@nordcraft/runtime 1.0.95 → 1.0.97

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.
Files changed (74) hide show
  1. package/dist/api/createAPI.js +29 -11
  2. package/dist/api/createAPI.js.map +1 -1
  3. package/dist/api/createAPIv2.js +49 -11
  4. package/dist/api/createAPIv2.js.map +1 -1
  5. package/dist/components/createComponent.js +19 -10
  6. package/dist/components/createComponent.js.map +1 -1
  7. package/dist/components/createElement.js +48 -16
  8. package/dist/components/createElement.js.map +1 -1
  9. package/dist/components/createNode.js +22 -11
  10. package/dist/components/createNode.js.map +1 -1
  11. package/dist/components/createNode.test.js +3 -3
  12. package/dist/components/createNode.test.js.map +1 -1
  13. package/dist/components/createSlot.js +2 -1
  14. package/dist/components/createSlot.js.map +1 -1
  15. package/dist/components/createText.js +7 -2
  16. package/dist/components/createText.js.map +1 -1
  17. package/dist/components/renderComponent.d.ts +4 -1
  18. package/dist/components/renderComponent.js +4 -2
  19. package/dist/components/renderComponent.js.map +1 -1
  20. package/dist/context/subscribeToContext.js +12 -2
  21. package/dist/context/subscribeToContext.js.map +1 -1
  22. package/dist/custom-element/ToddleComponent.js +12 -4
  23. package/dist/custom-element/ToddleComponent.js.map +1 -1
  24. package/dist/custom-element.main.esm.js +29 -29
  25. package/dist/custom-element.main.esm.js.map +4 -4
  26. package/dist/editor/editorUtils.d.ts +2 -0
  27. package/dist/editor/editorUtils.js +26 -0
  28. package/dist/editor/editorUtils.js.map +1 -0
  29. package/dist/editor/types.d.ts +4 -0
  30. package/dist/editor/types.js.map +1 -1
  31. package/dist/editor-preview.main.js +82 -18
  32. package/dist/editor-preview.main.js.map +1 -1
  33. package/dist/events/handleAction.js +74 -42
  34. package/dist/events/handleAction.js.map +1 -1
  35. package/dist/page.main.esm.js +3 -3
  36. package/dist/page.main.esm.js.map +4 -4
  37. package/dist/page.main.js +39 -8
  38. package/dist/page.main.js.map +1 -1
  39. package/dist/utils/createFormulaCache.js.map +1 -1
  40. package/dist/utils/nodes.d.ts +1 -0
  41. package/dist/utils/nodes.js +9 -0
  42. package/dist/utils/nodes.js.map +1 -1
  43. package/dist/utils/nodes.test.d.ts +1 -0
  44. package/dist/utils/nodes.test.js +192 -0
  45. package/dist/utils/nodes.test.js.map +1 -0
  46. package/dist/utils/subscribeCustomProperty.d.ts +1 -1
  47. package/dist/utils/subscribeCustomProperty.js +8 -4
  48. package/dist/utils/subscribeCustomProperty.js.map +1 -1
  49. package/dist/utils/subscribeCustomProperty.test.d.ts +1 -0
  50. package/dist/utils/subscribeCustomProperty.test.js +63 -0
  51. package/dist/utils/subscribeCustomProperty.test.js.map +1 -0
  52. package/package.json +3 -3
  53. package/src/api/createAPI.ts +90 -46
  54. package/src/api/createAPIv2.ts +79 -13
  55. package/src/components/createComponent.ts +123 -85
  56. package/src/components/createElement.ts +63 -27
  57. package/src/components/createNode.test.ts +3 -3
  58. package/src/components/createNode.ts +55 -31
  59. package/src/components/createSlot.ts +2 -1
  60. package/src/components/createText.ts +35 -18
  61. package/src/components/renderComponent.ts +8 -1
  62. package/src/context/subscribeToContext.ts +12 -2
  63. package/src/custom-element/ToddleComponent.ts +37 -22
  64. package/src/editor/editorUtils.ts +28 -0
  65. package/src/editor/types.ts +5 -0
  66. package/src/editor-preview.main.ts +137 -46
  67. package/src/events/handleAction.ts +190 -113
  68. package/src/page.main.ts +64 -26
  69. package/src/types.d.ts +3 -0
  70. package/src/utils/createFormulaCache.ts +2 -2
  71. package/src/utils/nodes.test.ts +246 -0
  72. package/src/utils/nodes.ts +11 -0
  73. package/src/utils/subscribeCustomProperty.test.ts +78 -0
  74. package/src/utils/subscribeCustomProperty.ts +21 -22
@@ -5,8 +5,11 @@ import type {
5
5
  SetMultiUrlParameterAction,
6
6
  SetURLParameterAction,
7
7
  } from '@nordcraft/core/dist/component/component.types'
8
- import { applyFormula } from '@nordcraft/core/dist/formula/formula'
9
- import { mapValues, omitKeys } from '@nordcraft/core/dist/utils/collections'
8
+ import {
9
+ applyFormula,
10
+ type FormulaContext,
11
+ } from '@nordcraft/core/dist/formula/formula'
12
+ import { mapObject, omitKeys } from '@nordcraft/core/dist/utils/collections'
10
13
  import { isDefined, toBoolean } from '@nordcraft/core/dist/utils/util'
11
14
  import fastDeepEqual from 'fast-deep-equal'
12
15
  import { isContextApiV2 } from '../api/apiUtils'
@@ -32,15 +35,21 @@ export function handleAction(
32
35
  const actionList =
33
36
  action.cases?.find(({ condition }) =>
34
37
  toBoolean(
35
- applyFormula(condition, {
36
- data,
37
- component: ctx.component,
38
- formulaCache: ctx.formulaCache,
39
- root: ctx.root,
40
- package: ctx.package,
41
- toddle: ctx.toddle,
42
- env: ctx.env,
43
- }),
38
+ applyFormula(
39
+ condition,
40
+ {
41
+ data,
42
+ component: ctx.component,
43
+ formulaCache: ctx.formulaCache,
44
+ root: ctx.root,
45
+ package: ctx.package,
46
+ toddle: ctx.toddle,
47
+ env: ctx.env,
48
+ jsonPath: ctx.jsonPath,
49
+ reportFormulaEvaluation: ctx.reportFormulaEvaluation,
50
+ },
51
+ ['cases', 'condition'],
52
+ ),
44
53
  ),
45
54
  ) ?? action.default
46
55
  // handle all actions for the case
@@ -65,7 +74,9 @@ export function handleAction(
65
74
  package: ctx.package,
66
75
  toddle: ctx.toddle,
67
76
  env: ctx.env,
77
+ jsonPath: ctx.jsonPath,
68
78
  })
79
+
69
80
  ctx.dataSignal.update((data) => {
70
81
  return {
71
82
  ...data,
@@ -78,34 +89,28 @@ export function handleAction(
78
89
  break
79
90
  }
80
91
  case 'TriggerEvent': {
81
- const payload = applyFormula(action.data, {
82
- data,
83
- component: ctx.component,
84
- formulaCache: ctx.formulaCache,
85
- root: ctx.root,
86
- package: ctx.package,
87
- toddle: ctx.toddle,
88
- env: ctx.env,
89
- })
92
+ const payload = applyFormula(
93
+ action.data,
94
+ {
95
+ data,
96
+ component: ctx.component,
97
+ formulaCache: ctx.formulaCache,
98
+ root: ctx.root,
99
+ package: ctx.package,
100
+ toddle: ctx.toddle,
101
+ env: ctx.env,
102
+ jsonPath: ctx.jsonPath,
103
+ reportFormulaEvaluation: ctx.reportFormulaEvaluation,
104
+ },
105
+ ['data'],
106
+ )
90
107
  ctx.triggerEvent(action.event, payload)
91
108
  break
92
109
  }
93
110
  case 'TriggerWorkflowCallback': {
94
- const payload = applyFormula(action.data, {
95
- data,
96
- component: ctx.component,
97
- formulaCache: ctx.formulaCache,
98
- root: ctx.root,
99
- package: ctx.package,
100
- toddle: ctx.toddle,
101
- env: ctx.env,
102
- })
103
- workflowCallback?.(action.event, payload)
104
- break
105
- }
106
- case 'SetURLParameter': {
107
- ctx.toddle.locationSignal.update((current) => {
108
- const value = applyFormula(action.data, {
111
+ const payload = applyFormula(
112
+ action.data,
113
+ {
109
114
  data,
110
115
  component: ctx.component,
111
116
  formulaCache: ctx.formulaCache,
@@ -113,7 +118,31 @@ export function handleAction(
113
118
  package: ctx.package,
114
119
  toddle: ctx.toddle,
115
120
  env: ctx.env,
116
- })
121
+ jsonPath: ctx.jsonPath,
122
+ reportFormulaEvaluation: ctx.reportFormulaEvaluation,
123
+ },
124
+ ['data'],
125
+ )
126
+ workflowCallback?.(action.event, payload)
127
+ break
128
+ }
129
+ case 'SetURLParameter': {
130
+ ctx.toddle.locationSignal.update((current) => {
131
+ const value = applyFormula(
132
+ action.data,
133
+ {
134
+ data,
135
+ component: ctx.component,
136
+ formulaCache: ctx.formulaCache,
137
+ root: ctx.root,
138
+ package: ctx.package,
139
+ toddle: ctx.toddle,
140
+ env: ctx.env,
141
+ jsonPath: ctx.jsonPath,
142
+ reportFormulaEvaluation: ctx.reportFormulaEvaluation,
143
+ },
144
+ ['data'],
145
+ )
117
146
  // historyMode was previously not declared explicitly, and we default
118
147
  // to push for state changes and replace for query changes
119
148
  let historyMode: SetURLParameterAction['historyMode'] | undefined
@@ -179,7 +208,7 @@ export function handleAction(
179
208
  let historyMode: SetMultiUrlParameterAction['historyMode'] = 'replace'
180
209
  const queryUpdates: Record<string, string> = {}
181
210
  const pathUpdates: Record<string, string> = {}
182
- const urlParameterCtx = {
211
+ const urlParameterCtx: FormulaContext = {
183
212
  data,
184
213
  component: ctx.component,
185
214
  formulaCache: ctx.formulaCache,
@@ -187,6 +216,8 @@ export function handleAction(
187
216
  package: ctx.package,
188
217
  toddle: ctx.toddle,
189
218
  env: ctx.env,
219
+ jsonPath: ctx.jsonPath,
220
+ reportFormulaEvaluation: ctx.reportFormulaEvaluation,
190
221
  }
191
222
  // Only match on p.type === 'param'
192
223
  const isValidPathParameter = (param: string) =>
@@ -199,7 +230,11 @@ export function handleAction(
199
230
  )
200
231
 
201
232
  for (const [parameter, formula] of parameters) {
202
- const value = applyFormula(formula, urlParameterCtx) ?? null
233
+ const value =
234
+ applyFormula(formula, urlParameterCtx, [
235
+ 'parameters',
236
+ parameter,
237
+ ]) ?? null
203
238
  if (isValidPathParameter(parameter)) {
204
239
  historyMode = 'push'
205
240
  pathUpdates[parameter] = value as string
@@ -260,16 +295,26 @@ export function handleAction(
260
295
  if (isContextApiV2(api)) {
261
296
  // Evaluate potential inputs here to make sure the api have the right values
262
297
  // This is needed if the inputs are formulas referencing workflow parameters
263
- const actionInputs = mapValues(action.inputs ?? {}, (input) =>
264
- applyFormula(input.formula, {
265
- data,
266
- component: ctx.component,
267
- formulaCache: ctx.formulaCache,
268
- root: ctx.root,
269
- package: ctx.package,
270
- toddle: ctx.toddle,
271
- env: ctx.env,
272
- }),
298
+ const actionInputs = mapObject(
299
+ action.inputs ?? {},
300
+ ([key, input]) => [
301
+ key,
302
+ applyFormula(
303
+ input.formula,
304
+ {
305
+ data,
306
+ component: ctx.component,
307
+ formulaCache: ctx.formulaCache,
308
+ root: ctx.root,
309
+ package: ctx.package,
310
+ toddle: ctx.toddle,
311
+ env: ctx.env,
312
+ jsonPath: ctx.jsonPath,
313
+ reportFormulaEvaluation: ctx.reportFormulaEvaluation,
314
+ },
315
+ ['inputs', key, 'formula'],
316
+ ),
317
+ ],
273
318
  )
274
319
  const actionModels = {
275
320
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
@@ -326,16 +371,26 @@ export function handleAction(
326
371
  break
327
372
  }
328
373
  case 'TriggerWorkflow': {
329
- const parameters = mapValues(action.parameters ?? {}, (parameter) =>
330
- applyFormula(parameter.formula, {
331
- data,
332
- component: ctx.component,
333
- formulaCache: ctx.formulaCache,
334
- root: ctx.root,
335
- package: ctx.package,
336
- toddle: ctx.toddle,
337
- env: ctx.env,
338
- }),
374
+ const parameters = mapObject(
375
+ action.parameters ?? {},
376
+ ([key, parameter]) => [
377
+ key,
378
+ applyFormula(
379
+ parameter.formula,
380
+ {
381
+ data,
382
+ component: ctx.component,
383
+ formulaCache: ctx.formulaCache,
384
+ root: ctx.root,
385
+ package: ctx.package,
386
+ toddle: ctx.toddle,
387
+ env: ctx.env,
388
+ jsonPath: ctx.jsonPath,
389
+ reportFormulaEvaluation: ctx.reportFormulaEvaluation,
390
+ },
391
+ ['parameters', key, 'formula'],
392
+ ),
393
+ ],
339
394
  )
340
395
  const callbacks = action.callbacks
341
396
  if (action.contextProvider) {
@@ -365,19 +420,21 @@ export function handleAction(
365
420
  event,
366
421
  (callbackName, callbackData) => {
367
422
  const callback = callbacks?.[callbackName]
368
- callback?.actions?.forEach((action) =>
369
- handleAction(
370
- action,
371
- {
372
- ...data,
373
- ...ctx.dataSignal.get(),
374
- Parameters: parameters,
375
- Event: callbackData,
376
- },
377
- ctx,
378
- event,
379
- workflowCallback,
380
- ),
423
+ callback?.actions?.forEach(
424
+ (action) =>
425
+ action &&
426
+ handleAction(
427
+ action,
428
+ {
429
+ ...data,
430
+ ...ctx.dataSignal.get(),
431
+ Parameters: parameters,
432
+ Event: callbackData,
433
+ },
434
+ ctx,
435
+ event,
436
+ workflowCallback,
437
+ ),
381
438
  )
382
439
  },
383
440
  ),
@@ -405,19 +462,21 @@ export function handleAction(
405
462
  event,
406
463
  (callbackName, callbackData) => {
407
464
  const callback = callbacks?.[callbackName]
408
- callback?.actions?.forEach((action) =>
409
- handleAction(
410
- action,
411
- {
412
- ...data,
413
- ...ctx.dataSignal.get(),
414
- Parameters: parameters,
415
- Event: callbackData,
416
- },
417
- ctx,
418
- event,
419
- workflowCallback,
420
- ),
465
+ callback?.actions?.forEach(
466
+ (action) =>
467
+ action &&
468
+ handleAction(
469
+ action,
470
+ {
471
+ ...data,
472
+ ...ctx.dataSignal.get(),
473
+ Parameters: parameters,
474
+ Event: callbackData,
475
+ },
476
+ ctx,
477
+ event,
478
+ workflowCallback,
479
+ ),
421
480
  )
422
481
  },
423
482
  ),
@@ -455,19 +514,25 @@ export function handleAction(
455
514
  const args = (action.arguments ?? []).reduce<
456
515
  Record<string, unknown>
457
516
  >(
458
- (args, arg) =>
517
+ (args, arg, i) =>
459
518
  arg
460
519
  ? {
461
520
  ...args,
462
- [arg.name]: applyFormula(arg.formula, {
463
- data,
464
- component: ctx.component,
465
- formulaCache: ctx.formulaCache,
466
- root: ctx.root,
467
- package: ctx.package,
468
- toddle: ctx.toddle,
469
- env: ctx.env,
470
- }),
521
+ [arg.name]: applyFormula(
522
+ arg.formula,
523
+ {
524
+ data,
525
+ component: ctx.component,
526
+ formulaCache: ctx.formulaCache,
527
+ root: ctx.root,
528
+ package: ctx.package,
529
+ toddle: ctx.toddle,
530
+ env: ctx.env,
531
+ jsonPath: ctx.jsonPath,
532
+ reportFormulaEvaluation: ctx.reportFormulaEvaluation,
533
+ },
534
+ ['arguments', i, 'formula'],
535
+ ),
471
536
  }
472
537
  : args,
473
538
  {},
@@ -511,26 +576,38 @@ export function handleAction(
511
576
  return
512
577
  }
513
578
  // First evaluate any arguments (input) to the action
514
- const args = action.arguments?.map((arg) =>
515
- applyFormula(arg?.formula, {
516
- data,
517
- component: ctx.component,
518
- formulaCache: ctx.formulaCache,
519
- root: ctx.root,
520
- package: ctx.package,
521
- toddle: ctx.toddle,
522
- env: ctx.env,
523
- }),
579
+ const args = action.arguments?.map((arg, i) =>
580
+ applyFormula(
581
+ arg?.formula,
582
+ {
583
+ data,
584
+ component: ctx.component,
585
+ formulaCache: ctx.formulaCache,
586
+ root: ctx.root,
587
+ package: ctx.package,
588
+ toddle: ctx.toddle,
589
+ env: ctx.env,
590
+ jsonPath: ctx.jsonPath,
591
+ reportFormulaEvaluation: ctx.reportFormulaEvaluation,
592
+ },
593
+ ['arguments', i, 'formula'],
594
+ ),
524
595
  ) ?? [
525
- applyFormula(action.data, {
526
- data,
527
- component: ctx.component,
528
- formulaCache: ctx.formulaCache,
529
- root: ctx.root,
530
- package: ctx.package,
531
- toddle: ctx.toddle,
532
- env: ctx.env,
533
- }),
596
+ applyFormula(
597
+ action.data,
598
+ {
599
+ data,
600
+ component: ctx.component,
601
+ formulaCache: ctx.formulaCache,
602
+ root: ctx.root,
603
+ package: ctx.package,
604
+ toddle: ctx.toddle,
605
+ env: ctx.env,
606
+ jsonPath: ctx.jsonPath,
607
+ reportFormulaEvaluation: ctx.reportFormulaEvaluation,
608
+ },
609
+ ['arguments', 'data'],
610
+ ),
534
611
  ] // action.data is a fallback to handle an older version of the action spec.
535
612
  return legacyHandler(args, { ...ctx, triggerActionEvent }, event)
536
613
  }
package/src/page.main.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { isLegacyApi, sortApiObjects } from '@nordcraft/core/dist/api/api'
2
+ import type { ComponentAPI } from '@nordcraft/core/dist/api/apiTypes'
2
3
  import type {
3
4
  Component,
4
5
  ComponentData,
@@ -168,15 +169,20 @@ export const createRoot = (domNode: HTMLElement) => {
168
169
  // state (e.g. localStorage, sensors etc.)
169
170
  Variables: mapObject(component.variables ?? {}, ([name, variable]) => [
170
171
  name,
171
- applyFormula(variable.initialValue, {
172
- data: window.toddle.pageState,
173
- component,
174
- formulaCache: {},
175
- root: document,
176
- package: undefined,
177
- toddle: window.toddle,
178
- env,
179
- }),
172
+ applyFormula(
173
+ variable.initialValue,
174
+ {
175
+ data: window.toddle.pageState,
176
+ component,
177
+ formulaCache: {},
178
+ root: document,
179
+ package: undefined,
180
+ toddle: window.toddle,
181
+ env,
182
+ jsonPath: [],
183
+ },
184
+ ['variables', name],
185
+ ),
180
186
  ]),
181
187
  })
182
188
 
@@ -217,22 +223,31 @@ export const createRoot = (domNode: HTMLElement) => {
217
223
  console.info('EVENT FIRED', event, data),
218
224
  package: undefined,
219
225
  env,
226
+ jsonPath: [],
220
227
  }
221
228
 
222
229
  // Note: this function must run procedurally to ensure apis (which are in correct order) can reference each other
223
- sortApiObjects(Object.entries(component.apis ?? {})).forEach(
224
- ([name, api]) => {
225
- if (isLegacyApi(api)) {
226
- ctx.apis[name] = createLegacyAPI(api, ctx)
227
- } else {
228
- ctx.apis[name] = createAPI({
229
- apiRequest: api,
230
- ctx,
231
- componentData: dataSignal.get(),
232
- })
233
- }
234
- },
235
- )
230
+ sortApiObjects(
231
+ Object.entries(component.apis ?? {}).filter(
232
+ (entry): entry is [string, ComponentAPI] => isDefined(entry[1]),
233
+ ),
234
+ ).forEach(([name, api]) => {
235
+ if (isLegacyApi(api)) {
236
+ ctx.apis[name] = createLegacyAPI(api, {
237
+ ...ctx,
238
+ jsonPath: ['apis', name],
239
+ })
240
+ } else {
241
+ ctx.apis[name] = createAPI({
242
+ apiRequest: api,
243
+ ctx: {
244
+ ...ctx,
245
+ jsonPath: ['apis', name],
246
+ },
247
+ componentData: dataSignal.get(),
248
+ })
249
+ }
250
+ })
236
251
  // Trigger actions for all APIs after all of them are created.
237
252
  Object.values(ctx.apis)
238
253
  .filter(isContextApiV2)
@@ -375,7 +390,13 @@ const setupMetaUpdates = (
375
390
  if (dynamicLang) {
376
391
  dataSignal
377
392
  .map((data) =>
378
- component ? applyFormula(langFormula, getFormulaContext(data)) : null,
393
+ component
394
+ ? applyFormula(langFormula, getFormulaContext(data), [
395
+ 'route',
396
+ 'info',
397
+ 'language',
398
+ ])
399
+ : null,
379
400
  )
380
401
  .subscribe((newLang) => {
381
402
  if (isDefined(newLang) && document.documentElement.lang !== newLang) {
@@ -390,7 +411,13 @@ const setupMetaUpdates = (
390
411
  if (dynamicTitle) {
391
412
  dataSignal
392
413
  .map((data) =>
393
- component ? applyFormula(titleFormula, getFormulaContext(data)) : null,
414
+ component
415
+ ? applyFormula(titleFormula, getFormulaContext(data), [
416
+ 'route',
417
+ 'info',
418
+ 'title',
419
+ ])
420
+ : null,
394
421
  )
395
422
  .subscribe((newTitle) => {
396
423
  if (isDefined(newTitle) && document.title !== newTitle) {
@@ -455,7 +482,11 @@ const setupMetaUpdates = (
455
482
  dataSignal
456
483
  .map((data) =>
457
484
  component
458
- ? applyFormula(descriptionFormula, getFormulaContext(data))
485
+ ? applyFormula(descriptionFormula, getFormulaContext(data), [
486
+ 'route',
487
+ 'info',
488
+ 'description',
489
+ ])
459
490
  : null,
460
491
  )
461
492
  .subscribe((newDescription) => {
@@ -511,7 +542,14 @@ const setupMetaUpdates = (
511
542
  component
512
543
  ? {
513
544
  ...agg,
514
- [key]: applyFormula(formula, context),
545
+ [key]: applyFormula(formula, context, [
546
+ 'route',
547
+ 'info',
548
+ 'meta',
549
+ id,
550
+ 'attrs',
551
+ key,
552
+ ]),
515
553
  }
516
554
  : agg,
517
555
  {},
package/src/types.d.ts CHANGED
@@ -9,6 +9,7 @@ import type {
9
9
  ToddleEnv,
10
10
  ValueOperationValue,
11
11
  } from '@nordcraft/core/dist/formula/formula'
12
+ import type { FormulaEvaluationReporter } from '@nordcraft/core/dist/formula/formulaTypes'
12
13
  import type {
13
14
  Toddle as NewToddle,
14
15
  Toddle,
@@ -84,6 +85,8 @@ export interface ComponentContext {
84
85
  theme: Signal<string | null>
85
86
  }
86
87
  toddle: Toddle<LocationSignal, PreviewShowSignal>
88
+ jsonPath: Array<string | number> | undefined
89
+ reportFormulaEvaluation?: FormulaEvaluationReporter | undefined
87
90
  env: ToddleEnv
88
91
  }
89
92
 
@@ -48,7 +48,7 @@ export function createFormulaCache(component: Component): FormulaCache {
48
48
  }
49
49
 
50
50
  function getFormulaCacheConfig(formula: Formula, component: Component) {
51
- const paths: string[][] = []
51
+ const paths: Array<string | number>[] = []
52
52
  function visitOperation(op: Formula) {
53
53
  if (!op) {
54
54
  return
@@ -81,7 +81,7 @@ function getFormulaCacheConfig(formula: Formula, component: Component) {
81
81
  }
82
82
  }
83
83
 
84
- const keys: string[][] = []
84
+ const keys: Array<string | number>[] = []
85
85
  paths
86
86
  .sort((a, b) => a.length - b.length)
87
87
  .forEach((path) => {