@goplasmatic/datalogic-ui 4.0.19 → 4.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/datalogic_wasm-CCIw5iCk.js +380 -0
- package/dist/datalogic_wasm-Dv8WyX8m.cjs +383 -0
- package/dist/index.cjs +17192 -19117
- package/dist/index.d.ts +0 -310
- package/dist/index.js +17604 -22706
- package/dist/styles.css +1 -0
- package/package.json +15 -17
- package/dist/datalogic_wasm-CJRUeom8.cjs +0 -470
- package/dist/datalogic_wasm-dEsk1ML-.js +0 -373
package/dist/index.d.ts
CHANGED
|
@@ -1,311 +1 @@
|
|
|
1
|
-
import { Edge } from '@xyflow/react';
|
|
2
|
-
import { JSX } from 'react/jsx-runtime';
|
|
3
|
-
import { Node as Node_2 } from '@xyflow/react';
|
|
4
|
-
|
|
5
|
-
export declare function applyTreeLayout(nodes: LogicNode[], edges?: LogicEdge[]): LogicNode[];
|
|
6
|
-
|
|
7
|
-
declare interface ArgSpec {
|
|
8
|
-
name: string;
|
|
9
|
-
label: string;
|
|
10
|
-
description?: string;
|
|
11
|
-
type?: ArgType;
|
|
12
|
-
required?: boolean;
|
|
13
|
-
repeatable?: boolean;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare interface ArgSummary {
|
|
17
|
-
icon: IconName;
|
|
18
|
-
label: string;
|
|
19
|
-
valueType: 'string' | 'number' | 'boolean' | 'null' | 'array' | 'date' | 'expression';
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
declare type ArgType = 'any' | 'number' | 'string' | 'boolean' | 'array' | 'object' | 'expression' | 'path' | 'datetime' | 'duration';
|
|
23
|
-
|
|
24
|
-
declare interface AritySpec {
|
|
25
|
-
type: ArityType;
|
|
26
|
-
min?: number;
|
|
27
|
-
max?: number;
|
|
28
|
-
args?: ArgSpec[];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
declare type ArityType = 'nullary' | 'unary' | 'binary' | 'ternary' | 'nary' | 'variadic' | 'chainable' | 'range' | 'special';
|
|
32
|
-
|
|
33
|
-
declare interface BaseNodeData extends Record<string, unknown> {
|
|
34
|
-
type: VisualNodeType;
|
|
35
|
-
parentId?: string;
|
|
36
|
-
argIndex?: number;
|
|
37
|
-
branchType?: 'yes' | 'no';
|
|
38
|
-
expression?: JsonLogicValue;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export declare const CATEGORY_COLORS: Record<NodeCategory, string>;
|
|
42
|
-
|
|
43
|
-
declare interface CellData {
|
|
44
|
-
type: 'inline' | 'branch' | 'editable';
|
|
45
|
-
rowLabel?: string;
|
|
46
|
-
label?: string;
|
|
47
|
-
icon?: IconName;
|
|
48
|
-
branchId?: string;
|
|
49
|
-
index: number;
|
|
50
|
-
summary?: ArgSummary;
|
|
51
|
-
conditionBranchId?: string;
|
|
52
|
-
thenBranchId?: string;
|
|
53
|
-
conditionText?: string;
|
|
54
|
-
thenText?: string;
|
|
55
|
-
fieldId?: string;
|
|
56
|
-
fieldType?: 'text' | 'number' | 'select';
|
|
57
|
-
value?: unknown;
|
|
58
|
-
placeholder?: string;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Iterator context variable
|
|
63
|
-
*/
|
|
64
|
-
declare interface ContextVariable {
|
|
65
|
-
name: string;
|
|
66
|
-
label: string;
|
|
67
|
-
description: string;
|
|
68
|
-
accessor: 'var' | 'val';
|
|
69
|
-
example: string;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
declare interface ConversionResult {
|
|
73
|
-
nodes: LogicNode[];
|
|
74
|
-
edges: LogicEdge[];
|
|
75
|
-
rootId: string | null;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export declare function DataLogicEditor({ value, onChange, data, theme: themeProp, className, preserveStructure, onPreserveStructureChange, editable, }: DataLogicEditorProps): JSX.Element;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Props for the DataLogicEditor component (public API)
|
|
82
|
-
*/
|
|
83
|
-
export declare interface DataLogicEditorProps {
|
|
84
|
-
/** JSONLogic expression to render */
|
|
85
|
-
value: JsonLogicValue | null;
|
|
86
|
-
/** Callback when expression changes (only when editable is true) */
|
|
87
|
-
onChange?: (expr: JsonLogicValue | null) => void;
|
|
88
|
-
/** Data context for evaluation. When provided, debugger controls become available. */
|
|
89
|
-
data?: unknown;
|
|
90
|
-
/** Theme override - 'light' or 'dark'. If not provided, uses system preference */
|
|
91
|
-
theme?: 'light' | 'dark';
|
|
92
|
-
/** Additional CSS class */
|
|
93
|
-
className?: string;
|
|
94
|
-
/**
|
|
95
|
-
* Enable structure preserve mode for JSON templates with embedded JSONLogic.
|
|
96
|
-
* When true, multi-key objects and arrays are treated as data structures
|
|
97
|
-
* with embedded JSONLogic expressions, rather than invalid JSONLogic.
|
|
98
|
-
*/
|
|
99
|
-
preserveStructure?: boolean;
|
|
100
|
-
/** Callback when preserve structure changes (from toolbar checkbox) */
|
|
101
|
-
onPreserveStructureChange?: (value: boolean) => void;
|
|
102
|
-
/**
|
|
103
|
-
* Enable editing: node selection, properties panel, context menus, undo/redo.
|
|
104
|
-
* Default: false
|
|
105
|
-
*/
|
|
106
|
-
editable?: boolean;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export declare type EvaluationResultsMap = Map<string, NodeEvaluationResult>;
|
|
110
|
-
|
|
111
|
-
declare type IconName = 'scale' | 'diamond' | 'calculator' | 'repeat' | 'type' | 'box' | 'git-merge' | 'git-branch' | 'text' | 'hash' | 'toggle-left' | 'toggle-right' | 'check' | 'x' | 'ban' | 'list' | 'calendar' | 'cog' | 'database' | 'boxes' | 'circle-help' | 'circle-x' | 'git-commit-horizontal' | 'search' | 'divide' | 'quote' | 'braces' | 'binary' | 'layers' | 'clock' | 'alert-circle' | 'arrow-up' | 'tag';
|
|
112
|
-
|
|
113
|
-
declare type JsonLogicExpression = {
|
|
114
|
-
[operator: string]: JsonLogicValue | JsonLogicValue[];
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
declare type JsonLogicPrimitive = string | number | boolean | null;
|
|
118
|
-
|
|
119
|
-
export declare function jsonLogicToNodes(expr: JsonLogicValue | null, options?: JsonLogicToNodesOptions): ConversionResult;
|
|
120
|
-
|
|
121
|
-
declare interface JsonLogicToNodesOptions {
|
|
122
|
-
/** Enable structure preserve mode for JSON templates with embedded JSONLogic */
|
|
123
|
-
preserveStructure?: boolean;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export declare type JsonLogicValue = JsonLogicPrimitive | JsonLogicPrimitive[] | JsonLogicExpression | JsonLogicValue[];
|
|
127
|
-
|
|
128
|
-
export declare interface LiteralNodeData extends BaseNodeData {
|
|
129
|
-
type: 'literal';
|
|
130
|
-
value: JsonLogicValue;
|
|
131
|
-
valueType: 'string' | 'number' | 'boolean' | 'null' | 'array';
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export declare type LogicEdge = Edge;
|
|
135
|
-
|
|
136
|
-
export declare type LogicNode = Node_2<LogicNodeData>;
|
|
137
|
-
|
|
138
|
-
export declare type LogicNodeData = OperatorNodeData | LiteralNodeData | StructureNodeData;
|
|
139
|
-
|
|
140
|
-
declare type NodeCategory = OperatorCategory | 'literal';
|
|
141
|
-
|
|
142
|
-
export declare interface NodeEvaluationResult {
|
|
143
|
-
value: unknown;
|
|
144
|
-
error: string | null;
|
|
145
|
-
type: 'boolean' | 'number' | 'string' | 'null' | 'array' | 'object' | 'undefined';
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
declare type NodeType = 'operator' | 'variable' | 'literal' | 'decision' | 'vertical' | 'iterator' | 'structure';
|
|
149
|
-
|
|
150
|
-
declare interface Operator {
|
|
151
|
-
name: string;
|
|
152
|
-
label: string;
|
|
153
|
-
category: OperatorCategory;
|
|
154
|
-
description: string;
|
|
155
|
-
arity: AritySpec;
|
|
156
|
-
help: OperatorHelp;
|
|
157
|
-
ui?: OperatorUIHints;
|
|
158
|
-
panel?: PanelConfig;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Operator Configuration Types
|
|
163
|
-
*
|
|
164
|
-
* This file defines the TypeScript interfaces for the operator configuration
|
|
165
|
-
* that serves as the single source of truth for all operator documentation
|
|
166
|
-
* and UI rendering.
|
|
167
|
-
*/
|
|
168
|
-
export declare type OperatorCategory = 'variable' | 'comparison' | 'logical' | 'arithmetic' | 'control' | 'string' | 'array' | 'datetime' | 'validation' | 'error' | 'utility';
|
|
169
|
-
|
|
170
|
-
declare interface OperatorExample {
|
|
171
|
-
title: string;
|
|
172
|
-
rule: unknown;
|
|
173
|
-
data?: unknown;
|
|
174
|
-
result?: unknown;
|
|
175
|
-
error?: {
|
|
176
|
-
type: string;
|
|
177
|
-
};
|
|
178
|
-
note?: string;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
declare interface OperatorHelp {
|
|
182
|
-
summary: string;
|
|
183
|
-
details?: string;
|
|
184
|
-
returnType: ReturnType_2;
|
|
185
|
-
examples: OperatorExample[];
|
|
186
|
-
notes?: string[];
|
|
187
|
-
seeAlso?: string[];
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export declare interface OperatorNodeData extends BaseNodeData {
|
|
191
|
-
type: 'operator';
|
|
192
|
-
operator: string;
|
|
193
|
-
category: OperatorCategory;
|
|
194
|
-
label: string;
|
|
195
|
-
icon: IconName;
|
|
196
|
-
cells: CellData[];
|
|
197
|
-
collapsed?: boolean;
|
|
198
|
-
expressionText?: string;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Combined map of all operators by name
|
|
203
|
-
*/
|
|
204
|
-
export declare const OPERATORS: Record<string, Operator>;
|
|
205
|
-
|
|
206
|
-
declare interface OperatorUIHints {
|
|
207
|
-
icon?: string;
|
|
208
|
-
shortLabel?: string;
|
|
209
|
-
nodeType?: NodeType;
|
|
210
|
-
inlineEditable?: boolean;
|
|
211
|
-
showArgLabels?: boolean;
|
|
212
|
-
collapsible?: boolean;
|
|
213
|
-
scopeJump?: boolean;
|
|
214
|
-
metadata?: boolean;
|
|
215
|
-
datetimeProps?: boolean;
|
|
216
|
-
iteratorContext?: boolean;
|
|
217
|
-
addArgumentLabel?: string;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Complete panel configuration
|
|
222
|
-
*/
|
|
223
|
-
declare interface PanelConfig {
|
|
224
|
-
sections: PanelSection[];
|
|
225
|
-
contextVariables?: ContextVariable[];
|
|
226
|
-
chainable?: boolean;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Panel field configuration
|
|
231
|
-
*/
|
|
232
|
-
declare interface PanelField {
|
|
233
|
-
id: string;
|
|
234
|
-
label: string;
|
|
235
|
-
inputType: PanelInputType;
|
|
236
|
-
helpText?: string;
|
|
237
|
-
placeholder?: string;
|
|
238
|
-
required?: boolean;
|
|
239
|
-
defaultValue?: unknown;
|
|
240
|
-
options?: SelectOption[];
|
|
241
|
-
showWhen?: VisibilityCondition[];
|
|
242
|
-
min?: number;
|
|
243
|
-
max?: number;
|
|
244
|
-
repeatable?: boolean;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* Input widget types for panel fields
|
|
249
|
-
*/
|
|
250
|
-
declare type PanelInputType = 'text' | 'textarea' | 'number' | 'boolean' | 'select' | 'path' | 'pathArray' | 'expression' | 'json';
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Panel section grouping
|
|
254
|
-
*/
|
|
255
|
-
declare interface PanelSection {
|
|
256
|
-
id: string;
|
|
257
|
-
title?: string;
|
|
258
|
-
fields: PanelField[];
|
|
259
|
-
defaultCollapsed?: boolean;
|
|
260
|
-
showWhen?: VisibilityCondition[];
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
declare type ReturnType_2 = 'any' | 'number' | 'string' | 'boolean' | 'array' | 'object' | 'null' | 'datetime' | 'duration' | 'number | string' | 'same' | 'never';
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* Select dropdown option
|
|
267
|
-
*/
|
|
268
|
-
declare interface SelectOption {
|
|
269
|
-
value: string | number | boolean;
|
|
270
|
-
label: string;
|
|
271
|
-
description?: string;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
declare interface StructureElement {
|
|
275
|
-
type: 'inline' | 'expression';
|
|
276
|
-
path: string[];
|
|
277
|
-
key?: string;
|
|
278
|
-
value?: JsonLogicValue;
|
|
279
|
-
branchId?: string;
|
|
280
|
-
startOffset: number;
|
|
281
|
-
endOffset: number;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
declare interface StructureNodeData extends BaseNodeData {
|
|
285
|
-
type: 'structure';
|
|
286
|
-
isArray: boolean;
|
|
287
|
-
formattedJson: string;
|
|
288
|
-
elements: StructureElement[];
|
|
289
|
-
collapsed?: boolean;
|
|
290
|
-
expressionText?: string;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
export declare interface VariableNodeData extends OperatorNodeData {
|
|
294
|
-
path?: string;
|
|
295
|
-
defaultValue?: JsonLogicValue;
|
|
296
|
-
scopeJump?: number;
|
|
297
|
-
pathComponents?: string[];
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* Visibility condition for conditional fields
|
|
302
|
-
*/
|
|
303
|
-
declare interface VisibilityCondition {
|
|
304
|
-
field: string;
|
|
305
|
-
operator: 'equals' | 'notEquals' | 'exists' | 'notExists';
|
|
306
|
-
value?: unknown;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
declare type VisualNodeType = 'operator' | 'literal' | 'structure';
|
|
310
|
-
|
|
311
1
|
export { }
|