@code0-tech/pictor 0.0.0-mvp.29 → 0.0.0-mvp.30
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/_virtual/_commonjsHelpers.js +6 -0
- package/dist/_virtual/index.js +4 -0
- package/dist/_virtual/index2.js +4 -0
- package/dist/_virtual/react-contenteditable.js +7 -0
- package/dist/_virtual/react-contenteditable2.js +4 -0
- package/dist/_virtual/react-dom-server-legacy.browser.development.js +4 -0
- package/dist/_virtual/react-dom-server-legacy.browser.production.js +4 -0
- package/dist/_virtual/react-dom-server.browser.development.js +4 -0
- package/dist/_virtual/react-dom-server.browser.production.js +4 -0
- package/dist/_virtual/react-is.development.js +4 -0
- package/dist/_virtual/react-is.production.min.js +4 -0
- package/dist/_virtual/server.browser.js +5 -0
- package/dist/_virtual/server.browser2.js +4 -0
- package/dist/assets/components/d-resizable/DResizable.style.css +1 -1
- package/dist/assets/components/form/Input.style.css +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +12 -12
- package/dist/components/button-group/ButtonGroup.js +12 -12
- package/dist/components/d-flow/DFlow.edges.hook.js +57 -54
- package/dist/components/d-flow/DFlow.js +304 -268
- package/dist/components/d-flow/DFlow.nodes.hook.js +60 -59
- package/dist/components/d-flow/DFlow.service.d.ts +3 -2
- package/dist/components/d-flow/DFlow.service.js +62 -47
- package/dist/components/d-flow/DFlow.util.d.ts +4 -0
- package/dist/components/d-flow/DFlow.util.js +63 -0
- package/dist/components/d-flow/DFlowEdge.js +34 -34
- package/dist/components/d-flow-data-type/DFlowDataType.service.js +17 -14
- package/dist/components/d-flow-data-type/DFlowDataType.view.d.ts +7 -4
- package/dist/components/d-flow-data-type/DFlowDataType.view.js +11 -6
- package/dist/components/d-flow-file/DFlowTabDefault.d.ts +0 -3
- package/dist/components/d-flow-file/DFlowTabDefault.js +77 -112
- package/dist/components/d-flow-file/DFlowTabTrigger.js +38 -49
- package/dist/components/d-flow-file/DFlowTabs.js +26 -27
- package/dist/components/d-flow-folder/DFlowFolder.js +170 -143
- package/dist/components/d-flow-folder/DFlowFolderContextMenu.js +18 -11
- package/dist/components/d-flow-folder/DFlowFolderItemPathInput.js +1 -0
- package/dist/components/d-flow-function/DFlowFunction.input.hook.js +4 -5
- package/dist/components/d-flow-function/DFlowFunction.return.hook.js +1 -1
- package/dist/components/d-flow-function/DFlowFunction.view.d.ts +14 -11
- package/dist/components/d-flow-function/DFlowFunction.view.js +19 -12
- package/dist/components/d-flow-function/DFlowFunctionDefaultCard.js +72 -75
- package/dist/components/d-flow-function/DFlowFunctionSuggestionCard.js +27 -32
- package/dist/components/d-flow-function/DFlowFunctionTriggerCard.js +17 -10
- package/dist/components/d-flow-input/DFlowInputDataType.js +38 -33
- package/dist/components/d-flow-input/DFlowInputDefault.d.ts +10 -0
- package/dist/components/d-flow-input/DFlowInputDefault.js +128 -0
- package/dist/components/d-flow-input/DFlowInputLiteralBadge.d.ts +7 -0
- package/dist/components/d-flow-input/DFlowInputLiteralBadge.js +24 -0
- package/dist/components/d-flow-input/DFlowInputNodeBadge.d.ts +11 -0
- package/dist/components/d-flow-input/DFlowInputNodeBadge.js +44 -0
- package/dist/components/d-flow-input/DFlowInputReferenceBadge.d.ts +11 -0
- package/dist/components/d-flow-input/DFlowInputReferenceBadge.js +33 -0
- package/dist/components/d-flow-panel/DFlowExport.js +1 -1
- package/dist/components/d-flow-panel/DFlowMiniMap.js +1 -1
- package/dist/components/d-flow-panel/DFlowPanelControl.js +34 -32
- package/dist/components/d-flow-suggestion/DFlowDataTypeSuggestions.hook.d.ts +3 -0
- package/dist/components/d-flow-suggestion/DFlowDataTypeSuggestions.hook.js +34 -0
- package/dist/components/d-flow-suggestion/DFlowFunctionSuggestions.hook.d.ts +3 -0
- package/dist/components/d-flow-suggestion/DFlowFunctionSuggestions.hook.js +50 -0
- package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.d.ts +3 -0
- package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.js +133 -0
- package/dist/components/d-flow-suggestion/DFlowSuggestion.hook.d.ts +3 -18
- package/dist/components/d-flow-suggestion/DFlowSuggestion.hook.js +19 -156
- package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.js +47 -58
- package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.util.js +5 -4
- package/dist/components/d-flow-suggestion/DFlowSuggestionSearchInput.js +6 -6
- package/dist/components/d-flow-suggestion/DFlowValueSuggestions.hook.d.ts +3 -0
- package/dist/components/d-flow-suggestion/DFlowValueSuggestions.hook.js +44 -0
- package/dist/components/d-flow-type/DFlowType.view.d.ts +5 -5
- package/dist/components/d-flow-type/DFlowType.view.js +22 -12
- package/dist/components/d-flow-validation/DFlowValidation.hook.js +1 -1
- package/dist/components/d-flow-validation/DNodeValidation.hook.js +39 -43
- package/dist/components/d-resizable/DResizable.d.ts +4 -4
- package/dist/components/d-resizable/DResizable.js +22 -21
- package/dist/components/d-user/DUserInput.js +23 -21
- package/dist/components/file-tabs/FileTabs.service.d.ts +0 -1
- package/dist/components/file-tabs/FileTabs.service.js +49 -53
- package/dist/components/form/EmailInput.js +9 -9
- package/dist/components/form/Input.d.ts +2 -1
- package/dist/components/form/Input.js +294 -397
- package/dist/components/form/Input.syntax.hook.d.ts +1 -18
- package/dist/components/form/Input.syntax.hook.js +7 -73
- package/dist/components/form/Input.utils.d.ts +1 -2
- package/dist/components/form/Input.utils.js +26 -21
- package/dist/components/form/InputContentEditable.hook.d.ts +40 -0
- package/dist/components/form/InputContentEditable.hook.js +471 -0
- package/dist/components/form/InputSuggestion.d.ts +2 -2
- package/dist/components/form/InputSuggestion.js +169 -107
- package/dist/components/form/PasswordInput.js +8 -8
- package/dist/components/form/TextInput.js +11 -11
- package/dist/components/form/useForm.d.ts +1 -0
- package/dist/components/form/useForm.js +45 -60
- package/dist/components/menu/Menu.js +4 -4
- package/dist/index.js +155 -154
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +30 -30
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +8 -8
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +8 -8
- package/dist/node_modules/fast-deep-equal/index.js +31 -0
- package/dist/node_modules/object-assign/index.js +49 -0
- package/dist/node_modules/prop-types/checkPropTypes.js +54 -0
- package/dist/node_modules/prop-types/factoryWithThrowingShims.js +52 -0
- package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +329 -0
- package/dist/node_modules/prop-types/index.js +17 -0
- package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +10 -0
- package/dist/node_modules/prop-types/lib/has.js +7 -0
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +87 -0
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +70 -0
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +10 -0
- package/dist/node_modules/react-contenteditable/lib/react-contenteditable.js +132 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +6235 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +4096 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server.browser.development.js +6753 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server.browser.production.js +4645 -0
- package/dist/node_modules/react-dom/server.browser.js +15 -0
- package/dist/utils/generics.d.ts +2 -0
- package/dist/utils/generics.js +93 -80
- package/dist/utils/index.js +22 -21
- package/dist/utils/inspection.d.ts +4 -2
- package/dist/utils/inspection.js +27 -2
- package/package.json +10 -8
- package/dist/components/form/Input.selection.hook.d.ts +0 -17
- package/dist/components/form/Input.selection.hook.js +0 -78
- package/dist/components/form/InputSyntax.d.ts +0 -19
- package/dist/components/form/InputSyntax.js +0 -52
- package/dist/components/form/inputSyntaxMapping.d.ts +0 -3
- package/dist/components/form/inputSyntaxMapping.js +0 -42
|
@@ -1,133 +1,132 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsx as z, jsxs as Q } from "react/jsx-runtime";
|
|
2
|
+
import { c as Z } from "../../_virtual/compiler-runtime.js";
|
|
3
3
|
import "../../utils/contextStore.js";
|
|
4
|
-
import
|
|
5
|
-
import { mergeCode0Props as
|
|
6
|
-
import { ReactFlowProvider as
|
|
4
|
+
import W from "react";
|
|
5
|
+
import { mergeCode0Props as tt } from "../../utils/utils.js";
|
|
6
|
+
import { ReactFlowProvider as et, useNodesState as ot, useEdgesState as st, useUpdateNodeInternals as nt, ReactFlow as it, Background as rt, BackgroundVariant as at } from "@xyflow/react";
|
|
7
7
|
import '../../assets/components/d-flow-panel/DFlowMiniMap.style.css';import '../../assets/components/d-flow/DFlow.style.css';import '../../assets/node_modules/@xyflow/react/dist/style.css';/* empty css */
|
|
8
8
|
/* empty css */
|
|
9
|
-
import { DFlowFunctionDefaultCard as
|
|
10
|
-
import { DFlowFunctionGroupCard as
|
|
11
|
-
import { DFlowFunctionSuggestionCard as
|
|
12
|
-
import { DFlowFunctionTriggerCard as
|
|
13
|
-
import { DFlowEdge as
|
|
14
|
-
import { DFlowPanelSize as
|
|
15
|
-
import { DFlowPanelControl as
|
|
16
|
-
import { useFlowEdges as
|
|
17
|
-
import { useFlowNodes as
|
|
9
|
+
import { DFlowFunctionDefaultCard as ct } from "../d-flow-function/DFlowFunctionDefaultCard.js";
|
|
10
|
+
import { DFlowFunctionGroupCard as dt } from "../d-flow-function/DFlowFunctionGroupCard.js";
|
|
11
|
+
import { DFlowFunctionSuggestionCard as ht } from "../d-flow-function/DFlowFunctionSuggestionCard.js";
|
|
12
|
+
import { DFlowFunctionTriggerCard as lt } from "../d-flow-function/DFlowFunctionTriggerCard.js";
|
|
13
|
+
import { DFlowEdge as gt } from "./DFlowEdge.js";
|
|
14
|
+
import { DFlowPanelSize as pt } from "../d-flow-panel/DFlowPanelSize.js";
|
|
15
|
+
import { DFlowPanelControl as mt } from "../d-flow-panel/DFlowPanelControl.js";
|
|
16
|
+
import { useFlowEdges as ft } from "./DFlow.edges.hook.js";
|
|
17
|
+
import { useFlowNodes as ut } from "./DFlow.nodes.hook.js";
|
|
18
18
|
import "../button/Button.js";
|
|
19
19
|
/* empty css */
|
|
20
|
-
import { DFlowPanelLayout as
|
|
21
|
-
import { DFlowValidation as
|
|
22
|
-
const
|
|
23
|
-
if (!
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (n) {
|
|
35
|
-
let s = H.get(n);
|
|
36
|
-
s || (s = [], H.set(n, s)), s.push(o.id);
|
|
20
|
+
import { DFlowPanelLayout as wt } from "../d-flow-panel/DFlowPanelLayout.js";
|
|
21
|
+
import { DFlowValidation as yt } from "../d-flow-validation/DFlowValidation.js";
|
|
22
|
+
const xt = (m, F) => {
|
|
23
|
+
if (!F || F.size === 0) return {
|
|
24
|
+
nodes: m
|
|
25
|
+
};
|
|
26
|
+
const w = 50, Y = 50, N = 16, x = 0.25;
|
|
27
|
+
let G = 0, A = !1;
|
|
28
|
+
const K = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map();
|
|
29
|
+
for (const e of m) {
|
|
30
|
+
const a = e.data?.linkingId;
|
|
31
|
+
if (a) {
|
|
32
|
+
const l = H.get(a) ?? [];
|
|
33
|
+
l.push(e.id), H.set(a, l);
|
|
37
34
|
}
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
if (e.parentId && !a) {
|
|
36
|
+
const l = K.get(e.parentId) ?? [];
|
|
37
|
+
l.push(e.id), K.set(e.parentId, l);
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
|
-
const
|
|
44
|
-
for (const [
|
|
45
|
-
const
|
|
46
|
-
for (let
|
|
47
|
-
|
|
40
|
+
const R = new Map(m.map((e) => [e.id, e])), O = /* @__PURE__ */ new Map();
|
|
41
|
+
for (const [e, a] of K) {
|
|
42
|
+
const l = new Array(a.length);
|
|
43
|
+
for (let p = 0; p < a.length; p++) l[p] = R.get(a[p]);
|
|
44
|
+
O.set(e, l);
|
|
48
45
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
const X = /* @__PURE__ */ new Map();
|
|
47
|
+
for (const [e, a] of H) {
|
|
48
|
+
const l = new Array(a.length);
|
|
49
|
+
for (let p = 0; p < a.length; p++) l[p] = R.get(a[p]);
|
|
50
|
+
X.set(e, l);
|
|
53
51
|
}
|
|
54
|
-
const
|
|
55
|
-
for (const
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
w:
|
|
59
|
-
h:
|
|
52
|
+
const C = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map();
|
|
53
|
+
for (const e of m) {
|
|
54
|
+
const a = typeof e.style?.width == "number" ? e.style.width : void 0, l = typeof e.style?.height == "number" ? e.style.height : void 0, p = e.measured?.width && e.measured.width > 0 ? e.measured.width : void 0, T = e.measured?.height && e.measured.height > 0 ? e.measured.height : void 0;
|
|
55
|
+
b.set(e.id, {
|
|
56
|
+
w: a ?? p ?? 200,
|
|
57
|
+
h: l ?? T ?? 80
|
|
60
58
|
});
|
|
61
59
|
}
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
const E = (e) => B.get(e.id)?.width, y = (e) => B.get(e.id)?.height, f = /* @__PURE__ */ new Map(), I = (e) => {
|
|
61
|
+
const a = f.get(e.id);
|
|
62
|
+
if (a) return a;
|
|
63
|
+
if (e.type !== "group") {
|
|
64
|
+
const S = b.get(e.id);
|
|
65
|
+
return f.set(e.id, S), S;
|
|
67
66
|
}
|
|
68
|
-
const
|
|
69
|
-
if (
|
|
70
|
-
const
|
|
71
|
-
w:
|
|
72
|
-
h:
|
|
67
|
+
const l = E(e), p = y(e);
|
|
68
|
+
if (l !== void 0 && p !== void 0) {
|
|
69
|
+
const S = {
|
|
70
|
+
w: l,
|
|
71
|
+
h: p
|
|
73
72
|
};
|
|
74
|
-
return
|
|
73
|
+
return f.set(e.id, S), S;
|
|
75
74
|
}
|
|
76
|
-
const
|
|
77
|
-
let
|
|
78
|
-
for (const
|
|
79
|
-
const
|
|
80
|
-
|
|
75
|
+
const T = O.get(e.id) ?? [];
|
|
76
|
+
let k = 0, V = 0, _ = 0;
|
|
77
|
+
for (const S of T) {
|
|
78
|
+
const L = I(S);
|
|
79
|
+
k += L.h, L.w > V && (V = L.w), _++;
|
|
81
80
|
}
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
w:
|
|
85
|
-
h: (
|
|
81
|
+
k += w * Math.max(0, _ - 1);
|
|
82
|
+
const q = {
|
|
83
|
+
w: V + 2 * N,
|
|
84
|
+
h: (_ ? k : 0) + 2 * N
|
|
86
85
|
};
|
|
87
|
-
return
|
|
86
|
+
return f.set(e.id, q), q;
|
|
88
87
|
};
|
|
89
88
|
do {
|
|
90
|
-
|
|
91
|
-
for (const
|
|
92
|
-
const
|
|
93
|
-
const
|
|
94
|
-
node:
|
|
95
|
-
cx:
|
|
89
|
+
A = !1, G++, f.clear();
|
|
90
|
+
for (const o of m) I(o);
|
|
91
|
+
const e = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), l = (o) => Math.round(o / 10), p = (o, h, g) => {
|
|
92
|
+
const i = [{
|
|
93
|
+
node: o,
|
|
94
|
+
cx: h,
|
|
96
95
|
cy: g,
|
|
97
96
|
phase: 0
|
|
98
97
|
}];
|
|
99
|
-
let
|
|
100
|
-
for (;
|
|
101
|
-
const t =
|
|
98
|
+
let M = 0;
|
|
99
|
+
for (; i.length; ) {
|
|
100
|
+
const t = i[i.length - 1];
|
|
102
101
|
switch (t.phase) {
|
|
103
102
|
case 0: {
|
|
104
|
-
|
|
103
|
+
e.set(t.node.id, {
|
|
105
104
|
x: t.cx,
|
|
106
105
|
y: t.cy
|
|
107
106
|
});
|
|
108
107
|
const {
|
|
109
|
-
w:
|
|
108
|
+
w: n,
|
|
110
109
|
h: r
|
|
111
|
-
} =
|
|
112
|
-
t.w =
|
|
113
|
-
const
|
|
114
|
-
for (const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
let
|
|
118
|
-
for (const
|
|
119
|
-
|
|
110
|
+
} = I(t.node);
|
|
111
|
+
t.w = n, t.h = r;
|
|
112
|
+
const s = X.get(t.node.id) ?? [], c = [], D = [];
|
|
113
|
+
for (const d of s)
|
|
114
|
+
d.type === "group" ? D.push(d) : c.push(d);
|
|
115
|
+
c.sort((d, u) => +d.data?.paramIndex - +u.data?.paramIndex), D.sort((d, u) => +d.data?.paramIndex - +u.data?.paramIndex), t.right = c, t.gParams = D;
|
|
116
|
+
let v = 0;
|
|
117
|
+
for (const d of c) v += I(d).h;
|
|
118
|
+
v += w * Math.max(0, c.length - 1), t.py = t.cy - v / 2, t.rightBottom = t.cy + r / 2, t.rightIndex = 0, t.phase = 1;
|
|
120
119
|
break;
|
|
121
120
|
}
|
|
122
121
|
case 1: {
|
|
123
122
|
if (t.rightIndex < t.right.length) {
|
|
124
|
-
const
|
|
125
|
-
let
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
node:
|
|
129
|
-
cx:
|
|
130
|
-
cy:
|
|
123
|
+
const n = t.right[t.rightIndex], r = I(n), s = t.cx + t.w / 2 + Y + r.w / 2;
|
|
124
|
+
let c = t.py + r.h / 2;
|
|
125
|
+
const D = l(s), d = (a.get(D) ?? Number.NEGATIVE_INFINITY) + w;
|
|
126
|
+
c - r.h / 2 < d && (c = d + r.h / 2, t.py = c - r.h / 2), t.childKey = D, t.childPs = r, i.push({
|
|
127
|
+
node: n,
|
|
128
|
+
cx: s,
|
|
129
|
+
cy: c,
|
|
131
130
|
phase: 0
|
|
132
131
|
}), t.phase = 10;
|
|
133
132
|
} else
|
|
@@ -135,30 +134,30 @@ const ut = (E, k) => {
|
|
|
135
134
|
break;
|
|
136
135
|
}
|
|
137
136
|
case 10: {
|
|
138
|
-
const
|
|
139
|
-
|
|
137
|
+
const n = t.lastChildBottom;
|
|
138
|
+
a.set(t.childKey, Math.max(a.get(t.childKey) ?? Number.NEGATIVE_INFINITY, n)), t.rightBottom = Math.max(t.rightBottom, n), t.py = Math.max(t.py + t.childPs.h + w, n + w), t.rightIndex++, t.phase = 1;
|
|
140
139
|
break;
|
|
141
140
|
}
|
|
142
141
|
case 2: {
|
|
143
142
|
if (t.gParams && t.gParams.length) {
|
|
144
|
-
const
|
|
143
|
+
const n = [];
|
|
145
144
|
let r = 0;
|
|
146
|
-
for (const
|
|
147
|
-
const
|
|
148
|
-
|
|
145
|
+
for (const s of t.gParams) {
|
|
146
|
+
const c = I(s);
|
|
147
|
+
n.push(c), r += c.w;
|
|
149
148
|
}
|
|
150
|
-
r +=
|
|
149
|
+
r += Y * (t.gParams.length - 1), t.gSizes = n, t.gx = t.cx - r / 2, t.gy = t.bottom + w, t.rowBottom = t.bottom, t.gIndex = 0, t.phase = 3;
|
|
151
150
|
} else
|
|
152
151
|
t.phase = 4;
|
|
153
152
|
break;
|
|
154
153
|
}
|
|
155
154
|
case 3: {
|
|
156
155
|
if (t.gIndex < t.gParams.length) {
|
|
157
|
-
const
|
|
158
|
-
t.gx += r.w +
|
|
159
|
-
node:
|
|
160
|
-
cx:
|
|
161
|
-
cy:
|
|
156
|
+
const n = t.gParams[t.gIndex], r = t.gSizes[t.gIndex], s = t.gx + r.w / 2, c = t.gy + r.h / 2;
|
|
157
|
+
t.gx += r.w + Y, i.push({
|
|
158
|
+
node: n,
|
|
159
|
+
cx: s,
|
|
160
|
+
cy: c,
|
|
162
161
|
phase: 0
|
|
163
162
|
}), t.childPs = r, t.phase = 30;
|
|
164
163
|
} else
|
|
@@ -166,227 +165,264 @@ const ut = (E, k) => {
|
|
|
166
165
|
break;
|
|
167
166
|
}
|
|
168
167
|
case 30: {
|
|
169
|
-
const
|
|
170
|
-
t.rowBottom = Math.max(t.rowBottom,
|
|
168
|
+
const n = t.lastChildBottom;
|
|
169
|
+
t.rowBottom = Math.max(t.rowBottom, n), t.gIndex++, t.phase = 3;
|
|
171
170
|
break;
|
|
172
171
|
}
|
|
173
172
|
case 4: {
|
|
174
173
|
if (t.node.type === "group") {
|
|
175
|
-
const
|
|
176
|
-
for (const
|
|
177
|
-
|
|
178
|
-
t.kids = r, t.kidIndex = 0, t.curY = t.cy - t.h / 2 +
|
|
174
|
+
const n = O.get(t.node.id) ?? [], r = [];
|
|
175
|
+
for (const s of n)
|
|
176
|
+
s.data?.linkingId || r.push(s);
|
|
177
|
+
t.kids = r, t.kidIndex = 0, t.curY = t.cy - t.h / 2 + N, t.phase = 5;
|
|
179
178
|
} else
|
|
180
179
|
t.phase = 6;
|
|
181
180
|
break;
|
|
182
181
|
}
|
|
183
182
|
case 5: {
|
|
184
183
|
if (t.kidIndex < t.kids.length) {
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
node:
|
|
184
|
+
const n = t.kids[t.kidIndex], r = I(n), s = t.curY + r.h / 2;
|
|
185
|
+
i.push({
|
|
186
|
+
node: n,
|
|
188
187
|
cx: t.cx,
|
|
189
|
-
cy:
|
|
188
|
+
cy: s,
|
|
190
189
|
phase: 0
|
|
191
190
|
}), t.childPs = r, t.phase = 50;
|
|
192
191
|
} else {
|
|
193
|
-
const
|
|
194
|
-
t.bottom = Math.max(t.bottom,
|
|
192
|
+
const n = t.curY - w;
|
|
193
|
+
t.bottom = Math.max(t.bottom, n + N), t.phase = 6;
|
|
195
194
|
}
|
|
196
195
|
break;
|
|
197
196
|
}
|
|
198
197
|
case 50: {
|
|
199
|
-
const
|
|
200
|
-
t.curY =
|
|
198
|
+
const n = t.lastChildBottom;
|
|
199
|
+
t.curY = n + w, t.kidIndex++, t.phase = 5;
|
|
201
200
|
break;
|
|
202
201
|
}
|
|
203
202
|
case 6: {
|
|
204
|
-
const
|
|
205
|
-
|
|
203
|
+
const n = i.pop();
|
|
204
|
+
i.length ? i[i.length - 1].lastChildBottom = n.bottom : M = n.bottom;
|
|
206
205
|
break;
|
|
207
206
|
}
|
|
208
207
|
}
|
|
209
208
|
}
|
|
210
|
-
return
|
|
209
|
+
return M;
|
|
211
210
|
};
|
|
212
211
|
let T = 0;
|
|
213
|
-
for (const
|
|
214
|
-
!
|
|
215
|
-
const
|
|
216
|
-
for (const
|
|
217
|
-
const N = /* @__PURE__ */ new Map();
|
|
218
|
-
for (const e of f) {
|
|
212
|
+
for (const o of m)
|
|
213
|
+
!o.data?.linkingId && !o.parentId && (T = p(o, 0, T + I(o).h / 2) + w);
|
|
214
|
+
const k = /* @__PURE__ */ new Map();
|
|
215
|
+
for (const o of m) {
|
|
219
216
|
const {
|
|
220
|
-
w:
|
|
217
|
+
w: h,
|
|
221
218
|
h: g
|
|
222
|
-
} =
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
N.set(e.id, {
|
|
227
|
-
x: h - p / 2,
|
|
228
|
-
y: y - g / 2
|
|
219
|
+
} = I(o), i = e.get(o.id);
|
|
220
|
+
k.set(o.id, {
|
|
221
|
+
x: i.x - h / 2,
|
|
222
|
+
y: i.y - g / 2
|
|
229
223
|
});
|
|
230
224
|
}
|
|
231
|
-
for (const
|
|
232
|
-
const
|
|
233
|
-
let g =
|
|
234
|
-
if (
|
|
235
|
-
const
|
|
236
|
-
g -=
|
|
225
|
+
for (const o of m) {
|
|
226
|
+
const h = k.get(o.id);
|
|
227
|
+
let g = h.x, i = h.y;
|
|
228
|
+
if (o.parentId) {
|
|
229
|
+
const t = k.get(o.parentId);
|
|
230
|
+
g -= t.x, i -= t.y;
|
|
237
231
|
}
|
|
238
|
-
|
|
232
|
+
const M = C.get(o.id);
|
|
233
|
+
(!M || Math.abs(M.x - g) > x || Math.abs(M.y - i) > x) && (C.set(o.id, {
|
|
239
234
|
x: g,
|
|
240
|
-
y:
|
|
241
|
-
};
|
|
235
|
+
y: i
|
|
236
|
+
}), A = !0);
|
|
242
237
|
}
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
let p = 0, g = e;
|
|
247
|
-
for (; g?.parentId && (p++, g = v.get(g.parentId), !!g); )
|
|
238
|
+
const V = (o) => {
|
|
239
|
+
let h = 0, g = o;
|
|
240
|
+
for (; g?.parentId && (h++, g = R.get(g.parentId), !!g); )
|
|
248
241
|
;
|
|
249
|
-
return
|
|
250
|
-
},
|
|
251
|
-
for (const
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
if (!p.length) {
|
|
259
|
-
const c = typeof e.style?.width == "number" ? e.style.width : 2 * b, S = typeof e.style?.height == "number" ? e.style.height : 2 * b;
|
|
260
|
-
e.style = {
|
|
261
|
-
...e.style,
|
|
262
|
-
width: c,
|
|
263
|
-
height: S
|
|
264
|
-
};
|
|
265
|
-
continue;
|
|
266
|
-
}
|
|
267
|
-
const g = (c) => {
|
|
268
|
-
const S = typeof c.style?.width == "number" ? c.style.width : void 0, q = typeof c.style?.height == "number" ? c.style.height : void 0, X = F.get(c.id);
|
|
269
|
-
return {
|
|
270
|
-
w: S ?? X.w,
|
|
271
|
-
h: q ?? X.h
|
|
272
|
-
};
|
|
242
|
+
return h;
|
|
243
|
+
}, _ = [];
|
|
244
|
+
for (const o of m) o.type === "group" && _.push(o);
|
|
245
|
+
_.sort((o, h) => V(h) - V(o));
|
|
246
|
+
const q = (o) => {
|
|
247
|
+
const h = typeof o.style?.width == "number" ? o.style.width : void 0, g = typeof o.style?.height == "number" ? o.style.height : void 0, i = b.get(o.id);
|
|
248
|
+
return {
|
|
249
|
+
w: h ?? i.w,
|
|
250
|
+
h: g ?? i.h
|
|
273
251
|
};
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
252
|
+
};
|
|
253
|
+
for (const o of _) {
|
|
254
|
+
const h = [];
|
|
255
|
+
for (const d of m)
|
|
256
|
+
d.parentId === o.id && h.push(d);
|
|
257
|
+
if (!h.length) {
|
|
258
|
+
const d = E(o) ?? (typeof o.style?.width == "number" ? o.style.width : 2 * N), u = y(o) ?? (typeof o.style?.height == "number" ? o.style.height : 2 * N);
|
|
259
|
+
B.set(o.id, {
|
|
260
|
+
width: d,
|
|
261
|
+
height: u
|
|
262
|
+
}), j.set(o.id, {
|
|
263
|
+
width: d,
|
|
264
|
+
height: u
|
|
265
|
+
}), b.set(o.id, {
|
|
266
|
+
w: d,
|
|
267
|
+
h: u
|
|
268
|
+
});
|
|
269
|
+
continue;
|
|
278
270
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
D = !0;
|
|
271
|
+
let g = Number.POSITIVE_INFINITY, i = Number.POSITIVE_INFINITY, M = Number.NEGATIVE_INFINITY, t = Number.NEGATIVE_INFINITY;
|
|
272
|
+
for (const d of h) {
|
|
273
|
+
const u = q(d), P = C.get(d.id);
|
|
274
|
+
P.x < g && (g = P.x), P.y < i && (i = P.y), P.x + u.w > M && (M = P.x + u.w), P.y + u.h > t && (t = P.y + u.h);
|
|
284
275
|
}
|
|
285
|
-
const
|
|
286
|
-
(Math.abs(
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
276
|
+
const n = g - N, r = i - N;
|
|
277
|
+
if (Math.abs(n) > x || Math.abs(r) > x)
|
|
278
|
+
for (const d of h) {
|
|
279
|
+
const u = C.get(d.id), P = u.x - n, U = u.y - r;
|
|
280
|
+
(Math.abs(u.x - P) > x || Math.abs(u.y - U) > x) && (C.set(d.id, {
|
|
281
|
+
x: P,
|
|
282
|
+
y: U
|
|
283
|
+
}), A = !0);
|
|
284
|
+
}
|
|
285
|
+
const s = M - g + 2 * N, c = t - i + 2 * N, D = E(o) ?? (typeof o.style?.width == "number" ? o.style.width : I(o).w), v = y(o) ?? (typeof o.style?.height == "number" ? o.style.height : I(o).h);
|
|
286
|
+
(Math.abs(s - D) > x || Math.abs(c - v) > x) && (A = !0), B.set(o.id, {
|
|
287
|
+
width: s,
|
|
288
|
+
height: c
|
|
289
|
+
}), j.set(o.id, {
|
|
290
|
+
width: s,
|
|
291
|
+
height: c
|
|
292
|
+
}), b.set(o.id, {
|
|
293
|
+
w: s,
|
|
294
|
+
h: c
|
|
296
295
|
});
|
|
297
296
|
}
|
|
298
|
-
|
|
299
|
-
for (const
|
|
300
|
-
const
|
|
301
|
-
for (const
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
x: g.x -
|
|
305
|
-
y: g.y -
|
|
297
|
+
f.clear();
|
|
298
|
+
for (const o of m) I(o);
|
|
299
|
+
const S = /* @__PURE__ */ new Map(), L = /* @__PURE__ */ new Map();
|
|
300
|
+
for (const o of m) {
|
|
301
|
+
const h = I(o), g = e.get(o.id);
|
|
302
|
+
L.set(o.id, g), S.set(o.id, {
|
|
303
|
+
x: g.x - h.w / 2,
|
|
304
|
+
y: g.y - h.h / 2
|
|
306
305
|
});
|
|
307
306
|
}
|
|
308
|
-
for (const
|
|
309
|
-
const
|
|
310
|
-
for (const
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
y.push(w ?? l(d).w);
|
|
307
|
+
for (const o of m) {
|
|
308
|
+
const h = [], g = X.get(o.id) ?? [];
|
|
309
|
+
for (const s of g) s.type === "group" && h.push(s);
|
|
310
|
+
if (!h.length) continue;
|
|
311
|
+
const i = h.slice().sort((s, c) => (+s.data?.paramIndex || 0) - (+c.data?.paramIndex || 0)), M = [];
|
|
312
|
+
for (const s of i) {
|
|
313
|
+
const c = E(s) ?? (typeof s.style?.width == "number" ? s.style.width : void 0);
|
|
314
|
+
M.push(c ?? I(s).w);
|
|
317
315
|
}
|
|
318
316
|
let t = 0;
|
|
319
|
-
for (const
|
|
320
|
-
t +=
|
|
321
|
-
let r =
|
|
322
|
-
for (let
|
|
323
|
-
const
|
|
317
|
+
for (const s of M) t += s;
|
|
318
|
+
t += Y * (i.length - 1);
|
|
319
|
+
let r = L.get(o.id).x - t / 2;
|
|
320
|
+
for (let s = 0; s < i.length; s++) {
|
|
321
|
+
const c = i[s], D = c.parentId ? S.get(c.parentId) : {
|
|
324
322
|
x: 0
|
|
325
|
-
};
|
|
326
|
-
|
|
323
|
+
}, v = C.get(c.id), d = r - D.x, u = v.y;
|
|
324
|
+
(Math.abs(v.x - d) > x || Math.abs(v.y - u) > x) && (C.set(c.id, {
|
|
325
|
+
x: d,
|
|
326
|
+
y: u
|
|
327
|
+
}), A = !0), r += M[s] + Y;
|
|
327
328
|
}
|
|
328
329
|
}
|
|
329
|
-
} while (
|
|
330
|
+
} while (A && G < 5);
|
|
330
331
|
return {
|
|
331
|
-
nodes:
|
|
332
|
+
nodes: m.map((e) => {
|
|
333
|
+
const a = C.get(e.id), l = j.get(e.id), p = B.get(e.id);
|
|
334
|
+
let T = !1;
|
|
335
|
+
if (a) {
|
|
336
|
+
const k = e.position ?? {
|
|
337
|
+
x: 0,
|
|
338
|
+
y: 0
|
|
339
|
+
};
|
|
340
|
+
(Math.abs(k.x - a.x) > x || Math.abs(k.y - a.y) > x) && (T = !0);
|
|
341
|
+
}
|
|
342
|
+
if (l) {
|
|
343
|
+
const k = e.measured ?? {
|
|
344
|
+
width: 0,
|
|
345
|
+
height: 0
|
|
346
|
+
};
|
|
347
|
+
(Math.abs(k.width - l.width) > x || Math.abs(k.height - l.height) > x) && (T = !0);
|
|
348
|
+
}
|
|
349
|
+
if (p) {
|
|
350
|
+
const k = typeof e.style?.width == "number" ? e.style.width : void 0, V = typeof e.style?.height == "number" ? e.style.height : void 0;
|
|
351
|
+
(k !== p.width || V !== p.height) && (T = !0);
|
|
352
|
+
}
|
|
353
|
+
return T ? {
|
|
354
|
+
...e,
|
|
355
|
+
position: a ?? e.position,
|
|
356
|
+
measured: l ? {
|
|
357
|
+
...e.measured,
|
|
358
|
+
width: l.width,
|
|
359
|
+
height: l.height
|
|
360
|
+
} : e.measured,
|
|
361
|
+
style: p ? {
|
|
362
|
+
...e.style,
|
|
363
|
+
width: p.width,
|
|
364
|
+
height: p.height
|
|
365
|
+
} : e.style
|
|
366
|
+
} : e;
|
|
367
|
+
})
|
|
332
368
|
};
|
|
333
|
-
},
|
|
334
|
-
const
|
|
335
|
-
let
|
|
336
|
-
return
|
|
337
|
-
},
|
|
369
|
+
}, $ = W.cache(xt), Gt = (m) => {
|
|
370
|
+
const F = Z.c(2);
|
|
371
|
+
let w;
|
|
372
|
+
return F[0] !== m ? (w = /* @__PURE__ */ z(et, { children: /* @__PURE__ */ z(It, { ...m }) }), F[0] = m, F[1] = w) : w = F[1], w;
|
|
373
|
+
}, It = (m) => {
|
|
338
374
|
const {
|
|
339
|
-
flowId:
|
|
340
|
-
namespaceId:
|
|
341
|
-
projectId:
|
|
342
|
-
} =
|
|
343
|
-
default:
|
|
344
|
-
group:
|
|
345
|
-
suggestion:
|
|
346
|
-
trigger:
|
|
347
|
-
},
|
|
348
|
-
default:
|
|
349
|
-
},
|
|
375
|
+
flowId: F,
|
|
376
|
+
namespaceId: w,
|
|
377
|
+
projectId: Y
|
|
378
|
+
} = m, N = W.useMemo(() => ({
|
|
379
|
+
default: ct,
|
|
380
|
+
group: dt,
|
|
381
|
+
suggestion: ht,
|
|
382
|
+
trigger: lt
|
|
383
|
+
}), []), x = W.useMemo(() => ({
|
|
384
|
+
default: gt
|
|
385
|
+
}), []), G = ut(F, w, Y), A = ft(F, w, Y), [K, H] = ot([]), [R, O, X] = st([]), C = nt(), B = W.useCallback((b) => {
|
|
350
386
|
requestAnimationFrame(() => {
|
|
351
|
-
|
|
387
|
+
b.forEach((E) => C(E));
|
|
352
388
|
});
|
|
353
|
-
}, [
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
const
|
|
357
|
-
if (!
|
|
358
|
-
const
|
|
389
|
+
}, [C]), j = W.useCallback((b) => {
|
|
390
|
+
const E = Array.from(new Set(b.filter((f) => f.type === "dimensions" || f.type === "position").map((f) => f.id))), y = /* @__PURE__ */ new Map();
|
|
391
|
+
b.filter((f) => f.type === "dimensions").forEach((f) => y.set(f.id, f.dimensions)), H((f) => {
|
|
392
|
+
const I = f.map((e) => {
|
|
393
|
+
if (!y.has(e.id)) return e;
|
|
394
|
+
const a = y.get(e.id) || {};
|
|
359
395
|
return {
|
|
360
|
-
...
|
|
396
|
+
...e,
|
|
361
397
|
measured: {
|
|
362
|
-
width:
|
|
363
|
-
height:
|
|
398
|
+
width: a.width ?? e.measured?.width ?? 0,
|
|
399
|
+
height: a.height ?? e.measured?.height ?? 0
|
|
364
400
|
}
|
|
365
401
|
};
|
|
366
402
|
});
|
|
367
|
-
return
|
|
368
|
-
}),
|
|
369
|
-
}, [
|
|
370
|
-
return
|
|
371
|
-
const
|
|
372
|
-
const
|
|
403
|
+
return $(I, new Set(E)).nodes;
|
|
404
|
+
}), B(E);
|
|
405
|
+
}, [B]);
|
|
406
|
+
return W.useEffect(() => {
|
|
407
|
+
const b = G.map((y) => {
|
|
408
|
+
const f = y.measured ? [] : document.querySelectorAll("[data-id='" + y.id + "']");
|
|
373
409
|
return {
|
|
374
|
-
...
|
|
410
|
+
...y,
|
|
375
411
|
measured: {
|
|
376
|
-
width:
|
|
377
|
-
height:
|
|
412
|
+
width: y.measured?.width ?? f[0]?.clientWidth ?? 0,
|
|
413
|
+
height: y.measured?.height ?? f[0]?.clientHeight ?? 0
|
|
378
414
|
}
|
|
379
415
|
};
|
|
380
|
-
}),
|
|
381
|
-
|
|
382
|
-
}, [
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
-
/* @__PURE__ */
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
-
/* @__PURE__ */
|
|
416
|
+
}), E = $(b, new Set(b.map((y) => y.id)));
|
|
417
|
+
H(E.nodes), O(A), B(E.nodes.map((y) => y.id));
|
|
418
|
+
}, [G, A, B]), /* @__PURE__ */ Q(it, { onlyRenderVisibleElements: !0, panOnScroll: !1, nodeTypes: N, edgeTypes: x, onInit: (b) => b.fitView(), onNodesChange: j, onEdgesChange: X, ...tt("flow", m), nodes: K, edges: R, children: [
|
|
419
|
+
/* @__PURE__ */ z(rt, { variant: at.Dots, color: "rgba(255,255,255, .05)", gap: 8, size: 2 }),
|
|
420
|
+
/* @__PURE__ */ z(pt, {}),
|
|
421
|
+
/* @__PURE__ */ z(wt, {}),
|
|
422
|
+
/* @__PURE__ */ z(yt, { flowId: "gid://sagittarius/Flow/1" }),
|
|
423
|
+
/* @__PURE__ */ z(mt, { flowId: F })
|
|
388
424
|
] });
|
|
389
425
|
};
|
|
390
426
|
export {
|
|
391
|
-
|
|
427
|
+
Gt as DFlow
|
|
392
428
|
};
|