@goplasmatic/datalogic-ui 5.2.0 → 5.4.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 (186) hide show
  1. package/README.md +163 -32
  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 +8 -1
  5. package/dist/components/logic-editor/EditorToolbar.d.ts.map +1 -1
  6. package/dist/components/logic-editor/KeyboardHandler.d.ts.map +1 -1
  7. package/dist/components/logic-editor/config/arity.d.ts +3 -0
  8. package/dist/components/logic-editor/config/arity.d.ts.map +1 -0
  9. package/dist/components/logic-editor/config/categories.d.ts +7 -2
  10. package/dist/components/logic-editor/config/categories.d.ts.map +1 -1
  11. package/dist/components/logic-editor/config/docs.d.ts +11 -0
  12. package/dist/components/logic-editor/config/docs.d.ts.map +1 -0
  13. package/dist/components/logic-editor/config/literalPanel.d.ts +4 -0
  14. package/dist/components/logic-editor/config/literalPanel.d.ts.map +1 -1
  15. package/dist/components/logic-editor/config/operators/arithmetic-basic.d.ts.map +1 -1
  16. package/dist/components/logic-editor/config/operators/arithmetic-functions.d.ts.map +1 -1
  17. package/dist/components/logic-editor/config/operators/array-iteration.d.ts.map +1 -1
  18. package/dist/components/logic-editor/config/operators/array-manipulation.d.ts.map +1 -1
  19. package/dist/components/logic-editor/config/operators/array.d.ts +1 -1
  20. package/dist/components/logic-editor/config/operators/control.d.ts.map +1 -1
  21. package/dist/components/logic-editor/config/operators/datetime.d.ts.map +1 -1
  22. package/dist/components/logic-editor/config/operators/error.d.ts.map +1 -1
  23. package/dist/components/logic-editor/config/operators/flagd.d.ts +3 -0
  24. package/dist/components/logic-editor/config/operators/flagd.d.ts.map +1 -0
  25. package/dist/components/logic-editor/config/operators/index.d.ts +2 -1
  26. package/dist/components/logic-editor/config/operators/index.d.ts.map +1 -1
  27. package/dist/components/logic-editor/config/operators/logical.d.ts.map +1 -1
  28. package/dist/components/logic-editor/config/operators/string-core.d.ts.map +1 -1
  29. package/dist/components/logic-editor/config/operators/string-transform.d.ts.map +1 -1
  30. package/dist/components/logic-editor/config/operators/utility.d.ts.map +1 -1
  31. package/dist/components/logic-editor/config/operators/validation.d.ts.map +1 -1
  32. package/dist/components/logic-editor/config/operators/variable.d.ts.map +1 -1
  33. package/dist/components/logic-editor/config/operators.types.d.ts +13 -11
  34. package/dist/components/logic-editor/config/operators.types.d.ts.map +1 -1
  35. package/dist/components/logic-editor/constants/colors.d.ts.map +1 -1
  36. package/dist/components/logic-editor/context/debugger/DebuggerProvider.d.ts +6 -1
  37. package/dist/components/logic-editor/context/debugger/DebuggerProvider.d.ts.map +1 -1
  38. package/dist/components/logic-editor/context/debugger/hooks.d.ts +3 -1
  39. package/dist/components/logic-editor/context/debugger/hooks.d.ts.map +1 -1
  40. package/dist/components/logic-editor/context/debugger/types.d.ts +18 -0
  41. package/dist/components/logic-editor/context/debugger/types.d.ts.map +1 -1
  42. package/dist/components/logic-editor/context/editor/EditorContext.d.ts.map +1 -1
  43. package/dist/components/logic-editor/context/editor/useNodeCreation.d.ts.map +1 -1
  44. package/dist/components/logic-editor/context/editor/useNodeEdgeInsert.d.ts +16 -0
  45. package/dist/components/logic-editor/context/editor/useNodeEdgeInsert.d.ts.map +1 -1
  46. package/dist/components/logic-editor/context/editor/useNodeOperations.d.ts.map +1 -1
  47. package/dist/components/logic-editor/context/index.d.ts +0 -1
  48. package/dist/components/logic-editor/context/index.d.ts.map +1 -1
  49. package/dist/components/logic-editor/context-menu/CanvasContextMenu.d.ts +1 -1
  50. package/dist/components/logic-editor/context-menu/CanvasContextMenu.d.ts.map +1 -1
  51. package/dist/components/logic-editor/context-menu/index.d.ts +0 -1
  52. package/dist/components/logic-editor/context-menu/index.d.ts.map +1 -1
  53. package/dist/components/logic-editor/context-menu/menu-helpers.d.ts +2 -1
  54. package/dist/components/logic-editor/context-menu/menu-helpers.d.ts.map +1 -1
  55. package/dist/components/logic-editor/context-menu/useContextMenuItems.d.ts.map +1 -1
  56. package/dist/components/logic-editor/debugger-controls/DebuggerControls.d.ts.map +1 -1
  57. package/dist/components/logic-editor/debugger-controls/StepTimeline.d.ts +14 -0
  58. package/dist/components/logic-editor/debugger-controls/StepTimeline.d.ts.map +1 -0
  59. package/dist/components/logic-editor/debugger-controls/index.d.ts +2 -0
  60. package/dist/components/logic-editor/debugger-controls/index.d.ts.map +1 -1
  61. package/dist/components/logic-editor/debugger-controls/keyboard-guard.d.ts +6 -0
  62. package/dist/components/logic-editor/debugger-controls/keyboard-guard.d.ts.map +1 -0
  63. package/dist/components/logic-editor/edges/EdgeOperatorPicker.d.ts.map +1 -1
  64. package/dist/components/logic-editor/hooks/index.d.ts +2 -3
  65. package/dist/components/logic-editor/hooks/index.d.ts.map +1 -1
  66. package/dist/components/logic-editor/hooks/useDebugClassName.d.ts +2 -0
  67. package/dist/components/logic-editor/hooks/useDebugClassName.d.ts.map +1 -1
  68. package/dist/components/logic-editor/hooks/useLogicEditor.d.ts +15 -8
  69. package/dist/components/logic-editor/hooks/useLogicEditor.d.ts.map +1 -1
  70. package/dist/components/logic-editor/hooks/useWasmEvaluator.d.ts +72 -4
  71. package/dist/components/logic-editor/hooks/useWasmEvaluator.d.ts.map +1 -1
  72. package/dist/components/logic-editor/index.d.ts +3 -4
  73. package/dist/components/logic-editor/index.d.ts.map +1 -1
  74. package/dist/components/logic-editor/nodes/DebugInfoBubble.d.ts +9 -2
  75. package/dist/components/logic-editor/nodes/DebugInfoBubble.d.ts.map +1 -1
  76. package/dist/components/logic-editor/nodes/shared/NodeDebugBubble.d.ts +2 -1
  77. package/dist/components/logic-editor/nodes/shared/NodeDebugBubble.d.ts.map +1 -1
  78. package/dist/components/logic-editor/panel-inputs/PanelRenderer.d.ts +12 -1
  79. package/dist/components/logic-editor/panel-inputs/PanelRenderer.d.ts.map +1 -1
  80. package/dist/components/logic-editor/panel-inputs/index.d.ts +1 -1
  81. package/dist/components/logic-editor/panel-inputs/index.d.ts.map +1 -1
  82. package/dist/components/logic-editor/properties-panel/ArgumentItem.d.ts.map +1 -1
  83. package/dist/components/logic-editor/properties-panel/ArgumentsSection.d.ts.map +1 -1
  84. package/dist/components/logic-editor/properties-panel/HelpSection.d.ts +8 -2
  85. package/dist/components/logic-editor/properties-panel/HelpSection.d.ts.map +1 -1
  86. package/dist/components/logic-editor/properties-panel/utils/argument-parser.d.ts +4 -0
  87. package/dist/components/logic-editor/properties-panel/utils/argument-parser.d.ts.map +1 -1
  88. package/dist/components/logic-editor/properties-panel/utils/expression-rebuilder.d.ts +6 -2
  89. package/dist/components/logic-editor/properties-panel/utils/expression-rebuilder.d.ts.map +1 -1
  90. package/dist/components/logic-editor/properties-panel/utils.d.ts.map +1 -1
  91. package/dist/components/logic-editor/services/argument-service.d.ts +4 -1
  92. package/dist/components/logic-editor/services/argument-service.d.ts.map +1 -1
  93. package/dist/components/logic-editor/services/index.d.ts +1 -1
  94. package/dist/components/logic-editor/services/index.d.ts.map +1 -1
  95. package/dist/components/logic-editor/services/inline-edit-service.d.ts +13 -0
  96. package/dist/components/logic-editor/services/inline-edit-service.d.ts.map +1 -0
  97. package/dist/components/logic-editor/services/node-mutation-service.d.ts +3 -2
  98. package/dist/components/logic-editor/services/node-mutation-service.d.ts.map +1 -1
  99. package/dist/components/logic-editor/services/node-transform-service.d.ts +14 -4
  100. package/dist/components/logic-editor/services/node-transform-service.d.ts.map +1 -1
  101. package/dist/components/logic-editor/types/editor.d.ts +51 -19
  102. package/dist/components/logic-editor/types/editor.d.ts.map +1 -1
  103. package/dist/components/logic-editor/types/index.d.ts +1 -1
  104. package/dist/components/logic-editor/types/index.d.ts.map +1 -1
  105. package/dist/components/logic-editor/types/jsonlogic.d.ts +1 -1
  106. package/dist/components/logic-editor/types/jsonlogic.d.ts.map +1 -1
  107. package/dist/components/logic-editor/types/trace.d.ts +16 -5
  108. package/dist/components/logic-editor/types/trace.d.ts.map +1 -1
  109. package/dist/components/logic-editor/utils/Icon.d.ts.map +1 -1
  110. package/dist/components/logic-editor/utils/converters/if-else-converter.d.ts +29 -3
  111. package/dist/components/logic-editor/utils/converters/if-else-converter.d.ts.map +1 -1
  112. package/dist/components/logic-editor/utils/converters/index.d.ts.map +1 -1
  113. package/dist/components/logic-editor/utils/converters/operator-converter.d.ts +1 -1
  114. package/dist/components/logic-editor/utils/converters/operator-converter.d.ts.map +1 -1
  115. package/dist/components/logic-editor/utils/converters/structure-converter.d.ts +4 -0
  116. package/dist/components/logic-editor/utils/converters/structure-converter.d.ts.map +1 -1
  117. package/dist/components/logic-editor/utils/converters/structure-paths.d.ts +52 -0
  118. package/dist/components/logic-editor/utils/converters/structure-paths.d.ts.map +1 -0
  119. package/dist/components/logic-editor/utils/converters/switch-cells.d.ts +40 -0
  120. package/dist/components/logic-editor/utils/converters/switch-cells.d.ts.map +1 -0
  121. package/dist/components/logic-editor/utils/converters/switch-converter.d.ts +1 -1
  122. package/dist/components/logic-editor/utils/converters/switch-converter.d.ts.map +1 -1
  123. package/dist/components/logic-editor/utils/converters/variable-cells.d.ts +62 -0
  124. package/dist/components/logic-editor/utils/converters/variable-cells.d.ts.map +1 -0
  125. package/dist/components/logic-editor/utils/converters/variable-converter.d.ts +1 -3
  126. package/dist/components/logic-editor/utils/converters/variable-converter.d.ts.map +1 -1
  127. package/dist/components/logic-editor/utils/index.d.ts +1 -1
  128. package/dist/components/logic-editor/utils/index.d.ts.map +1 -1
  129. package/dist/components/logic-editor/utils/layout.d.ts.map +1 -1
  130. package/dist/components/logic-editor/utils/menu-builder.d.ts +7 -1
  131. package/dist/components/logic-editor/utils/menu-builder.d.ts.map +1 -1
  132. package/dist/components/logic-editor/utils/node-cloning.d.ts +9 -1
  133. package/dist/components/logic-editor/utils/node-cloning.d.ts.map +1 -1
  134. package/dist/components/logic-editor/utils/node-deletion.d.ts +17 -0
  135. package/dist/components/logic-editor/utils/node-deletion.d.ts.map +1 -1
  136. package/dist/components/logic-editor/utils/node-factory.d.ts +7 -3
  137. package/dist/components/logic-editor/utils/node-factory.d.ts.map +1 -1
  138. package/dist/components/logic-editor/utils/node-updaters.d.ts +6 -0
  139. package/dist/components/logic-editor/utils/node-updaters.d.ts.map +1 -1
  140. package/dist/components/logic-editor/utils/nodeShape.d.ts.map +1 -1
  141. package/dist/components/logic-editor/utils/nodes-to-jsonlogic.d.ts.map +1 -1
  142. package/dist/components/logic-editor/utils/signal.d.ts.map +1 -1
  143. package/dist/components/logic-editor/utils/trace/child-matching.d.ts +47 -1
  144. package/dist/components/logic-editor/utils/trace/child-matching.d.ts.map +1 -1
  145. package/dist/components/logic-editor/utils/trace/index.d.ts +3 -2
  146. package/dist/components/logic-editor/utils/trace/index.d.ts.map +1 -1
  147. package/dist/components/logic-editor/utils/trace/node-creators/if-else.d.ts +1 -1
  148. package/dist/components/logic-editor/utils/trace/node-creators/if-else.d.ts.map +1 -1
  149. package/dist/components/logic-editor/utils/trace/node-creators/index.d.ts +0 -1
  150. package/dist/components/logic-editor/utils/trace/node-creators/index.d.ts.map +1 -1
  151. package/dist/components/logic-editor/utils/trace/node-creators/structure.d.ts +8 -1
  152. package/dist/components/logic-editor/utils/trace/node-creators/structure.d.ts.map +1 -1
  153. package/dist/components/logic-editor/utils/trace/node-creators/switch.d.ts +9 -4
  154. package/dist/components/logic-editor/utils/trace/node-creators/switch.d.ts.map +1 -1
  155. package/dist/components/logic-editor/utils/trace/node-creators/variable.d.ts +14 -2
  156. package/dist/components/logic-editor/utils/trace/node-creators/variable.d.ts.map +1 -1
  157. package/dist/components/logic-editor/utils/trace/node-creators/vertical-cell.d.ts +3 -1
  158. package/dist/components/logic-editor/utils/trace/node-creators/vertical-cell.d.ts.map +1 -1
  159. package/dist/components/logic-editor/utils/trace/trace-failure.d.ts +29 -0
  160. package/dist/components/logic-editor/utils/trace/trace-failure.d.ts.map +1 -0
  161. package/dist/components/logic-editor/utils/trace/trace-ids.d.ts +6 -0
  162. package/dist/components/logic-editor/utils/trace/trace-ids.d.ts.map +1 -0
  163. package/dist/components/logic-editor/utils/trace/trace-to-nodes.d.ts +5 -1
  164. package/dist/components/logic-editor/utils/trace/trace-to-nodes.d.ts.map +1 -1
  165. package/dist/datalogic_wasm-6KTmUP2q.cjs +1125 -0
  166. package/dist/datalogic_wasm-DJxb6g5L.js +1124 -0
  167. package/dist/index.cjs +6979 -3844
  168. package/dist/index.js +6975 -3844
  169. package/dist/lib.d.ts +5 -1
  170. package/dist/lib.d.ts.map +1 -1
  171. package/dist/styles.css +440 -0
  172. package/package.json +26 -23
  173. package/dist/components/logic-editor/context/EvaluationContext.d.ts +0 -5
  174. package/dist/components/logic-editor/context/EvaluationContext.d.ts.map +0 -1
  175. package/dist/components/logic-editor/context-menu/AddArgumentMenu.d.ts +0 -24
  176. package/dist/components/logic-editor/context-menu/AddArgumentMenu.d.ts.map +0 -1
  177. package/dist/components/logic-editor/hooks/useDebugEvaluation.d.ts +0 -16
  178. package/dist/components/logic-editor/hooks/useDebugEvaluation.d.ts.map +0 -1
  179. package/dist/components/logic-editor/utils/expression-builder.d.ts +0 -16
  180. package/dist/components/logic-editor/utils/expression-builder.d.ts.map +0 -1
  181. package/dist/components/logic-editor/utils/trace/evaluation-results.d.ts +0 -15
  182. package/dist/components/logic-editor/utils/trace/evaluation-results.d.ts.map +0 -1
  183. package/dist/components/logic-editor/utils/trace/node-creators/operator.d.ts +0 -11
  184. package/dist/components/logic-editor/utils/trace/node-creators/operator.d.ts.map +0 -1
  185. package/dist/datalogic_wasm-CQhNPxpU.js +0 -1146
  186. package/dist/datalogic_wasm-Da8EOl2Z.cjs +0 -1149
@@ -1 +1 @@
1
- {"version":3,"file":"ArgumentsSection.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/properties-panel/ArgumentsSection.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAqD,MAAM,UAAU,CAAC;AAa7F,UAAU,qBAAqB;IAC7B,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,eAAO,MAAM,gBAAgB,kDAE1B,qBAAqB,wCAwNtB,CAAC"}
1
+ {"version":3,"file":"ArgumentsSection.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/properties-panel/ArgumentsSection.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAqD,MAAM,UAAU,CAAC;AAY7F,UAAU,qBAAqB;IAC7B,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,eAAO,MAAM,gBAAgB,kDAE1B,qBAAqB,wCAgKtB,CAAC"}
@@ -1,8 +1,14 @@
1
- import { OperatorHelp, AritySpec } from '../config/operators.types';
1
+ import { Operator, OperatorHelp, AritySpec } from '../config/operators.types';
2
2
  interface HelpSectionProps {
3
3
  help: OperatorHelp;
4
4
  arity: AritySpec;
5
+ /**
6
+ * The operator being described. Optional for backward compatibility: when
7
+ * omitted, the operator is recovered from the registry by matching the
8
+ * `help` object identity (configs are static, so this is exact).
9
+ */
10
+ operator?: Operator;
5
11
  }
6
- export declare const HelpSection: import('react').MemoExoticComponent<({ help, arity, }: HelpSectionProps) => import("react").JSX.Element>;
12
+ export declare const HelpSection: import('react').MemoExoticComponent<({ help, arity, operator, }: HelpSectionProps) => import("react").JSX.Element>;
7
13
  export {};
8
14
  //# sourceMappingURL=HelpSection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HelpSection.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/properties-panel/HelpSection.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAmB,MAAM,2BAA2B,CAAC;AAE1F,UAAU,gBAAgB;IACxB,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;CAClB;AAmCD,eAAO,MAAM,WAAW,yDAGrB,gBAAgB,iCAuDjB,CAAC"}
1
+ {"version":3,"file":"HelpSection.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/properties-panel/HelpSection.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,SAAS,EAEV,MAAM,2BAA2B,CAAC;AAOnC,UAAU,gBAAgB;IACxB,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAMD,eAAO,MAAM,WAAW,mEAIrB,gBAAgB,iCAkFjB,CAAC"}
@@ -20,6 +20,10 @@ export interface ArgumentInfo {
20
20
  fieldType?: string;
21
21
  /** Placeholder text from editable cell */
22
22
  placeholder?: string;
23
+ /** Inline operand that is not a plain literal (a collapsed var pill, an array): shown, not edited */
24
+ readOnly?: boolean;
25
+ /** Display text for read-only inline operands */
26
+ displayLabel?: string;
23
27
  }
24
28
  /**
25
29
  * Check if an operator supports variable arguments
@@ -1 +1 @@
1
- {"version":3,"file":"argument-parser.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/properties-panel/utils/argument-parser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAChG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,0BAA0B;IAC1B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,SAAS,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;IACzC,uBAAuB;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAS5E;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAGpE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CAGtE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAM9D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,eAAe,CAAC,WAAW,CAAC,CAOlF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAoBvD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,GACnC,YAAY,EAAE,CA4EhB"}
1
+ {"version":3,"file":"argument-parser.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/properties-panel/utils/argument-parser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAChG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAG7D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,0BAA0B;IAC1B,KAAK,CA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, val, exists) from editable cell values
3
+ * Rebuild expression for variable operators (var, val, exists) from editable cell values.
4
+ *
5
+ * `currentExpression` (the node's stored expression) supplies the original
6
+ * argument form (string vs array) and the default of a var whose default is
7
+ * wired to a child or stored inline.
4
8
  */
5
- export declare function rebuildVariableExpression(operator: string, cells: CellData[]): JsonLogicValue;
9
+ export declare function rebuildVariableExpression(operator: string, cells: CellData[], currentExpression?: JsonLogicValue): JsonLogicValue;
6
10
  //# sourceMappingURL=expression-rebuilder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"expression-rebuilder.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/properties-panel/utils/expression-rebuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5D;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,cAAc,CAgD7F"}
1
+ {"version":3,"file":"expression-rebuilder.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/properties-panel/utils/expression-rebuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5D;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,QAAQ,EAAE,EACjB,iBAAiB,CAAC,EAAE,cAAc,GACjC,cAAc,CAMhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/properties-panel/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAwD,MAAM,UAAU,CAAC;AACpG,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAIvE;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,aAAa,GAAG,WAAW,GAAG,IAAI,CAW7E;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,aAAa,GAAG,QAAQ,GAAG,IAAI,CAO7E;AAWD;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAWrF;AA6DD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAW/D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CAWlE"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/properties-panel/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,aAAa,EAKd,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAUvE;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,aAAa,GAAG,WAAW,GAAG,IAAI,CAW7E;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,aAAa,GAAG,QAAQ,GAAG,IAAI,CAO7E;AAcD;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAWrF;AA2ED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAW/D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CAWlE"}
@@ -6,12 +6,15 @@ export interface AddArgumentResult {
6
6
  nodes: LogicNode[];
7
7
  newNodeId: string;
8
8
  }
9
+ /** True when the operator's arity lets the editor add / remove arguments. */
10
+ export declare function canEditArguments(operator: string): boolean;
9
11
  /**
10
12
  * Add an argument to an operator node (unified cells-based logic)
11
13
  */
12
14
  export declare function addArgument(nodes: LogicNode[], parentId: string, nodeType: 'literal' | 'variable' | 'operator', operatorName?: string): AddArgumentResult | null;
13
15
  /**
14
- * Remove an argument from an operator node (unified cells-based logic)
16
+ * Remove an argument from an operator node (unified cells-based logic).
17
+ * `argIndex` is the cell index of the argument to remove.
15
18
  */
16
19
  export declare function removeArgument(nodes: LogicNode[], parentId: string, argIndex: number): LogicNode[] | null;
17
20
  //# sourceMappingURL=argument-service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"argument-service.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/services/argument-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,SAAS,EAKV,MAAM,UAAU,CAAC;AAKlB;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,SAAS,EAAE,EAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,EAC7C,YAAY,CAAC,EAAE,MAAM,GACpB,iBAAiB,GAAG,IAAI,CA8E1B;AA4LD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,EAAE,EAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,SAAS,EAAE,GAAG,IAAI,CAsEpB"}
1
+ {"version":3,"file":"argument-service.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/services/argument-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EACV,SAAS,EAKV,MAAM,UAAU,CAAC;AA0BlB;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAa1D;AAiCD;;GAEG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,SAAS,EAAE,EAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,EAC7C,YAAY,CAAC,EAAE,MAAM,GACpB,iBAAiB,GAAG,IAAI,CAuE1B;AAkMD;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,EAAE,EAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,SAAS,EAAE,GAAG,IAAI,CA8FpB"}
@@ -3,5 +3,5 @@
3
3
  *
4
4
  * Re-exports all editor services for convenient imports.
5
5
  */
6
- export { addArgument, removeArgument, wrapInOperator, duplicateNodeTree, type AddArgumentResult, } from './node-mutation-service';
6
+ export { addArgument, removeArgument, canEditArguments, wrapInOperator, duplicateNodeTree, updateInlineOperand, inlineOperandForCell, type AddArgumentResult, } from './node-mutation-service';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/services/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,WAAW,EACX,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,KAAK,iBAAiB,GACvB,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/services/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,iBAAiB,GACvB,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { OperatorNodeData, JsonLogicValue, CellData } from '../types';
2
+ /**
3
+ * The inline (stored) operand a cell displays, looked up the way the
4
+ * serializer would: switch rows through their Case/Then pairing, everything
5
+ * else by cell index. Undefined when the node has no stored operand for it.
6
+ */
7
+ export declare function inlineOperandForCell(data: OperatorNodeData, cell: CellData): JsonLogicValue | undefined;
8
+ /**
9
+ * Compute the data patch for changing the inline value shown at `cellIndex`.
10
+ * Returns null when the cell is unknown or holds a wired child.
11
+ */
12
+ export declare function updateInlineOperand(data: OperatorNodeData, cellIndex: number, newValue: JsonLogicValue): Partial<OperatorNodeData> | null;
13
+ //# sourceMappingURL=inline-edit-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-edit-service.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/services/inline-edit-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AA0B3E;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,GAAG,cAAc,GAAG,SAAS,CAMvG;AAoBD;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,gBAAgB,EACtB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAyClC"}
@@ -8,7 +8,8 @@
8
8
  * - node-transform-service.ts (wrap/duplicate operations)
9
9
  */
10
10
  export { getDefaultValueForCategory, createArgumentNode } from './node-creation-service';
11
- export { addArgument, removeArgument, type AddArgumentResult } from './argument-service';
11
+ export { addArgument, removeArgument, canEditArguments, type AddArgumentResult } from './argument-service';
12
12
  export { wrapInOperator, duplicateNodeTree } from './node-transform-service';
13
- export { cloneNodesWithIdMapping, getDescendants, updateParentChildReference } from '../utils/node-cloning';
13
+ export { updateInlineOperand, inlineOperandForCell } from './inline-edit-service';
14
+ export { cloneNodesWithIdMapping, getDescendants, updateParentChildReference, replaceChildReference, } from '../utils/node-cloning';
14
15
  //# sourceMappingURL=node-mutation-service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-mutation-service.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/services/node-mutation-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"node-mutation-service.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/services/node-mutation-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClF,OAAO,EACL,uBAAuB,EACvB,cAAc,EACd,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,uBAAuB,CAAC"}
@@ -1,15 +1,25 @@
1
1
  import { LogicNode } from '../types';
2
- import { cloneNodesWithIdMapping, getDescendants, updateParentChildReference } from '../utils/node-cloning';
2
+ import { cloneNodesWithIdMapping, getDescendants, updateParentChildReference, replaceChildReference } from '../utils/node-cloning';
3
3
  /**
4
- * Wrap a node in an operator
4
+ * Wrap a node in an operator: the node becomes the wrapper's first operand
5
+ * and the wrapper takes the node's place under its parent (operator cells and
6
+ * structure elements alike). Wrapping in `if` builds a real decision diamond
7
+ * with the node as its condition and placeholder then/else values.
5
8
  */
6
9
  export declare function wrapInOperator(nodes: LogicNode[], nodeId: string, operator: string): LogicNode[] | null;
7
10
  /**
8
- * Duplicate a node and its descendants
11
+ * Duplicate a node and its descendants as a new sibling.
12
+ *
13
+ * Only parents with a free slot accept the copy: n-ary operators append an
14
+ * operand, switch/match duplicate the whole Case/Then pair, array templates
15
+ * append an element. Fixed-slot parents (decision diamonds, var defaults,
16
+ * switch Match/Default rows, object templates) return null so the caller
17
+ * leaves the graph unchanged. A root node is duplicated in place (the tree is
18
+ * replaced by its copy).
9
19
  */
10
20
  export declare function duplicateNodeTree(nodes: LogicNode[], nodeId: string): {
11
21
  nodes: LogicNode[];
12
22
  newRootId: string;
13
23
  } | null;
14
- export { cloneNodesWithIdMapping, getDescendants, updateParentChildReference };
24
+ export { cloneNodesWithIdMapping, getDescendants, updateParentChildReference, replaceChildReference };
15
25
  //# sourceMappingURL=node-transform-service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-transform-service.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/services/node-transform-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,SAAS,EAEV,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAE5G;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,EAAE,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,SAAS,EAAE,GAAG,IAAI,CA+DpB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS,EAAE,EAClB,MAAM,EAAE,MAAM,GACb;IAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAmDlD;AAGD,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,0BAA0B,EAAE,CAAC"}
1
+ {"version":3,"file":"node-transform-service.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/services/node-transform-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,SAAS,EAMV,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,uBAAuB,EACvB,cAAc,EACd,0BAA0B,EAC1B,qBAAqB,EACtB,MAAM,uBAAuB,CAAC;AA+C/B;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,EAAE,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,SAAS,EAAE,GAAG,IAAI,CAyEpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS,EAAE,EAClB,MAAM,EAAE,MAAM,GACb;IAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAgClD;AAuKD,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import { Node, Edge } from '@xyflow/react';
2
2
  import { OperatorCategory, JsonLogicValue } from './jsonlogic';
3
3
  import { IconName } from '../utils/icons';
4
- import { TracedResult } from './trace';
5
4
  export type VisualNodeType = 'operator' | 'literal' | 'structure';
6
5
  export interface BaseNodeData extends Record<string, unknown> {
7
6
  type: VisualNodeType;
@@ -84,25 +83,44 @@ export interface ConversionResult {
84
83
  edges: LogicEdge[];
85
84
  rootId: string | null;
86
85
  }
87
- export interface NodeEvaluationResult {
88
- value: unknown;
89
- error: string | null;
90
- type: 'boolean' | 'number' | 'string' | 'null' | 'array' | 'object' | 'undefined';
91
- }
92
- export type EvaluationResultsMap = Map<string, NodeEvaluationResult>;
93
- export interface LogicEditorProps {
94
- value: JsonLogicValue | null;
95
- onChange: (expr: JsonLogicValue | null) => void;
96
- readOnly?: boolean;
97
- className?: string;
98
- evaluationResults?: EvaluationResultsMap;
99
- /** Data object for debug evaluation */
100
- debugData?: unknown;
101
- /** Evaluate function from WASM - if provided, enables debug mode */
102
- evaluate?: (logic: unknown, data: unknown) => unknown;
103
- /** Evaluate with trace function from WASM - if provided, uses trace API for diagram rendering */
104
- evaluateWithTrace?: (logic: unknown, data: unknown) => TracedResult;
86
+ /**
87
+ * Engine evaluation settings, mirroring the WASM `Engine` config keys
88
+ * (`EvaluationConfig::from_json_str` in the Rust crate). Every key is
89
+ * optional; omitted keys keep the engine default (or the selected preset's
90
+ * value). Unknown keys or values are rejected by the engine with a
91
+ * `ConfigurationError`.
92
+ */
93
+ export interface DataLogicEvaluationConfig {
94
+ /** Starting point the other keys override. Default: `'default'`. */
95
+ preset?: 'default' | 'safe_arithmetic' | 'strict';
96
+ /** What arithmetic does with a non-numeric operand. Default: `'throw_error'`. */
97
+ arithmetic_nan_handling?: 'throw_error' | 'ignore_value' | 'coerce_to_zero' | 'return_null';
98
+ /**
99
+ * What a fractional dividend over zero yields. Default: `'return_saturated'`.
100
+ * Integer division by zero always throws `{"type": "NaN"}`.
101
+ */
102
+ division_by_zero?: 'return_saturated' | 'throw_error' | 'return_null' | 'return_infinity';
103
+ /** Whether loose `==` raises on incompatible types. Default: `true`. */
104
+ loose_equality_errors?: boolean;
105
+ /** Truthiness rules used by `if`, `and`, `or`, `!`. Default: `'javascript'`. */
106
+ truthy_evaluator?: 'javascript' | 'python' | 'strict_boolean';
107
+ /** Numeric coercion knobs (all default to `true` except `reject_non_numeric`). */
108
+ numeric_coercion?: {
109
+ empty_string_to_zero?: boolean;
110
+ null_to_zero?: boolean;
111
+ bool_to_number?: boolean;
112
+ /** When `true`, overrides every other coercion flag and raises instead. */
113
+ reject_non_numeric?: boolean;
114
+ };
115
+ /** Nested evaluation-boundary cap (custom operators re-entering the engine). Default: `256`. */
116
+ max_recursion_depth?: number;
105
117
  }
118
+ /**
119
+ * A custom operator implementation. Receives the already-evaluated
120
+ * arguments and returns any JSON-serializable value (`undefined` becomes
121
+ * `null`). A thrown exception surfaces as a runtime evaluation error.
122
+ */
123
+ export type DataLogicCustomOperator = (args: unknown[]) => unknown;
106
124
  /**
107
125
  * Props for the DataLogicEditor component (public API)
108
126
  */
@@ -126,6 +144,20 @@ export interface DataLogicEditorProps {
126
144
  templating?: boolean;
127
145
  /** Callback when templating mode changes (from toolbar checkbox) */
128
146
  onTemplatingChange?: (value: boolean) => void;
147
+ /**
148
+ * Engine evaluation settings (presets, NaN and division-by-zero handling,
149
+ * truthiness rules, numeric coercion, recursion cap). Applied to both the
150
+ * plain and the traced evaluation paths; the toolbar shows a compact
151
+ * summary whenever the settings differ from the engine defaults.
152
+ */
153
+ config?: DataLogicEvaluationConfig;
154
+ /**
155
+ * Custom operators registered on the evaluation engine, keyed by operator
156
+ * name. Rules that use them evaluate and trace normally; the palette and
157
+ * help panel only know built-in operators, so custom nodes render with
158
+ * the generic "utility" styling.
159
+ */
160
+ customOperators?: Record<string, DataLogicCustomOperator>;
129
161
  /**
130
162
  * Enable editing: node selection, properties panel, context menus, undo/redo.
131
163
  * Default: false
@@ -1 +1 @@
1
- {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/types/editor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG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AAC;IAEf,kFAAkF;IAClF,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAEzB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,oEAAoE;IACpE,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAE9C;;;;;OAKG;IACH,MAAM,CAAC,EAAE,yBAAyB,CAAC;IAEnC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;IAE1D;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE9B;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C"}
@@ -1,5 +1,5 @@
1
1
  export type { JsonLogicPrimitive, JsonLogicVar, JsonLogicVal, JsonLogicExpression, JsonLogicValue, OperatorCategory, NodeCategory, } from './jsonlogic';
2
- export type { VisualNodeType, BaseNodeData, ArgSummary, OperatorNodeData, LiteralNodeData, CellData, VariableNodeData, StructureElement, StructureNodeData, LogicNodeData, LogicNode, LogicEdge, EditorState, ConversionResult, NodeEvaluationResult, EvaluationResultsMap, LogicEditorProps, DataLogicEditorProps, } from './editor';
2
+ export type { VisualNodeType, BaseNodeData, ArgSummary, OperatorNodeData, LiteralNodeData, CellData, VariableNodeData, StructureElement, StructureNodeData, LogicNodeData, LogicNode, LogicEdge, EditorState, ConversionResult, DataLogicEditorProps, DataLogicEvaluationConfig, DataLogicCustomOperator, } from './editor';
3
3
  export type { ExpressionNode, ExecutionStep, TracedResult, StructuredError, } from './trace';
4
4
  export { CATEGORY_COLORS } from '../constants/colors';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,cAAc,EACd,aAAa,EACb,YAAY,EACZ,eAAe,GAChB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,cAAc,EACd,aAAa,EACb,YAAY,EACZ,eAAe,GAChB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
@@ -3,7 +3,7 @@ export interface JsonLogicVar {
3
3
  var: string | [string, JsonLogicValue];
4
4
  }
5
5
  export interface JsonLogicVal {
6
- val: string;
6
+ val: string | JsonLogicValue[];
7
7
  }
8
8
  export type JsonLogicExpression = {
9
9
  [operator: string]: JsonLogicValue | JsonLogicValue[];
@@ -1 +1 @@
1
- {"version":3,"file":"jsonlogic.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/types/jsonlogic.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAGlE,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CACxC;AAGD,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;CACb;AAGD,MAAM,MAAM,mBAAmB,GAAG;IAChC,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,cAAc,EAAE,CAAC;CACvD,CAAC;AAGF,MAAM,MAAM,cAAc,GACtB,kBAAkB,GAClB,kBAAkB,EAAE,GACpB,mBAAmB,GACnB,cAAc,EAAE,CAAC;AAKrB,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAIlE,MAAM,MAAM,YAAY,GACpB,OAAO,2BAA2B,EAAE,gBAAgB,GACpD,SAAS,CAAC"}
1
+ {"version":3,"file":"jsonlogic.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/types/jsonlogic.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAGlE,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CACxC;AAGD,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,GAAG,cAAc,EAAE,CAAC;CAChC;AAGD,MAAM,MAAM,mBAAmB,GAAG;IAChC,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,cAAc,EAAE,CAAC;CACvD,CAAC;AAGF,MAAM,MAAM,cAAc,GACtB,kBAAkB,GAClB,kBAAkB,EAAE,GACpB,mBAAmB,GACnB,cAAc,EAAE,CAAC;AAKrB,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAIlE,MAAM,MAAM,YAAY,GACpB,OAAO,2BAA2B,EAAE,gBAAgB,GACpD,SAAS,CAAC"}
@@ -3,22 +3,27 @@ export interface ExpressionNode {
3
3
  expression: string;
4
4
  children: ExpressionNode[];
5
5
  }
6
+ /**
7
+ * One recorded evaluation step. Mirrors the Rust `ExecutionStep`: `result`
8
+ * and `error` are always emitted (null when absent), the iteration fields
9
+ * only inside iterator operators (map / filter / reduce / all / some / none).
10
+ */
6
11
  export interface ExecutionStep {
7
- id: number;
12
+ step_id: number;
8
13
  node_id: number;
9
14
  context: unknown;
10
- result?: unknown;
11
- error?: string;
15
+ result: unknown;
16
+ error: string | null;
12
17
  iteration_index?: number;
13
18
  iteration_total?: number;
14
19
  }
15
20
  /**
16
21
  * Structured error shape emitted by the WASM `*_structured` entry points.
17
22
  *
18
- * Mirrors the Rust `Error` serialization — `type` is a stable
23
+ * Mirrors the Rust `Error` serialization: `type` is a stable
19
24
  * machine-readable kind, `message` is human-readable, and variant-specific
20
25
  * extras appear as extra fields. `node_ids` is the v5 failure breadcrumb
21
- * (compile-time node IDs, root-to-leaf); `stage` is set on parse-time
26
+ * (compile-time node IDs, innermost first); `stage` is set on parse-time
22
27
  * failures from the WASM boundary itself.
23
28
  */
24
29
  export interface StructuredError {
@@ -33,6 +38,12 @@ export interface StructuredError {
33
38
  stage?: string;
34
39
  node_ids?: number[];
35
40
  }
41
+ /**
42
+ * Envelope returned by `evaluateWithTrace`. On a compile-stage failure
43
+ * (parse error, unknown operator) `expression_tree` is the placeholder
44
+ * `{ id: 0, expression: '', children: [] }` and `steps` is empty; `error` and
45
+ * `structured_error` are present whenever evaluation did not produce a result.
46
+ */
36
47
  export interface TracedResult {
37
48
  result: unknown;
38
49
  expression_tree: ExpressionNode;
@@ -1 +1 @@
1
- {"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/types/trace.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,EAAE,cAAc,CAAC;IAChC,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,eAAe,CAAC;CACpC"}
1
+ {"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/types/trace.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,EAAE,cAAc,CAAC;IAChC,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,eAAe,CAAC;CACpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAqC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAwCxC,UAAU,SAAS;IACjB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,IAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,SAAS,GAAG,KAAK,CAAC,YAAY,CAGzF"}
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAqC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAwCxC,UAAU,SAAS;IACjB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,IAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,SAAS,GAAG,KAAK,CAAC,YAAY,CAOzF"}
@@ -1,10 +1,36 @@
1
- import { JsonLogicValue } from '../../types';
1
+ import { JsonLogicValue, CellData } from '../../types';
2
2
  import { ConversionContext, ConverterFn } from './types';
3
+ /** Operators rendered as a decision diamond chain. */
4
+ export declare function isIfOperator(operator: string): boolean;
5
+ /** The three inputs of a decision diamond. */
6
+ export type DecisionSlot = 'when' | 'then' | 'else';
3
7
  /**
4
- * Convert if/then/else into a CHAIN of standalone decision-diamond nodes — one
8
+ * Which diamond input a cell belongs to, from its row label (the converter and
9
+ * trace builder write 'when'/'then'/'else'; older in-editor nodes used
10
+ * 'If'/'Then'/'Else'). Undefined for cells that are not part of a diamond.
11
+ */
12
+ export declare function decisionSlotOf(cell: CellData): DecisionSlot | undefined;
13
+ /**
14
+ * True when the cells carry the diamond layout: a when and a then input and
15
+ * at most one else input, nothing else. A generic `if` node (single operand,
16
+ * shorthand form, or built from an invalid rule) does not.
17
+ */
18
+ export declare function isDecisionCells(cells: CellData[]): boolean;
19
+ /** Look up the cell for a diamond input. */
20
+ export declare function decisionCell(cells: CellData[], slot: DecisionSlot): CellData | undefined;
21
+ /** Build a branch cell for a diamond input. */
22
+ export declare function makeDecisionBranchCell(slot: DecisionSlot, branchId: string, label?: string): CellData;
23
+ /** Build an inline placeholder cell for a diamond input (value is stored on the expression). */
24
+ export declare function makeDecisionInlineCell(slot: DecisionSlot, label: string): CellData;
25
+ /**
26
+ * Convert if/then/else into a CHAIN of standalone decision-diamond nodes, one
5
27
  * diamond per condition, rather than a single block. Each diamond has three
6
28
  * inputs (when / then / else); a trailing else-if becomes the next diamond wired
7
29
  * into the else input, so the diamonds read as a series down the else path.
30
+ *
31
+ * The caller guarantees at least two arguments (condition + then); shorter or
32
+ * non-array forms are converted as generic operator nodes so they serialize
33
+ * back unchanged.
8
34
  */
9
- export declare function convertIfElse(ifArgs: JsonLogicValue[], context: ConversionContext, convertValue: ConverterFn): string;
35
+ export declare function convertIfElse(operator: string, ifArgs: JsonLogicValue[], context: ConversionContext, convertValue: ConverterFn): string;
10
36
  //# sourceMappingURL=if-else-converter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"if-else-converter.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/converters/if-else-converter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAoD,MAAM,aAAa,CAAC;AACpG,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAoB9D;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,cAAc,EAAE,EACxB,OAAO,EAAE,iBAAiB,EAC1B,YAAY,EAAE,WAAW,GACxB,MAAM,CAwBR"}
1
+ {"version":3,"file":"if-else-converter.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/converters/if-else-converter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAA+B,QAAQ,EAAa,MAAM,aAAa,CAAC;AACpG,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAQ9D,sDAAsD;AACtD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED,8CAA8C;AAC9C,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,YAAY,GAAG,SAAS,CAMvE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,CAS1D;AAED,4CAA4C;AAC5C,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,YAAY,GAAG,QAAQ,GAAG,SAAS,CAExF;AAUD,+CAA+C;AAC/C,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,CASrG;AAED,gGAAgG;AAChG,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,CAQlF;AAcD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,cAAc,EAAE,EACxB,OAAO,EAAE,iBAAiB,EAC1B,YAAY,EAAE,WAAW,GACxB,MAAM,CAYR"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/converters/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AASjD,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG1E,wBAAgB,YAAY,CAC1B,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,iBAAiB,GACzB,MAAM,CA2CR"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/converters/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AASjD,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG1E,wBAAgB,YAAY,CAC1B,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,iBAAiB,GACzB,MAAM,CA8CR"}
@@ -1,5 +1,5 @@
1
1
  import { JsonLogicValue } from '../../types';
2
2
  import { ConversionContext, ConverterFn } from './types';
3
- export declare function convertOperator(operator: string, operandArray: JsonLogicValue[], context: ConversionContext, convertValue: ConverterFn): string;
3
+ export declare function convertOperator(operator: string, operandArray: JsonLogicValue[], context: ConversionContext, convertValue: ConverterFn, rawOperand?: JsonLogicValue): string;
4
4
  export declare function isUnaryOperator(operator: string): boolean;
5
5
  //# sourceMappingURL=operator-converter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"operator-converter.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/converters/operator-converter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,aAAa,CAAC;AACzF,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAe9D,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,cAAc,EAAE,EAC9B,OAAO,EAAE,iBAAiB,EAC1B,YAAY,EAAE,WAAW,GACxB,MAAM,CA2FR;AAGD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEzD"}
1
+ {"version":3,"file":"operator-converter.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/converters/operator-converter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,aAAa,CAAC;AACzF,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAe9D,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,cAAc,EAAE,EAC9B,OAAO,EAAE,iBAAiB,EAC1B,YAAY,EAAE,WAAW,EACzB,UAAU,CAAC,EAAE,cAAc,GAC1B,MAAM,CA6FR;AAGD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEzD"}
@@ -2,6 +2,10 @@ import { ConversionContext, ConverterFn } from './types';
2
2
  /**
3
3
  * Convert a data structure (object or array with potential JSONLogic expressions)
4
4
  * to a structure node that displays formatted JSON with linked expression branches.
5
+ *
6
+ * Only embedded expressions become elements (and child nodes); every literal
7
+ * field stays inside `data.expression`, which the serializer walks, substituting
8
+ * each element's child at its recorded path.
5
9
  */
6
10
  export declare function convertStructure(value: Record<string, unknown> | unknown[], context: ConversionContext, convertValue: ConverterFn): string;
7
11
  //# sourceMappingURL=structure-converter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"structure-converter.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/converters/structure-converter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAW9D;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,EAC1C,OAAO,EAAE,iBAAiB,EAC1B,YAAY,EAAE,WAAW,GACxB,MAAM,CAqGR"}
1
+ {"version":3,"file":"structure-converter.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/converters/structure-converter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAO9D;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,EAC1C,OAAO,EAAE,iBAAiB,EAC1B,YAAY,EAAE,WAAW,GACxB,MAAM,CAmFR"}
@@ -0,0 +1,52 @@
1
+ import { JsonLogicValue, StructureElement } from '../../types';
2
+ export declare const EXPR_PLACEHOLDER = "{{EXPR}}";
3
+ export declare const EXPR_PLACEHOLDER_QUOTED = "\"{{EXPR}}\"";
4
+ export declare function cloneJson<T>(value: T): T;
5
+ /** Read the value at `path` (undefined when any segment is missing). */
6
+ export declare function getAtPath(root: unknown, path: string[]): unknown;
7
+ /**
8
+ * Set the value at `path`, creating intermediate containers as needed
9
+ * (arrays for numeric segments, objects otherwise). Mutates `root` and
10
+ * returns it; a root replaced wholesale (empty path) is returned instead.
11
+ */
12
+ export declare function setAtPath(root: JsonLogicValue, path: string[], value: JsonLogicValue): JsonLogicValue;
13
+ /** Remove the value at `path` (array entries are spliced out). Mutates `root`. */
14
+ export declare function removeAtPath(root: JsonLogicValue, path: string[]): void;
15
+ /**
16
+ * After removing the entry at `removedPath` from an array, later siblings in
17
+ * that array (and everything nested under them) shift down by one index.
18
+ * Returns the adjusted path for `path`.
19
+ */
20
+ export declare function shiftPathAfterRemoval(path: string[], removedPath: string[], root: JsonLogicValue): string[];
21
+ /** Character span of one expression placeholder in the formatted JSON. */
22
+ export interface ExprSpan {
23
+ startOffset: number;
24
+ endOffset: number;
25
+ }
26
+ /**
27
+ * A marker factory whose tokens cannot occur anywhere inside `source`.
28
+ * Marking each expression slot with a distinct token (rather than one
29
+ * shared `{{EXPR}}`) is what makes the offset search exact: a literal
30
+ * `"{{EXPR}}"` in the user's own data can no longer be mistaken for a
31
+ * placeholder, and slots no longer have to be listed in document order.
32
+ */
33
+ export declare function exprMarkerFactory(source: JsonLogicValue): (slot: number) => string;
34
+ /**
35
+ * Swap each unique marker in `marked` back to the canonical `"{{EXPR}}"`,
36
+ * returning the final JSON plus the span each slot ended up occupying.
37
+ * `spans[i]` is null when `markers[i]` is not present (an element whose
38
+ * path no longer resolves).
39
+ */
40
+ export declare function resolveExprMarkers(marked: string, markers: string[]): {
41
+ formattedJson: string;
42
+ spans: (ExprSpan | null)[];
43
+ };
44
+ /**
45
+ * Produce the pretty-printed JSON with a placeholder at every expression
46
+ * element's path, and return the elements with their character offsets set.
47
+ */
48
+ export declare function formatStructureWithPlaceholders(expression: JsonLogicValue, elements: StructureElement[]): {
49
+ formattedJson: string;
50
+ elements: StructureElement[];
51
+ };
52
+ //# sourceMappingURL=structure-paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structure-paths.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/converters/structure-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpE,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAE3C,eAAO,MAAM,uBAAuB,iBAA0B,CAAC;AAE/D,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAExC;AAMD,wEAAwE;AACxE,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAOhE;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,cAAc,GAAG,cAAc,CAgCrG;AAED,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAUvE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,GAAG,MAAM,EAAE,CAc3G;AAED,0EAA0E;AAC1E,MAAM,WAAW,QAAQ;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAKlF;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EAAE,GAChB;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAA;CAAE,CAsBvD;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAC7C,UAAU,EAAE,cAAc,EAC1B,QAAQ,EAAE,gBAAgB,EAAE,GAC3B;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,gBAAgB,EAAE,CAAA;CAAE,CA0BzD"}
@@ -0,0 +1,40 @@
1
+ import { JsonLogicValue, CellData } from '../../types';
2
+ export declare const SWITCH_ROW_LABELS: readonly ["Match", "Case", "Then", "Default"];
3
+ export type SwitchRowLabel = (typeof SWITCH_ROW_LABELS)[number];
4
+ export declare function isSwitchOperator(operator: string): boolean;
5
+ /** True when the cells carry the Match/Case/Then/Default row layout. */
6
+ export declare function isSwitchCells(cells: CellData[]): boolean;
7
+ /** A cases operand is well formed when every entry is a [case, result] pair. */
8
+ export declare function isWellFormedCases(cases: JsonLogicValue): cases is JsonLogicValue[][];
9
+ /** Split [discriminant, cases, default] out of a stored operand list. */
10
+ export declare function splitSwitchOperands(storedOperands: JsonLogicValue[]): {
11
+ discriminant: JsonLogicValue;
12
+ cases: JsonLogicValue[][];
13
+ defaultValue: JsonLogicValue | undefined;
14
+ hasCases: boolean;
15
+ };
16
+ /**
17
+ * The stored (inline) operand every switch cell corresponds to, by row
18
+ * position: Match -> operands[0], the k-th Case/Then -> cases[k][0|1],
19
+ * Default -> operands[2]. One pass, keyed by cell index.
20
+ */
21
+ export declare function switchStoredValues(cells: CellData[], storedOperands: JsonLogicValue[]): Map<number, JsonLogicValue | undefined>;
22
+ /** The stored operand for one cell (see [`switchStoredValues`]). */
23
+ export declare function switchStoredValueForCell(cells: CellData[], storedOperands: JsonLogicValue[], target: CellData): JsonLogicValue | undefined;
24
+ /**
25
+ * Resolve every cell to a value: branch cells through `resolveBranch`
26
+ * (falling back to the stored operand), inline cells to the stored operand.
27
+ * Returns a map keyed by cell index so callers can filter/reorder cells
28
+ * afterwards without losing the alignment.
29
+ */
30
+ export declare function resolveSwitchCellValues(cells: CellData[], storedOperands: JsonLogicValue[], resolveBranch?: (cell: CellData) => JsonLogicValue | undefined): Map<number, JsonLogicValue>;
31
+ /**
32
+ * Rebuild [discriminant, [[case, result], ...], default?] from cells and their
33
+ * resolved values. The cases array is emitted when there is at least one
34
+ * Case/Then pair or the original rule carried one (so {"switch": [d]} stays
35
+ * exactly that).
36
+ */
37
+ export declare function switchArgsFromCells(cells: CellData[], values: Map<number, JsonLogicValue>, hadCases: boolean): JsonLogicValue[];
38
+ /** Find the Case/Then partner of a switch cell (the adjacent row of its pair). */
39
+ export declare function switchPairPartner(cells: CellData[], cell: CellData): CellData | undefined;
40
+ //# sourceMappingURL=switch-cells.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch-cells.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/converters/switch-cells.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE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