@burdenoff/fluidgrids-fe-sdk 2026.1008.3 → 2026.1010.1
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/{WorkflowBuilder-YVIRBXAH.js → WorkflowBuilder-AQSWNBKH.js} +5 -5
- package/dist/{WorkflowBuilder-YVIRBXAH.js.map → WorkflowBuilder-AQSWNBKH.js.map} +1 -1
- package/dist/{WorkflowsList-CQRXZV6I.js → WorkflowsList-CE2CRD7W.js} +4 -4
- package/dist/{WorkflowsList-CQRXZV6I.js.map → WorkflowsList-CE2CRD7W.js.map} +1 -1
- package/dist/{chunk-3B5YEXSW.js → chunk-47RAP7HT.js} +13 -4
- package/dist/chunk-47RAP7HT.js.map +1 -0
- package/dist/{chunk-F5UXTEW5.js → chunk-HK7IRZLW.js} +3 -3
- package/dist/{chunk-F5UXTEW5.js.map → chunk-HK7IRZLW.js.map} +1 -1
- package/dist/{chunk-5DQU54IB.js → chunk-OJ3AVTEY.js} +3 -3
- package/dist/{chunk-5DQU54IB.js.map → chunk-OJ3AVTEY.js.map} +1 -1
- package/dist/{chunk-EL672H2D.js → chunk-PAZHTUZ4.js} +3 -3
- package/dist/{chunk-EL672H2D.js.map → chunk-PAZHTUZ4.js.map} +1 -1
- package/dist/{chunk-VGJKZYW2.js → chunk-PKWVMJFF.js} +4 -4
- package/dist/{chunk-VGJKZYW2.js.map → chunk-PKWVMJFF.js.map} +1 -1
- package/dist/{chunk-WXNDAONY.js → chunk-T3ZCEAHR.js} +3 -3
- package/dist/{chunk-WXNDAONY.js.map → chunk-T3ZCEAHR.js.map} +1 -1
- package/dist/{chunk-5UB3HSNE.js → chunk-UQYGUZEP.js} +4 -4
- package/dist/{chunk-5UB3HSNE.js.map → chunk-UQYGUZEP.js.map} +1 -1
- package/dist/index.js +11 -11
- package/dist/settings.js +2 -2
- package/dist/templates.js +3 -3
- package/dist/workflow-builder.js +4 -4
- package/dist/workflows-list.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-3B5YEXSW.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { WorkflowBuilder } from './chunk-
|
|
1
|
+
export { WorkflowBuilder } from './chunk-UQYGUZEP.js';
|
|
2
2
|
import './chunk-KGD6CRSA.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-OJ3AVTEY.js';
|
|
4
4
|
import './chunk-XQP33UJR.js';
|
|
5
5
|
import './chunk-P5PKRQAO.js';
|
|
6
6
|
import './chunk-NH5YCY37.js';
|
|
@@ -12,10 +12,10 @@ import './chunk-W23ZXNKU.js';
|
|
|
12
12
|
import './chunk-3ZYUGTIT.js';
|
|
13
13
|
import './chunk-XBIHI224.js';
|
|
14
14
|
import './chunk-DFGJKGWH.js';
|
|
15
|
-
import './chunk-
|
|
15
|
+
import './chunk-47RAP7HT.js';
|
|
16
16
|
import './chunk-3P4YQ7DO.js';
|
|
17
17
|
import './chunk-LMO5ASOE.js';
|
|
18
18
|
import './chunk-7YWBH2A5.js';
|
|
19
19
|
import './chunk-ZBMMEE5U.js';
|
|
20
|
-
//# sourceMappingURL=WorkflowBuilder-
|
|
21
|
-
//# sourceMappingURL=WorkflowBuilder-
|
|
20
|
+
//# sourceMappingURL=WorkflowBuilder-AQSWNBKH.js.map
|
|
21
|
+
//# sourceMappingURL=WorkflowBuilder-AQSWNBKH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"WorkflowBuilder-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"WorkflowBuilder-AQSWNBKH.js"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { WorkflowsList } from './chunk-
|
|
1
|
+
export { WorkflowsList } from './chunk-HK7IRZLW.js';
|
|
2
2
|
import './chunk-KGD6CRSA.js';
|
|
3
3
|
import './chunk-AANIWER2.js';
|
|
4
4
|
import './chunk-W23ZXNKU.js';
|
|
5
5
|
import './chunk-3ZYUGTIT.js';
|
|
6
6
|
import './chunk-XBIHI224.js';
|
|
7
7
|
import './chunk-DFGJKGWH.js';
|
|
8
|
-
import './chunk-
|
|
8
|
+
import './chunk-47RAP7HT.js';
|
|
9
9
|
import './chunk-3P4YQ7DO.js';
|
|
10
10
|
import './chunk-LMO5ASOE.js';
|
|
11
11
|
import './chunk-7YWBH2A5.js';
|
|
12
12
|
import './chunk-ZBMMEE5U.js';
|
|
13
|
-
//# sourceMappingURL=WorkflowsList-
|
|
14
|
-
//# sourceMappingURL=WorkflowsList-
|
|
13
|
+
//# sourceMappingURL=WorkflowsList-CE2CRD7W.js.map
|
|
14
|
+
//# sourceMappingURL=WorkflowsList-CE2CRD7W.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"WorkflowsList-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"WorkflowsList-CE2CRD7W.js"}
|
|
@@ -55,6 +55,11 @@ var useFlowStore = create()((set, get) => {
|
|
|
55
55
|
lastCheckpointKind = kind;
|
|
56
56
|
lastCheckpointAt = now;
|
|
57
57
|
}
|
|
58
|
+
const REMOVAL_KINDS = /* @__PURE__ */ new Set(["nodes:remove", "edges:remove"]);
|
|
59
|
+
const SAME_ACTION_WINDOW_MS = 150;
|
|
60
|
+
function joinsPrecedingRemoval(kind) {
|
|
61
|
+
return lastCheckpointKind !== null && lastCheckpointKind !== kind && REMOVAL_KINDS.has(kind) && REMOVAL_KINDS.has(lastCheckpointKind) && Date.now() - lastCheckpointAt < SAME_ACTION_WINDOW_MS;
|
|
62
|
+
}
|
|
58
63
|
function resetCoalescing() {
|
|
59
64
|
lastCheckpointKind = null;
|
|
60
65
|
lastCheckpointAt = 0;
|
|
@@ -289,7 +294,9 @@ var useFlowStore = create()((set, get) => {
|
|
|
289
294
|
const stillPresent = get().workflow.nodes.some(
|
|
290
295
|
(n) => removedIds.has(n.id)
|
|
291
296
|
);
|
|
292
|
-
if (stillPresent
|
|
297
|
+
if (stillPresent && !joinsPrecedingRemoval("nodes:remove")) {
|
|
298
|
+
pushCheckpoint("nodes:remove", false);
|
|
299
|
+
}
|
|
293
300
|
} else if (addedCount > 0) {
|
|
294
301
|
pushCheckpoint("nodes:add", false);
|
|
295
302
|
} else {
|
|
@@ -485,7 +492,9 @@ var useFlowStore = create()((set, get) => {
|
|
|
485
492
|
const stillPresent = get().workflow.edges.some(
|
|
486
493
|
(e) => removedIds.has(e.id)
|
|
487
494
|
);
|
|
488
|
-
if (stillPresent
|
|
495
|
+
if (stillPresent && !joinsPrecedingRemoval("edges:remove")) {
|
|
496
|
+
pushCheckpoint("edges:remove", false);
|
|
497
|
+
}
|
|
489
498
|
} else if (changes.some((c) => c.type === "add")) {
|
|
490
499
|
pushCheckpoint("edges:add", false);
|
|
491
500
|
}
|
|
@@ -677,5 +686,5 @@ if (typeof window !== "undefined" && import.meta.env?.DEV) {
|
|
|
677
686
|
}
|
|
678
687
|
|
|
679
688
|
export { useFlowStore };
|
|
680
|
-
//# sourceMappingURL=chunk-
|
|
681
|
-
//# sourceMappingURL=chunk-
|
|
689
|
+
//# sourceMappingURL=chunk-47RAP7HT.js.map
|
|
690
|
+
//# sourceMappingURL=chunk-47RAP7HT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/builder/stores/flow-store.ts"],"names":[],"mappings":";;;;;AAkEA,IAAM,aAAA,GAAgB,GAAA;AAItB,IAAM,YAAA,GAAe,EAAA;AASrB,SAAS,WAAc,KAAA,EAAa;AAClC,EAAA,IAAI;AACF,IAAA,OAAO,gBAAgB,KAAK,CAAA;AAAA,EAC9B,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,IAAA,CAAK,KAAA,CAAM,IAAA,CAAK,SAAA,CAAU,KAAK,CAAC,CAAA;AAAA,EACzC;AACF;AA8LA,IAAM,IAAA,GAAc;AAAA,EAClB,EAAE,KAAA,EAAO,WAAA,EAAa,KAAA,EAAO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A,KACG;AACH,UAAA,MAAM,eAGF,EAAC;AACL,UAAA,KAAA,MAAW,OAAO,IAAA,EAAM;AACtB,YAAA,YAAA,CAAa,GAAA,CAAI,MAAM,CAAA,GACrB,GAAA,CAAI,WAAW,WAAA,GACX,SAAA,GACA,GAAA,CAAI,MAAA,KAAW,QAAA,GACb,OAAA,GACA,GAAA,CAAI,MAAA,KAAW,YACb,SAAA,GACA,MAAA;AAAA,UACZ;AACA,UAAA,GAAA,CAAI,OAAO;AAAA,YACT,SAAA,EAAW;AAAA,cACT,GAAG,iBAAA;AAAA,cACH,YAAA,EAAc,KAAA;AAAA,cACd,SAAA,EAAW,QAAA,GACP,EAAE,KAAA,EAAO,GAAG,QAAA,EAAS,GACrB,EAAE,KAAA,EAAO,WAAA,EAAa,EAAA,EAAI,OAAA,EAAS,EAAA,EAAG;AAAA,cAC1C,IAAA;AAAA,cACA,YAAA;AAAA,cACA,aAAA,EAAe;AAAA;AACjB,WACF,CAAE,CAAA;AAAA,QACJ;AAAA;AACF;AACF,GACF;AACF,CAAC;AAID,IAAI,OAAO,MAAA,KAAW,WAAA,IAAe,MAAA,CAAA,IAAA,CAAY,KAAK,GAAA,EAAK;AACzD,EAAC,OAA8C,aAAA,GAAgB,YAAA;AACjE","file":"chunk-47RAP7HT.js","sourcesContent":["import { nanoid } from \"nanoid/non-secure\";\nimport {\n addEdge,\n applyEdgeChanges,\n applyNodeChanges,\n type Connection,\n type Edge,\n type EdgeChange,\n type Node,\n type NodeChange,\n} from \"@xyflow/react\";\nimport { create } from \"zustand\";\nimport { produce } from \"immer\";\nimport type {\n ExtendedNodeType,\n EdgeCondition,\n EdgeMapping,\n} from \"../../types/node\";\nimport type { Tag } from \"../../types/workflow\";\nimport type {\n ExecutionLog,\n ExecutionRunMetadata,\n StepExecutionPlan,\n} from \"../../types/execution\";\n\n// Node execution state for visual display\nexport interface NodeExecutionState {\n status: \"idle\" | \"running\" | \"success\" | \"error\";\n itemCount?: number;\n error?: string;\n}\n\n// Execution state for step execution feature\ninterface ExecutionState {\n isExecuting: boolean;\n executingNodeId: string | null;\n currentRunId: string | null;\n /** Identity of the run whose logs are currently loaded/reusable. */\n sourceRun: ExecutionRunMetadata | null;\n stepPlan: StepExecutionPlan | null;\n logs: ExecutionLog[];\n selectedLogId: string | null;\n panelExpanded: boolean;\n nodeStatuses: Record<string, \"idle\" | \"running\" | \"success\" | \"error\">;\n nodeItemCounts: Record<string, number>;\n}\n\ninterface CustomEdgeProps extends Edge {\n condition?: EdgeCondition;\n mapping?: EdgeMapping;\n}\n\n/** A point-in-time snapshot of canvas structure for undo/redo. */\nexport interface HistorySnapshot {\n nodes: Node[];\n edges: CustomEdgeProps[];\n}\n\n/** Undo/redo stacks for the currently open workflow. */\nexport interface HistoryState {\n past: HistorySnapshot[];\n future: HistorySnapshot[];\n}\n\n/** Bounds how far back undo can go — generous for an editing session without\n * letting the stacks grow unbounded on a long-lived tab. */\nconst HISTORY_LIMIT = 100;\n\n/** Canvas offset applied to duplicated/pasted nodes so clones never land\n * exactly on top of their source (n8n/Figma-style paste offset). */\nconst CLONE_OFFSET = 48;\n\n/**\n * Deep-clone a value for history snapshots / node-and-edge duplication.\n * `structuredClone` is preferred (fast, handles Dates/Maps/etc.), with a\n * JSON round-trip fallback for the rare manifest blob that carries something\n * structuredClone can't handle (e.g. a stray function reference) — dropping\n * that field is safer than throwing and losing the whole undo/copy action.\n */\nfunction cloneValue<T>(value: T): T {\n try {\n return structuredClone(value);\n } catch {\n return JSON.parse(JSON.stringify(value)) as T;\n }\n}\n\ninterface State {\n nodes: Node[];\n edges: CustomEdgeProps[];\n /** Node currently open in the n8n-style 3-pane Node Detail View modal. */\n ndv?: { nodeId: string; type: ExtendedNodeType } | null;\n /** Node currently in inline-rename edit mode (F2 or double-click on its\n * title). Only one node can be renamed at a time. */\n renamingNodeId?: string | null;\n /**\n * Node currently open in the single-click floating quick-config panel\n * (Make-style, attached beside the node). The panel derives its own screen\n * position from the node's live rect, so no anchor is stored here.\n */\n quickConfig?: {\n nodeId: string;\n type: ExtendedNodeType;\n } | null;\n /**\n * Source handle awaiting attachment via the Node Store (the n8n-style \"+\"\n * button on an output handle). While set, clicking an operation in the\n * store panel creates the node and wires it to this handle.\n */\n pendingConnection?: { nodeId: string; handleId: string } | null;\n sidebar: {\n active: \"node-properties\" | \"store-browse\" | \"none\";\n panels: {\n nodeProperties: {\n selectedNode: { id: string; type: ExtendedNodeType } | null | undefined;\n };\n };\n };\n}\n\ninterface Actions {\n actions: {\n saveWorkflow: () => {\n id: string;\n name: string;\n version: string;\n alias?: string;\n dbId?: string;\n status?: string;\n nodes: Node[];\n edges: Edge[];\n };\n setWorkflow: (workflow: Partial<IFlowState[\"workflow\"]>) => void;\n resetWorkflow: () => void;\n history: {\n undo: () => void;\n redo: () => void;\n /** Wipe both stacks — called when a (different) workflow is loaded so\n * undo can never reach back into a previously open workflow. */\n clear: () => void;\n };\n nodes: {\n onNodesChange: (changes: NodeChange[]) => void;\n /** `historyKind` groups rapid same-kind writes (e.g. keystrokes in one\n * field) into a single undo step; `skipHistory` opts a caller out of\n * history entirely (e.g. transient UI-only patches). */\n setNodes: (\n nodes: Node[],\n opts?: { historyKind?: string; skipHistory?: boolean },\n ) => void;\n deleteNode: (node: Node) => void;\n /** Bulk delete (multi-select) — one undo step for the whole selection. */\n deleteNodes: (nodes: Node[]) => void;\n /** Clone the given nodes (+ edges strictly between them) with fresh ids,\n * offset on the canvas, and select only the clones. */\n duplicateNodes: (nodeIds: string[]) => void;\n /** Insert a clipboard payload (possibly from another workflow/tab):\n * fresh ids, offset, selects the pasted nodes. */\n pasteNodes: (payload: { nodes: Node[]; edges: Edge[] }) => void;\n toggleDisabled: (nodeId: string) => void;\n renameNode: (nodeId: string, label: string) => void;\n startRename: (nodeId: string) => void;\n endRename: () => void;\n };\n edges: {\n onEdgesChange: (changes: EdgeChange[]) => void;\n onConnect: (connection: Connection) => void;\n setEdges: (\n edges: Edge[],\n opts?: { historyKind?: string; skipHistory?: boolean },\n ) => void;\n deleteEdge: (edge: Edge) => void;\n };\n ndv: {\n open: (node: { nodeId: string; type: ExtendedNodeType }) => void;\n close: () => void;\n };\n quickConfig: {\n open: (node: { nodeId: string; type: ExtendedNodeType }) => void;\n close: () => void;\n };\n pendingConnection: {\n /** Arm attach mode for a source handle and open the Node Store panel. */\n start: (connection: { nodeId: string; handleId: string }) => void;\n clear: () => void;\n };\n sidebar: {\n setActivePanel: (\n panel: \"node-properties\" | \"store-browse\" | \"none\",\n ) => void;\n showNodePropertiesOf: (node: {\n id: string;\n type: ExtendedNodeType;\n block?: string;\n }) => void;\n panels: {\n nodeProperties: {\n setSelectedNode: (\n node: { id: string; type: ExtendedNodeType } | undefined | null,\n ) => void;\n };\n tags: {\n setTags: (tags: Tag[]) => void;\n createTag: (tag: Tag) => void;\n deleteTag: (tag: Tag) => void;\n updateTag: (tag: Tag, newTag: Tag) => void;\n };\n };\n };\n };\n}\n\nexport interface IFlowState {\n tags: Tag[];\n /** Undo/redo stacks — canvas structure (nodes/edges) AND parameter edits,\n * since both flow through the same `setNodes`/`setEdges` writes. */\n history: HistoryState;\n workflow: {\n id: string;\n workflowKey: string;\n name: string;\n version: string;\n alias?: string;\n /** Database row ID (used for updateWorkflowDefinition) */\n dbId?: string;\n /** Current workflow status: DRAFT | ACTIVE | ARCHIVED | DEPRECATED */\n status?: string;\n /**\n * Pinned/mock output data, keyed by nodeId (BOFF-7511). Mirrors\n * `WorkflowDefinition.pinnedNodeData` — hydrated on load, kept in sync by\n * the NDV's pin/unpin actions so the canvas never shows a stale pin\n * badge after a mutation round-trips.\n */\n pinnedNodeData?: Record<\n string,\n { data: Record<string, unknown>; pinnedAt?: string; pinnedBy?: string }\n >;\n } & State;\n execution: ExecutionState;\n actions: Actions[\"actions\"] & {\n execution: {\n startExecution: (\n nodeId: string,\n runId: string,\n metadata?: Omit<ExecutionRunMetadata, \"runId\">,\n ) => void;\n setRunMetadata: (metadata: ExecutionRunMetadata) => void;\n setStepPlan: (plan: StepExecutionPlan) => void;\n addLog: (log: ExecutionLog) => void;\n updateLog: (logId: string, updates: Partial<ExecutionLog>) => void;\n setNodeStatus: (\n nodeId: string,\n status: \"idle\" | \"running\" | \"success\" | \"error\",\n ) => void;\n setNodeItemCount: (nodeId: string, count: number) => void;\n selectLog: (logId: string | null) => void;\n togglePanel: () => void;\n clearLogs: () => void;\n completeExecution: () => void;\n /**\n * Debug-in-editor (BOFF-7511): load a PAST run's node states onto the\n * canvas as if they'd just executed, without marking anything as\n * \"running\". Each node shows what it actually produced in `runId`, and\n * `currentRunId` becomes that run's id so \"Run from this node\" knows\n * which run to reuse upstream outputs from.\n */\n loadDebugRun: (\n runId: string,\n logs: ExecutionLog[],\n metadata?: Omit<ExecutionRunMetadata, \"runId\">,\n ) => void;\n };\n };\n}\n\nconst TAGS: Tag[] = [\n { value: \"marketing\", label: \"Marketing\", color: \"#ef4444\" },\n { value: \"support\", label: \"Support\", color: \"#ef4444\" },\n { value: \"lead\", label: \"Lead\", color: \"#eab308\" },\n { value: \"new\", label: \"New\", color: \"#22c55e\" },\n];\n\n/**\n * Pristine execution state. The `execution` slice is global (one run at a\n * time), so it MUST be reset whenever a different workflow is loaded —\n * otherwise the previous workflow's run logs leak into the next workflow's\n * Logs panel. Shared by the store initializer and `resetWorkflow`.\n */\nconst INITIAL_EXECUTION: ExecutionState = {\n isExecuting: false,\n executingNodeId: null,\n currentRunId: null,\n sourceRun: null,\n stepPlan: null,\n logs: [],\n selectedLogId: null,\n panelExpanded: false,\n nodeStatuses: {},\n nodeItemCounts: {},\n};\n\nconst INITIAL_HISTORY: HistoryState = { past: [], future: [] };\n\nexport const useFlowStore = create<IFlowState>()((set, get) => {\n // Coalescing bookkeeping for history checkpoints. Plain closure vars (not\n // store state) — they're write-tracking metadata, not something a\n // component should ever render off of.\n let lastCheckpointKind: string | null = null;\n let lastCheckpointAt = 0;\n\n /**\n * Record an undo point BEFORE a mutation is applied.\n *\n * `coalesce: true` merges this call into the immediately preceding one when\n * they share the same `kind` and land within the coalescing window — used\n * for bursty writes (keystrokes in one field, a drag in progress) so undo\n * has one step per logical edit, not one per change event. Structural\n * actions (delete, connect, duplicate, disable, rename, …) always pass\n * `coalesce: false` so each is its own undo step even if done quickly in\n * succession.\n */\n function pushCheckpoint(kind: string, coalesce: boolean) {\n const now = Date.now();\n const isCoalesced =\n coalesce && kind === lastCheckpointKind && now - lastCheckpointAt < 800;\n\n if (!isCoalesced) {\n const state = get();\n const snapshot: HistorySnapshot = {\n nodes: cloneValue(state.workflow.nodes),\n edges: cloneValue(state.workflow.edges),\n };\n set((s) => ({\n history: {\n past: [...s.history.past, snapshot].slice(-HISTORY_LIMIT),\n future: [],\n },\n }));\n } else if (get().history.future.length > 0) {\n // Still invalidate redo on a coalesced edit — the user has diverged\n // from whatever redo state existed.\n set((s) => ({ history: { ...s.history, future: [] } }));\n }\n\n lastCheckpointKind = kind;\n lastCheckpointAt = now;\n }\n\n /**\n * Deleting a node makes React Flow report TWO removals back to back: the\n * node through `onNodesChange`, then every connection attached to it through\n * `onEdgesChange`. They are one user action, so the second must not push its\n * own checkpoint — otherwise one delete costs two Undo presses, and the first\n * press only brings back the connection, which cannot draw without its node\n * and so looks like Undo did nothing.\n */\n const REMOVAL_KINDS = new Set([\"nodes:remove\", \"edges:remove\"]);\n const SAME_ACTION_WINDOW_MS = 150;\n function joinsPrecedingRemoval(kind: string): boolean {\n return (\n lastCheckpointKind !== null &&\n lastCheckpointKind !== kind &&\n REMOVAL_KINDS.has(kind) &&\n REMOVAL_KINDS.has(lastCheckpointKind) &&\n Date.now() - lastCheckpointAt < SAME_ACTION_WINDOW_MS\n );\n }\n\n /** Reset coalescing so the next edit always starts a fresh checkpoint. */\n function resetCoalescing() {\n lastCheckpointKind = null;\n lastCheckpointAt = 0;\n }\n\n return {\n tags: TAGS,\n history: { ...INITIAL_HISTORY },\n workflow: {\n id: nanoid(),\n workflowKey: \"\",\n name: \"\",\n version: \"\",\n alias: \"\",\n edges: [],\n nodes: [],\n ndv: null,\n quickConfig: null,\n pendingConnection: null,\n renamingNodeId: null,\n sidebar: {\n active: \"none\",\n panels: {\n nodeProperties: {\n selectedNode: null,\n },\n },\n },\n },\n execution: { ...INITIAL_EXECUTION },\n actions: {\n saveWorkflow: () => {\n const { workflow } = get();\n const { id, name, version, alias, dbId, status, nodes, edges } =\n workflow;\n set({ workflow });\n return { id, name, version, alias, dbId, status, nodes, edges };\n },\n setWorkflow: (workflow: Partial<IFlowState[\"workflow\"]>) => {\n set((state) => ({\n workflow: {\n ...state.workflow,\n ...workflow,\n },\n }));\n },\n resetWorkflow: () => {\n resetCoalescing();\n set(() => ({\n workflow: {\n id: nanoid(),\n workflowKey: \"\",\n name: \"\",\n version: \"\",\n alias: \"\",\n dbId: undefined,\n status: undefined,\n edges: [],\n nodes: [],\n ndv: null,\n quickConfig: null,\n pendingConnection: null,\n renamingNodeId: null,\n sidebar: {\n active: \"none\",\n panels: {\n nodeProperties: {\n selectedNode: null,\n },\n },\n },\n },\n // Wipe run state too — resetWorkflow fires when the builder loads a\n // (different) workflow, so the previous workflow's logs must not carry\n // over into this one's Logs panel.\n execution: { ...INITIAL_EXECUTION },\n // A freshly loaded workflow must not be undo-able back to empty —\n // undo/redo only ever applies within the currently open workflow.\n history: { ...INITIAL_HISTORY },\n }));\n },\n history: {\n undo: () => {\n const { past, future } = get().history;\n const previous = past[past.length - 1];\n if (!previous) return;\n const { nodes, edges } = get().workflow;\n const current: HistorySnapshot = {\n nodes: cloneValue(nodes),\n edges: cloneValue(edges),\n };\n resetCoalescing();\n set((s) => ({\n workflow: {\n ...s.workflow,\n nodes: previous.nodes,\n edges: previous.edges,\n },\n history: {\n past: past.slice(0, -1),\n future: [current, ...future].slice(0, HISTORY_LIMIT),\n },\n }));\n },\n redo: () => {\n const { past, future } = get().history;\n const next = future[0];\n if (!next) return;\n const { nodes, edges } = get().workflow;\n const current: HistorySnapshot = {\n nodes: cloneValue(nodes),\n edges: cloneValue(edges),\n };\n resetCoalescing();\n set((s) => ({\n workflow: {\n ...s.workflow,\n nodes: next.nodes,\n edges: next.edges,\n },\n history: {\n past: [...past, current].slice(-HISTORY_LIMIT),\n future: future.slice(1),\n },\n }));\n },\n clear: () => {\n resetCoalescing();\n set({ history: { ...INITIAL_HISTORY } });\n },\n },\n ndv: {\n // Opening the full NDV supersedes the floating quick-config panel — the\n // two edit the same node data, so only one should be visible at a time.\n open: (node: { nodeId: string; type: ExtendedNodeType }) =>\n set((state) => ({\n workflow: { ...state.workflow, ndv: node, quickConfig: null },\n })),\n close: () =>\n set((state) => ({\n workflow: { ...state.workflow, ndv: null },\n })),\n },\n quickConfig: {\n open: (node: { nodeId: string; type: ExtendedNodeType }) =>\n set((state) => ({\n workflow: { ...state.workflow, quickConfig: node },\n })),\n close: () =>\n set((state) => ({\n workflow: { ...state.workflow, quickConfig: null },\n })),\n },\n pendingConnection: {\n start: (connection: { nodeId: string; handleId: string }) =>\n set((state) => ({\n workflow: {\n ...state.workflow,\n pendingConnection: connection,\n sidebar: { ...state.workflow.sidebar, active: \"store-browse\" },\n },\n })),\n clear: () =>\n set((state) => ({\n workflow: { ...state.workflow, pendingConnection: null },\n })),\n },\n sidebar: {\n // Leaving the store panel abandons any armed \"+\" attach mode — the\n // pending handle would otherwise silently capture a later insert.\n setActivePanel: (panel: \"node-properties\" | \"store-browse\" | \"none\") =>\n set((state) => ({\n workflow: {\n ...state.workflow,\n sidebar: { ...state.workflow.sidebar, active: panel },\n ...(panel !== \"store-browse\" ? { pendingConnection: null } : {}),\n },\n })),\n showNodePropertiesOf: (node: {\n id: string;\n type: ExtendedNodeType;\n }) => {\n set((state) => ({\n workflow: {\n ...state.workflow,\n pendingConnection: null,\n sidebar: {\n ...state.workflow.sidebar,\n active: \"node-properties\",\n panels: {\n ...state.workflow.sidebar.panels,\n nodeProperties: {\n ...state.workflow.sidebar.panels.nodeProperties,\n selectedNode: node,\n },\n },\n },\n },\n }));\n },\n panels: {\n nodeProperties: {\n setSelectedNode: (\n node: { id: string; type: ExtendedNodeType } | undefined | null,\n ) =>\n set((state) => ({\n workflow: {\n ...state.workflow,\n sidebar: {\n ...state.workflow.sidebar,\n panels: {\n ...state.workflow.sidebar.panels,\n nodeProperties: {\n ...state.workflow.sidebar.panels.nodeProperties,\n selectedNode: node,\n },\n },\n },\n },\n })),\n },\n tags: {\n setTags: (tags: Tag[]) => set({ tags }),\n createTag: (tag: Tag) =>\n set((state) => ({\n tags: [...state.tags, tag],\n })),\n updateTag: (tag: Tag, newTag: Tag) =>\n set((state) => ({\n tags: state.tags.map((f) =>\n f.value === tag.value ? newTag : f,\n ),\n })),\n deleteTag: (tag: Tag) =>\n set((state) => ({\n tags: state.tags.filter((f) => f.value !== tag.value),\n })),\n },\n },\n },\n nodes: {\n onNodesChange: (changes) => {\n const removedIds = new Set(\n changes\n .filter(\n (c): c is Extract<NodeChange, { type: \"remove\" }> =>\n c.type === \"remove\",\n )\n .map((c) => c.id),\n );\n const addedCount = changes.filter((c) => c.type === \"add\").length;\n\n if (removedIds.size > 0) {\n const stillPresent = get().workflow.nodes.some((n) =>\n removedIds.has(n.id),\n );\n if (stillPresent && !joinsPrecedingRemoval(\"nodes:remove\")) {\n pushCheckpoint(\"nodes:remove\", false);\n }\n } else if (addedCount > 0) {\n // A node landed on the canvas via React Flow's own imperative\n // `addNodes()` (drag-from-palette drop, Node Store click-insert,\n // sticky note insert — see useInsertNode / useInsertStickyNote)\n // rather than through our `setNodes` action, so it would\n // otherwise never reach the history stack and Undo would stay\n // disabled after adding a node.\n pushCheckpoint(\"nodes:add\", false);\n } else {\n const finishedDragIds = changes.filter(\n (c): c is Extract<NodeChange, { type: \"position\" }> =>\n c.type === \"position\" && c.dragging === false,\n );\n const actuallyMoved = finishedDragIds.some((c) => {\n const current = get().workflow.nodes.find((n) => n.id === c.id);\n return (\n current &&\n c.position &&\n (current.position.x !== c.position.x ||\n current.position.y !== c.position.y)\n );\n });\n if (actuallyMoved) pushCheckpoint(\"nodes:move\", false);\n }\n\n set((state) =>\n produce(state, (draft) => {\n const updatedNodes = applyNodeChanges(\n changes,\n draft.workflow.nodes,\n );\n draft.workflow.nodes = updatedNodes;\n }),\n );\n },\n setNodes: (nodes, opts) => {\n if (!opts?.skipHistory) {\n pushCheckpoint(\n opts?.historyKind ?? \"nodes:set\",\n !!opts?.historyKind,\n );\n }\n set({ workflow: { ...get().workflow, nodes } });\n },\n deleteNode: (node: Node) => {\n const exists = get().workflow.nodes.some((n) => n.id === node.id);\n if (exists) pushCheckpoint(\"nodes:delete\", false);\n set((state) => ({\n workflow: {\n ...state.workflow,\n nodes: state.workflow.nodes.filter((n) => n.id !== node.id),\n // Drop any UI state pointing at the removed node.\n ...(state.workflow.quickConfig?.nodeId === node.id\n ? { quickConfig: null }\n : {}),\n ...(state.workflow.pendingConnection?.nodeId === node.id\n ? { pendingConnection: null }\n : {}),\n },\n }));\n },\n deleteNodes: (nodes: Node[]) => {\n const ids = new Set(nodes.map((n) => n.id));\n if (ids.size === 0) return;\n const anyExist = get().workflow.nodes.some((n) => ids.has(n.id));\n if (anyExist) pushCheckpoint(\"nodes:delete\", false);\n set((state) => ({\n workflow: {\n ...state.workflow,\n nodes: state.workflow.nodes.filter((n) => !ids.has(n.id)),\n edges: state.workflow.edges.filter(\n (e) => !ids.has(e.source) && !ids.has(e.target),\n ),\n ...(state.workflow.quickConfig &&\n ids.has(state.workflow.quickConfig.nodeId)\n ? { quickConfig: null }\n : {}),\n ...(state.workflow.pendingConnection &&\n ids.has(state.workflow.pendingConnection.nodeId)\n ? { pendingConnection: null }\n : {}),\n },\n }));\n },\n duplicateNodes: (nodeIds: string[]) => {\n const { nodes, edges } = get().workflow;\n const idSet = new Set(nodeIds);\n const selected = nodes.filter((n) => idSet.has(n.id));\n if (selected.length === 0) return;\n pushCheckpoint(\"nodes:duplicate\", false);\n\n const idMap = new Map<string, string>();\n const clones = selected.map((n) => {\n const newId = nanoid();\n idMap.set(n.id, newId);\n const cloned = cloneValue(n);\n return {\n ...cloned,\n id: newId,\n position: {\n x: cloned.position.x + CLONE_OFFSET,\n y: cloned.position.y + CLONE_OFFSET,\n },\n selected: true,\n };\n });\n // Only edges strictly BETWEEN two duplicated nodes come along —\n // an edge to a non-duplicated neighbor would otherwise silently\n // rewire the original graph.\n const clonedEdges = edges\n .filter((e) => idMap.has(e.source) && idMap.has(e.target))\n .map((e) => {\n const cloned = cloneValue(e);\n return {\n ...cloned,\n id: nanoid(),\n source: idMap.get(e.source) as string,\n target: idMap.get(e.target) as string,\n selected: false,\n };\n });\n\n set((state) => ({\n workflow: {\n ...state.workflow,\n nodes: [\n ...state.workflow.nodes.map((n) =>\n idSet.has(n.id) ? { ...n, selected: false } : n,\n ),\n ...clones,\n ],\n edges: [...state.workflow.edges, ...clonedEdges],\n },\n }));\n },\n pasteNodes: (payload: { nodes: Node[]; edges: Edge[] }) => {\n const pasteNodesIn = payload.nodes ?? [];\n if (pasteNodesIn.length === 0) return;\n pushCheckpoint(\"nodes:paste\", false);\n\n const idMap = new Map<string, string>();\n const clones = pasteNodesIn.map((n) => {\n const newId = nanoid();\n idMap.set(n.id, newId);\n const cloned = cloneValue(n);\n return {\n ...cloned,\n id: newId,\n position: {\n x: (cloned.position?.x ?? 0) + CLONE_OFFSET,\n y: (cloned.position?.y ?? 0) + CLONE_OFFSET,\n },\n selected: true,\n };\n });\n const clonedEdges = (payload.edges ?? [])\n .filter((e) => idMap.has(e.source) && idMap.has(e.target))\n .map((e) => {\n const cloned = cloneValue(e);\n return {\n ...cloned,\n id: nanoid(),\n source: idMap.get(e.source) as string,\n target: idMap.get(e.target) as string,\n selected: false,\n };\n });\n\n set((state) => ({\n workflow: {\n ...state.workflow,\n nodes: [\n ...state.workflow.nodes.map((n) => ({ ...n, selected: false })),\n ...clones,\n ],\n edges: [...state.workflow.edges, ...clonedEdges],\n },\n }));\n },\n toggleDisabled: (nodeId: string) => {\n pushCheckpoint(\"nodes:disable\", false);\n set((state) => ({\n workflow: {\n ...state.workflow,\n nodes: state.workflow.nodes.map((n) => {\n if (n.id !== nodeId) return n;\n const data = (n.data ?? {}) as Record<string, unknown>;\n return {\n ...n,\n data: { ...data, disabled: !(data.disabled === true) },\n };\n }),\n },\n }));\n },\n renameNode: (nodeId: string, label: string) => {\n pushCheckpoint(\"nodes:rename\", false);\n set((state) => ({\n workflow: {\n ...state.workflow,\n nodes: state.workflow.nodes.map((n) =>\n n.id === nodeId\n ? { ...n, data: { ...(n.data ?? {}), label } }\n : n,\n ),\n renamingNodeId: null,\n },\n }));\n },\n startRename: (nodeId: string) => {\n set((state) => ({\n workflow: { ...state.workflow, renamingNodeId: nodeId },\n }));\n },\n endRename: () => {\n set((state) => ({\n workflow: { ...state.workflow, renamingNodeId: null },\n }));\n },\n },\n edges: {\n onEdgesChange: (changes) => {\n const removedIds = new Set(\n changes\n .filter(\n (c): c is Extract<EdgeChange, { type: \"remove\" }> =>\n c.type === \"remove\",\n )\n .map((c) => c.id),\n );\n if (removedIds.size > 0) {\n const stillPresent = get().workflow.edges.some((e) =>\n removedIds.has(e.id),\n );\n if (stillPresent && !joinsPrecedingRemoval(\"edges:remove\")) {\n pushCheckpoint(\"edges:remove\", false);\n }\n } else if (changes.some((c) => c.type === \"add\")) {\n // Same gap as onNodesChange's \"add\" case: an edge created via\n // React Flow's imperative `addEdges()` (e.g. drag a connection\n // off a handle onto empty canvas, then pick a node from the\n // floating menu — useAddNodeOnEdgeDrop) must still be undoable.\n pushCheckpoint(\"edges:add\", false);\n }\n\n set((state) =>\n produce(state, (draft) => {\n const updatedEdges = applyEdgeChanges(\n changes,\n draft.workflow.edges,\n );\n draft.workflow.edges = updatedEdges;\n }),\n );\n },\n onConnect: (connection) => {\n pushCheckpoint(\"edges:connect\", false);\n const edge = {\n ...connection,\n id: nanoid(),\n type: \"deletable\",\n } as Edge;\n set({\n workflow: {\n ...get().workflow,\n edges: addEdge(edge, get().workflow.edges),\n },\n });\n },\n setEdges: (edges, opts) => {\n if (!opts?.skipHistory) {\n pushCheckpoint(\n opts?.historyKind ?? \"edges:set\",\n !!opts?.historyKind,\n );\n }\n set({ workflow: { ...get().workflow, edges } });\n },\n deleteEdge: (edge: Edge) => {\n const exists = get().workflow.edges.some((e) => e.id === edge.id);\n if (exists) pushCheckpoint(\"edges:delete\", false);\n set((state) => ({\n workflow: {\n ...state.workflow,\n edges: state.workflow.edges.filter((e) => e.id !== edge.id),\n },\n }));\n },\n },\n execution: {\n startExecution: (\n nodeId: string,\n runId: string,\n metadata?: Omit<ExecutionRunMetadata, \"runId\">,\n ) => {\n set((state) => ({\n execution: {\n ...state.execution,\n isExecuting: true,\n executingNodeId: nodeId,\n currentRunId: runId,\n sourceRun: metadata\n ? { runId, ...metadata }\n : { runId, workflowKey: \"\", version: \"\" },\n panelExpanded: true,\n nodeStatuses: {\n ...state.execution.nodeStatuses,\n [nodeId]: \"running\",\n },\n },\n }));\n },\n setRunMetadata: (metadata: ExecutionRunMetadata) => {\n set((state) => {\n if (\n state.execution.currentRunId !== metadata.runId &&\n state.execution.sourceRun?.runId !== metadata.runId\n ) {\n return state;\n }\n return {\n execution: {\n ...state.execution,\n currentRunId: metadata.runId,\n sourceRun: metadata,\n },\n };\n });\n },\n setStepPlan: (plan: StepExecutionPlan) => {\n set((state) => ({\n execution: {\n ...state.execution,\n stepPlan: plan,\n },\n }));\n },\n addLog: (log: ExecutionLog) => {\n set((state) => ({\n execution: {\n ...state.execution,\n logs: [...state.execution.logs, log],\n selectedLogId: log.id,\n },\n }));\n },\n updateLog: (logId: string, updates: Partial<ExecutionLog>) => {\n set((state) => ({\n execution: {\n ...state.execution,\n logs: state.execution.logs.map((log) =>\n log.id === logId ? { ...log, ...updates } : log,\n ),\n },\n }));\n },\n setNodeStatus: (\n nodeId: string,\n status: \"idle\" | \"running\" | \"success\" | \"error\",\n ) => {\n set((state) => ({\n execution: {\n ...state.execution,\n nodeStatuses: {\n ...state.execution.nodeStatuses,\n [nodeId]: status,\n },\n },\n }));\n },\n setNodeItemCount: (nodeId: string, count: number) => {\n set((state) => ({\n execution: {\n ...state.execution,\n nodeItemCounts: {\n ...state.execution.nodeItemCounts,\n [nodeId]: count,\n },\n },\n }));\n },\n selectLog: (logId: string | null) => {\n set((state) => ({\n execution: {\n ...state.execution,\n selectedLogId: logId,\n },\n }));\n },\n togglePanel: () => {\n set((state) => ({\n execution: {\n ...state.execution,\n panelExpanded: !state.execution.panelExpanded,\n },\n }));\n },\n clearLogs: () => {\n set((state) => ({\n execution: {\n ...state.execution,\n logs: [],\n stepPlan: null,\n currentRunId: null,\n sourceRun: null,\n selectedLogId: null,\n nodeStatuses: {},\n nodeItemCounts: {},\n },\n }));\n },\n completeExecution: () => {\n set((state) => ({\n execution: {\n ...state.execution,\n isExecuting: false,\n executingNodeId: null,\n },\n }));\n },\n loadDebugRun: (\n runId: string,\n logs: ExecutionLog[],\n metadata?: Omit<ExecutionRunMetadata, \"runId\">,\n ) => {\n const nodeStatuses: Record<\n string,\n \"idle\" | \"running\" | \"success\" | \"error\"\n > = {};\n for (const log of logs) {\n nodeStatuses[log.nodeId] =\n log.status === \"completed\"\n ? \"success\"\n : log.status === \"failed\"\n ? \"error\"\n : log.status === \"running\"\n ? \"running\"\n : \"idle\";\n }\n set(() => ({\n execution: {\n ...INITIAL_EXECUTION,\n currentRunId: runId,\n sourceRun: metadata\n ? { runId, ...metadata }\n : { runId, workflowKey: \"\", version: \"\" },\n logs,\n nodeStatuses,\n panelExpanded: true,\n },\n }));\n },\n },\n },\n };\n});\n\n// Dev-only debug handle so the store can be inspected/driven from the browser\n// console or automated tests. No-op in production builds.\nif (typeof window !== \"undefined\" && import.meta.env?.DEV) {\n (window as unknown as Record<string, unknown>).__fgFlowStore = useFlowStore;\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import { NEW_WORKFLOW_NAV } from './chunk-KGD6CRSA.js';
|
|
|
2
2
|
import { QuotaExhaustedDialog } from './chunk-AANIWER2.js';
|
|
3
3
|
import { SdkPermissionButton, FLUIDGRIDS_PERMISSIONS, SdkPermissionGate } from './chunk-W23ZXNKU.js';
|
|
4
4
|
import { useWorkflowDefinitions, useLazyWorkflowDefinition, useImportWorkflow, useDuplicateWorkflow, useDeleteWorkflow } from './chunk-XBIHI224.js';
|
|
5
|
-
import { useFlowStore } from './chunk-
|
|
5
|
+
import { useFlowStore } from './chunk-47RAP7HT.js';
|
|
6
6
|
import { useTr } from './chunk-7YWBH2A5.js';
|
|
7
7
|
import { useState, useMemo } from 'react';
|
|
8
8
|
import { useNavigate } from 'react-router';
|
|
@@ -1251,5 +1251,5 @@ function WorkflowsList() {
|
|
|
1251
1251
|
}
|
|
1252
1252
|
|
|
1253
1253
|
export { WorkflowsList };
|
|
1254
|
-
//# sourceMappingURL=chunk-
|
|
1255
|
-
//# sourceMappingURL=chunk-
|
|
1254
|
+
//# sourceMappingURL=chunk-HK7IRZLW.js.map
|
|
1255
|
+
//# sourceMappingURL=chunk-HK7IRZLW.js.map
|