@object-ui/plugin-workflow 4.0.3 → 4.0.5
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/CHANGELOG.md +50 -0
- package/dist/index.js +600 -777
- package/dist/index.umd.cjs +2 -7
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,198 +1,21 @@
|
|
|
1
1
|
import { ComponentRegistry as e } from "@object-ui/core";
|
|
2
2
|
import { useCallback as t, useMemo as n, useRef as r, useState as i } from "react";
|
|
3
3
|
import { Badge as a, Button as o, Card as s, CardContent as c, CardHeader as l, CardTitle as u, Input as d, Label as f, Select as p, SelectContent as m, SelectItem as h, SelectTrigger as g, SelectValue as _, Separator as v, Switch as y } from "@object-ui/components";
|
|
4
|
-
import { AlertCircle as b, ArrowRight as x, Bell as S, Check as C, CheckCircle as w, Circle as T, Clock as E, Code as D, Download as ee, FileEdit as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
type: e,
|
|
20
|
-
key: i,
|
|
21
|
-
ref: n === void 0 ? null : n,
|
|
22
|
-
props: r
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
e.Fragment = n, e.jsx = r, e.jsxs = r;
|
|
26
|
-
})), ve = /* @__PURE__ */ U(((e) => {
|
|
27
|
-
process.env.NODE_ENV !== "production" && (function() {
|
|
28
|
-
function t(e) {
|
|
29
|
-
if (e == null) return null;
|
|
30
|
-
if (typeof e == "function") return e.$$typeof === ee ? null : e.displayName || e.name || null;
|
|
31
|
-
if (typeof e == "string") return e;
|
|
32
|
-
switch (e) {
|
|
33
|
-
case _: return "Fragment";
|
|
34
|
-
case y: return "Profiler";
|
|
35
|
-
case v: return "StrictMode";
|
|
36
|
-
case C: return "Suspense";
|
|
37
|
-
case w: return "SuspenseList";
|
|
38
|
-
case D: return "Activity";
|
|
39
|
-
}
|
|
40
|
-
if (typeof e == "object") switch (typeof e.tag == "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
|
|
41
|
-
case g: return "Portal";
|
|
42
|
-
case x: return e.displayName || "Context";
|
|
43
|
-
case b: return (e._context.displayName || "Context") + ".Consumer";
|
|
44
|
-
case S:
|
|
45
|
-
var n = e.render;
|
|
46
|
-
return e = e.displayName, e ||= (e = n.displayName || n.name || "", e === "" ? "ForwardRef" : "ForwardRef(" + e + ")"), e;
|
|
47
|
-
case T: return n = e.displayName || null, n === null ? t(e.type) || "Memo" : n;
|
|
48
|
-
case E:
|
|
49
|
-
n = e._payload, e = e._init;
|
|
50
|
-
try {
|
|
51
|
-
return t(e(n));
|
|
52
|
-
} catch {}
|
|
53
|
-
}
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
function n(e) {
|
|
57
|
-
return "" + e;
|
|
58
|
-
}
|
|
59
|
-
function r(e) {
|
|
60
|
-
try {
|
|
61
|
-
n(e);
|
|
62
|
-
var t = !1;
|
|
63
|
-
} catch {
|
|
64
|
-
t = !0;
|
|
65
|
-
}
|
|
66
|
-
if (t) {
|
|
67
|
-
t = console;
|
|
68
|
-
var r = t.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
69
|
-
return r.call(t, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", i), n(e);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function i(e) {
|
|
73
|
-
if (e === _) return "<>";
|
|
74
|
-
if (typeof e == "object" && e && e.$$typeof === E) return "<...>";
|
|
75
|
-
try {
|
|
76
|
-
var n = t(e);
|
|
77
|
-
return n ? "<" + n + ">" : "<...>";
|
|
78
|
-
} catch {
|
|
79
|
-
return "<...>";
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
function a() {
|
|
83
|
-
var e = O.A;
|
|
84
|
-
return e === null ? null : e.getOwner();
|
|
85
|
-
}
|
|
86
|
-
function o() {
|
|
87
|
-
return Error("react-stack-top-frame");
|
|
88
|
-
}
|
|
89
|
-
function s(e) {
|
|
90
|
-
if (k.call(e, "key")) {
|
|
91
|
-
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
92
|
-
if (t && t.isReactWarning) return !1;
|
|
93
|
-
}
|
|
94
|
-
return e.key !== void 0;
|
|
95
|
-
}
|
|
96
|
-
function c(e, t) {
|
|
97
|
-
function n() {
|
|
98
|
-
te || (te = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
|
|
99
|
-
}
|
|
100
|
-
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
101
|
-
get: n,
|
|
102
|
-
configurable: !0
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
function l() {
|
|
106
|
-
var e = t(this.type);
|
|
107
|
-
return ne[e] || (ne[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
|
|
108
|
-
}
|
|
109
|
-
function u(e, t, n, r, i, a) {
|
|
110
|
-
var o = n.ref;
|
|
111
|
-
return e = {
|
|
112
|
-
$$typeof: h,
|
|
113
|
-
type: e,
|
|
114
|
-
key: t,
|
|
115
|
-
props: n,
|
|
116
|
-
_owner: r
|
|
117
|
-
}, (o === void 0 ? null : o) === null ? Object.defineProperty(e, "ref", {
|
|
118
|
-
enumerable: !1,
|
|
119
|
-
value: null
|
|
120
|
-
}) : Object.defineProperty(e, "ref", {
|
|
121
|
-
enumerable: !1,
|
|
122
|
-
get: l
|
|
123
|
-
}), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
124
|
-
configurable: !1,
|
|
125
|
-
enumerable: !1,
|
|
126
|
-
writable: !0,
|
|
127
|
-
value: 0
|
|
128
|
-
}), Object.defineProperty(e, "_debugInfo", {
|
|
129
|
-
configurable: !1,
|
|
130
|
-
enumerable: !1,
|
|
131
|
-
writable: !0,
|
|
132
|
-
value: null
|
|
133
|
-
}), Object.defineProperty(e, "_debugStack", {
|
|
134
|
-
configurable: !1,
|
|
135
|
-
enumerable: !1,
|
|
136
|
-
writable: !0,
|
|
137
|
-
value: i
|
|
138
|
-
}), Object.defineProperty(e, "_debugTask", {
|
|
139
|
-
configurable: !1,
|
|
140
|
-
enumerable: !1,
|
|
141
|
-
writable: !0,
|
|
142
|
-
value: a
|
|
143
|
-
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
144
|
-
}
|
|
145
|
-
function d(e, n, i, o, l, d) {
|
|
146
|
-
var p = n.children;
|
|
147
|
-
if (p !== void 0) if (o) if (A(p)) {
|
|
148
|
-
for (o = 0; o < p.length; o++) f(p[o]);
|
|
149
|
-
Object.freeze && Object.freeze(p);
|
|
150
|
-
} else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
151
|
-
else f(p);
|
|
152
|
-
if (k.call(n, "key")) {
|
|
153
|
-
p = t(e);
|
|
154
|
-
var m = Object.keys(n).filter(function(e) {
|
|
155
|
-
return e !== "key";
|
|
156
|
-
});
|
|
157
|
-
o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", ie[p + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", o, p, m, p), ie[p + o] = !0);
|
|
158
|
-
}
|
|
159
|
-
if (p = null, i !== void 0 && (r(i), p = "" + i), s(n) && (r(n.key), p = "" + n.key), "key" in n) for (var h in i = {}, n) h !== "key" && (i[h] = n[h]);
|
|
160
|
-
else i = n;
|
|
161
|
-
return p && c(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), u(e, p, i, a(), l, d);
|
|
162
|
-
}
|
|
163
|
-
function f(e) {
|
|
164
|
-
p(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === E && (e._payload.status === "fulfilled" ? p(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
165
|
-
}
|
|
166
|
-
function p(e) {
|
|
167
|
-
return typeof e == "object" && !!e && e.$$typeof === h;
|
|
168
|
-
}
|
|
169
|
-
var m = _e("react"), h = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), x = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), D = Symbol.for("react.activity"), ee = Symbol.for("react.client.reference"), O = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, k = Object.prototype.hasOwnProperty, A = Array.isArray, j = console.createTask ? console.createTask : function() {
|
|
170
|
-
return null;
|
|
171
|
-
};
|
|
172
|
-
m = { react_stack_bottom_frame: function(e) {
|
|
173
|
-
return e();
|
|
174
|
-
} };
|
|
175
|
-
var te, ne = {}, M = m.react_stack_bottom_frame.bind(m, o)(), re = j(i(o)), ie = {};
|
|
176
|
-
e.Fragment = _, e.jsx = function(e, t, n) {
|
|
177
|
-
var r = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
178
|
-
return d(e, t, n, !1, r ? Error("react-stack-top-frame") : M, r ? j(i(e)) : re);
|
|
179
|
-
}, e.jsxs = function(e, t, n) {
|
|
180
|
-
var r = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
181
|
-
return d(e, t, n, !0, r ? Error("react-stack-top-frame") : M, r ? j(i(e)) : re);
|
|
182
|
-
};
|
|
183
|
-
})();
|
|
184
|
-
})), G = (/* @__PURE__ */ U(((e, t) => {
|
|
185
|
-
process.env.NODE_ENV === "production" ? t.exports = W() : t.exports = ve();
|
|
186
|
-
})))(), K = {
|
|
187
|
-
start: /* @__PURE__ */ (0, G.jsx)(N, { className: "h-4 w-4 text-green-500" }),
|
|
188
|
-
end: /* @__PURE__ */ (0, G.jsx)(w, { className: "h-4 w-4 text-red-500" }),
|
|
189
|
-
task: /* @__PURE__ */ (0, G.jsx)(T, { className: "h-4 w-4 text-blue-500" }),
|
|
190
|
-
approval: /* @__PURE__ */ (0, G.jsx)(V, { className: "h-4 w-4 text-purple-500" }),
|
|
191
|
-
condition: /* @__PURE__ */ (0, G.jsx)(k, { className: "h-4 w-4 text-orange-500" }),
|
|
192
|
-
parallel: /* @__PURE__ */ (0, G.jsx)(x, { className: "h-4 w-4 text-teal-500" }),
|
|
193
|
-
delay: /* @__PURE__ */ (0, G.jsx)(E, { className: "h-4 w-4 text-gray-500" }),
|
|
194
|
-
notification: /* @__PURE__ */ (0, G.jsx)(S, { className: "h-4 w-4 text-yellow-500" }),
|
|
195
|
-
script: /* @__PURE__ */ (0, G.jsx)(D, { className: "h-4 w-4 text-indigo-500" })
|
|
4
|
+
import { AlertCircle as b, ArrowRight as x, Bell as S, Check as C, CheckCircle as w, Circle as T, Clock as E, Code as D, Download as ee, FileEdit as te, GitBranch as O, GitMerge as k, Globe as A, History as ne, Link as re, Loader2 as ie, Mail as ae, MessageSquare as oe, PanelRightClose as se, PanelRightOpen as ce, Play as j, Plus as M, Redo2 as le, RefreshCw as N, RotateCcw as ue, Save as de, Settings as P, SkipForward as F, Square as I, Trash2 as L, Undo2 as fe, Upload as pe, User as R, Users as z, X as B, Zap as me, ZoomIn as he, ZoomOut as ge } from "lucide-react";
|
|
5
|
+
import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
6
|
+
import { clsx as _e } from "clsx";
|
|
7
|
+
import { twMerge as ve } from "tailwind-merge";
|
|
8
|
+
//#region src/WorkflowDesigner.tsx
|
|
9
|
+
var W = {
|
|
10
|
+
start: /* @__PURE__ */ H(j, { className: "h-4 w-4 text-green-500" }),
|
|
11
|
+
end: /* @__PURE__ */ H(w, { className: "h-4 w-4 text-red-500" }),
|
|
12
|
+
task: /* @__PURE__ */ H(T, { className: "h-4 w-4 text-blue-500" }),
|
|
13
|
+
approval: /* @__PURE__ */ H(z, { className: "h-4 w-4 text-purple-500" }),
|
|
14
|
+
condition: /* @__PURE__ */ H(O, { className: "h-4 w-4 text-orange-500" }),
|
|
15
|
+
parallel: /* @__PURE__ */ H(x, { className: "h-4 w-4 text-teal-500" }),
|
|
16
|
+
delay: /* @__PURE__ */ H(E, { className: "h-4 w-4 text-gray-500" }),
|
|
17
|
+
notification: /* @__PURE__ */ H(S, { className: "h-4 w-4 text-yellow-500" }),
|
|
18
|
+
script: /* @__PURE__ */ H(D, { className: "h-4 w-4 text-indigo-500" })
|
|
196
19
|
}, ye = {
|
|
197
20
|
start: "border-green-300 bg-green-50",
|
|
198
21
|
end: "border-red-300 bg-red-50",
|
|
@@ -203,7 +26,7 @@ var U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
203
26
|
delay: "border-gray-300 bg-gray-50",
|
|
204
27
|
notification: "border-yellow-300 bg-yellow-50",
|
|
205
28
|
script: "border-indigo-300 bg-indigo-50"
|
|
206
|
-
},
|
|
29
|
+
}, G = {
|
|
207
30
|
draft: {
|
|
208
31
|
variant: "secondary",
|
|
209
32
|
label: "Draft"
|
|
@@ -295,19 +118,19 @@ var U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
295
118
|
})), y === e && b(null));
|
|
296
119
|
}, [p, y]), ee = () => {
|
|
297
120
|
console.log("Saving workflow:", h), e.onSave;
|
|
298
|
-
},
|
|
121
|
+
}, te = () => {
|
|
299
122
|
g((e) => ({
|
|
300
123
|
...e,
|
|
301
124
|
status: "active"
|
|
302
125
|
})), console.log("Publishing workflow"), e.onPublish;
|
|
303
|
-
},
|
|
304
|
-
return /* @__PURE__ */ (
|
|
126
|
+
}, k = G[h.status || "draft"];
|
|
127
|
+
return /* @__PURE__ */ U("div", {
|
|
305
128
|
className: "space-y-4",
|
|
306
|
-
children: [m && /* @__PURE__ */ (
|
|
129
|
+
children: [m && /* @__PURE__ */ U("div", {
|
|
307
130
|
className: "flex items-center justify-between gap-2 p-4 bg-card rounded-lg border",
|
|
308
|
-
children: [/* @__PURE__ */ (
|
|
131
|
+
children: [/* @__PURE__ */ U("div", {
|
|
309
132
|
className: "flex items-center gap-3",
|
|
310
|
-
children: [/* @__PURE__ */ (
|
|
133
|
+
children: [/* @__PURE__ */ H("div", { children: /* @__PURE__ */ H(d, {
|
|
311
134
|
value: h.title || "",
|
|
312
135
|
onChange: (e) => g((t) => ({
|
|
313
136
|
...t,
|
|
@@ -316,33 +139,33 @@ var U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
316
139
|
className: "text-lg font-semibold border-none p-0 h-auto focus-visible:ring-0",
|
|
317
140
|
readOnly: p,
|
|
318
141
|
placeholder: "Workflow Title"
|
|
319
|
-
}) }), /* @__PURE__ */ (
|
|
320
|
-
variant:
|
|
321
|
-
children:
|
|
142
|
+
}) }), /* @__PURE__ */ H(a, {
|
|
143
|
+
variant: k.variant,
|
|
144
|
+
children: k.label
|
|
322
145
|
})]
|
|
323
|
-
}), !p && /* @__PURE__ */ (
|
|
146
|
+
}), !p && /* @__PURE__ */ U("div", {
|
|
324
147
|
className: "flex items-center gap-2",
|
|
325
|
-
children: [/* @__PURE__ */ (
|
|
148
|
+
children: [/* @__PURE__ */ U(o, {
|
|
326
149
|
variant: "outline",
|
|
327
150
|
size: "sm",
|
|
328
151
|
onClick: ee,
|
|
329
|
-
children: [/* @__PURE__ */ (
|
|
330
|
-
}), /* @__PURE__ */ (
|
|
152
|
+
children: [/* @__PURE__ */ H(de, { className: "h-4 w-4 mr-2" }), "Save"]
|
|
153
|
+
}), /* @__PURE__ */ U(o, {
|
|
331
154
|
size: "sm",
|
|
332
|
-
onClick:
|
|
155
|
+
onClick: te,
|
|
333
156
|
disabled: h.status === "active",
|
|
334
|
-
children: [/* @__PURE__ */ (
|
|
157
|
+
children: [/* @__PURE__ */ H(j, { className: "h-4 w-4 mr-2" }), "Publish"]
|
|
335
158
|
})]
|
|
336
159
|
})]
|
|
337
|
-
}), /* @__PURE__ */ (
|
|
160
|
+
}), /* @__PURE__ */ U("div", {
|
|
338
161
|
className: "grid grid-cols-1 lg:grid-cols-4 gap-4",
|
|
339
162
|
children: [
|
|
340
|
-
!p && /* @__PURE__ */ (
|
|
163
|
+
!p && /* @__PURE__ */ U(s, {
|
|
341
164
|
className: "lg:col-span-1",
|
|
342
|
-
children: [/* @__PURE__ */ (
|
|
165
|
+
children: [/* @__PURE__ */ H(l, { children: /* @__PURE__ */ H(u, {
|
|
343
166
|
className: "text-sm",
|
|
344
167
|
children: "Add Node"
|
|
345
|
-
}) }), /* @__PURE__ */ (
|
|
168
|
+
}) }), /* @__PURE__ */ H(c, {
|
|
346
169
|
className: "space-y-2",
|
|
347
170
|
children: [
|
|
348
171
|
"task",
|
|
@@ -352,38 +175,38 @@ var U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
352
175
|
"delay",
|
|
353
176
|
"notification",
|
|
354
177
|
"script"
|
|
355
|
-
].map((e) => /* @__PURE__ */ (
|
|
178
|
+
].map((e) => /* @__PURE__ */ U("button", {
|
|
356
179
|
onClick: () => C(e),
|
|
357
180
|
className: "w-full flex items-center gap-2 p-2 rounded-md border hover:bg-muted/50 transition-colors text-sm",
|
|
358
|
-
children: [
|
|
181
|
+
children: [W[e], /* @__PURE__ */ H("span", {
|
|
359
182
|
className: "capitalize",
|
|
360
183
|
children: e
|
|
361
184
|
})]
|
|
362
185
|
}, e))
|
|
363
186
|
})]
|
|
364
187
|
}),
|
|
365
|
-
/* @__PURE__ */ (
|
|
188
|
+
/* @__PURE__ */ U(s, {
|
|
366
189
|
className: p ? "lg:col-span-3" : "lg:col-span-2",
|
|
367
|
-
children: [/* @__PURE__ */ (
|
|
190
|
+
children: [/* @__PURE__ */ H(l, { children: /* @__PURE__ */ U(u, {
|
|
368
191
|
className: "text-sm flex items-center gap-2",
|
|
369
|
-
children: [/* @__PURE__ */ (
|
|
370
|
-
}) }), /* @__PURE__ */ (
|
|
192
|
+
children: [/* @__PURE__ */ H(O, { className: "h-4 w-4" }), "Workflow Flow"]
|
|
193
|
+
}) }), /* @__PURE__ */ H(c, { children: /* @__PURE__ */ U("div", {
|
|
371
194
|
className: "space-y-2",
|
|
372
195
|
children: [
|
|
373
|
-
h.nodes.map((e) => /* @__PURE__ */ (
|
|
196
|
+
h.nodes.map((e) => /* @__PURE__ */ U("div", {
|
|
374
197
|
onClick: () => {
|
|
375
198
|
v(e.id), b(null);
|
|
376
199
|
},
|
|
377
200
|
className: `flex items-center justify-between p-3 rounded-lg border-2 cursor-pointer transition-all ${ye[e.type]} ${_ === e.id ? "ring-2 ring-primary shadow-md" : "hover:shadow-sm"}`,
|
|
378
|
-
children: [/* @__PURE__ */ (
|
|
201
|
+
children: [/* @__PURE__ */ U("div", {
|
|
379
202
|
className: "flex items-center gap-2",
|
|
380
203
|
children: [
|
|
381
|
-
|
|
382
|
-
/* @__PURE__ */ (
|
|
204
|
+
W[e.type],
|
|
205
|
+
/* @__PURE__ */ H("span", {
|
|
383
206
|
className: "font-medium text-sm",
|
|
384
207
|
children: e.label
|
|
385
208
|
}),
|
|
386
|
-
/* @__PURE__ */ (
|
|
209
|
+
/* @__PURE__ */ U("span", {
|
|
387
210
|
className: "text-xs text-muted-foreground capitalize",
|
|
388
211
|
children: [
|
|
389
212
|
"(",
|
|
@@ -392,84 +215,84 @@ var U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
392
215
|
]
|
|
393
216
|
})
|
|
394
217
|
]
|
|
395
|
-
}), /* @__PURE__ */ (
|
|
218
|
+
}), /* @__PURE__ */ U("div", {
|
|
396
219
|
className: "flex items-center gap-1",
|
|
397
|
-
children: [h.edges.filter((t) => t.source === e.id).length > 0 && /* @__PURE__ */ (
|
|
220
|
+
children: [h.edges.filter((t) => t.source === e.id).length > 0 && /* @__PURE__ */ U(a, {
|
|
398
221
|
variant: "outline",
|
|
399
222
|
className: "text-xs",
|
|
400
223
|
children: [h.edges.filter((t) => t.source === e.id).length, " out"]
|
|
401
|
-
}), !p && e.type !== "start" && e.type !== "end" && /* @__PURE__ */ (
|
|
224
|
+
}), !p && e.type !== "start" && e.type !== "end" && /* @__PURE__ */ H(o, {
|
|
402
225
|
size: "sm",
|
|
403
226
|
variant: "ghost",
|
|
404
227
|
className: "h-6 w-6 p-0 text-red-500 hover:text-red-700",
|
|
405
228
|
onClick: (t) => {
|
|
406
229
|
t.stopPropagation(), T(e.id);
|
|
407
230
|
},
|
|
408
|
-
children: /* @__PURE__ */ (
|
|
231
|
+
children: /* @__PURE__ */ H(L, { className: "h-3 w-3" })
|
|
409
232
|
})]
|
|
410
233
|
})]
|
|
411
234
|
}, e.id)),
|
|
412
|
-
h.edges.length > 0 && /* @__PURE__ */ (
|
|
235
|
+
h.edges.length > 0 && /* @__PURE__ */ U("div", {
|
|
413
236
|
className: "mt-4 pt-4 border-t",
|
|
414
|
-
children: [/* @__PURE__ */ (
|
|
237
|
+
children: [/* @__PURE__ */ H(f, {
|
|
415
238
|
className: "text-xs text-muted-foreground mb-2 block",
|
|
416
239
|
children: "Connections"
|
|
417
240
|
}), h.edges.map((e) => {
|
|
418
241
|
let t = h.nodes.find((t) => t.id === e.source), n = h.nodes.find((t) => t.id === e.target);
|
|
419
|
-
return /* @__PURE__ */ (
|
|
242
|
+
return /* @__PURE__ */ U("div", {
|
|
420
243
|
className: "flex items-center gap-2 p-2 text-sm",
|
|
421
244
|
children: [
|
|
422
|
-
/* @__PURE__ */ (
|
|
423
|
-
/* @__PURE__ */ (
|
|
424
|
-
/* @__PURE__ */ (
|
|
425
|
-
e.label && /* @__PURE__ */ (
|
|
245
|
+
/* @__PURE__ */ H("span", { children: t?.label || e.source }),
|
|
246
|
+
/* @__PURE__ */ H(x, { className: "h-3 w-3 text-muted-foreground" }),
|
|
247
|
+
/* @__PURE__ */ H("span", { children: n?.label || e.target }),
|
|
248
|
+
e.label && /* @__PURE__ */ H(a, {
|
|
426
249
|
variant: "outline",
|
|
427
250
|
className: "text-xs",
|
|
428
251
|
children: e.label
|
|
429
252
|
}),
|
|
430
|
-
!p && /* @__PURE__ */ (
|
|
253
|
+
!p && /* @__PURE__ */ H(o, {
|
|
431
254
|
size: "sm",
|
|
432
255
|
variant: "ghost",
|
|
433
256
|
className: "h-5 w-5 p-0 ml-auto text-red-500",
|
|
434
257
|
onClick: () => D(e.id),
|
|
435
|
-
children: /* @__PURE__ */ (
|
|
258
|
+
children: /* @__PURE__ */ H(L, { className: "h-3 w-3" })
|
|
436
259
|
})
|
|
437
260
|
]
|
|
438
261
|
}, e.id);
|
|
439
262
|
})]
|
|
440
263
|
}),
|
|
441
|
-
!p && h.nodes.length >= 2 && /* @__PURE__ */ (
|
|
264
|
+
!p && h.nodes.length >= 2 && /* @__PURE__ */ U("div", {
|
|
442
265
|
className: "mt-4 pt-4 border-t",
|
|
443
266
|
children: [
|
|
444
|
-
/* @__PURE__ */ (
|
|
267
|
+
/* @__PURE__ */ H(f, {
|
|
445
268
|
className: "text-xs text-muted-foreground mb-2 block",
|
|
446
269
|
children: "Quick Connect"
|
|
447
270
|
}),
|
|
448
|
-
/* @__PURE__ */ (
|
|
271
|
+
/* @__PURE__ */ U("div", {
|
|
449
272
|
className: "grid grid-cols-2 gap-2",
|
|
450
|
-
children: [/* @__PURE__ */ (
|
|
273
|
+
children: [/* @__PURE__ */ U("select", {
|
|
451
274
|
id: "edge-source",
|
|
452
275
|
className: "border rounded-md p-1.5 text-sm bg-background",
|
|
453
|
-
children: [/* @__PURE__ */ (
|
|
276
|
+
children: [/* @__PURE__ */ H("option", {
|
|
454
277
|
value: "",
|
|
455
278
|
children: "From..."
|
|
456
|
-
}), h.nodes.filter((e) => e.type !== "end").map((e) => /* @__PURE__ */ (
|
|
279
|
+
}), h.nodes.filter((e) => e.type !== "end").map((e) => /* @__PURE__ */ H("option", {
|
|
457
280
|
value: e.id,
|
|
458
281
|
children: e.label
|
|
459
282
|
}, e.id))]
|
|
460
|
-
}), /* @__PURE__ */ (
|
|
283
|
+
}), /* @__PURE__ */ U("select", {
|
|
461
284
|
id: "edge-target",
|
|
462
285
|
className: "border rounded-md p-1.5 text-sm bg-background",
|
|
463
|
-
children: [/* @__PURE__ */ (
|
|
286
|
+
children: [/* @__PURE__ */ H("option", {
|
|
464
287
|
value: "",
|
|
465
288
|
children: "To..."
|
|
466
|
-
}), h.nodes.filter((e) => e.type !== "start").map((e) => /* @__PURE__ */ (
|
|
289
|
+
}), h.nodes.filter((e) => e.type !== "start").map((e) => /* @__PURE__ */ H("option", {
|
|
467
290
|
value: e.id,
|
|
468
291
|
children: e.label
|
|
469
292
|
}, e.id))]
|
|
470
293
|
})]
|
|
471
294
|
}),
|
|
472
|
-
/* @__PURE__ */ (
|
|
295
|
+
/* @__PURE__ */ U(o, {
|
|
473
296
|
size: "sm",
|
|
474
297
|
variant: "outline",
|
|
475
298
|
className: "mt-2 w-full",
|
|
@@ -477,106 +300,106 @@ var U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
477
300
|
let e = document.getElementById("edge-source")?.value, t = document.getElementById("edge-target")?.value;
|
|
478
301
|
e && t && e !== t && E(e, t);
|
|
479
302
|
},
|
|
480
|
-
children: [/* @__PURE__ */ (
|
|
303
|
+
children: [/* @__PURE__ */ H(M, { className: "h-3 w-3 mr-1" }), "Connect"]
|
|
481
304
|
})
|
|
482
305
|
]
|
|
483
306
|
})
|
|
484
307
|
]
|
|
485
308
|
}) })]
|
|
486
309
|
}),
|
|
487
|
-
/* @__PURE__ */ (
|
|
310
|
+
/* @__PURE__ */ U(s, {
|
|
488
311
|
className: "lg:col-span-1",
|
|
489
|
-
children: [/* @__PURE__ */ (
|
|
312
|
+
children: [/* @__PURE__ */ H(l, { children: /* @__PURE__ */ U(u, {
|
|
490
313
|
className: "text-sm flex items-center gap-2",
|
|
491
|
-
children: [/* @__PURE__ */ (
|
|
492
|
-
}) }), /* @__PURE__ */ (
|
|
314
|
+
children: [/* @__PURE__ */ H(P, { className: "h-4 w-4" }), "Properties"]
|
|
315
|
+
}) }), /* @__PURE__ */ H(c, { children: S ? /* @__PURE__ */ U("div", {
|
|
493
316
|
className: "space-y-3",
|
|
494
317
|
children: [
|
|
495
|
-
/* @__PURE__ */ (
|
|
318
|
+
/* @__PURE__ */ U("div", {
|
|
496
319
|
className: "space-y-1",
|
|
497
|
-
children: [/* @__PURE__ */ (
|
|
320
|
+
children: [/* @__PURE__ */ H(f, {
|
|
498
321
|
className: "text-xs",
|
|
499
322
|
children: "Label"
|
|
500
|
-
}), /* @__PURE__ */ (
|
|
323
|
+
}), /* @__PURE__ */ H(d, {
|
|
501
324
|
value: S.label,
|
|
502
325
|
onChange: (e) => w(S.id, { label: e.target.value }),
|
|
503
326
|
className: "h-8 text-sm",
|
|
504
327
|
readOnly: p
|
|
505
328
|
})]
|
|
506
329
|
}),
|
|
507
|
-
/* @__PURE__ */ (
|
|
330
|
+
/* @__PURE__ */ U("div", {
|
|
508
331
|
className: "space-y-1",
|
|
509
|
-
children: [/* @__PURE__ */ (
|
|
332
|
+
children: [/* @__PURE__ */ H(f, {
|
|
510
333
|
className: "text-xs",
|
|
511
334
|
children: "Type"
|
|
512
|
-
}), /* @__PURE__ */ (
|
|
335
|
+
}), /* @__PURE__ */ U("div", {
|
|
513
336
|
className: "flex items-center gap-2 p-2 rounded-md bg-muted text-sm",
|
|
514
|
-
children: [
|
|
337
|
+
children: [W[S.type], /* @__PURE__ */ H("span", {
|
|
515
338
|
className: "capitalize",
|
|
516
339
|
children: S.type
|
|
517
340
|
})]
|
|
518
341
|
})]
|
|
519
342
|
}),
|
|
520
|
-
S.description !== void 0 && /* @__PURE__ */ (
|
|
343
|
+
S.description !== void 0 && /* @__PURE__ */ U("div", {
|
|
521
344
|
className: "space-y-1",
|
|
522
|
-
children: [/* @__PURE__ */ (
|
|
345
|
+
children: [/* @__PURE__ */ H(f, {
|
|
523
346
|
className: "text-xs",
|
|
524
347
|
children: "Description"
|
|
525
|
-
}), /* @__PURE__ */ (
|
|
348
|
+
}), /* @__PURE__ */ H(d, {
|
|
526
349
|
value: S.description || "",
|
|
527
350
|
onChange: (e) => w(S.id, { description: e.target.value }),
|
|
528
351
|
className: "h-8 text-sm",
|
|
529
352
|
readOnly: p
|
|
530
353
|
})]
|
|
531
354
|
}),
|
|
532
|
-
(S.type === "approval" || S.type === "task") && /* @__PURE__ */ (
|
|
355
|
+
(S.type === "approval" || S.type === "task") && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ U("div", {
|
|
533
356
|
className: "space-y-1",
|
|
534
|
-
children: [/* @__PURE__ */ (
|
|
357
|
+
children: [/* @__PURE__ */ H(f, {
|
|
535
358
|
className: "text-xs",
|
|
536
359
|
children: "Assignee"
|
|
537
|
-
}), /* @__PURE__ */ (
|
|
360
|
+
}), /* @__PURE__ */ H(d, {
|
|
538
361
|
value: S.assignee || "",
|
|
539
362
|
onChange: (e) => w(S.id, { assignee: e.target.value }),
|
|
540
363
|
className: "h-8 text-sm",
|
|
541
364
|
placeholder: "User, role, or expression",
|
|
542
365
|
readOnly: p
|
|
543
366
|
})]
|
|
544
|
-
}), /* @__PURE__ */ (
|
|
367
|
+
}), /* @__PURE__ */ U("div", {
|
|
545
368
|
className: "space-y-1",
|
|
546
|
-
children: [/* @__PURE__ */ (
|
|
369
|
+
children: [/* @__PURE__ */ H(f, {
|
|
547
370
|
className: "text-xs",
|
|
548
371
|
children: "Assignee Type"
|
|
549
|
-
}), /* @__PURE__ */ (
|
|
372
|
+
}), /* @__PURE__ */ U("select", {
|
|
550
373
|
className: "w-full border rounded-md h-8 text-sm px-2 bg-background",
|
|
551
374
|
value: S.assigneeType || "user",
|
|
552
375
|
onChange: (e) => w(S.id, { assigneeType: e.target.value }),
|
|
553
376
|
disabled: p,
|
|
554
377
|
children: [
|
|
555
|
-
/* @__PURE__ */ (
|
|
378
|
+
/* @__PURE__ */ H("option", {
|
|
556
379
|
value: "user",
|
|
557
380
|
children: "User"
|
|
558
381
|
}),
|
|
559
|
-
/* @__PURE__ */ (
|
|
382
|
+
/* @__PURE__ */ H("option", {
|
|
560
383
|
value: "role",
|
|
561
384
|
children: "Role"
|
|
562
385
|
}),
|
|
563
|
-
/* @__PURE__ */ (
|
|
386
|
+
/* @__PURE__ */ H("option", {
|
|
564
387
|
value: "group",
|
|
565
388
|
children: "Group"
|
|
566
389
|
}),
|
|
567
|
-
/* @__PURE__ */ (
|
|
390
|
+
/* @__PURE__ */ H("option", {
|
|
568
391
|
value: "expression",
|
|
569
392
|
children: "Expression"
|
|
570
393
|
})
|
|
571
394
|
]
|
|
572
395
|
})]
|
|
573
396
|
})] }),
|
|
574
|
-
S.type === "delay" && /* @__PURE__ */ (
|
|
397
|
+
S.type === "delay" && /* @__PURE__ */ U("div", {
|
|
575
398
|
className: "space-y-1",
|
|
576
|
-
children: [/* @__PURE__ */ (
|
|
399
|
+
children: [/* @__PURE__ */ H(f, {
|
|
577
400
|
className: "text-xs",
|
|
578
401
|
children: "Timeout (minutes)"
|
|
579
|
-
}), /* @__PURE__ */ (
|
|
402
|
+
}), /* @__PURE__ */ H(d, {
|
|
580
403
|
type: "number",
|
|
581
404
|
value: S.timeout || 60,
|
|
582
405
|
onChange: (e) => w(S.id, { timeout: Number(e.target.value) }),
|
|
@@ -584,12 +407,12 @@ var U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
584
407
|
readOnly: p
|
|
585
408
|
})]
|
|
586
409
|
}),
|
|
587
|
-
/* @__PURE__ */ (
|
|
410
|
+
/* @__PURE__ */ U("div", {
|
|
588
411
|
className: "text-xs text-muted-foreground mt-2",
|
|
589
412
|
children: ["ID: ", S.id]
|
|
590
413
|
})
|
|
591
414
|
]
|
|
592
|
-
}) : /* @__PURE__ */ (
|
|
415
|
+
}) : /* @__PURE__ */ H("div", {
|
|
593
416
|
className: "text-sm text-muted-foreground text-center py-8",
|
|
594
417
|
children: "Select a node to edit its properties"
|
|
595
418
|
}) })]
|
|
@@ -597,7 +420,7 @@ var U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
597
420
|
]
|
|
598
421
|
})]
|
|
599
422
|
});
|
|
600
|
-
},
|
|
423
|
+
}, K = ({ schema: e }) => {
|
|
601
424
|
let { currentNodeId: t, approvalRule: n, history: r = [], data: p, showHistory: m = !0, showComments: h = !0 } = e, [g, _] = i(""), [v, y] = i(!1), b = (e) => {
|
|
602
425
|
y(!0), console.log(`Approval action: ${e}`, {
|
|
603
426
|
currentNodeId: t,
|
|
@@ -609,46 +432,46 @@ var U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
609
432
|
}, x = (e) => {
|
|
610
433
|
switch (e) {
|
|
611
434
|
case "approve":
|
|
612
|
-
case "approved": return /* @__PURE__ */ (
|
|
435
|
+
case "approved": return /* @__PURE__ */ H(a, {
|
|
613
436
|
variant: "default",
|
|
614
437
|
className: "bg-green-500",
|
|
615
438
|
children: "Approved"
|
|
616
439
|
});
|
|
617
440
|
case "reject":
|
|
618
|
-
case "rejected": return /* @__PURE__ */ (
|
|
441
|
+
case "rejected": return /* @__PURE__ */ H(a, {
|
|
619
442
|
variant: "destructive",
|
|
620
443
|
children: "Rejected"
|
|
621
444
|
});
|
|
622
445
|
case "reassign":
|
|
623
|
-
case "reassigned": return /* @__PURE__ */ (
|
|
446
|
+
case "reassigned": return /* @__PURE__ */ H(a, {
|
|
624
447
|
variant: "secondary",
|
|
625
448
|
children: "Reassigned"
|
|
626
449
|
});
|
|
627
|
-
case "comment": return /* @__PURE__ */ (
|
|
450
|
+
case "comment": return /* @__PURE__ */ H(a, {
|
|
628
451
|
variant: "outline",
|
|
629
452
|
children: "Comment"
|
|
630
453
|
});
|
|
631
454
|
case "escalate":
|
|
632
|
-
case "escalated": return /* @__PURE__ */ (
|
|
455
|
+
case "escalated": return /* @__PURE__ */ H(a, {
|
|
633
456
|
variant: "secondary",
|
|
634
457
|
className: "bg-orange-500 text-white",
|
|
635
458
|
children: "Escalated"
|
|
636
459
|
});
|
|
637
|
-
default: return /* @__PURE__ */ (
|
|
460
|
+
default: return /* @__PURE__ */ H(a, {
|
|
638
461
|
variant: "outline",
|
|
639
462
|
children: e
|
|
640
463
|
});
|
|
641
464
|
}
|
|
642
465
|
};
|
|
643
|
-
return /* @__PURE__ */ (
|
|
466
|
+
return /* @__PURE__ */ U("div", {
|
|
644
467
|
className: "space-y-4",
|
|
645
468
|
children: [
|
|
646
|
-
/* @__PURE__ */ (
|
|
469
|
+
/* @__PURE__ */ U(s, { children: [/* @__PURE__ */ H(l, { children: /* @__PURE__ */ U(u, {
|
|
647
470
|
className: "flex items-center gap-2",
|
|
648
471
|
children: [
|
|
649
|
-
/* @__PURE__ */ (
|
|
472
|
+
/* @__PURE__ */ H(E, { className: "h-5 w-5" }),
|
|
650
473
|
"Pending Approval",
|
|
651
|
-
n && /* @__PURE__ */ (
|
|
474
|
+
n && /* @__PURE__ */ U(a, {
|
|
652
475
|
variant: "outline",
|
|
653
476
|
className: "ml-2",
|
|
654
477
|
children: [
|
|
@@ -659,129 +482,129 @@ var U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
659
482
|
]
|
|
660
483
|
})
|
|
661
484
|
]
|
|
662
|
-
}) }), /* @__PURE__ */ (
|
|
485
|
+
}) }), /* @__PURE__ */ U(c, {
|
|
663
486
|
className: "space-y-4",
|
|
664
487
|
children: [
|
|
665
|
-
p && Object.keys(p).length > 0 && /* @__PURE__ */ (
|
|
488
|
+
p && Object.keys(p).length > 0 && /* @__PURE__ */ U("div", {
|
|
666
489
|
className: "p-3 bg-muted/50 rounded-lg",
|
|
667
|
-
children: [/* @__PURE__ */ (
|
|
490
|
+
children: [/* @__PURE__ */ H(f, {
|
|
668
491
|
className: "text-xs text-muted-foreground mb-2 block",
|
|
669
492
|
children: "Request Details"
|
|
670
|
-
}), /* @__PURE__ */ (
|
|
493
|
+
}), /* @__PURE__ */ H("div", {
|
|
671
494
|
className: "grid grid-cols-2 gap-2",
|
|
672
|
-
children: Object.entries(p).slice(0, 6).map(([e, t]) => /* @__PURE__ */ (
|
|
495
|
+
children: Object.entries(p).slice(0, 6).map(([e, t]) => /* @__PURE__ */ U("div", {
|
|
673
496
|
className: "text-sm",
|
|
674
|
-
children: [/* @__PURE__ */ (
|
|
497
|
+
children: [/* @__PURE__ */ U("span", {
|
|
675
498
|
className: "text-muted-foreground",
|
|
676
499
|
children: [e, ": "]
|
|
677
|
-
}), /* @__PURE__ */ (
|
|
500
|
+
}), /* @__PURE__ */ H("span", {
|
|
678
501
|
className: "font-medium",
|
|
679
502
|
children: String(t)
|
|
680
503
|
})]
|
|
681
504
|
}, e))
|
|
682
505
|
})]
|
|
683
506
|
}),
|
|
684
|
-
h && /* @__PURE__ */ (
|
|
507
|
+
h && /* @__PURE__ */ U("div", {
|
|
685
508
|
className: "space-y-2",
|
|
686
|
-
children: [/* @__PURE__ */ (
|
|
509
|
+
children: [/* @__PURE__ */ U(f, {
|
|
687
510
|
className: "flex items-center gap-2 text-sm",
|
|
688
|
-
children: [/* @__PURE__ */ (
|
|
689
|
-
}), /* @__PURE__ */ (
|
|
511
|
+
children: [/* @__PURE__ */ H(oe, { className: "h-4 w-4" }), "Comment"]
|
|
512
|
+
}), /* @__PURE__ */ H(d, {
|
|
690
513
|
value: g,
|
|
691
514
|
onChange: (e) => _(e.target.value),
|
|
692
515
|
placeholder: "Add a comment (optional)"
|
|
693
516
|
})]
|
|
694
517
|
}),
|
|
695
|
-
/* @__PURE__ */ (
|
|
518
|
+
/* @__PURE__ */ U("div", {
|
|
696
519
|
className: "flex items-center gap-2",
|
|
697
520
|
children: [
|
|
698
|
-
/* @__PURE__ */ (
|
|
521
|
+
/* @__PURE__ */ U(o, {
|
|
699
522
|
onClick: () => b("approve"),
|
|
700
523
|
disabled: v,
|
|
701
524
|
className: "bg-green-600 hover:bg-green-700",
|
|
702
|
-
children: [/* @__PURE__ */ (
|
|
525
|
+
children: [/* @__PURE__ */ H(C, { className: "h-4 w-4 mr-2" }), "Approve"]
|
|
703
526
|
}),
|
|
704
|
-
/* @__PURE__ */ (
|
|
527
|
+
/* @__PURE__ */ U(o, {
|
|
705
528
|
variant: "destructive",
|
|
706
529
|
onClick: () => b("reject"),
|
|
707
530
|
disabled: v,
|
|
708
|
-
children: [/* @__PURE__ */ (
|
|
531
|
+
children: [/* @__PURE__ */ H(B, { className: "h-4 w-4 mr-2" }), "Reject"]
|
|
709
532
|
}),
|
|
710
|
-
/* @__PURE__ */ (
|
|
533
|
+
/* @__PURE__ */ U(o, {
|
|
711
534
|
variant: "outline",
|
|
712
535
|
onClick: () => b("reassign"),
|
|
713
536
|
disabled: v,
|
|
714
|
-
children: [/* @__PURE__ */ (
|
|
537
|
+
children: [/* @__PURE__ */ H(N, { className: "h-4 w-4 mr-2" }), "Reassign"]
|
|
715
538
|
})
|
|
716
539
|
]
|
|
717
540
|
})
|
|
718
541
|
]
|
|
719
542
|
})] }),
|
|
720
|
-
m && r.length > 0 && /* @__PURE__ */ (
|
|
543
|
+
m && r.length > 0 && /* @__PURE__ */ U(s, { children: [/* @__PURE__ */ H(l, { children: /* @__PURE__ */ H(u, {
|
|
721
544
|
className: "text-sm",
|
|
722
545
|
children: "Approval History"
|
|
723
|
-
}) }), /* @__PURE__ */ (
|
|
546
|
+
}) }), /* @__PURE__ */ H(c, { children: /* @__PURE__ */ H("div", {
|
|
724
547
|
className: "space-y-3",
|
|
725
|
-
children: r.map((e, t) => /* @__PURE__ */ (
|
|
548
|
+
children: r.map((e, t) => /* @__PURE__ */ U("div", {
|
|
726
549
|
className: "flex items-start gap-3 p-3 rounded-lg border",
|
|
727
|
-
children: [/* @__PURE__ */ (
|
|
550
|
+
children: [/* @__PURE__ */ H("div", {
|
|
728
551
|
className: "mt-0.5",
|
|
729
|
-
children: /* @__PURE__ */ (
|
|
730
|
-
}), /* @__PURE__ */ (
|
|
552
|
+
children: /* @__PURE__ */ H(R, { className: "h-4 w-4 text-muted-foreground" })
|
|
553
|
+
}), /* @__PURE__ */ U("div", {
|
|
731
554
|
className: "flex-1 min-w-0",
|
|
732
|
-
children: [/* @__PURE__ */ (
|
|
555
|
+
children: [/* @__PURE__ */ U("div", {
|
|
733
556
|
className: "flex items-center gap-2 flex-wrap",
|
|
734
557
|
children: [
|
|
735
|
-
/* @__PURE__ */ (
|
|
558
|
+
/* @__PURE__ */ H("span", {
|
|
736
559
|
className: "font-medium text-sm",
|
|
737
560
|
children: e.actorName || e.actor
|
|
738
561
|
}),
|
|
739
562
|
x(e.action),
|
|
740
|
-
/* @__PURE__ */ (
|
|
563
|
+
/* @__PURE__ */ H("span", {
|
|
741
564
|
className: "text-xs text-muted-foreground",
|
|
742
565
|
children: new Date(e.timestamp).toLocaleString()
|
|
743
566
|
})
|
|
744
567
|
]
|
|
745
|
-
}), e.comment && /* @__PURE__ */ (
|
|
568
|
+
}), e.comment && /* @__PURE__ */ H("p", {
|
|
746
569
|
className: "text-sm text-muted-foreground mt-1",
|
|
747
570
|
children: e.comment
|
|
748
571
|
})]
|
|
749
572
|
})]
|
|
750
573
|
}, t))
|
|
751
574
|
}) })] }),
|
|
752
|
-
m && r.length === 0 && /* @__PURE__ */ (
|
|
575
|
+
m && r.length === 0 && /* @__PURE__ */ H(s, { children: /* @__PURE__ */ H(c, {
|
|
753
576
|
className: "p-6 text-center text-muted-foreground text-sm",
|
|
754
577
|
children: "No approval history yet"
|
|
755
578
|
}) })
|
|
756
579
|
]
|
|
757
580
|
});
|
|
758
|
-
},
|
|
581
|
+
}, q = {
|
|
759
582
|
record_created: "Record Created",
|
|
760
583
|
record_updated: "Record Updated",
|
|
761
584
|
record_deleted: "Record Deleted",
|
|
762
585
|
field_changed: "Field Changed",
|
|
763
586
|
scheduled: "Scheduled"
|
|
764
|
-
},
|
|
587
|
+
}, J = {
|
|
765
588
|
send_email: "Send Email",
|
|
766
589
|
update_field: "Update Field",
|
|
767
590
|
create_record: "Create Record",
|
|
768
591
|
delete_record: "Delete Record",
|
|
769
592
|
webhook: "Webhook",
|
|
770
593
|
notification: "Notification"
|
|
771
|
-
},
|
|
772
|
-
send_email: /* @__PURE__ */ (
|
|
773
|
-
update_field: /* @__PURE__ */ (
|
|
774
|
-
create_record: /* @__PURE__ */ (
|
|
775
|
-
delete_record: /* @__PURE__ */ (
|
|
776
|
-
webhook: /* @__PURE__ */ (
|
|
777
|
-
notification: /* @__PURE__ */ (
|
|
778
|
-
},
|
|
594
|
+
}, xe = {
|
|
595
|
+
send_email: /* @__PURE__ */ H(ae, { className: "h-4 w-4" }),
|
|
596
|
+
update_field: /* @__PURE__ */ H(te, { className: "h-4 w-4" }),
|
|
597
|
+
create_record: /* @__PURE__ */ H(M, { className: "h-4 w-4" }),
|
|
598
|
+
delete_record: /* @__PURE__ */ H(L, { className: "h-4 w-4" }),
|
|
599
|
+
webhook: /* @__PURE__ */ H(A, { className: "h-4 w-4" }),
|
|
600
|
+
notification: /* @__PURE__ */ H(S, { className: "h-4 w-4" })
|
|
601
|
+
}, Se = {
|
|
779
602
|
equals: "Equals",
|
|
780
603
|
not_equals: "Not Equals",
|
|
781
604
|
contains: "Contains",
|
|
782
605
|
greater_than: "Greater Than",
|
|
783
606
|
less_than: "Less Than"
|
|
784
|
-
},
|
|
607
|
+
}, Ce = () => ({
|
|
785
608
|
id: `auto-${Date.now()}`,
|
|
786
609
|
name: "",
|
|
787
610
|
description: "",
|
|
@@ -789,18 +612,18 @@ var U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
789
612
|
trigger: { type: "record_created" },
|
|
790
613
|
actions: [],
|
|
791
614
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
792
|
-
}), Y = ({ label: e, value: t, placeholder: n, onChange: r }) => /* @__PURE__ */ (
|
|
615
|
+
}), Y = ({ label: e, value: t, placeholder: n, onChange: r }) => /* @__PURE__ */ U("div", {
|
|
793
616
|
className: "space-y-1",
|
|
794
|
-
children: [/* @__PURE__ */ (
|
|
617
|
+
children: [/* @__PURE__ */ H(f, {
|
|
795
618
|
className: "text-xs",
|
|
796
619
|
children: e
|
|
797
|
-
}), /* @__PURE__ */ (
|
|
620
|
+
}), /* @__PURE__ */ H(d, {
|
|
798
621
|
value: t,
|
|
799
622
|
onChange: (e) => r(e.target.value),
|
|
800
623
|
placeholder: n
|
|
801
624
|
})]
|
|
802
|
-
}),
|
|
803
|
-
let [S, C] = i(e ??
|
|
625
|
+
}), we = ({ automation: e, objects: n = [], onSave: r, onCancel: b, className: x }) => {
|
|
626
|
+
let [S, C] = i(e ?? Ce()), w = t((e) => {
|
|
804
627
|
C((t) => ({
|
|
805
628
|
...t,
|
|
806
629
|
trigger: {
|
|
@@ -829,30 +652,30 @@ var U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
829
652
|
...t,
|
|
830
653
|
actions: t.actions.filter((t, n) => n !== e)
|
|
831
654
|
}));
|
|
832
|
-
}, []),
|
|
655
|
+
}, []), te = S.trigger.type !== "scheduled", O = S.trigger.type === "field_changed", k = S.trigger.type === "scheduled", A = n.find((e) => e.name === S.trigger.objectName)?.fields, ne = (e, t) => {
|
|
833
656
|
let n = (n, r) => D(t, { params: {
|
|
834
657
|
...e.params,
|
|
835
658
|
[n]: r
|
|
836
659
|
} });
|
|
837
660
|
switch (e.type) {
|
|
838
|
-
case "send_email": return /* @__PURE__ */ (
|
|
661
|
+
case "send_email": return /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(Y, {
|
|
839
662
|
label: "To",
|
|
840
663
|
value: e.params.to ?? "",
|
|
841
664
|
placeholder: "Recipient email",
|
|
842
665
|
onChange: (e) => n("to", e)
|
|
843
|
-
}), /* @__PURE__ */ (
|
|
666
|
+
}), /* @__PURE__ */ H(Y, {
|
|
844
667
|
label: "Subject",
|
|
845
668
|
value: e.params.subject ?? "",
|
|
846
669
|
placeholder: "Email subject",
|
|
847
670
|
onChange: (e) => n("subject", e)
|
|
848
671
|
})] });
|
|
849
|
-
case "webhook": return /* @__PURE__ */ (
|
|
672
|
+
case "webhook": return /* @__PURE__ */ H(Y, {
|
|
850
673
|
label: "URL",
|
|
851
674
|
value: e.params.url ?? "",
|
|
852
675
|
placeholder: "https://...",
|
|
853
676
|
onChange: (e) => n("url", e)
|
|
854
677
|
});
|
|
855
|
-
case "notification": return /* @__PURE__ */ (
|
|
678
|
+
case "notification": return /* @__PURE__ */ H(Y, {
|
|
856
679
|
label: "Message",
|
|
857
680
|
value: e.params.message ?? "",
|
|
858
681
|
placeholder: "Notification message",
|
|
@@ -860,7 +683,7 @@ var U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
860
683
|
});
|
|
861
684
|
case "update_field":
|
|
862
685
|
case "create_record":
|
|
863
|
-
case "delete_record": return /* @__PURE__ */ (
|
|
686
|
+
case "delete_record": return /* @__PURE__ */ H(Y, {
|
|
864
687
|
label: "Target Object",
|
|
865
688
|
value: e.params.objectName ?? "",
|
|
866
689
|
placeholder: "Object name",
|
|
@@ -869,140 +692,140 @@ var U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
869
692
|
default: return null;
|
|
870
693
|
}
|
|
871
694
|
};
|
|
872
|
-
return /* @__PURE__ */ (
|
|
695
|
+
return /* @__PURE__ */ U("div", {
|
|
873
696
|
className: x ?? "space-y-4",
|
|
874
697
|
children: [
|
|
875
|
-
/* @__PURE__ */ (
|
|
698
|
+
/* @__PURE__ */ U(s, { children: [/* @__PURE__ */ H(l, { children: /* @__PURE__ */ U(u, {
|
|
876
699
|
className: "flex items-center gap-2 text-sm",
|
|
877
|
-
children: [/* @__PURE__ */ (
|
|
878
|
-
}) }), /* @__PURE__ */ (
|
|
700
|
+
children: [/* @__PURE__ */ H(me, { className: "h-4 w-4 text-yellow-500" }), "Trigger"]
|
|
701
|
+
}) }), /* @__PURE__ */ U(c, {
|
|
879
702
|
className: "space-y-4",
|
|
880
703
|
children: [
|
|
881
|
-
/* @__PURE__ */ (
|
|
704
|
+
/* @__PURE__ */ U("div", {
|
|
882
705
|
className: "space-y-1",
|
|
883
|
-
children: [/* @__PURE__ */ (
|
|
706
|
+
children: [/* @__PURE__ */ H(f, {
|
|
884
707
|
className: "text-xs",
|
|
885
708
|
children: "Trigger Type"
|
|
886
|
-
}), /* @__PURE__ */ (
|
|
709
|
+
}), /* @__PURE__ */ U(p, {
|
|
887
710
|
value: S.trigger.type,
|
|
888
711
|
onValueChange: (e) => w({ type: e }),
|
|
889
|
-
children: [/* @__PURE__ */ (
|
|
712
|
+
children: [/* @__PURE__ */ H(g, { children: /* @__PURE__ */ H(_, { placeholder: "Select trigger type" }) }), /* @__PURE__ */ H(m, { children: Object.keys(q).map((e) => /* @__PURE__ */ H(h, {
|
|
890
713
|
value: e,
|
|
891
|
-
children:
|
|
714
|
+
children: q[e]
|
|
892
715
|
}, e)) })]
|
|
893
716
|
})]
|
|
894
717
|
}),
|
|
895
|
-
|
|
718
|
+
te && /* @__PURE__ */ U("div", {
|
|
896
719
|
className: "space-y-1",
|
|
897
|
-
children: [/* @__PURE__ */ (
|
|
720
|
+
children: [/* @__PURE__ */ H(f, {
|
|
898
721
|
className: "text-xs",
|
|
899
722
|
children: "Object"
|
|
900
|
-
}), n.length > 0 ? /* @__PURE__ */ (
|
|
723
|
+
}), n.length > 0 ? /* @__PURE__ */ U(p, {
|
|
901
724
|
value: S.trigger.objectName ?? "",
|
|
902
725
|
onValueChange: (e) => w({ objectName: e }),
|
|
903
|
-
children: [/* @__PURE__ */ (
|
|
726
|
+
children: [/* @__PURE__ */ H(g, { children: /* @__PURE__ */ H(_, { placeholder: "Select object" }) }), /* @__PURE__ */ H(m, { children: n.map((e) => /* @__PURE__ */ H(h, {
|
|
904
727
|
value: e.name,
|
|
905
728
|
children: e.label
|
|
906
729
|
}, e.name)) })]
|
|
907
|
-
}) : /* @__PURE__ */ (
|
|
730
|
+
}) : /* @__PURE__ */ H(d, {
|
|
908
731
|
value: S.trigger.objectName ?? "",
|
|
909
732
|
onChange: (e) => w({ objectName: e.target.value }),
|
|
910
733
|
placeholder: "Object name"
|
|
911
734
|
})]
|
|
912
735
|
}),
|
|
913
|
-
|
|
736
|
+
O && /* @__PURE__ */ U("div", {
|
|
914
737
|
className: "space-y-1",
|
|
915
|
-
children: [/* @__PURE__ */ (
|
|
738
|
+
children: [/* @__PURE__ */ H(f, {
|
|
916
739
|
className: "text-xs",
|
|
917
740
|
children: "Field"
|
|
918
|
-
}),
|
|
741
|
+
}), A ? /* @__PURE__ */ U(p, {
|
|
919
742
|
value: S.trigger.fieldName ?? "",
|
|
920
743
|
onValueChange: (e) => w({ fieldName: e }),
|
|
921
|
-
children: [/* @__PURE__ */ (
|
|
744
|
+
children: [/* @__PURE__ */ H(g, { children: /* @__PURE__ */ H(_, { placeholder: "Select field" }) }), /* @__PURE__ */ H(m, { children: Object.keys(A).map((e) => /* @__PURE__ */ H(h, {
|
|
922
745
|
value: e,
|
|
923
746
|
children: e
|
|
924
747
|
}, e)) })]
|
|
925
|
-
}) : /* @__PURE__ */ (
|
|
748
|
+
}) : /* @__PURE__ */ H(d, {
|
|
926
749
|
value: S.trigger.fieldName ?? "",
|
|
927
750
|
onChange: (e) => w({ fieldName: e.target.value }),
|
|
928
751
|
placeholder: "Field name"
|
|
929
752
|
})]
|
|
930
753
|
}),
|
|
931
|
-
|
|
754
|
+
k && /* @__PURE__ */ U("div", {
|
|
932
755
|
className: "space-y-1",
|
|
933
|
-
children: [/* @__PURE__ */ (
|
|
756
|
+
children: [/* @__PURE__ */ U(f, {
|
|
934
757
|
className: "text-xs flex items-center gap-1",
|
|
935
|
-
children: [/* @__PURE__ */ (
|
|
936
|
-
}), /* @__PURE__ */ (
|
|
758
|
+
children: [/* @__PURE__ */ H(E, { className: "h-3 w-3" }), " Cron Schedule"]
|
|
759
|
+
}), /* @__PURE__ */ H(d, {
|
|
937
760
|
value: S.trigger.schedule ?? "",
|
|
938
761
|
onChange: (e) => w({ schedule: e.target.value }),
|
|
939
762
|
placeholder: "e.g. 0 9 * * 1-5"
|
|
940
763
|
})]
|
|
941
764
|
}),
|
|
942
|
-
/* @__PURE__ */ (
|
|
765
|
+
/* @__PURE__ */ U("div", {
|
|
943
766
|
className: "space-y-1",
|
|
944
|
-
children: [/* @__PURE__ */ (
|
|
767
|
+
children: [/* @__PURE__ */ H(f, {
|
|
945
768
|
className: "text-xs",
|
|
946
769
|
children: "Condition (optional)"
|
|
947
|
-
}), /* @__PURE__ */ (
|
|
770
|
+
}), /* @__PURE__ */ H(d, {
|
|
948
771
|
value: S.trigger.condition ?? "",
|
|
949
772
|
onChange: (e) => w({ condition: e.target.value }),
|
|
950
773
|
placeholder: "e.g. ${data.status === \"active\"}"
|
|
951
774
|
})]
|
|
952
775
|
}),
|
|
953
|
-
/* @__PURE__ */ (
|
|
954
|
-
/* @__PURE__ */ (
|
|
776
|
+
/* @__PURE__ */ H(v, {}),
|
|
777
|
+
/* @__PURE__ */ U("div", {
|
|
955
778
|
className: "space-y-3",
|
|
956
779
|
children: [
|
|
957
|
-
/* @__PURE__ */ (
|
|
780
|
+
/* @__PURE__ */ H(f, {
|
|
958
781
|
className: "text-xs font-medium",
|
|
959
782
|
children: "Conditional Trigger (optional)"
|
|
960
783
|
}),
|
|
961
|
-
/* @__PURE__ */ (
|
|
784
|
+
/* @__PURE__ */ H("p", {
|
|
962
785
|
className: "text-xs text-muted-foreground",
|
|
963
786
|
children: "Run only when a field matches a specific value."
|
|
964
787
|
}),
|
|
965
|
-
/* @__PURE__ */ (
|
|
788
|
+
/* @__PURE__ */ U("div", {
|
|
966
789
|
className: "grid grid-cols-3 gap-2",
|
|
967
790
|
children: [
|
|
968
|
-
/* @__PURE__ */ (
|
|
791
|
+
/* @__PURE__ */ U("div", {
|
|
969
792
|
className: "space-y-1",
|
|
970
|
-
children: [/* @__PURE__ */ (
|
|
793
|
+
children: [/* @__PURE__ */ H(f, {
|
|
971
794
|
className: "text-xs",
|
|
972
795
|
children: "Field"
|
|
973
|
-
}),
|
|
796
|
+
}), A ? /* @__PURE__ */ U(p, {
|
|
974
797
|
value: S.trigger.conditionField ?? "",
|
|
975
798
|
onValueChange: (e) => w({ conditionField: e }),
|
|
976
|
-
children: [/* @__PURE__ */ (
|
|
799
|
+
children: [/* @__PURE__ */ H(g, { children: /* @__PURE__ */ H(_, { placeholder: "Field" }) }), /* @__PURE__ */ H(m, { children: Object.keys(A).map((e) => /* @__PURE__ */ H(h, {
|
|
977
800
|
value: e,
|
|
978
801
|
children: e
|
|
979
802
|
}, e)) })]
|
|
980
|
-
}) : /* @__PURE__ */ (
|
|
803
|
+
}) : /* @__PURE__ */ H(d, {
|
|
981
804
|
value: S.trigger.conditionField ?? "",
|
|
982
805
|
onChange: (e) => w({ conditionField: e.target.value }),
|
|
983
806
|
placeholder: "e.g. status"
|
|
984
807
|
})]
|
|
985
808
|
}),
|
|
986
|
-
/* @__PURE__ */ (
|
|
809
|
+
/* @__PURE__ */ U("div", {
|
|
987
810
|
className: "space-y-1",
|
|
988
|
-
children: [/* @__PURE__ */ (
|
|
811
|
+
children: [/* @__PURE__ */ H(f, {
|
|
989
812
|
className: "text-xs",
|
|
990
813
|
children: "Operator"
|
|
991
|
-
}), /* @__PURE__ */ (
|
|
814
|
+
}), /* @__PURE__ */ U(p, {
|
|
992
815
|
value: S.trigger.conditionOperator ?? "equals",
|
|
993
816
|
onValueChange: (e) => w({ conditionOperator: e }),
|
|
994
|
-
children: [/* @__PURE__ */ (
|
|
817
|
+
children: [/* @__PURE__ */ H(g, { children: /* @__PURE__ */ H(_, { placeholder: "Operator" }) }), /* @__PURE__ */ H(m, { children: Object.keys(Se).map((e) => /* @__PURE__ */ H(h, {
|
|
995
818
|
value: e,
|
|
996
|
-
children:
|
|
819
|
+
children: Se[e]
|
|
997
820
|
}, e)) })]
|
|
998
821
|
})]
|
|
999
822
|
}),
|
|
1000
|
-
/* @__PURE__ */ (
|
|
823
|
+
/* @__PURE__ */ U("div", {
|
|
1001
824
|
className: "space-y-1",
|
|
1002
|
-
children: [/* @__PURE__ */ (
|
|
825
|
+
children: [/* @__PURE__ */ H(f, {
|
|
1003
826
|
className: "text-xs",
|
|
1004
827
|
children: "Value"
|
|
1005
|
-
}), /* @__PURE__ */ (
|
|
828
|
+
}), /* @__PURE__ */ H(d, {
|
|
1006
829
|
value: S.trigger.conditionValue ?? "",
|
|
1007
830
|
onChange: (e) => w({ conditionValue: e.target.value }),
|
|
1008
831
|
placeholder: "e.g. urgent"
|
|
@@ -1014,111 +837,111 @@ var U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
1014
837
|
})
|
|
1015
838
|
]
|
|
1016
839
|
})] }),
|
|
1017
|
-
/* @__PURE__ */ (
|
|
840
|
+
/* @__PURE__ */ U(s, { children: [/* @__PURE__ */ H(l, { children: /* @__PURE__ */ U(u, {
|
|
1018
841
|
className: "flex items-center gap-2 text-sm",
|
|
1019
842
|
children: [
|
|
1020
|
-
/* @__PURE__ */ (
|
|
843
|
+
/* @__PURE__ */ H(P, { className: "h-4 w-4" }),
|
|
1021
844
|
" Actions",
|
|
1022
|
-
/* @__PURE__ */ (
|
|
845
|
+
/* @__PURE__ */ H(a, {
|
|
1023
846
|
variant: "secondary",
|
|
1024
847
|
className: "ml-auto",
|
|
1025
848
|
children: S.actions.length
|
|
1026
849
|
})
|
|
1027
850
|
]
|
|
1028
|
-
}) }), /* @__PURE__ */ (
|
|
851
|
+
}) }), /* @__PURE__ */ U(c, {
|
|
1029
852
|
className: "space-y-3",
|
|
1030
853
|
children: [
|
|
1031
|
-
S.actions.length > 1 && /* @__PURE__ */ (
|
|
854
|
+
S.actions.length > 1 && /* @__PURE__ */ U("div", {
|
|
1032
855
|
className: "flex items-center gap-2 text-xs text-muted-foreground",
|
|
1033
|
-
children: [/* @__PURE__ */ (
|
|
856
|
+
children: [/* @__PURE__ */ H(f, {
|
|
1034
857
|
className: "text-xs",
|
|
1035
858
|
children: "Execution"
|
|
1036
|
-
}), /* @__PURE__ */ (
|
|
859
|
+
}), /* @__PURE__ */ U(p, {
|
|
1037
860
|
value: S.executionMode ?? "sequential",
|
|
1038
861
|
onValueChange: (e) => C((t) => ({
|
|
1039
862
|
...t,
|
|
1040
863
|
executionMode: e
|
|
1041
864
|
})),
|
|
1042
|
-
children: [/* @__PURE__ */ (
|
|
865
|
+
children: [/* @__PURE__ */ H(g, {
|
|
1043
866
|
className: "h-7 w-36",
|
|
1044
|
-
children: /* @__PURE__ */ (
|
|
1045
|
-
}), /* @__PURE__ */ (
|
|
867
|
+
children: /* @__PURE__ */ H(_, {})
|
|
868
|
+
}), /* @__PURE__ */ U(m, { children: [/* @__PURE__ */ H(h, {
|
|
1046
869
|
value: "sequential",
|
|
1047
870
|
children: "Sequential"
|
|
1048
|
-
}), /* @__PURE__ */ (
|
|
871
|
+
}), /* @__PURE__ */ H(h, {
|
|
1049
872
|
value: "parallel",
|
|
1050
873
|
children: "Parallel"
|
|
1051
874
|
})] })]
|
|
1052
875
|
})]
|
|
1053
876
|
}),
|
|
1054
|
-
S.actions.map((e, t) => /* @__PURE__ */ (
|
|
877
|
+
S.actions.map((e, t) => /* @__PURE__ */ U("div", {
|
|
1055
878
|
className: "rounded-lg border p-3 space-y-3",
|
|
1056
879
|
children: [
|
|
1057
|
-
/* @__PURE__ */ (
|
|
880
|
+
/* @__PURE__ */ U("div", {
|
|
1058
881
|
className: "flex items-center justify-between",
|
|
1059
|
-
children: [/* @__PURE__ */ (
|
|
882
|
+
children: [/* @__PURE__ */ U("div", {
|
|
1060
883
|
className: "flex items-center gap-2",
|
|
1061
884
|
children: [
|
|
1062
|
-
|
|
1063
|
-
/* @__PURE__ */ (
|
|
885
|
+
xe[e.type],
|
|
886
|
+
/* @__PURE__ */ H("span", {
|
|
1064
887
|
className: "text-sm font-medium",
|
|
1065
888
|
children: S.actions.length > 1 && (S.executionMode ?? "sequential") === "sequential" ? `Step ${t + 1}` : `Action ${t + 1}`
|
|
1066
889
|
}),
|
|
1067
|
-
t > 0 && S.actions.length > 1 && (S.executionMode ?? "sequential") === "sequential" && /* @__PURE__ */ (
|
|
890
|
+
t > 0 && S.actions.length > 1 && (S.executionMode ?? "sequential") === "sequential" && /* @__PURE__ */ H(a, {
|
|
1068
891
|
variant: "outline",
|
|
1069
892
|
className: "text-[10px] px-1",
|
|
1070
893
|
children: "then"
|
|
1071
894
|
})
|
|
1072
895
|
]
|
|
1073
|
-
}), /* @__PURE__ */ (
|
|
896
|
+
}), /* @__PURE__ */ H(o, {
|
|
1074
897
|
size: "sm",
|
|
1075
898
|
variant: "ghost",
|
|
1076
899
|
className: "h-7 w-7 p-0 text-red-500 hover:text-red-700",
|
|
1077
900
|
onClick: () => ee(t),
|
|
1078
|
-
children: /* @__PURE__ */ (
|
|
901
|
+
children: /* @__PURE__ */ H(L, { className: "h-4 w-4" })
|
|
1079
902
|
})]
|
|
1080
903
|
}),
|
|
1081
|
-
/* @__PURE__ */ (
|
|
904
|
+
/* @__PURE__ */ U("div", {
|
|
1082
905
|
className: "space-y-1",
|
|
1083
|
-
children: [/* @__PURE__ */ (
|
|
906
|
+
children: [/* @__PURE__ */ H(f, {
|
|
1084
907
|
className: "text-xs",
|
|
1085
908
|
children: "Action Type"
|
|
1086
|
-
}), /* @__PURE__ */ (
|
|
909
|
+
}), /* @__PURE__ */ U(p, {
|
|
1087
910
|
value: e.type,
|
|
1088
911
|
onValueChange: (e) => D(t, {
|
|
1089
912
|
type: e,
|
|
1090
913
|
params: {}
|
|
1091
914
|
}),
|
|
1092
|
-
children: [/* @__PURE__ */ (
|
|
915
|
+
children: [/* @__PURE__ */ H(g, { children: /* @__PURE__ */ H(_, {}) }), /* @__PURE__ */ H(m, { children: Object.keys(J).map((e) => /* @__PURE__ */ H(h, {
|
|
1093
916
|
value: e,
|
|
1094
|
-
children:
|
|
917
|
+
children: J[e]
|
|
1095
918
|
}, e)) })]
|
|
1096
919
|
})]
|
|
1097
920
|
}),
|
|
1098
|
-
|
|
921
|
+
ne(e, t)
|
|
1099
922
|
]
|
|
1100
923
|
}, t)),
|
|
1101
|
-
/* @__PURE__ */ (
|
|
924
|
+
/* @__PURE__ */ U(o, {
|
|
1102
925
|
variant: "outline",
|
|
1103
926
|
size: "sm",
|
|
1104
927
|
className: "w-full",
|
|
1105
928
|
onClick: T,
|
|
1106
|
-
children: [/* @__PURE__ */ (
|
|
929
|
+
children: [/* @__PURE__ */ H(M, { className: "h-4 w-4 mr-2" }), " Add Action"]
|
|
1107
930
|
})
|
|
1108
931
|
]
|
|
1109
932
|
})] }),
|
|
1110
|
-
/* @__PURE__ */ (
|
|
933
|
+
/* @__PURE__ */ U(s, { children: [/* @__PURE__ */ H(l, { children: /* @__PURE__ */ H(u, {
|
|
1111
934
|
className: "text-sm",
|
|
1112
935
|
children: "Summary"
|
|
1113
|
-
}) }), /* @__PURE__ */ (
|
|
936
|
+
}) }), /* @__PURE__ */ U(c, {
|
|
1114
937
|
className: "space-y-4",
|
|
1115
938
|
children: [
|
|
1116
|
-
/* @__PURE__ */ (
|
|
939
|
+
/* @__PURE__ */ U("div", {
|
|
1117
940
|
className: "space-y-1",
|
|
1118
|
-
children: [/* @__PURE__ */ (
|
|
941
|
+
children: [/* @__PURE__ */ H(f, {
|
|
1119
942
|
className: "text-xs",
|
|
1120
943
|
children: "Name"
|
|
1121
|
-
}), /* @__PURE__ */ (
|
|
944
|
+
}), /* @__PURE__ */ H(d, {
|
|
1122
945
|
value: S.name,
|
|
1123
946
|
onChange: (e) => C((t) => ({
|
|
1124
947
|
...t,
|
|
@@ -1127,12 +950,12 @@ var U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
1127
950
|
placeholder: "Automation name"
|
|
1128
951
|
})]
|
|
1129
952
|
}),
|
|
1130
|
-
/* @__PURE__ */ (
|
|
953
|
+
/* @__PURE__ */ U("div", {
|
|
1131
954
|
className: "space-y-1",
|
|
1132
|
-
children: [/* @__PURE__ */ (
|
|
955
|
+
children: [/* @__PURE__ */ H(f, {
|
|
1133
956
|
className: "text-xs",
|
|
1134
957
|
children: "Description"
|
|
1135
|
-
}), /* @__PURE__ */ (
|
|
958
|
+
}), /* @__PURE__ */ H(d, {
|
|
1136
959
|
value: S.description ?? "",
|
|
1137
960
|
onChange: (e) => C((t) => ({
|
|
1138
961
|
...t,
|
|
@@ -1141,12 +964,12 @@ var U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
1141
964
|
placeholder: "Optional description"
|
|
1142
965
|
})]
|
|
1143
966
|
}),
|
|
1144
|
-
/* @__PURE__ */ (
|
|
967
|
+
/* @__PURE__ */ U("div", {
|
|
1145
968
|
className: "flex items-center justify-between",
|
|
1146
|
-
children: [/* @__PURE__ */ (
|
|
969
|
+
children: [/* @__PURE__ */ H(f, {
|
|
1147
970
|
className: "text-sm",
|
|
1148
971
|
children: "Enabled"
|
|
1149
|
-
}), /* @__PURE__ */ (
|
|
972
|
+
}), /* @__PURE__ */ H(y, {
|
|
1150
973
|
checked: S.enabled,
|
|
1151
974
|
onCheckedChange: (e) => C((t) => ({
|
|
1152
975
|
...t,
|
|
@@ -1154,30 +977,30 @@ var U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
1154
977
|
}))
|
|
1155
978
|
})]
|
|
1156
979
|
}),
|
|
1157
|
-
/* @__PURE__ */ (
|
|
1158
|
-
/* @__PURE__ */ (
|
|
980
|
+
/* @__PURE__ */ H(v, {}),
|
|
981
|
+
/* @__PURE__ */ U("div", {
|
|
1159
982
|
className: "flex items-center gap-2 justify-end",
|
|
1160
|
-
children: [b && /* @__PURE__ */ (
|
|
983
|
+
children: [b && /* @__PURE__ */ H(o, {
|
|
1161
984
|
variant: "outline",
|
|
1162
985
|
size: "sm",
|
|
1163
986
|
onClick: b,
|
|
1164
987
|
children: "Cancel"
|
|
1165
|
-
}), /* @__PURE__ */ (
|
|
988
|
+
}), /* @__PURE__ */ U(o, {
|
|
1166
989
|
size: "sm",
|
|
1167
990
|
onClick: () => r?.(S),
|
|
1168
|
-
children: [/* @__PURE__ */ (
|
|
991
|
+
children: [/* @__PURE__ */ H(me, { className: "h-4 w-4 mr-2" }), " Save Automation"]
|
|
1169
992
|
})]
|
|
1170
993
|
})
|
|
1171
994
|
]
|
|
1172
995
|
})] })
|
|
1173
996
|
]
|
|
1174
997
|
});
|
|
1175
|
-
},
|
|
998
|
+
}, Te = {
|
|
1176
999
|
success: "default",
|
|
1177
1000
|
failure: "destructive",
|
|
1178
1001
|
running: "secondary",
|
|
1179
1002
|
pending: "outline"
|
|
1180
|
-
},
|
|
1003
|
+
}, Ee = {
|
|
1181
1004
|
success: "Success",
|
|
1182
1005
|
failure: "Failed",
|
|
1183
1006
|
running: "Running",
|
|
@@ -1190,47 +1013,47 @@ function De(e, t) {
|
|
|
1190
1013
|
let r = Math.floor(n / 1e3);
|
|
1191
1014
|
return r < 60 ? `${r}s` : `${Math.floor(r / 60)}m ${r % 60}s`;
|
|
1192
1015
|
}
|
|
1193
|
-
var Oe = ({ runs: e = [], className: t }) => /* @__PURE__ */ (
|
|
1016
|
+
var Oe = ({ runs: e = [], className: t }) => /* @__PURE__ */ U(s, {
|
|
1194
1017
|
className: t,
|
|
1195
|
-
children: [/* @__PURE__ */ (
|
|
1018
|
+
children: [/* @__PURE__ */ H(l, { children: /* @__PURE__ */ U(u, {
|
|
1196
1019
|
className: "flex items-center gap-2 text-sm",
|
|
1197
1020
|
children: [
|
|
1198
|
-
/* @__PURE__ */ (
|
|
1021
|
+
/* @__PURE__ */ H(E, { className: "h-4 w-4" }),
|
|
1199
1022
|
"Automation Run History",
|
|
1200
|
-
/* @__PURE__ */ (
|
|
1023
|
+
/* @__PURE__ */ H(a, {
|
|
1201
1024
|
variant: "outline",
|
|
1202
1025
|
className: "ml-auto",
|
|
1203
1026
|
children: e.length
|
|
1204
1027
|
})
|
|
1205
1028
|
]
|
|
1206
|
-
}) }), /* @__PURE__ */ (
|
|
1029
|
+
}) }), /* @__PURE__ */ H(c, { children: e.length === 0 ? /* @__PURE__ */ H("p", {
|
|
1207
1030
|
className: "text-sm text-muted-foreground text-center py-6",
|
|
1208
1031
|
children: "No automation runs yet"
|
|
1209
|
-
}) : /* @__PURE__ */ (
|
|
1032
|
+
}) : /* @__PURE__ */ H("div", {
|
|
1210
1033
|
className: "space-y-2",
|
|
1211
|
-
children: e.map((e) => /* @__PURE__ */ (
|
|
1034
|
+
children: e.map((e) => /* @__PURE__ */ U("div", {
|
|
1212
1035
|
className: "flex items-start gap-3 rounded-lg border p-3",
|
|
1213
|
-
children: [/* @__PURE__ */ (
|
|
1214
|
-
variant:
|
|
1215
|
-
children:
|
|
1216
|
-
}), /* @__PURE__ */ (
|
|
1036
|
+
children: [/* @__PURE__ */ H(a, {
|
|
1037
|
+
variant: Te[e.status],
|
|
1038
|
+
children: Ee[e.status]
|
|
1039
|
+
}), /* @__PURE__ */ U("div", {
|
|
1217
1040
|
className: "flex-1 min-w-0 space-y-1",
|
|
1218
1041
|
children: [
|
|
1219
|
-
/* @__PURE__ */ (
|
|
1042
|
+
/* @__PURE__ */ U("div", {
|
|
1220
1043
|
className: "flex items-center gap-2 flex-wrap",
|
|
1221
|
-
children: [/* @__PURE__ */ (
|
|
1044
|
+
children: [/* @__PURE__ */ H("span", {
|
|
1222
1045
|
className: "text-sm font-medium",
|
|
1223
1046
|
children: e.automationName
|
|
1224
|
-
}), e.triggerEvent && /* @__PURE__ */ (
|
|
1047
|
+
}), e.triggerEvent && /* @__PURE__ */ U("span", {
|
|
1225
1048
|
className: "text-xs text-muted-foreground",
|
|
1226
1049
|
children: ["— ", e.triggerEvent]
|
|
1227
1050
|
})]
|
|
1228
1051
|
}),
|
|
1229
|
-
/* @__PURE__ */ (
|
|
1052
|
+
/* @__PURE__ */ U("div", {
|
|
1230
1053
|
className: "flex items-center gap-3 text-xs text-muted-foreground",
|
|
1231
|
-
children: [/* @__PURE__ */ (
|
|
1054
|
+
children: [/* @__PURE__ */ H("span", { children: new Date(e.startedAt).toLocaleString() }), /* @__PURE__ */ U("span", { children: ["Duration: ", De(e.startedAt, e.completedAt)] })]
|
|
1232
1055
|
}),
|
|
1233
|
-
e.status === "failure" && e.error && /* @__PURE__ */ (
|
|
1056
|
+
e.status === "failure" && e.error && /* @__PURE__ */ H("p", {
|
|
1234
1057
|
className: "text-xs text-red-600 mt-1",
|
|
1235
1058
|
children: e.error
|
|
1236
1059
|
})
|
|
@@ -1241,10 +1064,10 @@ var Oe = ({ runs: e = [], className: t }) => /* @__PURE__ */ (0, G.jsxs)(s, {
|
|
|
1241
1064
|
});
|
|
1242
1065
|
//#endregion
|
|
1243
1066
|
//#region src/FlowDesigner.tsx
|
|
1244
|
-
function
|
|
1245
|
-
return
|
|
1067
|
+
function X(...e) {
|
|
1068
|
+
return ve(_e(e));
|
|
1246
1069
|
}
|
|
1247
|
-
var
|
|
1070
|
+
var Z = 130, Q = 52, ke = {
|
|
1248
1071
|
start: "Start",
|
|
1249
1072
|
end: "End",
|
|
1250
1073
|
task: "Task",
|
|
@@ -1259,22 +1082,22 @@ var Q = 130, Ae = 52, $ = {
|
|
|
1259
1082
|
delay: "Delay",
|
|
1260
1083
|
notification: "Notification",
|
|
1261
1084
|
webhook: "Webhook"
|
|
1085
|
+
}, Ae = {
|
|
1086
|
+
start: /* @__PURE__ */ H(j, { className: "h-3.5 w-3.5 text-green-500" }),
|
|
1087
|
+
end: /* @__PURE__ */ H(I, { className: "h-3.5 w-3.5 text-red-500" }),
|
|
1088
|
+
task: /* @__PURE__ */ H(w, { className: "h-3.5 w-3.5 text-blue-500" }),
|
|
1089
|
+
user_task: /* @__PURE__ */ H(z, { className: "h-3.5 w-3.5 text-blue-600" }),
|
|
1090
|
+
service_task: /* @__PURE__ */ H(P, { className: "h-3.5 w-3.5 text-blue-400" }),
|
|
1091
|
+
script_task: /* @__PURE__ */ H(D, { className: "h-3.5 w-3.5 text-indigo-500" }),
|
|
1092
|
+
approval: /* @__PURE__ */ H(z, { className: "h-3.5 w-3.5 text-purple-500" }),
|
|
1093
|
+
condition: /* @__PURE__ */ H(O, { className: "h-3.5 w-3.5 text-orange-500" }),
|
|
1094
|
+
parallel_gateway: /* @__PURE__ */ H(O, { className: "h-3.5 w-3.5 text-teal-500" }),
|
|
1095
|
+
join_gateway: /* @__PURE__ */ H(k, { className: "h-3.5 w-3.5 text-teal-600" }),
|
|
1096
|
+
boundary_event: /* @__PURE__ */ H(b, { className: "h-3.5 w-3.5 text-amber-500" }),
|
|
1097
|
+
delay: /* @__PURE__ */ H(E, { className: "h-3.5 w-3.5 text-gray-500" }),
|
|
1098
|
+
notification: /* @__PURE__ */ H(S, { className: "h-3.5 w-3.5 text-yellow-500" }),
|
|
1099
|
+
webhook: /* @__PURE__ */ H(A, { className: "h-3.5 w-3.5 text-cyan-500" })
|
|
1262
1100
|
}, je = {
|
|
1263
|
-
start: /* @__PURE__ */ (0, G.jsx)(N, { className: "h-3.5 w-3.5 text-green-500" }),
|
|
1264
|
-
end: /* @__PURE__ */ (0, G.jsx)(R, { className: "h-3.5 w-3.5 text-red-500" }),
|
|
1265
|
-
task: /* @__PURE__ */ (0, G.jsx)(w, { className: "h-3.5 w-3.5 text-blue-500" }),
|
|
1266
|
-
user_task: /* @__PURE__ */ (0, G.jsx)(V, { className: "h-3.5 w-3.5 text-blue-600" }),
|
|
1267
|
-
service_task: /* @__PURE__ */ (0, G.jsx)(I, { className: "h-3.5 w-3.5 text-blue-400" }),
|
|
1268
|
-
script_task: /* @__PURE__ */ (0, G.jsx)(D, { className: "h-3.5 w-3.5 text-indigo-500" }),
|
|
1269
|
-
approval: /* @__PURE__ */ (0, G.jsx)(V, { className: "h-3.5 w-3.5 text-purple-500" }),
|
|
1270
|
-
condition: /* @__PURE__ */ (0, G.jsx)(k, { className: "h-3.5 w-3.5 text-orange-500" }),
|
|
1271
|
-
parallel_gateway: /* @__PURE__ */ (0, G.jsx)(k, { className: "h-3.5 w-3.5 text-teal-500" }),
|
|
1272
|
-
join_gateway: /* @__PURE__ */ (0, G.jsx)(A, { className: "h-3.5 w-3.5 text-teal-600" }),
|
|
1273
|
-
boundary_event: /* @__PURE__ */ (0, G.jsx)(b, { className: "h-3.5 w-3.5 text-amber-500" }),
|
|
1274
|
-
delay: /* @__PURE__ */ (0, G.jsx)(E, { className: "h-3.5 w-3.5 text-gray-500" }),
|
|
1275
|
-
notification: /* @__PURE__ */ (0, G.jsx)(S, { className: "h-3.5 w-3.5 text-yellow-500" }),
|
|
1276
|
-
webhook: /* @__PURE__ */ (0, G.jsx)(j, { className: "h-3.5 w-3.5 text-cyan-500" })
|
|
1277
|
-
}, Me = {
|
|
1278
1101
|
start: "border-green-400 bg-green-50 dark:bg-green-950",
|
|
1279
1102
|
end: "border-red-400 bg-red-50 dark:bg-red-950",
|
|
1280
1103
|
task: "border-blue-300 bg-blue-50 dark:bg-blue-950",
|
|
@@ -1289,28 +1112,28 @@ var Q = 130, Ae = 52, $ = {
|
|
|
1289
1112
|
delay: "border-gray-400 bg-gray-50 dark:bg-gray-900",
|
|
1290
1113
|
notification: "border-yellow-400 bg-yellow-50 dark:bg-yellow-950",
|
|
1291
1114
|
webhook: "border-cyan-400 bg-cyan-50 dark:bg-cyan-950"
|
|
1292
|
-
},
|
|
1115
|
+
}, Me = {
|
|
1293
1116
|
pending: {
|
|
1294
1117
|
color: "text-muted-foreground",
|
|
1295
|
-
icon: /* @__PURE__ */ (
|
|
1118
|
+
icon: /* @__PURE__ */ H(E, { className: "h-3 w-3" })
|
|
1296
1119
|
},
|
|
1297
1120
|
running: {
|
|
1298
1121
|
color: "text-blue-500",
|
|
1299
|
-
icon: /* @__PURE__ */ (
|
|
1122
|
+
icon: /* @__PURE__ */ H(ie, { className: "h-3 w-3 animate-spin" })
|
|
1300
1123
|
},
|
|
1301
1124
|
completed: {
|
|
1302
1125
|
color: "text-green-500",
|
|
1303
|
-
icon: /* @__PURE__ */ (
|
|
1126
|
+
icon: /* @__PURE__ */ H(w, { className: "h-3 w-3" })
|
|
1304
1127
|
},
|
|
1305
1128
|
failed: {
|
|
1306
1129
|
color: "text-red-500",
|
|
1307
|
-
icon: /* @__PURE__ */ (
|
|
1130
|
+
icon: /* @__PURE__ */ H(b, { className: "h-3 w-3" })
|
|
1308
1131
|
},
|
|
1309
1132
|
skipped: {
|
|
1310
1133
|
color: "text-gray-400",
|
|
1311
|
-
icon: /* @__PURE__ */ (
|
|
1134
|
+
icon: /* @__PURE__ */ H(F, { className: "h-3 w-3" })
|
|
1312
1135
|
}
|
|
1313
|
-
},
|
|
1136
|
+
}, Ne = [
|
|
1314
1137
|
"task",
|
|
1315
1138
|
"user_task",
|
|
1316
1139
|
"service_task",
|
|
@@ -1323,18 +1146,18 @@ var Q = 130, Ae = 52, $ = {
|
|
|
1323
1146
|
"delay",
|
|
1324
1147
|
"notification",
|
|
1325
1148
|
"webhook"
|
|
1326
|
-
],
|
|
1149
|
+
], Pe = {
|
|
1327
1150
|
allow: "Allow (run concurrently)",
|
|
1328
1151
|
forbid: "Forbid (skip new)",
|
|
1329
1152
|
replace: "Replace (cancel existing)",
|
|
1330
1153
|
queue: "Queue (run after current)"
|
|
1331
|
-
},
|
|
1154
|
+
}, $ = {
|
|
1332
1155
|
condition: "Condition",
|
|
1333
1156
|
manual: "Manual",
|
|
1334
1157
|
webhook: "Webhook",
|
|
1335
1158
|
timer: "Timer",
|
|
1336
1159
|
signal: "Signal"
|
|
1337
|
-
},
|
|
1160
|
+
}, Fe = () => [{
|
|
1338
1161
|
id: "start-1",
|
|
1339
1162
|
type: "start",
|
|
1340
1163
|
label: "Start",
|
|
@@ -1350,8 +1173,8 @@ var Q = 130, Ae = 52, $ = {
|
|
|
1350
1173
|
x: 500,
|
|
1351
1174
|
y: 200
|
|
1352
1175
|
}
|
|
1353
|
-
}],
|
|
1354
|
-
function
|
|
1176
|
+
}], Ie = () => [];
|
|
1177
|
+
function Le(e) {
|
|
1355
1178
|
let [n, r] = i([e]), [a, o] = i(0);
|
|
1356
1179
|
return {
|
|
1357
1180
|
current: n[a],
|
|
@@ -1368,7 +1191,7 @@ function ze(e) {
|
|
|
1368
1191
|
canRedo: a < n.length - 1
|
|
1369
1192
|
};
|
|
1370
1193
|
}
|
|
1371
|
-
function
|
|
1194
|
+
function Re(e, t, n) {
|
|
1372
1195
|
let r = [], i = ["boundary_event"];
|
|
1373
1196
|
e.forEach((e) => {
|
|
1374
1197
|
i.includes(e.type) && r.push(`Node "${e.label}" (${e.type}) has limited BPMN mapping.`);
|
|
@@ -1379,7 +1202,7 @@ function Be(e, t, n) {
|
|
|
1379
1202
|
" xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\"",
|
|
1380
1203
|
" targetNamespace=\"http://objectui.org/bpmn\">",
|
|
1381
1204
|
` <process id="process-1" name="${n}" isExecutable="true">`,
|
|
1382
|
-
...e.map((e) => ` <${
|
|
1205
|
+
...e.map((e) => ` <${ze(e.type)} id="${e.id}" name="${e.label}" />`),
|
|
1383
1206
|
...t.map((e) => ` <sequenceFlow ${[
|
|
1384
1207
|
`id="${e.id}"`,
|
|
1385
1208
|
`sourceRef="${e.source}"`,
|
|
@@ -1397,7 +1220,7 @@ function Be(e, t, n) {
|
|
|
1397
1220
|
bpmnXml: a
|
|
1398
1221
|
};
|
|
1399
1222
|
}
|
|
1400
|
-
function
|
|
1223
|
+
function ze(e) {
|
|
1401
1224
|
return {
|
|
1402
1225
|
start: "startEvent",
|
|
1403
1226
|
end: "endEvent",
|
|
@@ -1415,17 +1238,17 @@ function Ve(e) {
|
|
|
1415
1238
|
webhook: "serviceTask"
|
|
1416
1239
|
}[e] ?? "task";
|
|
1417
1240
|
}
|
|
1418
|
-
function
|
|
1419
|
-
let n = e.position.x +
|
|
1241
|
+
function Be(e, t) {
|
|
1242
|
+
let n = e.position.x + Z, r = e.position.y + Q / 2, i = t.position.x, a = t.position.y + Q / 2, o = (n + i) / 2;
|
|
1420
1243
|
return {
|
|
1421
1244
|
d: `M ${n} ${r} C ${o} ${r}, ${o} ${a}, ${i} ${a}`,
|
|
1422
1245
|
labelX: o,
|
|
1423
1246
|
labelY: (r + a) / 2 - 8
|
|
1424
1247
|
};
|
|
1425
1248
|
}
|
|
1426
|
-
var
|
|
1427
|
-
let u = e.executionStatus, d = u ?
|
|
1428
|
-
return /* @__PURE__ */ (
|
|
1249
|
+
var Ve = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly: i, showExecutionOverlay: a, onSelect: o, onDelete: s, onDragStart: c, onPortClick: l }) => {
|
|
1250
|
+
let u = e.executionStatus, d = u ? Me[u] : null;
|
|
1251
|
+
return /* @__PURE__ */ U("div", {
|
|
1429
1252
|
className: "absolute select-none",
|
|
1430
1253
|
style: {
|
|
1431
1254
|
left: e.position.x,
|
|
@@ -1437,74 +1260,74 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
1437
1260
|
role: "group",
|
|
1438
1261
|
"aria-label": e.label,
|
|
1439
1262
|
children: [
|
|
1440
|
-
/* @__PURE__ */ (
|
|
1441
|
-
className:
|
|
1263
|
+
/* @__PURE__ */ U("div", {
|
|
1264
|
+
className: X("flex items-center gap-2 border-2 rounded px-3 py-2 min-h-[52px] transition-shadow cursor-pointer", je[e.type], t && "ring-2 ring-primary shadow-md", n && "ring-2 ring-blue-400 shadow-lg", r && !n && "cursor-crosshair", a && u === "running" && "ring-2 ring-blue-400", a && u === "failed" && "ring-2 ring-red-400", a && u === "completed" && "ring-2 ring-green-400"),
|
|
1442
1265
|
style: {
|
|
1443
|
-
width:
|
|
1444
|
-
minHeight:
|
|
1266
|
+
width: Z,
|
|
1267
|
+
minHeight: Q
|
|
1445
1268
|
},
|
|
1446
1269
|
children: [
|
|
1447
|
-
/* @__PURE__ */ (
|
|
1270
|
+
/* @__PURE__ */ H("span", {
|
|
1448
1271
|
className: "shrink-0",
|
|
1449
|
-
children:
|
|
1272
|
+
children: Ae[e.type]
|
|
1450
1273
|
}),
|
|
1451
|
-
/* @__PURE__ */ (
|
|
1274
|
+
/* @__PURE__ */ H("span", {
|
|
1452
1275
|
className: "text-xs font-medium leading-tight flex-1 truncate",
|
|
1453
1276
|
children: e.label
|
|
1454
1277
|
}),
|
|
1455
|
-
a && d && /* @__PURE__ */ (
|
|
1456
|
-
className:
|
|
1278
|
+
a && d && /* @__PURE__ */ H("span", {
|
|
1279
|
+
className: X("shrink-0", d.color),
|
|
1457
1280
|
children: d.icon
|
|
1458
1281
|
})
|
|
1459
1282
|
]
|
|
1460
1283
|
}),
|
|
1461
|
-
!i && (t || r) && /* @__PURE__ */ (
|
|
1284
|
+
!i && (t || r) && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
|
|
1462
1285
|
className: "absolute w-3 h-3 rounded-full bg-primary border-2 border-background shadow cursor-crosshair",
|
|
1463
1286
|
style: {
|
|
1464
1287
|
right: -6,
|
|
1465
|
-
top:
|
|
1288
|
+
top: Q / 2 - 6
|
|
1466
1289
|
},
|
|
1467
1290
|
title: "Connect from this node",
|
|
1468
1291
|
onClick: (t) => {
|
|
1469
1292
|
t.stopPropagation(), l(e.id);
|
|
1470
1293
|
}
|
|
1471
|
-
}), /* @__PURE__ */ (
|
|
1294
|
+
}), /* @__PURE__ */ H("div", {
|
|
1472
1295
|
className: "absolute w-3 h-3 rounded-full bg-muted-foreground border-2 border-background shadow cursor-crosshair",
|
|
1473
1296
|
style: {
|
|
1474
1297
|
left: -6,
|
|
1475
|
-
top:
|
|
1298
|
+
top: Q / 2 - 6
|
|
1476
1299
|
},
|
|
1477
1300
|
title: "Connect to this node",
|
|
1478
1301
|
onClick: (t) => {
|
|
1479
1302
|
t.stopPropagation(), l(e.id);
|
|
1480
1303
|
}
|
|
1481
1304
|
})] }),
|
|
1482
|
-
!i && t && !r && /* @__PURE__ */ (
|
|
1305
|
+
!i && t && !r && /* @__PURE__ */ H("button", {
|
|
1483
1306
|
className: "absolute -top-2 -right-2 p-0.5 rounded-full bg-destructive text-destructive-foreground shadow",
|
|
1484
1307
|
onClick: (t) => {
|
|
1485
1308
|
t.stopPropagation(), s(e.id);
|
|
1486
1309
|
},
|
|
1487
1310
|
"aria-label": `Delete node ${e.label}`,
|
|
1488
|
-
children: /* @__PURE__ */ (
|
|
1311
|
+
children: /* @__PURE__ */ H(L, { className: "h-3 w-3" })
|
|
1489
1312
|
})
|
|
1490
1313
|
]
|
|
1491
1314
|
});
|
|
1492
|
-
},
|
|
1315
|
+
}, He = ({ node: e, edge: t, readOnly: n, onNodeChange: r, onEdgeChange: i }) => !e && !t ? /* @__PURE__ */ H("div", {
|
|
1493
1316
|
className: "p-4 text-sm text-muted-foreground",
|
|
1494
1317
|
children: "Select a node or edge to edit its properties."
|
|
1495
|
-
}) : e ? /* @__PURE__ */ (
|
|
1318
|
+
}) : e ? /* @__PURE__ */ U("div", {
|
|
1496
1319
|
className: "p-3 space-y-3 overflow-y-auto",
|
|
1497
1320
|
children: [
|
|
1498
|
-
/* @__PURE__ */ (
|
|
1321
|
+
/* @__PURE__ */ H("p", {
|
|
1499
1322
|
className: "text-xs font-semibold text-muted-foreground uppercase tracking-wide",
|
|
1500
1323
|
children: "Node Properties"
|
|
1501
1324
|
}),
|
|
1502
|
-
/* @__PURE__ */ (
|
|
1325
|
+
/* @__PURE__ */ U("div", {
|
|
1503
1326
|
className: "space-y-1",
|
|
1504
|
-
children: [/* @__PURE__ */ (
|
|
1327
|
+
children: [/* @__PURE__ */ H(f, {
|
|
1505
1328
|
className: "text-xs",
|
|
1506
1329
|
children: "Label"
|
|
1507
|
-
}), /* @__PURE__ */ (
|
|
1330
|
+
}), /* @__PURE__ */ H(d, {
|
|
1508
1331
|
value: e.label,
|
|
1509
1332
|
onChange: (t) => r({
|
|
1510
1333
|
...e,
|
|
@@ -1514,34 +1337,34 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
1514
1337
|
className: "h-7 text-xs"
|
|
1515
1338
|
})]
|
|
1516
1339
|
}),
|
|
1517
|
-
/* @__PURE__ */ (
|
|
1340
|
+
/* @__PURE__ */ U("div", {
|
|
1518
1341
|
className: "space-y-1",
|
|
1519
|
-
children: [/* @__PURE__ */ (
|
|
1342
|
+
children: [/* @__PURE__ */ H(f, {
|
|
1520
1343
|
className: "text-xs",
|
|
1521
1344
|
children: "Type"
|
|
1522
|
-
}), /* @__PURE__ */ (
|
|
1345
|
+
}), /* @__PURE__ */ U(p, {
|
|
1523
1346
|
value: e.type,
|
|
1524
1347
|
onValueChange: (t) => r({
|
|
1525
1348
|
...e,
|
|
1526
1349
|
type: t
|
|
1527
1350
|
}),
|
|
1528
1351
|
disabled: n,
|
|
1529
|
-
children: [/* @__PURE__ */ (
|
|
1352
|
+
children: [/* @__PURE__ */ H(g, {
|
|
1530
1353
|
className: "h-7 text-xs",
|
|
1531
|
-
children: /* @__PURE__ */ (
|
|
1532
|
-
}), /* @__PURE__ */ (
|
|
1354
|
+
children: /* @__PURE__ */ H(_, {})
|
|
1355
|
+
}), /* @__PURE__ */ H(m, { children: Object.keys(ke).map((e) => /* @__PURE__ */ H(h, {
|
|
1533
1356
|
value: e,
|
|
1534
1357
|
className: "text-xs",
|
|
1535
|
-
children:
|
|
1358
|
+
children: ke[e]
|
|
1536
1359
|
}, e)) })]
|
|
1537
1360
|
})]
|
|
1538
1361
|
}),
|
|
1539
|
-
/* @__PURE__ */ (
|
|
1362
|
+
/* @__PURE__ */ U("div", {
|
|
1540
1363
|
className: "space-y-1",
|
|
1541
|
-
children: [/* @__PURE__ */ (
|
|
1364
|
+
children: [/* @__PURE__ */ H(f, {
|
|
1542
1365
|
className: "text-xs",
|
|
1543
1366
|
children: "Description"
|
|
1544
|
-
}), /* @__PURE__ */ (
|
|
1367
|
+
}), /* @__PURE__ */ H(d, {
|
|
1545
1368
|
value: e.description ?? "",
|
|
1546
1369
|
onChange: (t) => r({
|
|
1547
1370
|
...e,
|
|
@@ -1559,18 +1382,18 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
1559
1382
|
"script_task",
|
|
1560
1383
|
"delay",
|
|
1561
1384
|
"webhook"
|
|
1562
|
-
].includes(e.type) && /* @__PURE__ */ (
|
|
1563
|
-
/* @__PURE__ */ (
|
|
1564
|
-
/* @__PURE__ */ (
|
|
1385
|
+
].includes(e.type) && /* @__PURE__ */ U(V, { children: [
|
|
1386
|
+
/* @__PURE__ */ H(v, {}),
|
|
1387
|
+
/* @__PURE__ */ H("p", {
|
|
1565
1388
|
className: "text-xs font-semibold text-muted-foreground uppercase tracking-wide",
|
|
1566
1389
|
children: "Executor"
|
|
1567
1390
|
}),
|
|
1568
|
-
/* @__PURE__ */ (
|
|
1391
|
+
/* @__PURE__ */ U("div", {
|
|
1569
1392
|
className: "space-y-1",
|
|
1570
|
-
children: [/* @__PURE__ */ (
|
|
1393
|
+
children: [/* @__PURE__ */ H(f, {
|
|
1571
1394
|
className: "text-xs",
|
|
1572
1395
|
children: "Executor Type"
|
|
1573
|
-
}), /* @__PURE__ */ (
|
|
1396
|
+
}), /* @__PURE__ */ H(d, {
|
|
1574
1397
|
value: e.executor?.type ?? "",
|
|
1575
1398
|
onChange: (t) => r({
|
|
1576
1399
|
...e,
|
|
@@ -1584,12 +1407,12 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
1584
1407
|
placeholder: "e.g. http, script, email"
|
|
1585
1408
|
})]
|
|
1586
1409
|
}),
|
|
1587
|
-
e.type === "delay" && /* @__PURE__ */ (
|
|
1410
|
+
e.type === "delay" && /* @__PURE__ */ U("div", {
|
|
1588
1411
|
className: "space-y-1",
|
|
1589
|
-
children: [/* @__PURE__ */ (
|
|
1412
|
+
children: [/* @__PURE__ */ H(f, {
|
|
1590
1413
|
className: "text-xs",
|
|
1591
1414
|
children: "Wait Event Type"
|
|
1592
|
-
}), /* @__PURE__ */ (
|
|
1415
|
+
}), /* @__PURE__ */ U(p, {
|
|
1593
1416
|
value: e.executor?.waitEventConfig?.eventType ?? "timer",
|
|
1594
1417
|
onValueChange: (t) => r({
|
|
1595
1418
|
...e,
|
|
@@ -1603,22 +1426,22 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
1603
1426
|
}
|
|
1604
1427
|
}),
|
|
1605
1428
|
disabled: n,
|
|
1606
|
-
children: [/* @__PURE__ */ (
|
|
1429
|
+
children: [/* @__PURE__ */ H(g, {
|
|
1607
1430
|
className: "h-7 text-xs",
|
|
1608
|
-
children: /* @__PURE__ */ (
|
|
1609
|
-
}), /* @__PURE__ */ (
|
|
1431
|
+
children: /* @__PURE__ */ H(_, {})
|
|
1432
|
+
}), /* @__PURE__ */ H(m, { children: Object.keys($).map((e) => /* @__PURE__ */ H(h, {
|
|
1610
1433
|
value: e,
|
|
1611
1434
|
className: "text-xs",
|
|
1612
|
-
children:
|
|
1435
|
+
children: $[e]
|
|
1613
1436
|
}, e)) })]
|
|
1614
1437
|
})]
|
|
1615
1438
|
}),
|
|
1616
|
-
/* @__PURE__ */ (
|
|
1439
|
+
/* @__PURE__ */ U("div", {
|
|
1617
1440
|
className: "space-y-1",
|
|
1618
|
-
children: [/* @__PURE__ */ (
|
|
1441
|
+
children: [/* @__PURE__ */ H(f, {
|
|
1619
1442
|
className: "text-xs",
|
|
1620
1443
|
children: "Timeout (ms)"
|
|
1621
|
-
}), /* @__PURE__ */ (
|
|
1444
|
+
}), /* @__PURE__ */ H(d, {
|
|
1622
1445
|
type: "number",
|
|
1623
1446
|
value: e.executor?.timeoutMs ?? "",
|
|
1624
1447
|
onChange: (t) => r({
|
|
@@ -1635,18 +1458,18 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
1635
1458
|
})]
|
|
1636
1459
|
})
|
|
1637
1460
|
] }),
|
|
1638
|
-
e.type === "boundary_event" && /* @__PURE__ */ (
|
|
1639
|
-
/* @__PURE__ */ (
|
|
1640
|
-
/* @__PURE__ */ (
|
|
1461
|
+
e.type === "boundary_event" && /* @__PURE__ */ U(V, { children: [
|
|
1462
|
+
/* @__PURE__ */ H(v, {}),
|
|
1463
|
+
/* @__PURE__ */ H("p", {
|
|
1641
1464
|
className: "text-xs font-semibold text-muted-foreground uppercase tracking-wide",
|
|
1642
1465
|
children: "Boundary Config"
|
|
1643
1466
|
}),
|
|
1644
|
-
/* @__PURE__ */ (
|
|
1467
|
+
/* @__PURE__ */ U("div", {
|
|
1645
1468
|
className: "space-y-1",
|
|
1646
|
-
children: [/* @__PURE__ */ (
|
|
1469
|
+
children: [/* @__PURE__ */ H(f, {
|
|
1647
1470
|
className: "text-xs",
|
|
1648
1471
|
children: "Attached To Node ID"
|
|
1649
|
-
}), /* @__PURE__ */ (
|
|
1472
|
+
}), /* @__PURE__ */ H(d, {
|
|
1650
1473
|
value: e.boundaryConfig?.attachedToNodeId ?? "",
|
|
1651
1474
|
onChange: (t) => r({
|
|
1652
1475
|
...e,
|
|
@@ -1661,12 +1484,12 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
1661
1484
|
placeholder: "Host node id"
|
|
1662
1485
|
})]
|
|
1663
1486
|
}),
|
|
1664
|
-
/* @__PURE__ */ (
|
|
1487
|
+
/* @__PURE__ */ U("div", {
|
|
1665
1488
|
className: "space-y-1",
|
|
1666
|
-
children: [/* @__PURE__ */ (
|
|
1489
|
+
children: [/* @__PURE__ */ H(f, {
|
|
1667
1490
|
className: "text-xs",
|
|
1668
1491
|
children: "Event Type"
|
|
1669
|
-
}), /* @__PURE__ */ (
|
|
1492
|
+
}), /* @__PURE__ */ U(p, {
|
|
1670
1493
|
value: e.boundaryConfig?.eventType ?? "error",
|
|
1671
1494
|
onValueChange: (t) => r({
|
|
1672
1495
|
...e,
|
|
@@ -1677,16 +1500,16 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
1677
1500
|
}
|
|
1678
1501
|
}),
|
|
1679
1502
|
disabled: n,
|
|
1680
|
-
children: [/* @__PURE__ */ (
|
|
1503
|
+
children: [/* @__PURE__ */ H(g, {
|
|
1681
1504
|
className: "h-7 text-xs",
|
|
1682
|
-
children: /* @__PURE__ */ (
|
|
1683
|
-
}), /* @__PURE__ */ (
|
|
1505
|
+
children: /* @__PURE__ */ H(_, {})
|
|
1506
|
+
}), /* @__PURE__ */ H(m, { children: [
|
|
1684
1507
|
"error",
|
|
1685
1508
|
"timer",
|
|
1686
1509
|
"message",
|
|
1687
1510
|
"signal",
|
|
1688
1511
|
"compensation"
|
|
1689
|
-
].map((e) => /* @__PURE__ */ (
|
|
1512
|
+
].map((e) => /* @__PURE__ */ H(h, {
|
|
1690
1513
|
value: e,
|
|
1691
1514
|
className: "text-xs capitalize",
|
|
1692
1515
|
children: e
|
|
@@ -1695,19 +1518,19 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
1695
1518
|
})
|
|
1696
1519
|
] })
|
|
1697
1520
|
]
|
|
1698
|
-
}) : t ? /* @__PURE__ */ (
|
|
1521
|
+
}) : t ? /* @__PURE__ */ U("div", {
|
|
1699
1522
|
className: "p-3 space-y-3 overflow-y-auto",
|
|
1700
1523
|
children: [
|
|
1701
|
-
/* @__PURE__ */ (
|
|
1524
|
+
/* @__PURE__ */ H("p", {
|
|
1702
1525
|
className: "text-xs font-semibold text-muted-foreground uppercase tracking-wide",
|
|
1703
1526
|
children: "Edge Properties"
|
|
1704
1527
|
}),
|
|
1705
|
-
/* @__PURE__ */ (
|
|
1528
|
+
/* @__PURE__ */ U("div", {
|
|
1706
1529
|
className: "space-y-1",
|
|
1707
|
-
children: [/* @__PURE__ */ (
|
|
1530
|
+
children: [/* @__PURE__ */ H(f, {
|
|
1708
1531
|
className: "text-xs",
|
|
1709
1532
|
children: "Label"
|
|
1710
|
-
}), /* @__PURE__ */ (
|
|
1533
|
+
}), /* @__PURE__ */ H(d, {
|
|
1711
1534
|
value: t.label ?? "",
|
|
1712
1535
|
onChange: (e) => i({
|
|
1713
1536
|
...t,
|
|
@@ -1717,33 +1540,33 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
1717
1540
|
className: "h-7 text-xs"
|
|
1718
1541
|
})]
|
|
1719
1542
|
}),
|
|
1720
|
-
/* @__PURE__ */ (
|
|
1543
|
+
/* @__PURE__ */ U("div", {
|
|
1721
1544
|
className: "space-y-1",
|
|
1722
|
-
children: [/* @__PURE__ */ (
|
|
1545
|
+
children: [/* @__PURE__ */ H(f, {
|
|
1723
1546
|
className: "text-xs",
|
|
1724
1547
|
children: "Type"
|
|
1725
|
-
}), /* @__PURE__ */ (
|
|
1548
|
+
}), /* @__PURE__ */ U(p, {
|
|
1726
1549
|
value: t.type ?? "default",
|
|
1727
1550
|
onValueChange: (e) => i({
|
|
1728
1551
|
...t,
|
|
1729
1552
|
type: e
|
|
1730
1553
|
}),
|
|
1731
1554
|
disabled: n,
|
|
1732
|
-
children: [/* @__PURE__ */ (
|
|
1555
|
+
children: [/* @__PURE__ */ H(g, {
|
|
1733
1556
|
className: "h-7 text-xs",
|
|
1734
|
-
children: /* @__PURE__ */ (
|
|
1735
|
-
}), /* @__PURE__ */ (
|
|
1736
|
-
/* @__PURE__ */ (
|
|
1557
|
+
children: /* @__PURE__ */ H(_, {})
|
|
1558
|
+
}), /* @__PURE__ */ U(m, { children: [
|
|
1559
|
+
/* @__PURE__ */ H(h, {
|
|
1737
1560
|
value: "default",
|
|
1738
1561
|
className: "text-xs",
|
|
1739
1562
|
children: "Default"
|
|
1740
1563
|
}),
|
|
1741
|
-
/* @__PURE__ */ (
|
|
1564
|
+
/* @__PURE__ */ H(h, {
|
|
1742
1565
|
value: "conditional",
|
|
1743
1566
|
className: "text-xs",
|
|
1744
1567
|
children: "Conditional"
|
|
1745
1568
|
}),
|
|
1746
|
-
/* @__PURE__ */ (
|
|
1569
|
+
/* @__PURE__ */ H(h, {
|
|
1747
1570
|
value: "timeout",
|
|
1748
1571
|
className: "text-xs",
|
|
1749
1572
|
children: "Timeout"
|
|
@@ -1751,12 +1574,12 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
1751
1574
|
] })]
|
|
1752
1575
|
})]
|
|
1753
1576
|
}),
|
|
1754
|
-
t.type === "conditional" && /* @__PURE__ */ (
|
|
1577
|
+
t.type === "conditional" && /* @__PURE__ */ U("div", {
|
|
1755
1578
|
className: "space-y-1",
|
|
1756
|
-
children: [/* @__PURE__ */ (
|
|
1579
|
+
children: [/* @__PURE__ */ H(f, {
|
|
1757
1580
|
className: "text-xs",
|
|
1758
1581
|
children: "Condition Expression"
|
|
1759
|
-
}), /* @__PURE__ */ (
|
|
1582
|
+
}), /* @__PURE__ */ H(d, {
|
|
1760
1583
|
value: t.condition ?? "",
|
|
1761
1584
|
onChange: (e) => i({
|
|
1762
1585
|
...t,
|
|
@@ -1767,9 +1590,9 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
1767
1590
|
placeholder: "e.g. status === 'approved'"
|
|
1768
1591
|
})]
|
|
1769
1592
|
}),
|
|
1770
|
-
/* @__PURE__ */ (
|
|
1593
|
+
/* @__PURE__ */ U("div", {
|
|
1771
1594
|
className: "flex items-center gap-2",
|
|
1772
|
-
children: [/* @__PURE__ */ (
|
|
1595
|
+
children: [/* @__PURE__ */ H("input", {
|
|
1773
1596
|
type: "checkbox",
|
|
1774
1597
|
id: "edge-isDefault",
|
|
1775
1598
|
checked: t.isDefault ?? !1,
|
|
@@ -1779,387 +1602,387 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
1779
1602
|
}),
|
|
1780
1603
|
disabled: n,
|
|
1781
1604
|
className: "h-3.5 w-3.5"
|
|
1782
|
-
}), /* @__PURE__ */ (
|
|
1605
|
+
}), /* @__PURE__ */ H(f, {
|
|
1783
1606
|
htmlFor: "edge-isDefault",
|
|
1784
1607
|
className: "text-xs",
|
|
1785
1608
|
children: "Default edge (isDefault)"
|
|
1786
1609
|
})]
|
|
1787
1610
|
})
|
|
1788
1611
|
]
|
|
1789
|
-
}) : null,
|
|
1612
|
+
}) : null, Ue = ({ versions: e }) => /* @__PURE__ */ U("div", {
|
|
1790
1613
|
className: "p-3 space-y-2",
|
|
1791
1614
|
children: [
|
|
1792
|
-
/* @__PURE__ */ (
|
|
1615
|
+
/* @__PURE__ */ H("p", {
|
|
1793
1616
|
className: "text-xs font-semibold text-muted-foreground uppercase tracking-wide",
|
|
1794
1617
|
children: "Version History"
|
|
1795
1618
|
}),
|
|
1796
|
-
e.length === 0 && /* @__PURE__ */ (
|
|
1619
|
+
e.length === 0 && /* @__PURE__ */ H("p", {
|
|
1797
1620
|
className: "text-xs text-muted-foreground",
|
|
1798
1621
|
children: "No version history available."
|
|
1799
1622
|
}),
|
|
1800
|
-
/* @__PURE__ */ (
|
|
1623
|
+
/* @__PURE__ */ H("div", {
|
|
1801
1624
|
className: "space-y-1.5",
|
|
1802
|
-
children: e.map((e) => /* @__PURE__ */ (
|
|
1803
|
-
className:
|
|
1625
|
+
children: e.map((e) => /* @__PURE__ */ U("div", {
|
|
1626
|
+
className: X("rounded border p-2 text-xs", e.isCurrent ? "border-primary bg-primary/5" : "border-border bg-muted/30"),
|
|
1804
1627
|
children: [
|
|
1805
|
-
/* @__PURE__ */ (
|
|
1628
|
+
/* @__PURE__ */ U("div", {
|
|
1806
1629
|
className: "flex items-center justify-between",
|
|
1807
|
-
children: [/* @__PURE__ */ (
|
|
1630
|
+
children: [/* @__PURE__ */ U("span", {
|
|
1808
1631
|
className: "font-medium",
|
|
1809
1632
|
children: ["v", e.version]
|
|
1810
|
-
}), e.isCurrent && /* @__PURE__ */ (
|
|
1633
|
+
}), e.isCurrent && /* @__PURE__ */ H(a, {
|
|
1811
1634
|
variant: "default",
|
|
1812
1635
|
className: "text-[10px] h-4",
|
|
1813
1636
|
children: "Current"
|
|
1814
1637
|
})]
|
|
1815
1638
|
}),
|
|
1816
|
-
e.changeNote && /* @__PURE__ */ (
|
|
1639
|
+
e.changeNote && /* @__PURE__ */ H("p", {
|
|
1817
1640
|
className: "text-muted-foreground mt-0.5",
|
|
1818
1641
|
children: e.changeNote
|
|
1819
1642
|
}),
|
|
1820
|
-
/* @__PURE__ */ (
|
|
1643
|
+
/* @__PURE__ */ U("p", {
|
|
1821
1644
|
className: "text-muted-foreground mt-0.5",
|
|
1822
|
-
children: [e.author && /* @__PURE__ */ (
|
|
1645
|
+
children: [e.author && /* @__PURE__ */ U(V, { children: [e.author, " · "] }), new Date(e.createdAt).toLocaleDateString()]
|
|
1823
1646
|
})
|
|
1824
1647
|
]
|
|
1825
1648
|
}, e.version))
|
|
1826
1649
|
})
|
|
1827
1650
|
]
|
|
1828
|
-
}),
|
|
1829
|
-
let { readOnly: p = !1, showToolbar: m = !0, showMinimap: h = !1, showVersionHistory: g = !1, showExecutionOverlay: _ = !1, executionSteps: y = [], versionHistory: b = [], concurrencyPolicy: x, title: S = "New Flow", description: C = "", status: w = "draft" } = e, [T, E] = i(S), [D,
|
|
1830
|
-
nodes: e.nodes ??
|
|
1831
|
-
edges: e.edges ??
|
|
1832
|
-
}),
|
|
1833
|
-
if (!_ || y.length === 0) return
|
|
1651
|
+
}), We = ({ schema: e, onSave: f }) => {
|
|
1652
|
+
let { readOnly: p = !1, showToolbar: m = !0, showMinimap: h = !1, showVersionHistory: g = !1, showExecutionOverlay: _ = !1, executionSteps: y = [], versionHistory: b = [], concurrencyPolicy: x, title: S = "New Flow", description: C = "", status: w = "draft" } = e, [T, E] = i(S), [D, te] = i(C), { current: O, push: k, undo: A, redo: ie, canUndo: ae, canRedo: oe } = Le({
|
|
1653
|
+
nodes: e.nodes ?? Fe(),
|
|
1654
|
+
edges: e.edges ?? Ie()
|
|
1655
|
+
}), j = O.nodes, M = O.edges, [N, P] = i(null), [F, I] = i(null), [L, R] = i(!1), [z, B] = i(null), [_e, ve] = i(!0), [W, ye] = i(g), [G, be] = i(null), [K, q] = i(1), J = r(null), xe = n(() => j.find((e) => e.id === N) ?? null, [j, N]), Se = n(() => M.find((e) => e.id === F) ?? null, [M, F]), Ce = n(() => {
|
|
1656
|
+
if (!_ || y.length === 0) return j;
|
|
1834
1657
|
let e = new Map(y.map((e) => [e.nodeId, e.status]));
|
|
1835
|
-
return
|
|
1658
|
+
return j.map((t) => e.has(t.id) ? {
|
|
1836
1659
|
...t,
|
|
1837
1660
|
executionStatus: e.get(t.id)
|
|
1838
1661
|
} : t);
|
|
1839
1662
|
}, [
|
|
1840
|
-
|
|
1663
|
+
j,
|
|
1841
1664
|
_,
|
|
1842
1665
|
y
|
|
1843
|
-
]),
|
|
1666
|
+
]), Y = t((e) => {
|
|
1844
1667
|
if (p) return;
|
|
1845
1668
|
let t = {
|
|
1846
1669
|
id: `${e}-${Date.now()}`,
|
|
1847
1670
|
type: e,
|
|
1848
|
-
label:
|
|
1671
|
+
label: ke[e],
|
|
1849
1672
|
position: {
|
|
1850
1673
|
x: 200,
|
|
1851
|
-
y: 80 +
|
|
1674
|
+
y: 80 + j.length * 70
|
|
1852
1675
|
}
|
|
1853
1676
|
};
|
|
1854
|
-
|
|
1855
|
-
nodes: [...
|
|
1856
|
-
edges:
|
|
1677
|
+
k({
|
|
1678
|
+
nodes: [...j, t],
|
|
1679
|
+
edges: M
|
|
1857
1680
|
});
|
|
1858
1681
|
}, [
|
|
1859
1682
|
p,
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
]),
|
|
1864
|
-
p || (
|
|
1865
|
-
nodes:
|
|
1866
|
-
edges:
|
|
1867
|
-
}),
|
|
1683
|
+
j,
|
|
1684
|
+
M,
|
|
1685
|
+
k
|
|
1686
|
+
]), we = t((e) => {
|
|
1687
|
+
p || (k({
|
|
1688
|
+
nodes: j.filter((t) => t.id !== e),
|
|
1689
|
+
edges: M.filter((t) => t.source !== e && t.target !== e)
|
|
1690
|
+
}), N === e && P(null));
|
|
1868
1691
|
}, [
|
|
1869
1692
|
p,
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
]),
|
|
1875
|
-
p ||
|
|
1876
|
-
nodes:
|
|
1877
|
-
edges:
|
|
1693
|
+
j,
|
|
1694
|
+
M,
|
|
1695
|
+
k,
|
|
1696
|
+
N
|
|
1697
|
+
]), Te = t((e) => {
|
|
1698
|
+
p || k({
|
|
1699
|
+
nodes: j.map((t) => t.id === e.id ? e : t),
|
|
1700
|
+
edges: M
|
|
1878
1701
|
});
|
|
1879
1702
|
}, [
|
|
1880
1703
|
p,
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
]),
|
|
1885
|
-
p || (
|
|
1886
|
-
nodes:
|
|
1887
|
-
edges:
|
|
1888
|
-
}),
|
|
1704
|
+
j,
|
|
1705
|
+
M,
|
|
1706
|
+
k
|
|
1707
|
+
]), Ee = t((e) => {
|
|
1708
|
+
p || (k({
|
|
1709
|
+
nodes: j,
|
|
1710
|
+
edges: M.filter((t) => t.id !== e)
|
|
1711
|
+
}), F === e && I(null));
|
|
1889
1712
|
}, [
|
|
1890
1713
|
p,
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
]),
|
|
1896
|
-
p ||
|
|
1897
|
-
nodes:
|
|
1898
|
-
edges:
|
|
1714
|
+
j,
|
|
1715
|
+
M,
|
|
1716
|
+
k,
|
|
1717
|
+
F
|
|
1718
|
+
]), De = t((e) => {
|
|
1719
|
+
p || k({
|
|
1720
|
+
nodes: j,
|
|
1721
|
+
edges: M.map((t) => t.id === e.id ? e : t)
|
|
1899
1722
|
});
|
|
1900
1723
|
}, [
|
|
1901
1724
|
p,
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
]),
|
|
1725
|
+
j,
|
|
1726
|
+
M,
|
|
1727
|
+
k
|
|
1728
|
+
]), Oe = t((e) => {
|
|
1906
1729
|
if (!p) {
|
|
1907
|
-
if (!
|
|
1908
|
-
|
|
1730
|
+
if (!L) {
|
|
1731
|
+
R(!0), B(e);
|
|
1909
1732
|
return;
|
|
1910
1733
|
}
|
|
1911
|
-
if (
|
|
1734
|
+
if (z && z !== e) {
|
|
1912
1735
|
let t = {
|
|
1913
1736
|
id: `edge-${Date.now()}`,
|
|
1914
|
-
source:
|
|
1737
|
+
source: z,
|
|
1915
1738
|
target: e
|
|
1916
1739
|
};
|
|
1917
|
-
|
|
1918
|
-
nodes:
|
|
1919
|
-
edges: [...
|
|
1740
|
+
k({
|
|
1741
|
+
nodes: j,
|
|
1742
|
+
edges: [...M, t]
|
|
1920
1743
|
});
|
|
1921
1744
|
}
|
|
1922
|
-
|
|
1745
|
+
R(!1), B(null);
|
|
1923
1746
|
}
|
|
1924
1747
|
}, [
|
|
1925
1748
|
p,
|
|
1749
|
+
L,
|
|
1926
1750
|
z,
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
]), X = r(null), Z = r(null), De = t((e, t) => {
|
|
1751
|
+
j,
|
|
1752
|
+
M,
|
|
1753
|
+
k
|
|
1754
|
+
]), X = r(null), Z = r(null), Q = t((e, t) => {
|
|
1932
1755
|
X.current = t;
|
|
1933
|
-
let n =
|
|
1756
|
+
let n = j.find((e) => e.id === t);
|
|
1934
1757
|
n && (Z.current = {
|
|
1935
1758
|
mouseX: e.clientX,
|
|
1936
1759
|
mouseY: e.clientY,
|
|
1937
1760
|
nodeX: n.position.x,
|
|
1938
1761
|
nodeY: n.position.y
|
|
1939
1762
|
}), e.dataTransfer.effectAllowed = "move";
|
|
1940
|
-
}, [
|
|
1941
|
-
if (e.preventDefault(), !X.current || !Z.current || !
|
|
1942
|
-
|
|
1763
|
+
}, [j]), je = t((e) => {
|
|
1764
|
+
if (e.preventDefault(), !X.current || !Z.current || !J.current) return;
|
|
1765
|
+
J.current.getBoundingClientRect();
|
|
1943
1766
|
let t = (e.clientX - Z.current.mouseX) / K, n = (e.clientY - Z.current.mouseY) / K, r = Math.max(0, Z.current.nodeX + t), i = Math.max(0, Z.current.nodeY + n), a = X.current;
|
|
1944
|
-
|
|
1945
|
-
nodes:
|
|
1767
|
+
k({
|
|
1768
|
+
nodes: j.map((e) => e.id === a ? {
|
|
1946
1769
|
...e,
|
|
1947
1770
|
position: {
|
|
1948
1771
|
x: r,
|
|
1949
1772
|
y: i
|
|
1950
1773
|
}
|
|
1951
1774
|
} : e),
|
|
1952
|
-
edges:
|
|
1775
|
+
edges: M
|
|
1953
1776
|
}), X.current = null, Z.current = null;
|
|
1954
1777
|
}, [
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1778
|
+
j,
|
|
1779
|
+
M,
|
|
1780
|
+
k,
|
|
1958
1781
|
K
|
|
1959
|
-
]),
|
|
1960
|
-
let e =
|
|
1961
|
-
|
|
1782
|
+
]), Me = t(() => {
|
|
1783
|
+
let e = Re(j, M, T);
|
|
1784
|
+
be(e);
|
|
1962
1785
|
let t = new Blob([e.bpmnXml ?? ""], { type: "application/xml" }), n = URL.createObjectURL(t), r = document.createElement("a");
|
|
1963
1786
|
r.href = n, r.download = `${T.replace(/\s+/g, "-").toLowerCase()}.bpmn`, r.click(), URL.revokeObjectURL(n);
|
|
1964
1787
|
}, [
|
|
1965
|
-
|
|
1966
|
-
|
|
1788
|
+
j,
|
|
1789
|
+
M,
|
|
1967
1790
|
T
|
|
1968
|
-
]),
|
|
1969
|
-
f?.(
|
|
1791
|
+
]), $ = t(() => {
|
|
1792
|
+
f?.(j, M);
|
|
1970
1793
|
}, [
|
|
1971
|
-
|
|
1972
|
-
|
|
1794
|
+
j,
|
|
1795
|
+
M,
|
|
1973
1796
|
f
|
|
1974
1797
|
]);
|
|
1975
|
-
return /* @__PURE__ */ (
|
|
1798
|
+
return /* @__PURE__ */ U(s, {
|
|
1976
1799
|
className: "flex flex-col h-full min-h-[600px] outline-none",
|
|
1977
1800
|
tabIndex: 0,
|
|
1978
1801
|
onKeyDown: t((e) => {
|
|
1979
1802
|
let t = e.ctrlKey || e.metaKey;
|
|
1980
1803
|
if (t && e.key === "z" && !e.shiftKey) {
|
|
1981
|
-
e.preventDefault(),
|
|
1804
|
+
e.preventDefault(), A();
|
|
1982
1805
|
return;
|
|
1983
1806
|
}
|
|
1984
1807
|
if (t && (e.key === "y" || e.key === "z" && e.shiftKey)) {
|
|
1985
|
-
e.preventDefault(),
|
|
1808
|
+
e.preventDefault(), ie();
|
|
1986
1809
|
return;
|
|
1987
1810
|
}
|
|
1988
1811
|
if (t && e.key === "s") {
|
|
1989
|
-
e.preventDefault(),
|
|
1812
|
+
e.preventDefault(), $();
|
|
1990
1813
|
return;
|
|
1991
1814
|
}
|
|
1992
|
-
e.key === "Escape" && (
|
|
1815
|
+
e.key === "Escape" && (R(!1), B(null), P(null), I(null)), (e.key === "Delete" || e.key === "Backspace") && (N ? we(N) : F && Ee(F));
|
|
1993
1816
|
}, [
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1817
|
+
A,
|
|
1818
|
+
ie,
|
|
1819
|
+
$,
|
|
1820
|
+
N,
|
|
1997
1821
|
F,
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
Te
|
|
1822
|
+
we,
|
|
1823
|
+
Ee
|
|
2001
1824
|
]),
|
|
2002
|
-
children: [/* @__PURE__ */ (
|
|
1825
|
+
children: [/* @__PURE__ */ H(l, {
|
|
2003
1826
|
className: "py-2 px-4 border-b flex-shrink-0",
|
|
2004
|
-
children: /* @__PURE__ */ (
|
|
1827
|
+
children: /* @__PURE__ */ U("div", {
|
|
2005
1828
|
className: "flex items-center gap-3 flex-wrap",
|
|
2006
1829
|
children: [
|
|
2007
|
-
/* @__PURE__ */ (
|
|
2008
|
-
/* @__PURE__ */ (
|
|
1830
|
+
/* @__PURE__ */ H(me, { className: "h-4 w-4 text-primary shrink-0" }),
|
|
1831
|
+
/* @__PURE__ */ H(u, {
|
|
2009
1832
|
className: "text-sm font-semibold",
|
|
2010
|
-
children: p ? /* @__PURE__ */ (
|
|
1833
|
+
children: p ? /* @__PURE__ */ H("span", { children: T }) : /* @__PURE__ */ H(d, {
|
|
2011
1834
|
value: T,
|
|
2012
1835
|
onChange: (e) => E(e.target.value),
|
|
2013
1836
|
className: "h-6 text-sm font-semibold border-0 p-0 focus-visible:ring-0 bg-transparent",
|
|
2014
1837
|
"aria-label": "Flow title"
|
|
2015
1838
|
})
|
|
2016
1839
|
}),
|
|
2017
|
-
/* @__PURE__ */ (
|
|
1840
|
+
/* @__PURE__ */ H(a, {
|
|
2018
1841
|
variant: "outline",
|
|
2019
1842
|
className: "text-xs capitalize",
|
|
2020
1843
|
children: w
|
|
2021
1844
|
}),
|
|
2022
|
-
x && /* @__PURE__ */ (
|
|
1845
|
+
x && /* @__PURE__ */ H(a, {
|
|
2023
1846
|
variant: "secondary",
|
|
2024
1847
|
className: "text-xs",
|
|
2025
|
-
children:
|
|
1848
|
+
children: Pe[x]
|
|
2026
1849
|
}),
|
|
2027
|
-
/* @__PURE__ */ (
|
|
1850
|
+
/* @__PURE__ */ U("div", {
|
|
2028
1851
|
className: "ml-auto flex items-center gap-1",
|
|
2029
1852
|
children: [
|
|
2030
|
-
!p && /* @__PURE__ */ (
|
|
2031
|
-
/* @__PURE__ */ (
|
|
1853
|
+
!p && /* @__PURE__ */ U(V, { children: [
|
|
1854
|
+
/* @__PURE__ */ H(o, {
|
|
2032
1855
|
size: "icon",
|
|
2033
1856
|
variant: "ghost",
|
|
2034
1857
|
className: "h-7 w-7",
|
|
2035
|
-
onClick:
|
|
2036
|
-
disabled: !
|
|
1858
|
+
onClick: A,
|
|
1859
|
+
disabled: !ae,
|
|
2037
1860
|
title: "Undo (Ctrl+Z)",
|
|
2038
|
-
children: /* @__PURE__ */ (
|
|
1861
|
+
children: /* @__PURE__ */ H(fe, { className: "h-4 w-4" })
|
|
2039
1862
|
}),
|
|
2040
|
-
/* @__PURE__ */ (
|
|
1863
|
+
/* @__PURE__ */ H(o, {
|
|
2041
1864
|
size: "icon",
|
|
2042
1865
|
variant: "ghost",
|
|
2043
1866
|
className: "h-7 w-7",
|
|
2044
|
-
onClick:
|
|
2045
|
-
disabled: !
|
|
1867
|
+
onClick: ie,
|
|
1868
|
+
disabled: !oe,
|
|
2046
1869
|
title: "Redo (Ctrl+Y)",
|
|
2047
|
-
children: /* @__PURE__ */ (
|
|
1870
|
+
children: /* @__PURE__ */ H(le, { className: "h-4 w-4" })
|
|
2048
1871
|
}),
|
|
2049
|
-
/* @__PURE__ */ (
|
|
1872
|
+
/* @__PURE__ */ H(v, {
|
|
2050
1873
|
orientation: "vertical",
|
|
2051
1874
|
className: "h-5 mx-1"
|
|
2052
1875
|
})
|
|
2053
1876
|
] }),
|
|
2054
|
-
/* @__PURE__ */ (
|
|
1877
|
+
/* @__PURE__ */ H(o, {
|
|
2055
1878
|
size: "icon",
|
|
2056
1879
|
variant: "ghost",
|
|
2057
1880
|
className: "h-7 w-7",
|
|
2058
|
-
onClick: () =>
|
|
1881
|
+
onClick: () => q((e) => Math.min(2, e + .1)),
|
|
2059
1882
|
title: "Zoom in",
|
|
2060
|
-
children: /* @__PURE__ */ (
|
|
1883
|
+
children: /* @__PURE__ */ H(he, { className: "h-4 w-4" })
|
|
2061
1884
|
}),
|
|
2062
|
-
/* @__PURE__ */ (
|
|
1885
|
+
/* @__PURE__ */ H(o, {
|
|
2063
1886
|
size: "icon",
|
|
2064
1887
|
variant: "ghost",
|
|
2065
1888
|
className: "h-7 w-7",
|
|
2066
|
-
onClick: () =>
|
|
1889
|
+
onClick: () => q(1),
|
|
2067
1890
|
title: "Reset zoom",
|
|
2068
|
-
children: /* @__PURE__ */ (
|
|
1891
|
+
children: /* @__PURE__ */ H(ue, { className: "h-4 w-4" })
|
|
2069
1892
|
}),
|
|
2070
|
-
/* @__PURE__ */ (
|
|
1893
|
+
/* @__PURE__ */ H(o, {
|
|
2071
1894
|
size: "icon",
|
|
2072
1895
|
variant: "ghost",
|
|
2073
1896
|
className: "h-7 w-7",
|
|
2074
|
-
onClick: () =>
|
|
1897
|
+
onClick: () => q((e) => Math.max(.3, e - .1)),
|
|
2075
1898
|
title: "Zoom out",
|
|
2076
|
-
children: /* @__PURE__ */ (
|
|
1899
|
+
children: /* @__PURE__ */ H(ge, { className: "h-4 w-4" })
|
|
2077
1900
|
}),
|
|
2078
|
-
/* @__PURE__ */ (
|
|
1901
|
+
/* @__PURE__ */ H(v, {
|
|
2079
1902
|
orientation: "vertical",
|
|
2080
1903
|
className: "h-5 mx-1"
|
|
2081
1904
|
}),
|
|
2082
|
-
b.length > 0 && /* @__PURE__ */ (
|
|
1905
|
+
b.length > 0 && /* @__PURE__ */ H(o, {
|
|
2083
1906
|
size: "icon",
|
|
2084
|
-
variant:
|
|
1907
|
+
variant: W ? "secondary" : "ghost",
|
|
2085
1908
|
className: "h-7 w-7",
|
|
2086
|
-
onClick: () =>
|
|
1909
|
+
onClick: () => ye((e) => !e),
|
|
2087
1910
|
title: "Version history",
|
|
2088
|
-
children: /* @__PURE__ */ (
|
|
1911
|
+
children: /* @__PURE__ */ H(ne, { className: "h-4 w-4" })
|
|
2089
1912
|
}),
|
|
2090
|
-
/* @__PURE__ */ (
|
|
1913
|
+
/* @__PURE__ */ H(o, {
|
|
2091
1914
|
size: "icon",
|
|
2092
1915
|
variant: "ghost",
|
|
2093
1916
|
className: "h-7 w-7",
|
|
2094
|
-
onClick:
|
|
1917
|
+
onClick: Me,
|
|
2095
1918
|
title: "Export BPMN",
|
|
2096
|
-
children: /* @__PURE__ */ (
|
|
1919
|
+
children: /* @__PURE__ */ H(ee, { className: "h-4 w-4" })
|
|
2097
1920
|
}),
|
|
2098
|
-
!p && /* @__PURE__ */ (
|
|
1921
|
+
!p && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(o, {
|
|
2099
1922
|
size: "icon",
|
|
2100
1923
|
variant: "ghost",
|
|
2101
1924
|
className: "h-7 w-7",
|
|
2102
1925
|
title: "Import BPMN (drag & drop)",
|
|
2103
|
-
children: /* @__PURE__ */ (
|
|
2104
|
-
}), /* @__PURE__ */ (
|
|
1926
|
+
children: /* @__PURE__ */ H(pe, { className: "h-4 w-4" })
|
|
1927
|
+
}), /* @__PURE__ */ U(o, {
|
|
2105
1928
|
size: "sm",
|
|
2106
1929
|
variant: "default",
|
|
2107
1930
|
className: "h-7 text-xs gap-1",
|
|
2108
|
-
onClick:
|
|
1931
|
+
onClick: $,
|
|
2109
1932
|
title: "Save (Ctrl+S)",
|
|
2110
|
-
children: [/* @__PURE__ */ (
|
|
1933
|
+
children: [/* @__PURE__ */ H(de, { className: "h-3.5 w-3.5" }), " Save"]
|
|
2111
1934
|
})] }),
|
|
2112
|
-
/* @__PURE__ */ (
|
|
1935
|
+
/* @__PURE__ */ H(o, {
|
|
2113
1936
|
size: "icon",
|
|
2114
1937
|
variant: "ghost",
|
|
2115
1938
|
className: "h-7 w-7",
|
|
2116
|
-
onClick: () =>
|
|
2117
|
-
title:
|
|
2118
|
-
children:
|
|
1939
|
+
onClick: () => ve((e) => !e),
|
|
1940
|
+
title: _e ? "Hide properties" : "Show properties",
|
|
1941
|
+
children: H(_e ? se : ce, { className: "h-4 w-4" })
|
|
2119
1942
|
})
|
|
2120
1943
|
]
|
|
2121
1944
|
})
|
|
2122
1945
|
]
|
|
2123
1946
|
})
|
|
2124
|
-
}), /* @__PURE__ */ (
|
|
1947
|
+
}), /* @__PURE__ */ U(c, {
|
|
2125
1948
|
className: "flex flex-1 p-0 overflow-hidden",
|
|
2126
1949
|
children: [
|
|
2127
|
-
m && !p && /* @__PURE__ */ (
|
|
1950
|
+
m && !p && /* @__PURE__ */ U("div", {
|
|
2128
1951
|
className: "w-36 border-r bg-muted/30 flex-shrink-0 overflow-y-auto py-2 px-2",
|
|
2129
1952
|
children: [
|
|
2130
|
-
/* @__PURE__ */ (
|
|
1953
|
+
/* @__PURE__ */ H("p", {
|
|
2131
1954
|
className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-2 px-1",
|
|
2132
1955
|
children: "Add Node"
|
|
2133
1956
|
}),
|
|
2134
|
-
/* @__PURE__ */ (
|
|
1957
|
+
/* @__PURE__ */ H("div", {
|
|
2135
1958
|
className: "space-y-1",
|
|
2136
|
-
children:
|
|
1959
|
+
children: Ne.map((e) => /* @__PURE__ */ U("button", {
|
|
2137
1960
|
className: "w-full flex items-center gap-2 text-xs px-2 py-1.5 rounded hover:bg-muted transition-colors text-left",
|
|
2138
|
-
onClick: () =>
|
|
2139
|
-
title: `Add ${
|
|
2140
|
-
children: [
|
|
1961
|
+
onClick: () => Y(e),
|
|
1962
|
+
title: `Add ${ke[e]}`,
|
|
1963
|
+
children: [Ae[e], /* @__PURE__ */ H("span", {
|
|
2141
1964
|
className: "truncate",
|
|
2142
|
-
children:
|
|
1965
|
+
children: ke[e]
|
|
2143
1966
|
})]
|
|
2144
1967
|
}, e))
|
|
2145
1968
|
}),
|
|
2146
|
-
|
|
1969
|
+
L && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(v, { className: "my-2" }), /* @__PURE__ */ U("div", {
|
|
2147
1970
|
className: "px-1",
|
|
2148
1971
|
children: [
|
|
2149
|
-
/* @__PURE__ */ (
|
|
1972
|
+
/* @__PURE__ */ H("p", {
|
|
2150
1973
|
className: "text-[10px] text-blue-600 font-medium",
|
|
2151
1974
|
children: "Connect mode"
|
|
2152
1975
|
}),
|
|
2153
|
-
/* @__PURE__ */ (
|
|
1976
|
+
/* @__PURE__ */ H("p", {
|
|
2154
1977
|
className: "text-[10px] text-muted-foreground",
|
|
2155
1978
|
children: "Click a target node port to connect."
|
|
2156
1979
|
}),
|
|
2157
|
-
/* @__PURE__ */ (
|
|
1980
|
+
/* @__PURE__ */ H(o, {
|
|
2158
1981
|
size: "sm",
|
|
2159
1982
|
variant: "outline",
|
|
2160
1983
|
className: "h-6 text-xs mt-1 w-full",
|
|
2161
1984
|
onClick: () => {
|
|
2162
|
-
|
|
1985
|
+
R(!1), B(null);
|
|
2163
1986
|
},
|
|
2164
1987
|
children: "Cancel"
|
|
2165
1988
|
})
|
|
@@ -2167,10 +1990,10 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
2167
1990
|
})] })
|
|
2168
1991
|
]
|
|
2169
1992
|
}),
|
|
2170
|
-
/* @__PURE__ */ (
|
|
1993
|
+
/* @__PURE__ */ H("div", {
|
|
2171
1994
|
className: "flex-1 overflow-auto relative bg-dot-pattern",
|
|
2172
|
-
children: /* @__PURE__ */ (
|
|
2173
|
-
ref:
|
|
1995
|
+
children: /* @__PURE__ */ U("div", {
|
|
1996
|
+
ref: J,
|
|
2174
1997
|
className: "relative",
|
|
2175
1998
|
style: {
|
|
2176
1999
|
width: 1200,
|
|
@@ -2178,65 +2001,65 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
2178
2001
|
transform: `scale(${K})`,
|
|
2179
2002
|
transformOrigin: "top left"
|
|
2180
2003
|
},
|
|
2181
|
-
onDrop:
|
|
2004
|
+
onDrop: je,
|
|
2182
2005
|
onDragOver: (e) => e.preventDefault(),
|
|
2183
2006
|
onClick: (e) => {
|
|
2184
|
-
e.target ===
|
|
2007
|
+
e.target === J.current && (P(null), I(null));
|
|
2185
2008
|
},
|
|
2186
2009
|
children: [
|
|
2187
|
-
/* @__PURE__ */ (
|
|
2010
|
+
/* @__PURE__ */ U("svg", {
|
|
2188
2011
|
className: "absolute inset-0 pointer-events-none",
|
|
2189
2012
|
width: 1200,
|
|
2190
2013
|
height: 700,
|
|
2191
2014
|
style: { overflow: "visible" },
|
|
2192
|
-
children: [/* @__PURE__ */ (
|
|
2193
|
-
/* @__PURE__ */ (
|
|
2015
|
+
children: [/* @__PURE__ */ U("defs", { children: [
|
|
2016
|
+
/* @__PURE__ */ H("marker", {
|
|
2194
2017
|
id: "fd-arrowhead",
|
|
2195
2018
|
markerWidth: "10",
|
|
2196
2019
|
markerHeight: "7",
|
|
2197
2020
|
refX: "9",
|
|
2198
2021
|
refY: "3.5",
|
|
2199
2022
|
orient: "auto",
|
|
2200
|
-
children: /* @__PURE__ */ (
|
|
2023
|
+
children: /* @__PURE__ */ H("polygon", {
|
|
2201
2024
|
points: "0 0, 10 3.5, 0 7",
|
|
2202
2025
|
fill: "hsl(var(--foreground) / 0.5)"
|
|
2203
2026
|
})
|
|
2204
2027
|
}),
|
|
2205
|
-
/* @__PURE__ */ (
|
|
2028
|
+
/* @__PURE__ */ H("marker", {
|
|
2206
2029
|
id: "fd-arrowhead-selected",
|
|
2207
2030
|
markerWidth: "10",
|
|
2208
2031
|
markerHeight: "7",
|
|
2209
2032
|
refX: "9",
|
|
2210
2033
|
refY: "3.5",
|
|
2211
2034
|
orient: "auto",
|
|
2212
|
-
children: /* @__PURE__ */ (
|
|
2035
|
+
children: /* @__PURE__ */ H("polygon", {
|
|
2213
2036
|
points: "0 0, 10 3.5, 0 7",
|
|
2214
2037
|
fill: "hsl(var(--primary))"
|
|
2215
2038
|
})
|
|
2216
2039
|
}),
|
|
2217
|
-
/* @__PURE__ */ (
|
|
2040
|
+
/* @__PURE__ */ H("marker", {
|
|
2218
2041
|
id: "fd-arrowhead-conditional",
|
|
2219
2042
|
markerWidth: "10",
|
|
2220
2043
|
markerHeight: "7",
|
|
2221
2044
|
refX: "9",
|
|
2222
2045
|
refY: "3.5",
|
|
2223
2046
|
orient: "auto",
|
|
2224
|
-
children: /* @__PURE__ */ (
|
|
2047
|
+
children: /* @__PURE__ */ H("polygon", {
|
|
2225
2048
|
points: "0 0, 10 3.5, 0 7",
|
|
2226
2049
|
fill: "hsl(var(--foreground) / 0.6)"
|
|
2227
2050
|
})
|
|
2228
2051
|
})
|
|
2229
|
-
] }),
|
|
2230
|
-
let t =
|
|
2052
|
+
] }), M.map((e) => {
|
|
2053
|
+
let t = Ce.find((t) => t.id === e.source), n = Ce.find((t) => t.id === e.target);
|
|
2231
2054
|
if (!t || !n) return null;
|
|
2232
|
-
let { d: r, labelX: i, labelY: a } =
|
|
2233
|
-
return /* @__PURE__ */ (
|
|
2055
|
+
let { d: r, labelX: i, labelY: a } = Be(t, n), o = e.id === F, s = e.type === "conditional", c = e.isDefault;
|
|
2056
|
+
return /* @__PURE__ */ U("g", {
|
|
2234
2057
|
className: "pointer-events-auto cursor-pointer",
|
|
2235
2058
|
onClick: (t) => {
|
|
2236
|
-
t.stopPropagation(),
|
|
2059
|
+
t.stopPropagation(), I(e.id), P(null);
|
|
2237
2060
|
},
|
|
2238
2061
|
children: [
|
|
2239
|
-
/* @__PURE__ */ (
|
|
2062
|
+
/* @__PURE__ */ H("path", {
|
|
2240
2063
|
d: r,
|
|
2241
2064
|
fill: "none",
|
|
2242
2065
|
stroke: o ? "hsl(var(--primary))" : s ? "hsl(var(--foreground) / 0.6)" : "hsl(var(--foreground) / 0.4)",
|
|
@@ -2244,7 +2067,7 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
2244
2067
|
strokeDasharray: s ? "6 3" : c ? "3 3" : void 0,
|
|
2245
2068
|
markerEnd: `url(#fd-arrowhead${o ? "-selected" : s ? "-conditional" : ""})`
|
|
2246
2069
|
}),
|
|
2247
|
-
(e.label || c) && /* @__PURE__ */ (
|
|
2070
|
+
(e.label || c) && /* @__PURE__ */ H("text", {
|
|
2248
2071
|
x: i,
|
|
2249
2072
|
y: a,
|
|
2250
2073
|
textAnchor: "middle",
|
|
@@ -2252,7 +2075,7 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
2252
2075
|
style: { fontSize: 10 },
|
|
2253
2076
|
children: e.label ?? (c ? "(default)" : "")
|
|
2254
2077
|
}),
|
|
2255
|
-
e.condition && /* @__PURE__ */ (
|
|
2078
|
+
e.condition && /* @__PURE__ */ H("text", {
|
|
2256
2079
|
x: i,
|
|
2257
2080
|
y: a + 12,
|
|
2258
2081
|
textAnchor: "middle",
|
|
@@ -2260,7 +2083,7 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
2260
2083
|
style: { fontSize: 9 },
|
|
2261
2084
|
children: e.condition.length > 24 ? e.condition.slice(0, 24) + "…" : e.condition
|
|
2262
2085
|
}),
|
|
2263
|
-
/* @__PURE__ */ (
|
|
2086
|
+
/* @__PURE__ */ H("path", {
|
|
2264
2087
|
d: r,
|
|
2265
2088
|
fill: "none",
|
|
2266
2089
|
stroke: "transparent",
|
|
@@ -2270,56 +2093,56 @@ var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly
|
|
|
2270
2093
|
}, e.id);
|
|
2271
2094
|
})]
|
|
2272
2095
|
}),
|
|
2273
|
-
|
|
2096
|
+
Ce.map((e) => /* @__PURE__ */ H(Ve, {
|
|
2274
2097
|
node: e,
|
|
2275
|
-
isSelected:
|
|
2276
|
-
isConnectSource:
|
|
2277
|
-
connectMode:
|
|
2098
|
+
isSelected: N === e.id,
|
|
2099
|
+
isConnectSource: z === e.id,
|
|
2100
|
+
connectMode: L,
|
|
2278
2101
|
readOnly: p,
|
|
2279
2102
|
showExecutionOverlay: _,
|
|
2280
2103
|
onSelect: (e, t) => {
|
|
2281
|
-
t ||
|
|
2104
|
+
t || I(null), P(e);
|
|
2282
2105
|
},
|
|
2283
|
-
onDelete:
|
|
2284
|
-
onDragStart:
|
|
2285
|
-
onPortClick:
|
|
2106
|
+
onDelete: we,
|
|
2107
|
+
onDragStart: Q,
|
|
2108
|
+
onPortClick: Oe
|
|
2286
2109
|
}, e.id)),
|
|
2287
|
-
|
|
2110
|
+
L && z && /* @__PURE__ */ U("div", {
|
|
2288
2111
|
className: "absolute bottom-4 left-1/2 -translate-x-1/2 bg-blue-600 text-white text-xs px-3 py-1.5 rounded shadow-lg pointer-events-none",
|
|
2289
|
-
children: [/* @__PURE__ */ (
|
|
2112
|
+
children: [/* @__PURE__ */ H(re, { className: "h-3 w-3 inline mr-1" }), "Click a node port to complete the connection — Esc to cancel"]
|
|
2290
2113
|
}),
|
|
2291
|
-
|
|
2114
|
+
j.length === 0 && /* @__PURE__ */ H("div", {
|
|
2292
2115
|
className: "absolute inset-0 flex items-center justify-center text-muted-foreground text-sm",
|
|
2293
2116
|
children: "No nodes yet. Use the toolbar to add nodes."
|
|
2294
2117
|
})
|
|
2295
2118
|
]
|
|
2296
2119
|
})
|
|
2297
2120
|
}),
|
|
2298
|
-
|
|
2121
|
+
W && b.length > 0 && /* @__PURE__ */ H("div", {
|
|
2299
2122
|
className: "w-48 border-l bg-background flex-shrink-0 overflow-y-auto",
|
|
2300
|
-
children: /* @__PURE__ */ (
|
|
2123
|
+
children: /* @__PURE__ */ H(Ue, { versions: b })
|
|
2301
2124
|
}),
|
|
2302
|
-
|
|
2125
|
+
_e && /* @__PURE__ */ U("div", {
|
|
2303
2126
|
className: "w-52 border-l bg-background flex-shrink-0 overflow-y-auto",
|
|
2304
|
-
children: [/* @__PURE__ */ (
|
|
2305
|
-
node:
|
|
2306
|
-
edge:
|
|
2127
|
+
children: [/* @__PURE__ */ H(He, {
|
|
2128
|
+
node: xe,
|
|
2129
|
+
edge: Se,
|
|
2307
2130
|
readOnly: p,
|
|
2308
|
-
onNodeChange:
|
|
2309
|
-
onEdgeChange:
|
|
2310
|
-
}),
|
|
2131
|
+
onNodeChange: Te,
|
|
2132
|
+
onEdgeChange: De
|
|
2133
|
+
}), G && /* @__PURE__ */ U("div", {
|
|
2311
2134
|
className: "p-3 border-t",
|
|
2312
2135
|
children: [
|
|
2313
|
-
/* @__PURE__ */ (
|
|
2136
|
+
/* @__PURE__ */ H("p", {
|
|
2314
2137
|
className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1",
|
|
2315
2138
|
children: "BPMN Export"
|
|
2316
2139
|
}),
|
|
2317
|
-
/* @__PURE__ */ (
|
|
2318
|
-
variant:
|
|
2140
|
+
/* @__PURE__ */ H(a, {
|
|
2141
|
+
variant: G.success ? "default" : "destructive",
|
|
2319
2142
|
className: "text-[10px]",
|
|
2320
|
-
children:
|
|
2143
|
+
children: G.success ? `Exported ${G.nodeCount} nodes` : "Export failed"
|
|
2321
2144
|
}),
|
|
2322
|
-
|
|
2145
|
+
G.warnings?.map((e, t) => /* @__PURE__ */ H("p", {
|
|
2323
2146
|
className: "text-[10px] text-amber-600 mt-0.5",
|
|
2324
2147
|
children: e
|
|
2325
2148
|
}, t))
|
|
@@ -2358,7 +2181,7 @@ e.register("workflow-designer", be, {
|
|
|
2358
2181
|
defaultValue: !1
|
|
2359
2182
|
}
|
|
2360
2183
|
]
|
|
2361
|
-
}), e.register("approval-process",
|
|
2184
|
+
}), e.register("approval-process", K, {
|
|
2362
2185
|
label: "Approval Process",
|
|
2363
2186
|
category: "Enterprise",
|
|
2364
2187
|
inputs: [
|
|
@@ -2400,7 +2223,7 @@ e.register("workflow-designer", be, {
|
|
|
2400
2223
|
defaultValue: !0
|
|
2401
2224
|
}
|
|
2402
2225
|
]
|
|
2403
|
-
}), e.register("automation-builder",
|
|
2226
|
+
}), e.register("automation-builder", we, {
|
|
2404
2227
|
label: "Automation Builder",
|
|
2405
2228
|
category: "Enterprise",
|
|
2406
2229
|
inputs: [{
|
|
@@ -2420,7 +2243,7 @@ e.register("workflow-designer", be, {
|
|
|
2420
2243
|
type: "code",
|
|
2421
2244
|
label: "Run History"
|
|
2422
2245
|
}]
|
|
2423
|
-
}), e.register("flow-designer",
|
|
2246
|
+
}), e.register("flow-designer", We, {
|
|
2424
2247
|
label: "Flow Designer",
|
|
2425
2248
|
category: "Enterprise",
|
|
2426
2249
|
inputs: [
|
|
@@ -2487,4 +2310,4 @@ e.register("workflow-designer", be, {
|
|
|
2487
2310
|
]
|
|
2488
2311
|
});
|
|
2489
2312
|
//#endregion
|
|
2490
|
-
export {
|
|
2313
|
+
export { K as ApprovalProcess, we as AutomationBuilder, Oe as AutomationRunHistory, We as FlowDesigner, be as WorkflowDesigner };
|