@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.
- package/dist/{chunk-XO4ODEY2.js → chunk-I5EPWHNM.js} +3 -3
- package/dist/{chunk-XO4ODEY2.js.map → chunk-I5EPWHNM.js.map} +1 -1
- package/dist/{chunk-BBFHGAEN.js → chunk-J66LOLJR.js} +4 -4
- package/dist/{chunk-BBFHGAEN.js.map → chunk-J66LOLJR.js.map} +1 -1
- package/dist/{chunk-3EDB6ELL.js → chunk-KMONOPAK.js} +3 -3
- package/dist/{chunk-3EDB6ELL.js.map → chunk-KMONOPAK.js.map} +1 -1
- package/dist/{chunk-GPFIJR2K.js → chunk-LBE4L3DS.js} +4 -4
- package/dist/{chunk-GPFIJR2K.js.map → chunk-LBE4L3DS.js.map} +1 -1
- package/dist/{chunk-J5YUYDMK.js → chunk-OZHBAXMA.js} +21 -4
- package/dist/chunk-OZHBAXMA.js.map +1 -0
- package/dist/{chunk-S4MOUOG4.js → chunk-QMJVUT7C.js} +3 -3
- package/dist/{chunk-S4MOUOG4.js.map → chunk-QMJVUT7C.js.map} +1 -1
- package/dist/{chunk-4GNDRRJ3.js → chunk-R4G7SPLD.js} +3 -3
- package/dist/{chunk-4GNDRRJ3.js.map → chunk-R4G7SPLD.js.map} +1 -1
- package/dist/durable.cjs +19 -2
- package/dist/durable.cjs.map +1 -1
- package/dist/durable.js +1 -1
- package/dist/engine.cjs +19 -2
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.js +4 -4
- package/dist/index.cjs +19 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -12
- package/dist/registry.cjs +19 -2
- package/dist/registry.cjs.map +1 -1
- package/dist/registry.js +2 -2
- package/dist/runtime.cjs +19 -2
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +3 -3
- package/dist/schema.cjs +19 -2
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.js +3 -3
- package/dist/screens.cjs +19 -2
- package/dist/screens.cjs.map +1 -1
- package/dist/screens.js +4 -4
- package/dist/ux.cjs +19 -2
- package/dist/ux.cjs.map +1 -1
- package/dist/ux.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-J5YUYDMK.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { removeNodes, removeEdges, cloneSubgraph, alignNodes, distributeNodes, reconnectEdge, assignToLane, removeFromLane, duplicateNode, setEdgeLabel, FlowCanvas } from './chunk-
|
|
2
|
-
export { ActionNode, DecisionNode, FlowCanvas, FlowViewer, NodeShell, OutputNode, SubgraphNode, TriggerNode, alignNodes, cloneSubgraph, defaultNodeTypes, distributeNodes, reconnectEdge } from './chunk-
|
|
3
|
-
import { useFlowState, useFlowRun, useFlowHistory, applyOutputsToNodes, applyStatusesToNodes } from './chunk-
|
|
4
|
-
export { applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './chunk-
|
|
5
|
-
export { runCohort } from './chunk-
|
|
6
|
-
import { buildNodeTypes, FlowEditorProvider, registerBuiltinKinds } from './chunk-
|
|
7
|
-
export { ANY_PORT_TYPE, BUILTIN_KINDS, LaneNode, NoteNode, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, registerBuiltinKinds, useFlowEditor, useFlowEditorOptional } from './chunk-
|
|
1
|
+
import { removeNodes, removeEdges, cloneSubgraph, alignNodes, distributeNodes, reconnectEdge, assignToLane, removeFromLane, duplicateNode, setEdgeLabel, FlowCanvas } from './chunk-J66LOLJR.js';
|
|
2
|
+
export { ActionNode, DecisionNode, FlowCanvas, FlowViewer, NodeShell, OutputNode, SubgraphNode, TriggerNode, alignNodes, cloneSubgraph, defaultNodeTypes, distributeNodes, reconnectEdge } from './chunk-J66LOLJR.js';
|
|
3
|
+
import { useFlowState, useFlowRun, useFlowHistory, applyOutputsToNodes, applyStatusesToNodes } from './chunk-QMJVUT7C.js';
|
|
4
|
+
export { applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './chunk-QMJVUT7C.js';
|
|
5
|
+
export { runCohort } from './chunk-R4G7SPLD.js';
|
|
6
|
+
import { buildNodeTypes, FlowEditorProvider, registerBuiltinKinds } from './chunk-I5EPWHNM.js';
|
|
7
|
+
export { ANY_PORT_TYPE, BUILTIN_KINDS, LaneNode, NoteNode, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, registerBuiltinKinds, useFlowEditor, useFlowEditorOptional } from './chunk-I5EPWHNM.js';
|
|
8
8
|
import { getRichInputAdapter } from './chunk-F5RPRB7A.js';
|
|
9
9
|
export { RichInputPreview, getRichInputAdapter, isRichInputEnabled, onRichInputAdapterChanged, registerRichInputAdapter } from './chunk-F5RPRB7A.js';
|
|
10
10
|
import { ReactFlowProvider, useReactFlow, addEdge, applyEdgeChanges, applyNodeChanges, Position, Handle } from './chunk-OWENS2H5.js';
|
|
11
|
-
import { workflowToBlob, importWorkflow, exportWorkflow } from './chunk-
|
|
12
|
-
export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-
|
|
13
|
-
import './chunk-
|
|
14
|
-
import { humanInputFields, onNodeKindsChanged, listNodeKinds, getNodeKind, defaultConfigFor, ensureBuiltinKinds, validateConfig, categoryAccent, availableVariables, baseVariables, describeExpressionGrammar } from './chunk-
|
|
15
|
-
export { LEGACY_PAUSE_PREFIXES, PAUSE_PREFIX, UnresolvedPathError, applyKindSchemaOverlay, availableVariables, baseVariables, categoryAccent, clearKindSchemaOverlays, clearNodeKindOverrides, decodePause, defaultConfigFor, describeExpressionGrammar, encodePause, ensureBuiltinKinds, evaluateConfig, evaluateExpression, getNodeKind, isPause, listNodeKinds, onNodeKindsChanged, outputFieldsFor, overrideNodeKind, pauseForHuman, registerNodeKind, resolveNodePorts, resolvePath, resolvePortSpec, runFlow, text, truthy, tryResolvePath, unregisterNodeKind, validateConfig } from './chunk-
|
|
11
|
+
import { workflowToBlob, importWorkflow, exportWorkflow } from './chunk-LBE4L3DS.js';
|
|
12
|
+
export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-LBE4L3DS.js';
|
|
13
|
+
import './chunk-KMONOPAK.js';
|
|
14
|
+
import { humanInputFields, onNodeKindsChanged, listNodeKinds, getNodeKind, defaultConfigFor, ensureBuiltinKinds, validateConfig, categoryAccent, availableVariables, baseVariables, describeExpressionGrammar } from './chunk-OZHBAXMA.js';
|
|
15
|
+
export { LEGACY_PAUSE_PREFIXES, PAUSE_PREFIX, UnresolvedPathError, applyKindSchemaOverlay, availableVariables, baseVariables, categoryAccent, clearKindSchemaOverlays, clearNodeKindOverrides, decodePause, defaultConfigFor, describeExpressionGrammar, encodePause, ensureBuiltinKinds, evaluateConfig, evaluateExpression, getNodeKind, isPause, listNodeKinds, onNodeKindsChanged, outputFieldsFor, overrideNodeKind, pauseForHuman, registerNodeKind, resolveNodePorts, resolvePath, resolvePortSpec, runFlow, text, truthy, tryResolvePath, unregisterNodeKind, validateConfig } from './chunk-OZHBAXMA.js';
|
|
16
16
|
import './chunk-2QXKDLGT.js';
|
|
17
17
|
import { forwardRef, useState, useMemo, useEffect, useCallback, useRef, useImperativeHandle, useId, memo } from 'react';
|
|
18
18
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
package/dist/registry.cjs
CHANGED
|
@@ -1231,6 +1231,7 @@ var branchExecutor = (ctx) => {
|
|
|
1231
1231
|
const inputs = ctx.inputs;
|
|
1232
1232
|
let taken;
|
|
1233
1233
|
const raw = config.condition;
|
|
1234
|
+
validateRoutingExpression(ctx, raw, "branch", "condition");
|
|
1234
1235
|
if (typeof raw === "string" && raw.trim() !== "") {
|
|
1235
1236
|
taken = truthy(resolve(raw, inputs));
|
|
1236
1237
|
warnIfUnresolved(ctx, raw, taken ? "true" : "false");
|
|
@@ -1400,6 +1401,7 @@ var switchCaseExecutor = (ctx) => {
|
|
|
1400
1401
|
const config = configOf(ctx.node);
|
|
1401
1402
|
const inputs = ctx.inputs;
|
|
1402
1403
|
const expression = config.value;
|
|
1404
|
+
validateRoutingExpression(ctx, expression, "switch_case", "value");
|
|
1403
1405
|
const value = text(resolve(expression, inputs));
|
|
1404
1406
|
const cases = config.cases ?? {};
|
|
1405
1407
|
const matched = Object.prototype.hasOwnProperty.call(cases, value);
|
|
@@ -1407,6 +1409,21 @@ var switchCaseExecutor = (ctx) => {
|
|
|
1407
1409
|
warnIfUnresolved(ctx, expression, port, "value");
|
|
1408
1410
|
return { __port: port, value: inputs.in ?? inputs };
|
|
1409
1411
|
};
|
|
1412
|
+
function validateRoutingExpression(ctx, value, kind, field) {
|
|
1413
|
+
if (typeof value !== "string" || value.trim() === "") return;
|
|
1414
|
+
const bare = value.trim();
|
|
1415
|
+
const subject = `${kind} "${ctx.node.id}" ${field} "${bare}"`;
|
|
1416
|
+
if (!value.includes("{{")) {
|
|
1417
|
+
ctx.abort(`${subject} is not an expression -- wrap it: {{ ${bare} }}`);
|
|
1418
|
+
}
|
|
1419
|
+
let open = 0;
|
|
1420
|
+
for (const [delimiter] of value.matchAll(/\{\{|\}\}/g)) {
|
|
1421
|
+
open = delimiter === "{{" ? open + 1 : Math.max(0, open - 1);
|
|
1422
|
+
}
|
|
1423
|
+
if (open > 0) {
|
|
1424
|
+
ctx.abort(`${subject} has an unclosed expression -- close every {{ with }}`);
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1410
1427
|
|
|
1411
1428
|
// src/registry/terminal-nodes.ts
|
|
1412
1429
|
var DEFAULT_TIMEOUT_MS = 12e4;
|
|
@@ -1898,7 +1915,7 @@ var KINDS = [
|
|
|
1898
1915
|
key: "condition",
|
|
1899
1916
|
label: "Raw expression (advanced)",
|
|
1900
1917
|
example: "{{ $json.active && $json.score > 10 }}",
|
|
1901
|
-
description: "Escape hatch for logic the builder can't express. Overrides the conditions above when set."
|
|
1918
|
+
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."
|
|
1902
1919
|
}
|
|
1903
1920
|
]
|
|
1904
1921
|
},
|
|
@@ -1918,7 +1935,7 @@ var KINDS = [
|
|
|
1918
1935
|
// moves the ports on the canvas and the ports the runtime activates.
|
|
1919
1936
|
outputs: (config) => casePorts(config?.cases),
|
|
1920
1937
|
configSchema: [
|
|
1921
|
-
{ type: "expression", key: "value", label: "Switch on", example: "{{ $json.kind }}", required: true },
|
|
1938
|
+
{ 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 },
|
|
1922
1939
|
{
|
|
1923
1940
|
type: "keyvalue",
|
|
1924
1941
|
key: "cases",
|