From 58c0153030e822ab671b105ce7e73dc33ffb62d4 Mon Sep 17 00:00:00 2001 From: Akshar Patel Date: Thu, 13 Aug 2026 03:04:28 -0400 Subject: [PATCH] fix(registry): clear flowchart selection after click-away --- docs/catalog/blocks/flowchart-vertical.mdx | 12 ++---------- docs/catalog/blocks/flowchart.mdx | 12 ++---------- docs/public/catalog/blocks/flowchart-vertical.json | 2 +- docs/public/catalog/blocks/flowchart.json | 2 +- .../flowchart-vertical/flowchart-vertical.html | 12 ++---------- registry/blocks/flowchart/flowchart.html | 12 ++---------- 6 files changed, 10 insertions(+), 42 deletions(-) diff --git a/docs/catalog/blocks/flowchart-vertical.mdx b/docs/catalog/blocks/flowchart-vertical.mdx index 45df1fac1c..d1baf6b652 100644 --- a/docs/catalog/blocks/flowchart-vertical.mdx +++ b/docs/catalog/blocks/flowchart-vertical.mdx @@ -144,6 +144,7 @@ That writes one file: `compositions/flowchart-vertical.html`. /> +
Try no-code first @@ -335,7 +336,6 @@ That writes one file: `compositions/flowchart-vertical.html`. (function () { const tl = gsap.timeline({ paused: true }); const S = "#flowchart-vertical"; - const nodePython = document.querySelector(S + " #node-python"); const pythonText = document.querySelector(S + " #python-text"); // 1. Root node scales in @@ -406,15 +406,7 @@ That writes one file: `compositions/flowchart-vertical.html`. tl.to(S + " #cursor", { x: -1110, y: -1560, duration: 1, ease: "power1.inOut" }, "hold3"); // 10. Cursor clicks — selection border - tl.add(() => { - if (!nodePython) return; - if (!nodePython.querySelector(".selection-border")) { - const border = document.createElement("div"); - border.className = "selection-border"; - nodePython.appendChild(border); - } - gsap.set(S + " .selection-border", { opacity: 1 }); - }, "hold3+=1"); + tl.set(S + " .selection-border", { opacity: 1 }, "hold3+=1"); tl.to( S + " #cursor", diff --git a/docs/catalog/blocks/flowchart.mdx b/docs/catalog/blocks/flowchart.mdx index f1175f94ec..d0f7ec14f8 100644 --- a/docs/catalog/blocks/flowchart.mdx +++ b/docs/catalog/blocks/flowchart.mdx @@ -144,6 +144,7 @@ That writes one file: `compositions/flowchart.html`. />
+
Try no-code first @@ -335,7 +336,6 @@ That writes one file: `compositions/flowchart.html`. (function () { const tl = gsap.timeline({ paused: true }); const S = '[data-composition-id="flowchart"]'; - const nodePython = document.querySelector(S + " #node-python"); const pythonText = document.querySelector(S + " #python-text"); // 1. Root node scales in @@ -406,15 +406,7 @@ That writes one file: `compositions/flowchart.html`. tl.to(S + " #cursor", { x: -1470, y: -540, duration: 1, ease: "power1.inOut" }, "hold3"); // 10. Cursor clicks — selection border - tl.add(() => { - if (!nodePython) return; - if (!nodePython.querySelector(".selection-border")) { - const border = document.createElement("div"); - border.className = "selection-border"; - nodePython.appendChild(border); - } - gsap.set(S + " .selection-border", { opacity: 1 }); - }, "hold3+=1"); + tl.set(S + " .selection-border", { opacity: 1 }, "hold3+=1"); tl.to( S + " #cursor", diff --git a/docs/public/catalog/blocks/flowchart-vertical.json b/docs/public/catalog/blocks/flowchart-vertical.json index ad91852e6b..8cdd25b5ae 100644 --- a/docs/public/catalog/blocks/flowchart-vertical.json +++ b/docs/public/catalog/blocks/flowchart-vertical.json @@ -1 +1 @@ -{"html":"\n\n \n \n \n Flowchart Vertical\n \n \n \n \n \n \n \n \n
\n \n \n \n \n\n \n \n \n\n \n \n \n \n\n
Yes
\n
Not sure
\n\n \n
\n Should I learn to code?\n
\n\n \n
Yes
\n
Not sure
\n\n \n
\n
\n Start with Pythom\n \n \n \n
\n
\n
\n Try no-code first\n
\n
\n Build a personal website\n
\n
\n Take a free intro course\n
\n\n \n
\n \n \n \n
You
\n
\n\n \n
👍
\n\n \n
\n
\n\n \n\n \n
\n \n\n"} \ No newline at end of file +{"html":"\n\n \n \n \n Flowchart Vertical\n \n \n \n \n \n \n \n \n
\n \n \n \n \n\n \n \n \n\n \n \n \n \n\n
Yes
\n
Not sure
\n\n \n
\n Should I learn to code?\n
\n\n \n
Yes
\n
Not sure
\n\n \n
\n
\n Start with Pythom\n \n \n \n
\n
\n
\n
\n Try no-code first\n
\n
\n Build a personal website\n
\n
\n Take a free intro course\n
\n\n \n
\n \n \n \n
You
\n
\n\n \n
👍
\n\n \n
\n
\n\n \n\n \n \n \n\n"} \ No newline at end of file diff --git a/docs/public/catalog/blocks/flowchart.json b/docs/public/catalog/blocks/flowchart.json index 9ca0b524e0..ba2a0bbe89 100644 --- a/docs/public/catalog/blocks/flowchart.json +++ b/docs/public/catalog/blocks/flowchart.json @@ -1 +1 @@ -{"html":"\n\n \n \n \n Flowchart\n \n \n \n \n \n \n \n \n
\n \n \n \n \n\n \n \n \n\n \n \n \n \n\n
Yes
\n
Not sure
\n\n \n
\n Should I learn to code?\n
\n\n \n
Yes
\n
Not sure
\n\n \n
\n
\n Start with Pythom\n \n \n \n
\n
\n
\n Try no-code first\n
\n
\n Build a personal website\n
\n
\n Take a free intro course\n
\n\n \n
\n \n \n \n
You
\n
\n\n \n
👍
\n\n \n
\n
\n\n \n\n \n \n \n\n"} \ No newline at end of file +{"html":"\n\n \n \n \n Flowchart\n \n \n \n \n \n \n \n \n
\n \n \n \n \n\n \n \n \n\n \n \n \n \n\n
Yes
\n
Not sure
\n\n \n
\n Should I learn to code?\n
\n\n \n
Yes
\n
Not sure
\n\n \n
\n
\n Start with Pythom\n \n \n \n
\n
\n
\n
\n Try no-code first\n
\n
\n Build a personal website\n
\n
\n Take a free intro course\n
\n\n \n
\n \n \n \n
You
\n
\n\n \n
👍
\n\n \n
\n
\n\n \n\n \n \n \n\n"} \ No newline at end of file diff --git a/registry/blocks/flowchart-vertical/flowchart-vertical.html b/registry/blocks/flowchart-vertical/flowchart-vertical.html index 872a16d07e..c904fe47e4 100644 --- a/registry/blocks/flowchart-vertical/flowchart-vertical.html +++ b/registry/blocks/flowchart-vertical/flowchart-vertical.html @@ -119,6 +119,7 @@ /> +
Try no-code first @@ -310,7 +311,6 @@ (function () { const tl = gsap.timeline({ paused: true }); const S = "#flowchart-vertical"; - const nodePython = document.querySelector(S + " #node-python"); const pythonText = document.querySelector(S + " #python-text"); // 1. Root node scales in @@ -381,15 +381,7 @@ tl.to(S + " #cursor", { x: -1110, y: -1560, duration: 1, ease: "power1.inOut" }, "hold3"); // 10. Cursor clicks — selection border - tl.add(() => { - if (!nodePython) return; - if (!nodePython.querySelector(".selection-border")) { - const border = document.createElement("div"); - border.className = "selection-border"; - nodePython.appendChild(border); - } - gsap.set(S + " .selection-border", { opacity: 1 }); - }, "hold3+=1"); + tl.set(S + " .selection-border", { opacity: 1 }, "hold3+=1"); tl.to( S + " #cursor", diff --git a/registry/blocks/flowchart/flowchart.html b/registry/blocks/flowchart/flowchart.html index da31cbcac5..88cd257d37 100644 --- a/registry/blocks/flowchart/flowchart.html +++ b/registry/blocks/flowchart/flowchart.html @@ -119,6 +119,7 @@ />
+
Try no-code first @@ -310,7 +311,6 @@ (function () { const tl = gsap.timeline({ paused: true }); const S = '[data-composition-id="flowchart"]'; - const nodePython = document.querySelector(S + " #node-python"); const pythonText = document.querySelector(S + " #python-text"); // 1. Root node scales in @@ -381,15 +381,7 @@ tl.to(S + " #cursor", { x: -1470, y: -540, duration: 1, ease: "power1.inOut" }, "hold3"); // 10. Cursor clicks — selection border - tl.add(() => { - if (!nodePython) return; - if (!nodePython.querySelector(".selection-border")) { - const border = document.createElement("div"); - border.className = "selection-border"; - nodePython.appendChild(border); - } - gsap.set(S + " .selection-border", { opacity: 1 }); - }, "hold3+=1"); + tl.set(S + " .selection-border", { opacity: 1 }, "hold3+=1"); tl.to( S + " #cursor",