@elixpo/lixsketch 5.4.7 → 5.5.1

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 (218) hide show
  1. package/dist/react/AIRenderer-M4LMJ66J.js +1105 -0
  2. package/dist/react/AIRenderer-M4LMJ66J.js.map +7 -0
  3. package/dist/react/Arrow-BJDAXPMH.js +8 -0
  4. package/dist/react/Arrow-BJDAXPMH.js.map +7 -0
  5. package/dist/react/Circle-KPG7TKIX.js +8 -0
  6. package/dist/react/Circle-KPG7TKIX.js.map +7 -0
  7. package/dist/react/CodeShape-K4DIZAIV.js +8 -0
  8. package/dist/react/CodeShape-K4DIZAIV.js.map +7 -0
  9. package/dist/react/CopyPaste-4CKJRHJ3.js +569 -0
  10. package/dist/react/CopyPaste-4CKJRHJ3.js.map +7 -0
  11. package/dist/react/EraserTrail-PA6IQLQN.js +20 -0
  12. package/dist/react/EraserTrail-PA6IQLQN.js.map +7 -0
  13. package/dist/react/EventDispatcher-SRFH6LQZ.js +463 -0
  14. package/dist/react/EventDispatcher-SRFH6LQZ.js.map +7 -0
  15. package/dist/react/Frame-6UR5XPAX.js +10 -0
  16. package/dist/react/Frame-6UR5XPAX.js.map +7 -0
  17. package/dist/react/FreehandStroke-CK24NUT3.js +8 -0
  18. package/dist/react/FreehandStroke-CK24NUT3.js.map +7 -0
  19. package/dist/react/GraphEngine-QE5B2PMR.js +340 -0
  20. package/dist/react/GraphEngine-QE5B2PMR.js.map +7 -0
  21. package/dist/react/GraphMathParser-2WMTY4IE.js +10 -0
  22. package/dist/react/GraphMathParser-2WMTY4IE.js.map +7 -0
  23. package/dist/react/IconShape-KMIA6T2H.js +10 -0
  24. package/dist/react/IconShape-KMIA6T2H.js.map +7 -0
  25. package/dist/react/ImageShape-CHHGBXUQ.js +10 -0
  26. package/dist/react/ImageShape-CHHGBXUQ.js.map +7 -0
  27. package/dist/react/LayerOrder-XCHF4MSS.js +66 -0
  28. package/dist/react/LayerOrder-XCHF4MSS.js.map +7 -0
  29. package/dist/react/Line-2KOQEEGA.js +10 -0
  30. package/dist/react/Line-2KOQEEGA.js.map +7 -0
  31. package/dist/react/LixScriptParser-JYWJX375.js +1033 -0
  32. package/dist/react/LixScriptParser-JYWJX375.js.map +7 -0
  33. package/dist/react/MermaidFlowchartRenderer-4QBAZ5MB.js +412 -0
  34. package/dist/react/MermaidFlowchartRenderer-4QBAZ5MB.js.map +7 -0
  35. package/dist/react/MermaidSequenceParser-UKG2NSZY.js +8 -0
  36. package/dist/react/MermaidSequenceParser-UKG2NSZY.js.map +7 -0
  37. package/dist/react/MermaidSequenceRenderer-HPLHY5II.js +387 -0
  38. package/dist/react/MermaidSequenceRenderer-HPLHY5II.js.map +7 -0
  39. package/dist/react/Rectangle-6FE7RN6W.js +8 -0
  40. package/dist/react/Rectangle-6FE7RN6W.js.map +7 -0
  41. package/dist/react/ResizeCode-WAMDTKSW.js +2 -0
  42. package/dist/react/ResizeCode-WAMDTKSW.js.map +7 -0
  43. package/dist/react/ResizeShapes-LKEQTITP.js +250 -0
  44. package/dist/react/ResizeShapes-LKEQTITP.js.map +7 -0
  45. package/dist/react/SceneSerializer-4U4B24JM.js +739 -0
  46. package/dist/react/SceneSerializer-4U4B24JM.js.map +7 -0
  47. package/dist/react/Selection-VVUHY5YJ.js +34 -0
  48. package/dist/react/Selection-VVUHY5YJ.js.map +7 -0
  49. package/dist/react/SketchEngine-YA4RG3KX.js +413 -0
  50. package/dist/react/SketchEngine-YA4RG3KX.js.map +7 -0
  51. package/dist/react/TextShape-54ZJ66E3.js +8 -0
  52. package/dist/react/TextShape-54ZJ66E3.js.map +7 -0
  53. package/dist/react/UndoRedo-M2JZUBKN.js +30 -0
  54. package/dist/react/UndoRedo-M2JZUBKN.js.map +7 -0
  55. package/dist/react/ZoomPan-U3TXC5AJ.js +186 -0
  56. package/dist/react/ZoomPan-U3TXC5AJ.js.map +7 -0
  57. package/dist/react/arrowTool-CWEMIRXK.js +17 -0
  58. package/dist/react/arrowTool-CWEMIRXK.js.map +7 -0
  59. package/dist/react/boxicons-5JNJQPUP.woff +0 -0
  60. package/dist/react/boxicons-6NVWQSCQ.eot +0 -0
  61. package/dist/react/boxicons-AQ5N6WP7.woff2 +0 -0
  62. package/dist/react/boxicons-GDR4JU3X.ttf +0 -0
  63. package/dist/react/boxicons-NNFHLMOR.svg +1660 -0
  64. package/dist/react/chunk-2OQXI7QB.js +564 -0
  65. package/dist/react/chunk-2OQXI7QB.js.map +7 -0
  66. package/dist/react/chunk-5OUBTHHO.js +187 -0
  67. package/dist/react/chunk-5OUBTHHO.js.map +7 -0
  68. package/dist/react/chunk-6PFXZKL2.js +628 -0
  69. package/dist/react/chunk-6PFXZKL2.js.map +7 -0
  70. package/dist/react/chunk-6SFNWGGZ.js +453 -0
  71. package/dist/react/chunk-6SFNWGGZ.js.map +7 -0
  72. package/dist/react/chunk-7TZSIR6V.js +210 -0
  73. package/dist/react/chunk-7TZSIR6V.js.map +7 -0
  74. package/dist/react/chunk-AJAZC37E.js +662 -0
  75. package/dist/react/chunk-AJAZC37E.js.map +7 -0
  76. package/dist/react/chunk-BU4D2WYQ.js +1213 -0
  77. package/dist/react/chunk-BU4D2WYQ.js.map +7 -0
  78. package/dist/react/chunk-BZE4CEBG.js +747 -0
  79. package/dist/react/chunk-BZE4CEBG.js.map +7 -0
  80. package/dist/react/chunk-CB2RANCB.js +212 -0
  81. package/dist/react/chunk-CB2RANCB.js.map +7 -0
  82. package/dist/react/chunk-DNAG7ML6.js +128 -0
  83. package/dist/react/chunk-DNAG7ML6.js.map +7 -0
  84. package/dist/react/chunk-HZWLPXFN.js +198 -0
  85. package/dist/react/chunk-HZWLPXFN.js.map +7 -0
  86. package/dist/react/chunk-I6HCCIXB.js +572 -0
  87. package/dist/react/chunk-I6HCCIXB.js.map +7 -0
  88. package/dist/react/chunk-IZ5OGWGW.js +235 -0
  89. package/dist/react/chunk-IZ5OGWGW.js.map +7 -0
  90. package/dist/react/chunk-JJCJNLNN.js +1490 -0
  91. package/dist/react/chunk-JJCJNLNN.js.map +7 -0
  92. package/dist/react/chunk-JQ3IRFDP.js +222 -0
  93. package/dist/react/chunk-JQ3IRFDP.js.map +7 -0
  94. package/dist/react/chunk-L5OARZJ7.js +1134 -0
  95. package/dist/react/chunk-L5OARZJ7.js.map +7 -0
  96. package/dist/react/chunk-LHRTXNVE.js +1600 -0
  97. package/dist/react/chunk-LHRTXNVE.js.map +7 -0
  98. package/dist/react/chunk-Q2GA4MBZ.js +1653 -0
  99. package/dist/react/chunk-Q2GA4MBZ.js.map +7 -0
  100. package/dist/react/chunk-QNSE5BAY.js +519 -0
  101. package/dist/react/chunk-QNSE5BAY.js.map +7 -0
  102. package/dist/react/chunk-QXFBG7OM.js +191 -0
  103. package/dist/react/chunk-QXFBG7OM.js.map +7 -0
  104. package/dist/react/chunk-T6ZVV5ZO.js +714 -0
  105. package/dist/react/chunk-T6ZVV5ZO.js.map +7 -0
  106. package/dist/react/chunk-URB6MY46.js +974 -0
  107. package/dist/react/chunk-URB6MY46.js.map +7 -0
  108. package/dist/react/chunk-VN62KLOC.js +931 -0
  109. package/dist/react/chunk-VN62KLOC.js.map +7 -0
  110. package/dist/react/chunk-VQVEPJSA.js +158 -0
  111. package/dist/react/chunk-VQVEPJSA.js.map +7 -0
  112. package/dist/react/chunk-XISEAGBV.js +1632 -0
  113. package/dist/react/chunk-XISEAGBV.js.map +7 -0
  114. package/dist/react/chunk-YKJUBFHE.js +575 -0
  115. package/dist/react/chunk-YKJUBFHE.js.map +7 -0
  116. package/dist/react/circleTool-NUATSEI2.js +14 -0
  117. package/dist/react/circleTool-NUATSEI2.js.map +7 -0
  118. package/dist/react/codeTool-MHCB2FNB.js +38 -0
  119. package/dist/react/codeTool-MHCB2FNB.js.map +7 -0
  120. package/dist/react/eraserTool-2GS2LQCS.js +103 -0
  121. package/dist/react/eraserTool-2GS2LQCS.js.map +7 -0
  122. package/dist/react/frameTool-PWVKKXSP.js +14 -0
  123. package/dist/react/frameTool-PWVKKXSP.js.map +7 -0
  124. package/dist/react/freehandTool-SLYGASVP.js +14 -0
  125. package/dist/react/freehandTool-SLYGASVP.js.map +7 -0
  126. package/dist/react/iconTool-GPZ7O7NH.js +18 -0
  127. package/dist/react/iconTool-GPZ7O7NH.js.map +7 -0
  128. package/dist/react/imageTool-D5R4XGEU.js +15 -0
  129. package/dist/react/imageTool-D5R4XGEU.js.map +7 -0
  130. package/dist/react/index.js +5349 -0
  131. package/dist/react/index.js.map +7 -0
  132. package/dist/react/laserTool-XVMV63AV.js +239 -0
  133. package/dist/react/laserTool-XVMV63AV.js.map +7 -0
  134. package/dist/react/lineTool-WNI5EMZ5.js +14 -0
  135. package/dist/react/lineTool-WNI5EMZ5.js.map +7 -0
  136. package/dist/react/lixCode-OJMVUXXI.ttf +0 -0
  137. package/dist/react/lixDefault-JEAPAUJL.ttf +0 -0
  138. package/dist/react/lixFancy-BPXYM5CQ.ttf +0 -0
  139. package/dist/react/lixFont-CPKEUDVM.woff2 +0 -0
  140. package/dist/react/rectangleTool-U7DZ6ZTA.js +14 -0
  141. package/dist/react/rectangleTool-U7DZ6ZTA.js.map +7 -0
  142. package/dist/react/styles.css +6627 -0
  143. package/dist/react/textTool-M7S6F3VC.js +21 -0
  144. package/dist/react/textTool-M7S6F3VC.js.map +7 -0
  145. package/package.json +39 -5
  146. package/src/EngineShortcuts.js +83 -27
  147. package/src/core/AIRenderer.js +30 -18
  148. package/src/core/GraphEngine.js +64 -41
  149. package/src/core/MermaidFlowchartRenderer.js +153 -88
  150. package/src/core/MermaidSequenceRenderer.js +168 -93
  151. package/src/core/SceneSerializer.js +86 -2
  152. package/src/core/Selection.js +119 -19
  153. package/src/core/UndoRedo.js +82 -15
  154. package/src/core/ZoomPan.js +15 -5
  155. package/src/index.js +14 -1
  156. package/src/react/LixSketchCanvas.jsx +347 -0
  157. package/src/react/components/AppMenu.jsx +482 -0
  158. package/src/react/components/Footer.jsx +85 -0
  159. package/src/react/components/Toolbar.jsx +140 -0
  160. package/src/react/components/canvas/CanvasLoadingOverlay.jsx +76 -0
  161. package/src/react/components/canvas/ContextMenu.jsx +466 -0
  162. package/src/react/components/canvas/FindBar.jsx +177 -0
  163. package/src/react/components/canvas/ImageSourcePicker.jsx +133 -0
  164. package/src/react/components/canvas/MultiSelectActions.jsx +120 -0
  165. package/src/react/components/canvas/SVGCanvas.jsx +145 -0
  166. package/src/react/components/canvas/SaveStatusIndicator.jsx +29 -0
  167. package/src/react/components/modals/CanvasPropertiesModal.jsx +358 -0
  168. package/src/react/components/modals/CommandPalette.jsx +307 -0
  169. package/src/react/components/modals/ExportImageModal.jsx +287 -0
  170. package/src/react/components/modals/GraphModal.jsx +174 -0
  171. package/src/react/components/modals/HelpModal.jsx +208 -0
  172. package/src/react/components/modals/LixScriptModal.jsx +130 -0
  173. package/src/react/components/modals/ShortcutsModal.jsx +125 -0
  174. package/src/react/components/sidebars/ArrowSidebar.jsx +173 -0
  175. package/src/react/components/sidebars/CircleSidebar.jsx +134 -0
  176. package/src/react/components/sidebars/FrameSidebar.jsx +263 -0
  177. package/src/react/components/sidebars/IconSidebar.jsx +279 -0
  178. package/src/react/components/sidebars/ImageSidebar.jsx +69 -0
  179. package/src/react/components/sidebars/LineSidebar.jsx +109 -0
  180. package/src/react/components/sidebars/PaintbrushSidebar.jsx +119 -0
  181. package/src/react/components/sidebars/RectangleSidebar.jsx +165 -0
  182. package/src/react/components/sidebars/ShapeSidebar.jsx +130 -0
  183. package/src/react/components/sidebars/TextSidebar.jsx +174 -0
  184. package/src/react/hooks/inertStores.js +58 -0
  185. package/src/react/hooks/useSketchEngine.js +76 -0
  186. package/src/react/hooks/useTranslation.js +92 -0
  187. package/src/react/index.js +41 -0
  188. package/src/react/store/useSketchStore.js +234 -0
  189. package/src/react/store/useUIStore.js +196 -0
  190. package/src/react/styles/arrowSidebar.css +263 -0
  191. package/src/react/styles/canvasStroke.css +47 -0
  192. package/src/react/styles/canvasTools.css +769 -0
  193. package/src/react/styles/circleSidebar.css +206 -0
  194. package/src/react/styles/fonts/fonts.css +29 -0
  195. package/src/react/styles/fonts/lixCode.ttf +0 -0
  196. package/src/react/styles/fonts/lixDefault.ttf +0 -0
  197. package/src/react/styles/fonts/lixDocs.ttf +0 -0
  198. package/src/react/styles/fonts/lixFancy.ttf +0 -0
  199. package/src/react/styles/fonts/lixFont.woff2 +0 -0
  200. package/src/react/styles/lineSidebar.css +207 -0
  201. package/src/react/styles/paintbrushSidebar.css +247 -0
  202. package/src/react/styles/squareSidebar.css +206 -0
  203. package/src/react/styles/writeText.css +149 -0
  204. package/src/react/styles.css +175 -0
  205. package/src/react/toolsEnum.js +20 -0
  206. package/src/react/utils/toast.js +18 -0
  207. package/src/shapes/Frame.js +7 -1
  208. package/src/shapes/Line.js +11 -5
  209. package/src/tools/arrowTool.js +30 -4
  210. package/src/tools/circleTool.js +33 -9
  211. package/src/tools/codeTool.js +5 -3
  212. package/src/tools/frameTool.js +47 -7
  213. package/src/tools/freehandTool.js +12 -4
  214. package/src/tools/iconTool.js +7 -1
  215. package/src/tools/imageTool.js +7 -1
  216. package/src/tools/lineTool.js +27 -3
  217. package/src/tools/rectangleTool.js +45 -8
  218. package/src/tools/textTool.js +23 -6
@@ -0,0 +1,572 @@
1
+ "use client";
2
+ import {
3
+ calculateSnap,
4
+ cleanupAttachments,
5
+ clearSnapGuides
6
+ } from "./chunk-BZE4CEBG.js";
7
+ import {
8
+ pushCreateAction,
9
+ pushDeleteAction,
10
+ pushFrameAttachmentAction,
11
+ pushOptionsChangeAction,
12
+ pushTransformAction
13
+ } from "./chunk-L5OARZJ7.js";
14
+
15
+ // src/tools/circleTool.js
16
+ function getThemeStroke() {
17
+ if (typeof document === "undefined") return "#fff";
18
+ return document.body && document.body.classList.contains("theme-dark") ? "#fff" : "#1a1a2e";
19
+ }
20
+ var isDrawingCircle = false;
21
+ var isDraggingShapeCircle = false;
22
+ var isResizingShapeCircle = false;
23
+ var isRotatingShapeCircle = false;
24
+ var resizingAnchorIndexCircle = null;
25
+ var startRotationMouseAngleCircle = null;
26
+ var startShapeRotationCircle = null;
27
+ var rc = rough.svg(svg);
28
+ var startX;
29
+ var startY;
30
+ var circleStrokecolor = null;
31
+ var circleBackgroundColor = "transparent";
32
+ var circleFillStyleValue = "none";
33
+ var circleStrokeThicknes = 2;
34
+ var circleOutlineStyle = "solid";
35
+ var dragOldPosCircle = null;
36
+ var draggedShapeInitialFrameCircle = null;
37
+ var hoveredFrameCircle = null;
38
+ var colorOptionsCircle = document.querySelectorAll(".circleStrokeSpan");
39
+ var backgroundColorOptionsCircle = document.querySelectorAll(".circleBackgroundSpan");
40
+ var fillStyleOptionsCircle = document.querySelectorAll(".circleFillStyleSpan");
41
+ var strokeThicknessValueCircle = document.querySelectorAll(".circleStrokeThickSpan");
42
+ var outlineStyleValueCircle = document.querySelectorAll(".circleOutlineStyle");
43
+ function getSVGCoordsFromMouse(e) {
44
+ const viewBox = svg.viewBox.baseVal;
45
+ const rect = svg.getBoundingClientRect();
46
+ const mouseX = e.clientX - rect.left;
47
+ const mouseY = e.clientY - rect.top;
48
+ const svgX = viewBox.x + mouseX / rect.width * viewBox.width;
49
+ const svgY = viewBox.y + mouseY / rect.height * viewBox.height;
50
+ return { x: svgX, y: svgY };
51
+ }
52
+ function deleteCurrentShape() {
53
+ if (currentShape && currentShape.shapeName === "circle") {
54
+ const idx = shapes.indexOf(currentShape);
55
+ if (idx !== -1) shapes.splice(idx, 1);
56
+ cleanupAttachments(currentShape);
57
+ if (currentShape.group.parentNode) {
58
+ currentShape.group.parentNode.removeChild(currentShape.group);
59
+ }
60
+ pushDeleteAction(currentShape);
61
+ currentShape = null;
62
+ disableAllSideBars();
63
+ }
64
+ }
65
+ document.addEventListener("keydown", (e) => {
66
+ if (e.key === "Delete" && currentShape && currentShape.shapeName === "circle") {
67
+ deleteCurrentShape();
68
+ }
69
+ });
70
+ var handleMouseDown = (e) => {
71
+ const { x: svgMouseX, y: svgMouseY } = getSVGCoordsFromMouse(e);
72
+ if (isCircleToolActive) {
73
+ startX = svgMouseX;
74
+ startY = svgMouseY;
75
+ isDrawingCircle = true;
76
+ if (currentShape) {
77
+ currentShape.removeSelection();
78
+ currentShape = null;
79
+ disableAllSideBars();
80
+ }
81
+ let initialOptions = {
82
+ stroke: circleStrokecolor ?? getThemeStroke(),
83
+ fill: circleBackgroundColor,
84
+ fillStyle: circleFillStyleValue,
85
+ strokeWidth: circleStrokeThicknes
86
+ };
87
+ if (circleOutlineStyle === "dashed") {
88
+ initialOptions.strokeDasharray = "5,5";
89
+ } else if (circleOutlineStyle === "dotted") {
90
+ initialOptions.strokeDasharray = "2,8";
91
+ } else {
92
+ initialOptions.strokeDasharray = "";
93
+ }
94
+ currentShape = new Circle(startX, startY, 0, 0, initialOptions);
95
+ } else if (isSelectionToolActive) {
96
+ let clickedOnShape = false;
97
+ if (currentShape && currentShape.shapeName === "circle" && currentShape.isSelected) {
98
+ const anchorInfo = currentShape.isNearAnchor(svgMouseX, svgMouseY);
99
+ if (anchorInfo) {
100
+ dragOldPosCircle = {
101
+ x: currentShape.x,
102
+ y: currentShape.y,
103
+ rx: currentShape.rx,
104
+ ry: currentShape.ry,
105
+ rotation: currentShape.rotation
106
+ };
107
+ if (anchorInfo.type === "resize") {
108
+ isResizingShapeCircle = true;
109
+ resizingAnchorIndexCircle = anchorInfo.index;
110
+ } else if (anchorInfo.type === "rotate") {
111
+ isRotatingShapeCircle = true;
112
+ const CTM = currentShape.group.getCTM();
113
+ if (CTM) {
114
+ const svgPoint = svg.createSVGPoint();
115
+ svgPoint.x = currentShape.x;
116
+ svgPoint.y = currentShape.y;
117
+ const centerSVGPoint = svgPoint.matrixTransform(CTM);
118
+ startRotationMouseAngleCircle = Math.atan2(svgMouseY - centerSVGPoint.y, svgMouseX - centerSVGPoint.x) * (180 / Math.PI);
119
+ startShapeRotationCircle = currentShape.rotation;
120
+ } else {
121
+ isRotatingShapeCircle = false;
122
+ }
123
+ }
124
+ clickedOnShape = true;
125
+ } else if (currentShape.contains(svgMouseX, svgMouseY)) {
126
+ isDraggingShapeCircle = true;
127
+ dragOldPosCircle = {
128
+ x: currentShape.x,
129
+ y: currentShape.y,
130
+ rx: currentShape.rx,
131
+ ry: currentShape.ry,
132
+ rotation: currentShape.rotation
133
+ };
134
+ draggedShapeInitialFrameCircle = currentShape.parentFrame || null;
135
+ if (currentShape.parentFrame) {
136
+ currentShape.parentFrame.temporarilyRemoveFromFrame(currentShape);
137
+ }
138
+ startX = svgMouseX;
139
+ startY = svgMouseY;
140
+ clickedOnShape = true;
141
+ }
142
+ }
143
+ if (!clickedOnShape) {
144
+ let shapeToSelect = null;
145
+ for (let i = shapes.length - 1; i >= 0; i--) {
146
+ const shape = shapes[i];
147
+ if (shape.shapeName === "circle" && shape.contains(svgMouseX, svgMouseY)) {
148
+ shapeToSelect = shape;
149
+ break;
150
+ }
151
+ }
152
+ if (currentShape && currentShape !== shapeToSelect) {
153
+ currentShape.removeSelection();
154
+ currentShape = null;
155
+ disableAllSideBars();
156
+ }
157
+ if (shapeToSelect) {
158
+ currentShape = shapeToSelect;
159
+ currentShape.isSelected = true;
160
+ currentShape.draw();
161
+ isDraggingShapeCircle = true;
162
+ dragOldPosCircle = {
163
+ x: currentShape.x,
164
+ y: currentShape.y,
165
+ rx: currentShape.rx,
166
+ ry: currentShape.ry,
167
+ rotation: currentShape.rotation
168
+ };
169
+ draggedShapeInitialFrameCircle = currentShape.parentFrame || null;
170
+ if (currentShape.parentFrame) {
171
+ currentShape.parentFrame.temporarilyRemoveFromFrame(currentShape);
172
+ }
173
+ startX = svgMouseX;
174
+ startY = svgMouseY;
175
+ clickedOnShape = true;
176
+ }
177
+ }
178
+ if (!clickedOnShape && currentShape) {
179
+ currentShape.removeSelection();
180
+ currentShape = null;
181
+ disableAllSideBars();
182
+ }
183
+ }
184
+ };
185
+ var handleMouseMove = (e) => {
186
+ const { x: svgMouseX, y: svgMouseY } = getSVGCoordsFromMouse(e);
187
+ const svgRect = svg.getBoundingClientRect();
188
+ lastMousePos = {
189
+ x: e.clientX - svgRect.left,
190
+ y: e.clientY - svgRect.top
191
+ };
192
+ if (isDrawingCircle && isCircleToolActive && currentShape) {
193
+ currentShape.x = (startX + svgMouseX) / 2;
194
+ currentShape.y = (startY + svgMouseY) / 2;
195
+ currentShape.rx = Math.abs(svgMouseX - startX) / 2;
196
+ currentShape.ry = Math.abs(svgMouseY - startY) / 2;
197
+ currentShape.draw();
198
+ shapes.forEach((frame) => {
199
+ if (frame.shapeName === "frame") {
200
+ if (frame.isShapeInFrame(currentShape)) {
201
+ frame.highlightFrame();
202
+ hoveredFrameCircle = frame;
203
+ } else if (hoveredFrameCircle === frame) {
204
+ frame.removeHighlight();
205
+ hoveredFrameCircle = null;
206
+ }
207
+ }
208
+ });
209
+ } else if (isDraggingShapeCircle && currentShape && currentShape.isSelected) {
210
+ const dx = svgMouseX - startX;
211
+ const dy = svgMouseY - startY;
212
+ currentShape.move(dx, dy);
213
+ startX = svgMouseX;
214
+ startY = svgMouseY;
215
+ if (window.__sketchStoreApi && window.__sketchStoreApi.getState().snapToObjects) {
216
+ const snap = calculateSnap(currentShape, e.shiftKey, e.clientX, e.clientY);
217
+ if (snap.dx || snap.dy) {
218
+ currentShape.move(snap.dx, snap.dy);
219
+ }
220
+ } else {
221
+ clearSnapGuides();
222
+ }
223
+ let newHover = null;
224
+ for (const f of shapes) {
225
+ if (f.shapeName !== "frame") continue;
226
+ if (f === currentShape) continue;
227
+ if (typeof f.isShapeInFrame === "function" && f.isShapeInFrame(currentShape)) {
228
+ newHover = f;
229
+ break;
230
+ }
231
+ }
232
+ if (hoveredFrameCircle && hoveredFrameCircle !== newHover && typeof hoveredFrameCircle.removeHighlight === "function") {
233
+ hoveredFrameCircle.removeHighlight();
234
+ }
235
+ if (newHover && newHover !== hoveredFrameCircle && typeof newHover.highlightFrame === "function") {
236
+ newHover.highlightFrame();
237
+ }
238
+ hoveredFrameCircle = newHover;
239
+ } else if (isResizingShapeCircle && currentShape && currentShape.isSelected) {
240
+ currentShape.updatePosition(resizingAnchorIndexCircle, svgMouseX, svgMouseY);
241
+ currentShape._skipAnchors = true;
242
+ currentShape.draw();
243
+ currentShape._skipAnchors = false;
244
+ } else if (isRotatingShapeCircle && currentShape && currentShape.isSelected) {
245
+ const CTM = currentShape.group.getCTM();
246
+ if (CTM) {
247
+ const svgPoint = svg.createSVGPoint();
248
+ svgPoint.x = currentShape.x;
249
+ svgPoint.y = currentShape.y;
250
+ const centerSVGPoint = svgPoint.matrixTransform(CTM);
251
+ const currentMouseAngle = Math.atan2(svgMouseY - centerSVGPoint.y, svgMouseX - centerSVGPoint.x) * (180 / Math.PI);
252
+ const angleDiff = currentMouseAngle - startRotationMouseAngleCircle;
253
+ let newRotation = startShapeRotationCircle + angleDiff;
254
+ const snapAngle = 15;
255
+ if (e.shiftKey) {
256
+ newRotation = Math.round(newRotation / snapAngle) * snapAngle;
257
+ }
258
+ currentShape.rotate(newRotation);
259
+ currentShape._skipAnchors = true;
260
+ currentShape.draw();
261
+ currentShape._skipAnchors = false;
262
+ svg.style.cursor = "grabbing";
263
+ } else {
264
+ isRotatingShapeCircle = false;
265
+ svg.style.cursor = "default";
266
+ }
267
+ } else if (isSelectionToolActive && !isDrawingCircle && currentShape && currentShape.isSelected) {
268
+ const anchorInfo = currentShape.isNearAnchor(svgMouseX, svgMouseY);
269
+ if (anchorInfo) {
270
+ if (anchorInfo.type === "resize") {
271
+ const baseDirection = anchorInfo.index;
272
+ const rotatedCursor = currentShape.getRotatedCursor(baseDirection, currentShape.rotation);
273
+ svg.style.cursor = rotatedCursor + "-resize";
274
+ } else if (anchorInfo.type === "rotate") {
275
+ svg.style.cursor = "grab";
276
+ }
277
+ } else if (currentShape.contains(svgMouseX, svgMouseY)) {
278
+ svg.style.cursor = "move";
279
+ } else {
280
+ svg.style.cursor = "default";
281
+ }
282
+ } else if (isSelectionToolActive && !isDrawingCircle && !isDraggingShapeCircle && !isResizingShapeCircle && !isRotatingShapeCircle) {
283
+ let hoveredShape = null;
284
+ for (let i = shapes.length - 1; i >= 0; i--) {
285
+ const shape = shapes[i];
286
+ if (shape.shapeName === "circle" && shape.contains(svgMouseX, svgMouseY)) {
287
+ hoveredShape = shape;
288
+ break;
289
+ }
290
+ }
291
+ if (hoveredShape) {
292
+ svg.style.cursor = "pointer";
293
+ } else {
294
+ svg.style.cursor = "default";
295
+ }
296
+ }
297
+ };
298
+ var handleMouseUp = (e) => {
299
+ if (isDrawingCircle && currentShape) {
300
+ if (currentShape.rx === 0 && currentShape.ry === 0) {
301
+ if (currentShape.group.parentNode) {
302
+ currentShape.group.parentNode.removeChild(currentShape.group);
303
+ }
304
+ currentShape = null;
305
+ } else {
306
+ shapes.push(currentShape);
307
+ pushCreateAction(currentShape);
308
+ const finalFrame = hoveredFrameCircle;
309
+ if (finalFrame) {
310
+ finalFrame.addShapeToFrame(currentShape);
311
+ pushFrameAttachmentAction(finalFrame, currentShape, "attach", null);
312
+ }
313
+ const drawnShape = currentShape;
314
+ if (window.__sketchStoreApi) window.__sketchStoreApi.setActiveTool("select", { afterDraw: true });
315
+ currentShape = drawnShape;
316
+ currentShape.isSelected = true;
317
+ if (typeof currentShape.addAnchors === "function") {
318
+ currentShape.addAnchors();
319
+ }
320
+ }
321
+ if (hoveredFrameCircle) {
322
+ hoveredFrameCircle.removeHighlight();
323
+ hoveredFrameCircle = null;
324
+ }
325
+ }
326
+ if ((isDraggingShapeCircle || isResizingShapeCircle || isRotatingShapeCircle) && dragOldPosCircle && currentShape) {
327
+ const newPos = {
328
+ x: currentShape.x,
329
+ y: currentShape.y,
330
+ rx: currentShape.rx,
331
+ ry: currentShape.ry,
332
+ rotation: currentShape.rotation,
333
+ parentFrame: isDraggingShapeCircle ? hoveredFrameCircle || null : currentShape.parentFrame
334
+ };
335
+ const oldPos = {
336
+ ...dragOldPosCircle,
337
+ parentFrame: draggedShapeInitialFrameCircle
338
+ };
339
+ const stateChanged = oldPos.x !== newPos.x || oldPos.y !== newPos.y || oldPos.rx !== newPos.rx || oldPos.ry !== newPos.ry || oldPos.rotation !== newPos.rotation;
340
+ const frameChanged = oldPos.parentFrame !== newPos.parentFrame;
341
+ if (stateChanged || frameChanged) {
342
+ const oldPosForUndo = {
343
+ x: oldPos.x,
344
+ y: oldPos.y,
345
+ rx: oldPos.rx,
346
+ ry: oldPos.ry,
347
+ rotation: oldPos.rotation,
348
+ parentFrame: oldPos.parentFrame
349
+ };
350
+ const newPosForUndo = {
351
+ x: newPos.x,
352
+ y: newPos.y,
353
+ rx: newPos.rx,
354
+ ry: newPos.ry,
355
+ rotation: newPos.rotation,
356
+ parentFrame: newPos.parentFrame
357
+ };
358
+ pushTransformAction(currentShape, oldPosForUndo, newPosForUndo);
359
+ }
360
+ if (isDraggingShapeCircle) {
361
+ const finalFrame = hoveredFrameCircle;
362
+ if (draggedShapeInitialFrameCircle !== finalFrame) {
363
+ if (draggedShapeInitialFrameCircle) {
364
+ draggedShapeInitialFrameCircle.removeShapeFromFrame(currentShape);
365
+ }
366
+ if (finalFrame) {
367
+ finalFrame.addShapeToFrame(currentShape);
368
+ }
369
+ if (frameChanged) {
370
+ pushFrameAttachmentAction(
371
+ finalFrame || draggedShapeInitialFrameCircle,
372
+ currentShape,
373
+ finalFrame ? "attach" : "detach",
374
+ draggedShapeInitialFrameCircle
375
+ );
376
+ }
377
+ } else if (draggedShapeInitialFrameCircle) {
378
+ draggedShapeInitialFrameCircle.restoreToFrame(currentShape);
379
+ }
380
+ }
381
+ dragOldPosCircle = null;
382
+ draggedShapeInitialFrameCircle = null;
383
+ }
384
+ if (hoveredFrameCircle) {
385
+ hoveredFrameCircle.removeHighlight();
386
+ hoveredFrameCircle = null;
387
+ }
388
+ clearSnapGuides();
389
+ isDrawingCircle = false;
390
+ isDraggingShapeCircle = false;
391
+ isResizingShapeCircle = false;
392
+ isRotatingShapeCircle = false;
393
+ resizingAnchorIndexCircle = null;
394
+ startRotationMouseAngleCircle = null;
395
+ startShapeRotationCircle = 0;
396
+ svg.style.cursor = "default";
397
+ };
398
+ colorOptionsCircle.forEach((span) => {
399
+ span.addEventListener("click", function(event) {
400
+ event.stopPropagation();
401
+ if (currentShape && currentShape.shapeName === "circle" && currentShape.isSelected) {
402
+ const color = this.getAttribute("data-id");
403
+ const oldOptions = { ...currentShape.options };
404
+ currentShape.options.stroke = color;
405
+ currentShape.draw();
406
+ currentShape.updateSidebar();
407
+ pushOptionsChangeAction(currentShape, oldOptions);
408
+ } else {
409
+ circleStrokecolor = this.getAttribute("data-id");
410
+ }
411
+ colorOptionsCircle.forEach((span2) => {
412
+ span2.classList.remove("selected");
413
+ });
414
+ this.classList.add("selected");
415
+ });
416
+ });
417
+ backgroundColorOptionsCircle.forEach((span) => {
418
+ span.addEventListener("click", function(event) {
419
+ event.stopPropagation();
420
+ if (currentShape && currentShape.shapeName === "circle" && currentShape.isSelected) {
421
+ const color = this.getAttribute("data-id");
422
+ const oldOptions = { ...currentShape.options };
423
+ currentShape.options.fill = color;
424
+ currentShape.draw();
425
+ currentShape.updateSidebar();
426
+ pushOptionsChangeAction(currentShape, oldOptions);
427
+ } else {
428
+ circleBackgroundColor = this.getAttribute("data-id");
429
+ }
430
+ backgroundColorOptionsCircle.forEach((span2) => {
431
+ span2.classList.remove("selected");
432
+ });
433
+ this.classList.add("selected");
434
+ });
435
+ });
436
+ fillStyleOptionsCircle.forEach((span) => {
437
+ span.addEventListener("click", function(event) {
438
+ event.stopPropagation();
439
+ if (currentShape && currentShape.shapeName === "circle" && currentShape.isSelected) {
440
+ const style = this.getAttribute("data-id");
441
+ const oldOptions = { ...currentShape.options };
442
+ currentShape.options.fillStyle = style;
443
+ currentShape.draw();
444
+ currentShape.updateSidebar();
445
+ pushOptionsChangeAction(currentShape, oldOptions);
446
+ } else {
447
+ circleFillStyleValue = this.getAttribute("data-id");
448
+ }
449
+ fillStyleOptionsCircle.forEach((span2) => {
450
+ span2.classList.remove("selected");
451
+ });
452
+ this.classList.add("selected");
453
+ });
454
+ });
455
+ strokeThicknessValueCircle.forEach((span) => {
456
+ span.addEventListener("click", function(event) {
457
+ event.stopPropagation();
458
+ if (currentShape && currentShape.shapeName === "circle" && currentShape.isSelected) {
459
+ const thick = parseInt(this.getAttribute("data-id"), 10);
460
+ const oldOptions = { ...currentShape.options };
461
+ currentShape.options.strokeWidth = thick;
462
+ currentShape.draw();
463
+ currentShape.updateSidebar();
464
+ pushOptionsChangeAction(currentShape, oldOptions);
465
+ } else {
466
+ circleStrokeThicknes = parseInt(this.getAttribute("data-id"), 10);
467
+ }
468
+ strokeThicknessValueCircle.forEach((span2) => {
469
+ span2.classList.remove("selected");
470
+ });
471
+ this.classList.add("selected");
472
+ });
473
+ });
474
+ outlineStyleValueCircle.forEach((span) => {
475
+ span.addEventListener("click", function(event) {
476
+ event.stopPropagation();
477
+ if (currentShape && currentShape.shapeName === "circle" && currentShape.isSelected) {
478
+ const style = this.getAttribute("data-id");
479
+ const oldOptions = { ...currentShape.options };
480
+ if (style === "dashed") {
481
+ currentShape.options.strokeDasharray = "5,5";
482
+ } else if (style === "dotted") {
483
+ currentShape.options.strokeDasharray = "2,8";
484
+ } else {
485
+ currentShape.options.strokeDasharray = "";
486
+ }
487
+ currentShape.draw();
488
+ currentShape.updateSidebar();
489
+ pushOptionsChangeAction(currentShape, oldOptions);
490
+ } else {
491
+ circleOutlineStyle = this.getAttribute("data-id");
492
+ }
493
+ outlineStyleValueCircle.forEach((span2) => {
494
+ span2.classList.remove("selected");
495
+ });
496
+ this.classList.add("selected");
497
+ });
498
+ });
499
+ window.Circle = Circle;
500
+ window.circleToolSettings = {
501
+ get strokeColor() {
502
+ return circleStrokecolor;
503
+ },
504
+ set strokeColor(v) {
505
+ circleStrokecolor = v;
506
+ },
507
+ get bgColor() {
508
+ return circleBackgroundColor;
509
+ },
510
+ set bgColor(v) {
511
+ circleBackgroundColor = v;
512
+ },
513
+ get fillStyle() {
514
+ return circleFillStyleValue;
515
+ },
516
+ set fillStyle(v) {
517
+ circleFillStyleValue = v;
518
+ },
519
+ get strokeWidth() {
520
+ return circleStrokeThicknes;
521
+ },
522
+ set strokeWidth(v) {
523
+ circleStrokeThicknes = v;
524
+ },
525
+ get outlineStyle() {
526
+ return circleOutlineStyle;
527
+ },
528
+ set outlineStyle(v) {
529
+ circleOutlineStyle = v;
530
+ }
531
+ };
532
+ window.updateSelectedCircleStyle = function(changes) {
533
+ if (currentShape && currentShape.shapeName === "circle" && currentShape.isSelected) {
534
+ pushOptionsChangeAction(currentShape, { ...currentShape.options });
535
+ if (changes.stroke !== void 0) {
536
+ circleStrokecolor = changes.stroke;
537
+ currentShape.options.stroke = changes.stroke;
538
+ }
539
+ if (changes.fill !== void 0) {
540
+ circleBackgroundColor = changes.fill;
541
+ currentShape.options.fill = changes.fill;
542
+ }
543
+ if (changes.fillStyle !== void 0) {
544
+ circleFillStyleValue = changes.fillStyle;
545
+ currentShape.options.fillStyle = changes.fillStyle;
546
+ }
547
+ if (changes.strokeWidth !== void 0) {
548
+ circleStrokeThicknes = changes.strokeWidth;
549
+ currentShape.options.strokeWidth = changes.strokeWidth;
550
+ }
551
+ if (changes.outlineStyle !== void 0) {
552
+ circleOutlineStyle = changes.outlineStyle;
553
+ if (changes.outlineStyle === "dashed") currentShape.options.strokeDasharray = "5,5";
554
+ else if (changes.outlineStyle === "dotted") currentShape.options.strokeDasharray = "2,8";
555
+ else currentShape.options.strokeDasharray = "";
556
+ }
557
+ currentShape.draw();
558
+ } else {
559
+ if (changes.stroke !== void 0) circleStrokecolor = changes.stroke;
560
+ if (changes.fill !== void 0) circleBackgroundColor = changes.fill;
561
+ if (changes.fillStyle !== void 0) circleFillStyleValue = changes.fillStyle;
562
+ if (changes.strokeWidth !== void 0) circleStrokeThicknes = changes.strokeWidth;
563
+ if (changes.outlineStyle !== void 0) circleOutlineStyle = changes.outlineStyle;
564
+ }
565
+ };
566
+
567
+ export {
568
+ handleMouseDown,
569
+ handleMouseMove,
570
+ handleMouseUp
571
+ };
572
+ //# sourceMappingURL=chunk-I6HCCIXB.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/tools/circleTool.js"],
4
+ "sourcesContent": ["/* eslint-disable */\n// Circle tool event handlers - extracted from drawCircle.js\nimport { pushCreateAction, pushDeleteAction, pushOptionsChangeAction, pushTransformAction, pushFrameAttachmentAction } from '../core/UndoRedo.js';\nimport { cleanupAttachments } from './arrowTool.js';\nimport { calculateSnap, clearSnapGuides } from '../core/SnapGuides.js';\n\nfunction getThemeStroke() { if (typeof document === \"undefined\") return \"#fff\"; return document.body && document.body.classList.contains(\"theme-dark\") ? \"#fff\" : \"#1a1a2e\"; }\n\nlet isDrawingCircle = false;\nlet isDraggingShapeCircle = false;\nlet isResizingShapeCircle = false;\nlet isRotatingShapeCircle = false;\nlet resizingAnchorIndexCircle = null;\n\nlet startRotationMouseAngleCircle = null;\nlet startShapeRotationCircle = null;\nconst rc = rough.svg(svg);\nlet startX, startY;\n\n\nlet circleStrokecolor = null;\nlet circleBackgroundColor = \"transparent\";\nlet circleFillStyleValue = \"none\";\nlet circleStrokeThicknes = 2;\nlet circleOutlineStyle = \"solid\";\n\nlet dragOldPosCircle = null;\nlet draggedShapeInitialFrameCircle = null;\nlet hoveredFrameCircle = null;\nlet colorOptionsCircle = document.querySelectorAll(\".circleStrokeSpan\");\nlet backgroundColorOptionsCircle = document.querySelectorAll(\".circleBackgroundSpan\");\nlet fillStyleOptionsCircle = document.querySelectorAll(\".circleFillStyleSpan\");\nlet strokeThicknessValueCircle = document.querySelectorAll(\".circleStrokeThickSpan\");\nlet outlineStyleValueCircle = document.querySelectorAll(\".circleOutlineStyle\");\n\n\n\nfunction getSVGCoordsFromMouse(e) {\n const viewBox = svg.viewBox.baseVal;\n const rect = svg.getBoundingClientRect();\n const mouseX = e.clientX - rect.left;\n const mouseY = e.clientY - rect.top;\n const svgX = viewBox.x + (mouseX / rect.width) * viewBox.width;\n const svgY = viewBox.y + (mouseY / rect.height) * viewBox.height;\n return { x: svgX, y: svgY };\n}\n\n\nfunction deleteCurrentShape() {\n if (currentShape && currentShape.shapeName === 'circle') {\n const idx = shapes.indexOf(currentShape);\n if (idx !== -1) shapes.splice(idx, 1);\n \n // Clean up any arrow attachments before deleting\n cleanupAttachments(currentShape);\n \n if (currentShape.group.parentNode) {\n currentShape.group.parentNode.removeChild(currentShape.group);\n }\n pushDeleteAction(currentShape);\n currentShape = null;\n disableAllSideBars();\n }\n}\n\ndocument.addEventListener('keydown', (e) => {\n if (e.key === 'Delete' && currentShape && currentShape.shapeName === 'circle') {\n deleteCurrentShape();\n }\n});\n\nconst handleMouseDown = (e) => {\n const {x: svgMouseX, y: svgMouseY} = getSVGCoordsFromMouse(e);\n\n if(isCircleToolActive)\n {\n startX = svgMouseX;\n startY = svgMouseY;\n isDrawingCircle = true;\n\n if(currentShape) \n {\n currentShape.removeSelection();\n currentShape = null;\n disableAllSideBars();\n }\n let initialOptions = {\n stroke: circleStrokecolor ?? getThemeStroke(),\n fill: circleBackgroundColor,\n fillStyle: circleFillStyleValue,\n strokeWidth: circleStrokeThicknes,\n };\n if(circleOutlineStyle === \"dashed\") {\n initialOptions.strokeDasharray = \"5,5\";\n }\n else if(circleOutlineStyle === \"dotted\") {\n initialOptions.strokeDasharray = \"2,8\";\n } else {\n initialOptions.strokeDasharray = \"\";\n }\n\n currentShape = new Circle(startX, startY, 0, 0, initialOptions);\n }\n\n else if(isSelectionToolActive) \n {\n let clickedOnShape = false;\n if (currentShape && currentShape.shapeName === 'circle' && currentShape.isSelected)\n {\n const anchorInfo = currentShape.isNearAnchor(svgMouseX, svgMouseY);\n if (anchorInfo) {\n dragOldPosCircle = { \n x: currentShape.x, \n y: currentShape.y, \n rx: currentShape.rx, \n ry: currentShape.ry, \n rotation: currentShape.rotation \n };\n if(anchorInfo.type === 'resize') \n {\n isResizingShapeCircle = true;\n resizingAnchorIndexCircle = anchorInfo.index;\n }\n else if(anchorInfo.type === 'rotate') \n {\n isRotatingShapeCircle = true;\n const CTM = currentShape.group.getCTM();\n if(CTM)\n {\n const svgPoint = svg.createSVGPoint();\n svgPoint.x = currentShape.x;\n svgPoint.y = currentShape.y;\n const centerSVGPoint = svgPoint.matrixTransform(CTM);\n startRotationMouseAngleCircle = Math.atan2(svgMouseY - centerSVGPoint.y, svgMouseX - centerSVGPoint.x) * (180 / Math.PI);\n startShapeRotationCircle = currentShape.rotation;\n }\n else \n {\n isRotatingShapeCircle = false;\n }\n }\n clickedOnShape = true;\n }\n else if (currentShape.contains(svgMouseX, svgMouseY)) \n {\n isDraggingShapeCircle = true;\n dragOldPosCircle = { \n x: currentShape.x, \n y: currentShape.y, \n rx: currentShape.rx, \n ry: currentShape.ry, \n rotation: currentShape.rotation \n };\n \n // Store initial frame state\n draggedShapeInitialFrameCircle = currentShape.parentFrame || null;\n \n // Temporarily remove from frame clipping if dragging\n if (currentShape.parentFrame) {\n currentShape.parentFrame.temporarilyRemoveFromFrame(currentShape);\n }\n \n startX = svgMouseX;\n startY = svgMouseY;\n clickedOnShape = true;\n }\n }\n if (!clickedOnShape) \n {\n let shapeToSelect = null;\n for (let i = shapes.length - 1; i >= 0; i--) {\n const shape = shapes[i];\n if (shape.shapeName === 'circle' && shape.contains(svgMouseX, svgMouseY)) {\n shapeToSelect = shape;\n break; \n }\n }\n if (currentShape && currentShape !== shapeToSelect) {\n currentShape.removeSelection();\n currentShape = null;\n disableAllSideBars();\n }\n if(shapeToSelect)\n {\n currentShape = shapeToSelect;\n currentShape.isSelected = true;\n currentShape.draw();\n isDraggingShapeCircle = true;\n dragOldPosCircle = { \n x: currentShape.x, \n y: currentShape.y, \n rx: currentShape.rx, \n ry: currentShape.ry, \n rotation: currentShape.rotation \n };\n \n // Store initial frame state\n draggedShapeInitialFrameCircle = currentShape.parentFrame || null;\n \n // Temporarily remove from frame clipping if dragging\n if (currentShape.parentFrame) {\n currentShape.parentFrame.temporarilyRemoveFromFrame(currentShape);\n }\n \n startX = svgMouseX;\n startY = svgMouseY;\n clickedOnShape = true;\n }\n }\n if(!clickedOnShape && currentShape) {\n currentShape.removeSelection();\n currentShape = null;\n disableAllSideBars();\n }\n }\n};\n\nconst handleMouseMove = (e) => {\n\n const {x: svgMouseX, y: svgMouseY} = getSVGCoordsFromMouse(e);\n \n // Keep lastMousePos in screen coordinates for other functions\n const svgRect = svg.getBoundingClientRect();\n lastMousePos = {\n x: e.clientX - svgRect.left, \n y: e.clientY - svgRect.top\n };\n\n if(isDrawingCircle && isCircleToolActive && currentShape) \n {\n currentShape.x = (startX + svgMouseX) / 2;\n currentShape.y = (startY + svgMouseY) / 2;\n currentShape.rx = Math.abs(svgMouseX - startX) / 2;\n currentShape.ry = Math.abs(svgMouseY - startY) / 2;\n currentShape.draw();\n \n // Check for frame containment while drawing (but don't apply clipping yet)\n shapes.forEach(frame => {\n if (frame.shapeName === 'frame') {\n if (frame.isShapeInFrame(currentShape)) {\n frame.highlightFrame();\n hoveredFrameCircle = frame;\n } else if (hoveredFrameCircle === frame) {\n frame.removeHighlight();\n hoveredFrameCircle = null;\n }\n }\n });\n }\n else if (isDraggingShapeCircle && currentShape && currentShape.isSelected) {\n const dx = svgMouseX - startX;\n const dy = svgMouseY - startY;\n currentShape.move(dx, dy);\n startX = svgMouseX;\n startY = svgMouseY;\n\n // Snap guides\n if (window.__sketchStoreApi && window.__sketchStoreApi.getState().snapToObjects) {\n const snap = calculateSnap(currentShape, e.shiftKey, e.clientX, e.clientY);\n if (snap.dx || snap.dy) {\n currentShape.move(snap.dx, snap.dy);\n }\n } else {\n clearSnapGuides();\n }\n\n // Issue #24 bug #4: track containing frame during drag (see same\n // block in rectangleTool for the rationale).\n let newHover = null;\n for (const f of shapes) {\n if (f.shapeName !== 'frame') continue;\n if (f === currentShape) continue;\n if (typeof f.isShapeInFrame === 'function' && f.isShapeInFrame(currentShape)) {\n newHover = f;\n break;\n }\n }\n if (hoveredFrameCircle && hoveredFrameCircle !== newHover && typeof hoveredFrameCircle.removeHighlight === 'function') {\n hoveredFrameCircle.removeHighlight();\n }\n if (newHover && newHover !== hoveredFrameCircle && typeof newHover.highlightFrame === 'function') {\n newHover.highlightFrame();\n }\n hoveredFrameCircle = newHover;\n }\n \n else if(isResizingShapeCircle && currentShape && currentShape.isSelected)\n {\n currentShape.updatePosition(resizingAnchorIndexCircle, svgMouseX, svgMouseY);\n currentShape._skipAnchors = true;\n currentShape.draw();\n currentShape._skipAnchors = false;\n }\n else if (isRotatingShapeCircle && currentShape && currentShape.isSelected)\n {\n const CTM = currentShape.group.getCTM();\n if(CTM) {\n const svgPoint = svg.createSVGPoint();\n svgPoint.x = currentShape.x;\n svgPoint.y = currentShape.y;\n const centerSVGPoint = svgPoint.matrixTransform(CTM);\n const currentMouseAngle = Math.atan2(svgMouseY - centerSVGPoint.y, svgMouseX - centerSVGPoint.x) * (180 / Math.PI);\n const angleDiff = currentMouseAngle - startRotationMouseAngleCircle;\n let newRotation = startShapeRotationCircle + angleDiff;\n const snapAngle = 15;\n if (e.shiftKey) {\n newRotation = Math.round(newRotation / snapAngle) * snapAngle;\n }\n currentShape.rotate(newRotation);\n currentShape._skipAnchors = true;\n currentShape.draw();\n currentShape._skipAnchors = false;\n svg.style.cursor = 'grabbing'; \n }\n else \n {\n isRotatingShapeCircle = false; \n svg.style.cursor = 'default';\n }\n }\n else if (isSelectionToolActive && !isDrawingCircle && currentShape && currentShape.isSelected) \n {\n const anchorInfo = currentShape.isNearAnchor(svgMouseX, svgMouseY);\n if(anchorInfo)\n {\n if(anchorInfo.type === 'resize') {\n const baseDirection = anchorInfo.index; \n const rotatedCursor = currentShape.getRotatedCursor(baseDirection, currentShape.rotation);\n svg.style.cursor = rotatedCursor + '-resize';\n }\n else if(anchorInfo.type === 'rotate') {\n svg.style.cursor = 'grab';\n }\n }\n else if(currentShape.contains(svgMouseX, svgMouseY)) {\n svg.style.cursor = 'move';\n }\n else \n {\n svg.style.cursor = 'default';\n }\n }\n else if (isSelectionToolActive && !isDrawingCircle && !isDraggingShapeCircle && !isResizingShapeCircle && !isRotatingShapeCircle) \n {\n let hoveredShape = null;\n for (let i = shapes.length - 1; i >= 0; i--) {\n const shape = shapes[i];\n if (shape.shapeName === 'circle' && shape.contains(svgMouseX, svgMouseY)) {\n hoveredShape = shape;\n break; \n }\n }\n if (hoveredShape) {\n svg.style.cursor = 'pointer';\n } else {\n svg.style.cursor = 'default';\n }\n }\n}\n\nconst handleMouseUp = (e) => {\n if (isDrawingCircle && currentShape) {\n if(currentShape.rx === 0 && currentShape.ry === 0) {\n if (currentShape.group.parentNode) {\n currentShape.group.parentNode.removeChild(currentShape.group);\n }\n currentShape = null;\n } else {\n shapes.push(currentShape);\n pushCreateAction(currentShape);\n\n // Check for frame containment and track attachment\n const finalFrame = hoveredFrameCircle;\n if (finalFrame) {\n finalFrame.addShapeToFrame(currentShape);\n // Track the attachment for undo\n pushFrameAttachmentAction(finalFrame, currentShape, 'attach', null);\n }\n\n // Auto-select the drawn shape and switch to selection tool\n const drawnShape = currentShape;\n if (window.__sketchStoreApi) window.__sketchStoreApi.setActiveTool('select', { afterDraw: true });\n currentShape = drawnShape;\n currentShape.isSelected = true;\n if (typeof currentShape.addAnchors === 'function') {\n currentShape.addAnchors();\n }\n }\n \n // Clear frame highlighting\n if (hoveredFrameCircle) {\n hoveredFrameCircle.removeHighlight();\n hoveredFrameCircle = null;\n }\n }\n \n if((isDraggingShapeCircle || isResizingShapeCircle || isRotatingShapeCircle) && dragOldPosCircle && currentShape) {\n // Issue #34 bug #2: see rectangleTool \u2014 record the hovered frame\n // as the destination, not the stale `parentFrame` (containment\n // transfer happens later in this handler).\n const newPos = {\n x: currentShape.x,\n y: currentShape.y,\n rx: currentShape.rx,\n ry: currentShape.ry,\n rotation: currentShape.rotation,\n parentFrame: isDraggingShapeCircle ? (hoveredFrameCircle || null) : currentShape.parentFrame,\n };\n const oldPos = {\n ...dragOldPosCircle,\n parentFrame: draggedShapeInitialFrameCircle\n };\n \n const stateChanged = oldPos.x !== newPos.x || oldPos.y !== newPos.y ||\n oldPos.rx !== newPos.rx || oldPos.ry !== newPos.ry || \n oldPos.rotation !== newPos.rotation;\n\n const frameChanged = oldPos.parentFrame !== newPos.parentFrame;\n\n if (stateChanged || frameChanged) {\n const oldPosForUndo = {\n x: oldPos.x,\n y: oldPos.y,\n rx: oldPos.rx,\n ry: oldPos.ry,\n rotation: oldPos.rotation,\n parentFrame: oldPos.parentFrame\n };\n const newPosForUndo = {\n x: newPos.x,\n y: newPos.y,\n rx: newPos.rx,\n ry: newPos.ry,\n rotation: newPos.rotation,\n parentFrame: newPos.parentFrame\n };\n pushTransformAction(currentShape, oldPosForUndo, newPosForUndo);\n }\n \n // Handle frame containment changes after drag\n if (isDraggingShapeCircle) {\n const finalFrame = hoveredFrameCircle;\n \n // If shape moved to a different frame\n if (draggedShapeInitialFrameCircle !== finalFrame) {\n // Remove from initial frame\n if (draggedShapeInitialFrameCircle) {\n draggedShapeInitialFrameCircle.removeShapeFromFrame(currentShape);\n }\n \n // Add to new frame\n if (finalFrame) {\n finalFrame.addShapeToFrame(currentShape);\n }\n \n // Track the frame change for undo\n if (frameChanged) {\n pushFrameAttachmentAction(finalFrame || draggedShapeInitialFrameCircle, currentShape, \n finalFrame ? 'attach' : 'detach', draggedShapeInitialFrameCircle);\n }\n } else if (draggedShapeInitialFrameCircle) {\n // Shape stayed in same frame, restore clipping\n draggedShapeInitialFrameCircle.restoreToFrame(currentShape);\n }\n }\n \n dragOldPosCircle = null;\n draggedShapeInitialFrameCircle = null;\n }\n \n // Clear frame highlighting\n if (hoveredFrameCircle) {\n hoveredFrameCircle.removeHighlight();\n hoveredFrameCircle = null;\n }\n\n clearSnapGuides();\n isDrawingCircle = false;\n isDraggingShapeCircle = false;\n isResizingShapeCircle = false;\n isRotatingShapeCircle = false;\n resizingAnchorIndexCircle = null;\n startRotationMouseAngleCircle = null;\n startShapeRotationCircle = 0;\n svg.style.cursor = 'default';\n}\n\n\ncolorOptionsCircle.forEach(span => {\n span.addEventListener('click', function(event) {\n event.stopPropagation();\n if (currentShape && currentShape.shapeName === 'circle' && currentShape.isSelected) {\n const color = this.getAttribute('data-id');\n const oldOptions = {...currentShape.options};\n currentShape.options.stroke = color;\n currentShape.draw();\n currentShape.updateSidebar();\n pushOptionsChangeAction(currentShape, oldOptions);\n }\n else \n {\n circleStrokecolor = this.getAttribute('data-id');\n }\n colorOptionsCircle.forEach(span => {\n span.classList.remove('selected');\n });\n this.classList.add('selected');\n });\n});\nbackgroundColorOptionsCircle.forEach(span => {\n span.addEventListener('click', function(event) {\n event.stopPropagation();\n if (currentShape && currentShape.shapeName === 'circle' && currentShape.isSelected) {\n const color = this.getAttribute('data-id');\n const oldOptions = {...currentShape.options};\n currentShape.options.fill = color;\n currentShape.draw();\n currentShape.updateSidebar();\n pushOptionsChangeAction(currentShape, oldOptions);\n }\n else \n {\n circleBackgroundColor = this.getAttribute('data-id');\n }\n backgroundColorOptionsCircle.forEach(span => {\n span.classList.remove('selected');\n });\n this.classList.add('selected');\n });\n});\nfillStyleOptionsCircle.forEach(span => {\n span.addEventListener('click', function(event) {\n event.stopPropagation();\n if (currentShape && currentShape.shapeName === 'circle' && currentShape.isSelected) {\n const style = this.getAttribute('data-id');\n const oldOptions = {...currentShape.options};\n currentShape.options.fillStyle = style;\n currentShape.draw();\n currentShape.updateSidebar();\n pushOptionsChangeAction(currentShape, oldOptions);\n }\n else \n {\n circleFillStyleValue = this.getAttribute('data-id');\n }\n fillStyleOptionsCircle.forEach(span => {\n span.classList.remove('selected');\n });\n this.classList.add('selected');\n });\n});\nstrokeThicknessValueCircle.forEach(span => {\n span.addEventListener('click', function(event) {\n event.stopPropagation();\n if (currentShape && currentShape.shapeName === 'circle' && currentShape.isSelected) {\n const thick = parseInt(this.getAttribute('data-id'), 10);\n const oldOptions = {...currentShape.options};\n currentShape.options.strokeWidth = thick;\n currentShape.draw();\n currentShape.updateSidebar();\n pushOptionsChangeAction(currentShape, oldOptions);\n }\n else \n {\n circleStrokeThicknes = parseInt(this.getAttribute('data-id'), 10);\n }\n strokeThicknessValueCircle.forEach(span => {\n span.classList.remove('selected');\n });\n this.classList.add('selected');\n });\n});\noutlineStyleValueCircle.forEach(span => {\n span.addEventListener('click', function(event) {\n event.stopPropagation();\n if (currentShape && currentShape.shapeName === 'circle' && currentShape.isSelected) {\n const style = this.getAttribute('data-id');\n const oldOptions = {...currentShape.options};\n if (style === \"dashed\") {\n currentShape.options.strokeDasharray = \"5,5\";\n } else if (style === \"dotted\") {\n currentShape.options.strokeDasharray = \"2,8\";\n } else {\n currentShape.options.strokeDasharray = \"\";\n }\n currentShape.draw();\n currentShape.updateSidebar();\n pushOptionsChangeAction(currentShape, oldOptions);\n }\n else \n {\n circleOutlineStyle = this.getAttribute('data-id');\n }\n outlineStyleValueCircle.forEach(span => {\n span.classList.remove('selected');\n });\n this.classList.add('selected');\n });\n});\n\nwindow.Circle = Circle;\n\n// Bridge circle tool settings to React sidebar\nwindow.circleToolSettings = {\n get strokeColor() { return circleStrokecolor; },\n set strokeColor(v) { circleStrokecolor = v; },\n get bgColor() { return circleBackgroundColor; },\n set bgColor(v) { circleBackgroundColor = v; },\n get fillStyle() { return circleFillStyleValue; },\n set fillStyle(v) { circleFillStyleValue = v; },\n get strokeWidth() { return circleStrokeThicknes; },\n set strokeWidth(v) { circleStrokeThicknes = v; },\n get outlineStyle() { return circleOutlineStyle; },\n set outlineStyle(v) { circleOutlineStyle = v; },\n};\nwindow.updateSelectedCircleStyle = function(changes) {\n if (currentShape && currentShape.shapeName === 'circle' && currentShape.isSelected) {\n pushOptionsChangeAction(currentShape, { ...currentShape.options });\n if (changes.stroke !== undefined) { circleStrokecolor = changes.stroke; currentShape.options.stroke = changes.stroke; }\n if (changes.fill !== undefined) { circleBackgroundColor = changes.fill; currentShape.options.fill = changes.fill; }\n if (changes.fillStyle !== undefined) { circleFillStyleValue = changes.fillStyle; currentShape.options.fillStyle = changes.fillStyle; }\n if (changes.strokeWidth !== undefined) { circleStrokeThicknes = changes.strokeWidth; currentShape.options.strokeWidth = changes.strokeWidth; }\n if (changes.outlineStyle !== undefined) {\n circleOutlineStyle = changes.outlineStyle;\n if (changes.outlineStyle === \"dashed\") currentShape.options.strokeDasharray = \"5,5\";\n else if (changes.outlineStyle === \"dotted\") currentShape.options.strokeDasharray = \"2,8\";\n else currentShape.options.strokeDasharray = \"\";\n }\n currentShape.draw();\n } else {\n if (changes.stroke !== undefined) circleStrokecolor = changes.stroke;\n if (changes.fill !== undefined) circleBackgroundColor = changes.fill;\n if (changes.fillStyle !== undefined) circleFillStyleValue = changes.fillStyle;\n if (changes.strokeWidth !== undefined) circleStrokeThicknes = changes.strokeWidth;\n if (changes.outlineStyle !== undefined) circleOutlineStyle = changes.outlineStyle;\n }\n};\n\nexport {\n handleMouseDown as handleMouseDownCircle,\n handleMouseMove as handleMouseMoveCircle,\n handleMouseUp as handleMouseUpCircle,\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;AAMA,SAAS,iBAAiB;AAAE,MAAI,OAAO,aAAa,YAAa,QAAO;AAAQ,SAAO,SAAS,QAAQ,SAAS,KAAK,UAAU,SAAS,YAAY,IAAI,SAAS;AAAW;AAE7K,IAAI,kBAAkB;AACtB,IAAI,wBAAwB;AAC5B,IAAI,wBAAwB;AAC5B,IAAI,wBAAwB;AAC5B,IAAI,4BAA4B;AAEhC,IAAI,gCAAgC;AACpC,IAAI,2BAA2B;AAC/B,IAAM,KAAK,MAAM,IAAI,GAAG;AACxB,IAAI;AAAJ,IAAY;AAGZ,IAAI,oBAAoB;AACxB,IAAI,wBAAwB;AAC5B,IAAI,uBAAuB;AAC3B,IAAI,uBAAuB;AAC3B,IAAI,qBAAqB;AAEzB,IAAI,mBAAmB;AACvB,IAAI,iCAAiC;AACrC,IAAI,qBAAqB;AACzB,IAAI,qBAAqB,SAAS,iBAAiB,mBAAmB;AACtE,IAAI,+BAA+B,SAAS,iBAAiB,uBAAuB;AACpF,IAAI,yBAAyB,SAAS,iBAAiB,sBAAsB;AAC7E,IAAI,6BAA6B,SAAS,iBAAiB,wBA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