@goplasmatic/datalogic-ui 4.0.15 → 4.0.19
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-CJRUeom8.cjs +470 -0
- package/dist/datalogic_wasm-dEsk1ML-.js +373 -0
- package/dist/index.cjs +795 -94
- package/dist/index.d.ts +1 -1
- package/dist/index.js +959 -127
- package/dist/styles.css +1625 -0
- package/package.json +4 -4
- package/dist/datalogic_wasm-DdphYKj8.js +0 -373
- package/dist/datalogic_wasm-G7i-KOME.cjs +0 -470
package/dist/index.cjs
CHANGED
|
@@ -124,11 +124,11 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
124
124
|
*/
|
|
125
125
|
|
|
126
126
|
|
|
127
|
-
const __iconNode$
|
|
127
|
+
const __iconNode$R = [
|
|
128
128
|
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
129
129
|
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
130
130
|
];
|
|
131
|
-
const ArrowUp = createLucideIcon("arrow-up", __iconNode$
|
|
131
|
+
const ArrowUp = createLucideIcon("arrow-up", __iconNode$R);
|
|
132
132
|
|
|
133
133
|
/**
|
|
134
134
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -138,11 +138,11 @@ const ArrowUp = createLucideIcon("arrow-up", __iconNode$Q);
|
|
|
138
138
|
*/
|
|
139
139
|
|
|
140
140
|
|
|
141
|
-
const __iconNode$
|
|
141
|
+
const __iconNode$Q = [
|
|
142
142
|
["path", { d: "M4.929 4.929 19.07 19.071", key: "196cmz" }],
|
|
143
143
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
|
|
144
144
|
];
|
|
145
|
-
const Ban = createLucideIcon("ban", __iconNode$
|
|
145
|
+
const Ban = createLucideIcon("ban", __iconNode$Q);
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -152,7 +152,7 @@ const Ban = createLucideIcon("ban", __iconNode$P);
|
|
|
152
152
|
*/
|
|
153
153
|
|
|
154
154
|
|
|
155
|
-
const __iconNode$
|
|
155
|
+
const __iconNode$P = [
|
|
156
156
|
["rect", { x: "14", y: "14", width: "4", height: "6", rx: "2", key: "p02svl" }],
|
|
157
157
|
["rect", { x: "6", y: "4", width: "4", height: "6", rx: "2", key: "xm4xkj" }],
|
|
158
158
|
["path", { d: "M6 20h4", key: "1i6q5t" }],
|
|
@@ -160,7 +160,7 @@ const __iconNode$O = [
|
|
|
160
160
|
["path", { d: "M6 14h2v6", key: "16z9wg" }],
|
|
161
161
|
["path", { d: "M14 4h2v6", key: "1idq9u" }]
|
|
162
162
|
];
|
|
163
|
-
const Binary = createLucideIcon("binary", __iconNode$
|
|
163
|
+
const Binary = createLucideIcon("binary", __iconNode$P);
|
|
164
164
|
|
|
165
165
|
/**
|
|
166
166
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -170,7 +170,7 @@ const Binary = createLucideIcon("binary", __iconNode$O);
|
|
|
170
170
|
*/
|
|
171
171
|
|
|
172
172
|
|
|
173
|
-
const __iconNode$
|
|
173
|
+
const __iconNode$O = [
|
|
174
174
|
[
|
|
175
175
|
"path",
|
|
176
176
|
{
|
|
@@ -181,7 +181,7 @@ const __iconNode$N = [
|
|
|
181
181
|
["path", { d: "m3.3 7 8.7 5 8.7-5", key: "g66t2b" }],
|
|
182
182
|
["path", { d: "M12 22V12", key: "d0xqtd" }]
|
|
183
183
|
];
|
|
184
|
-
const Box = createLucideIcon("box", __iconNode$
|
|
184
|
+
const Box = createLucideIcon("box", __iconNode$O);
|
|
185
185
|
|
|
186
186
|
/**
|
|
187
187
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -191,7 +191,7 @@ const Box = createLucideIcon("box", __iconNode$N);
|
|
|
191
191
|
*/
|
|
192
192
|
|
|
193
193
|
|
|
194
|
-
const __iconNode$
|
|
194
|
+
const __iconNode$N = [
|
|
195
195
|
[
|
|
196
196
|
"path",
|
|
197
197
|
{
|
|
@@ -223,7 +223,7 @@ const __iconNode$M = [
|
|
|
223
223
|
["path", { d: "m12 8 4.74-2.85", key: "3rx089" }],
|
|
224
224
|
["path", { d: "M12 13.5V8", key: "1io7kd" }]
|
|
225
225
|
];
|
|
226
|
-
const Boxes = createLucideIcon("boxes", __iconNode$
|
|
226
|
+
const Boxes = createLucideIcon("boxes", __iconNode$N);
|
|
227
227
|
|
|
228
228
|
/**
|
|
229
229
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -233,7 +233,7 @@ const Boxes = createLucideIcon("boxes", __iconNode$M);
|
|
|
233
233
|
*/
|
|
234
234
|
|
|
235
235
|
|
|
236
|
-
const __iconNode$
|
|
236
|
+
const __iconNode$M = [
|
|
237
237
|
[
|
|
238
238
|
"path",
|
|
239
239
|
{ d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1", key: "ezmyqa" }
|
|
@@ -246,7 +246,7 @@ const __iconNode$L = [
|
|
|
246
246
|
}
|
|
247
247
|
]
|
|
248
248
|
];
|
|
249
|
-
const Braces = createLucideIcon("braces", __iconNode$
|
|
249
|
+
const Braces = createLucideIcon("braces", __iconNode$M);
|
|
250
250
|
|
|
251
251
|
/**
|
|
252
252
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -256,7 +256,7 @@ const Braces = createLucideIcon("braces", __iconNode$L);
|
|
|
256
256
|
*/
|
|
257
257
|
|
|
258
258
|
|
|
259
|
-
const __iconNode$
|
|
259
|
+
const __iconNode$L = [
|
|
260
260
|
["path", { d: "M12 20v-9", key: "1qisl0" }],
|
|
261
261
|
["path", { d: "M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z", key: "uouzyp" }],
|
|
262
262
|
["path", { d: "M14.12 3.88 16 2", key: "qol33r" }],
|
|
@@ -269,7 +269,7 @@ const __iconNode$K = [
|
|
|
269
269
|
["path", { d: "m8 2 1.88 1.88", key: "fmnt4t" }],
|
|
270
270
|
["path", { d: "M9 7.13V6a3 3 0 1 1 6 0v1.13", key: "1vgav8" }]
|
|
271
271
|
];
|
|
272
|
-
const Bug = createLucideIcon("bug", __iconNode$
|
|
272
|
+
const Bug = createLucideIcon("bug", __iconNode$L);
|
|
273
273
|
|
|
274
274
|
/**
|
|
275
275
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -279,7 +279,7 @@ const Bug = createLucideIcon("bug", __iconNode$K);
|
|
|
279
279
|
*/
|
|
280
280
|
|
|
281
281
|
|
|
282
|
-
const __iconNode$
|
|
282
|
+
const __iconNode$K = [
|
|
283
283
|
["rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", key: "1nb95v" }],
|
|
284
284
|
["line", { x1: "8", x2: "16", y1: "6", y2: "6", key: "x4nwl0" }],
|
|
285
285
|
["line", { x1: "16", x2: "16", y1: "14", y2: "18", key: "wjye3r" }],
|
|
@@ -291,7 +291,7 @@ const __iconNode$J = [
|
|
|
291
291
|
["path", { d: "M12 18h.01", key: "mhygvu" }],
|
|
292
292
|
["path", { d: "M8 18h.01", key: "lrp35t" }]
|
|
293
293
|
];
|
|
294
|
-
const Calculator = createLucideIcon("calculator", __iconNode$
|
|
294
|
+
const Calculator = createLucideIcon("calculator", __iconNode$K);
|
|
295
295
|
|
|
296
296
|
/**
|
|
297
297
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -301,13 +301,13 @@ const Calculator = createLucideIcon("calculator", __iconNode$J);
|
|
|
301
301
|
*/
|
|
302
302
|
|
|
303
303
|
|
|
304
|
-
const __iconNode$
|
|
304
|
+
const __iconNode$J = [
|
|
305
305
|
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
306
306
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
307
307
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
308
308
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
309
309
|
];
|
|
310
|
-
const Calendar = createLucideIcon("calendar", __iconNode$
|
|
310
|
+
const Calendar = createLucideIcon("calendar", __iconNode$J);
|
|
311
311
|
|
|
312
312
|
/**
|
|
313
313
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -317,8 +317,8 @@ const Calendar = createLucideIcon("calendar", __iconNode$I);
|
|
|
317
317
|
*/
|
|
318
318
|
|
|
319
319
|
|
|
320
|
-
const __iconNode$
|
|
321
|
-
const Check = createLucideIcon("check", __iconNode$
|
|
320
|
+
const __iconNode$I = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
321
|
+
const Check = createLucideIcon("check", __iconNode$I);
|
|
322
322
|
|
|
323
323
|
/**
|
|
324
324
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -328,8 +328,8 @@ const Check = createLucideIcon("check", __iconNode$H);
|
|
|
328
328
|
*/
|
|
329
329
|
|
|
330
330
|
|
|
331
|
-
const __iconNode$
|
|
332
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$
|
|
331
|
+
const __iconNode$H = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
332
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$H);
|
|
333
333
|
|
|
334
334
|
/**
|
|
335
335
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -339,8 +339,8 @@ const ChevronDown = createLucideIcon("chevron-down", __iconNode$G);
|
|
|
339
339
|
*/
|
|
340
340
|
|
|
341
341
|
|
|
342
|
-
const __iconNode$
|
|
343
|
-
const ChevronLeft = createLucideIcon("chevron-left", __iconNode$
|
|
342
|
+
const __iconNode$G = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
|
|
343
|
+
const ChevronLeft = createLucideIcon("chevron-left", __iconNode$G);
|
|
344
344
|
|
|
345
345
|
/**
|
|
346
346
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -350,8 +350,8 @@ const ChevronLeft = createLucideIcon("chevron-left", __iconNode$F);
|
|
|
350
350
|
*/
|
|
351
351
|
|
|
352
352
|
|
|
353
|
-
const __iconNode$
|
|
354
|
-
const ChevronRight = createLucideIcon("chevron-right", __iconNode$
|
|
353
|
+
const __iconNode$F = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
354
|
+
const ChevronRight = createLucideIcon("chevron-right", __iconNode$F);
|
|
355
355
|
|
|
356
356
|
/**
|
|
357
357
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -361,12 +361,12 @@ const ChevronRight = createLucideIcon("chevron-right", __iconNode$E);
|
|
|
361
361
|
*/
|
|
362
362
|
|
|
363
363
|
|
|
364
|
-
const __iconNode$
|
|
364
|
+
const __iconNode$E = [
|
|
365
365
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
366
366
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
367
367
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
368
368
|
];
|
|
369
|
-
const CircleAlert = createLucideIcon("circle-alert", __iconNode$
|
|
369
|
+
const CircleAlert = createLucideIcon("circle-alert", __iconNode$E);
|
|
370
370
|
|
|
371
371
|
/**
|
|
372
372
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -376,12 +376,12 @@ const CircleAlert = createLucideIcon("circle-alert", __iconNode$D);
|
|
|
376
376
|
*/
|
|
377
377
|
|
|
378
378
|
|
|
379
|
-
const __iconNode$
|
|
379
|
+
const __iconNode$D = [
|
|
380
380
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
381
381
|
["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
|
|
382
382
|
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
383
383
|
];
|
|
384
|
-
const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$
|
|
384
|
+
const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$D);
|
|
385
385
|
|
|
386
386
|
/**
|
|
387
387
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -391,12 +391,12 @@ const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$C
|
|
|
391
391
|
*/
|
|
392
392
|
|
|
393
393
|
|
|
394
|
-
const __iconNode$
|
|
394
|
+
const __iconNode$C = [
|
|
395
395
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
396
396
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
397
397
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
398
398
|
];
|
|
399
|
-
const CircleX = createLucideIcon("circle-x", __iconNode$
|
|
399
|
+
const CircleX = createLucideIcon("circle-x", __iconNode$C);
|
|
400
400
|
|
|
401
401
|
/**
|
|
402
402
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -406,7 +406,7 @@ const CircleX = createLucideIcon("circle-x", __iconNode$B);
|
|
|
406
406
|
*/
|
|
407
407
|
|
|
408
408
|
|
|
409
|
-
const __iconNode$
|
|
409
|
+
const __iconNode$B = [
|
|
410
410
|
["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
|
|
411
411
|
[
|
|
412
412
|
"path",
|
|
@@ -416,7 +416,7 @@ const __iconNode$A = [
|
|
|
416
416
|
}
|
|
417
417
|
]
|
|
418
418
|
];
|
|
419
|
-
const Clipboard = createLucideIcon("clipboard", __iconNode$
|
|
419
|
+
const Clipboard = createLucideIcon("clipboard", __iconNode$B);
|
|
420
420
|
|
|
421
421
|
/**
|
|
422
422
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -426,11 +426,11 @@ const Clipboard = createLucideIcon("clipboard", __iconNode$A);
|
|
|
426
426
|
*/
|
|
427
427
|
|
|
428
428
|
|
|
429
|
-
const __iconNode$
|
|
429
|
+
const __iconNode$A = [
|
|
430
430
|
["path", { d: "M12 6v6l4 2", key: "mmk7yg" }],
|
|
431
431
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
|
|
432
432
|
];
|
|
433
|
-
const Clock = createLucideIcon("clock", __iconNode$
|
|
433
|
+
const Clock = createLucideIcon("clock", __iconNode$A);
|
|
434
434
|
|
|
435
435
|
/**
|
|
436
436
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -440,7 +440,7 @@ const Clock = createLucideIcon("clock", __iconNode$z);
|
|
|
440
440
|
*/
|
|
441
441
|
|
|
442
442
|
|
|
443
|
-
const __iconNode$
|
|
443
|
+
const __iconNode$z = [
|
|
444
444
|
["path", { d: "M11 10.27 7 3.34", key: "16pf9h" }],
|
|
445
445
|
["path", { d: "m11 13.73-4 6.93", key: "794ttg" }],
|
|
446
446
|
["path", { d: "M12 22v-2", key: "1osdcq" }],
|
|
@@ -456,7 +456,7 @@ const __iconNode$y = [
|
|
|
456
456
|
["circle", { cx: "12", cy: "12", r: "2", key: "1c9p78" }],
|
|
457
457
|
["circle", { cx: "12", cy: "12", r: "8", key: "46899m" }]
|
|
458
458
|
];
|
|
459
|
-
const Cog = createLucideIcon("cog", __iconNode$
|
|
459
|
+
const Cog = createLucideIcon("cog", __iconNode$z);
|
|
460
460
|
|
|
461
461
|
/**
|
|
462
462
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -466,11 +466,11 @@ const Cog = createLucideIcon("cog", __iconNode$y);
|
|
|
466
466
|
*/
|
|
467
467
|
|
|
468
468
|
|
|
469
|
-
const __iconNode$
|
|
469
|
+
const __iconNode$y = [
|
|
470
470
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
471
471
|
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
472
472
|
];
|
|
473
|
-
const Copy = createLucideIcon("copy", __iconNode$
|
|
473
|
+
const Copy = createLucideIcon("copy", __iconNode$y);
|
|
474
474
|
|
|
475
475
|
/**
|
|
476
476
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -480,12 +480,12 @@ const Copy = createLucideIcon("copy", __iconNode$x);
|
|
|
480
480
|
*/
|
|
481
481
|
|
|
482
482
|
|
|
483
|
-
const __iconNode$
|
|
483
|
+
const __iconNode$x = [
|
|
484
484
|
["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
|
|
485
485
|
["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
|
|
486
486
|
["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
|
|
487
487
|
];
|
|
488
|
-
const Database = createLucideIcon("database", __iconNode$
|
|
488
|
+
const Database = createLucideIcon("database", __iconNode$x);
|
|
489
489
|
|
|
490
490
|
/**
|
|
491
491
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -495,7 +495,7 @@ const Database = createLucideIcon("database", __iconNode$w);
|
|
|
495
495
|
*/
|
|
496
496
|
|
|
497
497
|
|
|
498
|
-
const __iconNode$
|
|
498
|
+
const __iconNode$w = [
|
|
499
499
|
[
|
|
500
500
|
"path",
|
|
501
501
|
{
|
|
@@ -504,7 +504,7 @@ const __iconNode$v = [
|
|
|
504
504
|
}
|
|
505
505
|
]
|
|
506
506
|
];
|
|
507
|
-
const Diamond = createLucideIcon("diamond", __iconNode$
|
|
507
|
+
const Diamond = createLucideIcon("diamond", __iconNode$w);
|
|
508
508
|
|
|
509
509
|
/**
|
|
510
510
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -514,12 +514,12 @@ const Diamond = createLucideIcon("diamond", __iconNode$v);
|
|
|
514
514
|
*/
|
|
515
515
|
|
|
516
516
|
|
|
517
|
-
const __iconNode$
|
|
517
|
+
const __iconNode$v = [
|
|
518
518
|
["circle", { cx: "12", cy: "6", r: "1", key: "1bh7o1" }],
|
|
519
519
|
["line", { x1: "5", x2: "19", y1: "12", y2: "12", key: "13b5wn" }],
|
|
520
520
|
["circle", { cx: "12", cy: "18", r: "1", key: "lqb9t5" }]
|
|
521
521
|
];
|
|
522
|
-
const Divide = createLucideIcon("divide", __iconNode$
|
|
522
|
+
const Divide = createLucideIcon("divide", __iconNode$v);
|
|
523
523
|
|
|
524
524
|
/**
|
|
525
525
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -529,12 +529,12 @@ const Divide = createLucideIcon("divide", __iconNode$u);
|
|
|
529
529
|
*/
|
|
530
530
|
|
|
531
531
|
|
|
532
|
-
const __iconNode$
|
|
532
|
+
const __iconNode$u = [
|
|
533
533
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
534
534
|
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
535
535
|
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
536
536
|
];
|
|
537
|
-
const ExternalLink = createLucideIcon("external-link", __iconNode$
|
|
537
|
+
const ExternalLink = createLucideIcon("external-link", __iconNode$u);
|
|
538
538
|
|
|
539
539
|
/**
|
|
540
540
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -544,13 +544,13 @@ const ExternalLink = createLucideIcon("external-link", __iconNode$t);
|
|
|
544
544
|
*/
|
|
545
545
|
|
|
546
546
|
|
|
547
|
-
const __iconNode$
|
|
547
|
+
const __iconNode$t = [
|
|
548
548
|
["line", { x1: "6", x2: "6", y1: "3", y2: "15", key: "17qcm7" }],
|
|
549
549
|
["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
|
|
550
550
|
["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
|
|
551
551
|
["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
|
|
552
552
|
];
|
|
553
|
-
const GitBranch = createLucideIcon("git-branch", __iconNode$
|
|
553
|
+
const GitBranch = createLucideIcon("git-branch", __iconNode$t);
|
|
554
554
|
|
|
555
555
|
/**
|
|
556
556
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -560,12 +560,12 @@ const GitBranch = createLucideIcon("git-branch", __iconNode$s);
|
|
|
560
560
|
*/
|
|
561
561
|
|
|
562
562
|
|
|
563
|
-
const __iconNode$
|
|
563
|
+
const __iconNode$s = [
|
|
564
564
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
|
|
565
565
|
["line", { x1: "3", x2: "9", y1: "12", y2: "12", key: "1dyftd" }],
|
|
566
566
|
["line", { x1: "15", x2: "21", y1: "12", y2: "12", key: "oup4p8" }]
|
|
567
567
|
];
|
|
568
|
-
const GitCommitHorizontal = createLucideIcon("git-commit-horizontal", __iconNode$
|
|
568
|
+
const GitCommitHorizontal = createLucideIcon("git-commit-horizontal", __iconNode$s);
|
|
569
569
|
|
|
570
570
|
/**
|
|
571
571
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -575,12 +575,12 @@ const GitCommitHorizontal = createLucideIcon("git-commit-horizontal", __iconNode
|
|
|
575
575
|
*/
|
|
576
576
|
|
|
577
577
|
|
|
578
|
-
const __iconNode$
|
|
578
|
+
const __iconNode$r = [
|
|
579
579
|
["circle", { cx: "18", cy: "18", r: "3", key: "1xkwt0" }],
|
|
580
580
|
["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
|
|
581
581
|
["path", { d: "M6 21V9a9 9 0 0 0 9 9", key: "7kw0sc" }]
|
|
582
582
|
];
|
|
583
|
-
const GitMerge = createLucideIcon("git-merge", __iconNode$
|
|
583
|
+
const GitMerge = createLucideIcon("git-merge", __iconNode$r);
|
|
584
584
|
|
|
585
585
|
/**
|
|
586
586
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -590,13 +590,13 @@ const GitMerge = createLucideIcon("git-merge", __iconNode$q);
|
|
|
590
590
|
*/
|
|
591
591
|
|
|
592
592
|
|
|
593
|
-
const __iconNode$
|
|
593
|
+
const __iconNode$q = [
|
|
594
594
|
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
595
595
|
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
596
596
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
597
597
|
["line", { x1: "16", x2: "14", y1: "3", y2: "21", key: "weycgp" }]
|
|
598
598
|
];
|
|
599
|
-
const Hash = createLucideIcon("hash", __iconNode$
|
|
599
|
+
const Hash = createLucideIcon("hash", __iconNode$q);
|
|
600
600
|
|
|
601
601
|
/**
|
|
602
602
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -606,7 +606,7 @@ const Hash = createLucideIcon("hash", __iconNode$p);
|
|
|
606
606
|
*/
|
|
607
607
|
|
|
608
608
|
|
|
609
|
-
const __iconNode$
|
|
609
|
+
const __iconNode$p = [
|
|
610
610
|
[
|
|
611
611
|
"path",
|
|
612
612
|
{
|
|
@@ -629,7 +629,7 @@ const __iconNode$o = [
|
|
|
629
629
|
}
|
|
630
630
|
]
|
|
631
631
|
];
|
|
632
|
-
const Layers = createLucideIcon("layers", __iconNode$
|
|
632
|
+
const Layers = createLucideIcon("layers", __iconNode$p);
|
|
633
633
|
|
|
634
634
|
/**
|
|
635
635
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -639,13 +639,13 @@ const Layers = createLucideIcon("layers", __iconNode$o);
|
|
|
639
639
|
*/
|
|
640
640
|
|
|
641
641
|
|
|
642
|
-
const __iconNode$
|
|
642
|
+
const __iconNode$o = [
|
|
643
643
|
["path", { d: "M9 17H7A5 5 0 0 1 7 7", key: "10o201" }],
|
|
644
644
|
["path", { d: "M15 7h2a5 5 0 0 1 4 8", key: "1d3206" }],
|
|
645
645
|
["line", { x1: "8", x2: "12", y1: "12", y2: "12", key: "rvw6j4" }],
|
|
646
646
|
["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }]
|
|
647
647
|
];
|
|
648
|
-
const Link2Off = createLucideIcon("link-2-off", __iconNode$
|
|
648
|
+
const Link2Off = createLucideIcon("link-2-off", __iconNode$o);
|
|
649
649
|
|
|
650
650
|
/**
|
|
651
651
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -655,7 +655,7 @@ const Link2Off = createLucideIcon("link-2-off", __iconNode$n);
|
|
|
655
655
|
*/
|
|
656
656
|
|
|
657
657
|
|
|
658
|
-
const __iconNode$
|
|
658
|
+
const __iconNode$n = [
|
|
659
659
|
["path", { d: "M3 5h.01", key: "18ugdj" }],
|
|
660
660
|
["path", { d: "M3 12h.01", key: "nlz23k" }],
|
|
661
661
|
["path", { d: "M3 19h.01", key: "noohij" }],
|
|
@@ -663,7 +663,7 @@ const __iconNode$m = [
|
|
|
663
663
|
["path", { d: "M8 12h13", key: "1za7za" }],
|
|
664
664
|
["path", { d: "M8 19h13", key: "m83p4d" }]
|
|
665
665
|
];
|
|
666
|
-
const List = createLucideIcon("list", __iconNode$
|
|
666
|
+
const List = createLucideIcon("list", __iconNode$n);
|
|
667
667
|
|
|
668
668
|
/**
|
|
669
669
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -673,13 +673,13 @@ const List = createLucideIcon("list", __iconNode$m);
|
|
|
673
673
|
*/
|
|
674
674
|
|
|
675
675
|
|
|
676
|
-
const __iconNode$
|
|
676
|
+
const __iconNode$m = [
|
|
677
677
|
["path", { d: "M8 3H5a2 2 0 0 0-2 2v3", key: "1dcmit" }],
|
|
678
678
|
["path", { d: "M21 8V5a2 2 0 0 0-2-2h-3", key: "1e4gt3" }],
|
|
679
679
|
["path", { d: "M3 16v3a2 2 0 0 0 2 2h3", key: "wsl5sc" }],
|
|
680
680
|
["path", { d: "M16 21h3a2 2 0 0 0 2-2v-3", key: "18trek" }]
|
|
681
681
|
];
|
|
682
|
-
const Maximize = createLucideIcon("maximize", __iconNode$
|
|
682
|
+
const Maximize = createLucideIcon("maximize", __iconNode$m);
|
|
683
683
|
|
|
684
684
|
/**
|
|
685
685
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -689,7 +689,7 @@ const Maximize = createLucideIcon("maximize", __iconNode$l);
|
|
|
689
689
|
*/
|
|
690
690
|
|
|
691
691
|
|
|
692
|
-
const __iconNode$
|
|
692
|
+
const __iconNode$l = [
|
|
693
693
|
[
|
|
694
694
|
"path",
|
|
695
695
|
{
|
|
@@ -698,7 +698,7 @@ const __iconNode$k = [
|
|
|
698
698
|
}
|
|
699
699
|
]
|
|
700
700
|
];
|
|
701
|
-
const MousePointer2 = createLucideIcon("mouse-pointer-2", __iconNode$
|
|
701
|
+
const MousePointer2 = createLucideIcon("mouse-pointer-2", __iconNode$l);
|
|
702
702
|
|
|
703
703
|
/**
|
|
704
704
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -708,11 +708,11 @@ const MousePointer2 = createLucideIcon("mouse-pointer-2", __iconNode$k);
|
|
|
708
708
|
*/
|
|
709
709
|
|
|
710
710
|
|
|
711
|
-
const __iconNode$
|
|
711
|
+
const __iconNode$k = [
|
|
712
712
|
["rect", { x: "14", y: "3", width: "5", height: "18", rx: "1", key: "kaeet6" }],
|
|
713
713
|
["rect", { x: "5", y: "3", width: "5", height: "18", rx: "1", key: "1wsw3u" }]
|
|
714
714
|
];
|
|
715
|
-
const Pause = createLucideIcon("pause", __iconNode$
|
|
715
|
+
const Pause = createLucideIcon("pause", __iconNode$k);
|
|
716
716
|
|
|
717
717
|
/**
|
|
718
718
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -722,7 +722,7 @@ const Pause = createLucideIcon("pause", __iconNode$j);
|
|
|
722
722
|
*/
|
|
723
723
|
|
|
724
724
|
|
|
725
|
-
const __iconNode$
|
|
725
|
+
const __iconNode$j = [
|
|
726
726
|
["path", { d: "M13 21h8", key: "1jsn5i" }],
|
|
727
727
|
[
|
|
728
728
|
"path",
|
|
@@ -732,7 +732,7 @@ const __iconNode$i = [
|
|
|
732
732
|
}
|
|
733
733
|
]
|
|
734
734
|
];
|
|
735
|
-
const PenLine = createLucideIcon("pen-line", __iconNode$
|
|
735
|
+
const PenLine = createLucideIcon("pen-line", __iconNode$j);
|
|
736
736
|
|
|
737
737
|
/**
|
|
738
738
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -742,7 +742,7 @@ const PenLine = createLucideIcon("pen-line", __iconNode$i);
|
|
|
742
742
|
*/
|
|
743
743
|
|
|
744
744
|
|
|
745
|
-
const __iconNode$
|
|
745
|
+
const __iconNode$i = [
|
|
746
746
|
[
|
|
747
747
|
"path",
|
|
748
748
|
{
|
|
@@ -751,7 +751,7 @@ const __iconNode$h = [
|
|
|
751
751
|
}
|
|
752
752
|
]
|
|
753
753
|
];
|
|
754
|
-
const Play = createLucideIcon("play", __iconNode$
|
|
754
|
+
const Play = createLucideIcon("play", __iconNode$i);
|
|
755
755
|
|
|
756
756
|
/**
|
|
757
757
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -761,11 +761,11 @@ const Play = createLucideIcon("play", __iconNode$h);
|
|
|
761
761
|
*/
|
|
762
762
|
|
|
763
763
|
|
|
764
|
-
const __iconNode$
|
|
764
|
+
const __iconNode$h = [
|
|
765
765
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
766
766
|
["path", { d: "M12 5v14", key: "s699le" }]
|
|
767
767
|
];
|
|
768
|
-
const Plus = createLucideIcon("plus", __iconNode$
|
|
768
|
+
const Plus = createLucideIcon("plus", __iconNode$h);
|
|
769
769
|
|
|
770
770
|
/**
|
|
771
771
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -775,7 +775,7 @@ const Plus = createLucideIcon("plus", __iconNode$g);
|
|
|
775
775
|
*/
|
|
776
776
|
|
|
777
777
|
|
|
778
|
-
const __iconNode$
|
|
778
|
+
const __iconNode$g = [
|
|
779
779
|
[
|
|
780
780
|
"path",
|
|
781
781
|
{
|
|
@@ -791,7 +791,7 @@ const __iconNode$f = [
|
|
|
791
791
|
}
|
|
792
792
|
]
|
|
793
793
|
];
|
|
794
|
-
const Quote = createLucideIcon("quote", __iconNode$
|
|
794
|
+
const Quote = createLucideIcon("quote", __iconNode$g);
|
|
795
795
|
|
|
796
796
|
/**
|
|
797
797
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -801,11 +801,11 @@ const Quote = createLucideIcon("quote", __iconNode$f);
|
|
|
801
801
|
*/
|
|
802
802
|
|
|
803
803
|
|
|
804
|
-
const __iconNode$
|
|
804
|
+
const __iconNode$f = [
|
|
805
805
|
["path", { d: "m15 14 5-5-5-5", key: "12vg1m" }],
|
|
806
806
|
["path", { d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13", key: "6uklza" }]
|
|
807
807
|
];
|
|
808
|
-
const Redo2 = createLucideIcon("redo-2", __iconNode$
|
|
808
|
+
const Redo2 = createLucideIcon("redo-2", __iconNode$f);
|
|
809
809
|
|
|
810
810
|
/**
|
|
811
811
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -815,13 +815,13 @@ const Redo2 = createLucideIcon("redo-2", __iconNode$e);
|
|
|
815
815
|
*/
|
|
816
816
|
|
|
817
817
|
|
|
818
|
-
const __iconNode$
|
|
818
|
+
const __iconNode$e = [
|
|
819
819
|
["path", { d: "m17 2 4 4-4 4", key: "nntrym" }],
|
|
820
820
|
["path", { d: "M3 11v-1a4 4 0 0 1 4-4h14", key: "84bu3i" }],
|
|
821
821
|
["path", { d: "m7 22-4-4 4-4", key: "1wqhfi" }],
|
|
822
822
|
["path", { d: "M21 13v1a4 4 0 0 1-4 4H3", key: "1rx37r" }]
|
|
823
823
|
];
|
|
824
|
-
const Repeat = createLucideIcon("repeat", __iconNode$
|
|
824
|
+
const Repeat = createLucideIcon("repeat", __iconNode$e);
|
|
825
825
|
|
|
826
826
|
/**
|
|
827
827
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -831,14 +831,14 @@ const Repeat = createLucideIcon("repeat", __iconNode$d);
|
|
|
831
831
|
*/
|
|
832
832
|
|
|
833
833
|
|
|
834
|
-
const __iconNode$
|
|
834
|
+
const __iconNode$d = [
|
|
835
835
|
["path", { d: "M12 3v18", key: "108xh3" }],
|
|
836
836
|
["path", { d: "m19 8 3 8a5 5 0 0 1-6 0zV7", key: "zcdpyk" }],
|
|
837
837
|
["path", { d: "M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1", key: "1yorad" }],
|
|
838
838
|
["path", { d: "m5 8 3 8a5 5 0 0 1-6 0zV7", key: "eua70x" }],
|
|
839
839
|
["path", { d: "M7 21h10", key: "1b0cd5" }]
|
|
840
840
|
];
|
|
841
|
-
const Scale = createLucideIcon("scale", __iconNode$
|
|
841
|
+
const Scale = createLucideIcon("scale", __iconNode$d);
|
|
842
842
|
|
|
843
843
|
/**
|
|
844
844
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -848,11 +848,11 @@ const Scale = createLucideIcon("scale", __iconNode$c);
|
|
|
848
848
|
*/
|
|
849
849
|
|
|
850
850
|
|
|
851
|
-
const __iconNode$
|
|
851
|
+
const __iconNode$c = [
|
|
852
852
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
853
853
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
854
854
|
];
|
|
855
|
-
const Search = createLucideIcon("search", __iconNode$
|
|
855
|
+
const Search = createLucideIcon("search", __iconNode$c);
|
|
856
856
|
|
|
857
857
|
/**
|
|
858
858
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -862,7 +862,7 @@ const Search = createLucideIcon("search", __iconNode$b);
|
|
|
862
862
|
*/
|
|
863
863
|
|
|
864
864
|
|
|
865
|
-
const __iconNode$
|
|
865
|
+
const __iconNode$b = [
|
|
866
866
|
[
|
|
867
867
|
"path",
|
|
868
868
|
{
|
|
@@ -872,7 +872,7 @@ const __iconNode$a = [
|
|
|
872
872
|
],
|
|
873
873
|
["path", { d: "M3 20V4", key: "1ptbpl" }]
|
|
874
874
|
];
|
|
875
|
-
const SkipBack = createLucideIcon("skip-back", __iconNode$
|
|
875
|
+
const SkipBack = createLucideIcon("skip-back", __iconNode$b);
|
|
876
876
|
|
|
877
877
|
/**
|
|
878
878
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -882,7 +882,7 @@ const SkipBack = createLucideIcon("skip-back", __iconNode$a);
|
|
|
882
882
|
*/
|
|
883
883
|
|
|
884
884
|
|
|
885
|
-
const __iconNode$
|
|
885
|
+
const __iconNode$a = [
|
|
886
886
|
["path", { d: "M21 4v16", key: "7j8fe9" }],
|
|
887
887
|
[
|
|
888
888
|
"path",
|
|
@@ -892,7 +892,27 @@ const __iconNode$9 = [
|
|
|
892
892
|
}
|
|
893
893
|
]
|
|
894
894
|
];
|
|
895
|
-
const SkipForward = createLucideIcon("skip-forward", __iconNode$
|
|
895
|
+
const SkipForward = createLucideIcon("skip-forward", __iconNode$a);
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* @license lucide-react v0.562.0 - ISC
|
|
899
|
+
*
|
|
900
|
+
* This source code is licensed under the ISC license.
|
|
901
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
902
|
+
*/
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
const __iconNode$9 = [
|
|
906
|
+
[
|
|
907
|
+
"path",
|
|
908
|
+
{
|
|
909
|
+
d: "M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",
|
|
910
|
+
key: "vktsd0"
|
|
911
|
+
}
|
|
912
|
+
],
|
|
913
|
+
["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }]
|
|
914
|
+
];
|
|
915
|
+
const Tag = createLucideIcon("tag", __iconNode$9);
|
|
896
916
|
|
|
897
917
|
/**
|
|
898
918
|
* @license lucide-react v0.562.0 - ISC
|
|
@@ -2945,6 +2965,257 @@ const controlOperators = {
|
|
|
2945
2965
|
]
|
|
2946
2966
|
}
|
|
2947
2967
|
},
|
|
2968
|
+
switch: {
|
|
2969
|
+
name: "switch",
|
|
2970
|
+
label: "Switch",
|
|
2971
|
+
category: "control",
|
|
2972
|
+
description: "Match a value against cases (switch/case)",
|
|
2973
|
+
arity: {
|
|
2974
|
+
type: "special",
|
|
2975
|
+
min: 2,
|
|
2976
|
+
args: [
|
|
2977
|
+
{ name: "discriminant", label: "Value", type: "any", required: true },
|
|
2978
|
+
{ name: "cases", label: "Cases", type: "array", required: true },
|
|
2979
|
+
{ name: "default", label: "Default", type: "any", required: false }
|
|
2980
|
+
]
|
|
2981
|
+
},
|
|
2982
|
+
help: {
|
|
2983
|
+
summary: "Evaluate a value once and match it against case/result pairs",
|
|
2984
|
+
details: "Evaluates the discriminant expression once, then compares it against each case value using strict equality. Returns the result of the first matching case, or the default value if no case matches. If no default is provided and nothing matches, returns null.",
|
|
2985
|
+
returnType: "any",
|
|
2986
|
+
examples: [
|
|
2987
|
+
{
|
|
2988
|
+
title: "Simple string matching",
|
|
2989
|
+
rule: {
|
|
2990
|
+
switch: [
|
|
2991
|
+
{ var: "color" },
|
|
2992
|
+
[
|
|
2993
|
+
["red", "stop"],
|
|
2994
|
+
["green", "go"]
|
|
2995
|
+
],
|
|
2996
|
+
"unknown"
|
|
2997
|
+
]
|
|
2998
|
+
},
|
|
2999
|
+
data: { color: "red" },
|
|
3000
|
+
result: "stop"
|
|
3001
|
+
},
|
|
3002
|
+
{
|
|
3003
|
+
title: "HTTP status codes",
|
|
3004
|
+
rule: {
|
|
3005
|
+
switch: [
|
|
3006
|
+
{ var: "status" },
|
|
3007
|
+
[
|
|
3008
|
+
[200, "OK"],
|
|
3009
|
+
[404, "Not Found"],
|
|
3010
|
+
[500, "Error"]
|
|
3011
|
+
],
|
|
3012
|
+
"Unknown"
|
|
3013
|
+
]
|
|
3014
|
+
},
|
|
3015
|
+
data: { status: 404 },
|
|
3016
|
+
result: "Not Found"
|
|
3017
|
+
},
|
|
3018
|
+
{
|
|
3019
|
+
title: "Computed discriminant",
|
|
3020
|
+
rule: {
|
|
3021
|
+
switch: [
|
|
3022
|
+
{ "+": [{ var: "a" }, { var: "b" }] },
|
|
3023
|
+
[
|
|
3024
|
+
[10, "ten"],
|
|
3025
|
+
[20, "twenty"]
|
|
3026
|
+
],
|
|
3027
|
+
"other"
|
|
3028
|
+
]
|
|
3029
|
+
},
|
|
3030
|
+
data: { a: 7, b: 3 },
|
|
3031
|
+
result: "ten"
|
|
3032
|
+
},
|
|
3033
|
+
{
|
|
3034
|
+
title: "Expression as result",
|
|
3035
|
+
rule: {
|
|
3036
|
+
switch: [
|
|
3037
|
+
{ var: "tier" },
|
|
3038
|
+
[
|
|
3039
|
+
["gold", { "*": [{ var: "price" }, 0.8] }],
|
|
3040
|
+
["silver", { "*": [{ var: "price" }, 0.9] }]
|
|
3041
|
+
],
|
|
3042
|
+
{ var: "price" }
|
|
3043
|
+
]
|
|
3044
|
+
},
|
|
3045
|
+
data: { tier: "gold", price: 100 },
|
|
3046
|
+
result: 80
|
|
3047
|
+
}
|
|
3048
|
+
],
|
|
3049
|
+
notes: [
|
|
3050
|
+
"Pattern: [discriminant, [[case1, result1], [case2, result2], ...], default]",
|
|
3051
|
+
"Uses strict equality (type-sensitive)",
|
|
3052
|
+
"First matching case wins",
|
|
3053
|
+
"Only the matched result is evaluated (short-circuit)",
|
|
3054
|
+
'"match" is an alias for "switch"'
|
|
3055
|
+
],
|
|
3056
|
+
seeAlso: ["if", "?:", "=="]
|
|
3057
|
+
},
|
|
3058
|
+
ui: {
|
|
3059
|
+
icon: "git-branch",
|
|
3060
|
+
shortLabel: "switch",
|
|
3061
|
+
nodeType: "decision",
|
|
3062
|
+
collapsible: true,
|
|
3063
|
+
addArgumentLabel: "Add Case"
|
|
3064
|
+
},
|
|
3065
|
+
panel: {
|
|
3066
|
+
sections: [
|
|
3067
|
+
{
|
|
3068
|
+
id: "discriminant",
|
|
3069
|
+
title: "Match Value",
|
|
3070
|
+
fields: [
|
|
3071
|
+
{
|
|
3072
|
+
id: "discriminant",
|
|
3073
|
+
label: "Value",
|
|
3074
|
+
inputType: "expression",
|
|
3075
|
+
required: true,
|
|
3076
|
+
helpText: "Expression to evaluate and match against cases"
|
|
3077
|
+
}
|
|
3078
|
+
]
|
|
3079
|
+
},
|
|
3080
|
+
{
|
|
3081
|
+
id: "cases",
|
|
3082
|
+
title: "Cases",
|
|
3083
|
+
fields: [
|
|
3084
|
+
{
|
|
3085
|
+
id: "caseCount",
|
|
3086
|
+
label: "Number of Cases",
|
|
3087
|
+
inputType: "number",
|
|
3088
|
+
min: 1,
|
|
3089
|
+
max: 50,
|
|
3090
|
+
defaultValue: 1,
|
|
3091
|
+
helpText: "Number of case/result pairs"
|
|
3092
|
+
},
|
|
3093
|
+
{
|
|
3094
|
+
id: "case",
|
|
3095
|
+
label: "Case",
|
|
3096
|
+
inputType: "expression",
|
|
3097
|
+
repeatable: true,
|
|
3098
|
+
helpText: "Case value and result pairs"
|
|
3099
|
+
}
|
|
3100
|
+
]
|
|
3101
|
+
},
|
|
3102
|
+
{
|
|
3103
|
+
id: "default",
|
|
3104
|
+
title: "Default",
|
|
3105
|
+
fields: [
|
|
3106
|
+
{
|
|
3107
|
+
id: "hasDefault",
|
|
3108
|
+
label: "Has Default",
|
|
3109
|
+
inputType: "boolean",
|
|
3110
|
+
defaultValue: false
|
|
3111
|
+
},
|
|
3112
|
+
{
|
|
3113
|
+
id: "default",
|
|
3114
|
+
label: "Default",
|
|
3115
|
+
inputType: "expression",
|
|
3116
|
+
showWhen: [{ field: "hasDefault", operator: "equals", value: true }],
|
|
3117
|
+
helpText: "Value returned if no cases match"
|
|
3118
|
+
}
|
|
3119
|
+
]
|
|
3120
|
+
}
|
|
3121
|
+
]
|
|
3122
|
+
}
|
|
3123
|
+
},
|
|
3124
|
+
match: {
|
|
3125
|
+
name: "match",
|
|
3126
|
+
label: "Match",
|
|
3127
|
+
category: "control",
|
|
3128
|
+
description: "Match a value against cases (alias for switch)",
|
|
3129
|
+
arity: {
|
|
3130
|
+
type: "special",
|
|
3131
|
+
min: 2,
|
|
3132
|
+
args: [
|
|
3133
|
+
{ name: "discriminant", label: "Value", type: "any", required: true },
|
|
3134
|
+
{ name: "cases", label: "Cases", type: "array", required: true },
|
|
3135
|
+
{ name: "default", label: "Default", type: "any", required: false }
|
|
3136
|
+
]
|
|
3137
|
+
},
|
|
3138
|
+
help: {
|
|
3139
|
+
summary: "Evaluate a value once and match it against case/result pairs (alias for switch)",
|
|
3140
|
+
details: 'Identical to "switch". Evaluates the discriminant expression once, then compares it against each case value using strict equality.',
|
|
3141
|
+
returnType: "any",
|
|
3142
|
+
examples: [
|
|
3143
|
+
{
|
|
3144
|
+
title: "Simple matching",
|
|
3145
|
+
rule: {
|
|
3146
|
+
match: [
|
|
3147
|
+
{ var: "color" },
|
|
3148
|
+
[
|
|
3149
|
+
["red", "stop"],
|
|
3150
|
+
["green", "go"]
|
|
3151
|
+
],
|
|
3152
|
+
"unknown"
|
|
3153
|
+
]
|
|
3154
|
+
},
|
|
3155
|
+
data: { color: "green" },
|
|
3156
|
+
result: "go"
|
|
3157
|
+
}
|
|
3158
|
+
],
|
|
3159
|
+
notes: ['Alias for "switch"', 'See "switch" for full documentation'],
|
|
3160
|
+
seeAlso: ["switch", "if", "?:"]
|
|
3161
|
+
},
|
|
3162
|
+
ui: {
|
|
3163
|
+
icon: "git-branch",
|
|
3164
|
+
shortLabel: "match",
|
|
3165
|
+
nodeType: "decision",
|
|
3166
|
+
collapsible: true,
|
|
3167
|
+
addArgumentLabel: "Add Case"
|
|
3168
|
+
},
|
|
3169
|
+
panel: {
|
|
3170
|
+
sections: [
|
|
3171
|
+
{
|
|
3172
|
+
id: "discriminant",
|
|
3173
|
+
title: "Match Value",
|
|
3174
|
+
fields: [
|
|
3175
|
+
{
|
|
3176
|
+
id: "discriminant",
|
|
3177
|
+
label: "Value",
|
|
3178
|
+
inputType: "expression",
|
|
3179
|
+
required: true,
|
|
3180
|
+
helpText: "Expression to evaluate and match against cases"
|
|
3181
|
+
}
|
|
3182
|
+
]
|
|
3183
|
+
},
|
|
3184
|
+
{
|
|
3185
|
+
id: "cases",
|
|
3186
|
+
title: "Cases",
|
|
3187
|
+
fields: [
|
|
3188
|
+
{
|
|
3189
|
+
id: "case",
|
|
3190
|
+
label: "Case",
|
|
3191
|
+
inputType: "expression",
|
|
3192
|
+
repeatable: true,
|
|
3193
|
+
helpText: "Case value and result pairs"
|
|
3194
|
+
}
|
|
3195
|
+
]
|
|
3196
|
+
},
|
|
3197
|
+
{
|
|
3198
|
+
id: "default",
|
|
3199
|
+
title: "Default",
|
|
3200
|
+
fields: [
|
|
3201
|
+
{
|
|
3202
|
+
id: "hasDefault",
|
|
3203
|
+
label: "Has Default",
|
|
3204
|
+
inputType: "boolean",
|
|
3205
|
+
defaultValue: false
|
|
3206
|
+
},
|
|
3207
|
+
{
|
|
3208
|
+
id: "default",
|
|
3209
|
+
label: "Default",
|
|
3210
|
+
inputType: "expression",
|
|
3211
|
+
showWhen: [{ field: "hasDefault", operator: "equals", value: true }],
|
|
3212
|
+
helpText: "Value returned if no cases match"
|
|
3213
|
+
}
|
|
3214
|
+
]
|
|
3215
|
+
}
|
|
3216
|
+
]
|
|
3217
|
+
}
|
|
3218
|
+
},
|
|
2948
3219
|
"??": {
|
|
2949
3220
|
name: "??",
|
|
2950
3221
|
label: "Coalesce",
|
|
@@ -5558,6 +5829,21 @@ function generateExpressionText(value, maxLength = 100) {
|
|
|
5558
5829
|
}
|
|
5559
5830
|
return parts.join(" ");
|
|
5560
5831
|
}
|
|
5832
|
+
if (op === "switch" || op === "match") {
|
|
5833
|
+
const parts = [`${op}(${toText(args[0])})`];
|
|
5834
|
+
if (args.length >= 2 && Array.isArray(args[1])) {
|
|
5835
|
+
const cases = args[1];
|
|
5836
|
+
for (const c of cases) {
|
|
5837
|
+
if (Array.isArray(c) && c.length >= 2) {
|
|
5838
|
+
parts.push(`${toText(c[0])}: ${toText(c[1])}`);
|
|
5839
|
+
}
|
|
5840
|
+
}
|
|
5841
|
+
}
|
|
5842
|
+
if (args.length >= 3) {
|
|
5843
|
+
parts.push(`default: ${toText(args[2])}`);
|
|
5844
|
+
}
|
|
5845
|
+
return parts.join(", ");
|
|
5846
|
+
}
|
|
5561
5847
|
return `${op}(${args.map((a) => toText(a)).join(", ")})`;
|
|
5562
5848
|
}
|
|
5563
5849
|
return String(val);
|
|
@@ -5662,7 +5948,8 @@ const ICON_COMPONENTS = {
|
|
|
5662
5948
|
"layers": Layers,
|
|
5663
5949
|
"clock": Clock,
|
|
5664
5950
|
"alert-circle": CircleAlert,
|
|
5665
|
-
"arrow-up": ArrowUp
|
|
5951
|
+
"arrow-up": ArrowUp,
|
|
5952
|
+
"tag": Tag
|
|
5666
5953
|
};
|
|
5667
5954
|
function Icon({ name, size = 14, className, style }) {
|
|
5668
5955
|
const IconComponent = ICON_COMPONENTS[name];
|
|
@@ -6331,6 +6618,171 @@ function convertIfElse(ifArgs, context, convertValue) {
|
|
|
6331
6618
|
return nodeId;
|
|
6332
6619
|
}
|
|
6333
6620
|
|
|
6621
|
+
function convertSwitch(operator, switchArgs, context, convertValue) {
|
|
6622
|
+
const parentInfo = getParentInfo(context);
|
|
6623
|
+
const nodeId = v4();
|
|
6624
|
+
const cells = [];
|
|
6625
|
+
let cellIndex = 0;
|
|
6626
|
+
let branchIndex = 0;
|
|
6627
|
+
if (switchArgs.length >= 1) {
|
|
6628
|
+
const discriminant = switchArgs[0];
|
|
6629
|
+
if (isSimpleOperand(discriminant)) {
|
|
6630
|
+
cells.push({
|
|
6631
|
+
type: "inline",
|
|
6632
|
+
icon: "diamond",
|
|
6633
|
+
rowLabel: "Match",
|
|
6634
|
+
label: formatOperandLabel(discriminant),
|
|
6635
|
+
index: cellIndex
|
|
6636
|
+
});
|
|
6637
|
+
} else {
|
|
6638
|
+
const discBranchId = convertValue(discriminant, {
|
|
6639
|
+
nodes: context.nodes,
|
|
6640
|
+
edges: context.edges,
|
|
6641
|
+
parentId: nodeId,
|
|
6642
|
+
argIndex: 0,
|
|
6643
|
+
preserveStructure: context.preserveStructure
|
|
6644
|
+
});
|
|
6645
|
+
context.edges.push(createBranchEdge(nodeId, discBranchId, branchIndex));
|
|
6646
|
+
cells.push({
|
|
6647
|
+
type: "branch",
|
|
6648
|
+
icon: "diamond",
|
|
6649
|
+
rowLabel: "Match",
|
|
6650
|
+
label: generateExpressionText(discriminant, 40),
|
|
6651
|
+
branchId: discBranchId,
|
|
6652
|
+
index: cellIndex
|
|
6653
|
+
});
|
|
6654
|
+
branchIndex++;
|
|
6655
|
+
}
|
|
6656
|
+
cellIndex++;
|
|
6657
|
+
}
|
|
6658
|
+
if (switchArgs.length >= 2) {
|
|
6659
|
+
const cases = switchArgs[1];
|
|
6660
|
+
const casePairs = Array.isArray(cases) ? cases : [];
|
|
6661
|
+
for (let i = 0; i < casePairs.length; i++) {
|
|
6662
|
+
const pair = casePairs[i];
|
|
6663
|
+
if (!Array.isArray(pair) || pair.length < 2) continue;
|
|
6664
|
+
const caseValue = pair[0];
|
|
6665
|
+
const resultValue = pair[1];
|
|
6666
|
+
if (isSimpleOperand(caseValue)) {
|
|
6667
|
+
cells.push({
|
|
6668
|
+
type: "inline",
|
|
6669
|
+
icon: "tag",
|
|
6670
|
+
rowLabel: "Case",
|
|
6671
|
+
label: formatOperandLabel(caseValue),
|
|
6672
|
+
index: cellIndex
|
|
6673
|
+
});
|
|
6674
|
+
} else {
|
|
6675
|
+
const caseBranchId = convertValue(caseValue, {
|
|
6676
|
+
nodes: context.nodes,
|
|
6677
|
+
edges: context.edges,
|
|
6678
|
+
parentId: nodeId,
|
|
6679
|
+
argIndex: cellIndex,
|
|
6680
|
+
preserveStructure: context.preserveStructure
|
|
6681
|
+
});
|
|
6682
|
+
context.edges.push(createBranchEdge(nodeId, caseBranchId, branchIndex));
|
|
6683
|
+
cells.push({
|
|
6684
|
+
type: "branch",
|
|
6685
|
+
icon: "tag",
|
|
6686
|
+
rowLabel: "Case",
|
|
6687
|
+
label: generateExpressionText(caseValue, 40),
|
|
6688
|
+
branchId: caseBranchId,
|
|
6689
|
+
index: cellIndex
|
|
6690
|
+
});
|
|
6691
|
+
branchIndex++;
|
|
6692
|
+
}
|
|
6693
|
+
cellIndex++;
|
|
6694
|
+
if (isSimpleOperand(resultValue)) {
|
|
6695
|
+
cells.push({
|
|
6696
|
+
type: "inline",
|
|
6697
|
+
icon: "check",
|
|
6698
|
+
rowLabel: "Then",
|
|
6699
|
+
label: formatOperandLabel(resultValue),
|
|
6700
|
+
index: cellIndex
|
|
6701
|
+
});
|
|
6702
|
+
} else {
|
|
6703
|
+
const resultBranchId = convertValue(resultValue, {
|
|
6704
|
+
nodes: context.nodes,
|
|
6705
|
+
edges: context.edges,
|
|
6706
|
+
parentId: nodeId,
|
|
6707
|
+
argIndex: cellIndex,
|
|
6708
|
+
branchType: "yes",
|
|
6709
|
+
preserveStructure: context.preserveStructure
|
|
6710
|
+
});
|
|
6711
|
+
context.edges.push(createBranchEdge(nodeId, resultBranchId, branchIndex));
|
|
6712
|
+
cells.push({
|
|
6713
|
+
type: "branch",
|
|
6714
|
+
icon: "check",
|
|
6715
|
+
rowLabel: "Then",
|
|
6716
|
+
label: generateExpressionText(resultValue, 40),
|
|
6717
|
+
branchId: resultBranchId,
|
|
6718
|
+
index: cellIndex
|
|
6719
|
+
});
|
|
6720
|
+
branchIndex++;
|
|
6721
|
+
}
|
|
6722
|
+
cellIndex++;
|
|
6723
|
+
}
|
|
6724
|
+
}
|
|
6725
|
+
if (switchArgs.length >= 3) {
|
|
6726
|
+
const defaultValue = switchArgs[2];
|
|
6727
|
+
if (isSimpleOperand(defaultValue)) {
|
|
6728
|
+
cells.push({
|
|
6729
|
+
type: "inline",
|
|
6730
|
+
icon: "x",
|
|
6731
|
+
rowLabel: "Default",
|
|
6732
|
+
label: formatOperandLabel(defaultValue),
|
|
6733
|
+
index: cellIndex
|
|
6734
|
+
});
|
|
6735
|
+
} else {
|
|
6736
|
+
const defaultBranchId = convertValue(defaultValue, {
|
|
6737
|
+
nodes: context.nodes,
|
|
6738
|
+
edges: context.edges,
|
|
6739
|
+
parentId: nodeId,
|
|
6740
|
+
argIndex: cellIndex,
|
|
6741
|
+
branchType: "no",
|
|
6742
|
+
preserveStructure: context.preserveStructure
|
|
6743
|
+
});
|
|
6744
|
+
context.edges.push(createBranchEdge(nodeId, defaultBranchId, branchIndex));
|
|
6745
|
+
cells.push({
|
|
6746
|
+
type: "branch",
|
|
6747
|
+
icon: "x",
|
|
6748
|
+
rowLabel: "Default",
|
|
6749
|
+
label: generateExpressionText(defaultValue, 40),
|
|
6750
|
+
branchId: defaultBranchId,
|
|
6751
|
+
index: cellIndex
|
|
6752
|
+
});
|
|
6753
|
+
}
|
|
6754
|
+
}
|
|
6755
|
+
const originalExpr = { [operator]: switchArgs };
|
|
6756
|
+
const expressionText = generateExpressionText(originalExpr);
|
|
6757
|
+
const label = operator === "match" ? "Match / Case" : "Switch / Case";
|
|
6758
|
+
const switchNode = {
|
|
6759
|
+
id: nodeId,
|
|
6760
|
+
type: "operator",
|
|
6761
|
+
position: { x: 0, y: 0 },
|
|
6762
|
+
data: {
|
|
6763
|
+
type: "operator",
|
|
6764
|
+
operator,
|
|
6765
|
+
category: "control",
|
|
6766
|
+
label,
|
|
6767
|
+
icon: "diamond",
|
|
6768
|
+
cells,
|
|
6769
|
+
collapsed: false,
|
|
6770
|
+
expressionText,
|
|
6771
|
+
parentId: parentInfo.parentId,
|
|
6772
|
+
argIndex: parentInfo.argIndex,
|
|
6773
|
+
branchType: parentInfo.branchType,
|
|
6774
|
+
expression: originalExpr
|
|
6775
|
+
}
|
|
6776
|
+
};
|
|
6777
|
+
context.nodes.push(switchNode);
|
|
6778
|
+
if (parentInfo.parentId && !parentInfo.branchType) {
|
|
6779
|
+
context.edges.push(
|
|
6780
|
+
createArgEdge(parentInfo.parentId, nodeId, parentInfo.argIndex ?? 0)
|
|
6781
|
+
);
|
|
6782
|
+
}
|
|
6783
|
+
return nodeId;
|
|
6784
|
+
}
|
|
6785
|
+
|
|
6334
6786
|
function convertOperator$1(operator, operandArray, context, convertValue) {
|
|
6335
6787
|
const nodeId = v4();
|
|
6336
6788
|
const op = getOperator(operator);
|
|
@@ -6529,6 +6981,10 @@ function convertValue(value, context) {
|
|
|
6529
6981
|
const ifArgs = Array.isArray(operands) ? operands : [operands];
|
|
6530
6982
|
return convertIfElse(ifArgs, context, convertValue);
|
|
6531
6983
|
}
|
|
6984
|
+
if (operator === "switch" || operator === "match") {
|
|
6985
|
+
const switchArgs = Array.isArray(operands) ? operands : [operands];
|
|
6986
|
+
return convertSwitch(operator, switchArgs, context, convertValue);
|
|
6987
|
+
}
|
|
6532
6988
|
if (isVariableOperator(operator)) {
|
|
6533
6989
|
return convertVariable(operator, operands, context, convertValue);
|
|
6534
6990
|
}
|
|
@@ -6670,17 +7126,33 @@ function createVariableNodeFromTrace(nodeId, expression, children, context, pare
|
|
|
6670
7126
|
}
|
|
6671
7127
|
}
|
|
6672
7128
|
|
|
7129
|
+
function deepEqual(a, b) {
|
|
7130
|
+
if (a === b) return true;
|
|
7131
|
+
if (a === null || b === null || typeof a !== typeof b) return a === b;
|
|
7132
|
+
if (Array.isArray(a)) {
|
|
7133
|
+
if (!Array.isArray(b) || a.length !== b.length) return false;
|
|
7134
|
+
return a.every((v, i) => deepEqual(v, b[i]));
|
|
7135
|
+
}
|
|
7136
|
+
if (typeof a === "object") {
|
|
7137
|
+
const aObj = a;
|
|
7138
|
+
const bObj = b;
|
|
7139
|
+
const aKeys = Object.keys(aObj);
|
|
7140
|
+
const bKeys = Object.keys(bObj);
|
|
7141
|
+
if (aKeys.length !== bKeys.length) return false;
|
|
7142
|
+
return aKeys.every((k) => k in bObj && deepEqual(aObj[k], bObj[k]));
|
|
7143
|
+
}
|
|
7144
|
+
return false;
|
|
7145
|
+
}
|
|
6673
7146
|
function findMatchingChild(operand, children, usedIndices) {
|
|
6674
|
-
const operandStr = JSON.stringify(operand);
|
|
6675
7147
|
for (let i = 0; i < children.length; i++) {
|
|
6676
7148
|
if (usedIndices.has(i)) continue;
|
|
6677
7149
|
try {
|
|
6678
|
-
const
|
|
6679
|
-
if (
|
|
7150
|
+
const childExpr = JSON.parse(children[i].expression);
|
|
7151
|
+
if (deepEqual(operand, childExpr)) {
|
|
6680
7152
|
return { child: children[i], index: i };
|
|
6681
7153
|
}
|
|
6682
7154
|
} catch {
|
|
6683
|
-
if (children[i].expression ===
|
|
7155
|
+
if (children[i].expression === JSON.stringify(operand)) {
|
|
6684
7156
|
return { child: children[i], index: i };
|
|
6685
7157
|
}
|
|
6686
7158
|
}
|
|
@@ -7041,6 +7513,174 @@ function createIfElseNodeFromTrace(nodeId, expression, children, context, parent
|
|
|
7041
7513
|
}
|
|
7042
7514
|
}
|
|
7043
7515
|
|
|
7516
|
+
function createSwitchNodeFromTrace(nodeId, expression, children, context, parentInfo, processExpressionNode, createFallbackNode) {
|
|
7517
|
+
const obj = expression;
|
|
7518
|
+
const operator = Object.keys(obj)[0];
|
|
7519
|
+
const switchArgs = obj[operator];
|
|
7520
|
+
const usedChildIndices = /* @__PURE__ */ new Set();
|
|
7521
|
+
const cells = [];
|
|
7522
|
+
let cellIndex = 0;
|
|
7523
|
+
let branchIndex = 0;
|
|
7524
|
+
function processBranch(value, argIndex, branchType) {
|
|
7525
|
+
let branchId;
|
|
7526
|
+
const match = findMatchingChild(value, children, usedChildIndices);
|
|
7527
|
+
if (match) {
|
|
7528
|
+
usedChildIndices.add(match.index);
|
|
7529
|
+
branchId = processExpressionNode(match.child, context, {
|
|
7530
|
+
parentId: nodeId,
|
|
7531
|
+
argIndex,
|
|
7532
|
+
branchType
|
|
7533
|
+
});
|
|
7534
|
+
} else {
|
|
7535
|
+
const nodeType = determineNodeType(value, context.preserveStructure);
|
|
7536
|
+
const nextUnused = nodeType !== "literal" ? getNextUnusedChild(children, usedChildIndices) : null;
|
|
7537
|
+
if (nextUnused) {
|
|
7538
|
+
usedChildIndices.add(nextUnused.index);
|
|
7539
|
+
branchId = processExpressionNode(nextUnused.child, context, {
|
|
7540
|
+
parentId: nodeId,
|
|
7541
|
+
argIndex,
|
|
7542
|
+
branchType
|
|
7543
|
+
}, value);
|
|
7544
|
+
} else {
|
|
7545
|
+
branchId = `${nodeId}-arg-${argIndex}`;
|
|
7546
|
+
createFallbackNode(branchId, value, context, {
|
|
7547
|
+
parentId: nodeId,
|
|
7548
|
+
argIndex,
|
|
7549
|
+
branchType
|
|
7550
|
+
});
|
|
7551
|
+
}
|
|
7552
|
+
}
|
|
7553
|
+
return branchId;
|
|
7554
|
+
}
|
|
7555
|
+
if (switchArgs.length >= 1) {
|
|
7556
|
+
const discriminant = switchArgs[0];
|
|
7557
|
+
if (isSimpleOperand(discriminant)) {
|
|
7558
|
+
cells.push({
|
|
7559
|
+
type: "inline",
|
|
7560
|
+
icon: "diamond",
|
|
7561
|
+
rowLabel: "Match",
|
|
7562
|
+
label: formatOperandLabel(discriminant),
|
|
7563
|
+
index: cellIndex
|
|
7564
|
+
});
|
|
7565
|
+
} else {
|
|
7566
|
+
const discBranchId = processBranch(discriminant, 0);
|
|
7567
|
+
context.edges.push(createBranchEdge(nodeId, discBranchId, branchIndex));
|
|
7568
|
+
cells.push({
|
|
7569
|
+
type: "branch",
|
|
7570
|
+
icon: "diamond",
|
|
7571
|
+
rowLabel: "Match",
|
|
7572
|
+
label: generateExpressionText(discriminant, 40),
|
|
7573
|
+
branchId: discBranchId,
|
|
7574
|
+
index: cellIndex
|
|
7575
|
+
});
|
|
7576
|
+
branchIndex++;
|
|
7577
|
+
}
|
|
7578
|
+
cellIndex++;
|
|
7579
|
+
}
|
|
7580
|
+
if (switchArgs.length >= 2) {
|
|
7581
|
+
const cases = switchArgs[1];
|
|
7582
|
+
const casePairs = Array.isArray(cases) ? cases : [];
|
|
7583
|
+
for (let i = 0; i < casePairs.length; i++) {
|
|
7584
|
+
const pair = casePairs[i];
|
|
7585
|
+
if (!Array.isArray(pair) || pair.length < 2) continue;
|
|
7586
|
+
const caseValue = pair[0];
|
|
7587
|
+
const resultValue = pair[1];
|
|
7588
|
+
if (isSimpleOperand(caseValue)) {
|
|
7589
|
+
cells.push({
|
|
7590
|
+
type: "inline",
|
|
7591
|
+
icon: "tag",
|
|
7592
|
+
rowLabel: "Case",
|
|
7593
|
+
label: formatOperandLabel(caseValue),
|
|
7594
|
+
index: cellIndex
|
|
7595
|
+
});
|
|
7596
|
+
} else {
|
|
7597
|
+
const caseBranchId = processBranch(caseValue, cellIndex);
|
|
7598
|
+
context.edges.push(createBranchEdge(nodeId, caseBranchId, branchIndex));
|
|
7599
|
+
cells.push({
|
|
7600
|
+
type: "branch",
|
|
7601
|
+
icon: "tag",
|
|
7602
|
+
rowLabel: "Case",
|
|
7603
|
+
label: generateExpressionText(caseValue, 40),
|
|
7604
|
+
branchId: caseBranchId,
|
|
7605
|
+
index: cellIndex
|
|
7606
|
+
});
|
|
7607
|
+
branchIndex++;
|
|
7608
|
+
}
|
|
7609
|
+
cellIndex++;
|
|
7610
|
+
if (isSimpleOperand(resultValue)) {
|
|
7611
|
+
cells.push({
|
|
7612
|
+
type: "inline",
|
|
7613
|
+
icon: "check",
|
|
7614
|
+
rowLabel: "Then",
|
|
7615
|
+
label: formatOperandLabel(resultValue),
|
|
7616
|
+
index: cellIndex
|
|
7617
|
+
});
|
|
7618
|
+
} else {
|
|
7619
|
+
const resultBranchId = processBranch(resultValue, cellIndex, "yes");
|
|
7620
|
+
context.edges.push(createBranchEdge(nodeId, resultBranchId, branchIndex));
|
|
7621
|
+
cells.push({
|
|
7622
|
+
type: "branch",
|
|
7623
|
+
icon: "check",
|
|
7624
|
+
rowLabel: "Then",
|
|
7625
|
+
label: generateExpressionText(resultValue, 40),
|
|
7626
|
+
branchId: resultBranchId,
|
|
7627
|
+
index: cellIndex
|
|
7628
|
+
});
|
|
7629
|
+
branchIndex++;
|
|
7630
|
+
}
|
|
7631
|
+
cellIndex++;
|
|
7632
|
+
}
|
|
7633
|
+
}
|
|
7634
|
+
if (switchArgs.length >= 3) {
|
|
7635
|
+
const defaultValue = switchArgs[2];
|
|
7636
|
+
if (isSimpleOperand(defaultValue)) {
|
|
7637
|
+
cells.push({
|
|
7638
|
+
type: "inline",
|
|
7639
|
+
icon: "x",
|
|
7640
|
+
rowLabel: "Default",
|
|
7641
|
+
label: formatOperandLabel(defaultValue),
|
|
7642
|
+
index: cellIndex
|
|
7643
|
+
});
|
|
7644
|
+
} else {
|
|
7645
|
+
const defaultBranchId = processBranch(defaultValue, cellIndex, "no");
|
|
7646
|
+
context.edges.push(createBranchEdge(nodeId, defaultBranchId, branchIndex));
|
|
7647
|
+
cells.push({
|
|
7648
|
+
type: "branch",
|
|
7649
|
+
icon: "x",
|
|
7650
|
+
rowLabel: "Default",
|
|
7651
|
+
label: generateExpressionText(defaultValue, 40),
|
|
7652
|
+
branchId: defaultBranchId,
|
|
7653
|
+
index: cellIndex
|
|
7654
|
+
});
|
|
7655
|
+
}
|
|
7656
|
+
}
|
|
7657
|
+
const expressionText = generateExpressionText(expression);
|
|
7658
|
+
const label = operator === "match" ? "Match / Case" : "Switch / Case";
|
|
7659
|
+
const switchNode = {
|
|
7660
|
+
id: nodeId,
|
|
7661
|
+
type: "operator",
|
|
7662
|
+
position: { x: 0, y: 0 },
|
|
7663
|
+
data: {
|
|
7664
|
+
type: "operator",
|
|
7665
|
+
operator,
|
|
7666
|
+
category: "control",
|
|
7667
|
+
label,
|
|
7668
|
+
icon: "diamond",
|
|
7669
|
+
cells,
|
|
7670
|
+
collapsed: false,
|
|
7671
|
+
expressionText,
|
|
7672
|
+
parentId: parentInfo.parentId,
|
|
7673
|
+
argIndex: parentInfo.argIndex,
|
|
7674
|
+
branchType: parentInfo.branchType,
|
|
7675
|
+
expression
|
|
7676
|
+
}
|
|
7677
|
+
};
|
|
7678
|
+
context.nodes.push(switchNode);
|
|
7679
|
+
if (parentInfo.parentId && !parentInfo.branchType) {
|
|
7680
|
+
context.edges.push(createArgEdge(parentInfo.parentId, nodeId, parentInfo.argIndex ?? 0));
|
|
7681
|
+
}
|
|
7682
|
+
}
|
|
7683
|
+
|
|
7044
7684
|
const EXPR_PLACEHOLDER = "{{EXPR}}";
|
|
7045
7685
|
const EXPR_PLACEHOLDER_QUOTED = `"${EXPR_PLACEHOLDER}"`;
|
|
7046
7686
|
function isExpressionBranch(item, preserveStructure) {
|
|
@@ -7208,6 +7848,16 @@ function processExpressionNode(exprNode, context, parentInfo = {}, originalExpre
|
|
|
7208
7848
|
processExpressionNode,
|
|
7209
7849
|
createFallbackNode
|
|
7210
7850
|
);
|
|
7851
|
+
} else if (op === "switch" || op === "match") {
|
|
7852
|
+
createSwitchNodeFromTrace(
|
|
7853
|
+
nodeId,
|
|
7854
|
+
expression,
|
|
7855
|
+
exprNode.children,
|
|
7856
|
+
context,
|
|
7857
|
+
parentInfo,
|
|
7858
|
+
processExpressionNode,
|
|
7859
|
+
createFallbackNode
|
|
7860
|
+
);
|
|
7211
7861
|
} else {
|
|
7212
7862
|
const operands = obj[op];
|
|
7213
7863
|
const args = Array.isArray(operands) ? operands : [operands];
|
|
@@ -7281,6 +7931,16 @@ function createFallbackNode(nodeId, value, context, parentInfo) {
|
|
|
7281
7931
|
processExpressionNode,
|
|
7282
7932
|
createFallbackNode
|
|
7283
7933
|
);
|
|
7934
|
+
} else if (op === "switch" || op === "match") {
|
|
7935
|
+
createSwitchNodeFromTrace(
|
|
7936
|
+
nodeId,
|
|
7937
|
+
value,
|
|
7938
|
+
[],
|
|
7939
|
+
context,
|
|
7940
|
+
parentInfo,
|
|
7941
|
+
processExpressionNode,
|
|
7942
|
+
createFallbackNode
|
|
7943
|
+
);
|
|
7284
7944
|
} else {
|
|
7285
7945
|
const operands = obj[op];
|
|
7286
7946
|
const args = Array.isArray(operands) ? operands : [operands];
|
|
@@ -14545,7 +15205,7 @@ function useWasmEvaluator(options = {}) {
|
|
|
14545
15205
|
try {
|
|
14546
15206
|
setLoading(true);
|
|
14547
15207
|
setError(null);
|
|
14548
|
-
const wasm = await Promise.resolve().then(() => require('./datalogic_wasm-
|
|
15208
|
+
const wasm = await Promise.resolve().then(() => require('./datalogic_wasm-CJRUeom8.cjs'));
|
|
14549
15209
|
await wasm.default();
|
|
14550
15210
|
if (!cancelled) {
|
|
14551
15211
|
moduleRef.current = {
|
|
@@ -16446,6 +17106,9 @@ function convertOperator(data, nodeMap) {
|
|
|
16446
17106
|
resultArgs.push(storedOperands[i]);
|
|
16447
17107
|
}
|
|
16448
17108
|
}
|
|
17109
|
+
if (data.operator === "switch" || data.operator === "match") {
|
|
17110
|
+
return convertSwitchFromCells(data, storedOperands, nodeMap);
|
|
17111
|
+
}
|
|
16449
17112
|
if (data.operator === "val") {
|
|
16450
17113
|
return convertValFromCells(data);
|
|
16451
17114
|
}
|
|
@@ -16457,6 +17120,44 @@ function convertOperator(data, nodeMap) {
|
|
|
16457
17120
|
}
|
|
16458
17121
|
return { [data.operator]: resultArgs };
|
|
16459
17122
|
}
|
|
17123
|
+
function convertSwitchFromCells(data, storedOperands, nodeMap) {
|
|
17124
|
+
const storedCases = Array.isArray(storedOperands[1]) ? storedOperands[1] : [];
|
|
17125
|
+
let discriminant = null;
|
|
17126
|
+
const casePairs = [];
|
|
17127
|
+
let defaultValue;
|
|
17128
|
+
let pendingCaseValue = null;
|
|
17129
|
+
let caseIndex = 0;
|
|
17130
|
+
for (const cell of data.cells) {
|
|
17131
|
+
if (cell.rowLabel === "Match") {
|
|
17132
|
+
discriminant = resolveCellValue(cell, storedOperands[0], nodeMap);
|
|
17133
|
+
} else if (cell.rowLabel === "Case") {
|
|
17134
|
+
const storedPair = storedCases[caseIndex];
|
|
17135
|
+
pendingCaseValue = resolveCellValue(cell, storedPair?.[0] ?? null, nodeMap);
|
|
17136
|
+
} else if (cell.rowLabel === "Then" && pendingCaseValue !== null) {
|
|
17137
|
+
const storedPair = storedCases[caseIndex];
|
|
17138
|
+
const resultValue = resolveCellValue(cell, storedPair?.[1] ?? null, nodeMap);
|
|
17139
|
+
casePairs.push([pendingCaseValue, resultValue]);
|
|
17140
|
+
pendingCaseValue = null;
|
|
17141
|
+
caseIndex++;
|
|
17142
|
+
} else if (cell.rowLabel === "Default") {
|
|
17143
|
+
defaultValue = resolveCellValue(cell, storedOperands[2] ?? null, nodeMap);
|
|
17144
|
+
}
|
|
17145
|
+
}
|
|
17146
|
+
const args = [discriminant, casePairs];
|
|
17147
|
+
if (defaultValue !== void 0) {
|
|
17148
|
+
args.push(defaultValue);
|
|
17149
|
+
}
|
|
17150
|
+
return { [data.operator]: args };
|
|
17151
|
+
}
|
|
17152
|
+
function resolveCellValue(cell, storedValue, nodeMap) {
|
|
17153
|
+
if (cell.type === "branch" && cell.branchId) {
|
|
17154
|
+
const branchNode = nodeMap.get(cell.branchId);
|
|
17155
|
+
if (branchNode) {
|
|
17156
|
+
return convertNode(branchNode.data, nodeMap);
|
|
17157
|
+
}
|
|
17158
|
+
}
|
|
17159
|
+
return storedValue;
|
|
17160
|
+
}
|
|
16460
17161
|
function convertValFromCells(data) {
|
|
16461
17162
|
const scopeCell = data.cells.find((c) => c.fieldId === "scopeLevel");
|
|
16462
17163
|
const pathCells = data.cells.filter((c) => c.fieldId === "path");
|