dishui 0.0.56 → 0.0.59
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/components/Select/index.js +90 -72
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/pro/Flow/Flow.js +659 -552
- package/dist/components/pro/Flow/Flow.js.map +1 -1
- package/dist/components/pro/Flow/FlowCanvas.js +1041 -966
- package/dist/components/pro/Flow/FlowCanvas.js.map +1 -1
- package/dist/components/pro/Flow/canvas/ViewportContainer.d.ts +6 -0
- package/dist/components/pro/Flow/canvas/ViewportContainer.js +20 -15
- package/dist/components/pro/Flow/canvas/ViewportContainer.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowUIContext.d.ts +6 -2
- package/dist/components/pro/Flow/context/FlowUIContext.js +51 -51
- package/dist/components/pro/Flow/context/FlowUIContext.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useCompactMode.d.ts +13 -0
- package/dist/components/pro/Flow/hooks/useCompactMode.js +20 -0
- package/dist/components/pro/Flow/hooks/useCompactMode.js.map +1 -0
- package/dist/components/pro/Flow/hooks/useDraggablePanel.d.ts +19 -4
- package/dist/components/pro/Flow/hooks/useDraggablePanel.js +31 -24
- package/dist/components/pro/Flow/hooks/useDraggablePanel.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useMindMap.js +16 -22
- package/dist/components/pro/Flow/hooks/useMindMap.js.map +1 -1
- package/dist/components/pro/Flow/hooks/usePixiApp.js +16 -16
- package/dist/components/pro/Flow/hooks/usePixiApp.js.map +1 -1
- package/dist/components/pro/Flow/nodes/nodeUtils.d.ts +2 -2
- package/dist/components/pro/Flow/nodes/nodeUtils.js +12 -12
- package/dist/components/pro/Flow/nodes/nodeUtils.js.map +1 -1
- package/dist/components/pro/Flow/panels/FlowPanelGroup.d.ts +10 -5
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js +95 -67
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js.map +1 -1
- package/dist/dishui.css +1 -1
- package/dist/utils/i18n.js +10 -0
- package/dist/utils/i18n.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,58 +1,84 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import ge from "../../Select/index.js";
|
|
2
|
+
import we from "../CodeEditor/editors/CodeEditor.js";
|
|
3
|
+
import { DEFAULT_NODE_DATA as se, ROOT_CANVAS_ID as Ie, createEmptyDocument as ve } from "./constants.js";
|
|
4
|
+
import { FlowProvider as ye, useFlowContext as ee } from "./context/FlowContext.js";
|
|
5
|
+
import { FlowUIProvider as be, useFlowUI as Y } from "./context/FlowUIContext.js";
|
|
6
|
+
import { FlowAIProvider as xe } from "./context/FlowAIContext.js";
|
|
6
7
|
import { generateId as Q } from "./nodes/nodeUtils.js";
|
|
7
|
-
import { normalizeEdgeHandles as
|
|
8
|
-
import
|
|
9
|
-
import { downloadDataURL as
|
|
10
|
-
import
|
|
11
|
-
import { MediaStampContent as
|
|
12
|
-
import { InspectorPanelContent as
|
|
13
|
-
import { OutlinePanelContent as
|
|
14
|
-
import { AIPanelContent as
|
|
15
|
-
import { PresentationMode as
|
|
16
|
-
import { MediaOverlay as
|
|
8
|
+
import { normalizeEdgeHandles as Se } from "./edges/edgePaths.js";
|
|
9
|
+
import Ce from "./FlowCanvas.js";
|
|
10
|
+
import { downloadDataURL as Me, safeFileBaseName as Pe } from "./hooks/useFlowImportExport.js";
|
|
11
|
+
import Ne, { FlowZoomControls as ke } from "./panels/FlowToolbar.js";
|
|
12
|
+
import { MediaStampContent as De, ShapePaletteContent as ze, SvgStampContent as Ee } from "./panels/ShapePalette.js";
|
|
13
|
+
import { InspectorPanelContent as Ae } from "./panels/InspectorPanel.js";
|
|
14
|
+
import { OutlinePanelContent as Te } from "./panels/OutlinePanel.js";
|
|
15
|
+
import { AIPanelContent as Re } from "./panels/AIPanel.js";
|
|
16
|
+
import { PresentationMode as Le } from "./panels/PresentationMode.js";
|
|
17
|
+
import { MediaOverlay as Fe } from "./nodes/MediaOverlay.js";
|
|
17
18
|
import q from "./panels/FlowPanelGroup.js";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import { MiniMapRenderer as
|
|
21
|
-
import { useUndoRedo as
|
|
22
|
-
import { useClipboard as
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
19
|
+
import Ge from "./panels/Breadcrumb.js";
|
|
20
|
+
import Ke from "./panels/ContextMenu.js";
|
|
21
|
+
import { MiniMapRenderer as We } from "./canvas/MiniMapRenderer.js";
|
|
22
|
+
import { useUndoRedo as He } from "./hooks/useUndoRedo.js";
|
|
23
|
+
import { useClipboard as ae } from "./hooks/useClipboard.js";
|
|
24
|
+
import { useCompactMode as Ue } from "./hooks/useCompactMode.js";
|
|
25
|
+
import { usePdfExport as Ze } from "./hooks/usePdfExport.js";
|
|
26
|
+
import { useKeyboardShortcuts as $e } from "./hooks/useKeyboardShortcuts.js";
|
|
27
|
+
import { useMindMap as Je } from "./hooks/useMindMap.js";
|
|
26
28
|
/* empty css */
|
|
27
|
-
import { forwardRef as
|
|
28
|
-
import { jsx as
|
|
29
|
-
import { EditorView as
|
|
30
|
-
function
|
|
31
|
-
let
|
|
32
|
-
const
|
|
33
|
-
for (const [
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
const
|
|
37
|
-
return
|
|
38
|
-
...
|
|
29
|
+
import { forwardRef as Oe, useCallback as D, useEffect as X, useImperativeHandle as _e, useMemo as le, useRef as R, useState as j } from "react";
|
|
30
|
+
import { jsx as a, jsxs as O } from "react/jsx-runtime";
|
|
31
|
+
import { EditorView as Be } from "@codemirror/view";
|
|
32
|
+
function Ve(s) {
|
|
33
|
+
let m = !1;
|
|
34
|
+
const d = { ...s.canvases };
|
|
35
|
+
for (const [I, f] of Object.entries(d)) {
|
|
36
|
+
const i = f.nodes.map((t) => {
|
|
37
|
+
if (t.type !== "shapeSvg") return t;
|
|
38
|
+
const g = t.data.labelPlacement, u = g === "above" ? "top" : g === "center" ? "middle" : g === "below" ? "bottom" : t.data.labelPlacement;
|
|
39
|
+
return u === t.data.labelPlacement ? t : (m = !0, {
|
|
40
|
+
...t,
|
|
39
41
|
data: {
|
|
40
|
-
...
|
|
41
|
-
labelPlacement:
|
|
42
|
+
...t.data,
|
|
43
|
+
labelPlacement: u
|
|
42
44
|
}
|
|
43
45
|
});
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
});
|
|
47
|
+
let l = !1;
|
|
48
|
+
const o = i.map((t) => {
|
|
49
|
+
if (!t.data.isMindMapNode) return t;
|
|
50
|
+
const g = t.data.fill === "#ffffff" || t.data.fill === "#eef2ff" ? "theme:base-100" : t.data.fill, u = t.data.stroke === "#6366f1" ? "theme:base-content" : t.data.stroke === "#4f46e5" ? "theme:primary" : t.data.stroke;
|
|
51
|
+
return g === t.data.fill && u === t.data.stroke ? t : (l = !0, {
|
|
52
|
+
...t,
|
|
53
|
+
data: {
|
|
54
|
+
...t.data,
|
|
55
|
+
fill: g,
|
|
56
|
+
stroke: u
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}), h = /* @__PURE__ */ new Map();
|
|
60
|
+
for (const t of o) h.set(t.id, t);
|
|
61
|
+
let c = !1;
|
|
62
|
+
const v = Se(f.edges, h).map((t) => {
|
|
63
|
+
if (t.data.strokeColor !== "#94a3b8") return t;
|
|
64
|
+
const g = h.get(t.source), u = h.get(t.target);
|
|
65
|
+
return !g?.data.isMindMapNode || !u?.data.isMindMapNode ? t : (c = !0, {
|
|
66
|
+
...t,
|
|
67
|
+
data: {
|
|
68
|
+
...t.data,
|
|
69
|
+
strokeColor: "theme:base-content"
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
(l || c) && (m = !0), (o !== i || v !== f.edges) && (d[I] = {
|
|
74
|
+
...f,
|
|
75
|
+
nodes: o,
|
|
76
|
+
edges: v
|
|
77
|
+
});
|
|
52
78
|
}
|
|
53
|
-
return
|
|
79
|
+
return m ? {
|
|
54
80
|
...s,
|
|
55
|
-
canvases:
|
|
81
|
+
canvases: d
|
|
56
82
|
} : s;
|
|
57
83
|
}
|
|
58
84
|
var ce = {
|
|
@@ -60,220 +86,220 @@ var ce = {
|
|
|
60
86
|
edgeIds: /* @__PURE__ */ new Set(),
|
|
61
87
|
lineIds: /* @__PURE__ */ new Set()
|
|
62
88
|
};
|
|
63
|
-
function
|
|
64
|
-
const { selection:
|
|
65
|
-
const { nodeIds:
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
return
|
|
69
|
-
...
|
|
89
|
+
function je({ onUndo: s, onRedo: m, groupRef: d, geoGroupRef: I, ungroupRef: f }) {
|
|
90
|
+
const { selection: i, setSelection: l, currentCanvas: o, setDoc: h, currentCanvasId: c } = ee(), { viewport: v } = Y(), { copy: t, cut: g, paste: u, duplicate: y } = ae(), b = D(() => {
|
|
91
|
+
const { nodeIds: r, edgeIds: p, lineIds: S } = i;
|
|
92
|
+
r.size === 0 && p.size === 0 && S.size === 0 || r.size > 1 && !window.confirm(`确定要删除选中的 ${r.size} 个节点吗?`) || (h((k) => {
|
|
93
|
+
const e = k.canvases[c];
|
|
94
|
+
return e ? {
|
|
95
|
+
...k,
|
|
70
96
|
canvases: {
|
|
71
|
-
...
|
|
72
|
-
[
|
|
73
|
-
...
|
|
74
|
-
nodes:
|
|
75
|
-
...
|
|
97
|
+
...k.canvases,
|
|
98
|
+
[c]: {
|
|
99
|
+
...e,
|
|
100
|
+
nodes: e.nodes.filter((n) => !r.has(n.id)).map((n) => n.parentId && r.has(n.parentId) ? {
|
|
101
|
+
...n,
|
|
76
102
|
parentId: void 0
|
|
77
|
-
} :
|
|
78
|
-
edges:
|
|
79
|
-
lines:
|
|
80
|
-
...
|
|
103
|
+
} : n),
|
|
104
|
+
edges: e.edges.filter((n) => !p.has(n.id) && !r.has(n.source) && !r.has(n.target)),
|
|
105
|
+
lines: e.lines.filter((n) => !S.has(n.id)).map((n) => n.parentId && r.has(n.parentId) ? {
|
|
106
|
+
...n,
|
|
81
107
|
parentId: void 0
|
|
82
|
-
} :
|
|
108
|
+
} : n)
|
|
83
109
|
}
|
|
84
110
|
}
|
|
85
|
-
} :
|
|
86
|
-
}),
|
|
111
|
+
} : k;
|
|
112
|
+
}), l(ce));
|
|
87
113
|
}, [
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
]),
|
|
93
|
-
|
|
94
|
-
nodeIds: new Set(
|
|
95
|
-
edgeIds: new Set(
|
|
96
|
-
lineIds: new Set(
|
|
114
|
+
i,
|
|
115
|
+
h,
|
|
116
|
+
c,
|
|
117
|
+
l
|
|
118
|
+
]), w = D(() => {
|
|
119
|
+
l({
|
|
120
|
+
nodeIds: new Set(o.nodes.map((r) => r.id)),
|
|
121
|
+
edgeIds: new Set(o.edges.map((r) => r.id)),
|
|
122
|
+
lineIds: new Set(o.lines.map((r) => r.id))
|
|
97
123
|
});
|
|
98
|
-
}, [
|
|
99
|
-
const
|
|
100
|
-
if (
|
|
101
|
-
const
|
|
102
|
-
let
|
|
103
|
-
for (const
|
|
104
|
-
|
|
105
|
-
for (const
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
id:
|
|
109
|
-
type:
|
|
124
|
+
}, [o, l]), C = D((r) => {
|
|
125
|
+
const p = i.nodeIds, S = i.lineIds;
|
|
126
|
+
if (p.size + S.size < 2) return;
|
|
127
|
+
const k = o.nodes.filter((N) => p.has(N.id)), e = o.lines.filter((N) => S.has(N.id)), n = 20;
|
|
128
|
+
let x = 1 / 0, W = 1 / 0, T = -1 / 0, H = -1 / 0;
|
|
129
|
+
for (const N of k)
|
|
130
|
+
x = Math.min(x, N.position.x), W = Math.min(W, N.position.y), T = Math.max(T, N.position.x + N.width), H = Math.max(H, N.position.y + N.height);
|
|
131
|
+
for (const N of e) for (const z of N.points)
|
|
132
|
+
x = Math.min(x, z.x), W = Math.min(W, z.y), T = Math.max(T, z.x), H = Math.max(H, z.y);
|
|
133
|
+
const U = r === "geometryGroup", Z = Q("group"), P = {
|
|
134
|
+
id: Z,
|
|
135
|
+
type: r,
|
|
110
136
|
position: {
|
|
111
|
-
x:
|
|
112
|
-
y:
|
|
137
|
+
x: x - n,
|
|
138
|
+
y: W - n
|
|
113
139
|
},
|
|
114
|
-
width: T -
|
|
115
|
-
height:
|
|
140
|
+
width: T - x + n * 2,
|
|
141
|
+
height: H - W + n * 2,
|
|
116
142
|
data: {
|
|
117
|
-
...
|
|
118
|
-
label:
|
|
119
|
-
fill:
|
|
143
|
+
...se,
|
|
144
|
+
label: U ? "Geo Group" : "Group",
|
|
145
|
+
fill: U ? "#fefce8" : "#f0f9ff",
|
|
120
146
|
stroke: "#9ca3af",
|
|
121
147
|
strokeWidth: 1.5,
|
|
122
|
-
borderStyle:
|
|
148
|
+
borderStyle: U ? "dashed" : "dotted",
|
|
123
149
|
isGroup: !0
|
|
124
150
|
}
|
|
125
151
|
};
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
return
|
|
129
|
-
...
|
|
152
|
+
h((N) => {
|
|
153
|
+
const z = N.canvases[c];
|
|
154
|
+
return z ? {
|
|
155
|
+
...N,
|
|
130
156
|
canvases: {
|
|
131
|
-
...
|
|
132
|
-
[
|
|
133
|
-
...
|
|
134
|
-
nodes:
|
|
135
|
-
...
|
|
136
|
-
parentId:
|
|
137
|
-
} :
|
|
138
|
-
lines:
|
|
139
|
-
...
|
|
140
|
-
parentId:
|
|
141
|
-
} :
|
|
157
|
+
...N.canvases,
|
|
158
|
+
[c]: {
|
|
159
|
+
...z,
|
|
160
|
+
nodes: U ? [P, ...z.nodes] : [P, ...z.nodes.map((J) => p.has(J.id) ? {
|
|
161
|
+
...J,
|
|
162
|
+
parentId: Z
|
|
163
|
+
} : J)],
|
|
164
|
+
lines: U ? z.lines : z.lines.map((J) => S.has(J.id) ? {
|
|
165
|
+
...J,
|
|
166
|
+
parentId: Z
|
|
167
|
+
} : J)
|
|
142
168
|
}
|
|
143
169
|
}
|
|
144
|
-
} :
|
|
145
|
-
}),
|
|
146
|
-
nodeIds: /* @__PURE__ */ new Set([
|
|
170
|
+
} : N;
|
|
171
|
+
}), l({
|
|
172
|
+
nodeIds: /* @__PURE__ */ new Set([Z]),
|
|
147
173
|
edgeIds: /* @__PURE__ */ new Set(),
|
|
148
174
|
lineIds: /* @__PURE__ */ new Set()
|
|
149
175
|
});
|
|
150
176
|
}, [
|
|
151
|
-
|
|
152
|
-
e,
|
|
153
|
-
d,
|
|
177
|
+
i,
|
|
154
178
|
o,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
179
|
+
h,
|
|
180
|
+
c,
|
|
181
|
+
l
|
|
182
|
+
]), G = D(() => C("flowGroup"), [C]), L = D(() => C("geometryGroup"), [C]), K = D(() => {
|
|
183
|
+
const r = i.nodeIds;
|
|
184
|
+
if (r.size === 0) return;
|
|
185
|
+
const p = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Set(), k = /* @__PURE__ */ new Set();
|
|
186
|
+
for (const e of o.nodes) r.has(e.id) && (e.type === "flowGroup" || e.type === "geometryGroup" || e.data.isGroup) && p.add(e.id);
|
|
187
|
+
if (p.size !== 0) {
|
|
188
|
+
for (const e of o.nodes) e.parentId && p.has(e.parentId) && S.add(e.id);
|
|
189
|
+
for (const e of o.lines) e.parentId && p.has(e.parentId) && k.add(e.id);
|
|
190
|
+
h((e) => {
|
|
191
|
+
const n = e.canvases[c];
|
|
192
|
+
return n ? {
|
|
193
|
+
...e,
|
|
168
194
|
canvases: {
|
|
169
|
-
...
|
|
170
|
-
[
|
|
171
|
-
...
|
|
172
|
-
nodes:
|
|
173
|
-
...
|
|
195
|
+
...e.canvases,
|
|
196
|
+
[c]: {
|
|
197
|
+
...n,
|
|
198
|
+
nodes: n.nodes.filter((x) => !p.has(x.id)).map((x) => S.has(x.id) ? {
|
|
199
|
+
...x,
|
|
174
200
|
parentId: void 0
|
|
175
|
-
} :
|
|
176
|
-
lines:
|
|
177
|
-
...
|
|
201
|
+
} : x),
|
|
202
|
+
lines: n.lines.map((x) => k.has(x.id) ? {
|
|
203
|
+
...x,
|
|
178
204
|
parentId: void 0
|
|
179
|
-
} :
|
|
205
|
+
} : x)
|
|
180
206
|
}
|
|
181
207
|
}
|
|
182
|
-
} :
|
|
183
|
-
}),
|
|
184
|
-
nodeIds:
|
|
208
|
+
} : e;
|
|
209
|
+
}), l({
|
|
210
|
+
nodeIds: S,
|
|
185
211
|
edgeIds: /* @__PURE__ */ new Set(),
|
|
186
|
-
lineIds:
|
|
212
|
+
lineIds: k
|
|
187
213
|
});
|
|
188
214
|
}
|
|
189
215
|
}, [
|
|
190
|
-
|
|
191
|
-
e,
|
|
192
|
-
d,
|
|
216
|
+
i,
|
|
193
217
|
o,
|
|
194
|
-
|
|
218
|
+
h,
|
|
219
|
+
c,
|
|
220
|
+
l
|
|
195
221
|
]);
|
|
196
|
-
|
|
197
|
-
const
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
const
|
|
201
|
-
if (!
|
|
202
|
-
const
|
|
222
|
+
d.current = G, I.current = L, f.current = K;
|
|
223
|
+
const M = D((r) => {
|
|
224
|
+
const p = i.nodeIds, S = i.lineIds;
|
|
225
|
+
p.size === 0 && S.size === 0 || h((k) => {
|
|
226
|
+
const e = k.canvases[c];
|
|
227
|
+
if (!e) return k;
|
|
228
|
+
const n = e.nodes.map((P) => P.zIndex ?? 0), x = n.length > 0 ? Math.max(...n) : 0, W = n.length > 0 ? Math.min(...n) : 0, T = e.lines.map((P) => P.zIndex ?? 0), H = T.length > 0 ? Math.max(...T) : 0, U = T.length > 0 ? Math.min(...T) : 0, Z = (P, N, z) => r === "front" ? N + 1 : r === "back" ? z - 1 : r === "up" ? P + 1 : P - 1;
|
|
203
229
|
return {
|
|
204
|
-
...
|
|
230
|
+
...k,
|
|
205
231
|
canvases: {
|
|
206
|
-
...
|
|
207
|
-
[
|
|
208
|
-
...
|
|
209
|
-
nodes:
|
|
210
|
-
...
|
|
211
|
-
zIndex:
|
|
212
|
-
} :
|
|
213
|
-
lines:
|
|
214
|
-
...
|
|
215
|
-
zIndex:
|
|
216
|
-
} :
|
|
232
|
+
...k.canvases,
|
|
233
|
+
[c]: {
|
|
234
|
+
...e,
|
|
235
|
+
nodes: e.nodes.map((P) => p.has(P.id) ? {
|
|
236
|
+
...P,
|
|
237
|
+
zIndex: Z(P.zIndex ?? 0, x, W)
|
|
238
|
+
} : P),
|
|
239
|
+
lines: e.lines.map((P) => S.has(P.id) ? {
|
|
240
|
+
...P,
|
|
241
|
+
zIndex: Z(P.zIndex ?? 0, H, U)
|
|
242
|
+
} : P)
|
|
217
243
|
}
|
|
218
244
|
}
|
|
219
245
|
};
|
|
220
246
|
});
|
|
221
247
|
}, [
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
248
|
+
i,
|
|
249
|
+
h,
|
|
250
|
+
c
|
|
225
251
|
]);
|
|
226
|
-
return
|
|
227
|
-
const
|
|
228
|
-
const
|
|
229
|
-
if (
|
|
230
|
-
const
|
|
231
|
-
if (!
|
|
232
|
-
|
|
252
|
+
return X(() => {
|
|
253
|
+
const r = (p) => {
|
|
254
|
+
const S = p.target;
|
|
255
|
+
if (S?.tagName === "INPUT" || S?.tagName === "TEXTAREA" || S?.isContentEditable) return;
|
|
256
|
+
const k = Array.from(p.clipboardData?.items ?? []).find((x) => x.type.startsWith("image/"));
|
|
257
|
+
if (!k) {
|
|
258
|
+
p.preventDefault(), u();
|
|
233
259
|
return;
|
|
234
260
|
}
|
|
235
|
-
const
|
|
236
|
-
if (!
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
if (typeof
|
|
241
|
-
const
|
|
242
|
-
if (
|
|
243
|
-
|
|
244
|
-
const
|
|
245
|
-
return
|
|
246
|
-
...
|
|
261
|
+
const e = k.getAsFile();
|
|
262
|
+
if (!e) return;
|
|
263
|
+
p.preventDefault();
|
|
264
|
+
const n = new FileReader();
|
|
265
|
+
n.onload = () => {
|
|
266
|
+
if (typeof n.result != "string") return;
|
|
267
|
+
const x = i.nodeIds.size === 1 ? o.nodes.find((E) => i.nodeIds.has(E.id) && E.type === "mediaNode" && E.data.mediaKind === "image") : void 0;
|
|
268
|
+
if (x) {
|
|
269
|
+
h((E) => {
|
|
270
|
+
const _ = E.canvases[c];
|
|
271
|
+
return _ ? {
|
|
272
|
+
...E,
|
|
247
273
|
canvases: {
|
|
248
|
-
...
|
|
249
|
-
[
|
|
250
|
-
...
|
|
251
|
-
nodes:
|
|
252
|
-
...
|
|
274
|
+
...E.canvases,
|
|
275
|
+
[c]: {
|
|
276
|
+
..._,
|
|
277
|
+
nodes: _.nodes.map((V) => V.id === x.id ? {
|
|
278
|
+
...V,
|
|
253
279
|
data: {
|
|
254
|
-
...
|
|
255
|
-
mediaContent:
|
|
280
|
+
...V.data,
|
|
281
|
+
mediaContent: n.result
|
|
256
282
|
}
|
|
257
|
-
} :
|
|
283
|
+
} : V)
|
|
258
284
|
}
|
|
259
285
|
}
|
|
260
|
-
} :
|
|
286
|
+
} : E;
|
|
261
287
|
});
|
|
262
288
|
return;
|
|
263
289
|
}
|
|
264
|
-
const
|
|
265
|
-
id:
|
|
290
|
+
const W = Q("node"), T = 320, H = 220, U = window.innerWidth, Z = window.innerHeight, P = (U / 2 - v.x) / v.zoom, N = (Z / 2 - v.y) / v.zoom, z = Math.max(0, ...o.nodes.map((E) => E.zIndex ?? 0)), J = {
|
|
291
|
+
id: W,
|
|
266
292
|
type: "mediaNode",
|
|
267
293
|
position: {
|
|
268
|
-
x:
|
|
269
|
-
y:
|
|
294
|
+
x: P - T / 2,
|
|
295
|
+
y: N - H / 2
|
|
270
296
|
},
|
|
271
297
|
width: T,
|
|
272
|
-
height:
|
|
273
|
-
zIndex:
|
|
298
|
+
height: H,
|
|
299
|
+
zIndex: z + 1,
|
|
274
300
|
data: {
|
|
275
|
-
...
|
|
276
|
-
label:
|
|
301
|
+
...se,
|
|
302
|
+
label: e.name || "Image",
|
|
277
303
|
fill: "theme:base-100",
|
|
278
304
|
stroke: "theme:base-content",
|
|
279
305
|
strokeWidth: 1.5,
|
|
@@ -281,180 +307,182 @@ function Je({ onUndo: s, onRedo: p, groupRef: l, geoGroupRef: w, ungroupRef: i }
|
|
|
281
307
|
fontSize: 13,
|
|
282
308
|
borderStyle: "solid",
|
|
283
309
|
mediaKind: "image",
|
|
284
|
-
mediaContent:
|
|
310
|
+
mediaContent: n.result
|
|
285
311
|
}
|
|
286
312
|
};
|
|
287
|
-
|
|
288
|
-
const
|
|
289
|
-
return
|
|
290
|
-
...
|
|
313
|
+
h((E) => {
|
|
314
|
+
const _ = E.canvases[c];
|
|
315
|
+
return _ ? {
|
|
316
|
+
...E,
|
|
291
317
|
canvases: {
|
|
292
|
-
...
|
|
293
|
-
[
|
|
294
|
-
...
|
|
295
|
-
nodes: [...
|
|
318
|
+
...E.canvases,
|
|
319
|
+
[c]: {
|
|
320
|
+
..._,
|
|
321
|
+
nodes: [..._.nodes, J]
|
|
296
322
|
}
|
|
297
323
|
}
|
|
298
|
-
} :
|
|
299
|
-
}),
|
|
300
|
-
nodeIds: /* @__PURE__ */ new Set([
|
|
324
|
+
} : E;
|
|
325
|
+
}), l({
|
|
326
|
+
nodeIds: /* @__PURE__ */ new Set([W]),
|
|
301
327
|
edgeIds: /* @__PURE__ */ new Set(),
|
|
302
328
|
lineIds: /* @__PURE__ */ new Set()
|
|
303
329
|
});
|
|
304
|
-
},
|
|
330
|
+
}, n.readAsDataURL(e);
|
|
305
331
|
};
|
|
306
|
-
return window.addEventListener("paste",
|
|
332
|
+
return window.addEventListener("paste", r), () => window.removeEventListener("paste", r);
|
|
307
333
|
}, [
|
|
308
|
-
e,
|
|
309
334
|
o,
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
335
|
+
c,
|
|
336
|
+
u,
|
|
337
|
+
i,
|
|
338
|
+
h,
|
|
339
|
+
l,
|
|
340
|
+
v
|
|
341
|
+
]), $e(le(() => ({
|
|
316
342
|
undo: s,
|
|
317
|
-
redo:
|
|
318
|
-
copy:
|
|
319
|
-
cut:
|
|
320
|
-
paste:
|
|
321
|
-
duplicate:
|
|
322
|
-
deleteSelected:
|
|
323
|
-
selectAll:
|
|
324
|
-
group:
|
|
325
|
-
geoGroup:
|
|
326
|
-
ungroup:
|
|
327
|
-
bringToFront: () =>
|
|
328
|
-
bringForward: () =>
|
|
329
|
-
sendBackward: () =>
|
|
330
|
-
sendToBack: () =>
|
|
343
|
+
redo: m,
|
|
344
|
+
copy: t,
|
|
345
|
+
cut: g,
|
|
346
|
+
paste: u,
|
|
347
|
+
duplicate: y,
|
|
348
|
+
deleteSelected: b,
|
|
349
|
+
selectAll: w,
|
|
350
|
+
group: G,
|
|
351
|
+
geoGroup: L,
|
|
352
|
+
ungroup: K,
|
|
353
|
+
bringToFront: () => M("front"),
|
|
354
|
+
bringForward: () => M("up"),
|
|
355
|
+
sendBackward: () => M("down"),
|
|
356
|
+
sendToBack: () => M("back")
|
|
331
357
|
}), [
|
|
332
358
|
s,
|
|
333
|
-
|
|
359
|
+
m,
|
|
360
|
+
t,
|
|
361
|
+
g,
|
|
334
362
|
u,
|
|
335
|
-
|
|
363
|
+
y,
|
|
336
364
|
b,
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
E
|
|
344
|
-
])), Ke(), null;
|
|
365
|
+
w,
|
|
366
|
+
G,
|
|
367
|
+
L,
|
|
368
|
+
K,
|
|
369
|
+
M
|
|
370
|
+
])), Je(), null;
|
|
345
371
|
}
|
|
346
|
-
function
|
|
347
|
-
return
|
|
372
|
+
function Xe({ pixiRef: s, exportPdfRef: m }) {
|
|
373
|
+
return m.current = Ze(s), null;
|
|
348
374
|
}
|
|
349
|
-
var
|
|
350
|
-
const [
|
|
351
|
-
|
|
352
|
-
const
|
|
353
|
-
|
|
354
|
-
exportPNG: async (
|
|
355
|
-
const
|
|
356
|
-
return !
|
|
375
|
+
var Kt = Oe(function({ initialDocument: m, onChange: d, width: I, height: f, readOnly: i = !1, onBack: l, onExportPNG: o, onPublish: h, showMiniMap: c = !0, showGrid: v = !0, gridSize: t = 20, className: g, showAI: u = !0, showAIConfig: y = !0, aiConfig: b }, w) {
|
|
376
|
+
const [C, G] = j(() => Ve(m ?? ve())), [L, K] = j(ce), M = R(null), r = R(null), p = R(null), S = R(null), k = Ue(S), { wrappedSetDoc: e, undo: n, redo: x, canUndo: W, canRedo: T } = He(C, G), H = R(null), U = R(null), Z = R(null), P = R(null), N = R(d);
|
|
377
|
+
N.current = d;
|
|
378
|
+
const z = R(C);
|
|
379
|
+
z.current = C, _e(w, () => ({
|
|
380
|
+
exportPNG: async (F) => {
|
|
381
|
+
const A = M.current;
|
|
382
|
+
return !A || A.destroyed ? null : A.exportPNG(F);
|
|
357
383
|
},
|
|
358
|
-
getDocument: () =>
|
|
384
|
+
getDocument: () => z.current
|
|
359
385
|
}), []);
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
const
|
|
363
|
-
return
|
|
386
|
+
const J = D((F) => {
|
|
387
|
+
e((A) => {
|
|
388
|
+
const B = typeof F == "function" ? F(A) : F;
|
|
389
|
+
return i ? B.canvases === A.canvases && B.title === A.title ? B : A : (queueMicrotask(() => N.current?.(B)), B);
|
|
364
390
|
});
|
|
365
|
-
}, [
|
|
366
|
-
|
|
367
|
-
}, [
|
|
368
|
-
|
|
369
|
-
}, [
|
|
370
|
-
|
|
371
|
-
}, []),
|
|
372
|
-
if (
|
|
373
|
-
const
|
|
374
|
-
if (!
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
}, [
|
|
378
|
-
await
|
|
391
|
+
}, [e, i]), E = D(() => {
|
|
392
|
+
i || n();
|
|
393
|
+
}, [i, n]), _ = D(() => {
|
|
394
|
+
i || x();
|
|
395
|
+
}, [i, x]), V = D((F) => {
|
|
396
|
+
M.current = F, r.current && !p.current && (p.current = new We(r.current));
|
|
397
|
+
}, []), ue = D(async () => {
|
|
398
|
+
if (o) return void o();
|
|
399
|
+
const F = M.current;
|
|
400
|
+
if (!F || F.destroyed) return;
|
|
401
|
+
const A = await F.exportPNG(16777215);
|
|
402
|
+
A && Me(A, `${Pe(z.current.title)}.png`);
|
|
403
|
+
}, [o]), fe = D(async () => {
|
|
404
|
+
await P.current?.();
|
|
379
405
|
}, []);
|
|
380
|
-
|
|
381
|
-
let
|
|
382
|
-
const
|
|
383
|
-
const
|
|
384
|
-
if (
|
|
385
|
-
const
|
|
386
|
-
x:
|
|
387
|
-
y:
|
|
388
|
-
zoom:
|
|
389
|
-
},
|
|
390
|
-
|
|
406
|
+
X(() => {
|
|
407
|
+
let F = !1, A = null;
|
|
408
|
+
const B = () => {
|
|
409
|
+
const $ = M.current, ne = p.current;
|
|
410
|
+
if (!$ || $.destroyed || !ne) return;
|
|
411
|
+
const me = {
|
|
412
|
+
x: $.world.position.x,
|
|
413
|
+
y: $.world.position.y,
|
|
414
|
+
zoom: $.world.scale.x
|
|
415
|
+
}, he = C.stack[C.stack.length - 1] ?? "root", oe = C.canvases[he];
|
|
416
|
+
oe && ne.update(oe.nodes, me, $.app.screen.width, $.app.screen.height);
|
|
391
417
|
}, te = () => {
|
|
392
|
-
if (
|
|
393
|
-
const
|
|
394
|
-
|
|
418
|
+
if (F) return;
|
|
419
|
+
const $ = M.current;
|
|
420
|
+
$ && !$.destroyed && p.current ? ($.app.ticker.add(B), A = $) : requestAnimationFrame(te);
|
|
395
421
|
};
|
|
396
422
|
return te(), () => {
|
|
397
|
-
|
|
423
|
+
F = !0, A && !A.destroyed && A.app.ticker.remove(B);
|
|
398
424
|
};
|
|
399
|
-
}, [
|
|
400
|
-
const
|
|
401
|
-
width:
|
|
402
|
-
height:
|
|
425
|
+
}, [C]);
|
|
426
|
+
const pe = {
|
|
427
|
+
width: I ?? "100%",
|
|
428
|
+
height: f ?? "100%"
|
|
403
429
|
};
|
|
404
|
-
return /* @__PURE__ */
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
430
|
+
return /* @__PURE__ */ a("div", {
|
|
431
|
+
ref: S,
|
|
432
|
+
className: `flow-container ${g ?? ""}`,
|
|
433
|
+
style: pe,
|
|
434
|
+
children: /* @__PURE__ */ a(ye, {
|
|
435
|
+
doc: C,
|
|
436
|
+
setDoc: J,
|
|
437
|
+
selection: L,
|
|
438
|
+
setSelection: K,
|
|
439
|
+
children: /* @__PURE__ */ a(be, {
|
|
440
|
+
showMiniMap: c,
|
|
441
|
+
showGrid: v,
|
|
442
|
+
gridSize: t,
|
|
443
|
+
showAI: u,
|
|
444
|
+
readOnly: i,
|
|
445
|
+
children: /* @__PURE__ */ O(xe, {
|
|
446
|
+
initialConfig: b,
|
|
447
|
+
showAIConfig: y,
|
|
421
448
|
children: [
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
-
onUndo:
|
|
424
|
-
onRedo:
|
|
425
|
-
groupRef:
|
|
426
|
-
geoGroupRef:
|
|
427
|
-
ungroupRef:
|
|
449
|
+
/* @__PURE__ */ a(je, {
|
|
450
|
+
onUndo: E,
|
|
451
|
+
onRedo: _,
|
|
452
|
+
groupRef: H,
|
|
453
|
+
geoGroupRef: U,
|
|
454
|
+
ungroupRef: Z
|
|
428
455
|
}),
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
pixiRef:
|
|
431
|
-
exportPdfRef:
|
|
456
|
+
/* @__PURE__ */ a(Xe, {
|
|
457
|
+
pixiRef: M,
|
|
458
|
+
exportPdfRef: P
|
|
432
459
|
}),
|
|
433
|
-
/* @__PURE__ */
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
460
|
+
/* @__PURE__ */ O(et, {
|
|
461
|
+
compact: k,
|
|
462
|
+
toolbar: i ? null : /* @__PURE__ */ a(Ne, {
|
|
463
|
+
onBack: l,
|
|
464
|
+
onUndo: E,
|
|
465
|
+
onRedo: _,
|
|
466
|
+
canUndo: W,
|
|
467
|
+
canRedo: T,
|
|
468
|
+
onGroup: () => H.current?.(),
|
|
469
|
+
onGeoGroup: () => U.current?.(),
|
|
470
|
+
onUngroup: () => Z.current?.(),
|
|
471
|
+
onExportPNG: ue,
|
|
472
|
+
onExportPDF: fe,
|
|
473
|
+
onPublish: h
|
|
446
474
|
}),
|
|
447
475
|
children: [
|
|
448
|
-
/* @__PURE__ */
|
|
449
|
-
/* @__PURE__ */
|
|
450
|
-
/* @__PURE__ */
|
|
451
|
-
!
|
|
452
|
-
/* @__PURE__ */
|
|
453
|
-
canvasRef:
|
|
454
|
-
pixiRef:
|
|
455
|
-
miniMapRef:
|
|
476
|
+
/* @__PURE__ */ a(Ce, { onPixiReady: V }),
|
|
477
|
+
/* @__PURE__ */ a(Fe, {}),
|
|
478
|
+
/* @__PURE__ */ O(Ye, { children: [!i && /* @__PURE__ */ a(ke, {}), /* @__PURE__ */ a(Ge, {})] }),
|
|
479
|
+
!i && /* @__PURE__ */ a(it, {}),
|
|
480
|
+
/* @__PURE__ */ a(tt, {
|
|
481
|
+
canvasRef: r,
|
|
482
|
+
pixiRef: M,
|
|
483
|
+
miniMapRef: p
|
|
456
484
|
}),
|
|
457
|
-
/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ a(Le, {})
|
|
458
486
|
]
|
|
459
487
|
})
|
|
460
488
|
]
|
|
@@ -463,171 +491,250 @@ var Nt = Ue(function({ initialDocument: p, onChange: l, width: w, height: i, rea
|
|
|
463
491
|
})
|
|
464
492
|
});
|
|
465
493
|
});
|
|
466
|
-
function
|
|
467
|
-
const { presentation:
|
|
468
|
-
return /* @__PURE__ */
|
|
494
|
+
function Ye({ children: s }) {
|
|
495
|
+
const { presentation: m } = Y();
|
|
496
|
+
return /* @__PURE__ */ a("div", {
|
|
469
497
|
className: "flow-overlay",
|
|
470
|
-
style: { display:
|
|
498
|
+
style: { display: m ? "none" : void 0 },
|
|
471
499
|
children: s
|
|
472
500
|
});
|
|
473
501
|
}
|
|
474
|
-
var
|
|
502
|
+
var qe = [
|
|
475
503
|
{
|
|
476
504
|
id: "shapes",
|
|
477
505
|
label: "Shapes",
|
|
478
506
|
icon: "▢",
|
|
479
|
-
side: "left",
|
|
480
507
|
showKey: "showPalette"
|
|
481
508
|
},
|
|
482
509
|
{
|
|
483
510
|
id: "icons",
|
|
484
511
|
label: "Icons",
|
|
485
512
|
icon: "★",
|
|
486
|
-
side: "left",
|
|
487
513
|
showKey: "showPalette"
|
|
488
514
|
},
|
|
489
515
|
{
|
|
490
516
|
id: "media",
|
|
491
517
|
label: "Media",
|
|
492
518
|
icon: "▶",
|
|
493
|
-
side: "left",
|
|
494
519
|
showKey: "showPalette"
|
|
495
520
|
},
|
|
496
521
|
{
|
|
497
522
|
id: "inspector",
|
|
498
523
|
label: "Inspector",
|
|
499
524
|
icon: "⚙",
|
|
500
|
-
side: "right",
|
|
501
525
|
showKey: "showInspector"
|
|
502
526
|
},
|
|
503
527
|
{
|
|
504
528
|
id: "outline",
|
|
505
529
|
label: "Outline",
|
|
506
530
|
icon: "☰",
|
|
507
|
-
side: "right",
|
|
508
531
|
showKey: "showOutline"
|
|
509
532
|
},
|
|
510
533
|
{
|
|
511
534
|
id: "json",
|
|
512
535
|
label: "JSON",
|
|
513
536
|
icon: "{ }",
|
|
514
|
-
side: "right",
|
|
515
537
|
showKey: "showJson"
|
|
516
538
|
},
|
|
517
539
|
{
|
|
518
540
|
id: "ai",
|
|
519
541
|
label: "AI",
|
|
520
542
|
icon: "✨",
|
|
521
|
-
side: "right",
|
|
522
543
|
showKey: "showAI"
|
|
523
544
|
}
|
|
524
545
|
];
|
|
525
|
-
function
|
|
546
|
+
function ie(s) {
|
|
526
547
|
switch (s) {
|
|
527
548
|
case "shapes":
|
|
528
|
-
return /* @__PURE__ */
|
|
549
|
+
return /* @__PURE__ */ a(ze, {});
|
|
529
550
|
case "icons":
|
|
530
|
-
return /* @__PURE__ */
|
|
551
|
+
return /* @__PURE__ */ a(Ee, {});
|
|
531
552
|
case "media":
|
|
532
|
-
return /* @__PURE__ */
|
|
553
|
+
return /* @__PURE__ */ a(De, {});
|
|
533
554
|
case "inspector":
|
|
534
|
-
return /* @__PURE__ */
|
|
555
|
+
return /* @__PURE__ */ a(Ae, {});
|
|
535
556
|
case "outline":
|
|
536
|
-
return /* @__PURE__ */
|
|
557
|
+
return /* @__PURE__ */ a(Te, {});
|
|
537
558
|
case "json":
|
|
538
|
-
return /* @__PURE__ */
|
|
559
|
+
return /* @__PURE__ */ a(st, {});
|
|
539
560
|
case "ai":
|
|
540
|
-
return /* @__PURE__ */
|
|
561
|
+
return /* @__PURE__ */ a(Re, {});
|
|
541
562
|
default:
|
|
542
563
|
return null;
|
|
543
564
|
}
|
|
544
565
|
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
566
|
+
var Qe = /* @__PURE__ */ new Set([
|
|
567
|
+
"shapes",
|
|
568
|
+
"icons",
|
|
569
|
+
"media"
|
|
570
|
+
]);
|
|
571
|
+
function et({ children: s, toolbar: m, compact: d }) {
|
|
572
|
+
const I = Y(), { panelDocks: f, setPanelDock: i, presentation: l, readOnly: o } = I, { setShowPalette: h, setShowInspector: c, setShowOutline: v, setShowJson: t, setShowAI: g } = I, u = o ? [] : qe.filter((e) => !e.showKey || I[e.showKey]), y = (e) => ({
|
|
573
|
+
id: e.id,
|
|
574
|
+
label: e.label,
|
|
575
|
+
icon: e.icon,
|
|
576
|
+
content: ie(e.id)
|
|
577
|
+
}), [b, w] = j(null), C = R(null);
|
|
578
|
+
X(() => {
|
|
579
|
+
if (!d) {
|
|
580
|
+
C.current = null;
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
const e = I.pendingPlacement, n = e ? `${e.type}:${e.data?.svgId ?? ""}:${e.data?.mediaKind ?? ""}` : null, x = C.current;
|
|
584
|
+
C.current = n, n && n !== x && b && Qe.has(b) && w(null);
|
|
585
|
+
}, [
|
|
586
|
+
I.pendingPlacement,
|
|
587
|
+
d,
|
|
588
|
+
b
|
|
589
|
+
]);
|
|
590
|
+
const [G, L] = j(null), K = D((e, n) => i(e, n), [i]), M = D((e) => {
|
|
591
|
+
e === "inspector" ? c(!1) : e === "outline" ? v(!1) : e === "json" ? t(!1) : e === "ai" ? g(!1) : h(!1);
|
|
592
|
+
}, [
|
|
593
|
+
c,
|
|
594
|
+
v,
|
|
595
|
+
t,
|
|
596
|
+
g,
|
|
597
|
+
h
|
|
598
|
+
]);
|
|
599
|
+
if (d && !l) {
|
|
600
|
+
const e = u.find((n) => n.id === b) ?? null;
|
|
601
|
+
return /* @__PURE__ */ O("div", {
|
|
602
|
+
className: "flow-workspace",
|
|
603
|
+
children: [
|
|
604
|
+
m,
|
|
605
|
+
u.length > 0 && /* @__PURE__ */ a("div", {
|
|
606
|
+
className: "flow-mobile-panel-bar",
|
|
607
|
+
children: /* @__PURE__ */ a(ge, {
|
|
608
|
+
placeholder: "选择面板…",
|
|
609
|
+
options: u.map((n) => ({
|
|
610
|
+
value: n.id,
|
|
611
|
+
label: n.label
|
|
612
|
+
})),
|
|
613
|
+
value: b ?? void 0,
|
|
614
|
+
onChange: (n) => w(String(n))
|
|
615
|
+
})
|
|
616
|
+
}),
|
|
617
|
+
/* @__PURE__ */ O("div", {
|
|
618
|
+
className: "flow-workspace-main",
|
|
619
|
+
children: [/* @__PURE__ */ a("div", {
|
|
620
|
+
className: "flow-stage",
|
|
621
|
+
children: s
|
|
622
|
+
}), e && /* @__PURE__ */ O("div", {
|
|
623
|
+
className: "flow-mobile-panel",
|
|
624
|
+
children: [/* @__PURE__ */ O("div", {
|
|
625
|
+
className: "flow-mobile-panel-header",
|
|
626
|
+
children: [/* @__PURE__ */ O("span", {
|
|
627
|
+
className: "flow-mobile-panel-title",
|
|
628
|
+
children: [e.icon && /* @__PURE__ */ a("span", {
|
|
629
|
+
className: "flow-panel-tab-icon",
|
|
630
|
+
children: e.icon
|
|
631
|
+
}), e.label]
|
|
632
|
+
}), /* @__PURE__ */ a("button", {
|
|
633
|
+
type: "button",
|
|
634
|
+
className: "flow-mobile-panel-close",
|
|
635
|
+
"aria-label": "关闭面板",
|
|
636
|
+
onClick: () => w(null),
|
|
637
|
+
children: "✕"
|
|
638
|
+
})]
|
|
639
|
+
}), /* @__PURE__ */ a("div", {
|
|
640
|
+
className: "flow-mobile-panel-body",
|
|
641
|
+
children: ie(e.id)
|
|
642
|
+
})]
|
|
643
|
+
})]
|
|
644
|
+
})
|
|
645
|
+
]
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
const r = (e) => f[e] ?? "left", p = u.filter((e) => r(e.id) === "left").map(y), S = u.filter((e) => r(e.id) === "right").map(y), k = u.filter((e) => r(e.id) === "float");
|
|
649
|
+
return /* @__PURE__ */ O("div", {
|
|
553
650
|
className: "flow-workspace",
|
|
554
|
-
children: [!
|
|
651
|
+
children: [!l && m, /* @__PURE__ */ O("div", {
|
|
555
652
|
className: "flow-workspace-main",
|
|
556
653
|
children: [
|
|
557
|
-
!
|
|
558
|
-
tabs:
|
|
559
|
-
defaultTab:
|
|
654
|
+
!l && p.length > 0 && /* @__PURE__ */ a(q, {
|
|
655
|
+
tabs: p,
|
|
656
|
+
defaultTab: p[0]?.id,
|
|
560
657
|
resizeEdge: "right",
|
|
561
|
-
defaultWidth:
|
|
562
|
-
|
|
658
|
+
defaultWidth: 220,
|
|
659
|
+
dock: "left",
|
|
660
|
+
onDock: K,
|
|
661
|
+
onClose: M
|
|
563
662
|
}),
|
|
564
|
-
/* @__PURE__ */
|
|
663
|
+
/* @__PURE__ */ a("div", {
|
|
565
664
|
className: "flow-stage",
|
|
566
665
|
children: s
|
|
567
666
|
}),
|
|
568
|
-
!
|
|
569
|
-
tabs:
|
|
570
|
-
defaultTab:
|
|
667
|
+
!l && S.length > 0 && /* @__PURE__ */ a(q, {
|
|
668
|
+
tabs: S,
|
|
669
|
+
defaultTab: S[0]?.id,
|
|
571
670
|
resizeEdge: "left",
|
|
572
671
|
defaultWidth: 220,
|
|
573
|
-
|
|
672
|
+
dock: "right",
|
|
673
|
+
onDock: K,
|
|
674
|
+
onClose: M
|
|
574
675
|
}),
|
|
575
|
-
!
|
|
576
|
-
tabs: [
|
|
676
|
+
!l && k.map((e, n) => /* @__PURE__ */ a(q, {
|
|
677
|
+
tabs: [y(e)],
|
|
577
678
|
resizeEdge: "right",
|
|
578
679
|
defaultWidth: 220,
|
|
680
|
+
dock: "float",
|
|
579
681
|
style: {
|
|
580
|
-
top: 48 +
|
|
581
|
-
left: 24 +
|
|
682
|
+
top: 48 + n * 40,
|
|
683
|
+
left: 24 + n * 30
|
|
582
684
|
},
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
685
|
+
onDock: K,
|
|
686
|
+
onClose: M,
|
|
687
|
+
onDragHintChange: L
|
|
688
|
+
}, e.id)),
|
|
689
|
+
!l && G && /* @__PURE__ */ a("div", {
|
|
690
|
+
className: `flow-dock-dropzone flow-dock-dropzone--${G}`,
|
|
691
|
+
children: /* @__PURE__ */ a("span", { children: G === "left" ? "⇤ 停靠左侧" : "停靠右侧 ⇥" })
|
|
692
|
+
})
|
|
586
693
|
]
|
|
587
694
|
})]
|
|
588
695
|
});
|
|
589
696
|
}
|
|
590
|
-
function
|
|
591
|
-
const { showMiniMap:
|
|
592
|
-
const
|
|
593
|
-
if (!
|
|
594
|
-
const
|
|
595
|
-
if (
|
|
596
|
-
const { width:
|
|
597
|
-
if (!
|
|
598
|
-
const
|
|
599
|
-
|
|
600
|
-
x:
|
|
601
|
-
y:
|
|
602
|
-
zoom:
|
|
697
|
+
function tt({ canvasRef: s, pixiRef: m, miniMapRef: d }) {
|
|
698
|
+
const { showMiniMap: I, setViewport: f, presentation: i } = Y(), l = R(!1), o = D((t, g) => {
|
|
699
|
+
const u = s.current, y = m.current, b = d.current;
|
|
700
|
+
if (!u || !y || y.destroyed || !b) return;
|
|
701
|
+
const w = u.getBoundingClientRect();
|
|
702
|
+
if (w.width === 0 || w.height === 0) return;
|
|
703
|
+
const { width: C, height: G } = b.size, L = (t - w.left) / w.width * C, K = (g - w.top) / w.height * G, M = b.minimapToWorld(L, K);
|
|
704
|
+
if (!M) return;
|
|
705
|
+
const r = y.world.scale.x || 1, p = y.app.screen.width, S = y.app.screen.height;
|
|
706
|
+
f({
|
|
707
|
+
x: p / 2 - M.x * r,
|
|
708
|
+
y: S / 2 - M.y * r,
|
|
709
|
+
zoom: r
|
|
603
710
|
});
|
|
604
711
|
}, [
|
|
605
712
|
s,
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
]),
|
|
610
|
-
|
|
611
|
-
}, [
|
|
612
|
-
|
|
613
|
-
}, [
|
|
614
|
-
|
|
713
|
+
m,
|
|
714
|
+
d,
|
|
715
|
+
f
|
|
716
|
+
]), h = D((t) => {
|
|
717
|
+
t.preventDefault(), t.currentTarget.setPointerCapture(t.pointerId), l.current = !0, o(t.clientX, t.clientY);
|
|
718
|
+
}, [o]), c = D((t) => {
|
|
719
|
+
l.current && o(t.clientX, t.clientY);
|
|
720
|
+
}, [o]), v = D((t) => {
|
|
721
|
+
l.current = !1;
|
|
615
722
|
try {
|
|
616
|
-
|
|
723
|
+
t.currentTarget.releasePointerCapture(t.pointerId);
|
|
617
724
|
} catch {
|
|
618
725
|
}
|
|
619
726
|
}, []);
|
|
620
|
-
return /* @__PURE__ */
|
|
727
|
+
return /* @__PURE__ */ a("div", {
|
|
621
728
|
className: "flow-minimap",
|
|
622
729
|
style: {
|
|
623
|
-
display:
|
|
730
|
+
display: I && !i ? void 0 : "none",
|
|
624
731
|
cursor: "pointer"
|
|
625
732
|
},
|
|
626
|
-
onPointerDown:
|
|
627
|
-
onPointerMove:
|
|
628
|
-
onPointerUp:
|
|
733
|
+
onPointerDown: h,
|
|
734
|
+
onPointerMove: c,
|
|
735
|
+
onPointerUp: v,
|
|
629
736
|
title: "点击或拖动以移动画布",
|
|
630
|
-
children: /* @__PURE__ */
|
|
737
|
+
children: /* @__PURE__ */ a("canvas", {
|
|
631
738
|
ref: s,
|
|
632
739
|
width: 180,
|
|
633
740
|
height: 120,
|
|
@@ -639,97 +746,97 @@ function $e({ canvasRef: s, pixiRef: p, miniMapRef: l }) {
|
|
|
639
746
|
})
|
|
640
747
|
});
|
|
641
748
|
}
|
|
642
|
-
function
|
|
643
|
-
const
|
|
644
|
-
if (
|
|
645
|
-
let
|
|
646
|
-
for (let
|
|
647
|
-
if (s[
|
|
648
|
-
if (
|
|
649
|
-
|
|
749
|
+
function nt(s, m) {
|
|
750
|
+
const d = `"id": "${m}"`, I = s.indexOf(d);
|
|
751
|
+
if (I === -1) return null;
|
|
752
|
+
let f = 0, i = -1;
|
|
753
|
+
for (let o = I; o >= 0; o--)
|
|
754
|
+
if (s[o] === "}" && f++, s[o] === "{") {
|
|
755
|
+
if (f === 0) {
|
|
756
|
+
i = o;
|
|
650
757
|
break;
|
|
651
758
|
}
|
|
652
|
-
|
|
759
|
+
f--;
|
|
653
760
|
}
|
|
654
|
-
if (
|
|
655
|
-
|
|
656
|
-
let
|
|
657
|
-
for (let
|
|
658
|
-
if (s[
|
|
659
|
-
|
|
761
|
+
if (i === -1) return null;
|
|
762
|
+
f = 0;
|
|
763
|
+
let l = -1;
|
|
764
|
+
for (let o = i; o < s.length; o++)
|
|
765
|
+
if (s[o] === "{" && f++, s[o] === "}" && (f--, f === 0)) {
|
|
766
|
+
l = o;
|
|
660
767
|
break;
|
|
661
768
|
}
|
|
662
|
-
return
|
|
663
|
-
startLine: s.slice(0,
|
|
769
|
+
return l === -1 ? null : {
|
|
770
|
+
startLine: s.slice(0, i).split(`
|
|
664
771
|
`).length,
|
|
665
|
-
endLine: s.slice(0,
|
|
772
|
+
endLine: s.slice(0, l + 1).split(`
|
|
666
773
|
`).length
|
|
667
774
|
};
|
|
668
775
|
}
|
|
669
|
-
function
|
|
670
|
-
s.querySelectorAll(".cm-line.flow-json-hl").forEach((
|
|
776
|
+
function re(s) {
|
|
777
|
+
s.querySelectorAll(".cm-line.flow-json-hl").forEach((m) => m.classList.remove("flow-json-hl"));
|
|
671
778
|
}
|
|
672
|
-
function
|
|
673
|
-
const
|
|
674
|
-
if (
|
|
675
|
-
for (let
|
|
676
|
-
const
|
|
677
|
-
|
|
779
|
+
function ot(s, m, d) {
|
|
780
|
+
const I = s.getView();
|
|
781
|
+
if (I)
|
|
782
|
+
for (let f = m; f <= d; f++) try {
|
|
783
|
+
const i = I.state.doc.line(f), l = I.domAtPos(i.from), o = l.node instanceof HTMLElement ? l.node.closest(".cm-line") : l.node.parentElement?.closest(".cm-line");
|
|
784
|
+
o && o.classList.add("flow-json-hl");
|
|
678
785
|
} catch {
|
|
679
786
|
}
|
|
680
787
|
}
|
|
681
|
-
function
|
|
682
|
-
const { setDoc: s, currentCanvasId:
|
|
683
|
-
|
|
684
|
-
if (
|
|
685
|
-
|
|
788
|
+
function st() {
|
|
789
|
+
const { setDoc: s, currentCanvasId: m, selection: d, currentCanvas: I } = ee(), [f, i] = j(""), [l, o] = j(null), h = R(!1), c = R(null), v = R(null), t = le(() => d.nodeIds.size + d.edgeIds.size + d.lineIds.size !== 1 ? null : d.nodeIds.size === 1 ? [...d.nodeIds][0] : d.edgeIds.size === 1 ? [...d.edgeIds][0] : d.lineIds.size === 1 ? [...d.lineIds][0] : null, [d]);
|
|
790
|
+
X(() => {
|
|
791
|
+
if (h.current) {
|
|
792
|
+
h.current = !1;
|
|
686
793
|
return;
|
|
687
794
|
}
|
|
688
|
-
|
|
689
|
-
}, [
|
|
690
|
-
const
|
|
691
|
-
if (
|
|
692
|
-
const
|
|
693
|
-
const
|
|
694
|
-
if (!
|
|
695
|
-
const
|
|
696
|
-
if (!
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
const
|
|
700
|
-
|
|
795
|
+
i(JSON.stringify(I, null, 2)), o(null);
|
|
796
|
+
}, [I]), X(() => {
|
|
797
|
+
const y = v.current;
|
|
798
|
+
if (y && re(y), !t) return;
|
|
799
|
+
const b = setTimeout(() => {
|
|
800
|
+
const w = nt(f, t);
|
|
801
|
+
if (!w || !v.current) return;
|
|
802
|
+
const C = c.current?.getView();
|
|
803
|
+
if (!C) return;
|
|
804
|
+
const G = v.current, L = C.scrollDOM;
|
|
805
|
+
L.style.scrollBehavior = "smooth";
|
|
806
|
+
const K = C.state.doc.line(w.startLine);
|
|
807
|
+
C.dispatch({ effects: Be.scrollIntoView(K.from, {
|
|
701
808
|
y: "start",
|
|
702
809
|
yMargin: 0
|
|
703
810
|
}) });
|
|
704
|
-
const
|
|
705
|
-
|
|
811
|
+
const M = () => {
|
|
812
|
+
L.style.scrollBehavior = "", re(G), ot(c.current, w.startLine, w.endLine);
|
|
706
813
|
};
|
|
707
|
-
let
|
|
708
|
-
const
|
|
709
|
-
clearTimeout(
|
|
814
|
+
let r;
|
|
815
|
+
const p = () => {
|
|
816
|
+
clearTimeout(r), r = setTimeout(M, 100);
|
|
710
817
|
};
|
|
711
|
-
|
|
712
|
-
|
|
818
|
+
L.addEventListener("scroll", p), r = setTimeout(() => {
|
|
819
|
+
L.removeEventListener("scroll", p), M();
|
|
713
820
|
}, 800);
|
|
714
821
|
}, 120);
|
|
715
|
-
return () => clearTimeout(
|
|
716
|
-
}, [
|
|
717
|
-
const
|
|
718
|
-
|
|
822
|
+
return () => clearTimeout(b);
|
|
823
|
+
}, [t, f]);
|
|
824
|
+
const g = D((y) => {
|
|
825
|
+
i(y);
|
|
719
826
|
try {
|
|
720
|
-
const
|
|
721
|
-
|
|
722
|
-
...
|
|
827
|
+
const b = JSON.parse(y);
|
|
828
|
+
b && Array.isArray(b.nodes) && Array.isArray(b.edges) && Array.isArray(b.lines) ? (o(null), h.current = !0, s((w) => ({
|
|
829
|
+
...w,
|
|
723
830
|
canvases: {
|
|
724
|
-
...
|
|
725
|
-
[
|
|
831
|
+
...w.canvases,
|
|
832
|
+
[m]: b
|
|
726
833
|
}
|
|
727
|
-
}))) :
|
|
728
|
-
} catch (
|
|
729
|
-
|
|
834
|
+
}))) : o("JSON must have nodes, edges, lines arrays");
|
|
835
|
+
} catch (b) {
|
|
836
|
+
o(b.message?.slice(0, 60) ?? "Invalid JSON");
|
|
730
837
|
}
|
|
731
|
-
}, [s,
|
|
732
|
-
return /* @__PURE__ */
|
|
838
|
+
}, [s, m]), u = t ? d.nodeIds.has(t) ? "Node" : d.edgeIds.has(t) ? "Edge" : "Line" : null;
|
|
839
|
+
return /* @__PURE__ */ O("div", {
|
|
733
840
|
style: {
|
|
734
841
|
display: "flex",
|
|
735
842
|
flexDirection: "column",
|
|
@@ -737,32 +844,32 @@ function Qe() {
|
|
|
737
844
|
minHeight: 0
|
|
738
845
|
},
|
|
739
846
|
children: [
|
|
740
|
-
/* @__PURE__ */
|
|
847
|
+
/* @__PURE__ */ a("div", {
|
|
741
848
|
className: "flow-json-header",
|
|
742
|
-
children: /* @__PURE__ */
|
|
849
|
+
children: /* @__PURE__ */ a("span", {
|
|
743
850
|
className: "flow-json-scope",
|
|
744
|
-
children:
|
|
851
|
+
children: u ? `${u}: ${t.slice(0, 8)}` : "Canvas"
|
|
745
852
|
})
|
|
746
853
|
}),
|
|
747
|
-
|
|
854
|
+
l && /* @__PURE__ */ a("div", {
|
|
748
855
|
style: {
|
|
749
856
|
fontSize: 11,
|
|
750
857
|
color: "oklch(var(--er))",
|
|
751
858
|
padding: "4px 0",
|
|
752
859
|
flexShrink: 0
|
|
753
860
|
},
|
|
754
|
-
children:
|
|
861
|
+
children: l
|
|
755
862
|
}),
|
|
756
|
-
/* @__PURE__ */
|
|
757
|
-
ref:
|
|
863
|
+
/* @__PURE__ */ a("div", {
|
|
864
|
+
ref: v,
|
|
758
865
|
style: {
|
|
759
866
|
flex: 1,
|
|
760
867
|
minHeight: 0
|
|
761
868
|
},
|
|
762
|
-
children: /* @__PURE__ */
|
|
763
|
-
ref:
|
|
764
|
-
value:
|
|
765
|
-
onChange:
|
|
869
|
+
children: /* @__PURE__ */ a(we, {
|
|
870
|
+
ref: c,
|
|
871
|
+
value: f,
|
|
872
|
+
onChange: g,
|
|
766
873
|
language: "json",
|
|
767
874
|
lineNumbers: !1,
|
|
768
875
|
height: "100%",
|
|
@@ -772,112 +879,112 @@ function Qe() {
|
|
|
772
879
|
]
|
|
773
880
|
});
|
|
774
881
|
}
|
|
775
|
-
function
|
|
776
|
-
const { contextMenu: s, setContextMenu:
|
|
882
|
+
function it() {
|
|
883
|
+
const { contextMenu: s, setContextMenu: m } = Y(), { doc: d, setDoc: I, currentCanvasId: f, pushCanvas: i, setSelection: l } = ee(), { duplicate: o } = ae();
|
|
777
884
|
if (!s) return null;
|
|
778
|
-
const
|
|
779
|
-
if (!
|
|
780
|
-
return
|
|
781
|
-
const
|
|
782
|
-
return
|
|
885
|
+
const h = d.canvases[f];
|
|
886
|
+
if (!h)
|
|
887
|
+
return m(null), null;
|
|
888
|
+
const c = s.nodeId ? h.nodes.find((t) => t.id === s.nodeId) : null, v = [];
|
|
889
|
+
return c && (v.push({
|
|
783
890
|
label: "Duplicate",
|
|
784
891
|
icon: "⧉",
|
|
785
892
|
action: () => {
|
|
786
|
-
|
|
893
|
+
o(24, 24, { nodeIds: /* @__PURE__ */ new Set([c.id]) });
|
|
787
894
|
}
|
|
788
|
-
}),
|
|
895
|
+
}), v.push({
|
|
789
896
|
label: "---",
|
|
790
897
|
action: () => {
|
|
791
898
|
}
|
|
792
|
-
}),
|
|
899
|
+
}), c.data.childCanvasId ? (v.push({
|
|
793
900
|
label: "Enter Sub-canvas",
|
|
794
901
|
icon: "↓",
|
|
795
902
|
action: () => {
|
|
796
|
-
|
|
903
|
+
i(c.data.childCanvasId), l({
|
|
797
904
|
nodeIds: /* @__PURE__ */ new Set(),
|
|
798
905
|
edgeIds: /* @__PURE__ */ new Set(),
|
|
799
906
|
lineIds: /* @__PURE__ */ new Set()
|
|
800
907
|
});
|
|
801
908
|
}
|
|
802
|
-
}),
|
|
909
|
+
}), v.push({
|
|
803
910
|
label: "---",
|
|
804
911
|
action: () => {
|
|
805
912
|
}
|
|
806
|
-
}),
|
|
913
|
+
}), v.push({
|
|
807
914
|
label: "Delete Sub-canvas",
|
|
808
915
|
icon: "🗑",
|
|
809
916
|
danger: !0,
|
|
810
917
|
action: () => {
|
|
811
|
-
const
|
|
812
|
-
|
|
813
|
-
const
|
|
814
|
-
de(
|
|
815
|
-
const
|
|
816
|
-
if (!
|
|
817
|
-
|
|
818
|
-
...
|
|
819
|
-
nodes:
|
|
820
|
-
...
|
|
918
|
+
const t = c.data.childCanvasId;
|
|
919
|
+
I((g) => {
|
|
920
|
+
const u = { ...g.canvases };
|
|
921
|
+
de(u, t);
|
|
922
|
+
const y = u[f];
|
|
923
|
+
if (!y) return g;
|
|
924
|
+
u[f] = {
|
|
925
|
+
...y,
|
|
926
|
+
nodes: y.nodes.map((w) => w.id === c.id ? {
|
|
927
|
+
...w,
|
|
821
928
|
data: {
|
|
822
|
-
...
|
|
929
|
+
...w.data,
|
|
823
930
|
childCanvasId: void 0
|
|
824
931
|
}
|
|
825
|
-
} :
|
|
932
|
+
} : w)
|
|
826
933
|
};
|
|
827
|
-
const
|
|
828
|
-
return
|
|
829
|
-
...
|
|
830
|
-
canvases:
|
|
831
|
-
stack:
|
|
934
|
+
const b = g.stack.filter((w) => u[w]);
|
|
935
|
+
return b.length === 0 && b.push(Ie), {
|
|
936
|
+
...g,
|
|
937
|
+
canvases: u,
|
|
938
|
+
stack: b
|
|
832
939
|
};
|
|
833
940
|
});
|
|
834
941
|
}
|
|
835
|
-
})) :
|
|
942
|
+
})) : v.push({
|
|
836
943
|
label: "Create Sub-canvas",
|
|
837
944
|
icon: "⊞",
|
|
838
945
|
action: () => {
|
|
839
|
-
const
|
|
840
|
-
|
|
841
|
-
const
|
|
842
|
-
return
|
|
843
|
-
...
|
|
946
|
+
const t = Q("canvas");
|
|
947
|
+
I((g) => {
|
|
948
|
+
const u = g.canvases[f];
|
|
949
|
+
return u ? {
|
|
950
|
+
...g,
|
|
844
951
|
canvases: {
|
|
845
|
-
...
|
|
846
|
-
[
|
|
847
|
-
...
|
|
848
|
-
nodes:
|
|
849
|
-
...
|
|
952
|
+
...g.canvases,
|
|
953
|
+
[f]: {
|
|
954
|
+
...u,
|
|
955
|
+
nodes: u.nodes.map((y) => y.id === c.id ? {
|
|
956
|
+
...y,
|
|
850
957
|
data: {
|
|
851
|
-
...
|
|
852
|
-
childCanvasId:
|
|
958
|
+
...y.data,
|
|
959
|
+
childCanvasId: t
|
|
853
960
|
}
|
|
854
|
-
} :
|
|
961
|
+
} : y)
|
|
855
962
|
},
|
|
856
|
-
[
|
|
963
|
+
[t]: {
|
|
857
964
|
nodes: [],
|
|
858
965
|
edges: [],
|
|
859
966
|
lines: []
|
|
860
967
|
}
|
|
861
968
|
}
|
|
862
|
-
} :
|
|
863
|
-
}), t
|
|
969
|
+
} : g;
|
|
970
|
+
}), i(t);
|
|
864
971
|
}
|
|
865
|
-
})),
|
|
972
|
+
})), v.length === 0 ? null : /* @__PURE__ */ a(Ke, {
|
|
866
973
|
x: s.x,
|
|
867
974
|
y: s.y,
|
|
868
|
-
items:
|
|
869
|
-
onClose: () =>
|
|
975
|
+
items: v,
|
|
976
|
+
onClose: () => m(null)
|
|
870
977
|
});
|
|
871
978
|
}
|
|
872
|
-
function de(s,
|
|
873
|
-
const
|
|
874
|
-
if (
|
|
875
|
-
for (const
|
|
876
|
-
delete s[
|
|
979
|
+
function de(s, m) {
|
|
980
|
+
const d = s[m];
|
|
981
|
+
if (d) {
|
|
982
|
+
for (const I of d.nodes) I.data.childCanvasId && de(s, I.data.childCanvasId);
|
|
983
|
+
delete s[m];
|
|
877
984
|
}
|
|
878
985
|
}
|
|
879
986
|
export {
|
|
880
|
-
|
|
987
|
+
Kt as default
|
|
881
988
|
};
|
|
882
989
|
|
|
883
990
|
//# sourceMappingURL=Flow.js.map
|