@goplasmatic/datalogic-ui 5.2.0 → 5.3.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-BWLewicv.cjs +1107 -0
- package/dist/datalogic_wasm-B_6dx9ev.js +1106 -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
|
@@ -14,5 +14,5 @@ import { ConversionContext, ConverterFn } from './types';
|
|
|
14
14
|
* ...
|
|
15
15
|
* Default → default expression
|
|
16
16
|
*/
|
|
17
|
-
export declare function convertSwitch(operator: string, switchArgs: JsonLogicValue[], context: ConversionContext, convertValue: ConverterFn): string;
|
|
17
|
+
export declare function convertSwitch(operator: string, switchArgs: JsonLogicValue[], context: ConversionContext, convertValue: ConverterFn, rawOperand?: JsonLogicValue): string;
|
|
18
18
|
//# sourceMappingURL=switch-converter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch-converter.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/converters/switch-converter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,aAAa,CAAC;AACzF,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"switch-converter.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/converters/switch-converter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,aAAa,CAAC;AACzF,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAU9D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,cAAc,EAAE,EAC5B,OAAO,EAAE,iBAAiB,EAC1B,YAAY,EAAE,WAAW,EACzB,UAAU,CAAC,EAAE,cAAc,GAC1B,MAAM,CA2MR"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { JsonLogicValue, CellData } from '../../types';
|
|
2
|
+
export declare const VARIABLE_OPERATORS: readonly ["var", "val", "exists"];
|
|
3
|
+
export type VariableOperator = (typeof VARIABLE_OPERATORS)[number];
|
|
4
|
+
export declare function isVariableOperatorName(operator: string): operator is VariableOperator;
|
|
5
|
+
export interface ParsedVar {
|
|
6
|
+
/** false when the path (or the operand as a whole) is a computed expression */
|
|
7
|
+
isStatic: boolean;
|
|
8
|
+
path: string | number;
|
|
9
|
+
defaultValue?: JsonLogicValue;
|
|
10
|
+
}
|
|
11
|
+
/** Parse the operand of {"var": ...}. */
|
|
12
|
+
export declare function parseVarOperand(raw: JsonLogicValue | undefined): ParsedVar;
|
|
13
|
+
export interface ParsedVal {
|
|
14
|
+
isStatic: boolean;
|
|
15
|
+
/** Scope jump as written (sign preserved); 0 when no scope array is present */
|
|
16
|
+
scope: number;
|
|
17
|
+
components: JsonLogicValue[];
|
|
18
|
+
}
|
|
19
|
+
/** Parse the operand of {"val": ...}: optional leading [n] scope array, then path segments. */
|
|
20
|
+
export declare function parseValOperand(raw: JsonLogicValue | undefined): ParsedVal;
|
|
21
|
+
export interface ParsedExists {
|
|
22
|
+
isStatic: boolean;
|
|
23
|
+
/** string / number = a single literal key; array = nested path components */
|
|
24
|
+
path: string | number | JsonLogicValue[];
|
|
25
|
+
}
|
|
26
|
+
/** Parse the operand of {"exists": ...}. */
|
|
27
|
+
export declare function parseExistsOperand(raw: JsonLogicValue | undefined): ParsedExists;
|
|
28
|
+
/**
|
|
29
|
+
* Normalize whatever a path cell holds into path components. Arrays are used
|
|
30
|
+
* as-is (they came from the JSON), strings are split on '.' (typed by the
|
|
31
|
+
* user), numbers are a single index segment.
|
|
32
|
+
*/
|
|
33
|
+
export declare function pathComponentsFromCellValue(value: unknown): JsonLogicValue[];
|
|
34
|
+
/** Display text for a list of path components (dot-joined, or "context" when empty). */
|
|
35
|
+
export declare function joinPathComponents(components: JsonLogicValue[]): string;
|
|
36
|
+
/** Display text for a var path cell value. */
|
|
37
|
+
export declare function varPathLabel(value: unknown): string;
|
|
38
|
+
/** Label for a val scope cell. */
|
|
39
|
+
export declare function scopeLabel(scope: number): string;
|
|
40
|
+
/** The raw operand of a stored {op: operand} expression, or undefined. */
|
|
41
|
+
export declare function rawOperandOf(expression: JsonLogicValue | undefined): JsonLogicValue | undefined;
|
|
42
|
+
export interface VariableExpressionOptions {
|
|
43
|
+
/** The operand of the node's stored expression (decides string vs array form) */
|
|
44
|
+
rawOperand?: JsonLogicValue;
|
|
45
|
+
/** Resolve a branch cell to its child's expression (serializer); undefined = use the stored operand */
|
|
46
|
+
resolveBranch?: (cell: CellData) => JsonLogicValue | undefined;
|
|
47
|
+
}
|
|
48
|
+
/** True when the cells carry the editable variable layout described above. */
|
|
49
|
+
export declare function hasVariableCells(cells: CellData[]): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Rebuild a var / val / exists expression from its cells.
|
|
52
|
+
*
|
|
53
|
+
* Returns undefined when the cells do not carry the variable layout (a dynamic
|
|
54
|
+
* path converted as a generic operator, or a foreign cell shape) so the caller
|
|
55
|
+
* can fall back to generic serialization.
|
|
56
|
+
*/
|
|
57
|
+
export declare function variableCellsToExpression(operator: string, cells: CellData[], options?: VariableExpressionOptions): JsonLogicValue | undefined;
|
|
58
|
+
/** Metadata access ({"val": [[1], "index"]}) reads the current iteration frame. */
|
|
59
|
+
export declare const METADATA_SCOPE = 1;
|
|
60
|
+
/** True when scope + components describe iteration metadata access. */
|
|
61
|
+
export declare function isMetadataAccess(scope: number, components: JsonLogicValue[]): boolean;
|
|
62
|
+
//# sourceMappingURL=variable-cells.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variable-cells.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/converters/variable-cells.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI5D,eAAO,MAAM,kBAAkB,mCAAoC,CAAC;AACpE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnE,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,IAAI,gBAAgB,CAErF;AAOD,MAAM,WAAW,SAAS;IACxB,+EAA+E;IAC/E,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,cAAc,CAAC;CAC/B;AAED,yCAAyC;AACzC,wBAAgB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,SAAS,GAAG,SAAS,CAe1E;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,cAAc,EAAE,CAAC;CAC9B;AAED,+FAA+F;AAC/F,wBAAgB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,SAAS,GAAG,SAAS,CAiB1E;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,6EAA6E;IAC7E,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,cAAc,EAAE,CAAC;CAC1C;AAED,4CAA4C;AAC5C,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,cAAc,GAAG,SAAS,GAAG,YAAY,CAShF;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,EAAE,CAK5E;AAED,wFAAwF;AACxF,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,cAAc,EAAE,GAAG,MAAM,CAGvE;AAED,8CAA8C;AAC9C,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAGnD;AAED,kCAAkC;AAClC,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGhD;AAED,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,UAAU,EAAE,cAAc,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,CAK/F;AAED,MAAM,WAAW,yBAAyB;IACxC,iFAAiF;IACjF,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,uGAAuG;IACvG,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,cAAc,GAAG,SAAS,CAAC;CAChE;AAED,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,CAE3D;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,QAAQ,EAAE,EACjB,OAAO,GAAE,yBAA8B,GACtC,cAAc,GAAG,SAAS,CAkF5B;AAED,mFAAmF;AACnF,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,uEAAuE;AACvE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,OAAO,CAMrF"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { JsonLogicValue } from '../../types';
|
|
2
2
|
import { ConversionContext, ConverterFn } from './types';
|
|
3
|
-
|
|
4
|
-
type VariableOperator = (typeof VARIABLE_OPERATORS)[number];
|
|
3
|
+
import { VariableOperator } from './variable-cells';
|
|
5
4
|
export declare function isVariableOperator(operator: string): operator is VariableOperator;
|
|
6
5
|
export declare function convertVariable(operator: VariableOperator, operands: JsonLogicValue, context: ConversionContext, convertValue: ConverterFn): string;
|
|
7
|
-
export {};
|
|
8
6
|
//# sourceMappingURL=variable-converter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variable-converter.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/converters/variable-converter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,aAAa,CAAC;AACzF,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"variable-converter.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/converters/variable-converter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,aAAa,CAAC;AACzF,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAU9D,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAC;AAG1B,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,IAAI,gBAAgB,CAEjF;AAKD,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,iBAAiB,EAC1B,YAAY,EAAE,WAAW,GACxB,MAAM,CAmGR"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { jsonLogicToNodes, type JsonLogicToNodesOptions } from './jsonlogic-to-nodes';
|
|
2
|
-
export { traceToNodes,
|
|
2
|
+
export { traceToNodes, traceIdToNodeId, type TraceConversionResult, type TraceToNodesOptions, type TraceContext, type ValueType, type NodeType, type ChildMatch, findMatchingChild, getNextUnusedChild, determineNodeType, mapInlinedChildren, } from './trace';
|
|
3
3
|
export { applyTreeLayout } from './layout';
|
|
4
4
|
export { getHiddenNodeIds } from './visibility';
|
|
5
5
|
export { isPlainObject, isJsonLogicExpression, isDataStructure, getValueType, looksLikeDate, isSimpleOperand, getValueColorClass, } from './type-helpers';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EACL,YAAY,EACZ
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EACL,YAAY,EACZ,eAAe,EACf,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,eAAe,EACf,YAAY,EACZ,aAAa,EACb,eAAe,EACf,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,cAAc,EACd,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,iBAAiB,EACjB,KAAK,yBAAyB,EAC9B,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,UAAU,EACV,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EACL,KAAK,WAAW,EAChB,uBAAuB,EACvB,cAAc,EACd,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EACf,KAAK,mBAAmB,EACxB,oBAAoB,GACrB,MAAM,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/layout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAiD,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/layout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAiD,MAAM,UAAU,CAAC;AAkBpG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAmMpE,wBAAgB,eAAe,CAC7B,KAAK,EAAE,SAAS,EAAE,EAClB,KAAK,CAAC,EAAE,SAAS,EAAE,EACnB,SAAS,GAAE,aAAsB,GAChC,SAAS,EAAE,CAsGb"}
|
|
@@ -4,13 +4,19 @@ import { OperatorCategory } from '../config/operators.types';
|
|
|
4
4
|
* Capitalize the first letter of a string.
|
|
5
5
|
*/
|
|
6
6
|
export declare function capitalizeFirst(str: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Category order for operator menus, derived from the category registry
|
|
9
|
+
* (declaration order in `config/categories.ts`). Any category that only
|
|
10
|
+
* exists in the operator registry is appended so nothing is ever hidden.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getOperatorCategoryOrder(): OperatorCategory[];
|
|
7
13
|
/**
|
|
8
14
|
* Options for building operator submenus.
|
|
9
15
|
*/
|
|
10
16
|
export interface OperatorMenuOptions {
|
|
11
17
|
/** Categories to exclude from the menu */
|
|
12
18
|
excludeCategories?: OperatorCategory[];
|
|
13
|
-
/** Maximum number of operators per category (default:
|
|
19
|
+
/** Maximum number of operators per category (default: unlimited) */
|
|
14
20
|
maxPerCategory?: number;
|
|
15
21
|
}
|
|
16
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-builder.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/menu-builder.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"menu-builder.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/menu-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,gBAAgB,EAAE,CAW7D;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,0CAA0C;IAC1C,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACvC,oEAAoE;IACpE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,EACxC,OAAO,CAAC,EAAE,mBAAmB,GAC5B,cAAc,EAAE,CAgClB"}
|
|
@@ -17,6 +17,7 @@ export interface CloneResult {
|
|
|
17
17
|
* - Generating new UUIDs for each node
|
|
18
18
|
* - Remapping parentId references within the cloned set
|
|
19
19
|
* - Remapping cell branch IDs for operator nodes
|
|
20
|
+
* - Remapping element branch IDs for structure (template) nodes
|
|
20
21
|
*
|
|
21
22
|
* @param nodes - The nodes to clone (should include the root and all descendants)
|
|
22
23
|
* @param rootId - The ID of the root node in the original set
|
|
@@ -34,11 +35,18 @@ export declare function cloneNodesWithIdMapping(nodes: LogicNode[], rootId: stri
|
|
|
34
35
|
* @returns Array of descendant nodes (not including the parent)
|
|
35
36
|
*/
|
|
36
37
|
export declare function getDescendants(nodeId: string, allNodes: LogicNode[]): LogicNode[];
|
|
38
|
+
/**
|
|
39
|
+
* Return a copy of `node` whose references to child `oldChildId` point at
|
|
40
|
+
* `newChildId` instead: operator cells (branch / condition / then) and
|
|
41
|
+
* structure elements alike. Nodes that do not reference the child are
|
|
42
|
+
* returned unchanged (same object).
|
|
43
|
+
*/
|
|
44
|
+
export declare function replaceChildReference(node: LogicNode, oldChildId: string, newChildId: string): LogicNode;
|
|
37
45
|
/**
|
|
38
46
|
* Update parent references when replacing a node in the tree.
|
|
39
47
|
*
|
|
40
48
|
* When a node is replaced (e.g., during paste), the parent's
|
|
41
|
-
* cells
|
|
49
|
+
* cells (or structure elements) need to be updated to point to the new node ID.
|
|
42
50
|
*
|
|
43
51
|
* @param nodes - The nodes to update
|
|
44
52
|
* @param parentId - The ID of the parent node to update
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-cloning.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/node-cloning.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"node-cloning.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/node-cloning.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAuC,MAAM,UAAU,CAAC;AAE/E;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,oCAAoC;IACpC,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,gCAAgC;IAChC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,SAAS,EAAE,EAClB,MAAM,EAAE,MAAM,GACb,WAAW,CAuEb;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,EAAE,GACpB,SAAS,EAAE,CAkCb;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,SAAS,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,SAAS,CA6CX;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,SAAS,EAAE,EAClB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,SAAS,EAAE,CAKb"}
|
|
@@ -12,6 +12,22 @@ export declare function deleteNodeAndDescendants(nodeId: string, nodes: LogicNod
|
|
|
12
12
|
* Get all descendant node IDs for a given node.
|
|
13
13
|
*/
|
|
14
14
|
export declare function getDescendantIds(nodeId: string, nodes: LogicNode[]): Set<string>;
|
|
15
|
+
interface ParentUpdate {
|
|
16
|
+
node: LogicNode;
|
|
17
|
+
/** old argIndex -> new argIndex for surviving children (undefined = unchanged) */
|
|
18
|
+
argIndexMap?: Map<number, number>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Update a parent node after one or more of its children were deleted.
|
|
22
|
+
* Creates fully immutable updates - no mutation of original objects.
|
|
23
|
+
* Also rebuilds the expression from remaining children.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Rebuild a parent after some set of its children was deleted. Exported as
|
|
27
|
+
* the seam `deleteNodeAndDescendants` delegates to, so callers that already
|
|
28
|
+
* know the deleted set (and tests covering multi-child removal) can reuse it.
|
|
29
|
+
*/
|
|
30
|
+
export declare function updateParentAfterChildDeletion(parentNode: LogicNode, deletedIds: Set<string>, allNodes: LogicNode[]): ParentUpdate;
|
|
15
31
|
/**
|
|
16
32
|
* Check if a node is the root node (has no parent)
|
|
17
33
|
*/
|
|
@@ -21,4 +37,5 @@ export declare function isRootNode(node: LogicNode): boolean;
|
|
|
21
37
|
* Root nodes cannot be deleted.
|
|
22
38
|
*/
|
|
23
39
|
export declare function canDeleteNode(node: LogicNode): boolean;
|
|
40
|
+
export {};
|
|
24
41
|
//# sourceMappingURL=node-deletion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-deletion.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/node-deletion.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"node-deletion.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/node-deletion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,SAAS,EAMV,MAAM,UAAU,CAAC;AA2BlB;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,EAAE,GACjB,SAAS,EAAE,CAuCb;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAmBhF;AAyDD,UAAU,YAAY;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,kFAAkF;IAClF,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED;;;;GAIG;AACH;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,SAAS,EACrB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,EACvB,QAAQ,EAAE,SAAS,EAAE,GACpB,YAAY,CAWd;AA2ID;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAEnD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAEtD"}
|
|
@@ -4,13 +4,17 @@ import { ParentInfo } from './converters/types';
|
|
|
4
4
|
export declare function createLiteralNode(value: JsonLogicValue, parentInfo?: ParentInfo): LogicNode;
|
|
5
5
|
export interface BuildVariableCellsOptions {
|
|
6
6
|
operator: 'var' | 'val' | 'exists';
|
|
7
|
-
path:
|
|
7
|
+
/** var: dot-notation path (a numeric index is kept as a number); exists: a single literal key */
|
|
8
|
+
path: string | number;
|
|
9
|
+
/** var only: an inline (simple) default value */
|
|
8
10
|
defaultValue?: JsonLogicValue;
|
|
11
|
+
/** val only: scope jump as written in the rule (sign preserved) */
|
|
9
12
|
scopeJump?: number;
|
|
10
|
-
|
|
13
|
+
/** val / exists: path components, kept as an array so keys containing '.' survive */
|
|
14
|
+
pathComponents?: JsonLogicValue[];
|
|
11
15
|
}
|
|
12
16
|
export declare function buildVariableCells(options: BuildVariableCellsOptions): CellData[];
|
|
13
|
-
export declare function createVariableNode(operator: 'var' | 'val' | 'exists', path: string, defaultValue: JsonLogicValue | undefined, originalExpr: JsonLogicValue, parentInfo?: ParentInfo, scopeJump?: number, pathComponents?:
|
|
17
|
+
export declare function createVariableNode(operator: 'var' | 'val' | 'exists', path: string | number, defaultValue: JsonLogicValue | undefined, originalExpr: JsonLogicValue, parentInfo?: ParentInfo, scopeJump?: number, pathComponents?: JsonLogicValue[]): LogicNode;
|
|
14
18
|
interface OperatorNodeOptions {
|
|
15
19
|
operator: string;
|
|
16
20
|
category: OperatorCategory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-factory.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/node-factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,SAAS,EAGT,gBAAgB,EAChB,QAAQ,EACT,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"node-factory.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/node-factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,SAAS,EAGT,gBAAgB,EAChB,QAAQ,EACT,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAYrD,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,cAAc,EACrB,UAAU,GAAE,UAAe,GAC1B,SAAS,CAgBX;AAGD,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAC;IACnC,iGAAiG;IACjG,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,iDAAiD;IACjD,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qFAAqF;IACrF,cAAc,CAAC,EAAE,cAAc,EAAE,CAAC;CACnC;AAID,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,QAAQ,EAAE,CAqEjF;AAGD,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,EAClC,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,YAAY,EAAE,cAAc,GAAG,SAAS,EACxC,YAAY,EAAE,cAAc,EAC5B,UAAU,GAAE,UAAe,EAC3B,SAAS,CAAC,EAAE,MAAM,EAClB,cAAc,CAAC,EAAE,cAAc,EAAE,GAChC,SAAS,CAsBX;AAGD,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,cAAc,CAAC;CAC5B;AAGD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,mBAAmB,EAC5B,UAAU,GAAE,UAAe,GAC1B,SAAS,CAqBX;AAGD,UAAU,WAAW;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAGD,wBAAgB,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,CAwB1D;AAGD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAO5F;AAGD,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAO,GACnF,SAAS,CAQX"}
|
|
@@ -8,4 +8,10 @@ export declare function panelValuesToNodeData(currentData: LogicNodeData, panelV
|
|
|
8
8
|
* Check if panel values have changed compared to node data
|
|
9
9
|
*/
|
|
10
10
|
export declare function havePanelValuesChanged(nodeData: LogicNodeData, panelValues: Record<string, unknown>): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Compare the editable parts of two node data objects (expression, cells and
|
|
13
|
+
* literal value). Presentation fields are ignored so a no-op panel apply does
|
|
14
|
+
* not register as an edit.
|
|
15
|
+
*/
|
|
16
|
+
export declare function nodeEditsEqual(a: LogicNodeData, b: LogicNodeData): boolean;
|
|
11
17
|
//# sourceMappingURL=node-updaters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-updaters.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/node-updaters.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"node-updaters.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/node-updaters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,aAAa,EAKd,MAAM,UAAU,CAAC;AAYlB;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,aAAa,EAC1B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,aAAa,CAmBf;AAgPD;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,aAAa,EACvB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,OAAO,CAGT;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAQ1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeShape.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/nodeShape.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"nodeShape.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/nodeShape.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG3D,MAAM,MAAM,SAAS,GACjB,KAAK,GACL,MAAM,GACN,OAAO,GACP,QAAQ,GACR,UAAU,GACV,YAAY,GACZ,OAAO,CAAC;AAIZ,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAWzF;AAED,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAErD;AAYD,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGzD;AAED,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAOzF,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAYlE;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAUxE;AASD,gFAAgF;AAChF,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAEnD;AAED,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,CAIvD;AAED,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,YAAY,GAAG,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,CAAC;AAEnG,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC,GAC9D,UAAU,CAgCZ;AAED,mFAAmF;AACnF,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAItD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodes-to-jsonlogic.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/nodes-to-jsonlogic.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"nodes-to-jsonlogic.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/nodes-to-jsonlogic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,SAAS,EAMV,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAoBzD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,cAAc,GAAG,IAAI,CAa1E;AAgQD;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,SAAS,GAAG,IAAI,CAGhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signal.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/signal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,MAAM,SAAS,GACjB,WAAW,GACX,YAAY,GACZ,WAAW,GACX,QAAQ,GACR,QAAQ,GACR,YAAY,GACZ,MAAM,GACN,UAAU,GACV,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"signal.d.ts","sourceRoot":"","sources":["../../../../src/components/logic-editor/utils/signal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,MAAM,SAAS,GACjB,WAAW,GACX,YAAY,GACZ,WAAW,GACX,QAAQ,GACR,QAAQ,GACR,YAAY,GACZ,MAAM,GACN,UAAU,GACV,MAAM,CAAC;AAkBX,mFAAmF;AACnF,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,SAAS,CAWX;AAED,iDAAiD;AACjD,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,eAAe,CAAC,WAAW,CAAC,GAAG,SAAS,CASnF;AAED,6DAA6D;AAC7D,wBAAgB,SAAS,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM,CAEhD"}
|
|
@@ -1,13 +1,59 @@
|
|
|
1
1
|
import { JsonLogicValue } from '../../types';
|
|
2
2
|
import { ExpressionNode } from '../../types/trace';
|
|
3
3
|
import { ChildMatch } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Normalize a JSONLogic expression toward the compiler's canonical shape so
|
|
6
|
+
* the original rule and the engine's trace expression compare equal:
|
|
7
|
+
* - `{"op": [x]}` unwraps to `{"op": x}` (single-arg operators)
|
|
8
|
+
* - `?:` becomes `if`, `match` becomes `switch`
|
|
9
|
+
* - static `var` / `val` paths collapse to the compiled dotted / scoped form
|
|
10
|
+
* (including numeric paths, which the engine emits as strings)
|
|
11
|
+
* - `{"throw": {"type": t}}` becomes `{"throw": t}`
|
|
12
|
+
* Applied to both sides before comparison, so the direction only matters for
|
|
13
|
+
* the shapes the engine actually rewrites.
|
|
14
|
+
*/
|
|
15
|
+
export declare function normalizeExpression(expr: unknown): unknown;
|
|
16
|
+
/**
|
|
17
|
+
* Returned by [`parseTraceExpression`] when the expression string is not
|
|
18
|
+
* JSON. A distinct sentinel rather than null, which is a value the string
|
|
19
|
+
* `"null"` legitimately parses to.
|
|
20
|
+
*/
|
|
21
|
+
export declare const UNPARSEABLE: unique symbol;
|
|
22
|
+
/**
|
|
23
|
+
* Parse a trace child's expression string. The engine does not escape quotes
|
|
24
|
+
* inside keys or paths, so a rare malformed string yields [`UNPARSEABLE`]
|
|
25
|
+
* rather than throwing.
|
|
26
|
+
*/
|
|
27
|
+
export declare function parseTraceExpression(child: ExpressionNode): unknown | typeof UNPARSEABLE;
|
|
28
|
+
/**
|
|
29
|
+
* Whether an operand could own a node in the engine's expression tree. The
|
|
30
|
+
* tree keeps operators, arrays that contain operators, and (in templating
|
|
31
|
+
* mode) nested template structures; plain literals never appear.
|
|
32
|
+
*/
|
|
33
|
+
export declare function mayHaveTraceNode(value: unknown, templating: boolean): boolean;
|
|
4
34
|
/**
|
|
5
35
|
* Find the matching child node for an operand by comparing expressions.
|
|
6
|
-
* Uses deep equality
|
|
36
|
+
* Uses deep equality (key-order insensitive) on the canonicalized forms so the
|
|
37
|
+
* original rule matches the engine's rewritten expression string.
|
|
7
38
|
*/
|
|
8
39
|
export declare function findMatchingChild(operand: JsonLogicValue, children: ExpressionNode[], usedIndices: Set<number>): ChildMatch | null;
|
|
9
40
|
/**
|
|
10
41
|
* Get the next unused child (for positional matching when exact matching fails)
|
|
11
42
|
*/
|
|
12
43
|
export declare function getNextUnusedChild(children: ExpressionNode[], usedIndices: Set<number>): ChildMatch | null;
|
|
44
|
+
/**
|
|
45
|
+
* Resolve every operand of an operator to its trace child in three passes:
|
|
46
|
+
* 1. exact (canonicalized) match,
|
|
47
|
+
* 2. loose match on expression kind (same operator / array / structure) for
|
|
48
|
+
* operands the engine partially rewrote, e.g. constant-folded arguments,
|
|
49
|
+
* 3. positional, only when the leftover operands and children pair up 1:1.
|
|
50
|
+
* Returns one entry per operand (null when the operand has no trace node,
|
|
51
|
+
* e.g. a literal or a fully constant-folded sub-expression).
|
|
52
|
+
*/
|
|
53
|
+
export declare function matchOperandsToChildren(operands: JsonLogicValue[], children: ExpressionNode[], templating: boolean): (ChildMatch | null)[];
|
|
54
|
+
/**
|
|
55
|
+
* Trace children that no operand claimed. Their steps still need a home, so
|
|
56
|
+
* callers fold them into the parent visual node.
|
|
57
|
+
*/
|
|
58
|
+
export declare function unmatchedChildren(children: ExpressionNode[], matches: (ChildMatch | null)[]): ExpressionNode[];
|
|
13
59
|
//# sourceMappingURL=child-matching.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"child-matching.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/trace/child-matching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"child-matching.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/trace/child-matching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAwD1C;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAuC1D;AAwBD;;;;GAIG;AACH,eAAO,MAAM,WAAW,eAAyC,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,GAAG,OAAO,WAAW,CAMxF;AAkBD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,GAAG,OAAO,CAU7E;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,cAAc,EAAE,EAC1B,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,GACvB,UAAU,GAAG,IAAI,CAiBnB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,cAAc,EAAE,EAC1B,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,GACvB,UAAU,GAAG,IAAI,CAOnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,cAAc,EAAE,EAC1B,QAAQ,EAAE,cAAc,EAAE,EAC1B,UAAU,EAAE,OAAO,GAClB,CAAC,UAAU,GAAG,IAAI,CAAC,EAAE,CA6CvB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,cAAc,EAAE,EAC1B,OAAO,EAAE,CAAC,UAAU,GAAG,IAAI,CAAC,EAAE,GAC7B,cAAc,EAAE,CAGlB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { traceToNodes } from './trace-to-nodes';
|
|
2
|
-
export {
|
|
2
|
+
export { traceIdToNodeId } from './trace-ids';
|
|
3
|
+
export { isCompileFailedTrace, getTraceFailure, formatTraceFailure, traceFailureType, resolveFailedNodeIds, type TraceFailure, } from './trace-failure';
|
|
3
4
|
export type { TraceConversionResult, TraceToNodesOptions, TraceContext, ValueType, NodeType, ChildMatch, } from './types';
|
|
4
|
-
export { findMatchingChild, getNextUnusedChild } from './child-matching';
|
|
5
|
+
export { findMatchingChild, getNextUnusedChild, matchOperandsToChildren, normalizeExpression, mayHaveTraceNode, } from './child-matching';
|
|
5
6
|
export { determineNodeType } from './node-type';
|
|
6
7
|
export { mapInlinedChildren } from './inline-mapping';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/trace/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/trace/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,YAAY,GAClB,MAAM,iBAAiB,CAAC;AAGzB,YAAY,EACV,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,UAAU,GACX,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { TraceContext } from '../types';
|
|
|
5
5
|
type ProcessExpressionNodeFn = (exprNode: ExpressionNode, context: TraceContext, parentInfo: ParentInfo, originalExpression?: JsonLogicValue) => string;
|
|
6
6
|
type CreateFallbackNodeFn = (nodeId: string, value: JsonLogicValue, context: TraceContext, parentInfo: ParentInfo) => void;
|
|
7
7
|
/**
|
|
8
|
-
* Create a CHAIN of decision-diamond nodes for an if/then/else from trace data
|
|
8
|
+
* Create a CHAIN of decision-diamond nodes for an if/then/else from trace data:
|
|
9
9
|
* one diamond per condition (when / then / else), the else input chaining into
|
|
10
10
|
* the next diamond for each else-if. The first diamond keeps the trace node id so
|
|
11
11
|
* its debug mapping is preserved.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"if-else.d.ts","sourceRoot":"","sources":["../../../../../../src/components/logic-editor/utils/trace/node-creators/if-else.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,cAAc,EAGf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"if-else.d.ts","sourceRoot":"","sources":["../../../../../../src/components/logic-editor/utils/trace/node-creators/if-else.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,cAAc,EAGf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,UAAU,CAAC;AASzD,KAAK,uBAAuB,GAAG,CAC7B,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,EACtB,kBAAkB,CAAC,EAAE,cAAc,KAChC,MAAM,CAAC;AAEZ,KAAK,oBAAoB,GAAG,CAC1B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,KACnB,IAAI,CAAC;AAEV;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,cAAc,EAC1B,QAAQ,EAAE,cAAc,EAAE,EAC1B,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,EACtB,qBAAqB,EAAE,uBAAuB,EAC9C,kBAAkB,EAAE,oBAAoB,GACvC,IAAI,CAyHN"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { createLiteralNodeFromTrace } from './literal';
|
|
2
2
|
export { createVariableNodeFromTrace } from './variable';
|
|
3
|
-
export { createOperatorNodeFromTrace } from './operator';
|
|
4
3
|
export { createVerticalCellNodeFromTrace } from './vertical-cell';
|
|
5
4
|
export { createIfElseNodeFromTrace } from './if-else';
|
|
6
5
|
export { createSwitchNodeFromTrace } from './switch';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/logic-editor/utils/trace/node-creators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/logic-editor/utils/trace/node-creators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -5,7 +5,14 @@ import { TraceContext } from '../types';
|
|
|
5
5
|
type ProcessExpressionNodeFn = (exprNode: ExpressionNode, context: TraceContext, parentInfo: ParentInfo, originalExpression?: JsonLogicValue) => string;
|
|
6
6
|
type CreateFallbackNodeFn = (nodeId: string, value: JsonLogicValue, context: TraceContext, parentInfo: ParentInfo) => void;
|
|
7
7
|
/**
|
|
8
|
-
* Create a structure node for data structures with embedded JSONLogic from trace data
|
|
8
|
+
* Create a structure node for data structures with embedded JSONLogic from trace data.
|
|
9
|
+
*
|
|
10
|
+
* Mirrors the static structure converter: the structure renders as one node
|
|
11
|
+
* whose JSONLogic expressions (at any nesting depth) become child nodes. The
|
|
12
|
+
* engine tree, however, gives every nested object / array its own node, so
|
|
13
|
+
* nested structures are matched to their trace child, folded onto this node
|
|
14
|
+
* (their steps highlight the structure), and their expressions are matched
|
|
15
|
+
* against that child's children.
|
|
9
16
|
*/
|
|
10
17
|
export declare function createStructureNodeFromTrace(nodeId: string, expression: JsonLogicValue, children: ExpressionNode[], context: TraceContext, parentInfo: ParentInfo, processExpressionNode: ProcessExpressionNodeFn, createFallbackNode: CreateFallbackNodeFn): void;
|
|
11
18
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structure.d.ts","sourceRoot":"","sources":["../../../../../../src/components/logic-editor/utils/trace/node-creators/structure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,cAAc,EAGf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"structure.d.ts","sourceRoot":"","sources":["../../../../../../src/components/logic-editor/utils/trace/node-creators/structure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,cAAc,EAGf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,UAAU,CAAC;AAUzD,KAAK,uBAAuB,GAAG,CAC7B,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,EACtB,kBAAkB,CAAC,EAAE,cAAc,KAChC,MAAM,CAAC;AAEZ,KAAK,oBAAoB,GAAG,CAC1B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,KACnB,IAAI,CAAC;AAGV;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,cAAc,EAC1B,QAAQ,EAAE,cAAc,EAAE,EAC1B,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,EACtB,qBAAqB,EAAE,uBAAuB,EAC9C,kBAAkB,EAAE,oBAAoB,GACvC,IAAI,CA+IN"}
|
|
@@ -9,12 +9,17 @@ type CreateFallbackNodeFn = (nodeId: string, value: JsonLogicValue, context: Tra
|
|
|
9
9
|
*
|
|
10
10
|
* JSON structure: {"switch": [discriminant, [[case1, result1], ...], default]}
|
|
11
11
|
*
|
|
12
|
+
* The engine nests the case expressions two levels deep in its tree
|
|
13
|
+
* (cases array -> pair array -> case / result), so the pair wrappers are
|
|
14
|
+
* flattened here and folded onto the switch node; only the case / result
|
|
15
|
+
* expressions become child nodes.
|
|
16
|
+
*
|
|
12
17
|
* Visual layout mirrors if/else but with case/then pairs:
|
|
13
|
-
* Match
|
|
14
|
-
* Case
|
|
15
|
-
* Then
|
|
18
|
+
* Match -> discriminant
|
|
19
|
+
* Case -> case value (inline or branch)
|
|
20
|
+
* Then -> result
|
|
16
21
|
* ...
|
|
17
|
-
* Default
|
|
22
|
+
* Default -> default value
|
|
18
23
|
*/
|
|
19
24
|
export declare function createSwitchNodeFromTrace(nodeId: string, expression: JsonLogicValue, children: ExpressionNode[], context: TraceContext, parentInfo: ParentInfo, processExpressionNode: ProcessExpressionNodeFn, createFallbackNode: CreateFallbackNodeFn): void;
|
|
20
25
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../../../src/components/logic-editor/utils/trace/node-creators/switch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,cAAc,EAGf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../../../src/components/logic-editor/utils/trace/node-creators/switch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,cAAc,EAGf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,UAAU,CAAC;AASzD,KAAK,uBAAuB,GAAG,CAC7B,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,EACtB,kBAAkB,CAAC,EAAE,cAAc,KAChC,MAAM,CAAC;AAEZ,KAAK,oBAAoB,GAAG,CAC1B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,KACnB,IAAI,CAAC;AAEV;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,cAAc,EAC1B,QAAQ,EAAE,cAAc,EAAE,EAC1B,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,EACtB,qBAAqB,EAAE,uBAAuB,EAC9C,kBAAkB,EAAE,oBAAoB,GACvC,IAAI,CAuMN"}
|
|
@@ -2,8 +2,20 @@ import { JsonLogicValue } from '../../../types';
|
|
|
2
2
|
import { ExpressionNode } from '../../../types/trace';
|
|
3
3
|
import { ParentInfo } from '../../converters/types';
|
|
4
4
|
import { TraceContext } from '../types';
|
|
5
|
+
import { VariableOperator } from '../../converters/variable-cells';
|
|
6
|
+
type ProcessExpressionNodeFn = (exprNode: ExpressionNode, context: TraceContext, parentInfo: ParentInfo, originalExpression?: JsonLogicValue) => string;
|
|
7
|
+
type CreateFallbackNodeFn = (nodeId: string, value: JsonLogicValue, context: TraceContext, parentInfo: ParentInfo) => void;
|
|
5
8
|
/**
|
|
6
|
-
*
|
|
9
|
+
* Whether a var / val / exists expression has a static path (renderable as
|
|
10
|
+
* editable cells). Computed paths are wired as ordinary operator arguments by
|
|
11
|
+
* the caller instead.
|
|
7
12
|
*/
|
|
8
|
-
export declare function
|
|
13
|
+
export declare function isStaticVariableExpression(operator: VariableOperator, operands: JsonLogicValue): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Create a variable node from trace data. Mirrors the static variable
|
|
16
|
+
* converter: the path renders as editable cells, and a complex default value
|
|
17
|
+
* (an expression) becomes a wired child, matched to its trace child.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createVariableNodeFromTrace(nodeId: string, expression: JsonLogicValue, children: ExpressionNode[], context: TraceContext, parentInfo: ParentInfo, processExpressionNode?: ProcessExpressionNodeFn, createFallbackNode?: CreateFallbackNodeFn): void;
|
|
20
|
+
export {};
|
|
9
21
|
//# sourceMappingURL=variable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variable.d.ts","sourceRoot":"","sources":["../../../../../../src/components/logic-editor/utils/trace/node-creators/variable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,cAAc,
|
|
1
|
+
{"version":3,"file":"variable.d.ts","sourceRoot":"","sources":["../../../../../../src/components/logic-editor/utils/trace/node-creators/variable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,cAAc,EAGf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAQ7C,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,iCAAiC,CAAC;AAKzC,KAAK,uBAAuB,GAAG,CAC7B,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,EACtB,kBAAkB,CAAC,EAAE,cAAc,KAChC,MAAM,CAAC;AAEZ,KAAK,oBAAoB,GAAG,CAC1B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,KACnB,IAAI,CAAC;AAEV;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,cAAc,GAAG,OAAO,CAIxG;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,cAAc,EAC1B,QAAQ,EAAE,cAAc,EAAE,EAC1B,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,EACtB,qBAAqB,CAAC,EAAE,uBAAuB,EAC/C,kBAAkB,CAAC,EAAE,oBAAoB,GACxC,IAAI,CAyGN"}
|
|
@@ -5,7 +5,9 @@ import { TraceContext } from '../types';
|
|
|
5
5
|
type ProcessExpressionNodeFn = (exprNode: ExpressionNode, context: TraceContext, parentInfo: ParentInfo, originalExpression?: JsonLogicValue) => string;
|
|
6
6
|
type CreateFallbackNodeFn = (nodeId: string, value: JsonLogicValue, context: TraceContext, parentInfo: ParentInfo) => void;
|
|
7
7
|
/**
|
|
8
|
-
* Create a
|
|
8
|
+
* Create a cells-based operator node (any arity) from trace data. Mirrors the
|
|
9
|
+
* static converter's convertOperator: simple literals and collapsible static
|
|
10
|
+
* var reads render as inline cells, everything else as a wired child.
|
|
9
11
|
*/
|
|
10
12
|
export declare function createVerticalCellNodeFromTrace(nodeId: string, expression: JsonLogicValue, children: ExpressionNode[], context: TraceContext, parentInfo: ParentInfo, processExpressionNode: ProcessExpressionNodeFn, createFallbackNode: CreateFallbackNodeFn): void;
|
|
11
13
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vertical-cell.d.ts","sourceRoot":"","sources":["../../../../../../src/components/logic-editor/utils/trace/node-creators/vertical-cell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,cAAc,EAGf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAc7C,KAAK,uBAAuB,GAAG,CAC7B,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,EACtB,kBAAkB,CAAC,EAAE,cAAc,KAChC,MAAM,CAAC;AAEZ,KAAK,oBAAoB,GAAG,CAC1B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,KACnB,IAAI,CAAC;AAEV
|
|
1
|
+
{"version":3,"file":"vertical-cell.d.ts","sourceRoot":"","sources":["../../../../../../src/components/logic-editor/utils/trace/node-creators/vertical-cell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,cAAc,EAGf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAc7C,KAAK,uBAAuB,GAAG,CAC7B,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,EACtB,kBAAkB,CAAC,EAAE,cAAc,KAChC,MAAM,CAAC;AAEZ,KAAK,oBAAoB,GAAG,CAC1B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,KACnB,IAAI,CAAC;AAEV;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,cAAc,EAC1B,QAAQ,EAAE,cAAc,EAAE,EAC1B,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,EACtB,qBAAqB,EAAE,uBAAuB,EAC9C,kBAAkB,EAAE,oBAAoB,GACvC,IAAI,CA6GN"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TracedResult, StructuredError } from '../../types/trace';
|
|
2
|
+
/**
|
|
3
|
+
* A trace-level failure: the structured error when the engine emitted one,
|
|
4
|
+
* otherwise the plain message.
|
|
5
|
+
*/
|
|
6
|
+
export type TraceFailure = StructuredError | string;
|
|
7
|
+
/**
|
|
8
|
+
* True when the engine could not build an expression tree at all (parse
|
|
9
|
+
* error, unknown operator, ...): the envelope carries the placeholder tree
|
|
10
|
+
* `{ id: 0, expression: '', children: [] }` and no steps.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isCompileFailedTrace(trace: TracedResult): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The failure reported by a trace envelope, or undefined when evaluation
|
|
15
|
+
* succeeded. Prefers `structured_error` (machine-readable, with the
|
|
16
|
+
* `node_ids` breadcrumb) over the flat `error` message.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getTraceFailure(trace: TracedResult): TraceFailure | undefined;
|
|
19
|
+
/** Human-readable message for a trace failure. */
|
|
20
|
+
export declare function formatTraceFailure(failure: TraceFailure): string;
|
|
21
|
+
/** Machine-readable kind of a trace failure (undefined for plain messages). */
|
|
22
|
+
export declare function traceFailureType(failure: TraceFailure): string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Visual node ids on the engine's failure breadcrumb (`structured_error.node_ids`,
|
|
25
|
+
* innermost first), resolved through the trace node map. Ids the map does not
|
|
26
|
+
* know are dropped. Returns an empty set when there is no breadcrumb.
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveFailedNodeIds(trace: TracedResult, traceNodeMap: Map<string, string>): Set<string>;
|
|
29
|
+
//# sourceMappingURL=trace-failure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace-failure.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/trace/trace-failure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGvE;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,MAAM,CAAC;AAEpD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAIjE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,GAAG,SAAS,CAI7E;AAED,kDAAkD;AAClD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAEhE;AAED,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAE1E;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,YAAY,EACnB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,GAAG,CAAC,MAAM,CAAC,CASb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace-ids.d.ts","sourceRoot":"","sources":["../../../../../src/components/logic-editor/utils/trace/trace-ids.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAElD"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { TracedResult } from '../../types/trace';
|
|
2
2
|
import { TraceConversionResult, TraceToNodesOptions } from './types';
|
|
3
3
|
/**
|
|
4
|
-
* Main conversion function: Convert trace data to visual nodes and edges
|
|
4
|
+
* Main conversion function: Convert trace data to visual nodes and edges.
|
|
5
|
+
*
|
|
6
|
+
* A compile-failed envelope (placeholder tree with an empty expression) has
|
|
7
|
+
* nothing to render and yields the empty result; callers fall back to the
|
|
8
|
+
* static converter and surface `trace.structured_error` / `trace.error`.
|
|
5
9
|
*/
|
|
6
10
|
export declare function traceToNodes(trace: TracedResult, options?: TraceToNodesOptions): TraceConversionResult;
|
|
7
11
|
//# sourceMappingURL=trace-to-nodes.d.ts.map
|