@elixpo/lixsketch 5.6.11 → 5.6.12

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 (55) hide show
  1. package/dist/react/Arrow-YIOAH45F.js +9 -0
  2. package/dist/react/{Circle-5WL5HZA5.js → Circle-BZANVNWQ.js} +3 -3
  3. package/dist/react/{CopyPaste-V7AY56H3.js → CopyPaste-IY5TF5Z2.js} +6 -6
  4. package/dist/react/{EraserTrail-PA6IQLQN.js → EraserTrail-F3ZJNWNL.js} +2 -2
  5. package/dist/react/{Line-YONPLUYT.js → Line-7IGMPC5Q.js} +3 -3
  6. package/dist/react/{Rectangle-7KMA3SC6.js → Rectangle-G3MPA72T.js} +3 -3
  7. package/dist/react/{SceneSerializer-7O72LEZP.js → SceneSerializer-X5GJFI2E.js} +6 -6
  8. package/dist/react/{SketchEngine-VTWURP2K.js → SketchEngine-6UBUCW5L.js} +10 -10
  9. package/dist/react/{chunk-TCWCC4Z4.js → chunk-3ROBBYUS.js} +30 -12
  10. package/dist/react/chunk-3ROBBYUS.js.map +7 -0
  11. package/dist/react/{chunk-JYBJXTLM.js → chunk-6DJ2UFEY.js} +4 -3
  12. package/dist/react/chunk-6DJ2UFEY.js.map +7 -0
  13. package/dist/react/chunk-6KNC7RDT.js +59 -0
  14. package/dist/react/chunk-6KNC7RDT.js.map +7 -0
  15. package/dist/react/{chunk-5OUBTHHO.js → chunk-PK7MU63Q.js} +33 -12
  16. package/dist/react/chunk-PK7MU63Q.js.map +7 -0
  17. package/dist/react/{chunk-WCA3FGWE.js → chunk-YXJMIL6G.js} +4 -3
  18. package/dist/react/chunk-YXJMIL6G.js.map +7 -0
  19. package/dist/react/{chunk-VJDNKJBX.js → chunk-ZTSW4DOB.js} +4 -3
  20. package/dist/react/chunk-ZTSW4DOB.js.map +7 -0
  21. package/dist/react/{eraserTool-2GS2LQCS.js → eraserTool-P6WR35AE.js} +11 -5
  22. package/dist/react/eraserTool-P6WR35AE.js.map +7 -0
  23. package/dist/react/index.js +41 -8
  24. package/dist/react/index.js.map +3 -3
  25. package/dist/react/{laserTool-XVMV63AV.js → laserTool-L3MNCPTS.js} +15 -8
  26. package/dist/react/laserTool-L3MNCPTS.js.map +7 -0
  27. package/package.json +1 -1
  28. package/src/core/EraserTrail.js +36 -11
  29. package/src/core/ShapeLabelLayout.js +42 -0
  30. package/src/react/components/sidebars/ShapeSidebar.jsx +28 -4
  31. package/src/react/store/useSketchStore.js +5 -1
  32. package/src/shapes/Arrow.js +2 -1
  33. package/src/shapes/Circle.js +2 -1
  34. package/src/shapes/Line.js +2 -1
  35. package/src/shapes/Rectangle.js +32 -10
  36. package/src/tools/eraserTool.js +9 -3
  37. package/src/tools/laserTool.js +14 -8
  38. package/dist/react/Arrow-QMR77LGQ.js +0 -9
  39. package/dist/react/chunk-5OUBTHHO.js.map +0 -7
  40. package/dist/react/chunk-JYBJXTLM.js.map +0 -7
  41. package/dist/react/chunk-M7OYYJC6.js +0 -17
  42. package/dist/react/chunk-M7OYYJC6.js.map +0 -7
  43. package/dist/react/chunk-TCWCC4Z4.js.map +0 -7
  44. package/dist/react/chunk-VJDNKJBX.js.map +0 -7
  45. package/dist/react/chunk-WCA3FGWE.js.map +0 -7
  46. package/dist/react/eraserTool-2GS2LQCS.js.map +0 -7
  47. package/dist/react/laserTool-XVMV63AV.js.map +0 -7
  48. /package/dist/react/{Arrow-QMR77LGQ.js.map → Arrow-YIOAH45F.js.map} +0 -0
  49. /package/dist/react/{Circle-5WL5HZA5.js.map → Circle-BZANVNWQ.js.map} +0 -0
  50. /package/dist/react/{CopyPaste-V7AY56H3.js.map → CopyPaste-IY5TF5Z2.js.map} +0 -0
  51. /package/dist/react/{EraserTrail-PA6IQLQN.js.map → EraserTrail-F3ZJNWNL.js.map} +0 -0
  52. /package/dist/react/{Line-YONPLUYT.js.map → Line-7IGMPC5Q.js.map} +0 -0
  53. /package/dist/react/{Rectangle-7KMA3SC6.js.map → Rectangle-G3MPA72T.js.map} +0 -0
  54. /package/dist/react/{SceneSerializer-7O72LEZP.js.map → SceneSerializer-X5GJFI2E.js.map} +0 -0
  55. /package/dist/react/{SketchEngine-VTWURP2K.js.map → SketchEngine-6UBUCW5L.js.map} +0 -0
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import {
3
+ Arrow
4
+ } from "./chunk-YXJMIL6G.js";
5
+ import "./chunk-6KNC7RDT.js";
6
+ export {
7
+ Arrow
8
+ };
9
+ //# sourceMappingURL=Arrow-YIOAH45F.js.map
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  Circle
4
- } from "./chunk-VJDNKJBX.js";
4
+ } from "./chunk-ZTSW4DOB.js";
5
5
  import "./chunk-6AIFXYV6.js";
6
6
  import "./chunk-MS4TIQ6Z.js";
7
- import "./chunk-M7OYYJC6.js";
7
+ import "./chunk-6KNC7RDT.js";
8
8
  export {
9
9
  Circle
10
10
  };
11
- //# sourceMappingURL=Circle-5WL5HZA5.js.map
11
+ //# sourceMappingURL=Circle-BZANVNWQ.js.map
@@ -20,19 +20,19 @@ import {
20
20
  } from "./chunk-DNAG7ML6.js";
21
21
  import {
22
22
  Rectangle
23
- } from "./chunk-TCWCC4Z4.js";
23
+ } from "./chunk-3ROBBYUS.js";
24
24
  import {
25
25
  Circle
26
- } from "./chunk-VJDNKJBX.js";
26
+ } from "./chunk-ZTSW4DOB.js";
27
27
  import "./chunk-6AIFXYV6.js";
28
28
  import "./chunk-MS4TIQ6Z.js";
29
29
  import {
30
30
  Arrow
31
- } from "./chunk-WCA3FGWE.js";
31
+ } from "./chunk-YXJMIL6G.js";
32
32
  import {
33
33
  Line
34
- } from "./chunk-JYBJXTLM.js";
35
- import "./chunk-M7OYYJC6.js";
34
+ } from "./chunk-6DJ2UFEY.js";
35
+ import "./chunk-6KNC7RDT.js";
36
36
  import "./chunk-2U47AU6Y.js";
37
37
  import {
38
38
  beginUndoBatch,
@@ -648,4 +648,4 @@ export {
648
648
  pasteClipboard,
649
649
  serializeShape
650
650
  };
651
- //# sourceMappingURL=CopyPaste-V7AY56H3.js.map
651
+ //# sourceMappingURL=CopyPaste-IY5TF5Z2.js.map
@@ -7,7 +7,7 @@ import {
7
7
  getTargetedElements,
8
8
  setIsErasing,
9
9
  updateEraserTrail
10
- } from "./chunk-5OUBTHHO.js";
10
+ } from "./chunk-PK7MU63Q.js";
11
11
  export {
12
12
  createEraserTrail,
13
13
  fadeOutEraserTrail,
@@ -17,4 +17,4 @@ export {
17
17
  setIsErasing,
18
18
  updateEraserTrail
19
19
  };
20
- //# sourceMappingURL=EraserTrail-PA6IQLQN.js.map
20
+ //# sourceMappingURL=EraserTrail-F3ZJNWNL.js.map
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  Line
4
- } from "./chunk-JYBJXTLM.js";
5
- import "./chunk-M7OYYJC6.js";
4
+ } from "./chunk-6DJ2UFEY.js";
5
+ import "./chunk-6KNC7RDT.js";
6
6
  import "./chunk-2U47AU6Y.js";
7
7
  import "./chunk-TFCBCWL5.js";
8
8
  export {
9
9
  Line
10
10
  };
11
- //# sourceMappingURL=Line-YONPLUYT.js.map
11
+ //# sourceMappingURL=Line-7IGMPC5Q.js.map
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  Rectangle
4
- } from "./chunk-TCWCC4Z4.js";
4
+ } from "./chunk-3ROBBYUS.js";
5
5
  import "./chunk-6AIFXYV6.js";
6
6
  import "./chunk-MS4TIQ6Z.js";
7
- import "./chunk-M7OYYJC6.js";
7
+ import "./chunk-6KNC7RDT.js";
8
8
  export {
9
9
  Rectangle
10
10
  };
11
- //# sourceMappingURL=Rectangle-7KMA3SC6.js.map
11
+ //# sourceMappingURL=Rectangle-G3MPA72T.js.map
@@ -19,19 +19,19 @@ import {
19
19
  } from "./chunk-QZI4UIE5.js";
20
20
  import {
21
21
  Rectangle
22
- } from "./chunk-TCWCC4Z4.js";
22
+ } from "./chunk-3ROBBYUS.js";
23
23
  import {
24
24
  Circle
25
- } from "./chunk-VJDNKJBX.js";
25
+ } from "./chunk-ZTSW4DOB.js";
26
26
  import "./chunk-6AIFXYV6.js";
27
27
  import "./chunk-MS4TIQ6Z.js";
28
28
  import {
29
29
  Arrow
30
- } from "./chunk-WCA3FGWE.js";
30
+ } from "./chunk-YXJMIL6G.js";
31
31
  import {
32
32
  Line
33
- } from "./chunk-JYBJXTLM.js";
34
- import "./chunk-M7OYYJC6.js";
33
+ } from "./chunk-6DJ2UFEY.js";
34
+ import "./chunk-6KNC7RDT.js";
35
35
  import "./chunk-2U47AU6Y.js";
36
36
  import {
37
37
  clearUndoHistory,
@@ -867,4 +867,4 @@ export {
867
867
  uploadScene,
868
868
  validateScene
869
869
  };
870
- //# sourceMappingURL=SceneSerializer-7O72LEZP.js.map
870
+ //# sourceMappingURL=SceneSerializer-X5GJFI2E.js.map
@@ -165,10 +165,10 @@ var SketchEngine = class {
165
165
  { Frame },
166
166
  { FreehandStroke }
167
167
  ] = await Promise.all([
168
- import("./Rectangle-7KMA3SC6.js"),
169
- import("./Circle-5WL5HZA5.js"),
170
- import("./Arrow-QMR77LGQ.js"),
171
- import("./Line-YONPLUYT.js"),
168
+ import("./Rectangle-G3MPA72T.js"),
169
+ import("./Circle-BZANVNWQ.js"),
170
+ import("./Arrow-YIOAH45F.js"),
171
+ import("./Line-7IGMPC5Q.js"),
172
172
  import("./TextShape-DY77FFI2.js"),
173
173
  import("./CodeShape-TE74XP5V.js"),
174
174
  import("./ImageShape-JGLT2UGG.js"),
@@ -247,8 +247,8 @@ var SketchEngine = class {
247
247
  import("./UndoRedo-YLQJ6DXW.js"),
248
248
  import("./Selection-S4FYSZIF.js"),
249
249
  import("./ZoomPan-AEKWKUCH.js"),
250
- import("./CopyPaste-V7AY56H3.js"),
251
- import("./EraserTrail-PA6IQLQN.js"),
250
+ import("./CopyPaste-IY5TF5Z2.js"),
251
+ import("./EraserTrail-F3ZJNWNL.js"),
252
252
  import("./ResizeShapes-LKEQTITP.js"),
253
253
  import("./ResizeCode-WAMDTKSW.js")
254
254
  ]);
@@ -266,11 +266,11 @@ var SketchEngine = class {
266
266
  eventDispatcher.initEventDispatcher(this.svg);
267
267
  }
268
268
  window.__sketchInteractionReady = true;
269
- const sceneSerializer = await import("./SceneSerializer-7O72LEZP.js");
269
+ const sceneSerializer = await import("./SceneSerializer-X5GJFI2E.js");
270
270
  if (sceneSerializer.initSceneSerializer) sceneSerializer.initSceneSerializer();
271
271
  await Promise.all([
272
- import("./eraserTool-2GS2LQCS.js"),
273
- import("./laserTool-XVMV63AV.js")
272
+ import("./eraserTool-P6WR35AE.js"),
273
+ import("./laserTool-L3MNCPTS.js")
274
274
  ]);
275
275
  if (undoRedo.undo) window.undo = undoRedo.undo;
276
276
  if (undoRedo.redo) window.redo = undoRedo.redo;
@@ -441,4 +441,4 @@ export {
441
441
  SketchEngine,
442
442
  SketchEngine_default as default
443
443
  };
444
- //# sourceMappingURL=SketchEngine-VTWURP2K.js.map
444
+ //# sourceMappingURL=SketchEngine-6UBUCW5L.js.map
@@ -7,8 +7,10 @@ import {
7
7
  registerRotationAnchor
8
8
  } from "./chunk-MS4TIQ6Z.js";
9
9
  import {
10
+ DEFAULT_SHAPE_LABEL_FONT_SIZE,
11
+ measureShapeLabel,
10
12
  resolveThemeLabelColor
11
- } from "./chunk-M7OYYJC6.js";
13
+ } from "./chunk-6KNC7RDT.js";
12
14
 
13
15
  // src/shapes/Rectangle.js
14
16
  var rc = rough.svg(svg);
@@ -50,7 +52,7 @@ var Rectangle = class {
50
52
  this.label = options.label || "";
51
53
  this.labelElement = null;
52
54
  this.labelColor = resolveThemeLabelColor(options.labelColor);
53
- this.labelFontSize = options.labelFontSize || 14;
55
+ this.labelFontSize = options.labelFontSize || DEFAULT_SHAPE_LABEL_FONT_SIZE;
54
56
  this.labelBg = options.labelBg !== false;
55
57
  this._isEditingLabel = false;
56
58
  this._hitArea = null;
@@ -73,6 +75,7 @@ var Rectangle = class {
73
75
  this.draw();
74
76
  }
75
77
  draw() {
78
+ const labelLayout = this._ensureLabelFits();
76
79
  const childrenToRemove = [];
77
80
  const preserveSet = this._skipAnchors ? new Set([...this.anchors, this.selectionOutline, this.rotationAnchor].filter(Boolean)) : null;
78
81
  for (let i = 0; i < this.group.children.length; i++) {
@@ -110,7 +113,7 @@ var Rectangle = class {
110
113
  this._hitArea.setAttribute("width", this.width);
111
114
  this._hitArea.setAttribute("height", this.height);
112
115
  this._updateShade();
113
- this._updateLabelElement();
116
+ this._updateLabelElement(labelLayout);
114
117
  const rotateCenterX = this.width / 2;
115
118
  const rotateCenterY = this.height / 2;
116
119
  this.group.setAttribute("transform", `translate(${this.x}, ${this.y}) rotate(${this.rotation}, ${rotateCenterX}, ${rotateCenterY})`);
@@ -188,7 +191,15 @@ var Rectangle = class {
188
191
  this.group.appendChild(this._shadeRect);
189
192
  }
190
193
  }
191
- _updateLabelElement() {
194
+ _ensureLabelFits() {
195
+ if (!this.label) return null;
196
+ const layout = measureShapeLabel(this.label, this.labelFontSize);
197
+ if (this.isBeingDrawn || !this.labelBg) return layout;
198
+ this.width = Math.max(this.width, layout.requiredWidth);
199
+ this.height = Math.max(this.height, layout.requiredHeight);
200
+ return layout;
201
+ }
202
+ _updateLabelElement(layout = null) {
192
203
  if (!this.label) {
193
204
  if (this.labelElement && this.labelElement.parentNode === this.group) {
194
205
  this.group.removeChild(this.labelElement);
@@ -205,14 +216,22 @@ var Rectangle = class {
205
216
  this.labelElement.setAttribute("class", "shape-label");
206
217
  this.labelElement.setAttribute("pointer-events", "none");
207
218
  }
219
+ const labelLayout = layout || measureShapeLabel(this.label, this.labelFontSize);
220
+ const startY = (this.height - labelLayout.contentHeight) / 2;
221
+ while (this.labelElement.firstChild) this.labelElement.removeChild(this.labelElement.firstChild);
222
+ labelLayout.lines.forEach((line, index) => {
223
+ const tspan = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
224
+ tspan.setAttribute("x", this.width / 2);
225
+ tspan.setAttribute("y", startY + index * labelLayout.lineHeight);
226
+ tspan.setAttribute("dominant-baseline", "hanging");
227
+ tspan.textContent = line || " ";
228
+ this.labelElement.appendChild(tspan);
229
+ });
208
230
  this.labelElement.setAttribute("x", this.width / 2);
209
- this.labelElement.setAttribute("y", this.height / 2);
210
231
  this.labelElement.setAttribute("text-anchor", "middle");
211
- this.labelElement.setAttribute("dominant-baseline", "central");
212
232
  this.labelElement.setAttribute("fill", this.labelColor);
213
233
  this.labelElement.setAttribute("font-size", this.labelFontSize);
214
234
  this.labelElement.setAttribute("font-family", "lixFont, sans-serif");
215
- this.labelElement.textContent = this.label;
216
235
  if (!this.labelBg) {
217
236
  if (this._labelBg && this._labelBg.parentNode === this.group) {
218
237
  this.group.removeChild(this._labelBg);
@@ -230,9 +249,8 @@ var Rectangle = class {
230
249
  this._labelBg.setAttribute("fill", canvasBg);
231
250
  const hPadding = 6;
232
251
  const vPadding = 2;
233
- const charWidth = this.labelFontSize * 0.6;
234
- const bgW = this.label.length * charWidth + hPadding * 2;
235
- const bgH = this.labelFontSize + vPadding * 2;
252
+ const bgW = labelLayout.contentWidth + hPadding * 2;
253
+ const bgH = labelLayout.contentHeight + vPadding * 2;
236
254
  this._labelBg.setAttribute("x", this.width / 2 - bgW / 2);
237
255
  this._labelBg.setAttribute("y", this.height / 2 - bgH / 2);
238
256
  this._labelBg.setAttribute("width", bgW);
@@ -310,7 +328,7 @@ var Rectangle = class {
310
328
  sel.addRange(range);
311
329
  }, 10);
312
330
  const finishEdit = () => {
313
- const newText = input.textContent.trim().replace(/\u00A0/g, "");
331
+ const newText = input.innerText.trim().replace(/\u00A0/g, "");
314
332
  this.label = newText;
315
333
  this._isEditingLabel = false;
316
334
  if (overlay.parentNode) overlay.parentNode.removeChild(overlay);
@@ -724,4 +742,4 @@ var Rectangle = class {
724
742
  export {
725
743
  Rectangle
726
744
  };
727
- //# sourceMappingURL=chunk-TCWCC4Z4.js.map
745
+ //# sourceMappingURL=chunk-3ROBBYUS.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/shapes/Rectangle.js"],
4
+ "sourcesContent": ["/* eslint-disable */\nimport { registerRotationAnchor } from '../core/ScreenSpaceControls.js';\nimport { canvasToLocal, localToCanvas } from '../core/CanvasSpace.js';\nimport { DEFAULT_SHAPE_LABEL_FONT_SIZE, measureShapeLabel } from '../core/ShapeLabelLayout.js';\nimport { resolveThemeLabelColor } from '../utils/themeColors.js';\n// Rectangle shape class - extracted from drawSquare.js\n// Depends on globals: svg, shapes, rough, currentShape, currentZoom, rc\n\n// Create local rc from globals; tool-state vars default to false\nconst rc = rough.svg(svg);\nlet isDraggingShapeSquare = false;\nlet isResizingShapeSquare = false;\nlet isRotatingShapeSquare = false;\nlet hoveredFrame = null;\nconst SquarecolorOptions = document.querySelectorAll(\".squareStrokeSpan\");\nconst backgroundColorOptionsSquare = document.querySelectorAll(\".squareBackgroundSpan\");\nconst fillStyleOptions = document.querySelectorAll(\".squareFillStyleSpan\");\nconst squareStrokeThicknessValue = document.querySelectorAll(\".squareStrokeThickSpan\");\nconst squareOutlineStyleValue = document.querySelectorAll(\".squareOutlineStyle\");\n// Depends on globals: squareStrokecolor, squareBackgroundColor, squareFillStyleValue, squareStrokeThicknes, squareOutlineStyle\n// Depends on globals: isDraggingShapeSquare, isResizingShapeSquare, isRotatingShapeSquare\n// Depends on globals: squareSideBar, disableAllSideBars\n// Depends on DOM query: SquarecolorOptions, backgroundColorOptionsSquare, fillStyleOptions, squareStrokeThicknessValue, squareOutlineStyleValue\n\nclass Rectangle {\n constructor(x, y, width, height, options = {}) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.options = {\n roughness: 1.5,\n stroke: \"#fff\",\n strokeWidth: 2,\n fill: \"transparent\",\n fillStyle: \"none\",\n strokeDasharray: \"\",\n ...options\n };\n this.element = null;\n this.isSelected = false;\n this.rotation = 0;\n this.group = document.createElementNS('http://www.w3.org/2000/svg', 'g');\n this.anchors = [];\n this.rotationAnchor = null;\n this.selectionPadding = 8;\n this.selectionOutline = null;\n this.shapeName = 'rectangle';\n this.shapeID = `rectangle-${String(Date.now()).slice(0, 8)}-${Math.floor(Math.random() * 10000)}`;\n this.group.setAttribute('id', this.shapeID);\n\n // Embedded label support\n this.label = options.label || '';\n this.labelElement = null;\n this.labelColor = resolveThemeLabelColor(options.labelColor);\n this.labelFontSize = options.labelFontSize || DEFAULT_SHAPE_LABEL_FONT_SIZE;\n this.labelBg = options.labelBg !== false; // set labelBg:false to render plain text with no pill backdrop\n this._isEditingLabel = false;\n this._hitArea = null;\n this._labelBg = null;\n\n // Shading / gradient support for research paper style diagrams\n this.shadeColor = options.shadeColor || null;\n this.shadeOpacity = options.shadeOpacity !== undefined ? options.shadeOpacity : 0.15;\n this.shadeDirection = options.shadeDirection || 'bottom'; // 'top' | 'bottom' | 'left' | 'right'\n this._shadeRect = null;\n this._shadeGradient = null;\n\n if (!this.group.parentNode) {\n svg.appendChild(this.group);\n }\n this._lastDrawn = {\n width: null,\n height: null,\n options: null\n };\n this.isBeingDrawn = false;\n this._setupLabelDblClick();\n this.draw();\n }\n draw() {\n const labelLayout = this._ensureLabelFits();\n const childrenToRemove = [];\n const preserveSet = this._skipAnchors ? new Set([...this.anchors, this.selectionOutline, this.rotationAnchor].filter(Boolean)) : null;\n for (let i = 0; i < this.group.children.length; i++) {\n const child = this.group.children[i];\n if (child !== this.element && child !== this.labelElement && child !== this._hitArea && child !== this._labelBg && child !== this._shadeRect) {\n if (preserveSet && preserveSet.has(child)) continue;\n childrenToRemove.push(child);\n }\n }\n childrenToRemove.forEach(child => this.group.removeChild(child));\n\n const optionsString = JSON.stringify(this.options);\n const isInitialDraw = this.element === null;\n const optionsChanged = optionsString !== this._lastDrawn.options;\n const sizeChanged = this.width !== this._lastDrawn.width || this.height !== this._lastDrawn.height;\n\n // Only regenerate rough element if it's not being actively drawn OR if options changed OR initial draw\n if (isInitialDraw || optionsChanged || (!this.isBeingDrawn && sizeChanged)) {\n if (this.element && this.element.parentNode === this.group) {\n this.group.removeChild(this.element);\n }\n const roughRect = rc.rectangle(0, 0, this.width, this.height, this.options);\n this.element = roughRect;\n this.group.appendChild(roughRect);\n\n // Cache the values\n this._lastDrawn.width = this.width;\n this._lastDrawn.height = this.height;\n this._lastDrawn.options = optionsString;\n }\n\n // Hit area for dblclick detection (transparent rect that captures pointer events)\n if (!this._hitArea) {\n this._hitArea = document.createElementNS('http://www.w3.org/2000/svg', 'rect');\n this._hitArea.setAttribute('fill', 'transparent');\n this._hitArea.setAttribute('stroke', 'none');\n this._hitArea.setAttribute('style', 'pointer-events: all;');\n this.group.insertBefore(this._hitArea, this.group.firstChild);\n }\n this._hitArea.setAttribute('x', 0);\n this._hitArea.setAttribute('y', 0);\n this._hitArea.setAttribute('width', this.width);\n this._hitArea.setAttribute('height', this.height);\n\n // Shading / gradient overlay\n this._updateShade();\n\n // Update embedded label\n this._updateLabelElement(labelLayout);\n\n const rotateCenterX = this.width / 2;\n const rotateCenterY = this.height / 2;\n this.group.setAttribute('transform', `translate(${this.x}, ${this.y}) rotate(${this.rotation}, ${rotateCenterX}, ${rotateCenterY})`);\n\n if (this.isSelected) {\n if (this._skipAnchors) {\n this.updateSelectionControls();\n } else {\n this.addAnchors();\n }\n }\n if (!this.group.parentNode) {\n this.updateAttachedArrows();\n svg.appendChild(this.group);\n }\n }\n\n _updateShade() {\n if (!this.shadeColor) {\n if (this._shadeRect && this._shadeRect.parentNode === this.group) {\n this.group.removeChild(this._shadeRect);\n this._shadeRect = null;\n }\n if (this._shadeGradient && this._shadeGradient.parentNode) {\n this._shadeGradient.parentNode.removeChild(this._shadeGradient);\n this._shadeGradient = null;\n }\n return;\n }\n\n // Create or update gradient in SVG defs\n let defs = svg.querySelector('defs');\n if (!defs) {\n defs = document.createElementNS('http://www.w3.org/2000/svg', 'defs');\n svg.appendChild(defs);\n }\n\n const gradId = `shade-${this.shapeID}`;\n if (!this._shadeGradient) {\n this._shadeGradient = document.createElementNS('http://www.w3.org/2000/svg', 'linearGradient');\n this._shadeGradient.setAttribute('id', gradId);\n defs.appendChild(this._shadeGradient);\n }\n\n // Direction mapping\n const dirs = {\n top: { x1: '0%', y1: '0%', x2: '0%', y2: '100%' },\n bottom: { x1: '0%', y1: '100%', x2: '0%', y2: '0%' },\n left: { x1: '0%', y1: '0%', x2: '100%', y2: '0%' },\n right: { x1: '100%', y1: '0%', x2: '0%', y2: '0%' },\n };\n const d = dirs[this.shadeDirection] || dirs.bottom;\n this._shadeGradient.setAttribute('x1', d.x1);\n this._shadeGradient.setAttribute('y1', d.y1);\n this._shadeGradient.setAttribute('x2', d.x2);\n this._shadeGradient.setAttribute('y2', d.y2);\n\n // Rebuild stops\n while (this._shadeGradient.firstChild) this._shadeGradient.removeChild(this._shadeGradient.firstChild);\n const stop1 = document.createElementNS('http://www.w3.org/2000/svg', 'stop');\n stop1.setAttribute('offset', '0%');\n stop1.setAttribute('stop-color', this.shadeColor);\n stop1.setAttribute('stop-opacity', this.shadeOpacity);\n const stop2 = document.createElementNS('http://www.w3.org/2000/svg', 'stop');\n stop2.setAttribute('offset', '100%');\n stop2.setAttribute('stop-color', this.shadeColor);\n stop2.setAttribute('stop-opacity', '0');\n this._shadeGradient.appendChild(stop1);\n this._shadeGradient.appendChild(stop2);\n\n // Create or update shade rect\n if (!this._shadeRect) {\n this._shadeRect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');\n this._shadeRect.setAttribute('pointer-events', 'none');\n }\n this._shadeRect.setAttribute('x', 0);\n this._shadeRect.setAttribute('y', 0);\n this._shadeRect.setAttribute('width', this.width);\n this._shadeRect.setAttribute('height', this.height);\n this._shadeRect.setAttribute('fill', `url(#${gradId})`);\n this._shadeRect.setAttribute('rx', 2);\n\n // Insert after rough element\n if (this._shadeRect.parentNode === this.group) this.group.removeChild(this._shadeRect);\n if (this.element && this.element.nextSibling) {\n this.group.insertBefore(this._shadeRect, this.element.nextSibling);\n } else {\n this.group.appendChild(this._shadeRect);\n }\n }\n\n _ensureLabelFits() {\n if (!this.label) return null;\n const layout = measureShapeLabel(this.label, this.labelFontSize);\n // Dense diagram renderers opt out of the label backdrop and own their\n // geometry. Auto-fit is for interactive rectangle labels.\n if (this.isBeingDrawn || !this.labelBg) return layout;\n this.width = Math.max(this.width, layout.requiredWidth);\n this.height = Math.max(this.height, layout.requiredHeight);\n return layout;\n }\n\n _updateLabelElement(layout = null) {\n if (!this.label) {\n // Remove label element if label is empty\n if (this.labelElement && this.labelElement.parentNode === this.group) {\n this.group.removeChild(this.labelElement);\n this.labelElement = null;\n }\n if (this._labelBg && this._labelBg.parentNode === this.group) {\n this.group.removeChild(this._labelBg);\n this._labelBg = null;\n }\n return;\n }\n\n if (!this.labelElement) {\n this.labelElement = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n this.labelElement.setAttribute('class', 'shape-label');\n this.labelElement.setAttribute('pointer-events', 'none');\n }\n\n const labelLayout = layout || measureShapeLabel(this.label, this.labelFontSize);\n const startY = (this.height - labelLayout.contentHeight) / 2;\n\n while (this.labelElement.firstChild) this.labelElement.removeChild(this.labelElement.firstChild);\n labelLayout.lines.forEach((line, index) => {\n const tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');\n tspan.setAttribute('x', this.width / 2);\n tspan.setAttribute('y', startY + index * labelLayout.lineHeight);\n tspan.setAttribute('dominant-baseline', 'hanging');\n tspan.textContent = line || ' ';\n this.labelElement.appendChild(tspan);\n });\n\n // Position at center of rectangle\n this.labelElement.setAttribute('x', this.width / 2);\n this.labelElement.setAttribute('text-anchor', 'middle');\n this.labelElement.setAttribute('fill', this.labelColor);\n this.labelElement.setAttribute('font-size', this.labelFontSize);\n this.labelElement.setAttribute('font-family', 'lixFont, sans-serif');\n\n // Background padding rect behind text (like arrows have) \u2014 skippable\n // via labelBg:false for dense multi-row content (e.g. mermaid ER\n // attribute rows) where a pill backdrop looks out of place and\n // doesn't match the SVG preview.\n if (!this.labelBg) {\n if (this._labelBg && this._labelBg.parentNode === this.group) {\n this.group.removeChild(this._labelBg);\n this._labelBg = null;\n }\n if (this.labelElement.parentNode === this.group) this.group.removeChild(this.labelElement);\n this.group.appendChild(this.labelElement);\n return;\n }\n const canvasBg = window.getComputedStyle(svg).backgroundColor || '#000';\n if (!this._labelBg) {\n this._labelBg = document.createElementNS('http://www.w3.org/2000/svg', 'rect');\n this._labelBg.setAttribute('pointer-events', 'none');\n }\n this._labelBg.setAttribute('fill', canvasBg);\n const hPadding = 6;\n const vPadding = 2;\n const bgW = labelLayout.contentWidth + hPadding * 2;\n const bgH = labelLayout.contentHeight + vPadding * 2;\n this._labelBg.setAttribute('x', this.width / 2 - bgW / 2);\n this._labelBg.setAttribute('y', this.height / 2 - bgH / 2);\n this._labelBg.setAttribute('width', bgW);\n this._labelBg.setAttribute('height', bgH);\n this._labelBg.setAttribute('rx', 3);\n\n // Re-append bg then text on top\n if (this._labelBg.parentNode === this.group) this.group.removeChild(this._labelBg);\n if (this.labelElement.parentNode === this.group) this.group.removeChild(this.labelElement);\n this.group.appendChild(this._labelBg);\n this.group.appendChild(this.labelElement);\n }\n\n _setupLabelDblClick() {\n this.group.addEventListener('dblclick', (e) => {\n e.stopPropagation();\n e.preventDefault();\n this.startLabelEdit();\n });\n }\n\n startLabelEdit() {\n if (this._isEditingLabel) return;\n this._isEditingLabel = true;\n\n // Hide label element during editing\n if (this.labelElement) {\n this.labelElement.setAttribute('visibility', 'hidden');\n }\n\n // Get shape's screen position via CTM\n const ctm = this.group.getScreenCTM();\n if (!ctm) { this._isEditingLabel = false; return; }\n\n // Map the shape corners to screen coords\n const pt1 = svg.createSVGPoint();\n pt1.x = 0; pt1.y = 0;\n const screenTL = pt1.matrixTransform(ctm);\n const pt2 = svg.createSVGPoint();\n pt2.x = this.width; pt2.y = this.height;\n const screenBR = pt2.matrixTransform(ctm);\n\n const screenW = Math.abs(screenBR.x - screenTL.x);\n const screenH = Math.abs(screenBR.y - screenTL.y);\n const screenX = Math.min(screenTL.x, screenBR.x);\n const screenY = Math.min(screenTL.y, screenBR.y);\n\n // Create HTML overlay\n const overlay = document.createElement('div');\n overlay.className = 'shape-label-editor';\n overlay.style.cssText = `\n position: fixed; z-index: 10000;\n left: ${screenX}px; top: ${screenY}px;\n width: ${screenW}px; height: ${screenH}px;\n display: flex; align-items: center; justify-content: center;\n pointer-events: auto;\n `;\n\n const canvasBg = window.getComputedStyle(svg).backgroundColor || '#000';\n const input = document.createElement('div');\n input.setAttribute('contenteditable', 'true');\n input.style.cssText = `\n max-width: ${screenW - 8}px; min-width: 30px; min-height: 20px;\n background: ${canvasBg}; border: none;\n outline: none; padding: 2px 6px;\n color: ${this.labelColor}; font-size: ${Math.max(12, this.labelFontSize * (screenW / Math.max(this.width, 1)))}px;\n font-family: lixFont, sans-serif; text-align: center;\n white-space: pre-wrap; word-break: break-word;\n cursor: text;\n `;\n if (this.label) {\n input.textContent = this.label;\n } else {\n input.innerHTML = '&nbsp;';\n }\n\n overlay.appendChild(input);\n document.body.appendChild(overlay);\n\n // Focus and select all text\n setTimeout(() => {\n input.focus();\n const sel = window.getSelection();\n const range = document.createRange();\n range.selectNodeContents(input);\n sel.removeAllRanges();\n sel.addRange(range);\n }, 10);\n\n const finishEdit = () => {\n const newText = input.innerText.trim().replace(/\\u00A0/g, '');\n this.label = newText;\n this._isEditingLabel = false;\n\n if (overlay.parentNode) overlay.parentNode.removeChild(overlay);\n if (this.labelElement) this.labelElement.setAttribute('visibility', 'visible');\n this.draw();\n };\n\n input.addEventListener('blur', finishEdit);\n input.addEventListener('keydown', (e) => {\n e.stopPropagation();\n if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); input.blur(); }\n if (e.key === 'Escape') { input.textContent = this.label; input.blur(); }\n });\n input.addEventListener('pointerdown', (e) => e.stopPropagation());\n input.addEventListener('pointermove', (e) => e.stopPropagation());\n input.addEventListener('pointerup', (e) => e.stopPropagation());\n }\n\n setLabel(text, color, fontSize) {\n this.label = text || '';\n if (color) this.labelColor = color;\n if (fontSize) this.labelFontSize = fontSize;\n this.draw();\n }\n\n setDrawingState(isDrawing) {\n this.isBeingDrawn = isDrawing;\n }\n\n getRotatedCursor(direction, angle) {\n const directions = ['ns', 'nesw', 'ew', 'nwse'];\n angle = angle % 360;\n if (angle < 0) angle += 360;\n\n const baseDirectionMap = {\n '0': 'nwse', '1': 'nesw', \n '2': 'nesw', '3': 'nwse', \n '4': 'ns', '5': 'ns', \n '6': 'ew', '7': 'ew' \n };\n const baseDirection = baseDirectionMap[direction];\n let effectiveAngle = angle; \n if (baseDirection === 'nesw') {\n effectiveAngle += 45;\n } else if (baseDirection === 'ew') {\n effectiveAngle += 90;\n } else if (baseDirection === 'nwse') {\n effectiveAngle += 135;\n }\n effectiveAngle = effectiveAngle % 360;\n if (effectiveAngle < 0) effectiveAngle += 360;\n const index = Math.round(effectiveAngle / 45) % 4; \n let finalIndex;\n if (effectiveAngle >= 337.5 || effectiveAngle < 22.5) finalIndex = 0; \n else if (effectiveAngle >= 22.5 && effectiveAngle < 67.5) finalIndex = 1; \n else if (effectiveAngle >= 67.5 && effectiveAngle < 112.5) finalIndex = 2; \n else if (effectiveAngle >= 112.5 && effectiveAngle < 157.5) finalIndex = 3;\n else if (effectiveAngle >= 157.5 && effectiveAngle < 202.5) finalIndex = 0; \n else if (effectiveAngle >= 202.5 && effectiveAngle < 247.5) finalIndex = 1; \n else if (effectiveAngle >= 247.5 && effectiveAngle < 292.5) finalIndex = 2; \n else if (effectiveAngle >= 292.5 && effectiveAngle < 337.5) finalIndex = 3; \n else finalIndex = 0; \n return directions[finalIndex];\n }\n addAnchors() {\n const zoom = window.currentZoom || 1;\n const anchorSize = 10 / zoom;\n const anchorStrokeWidth = 2;\n const self = this;\n const expandedX = -this.selectionPadding; \n const expandedY = -this.selectionPadding; \n const expandedWidth = this.width + 2 * this.selectionPadding;\n const expandedHeight = this.height + 2 * this.selectionPadding;\n\n const positions = [\n { x: expandedX, y: expandedY }, \n { x: expandedX + expandedWidth, y: expandedY }, \n { x: expandedX, y: expandedY + expandedHeight }, \n { x: expandedX + expandedWidth, y: expandedY + expandedHeight }, \n { x: expandedX + expandedWidth / 2, y: expandedY }, \n { x: expandedX + expandedWidth / 2, y: expandedY + expandedHeight }, \n { x: expandedX, y: expandedHeight / 2 + expandedY }, \n { x: expandedX + expandedWidth, y: expandedHeight / 2 + expandedY } \n ];\n\n const outlinePoints = [\n [positions[0].x, positions[0].y],\n [positions[1].x, positions[1].y],\n [positions[3].x, positions[3].y],\n [positions[2].x, positions[2].y],\n [positions[0].x, positions[0].y]\n ];\n\n this.anchors.forEach(anchor => {\n if (anchor.parentNode === this.group) {\n this.group.removeChild(anchor);\n }\n });\n if (this.rotationAnchor && this.rotationAnchor.parentNode === this.group) {\n this.group.removeChild(this.rotationAnchor);\n }\n if (this.selectionOutline && this.selectionOutline.parentNode === this.group) {\n this.group.removeChild(this.selectionOutline);\n }\n\n this.anchors = [];\n const anchorDirections = {\n 0: 'nwse', \n 1: 'nesw', \n 2: 'nesw', \n 3: 'nwse', \n 4: 'ns', \n 5: 'ns', \n 6: 'ew', \n 7: 'ew' \n };\n\n positions.forEach((pos, i) => {\n const anchor = document.createElementNS('http://www.w3.org/2000/svg', 'rect');\n anchor.setAttribute('x', pos.x - anchorSize / 2);\n anchor.setAttribute('y', pos.y - anchorSize / 2);\n anchor.setAttribute('width', anchorSize);\n anchor.setAttribute('height', anchorSize);\n anchor.setAttribute('class', 'anchor');\n anchor.setAttribute('data-index', i);\n anchor.setAttribute('fill', '#121212');\n anchor.setAttribute('stroke', '#5B57D1');\n anchor.setAttribute('stroke-width', anchorStrokeWidth);\n anchor.setAttribute('vector-effect', 'non-scaling-stroke');\n anchor.setAttribute('style', 'pointer-events: all;');\n\n anchor.addEventListener('mouseover', function () {\n const index = this.getAttribute('data-index');\n const baseDirection = anchorDirections[index];\n const rotatedCursor = self.getRotatedCursor(index, self.rotation); \n svg.style.cursor = rotatedCursor + '-resize';\n });\n\n anchor.addEventListener('mouseout', function () {\n if (!isResizingShapeSquare && !isDraggingShapeSquare && !isRotatingShapeSquare) {\n svg.style.cursor = 'default';\n }\n });\n\n this.group.appendChild(anchor);\n this.anchors[i] = anchor;\n });\n const rotationAnchorPos = { x: expandedX + expandedWidth / 2, y: expandedY - 30 / zoom };\n this.rotationAnchor = document.createElementNS('http://www.w3.org/2000/svg', 'circle');\n this.rotationAnchor.setAttribute('cx', rotationAnchorPos.x);\n this.rotationAnchor.setAttribute('cy', rotationAnchorPos.y);\n this.rotationAnchor.setAttribute('r', 8 / zoom);\n this.rotationAnchor.setAttribute('class', 'rotate-anchor');\n this.rotationAnchor.setAttribute('fill', '#121212');\n this.rotationAnchor.setAttribute('stroke', '#5B57D1');\n this.rotationAnchor.setAttribute('stroke-width', anchorStrokeWidth);\n this.rotationAnchor.setAttribute('vector-effect', 'non-scaling-stroke');\n this.rotationAnchor.setAttribute('style', 'pointer-events: all;');\n this.group.appendChild(this.rotationAnchor);\n registerRotationAnchor(this.rotationAnchor, { radius: 8, edgeY: expandedY });\n\n this.rotationAnchor.addEventListener('mouseover', function () {\n if (!isResizingShapeSquare && !isDraggingShapeSquare && !isRotatingShapeSquare) {\n svg.style.cursor = 'grab';\n }\n });\n this.rotationAnchor.addEventListener('mouseout', function () {\n if (!isResizingShapeSquare && !isDraggingShapeSquare && !isRotatingShapeSquare) {\n svg.style.cursor = 'default';\n }\n });\n\n const pointsAttr = outlinePoints.map(p => p.join(',')).join(' ');\n const outline = document.createElementNS('http://www.w3.org/2000/svg', 'polyline');\n outline.setAttribute('points', pointsAttr);\n outline.setAttribute('class', 'selection-outline');\n outline.setAttribute('fill', 'none');\n outline.setAttribute('stroke', '#5B57D1');\n outline.setAttribute('stroke-width', 1.5);\n outline.setAttribute('stroke-dasharray', '4 2');\n outline.setAttribute('vector-effect', 'non-scaling-stroke');\n outline.setAttribute('style', 'pointer-events: none;');\n this.group.appendChild(outline);\n this.selectionOutline = outline;\n\n // Show relevant sidebar\n disableAllSideBars();\n squareSideBar.classList.remove(\"hidden\");\n if (window.__showSidebarForShape) window.__showSidebarForShape('rectangle');\n this.updateSidebar();\n }\n\n updateSelectionControls() {\n if (!this.selectionOutline || this.anchors.length === 0) return;\n\n const zoom = window.currentZoom || 1;\n const anchorSize = 10 / zoom;\n const expandedX = -this.selectionPadding;\n const expandedY = -this.selectionPadding;\n const expandedWidth = this.width + 2 * this.selectionPadding;\n const expandedHeight = this.height + 2 * this.selectionPadding;\n\n const positions = [\n { x: expandedX, y: expandedY },\n { x: expandedX + expandedWidth, y: expandedY },\n { x: expandedX, y: expandedY + expandedHeight },\n { x: expandedX + expandedWidth, y: expandedY + expandedHeight },\n { x: expandedX + expandedWidth / 2, y: expandedY },\n { x: expandedX + expandedWidth / 2, y: expandedY + expandedHeight },\n { x: expandedX, y: expandedHeight / 2 + expandedY },\n { x: expandedX + expandedWidth, y: expandedHeight / 2 + expandedY }\n ];\n\n // Update anchor positions\n positions.forEach((pos, i) => {\n if (this.anchors[i]) {\n this.anchors[i].setAttribute('x', pos.x - anchorSize / 2);\n this.anchors[i].setAttribute('y', pos.y - anchorSize / 2);\n }\n });\n\n // Update outline\n const outlinePoints = [\n [positions[0].x, positions[0].y],\n [positions[1].x, positions[1].y],\n [positions[3].x, positions[3].y],\n [positions[2].x, positions[2].y],\n [positions[0].x, positions[0].y]\n ];\n this.selectionOutline.setAttribute('points', outlinePoints.map(p => p.join(',')).join(' '));\n\n // Update rotation anchor\n if (this.rotationAnchor) {\n this.rotationAnchor.setAttribute('cx', expandedX + expandedWidth / 2);\n this.rotationAnchor.setAttribute('cy', expandedY - 30 / zoom);\n }\n }\n\n removeSelection() {\n // Remove selection elements (anchors, outline, rotation anchor) from the group\n this.anchors.forEach(anchor => {\n if (anchor.parentNode === this.group) {\n this.group.removeChild(anchor);\n }\n });\n if (this.rotationAnchor && this.rotationAnchor.parentNode === this.group) {\n this.group.removeChild(this.rotationAnchor);\n }\n if (this.selectionOutline && this.selectionOutline.parentNode === this.group) {\n this.group.removeChild(this.selectionOutline);\n }\n this.anchors = [];\n this.rotationAnchor = null;\n this.selectionOutline = null;\n this.isSelected = false;\n }\n\n contains(x, y) {\n if (!this.element) return false;\n // x/y are already canvas (viewBox) coordinates. getCTM() operates in\n // viewport coordinates and made hit testing drift after pan/zoom.\n const centerX = this.width / 2;\n const centerY = this.height / 2;\n const angle = -(this.rotation || 0) * Math.PI / 180;\n const translatedX = x - this.x;\n const translatedY = y - this.y;\n const dx = translatedX - centerX;\n const dy = translatedY - centerY;\n const localX = dx * Math.cos(angle) - dy * Math.sin(angle) + centerX;\n const localY = dx * Math.sin(angle) + dy * Math.cos(angle) + centerY;\n const tolerance = 5;\n return localX >= -tolerance && localX <= this.width + tolerance &&\n localY >= -tolerance && localY <= this.height + tolerance;\n }\n\n // Helper to check if a point is near an anchor\n isNearAnchor(x, y) {\n if (!this.isSelected) return null;\n const zoom = window.currentZoom || 1;\n const buffer = 10 / zoom;\n const anchorSize = 10 / zoom;\n const transform = { x: this.x, y: this.y, rotation: this.rotation, centerX: this.width / 2, centerY: this.height / 2 };\n\n // Iterate through anchors\n for (let i = 0; i < this.anchors.length; i++) {\n const anchor = this.anchors[i];\n const anchorLocalX = parseFloat(anchor.getAttribute('x')) + anchorSize / 2;\n const anchorLocalY = parseFloat(anchor.getAttribute('y')) + anchorSize / 2;\n const transformedPoint = localToCanvas({ x: anchorLocalX, y: anchorLocalY }, transform);\n const anchorLeft = transformedPoint.x - anchorSize/2 - buffer;\n const anchorRight = transformedPoint.x + anchorSize/2 + buffer;\n const anchorTop = transformedPoint.y - anchorSize/2 - buffer;\n const anchorBottom = transformedPoint.y + anchorSize/2 + buffer;\n if (x >= anchorLeft && x <= anchorRight && y >= anchorTop && y <= anchorBottom) {\n return { type: 'resize', index: i };\n }\n }\n\n // Check rotation anchor\n if (this.rotationAnchor) {\n const rotateAnchorLocalX = parseFloat(this.rotationAnchor.getAttribute('cx'));\n const rotateAnchorLocalY = parseFloat(this.rotationAnchor.getAttribute('cy'));\n const transformedPoint = localToCanvas({ x: rotateAnchorLocalX, y: rotateAnchorLocalY }, transform);\n const rotateAnchorRadius = parseFloat(this.rotationAnchor.getAttribute('r'));\n const distSq = (x - transformedPoint.x)**2 + (y - transformedPoint.y)**2;\n if (distSq <= (rotateAnchorRadius + buffer)**2) {\n return { type: 'rotate' };\n }\n }\n\n return null;\n }\n\n\nmove(dx, dy) {\n this.x += dx;\n this.y += dy;\n\n // Fast path: just update the transform \u2014 no need to rebuild RoughJS element\n const rotateCenterX = this.width / 2;\n const rotateCenterY = this.height / 2;\n this.group.setAttribute('transform', `translate(${this.x}, ${this.y}) rotate(${this.rotation}, ${rotateCenterX}, ${rotateCenterY})`);\n\n this.updateAttachedArrows();\n\n // Only update frame containment if we're actively dragging the shape itself\n // and not being moved by a parent frame\n if (isDraggingShapeSquare && !this.isBeingMovedByFrame) {\n this.updateFrameContainment();\n }\n}\n\nupdateFrameContainment() {\n // Don't update if we're being moved by a frame\n if (this.isBeingMovedByFrame) return;\n \n let targetFrame = null;\n \n // Find which frame this shape is over\n shapes.forEach(shape => {\n if (shape.shapeName === 'frame' && shape.isShapeInFrame(this)) {\n targetFrame = shape;\n }\n });\n \n // If we have a parent frame and we're being dragged, temporarily remove clipping\n if (this.parentFrame && isDraggingShapeSquare) {\n this.parentFrame.temporarilyRemoveFromFrame(this);\n }\n \n // Update frame highlighting\n if (hoveredFrame && hoveredFrame !== targetFrame) {\n hoveredFrame.removeHighlight();\n }\n \n if (targetFrame && targetFrame !== hoveredFrame) {\n targetFrame.highlightFrame();\n }\n \n hoveredFrame = targetFrame;\n}\n\n updatePosition(anchorIndex, newMouseX, newMouseY) {\n const oldW = this.width;\n const oldH = this.height;\n const transform = { x: this.x, y: this.y, rotation: this.rotation, centerX: oldW / 2, centerY: oldH / 2 };\n const localMouse = canvasToLocal({ x: newMouseX, y: newMouseY }, transform);\n\n // Determine fixed point in old local coords and compute raw new dimensions\n let fixedOldX, fixedOldY, rawW, rawH;\n switch (anchorIndex) {\n case 0: fixedOldX = oldW; fixedOldY = oldH; rawW = oldW - localMouse.x; rawH = oldH - localMouse.y; break;\n case 1: fixedOldX = 0; fixedOldY = oldH; rawW = localMouse.x; rawH = oldH - localMouse.y; break;\n case 2: fixedOldX = oldW; fixedOldY = 0; rawW = oldW - localMouse.x; rawH = localMouse.y; break;\n case 3: fixedOldX = 0; fixedOldY = 0; rawW = localMouse.x; rawH = localMouse.y; break;\n case 4: fixedOldX = 0; fixedOldY = oldH; rawW = oldW; rawH = oldH - localMouse.y; break;\n case 5: fixedOldX = 0; fixedOldY = 0; rawW = oldW; rawH = localMouse.y; break;\n case 6: fixedOldX = oldW; fixedOldY = 0; rawW = oldW - localMouse.x; rawH = oldH; break;\n case 7: fixedOldX = 0; fixedOldY = 0; rawW = localMouse.x; rawH = oldH; break;\n }\n\n // Get world position of the fixed point using current CTM\n const fixedWorld = localToCanvas({ x: fixedOldX, y: fixedOldY }, transform);\n\n // Handle negative dimensions (dragged past opposite edge)\n const newW = Math.abs(rawW);\n const newH = Math.abs(rawH);\n\n // Fixed point in new local coords (flips if dimension went negative)\n const fixedNewX = fixedOldX === 0 ? (rawW >= 0 ? 0 : newW) : (rawW >= 0 ? newW : 0);\n const fixedNewY = fixedOldY === 0 ? (rawH >= 0 ? 0 : newH) : (rawH >= 0 ? newH : 0);\n\n // Solve for new x, y so the fixed corner stays in place\n // Transform: translate(x, y) rotate(\u03B8, newW/2, newH/2)\n const rad = this.rotation * Math.PI / 180;\n const cosR = Math.cos(rad);\n const sinR = Math.sin(rad);\n const ncx = newW / 2;\n const ncy = newH / 2;\n const dx = fixedNewX - ncx;\n const dy = fixedNewY - ncy;\n const rotX = ncx + dx * cosR - dy * sinR;\n const rotY = ncy + dx * sinR + dy * cosR;\n\n this.x = fixedWorld.x - rotX;\n this.y = fixedWorld.y - rotY;\n this.width = newW;\n this.height = newH;\n\n this.updateAttachedArrows();\n }\n\n updateAttachedArrows() {\n shapes.forEach(shape => {\n if (shape && shape.shapeName === 'arrow' && typeof shape.updateAttachments === 'function') {\n \n if ((shape.attachedToStart && shape.attachedToStart.shape === this) ||\n (shape.attachedToEnd && shape.attachedToEnd.shape === this)) {\n shape.updateAttachments();\n }\n }\n });\n } \n\n rotate(angle) {\n angle = angle % 360;\n if (angle < 0) angle += 360;\n this.rotation = angle;\n }\n\n // Method to update the sidebar based on the shape's current options\n // No-op: React sidebar handles UI updates via Zustand store\n updateSidebar() {}\n}\n\nexport { Rectangle };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;AASA,IAAM,KAAK,MAAM,IAAI,GAAG;AACxB,IAAI,wBAAwB;AAC5B,IAAI,wBAAwB;AAC5B,IAAI,wBAAwB;AAC5B,IAAI,eAAe;AACnB,IAAM,qBAAqB,SAAS,iBAAiB,mBAAmB;AACxE,IAAM,+BAA+B,SAAS,iBAAiB,uBAAuB;AACtF,IAAM,mBAAmB,SAAS,iBAAiB,sBAAsB;AACzE,IAAM,6BAA6B,SAAS,iBAAiB,wBAAwB;AACrF,IAAM,0BAA0B,SAAS,iBAAiB,qBAAqB;AAM/E,IAAM,YAAN,MAAgB;AAAA,EACZ,YAAY,GAAG,GAAG,OAAO,QAAQ,UAAU,CAAC,GAAG;AAC3C,SAAK,IAAI;AACT,SAAK,IAAI;AACT,SAAK,QAAQ;AACb,SAAK,SAAS;AACd,SAAK,UAAU;AAAA,MACX,WAAW;AAAA,MACX,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,MAAM;AAAA,MACN,WAAW;AAAA,MACX,iBAAiB;AAAA,MACjB,GAAG;AAAA,IACP;AACA,SAAK,UAAU;AACf,SAAK,aAAa;AAClB,SAAK,WAAW;AAChB,SAAK,QAAQ,SAAS,gBAAgB,8BAA8B,GAAG;AACvE,SAAK,UAAU,CAAC;AAChB,SAAK,iBAAiB;AACtB,SAAK,mBAAmB;AACxB,SAAK,mBAAmB;AACxB,SAAK,YAAY;AACjB,SAAK,UAAU,aAAa,OAAO,KAAK,IAAI,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK,MAAM,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-1,7 +1,8 @@
1
1
  "use client";
2
2
  import {
3
+ DEFAULT_SHAPE_LABEL_FONT_SIZE,
3
4
  resolveThemeLabelColor
4
- } from "./chunk-M7OYYJC6.js";
5
+ } from "./chunk-6KNC7RDT.js";
5
6
  import {
6
7
  updateAttachedArrows
7
8
  } from "./chunk-2U47AU6Y.js";
@@ -35,7 +36,7 @@ var Line = class {
35
36
  this.label = options.label || "";
36
37
  this.labelElement = null;
37
38
  this.labelColor = resolveThemeLabelColor(options.labelColor);
38
- this.labelFontSize = options.labelFontSize || 12;
39
+ this.labelFontSize = options.labelFontSize || DEFAULT_SHAPE_LABEL_FONT_SIZE;
39
40
  this._isEditingLabel = false;
40
41
  this._hitArea = null;
41
42
  this._labelBg = null;
@@ -650,4 +651,4 @@ var Line = class {
650
651
  export {
651
652
  Line
652
653
  };
653
- //# sourceMappingURL=chunk-JYBJXTLM.js.map
654
+ //# sourceMappingURL=chunk-6DJ2UFEY.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/shapes/Line.js"],
4
+ "sourcesContent": ["/* eslint-disable */\n// Line shape class - extracted from lineTool.js\n// Depends on globals: svg, shapes, rough, currentShape, currentZoom\nimport { updateAttachedArrows as updateArrowsForShape } from '../tools/arrowTool.js';\nimport { DEFAULT_SHAPE_LABEL_FONT_SIZE } from '../core/ShapeLabelLayout.js';\nimport { resolveThemeLabelColor } from '../utils/themeColors.js';\n\nconst rc = rough.svg(svg);\n// Issue #38 follow-up: read the default stroke from the active theme\n// instead of pinning to a single colour. White was invisible on the new\n// light canvas, black is invisible if the user toggles dark.\nfunction getThemeStroke() {\n if (typeof document === 'undefined') return '#fff';\n return document.body && document.body.classList.contains('theme-dark') ? '#fff' : '#000000';\n}\nconst lineStrokeWidth = 2;\nlet hoveredFrameLine = null;\n\nclass Line {\n constructor(startPoint, endPoint, options = {}) {\n this.startPoint = startPoint;\n this.endPoint = endPoint;\n this.options = { ...options };\n // RoughJS otherwise chooses a fresh random stroke on every redraw.\n // A stable per-line seed keeps the hand-drawn contour visually fixed\n // while its endpoints move.\n if (!Number.isInteger(this.options.seed) || this.options.seed <= 0) {\n this.options.seed = Math.floor(Math.random() * 0x7fffffff) + 1;\n }\n this.group = document.createElementNS('http://www.w3.org/2000/svg', 'g');\n this.isSelected = false;\n this.anchors = [];\n this.selectionOutline = null;\n this.shapeName = \"line\"; \n this.shapeID = `line-${String(Date.now()).slice(0, 8)}-${Math.floor(Math.random() * 10000)}`; \n this.group.setAttribute('id', this.shapeID);\n \n // Curve properties\n this.isCurved = false;\n this.controlPoint = null;\n \n // Frame attachment properties\n this.parentFrame = null;\n\n // Embedded label support\n this.label = options.label || '';\n this.labelElement = null;\n this.labelColor = resolveThemeLabelColor(options.labelColor);\n this.labelFontSize = options.labelFontSize || DEFAULT_SHAPE_LABEL_FONT_SIZE;\n this._isEditingLabel = false;\n this._hitArea = null;\n this._labelBg = null;\n this._dragRenderFrame = null;\n\n svg.appendChild(this.group);\n this._setupLabelDblClick();\n this.draw();\n }\n\n // Add position and dimension properties for frame compatibility\n get x() {\n return Math.min(this.startPoint.x, this.endPoint.x);\n }\n \n set x(value) {\n const currentX = this.x;\n const dx = value - currentX;\n this.startPoint.x += dx;\n this.endPoint.x += dx;\n if (this.controlPoint) {\n this.controlPoint.x += dx;\n }\n }\n \n get y() {\n return Math.min(this.startPoint.y, this.endPoint.y);\n }\n \n set y(value) {\n const currentY = this.y;\n const dy = value - currentY;\n this.startPoint.y += dy;\n this.endPoint.y += dy;\n if (this.controlPoint) {\n this.controlPoint.y += dy;\n }\n }\n \n get width() {\n return Math.abs(this.endPoint.x - this.startPoint.x);\n }\n \n set width(value) {\n const centerX = (this.startPoint.x + this.endPoint.x) / 2;\n this.startPoint.x = centerX - value / 2;\n this.endPoint.x = centerX + value / 2;\n }\n \n get height() {\n return Math.abs(this.endPoint.y - this.startPoint.y);\n }\n \n set height(value) {\n const centerY = (this.startPoint.y + this.endPoint.y) / 2;\n this.startPoint.y = centerY - value / 2;\n this.endPoint.y = centerY + value / 2;\n }\n\n initializeCurveControlPoint() {\n const midX = (this.startPoint.x + this.endPoint.x) / 2;\n const midY = (this.startPoint.y + this.endPoint.y) / 2;\n \n // Calculate perpendicular offset for curve\n const dx = this.endPoint.x - this.startPoint.x;\n const dy = this.endPoint.y - this.startPoint.y;\n const length = Math.sqrt(dx * dx + dy * dy);\n \n if (length === 0) {\n this.controlPoint = { x: midX, y: midY - 20 };\n return;\n }\n \n // Perpendicular vector\n const perpX = -dy / length;\n const perpY = dx / length;\n const curveOffset = 30; // Default curve amount\n \n this.controlPoint = {\n x: midX + perpX * curveOffset,\n y: midY + perpY * curveOffset\n };\n }\n\n draw() {\n // Clear existing elements but preserve label, hit area, and anchors during active resize\n const childrenToRemove = [];\n const preserveSet = this._skipAnchors ? new Set([...this.anchors, this.selectionOutline].filter(Boolean)) : null;\n for (let i = 0; i < this.group.children.length; i++) {\n const child = this.group.children[i];\n if (child !== this.labelElement && child !== this._hitArea && child !== this._labelBg) {\n if (preserveSet && preserveSet.has(child)) continue;\n childrenToRemove.push(child);\n }\n }\n childrenToRemove.forEach(child => this.group.removeChild(child));\n\n const rc = rough.svg(svg);\n let lineElement;\n\n if (this.isCurved && this.controlPoint) {\n const pathData = `M ${this.startPoint.x} ${this.startPoint.y} Q ${this.controlPoint.x} ${this.controlPoint.y} ${this.endPoint.x} ${this.endPoint.y}`;\n lineElement = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n lineElement.setAttribute('d', pathData);\n lineElement.setAttribute('stroke', this.options.stroke || getThemeStroke());\n lineElement.setAttribute('stroke-width', this.options.strokeWidth || lineStrokeWidth);\n lineElement.setAttribute('fill', 'none');\n lineElement.setAttribute('stroke-linecap', 'round');\n if (this.options.strokeDasharray) {\n lineElement.setAttribute('stroke-dasharray', this.options.strokeDasharray);\n }\n } else if (this.isBeingDrawn || this.options.strokeDasharray) {\n // Use plain SVG for lines being drawn OR dashed/dotted lines\n // (RoughJS ignores strokeDasharray, so dashed styles must bypass it)\n lineElement = document.createElementNS('http://www.w3.org/2000/svg', 'line');\n lineElement.setAttribute('x1', this.startPoint.x);\n lineElement.setAttribute('y1', this.startPoint.y);\n lineElement.setAttribute('x2', this.endPoint.x);\n lineElement.setAttribute('y2', this.endPoint.y);\n lineElement.setAttribute('stroke', this.options.stroke || getThemeStroke());\n lineElement.setAttribute('stroke-width', this.options.strokeWidth || lineStrokeWidth);\n lineElement.setAttribute('stroke-linecap', 'round');\n if (this.options.strokeDasharray) {\n lineElement.setAttribute('stroke-dasharray', this.options.strokeDasharray);\n }\n } else {\n lineElement = rc.line(\n this.startPoint.x, this.startPoint.y,\n this.endPoint.x, this.endPoint.y,\n this.options\n );\n }\n\n this.element = lineElement;\n this.group.appendChild(lineElement);\n\n // Hit area - thicker invisible path for dblclick detection\n if (!this._hitArea) {\n this._hitArea = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n this._hitArea.setAttribute('fill', 'none');\n this._hitArea.setAttribute('stroke', 'transparent');\n this._hitArea.setAttribute('stroke-width', '20');\n this._hitArea.setAttribute('style', 'pointer-events: stroke;');\n this.group.appendChild(this._hitArea);\n }\n if (this.isCurved && this.controlPoint) {\n this._hitArea.setAttribute('d', `M ${this.startPoint.x} ${this.startPoint.y} Q ${this.controlPoint.x} ${this.controlPoint.y} ${this.endPoint.x} ${this.endPoint.y}`);\n } else {\n this._hitArea.setAttribute('d', `M ${this.startPoint.x} ${this.startPoint.y} L ${this.endPoint.x} ${this.endPoint.y}`);\n }\n\n // Update embedded label at midpoint\n this._updateLabelElement();\n\n if (this.isSelected) {\n if (this._skipAnchors) {\n this.updateSelectionControls();\n } else {\n this.addAnchors();\n }\n }\n }\n\n _getMidpoint() {\n if (this.isCurved && this.controlPoint) {\n // Quadratic bezier midpoint at t=0.5\n const t = 0.5;\n const mx = (1 - t) * (1 - t) * this.startPoint.x + 2 * (1 - t) * t * this.controlPoint.x + t * t * this.endPoint.x;\n const my = (1 - t) * (1 - t) * this.startPoint.y + 2 * (1 - t) * t * this.controlPoint.y + t * t * this.endPoint.y;\n return { x: mx, y: my };\n }\n return {\n x: (this.startPoint.x + this.endPoint.x) / 2,\n y: (this.startPoint.y + this.endPoint.y) / 2\n };\n }\n\n _updateLabelElement() {\n if (!this.label) {\n if (this.labelElement && this.labelElement.parentNode === this.group) {\n this.group.removeChild(this.labelElement);\n this.labelElement = null;\n }\n if (this._labelBg && this._labelBg.parentNode === this.group) {\n this.group.removeChild(this._labelBg);\n this._labelBg = null;\n }\n return;\n }\n\n if (!this.labelElement) {\n this.labelElement = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n this.labelElement.setAttribute('class', 'shape-label');\n this.labelElement.setAttribute('pointer-events', 'none');\n }\n\n const mid = this._getMidpoint();\n this.labelElement.setAttribute('x', mid.x);\n this.labelElement.setAttribute('y', mid.y);\n this.labelElement.setAttribute('text-anchor', 'middle');\n this.labelElement.setAttribute('dominant-baseline', 'central');\n this.labelElement.setAttribute('fill', this.labelColor);\n this.labelElement.setAttribute('font-size', this.labelFontSize);\n this.labelElement.setAttribute('font-family', 'lixFont, sans-serif');\n this.labelElement.textContent = this.label;\n\n // Background knockout rect - hides the line behind the text\n const canvasBg = window.getComputedStyle(svg).backgroundColor || '#000';\n if (!this._labelBg) {\n this._labelBg = document.createElementNS('http://www.w3.org/2000/svg', 'rect');\n this._labelBg.setAttribute('pointer-events', 'none');\n }\n this._labelBg.setAttribute('fill', canvasBg);\n const hPadding = 4;\n const vPadding = 1;\n const charWidth = this.labelFontSize * 0.6;\n const bgW = this.label.length * charWidth + hPadding * 2;\n const bgH = this.labelFontSize + vPadding * 2;\n this._labelBg.setAttribute('x', mid.x - bgW / 2);\n this._labelBg.setAttribute('y', mid.y - bgH / 2);\n this._labelBg.setAttribute('width', bgW);\n this._labelBg.setAttribute('height', bgH);\n this._labelBg.setAttribute('rx', 2);\n\n // Re-append bg then text at end so they render ON TOP of the line path\n if (this._labelBg.parentNode === this.group) this.group.removeChild(this._labelBg);\n if (this.labelElement.parentNode === this.group) this.group.removeChild(this.labelElement);\n this.group.appendChild(this._labelBg);\n this.group.appendChild(this.labelElement);\n }\n\n _setupLabelDblClick() {\n this.group.addEventListener('dblclick', (e) => {\n e.stopPropagation();\n e.preventDefault();\n this.startLabelEdit();\n });\n }\n\n startLabelEdit() {\n if (this._isEditingLabel) return;\n this._isEditingLabel = true;\n\n if (this.labelElement) {\n this.labelElement.setAttribute('visibility', 'hidden');\n }\n if (this._labelBg) {\n this._labelBg.setAttribute('visibility', 'hidden');\n }\n\n // Get midpoint in screen coords via CTM\n const mid = this._getMidpoint();\n const ctm = this.group.getScreenCTM();\n if (!ctm) { this._isEditingLabel = false; return; }\n\n const pt = svg.createSVGPoint();\n pt.x = mid.x; pt.y = mid.y;\n const screenMid = pt.matrixTransform(ctm);\n\n const editW = 160;\n const editH = 28;\n\n // Create HTML overlay centered on the midpoint\n const overlay = document.createElement('div');\n overlay.className = 'shape-label-editor';\n overlay.style.cssText = `\n position: fixed; z-index: 10000;\n left: ${screenMid.x - editW / 2}px; top: ${screenMid.y - editH / 2}px;\n width: ${editW}px; height: ${editH}px;\n display: flex; align-items: center; justify-content: center;\n pointer-events: auto;\n `;\n\n const canvasBg = window.getComputedStyle(svg).backgroundColor || '#000';\n const input = document.createElement('div');\n input.setAttribute('contenteditable', 'true');\n input.style.cssText = `\n width: 100%; height: 100%;\n background: ${canvasBg}; border: none;\n outline: none; padding: 2px 6px;\n color: ${this.labelColor}; font-size: ${this.labelFontSize}px;\n font-family: lixFont, sans-serif; text-align: center;\n display: flex; align-items: center; justify-content: center;\n white-space: pre-wrap; word-break: break-word;\n cursor: text;\n `;\n if (this.label) {\n input.textContent = this.label;\n } else {\n input.innerHTML = '&nbsp;';\n }\n\n overlay.appendChild(input);\n document.body.appendChild(overlay);\n\n setTimeout(() => {\n input.focus();\n const sel = window.getSelection();\n const range = document.createRange();\n range.selectNodeContents(input);\n sel.removeAllRanges();\n sel.addRange(range);\n }, 10);\n\n const finishEdit = () => {\n const newText = input.textContent.trim().replace(/\\u00A0/g, '');\n this.label = newText;\n this._isEditingLabel = false;\n if (overlay.parentNode) overlay.parentNode.removeChild(overlay);\n if (this.labelElement) this.labelElement.removeAttribute('visibility');\n if (this._labelBg) this._labelBg.removeAttribute('visibility');\n this.draw();\n };\n\n input.addEventListener('blur', finishEdit);\n input.addEventListener('keydown', (e) => {\n e.stopPropagation();\n if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); input.blur(); }\n if (e.key === 'Escape') { input.textContent = this.label; input.blur(); }\n });\n input.addEventListener('pointerdown', (e) => e.stopPropagation());\n input.addEventListener('pointermove', (e) => e.stopPropagation());\n input.addEventListener('pointerup', (e) => e.stopPropagation());\n }\n\n setLabel(text, color, fontSize) {\n this.label = text || '';\n if (color) this.labelColor = color;\n if (fontSize) this.labelFontSize = fontSize;\n this.draw();\n }\n\n updateSelectionControls() {\n if (this.anchors.length === 0) return;\n\n // Update start anchor\n if (this.anchors[0]) {\n this.anchors[0].setAttribute('cx', this.startPoint.x);\n this.anchors[0].setAttribute('cy', this.startPoint.y);\n }\n\n // Update end anchor\n if (this.anchors[1]) {\n this.anchors[1].setAttribute('cx', this.endPoint.x);\n this.anchors[1].setAttribute('cy', this.endPoint.y);\n }\n\n // Update middle anchor\n if (this.anchors[2]) {\n const midX = (this.startPoint.x + this.endPoint.x) / 2;\n const midY = (this.startPoint.y + this.endPoint.y) / 2;\n let anchorMidX = midX, anchorMidY = midY;\n if (this.isCurved && this.controlPoint) {\n anchorMidX = 0.25 * this.startPoint.x + 0.5 * this.controlPoint.x + 0.25 * this.endPoint.x;\n anchorMidY = 0.25 * this.startPoint.y + 0.5 * this.controlPoint.y + 0.25 * this.endPoint.y;\n }\n this.anchors[2].setAttribute('cx', anchorMidX);\n this.anchors[2].setAttribute('cy', anchorMidY);\n }\n }\n\n selectLine() {\n this.isSelected = true;\n this.addAnchors();\n}\n\ndeselectLine() {\n this.isSelected = false;\n this.removeSelection();\n}\n\n// Update the complete removeSelection method\nremoveSelection() {\n // Remove anchors\n this.anchors.forEach(anchor => {\n if (anchor && anchor.parentNode === this.group) {\n this.group.removeChild(anchor);\n }\n });\n this.anchors = [];\n this.isSelected = false; // Only set to false when actually deselecting\n}\n\n addAnchors() {\n // Only remove existing anchors if they exist, don't call full removeSelection\n this.anchors.forEach(anchor => {\n if (anchor && anchor.parentNode === this.group) {\n this.group.removeChild(anchor);\n }\n });\n this.anchors = [];\n \n const anchorSize = 10 / (currentZoom || 1);\n const anchorStrokeWidth = 2;\n \n // Start point anchor\n const startAnchor = document.createElementNS('http://www.w3.org/2000/svg', 'circle');\n startAnchor.setAttribute('cx', this.startPoint.x);\n startAnchor.setAttribute('cy', this.startPoint.y);\n startAnchor.setAttribute('r', anchorSize / 2);\n startAnchor.setAttribute('fill', '#121212');\n startAnchor.setAttribute('stroke', '#5B57D1');\n startAnchor.setAttribute('stroke-width', anchorStrokeWidth);\n startAnchor.setAttribute('vector-effect', 'non-scaling-stroke');\n startAnchor.setAttribute('class', 'anchor line-anchor');\n startAnchor.style.cursor = 'grab';\n startAnchor.style.pointerEvents = 'all';\n startAnchor.dataset.index = 0;\n this.group.appendChild(startAnchor);\n this.anchors[0] = startAnchor;\n\n // End point anchor\n const endAnchor = document.createElementNS('http://www.w3.org/2000/svg', 'circle');\n endAnchor.setAttribute('cx', this.endPoint.x);\n endAnchor.setAttribute('cy', this.endPoint.y);\n endAnchor.setAttribute('r', anchorSize / 2);\n endAnchor.setAttribute('fill', '#121212');\n endAnchor.setAttribute('stroke', '#5B57D1');\n endAnchor.setAttribute('stroke-width', anchorStrokeWidth);\n endAnchor.setAttribute('vector-effect', 'non-scaling-stroke');\n endAnchor.setAttribute('class', 'anchor line-anchor');\n endAnchor.style.cursor = 'grab';\n endAnchor.style.pointerEvents = 'all';\n endAnchor.dataset.index = 1;\n this.group.appendChild(endAnchor);\n this.anchors[1] = endAnchor;\n\n // Middle anchor for curving - positioned ON the bezier curve at t=0.5\n const midX = (this.startPoint.x + this.endPoint.x) / 2;\n const midY = (this.startPoint.y + this.endPoint.y) / 2;\n let anchorMidX = midX, anchorMidY = midY;\n if (this.isCurved && this.controlPoint) {\n // Bezier point at t=0.5: 0.25*P0 + 0.5*CP + 0.25*P1\n anchorMidX = 0.25 * this.startPoint.x + 0.5 * this.controlPoint.x + 0.25 * this.endPoint.x;\n anchorMidY = 0.25 * this.startPoint.y + 0.5 * this.controlPoint.y + 0.25 * this.endPoint.y;\n }\n\n const middleAnchor = document.createElementNS('http://www.w3.org/2000/svg', 'circle');\n middleAnchor.setAttribute('cx', anchorMidX);\n middleAnchor.setAttribute('cy', anchorMidY);\n middleAnchor.setAttribute('r', anchorSize / 2);\n middleAnchor.setAttribute('fill', this.isCurved ? '#5B57D1' : '#121212');\n middleAnchor.setAttribute('stroke', '#5B57D1');\n middleAnchor.setAttribute('stroke-width', anchorStrokeWidth);\n middleAnchor.setAttribute('vector-effect', 'non-scaling-stroke');\n middleAnchor.setAttribute('class', 'anchor line-middle-anchor');\n middleAnchor.style.cursor = 'grab';\n middleAnchor.style.pointerEvents = 'all';\n middleAnchor.dataset.index = 2;\n this.group.appendChild(middleAnchor);\n this.anchors[2] = middleAnchor;\n\n // Show line sidebar\n disableAllSideBars();\n lineSideBar.classList.remove(\"hidden\");\n if (window.__showSidebarForShape) window.__showSidebarForShape('line');\n this.updateSidebar();\n }\n\n isNearAnchor(x, y) {\n if (!this.isSelected) return null;\n const buffer = 15; // Increased buffer for easier selection\n const anchorSize = 10 / (currentZoom || 1);\n\n // Check anchors\n for (let i = 0; i < this.anchors.length; i++) {\n const anchor = this.anchors[i];\n if (anchor) {\n const anchorX = parseFloat(anchor.getAttribute('cx'));\n const anchorY = parseFloat(anchor.getAttribute('cy'));\n const distance = Math.sqrt(Math.pow(x - anchorX, 2) + Math.pow(y - anchorY, 2));\n if (distance <= anchorSize / 2 + buffer) {\n return { type: 'anchor', index: i };\n }\n }\n }\n \n return null;\n }\n\n updatePosition(anchorIndex, newX, newY) {\n if (anchorIndex === 0) {\n this.startPoint.x = newX;\n this.startPoint.y = newY;\n } else if (anchorIndex === 1) {\n this.endPoint.x = newX;\n this.endPoint.y = newY;\n } else if (anchorIndex === 2) {\n // Middle anchor - dragged position is ON the curve (bezier t=0.5)\n if (!this.isCurved) {\n this.isCurved = true;\n }\n // Invert bezier formula: CP = 2*M - 0.5*(P0+P1)\n this.controlPoint = {\n x: 2 * newX - 0.5 * (this.startPoint.x + this.endPoint.x),\n y: 2 * newY - 0.5 * (this.startPoint.y + this.endPoint.y)\n };\n }\n\n this.scheduleDragRender();\n }\n\n scheduleDragRender() {\n if (this._dragRenderFrame !== null) return;\n if (typeof requestAnimationFrame !== 'function') {\n this.renderDragGeometry();\n return;\n }\n this._dragRenderFrame = requestAnimationFrame(() => {\n this._dragRenderFrame = null;\n this.renderDragGeometry();\n });\n }\n\n renderDragGeometry() {\n this.updateLineElement();\n this.updateAnchorPositions();\n if (this._hitArea) {\n const path = this.isCurved && this.controlPoint\n ? `M ${this.startPoint.x} ${this.startPoint.y} Q ${this.controlPoint.x} ${this.controlPoint.y} ${this.endPoint.x} ${this.endPoint.y}`\n : `M ${this.startPoint.x} ${this.startPoint.y} L ${this.endPoint.x} ${this.endPoint.y}`;\n this._hitArea.setAttribute('d', path);\n }\n this._updateLabelElement();\n }\n\n finalizeMove() {\n if (this._dragRenderFrame !== null && typeof cancelAnimationFrame === 'function') {\n cancelAnimationFrame(this._dragRenderFrame);\n }\n this._dragRenderFrame = null;\n this.draw();\n }\n\n updateLineElement() {\n // Update just the line element without rebuilding entire structure\n if (this.element && this.element.parentNode) {\n this.element.parentNode.removeChild(this.element);\n }\n\n const rc = rough.svg(svg);\n let lineElement;\n\n if (this.isCurved && this.controlPoint) {\n const pathData = `M ${this.startPoint.x} ${this.startPoint.y} Q ${this.controlPoint.x} ${this.controlPoint.y} ${this.endPoint.x} ${this.endPoint.y}`;\n lineElement = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n lineElement.setAttribute('d', pathData);\n lineElement.setAttribute('stroke', this.options.stroke || getThemeStroke());\n lineElement.setAttribute('stroke-width', this.options.strokeWidth || lineStrokeWidth);\n lineElement.setAttribute('fill', 'none');\n lineElement.setAttribute('stroke-linecap', 'round');\n if (this.options.strokeDasharray) {\n lineElement.setAttribute('stroke-dasharray', this.options.strokeDasharray);\n }\n } else if (this.options.strokeDasharray) {\n // Dashed/dotted lines must use plain SVG (RoughJS ignores strokeDasharray)\n lineElement = document.createElementNS('http://www.w3.org/2000/svg', 'line');\n lineElement.setAttribute('x1', this.startPoint.x);\n lineElement.setAttribute('y1', this.startPoint.y);\n lineElement.setAttribute('x2', this.endPoint.x);\n lineElement.setAttribute('y2', this.endPoint.y);\n lineElement.setAttribute('stroke', this.options.stroke || getThemeStroke());\n lineElement.setAttribute('stroke-width', this.options.strokeWidth || lineStrokeWidth);\n lineElement.setAttribute('stroke-linecap', 'round');\n lineElement.setAttribute('stroke-dasharray', this.options.strokeDasharray);\n } else {\n lineElement = rc.line(\n this.startPoint.x, this.startPoint.y,\n this.endPoint.x, this.endPoint.y,\n this.options\n );\n }\n\n this.element = lineElement;\n this.group.insertBefore(lineElement, this.group.firstChild);\n }\n\n updateAnchorPositions() {\n // Update anchor positions without rebuilding them\n if (this.anchors[0]) {\n this.anchors[0].setAttribute('cx', this.startPoint.x);\n this.anchors[0].setAttribute('cy', this.startPoint.y);\n }\n if (this.anchors[1]) {\n this.anchors[1].setAttribute('cx', this.endPoint.x);\n this.anchors[1].setAttribute('cy', this.endPoint.y);\n }\n if (this.anchors[2]) {\n const midX = (this.startPoint.x + this.endPoint.x) / 2;\n const midY = (this.startPoint.y + this.endPoint.y) / 2;\n let anchorMidX = midX, anchorMidY = midY;\n if (this.isCurved && this.controlPoint) {\n // Bezier point at t=0.5: 0.25*P0 + 0.5*CP + 0.25*P1\n anchorMidX = 0.25 * this.startPoint.x + 0.5 * this.controlPoint.x + 0.25 * this.endPoint.x;\n anchorMidY = 0.25 * this.startPoint.y + 0.5 * this.controlPoint.y + 0.25 * this.endPoint.y;\n }\n this.anchors[2].setAttribute('cx', anchorMidX);\n this.anchors[2].setAttribute('cy', anchorMidY);\n this.anchors[2].setAttribute('fill', this.isCurved ? '#5B57D1' : '#121212');\n }\n }\n\n // Add move method for dragging the entire line\n move(dx, dy) {\n this.startPoint.x += dx;\n this.startPoint.y += dy;\n this.endPoint.x += dx;\n this.endPoint.y += dy;\n if (this.controlPoint) {\n this.controlPoint.x += dx;\n this.controlPoint.y += dy;\n }\n\n // Multiple pointer/snap updates in one browser frame collapse into a\n // single DOM + RoughJS update.\n this.scheduleDragRender();\n\n // Only update frame containment if not being moved by a parent frame\n if (!this.isBeingMovedByFrame) {\n this.updateFrameContainment();\n }\n\n this.updateAttachedArrows();\n }\n\n updateAttachedArrows() {\n updateArrowsForShape(this);\n }\n\n updateFrameContainment() {\n // Don't update if we're being moved by a frame\n if (this.isBeingMovedByFrame) return;\n \n let targetFrame = null;\n \n // Find which frame this shape is over\n shapes.forEach(shape => {\n if (shape.shapeName === 'frame' && shape.isShapeInFrame(this)) {\n targetFrame = shape;\n }\n });\n \n // If we have a parent frame and we're being dragged, temporarily remove clipping\n if (this.parentFrame) {\n this.parentFrame.temporarilyRemoveFromFrame(this);\n }\n \n // Update frame highlighting\n if (hoveredFrameLine && hoveredFrameLine !== targetFrame) {\n hoveredFrameLine.removeHighlight();\n }\n \n if (targetFrame && targetFrame !== hoveredFrameLine) {\n targetFrame.highlightFrame();\n }\n \n hoveredFrameLine = targetFrame;\n }\n\n contains(x, y) {\n const tolerance = 8 / (currentZoom || 1); // Slightly larger tolerance for easier selection\n \n if (this.isCurved && this.controlPoint) {\n return this.pointToQuadraticBezierDistance(x, y) <= tolerance;\n } else {\n return this.pointToLineDistance(x, y, this.startPoint.x, this.startPoint.y, this.endPoint.x, this.endPoint.y) <= tolerance;\n }\n }\n\n pointToQuadraticBezierDistance(x, y) {\n let minDistance = Infinity;\n const steps = 50; // Reduced steps for better performance\n\n for (let i = 0; i <= steps; i++) {\n const t = i / steps;\n const point = this.getQuadraticBezierPoint(t);\n const distance = Math.sqrt(Math.pow(x - point.x, 2) + Math.pow(y - point.y, 2));\n minDistance = Math.min(minDistance, distance);\n }\n\n return minDistance;\n }\n\n getQuadraticBezierPoint(t) {\n if (!this.controlPoint) return this.startPoint;\n \n const mt = 1 - t;\n return {\n x: mt * mt * this.startPoint.x + 2 * mt * t * this.controlPoint.x + t * t * this.endPoint.x,\n y: mt * mt * this.startPoint.y + 2 * mt * t * this.controlPoint.y + t * t * this.endPoint.y\n };\n }\n\n pointToLineDistance(x, y, x1, y1, x2, y2) {\n const A = x - x1;\n const B = y - y1;\n const C = x2 - x1;\n const D = y2 - y1;\n const dot = A * C + B * D;\n const lenSq = C * C + D * D;\n let param = -1;\n if (lenSq !== 0) param = dot / lenSq;\n let xx, yy;\n if (param < 0) {\n xx = x1;\n yy = y1;\n } else if (param > 1) {\n xx = x2;\n yy = y2;\n } else {\n xx = x1 + param * C;\n yy = y1 + param * D;\n }\n const dx = x - xx;\n const dy = y - yy;\n return Math.sqrt(dx * dx + dy * dy);\n }\n\n // No-op: React sidebar handles UI updates via Zustand store\n updateSidebar() {}\n}\n\nexport { Line };\n"],
5
+ "mappings": ";;;;;;;;;;AAOA,IAAM,KAAK,MAAM,IAAI,GAAG;AAIxB,SAAS,iBAAiB;AACtB,MAAI,OAAO,aAAa,YAAa,QAAO;AAC5C,SAAO,SAAS,QAAQ,SAAS,KAAK,UAAU,SAAS,YAAY,IAAI,SAAS;AACtF;AACA,IAAM,kBAAkB;AACxB,IAAI,mBAAmB;AAEvB,IAAM,OAAN,MAAW;AAAA,EACP,YAAY,YAAY,UAAU,UAAU,CAAC,GAAG;AAC5C,SAAK,aAAa;AAClB,SAAK,WAAW;AAChB,SAAK,UAAU,EAAE,GAAG,QAAQ;AAI5B,QAAI,CAAC,OAAO,UAAU,KAAK,QAAQ,IAAI,KAAK,KAAK,QAAQ,QAAQ,GAAG;AAChE,WAAK,QAA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