@particle-academy/fancy-flow 0.43.1 → 0.44.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.
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import { removeNodes, removeEdges, cloneSubgraph, alignNodes, distributeNodes, reconnectEdge, assignToLane, removeFromLane, duplicateNode, setEdgeLabel, FlowCanvas } from './chunk-T3VQX3XB.js';
2
- export { ActionNode, DecisionNode, FlowCanvas, FlowViewer, NodeShell, OutputNode, SubgraphNode, TriggerNode, alignNodes, cloneSubgraph, defaultNodeTypes, distributeNodes, reconnectEdge } from './chunk-T3VQX3XB.js';
1
+ import { removeNodes, removeEdges, cloneSubgraph, alignNodes, distributeNodes, reconnectEdge, assignToLane, removeFromLane, duplicateNode, setEdgeLabel, FlowCanvas } from './chunk-DHUFUDEX.js';
2
+ export { ActionNode, DecisionNode, FlowCanvas, FlowViewer, NodeShell, OutputNode, SubgraphNode, TriggerNode, alignNodes, cloneSubgraph, defaultNodeTypes, distributeNodes, reconnectEdge } from './chunk-DHUFUDEX.js';
3
3
  import { useFlowState, useFlowRun, useFlowHistory, applyOutputsToNodes, applyStatusesToNodes } from './chunk-A6RFLGWV.js';
4
4
  export { applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './chunk-A6RFLGWV.js';
5
5
  export { runCohort } from './chunk-QZTGV3ZL.js';
6
- import { buildNodeTypes, FlowEditorProvider, registerBuiltinKinds } from './chunk-55KQS3LK.js';
7
- export { ANY_PORT_TYPE, BUILTIN_KINDS, LaneNode, NoteNode, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, registerBuiltinKinds, useFlowEditor, useFlowEditorOptional } from './chunk-55KQS3LK.js';
6
+ import { buildNodeTypes, FlowEditorProvider, registerBuiltinKinds } from './chunk-WBXGZVLB.js';
7
+ export { ANY_PORT_TYPE, BUILTIN_KINDS, LaneNode, NoteNode, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, registerBuiltinKinds, useFlowEditor, useFlowEditorOptional } from './chunk-WBXGZVLB.js';
8
8
  import { ReactFlowProvider, useReactFlow, addEdge, applyEdgeChanges, applyNodeChanges, Position, Handle } from './chunk-OWENS2H5.js';
9
9
  export { LEGACY_PAUSE_PREFIXES, PAUSE_PREFIX, decodePause, encodePause, isPause, pauseForHuman } from './chunk-UEOE6B52.js';
10
10
  import './chunk-USL4FMFU.js';
@@ -1824,8 +1824,23 @@ var flowKeys = {
1824
1824
  };
1825
1825
 
1826
1826
  // src/expressions/expr.ts
1827
- var WHOLE = /^\{\{([\s\S]*?)\}\}$/;
1828
- var EACH = /\{\{([\s\S]*?)\}\}/g;
1827
+ function wholeExpression(trimmed) {
1828
+ if (trimmed.length < 4) return null;
1829
+ if (!trimmed.startsWith("{{") || !trimmed.endsWith("}}")) return null;
1830
+ return trimmed.slice(2, -2);
1831
+ }
1832
+ function interpolate(template, resolve) {
1833
+ let out = "";
1834
+ let i = 0;
1835
+ for (; ; ) {
1836
+ const open = template.indexOf("{{", i);
1837
+ if (open === -1) return out + template.slice(i);
1838
+ const close = template.indexOf("}}", open + 2);
1839
+ if (close === -1) return out + template.slice(i);
1840
+ out += template.slice(i, open) + resolve(template.slice(open + 2, close));
1841
+ i = close + 2;
1842
+ }
1843
+ }
1829
1844
  var FALSY_STRINGS = /* @__PURE__ */ new Set(["", "0", "false", "no", "off", "null"]);
1830
1845
  function resolvePath(path, context) {
1831
1846
  const trimmed = path.trim();
@@ -1850,9 +1865,9 @@ function resolvePath(path, context) {
1850
1865
  }
1851
1866
  function evaluateExpression(template, context) {
1852
1867
  if (typeof template !== "string") return template;
1853
- const whole = WHOLE.exec(template.trim());
1854
- if (whole) return resolvePath(whole[1] ?? "", context);
1855
- return template.replace(EACH, (_m, path) => stringify(resolvePath(path, context)));
1868
+ const whole = wholeExpression(template.trim());
1869
+ if (whole !== null) return resolvePath(whole, context);
1870
+ return interpolate(template, (path) => stringify(resolvePath(path, context)));
1856
1871
  }
1857
1872
  function truthy(value) {
1858
1873
  if (typeof value === "boolean") return value;