@emporix/process-diagram 2.0.0-beta.28 → 2.0.0-beta.29
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/helpers/debuggerConnector.helpers.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +34 -31
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as C, Fragment as tt, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import X, { forwardRef as pe, useState as D, useRef as F, useCallback as J, useImperativeHandle as he, useEffect as st, createContext as Yt, useMemo as R, useContext as Gt, useLayoutEffect as fe } from "react";
|
|
3
3
|
import { createPortal as ge } from "react-dom";
|
|
4
4
|
const Ce = "_container_1f7x1_1", me = "_step_1f7x1_7", ve = "_dotsButton_1f7x1_23", _e = "_selected_1f7x1_27", xe = "_selectedInvalid_1f7x1_36", Ie = "_isSet_1f7x1_45", we = "_invalid_1f7x1_52", ye = "_debuggerStatus_1f7x1_60", be = "_title_1f7x1_64", Ne = "_icon_1f7x1_67", Le = "_filterFlag_1f7x1_78", Se = "_content_1f7x1_141", k = {
|
|
5
5
|
container: Ce,
|
|
@@ -21,7 +21,7 @@ var Zt = {
|
|
|
21
21
|
className: void 0,
|
|
22
22
|
style: void 0,
|
|
23
23
|
attr: void 0
|
|
24
|
-
}, At =
|
|
24
|
+
}, At = X.createContext && /* @__PURE__ */ X.createContext(Zt), Ee = ["attr", "size", "title"];
|
|
25
25
|
function Te(t, e) {
|
|
26
26
|
if (t == null) return {};
|
|
27
27
|
var o = Pe(t, e), i, s;
|
|
@@ -91,12 +91,12 @@ function Oe(t, e) {
|
|
|
91
91
|
return (e === "string" ? String : Number)(t);
|
|
92
92
|
}
|
|
93
93
|
function Ut(t) {
|
|
94
|
-
return t && t.map((e, o) => /* @__PURE__ */
|
|
94
|
+
return t && t.map((e, o) => /* @__PURE__ */ X.createElement(e.tag, Ct({
|
|
95
95
|
key: o
|
|
96
96
|
}, e.attr), Ut(e.child)));
|
|
97
97
|
}
|
|
98
98
|
function et(t) {
|
|
99
|
-
return (e) => /* @__PURE__ */
|
|
99
|
+
return (e) => /* @__PURE__ */ X.createElement(Me, gt({
|
|
100
100
|
attr: Ct({}, t.attr)
|
|
101
101
|
}, e), Ut(t.child));
|
|
102
102
|
}
|
|
@@ -107,7 +107,7 @@ function Me(t) {
|
|
|
107
107
|
size: s,
|
|
108
108
|
title: l
|
|
109
109
|
} = t, a = Te(t, Ee), p = s || o.size || "1em", c;
|
|
110
|
-
return o.className && (c = o.className), t.className && (c = (c ? c + " " : "") + t.className), /* @__PURE__ */
|
|
110
|
+
return o.className && (c = o.className), t.className && (c = (c ? c + " " : "") + t.className), /* @__PURE__ */ X.createElement("svg", gt({
|
|
111
111
|
stroke: "currentColor",
|
|
112
112
|
fill: "currentColor",
|
|
113
113
|
strokeWidth: "0"
|
|
@@ -119,9 +119,9 @@ function Me(t) {
|
|
|
119
119
|
height: p,
|
|
120
120
|
width: p,
|
|
121
121
|
xmlns: "http://www.w3.org/2000/svg"
|
|
122
|
-
}), l && /* @__PURE__ */
|
|
122
|
+
}), l && /* @__PURE__ */ X.createElement("title", null, l), t.children);
|
|
123
123
|
};
|
|
124
|
-
return At !== void 0 ? /* @__PURE__ */
|
|
124
|
+
return At !== void 0 ? /* @__PURE__ */ X.createElement(At.Consumer, null, (o) => e(o)) : e(Zt);
|
|
125
125
|
}
|
|
126
126
|
function $e(t) {
|
|
127
127
|
return et({ 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: [] }] })(t);
|
|
@@ -194,7 +194,7 @@ const De = "_panel_19663_1", Be = "_panelExiting_19663_13", Fe = "_menuItem_1966
|
|
|
194
194
|
N.stopPropagation(), m.command?.({ originalEvent: N, item: m }), b();
|
|
195
195
|
}, L = (m, N) => {
|
|
196
196
|
const d = (x) => h(m, x);
|
|
197
|
-
return m.template ? /* @__PURE__ */ n(
|
|
197
|
+
return m.template ? /* @__PURE__ */ n(X.Fragment, { children: m.template(m, { onClick: d }) }, N) : /* @__PURE__ */ C(
|
|
198
198
|
"button",
|
|
199
199
|
{
|
|
200
200
|
type: "button",
|
|
@@ -633,9 +633,9 @@ const ht = (t) => {
|
|
|
633
633
|
});
|
|
634
634
|
}
|
|
635
635
|
}), g(P), w.current && P.length > 0) {
|
|
636
|
-
const $ = w.current.getBoundingClientRect(), z = Math.min(...P.map((
|
|
637
|
-
...P.map((
|
|
638
|
-
), nt = Math.max(...P.map((
|
|
636
|
+
const $ = w.current.getBoundingClientRect(), z = Math.min(...P.map((Z) => Z.top)), Y = b.current.filter(Boolean).map((Z) => Z?.offsetHeight || 68), A = Math.max(
|
|
637
|
+
...P.map((Z, ue) => Z.top + (Y[ue] || 68))
|
|
638
|
+
), nt = Math.max(...P.map((Z) => Z.right)) + 0, ct = Math.max(
|
|
639
639
|
$.height,
|
|
640
640
|
A - z + 100
|
|
641
641
|
);
|
|
@@ -979,7 +979,7 @@ const ht = (t) => {
|
|
|
979
979
|
t ? /* @__PURE__ */ n("div", { className: Wt.tooltip, role: "tooltip", children: t }) : null
|
|
980
980
|
]
|
|
981
981
|
}
|
|
982
|
-
), Dn = "_conditionContainer_19jfz_1", Bn = "_debuggerTint_19jfz_5", Fn = "_connectorLine_19jfz_5", An = "_connectorDot_19jfz_8", jn = "_condition_19jfz_1", Wn = "_conditionWrapper_19jfz_15", Hn = "_conditionFits_19jfz_67",
|
|
982
|
+
), Dn = "_conditionContainer_19jfz_1", Bn = "_debuggerTint_19jfz_5", Fn = "_connectorLine_19jfz_5", An = "_connectorDot_19jfz_8", jn = "_condition_19jfz_1", Wn = "_conditionWrapper_19jfz_15", Hn = "_conditionFits_19jfz_67", U = {
|
|
983
983
|
conditionContainer: Dn,
|
|
984
984
|
debuggerTint: Bn,
|
|
985
985
|
connectorLine: Fn,
|
|
@@ -1008,17 +1008,17 @@ const ht = (t) => {
|
|
|
1008
1008
|
"--condition-line-width": "3px",
|
|
1009
1009
|
"--condition-line-style": "dotted"
|
|
1010
1010
|
};
|
|
1011
|
-
}, [r]), w = `${
|
|
1011
|
+
}, [r]), w = `${U.condition} ${a ? "" : U.conditionFits}`.trim(), b = `${U.conditionContainer} ${u ? U.debuggerTint : ""}`.trim();
|
|
1012
1012
|
return /* @__PURE__ */ C(
|
|
1013
1013
|
"div",
|
|
1014
1014
|
{
|
|
1015
1015
|
className: b,
|
|
1016
1016
|
style: { ...e, ...I },
|
|
1017
1017
|
children: [
|
|
1018
|
-
/* @__PURE__ */ n("div", { className:
|
|
1019
|
-
/* @__PURE__ */ n($n, { content: c, className:
|
|
1020
|
-
/* @__PURE__ */ n("div", { className:
|
|
1021
|
-
/* @__PURE__ */ n("div", { className:
|
|
1018
|
+
/* @__PURE__ */ n("div", { className: U.connectorLine }),
|
|
1019
|
+
/* @__PURE__ */ n($n, { content: c, className: U.conditionWrapper, children: /* @__PURE__ */ n("div", { ref: s, className: w, children: /* @__PURE__ */ n("span", { ref: l, children: t }) }) }),
|
|
1020
|
+
/* @__PURE__ */ n("div", { className: U.connectorLine }),
|
|
1021
|
+
/* @__PURE__ */ n("div", { className: U.connectorDot })
|
|
1022
1022
|
]
|
|
1023
1023
|
}
|
|
1024
1024
|
);
|
|
@@ -1806,7 +1806,7 @@ const ht = (t) => {
|
|
|
1806
1806
|
const i = Rt(o, e);
|
|
1807
1807
|
if (i !== void 0) return i;
|
|
1808
1808
|
}
|
|
1809
|
-
},
|
|
1809
|
+
}, G = (t, e) => {
|
|
1810
1810
|
for (const o of t.triggers)
|
|
1811
1811
|
if (o.localId === e) return o.status;
|
|
1812
1812
|
for (const o of t.steps) {
|
|
@@ -1843,9 +1843,9 @@ const ht = (t) => {
|
|
|
1843
1843
|
return !1;
|
|
1844
1844
|
}, vt = (t, e, o) => {
|
|
1845
1845
|
if (e === o) return !1;
|
|
1846
|
-
const i =
|
|
1846
|
+
const i = G(t, e), s = G(t, o);
|
|
1847
1847
|
return i !== "finished" || s !== "finished" ? !1 : kt(t, e, o);
|
|
1848
|
-
}, Ot = (t, e, o) => e === o || !v1(t, e) ||
|
|
1848
|
+
}, Ot = (t, e, o) => e === o || !v1(t, e) || G(t, o) !== "finished" ? !1 : kt(t, e, o), it = ({
|
|
1849
1849
|
lineColor: t,
|
|
1850
1850
|
style: e,
|
|
1851
1851
|
fromLocalId: o,
|
|
@@ -1875,13 +1875,16 @@ const ht = (t) => {
|
|
|
1875
1875
|
);
|
|
1876
1876
|
}, Mt = (t) => t.steps && t.steps.length > 0 ? ut(t.steps[t.steps.length - 1]) : t.paths && t.paths.length > 0 ? Mt(t.paths[t.paths.length - 1]) : t.localId, ut = (t) => "paths" in t && t.paths && t.paths.length > 0 ? Mt(t.paths[t.paths.length - 1]) : "steps" in t && t.steps && t.steps.length > 0 ? ut(t.steps[t.steps.length - 1]) : t.localId, _t = (t) => "steps" in t && t.steps && t.steps.length > 0 ? _t(t.steps[t.steps.length - 1]) : "paths" in t && t.paths && t.paths.length > 0 ? _t(t.paths[t.paths.length - 1]) : t.localId, se = (t, e, o, i) => {
|
|
1877
1877
|
const s = e.statusLine(void 0);
|
|
1878
|
-
if (i == null)
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1878
|
+
if (i == null)
|
|
1879
|
+
return o != null && G(t, o) === "finished" ? e.statusLine("finished") : s;
|
|
1880
|
+
const l = G(t, i);
|
|
1881
|
+
if (l == null || l !== "finished")
|
|
1882
|
+
return s;
|
|
1883
|
+
if (o == null) {
|
|
1884
|
+
const a = t.steps[0]?.localId;
|
|
1885
|
+
return a !== void 0 && i === a ? e.statusLine("finished") : s;
|
|
1886
|
+
}
|
|
1887
|
+
return Ot(t, o, i) || vt(t, o, i) ? e.statusLine("finished") : s;
|
|
1885
1888
|
}, re = Yt(
|
|
1886
1889
|
null
|
|
1887
1890
|
), _1 = re.Provider, $t = () => {
|
|
@@ -1962,7 +1965,7 @@ const ht = (t) => {
|
|
|
1962
1965
|
const E = _[x];
|
|
1963
1966
|
if (E === void 0) return null;
|
|
1964
1967
|
let T = d;
|
|
1965
|
-
if (s != null &&
|
|
1968
|
+
if (s != null && G(c, s) === "finished") {
|
|
1966
1969
|
const j = _t(
|
|
1967
1970
|
e[x]
|
|
1968
1971
|
);
|
|
@@ -1993,7 +1996,7 @@ const ht = (t) => {
|
|
|
1993
1996
|
i
|
|
1994
1997
|
]), N = R(() => {
|
|
1995
1998
|
const d = r.statusLine(void 0);
|
|
1996
|
-
if (e.length === 0 || s == null ||
|
|
1999
|
+
if (e.length === 0 || s == null || G(c, s) !== "finished") return d;
|
|
1997
2000
|
const E = _t(
|
|
1998
2001
|
e[0]
|
|
1999
2002
|
);
|
|
@@ -2174,11 +2177,11 @@ const ht = (t) => {
|
|
|
2174
2177
|
const { process: a, lineColors: p } = $t(), { localId: c, limit: r, steps: u, condition: I } = t, w = u ?? [], b = () => {
|
|
2175
2178
|
}, [_, g] = D(!1), f = () => {
|
|
2176
2179
|
g((E) => !E), s?.();
|
|
2177
|
-
}, h = S.container + (_ ? "" : " " + S.collapsed), L = S.expandable + (_ ? "" : " " + S.expandableCollapsed), m = w[0]?.localId, N = m != null ?
|
|
2180
|
+
}, h = S.container + (_ ? "" : " " + S.collapsed), L = S.expandable + (_ ? "" : " " + S.expandableCollapsed), m = w[0]?.localId, N = m != null ? G(a, m) : void 0, x = e != null && (Ot(
|
|
2178
2181
|
a,
|
|
2179
2182
|
e,
|
|
2180
2183
|
c
|
|
2181
|
-
) ||
|
|
2184
|
+
) || G(a, e) === "finished" && kt(a, e, c) || vt(a, e, c)) && N === "finished" ? p.statusLine("finished") : p.statusLine(void 0);
|
|
2182
2185
|
return /* @__PURE__ */ C(
|
|
2183
2186
|
"div",
|
|
2184
2187
|
{
|