@elixpo/lixsketch 5.6.9 → 5.6.11

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 (165) hide show
  1. package/dist/react/{AIRenderer-R5M2CIDO.js → AIRenderer-JNEZYDYQ.js} +4 -4
  2. package/dist/react/Arrow-QMR77LGQ.js +9 -0
  3. package/dist/react/Circle-5WL5HZA5.js +11 -0
  4. package/dist/react/{CopyPaste-PPDS3AD6.js → CopyPaste-V7AY56H3.js} +74 -30
  5. package/dist/react/CopyPaste-V7AY56H3.js.map +7 -0
  6. package/dist/react/{EventDispatcher-UV7LFSAS.js → EventDispatcher-E4OJCMY6.js} +154 -57
  7. package/dist/react/{EventDispatcher-UV7LFSAS.js.map → EventDispatcher-E4OJCMY6.js.map} +3 -3
  8. package/dist/react/Frame-OZCDVPMI.js +11 -0
  9. package/dist/react/FreehandStroke-QSSYWBFK.js +9 -0
  10. package/dist/react/IconShape-HXUV4VRT.js +10 -0
  11. package/dist/react/ImageShape-JGLT2UGG.js +10 -0
  12. package/dist/react/Line-YONPLUYT.js +11 -0
  13. package/dist/react/{MermaidFlowchartRenderer-EL3Q2MNW.js → MermaidFlowchartRenderer-FSH43RUP.js} +26 -7
  14. package/dist/react/{MermaidFlowchartRenderer-EL3Q2MNW.js.map → MermaidFlowchartRenderer-FSH43RUP.js.map} +2 -2
  15. package/dist/react/{MermaidSequenceRenderer-K4KHHEVC.js → MermaidSequenceRenderer-FRPNOF2V.js} +11 -9
  16. package/dist/react/{MermaidSequenceRenderer-K4KHHEVC.js.map → MermaidSequenceRenderer-FRPNOF2V.js.map} +2 -2
  17. package/dist/react/{MermaidStructuredRenderer-6LN3WISP.js → MermaidStructuredRenderer-BZGQLRIH.js} +13 -6
  18. package/dist/react/{MermaidStructuredRenderer-6LN3WISP.js.map → MermaidStructuredRenderer-BZGQLRIH.js.map} +2 -2
  19. package/dist/react/Rectangle-7KMA3SC6.js +11 -0
  20. package/dist/react/{SceneSerializer-H6KMQCO2.js → SceneSerializer-7O72LEZP.js} +13 -12
  21. package/dist/react/{SceneSerializer-H6KMQCO2.js.map → SceneSerializer-7O72LEZP.js.map} +1 -1
  22. package/dist/react/{Selection-CFWRGVKH.js → Selection-S4FYSZIF.js} +5 -5
  23. package/dist/react/{SketchEngine-UFLZJQXS.js → SketchEngine-VTWURP2K.js} +26 -26
  24. package/dist/react/{UndoRedo-RXO7YHA2.js → UndoRedo-YLQJ6DXW.js} +8 -2
  25. package/dist/react/{ZoomPan-RR7KUYZT.js → ZoomPan-AEKWKUCH.js} +2 -2
  26. package/dist/react/{arrowTool-DO327FKU.js → arrowTool-C4RDWQEX.js} +3 -3
  27. package/dist/react/{chunk-X5ENBMGL.js → chunk-2U47AU6Y.js} +3 -3
  28. package/dist/react/{chunk-X5ENBMGL.js.map → chunk-2U47AU6Y.js.map} +1 -1
  29. package/dist/react/{chunk-RK3NVAER.js → chunk-75OPJOWN.js} +7 -7
  30. package/dist/react/chunk-75OPJOWN.js.map +7 -0
  31. package/dist/react/{chunk-DODPOWNX.js → chunk-CWE5IFG7.js} +5 -5
  32. package/dist/react/{chunk-DODPOWNX.js.map → chunk-CWE5IFG7.js.map} +1 -1
  33. package/dist/react/{chunk-O7KXLFZN.js → chunk-IS2MKWGH.js} +8 -7
  34. package/dist/react/chunk-IS2MKWGH.js.map +7 -0
  35. package/dist/react/{chunk-ZNZAICWY.js → chunk-JEHOEQ6Z.js} +13 -5
  36. package/dist/react/chunk-JEHOEQ6Z.js.map +7 -0
  37. package/dist/react/{chunk-BOZEDUAF.js → chunk-JYBJXTLM.js} +40 -15
  38. package/dist/react/chunk-JYBJXTLM.js.map +7 -0
  39. package/dist/react/{chunk-6LWUR7XB.js → chunk-LXEHYCKH.js} +4 -4
  40. package/dist/react/{chunk-6LWUR7XB.js.map → chunk-LXEHYCKH.js.map} +1 -1
  41. package/dist/react/chunk-M7OYYJC6.js +17 -0
  42. package/dist/react/chunk-M7OYYJC6.js.map +7 -0
  43. package/dist/react/chunk-MS4TIQ6Z.js +131 -0
  44. package/dist/react/chunk-MS4TIQ6Z.js.map +7 -0
  45. package/dist/react/{chunk-2ALS5JGS.js → chunk-OCJN32IL.js} +2 -2
  46. package/dist/react/{chunk-KZBKYHZO.js → chunk-P7VIYR6R.js} +8 -5
  47. package/dist/react/chunk-P7VIYR6R.js.map +7 -0
  48. package/dist/react/{chunk-KC26KJW4.js → chunk-PX2635H5.js} +32 -10
  49. package/dist/react/chunk-PX2635H5.js.map +7 -0
  50. package/dist/react/{chunk-37PF7FG2.js → chunk-SDG4U7TP.js} +7 -6
  51. package/dist/react/chunk-SDG4U7TP.js.map +7 -0
  52. package/dist/react/{chunk-CGMUXYPJ.js → chunk-STJERZ25.js} +8 -4
  53. package/dist/react/chunk-STJERZ25.js.map +7 -0
  54. package/dist/react/{chunk-VZPH7OAM.js → chunk-TCWCC4Z4.js} +7 -3
  55. package/dist/react/chunk-TCWCC4Z4.js.map +7 -0
  56. package/dist/react/{chunk-VZX55VQL.js → chunk-TFCBCWL5.js} +90 -33
  57. package/dist/react/chunk-TFCBCWL5.js.map +7 -0
  58. package/dist/react/{chunk-GQLXUZHQ.js → chunk-TWHJ6PJK.js} +5 -3
  59. package/dist/react/chunk-TWHJ6PJK.js.map +7 -0
  60. package/dist/react/{chunk-NH3NVSWT.js → chunk-UCOK4V5Z.js} +4 -3
  61. package/dist/react/{chunk-NH3NVSWT.js.map → chunk-UCOK4V5Z.js.map} +2 -2
  62. package/dist/react/{chunk-W7XUY4GR.js → chunk-VJDNKJBX.js} +56 -4
  63. package/dist/react/chunk-VJDNKJBX.js.map +7 -0
  64. package/dist/react/{chunk-BT2EIJD4.js → chunk-WCA3FGWE.js} +6 -3
  65. package/dist/react/chunk-WCA3FGWE.js.map +7 -0
  66. package/dist/react/{chunk-I7TVGJFF.js → chunk-Y3FJMYPX.js} +4 -4
  67. package/dist/react/{chunk-I7TVGJFF.js.map → chunk-Y3FJMYPX.js.map} +1 -1
  68. package/dist/react/{chunk-7DD2JRBC.js → chunk-YCGLGY4C.js} +2 -2
  69. package/dist/react/{circleTool-NK4RVDAR.js → circleTool-QQV2QEVF.js} +4 -4
  70. package/dist/react/{codeTool-3WF4HEOW.js → codeTool-PTCPSZ4L.js} +5 -5
  71. package/dist/react/{frameTool-VCNV2NG2.js → frameTool-7GQPLU4Y.js} +4 -4
  72. package/dist/react/{freehandTool-TBAOD46K.js → freehandTool-3RJXTVAK.js} +4 -4
  73. package/dist/react/{iconTool-65JCAKYF.js → iconTool-DW5YJX7P.js} +5 -5
  74. package/dist/react/{imageTool-UQZUBOK2.js → imageTool-7GZQKWYT.js} +5 -5
  75. package/dist/react/index.js +68 -63
  76. package/dist/react/index.js.map +2 -2
  77. package/dist/react/{lineTool-762KBYOM.js → lineTool-5CY7BHND.js} +4 -4
  78. package/dist/react/{rectangleTool-IQK3HZK6.js → rectangleTool-DK4QL4QW.js} +4 -4
  79. package/dist/react/styles.css +4 -0
  80. package/dist/react/{textTool-ITG2SBJK.js → textTool-GP5QQYF3.js} +6 -6
  81. package/package.json +1 -1
  82. package/src/core/CopyPaste.js +66 -18
  83. package/src/core/EventDispatcher.js +71 -47
  84. package/src/core/MermaidFlowchartRenderer.js +34 -8
  85. package/src/core/MermaidSequenceRenderer.js +10 -8
  86. package/src/core/MermaidStructuredRenderer.js +12 -5
  87. package/src/core/ScreenSpaceControls.js +102 -13
  88. package/src/core/Selection.js +26 -7
  89. package/src/core/SelectionGesture.js +50 -0
  90. package/src/core/UndoRedo.js +108 -35
  91. package/src/react/components/sidebars/CircleSidebar.jsx +11 -5
  92. package/src/react/components/sidebars/IconSidebar.jsx +10 -4
  93. package/src/react/components/sidebars/RectangleSidebar.jsx +11 -5
  94. package/src/react/components/sidebars/ShapeSidebar.jsx +29 -37
  95. package/src/react/components/sidebars/TextSidebar.jsx +10 -4
  96. package/src/react/store/useUIStore.js +8 -1
  97. package/src/react/styles.css +13 -0
  98. package/src/react/utils/canvasBackgrounds.js +11 -2
  99. package/src/shapes/Arrow.js +4 -3
  100. package/src/shapes/Circle.js +58 -2
  101. package/src/shapes/Frame.js +11 -4
  102. package/src/shapes/FreehandStroke.js +2 -1
  103. package/src/shapes/Line.js +47 -20
  104. package/src/shapes/Rectangle.js +3 -1
  105. package/src/tools/arrowTool.js +1 -1
  106. package/src/tools/circleTool.js +5 -2
  107. package/src/tools/codeTool.js +1 -1
  108. package/src/tools/frameTool.js +3 -2
  109. package/src/tools/freehandTool.js +1 -1
  110. package/src/tools/iconTool.js +4 -3
  111. package/src/tools/imageTool.js +3 -2
  112. package/src/tools/lineTool.js +5 -1
  113. package/src/tools/rectangleTool.js +1 -1
  114. package/src/tools/shapeRecognitionTool.js +1 -1
  115. package/src/tools/textTool.js +2 -2
  116. package/src/utils/themeColors.js +13 -0
  117. package/dist/react/Arrow-EF7ALH2Y.js +0 -8
  118. package/dist/react/Circle-HMM5PKJ2.js +0 -10
  119. package/dist/react/CopyPaste-PPDS3AD6.js.map +0 -7
  120. package/dist/react/Frame-DELCMYV6.js +0 -11
  121. package/dist/react/FreehandStroke-WXIJKD5I.js +0 -9
  122. package/dist/react/IconShape-PZHMZSLR.js +0 -10
  123. package/dist/react/ImageShape-ZMBZARRI.js +0 -10
  124. package/dist/react/Line-VPVPL6ET.js +0 -10
  125. package/dist/react/Rectangle-4U4CD2ER.js +0 -10
  126. package/dist/react/chunk-37PF7FG2.js.map +0 -7
  127. package/dist/react/chunk-BOZEDUAF.js.map +0 -7
  128. package/dist/react/chunk-BT2EIJD4.js.map +0 -7
  129. package/dist/react/chunk-CGMUXYPJ.js.map +0 -7
  130. package/dist/react/chunk-GQLXUZHQ.js.map +0 -7
  131. package/dist/react/chunk-KC26KJW4.js.map +0 -7
  132. package/dist/react/chunk-KZBKYHZO.js.map +0 -7
  133. package/dist/react/chunk-O7KXLFZN.js.map +0 -7
  134. package/dist/react/chunk-PAKA6HUX.js +0 -59
  135. package/dist/react/chunk-PAKA6HUX.js.map +0 -7
  136. package/dist/react/chunk-RK3NVAER.js.map +0 -7
  137. package/dist/react/chunk-VZPH7OAM.js.map +0 -7
  138. package/dist/react/chunk-VZX55VQL.js.map +0 -7
  139. package/dist/react/chunk-W7XUY4GR.js.map +0 -7
  140. package/dist/react/chunk-ZNZAICWY.js.map +0 -7
  141. /package/dist/react/{AIRenderer-R5M2CIDO.js.map → AIRenderer-JNEZYDYQ.js.map} +0 -0
  142. /package/dist/react/{Arrow-EF7ALH2Y.js.map → Arrow-QMR77LGQ.js.map} +0 -0
  143. /package/dist/react/{Circle-HMM5PKJ2.js.map → Circle-5WL5HZA5.js.map} +0 -0
  144. /package/dist/react/{Frame-DELCMYV6.js.map → Frame-OZCDVPMI.js.map} +0 -0
  145. /package/dist/react/{FreehandStroke-WXIJKD5I.js.map → FreehandStroke-QSSYWBFK.js.map} +0 -0
  146. /package/dist/react/{IconShape-PZHMZSLR.js.map → IconShape-HXUV4VRT.js.map} +0 -0
  147. /package/dist/react/{ImageShape-ZMBZARRI.js.map → ImageShape-JGLT2UGG.js.map} +0 -0
  148. /package/dist/react/{Line-VPVPL6ET.js.map → Line-YONPLUYT.js.map} +0 -0
  149. /package/dist/react/{Rectangle-4U4CD2ER.js.map → Rectangle-7KMA3SC6.js.map} +0 -0
  150. /package/dist/react/{Selection-CFWRGVKH.js.map → Selection-S4FYSZIF.js.map} +0 -0
  151. /package/dist/react/{SketchEngine-UFLZJQXS.js.map → SketchEngine-VTWURP2K.js.map} +0 -0
  152. /package/dist/react/{UndoRedo-RXO7YHA2.js.map → UndoRedo-YLQJ6DXW.js.map} +0 -0
  153. /package/dist/react/{ZoomPan-RR7KUYZT.js.map → ZoomPan-AEKWKUCH.js.map} +0 -0
  154. /package/dist/react/{arrowTool-DO327FKU.js.map → arrowTool-C4RDWQEX.js.map} +0 -0
  155. /package/dist/react/{chunk-2ALS5JGS.js.map → chunk-OCJN32IL.js.map} +0 -0
  156. /package/dist/react/{chunk-7DD2JRBC.js.map → chunk-YCGLGY4C.js.map} +0 -0
  157. /package/dist/react/{circleTool-NK4RVDAR.js.map → circleTool-QQV2QEVF.js.map} +0 -0
  158. /package/dist/react/{codeTool-3WF4HEOW.js.map → codeTool-PTCPSZ4L.js.map} +0 -0
  159. /package/dist/react/{frameTool-VCNV2NG2.js.map → frameTool-7GQPLU4Y.js.map} +0 -0
  160. /package/dist/react/{freehandTool-TBAOD46K.js.map → freehandTool-3RJXTVAK.js.map} +0 -0
  161. /package/dist/react/{iconTool-65JCAKYF.js.map → iconTool-DW5YJX7P.js.map} +0 -0
  162. /package/dist/react/{imageTool-UQZUBOK2.js.map → imageTool-7GZQKWYT.js.map} +0 -0
  163. /package/dist/react/{lineTool-762KBYOM.js.map → lineTool-5CY7BHND.js.map} +0 -0
  164. /package/dist/react/{rectangleTool-IQK3HZK6.js.map → rectangleTool-DK4QL4QW.js.map} +0 -0
  165. /package/dist/react/{textTool-ITG2SBJK.js.map → textTool-GP5QQYF3.js.map} +0 -0
@@ -4,32 +4,32 @@ import {
4
4
  handleTextMouseDown,
5
5
  handleTextMouseMove,
6
6
  handleTextMouseUp
7
- } from "./chunk-RK3NVAER.js";
7
+ } from "./chunk-75OPJOWN.js";
8
8
  import {
9
9
  handleCodeMouseDown,
10
10
  handleCodeMouseMove,
11
11
  handleCodeMouseUp
12
- } from "./chunk-DODPOWNX.js";
12
+ } from "./chunk-CWE5IFG7.js";
13
13
  import {
14
14
  handleMouseDownImage,
15
15
  handleMouseMoveImage,
16
16
  handleMouseUpImage
17
- } from "./chunk-37PF7FG2.js";
17
+ } from "./chunk-SDG4U7TP.js";
18
18
  import {
19
19
  handleMouseDownIcon,
20
20
  handleMouseMoveIcon,
21
21
  handleMouseUpIcon
22
- } from "./chunk-O7KXLFZN.js";
22
+ } from "./chunk-IS2MKWGH.js";
23
23
  import {
24
24
  handleMouseDown as handleMouseDown4,
25
25
  handleMouseMove as handleMouseMove4,
26
26
  handleMouseUp as handleMouseUp4
27
- } from "./chunk-GQLXUZHQ.js";
27
+ } from "./chunk-TWHJ6PJK.js";
28
28
  import {
29
29
  handleMouseDown as handleMouseDown5,
30
30
  handleMouseMove as handleMouseMove5,
31
31
  handleMouseUp as handleMouseUp5
32
- } from "./chunk-6LWUR7XB.js";
32
+ } from "./chunk-LXEHYCKH.js";
33
33
  import {
34
34
  handleMultiSelectionMouseDown,
35
35
  handleMultiSelectionMouseMove,
@@ -37,40 +37,40 @@ import {
37
37
  isMultiSelecting,
38
38
  multiSelection,
39
39
  removeMultiSelectionRect
40
- } from "./chunk-KC26KJW4.js";
40
+ } from "./chunk-PX2635H5.js";
41
41
  import {
42
42
  Frame
43
- } from "./chunk-ZNZAICWY.js";
43
+ } from "./chunk-JEHOEQ6Z.js";
44
44
  import {
45
45
  handleMouseDownRect,
46
46
  handleMouseMoveRect,
47
47
  handleMouseUpRect
48
- } from "./chunk-I7TVGJFF.js";
48
+ } from "./chunk-Y3FJMYPX.js";
49
49
  import {
50
50
  handleMouseDown as handleMouseDown2,
51
51
  handleMouseMove as handleMouseMove2,
52
52
  handleMouseUp as handleMouseUp2
53
- } from "./chunk-KZBKYHZO.js";
53
+ } from "./chunk-P7VIYR6R.js";
54
54
  import {
55
55
  handleMouseDown as handleMouseDown3,
56
56
  handleMouseMove as handleMouseMove3,
57
57
  handleMouseUp as handleMouseUp3
58
- } from "./chunk-CGMUXYPJ.js";
58
+ } from "./chunk-STJERZ25.js";
59
59
  import {
60
60
  normalizeWebEmbedUrl
61
61
  } from "./chunk-QZI4UIE5.js";
62
62
  import "./chunk-DNAG7ML6.js";
63
- import "./chunk-PAKA6HUX.js";
63
+ import "./chunk-MS4TIQ6Z.js";
64
64
  import {
65
65
  handleMouseDown,
66
66
  handleMouseMove,
67
67
  handleMouseUp
68
- } from "./chunk-X5ENBMGL.js";
68
+ } from "./chunk-2U47AU6Y.js";
69
69
  import {
70
70
  pushCreateAction,
71
71
  pushFrameAttachmentAction,
72
72
  pushOptionsChangeAction
73
- } from "./chunk-VZX55VQL.js";
73
+ } from "./chunk-TFCBCWL5.js";
74
74
 
75
75
  // src/tools/shapeRecognition.js
76
76
  var MIN_SHAPE_SIZE2 = 8;
@@ -325,7 +325,7 @@ var previewPath = null;
325
325
  var previewFrame = 0;
326
326
  var latestPrediction = null;
327
327
  function getThemeStroke() {
328
- return document.body?.classList.contains("theme-dark") ? "#f7f4ff" : "#211a33";
328
+ return document.body?.classList.contains("theme-dark") ? "#f7f4ff" : "#000000";
329
329
  }
330
330
  function getSVGPoint(event) {
331
331
  const viewBox = svg.viewBox.baseVal;
@@ -821,7 +821,77 @@ function handleWebEmbedUp() {
821
821
  }
822
822
  window.__placeWebEmbed = placeWebEmbed;
823
823
 
824
+ // src/core/SelectionGesture.js
825
+ function normalizePointerId(pointerId) {
826
+ return Number.isFinite(Number(pointerId)) ? Number(pointerId) : null;
827
+ }
828
+ function createSelectionGestureOwner() {
829
+ let activeGesture = null;
830
+ return {
831
+ captureShape(shape, pointerId) {
832
+ if (!shape) return null;
833
+ activeGesture = {
834
+ kind: "shape",
835
+ shape,
836
+ shapeName: shape.shapeName,
837
+ pointerId: normalizePointerId(pointerId)
838
+ };
839
+ return activeGesture;
840
+ },
841
+ captureMulti(pointerId) {
842
+ activeGesture = {
843
+ kind: "multi",
844
+ pointerId: normalizePointerId(pointerId)
845
+ };
846
+ return activeGesture;
847
+ },
848
+ get(pointerId) {
849
+ if (!activeGesture) return null;
850
+ const requestedPointer = normalizePointerId(pointerId);
851
+ if (activeGesture.pointerId !== null && requestedPointer !== null && activeGesture.pointerId !== requestedPointer) {
852
+ return null;
853
+ }
854
+ return activeGesture;
855
+ },
856
+ clear(pointerId) {
857
+ const gesture = this.get(pointerId);
858
+ if (!gesture) return false;
859
+ activeGesture = null;
860
+ return true;
861
+ },
862
+ clearAll() {
863
+ activeGesture = null;
864
+ }
865
+ };
866
+ }
867
+
824
868
  // src/core/EventDispatcher.js
869
+ var selectionGestureOwner = createSelectionGestureOwner();
870
+ var shapePointerHandlers = {
871
+ rectangle: { down: handleMouseDownRect, move: handleMouseMoveRect, up: handleMouseUpRect },
872
+ arrow: { down: handleMouseDown, move: handleMouseMove, up: handleMouseUp },
873
+ circle: { down: handleMouseDown2, move: handleMouseMove2, up: handleMouseUp2 },
874
+ image: { down: handleMouseDownImage, move: handleMouseMoveImage, up: handleMouseUpImage },
875
+ line: { down: handleMouseDown3, move: handleMouseMove3, up: handleMouseUp3 },
876
+ freehandStroke: { down: handleMouseDown5, move: handleMouseMove5, up: handleMouseUp5 },
877
+ text: { down: handleTextMouseDown, move: handleTextMouseMove, up: handleTextMouseUp },
878
+ frame: { down: handleMouseDown4, move: handleMouseMove4, up: handleMouseUp4 },
879
+ icon: { down: handleMouseDownIcon, move: handleMouseMoveIcon, up: handleMouseUpIcon },
880
+ code: { down: handleCodeMouseDown, move: handleCodeMouseMove, up: handleCodeMouseUp }
881
+ };
882
+ function routeShapePointer(phase, event, shape = currentShape) {
883
+ const handler = shapePointerHandlers[shape?.shapeName]?.[phase];
884
+ if (!handler) return false;
885
+ handler(event);
886
+ return true;
887
+ }
888
+ function captureSelectionGesture(event) {
889
+ if (isMultiSelecting || multiSelection.isDragging || multiSelection.isResizing || multiSelection.isRotating) {
890
+ selectionGestureOwner.captureMulti(event.pointerId);
891
+ } else if (currentShape?.isSelected) {
892
+ selectionGestureOwner.captureShape(currentShape, event.pointerId);
893
+ }
894
+ }
825
895
  var EDGE_THRESHOLD = 40;
826
896
  var SCROLL_SPEED = 8;
827
897
  var _autoScrollRAF = null;
@@ -880,6 +950,7 @@ function _onDocumentDragMove(e) {
880
950
  const clampedX = Math.max(rect.left, Math.min(rect.right, e.clientX));
881
951
  const clampedY = Math.max(rect.top, Math.min(rect.bottom, e.clientY));
882
952
  const clampedEvent = new PointerEvent(e.type, {
953
+ pointerId: e.pointerId,
883
954
  clientX: clampedX,
884
955
  clientY: clampedY,
885
956
  buttons: e.buttons,
@@ -901,6 +972,7 @@ function _onDocumentDragUp(e) {
901
972
  var handleMainMouseDown = (e) => {
902
973
  if (!e.target) return;
903
974
  if (e.button === 1 || e.button === 2 || window.__spacePanActive) return;
975
+ selectionGestureOwner.clearAll();
904
976
  removeMultiSelectionRect();
905
977
  if (!isSelectionToolActive) {
906
978
  if (multiSelection.selectedShapes.size > 0) {
@@ -950,66 +1022,67 @@ var handleMainMouseDown = (e) => {
950
1022
  handleMouseDownIcon(e);
951
1023
  } else if (isSelectionToolActive) {
952
1024
  if (handleMultiSelectionMouseDown(e)) {
1025
+ captureSelectionGesture(e);
953
1026
  return;
954
1027
  }
955
1028
  const prevShape = currentShape;
956
1029
  let handled = false;
957
- if (currentShape?.shapeName === "rectangle") {
958
- handleMouseDownRect(e);
959
- handled = true;
960
- } else if (currentShape?.shapeName === "arrow") {
961
- handleMouseDown(e);
962
- handled = true;
963
- } else if (currentShape?.shapeName === "circle") {
964
- handleMouseDown2(e);
965
- handled = true;
966
- } else if (currentShape?.shapeName === "image") {
967
- handleMouseDownImage(e);
968
- handled = true;
969
- } else if (currentShape?.shapeName === "line") {
970
- handleMouseDown3(e);
971
- handled = true;
972
- } else if (currentShape?.shapeName === "freehandStroke") {
973
- handleMouseDown5(e);
974
- handled = true;
975
- } else if (currentShape?.shapeName === "text") {
976
- handleTextMouseDown(e);
977
- handled = true;
978
- } else if (currentShape?.shapeName === "frame") {
979
- handleMouseDown4(e);
980
- handled = true;
981
- } else if (currentShape?.shapeName === "icon") {
982
- handleMouseDownIcon(e);
983
- handled = true;
984
- } else if (currentShape?.shapeName === "code") {
985
- handleCodeMouseDown(e);
986
- handled = true;
987
- }
1030
+ handled = routeShapePointer("down", e);
988
1031
  if (handled && prevShape && !currentShape) {
989
1032
  handled = false;
990
1033
  }
991
1034
  if (!handled) {
992
1035
  const originalCurrentShape = currentShape;
993
1036
  handleMouseDownRect(e);
994
- if (currentShape && currentShape !== originalCurrentShape) return;
1037
+ if (currentShape && currentShape !== originalCurrentShape) {
1038
+ captureSelectionGesture(e);
1039
+ return;
1040
+ }
995
1041
  handleMouseDown2(e);
996
- if (currentShape && currentShape !== originalCurrentShape) return;
1042
+ if (currentShape && currentShape !== originalCurrentShape) {
1043
+ captureSelectionGesture(e);
1044
+ return;
1045
+ }
997
1046
  handleMouseDown(e);
998
- if (currentShape && currentShape !== originalCurrentShape) return;
1047
+ if (currentShape && currentShape !== originalCurrentShape) {
1048
+ captureSelectionGesture(e);
1049
+ return;
1050
+ }
999
1051
  handleMouseDownImage(e);
1000
- if (currentShape && currentShape !== originalCurrentShape) return;
1052
+ if (currentShape && currentShape !== originalCurrentShape) {
1053
+ captureSelectionGesture(e);
1054
+ return;
1055
+ }
1001
1056
  handleMouseDown3(e);
1002
- if (currentShape && currentShape !== originalCurrentShape) return;
1057
+ if (currentShape && currentShape !== originalCurrentShape) {
1058
+ captureSelectionGesture(e);
1059
+ return;
1060
+ }
1003
1061
  handleMouseDown5(e);
1004
- if (currentShape && currentShape !== originalCurrentShape) return;
1062
+ if (currentShape && currentShape !== originalCurrentShape) {
1063
+ captureSelectionGesture(e);
1064
+ return;
1065
+ }
1005
1066
  handleTextMouseDown(e);
1006
- if (currentShape && currentShape !== originalCurrentShape) return;
1067
+ if (currentShape && currentShape !== originalCurrentShape) {
1068
+ captureSelectionGesture(e);
1069
+ return;
1070
+ }
1007
1071
  handleMouseDown4(e);
1008
- if (currentShape && currentShape !== originalCurrentShape) return;
1072
+ if (currentShape && currentShape !== originalCurrentShape) {
1073
+ captureSelectionGesture(e);
1074
+ return;
1075
+ }
1009
1076
  handleMouseDownIcon(e);
1010
- if (currentShape && currentShape !== originalCurrentShape) return;
1077
+ if (currentShape && currentShape !== originalCurrentShape) {
1078
+ captureSelectionGesture(e);
1079
+ return;
1080
+ }
1011
1081
  handleCodeMouseDown(e);
1012
- if (currentShape && currentShape !== originalCurrentShape) return;
1082
+ if (currentShape && currentShape !== originalCurrentShape) {
1083
+ captureSelectionGesture(e);
1084
+ return;
1085
+ }
1013
1086
  if (currentShape === originalCurrentShape) {
1014
1087
  if (currentShape) {
1015
1088
  currentShape.removeSelection();
@@ -1017,6 +1090,7 @@ var handleMainMouseDown = (e) => {
1017
1090
  }
1018
1091
  }
1019
1092
  }
1093
+ captureSelectionGesture(e);
1020
1094
  }
1021
1095
  };
1022
1096
  var handleMainMouseMove = (e) => {
@@ -1055,6 +1129,15 @@ var handleMainMouseMove = (e) => {
1055
1129
  } else if (isIconToolActive) {
1056
1130
  handleMouseMoveIcon(e);
1057
1131
  } else if (isSelectionToolActive) {
1132
+ const activeGesture = selectionGestureOwner.get(e.pointerId);
1133
+ if (activeGesture) {
1134
+ if (activeGesture.kind === "multi") {
1135
+ handleMultiSelectionMouseMove(e);
1136
+ } else if (currentShape === activeGesture.shape && currentShape?.isSelected) {
1137
+ routeShapePointer("move", e, activeGesture.shape);
1138
+ }
1139
+ return;
1140
+ }
1058
1141
  if (isMultiSelecting || multiSelection.isDragging || multiSelection.isResizing || multiSelection.isRotating) {
1059
1142
  if (handleMultiSelectionMouseMove(e)) {
1060
1143
  return;
@@ -1128,6 +1211,19 @@ var handleMainMouseUp = (e) => {
1128
1211
  } else if (isIconToolActive) {
1129
1212
  handleMouseUpIcon(e);
1130
1213
  } else if (isSelectionToolActive) {
1214
+ const activeGesture = selectionGestureOwner.get(e.pointerId);
1215
+ if (activeGesture) {
1216
+ try {
1217
+ if (activeGesture.kind === "multi") {
1218
+ handleMultiSelectionMouseUp(e);
1219
+ } else if (currentShape === activeGesture.shape) {
1220
+ routeShapePointer("up", e, activeGesture.shape);
1221
+ }
1222
+ } finally {
1223
+ selectionGestureOwner.clear(e.pointerId);
1224
+ }
1225
+ return;
1226
+ }
1131
1227
  if (isMultiSelecting || multiSelection.isDragging || multiSelection.isResizing || multiSelection.isRotating) {
1132
1228
  handleMultiSelectionMouseUp(e);
1133
1229
  return;
@@ -1221,6 +1317,7 @@ function initEventDispatcher(svgEl) {
1221
1317
  }
1222
1318
  function cleanupEventDispatcher() {
1223
1319
  _stopAutoScroll();
1320
+ selectionGestureOwner.clearAll();
1224
1321
  if (_documentDragActive) {
1225
1322
  document.removeEventListener("pointermove", _onDocumentDragMove);
1226
1323
  document.removeEventListener("pointerup", _onDocumentDragUp);
@@ -1247,4 +1344,4 @@ export {
1247
1344
  handleMainMouseUp,
1248
1345
  initEventDispatcher
1249
1346
  };
1250
- //# sourceMappingURL=EventDispatcher-UV7LFSAS.js.map
1347
+ //# sourceMappingURL=EventDispatcher-E4OJCMY6.js.map