@burdenoff/fluidgrids-fe-sdk 2026.730.3 → 2026.731.2
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-CLIMJZPI.js → WorkflowBuilder-65FSMSCD.js} +4 -4
- package/dist/{WorkflowBuilder-CLIMJZPI.js.map → WorkflowBuilder-65FSMSCD.js.map} +1 -1
- package/dist/{blocks-M44L2H7I.js → blocks-UUACLZOU.js} +3 -3
- package/dist/{blocks-M44L2H7I.js.map → blocks-UUACLZOU.js.map} +1 -1
- package/dist/{chunk-JTET2M65.js → chunk-TH764V3S.js} +318 -38
- package/dist/chunk-TH764V3S.js.map +1 -0
- package/dist/{chunk-DZTLVUGS.js → chunk-UHUNDVWH.js} +51 -11
- package/dist/chunk-UHUNDVWH.js.map +1 -0
- package/dist/index.js +4 -4
- package/package.json +5 -5
- package/dist/chunk-DZTLVUGS.js.map +0 -1
- package/dist/chunk-JTET2M65.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { WorkflowBuilder } from './chunk-
|
|
1
|
+
export { WorkflowBuilder } from './chunk-UHUNDVWH.js';
|
|
2
2
|
import './chunk-MRVS73S2.js';
|
|
3
3
|
import './chunk-DBOMRIP5.js';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-TH764V3S.js';
|
|
5
5
|
import './chunk-BQXHJIER.js';
|
|
6
6
|
import './chunk-PNOA7CQV.js';
|
|
7
7
|
import './chunk-42PCKNPK.js';
|
|
@@ -12,5 +12,5 @@ import './chunk-IU65EQOS.js';
|
|
|
12
12
|
import './chunk-5BDQNSP3.js';
|
|
13
13
|
import './chunk-WWU2O2SR.js';
|
|
14
14
|
import './chunk-XQP33UJR.js';
|
|
15
|
-
//# sourceMappingURL=WorkflowBuilder-
|
|
16
|
-
//# sourceMappingURL=WorkflowBuilder-
|
|
15
|
+
//# sourceMappingURL=WorkflowBuilder-65FSMSCD.js.map
|
|
16
|
+
//# sourceMappingURL=WorkflowBuilder-65FSMSCD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"WorkflowBuilder-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"WorkflowBuilder-65FSMSCD.js"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AVAILABLE_NODES, NODES, NODES_METADATA, NODE_CONFIGS, NODE_TYPES, ensureNodeConfigsLoaded, fetchNodeManifest, isNodeConfigsInitialized, onNodeTypesUpdate, refetchStoreNodes, registerWorkflowNodeTypes } from './chunk-
|
|
1
|
+
export { AVAILABLE_NODES, NODES, NODES_METADATA, NODE_CONFIGS, NODE_TYPES, ensureNodeConfigsLoaded, fetchNodeManifest, isNodeConfigsInitialized, onNodeTypesUpdate, refetchStoreNodes, registerWorkflowNodeTypes } from './chunk-TH764V3S.js';
|
|
2
2
|
import './chunk-BQXHJIER.js';
|
|
3
3
|
import './chunk-PNOA7CQV.js';
|
|
4
4
|
import './chunk-KU64CCSV.js';
|
|
@@ -7,5 +7,5 @@ import './chunk-3ZYUGTIT.js';
|
|
|
7
7
|
import './chunk-IU65EQOS.js';
|
|
8
8
|
import './chunk-5BDQNSP3.js';
|
|
9
9
|
import './chunk-WWU2O2SR.js';
|
|
10
|
-
//# sourceMappingURL=blocks-
|
|
11
|
-
//# sourceMappingURL=blocks-
|
|
10
|
+
//# sourceMappingURL=blocks-UUACLZOU.js.map
|
|
11
|
+
//# sourceMappingURL=blocks-UUACLZOU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"blocks-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"blocks-UUACLZOU.js"}
|
|
@@ -5,14 +5,16 @@ import { SdkPermissionGate, FLUIDGRIDS_PERMISSIONS } from './chunk-UIY2HBWA.js';
|
|
|
5
5
|
import { NodeEndpointConfigsDocument, NodeManifestDocument, throwIfResultError, UpdateWorkflowDefinitionDocument, CreateWorkflowDefinitionDocument, CreateWorkflowVersionDocument, TriggerWorkflowDocument, describeOperationError, WorkflowRunDocument } from './chunk-IU65EQOS.js';
|
|
6
6
|
import { waitForFluidGridsClient, getFluidGridsClient } from './chunk-5BDQNSP3.js';
|
|
7
7
|
import { config, getFluidGridsConfig } from './chunk-WWU2O2SR.js';
|
|
8
|
-
import { useStore, useReactFlow, getConnectedEdges, Handle, Position, useUpdateNodeInternals, useNodeId } from '@xyflow/react';
|
|
9
8
|
import * as React from 'react';
|
|
10
|
-
import { forwardRef, useState, useImperativeHandle, useRef, useEffect, useMemo, useCallback
|
|
11
|
-
import {
|
|
12
|
-
import { useShallow } from 'zustand/shallow';
|
|
9
|
+
import { memo, forwardRef, useState, useImperativeHandle, useRef, useEffect, useMemo, useCallback } from 'react';
|
|
10
|
+
import { useReactFlow, NodeResizer, getConnectedEdges, useStore, Handle, Position, useUpdateNodeInternals, useNodeId } from '@xyflow/react';
|
|
13
11
|
import { Icon } from '@iconify/react';
|
|
12
|
+
import { nanoid } from 'nanoid';
|
|
13
|
+
import { Markdown } from '@burdenoff/fe-libs/shared/components';
|
|
14
14
|
import { cn } from '@burdenoff/fe-libs/utils';
|
|
15
|
+
import { useShallow } from 'zustand/shallow';
|
|
15
16
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
17
|
+
import { nanoid as nanoid$1 } from 'nanoid/non-secure';
|
|
16
18
|
import { Textarea, Input, Button, Card, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuLabel, DropdownMenuItem, DropdownMenuSeparator, Dialog as Dialog$1, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '@burdenoff/fe-libs/ui';
|
|
17
19
|
import * as AdaptiveCards from 'adaptivecards';
|
|
18
20
|
import { formatDistanceToNow } from 'date-fns';
|
|
@@ -22,29 +24,6 @@ import { toast } from 'sonner';
|
|
|
22
24
|
import { useParams, useNavigate } from 'react-router-dom';
|
|
23
25
|
import { InfoCircledIcon } from '@radix-ui/react-icons';
|
|
24
26
|
|
|
25
|
-
function getNodeDetail(nodeType) {
|
|
26
|
-
const node = NODES.find((node2) => node2.type === nodeType);
|
|
27
|
-
if (!node) {
|
|
28
|
-
return {
|
|
29
|
-
icon: "mynaui:keyboard-solid",
|
|
30
|
-
title: nodeType ?? "Unknown",
|
|
31
|
-
description: "",
|
|
32
|
-
gradientColor: "gray"
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
return node.detail;
|
|
36
|
-
}
|
|
37
|
-
function createNodeData(type, data) {
|
|
38
|
-
return {
|
|
39
|
-
id: nanoid(),
|
|
40
|
-
type,
|
|
41
|
-
data
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function createNodeWithDefaultData(type, data) {
|
|
45
|
-
const defaultData = NODES.find((node) => node.type === type)?.defaultData ?? {};
|
|
46
|
-
return Object.assign(createNodeData(type, defaultData), data);
|
|
47
|
-
}
|
|
48
27
|
function useDeleteNode() {
|
|
49
28
|
const { getNode, getEdges, deleteElements } = useReactFlow();
|
|
50
29
|
const [deleteNode, deleteEdge] = useFlowStore(
|
|
@@ -68,6 +47,284 @@ function useDeleteNode() {
|
|
|
68
47
|
[deleteElements, getEdges, getNode, deleteNode, deleteEdge]
|
|
69
48
|
);
|
|
70
49
|
}
|
|
50
|
+
|
|
51
|
+
// src/builder/contants/symbols.ts
|
|
52
|
+
var NODE_TYPE_DRAG_DATA_FORMAT = "application/flow-builder.node-type";
|
|
53
|
+
var NODE_OPERATION_DRAG_DATA_FORMAT = "application/flow-builder.node-operation";
|
|
54
|
+
var STICKY_NOTE_TYPE = "sticky-note";
|
|
55
|
+
var STICKY_COLORS = {
|
|
56
|
+
yellow: "#F2C94C",
|
|
57
|
+
orange: "#EB8934",
|
|
58
|
+
blue: "#3B82F6",
|
|
59
|
+
green: "#10B981",
|
|
60
|
+
red: "#EF4444",
|
|
61
|
+
purple: "#8B5CF6",
|
|
62
|
+
gray: "#9CA3AF"
|
|
63
|
+
};
|
|
64
|
+
var DEFAULT_STICKY_COLOR = "yellow";
|
|
65
|
+
var STICKY_DEFAULT_SIZE = { width: 260, height: 170 };
|
|
66
|
+
var STICKY_MIN_SIZE = { width: 160, height: 90 };
|
|
67
|
+
function ToolbarButton({
|
|
68
|
+
title,
|
|
69
|
+
onClick,
|
|
70
|
+
danger,
|
|
71
|
+
children
|
|
72
|
+
}) {
|
|
73
|
+
return /* @__PURE__ */ jsx(
|
|
74
|
+
"button",
|
|
75
|
+
{
|
|
76
|
+
type: "button",
|
|
77
|
+
title,
|
|
78
|
+
onClick: (e) => {
|
|
79
|
+
e.stopPropagation();
|
|
80
|
+
onClick();
|
|
81
|
+
},
|
|
82
|
+
className: cn(
|
|
83
|
+
"nodrag flex size-6 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
84
|
+
danger && "text-[var(--color-status-error-text)] hover:text-[var(--color-status-error-text)]"
|
|
85
|
+
),
|
|
86
|
+
children
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
function StickyNoteNodeComponent({
|
|
91
|
+
id,
|
|
92
|
+
selected,
|
|
93
|
+
data
|
|
94
|
+
}) {
|
|
95
|
+
const { setNodes, getNode } = useReactFlow();
|
|
96
|
+
const zustandSetNodes = useFlowStore((s) => s.actions.nodes.setNodes);
|
|
97
|
+
const deleteNode = useDeleteNode();
|
|
98
|
+
const [editing, setEditing] = useState(false);
|
|
99
|
+
const [showPalette, setShowPalette] = useState(false);
|
|
100
|
+
const [draft, setDraft] = useState(String(data.content ?? ""));
|
|
101
|
+
const textareaRef = useRef(null);
|
|
102
|
+
const rootRef = useRef(null);
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
const wrapper = rootRef.current?.closest(".react-flow__node");
|
|
105
|
+
if (wrapper && wrapper.style.zIndex !== "-1") {
|
|
106
|
+
wrapper.style.zIndex = "-1";
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
const colorKey = typeof data.color === "string" && STICKY_COLORS[data.color] ? data.color : DEFAULT_STICKY_COLOR;
|
|
110
|
+
const accent = STICKY_COLORS[colorKey];
|
|
111
|
+
const patchData = useCallback(
|
|
112
|
+
(patch) => {
|
|
113
|
+
setNodes((nds) => {
|
|
114
|
+
const updated = nds.map(
|
|
115
|
+
(n) => n.id === id ? { ...n, data: { ...n.data, ...patch } } : n
|
|
116
|
+
);
|
|
117
|
+
zustandSetNodes(updated);
|
|
118
|
+
return updated;
|
|
119
|
+
});
|
|
120
|
+
},
|
|
121
|
+
[id, setNodes, zustandSetNodes]
|
|
122
|
+
);
|
|
123
|
+
const startEditing = useCallback(() => {
|
|
124
|
+
setDraft(String(getNode(id)?.data?.content ?? ""));
|
|
125
|
+
setEditing(true);
|
|
126
|
+
setShowPalette(false);
|
|
127
|
+
}, [getNode, id]);
|
|
128
|
+
const commitEdit = useCallback(() => {
|
|
129
|
+
setEditing(false);
|
|
130
|
+
patchData({ content: draft });
|
|
131
|
+
}, [draft, patchData]);
|
|
132
|
+
const cancelEdit = useCallback(() => {
|
|
133
|
+
setEditing(false);
|
|
134
|
+
setDraft(String(getNode(id)?.data?.content ?? ""));
|
|
135
|
+
}, [getNode, id]);
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
if (editing) {
|
|
138
|
+
const el = textareaRef.current;
|
|
139
|
+
el?.focus();
|
|
140
|
+
el?.setSelectionRange(el.value.length, el.value.length);
|
|
141
|
+
}
|
|
142
|
+
}, [editing]);
|
|
143
|
+
const duplicate = useCallback(() => {
|
|
144
|
+
const source = getNode(id);
|
|
145
|
+
if (!source) return;
|
|
146
|
+
const clone = {
|
|
147
|
+
...source,
|
|
148
|
+
id: nanoid(),
|
|
149
|
+
position: {
|
|
150
|
+
x: source.position.x + 24,
|
|
151
|
+
y: source.position.y + 24
|
|
152
|
+
},
|
|
153
|
+
selected: true,
|
|
154
|
+
data: { ...source.data }
|
|
155
|
+
};
|
|
156
|
+
setNodes((nds) => {
|
|
157
|
+
const updated = [
|
|
158
|
+
...nds.map((n) => n.selected ? { ...n, selected: false } : n),
|
|
159
|
+
clone
|
|
160
|
+
];
|
|
161
|
+
zustandSetNodes(updated);
|
|
162
|
+
return updated;
|
|
163
|
+
});
|
|
164
|
+
}, [getNode, id, setNodes, zustandSetNodes]);
|
|
165
|
+
const content = String(data.content ?? "");
|
|
166
|
+
return (
|
|
167
|
+
// Outer wrapper is NOT overflow-hidden: the NodeResizer's edge lines and
|
|
168
|
+
// corner handles sit on the bounds and would be clipped/covered otherwise.
|
|
169
|
+
/* @__PURE__ */ jsxs("div", { ref: rootRef, className: "group relative h-full w-full", children: [
|
|
170
|
+
/* @__PURE__ */ jsx(
|
|
171
|
+
NodeResizer,
|
|
172
|
+
{
|
|
173
|
+
isVisible: !!selected,
|
|
174
|
+
minWidth: STICKY_MIN_SIZE.width,
|
|
175
|
+
minHeight: STICKY_MIN_SIZE.height,
|
|
176
|
+
lineStyle: { border: "none", zIndex: 20 },
|
|
177
|
+
handleStyle: {
|
|
178
|
+
width: 12,
|
|
179
|
+
height: 12,
|
|
180
|
+
backgroundColor: "transparent",
|
|
181
|
+
border: "none",
|
|
182
|
+
zIndex: 20
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
),
|
|
186
|
+
/* @__PURE__ */ jsx(
|
|
187
|
+
"div",
|
|
188
|
+
{
|
|
189
|
+
className: cn(
|
|
190
|
+
"absolute right-1 z-30 flex items-center gap-0.5 rounded-lg border border-border bg-card p-0.5 shadow-md transition-all duration-150",
|
|
191
|
+
selected || showPalette ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100"
|
|
192
|
+
),
|
|
193
|
+
style: { top: -15 },
|
|
194
|
+
onDoubleClick: (e) => e.stopPropagation(),
|
|
195
|
+
children: showPalette ? /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 px-1 py-0.5", children: Object.entries(STICKY_COLORS).map(([name, hex]) => /* @__PURE__ */ jsx(
|
|
196
|
+
"button",
|
|
197
|
+
{
|
|
198
|
+
type: "button",
|
|
199
|
+
title: name,
|
|
200
|
+
onClick: (e) => {
|
|
201
|
+
e.stopPropagation();
|
|
202
|
+
patchData({ color: name });
|
|
203
|
+
setShowPalette(false);
|
|
204
|
+
},
|
|
205
|
+
className: cn(
|
|
206
|
+
"nodrag size-4 rounded-full border transition-transform hover:scale-125",
|
|
207
|
+
name === colorKey ? "border-foreground" : "border-transparent"
|
|
208
|
+
),
|
|
209
|
+
style: { backgroundColor: hex }
|
|
210
|
+
},
|
|
211
|
+
name
|
|
212
|
+
)) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
213
|
+
/* @__PURE__ */ jsx(ToolbarButton, { title: "Edit note", onClick: startEditing, children: /* @__PURE__ */ jsx(Icon, { icon: "mynaui:edit", className: "size-3.5" }) }),
|
|
214
|
+
/* @__PURE__ */ jsx(
|
|
215
|
+
ToolbarButton,
|
|
216
|
+
{
|
|
217
|
+
title: "Change color",
|
|
218
|
+
onClick: () => setShowPalette(true),
|
|
219
|
+
children: /* @__PURE__ */ jsx(
|
|
220
|
+
"span",
|
|
221
|
+
{
|
|
222
|
+
className: "size-3.5 rounded-full",
|
|
223
|
+
style: { backgroundColor: accent }
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
}
|
|
227
|
+
),
|
|
228
|
+
/* @__PURE__ */ jsx(ToolbarButton, { title: "Duplicate note", onClick: duplicate, children: /* @__PURE__ */ jsx(Icon, { icon: "mynaui:copy", className: "size-3.5" }) }),
|
|
229
|
+
/* @__PURE__ */ jsx(
|
|
230
|
+
ToolbarButton,
|
|
231
|
+
{
|
|
232
|
+
title: "Delete note",
|
|
233
|
+
danger: true,
|
|
234
|
+
onClick: () => deleteNode(id),
|
|
235
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: "mynaui:trash", className: "size-3.5" })
|
|
236
|
+
}
|
|
237
|
+
)
|
|
238
|
+
] })
|
|
239
|
+
}
|
|
240
|
+
),
|
|
241
|
+
/* @__PURE__ */ jsx(
|
|
242
|
+
"div",
|
|
243
|
+
{
|
|
244
|
+
className: "flex h-full w-full flex-col overflow-hidden rounded-lg border",
|
|
245
|
+
style: {
|
|
246
|
+
backgroundColor: `${accent}1F`,
|
|
247
|
+
// Same border whether selected or not — selection shows only via the
|
|
248
|
+
// floating toolbar (no extra border/outline on click).
|
|
249
|
+
borderColor: `${accent}59`
|
|
250
|
+
},
|
|
251
|
+
onDoubleClick: (e) => {
|
|
252
|
+
e.stopPropagation();
|
|
253
|
+
startEditing();
|
|
254
|
+
},
|
|
255
|
+
children: editing ? /* @__PURE__ */ jsx(
|
|
256
|
+
"textarea",
|
|
257
|
+
{
|
|
258
|
+
ref: textareaRef,
|
|
259
|
+
value: draft,
|
|
260
|
+
onChange: (e) => setDraft(e.target.value),
|
|
261
|
+
onBlur: commitEdit,
|
|
262
|
+
onKeyDown: (e) => {
|
|
263
|
+
e.stopPropagation();
|
|
264
|
+
if (e.key === "Escape") cancelEdit();
|
|
265
|
+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) commitEdit();
|
|
266
|
+
},
|
|
267
|
+
placeholder: "# Note\nSupports **markdown** \u2014 headings, lists, links\u2026",
|
|
268
|
+
className: "nodrag nowheel h-full w-full resize-none bg-transparent p-3 font-mono text-xs leading-relaxed text-foreground outline-none placeholder:text-muted-foreground/60"
|
|
269
|
+
}
|
|
270
|
+
) : content.trim() ? /* @__PURE__ */ jsx(
|
|
271
|
+
"div",
|
|
272
|
+
{
|
|
273
|
+
className: cn(
|
|
274
|
+
"nowheel h-full w-full overflow-auto p-3 text-xs leading-relaxed text-foreground",
|
|
275
|
+
// Compact markdown typography scoped to the note body.
|
|
276
|
+
"[&_h1]:mb-1.5 [&_h1]:text-sm [&_h1]:font-bold",
|
|
277
|
+
"[&_h2]:mb-1 [&_h2]:text-[13px] [&_h2]:font-bold",
|
|
278
|
+
"[&_h3]:mb-1 [&_h3]:text-xs [&_h3]:font-semibold",
|
|
279
|
+
"[&_p]:mb-1.5 [&_ul]:mb-1.5 [&_ul]:list-disc [&_ul]:pl-4",
|
|
280
|
+
"[&_ol]:mb-1.5 [&_ol]:list-decimal [&_ol]:pl-4 [&_li]:mb-0.5",
|
|
281
|
+
"[&_a]:underline [&_code]:rounded [&_code]:bg-muted [&_code]:px-1"
|
|
282
|
+
),
|
|
283
|
+
children: /* @__PURE__ */ jsx(Markdown, { children: content })
|
|
284
|
+
}
|
|
285
|
+
) : /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center justify-center p-3 text-xs text-muted-foreground/70", children: "Double-click to edit" })
|
|
286
|
+
}
|
|
287
|
+
)
|
|
288
|
+
] })
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
var StickyNoteNode = memo(StickyNoteNodeComponent);
|
|
292
|
+
function buildStickyNode(position) {
|
|
293
|
+
return {
|
|
294
|
+
id: nanoid(),
|
|
295
|
+
type: STICKY_NOTE_TYPE,
|
|
296
|
+
position,
|
|
297
|
+
width: STICKY_DEFAULT_SIZE.width,
|
|
298
|
+
height: STICKY_DEFAULT_SIZE.height,
|
|
299
|
+
// Render under regular nodes and edges — notes are a background layer.
|
|
300
|
+
zIndex: -1,
|
|
301
|
+
selected: true,
|
|
302
|
+
data: { content: "", color: DEFAULT_STICKY_COLOR }
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
function getNodeDetail(nodeType) {
|
|
306
|
+
const node = NODES.find((node2) => node2.type === nodeType);
|
|
307
|
+
if (!node) {
|
|
308
|
+
return {
|
|
309
|
+
icon: "mynaui:keyboard-solid",
|
|
310
|
+
title: nodeType ?? "Unknown",
|
|
311
|
+
description: "",
|
|
312
|
+
gradientColor: "gray"
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
return node.detail;
|
|
316
|
+
}
|
|
317
|
+
function createNodeData(type, data) {
|
|
318
|
+
return {
|
|
319
|
+
id: nanoid$1(),
|
|
320
|
+
type,
|
|
321
|
+
data
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
function createNodeWithDefaultData(type, data) {
|
|
325
|
+
const defaultData = NODES.find((node) => node.type === type)?.defaultData ?? {};
|
|
326
|
+
return Object.assign(createNodeData(type, defaultData), data);
|
|
327
|
+
}
|
|
71
328
|
var BRAND_ACCENTS = [
|
|
72
329
|
[/gmail|google/, "#ea4335"],
|
|
73
330
|
[/slack/, "#611f69"],
|
|
@@ -154,9 +411,9 @@ var NodeCard = React.forwardRef(
|
|
|
154
411
|
},
|
|
155
412
|
onDoubleClick: (e) => e.stopPropagation(),
|
|
156
413
|
children: [
|
|
157
|
-
onSettings && /* @__PURE__ */ jsx(
|
|
414
|
+
onSettings && /* @__PURE__ */ jsx(ToolbarButton2, { title: "Configure", onClick: onSettings, children: /* @__PURE__ */ jsx(Icon, { icon: "lucide:sliders-horizontal", className: "size-4" }) }),
|
|
158
415
|
onExecute && /* @__PURE__ */ jsx(
|
|
159
|
-
|
|
416
|
+
ToolbarButton2,
|
|
160
417
|
{
|
|
161
418
|
title: "Execute step",
|
|
162
419
|
onClick: onExecute,
|
|
@@ -177,7 +434,7 @@ var NodeCard = React.forwardRef(
|
|
|
177
434
|
}
|
|
178
435
|
),
|
|
179
436
|
infoButton,
|
|
180
|
-
onDelete && /* @__PURE__ */ jsx(
|
|
437
|
+
onDelete && /* @__PURE__ */ jsx(ToolbarButton2, { title: "Delete", onClick: onDelete, children: /* @__PURE__ */ jsx(
|
|
181
438
|
Icon,
|
|
182
439
|
{
|
|
183
440
|
icon: "mynaui:trash",
|
|
@@ -245,7 +502,7 @@ var NodeCard = React.forwardRef(
|
|
|
245
502
|
}
|
|
246
503
|
);
|
|
247
504
|
NodeCard.displayName = "NodeCard";
|
|
248
|
-
function
|
|
505
|
+
function ToolbarButton2({
|
|
249
506
|
title,
|
|
250
507
|
onClick,
|
|
251
508
|
disabled,
|
|
@@ -8471,6 +8728,25 @@ function ArrayField({
|
|
|
8471
8728
|
description && /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: description })
|
|
8472
8729
|
] });
|
|
8473
8730
|
}
|
|
8731
|
+
|
|
8732
|
+
// src/builder/lib/sticky-notes.ts
|
|
8733
|
+
function isStickyNode(node) {
|
|
8734
|
+
return node?.type === STICKY_NOTE_TYPE;
|
|
8735
|
+
}
|
|
8736
|
+
function partitionStickyNotes(nodes) {
|
|
8737
|
+
return {
|
|
8738
|
+
nodes: nodes.filter((n) => !isStickyNode(n)),
|
|
8739
|
+
stickyNotes: nodes.filter((n) => isStickyNode(n))
|
|
8740
|
+
};
|
|
8741
|
+
}
|
|
8742
|
+
function mergeStickyNotes(def) {
|
|
8743
|
+
const nodes = Array.isArray(def.nodes) ? def.nodes : [];
|
|
8744
|
+
const stickies = Array.isArray(def.stickyNotes) ? def.stickyNotes : [];
|
|
8745
|
+
const seen = new Set(nodes.map((n) => n.id));
|
|
8746
|
+
return [...nodes, ...stickies.filter((s) => s?.id && !seen.has(s.id))];
|
|
8747
|
+
}
|
|
8748
|
+
|
|
8749
|
+
// src/builder/hooks/use-save-workflow.ts
|
|
8474
8750
|
function slimNodeDataToCurrentOperation(data) {
|
|
8475
8751
|
const nodeData = data.nodeData;
|
|
8476
8752
|
if (!nodeData) return data;
|
|
@@ -8503,16 +8779,18 @@ function useSaveWorkflow() {
|
|
|
8503
8779
|
}
|
|
8504
8780
|
const isDraft = !workflow.status || workflow.status === "DRAFT";
|
|
8505
8781
|
const client = getFluidGridsClient();
|
|
8782
|
+
const partitioned = partitionStickyNotes(workflow.nodes ?? []);
|
|
8506
8783
|
const preparedWorkflow = {
|
|
8507
8784
|
...workflow,
|
|
8508
|
-
nodes:
|
|
8785
|
+
nodes: partitioned.nodes.map((n) => {
|
|
8509
8786
|
const slimData = slimNodeDataToCurrentOperation(
|
|
8510
8787
|
n.data ?? {}
|
|
8511
8788
|
);
|
|
8512
8789
|
const { nodeData: _slimNodeData, ...flattenedData } = slimData;
|
|
8513
8790
|
void _slimNodeData;
|
|
8514
8791
|
return { ...n, data: slimData, ...flattenedData };
|
|
8515
|
-
})
|
|
8792
|
+
}),
|
|
8793
|
+
stickyNotes: partitioned.stickyNotes
|
|
8516
8794
|
};
|
|
8517
8795
|
const definitionJson = {
|
|
8518
8796
|
key: workflowKey,
|
|
@@ -9411,7 +9689,7 @@ function useNodeExecution() {
|
|
|
9411
9689
|
} catch (error) {
|
|
9412
9690
|
console.error("[useNodeExecution] Error triggering workflow:", error);
|
|
9413
9691
|
const errorMessage = describeOperationError(error);
|
|
9414
|
-
const errorRunId = nanoid();
|
|
9692
|
+
const errorRunId = nanoid$1();
|
|
9415
9693
|
const errorLog = {
|
|
9416
9694
|
id: `${errorRunId}-${stopAtNodeId}`,
|
|
9417
9695
|
runId: errorRunId,
|
|
@@ -9495,7 +9773,7 @@ function useNodeExecution() {
|
|
|
9495
9773
|
} catch (error) {
|
|
9496
9774
|
console.error("[useNodeExecution] Error triggering workflow:", error);
|
|
9497
9775
|
const errorMessage = describeOperationError(error);
|
|
9498
|
-
const errorRunId = nanoid();
|
|
9776
|
+
const errorRunId = nanoid$1();
|
|
9499
9777
|
const errorLog = {
|
|
9500
9778
|
id: `${errorRunId}-${triggerNode.id}`,
|
|
9501
9779
|
runId: errorRunId,
|
|
@@ -10334,6 +10612,7 @@ async function refetchStoreNodes() {
|
|
|
10334
10612
|
if (fallback?.node) {
|
|
10335
10613
|
NODE_TYPES["default"] = fallback.node;
|
|
10336
10614
|
}
|
|
10615
|
+
NODE_TYPES[STICKY_NOTE_TYPE] = StickyNoteNode;
|
|
10337
10616
|
await initializeNodeConfigs();
|
|
10338
10617
|
rebuildNodeArrays();
|
|
10339
10618
|
} catch (error) {
|
|
@@ -10418,6 +10697,7 @@ var fallbackDynamic = getNodeMetadata({ type: "__default_dynamic__" });
|
|
|
10418
10697
|
if (fallbackDynamic?.node) {
|
|
10419
10698
|
NODE_TYPES["default"] = fallbackDynamic.node;
|
|
10420
10699
|
}
|
|
10700
|
+
NODE_TYPES[STICKY_NOTE_TYPE] = StickyNoteNode;
|
|
10421
10701
|
function registerWorkflowNodeTypes(workflowNodes) {
|
|
10422
10702
|
for (const node of workflowNodes) {
|
|
10423
10703
|
if (node.type && !NODE_TYPES[node.type]) {
|
|
@@ -10436,6 +10716,6 @@ function registerWorkflowNodeTypes(workflowNodes) {
|
|
|
10436
10716
|
}
|
|
10437
10717
|
}
|
|
10438
10718
|
|
|
10439
|
-
export { AVAILABLE_NODES, ConfigSchemaForm, ConnectionFormDialog, ConnectionSelector, NODES, NODES_METADATA, NODE_CONFIGS, NODE_TYPES, NodePropertyPanel, ProviderPicker, ensureNodeConfigsLoaded, fetchNodeManifest, getNodeDetail, getNodeMetadata, getProviderForm, isNodeConfigsInitialized, listCustomBlocks, onNodeTypesUpdate, refetchStoreNodes, registerCustomBlock, registerWorkflowNodeTypes, resolveUiSpec, stripSubmitActions, useConnection, useConnectionDialog, useConnections, useConnectionsByProvider, useCreateConnection, useInitiateOAuth, useInsertNode, useNodeExecution, useProviderByKey, useProviderCatalog, useProviders, useSaveWorkflow };
|
|
10440
|
-
//# sourceMappingURL=chunk-
|
|
10441
|
-
//# sourceMappingURL=chunk-
|
|
10719
|
+
export { AVAILABLE_NODES, ConfigSchemaForm, ConnectionFormDialog, ConnectionSelector, NODES, NODES_METADATA, NODE_CONFIGS, NODE_OPERATION_DRAG_DATA_FORMAT, NODE_TYPES, NODE_TYPE_DRAG_DATA_FORMAT, NodePropertyPanel, ProviderPicker, STICKY_NOTE_TYPE, buildStickyNode, ensureNodeConfigsLoaded, fetchNodeManifest, getNodeDetail, getNodeMetadata, getProviderForm, isNodeConfigsInitialized, listCustomBlocks, mergeStickyNotes, onNodeTypesUpdate, refetchStoreNodes, registerCustomBlock, registerWorkflowNodeTypes, resolveUiSpec, stripSubmitActions, useConnection, useConnectionDialog, useConnections, useConnectionsByProvider, useCreateConnection, useInitiateOAuth, useInsertNode, useNodeExecution, useProviderByKey, useProviderCatalog, useProviders, useSaveWorkflow };
|
|
10720
|
+
//# sourceMappingURL=chunk-TH764V3S.js.map
|
|
10721
|
+
//# sourceMappingURL=chunk-TH764V3S.js.map
|