grab 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/chunk-AUCTCQDK.js +11 -0
  2. package/dist/chunk-BUGEJDSS.js +106 -0
  3. package/dist/chunk-DQF5UPS7.cjs +106 -0
  4. package/dist/{chunk-RC4NZFZ2.js → chunk-PHW64LYN.js} +2 -2
  5. package/dist/chunk-RL2PALRF.cjs +11 -0
  6. package/dist/{chunk-6ZQDLLHR.cjs → chunk-UBNTNO5I.cjs} +2 -2
  7. package/dist/core/index.cjs +1 -1
  8. package/dist/core/index.d.cts +1 -1
  9. package/dist/core/index.d.ts +1 -1
  10. package/dist/core/index.js +1 -1
  11. package/dist/design-system.cjs +1 -1
  12. package/dist/design-system.js +1 -1
  13. package/dist/{index-CNbOr8nS.d.cts → index-CNwr6CHX.d.cts} +11 -0
  14. package/dist/{index-CNbOr8nS.d.ts → index-CNwr6CHX.d.ts} +11 -0
  15. package/dist/index.cjs +2 -2
  16. package/dist/index.d.cts +2 -2
  17. package/dist/index.d.ts +2 -2
  18. package/dist/index.global.js +31 -31
  19. package/dist/index.js +1 -1
  20. package/dist/styles.css +1 -1
  21. package/package.json +2 -2
  22. package/dist/chunk-B7WRCPLA.cjs +0 -10
  23. package/dist/chunk-GJYSUTIS.cjs +0 -11
  24. package/dist/chunk-GR44JZAF.cjs +0 -8693
  25. package/dist/chunk-HX7TFX35.js +0 -11
  26. package/dist/chunk-MQPXIDNA.cjs +0 -106
  27. package/dist/chunk-NSWOAAF7.cjs +0 -2898
  28. package/dist/chunk-QCHSAPXI.cjs +0 -106
  29. package/dist/chunk-SS53RBM5.js +0 -5493
  30. package/dist/chunk-SXPKIMD2.js +0 -106
  31. package/dist/chunk-UATGYKWT.cjs +0 -5609
  32. package/dist/chunk-UPZX4BRF.js +0 -8677
  33. package/dist/chunk-WXVKFEIR.js +0 -10
  34. package/dist/chunk-XGWXDYKC.js +0 -1483
  35. package/dist/chunk-YLRWPBUP.js +0 -2896
  36. package/dist/chunk-ZIQID6NM.js +0 -106
  37. package/dist/chunk-ZOJKI2FW.cjs +0 -1483
@@ -1,2896 +0,0 @@
1
- import { delegateEvents, styles_default, render, createComponent, createSignal, onCleanup, template, use, insert, Show, For, createRenderEffect, style, setStyleProperty, memo, setAttribute, SelectionLabel, ContextMenu, onMount, addEventListener, cn, PANEL_STYLES, className, IconSelect, getToolbarIconColor, IconComment, IconChevron } from './chunk-SS53RBM5.js';
2
-
3
- /**
4
- * @license MIT
5
- *
6
- * Copyright (c) 2025 Aiden Bai
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
-
12
- // src/components/toolbar/toolbar-content.tsx
13
- var _tmpl$ = /* @__PURE__ */ template(`<button class="contain-layout flex items-center justify-center cursor-pointer interactive-scale touch-hitbox mr-1.5">`);
14
- var _tmpl$2 = /* @__PURE__ */ template(`<button class="contain-layout flex items-center justify-center cursor-pointer interactive-scale outline-none mx-0.5"><div><div>`);
15
- var _tmpl$3 = /* @__PURE__ */ template(`<button class="contain-layout shrink-0 flex items-center justify-center cursor-pointer interactive-scale">`);
16
- var _tmpl$4 = /* @__PURE__ */ template(`<div><div><div class="flex items-center min-w-0"><div><div class="relative overflow-visible min-w-0"></div></div><div><div class="relative overflow-visible min-w-0"></div></div><div class="relative shrink-0 overflow-visible">`);
17
- var ToolbarContent = (props) => {
18
- const edge = () => props.snapEdge ?? "bottom";
19
- const collapsedEdgeClasses = () => {
20
- if (!props.isCollapsed) return "";
21
- const roundedClass = {
22
- top: "rounded-t-none rounded-b-[10px]",
23
- bottom: "rounded-b-none rounded-t-[10px]",
24
- left: "rounded-l-none rounded-r-[10px]",
25
- right: "rounded-r-none rounded-l-[10px]"
26
- }[edge()];
27
- const paddingClass = edge() === "top" || edge() === "bottom" ? "px-2 py-0.25" : "px-0.25 py-2";
28
- return `${roundedClass} ${paddingClass}`;
29
- };
30
- const chevronRotation = () => {
31
- const collapsed = props.isCollapsed;
32
- switch (edge()) {
33
- case "top":
34
- return collapsed ? "rotate-180" : "rotate-0";
35
- case "bottom":
36
- return collapsed ? "rotate-0" : "rotate-180";
37
- case "left":
38
- return collapsed ? "rotate-90" : "-rotate-90";
39
- case "right":
40
- return collapsed ? "-rotate-90" : "rotate-90";
41
- default:
42
- return "rotate-0";
43
- }
44
- };
45
- const defaultSelectButton = () => (() => {
46
- var _el$ = _tmpl$();
47
- insert(_el$, createComponent(IconSelect, {
48
- size: 14,
49
- get ["class"]() {
50
- return cn("transition-colors", getToolbarIconColor(Boolean(props.isActive) && !props.isCommentMode, Boolean(props.isCommentMode)));
51
- }
52
- }));
53
- return _el$;
54
- })();
55
- const defaultCommentButton = () => (() => {
56
- var _el$2 = _tmpl$();
57
- insert(_el$2, createComponent(IconComment, {
58
- size: 14,
59
- get ["class"]() {
60
- return cn("transition-colors", getToolbarIconColor(Boolean(props.isCommentMode), Boolean(props.isActive) && !props.isCommentMode));
61
- }
62
- }));
63
- return _el$2;
64
- })();
65
- const defaultToggleButton = () => (() => {
66
- var _el$3 = _tmpl$2(), _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild;
67
- createRenderEffect((_p$) => {
68
- var _v$ = cn("relative w-5 h-3 rounded-full transition-colors", props.enabled ? "bg-black" : "bg-black/25"), _v$2 = cn("absolute top-0.5 w-2 h-2 rounded-full bg-white transition-transform", props.enabled ? "left-2.5" : "left-0.5");
69
- _v$ !== _p$.e && className(_el$4, _p$.e = _v$);
70
- _v$2 !== _p$.t && className(_el$5, _p$.t = _v$2);
71
- return _p$;
72
- }, {
73
- e: void 0,
74
- t: void 0
75
- });
76
- return _el$3;
77
- })();
78
- const defaultCollapseButton = () => (() => {
79
- var _el$6 = _tmpl$3();
80
- insert(_el$6, createComponent(IconChevron, {
81
- get ["class"]() {
82
- return cn("text-[#B3B3B3] transition-transform duration-150", chevronRotation());
83
- }
84
- }));
85
- return _el$6;
86
- })();
87
- return (() => {
88
- var _el$7 = _tmpl$4(), _el$8 = _el$7.firstChild, _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$0.firstChild, _el$10 = _el$0.nextSibling, _el$11 = _el$10.firstChild, _el$12 = _el$10.nextSibling;
89
- addEventListener(_el$7, "click", props.onPanelClick, true);
90
- addEventListener(_el$7, "animationend", props.onAnimationEnd);
91
- insert(_el$1, () => props.selectButton ?? defaultSelectButton());
92
- insert(_el$11, () => props.commentButton ?? defaultCommentButton());
93
- insert(_el$12, () => props.toggleButton ?? defaultToggleButton());
94
- insert(_el$7, () => props.collapseButton ?? defaultCollapseButton(), null);
95
- insert(_el$7, () => props.shakeTooltip, null);
96
- createRenderEffect((_p$) => {
97
- var _v$3 = cn("flex items-center justify-center rounded-[10px] antialiased transition-all duration-150 ease-out relative overflow-visible [font-synthesis:none] filter-[drop-shadow(0px_1px_2px_#51515140)] [corner-shape:superellipse(1.25)]", PANEL_STYLES, !props.isCollapsed && "py-1.5 gap-1.5 px-2", collapsedEdgeClasses(), props.isShaking && "animate-shake"), _v$4 = props.transformOrigin, _v$5 = cn("grid transition-all duration-150 ease-out", props.isCollapsed ? "grid-cols-[0fr] opacity-0" : "grid-cols-[1fr] opacity-100"), _v$6 = cn("grid transition-all duration-150 ease-out", props.enabled ? "grid-cols-[1fr] opacity-100" : "grid-cols-[0fr] opacity-0"), _v$7 = cn("grid transition-all duration-150 ease-out", props.enabled ? "grid-cols-[1fr] opacity-100" : "grid-cols-[0fr] opacity-0");
98
- _v$3 !== _p$.e && className(_el$7, _p$.e = _v$3);
99
- _v$4 !== _p$.t && setStyleProperty(_el$7, "transform-origin", _p$.t = _v$4);
100
- _v$5 !== _p$.a && className(_el$8, _p$.a = _v$5);
101
- _v$6 !== _p$.o && className(_el$0, _p$.o = _v$6);
102
- _v$7 !== _p$.i && className(_el$10, _p$.i = _v$7);
103
- return _p$;
104
- }, {
105
- e: void 0,
106
- t: void 0,
107
- a: void 0,
108
- o: void 0,
109
- i: void 0
110
- });
111
- return _el$7;
112
- })();
113
- };
114
- delegateEvents(["click"]);
115
-
116
- // src/design-system.tsx
117
- var _tmpl$5 = /* @__PURE__ */ template(`<span style=font-size:10px;font-weight:500>/`);
118
- var _tmpl$22 = /* @__PURE__ */ template(`<div style=display:flex;align-items:center;gap:8px;margin-top:8px><button style="display:flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;background-color:transparent;border-radius:4px;font-size:10px;cursor:pointer;flex-shrink:0;transition:all 0.15s ease"></button><input type=range min=0 style=flex:1;height:4px;cursor:pointer>`);
119
- var _tmpl$32 = /* @__PURE__ */ template(`<div>`);
120
- var _tmpl$42 = /* @__PURE__ */ template(`<div><div><div style=display:flex;flex-direction:column;gap:2px;flex:1;min-width:0><div style=display:flex;align-items:center;gap:6px><span style=font-size:13px;font-weight:500;line-height:1.3></span></div><span style=font-size:11px;line-height:1.3></span></div><div style=display:flex;align-items:center;gap:4px;flex-shrink:0><button style="display:flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;background-color:transparent;border-radius:4px;font-size:12px;cursor:pointer;transition:all 0.15s ease"></button><button title="Refresh this card"style="display:flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;background-color:transparent;border-radius:4px;font-size:12px;cursor:pointer;transition:all 0.15s ease">\u21BB</button></div></div><div>`);
121
- var _tmpl$52 = /* @__PURE__ */ template(`<div style="position:fixed;bottom:16px;right:16px;padding:6px 10px;border-radius:6px;font-family:ui-monospace, SFMono-Regular, monospace;font-size:12px;z-index:9999;backdrop-filter:blur(8px)"> FPS`);
122
- var _tmpl$6 = /* @__PURE__ */ template(`<div style="padding:16px 24px"><span style="color:rgba(250, 204, 21, 0.8)">\u2605 Starred (<!>)</span><div>`);
123
- var _tmpl$7 = /* @__PURE__ */ template(`<div style="padding:16px 24px"><span>Flows</span><div>`);
124
- var _tmpl$8 = /* @__PURE__ */ template(`<div style="padding:16px 24px"><span>Selection Label</span><div>`);
125
- var _tmpl$9 = /* @__PURE__ */ template(`<div style="padding:16px 24px"><span>Context Menu (Right-Click)</span><div>`);
126
- var _tmpl$0 = /* @__PURE__ */ template(`<div style="padding:16px 24px"><span>Toolbar</span><div>`);
127
- var _tmpl$1 = /* @__PURE__ */ template(`<div style="padding:16px 24px"><span>Agent States</span><div>`);
128
- var _tmpl$10 = /* @__PURE__ */ template(`<div style="padding:48px 24px;text-align:center"><span style=font-size:14px>No states match "<!>"`);
129
- var _tmpl$11 = /* @__PURE__ */ template(`<div style="display:flex;flex-direction:column;min-height:100vh;font-family:Geist, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif;transition:background-color 0.15s ease"><div style="display:flex;justify-content:space-between;align-items:center;padding:16px 24px"><div style=display:flex;align-items:center;gap:10px><svg width=24 height=24 viewBox="0 0 294 294"fill=none xmlns=http://www.w3.org/2000/svg><g clip-path=url(#clip0_logo)><mask id=mask0_logo maskUnits=userSpaceOnUse x=0 y=0 width=294 height=294 style=mask-type:luminance><path d="M294 0H0V294H294V0Z"fill=white></path></mask><g mask=url(#mask0_logo)><path d="M144.599 47.4924C169.712 27.3959 194.548 20.0265 212.132 30.1797C227.847 39.2555 234.881 60.3243 231.926 89.516C231.677 92.0069 231.328 94.5423 230.94 97.1058L228.526 110.14C228.517 110.136 228.505 110.132 228.495 110.127C228.486 110.165 228.479 110.203 228.468 110.24L216.255 105.741C216.256 105.736 216.248 105.728 216.248 105.723C207.915 103.125 199.421 101.075 190.82 99.5888L190.696 99.5588L173.526 97.2648L173.511 97.2631C173.492 97.236 173.467 97.2176 173.447 97.1905C163.862 96.2064 154.233 95.7166 144.599 95.7223C134.943 95.7162 125.295 96.219 115.693 97.2286C110.075 105.033 104.859 113.118 100.063 121.453C95.2426 129.798 90.8624 138.391 86.939 147.193C90.8624 155.996 95.2426 164.588 100.063 172.933C104.866 181.302 110.099 189.417 115.741 197.245C115.749 197.245 115.758 197.246 115.766 197.247L115.752 197.27L115.745 197.283L115.754 197.296L126.501 211.013L126.574 211.089C132.136 217.767 138.126 224.075 144.507 229.974L144.609 230.082L154.572 238.287C154.539 238.319 154.506 238.35 154.472 238.38C154.485 238.392 154.499 238.402 154.513 238.412L143.846 247.482L143.827 247.497C126.56 261.128 109.472 268.745 94.8019 268.745C88.5916 268.837 82.4687 267.272 77.0657 264.208C61.3496 255.132 54.3164 234.062 57.2707 204.871C57.528 202.307 57.8806 199.694 58.2904 197.054C28.3363 185.327 9.52301 167.51 9.52301 147.193C9.52301 129.042 24.2476 112.396 50.9901 100.375C53.3443 99.3163 55.7938 98.3058 58.2904 97.3526C57.8806 94.7023 57.528 92.0803 57.2707 89.516C54.3164 60.3243 61.3496 39.2555 77.0657 30.1797C94.6494 20.0265 119.486 27.3959 144.599 47.4924ZM70.6423 201.315C70.423 202.955 70.2229 204.566 70.0704 206.168C67.6686 229.567 72.5478 246.628 83.3615 252.988L83.5176 253.062C95.0399 259.717 114.015 254.426 134.782 238.38C125.298 229.45 116.594 219.725 108.764 209.314C95.8516 207.742 83.0977 205.066 70.6423 201.315ZM80.3534 163.438C77.34 171.677 74.8666 180.104 72.9484 188.664C81.1787 191.224 89.5657 193.247 98.0572 194.724L98.4618 194.813C95.2115 189.865 92.0191 184.66 88.9311 179.378C85.8433 174.097 83.003 168.768 80.3534 163.438ZM60.759 110.203C59.234 110.839 57.7378 111.475 56.27 112.11C34.7788 121.806 22.3891 134.591 22.3891 147.193C22.3891 160.493 36.4657 174.297 60.7494 184.26C63.7439 171.581 67.8124 159.182 72.9104 147.193C67.822 135.23 63.7566 122.855 60.759 110.203ZM98.4137 99.6404C89.8078 101.145 81.3075 103.206 72.9676 105.809C74.854 114.203 77.2741 122.468 80.2132 130.554L80.3059 130.939C82.9938 125.6 85.8049 120.338 88.8834 115.008C91.9618 109.679 95.1544 104.569 98.4137 99.6404ZM94.9258 38.5215C90.9331 38.4284 86.9866 39.3955 83.4891 41.3243C72.6291 47.6015 67.6975 64.5954 70.0424 87.9446L70.0416 88.2194C70.194 89.8208 70.3941 91.4325 70.6134 93.0624C83.0737 89.3364 95.8263 86.6703 108.736 85.0924C116.57 74.6779 125.28 64.9532 134.773 56.0249C119.877 44.5087 105.895 38.5215 94.9258 38.5215ZM205.737 41.3148C202.268 39.398 198.355 38.4308 194.394 38.5099L194.29 38.512C183.321 38.512 169.34 44.4991 154.444 56.0153C163.93 64.9374 172.634 74.6557 180.462 85.064C193.375 86.6345 206.128 89.3102 218.584 93.0624C218.812 91.4325 219.003 89.8118 219.165 88.2098C221.548 64.7099 216.65 47.6164 205.737 41.3148ZM144.552 64.3097C138.104 70.2614 132.054 76.6306 126.443 83.3765C132.39 82.995 138.426 82.8046 144.552 82.8046C150.727 82.8046 156.778 83.0143 162.707 83.3765C157.08 76.6293 151.015 70.2596 144.552 64.3097Z"></path><path d="M144.598 47.4924C169.712 27.3959 194.547 20.0265 212.131 30.1797C227.847 39.2555 234.88 60.3243 231.926 89.516C231.677 92.0069 231.327 94.5423 230.941 97.1058L228.526 110.14L228.496 110.127C228.487 110.165 228.478 110.203 228.469 110.24L216.255 105.741L216.249 105.723C207.916 103.125 199.42 101.075 190.82 99.5888L190.696 99.5588L173.525 97.2648L173.511 97.263C173.492 97.236 173.468 97.2176 173.447 97.1905C163.863 96.2064 154.234 95.7166 144.598 95.7223C134.943 95.7162 125.295 96.219 115.693 97.2286C110.075 105.033 104.859 113.118 100.063 121.453C95.2426 129.798 90.8622 138.391 86.939 147.193C90.8622 155.996 95.2426 164.588 100.063 172.933C104.866 181.302 110.099 189.417 115.741 197.245L115.766 197.247L115.752 197.27L115.745 197.283L115.754 197.296L126.501 211.013L126.574 211.089C132.136 217.767 138.126 224.075 144.506 229.974L144.61 230.082L154.572 238.287C154.539 238.319 154.506 238.35 154.473 238.38L154.512 238.412L143.847 247.482L143.827 247.497C126.56 261.13 109.472 268.745 94.8018 268.745C88.5915 268.837 82.4687 267.272 77.0657 264.208C61.3496 255.132 54.3162 234.062 57.2707 204.871C57.528 202.307 57.8806 199.694 58.2904 197.054C28.3362 185.327 9.52298 167.51 9.52298 147.193C9.52298 129.042 24.2476 112.396 50.9901 100.375C53.3443 99.3163 55.7938 98.3058 58.2904 97.3526C57.8806 94.7023 57.528 92.0803 57.2707 89.516C54.3162 60.3243 61.3496 39.2555 77.0657 30.1797C94.6493 20.0265 119.486 27.3959 144.598 47.4924ZM70.6422 201.315C70.423 202.955 70.2229 204.566 70.0704 206.168C67.6686 229.567 72.5478 246.628 83.3615 252.988L83.5175 253.062C95.0399 259.717 114.015 254.426 134.782 238.38C125.298 229.45 116.594 219.725 108.764 209.314C95.8515 207.742 83.0977 205.066 70.6422 201.315ZM80.3534 163.438C77.34 171.677 74.8666 180.104 72.9484 188.664C81.1786 191.224 89.5657 193.247 98.0572 194.724L98.4618 194.813C95.2115 189.865 92.0191 184.66 88.931 179.378C85.8433 174.097 83.003 168.768 80.3534 163.438ZM60.7589 110.203C59.234 110.839 57.7378 111.475 56.2699 112.11C34.7788 121.806 22.3891 134.591 22.3891 147.193C22.3891 160.493 36.4657 174.297 60.7494 184.26C63.7439 171.581 67.8124 159.182 72.9103 147.193C67.822 135.23 63.7566 122.855 60.7589 110.203ZM98.4137 99.6404C89.8078 101.145 81.3075 103.206 72.9676 105.809C74.8539 114.203 77.2741 122.468 80.2132 130.554L80.3059 130.939C82.9938 125.6 85.8049 120.338 88.8834 115.008C91.9618 109.679 95.1544 104.569 98.4137 99.6404ZM94.9258 38.5215C90.9331 38.4284 86.9866 39.3955 83.4891 41.3243C72.629 47.6015 67.6975 64.5954 70.0424 87.9446L70.0415 88.2194C70.194 89.8208 70.3941 91.4325 70.6134 93.0624C83.0737 89.3364 95.8262 86.6703 108.736 85.0924C116.57 74.6779 125.28 64.9532 134.772 56.0249C119.877 44.5087 105.895 38.5215 94.9258 38.5215ZM205.737 41.3148C202.268 39.398 198.355 38.4308 194.394 38.5099L194.291 38.512C183.321 38.512 169.34 44.4991 154.443 56.0153C163.929 64.9374 172.634 74.6557 180.462 85.064C193.374 86.6345 206.129 89.3102 218.584 93.0624C218.813 91.4325 219.003 89.8118 219.166 88.2098C221.548 64.7099 216.65 47.6164 205.737 41.3148ZM144.551 64.3097C138.103 70.2614 132.055 76.6306 126.443 83.3765C132.389 82.995 138.427 82.8046 144.551 82.8046C150.727 82.8046 156.779 83.0143 162.707 83.3765C157.079 76.6293 151.015 70.2596 144.551 64.3097Z"fill=#FF40E0></path></g><mask id=mask1_logo maskUnits=userSpaceOnUse x=102 y=84 width=161 height=162 style=mask-type:luminance><path d="M235.282 84.827L102.261 112.259L129.693 245.28L262.714 217.848L235.282 84.827Z"fill=white></path></mask><g mask=url(#mask1_logo)><path d="M136.863 129.916L213.258 141.224C220.669 142.322 222.495 152.179 215.967 155.856L187.592 171.843L184.135 204.227C183.339 211.678 173.564 213.901 169.624 207.526L129.021 141.831C125.503 136.14 130.245 128.936 136.863 129.916Z"fill=#FF40E0 stroke=#FF40E0 stroke-width=0.817337 stroke-linecap=round stroke-linejoin=round></path></g></g><defs><clipPath id=clip0_logo><rect width=294 height=294 fill=white></rect></clipPath></defs></svg><span style=font-size:14px;font-weight:600;letter-spacing:-0.01em>Design System</span></div><div style=display:flex;align-items:center;gap:8px;flex:1;max-width:400px><input type=text placeholder="Search states\u2026"style="flex:1;padding:6px 12px;border-radius:6px;font-size:13px;font-family:inherit;outline:none;transition:all 0.15s ease"></div><div style=display:flex;align-items:center;gap:8px><button></button><button>\u21BB Refresh</button><button>`);
130
- var DESIGN_SYSTEM_STATES = [
131
- // ══════════════════════════════════════════════════════════════════════════
132
- // SELECTION LABEL STATES
133
- // ══════════════════════════════════════════════════════════════════════════
134
- // === IDLE STATES ===
135
- {
136
- id: "idle-default",
137
- label: "Idle (Default)",
138
- description: 'TagBadge + "Click to Copy"',
139
- component: "label",
140
- props: {
141
- tagName: "button",
142
- componentName: "Button",
143
- status: "idle",
144
- hasAgent: false
145
- }
146
- },
147
- {
148
- id: "idle-with-filepath",
149
- label: "Idle (With File Path)",
150
- description: "Clickable tag badge with open icon",
151
- component: "label",
152
- props: {
153
- tagName: "div",
154
- componentName: "Header",
155
- status: "idle",
156
- hasAgent: false,
157
- filePath: "src/components/Header.tsx"
158
- }
159
- },
160
- {
161
- id: "idle-context-menu-open",
162
- label: "Idle (Context Menu Open)",
163
- description: "Open indicator icon visible",
164
- component: "label",
165
- props: {
166
- tagName: "main",
167
- componentName: "Main",
168
- status: "idle",
169
- hasAgent: false,
170
- isContextMenuOpen: true,
171
- filePath: "src/components/Main.tsx"
172
- }
173
- },
174
- {
175
- id: "idle-multi-element",
176
- label: "Idle (Multi-Element)",
177
- description: 'Shows "3 elements" instead of tag',
178
- component: "label",
179
- props: {
180
- tagName: "div",
181
- elementsCount: 3,
182
- status: "idle",
183
- hasAgent: false
184
- }
185
- },
186
- {
187
- id: "idle-tag-only",
188
- label: "Idle (Tag Only)",
189
- description: "HTML tag without component name",
190
- component: "label",
191
- props: {
192
- tagName: "section",
193
- status: "idle",
194
- hasAgent: false
195
- }
196
- },
197
- {
198
- id: "idle-long-component-name",
199
- label: "Idle (Long Component)",
200
- description: "Very long component name truncation",
201
- component: "label",
202
- props: {
203
- tagName: "div",
204
- componentName: "SuperLongComponentNameThatShouldDefinitelyTruncate",
205
- status: "idle",
206
- hasAgent: false
207
- }
208
- },
209
- {
210
- id: "idle-long-tag-name",
211
- label: "Idle (Long Tag)",
212
- description: "Long custom element tag name",
213
- component: "label",
214
- props: {
215
- tagName: "my-super-long-custom-web-component-element",
216
- status: "idle",
217
- hasAgent: false
218
- }
219
- },
220
- {
221
- id: "idle-long-filepath",
222
- label: "Idle (Long File Path)",
223
- description: "Deeply nested file path truncation",
224
- component: "label",
225
- props: {
226
- tagName: "div",
227
- componentName: "Button",
228
- status: "idle",
229
- hasAgent: false,
230
- filePath: "src/components/ui/forms/inputs/buttons/primary/PrimaryButton.tsx"
231
- }
232
- },
233
- {
234
- id: "idle-large-element-count",
235
- label: "Idle (Large Count)",
236
- description: "Many elements selected (99)",
237
- component: "label",
238
- props: {
239
- tagName: "div",
240
- elementsCount: 99,
241
- status: "idle",
242
- hasAgent: false
243
- }
244
- },
245
- {
246
- id: "idle-long-both",
247
- label: "Idle (Long Tag + Component)",
248
- description: "Both tag and component name long",
249
- component: "label",
250
- props: {
251
- tagName: "custom-interactive-element",
252
- componentName: "InteractiveCustomElementWrapper",
253
- status: "idle",
254
- hasAgent: false,
255
- filePath: "src/wrappers/InteractiveCustomElementWrapper.tsx"
256
- }
257
- },
258
- {
259
- id: "idle-agent-not-connected",
260
- label: "Idle (Agent Not Connected)",
261
- description: "Agent available but not connected",
262
- component: "label",
263
- props: {
264
- tagName: "div",
265
- componentName: "Panel",
266
- status: "idle",
267
- hasAgent: true,
268
- isAgentConnected: false
269
- }
270
- },
271
- // === PROMPT MODE STATES ===
272
- {
273
- id: "prompt-empty",
274
- label: "Prompt (Empty)",
275
- description: "Input field ready for typing",
276
- component: "label",
277
- props: {
278
- tagName: "div",
279
- componentName: "Card",
280
- status: "idle",
281
- hasAgent: true,
282
- isAgentConnected: true,
283
- isPromptMode: true,
284
- inputValue: ""
285
- }
286
- },
287
- {
288
- id: "prompt-with-text",
289
- label: "Prompt (With Text)",
290
- description: "Input field with user text",
291
- component: "label",
292
- props: {
293
- tagName: "form",
294
- componentName: "Form",
295
- status: "idle",
296
- hasAgent: true,
297
- isAgentConnected: true,
298
- isPromptMode: true,
299
- inputValue: "make the button larger"
300
- }
301
- },
302
- {
303
- id: "prompt-with-reply",
304
- label: "Prompt (Reply Mode)",
305
- description: 'Shows "previously:" quote above input',
306
- component: "label",
307
- props: {
308
- tagName: "span",
309
- componentName: "Text",
310
- status: "idle",
311
- hasAgent: true,
312
- isAgentConnected: true,
313
- isPromptMode: true,
314
- inputValue: "now make it blue",
315
- replyToPrompt: "make the button larger"
316
- }
317
- },
318
- {
319
- id: "prompt-multiline",
320
- label: "Prompt (Multi-line)",
321
- description: "Long text that wraps to multiple lines",
322
- component: "label",
323
- props: {
324
- tagName: "div",
325
- componentName: "Container",
326
- status: "idle",
327
- hasAgent: true,
328
- isAgentConnected: true,
329
- isPromptMode: true,
330
- inputValue: "make the button bigger and change the background color to a nice gradient from blue to purple"
331
- }
332
- },
333
- {
334
- id: "prompt-long-reply",
335
- label: "Prompt (Long Previous)",
336
- description: "Long previously: text that truncates",
337
- component: "label",
338
- props: {
339
- tagName: "button",
340
- componentName: "Submit",
341
- status: "idle",
342
- hasAgent: true,
343
- isAgentConnected: true,
344
- isPromptMode: true,
345
- inputValue: "also add rounded corners",
346
- replyToPrompt: "make the button larger and add a hover effect with a nice shadow underneath it"
347
- }
348
- },
349
- {
350
- id: "pending-dismiss",
351
- label: "Pending Dismiss",
352
- description: '"Discard?" confirmation dialog',
353
- component: "label",
354
- props: {
355
- tagName: "header",
356
- componentName: "Header",
357
- status: "idle",
358
- hasAgent: true,
359
- isPromptMode: true,
360
- isPendingDismiss: true
361
- }
362
- },
363
- // === COPYING STATES ===
364
- {
365
- id: "copying-simple",
366
- label: "Copying (Simple)",
367
- description: '"Grabbing..." with pulse animation',
368
- component: "label",
369
- props: {
370
- tagName: "input",
371
- componentName: "TextField",
372
- status: "copying",
373
- hasAgent: false,
374
- statusText: "Grabbing\u2026"
375
- }
376
- },
377
- {
378
- id: "copying-with-prompt",
379
- label: "Copying (With Prompt)",
380
- description: "Disabled input + stop button",
381
- component: "label",
382
- props: {
383
- tagName: "section",
384
- componentName: "Section",
385
- status: "copying",
386
- hasAgent: true,
387
- isAgentConnected: true,
388
- inputValue: "add form validation",
389
- statusText: "Thinking\u2026"
390
- }
391
- },
392
- {
393
- id: "pending-abort",
394
- label: "Pending Abort",
395
- description: '"Discard?" during copy operation',
396
- component: "label",
397
- props: {
398
- tagName: "article",
399
- componentName: "Article",
400
- status: "copying",
401
- hasAgent: true,
402
- isPendingAbort: true
403
- }
404
- },
405
- {
406
- id: "copying-applying",
407
- label: "Copying (Applying)",
408
- description: '"Applying changes\u2026" status variant',
409
- component: "label",
410
- props: {
411
- tagName: "form",
412
- componentName: "LoginForm",
413
- status: "copying",
414
- hasAgent: true,
415
- isAgentConnected: true,
416
- inputValue: "add validation",
417
- statusText: "Applying changes\u2026"
418
- }
419
- },
420
- {
421
- id: "copying-analyzing",
422
- label: "Copying (Analyzing)",
423
- description: '"Analyzing\u2026" status variant',
424
- component: "label",
425
- props: {
426
- tagName: "table",
427
- componentName: "DataTable",
428
- status: "copying",
429
- hasAgent: true,
430
- isAgentConnected: true,
431
- inputValue: "make columns sortable",
432
- statusText: "Analyzing\u2026"
433
- }
434
- },
435
- {
436
- id: "copying-long-input",
437
- label: "Copying (Long Input)",
438
- description: "Long prompt during copying",
439
- component: "label",
440
- props: {
441
- tagName: "div",
442
- componentName: "Modal",
443
- status: "copying",
444
- hasAgent: true,
445
- isAgentConnected: true,
446
- inputValue: "add a close button in the top right corner with an X icon and make it dismiss the modal when clicked",
447
- statusText: "Thinking\u2026"
448
- }
449
- },
450
- {
451
- id: "copying-long-component",
452
- label: "Copying (Long Component)",
453
- description: "Long component name while copying",
454
- component: "label",
455
- props: {
456
- tagName: "div",
457
- componentName: "InteractiveDataVisualizationChart",
458
- status: "copying",
459
- hasAgent: true,
460
- isAgentConnected: true,
461
- inputValue: "add tooltips",
462
- statusText: "Applying\u2026"
463
- }
464
- },
465
- // === COMPLETION STATES ===
466
- {
467
- id: "copied-simple",
468
- label: "Copied (Simple)",
469
- description: 'Checkmark + "Copied" text only',
470
- component: "label",
471
- props: {
472
- tagName: "nav",
473
- componentName: "Navigation",
474
- status: "copied",
475
- hasAgent: false,
476
- hasOnDismiss: false,
477
- hasOnUndo: false
478
- }
479
- },
480
- {
481
- id: "copied-with-actions",
482
- label: "Copied (With Actions)",
483
- description: "Undo + Keep buttons",
484
- component: "label",
485
- props: {
486
- tagName: "footer",
487
- componentName: "Footer",
488
- status: "copied",
489
- hasAgent: true,
490
- isAgentConnected: true,
491
- statusText: "Applied changes",
492
- supportsUndo: true
493
- }
494
- },
495
- {
496
- id: "copied-with-followup",
497
- label: "Copied (With Follow-up)",
498
- description: "Follow-up input field below",
499
- component: "label",
500
- props: {
501
- tagName: "aside",
502
- componentName: "Sidebar",
503
- status: "copied",
504
- hasAgent: true,
505
- isAgentConnected: true,
506
- statusText: "Done",
507
- supportsUndo: true,
508
- supportsFollowUp: true
509
- }
510
- },
511
- {
512
- id: "copied-no-dismiss",
513
- label: "Copied (No Dismiss)",
514
- description: "Checkmark + status only, no Keep button",
515
- component: "label",
516
- props: {
517
- tagName: "span",
518
- componentName: "Badge",
519
- status: "copied",
520
- hasAgent: true,
521
- isAgentConnected: true,
522
- statusText: "Applied",
523
- hasOnDismiss: false
524
- }
525
- },
526
- {
527
- id: "copied-no-undo",
528
- label: "Copied (No Undo)",
529
- description: "Keep button but no Undo",
530
- component: "label",
531
- props: {
532
- tagName: "li",
533
- componentName: "ListItem",
534
- status: "copied",
535
- hasAgent: true,
536
- isAgentConnected: true,
537
- statusText: "Changes saved",
538
- supportsUndo: false
539
- }
540
- },
541
- {
542
- id: "copied-with-more-options",
543
- label: "Copied (More Options)",
544
- description: "Ellipsis button for context menu",
545
- component: "label",
546
- props: {
547
- tagName: "div",
548
- componentName: "Widget",
549
- status: "copied",
550
- hasAgent: true,
551
- isAgentConnected: true,
552
- statusText: "Updated",
553
- supportsUndo: true,
554
- showMoreOptions: true
555
- }
556
- },
557
- {
558
- id: "copied-custom-dismiss",
559
- label: "Copied (Custom Dismiss)",
560
- description: '"Accept" instead of "Keep"',
561
- component: "label",
562
- props: {
563
- tagName: "section",
564
- componentName: "Hero",
565
- status: "copied",
566
- hasAgent: true,
567
- isAgentConnected: true,
568
- statusText: "Ready",
569
- supportsUndo: true,
570
- dismissButtonText: "Accept"
571
- }
572
- },
573
- {
574
- id: "copied-followup-placeholder",
575
- label: "Copied (Follow-up Placeholder)",
576
- description: "Previous prompt as placeholder",
577
- component: "label",
578
- props: {
579
- tagName: "header",
580
- componentName: "TopBar",
581
- status: "copied",
582
- hasAgent: true,
583
- isAgentConnected: true,
584
- statusText: "Done",
585
- supportsUndo: true,
586
- supportsFollowUp: true,
587
- previousPrompt: "make it bigger"
588
- }
589
- },
590
- // === AGENT EDGE CASES ===
591
- {
592
- id: "agent-long-component",
593
- label: "Agent (Long Component)",
594
- description: "Long component name with prompt",
595
- component: "label",
596
- props: {
597
- tagName: "div",
598
- componentName: "VeryLongComponentNameThatShouldTruncateInTheUI",
599
- status: "idle",
600
- hasAgent: true,
601
- isAgentConnected: true,
602
- isPromptMode: true,
603
- inputValue: ""
604
- }
605
- },
606
- {
607
- id: "agent-long-status",
608
- label: "Agent (Long Status)",
609
- description: "Very long status text during operation",
610
- component: "label",
611
- props: {
612
- tagName: "form",
613
- componentName: "SearchForm",
614
- status: "copying",
615
- hasAgent: true,
616
- isAgentConnected: true,
617
- inputValue: "add validation",
618
- statusText: "Analyzing component structure and dependencies\u2026"
619
- }
620
- },
621
- {
622
- id: "agent-long-previous",
623
- label: "Agent (Long Previous Prompt)",
624
- description: "Very long previous prompt truncation",
625
- component: "label",
626
- props: {
627
- tagName: "div",
628
- componentName: "Card",
629
- status: "idle",
630
- hasAgent: true,
631
- isAgentConnected: true,
632
- isPromptMode: true,
633
- inputValue: "and also fix the spacing",
634
- replyToPrompt: "make the card have rounded corners with a subtle shadow and increase the padding on all sides to make it feel more spacious"
635
- }
636
- },
637
- {
638
- id: "agent-copied-long-status",
639
- label: "Agent Copied (Long Status)",
640
- description: "Long completion status message",
641
- component: "label",
642
- props: {
643
- tagName: "section",
644
- componentName: "HeroSection",
645
- status: "copied",
646
- hasAgent: true,
647
- isAgentConnected: true,
648
- statusText: "Successfully applied 5 changes across 3 files",
649
- supportsUndo: true,
650
- supportsFollowUp: true
651
- }
652
- },
653
- {
654
- id: "agent-copied-long-placeholder",
655
- label: "Agent Copied (Long Placeholder)",
656
- description: "Long previous prompt as placeholder",
657
- component: "label",
658
- props: {
659
- tagName: "nav",
660
- componentName: "Navbar",
661
- status: "copied",
662
- hasAgent: true,
663
- isAgentConnected: true,
664
- statusText: "Done",
665
- supportsUndo: true,
666
- supportsFollowUp: true,
667
- previousPrompt: "make the navbar sticky with a blur background effect and add smooth scroll behavior"
668
- }
669
- },
670
- {
671
- id: "agent-all-features",
672
- label: "Agent (All Features)",
673
- description: "Undo + Follow-up + More options",
674
- component: "label",
675
- props: {
676
- tagName: "div",
677
- componentName: "Dashboard",
678
- status: "copied",
679
- hasAgent: true,
680
- isAgentConnected: true,
681
- statusText: "Applied changes",
682
- supportsUndo: true,
683
- supportsFollowUp: true,
684
- showMoreOptions: true,
685
- previousPrompt: "add dark mode"
686
- }
687
- },
688
- {
689
- id: "agent-single-char-component",
690
- label: "Agent (Single Char)",
691
- description: "Single character component name",
692
- component: "label",
693
- props: {
694
- tagName: "i",
695
- componentName: "I",
696
- status: "idle",
697
- hasAgent: true,
698
- isAgentConnected: true,
699
- isPromptMode: true,
700
- inputValue: ""
701
- }
702
- },
703
- {
704
- id: "agent-numeric-component",
705
- label: "Agent (Numeric Name)",
706
- description: "Component name with numbers",
707
- component: "label",
708
- props: {
709
- tagName: "div",
710
- componentName: "Card2024V2",
711
- status: "idle",
712
- hasAgent: true,
713
- isAgentConnected: true,
714
- isPromptMode: true,
715
- inputValue: "update the styles"
716
- }
717
- },
718
- // === ERROR STATES ===
719
- {
720
- id: "error",
721
- label: "Error",
722
- description: "Error message with Retry + Ok",
723
- component: "label",
724
- props: {
725
- tagName: "dialog",
726
- componentName: "Modal",
727
- status: "error",
728
- error: "Failed to copy element"
729
- }
730
- },
731
- {
732
- id: "error-retry-only",
733
- label: "Error (Retry Only)",
734
- description: "Retry button, no Ok",
735
- component: "label",
736
- props: {
737
- tagName: "form",
738
- componentName: "Search",
739
- status: "error",
740
- error: "Connection timeout",
741
- hasOnRetry: true,
742
- hasOnAcknowledge: false
743
- }
744
- },
745
- {
746
- id: "error-ok-only",
747
- label: "Error (Ok Only)",
748
- description: "Ok button, no Retry",
749
- component: "label",
750
- props: {
751
- tagName: "div",
752
- componentName: "Alert",
753
- status: "error",
754
- error: "Operation cancelled",
755
- hasOnRetry: false,
756
- hasOnAcknowledge: true
757
- }
758
- },
759
- {
760
- id: "error-long-message",
761
- label: "Error (Long Message)",
762
- description: "Truncated error > 50 chars",
763
- component: "label",
764
- props: {
765
- tagName: "section",
766
- componentName: "Dashboard",
767
- status: "error",
768
- error: "The server returned an unexpected error response. Please check your network connection and try again later."
769
- }
770
- },
771
- {
772
- id: "error-long-component",
773
- label: "Error (Long Component)",
774
- description: "Error with long component name",
775
- component: "label",
776
- props: {
777
- tagName: "div",
778
- componentName: "VeryLongComponentNameThatMightOverflow",
779
- status: "error",
780
- error: "Component not found"
781
- }
782
- },
783
- {
784
- id: "error-no-buttons",
785
- label: "Error (No Buttons)",
786
- description: "Error with no action buttons",
787
- component: "label",
788
- props: {
789
- tagName: "span",
790
- componentName: "Text",
791
- status: "error",
792
- error: "Unknown error occurred",
793
- hasOnRetry: false,
794
- hasOnAcknowledge: false
795
- }
796
- },
797
- // ══════════════════════════════════════════════════════════════════════════
798
- // CONTEXT MENU STATES (Right-Click Menu)
799
- // ══════════════════════════════════════════════════════════════════════════
800
- {
801
- id: "context-menu-basic",
802
- label: "Context Menu (Basic)",
803
- description: "Copy, Copy HTML options",
804
- component: "context-menu",
805
- props: {
806
- tagName: "button",
807
- componentName: "Button",
808
- hasFilePath: false
809
- }
810
- },
811
- {
812
- id: "context-menu-with-open",
813
- label: "Context Menu (With Open)",
814
- description: "Includes Open option with file path",
815
- component: "context-menu",
816
- props: {
817
- tagName: "div",
818
- componentName: "Header",
819
- hasFilePath: true,
820
- filePath: "src/components/Header.tsx"
821
- }
822
- },
823
- {
824
- id: "context-menu-tag-only",
825
- label: "Context Menu (Tag Only)",
826
- description: "HTML tag without component name",
827
- component: "context-menu",
828
- props: {
829
- tagName: "section",
830
- hasFilePath: false
831
- }
832
- },
833
- {
834
- id: "context-menu-long-component",
835
- label: "Context Menu (Long Name)",
836
- description: "Long component name in header",
837
- component: "context-menu",
838
- props: {
839
- tagName: "div",
840
- componentName: "SuperLongComponentNameThatNeedsTruncation",
841
- hasFilePath: true,
842
- filePath: "src/components/SuperLongComponentNameThatNeedsTruncation.tsx"
843
- }
844
- },
845
- {
846
- id: "context-menu-long-tag",
847
- label: "Context Menu (Long Tag)",
848
- description: "Long custom element tag",
849
- component: "context-menu",
850
- props: {
851
- tagName: "my-custom-interactive-web-component",
852
- hasFilePath: false
853
- }
854
- },
855
- // ══════════════════════════════════════════════════════════════════════════
856
- // TOOLBAR STATES
857
- // ══════════════════════════════════════════════════════════════════════════
858
- {
859
- id: "toolbar-default",
860
- label: "Toolbar (Default)",
861
- description: "Inactive, enabled state",
862
- component: "toolbar",
863
- props: {
864
- isToolbarActive: false,
865
- isToolbarEnabled: true
866
- }
867
- },
868
- {
869
- id: "toolbar-active",
870
- label: "Toolbar (Active)",
871
- description: "Selection mode active",
872
- component: "toolbar",
873
- props: {
874
- isToolbarActive: true,
875
- isToolbarEnabled: true
876
- }
877
- },
878
- {
879
- id: "toolbar-disabled",
880
- label: "Toolbar (Disabled)",
881
- description: "Toggle switch off",
882
- component: "toolbar",
883
- props: {
884
- isToolbarActive: false,
885
- isToolbarEnabled: false
886
- }
887
- },
888
- {
889
- id: "toolbar-active-disabled",
890
- label: "Toolbar (Active + Disabled)",
891
- description: "Active but toggle off",
892
- component: "toolbar",
893
- props: {
894
- isToolbarActive: true,
895
- isToolbarEnabled: false
896
- }
897
- },
898
- {
899
- id: "toolbar-comment-mode",
900
- label: "Toolbar (Comment Mode)",
901
- description: "Comment selection mode active",
902
- component: "toolbar",
903
- props: {
904
- isToolbarActive: true,
905
- isToolbarCommentMode: true,
906
- isToolbarEnabled: true
907
- }
908
- },
909
- {
910
- id: "toolbar-collapsed-bottom",
911
- label: "Toolbar (Collapsed Bottom)",
912
- description: "Minimized, snapped to bottom edge",
913
- component: "toolbar",
914
- props: {
915
- isToolbarActive: false,
916
- isToolbarEnabled: true,
917
- isToolbarCollapsed: true,
918
- toolbarSnapEdge: "bottom"
919
- }
920
- },
921
- {
922
- id: "toolbar-collapsed-top",
923
- label: "Toolbar (Collapsed Top)",
924
- description: "Minimized, snapped to top edge",
925
- component: "toolbar",
926
- props: {
927
- isToolbarActive: false,
928
- isToolbarEnabled: true,
929
- isToolbarCollapsed: true,
930
- toolbarSnapEdge: "top"
931
- }
932
- },
933
- {
934
- id: "toolbar-collapsed-left",
935
- label: "Toolbar (Collapsed Left)",
936
- description: "Minimized, snapped to left edge",
937
- component: "toolbar",
938
- props: {
939
- isToolbarActive: false,
940
- isToolbarEnabled: true,
941
- isToolbarCollapsed: true,
942
- toolbarSnapEdge: "left"
943
- }
944
- },
945
- {
946
- id: "toolbar-collapsed-right",
947
- label: "Toolbar (Collapsed Right)",
948
- description: "Minimized, snapped to right edge",
949
- component: "toolbar",
950
- props: {
951
- isToolbarActive: false,
952
- isToolbarEnabled: true,
953
- isToolbarCollapsed: true,
954
- toolbarSnapEdge: "right"
955
- }
956
- },
957
- // ══════════════════════════════════════════════════════════════════════════
958
- // ANIMATION SEQUENCES
959
- // ══════════════════════════════════════════════════════════════════════════
960
- {
961
- id: "anim-copy-flow",
962
- label: "Copy Flow",
963
- description: "idle \u2192 copying \u2192 \u2713 copied",
964
- component: "label",
965
- props: {
966
- tagName: "button",
967
- componentName: "Button",
968
- status: "idle",
969
- hasAgent: false
970
- },
971
- animationSequence: [{
972
- props: {
973
- tagName: "button",
974
- componentName: "Button",
975
- status: "idle",
976
- hasAgent: false
977
- },
978
- durationMs: 1500
979
- }, {
980
- props: {
981
- tagName: "button",
982
- componentName: "Button",
983
- status: "copying",
984
- hasAgent: false,
985
- statusText: "Grabbing\u2026"
986
- },
987
- durationMs: 2e3
988
- }, {
989
- props: {
990
- tagName: "button",
991
- componentName: "Button",
992
- status: "copied",
993
- hasAgent: false,
994
- hasOnDismiss: false,
995
- hasOnUndo: false,
996
- showMoreOptions: true
997
- },
998
- durationMs: 2e3
999
- }]
1000
- },
1001
- {
1002
- id: "anim-agent-flow",
1003
- label: "Agent Flow",
1004
- description: "prompt \u2192 thinking \u2192 done",
1005
- component: "label",
1006
- props: {
1007
- tagName: "div",
1008
- componentName: "Card",
1009
- status: "idle",
1010
- hasAgent: true,
1011
- isAgentConnected: true,
1012
- isPromptMode: true,
1013
- inputValue: ""
1014
- },
1015
- animationSequence: [{
1016
- props: {
1017
- tagName: "div",
1018
- componentName: "Card",
1019
- status: "idle",
1020
- hasAgent: true,
1021
- isAgentConnected: true,
1022
- isPromptMode: true,
1023
- inputValue: ""
1024
- },
1025
- durationMs: 1e3
1026
- }, {
1027
- props: {
1028
- tagName: "div",
1029
- componentName: "Card",
1030
- status: "idle",
1031
- hasAgent: true,
1032
- isAgentConnected: true,
1033
- isPromptMode: true,
1034
- inputValue: "make it"
1035
- },
1036
- durationMs: 400
1037
- }, {
1038
- props: {
1039
- tagName: "div",
1040
- componentName: "Card",
1041
- status: "idle",
1042
- hasAgent: true,
1043
- isAgentConnected: true,
1044
- isPromptMode: true,
1045
- inputValue: "make it bigger"
1046
- },
1047
- durationMs: 800
1048
- }, {
1049
- props: {
1050
- tagName: "div",
1051
- componentName: "Card",
1052
- status: "copying",
1053
- hasAgent: true,
1054
- isAgentConnected: true,
1055
- inputValue: "make it bigger",
1056
- statusText: "Thinking\u2026"
1057
- },
1058
- durationMs: 1500
1059
- }, {
1060
- props: {
1061
- tagName: "div",
1062
- componentName: "Card",
1063
- status: "copying",
1064
- hasAgent: true,
1065
- isAgentConnected: true,
1066
- inputValue: "make it bigger",
1067
- statusText: "Applying changes\u2026"
1068
- },
1069
- durationMs: 1500
1070
- }, {
1071
- props: {
1072
- tagName: "div",
1073
- componentName: "Card",
1074
- status: "copied",
1075
- hasAgent: true,
1076
- isAgentConnected: true,
1077
- statusText: "Applied changes",
1078
- supportsUndo: true,
1079
- supportsFollowUp: true,
1080
- showMoreOptions: true
1081
- },
1082
- durationMs: 2500
1083
- }]
1084
- },
1085
- {
1086
- id: "anim-error-flow",
1087
- label: "Error Flow",
1088
- description: "idle \u2192 copying \u2192 error",
1089
- component: "label",
1090
- props: {
1091
- tagName: "form",
1092
- componentName: "Form",
1093
- status: "idle",
1094
- hasAgent: false
1095
- },
1096
- animationSequence: [{
1097
- props: {
1098
- tagName: "form",
1099
- componentName: "Form",
1100
- status: "idle",
1101
- hasAgent: false
1102
- },
1103
- durationMs: 1500
1104
- }, {
1105
- props: {
1106
- tagName: "form",
1107
- componentName: "Form",
1108
- status: "copying",
1109
- hasAgent: false,
1110
- statusText: "Grabbing\u2026"
1111
- },
1112
- durationMs: 2e3
1113
- }, {
1114
- props: {
1115
- tagName: "form",
1116
- componentName: "Form",
1117
- status: "error",
1118
- error: "Failed to copy element",
1119
- hasOnRetry: true,
1120
- hasOnAcknowledge: true
1121
- },
1122
- durationMs: 2500
1123
- }]
1124
- },
1125
- {
1126
- id: "anim-discard-flow",
1127
- label: "Discard Prompt",
1128
- description: "prompt \u2192 pending dismiss \u2192 cancelled",
1129
- component: "label",
1130
- props: {
1131
- tagName: "header",
1132
- componentName: "Header",
1133
- status: "idle",
1134
- hasAgent: true,
1135
- isAgentConnected: true,
1136
- isPromptMode: true,
1137
- inputValue: "change color"
1138
- },
1139
- animationSequence: [{
1140
- props: {
1141
- tagName: "header",
1142
- componentName: "Header",
1143
- status: "idle",
1144
- hasAgent: true,
1145
- isAgentConnected: true,
1146
- isPromptMode: true,
1147
- inputValue: "change color"
1148
- },
1149
- durationMs: 1500
1150
- }, {
1151
- props: {
1152
- tagName: "header",
1153
- componentName: "Header",
1154
- status: "idle",
1155
- hasAgent: true,
1156
- isPromptMode: true,
1157
- isPendingDismiss: true
1158
- },
1159
- durationMs: 2e3
1160
- }, {
1161
- props: {
1162
- tagName: "header",
1163
- componentName: "Header",
1164
- status: "idle",
1165
- hasAgent: true,
1166
- isAgentConnected: true,
1167
- isPromptMode: true,
1168
- inputValue: "change color"
1169
- },
1170
- durationMs: 1500
1171
- }]
1172
- },
1173
- {
1174
- id: "anim-abort-flow",
1175
- label: "Abort Operation",
1176
- description: "copying \u2192 pending abort \u2192 idle",
1177
- component: "label",
1178
- props: {
1179
- tagName: "section",
1180
- componentName: "Section",
1181
- status: "copying",
1182
- hasAgent: true,
1183
- isAgentConnected: true,
1184
- inputValue: "add animation",
1185
- statusText: "Thinking\u2026"
1186
- },
1187
- animationSequence: [{
1188
- props: {
1189
- tagName: "section",
1190
- componentName: "Section",
1191
- status: "copying",
1192
- hasAgent: true,
1193
- isAgentConnected: true,
1194
- inputValue: "add animation",
1195
- statusText: "Thinking\u2026"
1196
- },
1197
- durationMs: 1500
1198
- }, {
1199
- props: {
1200
- tagName: "section",
1201
- componentName: "Section",
1202
- status: "copying",
1203
- hasAgent: true,
1204
- isPendingAbort: true
1205
- },
1206
- durationMs: 2e3
1207
- }, {
1208
- props: {
1209
- tagName: "section",
1210
- componentName: "Section",
1211
- status: "idle",
1212
- hasAgent: true,
1213
- isAgentConnected: true,
1214
- isPromptMode: true,
1215
- inputValue: ""
1216
- },
1217
- durationMs: 1500
1218
- }]
1219
- },
1220
- {
1221
- id: "anim-toolbar-toggle",
1222
- label: "Toolbar Toggle",
1223
- description: "inactive \u2192 active \u2192 inactive",
1224
- component: "toolbar",
1225
- props: {
1226
- isToolbarActive: false,
1227
- isToolbarEnabled: true
1228
- },
1229
- animationSequence: [{
1230
- props: {
1231
- isToolbarActive: false,
1232
- isToolbarEnabled: true
1233
- },
1234
- durationMs: 1500
1235
- }, {
1236
- props: {
1237
- isToolbarActive: true,
1238
- isToolbarEnabled: true
1239
- },
1240
- durationMs: 2e3
1241
- }, {
1242
- props: {
1243
- isToolbarActive: false,
1244
- isToolbarEnabled: true
1245
- },
1246
- durationMs: 1500
1247
- }]
1248
- },
1249
- {
1250
- id: "anim-toolbar-enable",
1251
- label: "Toolbar Enable",
1252
- description: "disabled \u2192 enabled \u2192 disabled",
1253
- component: "toolbar",
1254
- props: {
1255
- isToolbarActive: false,
1256
- isToolbarEnabled: false
1257
- },
1258
- animationSequence: [{
1259
- props: {
1260
- isToolbarActive: false,
1261
- isToolbarEnabled: false
1262
- },
1263
- durationMs: 1500
1264
- }, {
1265
- props: {
1266
- isToolbarActive: false,
1267
- isToolbarEnabled: true
1268
- },
1269
- durationMs: 2e3
1270
- }, {
1271
- props: {
1272
- isToolbarActive: false,
1273
- isToolbarEnabled: false
1274
- },
1275
- durationMs: 1500
1276
- }]
1277
- },
1278
- {
1279
- id: "anim-followup-flow",
1280
- label: "Follow-up",
1281
- description: "copied \u2192 follow-up \u2192 new result",
1282
- component: "label",
1283
- props: {
1284
- tagName: "nav",
1285
- componentName: "Navbar",
1286
- status: "copied",
1287
- hasAgent: true,
1288
- isAgentConnected: true,
1289
- statusText: "Done",
1290
- supportsUndo: true,
1291
- supportsFollowUp: true,
1292
- showMoreOptions: true
1293
- },
1294
- animationSequence: [{
1295
- props: {
1296
- tagName: "nav",
1297
- componentName: "Navbar",
1298
- status: "copied",
1299
- hasAgent: true,
1300
- isAgentConnected: true,
1301
- statusText: "Done",
1302
- supportsUndo: true,
1303
- supportsFollowUp: true,
1304
- showMoreOptions: true
1305
- },
1306
- durationMs: 2e3
1307
- }, {
1308
- props: {
1309
- tagName: "nav",
1310
- componentName: "Navbar",
1311
- status: "copying",
1312
- hasAgent: true,
1313
- isAgentConnected: true,
1314
- inputValue: "also make it sticky",
1315
- statusText: "Thinking\u2026"
1316
- },
1317
- durationMs: 2e3
1318
- }, {
1319
- props: {
1320
- tagName: "nav",
1321
- componentName: "Navbar",
1322
- status: "copied",
1323
- hasAgent: true,
1324
- isAgentConnected: true,
1325
- statusText: "Applied 2 changes",
1326
- supportsUndo: true,
1327
- supportsFollowUp: true,
1328
- showMoreOptions: true
1329
- },
1330
- durationMs: 2e3
1331
- }]
1332
- },
1333
- {
1334
- id: "anim-undo-flow",
1335
- label: "Undo Flow",
1336
- description: "copied \u2192 undo \u2192 idle",
1337
- component: "label",
1338
- props: {
1339
- tagName: "div",
1340
- componentName: "Modal",
1341
- status: "copied",
1342
- hasAgent: true,
1343
- isAgentConnected: true,
1344
- statusText: "Applied changes",
1345
- supportsUndo: true,
1346
- showMoreOptions: true
1347
- },
1348
- animationSequence: [{
1349
- props: {
1350
- tagName: "div",
1351
- componentName: "Modal",
1352
- status: "copied",
1353
- hasAgent: true,
1354
- isAgentConnected: true,
1355
- statusText: "Applied changes",
1356
- supportsUndo: true,
1357
- supportsFollowUp: true,
1358
- showMoreOptions: true
1359
- },
1360
- durationMs: 2e3
1361
- }, {
1362
- props: {
1363
- tagName: "div",
1364
- componentName: "Modal",
1365
- status: "idle",
1366
- hasAgent: true,
1367
- isAgentConnected: true,
1368
- isPromptMode: true,
1369
- inputValue: ""
1370
- },
1371
- durationMs: 2e3
1372
- }]
1373
- },
1374
- {
1375
- id: "anim-retry-flow",
1376
- label: "Retry After Error",
1377
- description: "error \u2192 retry \u2192 \u2713 copied",
1378
- component: "label",
1379
- props: {
1380
- tagName: "table",
1381
- componentName: "DataTable",
1382
- status: "error",
1383
- error: "Connection timeout",
1384
- hasOnRetry: true,
1385
- hasOnAcknowledge: true
1386
- },
1387
- animationSequence: [{
1388
- props: {
1389
- tagName: "table",
1390
- componentName: "DataTable",
1391
- status: "error",
1392
- error: "Connection timeout",
1393
- hasOnRetry: true,
1394
- hasOnAcknowledge: true
1395
- },
1396
- durationMs: 2e3
1397
- }, {
1398
- props: {
1399
- tagName: "table",
1400
- componentName: "DataTable",
1401
- status: "copying",
1402
- statusText: "Retrying\u2026"
1403
- },
1404
- durationMs: 1500
1405
- }, {
1406
- props: {
1407
- tagName: "table",
1408
- componentName: "DataTable",
1409
- status: "copied",
1410
- hasOnDismiss: false,
1411
- hasOnUndo: false,
1412
- showMoreOptions: true
1413
- },
1414
- durationMs: 2e3
1415
- }]
1416
- },
1417
- {
1418
- id: "anim-agent-error-flow",
1419
- label: "Agent Error",
1420
- description: "prompt \u2192 thinking \u2192 error",
1421
- component: "label",
1422
- props: {
1423
- tagName: "aside",
1424
- componentName: "Sidebar",
1425
- status: "idle",
1426
- hasAgent: true,
1427
- isAgentConnected: true,
1428
- isPromptMode: true,
1429
- inputValue: ""
1430
- },
1431
- animationSequence: [{
1432
- props: {
1433
- tagName: "aside",
1434
- componentName: "Sidebar",
1435
- status: "idle",
1436
- hasAgent: true,
1437
- isAgentConnected: true,
1438
- isPromptMode: true,
1439
- inputValue: ""
1440
- },
1441
- durationMs: 1e3
1442
- }, {
1443
- props: {
1444
- tagName: "aside",
1445
- componentName: "Sidebar",
1446
- status: "idle",
1447
- hasAgent: true,
1448
- isAgentConnected: true,
1449
- isPromptMode: true,
1450
- inputValue: "make it collapsible"
1451
- },
1452
- durationMs: 800
1453
- }, {
1454
- props: {
1455
- tagName: "aside",
1456
- componentName: "Sidebar",
1457
- status: "copying",
1458
- hasAgent: true,
1459
- isAgentConnected: true,
1460
- statusText: "Thinking\u2026"
1461
- },
1462
- durationMs: 2e3
1463
- }, {
1464
- props: {
1465
- tagName: "aside",
1466
- componentName: "Sidebar",
1467
- status: "error",
1468
- hasAgent: true,
1469
- error: "Agent failed to respond",
1470
- hasOnRetry: true,
1471
- hasOnAcknowledge: true
1472
- },
1473
- durationMs: 2500
1474
- }]
1475
- },
1476
- {
1477
- id: "anim-acknowledge-error",
1478
- label: "Acknowledge Error",
1479
- description: "error \u2192 ok \u2192 dismissed",
1480
- component: "label",
1481
- props: {
1482
- tagName: "ul",
1483
- componentName: "List",
1484
- status: "error",
1485
- error: "Element not found",
1486
- hasOnRetry: true,
1487
- hasOnAcknowledge: true
1488
- },
1489
- animationSequence: [{
1490
- props: {
1491
- tagName: "ul",
1492
- componentName: "List",
1493
- status: "error",
1494
- error: "Element not found",
1495
- hasOnRetry: true,
1496
- hasOnAcknowledge: true
1497
- },
1498
- durationMs: 2500
1499
- }, {
1500
- props: {
1501
- tagName: "ul",
1502
- componentName: "List",
1503
- status: "idle"
1504
- },
1505
- durationMs: 2e3
1506
- }]
1507
- },
1508
- {
1509
- id: "anim-connect-agent",
1510
- label: "Agent Connect",
1511
- description: "disconnected \u2192 connected \u2192 prompt",
1512
- component: "label",
1513
- props: {
1514
- tagName: "footer",
1515
- componentName: "Footer",
1516
- status: "idle",
1517
- hasAgent: true,
1518
- isAgentConnected: false
1519
- },
1520
- animationSequence: [{
1521
- props: {
1522
- tagName: "footer",
1523
- componentName: "Footer",
1524
- status: "idle",
1525
- hasAgent: true,
1526
- isAgentConnected: false
1527
- },
1528
- durationMs: 2e3
1529
- }, {
1530
- props: {
1531
- tagName: "footer",
1532
- componentName: "Footer",
1533
- status: "idle",
1534
- hasAgent: true,
1535
- isAgentConnected: true,
1536
- isPromptMode: true,
1537
- inputValue: ""
1538
- },
1539
- durationMs: 2500
1540
- }]
1541
- },
1542
- {
1543
- id: "anim-context-menu-flow",
1544
- label: "Context Menu",
1545
- description: "context menu options",
1546
- component: "context-menu",
1547
- props: {
1548
- tagName: "article",
1549
- componentName: "BlogPost",
1550
- hasFilePath: false
1551
- },
1552
- animationSequence: [{
1553
- props: {
1554
- tagName: "article",
1555
- componentName: "BlogPost",
1556
- hasFilePath: false
1557
- },
1558
- durationMs: 2e3
1559
- }, {
1560
- props: {
1561
- tagName: "article",
1562
- componentName: "BlogPost",
1563
- hasFilePath: true,
1564
- filePath: "src/components/BlogPost.tsx"
1565
- },
1566
- durationMs: 2500
1567
- }, {
1568
- props: {
1569
- tagName: "article",
1570
- componentName: "BlogPost",
1571
- hasFilePath: false
1572
- },
1573
- durationMs: 2e3
1574
- }]
1575
- },
1576
- {
1577
- id: "anim-toolbar-collapse-bottom",
1578
- label: "Toolbar Collapse (Bottom)",
1579
- description: "expanded \u2192 collapsed \u2192 expanded",
1580
- component: "toolbar",
1581
- props: {
1582
- isToolbarActive: true,
1583
- isToolbarEnabled: true,
1584
- isToolbarCollapsed: false,
1585
- toolbarSnapEdge: "bottom"
1586
- },
1587
- animationSequence: [{
1588
- props: {
1589
- isToolbarActive: true,
1590
- isToolbarEnabled: true,
1591
- isToolbarCollapsed: false,
1592
- toolbarSnapEdge: "bottom"
1593
- },
1594
- durationMs: 2e3
1595
- }, {
1596
- props: {
1597
- isToolbarActive: true,
1598
- isToolbarEnabled: true,
1599
- isToolbarCollapsed: true,
1600
- toolbarSnapEdge: "bottom"
1601
- },
1602
- durationMs: 2e3
1603
- }, {
1604
- props: {
1605
- isToolbarActive: true,
1606
- isToolbarEnabled: true,
1607
- isToolbarCollapsed: false,
1608
- toolbarSnapEdge: "bottom"
1609
- },
1610
- durationMs: 2e3
1611
- }]
1612
- },
1613
- {
1614
- id: "anim-toolbar-collapse-right",
1615
- label: "Toolbar Collapse (Right)",
1616
- description: "expanded \u2192 collapsed \u2192 expanded",
1617
- component: "toolbar",
1618
- props: {
1619
- isToolbarActive: true,
1620
- isToolbarEnabled: true,
1621
- isToolbarCollapsed: false,
1622
- toolbarSnapEdge: "right"
1623
- },
1624
- animationSequence: [{
1625
- props: {
1626
- isToolbarActive: true,
1627
- isToolbarEnabled: true,
1628
- isToolbarCollapsed: false,
1629
- toolbarSnapEdge: "right"
1630
- },
1631
- durationMs: 2e3
1632
- }, {
1633
- props: {
1634
- isToolbarActive: true,
1635
- isToolbarEnabled: true,
1636
- isToolbarCollapsed: true,
1637
- toolbarSnapEdge: "right"
1638
- },
1639
- durationMs: 2e3
1640
- }, {
1641
- props: {
1642
- isToolbarActive: true,
1643
- isToolbarEnabled: true,
1644
- isToolbarCollapsed: false,
1645
- toolbarSnapEdge: "right"
1646
- },
1647
- durationMs: 2e3
1648
- }]
1649
- },
1650
- {
1651
- id: "anim-copy-with-file",
1652
- label: "Copy with File Path",
1653
- description: "idle \u2192 copying \u2192 \u2713 copied",
1654
- component: "label",
1655
- props: {
1656
- tagName: "span",
1657
- componentName: "Badge",
1658
- status: "idle",
1659
- filePath: "src/components/Badge.tsx"
1660
- },
1661
- animationSequence: [{
1662
- props: {
1663
- tagName: "span",
1664
- componentName: "Badge",
1665
- status: "idle",
1666
- filePath: "src/components/Badge.tsx"
1667
- },
1668
- durationMs: 1500
1669
- }, {
1670
- props: {
1671
- tagName: "span",
1672
- componentName: "Badge",
1673
- status: "copying",
1674
- filePath: "src/components/Badge.tsx",
1675
- statusText: "Grabbing\u2026"
1676
- },
1677
- durationMs: 2e3
1678
- }, {
1679
- props: {
1680
- tagName: "span",
1681
- componentName: "Badge",
1682
- status: "copied",
1683
- filePath: "src/components/Badge.tsx",
1684
- hasOnDismiss: false,
1685
- hasOnUndo: false,
1686
- showMoreOptions: true
1687
- },
1688
- durationMs: 2e3
1689
- }]
1690
- },
1691
- {
1692
- id: "anim-multiple-elements",
1693
- label: "Multiple Elements",
1694
- description: "1 \u2192 5 selected \u2192 copying \u2192 \u2713 copied",
1695
- component: "label",
1696
- props: {
1697
- tagName: "li",
1698
- componentName: "ListItem",
1699
- status: "idle",
1700
- elementsCount: 1
1701
- },
1702
- animationSequence: [{
1703
- props: {
1704
- tagName: "li",
1705
- componentName: "ListItem",
1706
- status: "idle",
1707
- elementsCount: 1
1708
- },
1709
- durationMs: 2e3
1710
- }, {
1711
- props: {
1712
- tagName: "li",
1713
- componentName: "ListItem",
1714
- status: "idle",
1715
- elementsCount: 5
1716
- },
1717
- durationMs: 2e3
1718
- }, {
1719
- props: {
1720
- tagName: "li",
1721
- componentName: "ListItem",
1722
- status: "copying",
1723
- elementsCount: 5,
1724
- statusText: "Grabbing 5\u2026"
1725
- },
1726
- durationMs: 2e3
1727
- }, {
1728
- props: {
1729
- tagName: "li",
1730
- componentName: "ListItem",
1731
- status: "copied",
1732
- elementsCount: 5,
1733
- hasOnDismiss: false,
1734
- hasOnUndo: false,
1735
- showMoreOptions: true
1736
- },
1737
- durationMs: 2e3
1738
- }]
1739
- },
1740
- {
1741
- id: "anim-long-operation",
1742
- label: "Long Operation",
1743
- description: "copying with status updates",
1744
- component: "label",
1745
- props: {
1746
- tagName: "main",
1747
- componentName: "Dashboard",
1748
- status: "copying",
1749
- hasAgent: true,
1750
- isAgentConnected: true,
1751
- statusText: "Starting\u2026"
1752
- },
1753
- animationSequence: [{
1754
- props: {
1755
- tagName: "main",
1756
- componentName: "Dashboard",
1757
- status: "idle",
1758
- hasAgent: true,
1759
- isAgentConnected: true,
1760
- isPromptMode: true,
1761
- inputValue: "redesign the layout"
1762
- },
1763
- durationMs: 1500
1764
- }, {
1765
- props: {
1766
- tagName: "main",
1767
- componentName: "Dashboard",
1768
- status: "copying",
1769
- hasAgent: true,
1770
- isAgentConnected: true,
1771
- statusText: "Analyzing\u2026"
1772
- },
1773
- durationMs: 1500
1774
- }, {
1775
- props: {
1776
- tagName: "main",
1777
- componentName: "Dashboard",
1778
- status: "copying",
1779
- hasAgent: true,
1780
- isAgentConnected: true,
1781
- statusText: "Generating code\u2026"
1782
- },
1783
- durationMs: 1500
1784
- }, {
1785
- props: {
1786
- tagName: "main",
1787
- componentName: "Dashboard",
1788
- status: "copying",
1789
- hasAgent: true,
1790
- isAgentConnected: true,
1791
- statusText: "Applying changes\u2026"
1792
- },
1793
- durationMs: 1500
1794
- }, {
1795
- props: {
1796
- tagName: "main",
1797
- componentName: "Dashboard",
1798
- status: "copied",
1799
- hasAgent: true,
1800
- isAgentConnected: true,
1801
- statusText: "Done",
1802
- supportsUndo: true,
1803
- supportsFollowUp: true,
1804
- showMoreOptions: true
1805
- },
1806
- durationMs: 2e3
1807
- }]
1808
- },
1809
- {
1810
- id: "anim-reply-to-prompt",
1811
- label: "Reply to Prompt",
1812
- description: "completed \u2192 edit with previous",
1813
- component: "label",
1814
- props: {
1815
- tagName: "div",
1816
- componentName: "Card",
1817
- status: "copied",
1818
- hasAgent: true,
1819
- isAgentConnected: true,
1820
- statusText: "Done",
1821
- supportsFollowUp: true,
1822
- showMoreOptions: true
1823
- },
1824
- animationSequence: [{
1825
- props: {
1826
- tagName: "div",
1827
- componentName: "Card",
1828
- status: "copied",
1829
- hasAgent: true,
1830
- isAgentConnected: true,
1831
- statusText: "Done",
1832
- supportsUndo: true,
1833
- supportsFollowUp: true,
1834
- showMoreOptions: true
1835
- },
1836
- durationMs: 2e3
1837
- }, {
1838
- props: {
1839
- tagName: "div",
1840
- componentName: "Card",
1841
- status: "idle",
1842
- hasAgent: true,
1843
- isAgentConnected: true,
1844
- isPromptMode: true,
1845
- inputValue: "",
1846
- previousPrompt: "make it bigger",
1847
- replyToPrompt: "make it bigger"
1848
- },
1849
- durationMs: 2500
1850
- }, {
1851
- props: {
1852
- tagName: "div",
1853
- componentName: "Card",
1854
- status: "idle",
1855
- hasAgent: true,
1856
- isAgentConnected: true,
1857
- isPromptMode: true,
1858
- inputValue: "also add shadow",
1859
- previousPrompt: "make it bigger",
1860
- replyToPrompt: "make it bigger"
1861
- },
1862
- durationMs: 1500
1863
- }]
1864
- }
1865
- ];
1866
- var CELL_SIZE_PX = 300;
1867
- var TARGET_HEIGHT_PX = 48;
1868
- var GAP_PX = 16;
1869
- var CARD_BORDER_RADIUS_PX = 8;
1870
- var CARD_HEADER_PADDING = "12px 14px";
1871
- var CARD_CONTENT_PADDING_PX = 16;
1872
- var TOGGLE_BUTTON_PADDING = "5px 10px";
1873
- var TOGGLE_BUTTON_GAP_PX = 6;
1874
- var TOGGLE_BUTTON_BORDER_RADIUS_PX = 6;
1875
- var TOGGLE_BUTTON_FONT_SIZE_PX = 12;
1876
- var SECTION_TITLE_FONT_SIZE_PX = 11;
1877
- var SECTION_TITLE_MARGIN_BOTTOM_PX = 12;
1878
- var TARGET_BORDER_RADIUS_PX = 6;
1879
- var TARGET_FONT_SIZE_PX = 12;
1880
- var TRANSITION_DURATION = "0.15s ease";
1881
- var STORAGE_KEY_THEME = "react-grab-design-system-theme";
1882
- var STORAGE_KEY_STARRED = "react-grab-design-system-starred";
1883
- var generateRandomSuffix = (length) => {
1884
- const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
1885
- let result = "";
1886
- for (let i = 0; i < length; i++) {
1887
- result += chars.charAt(Math.floor(Math.random() * chars.length));
1888
- }
1889
- return result;
1890
- };
1891
- var elongateProps = (props) => {
1892
- const elongateString = (value) => {
1893
- if (!value) return value;
1894
- return value + generateRandomSuffix(20 + Math.floor(Math.random() * 30));
1895
- };
1896
- return {
1897
- ...props,
1898
- tagName: elongateString(props.tagName),
1899
- componentName: elongateString(props.componentName),
1900
- filePath: elongateString(props.filePath),
1901
- statusText: elongateString(props.statusText),
1902
- error: elongateString(props.error),
1903
- inputValue: elongateString(props.inputValue),
1904
- replyToPrompt: elongateString(props.replyToPrompt),
1905
- previousPrompt: elongateString(props.previousPrompt),
1906
- dismissButtonText: elongateString(props.dismissButtonText)
1907
- };
1908
- };
1909
- var loadTheme = () => {
1910
- try {
1911
- const saved = localStorage.getItem(STORAGE_KEY_THEME);
1912
- if (saved === "light") return false;
1913
- return true;
1914
- } catch {
1915
- return true;
1916
- }
1917
- };
1918
- var saveTheme = (isDark) => {
1919
- try {
1920
- localStorage.setItem(STORAGE_KEY_THEME, isDark ? "dark" : "light");
1921
- } catch {
1922
- }
1923
- };
1924
- var loadStarred = () => {
1925
- try {
1926
- const saved = localStorage.getItem(STORAGE_KEY_STARRED);
1927
- if (!saved) return /* @__PURE__ */ new Set();
1928
- return new Set(JSON.parse(saved));
1929
- } catch {
1930
- return /* @__PURE__ */ new Set();
1931
- }
1932
- };
1933
- var saveStarred = (starred) => {
1934
- try {
1935
- localStorage.setItem(STORAGE_KEY_STARRED, JSON.stringify([...starred]));
1936
- } catch {
1937
- }
1938
- };
1939
- var DARK_THEME = {
1940
- background: "#000000",
1941
- cardBackground: "rgba(255, 255, 255, 0.05)",
1942
- cardContentBackground: "rgba(0, 0, 0, 0.6)",
1943
- cardBorder: "rgba(255, 255, 255, 0.1)",
1944
- cardShadow: "0 8px 30px rgba(0, 0, 0, 0.3)",
1945
- titleText: "#ffffff",
1946
- descriptionText: "rgba(255, 255, 255, 0.5)",
1947
- targetBackground: "rgba(215, 95, 203, 0.1)",
1948
- targetBorder: "rgba(215, 95, 203, 0.3)",
1949
- targetText: "rgba(215, 95, 203, 0.7)",
1950
- toggleBackground: "rgba(255, 255, 255, 0.05)",
1951
- toggleBorder: "rgba(255, 255, 255, 0.1)",
1952
- toggleText: "#ffffff",
1953
- sectionTitle: "rgba(255, 255, 255, 0.4)"
1954
- };
1955
- var LIGHT_THEME = {
1956
- background: "#f5f5f5",
1957
- cardBackground: "#ffffff",
1958
- cardContentBackground: "rgba(0, 0, 0, 0.03)",
1959
- cardBorder: "rgba(0, 0, 0, 0.1)",
1960
- cardShadow: "0 8px 30px rgba(0, 0, 0, 0.08)",
1961
- titleText: "#0a0a0a",
1962
- descriptionText: "rgba(0, 0, 0, 0.5)",
1963
- targetBackground: "rgba(215, 95, 203, 0.08)",
1964
- targetBorder: "rgba(215, 95, 203, 0.3)",
1965
- targetText: "rgba(215, 95, 203, 0.7)",
1966
- toggleBackground: "#ffffff",
1967
- toggleBorder: "rgba(0, 0, 0, 0.1)",
1968
- toggleText: "#0a0a0a",
1969
- sectionTitle: "rgba(0, 0, 0, 0.4)"
1970
- };
1971
- var createToggleButtonStyle = (theme) => ({
1972
- display: "flex",
1973
- "align-items": "center",
1974
- gap: `${TOGGLE_BUTTON_GAP_PX}px`,
1975
- padding: TOGGLE_BUTTON_PADDING,
1976
- "background-color": theme.toggleBackground,
1977
- border: `1px solid ${theme.toggleBorder}`,
1978
- "border-radius": `${TOGGLE_BUTTON_BORDER_RADIUS_PX}px`,
1979
- color: theme.toggleText,
1980
- "font-size": `${TOGGLE_BUTTON_FONT_SIZE_PX}px`,
1981
- "font-weight": "500",
1982
- cursor: "pointer",
1983
- transition: `all ${TRANSITION_DURATION}`
1984
- });
1985
- var createCardContainerStyle = (theme) => ({
1986
- display: "flex",
1987
- "flex-direction": "column",
1988
- "background-color": theme.cardBackground,
1989
- "border-radius": `${CARD_BORDER_RADIUS_PX}px`,
1990
- border: `1px solid ${theme.cardBorder}`,
1991
- "box-shadow": theme.cardShadow,
1992
- overflow: "hidden",
1993
- "aspect-ratio": "1",
1994
- transition: `all ${TRANSITION_DURATION}`
1995
- });
1996
- var createCardHeaderStyle = (theme) => ({
1997
- display: "flex",
1998
- "justify-content": "space-between",
1999
- "align-items": "flex-start",
2000
- padding: CARD_HEADER_PADDING,
2001
- "border-bottom": `1px solid ${theme.cardBorder}`
2002
- });
2003
- var createCardContentStyle = (theme) => ({
2004
- flex: "1",
2005
- display: "flex",
2006
- "flex-direction": "column",
2007
- "align-items": "center",
2008
- "justify-content": "center",
2009
- padding: `${CARD_CONTENT_PADDING_PX}px`,
2010
- position: "relative",
2011
- "background-color": theme.cardContentBackground
2012
- });
2013
- var createTargetStyle = (theme) => ({
2014
- width: "100%",
2015
- height: `${TARGET_HEIGHT_PX}px`,
2016
- "background-color": theme.targetBackground,
2017
- border: `1px solid ${theme.targetBorder}`,
2018
- "border-radius": `${TARGET_BORDER_RADIUS_PX}px`,
2019
- display: "flex",
2020
- "align-items": "center",
2021
- "justify-content": "center",
2022
- color: theme.targetText,
2023
- "font-size": `${TARGET_FONT_SIZE_PX}px`,
2024
- "font-family": "ui-monospace, SFMono-Regular, monospace"
2025
- });
2026
- var StateCard = (props) => {
2027
- const [isCardRefreshing, setIsCardRefreshing] = createSignal(false);
2028
- const [isPlaying, setIsPlaying] = createSignal(false);
2029
- const [frameIndex, setFrameIndex] = createSignal(0);
2030
- let animationTimeout;
2031
- const hasAnimation = () => Boolean(props.state.animationSequence?.length);
2032
- const frameCount = () => props.state.animationSequence?.length ?? 0;
2033
- const currentProps = () => {
2034
- let baseProps;
2035
- if (hasAnimation() && props.state.animationSequence) {
2036
- baseProps = props.state.animationSequence[frameIndex()].props;
2037
- } else {
2038
- baseProps = props.state.props;
2039
- }
2040
- return props.isScrambled ? elongateProps(baseProps) : baseProps;
2041
- };
2042
- const scheduleNextFrame = () => {
2043
- if (!props.state.animationSequence) return;
2044
- const sequence = props.state.animationSequence;
2045
- const currentFrame = sequence[frameIndex()];
2046
- animationTimeout = setTimeout(() => {
2047
- const nextIndex = (frameIndex() + 1) % sequence.length;
2048
- setFrameIndex(nextIndex);
2049
- if (isPlaying()) {
2050
- scheduleNextFrame();
2051
- }
2052
- }, currentFrame.durationMs);
2053
- };
2054
- const handleTogglePlay = (event) => {
2055
- event.stopPropagation();
2056
- if (isPlaying()) {
2057
- setIsPlaying(false);
2058
- if (animationTimeout) {
2059
- clearTimeout(animationTimeout);
2060
- animationTimeout = void 0;
2061
- }
2062
- } else {
2063
- setIsPlaying(true);
2064
- scheduleNextFrame();
2065
- }
2066
- };
2067
- const handleSliderChange = (event) => {
2068
- const target = event.target;
2069
- setFrameIndex(parseInt(target.value, 10));
2070
- if (isPlaying()) {
2071
- setIsPlaying(false);
2072
- if (animationTimeout) {
2073
- clearTimeout(animationTimeout);
2074
- animationTimeout = void 0;
2075
- }
2076
- }
2077
- };
2078
- onCleanup(() => {
2079
- if (animationTimeout) {
2080
- clearTimeout(animationTimeout);
2081
- }
2082
- });
2083
- const handleCardRefresh = (event) => {
2084
- event.stopPropagation();
2085
- setIsCardRefreshing(true);
2086
- setFrameIndex(0);
2087
- setIsPlaying(false);
2088
- if (animationTimeout) {
2089
- clearTimeout(animationTimeout);
2090
- animationTimeout = void 0;
2091
- }
2092
- props.onRefresh();
2093
- queueMicrotask(() => setIsCardRefreshing(false));
2094
- };
2095
- const handleToggleStar = (event) => {
2096
- event.stopPropagation();
2097
- props.onToggleStar();
2098
- };
2099
- return (() => {
2100
- var _el$ = _tmpl$42(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$8 = _el$4.nextSibling, _el$10 = _el$3.nextSibling, _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$2.nextSibling;
2101
- insert(_el$5, () => props.state.label);
2102
- insert(_el$4, createComponent(Show, {
2103
- get when() {
2104
- return hasAnimation();
2105
- },
2106
- get children() {
2107
- var _el$6 = _tmpl$5(), _el$7 = _el$6.firstChild;
2108
- insert(_el$6, () => frameIndex() + 1, _el$7);
2109
- insert(_el$6, frameCount, null);
2110
- createRenderEffect((_$p) => setStyleProperty(_el$6, "color", props.theme.descriptionText));
2111
- return _el$6;
2112
- }
2113
- }), null);
2114
- insert(_el$8, () => props.state.description);
2115
- insert(_el$3, createComponent(Show, {
2116
- get when() {
2117
- return hasAnimation();
2118
- },
2119
- get children() {
2120
- var _el$9 = _tmpl$22(), _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling;
2121
- _el$0.$$click = handleTogglePlay;
2122
- insert(_el$0, () => isPlaying() ? "\u23F8" : "\u25B6");
2123
- _el$1.$$input = handleSliderChange;
2124
- createRenderEffect((_p$) => {
2125
- var _v$ = `1px solid ${props.theme.cardBorder}`, _v$2 = props.theme.titleText, _v$3 = isPlaying() ? "Pause" : "Play", _v$4 = frameCount() - 1, _v$5 = props.theme.titleText;
2126
- _v$ !== _p$.e && setStyleProperty(_el$0, "border", _p$.e = _v$);
2127
- _v$2 !== _p$.t && setStyleProperty(_el$0, "color", _p$.t = _v$2);
2128
- _v$3 !== _p$.a && setAttribute(_el$0, "title", _p$.a = _v$3);
2129
- _v$4 !== _p$.o && setAttribute(_el$1, "max", _p$.o = _v$4);
2130
- _v$5 !== _p$.i && setStyleProperty(_el$1, "accent-color", _p$.i = _v$5);
2131
- return _p$;
2132
- }, {
2133
- e: void 0,
2134
- t: void 0,
2135
- a: void 0,
2136
- o: void 0,
2137
- i: void 0
2138
- });
2139
- createRenderEffect(() => _el$1.value = frameIndex());
2140
- return _el$9;
2141
- }
2142
- }), null);
2143
- _el$11.$$click = handleToggleStar;
2144
- insert(_el$11, () => props.isStarred ? "\u2605" : "\u2606");
2145
- _el$12.$$click = handleCardRefresh;
2146
- insert(_el$13, createComponent(Show, {
2147
- get when() {
2148
- return !isCardRefreshing();
2149
- },
2150
- get children() {
2151
- return [createComponent(Show, {
2152
- get when() {
2153
- return props.state.component !== "toolbar";
2154
- },
2155
- get children() {
2156
- var _el$14 = _tmpl$32();
2157
- use((element) => props.registerCell(element), _el$14);
2158
- insert(_el$14, () => props.getTargetDisplayText());
2159
- createRenderEffect((_$p) => style(_el$14, createTargetStyle(props.theme), _$p));
2160
- return _el$14;
2161
- }
2162
- }), createComponent(Show, {
2163
- get when() {
2164
- return props.state.component === "label";
2165
- },
2166
- get children() {
2167
- return createComponent(SelectionLabel, {
2168
- get tagName() {
2169
- return currentProps().tagName;
2170
- },
2171
- get componentName() {
2172
- return currentProps().componentName;
2173
- },
2174
- get elementsCount() {
2175
- return currentProps().elementsCount;
2176
- },
2177
- get selectionBounds() {
2178
- return props.getBounds();
2179
- },
2180
- get mouseX() {
2181
- return memo(() => !!props.getBounds())() ? props.getBounds().x + props.getBounds().width / 2 : void 0;
2182
- },
2183
- visible: true,
2184
- get status() {
2185
- return currentProps().status;
2186
- },
2187
- get hasAgent() {
2188
- return currentProps().hasAgent;
2189
- },
2190
- get isAgentConnected() {
2191
- return currentProps().isAgentConnected;
2192
- },
2193
- get isPromptMode() {
2194
- return currentProps().isPromptMode;
2195
- },
2196
- get inputValue() {
2197
- return currentProps().inputValue;
2198
- },
2199
- get replyToPrompt() {
2200
- return currentProps().replyToPrompt;
2201
- },
2202
- get statusText() {
2203
- return currentProps().statusText;
2204
- },
2205
- get isPendingDismiss() {
2206
- return currentProps().isPendingDismiss;
2207
- },
2208
- get isPendingAbort() {
2209
- return currentProps().isPendingAbort;
2210
- },
2211
- get error() {
2212
- return currentProps().error;
2213
- },
2214
- get isContextMenuOpen() {
2215
- return currentProps().isContextMenuOpen;
2216
- },
2217
- get supportsUndo() {
2218
- return currentProps().supportsUndo;
2219
- },
2220
- get supportsFollowUp() {
2221
- return currentProps().supportsFollowUp;
2222
- },
2223
- get filePath() {
2224
- return currentProps().filePath;
2225
- },
2226
- get dismissButtonText() {
2227
- return currentProps().dismissButtonText;
2228
- },
2229
- get previousPrompt() {
2230
- return currentProps().previousPrompt;
2231
- },
2232
- get onOpen() {
2233
- return currentProps().filePath ? () => {
2234
- } : void 0;
2235
- },
2236
- onInputChange: () => {
2237
- },
2238
- onSubmit: () => {
2239
- },
2240
- onToggleExpand: () => {
2241
- },
2242
- onConfirmDismiss: () => {
2243
- },
2244
- onCancelDismiss: () => {
2245
- },
2246
- onConfirmAbort: () => {
2247
- },
2248
- onCancelAbort: () => {
2249
- },
2250
- get onAcknowledgeError() {
2251
- return currentProps().hasOnAcknowledge !== false ? () => {
2252
- } : void 0;
2253
- },
2254
- get onRetry() {
2255
- return currentProps().hasOnRetry !== false ? () => {
2256
- } : void 0;
2257
- },
2258
- get onDismiss() {
2259
- return currentProps().hasOnDismiss !== false ? () => {
2260
- } : void 0;
2261
- },
2262
- get onUndo() {
2263
- return currentProps().hasOnUndo !== false ? () => {
2264
- } : void 0;
2265
- },
2266
- onFollowUpSubmit: () => {
2267
- },
2268
- onAbort: () => {
2269
- },
2270
- get onShowContextMenu() {
2271
- return currentProps().showMoreOptions ? () => {
2272
- } : void 0;
2273
- }
2274
- });
2275
- }
2276
- }), createComponent(Show, {
2277
- get when() {
2278
- return props.state.component === "context-menu";
2279
- },
2280
- get children() {
2281
- return createComponent(ContextMenu, {
2282
- get position() {
2283
- return memo(() => !!props.getBounds())() ? {
2284
- x: props.getBounds().x + props.getBounds().width / 2,
2285
- y: props.getBounds().y + props.getBounds().height
2286
- } : null;
2287
- },
2288
- get selectionBounds() {
2289
- return props.getBounds() ?? null;
2290
- },
2291
- get tagName() {
2292
- return currentProps().tagName;
2293
- },
2294
- get componentName() {
2295
- return currentProps().componentName;
2296
- },
2297
- get hasFilePath() {
2298
- return currentProps().hasFilePath ?? false;
2299
- },
2300
- get actions() {
2301
- return [{
2302
- id: "copy",
2303
- label: "Copy",
2304
- shortcut: "C",
2305
- onAction: () => {
2306
- }
2307
- }, {
2308
- id: "screenshot",
2309
- label: "Screenshot",
2310
- shortcut: "S",
2311
- onAction: () => {
2312
- }
2313
- }, {
2314
- id: "copy-html",
2315
- label: "Copy HTML",
2316
- onAction: () => {
2317
- }
2318
- }, {
2319
- id: "open",
2320
- label: "Open",
2321
- shortcut: "O",
2322
- enabled: currentProps().hasFilePath ?? false,
2323
- onAction: () => {
2324
- }
2325
- }, {
2326
- id: "comment",
2327
- label: "Comment",
2328
- shortcut: "Enter",
2329
- onAction: () => {
2330
- }
2331
- }];
2332
- },
2333
- onDismiss: () => {
2334
- },
2335
- onHide: () => {
2336
- }
2337
- });
2338
- }
2339
- }), createComponent(Show, {
2340
- get when() {
2341
- return props.state.component === "toolbar";
2342
- },
2343
- get children() {
2344
- return createComponent(ToolbarContent, {
2345
- get isActive() {
2346
- return currentProps().isToolbarActive ?? false;
2347
- },
2348
- get isCommentMode() {
2349
- return currentProps().isToolbarCommentMode ?? false;
2350
- },
2351
- get enabled() {
2352
- return currentProps().isToolbarEnabled ?? true;
2353
- },
2354
- get isCollapsed() {
2355
- return currentProps().isToolbarCollapsed;
2356
- },
2357
- get snapEdge() {
2358
- return currentProps().toolbarSnapEdge;
2359
- }
2360
- });
2361
- }
2362
- })];
2363
- }
2364
- }));
2365
- createRenderEffect((_p$) => {
2366
- var _v$6 = createCardContainerStyle(props.theme), _v$7 = createCardHeaderStyle(props.theme), _v$8 = props.theme.titleText, _v$9 = props.theme.descriptionText, _v$0 = `1px solid ${props.isStarred ? "rgba(250, 204, 21, 0.5)" : props.theme.cardBorder}`, _v$1 = props.isStarred ? "rgba(250, 204, 21, 1)" : props.theme.descriptionText, _v$10 = props.isStarred ? "Unstar this card" : "Star this card", _v$11 = `1px solid ${props.theme.cardBorder}`, _v$12 = props.theme.descriptionText, _v$13 = createCardContentStyle(props.theme);
2367
- _p$.e = style(_el$, _v$6, _p$.e);
2368
- _p$.t = style(_el$2, _v$7, _p$.t);
2369
- _v$8 !== _p$.a && setStyleProperty(_el$5, "color", _p$.a = _v$8);
2370
- _v$9 !== _p$.o && setStyleProperty(_el$8, "color", _p$.o = _v$9);
2371
- _v$0 !== _p$.i && setStyleProperty(_el$11, "border", _p$.i = _v$0);
2372
- _v$1 !== _p$.n && setStyleProperty(_el$11, "color", _p$.n = _v$1);
2373
- _v$10 !== _p$.s && setAttribute(_el$11, "title", _p$.s = _v$10);
2374
- _v$11 !== _p$.h && setStyleProperty(_el$12, "border", _p$.h = _v$11);
2375
- _v$12 !== _p$.r && setStyleProperty(_el$12, "color", _p$.r = _v$12);
2376
- _p$.d = style(_el$13, _v$13, _p$.d);
2377
- return _p$;
2378
- }, {
2379
- e: void 0,
2380
- t: void 0,
2381
- a: void 0,
2382
- o: void 0,
2383
- i: void 0,
2384
- n: void 0,
2385
- s: void 0,
2386
- h: void 0,
2387
- r: void 0,
2388
- d: void 0
2389
- });
2390
- return _el$;
2391
- })();
2392
- };
2393
- var FpsMeter = (props) => {
2394
- const [fps, setFps] = createSignal(0);
2395
- let frameCount = 0;
2396
- let lastTime = performance.now();
2397
- let animationFrameId;
2398
- const measureFps = () => {
2399
- frameCount++;
2400
- const currentTime = performance.now();
2401
- const elapsed = currentTime - lastTime;
2402
- if (elapsed >= 1e3) {
2403
- setFps(Math.round(frameCount * 1e3 / elapsed));
2404
- frameCount = 0;
2405
- lastTime = currentTime;
2406
- }
2407
- animationFrameId = requestAnimationFrame(measureFps);
2408
- };
2409
- onMount(() => {
2410
- animationFrameId = requestAnimationFrame(measureFps);
2411
- });
2412
- onCleanup(() => {
2413
- if (animationFrameId) {
2414
- cancelAnimationFrame(animationFrameId);
2415
- }
2416
- });
2417
- return (() => {
2418
- var _el$15 = _tmpl$52(), _el$16 = _el$15.firstChild;
2419
- insert(_el$15, fps, _el$16);
2420
- createRenderEffect((_p$) => {
2421
- var _v$14 = props.theme.cardBackground, _v$15 = `1px solid ${props.theme.cardBorder}`, _v$16 = props.theme.titleText;
2422
- _v$14 !== _p$.e && setStyleProperty(_el$15, "background-color", _p$.e = _v$14);
2423
- _v$15 !== _p$.t && setStyleProperty(_el$15, "border", _p$.t = _v$15);
2424
- _v$16 !== _p$.a && setStyleProperty(_el$15, "color", _p$.a = _v$16);
2425
- return _p$;
2426
- }, {
2427
- e: void 0,
2428
- t: void 0,
2429
- a: void 0
2430
- });
2431
- return _el$15;
2432
- })();
2433
- };
2434
- var DesignSystemGrid = () => {
2435
- const [cellRefs, setCellRefs] = createSignal(/* @__PURE__ */ new Map());
2436
- const [boundsVersion, setBoundsVersion] = createSignal(0);
2437
- const [isDarkMode, setIsDarkMode] = createSignal(loadTheme());
2438
- const [isRefreshing, setIsRefreshing] = createSignal(false);
2439
- const [starredIds, setStarredIds] = createSignal(loadStarred());
2440
- const [searchQuery, setSearchQuery] = createSignal("");
2441
- const [isScrambled, setIsScrambled] = createSignal(false);
2442
- const handleRefresh = () => {
2443
- setIsRefreshing(true);
2444
- setCellRefs(/* @__PURE__ */ new Map());
2445
- queueMicrotask(() => setIsRefreshing(false));
2446
- };
2447
- const handleToggleTheme = () => {
2448
- setIsDarkMode((prev) => {
2449
- const newValue = !prev;
2450
- saveTheme(newValue);
2451
- return newValue;
2452
- });
2453
- };
2454
- const handleToggleStar = (id) => {
2455
- setStarredIds((prev) => {
2456
- const next = new Set(prev);
2457
- if (next.has(id)) {
2458
- next.delete(id);
2459
- } else {
2460
- next.add(id);
2461
- }
2462
- saveStarred(next);
2463
- return next;
2464
- });
2465
- };
2466
- const isStarred = (id) => starredIds().has(id);
2467
- const theme = () => isDarkMode() ? DARK_THEME : LIGHT_THEME;
2468
- const sectionTitleStyle = () => ({
2469
- display: "block",
2470
- color: theme().sectionTitle,
2471
- "font-size": `${SECTION_TITLE_FONT_SIZE_PX}px`,
2472
- "font-weight": "600",
2473
- "text-transform": "uppercase",
2474
- "letter-spacing": "0.05em",
2475
- "margin-bottom": `${SECTION_TITLE_MARGIN_BOTTOM_PX}px`
2476
- });
2477
- const gridStyle = () => ({
2478
- display: "grid",
2479
- "grid-template-columns": `repeat(auto-fill, minmax(${CELL_SIZE_PX}px, 1fr))`,
2480
- gap: `${GAP_PX}px`
2481
- });
2482
- const getTargetDisplayText = (state) => {
2483
- if (state.component === "toolbar") {
2484
- return "";
2485
- }
2486
- if (state.props.elementsCount && state.props.elementsCount > 1) {
2487
- return `<${state.props.elementsCount} elements>`;
2488
- }
2489
- return `<${state.props.componentName || state.props.tagName || "element"} />`;
2490
- };
2491
- const registerCell = (id, element) => {
2492
- setCellRefs((prev) => {
2493
- const next = new Map(prev);
2494
- next.set(id, element);
2495
- return next;
2496
- });
2497
- setBoundsVersion((version) => version + 1);
2498
- };
2499
- const getBoundsForCell = (id) => {
2500
- boundsVersion();
2501
- const element = cellRefs().get(id);
2502
- if (!element) return void 0;
2503
- const rect = element.getBoundingClientRect();
2504
- return {
2505
- x: rect.x,
2506
- y: rect.y,
2507
- width: rect.width,
2508
- height: rect.height,
2509
- borderRadius: `${TARGET_BORDER_RADIUS_PX}px`,
2510
- transform: ""
2511
- };
2512
- };
2513
- let resizeObserver;
2514
- let containerRef;
2515
- const handleScroll = () => {
2516
- setBoundsVersion((version) => version + 1);
2517
- };
2518
- const setupResizeObserver = (container) => {
2519
- containerRef = container;
2520
- resizeObserver = new ResizeObserver(() => {
2521
- setBoundsVersion((version) => version + 1);
2522
- });
2523
- resizeObserver.observe(container);
2524
- window.addEventListener("scroll", handleScroll, true);
2525
- container.addEventListener("scroll", handleScroll, true);
2526
- };
2527
- onCleanup(() => {
2528
- resizeObserver?.disconnect();
2529
- window.removeEventListener("scroll", handleScroll, true);
2530
- containerRef?.removeEventListener("scroll", handleScroll, true);
2531
- });
2532
- const hasAnimation = (state) => Boolean(state.animationSequence?.length);
2533
- const matchesSearch = (state) => {
2534
- const query = searchQuery().toLowerCase().trim();
2535
- if (!query) return true;
2536
- return state.label.toLowerCase().includes(query) || state.description.toLowerCase().includes(query) || state.id.toLowerCase().includes(query) || (state.props.componentName?.toLowerCase().includes(query) ?? false) || (state.props.tagName?.toLowerCase().includes(query) ?? false);
2537
- };
2538
- const starredStates = () => DESIGN_SYSTEM_STATES.filter((state) => starredIds().has(state.id) && matchesSearch(state));
2539
- const labelStates = () => DESIGN_SYSTEM_STATES.filter((state) => state.component === "label" && !state.props.hasAgent && !hasAnimation(state) && matchesSearch(state));
2540
- const contextMenuStates = () => DESIGN_SYSTEM_STATES.filter((state) => state.component === "context-menu" && !hasAnimation(state) && matchesSearch(state));
2541
- const toolbarStates = () => DESIGN_SYSTEM_STATES.filter((state) => state.component === "toolbar" && !hasAnimation(state) && matchesSearch(state));
2542
- const agentLabelStates = () => DESIGN_SYSTEM_STATES.filter((state) => state.component === "label" && state.props.hasAgent && !hasAnimation(state) && matchesSearch(state));
2543
- const flowStates = () => DESIGN_SYSTEM_STATES.filter((state) => hasAnimation(state) && matchesSearch(state));
2544
- const createRefreshHandler = (id) => () => {
2545
- setCellRefs((prev) => {
2546
- const next = new Map(prev);
2547
- next.delete(id);
2548
- return next;
2549
- });
2550
- };
2551
- return (() => {
2552
- var _el$17 = _tmpl$11(), _el$18 = _el$17.firstChild, _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild, _el$21 = _el$20.firstChild, _el$22 = _el$21.firstChild, _el$23 = _el$22.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$20.nextSibling, _el$26 = _el$19.nextSibling, _el$27 = _el$26.firstChild, _el$28 = _el$26.nextSibling, _el$29 = _el$28.firstChild, _el$30 = _el$29.nextSibling, _el$31 = _el$30.nextSibling;
2553
- use(setupResizeObserver, _el$17);
2554
- _el$27.$$input = (event) => setSearchQuery(event.currentTarget.value);
2555
- _el$29.$$click = () => setIsScrambled((prev) => !prev);
2556
- insert(_el$29, () => isScrambled() ? "\u2713 Scramble" : "Scramble");
2557
- _el$30.$$click = handleRefresh;
2558
- _el$31.$$click = handleToggleTheme;
2559
- insert(_el$31, () => isDarkMode() ? "Dark" : "Light");
2560
- insert(_el$17, createComponent(Show, {
2561
- get when() {
2562
- return !isRefreshing();
2563
- },
2564
- get children() {
2565
- return [createComponent(Show, {
2566
- get when() {
2567
- return starredStates().length > 0;
2568
- },
2569
- get children() {
2570
- var _el$32 = _tmpl$6(), _el$33 = _el$32.firstChild, _el$34 = _el$33.firstChild, _el$36 = _el$34.nextSibling; _el$36.nextSibling; var _el$37 = _el$33.nextSibling;
2571
- insert(_el$33, () => starredStates().length, _el$36);
2572
- insert(_el$37, createComponent(For, {
2573
- get each() {
2574
- return starredStates();
2575
- },
2576
- children: (state) => createComponent(StateCard, {
2577
- state,
2578
- get theme() {
2579
- return theme();
2580
- },
2581
- getBounds: () => getBoundsForCell(state.id),
2582
- registerCell: (element) => registerCell(state.id, element),
2583
- get onRefresh() {
2584
- return createRefreshHandler(state.id);
2585
- },
2586
- getTargetDisplayText: () => getTargetDisplayText(state),
2587
- get isStarred() {
2588
- return isStarred(state.id);
2589
- },
2590
- onToggleStar: () => handleToggleStar(state.id),
2591
- get isScrambled() {
2592
- return isScrambled();
2593
- }
2594
- })
2595
- }));
2596
- createRenderEffect((_p$) => {
2597
- var _v$17 = {
2598
- ...sectionTitleStyle()
2599
- }, _v$18 = gridStyle();
2600
- _p$.e = style(_el$33, _v$17, _p$.e);
2601
- _p$.t = style(_el$37, _v$18, _p$.t);
2602
- return _p$;
2603
- }, {
2604
- e: void 0,
2605
- t: void 0
2606
- });
2607
- return _el$32;
2608
- }
2609
- }), createComponent(Show, {
2610
- get when() {
2611
- return flowStates().length > 0;
2612
- },
2613
- get children() {
2614
- var _el$38 = _tmpl$7(), _el$39 = _el$38.firstChild, _el$40 = _el$39.nextSibling;
2615
- insert(_el$40, createComponent(For, {
2616
- get each() {
2617
- return flowStates();
2618
- },
2619
- children: (state) => createComponent(StateCard, {
2620
- state,
2621
- get theme() {
2622
- return theme();
2623
- },
2624
- getBounds: () => getBoundsForCell(state.id),
2625
- registerCell: (element) => registerCell(state.id, element),
2626
- get onRefresh() {
2627
- return createRefreshHandler(state.id);
2628
- },
2629
- getTargetDisplayText: () => getTargetDisplayText(state),
2630
- get isStarred() {
2631
- return isStarred(state.id);
2632
- },
2633
- onToggleStar: () => handleToggleStar(state.id),
2634
- get isScrambled() {
2635
- return isScrambled();
2636
- }
2637
- })
2638
- }));
2639
- createRenderEffect((_p$) => {
2640
- var _v$19 = sectionTitleStyle(), _v$20 = gridStyle();
2641
- _p$.e = style(_el$39, _v$19, _p$.e);
2642
- _p$.t = style(_el$40, _v$20, _p$.t);
2643
- return _p$;
2644
- }, {
2645
- e: void 0,
2646
- t: void 0
2647
- });
2648
- return _el$38;
2649
- }
2650
- }), createComponent(Show, {
2651
- get when() {
2652
- return labelStates().length > 0;
2653
- },
2654
- get children() {
2655
- var _el$41 = _tmpl$8(), _el$42 = _el$41.firstChild, _el$43 = _el$42.nextSibling;
2656
- insert(_el$43, createComponent(For, {
2657
- get each() {
2658
- return labelStates();
2659
- },
2660
- children: (state) => createComponent(StateCard, {
2661
- state,
2662
- get theme() {
2663
- return theme();
2664
- },
2665
- getBounds: () => getBoundsForCell(state.id),
2666
- registerCell: (element) => registerCell(state.id, element),
2667
- get onRefresh() {
2668
- return createRefreshHandler(state.id);
2669
- },
2670
- getTargetDisplayText: () => getTargetDisplayText(state),
2671
- get isStarred() {
2672
- return isStarred(state.id);
2673
- },
2674
- onToggleStar: () => handleToggleStar(state.id),
2675
- get isScrambled() {
2676
- return isScrambled();
2677
- }
2678
- })
2679
- }));
2680
- createRenderEffect((_p$) => {
2681
- var _v$21 = sectionTitleStyle(), _v$22 = gridStyle();
2682
- _p$.e = style(_el$42, _v$21, _p$.e);
2683
- _p$.t = style(_el$43, _v$22, _p$.t);
2684
- return _p$;
2685
- }, {
2686
- e: void 0,
2687
- t: void 0
2688
- });
2689
- return _el$41;
2690
- }
2691
- }), createComponent(Show, {
2692
- get when() {
2693
- return contextMenuStates().length > 0;
2694
- },
2695
- get children() {
2696
- var _el$44 = _tmpl$9(), _el$45 = _el$44.firstChild, _el$46 = _el$45.nextSibling;
2697
- insert(_el$46, createComponent(For, {
2698
- get each() {
2699
- return contextMenuStates();
2700
- },
2701
- children: (state) => createComponent(StateCard, {
2702
- state,
2703
- get theme() {
2704
- return theme();
2705
- },
2706
- getBounds: () => getBoundsForCell(state.id),
2707
- registerCell: (element) => registerCell(state.id, element),
2708
- get onRefresh() {
2709
- return createRefreshHandler(state.id);
2710
- },
2711
- getTargetDisplayText: () => getTargetDisplayText(state),
2712
- get isStarred() {
2713
- return isStarred(state.id);
2714
- },
2715
- onToggleStar: () => handleToggleStar(state.id),
2716
- get isScrambled() {
2717
- return isScrambled();
2718
- }
2719
- })
2720
- }));
2721
- createRenderEffect((_p$) => {
2722
- var _v$23 = sectionTitleStyle(), _v$24 = gridStyle();
2723
- _p$.e = style(_el$45, _v$23, _p$.e);
2724
- _p$.t = style(_el$46, _v$24, _p$.t);
2725
- return _p$;
2726
- }, {
2727
- e: void 0,
2728
- t: void 0
2729
- });
2730
- return _el$44;
2731
- }
2732
- }), createComponent(Show, {
2733
- get when() {
2734
- return toolbarStates().length > 0;
2735
- },
2736
- get children() {
2737
- var _el$47 = _tmpl$0(), _el$48 = _el$47.firstChild, _el$49 = _el$48.nextSibling;
2738
- insert(_el$49, createComponent(For, {
2739
- get each() {
2740
- return toolbarStates();
2741
- },
2742
- children: (state) => createComponent(StateCard, {
2743
- state,
2744
- get theme() {
2745
- return theme();
2746
- },
2747
- getBounds: () => getBoundsForCell(state.id),
2748
- registerCell: (element) => registerCell(state.id, element),
2749
- get onRefresh() {
2750
- return createRefreshHandler(state.id);
2751
- },
2752
- getTargetDisplayText: () => getTargetDisplayText(state),
2753
- get isStarred() {
2754
- return isStarred(state.id);
2755
- },
2756
- onToggleStar: () => handleToggleStar(state.id),
2757
- get isScrambled() {
2758
- return isScrambled();
2759
- }
2760
- })
2761
- }));
2762
- createRenderEffect((_p$) => {
2763
- var _v$25 = sectionTitleStyle(), _v$26 = gridStyle();
2764
- _p$.e = style(_el$48, _v$25, _p$.e);
2765
- _p$.t = style(_el$49, _v$26, _p$.t);
2766
- return _p$;
2767
- }, {
2768
- e: void 0,
2769
- t: void 0
2770
- });
2771
- return _el$47;
2772
- }
2773
- }), createComponent(Show, {
2774
- get when() {
2775
- return agentLabelStates().length > 0;
2776
- },
2777
- get children() {
2778
- var _el$50 = _tmpl$1(), _el$51 = _el$50.firstChild, _el$52 = _el$51.nextSibling;
2779
- insert(_el$52, createComponent(For, {
2780
- get each() {
2781
- return agentLabelStates();
2782
- },
2783
- children: (state) => createComponent(StateCard, {
2784
- state,
2785
- get theme() {
2786
- return theme();
2787
- },
2788
- getBounds: () => getBoundsForCell(state.id),
2789
- registerCell: (element) => registerCell(state.id, element),
2790
- get onRefresh() {
2791
- return createRefreshHandler(state.id);
2792
- },
2793
- getTargetDisplayText: () => getTargetDisplayText(state),
2794
- get isStarred() {
2795
- return isStarred(state.id);
2796
- },
2797
- onToggleStar: () => handleToggleStar(state.id),
2798
- get isScrambled() {
2799
- return isScrambled();
2800
- }
2801
- })
2802
- }));
2803
- createRenderEffect((_p$) => {
2804
- var _v$27 = sectionTitleStyle(), _v$28 = gridStyle();
2805
- _p$.e = style(_el$51, _v$27, _p$.e);
2806
- _p$.t = style(_el$52, _v$28, _p$.t);
2807
- return _p$;
2808
- }, {
2809
- e: void 0,
2810
- t: void 0
2811
- });
2812
- return _el$50;
2813
- }
2814
- }), createComponent(Show, {
2815
- get when() {
2816
- return memo(() => !!searchQuery().trim())() && starredStates().length + flowStates().length + labelStates().length + contextMenuStates().length + toolbarStates().length + agentLabelStates().length === 0;
2817
- },
2818
- get children() {
2819
- var _el$53 = _tmpl$10(), _el$54 = _el$53.firstChild, _el$55 = _el$54.firstChild, _el$57 = _el$55.nextSibling; _el$57.nextSibling;
2820
- insert(_el$54, searchQuery, _el$57);
2821
- createRenderEffect((_$p) => setStyleProperty(_el$54, "color", theme().descriptionText));
2822
- return _el$53;
2823
- }
2824
- })];
2825
- }
2826
- }), null);
2827
- insert(_el$17, createComponent(FpsMeter, {
2828
- get theme() {
2829
- return theme();
2830
- }
2831
- }), null);
2832
- createRenderEffect((_p$) => {
2833
- var _v$29 = theme().background, _v$30 = `1px solid ${theme().cardBorder}`, _v$31 = theme().titleText, _v$32 = theme().titleText, _v$33 = `1px solid ${theme().cardBorder}`, _v$34 = theme().cardBackground, _v$35 = theme().titleText, _v$36 = {
2834
- ...createToggleButtonStyle(theme()),
2835
- "background-color": isScrambled() ? "rgba(215, 95, 203, 0.2)" : theme().toggleBackground,
2836
- "border-color": isScrambled() ? "rgba(215, 95, 203, 0.5)" : theme().toggleBorder
2837
- }, _v$37 = createToggleButtonStyle(theme()), _v$38 = createToggleButtonStyle(theme());
2838
- _v$29 !== _p$.e && setStyleProperty(_el$17, "background-color", _p$.e = _v$29);
2839
- _v$30 !== _p$.t && setStyleProperty(_el$18, "border-bottom", _p$.t = _v$30);
2840
- _v$31 !== _p$.a && setAttribute(_el$24, "fill", _p$.a = _v$31);
2841
- _v$32 !== _p$.o && setStyleProperty(_el$25, "color", _p$.o = _v$32);
2842
- _v$33 !== _p$.i && setStyleProperty(_el$27, "border", _p$.i = _v$33);
2843
- _v$34 !== _p$.n && setStyleProperty(_el$27, "background-color", _p$.n = _v$34);
2844
- _v$35 !== _p$.s && setStyleProperty(_el$27, "color", _p$.s = _v$35);
2845
- _p$.h = style(_el$29, _v$36, _p$.h);
2846
- _p$.r = style(_el$30, _v$37, _p$.r);
2847
- _p$.d = style(_el$31, _v$38, _p$.d);
2848
- return _p$;
2849
- }, {
2850
- e: void 0,
2851
- t: void 0,
2852
- a: void 0,
2853
- o: void 0,
2854
- i: void 0,
2855
- n: void 0,
2856
- s: void 0,
2857
- h: void 0,
2858
- r: void 0,
2859
- d: void 0
2860
- });
2861
- createRenderEffect(() => _el$27.value = searchQuery());
2862
- return _el$17;
2863
- })();
2864
- };
2865
- var renderDesignSystemPreview = (container, options) => {
2866
- const shadowHost = document.createElement("div");
2867
- shadowHost.setAttribute("data-react-grab-design-system", "true");
2868
- shadowHost.style.position = "relative";
2869
- shadowHost.style.width = "100%";
2870
- shadowHost.style.minHeight = "100vh";
2871
- const shadowRoot = shadowHost.attachShadow({
2872
- mode: "open"
2873
- });
2874
- if (styles_default) {
2875
- const styleElement = document.createElement("style");
2876
- styleElement.textContent = styles_default;
2877
- shadowRoot.appendChild(styleElement);
2878
- }
2879
- const fontLink = document.createElement("link");
2880
- fontLink.rel = "stylesheet";
2881
- fontLink.href = "https://fonts.googleapis.com/css2?family=Geist:wght@500&display=swap";
2882
- shadowRoot.appendChild(fontLink);
2883
- const renderRoot = document.createElement("div");
2884
- renderRoot.style.width = "100%";
2885
- shadowRoot.appendChild(renderRoot);
2886
- container.appendChild(shadowHost);
2887
- const dispose = render(() => createComponent(DesignSystemGrid, {}), renderRoot);
2888
- return () => {
2889
- dispose();
2890
- container.removeChild(shadowHost);
2891
- options?.onDispose?.();
2892
- };
2893
- };
2894
- delegateEvents(["click", "input"]);
2895
-
2896
- export { renderDesignSystemPreview };