dishui 0.0.59 → 0.0.61
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 +1104 -957
- 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,61 +1,62 @@
|
|
|
1
1
|
import { resolveThemeColor as u } from "../utils/themeColor.js";
|
|
2
|
-
import { drawRoundRectBorder as
|
|
3
|
-
import { createNodeText as
|
|
4
|
-
import { createHandleGraphics as
|
|
5
|
-
import { getFlipScale as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { drawBorderSides as Q, drawRoundRectBorder as it, hasBorderSideOverrides as U, shapeDrawers as H } from "./shapes.js";
|
|
3
|
+
import { createNodeText as st, formatIconLabel as at, normalizeIconLabelPlacement as ot, updateNodeText as rt } from "./NodeText.js";
|
|
4
|
+
import { createHandleGraphics as lt, getHandlePositions as Z, updateHandleGraphics as ht } from "./NodeHandles.js";
|
|
5
|
+
import { getFlipScale as nt, getRotationRad as ct } from "./nodeUtils.js";
|
|
6
|
+
import { getSvgIcon as ft } from "./svgIcons.js";
|
|
7
|
+
import { getIconTexture as tt, subscribeIconTextureReady as dt } from "./svgIconTexture.js";
|
|
8
|
+
import { Container as Y, Graphics as E, Sprite as et, Text as V } from "pixi.js";
|
|
9
|
+
function pt(o, t, r, b, p) {
|
|
10
|
+
const a = 6 + b / 2, e = t - 6 - b / 2, s = t / 2, l = 6 + p / 2, i = r - 6 - p / 2, c = r / 2;
|
|
10
11
|
switch (o) {
|
|
11
12
|
case "top":
|
|
12
13
|
return {
|
|
13
|
-
x:
|
|
14
|
-
y:
|
|
14
|
+
x: s,
|
|
15
|
+
y: l
|
|
15
16
|
};
|
|
16
17
|
case "bottom":
|
|
17
18
|
return {
|
|
18
|
-
x:
|
|
19
|
-
y:
|
|
19
|
+
x: s,
|
|
20
|
+
y: i
|
|
20
21
|
};
|
|
21
22
|
case "left":
|
|
22
23
|
return {
|
|
23
|
-
x:
|
|
24
|
-
y:
|
|
24
|
+
x: a,
|
|
25
|
+
y: c
|
|
25
26
|
};
|
|
26
27
|
case "right":
|
|
27
28
|
return {
|
|
28
29
|
x: e,
|
|
29
|
-
y:
|
|
30
|
+
y: c
|
|
30
31
|
};
|
|
31
32
|
case "top-left":
|
|
32
33
|
return {
|
|
33
|
-
x:
|
|
34
|
-
y:
|
|
34
|
+
x: a,
|
|
35
|
+
y: l
|
|
35
36
|
};
|
|
36
37
|
case "top-right":
|
|
37
38
|
return {
|
|
38
39
|
x: e,
|
|
39
|
-
y:
|
|
40
|
+
y: l
|
|
40
41
|
};
|
|
41
42
|
case "bottom-left":
|
|
42
43
|
return {
|
|
43
|
-
x:
|
|
44
|
-
y:
|
|
44
|
+
x: a,
|
|
45
|
+
y: i
|
|
45
46
|
};
|
|
46
47
|
case "bottom-right":
|
|
47
48
|
return {
|
|
48
49
|
x: e,
|
|
49
|
-
y:
|
|
50
|
+
y: i
|
|
50
51
|
};
|
|
51
52
|
default:
|
|
52
53
|
return {
|
|
53
|
-
x:
|
|
54
|
-
y:
|
|
54
|
+
x: s,
|
|
55
|
+
y: c
|
|
55
56
|
};
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
|
-
var
|
|
59
|
+
var St = class {
|
|
59
60
|
world;
|
|
60
61
|
nodeLayer;
|
|
61
62
|
nodes = /* @__PURE__ */ new Map();
|
|
@@ -65,25 +66,25 @@ var ct = class {
|
|
|
65
66
|
this._dynamicOffset = (this._dynamicOffset + o * 0.06) % 1e3;
|
|
66
67
|
}
|
|
67
68
|
constructor(o) {
|
|
68
|
-
this.world = o, this.nodeLayer = new
|
|
69
|
+
this.world = o, this.nodeLayer = new Y({
|
|
69
70
|
label: "nodes",
|
|
70
71
|
sortableChildren: !0
|
|
71
|
-
}), this.world.addChild(this.nodeLayer), this._unsubscribeTextureReady =
|
|
72
|
+
}), this.world.addChild(this.nodeLayer), this._unsubscribeTextureReady = dt(() => this._resync?.());
|
|
72
73
|
}
|
|
73
74
|
_resync = null;
|
|
74
|
-
sync(o, t,
|
|
75
|
-
const
|
|
76
|
-
this._resync = () => this.sync(o, t,
|
|
77
|
-
const
|
|
78
|
-
const e = o.filter((
|
|
79
|
-
return e.forEach((
|
|
75
|
+
sync(o, t, r, b, p) {
|
|
76
|
+
const n = /* @__PURE__ */ new Set();
|
|
77
|
+
this._resync = () => this.sync(o, t, r, b, p);
|
|
78
|
+
const a = b ?? (() => {
|
|
79
|
+
const e = o.filter((l) => l.type === "animAnchor").sort((l, i) => (l.data.animIndex ?? 0) - (i.data.animIndex ?? 0)), s = /* @__PURE__ */ new Map();
|
|
80
|
+
return e.forEach((l, i) => s.set(l.id, i + 1)), s;
|
|
80
81
|
})();
|
|
81
82
|
for (const e of o) {
|
|
82
|
-
|
|
83
|
-
let
|
|
84
|
-
|
|
83
|
+
n.add(e.id);
|
|
84
|
+
let s = this.nodes.get(e.id);
|
|
85
|
+
s || (s = this._createNode(e), this.nodes.set(e.id, s)), this._updateNode(s, e, t.has(e.id), r === e.id, a.get(e.id), p);
|
|
85
86
|
}
|
|
86
|
-
for (const [e,
|
|
87
|
+
for (const [e, s] of this.nodes) n.has(e) || (this.nodeLayer.removeChild(s.container), s.container.destroy({ children: !0 }), this.nodes.delete(e));
|
|
87
88
|
}
|
|
88
89
|
getNodeContainer(o) {
|
|
89
90
|
return this.nodes.get(o);
|
|
@@ -92,25 +93,27 @@ var ct = class {
|
|
|
92
93
|
return [...this.nodes.values()];
|
|
93
94
|
}
|
|
94
95
|
_createNode(o) {
|
|
95
|
-
const t = new
|
|
96
|
+
const t = new Y({ label: `node-${o.id}` });
|
|
96
97
|
t.eventMode = "static", t.cursor = "pointer";
|
|
97
|
-
const
|
|
98
|
-
t.addChild(
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
const
|
|
98
|
+
const r = new Y({ label: "svg-transform" });
|
|
99
|
+
t.addChild(r);
|
|
100
|
+
const b = new E();
|
|
101
|
+
b.label = "sub-canvas-glow", t.addChild(b);
|
|
102
|
+
const p = new E();
|
|
103
|
+
p.label = "shape", t.addChild(p);
|
|
104
|
+
const n = new et();
|
|
105
|
+
n.label = "svg-icon", n.anchor.set(0.5, 0.5), n.visible = !1, t.addChild(n);
|
|
106
|
+
const a = st({
|
|
106
107
|
label: o.data.label,
|
|
107
108
|
color: u(o.data.labelColor ?? o.data.color, "#111827"),
|
|
108
109
|
fontSize: o.data.fontSize,
|
|
109
110
|
width: o.width,
|
|
110
111
|
height: o.height
|
|
111
112
|
});
|
|
112
|
-
t.addChild(
|
|
113
|
-
const e = new
|
|
113
|
+
t.addChild(a);
|
|
114
|
+
const e = new et();
|
|
115
|
+
e.label = "node-title-icon", e.anchor.set(0.5, 0.5), e.visible = !1, t.addChild(e);
|
|
116
|
+
const s = new V({
|
|
114
117
|
text: "",
|
|
115
118
|
style: {
|
|
116
119
|
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
@@ -119,10 +122,10 @@ var ct = class {
|
|
|
119
122
|
align: "center"
|
|
120
123
|
}
|
|
121
124
|
});
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
const
|
|
125
|
+
s.label = "node-subtext", s.anchor.set(0.5, 0.5), s.visible = !1, t.addChild(s);
|
|
126
|
+
const l = new E();
|
|
127
|
+
l.label = "node-tag-bg", l.visible = !1, t.addChild(l);
|
|
128
|
+
const i = new V({
|
|
126
129
|
text: "",
|
|
127
130
|
style: {
|
|
128
131
|
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
@@ -130,8 +133,8 @@ var ct = class {
|
|
|
130
133
|
fill: "#cbd5e1"
|
|
131
134
|
}
|
|
132
135
|
});
|
|
133
|
-
|
|
134
|
-
const
|
|
136
|
+
i.label = "node-tag-text", i.anchor.set(0.5, 0.5), i.visible = !1, t.addChild(i);
|
|
137
|
+
const c = Z(o.width, o.height), g = lt(t, c, !1), m = new V({
|
|
135
138
|
text: "",
|
|
136
139
|
style: {
|
|
137
140
|
fontFamily: "system-ui, sans-serif",
|
|
@@ -140,141 +143,167 @@ var ct = class {
|
|
|
140
143
|
fontWeight: "700"
|
|
141
144
|
}
|
|
142
145
|
});
|
|
143
|
-
return
|
|
146
|
+
return m.label = "anim-badge", m.anchor.set(0.5, 0.5), m.visible = !1, t.addChild(m), this.nodeLayer.addChild(t), {
|
|
144
147
|
container: t,
|
|
145
|
-
shape:
|
|
146
|
-
svgTransform:
|
|
147
|
-
icon:
|
|
148
|
-
text:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
148
|
+
shape: p,
|
|
149
|
+
svgTransform: r,
|
|
150
|
+
icon: n,
|
|
151
|
+
text: a,
|
|
152
|
+
titleIcon: e,
|
|
153
|
+
subtext: s,
|
|
154
|
+
tagBg: l,
|
|
155
|
+
tagText: i,
|
|
156
|
+
animBadge: m,
|
|
157
|
+
handles: g,
|
|
158
|
+
handleDefs: c,
|
|
155
159
|
nodeId: o.id,
|
|
156
|
-
subCanvasGlow:
|
|
160
|
+
subCanvasGlow: b
|
|
157
161
|
};
|
|
158
162
|
}
|
|
159
|
-
_updateNode(o, t,
|
|
160
|
-
const { container:
|
|
161
|
-
|
|
162
|
-
const
|
|
163
|
-
let
|
|
164
|
-
if (
|
|
165
|
-
else if (
|
|
166
|
-
|
|
167
|
-
const
|
|
168
|
-
|
|
163
|
+
_updateNode(o, t, r, b, p, n) {
|
|
164
|
+
const { container: a, svgTransform: e, shape: s, icon: l, text: i, titleIcon: c, subtext: g, tagBg: m, tagText: v, animBadge: C, handles: k, subCanvasGlow: z } = o, I = t.type === "shapeSvg", M = ct(t.data), w = nt(t.data);
|
|
165
|
+
a.zIndex = t.zIndex ?? 0, I ? (s.parent !== e && e.addChild(s), l.parent !== e && e.addChild(l), k.parent !== e && e.addChild(k), a.position.set(t.position.x, t.position.y), a.rotation = 0, a.scale.set(1, 1), a.pivot.set(0, 0), e.position.set(t.width / 2, t.height / 2), e.pivot.set(t.width / 2, t.height / 2), e.rotation = M, e.scale.set(w.sx, w.sy)) : (s.parent !== a && a.addChildAt(s, Math.min(2, a.children.length)), l.parent !== a && a.addChild(l), k.parent !== a && a.addChild(k), e.rotation = 0, e.scale.set(1, 1), a.position.set(t.position.x, t.position.y), a.rotation = M, a.scale.set(w.sx, w.sy), M !== 0 || w.sx < 0 || w.sy < 0 ? (a.pivot.set(t.width / 2, t.height / 2), a.position.set(t.position.x + t.width / 2, t.position.y + t.height / 2)) : a.pivot.set(0, 0));
|
|
166
|
+
const B = t.type === "mediaNode", O = t.type === "animAnchor";
|
|
167
|
+
let G = !0;
|
|
168
|
+
if (s.clear(), s.alpha = 1, I) this._updateSvgNode(o, t, r);
|
|
169
|
+
else if (B) {
|
|
170
|
+
l.visible = !1;
|
|
171
|
+
const f = 6, h = t.data.fill && t.data.fill !== "transparent" ? u(t.data.fill, "#ffffff") : "#ffffff", d = t.data.borderStyle === "none", y = U(t.data, t.type), x = r ? "#3b82f6" : u(t.data.stroke, "#374151"), S = r ? Math.max(t.data.strokeWidth, 2) : t.data.strokeWidth;
|
|
172
|
+
if (H.shapeRoundRect(s, {
|
|
169
173
|
width: t.width,
|
|
170
174
|
height: t.height,
|
|
171
|
-
fill:
|
|
172
|
-
stroke:
|
|
173
|
-
strokeWidth:
|
|
174
|
-
borderStyle:
|
|
175
|
+
fill: h,
|
|
176
|
+
stroke: y ? "transparent" : x,
|
|
177
|
+
strokeWidth: S,
|
|
178
|
+
borderStyle: r && d ? "solid" : t.data.borderStyle,
|
|
175
179
|
dashOffset: this._dynamicOffset
|
|
176
|
-
})
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
180
|
+
}), y) {
|
|
181
|
+
const T = u(t.data.stroke, "#374151");
|
|
182
|
+
r && s.roundRect(0, 0, t.width, t.height, f).stroke({
|
|
183
|
+
color: "#3b82f6",
|
|
184
|
+
width: Math.max(t.data.strokeWidth, 2)
|
|
185
|
+
}), Q(s, "mediaNode", t.width, t.height, t.data.borderSides, T, t.data.strokeWidth, d ? void 0 : t.data.borderStyle, this._dynamicOffset);
|
|
186
|
+
}
|
|
187
|
+
} else if (O) {
|
|
188
|
+
l.visible = !1;
|
|
189
|
+
const f = "#8b5cf6", h = n?.presentation ?? !1;
|
|
190
|
+
G = h ? (n?.presentationAnchorVisible ?? !1) && n?.presentationAnchorId === t.id : n?.showAnchors ?? !0, G && (s.alpha = h ? 0.48 : 0.9, H.shapeRoundRect(s, {
|
|
181
191
|
width: t.width,
|
|
182
192
|
height: t.height,
|
|
183
193
|
fill: "transparent",
|
|
184
|
-
stroke:
|
|
185
|
-
strokeWidth:
|
|
194
|
+
stroke: r && !h ? "#3b82f6" : f,
|
|
195
|
+
strokeWidth: r && !h ? 2.5 : 1.5,
|
|
186
196
|
borderStyle: "dashed"
|
|
187
|
-
}),
|
|
197
|
+
}), s.circle(0, 0, h ? 11 : 13).fill({ color: r && !h ? "#3b82f6" : f })), C.text = String(p ?? ""), C.alpha = h ? 0.7 : 1, C.visible = G, C.position.set(0, 0);
|
|
188
198
|
} else {
|
|
189
|
-
|
|
190
|
-
const
|
|
191
|
-
|
|
199
|
+
l.visible = !1;
|
|
200
|
+
const f = H[t.type] ?? H.shapeRect, h = U(t.data, t.type), d = t.data.borderStyle === "none", y = u(t.data.stroke, "#374151");
|
|
201
|
+
if (f(s, {
|
|
192
202
|
width: t.width,
|
|
193
203
|
height: t.height,
|
|
194
204
|
fill: u(t.data.fill, "#ffffff"),
|
|
195
|
-
stroke:
|
|
196
|
-
strokeWidth:
|
|
197
|
-
borderStyle:
|
|
205
|
+
stroke: h ? "transparent" : r ? "#3b82f6" : y,
|
|
206
|
+
strokeWidth: r ? Math.max(t.data.strokeWidth, 2) : t.data.strokeWidth,
|
|
207
|
+
borderStyle: r && d ? "solid" : t.data.borderStyle,
|
|
198
208
|
dashOffset: this._dynamicOffset
|
|
199
|
-
})
|
|
209
|
+
}), h) {
|
|
210
|
+
if (r) {
|
|
211
|
+
const S = t.type === "shapeRect" ? 0 : Math.min(12, t.width * 0.1, t.height * 0.1);
|
|
212
|
+
s.roundRect(0, 0, t.width, t.height, S).stroke({
|
|
213
|
+
color: "#3b82f6",
|
|
214
|
+
width: Math.max(t.data.strokeWidth, 2)
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
const x = r && d ? "solid" : t.data.borderStyle;
|
|
218
|
+
Q(s, t.type, t.width, t.height, t.data.borderSides, y, t.data.strokeWidth, x, this._dynamicOffset);
|
|
219
|
+
}
|
|
200
220
|
}
|
|
201
|
-
if (
|
|
202
|
-
const
|
|
203
|
-
|
|
221
|
+
if (O || (C.visible = !1), z.clear(), t.data.childCanvasId) {
|
|
222
|
+
const h = t.width + 8, d = t.height + 8, y = 0.5 + 0.3 * Math.sin(this._dynamicOffset * 8e-3);
|
|
223
|
+
z.roundRect(-4, -4, h, d, 6), z.stroke({
|
|
204
224
|
color: 9133302,
|
|
205
225
|
width: 2.5,
|
|
206
|
-
alpha:
|
|
207
|
-
}),
|
|
226
|
+
alpha: y
|
|
227
|
+
}), z.roundRect(-6, -6, h + 4, d + 4, 8), z.stroke({
|
|
208
228
|
color: 9133302,
|
|
209
229
|
width: 1,
|
|
210
|
-
alpha:
|
|
230
|
+
alpha: y * 0.4
|
|
211
231
|
});
|
|
212
232
|
}
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
label:
|
|
216
|
-
color: u(
|
|
233
|
+
const N = ot(t.data.labelPlacement), $ = t.data.labelColor ?? (I ? "theme:base-content" : t.data.color);
|
|
234
|
+
rt(i, {
|
|
235
|
+
label: B ? "" : I ? at(t.data.label, N) : t.data.label,
|
|
236
|
+
color: u($, "#111827"),
|
|
217
237
|
fontSize: t.data.fontSize,
|
|
218
238
|
width: t.width,
|
|
219
239
|
height: t.height
|
|
220
|
-
}),
|
|
221
|
-
const
|
|
240
|
+
}), i.visible = !B && (!O || G);
|
|
241
|
+
const P = !I && !B && (!O || G), j = P ? (t.data.sublabel ?? "").trim() : "", L = j.length > 0, D = P ? (t.data.titleIcon ?? "").trim() : "", X = 6, W = Math.max(8, t.data.titleIconSize ?? Math.round(t.data.fontSize * 1.15)), q = W / 96;
|
|
242
|
+
if (D.length > 0) {
|
|
243
|
+
const f = ft(D)?.brandColor ?? $, h = tt(D, u(t.data.titleIconColor ?? f, "#111827") || "#111827");
|
|
244
|
+
h ? (c.texture = h, c.visible = !0) : c.visible = !1;
|
|
245
|
+
} else c.visible = !1;
|
|
222
246
|
if (t.type === "shapeCorner") {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
247
|
+
c.visible = !1;
|
|
248
|
+
const f = Math.min(t.width, t.height) * 0.4;
|
|
249
|
+
i.position.set((f + t.width) / 2, (f + t.height) / 2);
|
|
250
|
+
} else if (I) {
|
|
251
|
+
const h = i.width / 2, d = i.height / 2;
|
|
252
|
+
N === "top" ? i.position.set(t.width / 2, -4 - d) : N === "bottom" ? i.position.set(t.width / 2, t.height + 4 + d) : N === "left" ? i.position.set(-4 - h, t.height / 2) : N === "right" ? i.position.set(t.width + 4 + h, t.height / 2) : i.position.set(t.width / 2, t.height / 2), i.position.x += t.data.labelOffsetX ?? 0, i.position.y += t.data.labelOffsetY ?? 0;
|
|
253
|
+
} else if (!B) {
|
|
254
|
+
const h = Math.max(9, t.data.fontSize - 3);
|
|
255
|
+
if (L) {
|
|
256
|
+
const _ = g.style;
|
|
257
|
+
_.fill = u(t.data.sublabelColor ?? "#94a3b8", "#94a3b8"), _.fontSize = h, g.text = j, g.anchor.set(0.5, 0.5), g.visible = !0, g.rotation = -M, g.scale.set(w.sx, w.sy);
|
|
233
258
|
}
|
|
234
|
-
|
|
235
|
-
const
|
|
236
|
-
|
|
259
|
+
i.anchor.set(0.5, 0.5);
|
|
260
|
+
const d = c.visible, y = i.width + (d ? W + X : 0), x = Math.max(i.height, d ? W : 0) + (L ? 3 + g.height : 0), S = Math.max(y, L ? g.width : 0), T = t.data.isGroup || t.type === "flowGroup" || t.type === "geometryGroup", A = pt(t.data.textPlacement ?? (O || T ? "top" : "center"), t.width, t.height, S, x), R = A.x + (t.data.labelOffsetX ?? 0), K = A.y + (t.data.labelOffsetY ?? 0), F = K - x / 2 + i.height / 2;
|
|
261
|
+
if (d) {
|
|
262
|
+
const _ = R - y / 2;
|
|
263
|
+
(t.data.titleIconSide ?? "left") === "right" ? (i.position.set(_ + i.width / 2, F), c.position.set(_ + i.width + X + W / 2, F)) : (c.position.set(_ + W / 2, F), i.position.set(_ + W + X + i.width / 2, F));
|
|
264
|
+
} else i.position.set(R, F);
|
|
265
|
+
L && g.position.set(R, K + x / 2 - g.height / 2);
|
|
237
266
|
}
|
|
238
|
-
|
|
239
|
-
const
|
|
240
|
-
if (
|
|
241
|
-
|
|
242
|
-
const
|
|
243
|
-
|
|
267
|
+
L || (g.visible = !1), I ? (i.rotation = 0, i.scale.set(1, 1)) : (i.rotation = -M, i.scale.set(w.sx, w.sy), c.rotation = -M, c.scale.set(q * w.sx, q * w.sy));
|
|
268
|
+
const J = P ? (t.data.tag ?? "").trim() : "";
|
|
269
|
+
if (J) {
|
|
270
|
+
v.text = J, v.visible = !0;
|
|
271
|
+
const f = 5, h = 2, d = v.width + f * 2, y = v.height + h * 2, x = 6, S = t.data.tagPlacement ?? "top-right", T = S === "top-left" || S === "bottom-left" ? x : t.width - d - x, A = S === "top-left" || S === "top-right" ? x : t.height - y - x, R = u(t.data.tagColor ?? t.data.stroke, "#334155");
|
|
272
|
+
m.clear(), m.roundRect(T, A, d, y, 3).fill({
|
|
244
273
|
color: R,
|
|
245
274
|
alpha: 0.18
|
|
246
275
|
}).stroke({
|
|
247
276
|
color: R,
|
|
248
277
|
width: 1,
|
|
249
278
|
alpha: 0.55
|
|
250
|
-
}),
|
|
279
|
+
}), m.visible = !0, v.style.fill = R, v.position.set(T + d / 2, A + y / 2), v.rotation = 0, v.scale.set(1, 1);
|
|
251
280
|
} else
|
|
252
|
-
|
|
253
|
-
if (
|
|
254
|
-
const
|
|
255
|
-
o.handleDefs =
|
|
281
|
+
m.visible = !1, v.visible = !1;
|
|
282
|
+
if (k.visible = (b || r) && !(O && n?.presentation), k.visible) {
|
|
283
|
+
const f = Z(t.width, t.height);
|
|
284
|
+
o.handleDefs = f, ht(k, f);
|
|
256
285
|
}
|
|
257
286
|
}
|
|
258
|
-
_updateSvgNode(o, t,
|
|
259
|
-
const { shape:
|
|
260
|
-
e.fill && e.fill !== "transparent" && (
|
|
261
|
-
width:
|
|
262
|
-
height:
|
|
287
|
+
_updateSvgNode(o, t, r) {
|
|
288
|
+
const { shape: b, icon: p } = o, { width: n, height: a, data: e } = t, s = e.iconBox ?? !1, l = e.borderStyle ?? (s ? "solid" : "none"), i = l === "none", c = Math.min(8, n * 0.12, a * 0.12);
|
|
289
|
+
e.fill && e.fill !== "transparent" && (s || !i) && b.roundRect(0, 0, n, a, c).fill({ color: u(e.fill, "#ffffff") }), !i && e.stroke && e.stroke !== "transparent" && e.strokeWidth > 0 && it(b, {
|
|
290
|
+
width: n,
|
|
291
|
+
height: a,
|
|
263
292
|
fill: "transparent",
|
|
264
293
|
stroke: u(e.stroke, "#374151"),
|
|
265
294
|
strokeWidth: e.strokeWidth,
|
|
266
|
-
borderStyle:
|
|
295
|
+
borderStyle: l,
|
|
267
296
|
dashOffset: this._dynamicOffset
|
|
268
|
-
},
|
|
297
|
+
}, c), r && b.roundRect(0, 0, n, a, c).stroke({
|
|
269
298
|
color: "#3b82f6",
|
|
270
299
|
width: Math.max(e.strokeWidth, 2)
|
|
271
300
|
});
|
|
272
|
-
const g = u(e.color, "#334155") || "#334155",
|
|
273
|
-
if (
|
|
274
|
-
|
|
275
|
-
const v =
|
|
276
|
-
|
|
277
|
-
} else
|
|
301
|
+
const g = u(e.color, "#334155") || "#334155", m = tt(e.svgId ?? "", g);
|
|
302
|
+
if (m) {
|
|
303
|
+
p.texture = m, p.visible = !0;
|
|
304
|
+
const v = s ? Math.min(n, a) * 0.18 : 2, C = Math.max(4, Math.min(n, a) - v * 2);
|
|
305
|
+
p.width = C, p.height = C, p.position.set(n / 2, a / 2);
|
|
306
|
+
} else p.visible = !1;
|
|
278
307
|
}
|
|
279
308
|
destroy() {
|
|
280
309
|
this._unsubscribeTextureReady(), this._resync = null;
|
|
@@ -283,7 +312,7 @@ var ct = class {
|
|
|
283
312
|
}
|
|
284
313
|
};
|
|
285
314
|
export {
|
|
286
|
-
|
|
315
|
+
St as NodeRenderer
|
|
287
316
|
};
|
|
288
317
|
|
|
289
318
|
//# sourceMappingURL=NodeRenderer.js.map
|