@particle-academy/fancy-flow 0.78.0 → 0.79.0

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 (40) hide show
  1. package/dist/{chunk-XO4ODEY2.js → chunk-I5EPWHNM.js} +3 -3
  2. package/dist/{chunk-XO4ODEY2.js.map → chunk-I5EPWHNM.js.map} +1 -1
  3. package/dist/{chunk-BBFHGAEN.js → chunk-J66LOLJR.js} +4 -4
  4. package/dist/{chunk-BBFHGAEN.js.map → chunk-J66LOLJR.js.map} +1 -1
  5. package/dist/{chunk-3EDB6ELL.js → chunk-KMONOPAK.js} +3 -3
  6. package/dist/{chunk-3EDB6ELL.js.map → chunk-KMONOPAK.js.map} +1 -1
  7. package/dist/{chunk-GPFIJR2K.js → chunk-LBE4L3DS.js} +4 -4
  8. package/dist/{chunk-GPFIJR2K.js.map → chunk-LBE4L3DS.js.map} +1 -1
  9. package/dist/{chunk-J5YUYDMK.js → chunk-OZHBAXMA.js} +21 -4
  10. package/dist/chunk-OZHBAXMA.js.map +1 -0
  11. package/dist/{chunk-S4MOUOG4.js → chunk-QMJVUT7C.js} +3 -3
  12. package/dist/{chunk-S4MOUOG4.js.map → chunk-QMJVUT7C.js.map} +1 -1
  13. package/dist/{chunk-4GNDRRJ3.js → chunk-R4G7SPLD.js} +3 -3
  14. package/dist/{chunk-4GNDRRJ3.js.map → chunk-R4G7SPLD.js.map} +1 -1
  15. package/dist/durable.cjs +19 -2
  16. package/dist/durable.cjs.map +1 -1
  17. package/dist/durable.js +1 -1
  18. package/dist/engine.cjs +19 -2
  19. package/dist/engine.cjs.map +1 -1
  20. package/dist/engine.js +4 -4
  21. package/dist/index.cjs +19 -2
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.js +12 -12
  24. package/dist/registry.cjs +19 -2
  25. package/dist/registry.cjs.map +1 -1
  26. package/dist/registry.js +2 -2
  27. package/dist/runtime.cjs +19 -2
  28. package/dist/runtime.cjs.map +1 -1
  29. package/dist/runtime.js +3 -3
  30. package/dist/schema.cjs +19 -2
  31. package/dist/schema.cjs.map +1 -1
  32. package/dist/schema.js +3 -3
  33. package/dist/screens.cjs +19 -2
  34. package/dist/screens.cjs.map +1 -1
  35. package/dist/screens.js +4 -4
  36. package/dist/ux.cjs +19 -2
  37. package/dist/ux.cjs.map +1 -1
  38. package/dist/ux.js +1 -1
  39. package/package.json +2 -2
  40. package/dist/chunk-J5YUYDMK.js.map +0 -1
package/dist/screens.js CHANGED
@@ -1,9 +1,9 @@
1
- import { FlowViewer } from './chunk-BBFHGAEN.js';
2
- export { FlowViewer } from './chunk-BBFHGAEN.js';
3
- import './chunk-XO4ODEY2.js';
1
+ import { FlowViewer } from './chunk-J66LOLJR.js';
2
+ export { FlowViewer } from './chunk-J66LOLJR.js';
3
+ import './chunk-I5EPWHNM.js';
4
4
  import './chunk-F5RPRB7A.js';
5
5
  import './chunk-OWENS2H5.js';
6
- import './chunk-J5YUYDMK.js';
6
+ import './chunk-OZHBAXMA.js';
7
7
  import './chunk-2QXKDLGT.js';
8
8
  import { registerSchemaComponents } from '@particle-academy/fancy-screens';
9
9
 
package/dist/ux.cjs CHANGED
@@ -1166,6 +1166,7 @@ var branchExecutor = (ctx) => {
1166
1166
  const inputs = ctx.inputs;
1167
1167
  let taken;
1168
1168
  const raw = config.condition;
1169
+ validateRoutingExpression(ctx, raw, "branch", "condition");
1169
1170
  if (typeof raw === "string" && raw.trim() !== "") {
1170
1171
  taken = truthy(resolve(raw, inputs));
1171
1172
  warnIfUnresolved(ctx, raw, taken ? "true" : "false");
@@ -1335,6 +1336,7 @@ var switchCaseExecutor = (ctx) => {
1335
1336
  const config = configOf(ctx.node);
1336
1337
  const inputs = ctx.inputs;
1337
1338
  const expression = config.value;
1339
+ validateRoutingExpression(ctx, expression, "switch_case", "value");
1338
1340
  const value = text(resolve(expression, inputs));
1339
1341
  const cases = config.cases ?? {};
1340
1342
  const matched = Object.prototype.hasOwnProperty.call(cases, value);
@@ -1342,6 +1344,21 @@ var switchCaseExecutor = (ctx) => {
1342
1344
  warnIfUnresolved(ctx, expression, port, "value");
1343
1345
  return { __port: port, value: inputs.in ?? inputs };
1344
1346
  };
1347
+ function validateRoutingExpression(ctx, value, kind, field) {
1348
+ if (typeof value !== "string" || value.trim() === "") return;
1349
+ const bare = value.trim();
1350
+ const subject = `${kind} "${ctx.node.id}" ${field} "${bare}"`;
1351
+ if (!value.includes("{{")) {
1352
+ ctx.abort(`${subject} is not an expression -- wrap it: {{ ${bare} }}`);
1353
+ }
1354
+ let open = 0;
1355
+ for (const [delimiter] of value.matchAll(/\{\{|\}\}/g)) {
1356
+ open = delimiter === "{{" ? open + 1 : Math.max(0, open - 1);
1357
+ }
1358
+ if (open > 0) {
1359
+ ctx.abort(`${subject} has an unclosed expression -- close every {{ with }}`);
1360
+ }
1361
+ }
1345
1362
 
1346
1363
  // src/registry/terminal-nodes.ts
1347
1364
  var DEFAULT_TIMEOUT_MS = 12e4;
@@ -1833,7 +1850,7 @@ var KINDS = [
1833
1850
  key: "condition",
1834
1851
  label: "Raw expression (advanced)",
1835
1852
  example: "{{ $json.active && $json.score > 10 }}",
1836
- description: "Escape hatch for logic the builder can't express. Overrides the conditions above when set."
1853
+ description: "Escape hatch for logic the builder can't express. Overrides the conditions above when set. String values must be {{ }}-wrapped expressions; bare strings and unclosed templates abort the run."
1837
1854
  }
1838
1855
  ]
1839
1856
  },
@@ -1853,7 +1870,7 @@ var KINDS = [
1853
1870
  // moves the ports on the canvas and the ports the runtime activates.
1854
1871
  outputs: (config) => casePorts(config?.cases),
1855
1872
  configSchema: [
1856
- { type: "expression", key: "value", label: "Switch on", example: "{{ $json.kind }}", required: true },
1873
+ { type: "expression", key: "value", label: "Switch on", description: "String values must be {{ }}-wrapped expressions; bare strings and unclosed templates abort the run.", example: "{{ $json.kind }}", required: true },
1857
1874
  {
1858
1875
  type: "keyvalue",
1859
1876
  key: "cases",