@elixpo/lixsketch 5.6.10 → 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.
- package/dist/react/{AIRenderer-R5M2CIDO.js → AIRenderer-JNEZYDYQ.js} +4 -4
- package/dist/react/Arrow-QMR77LGQ.js +9 -0
- package/dist/react/Circle-5WL5HZA5.js +11 -0
- package/dist/react/{CopyPaste-N4U2NTQT.js → CopyPaste-V7AY56H3.js} +74 -30
- package/dist/react/CopyPaste-V7AY56H3.js.map +7 -0
- package/dist/react/{EventDispatcher-J657SDW4.js → EventDispatcher-E4OJCMY6.js} +153 -56
- package/dist/react/{EventDispatcher-J657SDW4.js.map → EventDispatcher-E4OJCMY6.js.map} +3 -3
- package/dist/react/Frame-OZCDVPMI.js +11 -0
- package/dist/react/FreehandStroke-QSSYWBFK.js +9 -0
- package/dist/react/IconShape-HXUV4VRT.js +10 -0
- package/dist/react/ImageShape-JGLT2UGG.js +10 -0
- package/dist/react/Line-YONPLUYT.js +11 -0
- package/dist/react/{MermaidFlowchartRenderer-EL3Q2MNW.js → MermaidFlowchartRenderer-FSH43RUP.js} +26 -7
- package/dist/react/{MermaidFlowchartRenderer-EL3Q2MNW.js.map → MermaidFlowchartRenderer-FSH43RUP.js.map} +2 -2
- package/dist/react/{MermaidSequenceRenderer-K4KHHEVC.js → MermaidSequenceRenderer-FRPNOF2V.js} +11 -9
- package/dist/react/{MermaidSequenceRenderer-K4KHHEVC.js.map → MermaidSequenceRenderer-FRPNOF2V.js.map} +2 -2
- package/dist/react/{MermaidStructuredRenderer-6LN3WISP.js → MermaidStructuredRenderer-BZGQLRIH.js} +13 -6
- package/dist/react/{MermaidStructuredRenderer-6LN3WISP.js.map → MermaidStructuredRenderer-BZGQLRIH.js.map} +2 -2
- package/dist/react/Rectangle-7KMA3SC6.js +11 -0
- package/dist/react/{SceneSerializer-Y6QABGZY.js → SceneSerializer-7O72LEZP.js} +13 -12
- package/dist/react/{SceneSerializer-Y6QABGZY.js.map → SceneSerializer-7O72LEZP.js.map} +1 -1
- package/dist/react/{Selection-GCZWCNAR.js → Selection-S4FYSZIF.js} +5 -5
- package/dist/react/{SketchEngine-PCMCE63L.js → SketchEngine-VTWURP2K.js} +26 -26
- package/dist/react/{UndoRedo-RXO7YHA2.js → UndoRedo-YLQJ6DXW.js} +8 -2
- package/dist/react/{ZoomPan-RR7KUYZT.js → ZoomPan-AEKWKUCH.js} +2 -2
- package/dist/react/{arrowTool-UN3TNJFP.js → arrowTool-C4RDWQEX.js} +3 -3
- package/dist/react/{chunk-KXLNEFN5.js → chunk-2U47AU6Y.js} +2 -2
- package/dist/react/{chunk-YHQ4ZAJQ.js → chunk-75OPJOWN.js} +6 -6
- package/dist/react/chunk-75OPJOWN.js.map +7 -0
- package/dist/react/{chunk-P5476S5I.js → chunk-CWE5IFG7.js} +4 -4
- package/dist/react/{chunk-3FCIBY54.js → chunk-IS2MKWGH.js} +8 -7
- package/dist/react/chunk-IS2MKWGH.js.map +7 -0
- package/dist/react/{chunk-ZNZAICWY.js → chunk-JEHOEQ6Z.js} +13 -5
- package/dist/react/chunk-JEHOEQ6Z.js.map +7 -0
- package/dist/react/{chunk-TAJ5E6KI.js → chunk-JYBJXTLM.js} +39 -14
- package/dist/react/chunk-JYBJXTLM.js.map +7 -0
- package/dist/react/{chunk-3PFVMNDJ.js → chunk-LXEHYCKH.js} +3 -3
- package/dist/react/chunk-M7OYYJC6.js +17 -0
- package/dist/react/chunk-M7OYYJC6.js.map +7 -0
- package/dist/react/chunk-MS4TIQ6Z.js +131 -0
- package/dist/react/chunk-MS4TIQ6Z.js.map +7 -0
- package/dist/react/{chunk-5XGQ3CMT.js → chunk-OCJN32IL.js} +2 -2
- package/dist/react/{chunk-7NHZYKYB.js → chunk-P7VIYR6R.js} +7 -4
- package/dist/react/chunk-P7VIYR6R.js.map +7 -0
- package/dist/react/{chunk-UERV53R7.js → chunk-PX2635H5.js} +32 -10
- package/dist/react/chunk-PX2635H5.js.map +7 -0
- package/dist/react/{chunk-KACRJ6AJ.js → chunk-SDG4U7TP.js} +7 -6
- package/dist/react/chunk-SDG4U7TP.js.map +7 -0
- package/dist/react/{chunk-JVHZVV5U.js → chunk-STJERZ25.js} +7 -3
- package/dist/react/chunk-STJERZ25.js.map +7 -0
- package/dist/react/{chunk-VZPH7OAM.js → chunk-TCWCC4Z4.js} +7 -3
- package/dist/react/chunk-TCWCC4Z4.js.map +7 -0
- package/dist/react/{chunk-VZX55VQL.js → chunk-TFCBCWL5.js} +90 -33
- package/dist/react/chunk-TFCBCWL5.js.map +7 -0
- package/dist/react/{chunk-GQLXUZHQ.js → chunk-TWHJ6PJK.js} +5 -3
- package/dist/react/chunk-TWHJ6PJK.js.map +7 -0
- package/dist/react/{chunk-NH3NVSWT.js → chunk-UCOK4V5Z.js} +4 -3
- package/dist/react/{chunk-NH3NVSWT.js.map → chunk-UCOK4V5Z.js.map} +2 -2
- package/dist/react/{chunk-W7XUY4GR.js → chunk-VJDNKJBX.js} +56 -4
- package/dist/react/chunk-VJDNKJBX.js.map +7 -0
- package/dist/react/{chunk-BT2EIJD4.js → chunk-WCA3FGWE.js} +6 -3
- package/dist/react/chunk-WCA3FGWE.js.map +7 -0
- package/dist/react/{chunk-7WXEWDRL.js → chunk-Y3FJMYPX.js} +3 -3
- package/dist/react/{chunk-ULZW5PXM.js → chunk-YCGLGY4C.js} +2 -2
- package/dist/react/{circleTool-YDTQDGYX.js → circleTool-QQV2QEVF.js} +4 -4
- package/dist/react/{codeTool-U6SYKHHD.js → codeTool-PTCPSZ4L.js} +5 -5
- package/dist/react/{frameTool-VRI7OODN.js → frameTool-7GQPLU4Y.js} +4 -4
- package/dist/react/{freehandTool-2ICCQHVY.js → freehandTool-3RJXTVAK.js} +4 -4
- package/dist/react/{iconTool-32D5NJ4I.js → iconTool-DW5YJX7P.js} +5 -5
- package/dist/react/{imageTool-Z6Y4OXBG.js → imageTool-7GZQKWYT.js} +5 -5
- package/dist/react/index.js +49 -56
- package/dist/react/index.js.map +2 -2
- package/dist/react/{lineTool-BUWVQ666.js → lineTool-5CY7BHND.js} +4 -4
- package/dist/react/{rectangleTool-NJYG6Y6L.js → rectangleTool-DK4QL4QW.js} +4 -4
- package/dist/react/{textTool-CIJCF4Z3.js → textTool-GP5QQYF3.js} +6 -6
- package/package.json +1 -1
- package/src/core/CopyPaste.js +66 -18
- package/src/core/EventDispatcher.js +71 -47
- package/src/core/MermaidFlowchartRenderer.js +34 -8
- package/src/core/MermaidSequenceRenderer.js +10 -8
- package/src/core/MermaidStructuredRenderer.js +12 -5
- package/src/core/ScreenSpaceControls.js +102 -13
- package/src/core/Selection.js +26 -7
- package/src/core/SelectionGesture.js +50 -0
- package/src/core/UndoRedo.js +108 -35
- package/src/react/components/sidebars/CircleSidebar.jsx +11 -5
- package/src/react/components/sidebars/IconSidebar.jsx +10 -4
- package/src/react/components/sidebars/RectangleSidebar.jsx +11 -5
- package/src/react/components/sidebars/ShapeSidebar.jsx +29 -37
- package/src/react/store/useUIStore.js +7 -0
- package/src/shapes/Arrow.js +4 -3
- package/src/shapes/Circle.js +58 -2
- package/src/shapes/Frame.js +11 -4
- package/src/shapes/FreehandStroke.js +2 -1
- package/src/shapes/Line.js +45 -18
- package/src/shapes/Rectangle.js +3 -1
- package/src/tools/circleTool.js +4 -1
- package/src/tools/frameTool.js +3 -2
- package/src/tools/iconTool.js +4 -3
- package/src/tools/imageTool.js +3 -2
- package/src/tools/lineTool.js +4 -0
- package/src/tools/textTool.js +1 -1
- package/src/utils/themeColors.js +13 -0
- package/dist/react/Arrow-EF7ALH2Y.js +0 -8
- package/dist/react/Circle-HMM5PKJ2.js +0 -10
- package/dist/react/CopyPaste-N4U2NTQT.js.map +0 -7
- package/dist/react/Frame-NHPESH4Y.js +0 -11
- package/dist/react/FreehandStroke-WXIJKD5I.js +0 -9
- package/dist/react/IconShape-RN5HJDUF.js +0 -10
- package/dist/react/ImageShape-L7U64AVP.js +0 -10
- package/dist/react/Line-LPRTGPUQ.js +0 -10
- package/dist/react/Rectangle-4U4CD2ER.js +0 -10
- package/dist/react/chunk-3FCIBY54.js.map +0 -7
- package/dist/react/chunk-7NHZYKYB.js.map +0 -7
- package/dist/react/chunk-BT2EIJD4.js.map +0 -7
- package/dist/react/chunk-GQLXUZHQ.js.map +0 -7
- package/dist/react/chunk-JVHZVV5U.js.map +0 -7
- package/dist/react/chunk-KACRJ6AJ.js.map +0 -7
- package/dist/react/chunk-PAKA6HUX.js +0 -59
- package/dist/react/chunk-PAKA6HUX.js.map +0 -7
- package/dist/react/chunk-TAJ5E6KI.js.map +0 -7
- package/dist/react/chunk-UERV53R7.js.map +0 -7
- package/dist/react/chunk-VZPH7OAM.js.map +0 -7
- package/dist/react/chunk-VZX55VQL.js.map +0 -7
- package/dist/react/chunk-W7XUY4GR.js.map +0 -7
- package/dist/react/chunk-YHQ4ZAJQ.js.map +0 -7
- package/dist/react/chunk-ZNZAICWY.js.map +0 -7
- /package/dist/react/{AIRenderer-R5M2CIDO.js.map → AIRenderer-JNEZYDYQ.js.map} +0 -0
- /package/dist/react/{Arrow-EF7ALH2Y.js.map → Arrow-QMR77LGQ.js.map} +0 -0
- /package/dist/react/{Circle-HMM5PKJ2.js.map → Circle-5WL5HZA5.js.map} +0 -0
- /package/dist/react/{Frame-NHPESH4Y.js.map → Frame-OZCDVPMI.js.map} +0 -0
- /package/dist/react/{FreehandStroke-WXIJKD5I.js.map → FreehandStroke-QSSYWBFK.js.map} +0 -0
- /package/dist/react/{IconShape-RN5HJDUF.js.map → IconShape-HXUV4VRT.js.map} +0 -0
- /package/dist/react/{ImageShape-L7U64AVP.js.map → ImageShape-JGLT2UGG.js.map} +0 -0
- /package/dist/react/{Line-LPRTGPUQ.js.map → Line-YONPLUYT.js.map} +0 -0
- /package/dist/react/{Rectangle-4U4CD2ER.js.map → Rectangle-7KMA3SC6.js.map} +0 -0
- /package/dist/react/{Selection-GCZWCNAR.js.map → Selection-S4FYSZIF.js.map} +0 -0
- /package/dist/react/{SketchEngine-PCMCE63L.js.map → SketchEngine-VTWURP2K.js.map} +0 -0
- /package/dist/react/{UndoRedo-RXO7YHA2.js.map → UndoRedo-YLQJ6DXW.js.map} +0 -0
- /package/dist/react/{ZoomPan-RR7KUYZT.js.map → ZoomPan-AEKWKUCH.js.map} +0 -0
- /package/dist/react/{arrowTool-UN3TNJFP.js.map → arrowTool-C4RDWQEX.js.map} +0 -0
- /package/dist/react/{chunk-KXLNEFN5.js.map → chunk-2U47AU6Y.js.map} +0 -0
- /package/dist/react/{chunk-P5476S5I.js.map → chunk-CWE5IFG7.js.map} +0 -0
- /package/dist/react/{chunk-3PFVMNDJ.js.map → chunk-LXEHYCKH.js.map} +0 -0
- /package/dist/react/{chunk-5XGQ3CMT.js.map → chunk-OCJN32IL.js.map} +0 -0
- /package/dist/react/{chunk-7WXEWDRL.js.map → chunk-Y3FJMYPX.js.map} +0 -0
- /package/dist/react/{chunk-ULZW5PXM.js.map → chunk-YCGLGY4C.js.map} +0 -0
- /package/dist/react/{circleTool-YDTQDGYX.js.map → circleTool-QQV2QEVF.js.map} +0 -0
- /package/dist/react/{codeTool-U6SYKHHD.js.map → codeTool-PTCPSZ4L.js.map} +0 -0
- /package/dist/react/{frameTool-VRI7OODN.js.map → frameTool-7GQPLU4Y.js.map} +0 -0
- /package/dist/react/{freehandTool-2ICCQHVY.js.map → freehandTool-3RJXTVAK.js.map} +0 -0
- /package/dist/react/{iconTool-32D5NJ4I.js.map → iconTool-DW5YJX7P.js.map} +0 -0
- /package/dist/react/{imageTool-Z6Y4OXBG.js.map → imageTool-7GZQKWYT.js.map} +0 -0
- /package/dist/react/{lineTool-BUWVQ666.js.map → lineTool-5CY7BHND.js.map} +0 -0
- /package/dist/react/{rectangleTool-NJYG6Y6L.js.map → rectangleTool-DK4QL4QW.js.map} +0 -0
- /package/dist/react/{textTool-CIJCF4Z3.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-
|
|
7
|
+
} from "./chunk-75OPJOWN.js";
|
|
8
8
|
import {
|
|
9
9
|
handleCodeMouseDown,
|
|
10
10
|
handleCodeMouseMove,
|
|
11
11
|
handleCodeMouseUp
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CWE5IFG7.js";
|
|
13
13
|
import {
|
|
14
14
|
handleMouseDownImage,
|
|
15
15
|
handleMouseMoveImage,
|
|
16
16
|
handleMouseUpImage
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-SDG4U7TP.js";
|
|
18
18
|
import {
|
|
19
19
|
handleMouseDownIcon,
|
|
20
20
|
handleMouseMoveIcon,
|
|
21
21
|
handleMouseUpIcon
|
|
22
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
40
|
+
} from "./chunk-PX2635H5.js";
|
|
41
41
|
import {
|
|
42
42
|
Frame
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-JEHOEQ6Z.js";
|
|
44
44
|
import {
|
|
45
45
|
handleMouseDownRect,
|
|
46
46
|
handleMouseMoveRect,
|
|
47
47
|
handleMouseUpRect
|
|
48
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
63
|
+
import "./chunk-MS4TIQ6Z.js";
|
|
64
64
|
import {
|
|
65
65
|
handleMouseDown,
|
|
66
66
|
handleMouseMove,
|
|
67
67
|
handleMouseUp
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-2U47AU6Y.js";
|
|
69
69
|
import {
|
|
70
70
|
pushCreateAction,
|
|
71
71
|
pushFrameAttachmentAction,
|
|
72
72
|
pushOptionsChangeAction
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-TFCBCWL5.js";
|
|
74
74
|
|
|
75
75
|
// src/tools/shapeRecognition.js
|
|
76
76
|
var MIN_SHAPE_SIZE2 = 8;
|
|
@@ -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
|
-
|
|
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)
|
|
1037
|
+
if (currentShape && currentShape !== originalCurrentShape) {
|
|
1038
|
+
captureSelectionGesture(e);
|
|
1039
|
+
return;
|
|
1040
|
+
}
|
|
995
1041
|
handleMouseDown2(e);
|
|
996
|
-
if (currentShape && currentShape !== originalCurrentShape)
|
|
1042
|
+
if (currentShape && currentShape !== originalCurrentShape) {
|
|
1043
|
+
captureSelectionGesture(e);
|
|
1044
|
+
return;
|
|
1045
|
+
}
|
|
997
1046
|
handleMouseDown(e);
|
|
998
|
-
if (currentShape && currentShape !== originalCurrentShape)
|
|
1047
|
+
if (currentShape && currentShape !== originalCurrentShape) {
|
|
1048
|
+
captureSelectionGesture(e);
|
|
1049
|
+
return;
|
|
1050
|
+
}
|
|
999
1051
|
handleMouseDownImage(e);
|
|
1000
|
-
if (currentShape && currentShape !== originalCurrentShape)
|
|
1052
|
+
if (currentShape && currentShape !== originalCurrentShape) {
|
|
1053
|
+
captureSelectionGesture(e);
|
|
1054
|
+
return;
|
|
1055
|
+
}
|
|
1001
1056
|
handleMouseDown3(e);
|
|
1002
|
-
if (currentShape && currentShape !== originalCurrentShape)
|
|
1057
|
+
if (currentShape && currentShape !== originalCurrentShape) {
|
|
1058
|
+
captureSelectionGesture(e);
|
|
1059
|
+
return;
|
|
1060
|
+
}
|
|
1003
1061
|
handleMouseDown5(e);
|
|
1004
|
-
if (currentShape && currentShape !== originalCurrentShape)
|
|
1062
|
+
if (currentShape && currentShape !== originalCurrentShape) {
|
|
1063
|
+
captureSelectionGesture(e);
|
|
1064
|
+
return;
|
|
1065
|
+
}
|
|
1005
1066
|
handleTextMouseDown(e);
|
|
1006
|
-
if (currentShape && currentShape !== originalCurrentShape)
|
|
1067
|
+
if (currentShape && currentShape !== originalCurrentShape) {
|
|
1068
|
+
captureSelectionGesture(e);
|
|
1069
|
+
return;
|
|
1070
|
+
}
|
|
1007
1071
|
handleMouseDown4(e);
|
|
1008
|
-
if (currentShape && currentShape !== originalCurrentShape)
|
|
1072
|
+
if (currentShape && currentShape !== originalCurrentShape) {
|
|
1073
|
+
captureSelectionGesture(e);
|
|
1074
|
+
return;
|
|
1075
|
+
}
|
|
1009
1076
|
handleMouseDownIcon(e);
|
|
1010
|
-
if (currentShape && currentShape !== originalCurrentShape)
|
|
1077
|
+
if (currentShape && currentShape !== originalCurrentShape) {
|
|
1078
|
+
captureSelectionGesture(e);
|
|
1079
|
+
return;
|
|
1080
|
+
}
|
|
1011
1081
|
handleCodeMouseDown(e);
|
|
1012
|
-
if (currentShape && currentShape !== originalCurrentShape)
|
|
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-
|
|
1347
|
+
//# sourceMappingURL=EventDispatcher-E4OJCMY6.js.map
|