@kaskad/core 0.0.7 → 0.0.9
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/fesm2022/kaskad-core.mjs
CHANGED
|
@@ -46,13 +46,13 @@ class TemplateLoadingTracker {
|
|
|
46
46
|
// Export a singleton instance for tracking template loading operations
|
|
47
47
|
const templateLoadingTracker = new TemplateLoadingTracker();
|
|
48
48
|
|
|
49
|
-
function execute$
|
|
49
|
+
function execute$X(_ctx, ms) {
|
|
50
50
|
return new Promise((resolve) => setTimeout(() => resolve(), ms));
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
var delay$1 = /*#__PURE__*/Object.freeze({
|
|
54
54
|
__proto__: null,
|
|
55
|
-
execute: execute$
|
|
55
|
+
execute: execute$X
|
|
56
56
|
});
|
|
57
57
|
|
|
58
58
|
const commands$1 = {
|
|
@@ -86,7 +86,7 @@ const and = {
|
|
|
86
86
|
signature: '(...unknown) => boolean',
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
function execute$
|
|
89
|
+
function execute$W(source, path) {
|
|
90
90
|
const takeDeep = (source, path) => path.reduce((current, step) => {
|
|
91
91
|
return current?.[step];
|
|
92
92
|
}, source);
|
|
@@ -94,108 +94,99 @@ function execute$U(source, path) {
|
|
|
94
94
|
}
|
|
95
95
|
const arrayPluck = {
|
|
96
96
|
kind: 'imperative',
|
|
97
|
-
execute: execute$
|
|
97
|
+
execute: execute$W,
|
|
98
98
|
signature: '(unknown{}[], string[]) => unknown',
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
-
function execute$
|
|
101
|
+
function execute$V(value, index) {
|
|
102
102
|
return value[index];
|
|
103
103
|
}
|
|
104
104
|
const at = {
|
|
105
105
|
kind: 'imperative',
|
|
106
|
-
execute: execute$
|
|
106
|
+
execute: execute$V,
|
|
107
107
|
signature: '(unknown[], number) => unknown',
|
|
108
108
|
};
|
|
109
109
|
|
|
110
|
-
function execute$
|
|
110
|
+
function execute$U(value) {
|
|
111
111
|
return Boolean(value);
|
|
112
112
|
}
|
|
113
113
|
const bool = {
|
|
114
114
|
kind: 'imperative',
|
|
115
|
-
execute: execute$
|
|
115
|
+
execute: execute$U,
|
|
116
116
|
signature: '(unknown) => boolean',
|
|
117
117
|
};
|
|
118
118
|
|
|
119
|
-
function execute$
|
|
119
|
+
function execute$T(value) {
|
|
120
120
|
return Math.ceil(value);
|
|
121
121
|
}
|
|
122
122
|
const ceil = {
|
|
123
123
|
kind: 'imperative',
|
|
124
|
-
execute: execute$
|
|
124
|
+
execute: execute$T,
|
|
125
125
|
signature: '(number) => number',
|
|
126
126
|
};
|
|
127
127
|
|
|
128
|
-
function execute$
|
|
128
|
+
function execute$S(strings, separator = '') {
|
|
129
129
|
return strings.join(separator);
|
|
130
130
|
}
|
|
131
131
|
const concat = {
|
|
132
132
|
kind: 'imperative',
|
|
133
|
-
execute: execute$
|
|
133
|
+
execute: execute$S,
|
|
134
134
|
signature: '(unknown[], string) => string',
|
|
135
135
|
};
|
|
136
136
|
|
|
137
|
-
const execute$
|
|
137
|
+
const execute$R = (value) => {
|
|
138
138
|
return new Promise((resolve) => setTimeout(() => resolve(value), 500));
|
|
139
139
|
};
|
|
140
140
|
const delay = {
|
|
141
141
|
kind: 'imperative',
|
|
142
|
-
execute: execute$
|
|
142
|
+
execute: execute$R,
|
|
143
143
|
signature: '(unknown) => unknown',
|
|
144
144
|
};
|
|
145
145
|
|
|
146
|
-
function execute$
|
|
146
|
+
function execute$Q(num1, num2) {
|
|
147
147
|
return num1 / num2;
|
|
148
148
|
}
|
|
149
149
|
const divide = {
|
|
150
150
|
kind: 'imperative',
|
|
151
|
-
execute: execute$
|
|
151
|
+
execute: execute$Q,
|
|
152
152
|
signature: '(number, number) => number',
|
|
153
153
|
};
|
|
154
154
|
|
|
155
|
-
function execute$
|
|
155
|
+
function execute$P(items) {
|
|
156
156
|
return items.length === 0;
|
|
157
157
|
}
|
|
158
158
|
const empty = {
|
|
159
159
|
kind: 'imperative',
|
|
160
|
-
execute: execute$
|
|
160
|
+
execute: execute$P,
|
|
161
161
|
signature: '(unknown[]) => boolean',
|
|
162
162
|
};
|
|
163
163
|
|
|
164
|
-
function execute$
|
|
164
|
+
function execute$O(object) {
|
|
165
165
|
return Object.keys(object).length === 0;
|
|
166
166
|
}
|
|
167
167
|
const emptyObject = {
|
|
168
168
|
kind: 'imperative',
|
|
169
|
-
execute: execute$
|
|
169
|
+
execute: execute$O,
|
|
170
170
|
signature: '(unknown{}) => boolean',
|
|
171
171
|
};
|
|
172
172
|
|
|
173
|
-
const execute$
|
|
173
|
+
const execute$N = (a, b) => a === b;
|
|
174
174
|
const eq = {
|
|
175
175
|
kind: 'imperative',
|
|
176
|
-
execute: execute$
|
|
177
|
-
signature: '(unknown, unknown) => boolean',
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
function execute$K(value1, value2) {
|
|
181
|
-
return value1 === value2;
|
|
182
|
-
}
|
|
183
|
-
const equal = {
|
|
184
|
-
kind: 'imperative',
|
|
185
|
-
execute: execute$K,
|
|
176
|
+
execute: execute$N,
|
|
186
177
|
signature: '(unknown, unknown) => boolean',
|
|
187
178
|
};
|
|
188
179
|
|
|
189
|
-
function execute$
|
|
180
|
+
function execute$M(items) {
|
|
190
181
|
return items.every((item) => !!item);
|
|
191
182
|
}
|
|
192
183
|
const every = {
|
|
193
184
|
kind: 'imperative',
|
|
194
|
-
execute: execute$
|
|
185
|
+
execute: execute$M,
|
|
195
186
|
signature: '(unknown[]) => boolean',
|
|
196
187
|
};
|
|
197
188
|
|
|
198
|
-
function execute$
|
|
189
|
+
function execute$L(array, allowedValues) {
|
|
199
190
|
if (!allowedValues) {
|
|
200
191
|
return [];
|
|
201
192
|
}
|
|
@@ -206,60 +197,60 @@ function execute$I(array, allowedValues) {
|
|
|
206
197
|
}
|
|
207
198
|
const filterIn = {
|
|
208
199
|
kind: 'imperative',
|
|
209
|
-
execute: execute$
|
|
200
|
+
execute: execute$L,
|
|
210
201
|
signature: '(unknown[], unknown[]) => unknown[]',
|
|
211
202
|
};
|
|
212
203
|
|
|
213
|
-
function execute$
|
|
204
|
+
function execute$K(collection, key, values) {
|
|
214
205
|
return values
|
|
215
206
|
.map((value) => collection.find((element) => element[key] === value))
|
|
216
207
|
.filter((item) => item !== undefined);
|
|
217
208
|
}
|
|
218
209
|
const findAllBy = {
|
|
219
210
|
kind: 'imperative',
|
|
220
|
-
execute: execute$
|
|
211
|
+
execute: execute$K,
|
|
221
212
|
signature: '(unknown{}[], string, unknown[]) => unknown{}[]',
|
|
222
213
|
};
|
|
223
214
|
|
|
224
|
-
function execute$
|
|
215
|
+
function execute$J(collection, key, value) {
|
|
225
216
|
const found = collection.find((element) => element[key] === value);
|
|
226
217
|
return found || null;
|
|
227
218
|
}
|
|
228
219
|
const findBy = {
|
|
229
220
|
kind: 'imperative',
|
|
230
|
-
execute: execute$
|
|
221
|
+
execute: execute$J,
|
|
231
222
|
signature: '(unknown{}[], string, unknown) => unknown',
|
|
232
223
|
};
|
|
233
224
|
|
|
234
|
-
function execute$
|
|
225
|
+
function execute$I(array) {
|
|
235
226
|
return array.flat();
|
|
236
227
|
}
|
|
237
228
|
const flatten = {
|
|
238
229
|
kind: 'imperative',
|
|
239
|
-
execute: execute$
|
|
230
|
+
execute: execute$I,
|
|
240
231
|
signature: '(unknown[][]) => unknown[]',
|
|
241
232
|
};
|
|
242
233
|
|
|
243
|
-
function execute$
|
|
234
|
+
function execute$H(value) {
|
|
244
235
|
return Math.floor(value);
|
|
245
236
|
}
|
|
246
237
|
const floor = {
|
|
247
238
|
kind: 'imperative',
|
|
248
|
-
execute: execute$
|
|
239
|
+
execute: execute$H,
|
|
249
240
|
signature: '(number) => number',
|
|
250
241
|
};
|
|
251
242
|
|
|
252
|
-
const execute$
|
|
243
|
+
const execute$G = (a, b) => a > b;
|
|
253
244
|
const gt = {
|
|
254
245
|
kind: 'imperative',
|
|
255
|
-
execute: execute$
|
|
246
|
+
execute: execute$G,
|
|
256
247
|
signature: '(number, number) => boolean',
|
|
257
248
|
};
|
|
258
249
|
|
|
259
|
-
const execute$
|
|
250
|
+
const execute$F = (a, b) => a >= b;
|
|
260
251
|
const gte = {
|
|
261
252
|
kind: 'imperative',
|
|
262
|
-
execute: execute$
|
|
253
|
+
execute: execute$F,
|
|
263
254
|
signature: '(number, number) => boolean',
|
|
264
255
|
};
|
|
265
256
|
|
|
@@ -290,7 +281,7 @@ const ifFn = {
|
|
|
290
281
|
signature: '(unknown, unknown, unknown) => unknown',
|
|
291
282
|
};
|
|
292
283
|
|
|
293
|
-
function execute$
|
|
284
|
+
function execute$E(collection, value) {
|
|
294
285
|
if (collection instanceof Set) {
|
|
295
286
|
return collection.has(value);
|
|
296
287
|
}
|
|
@@ -298,7 +289,7 @@ function execute$B(collection, value) {
|
|
|
298
289
|
}
|
|
299
290
|
const inFn = {
|
|
300
291
|
kind: 'imperative',
|
|
301
|
-
execute: execute$
|
|
292
|
+
execute: execute$E,
|
|
302
293
|
signature: '(unknown[], unknown) => boolean',
|
|
303
294
|
};
|
|
304
295
|
|
|
@@ -308,96 +299,96 @@ function replacer(_key, value) {
|
|
|
308
299
|
}
|
|
309
300
|
return value;
|
|
310
301
|
}
|
|
311
|
-
function execute$
|
|
302
|
+
function execute$D(arg) {
|
|
312
303
|
return JSON.stringify(arg, replacer);
|
|
313
304
|
}
|
|
314
305
|
const json = {
|
|
315
306
|
kind: 'imperative',
|
|
316
|
-
execute: execute$
|
|
307
|
+
execute: execute$D,
|
|
317
308
|
signature: '(unknown) => string',
|
|
318
309
|
};
|
|
319
310
|
|
|
320
|
-
function execute$
|
|
311
|
+
function execute$C(object) {
|
|
321
312
|
return Object.keys(object);
|
|
322
313
|
}
|
|
323
314
|
const keys = {
|
|
324
315
|
kind: 'imperative',
|
|
325
|
-
execute: execute$
|
|
316
|
+
execute: execute$C,
|
|
326
317
|
signature: '(unknown{}) => string[]',
|
|
327
318
|
};
|
|
328
319
|
|
|
329
|
-
function execute$
|
|
320
|
+
function execute$B(value) {
|
|
330
321
|
return value.length;
|
|
331
322
|
}
|
|
332
323
|
const length = {
|
|
333
324
|
kind: 'imperative',
|
|
334
|
-
execute: execute$
|
|
325
|
+
execute: execute$B,
|
|
335
326
|
signature: '(unknown[]) => number',
|
|
336
327
|
};
|
|
337
328
|
|
|
338
|
-
const execute$
|
|
329
|
+
const execute$A = (a, b) => a < b;
|
|
339
330
|
const lt = {
|
|
340
331
|
kind: 'imperative',
|
|
341
|
-
execute: execute$
|
|
332
|
+
execute: execute$A,
|
|
342
333
|
signature: '(number, number) => boolean',
|
|
343
334
|
};
|
|
344
335
|
|
|
345
|
-
const execute$
|
|
336
|
+
const execute$z = (a, b) => a <= b;
|
|
346
337
|
const lte = {
|
|
347
338
|
kind: 'imperative',
|
|
348
|
-
execute: execute$
|
|
339
|
+
execute: execute$z,
|
|
349
340
|
signature: '(number, number) => boolean',
|
|
350
341
|
};
|
|
351
342
|
|
|
352
|
-
function execute$
|
|
343
|
+
function execute$y(num, delta) {
|
|
353
344
|
return num - delta;
|
|
354
345
|
}
|
|
355
346
|
const minus = {
|
|
356
347
|
kind: 'imperative',
|
|
357
|
-
execute: execute$
|
|
348
|
+
execute: execute$y,
|
|
358
349
|
signature: '(number, number) => number',
|
|
359
350
|
};
|
|
360
351
|
|
|
361
|
-
function execute$
|
|
352
|
+
function execute$x(a, b) {
|
|
362
353
|
return a % b;
|
|
363
354
|
}
|
|
364
355
|
const modulo = {
|
|
365
356
|
kind: 'imperative',
|
|
366
|
-
execute: execute$
|
|
357
|
+
execute: execute$x,
|
|
367
358
|
signature: '(number, number) => number',
|
|
368
359
|
};
|
|
369
360
|
|
|
370
|
-
function execute$
|
|
361
|
+
function execute$w(num1, num2) {
|
|
371
362
|
return num1 * num2;
|
|
372
363
|
}
|
|
373
364
|
const multiply = {
|
|
374
365
|
kind: 'imperative',
|
|
375
|
-
execute: execute$
|
|
366
|
+
execute: execute$w,
|
|
376
367
|
signature: '(number, number) => number',
|
|
377
368
|
};
|
|
378
369
|
|
|
379
|
-
function execute$
|
|
370
|
+
function execute$v(num) {
|
|
380
371
|
return -num;
|
|
381
372
|
}
|
|
382
373
|
const negate = {
|
|
383
374
|
kind: 'imperative',
|
|
384
|
-
execute: execute$
|
|
375
|
+
execute: execute$v,
|
|
385
376
|
signature: '(number) => number',
|
|
386
377
|
};
|
|
387
378
|
|
|
388
|
-
const execute$
|
|
379
|
+
const execute$u = (a, b) => a !== b;
|
|
389
380
|
const neq = {
|
|
390
381
|
kind: 'imperative',
|
|
391
|
-
execute: execute$
|
|
382
|
+
execute: execute$u,
|
|
392
383
|
signature: '(unknown, unknown) => boolean',
|
|
393
384
|
};
|
|
394
385
|
|
|
395
|
-
function execute$
|
|
386
|
+
function execute$t(value) {
|
|
396
387
|
return !value;
|
|
397
388
|
}
|
|
398
389
|
const not = {
|
|
399
390
|
kind: 'imperative',
|
|
400
|
-
execute: execute$
|
|
391
|
+
execute: execute$t,
|
|
401
392
|
signature: '(unknown) => boolean',
|
|
402
393
|
};
|
|
403
394
|
|
|
@@ -431,7 +422,7 @@ const nullCoalesce = {
|
|
|
431
422
|
signature: '(unknown, unknown) => unknown',
|
|
432
423
|
};
|
|
433
424
|
|
|
434
|
-
function execute$
|
|
425
|
+
function execute$s(value) {
|
|
435
426
|
const number = Number(value);
|
|
436
427
|
if (Number.isNaN(number)) {
|
|
437
428
|
throw new Error(`Cannot convert value ${value} to number`);
|
|
@@ -440,11 +431,11 @@ function execute$p(value) {
|
|
|
440
431
|
}
|
|
441
432
|
const number = {
|
|
442
433
|
kind: 'imperative',
|
|
443
|
-
execute: execute$
|
|
434
|
+
execute: execute$s,
|
|
444
435
|
signature: '(unknown) => number',
|
|
445
436
|
};
|
|
446
437
|
|
|
447
|
-
function execute$
|
|
438
|
+
function execute$r(parts) {
|
|
448
439
|
const result = {};
|
|
449
440
|
for (let i = 0; i < parts.length; i += 2) {
|
|
450
441
|
const key = parts[i];
|
|
@@ -457,7 +448,7 @@ function execute$o(parts) {
|
|
|
457
448
|
}
|
|
458
449
|
const objectFn = {
|
|
459
450
|
kind: 'imperative',
|
|
460
|
-
execute: execute$
|
|
451
|
+
execute: execute$r,
|
|
461
452
|
signature: '(unknown[]) => unknown{}',
|
|
462
453
|
};
|
|
463
454
|
|
|
@@ -488,60 +479,60 @@ const or = {
|
|
|
488
479
|
signature: '(...unknown) => boolean',
|
|
489
480
|
};
|
|
490
481
|
|
|
491
|
-
function execute$
|
|
482
|
+
function execute$q(source, path) {
|
|
492
483
|
return path.reduce((current, step) => {
|
|
493
484
|
return current?.[step];
|
|
494
485
|
}, source);
|
|
495
486
|
}
|
|
496
487
|
const pluck = {
|
|
497
488
|
kind: 'imperative',
|
|
498
|
-
execute: execute$
|
|
489
|
+
execute: execute$q,
|
|
499
490
|
signature: '(unknown{}, string[]) => unknown',
|
|
500
491
|
};
|
|
501
492
|
|
|
502
|
-
function execute$
|
|
493
|
+
function execute$p(a, b) {
|
|
503
494
|
return a + b;
|
|
504
495
|
}
|
|
505
496
|
const plus = {
|
|
506
497
|
kind: 'imperative',
|
|
507
|
-
execute: execute$
|
|
498
|
+
execute: execute$p,
|
|
508
499
|
signature: '(unknown, unknown) => unknown',
|
|
509
500
|
};
|
|
510
501
|
|
|
511
|
-
function execute$
|
|
502
|
+
function execute$o(value, precision = 0) {
|
|
512
503
|
const multiplier = Math.pow(10, precision);
|
|
513
504
|
return Math.round(value * multiplier) / multiplier;
|
|
514
505
|
}
|
|
515
506
|
const round = {
|
|
516
507
|
kind: 'imperative',
|
|
517
|
-
execute: execute$
|
|
508
|
+
execute: execute$o,
|
|
518
509
|
signature: '(number, number) => number',
|
|
519
510
|
};
|
|
520
511
|
|
|
521
|
-
function execute$
|
|
512
|
+
function execute$n(value, start, end) {
|
|
522
513
|
return value.slice(start, end);
|
|
523
514
|
}
|
|
524
515
|
const slice = {
|
|
525
516
|
kind: 'imperative',
|
|
526
|
-
execute: execute$
|
|
517
|
+
execute: execute$n,
|
|
527
518
|
signature: '(unknown[], number, number) => unknown[]',
|
|
528
519
|
};
|
|
529
520
|
|
|
530
|
-
function execute$
|
|
521
|
+
function execute$m(items) {
|
|
531
522
|
return items.some((item) => !!item);
|
|
532
523
|
}
|
|
533
524
|
const some = {
|
|
534
525
|
kind: 'imperative',
|
|
535
|
-
execute: execute$
|
|
526
|
+
execute: execute$m,
|
|
536
527
|
signature: '(unknown[]) => boolean',
|
|
537
528
|
};
|
|
538
529
|
|
|
539
|
-
function execute$
|
|
530
|
+
function execute$l(value) {
|
|
540
531
|
return String(value);
|
|
541
532
|
}
|
|
542
533
|
const string = {
|
|
543
534
|
kind: 'imperative',
|
|
544
|
-
execute: execute$
|
|
535
|
+
execute: execute$l,
|
|
545
536
|
signature: '(unknown) => string',
|
|
546
537
|
};
|
|
547
538
|
|
|
@@ -613,21 +604,21 @@ const switchFn = {
|
|
|
613
604
|
signature: '(...unknown) => unknown',
|
|
614
605
|
};
|
|
615
606
|
|
|
616
|
-
function execute$
|
|
607
|
+
function execute$k(value) {
|
|
617
608
|
return value.toLowerCase();
|
|
618
609
|
}
|
|
619
610
|
const toLowerCase = {
|
|
620
611
|
kind: 'imperative',
|
|
621
|
-
execute: execute$
|
|
612
|
+
execute: execute$k,
|
|
622
613
|
signature: '(string) => string',
|
|
623
614
|
};
|
|
624
615
|
|
|
625
|
-
function execute$
|
|
616
|
+
function execute$j(value) {
|
|
626
617
|
return value.toUpperCase();
|
|
627
618
|
}
|
|
628
619
|
const toUpperCase = {
|
|
629
620
|
kind: 'imperative',
|
|
630
|
-
execute: execute$
|
|
621
|
+
execute: execute$j,
|
|
631
622
|
signature: '(string) => string',
|
|
632
623
|
};
|
|
633
624
|
|
|
@@ -646,7 +637,6 @@ const formulaFunctions$2 = {
|
|
|
646
637
|
findAllBy,
|
|
647
638
|
at,
|
|
648
639
|
not,
|
|
649
|
-
equal,
|
|
650
640
|
// Array element checkers (imperative)
|
|
651
641
|
some,
|
|
652
642
|
every,
|
|
@@ -1532,14 +1522,19 @@ function activateFormulaComputation(node) {
|
|
|
1532
1522
|
});
|
|
1533
1523
|
currentFrame.disposers.push(...disposers);
|
|
1534
1524
|
const computationDisposer = reaction(() => computed.get(), (computationState) => {
|
|
1535
|
-
const { evaluating, value: rawSchema, failed } = computationState;
|
|
1525
|
+
const { evaluating, value: rawSchema, failed, hasResult, error } = computationState;
|
|
1536
1526
|
node.evaluating = evaluating;
|
|
1527
|
+
node.failed = failed;
|
|
1528
|
+
node.error = error ?? null;
|
|
1529
|
+
if (!hasResult) {
|
|
1530
|
+
return; // No value produced yet (initial async load or args failed)
|
|
1531
|
+
}
|
|
1537
1532
|
if (evaluating) {
|
|
1533
|
+
node.setPendingValue(rawSchema);
|
|
1538
1534
|
return;
|
|
1539
1535
|
}
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
// Example: if this is depth 2, clear frames 2, 3, 4... but keep 0, 1
|
|
1536
|
+
// Fully settled — clear pending value, apply schema, rebuild structure
|
|
1537
|
+
node.clearPendingValue();
|
|
1543
1538
|
node.computationStack.popFrom(thisFrameDepth);
|
|
1544
1539
|
store.setNodeRawSchema(node, rawSchema);
|
|
1545
1540
|
if (node.computationStack.depth > thisFrameDepth) {
|
|
@@ -1861,7 +1856,7 @@ function createJsFunction(func) {
|
|
|
1861
1856
|
return new Function(commandsStr, 'args', `return (async () => { ${func} })();`);
|
|
1862
1857
|
}
|
|
1863
1858
|
|
|
1864
|
-
function execute$
|
|
1859
|
+
function execute$i(ctx, selector, item) {
|
|
1865
1860
|
ComponentTreeApi.appendArrayItem(ctx.componentId, selector, item);
|
|
1866
1861
|
const arrayNode = ComponentTreeApi.findNode(ctx.componentId, selector);
|
|
1867
1862
|
if (arrayNode) {
|
|
@@ -1876,55 +1871,55 @@ function execute$f(ctx, selector, item) {
|
|
|
1876
1871
|
|
|
1877
1872
|
var appendArrayItem = /*#__PURE__*/Object.freeze({
|
|
1878
1873
|
__proto__: null,
|
|
1879
|
-
execute: execute$
|
|
1874
|
+
execute: execute$i
|
|
1880
1875
|
});
|
|
1881
1876
|
|
|
1882
|
-
function execute$
|
|
1883
|
-
return ComponentTreeApi.
|
|
1877
|
+
function execute$h(ctx, selector) {
|
|
1878
|
+
return ComponentTreeApi.findNode(ctx.componentId, selector)?.extractedValue ?? null;
|
|
1884
1879
|
}
|
|
1885
1880
|
|
|
1886
|
-
var
|
|
1881
|
+
var get = /*#__PURE__*/Object.freeze({
|
|
1887
1882
|
__proto__: null,
|
|
1888
|
-
execute: execute$
|
|
1883
|
+
execute: execute$h
|
|
1889
1884
|
});
|
|
1890
1885
|
|
|
1891
|
-
function execute$
|
|
1892
|
-
return ComponentTreeApi.
|
|
1886
|
+
function execute$g(ctx, selector, path) {
|
|
1887
|
+
return ComponentTreeApi.collectValuesArray(ctx.componentId, selector, path);
|
|
1893
1888
|
}
|
|
1894
1889
|
|
|
1895
|
-
var
|
|
1890
|
+
var propArray$1 = /*#__PURE__*/Object.freeze({
|
|
1896
1891
|
__proto__: null,
|
|
1897
|
-
execute: execute$
|
|
1892
|
+
execute: execute$g
|
|
1898
1893
|
});
|
|
1899
1894
|
|
|
1900
|
-
function execute$
|
|
1901
|
-
return ComponentTreeApi.
|
|
1895
|
+
function execute$f(ctx, selector, objectKey, objectValue) {
|
|
1896
|
+
return ComponentTreeApi.collectValuesMap(ctx.componentId, selector, objectKey, objectValue);
|
|
1902
1897
|
}
|
|
1903
1898
|
|
|
1904
|
-
var
|
|
1899
|
+
var propObject$1 = /*#__PURE__*/Object.freeze({
|
|
1905
1900
|
__proto__: null,
|
|
1906
|
-
execute: execute$
|
|
1901
|
+
execute: execute$f
|
|
1907
1902
|
});
|
|
1908
1903
|
|
|
1909
|
-
function execute$
|
|
1904
|
+
function execute$e(ctx, selector, index) {
|
|
1910
1905
|
ComponentTreeApi.removeArrayItem(ctx.componentId, selector, index);
|
|
1911
1906
|
}
|
|
1912
1907
|
|
|
1913
1908
|
var removeArrayItem = /*#__PURE__*/Object.freeze({
|
|
1914
1909
|
__proto__: null,
|
|
1915
|
-
execute: execute$
|
|
1910
|
+
execute: execute$e
|
|
1916
1911
|
});
|
|
1917
1912
|
|
|
1918
|
-
function execute$
|
|
1913
|
+
function execute$d(ctx, selector, ...args) {
|
|
1919
1914
|
return ComponentTreeApi.runCommandNode(ctx.componentId, selector, ...args);
|
|
1920
1915
|
}
|
|
1921
1916
|
|
|
1922
1917
|
var run = /*#__PURE__*/Object.freeze({
|
|
1923
1918
|
__proto__: null,
|
|
1924
|
-
execute: execute$
|
|
1919
|
+
execute: execute$d
|
|
1925
1920
|
});
|
|
1926
1921
|
|
|
1927
|
-
function execute$
|
|
1922
|
+
function execute$c(ctx, componentSelector, methodName, ...args) {
|
|
1928
1923
|
const component = ComponentTreeApi.getComponent(ctx.componentId, componentSelector);
|
|
1929
1924
|
const instance = componentInstanceMap.get(component.id);
|
|
1930
1925
|
if (!instance) {
|
|
@@ -1939,10 +1934,10 @@ function execute$9(ctx, componentSelector, methodName, ...args) {
|
|
|
1939
1934
|
|
|
1940
1935
|
var runComponentMethod = /*#__PURE__*/Object.freeze({
|
|
1941
1936
|
__proto__: null,
|
|
1942
|
-
execute: execute$
|
|
1937
|
+
execute: execute$c
|
|
1943
1938
|
});
|
|
1944
1939
|
|
|
1945
|
-
function execute$
|
|
1940
|
+
function execute$b(ctx, selector, value) {
|
|
1946
1941
|
ComponentTreeApi.setNodeRawSchema(ctx.componentId, selector, value);
|
|
1947
1942
|
const node = ComponentTreeApi.findNode(ctx.componentId, selector);
|
|
1948
1943
|
if (node) {
|
|
@@ -1952,15 +1947,12 @@ function execute$8(ctx, selector, value) {
|
|
|
1952
1947
|
|
|
1953
1948
|
var set = /*#__PURE__*/Object.freeze({
|
|
1954
1949
|
__proto__: null,
|
|
1955
|
-
execute: execute$
|
|
1950
|
+
execute: execute$b
|
|
1956
1951
|
});
|
|
1957
1952
|
|
|
1958
1953
|
const commands = {
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
// Legacy aliases
|
|
1962
|
-
propObject: collectValuesMap$1,
|
|
1963
|
-
propArray: collectValuesArray$1,
|
|
1954
|
+
propObject: propObject$1,
|
|
1955
|
+
propArray: propArray$1,
|
|
1964
1956
|
appendArrayItem,
|
|
1965
1957
|
removeArrayItem,
|
|
1966
1958
|
runComponentMethod,
|
|
@@ -1990,43 +1982,33 @@ const componentsDefinitions$2 = {
|
|
|
1990
1982
|
},
|
|
1991
1983
|
};
|
|
1992
1984
|
|
|
1993
|
-
function execute$
|
|
1994
|
-
return ComponentTreeApi.
|
|
1985
|
+
function execute$a(ctx, selector) {
|
|
1986
|
+
return ComponentTreeApi.getNode(ctx.componentId, selector).error;
|
|
1995
1987
|
}
|
|
1996
|
-
const
|
|
1988
|
+
const error = {
|
|
1997
1989
|
kind: 'imperative',
|
|
1998
1990
|
contextual: true,
|
|
1999
|
-
execute: execute$
|
|
2000
|
-
signature: '(string
|
|
2001
|
-
};
|
|
2002
|
-
|
|
2003
|
-
function execute$6(ctx, selector, objectKey, objectValue) {
|
|
2004
|
-
return ComponentTreeApi.collectValuesMap(ctx.componentId, selector, objectKey, objectValue);
|
|
2005
|
-
}
|
|
2006
|
-
const collectValuesMap = {
|
|
2007
|
-
kind: 'imperative',
|
|
2008
|
-
contextual: true,
|
|
2009
|
-
execute: execute$6,
|
|
2010
|
-
signature: '(string, string, string) => unknown{}',
|
|
1991
|
+
execute: execute$a,
|
|
1992
|
+
signature: '(string) => unknown',
|
|
2011
1993
|
};
|
|
2012
1994
|
|
|
2013
|
-
function execute$
|
|
1995
|
+
function execute$9(ctx, selector) {
|
|
2014
1996
|
return ComponentTreeApi.getNode(ctx.componentId, selector).evaluating;
|
|
2015
1997
|
}
|
|
2016
1998
|
const evaluating = {
|
|
2017
1999
|
kind: 'imperative',
|
|
2018
2000
|
contextual: true,
|
|
2019
|
-
execute: execute$
|
|
2001
|
+
execute: execute$9,
|
|
2020
2002
|
signature: '(string) => boolean',
|
|
2021
2003
|
};
|
|
2022
2004
|
|
|
2023
|
-
function execute$
|
|
2005
|
+
function execute$8(ctx, selector) {
|
|
2024
2006
|
return ComponentTreeApi.getNode(ctx.componentId, selector).failed;
|
|
2025
2007
|
}
|
|
2026
2008
|
const failed = {
|
|
2027
2009
|
kind: 'imperative',
|
|
2028
2010
|
contextual: true,
|
|
2029
|
-
execute: execute$
|
|
2011
|
+
execute: execute$8,
|
|
2030
2012
|
signature: '(string) => boolean',
|
|
2031
2013
|
};
|
|
2032
2014
|
|
|
@@ -2075,15 +2057,13 @@ const getFn = {
|
|
|
2075
2057
|
if (!targetNode) {
|
|
2076
2058
|
return state.success(isOptional ? null : createFailedAsyncValue(new Error(`Node not found: ${selector}`)));
|
|
2077
2059
|
}
|
|
2078
|
-
//
|
|
2079
|
-
if (targetNode.evaluating
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
};
|
|
2086
|
-
return state.success(asyncValue);
|
|
2060
|
+
// Signal evaluating through side-channel, not through the value
|
|
2061
|
+
if (targetNode.evaluating) {
|
|
2062
|
+
state.markEvaluating();
|
|
2063
|
+
}
|
|
2064
|
+
// Only wrap in AsyncValue for failed (no usable value)
|
|
2065
|
+
if (targetNode.failed) {
|
|
2066
|
+
return state.success(createFailedAsyncValue(new Error('Target node failed')));
|
|
2087
2067
|
}
|
|
2088
2068
|
return state.success(targetNode.extractedValue);
|
|
2089
2069
|
});
|
|
@@ -2091,16 +2071,47 @@ const getFn = {
|
|
|
2091
2071
|
signature: '(string) => unknown',
|
|
2092
2072
|
};
|
|
2093
2073
|
|
|
2094
|
-
function execute$
|
|
2074
|
+
function execute$7(ctx, componentSelector) {
|
|
2095
2075
|
return ComponentTreeApi.findComponent(ctx.componentId, componentSelector)?.id ?? null;
|
|
2096
2076
|
}
|
|
2097
2077
|
const idFn = {
|
|
2098
2078
|
kind: 'imperative',
|
|
2099
2079
|
contextual: true,
|
|
2100
|
-
execute: execute$
|
|
2080
|
+
execute: execute$7,
|
|
2101
2081
|
signature: '(string) => string',
|
|
2102
2082
|
};
|
|
2103
2083
|
|
|
2084
|
+
function execute$6(ctx, selector, path) {
|
|
2085
|
+
return ComponentTreeApi.collectValuesArray(ctx.componentId, selector, path);
|
|
2086
|
+
}
|
|
2087
|
+
const propArray = {
|
|
2088
|
+
kind: 'imperative',
|
|
2089
|
+
contextual: true,
|
|
2090
|
+
execute: execute$6,
|
|
2091
|
+
signature: '(string, string) => unknown[]',
|
|
2092
|
+
};
|
|
2093
|
+
|
|
2094
|
+
function execute$5(ctx, selector, objectKey, objectValue) {
|
|
2095
|
+
return ComponentTreeApi.collectValuesMap(ctx.componentId, selector, objectKey, objectValue);
|
|
2096
|
+
}
|
|
2097
|
+
const propObject = {
|
|
2098
|
+
kind: 'imperative',
|
|
2099
|
+
contextual: true,
|
|
2100
|
+
execute: execute$5,
|
|
2101
|
+
signature: '(string, string, string) => unknown{}',
|
|
2102
|
+
};
|
|
2103
|
+
|
|
2104
|
+
function execute$4(ctx, selector) {
|
|
2105
|
+
const node = ComponentTreeApi.getNode(ctx.componentId, selector);
|
|
2106
|
+
return node.settled && !node.evaluating && !node.failed;
|
|
2107
|
+
}
|
|
2108
|
+
const ready = {
|
|
2109
|
+
kind: 'imperative',
|
|
2110
|
+
contextual: true,
|
|
2111
|
+
execute: execute$4,
|
|
2112
|
+
signature: '(string) => boolean',
|
|
2113
|
+
};
|
|
2114
|
+
|
|
2104
2115
|
/**
|
|
2105
2116
|
* Get a nested property value from an object using dot notation
|
|
2106
2117
|
* e.g., getNestedProperty({ user: { id: 123 } }, "user.id") => 123
|
|
@@ -2119,7 +2130,7 @@ function getNestedProperty(obj, path) {
|
|
|
2119
2130
|
}
|
|
2120
2131
|
return current;
|
|
2121
2132
|
}
|
|
2122
|
-
function execute$
|
|
2133
|
+
function execute$3(dimensions, content) {
|
|
2123
2134
|
return generateCombinations(dimensions).map(({ variables }) => ({
|
|
2124
2135
|
componentType: 'sys.RefSpace',
|
|
2125
2136
|
content,
|
|
@@ -2201,14 +2212,24 @@ function generateCombinations(dimensions) {
|
|
|
2201
2212
|
}
|
|
2202
2213
|
const repeat = {
|
|
2203
2214
|
kind: 'imperative',
|
|
2204
|
-
execute: execute$
|
|
2215
|
+
execute: execute$3,
|
|
2205
2216
|
signature: '({items: unknown[], itemsType: unknown, item: string, index: string, first: unknown, last: unknown, trackBy: unknown}[], componentSchema) => componentSchema[]',
|
|
2206
2217
|
};
|
|
2207
2218
|
|
|
2208
|
-
function execute$
|
|
2219
|
+
function execute$2(ctx, selector) {
|
|
2209
2220
|
return ComponentTreeApi.isCommandRunning(ctx.componentId, selector);
|
|
2210
2221
|
}
|
|
2211
2222
|
const running = {
|
|
2223
|
+
kind: 'imperative',
|
|
2224
|
+
contextual: true,
|
|
2225
|
+
execute: execute$2,
|
|
2226
|
+
signature: '(string) => boolean',
|
|
2227
|
+
};
|
|
2228
|
+
|
|
2229
|
+
function execute$1(ctx, selector) {
|
|
2230
|
+
return ComponentTreeApi.getNode(ctx.componentId, selector).settled;
|
|
2231
|
+
}
|
|
2232
|
+
const settled = {
|
|
2212
2233
|
kind: 'imperative',
|
|
2213
2234
|
contextual: true,
|
|
2214
2235
|
execute: execute$1,
|
|
@@ -2216,13 +2237,14 @@ const running = {
|
|
|
2216
2237
|
};
|
|
2217
2238
|
|
|
2218
2239
|
const formulaFunctions$1 = {
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
propObject: collectValuesMap,
|
|
2222
|
-
propArray: collectValuesArray,
|
|
2240
|
+
propObject,
|
|
2241
|
+
propArray,
|
|
2223
2242
|
get: getFn,
|
|
2224
2243
|
id: idFn,
|
|
2244
|
+
error,
|
|
2225
2245
|
evaluating,
|
|
2246
|
+
settled,
|
|
2247
|
+
ready,
|
|
2226
2248
|
failed,
|
|
2227
2249
|
running,
|
|
2228
2250
|
repeat,
|