@burdenoff/fluidgrids-fe-sdk 2026.1008.2 → 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/ExecutionDetailPage-JB5UYJMF.js +12 -0
- package/dist/{ExecutionDetailPage-HPAU7U3E.js.map → ExecutionDetailPage-JB5UYJMF.js.map} +1 -1
- package/dist/ExecutionsListPage-RDGTW6UF.js +11 -0
- package/dist/{ExecutionsListPage-TLXVEIRK.js.map → ExecutionsListPage-RDGTW6UF.js.map} +1 -1
- package/dist/{WorkflowBuilder-YJLWNBT3.js → WorkflowBuilder-AQSWNBKH.js} +7 -7
- package/dist/{WorkflowBuilder-YJLWNBT3.js.map → WorkflowBuilder-AQSWNBKH.js.map} +1 -1
- package/dist/WorkflowsList-CE2CRD7W.js +14 -0
- package/dist/{WorkflowsList-YSZWXFMZ.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-LVKUOMLJ.js → chunk-CZ7APZ5B.js} +5 -5
- package/dist/{chunk-LVKUOMLJ.js.map → chunk-CZ7APZ5B.js.map} +1 -1
- package/dist/{chunk-F2BBRTLB.js → chunk-DFGJKGWH.js} +6 -4
- package/dist/chunk-DFGJKGWH.js.map +1 -0
- package/dist/{chunk-NG32SZ75.js → chunk-FA7S7YMY.js} +3 -3
- package/dist/{chunk-NG32SZ75.js.map → chunk-FA7S7YMY.js.map} +1 -1
- package/dist/{chunk-WYQ4OBES.js → chunk-HK7IRZLW.js} +4 -4
- package/dist/{chunk-WYQ4OBES.js.map → chunk-HK7IRZLW.js.map} +1 -1
- package/dist/{chunk-IOV4YPQU.js → chunk-M2YFTRLL.js} +4 -4
- package/dist/{chunk-IOV4YPQU.js.map → chunk-M2YFTRLL.js.map} +1 -1
- package/dist/{chunk-W7APOU2R.js → chunk-OJ3AVTEY.js} +64 -9
- package/dist/chunk-OJ3AVTEY.js.map +1 -0
- package/dist/{chunk-WKALLY4E.js → chunk-PAZHTUZ4.js} +4 -4
- package/dist/{chunk-WKALLY4E.js.map → chunk-PAZHTUZ4.js.map} +1 -1
- package/dist/{chunk-I2766GDR.js → chunk-PKWVMJFF.js} +11 -5
- package/dist/chunk-PKWVMJFF.js.map +1 -0
- 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-W73HBP7B.js → chunk-UQYGUZEP.js} +6 -6
- package/dist/{chunk-W73HBP7B.js.map → chunk-UQYGUZEP.js.map} +1 -1
- package/dist/{chunk-2C6CUHM3.js → chunk-XBIHI224.js} +3 -3
- package/dist/{chunk-2C6CUHM3.js.map → chunk-XBIHI224.js.map} +1 -1
- package/dist/{chunk-KIJDG6MG.js → chunk-Z5HU6MUG.js} +4 -4
- package/dist/{chunk-KIJDG6MG.js.map → chunk-Z5HU6MUG.js.map} +1 -1
- package/dist/config-SCVEDF5V.js +3 -0
- package/dist/{config-YHUOLDAL.js.map → config-SCVEDF5V.js.map} +1 -1
- package/dist/executions.js +5 -5
- package/dist/history.js +3 -3
- package/dist/index.d.ts +16 -5
- package/dist/index.js +25 -20
- package/dist/index.js.map +1 -1
- package/dist/settings.js +2 -2
- package/dist/templates.js +5 -5
- package/dist/{workflow-builder-CpdCzzst.d.ts → workflow-builder-DvbjeuIN.d.ts} +5 -1
- package/dist/workflow-builder.d.ts +1 -1
- package/dist/workflow-builder.js +6 -6
- package/dist/workflows-list.js +4 -4
- package/package.json +1 -1
- package/dist/ExecutionDetailPage-HPAU7U3E.js +0 -12
- package/dist/ExecutionsListPage-TLXVEIRK.js +0 -11
- package/dist/WorkflowsList-YSZWXFMZ.js +0 -14
- package/dist/chunk-3B5YEXSW.js.map +0 -1
- package/dist/chunk-F2BBRTLB.js.map +0 -1
- package/dist/chunk-I2766GDR.js.map +0 -1
- package/dist/chunk-W7APOU2R.js.map +0 -1
- package/dist/config-YHUOLDAL.js +0 -3
package/dist/settings.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { SettingsPage } from './chunk-
|
|
1
|
+
export { SettingsPage } from './chunk-T3ZCEAHR.js';
|
|
2
2
|
import './chunk-WNFZXH3Z.js';
|
|
3
3
|
import './chunk-NK32XOQN.js';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-47RAP7HT.js';
|
|
5
5
|
import './chunk-3P4YQ7DO.js';
|
|
6
6
|
import './chunk-LMO5ASOE.js';
|
|
7
7
|
import './chunk-7YWBH2A5.js';
|
package/dist/templates.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { TemplatePreview, TemplatesPage } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { TemplatePreview, TemplatesPage } from './chunk-PAZHTUZ4.js';
|
|
2
|
+
import './chunk-OJ3AVTEY.js';
|
|
3
3
|
import './chunk-XQP33UJR.js';
|
|
4
4
|
import './chunk-P5PKRQAO.js';
|
|
5
5
|
import './chunk-NH5YCY37.js';
|
|
@@ -9,9 +9,9 @@ import './chunk-6LXMUIR3.js';
|
|
|
9
9
|
import './chunk-AANIWER2.js';
|
|
10
10
|
import './chunk-W23ZXNKU.js';
|
|
11
11
|
import './chunk-3ZYUGTIT.js';
|
|
12
|
-
import './chunk-
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-
|
|
12
|
+
import './chunk-XBIHI224.js';
|
|
13
|
+
import './chunk-DFGJKGWH.js';
|
|
14
|
+
import './chunk-47RAP7HT.js';
|
|
15
15
|
import './chunk-3P4YQ7DO.js';
|
|
16
16
|
import './chunk-LMO5ASOE.js';
|
|
17
17
|
import './chunk-7YWBH2A5.js';
|
|
@@ -389,6 +389,10 @@ interface WorkflowBuilderProps extends Omit<WorkflowBuilderCoreProps, "workflow"
|
|
|
389
389
|
authToken?: string;
|
|
390
390
|
/** Current workspace ID */
|
|
391
391
|
workspaceId: string;
|
|
392
|
+
/** Product namespace, actor identity and workspace authentication. */
|
|
393
|
+
productId?: string;
|
|
394
|
+
userId?: string;
|
|
395
|
+
workspaceToken?: string;
|
|
392
396
|
/** Current tenant ID */
|
|
393
397
|
tenantId?: string;
|
|
394
398
|
/** Organization ID */
|
|
@@ -436,7 +440,7 @@ interface WorkflowBuilderProps extends Omit<WorkflowBuilderCoreProps, "workflow"
|
|
|
436
440
|
* />
|
|
437
441
|
* ```
|
|
438
442
|
*/
|
|
439
|
-
declare function WorkflowBuilder$1({ workflowId, workflowVersion, initialWorkflow, apiGatewayUrl, globalApiUrl, authToken, workspaceId, tenantId, organizationId, workspaceClient, globalClient, ...coreProps }: WorkflowBuilderProps): react_jsx_runtime.JSX.Element;
|
|
443
|
+
declare function WorkflowBuilder$1({ workflowId, workflowVersion, initialWorkflow, apiGatewayUrl, globalApiUrl, authToken, workspaceId, tenantId, productId, userId, workspaceToken, organizationId, workspaceClient, globalClient, ...coreProps }: WorkflowBuilderProps): react_jsx_runtime.JSX.Element;
|
|
440
444
|
|
|
441
445
|
/**
|
|
442
446
|
* WorkflowBuilder page with ErrorBoundary for graceful crash recovery.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { I as IFlowState, W as WorkflowBuilder, o as WorkflowBuilderCore, p as WorkflowBuilderCoreProps, n as WorkflowBuilderPage, q as WorkflowBuilderProps, w as WorkflowSearchRedirect, x as refetchStoreNodes, y as useFlowStore } from './workflow-builder-
|
|
1
|
+
export { I as IFlowState, W as WorkflowBuilder, o as WorkflowBuilderCore, p as WorkflowBuilderCoreProps, n as WorkflowBuilderPage, q as WorkflowBuilderProps, w as WorkflowSearchRedirect, x as refetchStoreNodes, y as useFlowStore } from './workflow-builder-DvbjeuIN.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import '@apollo/client/core';
|
|
4
4
|
import '@xyflow/react';
|
package/dist/workflow-builder.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { WorkflowBuilder, WorkflowBuilderCore, WorkflowSearchRedirect } from './chunk-
|
|
2
|
-
export { WorkflowBuilder as WorkflowBuilderPage } from './chunk-
|
|
1
|
+
export { WorkflowBuilder, WorkflowBuilderCore, WorkflowSearchRedirect } from './chunk-PKWVMJFF.js';
|
|
2
|
+
export { WorkflowBuilder as WorkflowBuilderPage } from './chunk-UQYGUZEP.js';
|
|
3
3
|
import './chunk-KGD6CRSA.js';
|
|
4
|
-
export { refetchStoreNodes } from './chunk-
|
|
4
|
+
export { refetchStoreNodes } from './chunk-OJ3AVTEY.js';
|
|
5
5
|
import './chunk-XQP33UJR.js';
|
|
6
6
|
import './chunk-P5PKRQAO.js';
|
|
7
7
|
import './chunk-NH5YCY37.js';
|
|
@@ -11,9 +11,9 @@ import './chunk-6LXMUIR3.js';
|
|
|
11
11
|
import './chunk-AANIWER2.js';
|
|
12
12
|
import './chunk-W23ZXNKU.js';
|
|
13
13
|
import './chunk-3ZYUGTIT.js';
|
|
14
|
-
import './chunk-
|
|
15
|
-
import './chunk-
|
|
16
|
-
export { useFlowStore } from './chunk-
|
|
14
|
+
import './chunk-XBIHI224.js';
|
|
15
|
+
import './chunk-DFGJKGWH.js';
|
|
16
|
+
export { useFlowStore } from './chunk-47RAP7HT.js';
|
|
17
17
|
import './chunk-3P4YQ7DO.js';
|
|
18
18
|
import './chunk-LMO5ASOE.js';
|
|
19
19
|
import './chunk-7YWBH2A5.js';
|
package/dist/workflows-list.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
6
|
+
import './chunk-XBIHI224.js';
|
|
7
|
+
import './chunk-DFGJKGWH.js';
|
|
8
|
+
import './chunk-47RAP7HT.js';
|
|
9
9
|
import './chunk-3P4YQ7DO.js';
|
|
10
10
|
import './chunk-LMO5ASOE.js';
|
|
11
11
|
import './chunk-7YWBH2A5.js';
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { ExecutionDetailPage } from './chunk-KIJDG6MG.js';
|
|
2
|
-
import './chunk-NG32SZ75.js';
|
|
3
|
-
import './chunk-NK32XOQN.js';
|
|
4
|
-
import './chunk-W23ZXNKU.js';
|
|
5
|
-
import './chunk-3ZYUGTIT.js';
|
|
6
|
-
import './chunk-F2BBRTLB.js';
|
|
7
|
-
import './chunk-3P4YQ7DO.js';
|
|
8
|
-
import './chunk-LMO5ASOE.js';
|
|
9
|
-
import './chunk-7YWBH2A5.js';
|
|
10
|
-
import './chunk-ZBMMEE5U.js';
|
|
11
|
-
//# sourceMappingURL=ExecutionDetailPage-HPAU7U3E.js.map
|
|
12
|
-
//# sourceMappingURL=ExecutionDetailPage-HPAU7U3E.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { ExecutionsListPage } from './chunk-LVKUOMLJ.js';
|
|
2
|
-
import './chunk-NG32SZ75.js';
|
|
3
|
-
import './chunk-NK32XOQN.js';
|
|
4
|
-
import './chunk-2C6CUHM3.js';
|
|
5
|
-
import './chunk-F2BBRTLB.js';
|
|
6
|
-
import './chunk-3P4YQ7DO.js';
|
|
7
|
-
import './chunk-LMO5ASOE.js';
|
|
8
|
-
import './chunk-7YWBH2A5.js';
|
|
9
|
-
import './chunk-ZBMMEE5U.js';
|
|
10
|
-
//# sourceMappingURL=ExecutionsListPage-TLXVEIRK.js.map
|
|
11
|
-
//# sourceMappingURL=ExecutionsListPage-TLXVEIRK.js.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export { WorkflowsList } from './chunk-WYQ4OBES.js';
|
|
2
|
-
import './chunk-KGD6CRSA.js';
|
|
3
|
-
import './chunk-AANIWER2.js';
|
|
4
|
-
import './chunk-W23ZXNKU.js';
|
|
5
|
-
import './chunk-3ZYUGTIT.js';
|
|
6
|
-
import './chunk-2C6CUHM3.js';
|
|
7
|
-
import './chunk-F2BBRTLB.js';
|
|
8
|
-
import './chunk-3B5YEXSW.js';
|
|
9
|
-
import './chunk-3P4YQ7DO.js';
|
|
10
|
-
import './chunk-LMO5ASOE.js';
|
|
11
|
-
import './chunk-7YWBH2A5.js';
|
|
12
|
-
import './chunk-ZBMMEE5U.js';
|
|
13
|
-
//# sourceMappingURL=WorkflowsList-YSZWXFMZ.js.map
|
|
14
|
-
//# sourceMappingURL=WorkflowsList-YSZWXFMZ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,WAAA,EAAa,OAAO,SAAA,EAAU;AAAA,EAC3D,EAAE,KAAA,EAAO,SAAA,EAAW,KAAA,EAAO,SAAA,EAAW,OAAO,SAAA,EAAU;AAAA,EACvD,EAAE,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,MAAA,EAAQ,OAAO,SAAA,EAAU;AAAA,EACjD,EAAE,KAAA,EAAO,KAAA,EAAO,KAAA,EAAO,KAAA,EAAO,OAAO,SAAA;AACvC,CAAA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E","file":"chunk-3B5YEXSW.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 /** 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) pushCheckpoint(\"nodes:remove\", false);\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) pushCheckpoint(\"edges:remove\", false);\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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/modules/executions/store/executionsStore.ts","../src/config/index.ts"],"names":[],"mappings":";;AA8EA,IAAM,aAAA,GAAkC;AAAA,EACtC,MAAA,EAAQ,KAAA;AAAA,EACR,WAAA,EAAa,EAAA;AAAA,EACb,SAAA,EAAW;AAAA,IACT,KAAA,EAAO,IAAA;A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A,MAAM,GAAA,GAAM,WAAW,aAAA,CAAc,aAAA;AACrC,EAAA,IAAI,CAAC,GAAA,EAAK;AACR,IAAA,MAAM,IAAI,MAAM,wDAAwD,CAAA;AAAA,EAC1E;AACA,EAAA,MAAM,cAAA,GAAiB,IAAI,QAAA,CAAS,GAAG,IAAI,GAAA,CAAI,KAAA,CAAM,CAAA,EAAG,EAAE,CAAA,GAAI,GAAA;AAC9D,EAAA,IAAI,cAAA,CAAe,QAAA,CAAS,UAAU,CAAA,EAAG;AACvC,IAAA,OAAO,cAAA;AAAA,EACT;AACA,EAAA,OAAO,GAAG,cAAc,CAAA,mBAAA,CAAA;AAC1B","file":"chunk-F2BBRTLB.js","sourcesContent":["import { create } from \"zustand\";\nimport type {\n RunStatus,\n ExecutionsFilter,\n ExecutionsViewMode,\n ExecutionSelection,\n ExecutionsPagination,\n DateRange,\n WorkflowRun,\n} from \"../types\";\n\ninterface ExecutionsState {\n // View state\n viewMode: ExecutionsViewMode;\n selectedExecution: WorkflowRun | null;\n expandedRows: Set<string>;\n\n // Selection\n selection: ExecutionSelection;\n\n // Filters\n filter: ExecutionsFilter;\n\n // Pagination\n pagination: ExecutionsPagination;\n\n // UI state\n isFilterPanelOpen: boolean;\n isDetailsPanelOpen: boolean;\n autoRefresh: boolean;\n autoRefreshInterval: number;\n\n // Real-time\n liveRunIds: Set<string>;\n\n // Actions - View\n setViewMode: (mode: ExecutionsViewMode) => void;\n setSelectedExecution: (execution: WorkflowRun | null) => void;\n toggleRowExpanded: (runId: string) => void;\n\n // Actions - Selection\n setSelection: (selection: ExecutionSelection) => void;\n toggleSelectRun: (runId: string) => void;\n selectAll: (runIds: string[]) => void;\n clearSelection: () => void;\n\n // Actions - Filter\n updateFilter: (filter: Partial<ExecutionsFilter>) => void;\n setStatusFilter: (status: RunStatus | \"all\") => void;\n setWorkflowFilter: (workflowKey: string) => void;\n setDateRange: (dateRange: DateRange) => void;\n setSearchQuery: (search: string) => void;\n setTriggerTypeFilter: (triggerType: ExecutionsFilter[\"triggerType\"]) => void;\n setDurationFilter: (\n durationMinSeconds: number | null,\n durationMaxSeconds: number | null,\n ) => void;\n setErrorTypeFilter: (errorType: ExecutionsFilter[\"errorType\"]) => void;\n setNodeFilter: (nodeId: string) => void;\n resetFilters: () => void;\n\n // Actions - Pagination\n setPage: (page: number) => void;\n setPageSize: (pageSize: number) => void;\n setTotal: (total: number) => void;\n\n // Actions - UI\n toggleFilterPanel: () => void;\n toggleDetailsPanel: () => void;\n setAutoRefresh: (enabled: boolean) => void;\n setAutoRefreshInterval: (interval: number) => void;\n\n // Actions - Real-time\n addLiveRun: (runId: string) => void;\n removeLiveRun: (runId: string) => void;\n clearLiveRuns: () => void;\n}\n\nconst defaultFilter: ExecutionsFilter = {\n status: \"all\",\n workflowKey: \"\",\n dateRange: {\n start: null,\n end: null,\n preset: \"all\",\n },\n search: \"\",\n triggerType: \"all\",\n durationMinSeconds: null,\n durationMaxSeconds: null,\n errorType: \"all\",\n nodeId: \"\",\n};\n\nconst defaultPagination: ExecutionsPagination = {\n page: 1,\n pageSize: 25,\n total: 0,\n};\n\nexport const useExecutionsStore = create<ExecutionsState>((set) => ({\n // Initial state\n viewMode: \"table\",\n selectedExecution: null,\n expandedRows: new Set(),\n\n selection: {\n runIds: [],\n allSelected: false,\n },\n\n filter: defaultFilter,\n pagination: defaultPagination,\n\n isFilterPanelOpen: false,\n isDetailsPanelOpen: false,\n autoRefresh: true,\n autoRefreshInterval: 5000,\n\n liveRunIds: new Set(),\n\n // Actions - View\n setViewMode: (mode) => set({ viewMode: mode }),\n\n setSelectedExecution: (execution) =>\n set({\n selectedExecution: execution,\n isDetailsPanelOpen: execution !== null,\n }),\n\n toggleRowExpanded: (runId) =>\n set((state) => {\n const newExpanded = new Set(state.expandedRows);\n if (newExpanded.has(runId)) {\n newExpanded.delete(runId);\n } else {\n newExpanded.add(runId);\n }\n return { expandedRows: newExpanded };\n }),\n\n // Actions - Selection\n setSelection: (selection) => set({ selection }),\n\n toggleSelectRun: (runId) =>\n set((state) => {\n const isSelected = state.selection.runIds.includes(runId);\n const newRunIds = isSelected\n ? state.selection.runIds.filter((id) => id !== runId)\n : [...state.selection.runIds, runId];\n return {\n selection: {\n runIds: newRunIds,\n allSelected: false,\n },\n };\n }),\n\n selectAll: (runIds) =>\n set((state) => ({\n selection: {\n runIds: state.selection.allSelected ? [] : runIds,\n allSelected: !state.selection.allSelected,\n },\n })),\n\n clearSelection: () =>\n set({\n selection: {\n runIds: [],\n allSelected: false,\n },\n }),\n\n // Actions - Filter\n updateFilter: (filterUpdate) =>\n set((state) => ({\n filter: { ...state.filter, ...filterUpdate },\n pagination: { ...state.pagination, page: 1 },\n })),\n\n setStatusFilter: (status) =>\n set((state) => ({\n filter: { ...state.filter, status },\n pagination: { ...state.pagination, page: 1 },\n })),\n\n setWorkflowFilter: (workflowKey) =>\n set((state) => ({\n filter: { ...state.filter, workflowKey },\n pagination: { ...state.pagination, page: 1 },\n })),\n\n setDateRange: (dateRange) =>\n set((state) => ({\n filter: { ...state.filter, dateRange },\n pagination: { ...state.pagination, page: 1 },\n })),\n\n setSearchQuery: (search) =>\n set((state) => ({\n filter: { ...state.filter, search },\n pagination: { ...state.pagination, page: 1 },\n })),\n\n setTriggerTypeFilter: (triggerType) =>\n set((state) => ({\n filter: { ...state.filter, triggerType },\n pagination: { ...state.pagination, page: 1 },\n })),\n\n setDurationFilter: (durationMinSeconds, durationMaxSeconds) =>\n set((state) => ({\n filter: { ...state.filter, durationMinSeconds, durationMaxSeconds },\n pagination: { ...state.pagination, page: 1 },\n })),\n\n setErrorTypeFilter: (errorType) =>\n set((state) => ({\n filter: { ...state.filter, errorType },\n pagination: { ...state.pagination, page: 1 },\n })),\n\n setNodeFilter: (nodeId) =>\n set((state) => ({\n filter: { ...state.filter, nodeId },\n pagination: { ...state.pagination, page: 1 },\n })),\n\n resetFilters: () =>\n set({\n filter: defaultFilter,\n pagination: { ...defaultPagination },\n }),\n\n // Actions - Pagination\n setPage: (page) =>\n set((state) => ({\n pagination: { ...state.pagination, page },\n })),\n\n setPageSize: (pageSize) =>\n set((state) => ({\n pagination: { ...state.pagination, pageSize, page: 1 },\n })),\n\n setTotal: (total) =>\n set((state) => ({\n pagination: { ...state.pagination, total },\n })),\n\n // Actions - UI\n toggleFilterPanel: () =>\n set((state) => ({\n isFilterPanelOpen: !state.isFilterPanelOpen,\n })),\n\n toggleDetailsPanel: () =>\n set((state) => ({\n isDetailsPanelOpen: !state.isDetailsPanelOpen,\n })),\n\n setAutoRefresh: (enabled) => set({ autoRefresh: enabled }),\n\n setAutoRefreshInterval: (interval) => set({ autoRefreshInterval: interval }),\n\n // Actions - Real-time\n addLiveRun: (runId) =>\n set((state) => {\n const newLiveRunIds = new Set(state.liveRunIds);\n newLiveRunIds.add(runId);\n return { liveRunIds: newLiveRunIds };\n }),\n\n removeLiveRun: (runId) =>\n set((state) => {\n const newLiveRunIds = new Set(state.liveRunIds);\n newLiveRunIds.delete(runId);\n return { liveRunIds: newLiveRunIds };\n }),\n\n clearLiveRuns: () => set({ liveRunIds: new Set() }),\n}));\n","import { useExecutionsStore } from \"../modules/executions/store/executionsStore\";\n/**\n * Configuration module for FluidGrids SDK\n */\n\n/** Result passed to the onWorkflowSaved callback after a successful save */\nexport interface WorkflowSavedResult {\n /** Database row ID of the saved workflow definition */\n dbId: string;\n /** Human-readable workflow key (e.g., \"github_user_profile\") */\n workflowKey: string;\n /** Semantic version string (e.g., \"v1\", \"v2\") */\n version: string;\n /** Display name of the workflow */\n name: string;\n /** Optional description */\n description?: string;\n /** What kind of save operation occurred */\n operation: \"created\" | \"updated\" | \"versioned\";\n}\n\nexport interface FluidGridsConfig {\n /** GraphQL endpoint URL (workspace gateway) */\n apiGatewayUrl: string;\n /** GraphQL endpoint URL (global gateway) */\n globalApiUrl?: string;\n /** Auth token for API calls */\n authToken?: string;\n /** Current workspace ID */\n workspaceId: string;\n /** Current tenant ID */\n tenantId?: string;\n /** Organization ID */\n organizationId?: string;\n /**\n * @deprecated Never read. Share/Embed links used to be built from this\n * value, which no host ever set, so they shipped as `undefined/...`\n * (BOFF-7753). Kept only so existing host configs still type-check.\n */\n fluidgridFrontendUrl?: string;\n /** Product ID for workflow isolation (e.g., 'bigconsole', 'botlit', 'fluidgrids') */\n productId?: string;\n /** Product name for display purposes */\n productName?: string;\n /** Optional allowlist for host origins embedding the SDK */\n trustedOrigins?: string[];\n /**\n * Callback invoked after a workflow is successfully saved to wspace-workflow-svc.\n * Host apps (BigConsole, Botlit) can use this to sync metadata to their own backends.\n * Errors thrown by this callback are caught and logged — they never block the save.\n */\n onWorkflowSaved?: (result: WorkflowSavedResult) => void | Promise<void>;\n}\n\n// Default configuration\nlet runtimeConfig: FluidGridsConfig = {\n apiGatewayUrl: \"\",\n workspaceId: \"\",\n};\n\n/**\n * Get current configuration via proxy for live access\n */\nexport const config = new Proxy({} as FluidGridsConfig, {\n get(_, prop: keyof FluidGridsConfig) {\n return runtimeConfig[prop];\n },\n});\n\n/**\n * Get the full configuration object\n */\nexport function getFluidGridsConfig(): FluidGridsConfig {\n return { ...runtimeConfig };\n}\n\n/**\n * Set runtime configuration\n */\nexport function setFluidGridsConfig(\n newConfig: Partial<FluidGridsConfig>,\n): void {\n runtimeConfig = { ...runtimeConfig, ...newConfig };\n}\n\n/**\n * Reset configuration to defaults\n */\nexport function resetFluidGridsConfig(): void {\n // Executions contain user data; never carry selections or filters into another host/session.\n useExecutionsStore.setState(useExecutionsStore.getInitialState(), true);\n runtimeConfig = {\n apiGatewayUrl: \"\",\n workspaceId: \"\",\n };\n}\n\nfunction normalizeOrigin(origin: string): string {\n return origin.replace(/\\/$/, \"\");\n}\n\nexport function validateTrustedOrigin(trustedOrigins?: string[]): void {\n if (typeof window === \"undefined\" || !trustedOrigins?.length) {\n return;\n }\n\n const currentOrigin = normalizeOrigin(window.location.origin);\n const allowedOrigins = trustedOrigins.map(normalizeOrigin);\n\n if (!allowedOrigins.includes(currentOrigin)) {\n throw new Error(\n `FluidGrids SDK blocked untrusted origin: ${currentOrigin}`,\n );\n }\n}\n\n/**\n * Get the GraphQL endpoint URL\n */\nexport function getGraphQLEndpoint(baseUrl?: string): string {\n const url = baseUrl || runtimeConfig.apiGatewayUrl;\n if (!url) {\n throw new Error(\"FluidGrids SDK requires apiGatewayUrl to be configured\");\n }\n const normalizedBase = url.endsWith(\"/\") ? url.slice(0, -1) : url;\n if (normalizedBase.endsWith(\"/graphql\")) {\n return normalizedBase;\n }\n return `${normalizedBase}/workspaces/graphql`;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/builder/components/ui/sonner.tsx","../src/components/WorkflowBuilderCore.tsx","../src/components/WorkflowBuilder.tsx","../src/pages/WorkflowSearchRedirect.tsx"],"names":["Sonner","jsx","jsxs"],"mappings":";;;;;;;;;;;;;;;;;;AAKA,IAAM,OAAA,GAAU,CAAC,EAAE,GAAG,OAAM,KAAoB;AAC9C,EAAA,MAAM,EAAE,aAAA,GAAgB,OAAA,EAAQ,GAAI,QAAA,EAAS;AAE7C,EAAA,uBACE,GAAA;AAAA,IAACA,SAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,aAAA;AAAA,MACP,SAAA,EAAU,eAAA;AAAA,MACV,YAAA,EAAc;AAAA,QACZ,UAAA,EAAY;AAAA,UACV,KAAA,EACE,uIAAA;AAAA,UACF,WAAA,EAAa,sCAAA;AAAA,UACb,YAAA,EACE,kEAAA;AAAA,UACF,YAAA,EACE;AAAA;AACJ,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ,CAAA;AC0BA,IAAM,kBAAA,GAAqB;AAAA,EACzB,IAAA,EAAM,YAAA;AAAA,EACN,SAAA,EAAW;AAAA,IACT,MAAM,UAAA,CAAW,WAAA;AAAA,IACjB,KAAA,EAAO,EAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,KAAA,EAAO;AAAA,IACL,MAAA,EAAQ;AAAA;AAEZ,CAAA;AA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AA,sBAAAD,GAAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAK,0BAAA,EAA2B,WAAU,QAAA,EAAS,CAAA;AAAA,MAAE;AAAA,KAAA,EAE7D,CAAA;AAAA,EAEJ;AAEA,EAAA,IAAI,KAAA,IAAS,CAAC,QAAA,EAAU;AACtB,IAAA,uBAAOA,GAAAA,CAAC,QAAA,EAAA,EAAS,EAAA,EAAG,SAAA,EAAU,SAAO,IAAA,EAAC,CAAA;AAAA,EACxC;AAEA,EAAA,uBACEA,GAAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,IAAI,CAAA,YAAA,EAAe,QAAA,CAAS,WAAW,CAAA,CAAA,EAAI,SAAS,OAAO,CAAA,CAAA;AAAA,MAC3D,OAAA,EAAO;AAAA;AAAA,GACT;AAEJ","file":"chunk-I2766GDR.js","sourcesContent":["import { useTheme } from \"@burdenoff/fe-libs/shared/hooks/shell\";\nimport { Toaster as Sonner } from \"sonner\";\n\ntype ToasterProps = React.ComponentProps<typeof Sonner>;\n\nconst Toaster = ({ ...props }: ToasterProps) => {\n const { resolvedTheme = \"light\" } = useTheme();\n\n return (\n <Sonner\n theme={resolvedTheme as ToasterProps[\"theme\"]}\n className=\"toaster group\"\n toastOptions={{\n classNames: {\n toast:\n \"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg\",\n description: \"group-[.toast]:text-muted-foreground\",\n actionButton:\n \"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground\",\n cancelButton:\n \"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground\",\n },\n }}\n {...props}\n />\n );\n};\n\nexport { Toaster };\n","import { useCallback, useEffect, useState, useRef } from \"react\";\nimport {\n ReactFlow,\n Background,\n Controls,\n MiniMap,\n Handle,\n Position,\n type NodeTypes,\n MarkerType,\n type NodeProps,\n useReactFlow,\n ReactFlowProvider,\n} from \"@xyflow/react\";\nimport { useShallow } from \"zustand/shallow\";\nimport \"@xyflow/react/dist/style.css\";\n\nimport { useFlowStore } from \"../builder/stores/flow-store\";\nimport { Button } from \"../ui/button\";\nimport { Input } from \"../ui/input\";\nimport { Card } from \"../ui/card\";\nimport { cn } from \"../utils/cn\";\nimport type { WorkflowData, FlowNode } from \"../types\";\nimport { ArrowLeft, Play, Save, Trash2 } from \"lucide-react\";\nimport { Toaster } from \"../builder/components/ui/sonner\";\nimport { useTr } from \"../hooks/useTr\";\nimport { FluidGridsMark } from \"./shared/FluidGridsMark\";\n\nexport interface WorkflowBuilderCoreProps {\n /** Initial workflow data to render */\n workflow?: WorkflowData;\n /** Readonly mode - disables editing */\n readonly?: boolean;\n /** Hide the header toolbar */\n hideHeader?: boolean;\n /** Hide the sidebar */\n hideSidebar?: boolean;\n /** Hide the logs panel */\n hideLogsPanel?: boolean;\n /** Callback when workflow is saved */\n onSave?: (workflow: WorkflowData) => void;\n /** Callback when workflow execution starts */\n onExecute?: (runId: string) => void;\n /** Callback when a node is clicked */\n onNodeClick?: (node: FlowNode) => void;\n /** Callback when back button is clicked */\n onBack?: () => void;\n /** Custom className */\n className?: string;\n}\n\n// Default edge options\nconst defaultEdgeOptions = {\n type: \"smoothstep\",\n markerEnd: {\n type: MarkerType.ArrowClosed,\n width: 21,\n height: 21,\n },\n style: {\n stroke: \"#888\",\n },\n};\n\n// Handle styles\nconst handleStyle: React.CSSProperties = {\n width: 10,\n height: 10,\n background: \"#3b82f6\", // blue-500\n border: \"2px solid white\",\n};\n\n// Base node styles\nconst baseNodeStyle: React.CSSProperties = {\n padding: \"8px 16px\",\n borderRadius: \"8px\",\n fontWeight: 500,\n boxShadow:\n \"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)\",\n position: \"relative\",\n color: \"white\",\n};\n\n// Node type → colour mapping\nconst NODE_COLORS: Record<string, string> = {\n \"trigger:api\": \"#22c55e\",\n end: \"#ef4444\",\n \"internal:if\": \"#8b5cf6\",\n \"internal:switch\": \"#8b5cf6\",\n \"internal:loop\": \"#f59e0b\",\n \"internal:merge\": \"#6366f1\",\n \"internal:set\": \"#3b82f6\",\n \"internal:filter\": \"#06b6d4\",\n \"internal:aggregate\": \"#0891b2\",\n \"internal:wait\": \"#64748b\",\n \"internal:noop\": \"#94a3b8\",\n \"internal:http\": \"#f97316\",\n default: \"#3b82f6\",\n};\n\nfunction getNodeColor(type: string): string {\n return NODE_COLORS[type] ?? NODE_COLORS.default;\n}\n\n// Trigger Node component - has only source handle (bottom)\nfunction TriggerNode({ data }: NodeProps) {\n const tr = useTr();\n const label = (data as { label?: string }).label;\n return (\n <div style={{ ...baseNodeStyle, background: getNodeColor(\"trigger:api\") }}>\n {label ||\n tr(\n \"fluidgrids.components.workflowBuilderCore.triggerNodeLabel\",\n \"API Trigger\",\n )}\n <Handle type=\"source\" position={Position.Bottom} style={handleStyle} />\n </div>\n );\n}\n\n// End Node component - has only target handle (top)\nfunction EndNode({ data }: NodeProps) {\n const tr = useTr();\n const label = (data as { label?: string }).label;\n return (\n <div style={{ ...baseNodeStyle, background: getNodeColor(\"end\") }}>\n <Handle type=\"target\" position={Position.Top} style={handleStyle} />\n {label ||\n tr(\"fluidgrids.components.workflowBuilderCore.endNodeLabel\", \"End\")}\n </div>\n );\n}\n\n// Action Node component - has both source (bottom) and target (top) handles\nfunction ActionNode({ data, type }: NodeProps) {\n const tr = useTr();\n const label = (data as { label?: string }).label;\n const color = getNodeColor(type || \"default\");\n return (\n <div\n style={{\n ...baseNodeStyle,\n background: color,\n minWidth: 120,\n textAlign: \"center\",\n }}\n >\n <Handle type=\"target\" position={Position.Top} style={handleStyle} />\n {label ||\n tr(\n \"fluidgrids.components.workflowBuilderCore.actionNodeLabel\",\n \"Action\",\n )}\n <Handle type=\"source\" position={Position.Bottom} style={handleStyle} />\n </div>\n );\n}\n\n// Define node types\nconst NODE_TYPES: NodeTypes = {\n \"trigger:api\": TriggerNode,\n end: EndNode,\n \"internal:if\": ActionNode,\n \"internal:switch\": ActionNode,\n \"internal:loop\": ActionNode,\n \"internal:merge\": ActionNode,\n \"internal:set\": ActionNode,\n \"internal:filter\": ActionNode,\n \"internal:aggregate\": ActionNode,\n \"internal:wait\": ActionNode,\n \"internal:noop\": ActionNode,\n \"internal:http\": ActionNode,\n \"internal:subworkflow\": ActionNode,\n default: ActionNode,\n};\n\n// Counter for unique node ids\nlet nodeIdCounter = 0;\n\nfunction FlowBuilderInner({\n workflow,\n readonly = false,\n hideHeader = false,\n hideSidebar = false,\n hideLogsPanel = false,\n onSave,\n onExecute,\n onNodeClick,\n onBack,\n className,\n}: WorkflowBuilderCoreProps) {\n const reactFlowInstance = useReactFlow();\n const tr = useTr();\n\n const setWorkflow = useFlowStore((s) => s.actions.setWorkflow);\n const resetWorkflow = useFlowStore((s) => s.actions.resetWorkflow);\n const deleteNode = useFlowStore((s) => s.actions.nodes.deleteNode);\n const setNodes = useFlowStore((s) => s.actions.nodes.setNodes);\n\n const [nodes, edges, onNodesChange, onEdgesChange, onConnect] = useFlowStore(\n useShallow((s) => [\n s.workflow.nodes,\n s.workflow.edges,\n s.actions.nodes.onNodesChange,\n s.actions.edges.onEdgesChange,\n s.actions.edges.onConnect,\n ]),\n );\n\n const [workflowName, setWorkflowName] = useState(\n workflow?.name || \"Untitled Workflow\",\n );\n\n // Selected node for properties panel\n const [selectedNodeId, setSelectedNodeId] = useState<string | null>(null);\n\n // Ref for the ReactFlow wrapper (needed for drop position calculation)\n const reactFlowWrapper = useRef<HTMLDivElement>(null);\n\n // Initialize workflow on mount\n useEffect(() => {\n resetWorkflow();\n if (workflow) {\n setWorkflow(workflow);\n setWorkflowName(workflow.name || \"Untitled Workflow\");\n }\n }, [workflow, resetWorkflow, setWorkflow]);\n\n const handleNameChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setWorkflowName(e.target.value);\n setWorkflow({ name: e.target.value });\n };\n\n const handleSave = () => {\n const savedWorkflow: WorkflowData = {\n id: workflow?.id || \"\",\n workflowKey: workflow?.workflowKey || \"\",\n name: workflowName,\n version: workflow?.version || \"1\",\n alias: workflow?.alias,\n nodes: nodes as FlowNode[],\n edges,\n sidebar: {\n active: \"none\",\n panels: {\n nodeProperties: {\n selectedNode: null,\n },\n },\n },\n };\n onSave?.(savedWorkflow);\n };\n\n const handleExecute = () => {\n // Generate a run ID and trigger execution\n const runId = `run-${Date.now()}`;\n onExecute?.(runId);\n };\n\n // ---- Node click → select in sidebar ----\n const handleNodeClick = useCallback(\n (\n _event: React.MouseEvent,\n node: { id: string; [key: string]: unknown },\n ) => {\n setSelectedNodeId(node.id);\n onNodeClick?.(node as unknown as FlowNode);\n },\n [onNodeClick],\n );\n\n // Deselect when clicking the pane\n const handlePaneClick = useCallback(() => {\n setSelectedNodeId(null);\n }, []);\n\n // ---- Drag-and-drop from external palette ----\n const handleDragOver = useCallback((event: React.DragEvent) => {\n event.preventDefault();\n event.dataTransfer.dropEffect = \"copy\";\n }, []);\n\n const handleDrop = useCallback(\n (event: React.DragEvent) => {\n event.preventDefault();\n\n const raw = event.dataTransfer.getData(\"application/json\");\n if (!raw) return;\n\n let payload: { id?: string; type?: string; label?: string };\n try {\n payload = JSON.parse(raw);\n } catch {\n return;\n }\n\n const nodeType = payload.type || payload.id || \"default\";\n const label = payload.label || nodeType;\n\n // Calculate drop position in flow coordinates\n const bounds = reactFlowWrapper.current?.getBoundingClientRect();\n if (!bounds) return;\n\n const position = reactFlowInstance.screenToFlowPosition({\n x: event.clientX - bounds.left,\n y: event.clientY - bounds.top,\n });\n\n nodeIdCounter += 1;\n const newNodeId = `${nodeType}-${Date.now()}-${nodeIdCounter}`;\n const newNode: FlowNode = {\n id: newNodeId,\n type: nodeType,\n position,\n data: { label },\n };\n\n // Append to the existing nodes via the store\n const currentNodes = useFlowStore.getState().workflow.nodes;\n setNodes([...currentNodes, newNode]);\n },\n [reactFlowInstance, setNodes],\n );\n\n // ---- Selected node helpers ----\n const selectedNode = selectedNodeId\n ? (nodes.find((n) => n.id === selectedNodeId) as FlowNode | undefined)\n : null;\n\n const handleSelectedNodeLabelChange = useCallback(\n (newLabel: string) => {\n if (!selectedNodeId) return;\n const currentNodes = useFlowStore.getState().workflow.nodes;\n const updated = currentNodes.map((n) =>\n n.id === selectedNodeId\n ? { ...n, data: { ...n.data, label: newLabel } }\n : n,\n );\n setNodes(updated);\n },\n [selectedNodeId, setNodes],\n );\n\n const handleDeleteSelectedNode = useCallback(() => {\n if (!selectedNode) return;\n if (selectedNode.deletable === false) return; // can't delete trigger/end\n deleteNode(selectedNode);\n setSelectedNodeId(null);\n }, [selectedNode, deleteNode]);\n\n return (\n <div\n className={cn(\"flex flex-col flex-1 h-full w-full min-h-0\", className)}\n >\n {/* Header */}\n {!hideHeader && (\n <Card className=\"h-14 shrink-0 border-0 rounded-none bg-gradient-to-r from-primary/20 to-transparent p-2 flex items-center justify-between border-b\">\n <div className=\"flex items-center gap-2\">\n {onBack && (\n <Button variant=\"ghost\" size=\"icon\" onClick={onBack}>\n <ArrowLeft className=\"size-5\" />\n </Button>\n )}\n <Input\n className=\"font-semibold max-w-[300px]\"\n value={workflowName}\n onChange={handleNameChange}\n placeholder={tr(\n \"fluidgrids.components.workflowBuilderCore.workflowNamePlaceholder\",\n \"Workflow Name\",\n )}\n disabled={readonly}\n />\n </div>\n\n {!readonly && (\n <div className=\"flex items-center gap-2\">\n <Button variant=\"outline\" size=\"sm\" onClick={handleSave}>\n <Save className=\"size-4 mr-1\" />\n {tr(\"fluidgrids.components.workflowBuilderCore.save\", \"Save\")}\n </Button>\n <Button size=\"sm\" onClick={handleExecute}>\n <Play className=\"size-4 mr-1\" />\n {tr(\"fluidgrids.components.workflowBuilderCore.run\", \"Run\")}\n </Button>\n </div>\n )}\n </Card>\n )}\n\n {/* Main content */}\n <div className=\"flex flex-1 min-h-0 overflow-hidden\">\n {/* Canvas */}\n <div className=\"flex-1 h-full relative\" ref={reactFlowWrapper}>\n <ReactFlow\n nodes={nodes}\n edges={edges}\n onNodesChange={readonly ? undefined : onNodesChange}\n onEdgesChange={readonly ? undefined : onEdgesChange}\n onConnect={readonly ? undefined : onConnect}\n onNodeClick={readonly ? undefined : handleNodeClick}\n onPaneClick={handlePaneClick}\n onDragOver={readonly ? undefined : handleDragOver}\n onDrop={readonly ? undefined : handleDrop}\n nodeTypes={NODE_TYPES}\n defaultEdgeOptions={defaultEdgeOptions}\n fitView\n snapToGrid\n snapGrid={[16, 16]}\n proOptions={{ hideAttribution: true }}\n deleteKeyCode={readonly ? null : \"Backspace\"}\n >\n <Background gap={24} />\n <Controls />\n <MiniMap />\n </ReactFlow>\n {/* Always shown, whatever readonly/hideHeader/hideSidebar say — no\n white-labelling. */}\n <FluidGridsMark />\n </div>\n\n {/* Sidebar — Node Properties */}\n {!hideSidebar && !readonly && (\n <div className=\"w-60 shrink-0 border-l bg-card overflow-y-auto\">\n <div className=\"p-4 border-b\">\n <div className=\"text-sm font-semibold\">\n {tr(\n \"fluidgrids.components.workflowBuilderCore.nodePropertiesHeading\",\n \"Node Properties\",\n )}\n </div>\n </div>\n\n {selectedNode ? (\n <div className=\"p-4 space-y-4\">\n {/* Node ID */}\n <div>\n <label className=\"block text-xs font-medium text-muted-foreground mb-1\">\n {tr(\n \"fluidgrids.components.workflowBuilderCore.nodeIdLabel\",\n \"Node ID\",\n )}\n </label>\n <code className=\"block text-xs bg-muted px-2 py-1 rounded font-mono break-all\">\n {selectedNode.id}\n </code>\n </div>\n\n {/* Node Type */}\n <div>\n <label className=\"block text-xs font-medium text-muted-foreground mb-1\">\n {tr(\n \"fluidgrids.components.workflowBuilderCore.nodeTypeLabel\",\n \"Type\",\n )}\n </label>\n <div className=\"flex items-center gap-2\">\n <span\n className=\"inline-block w-3 h-3 rounded-full shrink-0\"\n style={{\n background: getNodeColor(\n selectedNode.type || \"default\",\n ),\n }}\n />\n <code className=\"text-xs font-mono\">\n {selectedNode.type}\n </code>\n </div>\n </div>\n\n {/* Label */}\n <div>\n <label className=\"block text-xs font-medium text-muted-foreground mb-1\">\n {tr(\n \"fluidgrids.components.workflowBuilderCore.nodeLabelLabel\",\n \"Label\",\n )}\n </label>\n <Input\n value={\n (selectedNode.data as { label?: string })?.label ?? \"\"\n }\n onChange={(e) =>\n handleSelectedNodeLabelChange(e.target.value)\n }\n className=\"text-sm\"\n placeholder={tr(\n \"fluidgrids.components.workflowBuilderCore.nodeLabelPlaceholder\",\n \"Node label\",\n )}\n />\n </div>\n\n {/* Position */}\n <div>\n <label className=\"block text-xs font-medium text-muted-foreground mb-1\">\n {tr(\n \"fluidgrids.components.workflowBuilderCore.positionLabel\",\n \"Position\",\n )}\n </label>\n <div className=\"grid grid-cols-2 gap-2 text-xs text-muted-foreground\">\n <div>\n X:{\" \"}\n <span className=\"font-mono\">\n {Math.round(selectedNode.position.x)}\n </span>\n </div>\n <div>\n Y:{\" \"}\n <span className=\"font-mono\">\n {Math.round(selectedNode.position.y)}\n </span>\n </div>\n </div>\n </div>\n\n {/* Connected edges */}\n <div>\n <label className=\"block text-xs font-medium text-muted-foreground mb-1\">\n {tr(\n \"fluidgrids.components.workflowBuilderCore.connectionsLabel\",\n \"Connections\",\n )}\n </label>\n <div className=\"text-xs text-muted-foreground\">\n {(() => {\n const inbound = edges.filter(\n (e) => e.target === selectedNode.id,\n );\n const outbound = edges.filter(\n (e) => e.source === selectedNode.id,\n );\n return (\n <>\n <div>\n {inbound.length} inbound, {outbound.length} outbound\n </div>\n </>\n );\n })()}\n </div>\n </div>\n\n {/* Delete */}\n {selectedNode.deletable !== false && (\n <div className=\"pt-2 border-t\">\n <Button\n variant=\"destructive\"\n size=\"sm\"\n className=\"w-full\"\n onClick={handleDeleteSelectedNode}\n >\n <Trash2 className=\"size-4 mr-1\" />\n {tr(\n \"fluidgrids.components.workflowBuilderCore.deleteNode\",\n \"Delete Node\",\n )}\n </Button>\n </div>\n )}\n </div>\n ) : (\n <div className=\"p-4\">\n <p className=\"text-xs text-muted-foreground\">\n {tr(\n \"fluidgrids.components.workflowBuilderCore.noSelectionHint\",\n \"Click a node on the canvas to view and edit its properties.\",\n )}\n </p>\n <p className=\"text-xs text-muted-foreground mt-2\">\n {tr(\n \"fluidgrids.components.workflowBuilderCore.dragPaletteHint\",\n \"Drag nodes from the palette on the left to add them to the workflow.\",\n )}\n </p>\n </div>\n )}\n </div>\n )}\n </div>\n\n {/* Logs panel placeholder */}\n {!hideLogsPanel && (\n <div className=\"h-32 border-t bg-card p-2\">\n <div className=\"text-sm font-medium mb-2\">\n {tr(\n \"fluidgrids.components.workflowBuilderCore.executionLogsHeading\",\n \"Execution Logs\",\n )}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {tr(\n \"fluidgrids.components.workflowBuilderCore.executionLogsEmpty\",\n \"Execution logs will appear here when you run the workflow\",\n )}\n </p>\n </div>\n )}\n </div>\n );\n}\n\nexport function WorkflowBuilderCore(props: WorkflowBuilderCoreProps) {\n return (\n <ReactFlowProvider>\n <FlowBuilderInner {...props} />\n <Toaster richColors position=\"bottom-center\" duration={2000} />\n </ReactFlowProvider>\n );\n}\n","import { type ApolloClient } from \"@apollo/client/core\";\nimport { FluidGridsProvider } from \"./FluidGridsProvider\";\nimport {\n WorkflowBuilderCore,\n type WorkflowBuilderCoreProps,\n} from \"./WorkflowBuilderCore\";\nimport type { WorkflowData } from \"../types\";\n\nexport interface WorkflowBuilderProps extends Omit<\n WorkflowBuilderCoreProps,\n \"workflow\"\n> {\n /** Workflow ID to load */\n workflowId?: string;\n /** Workflow version to load */\n workflowVersion?: string;\n /** Initial workflow data (bypasses API fetch) */\n initialWorkflow?: WorkflowData;\n /** Workspace API Gateway URL */\n apiGatewayUrl?: string;\n /** Global API Gateway URL (for store operations) */\n globalApiUrl?: string;\n /** Authentication token */\n authToken?: string;\n /** Current workspace ID */\n workspaceId: string;\n /** Current tenant ID */\n tenantId?: string;\n /** Organization ID */\n organizationId?: string;\n /** Optional: Provide your own workspace Apollo client */\n workspaceClient?: ApolloClient;\n /** Optional: Provide your own global Apollo client */\n globalClient?: ApolloClient;\n}\n\n/**\n * WorkflowBuilder - Standalone workflow builder component with Apollo client support\n *\n * Use this component when you want to embed the workflow builder in any React app.\n * You can either:\n * 1. Provide pre-configured Apollo clients (workspaceClient + globalClient) - Recommended\n * 2. Provide URLs and let the component create clients internally\n *\n * @example Dual Client Injection (Recommended)\n * ```tsx\n * import { createFluidGridsClients } from '@fluidgrids/fe-sdk';\n *\n * const { workspaceClient, globalClient } = createFluidGridsClients({\n * workspaceApiUrl: 'http://localhost:4000/workspaces/graphql',\n * globalApiUrl: 'http://localhost:4000/global/graphql',\n * authToken: token,\n * workspaceId: 'ws-123',\n * });\n *\n * <WorkflowBuilder\n * workspaceClient={workspaceClient}\n * globalClient={globalClient}\n * workspaceId=\"ws-123\"\n * onSave={(workflow) => console.log(workflow)}\n * />\n * ```\n *\n * @example URL-based (Simpler, less flexible)\n * ```tsx\n * <WorkflowBuilder\n * apiGatewayUrl=\"http://localhost:4000/workspaces/graphql\"\n * globalApiUrl=\"http://localhost:4000/global/graphql\"\n * authToken={token}\n * workspaceId=\"ws-123\"\n * onSave={(workflow) => console.log(workflow)}\n * />\n * ```\n */\nexport function WorkflowBuilder({\n workflowId,\n workflowVersion,\n initialWorkflow,\n apiGatewayUrl,\n globalApiUrl,\n authToken,\n workspaceId,\n tenantId,\n organizationId,\n workspaceClient,\n globalClient,\n ...coreProps\n}: WorkflowBuilderProps) {\n // If initialWorkflow is provided, use it directly\n // Otherwise, the workflow will need to be loaded from the API\n const workflow =\n initialWorkflow || createDefaultWorkflow(workflowId, workflowVersion);\n\n return (\n <FluidGridsProvider\n apiGatewayUrl={apiGatewayUrl}\n globalApiUrl={globalApiUrl}\n authToken={authToken}\n workspaceId={workspaceId}\n tenantId={tenantId}\n organizationId={organizationId}\n workspaceClient={workspaceClient}\n globalClient={globalClient}\n >\n <WorkflowBuilderCore workflow={workflow} {...coreProps} />\n </FluidGridsProvider>\n );\n}\n\nfunction createDefaultWorkflow(id?: string, version?: string): WorkflowData {\n return {\n id: id || `workflow-${Date.now()}`,\n workflowKey: id || `workflow-${Date.now()}`,\n name: \"Untitled Workflow\",\n version: version || \"1\",\n nodes: [],\n edges: [],\n sidebar: {\n active: \"store-browse\",\n panels: {\n nodeProperties: {\n selectedNode: null,\n },\n },\n },\n };\n}\n","import { Navigate, useParams } from \"react-router\";\nimport { Icon } from \"@iconify/react\";\nimport { useWorkflowDefinition } from \"../hooks/useWorkflows\";\n\n/**\n * Global search indexes WorkflowDefinition by its database id, but the\n * builder route (`workflow/:workflowKey/:version`) is keyed by workflowKey +\n * version. This page bridges the two: it resolves the id to its current\n * workflowKey/version and redirects there.\n */\nexport function WorkflowSearchRedirect() {\n const { id } = useParams<{ id: string }>();\n const { workflow, loading, error } = useWorkflowDefinition(undefined, id);\n\n if (loading) {\n return (\n <div className=\"flex h-full min-h-[40vh] items-center justify-center gap-2 text-sm text-muted-foreground\">\n <Icon icon=\"svg-spinners:ring-resize\" className=\"size-4\" />\n Opening workflow…\n </div>\n );\n }\n\n if (error || !workflow) {\n return <Navigate to=\"../list\" replace />;\n }\n\n return (\n <Navigate\n to={`../workflow/${workflow.workflowKey}/${workflow.version}`}\n replace\n />\n );\n}\n"]}
|