@emporix/process-diagram 1.0.6 → 1.0.7

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/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsxs as g, Fragment as se, jsx as t } from "react/jsx-runtime";
2
- import O, { forwardRef as ce, useState as E, useRef as T, useCallback as H, useImperativeHandle as le, useEffect as W, createContext as ae, useMemo as z, useContext as de } from "react";
2
+ import O, { forwardRef as le, useState as E, useRef as T, useCallback as H, useImperativeHandle as ce, useEffect as W, createContext as ae, useMemo as $, useContext as de } from "react";
3
3
  import { createPortal as ue } from "react-dom";
4
4
  const pe = "_container_ww84z_1", he = "_step_ww84z_7", me = "_selected_ww84z_22", ge = "_selectedInvalid_ww84z_28", Ce = "_isSet_ww84z_34", fe = "_invalid_ww84z_38", ve = "_filterFlag_ww84z_44", _e = "_title_ww84z_70", we = "_icon_ww84z_87", ye = "_content_ww84z_105", xe = "_dotsButton_ww84z_111", f = {
5
5
  container: pe,
@@ -20,18 +20,18 @@ var J = {
20
20
  className: void 0,
21
21
  style: void 0,
22
22
  attr: void 0
23
- }, Y = O.createContext && /* @__PURE__ */ O.createContext(J), ke = ["attr", "size", "title"];
24
- function Ie(e, i) {
23
+ }, Y = O.createContext && /* @__PURE__ */ O.createContext(J), Ie = ["attr", "size", "title"];
24
+ function be(e, i) {
25
25
  if (e == null) return {};
26
- var n = be(e, i), r, d;
26
+ var n = ke(e, i), r, a;
27
27
  if (Object.getOwnPropertySymbols) {
28
28
  var p = Object.getOwnPropertySymbols(e);
29
- for (d = 0; d < p.length; d++)
30
- r = p[d], !(i.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
29
+ for (a = 0; a < p.length; a++)
30
+ r = p[a], !(i.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
31
31
  }
32
32
  return n;
33
33
  }
34
- function be(e, i) {
34
+ function ke(e, i) {
35
35
  if (e == null) return {};
36
36
  var n = {};
37
37
  for (var r in e)
@@ -55,8 +55,8 @@ function X(e, i) {
55
55
  var n = Object.keys(e);
56
56
  if (Object.getOwnPropertySymbols) {
57
57
  var r = Object.getOwnPropertySymbols(e);
58
- i && (r = r.filter(function(d) {
59
- return Object.getOwnPropertyDescriptor(e, d).enumerable;
58
+ i && (r = r.filter(function(a) {
59
+ return Object.getOwnPropertyDescriptor(e, a).enumerable;
60
60
  })), n.push.apply(n, r);
61
61
  }
62
62
  return n;
@@ -76,10 +76,10 @@ function Ne(e, i, n) {
76
76
  return i = Pe(i), i in e ? Object.defineProperty(e, i, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[i] = n, e;
77
77
  }
78
78
  function Pe(e) {
79
- var i = Le(e, "string");
79
+ var i = Me(e, "string");
80
80
  return typeof i == "symbol" ? i : i + "";
81
81
  }
82
- function Le(e, i) {
82
+ function Me(e, i) {
83
83
  if (typeof e != "object" || !e) return e;
84
84
  var n = e[Symbol.toPrimitive];
85
85
  if (n !== void 0) {
@@ -94,44 +94,44 @@ function Q(e) {
94
94
  key: n
95
95
  }, i.attr), Q(i.child)));
96
96
  }
97
- function j(e) {
98
- return (i) => /* @__PURE__ */ O.createElement(Me, F({
97
+ function z(e) {
98
+ return (i) => /* @__PURE__ */ O.createElement(Le, F({
99
99
  attr: A({}, e.attr)
100
100
  }, i), Q(e.child));
101
101
  }
102
- function Me(e) {
102
+ function Le(e) {
103
103
  var i = (n) => {
104
104
  var {
105
105
  attr: r,
106
- size: d,
106
+ size: a,
107
107
  title: p
108
- } = e, l = Ie(e, ke), c = d || n.size || "1em", o;
108
+ } = e, d = be(e, Ie), l = a || n.size || "1em", o;
109
109
  return n.className && (o = n.className), e.className && (o = (o ? o + " " : "") + e.className), /* @__PURE__ */ O.createElement("svg", F({
110
110
  stroke: "currentColor",
111
111
  fill: "currentColor",
112
112
  strokeWidth: "0"
113
- }, n.attr, r, l, {
113
+ }, n.attr, r, d, {
114
114
  className: o,
115
115
  style: A(A({
116
116
  color: e.color || n.color
117
117
  }, n.style), e.style),
118
- height: c,
119
- width: c,
118
+ height: l,
119
+ width: l,
120
120
  xmlns: "http://www.w3.org/2000/svg"
121
121
  }), p && /* @__PURE__ */ O.createElement("title", null, p), e.children);
122
122
  };
123
123
  return Y !== void 0 ? /* @__PURE__ */ O.createElement(Y.Consumer, null, (n) => i(n)) : i(J);
124
124
  }
125
125
  function Ee(e) {
126
- return j({ attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M5.52.359A.5.5 0 0 1 6 0h4a.5.5 0 0 1 .474.658L8.694 6H12.5a.5.5 0 0 1 .395.807l-7 9a.5.5 0 0 1-.873-.454L6.823 9.5H3.5a.5.5 0 0 1-.48-.641zM6.374 1 4.168 8.5H7.5a.5.5 0 0 1 .478.647L6.78 13.04 11.478 7H8a.5.5 0 0 1-.474-.658L9.306 1z" }, child: [] }] })(e);
126
+ return z({ attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M5.52.359A.5.5 0 0 1 6 0h4a.5.5 0 0 1 .474.658L8.694 6H12.5a.5.5 0 0 1 .395.807l-7 9a.5.5 0 0 1-.873-.454L6.823 9.5H3.5a.5.5 0 0 1-.48-.641zM6.374 1 4.168 8.5H7.5a.5.5 0 0 1 .478.647L6.78 13.04 11.478 7H8a.5.5 0 0 1-.474-.658L9.306 1z" }, child: [] }] })(e);
127
127
  }
128
128
  function G(e) {
129
- return j({ attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" }, child: [] }] })(e);
129
+ return z({ attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" }, child: [] }] })(e);
130
130
  }
131
131
  function ee(e) {
132
- return j({ attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z" }, child: [] }, { tag: "path", attr: { d: "M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z" }, child: [] }] })(e);
132
+ return z({ attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z" }, child: [] }, { tag: "path", attr: { d: "M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z" }, child: [] }] })(e);
133
133
  }
134
- const Oe = "_panel_19663_1", Be = "_panelExiting_19663_13", Se = "_menuItem_19663_37", He = "_disabled_19663_52", Te = "_menuItemIcon_19663_57", $e = "_menuItemText_19663_63", ze = "_overlay_19663_69", I = {
134
+ const Oe = "_panel_19663_1", Be = "_panelExiting_19663_13", Se = "_menuItem_19663_37", He = "_disabled_19663_52", Te = "_menuItemIcon_19663_57", $e = "_menuItemText_19663_63", ze = "_overlay_19663_69", b = {
135
135
  panel: Oe,
136
136
  panelExiting: Be,
137
137
  menuItem: Se,
@@ -142,93 +142,93 @@ const Oe = "_panel_19663_1", Be = "_panelExiting_19663_13", Se = "_menuItem_1966
142
142
  }, je = (e) => {
143
143
  const n = e.currentTarget ?? e.target;
144
144
  if (n?.getBoundingClientRect) {
145
- const d = n.getBoundingClientRect();
146
- return { top: d.bottom + 2, left: d.left };
145
+ const a = n.getBoundingClientRect();
146
+ return { top: a.bottom + 2, left: a.left };
147
147
  }
148
148
  const r = e;
149
149
  return {
150
150
  top: (r.clientY ?? 0) + 2,
151
151
  left: r.clientX ?? 0
152
152
  };
153
- }, te = ce(function({ model: i, popup: n = !0, onHide: r, onClick: d }, p) {
154
- const [l, c] = E(!1), [o, C] = E(!1), [y, S] = E({ top: 0, left: 0 }), _ = T(null), v = H(() => {
153
+ }, te = le(function({ model: i, popup: n = !0, onHide: r, onClick: a }, p) {
154
+ const [d, l] = E(!1), [o, C] = E(!1), [y, S] = E({ top: 0, left: 0 }), _ = T(null), v = H(() => {
155
155
  o || C(!0);
156
156
  }, [o]), B = H(
157
- (a) => {
158
- o && a.animationName.includes("menuOut") && (c(!1), C(!1), r?.());
157
+ (c) => {
158
+ o && c.animationName.includes("menuOut") && (l(!1), C(!1), r?.());
159
159
  },
160
160
  [o, r]
161
- ), b = H((a) => {
162
- S(je(a)), C(!1), c(!0);
161
+ ), k = H((c) => {
162
+ S(je(c)), C(!1), l(!0);
163
163
  }, []), x = H(
164
- (a) => {
165
- l ? v() : b(a);
164
+ (c) => {
165
+ d ? v() : k(c);
166
166
  },
167
- [l, v, b]
167
+ [d, v, k]
168
168
  );
169
- le(
169
+ ce(
170
170
  p,
171
171
  () => ({
172
- show: b,
172
+ show: k,
173
173
  hide: v,
174
174
  toggle: x
175
175
  }),
176
- [b, v, x]
176
+ [k, v, x]
177
177
  ), W(() => {
178
- if (!l) return;
179
- const a = (u) => {
178
+ if (!d) return;
179
+ const c = (u) => {
180
180
  u.key === "Escape" && v();
181
181
  }, s = (u) => {
182
182
  const h = _.current;
183
183
  h && !h.contains(u.target) && v();
184
184
  };
185
- return document.addEventListener("keydown", a), document.addEventListener("mousedown", s), () => {
186
- document.removeEventListener("keydown", a), document.removeEventListener("mousedown", s);
185
+ return document.addEventListener("keydown", c), document.addEventListener("mousedown", s), () => {
186
+ document.removeEventListener("keydown", c), document.removeEventListener("mousedown", s);
187
187
  };
188
- }, [l, v]);
189
- const P = (a, s) => {
190
- s.stopPropagation(), a.command?.({ originalEvent: s, item: a }), v();
191
- }, k = (a, s) => {
192
- const u = (h) => P(a, h);
193
- return a.template ? /* @__PURE__ */ t(O.Fragment, { children: a.template(a, { onClick: u }) }, s) : /* @__PURE__ */ g(
188
+ }, [d, v]);
189
+ const P = (c, s) => {
190
+ s.stopPropagation(), c.command?.({ originalEvent: s, item: c }), v();
191
+ }, I = (c, s) => {
192
+ const u = (h) => P(c, h);
193
+ return c.template ? /* @__PURE__ */ t(O.Fragment, { children: c.template(c, { onClick: u }) }, s) : /* @__PURE__ */ g(
194
194
  "button",
195
195
  {
196
196
  type: "button",
197
- className: `${I.menuItem} ${a.disabled && I.disabled}`,
197
+ className: `${b.menuItem} ${c.disabled && b.disabled}`,
198
198
  onClick: (h) => {
199
- a.disabled || u(h);
199
+ c.disabled || u(h);
200
200
  },
201
201
  children: [
202
- a.icon && /* @__PURE__ */ t("span", { className: I.menuItemIcon, children: a.icon }),
203
- /* @__PURE__ */ t("span", { className: I.menuItemText, children: a.label })
202
+ c.icon && /* @__PURE__ */ t("span", { className: b.menuItemIcon, children: c.icon }),
203
+ /* @__PURE__ */ t("span", { className: b.menuItemText, children: c.label })
204
204
  ]
205
205
  },
206
206
  s
207
207
  );
208
208
  };
209
- return !l || !n ? null : ue(
209
+ return !d || !n ? null : ue(
210
210
  /* @__PURE__ */ g(se, { children: [
211
211
  /* @__PURE__ */ t(
212
212
  "div",
213
213
  {
214
- className: I.overlay,
214
+ className: b.overlay,
215
215
  "aria-hidden": !0,
216
216
  onClick: () => v(),
217
- onMouseDown: (a) => a.stopPropagation()
217
+ onMouseDown: (c) => c.stopPropagation()
218
218
  }
219
219
  ),
220
220
  /* @__PURE__ */ t(
221
221
  "div",
222
222
  {
223
223
  ref: _,
224
- className: `${I.panel} ${o ? I.panelExiting : ""}`,
224
+ className: `${b.panel} ${o ? b.panelExiting : ""}`,
225
225
  role: "menu",
226
226
  style: { top: y.top, left: y.left },
227
227
  onAnimationEnd: B,
228
- onClick: (a) => {
229
- a.stopPropagation(), d?.(a);
228
+ onClick: (c) => {
229
+ c.stopPropagation(), a?.(c);
230
230
  },
231
- children: i.map(k)
231
+ children: i.map(I)
232
232
  }
233
233
  )
234
234
  ] }),
@@ -237,11 +237,11 @@ const Oe = "_panel_19663_1", Be = "_panelExiting_19663_13", Se = "_menuItem_1966
237
237
  }), ne = () => (e, i) => /* @__PURE__ */ g(
238
238
  "button",
239
239
  {
240
- className: I.menuItem,
240
+ className: b.menuItem,
241
241
  onClick: (n) => i.onClick(n),
242
242
  children: [
243
- /* @__PURE__ */ t("span", { className: I.menuItemIcon, children: e.icon }),
244
- /* @__PURE__ */ t("span", { className: I.menuItemText, children: e.label })
243
+ /* @__PURE__ */ t("span", { className: b.menuItemIcon, children: e.icon }),
244
+ /* @__PURE__ */ t("span", { className: b.menuItemText, children: e.label })
245
245
  ]
246
246
  }
247
247
  ), K = ({
@@ -275,20 +275,20 @@ const Oe = "_panel_19663_1", Be = "_panelExiting_19663_13", Se = "_menuItem_1966
275
275
  }
276
276
  ), ie = ae(
277
277
  void 0
278
- ), yt = ({ children: e }) => {
279
- const [i, n] = E([]), r = H((l, c) => {
278
+ ), wt = ({ children: e }) => {
279
+ const [i, n] = E([]), r = H((d, l) => {
280
280
  n((o) => (o.forEach((C) => {
281
- C.current && C !== l && C.current.hide(c);
282
- }), [])), l.current?.toggle(c), n([l]);
283
- }, []), d = H((l) => {
284
- n((c) => c.filter((o) => o !== l));
285
- }, []), p = z(
281
+ C.current && C !== d && C.current.hide(l);
282
+ }), [])), d.current?.toggle(l), n([d]);
283
+ }, []), a = H((d) => {
284
+ n((l) => l.filter((o) => o !== d));
285
+ }, []), p = $(
286
286
  () => ({
287
287
  openMenus: i,
288
288
  openMenu: r,
289
- closeMenu: d
289
+ closeMenu: a
290
290
  }),
291
- [i, r, d]
291
+ [i, r, a]
292
292
  );
293
293
  return /* @__PURE__ */ t(ie.Provider, { value: p, children: e });
294
294
  }, Re = () => {
@@ -320,17 +320,17 @@ const Oe = "_panel_19663_1", Be = "_panelExiting_19663_13", Se = "_menuItem_1966
320
320
  isSet: i,
321
321
  isSelected: n,
322
322
  isFilter: r,
323
- className: d,
323
+ className: a,
324
324
  title: p,
325
- icon: l,
326
- contextMenuItems: c = void 0,
325
+ icon: d,
326
+ contextMenuItems: l = void 0,
327
327
  onClick: o,
328
328
  onDeleteStep: C,
329
329
  onUpdateFilter: y,
330
330
  subtitle: S,
331
331
  isInvalid: _,
332
332
  idx: v
333
- } = e, B = T(null), { openMenu: b, closeMenu: x } = Re(), P = ne(), k = z(() => [
333
+ } = e, B = T(null), { openMenu: k, closeMenu: x } = Re(), P = ne(), I = $(() => [
334
334
  {
335
335
  label: "Add Step Filter",
336
336
  icon: /* @__PURE__ */ t("div", { className: "mr-2 flex items-center justify-center", children: /* @__PURE__ */ t(K, {}) }),
@@ -347,10 +347,10 @@ const Oe = "_panel_19663_1", Be = "_panelExiting_19663_13", Se = "_menuItem_1966
347
347
  },
348
348
  template: P
349
349
  }
350
- ], [y, C, v]), a = z(() => c !== void 0 ? c : k, [c, k]), s = (m) => {
351
- m.stopPropagation(), b(B, m);
352
- }, u = z(() => n && _ ? f.step + " " + f.selectedInvalid : n ? f.step + " " + f.selected : i ? f.step + " " + f.isSet : _ ? f.step + " " + f.invalid : f.step, [i, n, _]), h = z(() => _ ? /* @__PURE__ */ t(Fe, { color: "#E32012" }) : l, [l, _]);
353
- return /* @__PURE__ */ t("div", { className: f.container + " " + d, children: /* @__PURE__ */ g("div", { children: [
350
+ ], [y, C, v]), c = $(() => l !== void 0 ? l : I, [l, I]), s = (m) => {
351
+ m.stopPropagation(), k(B, m);
352
+ }, u = $(() => n && _ ? f.step + " " + f.selectedInvalid : n ? f.step + " " + f.selected : i ? f.step + " " + f.isSet : _ ? f.step + " " + f.invalid : f.step, [i, n, _]), h = $(() => _ ? /* @__PURE__ */ t(Fe, { color: "#E32012" }) : d, [d, _]);
353
+ return /* @__PURE__ */ t("div", { className: f.container + " " + a, children: /* @__PURE__ */ g("div", { children: [
354
354
  /* @__PURE__ */ g("div", { className: u, onClick: o, children: [
355
355
  /* @__PURE__ */ g("div", { className: f.content, children: [
356
356
  /* @__PURE__ */ t("div", { className: `${f.icon} ${_ && f.invalid}`, children: h }),
@@ -375,7 +375,7 @@ const Oe = "_panel_19663_1", Be = "_panelExiting_19663_13", Se = "_menuItem_1966
375
375
  /* @__PURE__ */ t(
376
376
  te,
377
377
  {
378
- model: a,
378
+ model: c,
379
379
  popup: !0,
380
380
  ref: B,
381
381
  onClick: (m) => m.stopPropagation(),
@@ -443,33 +443,33 @@ const Oe = "_panel_19663_1", Be = "_panelExiting_19663_13", Se = "_menuItem_1966
443
443
  borderTop: "1px solid #a1bbdc"
444
444
  }
445
445
  }
446
- ), rt = 80, R = 34, ot = ({
446
+ ), rt = 80, j = 34, ot = ({
447
447
  steps: e,
448
448
  title: i,
449
449
  className: n,
450
450
  onDeleteTrigger: r,
451
- onAddTrigger: d,
451
+ onAddTrigger: a,
452
452
  onSelectStep: p
453
453
  }) => {
454
- const l = T(null), c = T([]), [o, C] = E([]), [y, S] = E({ width: 0, height: 0 }), [_, v] = E(!1), [B, b] = E(!1), x = T(null);
454
+ const d = T(null), l = T([]), [o, C] = E([]), [y, S] = E({ width: 0, height: 0 }), [_, v] = E(!1), [B, k] = E(!1), x = T(null);
455
455
  if (W(() => {
456
456
  const s = () => {
457
- if (!l.current) return;
457
+ if (!d.current) return;
458
458
  const u = [];
459
- if (c.current.forEach((h, m) => {
460
- if (h && l.current) {
461
- const L = l.current.getBoundingClientRect(), N = h.getBoundingClientRect();
459
+ if (l.current.forEach((h, m) => {
460
+ if (h && d.current) {
461
+ const M = d.current.getBoundingClientRect(), N = h.getBoundingClientRect();
462
462
  u.push({
463
463
  id: e[m]?.id || `step-${m}`,
464
- top: N.top - L.top,
465
- right: N.right - L.left,
466
- centerY: N.top - L.top + N.height / 2
464
+ top: N.top - M.top,
465
+ right: N.right - M.left,
466
+ centerY: N.top - M.top + N.height / 2
467
467
  });
468
468
  }
469
- }), C(u), l.current && u.length > 0) {
470
- const h = l.current.getBoundingClientRect(), m = Math.min(...u.map((M) => M.top)), L = c.current.filter(Boolean).map((M) => M?.offsetHeight || 68), N = Math.max(
471
- ...u.map((M, oe) => M.top + (L[oe] || 68))
472
- ), V = Math.max(...u.map((M) => M.right)) + 0, D = Math.max(
469
+ }), C(u), d.current && u.length > 0) {
470
+ const h = d.current.getBoundingClientRect(), m = Math.min(...u.map((L) => L.top)), M = l.current.filter(Boolean).map((L) => L?.offsetHeight || 68), N = Math.max(
471
+ ...u.map((L, oe) => L.top + (M[oe] || 68))
472
+ ), V = Math.max(...u.map((L) => L.right)) + 0, D = Math.max(
473
473
  h.height,
474
474
  N - m + 100
475
475
  );
@@ -481,9 +481,9 @@ const Oe = "_panel_19663_1", Be = "_panelExiting_19663_13", Se = "_menuItem_1966
481
481
  };
482
482
  return s(), window.addEventListener("resize", s), () => window.removeEventListener("resize", s);
483
483
  }, [e]), W(() => (_ ? (x.current && (clearTimeout(x.current), x.current = null), setTimeout(() => {
484
- b(!0);
484
+ k(!0);
485
485
  }, 0)) : x.current = setTimeout(() => {
486
- b(!1);
486
+ k(!1);
487
487
  }, 140), () => {
488
488
  x.current && clearTimeout(x.current);
489
489
  }), [_]), e.length === 0)
@@ -492,20 +492,20 @@ const Oe = "_panel_19663_1", Be = "_panelExiting_19663_13", Se = "_menuItem_1966
492
492
  /* @__PURE__ */ t("div", { className: w.empty, children: "No steps" })
493
493
  ] });
494
494
  const P = o.length > 0 ? rt : 0;
495
- let k = 0;
496
- o.length > 1 ? k = o.reduce((s, u) => s + u.top + R, 0) / o.length : o.length === 1 && (k = o[0].top + R);
497
- const a = (s, u, h, m) => {
498
- const L = h - s, N = Math.min(L * 0.6, 60), Z = s + N, V = u, D = h - N;
495
+ let I = 0;
496
+ o.length > 1 ? I = o.reduce((s, u) => s + u.top + j, 0) / o.length : o.length === 1 && (I = o[0].top + j);
497
+ const c = (s, u, h, m) => {
498
+ const M = h - s, N = Math.min(M * 0.6, 60), Z = s + N, V = u, D = h - N;
499
499
  return `M ${s} ${u} C ${Z} ${V}, ${D} ${m}, ${h} ${m}`;
500
500
  };
501
- return /* @__PURE__ */ g("div", { className: `${w.trigger} ${n || ""}`, ref: l, children: [
501
+ return /* @__PURE__ */ g("div", { className: `${w.trigger} ${n || ""}`, ref: d, children: [
502
502
  i && /* @__PURE__ */ t("h3", { className: w.title, children: i }),
503
503
  /* @__PURE__ */ g("div", { className: w.triggerContainer, children: [
504
504
  /* @__PURE__ */ t("div", { className: w.stepsContainer, children: e.map((s, u) => /* @__PURE__ */ t(
505
505
  "div",
506
506
  {
507
507
  ref: (h) => {
508
- c.current[u] = h;
508
+ l.current[u] = h;
509
509
  },
510
510
  children: /* @__PURE__ */ t(
511
511
  re,
@@ -537,7 +537,7 @@ const Oe = "_panel_19663_1", Be = "_panelExiting_19663_13", Se = "_menuItem_1966
537
537
  label: "Add More Triggers",
538
538
  icon: /* @__PURE__ */ t(Ee, { className: "mr-2", color: "#3B64A0", size: 18 }),
539
539
  command: () => {
540
- d?.();
540
+ a?.();
541
541
  }
542
542
  }
543
543
  ]
@@ -553,11 +553,11 @@ const Oe = "_panel_19663_1", Be = "_panelExiting_19663_13", Se = "_menuItem_1966
553
553
  width: y.width,
554
554
  height: y.height,
555
555
  children: o.map((s) => {
556
- const h = o.length === 1 ? o[0].top + R : s.top + R;
556
+ const h = o.length === 1 ? o[0].top + j : s.top + j;
557
557
  return /* @__PURE__ */ t(
558
558
  "path",
559
559
  {
560
- d: a(0, h, P, k),
560
+ d: c(0, h, P, I),
561
561
  stroke: "#3b64a0",
562
562
  strokeWidth: "2",
563
563
  fill: "none",
@@ -575,7 +575,7 @@ const Oe = "_panel_19663_1", Be = "_panelExiting_19663_13", Se = "_menuItem_1966
575
575
  className: w.centralNode,
576
576
  style: {
577
577
  "--node-x": `${P}px`,
578
- "--node-y": `${k}px`
578
+ "--node-y": `${I}px`
579
579
  },
580
580
  onMouseEnter: () => v(!0),
581
581
  onMouseLeave: () => v(!1),
@@ -583,7 +583,7 @@ const Oe = "_panel_19663_1", Be = "_panelExiting_19663_13", Se = "_menuItem_1966
583
583
  "div",
584
584
  {
585
585
  className: `${w.iconWrapper} ${_ ? w.fadeIn : w.fadeOut}`,
586
- onClick: d,
586
+ onClick: a,
587
587
  children: /* @__PURE__ */ t(Ae, {})
588
588
  }
589
589
  ) : null
@@ -595,7 +595,7 @@ const Oe = "_panel_19663_1", Be = "_panelExiting_19663_13", Se = "_menuItem_1966
595
595
  className: w.operationContainer,
596
596
  style: {
597
597
  "--op-x": `${P + 16}px`,
598
- "--op-y": `${k}px`
598
+ "--op-y": `${I}px`
599
599
  },
600
600
  children: /* @__PURE__ */ t(We, {})
601
601
  }
@@ -632,51 +632,49 @@ const Oe = "_panel_19663_1", Be = "_panelExiting_19663_13", Se = "_menuItem_1966
632
632
  )
633
633
  ]
634
634
  }
635
- ), ct = "_stepLink_1ugcc_1", lt = "_stepLinkIcon_1ugcc_8", at = "_stepLinkLine_1ugcc_24", dt = "_stepLinkContainer_1ugcc_46", $ = {
636
- stepLink: ct,
635
+ ), lt = "_stepLinkIcon_1enyn_1", ct = "_stepLinkLine_1enyn_17", at = "_stepLinkContainer_1enyn_39", R = {
637
636
  stepLinkIcon: lt,
638
- stepLinkLine: at,
639
- stepLinkContainer: dt
637
+ stepLinkLine: ct,
638
+ stepLinkContainer: at
640
639
  };
641
- function ut(e) {
642
- return j({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "circle", attr: { cx: "12", cy: "12", r: "4" }, child: [] }, { tag: "line", attr: { x1: "1.05", y1: "12", x2: "7", y2: "12" }, child: [] }, { tag: "line", attr: { x1: "17.01", y1: "12", x2: "22.96", y2: "12" }, child: [] }] })(e);
640
+ function dt(e) {
641
+ return z({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "circle", attr: { cx: "12", cy: "12", r: "4" }, child: [] }, { tag: "line", attr: { x1: "1.05", y1: "12", x2: "7", y2: "12" }, child: [] }, { tag: "line", attr: { x1: "17.01", y1: "12", x2: "22.96", y2: "12" }, child: [] }] })(e);
643
642
  }
644
- function pt(e) {
645
- return j({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "polygon", attr: { points: "13 2 3 14 12 14 11 22 21 10 12 10 13 2" }, child: [] }] })(e);
643
+ function ut(e) {
644
+ return z({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "polygon", attr: { points: "13 2 3 14 12 14 11 22 21 10 12 10 13 2" }, child: [] }] })(e);
646
645
  }
647
646
  const U = ({
648
- style: e,
649
- onAddStep: i,
650
- onAddTrigger: n,
651
- index: r = 0
647
+ onAddStep: e,
648
+ onAddTrigger: i,
649
+ index: n = 0
652
650
  }) => {
653
- const d = ne(), p = T(null), l = [
651
+ const r = ne(), a = T(null), p = [
654
652
  {
655
653
  label: "Trigger",
656
- icon: /* @__PURE__ */ t(pt, { className: "mr-2", color: "#3B64A0", size: 18 }),
654
+ icon: /* @__PURE__ */ t(ut, { className: "mr-2", color: "#3B64A0", size: 18 }),
657
655
  command: () => {
658
- n?.(r);
656
+ i?.(n);
659
657
  },
660
- template: d
658
+ template: r
661
659
  },
662
660
  {
663
661
  label: "Step",
664
- icon: /* @__PURE__ */ t(ut, { className: "mr-2", color: "#3B64A0", size: 18 }),
662
+ icon: /* @__PURE__ */ t(dt, { className: "mr-2", color: "#3B64A0", size: 18 }),
665
663
  command: () => {
666
- i?.(r);
664
+ e?.(n);
667
665
  },
668
- template: d
666
+ template: r
669
667
  }
670
- ], c = (o) => {
671
- p.current?.show(o);
668
+ ], d = (l) => {
669
+ a.current?.show(l);
672
670
  };
673
- return /* @__PURE__ */ t("div", { className: $.stepLink, style: e, children: /* @__PURE__ */ g("main", { className: $.stepLinkContainer, children: [
674
- /* @__PURE__ */ t("div", { className: $.stepLinkLine }),
671
+ return /* @__PURE__ */ g("div", { className: R.stepLinkContainer, children: [
672
+ /* @__PURE__ */ t("div", { className: R.stepLinkLine }),
675
673
  /* @__PURE__ */ t(
676
674
  "div",
677
675
  {
678
- className: $.stepLinkIcon,
679
- onClick: c,
676
+ className: R.stepLinkIcon,
677
+ onClick: d,
680
678
  "aria-haspopup": !0,
681
679
  children: /* @__PURE__ */ t(st, {})
682
680
  }
@@ -684,25 +682,25 @@ const U = ({
684
682
  /* @__PURE__ */ t(
685
683
  te,
686
684
  {
687
- model: r === 0 ? l.splice(1) : l,
685
+ model: n === 0 ? p.splice(1) : p,
688
686
  popup: !0,
689
- ref: p
687
+ ref: a
690
688
  }
691
689
  ),
692
- /* @__PURE__ */ t("div", { className: $.stepLinkLine })
693
- ] }) });
694
- }, ht = "_steps_1y1ls_1", mt = "_stepContainer_1y1ls_9", q = {
695
- steps: ht,
696
- stepContainer: mt
697
- }, gt = ({
690
+ /* @__PURE__ */ t("div", { className: R.stepLinkLine })
691
+ ] });
692
+ }, pt = "_steps_1y1ls_1", ht = "_stepContainer_1y1ls_9", q = {
693
+ steps: pt,
694
+ stepContainer: ht
695
+ }, mt = ({
698
696
  steps: e,
699
697
  className: i,
700
698
  onDeleteStep: n,
701
699
  onUpdateFilter: r,
702
- onAddStep: d,
700
+ onAddStep: a,
703
701
  onAddTrigger: p,
704
- onSelectStep: l
705
- }) => /* @__PURE__ */ t("div", { className: q.steps + (i ? " " + i : ""), style: { alignItems: e.length > 0 ? "center" : "start" }, children: /* @__PURE__ */ g(
702
+ onSelectStep: d
703
+ }) => /* @__PURE__ */ t("div", { className: q.steps + (i ? " " + i : ""), children: /* @__PURE__ */ g(
706
704
  "div",
707
705
  {
708
706
  style: {
@@ -716,24 +714,24 @@ const U = ({
716
714
  /* @__PURE__ */ t(
717
715
  U,
718
716
  {
719
- onAddStep: d,
717
+ onAddStep: a,
720
718
  onAddTrigger: p,
721
719
  index: 0
722
720
  }
723
721
  ),
724
- e.map((c, o) => /* @__PURE__ */ g("div", { className: q.stepContainer, children: [
722
+ e.map((l, o) => /* @__PURE__ */ g("div", { className: q.stepContainer, children: [
725
723
  /* @__PURE__ */ t(
726
724
  re,
727
725
  {
728
726
  idx: o,
729
- title: c.title,
730
- isSet: c.isSet,
731
- isInvalid: c.isInvalid,
732
- isFilter: c.isFilter,
733
- isSelected: c.isSelected,
734
- icon: c.icon,
727
+ title: l.title,
728
+ isSet: l.isSet,
729
+ isInvalid: l.isInvalid,
730
+ isFilter: l.isFilter,
731
+ isSelected: l.isSelected,
732
+ icon: l.icon,
735
733
  onClick: () => {
736
- l(c.id);
734
+ d(l.id);
737
735
  },
738
736
  onDeleteStep: n ? (C) => n(e[C].id) : void 0,
739
737
  onUpdateFilter: r ? (C) => r(e[C].id) : void 0
@@ -742,12 +740,12 @@ const U = ({
742
740
  /* @__PURE__ */ t(
743
741
  U,
744
742
  {
745
- onAddStep: d,
743
+ onAddStep: a,
746
744
  onAddTrigger: p,
747
745
  index: o + 1
748
746
  }
749
747
  )
750
- ] }, c.id)),
748
+ ] }, l.id)),
751
749
  /* @__PURE__ */ t(
752
750
  "div",
753
751
  {
@@ -762,35 +760,35 @@ const U = ({
762
760
  )
763
761
  ]
764
762
  }
765
- ) }), Ct = "_container_12c1g_1", ft = {
766
- container: Ct
767
- }, xt = ({
763
+ ) }), gt = "_container_12c1g_1", Ct = {
764
+ container: gt
765
+ }, yt = ({
768
766
  process: e,
769
767
  onAddTrigger: i,
770
768
  addMultipleTriggers: n,
771
769
  onAddStep: r,
772
- onEditTrigger: d,
770
+ onEditTrigger: a,
773
771
  onDeleteTrigger: p,
774
- onDeleteStep: l,
775
- onUpdateFilter: c,
772
+ onDeleteStep: d,
773
+ onUpdateFilter: l,
776
774
  onSelectStep: o
777
- }) => /* @__PURE__ */ g("div", { className: ft.container, children: [
775
+ }) => /* @__PURE__ */ g("div", { className: Ct.container, children: [
778
776
  /* @__PURE__ */ t(
779
777
  ot,
780
778
  {
781
779
  steps: e.triggers,
782
780
  onAddTrigger: n,
783
781
  onDeleteTrigger: p,
784
- onEditTrigger: d,
782
+ onEditTrigger: a,
785
783
  onSelectStep: o
786
784
  }
787
785
  ),
788
786
  /* @__PURE__ */ t(
789
- gt,
787
+ mt,
790
788
  {
791
789
  steps: e.steps,
792
- onDeleteStep: l,
793
- onUpdateFilter: c,
790
+ onDeleteStep: d,
791
+ onUpdateFilter: l,
794
792
  onAddStep: r,
795
793
  onAddTrigger: i,
796
794
  onSelectStep: (C) => {
@@ -801,8 +799,8 @@ const U = ({
801
799
  ] });
802
800
  export {
803
801
  te as Menu,
804
- yt as MenuProvider,
805
- xt as ProcessDiagram,
802
+ wt as MenuProvider,
803
+ yt as ProcessDiagram,
806
804
  re as ProcessStep,
807
805
  ot as Trigger,
808
806
  Re as useMenuProvider