dishui 0.0.59 → 0.0.60
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/Flow/Flow.js +517 -543
- package/dist/components/pro/Flow/Flow.js.map +1 -1
- package/dist/components/pro/Flow/FlowCanvas.js +1092 -947
- package/dist/components/pro/Flow/FlowCanvas.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowUIContext.d.ts +3 -0
- package/dist/components/pro/Flow/context/FlowUIContext.js +67 -64
- package/dist/components/pro/Flow/context/FlowUIContext.js.map +1 -1
- package/dist/components/pro/Flow/edges/EdgeRenderer.js +1 -1
- package/dist/components/pro/Flow/edges/edgePaths.js +170 -159
- package/dist/components/pro/Flow/edges/edgePaths.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useDeleteSelection.d.ts +8 -0
- package/dist/components/pro/Flow/hooks/useDeleteSelection.js +43 -0
- package/dist/components/pro/Flow/hooks/useDeleteSelection.js.map +1 -0
- package/dist/components/pro/Flow/hooks/useMindMap.js +19 -17
- package/dist/components/pro/Flow/hooks/useMindMap.js.map +1 -1
- package/dist/components/pro/Flow/lines/LineRenderer.js +1 -1
- package/dist/components/pro/Flow/nodes/NodeRenderer.d.ts +2 -0
- package/dist/components/pro/Flow/nodes/NodeRenderer.js +174 -145
- package/dist/components/pro/Flow/nodes/NodeRenderer.js.map +1 -1
- package/dist/components/pro/Flow/nodes/shapes.d.ts +20 -0
- package/dist/components/pro/Flow/nodes/shapes.js +438 -203
- package/dist/components/pro/Flow/nodes/shapes.js.map +1 -1
- package/dist/components/pro/Flow/nodes/svgIconTexture.d.ts +4 -0
- package/dist/components/pro/Flow/nodes/svgIconTexture.js.map +1 -1
- package/dist/components/pro/Flow/panels/FlowToolbar.d.ts +4 -1
- package/dist/components/pro/Flow/panels/FlowToolbar.js +106 -100
- package/dist/components/pro/Flow/panels/FlowToolbar.js.map +1 -1
- package/dist/components/pro/Flow/panels/InspectorPanel.js +739 -476
- package/dist/components/pro/Flow/panels/InspectorPanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/toolbarIcons.d.ts +2 -0
- package/dist/components/pro/Flow/panels/toolbarIcons.js +30 -25
- package/dist/components/pro/Flow/panels/toolbarIcons.js.map +1 -1
- package/dist/components/pro/Flow/types.d.ts +32 -0
- package/dist/components/pro/Flow/types.js.map +1 -1
- package/dist/dishui.css +1 -1
- package/package.json +1 -1
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
import g from "../../../Button/index.js";
|
|
2
|
-
import
|
|
2
|
+
import b from "../../../Input/index.js";
|
|
3
3
|
import n from "../../../Label/index.js";
|
|
4
|
-
import
|
|
4
|
+
import W from "../../../Checkbox/index.js";
|
|
5
5
|
import y from "../../../Select/index.js";
|
|
6
|
-
import { BORDER_STYLE_OPTIONS as
|
|
7
|
-
import { useFlowContext as
|
|
8
|
-
import { useFlowUI as
|
|
9
|
-
import { COMMON_COLORS as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
6
|
+
import { BORDER_STYLE_OPTIONS as le, DEFAULT_NODE_DATA as te, EDGE_LINE_STYLE_OPTIONS as J, EDGE_MARKER_OPTIONS as Z, EDGE_TYPE_OPTIONS as se } from "../constants.js";
|
|
7
|
+
import { useFlowContext as ie } from "../context/FlowContext.js";
|
|
8
|
+
import { useFlowUI as ae } from "../context/FlowUIContext.js";
|
|
9
|
+
import { COMMON_COLORS as H, THEME_SYNC_TOKEN as oe, isThemeToken as ne, resolveThemeColor as re, themeTokenCssVar as ce } from "../utils/themeColor.js";
|
|
10
|
+
import { BORDER_SIDE_NAMES as de, BORDER_SIDE_TYPES as he, hasBorderSideOverrides as pe } from "../nodes/shapes.js";
|
|
11
|
+
import { generateId as me } from "../nodes/nodeUtils.js";
|
|
12
|
+
import { SVG_ICON_CATEGORIES as fe, buildSvgMarkup as ue, getAllSvgIcons as ve, getSvgIcon as $, getSvgIconsByCategory as we } from "../nodes/svgIcons.js";
|
|
13
|
+
import { COMPONENT_STYLES as R } from "../archify/palette.js";
|
|
14
|
+
import { ARCHIFY_COMPONENT_LABELS as _, ARCHIFY_COMPONENT_ORDER as j, archifyStylePatch as V } from "../archify/presets.js";
|
|
15
|
+
import { useDraggablePanel as be } from "../hooks/useDraggablePanel.js";
|
|
16
|
+
import { useResizablePanel as ge } from "../hooks/useResizablePanel.js";
|
|
17
|
+
import { FLOW_NODE_TYPES as Ne } from "../types.js";
|
|
18
|
+
import { ExpandableTextarea as K } from "./ExpandableTextarea.js";
|
|
19
|
+
import { DataInspectorSection as xe } from "./DataInspectorSection.js";
|
|
20
|
+
import { useMemo as A, useRef as ye, useState as ze } from "react";
|
|
21
|
+
import { Fragment as E, jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
22
|
+
function Ue() {
|
|
23
|
+
const { showInspector: l } = ae(), { panelStyle: c, handleProps: a } = be(), { panelWidth: o, resizeHandleProps: f } = ge("left", 240);
|
|
24
|
+
return l ? /* @__PURE__ */ s("div", {
|
|
24
25
|
className: "flow-inspector",
|
|
25
26
|
"data-flow-panel": !0,
|
|
26
27
|
style: {
|
|
27
|
-
...
|
|
28
|
-
width:
|
|
28
|
+
...c,
|
|
29
|
+
width: o
|
|
29
30
|
},
|
|
30
31
|
children: [
|
|
31
32
|
/* @__PURE__ */ e("div", {
|
|
32
33
|
className: "flow-panel-resize-handle flow-panel-resize-handle--left",
|
|
33
|
-
...
|
|
34
|
+
...f
|
|
34
35
|
}),
|
|
35
36
|
/* @__PURE__ */ e("div", {
|
|
36
37
|
className: "flow-panel-drag-handle",
|
|
37
|
-
...
|
|
38
|
+
...a,
|
|
38
39
|
style: {
|
|
39
40
|
fontSize: 11,
|
|
40
41
|
fontWeight: 600,
|
|
@@ -48,257 +49,257 @@ function Xe() {
|
|
|
48
49
|
}),
|
|
49
50
|
/* @__PURE__ */ e("div", {
|
|
50
51
|
className: "flow-inspector-content",
|
|
51
|
-
children: /* @__PURE__ */ e(
|
|
52
|
+
children: /* @__PURE__ */ e(Ce, {})
|
|
52
53
|
})
|
|
53
54
|
]
|
|
54
55
|
}) : null;
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
-
const { currentCanvas: l, selection:
|
|
58
|
-
if (
|
|
59
|
-
const
|
|
60
|
-
let
|
|
61
|
-
for (const
|
|
62
|
-
|
|
63
|
-
for (const
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
id:
|
|
67
|
-
type:
|
|
57
|
+
function Ce() {
|
|
58
|
+
const { currentCanvas: l, selection: c, setSelection: a, setDoc: o, currentCanvasId: f } = ie(), m = A(() => l.nodes.filter((p) => c.nodeIds.has(p.id)), [l.nodes, c.nodeIds]), t = A(() => l.edges.filter((p) => c.edgeIds.has(p.id)), [l.edges, c.edgeIds]), r = A(() => l.lines.filter((p) => c.lineIds.has(p.id)), [l.lines, c.lineIds]), N = m.length > 0 || t.length > 0 || r.length > 0, w = m.length === 1 && (m[0].type === "flowGroup" || m[0].type === "geometryGroup" || m[0].data.isGroup), z = m.length + r.length, T = (p = "flowGroup") => {
|
|
59
|
+
if (z < 2) return;
|
|
60
|
+
const v = 20;
|
|
61
|
+
let h = 1 / 0, i = 1 / 0, d = -1 / 0, u = -1 / 0;
|
|
62
|
+
for (const S of m)
|
|
63
|
+
h = Math.min(h, S.position.x), i = Math.min(i, S.position.y), d = Math.max(d, S.position.x + S.width), u = Math.max(u, S.position.y + S.height);
|
|
64
|
+
for (const S of r) for (const I of S.points)
|
|
65
|
+
h = Math.min(h, I.x), i = Math.min(i, I.y), d = Math.max(d, I.x), u = Math.max(u, I.y);
|
|
66
|
+
const M = p === "geometryGroup", B = me("group"), x = {
|
|
67
|
+
id: B,
|
|
68
|
+
type: p,
|
|
68
69
|
position: {
|
|
69
|
-
x:
|
|
70
|
-
y:
|
|
70
|
+
x: h - v,
|
|
71
|
+
y: i - v
|
|
71
72
|
},
|
|
72
|
-
width:
|
|
73
|
-
height:
|
|
73
|
+
width: d - h + v * 2,
|
|
74
|
+
height: u - i + v * 2,
|
|
74
75
|
data: {
|
|
75
|
-
...
|
|
76
|
-
label:
|
|
77
|
-
fill:
|
|
76
|
+
...te,
|
|
77
|
+
label: M ? "Geo Group" : "Group",
|
|
78
|
+
fill: M ? "#fefce8" : "#f0f9ff",
|
|
78
79
|
stroke: "#9ca3af",
|
|
79
80
|
strokeWidth: 1.5,
|
|
80
|
-
borderStyle:
|
|
81
|
+
borderStyle: M ? "dashed" : "dotted",
|
|
81
82
|
isGroup: !0
|
|
82
83
|
}
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
return
|
|
87
|
-
...
|
|
84
|
+
}, F = c.nodeIds, C = c.lineIds;
|
|
85
|
+
o((S) => {
|
|
86
|
+
const I = S.canvases[f];
|
|
87
|
+
return I ? {
|
|
88
|
+
...S,
|
|
88
89
|
canvases: {
|
|
89
|
-
...
|
|
90
|
-
[
|
|
91
|
-
...
|
|
92
|
-
nodes:
|
|
90
|
+
...S.canvases,
|
|
91
|
+
[f]: {
|
|
92
|
+
...I,
|
|
93
|
+
nodes: M ? [x, ...I.nodes] : [x, ...I.nodes.map((G) => F.has(G.id) ? {
|
|
93
94
|
...G,
|
|
94
|
-
parentId:
|
|
95
|
+
parentId: B
|
|
95
96
|
} : G)],
|
|
96
|
-
lines:
|
|
97
|
+
lines: M ? I.lines : I.lines.map((G) => C.has(G.id) ? {
|
|
97
98
|
...G,
|
|
98
|
-
parentId:
|
|
99
|
+
parentId: B
|
|
99
100
|
} : G)
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
|
-
} :
|
|
103
|
-
}),
|
|
104
|
-
nodeIds: /* @__PURE__ */ new Set([
|
|
103
|
+
} : S;
|
|
104
|
+
}), a({
|
|
105
|
+
nodeIds: /* @__PURE__ */ new Set([B]),
|
|
105
106
|
edgeIds: /* @__PURE__ */ new Set(),
|
|
106
107
|
lineIds: /* @__PURE__ */ new Set()
|
|
107
108
|
});
|
|
108
109
|
}, Y = () => {
|
|
109
|
-
const
|
|
110
|
-
for (const
|
|
111
|
-
if (
|
|
112
|
-
for (const
|
|
113
|
-
for (const
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
return
|
|
117
|
-
...
|
|
110
|
+
const p = /* @__PURE__ */ new Set(), v = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set();
|
|
111
|
+
for (const i of m) (i.type === "flowGroup" || i.type === "geometryGroup" || i.data.isGroup) && p.add(i.id);
|
|
112
|
+
if (p.size !== 0) {
|
|
113
|
+
for (const i of l.nodes) i.parentId && p.has(i.parentId) && v.add(i.id);
|
|
114
|
+
for (const i of l.lines) i.parentId && p.has(i.parentId) && h.add(i.id);
|
|
115
|
+
o((i) => {
|
|
116
|
+
const d = i.canvases[f];
|
|
117
|
+
return d ? {
|
|
118
|
+
...i,
|
|
118
119
|
canvases: {
|
|
119
|
-
...
|
|
120
|
-
[
|
|
121
|
-
...
|
|
122
|
-
nodes:
|
|
123
|
-
...
|
|
120
|
+
...i.canvases,
|
|
121
|
+
[f]: {
|
|
122
|
+
...d,
|
|
123
|
+
nodes: d.nodes.filter((u) => !p.has(u.id)).map((u) => v.has(u.id) ? {
|
|
124
|
+
...u,
|
|
124
125
|
parentId: void 0
|
|
125
|
-
} :
|
|
126
|
-
lines:
|
|
127
|
-
...
|
|
126
|
+
} : u),
|
|
127
|
+
lines: d.lines.map((u) => h.has(u.id) ? {
|
|
128
|
+
...u,
|
|
128
129
|
parentId: void 0
|
|
129
|
-
} :
|
|
130
|
+
} : u)
|
|
130
131
|
}
|
|
131
132
|
}
|
|
132
|
-
} :
|
|
133
|
-
}),
|
|
134
|
-
nodeIds:
|
|
133
|
+
} : i;
|
|
134
|
+
}), a({
|
|
135
|
+
nodeIds: v,
|
|
135
136
|
edgeIds: /* @__PURE__ */ new Set(),
|
|
136
|
-
lineIds:
|
|
137
|
+
lineIds: h
|
|
137
138
|
});
|
|
138
139
|
}
|
|
139
|
-
},
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
const
|
|
143
|
-
if (!
|
|
144
|
-
const
|
|
145
|
-
if (!
|
|
146
|
-
const
|
|
147
|
-
let
|
|
148
|
-
return
|
|
149
|
-
...
|
|
150
|
-
zIndex:
|
|
140
|
+
}, P = (p) => {
|
|
141
|
+
const v = c.nodeIds;
|
|
142
|
+
v.size !== 0 && o((h) => {
|
|
143
|
+
const i = h.canvases[f];
|
|
144
|
+
if (!i) return h;
|
|
145
|
+
const d = i.nodes.map((x) => x.zIndex ?? 0), u = d.length > 0 ? Math.max(...d) : 0, M = d.length > 0 ? Math.min(...d) : 0, B = i.nodes.map((x) => {
|
|
146
|
+
if (!v.has(x.id)) return x;
|
|
147
|
+
const F = x.zIndex ?? 0;
|
|
148
|
+
let C = F;
|
|
149
|
+
return p === "front" ? C = u + 1 : p === "back" ? C = M - 1 : p === "up" ? C = F + 1 : p === "down" && (C = F - 1), {
|
|
150
|
+
...x,
|
|
151
|
+
zIndex: C
|
|
151
152
|
};
|
|
152
153
|
});
|
|
153
154
|
return {
|
|
154
|
-
...
|
|
155
|
+
...h,
|
|
155
156
|
canvases: {
|
|
156
|
-
...
|
|
157
|
-
[
|
|
158
|
-
...
|
|
159
|
-
nodes:
|
|
157
|
+
...h.canvases,
|
|
158
|
+
[f]: {
|
|
159
|
+
...i,
|
|
160
|
+
nodes: B
|
|
160
161
|
}
|
|
161
162
|
}
|
|
162
163
|
};
|
|
163
164
|
});
|
|
164
|
-
},
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
const
|
|
168
|
-
if (!
|
|
169
|
-
const
|
|
170
|
-
if (!
|
|
171
|
-
const
|
|
172
|
-
let
|
|
173
|
-
return
|
|
174
|
-
...
|
|
175
|
-
zIndex:
|
|
165
|
+
}, L = (p) => {
|
|
166
|
+
const v = c.lineIds;
|
|
167
|
+
v.size !== 0 && o((h) => {
|
|
168
|
+
const i = h.canvases[f];
|
|
169
|
+
if (!i) return h;
|
|
170
|
+
const d = i.lines.map((x) => x.zIndex ?? 0), u = d.length > 0 ? Math.max(...d) : 0, M = d.length > 0 ? Math.min(...d) : 0, B = i.lines.map((x) => {
|
|
171
|
+
if (!v.has(x.id)) return x;
|
|
172
|
+
const F = x.zIndex ?? 0;
|
|
173
|
+
let C = F;
|
|
174
|
+
return p === "front" ? C = u + 1 : p === "back" ? C = M - 1 : p === "up" ? C = F + 1 : p === "down" && (C = F - 1), {
|
|
175
|
+
...x,
|
|
176
|
+
zIndex: C
|
|
176
177
|
};
|
|
177
178
|
});
|
|
178
179
|
return {
|
|
179
|
-
...
|
|
180
|
+
...h,
|
|
180
181
|
canvases: {
|
|
181
|
-
...
|
|
182
|
-
[
|
|
183
|
-
...
|
|
184
|
-
lines:
|
|
182
|
+
...h.canvases,
|
|
183
|
+
[f]: {
|
|
184
|
+
...i,
|
|
185
|
+
lines: B
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
188
|
};
|
|
188
189
|
});
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
},
|
|
192
|
-
|
|
193
|
-
const
|
|
194
|
-
return
|
|
195
|
-
...
|
|
190
|
+
}, k = (p, v, h) => {
|
|
191
|
+
X(p, { [v]: h });
|
|
192
|
+
}, X = (p, v) => {
|
|
193
|
+
o((h) => {
|
|
194
|
+
const i = h.canvases[f];
|
|
195
|
+
return i ? {
|
|
196
|
+
...h,
|
|
196
197
|
canvases: {
|
|
197
|
-
...
|
|
198
|
-
[
|
|
199
|
-
...
|
|
200
|
-
nodes:
|
|
201
|
-
...
|
|
198
|
+
...h.canvases,
|
|
199
|
+
[f]: {
|
|
200
|
+
...i,
|
|
201
|
+
nodes: i.nodes.map((d) => d.id === p ? {
|
|
202
|
+
...d,
|
|
202
203
|
data: {
|
|
203
|
-
...
|
|
204
|
-
...
|
|
204
|
+
...d.data,
|
|
205
|
+
...v
|
|
205
206
|
}
|
|
206
|
-
} :
|
|
207
|
+
} : d)
|
|
207
208
|
}
|
|
208
209
|
}
|
|
209
|
-
} :
|
|
210
|
+
} : h;
|
|
210
211
|
});
|
|
211
|
-
},
|
|
212
|
-
|
|
213
|
-
const
|
|
214
|
-
return
|
|
215
|
-
...
|
|
212
|
+
}, q = (p, v, h) => {
|
|
213
|
+
o((i) => {
|
|
214
|
+
const d = i.canvases[f];
|
|
215
|
+
return d ? {
|
|
216
|
+
...i,
|
|
216
217
|
canvases: {
|
|
217
|
-
...
|
|
218
|
-
[
|
|
219
|
-
...
|
|
220
|
-
nodes:
|
|
221
|
-
...
|
|
222
|
-
[
|
|
223
|
-
} :
|
|
218
|
+
...i.canvases,
|
|
219
|
+
[f]: {
|
|
220
|
+
...d,
|
|
221
|
+
nodes: d.nodes.map((u) => u.id === p ? {
|
|
222
|
+
...u,
|
|
223
|
+
[v]: h
|
|
224
|
+
} : u)
|
|
224
225
|
}
|
|
225
226
|
}
|
|
226
|
-
} :
|
|
227
|
+
} : i;
|
|
227
228
|
});
|
|
228
|
-
},
|
|
229
|
-
|
|
230
|
-
const
|
|
231
|
-
return
|
|
232
|
-
...
|
|
229
|
+
}, Q = (p, v, h) => {
|
|
230
|
+
o((i) => {
|
|
231
|
+
const d = i.canvases[f];
|
|
232
|
+
return d ? {
|
|
233
|
+
...i,
|
|
233
234
|
canvases: {
|
|
234
|
-
...
|
|
235
|
-
[
|
|
236
|
-
...
|
|
237
|
-
edges:
|
|
238
|
-
...
|
|
235
|
+
...i.canvases,
|
|
236
|
+
[f]: {
|
|
237
|
+
...d,
|
|
238
|
+
edges: d.edges.map((u) => u.id === p ? {
|
|
239
|
+
...u,
|
|
239
240
|
data: {
|
|
240
|
-
...
|
|
241
|
-
[
|
|
241
|
+
...u.data,
|
|
242
|
+
[v]: h
|
|
242
243
|
}
|
|
243
|
-
} :
|
|
244
|
+
} : u)
|
|
244
245
|
}
|
|
245
246
|
}
|
|
246
|
-
} :
|
|
247
|
+
} : i;
|
|
247
248
|
});
|
|
248
|
-
},
|
|
249
|
-
|
|
250
|
-
const
|
|
251
|
-
return
|
|
252
|
-
...
|
|
249
|
+
}, D = (p, v) => {
|
|
250
|
+
o((h) => {
|
|
251
|
+
const i = h.canvases[f];
|
|
252
|
+
return i ? {
|
|
253
|
+
...h,
|
|
253
254
|
canvases: {
|
|
254
|
-
...
|
|
255
|
-
[
|
|
256
|
-
...
|
|
257
|
-
nodes:
|
|
258
|
-
...
|
|
259
|
-
type:
|
|
260
|
-
} :
|
|
255
|
+
...h.canvases,
|
|
256
|
+
[f]: {
|
|
257
|
+
...i,
|
|
258
|
+
nodes: i.nodes.map((d) => d.id === p ? {
|
|
259
|
+
...d,
|
|
260
|
+
type: v
|
|
261
|
+
} : d)
|
|
261
262
|
}
|
|
262
263
|
}
|
|
263
|
-
} :
|
|
264
|
+
} : h;
|
|
264
265
|
});
|
|
265
|
-
},
|
|
266
|
-
|
|
267
|
-
const
|
|
268
|
-
return
|
|
269
|
-
...
|
|
266
|
+
}, U = (p, v) => {
|
|
267
|
+
o((h) => {
|
|
268
|
+
const i = h.canvases[f];
|
|
269
|
+
return i ? {
|
|
270
|
+
...h,
|
|
270
271
|
canvases: {
|
|
271
|
-
...
|
|
272
|
-
[
|
|
273
|
-
...
|
|
274
|
-
edges:
|
|
275
|
-
...
|
|
276
|
-
type:
|
|
277
|
-
} :
|
|
272
|
+
...h.canvases,
|
|
273
|
+
[f]: {
|
|
274
|
+
...i,
|
|
275
|
+
edges: i.edges.map((d) => d.id === p ? {
|
|
276
|
+
...d,
|
|
277
|
+
type: v
|
|
278
|
+
} : d)
|
|
278
279
|
}
|
|
279
280
|
}
|
|
280
|
-
} :
|
|
281
|
+
} : h;
|
|
281
282
|
});
|
|
282
|
-
},
|
|
283
|
-
|
|
284
|
-
const
|
|
285
|
-
return
|
|
286
|
-
...
|
|
283
|
+
}, ee = (p, v, h) => {
|
|
284
|
+
o((i) => {
|
|
285
|
+
const d = i.canvases[f];
|
|
286
|
+
return d ? {
|
|
287
|
+
...i,
|
|
287
288
|
canvases: {
|
|
288
|
-
...
|
|
289
|
-
[
|
|
290
|
-
...
|
|
291
|
-
lines:
|
|
292
|
-
...
|
|
293
|
-
[
|
|
294
|
-
} :
|
|
289
|
+
...i.canvases,
|
|
290
|
+
[f]: {
|
|
291
|
+
...d,
|
|
292
|
+
lines: d.lines.map((u) => u.id === p ? {
|
|
293
|
+
...u,
|
|
294
|
+
[v]: h
|
|
295
|
+
} : u)
|
|
295
296
|
}
|
|
296
297
|
}
|
|
297
|
-
} :
|
|
298
|
+
} : i;
|
|
298
299
|
});
|
|
299
300
|
};
|
|
300
|
-
return /* @__PURE__ */
|
|
301
|
-
!
|
|
301
|
+
return /* @__PURE__ */ s(E, { children: [
|
|
302
|
+
!N && /* @__PURE__ */ e("div", {
|
|
302
303
|
style: {
|
|
303
304
|
fontSize: 12,
|
|
304
305
|
color: "color-mix(in oklch, var(--color-base-content) 40%, transparent)",
|
|
@@ -307,35 +308,35 @@ function we() {
|
|
|
307
308
|
},
|
|
308
309
|
children: "Select an element to inspect"
|
|
309
310
|
}),
|
|
310
|
-
|
|
311
|
-
node:
|
|
312
|
-
isGroup:
|
|
313
|
-
onUpdateData:
|
|
314
|
-
onUpdateDataBatch:
|
|
315
|
-
onUpdateDimension:
|
|
316
|
-
onUpdateType:
|
|
311
|
+
m.length === 1 && /* @__PURE__ */ e(Ie, {
|
|
312
|
+
node: m[0],
|
|
313
|
+
isGroup: w,
|
|
314
|
+
onUpdateData: k,
|
|
315
|
+
onUpdateDataBatch: X,
|
|
316
|
+
onUpdateDimension: q,
|
|
317
|
+
onUpdateType: D
|
|
317
318
|
}),
|
|
318
|
-
|
|
319
|
+
z > 1 && /* @__PURE__ */ s("div", {
|
|
319
320
|
className: "flow-inspector-section",
|
|
320
321
|
children: [
|
|
321
322
|
/* @__PURE__ */ e("div", {
|
|
322
323
|
className: "flow-inspector-section-title",
|
|
323
324
|
children: "Selection"
|
|
324
325
|
}),
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ s("div", {
|
|
326
327
|
style: {
|
|
327
328
|
fontSize: 12,
|
|
328
329
|
color: "color-mix(in oklch, var(--color-base-content) 50%, transparent)",
|
|
329
330
|
marginBottom: 8
|
|
330
331
|
},
|
|
331
332
|
children: [
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
333
|
+
m.length > 0 && `${m.length} node${m.length > 1 ? "s" : ""}`,
|
|
334
|
+
m.length > 0 && r.length > 0 && ", ",
|
|
335
|
+
r.length > 0 && `${r.length} line${r.length > 1 ? "s" : ""}`,
|
|
335
336
|
" selected"
|
|
336
337
|
]
|
|
337
338
|
}),
|
|
338
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ s("div", {
|
|
339
340
|
style: {
|
|
340
341
|
display: "flex",
|
|
341
342
|
flexDirection: "column",
|
|
@@ -344,25 +345,25 @@ function we() {
|
|
|
344
345
|
},
|
|
345
346
|
children: [/* @__PURE__ */ e(g, {
|
|
346
347
|
size: "xs",
|
|
347
|
-
onClick: () =>
|
|
348
|
+
onClick: () => T("flowGroup"),
|
|
348
349
|
block: !0,
|
|
349
350
|
children: "Group (⌘G)"
|
|
350
351
|
}), /* @__PURE__ */ e(g, {
|
|
351
352
|
size: "xs",
|
|
352
353
|
variant: "ghost",
|
|
353
|
-
onClick: () =>
|
|
354
|
+
onClick: () => T("geometryGroup"),
|
|
354
355
|
block: !0,
|
|
355
356
|
children: "Geo Group (⌘⌥G)"
|
|
356
357
|
})]
|
|
357
358
|
})
|
|
358
359
|
]
|
|
359
360
|
}),
|
|
360
|
-
|
|
361
|
+
w && /* @__PURE__ */ s("div", {
|
|
361
362
|
className: "flow-inspector-section",
|
|
362
363
|
children: [
|
|
363
364
|
/* @__PURE__ */ e("div", {
|
|
364
365
|
className: "flow-inspector-section-title",
|
|
365
|
-
children:
|
|
366
|
+
children: m[0].type === "geometryGroup" ? "Geometry Group" : "Group"
|
|
366
367
|
}),
|
|
367
368
|
/* @__PURE__ */ e("div", {
|
|
368
369
|
style: {
|
|
@@ -370,7 +371,7 @@ function we() {
|
|
|
370
371
|
color: "color-mix(in oklch, var(--color-base-content) 45%, transparent)",
|
|
371
372
|
marginBottom: 6
|
|
372
373
|
},
|
|
373
|
-
children:
|
|
374
|
+
children: m[0].type === "geometryGroup" ? "Auto-binds spatially contained nodes" : "Explicit membership via add/remove"
|
|
374
375
|
}),
|
|
375
376
|
/* @__PURE__ */ e(g, {
|
|
376
377
|
size: "xs",
|
|
@@ -381,12 +382,12 @@ function we() {
|
|
|
381
382
|
})
|
|
382
383
|
]
|
|
383
384
|
}),
|
|
384
|
-
|
|
385
|
+
m.length > 0 && /* @__PURE__ */ s("div", {
|
|
385
386
|
className: "flow-inspector-section",
|
|
386
387
|
children: [/* @__PURE__ */ e("div", {
|
|
387
388
|
className: "flow-inspector-section-title",
|
|
388
389
|
children: "Layer"
|
|
389
|
-
}), /* @__PURE__ */
|
|
390
|
+
}), /* @__PURE__ */ s("div", {
|
|
390
391
|
style: {
|
|
391
392
|
display: "flex",
|
|
392
393
|
gap: 4
|
|
@@ -395,7 +396,7 @@ function we() {
|
|
|
395
396
|
/* @__PURE__ */ e(g, {
|
|
396
397
|
size: "xs",
|
|
397
398
|
variant: "ghost",
|
|
398
|
-
onClick: () =>
|
|
399
|
+
onClick: () => P("front"),
|
|
399
400
|
children: /* @__PURE__ */ e("span", {
|
|
400
401
|
title: "Bring to Front (⌘⇧↑)",
|
|
401
402
|
children: "⤒"
|
|
@@ -404,7 +405,7 @@ function we() {
|
|
|
404
405
|
/* @__PURE__ */ e(g, {
|
|
405
406
|
size: "xs",
|
|
406
407
|
variant: "ghost",
|
|
407
|
-
onClick: () =>
|
|
408
|
+
onClick: () => P("up"),
|
|
408
409
|
children: /* @__PURE__ */ e("span", {
|
|
409
410
|
title: "Bring Forward (⌘↑)",
|
|
410
411
|
children: "↑"
|
|
@@ -413,7 +414,7 @@ function we() {
|
|
|
413
414
|
/* @__PURE__ */ e(g, {
|
|
414
415
|
size: "xs",
|
|
415
416
|
variant: "ghost",
|
|
416
|
-
onClick: () =>
|
|
417
|
+
onClick: () => P("down"),
|
|
417
418
|
children: /* @__PURE__ */ e("span", {
|
|
418
419
|
title: "Send Backward (⌘↓)",
|
|
419
420
|
children: "↓"
|
|
@@ -422,7 +423,7 @@ function we() {
|
|
|
422
423
|
/* @__PURE__ */ e(g, {
|
|
423
424
|
size: "xs",
|
|
424
425
|
variant: "ghost",
|
|
425
|
-
onClick: () =>
|
|
426
|
+
onClick: () => P("back"),
|
|
426
427
|
children: /* @__PURE__ */ e("span", {
|
|
427
428
|
title: "Send to Back (⌘⇧↓)",
|
|
428
429
|
children: "⤓"
|
|
@@ -431,20 +432,20 @@ function we() {
|
|
|
431
432
|
]
|
|
432
433
|
})]
|
|
433
434
|
}),
|
|
434
|
-
|
|
435
|
-
edge:
|
|
436
|
-
onUpdateData:
|
|
437
|
-
onUpdateType:
|
|
435
|
+
t.length === 1 && /* @__PURE__ */ e(Oe, {
|
|
436
|
+
edge: t[0],
|
|
437
|
+
onUpdateData: Q,
|
|
438
|
+
onUpdateType: U
|
|
438
439
|
}),
|
|
439
|
-
|
|
440
|
-
line:
|
|
441
|
-
onUpdateData:
|
|
442
|
-
}), /* @__PURE__ */
|
|
440
|
+
r.length === 1 && /* @__PURE__ */ s(E, { children: [/* @__PURE__ */ e(Ee, {
|
|
441
|
+
line: r[0],
|
|
442
|
+
onUpdateData: ee
|
|
443
|
+
}), /* @__PURE__ */ s("div", {
|
|
443
444
|
className: "flow-inspector-section",
|
|
444
445
|
children: [/* @__PURE__ */ e("div", {
|
|
445
446
|
className: "flow-inspector-section-title",
|
|
446
447
|
children: "Layer"
|
|
447
|
-
}), /* @__PURE__ */
|
|
448
|
+
}), /* @__PURE__ */ s("div", {
|
|
448
449
|
style: {
|
|
449
450
|
display: "flex",
|
|
450
451
|
gap: 4
|
|
@@ -453,7 +454,7 @@ function we() {
|
|
|
453
454
|
/* @__PURE__ */ e(g, {
|
|
454
455
|
size: "xs",
|
|
455
456
|
variant: "ghost",
|
|
456
|
-
onClick: () =>
|
|
457
|
+
onClick: () => L("front"),
|
|
457
458
|
children: /* @__PURE__ */ e("span", {
|
|
458
459
|
title: "Bring to Front",
|
|
459
460
|
children: "⤒"
|
|
@@ -462,7 +463,7 @@ function we() {
|
|
|
462
463
|
/* @__PURE__ */ e(g, {
|
|
463
464
|
size: "xs",
|
|
464
465
|
variant: "ghost",
|
|
465
|
-
onClick: () =>
|
|
466
|
+
onClick: () => L("up"),
|
|
466
467
|
children: /* @__PURE__ */ e("span", {
|
|
467
468
|
title: "Bring Forward",
|
|
468
469
|
children: "↑"
|
|
@@ -471,7 +472,7 @@ function we() {
|
|
|
471
472
|
/* @__PURE__ */ e(g, {
|
|
472
473
|
size: "xs",
|
|
473
474
|
variant: "ghost",
|
|
474
|
-
onClick: () =>
|
|
475
|
+
onClick: () => L("down"),
|
|
475
476
|
children: /* @__PURE__ */ e("span", {
|
|
476
477
|
title: "Send Backward",
|
|
477
478
|
children: "↓"
|
|
@@ -480,7 +481,7 @@ function we() {
|
|
|
480
481
|
/* @__PURE__ */ e(g, {
|
|
481
482
|
size: "xs",
|
|
482
483
|
variant: "ghost",
|
|
483
|
-
onClick: () =>
|
|
484
|
+
onClick: () => L("back"),
|
|
484
485
|
children: /* @__PURE__ */ e("span", {
|
|
485
486
|
title: "Send to Back",
|
|
486
487
|
children: "⤓"
|
|
@@ -491,9 +492,9 @@ function we() {
|
|
|
491
492
|
})] })
|
|
492
493
|
] });
|
|
493
494
|
}
|
|
494
|
-
function
|
|
495
|
-
const
|
|
496
|
-
return /* @__PURE__ */
|
|
495
|
+
function O({ value: l, onChange: c, kind: a, allowTransparent: o, customFallback: f = "#ffffff" }) {
|
|
496
|
+
const m = oe[a], t = ce(m) ?? "var(--color-base-content)", r = l ?? "", N = r.toLowerCase(), w = ne(r), z = r === "transparent", T = H.some((k) => k.value.toLowerCase() === N), Y = r === m, P = !!r && !w && !z && !T, L = P ? r : f;
|
|
497
|
+
return /* @__PURE__ */ s("div", {
|
|
497
498
|
className: "flow-color-field",
|
|
498
499
|
children: [
|
|
499
500
|
/* @__PURE__ */ e("button", {
|
|
@@ -501,189 +502,350 @@ function P({ value: l, onChange: d, kind: o, allowTransparent: i, customFallback
|
|
|
501
502
|
title: "跟随主题切换",
|
|
502
503
|
"aria-label": "跟随主题切换",
|
|
503
504
|
className: `flow-color-swatch flow-color-swatch--sync${Y ? " is-active" : ""}`,
|
|
504
|
-
style: { background:
|
|
505
|
-
onClick: () =>
|
|
505
|
+
style: { background: t },
|
|
506
|
+
onClick: () => c(m)
|
|
506
507
|
}),
|
|
507
508
|
/* @__PURE__ */ e("span", { className: "flow-color-divider" }),
|
|
508
|
-
|
|
509
|
+
H.map((k) => /* @__PURE__ */ e("button", {
|
|
509
510
|
type: "button",
|
|
510
|
-
title:
|
|
511
|
-
"aria-label":
|
|
512
|
-
className: `flow-color-swatch${!
|
|
513
|
-
style: { background:
|
|
514
|
-
onClick: () =>
|
|
515
|
-
},
|
|
511
|
+
title: k.label,
|
|
512
|
+
"aria-label": k.label,
|
|
513
|
+
className: `flow-color-swatch${!w && !z && N === k.value.toLowerCase() ? " is-active" : ""}`,
|
|
514
|
+
style: { background: k.value },
|
|
515
|
+
onClick: () => c(k.value)
|
|
516
|
+
}, k.value)),
|
|
516
517
|
/* @__PURE__ */ e("span", { className: "flow-color-divider" }),
|
|
517
518
|
/* @__PURE__ */ e("label", {
|
|
518
|
-
className: `flow-color-swatch flow-color-swatch--custom${
|
|
519
|
+
className: `flow-color-swatch flow-color-swatch--custom${P ? " is-active" : ""}`,
|
|
519
520
|
title: "自定义颜色",
|
|
520
|
-
style:
|
|
521
|
+
style: P ? { background: r } : void 0,
|
|
521
522
|
children: /* @__PURE__ */ e("input", {
|
|
522
523
|
type: "color",
|
|
523
|
-
value:
|
|
524
|
-
onChange: (
|
|
524
|
+
value: L,
|
|
525
|
+
onChange: (k) => c(k.target.value)
|
|
525
526
|
})
|
|
526
527
|
}),
|
|
527
|
-
|
|
528
|
+
o && /* @__PURE__ */ e("button", {
|
|
528
529
|
type: "button",
|
|
529
530
|
title: "透明",
|
|
530
531
|
"aria-label": "透明",
|
|
531
|
-
className: `flow-color-swatch flow-color-swatch--transparent${
|
|
532
|
-
onClick: () =>
|
|
532
|
+
className: `flow-color-swatch flow-color-swatch--transparent${z ? " is-active" : ""}`,
|
|
533
|
+
onClick: () => c("transparent")
|
|
533
534
|
})
|
|
534
535
|
]
|
|
535
536
|
});
|
|
536
537
|
}
|
|
537
|
-
function
|
|
538
|
-
|
|
539
|
-
|
|
538
|
+
function Se(l) {
|
|
539
|
+
const c = ue(l, re($(l)?.brandColor, "") || "#475569");
|
|
540
|
+
return c ? `data:image/svg+xml;utf8,${encodeURIComponent(c)}` : "";
|
|
541
|
+
}
|
|
542
|
+
function ke({ node: l, onUpdateData: c }) {
|
|
543
|
+
const [a, o] = ze("lang"), f = A(() => we(a), [a]), m = l.data.titleIcon ?? "", t = l.data.titleIconSide ?? "left";
|
|
544
|
+
return /* @__PURE__ */ s("div", {
|
|
545
|
+
className: "flow-inspector-section",
|
|
546
|
+
children: [
|
|
547
|
+
/* @__PURE__ */ e("div", {
|
|
548
|
+
className: "flow-inspector-section-title",
|
|
549
|
+
children: "Title Icon"
|
|
550
|
+
}),
|
|
551
|
+
/* @__PURE__ */ s("div", {
|
|
552
|
+
className: "flow-inspector-row",
|
|
553
|
+
children: [/* @__PURE__ */ e(n, {
|
|
554
|
+
size: "xs",
|
|
555
|
+
className: "flow-inspector-label",
|
|
556
|
+
children: "Icon"
|
|
557
|
+
}), /* @__PURE__ */ s("div", {
|
|
558
|
+
style: {
|
|
559
|
+
display: "flex",
|
|
560
|
+
gap: 4,
|
|
561
|
+
alignItems: "center",
|
|
562
|
+
flex: 1,
|
|
563
|
+
minWidth: 0
|
|
564
|
+
},
|
|
565
|
+
children: [/* @__PURE__ */ e(y, {
|
|
566
|
+
options: fe.map((r) => ({
|
|
567
|
+
value: r.id,
|
|
568
|
+
label: r.label
|
|
569
|
+
})),
|
|
570
|
+
value: a,
|
|
571
|
+
onChange: (r) => o(r),
|
|
572
|
+
style: {
|
|
573
|
+
fontSize: 12,
|
|
574
|
+
flex: 1,
|
|
575
|
+
minWidth: 0
|
|
576
|
+
}
|
|
577
|
+
}), /* @__PURE__ */ e(g, {
|
|
578
|
+
size: "xs",
|
|
579
|
+
variant: m ? "ghost" : "primary",
|
|
580
|
+
square: !0,
|
|
581
|
+
onClick: () => c(l.id, "titleIcon", void 0),
|
|
582
|
+
children: /* @__PURE__ */ e("span", {
|
|
583
|
+
title: "移除标题图标",
|
|
584
|
+
children: "✕"
|
|
585
|
+
})
|
|
586
|
+
})]
|
|
587
|
+
})]
|
|
588
|
+
}),
|
|
589
|
+
m && !f.some((r) => r.id === m) && /* @__PURE__ */ e("div", {
|
|
590
|
+
style: {
|
|
591
|
+
fontSize: 10,
|
|
592
|
+
opacity: 0.55,
|
|
593
|
+
marginBottom: 4
|
|
594
|
+
},
|
|
595
|
+
children: "当前图标在其他分类"
|
|
596
|
+
}),
|
|
597
|
+
/* @__PURE__ */ e("div", {
|
|
598
|
+
style: {
|
|
599
|
+
display: "grid",
|
|
600
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(22px, 1fr))",
|
|
601
|
+
gap: 3,
|
|
602
|
+
maxHeight: 92,
|
|
603
|
+
overflowY: "auto",
|
|
604
|
+
padding: 3,
|
|
605
|
+
border: "1px solid color-mix(in oklch, var(--color-base-content) 14%, transparent)",
|
|
606
|
+
borderRadius: 6,
|
|
607
|
+
marginBottom: 6
|
|
608
|
+
},
|
|
609
|
+
children: f.map((r) => {
|
|
610
|
+
const N = Se(r.id), w = m === r.id;
|
|
611
|
+
return /* @__PURE__ */ e("button", {
|
|
612
|
+
type: "button",
|
|
613
|
+
title: r.label,
|
|
614
|
+
"aria-label": r.label,
|
|
615
|
+
onClick: () => c(l.id, "titleIcon", r.id),
|
|
616
|
+
style: {
|
|
617
|
+
display: "flex",
|
|
618
|
+
alignItems: "center",
|
|
619
|
+
justifyContent: "center",
|
|
620
|
+
width: 22,
|
|
621
|
+
height: 22,
|
|
622
|
+
borderRadius: 4,
|
|
623
|
+
cursor: "pointer",
|
|
624
|
+
padding: 0,
|
|
625
|
+
border: w ? "1.5px solid var(--color-primary)" : "1px solid transparent",
|
|
626
|
+
background: w ? "color-mix(in oklch, var(--color-primary) 12%, transparent)" : "transparent"
|
|
627
|
+
},
|
|
628
|
+
children: N && /* @__PURE__ */ e("img", {
|
|
629
|
+
src: N,
|
|
630
|
+
width: 16,
|
|
631
|
+
height: 16,
|
|
632
|
+
alt: "",
|
|
633
|
+
style: { objectFit: "contain" }
|
|
634
|
+
})
|
|
635
|
+
}, r.id);
|
|
636
|
+
})
|
|
637
|
+
}),
|
|
638
|
+
m && /* @__PURE__ */ s(E, { children: [
|
|
639
|
+
/* @__PURE__ */ s("div", {
|
|
640
|
+
className: "flow-inspector-row",
|
|
641
|
+
children: [/* @__PURE__ */ e(n, {
|
|
642
|
+
size: "xs",
|
|
643
|
+
className: "flow-inspector-label",
|
|
644
|
+
children: "Side"
|
|
645
|
+
}), /* @__PURE__ */ e(y, {
|
|
646
|
+
options: [{
|
|
647
|
+
value: "left",
|
|
648
|
+
label: "left"
|
|
649
|
+
}, {
|
|
650
|
+
value: "right",
|
|
651
|
+
label: "right"
|
|
652
|
+
}],
|
|
653
|
+
value: t,
|
|
654
|
+
onChange: (r) => c(l.id, "titleIconSide", r),
|
|
655
|
+
style: { fontSize: 12 }
|
|
656
|
+
})]
|
|
657
|
+
}),
|
|
658
|
+
/* @__PURE__ */ s("div", {
|
|
659
|
+
className: "flow-inspector-row",
|
|
660
|
+
children: [
|
|
661
|
+
/* @__PURE__ */ e(n, {
|
|
662
|
+
size: "xs",
|
|
663
|
+
className: "flow-inspector-label",
|
|
664
|
+
children: "Size"
|
|
665
|
+
}),
|
|
666
|
+
/* @__PURE__ */ e(b, {
|
|
667
|
+
size: "xs",
|
|
668
|
+
type: "number",
|
|
669
|
+
value: String(l.data.titleIconSize ?? Math.max(8, Math.round(l.data.fontSize * 1.15))),
|
|
670
|
+
onChange: (r) => c(l.id, "titleIconSize", Math.max(8, Number(r.target.value) || 8))
|
|
671
|
+
}),
|
|
672
|
+
/* @__PURE__ */ e("span", {
|
|
673
|
+
className: "flow-inspector-suffix",
|
|
674
|
+
style: {
|
|
675
|
+
fontSize: 10,
|
|
676
|
+
opacity: 0.5
|
|
677
|
+
},
|
|
678
|
+
children: "px"
|
|
679
|
+
})
|
|
680
|
+
]
|
|
681
|
+
}),
|
|
682
|
+
/* @__PURE__ */ s("div", {
|
|
683
|
+
className: "flow-inspector-row",
|
|
684
|
+
children: [/* @__PURE__ */ e(n, {
|
|
685
|
+
size: "xs",
|
|
686
|
+
className: "flow-inspector-label",
|
|
687
|
+
children: "Color"
|
|
688
|
+
}), /* @__PURE__ */ e(O, {
|
|
689
|
+
value: l.data.titleIconColor ?? $(m)?.brandColor ?? l.data.labelColor ?? l.data.color,
|
|
690
|
+
kind: "stroke",
|
|
691
|
+
customFallback: "#334155",
|
|
692
|
+
onChange: (r) => c(l.id, "titleIconColor", r)
|
|
693
|
+
})]
|
|
694
|
+
})
|
|
695
|
+
] })
|
|
696
|
+
]
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
function Ie({ node: l, isGroup: c, onUpdateData: a, onUpdateDataBatch: o, onUpdateDimension: f, onUpdateType: m }) {
|
|
700
|
+
return /* @__PURE__ */ s(E, { children: [
|
|
701
|
+
/* @__PURE__ */ s("div", {
|
|
540
702
|
className: "flow-inspector-section",
|
|
541
703
|
children: [
|
|
542
704
|
/* @__PURE__ */ e("div", {
|
|
543
705
|
className: "flow-inspector-section-title",
|
|
544
706
|
children: "Node"
|
|
545
707
|
}),
|
|
546
|
-
/* @__PURE__ */
|
|
708
|
+
/* @__PURE__ */ s("div", {
|
|
547
709
|
className: "flow-inspector-row",
|
|
548
710
|
children: [/* @__PURE__ */ e(n, {
|
|
549
711
|
size: "xs",
|
|
550
712
|
className: "flow-inspector-label",
|
|
551
713
|
children: "Label"
|
|
552
|
-
}), /* @__PURE__ */ e(
|
|
714
|
+
}), /* @__PURE__ */ e(b, {
|
|
553
715
|
size: "xs",
|
|
554
716
|
value: l.data.label,
|
|
555
|
-
onChange: (
|
|
717
|
+
onChange: (t) => a(l.id, "label", t.target.value)
|
|
556
718
|
})]
|
|
557
719
|
}),
|
|
558
|
-
/* @__PURE__ */
|
|
720
|
+
/* @__PURE__ */ s("div", {
|
|
559
721
|
className: "flow-inspector-row",
|
|
560
722
|
children: [/* @__PURE__ */ e(n, {
|
|
561
723
|
size: "xs",
|
|
562
724
|
className: "flow-inspector-label",
|
|
563
725
|
children: "Type"
|
|
564
726
|
}), /* @__PURE__ */ e(y, {
|
|
565
|
-
options:
|
|
566
|
-
value:
|
|
567
|
-
label:
|
|
727
|
+
options: Ne.map((t) => ({
|
|
728
|
+
value: t,
|
|
729
|
+
label: t
|
|
568
730
|
})),
|
|
569
731
|
value: l.type,
|
|
570
|
-
onChange: (
|
|
732
|
+
onChange: (t) => m(l.id, t),
|
|
571
733
|
style: { fontSize: 12 }
|
|
572
734
|
})]
|
|
573
735
|
})
|
|
574
736
|
]
|
|
575
737
|
}),
|
|
576
|
-
/* @__PURE__ */
|
|
738
|
+
/* @__PURE__ */ s("div", {
|
|
577
739
|
className: "flow-inspector-section",
|
|
578
740
|
children: [
|
|
579
741
|
/* @__PURE__ */ e("div", {
|
|
580
742
|
className: "flow-inspector-section-title",
|
|
581
743
|
children: "Size"
|
|
582
744
|
}),
|
|
583
|
-
/* @__PURE__ */
|
|
745
|
+
/* @__PURE__ */ s("div", {
|
|
584
746
|
className: "flow-inspector-row",
|
|
585
747
|
children: [/* @__PURE__ */ e(n, {
|
|
586
748
|
size: "xs",
|
|
587
749
|
className: "flow-inspector-label",
|
|
588
750
|
children: "W"
|
|
589
|
-
}), /* @__PURE__ */ e(
|
|
751
|
+
}), /* @__PURE__ */ e(b, {
|
|
590
752
|
size: "xs",
|
|
591
753
|
type: "number",
|
|
592
754
|
value: String(Math.round(l.width * 100) / 100),
|
|
593
|
-
onChange: (
|
|
755
|
+
onChange: (t) => f(l.id, "width", Number(t.target.value) || l.width)
|
|
594
756
|
})]
|
|
595
757
|
}),
|
|
596
|
-
/* @__PURE__ */
|
|
758
|
+
/* @__PURE__ */ s("div", {
|
|
597
759
|
className: "flow-inspector-row",
|
|
598
760
|
children: [/* @__PURE__ */ e(n, {
|
|
599
761
|
size: "xs",
|
|
600
762
|
className: "flow-inspector-label",
|
|
601
763
|
children: "H"
|
|
602
|
-
}), /* @__PURE__ */ e(
|
|
764
|
+
}), /* @__PURE__ */ e(b, {
|
|
603
765
|
size: "xs",
|
|
604
766
|
type: "number",
|
|
605
767
|
value: String(Math.round(l.height * 100) / 100),
|
|
606
|
-
onChange: (
|
|
768
|
+
onChange: (t) => f(l.id, "height", Number(t.target.value) || l.height)
|
|
607
769
|
})]
|
|
608
770
|
})
|
|
609
771
|
]
|
|
610
772
|
}),
|
|
611
|
-
/* @__PURE__ */
|
|
773
|
+
/* @__PURE__ */ s("div", {
|
|
612
774
|
className: "flow-inspector-section",
|
|
613
775
|
children: [
|
|
614
776
|
/* @__PURE__ */ e("div", {
|
|
615
777
|
className: "flow-inspector-section-title",
|
|
616
778
|
children: "Style"
|
|
617
779
|
}),
|
|
618
|
-
/* @__PURE__ */
|
|
780
|
+
/* @__PURE__ */ s("div", {
|
|
619
781
|
className: "flow-inspector-row",
|
|
620
782
|
children: [/* @__PURE__ */ e(n, {
|
|
621
783
|
size: "xs",
|
|
622
784
|
className: "flow-inspector-label",
|
|
623
785
|
children: "Fill"
|
|
624
|
-
}), /* @__PURE__ */ e(
|
|
786
|
+
}), /* @__PURE__ */ e(O, {
|
|
625
787
|
value: l.data.fill,
|
|
626
788
|
kind: "fill",
|
|
627
789
|
allowTransparent: !0,
|
|
628
790
|
customFallback: "#ffffff",
|
|
629
|
-
onChange: (
|
|
791
|
+
onChange: (t) => a(l.id, "fill", t)
|
|
630
792
|
})]
|
|
631
793
|
}),
|
|
632
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ s("div", {
|
|
633
795
|
className: "flow-inspector-row",
|
|
634
796
|
children: [/* @__PURE__ */ e(n, {
|
|
635
797
|
size: "xs",
|
|
636
798
|
className: "flow-inspector-label",
|
|
637
799
|
children: "Stroke"
|
|
638
|
-
}), /* @__PURE__ */ e(
|
|
800
|
+
}), /* @__PURE__ */ e(O, {
|
|
639
801
|
value: l.data.stroke,
|
|
640
802
|
kind: "stroke",
|
|
641
803
|
allowTransparent: !0,
|
|
642
804
|
customFallback: "#000000",
|
|
643
|
-
onChange: (
|
|
805
|
+
onChange: (t) => a(l.id, "stroke", t)
|
|
644
806
|
})]
|
|
645
807
|
}),
|
|
646
|
-
/* @__PURE__ */
|
|
808
|
+
/* @__PURE__ */ s("div", {
|
|
647
809
|
className: "flow-inspector-row",
|
|
648
810
|
children: [/* @__PURE__ */ e(n, {
|
|
649
811
|
size: "xs",
|
|
650
812
|
className: "flow-inspector-label",
|
|
651
813
|
children: "Font"
|
|
652
|
-
}), /* @__PURE__ */ e(
|
|
814
|
+
}), /* @__PURE__ */ e(b, {
|
|
653
815
|
size: "xs",
|
|
654
816
|
type: "number",
|
|
655
817
|
value: String(l.data.fontSize),
|
|
656
|
-
onChange: (
|
|
818
|
+
onChange: (t) => a(l.id, "fontSize", Number(t.target.value) || 14)
|
|
657
819
|
})]
|
|
658
820
|
}),
|
|
659
|
-
/* @__PURE__ */
|
|
821
|
+
/* @__PURE__ */ s("div", {
|
|
660
822
|
className: "flow-inspector-row",
|
|
661
823
|
children: [/* @__PURE__ */ e(n, {
|
|
662
824
|
size: "xs",
|
|
663
825
|
className: "flow-inspector-label",
|
|
664
826
|
children: "Color"
|
|
665
|
-
}), /* @__PURE__ */ e(
|
|
827
|
+
}), /* @__PURE__ */ e(O, {
|
|
666
828
|
value: l.data.color,
|
|
667
829
|
kind: "text",
|
|
668
830
|
customFallback: "#111827",
|
|
669
|
-
onChange: (
|
|
831
|
+
onChange: (t) => a(l.id, "color", t)
|
|
670
832
|
})]
|
|
671
833
|
}),
|
|
672
|
-
/* @__PURE__ */
|
|
834
|
+
/* @__PURE__ */ s("div", {
|
|
673
835
|
className: "flow-inspector-row",
|
|
674
836
|
children: [/* @__PURE__ */ e(n, {
|
|
675
837
|
size: "xs",
|
|
676
838
|
className: "flow-inspector-label",
|
|
677
839
|
children: "Font Color"
|
|
678
|
-
}), /* @__PURE__ */ e(
|
|
840
|
+
}), /* @__PURE__ */ e(O, {
|
|
679
841
|
value: l.data.labelColor ?? l.data.color,
|
|
680
842
|
kind: "text",
|
|
681
843
|
customFallback: "#111827",
|
|
682
|
-
onChange: (
|
|
844
|
+
onChange: (t) => a(l.id, "labelColor", t)
|
|
683
845
|
})]
|
|
684
846
|
}),
|
|
685
|
-
l.type !== "shapeSvg" && l.type !== "mediaNode" && /* @__PURE__ */
|
|
686
|
-
/* @__PURE__ */
|
|
847
|
+
l.type !== "shapeSvg" && l.type !== "mediaNode" && /* @__PURE__ */ s(E, { children: [
|
|
848
|
+
/* @__PURE__ */ s("div", {
|
|
687
849
|
className: "flow-inspector-row",
|
|
688
850
|
children: [/* @__PURE__ */ e(n, {
|
|
689
851
|
size: "xs",
|
|
@@ -728,39 +890,39 @@ function ve({ node: l, isGroup: d, onUpdateData: o, onUpdateDataBatch: i, onUpda
|
|
|
728
890
|
label: "bottom-right"
|
|
729
891
|
}
|
|
730
892
|
],
|
|
731
|
-
value: l.data.textPlacement ?? (
|
|
732
|
-
onChange: (
|
|
893
|
+
value: l.data.textPlacement ?? (c || l.type === "animAnchor" ? "top" : "center"),
|
|
894
|
+
onChange: (t) => a(l.id, "textPlacement", t),
|
|
733
895
|
style: { fontSize: 12 }
|
|
734
896
|
})]
|
|
735
897
|
}),
|
|
736
|
-
/* @__PURE__ */
|
|
898
|
+
/* @__PURE__ */ s("div", {
|
|
737
899
|
className: "flow-inspector-row",
|
|
738
900
|
children: [/* @__PURE__ */ e(n, {
|
|
739
901
|
size: "xs",
|
|
740
902
|
className: "flow-inspector-label",
|
|
741
903
|
children: "Text Off X"
|
|
742
|
-
}), /* @__PURE__ */ e(
|
|
904
|
+
}), /* @__PURE__ */ e(b, {
|
|
743
905
|
size: "xs",
|
|
744
906
|
type: "number",
|
|
745
907
|
value: String(l.data.labelOffsetX ?? 0),
|
|
746
|
-
onChange: (
|
|
908
|
+
onChange: (t) => a(l.id, "labelOffsetX", Number(t.target.value) || 0)
|
|
747
909
|
})]
|
|
748
910
|
}),
|
|
749
|
-
/* @__PURE__ */
|
|
911
|
+
/* @__PURE__ */ s("div", {
|
|
750
912
|
className: "flow-inspector-row",
|
|
751
913
|
children: [/* @__PURE__ */ e(n, {
|
|
752
914
|
size: "xs",
|
|
753
915
|
className: "flow-inspector-label",
|
|
754
916
|
children: "Text Off Y"
|
|
755
|
-
}), /* @__PURE__ */ e(
|
|
917
|
+
}), /* @__PURE__ */ e(b, {
|
|
756
918
|
size: "xs",
|
|
757
919
|
type: "number",
|
|
758
920
|
value: String(l.data.labelOffsetY ?? 0),
|
|
759
|
-
onChange: (
|
|
921
|
+
onChange: (t) => a(l.id, "labelOffsetY", Number(t.target.value) || 0)
|
|
760
922
|
})]
|
|
761
923
|
})
|
|
762
924
|
] }),
|
|
763
|
-
/* @__PURE__ */
|
|
925
|
+
/* @__PURE__ */ s("div", {
|
|
764
926
|
className: "flow-inspector-row",
|
|
765
927
|
children: [/* @__PURE__ */ e(n, {
|
|
766
928
|
size: "xs",
|
|
@@ -770,54 +932,151 @@ function ve({ node: l, isGroup: d, onUpdateData: o, onUpdateDataBatch: i, onUpda
|
|
|
770
932
|
options: [{
|
|
771
933
|
value: "none",
|
|
772
934
|
label: "none"
|
|
773
|
-
}, ...
|
|
774
|
-
value:
|
|
775
|
-
label:
|
|
935
|
+
}, ...le.map((t) => ({
|
|
936
|
+
value: t,
|
|
937
|
+
label: t
|
|
776
938
|
}))],
|
|
777
|
-
value: l.data.borderStyle ?? (
|
|
778
|
-
onChange: (
|
|
939
|
+
value: l.data.borderStyle ?? (c ? l.type === "geometryGroup" ? "dashed" : "dotted" : "solid"),
|
|
940
|
+
onChange: (t) => a(l.id, "borderStyle", t),
|
|
779
941
|
style: { fontSize: 12 }
|
|
780
942
|
})]
|
|
781
943
|
}),
|
|
782
|
-
l.type
|
|
783
|
-
|
|
944
|
+
he.has(l.type) && (() => {
|
|
945
|
+
const t = l.data.borderSides ?? {}, r = (w, z) => {
|
|
946
|
+
a(l.id, "borderSides", {
|
|
947
|
+
...l.data.borderSides ?? {},
|
|
948
|
+
[w]: {
|
|
949
|
+
...l.data.borderSides?.[w] ?? {},
|
|
950
|
+
...z
|
|
951
|
+
}
|
|
952
|
+
});
|
|
953
|
+
}, N = {
|
|
954
|
+
top: "Top",
|
|
955
|
+
right: "Right",
|
|
956
|
+
bottom: "Bottom",
|
|
957
|
+
left: "Left"
|
|
958
|
+
};
|
|
959
|
+
return /* @__PURE__ */ s(E, { children: [/* @__PURE__ */ s("div", {
|
|
960
|
+
className: "flow-inspector-row",
|
|
961
|
+
children: [/* @__PURE__ */ e(n, {
|
|
962
|
+
size: "xs",
|
|
963
|
+
className: "flow-inspector-label",
|
|
964
|
+
children: "Sides"
|
|
965
|
+
}), /* @__PURE__ */ s("div", {
|
|
966
|
+
style: {
|
|
967
|
+
display: "flex",
|
|
968
|
+
alignItems: "center",
|
|
969
|
+
gap: 6,
|
|
970
|
+
flex: 1
|
|
971
|
+
},
|
|
972
|
+
children: [/* @__PURE__ */ e("span", {
|
|
973
|
+
style: {
|
|
974
|
+
fontSize: 10,
|
|
975
|
+
opacity: 0.55
|
|
976
|
+
},
|
|
977
|
+
children: "上下左右独立边框"
|
|
978
|
+
}), pe(l.data, l.type) && /* @__PURE__ */ e("span", {
|
|
979
|
+
title: "恢复与 Border 设置一致",
|
|
980
|
+
style: { display: "inline-flex" },
|
|
981
|
+
children: /* @__PURE__ */ e(g, {
|
|
982
|
+
size: "xs",
|
|
983
|
+
variant: "ghost",
|
|
984
|
+
onClick: () => a(l.id, "borderSides", void 0),
|
|
985
|
+
children: "重置"
|
|
986
|
+
})
|
|
987
|
+
})]
|
|
988
|
+
})]
|
|
989
|
+
}), de.map((w) => {
|
|
990
|
+
const z = t[w];
|
|
991
|
+
return /* @__PURE__ */ s("div", {
|
|
992
|
+
style: {
|
|
993
|
+
display: "flex",
|
|
994
|
+
alignItems: "center",
|
|
995
|
+
gap: 4,
|
|
996
|
+
marginBottom: 4
|
|
997
|
+
},
|
|
998
|
+
children: [
|
|
999
|
+
/* @__PURE__ */ e("span", {
|
|
1000
|
+
title: `独立设置${N[w]}边`,
|
|
1001
|
+
style: {
|
|
1002
|
+
fontSize: 10,
|
|
1003
|
+
width: 40,
|
|
1004
|
+
flexShrink: 0,
|
|
1005
|
+
opacity: z ? 0.95 : 0.6
|
|
1006
|
+
},
|
|
1007
|
+
children: N[w]
|
|
1008
|
+
}),
|
|
1009
|
+
/* @__PURE__ */ e("span", {
|
|
1010
|
+
title: `显示/隐藏 ${N[w]} 边`,
|
|
1011
|
+
style: { display: "inline-flex" },
|
|
1012
|
+
children: /* @__PURE__ */ e(W, {
|
|
1013
|
+
size: "sm",
|
|
1014
|
+
checked: z?.visible ?? !0,
|
|
1015
|
+
onChange: (T) => r(w, { visible: T })
|
|
1016
|
+
})
|
|
1017
|
+
}),
|
|
1018
|
+
/* @__PURE__ */ e(O, {
|
|
1019
|
+
value: z?.color ?? l.data.stroke,
|
|
1020
|
+
kind: "stroke",
|
|
1021
|
+
customFallback: "#334155",
|
|
1022
|
+
onChange: (T) => r(w, { color: T })
|
|
1023
|
+
}),
|
|
1024
|
+
/* @__PURE__ */ e("span", {
|
|
1025
|
+
title: `${N[w]} 粗细`,
|
|
1026
|
+
style: {
|
|
1027
|
+
display: "inline-flex",
|
|
1028
|
+
width: 52
|
|
1029
|
+
},
|
|
1030
|
+
children: /* @__PURE__ */ e(b, {
|
|
1031
|
+
size: "xs",
|
|
1032
|
+
type: "number",
|
|
1033
|
+
value: String(z?.width ?? l.data.strokeWidth),
|
|
1034
|
+
onChange: (T) => r(w, { width: Math.max(0, Number(T.target.value) || 0) })
|
|
1035
|
+
})
|
|
1036
|
+
})
|
|
1037
|
+
]
|
|
1038
|
+
}, w);
|
|
1039
|
+
})] });
|
|
1040
|
+
})(),
|
|
1041
|
+
l.type === "shapeSvg" && /* @__PURE__ */ s(E, { children: [
|
|
1042
|
+
/* @__PURE__ */ s("div", {
|
|
784
1043
|
className: "flow-inspector-row",
|
|
785
1044
|
children: [/* @__PURE__ */ e(n, {
|
|
786
1045
|
size: "xs",
|
|
787
1046
|
className: "flow-inspector-label",
|
|
788
1047
|
children: "Icon"
|
|
789
1048
|
}), /* @__PURE__ */ e(y, {
|
|
790
|
-
options:
|
|
791
|
-
value:
|
|
792
|
-
label:
|
|
1049
|
+
options: ve().map((t) => ({
|
|
1050
|
+
value: t.id,
|
|
1051
|
+
label: t.label
|
|
793
1052
|
})),
|
|
794
1053
|
value: l.data.svgId ?? "",
|
|
795
1054
|
placeholder: "选择图标",
|
|
796
|
-
onChange: (
|
|
797
|
-
const
|
|
798
|
-
|
|
799
|
-
svgId:
|
|
800
|
-
...
|
|
801
|
-
...!l.data.label || l.data.label === "Text" ? { label:
|
|
1055
|
+
onChange: (t) => {
|
|
1056
|
+
const r = $(String(t));
|
|
1057
|
+
o(l.id, {
|
|
1058
|
+
svgId: t,
|
|
1059
|
+
...r?.brandColor ? { color: r.brandColor } : {},
|
|
1060
|
+
...!l.data.label || l.data.label === "Text" ? { label: r?.label ?? String(t) } : {}
|
|
802
1061
|
});
|
|
803
1062
|
},
|
|
804
1063
|
style: { fontSize: 12 }
|
|
805
1064
|
})]
|
|
806
1065
|
}),
|
|
807
|
-
/* @__PURE__ */
|
|
1066
|
+
/* @__PURE__ */ s("div", {
|
|
808
1067
|
className: "flow-inspector-row",
|
|
809
1068
|
children: [/* @__PURE__ */ e(n, {
|
|
810
1069
|
size: "xs",
|
|
811
1070
|
className: "flow-inspector-label",
|
|
812
1071
|
children: "Box"
|
|
813
|
-
}), /* @__PURE__ */ e(
|
|
1072
|
+
}), /* @__PURE__ */ e(W, {
|
|
814
1073
|
size: "sm",
|
|
815
1074
|
checked: l.data.iconBox ?? !1,
|
|
816
|
-
onChange: (
|
|
1075
|
+
onChange: (t) => a(l.id, "iconBox", t),
|
|
817
1076
|
label: "显示边框"
|
|
818
1077
|
})]
|
|
819
1078
|
}),
|
|
820
|
-
/* @__PURE__ */
|
|
1079
|
+
/* @__PURE__ */ s("div", {
|
|
821
1080
|
className: "flow-inspector-row",
|
|
822
1081
|
children: [/* @__PURE__ */ e(n, {
|
|
823
1082
|
size: "xs",
|
|
@@ -847,45 +1106,45 @@ function ve({ node: l, isGroup: d, onUpdateData: o, onUpdateDataBatch: i, onUpda
|
|
|
847
1106
|
}
|
|
848
1107
|
],
|
|
849
1108
|
value: l.data.labelPlacement === "above" ? "top" : l.data.labelPlacement === "center" ? "middle" : l.data.labelPlacement === "below" ? "bottom" : l.data.labelPlacement ?? "bottom",
|
|
850
|
-
onChange: (
|
|
1109
|
+
onChange: (t) => a(l.id, "labelPlacement", t),
|
|
851
1110
|
style: { fontSize: 12 }
|
|
852
1111
|
})]
|
|
853
1112
|
}),
|
|
854
|
-
/* @__PURE__ */
|
|
1113
|
+
/* @__PURE__ */ s("div", {
|
|
855
1114
|
className: "flow-inspector-row",
|
|
856
1115
|
children: [/* @__PURE__ */ e(n, {
|
|
857
1116
|
size: "xs",
|
|
858
1117
|
className: "flow-inspector-label",
|
|
859
1118
|
children: "Offset X"
|
|
860
|
-
}), /* @__PURE__ */ e(
|
|
1119
|
+
}), /* @__PURE__ */ e(b, {
|
|
861
1120
|
size: "xs",
|
|
862
1121
|
type: "number",
|
|
863
1122
|
value: String(l.data.labelOffsetX ?? 0),
|
|
864
|
-
onChange: (
|
|
1123
|
+
onChange: (t) => a(l.id, "labelOffsetX", Number(t.target.value) || 0)
|
|
865
1124
|
})]
|
|
866
1125
|
}),
|
|
867
|
-
/* @__PURE__ */
|
|
1126
|
+
/* @__PURE__ */ s("div", {
|
|
868
1127
|
className: "flow-inspector-row",
|
|
869
1128
|
children: [/* @__PURE__ */ e(n, {
|
|
870
1129
|
size: "xs",
|
|
871
1130
|
className: "flow-inspector-label",
|
|
872
1131
|
children: "Offset Y"
|
|
873
|
-
}), /* @__PURE__ */ e(
|
|
1132
|
+
}), /* @__PURE__ */ e(b, {
|
|
874
1133
|
size: "xs",
|
|
875
1134
|
type: "number",
|
|
876
1135
|
value: String(l.data.labelOffsetY ?? 0),
|
|
877
|
-
onChange: (
|
|
1136
|
+
onChange: (t) => a(l.id, "labelOffsetY", Number(t.target.value) || 0)
|
|
878
1137
|
})]
|
|
879
1138
|
})
|
|
880
1139
|
] })
|
|
881
1140
|
]
|
|
882
1141
|
}),
|
|
883
|
-
l.type === "mediaNode" && /* @__PURE__ */
|
|
1142
|
+
l.type === "mediaNode" && /* @__PURE__ */ s("div", {
|
|
884
1143
|
className: "flow-inspector-section",
|
|
885
1144
|
children: [/* @__PURE__ */ e("div", {
|
|
886
1145
|
className: "flow-inspector-section-title",
|
|
887
1146
|
children: "Palette (Archify)"
|
|
888
|
-
}), /* @__PURE__ */
|
|
1147
|
+
}), /* @__PURE__ */ s("div", {
|
|
889
1148
|
className: "flow-inspector-row",
|
|
890
1149
|
children: [/* @__PURE__ */ e(n, {
|
|
891
1150
|
size: "xs",
|
|
@@ -897,83 +1156,87 @@ function ve({ node: l, isGroup: d, onUpdateData: o, onUpdateDataBatch: i, onUpda
|
|
|
897
1156
|
flexWrap: "wrap",
|
|
898
1157
|
gap: 4
|
|
899
1158
|
},
|
|
900
|
-
children:
|
|
1159
|
+
children: j.map((t) => /* @__PURE__ */ e("button", {
|
|
901
1160
|
type: "button",
|
|
902
|
-
title:
|
|
903
|
-
"aria-label":
|
|
904
|
-
onClick: () =>
|
|
1161
|
+
title: _[t],
|
|
1162
|
+
"aria-label": _[t],
|
|
1163
|
+
onClick: () => o(l.id, V(t)),
|
|
905
1164
|
style: {
|
|
906
1165
|
width: 18,
|
|
907
1166
|
height: 18,
|
|
908
1167
|
borderRadius: 4,
|
|
909
1168
|
cursor: "pointer",
|
|
910
|
-
background:
|
|
911
|
-
border: `1.5px solid ${
|
|
1169
|
+
background: R[t].fill,
|
|
1170
|
+
border: `1.5px solid ${R[t].stroke}`
|
|
912
1171
|
}
|
|
913
|
-
},
|
|
1172
|
+
}, t))
|
|
914
1173
|
})]
|
|
915
1174
|
})]
|
|
916
1175
|
}),
|
|
917
|
-
l.type !== "mediaNode" && /* @__PURE__ */
|
|
1176
|
+
l.type !== "mediaNode" && l.type !== "shapeSvg" && /* @__PURE__ */ e(ke, {
|
|
1177
|
+
node: l,
|
|
1178
|
+
onUpdateData: a
|
|
1179
|
+
}),
|
|
1180
|
+
l.type !== "mediaNode" && /* @__PURE__ */ s("div", {
|
|
918
1181
|
className: "flow-inspector-section",
|
|
919
1182
|
children: [
|
|
920
1183
|
/* @__PURE__ */ e("div", {
|
|
921
1184
|
className: "flow-inspector-section-title",
|
|
922
1185
|
children: "Card (Archify)"
|
|
923
1186
|
}),
|
|
924
|
-
/* @__PURE__ */
|
|
1187
|
+
/* @__PURE__ */ s("div", {
|
|
925
1188
|
className: "flow-inspector-row",
|
|
926
1189
|
children: [/* @__PURE__ */ e(n, {
|
|
927
1190
|
size: "xs",
|
|
928
1191
|
className: "flow-inspector-label",
|
|
929
1192
|
children: "Subtitle"
|
|
930
|
-
}), /* @__PURE__ */ e(
|
|
1193
|
+
}), /* @__PURE__ */ e(b, {
|
|
931
1194
|
size: "xs",
|
|
932
1195
|
value: l.data.sublabel ?? "",
|
|
933
1196
|
placeholder: "secondary line",
|
|
934
|
-
onChange: (
|
|
1197
|
+
onChange: (t) => a(l.id, "sublabel", t.target.value)
|
|
935
1198
|
})]
|
|
936
1199
|
}),
|
|
937
|
-
/* @__PURE__ */
|
|
1200
|
+
/* @__PURE__ */ s("div", {
|
|
938
1201
|
className: "flow-inspector-row",
|
|
939
1202
|
children: [/* @__PURE__ */ e(n, {
|
|
940
1203
|
size: "xs",
|
|
941
1204
|
className: "flow-inspector-label",
|
|
942
1205
|
children: "Sub Color"
|
|
943
|
-
}), /* @__PURE__ */ e(
|
|
1206
|
+
}), /* @__PURE__ */ e(O, {
|
|
944
1207
|
value: l.data.sublabelColor ?? "#94a3b8",
|
|
945
1208
|
kind: "text",
|
|
946
1209
|
customFallback: "#94a3b8",
|
|
947
|
-
onChange: (
|
|
1210
|
+
onChange: (t) => a(l.id, "sublabelColor", t)
|
|
948
1211
|
})]
|
|
949
1212
|
}),
|
|
950
|
-
/* @__PURE__ */
|
|
1213
|
+
/* @__PURE__ */ s("div", {
|
|
951
1214
|
className: "flow-inspector-row",
|
|
952
1215
|
children: [/* @__PURE__ */ e(n, {
|
|
953
1216
|
size: "xs",
|
|
954
1217
|
className: "flow-inspector-label",
|
|
955
1218
|
children: "Tag"
|
|
956
|
-
}), /* @__PURE__ */ e(
|
|
1219
|
+
}), /* @__PURE__ */ e(b, {
|
|
957
1220
|
size: "xs",
|
|
958
1221
|
value: l.data.tag ?? "",
|
|
959
1222
|
placeholder: "corner pill",
|
|
960
|
-
onChange: (
|
|
1223
|
+
onChange: (t) => a(l.id, "tag", t.target.value)
|
|
961
1224
|
})]
|
|
962
1225
|
}),
|
|
963
|
-
/* @__PURE__ */
|
|
1226
|
+
/* @__PURE__ */ s("div", {
|
|
964
1227
|
className: "flow-inspector-row",
|
|
965
1228
|
children: [/* @__PURE__ */ e(n, {
|
|
966
1229
|
size: "xs",
|
|
967
1230
|
className: "flow-inspector-label",
|
|
968
1231
|
children: "Tag Color"
|
|
969
|
-
}), /* @__PURE__ */ e(
|
|
1232
|
+
}), /* @__PURE__ */ e(O, {
|
|
970
1233
|
value: l.data.tagColor ?? l.data.stroke,
|
|
971
1234
|
kind: "stroke",
|
|
972
1235
|
customFallback: "#334155",
|
|
973
|
-
onChange: (
|
|
1236
|
+
onChange: (t) => a(l.id, "tagColor", t)
|
|
974
1237
|
})]
|
|
975
1238
|
}),
|
|
976
|
-
/* @__PURE__ */
|
|
1239
|
+
/* @__PURE__ */ s("div", {
|
|
977
1240
|
className: "flow-inspector-row",
|
|
978
1241
|
children: [/* @__PURE__ */ e(n, {
|
|
979
1242
|
size: "xs",
|
|
@@ -999,11 +1262,11 @@ function ve({ node: l, isGroup: d, onUpdateData: o, onUpdateDataBatch: i, onUpda
|
|
|
999
1262
|
}
|
|
1000
1263
|
],
|
|
1001
1264
|
value: l.data.tagPlacement ?? "top-right",
|
|
1002
|
-
onChange: (
|
|
1265
|
+
onChange: (t) => a(l.id, "tagPlacement", t),
|
|
1003
1266
|
style: { fontSize: 12 }
|
|
1004
1267
|
})]
|
|
1005
1268
|
}),
|
|
1006
|
-
/* @__PURE__ */
|
|
1269
|
+
/* @__PURE__ */ s("div", {
|
|
1007
1270
|
className: "flow-inspector-row",
|
|
1008
1271
|
children: [/* @__PURE__ */ e(n, {
|
|
1009
1272
|
size: "xs",
|
|
@@ -1015,36 +1278,36 @@ function ve({ node: l, isGroup: d, onUpdateData: o, onUpdateDataBatch: i, onUpda
|
|
|
1015
1278
|
flexWrap: "wrap",
|
|
1016
1279
|
gap: 4
|
|
1017
1280
|
},
|
|
1018
|
-
children:
|
|
1281
|
+
children: j.map((t) => /* @__PURE__ */ e("button", {
|
|
1019
1282
|
type: "button",
|
|
1020
|
-
title:
|
|
1021
|
-
"aria-label":
|
|
1022
|
-
onClick: () =>
|
|
1283
|
+
title: _[t],
|
|
1284
|
+
"aria-label": _[t],
|
|
1285
|
+
onClick: () => o(l.id, V(t)),
|
|
1023
1286
|
style: {
|
|
1024
1287
|
width: 18,
|
|
1025
1288
|
height: 18,
|
|
1026
1289
|
borderRadius: 4,
|
|
1027
1290
|
cursor: "pointer",
|
|
1028
|
-
background:
|
|
1029
|
-
border: `1.5px solid ${
|
|
1291
|
+
background: R[t].fill,
|
|
1292
|
+
border: `1.5px solid ${R[t].stroke}`
|
|
1030
1293
|
}
|
|
1031
|
-
},
|
|
1294
|
+
}, t))
|
|
1032
1295
|
})]
|
|
1033
1296
|
})
|
|
1034
1297
|
]
|
|
1035
1298
|
}),
|
|
1036
|
-
l.type === "mediaNode" && /* @__PURE__ */ e(
|
|
1299
|
+
l.type === "mediaNode" && /* @__PURE__ */ e(Te, {
|
|
1037
1300
|
node: l,
|
|
1038
|
-
onUpdateData:
|
|
1301
|
+
onUpdateData: a
|
|
1039
1302
|
}),
|
|
1040
|
-
/* @__PURE__ */
|
|
1303
|
+
/* @__PURE__ */ s("div", {
|
|
1041
1304
|
className: "flow-inspector-section",
|
|
1042
1305
|
children: [
|
|
1043
1306
|
/* @__PURE__ */ e("div", {
|
|
1044
1307
|
className: "flow-inspector-section-title",
|
|
1045
1308
|
children: "Transform"
|
|
1046
1309
|
}),
|
|
1047
|
-
/* @__PURE__ */
|
|
1310
|
+
/* @__PURE__ */ s("div", {
|
|
1048
1311
|
className: "flow-inspector-row",
|
|
1049
1312
|
children: [
|
|
1050
1313
|
/* @__PURE__ */ e(n, {
|
|
@@ -1052,11 +1315,11 @@ function ve({ node: l, isGroup: d, onUpdateData: o, onUpdateDataBatch: i, onUpda
|
|
|
1052
1315
|
className: "flow-inspector-label",
|
|
1053
1316
|
children: "Rotate"
|
|
1054
1317
|
}),
|
|
1055
|
-
/* @__PURE__ */ e(
|
|
1318
|
+
/* @__PURE__ */ e(b, {
|
|
1056
1319
|
size: "xs",
|
|
1057
1320
|
type: "number",
|
|
1058
1321
|
value: String(l.data.rotation ?? 0),
|
|
1059
|
-
onChange: (
|
|
1322
|
+
onChange: (t) => a(l.id, "rotation", Number(t.target.value) || 0)
|
|
1060
1323
|
}),
|
|
1061
1324
|
/* @__PURE__ */ e("span", {
|
|
1062
1325
|
className: "flow-inspector-suffix",
|
|
@@ -1068,7 +1331,7 @@ function ve({ node: l, isGroup: d, onUpdateData: o, onUpdateDataBatch: i, onUpda
|
|
|
1068
1331
|
})
|
|
1069
1332
|
]
|
|
1070
1333
|
}),
|
|
1071
|
-
/* @__PURE__ */
|
|
1334
|
+
/* @__PURE__ */ s("div", {
|
|
1072
1335
|
className: "flow-inspector-row",
|
|
1073
1336
|
children: [
|
|
1074
1337
|
/* @__PURE__ */ e(n, {
|
|
@@ -1079,7 +1342,7 @@ function ve({ node: l, isGroup: d, onUpdateData: o, onUpdateDataBatch: i, onUpda
|
|
|
1079
1342
|
/* @__PURE__ */ e(g, {
|
|
1080
1343
|
size: "xs",
|
|
1081
1344
|
variant: l.data.flipX ? "primary" : "ghost",
|
|
1082
|
-
onClick: () =>
|
|
1345
|
+
onClick: () => a(l.id, "flipX", !l.data.flipX),
|
|
1083
1346
|
square: !0,
|
|
1084
1347
|
children: /* @__PURE__ */ e("span", {
|
|
1085
1348
|
title: "Flip Horizontal",
|
|
@@ -1089,7 +1352,7 @@ function ve({ node: l, isGroup: d, onUpdateData: o, onUpdateDataBatch: i, onUpda
|
|
|
1089
1352
|
/* @__PURE__ */ e(g, {
|
|
1090
1353
|
size: "xs",
|
|
1091
1354
|
variant: l.data.flipY ? "primary" : "ghost",
|
|
1092
|
-
onClick: () =>
|
|
1355
|
+
onClick: () => a(l.id, "flipY", !l.data.flipY),
|
|
1093
1356
|
square: !0,
|
|
1094
1357
|
children: /* @__PURE__ */ e("span", {
|
|
1095
1358
|
title: "Flip Vertical",
|
|
@@ -1098,7 +1361,7 @@ function ve({ node: l, isGroup: d, onUpdateData: o, onUpdateDataBatch: i, onUpda
|
|
|
1098
1361
|
})
|
|
1099
1362
|
]
|
|
1100
1363
|
}),
|
|
1101
|
-
/* @__PURE__ */
|
|
1364
|
+
/* @__PURE__ */ s("div", {
|
|
1102
1365
|
className: "flow-inspector-row",
|
|
1103
1366
|
children: [
|
|
1104
1367
|
/* @__PURE__ */ e(n, {
|
|
@@ -1109,13 +1372,13 @@ function ve({ node: l, isGroup: d, onUpdateData: o, onUpdateDataBatch: i, onUpda
|
|
|
1109
1372
|
/* @__PURE__ */ e(g, {
|
|
1110
1373
|
size: "xs",
|
|
1111
1374
|
variant: "ghost",
|
|
1112
|
-
onClick: () =>
|
|
1375
|
+
onClick: () => a(l.id, "rotation", ((l.data.rotation ?? 0) + 90) % 360),
|
|
1113
1376
|
children: "+90°"
|
|
1114
1377
|
}),
|
|
1115
1378
|
/* @__PURE__ */ e(g, {
|
|
1116
1379
|
size: "xs",
|
|
1117
1380
|
variant: "ghost",
|
|
1118
|
-
onClick: () =>
|
|
1381
|
+
onClick: () => a(l.id, "rotation", ((l.data.rotation ?? 0) - 90 + 360) % 360),
|
|
1119
1382
|
children: "−90°"
|
|
1120
1383
|
})
|
|
1121
1384
|
]
|
|
@@ -1124,26 +1387,26 @@ function ve({ node: l, isGroup: d, onUpdateData: o, onUpdateDataBatch: i, onUpda
|
|
|
1124
1387
|
})
|
|
1125
1388
|
] });
|
|
1126
1389
|
}
|
|
1127
|
-
function
|
|
1128
|
-
const
|
|
1129
|
-
|
|
1390
|
+
function Te({ node: l, onUpdateData: c }) {
|
|
1391
|
+
const a = l.data.mediaKind ?? "markdown", o = l.data.aiConfig, f = ye(null), m = (t, r) => {
|
|
1392
|
+
c(l.id, "aiConfig", {
|
|
1130
1393
|
gateway: "",
|
|
1131
1394
|
protocol: "openai",
|
|
1132
1395
|
model: "",
|
|
1133
|
-
...
|
|
1134
|
-
[
|
|
1396
|
+
...o,
|
|
1397
|
+
[t]: r
|
|
1135
1398
|
});
|
|
1136
1399
|
};
|
|
1137
|
-
return /* @__PURE__ */
|
|
1400
|
+
return /* @__PURE__ */ s("div", {
|
|
1138
1401
|
className: "flow-inspector-section",
|
|
1139
|
-
children: [/* @__PURE__ */
|
|
1402
|
+
children: [/* @__PURE__ */ s("div", {
|
|
1140
1403
|
className: "flow-inspector-section-title",
|
|
1141
|
-
children: ["Media · ",
|
|
1142
|
-
}),
|
|
1404
|
+
children: ["Media · ", a]
|
|
1405
|
+
}), a === "data" ? /* @__PURE__ */ e(xe, {
|
|
1143
1406
|
node: l,
|
|
1144
|
-
onUpdateData:
|
|
1145
|
-
}) :
|
|
1146
|
-
/* @__PURE__ */
|
|
1407
|
+
onUpdateData: c
|
|
1408
|
+
}) : a === "model3d" ? /* @__PURE__ */ s(E, { children: [
|
|
1409
|
+
/* @__PURE__ */ s("div", {
|
|
1147
1410
|
className: "flow-inspector-row",
|
|
1148
1411
|
children: [/* @__PURE__ */ e(n, {
|
|
1149
1412
|
size: "xs",
|
|
@@ -1165,23 +1428,23 @@ function be({ node: l, onUpdateData: d }) {
|
|
|
1165
1428
|
}
|
|
1166
1429
|
],
|
|
1167
1430
|
value: l.data.modelFormat ?? "stl",
|
|
1168
|
-
onChange: (
|
|
1431
|
+
onChange: (t) => c(l.id, "modelFormat", t)
|
|
1169
1432
|
})]
|
|
1170
1433
|
}),
|
|
1171
|
-
/* @__PURE__ */
|
|
1434
|
+
/* @__PURE__ */ s("div", {
|
|
1172
1435
|
className: "flow-inspector-row flow-inspector-multiline",
|
|
1173
1436
|
children: [/* @__PURE__ */ e(n, {
|
|
1174
1437
|
size: "xs",
|
|
1175
1438
|
className: "flow-inspector-label",
|
|
1176
1439
|
children: "模型链接"
|
|
1177
|
-
}), /* @__PURE__ */ e(
|
|
1440
|
+
}), /* @__PURE__ */ e(b, {
|
|
1178
1441
|
size: "xs",
|
|
1179
1442
|
value: l.data.mediaContent ?? "",
|
|
1180
1443
|
placeholder: "https://example.com/model.stl",
|
|
1181
|
-
onChange: (
|
|
1444
|
+
onChange: (t) => c(l.id, "mediaContent", t.target.value)
|
|
1182
1445
|
})]
|
|
1183
1446
|
}),
|
|
1184
|
-
/* @__PURE__ */
|
|
1447
|
+
/* @__PURE__ */ s("div", {
|
|
1185
1448
|
className: "flow-inspector-row",
|
|
1186
1449
|
children: [
|
|
1187
1450
|
/* @__PURE__ */ e(n, {
|
|
@@ -1190,32 +1453,32 @@ function be({ node: l, onUpdateData: d }) {
|
|
|
1190
1453
|
children: "本地模型"
|
|
1191
1454
|
}),
|
|
1192
1455
|
/* @__PURE__ */ e("input", {
|
|
1193
|
-
ref:
|
|
1456
|
+
ref: f,
|
|
1194
1457
|
type: "file",
|
|
1195
1458
|
accept: ".stl,.obj,.3mf,model/stl,model/obj,model/3mf,application/vnd.ms-package.3dmanufacturing-3dmodel+xml",
|
|
1196
1459
|
hidden: !0,
|
|
1197
|
-
onChange: (
|
|
1198
|
-
const
|
|
1199
|
-
if (
|
|
1200
|
-
if (
|
|
1460
|
+
onChange: (t) => {
|
|
1461
|
+
const r = t.target.files?.[0];
|
|
1462
|
+
if (t.target.value = "", !r) return;
|
|
1463
|
+
if (r.size > 10 * 1024 * 1024) {
|
|
1201
1464
|
window.alert("本地模型不能超过 10 MiB,请改用模型链接。");
|
|
1202
1465
|
return;
|
|
1203
1466
|
}
|
|
1204
|
-
const
|
|
1205
|
-
if (
|
|
1467
|
+
const N = r.name.split(".").pop()?.toLowerCase();
|
|
1468
|
+
if (N !== "stl" && N !== "obj" && N !== "3mf") {
|
|
1206
1469
|
window.alert("仅支持 STL、OBJ 和 3MF 模型。");
|
|
1207
1470
|
return;
|
|
1208
1471
|
}
|
|
1209
|
-
const
|
|
1210
|
-
|
|
1211
|
-
typeof
|
|
1212
|
-
},
|
|
1472
|
+
const w = new FileReader();
|
|
1473
|
+
w.onload = () => {
|
|
1474
|
+
typeof w.result == "string" && (c(l.id, "modelFormat", N), c(l.id, "mediaContent", w.result));
|
|
1475
|
+
}, w.onerror = () => window.alert("读取本地模型失败。"), w.readAsDataURL(r);
|
|
1213
1476
|
}
|
|
1214
1477
|
}),
|
|
1215
1478
|
/* @__PURE__ */ e(g, {
|
|
1216
1479
|
size: "xs",
|
|
1217
1480
|
variant: "neutral",
|
|
1218
|
-
onClick: () =>
|
|
1481
|
+
onClick: () => f.current?.click(),
|
|
1219
1482
|
children: "选择文件"
|
|
1220
1483
|
}),
|
|
1221
1484
|
l.data.mediaContent?.startsWith("data:") && /* @__PURE__ */ e("span", {
|
|
@@ -1228,33 +1491,33 @@ function be({ node: l, onUpdateData: d }) {
|
|
|
1228
1491
|
className: "flow-inspector-help",
|
|
1229
1492
|
children: "支持 STL、OBJ、3MF;本地文件将以 Base64 嵌入文档,最大 10 MiB。选中节点后可在内部拖拽旋转、滚轮缩放。"
|
|
1230
1493
|
})
|
|
1231
|
-
] }) :
|
|
1494
|
+
] }) : a === "image" ? /* @__PURE__ */ s(E, { children: [/* @__PURE__ */ s("div", {
|
|
1232
1495
|
className: "flow-inspector-row flow-inspector-multiline",
|
|
1233
1496
|
children: [/* @__PURE__ */ e(n, {
|
|
1234
1497
|
size: "xs",
|
|
1235
1498
|
className: "flow-inspector-label",
|
|
1236
1499
|
children: "图片链接"
|
|
1237
|
-
}), /* @__PURE__ */ e(
|
|
1500
|
+
}), /* @__PURE__ */ e(b, {
|
|
1238
1501
|
size: "xs",
|
|
1239
1502
|
value: l.data.mediaContent ?? "",
|
|
1240
1503
|
placeholder: "https://example.com/image.png",
|
|
1241
|
-
onChange: (
|
|
1504
|
+
onChange: (t) => c(l.id, "mediaContent", t.target.value)
|
|
1242
1505
|
})]
|
|
1243
1506
|
}), /* @__PURE__ */ e("div", {
|
|
1244
1507
|
className: "flow-inspector-help",
|
|
1245
1508
|
children: "支持 HTTP(S) 链接;选中图片节点后可直接粘贴图片并保存为 Base64。"
|
|
1246
|
-
})] }) :
|
|
1509
|
+
})] }) : a !== "ai" ? /* @__PURE__ */ e(K, {
|
|
1247
1510
|
label: {
|
|
1248
1511
|
markdown: "Markdown 源码",
|
|
1249
1512
|
html: "HTML 源码",
|
|
1250
1513
|
mermaid: "Mermaid 图表",
|
|
1251
1514
|
math: "LaTeX 公式"
|
|
1252
|
-
}[
|
|
1515
|
+
}[a] ?? "内容",
|
|
1253
1516
|
value: l.data.mediaContent ?? "",
|
|
1254
|
-
onChange: (
|
|
1517
|
+
onChange: (t) => c(l.id, "mediaContent", t),
|
|
1255
1518
|
rows: 8
|
|
1256
|
-
}) : /* @__PURE__ */
|
|
1257
|
-
/* @__PURE__ */
|
|
1519
|
+
}) : /* @__PURE__ */ s(E, { children: [
|
|
1520
|
+
/* @__PURE__ */ s("div", {
|
|
1258
1521
|
className: "flow-inspector-row",
|
|
1259
1522
|
children: [/* @__PURE__ */ e(n, {
|
|
1260
1523
|
size: "xs",
|
|
@@ -1268,12 +1531,12 @@ function be({ node: l, onUpdateData: d }) {
|
|
|
1268
1531
|
value: "anthropic",
|
|
1269
1532
|
label: "Anthropic 兼容"
|
|
1270
1533
|
}],
|
|
1271
|
-
value:
|
|
1272
|
-
onChange: (
|
|
1534
|
+
value: o?.protocol ?? "openai",
|
|
1535
|
+
onChange: (t) => m("protocol", t),
|
|
1273
1536
|
style: { fontSize: 12 }
|
|
1274
1537
|
})]
|
|
1275
1538
|
}),
|
|
1276
|
-
/* @__PURE__ */
|
|
1539
|
+
/* @__PURE__ */ s("div", {
|
|
1277
1540
|
className: "flow-inspector-row",
|
|
1278
1541
|
style: {
|
|
1279
1542
|
flexDirection: "column",
|
|
@@ -1284,14 +1547,14 @@ function be({ node: l, onUpdateData: d }) {
|
|
|
1284
1547
|
size: "xs",
|
|
1285
1548
|
className: "flow-inspector-label",
|
|
1286
1549
|
children: "接口地址"
|
|
1287
|
-
}), /* @__PURE__ */ e(
|
|
1550
|
+
}), /* @__PURE__ */ e(b, {
|
|
1288
1551
|
size: "xs",
|
|
1289
|
-
value:
|
|
1552
|
+
value: o?.gateway ?? "",
|
|
1290
1553
|
placeholder: "https://api.openai.com/v1/chat/completions",
|
|
1291
|
-
onChange: (
|
|
1554
|
+
onChange: (t) => m("gateway", t.target.value)
|
|
1292
1555
|
})]
|
|
1293
1556
|
}),
|
|
1294
|
-
/* @__PURE__ */
|
|
1557
|
+
/* @__PURE__ */ s("div", {
|
|
1295
1558
|
className: "flow-inspector-row",
|
|
1296
1559
|
style: {
|
|
1297
1560
|
flexDirection: "column",
|
|
@@ -1302,14 +1565,14 @@ function be({ node: l, onUpdateData: d }) {
|
|
|
1302
1565
|
size: "xs",
|
|
1303
1566
|
className: "flow-inspector-label",
|
|
1304
1567
|
children: "模型"
|
|
1305
|
-
}), /* @__PURE__ */ e(
|
|
1568
|
+
}), /* @__PURE__ */ e(b, {
|
|
1306
1569
|
size: "xs",
|
|
1307
|
-
value:
|
|
1570
|
+
value: o?.model ?? "",
|
|
1308
1571
|
placeholder: "gpt-4o-mini",
|
|
1309
|
-
onChange: (
|
|
1572
|
+
onChange: (t) => m("model", t.target.value)
|
|
1310
1573
|
})]
|
|
1311
1574
|
}),
|
|
1312
|
-
/* @__PURE__ */
|
|
1575
|
+
/* @__PURE__ */ s("div", {
|
|
1313
1576
|
className: "flow-inspector-row",
|
|
1314
1577
|
style: {
|
|
1315
1578
|
flexDirection: "column",
|
|
@@ -1320,18 +1583,18 @@ function be({ node: l, onUpdateData: d }) {
|
|
|
1320
1583
|
size: "xs",
|
|
1321
1584
|
className: "flow-inspector-label",
|
|
1322
1585
|
children: "API Key"
|
|
1323
|
-
}), /* @__PURE__ */ e(
|
|
1586
|
+
}), /* @__PURE__ */ e(b, {
|
|
1324
1587
|
size: "xs",
|
|
1325
1588
|
type: "password",
|
|
1326
|
-
value:
|
|
1589
|
+
value: o?.apiKey ?? "",
|
|
1327
1590
|
placeholder: "sk-...",
|
|
1328
|
-
onChange: (
|
|
1591
|
+
onChange: (t) => m("apiKey", t.target.value)
|
|
1329
1592
|
})]
|
|
1330
1593
|
}),
|
|
1331
|
-
/* @__PURE__ */ e(
|
|
1594
|
+
/* @__PURE__ */ e(K, {
|
|
1332
1595
|
label: "System Prompt",
|
|
1333
|
-
value:
|
|
1334
|
-
onChange: (
|
|
1596
|
+
value: o?.systemPrompt ?? "",
|
|
1597
|
+
onChange: (t) => m("systemPrompt", t),
|
|
1335
1598
|
rows: 3
|
|
1336
1599
|
}),
|
|
1337
1600
|
/* @__PURE__ */ e("div", {
|
|
@@ -1345,142 +1608,142 @@ function be({ node: l, onUpdateData: d }) {
|
|
|
1345
1608
|
] })]
|
|
1346
1609
|
});
|
|
1347
1610
|
}
|
|
1348
|
-
function
|
|
1349
|
-
return /* @__PURE__ */
|
|
1611
|
+
function Oe({ edge: l, onUpdateData: c, onUpdateType: a }) {
|
|
1612
|
+
return /* @__PURE__ */ s("div", {
|
|
1350
1613
|
className: "flow-inspector-section",
|
|
1351
1614
|
children: [
|
|
1352
1615
|
/* @__PURE__ */ e("div", {
|
|
1353
1616
|
className: "flow-inspector-section-title",
|
|
1354
1617
|
children: "Edge"
|
|
1355
1618
|
}),
|
|
1356
|
-
/* @__PURE__ */
|
|
1619
|
+
/* @__PURE__ */ s("div", {
|
|
1357
1620
|
className: "flow-inspector-row",
|
|
1358
1621
|
children: [/* @__PURE__ */ e(n, {
|
|
1359
1622
|
size: "xs",
|
|
1360
1623
|
className: "flow-inspector-label",
|
|
1361
1624
|
children: "Type"
|
|
1362
1625
|
}), /* @__PURE__ */ e(y, {
|
|
1363
|
-
options: se.map((
|
|
1364
|
-
value:
|
|
1365
|
-
label:
|
|
1626
|
+
options: se.map((o) => ({
|
|
1627
|
+
value: o,
|
|
1628
|
+
label: o
|
|
1366
1629
|
})),
|
|
1367
1630
|
value: l.type,
|
|
1368
|
-
onChange: (
|
|
1631
|
+
onChange: (o) => a(l.id, o),
|
|
1369
1632
|
style: { fontSize: 12 }
|
|
1370
1633
|
})]
|
|
1371
1634
|
}),
|
|
1372
|
-
/* @__PURE__ */
|
|
1635
|
+
/* @__PURE__ */ s("div", {
|
|
1373
1636
|
className: "flow-inspector-row",
|
|
1374
1637
|
children: [/* @__PURE__ */ e(n, {
|
|
1375
1638
|
size: "xs",
|
|
1376
1639
|
className: "flow-inspector-label",
|
|
1377
1640
|
children: "Color"
|
|
1378
|
-
}), /* @__PURE__ */ e(
|
|
1641
|
+
}), /* @__PURE__ */ e(O, {
|
|
1379
1642
|
value: l.data.strokeColor,
|
|
1380
1643
|
kind: "line",
|
|
1381
1644
|
customFallback: "#374151",
|
|
1382
|
-
onChange: (
|
|
1645
|
+
onChange: (o) => c(l.id, "strokeColor", o)
|
|
1383
1646
|
})]
|
|
1384
1647
|
}),
|
|
1385
|
-
/* @__PURE__ */
|
|
1648
|
+
/* @__PURE__ */ s("div", {
|
|
1386
1649
|
className: "flow-inspector-row",
|
|
1387
1650
|
children: [/* @__PURE__ */ e(n, {
|
|
1388
1651
|
size: "xs",
|
|
1389
1652
|
className: "flow-inspector-label",
|
|
1390
1653
|
children: "Width"
|
|
1391
|
-
}), /* @__PURE__ */ e(
|
|
1654
|
+
}), /* @__PURE__ */ e(b, {
|
|
1392
1655
|
size: "xs",
|
|
1393
1656
|
type: "number",
|
|
1394
1657
|
value: String(l.data.strokeWidth ?? 2),
|
|
1395
|
-
onChange: (
|
|
1658
|
+
onChange: (o) => c(l.id, "strokeWidth", Number(o.target.value) || 2)
|
|
1396
1659
|
})]
|
|
1397
1660
|
}),
|
|
1398
|
-
/* @__PURE__ */
|
|
1661
|
+
/* @__PURE__ */ s("div", {
|
|
1399
1662
|
className: "flow-inspector-row",
|
|
1400
1663
|
children: [/* @__PURE__ */ e(n, {
|
|
1401
1664
|
size: "xs",
|
|
1402
1665
|
className: "flow-inspector-label",
|
|
1403
1666
|
children: "Animation"
|
|
1404
|
-
}), /* @__PURE__ */ e(
|
|
1667
|
+
}), /* @__PURE__ */ e(W, {
|
|
1405
1668
|
size: "sm",
|
|
1406
1669
|
checked: l.data.animated ?? !1,
|
|
1407
|
-
onChange: (
|
|
1670
|
+
onChange: (o) => c(l.id, "animated", o),
|
|
1408
1671
|
label: "预览时播放"
|
|
1409
1672
|
})]
|
|
1410
1673
|
}),
|
|
1411
|
-
/* @__PURE__ */
|
|
1674
|
+
/* @__PURE__ */ s("div", {
|
|
1412
1675
|
className: "flow-inspector-row",
|
|
1413
1676
|
children: [/* @__PURE__ */ e(n, {
|
|
1414
1677
|
size: "xs",
|
|
1415
1678
|
className: "flow-inspector-label",
|
|
1416
1679
|
children: "Line"
|
|
1417
1680
|
}), /* @__PURE__ */ e(y, {
|
|
1418
|
-
options:
|
|
1419
|
-
value:
|
|
1420
|
-
label:
|
|
1681
|
+
options: J.map((o) => ({
|
|
1682
|
+
value: o,
|
|
1683
|
+
label: o
|
|
1421
1684
|
})),
|
|
1422
1685
|
value: l.data.lineStyle ?? "solid",
|
|
1423
|
-
onChange: (
|
|
1686
|
+
onChange: (o) => c(l.id, "lineStyle", o),
|
|
1424
1687
|
style: { fontSize: 12 }
|
|
1425
1688
|
})]
|
|
1426
1689
|
}),
|
|
1427
|
-
/* @__PURE__ */
|
|
1690
|
+
/* @__PURE__ */ s("div", {
|
|
1428
1691
|
className: "flow-inspector-row",
|
|
1429
1692
|
children: [/* @__PURE__ */ e(n, {
|
|
1430
1693
|
size: "xs",
|
|
1431
1694
|
className: "flow-inspector-label",
|
|
1432
1695
|
children: "Start"
|
|
1433
1696
|
}), /* @__PURE__ */ e(y, {
|
|
1434
|
-
options:
|
|
1435
|
-
value:
|
|
1436
|
-
label:
|
|
1697
|
+
options: Z.map((o) => ({
|
|
1698
|
+
value: o,
|
|
1699
|
+
label: o
|
|
1437
1700
|
})),
|
|
1438
1701
|
value: l.data.markerStart ?? "none",
|
|
1439
|
-
onChange: (
|
|
1702
|
+
onChange: (o) => c(l.id, "markerStart", o),
|
|
1440
1703
|
style: { fontSize: 12 }
|
|
1441
1704
|
})]
|
|
1442
1705
|
}),
|
|
1443
|
-
/* @__PURE__ */
|
|
1706
|
+
/* @__PURE__ */ s("div", {
|
|
1444
1707
|
className: "flow-inspector-row",
|
|
1445
1708
|
children: [/* @__PURE__ */ e(n, {
|
|
1446
1709
|
size: "xs",
|
|
1447
1710
|
className: "flow-inspector-label",
|
|
1448
1711
|
children: "End"
|
|
1449
1712
|
}), /* @__PURE__ */ e(y, {
|
|
1450
|
-
options:
|
|
1451
|
-
value:
|
|
1452
|
-
label:
|
|
1713
|
+
options: Z.map((o) => ({
|
|
1714
|
+
value: o,
|
|
1715
|
+
label: o
|
|
1453
1716
|
})),
|
|
1454
1717
|
value: l.data.markerEnd ?? "none",
|
|
1455
|
-
onChange: (
|
|
1718
|
+
onChange: (o) => c(l.id, "markerEnd", o),
|
|
1456
1719
|
style: { fontSize: 12 }
|
|
1457
1720
|
})]
|
|
1458
1721
|
}),
|
|
1459
|
-
/* @__PURE__ */
|
|
1722
|
+
/* @__PURE__ */ s("div", {
|
|
1460
1723
|
className: "flow-inspector-row",
|
|
1461
1724
|
children: [/* @__PURE__ */ e(n, {
|
|
1462
1725
|
size: "xs",
|
|
1463
1726
|
className: "flow-inspector-label",
|
|
1464
1727
|
children: "Label"
|
|
1465
|
-
}), /* @__PURE__ */ e(
|
|
1728
|
+
}), /* @__PURE__ */ e(b, {
|
|
1466
1729
|
size: "xs",
|
|
1467
1730
|
value: l.data.labelText ?? "",
|
|
1468
|
-
onChange: (
|
|
1731
|
+
onChange: (o) => c(l.id, "labelText", o.target.value),
|
|
1469
1732
|
placeholder: "Edge label"
|
|
1470
1733
|
})]
|
|
1471
1734
|
})
|
|
1472
1735
|
]
|
|
1473
1736
|
});
|
|
1474
1737
|
}
|
|
1475
|
-
function
|
|
1476
|
-
return /* @__PURE__ */
|
|
1738
|
+
function Ee({ line: l, onUpdateData: c }) {
|
|
1739
|
+
return /* @__PURE__ */ s("div", {
|
|
1477
1740
|
className: "flow-inspector-section",
|
|
1478
1741
|
children: [
|
|
1479
1742
|
/* @__PURE__ */ e("div", {
|
|
1480
1743
|
className: "flow-inspector-section-title",
|
|
1481
1744
|
children: "Line"
|
|
1482
1745
|
}),
|
|
1483
|
-
/* @__PURE__ */
|
|
1746
|
+
/* @__PURE__ */ s("div", {
|
|
1484
1747
|
className: "flow-inspector-row",
|
|
1485
1748
|
children: [/* @__PURE__ */ e(n, {
|
|
1486
1749
|
size: "xs",
|
|
@@ -1494,45 +1757,45 @@ function Ne({ line: l, onUpdateData: d }) {
|
|
|
1494
1757
|
children: l.type
|
|
1495
1758
|
})]
|
|
1496
1759
|
}),
|
|
1497
|
-
/* @__PURE__ */
|
|
1760
|
+
/* @__PURE__ */ s("div", {
|
|
1498
1761
|
className: "flow-inspector-row",
|
|
1499
1762
|
children: [/* @__PURE__ */ e(n, {
|
|
1500
1763
|
size: "xs",
|
|
1501
1764
|
className: "flow-inspector-label",
|
|
1502
1765
|
children: "Color"
|
|
1503
|
-
}), /* @__PURE__ */ e(
|
|
1766
|
+
}), /* @__PURE__ */ e(O, {
|
|
1504
1767
|
value: l.strokeColor,
|
|
1505
1768
|
kind: "line",
|
|
1506
1769
|
customFallback: "#374151",
|
|
1507
|
-
onChange: (
|
|
1770
|
+
onChange: (a) => c(l.id, "strokeColor", a)
|
|
1508
1771
|
})]
|
|
1509
1772
|
}),
|
|
1510
|
-
/* @__PURE__ */
|
|
1773
|
+
/* @__PURE__ */ s("div", {
|
|
1511
1774
|
className: "flow-inspector-row",
|
|
1512
1775
|
children: [/* @__PURE__ */ e(n, {
|
|
1513
1776
|
size: "xs",
|
|
1514
1777
|
className: "flow-inspector-label",
|
|
1515
1778
|
children: "Width"
|
|
1516
|
-
}), /* @__PURE__ */ e(
|
|
1779
|
+
}), /* @__PURE__ */ e(b, {
|
|
1517
1780
|
size: "xs",
|
|
1518
1781
|
type: "number",
|
|
1519
1782
|
value: String(l.strokeWidth),
|
|
1520
|
-
onChange: (
|
|
1783
|
+
onChange: (a) => c(l.id, "strokeWidth", Number(a.target.value) || 2)
|
|
1521
1784
|
})]
|
|
1522
1785
|
}),
|
|
1523
|
-
/* @__PURE__ */
|
|
1786
|
+
/* @__PURE__ */ s("div", {
|
|
1524
1787
|
className: "flow-inspector-row",
|
|
1525
1788
|
children: [/* @__PURE__ */ e(n, {
|
|
1526
1789
|
size: "xs",
|
|
1527
1790
|
className: "flow-inspector-label",
|
|
1528
1791
|
children: "Style"
|
|
1529
1792
|
}), /* @__PURE__ */ e(y, {
|
|
1530
|
-
options:
|
|
1531
|
-
value:
|
|
1532
|
-
label:
|
|
1793
|
+
options: J.map((a) => ({
|
|
1794
|
+
value: a,
|
|
1795
|
+
label: a
|
|
1533
1796
|
})),
|
|
1534
1797
|
value: l.lineStyle,
|
|
1535
|
-
onChange: (
|
|
1798
|
+
onChange: (a) => c(l.id, "lineStyle", a),
|
|
1536
1799
|
style: { fontSize: 12 }
|
|
1537
1800
|
})]
|
|
1538
1801
|
})
|
|
@@ -1540,8 +1803,8 @@ function Ne({ line: l, onUpdateData: d }) {
|
|
|
1540
1803
|
});
|
|
1541
1804
|
}
|
|
1542
1805
|
export {
|
|
1543
|
-
|
|
1544
|
-
|
|
1806
|
+
Ce as InspectorPanelContent,
|
|
1807
|
+
Ue as default
|
|
1545
1808
|
};
|
|
1546
1809
|
|
|
1547
1810
|
//# sourceMappingURL=InspectorPanel.js.map
|