@goplasmatic/datalogic-ui 4.0.21 → 5.0.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.
Files changed (38) hide show
  1. package/README.md +35 -15
  2. package/dist/components/logic-editor/DataLogicEditor.d.ts +1 -1
  3. package/dist/components/logic-editor/DataLogicEditor.d.ts.map +1 -1
  4. package/dist/components/logic-editor/EditorToolbar.d.ts +3 -3
  5. package/dist/components/logic-editor/EditorToolbar.d.ts.map +1 -1
  6. package/dist/components/logic-editor/UndoRedoToolbar.d.ts.map +1 -1
  7. package/dist/components/logic-editor/config/operators/utility.d.ts.map +1 -1
  8. package/dist/components/logic-editor/context/editor/useClipboardState.d.ts.map +1 -1
  9. package/dist/components/logic-editor/context/editor/useHistoryState.d.ts.map +1 -1
  10. package/dist/components/logic-editor/debugger-controls/DebuggerControls.d.ts.map +1 -1
  11. package/dist/components/logic-editor/hooks/index.d.ts +1 -1
  12. package/dist/components/logic-editor/hooks/index.d.ts.map +1 -1
  13. package/dist/components/logic-editor/hooks/useLogicEditor.d.ts +3 -3
  14. package/dist/components/logic-editor/hooks/useLogicEditor.d.ts.map +1 -1
  15. package/dist/components/logic-editor/hooks/useWasmEvaluator.d.ts +8 -3
  16. package/dist/components/logic-editor/hooks/useWasmEvaluator.d.ts.map +1 -1
  17. package/dist/components/logic-editor/types/editor.d.ts +18 -6
  18. package/dist/components/logic-editor/types/editor.d.ts.map +1 -1
  19. package/dist/components/logic-editor/types/index.d.ts +1 -1
  20. package/dist/components/logic-editor/types/index.d.ts.map +1 -1
  21. package/dist/components/logic-editor/types/trace.d.ts +22 -0
  22. package/dist/components/logic-editor/types/trace.d.ts.map +1 -1
  23. package/dist/components/logic-editor/utils/converters/types.d.ts +2 -2
  24. package/dist/components/logic-editor/utils/converters/types.d.ts.map +1 -1
  25. package/dist/components/logic-editor/utils/jsonlogic-to-nodes.d.ts +2 -2
  26. package/dist/components/logic-editor/utils/jsonlogic-to-nodes.d.ts.map +1 -1
  27. package/dist/components/logic-editor/utils/trace/node-type.d.ts +1 -1
  28. package/dist/components/logic-editor/utils/trace/node-type.d.ts.map +1 -1
  29. package/dist/components/logic-editor/utils/trace/types.d.ts +3 -3
  30. package/dist/components/logic-editor/utils/trace/types.d.ts.map +1 -1
  31. package/dist/datalogic_wasm-CF1jcNAu.js +634 -0
  32. package/dist/datalogic_wasm-Dj9TEPTG.cjs +637 -0
  33. package/dist/index.cjs +868 -388
  34. package/dist/index.js +869 -389
  35. package/dist/styles.css +302 -136
  36. package/package.json +32 -29
  37. package/dist/datalogic_wasm-Ckkdrc0z.cjs +0 -383
  38. package/dist/datalogic_wasm-daWVf40b.js +0 -380
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import React, { createContext, createElement, createRef, forwardRef, memo, useCallback, useContext, useEffect, useImperativeHandle, useMemo, useReducer, useRef, useState } from "react";
1
+ import React, { createContext, createElement, createRef, forwardRef, memo, useCallback, useContext, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
2
2
  import { Background, BaseEdge, Controls, Handle, Position, ReactFlow, ReactFlowProvider, getBezierPath, useEdgesState, useNodesState, useOnSelectionChange, useReactFlow } from "@xyflow/react";
3
3
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
4
  import { createPortal } from "react-dom";
5
- //#region ../node_modules/.pnpm/lucide-react@1.8.0_react@19.2.5/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
5
+ //#region node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs
6
6
  /**
7
- * @license lucide-react v1.8.0 - ISC
7
+ * @license lucide-react v1.14.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
@@ -13,27 +13,27 @@ var mergeClasses = (...classes) => classes.filter((className, index, array) => {
13
13
  return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
14
14
  }).join(" ").trim();
15
15
  //#endregion
16
- //#region ../node_modules/.pnpm/lucide-react@1.8.0_react@19.2.5/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.js
16
+ //#region node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.mjs
17
17
  /**
18
- * @license lucide-react v1.8.0 - ISC
18
+ * @license lucide-react v1.14.0 - ISC
19
19
  *
20
20
  * This source code is licensed under the ISC license.
21
21
  * See the LICENSE file in the root directory of this source tree.
22
22
  */
23
23
  var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
24
24
  //#endregion
25
- //#region ../node_modules/.pnpm/lucide-react@1.8.0_react@19.2.5/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.js
25
+ //#region node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.mjs
26
26
  /**
27
- * @license lucide-react v1.8.0 - ISC
27
+ * @license lucide-react v1.14.0 - ISC
28
28
  *
29
29
  * This source code is licensed under the ISC license.
30
30
  * See the LICENSE file in the root directory of this source tree.
31
31
  */
32
32
  var toCamelCase = (string) => string.replace(/^([A-Z])|[\s-_]+(\w)/g, (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase());
33
33
  //#endregion
34
- //#region ../node_modules/.pnpm/lucide-react@1.8.0_react@19.2.5/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.js
34
+ //#region node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.mjs
35
35
  /**
36
- * @license lucide-react v1.8.0 - ISC
36
+ * @license lucide-react v1.14.0 - ISC
37
37
  *
38
38
  * This source code is licensed under the ISC license.
39
39
  * See the LICENSE file in the root directory of this source tree.
@@ -43,9 +43,9 @@ var toPascalCase = (string) => {
43
43
  return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
44
44
  };
45
45
  //#endregion
46
- //#region ../node_modules/.pnpm/lucide-react@1.8.0_react@19.2.5/node_modules/lucide-react/dist/esm/defaultAttributes.js
46
+ //#region node_modules/lucide-react/dist/esm/defaultAttributes.mjs
47
47
  /**
48
- * @license lucide-react v1.8.0 - ISC
48
+ * @license lucide-react v1.14.0 - ISC
49
49
  *
50
50
  * This source code is licensed under the ISC license.
51
51
  * See the LICENSE file in the root directory of this source tree.
@@ -62,9 +62,9 @@ var defaultAttributes = {
62
62
  strokeLinejoin: "round"
63
63
  };
64
64
  //#endregion
65
- //#region ../node_modules/.pnpm/lucide-react@1.8.0_react@19.2.5/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.js
65
+ //#region node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.mjs
66
66
  /**
67
- * @license lucide-react v1.8.0 - ISC
67
+ * @license lucide-react v1.14.0 - ISC
68
68
  *
69
69
  * This source code is licensed under the ISC license.
70
70
  * See the LICENSE file in the root directory of this source tree.
@@ -74,9 +74,9 @@ var hasA11yProp = (props) => {
74
74
  return false;
75
75
  };
76
76
  //#endregion
77
- //#region ../node_modules/.pnpm/lucide-react@1.8.0_react@19.2.5/node_modules/lucide-react/dist/esm/context.js
77
+ //#region node_modules/lucide-react/dist/esm/context.mjs
78
78
  /**
79
- * @license lucide-react v1.8.0 - ISC
79
+ * @license lucide-react v1.14.0 - ISC
80
80
  *
81
81
  * This source code is licensed under the ISC license.
82
82
  * See the LICENSE file in the root directory of this source tree.
@@ -84,9 +84,9 @@ var hasA11yProp = (props) => {
84
84
  var LucideContext = createContext({});
85
85
  var useLucideContext = () => useContext(LucideContext);
86
86
  //#endregion
87
- //#region ../node_modules/.pnpm/lucide-react@1.8.0_react@19.2.5/node_modules/lucide-react/dist/esm/Icon.js
87
+ //#region node_modules/lucide-react/dist/esm/Icon.mjs
88
88
  /**
89
- * @license lucide-react v1.8.0 - ISC
89
+ * @license lucide-react v1.14.0 - ISC
90
90
  *
91
91
  * This source code is licensed under the ISC license.
92
92
  * See the LICENSE file in the root directory of this source tree.
@@ -107,9 +107,9 @@ var Icon$1 = forwardRef(({ color, size, strokeWidth, absoluteStrokeWidth, classN
107
107
  }, [...iconNode.map(([tag, attrs]) => createElement(tag, attrs)), ...Array.isArray(children) ? children : [children]]);
108
108
  });
109
109
  //#endregion
110
- //#region ../node_modules/.pnpm/lucide-react@1.8.0_react@19.2.5/node_modules/lucide-react/dist/esm/createLucideIcon.js
110
+ //#region node_modules/lucide-react/dist/esm/createLucideIcon.mjs
111
111
  /**
112
- * @license lucide-react v1.8.0 - ISC
112
+ * @license lucide-react v1.14.0 - ISC
113
113
  *
114
114
  * This source code is licensed under the ISC license.
115
115
  * See the LICENSE file in the root directory of this source tree.
@@ -124,6 +124,12 @@ var createLucideIcon = (iconName, iconNode) => {
124
124
  Component.displayName = toPascalCase(iconName);
125
125
  return Component;
126
126
  };
127
+ /**
128
+ * @license lucide-react v1.14.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */
127
133
  var ArrowUp = createLucideIcon("arrow-up", [["path", {
128
134
  d: "m5 12 7-7 7 7",
129
135
  key: "hav0vg"
@@ -131,6 +137,12 @@ var ArrowUp = createLucideIcon("arrow-up", [["path", {
131
137
  d: "M12 19V5",
132
138
  key: "x0mq9r"
133
139
  }]]);
140
+ /**
141
+ * @license lucide-react v1.14.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */
134
146
  var Ban = createLucideIcon("ban", [["circle", {
135
147
  cx: "12",
136
148
  cy: "12",
@@ -140,6 +152,12 @@ var Ban = createLucideIcon("ban", [["circle", {
140
152
  d: "M4.929 4.929 19.07 19.071",
141
153
  key: "196cmz"
142
154
  }]]);
155
+ /**
156
+ * @license lucide-react v1.14.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */
143
161
  var Binary = createLucideIcon("binary", [
144
162
  ["rect", {
145
163
  x: "14",
@@ -174,6 +192,12 @@ var Binary = createLucideIcon("binary", [
174
192
  key: "1idq9u"
175
193
  }]
176
194
  ]);
195
+ /**
196
+ * @license lucide-react v1.14.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */
177
201
  var Box = createLucideIcon("box", [
178
202
  ["path", {
179
203
  d: "M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",
@@ -188,6 +212,12 @@ var Box = createLucideIcon("box", [
188
212
  key: "d0xqtd"
189
213
  }]
190
214
  ]);
215
+ /**
216
+ * @license lucide-react v1.14.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */
191
221
  var Boxes = createLucideIcon("boxes", [
192
222
  ["path", {
193
223
  d: "M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",
@@ -238,6 +268,12 @@ var Boxes = createLucideIcon("boxes", [
238
268
  key: "1io7kd"
239
269
  }]
240
270
  ]);
271
+ /**
272
+ * @license lucide-react v1.14.0 - ISC
273
+ *
274
+ * This source code is licensed under the ISC license.
275
+ * See the LICENSE file in the root directory of this source tree.
276
+ */
241
277
  var Braces = createLucideIcon("braces", [["path", {
242
278
  d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",
243
279
  key: "ezmyqa"
@@ -245,6 +281,12 @@ var Braces = createLucideIcon("braces", [["path", {
245
281
  d: "M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",
246
282
  key: "e1hn23"
247
283
  }]]);
284
+ /**
285
+ * @license lucide-react v1.14.0 - ISC
286
+ *
287
+ * This source code is licensed under the ISC license.
288
+ * See the LICENSE file in the root directory of this source tree.
289
+ */
248
290
  var Bug = createLucideIcon("bug", [
249
291
  ["path", {
250
292
  d: "M12 20v-9",
@@ -291,6 +333,12 @@ var Bug = createLucideIcon("bug", [
291
333
  key: "1vgav8"
292
334
  }]
293
335
  ]);
336
+ /**
337
+ * @license lucide-react v1.14.0 - ISC
338
+ *
339
+ * This source code is licensed under the ISC license.
340
+ * See the LICENSE file in the root directory of this source tree.
341
+ */
294
342
  var Calculator = createLucideIcon("calculator", [
295
343
  ["rect", {
296
344
  width: "16",
@@ -343,6 +391,12 @@ var Calculator = createLucideIcon("calculator", [
343
391
  key: "lrp35t"
344
392
  }]
345
393
  ]);
394
+ /**
395
+ * @license lucide-react v1.14.0 - ISC
396
+ *
397
+ * This source code is licensed under the ISC license.
398
+ * See the LICENSE file in the root directory of this source tree.
399
+ */
346
400
  var Calendar = createLucideIcon("calendar", [
347
401
  ["path", {
348
402
  d: "M8 2v4",
@@ -365,22 +419,52 @@ var Calendar = createLucideIcon("calendar", [
365
419
  key: "8toen8"
366
420
  }]
367
421
  ]);
422
+ /**
423
+ * @license lucide-react v1.14.0 - ISC
424
+ *
425
+ * This source code is licensed under the ISC license.
426
+ * See the LICENSE file in the root directory of this source tree.
427
+ */
368
428
  var Check = createLucideIcon("check", [["path", {
369
429
  d: "M20 6 9 17l-5-5",
370
430
  key: "1gmf2c"
371
431
  }]]);
432
+ /**
433
+ * @license lucide-react v1.14.0 - ISC
434
+ *
435
+ * This source code is licensed under the ISC license.
436
+ * See the LICENSE file in the root directory of this source tree.
437
+ */
372
438
  var ChevronDown = createLucideIcon("chevron-down", [["path", {
373
439
  d: "m6 9 6 6 6-6",
374
440
  key: "qrunsl"
375
441
  }]]);
442
+ /**
443
+ * @license lucide-react v1.14.0 - ISC
444
+ *
445
+ * This source code is licensed under the ISC license.
446
+ * See the LICENSE file in the root directory of this source tree.
447
+ */
376
448
  var ChevronLeft = createLucideIcon("chevron-left", [["path", {
377
449
  d: "m15 18-6-6 6-6",
378
450
  key: "1wnfg3"
379
451
  }]]);
452
+ /**
453
+ * @license lucide-react v1.14.0 - ISC
454
+ *
455
+ * This source code is licensed under the ISC license.
456
+ * See the LICENSE file in the root directory of this source tree.
457
+ */
380
458
  var ChevronRight = createLucideIcon("chevron-right", [["path", {
381
459
  d: "m9 18 6-6-6-6",
382
460
  key: "mthhwq"
383
461
  }]]);
462
+ /**
463
+ * @license lucide-react v1.14.0 - ISC
464
+ *
465
+ * This source code is licensed under the ISC license.
466
+ * See the LICENSE file in the root directory of this source tree.
467
+ */
384
468
  var CircleAlert = createLucideIcon("circle-alert", [
385
469
  ["circle", {
386
470
  cx: "12",
@@ -403,6 +487,12 @@ var CircleAlert = createLucideIcon("circle-alert", [
403
487
  key: "4dfq90"
404
488
  }]
405
489
  ]);
490
+ /**
491
+ * @license lucide-react v1.14.0 - ISC
492
+ *
493
+ * This source code is licensed under the ISC license.
494
+ * See the LICENSE file in the root directory of this source tree.
495
+ */
406
496
  var CircleQuestionMark = createLucideIcon("circle-question-mark", [
407
497
  ["circle", {
408
498
  cx: "12",
@@ -419,6 +509,12 @@ var CircleQuestionMark = createLucideIcon("circle-question-mark", [
419
509
  key: "p32p05"
420
510
  }]
421
511
  ]);
512
+ /**
513
+ * @license lucide-react v1.14.0 - ISC
514
+ *
515
+ * This source code is licensed under the ISC license.
516
+ * See the LICENSE file in the root directory of this source tree.
517
+ */
422
518
  var CircleX = createLucideIcon("circle-x", [
423
519
  ["circle", {
424
520
  cx: "12",
@@ -435,6 +531,12 @@ var CircleX = createLucideIcon("circle-x", [
435
531
  key: "z0biqf"
436
532
  }]
437
533
  ]);
534
+ /**
535
+ * @license lucide-react v1.14.0 - ISC
536
+ *
537
+ * This source code is licensed under the ISC license.
538
+ * See the LICENSE file in the root directory of this source tree.
539
+ */
438
540
  var Clipboard = createLucideIcon("clipboard", [["rect", {
439
541
  width: "8",
440
542
  height: "4",
@@ -447,6 +549,12 @@ var Clipboard = createLucideIcon("clipboard", [["rect", {
447
549
  d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",
448
550
  key: "116196"
449
551
  }]]);
552
+ /**
553
+ * @license lucide-react v1.14.0 - ISC
554
+ *
555
+ * This source code is licensed under the ISC license.
556
+ * See the LICENSE file in the root directory of this source tree.
557
+ */
450
558
  var Clock = createLucideIcon("clock", [["circle", {
451
559
  cx: "12",
452
560
  cy: "12",
@@ -456,6 +564,12 @@ var Clock = createLucideIcon("clock", [["circle", {
456
564
  d: "M12 6v6l4 2",
457
565
  key: "mmk7yg"
458
566
  }]]);
567
+ /**
568
+ * @license lucide-react v1.14.0 - ISC
569
+ *
570
+ * This source code is licensed under the ISC license.
571
+ * See the LICENSE file in the root directory of this source tree.
572
+ */
459
573
  var Cog = createLucideIcon("cog", [
460
574
  ["path", {
461
575
  d: "M11 10.27 7 3.34",
@@ -518,6 +632,12 @@ var Cog = createLucideIcon("cog", [
518
632
  key: "46899m"
519
633
  }]
520
634
  ]);
635
+ /**
636
+ * @license lucide-react v1.14.0 - ISC
637
+ *
638
+ * This source code is licensed under the ISC license.
639
+ * See the LICENSE file in the root directory of this source tree.
640
+ */
521
641
  var Copy = createLucideIcon("copy", [["rect", {
522
642
  width: "14",
523
643
  height: "14",
@@ -530,6 +650,12 @@ var Copy = createLucideIcon("copy", [["rect", {
530
650
  d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
531
651
  key: "zix9uf"
532
652
  }]]);
653
+ /**
654
+ * @license lucide-react v1.14.0 - ISC
655
+ *
656
+ * This source code is licensed under the ISC license.
657
+ * See the LICENSE file in the root directory of this source tree.
658
+ */
533
659
  var Database = createLucideIcon("database", [
534
660
  ["ellipse", {
535
661
  cx: "12",
@@ -547,10 +673,22 @@ var Database = createLucideIcon("database", [
547
673
  key: "mv7ke4"
548
674
  }]
549
675
  ]);
676
+ /**
677
+ * @license lucide-react v1.14.0 - ISC
678
+ *
679
+ * This source code is licensed under the ISC license.
680
+ * See the LICENSE file in the root directory of this source tree.
681
+ */
550
682
  var Diamond = createLucideIcon("diamond", [["path", {
551
683
  d: "M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z",
552
684
  key: "1f1r0c"
553
685
  }]]);
686
+ /**
687
+ * @license lucide-react v1.14.0 - ISC
688
+ *
689
+ * This source code is licensed under the ISC license.
690
+ * See the LICENSE file in the root directory of this source tree.
691
+ */
554
692
  var Divide = createLucideIcon("divide", [
555
693
  ["circle", {
556
694
  cx: "12",
@@ -572,6 +710,12 @@ var Divide = createLucideIcon("divide", [
572
710
  key: "lqb9t5"
573
711
  }]
574
712
  ]);
713
+ /**
714
+ * @license lucide-react v1.14.0 - ISC
715
+ *
716
+ * This source code is licensed under the ISC license.
717
+ * See the LICENSE file in the root directory of this source tree.
718
+ */
575
719
  var ExternalLink = createLucideIcon("external-link", [
576
720
  ["path", {
577
721
  d: "M15 3h6v6",
@@ -586,6 +730,36 @@ var ExternalLink = createLucideIcon("external-link", [
586
730
  key: "a6xqqp"
587
731
  }]
588
732
  ]);
733
+ /**
734
+ * @license lucide-react v1.14.0 - ISC
735
+ *
736
+ * This source code is licensed under the ISC license.
737
+ * See the LICENSE file in the root directory of this source tree.
738
+ */
739
+ var GitBranch = createLucideIcon("git-branch", [
740
+ ["path", {
741
+ d: "M15 6a9 9 0 0 0-9 9V3",
742
+ key: "1cii5b"
743
+ }],
744
+ ["circle", {
745
+ cx: "18",
746
+ cy: "6",
747
+ r: "3",
748
+ key: "1h7g24"
749
+ }],
750
+ ["circle", {
751
+ cx: "6",
752
+ cy: "18",
753
+ r: "3",
754
+ key: "fqmcym"
755
+ }]
756
+ ]);
757
+ /**
758
+ * @license lucide-react v1.14.0 - ISC
759
+ *
760
+ * This source code is licensed under the ISC license.
761
+ * See the LICENSE file in the root directory of this source tree.
762
+ */
589
763
  var GitCommitHorizontal = createLucideIcon("git-commit-horizontal", [
590
764
  ["circle", {
591
765
  cx: "12",
@@ -608,24 +782,12 @@ var GitCommitHorizontal = createLucideIcon("git-commit-horizontal", [
608
782
  key: "oup4p8"
609
783
  }]
610
784
  ]);
611
- var GitBranch = createLucideIcon("git-branch", [
612
- ["path", {
613
- d: "M15 6a9 9 0 0 0-9 9V3",
614
- key: "1cii5b"
615
- }],
616
- ["circle", {
617
- cx: "18",
618
- cy: "6",
619
- r: "3",
620
- key: "1h7g24"
621
- }],
622
- ["circle", {
623
- cx: "6",
624
- cy: "18",
625
- r: "3",
626
- key: "fqmcym"
627
- }]
628
- ]);
785
+ /**
786
+ * @license lucide-react v1.14.0 - ISC
787
+ *
788
+ * This source code is licensed under the ISC license.
789
+ * See the LICENSE file in the root directory of this source tree.
790
+ */
629
791
  var GitMerge = createLucideIcon("git-merge", [
630
792
  ["circle", {
631
793
  cx: "18",
@@ -644,6 +806,12 @@ var GitMerge = createLucideIcon("git-merge", [
644
806
  key: "7kw0sc"
645
807
  }]
646
808
  ]);
809
+ /**
810
+ * @license lucide-react v1.14.0 - ISC
811
+ *
812
+ * This source code is licensed under the ISC license.
813
+ * See the LICENSE file in the root directory of this source tree.
814
+ */
647
815
  var Hash = createLucideIcon("hash", [
648
816
  ["line", {
649
817
  x1: "4",
@@ -674,6 +842,12 @@ var Hash = createLucideIcon("hash", [
674
842
  key: "weycgp"
675
843
  }]
676
844
  ]);
845
+ /**
846
+ * @license lucide-react v1.14.0 - ISC
847
+ *
848
+ * This source code is licensed under the ISC license.
849
+ * See the LICENSE file in the root directory of this source tree.
850
+ */
677
851
  var Layers = createLucideIcon("layers", [
678
852
  ["path", {
679
853
  d: "M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",
@@ -688,6 +862,12 @@ var Layers = createLucideIcon("layers", [
688
862
  key: "kqbvx6"
689
863
  }]
690
864
  ]);
865
+ /**
866
+ * @license lucide-react v1.14.0 - ISC
867
+ *
868
+ * This source code is licensed under the ISC license.
869
+ * See the LICENSE file in the root directory of this source tree.
870
+ */
691
871
  var Link2Off = createLucideIcon("link-2-off", [
692
872
  ["path", {
693
873
  d: "M9 17H7A5 5 0 0 1 7 7",
@@ -712,6 +892,12 @@ var Link2Off = createLucideIcon("link-2-off", [
712
892
  key: "a6p6uj"
713
893
  }]
714
894
  ]);
895
+ /**
896
+ * @license lucide-react v1.14.0 - ISC
897
+ *
898
+ * This source code is licensed under the ISC license.
899
+ * See the LICENSE file in the root directory of this source tree.
900
+ */
715
901
  var List = createLucideIcon("list", [
716
902
  ["path", {
717
903
  d: "M3 5h.01",
@@ -738,6 +924,12 @@ var List = createLucideIcon("list", [
738
924
  key: "m83p4d"
739
925
  }]
740
926
  ]);
927
+ /**
928
+ * @license lucide-react v1.14.0 - ISC
929
+ *
930
+ * This source code is licensed under the ISC license.
931
+ * See the LICENSE file in the root directory of this source tree.
932
+ */
741
933
  var Maximize = createLucideIcon("maximize", [
742
934
  ["path", {
743
935
  d: "M8 3H5a2 2 0 0 0-2 2v3",
@@ -756,10 +948,22 @@ var Maximize = createLucideIcon("maximize", [
756
948
  key: "18trek"
757
949
  }]
758
950
  ]);
951
+ /**
952
+ * @license lucide-react v1.14.0 - ISC
953
+ *
954
+ * This source code is licensed under the ISC license.
955
+ * See the LICENSE file in the root directory of this source tree.
956
+ */
759
957
  var MousePointer2 = createLucideIcon("mouse-pointer-2", [["path", {
760
958
  d: "M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",
761
959
  key: "edeuup"
762
960
  }]]);
961
+ /**
962
+ * @license lucide-react v1.14.0 - ISC
963
+ *
964
+ * This source code is licensed under the ISC license.
965
+ * See the LICENSE file in the root directory of this source tree.
966
+ */
763
967
  var Pause = createLucideIcon("pause", [["rect", {
764
968
  x: "14",
765
969
  y: "3",
@@ -775,6 +979,12 @@ var Pause = createLucideIcon("pause", [["rect", {
775
979
  rx: "1",
776
980
  key: "1wsw3u"
777
981
  }]]);
982
+ /**
983
+ * @license lucide-react v1.14.0 - ISC
984
+ *
985
+ * This source code is licensed under the ISC license.
986
+ * See the LICENSE file in the root directory of this source tree.
987
+ */
778
988
  var PenLine = createLucideIcon("pen-line", [["path", {
779
989
  d: "M13 21h8",
780
990
  key: "1jsn5i"
@@ -782,10 +992,22 @@ var PenLine = createLucideIcon("pen-line", [["path", {
782
992
  d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
783
993
  key: "1a8usu"
784
994
  }]]);
995
+ /**
996
+ * @license lucide-react v1.14.0 - ISC
997
+ *
998
+ * This source code is licensed under the ISC license.
999
+ * See the LICENSE file in the root directory of this source tree.
1000
+ */
785
1001
  var Play = createLucideIcon("play", [["path", {
786
1002
  d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
787
1003
  key: "10ikf1"
788
1004
  }]]);
1005
+ /**
1006
+ * @license lucide-react v1.14.0 - ISC
1007
+ *
1008
+ * This source code is licensed under the ISC license.
1009
+ * See the LICENSE file in the root directory of this source tree.
1010
+ */
789
1011
  var Plus = createLucideIcon("plus", [["path", {
790
1012
  d: "M5 12h14",
791
1013
  key: "1ays0h"
@@ -793,6 +1015,12 @@ var Plus = createLucideIcon("plus", [["path", {
793
1015
  d: "M12 5v14",
794
1016
  key: "s699le"
795
1017
  }]]);
1018
+ /**
1019
+ * @license lucide-react v1.14.0 - ISC
1020
+ *
1021
+ * This source code is licensed under the ISC license.
1022
+ * See the LICENSE file in the root directory of this source tree.
1023
+ */
796
1024
  var Quote = createLucideIcon("quote", [["path", {
797
1025
  d: "M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",
798
1026
  key: "rib7q0"
@@ -800,6 +1028,12 @@ var Quote = createLucideIcon("quote", [["path", {
800
1028
  d: "M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",
801
1029
  key: "1ymkrd"
802
1030
  }]]);
1031
+ /**
1032
+ * @license lucide-react v1.14.0 - ISC
1033
+ *
1034
+ * This source code is licensed under the ISC license.
1035
+ * See the LICENSE file in the root directory of this source tree.
1036
+ */
803
1037
  var Redo2 = createLucideIcon("redo-2", [["path", {
804
1038
  d: "m15 14 5-5-5-5",
805
1039
  key: "12vg1m"
@@ -807,6 +1041,12 @@ var Redo2 = createLucideIcon("redo-2", [["path", {
807
1041
  d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",
808
1042
  key: "6uklza"
809
1043
  }]]);
1044
+ /**
1045
+ * @license lucide-react v1.14.0 - ISC
1046
+ *
1047
+ * This source code is licensed under the ISC license.
1048
+ * See the LICENSE file in the root directory of this source tree.
1049
+ */
810
1050
  var Repeat = createLucideIcon("repeat", [
811
1051
  ["path", {
812
1052
  d: "m17 2 4 4-4 4",
@@ -825,6 +1065,12 @@ var Repeat = createLucideIcon("repeat", [
825
1065
  key: "1rx37r"
826
1066
  }]
827
1067
  ]);
1068
+ /**
1069
+ * @license lucide-react v1.14.0 - ISC
1070
+ *
1071
+ * This source code is licensed under the ISC license.
1072
+ * See the LICENSE file in the root directory of this source tree.
1073
+ */
828
1074
  var Scale = createLucideIcon("scale", [
829
1075
  ["path", {
830
1076
  d: "M12 3v18",
@@ -847,6 +1093,12 @@ var Scale = createLucideIcon("scale", [
847
1093
  key: "1b0cd5"
848
1094
  }]
849
1095
  ]);
1096
+ /**
1097
+ * @license lucide-react v1.14.0 - ISC
1098
+ *
1099
+ * This source code is licensed under the ISC license.
1100
+ * See the LICENSE file in the root directory of this source tree.
1101
+ */
850
1102
  var Search = createLucideIcon("search", [["path", {
851
1103
  d: "m21 21-4.34-4.34",
852
1104
  key: "14j7rj"
@@ -856,6 +1108,12 @@ var Search = createLucideIcon("search", [["path", {
856
1108
  r: "8",
857
1109
  key: "4ej97u"
858
1110
  }]]);
1111
+ /**
1112
+ * @license lucide-react v1.14.0 - ISC
1113
+ *
1114
+ * This source code is licensed under the ISC license.
1115
+ * See the LICENSE file in the root directory of this source tree.
1116
+ */
859
1117
  var SkipBack = createLucideIcon("skip-back", [["path", {
860
1118
  d: "M17.971 4.285A2 2 0 0 1 21 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z",
861
1119
  key: "15892j"
@@ -863,6 +1121,12 @@ var SkipBack = createLucideIcon("skip-back", [["path", {
863
1121
  d: "M3 20V4",
864
1122
  key: "1ptbpl"
865
1123
  }]]);
1124
+ /**
1125
+ * @license lucide-react v1.14.0 - ISC
1126
+ *
1127
+ * This source code is licensed under the ISC license.
1128
+ * See the LICENSE file in the root directory of this source tree.
1129
+ */
866
1130
  var SkipForward = createLucideIcon("skip-forward", [["path", {
867
1131
  d: "M21 4v16",
868
1132
  key: "7j8fe9"
@@ -870,6 +1134,12 @@ var SkipForward = createLucideIcon("skip-forward", [["path", {
870
1134
  d: "M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",
871
1135
  key: "zs4d6"
872
1136
  }]]);
1137
+ /**
1138
+ * @license lucide-react v1.14.0 - ISC
1139
+ *
1140
+ * This source code is licensed under the ISC license.
1141
+ * See the LICENSE file in the root directory of this source tree.
1142
+ */
873
1143
  var Tag = createLucideIcon("tag", [["path", {
874
1144
  d: "M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",
875
1145
  key: "vktsd0"
@@ -880,6 +1150,12 @@ var Tag = createLucideIcon("tag", [["path", {
880
1150
  fill: "currentColor",
881
1151
  key: "kqv944"
882
1152
  }]]);
1153
+ /**
1154
+ * @license lucide-react v1.14.0 - ISC
1155
+ *
1156
+ * This source code is licensed under the ISC license.
1157
+ * See the LICENSE file in the root directory of this source tree.
1158
+ */
883
1159
  var TextAlignStart = createLucideIcon("text-align-start", [
884
1160
  ["path", {
885
1161
  d: "M21 5H3",
@@ -894,6 +1170,12 @@ var TextAlignStart = createLucideIcon("text-align-start", [
894
1170
  key: "z6ezky"
895
1171
  }]
896
1172
  ]);
1173
+ /**
1174
+ * @license lucide-react v1.14.0 - ISC
1175
+ *
1176
+ * This source code is licensed under the ISC license.
1177
+ * See the LICENSE file in the root directory of this source tree.
1178
+ */
897
1179
  var ToggleLeft = createLucideIcon("toggle-left", [["circle", {
898
1180
  cx: "9",
899
1181
  cy: "12",
@@ -907,6 +1189,12 @@ var ToggleLeft = createLucideIcon("toggle-left", [["circle", {
907
1189
  rx: "7",
908
1190
  key: "g7kal2"
909
1191
  }]]);
1192
+ /**
1193
+ * @license lucide-react v1.14.0 - ISC
1194
+ *
1195
+ * This source code is licensed under the ISC license.
1196
+ * See the LICENSE file in the root directory of this source tree.
1197
+ */
910
1198
  var ToggleRight = createLucideIcon("toggle-right", [["circle", {
911
1199
  cx: "15",
912
1200
  cy: "12",
@@ -920,6 +1208,12 @@ var ToggleRight = createLucideIcon("toggle-right", [["circle", {
920
1208
  rx: "7",
921
1209
  key: "g7kal2"
922
1210
  }]]);
1211
+ /**
1212
+ * @license lucide-react v1.14.0 - ISC
1213
+ *
1214
+ * This source code is licensed under the ISC license.
1215
+ * See the LICENSE file in the root directory of this source tree.
1216
+ */
923
1217
  var Trash2 = createLucideIcon("trash-2", [
924
1218
  ["path", {
925
1219
  d: "M10 11v6",
@@ -942,6 +1236,12 @@ var Trash2 = createLucideIcon("trash-2", [
942
1236
  key: "e791ji"
943
1237
  }]
944
1238
  ]);
1239
+ /**
1240
+ * @license lucide-react v1.14.0 - ISC
1241
+ *
1242
+ * This source code is licensed under the ISC license.
1243
+ * See the LICENSE file in the root directory of this source tree.
1244
+ */
945
1245
  var Type = createLucideIcon("type", [
946
1246
  ["path", {
947
1247
  d: "M12 4v16",
@@ -956,6 +1256,12 @@ var Type = createLucideIcon("type", [
956
1256
  key: "s66wpe"
957
1257
  }]
958
1258
  ]);
1259
+ /**
1260
+ * @license lucide-react v1.14.0 - ISC
1261
+ *
1262
+ * This source code is licensed under the ISC license.
1263
+ * See the LICENSE file in the root directory of this source tree.
1264
+ */
959
1265
  var Undo2 = createLucideIcon("undo-2", [["path", {
960
1266
  d: "M9 14 4 9l5-5",
961
1267
  key: "102s5s"
@@ -963,6 +1269,12 @@ var Undo2 = createLucideIcon("undo-2", [["path", {
963
1269
  d: "M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",
964
1270
  key: "f3b9sd"
965
1271
  }]]);
1272
+ /**
1273
+ * @license lucide-react v1.14.0 - ISC
1274
+ *
1275
+ * This source code is licensed under the ISC license.
1276
+ * See the LICENSE file in the root directory of this source tree.
1277
+ */
966
1278
  var Variable = createLucideIcon("variable", [
967
1279
  ["path", {
968
1280
  d: "M8 21s-4-3-4-9 4-9 4-9",
@@ -987,6 +1299,40 @@ var Variable = createLucideIcon("variable", [
987
1299
  key: "1shsy8"
988
1300
  }]
989
1301
  ]);
1302
+ /**
1303
+ * @license lucide-react v1.14.0 - ISC
1304
+ *
1305
+ * This source code is licensed under the ISC license.
1306
+ * See the LICENSE file in the root directory of this source tree.
1307
+ */
1308
+ var Workflow = createLucideIcon("workflow", [
1309
+ ["rect", {
1310
+ width: "8",
1311
+ height: "8",
1312
+ x: "3",
1313
+ y: "3",
1314
+ rx: "2",
1315
+ key: "by2w9f"
1316
+ }],
1317
+ ["path", {
1318
+ d: "M7 11v4a2 2 0 0 0 2 2h4",
1319
+ key: "xkn7yn"
1320
+ }],
1321
+ ["rect", {
1322
+ width: "8",
1323
+ height: "8",
1324
+ x: "13",
1325
+ y: "13",
1326
+ rx: "2",
1327
+ key: "1cgmvn"
1328
+ }]
1329
+ ]);
1330
+ /**
1331
+ * @license lucide-react v1.14.0 - ISC
1332
+ *
1333
+ * This source code is licensed under the ISC license.
1334
+ * See the LICENSE file in the root directory of this source tree.
1335
+ */
990
1336
  var X$1 = createLucideIcon("x", [["path", {
991
1337
  d: "M18 6 6 18",
992
1338
  key: "1bl5f8"
@@ -994,6 +1340,12 @@ var X$1 = createLucideIcon("x", [["path", {
994
1340
  d: "m6 6 12 12",
995
1341
  key: "d8bk6v"
996
1342
  }]]);
1343
+ /**
1344
+ * @license lucide-react v1.14.0 - ISC
1345
+ *
1346
+ * This source code is licensed under the ISC license.
1347
+ * See the LICENSE file in the root directory of this source tree.
1348
+ */
997
1349
  var ZoomIn = createLucideIcon("zoom-in", [
998
1350
  ["circle", {
999
1351
  cx: "11",
@@ -1030,18 +1382,18 @@ var BRANCH_COLORS = {
1030
1382
  no: "#EF4444"
1031
1383
  };
1032
1384
  var CATEGORY_COLORS = {
1033
- variable: "#5C7CFA",
1034
- comparison: "#20C997",
1035
- logical: "#845EF7",
1036
- arithmetic: "#40C057",
1037
- string: "#15AABF",
1038
- array: "#5F3DC4",
1039
- control: "#F59F00",
1040
- datetime: "#748FFC",
1041
- validation: "#ADB5BD",
1042
- utility: "#6B7280",
1043
- error: "#FA5252",
1044
- literal: "#6B7280"
1385
+ variable: "#6366f1",
1386
+ comparison: "#14b8a6",
1387
+ logical: "#8b5cf6",
1388
+ arithmetic: "#22c55e",
1389
+ string: "#06b6d4",
1390
+ array: "#7c3aed",
1391
+ control: "#f59e0b",
1392
+ datetime: "#0ea5e9",
1393
+ validation: "#94a3b8",
1394
+ utility: "#64748b",
1395
+ error: "#ef4444",
1396
+ literal: "#64748b"
1045
1397
  };
1046
1398
  //#endregion
1047
1399
  //#region src/components/logic-editor/config/operators/variable.ts
@@ -6003,179 +6355,99 @@ var errorOperators = {
6003
6355
  };
6004
6356
  //#endregion
6005
6357
  //#region src/components/logic-editor/config/operators/utility.ts
6006
- var utilityOperators = {
6007
- type: {
6008
- name: "type",
6009
- label: "Type",
6010
- category: "utility",
6011
- description: "Get the type of a value",
6012
- arity: {
6013
- type: "unary",
6014
- min: 1,
6015
- max: 1,
6016
- args: [{
6017
- name: "value",
6018
- label: "Value",
6019
- type: "any",
6020
- required: true,
6021
- description: "Value to check type of"
6022
- }]
6023
- },
6024
- help: {
6025
- summary: "Returns a string indicating the type of a value",
6026
- details: "Inspects a value and returns its type as a string. Useful for conditional logic based on data types. Includes special detection for datetime and duration strings.",
6027
- returnType: "string",
6028
- examples: [
6029
- {
6030
- title: "Number type",
6031
- rule: { type: 42 },
6032
- result: "number"
6033
- },
6034
- {
6035
- title: "String type",
6036
- rule: { type: "hello" },
6037
- result: "string"
6038
- },
6039
- {
6040
- title: "Boolean type",
6041
- rule: { type: true },
6042
- result: "boolean"
6043
- },
6044
- {
6045
- title: "Null type",
6046
- rule: { type: null },
6047
- result: "null"
6048
- },
6049
- {
6050
- title: "Array type",
6051
- rule: { type: [
6052
- 1,
6053
- 2,
6054
- 3
6055
- ] },
6056
- result: "array"
6057
- },
6058
- {
6059
- title: "Object type",
6060
- rule: { type: { key: "value" } },
6061
- result: "object"
6062
- },
6063
- {
6064
- title: "Datetime detection",
6065
- rule: { type: "2024-01-15T10:30:00Z" },
6066
- result: "datetime",
6067
- note: "ISO 8601 strings detected as datetime"
6068
- },
6069
- {
6070
- title: "Duration detection",
6071
- rule: { type: "2h30m" },
6072
- result: "duration",
6073
- note: "Duration strings detected automatically"
6074
- },
6075
- {
6076
- title: "With variable",
6077
- rule: { type: { var: "value" } },
6078
- data: { value: [
6079
- 1,
6080
- 2,
6081
- 3
6082
- ] },
6083
- result: "array"
6084
- }
6085
- ],
6086
- notes: [
6087
- "Returns: \"null\", \"boolean\", \"number\", \"string\", \"array\", \"object\", \"datetime\", \"duration\"",
6088
- "Datetime: detected by ISO 8601 format (contains T, :, and Z or +)",
6089
- "Duration: detected by time units (d, h, m, s) with digits",
6090
- "Empty arrays and objects are still \"array\" and \"object\""
6091
- ],
6092
- seeAlso: ["!!"]
6093
- },
6094
- ui: {
6095
- icon: "info",
6096
- shortLabel: "type",
6097
- nodeType: "operator"
6098
- }
6358
+ var utilityOperators = { type: {
6359
+ name: "type",
6360
+ label: "Type",
6361
+ category: "utility",
6362
+ description: "Get the type of a value",
6363
+ arity: {
6364
+ type: "unary",
6365
+ min: 1,
6366
+ max: 1,
6367
+ args: [{
6368
+ name: "value",
6369
+ label: "Value",
6370
+ type: "any",
6371
+ required: true,
6372
+ description: "Value to check type of"
6373
+ }]
6099
6374
  },
6100
- preserve: {
6101
- name: "preserve",
6102
- label: "Preserve",
6103
- category: "utility",
6104
- description: "Pass values through unchanged (templating mode)",
6105
- arity: {
6106
- type: "special",
6107
- min: 0,
6108
- args: [{
6109
- name: "value",
6110
- label: "Value",
6111
- type: "any",
6112
- required: false,
6113
- repeatable: true,
6114
- description: "Value(s) to preserve"
6115
- }]
6116
- },
6117
- help: {
6118
- summary: "Evaluate and return values unchanged",
6119
- details: "Used in structure preservation (templating) mode to pass values through without interpretation as operators. With one argument, returns that value. With multiple arguments, returns an array.",
6120
- returnType: "any",
6121
- examples: [
6122
- {
6123
- title: "Preserve single value",
6124
- rule: { preserve: 42 },
6125
- result: 42
6126
- },
6127
- {
6128
- title: "Preserve expression result",
6129
- rule: { preserve: { "+": [1, 2] } },
6130
- result: 3
6131
- },
6132
- {
6133
- title: "Preserve multiple values",
6134
- rule: { preserve: [
6135
- 1,
6136
- 2,
6137
- 3
6138
- ] },
6139
- result: [
6140
- 1,
6141
- 2,
6142
- 3
6143
- ]
6144
- },
6145
- {
6146
- title: "No arguments",
6147
- rule: { preserve: [] },
6148
- result: []
6149
- },
6150
- {
6151
- title: "In template context",
6152
- rule: {
6153
- name: { var: "user.name" },
6154
- status: { preserve: "active" }
6155
- },
6156
- data: { user: { name: "Alice" } },
6157
- result: {
6158
- name: "Alice",
6159
- status: "active"
6160
- },
6161
- note: "With preserve_structure enabled"
6162
- }
6163
- ],
6164
- notes: [
6165
- "Used with preserve_structure mode for JSON templating",
6166
- "No arguments: returns empty array",
6167
- "One argument: returns that argument evaluated",
6168
- "Multiple arguments: returns array of evaluated arguments"
6169
- ],
6170
- seeAlso: ["var", "val"]
6171
- },
6172
- ui: {
6173
- icon: "lock",
6174
- shortLabel: "keep",
6175
- nodeType: "operator"
6176
- }
6375
+ help: {
6376
+ summary: "Returns a string indicating the type of a value",
6377
+ details: "Inspects a value and returns its type as a string. Useful for conditional logic based on data types. Includes special detection for datetime and duration strings.",
6378
+ returnType: "string",
6379
+ examples: [
6380
+ {
6381
+ title: "Number type",
6382
+ rule: { type: 42 },
6383
+ result: "number"
6384
+ },
6385
+ {
6386
+ title: "String type",
6387
+ rule: { type: "hello" },
6388
+ result: "string"
6389
+ },
6390
+ {
6391
+ title: "Boolean type",
6392
+ rule: { type: true },
6393
+ result: "boolean"
6394
+ },
6395
+ {
6396
+ title: "Null type",
6397
+ rule: { type: null },
6398
+ result: "null"
6399
+ },
6400
+ {
6401
+ title: "Array type",
6402
+ rule: { type: [
6403
+ 1,
6404
+ 2,
6405
+ 3
6406
+ ] },
6407
+ result: "array"
6408
+ },
6409
+ {
6410
+ title: "Object type",
6411
+ rule: { type: { key: "value" } },
6412
+ result: "object"
6413
+ },
6414
+ {
6415
+ title: "Datetime detection",
6416
+ rule: { type: "2024-01-15T10:30:00Z" },
6417
+ result: "datetime",
6418
+ note: "ISO 8601 strings detected as datetime"
6419
+ },
6420
+ {
6421
+ title: "Duration detection",
6422
+ rule: { type: "2h30m" },
6423
+ result: "duration",
6424
+ note: "Duration strings detected automatically"
6425
+ },
6426
+ {
6427
+ title: "With variable",
6428
+ rule: { type: { var: "value" } },
6429
+ data: { value: [
6430
+ 1,
6431
+ 2,
6432
+ 3
6433
+ ] },
6434
+ result: "array"
6435
+ }
6436
+ ],
6437
+ notes: [
6438
+ "Returns: \"null\", \"boolean\", \"number\", \"string\", \"array\", \"object\", \"datetime\", \"duration\"",
6439
+ "Datetime: detected by ISO 8601 format (contains T, :, and Z or +)",
6440
+ "Duration: detected by time units (d, h, m, s) with digits",
6441
+ "Empty arrays and objects are still \"array\" and \"object\""
6442
+ ],
6443
+ seeAlso: ["!!"]
6444
+ },
6445
+ ui: {
6446
+ icon: "info",
6447
+ shortLabel: "type",
6448
+ nodeType: "operator"
6177
6449
  }
6178
- };
6450
+ } };
6179
6451
  //#endregion
6180
6452
  //#region src/components/logic-editor/config/operators/index.ts
6181
6453
  /**
@@ -6280,26 +6552,24 @@ function getParentInfo(context) {
6280
6552
  };
6281
6553
  }
6282
6554
  //#endregion
6283
- //#region ../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist/stringify.js
6555
+ //#region node_modules/uuid/dist/stringify.js
6284
6556
  var byteToHex = [];
6285
6557
  for (let i = 0; i < 256; ++i) byteToHex.push((i + 256).toString(16).slice(1));
6286
6558
  function unsafeStringify(arr, offset = 0) {
6287
6559
  return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
6288
6560
  }
6289
6561
  //#endregion
6290
- //#region ../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist/rng.js
6291
- var getRandomValues;
6562
+ //#region node_modules/uuid/dist/rng.js
6292
6563
  var rnds8 = new Uint8Array(16);
6293
6564
  function rng() {
6294
- if (!getRandomValues) {
6295
- if (typeof crypto === "undefined" || !crypto.getRandomValues) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
6296
- getRandomValues = crypto.getRandomValues.bind(crypto);
6297
- }
6298
- return getRandomValues(rnds8);
6565
+ return crypto.getRandomValues(rnds8);
6299
6566
  }
6300
- var native_default = { randomUUID: typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto) };
6301
6567
  //#endregion
6302
- //#region ../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist/v4.js
6568
+ //#region node_modules/uuid/dist/v4.js
6569
+ function v4(options, buf, offset) {
6570
+ if (!buf && !options && crypto.randomUUID) return crypto.randomUUID();
6571
+ return _v4(options, buf, offset);
6572
+ }
6303
6573
  function _v4(options, buf, offset) {
6304
6574
  options = options || {};
6305
6575
  const rnds = options.random ?? options.rng?.() ?? rng();
@@ -6314,10 +6584,6 @@ function _v4(options, buf, offset) {
6314
6584
  }
6315
6585
  return unsafeStringify(rnds);
6316
6586
  }
6317
- function v4(options, buf, offset) {
6318
- if (native_default.randomUUID && !buf && !options) return native_default.randomUUID();
6319
- return _v4(options, buf, offset);
6320
- }
6321
6587
  //#endregion
6322
6588
  //#region src/components/logic-editor/utils/formatting/expression-text.ts
6323
6589
  var COMPARISON_OPERATORS$1 = [
@@ -6884,70 +7150,70 @@ var categories = {
6884
7150
  name: "variable",
6885
7151
  label: "Variables",
6886
7152
  description: "Access data from the context",
6887
- color: "#5C7CFA",
7153
+ color: "#6366f1",
6888
7154
  icon: "database"
6889
7155
  },
6890
7156
  comparison: {
6891
7157
  name: "comparison",
6892
7158
  label: "Comparison",
6893
7159
  description: "Compare values",
6894
- color: "#20C997",
7160
+ color: "#14b8a6",
6895
7161
  icon: "scale"
6896
7162
  },
6897
7163
  logical: {
6898
7164
  name: "logical",
6899
7165
  label: "Logical",
6900
7166
  description: "Boolean logic operations",
6901
- color: "#845EF7",
7167
+ color: "#8b5cf6",
6902
7168
  icon: "binary"
6903
7169
  },
6904
7170
  arithmetic: {
6905
7171
  name: "arithmetic",
6906
7172
  label: "Arithmetic",
6907
7173
  description: "Mathematical operations",
6908
- color: "#40C057",
7174
+ color: "#22c55e",
6909
7175
  icon: "calculator"
6910
7176
  },
6911
7177
  control: {
6912
7178
  name: "control",
6913
7179
  label: "Control Flow",
6914
7180
  description: "Conditional branching",
6915
- color: "#F59F00",
7181
+ color: "#f59e0b",
6916
7182
  icon: "git-branch"
6917
7183
  },
6918
7184
  string: {
6919
7185
  name: "string",
6920
7186
  label: "String",
6921
7187
  description: "Text manipulation",
6922
- color: "#15AABF",
7188
+ color: "#06b6d4",
6923
7189
  icon: "type"
6924
7190
  },
6925
7191
  array: {
6926
7192
  name: "array",
6927
7193
  label: "Array",
6928
7194
  description: "Array operations and iteration",
6929
- color: "#5F3DC4",
7195
+ color: "#7c3aed",
6930
7196
  icon: "layers"
6931
7197
  },
6932
7198
  datetime: {
6933
7199
  name: "datetime",
6934
7200
  label: "Date & Time",
6935
7201
  description: "Date and time operations",
6936
- color: "#748FFC",
7202
+ color: "#0ea5e9",
6937
7203
  icon: "clock"
6938
7204
  },
6939
7205
  validation: {
6940
7206
  name: "validation",
6941
7207
  label: "Validation",
6942
7208
  description: "Check for missing values",
6943
- color: "#ADB5BD",
7209
+ color: "#94a3b8",
6944
7210
  icon: "alert-circle"
6945
7211
  },
6946
7212
  error: {
6947
7213
  name: "error",
6948
7214
  label: "Error Handling",
6949
7215
  description: "Handle errors gracefully",
6950
- color: "#FA5252",
7216
+ color: "#ef4444",
6951
7217
  icon: "circle-x"
6952
7218
  },
6953
7219
  utility: {
@@ -7015,7 +7281,7 @@ function convertVariable(operator, operands, context, convertValue) {
7015
7281
  edges: context.edges,
7016
7282
  parentId: nodeId,
7017
7283
  argIndex: 1,
7018
- preserveStructure: context.preserveStructure
7284
+ templating: context.templating
7019
7285
  });
7020
7286
  const summary = generateArgSummary(defaultValue);
7021
7287
  summary.label = generateExpressionText(defaultValue, TRUNCATION_LIMITS.expressionText);
@@ -7072,7 +7338,7 @@ function convertIfElse(ifArgs, context, convertValue) {
7072
7338
  parentId: parentInfo.parentId,
7073
7339
  argIndex: parentInfo.argIndex,
7074
7340
  branchType: parentInfo.branchType,
7075
- preserveStructure: context.preserveStructure
7341
+ templating: context.templating
7076
7342
  });
7077
7343
  const cells = [];
7078
7344
  let cellIndex = 0;
@@ -7087,7 +7353,7 @@ function convertIfElse(ifArgs, context, convertValue) {
7087
7353
  parentId: nodeId,
7088
7354
  argIndex: idx,
7089
7355
  branchType: "condition",
7090
- preserveStructure: context.preserveStructure
7356
+ templating: context.templating
7091
7357
  });
7092
7358
  context.edges.push({
7093
7359
  id: `${nodeId}-cond-${conditionBranchId}`,
@@ -7112,7 +7378,7 @@ function convertIfElse(ifArgs, context, convertValue) {
7112
7378
  parentId: nodeId,
7113
7379
  argIndex: idx + 1,
7114
7380
  branchType: "yes",
7115
- preserveStructure: context.preserveStructure
7381
+ templating: context.templating
7116
7382
  });
7117
7383
  context.edges.push({
7118
7384
  id: `${nodeId}-then-${thenBranchId}`,
@@ -7141,7 +7407,7 @@ function convertIfElse(ifArgs, context, convertValue) {
7141
7407
  parentId: nodeId,
7142
7408
  argIndex: ifArgs.length - 1,
7143
7409
  branchType: "no",
7144
- preserveStructure: context.preserveStructure
7410
+ templating: context.templating
7145
7411
  });
7146
7412
  context.edges.push({
7147
7413
  id: `${nodeId}-else-${elseBranchId}`,
@@ -7224,7 +7490,7 @@ function convertSwitch(operator, switchArgs, context, convertValue) {
7224
7490
  parentId: nodeId,
7225
7491
  argIndex: 0,
7226
7492
  branchType: "branch",
7227
- preserveStructure: context.preserveStructure
7493
+ templating: context.templating
7228
7494
  });
7229
7495
  context.edges.push(createBranchEdge(nodeId, discBranchId, cellIndex));
7230
7496
  cells.push({
@@ -7260,7 +7526,7 @@ function convertSwitch(operator, switchArgs, context, convertValue) {
7260
7526
  parentId: nodeId,
7261
7527
  argIndex: cellIndex,
7262
7528
  branchType: "branch",
7263
- preserveStructure: context.preserveStructure
7529
+ templating: context.templating
7264
7530
  });
7265
7531
  context.edges.push(createBranchEdge(nodeId, caseBranchId, cellIndex));
7266
7532
  cells.push({
@@ -7287,7 +7553,7 @@ function convertSwitch(operator, switchArgs, context, convertValue) {
7287
7553
  parentId: nodeId,
7288
7554
  argIndex: cellIndex,
7289
7555
  branchType: "yes",
7290
- preserveStructure: context.preserveStructure
7556
+ templating: context.templating
7291
7557
  });
7292
7558
  context.edges.push(createBranchEdge(nodeId, resultBranchId, cellIndex));
7293
7559
  cells.push({
@@ -7318,7 +7584,7 @@ function convertSwitch(operator, switchArgs, context, convertValue) {
7318
7584
  parentId: nodeId,
7319
7585
  argIndex: cellIndex,
7320
7586
  branchType: "no",
7321
- preserveStructure: context.preserveStructure
7587
+ templating: context.templating
7322
7588
  });
7323
7589
  context.edges.push(createBranchEdge(nodeId, defaultBranchId, cellIndex));
7324
7590
  cells.push({
@@ -7385,7 +7651,7 @@ function convertOperator$1(operator, operandArray, context, convertValue) {
7385
7651
  parentId: nodeId,
7386
7652
  argIndex: idx,
7387
7653
  branchType: "branch",
7388
- preserveStructure: context.preserveStructure
7654
+ templating: context.templating
7389
7655
  });
7390
7656
  const summary = generateArgSummary(operand);
7391
7657
  summary.label = generateExpressionText(operand, TRUNCATION_LIMITS.expressionText);
@@ -7449,7 +7715,7 @@ function convertStructure$1(value, context, convertValue) {
7449
7715
  edges: context.edges,
7450
7716
  parentId: nodeId,
7451
7717
  argIndex: expressionIndex,
7452
- preserveStructure: context.preserveStructure
7718
+ templating: context.templating
7453
7719
  });
7454
7720
  elements.push({
7455
7721
  type: "expression",
@@ -7533,7 +7799,7 @@ function walkAndCollect(value, path, onValue) {
7533
7799
  //#endregion
7534
7800
  //#region src/components/logic-editor/utils/converters/index.ts
7535
7801
  function convertValue(value, context) {
7536
- if (context.preserveStructure && isDataStructure(value)) return convertStructure$1(value, context, convertValue);
7802
+ if (context.templating && isDataStructure(value)) return convertStructure$1(value, context, convertValue);
7537
7803
  if (!isPlainObject(value)) return convertPrimitive(value, context);
7538
7804
  const keys = Object.keys(value);
7539
7805
  if (keys.length !== 1) return convertInvalidObject(value, context);
@@ -7560,7 +7826,7 @@ function jsonLogicToNodes(expr, options = {}) {
7560
7826
  rootId: convertValue(expr, {
7561
7827
  nodes,
7562
7828
  edges,
7563
- preserveStructure: options.preserveStructure
7829
+ templating: options.templating
7564
7830
  })
7565
7831
  };
7566
7832
  }
@@ -7602,8 +7868,8 @@ function buildEvaluationResultsFromTrace(trace) {
7602
7868
  /**
7603
7869
  * Determine what kind of node to create based on expression
7604
7870
  */
7605
- function determineNodeType(expr, preserveStructure) {
7606
- if (preserveStructure && isDataStructure(expr)) return "structure";
7871
+ function determineNodeType(expr, templating) {
7872
+ if (templating && isDataStructure(expr)) return "structure";
7607
7873
  if (expr === null || typeof expr !== "object" || Array.isArray(expr)) return "literal";
7608
7874
  if (Object.keys(expr).length !== 1) return "literal";
7609
7875
  return "operator";
@@ -7998,7 +8264,7 @@ function createIfElseNodeFromTrace(nodeId, expression, children, context, parent
7998
8264
  branchType: "condition"
7999
8265
  });
8000
8266
  } else {
8001
- const nextUnused = determineNodeType(condition, context.preserveStructure) !== "literal" ? getNextUnusedChild(children, usedChildIndices) : null;
8267
+ const nextUnused = determineNodeType(condition, context.templating) !== "literal" ? getNextUnusedChild(children, usedChildIndices) : null;
8002
8268
  if (nextUnused) {
8003
8269
  usedChildIndices.add(nextUnused.index);
8004
8270
  conditionBranchId = processExpressionNode(nextUnused.child, context, {
@@ -8036,7 +8302,7 @@ function createIfElseNodeFromTrace(nodeId, expression, children, context, parent
8036
8302
  branchType: "yes"
8037
8303
  });
8038
8304
  } else {
8039
- const nextUnused = determineNodeType(thenValue, context.preserveStructure) !== "literal" ? getNextUnusedChild(children, usedChildIndices) : null;
8305
+ const nextUnused = determineNodeType(thenValue, context.templating) !== "literal" ? getNextUnusedChild(children, usedChildIndices) : null;
8040
8306
  if (nextUnused) {
8041
8307
  usedChildIndices.add(nextUnused.index);
8042
8308
  thenBranchId = processExpressionNode(nextUnused.child, context, {
@@ -8078,7 +8344,7 @@ function createIfElseNodeFromTrace(nodeId, expression, children, context, parent
8078
8344
  branchType: "no"
8079
8345
  });
8080
8346
  } else {
8081
- const nextUnused = determineNodeType(elseValue, context.preserveStructure) !== "literal" ? getNextUnusedChild(children, usedChildIndices) : null;
8347
+ const nextUnused = determineNodeType(elseValue, context.templating) !== "literal" ? getNextUnusedChild(children, usedChildIndices) : null;
8082
8348
  if (nextUnused) {
8083
8349
  usedChildIndices.add(nextUnused.index);
8084
8350
  elseBranchId = processExpressionNode(nextUnused.child, context, {
@@ -8163,7 +8429,7 @@ function createSwitchNodeFromTrace(nodeId, expression, children, context, parent
8163
8429
  branchType
8164
8430
  });
8165
8431
  } else {
8166
- const nextUnused = determineNodeType(value, context.preserveStructure) !== "literal" ? getNextUnusedChild(children, usedChildIndices) : null;
8432
+ const nextUnused = determineNodeType(value, context.templating) !== "literal" ? getNextUnusedChild(children, usedChildIndices) : null;
8167
8433
  if (nextUnused) {
8168
8434
  usedChildIndices.add(nextUnused.index);
8169
8435
  branchId = processExpressionNode(nextUnused.child, context, {
@@ -8309,11 +8575,11 @@ var EXPR_PLACEHOLDER = "{{EXPR}}";
8309
8575
  var EXPR_PLACEHOLDER_QUOTED = `"${EXPR_PLACEHOLDER}"`;
8310
8576
  /**
8311
8577
  * Check if a value should be treated as an expression branch in trace conversion
8312
- * This includes JSONLogic expressions and nested structures (when preserveStructure is enabled)
8578
+ * This includes JSONLogic expressions and nested structures (when templating is enabled)
8313
8579
  */
8314
- function isExpressionBranch(item, preserveStructure) {
8580
+ function isExpressionBranch(item, templating) {
8315
8581
  if (isJsonLogicExpression(item)) return true;
8316
- if (preserveStructure && isDataStructure(item)) return true;
8582
+ if (templating && isDataStructure(item)) return true;
8317
8583
  return false;
8318
8584
  }
8319
8585
  /**
@@ -8322,7 +8588,7 @@ function isExpressionBranch(item, preserveStructure) {
8322
8588
  function walkAndCollectFromTrace(value, path, onValue, context) {
8323
8589
  if (Array.isArray(value)) return value.map((item, index) => {
8324
8590
  const itemPath = [...path, String(index)];
8325
- if (isExpressionBranch(item, context.preserveStructure)) return onValue(itemPath, item);
8591
+ if (isExpressionBranch(item, context.templating)) return onValue(itemPath, item);
8326
8592
  else if (typeof item === "object" && item !== null) return walkAndCollectFromTrace(item, itemPath, onValue, context);
8327
8593
  return item;
8328
8594
  });
@@ -8330,7 +8596,7 @@ function walkAndCollectFromTrace(value, path, onValue, context) {
8330
8596
  const result = {};
8331
8597
  for (const [key, item] of Object.entries(value)) {
8332
8598
  const itemPath = [...path, key];
8333
- if (isExpressionBranch(item, context.preserveStructure)) result[key] = onValue(itemPath, item, key);
8599
+ if (isExpressionBranch(item, context.templating)) result[key] = onValue(itemPath, item, key);
8334
8600
  else if (typeof item === "object" && item !== null) result[key] = walkAndCollectFromTrace(item, itemPath, onValue, context);
8335
8601
  else result[key] = item;
8336
8602
  }
@@ -8435,7 +8701,7 @@ function traceToNodes(trace, options = {}) {
8435
8701
  nodes,
8436
8702
  edges,
8437
8703
  traceNodeMap,
8438
- preserveStructure: options.preserveStructure ?? false
8704
+ templating: options.templating ?? false
8439
8705
  }, {}, rootExpression);
8440
8706
  return {
8441
8707
  nodes,
@@ -8452,7 +8718,7 @@ function processExpressionNode(exprNode, context, parentInfo = {}, originalExpre
8452
8718
  const nodeId = traceIdToNodeId(exprNode.id);
8453
8719
  const expression = originalExpression ?? JSON.parse(exprNode.expression);
8454
8720
  context.traceNodeMap.set(nodeId, nodeId);
8455
- switch (determineNodeType(expression, context.preserveStructure)) {
8721
+ switch (determineNodeType(expression, context.templating)) {
8456
8722
  case "literal":
8457
8723
  createLiteralNodeFromTrace(nodeId, expression, exprNode.children, context, parentInfo);
8458
8724
  break;
@@ -8487,7 +8753,7 @@ function processExpressionNode(exprNode, context, parentInfo = {}, originalExpre
8487
8753
  * This properly handles all node types (operators, variables, structures, etc.)
8488
8754
  */
8489
8755
  function createFallbackNode(nodeId, value, context, parentInfo) {
8490
- switch (determineNodeType(value, context.preserveStructure)) {
8756
+ switch (determineNodeType(value, context.templating)) {
8491
8757
  case "literal":
8492
8758
  createLiteralNodeFromTrace(nodeId, value, [], context, parentInfo);
8493
8759
  break;
@@ -8517,7 +8783,7 @@ function createFallbackNode(nodeId, value, context, parentInfo) {
8517
8783
  }
8518
8784
  }
8519
8785
  //#endregion
8520
- //#region ../node_modules/.pnpm/@dagrejs+dagre@3.0.0/node_modules/@dagrejs/dagre/dist/dagre.esm.js
8786
+ //#region node_modules/@dagrejs/dagre/dist/dagre.esm.js
8521
8787
  var ge = Object.defineProperty;
8522
8788
  var hn = (e, n, t) => n in e ? ge(e, n, {
8523
8789
  enumerable: !0,
@@ -10699,7 +10965,7 @@ var MAX_RECURSION_DEPTH = 100;
10699
10965
  var emptyResults$1 = /* @__PURE__ */ new Map();
10700
10966
  var emptySteps = [];
10701
10967
  var emptyTraceNodeMap = /* @__PURE__ */ new Map();
10702
- function useLogicEditor({ value, evaluateWithTrace, data, preserveStructure = false }) {
10968
+ function useLogicEditor({ value, evaluateWithTrace, data, templating = false }) {
10703
10969
  const [nodes, setNodes] = useState([]);
10704
10970
  const [edges, setEdges] = useState([]);
10705
10971
  const [error, setError] = useState(null);
@@ -10710,12 +10976,12 @@ function useLogicEditor({ value, evaluateWithTrace, data, preserveStructure = fa
10710
10976
  const lastExternalValueRef = useRef("");
10711
10977
  const lastDataRef = useRef("");
10712
10978
  const lastHadTraceRef = useRef(false);
10713
- const lastPreserveStructureRef = useRef(false);
10979
+ const lastTemplatingRef = useRef(false);
10714
10980
  useEffect(() => {
10715
10981
  const valueStr = JSON.stringify(value);
10716
10982
  const dataStr = JSON.stringify(data);
10717
10983
  const hasTrace = !!evaluateWithTrace;
10718
- if (valueStr === lastExternalValueRef.current && dataStr === lastDataRef.current && hasTrace === lastHadTraceRef.current && preserveStructure === lastPreserveStructureRef.current) return;
10984
+ if (valueStr === lastExternalValueRef.current && dataStr === lastDataRef.current && hasTrace === lastHadTraceRef.current && templating === lastTemplatingRef.current) return;
10719
10985
  try {
10720
10986
  if (!checkDepth(value, MAX_RECURSION_DEPTH)) {
10721
10987
  setError(`Expression exceeds maximum nesting depth of ${MAX_RECURSION_DEPTH}`);
@@ -10728,13 +10994,13 @@ function useLogicEditor({ value, evaluateWithTrace, data, preserveStructure = fa
10728
10994
  lastExternalValueRef.current = valueStr;
10729
10995
  lastDataRef.current = dataStr;
10730
10996
  lastHadTraceRef.current = hasTrace;
10731
- lastPreserveStructureRef.current = preserveStructure;
10997
+ lastTemplatingRef.current = templating;
10732
10998
  return;
10733
10999
  }
10734
11000
  if (evaluateWithTrace && value) try {
10735
11001
  const trace = evaluateWithTrace(value, data ?? {});
10736
11002
  const { nodes: newNodes, edges: newEdges, traceNodeMap: newTraceNodeMap } = traceToNodes(trace, {
10737
- preserveStructure,
11003
+ templating,
10738
11004
  originalValue: value
10739
11005
  });
10740
11006
  const layoutedNodes = applyTreeLayout(newNodes, newEdges);
@@ -10749,12 +11015,12 @@ function useLogicEditor({ value, evaluateWithTrace, data, preserveStructure = fa
10749
11015
  lastExternalValueRef.current = valueStr;
10750
11016
  lastDataRef.current = dataStr;
10751
11017
  lastHadTraceRef.current = hasTrace;
10752
- lastPreserveStructureRef.current = preserveStructure;
11018
+ lastTemplatingRef.current = templating;
10753
11019
  return;
10754
11020
  } catch (traceErr) {
10755
11021
  console.warn("Trace conversion failed, falling back to JS:", traceErr);
10756
11022
  }
10757
- const { nodes: newNodes, edges: newEdges } = jsonLogicToNodes(value, { preserveStructure });
11023
+ const { nodes: newNodes, edges: newEdges } = jsonLogicToNodes(value, { templating });
10758
11024
  setNodes(applyTreeLayout(newNodes, newEdges));
10759
11025
  setEdges(newEdges);
10760
11026
  setEvaluationResults(emptyResults$1);
@@ -10774,12 +11040,12 @@ function useLogicEditor({ value, evaluateWithTrace, data, preserveStructure = fa
10774
11040
  lastExternalValueRef.current = valueStr;
10775
11041
  lastDataRef.current = dataStr;
10776
11042
  lastHadTraceRef.current = hasTrace;
10777
- lastPreserveStructureRef.current = preserveStructure;
11043
+ lastTemplatingRef.current = templating;
10778
11044
  }, [
10779
11045
  value,
10780
11046
  data,
10781
11047
  evaluateWithTrace,
10782
- preserveStructure
11048
+ templating
10783
11049
  ]);
10784
11050
  return useMemo(() => ({
10785
11051
  nodes,
@@ -11434,18 +11700,21 @@ var MAX_HISTORY_SIZE = 50;
11434
11700
  function useHistoryState(nodesRef, setInternalNodes, onNodesChange, clearSelection) {
11435
11701
  const undoStackRef = useRef([]);
11436
11702
  const redoStackRef = useRef([]);
11437
- const [historyVersion, setHistoryVersion] = useState(0);
11703
+ const [canUndo, setCanUndo] = useState(false);
11704
+ const [canRedo, setCanRedo] = useState(false);
11438
11705
  return {
11439
11706
  pushToUndoStack: useCallback((nodes) => {
11440
11707
  undoStackRef.current = [...undoStackRef.current.slice(-MAX_HISTORY_SIZE + 1), JSON.parse(JSON.stringify(nodes))];
11441
11708
  redoStackRef.current = [];
11442
- setHistoryVersion((v) => v + 1);
11709
+ setCanUndo(true);
11710
+ setCanRedo(false);
11443
11711
  }, []),
11444
11712
  undo: useCallback(() => {
11445
11713
  if (undoStackRef.current.length === 0) return;
11446
11714
  const previousState = undoStackRef.current.pop();
11447
11715
  redoStackRef.current.push(JSON.parse(JSON.stringify(nodesRef.current)));
11448
- setHistoryVersion((v) => v + 1);
11716
+ setCanUndo(undoStackRef.current.length > 0);
11717
+ setCanRedo(true);
11449
11718
  setInternalNodes(previousState);
11450
11719
  onNodesChange?.(previousState);
11451
11720
  clearSelection();
@@ -11459,7 +11728,8 @@ function useHistoryState(nodesRef, setInternalNodes, onNodesChange, clearSelecti
11459
11728
  if (redoStackRef.current.length === 0) return;
11460
11729
  const nextState = redoStackRef.current.pop();
11461
11730
  undoStackRef.current.push(JSON.parse(JSON.stringify(nodesRef.current)));
11462
- setHistoryVersion((v) => v + 1);
11731
+ setCanUndo(true);
11732
+ setCanRedo(redoStackRef.current.length > 0);
11463
11733
  setInternalNodes(nextState);
11464
11734
  onNodesChange?.(nextState);
11465
11735
  clearSelection();
@@ -11469,8 +11739,8 @@ function useHistoryState(nodesRef, setInternalNodes, onNodesChange, clearSelecti
11469
11739
  onNodesChange,
11470
11740
  clearSelection
11471
11741
  ]),
11472
- canUndo: useMemo(() => undoStackRef.current.length > 0, [historyVersion]),
11473
- canRedo: useMemo(() => redoStackRef.current.length > 0, [historyVersion])
11742
+ canUndo,
11743
+ canRedo
11474
11744
  };
11475
11745
  }
11476
11746
  //#endregion
@@ -11483,15 +11753,16 @@ function useHistoryState(nodesRef, setInternalNodes, onNodesChange, clearSelecti
11483
11753
  function useClipboardState(deps) {
11484
11754
  const { selectedNode, internalNodes, pushToUndoStack, setInternalNodes, onNodesChange, setSelectedNodeId, setPanelValues, hasEditedRef } = deps;
11485
11755
  const clipboardRef = useRef(null);
11486
- const [clipboardVersion, setClipboardVersion] = useState(0);
11756
+ const [canPaste, setCanPaste] = useState(false);
11487
11757
  return {
11488
11758
  copyNode: useCallback(() => {
11489
11759
  if (!selectedNode) return;
11760
+ const copiedNodes = [selectedNode, ...getDescendants(selectedNode.id, internalNodes)].map((n) => JSON.parse(JSON.stringify(n)));
11490
11761
  clipboardRef.current = {
11491
- nodes: [selectedNode, ...getDescendants(selectedNode.id, internalNodes)].map((n) => JSON.parse(JSON.stringify(n))),
11762
+ nodes: copiedNodes,
11492
11763
  rootId: selectedNode.id
11493
11764
  };
11494
- setClipboardVersion((v) => v + 1);
11765
+ setCanPaste(copiedNodes.length > 0);
11495
11766
  }, [selectedNode, internalNodes]),
11496
11767
  pasteNode: useCallback(() => {
11497
11768
  const clipboard = clipboardRef.current;
@@ -11545,7 +11816,7 @@ function useClipboardState(deps) {
11545
11816
  setPanelValues,
11546
11817
  hasEditedRef
11547
11818
  ]),
11548
- canPaste: useMemo(() => clipboardRef.current !== null && clipboardRef.current.nodes.length > 0, [clipboardVersion])
11819
+ canPaste
11549
11820
  };
11550
11821
  }
11551
11822
  //#endregion
@@ -13146,14 +13417,33 @@ function useNodeCollapse(nodeId) {
13146
13417
  }
13147
13418
  //#endregion
13148
13419
  //#region src/components/logic-editor/hooks/useWasmEvaluator.ts
13149
- /** Extract error message from unknown error types (Error objects, strings from WASM, etc.) */
13150
- function extractErrorMessage(err, fallback) {
13151
- if (err instanceof Error) return err.message;
13152
- if (typeof err === "string") return err;
13153
- return fallback;
13420
+ /** Error thrown from the WASM boundary that carries the parsed StructuredError. */
13421
+ var DataLogicEvaluationError = class extends Error {
13422
+ structured;
13423
+ constructor(structured) {
13424
+ super(structured.message || structured.type);
13425
+ this.name = "DataLogicEvaluationError";
13426
+ this.structured = structured;
13427
+ }
13428
+ };
13429
+ /**
13430
+ * Attempt to parse a WASM error message as a StructuredError JSON document.
13431
+ * The WASM boundary always produces JSON; non-JSON errors fall back to a
13432
+ * synthetic `Unknown` StructuredError so downstream code has a uniform shape.
13433
+ */
13434
+ function parseStructuredError(err, fallbackMessage) {
13435
+ const raw = err instanceof Error ? err.message : typeof err === "string" ? err : fallbackMessage;
13436
+ try {
13437
+ const parsed = JSON.parse(raw);
13438
+ if (parsed && typeof parsed === "object" && "type" in parsed && "message" in parsed) return parsed;
13439
+ } catch {}
13440
+ return {
13441
+ type: "Unknown",
13442
+ message: raw
13443
+ };
13154
13444
  }
13155
13445
  function useWasmEvaluator(options = {}) {
13156
- const { preserveStructure = false } = options;
13446
+ const { templating = false } = options;
13157
13447
  const [ready, setReady] = useState(false);
13158
13448
  const [loading, setLoading] = useState(true);
13159
13449
  const [error, setError] = useState(null);
@@ -13164,12 +13454,12 @@ function useWasmEvaluator(options = {}) {
13164
13454
  try {
13165
13455
  setLoading(true);
13166
13456
  setError(null);
13167
- const wasm = await import("./datalogic_wasm-daWVf40b.js");
13457
+ const wasm = await import("./datalogic_wasm-CF1jcNAu.js");
13168
13458
  await wasm.default();
13169
13459
  if (!cancelled) {
13170
13460
  moduleRef.current = {
13171
13461
  evaluate: wasm.evaluate,
13172
- evaluate_with_trace: wasm.evaluate_with_trace,
13462
+ evaluateWithTrace: wasm.evaluateWithTrace,
13173
13463
  CompiledRule: wasm.CompiledRule
13174
13464
  };
13175
13465
  setReady(true);
@@ -13193,27 +13483,27 @@ function useWasmEvaluator(options = {}) {
13193
13483
  error,
13194
13484
  evaluate: useCallback((logic, data) => {
13195
13485
  if (!moduleRef.current) throw new Error("WASM module not initialized");
13486
+ const logicStr = JSON.stringify(logic);
13487
+ const dataStr = JSON.stringify(data);
13196
13488
  try {
13197
- const logicStr = JSON.stringify(logic);
13198
- const dataStr = JSON.stringify(data);
13199
- const resultStr = moduleRef.current.evaluate(logicStr, dataStr, preserveStructure);
13489
+ const resultStr = moduleRef.current.evaluate(logicStr, dataStr, templating);
13200
13490
  return JSON.parse(resultStr);
13201
13491
  } catch (err) {
13202
- throw new Error(extractErrorMessage(err, "Evaluation failed"), { cause: err });
13492
+ throw new DataLogicEvaluationError(parseStructuredError(err, "Evaluation failed"));
13203
13493
  }
13204
- }, [preserveStructure]),
13494
+ }, [templating]),
13205
13495
  evaluateWithTrace: useCallback((logic, data) => {
13206
13496
  if (!moduleRef.current) throw new Error("WASM module not initialized");
13207
- if (!moduleRef.current.evaluate_with_trace) throw new Error("evaluate_with_trace not available in WASM module");
13497
+ if (!moduleRef.current.evaluateWithTrace) throw new Error("evaluateWithTrace not available in WASM module");
13498
+ const logicStr = JSON.stringify(logic);
13499
+ const dataStr = JSON.stringify(data);
13208
13500
  try {
13209
- const logicStr = JSON.stringify(logic);
13210
- const dataStr = JSON.stringify(data);
13211
- const resultStr = moduleRef.current.evaluate_with_trace(logicStr, dataStr, preserveStructure);
13501
+ const resultStr = moduleRef.current.evaluateWithTrace(logicStr, dataStr, templating);
13212
13502
  return JSON.parse(resultStr);
13213
13503
  } catch (err) {
13214
- throw new Error(extractErrorMessage(err, "Trace evaluation failed"), { cause: err });
13504
+ throw new DataLogicEvaluationError(parseStructuredError(err, "Trace evaluation failed"));
13215
13505
  }
13216
- }, [preserveStructure])
13506
+ }, [templating])
13217
13507
  };
13218
13508
  }
13219
13509
  //#endregion
@@ -15362,6 +15652,136 @@ function convertStructure(data, nodeMap) {
15362
15652
  return obj;
15363
15653
  }
15364
15654
  //#endregion
15655
+ //#region src/components/Tooltip.tsx
15656
+ var OFFSET = 8;
15657
+ /**
15658
+ * Lightweight tooltip primitive.
15659
+ *
15660
+ * Wraps its children in a layout-neutral `<span>` that catches hover/focus
15661
+ * events, then renders the tooltip itself into a portal at `document.body`
15662
+ * with `position: fixed` — so it's immune to `overflow: hidden` or stacking-
15663
+ * context clipping from any ancestor (e.g. `.logic-editor`'s rounded clip).
15664
+ *
15665
+ * Hides on coarse-pointer / no-hover devices via CSS.
15666
+ */
15667
+ function Tooltip({ label, shortcut, side = "bottom", delay = 300, children }) {
15668
+ const [visible, setVisible] = useState(false);
15669
+ const [position, setPosition] = useState(null);
15670
+ const triggerRef = useRef(null);
15671
+ const tooltipRef = useRef(null);
15672
+ const showTimerRef = useRef(null);
15673
+ const computePosition = useCallback(() => {
15674
+ const trigger = triggerRef.current;
15675
+ const tooltip = tooltipRef.current;
15676
+ if (!trigger) return null;
15677
+ const triggerRect = trigger.getBoundingClientRect();
15678
+ const tooltipRect = tooltip?.getBoundingClientRect();
15679
+ const w = tooltipRect?.width ?? 0;
15680
+ const h = tooltipRect?.height ?? 0;
15681
+ const compute = (s) => {
15682
+ switch (s) {
15683
+ case "top": return {
15684
+ top: triggerRect.top - h - OFFSET,
15685
+ left: triggerRect.left + triggerRect.width / 2 - w / 2
15686
+ };
15687
+ case "bottom": return {
15688
+ top: triggerRect.bottom + OFFSET,
15689
+ left: triggerRect.left + triggerRect.width / 2 - w / 2
15690
+ };
15691
+ case "left": return {
15692
+ top: triggerRect.top + triggerRect.height / 2 - h / 2,
15693
+ left: triggerRect.left - w - OFFSET
15694
+ };
15695
+ case "right": return {
15696
+ top: triggerRect.top + triggerRect.height / 2 - h / 2,
15697
+ left: triggerRect.right + OFFSET
15698
+ };
15699
+ }
15700
+ };
15701
+ let chosen = side;
15702
+ let { top, left } = compute(side);
15703
+ const margin = 4;
15704
+ if (side === "bottom" && top + h > window.innerHeight - margin) {
15705
+ chosen = "top";
15706
+ ({top, left} = compute("top"));
15707
+ } else if (side === "top" && top < margin) {
15708
+ chosen = "bottom";
15709
+ ({top, left} = compute("bottom"));
15710
+ } else if (side === "right" && left + w > window.innerWidth - margin) {
15711
+ chosen = "left";
15712
+ ({top, left} = compute("left"));
15713
+ } else if (side === "left" && left < margin) {
15714
+ chosen = "right";
15715
+ ({top, left} = compute("right"));
15716
+ }
15717
+ left = Math.max(margin, Math.min(left, window.innerWidth - w - margin));
15718
+ top = Math.max(margin, Math.min(top, window.innerHeight - h - margin));
15719
+ return {
15720
+ top,
15721
+ left,
15722
+ side: chosen
15723
+ };
15724
+ }, [side]);
15725
+ const show = useCallback(() => {
15726
+ if (showTimerRef.current) clearTimeout(showTimerRef.current);
15727
+ showTimerRef.current = setTimeout(() => {
15728
+ setVisible(true);
15729
+ }, delay);
15730
+ }, [delay]);
15731
+ const hide = useCallback(() => {
15732
+ if (showTimerRef.current) {
15733
+ clearTimeout(showTimerRef.current);
15734
+ showTimerRef.current = null;
15735
+ }
15736
+ setVisible(false);
15737
+ setPosition(null);
15738
+ }, []);
15739
+ useEffect(() => {
15740
+ return () => {
15741
+ if (showTimerRef.current) clearTimeout(showTimerRef.current);
15742
+ };
15743
+ }, []);
15744
+ useLayoutEffect(() => {
15745
+ if (!visible) return;
15746
+ setPosition(computePosition());
15747
+ const handleReposition = () => setPosition(computePosition());
15748
+ window.addEventListener("scroll", handleReposition, true);
15749
+ window.addEventListener("resize", handleReposition);
15750
+ return () => {
15751
+ window.removeEventListener("scroll", handleReposition, true);
15752
+ window.removeEventListener("resize", handleReposition);
15753
+ };
15754
+ }, [visible, computePosition]);
15755
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
15756
+ ref: triggerRef,
15757
+ className: "dl-tooltip-wrap",
15758
+ onMouseEnter: show,
15759
+ onMouseLeave: hide,
15760
+ onFocus: show,
15761
+ onBlur: hide,
15762
+ "aria-label": label,
15763
+ children
15764
+ }), visible && typeof document !== "undefined" && createPortal(/* @__PURE__ */ jsxs("div", {
15765
+ ref: tooltipRef,
15766
+ role: "tooltip",
15767
+ className: "dl-tooltip",
15768
+ "data-side": position?.side ?? side,
15769
+ style: {
15770
+ position: "fixed",
15771
+ top: position?.top ?? -9999,
15772
+ left: position?.left ?? -9999,
15773
+ opacity: position ? 1 : 0
15774
+ },
15775
+ children: [/* @__PURE__ */ jsx("span", {
15776
+ className: "dl-tooltip-label",
15777
+ children: label
15778
+ }), shortcut ? /* @__PURE__ */ jsx("span", {
15779
+ className: "dl-tooltip-shortcut",
15780
+ children: shortcut
15781
+ }) : null]
15782
+ }), document.body)] });
15783
+ }
15784
+ //#endregion
15365
15785
  //#region src/components/logic-editor/debugger-controls/DebuggerControls.tsx
15366
15786
  function DebuggerControlsInline() {
15367
15787
  return /* @__PURE__ */ jsx(DebuggerControlsBase, { variant: "inline" });
@@ -15431,39 +15851,59 @@ function DebuggerControlsBase({ variant = "floating" }) {
15431
15851
  /* @__PURE__ */ jsxs("div", {
15432
15852
  className: "dl-debugger-buttons",
15433
15853
  children: [
15434
- /* @__PURE__ */ jsx("button", {
15435
- className: "dl-debugger-btn",
15436
- onClick: reset,
15437
- disabled: isAtStart,
15438
- title: "Reset to start (Home)",
15439
- children: /* @__PURE__ */ jsx(SkipBack, { size: 16 })
15854
+ /* @__PURE__ */ jsx(Tooltip, {
15855
+ label: "Reset",
15856
+ shortcut: "Home",
15857
+ side: "top",
15858
+ children: /* @__PURE__ */ jsx("button", {
15859
+ className: "dl-debugger-btn",
15860
+ onClick: reset,
15861
+ disabled: isAtStart,
15862
+ children: /* @__PURE__ */ jsx(SkipBack, { size: 16 })
15863
+ })
15440
15864
  }),
15441
- /* @__PURE__ */ jsx("button", {
15442
- className: "dl-debugger-btn",
15443
- onClick: stepBackward,
15444
- disabled: isAtStart,
15445
- title: "Step backward (Left Arrow)",
15446
- children: /* @__PURE__ */ jsx(ChevronLeft, { size: 18 })
15865
+ /* @__PURE__ */ jsx(Tooltip, {
15866
+ label: "Step back",
15867
+ shortcut: "←",
15868
+ side: "top",
15869
+ children: /* @__PURE__ */ jsx("button", {
15870
+ className: "dl-debugger-btn",
15871
+ onClick: stepBackward,
15872
+ disabled: isAtStart,
15873
+ children: /* @__PURE__ */ jsx(ChevronLeft, { size: 18 })
15874
+ })
15447
15875
  }),
15448
- /* @__PURE__ */ jsx("button", {
15449
- className: "dl-debugger-btn dl-debugger-btn-primary",
15450
- onClick: isPlaying ? pause : play,
15451
- title: isPlaying ? "Pause (Space)" : "Play (Space)",
15452
- children: isPlaying ? /* @__PURE__ */ jsx(Pause, { size: 18 }) : /* @__PURE__ */ jsx(Play, { size: 18 })
15876
+ /* @__PURE__ */ jsx(Tooltip, {
15877
+ label: isPlaying ? "Pause" : "Play",
15878
+ shortcut: "Space",
15879
+ side: "top",
15880
+ children: /* @__PURE__ */ jsx("button", {
15881
+ className: "dl-debugger-btn dl-debugger-btn-primary",
15882
+ onClick: isPlaying ? pause : play,
15883
+ children: isPlaying ? /* @__PURE__ */ jsx(Pause, { size: 18 }) : /* @__PURE__ */ jsx(Play, { size: 18 })
15884
+ })
15453
15885
  }),
15454
- /* @__PURE__ */ jsx("button", {
15455
- className: "dl-debugger-btn",
15456
- onClick: stepForward,
15457
- disabled: isAtEnd,
15458
- title: "Step forward (Right Arrow)",
15459
- children: /* @__PURE__ */ jsx(ChevronRight, { size: 18 })
15886
+ /* @__PURE__ */ jsx(Tooltip, {
15887
+ label: "Step forward",
15888
+ shortcut: "→",
15889
+ side: "top",
15890
+ children: /* @__PURE__ */ jsx("button", {
15891
+ className: "dl-debugger-btn",
15892
+ onClick: stepForward,
15893
+ disabled: isAtEnd,
15894
+ children: /* @__PURE__ */ jsx(ChevronRight, { size: 18 })
15895
+ })
15460
15896
  }),
15461
- /* @__PURE__ */ jsx("button", {
15462
- className: "dl-debugger-btn",
15463
- onClick: () => goToStep(totalSteps - 1),
15464
- disabled: isAtEnd,
15465
- title: "Jump to end (End)",
15466
- children: /* @__PURE__ */ jsx(SkipForward, { size: 16 })
15897
+ /* @__PURE__ */ jsx(Tooltip, {
15898
+ label: "Jump to end",
15899
+ shortcut: "End",
15900
+ side: "top",
15901
+ children: /* @__PURE__ */ jsx("button", {
15902
+ className: "dl-debugger-btn",
15903
+ onClick: () => goToStep(totalSteps - 1),
15904
+ disabled: isAtEnd,
15905
+ children: /* @__PURE__ */ jsx(SkipForward, { size: 16 })
15906
+ })
15467
15907
  })
15468
15908
  ]
15469
15909
  }),
@@ -17040,7 +17480,7 @@ var PropertiesPanel = memo(function PropertiesPanel({ width = 280 }) {
17040
17480
  if (selectedNode && Object.keys(panelValues).length > 0) applyTimerRef.current = setTimeout(() => {
17041
17481
  applyPanelChanges();
17042
17482
  applyTimerRef.current = null;
17043
- }, 500);
17483
+ }, 200);
17044
17484
  return () => {
17045
17485
  if (applyTimerRef.current) clearTimeout(applyTimerRef.current);
17046
17486
  };
@@ -17281,25 +17721,31 @@ function AutoFitView({ nodeCount }) {
17281
17721
  var UndoRedoToolbar = memo(function UndoRedoToolbar() {
17282
17722
  const { undo, redo, canUndo, canRedo } = useEditorContext();
17283
17723
  if (!canUndo && !canRedo) return null;
17284
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("button", {
17285
- type: "button",
17286
- className: "dl-toolbar-btn",
17287
- onClick: undo,
17288
- disabled: !canUndo,
17289
- title: "Undo (Cmd/Ctrl+Z)",
17290
- children: /* @__PURE__ */ jsx(Undo2, { size: 15 })
17291
- }), /* @__PURE__ */ jsx("button", {
17292
- type: "button",
17293
- className: "dl-toolbar-btn",
17294
- onClick: redo,
17295
- disabled: !canRedo,
17296
- title: "Redo (Cmd/Ctrl+Shift+Z)",
17297
- children: /* @__PURE__ */ jsx(Redo2, { size: 15 })
17724
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Tooltip, {
17725
+ label: "Undo",
17726
+ shortcut: "⌘Z",
17727
+ children: /* @__PURE__ */ jsx("button", {
17728
+ type: "button",
17729
+ className: "dl-toolbar-btn",
17730
+ onClick: undo,
17731
+ disabled: !canUndo,
17732
+ children: /* @__PURE__ */ jsx(Undo2, { size: 15 })
17733
+ })
17734
+ }), /* @__PURE__ */ jsx(Tooltip, {
17735
+ label: "Redo",
17736
+ shortcut: "⌘⇧Z",
17737
+ children: /* @__PURE__ */ jsx("button", {
17738
+ type: "button",
17739
+ className: "dl-toolbar-btn",
17740
+ onClick: redo,
17741
+ disabled: !canRedo,
17742
+ children: /* @__PURE__ */ jsx(Redo2, { size: 15 })
17743
+ })
17298
17744
  })] });
17299
17745
  });
17300
17746
  //#endregion
17301
17747
  //#region src/components/logic-editor/EditorToolbar.tsx
17302
- var EditorToolbar = memo(function EditorToolbar({ isEditMode, hasDebugger, preserveStructure, onPreserveStructureChange }) {
17748
+ var EditorToolbar = memo(function EditorToolbar({ isEditMode, hasDebugger, templating, onTemplatingChange }) {
17303
17749
  return /* @__PURE__ */ jsxs("div", {
17304
17750
  className: "logic-editor-toolbar",
17305
17751
  children: [
@@ -17307,13 +17753,17 @@ var EditorToolbar = memo(function EditorToolbar({ isEditMode, hasDebugger, prese
17307
17753
  /* @__PURE__ */ jsx("div", { className: "logic-editor-toolbar-spacer" }),
17308
17754
  hasDebugger && /* @__PURE__ */ jsx(DebuggerControlsInline, {}),
17309
17755
  /* @__PURE__ */ jsx("div", { className: "logic-editor-toolbar-spacer" }),
17310
- onPreserveStructureChange && /* @__PURE__ */ jsxs("label", {
17311
- className: "dl-preserve-structure-toggle",
17312
- children: [/* @__PURE__ */ jsx("input", {
17313
- type: "checkbox",
17314
- checked: preserveStructure,
17315
- onChange: (e) => onPreserveStructureChange(e.target.checked)
17316
- }), /* @__PURE__ */ jsx("span", { children: "Preserve Structure" })]
17756
+ onTemplatingChange && /* @__PURE__ */ jsx(Tooltip, {
17757
+ label: "Compile multi-key objects as output templates with embedded JSONLogic",
17758
+ side: "bottom",
17759
+ children: /* @__PURE__ */ jsxs("label", {
17760
+ className: "dl-templating-toggle",
17761
+ children: [/* @__PURE__ */ jsx("input", {
17762
+ type: "checkbox",
17763
+ checked: templating,
17764
+ onChange: (e) => onTemplatingChange(e.target.checked)
17765
+ }), /* @__PURE__ */ jsx("span", { children: "Templating" })]
17766
+ })
17317
17767
  })
17318
17768
  ]
17319
17769
  });
@@ -17321,11 +17771,43 @@ var EditorToolbar = memo(function EditorToolbar({ isEditMode, hasDebugger, prese
17321
17771
  //#endregion
17322
17772
  //#region src/components/logic-editor/DataLogicEditor.tsx
17323
17773
  var emptyResults = /* @__PURE__ */ new Map();
17774
+ function EmptyState({ exampleSuggestions, onSelectExample }) {
17775
+ const chips = exampleSuggestions && onSelectExample ? exampleSuggestions : [];
17776
+ return /* @__PURE__ */ jsxs("div", {
17777
+ className: "logic-editor-empty",
17778
+ children: [
17779
+ /* @__PURE__ */ jsx("div", {
17780
+ className: "logic-editor-empty-icon",
17781
+ children: /* @__PURE__ */ jsx(Workflow, {
17782
+ size: 28,
17783
+ strokeWidth: 1.5
17784
+ })
17785
+ }),
17786
+ /* @__PURE__ */ jsx("p", { children: "No expression" }),
17787
+ /* @__PURE__ */ jsx("p", {
17788
+ className: "logic-editor-empty-hint",
17789
+ children: "Enter valid JSONLogic in the input panel to visualize it."
17790
+ }),
17791
+ chips.length > 0 && /* @__PURE__ */ jsxs("div", {
17792
+ className: "logic-editor-empty-chips",
17793
+ children: [/* @__PURE__ */ jsx("span", {
17794
+ className: "logic-editor-empty-chips-label",
17795
+ children: "Try"
17796
+ }), chips.map((name) => /* @__PURE__ */ jsx("button", {
17797
+ type: "button",
17798
+ className: "logic-editor-empty-chip",
17799
+ onClick: () => onSelectExample?.(name),
17800
+ children: name
17801
+ }, name))]
17802
+ })
17803
+ ]
17804
+ });
17805
+ }
17324
17806
  /**
17325
17807
  * Read-only inner component - minimal, no EditorContext dependency.
17326
17808
  * Used when editable=false to avoid EditorProvider's state sync effects.
17327
17809
  */
17328
- function ReadOnlyEditorInner({ initialNodes, initialEdges, theme, showDebugger }) {
17810
+ function ReadOnlyEditorInner({ initialNodes, initialEdges, theme, showDebugger, exampleSuggestions, onSelectExample }) {
17329
17811
  const bgColor = theme === "dark" ? "#404040" : "#cccccc";
17330
17812
  const [nodes, , onNodesChange] = useNodesState(initialNodes);
17331
17813
  const [, , onEdgesChange] = useEdgesState(initialEdges);
@@ -17370,12 +17852,9 @@ function ReadOnlyEditorInner({ initialNodes, initialEdges, theme, showDebugger }
17370
17852
  showDebugger && /* @__PURE__ */ jsx(DebuggerControls, {}),
17371
17853
  /* @__PURE__ */ jsx(AutoFitView, { nodeCount: initialNodes.length })
17372
17854
  ]
17373
- }) }), visibleNodes.length === 0 && /* @__PURE__ */ jsxs("div", {
17374
- className: "logic-editor-empty",
17375
- children: [/* @__PURE__ */ jsx("p", { children: "No expression" }), /* @__PURE__ */ jsx("p", {
17376
- className: "logic-editor-empty-hint",
17377
- children: "Enter valid JSONLogic in the input panel to visualize it"
17378
- })]
17855
+ }) }), visibleNodes.length === 0 && /* @__PURE__ */ jsx(EmptyState, {
17856
+ exampleSuggestions,
17857
+ onSelectExample
17379
17858
  })]
17380
17859
  })
17381
17860
  });
@@ -17384,7 +17863,7 @@ function ReadOnlyEditorInner({ initialNodes, initialEdges, theme, showDebugger }
17384
17863
  * Editable inner component - full EditorContext support with syncing.
17385
17864
  * Used when editable=true.
17386
17865
  */
17387
- function EditableEditorInner({ initialNodes, initialEdges, evaluationResults, theme, showDebugger }) {
17866
+ function EditableEditorInner({ initialNodes, initialEdges, evaluationResults, theme, showDebugger, exampleSuggestions, onSelectExample }) {
17388
17867
  const bgColor = theme === "dark" ? "#404040" : "#cccccc";
17389
17868
  const { contextMenu, handleNodeContextMenu, handlePaneContextMenu, handleNodeDoubleClick, handleCloseContextMenu, handleEditProperties, contextMenuNode } = useContextMenu(true);
17390
17869
  const { nodes: editorNodes } = useEditorContext();
@@ -17462,28 +17941,25 @@ function EditableEditorInner({ initialNodes, initialEdges, evaluationResults, th
17462
17941
  onClose: handleCloseContextMenu
17463
17942
  })
17464
17943
  ]
17465
- }) }), visibleNodes.length === 0 && /* @__PURE__ */ jsxs("div", {
17466
- className: "logic-editor-empty",
17467
- children: [/* @__PURE__ */ jsx("p", { children: "No expression" }), /* @__PURE__ */ jsx("p", {
17468
- className: "logic-editor-empty-hint",
17469
- children: "Enter valid JSONLogic in the input panel to visualize it"
17470
- })]
17944
+ }) }), visibleNodes.length === 0 && /* @__PURE__ */ jsx(EmptyState, {
17945
+ exampleSuggestions,
17946
+ onSelectExample
17471
17947
  })]
17472
17948
  })
17473
17949
  });
17474
17950
  }
17475
- function DataLogicEditor({ value, onChange, data, theme: themeProp, className = "", preserveStructure = false, onPreserveStructureChange, editable = false }) {
17951
+ function DataLogicEditor({ value, onChange, data, theme: themeProp, className = "", templating = false, onTemplatingChange, editable = false, exampleSuggestions, onSelectExample }) {
17476
17952
  const onChangeTimerRef = useRef(null);
17477
17953
  const isEditMode = editable;
17478
17954
  const systemTheme = useSystemTheme();
17479
17955
  const resolvedTheme = themeProp ?? systemTheme;
17480
- const { ready: wasmReady, evaluateWithTrace } = useWasmEvaluator({ preserveStructure });
17956
+ const { ready: wasmReady, evaluateWithTrace } = useWasmEvaluator({ templating });
17481
17957
  const evalEnabled = data !== void 0;
17482
17958
  const editor = useLogicEditor({
17483
17959
  value,
17484
17960
  evaluateWithTrace: evalEnabled && wasmReady ? evaluateWithTrace : void 0,
17485
17961
  data: evalEnabled ? data : void 0,
17486
- preserveStructure
17962
+ templating
17487
17963
  });
17488
17964
  const expressionKey = `${editor.nodes.length}-${editor.edges.length}-${editor.nodes[0]?.id ?? "empty"}`;
17489
17965
  const hasDebugger = evalEnabled && editor.usingTraceMode && editor.steps.length > 0;
@@ -17520,7 +17996,9 @@ function DataLogicEditor({ value, onChange, data, theme: themeProp, className =
17520
17996
  initialNodes: editor.nodes,
17521
17997
  initialEdges: editor.edges,
17522
17998
  theme: resolvedTheme,
17523
- showDebugger: false
17999
+ showDebugger: false,
18000
+ exampleSuggestions,
18001
+ onSelectExample
17524
18002
  }, expressionKey);
17525
18003
  return /* @__PURE__ */ jsx("div", {
17526
18004
  className: editorClassName,
@@ -17532,8 +18010,8 @@ function DataLogicEditor({ value, onChange, data, theme: themeProp, className =
17532
18010
  children: [/* @__PURE__ */ jsx(EditorToolbar, {
17533
18011
  isEditMode: false,
17534
18012
  hasDebugger,
17535
- preserveStructure,
17536
- onPreserveStructureChange
18013
+ templating,
18014
+ onTemplatingChange
17537
18015
  }), /* @__PURE__ */ jsx("div", {
17538
18016
  className: "logic-editor-body",
17539
18017
  children: /* @__PURE__ */ jsx("div", {
@@ -17544,8 +18022,8 @@ function DataLogicEditor({ value, onChange, data, theme: themeProp, className =
17544
18022
  }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(EditorToolbar, {
17545
18023
  isEditMode: false,
17546
18024
  hasDebugger,
17547
- preserveStructure,
17548
- onPreserveStructureChange
18025
+ templating,
18026
+ onTemplatingChange
17549
18027
  }), /* @__PURE__ */ jsx("div", {
17550
18028
  className: "logic-editor-body",
17551
18029
  children: /* @__PURE__ */ jsx("div", {
@@ -17560,7 +18038,9 @@ function DataLogicEditor({ value, onChange, data, theme: themeProp, className =
17560
18038
  initialEdges: editor.edges,
17561
18039
  evaluationResults: emptyResults,
17562
18040
  theme: resolvedTheme,
17563
- showDebugger: false
18041
+ showDebugger: false,
18042
+ exampleSuggestions,
18043
+ onSelectExample
17564
18044
  }, expressionKey);
17565
18045
  return /* @__PURE__ */ jsxs(EditorProvider, {
17566
18046
  nodes: editor.nodes,
@@ -17576,8 +18056,8 @@ function DataLogicEditor({ value, onChange, data, theme: themeProp, className =
17576
18056
  children: [/* @__PURE__ */ jsx(EditorToolbar, {
17577
18057
  isEditMode,
17578
18058
  hasDebugger,
17579
- preserveStructure,
17580
- onPreserveStructureChange
18059
+ templating,
18060
+ onTemplatingChange
17581
18061
  }), /* @__PURE__ */ jsxs("div", {
17582
18062
  className: "logic-editor-body",
17583
18063
  children: [/* @__PURE__ */ jsx("div", {
@@ -17588,8 +18068,8 @@ function DataLogicEditor({ value, onChange, data, theme: themeProp, className =
17588
18068
  }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(EditorToolbar, {
17589
18069
  isEditMode,
17590
18070
  hasDebugger,
17591
- preserveStructure,
17592
- onPreserveStructureChange
18071
+ templating,
18072
+ onTemplatingChange
17593
18073
  }), /* @__PURE__ */ jsxs("div", {
17594
18074
  className: "logic-editor-body",
17595
18075
  children: [/* @__PURE__ */ jsx("div", {