@kaskad/core 0.0.8 → 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.
@@ -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$U(_ctx, ms) {
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$U
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$T(source, path) {
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,99 +94,99 @@ function execute$T(source, path) {
94
94
  }
95
95
  const arrayPluck = {
96
96
  kind: 'imperative',
97
- execute: execute$T,
97
+ execute: execute$W,
98
98
  signature: '(unknown{}[], string[]) => unknown',
99
99
  };
100
100
 
101
- function execute$S(value, index) {
101
+ function execute$V(value, index) {
102
102
  return value[index];
103
103
  }
104
104
  const at = {
105
105
  kind: 'imperative',
106
- execute: execute$S,
106
+ execute: execute$V,
107
107
  signature: '(unknown[], number) => unknown',
108
108
  };
109
109
 
110
- function execute$R(value) {
110
+ function execute$U(value) {
111
111
  return Boolean(value);
112
112
  }
113
113
  const bool = {
114
114
  kind: 'imperative',
115
- execute: execute$R,
115
+ execute: execute$U,
116
116
  signature: '(unknown) => boolean',
117
117
  };
118
118
 
119
- function execute$Q(value) {
119
+ function execute$T(value) {
120
120
  return Math.ceil(value);
121
121
  }
122
122
  const ceil = {
123
123
  kind: 'imperative',
124
- execute: execute$Q,
124
+ execute: execute$T,
125
125
  signature: '(number) => number',
126
126
  };
127
127
 
128
- function execute$P(strings, separator = '') {
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$P,
133
+ execute: execute$S,
134
134
  signature: '(unknown[], string) => string',
135
135
  };
136
136
 
137
- const execute$O = (value) => {
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$O,
142
+ execute: execute$R,
143
143
  signature: '(unknown) => unknown',
144
144
  };
145
145
 
146
- function execute$N(num1, num2) {
146
+ function execute$Q(num1, num2) {
147
147
  return num1 / num2;
148
148
  }
149
149
  const divide = {
150
150
  kind: 'imperative',
151
- execute: execute$N,
151
+ execute: execute$Q,
152
152
  signature: '(number, number) => number',
153
153
  };
154
154
 
155
- function execute$M(items) {
155
+ function execute$P(items) {
156
156
  return items.length === 0;
157
157
  }
158
158
  const empty = {
159
159
  kind: 'imperative',
160
- execute: execute$M,
160
+ execute: execute$P,
161
161
  signature: '(unknown[]) => boolean',
162
162
  };
163
163
 
164
- function execute$L(object) {
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$L,
169
+ execute: execute$O,
170
170
  signature: '(unknown{}) => boolean',
171
171
  };
172
172
 
173
- const execute$K = (a, b) => a === b;
173
+ const execute$N = (a, b) => a === b;
174
174
  const eq = {
175
175
  kind: 'imperative',
176
- execute: execute$K,
176
+ execute: execute$N,
177
177
  signature: '(unknown, unknown) => boolean',
178
178
  };
179
179
 
180
- function execute$J(items) {
180
+ function execute$M(items) {
181
181
  return items.every((item) => !!item);
182
182
  }
183
183
  const every = {
184
184
  kind: 'imperative',
185
- execute: execute$J,
185
+ execute: execute$M,
186
186
  signature: '(unknown[]) => boolean',
187
187
  };
188
188
 
189
- function execute$I(array, allowedValues) {
189
+ function execute$L(array, allowedValues) {
190
190
  if (!allowedValues) {
191
191
  return [];
192
192
  }
@@ -197,60 +197,60 @@ function execute$I(array, allowedValues) {
197
197
  }
198
198
  const filterIn = {
199
199
  kind: 'imperative',
200
- execute: execute$I,
200
+ execute: execute$L,
201
201
  signature: '(unknown[], unknown[]) => unknown[]',
202
202
  };
203
203
 
204
- function execute$H(collection, key, values) {
204
+ function execute$K(collection, key, values) {
205
205
  return values
206
206
  .map((value) => collection.find((element) => element[key] === value))
207
207
  .filter((item) => item !== undefined);
208
208
  }
209
209
  const findAllBy = {
210
210
  kind: 'imperative',
211
- execute: execute$H,
211
+ execute: execute$K,
212
212
  signature: '(unknown{}[], string, unknown[]) => unknown{}[]',
213
213
  };
214
214
 
215
- function execute$G(collection, key, value) {
215
+ function execute$J(collection, key, value) {
216
216
  const found = collection.find((element) => element[key] === value);
217
217
  return found || null;
218
218
  }
219
219
  const findBy = {
220
220
  kind: 'imperative',
221
- execute: execute$G,
221
+ execute: execute$J,
222
222
  signature: '(unknown{}[], string, unknown) => unknown',
223
223
  };
224
224
 
225
- function execute$F(array) {
225
+ function execute$I(array) {
226
226
  return array.flat();
227
227
  }
228
228
  const flatten = {
229
229
  kind: 'imperative',
230
- execute: execute$F,
230
+ execute: execute$I,
231
231
  signature: '(unknown[][]) => unknown[]',
232
232
  };
233
233
 
234
- function execute$E(value) {
234
+ function execute$H(value) {
235
235
  return Math.floor(value);
236
236
  }
237
237
  const floor = {
238
238
  kind: 'imperative',
239
- execute: execute$E,
239
+ execute: execute$H,
240
240
  signature: '(number) => number',
241
241
  };
242
242
 
243
- const execute$D = (a, b) => a > b;
243
+ const execute$G = (a, b) => a > b;
244
244
  const gt = {
245
245
  kind: 'imperative',
246
- execute: execute$D,
246
+ execute: execute$G,
247
247
  signature: '(number, number) => boolean',
248
248
  };
249
249
 
250
- const execute$C = (a, b) => a >= b;
250
+ const execute$F = (a, b) => a >= b;
251
251
  const gte = {
252
252
  kind: 'imperative',
253
- execute: execute$C,
253
+ execute: execute$F,
254
254
  signature: '(number, number) => boolean',
255
255
  };
256
256
 
@@ -281,7 +281,7 @@ const ifFn = {
281
281
  signature: '(unknown, unknown, unknown) => unknown',
282
282
  };
283
283
 
284
- function execute$B(collection, value) {
284
+ function execute$E(collection, value) {
285
285
  if (collection instanceof Set) {
286
286
  return collection.has(value);
287
287
  }
@@ -289,7 +289,7 @@ function execute$B(collection, value) {
289
289
  }
290
290
  const inFn = {
291
291
  kind: 'imperative',
292
- execute: execute$B,
292
+ execute: execute$E,
293
293
  signature: '(unknown[], unknown) => boolean',
294
294
  };
295
295
 
@@ -299,96 +299,96 @@ function replacer(_key, value) {
299
299
  }
300
300
  return value;
301
301
  }
302
- function execute$A(arg) {
302
+ function execute$D(arg) {
303
303
  return JSON.stringify(arg, replacer);
304
304
  }
305
305
  const json = {
306
306
  kind: 'imperative',
307
- execute: execute$A,
307
+ execute: execute$D,
308
308
  signature: '(unknown) => string',
309
309
  };
310
310
 
311
- function execute$z(object) {
311
+ function execute$C(object) {
312
312
  return Object.keys(object);
313
313
  }
314
314
  const keys = {
315
315
  kind: 'imperative',
316
- execute: execute$z,
316
+ execute: execute$C,
317
317
  signature: '(unknown{}) => string[]',
318
318
  };
319
319
 
320
- function execute$y(value) {
320
+ function execute$B(value) {
321
321
  return value.length;
322
322
  }
323
323
  const length = {
324
324
  kind: 'imperative',
325
- execute: execute$y,
325
+ execute: execute$B,
326
326
  signature: '(unknown[]) => number',
327
327
  };
328
328
 
329
- const execute$x = (a, b) => a < b;
329
+ const execute$A = (a, b) => a < b;
330
330
  const lt = {
331
331
  kind: 'imperative',
332
- execute: execute$x,
332
+ execute: execute$A,
333
333
  signature: '(number, number) => boolean',
334
334
  };
335
335
 
336
- const execute$w = (a, b) => a <= b;
336
+ const execute$z = (a, b) => a <= b;
337
337
  const lte = {
338
338
  kind: 'imperative',
339
- execute: execute$w,
339
+ execute: execute$z,
340
340
  signature: '(number, number) => boolean',
341
341
  };
342
342
 
343
- function execute$v(num, delta) {
343
+ function execute$y(num, delta) {
344
344
  return num - delta;
345
345
  }
346
346
  const minus = {
347
347
  kind: 'imperative',
348
- execute: execute$v,
348
+ execute: execute$y,
349
349
  signature: '(number, number) => number',
350
350
  };
351
351
 
352
- function execute$u(a, b) {
352
+ function execute$x(a, b) {
353
353
  return a % b;
354
354
  }
355
355
  const modulo = {
356
356
  kind: 'imperative',
357
- execute: execute$u,
357
+ execute: execute$x,
358
358
  signature: '(number, number) => number',
359
359
  };
360
360
 
361
- function execute$t(num1, num2) {
361
+ function execute$w(num1, num2) {
362
362
  return num1 * num2;
363
363
  }
364
364
  const multiply = {
365
365
  kind: 'imperative',
366
- execute: execute$t,
366
+ execute: execute$w,
367
367
  signature: '(number, number) => number',
368
368
  };
369
369
 
370
- function execute$s(num) {
370
+ function execute$v(num) {
371
371
  return -num;
372
372
  }
373
373
  const negate = {
374
374
  kind: 'imperative',
375
- execute: execute$s,
375
+ execute: execute$v,
376
376
  signature: '(number) => number',
377
377
  };
378
378
 
379
- const execute$r = (a, b) => a !== b;
379
+ const execute$u = (a, b) => a !== b;
380
380
  const neq = {
381
381
  kind: 'imperative',
382
- execute: execute$r,
382
+ execute: execute$u,
383
383
  signature: '(unknown, unknown) => boolean',
384
384
  };
385
385
 
386
- function execute$q(value) {
386
+ function execute$t(value) {
387
387
  return !value;
388
388
  }
389
389
  const not = {
390
390
  kind: 'imperative',
391
- execute: execute$q,
391
+ execute: execute$t,
392
392
  signature: '(unknown) => boolean',
393
393
  };
394
394
 
@@ -422,7 +422,7 @@ const nullCoalesce = {
422
422
  signature: '(unknown, unknown) => unknown',
423
423
  };
424
424
 
425
- function execute$p(value) {
425
+ function execute$s(value) {
426
426
  const number = Number(value);
427
427
  if (Number.isNaN(number)) {
428
428
  throw new Error(`Cannot convert value ${value} to number`);
@@ -431,11 +431,11 @@ function execute$p(value) {
431
431
  }
432
432
  const number = {
433
433
  kind: 'imperative',
434
- execute: execute$p,
434
+ execute: execute$s,
435
435
  signature: '(unknown) => number',
436
436
  };
437
437
 
438
- function execute$o(parts) {
438
+ function execute$r(parts) {
439
439
  const result = {};
440
440
  for (let i = 0; i < parts.length; i += 2) {
441
441
  const key = parts[i];
@@ -448,7 +448,7 @@ function execute$o(parts) {
448
448
  }
449
449
  const objectFn = {
450
450
  kind: 'imperative',
451
- execute: execute$o,
451
+ execute: execute$r,
452
452
  signature: '(unknown[]) => unknown{}',
453
453
  };
454
454
 
@@ -479,60 +479,60 @@ const or = {
479
479
  signature: '(...unknown) => boolean',
480
480
  };
481
481
 
482
- function execute$n(source, path) {
482
+ function execute$q(source, path) {
483
483
  return path.reduce((current, step) => {
484
484
  return current?.[step];
485
485
  }, source);
486
486
  }
487
487
  const pluck = {
488
488
  kind: 'imperative',
489
- execute: execute$n,
489
+ execute: execute$q,
490
490
  signature: '(unknown{}, string[]) => unknown',
491
491
  };
492
492
 
493
- function execute$m(a, b) {
493
+ function execute$p(a, b) {
494
494
  return a + b;
495
495
  }
496
496
  const plus = {
497
497
  kind: 'imperative',
498
- execute: execute$m,
498
+ execute: execute$p,
499
499
  signature: '(unknown, unknown) => unknown',
500
500
  };
501
501
 
502
- function execute$l(value, precision = 0) {
502
+ function execute$o(value, precision = 0) {
503
503
  const multiplier = Math.pow(10, precision);
504
504
  return Math.round(value * multiplier) / multiplier;
505
505
  }
506
506
  const round = {
507
507
  kind: 'imperative',
508
- execute: execute$l,
508
+ execute: execute$o,
509
509
  signature: '(number, number) => number',
510
510
  };
511
511
 
512
- function execute$k(value, start, end) {
512
+ function execute$n(value, start, end) {
513
513
  return value.slice(start, end);
514
514
  }
515
515
  const slice = {
516
516
  kind: 'imperative',
517
- execute: execute$k,
517
+ execute: execute$n,
518
518
  signature: '(unknown[], number, number) => unknown[]',
519
519
  };
520
520
 
521
- function execute$j(items) {
521
+ function execute$m(items) {
522
522
  return items.some((item) => !!item);
523
523
  }
524
524
  const some = {
525
525
  kind: 'imperative',
526
- execute: execute$j,
526
+ execute: execute$m,
527
527
  signature: '(unknown[]) => boolean',
528
528
  };
529
529
 
530
- function execute$i(value) {
530
+ function execute$l(value) {
531
531
  return String(value);
532
532
  }
533
533
  const string = {
534
534
  kind: 'imperative',
535
- execute: execute$i,
535
+ execute: execute$l,
536
536
  signature: '(unknown) => string',
537
537
  };
538
538
 
@@ -604,21 +604,21 @@ const switchFn = {
604
604
  signature: '(...unknown) => unknown',
605
605
  };
606
606
 
607
- function execute$h(value) {
607
+ function execute$k(value) {
608
608
  return value.toLowerCase();
609
609
  }
610
610
  const toLowerCase = {
611
611
  kind: 'imperative',
612
- execute: execute$h,
612
+ execute: execute$k,
613
613
  signature: '(string) => string',
614
614
  };
615
615
 
616
- function execute$g(value) {
616
+ function execute$j(value) {
617
617
  return value.toUpperCase();
618
618
  }
619
619
  const toUpperCase = {
620
620
  kind: 'imperative',
621
- execute: execute$g,
621
+ execute: execute$j,
622
622
  signature: '(string) => string',
623
623
  };
624
624
 
@@ -1522,14 +1522,19 @@ function activateFormulaComputation(node) {
1522
1522
  });
1523
1523
  currentFrame.disposers.push(...disposers);
1524
1524
  const computationDisposer = reaction(() => computed.get(), (computationState) => {
1525
- const { evaluating, value: rawSchema, failed } = computationState;
1525
+ const { evaluating, value: rawSchema, failed, hasResult, error } = computationState;
1526
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
+ }
1527
1532
  if (evaluating) {
1533
+ node.setPendingValue(rawSchema);
1528
1534
  return;
1529
1535
  }
1530
- node.failed = failed;
1531
- // Clear result frames from this depth onward (not all results!)
1532
- // 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();
1533
1538
  node.computationStack.popFrom(thisFrameDepth);
1534
1539
  store.setNodeRawSchema(node, rawSchema);
1535
1540
  if (node.computationStack.depth > thisFrameDepth) {
@@ -1851,7 +1856,7 @@ function createJsFunction(func) {
1851
1856
  return new Function(commandsStr, 'args', `return (async () => { ${func} })();`);
1852
1857
  }
1853
1858
 
1854
- function execute$f(ctx, selector, item) {
1859
+ function execute$i(ctx, selector, item) {
1855
1860
  ComponentTreeApi.appendArrayItem(ctx.componentId, selector, item);
1856
1861
  const arrayNode = ComponentTreeApi.findNode(ctx.componentId, selector);
1857
1862
  if (arrayNode) {
@@ -1866,55 +1871,55 @@ function execute$f(ctx, selector, item) {
1866
1871
 
1867
1872
  var appendArrayItem = /*#__PURE__*/Object.freeze({
1868
1873
  __proto__: null,
1869
- execute: execute$f
1874
+ execute: execute$i
1870
1875
  });
1871
1876
 
1872
- function execute$e(ctx, selector) {
1877
+ function execute$h(ctx, selector) {
1873
1878
  return ComponentTreeApi.findNode(ctx.componentId, selector)?.extractedValue ?? null;
1874
1879
  }
1875
1880
 
1876
1881
  var get = /*#__PURE__*/Object.freeze({
1877
1882
  __proto__: null,
1878
- execute: execute$e
1883
+ execute: execute$h
1879
1884
  });
1880
1885
 
1881
- function execute$d(ctx, selector, path) {
1886
+ function execute$g(ctx, selector, path) {
1882
1887
  return ComponentTreeApi.collectValuesArray(ctx.componentId, selector, path);
1883
1888
  }
1884
1889
 
1885
1890
  var propArray$1 = /*#__PURE__*/Object.freeze({
1886
1891
  __proto__: null,
1887
- execute: execute$d
1892
+ execute: execute$g
1888
1893
  });
1889
1894
 
1890
- function execute$c(ctx, selector, objectKey, objectValue) {
1895
+ function execute$f(ctx, selector, objectKey, objectValue) {
1891
1896
  return ComponentTreeApi.collectValuesMap(ctx.componentId, selector, objectKey, objectValue);
1892
1897
  }
1893
1898
 
1894
1899
  var propObject$1 = /*#__PURE__*/Object.freeze({
1895
1900
  __proto__: null,
1896
- execute: execute$c
1901
+ execute: execute$f
1897
1902
  });
1898
1903
 
1899
- function execute$b(ctx, selector, index) {
1904
+ function execute$e(ctx, selector, index) {
1900
1905
  ComponentTreeApi.removeArrayItem(ctx.componentId, selector, index);
1901
1906
  }
1902
1907
 
1903
1908
  var removeArrayItem = /*#__PURE__*/Object.freeze({
1904
1909
  __proto__: null,
1905
- execute: execute$b
1910
+ execute: execute$e
1906
1911
  });
1907
1912
 
1908
- function execute$a(ctx, selector, ...args) {
1913
+ function execute$d(ctx, selector, ...args) {
1909
1914
  return ComponentTreeApi.runCommandNode(ctx.componentId, selector, ...args);
1910
1915
  }
1911
1916
 
1912
1917
  var run = /*#__PURE__*/Object.freeze({
1913
1918
  __proto__: null,
1914
- execute: execute$a
1919
+ execute: execute$d
1915
1920
  });
1916
1921
 
1917
- function execute$9(ctx, componentSelector, methodName, ...args) {
1922
+ function execute$c(ctx, componentSelector, methodName, ...args) {
1918
1923
  const component = ComponentTreeApi.getComponent(ctx.componentId, componentSelector);
1919
1924
  const instance = componentInstanceMap.get(component.id);
1920
1925
  if (!instance) {
@@ -1929,10 +1934,10 @@ function execute$9(ctx, componentSelector, methodName, ...args) {
1929
1934
 
1930
1935
  var runComponentMethod = /*#__PURE__*/Object.freeze({
1931
1936
  __proto__: null,
1932
- execute: execute$9
1937
+ execute: execute$c
1933
1938
  });
1934
1939
 
1935
- function execute$8(ctx, selector, value) {
1940
+ function execute$b(ctx, selector, value) {
1936
1941
  ComponentTreeApi.setNodeRawSchema(ctx.componentId, selector, value);
1937
1942
  const node = ComponentTreeApi.findNode(ctx.componentId, selector);
1938
1943
  if (node) {
@@ -1942,7 +1947,7 @@ function execute$8(ctx, selector, value) {
1942
1947
 
1943
1948
  var set = /*#__PURE__*/Object.freeze({
1944
1949
  __proto__: null,
1945
- execute: execute$8
1950
+ execute: execute$b
1946
1951
  });
1947
1952
 
1948
1953
  const commands = {
@@ -1977,23 +1982,33 @@ const componentsDefinitions$2 = {
1977
1982
  },
1978
1983
  };
1979
1984
 
1980
- function execute$7(ctx, selector) {
1985
+ function execute$a(ctx, selector) {
1986
+ return ComponentTreeApi.getNode(ctx.componentId, selector).error;
1987
+ }
1988
+ const error = {
1989
+ kind: 'imperative',
1990
+ contextual: true,
1991
+ execute: execute$a,
1992
+ signature: '(string) => unknown',
1993
+ };
1994
+
1995
+ function execute$9(ctx, selector) {
1981
1996
  return ComponentTreeApi.getNode(ctx.componentId, selector).evaluating;
1982
1997
  }
1983
1998
  const evaluating = {
1984
1999
  kind: 'imperative',
1985
2000
  contextual: true,
1986
- execute: execute$7,
2001
+ execute: execute$9,
1987
2002
  signature: '(string) => boolean',
1988
2003
  };
1989
2004
 
1990
- function execute$6(ctx, selector) {
2005
+ function execute$8(ctx, selector) {
1991
2006
  return ComponentTreeApi.getNode(ctx.componentId, selector).failed;
1992
2007
  }
1993
2008
  const failed = {
1994
2009
  kind: 'imperative',
1995
2010
  contextual: true,
1996
- execute: execute$6,
2011
+ execute: execute$8,
1997
2012
  signature: '(string) => boolean',
1998
2013
  };
1999
2014
 
@@ -2042,15 +2057,13 @@ const getFn = {
2042
2057
  if (!targetNode) {
2043
2058
  return state.success(isOptional ? null : createFailedAsyncValue(new Error(`Node not found: ${selector}`)));
2044
2059
  }
2045
- // Wrap node value in AsyncValue if needed to propagate evaluating/failed state
2046
- if (targetNode.evaluating || targetNode.failed) {
2047
- const asyncValue = {
2048
- kind: 'promise',
2049
- current: targetNode.extractedValue,
2050
- error: targetNode.failed ? new Error('Target node failed') : null,
2051
- pending: targetNode.evaluating,
2052
- };
2053
- 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')));
2054
2067
  }
2055
2068
  return state.success(targetNode.extractedValue);
2056
2069
  });
@@ -2058,36 +2071,47 @@ const getFn = {
2058
2071
  signature: '(string) => unknown',
2059
2072
  };
2060
2073
 
2061
- function execute$5(ctx, componentSelector) {
2074
+ function execute$7(ctx, componentSelector) {
2062
2075
  return ComponentTreeApi.findComponent(ctx.componentId, componentSelector)?.id ?? null;
2063
2076
  }
2064
2077
  const idFn = {
2065
2078
  kind: 'imperative',
2066
2079
  contextual: true,
2067
- execute: execute$5,
2080
+ execute: execute$7,
2068
2081
  signature: '(string) => string',
2069
2082
  };
2070
2083
 
2071
- function execute$4(ctx, selector, path) {
2084
+ function execute$6(ctx, selector, path) {
2072
2085
  return ComponentTreeApi.collectValuesArray(ctx.componentId, selector, path);
2073
2086
  }
2074
2087
  const propArray = {
2075
2088
  kind: 'imperative',
2076
2089
  contextual: true,
2077
- execute: execute$4,
2090
+ execute: execute$6,
2078
2091
  signature: '(string, string) => unknown[]',
2079
2092
  };
2080
2093
 
2081
- function execute$3(ctx, selector, objectKey, objectValue) {
2094
+ function execute$5(ctx, selector, objectKey, objectValue) {
2082
2095
  return ComponentTreeApi.collectValuesMap(ctx.componentId, selector, objectKey, objectValue);
2083
2096
  }
2084
2097
  const propObject = {
2085
2098
  kind: 'imperative',
2086
2099
  contextual: true,
2087
- execute: execute$3,
2100
+ execute: execute$5,
2088
2101
  signature: '(string, string, string) => unknown{}',
2089
2102
  };
2090
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
+
2091
2115
  /**
2092
2116
  * Get a nested property value from an object using dot notation
2093
2117
  * e.g., getNestedProperty({ user: { id: 123 } }, "user.id") => 123
@@ -2106,7 +2130,7 @@ function getNestedProperty(obj, path) {
2106
2130
  }
2107
2131
  return current;
2108
2132
  }
2109
- function execute$2(dimensions, content) {
2133
+ function execute$3(dimensions, content) {
2110
2134
  return generateCombinations(dimensions).map(({ variables }) => ({
2111
2135
  componentType: 'sys.RefSpace',
2112
2136
  content,
@@ -2188,14 +2212,24 @@ function generateCombinations(dimensions) {
2188
2212
  }
2189
2213
  const repeat = {
2190
2214
  kind: 'imperative',
2191
- execute: execute$2,
2215
+ execute: execute$3,
2192
2216
  signature: '({items: unknown[], itemsType: unknown, item: string, index: string, first: unknown, last: unknown, trackBy: unknown}[], componentSchema) => componentSchema[]',
2193
2217
  };
2194
2218
 
2195
- function execute$1(ctx, selector) {
2219
+ function execute$2(ctx, selector) {
2196
2220
  return ComponentTreeApi.isCommandRunning(ctx.componentId, selector);
2197
2221
  }
2198
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 = {
2199
2233
  kind: 'imperative',
2200
2234
  contextual: true,
2201
2235
  execute: execute$1,
@@ -2207,7 +2241,10 @@ const formulaFunctions$1 = {
2207
2241
  propArray,
2208
2242
  get: getFn,
2209
2243
  id: idFn,
2244
+ error,
2210
2245
  evaluating,
2246
+ settled,
2247
+ ready,
2211
2248
  failed,
2212
2249
  running,
2213
2250
  repeat,