@cogentic-co/ds 0.4.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/LICENSE +21 -0
- package/README.md +139 -0
- package/dist/animations/animation-ai-analysis.d.ts +7 -0
- package/dist/animations/animation-ai-analysis.js +7 -0
- package/dist/animations/animation-ai-analysis.js.map +1 -0
- package/dist/animations/animation-audit-trail.d.ts +7 -0
- package/dist/animations/animation-audit-trail.js +5 -0
- package/dist/animations/animation-audit-trail.js.map +1 -0
- package/dist/animations/animation-compliance-reports.d.ts +7 -0
- package/dist/animations/animation-compliance-reports.js +7 -0
- package/dist/animations/animation-compliance-reports.js.map +1 -0
- package/dist/animations/animation-custom-rules.d.ts +7 -0
- package/dist/animations/animation-custom-rules.js +7 -0
- package/dist/animations/animation-custom-rules.js.map +1 -0
- package/dist/animations/animation-jira-ticket.d.ts +7 -0
- package/dist/animations/animation-jira-ticket.js +6 -0
- package/dist/animations/animation-jira-ticket.js.map +1 -0
- package/dist/animations/animation-jurisdiction-detection.d.ts +7 -0
- package/dist/animations/animation-jurisdiction-detection.js +7 -0
- package/dist/animations/animation-jurisdiction-detection.js.map +1 -0
- package/dist/animations/animation-multi-protocol.d.ts +7 -0
- package/dist/animations/animation-multi-protocol.js +5 -0
- package/dist/animations/animation-multi-protocol.js.map +1 -0
- package/dist/animations/animation-pricing-preview.d.ts +16 -0
- package/dist/animations/animation-pricing-preview.js +7 -0
- package/dist/animations/animation-pricing-preview.js.map +1 -0
- package/dist/animations/animation-realtime-updates.d.ts +7 -0
- package/dist/animations/animation-realtime-updates.js +8 -0
- package/dist/animations/animation-realtime-updates.js.map +1 -0
- package/dist/animations/animation-rest-api.d.ts +7 -0
- package/dist/animations/animation-rest-api.js +5 -0
- package/dist/animations/animation-rest-api.js.map +1 -0
- package/dist/animations/animation-risk-scoring.d.ts +7 -0
- package/dist/animations/animation-risk-scoring.js +8 -0
- package/dist/animations/animation-risk-scoring.js.map +1 -0
- package/dist/animations/animation-sandbox.d.ts +7 -0
- package/dist/animations/animation-sandbox.js +5 -0
- package/dist/animations/animation-sandbox.js.map +1 -0
- package/dist/animations/animation-scheduled-reports.d.ts +7 -0
- package/dist/animations/animation-scheduled-reports.js +7 -0
- package/dist/animations/animation-scheduled-reports.js.map +1 -0
- package/dist/animations/animation-secure-messaging.d.ts +7 -0
- package/dist/animations/animation-secure-messaging.js +6 -0
- package/dist/animations/animation-secure-messaging.js.map +1 -0
- package/dist/animations/animation-slack-notification.d.ts +7 -0
- package/dist/animations/animation-slack-notification.js +6 -0
- package/dist/animations/animation-slack-notification.js.map +1 -0
- package/dist/animations/animation-sop-mapping.d.ts +7 -0
- package/dist/animations/animation-sop-mapping.js +5 -0
- package/dist/animations/animation-sop-mapping.js.map +1 -0
- package/dist/animations/animation-team-routing.d.ts +7 -0
- package/dist/animations/animation-team-routing.js +7 -0
- package/dist/animations/animation-team-routing.js.map +1 -0
- package/dist/animations/animation-teams-notification.d.ts +7 -0
- package/dist/animations/animation-teams-notification.js +6 -0
- package/dist/animations/animation-teams-notification.js.map +1 -0
- package/dist/animations/animation-vasp-identification.d.ts +7 -0
- package/dist/animations/animation-vasp-identification.js +7 -0
- package/dist/animations/animation-vasp-identification.js.map +1 -0
- package/dist/animations/animation-webhooks.d.ts +7 -0
- package/dist/animations/animation-webhooks.js +6 -0
- package/dist/animations/animation-webhooks.js.map +1 -0
- package/dist/blocks/auth-form.d.ts +18 -0
- package/dist/blocks/auth-form.js +7 -0
- package/dist/blocks/auth-form.js.map +1 -0
- package/dist/blocks/feature-section.d.ts +17 -0
- package/dist/blocks/feature-section.js +5 -0
- package/dist/blocks/feature-section.js.map +1 -0
- package/dist/blocks/hero-section.d.ts +19 -0
- package/dist/blocks/hero-section.js +5 -0
- package/dist/blocks/hero-section.js.map +1 -0
- package/dist/blocks/pricing-table.d.ts +24 -0
- package/dist/blocks/pricing-table.js +6 -0
- package/dist/blocks/pricing-table.js.map +1 -0
- package/dist/blocks/stat-card.d.ts +15 -0
- package/dist/blocks/stat-card.js +6 -0
- package/dist/blocks/stat-card.js.map +1 -0
- package/dist/card-Cumdyf_G.d.ts +15 -0
- package/dist/charts.d.ts +4 -0
- package/dist/charts.js +5 -0
- package/dist/charts.js.map +1 -0
- package/dist/chatbot.d.ts +280 -0
- package/dist/chatbot.js +2202 -0
- package/dist/chatbot.js.map +1 -0
- package/dist/chunk-4NEQV6H2.js +39 -0
- package/dist/chunk-4NEQV6H2.js.map +1 -0
- package/dist/chunk-4YD3YS4B.js +110 -0
- package/dist/chunk-4YD3YS4B.js.map +1 -0
- package/dist/chunk-5JLZ42JT.js +125 -0
- package/dist/chunk-5JLZ42JT.js.map +1 -0
- package/dist/chunk-5OOO6TRA.js +111 -0
- package/dist/chunk-5OOO6TRA.js.map +1 -0
- package/dist/chunk-65Z2VEKG.js +161 -0
- package/dist/chunk-65Z2VEKG.js.map +1 -0
- package/dist/chunk-6RWCZUAD.js +12 -0
- package/dist/chunk-6RWCZUAD.js.map +1 -0
- package/dist/chunk-7HRPF2N2.js +56 -0
- package/dist/chunk-7HRPF2N2.js.map +1 -0
- package/dist/chunk-BNFSXNP2.js +71 -0
- package/dist/chunk-BNFSXNP2.js.map +1 -0
- package/dist/chunk-BTFYV3TI.js +102 -0
- package/dist/chunk-BTFYV3TI.js.map +1 -0
- package/dist/chunk-BTZB4JRC.js +117 -0
- package/dist/chunk-BTZB4JRC.js.map +1 -0
- package/dist/chunk-BZSA47MS.js +121 -0
- package/dist/chunk-BZSA47MS.js.map +1 -0
- package/dist/chunk-CG5JA7FM.js +107 -0
- package/dist/chunk-CG5JA7FM.js.map +1 -0
- package/dist/chunk-EFLWU2JP.js +145 -0
- package/dist/chunk-EFLWU2JP.js.map +1 -0
- package/dist/chunk-F7REPQOA.js +93 -0
- package/dist/chunk-F7REPQOA.js.map +1 -0
- package/dist/chunk-FKPK3CB7.js +143 -0
- package/dist/chunk-FKPK3CB7.js.map +1 -0
- package/dist/chunk-GZNLQE3I.js +55 -0
- package/dist/chunk-GZNLQE3I.js.map +1 -0
- package/dist/chunk-H7VUIMEL.js +172 -0
- package/dist/chunk-H7VUIMEL.js.map +1 -0
- package/dist/chunk-HTYR73ON.js +161 -0
- package/dist/chunk-HTYR73ON.js.map +1 -0
- package/dist/chunk-I26ZXVSY.js +124 -0
- package/dist/chunk-I26ZXVSY.js.map +1 -0
- package/dist/chunk-IKATDPHG.js +92 -0
- package/dist/chunk-IKATDPHG.js.map +1 -0
- package/dist/chunk-KUOF3XRZ.js +108 -0
- package/dist/chunk-KUOF3XRZ.js.map +1 -0
- package/dist/chunk-LW6GAWZM.js +148 -0
- package/dist/chunk-LW6GAWZM.js.map +1 -0
- package/dist/chunk-N7PBUY7G.js +110 -0
- package/dist/chunk-N7PBUY7G.js.map +1 -0
- package/dist/chunk-NAPDFVBI.js +102 -0
- package/dist/chunk-NAPDFVBI.js.map +1 -0
- package/dist/chunk-RTK7R4KZ.js +66 -0
- package/dist/chunk-RTK7R4KZ.js.map +1 -0
- package/dist/chunk-RXV2XUDZ.js +31 -0
- package/dist/chunk-RXV2XUDZ.js.map +1 -0
- package/dist/chunk-RZZTDJHG.js +110 -0
- package/dist/chunk-RZZTDJHG.js.map +1 -0
- package/dist/chunk-SNOJLZP4.js +197 -0
- package/dist/chunk-SNOJLZP4.js.map +1 -0
- package/dist/chunk-TAPJEVUA.js +24 -0
- package/dist/chunk-TAPJEVUA.js.map +1 -0
- package/dist/chunk-U4EPKN7G.js +518 -0
- package/dist/chunk-U4EPKN7G.js.map +1 -0
- package/dist/chunk-VWSX75RB.js +202 -0
- package/dist/chunk-VWSX75RB.js.map +1 -0
- package/dist/chunk-XFWKI45G.js +800 -0
- package/dist/chunk-XFWKI45G.js.map +1 -0
- package/dist/chunk-XQYFQ6PU.js +77 -0
- package/dist/chunk-XQYFQ6PU.js.map +1 -0
- package/dist/index-CcPuHWa-.d.ts +118 -0
- package/dist/index.d.ts +1385 -0
- package/dist/index.js +8673 -0
- package/dist/index.js.map +1 -0
- package/dist/workflow.d.ts +165 -0
- package/dist/workflow.js +5 -0
- package/dist/workflow.js.map +1 -0
- package/package.json +157 -0
- package/src/styles/globals.css +211 -0
|
@@ -0,0 +1,800 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn, __objRest, __spreadProps, __spreadValues } from './chunk-GZNLQE3I.js';
|
|
3
|
+
import { ReactFlow, Background, Controls, getBezierPath, BaseEdge, getSimpleBezierPath, Handle, Position, MiniMap, Panel, NodeToolbar } from '@xyflow/react';
|
|
4
|
+
import '@xyflow/react/dist/style.css';
|
|
5
|
+
import { createContext, Component, useState, useContext } from 'react';
|
|
6
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
import { cva } from 'class-variance-authority';
|
|
8
|
+
import { GripVertical, ChevronDown, ChevronUp, Plus } from 'lucide-react';
|
|
9
|
+
|
|
10
|
+
var WorkflowContext = createContext("vertical");
|
|
11
|
+
function useWorkflowLayout() {
|
|
12
|
+
return useContext(WorkflowContext);
|
|
13
|
+
}
|
|
14
|
+
var deleteKeyCode = ["Backspace", "Delete"];
|
|
15
|
+
function Canvas(_a) {
|
|
16
|
+
var _b = _a, { children, className, layout = "vertical" } = _b, props = __objRest(_b, ["children", "className", "layout"]);
|
|
17
|
+
return /* @__PURE__ */ jsx(WorkflowContext, { value: layout, children: /* @__PURE__ */ jsxs(
|
|
18
|
+
ReactFlow,
|
|
19
|
+
__spreadProps(__spreadValues({
|
|
20
|
+
"data-slot": "canvas",
|
|
21
|
+
deleteKeyCode,
|
|
22
|
+
fitView: true,
|
|
23
|
+
panOnDrag: false,
|
|
24
|
+
panOnScroll: true,
|
|
25
|
+
selectionOnDrag: true,
|
|
26
|
+
zoomOnDoubleClick: false,
|
|
27
|
+
className: cn("", className)
|
|
28
|
+
}, props), {
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx(Background, { bgColor: "var(--color-sidebar)" }),
|
|
31
|
+
children
|
|
32
|
+
]
|
|
33
|
+
})
|
|
34
|
+
) });
|
|
35
|
+
}
|
|
36
|
+
var workflowConnectionVariants = cva("", {
|
|
37
|
+
variants: {
|
|
38
|
+
variant: {
|
|
39
|
+
default: "",
|
|
40
|
+
dotted: "",
|
|
41
|
+
dashed: "",
|
|
42
|
+
animated: ""
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: { variant: "default" }
|
|
46
|
+
});
|
|
47
|
+
var strokeDash = {
|
|
48
|
+
default: void 0,
|
|
49
|
+
dotted: "2, 6",
|
|
50
|
+
dashed: "12, 6",
|
|
51
|
+
animated: void 0
|
|
52
|
+
};
|
|
53
|
+
function createConnectionLine(variant) {
|
|
54
|
+
const ConnectionLine = ({ fromX, fromY, toX, toY }) => {
|
|
55
|
+
const dx = Math.abs(toX - fromX);
|
|
56
|
+
const dy = Math.abs(toY - fromY);
|
|
57
|
+
const isVertical = dy > dx;
|
|
58
|
+
const path = isVertical ? `M${fromX},${fromY} C ${fromX},${fromY + (toY - fromY) * 0.5} ${toX},${fromY + (toY - fromY) * 0.5} ${toX},${toY}` : `M${fromX},${fromY} C ${fromX + (toX - fromX) * 0.5},${fromY} ${fromX + (toX - fromX) * 0.5},${toY} ${toX},${toY}`;
|
|
59
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
60
|
+
/* @__PURE__ */ jsx(
|
|
61
|
+
"path",
|
|
62
|
+
{
|
|
63
|
+
d: path,
|
|
64
|
+
fill: "none",
|
|
65
|
+
stroke: "var(--color-ring)",
|
|
66
|
+
strokeWidth: 2,
|
|
67
|
+
strokeDasharray: strokeDash[variant],
|
|
68
|
+
strokeLinecap: variant === "dotted" ? "round" : void 0
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
variant === "animated" && /* @__PURE__ */ jsx("circle", { fill: "var(--color-primary)", r: 3, children: /* @__PURE__ */ jsx("animateMotion", { dur: "1s", path, repeatCount: "indefinite" }) }),
|
|
72
|
+
/* @__PURE__ */ jsx(
|
|
73
|
+
"circle",
|
|
74
|
+
{
|
|
75
|
+
cx: toX,
|
|
76
|
+
cy: toY,
|
|
77
|
+
fill: "var(--color-card)",
|
|
78
|
+
r: 4,
|
|
79
|
+
stroke: "var(--color-ring)",
|
|
80
|
+
strokeWidth: 2
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
] });
|
|
84
|
+
};
|
|
85
|
+
return ConnectionLine;
|
|
86
|
+
}
|
|
87
|
+
var WorkflowConnection = createConnectionLine("default");
|
|
88
|
+
var WorkflowConnectionDotted = createConnectionLine("dotted");
|
|
89
|
+
var WorkflowConnectionDashed = createConnectionLine("dashed");
|
|
90
|
+
var WorkflowConnectionAnimated = createConnectionLine("animated");
|
|
91
|
+
function WorkflowControls(_a) {
|
|
92
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
93
|
+
return /* @__PURE__ */ jsx(
|
|
94
|
+
Controls,
|
|
95
|
+
__spreadValues({
|
|
96
|
+
"data-slot": "workflow-controls",
|
|
97
|
+
className: cn(
|
|
98
|
+
"gap-px overflow-hidden rounded-md border bg-card p-1 shadow-none!",
|
|
99
|
+
"[&>button]:rounded-md [&>button]:border-none! [&>button]:bg-transparent! [&>button]:hover:bg-secondary!",
|
|
100
|
+
className
|
|
101
|
+
)
|
|
102
|
+
}, props)
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
var variantStyles = {
|
|
106
|
+
solid: {},
|
|
107
|
+
dotted: { strokeDasharray: "3, 6", strokeLinecap: "round" },
|
|
108
|
+
dashed: { strokeDasharray: "8, 4" },
|
|
109
|
+
animated: {}
|
|
110
|
+
};
|
|
111
|
+
function SolidEdge({
|
|
112
|
+
id,
|
|
113
|
+
sourceX,
|
|
114
|
+
sourceY,
|
|
115
|
+
targetX,
|
|
116
|
+
targetY,
|
|
117
|
+
sourcePosition,
|
|
118
|
+
targetPosition,
|
|
119
|
+
data,
|
|
120
|
+
markerEnd,
|
|
121
|
+
style
|
|
122
|
+
}) {
|
|
123
|
+
var _a;
|
|
124
|
+
const variant = (_a = data == null ? void 0 : data.variant) != null ? _a : "solid";
|
|
125
|
+
const color = data == null ? void 0 : data.color;
|
|
126
|
+
const strokeColor = color != null ? color : "var(--color-muted-foreground)";
|
|
127
|
+
const markerId = `arrow-${id}`;
|
|
128
|
+
const resolvedMarkerEnd = (data == null ? void 0 : data.arrow) ? `url(#${markerId})` : markerEnd;
|
|
129
|
+
const [edgePath, labelX, labelY] = getBezierPath({
|
|
130
|
+
sourceX,
|
|
131
|
+
sourceY,
|
|
132
|
+
targetX,
|
|
133
|
+
targetY,
|
|
134
|
+
sourcePosition,
|
|
135
|
+
targetPosition
|
|
136
|
+
});
|
|
137
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
138
|
+
(data == null ? void 0 : data.arrow) && /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
|
|
139
|
+
"marker",
|
|
140
|
+
{
|
|
141
|
+
id: markerId,
|
|
142
|
+
markerWidth: "12",
|
|
143
|
+
markerHeight: "12",
|
|
144
|
+
refX: "10",
|
|
145
|
+
refY: "6",
|
|
146
|
+
orient: "auto",
|
|
147
|
+
markerUnits: "userSpaceOnUse",
|
|
148
|
+
children: /* @__PURE__ */ jsx("path", { d: "M2,2 L10,6 L2,10 Z", fill: strokeColor })
|
|
149
|
+
}
|
|
150
|
+
) }),
|
|
151
|
+
/* @__PURE__ */ jsx(
|
|
152
|
+
BaseEdge,
|
|
153
|
+
{
|
|
154
|
+
id,
|
|
155
|
+
path: edgePath,
|
|
156
|
+
markerEnd: resolvedMarkerEnd,
|
|
157
|
+
className: "!stroke-muted-foreground/50",
|
|
158
|
+
style: __spreadValues(__spreadValues(__spreadValues({
|
|
159
|
+
strokeWidth: 2
|
|
160
|
+
}, variantStyles[variant]), color ? { stroke: color } : {}), style)
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
(data == null ? void 0 : data.label) && /* @__PURE__ */ jsx(
|
|
164
|
+
"foreignObject",
|
|
165
|
+
{
|
|
166
|
+
x: labelX - 40,
|
|
167
|
+
y: labelY - 10,
|
|
168
|
+
width: 80,
|
|
169
|
+
height: 20,
|
|
170
|
+
className: "pointer-events-none",
|
|
171
|
+
children: /* @__PURE__ */ jsx("span", { className: "flex items-center justify-center rounded-full bg-card px-2 py-0.5 font-medium text-[10px] text-muted-foreground ring-1 ring-border", children: data.label })
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
] });
|
|
175
|
+
}
|
|
176
|
+
function DottedEdge(props) {
|
|
177
|
+
return /* @__PURE__ */ jsx(SolidEdge, __spreadProps(__spreadValues({}, props), { data: __spreadProps(__spreadValues({}, props.data), { variant: "dotted" }) }));
|
|
178
|
+
}
|
|
179
|
+
function DashedEdge(props) {
|
|
180
|
+
return /* @__PURE__ */ jsx(SolidEdge, __spreadProps(__spreadValues({}, props), { data: __spreadProps(__spreadValues({}, props.data), { variant: "dashed" }) }));
|
|
181
|
+
}
|
|
182
|
+
function TemporaryEdge({
|
|
183
|
+
id,
|
|
184
|
+
sourceX,
|
|
185
|
+
sourceY,
|
|
186
|
+
targetX,
|
|
187
|
+
targetY,
|
|
188
|
+
sourcePosition,
|
|
189
|
+
targetPosition
|
|
190
|
+
}) {
|
|
191
|
+
const [edgePath] = getSimpleBezierPath({
|
|
192
|
+
sourcePosition,
|
|
193
|
+
sourceX,
|
|
194
|
+
sourceY,
|
|
195
|
+
targetPosition,
|
|
196
|
+
targetX,
|
|
197
|
+
targetY
|
|
198
|
+
});
|
|
199
|
+
return /* @__PURE__ */ jsx(
|
|
200
|
+
BaseEdge,
|
|
201
|
+
{
|
|
202
|
+
className: "!stroke-ring",
|
|
203
|
+
id,
|
|
204
|
+
path: edgePath,
|
|
205
|
+
style: { strokeWidth: 2, strokeDasharray: "5, 5" }
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
function AnimatedEdge({
|
|
210
|
+
id,
|
|
211
|
+
sourceX,
|
|
212
|
+
sourceY,
|
|
213
|
+
targetX,
|
|
214
|
+
targetY,
|
|
215
|
+
sourcePosition,
|
|
216
|
+
targetPosition,
|
|
217
|
+
markerEnd,
|
|
218
|
+
style,
|
|
219
|
+
data
|
|
220
|
+
}) {
|
|
221
|
+
const color = data == null ? void 0 : data.color;
|
|
222
|
+
const strokeColor = color != null ? color : "var(--color-primary)";
|
|
223
|
+
const markerId = `arrow-${id}`;
|
|
224
|
+
const resolvedMarkerEnd = (data == null ? void 0 : data.arrow) ? `url(#${markerId})` : markerEnd;
|
|
225
|
+
const [edgePath] = getBezierPath({
|
|
226
|
+
sourceX,
|
|
227
|
+
sourceY,
|
|
228
|
+
targetX,
|
|
229
|
+
targetY,
|
|
230
|
+
sourcePosition,
|
|
231
|
+
targetPosition
|
|
232
|
+
});
|
|
233
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
234
|
+
(data == null ? void 0 : data.arrow) && /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
|
|
235
|
+
"marker",
|
|
236
|
+
{
|
|
237
|
+
id: markerId,
|
|
238
|
+
markerWidth: "12",
|
|
239
|
+
markerHeight: "12",
|
|
240
|
+
refX: "10",
|
|
241
|
+
refY: "6",
|
|
242
|
+
orient: "auto",
|
|
243
|
+
markerUnits: "userSpaceOnUse",
|
|
244
|
+
children: /* @__PURE__ */ jsx("path", { d: "M2,2 L10,6 L2,10 Z", fill: strokeColor })
|
|
245
|
+
}
|
|
246
|
+
) }),
|
|
247
|
+
/* @__PURE__ */ jsx(
|
|
248
|
+
BaseEdge,
|
|
249
|
+
{
|
|
250
|
+
id,
|
|
251
|
+
markerEnd: resolvedMarkerEnd,
|
|
252
|
+
path: edgePath,
|
|
253
|
+
className: "!stroke-primary/40",
|
|
254
|
+
style: __spreadValues(__spreadValues({ strokeWidth: 2 }, color ? { stroke: color } : {}), style)
|
|
255
|
+
}
|
|
256
|
+
),
|
|
257
|
+
/* @__PURE__ */ jsx("circle", { fill: strokeColor, r: "4", children: /* @__PURE__ */ jsx("animateMotion", { dur: "2s", path: edgePath, repeatCount: "indefinite" }) })
|
|
258
|
+
] });
|
|
259
|
+
}
|
|
260
|
+
var WorkflowEdge = {
|
|
261
|
+
Solid: SolidEdge,
|
|
262
|
+
Dotted: DottedEdge,
|
|
263
|
+
Dashed: DashedEdge,
|
|
264
|
+
Animated: AnimatedEdge,
|
|
265
|
+
Temporary: TemporaryEdge
|
|
266
|
+
};
|
|
267
|
+
var HandleBoundary = class extends Component {
|
|
268
|
+
constructor() {
|
|
269
|
+
super(...arguments);
|
|
270
|
+
this.state = { hasError: false };
|
|
271
|
+
}
|
|
272
|
+
static getDerivedStateFromError() {
|
|
273
|
+
return { hasError: true };
|
|
274
|
+
}
|
|
275
|
+
componentDidCatch(_, __) {
|
|
276
|
+
}
|
|
277
|
+
render() {
|
|
278
|
+
if (this.state.hasError) return null;
|
|
279
|
+
return this.props.children;
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
var workflowGateVariants = cva(
|
|
283
|
+
[
|
|
284
|
+
"group/gate relative flex items-center justify-center",
|
|
285
|
+
"bg-card overflow-visible",
|
|
286
|
+
"transition-shadow duration-150"
|
|
287
|
+
].join(" "),
|
|
288
|
+
{
|
|
289
|
+
variants: {
|
|
290
|
+
type: {
|
|
291
|
+
"if-else": "size-14 rotate-45 rounded-lg ring-2 ring-amber-400 dark:ring-amber-500",
|
|
292
|
+
switch: "size-14 rotate-45 rounded-lg ring-2 ring-violet-400 dark:ring-violet-500",
|
|
293
|
+
merge: "size-14 rotate-45 rounded-lg ring-2 ring-sky-400 dark:ring-sky-500",
|
|
294
|
+
delay: "size-14 rounded-full ring-2 ring-orange-400 dark:ring-orange-500",
|
|
295
|
+
end: "size-10 rounded-full ring-2 ring-red-400 dark:ring-red-500"
|
|
296
|
+
},
|
|
297
|
+
selected: {
|
|
298
|
+
true: "ring-[3px] ring-primary shadow-md",
|
|
299
|
+
false: ""
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
defaultVariants: { type: "if-else", selected: false }
|
|
303
|
+
}
|
|
304
|
+
);
|
|
305
|
+
var iconColor = {
|
|
306
|
+
"if-else": "text-amber-500 dark:text-amber-400",
|
|
307
|
+
switch: "text-violet-500 dark:text-violet-400",
|
|
308
|
+
merge: "text-sky-500 dark:text-sky-400",
|
|
309
|
+
delay: "text-orange-500 dark:text-orange-400",
|
|
310
|
+
end: "text-red-500 dark:text-red-400"
|
|
311
|
+
};
|
|
312
|
+
var branchLabelColor = {
|
|
313
|
+
"if-else": "border-emerald-300 bg-emerald-50 text-emerald-700 dark:border-emerald-600 dark:bg-emerald-950/40 dark:text-emerald-400",
|
|
314
|
+
switch: "border-violet-300 bg-violet-50 text-violet-700 dark:border-violet-600 dark:bg-violet-950/40 dark:text-violet-400",
|
|
315
|
+
merge: "border-sky-300 bg-sky-50 text-sky-700 dark:border-sky-600 dark:bg-sky-950/40 dark:text-sky-400",
|
|
316
|
+
delay: "border-orange-300 bg-orange-50 text-orange-700 dark:border-orange-600 dark:bg-orange-950/40 dark:text-orange-400",
|
|
317
|
+
end: "border-red-300 bg-red-50 text-red-700 dark:border-red-600 dark:bg-red-950/40 dark:text-red-400"
|
|
318
|
+
};
|
|
319
|
+
function BranchLabel({
|
|
320
|
+
children,
|
|
321
|
+
side,
|
|
322
|
+
type
|
|
323
|
+
}) {
|
|
324
|
+
var _a;
|
|
325
|
+
return /* @__PURE__ */ jsx(
|
|
326
|
+
"span",
|
|
327
|
+
{
|
|
328
|
+
className: cn(
|
|
329
|
+
"absolute top-1/2 -translate-y-1/2 whitespace-nowrap",
|
|
330
|
+
"rounded-md border px-2.5 py-1 font-semibold text-[11px]",
|
|
331
|
+
(_a = branchLabelColor[type]) != null ? _a : branchLabelColor["if-else"],
|
|
332
|
+
side === "left" ? "right-full mr-4" : "left-full ml-4"
|
|
333
|
+
),
|
|
334
|
+
children
|
|
335
|
+
}
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
var handleClassName = cn(
|
|
339
|
+
"!size-2.5 !rounded-full !border-[1.5px] !border-card !bg-muted-foreground/60",
|
|
340
|
+
"hover:!bg-primary !transition-colors"
|
|
341
|
+
);
|
|
342
|
+
function WorkflowGate(_a) {
|
|
343
|
+
var _b = _a, {
|
|
344
|
+
type = "if-else",
|
|
345
|
+
selected,
|
|
346
|
+
label,
|
|
347
|
+
icon,
|
|
348
|
+
handles,
|
|
349
|
+
branches,
|
|
350
|
+
className
|
|
351
|
+
} = _b, props = __objRest(_b, [
|
|
352
|
+
"type",
|
|
353
|
+
"selected",
|
|
354
|
+
"label",
|
|
355
|
+
"icon",
|
|
356
|
+
"handles",
|
|
357
|
+
"branches",
|
|
358
|
+
"className"
|
|
359
|
+
]);
|
|
360
|
+
const isRotated = type === "if-else" || type === "switch" || type === "merge";
|
|
361
|
+
const gateType = type != null ? type : "if-else";
|
|
362
|
+
let layout = "vertical";
|
|
363
|
+
try {
|
|
364
|
+
layout = useWorkflowLayout();
|
|
365
|
+
} catch (e) {
|
|
366
|
+
}
|
|
367
|
+
return /* @__PURE__ */ jsxs(
|
|
368
|
+
"div",
|
|
369
|
+
__spreadProps(__spreadValues({
|
|
370
|
+
"data-slot": "workflow-gate",
|
|
371
|
+
"data-gate-type": gateType,
|
|
372
|
+
className: cn("relative flex items-center justify-center", className)
|
|
373
|
+
}, props), {
|
|
374
|
+
children: [
|
|
375
|
+
/* @__PURE__ */ jsx("div", { className: cn(workflowGateVariants({ type, selected })), children: /* @__PURE__ */ jsxs(
|
|
376
|
+
"div",
|
|
377
|
+
{
|
|
378
|
+
className: cn(
|
|
379
|
+
"flex flex-col items-center justify-center gap-0.5",
|
|
380
|
+
isRotated && "-rotate-45"
|
|
381
|
+
),
|
|
382
|
+
children: [
|
|
383
|
+
icon && /* @__PURE__ */ jsx("span", { className: cn("[&>svg]:size-5", iconColor[gateType]), children: icon }),
|
|
384
|
+
label && !icon && /* @__PURE__ */ jsx(
|
|
385
|
+
"span",
|
|
386
|
+
{
|
|
387
|
+
className: cn("font-bold text-[9px] uppercase tracking-wider", iconColor[gateType]),
|
|
388
|
+
children: label
|
|
389
|
+
}
|
|
390
|
+
)
|
|
391
|
+
]
|
|
392
|
+
}
|
|
393
|
+
) }),
|
|
394
|
+
(branches == null ? void 0 : branches.left) && /* @__PURE__ */ jsx(BranchLabel, { side: "left", type: gateType, children: branches.left }),
|
|
395
|
+
(branches == null ? void 0 : branches.right) && /* @__PURE__ */ jsx(BranchLabel, { side: "right", type: gateType, children: branches.right }),
|
|
396
|
+
(handles == null ? void 0 : handles.top) && /* @__PURE__ */ jsx(HandleBoundary, { children: /* @__PURE__ */ jsx(
|
|
397
|
+
Handle,
|
|
398
|
+
{
|
|
399
|
+
type: "target",
|
|
400
|
+
position: layout === "horizontal" ? Position.Left : Position.Top,
|
|
401
|
+
className: handleClassName
|
|
402
|
+
}
|
|
403
|
+
) }),
|
|
404
|
+
(handles == null ? void 0 : handles.bottom) && /* @__PURE__ */ jsx(HandleBoundary, { children: /* @__PURE__ */ jsx(
|
|
405
|
+
Handle,
|
|
406
|
+
{
|
|
407
|
+
type: "source",
|
|
408
|
+
position: layout === "horizontal" ? Position.Right : Position.Bottom,
|
|
409
|
+
className: handleClassName
|
|
410
|
+
}
|
|
411
|
+
) }),
|
|
412
|
+
(handles == null ? void 0 : handles.left) && /* @__PURE__ */ jsx(HandleBoundary, { children: /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Left, id: "left", className: handleClassName }) }),
|
|
413
|
+
(handles == null ? void 0 : handles.right) && /* @__PURE__ */ jsx(HandleBoundary, { children: /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Right, id: "right", className: handleClassName }) })
|
|
414
|
+
]
|
|
415
|
+
})
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
var workflowGroupVariants = cva(
|
|
419
|
+
["relative rounded-2xl border-2 border-dashed p-4 pt-8", "transition-shadow duration-150"].join(
|
|
420
|
+
" "
|
|
421
|
+
),
|
|
422
|
+
{
|
|
423
|
+
variants: {
|
|
424
|
+
variant: {
|
|
425
|
+
default: "border-border/50 bg-muted/20",
|
|
426
|
+
primary: "border-primary/30 bg-primary/5",
|
|
427
|
+
success: "border-emerald-400/30 bg-emerald-50/30 dark:bg-emerald-950/10",
|
|
428
|
+
warning: "border-amber-400/30 bg-amber-50/30 dark:bg-amber-950/10"
|
|
429
|
+
},
|
|
430
|
+
selected: {
|
|
431
|
+
true: "border-primary/60 shadow-md",
|
|
432
|
+
false: ""
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
defaultVariants: { variant: "default", selected: false }
|
|
436
|
+
}
|
|
437
|
+
);
|
|
438
|
+
function WorkflowGroup(_a) {
|
|
439
|
+
var _b = _a, {
|
|
440
|
+
variant,
|
|
441
|
+
selected,
|
|
442
|
+
label,
|
|
443
|
+
icon,
|
|
444
|
+
className,
|
|
445
|
+
children
|
|
446
|
+
} = _b, props = __objRest(_b, [
|
|
447
|
+
"variant",
|
|
448
|
+
"selected",
|
|
449
|
+
"label",
|
|
450
|
+
"icon",
|
|
451
|
+
"className",
|
|
452
|
+
"children"
|
|
453
|
+
]);
|
|
454
|
+
return /* @__PURE__ */ jsxs(
|
|
455
|
+
"div",
|
|
456
|
+
__spreadProps(__spreadValues({
|
|
457
|
+
"data-slot": "workflow-group",
|
|
458
|
+
className: cn(workflowGroupVariants({ variant, selected }), className)
|
|
459
|
+
}, props), {
|
|
460
|
+
children: [
|
|
461
|
+
(label || icon) && /* @__PURE__ */ jsxs("div", { className: "absolute -top-3 left-4 inline-flex items-center gap-1.5 rounded-md bg-card px-2.5 py-1 font-semibold text-muted-foreground text-xs shadow-sm ring-1 ring-border", children: [
|
|
462
|
+
icon && /* @__PURE__ */ jsx("span", { className: "[&>svg]:size-3.5", children: icon }),
|
|
463
|
+
label
|
|
464
|
+
] }),
|
|
465
|
+
children
|
|
466
|
+
]
|
|
467
|
+
})
|
|
468
|
+
);
|
|
469
|
+
}
|
|
470
|
+
var HandleBoundary2 = class extends Component {
|
|
471
|
+
constructor() {
|
|
472
|
+
super(...arguments);
|
|
473
|
+
this.state = { hasError: false };
|
|
474
|
+
}
|
|
475
|
+
static getDerivedStateFromError() {
|
|
476
|
+
return { hasError: true };
|
|
477
|
+
}
|
|
478
|
+
componentDidCatch(_, __) {
|
|
479
|
+
}
|
|
480
|
+
render() {
|
|
481
|
+
if (this.state.hasError) return null;
|
|
482
|
+
return this.props.children;
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
var handleBase = "!size-2.5 !rounded-full !border-[1.5px] !border-card !bg-muted-foreground/60 hover:!bg-primary !transition-colors";
|
|
486
|
+
function WorkflowHandle(_a) {
|
|
487
|
+
var _b = _a, { type, position, className } = _b, props = __objRest(_b, ["type", "position", "className"]);
|
|
488
|
+
let layout = "vertical";
|
|
489
|
+
try {
|
|
490
|
+
layout = useWorkflowLayout();
|
|
491
|
+
} catch (e) {
|
|
492
|
+
}
|
|
493
|
+
const resolvedPosition = position != null ? position : type === "source" ? layout === "horizontal" ? Position.Right : Position.Bottom : layout === "horizontal" ? Position.Left : Position.Top;
|
|
494
|
+
return /* @__PURE__ */ jsx(HandleBoundary2, { children: /* @__PURE__ */ jsx(
|
|
495
|
+
Handle,
|
|
496
|
+
__spreadValues({
|
|
497
|
+
type,
|
|
498
|
+
position: resolvedPosition,
|
|
499
|
+
className: cn(handleBase, className)
|
|
500
|
+
}, props)
|
|
501
|
+
) });
|
|
502
|
+
}
|
|
503
|
+
var variantClasses = {
|
|
504
|
+
default: "bg-card text-foreground ring-border",
|
|
505
|
+
success: "bg-emerald-50 text-emerald-700 ring-emerald-200 dark:bg-emerald-950/40 dark:text-emerald-300 dark:ring-emerald-800",
|
|
506
|
+
warning: "bg-amber-50 text-amber-700 ring-amber-200 dark:bg-amber-950/40 dark:text-amber-300 dark:ring-amber-800",
|
|
507
|
+
error: "bg-red-50 text-red-700 ring-red-200 dark:bg-red-950/40 dark:text-red-300 dark:ring-red-800",
|
|
508
|
+
muted: "bg-muted text-muted-foreground ring-border"
|
|
509
|
+
};
|
|
510
|
+
function WorkflowLabel(_a) {
|
|
511
|
+
var _b = _a, { variant = "default", className } = _b, props = __objRest(_b, ["variant", "className"]);
|
|
512
|
+
return /* @__PURE__ */ jsx(
|
|
513
|
+
"div",
|
|
514
|
+
__spreadValues({
|
|
515
|
+
"data-slot": "workflow-label",
|
|
516
|
+
className: cn(
|
|
517
|
+
"inline-flex items-center gap-1.5 rounded-full px-3 py-1 font-semibold text-[11px] shadow-sm ring-1",
|
|
518
|
+
variantClasses[variant],
|
|
519
|
+
className
|
|
520
|
+
)
|
|
521
|
+
}, props)
|
|
522
|
+
);
|
|
523
|
+
}
|
|
524
|
+
function WorkflowMinimap(_a) {
|
|
525
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
526
|
+
return /* @__PURE__ */ jsx(
|
|
527
|
+
MiniMap,
|
|
528
|
+
__spreadValues({
|
|
529
|
+
"data-slot": "workflow-minimap",
|
|
530
|
+
className: cn("!rounded-lg !border !border-border !bg-card !shadow-sm", className),
|
|
531
|
+
maskColor: "var(--color-muted)",
|
|
532
|
+
nodeColor: "var(--color-primary)",
|
|
533
|
+
nodeStrokeColor: "var(--color-border)",
|
|
534
|
+
nodeBorderRadius: 8
|
|
535
|
+
}, props)
|
|
536
|
+
);
|
|
537
|
+
}
|
|
538
|
+
var HandleBoundary3 = class extends Component {
|
|
539
|
+
constructor() {
|
|
540
|
+
super(...arguments);
|
|
541
|
+
this.state = { hasError: false };
|
|
542
|
+
}
|
|
543
|
+
static getDerivedStateFromError() {
|
|
544
|
+
return { hasError: true };
|
|
545
|
+
}
|
|
546
|
+
componentDidCatch(_, __) {
|
|
547
|
+
}
|
|
548
|
+
render() {
|
|
549
|
+
if (this.state.hasError) return null;
|
|
550
|
+
return this.props.children;
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
var workflowNodeVariants = cva(
|
|
554
|
+
[
|
|
555
|
+
"group/node relative flex flex-col bg-card text-card-foreground",
|
|
556
|
+
"rounded-2xl shadow-sm overflow-visible w-80",
|
|
557
|
+
"transition-shadow duration-150"
|
|
558
|
+
].join(" "),
|
|
559
|
+
{
|
|
560
|
+
variants: {
|
|
561
|
+
state: {
|
|
562
|
+
default: "ring-1 ring-border/70",
|
|
563
|
+
selected: "ring-[3px] ring-primary shadow-md",
|
|
564
|
+
dotted: "border-2 border-dashed border-muted-foreground/30 shadow-none"
|
|
565
|
+
}
|
|
566
|
+
},
|
|
567
|
+
defaultVariants: { state: "default" }
|
|
568
|
+
}
|
|
569
|
+
);
|
|
570
|
+
function NodeHandle({ type }) {
|
|
571
|
+
let layout = "vertical";
|
|
572
|
+
try {
|
|
573
|
+
layout = useWorkflowLayout();
|
|
574
|
+
} catch (e) {
|
|
575
|
+
}
|
|
576
|
+
const position = layout === "horizontal" ? type === "target" ? Position.Left : Position.Right : type === "target" ? Position.Top : Position.Bottom;
|
|
577
|
+
return /* @__PURE__ */ jsx(
|
|
578
|
+
Handle,
|
|
579
|
+
{
|
|
580
|
+
type,
|
|
581
|
+
position,
|
|
582
|
+
className: cn(
|
|
583
|
+
"!flex !items-center !justify-center",
|
|
584
|
+
"!size-5 !rounded-full !border-2 !border-card !bg-muted-foreground/70",
|
|
585
|
+
"hover:!bg-primary hover:!border-primary/20 !transition-colors"
|
|
586
|
+
),
|
|
587
|
+
children: /* @__PURE__ */ jsx(Plus, { className: "pointer-events-none size-2.5 text-card" })
|
|
588
|
+
}
|
|
589
|
+
);
|
|
590
|
+
}
|
|
591
|
+
function WorkflowNodeHeader(_a) {
|
|
592
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
593
|
+
return /* @__PURE__ */ jsx(
|
|
594
|
+
"div",
|
|
595
|
+
__spreadValues({
|
|
596
|
+
"data-slot": "workflow-node-header",
|
|
597
|
+
className: cn("flex items-center gap-3 px-4 py-3.5", className)
|
|
598
|
+
}, props)
|
|
599
|
+
);
|
|
600
|
+
}
|
|
601
|
+
function WorkflowNodeTitle(_a) {
|
|
602
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
603
|
+
return /* @__PURE__ */ jsx(
|
|
604
|
+
"div",
|
|
605
|
+
__spreadValues({
|
|
606
|
+
"data-slot": "workflow-node-title",
|
|
607
|
+
className: cn("min-w-0 flex-1 truncate font-bold text-sm leading-tight", className)
|
|
608
|
+
}, props)
|
|
609
|
+
);
|
|
610
|
+
}
|
|
611
|
+
function WorkflowNodeDescription(_a) {
|
|
612
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
613
|
+
return /* @__PURE__ */ jsx(
|
|
614
|
+
"div",
|
|
615
|
+
__spreadValues({
|
|
616
|
+
"data-slot": "workflow-node-description",
|
|
617
|
+
className: cn("text-muted-foreground text-xs", className)
|
|
618
|
+
}, props)
|
|
619
|
+
);
|
|
620
|
+
}
|
|
621
|
+
function WorkflowNodeAction(_a) {
|
|
622
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
623
|
+
return /* @__PURE__ */ jsx(
|
|
624
|
+
"div",
|
|
625
|
+
__spreadValues({
|
|
626
|
+
"data-slot": "workflow-node-action",
|
|
627
|
+
className: cn("ml-auto shrink-0", className)
|
|
628
|
+
}, props)
|
|
629
|
+
);
|
|
630
|
+
}
|
|
631
|
+
function WorkflowNodeContent(_a) {
|
|
632
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
633
|
+
return /* @__PURE__ */ jsx(
|
|
634
|
+
"div",
|
|
635
|
+
__spreadValues({
|
|
636
|
+
"data-slot": "workflow-node-content",
|
|
637
|
+
className: cn("space-y-2.5 px-4 py-3", className)
|
|
638
|
+
}, props)
|
|
639
|
+
);
|
|
640
|
+
}
|
|
641
|
+
function WorkflowNodeFooter(_a) {
|
|
642
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
643
|
+
return /* @__PURE__ */ jsx(
|
|
644
|
+
"div",
|
|
645
|
+
__spreadValues({
|
|
646
|
+
"data-slot": "workflow-node-footer",
|
|
647
|
+
className: cn(
|
|
648
|
+
"flex items-center justify-center gap-1.5 px-4 py-2.5",
|
|
649
|
+
"font-semibold text-muted-foreground text-xs",
|
|
650
|
+
className
|
|
651
|
+
)
|
|
652
|
+
}, props)
|
|
653
|
+
);
|
|
654
|
+
}
|
|
655
|
+
function WorkflowNodeSeparator(_a) {
|
|
656
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
657
|
+
return /* @__PURE__ */ jsx(
|
|
658
|
+
"div",
|
|
659
|
+
__spreadValues({
|
|
660
|
+
"data-slot": "workflow-node-separator",
|
|
661
|
+
className: cn("mx-3 border-muted-foreground/20 border-t border-dashed", className)
|
|
662
|
+
}, props)
|
|
663
|
+
);
|
|
664
|
+
}
|
|
665
|
+
function WorkflowNodeRow(_a) {
|
|
666
|
+
var _b = _a, {
|
|
667
|
+
label,
|
|
668
|
+
value,
|
|
669
|
+
icon,
|
|
670
|
+
className
|
|
671
|
+
} = _b, props = __objRest(_b, [
|
|
672
|
+
"label",
|
|
673
|
+
"value",
|
|
674
|
+
"icon",
|
|
675
|
+
"className"
|
|
676
|
+
]);
|
|
677
|
+
return /* @__PURE__ */ jsxs(
|
|
678
|
+
"div",
|
|
679
|
+
__spreadProps(__spreadValues({
|
|
680
|
+
"data-slot": "workflow-node-row",
|
|
681
|
+
className: cn(
|
|
682
|
+
"flex items-center justify-between gap-3 rounded-xl bg-muted/60 px-4 py-2.5",
|
|
683
|
+
className
|
|
684
|
+
)
|
|
685
|
+
}, props), {
|
|
686
|
+
children: [
|
|
687
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-sm", children: label }),
|
|
688
|
+
/* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2 font-semibold text-sm", children: [
|
|
689
|
+
icon && /* @__PURE__ */ jsx("span", { className: "shrink-0 [&>img]:size-6 [&>img]:rounded-full [&>svg]:size-4", children: icon }),
|
|
690
|
+
value
|
|
691
|
+
] })
|
|
692
|
+
]
|
|
693
|
+
})
|
|
694
|
+
);
|
|
695
|
+
}
|
|
696
|
+
function WorkflowNode(_a) {
|
|
697
|
+
var _b = _a, {
|
|
698
|
+
state,
|
|
699
|
+
draggable: showDragHandle,
|
|
700
|
+
icon,
|
|
701
|
+
title,
|
|
702
|
+
status,
|
|
703
|
+
badge,
|
|
704
|
+
collapsible,
|
|
705
|
+
defaultCollapsed = false,
|
|
706
|
+
footer,
|
|
707
|
+
handles,
|
|
708
|
+
className,
|
|
709
|
+
children
|
|
710
|
+
} = _b, props = __objRest(_b, [
|
|
711
|
+
"state",
|
|
712
|
+
"draggable",
|
|
713
|
+
"icon",
|
|
714
|
+
"title",
|
|
715
|
+
"status",
|
|
716
|
+
"badge",
|
|
717
|
+
"collapsible",
|
|
718
|
+
"defaultCollapsed",
|
|
719
|
+
"footer",
|
|
720
|
+
"handles",
|
|
721
|
+
"className",
|
|
722
|
+
"children"
|
|
723
|
+
]);
|
|
724
|
+
const [collapsed, setCollapsed] = useState(defaultCollapsed);
|
|
725
|
+
const hasHeader = icon || title || status || showDragHandle;
|
|
726
|
+
const hasContent = !!children;
|
|
727
|
+
const hasFooter = footer || collapsible;
|
|
728
|
+
return /* @__PURE__ */ jsxs(
|
|
729
|
+
"div",
|
|
730
|
+
__spreadProps(__spreadValues({
|
|
731
|
+
"data-slot": "workflow-node",
|
|
732
|
+
"data-state": state != null ? state : "default",
|
|
733
|
+
className: cn(workflowNodeVariants({ state }), className)
|
|
734
|
+
}, props), {
|
|
735
|
+
children: [
|
|
736
|
+
(handles == null ? void 0 : handles.target) && /* @__PURE__ */ jsx(HandleBoundary3, { children: /* @__PURE__ */ jsx(NodeHandle, { type: "target" }) }),
|
|
737
|
+
hasHeader && /* @__PURE__ */ jsxs(WorkflowNodeHeader, { children: [
|
|
738
|
+
showDragHandle && /* @__PURE__ */ jsx("span", { className: "shrink-0 cursor-grab text-muted-foreground/40 transition-colors hover:text-muted-foreground active:cursor-grabbing", children: /* @__PURE__ */ jsx(GripVertical, { className: "size-4" }) }),
|
|
739
|
+
icon && /* @__PURE__ */ jsxs("span", { className: "relative shrink-0 [&>img]:size-8 [&>img]:rounded-lg [&>svg]:size-7", children: [
|
|
740
|
+
icon,
|
|
741
|
+
badge != null && /* @__PURE__ */ jsx("span", { className: "absolute -top-1.5 -right-1.5 inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-primary px-1 font-bold text-[10px] text-primary-foreground leading-none ring-2 ring-card", children: badge })
|
|
742
|
+
] }),
|
|
743
|
+
title && /* @__PURE__ */ jsx(WorkflowNodeTitle, { children: title }),
|
|
744
|
+
status && /* @__PURE__ */ jsxs("span", { className: "ml-auto inline-flex shrink-0 items-center gap-1 rounded-full border border-border/80 bg-muted/40 px-2.5 py-1 font-bold text-[10px] text-muted-foreground uppercase tracking-widest", children: [
|
|
745
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "size-2.5" }),
|
|
746
|
+
status
|
|
747
|
+
] })
|
|
748
|
+
] }),
|
|
749
|
+
hasContent && !collapsed && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
750
|
+
hasHeader && /* @__PURE__ */ jsx(WorkflowNodeSeparator, {}),
|
|
751
|
+
/* @__PURE__ */ jsx(WorkflowNodeContent, { children })
|
|
752
|
+
] }),
|
|
753
|
+
hasFooter && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
754
|
+
/* @__PURE__ */ jsx(WorkflowNodeSeparator, {}),
|
|
755
|
+
/* @__PURE__ */ jsx(WorkflowNodeFooter, { children: collapsible ? /* @__PURE__ */ jsx(
|
|
756
|
+
"button",
|
|
757
|
+
{
|
|
758
|
+
type: "button",
|
|
759
|
+
onClick: () => setCollapsed((c) => !c),
|
|
760
|
+
className: "inline-flex items-center gap-1.5 font-semibold text-muted-foreground text-xs transition-colors hover:text-foreground",
|
|
761
|
+
children: collapsed ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
762
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "size-3.5" }),
|
|
763
|
+
"Expand"
|
|
764
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
765
|
+
/* @__PURE__ */ jsx(ChevronUp, { className: "size-3.5" }),
|
|
766
|
+
"Close"
|
|
767
|
+
] })
|
|
768
|
+
}
|
|
769
|
+
) : footer })
|
|
770
|
+
] }),
|
|
771
|
+
(handles == null ? void 0 : handles.source) && /* @__PURE__ */ jsx(HandleBoundary3, { children: /* @__PURE__ */ jsx(NodeHandle, { type: "source" }) })
|
|
772
|
+
]
|
|
773
|
+
})
|
|
774
|
+
);
|
|
775
|
+
}
|
|
776
|
+
function WorkflowPanel(_a) {
|
|
777
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
778
|
+
return /* @__PURE__ */ jsx(
|
|
779
|
+
Panel,
|
|
780
|
+
__spreadValues({
|
|
781
|
+
"data-slot": "workflow-panel",
|
|
782
|
+
className: cn("m-4 overflow-hidden rounded-md border bg-card p-1", className)
|
|
783
|
+
}, props)
|
|
784
|
+
);
|
|
785
|
+
}
|
|
786
|
+
function WorkflowToolbar(_a) {
|
|
787
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
788
|
+
return /* @__PURE__ */ jsx(
|
|
789
|
+
NodeToolbar,
|
|
790
|
+
__spreadValues({
|
|
791
|
+
"data-slot": "workflow-toolbar",
|
|
792
|
+
className: cn("flex items-center gap-1 rounded-sm border bg-background p-1.5", className),
|
|
793
|
+
position: Position.Bottom
|
|
794
|
+
}, props)
|
|
795
|
+
);
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
export { AnimatedEdge, Canvas, DashedEdge, DottedEdge, HandleBoundary2 as HandleBoundary, SolidEdge, TemporaryEdge, WorkflowConnection, WorkflowConnectionAnimated, WorkflowConnectionDashed, WorkflowConnectionDotted, WorkflowControls, WorkflowEdge, WorkflowGate, WorkflowGroup, WorkflowHandle, WorkflowLabel, WorkflowMinimap, WorkflowNode, WorkflowNodeAction, WorkflowNodeContent, WorkflowNodeDescription, WorkflowNodeFooter, WorkflowNodeHeader, WorkflowNodeRow, WorkflowNodeSeparator, WorkflowNodeTitle, WorkflowPanel, WorkflowToolbar, createConnectionLine, handleBase, workflowConnectionVariants, workflowGateVariants, workflowGroupVariants, workflowNodeVariants };
|
|
799
|
+
//# sourceMappingURL=chunk-XFWKI45G.js.map
|
|
800
|
+
//# sourceMappingURL=chunk-XFWKI45G.js.map
|