@flowsterix/react 0.11.0 → 0.12.0
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.
- package/dist/chunk-D5LQLRSU.cjs +289 -0
- package/dist/chunk-FCOKCGV3.cjs +21 -0
- package/dist/chunk-HPVLOLCD.cjs +1 -0
- package/dist/components/TourPopoverPortal.d.ts +1 -1
- package/dist/components/TourPopoverPortal.d.ts.map +1 -1
- package/dist/context.d.ts +6 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/devtools/DevToolsProvider.d.ts.map +1 -1
- package/dist/devtools/components/FlowEditModal.d.ts.map +1 -1
- package/dist/devtools/components/FlowItem.d.ts.map +1 -1
- package/dist/devtools/components/GrabberOverlay.d.ts +1 -0
- package/dist/devtools/components/GrabberOverlay.d.ts.map +1 -1
- package/dist/devtools/components/StepItem.d.ts.map +1 -1
- package/dist/devtools/components/StepList.d.ts.map +1 -1
- package/dist/devtools/components/TabNav.d.ts.map +1 -1
- package/dist/devtools/components/Toolbar.d.ts.map +1 -1
- package/dist/devtools/globalBridge.d.ts +24 -0
- package/dist/devtools/globalBridge.d.ts.map +1 -0
- package/dist/devtools/hooks/useFlowsData.d.ts.map +1 -1
- package/dist/devtools/index.cjs +849 -577
- package/dist/devtools/index.mjs +605 -281
- package/dist/devtools/motion.d.ts +64 -0
- package/dist/devtools/motion.d.ts.map +1 -0
- package/dist/hooks/useHiddenTargetFallback.d.ts.map +1 -1
- package/dist/hooks/useTourOverlay.d.ts.map +1 -1
- package/dist/index.cjs +701 -927
- package/dist/index.mjs +116 -42
- package/dist/router/index.cjs +13 -202
- package/dist/router/nextAppRouterAdapter.cjs +11 -200
- package/dist/router/nextPagesRouterAdapter.cjs +10 -199
- package/dist/router/reactRouterAdapter.cjs +10 -199
- package/dist/router/tanstackRouterAdapter.cjs +22 -214
- package/package.json +1 -1
package/dist/devtools/index.cjs
CHANGED
|
@@ -1,67 +1,93 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkFCOKCGV3cjs = require('../chunk-FCOKCGV3.cjs');
|
|
6
|
+
|
|
7
|
+
// src/devtools/DevToolsProvider.tsx
|
|
8
|
+
var _react = require('react');
|
|
9
|
+
var _reactdom = require('react-dom');
|
|
10
|
+
var _react3 = require('motion/react');
|
|
11
|
+
|
|
12
|
+
// src/devtools/motion.ts
|
|
13
|
+
|
|
14
|
+
var springs = {
|
|
15
|
+
snappy: {
|
|
16
|
+
type: "spring",
|
|
17
|
+
damping: 30,
|
|
18
|
+
stiffness: 500,
|
|
19
|
+
mass: 0.5
|
|
20
|
+
},
|
|
21
|
+
smooth: {
|
|
22
|
+
type: "spring",
|
|
23
|
+
damping: 30,
|
|
24
|
+
stiffness: 300,
|
|
25
|
+
mass: 0.8
|
|
26
|
+
},
|
|
27
|
+
bouncy: {
|
|
28
|
+
type: "spring",
|
|
29
|
+
damping: 15,
|
|
30
|
+
stiffness: 400,
|
|
31
|
+
mass: 0.5
|
|
32
|
+
}
|
|
9
33
|
};
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
34
|
+
var stagger = {
|
|
35
|
+
fast: {
|
|
36
|
+
staggerChildren: 0.03,
|
|
37
|
+
delayChildren: 0.05
|
|
38
|
+
},
|
|
39
|
+
default: {
|
|
40
|
+
staggerChildren: 0.05,
|
|
41
|
+
delayChildren: 0.1
|
|
15
42
|
}
|
|
16
|
-
return to;
|
|
17
43
|
};
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
var import_react17 = require("motion/react");
|
|
44
|
+
var listItemVariants = {
|
|
45
|
+
hidden: {
|
|
46
|
+
opacity: 0,
|
|
47
|
+
y: 8,
|
|
48
|
+
scale: 0.98
|
|
49
|
+
},
|
|
50
|
+
visible: {
|
|
51
|
+
opacity: 1,
|
|
52
|
+
y: 0,
|
|
53
|
+
scale: 1
|
|
54
|
+
},
|
|
55
|
+
exit: {
|
|
56
|
+
opacity: 0,
|
|
57
|
+
scale: 0.95,
|
|
58
|
+
transition: { duration: 0.15 }
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
var listContainerVariants = {
|
|
62
|
+
hidden: { opacity: 0 },
|
|
63
|
+
visible: {
|
|
64
|
+
opacity: 1,
|
|
65
|
+
transition: stagger.fast
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
function useReducedMotion() {
|
|
69
|
+
const [prefersReducedMotion, setPrefersReducedMotion] = _react.useState.call(void 0, false);
|
|
70
|
+
_react.useEffect.call(void 0, () => {
|
|
71
|
+
const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
72
|
+
setPrefersReducedMotion(mediaQuery.matches);
|
|
73
|
+
const handler = (event) => {
|
|
74
|
+
setPrefersReducedMotion(event.matches);
|
|
75
|
+
};
|
|
76
|
+
mediaQuery.addEventListener("change", handler);
|
|
77
|
+
return () => mediaQuery.removeEventListener("change", handler);
|
|
78
|
+
}, []);
|
|
79
|
+
return prefersReducedMotion;
|
|
80
|
+
}
|
|
56
81
|
|
|
57
82
|
// src/devtools/components/GrabberOverlay.tsx
|
|
58
|
-
|
|
59
|
-
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
60
86
|
|
|
61
87
|
// src/devtools/utils/sourceExtractor.ts
|
|
62
88
|
function getReactFiber(element) {
|
|
63
89
|
const hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
64
|
-
if (hook
|
|
90
|
+
if (_optionalChain([hook, 'optionalAccess', _ => _.renderers])) {
|
|
65
91
|
for (const renderer of hook.renderers.values()) {
|
|
66
92
|
if (renderer.findFiberByHostInstance) {
|
|
67
93
|
const fiber = renderer.findFiberByHostInstance(element);
|
|
@@ -101,10 +127,10 @@ function findDebugSource(fiber) {
|
|
|
101
127
|
return {
|
|
102
128
|
fileName: source.fileName,
|
|
103
129
|
lineNumber: source.lineNumber,
|
|
104
|
-
columnNumber: source.columnNumber
|
|
130
|
+
columnNumber: _nullishCoalesce(source.columnNumber, () => ( 0))
|
|
105
131
|
};
|
|
106
132
|
}
|
|
107
|
-
current = current.return
|
|
133
|
+
current = _nullishCoalesce(current.return, () => ( null));
|
|
108
134
|
depth++;
|
|
109
135
|
}
|
|
110
136
|
return null;
|
|
@@ -116,7 +142,7 @@ function extractSource(params) {
|
|
|
116
142
|
const fiber = getReactFiber(element);
|
|
117
143
|
if (!fiber) return null;
|
|
118
144
|
return findDebugSource(fiber);
|
|
119
|
-
} catch {
|
|
145
|
+
} catch (e2) {
|
|
120
146
|
return null;
|
|
121
147
|
}
|
|
122
148
|
}
|
|
@@ -135,11 +161,11 @@ function extractComponentHierarchy(params) {
|
|
|
135
161
|
if (name && !hierarchy.includes(name)) {
|
|
136
162
|
hierarchy.push(name);
|
|
137
163
|
}
|
|
138
|
-
current = current.return
|
|
164
|
+
current = _nullishCoalesce(current.return, () => ( null));
|
|
139
165
|
depth++;
|
|
140
166
|
}
|
|
141
167
|
return hierarchy;
|
|
142
|
-
} catch {
|
|
168
|
+
} catch (e3) {
|
|
143
169
|
return hierarchy;
|
|
144
170
|
}
|
|
145
171
|
}
|
|
@@ -154,7 +180,7 @@ function getVSCodeLink(params) {
|
|
|
154
180
|
}
|
|
155
181
|
|
|
156
182
|
// src/devtools/components/GrabberOverlay.tsx
|
|
157
|
-
var
|
|
183
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
158
184
|
var styles = {
|
|
159
185
|
root: {
|
|
160
186
|
position: "fixed",
|
|
@@ -170,6 +196,10 @@ var styles = {
|
|
|
170
196
|
pointerEvents: "none",
|
|
171
197
|
boxShadow: "0 0 0 4px hsl(217 91% 60% / 0.15), 0 4px 20px hsl(217 91% 60% / 0.2)"
|
|
172
198
|
},
|
|
199
|
+
highlightPulse: {
|
|
200
|
+
boxShadow: "0 0 0 8px hsl(142 71% 55% / 0.3), 0 4px 20px hsl(142 71% 55% / 0.4)",
|
|
201
|
+
borderColor: "hsl(142 71% 55%)"
|
|
202
|
+
},
|
|
173
203
|
label: {
|
|
174
204
|
position: "absolute",
|
|
175
205
|
bottom: "100%",
|
|
@@ -228,7 +258,6 @@ var styles = {
|
|
|
228
258
|
position: "fixed",
|
|
229
259
|
bottom: 20,
|
|
230
260
|
left: "50%",
|
|
231
|
-
transform: "translateX(-50%)",
|
|
232
261
|
display: "flex",
|
|
233
262
|
alignItems: "center",
|
|
234
263
|
gap: 12,
|
|
@@ -272,9 +301,26 @@ var springTransition = {
|
|
|
272
301
|
mass: 0.8
|
|
273
302
|
};
|
|
274
303
|
function GrabberOverlay(props) {
|
|
275
|
-
const { isGrabbing, hoveredInfo, container } = props;
|
|
304
|
+
const { isGrabbing, hoveredInfo, container, onElementSelected } = props;
|
|
305
|
+
const reducedMotion = useReducedMotion();
|
|
306
|
+
const [showPulse, setShowPulse] = _react.useState.call(void 0, false);
|
|
307
|
+
_react.useEffect.call(void 0, () => {
|
|
308
|
+
if (onElementSelected) {
|
|
309
|
+
}
|
|
310
|
+
}, [onElementSelected]);
|
|
311
|
+
_react.useEffect.call(void 0, () => {
|
|
312
|
+
const handlePulse = () => {
|
|
313
|
+
if (reducedMotion) return;
|
|
314
|
+
setShowPulse(true);
|
|
315
|
+
setTimeout(() => setShowPulse(false), 300);
|
|
316
|
+
};
|
|
317
|
+
window.__devtools_pulse = handlePulse;
|
|
318
|
+
return () => {
|
|
319
|
+
delete window.__devtools_pulse;
|
|
320
|
+
};
|
|
321
|
+
}, [reducedMotion]);
|
|
276
322
|
if (typeof window === "undefined") return null;
|
|
277
|
-
const portalContainer = container
|
|
323
|
+
const portalContainer = _nullishCoalesce(container, () => ( document.body));
|
|
278
324
|
const labelStyle = {
|
|
279
325
|
...styles.label
|
|
280
326
|
};
|
|
@@ -288,12 +334,16 @@ function GrabberOverlay(props) {
|
|
|
288
334
|
labelStyle.left = "auto";
|
|
289
335
|
labelStyle.right = 0;
|
|
290
336
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
337
|
+
const highlightStyle = {
|
|
338
|
+
...styles.highlight,
|
|
339
|
+
...showPulse && styles.highlightPulse
|
|
340
|
+
};
|
|
341
|
+
return _reactdom.createPortal.call(void 0,
|
|
342
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles.root, "data-devtools-panel": "", children: [
|
|
343
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react3.AnimatePresence, { children: isGrabbing && hoveredInfo && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
344
|
+
_react3.motion.div,
|
|
295
345
|
{
|
|
296
|
-
style:
|
|
346
|
+
style: highlightStyle,
|
|
297
347
|
initial: {
|
|
298
348
|
top: hoveredInfo.rect.top,
|
|
299
349
|
left: hoveredInfo.rect.left,
|
|
@@ -306,27 +356,28 @@ function GrabberOverlay(props) {
|
|
|
306
356
|
left: hoveredInfo.rect.left,
|
|
307
357
|
width: hoveredInfo.rect.width,
|
|
308
358
|
height: hoveredInfo.rect.height,
|
|
309
|
-
opacity: 1
|
|
359
|
+
opacity: 1,
|
|
360
|
+
scale: showPulse ? 1.02 : 1
|
|
310
361
|
},
|
|
311
362
|
exit: {
|
|
312
363
|
opacity: 0
|
|
313
364
|
},
|
|
314
|
-
transition: springTransition,
|
|
315
|
-
children: /* @__PURE__ */ (0,
|
|
316
|
-
|
|
365
|
+
transition: reducedMotion ? { duration: 0 } : springTransition,
|
|
366
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
367
|
+
_react3.motion.div,
|
|
317
368
|
{
|
|
318
369
|
style: labelStyle,
|
|
319
|
-
initial: { opacity: 0, y: 4 },
|
|
370
|
+
initial: reducedMotion ? {} : { opacity: 0, y: 4 },
|
|
320
371
|
animate: { opacity: 1, y: 0 },
|
|
321
|
-
transition: { delay: 0.03, duration: 0.12 },
|
|
372
|
+
transition: reducedMotion ? { duration: 0 } : { delay: 0.03, duration: 0.12 },
|
|
322
373
|
children: [
|
|
323
|
-
/* @__PURE__ */ (0,
|
|
324
|
-
/* @__PURE__ */ (0,
|
|
374
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles.labelTop, children: [
|
|
375
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: styles.tagBadge, children: [
|
|
325
376
|
"<",
|
|
326
377
|
hoveredInfo.tag,
|
|
327
378
|
">"
|
|
328
379
|
] }),
|
|
329
|
-
hoveredInfo.text && /* @__PURE__ */ (0,
|
|
380
|
+
hoveredInfo.text && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
330
381
|
"span",
|
|
331
382
|
{
|
|
332
383
|
style: {
|
|
@@ -341,9 +392,9 @@ function GrabberOverlay(props) {
|
|
|
341
392
|
}
|
|
342
393
|
)
|
|
343
394
|
] }),
|
|
344
|
-
/* @__PURE__ */ (0,
|
|
345
|
-
hoveredInfo.source && /* @__PURE__ */ (0,
|
|
346
|
-
/* @__PURE__ */ (0,
|
|
395
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: styles.selector, children: hoveredInfo.selector }),
|
|
396
|
+
hoveredInfo.source && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles.source, children: [
|
|
397
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "10", height: "10", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5h-2z" }) }),
|
|
347
398
|
formatSourcePath({ source: hoveredInfo.source })
|
|
348
399
|
] })
|
|
349
400
|
]
|
|
@@ -352,28 +403,28 @@ function GrabberOverlay(props) {
|
|
|
352
403
|
},
|
|
353
404
|
"grabber-highlight"
|
|
354
405
|
) }),
|
|
355
|
-
/* @__PURE__ */ (0,
|
|
356
|
-
|
|
406
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react3.AnimatePresence, { children: isGrabbing && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
407
|
+
_react3.motion.div,
|
|
357
408
|
{
|
|
358
409
|
style: styles.hint,
|
|
359
|
-
initial: { opacity: 0, y: 10, scale: 0.95 },
|
|
360
|
-
animate: { opacity: 1, y: 0, scale: 1 },
|
|
361
|
-
exit: { opacity: 0, y: 10, scale: 0.95 },
|
|
362
|
-
transition: { duration: 0
|
|
410
|
+
initial: reducedMotion ? {} : { opacity: 0, y: 10, scale: 0.95, x: "-50%" },
|
|
411
|
+
animate: { opacity: 1, y: 0, scale: 1, x: "-50%" },
|
|
412
|
+
exit: reducedMotion ? {} : { opacity: 0, y: 10, scale: 0.95, x: "-50%" },
|
|
413
|
+
transition: reducedMotion ? { duration: 0 } : springs.smooth,
|
|
363
414
|
children: [
|
|
364
|
-
/* @__PURE__ */ (0,
|
|
365
|
-
/* @__PURE__ */ (0,
|
|
366
|
-
/* @__PURE__ */ (0,
|
|
415
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles.hintItem, children: [
|
|
416
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: styles.kbd, children: "Click" }),
|
|
417
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Add step" })
|
|
367
418
|
] }),
|
|
368
|
-
/* @__PURE__ */ (0,
|
|
369
|
-
/* @__PURE__ */ (0,
|
|
370
|
-
/* @__PURE__ */ (0,
|
|
371
|
-
/* @__PURE__ */ (0,
|
|
419
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: styles.divider }),
|
|
420
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles.hintItem, children: [
|
|
421
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: styles.kbd, children: "ESC" }),
|
|
422
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Cancel" })
|
|
372
423
|
] }),
|
|
373
|
-
/* @__PURE__ */ (0,
|
|
374
|
-
/* @__PURE__ */ (0,
|
|
375
|
-
/* @__PURE__ */ (0,
|
|
376
|
-
/* @__PURE__ */ (0,
|
|
424
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: styles.divider }),
|
|
425
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles.hintItem, children: [
|
|
426
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: styles.kbd, children: "Ctrl+Shift+G" }),
|
|
427
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Toggle" })
|
|
377
428
|
] })
|
|
378
429
|
]
|
|
379
430
|
},
|
|
@@ -385,14 +436,29 @@ function GrabberOverlay(props) {
|
|
|
385
436
|
}
|
|
386
437
|
|
|
387
438
|
// src/devtools/components/StepList.tsx
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
var _core = require('@dnd-kit/core');
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
var _sortable = require('@dnd-kit/sortable');
|
|
391
455
|
|
|
392
456
|
// src/devtools/components/StepItem.tsx
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
var
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
var _utilities = require('@dnd-kit/utilities');
|
|
460
|
+
|
|
461
|
+
|
|
396
462
|
var styles2 = {
|
|
397
463
|
card: {
|
|
398
464
|
display: "flex",
|
|
@@ -403,7 +469,12 @@ var styles2 = {
|
|
|
403
469
|
border: "1px solid hsl(215 20% 22%)",
|
|
404
470
|
fontSize: 12,
|
|
405
471
|
fontFamily: "inherit",
|
|
406
|
-
overflow: "hidden"
|
|
472
|
+
overflow: "hidden",
|
|
473
|
+
transition: "border-color 0.15s ease, box-shadow 0.15s ease"
|
|
474
|
+
},
|
|
475
|
+
cardHover: {
|
|
476
|
+
borderColor: "hsl(217 91% 55% / 0.4)",
|
|
477
|
+
boxShadow: "0 0 0 2px hsl(217 91% 55% / 0.1), 0 4px 12px rgba(0, 0, 0, 0.2)"
|
|
407
478
|
},
|
|
408
479
|
cardGhost: {
|
|
409
480
|
opacity: 0.4,
|
|
@@ -542,6 +613,8 @@ var styles2 = {
|
|
|
542
613
|
};
|
|
543
614
|
function SortableStepItem(props) {
|
|
544
615
|
const { step, index, onDelete, isBeingDragged = false } = props;
|
|
616
|
+
const [isHovered, setIsHovered] = _react.useState.call(void 0, false);
|
|
617
|
+
const reducedMotion = useReducedMotion();
|
|
545
618
|
const {
|
|
546
619
|
attributes,
|
|
547
620
|
listeners,
|
|
@@ -549,7 +622,7 @@ function SortableStepItem(props) {
|
|
|
549
622
|
transform,
|
|
550
623
|
transition,
|
|
551
624
|
isDragging
|
|
552
|
-
} = (0,
|
|
625
|
+
} = _sortable.useSortable.call(void 0, { id: step.id });
|
|
553
626
|
const handleCopySource = async () => {
|
|
554
627
|
if (step.source) {
|
|
555
628
|
const path = formatSourcePath({ source: step.source });
|
|
@@ -558,91 +631,113 @@ function SortableStepItem(props) {
|
|
|
558
631
|
};
|
|
559
632
|
const isGhost = isDragging || isBeingDragged;
|
|
560
633
|
const wrapperStyle = {
|
|
561
|
-
transform:
|
|
562
|
-
transition: transition
|
|
634
|
+
transform: _utilities.CSS.Transform.toString(transform),
|
|
635
|
+
transition: _nullishCoalesce(transition, () => ( "transform 200ms ease"))
|
|
563
636
|
};
|
|
564
637
|
const cardStyle = {
|
|
565
638
|
...styles2.card,
|
|
639
|
+
...isHovered && !isGhost && styles2.cardHover,
|
|
566
640
|
...isGhost && styles2.cardGhost
|
|
567
641
|
};
|
|
568
642
|
const handleStyle = {
|
|
569
643
|
...styles2.dragHandle
|
|
570
644
|
};
|
|
571
|
-
return /* @__PURE__ */
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
/* @__PURE__ */ (0,
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
"
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
),
|
|
611
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
612
|
-
"button",
|
|
613
|
-
{
|
|
614
|
-
type: "button",
|
|
615
|
-
style: styles2.copyButton,
|
|
616
|
-
onClick: handleCopySource,
|
|
617
|
-
title: "Copy path",
|
|
618
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
645
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
646
|
+
"div",
|
|
647
|
+
{
|
|
648
|
+
ref: setNodeRef,
|
|
649
|
+
style: wrapperStyle,
|
|
650
|
+
onMouseEnter: () => setIsHovered(true),
|
|
651
|
+
onMouseLeave: () => setIsHovered(false),
|
|
652
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: cardStyle, children: [
|
|
653
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: handleStyle, ...attributes, ...listeners, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width: "10", height: "16", viewBox: "0 0 10 16", fill: "currentColor", children: [
|
|
654
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "3", cy: "2", r: "1.5" }),
|
|
655
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "7", cy: "2", r: "1.5" }),
|
|
656
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "3", cy: "8", r: "1.5" }),
|
|
657
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "7", cy: "8", r: "1.5" }),
|
|
658
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "3", cy: "14", r: "1.5" }),
|
|
659
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "7", cy: "14", r: "1.5" })
|
|
660
|
+
] }) }),
|
|
661
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles2.content, children: [
|
|
662
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles2.header, children: [
|
|
663
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
664
|
+
_react3.motion.span,
|
|
665
|
+
{
|
|
666
|
+
style: styles2.order,
|
|
667
|
+
initial: reducedMotion ? {} : { scale: 1.2 },
|
|
668
|
+
animate: { scale: 1 },
|
|
669
|
+
transition: reducedMotion ? { duration: 0 } : springs.bouncy,
|
|
670
|
+
children: index + 1
|
|
671
|
+
},
|
|
672
|
+
`order-${index}`
|
|
673
|
+
),
|
|
674
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: styles2.tagBadge, children: [
|
|
675
|
+
"<",
|
|
676
|
+
step.elementTag,
|
|
677
|
+
">"
|
|
678
|
+
] }),
|
|
679
|
+
step.elementText && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: styles2.text, children: step.elementText })
|
|
680
|
+
] }),
|
|
681
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: styles2.selector, children: step.selector }),
|
|
682
|
+
step.source && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles2.sourceRow, children: [
|
|
683
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
619
684
|
"svg",
|
|
620
685
|
{
|
|
621
686
|
width: "10",
|
|
622
687
|
height: "10",
|
|
623
688
|
viewBox: "0 0 16 16",
|
|
624
|
-
fill: "
|
|
625
|
-
children:
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
689
|
+
fill: "hsl(142 71% 55%)",
|
|
690
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5h-2z" })
|
|
691
|
+
}
|
|
692
|
+
),
|
|
693
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
694
|
+
"a",
|
|
695
|
+
{
|
|
696
|
+
href: getVSCodeLink({ source: step.source }),
|
|
697
|
+
style: styles2.sourceLink,
|
|
698
|
+
title: "Open in VS Code",
|
|
699
|
+
children: formatSourcePath({ source: step.source })
|
|
700
|
+
}
|
|
701
|
+
),
|
|
702
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
703
|
+
"button",
|
|
704
|
+
{
|
|
705
|
+
type: "button",
|
|
706
|
+
style: styles2.copyButton,
|
|
707
|
+
onClick: handleCopySource,
|
|
708
|
+
title: "Copy path",
|
|
709
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
710
|
+
"svg",
|
|
711
|
+
{
|
|
712
|
+
width: "10",
|
|
713
|
+
height: "10",
|
|
714
|
+
viewBox: "0 0 16 16",
|
|
715
|
+
fill: "currentColor",
|
|
716
|
+
children: [
|
|
717
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M10 2H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM4 1h6a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3H4a3 3 0 0 1-3-3V4a3 3 0 0 1 3-3z" }),
|
|
718
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M14 5a1 1 0 0 1 1 1v8a2 2 0 0 1-2 2H6a1 1 0 0 1 0-2h7V6a1 1 0 0 1 1-1z" })
|
|
719
|
+
]
|
|
720
|
+
}
|
|
721
|
+
)
|
|
629
722
|
}
|
|
630
723
|
)
|
|
724
|
+
] })
|
|
725
|
+
] }),
|
|
726
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
727
|
+
_react3.motion.button,
|
|
728
|
+
{
|
|
729
|
+
type: "button",
|
|
730
|
+
style: styles2.deleteButton,
|
|
731
|
+
onClick: onDelete,
|
|
732
|
+
title: "Delete step",
|
|
733
|
+
whileHover: reducedMotion ? {} : { scale: 1.1, color: "hsl(0 70% 60%)" },
|
|
734
|
+
whileTap: reducedMotion ? {} : { scale: 0.9 },
|
|
735
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" }) })
|
|
631
736
|
}
|
|
632
737
|
)
|
|
633
738
|
] })
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
"button",
|
|
637
|
-
{
|
|
638
|
-
type: "button",
|
|
639
|
-
style: styles2.deleteButton,
|
|
640
|
-
onClick: onDelete,
|
|
641
|
-
title: "Delete step",
|
|
642
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" }) })
|
|
643
|
-
}
|
|
644
|
-
)
|
|
645
|
-
] }) });
|
|
739
|
+
}
|
|
740
|
+
);
|
|
646
741
|
}
|
|
647
742
|
function StepItemDragPreview(props) {
|
|
648
743
|
const { step, index } = props;
|
|
@@ -656,48 +751,48 @@ function StepItemDragPreview(props) {
|
|
|
656
751
|
...styles2.dragHandle,
|
|
657
752
|
...styles2.dragHandleActive
|
|
658
753
|
};
|
|
659
|
-
return /* @__PURE__ */ (0,
|
|
660
|
-
/* @__PURE__ */ (0,
|
|
661
|
-
/* @__PURE__ */ (0,
|
|
662
|
-
/* @__PURE__ */ (0,
|
|
663
|
-
/* @__PURE__ */ (0,
|
|
664
|
-
/* @__PURE__ */ (0,
|
|
665
|
-
/* @__PURE__ */ (0,
|
|
666
|
-
/* @__PURE__ */ (0,
|
|
754
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: cardStyle, children: [
|
|
755
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: handleStyle, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width: "10", height: "16", viewBox: "0 0 10 16", fill: "currentColor", children: [
|
|
756
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "3", cy: "2", r: "1.5" }),
|
|
757
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "7", cy: "2", r: "1.5" }),
|
|
758
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "3", cy: "8", r: "1.5" }),
|
|
759
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "7", cy: "8", r: "1.5" }),
|
|
760
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "3", cy: "14", r: "1.5" }),
|
|
761
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "7", cy: "14", r: "1.5" })
|
|
667
762
|
] }) }),
|
|
668
|
-
/* @__PURE__ */ (0,
|
|
669
|
-
/* @__PURE__ */ (0,
|
|
670
|
-
/* @__PURE__ */ (0,
|
|
671
|
-
/* @__PURE__ */ (0,
|
|
763
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles2.content, children: [
|
|
764
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles2.header, children: [
|
|
765
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: styles2.order, children: index + 1 }),
|
|
766
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: styles2.tagBadge, children: [
|
|
672
767
|
"<",
|
|
673
768
|
step.elementTag,
|
|
674
769
|
">"
|
|
675
770
|
] }),
|
|
676
|
-
step.elementText && /* @__PURE__ */ (0,
|
|
771
|
+
step.elementText && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: styles2.text, children: step.elementText })
|
|
677
772
|
] }),
|
|
678
|
-
/* @__PURE__ */ (0,
|
|
679
|
-
step.source && /* @__PURE__ */ (0,
|
|
680
|
-
/* @__PURE__ */ (0,
|
|
773
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: styles2.selector, children: step.selector }),
|
|
774
|
+
step.source && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles2.sourceRow, children: [
|
|
775
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
681
776
|
"svg",
|
|
682
777
|
{
|
|
683
778
|
width: "10",
|
|
684
779
|
height: "10",
|
|
685
780
|
viewBox: "0 0 16 16",
|
|
686
781
|
fill: "hsl(142 71% 55%)",
|
|
687
|
-
children: /* @__PURE__ */ (0,
|
|
782
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5h-2z" })
|
|
688
783
|
}
|
|
689
784
|
),
|
|
690
|
-
/* @__PURE__ */ (0,
|
|
785
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: styles2.sourceLink, children: formatSourcePath({ source: step.source }) })
|
|
691
786
|
] })
|
|
692
787
|
] }),
|
|
693
|
-
/* @__PURE__ */ (0,
|
|
788
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { ...styles2.deleteButton, visibility: "hidden" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" }) }) })
|
|
694
789
|
] });
|
|
695
790
|
}
|
|
696
791
|
|
|
697
792
|
// src/devtools/components/Toolbar.tsx
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
|
|
701
796
|
var styles3 = {
|
|
702
797
|
toolbar: {
|
|
703
798
|
display: "flex",
|
|
@@ -731,7 +826,8 @@ var styles3 = {
|
|
|
731
826
|
backgroundColor: "rgba(59, 130, 246, 0.15)",
|
|
732
827
|
borderColor: "rgba(59, 130, 246, 0.4)",
|
|
733
828
|
color: "#60a5fa",
|
|
734
|
-
boxShadow: "0 0 0 2px rgba(59, 130, 246, 0.1)"
|
|
829
|
+
boxShadow: "0 0 0 2px rgba(59, 130, 246, 0.1), 0 0 12px rgba(59, 130, 246, 0.2)",
|
|
830
|
+
animation: "grabPulse 2s ease-in-out infinite"
|
|
735
831
|
},
|
|
736
832
|
actionRow: {
|
|
737
833
|
display: "flex",
|
|
@@ -788,11 +884,18 @@ var styles3 = {
|
|
|
788
884
|
fontWeight: 600,
|
|
789
885
|
borderRadius: 4,
|
|
790
886
|
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.3)"
|
|
791
|
-
}
|
|
887
|
+
},
|
|
888
|
+
pulseKeyframes: `
|
|
889
|
+
@keyframes grabPulse {
|
|
890
|
+
0%, 100% { box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1), 0 0 12px rgba(59, 130, 246, 0.2); }
|
|
891
|
+
50% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 0 20px rgba(59, 130, 246, 0.3); }
|
|
892
|
+
}
|
|
893
|
+
`
|
|
792
894
|
};
|
|
793
895
|
function Toolbar(props) {
|
|
794
896
|
const { mode, stepCount, onToggleGrab, onExport, onCopyForAI, onReset } = props;
|
|
795
|
-
const [copied, setCopied] = (0,
|
|
897
|
+
const [copied, setCopied] = _react.useState.call(void 0, false);
|
|
898
|
+
const reducedMotion = useReducedMotion();
|
|
796
899
|
const isGrabbing = mode === "grabbing";
|
|
797
900
|
const hasSteps = stepCount > 0;
|
|
798
901
|
const handleCopy = async () => {
|
|
@@ -817,17 +920,18 @@ function Toolbar(props) {
|
|
|
817
920
|
...!hasSteps && styles3.actionButtonDisabled,
|
|
818
921
|
...hasSteps && styles3.actionButtonDanger
|
|
819
922
|
};
|
|
820
|
-
return /* @__PURE__ */ (0,
|
|
821
|
-
/* @__PURE__ */ (0,
|
|
822
|
-
|
|
923
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles3.toolbar, children: [
|
|
924
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "style", { children: styles3.pulseKeyframes }),
|
|
925
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: styles3.grabRow, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
926
|
+
_react3.motion.button,
|
|
823
927
|
{
|
|
824
928
|
type: "button",
|
|
825
929
|
style: grabButtonStyle,
|
|
826
930
|
onClick: onToggleGrab,
|
|
827
|
-
whileHover: { scale: 1.01 },
|
|
828
|
-
whileTap: { scale: 0.98 },
|
|
829
|
-
children: isGrabbing ? /* @__PURE__ */ (0,
|
|
830
|
-
/* @__PURE__ */ (0,
|
|
931
|
+
whileHover: reducedMotion ? {} : { scale: 1.01 },
|
|
932
|
+
whileTap: reducedMotion ? {} : { scale: 0.98 },
|
|
933
|
+
children: isGrabbing ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
934
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
831
935
|
"svg",
|
|
832
936
|
{
|
|
833
937
|
width: "14",
|
|
@@ -835,8 +939,8 @@ function Toolbar(props) {
|
|
|
835
939
|
viewBox: "0 0 16 16",
|
|
836
940
|
fill: "currentColor",
|
|
837
941
|
children: [
|
|
838
|
-
/* @__PURE__ */ (0,
|
|
839
|
-
/* @__PURE__ */ (0,
|
|
942
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "circle", { cx: "8", cy: "8", r: "3", children: [
|
|
943
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
840
944
|
"animate",
|
|
841
945
|
{
|
|
842
946
|
attributeName: "r",
|
|
@@ -845,7 +949,7 @@ function Toolbar(props) {
|
|
|
845
949
|
repeatCount: "indefinite"
|
|
846
950
|
}
|
|
847
951
|
),
|
|
848
|
-
/* @__PURE__ */ (0,
|
|
952
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
849
953
|
"animate",
|
|
850
954
|
{
|
|
851
955
|
attributeName: "opacity",
|
|
@@ -855,7 +959,7 @@ function Toolbar(props) {
|
|
|
855
959
|
}
|
|
856
960
|
)
|
|
857
961
|
] }),
|
|
858
|
-
/* @__PURE__ */ (0,
|
|
962
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
859
963
|
"circle",
|
|
860
964
|
{
|
|
861
965
|
cx: "8",
|
|
@@ -866,7 +970,7 @@ function Toolbar(props) {
|
|
|
866
970
|
strokeWidth: "1",
|
|
867
971
|
opacity: "0.3",
|
|
868
972
|
children: [
|
|
869
|
-
/* @__PURE__ */ (0,
|
|
973
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
870
974
|
"animate",
|
|
871
975
|
{
|
|
872
976
|
attributeName: "r",
|
|
@@ -875,7 +979,7 @@ function Toolbar(props) {
|
|
|
875
979
|
repeatCount: "indefinite"
|
|
876
980
|
}
|
|
877
981
|
),
|
|
878
|
-
/* @__PURE__ */ (0,
|
|
982
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
879
983
|
"animate",
|
|
880
984
|
{
|
|
881
985
|
attributeName: "opacity",
|
|
@@ -891,85 +995,86 @@ function Toolbar(props) {
|
|
|
891
995
|
}
|
|
892
996
|
),
|
|
893
997
|
"Grabbing..."
|
|
894
|
-
] }) : /* @__PURE__ */ (0,
|
|
895
|
-
/* @__PURE__ */ (0,
|
|
998
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
999
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
896
1000
|
"svg",
|
|
897
1001
|
{
|
|
898
1002
|
width: "14",
|
|
899
1003
|
height: "14",
|
|
900
1004
|
viewBox: "0 0 16 16",
|
|
901
1005
|
fill: "currentColor",
|
|
902
|
-
children: /* @__PURE__ */ (0,
|
|
1006
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M14 0a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h12zM5.904 10.803L10 6.707v2.768a.5.5 0 0 0 1 0V5.5a.5.5 0 0 0-.5-.5H6.525a.5.5 0 1 0 0 1h2.768l-4.096 4.096a.5.5 0 0 0 .707.707z" })
|
|
903
1007
|
}
|
|
904
1008
|
),
|
|
905
1009
|
"Grab Element",
|
|
906
|
-
/* @__PURE__ */ (0,
|
|
1010
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: styles3.kbd, children: "Ctrl+Shift+G" })
|
|
907
1011
|
] })
|
|
908
1012
|
}
|
|
909
1013
|
) }),
|
|
910
|
-
/* @__PURE__ */ (0,
|
|
911
|
-
/* @__PURE__ */ (0,
|
|
912
|
-
|
|
1014
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles3.actionRow, children: [
|
|
1015
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1016
|
+
_react3.motion.button,
|
|
913
1017
|
{
|
|
914
1018
|
type: "button",
|
|
915
1019
|
style: exportButtonStyle,
|
|
916
1020
|
onClick: onExport,
|
|
917
1021
|
disabled: !hasSteps,
|
|
918
|
-
whileHover: hasSteps ? { scale: 1.02 } : {},
|
|
919
|
-
whileTap: hasSteps ? { scale: 0.98 } : {},
|
|
1022
|
+
whileHover: hasSteps && !reducedMotion ? { scale: 1.02 } : {},
|
|
1023
|
+
whileTap: hasSteps && !reducedMotion ? { scale: 0.98 } : {},
|
|
920
1024
|
title: "Download JSON file",
|
|
921
1025
|
children: [
|
|
922
|
-
/* @__PURE__ */ (0,
|
|
923
|
-
/* @__PURE__ */ (0,
|
|
924
|
-
/* @__PURE__ */ (0,
|
|
1026
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width: "11", height: "11", viewBox: "0 0 16 16", fill: "currentColor", children: [
|
|
1027
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z" }),
|
|
1028
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z" })
|
|
925
1029
|
] }),
|
|
926
1030
|
"Export"
|
|
927
1031
|
]
|
|
928
1032
|
}
|
|
929
1033
|
),
|
|
930
|
-
/* @__PURE__ */ (0,
|
|
931
|
-
|
|
1034
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1035
|
+
_react3.motion.button,
|
|
932
1036
|
{
|
|
933
1037
|
type: "button",
|
|
934
1038
|
style: copyButtonStyle,
|
|
935
1039
|
onClick: handleCopy,
|
|
936
1040
|
disabled: !hasSteps,
|
|
937
|
-
whileHover: hasSteps ? { scale: 1.02 } : {},
|
|
938
|
-
whileTap: hasSteps ? { scale: 0.98 } : {},
|
|
1041
|
+
whileHover: hasSteps && !reducedMotion ? { scale: 1.02 } : {},
|
|
1042
|
+
whileTap: hasSteps && !reducedMotion ? { scale: 0.98 } : {},
|
|
939
1043
|
title: "Copy JSON to clipboard",
|
|
940
1044
|
children: [
|
|
941
|
-
/* @__PURE__ */ (0,
|
|
942
|
-
/* @__PURE__ */ (0,
|
|
943
|
-
/* @__PURE__ */ (0,
|
|
1045
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width: "11", height: "11", viewBox: "0 0 16 16", fill: "currentColor", children: [
|
|
1046
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M10 2H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM4 1h6a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3H4a3 3 0 0 1-3-3V4a3 3 0 0 1 3-3z" }),
|
|
1047
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M14 5a1 1 0 0 1 1 1v8a2 2 0 0 1-2 2H6a1 1 0 0 1 0-2h7V6a1 1 0 0 1 1-1z" })
|
|
944
1048
|
] }),
|
|
945
1049
|
"Copy",
|
|
946
|
-
copied && /* @__PURE__ */ (0,
|
|
947
|
-
|
|
1050
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react3.AnimatePresence, { children: copied && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1051
|
+
_react3.motion.span,
|
|
948
1052
|
{
|
|
949
1053
|
style: styles3.copiedBadge,
|
|
950
|
-
initial: { opacity: 0, scale: 0.
|
|
1054
|
+
initial: reducedMotion ? {} : { opacity: 0, scale: 0.5, y: 4 },
|
|
951
1055
|
animate: { opacity: 1, scale: 1, y: 0 },
|
|
952
|
-
exit: { opacity: 0, scale: 0.
|
|
1056
|
+
exit: reducedMotion ? {} : { opacity: 0, scale: 0.5, y: 4 },
|
|
1057
|
+
transition: reducedMotion ? { duration: 0 } : springs.bouncy,
|
|
953
1058
|
children: "Copied!"
|
|
954
1059
|
}
|
|
955
|
-
)
|
|
1060
|
+
) })
|
|
956
1061
|
]
|
|
957
1062
|
}
|
|
958
1063
|
),
|
|
959
|
-
/* @__PURE__ */ (0,
|
|
960
|
-
|
|
1064
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1065
|
+
_react3.motion.button,
|
|
961
1066
|
{
|
|
962
1067
|
type: "button",
|
|
963
1068
|
style: resetButtonStyle,
|
|
964
1069
|
onClick: onReset,
|
|
965
1070
|
disabled: !hasSteps,
|
|
966
|
-
whileHover: hasSteps ? { scale: 1.02 } : {},
|
|
967
|
-
whileTap: hasSteps ? { scale: 0.98 } : {},
|
|
1071
|
+
whileHover: hasSteps && !reducedMotion ? { scale: 1.02 } : {},
|
|
1072
|
+
whileTap: hasSteps && !reducedMotion ? { scale: 0.98 } : {},
|
|
968
1073
|
title: "Clear all steps",
|
|
969
1074
|
children: [
|
|
970
|
-
/* @__PURE__ */ (0,
|
|
971
|
-
/* @__PURE__ */ (0,
|
|
972
|
-
/* @__PURE__ */ (0,
|
|
1075
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width: "11", height: "11", viewBox: "0 0 16 16", fill: "currentColor", children: [
|
|
1076
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" }),
|
|
1077
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
973
1078
|
"path",
|
|
974
1079
|
{
|
|
975
1080
|
fillRule: "evenodd",
|
|
@@ -986,7 +1091,7 @@ function Toolbar(props) {
|
|
|
986
1091
|
}
|
|
987
1092
|
|
|
988
1093
|
// src/devtools/components/StepList.tsx
|
|
989
|
-
|
|
1094
|
+
|
|
990
1095
|
var styles4 = {
|
|
991
1096
|
scrollArea: {
|
|
992
1097
|
flex: 1,
|
|
@@ -1045,23 +1150,24 @@ function StepList(props) {
|
|
|
1045
1150
|
onClearAll,
|
|
1046
1151
|
onExport
|
|
1047
1152
|
} = props;
|
|
1048
|
-
const [activeId, setActiveId] = (0,
|
|
1153
|
+
const [activeId, setActiveId] = _react.useState.call(void 0, null);
|
|
1154
|
+
const reducedMotion = useReducedMotion();
|
|
1049
1155
|
const activeStep = activeId ? steps.find((s) => s.id === activeId) : null;
|
|
1050
1156
|
const activeIndex = activeId ? steps.findIndex((s) => s.id === activeId) : -1;
|
|
1051
|
-
const sensors = (0,
|
|
1052
|
-
(0,
|
|
1157
|
+
const sensors = _core.useSensors.call(void 0,
|
|
1158
|
+
_core.useSensor.call(void 0, _core.PointerSensor, {
|
|
1053
1159
|
activationConstraint: {
|
|
1054
1160
|
distance: 4
|
|
1055
1161
|
}
|
|
1056
1162
|
}),
|
|
1057
|
-
(0,
|
|
1058
|
-
coordinateGetter:
|
|
1163
|
+
_core.useSensor.call(void 0, _core.KeyboardSensor, {
|
|
1164
|
+
coordinateGetter: _sortable.sortableKeyboardCoordinates
|
|
1059
1165
|
})
|
|
1060
1166
|
);
|
|
1061
|
-
const handleDragStart = (0,
|
|
1167
|
+
const handleDragStart = _react.useCallback.call(void 0, (event) => {
|
|
1062
1168
|
setActiveId(event.active.id);
|
|
1063
1169
|
}, []);
|
|
1064
|
-
const handleDragEnd = (0,
|
|
1170
|
+
const handleDragEnd = _react.useCallback.call(void 0,
|
|
1065
1171
|
(event) => {
|
|
1066
1172
|
const { active, over } = event;
|
|
1067
1173
|
setActiveId(null);
|
|
@@ -1075,10 +1181,10 @@ function StepList(props) {
|
|
|
1075
1181
|
},
|
|
1076
1182
|
[steps, onReorderSteps]
|
|
1077
1183
|
);
|
|
1078
|
-
const handleDragCancel = (0,
|
|
1184
|
+
const handleDragCancel = _react.useCallback.call(void 0, () => {
|
|
1079
1185
|
setActiveId(null);
|
|
1080
1186
|
}, []);
|
|
1081
|
-
const handleExportClick = (0,
|
|
1187
|
+
const handleExportClick = _react.useCallback.call(void 0, () => {
|
|
1082
1188
|
const data = onExport();
|
|
1083
1189
|
const blob = new Blob([JSON.stringify(data, null, 2)], {
|
|
1084
1190
|
type: "application/json"
|
|
@@ -1090,18 +1196,18 @@ function StepList(props) {
|
|
|
1090
1196
|
a.click();
|
|
1091
1197
|
URL.revokeObjectURL(url);
|
|
1092
1198
|
}, [onExport]);
|
|
1093
|
-
const handleCopyForAI = (0,
|
|
1199
|
+
const handleCopyForAI = _react.useCallback.call(void 0, async () => {
|
|
1094
1200
|
const data = onExport();
|
|
1095
1201
|
await navigator.clipboard.writeText(JSON.stringify(data, null, 2));
|
|
1096
1202
|
}, [onExport]);
|
|
1097
|
-
const handleReset = (0,
|
|
1203
|
+
const handleReset = _react.useCallback.call(void 0, () => {
|
|
1098
1204
|
if (confirm("Clear all steps? This cannot be undone.")) {
|
|
1099
1205
|
onClearAll();
|
|
1100
1206
|
}
|
|
1101
1207
|
}, [onClearAll]);
|
|
1102
1208
|
if (typeof window === "undefined") return null;
|
|
1103
|
-
return /* @__PURE__ */ (0,
|
|
1104
|
-
/* @__PURE__ */ (0,
|
|
1209
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1210
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1105
1211
|
Toolbar,
|
|
1106
1212
|
{
|
|
1107
1213
|
mode,
|
|
@@ -1112,67 +1218,100 @@ function StepList(props) {
|
|
|
1112
1218
|
onReset: handleReset
|
|
1113
1219
|
}
|
|
1114
1220
|
),
|
|
1115
|
-
/* @__PURE__ */ (0,
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1221
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: styles4.scrollArea, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react3.AnimatePresence, { mode: "wait", children: steps.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1222
|
+
_react3.motion.div,
|
|
1223
|
+
{
|
|
1224
|
+
style: styles4.empty,
|
|
1225
|
+
initial: reducedMotion ? {} : { opacity: 0 },
|
|
1226
|
+
animate: { opacity: 1 },
|
|
1227
|
+
exit: reducedMotion ? {} : { opacity: 0 },
|
|
1228
|
+
transition: { duration: 0.2 },
|
|
1229
|
+
children: [
|
|
1230
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: styles4.emptyIcon, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1231
|
+
"svg",
|
|
1232
|
+
{
|
|
1233
|
+
width: "20",
|
|
1234
|
+
height: "20",
|
|
1235
|
+
viewBox: "0 0 16 16",
|
|
1236
|
+
fill: "hsl(215 20% 45%)",
|
|
1237
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M14 0a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h12zM5.904 10.803L10 6.707v2.768a.5.5 0 0 0 1 0V5.5a.5.5 0 0 0-.5-.5H6.525a.5.5 0 1 0 0 1h2.768l-4.096 4.096a.5.5 0 0 0 .707.707z" })
|
|
1238
|
+
}
|
|
1239
|
+
) }),
|
|
1240
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles4.emptyText, children: [
|
|
1241
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: "No steps captured yet." }),
|
|
1242
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { marginTop: 6 }, children: [
|
|
1243
|
+
"Press ",
|
|
1244
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: styles4.kbd, children: "Ctrl+Shift+G" }),
|
|
1245
|
+
" to grab"
|
|
1246
|
+
] })
|
|
1247
|
+
] })
|
|
1248
|
+
]
|
|
1249
|
+
},
|
|
1250
|
+
"empty-state"
|
|
1251
|
+
) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1252
|
+
_core.DndContext,
|
|
1136
1253
|
{
|
|
1137
1254
|
sensors,
|
|
1138
|
-
collisionDetection:
|
|
1255
|
+
collisionDetection: _core.closestCenter,
|
|
1139
1256
|
onDragStart: handleDragStart,
|
|
1140
1257
|
onDragEnd: handleDragEnd,
|
|
1141
1258
|
onDragCancel: handleDragCancel,
|
|
1142
1259
|
children: [
|
|
1143
|
-
/* @__PURE__ */ (0,
|
|
1144
|
-
|
|
1260
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1261
|
+
_sortable.SortableContext,
|
|
1145
1262
|
{
|
|
1146
1263
|
items: steps.map((s) => s.id),
|
|
1147
|
-
strategy:
|
|
1148
|
-
children: /* @__PURE__ */
|
|
1149
|
-
|
|
1264
|
+
strategy: _sortable.verticalListSortingStrategy,
|
|
1265
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1266
|
+
_react3.motion.div,
|
|
1150
1267
|
{
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1268
|
+
style: styles4.stepList,
|
|
1269
|
+
variants: reducedMotion ? void 0 : listContainerVariants,
|
|
1270
|
+
initial: "hidden",
|
|
1271
|
+
animate: "visible",
|
|
1272
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react3.AnimatePresence, { mode: "popLayout", children: steps.map((step, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1273
|
+
_react3.motion.div,
|
|
1274
|
+
{
|
|
1275
|
+
variants: reducedMotion ? void 0 : listItemVariants,
|
|
1276
|
+
initial: "hidden",
|
|
1277
|
+
animate: "visible",
|
|
1278
|
+
exit: "exit",
|
|
1279
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1280
|
+
SortableStepItem,
|
|
1281
|
+
{
|
|
1282
|
+
step,
|
|
1283
|
+
index,
|
|
1284
|
+
onDelete: () => onDeleteStep({ id: step.id }),
|
|
1285
|
+
isDragActive: activeId !== null,
|
|
1286
|
+
isBeingDragged: step.id === activeId
|
|
1287
|
+
}
|
|
1288
|
+
)
|
|
1289
|
+
},
|
|
1290
|
+
step.id
|
|
1291
|
+
)) })
|
|
1156
1292
|
},
|
|
1157
|
-
step
|
|
1158
|
-
)
|
|
1293
|
+
"step-list"
|
|
1294
|
+
)
|
|
1159
1295
|
}
|
|
1160
1296
|
),
|
|
1161
|
-
/* @__PURE__ */ (0,
|
|
1297
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.DragOverlay, { dropAnimation: null, children: activeStep && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StepItemDragPreview, { step: activeStep, index: activeIndex }) })
|
|
1162
1298
|
]
|
|
1163
1299
|
}
|
|
1164
|
-
) })
|
|
1300
|
+
) }) })
|
|
1165
1301
|
] });
|
|
1166
1302
|
}
|
|
1167
1303
|
|
|
1168
1304
|
// src/devtools/components/TabNav.tsx
|
|
1169
|
-
|
|
1305
|
+
|
|
1306
|
+
|
|
1307
|
+
|
|
1170
1308
|
var styles5 = {
|
|
1171
1309
|
container: {
|
|
1172
1310
|
display: "flex",
|
|
1173
1311
|
gap: 2,
|
|
1174
1312
|
padding: "8px 10px 0",
|
|
1175
|
-
borderBottom: "1px solid hsl(215 20% 20%)"
|
|
1313
|
+
borderBottom: "1px solid hsl(215 20% 20%)",
|
|
1314
|
+
position: "relative"
|
|
1176
1315
|
},
|
|
1177
1316
|
tab: {
|
|
1178
1317
|
flex: 1,
|
|
@@ -1189,13 +1328,21 @@ var styles5 = {
|
|
|
1189
1328
|
fontWeight: 500,
|
|
1190
1329
|
fontFamily: "inherit",
|
|
1191
1330
|
cursor: "pointer",
|
|
1192
|
-
transition: "
|
|
1331
|
+
transition: "color 0.15s ease",
|
|
1193
1332
|
outline: "none",
|
|
1194
|
-
marginBottom: -1
|
|
1333
|
+
marginBottom: -1,
|
|
1334
|
+
position: "relative",
|
|
1335
|
+
zIndex: 1
|
|
1195
1336
|
},
|
|
1196
1337
|
tabActive: {
|
|
1197
|
-
color: "hsl(217 91% 70%)"
|
|
1198
|
-
|
|
1338
|
+
color: "hsl(217 91% 70%)"
|
|
1339
|
+
},
|
|
1340
|
+
indicator: {
|
|
1341
|
+
position: "absolute",
|
|
1342
|
+
bottom: -1,
|
|
1343
|
+
height: 2,
|
|
1344
|
+
backgroundColor: "hsl(217 91% 60%)",
|
|
1345
|
+
borderRadius: 1
|
|
1199
1346
|
},
|
|
1200
1347
|
badge: {
|
|
1201
1348
|
display: "inline-flex",
|
|
@@ -1217,6 +1364,17 @@ var styles5 = {
|
|
|
1217
1364
|
};
|
|
1218
1365
|
function TabNav(props) {
|
|
1219
1366
|
const { activeTab, onTabChange, stepCount, flowCount } = props;
|
|
1367
|
+
const reducedMotion = useReducedMotion();
|
|
1368
|
+
const prevStepCount = _react.useRef.call(void 0, stepCount);
|
|
1369
|
+
const prevFlowCount = _react.useRef.call(void 0, flowCount);
|
|
1370
|
+
const stepCountChanged = stepCount !== prevStepCount.current;
|
|
1371
|
+
const flowCountChanged = flowCount !== prevFlowCount.current;
|
|
1372
|
+
_react.useEffect.call(void 0, () => {
|
|
1373
|
+
prevStepCount.current = stepCount;
|
|
1374
|
+
}, [stepCount]);
|
|
1375
|
+
_react.useEffect.call(void 0, () => {
|
|
1376
|
+
prevFlowCount.current = flowCount;
|
|
1377
|
+
}, [flowCount]);
|
|
1220
1378
|
const stepsTabStyle = {
|
|
1221
1379
|
...styles5.tab,
|
|
1222
1380
|
...activeTab === "steps" && styles5.tabActive
|
|
@@ -1233,69 +1391,117 @@ function TabNav(props) {
|
|
|
1233
1391
|
...styles5.badge,
|
|
1234
1392
|
...activeTab === "flows" && styles5.badgeActive
|
|
1235
1393
|
};
|
|
1236
|
-
return /* @__PURE__ */ (0,
|
|
1237
|
-
/* @__PURE__ */ (0,
|
|
1394
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles5.container, children: [
|
|
1395
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1238
1396
|
"button",
|
|
1239
1397
|
{
|
|
1240
1398
|
type: "button",
|
|
1241
1399
|
style: stepsTabStyle,
|
|
1242
1400
|
onClick: () => onTabChange("steps"),
|
|
1243
1401
|
children: [
|
|
1244
|
-
/* @__PURE__ */ (0,
|
|
1402
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M14 0a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h12zM5.904 10.803L10 6.707v2.768a.5.5 0 0 0 1 0V5.5a.5.5 0 0 0-.5-.5H6.525a.5.5 0 1 0 0 1h2.768l-4.096 4.096a.5.5 0 0 0 .707.707z" }) }),
|
|
1245
1403
|
"Steps",
|
|
1246
|
-
|
|
1404
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react3.AnimatePresence, { mode: "popLayout", children: stepCount > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1405
|
+
_react3.motion.span,
|
|
1406
|
+
{
|
|
1407
|
+
style: stepsBadgeStyle,
|
|
1408
|
+
initial: stepCountChanged && !reducedMotion ? { scale: 1.3 } : { scale: 1 },
|
|
1409
|
+
animate: { scale: 1 },
|
|
1410
|
+
exit: { scale: 0.8, opacity: 0 },
|
|
1411
|
+
transition: reducedMotion ? { duration: 0 } : springs.bouncy,
|
|
1412
|
+
children: stepCount
|
|
1413
|
+
},
|
|
1414
|
+
`step-badge-${stepCount}`
|
|
1415
|
+
) })
|
|
1247
1416
|
]
|
|
1248
1417
|
}
|
|
1249
1418
|
),
|
|
1250
|
-
/* @__PURE__ */ (0,
|
|
1419
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1251
1420
|
"button",
|
|
1252
1421
|
{
|
|
1253
1422
|
type: "button",
|
|
1254
1423
|
style: flowsTabStyle,
|
|
1255
1424
|
onClick: () => onTabChange("flows"),
|
|
1256
1425
|
children: [
|
|
1257
|
-
/* @__PURE__ */ (0,
|
|
1426
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M6 3.5A1.5 1.5 0 0 1 7.5 2h1A1.5 1.5 0 0 1 10 3.5v1A1.5 1.5 0 0 1 8.5 6v1H14a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-1 0V8h-5v.5a.5.5 0 0 1-1 0V8h-5v.5a.5.5 0 0 1-1 0v-1A.5.5 0 0 1 2 7h5.5V6A1.5 1.5 0 0 1 6 4.5v-1zm-3 8A1.5 1.5 0 0 1 4.5 10h1A1.5 1.5 0 0 1 7 11.5v1A1.5 1.5 0 0 1 5.5 14h-1A1.5 1.5 0 0 1 3 12.5v-1zm6 0a1.5 1.5 0 0 1 1.5-1.5h1a1.5 1.5 0 0 1 1.5 1.5v1a1.5 1.5 0 0 1-1.5 1.5h-1A1.5 1.5 0 0 1 9 12.5v-1z" }) }),
|
|
1258
1427
|
"Flows",
|
|
1259
|
-
|
|
1428
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react3.AnimatePresence, { mode: "popLayout", children: flowCount > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1429
|
+
_react3.motion.span,
|
|
1430
|
+
{
|
|
1431
|
+
style: flowsBadgeStyle,
|
|
1432
|
+
initial: flowCountChanged && !reducedMotion ? { scale: 1.3 } : { scale: 1 },
|
|
1433
|
+
animate: { scale: 1 },
|
|
1434
|
+
exit: { scale: 0.8, opacity: 0 },
|
|
1435
|
+
transition: reducedMotion ? { duration: 0 } : springs.bouncy,
|
|
1436
|
+
children: flowCount
|
|
1437
|
+
},
|
|
1438
|
+
`flow-badge-${flowCount}`
|
|
1439
|
+
) })
|
|
1260
1440
|
]
|
|
1261
1441
|
}
|
|
1442
|
+
),
|
|
1443
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1444
|
+
"div",
|
|
1445
|
+
{
|
|
1446
|
+
style: {
|
|
1447
|
+
...styles5.indicator,
|
|
1448
|
+
left: activeTab === "steps" ? 10 : "50%",
|
|
1449
|
+
width: "calc(50% - 11px)",
|
|
1450
|
+
transition: reducedMotion ? "none" : "left 0.2s cubic-bezier(0.16, 1, 0.3, 1)"
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1262
1453
|
)
|
|
1263
1454
|
] });
|
|
1264
1455
|
}
|
|
1265
1456
|
|
|
1266
1457
|
// src/devtools/components/FlowsTab.tsx
|
|
1267
|
-
|
|
1268
|
-
|
|
1458
|
+
|
|
1459
|
+
|
|
1269
1460
|
|
|
1270
1461
|
// src/devtools/hooks/useFlowsData.ts
|
|
1271
|
-
var import_react6 = require("react");
|
|
1272
1462
|
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
var
|
|
1276
|
-
function
|
|
1277
|
-
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1280
|
-
const
|
|
1281
|
-
if (!
|
|
1282
|
-
|
|
1283
|
-
"useDevToolsContext must be used within a TourProvider with devtools enabled"
|
|
1284
|
-
);
|
|
1463
|
+
|
|
1464
|
+
// src/devtools/globalBridge.ts
|
|
1465
|
+
var BRIDGE_KEY = "__FLOWSTERIX_DEVTOOLS_BRIDGE__";
|
|
1466
|
+
function getBridge() {
|
|
1467
|
+
if (typeof window === "undefined") {
|
|
1468
|
+
return { value: null, listeners: /* @__PURE__ */ new Set() };
|
|
1469
|
+
}
|
|
1470
|
+
const w = window;
|
|
1471
|
+
if (!w[BRIDGE_KEY]) {
|
|
1472
|
+
w[BRIDGE_KEY] = { value: null, listeners: /* @__PURE__ */ new Set() };
|
|
1285
1473
|
}
|
|
1286
|
-
return
|
|
1474
|
+
return w[BRIDGE_KEY];
|
|
1475
|
+
}
|
|
1476
|
+
function getDevToolsBridge() {
|
|
1477
|
+
return getBridge().value;
|
|
1478
|
+
}
|
|
1479
|
+
function subscribeDevToolsBridge(listener) {
|
|
1480
|
+
const bridge = getBridge();
|
|
1481
|
+
bridge.listeners.add(listener);
|
|
1482
|
+
return () => {
|
|
1483
|
+
bridge.listeners.delete(listener);
|
|
1484
|
+
};
|
|
1287
1485
|
}
|
|
1288
1486
|
|
|
1289
1487
|
// src/devtools/hooks/useFlowsData.ts
|
|
1488
|
+
function useBridge() {
|
|
1489
|
+
return _react.useSyncExternalStore.call(void 0,
|
|
1490
|
+
subscribeDevToolsBridge,
|
|
1491
|
+
getDevToolsBridge,
|
|
1492
|
+
() => null
|
|
1493
|
+
// Server snapshot
|
|
1494
|
+
);
|
|
1495
|
+
}
|
|
1290
1496
|
function useFlowsData() {
|
|
1291
|
-
const
|
|
1292
|
-
const [flowsData, setFlowsData] = (0,
|
|
1293
|
-
const loadFlowStates = (0,
|
|
1294
|
-
if (!
|
|
1497
|
+
const bridge = useBridge();
|
|
1498
|
+
const [flowsData, setFlowsData] = _react.useState.call(void 0, []);
|
|
1499
|
+
const loadFlowStates = _react.useCallback.call(void 0, async () => {
|
|
1500
|
+
if (!bridge) {
|
|
1295
1501
|
setFlowsData([]);
|
|
1296
1502
|
return;
|
|
1297
1503
|
}
|
|
1298
|
-
const { flows, activeFlowId, state: activeState, getFlowState } =
|
|
1504
|
+
const { flows, activeFlowId, state: activeState, getFlowState } = bridge;
|
|
1299
1505
|
const flowDataPromises = [];
|
|
1300
1506
|
for (const [flowId, definition] of flows) {
|
|
1301
1507
|
const isActive = flowId === activeFlowId;
|
|
@@ -1313,30 +1519,28 @@ function useFlowsData() {
|
|
|
1313
1519
|
}
|
|
1314
1520
|
const results = await Promise.all(flowDataPromises);
|
|
1315
1521
|
setFlowsData(results);
|
|
1316
|
-
}, [
|
|
1317
|
-
(0,
|
|
1522
|
+
}, [bridge]);
|
|
1523
|
+
_react.useEffect.call(void 0, () => {
|
|
1318
1524
|
void loadFlowStates();
|
|
1319
1525
|
}, [loadFlowStates]);
|
|
1320
|
-
|
|
1321
|
-
if (!devtools?.activeFlowId || !devtools?.state) return;
|
|
1322
|
-
void loadFlowStates();
|
|
1323
|
-
}, [devtools?.activeFlowId, devtools?.state, loadFlowStates]);
|
|
1324
|
-
const deleteFlow = (0, import_react6.useCallback)(
|
|
1526
|
+
const deleteFlow = _react.useCallback.call(void 0,
|
|
1325
1527
|
async (flowId) => {
|
|
1326
|
-
if (!
|
|
1327
|
-
|
|
1328
|
-
|
|
1528
|
+
if (!bridge) return;
|
|
1529
|
+
if (bridge.activeFlowId === flowId) {
|
|
1530
|
+
bridge.cancel();
|
|
1531
|
+
}
|
|
1532
|
+
await bridge.deleteFlowStorage(flowId);
|
|
1329
1533
|
await loadFlowStates();
|
|
1330
1534
|
},
|
|
1331
|
-
[
|
|
1535
|
+
[bridge, loadFlowStates]
|
|
1332
1536
|
);
|
|
1333
|
-
const updateFlow = (0,
|
|
1334
|
-
async (flowId,
|
|
1335
|
-
if (!
|
|
1336
|
-
await
|
|
1537
|
+
const updateFlow = _react.useCallback.call(void 0,
|
|
1538
|
+
async (flowId, newState) => {
|
|
1539
|
+
if (!bridge) return;
|
|
1540
|
+
await bridge.updateFlowStorage(flowId, newState);
|
|
1337
1541
|
await loadFlowStates();
|
|
1338
1542
|
},
|
|
1339
|
-
[
|
|
1543
|
+
[bridge, loadFlowStates]
|
|
1340
1544
|
);
|
|
1341
1545
|
return {
|
|
1342
1546
|
flows: flowsData,
|
|
@@ -1347,9 +1551,9 @@ function useFlowsData() {
|
|
|
1347
1551
|
}
|
|
1348
1552
|
|
|
1349
1553
|
// src/devtools/components/FlowItem.tsx
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1554
|
+
|
|
1555
|
+
|
|
1556
|
+
|
|
1353
1557
|
var styles6 = {
|
|
1354
1558
|
card: {
|
|
1355
1559
|
display: "flex",
|
|
@@ -1360,7 +1564,12 @@ var styles6 = {
|
|
|
1360
1564
|
borderRadius: 8,
|
|
1361
1565
|
border: "1px solid hsl(215 20% 22%)",
|
|
1362
1566
|
fontSize: 12,
|
|
1363
|
-
fontFamily: "inherit"
|
|
1567
|
+
fontFamily: "inherit",
|
|
1568
|
+
transition: "border-color 0.15s ease, box-shadow 0.15s ease"
|
|
1569
|
+
},
|
|
1570
|
+
cardHover: {
|
|
1571
|
+
borderColor: "hsl(215 20% 28%)",
|
|
1572
|
+
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)"
|
|
1364
1573
|
},
|
|
1365
1574
|
cardActive: {
|
|
1366
1575
|
borderColor: "hsl(217 91% 55% / 0.5)",
|
|
@@ -1480,7 +1689,9 @@ var statusStyles = {
|
|
|
1480
1689
|
function FlowItem(props) {
|
|
1481
1690
|
const { flow, onEdit, onDelete } = props;
|
|
1482
1691
|
const { flowId, definition, state, isActive } = flow;
|
|
1483
|
-
const [confirmDelete, setConfirmDelete] = (0,
|
|
1692
|
+
const [confirmDelete, setConfirmDelete] = _react.useState.call(void 0, false);
|
|
1693
|
+
const [isHovered, setIsHovered] = _react.useState.call(void 0, false);
|
|
1694
|
+
const reducedMotion = useReducedMotion();
|
|
1484
1695
|
const handleDelete = () => {
|
|
1485
1696
|
if (confirmDelete) {
|
|
1486
1697
|
onDelete();
|
|
@@ -1492,6 +1703,7 @@ function FlowItem(props) {
|
|
|
1492
1703
|
};
|
|
1493
1704
|
const cardStyle = {
|
|
1494
1705
|
...styles6.card,
|
|
1706
|
+
...isHovered && styles6.cardHover,
|
|
1495
1707
|
...isActive && styles6.cardActive
|
|
1496
1708
|
};
|
|
1497
1709
|
const statusBadgeStyle = {
|
|
@@ -1503,84 +1715,117 @@ function FlowItem(props) {
|
|
|
1503
1715
|
...confirmDelete && styles6.actionButtonDanger
|
|
1504
1716
|
};
|
|
1505
1717
|
const stepInfo = state ? `Step ${state.stepIndex + 1}/${definition.steps.length}` : null;
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1718
|
+
const currentStatus = _nullishCoalesce(_optionalChain([state, 'optionalAccess', _2 => _2.status]), () => ( "no state"));
|
|
1719
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1720
|
+
"div",
|
|
1721
|
+
{
|
|
1722
|
+
style: cardStyle,
|
|
1723
|
+
onMouseEnter: () => setIsHovered(true),
|
|
1724
|
+
onMouseLeave: () => setIsHovered(false),
|
|
1725
|
+
children: [
|
|
1726
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles6.header, children: [
|
|
1727
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles6.titleGroup, children: [
|
|
1728
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: styles6.flowId, children: flowId }),
|
|
1729
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react3.AnimatePresence, { mode: "wait", children: isActive && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1730
|
+
_react3.motion.span,
|
|
1731
|
+
{
|
|
1732
|
+
style: { ...styles6.statusBadge, ...styles6.activeBadge },
|
|
1733
|
+
initial: reducedMotion ? {} : { scale: 0.8, opacity: 0 },
|
|
1734
|
+
animate: { scale: 1, opacity: 1 },
|
|
1735
|
+
exit: reducedMotion ? {} : { scale: 0.8, opacity: 0 },
|
|
1736
|
+
transition: reducedMotion ? { duration: 0 } : springs.bouncy,
|
|
1737
|
+
children: "Active"
|
|
1738
|
+
},
|
|
1739
|
+
"active-badge"
|
|
1740
|
+
) })
|
|
1741
|
+
] }),
|
|
1742
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react3.AnimatePresence, { mode: "wait", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1743
|
+
_react3.motion.span,
|
|
1744
|
+
{
|
|
1745
|
+
style: statusBadgeStyle,
|
|
1746
|
+
initial: reducedMotion ? {} : { scale: 0.9, opacity: 0 },
|
|
1747
|
+
animate: { scale: 1, opacity: 1 },
|
|
1748
|
+
exit: reducedMotion ? {} : { scale: 0.9, opacity: 0 },
|
|
1749
|
+
transition: reducedMotion ? { duration: 0 } : { duration: 0.15 },
|
|
1750
|
+
children: currentStatus
|
|
1751
|
+
},
|
|
1752
|
+
currentStatus
|
|
1753
|
+
) })
|
|
1754
|
+
] }),
|
|
1755
|
+
state ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles6.infoRow, children: [
|
|
1756
|
+
stepInfo && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles6.infoItem, children: [
|
|
1757
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: styles6.label, children: "Step:" }),
|
|
1758
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: styles6.value, children: stepInfo })
|
|
1759
|
+
] }),
|
|
1760
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles6.infoItem, children: [
|
|
1761
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: styles6.label, children: "Version:" }),
|
|
1762
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: styles6.value, children: state.version })
|
|
1763
|
+
] }),
|
|
1764
|
+
state.stepId && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles6.infoItem, children: [
|
|
1765
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: styles6.label, children: "ID:" }),
|
|
1766
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: styles6.value, children: state.stepId })
|
|
1767
|
+
] })
|
|
1768
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: styles6.noState, children: "No stored state" }),
|
|
1769
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles6.actions, children: [
|
|
1770
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1771
|
+
_react3.motion.button,
|
|
1772
|
+
{
|
|
1773
|
+
type: "button",
|
|
1774
|
+
style: styles6.actionButton,
|
|
1775
|
+
onClick: onEdit,
|
|
1776
|
+
disabled: !state,
|
|
1777
|
+
whileHover: state && !reducedMotion ? { scale: 1.02 } : {},
|
|
1778
|
+
whileTap: state && !reducedMotion ? { scale: 0.98 } : {},
|
|
1779
|
+
title: state ? "Edit flow state" : "No state to edit",
|
|
1780
|
+
children: [
|
|
1781
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "10", height: "10", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5L13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175l-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z" }) }),
|
|
1782
|
+
"Edit"
|
|
1783
|
+
]
|
|
1784
|
+
}
|
|
1785
|
+
),
|
|
1786
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1787
|
+
_react3.motion.button,
|
|
1788
|
+
{
|
|
1789
|
+
type: "button",
|
|
1790
|
+
style: deleteButtonStyle,
|
|
1791
|
+
onClick: handleDelete,
|
|
1792
|
+
disabled: !state,
|
|
1793
|
+
whileHover: state && !reducedMotion ? { scale: 1.02 } : {},
|
|
1794
|
+
whileTap: state && !reducedMotion ? { scale: 0.98 } : {},
|
|
1795
|
+
title: confirmDelete ? "Click again to confirm deletion" : state ? "Delete flow state" : "No state to delete",
|
|
1796
|
+
children: [
|
|
1797
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width: "10", height: "10", viewBox: "0 0 16 16", fill: "currentColor", children: [
|
|
1798
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" }),
|
|
1799
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1800
|
+
"path",
|
|
1801
|
+
{
|
|
1802
|
+
fillRule: "evenodd",
|
|
1803
|
+
d: "M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4L4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"
|
|
1804
|
+
}
|
|
1805
|
+
)
|
|
1806
|
+
] }),
|
|
1807
|
+
confirmDelete ? "Confirm?" : "Delete"
|
|
1808
|
+
]
|
|
1809
|
+
}
|
|
1810
|
+
)
|
|
1811
|
+
] })
|
|
1812
|
+
]
|
|
1813
|
+
}
|
|
1814
|
+
);
|
|
1572
1815
|
}
|
|
1573
1816
|
|
|
1574
1817
|
// src/devtools/components/FlowEditModal.tsx
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1818
|
+
|
|
1819
|
+
|
|
1820
|
+
|
|
1821
|
+
|
|
1579
1822
|
var styles7 = {
|
|
1580
1823
|
overlay: {
|
|
1581
1824
|
position: "fixed",
|
|
1582
1825
|
inset: 0,
|
|
1583
1826
|
backgroundColor: "rgba(0, 0, 0, 0.6)",
|
|
1827
|
+
backdropFilter: "blur(4px)",
|
|
1828
|
+
WebkitBackdropFilter: "blur(4px)",
|
|
1584
1829
|
display: "flex",
|
|
1585
1830
|
alignItems: "center",
|
|
1586
1831
|
justifyContent: "center",
|
|
@@ -1643,7 +1888,8 @@ var styles7 = {
|
|
|
1643
1888
|
fontFamily: "ui-monospace, monospace",
|
|
1644
1889
|
resize: "vertical",
|
|
1645
1890
|
outline: "none",
|
|
1646
|
-
lineHeight: 1.5
|
|
1891
|
+
lineHeight: 1.5,
|
|
1892
|
+
transition: "border-color 0.15s ease"
|
|
1647
1893
|
},
|
|
1648
1894
|
textareaError: {
|
|
1649
1895
|
borderColor: "hsl(0 70% 50%)"
|
|
@@ -1695,15 +1941,22 @@ var styles7 = {
|
|
|
1695
1941
|
};
|
|
1696
1942
|
function FlowEditModal(props) {
|
|
1697
1943
|
const { isOpen, flowId, initialState, onClose, onSave, container } = props;
|
|
1698
|
-
const [jsonValue, setJsonValue] = (0,
|
|
1699
|
-
const [error, setError] = (0,
|
|
1700
|
-
|
|
1944
|
+
const [jsonValue, setJsonValue] = _react.useState.call(void 0, "");
|
|
1945
|
+
const [error, setError] = _react.useState.call(void 0, null);
|
|
1946
|
+
const [shake, setShake] = _react.useState.call(void 0, false);
|
|
1947
|
+
const reducedMotion = useReducedMotion();
|
|
1948
|
+
_react.useEffect.call(void 0, () => {
|
|
1701
1949
|
if (isOpen && initialState) {
|
|
1702
1950
|
setJsonValue(JSON.stringify(initialState, null, 2));
|
|
1703
1951
|
setError(null);
|
|
1704
1952
|
}
|
|
1705
1953
|
}, [isOpen, initialState]);
|
|
1706
|
-
const
|
|
1954
|
+
const triggerShake = _react.useCallback.call(void 0, () => {
|
|
1955
|
+
if (reducedMotion) return;
|
|
1956
|
+
setShake(true);
|
|
1957
|
+
setTimeout(() => setShake(false), 400);
|
|
1958
|
+
}, [reducedMotion]);
|
|
1959
|
+
const handleSave = _react.useCallback.call(void 0, () => {
|
|
1707
1960
|
try {
|
|
1708
1961
|
const parsed = JSON.parse(jsonValue);
|
|
1709
1962
|
if (typeof parsed.status !== "string") {
|
|
@@ -1719,9 +1972,10 @@ function FlowEditModal(props) {
|
|
|
1719
1972
|
onClose();
|
|
1720
1973
|
} catch (err) {
|
|
1721
1974
|
setError(err instanceof Error ? err.message : "Invalid JSON");
|
|
1975
|
+
triggerShake();
|
|
1722
1976
|
}
|
|
1723
|
-
}, [jsonValue, onSave, onClose]);
|
|
1724
|
-
const handleKeyDown = (0,
|
|
1977
|
+
}, [jsonValue, onSave, onClose, triggerShake]);
|
|
1978
|
+
const handleKeyDown = _react.useCallback.call(void 0,
|
|
1725
1979
|
(e) => {
|
|
1726
1980
|
if (e.key === "Escape") {
|
|
1727
1981
|
onClose();
|
|
@@ -1734,7 +1988,7 @@ function FlowEditModal(props) {
|
|
|
1734
1988
|
[onClose, handleSave]
|
|
1735
1989
|
);
|
|
1736
1990
|
if (typeof window === "undefined") return null;
|
|
1737
|
-
const portalContainer = container
|
|
1991
|
+
const portalContainer = _nullishCoalesce(container, () => ( document.body));
|
|
1738
1992
|
const textareaStyle = {
|
|
1739
1993
|
...styles7.textarea,
|
|
1740
1994
|
...error && styles7.textareaError
|
|
@@ -1744,47 +1998,54 @@ function FlowEditModal(props) {
|
|
|
1744
1998
|
...styles7.buttonPrimary,
|
|
1745
1999
|
...error && styles7.buttonDisabled
|
|
1746
2000
|
};
|
|
1747
|
-
return (0,
|
|
1748
|
-
/* @__PURE__ */ (0,
|
|
1749
|
-
|
|
2001
|
+
return _reactdom.createPortal.call(void 0,
|
|
2002
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react3.AnimatePresence, { children: isOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2003
|
+
_react3.motion.div,
|
|
1750
2004
|
{
|
|
1751
2005
|
style: styles7.overlay,
|
|
1752
|
-
initial: { opacity: 0 },
|
|
2006
|
+
initial: reducedMotion ? {} : { opacity: 0 },
|
|
1753
2007
|
animate: { opacity: 1 },
|
|
1754
|
-
exit: { opacity: 0 },
|
|
1755
|
-
transition: { duration: 0.15 },
|
|
2008
|
+
exit: reducedMotion ? {} : { opacity: 0 },
|
|
2009
|
+
transition: reducedMotion ? { duration: 0 } : { duration: 0.15 },
|
|
1756
2010
|
onClick: (e) => {
|
|
1757
2011
|
if (e.target === e.currentTarget) onClose();
|
|
1758
2012
|
},
|
|
1759
2013
|
onKeyDown: handleKeyDown,
|
|
1760
|
-
children: /* @__PURE__ */ (0,
|
|
1761
|
-
|
|
2014
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2015
|
+
_react3.motion.div,
|
|
1762
2016
|
{
|
|
1763
2017
|
style: styles7.modal,
|
|
1764
|
-
initial: { opacity: 0, scale: 0.95, y: 10 },
|
|
1765
|
-
animate: {
|
|
1766
|
-
|
|
1767
|
-
|
|
2018
|
+
initial: reducedMotion ? {} : { opacity: 0, scale: 0.95, y: 10 },
|
|
2019
|
+
animate: {
|
|
2020
|
+
opacity: 1,
|
|
2021
|
+
scale: 1,
|
|
2022
|
+
y: 0,
|
|
2023
|
+
x: shake ? [0, -8, 8, -6, 6, -4, 4, 0] : 0
|
|
2024
|
+
},
|
|
2025
|
+
exit: reducedMotion ? {} : { opacity: 0, scale: 0.95, y: 10 },
|
|
2026
|
+
transition: reducedMotion ? { duration: 0 } : springs.smooth,
|
|
1768
2027
|
onClick: (e) => e.stopPropagation(),
|
|
1769
2028
|
children: [
|
|
1770
|
-
/* @__PURE__ */ (0,
|
|
1771
|
-
/* @__PURE__ */ (0,
|
|
2029
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles7.header, children: [
|
|
2030
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: styles7.title, children: [
|
|
1772
2031
|
"Edit Flow: ",
|
|
1773
2032
|
flowId
|
|
1774
2033
|
] }),
|
|
1775
|
-
/* @__PURE__ */ (0,
|
|
1776
|
-
|
|
2034
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2035
|
+
_react3.motion.button,
|
|
1777
2036
|
{
|
|
1778
2037
|
type: "button",
|
|
1779
2038
|
style: styles7.closeButton,
|
|
1780
2039
|
onClick: onClose,
|
|
1781
2040
|
title: "Close",
|
|
1782
|
-
|
|
2041
|
+
whileHover: reducedMotion ? {} : { scale: 1.1 },
|
|
2042
|
+
whileTap: reducedMotion ? {} : { scale: 0.9 },
|
|
2043
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" }) })
|
|
1783
2044
|
}
|
|
1784
2045
|
)
|
|
1785
2046
|
] }),
|
|
1786
|
-
/* @__PURE__ */ (0,
|
|
1787
|
-
/* @__PURE__ */ (0,
|
|
2047
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles7.body, children: [
|
|
2048
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1788
2049
|
"textarea",
|
|
1789
2050
|
{
|
|
1790
2051
|
style: textareaStyle,
|
|
@@ -1797,27 +2058,39 @@ function FlowEditModal(props) {
|
|
|
1797
2058
|
autoFocus: true
|
|
1798
2059
|
}
|
|
1799
2060
|
),
|
|
1800
|
-
|
|
2061
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react3.AnimatePresence, { children: error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2062
|
+
_react3.motion.div,
|
|
2063
|
+
{
|
|
2064
|
+
style: styles7.error,
|
|
2065
|
+
initial: reducedMotion ? {} : { opacity: 0, y: -4 },
|
|
2066
|
+
animate: { opacity: 1, y: 0 },
|
|
2067
|
+
exit: reducedMotion ? {} : { opacity: 0, y: -4 },
|
|
2068
|
+
transition: { duration: 0.15 },
|
|
2069
|
+
children: error
|
|
2070
|
+
}
|
|
2071
|
+
) })
|
|
1801
2072
|
] }),
|
|
1802
|
-
/* @__PURE__ */ (0,
|
|
1803
|
-
/* @__PURE__ */ (0,
|
|
1804
|
-
|
|
2073
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles7.footer, children: [
|
|
2074
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2075
|
+
_react3.motion.button,
|
|
1805
2076
|
{
|
|
1806
2077
|
type: "button",
|
|
1807
2078
|
style: styles7.button,
|
|
1808
2079
|
onClick: onClose,
|
|
2080
|
+
whileHover: reducedMotion ? {} : { scale: 1.02 },
|
|
2081
|
+
whileTap: reducedMotion ? {} : { scale: 0.98 },
|
|
1809
2082
|
children: "Cancel"
|
|
1810
2083
|
}
|
|
1811
2084
|
),
|
|
1812
|
-
/* @__PURE__ */ (0,
|
|
1813
|
-
|
|
2085
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2086
|
+
_react3.motion.button,
|
|
1814
2087
|
{
|
|
1815
2088
|
type: "button",
|
|
1816
2089
|
style: saveButtonStyle,
|
|
1817
2090
|
onClick: handleSave,
|
|
1818
2091
|
disabled: !!error,
|
|
1819
|
-
whileHover: !error ? { scale: 1.02 } : {},
|
|
1820
|
-
whileTap: !error ? { scale: 0.98 } : {},
|
|
2092
|
+
whileHover: !error && !reducedMotion ? { scale: 1.02 } : {},
|
|
2093
|
+
whileTap: !error && !reducedMotion ? { scale: 0.98 } : {},
|
|
1821
2094
|
children: "Save"
|
|
1822
2095
|
}
|
|
1823
2096
|
)
|
|
@@ -1832,7 +2105,7 @@ function FlowEditModal(props) {
|
|
|
1832
2105
|
}
|
|
1833
2106
|
|
|
1834
2107
|
// src/devtools/components/FlowsTab.tsx
|
|
1835
|
-
|
|
2108
|
+
|
|
1836
2109
|
var styles8 = {
|
|
1837
2110
|
container: {
|
|
1838
2111
|
display: "flex",
|
|
@@ -1905,12 +2178,12 @@ var styles8 = {
|
|
|
1905
2178
|
function FlowsTab(props) {
|
|
1906
2179
|
const { container } = props;
|
|
1907
2180
|
const { flows, refreshFlows, deleteFlow, updateFlow } = useFlowsData();
|
|
1908
|
-
const [editModal, setEditModal] = (0,
|
|
2181
|
+
const [editModal, setEditModal] = _react.useState.call(void 0, {
|
|
1909
2182
|
isOpen: false,
|
|
1910
2183
|
flowId: "",
|
|
1911
2184
|
state: null
|
|
1912
2185
|
});
|
|
1913
|
-
const handleEdit = (0,
|
|
2186
|
+
const handleEdit = _react.useCallback.call(void 0, (flowId, state) => {
|
|
1914
2187
|
if (!state) return;
|
|
1915
2188
|
setEditModal({
|
|
1916
2189
|
isOpen: true,
|
|
@@ -1918,49 +2191,49 @@ function FlowsTab(props) {
|
|
|
1918
2191
|
state
|
|
1919
2192
|
});
|
|
1920
2193
|
}, []);
|
|
1921
|
-
const handleCloseModal = (0,
|
|
2194
|
+
const handleCloseModal = _react.useCallback.call(void 0, () => {
|
|
1922
2195
|
setEditModal((prev) => ({ ...prev, isOpen: false }));
|
|
1923
2196
|
}, []);
|
|
1924
|
-
const handleSave = (0,
|
|
2197
|
+
const handleSave = _react.useCallback.call(void 0,
|
|
1925
2198
|
async (newState) => {
|
|
1926
2199
|
await updateFlow(editModal.flowId, newState);
|
|
1927
2200
|
},
|
|
1928
2201
|
[editModal.flowId, updateFlow]
|
|
1929
2202
|
);
|
|
1930
|
-
const handleDelete = (0,
|
|
2203
|
+
const handleDelete = _react.useCallback.call(void 0,
|
|
1931
2204
|
async (flowId) => {
|
|
1932
2205
|
await deleteFlow(flowId);
|
|
1933
2206
|
},
|
|
1934
2207
|
[deleteFlow]
|
|
1935
2208
|
);
|
|
1936
2209
|
if (flows.length === 0) {
|
|
1937
|
-
return /* @__PURE__ */ (0,
|
|
1938
|
-
/* @__PURE__ */ (0,
|
|
2210
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: styles8.container, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles8.empty, children: [
|
|
2211
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: styles8.emptyIcon, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1939
2212
|
"svg",
|
|
1940
2213
|
{
|
|
1941
2214
|
width: "20",
|
|
1942
2215
|
height: "20",
|
|
1943
2216
|
viewBox: "0 0 16 16",
|
|
1944
2217
|
fill: "hsl(215 20% 45%)",
|
|
1945
|
-
children: /* @__PURE__ */ (0,
|
|
2218
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M6 3.5A1.5 1.5 0 0 1 7.5 2h1A1.5 1.5 0 0 1 10 3.5v1A1.5 1.5 0 0 1 8.5 6v1H14a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-1 0V8h-5v.5a.5.5 0 0 1-1 0V8h-5v.5a.5.5 0 0 1-1 0v-1A.5.5 0 0 1 2 7h5.5V6A1.5 1.5 0 0 1 6 4.5v-1zm-3 8A1.5 1.5 0 0 1 4.5 10h1A1.5 1.5 0 0 1 7 11.5v1A1.5 1.5 0 0 1 5.5 14h-1A1.5 1.5 0 0 1 3 12.5v-1zm6 0a1.5 1.5 0 0 1 1.5-1.5h1a1.5 1.5 0 0 1 1.5 1.5v1a1.5 1.5 0 0 1-1.5 1.5h-1A1.5 1.5 0 0 1 9 12.5v-1z" })
|
|
1946
2219
|
}
|
|
1947
2220
|
) }),
|
|
1948
|
-
/* @__PURE__ */ (0,
|
|
1949
|
-
/* @__PURE__ */ (0,
|
|
1950
|
-
/* @__PURE__ */ (0,
|
|
2221
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles8.emptyText, children: [
|
|
2222
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: "No flows registered." }),
|
|
2223
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { marginTop: 6, fontSize: 11, color: "hsl(215 20% 45%)" }, children: "Add flows to TourProvider to see them here." })
|
|
1951
2224
|
] })
|
|
1952
2225
|
] }) });
|
|
1953
2226
|
}
|
|
1954
|
-
return /* @__PURE__ */ (0,
|
|
1955
|
-
/* @__PURE__ */ (0,
|
|
1956
|
-
/* @__PURE__ */ (0,
|
|
2227
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles8.container, children: [
|
|
2228
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles8.toolbar, children: [
|
|
2229
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { fontSize: 11, color: "hsl(215 20% 50%)" }, children: [
|
|
1957
2230
|
flows.length,
|
|
1958
2231
|
" flow",
|
|
1959
2232
|
flows.length !== 1 ? "s" : "",
|
|
1960
2233
|
" registered"
|
|
1961
2234
|
] }),
|
|
1962
|
-
/* @__PURE__ */ (0,
|
|
1963
|
-
|
|
2235
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2236
|
+
_react3.motion.button,
|
|
1964
2237
|
{
|
|
1965
2238
|
type: "button",
|
|
1966
2239
|
style: styles8.refreshButton,
|
|
@@ -1969,22 +2242,22 @@ function FlowsTab(props) {
|
|
|
1969
2242
|
whileTap: { scale: 0.98 },
|
|
1970
2243
|
title: "Refresh flow states",
|
|
1971
2244
|
children: [
|
|
1972
|
-
/* @__PURE__ */ (0,
|
|
1973
|
-
/* @__PURE__ */ (0,
|
|
2245
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width: "10", height: "10", viewBox: "0 0 16 16", fill: "currentColor", children: [
|
|
2246
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1974
2247
|
"path",
|
|
1975
2248
|
{
|
|
1976
2249
|
fillRule: "evenodd",
|
|
1977
2250
|
d: "M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z"
|
|
1978
2251
|
}
|
|
1979
2252
|
),
|
|
1980
|
-
/* @__PURE__ */ (0,
|
|
2253
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" })
|
|
1981
2254
|
] }),
|
|
1982
2255
|
"Refresh"
|
|
1983
2256
|
]
|
|
1984
2257
|
}
|
|
1985
2258
|
)
|
|
1986
2259
|
] }),
|
|
1987
|
-
/* @__PURE__ */ (0,
|
|
2260
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: styles8.flowList, children: flows.map((flow) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1988
2261
|
FlowItem,
|
|
1989
2262
|
{
|
|
1990
2263
|
flow,
|
|
@@ -1993,7 +2266,7 @@ function FlowsTab(props) {
|
|
|
1993
2266
|
},
|
|
1994
2267
|
flow.flowId
|
|
1995
2268
|
)) }),
|
|
1996
|
-
editModal.state && /* @__PURE__ */ (0,
|
|
2269
|
+
editModal.state && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1997
2270
|
FlowEditModal,
|
|
1998
2271
|
{
|
|
1999
2272
|
isOpen: editModal.isOpen,
|
|
@@ -2008,15 +2281,15 @@ function FlowsTab(props) {
|
|
|
2008
2281
|
}
|
|
2009
2282
|
|
|
2010
2283
|
// src/devtools/hooks/useGrabMode.ts
|
|
2011
|
-
|
|
2284
|
+
|
|
2012
2285
|
|
|
2013
2286
|
// src/devtools/hooks/useElementInfo.ts
|
|
2014
|
-
|
|
2287
|
+
|
|
2015
2288
|
|
|
2016
2289
|
// src/devtools/utils/selectorGenerator.ts
|
|
2017
2290
|
function generateSemanticName(element) {
|
|
2018
2291
|
const tag = element.tagName.toLowerCase();
|
|
2019
|
-
const text = element.textContent
|
|
2292
|
+
const text = _optionalChain([element, 'access', _3 => _3.textContent, 'optionalAccess', _4 => _4.trim, 'call', _5 => _5(), 'access', _6 => _6.slice, 'call', _7 => _7(0, 20), 'access', _8 => _8.toLowerCase, 'call', _9 => _9()]) || "";
|
|
2020
2293
|
const className = element.className;
|
|
2021
2294
|
const id = element.id;
|
|
2022
2295
|
if (text) {
|
|
@@ -2048,7 +2321,7 @@ function getExistingDataAttrs(element) {
|
|
|
2048
2321
|
function isUnique(params) {
|
|
2049
2322
|
try {
|
|
2050
2323
|
return document.querySelectorAll(params.selector).length === 1;
|
|
2051
|
-
} catch {
|
|
2324
|
+
} catch (e4) {
|
|
2052
2325
|
return false;
|
|
2053
2326
|
}
|
|
2054
2327
|
}
|
|
@@ -2107,27 +2380,27 @@ function generateSelector(params) {
|
|
|
2107
2380
|
|
|
2108
2381
|
// src/devtools/hooks/useElementInfo.ts
|
|
2109
2382
|
function useElementInfo() {
|
|
2110
|
-
const getElementInfo = (0,
|
|
2383
|
+
const getElementInfo = _react.useCallback.call(void 0, (params) => {
|
|
2111
2384
|
const { element } = params;
|
|
2112
2385
|
const selectorResult = generateSelector({ element });
|
|
2113
2386
|
const source = extractSource({ element });
|
|
2114
2387
|
const componentHierarchy = extractComponentHierarchy({ element });
|
|
2115
2388
|
const rect = element.getBoundingClientRect();
|
|
2116
2389
|
const htmlElement = element;
|
|
2117
|
-
const styleAttr = htmlElement.getAttribute
|
|
2390
|
+
const styleAttr = _optionalChain([htmlElement, 'access', _10 => _10.getAttribute, 'optionalCall', _11 => _11("style")]) || void 0;
|
|
2118
2391
|
return {
|
|
2119
2392
|
element,
|
|
2120
2393
|
selector: selectorResult.selector,
|
|
2121
2394
|
selectorType: selectorResult.selectorType,
|
|
2122
2395
|
suggestedAttrName: selectorResult.suggestedAttrName,
|
|
2123
2396
|
tag: element.tagName.toLowerCase(),
|
|
2124
|
-
text: element.textContent
|
|
2397
|
+
text: _optionalChain([element, 'access', _12 => _12.textContent, 'optionalAccess', _13 => _13.trim, 'call', _14 => _14(), 'access', _15 => _15.slice, 'call', _16 => _16(0, 50)]) || void 0,
|
|
2125
2398
|
className: typeof element.className === "string" ? element.className : void 0,
|
|
2126
2399
|
style: styleAttr,
|
|
2127
2400
|
existingAttrs: selectorResult.existingAttrs,
|
|
2128
2401
|
componentHierarchy,
|
|
2129
2402
|
rect,
|
|
2130
|
-
source: source
|
|
2403
|
+
source: _nullishCoalesce(source, () => ( void 0))
|
|
2131
2404
|
};
|
|
2132
2405
|
}, []);
|
|
2133
2406
|
return { getElementInfo };
|
|
@@ -2140,31 +2413,31 @@ function isDevToolsElement(element) {
|
|
|
2140
2413
|
const root = element.getRootNode();
|
|
2141
2414
|
if (root instanceof ShadowRoot) {
|
|
2142
2415
|
const host = root.host;
|
|
2143
|
-
if (host
|
|
2416
|
+
if (_optionalChain([host, 'optionalAccess', _17 => _17.hasAttribute, 'call', _18 => _18("data-devtools-host")])) return true;
|
|
2144
2417
|
}
|
|
2145
2418
|
return false;
|
|
2146
2419
|
}
|
|
2147
2420
|
function useGrabMode() {
|
|
2148
|
-
const [mode, setMode] = (0,
|
|
2149
|
-
const [hoveredElement, setHoveredElement] = (0,
|
|
2421
|
+
const [mode, setMode] = _react.useState.call(void 0, "idle");
|
|
2422
|
+
const [hoveredElement, setHoveredElement] = _react.useState.call(void 0, null);
|
|
2150
2423
|
const { getElementInfo } = useElementInfo();
|
|
2151
|
-
const startGrabbing = (0,
|
|
2424
|
+
const startGrabbing = _react.useCallback.call(void 0, () => {
|
|
2152
2425
|
setMode("grabbing");
|
|
2153
2426
|
setHoveredElement(null);
|
|
2154
2427
|
}, []);
|
|
2155
|
-
const stopGrabbing = (0,
|
|
2428
|
+
const stopGrabbing = _react.useCallback.call(void 0, () => {
|
|
2156
2429
|
setMode("idle");
|
|
2157
2430
|
setHoveredElement(null);
|
|
2158
2431
|
}, []);
|
|
2159
|
-
const toggleGrabbing = (0,
|
|
2432
|
+
const toggleGrabbing = _react.useCallback.call(void 0, () => {
|
|
2160
2433
|
setMode((prev) => prev === "grabbing" ? "idle" : "grabbing");
|
|
2161
2434
|
setHoveredElement(null);
|
|
2162
2435
|
}, []);
|
|
2163
|
-
const selectCurrent = (0,
|
|
2436
|
+
const selectCurrent = _react.useCallback.call(void 0, () => {
|
|
2164
2437
|
if (!hoveredElement) return null;
|
|
2165
2438
|
return hoveredElement.info;
|
|
2166
2439
|
}, [hoveredElement]);
|
|
2167
|
-
(0,
|
|
2440
|
+
_react.useEffect.call(void 0, () => {
|
|
2168
2441
|
if (mode !== "grabbing") return;
|
|
2169
2442
|
const handleMouseMove = (e) => {
|
|
2170
2443
|
const target = document.elementFromPoint(e.clientX, e.clientY);
|
|
@@ -2188,7 +2461,7 @@ function useGrabMode() {
|
|
|
2188
2461
|
document.addEventListener("mousemove", handleMouseMove, { passive: true });
|
|
2189
2462
|
return () => document.removeEventListener("mousemove", handleMouseMove);
|
|
2190
2463
|
}, [mode, getElementInfo]);
|
|
2191
|
-
(0,
|
|
2464
|
+
_react.useEffect.call(void 0, () => {
|
|
2192
2465
|
const handleKeyDown = (e) => {
|
|
2193
2466
|
if (e.ctrlKey && e.shiftKey && e.key.toLowerCase() === "g") {
|
|
2194
2467
|
e.preventDefault();
|
|
@@ -2215,15 +2488,15 @@ function useGrabMode() {
|
|
|
2215
2488
|
}
|
|
2216
2489
|
|
|
2217
2490
|
// src/devtools/hooks/useStepStore.ts
|
|
2218
|
-
|
|
2491
|
+
|
|
2219
2492
|
|
|
2220
2493
|
// src/devtools/utils/storage.ts
|
|
2221
2494
|
var STORAGE_KEY = "flowsterix-devtools-steps";
|
|
2222
2495
|
function migrateStep(step) {
|
|
2223
2496
|
return {
|
|
2224
2497
|
...step,
|
|
2225
|
-
componentHierarchy: step.componentHierarchy
|
|
2226
|
-
existingAttrs: step.existingAttrs
|
|
2498
|
+
componentHierarchy: _nullishCoalesce(step.componentHierarchy, () => ( [])),
|
|
2499
|
+
existingAttrs: _nullishCoalesce(step.existingAttrs, () => ( []))
|
|
2227
2500
|
};
|
|
2228
2501
|
}
|
|
2229
2502
|
function loadSteps() {
|
|
@@ -2234,7 +2507,7 @@ function loadSteps() {
|
|
|
2234
2507
|
const parsed = JSON.parse(data);
|
|
2235
2508
|
if (!Array.isArray(parsed)) return [];
|
|
2236
2509
|
return parsed.map(migrateStep);
|
|
2237
|
-
} catch {
|
|
2510
|
+
} catch (e5) {
|
|
2238
2511
|
return [];
|
|
2239
2512
|
}
|
|
2240
2513
|
}
|
|
@@ -2242,14 +2515,14 @@ function saveSteps(steps) {
|
|
|
2242
2515
|
if (typeof window === "undefined") return;
|
|
2243
2516
|
try {
|
|
2244
2517
|
localStorage.setItem(STORAGE_KEY, JSON.stringify(steps));
|
|
2245
|
-
} catch {
|
|
2518
|
+
} catch (e6) {
|
|
2246
2519
|
}
|
|
2247
2520
|
}
|
|
2248
2521
|
function clearSteps() {
|
|
2249
2522
|
if (typeof window === "undefined") return;
|
|
2250
2523
|
try {
|
|
2251
2524
|
localStorage.removeItem(STORAGE_KEY);
|
|
2252
|
-
} catch {
|
|
2525
|
+
} catch (e7) {
|
|
2253
2526
|
}
|
|
2254
2527
|
}
|
|
2255
2528
|
|
|
@@ -2277,18 +2550,18 @@ function generateId() {
|
|
|
2277
2550
|
return `step-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`;
|
|
2278
2551
|
}
|
|
2279
2552
|
function useStepStore() {
|
|
2280
|
-
const steps = (0,
|
|
2281
|
-
(0,
|
|
2553
|
+
const steps = _react.useSyncExternalStore.call(void 0, subscribe, getSnapshot, getServerSnapshot);
|
|
2554
|
+
_react.useEffect.call(void 0, () => {
|
|
2282
2555
|
const saved = loadSteps();
|
|
2283
2556
|
if (saved.length > 0) {
|
|
2284
2557
|
store.steps = saved;
|
|
2285
2558
|
notifyListeners();
|
|
2286
2559
|
}
|
|
2287
2560
|
}, []);
|
|
2288
|
-
(0,
|
|
2561
|
+
_react.useEffect.call(void 0, () => {
|
|
2289
2562
|
saveSteps(steps);
|
|
2290
2563
|
}, [steps]);
|
|
2291
|
-
const addStep = (0,
|
|
2564
|
+
const addStep = _react.useCallback.call(void 0, (params) => {
|
|
2292
2565
|
const { info } = params;
|
|
2293
2566
|
const newStep = {
|
|
2294
2567
|
id: generateId(),
|
|
@@ -2315,12 +2588,12 @@ function useStepStore() {
|
|
|
2315
2588
|
notifyListeners();
|
|
2316
2589
|
return newStep;
|
|
2317
2590
|
}, []);
|
|
2318
|
-
const removeStep = (0,
|
|
2591
|
+
const removeStep = _react.useCallback.call(void 0, (params) => {
|
|
2319
2592
|
const { id } = params;
|
|
2320
2593
|
store.steps = store.steps.filter((s) => s.id !== id).map((s, i) => ({ ...s, order: i }));
|
|
2321
2594
|
notifyListeners();
|
|
2322
2595
|
}, []);
|
|
2323
|
-
const updateStep = (0,
|
|
2596
|
+
const updateStep = _react.useCallback.call(void 0,
|
|
2324
2597
|
(params) => {
|
|
2325
2598
|
const { id, updates } = params;
|
|
2326
2599
|
store.steps = store.steps.map(
|
|
@@ -2330,7 +2603,7 @@ function useStepStore() {
|
|
|
2330
2603
|
},
|
|
2331
2604
|
[]
|
|
2332
2605
|
);
|
|
2333
|
-
const reorderSteps = (0,
|
|
2606
|
+
const reorderSteps = _react.useCallback.call(void 0,
|
|
2334
2607
|
(params) => {
|
|
2335
2608
|
const { fromIndex, toIndex } = params;
|
|
2336
2609
|
const newSteps = [...store.steps];
|
|
@@ -2341,12 +2614,12 @@ function useStepStore() {
|
|
|
2341
2614
|
},
|
|
2342
2615
|
[]
|
|
2343
2616
|
);
|
|
2344
|
-
const clearAllSteps = (0,
|
|
2617
|
+
const clearAllSteps = _react.useCallback.call(void 0, () => {
|
|
2345
2618
|
store.steps = [];
|
|
2346
2619
|
clearSteps();
|
|
2347
2620
|
notifyListeners();
|
|
2348
2621
|
}, []);
|
|
2349
|
-
const exportSteps = (0,
|
|
2622
|
+
const exportSteps = _react.useCallback.call(void 0, () => {
|
|
2350
2623
|
return {
|
|
2351
2624
|
version: "1.0",
|
|
2352
2625
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -2390,7 +2663,7 @@ function useStepStore() {
|
|
|
2390
2663
|
}
|
|
2391
2664
|
|
|
2392
2665
|
// src/devtools/DevToolsProvider.tsx
|
|
2393
|
-
|
|
2666
|
+
|
|
2394
2667
|
var styles9 = {
|
|
2395
2668
|
panel: {
|
|
2396
2669
|
position: "fixed",
|
|
@@ -2472,10 +2745,10 @@ var styles9 = {
|
|
|
2472
2745
|
};
|
|
2473
2746
|
function DevToolsProvider(props) {
|
|
2474
2747
|
const { children, enabled = true, defaultTab = "steps" } = props;
|
|
2475
|
-
const [mounted, setMounted] = (0,
|
|
2476
|
-
const [shadowRoot, setShadowRoot] = (0,
|
|
2477
|
-
const [activeTab, setActiveTab] = (0,
|
|
2478
|
-
(0,
|
|
2748
|
+
const [mounted, setMounted] = _react.useState.call(void 0, false);
|
|
2749
|
+
const [shadowRoot, setShadowRoot] = _react.useState.call(void 0, null);
|
|
2750
|
+
const [activeTab, setActiveTab] = _react.useState.call(void 0, defaultTab);
|
|
2751
|
+
_react.useEffect.call(void 0, () => {
|
|
2479
2752
|
setMounted(true);
|
|
2480
2753
|
const host = document.createElement("div");
|
|
2481
2754
|
host.setAttribute("data-devtools-host", "");
|
|
@@ -2506,11 +2779,11 @@ function DevToolsProvider(props) {
|
|
|
2506
2779
|
exportSteps
|
|
2507
2780
|
} = useStepStore();
|
|
2508
2781
|
const { flows } = useFlowsData();
|
|
2509
|
-
const [collapsed, setCollapsed] = (0,
|
|
2510
|
-
const [position, setPosition] = (0,
|
|
2511
|
-
const [isPanelDragging, setIsPanelDragging] = (0,
|
|
2512
|
-
const dragStartRef =
|
|
2513
|
-
const handleClick = (0,
|
|
2782
|
+
const [collapsed, setCollapsed] = _react.useState.call(void 0, false);
|
|
2783
|
+
const [position, setPosition] = _react.useState.call(void 0, { x: 16, y: 16 });
|
|
2784
|
+
const [isPanelDragging, setIsPanelDragging] = _react.useState.call(void 0, false);
|
|
2785
|
+
const dragStartRef = _react.useRef.call(void 0, null);
|
|
2786
|
+
const handleClick = _react.useCallback.call(void 0,
|
|
2514
2787
|
(e) => {
|
|
2515
2788
|
if (mode !== "grabbing") return;
|
|
2516
2789
|
const target = e.target;
|
|
@@ -2519,7 +2792,7 @@ function DevToolsProvider(props) {
|
|
|
2519
2792
|
const root = target.getRootNode();
|
|
2520
2793
|
if (root instanceof ShadowRoot) {
|
|
2521
2794
|
const host = root.host;
|
|
2522
|
-
if (host
|
|
2795
|
+
if (_optionalChain([host, 'optionalAccess', _19 => _19.hasAttribute, 'call', _20 => _20("data-devtools-host")])) return;
|
|
2523
2796
|
}
|
|
2524
2797
|
e.preventDefault();
|
|
2525
2798
|
e.stopPropagation();
|
|
@@ -2530,12 +2803,12 @@ function DevToolsProvider(props) {
|
|
|
2530
2803
|
},
|
|
2531
2804
|
[mode, selectCurrent, addStep]
|
|
2532
2805
|
);
|
|
2533
|
-
(0,
|
|
2806
|
+
_react.useEffect.call(void 0, () => {
|
|
2534
2807
|
if (mode !== "grabbing") return;
|
|
2535
2808
|
document.addEventListener("click", handleClick, { capture: true });
|
|
2536
2809
|
return () => document.removeEventListener("click", handleClick, { capture: true });
|
|
2537
2810
|
}, [mode, handleClick]);
|
|
2538
|
-
(0,
|
|
2811
|
+
_react.useEffect.call(void 0, () => {
|
|
2539
2812
|
if (mode !== "grabbing") return;
|
|
2540
2813
|
const preventDefault = (e) => {
|
|
2541
2814
|
const target = e.target;
|
|
@@ -2547,7 +2820,7 @@ function DevToolsProvider(props) {
|
|
|
2547
2820
|
document.removeEventListener("submit", preventDefault, { capture: true });
|
|
2548
2821
|
};
|
|
2549
2822
|
}, [mode]);
|
|
2550
|
-
(0,
|
|
2823
|
+
_react.useEffect.call(void 0, () => {
|
|
2551
2824
|
const handleKeyDown = (e) => {
|
|
2552
2825
|
if (e.ctrlKey && e.shiftKey && e.key.toLowerCase() === "m") {
|
|
2553
2826
|
e.preventDefault();
|
|
@@ -2557,7 +2830,7 @@ function DevToolsProvider(props) {
|
|
|
2557
2830
|
document.addEventListener("keydown", handleKeyDown);
|
|
2558
2831
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
2559
2832
|
}, []);
|
|
2560
|
-
const handlePointerDown = (0,
|
|
2833
|
+
const handlePointerDown = _react.useCallback.call(void 0,
|
|
2561
2834
|
(e) => {
|
|
2562
2835
|
const target = e.target;
|
|
2563
2836
|
if (target.closest("button")) return;
|
|
@@ -2573,7 +2846,7 @@ function DevToolsProvider(props) {
|
|
|
2573
2846
|
},
|
|
2574
2847
|
[position]
|
|
2575
2848
|
);
|
|
2576
|
-
const handlePointerMove = (0,
|
|
2849
|
+
const handlePointerMove = _react.useCallback.call(void 0,
|
|
2577
2850
|
(e) => {
|
|
2578
2851
|
if (!dragStartRef.current || !isPanelDragging) return;
|
|
2579
2852
|
const dx = e.clientX - dragStartRef.current.x;
|
|
@@ -2584,15 +2857,15 @@ function DevToolsProvider(props) {
|
|
|
2584
2857
|
},
|
|
2585
2858
|
[isPanelDragging]
|
|
2586
2859
|
);
|
|
2587
|
-
const handlePointerUp = (0,
|
|
2860
|
+
const handlePointerUp = _react.useCallback.call(void 0, (e) => {
|
|
2588
2861
|
setIsPanelDragging(false);
|
|
2589
2862
|
dragStartRef.current = null;
|
|
2590
2863
|
e.target.releasePointerCapture(e.pointerId);
|
|
2591
2864
|
}, []);
|
|
2592
2865
|
if (!enabled || !mounted) {
|
|
2593
|
-
return /* @__PURE__ */ (0,
|
|
2866
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children });
|
|
2594
2867
|
}
|
|
2595
|
-
const shadowContainer = shadowRoot
|
|
2868
|
+
const shadowContainer = _nullishCoalesce(_optionalChain([shadowRoot, 'optionalAccess', _21 => _21.lastElementChild]), () => ( null));
|
|
2596
2869
|
const panelStyle = {
|
|
2597
2870
|
...styles9.panel,
|
|
2598
2871
|
right: position.x,
|
|
@@ -2602,20 +2875,20 @@ function DevToolsProvider(props) {
|
|
|
2602
2875
|
...styles9.header,
|
|
2603
2876
|
...isPanelDragging && styles9.headerDragging
|
|
2604
2877
|
};
|
|
2605
|
-
const portalContainer = shadowContainer
|
|
2606
|
-
return /* @__PURE__ */ (0,
|
|
2878
|
+
const portalContainer = _nullishCoalesce(shadowContainer, () => ( document.body));
|
|
2879
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2607
2880
|
children,
|
|
2608
|
-
/* @__PURE__ */ (0,
|
|
2881
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2609
2882
|
GrabberOverlay,
|
|
2610
2883
|
{
|
|
2611
2884
|
isGrabbing: mode === "grabbing",
|
|
2612
|
-
hoveredInfo: hoveredElement
|
|
2885
|
+
hoveredInfo: _nullishCoalesce(_optionalChain([hoveredElement, 'optionalAccess', _22 => _22.info]), () => ( null)),
|
|
2613
2886
|
container: shadowContainer
|
|
2614
2887
|
}
|
|
2615
2888
|
),
|
|
2616
|
-
(0,
|
|
2617
|
-
/* @__PURE__ */ (0,
|
|
2618
|
-
|
|
2889
|
+
_reactdom.createPortal.call(void 0,
|
|
2890
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2891
|
+
_react3.motion.div,
|
|
2619
2892
|
{
|
|
2620
2893
|
style: panelStyle,
|
|
2621
2894
|
initial: { opacity: 0, x: 20, scale: 0.95 },
|
|
@@ -2623,7 +2896,7 @@ function DevToolsProvider(props) {
|
|
|
2623
2896
|
transition: { duration: 0.2, ease: [0.16, 1, 0.3, 1] },
|
|
2624
2897
|
"data-devtools-panel": "",
|
|
2625
2898
|
children: [
|
|
2626
|
-
/* @__PURE__ */ (0,
|
|
2899
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2627
2900
|
"div",
|
|
2628
2901
|
{
|
|
2629
2902
|
style: headerStyle,
|
|
@@ -2632,21 +2905,21 @@ function DevToolsProvider(props) {
|
|
|
2632
2905
|
onPointerUp: handlePointerUp,
|
|
2633
2906
|
onPointerCancel: handlePointerUp,
|
|
2634
2907
|
children: [
|
|
2635
|
-
/* @__PURE__ */ (0,
|
|
2636
|
-
/* @__PURE__ */ (0,
|
|
2637
|
-
/* @__PURE__ */ (0,
|
|
2638
|
-
/* @__PURE__ */ (0,
|
|
2908
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: styles9.titleGroup, children: [
|
|
2909
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: styles9.logo, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "hsl(217 91% 70%)", children: [
|
|
2910
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M8 0L14.9 4v8L8 16 1.1 12V4L8 0zm0 2.3L3.1 5.2v5.6L8 13.7l4.9-2.9V5.2L8 2.3z" }),
|
|
2911
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M8 5l3 1.7v3.4L8 11.8 5 10.1V6.7L8 5z" })
|
|
2639
2912
|
] }) }),
|
|
2640
|
-
/* @__PURE__ */ (0,
|
|
2913
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: styles9.title, children: "DevTools" })
|
|
2641
2914
|
] }),
|
|
2642
|
-
/* @__PURE__ */ (0,
|
|
2915
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: styles9.headerButtons, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2643
2916
|
"button",
|
|
2644
2917
|
{
|
|
2645
2918
|
type: "button",
|
|
2646
2919
|
style: styles9.iconButton,
|
|
2647
2920
|
onClick: () => setCollapsed(!collapsed),
|
|
2648
2921
|
title: collapsed ? "Expand (Ctrl+Shift+M)" : "Collapse (Ctrl+Shift+M)",
|
|
2649
|
-
children: /* @__PURE__ */ (0,
|
|
2922
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2650
2923
|
"svg",
|
|
2651
2924
|
{
|
|
2652
2925
|
width: "14",
|
|
@@ -2657,7 +2930,7 @@ function DevToolsProvider(props) {
|
|
|
2657
2930
|
transform: collapsed ? "rotate(180deg)" : "none",
|
|
2658
2931
|
transition: "transform 0.2s ease"
|
|
2659
2932
|
},
|
|
2660
|
-
children: /* @__PURE__ */ (0,
|
|
2933
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M7.646 4.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1-.708.708L8 5.707l-5.646 5.647a.5.5 0 0 1-.708-.708l6-6z" })
|
|
2661
2934
|
}
|
|
2662
2935
|
)
|
|
2663
2936
|
}
|
|
@@ -2665,16 +2938,16 @@ function DevToolsProvider(props) {
|
|
|
2665
2938
|
]
|
|
2666
2939
|
}
|
|
2667
2940
|
),
|
|
2668
|
-
/* @__PURE__ */ (0,
|
|
2669
|
-
|
|
2941
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react3.AnimatePresence, { initial: false, children: !collapsed && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2942
|
+
_react3.motion.div,
|
|
2670
2943
|
{
|
|
2671
|
-
style: styles9.body,
|
|
2944
|
+
style: { ...styles9.body, overflow: "hidden" },
|
|
2672
2945
|
initial: { height: 0, opacity: 0 },
|
|
2673
2946
|
animate: { height: "auto", opacity: 1 },
|
|
2674
2947
|
exit: { height: 0, opacity: 0 },
|
|
2675
|
-
transition:
|
|
2948
|
+
transition: springs.smooth,
|
|
2676
2949
|
children: [
|
|
2677
|
-
/* @__PURE__ */ (0,
|
|
2950
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2678
2951
|
TabNav,
|
|
2679
2952
|
{
|
|
2680
2953
|
activeTab,
|
|
@@ -2683,7 +2956,7 @@ function DevToolsProvider(props) {
|
|
|
2683
2956
|
flowCount: flows.length
|
|
2684
2957
|
}
|
|
2685
2958
|
),
|
|
2686
|
-
activeTab === "steps" ? /* @__PURE__ */ (0,
|
|
2959
|
+
activeTab === "steps" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2687
2960
|
StepList,
|
|
2688
2961
|
{
|
|
2689
2962
|
steps,
|
|
@@ -2694,7 +2967,7 @@ function DevToolsProvider(props) {
|
|
|
2694
2967
|
onClearAll: clearAllSteps,
|
|
2695
2968
|
onExport: exportSteps
|
|
2696
2969
|
}
|
|
2697
|
-
) : /* @__PURE__ */ (0,
|
|
2970
|
+
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FlowsTab, { container: shadowContainer })
|
|
2698
2971
|
]
|
|
2699
2972
|
}
|
|
2700
2973
|
) })
|
|
@@ -2705,32 +2978,31 @@ function DevToolsProvider(props) {
|
|
|
2705
2978
|
)
|
|
2706
2979
|
] });
|
|
2707
2980
|
}
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
});
|
|
2981
|
+
|
|
2982
|
+
|
|
2983
|
+
|
|
2984
|
+
|
|
2985
|
+
|
|
2986
|
+
|
|
2987
|
+
|
|
2988
|
+
|
|
2989
|
+
|
|
2990
|
+
|
|
2991
|
+
|
|
2992
|
+
|
|
2993
|
+
|
|
2994
|
+
|
|
2995
|
+
|
|
2996
|
+
|
|
2997
|
+
|
|
2998
|
+
|
|
2999
|
+
|
|
3000
|
+
|
|
3001
|
+
|
|
3002
|
+
|
|
3003
|
+
|
|
3004
|
+
|
|
3005
|
+
|
|
3006
|
+
|
|
3007
|
+
|
|
3008
|
+
exports.DevToolsContext = _chunkFCOKCGV3cjs.DevToolsContext; exports.DevToolsProvider = DevToolsProvider; exports.FlowEditModal = FlowEditModal; exports.FlowItem = FlowItem; exports.FlowsTab = FlowsTab; exports.GrabberOverlay = GrabberOverlay; exports.SortableStepItem = SortableStepItem; exports.StepItem = SortableStepItem; exports.StepItemDragPreview = StepItemDragPreview; exports.StepList = StepList; exports.TabNav = TabNav; exports.Toolbar = Toolbar; exports.clearSteps = clearSteps; exports.extractComponentHierarchy = extractComponentHierarchy; exports.extractSource = extractSource; exports.formatSourcePath = formatSourcePath; exports.generateSelector = generateSelector; exports.getVSCodeLink = getVSCodeLink; exports.loadSteps = loadSteps; exports.saveSteps = saveSteps; exports.useDevToolsContext = _chunkFCOKCGV3cjs.useDevToolsContext; exports.useDevToolsContextRequired = _chunkFCOKCGV3cjs.useDevToolsContextRequired; exports.useElementInfo = useElementInfo; exports.useFlowsData = useFlowsData; exports.useGrabMode = useGrabMode; exports.useStepStore = useStepStore;
|