@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.
- package/README.md +163 -32
- package/dist/components/logic-editor/DataLogicEditor.d.ts +1 -1
- package/dist/components/logic-editor/DataLogicEditor.d.ts.map +1 -1
- package/dist/components/logic-editor/EditorToolbar.d.ts +8 -1
- package/dist/components/logic-editor/EditorToolbar.d.ts.map +1 -1
- package/dist/components/logic-editor/KeyboardHandler.d.ts.map +1 -1
- package/dist/components/logic-editor/config/arity.d.ts +3 -0
- package/dist/components/logic-editor/config/arity.d.ts.map +1 -0
- package/dist/components/logic-editor/config/categories.d.ts +7 -2
- package/dist/components/logic-editor/config/categories.d.ts.map +1 -1
- package/dist/components/logic-editor/config/docs.d.ts +11 -0
- package/dist/components/logic-editor/config/docs.d.ts.map +1 -0
- package/dist/components/logic-editor/config/literalPanel.d.ts +4 -0
- package/dist/components/logic-editor/config/literalPanel.d.ts.map +1 -1
- package/dist/components/logic-editor/config/operators/arithmetic-basic.d.ts.map +1 -1
- package/dist/components/logic-editor/config/operators/arithmetic-functions.d.ts.map +1 -1
- package/dist/components/logic-editor/config/operators/array-iteration.d.ts.map +1 -1
- package/dist/components/logic-editor/config/operators/array-manipulation.d.ts.map +1 -1
- package/dist/components/logic-editor/config/operators/array.d.ts +1 -1
- package/dist/components/logic-editor/config/operators/control.d.ts.map +1 -1
- package/dist/components/logic-editor/config/operators/datetime.d.ts.map +1 -1
- package/dist/components/logic-editor/config/operators/error.d.ts.map +1 -1
- package/dist/components/logic-editor/config/operators/flagd.d.ts +3 -0
- package/dist/components/logic-editor/config/operators/flagd.d.ts.map +1 -0
- package/dist/components/logic-editor/config/operators/index.d.ts +2 -1
- package/dist/components/logic-editor/config/operators/index.d.ts.map +1 -1
- package/dist/components/logic-editor/config/operators/logical.d.ts.map +1 -1
- package/dist/components/logic-editor/config/operators/string-core.d.ts.map +1 -1
- package/dist/components/logic-editor/config/operators/string-transform.d.ts.map +1 -1
- package/dist/components/logic-editor/config/operators/utility.d.ts.map +1 -1
- package/dist/components/logic-editor/config/operators/validation.d.ts.map +1 -1
- package/dist/components/logic-editor/config/operators/variable.d.ts.map +1 -1
- package/dist/components/logic-editor/config/operators.types.d.ts +13 -11
- package/dist/components/logic-editor/config/operators.types.d.ts.map +1 -1
- package/dist/components/logic-editor/constants/colors.d.ts.map +1 -1
- package/dist/components/logic-editor/context/debugger/DebuggerProvider.d.ts +6 -1
- package/dist/components/logic-editor/context/debugger/DebuggerProvider.d.ts.map +1 -1
- package/dist/components/logic-editor/context/debugger/hooks.d.ts +3 -1
- package/dist/components/logic-editor/context/debugger/hooks.d.ts.map +1 -1
- package/dist/components/logic-editor/context/debugger/types.d.ts +18 -0
- package/dist/components/logic-editor/context/debugger/types.d.ts.map +1 -1
- package/dist/components/logic-editor/context/editor/EditorContext.d.ts.map +1 -1
- package/dist/components/logic-editor/context/editor/useNodeCreation.d.ts.map +1 -1
- package/dist/components/logic-editor/context/editor/useNodeEdgeInsert.d.ts +16 -0
- package/dist/components/logic-editor/context/editor/useNodeEdgeInsert.d.ts.map +1 -1
- package/dist/components/logic-editor/context/editor/useNodeOperations.d.ts.map +1 -1
- package/dist/components/logic-editor/context/index.d.ts +0 -1
- package/dist/components/logic-editor/context/index.d.ts.map +1 -1
- package/dist/components/logic-editor/context-menu/CanvasContextMenu.d.ts +1 -1
- package/dist/components/logic-editor/context-menu/CanvasContextMenu.d.ts.map +1 -1
- package/dist/components/logic-editor/context-menu/index.d.ts +0 -1
- package/dist/components/logic-editor/context-menu/index.d.ts.map +1 -1
- package/dist/components/logic-editor/context-menu/menu-helpers.d.ts +2 -1
- package/dist/components/logic-editor/context-menu/menu-helpers.d.ts.map +1 -1
- package/dist/components/logic-editor/context-menu/useContextMenuItems.d.ts.map +1 -1
- package/dist/components/logic-editor/debugger-controls/DebuggerControls.d.ts.map +1 -1
- package/dist/components/logic-editor/debugger-controls/StepTimeline.d.ts +14 -0
- package/dist/components/logic-editor/debugger-controls/StepTimeline.d.ts.map +1 -0
- package/dist/components/logic-editor/debugger-controls/index.d.ts +2 -0
- package/dist/components/logic-editor/debugger-controls/index.d.ts.map +1 -1
- package/dist/components/logic-editor/debugger-controls/keyboard-guard.d.ts +6 -0
- package/dist/components/logic-editor/debugger-controls/keyboard-guard.d.ts.map +1 -0
- package/dist/components/logic-editor/edges/EdgeOperatorPicker.d.ts.map +1 -1
- package/dist/components/logic-editor/hooks/index.d.ts +2 -3
- package/dist/components/logic-editor/hooks/index.d.ts.map +1 -1
- package/dist/components/logic-editor/hooks/useDebugClassName.d.ts +2 -0
- package/dist/components/logic-editor/hooks/useDebugClassName.d.ts.map +1 -1
- package/dist/components/logic-editor/hooks/useLogicEditor.d.ts +15 -8
- package/dist/components/logic-editor/hooks/useLogicEditor.d.ts.map +1 -1
- package/dist/components/logic-editor/hooks/useWasmEvaluator.d.ts +72 -4
- package/dist/components/logic-editor/hooks/useWasmEvaluator.d.ts.map +1 -1
- package/dist/components/logic-editor/index.d.ts +3 -4
- package/dist/components/logic-editor/index.d.ts.map +1 -1
- package/dist/components/logic-editor/nodes/DebugInfoBubble.d.ts +9 -2
- package/dist/components/logic-editor/nodes/DebugInfoBubble.d.ts.map +1 -1
- package/dist/components/logic-editor/nodes/shared/NodeDebugBubble.d.ts +2 -1
- package/dist/components/logic-editor/nodes/shared/NodeDebugBubble.d.ts.map +1 -1
- package/dist/components/logic-editor/panel-inputs/PanelRenderer.d.ts +12 -1
- package/dist/components/logic-editor/panel-inputs/PanelRenderer.d.ts.map +1 -1
- package/dist/components/logic-editor/panel-inputs/index.d.ts +1 -1
- package/dist/components/logic-editor/panel-inputs/index.d.ts.map +1 -1
- package/dist/components/logic-editor/properties-panel/ArgumentItem.d.ts.map +1 -1
- package/dist/components/logic-editor/properties-panel/ArgumentsSection.d.ts.map +1 -1
- package/dist/components/logic-editor/properties-panel/HelpSection.d.ts +8 -2
- package/dist/components/logic-editor/properties-panel/HelpSection.d.ts.map +1 -1
- package/dist/components/logic-editor/properties-panel/utils/argument-parser.d.ts +4 -0
- package/dist/components/logic-editor/properties-panel/utils/argument-parser.d.ts.map +1 -1
- package/dist/components/logic-editor/properties-panel/utils/expression-rebuilder.d.ts +6 -2
- package/dist/components/logic-editor/properties-panel/utils/expression-rebuilder.d.ts.map +1 -1
- package/dist/components/logic-editor/properties-panel/utils.d.ts.map +1 -1
- package/dist/components/logic-editor/services/argument-service.d.ts +4 -1
- package/dist/components/logic-editor/services/argument-service.d.ts.map +1 -1
- package/dist/components/logic-editor/services/index.d.ts +1 -1
- package/dist/components/logic-editor/services/index.d.ts.map +1 -1
- package/dist/components/logic-editor/services/inline-edit-service.d.ts +13 -0
- package/dist/components/logic-editor/services/inline-edit-service.d.ts.map +1 -0
- package/dist/components/logic-editor/services/node-mutation-service.d.ts +3 -2
- package/dist/components/logic-editor/services/node-mutation-service.d.ts.map +1 -1
- package/dist/components/logic-editor/services/node-transform-service.d.ts +14 -4
- package/dist/components/logic-editor/services/node-transform-service.d.ts.map +1 -1
- package/dist/components/logic-editor/types/editor.d.ts +51 -19
- package/dist/components/logic-editor/types/editor.d.ts.map +1 -1
- package/dist/components/logic-editor/types/index.d.ts +1 -1
- package/dist/components/logic-editor/types/index.d.ts.map +1 -1
- package/dist/components/logic-editor/types/jsonlogic.d.ts +1 -1
- package/dist/components/logic-editor/types/jsonlogic.d.ts.map +1 -1
- package/dist/components/logic-editor/types/trace.d.ts +16 -5
- package/dist/components/logic-editor/types/trace.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/Icon.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/converters/if-else-converter.d.ts +29 -3
- package/dist/components/logic-editor/utils/converters/if-else-converter.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/converters/index.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/converters/operator-converter.d.ts +1 -1
- package/dist/components/logic-editor/utils/converters/operator-converter.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/converters/structure-converter.d.ts +4 -0
- package/dist/components/logic-editor/utils/converters/structure-converter.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/converters/structure-paths.d.ts +52 -0
- package/dist/components/logic-editor/utils/converters/structure-paths.d.ts.map +1 -0
- package/dist/components/logic-editor/utils/converters/switch-cells.d.ts +40 -0
- package/dist/components/logic-editor/utils/converters/switch-cells.d.ts.map +1 -0
- package/dist/components/logic-editor/utils/converters/switch-converter.d.ts +1 -1
- package/dist/components/logic-editor/utils/converters/switch-converter.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/converters/variable-cells.d.ts +62 -0
- package/dist/components/logic-editor/utils/converters/variable-cells.d.ts.map +1 -0
- package/dist/components/logic-editor/utils/converters/variable-converter.d.ts +1 -3
- package/dist/components/logic-editor/utils/converters/variable-converter.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/index.d.ts +1 -1
- package/dist/components/logic-editor/utils/index.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/layout.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/menu-builder.d.ts +7 -1
- package/dist/components/logic-editor/utils/menu-builder.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/node-cloning.d.ts +9 -1
- package/dist/components/logic-editor/utils/node-cloning.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/node-deletion.d.ts +17 -0
- package/dist/components/logic-editor/utils/node-deletion.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/node-factory.d.ts +7 -3
- package/dist/components/logic-editor/utils/node-factory.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/node-updaters.d.ts +6 -0
- package/dist/components/logic-editor/utils/node-updaters.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/nodeShape.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/nodes-to-jsonlogic.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/signal.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/trace/child-matching.d.ts +47 -1
- package/dist/components/logic-editor/utils/trace/child-matching.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/trace/index.d.ts +3 -2
- package/dist/components/logic-editor/utils/trace/index.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/trace/node-creators/if-else.d.ts +1 -1
- package/dist/components/logic-editor/utils/trace/node-creators/if-else.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/trace/node-creators/index.d.ts +0 -1
- package/dist/components/logic-editor/utils/trace/node-creators/index.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/trace/node-creators/structure.d.ts +8 -1
- package/dist/components/logic-editor/utils/trace/node-creators/structure.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/trace/node-creators/switch.d.ts +9 -4
- package/dist/components/logic-editor/utils/trace/node-creators/switch.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/trace/node-creators/variable.d.ts +14 -2
- package/dist/components/logic-editor/utils/trace/node-creators/variable.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/trace/node-creators/vertical-cell.d.ts +3 -1
- package/dist/components/logic-editor/utils/trace/node-creators/vertical-cell.d.ts.map +1 -1
- package/dist/components/logic-editor/utils/trace/trace-failure.d.ts +29 -0
- package/dist/components/logic-editor/utils/trace/trace-failure.d.ts.map +1 -0
- package/dist/components/logic-editor/utils/trace/trace-ids.d.ts +6 -0
- package/dist/components/logic-editor/utils/trace/trace-ids.d.ts.map +1 -0
- package/dist/components/logic-editor/utils/trace/trace-to-nodes.d.ts +5 -1
- package/dist/components/logic-editor/utils/trace/trace-to-nodes.d.ts.map +1 -1
- package/dist/datalogic_wasm-6KTmUP2q.cjs +1125 -0
- package/dist/datalogic_wasm-DJxb6g5L.js +1124 -0
- package/dist/index.cjs +6979 -3844
- package/dist/index.js +6975 -3844
- package/dist/lib.d.ts +5 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/styles.css +440 -0
- package/package.json +26 -23
- package/dist/components/logic-editor/context/EvaluationContext.d.ts +0 -5
- package/dist/components/logic-editor/context/EvaluationContext.d.ts.map +0 -1
- package/dist/components/logic-editor/context-menu/AddArgumentMenu.d.ts +0 -24
- package/dist/components/logic-editor/context-menu/AddArgumentMenu.d.ts.map +0 -1
- package/dist/components/logic-editor/hooks/useDebugEvaluation.d.ts +0 -16
- package/dist/components/logic-editor/hooks/useDebugEvaluation.d.ts.map +0 -1
- package/dist/components/logic-editor/utils/expression-builder.d.ts +0 -16
- package/dist/components/logic-editor/utils/expression-builder.d.ts.map +0 -1
- package/dist/components/logic-editor/utils/trace/evaluation-results.d.ts +0 -15
- package/dist/components/logic-editor/utils/trace/evaluation-results.d.ts.map +0 -1
- package/dist/components/logic-editor/utils/trace/node-creators/operator.d.ts +0 -11
- package/dist/components/logic-editor/utils/trace/node-creators/operator.d.ts.map +0 -1
- package/dist/datalogic_wasm-CQhNPxpU.js +0 -1146
- 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;
|
|
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,
|
|
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;
|
|
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,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;IACrB,qGAAqG;IACrG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAW5E;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,CAkFhB"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { JsonLogicValue, CellData } from '../../types';
|
|
2
2
|
/**
|
|
3
|
-
* Rebuild expression for variable operators (var, 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;
|
|
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,
|
|
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
|
|
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 {
|
|
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;
|
|
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,
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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;
|
|
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,C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C9B,CAAC;IACF,gGAAgG;IAChG,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;IAE7B,oEAAoE;IACpE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IAEjD,sFAAsF;IACtF,IAAI,CAAC,EAAE,OAAO,CAAC;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,
|
|
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,
|
|
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"}
|
|
@@ -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;
|
|
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
|
-
|
|
12
|
+
step_id: number;
|
|
8
13
|
node_id: number;
|
|
9
14
|
context: unknown;
|
|
10
|
-
result
|
|
11
|
-
error
|
|
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
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
-
*
|
|
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,
|
|
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,
|
|
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,
|
|
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;
|
|
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,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5D,eAAO,MAAM,iBAAiB,+CAAgD,CAAC;AAC/E,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,wBAAg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