@notmrabhi/flowforge 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GatewayBranchEdge-C-gffuVA.js +1 -0
- package/dist/GatewayBranchEdge-DHqcdxpD.js +1176 -0
- package/dist/SchemaBuilderDrawer-BAOGl8dt.js +3682 -0
- package/dist/SchemaBuilderDrawer-CP-Lqo0S.js +4 -0
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.js +2 -2
- package/dist/defaultUi.cjs +1 -1
- package/dist/defaultUi.js +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +39 -38
- package/dist/{index-uTiQ7O15.js → index-9Ahm5dnn.js} +1 -1
- package/dist/{index-C2VIw_j3.js → index-CiAhn6cP.js} +1 -1
- package/dist/index-D6g2IXSf.js +7611 -0
- package/dist/index-ucLEoH8L.js +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +85 -84
- package/dist/templateSkeletons-BLzZ5u00.js +1 -0
- package/dist/templateSkeletons-Ce90PFaV.js +2799 -0
- package/package.json +1 -1
- package/dist/GatewayBranchEdge-C-AVfqfT.js +0 -1
- package/dist/GatewayBranchEdge-gncIBR-0.js +0 -854
- package/dist/SchemaBuilderDrawer-B5oBHKmV.js +0 -3235
- package/dist/SchemaBuilderDrawer-DM3EucIa.js +0 -4
- package/dist/index-BbxqTJq-.js +0 -6
- package/dist/index-C9g7owAq.js +0 -7318
- package/dist/templateSkeletons-BGvu7nnP.js +0 -2617
- package/dist/templateSkeletons-Ccxv9TAx.js +0 -1
|
@@ -1,854 +0,0 @@
|
|
|
1
|
-
import e, { createContext as le, useContext as re } from "react";
|
|
2
|
-
import { Handle as b, Position as x, getStraightPath as B, BaseEdge as M } from "reactflow";
|
|
3
|
-
import { Tooltip as A, Chip as j } from "@mui/material";
|
|
4
|
-
import { GrTrigger as ae } from "react-icons/gr";
|
|
5
|
-
import { d as se } from "./messages-CO299wPN.js";
|
|
6
|
-
import { MdOutlineModeEdit as C, MdInfoOutline as K, MdInput as ie, MdDeleteOutline as I, MdCheckCircle as fe, MdPeople as ce, MdSchedule as de, MdWebhook as te, MdNotifications as $, MdSms as me, MdEmail as pe, MdContentCopy as ge, MdHttp as ye, MdCallSplit as ue, MdAccountTree as Ee, MdOpenInNew as be } from "react-icons/md";
|
|
7
|
-
import { FaCheckCircle as xe, FaTimesCircle as he } from "react-icons/fa";
|
|
8
|
-
import { FiFilter as Ne } from "react-icons/fi";
|
|
9
|
-
import { a as L, H as ke, B as _ } from "./canvasTokens-CAD6G24b.js";
|
|
10
|
-
const ve = le({
|
|
11
|
-
onEditNode: () => {
|
|
12
|
-
},
|
|
13
|
-
onDeleteNode: () => {
|
|
14
|
-
},
|
|
15
|
-
onAddStep: () => {
|
|
16
|
-
},
|
|
17
|
-
onClickAddTrigger: () => {
|
|
18
|
-
},
|
|
19
|
-
messages: se,
|
|
20
|
-
nodeRegistry: null,
|
|
21
|
-
nodeBody: "full"
|
|
22
|
-
}), w = () => re(ve), we = () => /* @__PURE__ */ e.createElement("div", { style: { width: 350, display: "flex", justifyContent: "center" } }, /* @__PURE__ */ e.createElement(b, { type: "source", position: x.Bottom, style: { opacity: 0, left: "50%" } }), /* @__PURE__ */ e.createElement("div", { style: { padding: "8px 28px", borderRadius: 999, background: "#f5f5f5", border: "1.5px solid #bdbdbd", fontSize: 13, fontWeight: 500, color: "#424242", userSelect: "none" } }, "Start")), Se = () => /* @__PURE__ */ e.createElement("div", { style: { width: 350, display: "flex", justifyContent: "center" } }, /* @__PURE__ */ e.createElement(b, { type: "target", position: x.Top, style: { opacity: 0, left: "50%" } }), /* @__PURE__ */ e.createElement("div", { style: { padding: "8px 28px", borderRadius: 999, background: "#f5f5f5", border: "1.5px solid #bdbdbd", fontSize: 13, fontWeight: 500, color: "#424242", userSelect: "none" } }, "End")), Ce = () => {
|
|
23
|
-
const { onClickAddTrigger: t, messages: l } = w();
|
|
24
|
-
return /* @__PURE__ */ e.createElement("div", { style: { width: 350, display: "flex", justifyContent: "center" } }, /* @__PURE__ */ e.createElement(b, { type: "target", position: x.Top, style: { opacity: 0, left: "50%" } }), /* @__PURE__ */ e.createElement(A, { title: l.addTriggerTooltip, placement: "top", arrow: !0 }, /* @__PURE__ */ e.createElement(
|
|
25
|
-
"div",
|
|
26
|
-
{
|
|
27
|
-
onClick: t,
|
|
28
|
-
role: "button",
|
|
29
|
-
tabIndex: 0,
|
|
30
|
-
onKeyDown: (s) => {
|
|
31
|
-
s.key === "Enter" && t();
|
|
32
|
-
},
|
|
33
|
-
style: { padding: "10px 24px", borderRadius: 8, border: "1.5px dashed #d0d0d0", background: "#fff", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }
|
|
34
|
-
},
|
|
35
|
-
/* @__PURE__ */ e.createElement(ae, { size: 16 }),
|
|
36
|
-
/* @__PURE__ */ e.createElement("span", { className: "ff-text-black", style: { fontSize: 13 }, "data-testid": "add-trigger-btn-text" }, l.addTriggerButton)
|
|
37
|
-
)), /* @__PURE__ */ e.createElement(b, { type: "source", position: x.Bottom, style: { opacity: 0, left: "50%" } }));
|
|
38
|
-
}, Te = ({ id: t }) => {
|
|
39
|
-
const { onAddStep: l } = w();
|
|
40
|
-
return /* @__PURE__ */ e.createElement(
|
|
41
|
-
"div",
|
|
42
|
-
{
|
|
43
|
-
onClick: () => l(t),
|
|
44
|
-
role: "button",
|
|
45
|
-
tabIndex: 0,
|
|
46
|
-
onKeyDown: (s) => {
|
|
47
|
-
s.key === "Enter" && l(t);
|
|
48
|
-
},
|
|
49
|
-
style: { width: 28, height: 28, borderRadius: "50%", border: "1.5px solid #9e9e9e", background: "#fff", display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", fontSize: 18, color: "#757575", lineHeight: 1, userSelect: "none" }
|
|
50
|
-
},
|
|
51
|
-
/* @__PURE__ */ e.createElement(b, { type: "target", position: x.Top, style: { opacity: 0 } }),
|
|
52
|
-
"+",
|
|
53
|
-
/* @__PURE__ */ e.createElement(b, { type: "source", position: x.Bottom, style: { opacity: 0 } })
|
|
54
|
-
);
|
|
55
|
-
};
|
|
56
|
-
function ze(t) {
|
|
57
|
-
return t ? t === "END_USER_CREATION" ? "New User Registration" : t === "END_USER_UPDATION" ? "On User Update" : t.replace(/[_-]+/g, " ").replace(/\b\w/g, (l) => l.toUpperCase()) : "";
|
|
58
|
-
}
|
|
59
|
-
function Ie(t) {
|
|
60
|
-
const l = typeof t == "string" ? t : t.value ?? "";
|
|
61
|
-
return l === "SIGNUP_FLOW" ? "User Self-Registration" : l === "ADMIN_CREATION_FLOW" ? "Create User via Admin Portal" : l === "SHEDULAR" ? "Scheduler" : typeof t != "string" && t.label ? t.label : l.replace(/[_-]+/g, " ").replace(/\b\w/g, (s) => s.toUpperCase());
|
|
62
|
-
}
|
|
63
|
-
const Pe = ({ data: t }) => {
|
|
64
|
-
const { onClickAddTrigger: l } = w(), {
|
|
65
|
-
type: s,
|
|
66
|
-
eventType: d,
|
|
67
|
-
sources: a,
|
|
68
|
-
label: r,
|
|
69
|
-
source: m,
|
|
70
|
-
previewWorkflow: n,
|
|
71
|
-
executionStatus: o,
|
|
72
|
-
infoText: f = "This node decides the flow trigger type and configuration."
|
|
73
|
-
} = t ?? {}, g = (u) => {
|
|
74
|
-
u == null || u.stopPropagation(), l();
|
|
75
|
-
}, p = Array.isArray(a) && a.length > 0, E = !!(r || m), c = s === "scheduler" ? "Scheduler Trigger" : s === "event" || p || E ? "Event Trigger Source" : "Select Trigger", i = s === "scheduler" ? /* @__PURE__ */ e.createElement("span", null, "Scheduler to be configured") : s === "event" || p ? /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center" }, /* @__PURE__ */ e.createElement("span", { style: { fontWeight: 600 } }, ze(d)), /* @__PURE__ */ e.createElement("span", { className: "ff-ms-2 ff-text-muted", style: { fontSize: 12 } }, "via")), /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-flex-wrap ff-mt-2", style: { gap: 4 } }, p ? a.map((u, k) => /* @__PURE__ */ e.createElement(
|
|
76
|
-
j,
|
|
77
|
-
{
|
|
78
|
-
key: k,
|
|
79
|
-
label: Ie(u),
|
|
80
|
-
variant: "outlined",
|
|
81
|
-
size: "small",
|
|
82
|
-
className: "ff-text-dark"
|
|
83
|
-
}
|
|
84
|
-
)) : /* @__PURE__ */ e.createElement("span", { className: "ff-text-muted", style: { fontSize: 12 } }, "No source selected"))) : E ? /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-flex-wrap ff-align-items-center", style: { gap: 6 } }, r && /* @__PURE__ */ e.createElement("span", { style: { fontWeight: 600 } }, r), m && /* @__PURE__ */ e.createElement(j, { label: m, variant: "outlined", size: "small" })) : /* @__PURE__ */ e.createElement(
|
|
85
|
-
"span",
|
|
86
|
-
{
|
|
87
|
-
role: "button",
|
|
88
|
-
tabIndex: 0,
|
|
89
|
-
onClick: g,
|
|
90
|
-
onKeyDown: (u) => {
|
|
91
|
-
(u.key === "Enter" || u.key === " ") && g(u);
|
|
92
|
-
},
|
|
93
|
-
style: { cursor: "pointer", color: "#1e88e5" }
|
|
94
|
-
},
|
|
95
|
-
"Click to select a trigger to start your workflow"
|
|
96
|
-
), N = o ? /* @__PURE__ */ e.createElement(e.Fragment, null, o.status === "success" && /* @__PURE__ */ e.createElement(xe, { size: 16, color: "#1DBF60", style: { marginRight: 8 } }), o.status === "failed" && /* @__PURE__ */ e.createElement(he, { size: 16, color: "#f44336", style: { marginRight: 8 } })) : /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center" }, !n && /* @__PURE__ */ e.createElement(
|
|
97
|
-
"div",
|
|
98
|
-
{
|
|
99
|
-
role: "button",
|
|
100
|
-
tabIndex: 0,
|
|
101
|
-
onClick: g,
|
|
102
|
-
onKeyDown: (u) => {
|
|
103
|
-
(u.key === "Enter" || u.key === " ") && g(u);
|
|
104
|
-
},
|
|
105
|
-
className: "ff-me-2",
|
|
106
|
-
style: { cursor: "pointer", color: "#212121" },
|
|
107
|
-
"aria-label": "Edit trigger"
|
|
108
|
-
},
|
|
109
|
-
/* @__PURE__ */ e.createElement(C, { size: 16 })
|
|
110
|
-
), /* @__PURE__ */ e.createElement(A, { title: /* @__PURE__ */ e.createElement("div", null, f), placement: "right", arrow: !0 }, /* @__PURE__ */ e.createElement("span", null, /* @__PURE__ */ e.createElement(K, { color: "gray", size: 16 }))));
|
|
111
|
-
return /* @__PURE__ */ e.createElement("div", { style: { width: 350 } }, /* @__PURE__ */ e.createElement(b, { type: "target", position: x.Top, style: { opacity: 0 } }), /* @__PURE__ */ e.createElement("div", { style: { border: "1.5px solid #a5d6a7", borderRadius: 8, background: "#fff", overflow: "hidden" } }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" } }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center ff-gap-2" }, /* @__PURE__ */ e.createElement(
|
|
112
|
-
"div",
|
|
113
|
-
{
|
|
114
|
-
style: {
|
|
115
|
-
width: 28,
|
|
116
|
-
height: 28,
|
|
117
|
-
borderRadius: 6,
|
|
118
|
-
background: "rgba(76,175,80,0.1)",
|
|
119
|
-
display: "flex",
|
|
120
|
-
alignItems: "center",
|
|
121
|
-
justifyContent: "center",
|
|
122
|
-
flexShrink: 0
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
/* @__PURE__ */ e.createElement(ie, { size: 16, color: "#388e3c" })
|
|
126
|
-
), /* @__PURE__ */ e.createElement("span", { style: { fontSize: 14, fontWeight: 600, color: "#212121" } }, c)), /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center" }, N)), /* @__PURE__ */ e.createElement(
|
|
127
|
-
"div",
|
|
128
|
-
{
|
|
129
|
-
style: {
|
|
130
|
-
background: "#f5f5f5",
|
|
131
|
-
fontSize: 12,
|
|
132
|
-
color: "#212121",
|
|
133
|
-
padding: "10px 6px",
|
|
134
|
-
margin: "0 12px 12px",
|
|
135
|
-
borderRadius: 6
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
i
|
|
139
|
-
)), /* @__PURE__ */ e.createElement(b, { type: "source", position: x.Bottom, style: { opacity: 0 }, id: "1" }));
|
|
140
|
-
}, ne = ({ rail: t, cardWidth: l }) => {
|
|
141
|
-
const s = l / 2;
|
|
142
|
-
l / 2 + t.indent;
|
|
143
|
-
const d = "var(--ff-edge-color, #b0bec5)";
|
|
144
|
-
return /* @__PURE__ */ e.createElement(
|
|
145
|
-
"svg",
|
|
146
|
-
{
|
|
147
|
-
width: l + t.indent + 200,
|
|
148
|
-
height: t.height,
|
|
149
|
-
style: { position: "absolute", left: 0, top: "100%", pointerEvents: "none", overflow: "visible" }
|
|
150
|
-
},
|
|
151
|
-
/* @__PURE__ */ e.createElement("line", { x1: s, y1: 0, x2: s, y2: t.height, stroke: d, strokeWidth: 1.5 }),
|
|
152
|
-
t.branches.map((a, r) => {
|
|
153
|
-
const m = a.y;
|
|
154
|
-
return /* @__PURE__ */ e.createElement("g", { key: r, transform: `translate(0, ${m})` }, /* @__PURE__ */ e.createElement(
|
|
155
|
-
"rect",
|
|
156
|
-
{
|
|
157
|
-
x: s - 5,
|
|
158
|
-
y: -5,
|
|
159
|
-
width: 10,
|
|
160
|
-
height: 10,
|
|
161
|
-
fill: "#fff",
|
|
162
|
-
stroke: d,
|
|
163
|
-
strokeWidth: 1.5,
|
|
164
|
-
transform: `rotate(45, ${s}, 0)`
|
|
165
|
-
}
|
|
166
|
-
), /* @__PURE__ */ e.createElement(
|
|
167
|
-
"text",
|
|
168
|
-
{
|
|
169
|
-
x: s + 14,
|
|
170
|
-
y: 4,
|
|
171
|
-
fontSize: 12,
|
|
172
|
-
fontWeight: 500,
|
|
173
|
-
fill: "var(--ff-text, #212121)",
|
|
174
|
-
style: { fontFamily: "sans-serif" }
|
|
175
|
-
},
|
|
176
|
-
a.label
|
|
177
|
-
));
|
|
178
|
-
})
|
|
179
|
-
);
|
|
180
|
-
}, De = ({ id: t, data: l }) => {
|
|
181
|
-
const { onEditNode: s, onDeleteNode: d } = w(), { conditions: a = [], infoText: r = "Filter conditions applied to workflow data", _branchRail: m } = l;
|
|
182
|
-
return /* @__PURE__ */ e.createElement("div", { style: { width: 350, position: "relative" } }, /* @__PURE__ */ e.createElement(b, { type: "target", position: x.Top, style: { opacity: 0 } }), /* @__PURE__ */ e.createElement("div", { style: { border: "1.5px solid #ffe082", borderRadius: 8, background: "#fff" } }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-mb-2 ff-justify-content-between ff-align-items-center ff-mx-2 ff-mt-2" }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center" }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded", style: { width: 25, height: 25, background: "rgba(255,160,0,0.1)" } }, /* @__PURE__ */ e.createElement(Ne, { className: "ff-text-warning", size: 16 })), /* @__PURE__ */ e.createElement("span", { className: "ff-ms-2 ff-fw-medium ff-text-dark", style: { fontSize: 14 } }, "Filter")), /* @__PURE__ */ e.createElement("div", { className: "node-actions ff-d-flex ff-align-items-center" }, /* @__PURE__ */ e.createElement(
|
|
183
|
-
"div",
|
|
184
|
-
{
|
|
185
|
-
role: "button",
|
|
186
|
-
tabIndex: 0,
|
|
187
|
-
onClick: (n) => {
|
|
188
|
-
n.stopPropagation(), s(t);
|
|
189
|
-
},
|
|
190
|
-
onKeyDown: (n) => {
|
|
191
|
-
n.key === "Enter" && (n.stopPropagation(), s(t));
|
|
192
|
-
}
|
|
193
|
-
},
|
|
194
|
-
/* @__PURE__ */ e.createElement(C, { size: 16 })
|
|
195
|
-
), /* @__PURE__ */ e.createElement(
|
|
196
|
-
"div",
|
|
197
|
-
{
|
|
198
|
-
className: "ff-ms-2",
|
|
199
|
-
role: "button",
|
|
200
|
-
tabIndex: 0,
|
|
201
|
-
onClick: (n) => {
|
|
202
|
-
n.stopPropagation(), d(t);
|
|
203
|
-
},
|
|
204
|
-
onKeyDown: (n) => {
|
|
205
|
-
n.key === "Enter" && (n.stopPropagation(), d(t));
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
/* @__PURE__ */ e.createElement(I, { color: "red", size: 16 })
|
|
209
|
-
), /* @__PURE__ */ e.createElement(A, { title: r, placement: "right", arrow: !0 }, /* @__PURE__ */ e.createElement("div", { className: "ff-ms-2" }, /* @__PURE__ */ e.createElement(K, { color: "gray", size: 16 }))))), /* @__PURE__ */ e.createElement("div", { className: "ff-p-2 ff-mx-2 ff-mb-2 ff-rounded", style: { background: "#fafafa", fontSize: 12 } }, a.length === 0 ? /* @__PURE__ */ e.createElement("span", { className: "ff-text-muted" }, "No conditions configured") : a.map((n, o) => /* @__PURE__ */ e.createElement("div", { key: o, className: "ff-d-flex ff-align-items-center ff-mb-1" }, /* @__PURE__ */ e.createElement("p", { className: "ff-m-0 ff-fw-bold ff-me-1 ff-text-truncate", style: { maxWidth: 100 }, title: n.field }, n.field), /* @__PURE__ */ e.createElement("span", { className: "ff-text-muted" }, n.operator), /* @__PURE__ */ e.createElement("p", { className: "ff-text-dark ff-text-truncate ff-mx-1 ff-m-0", title: n.value }, n.value), o < a.length - 1 && /* @__PURE__ */ e.createElement("p", { className: "ff-bg-primary ff-text-white ff-fw-bold ff-ms-1 ff-px-1 ff-rounded-1 ff-m-0" }, n.logicalOperator))))), /* @__PURE__ */ e.createElement(b, { type: "source", position: x.Bottom, style: { opacity: 0 } }), m && /* @__PURE__ */ e.createElement(ne, { rail: m, cardWidth: 350 }));
|
|
210
|
-
}, Ae = ({ id: t, data: l }) => {
|
|
211
|
-
const { onEditNode: s, onDeleteNode: d, nodeRegistry: a, nodeBody: r = "full" } = w(), { title: m = "Task", descriptorType: n, groupBlocks: o, groups: f, roles: g, groupId: p, roleId: E, infoText: c = "" } = l, i = n ? a == null ? void 0 : a.forType(n) : void 0, N = i == null ? void 0 : i.icon, u = (y) => y == null ? "" : typeof y == "string" ? y : typeof y == "object" && "label" in y ? String(y.label) : String(y), k = (y) => Array.isArray(y) ? y.map(u).filter(Boolean) : y != null && y !== "" ? [u(y)] : [], h = (o == null ? void 0 : o.flatMap((y) => y.groups ?? [])) ?? [...k(f), ...k(g), ...k(p), ...k(E)], z = h.length > 0;
|
|
212
|
-
return /* @__PURE__ */ e.createElement("div", { style: { width: 350 } }, /* @__PURE__ */ e.createElement(b, { type: "target", position: x.Top, style: { opacity: 0 } }), /* @__PURE__ */ e.createElement("div", { style: { border: "1.5px solid #b0bec5", borderRadius: 8, background: "#fff" } }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center ff-mx-2 ff-mt-2 ff-mb-1" }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center ff-gap-2" }, N && /* @__PURE__ */ e.createElement("div", { style: { display: "flex", alignItems: "center" } }, N), /* @__PURE__ */ e.createElement("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 } }, m)), /* @__PURE__ */ e.createElement("div", { className: "node-actions ff-d-flex ff-align-items-center" }, /* @__PURE__ */ e.createElement(
|
|
213
|
-
"div",
|
|
214
|
-
{
|
|
215
|
-
role: "button",
|
|
216
|
-
tabIndex: 0,
|
|
217
|
-
onClick: (y) => {
|
|
218
|
-
y.stopPropagation(), s(t);
|
|
219
|
-
},
|
|
220
|
-
onKeyDown: (y) => {
|
|
221
|
-
y.key === "Enter" && (y.stopPropagation(), s(t));
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
/* @__PURE__ */ e.createElement(C, { size: 16 })
|
|
225
|
-
), /* @__PURE__ */ e.createElement(
|
|
226
|
-
"div",
|
|
227
|
-
{
|
|
228
|
-
className: "ff-ms-2",
|
|
229
|
-
role: "button",
|
|
230
|
-
tabIndex: 0,
|
|
231
|
-
onClick: (y) => {
|
|
232
|
-
y.stopPropagation(), d(t);
|
|
233
|
-
},
|
|
234
|
-
onKeyDown: (y) => {
|
|
235
|
-
y.key === "Enter" && (y.stopPropagation(), d(t));
|
|
236
|
-
}
|
|
237
|
-
},
|
|
238
|
-
/* @__PURE__ */ e.createElement(I, { color: "red", size: 16 })
|
|
239
|
-
), c && /* @__PURE__ */ e.createElement(A, { title: c, placement: "right", arrow: !0 }, /* @__PURE__ */ e.createElement("div", { className: "ff-ms-2" }, /* @__PURE__ */ e.createElement(K, { color: "gray", size: 16 }))))), r !== "title-only" && /* @__PURE__ */ e.createElement("div", { className: "ff-mx-2 ff-mb-2 ff-p-2 ff-rounded", style: { background: "#fafafa", fontSize: 12 } }, i != null && i.renderNode ? i.renderNode(l) : z ? /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-flex-wrap ff-gap-1" }, h.map((y, T) => /* @__PURE__ */ e.createElement("span", { key: T, className: "ff-badge ff-bg-dark ff-text-white ff-py-1 ff-px-2 ff-rounded", style: { fontSize: 11 }, title: y }, y))) : /* @__PURE__ */ e.createElement("span", { className: "ff-text-muted" }, "Not configured"))), /* @__PURE__ */ e.createElement(b, { type: "source", position: x.Bottom, style: { opacity: 0 } }));
|
|
240
|
-
}, H = 5, Le = ({ id: t, data: l }) => {
|
|
241
|
-
const { onEditNode: s, onDeleteNode: d } = w(), { approvalData: a, isPreview: r = !1, _branchRail: m } = l, n = (a == null ? void 0 : a.policy) ?? {}, o = n.stages ?? [], f = o.length, g = o.slice(0, H), p = f - H, E = n.name ?? n.policyName ?? "Untitled Policy";
|
|
242
|
-
return /* @__PURE__ */ e.createElement("div", { style: { width: 350, position: "relative" } }, /* @__PURE__ */ e.createElement(b, { type: "target", position: x.Top, style: { opacity: 0 } }), /* @__PURE__ */ e.createElement("div", { style: { border: "1.5px solid #ffe082", borderRadius: 8, background: "#fff" } }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-mb-2 ff-justify-content-between ff-align-items-center ff-mx-2 ff-mt-2" }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center ff-gap-2" }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded", style: { width: 25, height: 25, background: "rgba(251,192,45,0.2)" } }, /* @__PURE__ */ e.createElement(fe, { style: { color: "#FBC02D" }, size: 16 })), /* @__PURE__ */ e.createElement("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 } }, "Approval Policy")), /* @__PURE__ */ e.createElement("div", { className: "node-actions ff-d-flex ff-align-items-center" }, !r && /* @__PURE__ */ e.createElement(
|
|
243
|
-
"div",
|
|
244
|
-
{
|
|
245
|
-
role: "button",
|
|
246
|
-
tabIndex: 0,
|
|
247
|
-
style: { cursor: "pointer" },
|
|
248
|
-
onClick: (c) => {
|
|
249
|
-
c.stopPropagation(), s(t);
|
|
250
|
-
},
|
|
251
|
-
onKeyDown: (c) => {
|
|
252
|
-
c.key === "Enter" && (c.stopPropagation(), s(t));
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
/* @__PURE__ */ e.createElement(C, { size: 16, className: "ff-text-secondary" })
|
|
256
|
-
), !r && /* @__PURE__ */ e.createElement(
|
|
257
|
-
"div",
|
|
258
|
-
{
|
|
259
|
-
className: "ff-ms-2",
|
|
260
|
-
role: "button",
|
|
261
|
-
tabIndex: 0,
|
|
262
|
-
style: { cursor: "pointer" },
|
|
263
|
-
onClick: (c) => {
|
|
264
|
-
c.stopPropagation(), d(t);
|
|
265
|
-
},
|
|
266
|
-
onKeyDown: (c) => {
|
|
267
|
-
c.key === "Enter" && (c.stopPropagation(), d(t));
|
|
268
|
-
}
|
|
269
|
-
},
|
|
270
|
-
/* @__PURE__ */ e.createElement(I, { color: "red", size: 16 })
|
|
271
|
-
), /* @__PURE__ */ e.createElement(A, { title: "This approval policy determines who must approve a request before the workflow continues.", arrow: !0, placement: "right" }, /* @__PURE__ */ e.createElement("span", { className: "ff-ms-2 ff-d-inline-flex" }, /* @__PURE__ */ e.createElement(K, { color: "gray", size: 16 }))))), /* @__PURE__ */ e.createElement("div", { className: "ff-p-2 ff-rounded ff-mx-2 ff-mb-2", style: { background: "#FCFCFC" } }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-justify-content-start ff-align-items-center ff-mb-2" }, /* @__PURE__ */ e.createElement("h6", { className: "ff-text-dark ff-mb-0 ff-text-truncate ff-flex-grow-1 ff-me-2", style: { fontSize: 13, fontWeight: 700 }, title: E }, E), /* @__PURE__ */ e.createElement("span", { className: "ff-badge ff-rounded-pill ff-px-2 ff-py-1 ff-flex-shrink-0", style: { background: "#FFF9C4", color: "#616161", fontSize: 11, fontWeight: 600 } }, f, " Stage", f !== 1 ? "s" : "")), o.length > 0 ? /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 8 } }, g.map((c, i) => {
|
|
272
|
-
var T, P, S;
|
|
273
|
-
const N = ((T = c.stageName) == null ? void 0 : T.trim()) || `Stage ${i + 1}`, u = Array.isArray(c.userIds) ? c.userIds.length : 0, k = ((P = c.groupName) == null ? void 0 : P.trim()) ?? "", h = ((S = c.roleName) == null ? void 0 : S.trim()) ?? "", z = u > 0 || k || h;
|
|
274
|
-
let y = "Not configured";
|
|
275
|
-
return k ? y = `Group: ${k}` : h ? y = `Role: ${h}` : u > 0 && (y = `${u} approver${u !== 1 ? "s" : ""}`), /* @__PURE__ */ e.createElement("div", { key: i, className: "ff-d-flex ff-align-items-center ff-gap-2" }, /* @__PURE__ */ e.createElement("div", { className: "ff-rounded-circle ff-d-flex ff-align-items-center ff-justify-content-center ff-flex-shrink-0", style: { width: 28, height: 28, background: "#FFF9C4", color: "#5D4037", fontSize: 12, fontWeight: 700 } }, i + 1), /* @__PURE__ */ e.createElement("div", { className: "ff-flex-grow-1 ff-rounded ff-p-2 ff-d-flex ff-justify-content-between ff-align-items-center ff-border", style: { background: "#FFFDE7", borderColor: "#FEE79A" } }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: 12, fontWeight: 700, color: "#212121" } }, N), /* @__PURE__ */ e.createElement("span", { className: `ff-d-flex ff-align-items-center ff-gap-1 ${z ? "ff-text-dark" : "ff-text-muted"}`, style: { fontSize: 12 } }, /* @__PURE__ */ e.createElement(ce, { size: 16, className: "ff-flex-shrink-0", style: { color: z ? "#5D4037" : "#9E9E9E" } }), y)));
|
|
276
|
-
}), p > 0 && /* @__PURE__ */ e.createElement(
|
|
277
|
-
"div",
|
|
278
|
-
{
|
|
279
|
-
className: "ff-text-center ff-fw-bold ff-py-2 ff-border ff-rounded",
|
|
280
|
-
style: { fontSize: 11, color: "#1976d2", borderColor: "#FEE79A", background: "#FFFDE7", borderStyle: "dashed", cursor: r ? "default" : "pointer" },
|
|
281
|
-
role: r ? void 0 : "button",
|
|
282
|
-
tabIndex: r ? void 0 : 0,
|
|
283
|
-
onClick: (c) => {
|
|
284
|
-
r || (c.stopPropagation(), s(t));
|
|
285
|
-
},
|
|
286
|
-
onKeyDown: (c) => {
|
|
287
|
-
r || c.key !== "Enter" || (c.stopPropagation(), s(t));
|
|
288
|
-
}
|
|
289
|
-
},
|
|
290
|
-
"+ ",
|
|
291
|
-
p,
|
|
292
|
-
" More Stage",
|
|
293
|
-
p > 1 ? "s" : ""
|
|
294
|
-
)) : /* @__PURE__ */ e.createElement("div", { className: "ff-text-center ff-py-3 ff-rounded ff-border", style: { fontSize: 12, color: "#9e9e9e", background: "#FFFDE7", borderColor: "#FEE79A", borderStyle: "dashed" } }, "No stages configured"))), /* @__PURE__ */ e.createElement(b, { type: "source", position: x.Bottom, style: { opacity: 0 } }), m && /* @__PURE__ */ e.createElement(ne, { rail: m, cardWidth: 350 }));
|
|
295
|
-
}, Fe = ({ id: t, data: l }) => {
|
|
296
|
-
const { onEditNode: s, onDeleteNode: d } = w(), { duration: a, unit: r } = l, m = a != null && r, n = m ? `Wait ${a} ${r}` : "Not configured";
|
|
297
|
-
return /* @__PURE__ */ e.createElement("div", { style: { width: 350 } }, /* @__PURE__ */ e.createElement(b, { type: "target", position: x.Top, style: { opacity: 0 } }), /* @__PURE__ */ e.createElement("div", { style: { border: "1.5px solid #b0bec5", borderRadius: 8, background: "#fff" } }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center ff-mx-2 ff-mt-2 ff-mb-1" }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center ff-gap-2" }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded", style: { width: 25, height: 25, background: "rgba(33,150,243,0.1)" } }, /* @__PURE__ */ e.createElement(de, { size: 16, color: "#1976d2" })), /* @__PURE__ */ e.createElement("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 } }, "Delay")), /* @__PURE__ */ e.createElement("div", { className: "node-actions ff-d-flex ff-align-items-center" }, /* @__PURE__ */ e.createElement(
|
|
298
|
-
"div",
|
|
299
|
-
{
|
|
300
|
-
role: "button",
|
|
301
|
-
tabIndex: 0,
|
|
302
|
-
onClick: (o) => {
|
|
303
|
-
o.stopPropagation(), s(t);
|
|
304
|
-
},
|
|
305
|
-
onKeyDown: (o) => {
|
|
306
|
-
o.key === "Enter" && (o.stopPropagation(), s(t));
|
|
307
|
-
}
|
|
308
|
-
},
|
|
309
|
-
/* @__PURE__ */ e.createElement(C, { size: 16 })
|
|
310
|
-
), /* @__PURE__ */ e.createElement(
|
|
311
|
-
"div",
|
|
312
|
-
{
|
|
313
|
-
className: "ff-ms-2",
|
|
314
|
-
role: "button",
|
|
315
|
-
tabIndex: 0,
|
|
316
|
-
onClick: (o) => {
|
|
317
|
-
o.stopPropagation(), d(t);
|
|
318
|
-
},
|
|
319
|
-
onKeyDown: (o) => {
|
|
320
|
-
o.key === "Enter" && (o.stopPropagation(), d(t));
|
|
321
|
-
}
|
|
322
|
-
},
|
|
323
|
-
/* @__PURE__ */ e.createElement(I, { color: "red", size: 16 })
|
|
324
|
-
))), /* @__PURE__ */ e.createElement("div", { className: "ff-mx-2 ff-mb-2 ff-p-2 ff-rounded", style: { background: "#fafafa", fontSize: 12 } }, /* @__PURE__ */ e.createElement("span", { className: m ? "ff-text-dark ff-fw-medium" : "ff-text-muted" }, n))), /* @__PURE__ */ e.createElement(b, { type: "source", position: x.Bottom, style: { opacity: 0 } }));
|
|
325
|
-
}, O = {
|
|
326
|
-
email: { label: "Email", bg: "#e3f2fd", color: "#1565c0", iconType: pe },
|
|
327
|
-
slack: { label: "Slack", bg: "#e8f5e9", color: "#2e7d32", iconType: $ },
|
|
328
|
-
teams: { label: "MS Teams", bg: "#ede7f6", color: "#4527a0", iconType: $ },
|
|
329
|
-
sms: { label: "SMS", bg: "#fce4ec", color: "#880e4f", iconType: me },
|
|
330
|
-
"in-app": { label: "In-App", bg: "#fff3e0", color: "#e65100", iconType: $ },
|
|
331
|
-
webhook: { label: "Webhook", bg: "#f3e5f5", color: "#6a1b9a", iconType: te }
|
|
332
|
-
}, We = {
|
|
333
|
-
label: "Notification",
|
|
334
|
-
bg: "rgba(156,39,176,0.1)",
|
|
335
|
-
color: "#7b1fa2",
|
|
336
|
-
iconType: $
|
|
337
|
-
};
|
|
338
|
-
function Re(t) {
|
|
339
|
-
var l;
|
|
340
|
-
switch (t.channel) {
|
|
341
|
-
case "email":
|
|
342
|
-
return ((l = t.emailTo) == null ? void 0 : l.join(", ")) ?? t.recipient ?? null;
|
|
343
|
-
case "slack":
|
|
344
|
-
return t.slackChannel ?? null;
|
|
345
|
-
case "teams":
|
|
346
|
-
return t.teamsMessage ? "Message configured" : null;
|
|
347
|
-
case "sms":
|
|
348
|
-
return t.smsTo ?? null;
|
|
349
|
-
case "in-app":
|
|
350
|
-
return t.inAppRecipient ?? null;
|
|
351
|
-
case "webhook":
|
|
352
|
-
return t.webhookUrl ?? null;
|
|
353
|
-
default:
|
|
354
|
-
return t.recipient ?? null;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
function $e(t) {
|
|
358
|
-
switch (t.channel) {
|
|
359
|
-
case "email":
|
|
360
|
-
return t.emailSubject ?? t.subject ?? null;
|
|
361
|
-
case "slack": {
|
|
362
|
-
const l = t.slackMessage;
|
|
363
|
-
return l ? l.length > 60 ? `${l.slice(0, 60)}…` : l : null;
|
|
364
|
-
}
|
|
365
|
-
case "in-app":
|
|
366
|
-
return t.inAppTitle ?? null;
|
|
367
|
-
default:
|
|
368
|
-
return t.subject ?? null;
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
const Be = ({ id: t, data: l }) => {
|
|
372
|
-
const { onEditNode: s, onDeleteNode: d } = w(), a = l, r = a.channel && O[a.channel] ? O[a.channel] : We, m = Re(a), n = $e(a), o = !!(a.channel && m), f = r.iconType;
|
|
373
|
-
return /* @__PURE__ */ e.createElement("div", { style: { width: L } }, /* @__PURE__ */ e.createElement(b, { type: "target", position: x.Top, style: { opacity: 0 } }), /* @__PURE__ */ e.createElement("div", { style: { border: "1.5px solid #b0bec5", borderRadius: 8, background: "#fff" } }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center ff-mx-2 ff-mt-2 ff-mb-1" }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center ff-gap-2" }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded", style: { width: 25, height: 25, background: r.bg } }, /* @__PURE__ */ e.createElement(f, { size: 16, color: r.color })), /* @__PURE__ */ e.createElement("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 } }, a.channel ? `${r.label} Notification` : "Notification")), /* @__PURE__ */ e.createElement("div", { className: "node-actions ff-d-flex ff-align-items-center" }, /* @__PURE__ */ e.createElement(
|
|
374
|
-
"div",
|
|
375
|
-
{
|
|
376
|
-
role: "button",
|
|
377
|
-
tabIndex: 0,
|
|
378
|
-
onClick: (g) => {
|
|
379
|
-
g.stopPropagation(), s(t);
|
|
380
|
-
},
|
|
381
|
-
onKeyDown: (g) => {
|
|
382
|
-
(g.key === "Enter" || g.key === " ") && (g.stopPropagation(), s(t));
|
|
383
|
-
}
|
|
384
|
-
},
|
|
385
|
-
/* @__PURE__ */ e.createElement(C, { size: 16 })
|
|
386
|
-
), /* @__PURE__ */ e.createElement(
|
|
387
|
-
"div",
|
|
388
|
-
{
|
|
389
|
-
className: "ff-ms-2",
|
|
390
|
-
role: "button",
|
|
391
|
-
tabIndex: 0,
|
|
392
|
-
onClick: (g) => {
|
|
393
|
-
g.stopPropagation(), d(t);
|
|
394
|
-
},
|
|
395
|
-
onKeyDown: (g) => {
|
|
396
|
-
(g.key === "Enter" || g.key === " ") && (g.stopPropagation(), d(t));
|
|
397
|
-
}
|
|
398
|
-
},
|
|
399
|
-
/* @__PURE__ */ e.createElement(I, { color: "red", size: 16 })
|
|
400
|
-
))), /* @__PURE__ */ e.createElement("div", { className: "ff-mx-2 ff-mb-2 ff-p-2 ff-rounded", style: { background: "#fafafa", fontSize: 12 } }, o ? /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-flex-column ff-gap-1" }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center ff-gap-2" }, /* @__PURE__ */ e.createElement("span", { className: "ff-px-2 ff-py-1 ff-rounded", style: { fontSize: 10, background: r.bg, color: r.color, fontWeight: 600, flexShrink: 0 } }, r.label), /* @__PURE__ */ e.createElement("span", { className: "ff-text-dark ff-text-truncate", style: { maxWidth: 220 } }, m)), n && /* @__PURE__ */ e.createElement("span", { className: "ff-text-muted ff-text-truncate", style: { maxWidth: 280 } }, n)) : /* @__PURE__ */ e.createElement("span", { className: "ff-text-muted" }, "Not configured"))), /* @__PURE__ */ e.createElement(b, { type: "source", position: x.Bottom, style: { opacity: 0 } }));
|
|
401
|
-
}, U = {
|
|
402
|
-
"api-key": "API Key",
|
|
403
|
-
hmac: "HMAC"
|
|
404
|
-
}, Me = ({ data: t }) => {
|
|
405
|
-
const { onClickAddTrigger: l } = w(), { label: s = "Webhook Trigger", endpointUrl: d, authMethod: a, source: r } = t, m = (o) => {
|
|
406
|
-
o.stopPropagation(), l();
|
|
407
|
-
}, n = (o) => {
|
|
408
|
-
o.stopPropagation(), d && navigator.clipboard.writeText(d).catch(() => {
|
|
409
|
-
});
|
|
410
|
-
};
|
|
411
|
-
return /* @__PURE__ */ e.createElement("div", { style: { width: L } }, /* @__PURE__ */ e.createElement(b, { type: "target", position: x.Top, style: { opacity: 0 } }), /* @__PURE__ */ e.createElement("div", { style: { border: "1.5px solid #90caf9", borderRadius: 8, background: "#fff", overflow: "hidden" } }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center ff-mx-2 ff-mt-2 ff-mb-2" }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center ff-gap-2" }, /* @__PURE__ */ e.createElement("div", { style: { width: 28, height: 28, borderRadius: 6, background: "rgba(33,150,243,0.1)", display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 } }, /* @__PURE__ */ e.createElement(te, { size: 16, color: "#1565c0" })), /* @__PURE__ */ e.createElement("span", { style: { fontSize: 13, fontWeight: 600, color: "#212121" } }, "Webhook Trigger")), /* @__PURE__ */ e.createElement(
|
|
412
|
-
"div",
|
|
413
|
-
{
|
|
414
|
-
role: "button",
|
|
415
|
-
tabIndex: 0,
|
|
416
|
-
onClick: m,
|
|
417
|
-
onKeyDown: (o) => {
|
|
418
|
-
(o.key === "Enter" || o.key === " ") && m(o);
|
|
419
|
-
},
|
|
420
|
-
className: "ff-d-flex ff-align-items-center",
|
|
421
|
-
style: { paddingRight: 4, cursor: "pointer" }
|
|
422
|
-
},
|
|
423
|
-
/* @__PURE__ */ e.createElement(C, { size: 16, color: "#555" })
|
|
424
|
-
)), /* @__PURE__ */ e.createElement("div", { className: "ff-mx-2 ff-mb-2 ff-p-2 ff-rounded", style: { background: "#e3f2fd", border: "1px solid #90caf9" } }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center ff-flex-wrap ff-gap-2 ff-mb-1" }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: 12, color: "#1565c0", fontWeight: 600 } }, s), r && /* @__PURE__ */ e.createElement("span", { className: "ff-px-2 ff-py-1 ff-rounded", style: { fontSize: 11, background: "#fff", border: "1px solid #90caf9", color: "#1565c0" } }, r), a && a !== "none" && U[a] && /* @__PURE__ */ e.createElement("span", { className: "ff-px-2 ff-py-1 ff-rounded", style: { fontSize: 10, background: "#1565c0", color: "#fff", fontWeight: 600 } }, U[a])), d && /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center ff-gap-1", style: { marginTop: 4 } }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: 10, color: "#1565c0", fontFamily: "monospace", flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, d), /* @__PURE__ */ e.createElement(A, { title: "Copy URL", placement: "top", arrow: !0 }, /* @__PURE__ */ e.createElement(
|
|
425
|
-
"div",
|
|
426
|
-
{
|
|
427
|
-
role: "button",
|
|
428
|
-
tabIndex: 0,
|
|
429
|
-
onClick: n,
|
|
430
|
-
onKeyDown: (o) => {
|
|
431
|
-
(o.key === "Enter" || o.key === " ") && n(o);
|
|
432
|
-
},
|
|
433
|
-
style: { cursor: "pointer", flexShrink: 0 }
|
|
434
|
-
},
|
|
435
|
-
/* @__PURE__ */ e.createElement(ge, { size: 12, color: "#1565c0" })
|
|
436
|
-
))))), /* @__PURE__ */ e.createElement(b, { type: "source", position: x.Bottom, style: { opacity: 0 } }));
|
|
437
|
-
}, Ke = ({ id: t, data: l }) => {
|
|
438
|
-
var E;
|
|
439
|
-
const { onEditNode: s, onDeleteNode: d, nodeRegistry: a } = w(), { method: r, url: m, descriptorType: n } = l, o = n ? (E = a == null ? void 0 : a.forType(n)) == null ? void 0 : E.icon : /* @__PURE__ */ e.createElement(ye, { size: 16, color: "#546e7a" }), f = !!(r && m), g = (r == null ? void 0 : r.toUpperCase()) ?? "", p = ke[g] ?? null;
|
|
440
|
-
return /* @__PURE__ */ e.createElement("div", { style: { width: L } }, /* @__PURE__ */ e.createElement(b, { type: "target", position: x.Top, style: { opacity: 0 } }), /* @__PURE__ */ e.createElement("div", { style: { border: "1.5px solid #b0bec5", borderRadius: 8, background: "#fff" } }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center ff-mx-2 ff-mt-2 ff-mb-1" }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center ff-gap-2" }, /* @__PURE__ */ e.createElement("div", { style: { width: 25, height: 25, display: "flex", alignItems: "center", justifyContent: "center" } }, o), /* @__PURE__ */ e.createElement("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 } }, "REST API Call")), /* @__PURE__ */ e.createElement("div", { className: "node-actions ff-d-flex ff-align-items-center" }, /* @__PURE__ */ e.createElement(
|
|
441
|
-
"div",
|
|
442
|
-
{
|
|
443
|
-
role: "button",
|
|
444
|
-
tabIndex: 0,
|
|
445
|
-
onClick: (c) => {
|
|
446
|
-
c.stopPropagation(), s(t);
|
|
447
|
-
},
|
|
448
|
-
onKeyDown: (c) => {
|
|
449
|
-
(c.key === "Enter" || c.key === " ") && (c.stopPropagation(), s(t));
|
|
450
|
-
}
|
|
451
|
-
},
|
|
452
|
-
/* @__PURE__ */ e.createElement(C, { size: 16 })
|
|
453
|
-
), /* @__PURE__ */ e.createElement(
|
|
454
|
-
"div",
|
|
455
|
-
{
|
|
456
|
-
className: "ff-ms-2",
|
|
457
|
-
role: "button",
|
|
458
|
-
tabIndex: 0,
|
|
459
|
-
onClick: (c) => {
|
|
460
|
-
c.stopPropagation(), d(t);
|
|
461
|
-
},
|
|
462
|
-
onKeyDown: (c) => {
|
|
463
|
-
(c.key === "Enter" || c.key === " ") && (c.stopPropagation(), d(t));
|
|
464
|
-
}
|
|
465
|
-
},
|
|
466
|
-
/* @__PURE__ */ e.createElement(I, { color: "red", size: 16 })
|
|
467
|
-
))), /* @__PURE__ */ e.createElement("div", { className: "ff-mx-2 ff-mb-2 ff-p-2 ff-rounded", style: { background: "#fafafa", fontSize: 12 } }, f ? /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center ff-gap-2" }, p && /* @__PURE__ */ e.createElement("span", { style: { fontSize: 10, fontWeight: 700, padding: "2px 6px", borderRadius: 4, background: p.bg, color: p.color, flexShrink: 0 } }, g), /* @__PURE__ */ e.createElement("span", { className: "ff-text-dark ff-text-truncate", style: { fontFamily: "monospace", fontSize: 11 }, title: m }, m)) : /* @__PURE__ */ e.createElement("span", { className: "ff-text-muted" }, "Not configured"))), /* @__PURE__ */ e.createElement(b, { type: "source", position: x.Bottom, style: { opacity: 0 } }));
|
|
468
|
-
}, je = {
|
|
469
|
-
eq: "=",
|
|
470
|
-
neq: "≠",
|
|
471
|
-
gt: ">",
|
|
472
|
-
gte: "≥",
|
|
473
|
-
lt: "<",
|
|
474
|
-
lte: "≤",
|
|
475
|
-
contains: "contains",
|
|
476
|
-
startsWith: "starts with",
|
|
477
|
-
endsWith: "ends with",
|
|
478
|
-
isEmpty: "is empty",
|
|
479
|
-
isNotEmpty: "is not empty"
|
|
480
|
-
}, _e = ({ id: t, data: l }) => {
|
|
481
|
-
const { onEditNode: s, onDeleteNode: d } = w(), { title: a = "Condition Branch", branchConfigs: r = [], defaultBranch: m } = l, n = r.length > 0;
|
|
482
|
-
return /* @__PURE__ */ e.createElement("div", { style: { width: L } }, /* @__PURE__ */ e.createElement(b, { type: "target", position: x.Top, style: { opacity: 0 } }), /* @__PURE__ */ e.createElement("div", { style: { border: "1.5px solid #b39ddb", borderRadius: 8, background: "#fff" } }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center ff-mx-2 ff-mt-2 ff-mb-1" }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center ff-gap-2" }, /* @__PURE__ */ e.createElement("div", { style: { width: 25, height: 25, borderRadius: 6, background: "rgba(103,58,183,0.1)", display: "flex", alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ e.createElement(ue, { size: 16, color: "#512da8" })), /* @__PURE__ */ e.createElement("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 } }, a)), /* @__PURE__ */ e.createElement("div", { className: "node-actions ff-d-flex ff-align-items-center" }, /* @__PURE__ */ e.createElement(
|
|
483
|
-
"div",
|
|
484
|
-
{
|
|
485
|
-
role: "button",
|
|
486
|
-
tabIndex: 0,
|
|
487
|
-
onClick: (o) => {
|
|
488
|
-
o.stopPropagation(), s(t);
|
|
489
|
-
},
|
|
490
|
-
onKeyDown: (o) => {
|
|
491
|
-
(o.key === "Enter" || o.key === " ") && (o.stopPropagation(), s(t));
|
|
492
|
-
}
|
|
493
|
-
},
|
|
494
|
-
/* @__PURE__ */ e.createElement(C, { size: 16 })
|
|
495
|
-
), /* @__PURE__ */ e.createElement(
|
|
496
|
-
"div",
|
|
497
|
-
{
|
|
498
|
-
className: "ff-ms-2",
|
|
499
|
-
role: "button",
|
|
500
|
-
tabIndex: 0,
|
|
501
|
-
onClick: (o) => {
|
|
502
|
-
o.stopPropagation(), d(t);
|
|
503
|
-
},
|
|
504
|
-
onKeyDown: (o) => {
|
|
505
|
-
(o.key === "Enter" || o.key === " ") && (o.stopPropagation(), d(t));
|
|
506
|
-
}
|
|
507
|
-
},
|
|
508
|
-
/* @__PURE__ */ e.createElement(I, { color: "red", size: 16 })
|
|
509
|
-
))), /* @__PURE__ */ e.createElement("div", { className: "ff-mx-2 ff-mb-2 ff-p-2 ff-rounded", style: { background: "#fafafa", fontSize: 12 } }, n ? /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 4 } }, r.map((o, f) => {
|
|
510
|
-
var c, i;
|
|
511
|
-
const g = _[f % _.length], p = (c = o.conditions) == null ? void 0 : c[0], E = (((i = o.conditions) == null ? void 0 : i.length) ?? 0) - 1;
|
|
512
|
-
return /* @__PURE__ */ e.createElement("div", { key: o.key, style: { display: "flex", alignItems: "center", gap: 6 } }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: 10, fontWeight: 600, padding: "2px 7px", borderRadius: 10, background: g.bg, color: g.color, flexShrink: 0 } }, o.label || o.key), p ? /* @__PURE__ */ e.createElement("span", { style: { fontSize: 11, color: "#616161", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, p.field, " ", je[p.operator] ?? p.operator, p.value ? ` ${p.value}` : "", E > 0 ? ` +${E} more` : "") : /* @__PURE__ */ e.createElement("span", { style: { fontSize: 11, color: "#9e9e9e" } }, "No conditions yet"));
|
|
513
|
-
}), m && /* @__PURE__ */ e.createElement("div", { style: { display: "flex", alignItems: "center", gap: 6, marginTop: 2 } }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: 10, fontWeight: 600, padding: "2px 7px", borderRadius: 10, background: "#f5f5f5", color: "#757575", flexShrink: 0 } }, "Default"), /* @__PURE__ */ e.createElement("span", { style: { fontSize: 11, color: "#9e9e9e" } }, "fallback path"))) : /* @__PURE__ */ e.createElement("span", { className: "ff-text-muted" }, "Not configured — click edit to add branches"))), /* @__PURE__ */ e.createElement(b, { type: "source", position: x.Bottom, style: { opacity: 0 } }));
|
|
514
|
-
}, He = ({ id: t, data: l }) => {
|
|
515
|
-
var c;
|
|
516
|
-
const { onEditNode: s, onDeleteNode: d, nodeRegistry: a } = w(), { title: r = "Sub-Workflow", workflowId: m, workflowLabel: n, descriptorType: o, onPreview: f } = l, g = o ? (c = a == null ? void 0 : a.forType(o)) == null ? void 0 : c.icon : /* @__PURE__ */ e.createElement(Ee, { size: 16, color: "#00695c" }), p = !!m, E = (i) => {
|
|
517
|
-
i.stopPropagation(), m && f && f(m);
|
|
518
|
-
};
|
|
519
|
-
return /* @__PURE__ */ e.createElement("div", { style: { width: L } }, /* @__PURE__ */ e.createElement(b, { type: "target", position: x.Top, style: { opacity: 0 } }), /* @__PURE__ */ e.createElement("div", { style: { border: "1.5px solid #80cbc4", borderRadius: 8, background: "#fff" } }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center ff-mx-2 ff-mt-2 ff-mb-1" }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center ff-gap-2" }, /* @__PURE__ */ e.createElement("div", { style: { width: 25, height: 25, borderRadius: 6, background: "rgba(0,137,123,0.1)", display: "flex", alignItems: "center", justifyContent: "center" } }, g), /* @__PURE__ */ e.createElement("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 } }, r)), /* @__PURE__ */ e.createElement("div", { className: "node-actions ff-d-flex ff-align-items-center" }, /* @__PURE__ */ e.createElement(
|
|
520
|
-
"div",
|
|
521
|
-
{
|
|
522
|
-
role: "button",
|
|
523
|
-
tabIndex: 0,
|
|
524
|
-
onClick: (i) => {
|
|
525
|
-
i.stopPropagation(), s(t);
|
|
526
|
-
},
|
|
527
|
-
onKeyDown: (i) => {
|
|
528
|
-
(i.key === "Enter" || i.key === " ") && (i.stopPropagation(), s(t));
|
|
529
|
-
}
|
|
530
|
-
},
|
|
531
|
-
/* @__PURE__ */ e.createElement(C, { size: 16 })
|
|
532
|
-
), /* @__PURE__ */ e.createElement(
|
|
533
|
-
"div",
|
|
534
|
-
{
|
|
535
|
-
className: "ff-ms-2",
|
|
536
|
-
role: "button",
|
|
537
|
-
tabIndex: 0,
|
|
538
|
-
onClick: (i) => {
|
|
539
|
-
i.stopPropagation(), d(t);
|
|
540
|
-
},
|
|
541
|
-
onKeyDown: (i) => {
|
|
542
|
-
(i.key === "Enter" || i.key === " ") && (i.stopPropagation(), d(t));
|
|
543
|
-
}
|
|
544
|
-
},
|
|
545
|
-
/* @__PURE__ */ e.createElement(I, { color: "red", size: 16 })
|
|
546
|
-
))), /* @__PURE__ */ e.createElement("div", { className: "ff-mx-2 ff-mb-2 ff-p-2 ff-rounded", style: { background: p ? "#e0f2f1" : "#fafafa", fontSize: 12, border: p ? "1px solid #b2dfdb" : "none" } }, p ? /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-align-items-center ff-justify-content-between" }, /* @__PURE__ */ e.createElement("div", { className: "ff-d-flex ff-flex-column ff-gap-1" }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: 12, fontWeight: 600, color: "#00695c" } }, n || m), /* @__PURE__ */ e.createElement("span", { style: { fontSize: 10, color: "#80cbc4", fontFamily: "monospace" } }, "ID: ", m)), f && /* @__PURE__ */ e.createElement(
|
|
547
|
-
"div",
|
|
548
|
-
{
|
|
549
|
-
role: "button",
|
|
550
|
-
tabIndex: 0,
|
|
551
|
-
onClick: E,
|
|
552
|
-
onKeyDown: (i) => {
|
|
553
|
-
(i.key === "Enter" || i.key === " ") && E(i);
|
|
554
|
-
},
|
|
555
|
-
style: { cursor: "pointer", display: "flex", alignItems: "center", gap: 3, fontSize: 11, color: "#00897b" }
|
|
556
|
-
},
|
|
557
|
-
/* @__PURE__ */ e.createElement(be, { size: 13 }),
|
|
558
|
-
"Preview"
|
|
559
|
-
)) : /* @__PURE__ */ e.createElement("span", { className: "ff-text-muted" }, "Not configured — select a workflow"))), /* @__PURE__ */ e.createElement(b, { type: "source", position: x.Bottom, style: { opacity: 0 } }));
|
|
560
|
-
}, ot = {
|
|
561
|
-
startNode: we,
|
|
562
|
-
endNode: Se,
|
|
563
|
-
addTriggerNode: Ce,
|
|
564
|
-
addStepNode: Te,
|
|
565
|
-
triggerNode: Pe,
|
|
566
|
-
filterNode: De,
|
|
567
|
-
actionNode: Ae,
|
|
568
|
-
approvalNode: Le,
|
|
569
|
-
delayNode: Fe,
|
|
570
|
-
notificationNode: Be,
|
|
571
|
-
webhookTriggerNode: Me,
|
|
572
|
-
restApiNode: Ke,
|
|
573
|
-
conditionBranchNode: _e,
|
|
574
|
-
subWorkflowNode: He
|
|
575
|
-
}, Oe = 11.5, G = 2, F = 6, V = 40, q = 20, Z = 4, lt = ({
|
|
576
|
-
id: t,
|
|
577
|
-
sourceX: l,
|
|
578
|
-
sourceY: s,
|
|
579
|
-
targetX: d,
|
|
580
|
-
targetY: a,
|
|
581
|
-
sourcePosition: r,
|
|
582
|
-
targetPosition: m,
|
|
583
|
-
source: n,
|
|
584
|
-
target: o,
|
|
585
|
-
data: f
|
|
586
|
-
}) => {
|
|
587
|
-
const [g, p, E] = B({
|
|
588
|
-
sourceX: l,
|
|
589
|
-
sourceY: s,
|
|
590
|
-
targetX: d,
|
|
591
|
-
targetY: a
|
|
592
|
-
}), c = f == null ? void 0 : f.label, i = c === "Pass", N = i || c === "Fail", u = l + (d - l) / 3, k = s + (a - s) / 3, h = l + 2 * (d - l) / 3, z = s + 2 * (a - s) / 3, y = f == null ? void 0 : f.onAddStepClick, T = (D) => {
|
|
593
|
-
if (D.stopPropagation(), typeof y != "function") return;
|
|
594
|
-
const oe = {
|
|
595
|
-
edgeId: t,
|
|
596
|
-
nodeId: n,
|
|
597
|
-
sourceNodeId: n,
|
|
598
|
-
targetNodeId: o,
|
|
599
|
-
position: "between",
|
|
600
|
-
referenceNodeId: n,
|
|
601
|
-
referenceNodeType: f == null ? void 0 : f.referenceNodeType,
|
|
602
|
-
stepVisibility: f == null ? void 0 : f.stepVisibility
|
|
603
|
-
};
|
|
604
|
-
y(n, oe);
|
|
605
|
-
}, P = (D) => {
|
|
606
|
-
(D.key === "Enter" || D.key === " ") && (D.preventDefault(), T(D));
|
|
607
|
-
}, S = () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("g", { className: "plus-icon-container" }, /* @__PURE__ */ e.createElement("circle", { r: Oe, className: "edge-plus-circle" }), /* @__PURE__ */ e.createElement("line", { x1: 0, y1: -F, x2: 0, y2: F, strokeWidth: G, strokeLinecap: "round", className: "plus-line" }), /* @__PURE__ */ e.createElement("line", { x1: -F, y1: 0, x2: F, y2: 0, strokeWidth: G, strokeLinecap: "round", className: "plus-line" })), /* @__PURE__ */ e.createElement("g", { className: "edge-plus-tooltip", transform: "translate(18, 0)" }, /* @__PURE__ */ e.createElement("rect", { x: 0, y: -10, width: 65, height: 20, rx: 4, className: "tooltip-bg" }), /* @__PURE__ */ e.createElement("path", { d: "M0 -4 L-4 0 L0 4 Z", className: "tooltip-bg" }), /* @__PURE__ */ e.createElement("text", { x: 32, y: 0, textAnchor: "middle", dominantBaseline: "central", fill: "white", style: { fontSize: 10, fontWeight: 600, pointerEvents: "none" } }, "Add Step"))), v = y ? {
|
|
608
|
-
onClick: T,
|
|
609
|
-
onKeyDown: P,
|
|
610
|
-
role: "button",
|
|
611
|
-
tabIndex: 0,
|
|
612
|
-
style: { cursor: "pointer", pointerEvents: "all" }
|
|
613
|
-
} : {
|
|
614
|
-
style: { cursor: "default", pointerEvents: "all" }
|
|
615
|
-
};
|
|
616
|
-
return /* @__PURE__ */ e.createElement("g", { className: "edge-with-plus-wrapper" }, /* @__PURE__ */ e.createElement(M, { id: t, path: g }), N ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("g", { transform: `translate(${u}, ${k})` }, /* @__PURE__ */ e.createElement("rect", { x: -V / 2, y: -q / 2, width: V, height: q, rx: Z, ry: Z, fill: i ? "#ADE6C5" : "#FDBFBF" }), /* @__PURE__ */ e.createElement("text", { textAnchor: "middle", dominantBaseline: "central", fill: i ? "#1DBF60" : "#C50000", style: { fontSize: 12, fontWeight: 500 } }, c)), /* @__PURE__ */ e.createElement("g", { className: "nodrag nopan edge-plus-svg", transform: `translate(${h}, ${z})`, "data-testid": "plus-node-icon", ...v }, /* @__PURE__ */ e.createElement(S, null))) : /* @__PURE__ */ e.createElement("g", { className: "nodrag nopan edge-plus-svg", transform: `translate(${p}, ${E})`, "data-testid": "plus-node-icon", ...v }, /* @__PURE__ */ e.createElement(S, null)));
|
|
617
|
-
}, Ue = 11.5, Y = 2, W = 6, rt = ({
|
|
618
|
-
id: t,
|
|
619
|
-
sourceX: l,
|
|
620
|
-
sourceY: s,
|
|
621
|
-
targetX: d,
|
|
622
|
-
targetY: a,
|
|
623
|
-
source: r,
|
|
624
|
-
target: m,
|
|
625
|
-
data: n
|
|
626
|
-
}) => {
|
|
627
|
-
const [o, f, g] = B({
|
|
628
|
-
sourceX: l,
|
|
629
|
-
sourceY: s,
|
|
630
|
-
targetX: d,
|
|
631
|
-
targetY: a
|
|
632
|
-
}), p = n == null ? void 0 : n.onAddStepClick, E = (i) => {
|
|
633
|
-
i.stopPropagation(), typeof p == "function" && p(r, {
|
|
634
|
-
edgeId: t,
|
|
635
|
-
nodeId: r,
|
|
636
|
-
sourceNodeId: r,
|
|
637
|
-
targetNodeId: m,
|
|
638
|
-
position: "between",
|
|
639
|
-
referenceNodeId: r,
|
|
640
|
-
referenceNodeType: n == null ? void 0 : n.referenceNodeType,
|
|
641
|
-
stepVisibility: n == null ? void 0 : n.stepVisibility,
|
|
642
|
-
filterId: n == null ? void 0 : n.filterId,
|
|
643
|
-
branch: n == null ? void 0 : n.branch
|
|
644
|
-
});
|
|
645
|
-
}, c = (i) => {
|
|
646
|
-
(i.key === "Enter" || i.key === " ") && (i.preventDefault(), E(i));
|
|
647
|
-
};
|
|
648
|
-
return /* @__PURE__ */ e.createElement("g", { className: "edge-with-plus-wrapper" }, /* @__PURE__ */ e.createElement(M, { id: t, path: o, style: { stroke: "#b0bec5" } }), /* @__PURE__ */ e.createElement(
|
|
649
|
-
"g",
|
|
650
|
-
{
|
|
651
|
-
className: "nodrag nopan edge-plus-svg",
|
|
652
|
-
transform: `translate(${f}, ${g})`,
|
|
653
|
-
style: {
|
|
654
|
-
cursor: p ? "pointer" : "default",
|
|
655
|
-
pointerEvents: "all",
|
|
656
|
-
outline: "none"
|
|
657
|
-
},
|
|
658
|
-
onClick: p ? E : void 0,
|
|
659
|
-
onKeyDown: p ? c : void 0,
|
|
660
|
-
role: p ? "button" : void 0,
|
|
661
|
-
tabIndex: p ? 0 : void 0,
|
|
662
|
-
"data-testid": "plus-node-icon"
|
|
663
|
-
},
|
|
664
|
-
/* @__PURE__ */ e.createElement("circle", { r: Ue, className: "edge-plus-circle" }),
|
|
665
|
-
/* @__PURE__ */ e.createElement(
|
|
666
|
-
"line",
|
|
667
|
-
{
|
|
668
|
-
x1: 0,
|
|
669
|
-
y1: -W,
|
|
670
|
-
x2: 0,
|
|
671
|
-
y2: W,
|
|
672
|
-
strokeWidth: Y,
|
|
673
|
-
strokeLinecap: "round",
|
|
674
|
-
className: "plus-line"
|
|
675
|
-
}
|
|
676
|
-
),
|
|
677
|
-
/* @__PURE__ */ e.createElement(
|
|
678
|
-
"line",
|
|
679
|
-
{
|
|
680
|
-
x1: -W,
|
|
681
|
-
y1: 0,
|
|
682
|
-
x2: W,
|
|
683
|
-
y2: 0,
|
|
684
|
-
strokeWidth: Y,
|
|
685
|
-
strokeLinecap: "round",
|
|
686
|
-
className: "plus-line"
|
|
687
|
-
}
|
|
688
|
-
),
|
|
689
|
-
/* @__PURE__ */ e.createElement("g", { className: "edge-plus-tooltip", transform: "translate(18, 0)" }, /* @__PURE__ */ e.createElement(
|
|
690
|
-
"rect",
|
|
691
|
-
{
|
|
692
|
-
x: 0,
|
|
693
|
-
y: -10,
|
|
694
|
-
width: 65,
|
|
695
|
-
height: 20,
|
|
696
|
-
rx: 4,
|
|
697
|
-
className: "tooltip-bg"
|
|
698
|
-
}
|
|
699
|
-
), /* @__PURE__ */ e.createElement("path", { d: "M0 -4 L-4 0 L0 4 Z", className: "tooltip-bg" }), /* @__PURE__ */ e.createElement(
|
|
700
|
-
"text",
|
|
701
|
-
{
|
|
702
|
-
x: 32,
|
|
703
|
-
y: 0,
|
|
704
|
-
textAnchor: "middle",
|
|
705
|
-
dominantBaseline: "central",
|
|
706
|
-
fill: "white",
|
|
707
|
-
style: { fontSize: 10, fontWeight: 600, pointerEvents: "none" }
|
|
708
|
-
},
|
|
709
|
-
"Add Step"
|
|
710
|
-
))
|
|
711
|
-
));
|
|
712
|
-
}, at = ({ id: t, sourceX: l, sourceY: s, targetX: d, targetY: a }) => {
|
|
713
|
-
const [r] = B({ sourceX: l, sourceY: s, targetX: d, targetY: a });
|
|
714
|
-
return /* @__PURE__ */ e.createElement(M, { id: t, path: r, style: { stroke: "#b0bec5" } });
|
|
715
|
-
}, Ge = 11.5, J = 2, R = 6, Ve = -24, Q = 40, X = 20, ee = 4, st = ({
|
|
716
|
-
id: t,
|
|
717
|
-
sourceX: l,
|
|
718
|
-
sourceY: s,
|
|
719
|
-
targetX: d,
|
|
720
|
-
targetY: a,
|
|
721
|
-
source: r,
|
|
722
|
-
target: m,
|
|
723
|
-
data: n
|
|
724
|
-
}) => {
|
|
725
|
-
const [o, f, g] = B({ sourceX: l, sourceY: s, targetX: d, targetY: a }), p = n == null ? void 0 : n.label, E = p === "Pass", c = E || p === "Fail", i = n == null ? void 0 : n.onAddStepClick, N = (n == null ? void 0 : n.showPlus) !== !1 && !!i, u = (h) => {
|
|
726
|
-
h.stopPropagation(), typeof i == "function" && i(r, {
|
|
727
|
-
edgeId: t,
|
|
728
|
-
nodeId: r,
|
|
729
|
-
sourceNodeId: r,
|
|
730
|
-
targetNodeId: m,
|
|
731
|
-
position: "between",
|
|
732
|
-
referenceNodeId: r,
|
|
733
|
-
referenceNodeType: n == null ? void 0 : n.referenceNodeType,
|
|
734
|
-
stepVisibility: n == null ? void 0 : n.stepVisibility
|
|
735
|
-
});
|
|
736
|
-
}, k = (h) => {
|
|
737
|
-
(h.key === "Enter" || h.key === " ") && (h.preventDefault(), u(h));
|
|
738
|
-
};
|
|
739
|
-
return /* @__PURE__ */ e.createElement("g", { className: "edge-with-plus-wrapper" }, /* @__PURE__ */ e.createElement(M, { id: t, path: o, style: { stroke: "#b0bec5" } }), /* @__PURE__ */ e.createElement(
|
|
740
|
-
"g",
|
|
741
|
-
{
|
|
742
|
-
className: "nodrag nopan edge-plus-svg",
|
|
743
|
-
transform: `translate(${f}, ${g})`,
|
|
744
|
-
style: { cursor: i ? "pointer" : "default", pointerEvents: "all", outline: "none" },
|
|
745
|
-
onClick: i ? u : void 0,
|
|
746
|
-
onKeyDown: i ? k : void 0,
|
|
747
|
-
role: i ? "button" : void 0,
|
|
748
|
-
tabIndex: i ? 0 : void 0
|
|
749
|
-
},
|
|
750
|
-
c && /* @__PURE__ */ e.createElement("g", { transform: `translate(0, ${N ? Ve : 0})` }, /* @__PURE__ */ e.createElement(
|
|
751
|
-
"rect",
|
|
752
|
-
{
|
|
753
|
-
x: -Q / 2,
|
|
754
|
-
y: -X / 2,
|
|
755
|
-
width: Q,
|
|
756
|
-
height: X,
|
|
757
|
-
rx: ee,
|
|
758
|
-
ry: ee,
|
|
759
|
-
fill: E ? "#ADE6C5" : "#FDBFBF"
|
|
760
|
-
}
|
|
761
|
-
), /* @__PURE__ */ e.createElement("text", { textAnchor: "middle", dominantBaseline: "central", fill: E ? "#1DBF60" : "#C50000", style: { fontSize: 12, fontWeight: 500 } }, p)),
|
|
762
|
-
N && /* @__PURE__ */ e.createElement("g", { className: "plus-icon-container" }, /* @__PURE__ */ e.createElement("circle", { r: Ge, className: "edge-plus-circle" }), /* @__PURE__ */ e.createElement("line", { x1: 0, y1: -R, x2: 0, y2: R, strokeWidth: J, strokeLinecap: "round", className: "plus-line" }), /* @__PURE__ */ e.createElement("line", { x1: -R, y1: 0, x2: R, y2: 0, strokeWidth: J, strokeLinecap: "round", className: "plus-line" })),
|
|
763
|
-
N && /* @__PURE__ */ e.createElement("g", { className: "edge-plus-tooltip", transform: "translate(22, 0)" }, /* @__PURE__ */ e.createElement("rect", { x: 0, y: -10, width: 65, height: 20, rx: 4, className: "tooltip-bg" }), /* @__PURE__ */ e.createElement("path", { d: "M0 -4 L-4 0 L0 4 Z", className: "tooltip-bg" }), /* @__PURE__ */ e.createElement("text", { x: 32, y: 0, textAnchor: "middle", dominantBaseline: "central", fill: "white", style: { fontSize: 10, fontWeight: 600, pointerEvents: "none" } }, "Add Step"))
|
|
764
|
-
));
|
|
765
|
-
}, it = ({
|
|
766
|
-
id: t,
|
|
767
|
-
source: l,
|
|
768
|
-
target: s,
|
|
769
|
-
sourceX: d,
|
|
770
|
-
sourceY: a,
|
|
771
|
-
targetX: r,
|
|
772
|
-
targetY: m,
|
|
773
|
-
style: n = {},
|
|
774
|
-
markerEnd: o,
|
|
775
|
-
data: f
|
|
776
|
-
}) => {
|
|
777
|
-
const g = (f == null ? void 0 : f.verticalRouting) ?? !1, p = 30, E = g ? (() => {
|
|
778
|
-
const v = m - p;
|
|
779
|
-
return `M ${d},${v} L ${r},${v} L ${r},${m}`;
|
|
780
|
-
})() : (() => {
|
|
781
|
-
const v = a + 30;
|
|
782
|
-
return `M ${d},${a} L ${d},${v} L ${r},${v} L ${r},${m}`;
|
|
783
|
-
})(), c = n.stroke || "#d1d5db", i = f == null ? void 0 : f.label, N = (f == null ? void 0 : f.isFirst) ?? !1, u = f == null ? void 0 : f.onAddStepClick, k = g ? m - p : a + 30, h = d + (r - d) * (g ? 0.25 : 0.35), z = d + (r - d) * (g ? 0.65 : 0.7), y = k, T = (v) => {
|
|
784
|
-
v.stopPropagation(), u && u(l, {
|
|
785
|
-
edgeId: t,
|
|
786
|
-
nodeId: l,
|
|
787
|
-
sourceNodeId: l,
|
|
788
|
-
targetNodeId: s,
|
|
789
|
-
position: "between",
|
|
790
|
-
referenceNodeId: l,
|
|
791
|
-
filterId: f == null ? void 0 : f.filterId,
|
|
792
|
-
branch: f == null ? void 0 : f.branch
|
|
793
|
-
});
|
|
794
|
-
}, P = 11.5, S = 6;
|
|
795
|
-
return /* @__PURE__ */ e.createElement("g", null, /* @__PURE__ */ e.createElement("path", { id: t, d: E, fill: "none", stroke: c, strokeWidth: 1.5, markerEnd: o }), i && !g && /* @__PURE__ */ e.createElement("g", { transform: `translate(${h}, ${y})` }, (() => {
|
|
796
|
-
const v = Math.max(44, i.length * 7 + 20);
|
|
797
|
-
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
|
|
798
|
-
"rect",
|
|
799
|
-
{
|
|
800
|
-
x: -v / 2,
|
|
801
|
-
y: -11,
|
|
802
|
-
width: v,
|
|
803
|
-
height: 22,
|
|
804
|
-
rx: 11,
|
|
805
|
-
fill: N ? "#e8f5e9" : "#ffebee",
|
|
806
|
-
stroke: N ? "#81c784" : "#e57373",
|
|
807
|
-
strokeWidth: 1
|
|
808
|
-
}
|
|
809
|
-
), /* @__PURE__ */ e.createElement(
|
|
810
|
-
"text",
|
|
811
|
-
{
|
|
812
|
-
x: 0,
|
|
813
|
-
y: 4,
|
|
814
|
-
textAnchor: "middle",
|
|
815
|
-
fontSize: 10,
|
|
816
|
-
fontWeight: 600,
|
|
817
|
-
fill: N ? "#2e7d32" : "#c62828",
|
|
818
|
-
style: { fontFamily: "sans-serif", pointerEvents: "none" }
|
|
819
|
-
},
|
|
820
|
-
i
|
|
821
|
-
));
|
|
822
|
-
})()), u && /* @__PURE__ */ e.createElement(
|
|
823
|
-
"g",
|
|
824
|
-
{
|
|
825
|
-
transform: `translate(${z}, ${y})`,
|
|
826
|
-
onClick: T,
|
|
827
|
-
style: { cursor: "pointer", pointerEvents: "all" },
|
|
828
|
-
className: "nodrag nopan edge-plus-svg"
|
|
829
|
-
},
|
|
830
|
-
/* @__PURE__ */ e.createElement("circle", { r: P, className: "edge-plus-circle" }),
|
|
831
|
-
/* @__PURE__ */ e.createElement("line", { x1: 0, y1: -S, x2: 0, y2: S, strokeWidth: 2, strokeLinecap: "round", className: "plus-line" }),
|
|
832
|
-
/* @__PURE__ */ e.createElement("line", { x1: -S, y1: 0, x2: S, y2: 0, strokeWidth: 2, strokeLinecap: "round", className: "plus-line" })
|
|
833
|
-
));
|
|
834
|
-
};
|
|
835
|
-
export {
|
|
836
|
-
Ae as A,
|
|
837
|
-
Fe as D,
|
|
838
|
-
lt as E,
|
|
839
|
-
De as F,
|
|
840
|
-
it as G,
|
|
841
|
-
st as L,
|
|
842
|
-
Be as N,
|
|
843
|
-
at as P,
|
|
844
|
-
Ke as R,
|
|
845
|
-
we as S,
|
|
846
|
-
Pe as T,
|
|
847
|
-
Me as W,
|
|
848
|
-
Ce as a,
|
|
849
|
-
Le as b,
|
|
850
|
-
Se as c,
|
|
851
|
-
rt as d,
|
|
852
|
-
ot as e,
|
|
853
|
-
ve as f
|
|
854
|
-
};
|