dishui 0.0.57 → 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.
Files changed (39) hide show
  1. package/dist/components/pro/Flow/Flow.js +496 -498
  2. package/dist/components/pro/Flow/Flow.js.map +1 -1
  3. package/dist/components/pro/Flow/FlowCanvas.js +1102 -939
  4. package/dist/components/pro/Flow/FlowCanvas.js.map +1 -1
  5. package/dist/components/pro/Flow/context/FlowUIContext.d.ts +3 -0
  6. package/dist/components/pro/Flow/context/FlowUIContext.js +67 -64
  7. package/dist/components/pro/Flow/context/FlowUIContext.js.map +1 -1
  8. package/dist/components/pro/Flow/edges/EdgeRenderer.js +1 -1
  9. package/dist/components/pro/Flow/edges/edgePaths.js +170 -159
  10. package/dist/components/pro/Flow/edges/edgePaths.js.map +1 -1
  11. package/dist/components/pro/Flow/hooks/useDeleteSelection.d.ts +8 -0
  12. package/dist/components/pro/Flow/hooks/useDeleteSelection.js +43 -0
  13. package/dist/components/pro/Flow/hooks/useDeleteSelection.js.map +1 -0
  14. package/dist/components/pro/Flow/hooks/useMindMap.js +19 -17
  15. package/dist/components/pro/Flow/hooks/useMindMap.js.map +1 -1
  16. package/dist/components/pro/Flow/lines/LineRenderer.js +1 -1
  17. package/dist/components/pro/Flow/nodes/NodeRenderer.d.ts +2 -0
  18. package/dist/components/pro/Flow/nodes/NodeRenderer.js +174 -145
  19. package/dist/components/pro/Flow/nodes/NodeRenderer.js.map +1 -1
  20. package/dist/components/pro/Flow/nodes/nodeUtils.d.ts +2 -2
  21. package/dist/components/pro/Flow/nodes/nodeUtils.js +12 -12
  22. package/dist/components/pro/Flow/nodes/nodeUtils.js.map +1 -1
  23. package/dist/components/pro/Flow/nodes/shapes.d.ts +20 -0
  24. package/dist/components/pro/Flow/nodes/shapes.js +438 -203
  25. package/dist/components/pro/Flow/nodes/shapes.js.map +1 -1
  26. package/dist/components/pro/Flow/nodes/svgIconTexture.d.ts +4 -0
  27. package/dist/components/pro/Flow/nodes/svgIconTexture.js.map +1 -1
  28. package/dist/components/pro/Flow/panels/FlowToolbar.d.ts +4 -1
  29. package/dist/components/pro/Flow/panels/FlowToolbar.js +106 -100
  30. package/dist/components/pro/Flow/panels/FlowToolbar.js.map +1 -1
  31. package/dist/components/pro/Flow/panels/InspectorPanel.js +739 -476
  32. package/dist/components/pro/Flow/panels/InspectorPanel.js.map +1 -1
  33. package/dist/components/pro/Flow/panels/toolbarIcons.d.ts +2 -0
  34. package/dist/components/pro/Flow/panels/toolbarIcons.js +30 -25
  35. package/dist/components/pro/Flow/panels/toolbarIcons.js.map +1 -1
  36. package/dist/components/pro/Flow/types.d.ts +32 -0
  37. package/dist/components/pro/Flow/types.js.map +1 -1
  38. package/dist/dishui.css +1 -1
  39. package/package.json +1 -1
@@ -1,61 +1,62 @@
1
1
  import { resolveThemeColor as u } from "../utils/themeColor.js";
2
- import { drawRoundRectBorder as E, shapeDrawers as G } from "./shapes.js";
3
- import { createNodeText as V, formatIconLabel as $, normalizeIconLabelPlacement as j, updateNodeText as q } from "./NodeText.js";
4
- import { createHandleGraphics as J, getHandlePositions as X, updateHandleGraphics as K } from "./NodeHandles.js";
5
- import { getFlipScale as Q, getRotationRad as U } from "./nodeUtils.js";
6
- import { getIconTexture as Z, subscribeIconTextureReady as tt } from "./svgIconTexture.js";
7
- import { Container as L, Graphics as B, Sprite as et, Text as F } from "pixi.js";
8
- function st(o, t, n, p, f) {
9
- const s = 6 + p / 2, e = t - 6 - p / 2, i = t / 2, r = 6 + f / 2, a = n - 6 - f / 2, h = n / 2;
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: i,
14
- y: r
14
+ x: s,
15
+ y: l
15
16
  };
16
17
  case "bottom":
17
18
  return {
18
- x: i,
19
- y: a
19
+ x: s,
20
+ y: i
20
21
  };
21
22
  case "left":
22
23
  return {
23
- x: s,
24
- y: h
24
+ x: a,
25
+ y: c
25
26
  };
26
27
  case "right":
27
28
  return {
28
29
  x: e,
29
- y: h
30
+ y: c
30
31
  };
31
32
  case "top-left":
32
33
  return {
33
- x: s,
34
- y: r
34
+ x: a,
35
+ y: l
35
36
  };
36
37
  case "top-right":
37
38
  return {
38
39
  x: e,
39
- y: r
40
+ y: l
40
41
  };
41
42
  case "bottom-left":
42
43
  return {
43
- x: s,
44
- y: a
44
+ x: a,
45
+ y: i
45
46
  };
46
47
  case "bottom-right":
47
48
  return {
48
49
  x: e,
49
- y: a
50
+ y: i
50
51
  };
51
52
  default:
52
53
  return {
53
- x: i,
54
- y: h
54
+ x: s,
55
+ y: c
55
56
  };
56
57
  }
57
58
  }
58
- var ct = class {
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 L({
69
+ this.world = o, this.nodeLayer = new Y({
69
70
  label: "nodes",
70
71
  sortableChildren: !0
71
- }), this.world.addChild(this.nodeLayer), this._unsubscribeTextureReady = tt(() => this._resync?.());
72
+ }), this.world.addChild(this.nodeLayer), this._unsubscribeTextureReady = dt(() => this._resync?.());
72
73
  }
73
74
  _resync = null;
74
- sync(o, t, n, p, f) {
75
- const l = /* @__PURE__ */ new Set();
76
- this._resync = () => this.sync(o, t, n, p, f);
77
- const s = p ?? (() => {
78
- const e = o.filter((r) => r.type === "animAnchor").sort((r, a) => (r.data.animIndex ?? 0) - (a.data.animIndex ?? 0)), i = /* @__PURE__ */ new Map();
79
- return e.forEach((r, a) => i.set(r.id, a + 1)), i;
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
- l.add(e.id);
83
- let i = this.nodes.get(e.id);
84
- i || (i = this._createNode(e), this.nodes.set(e.id, i)), this._updateNode(i, e, t.has(e.id), n === e.id, s.get(e.id), f);
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, i] of this.nodes) l.has(e) || (this.nodeLayer.removeChild(i.container), i.container.destroy({ children: !0 }), this.nodes.delete(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 L({ label: `node-${o.id}` });
96
+ const t = new Y({ label: `node-${o.id}` });
96
97
  t.eventMode = "static", t.cursor = "pointer";
97
- const n = new L({ label: "svg-transform" });
98
- t.addChild(n);
99
- const p = new B();
100
- p.label = "sub-canvas-glow", t.addChild(p);
101
- const f = new B();
102
- f.label = "shape", t.addChild(f);
103
- const l = new et();
104
- l.label = "svg-icon", l.anchor.set(0.5, 0.5), l.visible = !1, t.addChild(l);
105
- const s = V({
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(s);
113
- const e = new F({
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
- e.label = "node-subtext", e.anchor.set(0.5, 0.5), e.visible = !1, t.addChild(e);
123
- const i = new B();
124
- i.label = "node-tag-bg", i.visible = !1, t.addChild(i);
125
- const r = new F({
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
- r.label = "node-tag-text", r.anchor.set(0.5, 0.5), r.visible = !1, t.addChild(r);
134
- const a = X(o.width, o.height), h = J(t, a, !1), g = new F({
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 g.label = "anim-badge", g.anchor.set(0.5, 0.5), g.visible = !1, t.addChild(g), this.nodeLayer.addChild(t), {
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: f,
146
- svgTransform: n,
147
- icon: l,
148
- text: s,
149
- subtext: e,
150
- tagBg: i,
151
- tagText: r,
152
- animBadge: g,
153
- handles: h,
154
- handleDefs: a,
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: p
160
+ subCanvasGlow: b
157
161
  };
158
162
  }
159
- _updateNode(o, t, n, p, f, l) {
160
- const { container: s, svgTransform: e, shape: i, icon: r, text: a, subtext: h, tagBg: g, tagText: y, animBadge: v, handles: m, subCanvasGlow: T } = o, C = t.type === "shapeSvg", M = U(t.data), x = Q(t.data);
161
- s.zIndex = t.zIndex ?? 0, C ? (i.parent !== e && e.addChild(i), r.parent !== e && e.addChild(r), m.parent !== e && e.addChild(m), s.position.set(t.position.x, t.position.y), s.rotation = 0, s.scale.set(1, 1), s.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(x.sx, x.sy)) : (i.parent !== s && s.addChildAt(i, Math.min(2, s.children.length)), r.parent !== s && s.addChild(r), m.parent !== s && s.addChild(m), e.rotation = 0, e.scale.set(1, 1), s.position.set(t.position.x, t.position.y), s.rotation = M, s.scale.set(x.sx, x.sy), M !== 0 || x.sx < 0 || x.sy < 0 ? (s.pivot.set(t.width / 2, t.height / 2), s.position.set(t.position.x + t.width / 2, t.position.y + t.height / 2)) : s.pivot.set(0, 0));
162
- const O = t.type === "mediaNode", S = t.type === "animAnchor";
163
- let W = !0;
164
- if (i.clear(), i.alpha = 1, C) this._updateSvgNode(o, t, n);
165
- else if (O) {
166
- r.visible = !1;
167
- const d = t.data.fill && t.data.fill !== "transparent" ? u(t.data.fill, "#ffffff") : "#ffffff", c = t.data.borderStyle === "none", b = n ? "#3b82f6" : u(t.data.stroke, "#374151"), w = n ? Math.max(t.data.strokeWidth, 2) : t.data.strokeWidth;
168
- G.shapeRoundRect(i, {
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: d,
172
- stroke: b,
173
- strokeWidth: w,
174
- borderStyle: n && c ? "solid" : t.data.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
- } else if (S) {
178
- r.visible = !1;
179
- const d = "#8b5cf6", c = l?.presentation ?? !1;
180
- W = c ? (l?.presentationAnchorVisible ?? !1) && l?.presentationAnchorId === t.id : l?.showAnchors ?? !0, W && (i.alpha = c ? 0.48 : 0.9, G.shapeRoundRect(i, {
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: n && !c ? "#3b82f6" : d,
185
- strokeWidth: n && !c ? 2.5 : 1.5,
194
+ stroke: r && !h ? "#3b82f6" : f,
195
+ strokeWidth: r && !h ? 2.5 : 1.5,
186
196
  borderStyle: "dashed"
187
- }), i.circle(0, 0, c ? 11 : 13).fill({ color: n && !c ? "#3b82f6" : d })), v.text = String(f ?? ""), v.alpha = c ? 0.7 : 1, v.visible = W, v.position.set(0, 0);
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
- r.visible = !1;
190
- const d = G[t.type] ?? G.shapeRect, c = t.data.borderStyle === "none";
191
- d(i, {
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: n ? "#3b82f6" : u(t.data.stroke, "#374151"),
196
- strokeWidth: n ? Math.max(t.data.strokeWidth, 2) : t.data.strokeWidth,
197
- borderStyle: n && c ? "solid" : t.data.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 (S || (v.visible = !1), T.clear(), t.data.childCanvasId) {
202
- const c = t.width + 8, b = t.height + 8, w = 0.5 + 0.3 * Math.sin(this._dynamicOffset * 8e-3);
203
- T.roundRect(-4, -4, c, b, 6), T.stroke({
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: w
207
- }), T.roundRect(-6, -6, c + 4, b + 4, 8), T.stroke({
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: w * 0.4
230
+ alpha: y * 0.4
211
231
  });
212
232
  }
213
- const z = j(t.data.labelPlacement), Y = t.data.labelColor ?? (C ? "theme:base-content" : t.data.color);
214
- q(a, {
215
- label: O ? "" : C ? $(t.data.label, z) : t.data.label,
216
- color: u(Y, "#111827"),
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
- }), a.visible = !O && (!S || W);
221
- const H = !C && !O && (!S || W), P = H ? (t.data.sublabel ?? "").trim() : "", I = P.length > 0;
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
- const d = Math.min(t.width, t.height) * 0.4;
224
- a.position.set((d + t.width) / 2, (d + t.height) / 2);
225
- } else if (C) {
226
- const c = a.width / 2, b = a.height / 2;
227
- z === "top" ? a.position.set(t.width / 2, -4 - b) : z === "bottom" ? a.position.set(t.width / 2, t.height + 4 + b) : z === "left" ? a.position.set(-4 - c, t.height / 2) : z === "right" ? a.position.set(t.width + 4 + c, t.height / 2) : a.position.set(t.width / 2, t.height / 2), a.position.x += t.data.labelOffsetX ?? 0, a.position.y += t.data.labelOffsetY ?? 0;
228
- } else if (!O) {
229
- const c = Math.max(9, t.data.fontSize - 3);
230
- if (I) {
231
- const R = h.style;
232
- R.fill = u(t.data.sublabelColor ?? "#94a3b8", "#94a3b8"), R.fontSize = c, h.text = P, h.anchor.set(0.5, 0.5), h.visible = !0, h.rotation = -M, h.scale.set(x.sx, x.sy);
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
- a.anchor.set(0.5, 0.5);
235
- const b = a.height + (I ? 3 + h.height : 0), w = Math.max(a.width, I ? h.width : 0), _ = t.data.isGroup || t.type === "flowGroup" || t.type === "geometryGroup", k = st(t.data.textPlacement ?? (S || _ ? "top" : "center"), t.width, t.height, w, b), N = k.x + (t.data.labelOffsetX ?? 0), A = k.y + (t.data.labelOffsetY ?? 0);
236
- a.position.set(N, A - b / 2 + a.height / 2), I && h.position.set(N, A + b / 2 - h.height / 2);
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
- I || (h.visible = !1), C ? (a.rotation = 0, a.scale.set(1, 1)) : (a.rotation = -M, a.scale.set(x.sx, x.sy));
239
- const D = H ? (t.data.tag ?? "").trim() : "";
240
- if (D) {
241
- y.text = D, y.visible = !0;
242
- const d = 5, c = 2, b = y.width + d * 2, w = y.height + c * 2, _ = 6, k = t.data.tagPlacement ?? "top-right", N = k === "top-left" || k === "bottom-left" ? _ : t.width - b - _, A = k === "top-left" || k === "top-right" ? _ : t.height - w - _, R = u(t.data.tagColor ?? t.data.stroke, "#334155");
243
- g.clear(), g.roundRect(N, A, b, w, 3).fill({
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
- }), g.visible = !0, y.style.fill = R, y.position.set(N + b / 2, A + w / 2), y.rotation = 0, y.scale.set(1, 1);
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
- g.visible = !1, y.visible = !1;
253
- if (m.visible = (p || n) && !(S && l?.presentation), m.visible) {
254
- const d = X(t.width, t.height);
255
- o.handleDefs = d, K(m, d);
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, n) {
259
- const { shape: p, icon: f } = o, { width: l, height: s, data: e } = t, i = e.iconBox ?? !1, r = e.borderStyle ?? (i ? "solid" : "none"), a = r === "none", h = Math.min(8, l * 0.12, s * 0.12);
260
- e.fill && e.fill !== "transparent" && (i || !a) && p.roundRect(0, 0, l, s, h).fill({ color: u(e.fill, "#ffffff") }), !a && e.stroke && e.stroke !== "transparent" && e.strokeWidth > 0 && E(p, {
261
- width: l,
262
- height: s,
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: r,
295
+ borderStyle: l,
267
296
  dashOffset: this._dynamicOffset
268
- }, h), n && p.roundRect(0, 0, l, s, h).stroke({
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", y = Z(e.svgId ?? "", g);
273
- if (y) {
274
- f.texture = y, f.visible = !0;
275
- const v = i ? Math.min(l, s) * 0.18 : 2, m = Math.max(4, Math.min(l, s) - v * 2);
276
- f.width = m, f.height = m, f.position.set(l / 2, s / 2);
277
- } else f.visible = !1;
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
- ct as NodeRenderer
315
+ St as NodeRenderer
287
316
  };
288
317
 
289
318
  //# sourceMappingURL=NodeRenderer.js.map