dishui 0.0.47 → 0.0.49
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/pro/CodeEditor/editors/MarkdownEditor.js +1 -2
- package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js.map +1 -1
- package/dist/components/pro/CodeEditor/themes.js +0 -25
- package/dist/components/pro/CodeEditor/themes.js.map +1 -1
- package/dist/components/pro/CodeEditor/types.d.ts +1 -1
- package/dist/components/pro/Flow/Flow.js +500 -483
- package/dist/components/pro/Flow/Flow.js.map +1 -1
- package/dist/components/pro/Flow/FlowCanvas.js +526 -524
- package/dist/components/pro/Flow/FlowCanvas.js.map +1 -1
- package/dist/components/pro/Flow/canvas/GridRenderer.d.ts +3 -0
- package/dist/components/pro/Flow/canvas/GridRenderer.js +28 -23
- package/dist/components/pro/Flow/canvas/GridRenderer.js.map +1 -1
- package/dist/components/pro/Flow/canvas/MiniMapRenderer.js +18 -17
- package/dist/components/pro/Flow/canvas/MiniMapRenderer.js.map +1 -1
- package/dist/components/pro/Flow/canvas/PixiApp.d.ts +2 -0
- package/dist/components/pro/Flow/canvas/PixiApp.js +14 -11
- package/dist/components/pro/Flow/canvas/PixiApp.js.map +1 -1
- package/dist/components/pro/Flow/constants.js +7 -7
- package/dist/components/pro/Flow/constants.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowAIContext.d.ts +15 -0
- package/dist/components/pro/Flow/context/FlowAIContext.js +32 -0
- package/dist/components/pro/Flow/context/FlowAIContext.js.map +1 -0
- package/dist/components/pro/Flow/context/FlowUIContext.d.ts +4 -1
- package/dist/components/pro/Flow/context/FlowUIContext.js +58 -55
- package/dist/components/pro/Flow/context/FlowUIContext.js.map +1 -1
- package/dist/components/pro/Flow/edges/EdgeRenderer.js +22 -21
- package/dist/components/pro/Flow/edges/EdgeRenderer.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useFlowImportExport.js +32 -32
- package/dist/components/pro/Flow/hooks/useFlowImportExport.js.map +1 -1
- package/dist/components/pro/Flow/hooks/usePixiApp.d.ts +6 -1
- package/dist/components/pro/Flow/hooks/usePixiApp.js +49 -30
- package/dist/components/pro/Flow/hooks/usePixiApp.js.map +1 -1
- package/dist/components/pro/Flow/index.d.ts +2 -0
- package/dist/components/pro/Flow/lines/FreehandTool.js +21 -20
- package/dist/components/pro/Flow/lines/FreehandTool.js.map +1 -1
- package/dist/components/pro/Flow/lines/GeometricLineTool.js +22 -18
- package/dist/components/pro/Flow/lines/GeometricLineTool.js.map +1 -1
- package/dist/components/pro/Flow/lines/LineRenderer.js +19 -18
- package/dist/components/pro/Flow/lines/LineRenderer.js.map +1 -1
- package/dist/components/pro/Flow/nodes/MediaContent.js +143 -124
- package/dist/components/pro/Flow/nodes/MediaContent.js.map +1 -1
- package/dist/components/pro/Flow/nodes/MediaOverlay.js +22 -17
- package/dist/components/pro/Flow/nodes/MediaOverlay.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeRenderer.js +77 -76
- package/dist/components/pro/Flow/nodes/NodeRenderer.js.map +1 -1
- package/dist/components/pro/Flow/nodes/aiClient.d.ts +22 -0
- package/dist/components/pro/Flow/nodes/aiClient.js +107 -54
- package/dist/components/pro/Flow/nodes/aiClient.js.map +1 -1
- package/dist/components/pro/Flow/nodes/svgIcons.js +6 -6
- package/dist/components/pro/Flow/nodes/svgIcons.js.map +1 -1
- package/dist/components/pro/Flow/panels/AIPanel.d.ts +2 -0
- package/dist/components/pro/Flow/panels/AIPanel.js +498 -0
- package/dist/components/pro/Flow/panels/AIPanel.js.map +1 -0
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js +51 -39
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js.map +1 -1
- package/dist/components/pro/Flow/panels/FlowToolbar.js +91 -85
- package/dist/components/pro/Flow/panels/FlowToolbar.js.map +1 -1
- package/dist/components/pro/Flow/panels/InspectorPanel.js +372 -332
- package/dist/components/pro/Flow/panels/InspectorPanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/OutlinePanel.js +28 -27
- package/dist/components/pro/Flow/panels/OutlinePanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/ShapePalette.js +107 -104
- package/dist/components/pro/Flow/panels/ShapePalette.js.map +1 -1
- package/dist/components/pro/Flow/panels/toolbarIcons.d.ts +1 -0
- package/dist/components/pro/Flow/panels/toolbarIcons.js +25 -20
- package/dist/components/pro/Flow/panels/toolbarIcons.js.map +1 -1
- package/dist/components/pro/Flow/types.d.ts +13 -0
- package/dist/components/pro/Flow/types.js.map +1 -1
- package/dist/components/pro/Flow/utils/themeColor.d.ts +87 -0
- package/dist/components/pro/Flow/utils/themeColor.js +212 -0
- package/dist/components/pro/Flow/utils/themeColor.js.map +1 -0
- package/dist/contexts/AppContext.d.ts +1 -1
- package/dist/contexts/AppContext.js +28 -29
- package/dist/contexts/AppContext.js.map +1 -1
- package/dist/dishui.css +1 -1
- package/dist/favicon.svg +10 -0
- package/dist/flow.js +56 -51
- package/dist/styles/themeStyles.js +6 -11
- package/dist/styles/themeStyles.js.map +1 -1
- package/dist/utils/themes.js +3 -23
- package/dist/utils/themes.js.map +1 -1
- package/package.json +17 -18
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { BORDER_STYLE_OPTIONS as
|
|
7
|
-
import { useFlowContext as
|
|
8
|
-
import { useFlowUI as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import g from "../../../Button/index.js";
|
|
2
|
+
import b from "../../../Input/index.js";
|
|
3
|
+
import m from "../../../Label/index.js";
|
|
4
|
+
import X from "../../../Checkbox/index.js";
|
|
5
|
+
import k from "../../../Select/index.js";
|
|
6
|
+
import { BORDER_STYLE_OPTIONS as q, DEFAULT_NODE_DATA as Q, EDGE_LINE_STYLE_OPTIONS as $, EDGE_MARKER_OPTIONS as Y, EDGE_TYPE_OPTIONS as D } from "../constants.js";
|
|
7
|
+
import { useFlowContext as U } from "../context/FlowContext.js";
|
|
8
|
+
import { useFlowUI as ee } from "../context/FlowUIContext.js";
|
|
9
|
+
import { COMMON_COLORS as R, THEME_SYNC_TOKEN as le, isThemeToken as se, themeTokenCssVar as ae } from "../utils/themeColor.js";
|
|
10
|
+
import { generateId as ie } from "../nodes/nodeUtils.js";
|
|
11
|
+
import { getAllSvgIcons as te, getSvgIcon as ne } from "../nodes/svgIcons.js";
|
|
12
|
+
import { useDraggablePanel as oe } from "../hooks/useDraggablePanel.js";
|
|
13
|
+
import { useResizablePanel as re } from "../hooks/useResizablePanel.js";
|
|
14
|
+
import { FLOW_NODE_TYPES as ce } from "../types.js";
|
|
15
|
+
import { ExpandableTextarea as Z } from "./ExpandableTextarea.js";
|
|
16
|
+
import { DataInspectorSection as de } from "./DataInspectorSection.js";
|
|
17
|
+
import { useMemo as A, useRef as me } from "react";
|
|
18
|
+
import { Fragment as L, jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
19
|
+
function Pe() {
|
|
20
|
+
const { showInspector: l } = ee(), { panelStyle: c, handleProps: r } = oe(), { panelWidth: t, resizeHandleProps: p } = re("left", 240);
|
|
20
21
|
return l ? /* @__PURE__ */ a("div", {
|
|
21
22
|
className: "flow-inspector",
|
|
22
23
|
"data-flow-panel": !0,
|
|
23
24
|
style: {
|
|
24
|
-
...
|
|
25
|
+
...c,
|
|
25
26
|
width: t
|
|
26
27
|
},
|
|
27
28
|
children: [
|
|
28
29
|
/* @__PURE__ */ e("div", {
|
|
29
30
|
className: "flow-panel-resize-handle flow-panel-resize-handle--left",
|
|
30
|
-
...
|
|
31
|
+
...p
|
|
31
32
|
}),
|
|
32
33
|
/* @__PURE__ */ e("div", {
|
|
33
34
|
className: "flow-panel-drag-handle",
|
|
@@ -45,78 +46,78 @@ function Ee() {
|
|
|
45
46
|
}),
|
|
46
47
|
/* @__PURE__ */ e("div", {
|
|
47
48
|
className: "flow-inspector-content",
|
|
48
|
-
children: /* @__PURE__ */ e(
|
|
49
|
+
children: /* @__PURE__ */ e(he, {})
|
|
49
50
|
})
|
|
50
51
|
]
|
|
51
52
|
}) : null;
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
-
const { currentCanvas: l, selection:
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
54
|
+
function he() {
|
|
55
|
+
const { currentCanvas: l, selection: c, setSelection: r, setDoc: t, currentCanvasId: p } = U(), f = A(() => l.nodes.filter((d) => c.nodeIds.has(d.id)), [l.nodes, c.nodeIds]), s = A(() => l.edges.filter((d) => c.edgeIds.has(d.id)), [l.edges, c.edgeIds]), u = A(() => l.lines.filter((d) => c.lineIds.has(d.id)), [l.lines, c.lineIds]), S = f.length > 0 || s.length > 0 || u.length > 0, z = f.length === 1 && (f[0].type === "flowGroup" || f[0].type === "geometryGroup" || f[0].data.isGroup), M = f.length + u.length, P = (d = "flowGroup") => {
|
|
56
|
+
if (M < 2) return;
|
|
57
|
+
const w = 20;
|
|
57
58
|
let o = 1 / 0, i = 1 / 0, n = -1 / 0, h = -1 / 0;
|
|
58
|
-
for (const x of
|
|
59
|
+
for (const x of f)
|
|
59
60
|
o = Math.min(o, x.position.x), i = Math.min(i, x.position.y), n = Math.max(n, x.position.x + x.width), h = Math.max(h, x.position.y + x.height);
|
|
60
|
-
for (const x of
|
|
61
|
-
o = Math.min(o,
|
|
62
|
-
const
|
|
63
|
-
id:
|
|
64
|
-
type:
|
|
61
|
+
for (const x of u) for (const C of x.points)
|
|
62
|
+
o = Math.min(o, C.x), i = Math.min(i, C.y), n = Math.max(n, C.x), h = Math.max(h, C.y);
|
|
63
|
+
const I = d === "geometryGroup", E = ie("group"), v = {
|
|
64
|
+
id: E,
|
|
65
|
+
type: d,
|
|
65
66
|
position: {
|
|
66
|
-
x: o -
|
|
67
|
-
y: i -
|
|
67
|
+
x: o - w,
|
|
68
|
+
y: i - w
|
|
68
69
|
},
|
|
69
|
-
width: n - o +
|
|
70
|
-
height: h - i +
|
|
70
|
+
width: n - o + w * 2,
|
|
71
|
+
height: h - i + w * 2,
|
|
71
72
|
data: {
|
|
72
|
-
...
|
|
73
|
-
label:
|
|
74
|
-
fill:
|
|
73
|
+
...Q,
|
|
74
|
+
label: I ? "Geo Group" : "Group",
|
|
75
|
+
fill: I ? "#fefce8" : "#f0f9ff",
|
|
75
76
|
stroke: "#9ca3af",
|
|
76
77
|
strokeWidth: 1.5,
|
|
77
|
-
borderStyle:
|
|
78
|
+
borderStyle: I ? "dashed" : "dotted",
|
|
78
79
|
isGroup: !0
|
|
79
80
|
}
|
|
80
|
-
},
|
|
81
|
+
}, T = c.nodeIds, N = c.lineIds;
|
|
81
82
|
t((x) => {
|
|
82
|
-
const
|
|
83
|
-
return
|
|
83
|
+
const C = x.canvases[p];
|
|
84
|
+
return C ? {
|
|
84
85
|
...x,
|
|
85
86
|
canvases: {
|
|
86
87
|
...x.canvases,
|
|
87
|
-
[
|
|
88
|
-
...
|
|
89
|
-
nodes:
|
|
90
|
-
...
|
|
91
|
-
parentId:
|
|
92
|
-
} :
|
|
93
|
-
lines:
|
|
94
|
-
...
|
|
95
|
-
parentId:
|
|
96
|
-
} :
|
|
88
|
+
[p]: {
|
|
89
|
+
...C,
|
|
90
|
+
nodes: I ? [v, ...C.nodes] : [v, ...C.nodes.map((F) => T.has(F.id) ? {
|
|
91
|
+
...F,
|
|
92
|
+
parentId: E
|
|
93
|
+
} : F)],
|
|
94
|
+
lines: I ? C.lines : C.lines.map((F) => N.has(F.id) ? {
|
|
95
|
+
...F,
|
|
96
|
+
parentId: E
|
|
97
|
+
} : F)
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
} : x;
|
|
100
101
|
}), r({
|
|
101
|
-
nodeIds: /* @__PURE__ */ new Set([
|
|
102
|
+
nodeIds: /* @__PURE__ */ new Set([E]),
|
|
102
103
|
edgeIds: /* @__PURE__ */ new Set(),
|
|
103
104
|
lineIds: /* @__PURE__ */ new Set()
|
|
104
105
|
});
|
|
105
|
-
},
|
|
106
|
-
const
|
|
107
|
-
for (const i of
|
|
108
|
-
if (
|
|
109
|
-
for (const i of l.nodes) i.parentId &&
|
|
110
|
-
for (const i of l.lines) i.parentId &&
|
|
106
|
+
}, _ = () => {
|
|
107
|
+
const d = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
|
|
108
|
+
for (const i of f) (i.type === "flowGroup" || i.type === "geometryGroup" || i.data.isGroup) && d.add(i.id);
|
|
109
|
+
if (d.size !== 0) {
|
|
110
|
+
for (const i of l.nodes) i.parentId && d.has(i.parentId) && w.add(i.id);
|
|
111
|
+
for (const i of l.lines) i.parentId && d.has(i.parentId) && o.add(i.id);
|
|
111
112
|
t((i) => {
|
|
112
|
-
const n = i.canvases[
|
|
113
|
+
const n = i.canvases[p];
|
|
113
114
|
return n ? {
|
|
114
115
|
...i,
|
|
115
116
|
canvases: {
|
|
116
117
|
...i.canvases,
|
|
117
|
-
[
|
|
118
|
+
[p]: {
|
|
118
119
|
...n,
|
|
119
|
-
nodes: n.nodes.filter((h) => !
|
|
120
|
+
nodes: n.nodes.filter((h) => !d.has(h.id)).map((h) => w.has(h.id) ? {
|
|
120
121
|
...h,
|
|
121
122
|
parentId: void 0
|
|
122
123
|
} : h),
|
|
@@ -128,174 +129,174 @@ function oe() {
|
|
|
128
129
|
}
|
|
129
130
|
} : i;
|
|
130
131
|
}), r({
|
|
131
|
-
nodeIds:
|
|
132
|
+
nodeIds: w,
|
|
132
133
|
edgeIds: /* @__PURE__ */ new Set(),
|
|
133
134
|
lineIds: o
|
|
134
135
|
});
|
|
135
136
|
}
|
|
136
|
-
},
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
const i = o.canvases[
|
|
137
|
+
}, G = (d) => {
|
|
138
|
+
const w = c.nodeIds;
|
|
139
|
+
w.size !== 0 && t((o) => {
|
|
140
|
+
const i = o.canvases[p];
|
|
140
141
|
if (!i) return o;
|
|
141
|
-
const n = i.nodes.map((
|
|
142
|
-
if (!
|
|
143
|
-
const
|
|
144
|
-
let
|
|
145
|
-
return
|
|
146
|
-
...
|
|
147
|
-
zIndex:
|
|
142
|
+
const n = i.nodes.map((v) => v.zIndex ?? 0), h = n.length > 0 ? Math.max(...n) : 0, I = n.length > 0 ? Math.min(...n) : 0, E = i.nodes.map((v) => {
|
|
143
|
+
if (!w.has(v.id)) return v;
|
|
144
|
+
const T = v.zIndex ?? 0;
|
|
145
|
+
let N = T;
|
|
146
|
+
return d === "front" ? N = h + 1 : d === "back" ? N = I - 1 : d === "up" ? N = T + 1 : d === "down" && (N = T - 1), {
|
|
147
|
+
...v,
|
|
148
|
+
zIndex: N
|
|
148
149
|
};
|
|
149
150
|
});
|
|
150
151
|
return {
|
|
151
152
|
...o,
|
|
152
153
|
canvases: {
|
|
153
154
|
...o.canvases,
|
|
154
|
-
[
|
|
155
|
+
[p]: {
|
|
155
156
|
...i,
|
|
156
|
-
nodes:
|
|
157
|
+
nodes: E
|
|
157
158
|
}
|
|
158
159
|
}
|
|
159
160
|
};
|
|
160
161
|
});
|
|
161
|
-
},
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
const i = o.canvases[
|
|
162
|
+
}, O = (d) => {
|
|
163
|
+
const w = c.lineIds;
|
|
164
|
+
w.size !== 0 && t((o) => {
|
|
165
|
+
const i = o.canvases[p];
|
|
165
166
|
if (!i) return o;
|
|
166
|
-
const n = i.lines.map((
|
|
167
|
-
if (!
|
|
168
|
-
const
|
|
169
|
-
let
|
|
170
|
-
return
|
|
171
|
-
...
|
|
172
|
-
zIndex:
|
|
167
|
+
const n = i.lines.map((v) => v.zIndex ?? 0), h = n.length > 0 ? Math.max(...n) : 0, I = n.length > 0 ? Math.min(...n) : 0, E = i.lines.map((v) => {
|
|
168
|
+
if (!w.has(v.id)) return v;
|
|
169
|
+
const T = v.zIndex ?? 0;
|
|
170
|
+
let N = T;
|
|
171
|
+
return d === "front" ? N = h + 1 : d === "back" ? N = I - 1 : d === "up" ? N = T + 1 : d === "down" && (N = T - 1), {
|
|
172
|
+
...v,
|
|
173
|
+
zIndex: N
|
|
173
174
|
};
|
|
174
175
|
});
|
|
175
176
|
return {
|
|
176
177
|
...o,
|
|
177
178
|
canvases: {
|
|
178
179
|
...o.canvases,
|
|
179
|
-
[
|
|
180
|
+
[p]: {
|
|
180
181
|
...i,
|
|
181
|
-
lines:
|
|
182
|
+
lines: E
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
185
|
};
|
|
185
186
|
});
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
},
|
|
187
|
+
}, y = (d, w, o) => {
|
|
188
|
+
W(d, { [w]: o });
|
|
189
|
+
}, W = (d, w) => {
|
|
189
190
|
t((o) => {
|
|
190
|
-
const i = o.canvases[
|
|
191
|
+
const i = o.canvases[p];
|
|
191
192
|
return i ? {
|
|
192
193
|
...o,
|
|
193
194
|
canvases: {
|
|
194
195
|
...o.canvases,
|
|
195
|
-
[
|
|
196
|
+
[p]: {
|
|
196
197
|
...i,
|
|
197
|
-
nodes: i.nodes.map((n) => n.id ===
|
|
198
|
+
nodes: i.nodes.map((n) => n.id === d ? {
|
|
198
199
|
...n,
|
|
199
200
|
data: {
|
|
200
201
|
...n.data,
|
|
201
|
-
...
|
|
202
|
+
...w
|
|
202
203
|
}
|
|
203
204
|
} : n)
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
207
|
} : o;
|
|
207
208
|
});
|
|
208
|
-
},
|
|
209
|
+
}, j = (d, w, o) => {
|
|
209
210
|
t((i) => {
|
|
210
|
-
const n = i.canvases[
|
|
211
|
+
const n = i.canvases[p];
|
|
211
212
|
return n ? {
|
|
212
213
|
...i,
|
|
213
214
|
canvases: {
|
|
214
215
|
...i.canvases,
|
|
215
|
-
[
|
|
216
|
+
[p]: {
|
|
216
217
|
...n,
|
|
217
|
-
nodes: n.nodes.map((h) => h.id ===
|
|
218
|
+
nodes: n.nodes.map((h) => h.id === d ? {
|
|
218
219
|
...h,
|
|
219
|
-
[
|
|
220
|
+
[w]: o
|
|
220
221
|
} : h)
|
|
221
222
|
}
|
|
222
223
|
}
|
|
223
224
|
} : i;
|
|
224
225
|
});
|
|
225
|
-
},
|
|
226
|
+
}, H = (d, w, o) => {
|
|
226
227
|
t((i) => {
|
|
227
|
-
const n = i.canvases[
|
|
228
|
+
const n = i.canvases[p];
|
|
228
229
|
return n ? {
|
|
229
230
|
...i,
|
|
230
231
|
canvases: {
|
|
231
232
|
...i.canvases,
|
|
232
|
-
[
|
|
233
|
+
[p]: {
|
|
233
234
|
...n,
|
|
234
|
-
edges: n.edges.map((h) => h.id ===
|
|
235
|
+
edges: n.edges.map((h) => h.id === d ? {
|
|
235
236
|
...h,
|
|
236
237
|
data: {
|
|
237
238
|
...h.data,
|
|
238
|
-
[
|
|
239
|
+
[w]: o
|
|
239
240
|
}
|
|
240
241
|
} : h)
|
|
241
242
|
}
|
|
242
243
|
}
|
|
243
244
|
} : i;
|
|
244
245
|
});
|
|
245
|
-
},
|
|
246
|
+
}, K = (d, w) => {
|
|
246
247
|
t((o) => {
|
|
247
|
-
const i = o.canvases[
|
|
248
|
+
const i = o.canvases[p];
|
|
248
249
|
return i ? {
|
|
249
250
|
...o,
|
|
250
251
|
canvases: {
|
|
251
252
|
...o.canvases,
|
|
252
|
-
[
|
|
253
|
+
[p]: {
|
|
253
254
|
...i,
|
|
254
|
-
nodes: i.nodes.map((n) => n.id ===
|
|
255
|
+
nodes: i.nodes.map((n) => n.id === d ? {
|
|
255
256
|
...n,
|
|
256
|
-
type:
|
|
257
|
+
type: w
|
|
257
258
|
} : n)
|
|
258
259
|
}
|
|
259
260
|
}
|
|
260
261
|
} : o;
|
|
261
262
|
});
|
|
262
|
-
},
|
|
263
|
+
}, V = (d, w) => {
|
|
263
264
|
t((o) => {
|
|
264
|
-
const i = o.canvases[
|
|
265
|
+
const i = o.canvases[p];
|
|
265
266
|
return i ? {
|
|
266
267
|
...o,
|
|
267
268
|
canvases: {
|
|
268
269
|
...o.canvases,
|
|
269
|
-
[
|
|
270
|
+
[p]: {
|
|
270
271
|
...i,
|
|
271
|
-
edges: i.edges.map((n) => n.id ===
|
|
272
|
+
edges: i.edges.map((n) => n.id === d ? {
|
|
272
273
|
...n,
|
|
273
|
-
type:
|
|
274
|
+
type: w
|
|
274
275
|
} : n)
|
|
275
276
|
}
|
|
276
277
|
}
|
|
277
278
|
} : o;
|
|
278
279
|
});
|
|
279
|
-
}, J = (
|
|
280
|
+
}, J = (d, w, o) => {
|
|
280
281
|
t((i) => {
|
|
281
|
-
const n = i.canvases[
|
|
282
|
+
const n = i.canvases[p];
|
|
282
283
|
return n ? {
|
|
283
284
|
...i,
|
|
284
285
|
canvases: {
|
|
285
286
|
...i.canvases,
|
|
286
|
-
[
|
|
287
|
+
[p]: {
|
|
287
288
|
...n,
|
|
288
|
-
lines: n.lines.map((h) => h.id ===
|
|
289
|
+
lines: n.lines.map((h) => h.id === d ? {
|
|
289
290
|
...h,
|
|
290
|
-
[
|
|
291
|
+
[w]: o
|
|
291
292
|
} : h)
|
|
292
293
|
}
|
|
293
294
|
}
|
|
294
295
|
} : i;
|
|
295
296
|
});
|
|
296
297
|
};
|
|
297
|
-
return /* @__PURE__ */ a(
|
|
298
|
-
!
|
|
298
|
+
return /* @__PURE__ */ a(L, { children: [
|
|
299
|
+
!S && /* @__PURE__ */ e("div", {
|
|
299
300
|
style: {
|
|
300
301
|
fontSize: 12,
|
|
301
302
|
color: "color-mix(in oklch, var(--color-base-content) 40%, transparent)",
|
|
@@ -304,15 +305,15 @@ function oe() {
|
|
|
304
305
|
},
|
|
305
306
|
children: "Select an element to inspect"
|
|
306
307
|
}),
|
|
307
|
-
|
|
308
|
-
node:
|
|
309
|
-
isGroup:
|
|
310
|
-
onUpdateData:
|
|
311
|
-
onUpdateDataBatch:
|
|
312
|
-
onUpdateDimension:
|
|
313
|
-
onUpdateType:
|
|
308
|
+
f.length === 1 && /* @__PURE__ */ e(pe, {
|
|
309
|
+
node: f[0],
|
|
310
|
+
isGroup: z,
|
|
311
|
+
onUpdateData: y,
|
|
312
|
+
onUpdateDataBatch: W,
|
|
313
|
+
onUpdateDimension: j,
|
|
314
|
+
onUpdateType: K
|
|
314
315
|
}),
|
|
315
|
-
|
|
316
|
+
M > 1 && /* @__PURE__ */ a("div", {
|
|
316
317
|
className: "flow-inspector-section",
|
|
317
318
|
children: [
|
|
318
319
|
/* @__PURE__ */ e("div", {
|
|
@@ -326,9 +327,9 @@ function oe() {
|
|
|
326
327
|
marginBottom: 8
|
|
327
328
|
},
|
|
328
329
|
children: [
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
330
|
+
f.length > 0 && `${f.length} node${f.length > 1 ? "s" : ""}`,
|
|
331
|
+
f.length > 0 && u.length > 0 && ", ",
|
|
332
|
+
u.length > 0 && `${u.length} line${u.length > 1 ? "s" : ""}`,
|
|
332
333
|
" selected"
|
|
333
334
|
]
|
|
334
335
|
}),
|
|
@@ -339,27 +340,27 @@ function oe() {
|
|
|
339
340
|
gap: 4,
|
|
340
341
|
width: "100%"
|
|
341
342
|
},
|
|
342
|
-
children: [/* @__PURE__ */ e(
|
|
343
|
+
children: [/* @__PURE__ */ e(g, {
|
|
343
344
|
size: "xs",
|
|
344
|
-
onClick: () =>
|
|
345
|
+
onClick: () => P("flowGroup"),
|
|
345
346
|
block: !0,
|
|
346
347
|
children: "Group (⌘G)"
|
|
347
|
-
}), /* @__PURE__ */ e(
|
|
348
|
+
}), /* @__PURE__ */ e(g, {
|
|
348
349
|
size: "xs",
|
|
349
350
|
variant: "ghost",
|
|
350
|
-
onClick: () =>
|
|
351
|
+
onClick: () => P("geometryGroup"),
|
|
351
352
|
block: !0,
|
|
352
353
|
children: "Geo Group (⌘⌥G)"
|
|
353
354
|
})]
|
|
354
355
|
})
|
|
355
356
|
]
|
|
356
357
|
}),
|
|
357
|
-
|
|
358
|
+
z && /* @__PURE__ */ a("div", {
|
|
358
359
|
className: "flow-inspector-section",
|
|
359
360
|
children: [
|
|
360
361
|
/* @__PURE__ */ e("div", {
|
|
361
362
|
className: "flow-inspector-section-title",
|
|
362
|
-
children:
|
|
363
|
+
children: f[0].type === "geometryGroup" ? "Geometry Group" : "Group"
|
|
363
364
|
}),
|
|
364
365
|
/* @__PURE__ */ e("div", {
|
|
365
366
|
style: {
|
|
@@ -367,18 +368,18 @@ function oe() {
|
|
|
367
368
|
color: "color-mix(in oklch, var(--color-base-content) 45%, transparent)",
|
|
368
369
|
marginBottom: 6
|
|
369
370
|
},
|
|
370
|
-
children:
|
|
371
|
+
children: f[0].type === "geometryGroup" ? "Auto-binds spatially contained nodes" : "Explicit membership via add/remove"
|
|
371
372
|
}),
|
|
372
|
-
/* @__PURE__ */ e(
|
|
373
|
+
/* @__PURE__ */ e(g, {
|
|
373
374
|
size: "xs",
|
|
374
375
|
variant: "ghost",
|
|
375
|
-
onClick:
|
|
376
|
+
onClick: _,
|
|
376
377
|
block: !0,
|
|
377
378
|
children: "Ungroup (⌘⇧G)"
|
|
378
379
|
})
|
|
379
380
|
]
|
|
380
381
|
}),
|
|
381
|
-
|
|
382
|
+
f.length > 0 && /* @__PURE__ */ a("div", {
|
|
382
383
|
className: "flow-inspector-section",
|
|
383
384
|
children: [/* @__PURE__ */ e("div", {
|
|
384
385
|
className: "flow-inspector-section-title",
|
|
@@ -389,37 +390,37 @@ function oe() {
|
|
|
389
390
|
gap: 4
|
|
390
391
|
},
|
|
391
392
|
children: [
|
|
392
|
-
/* @__PURE__ */ e(
|
|
393
|
+
/* @__PURE__ */ e(g, {
|
|
393
394
|
size: "xs",
|
|
394
395
|
variant: "ghost",
|
|
395
|
-
onClick: () =>
|
|
396
|
+
onClick: () => G("front"),
|
|
396
397
|
children: /* @__PURE__ */ e("span", {
|
|
397
398
|
title: "Bring to Front (⌘⇧↑)",
|
|
398
399
|
children: "⤒"
|
|
399
400
|
})
|
|
400
401
|
}),
|
|
401
|
-
/* @__PURE__ */ e(
|
|
402
|
+
/* @__PURE__ */ e(g, {
|
|
402
403
|
size: "xs",
|
|
403
404
|
variant: "ghost",
|
|
404
|
-
onClick: () =>
|
|
405
|
+
onClick: () => G("up"),
|
|
405
406
|
children: /* @__PURE__ */ e("span", {
|
|
406
407
|
title: "Bring Forward (⌘↑)",
|
|
407
408
|
children: "↑"
|
|
408
409
|
})
|
|
409
410
|
}),
|
|
410
|
-
/* @__PURE__ */ e(
|
|
411
|
+
/* @__PURE__ */ e(g, {
|
|
411
412
|
size: "xs",
|
|
412
413
|
variant: "ghost",
|
|
413
|
-
onClick: () =>
|
|
414
|
+
onClick: () => G("down"),
|
|
414
415
|
children: /* @__PURE__ */ e("span", {
|
|
415
416
|
title: "Send Backward (⌘↓)",
|
|
416
417
|
children: "↓"
|
|
417
418
|
})
|
|
418
419
|
}),
|
|
419
|
-
/* @__PURE__ */ e(
|
|
420
|
+
/* @__PURE__ */ e(g, {
|
|
420
421
|
size: "xs",
|
|
421
422
|
variant: "ghost",
|
|
422
|
-
onClick: () =>
|
|
423
|
+
onClick: () => G("back"),
|
|
423
424
|
children: /* @__PURE__ */ e("span", {
|
|
424
425
|
title: "Send to Back (⌘⇧↓)",
|
|
425
426
|
children: "⤓"
|
|
@@ -428,13 +429,13 @@ function oe() {
|
|
|
428
429
|
]
|
|
429
430
|
})]
|
|
430
431
|
}),
|
|
431
|
-
s.length === 1 && /* @__PURE__ */ e(
|
|
432
|
+
s.length === 1 && /* @__PURE__ */ e(ue, {
|
|
432
433
|
edge: s[0],
|
|
433
|
-
onUpdateData:
|
|
434
|
-
onUpdateType:
|
|
434
|
+
onUpdateData: H,
|
|
435
|
+
onUpdateType: V
|
|
435
436
|
}),
|
|
436
|
-
|
|
437
|
-
line:
|
|
437
|
+
u.length === 1 && /* @__PURE__ */ a(L, { children: [/* @__PURE__ */ e(we, {
|
|
438
|
+
line: u[0],
|
|
438
439
|
onUpdateData: J
|
|
439
440
|
}), /* @__PURE__ */ a("div", {
|
|
440
441
|
className: "flow-inspector-section",
|
|
@@ -447,37 +448,37 @@ function oe() {
|
|
|
447
448
|
gap: 4
|
|
448
449
|
},
|
|
449
450
|
children: [
|
|
450
|
-
/* @__PURE__ */ e(
|
|
451
|
+
/* @__PURE__ */ e(g, {
|
|
451
452
|
size: "xs",
|
|
452
453
|
variant: "ghost",
|
|
453
|
-
onClick: () =>
|
|
454
|
+
onClick: () => O("front"),
|
|
454
455
|
children: /* @__PURE__ */ e("span", {
|
|
455
456
|
title: "Bring to Front",
|
|
456
457
|
children: "⤒"
|
|
457
458
|
})
|
|
458
459
|
}),
|
|
459
|
-
/* @__PURE__ */ e(
|
|
460
|
+
/* @__PURE__ */ e(g, {
|
|
460
461
|
size: "xs",
|
|
461
462
|
variant: "ghost",
|
|
462
|
-
onClick: () =>
|
|
463
|
+
onClick: () => O("up"),
|
|
463
464
|
children: /* @__PURE__ */ e("span", {
|
|
464
465
|
title: "Bring Forward",
|
|
465
466
|
children: "↑"
|
|
466
467
|
})
|
|
467
468
|
}),
|
|
468
|
-
/* @__PURE__ */ e(
|
|
469
|
+
/* @__PURE__ */ e(g, {
|
|
469
470
|
size: "xs",
|
|
470
471
|
variant: "ghost",
|
|
471
|
-
onClick: () =>
|
|
472
|
+
onClick: () => O("down"),
|
|
472
473
|
children: /* @__PURE__ */ e("span", {
|
|
473
474
|
title: "Send Backward",
|
|
474
475
|
children: "↓"
|
|
475
476
|
})
|
|
476
477
|
}),
|
|
477
|
-
/* @__PURE__ */ e(
|
|
478
|
+
/* @__PURE__ */ e(g, {
|
|
478
479
|
size: "xs",
|
|
479
480
|
variant: "ghost",
|
|
480
|
-
onClick: () =>
|
|
481
|
+
onClick: () => O("back"),
|
|
481
482
|
children: /* @__PURE__ */ e("span", {
|
|
482
483
|
title: "Send to Back",
|
|
483
484
|
children: "⤓"
|
|
@@ -488,8 +489,51 @@ function oe() {
|
|
|
488
489
|
})] })
|
|
489
490
|
] });
|
|
490
491
|
}
|
|
491
|
-
function
|
|
492
|
-
|
|
492
|
+
function B({ value: l, onChange: c, kind: r, allowTransparent: t, customFallback: p = "#ffffff" }) {
|
|
493
|
+
const f = le[r], s = ae(f) ?? "var(--color-base-content)", u = l ?? "", S = u.toLowerCase(), z = se(u), M = u === "transparent", P = R.some((y) => y.value.toLowerCase() === S), _ = u === f, G = !!u && !z && !M && !P, O = G ? u : p;
|
|
494
|
+
return /* @__PURE__ */ a("div", {
|
|
495
|
+
className: "flow-color-field",
|
|
496
|
+
children: [
|
|
497
|
+
/* @__PURE__ */ e("button", {
|
|
498
|
+
type: "button",
|
|
499
|
+
title: "跟随主题切换",
|
|
500
|
+
"aria-label": "跟随主题切换",
|
|
501
|
+
className: `flow-color-swatch flow-color-swatch--sync${_ ? " is-active" : ""}`,
|
|
502
|
+
style: { background: s },
|
|
503
|
+
onClick: () => c(f)
|
|
504
|
+
}),
|
|
505
|
+
/* @__PURE__ */ e("span", { className: "flow-color-divider" }),
|
|
506
|
+
R.map((y) => /* @__PURE__ */ e("button", {
|
|
507
|
+
type: "button",
|
|
508
|
+
title: y.label,
|
|
509
|
+
"aria-label": y.label,
|
|
510
|
+
className: `flow-color-swatch${!z && !M && S === y.value.toLowerCase() ? " is-active" : ""}`,
|
|
511
|
+
style: { background: y.value },
|
|
512
|
+
onClick: () => c(y.value)
|
|
513
|
+
}, y.value)),
|
|
514
|
+
/* @__PURE__ */ e("span", { className: "flow-color-divider" }),
|
|
515
|
+
/* @__PURE__ */ e("label", {
|
|
516
|
+
className: `flow-color-swatch flow-color-swatch--custom${G ? " is-active" : ""}`,
|
|
517
|
+
title: "自定义颜色",
|
|
518
|
+
style: G ? { background: u } : void 0,
|
|
519
|
+
children: /* @__PURE__ */ e("input", {
|
|
520
|
+
type: "color",
|
|
521
|
+
value: O,
|
|
522
|
+
onChange: (y) => c(y.target.value)
|
|
523
|
+
})
|
|
524
|
+
}),
|
|
525
|
+
t && /* @__PURE__ */ e("button", {
|
|
526
|
+
type: "button",
|
|
527
|
+
title: "透明",
|
|
528
|
+
"aria-label": "透明",
|
|
529
|
+
className: `flow-color-swatch flow-color-swatch--transparent${M ? " is-active" : ""}`,
|
|
530
|
+
onClick: () => c("transparent")
|
|
531
|
+
})
|
|
532
|
+
]
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
function pe({ node: l, isGroup: c, onUpdateData: r, onUpdateDataBatch: t, onUpdateDimension: p, onUpdateType: f }) {
|
|
536
|
+
return /* @__PURE__ */ a(L, { children: [
|
|
493
537
|
/* @__PURE__ */ a("div", {
|
|
494
538
|
className: "flow-inspector-section",
|
|
495
539
|
children: [
|
|
@@ -499,11 +543,11 @@ function re({ node: l, isGroup: p, onUpdateData: r, onUpdateDataBatch: t, onUpda
|
|
|
499
543
|
}),
|
|
500
544
|
/* @__PURE__ */ a("div", {
|
|
501
545
|
className: "flow-inspector-row",
|
|
502
|
-
children: [/* @__PURE__ */ e(
|
|
546
|
+
children: [/* @__PURE__ */ e(m, {
|
|
503
547
|
size: "xs",
|
|
504
548
|
className: "flow-inspector-label",
|
|
505
549
|
children: "Label"
|
|
506
|
-
}), /* @__PURE__ */ e(
|
|
550
|
+
}), /* @__PURE__ */ e(b, {
|
|
507
551
|
size: "xs",
|
|
508
552
|
value: l.data.label,
|
|
509
553
|
onChange: (s) => r(l.id, "label", s.target.value)
|
|
@@ -511,17 +555,17 @@ function re({ node: l, isGroup: p, onUpdateData: r, onUpdateDataBatch: t, onUpda
|
|
|
511
555
|
}),
|
|
512
556
|
/* @__PURE__ */ a("div", {
|
|
513
557
|
className: "flow-inspector-row",
|
|
514
|
-
children: [/* @__PURE__ */ e(
|
|
558
|
+
children: [/* @__PURE__ */ e(m, {
|
|
515
559
|
size: "xs",
|
|
516
560
|
className: "flow-inspector-label",
|
|
517
561
|
children: "Type"
|
|
518
|
-
}), /* @__PURE__ */ e(
|
|
519
|
-
options:
|
|
562
|
+
}), /* @__PURE__ */ e(k, {
|
|
563
|
+
options: ce.map((s) => ({
|
|
520
564
|
value: s,
|
|
521
565
|
label: s
|
|
522
566
|
})),
|
|
523
567
|
value: l.type,
|
|
524
|
-
onChange: (s) =>
|
|
568
|
+
onChange: (s) => f(l.id, s),
|
|
525
569
|
style: { fontSize: 12 }
|
|
526
570
|
})]
|
|
527
571
|
})
|
|
@@ -536,28 +580,28 @@ function re({ node: l, isGroup: p, onUpdateData: r, onUpdateDataBatch: t, onUpda
|
|
|
536
580
|
}),
|
|
537
581
|
/* @__PURE__ */ a("div", {
|
|
538
582
|
className: "flow-inspector-row",
|
|
539
|
-
children: [/* @__PURE__ */ e(
|
|
583
|
+
children: [/* @__PURE__ */ e(m, {
|
|
540
584
|
size: "xs",
|
|
541
585
|
className: "flow-inspector-label",
|
|
542
586
|
children: "W"
|
|
543
|
-
}), /* @__PURE__ */ e(
|
|
587
|
+
}), /* @__PURE__ */ e(b, {
|
|
544
588
|
size: "xs",
|
|
545
589
|
type: "number",
|
|
546
590
|
value: String(Math.round(l.width * 100) / 100),
|
|
547
|
-
onChange: (s) =>
|
|
591
|
+
onChange: (s) => p(l.id, "width", Number(s.target.value) || l.width)
|
|
548
592
|
})]
|
|
549
593
|
}),
|
|
550
594
|
/* @__PURE__ */ a("div", {
|
|
551
595
|
className: "flow-inspector-row",
|
|
552
|
-
children: [/* @__PURE__ */ e(
|
|
596
|
+
children: [/* @__PURE__ */ e(m, {
|
|
553
597
|
size: "xs",
|
|
554
598
|
className: "flow-inspector-label",
|
|
555
599
|
children: "H"
|
|
556
|
-
}), /* @__PURE__ */ e(
|
|
600
|
+
}), /* @__PURE__ */ e(b, {
|
|
557
601
|
size: "xs",
|
|
558
602
|
type: "number",
|
|
559
603
|
value: String(Math.round(l.height * 100) / 100),
|
|
560
|
-
onChange: (s) =>
|
|
604
|
+
onChange: (s) => p(l.id, "height", Number(s.target.value) || l.height)
|
|
561
605
|
})]
|
|
562
606
|
})
|
|
563
607
|
]
|
|
@@ -571,39 +615,39 @@ function re({ node: l, isGroup: p, onUpdateData: r, onUpdateDataBatch: t, onUpda
|
|
|
571
615
|
}),
|
|
572
616
|
/* @__PURE__ */ a("div", {
|
|
573
617
|
className: "flow-inspector-row",
|
|
574
|
-
children: [/* @__PURE__ */ e(
|
|
618
|
+
children: [/* @__PURE__ */ e(m, {
|
|
575
619
|
size: "xs",
|
|
576
620
|
className: "flow-inspector-label",
|
|
577
621
|
children: "Fill"
|
|
578
|
-
}), /* @__PURE__ */ e(
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
622
|
+
}), /* @__PURE__ */ e(B, {
|
|
623
|
+
value: l.data.fill,
|
|
624
|
+
kind: "fill",
|
|
625
|
+
allowTransparent: !0,
|
|
626
|
+
customFallback: "#ffffff",
|
|
627
|
+
onChange: (s) => r(l.id, "fill", s)
|
|
584
628
|
})]
|
|
585
629
|
}),
|
|
586
630
|
/* @__PURE__ */ a("div", {
|
|
587
631
|
className: "flow-inspector-row",
|
|
588
|
-
children: [/* @__PURE__ */ e(
|
|
632
|
+
children: [/* @__PURE__ */ e(m, {
|
|
589
633
|
size: "xs",
|
|
590
634
|
className: "flow-inspector-label",
|
|
591
635
|
children: "Stroke"
|
|
592
|
-
}), /* @__PURE__ */ e(
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
636
|
+
}), /* @__PURE__ */ e(B, {
|
|
637
|
+
value: l.data.stroke,
|
|
638
|
+
kind: "stroke",
|
|
639
|
+
allowTransparent: !0,
|
|
640
|
+
customFallback: "#000000",
|
|
641
|
+
onChange: (s) => r(l.id, "stroke", s)
|
|
598
642
|
})]
|
|
599
643
|
}),
|
|
600
644
|
/* @__PURE__ */ a("div", {
|
|
601
645
|
className: "flow-inspector-row",
|
|
602
|
-
children: [/* @__PURE__ */ e(
|
|
646
|
+
children: [/* @__PURE__ */ e(m, {
|
|
603
647
|
size: "xs",
|
|
604
648
|
className: "flow-inspector-label",
|
|
605
649
|
children: "Font"
|
|
606
|
-
}), /* @__PURE__ */ e(
|
|
650
|
+
}), /* @__PURE__ */ e(b, {
|
|
607
651
|
size: "xs",
|
|
608
652
|
type: "number",
|
|
609
653
|
value: String(l.data.fontSize),
|
|
@@ -612,71 +656,69 @@ function re({ node: l, isGroup: p, onUpdateData: r, onUpdateDataBatch: t, onUpda
|
|
|
612
656
|
}),
|
|
613
657
|
/* @__PURE__ */ a("div", {
|
|
614
658
|
className: "flow-inspector-row",
|
|
615
|
-
children: [/* @__PURE__ */ e(
|
|
659
|
+
children: [/* @__PURE__ */ e(m, {
|
|
616
660
|
size: "xs",
|
|
617
661
|
className: "flow-inspector-label",
|
|
618
662
|
children: "Color"
|
|
619
|
-
}), /* @__PURE__ */ e(
|
|
620
|
-
type: "color",
|
|
621
|
-
size: "xs",
|
|
663
|
+
}), /* @__PURE__ */ e(B, {
|
|
622
664
|
value: l.data.color,
|
|
623
|
-
|
|
624
|
-
|
|
665
|
+
kind: "text",
|
|
666
|
+
customFallback: "#111827",
|
|
667
|
+
onChange: (s) => r(l.id, "color", s)
|
|
625
668
|
})]
|
|
626
669
|
}),
|
|
627
670
|
/* @__PURE__ */ a("div", {
|
|
628
671
|
className: "flow-inspector-row",
|
|
629
|
-
children: [/* @__PURE__ */ e(
|
|
672
|
+
children: [/* @__PURE__ */ e(m, {
|
|
630
673
|
size: "xs",
|
|
631
674
|
className: "flow-inspector-label",
|
|
632
675
|
children: "Font Color"
|
|
633
|
-
}), /* @__PURE__ */ e(
|
|
634
|
-
type: "color",
|
|
635
|
-
size: "xs",
|
|
676
|
+
}), /* @__PURE__ */ e(B, {
|
|
636
677
|
value: l.data.labelColor ?? l.data.color,
|
|
637
|
-
|
|
638
|
-
|
|
678
|
+
kind: "text",
|
|
679
|
+
customFallback: "#111827",
|
|
680
|
+
onChange: (s) => r(l.id, "labelColor", s)
|
|
639
681
|
})]
|
|
640
682
|
}),
|
|
641
683
|
/* @__PURE__ */ a("div", {
|
|
642
684
|
className: "flow-inspector-row",
|
|
643
|
-
children: [/* @__PURE__ */ e(
|
|
685
|
+
children: [/* @__PURE__ */ e(m, {
|
|
644
686
|
size: "xs",
|
|
645
687
|
className: "flow-inspector-label",
|
|
646
688
|
children: "Border"
|
|
647
|
-
}), /* @__PURE__ */ e(
|
|
689
|
+
}), /* @__PURE__ */ e(k, {
|
|
648
690
|
options: [{
|
|
649
691
|
value: "none",
|
|
650
692
|
label: "none"
|
|
651
|
-
},
|
|
693
|
+
}, ...q.map((s) => ({
|
|
652
694
|
value: s,
|
|
653
695
|
label: s
|
|
654
696
|
}))],
|
|
655
|
-
value: l.data.borderStyle ?? (
|
|
697
|
+
value: l.data.borderStyle ?? (c ? l.type === "geometryGroup" ? "dashed" : "dotted" : "solid"),
|
|
656
698
|
onChange: (s) => r(l.id, "borderStyle", s),
|
|
657
699
|
style: { fontSize: 12 }
|
|
658
700
|
})]
|
|
659
701
|
}),
|
|
660
|
-
l.type === "shapeSvg" && /* @__PURE__ */ a(
|
|
702
|
+
l.type === "shapeSvg" && /* @__PURE__ */ a(L, { children: [
|
|
661
703
|
/* @__PURE__ */ a("div", {
|
|
662
704
|
className: "flow-inspector-row",
|
|
663
|
-
children: [/* @__PURE__ */ e(
|
|
705
|
+
children: [/* @__PURE__ */ e(m, {
|
|
664
706
|
size: "xs",
|
|
665
707
|
className: "flow-inspector-label",
|
|
666
708
|
children: "Icon"
|
|
667
|
-
}), /* @__PURE__ */ e(
|
|
668
|
-
options:
|
|
709
|
+
}), /* @__PURE__ */ e(k, {
|
|
710
|
+
options: te().map((s) => ({
|
|
669
711
|
value: s.id,
|
|
670
712
|
label: s.label
|
|
671
713
|
})),
|
|
672
714
|
value: l.data.svgId ?? "",
|
|
673
715
|
placeholder: "选择图标",
|
|
674
716
|
onChange: (s) => {
|
|
675
|
-
const
|
|
717
|
+
const u = ne(String(s));
|
|
676
718
|
t(l.id, {
|
|
677
719
|
svgId: s,
|
|
678
|
-
...
|
|
679
|
-
...!l.data.label || l.data.label === "Text" ? { label:
|
|
720
|
+
...u?.brandColor ? { color: u.brandColor } : {},
|
|
721
|
+
...!l.data.label || l.data.label === "Text" ? { label: u?.label ?? String(s) } : {}
|
|
680
722
|
});
|
|
681
723
|
},
|
|
682
724
|
style: { fontSize: 12 }
|
|
@@ -684,11 +726,11 @@ function re({ node: l, isGroup: p, onUpdateData: r, onUpdateDataBatch: t, onUpda
|
|
|
684
726
|
}),
|
|
685
727
|
/* @__PURE__ */ a("div", {
|
|
686
728
|
className: "flow-inspector-row",
|
|
687
|
-
children: [/* @__PURE__ */ e(
|
|
729
|
+
children: [/* @__PURE__ */ e(m, {
|
|
688
730
|
size: "xs",
|
|
689
731
|
className: "flow-inspector-label",
|
|
690
732
|
children: "Box"
|
|
691
|
-
}), /* @__PURE__ */ e(
|
|
733
|
+
}), /* @__PURE__ */ e(X, {
|
|
692
734
|
size: "sm",
|
|
693
735
|
checked: l.data.iconBox ?? !1,
|
|
694
736
|
onChange: (s) => r(l.id, "iconBox", s),
|
|
@@ -697,11 +739,11 @@ function re({ node: l, isGroup: p, onUpdateData: r, onUpdateDataBatch: t, onUpda
|
|
|
697
739
|
}),
|
|
698
740
|
/* @__PURE__ */ a("div", {
|
|
699
741
|
className: "flow-inspector-row",
|
|
700
|
-
children: [/* @__PURE__ */ e(
|
|
742
|
+
children: [/* @__PURE__ */ e(m, {
|
|
701
743
|
size: "xs",
|
|
702
744
|
className: "flow-inspector-label",
|
|
703
745
|
children: "Label"
|
|
704
|
-
}), /* @__PURE__ */ e(
|
|
746
|
+
}), /* @__PURE__ */ e(k, {
|
|
705
747
|
options: [
|
|
706
748
|
{
|
|
707
749
|
value: "top",
|
|
@@ -731,11 +773,11 @@ function re({ node: l, isGroup: p, onUpdateData: r, onUpdateDataBatch: t, onUpda
|
|
|
731
773
|
}),
|
|
732
774
|
/* @__PURE__ */ a("div", {
|
|
733
775
|
className: "flow-inspector-row",
|
|
734
|
-
children: [/* @__PURE__ */ e(
|
|
776
|
+
children: [/* @__PURE__ */ e(m, {
|
|
735
777
|
size: "xs",
|
|
736
778
|
className: "flow-inspector-label",
|
|
737
779
|
children: "Offset X"
|
|
738
|
-
}), /* @__PURE__ */ e(
|
|
780
|
+
}), /* @__PURE__ */ e(b, {
|
|
739
781
|
size: "xs",
|
|
740
782
|
type: "number",
|
|
741
783
|
value: String(l.data.labelOffsetX ?? 0),
|
|
@@ -744,11 +786,11 @@ function re({ node: l, isGroup: p, onUpdateData: r, onUpdateDataBatch: t, onUpda
|
|
|
744
786
|
}),
|
|
745
787
|
/* @__PURE__ */ a("div", {
|
|
746
788
|
className: "flow-inspector-row",
|
|
747
|
-
children: [/* @__PURE__ */ e(
|
|
789
|
+
children: [/* @__PURE__ */ e(m, {
|
|
748
790
|
size: "xs",
|
|
749
791
|
className: "flow-inspector-label",
|
|
750
792
|
children: "Offset Y"
|
|
751
|
-
}), /* @__PURE__ */ e(
|
|
793
|
+
}), /* @__PURE__ */ e(b, {
|
|
752
794
|
size: "xs",
|
|
753
795
|
type: "number",
|
|
754
796
|
value: String(l.data.labelOffsetY ?? 0),
|
|
@@ -758,7 +800,7 @@ function re({ node: l, isGroup: p, onUpdateData: r, onUpdateDataBatch: t, onUpda
|
|
|
758
800
|
] })
|
|
759
801
|
]
|
|
760
802
|
}),
|
|
761
|
-
l.type === "mediaNode" && /* @__PURE__ */ e(
|
|
803
|
+
l.type === "mediaNode" && /* @__PURE__ */ e(fe, {
|
|
762
804
|
node: l,
|
|
763
805
|
onUpdateData: r
|
|
764
806
|
}),
|
|
@@ -772,12 +814,12 @@ function re({ node: l, isGroup: p, onUpdateData: r, onUpdateDataBatch: t, onUpda
|
|
|
772
814
|
/* @__PURE__ */ a("div", {
|
|
773
815
|
className: "flow-inspector-row",
|
|
774
816
|
children: [
|
|
775
|
-
/* @__PURE__ */ e(
|
|
817
|
+
/* @__PURE__ */ e(m, {
|
|
776
818
|
size: "xs",
|
|
777
819
|
className: "flow-inspector-label",
|
|
778
820
|
children: "Rotate"
|
|
779
821
|
}),
|
|
780
|
-
/* @__PURE__ */ e(
|
|
822
|
+
/* @__PURE__ */ e(b, {
|
|
781
823
|
size: "xs",
|
|
782
824
|
type: "number",
|
|
783
825
|
value: String(l.data.rotation ?? 0),
|
|
@@ -796,12 +838,12 @@ function re({ node: l, isGroup: p, onUpdateData: r, onUpdateDataBatch: t, onUpda
|
|
|
796
838
|
/* @__PURE__ */ a("div", {
|
|
797
839
|
className: "flow-inspector-row",
|
|
798
840
|
children: [
|
|
799
|
-
/* @__PURE__ */ e(
|
|
841
|
+
/* @__PURE__ */ e(m, {
|
|
800
842
|
size: "xs",
|
|
801
843
|
className: "flow-inspector-label",
|
|
802
844
|
children: "Flip"
|
|
803
845
|
}),
|
|
804
|
-
/* @__PURE__ */ e(
|
|
846
|
+
/* @__PURE__ */ e(g, {
|
|
805
847
|
size: "xs",
|
|
806
848
|
variant: l.data.flipX ? "primary" : "ghost",
|
|
807
849
|
onClick: () => r(l.id, "flipX", !l.data.flipX),
|
|
@@ -811,7 +853,7 @@ function re({ node: l, isGroup: p, onUpdateData: r, onUpdateDataBatch: t, onUpda
|
|
|
811
853
|
children: "↔"
|
|
812
854
|
})
|
|
813
855
|
}),
|
|
814
|
-
/* @__PURE__ */ e(
|
|
856
|
+
/* @__PURE__ */ e(g, {
|
|
815
857
|
size: "xs",
|
|
816
858
|
variant: l.data.flipY ? "primary" : "ghost",
|
|
817
859
|
onClick: () => r(l.id, "flipY", !l.data.flipY),
|
|
@@ -826,18 +868,18 @@ function re({ node: l, isGroup: p, onUpdateData: r, onUpdateDataBatch: t, onUpda
|
|
|
826
868
|
/* @__PURE__ */ a("div", {
|
|
827
869
|
className: "flow-inspector-row",
|
|
828
870
|
children: [
|
|
829
|
-
/* @__PURE__ */ e(
|
|
871
|
+
/* @__PURE__ */ e(m, {
|
|
830
872
|
size: "xs",
|
|
831
873
|
className: "flow-inspector-label",
|
|
832
874
|
children: "Quick"
|
|
833
875
|
}),
|
|
834
|
-
/* @__PURE__ */ e(
|
|
876
|
+
/* @__PURE__ */ e(g, {
|
|
835
877
|
size: "xs",
|
|
836
878
|
variant: "ghost",
|
|
837
879
|
onClick: () => r(l.id, "rotation", ((l.data.rotation ?? 0) + 90) % 360),
|
|
838
880
|
children: "+90°"
|
|
839
881
|
}),
|
|
840
|
-
/* @__PURE__ */ e(
|
|
882
|
+
/* @__PURE__ */ e(g, {
|
|
841
883
|
size: "xs",
|
|
842
884
|
variant: "ghost",
|
|
843
885
|
onClick: () => r(l.id, "rotation", ((l.data.rotation ?? 0) - 90 + 360) % 360),
|
|
@@ -849,14 +891,14 @@ function re({ node: l, isGroup: p, onUpdateData: r, onUpdateDataBatch: t, onUpda
|
|
|
849
891
|
})
|
|
850
892
|
] });
|
|
851
893
|
}
|
|
852
|
-
function
|
|
853
|
-
const r = l.data.mediaKind ?? "markdown", t = l.data.aiConfig,
|
|
854
|
-
|
|
894
|
+
function fe({ node: l, onUpdateData: c }) {
|
|
895
|
+
const r = l.data.mediaKind ?? "markdown", t = l.data.aiConfig, p = me(null), f = (s, u) => {
|
|
896
|
+
c(l.id, "aiConfig", {
|
|
855
897
|
gateway: "",
|
|
856
898
|
protocol: "openai",
|
|
857
899
|
model: "",
|
|
858
900
|
...t,
|
|
859
|
-
[s]:
|
|
901
|
+
[s]: u
|
|
860
902
|
});
|
|
861
903
|
};
|
|
862
904
|
return /* @__PURE__ */ a("div", {
|
|
@@ -864,17 +906,17 @@ function ce({ node: l, onUpdateData: p }) {
|
|
|
864
906
|
children: [/* @__PURE__ */ a("div", {
|
|
865
907
|
className: "flow-inspector-section-title",
|
|
866
908
|
children: ["Media · ", r]
|
|
867
|
-
}), r === "data" ? /* @__PURE__ */ e(
|
|
909
|
+
}), r === "data" ? /* @__PURE__ */ e(de, {
|
|
868
910
|
node: l,
|
|
869
|
-
onUpdateData:
|
|
870
|
-
}) : r === "model3d" ? /* @__PURE__ */ a(
|
|
911
|
+
onUpdateData: c
|
|
912
|
+
}) : r === "model3d" ? /* @__PURE__ */ a(L, { children: [
|
|
871
913
|
/* @__PURE__ */ a("div", {
|
|
872
914
|
className: "flow-inspector-row",
|
|
873
|
-
children: [/* @__PURE__ */ e(
|
|
915
|
+
children: [/* @__PURE__ */ e(m, {
|
|
874
916
|
size: "xs",
|
|
875
917
|
className: "flow-inspector-label",
|
|
876
918
|
children: "格式"
|
|
877
|
-
}), /* @__PURE__ */ e(
|
|
919
|
+
}), /* @__PURE__ */ e(k, {
|
|
878
920
|
options: [
|
|
879
921
|
{
|
|
880
922
|
value: "stl",
|
|
@@ -890,57 +932,57 @@ function ce({ node: l, onUpdateData: p }) {
|
|
|
890
932
|
}
|
|
891
933
|
],
|
|
892
934
|
value: l.data.modelFormat ?? "stl",
|
|
893
|
-
onChange: (s) =>
|
|
935
|
+
onChange: (s) => c(l.id, "modelFormat", s)
|
|
894
936
|
})]
|
|
895
937
|
}),
|
|
896
938
|
/* @__PURE__ */ a("div", {
|
|
897
939
|
className: "flow-inspector-row flow-inspector-multiline",
|
|
898
|
-
children: [/* @__PURE__ */ e(
|
|
940
|
+
children: [/* @__PURE__ */ e(m, {
|
|
899
941
|
size: "xs",
|
|
900
942
|
className: "flow-inspector-label",
|
|
901
943
|
children: "模型链接"
|
|
902
|
-
}), /* @__PURE__ */ e(
|
|
944
|
+
}), /* @__PURE__ */ e(b, {
|
|
903
945
|
size: "xs",
|
|
904
946
|
value: l.data.mediaContent ?? "",
|
|
905
947
|
placeholder: "https://example.com/model.stl",
|
|
906
|
-
onChange: (s) =>
|
|
948
|
+
onChange: (s) => c(l.id, "mediaContent", s.target.value)
|
|
907
949
|
})]
|
|
908
950
|
}),
|
|
909
951
|
/* @__PURE__ */ a("div", {
|
|
910
952
|
className: "flow-inspector-row",
|
|
911
953
|
children: [
|
|
912
|
-
/* @__PURE__ */ e(
|
|
954
|
+
/* @__PURE__ */ e(m, {
|
|
913
955
|
size: "xs",
|
|
914
956
|
className: "flow-inspector-label",
|
|
915
957
|
children: "本地模型"
|
|
916
958
|
}),
|
|
917
959
|
/* @__PURE__ */ e("input", {
|
|
918
|
-
ref:
|
|
960
|
+
ref: p,
|
|
919
961
|
type: "file",
|
|
920
962
|
accept: ".stl,.obj,.3mf,model/stl,model/obj,model/3mf,application/vnd.ms-package.3dmanufacturing-3dmodel+xml",
|
|
921
963
|
hidden: !0,
|
|
922
964
|
onChange: (s) => {
|
|
923
|
-
const
|
|
924
|
-
if (s.target.value = "", !
|
|
925
|
-
if (
|
|
965
|
+
const u = s.target.files?.[0];
|
|
966
|
+
if (s.target.value = "", !u) return;
|
|
967
|
+
if (u.size > 10 * 1024 * 1024) {
|
|
926
968
|
window.alert("本地模型不能超过 10 MiB,请改用模型链接。");
|
|
927
969
|
return;
|
|
928
970
|
}
|
|
929
|
-
const
|
|
930
|
-
if (
|
|
971
|
+
const S = u.name.split(".").pop()?.toLowerCase();
|
|
972
|
+
if (S !== "stl" && S !== "obj" && S !== "3mf") {
|
|
931
973
|
window.alert("仅支持 STL、OBJ 和 3MF 模型。");
|
|
932
974
|
return;
|
|
933
975
|
}
|
|
934
|
-
const
|
|
935
|
-
|
|
936
|
-
typeof
|
|
937
|
-
},
|
|
976
|
+
const z = new FileReader();
|
|
977
|
+
z.onload = () => {
|
|
978
|
+
typeof z.result == "string" && (c(l.id, "modelFormat", S), c(l.id, "mediaContent", z.result));
|
|
979
|
+
}, z.onerror = () => window.alert("读取本地模型失败。"), z.readAsDataURL(u);
|
|
938
980
|
}
|
|
939
981
|
}),
|
|
940
|
-
/* @__PURE__ */ e(
|
|
982
|
+
/* @__PURE__ */ e(g, {
|
|
941
983
|
size: "xs",
|
|
942
984
|
variant: "neutral",
|
|
943
|
-
onClick: () =>
|
|
985
|
+
onClick: () => p.current?.click(),
|
|
944
986
|
children: "选择文件"
|
|
945
987
|
}),
|
|
946
988
|
l.data.mediaContent?.startsWith("data:") && /* @__PURE__ */ e("span", {
|
|
@@ -953,22 +995,22 @@ function ce({ node: l, onUpdateData: p }) {
|
|
|
953
995
|
className: "flow-inspector-help",
|
|
954
996
|
children: "支持 STL、OBJ、3MF;本地文件将以 Base64 嵌入文档,最大 10 MiB。选中节点后可在内部拖拽旋转、滚轮缩放。"
|
|
955
997
|
})
|
|
956
|
-
] }) : r === "image" ? /* @__PURE__ */ a(
|
|
998
|
+
] }) : r === "image" ? /* @__PURE__ */ a(L, { children: [/* @__PURE__ */ a("div", {
|
|
957
999
|
className: "flow-inspector-row flow-inspector-multiline",
|
|
958
|
-
children: [/* @__PURE__ */ e(
|
|
1000
|
+
children: [/* @__PURE__ */ e(m, {
|
|
959
1001
|
size: "xs",
|
|
960
1002
|
className: "flow-inspector-label",
|
|
961
1003
|
children: "图片链接"
|
|
962
|
-
}), /* @__PURE__ */ e(
|
|
1004
|
+
}), /* @__PURE__ */ e(b, {
|
|
963
1005
|
size: "xs",
|
|
964
1006
|
value: l.data.mediaContent ?? "",
|
|
965
1007
|
placeholder: "https://example.com/image.png",
|
|
966
|
-
onChange: (s) =>
|
|
1008
|
+
onChange: (s) => c(l.id, "mediaContent", s.target.value)
|
|
967
1009
|
})]
|
|
968
1010
|
}), /* @__PURE__ */ e("div", {
|
|
969
1011
|
className: "flow-inspector-help",
|
|
970
1012
|
children: "支持 HTTP(S) 链接;选中图片节点后可直接粘贴图片并保存为 Base64。"
|
|
971
|
-
})] }) : r !== "ai" ? /* @__PURE__ */ e(
|
|
1013
|
+
})] }) : r !== "ai" ? /* @__PURE__ */ e(Z, {
|
|
972
1014
|
label: {
|
|
973
1015
|
markdown: "Markdown 源码",
|
|
974
1016
|
html: "HTML 源码",
|
|
@@ -976,16 +1018,16 @@ function ce({ node: l, onUpdateData: p }) {
|
|
|
976
1018
|
math: "LaTeX 公式"
|
|
977
1019
|
}[r] ?? "内容",
|
|
978
1020
|
value: l.data.mediaContent ?? "",
|
|
979
|
-
onChange: (s) =>
|
|
1021
|
+
onChange: (s) => c(l.id, "mediaContent", s),
|
|
980
1022
|
rows: 8
|
|
981
|
-
}) : /* @__PURE__ */ a(
|
|
1023
|
+
}) : /* @__PURE__ */ a(L, { children: [
|
|
982
1024
|
/* @__PURE__ */ a("div", {
|
|
983
1025
|
className: "flow-inspector-row",
|
|
984
|
-
children: [/* @__PURE__ */ e(
|
|
1026
|
+
children: [/* @__PURE__ */ e(m, {
|
|
985
1027
|
size: "xs",
|
|
986
1028
|
className: "flow-inspector-label",
|
|
987
1029
|
children: "协议"
|
|
988
|
-
}), /* @__PURE__ */ e(
|
|
1030
|
+
}), /* @__PURE__ */ e(k, {
|
|
989
1031
|
options: [{
|
|
990
1032
|
value: "openai",
|
|
991
1033
|
label: "OpenAI 兼容"
|
|
@@ -994,7 +1036,7 @@ function ce({ node: l, onUpdateData: p }) {
|
|
|
994
1036
|
label: "Anthropic 兼容"
|
|
995
1037
|
}],
|
|
996
1038
|
value: t?.protocol ?? "openai",
|
|
997
|
-
onChange: (s) =>
|
|
1039
|
+
onChange: (s) => f("protocol", s),
|
|
998
1040
|
style: { fontSize: 12 }
|
|
999
1041
|
})]
|
|
1000
1042
|
}),
|
|
@@ -1005,15 +1047,15 @@ function ce({ node: l, onUpdateData: p }) {
|
|
|
1005
1047
|
alignItems: "stretch",
|
|
1006
1048
|
gap: 4
|
|
1007
1049
|
},
|
|
1008
|
-
children: [/* @__PURE__ */ e(
|
|
1050
|
+
children: [/* @__PURE__ */ e(m, {
|
|
1009
1051
|
size: "xs",
|
|
1010
1052
|
className: "flow-inspector-label",
|
|
1011
1053
|
children: "接口地址"
|
|
1012
|
-
}), /* @__PURE__ */ e(
|
|
1054
|
+
}), /* @__PURE__ */ e(b, {
|
|
1013
1055
|
size: "xs",
|
|
1014
1056
|
value: t?.gateway ?? "",
|
|
1015
1057
|
placeholder: "https://api.openai.com/v1/chat/completions",
|
|
1016
|
-
onChange: (s) =>
|
|
1058
|
+
onChange: (s) => f("gateway", s.target.value)
|
|
1017
1059
|
})]
|
|
1018
1060
|
}),
|
|
1019
1061
|
/* @__PURE__ */ a("div", {
|
|
@@ -1023,15 +1065,15 @@ function ce({ node: l, onUpdateData: p }) {
|
|
|
1023
1065
|
alignItems: "stretch",
|
|
1024
1066
|
gap: 4
|
|
1025
1067
|
},
|
|
1026
|
-
children: [/* @__PURE__ */ e(
|
|
1068
|
+
children: [/* @__PURE__ */ e(m, {
|
|
1027
1069
|
size: "xs",
|
|
1028
1070
|
className: "flow-inspector-label",
|
|
1029
1071
|
children: "模型"
|
|
1030
|
-
}), /* @__PURE__ */ e(
|
|
1072
|
+
}), /* @__PURE__ */ e(b, {
|
|
1031
1073
|
size: "xs",
|
|
1032
1074
|
value: t?.model ?? "",
|
|
1033
1075
|
placeholder: "gpt-4o-mini",
|
|
1034
|
-
onChange: (s) =>
|
|
1076
|
+
onChange: (s) => f("model", s.target.value)
|
|
1035
1077
|
})]
|
|
1036
1078
|
}),
|
|
1037
1079
|
/* @__PURE__ */ a("div", {
|
|
@@ -1041,22 +1083,22 @@ function ce({ node: l, onUpdateData: p }) {
|
|
|
1041
1083
|
alignItems: "stretch",
|
|
1042
1084
|
gap: 4
|
|
1043
1085
|
},
|
|
1044
|
-
children: [/* @__PURE__ */ e(
|
|
1086
|
+
children: [/* @__PURE__ */ e(m, {
|
|
1045
1087
|
size: "xs",
|
|
1046
1088
|
className: "flow-inspector-label",
|
|
1047
1089
|
children: "API Key"
|
|
1048
|
-
}), /* @__PURE__ */ e(
|
|
1090
|
+
}), /* @__PURE__ */ e(b, {
|
|
1049
1091
|
size: "xs",
|
|
1050
1092
|
type: "password",
|
|
1051
1093
|
value: t?.apiKey ?? "",
|
|
1052
1094
|
placeholder: "sk-...",
|
|
1053
|
-
onChange: (s) =>
|
|
1095
|
+
onChange: (s) => f("apiKey", s.target.value)
|
|
1054
1096
|
})]
|
|
1055
1097
|
}),
|
|
1056
|
-
/* @__PURE__ */ e(
|
|
1098
|
+
/* @__PURE__ */ e(Z, {
|
|
1057
1099
|
label: "System Prompt",
|
|
1058
1100
|
value: t?.systemPrompt ?? "",
|
|
1059
|
-
onChange: (s) =>
|
|
1101
|
+
onChange: (s) => f("systemPrompt", s),
|
|
1060
1102
|
rows: 3
|
|
1061
1103
|
}),
|
|
1062
1104
|
/* @__PURE__ */ e("div", {
|
|
@@ -1070,7 +1112,7 @@ function ce({ node: l, onUpdateData: p }) {
|
|
|
1070
1112
|
] })]
|
|
1071
1113
|
});
|
|
1072
1114
|
}
|
|
1073
|
-
function
|
|
1115
|
+
function ue({ edge: l, onUpdateData: c, onUpdateType: r }) {
|
|
1074
1116
|
return /* @__PURE__ */ a("div", {
|
|
1075
1117
|
className: "flow-inspector-section",
|
|
1076
1118
|
children: [
|
|
@@ -1080,12 +1122,12 @@ function de({ edge: l, onUpdateData: p, onUpdateType: r }) {
|
|
|
1080
1122
|
}),
|
|
1081
1123
|
/* @__PURE__ */ a("div", {
|
|
1082
1124
|
className: "flow-inspector-row",
|
|
1083
|
-
children: [/* @__PURE__ */ e(
|
|
1125
|
+
children: [/* @__PURE__ */ e(m, {
|
|
1084
1126
|
size: "xs",
|
|
1085
1127
|
className: "flow-inspector-label",
|
|
1086
1128
|
children: "Type"
|
|
1087
|
-
}), /* @__PURE__ */ e(
|
|
1088
|
-
options:
|
|
1129
|
+
}), /* @__PURE__ */ e(k, {
|
|
1130
|
+
options: D.map((t) => ({
|
|
1089
1131
|
value: t,
|
|
1090
1132
|
label: t
|
|
1091
1133
|
})),
|
|
@@ -1096,109 +1138,108 @@ function de({ edge: l, onUpdateData: p, onUpdateType: r }) {
|
|
|
1096
1138
|
}),
|
|
1097
1139
|
/* @__PURE__ */ a("div", {
|
|
1098
1140
|
className: "flow-inspector-row",
|
|
1099
|
-
children: [/* @__PURE__ */ e(
|
|
1141
|
+
children: [/* @__PURE__ */ e(m, {
|
|
1100
1142
|
size: "xs",
|
|
1101
1143
|
className: "flow-inspector-label",
|
|
1102
1144
|
children: "Color"
|
|
1103
|
-
}), /* @__PURE__ */ e(
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
onChange: (t) =>
|
|
1108
|
-
className: "flow-inspector-color flow-inspector-compact"
|
|
1145
|
+
}), /* @__PURE__ */ e(B, {
|
|
1146
|
+
value: l.data.strokeColor,
|
|
1147
|
+
kind: "line",
|
|
1148
|
+
customFallback: "#374151",
|
|
1149
|
+
onChange: (t) => c(l.id, "strokeColor", t)
|
|
1109
1150
|
})]
|
|
1110
1151
|
}),
|
|
1111
1152
|
/* @__PURE__ */ a("div", {
|
|
1112
1153
|
className: "flow-inspector-row",
|
|
1113
|
-
children: [/* @__PURE__ */ e(
|
|
1154
|
+
children: [/* @__PURE__ */ e(m, {
|
|
1114
1155
|
size: "xs",
|
|
1115
1156
|
className: "flow-inspector-label",
|
|
1116
1157
|
children: "Width"
|
|
1117
|
-
}), /* @__PURE__ */ e(
|
|
1158
|
+
}), /* @__PURE__ */ e(b, {
|
|
1118
1159
|
size: "xs",
|
|
1119
1160
|
type: "number",
|
|
1120
1161
|
value: String(l.data.strokeWidth ?? 2),
|
|
1121
|
-
onChange: (t) =>
|
|
1162
|
+
onChange: (t) => c(l.id, "strokeWidth", Number(t.target.value) || 2)
|
|
1122
1163
|
})]
|
|
1123
1164
|
}),
|
|
1124
1165
|
/* @__PURE__ */ a("div", {
|
|
1125
1166
|
className: "flow-inspector-row",
|
|
1126
|
-
children: [/* @__PURE__ */ e(
|
|
1167
|
+
children: [/* @__PURE__ */ e(m, {
|
|
1127
1168
|
size: "xs",
|
|
1128
1169
|
className: "flow-inspector-label",
|
|
1129
1170
|
children: "Animation"
|
|
1130
|
-
}), /* @__PURE__ */ e(
|
|
1171
|
+
}), /* @__PURE__ */ e(X, {
|
|
1131
1172
|
size: "sm",
|
|
1132
1173
|
checked: l.data.animated ?? !1,
|
|
1133
|
-
onChange: (t) =>
|
|
1174
|
+
onChange: (t) => c(l.id, "animated", t),
|
|
1134
1175
|
label: "预览时播放"
|
|
1135
1176
|
})]
|
|
1136
1177
|
}),
|
|
1137
1178
|
/* @__PURE__ */ a("div", {
|
|
1138
1179
|
className: "flow-inspector-row",
|
|
1139
|
-
children: [/* @__PURE__ */ e(
|
|
1180
|
+
children: [/* @__PURE__ */ e(m, {
|
|
1140
1181
|
size: "xs",
|
|
1141
1182
|
className: "flow-inspector-label",
|
|
1142
1183
|
children: "Line"
|
|
1143
|
-
}), /* @__PURE__ */ e(
|
|
1144
|
-
options:
|
|
1184
|
+
}), /* @__PURE__ */ e(k, {
|
|
1185
|
+
options: $.map((t) => ({
|
|
1145
1186
|
value: t,
|
|
1146
1187
|
label: t
|
|
1147
1188
|
})),
|
|
1148
1189
|
value: l.data.lineStyle ?? "solid",
|
|
1149
|
-
onChange: (t) =>
|
|
1190
|
+
onChange: (t) => c(l.id, "lineStyle", t),
|
|
1150
1191
|
style: { fontSize: 12 }
|
|
1151
1192
|
})]
|
|
1152
1193
|
}),
|
|
1153
1194
|
/* @__PURE__ */ a("div", {
|
|
1154
1195
|
className: "flow-inspector-row",
|
|
1155
|
-
children: [/* @__PURE__ */ e(
|
|
1196
|
+
children: [/* @__PURE__ */ e(m, {
|
|
1156
1197
|
size: "xs",
|
|
1157
1198
|
className: "flow-inspector-label",
|
|
1158
1199
|
children: "Start"
|
|
1159
|
-
}), /* @__PURE__ */ e(
|
|
1160
|
-
options:
|
|
1200
|
+
}), /* @__PURE__ */ e(k, {
|
|
1201
|
+
options: Y.map((t) => ({
|
|
1161
1202
|
value: t,
|
|
1162
1203
|
label: t
|
|
1163
1204
|
})),
|
|
1164
1205
|
value: l.data.markerStart ?? "none",
|
|
1165
|
-
onChange: (t) =>
|
|
1206
|
+
onChange: (t) => c(l.id, "markerStart", t),
|
|
1166
1207
|
style: { fontSize: 12 }
|
|
1167
1208
|
})]
|
|
1168
1209
|
}),
|
|
1169
1210
|
/* @__PURE__ */ a("div", {
|
|
1170
1211
|
className: "flow-inspector-row",
|
|
1171
|
-
children: [/* @__PURE__ */ e(
|
|
1212
|
+
children: [/* @__PURE__ */ e(m, {
|
|
1172
1213
|
size: "xs",
|
|
1173
1214
|
className: "flow-inspector-label",
|
|
1174
1215
|
children: "End"
|
|
1175
|
-
}), /* @__PURE__ */ e(
|
|
1176
|
-
options:
|
|
1216
|
+
}), /* @__PURE__ */ e(k, {
|
|
1217
|
+
options: Y.map((t) => ({
|
|
1177
1218
|
value: t,
|
|
1178
1219
|
label: t
|
|
1179
1220
|
})),
|
|
1180
1221
|
value: l.data.markerEnd ?? "none",
|
|
1181
|
-
onChange: (t) =>
|
|
1222
|
+
onChange: (t) => c(l.id, "markerEnd", t),
|
|
1182
1223
|
style: { fontSize: 12 }
|
|
1183
1224
|
})]
|
|
1184
1225
|
}),
|
|
1185
1226
|
/* @__PURE__ */ a("div", {
|
|
1186
1227
|
className: "flow-inspector-row",
|
|
1187
|
-
children: [/* @__PURE__ */ e(
|
|
1228
|
+
children: [/* @__PURE__ */ e(m, {
|
|
1188
1229
|
size: "xs",
|
|
1189
1230
|
className: "flow-inspector-label",
|
|
1190
1231
|
children: "Label"
|
|
1191
|
-
}), /* @__PURE__ */ e(
|
|
1232
|
+
}), /* @__PURE__ */ e(b, {
|
|
1192
1233
|
size: "xs",
|
|
1193
1234
|
value: l.data.labelText ?? "",
|
|
1194
|
-
onChange: (t) =>
|
|
1235
|
+
onChange: (t) => c(l.id, "labelText", t.target.value),
|
|
1195
1236
|
placeholder: "Edge label"
|
|
1196
1237
|
})]
|
|
1197
1238
|
})
|
|
1198
1239
|
]
|
|
1199
1240
|
});
|
|
1200
1241
|
}
|
|
1201
|
-
function
|
|
1242
|
+
function we({ line: l, onUpdateData: c }) {
|
|
1202
1243
|
return /* @__PURE__ */ a("div", {
|
|
1203
1244
|
className: "flow-inspector-section",
|
|
1204
1245
|
children: [
|
|
@@ -1208,7 +1249,7 @@ function pe({ line: l, onUpdateData: p }) {
|
|
|
1208
1249
|
}),
|
|
1209
1250
|
/* @__PURE__ */ a("div", {
|
|
1210
1251
|
className: "flow-inspector-row",
|
|
1211
|
-
children: [/* @__PURE__ */ e(
|
|
1252
|
+
children: [/* @__PURE__ */ e(m, {
|
|
1212
1253
|
size: "xs",
|
|
1213
1254
|
className: "flow-inspector-label",
|
|
1214
1255
|
children: "Type"
|
|
@@ -1222,44 +1263,43 @@ function pe({ line: l, onUpdateData: p }) {
|
|
|
1222
1263
|
}),
|
|
1223
1264
|
/* @__PURE__ */ a("div", {
|
|
1224
1265
|
className: "flow-inspector-row",
|
|
1225
|
-
children: [/* @__PURE__ */ e(
|
|
1266
|
+
children: [/* @__PURE__ */ e(m, {
|
|
1226
1267
|
size: "xs",
|
|
1227
1268
|
className: "flow-inspector-label",
|
|
1228
1269
|
children: "Color"
|
|
1229
|
-
}), /* @__PURE__ */ e(
|
|
1230
|
-
type: "color",
|
|
1231
|
-
size: "xs",
|
|
1270
|
+
}), /* @__PURE__ */ e(B, {
|
|
1232
1271
|
value: l.strokeColor,
|
|
1233
|
-
|
|
1234
|
-
|
|
1272
|
+
kind: "line",
|
|
1273
|
+
customFallback: "#374151",
|
|
1274
|
+
onChange: (r) => c(l.id, "strokeColor", r)
|
|
1235
1275
|
})]
|
|
1236
1276
|
}),
|
|
1237
1277
|
/* @__PURE__ */ a("div", {
|
|
1238
1278
|
className: "flow-inspector-row",
|
|
1239
|
-
children: [/* @__PURE__ */ e(
|
|
1279
|
+
children: [/* @__PURE__ */ e(m, {
|
|
1240
1280
|
size: "xs",
|
|
1241
1281
|
className: "flow-inspector-label",
|
|
1242
1282
|
children: "Width"
|
|
1243
|
-
}), /* @__PURE__ */ e(
|
|
1283
|
+
}), /* @__PURE__ */ e(b, {
|
|
1244
1284
|
size: "xs",
|
|
1245
1285
|
type: "number",
|
|
1246
1286
|
value: String(l.strokeWidth),
|
|
1247
|
-
onChange: (r) =>
|
|
1287
|
+
onChange: (r) => c(l.id, "strokeWidth", Number(r.target.value) || 2)
|
|
1248
1288
|
})]
|
|
1249
1289
|
}),
|
|
1250
1290
|
/* @__PURE__ */ a("div", {
|
|
1251
1291
|
className: "flow-inspector-row",
|
|
1252
|
-
children: [/* @__PURE__ */ e(
|
|
1292
|
+
children: [/* @__PURE__ */ e(m, {
|
|
1253
1293
|
size: "xs",
|
|
1254
1294
|
className: "flow-inspector-label",
|
|
1255
1295
|
children: "Style"
|
|
1256
|
-
}), /* @__PURE__ */ e(
|
|
1257
|
-
options:
|
|
1296
|
+
}), /* @__PURE__ */ e(k, {
|
|
1297
|
+
options: $.map((r) => ({
|
|
1258
1298
|
value: r,
|
|
1259
1299
|
label: r
|
|
1260
1300
|
})),
|
|
1261
1301
|
value: l.lineStyle,
|
|
1262
|
-
onChange: (r) =>
|
|
1302
|
+
onChange: (r) => c(l.id, "lineStyle", r),
|
|
1263
1303
|
style: { fontSize: 12 }
|
|
1264
1304
|
})]
|
|
1265
1305
|
})
|
|
@@ -1267,8 +1307,8 @@ function pe({ line: l, onUpdateData: p }) {
|
|
|
1267
1307
|
});
|
|
1268
1308
|
}
|
|
1269
1309
|
export {
|
|
1270
|
-
|
|
1271
|
-
|
|
1310
|
+
he as InspectorPanelContent,
|
|
1311
|
+
Pe as default
|
|
1272
1312
|
};
|
|
1273
1313
|
|
|
1274
1314
|
//# sourceMappingURL=InspectorPanel.js.map
|