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