@myoc/excalidraw 0.19.504 → 0.19.506
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/CHANGELOG.md +160 -0
- package/dist/dev/{chunk-Z5DMFRJ5.js → chunk-CUCA2WKB.js} +8 -7
- package/dist/dev/{chunk-Z5DMFRJ5.js.map → chunk-CUCA2WKB.js.map} +2 -2
- package/dist/dev/{chunk-OF725VHI.js → chunk-KCN2IL3S.js} +2 -2
- package/dist/dev/data/{image-ZR5DXOGS.js → image-KG7C5ZXU.js} +3 -3
- package/dist/dev/index.css +12 -0
- package/dist/dev/index.css.map +2 -2
- package/dist/dev/index.js +252 -273
- package/dist/dev/index.js.map +3 -3
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/{chunk-KG57QRSG.js → chunk-74H5OWWZ.js} +1 -1
- package/dist/prod/{chunk-44LLHLSZ.js → chunk-DAHBMDEO.js} +3 -3
- package/dist/prod/data/image-OZR7E4WV.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +17 -17
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/excalidraw/actions/actionStyles.d.ts +2 -4
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +1 -2
- package/dist/types/excalidraw/components/App.d.ts +8 -0
- package/dist/types/excalidraw/scene/types.d.ts +2 -0
- package/dist/types/excalidraw/types.d.ts +2 -0
- package/package.json +4 -4
- package/dist/prod/data/image-XPYUWCHN.js +0 -1
- /package/dist/dev/{chunk-OF725VHI.js.map → chunk-KCN2IL3S.js.map} +0 -0
- /package/dist/dev/data/{image-ZR5DXOGS.js.map → image-KG7C5ZXU.js.map} +0 -0
package/dist/dev/index.js
CHANGED
|
@@ -64,10 +64,10 @@ import {
|
|
|
64
64
|
serializeAsJSON,
|
|
65
65
|
serializeLibraryAsJSON,
|
|
66
66
|
strokeRectWithRotation_simple
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-CUCA2WKB.js";
|
|
68
68
|
import {
|
|
69
69
|
define_import_meta_env_default
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-KCN2IL3S.js";
|
|
71
71
|
import {
|
|
72
72
|
en_default
|
|
73
73
|
} from "./chunk-KLM3KPI7.js";
|
|
@@ -110,12 +110,12 @@ import {
|
|
|
110
110
|
} from "@excalidraw/math";
|
|
111
111
|
import {
|
|
112
112
|
COLOR_PALETTE as COLOR_PALETTE7,
|
|
113
|
-
CODES as
|
|
113
|
+
CODES as CODES11,
|
|
114
114
|
shouldResizeFromCenter,
|
|
115
115
|
shouldMaintainAspectRatio,
|
|
116
116
|
shouldRotateWithDiscreteAngle as shouldRotateWithDiscreteAngle3,
|
|
117
117
|
isArrowKey as isArrowKey2,
|
|
118
|
-
KEYS as
|
|
118
|
+
KEYS as KEYS51,
|
|
119
119
|
APP_NAME as APP_NAME2,
|
|
120
120
|
CURSOR_TYPE as CURSOR_TYPE4,
|
|
121
121
|
DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,
|
|
@@ -9502,7 +9502,7 @@ var exportCanvas = async (type, elements, appState, files, {
|
|
|
9502
9502
|
let blob = canvasToBlob(tempCanvas);
|
|
9503
9503
|
if (appState.exportEmbedScene) {
|
|
9504
9504
|
blob = blob.then(
|
|
9505
|
-
(blob2) => import("./data/image-
|
|
9505
|
+
(blob2) => import("./data/image-KG7C5ZXU.js").then(
|
|
9506
9506
|
({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
|
|
9507
9507
|
blob: blob2,
|
|
9508
9508
|
metadata: serializeAsJSON(elements, appState, files, "local")
|
|
@@ -9951,8 +9951,6 @@ import {
|
|
|
9951
9951
|
DEFAULT_FONT_SIZE as DEFAULT_FONT_SIZE2,
|
|
9952
9952
|
DEFAULT_FONT_FAMILY as DEFAULT_FONT_FAMILY2,
|
|
9953
9953
|
DEFAULT_TEXT_ALIGN,
|
|
9954
|
-
CODES as CODES3,
|
|
9955
|
-
KEYS as KEYS16,
|
|
9956
9954
|
getLineHeight as getLineHeight2
|
|
9957
9955
|
} from "@excalidraw/common";
|
|
9958
9956
|
import { newElementWith as newElementWith4 } from "@excalidraw/element";
|
|
@@ -9997,8 +9995,7 @@ var actionCopyStyles = register({
|
|
|
9997
9995
|
},
|
|
9998
9996
|
captureUpdate: CaptureUpdateAction10.EVENTUALLY
|
|
9999
9997
|
};
|
|
10000
|
-
}
|
|
10001
|
-
keyTest: (event) => event[KEYS16.CTRL_OR_CMD] && event.altKey && event.code === CODES3.C
|
|
9998
|
+
}
|
|
10002
9999
|
});
|
|
10003
10000
|
var actionPasteStyles = register({
|
|
10004
10001
|
name: "pasteStyles",
|
|
@@ -10074,12 +10071,11 @@ var actionPasteStyles = register({
|
|
|
10074
10071
|
}),
|
|
10075
10072
|
captureUpdate: CaptureUpdateAction10.IMMEDIATELY
|
|
10076
10073
|
};
|
|
10077
|
-
}
|
|
10078
|
-
keyTest: (event) => event[KEYS16.CTRL_OR_CMD] && event.altKey && event.code === CODES3.V
|
|
10074
|
+
}
|
|
10079
10075
|
});
|
|
10080
10076
|
|
|
10081
10077
|
// actions/actionMenu.tsx
|
|
10082
|
-
import { KEYS as
|
|
10078
|
+
import { KEYS as KEYS16 } from "@excalidraw/common";
|
|
10083
10079
|
import { CaptureUpdateAction as CaptureUpdateAction11 } from "@excalidraw/element";
|
|
10084
10080
|
var actionShortcuts = register({
|
|
10085
10081
|
name: "toggleShortcuts",
|
|
@@ -10103,7 +10099,7 @@ var actionShortcuts = register({
|
|
|
10103
10099
|
captureUpdate: CaptureUpdateAction11.EVENTUALLY
|
|
10104
10100
|
};
|
|
10105
10101
|
},
|
|
10106
|
-
keyTest: (event) => event.key ===
|
|
10102
|
+
keyTest: (event) => event.key === KEYS16.QUESTION_MARK
|
|
10107
10103
|
});
|
|
10108
10104
|
|
|
10109
10105
|
// actions/actionGroup.tsx
|
|
@@ -10119,7 +10115,7 @@ import {
|
|
|
10119
10115
|
removeElementsFromFrame,
|
|
10120
10116
|
replaceAllElementsInFrame
|
|
10121
10117
|
} from "@excalidraw/element";
|
|
10122
|
-
import { KEYS as
|
|
10118
|
+
import { KEYS as KEYS17, randomId, arrayToMap as arrayToMap6 } from "@excalidraw/common";
|
|
10123
10119
|
import {
|
|
10124
10120
|
getSelectedGroupIds,
|
|
10125
10121
|
selectGroup,
|
|
@@ -10247,7 +10243,7 @@ var actionGroup = register({
|
|
|
10247
10243
|
};
|
|
10248
10244
|
},
|
|
10249
10245
|
predicate: (elements, appState, _, app) => enableActionGroup(elements, appState, app),
|
|
10250
|
-
keyTest: (event) => !event.shiftKey && event[
|
|
10246
|
+
keyTest: (event) => !event.shiftKey && event[KEYS17.CTRL_OR_CMD] && event.key === KEYS17.G,
|
|
10251
10247
|
PanelComponent: ({ elements, appState, updateData, app }) => /* @__PURE__ */ jsx43(
|
|
10252
10248
|
ToolButton,
|
|
10253
10249
|
{
|
|
@@ -10338,7 +10334,7 @@ var actionUngroup = register({
|
|
|
10338
10334
|
captureUpdate: CaptureUpdateAction12.IMMEDIATELY
|
|
10339
10335
|
};
|
|
10340
10336
|
},
|
|
10341
|
-
keyTest: (event) => event.shiftKey && event[
|
|
10337
|
+
keyTest: (event) => event.shiftKey && event[KEYS17.CTRL_OR_CMD] && event.key === KEYS17.G.toUpperCase(),
|
|
10342
10338
|
predicate: (elements, appState) => getSelectedGroupIds(appState).length > 0,
|
|
10343
10339
|
PanelComponent: ({ elements, appState, updateData }) => /* @__PURE__ */ jsx43(
|
|
10344
10340
|
ToolButton,
|
|
@@ -10778,7 +10774,7 @@ var actionAddToLibrary = register({
|
|
|
10778
10774
|
import { getNonDeletedElements as getNonDeletedElements9 } from "@excalidraw/element";
|
|
10779
10775
|
import { isFrameLikeElement as isFrameLikeElement5 } from "@excalidraw/element";
|
|
10780
10776
|
import { updateFrameMembershipOfSelectedElements } from "@excalidraw/element";
|
|
10781
|
-
import { KEYS as
|
|
10777
|
+
import { KEYS as KEYS18, arrayToMap as arrayToMap7 } from "@excalidraw/common";
|
|
10782
10778
|
import { alignElements } from "@excalidraw/element";
|
|
10783
10779
|
import { CaptureUpdateAction as CaptureUpdateAction15 } from "@excalidraw/element";
|
|
10784
10780
|
import { getSelectedElementsByGroup } from "@excalidraw/element";
|
|
@@ -10823,7 +10819,7 @@ var actionAlignTop = register({
|
|
|
10823
10819
|
captureUpdate: CaptureUpdateAction15.IMMEDIATELY
|
|
10824
10820
|
};
|
|
10825
10821
|
},
|
|
10826
|
-
keyTest: (event) => event[
|
|
10822
|
+
keyTest: (event) => event[KEYS18.CTRL_OR_CMD] && event.shiftKey && event.key === KEYS18.ARROW_UP,
|
|
10827
10823
|
PanelComponent: ({ elements, appState, updateData, app }) => /* @__PURE__ */ jsx46(
|
|
10828
10824
|
ToolButton,
|
|
10829
10825
|
{
|
|
@@ -10855,7 +10851,7 @@ var actionAlignBottom = register({
|
|
|
10855
10851
|
captureUpdate: CaptureUpdateAction15.IMMEDIATELY
|
|
10856
10852
|
};
|
|
10857
10853
|
},
|
|
10858
|
-
keyTest: (event) => event[
|
|
10854
|
+
keyTest: (event) => event[KEYS18.CTRL_OR_CMD] && event.shiftKey && event.key === KEYS18.ARROW_DOWN,
|
|
10859
10855
|
PanelComponent: ({ elements, appState, updateData, app }) => /* @__PURE__ */ jsx46(
|
|
10860
10856
|
ToolButton,
|
|
10861
10857
|
{
|
|
@@ -10887,7 +10883,7 @@ var actionAlignLeft = register({
|
|
|
10887
10883
|
captureUpdate: CaptureUpdateAction15.IMMEDIATELY
|
|
10888
10884
|
};
|
|
10889
10885
|
},
|
|
10890
|
-
keyTest: (event) => event[
|
|
10886
|
+
keyTest: (event) => event[KEYS18.CTRL_OR_CMD] && event.shiftKey && event.key === KEYS18.ARROW_LEFT,
|
|
10891
10887
|
PanelComponent: ({ elements, appState, updateData, app }) => /* @__PURE__ */ jsx46(
|
|
10892
10888
|
ToolButton,
|
|
10893
10889
|
{
|
|
@@ -10919,7 +10915,7 @@ var actionAlignRight = register({
|
|
|
10919
10915
|
captureUpdate: CaptureUpdateAction15.IMMEDIATELY
|
|
10920
10916
|
};
|
|
10921
10917
|
},
|
|
10922
|
-
keyTest: (event) => event[
|
|
10918
|
+
keyTest: (event) => event[KEYS18.CTRL_OR_CMD] && event.shiftKey && event.key === KEYS18.ARROW_RIGHT,
|
|
10923
10919
|
PanelComponent: ({ elements, appState, updateData, app }) => /* @__PURE__ */ jsx46(
|
|
10924
10920
|
ToolButton,
|
|
10925
10921
|
{
|
|
@@ -10997,7 +10993,7 @@ var actionAlignHorizontallyCentered = register({
|
|
|
10997
10993
|
// actions/actionDistribute.tsx
|
|
10998
10994
|
import { getNonDeletedElements as getNonDeletedElements10 } from "@excalidraw/element";
|
|
10999
10995
|
import { isFrameLikeElement as isFrameLikeElement6 } from "@excalidraw/element";
|
|
11000
|
-
import { CODES as
|
|
10996
|
+
import { CODES as CODES3, KEYS as KEYS19, arrayToMap as arrayToMap8 } from "@excalidraw/common";
|
|
11001
10997
|
import { updateFrameMembershipOfSelectedElements as updateFrameMembershipOfSelectedElements2 } from "@excalidraw/element";
|
|
11002
10998
|
import { distributeElements } from "@excalidraw/element";
|
|
11003
10999
|
import { CaptureUpdateAction as CaptureUpdateAction16 } from "@excalidraw/element";
|
|
@@ -11042,7 +11038,7 @@ var distributeHorizontally = register({
|
|
|
11042
11038
|
captureUpdate: CaptureUpdateAction16.IMMEDIATELY
|
|
11043
11039
|
};
|
|
11044
11040
|
},
|
|
11045
|
-
keyTest: (event) => !event[
|
|
11041
|
+
keyTest: (event) => !event[KEYS19.CTRL_OR_CMD] && event.altKey && event.code === CODES3.H,
|
|
11046
11042
|
PanelComponent: ({ elements, appState, updateData, app }) => /* @__PURE__ */ jsx47(
|
|
11047
11043
|
ToolButton,
|
|
11048
11044
|
{
|
|
@@ -11072,7 +11068,7 @@ var distributeVertically = register({
|
|
|
11072
11068
|
captureUpdate: CaptureUpdateAction16.IMMEDIATELY
|
|
11073
11069
|
};
|
|
11074
11070
|
},
|
|
11075
|
-
keyTest: (event) => !event[
|
|
11071
|
+
keyTest: (event) => !event[KEYS19.CTRL_OR_CMD] && event.altKey && event.code === CODES3.V,
|
|
11076
11072
|
PanelComponent: ({ elements, appState, updateData, app }) => /* @__PURE__ */ jsx47(
|
|
11077
11073
|
ToolButton,
|
|
11078
11074
|
{
|
|
@@ -11088,7 +11084,7 @@ var distributeVertically = register({
|
|
|
11088
11084
|
});
|
|
11089
11085
|
|
|
11090
11086
|
// actions/actionArrange.tsx
|
|
11091
|
-
import { arrayToMap as arrayToMap9, KEYS as
|
|
11087
|
+
import { arrayToMap as arrayToMap9, KEYS as KEYS20, matchKey } from "@excalidraw/common";
|
|
11092
11088
|
import { CaptureUpdateAction as CaptureUpdateAction17 } from "@excalidraw/element";
|
|
11093
11089
|
import { updateFrameMembershipOfSelectedElements as updateFrameMembershipOfSelectedElements3 } from "@excalidraw/element/frame";
|
|
11094
11090
|
import { arrangeElements } from "@excalidraw/element/arrange";
|
|
@@ -11156,7 +11152,7 @@ var actionArrangeElements = register({
|
|
|
11156
11152
|
captureUpdate: CaptureUpdateAction17.IMMEDIATELY
|
|
11157
11153
|
};
|
|
11158
11154
|
},
|
|
11159
|
-
keyTest: (event) => event.shiftKey && matchKey(event,
|
|
11155
|
+
keyTest: (event) => event.shiftKey && matchKey(event, KEYS20.R),
|
|
11160
11156
|
PanelComponent: ({ updateData }) => /* @__PURE__ */ jsx48(
|
|
11161
11157
|
"button",
|
|
11162
11158
|
{
|
|
@@ -11233,7 +11229,7 @@ import { deepCopyElement as deepCopyElement3 } from "@excalidraw/element";
|
|
|
11233
11229
|
import { resizeMultipleElements } from "@excalidraw/element";
|
|
11234
11230
|
import { isArrowElement as isArrowElement3, isElbowArrow as isElbowArrow3 } from "@excalidraw/element";
|
|
11235
11231
|
import { updateFrameMembershipOfSelectedElements as updateFrameMembershipOfSelectedElements5 } from "@excalidraw/element";
|
|
11236
|
-
import { CODES as
|
|
11232
|
+
import { CODES as CODES4, KEYS as KEYS21, arrayToMap as arrayToMap11 } from "@excalidraw/common";
|
|
11237
11233
|
import { CaptureUpdateAction as CaptureUpdateAction19 } from "@excalidraw/element";
|
|
11238
11234
|
var actionFlipHorizontal = register({
|
|
11239
11235
|
name: "flipHorizontal",
|
|
@@ -11257,7 +11253,7 @@ var actionFlipHorizontal = register({
|
|
|
11257
11253
|
captureUpdate: CaptureUpdateAction19.IMMEDIATELY
|
|
11258
11254
|
};
|
|
11259
11255
|
},
|
|
11260
|
-
keyTest: (event) => event.shiftKey && event.code ===
|
|
11256
|
+
keyTest: (event) => event.shiftKey && event.code === CODES4.H
|
|
11261
11257
|
});
|
|
11262
11258
|
var actionFlipVertical = register({
|
|
11263
11259
|
name: "flipVertical",
|
|
@@ -11281,7 +11277,7 @@ var actionFlipVertical = register({
|
|
|
11281
11277
|
captureUpdate: CaptureUpdateAction19.IMMEDIATELY
|
|
11282
11278
|
};
|
|
11283
11279
|
},
|
|
11284
|
-
keyTest: (event) => event.shiftKey && event.code ===
|
|
11280
|
+
keyTest: (event) => event.shiftKey && event.code === CODES4.V && !event[KEYS21.CTRL_OR_CMD]
|
|
11285
11281
|
});
|
|
11286
11282
|
var flipSelectedElements = (elements, elementsMap, appState, flipDirection, app) => {
|
|
11287
11283
|
const selectedElements = getSelectedElements(
|
|
@@ -11363,7 +11359,7 @@ var flipElements = (selectedElements, elementsMap, flipDirection, app) => {
|
|
|
11363
11359
|
// actions/actionClipboard.tsx
|
|
11364
11360
|
import { isTextElement as isTextElement4 } from "@excalidraw/element";
|
|
11365
11361
|
import { getTextFromElements } from "@excalidraw/element";
|
|
11366
|
-
import { CODES as
|
|
11362
|
+
import { CODES as CODES5, KEYS as KEYS22, isFirefox as isFirefox2 } from "@excalidraw/common";
|
|
11367
11363
|
import { CaptureUpdateAction as CaptureUpdateAction20 } from "@excalidraw/element";
|
|
11368
11364
|
var actionCopy = register({
|
|
11369
11365
|
name: "copy",
|
|
@@ -11452,7 +11448,7 @@ var actionCut = register({
|
|
|
11452
11448
|
actionCopy.perform(elements, appState, event, app);
|
|
11453
11449
|
return actionDeleteSelected.perform(elements, appState, null, app);
|
|
11454
11450
|
},
|
|
11455
|
-
keyTest: (event) => event[
|
|
11451
|
+
keyTest: (event) => event[KEYS22.CTRL_OR_CMD] && event.key === KEYS22.X
|
|
11456
11452
|
});
|
|
11457
11453
|
var actionCopyAsSvg = register({
|
|
11458
11454
|
name: "copyAsSvg",
|
|
@@ -11566,7 +11562,7 @@ var actionCopyAsPng = register({
|
|
|
11566
11562
|
predicate: (elements) => {
|
|
11567
11563
|
return probablySupportsClipboardBlob && elements.length > 0;
|
|
11568
11564
|
},
|
|
11569
|
-
keyTest: (event) => event.code ===
|
|
11565
|
+
keyTest: (event) => event.code === CODES5.C && event.altKey && event.shiftKey,
|
|
11570
11566
|
keywords: ["png", "clipboard", "copy"]
|
|
11571
11567
|
});
|
|
11572
11568
|
var copyText = register({
|
|
@@ -11597,7 +11593,7 @@ var copyText = register({
|
|
|
11597
11593
|
});
|
|
11598
11594
|
|
|
11599
11595
|
// actions/actionToggleGridMode.tsx
|
|
11600
|
-
import { CODES as
|
|
11596
|
+
import { CODES as CODES6, KEYS as KEYS23 } from "@excalidraw/common";
|
|
11601
11597
|
import { CaptureUpdateAction as CaptureUpdateAction21 } from "@excalidraw/element";
|
|
11602
11598
|
var actionToggleGridMode = register({
|
|
11603
11599
|
name: "gridMode",
|
|
@@ -11623,11 +11619,10 @@ var actionToggleGridMode = register({
|
|
|
11623
11619
|
predicate: (element, appState, props) => {
|
|
11624
11620
|
return props.gridModeEnabled === void 0;
|
|
11625
11621
|
},
|
|
11626
|
-
keyTest: (event) => event[
|
|
11622
|
+
keyTest: (event) => event[KEYS23.CTRL_OR_CMD] && event.code === CODES6.QUOTE
|
|
11627
11623
|
});
|
|
11628
11624
|
|
|
11629
11625
|
// actions/actionToggleZenMode.tsx
|
|
11630
|
-
import { CODES as CODES8, KEYS as KEYS25 } from "@excalidraw/common";
|
|
11631
11626
|
import { CaptureUpdateAction as CaptureUpdateAction22 } from "@excalidraw/element";
|
|
11632
11627
|
var actionToggleZenMode = register({
|
|
11633
11628
|
name: "zenMode",
|
|
@@ -11650,12 +11645,11 @@ var actionToggleZenMode = register({
|
|
|
11650
11645
|
checked: (appState) => appState.zenModeEnabled,
|
|
11651
11646
|
predicate: (elements, appState, appProps, app) => {
|
|
11652
11647
|
return app.editorInterface.formFactor !== "phone" && typeof appProps.zenModeEnabled === "undefined";
|
|
11653
|
-
}
|
|
11654
|
-
keyTest: (event) => !event[KEYS25.CTRL_OR_CMD] && event.altKey && event.code === CODES8.Z
|
|
11648
|
+
}
|
|
11655
11649
|
});
|
|
11656
11650
|
|
|
11657
11651
|
// actions/actionToggleObjectsSnapMode.tsx
|
|
11658
|
-
import { CODES as
|
|
11652
|
+
import { CODES as CODES7, KEYS as KEYS24 } from "@excalidraw/common";
|
|
11659
11653
|
import { CaptureUpdateAction as CaptureUpdateAction23 } from "@excalidraw/element";
|
|
11660
11654
|
var actionToggleObjectsSnapMode = register({
|
|
11661
11655
|
name: "objectsSnapMode",
|
|
@@ -11680,7 +11674,7 @@ var actionToggleObjectsSnapMode = register({
|
|
|
11680
11674
|
predicate: (elements, appState, appProps) => {
|
|
11681
11675
|
return typeof appProps.objectsSnapModeEnabled === "undefined";
|
|
11682
11676
|
},
|
|
11683
|
-
keyTest: (event) => !event[
|
|
11677
|
+
keyTest: (event) => !event[KEYS24.CTRL_OR_CMD] && event.altKey && event.code === CODES7.S
|
|
11684
11678
|
});
|
|
11685
11679
|
|
|
11686
11680
|
// actions/actionToggleArrowBinding.tsx
|
|
@@ -11730,7 +11724,7 @@ var actionToggleMidpointSnapping = register({
|
|
|
11730
11724
|
});
|
|
11731
11725
|
|
|
11732
11726
|
// actions/actionToggleStats.tsx
|
|
11733
|
-
import { CODES as
|
|
11727
|
+
import { CODES as CODES8, KEYS as KEYS25 } from "@excalidraw/common";
|
|
11734
11728
|
import { CaptureUpdateAction as CaptureUpdateAction26 } from "@excalidraw/element";
|
|
11735
11729
|
var actionToggleStats = register({
|
|
11736
11730
|
name: "stats",
|
|
@@ -11749,7 +11743,7 @@ var actionToggleStats = register({
|
|
|
11749
11743
|
};
|
|
11750
11744
|
},
|
|
11751
11745
|
checked: (appState) => appState.stats.open,
|
|
11752
|
-
keyTest: (event) => !event[
|
|
11746
|
+
keyTest: (event) => !event[KEYS25.CTRL_OR_CMD] && event.altKey && event.code === CODES8.SLASH
|
|
11753
11747
|
});
|
|
11754
11748
|
|
|
11755
11749
|
// actions/actionBoundText.tsx
|
|
@@ -12020,7 +12014,7 @@ var actionWrapTextInContainer = register({
|
|
|
12020
12014
|
|
|
12021
12015
|
// actions/actionLink.tsx
|
|
12022
12016
|
import { isEmbeddableElement as isEmbeddableElement2 } from "@excalidraw/element";
|
|
12023
|
-
import { KEYS as
|
|
12017
|
+
import { KEYS as KEYS27 } from "@excalidraw/common";
|
|
12024
12018
|
import { CaptureUpdateAction as CaptureUpdateAction28 } from "@excalidraw/element";
|
|
12025
12019
|
|
|
12026
12020
|
// components/hyperlink/Hyperlink.tsx
|
|
@@ -12033,7 +12027,7 @@ import {
|
|
|
12033
12027
|
useRef as useRef12,
|
|
12034
12028
|
useState as useState10
|
|
12035
12029
|
} from "react";
|
|
12036
|
-
import { EVENT as EVENT5, HYPERLINK_TOOLTIP_DELAY, KEYS as
|
|
12030
|
+
import { EVENT as EVENT5, HYPERLINK_TOOLTIP_DELAY, KEYS as KEYS26 } from "@excalidraw/common";
|
|
12037
12031
|
import { getElementAbsoluteCoords } from "@excalidraw/element";
|
|
12038
12032
|
import { hitElementBoundingBox } from "@excalidraw/element";
|
|
12039
12033
|
import { isElementLink } from "@excalidraw/element";
|
|
@@ -12207,10 +12201,10 @@ var Hyperlink = ({
|
|
|
12207
12201
|
autoFocus: true,
|
|
12208
12202
|
onKeyDown: (event) => {
|
|
12209
12203
|
event.stopPropagation();
|
|
12210
|
-
if (event[
|
|
12204
|
+
if (event[KEYS26.CTRL_OR_CMD] && event.key === KEYS26.K) {
|
|
12211
12205
|
event.preventDefault();
|
|
12212
12206
|
}
|
|
12213
|
-
if (event.key ===
|
|
12207
|
+
if (event.key === KEYS26.ENTER || event.key === KEYS26.ESCAPE) {
|
|
12214
12208
|
handleSubmit();
|
|
12215
12209
|
setAppState({ showHyperlinkPopup: "info" });
|
|
12216
12210
|
}
|
|
@@ -12402,7 +12396,7 @@ var actionLink = register({
|
|
|
12402
12396
|
};
|
|
12403
12397
|
},
|
|
12404
12398
|
trackEvent: { category: "hyperlink", action: "click" },
|
|
12405
|
-
keyTest: (event) => event[
|
|
12399
|
+
keyTest: (event) => event[KEYS27.CTRL_OR_CMD] && event.key === KEYS27.K,
|
|
12406
12400
|
predicate: (elements, appState) => {
|
|
12407
12401
|
const selectedElements = getSelectedElements(elements, appState);
|
|
12408
12402
|
return selectedElements.length === 1;
|
|
@@ -12424,7 +12418,7 @@ var actionLink = register({
|
|
|
12424
12418
|
});
|
|
12425
12419
|
|
|
12426
12420
|
// actions/actionElementLock.ts
|
|
12427
|
-
import { KEYS as
|
|
12421
|
+
import { KEYS as KEYS28, arrayToMap as arrayToMap13, randomId as randomId3 } from "@excalidraw/common";
|
|
12428
12422
|
import {
|
|
12429
12423
|
elementsAreInSameGroup,
|
|
12430
12424
|
newElementWith as newElementWith7,
|
|
@@ -12515,7 +12509,7 @@ var actionToggleElementLock = register({
|
|
|
12515
12509
|
};
|
|
12516
12510
|
},
|
|
12517
12511
|
keyTest: (event, appState, elements, app) => {
|
|
12518
|
-
return event.key.toLocaleLowerCase() ===
|
|
12512
|
+
return event.key.toLocaleLowerCase() === KEYS28.L && event[KEYS28.CTRL_OR_CMD] && event.shiftKey && app.scene.getSelectedElements({
|
|
12519
12513
|
selectedElementIds: appState.selectedElementIds,
|
|
12520
12514
|
includeBoundTextElement: false
|
|
12521
12515
|
}).length > 0;
|
|
@@ -12590,7 +12584,7 @@ import { useEffect as useEffect28, useRef as useRef24, useMemo as useMemo9, useS
|
|
|
12590
12584
|
import {
|
|
12591
12585
|
DEFAULT_SIDEBAR as DEFAULT_SIDEBAR2,
|
|
12592
12586
|
EVENT as EVENT9,
|
|
12593
|
-
KEYS as
|
|
12587
|
+
KEYS as KEYS35,
|
|
12594
12588
|
capitalizeString as capitalizeString3,
|
|
12595
12589
|
isWritableElement as isWritableElement3
|
|
12596
12590
|
} from "@excalidraw/common";
|
|
@@ -13598,7 +13592,7 @@ var deburr = (str) => {
|
|
|
13598
13592
|
// components/Dialog.tsx
|
|
13599
13593
|
import clsx33 from "clsx";
|
|
13600
13594
|
import { useEffect as useEffect26, useState as useState22 } from "react";
|
|
13601
|
-
import { KEYS as
|
|
13595
|
+
import { KEYS as KEYS32, queryFocusableElements } from "@excalidraw/common";
|
|
13602
13596
|
|
|
13603
13597
|
// hooks/useCallbackRefState.ts
|
|
13604
13598
|
import { useCallback as useCallback7, useState as useState12 } from "react";
|
|
@@ -13621,7 +13615,7 @@ import {
|
|
|
13621
13615
|
LIBRARY_DISABLED_TYPES as LIBRARY_DISABLED_TYPES2,
|
|
13622
13616
|
randomId as randomId4,
|
|
13623
13617
|
isShallowEqual,
|
|
13624
|
-
KEYS as
|
|
13618
|
+
KEYS as KEYS30,
|
|
13625
13619
|
isWritableElement as isWritableElement2,
|
|
13626
13620
|
addEventListener,
|
|
13627
13621
|
EVENT as EVENT8,
|
|
@@ -15199,7 +15193,7 @@ import { CLASSES as CLASSES3 } from "@excalidraw/common";
|
|
|
15199
15193
|
// components/dropdownMenu/DropdownMenuContent.tsx
|
|
15200
15194
|
import clsx24 from "clsx";
|
|
15201
15195
|
import { useCallback as useCallback9, useEffect as useEffect22, useRef as useRef16 } from "react";
|
|
15202
|
-
import { CLASSES as CLASSES2, EVENT as EVENT7, KEYS as
|
|
15196
|
+
import { CLASSES as CLASSES2, EVENT as EVENT7, KEYS as KEYS29 } from "@excalidraw/common";
|
|
15203
15197
|
import { DropdownMenu as DropdownMenuPrimitive2 } from "radix-ui";
|
|
15204
15198
|
|
|
15205
15199
|
// components/Stack.tsx
|
|
@@ -15277,7 +15271,7 @@ var MenuContent = ({
|
|
|
15277
15271
|
return;
|
|
15278
15272
|
}
|
|
15279
15273
|
const onKeyDown = (event) => {
|
|
15280
|
-
if (event.key ===
|
|
15274
|
+
if (event.key === KEYS29.ESCAPE) {
|
|
15281
15275
|
event.stopImmediatePropagation();
|
|
15282
15276
|
callbacksRef.onClickOutside?.();
|
|
15283
15277
|
}
|
|
@@ -16566,7 +16560,7 @@ var LibraryMenu = memo3(() => {
|
|
|
16566
16560
|
document,
|
|
16567
16561
|
EVENT8.KEYDOWN,
|
|
16568
16562
|
(event) => {
|
|
16569
|
-
if (event.key ===
|
|
16563
|
+
if (event.key === KEYS30.ESCAPE && event.target instanceof HTMLElement) {
|
|
16570
16564
|
const target = event.target;
|
|
16571
16565
|
if (target.closest(`.${CLASSES4.SIDEBAR}`)) {
|
|
16572
16566
|
if (selectedItems.length > 0) {
|
|
@@ -16625,7 +16619,7 @@ var LibraryMenu = memo3(() => {
|
|
|
16625
16619
|
import clsx32 from "clsx";
|
|
16626
16620
|
import { useRef as useRef21 } from "react";
|
|
16627
16621
|
import { createPortal as createPortal2 } from "react-dom";
|
|
16628
|
-
import { KEYS as
|
|
16622
|
+
import { KEYS as KEYS31 } from "@excalidraw/common";
|
|
16629
16623
|
import { jsx as jsx75, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
16630
16624
|
var Modal = (props) => {
|
|
16631
16625
|
const { closeOnClickOutside = true } = props;
|
|
@@ -16639,7 +16633,7 @@ var Modal = (props) => {
|
|
|
16639
16633
|
return null;
|
|
16640
16634
|
}
|
|
16641
16635
|
const handleKeydown = (event) => {
|
|
16642
|
-
if (event.key ===
|
|
16636
|
+
if (event.key === KEYS31.ESCAPE) {
|
|
16643
16637
|
event.nativeEvent.stopImmediatePropagation();
|
|
16644
16638
|
event.stopPropagation();
|
|
16645
16639
|
props.onCloseRequest();
|
|
@@ -16712,7 +16706,7 @@ var Dialog = (props) => {
|
|
|
16712
16706
|
}
|
|
16713
16707
|
});
|
|
16714
16708
|
const handleKeyDown = (event) => {
|
|
16715
|
-
if (event.key ===
|
|
16709
|
+
if (event.key === KEYS32.TAB) {
|
|
16716
16710
|
const focusableElements2 = queryFocusableElements(islandNode);
|
|
16717
16711
|
const { activeElement } = document;
|
|
16718
16712
|
const currentIndex = focusableElements2.findIndex(
|
|
@@ -16776,7 +16770,7 @@ import { useMemo as useMemo8, useRef as useRef22, useState as useState24 } from
|
|
|
16776
16770
|
import { Popover as Popover7 } from "radix-ui";
|
|
16777
16771
|
import {
|
|
16778
16772
|
CLASSES as CLASSES5,
|
|
16779
|
-
KEYS as
|
|
16773
|
+
KEYS as KEYS34,
|
|
16780
16774
|
capitalizeString as capitalizeString2,
|
|
16781
16775
|
isTransparent as isTransparent2
|
|
16782
16776
|
} from "@excalidraw/common";
|
|
@@ -16795,7 +16789,7 @@ import {
|
|
|
16795
16789
|
import { getToolbarTools, SHAPES } from "@excalidraw/element/shapes";
|
|
16796
16790
|
|
|
16797
16791
|
// actions/actionToggleViewMode.tsx
|
|
16798
|
-
import { CODES as
|
|
16792
|
+
import { CODES as CODES9, KEYS as KEYS33 } from "@excalidraw/common";
|
|
16799
16793
|
import clsx34 from "clsx";
|
|
16800
16794
|
import { CaptureUpdateAction as CaptureUpdateAction32 } from "@excalidraw/element";
|
|
16801
16795
|
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
@@ -16821,7 +16815,7 @@ var actionToggleViewMode = register({
|
|
|
16821
16815
|
predicate: (elements, appState, appProps) => {
|
|
16822
16816
|
return typeof appProps.viewModeEnabled === "undefined";
|
|
16823
16817
|
},
|
|
16824
|
-
keyTest: (event) => !event[
|
|
16818
|
+
keyTest: (event) => !event[KEYS33.CTRL_OR_CMD] && event.altKey && event.code === CODES9.R,
|
|
16825
16819
|
PanelComponent: ({ data, updateData, appState }) => /* @__PURE__ */ jsx77(
|
|
16826
16820
|
ToolButton,
|
|
16827
16821
|
{
|
|
@@ -17830,7 +17824,7 @@ var ShapesSwitcher = ({
|
|
|
17830
17824
|
icon: app.state.activeTool.locked ? LockedIcon : UnlockedIcon,
|
|
17831
17825
|
"data-testid": `toolbar-lock`,
|
|
17832
17826
|
selected: app.state.activeTool.locked,
|
|
17833
|
-
shortcut:
|
|
17827
|
+
shortcut: KEYS34.Q,
|
|
17834
17828
|
children: capitalizeString2(t("toolBar.lock-short"))
|
|
17835
17829
|
}
|
|
17836
17830
|
)
|
|
@@ -17942,7 +17936,7 @@ var CommandShortcutHint = ({
|
|
|
17942
17936
|
] });
|
|
17943
17937
|
};
|
|
17944
17938
|
var isCommandPaletteToggleShortcut = (event) => {
|
|
17945
|
-
return !event.altKey && event[
|
|
17939
|
+
return !event.altKey && event[KEYS35.CTRL_OR_CMD] && (event.shiftKey && event.key.toLowerCase() === KEYS35.P || event.key === KEYS35.SLASH);
|
|
17946
17940
|
};
|
|
17947
17941
|
var CommandPalette = Object.assign(
|
|
17948
17942
|
(props) => {
|
|
@@ -18068,8 +18062,6 @@ function CommandPaletteInner({
|
|
|
18068
18062
|
actionManager.actions.copy,
|
|
18069
18063
|
actionManager.actions.deleteSelectedElements,
|
|
18070
18064
|
actionManager.actions.wrapSelectionInFrame,
|
|
18071
|
-
actionManager.actions.copyStyles,
|
|
18072
|
-
actionManager.actions.pasteStyles,
|
|
18073
18065
|
actionManager.actions.bringToFront,
|
|
18074
18066
|
actionManager.actions.bringForward,
|
|
18075
18067
|
actionManager.actions.sendBackward,
|
|
@@ -18125,7 +18117,6 @@ function CommandPaletteInner({
|
|
|
18125
18117
|
actionManager.actions.resetZoom,
|
|
18126
18118
|
actionManager.actions.zoomToFit,
|
|
18127
18119
|
actionManager.actions.smartZoom,
|
|
18128
|
-
actionManager.actions.zenMode,
|
|
18129
18120
|
actionManager.actions.viewMode,
|
|
18130
18121
|
actionManager.actions.gridMode,
|
|
18131
18122
|
actionManager.actions.objectsSnapMode,
|
|
@@ -18138,8 +18129,7 @@ function CommandPaletteInner({
|
|
|
18138
18129
|
const exportCommands = [
|
|
18139
18130
|
actionManager.actions.saveToActiveFile,
|
|
18140
18131
|
actionManager.actions.saveFileToDisk,
|
|
18141
|
-
actionManager.actions.copyAsPng
|
|
18142
|
-
actionManager.actions.copyAsSvg
|
|
18132
|
+
actionManager.actions.copyAsPng
|
|
18143
18133
|
].map((action) => actionToCommand(action, DEFAULT_CATEGORIES.export));
|
|
18144
18134
|
commandsFromActions = [
|
|
18145
18135
|
...elementsCommands,
|
|
@@ -18279,7 +18269,7 @@ function CommandPaletteInner({
|
|
|
18279
18269
|
label: t("toolBar.lock"),
|
|
18280
18270
|
category: DEFAULT_CATEGORIES.tools,
|
|
18281
18271
|
icon: uiAppState2.activeTool.locked ? LockedIcon : UnlockedIcon,
|
|
18282
|
-
shortcut:
|
|
18272
|
+
shortcut: KEYS35.Q.toLocaleUpperCase(),
|
|
18283
18273
|
viewMode: false,
|
|
18284
18274
|
perform: () => {
|
|
18285
18275
|
app.toggleLock();
|
|
@@ -18355,13 +18345,13 @@ function CommandPaletteInner({
|
|
|
18355
18345
|
}
|
|
18356
18346
|
);
|
|
18357
18347
|
const handleKeyDown = useStableCallback((event) => {
|
|
18358
|
-
const ignoreAlphanumerics = isWritableElement3(event.target) || isCommandPaletteToggleShortcut(event) || event.key ===
|
|
18359
|
-
if (ignoreAlphanumerics && event.key !==
|
|
18348
|
+
const ignoreAlphanumerics = isWritableElement3(event.target) || isCommandPaletteToggleShortcut(event) || event.key === KEYS35.ESCAPE;
|
|
18349
|
+
if (ignoreAlphanumerics && event.key !== KEYS35.ARROW_UP && event.key !== KEYS35.ARROW_DOWN && event.key !== KEYS35.ENTER) {
|
|
18360
18350
|
return;
|
|
18361
18351
|
}
|
|
18362
18352
|
const matchingCommands = Object.values(commandsByCategory).flat();
|
|
18363
18353
|
const shouldConsiderLastUsed = lastUsed && !commandSearch && isCommandAvailable(lastUsed);
|
|
18364
|
-
if (event.key ===
|
|
18354
|
+
if (event.key === KEYS35.ARROW_UP) {
|
|
18365
18355
|
event.preventDefault();
|
|
18366
18356
|
const index = matchingCommands.findIndex(
|
|
18367
18357
|
(item) => item.label === currentCommand?.label
|
|
@@ -18391,7 +18381,7 @@ function CommandPaletteInner({
|
|
|
18391
18381
|
}
|
|
18392
18382
|
return;
|
|
18393
18383
|
}
|
|
18394
|
-
if (event.key ===
|
|
18384
|
+
if (event.key === KEYS35.ARROW_DOWN) {
|
|
18395
18385
|
event.preventDefault();
|
|
18396
18386
|
const index = matchingCommands.findIndex(
|
|
18397
18387
|
(item) => item.label === currentCommand?.label
|
|
@@ -18416,7 +18406,7 @@ function CommandPaletteInner({
|
|
|
18416
18406
|
}
|
|
18417
18407
|
return;
|
|
18418
18408
|
}
|
|
18419
|
-
if (event.key ===
|
|
18409
|
+
if (event.key === KEYS35.ENTER) {
|
|
18420
18410
|
if (currentCommand) {
|
|
18421
18411
|
setTimeout(() => {
|
|
18422
18412
|
executeCommand(currentCommand, event);
|
|
@@ -18743,7 +18733,7 @@ import {
|
|
|
18743
18733
|
} from "@excalidraw/math";
|
|
18744
18734
|
import {
|
|
18745
18735
|
DRAGGING_THRESHOLD,
|
|
18746
|
-
KEYS as
|
|
18736
|
+
KEYS as KEYS36,
|
|
18747
18737
|
shouldRotateWithDiscreteAngle as shouldRotateWithDiscreteAngle2,
|
|
18748
18738
|
getGridPoint,
|
|
18749
18739
|
invariant as invariant11,
|
|
@@ -20285,7 +20275,7 @@ var actionTogglePolygon = register({
|
|
|
20285
20275
|
|
|
20286
20276
|
// actions/actionToggleSearchMenu.ts
|
|
20287
20277
|
import {
|
|
20288
|
-
KEYS as
|
|
20278
|
+
KEYS as KEYS37,
|
|
20289
20279
|
CANVAS_SEARCH_TAB,
|
|
20290
20280
|
CLASSES as CLASSES6,
|
|
20291
20281
|
DEFAULT_SIDEBAR as DEFAULT_SIDEBAR3
|
|
@@ -20327,7 +20317,7 @@ var actionToggleSearchMenu = register({
|
|
|
20327
20317
|
predicate: (element, appState, props) => {
|
|
20328
20318
|
return props.gridModeEnabled === void 0;
|
|
20329
20319
|
},
|
|
20330
|
-
keyTest: (event) => event[
|
|
20320
|
+
keyTest: (event) => event[KEYS37.CTRL_OR_CMD] && event.key === KEYS37.F
|
|
20331
20321
|
});
|
|
20332
20322
|
|
|
20333
20323
|
// actions/actionCropEditor.tsx
|
|
@@ -20550,7 +20540,7 @@ var actionWrapSelectionInFrame = register({
|
|
|
20550
20540
|
// actions/actionHistory.tsx
|
|
20551
20541
|
import {
|
|
20552
20542
|
isWindows,
|
|
20553
|
-
KEYS as
|
|
20543
|
+
KEYS as KEYS38,
|
|
20554
20544
|
matchKey as matchKey2,
|
|
20555
20545
|
arrayToMap as arrayToMap25,
|
|
20556
20546
|
MOBILE_ACTION_BUTTON_BG as MOBILE_ACTION_BUTTON_BG4
|
|
@@ -20781,7 +20771,7 @@ var createUndoAction = (history) => ({
|
|
|
20781
20771
|
appState,
|
|
20782
20772
|
() => history.undo(arrayToMap25(elements), appState)
|
|
20783
20773
|
),
|
|
20784
|
-
keyTest: (event) => event[
|
|
20774
|
+
keyTest: (event) => event[KEYS38.CTRL_OR_CMD] && matchKey2(event, KEYS38.Z) && !event.shiftKey,
|
|
20785
20775
|
PanelComponent: ({ appState, updateData, data, app }) => {
|
|
20786
20776
|
const { isUndoStackEmpty } = useEmitter(
|
|
20787
20777
|
history.onHistoryChangedEmitter,
|
|
@@ -20819,7 +20809,7 @@ var createRedoAction = (history) => ({
|
|
|
20819
20809
|
appState,
|
|
20820
20810
|
() => history.redo(arrayToMap25(elements), appState)
|
|
20821
20811
|
),
|
|
20822
|
-
keyTest: (event) => event[
|
|
20812
|
+
keyTest: (event) => event[KEYS38.CTRL_OR_CMD] && event.shiftKey && matchKey2(event, KEYS38.Z) || isWindows && event.ctrlKey && !event.shiftKey && matchKey2(event, KEYS38.Y),
|
|
20823
20813
|
PanelComponent: ({ appState, updateData, data, app }) => {
|
|
20824
20814
|
const { isRedoStackEmpty } = useEmitter(
|
|
20825
20815
|
history.onHistoryChangedEmitter,
|
|
@@ -21091,7 +21081,7 @@ import {
|
|
|
21091
21081
|
rangeIntersection,
|
|
21092
21082
|
rangesOverlap
|
|
21093
21083
|
} from "@excalidraw/math";
|
|
21094
|
-
import { TOOL_TYPE, KEYS as
|
|
21084
|
+
import { TOOL_TYPE, KEYS as KEYS39 } from "@excalidraw/common";
|
|
21095
21085
|
import {
|
|
21096
21086
|
getCommonBounds as getCommonBounds4,
|
|
21097
21087
|
getDraggedElementsBounds,
|
|
@@ -21137,7 +21127,7 @@ var isSnappingEnabled = ({
|
|
|
21137
21127
|
}) => {
|
|
21138
21128
|
if (event) {
|
|
21139
21129
|
const isLassoDragging = app.state.activeTool.type === "lasso" && app.state.selectedElementsAreBeingDragged;
|
|
21140
|
-
return (app.state.activeTool.type !== "lasso" || isLassoDragging) && (app.state.objectsSnapModeEnabled && !event[
|
|
21130
|
+
return (app.state.activeTool.type !== "lasso" || isLassoDragging) && (app.state.objectsSnapModeEnabled && !event[KEYS39.CTRL_OR_CMD] || !app.state.objectsSnapModeEnabled && event[KEYS39.CTRL_OR_CMD] && !isGridModeEnabled(app));
|
|
21141
21131
|
}
|
|
21142
21132
|
if (selectedElements.length === 1 && selectedElements[0].type === "arrow") {
|
|
21143
21133
|
return false;
|
|
@@ -22522,8 +22512,8 @@ var isPointHittingTextAutoResizeHandle = (point, textElement, zoomValue, formFac
|
|
|
22522
22512
|
|
|
22523
22513
|
// wysiwyg/textWysiwyg.tsx
|
|
22524
22514
|
import {
|
|
22525
|
-
CODES as
|
|
22526
|
-
KEYS as
|
|
22515
|
+
CODES as CODES10,
|
|
22516
|
+
KEYS as KEYS40,
|
|
22527
22517
|
CLASSES as CLASSES7,
|
|
22528
22518
|
POINTER_BUTTON,
|
|
22529
22519
|
THEME as THEME11,
|
|
@@ -22987,7 +22977,7 @@ var textWysiwyg = ({
|
|
|
22987
22977
|
app.actionManager.executeAction(actionDecreaseFontSize);
|
|
22988
22978
|
} else if (actionIncreaseFontSize.keyTest(event)) {
|
|
22989
22979
|
app.actionManager.executeAction(actionIncreaseFontSize);
|
|
22990
|
-
} else if (event.key ===
|
|
22980
|
+
} else if (event.key === KEYS40.ESCAPE) {
|
|
22991
22981
|
event.preventDefault();
|
|
22992
22982
|
submittedViaKeyboard = true;
|
|
22993
22983
|
handleSubmit();
|
|
@@ -22995,18 +22985,18 @@ var textWysiwyg = ({
|
|
|
22995
22985
|
event.preventDefault();
|
|
22996
22986
|
handleSubmit();
|
|
22997
22987
|
app.actionManager.executeAction(actionSaveToActiveFile);
|
|
22998
|
-
} else if (event.key ===
|
|
22988
|
+
} else if (event.key === KEYS40.ENTER && event[KEYS40.CTRL_OR_CMD]) {
|
|
22999
22989
|
event.preventDefault();
|
|
23000
22990
|
if (event.isComposing || event.keyCode === 229) {
|
|
23001
22991
|
return;
|
|
23002
22992
|
}
|
|
23003
22993
|
submittedViaKeyboard = true;
|
|
23004
22994
|
handleSubmit();
|
|
23005
|
-
} else if (event.key ===
|
|
22995
|
+
} else if (event.key === KEYS40.TAB || event[KEYS40.CTRL_OR_CMD] && (event.code === CODES10.BRACKET_LEFT || event.code === CODES10.BRACKET_RIGHT)) {
|
|
23006
22996
|
event.preventDefault();
|
|
23007
22997
|
if (event.isComposing) {
|
|
23008
22998
|
return;
|
|
23009
|
-
} else if (event.shiftKey || event.code ===
|
|
22999
|
+
} else if (event.shiftKey || event.code === CODES10.BRACKET_LEFT) {
|
|
23010
23000
|
outdent();
|
|
23011
23001
|
} else {
|
|
23012
23002
|
indent();
|
|
@@ -23561,7 +23551,7 @@ var LassoTrail = class extends AnimatedTrail {
|
|
|
23561
23551
|
};
|
|
23562
23552
|
|
|
23563
23553
|
// actions/actionSmartZoom.tsx
|
|
23564
|
-
import { KEYS as
|
|
23554
|
+
import { KEYS as KEYS41 } from "@excalidraw/common";
|
|
23565
23555
|
import { CaptureUpdateAction as CaptureUpdateAction40 } from "@excalidraw/element/store";
|
|
23566
23556
|
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
23567
23557
|
var actionSmartZoom = register({
|
|
@@ -23585,7 +23575,7 @@ var actionSmartZoom = register({
|
|
|
23585
23575
|
captureUpdate: CaptureUpdateAction40.NEVER
|
|
23586
23576
|
};
|
|
23587
23577
|
},
|
|
23588
|
-
keyTest: (event) => !event[
|
|
23578
|
+
keyTest: (event) => !event[KEYS41.CTRL_OR_CMD] && !event.shiftKey && !event.altKey && event.key.toLocaleLowerCase() === KEYS41.F,
|
|
23589
23579
|
PanelComponent: ({ data, updateData }) => /* @__PURE__ */ jsx86(
|
|
23590
23580
|
ToolButton,
|
|
23591
23581
|
{
|
|
@@ -23595,7 +23585,7 @@ var actionSmartZoom = register({
|
|
|
23595
23585
|
onClick: () => updateData(null),
|
|
23596
23586
|
size: data?.size || "medium",
|
|
23597
23587
|
"data-testid": "button-smart-zoom",
|
|
23598
|
-
keyBindingLabel:
|
|
23588
|
+
keyBindingLabel: KEYS41.F.toLocaleUpperCase()
|
|
23599
23589
|
}
|
|
23600
23590
|
)
|
|
23601
23591
|
});
|
|
@@ -24904,7 +24894,7 @@ import React29 from "react";
|
|
|
24904
24894
|
// components/Popover.tsx
|
|
24905
24895
|
import { useLayoutEffect as useLayoutEffect4, useRef as useRef25, useEffect as useEffect30 } from "react";
|
|
24906
24896
|
import { unstable_batchedUpdates as unstable_batchedUpdates2 } from "react-dom";
|
|
24907
|
-
import { KEYS as
|
|
24897
|
+
import { KEYS as KEYS42, queryFocusableElements as queryFocusableElements2 } from "@excalidraw/common";
|
|
24908
24898
|
import clsx38 from "clsx";
|
|
24909
24899
|
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
24910
24900
|
var Popover8 = ({
|
|
@@ -24929,7 +24919,7 @@ var Popover8 = ({
|
|
|
24929
24919
|
container.focus();
|
|
24930
24920
|
}
|
|
24931
24921
|
const handleKeyDown = (event) => {
|
|
24932
|
-
if (event.key ===
|
|
24922
|
+
if (event.key === KEYS42.TAB) {
|
|
24933
24923
|
const focusableElements = queryFocusableElements2(container);
|
|
24934
24924
|
const { activeElement } = document;
|
|
24935
24925
|
const currentIndex = focusableElements.findIndex(
|
|
@@ -25216,12 +25206,12 @@ var LoadingMessage = ({
|
|
|
25216
25206
|
// components/MobileToolBar.tsx
|
|
25217
25207
|
import { useState as useState28 } from "react";
|
|
25218
25208
|
import clsx42 from "clsx";
|
|
25219
|
-
import { KEYS as
|
|
25209
|
+
import { KEYS as KEYS44, capitalizeString as capitalizeString4 } from "@excalidraw/common";
|
|
25220
25210
|
import { SHAPES as SHAPES3 } from "@excalidraw/element/shapes";
|
|
25221
25211
|
|
|
25222
25212
|
// components/HandButton.tsx
|
|
25223
25213
|
import clsx41 from "clsx";
|
|
25224
|
-
import { KEYS as
|
|
25214
|
+
import { KEYS as KEYS43 } from "@excalidraw/common";
|
|
25225
25215
|
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
25226
25216
|
var HandButton = (props) => {
|
|
25227
25217
|
return /* @__PURE__ */ jsx92(
|
|
@@ -25233,9 +25223,9 @@ var HandButton = (props) => {
|
|
|
25233
25223
|
name: "editor-current-shape",
|
|
25234
25224
|
checked: props.checked,
|
|
25235
25225
|
title: `${props.title} \u2014 H`,
|
|
25236
|
-
keyBindingLabel: !props.isMobile ?
|
|
25226
|
+
keyBindingLabel: !props.isMobile ? KEYS43.H.toLocaleUpperCase() : void 0,
|
|
25237
25227
|
"aria-label": `${props.title} \u2014 H`,
|
|
25238
|
-
"aria-keyshortcuts":
|
|
25228
|
+
"aria-keyshortcuts": KEYS43.H,
|
|
25239
25229
|
"data-testid": `toolbar-hand`,
|
|
25240
25230
|
onChange: () => props.onChange?.()
|
|
25241
25231
|
}
|
|
@@ -25471,7 +25461,7 @@ var MobileToolBar = ({
|
|
|
25471
25461
|
icon: app.state.activeTool.locked ? LockedIcon : UnlockedIcon,
|
|
25472
25462
|
"data-testid": `toolbar-lock`,
|
|
25473
25463
|
selected: app.state.activeTool.locked,
|
|
25474
|
-
shortcut:
|
|
25464
|
+
shortcut: KEYS44.Q,
|
|
25475
25465
|
children: capitalizeString4(t("toolBar.lock-short"))
|
|
25476
25466
|
}
|
|
25477
25467
|
),
|
|
@@ -25480,7 +25470,7 @@ var MobileToolBar = ({
|
|
|
25480
25470
|
{
|
|
25481
25471
|
onSelect: () => app.setActiveTool({ type: "text" }),
|
|
25482
25472
|
icon: TextIcon,
|
|
25483
|
-
shortcut:
|
|
25473
|
+
shortcut: KEYS44.T.toLocaleUpperCase(),
|
|
25484
25474
|
"data-testid": "toolbar-text",
|
|
25485
25475
|
selected: activeTool.type === "text",
|
|
25486
25476
|
children: t("toolBar.text")
|
|
@@ -26159,7 +26149,7 @@ import {
|
|
|
26159
26149
|
CLASSES as CLASSES8,
|
|
26160
26150
|
EVENT as EVENT10,
|
|
26161
26151
|
isDevEnv as isDevEnv8,
|
|
26162
|
-
KEYS as
|
|
26152
|
+
KEYS as KEYS45,
|
|
26163
26153
|
updateObject
|
|
26164
26154
|
} from "@excalidraw/common";
|
|
26165
26155
|
|
|
@@ -26399,7 +26389,7 @@ var SidebarInner = forwardRef4(
|
|
|
26399
26389
|
);
|
|
26400
26390
|
useEffect32(() => {
|
|
26401
26391
|
const handleKeyDown = (event) => {
|
|
26402
|
-
if (event.key ===
|
|
26392
|
+
if (event.key === KEYS45.ESCAPE && (!docked || !editorInterface.canFitSidebar)) {
|
|
26403
26393
|
closeLibrary();
|
|
26404
26394
|
}
|
|
26405
26395
|
};
|
|
@@ -27056,7 +27046,6 @@ var Preferences = ({
|
|
|
27056
27046
|
/* @__PURE__ */ jsx111(PreferencesToggleToolLockItem, {}),
|
|
27057
27047
|
/* @__PURE__ */ jsx111(PreferencesToggleSnapModeItem, {}),
|
|
27058
27048
|
/* @__PURE__ */ jsx111(PreferencesToggleGridModeItem, {}),
|
|
27059
|
-
/* @__PURE__ */ jsx111(PreferencesToggleZenModeItem, {}),
|
|
27060
27049
|
/* @__PURE__ */ jsx111(PreferencesToggleViewModeItem, {}),
|
|
27061
27050
|
/* @__PURE__ */ jsx111(PreferencesToggleElementPropertiesItem, {}),
|
|
27062
27051
|
/* @__PURE__ */ jsx111(PreferencesToggleArrowBindingItem, {}),
|
|
@@ -27358,7 +27347,7 @@ import {
|
|
|
27358
27347
|
import { isElementCompletelyInViewport } from "@excalidraw/element";
|
|
27359
27348
|
import { measureText as measureText7 } from "@excalidraw/element";
|
|
27360
27349
|
import {
|
|
27361
|
-
KEYS as
|
|
27350
|
+
KEYS as KEYS46,
|
|
27362
27351
|
randomInteger as randomInteger3,
|
|
27363
27352
|
addEventListener as addEventListener2,
|
|
27364
27353
|
getFontString as getFontString10
|
|
@@ -27531,7 +27520,7 @@ var SearchMenu2 = () => {
|
|
|
27531
27520
|
});
|
|
27532
27521
|
useEffect33(() => {
|
|
27533
27522
|
const eventHandler = (event) => {
|
|
27534
|
-
if (event.key ===
|
|
27523
|
+
if (event.key === KEYS46.ESCAPE && !app.state.openDialog && !app.state.openPopup) {
|
|
27535
27524
|
event.preventDefault();
|
|
27536
27525
|
event.stopPropagation();
|
|
27537
27526
|
setAppState({
|
|
@@ -27539,7 +27528,7 @@ var SearchMenu2 = () => {
|
|
|
27539
27528
|
});
|
|
27540
27529
|
return;
|
|
27541
27530
|
}
|
|
27542
|
-
if (event[
|
|
27531
|
+
if (event[KEYS46.CTRL_OR_CMD] && event.key === KEYS46.F) {
|
|
27543
27532
|
event.preventDefault();
|
|
27544
27533
|
event.stopPropagation();
|
|
27545
27534
|
if (app.state.openDialog) {
|
|
@@ -27557,14 +27546,14 @@ var SearchMenu2 = () => {
|
|
|
27557
27546
|
}
|
|
27558
27547
|
if (event.target instanceof HTMLElement && event.target.closest(".layer-ui__search")) {
|
|
27559
27548
|
if (stableState.searchMatches.items.length) {
|
|
27560
|
-
if (event.key ===
|
|
27549
|
+
if (event.key === KEYS46.ENTER) {
|
|
27561
27550
|
event.stopPropagation();
|
|
27562
27551
|
stableState.goToNextItem();
|
|
27563
27552
|
}
|
|
27564
|
-
if (event.key ===
|
|
27553
|
+
if (event.key === KEYS46.ARROW_UP) {
|
|
27565
27554
|
event.stopPropagation();
|
|
27566
27555
|
stableState.goToPreviousItem();
|
|
27567
|
-
} else if (event.key ===
|
|
27556
|
+
} else if (event.key === KEYS46.ARROW_DOWN) {
|
|
27568
27557
|
event.stopPropagation();
|
|
27569
27558
|
stableState.goToNextItem();
|
|
27570
27559
|
}
|
|
@@ -28053,7 +28042,7 @@ import { updateBindings as updateBindings3 } from "@excalidraw/element";
|
|
|
28053
28042
|
// components/Stats/DragInput.tsx
|
|
28054
28043
|
import clsx54 from "clsx";
|
|
28055
28044
|
import { useEffect as useEffect34, useRef as useRef30, useState as useState33 } from "react";
|
|
28056
|
-
import { EVENT as EVENT12, KEYS as
|
|
28045
|
+
import { EVENT as EVENT12, KEYS as KEYS47, cloneJSON as cloneJSON3 } from "@excalidraw/common";
|
|
28057
28046
|
import { deepCopyElement as deepCopyElement4 } from "@excalidraw/element";
|
|
28058
28047
|
import { CaptureUpdateAction as CaptureUpdateAction41 } from "@excalidraw/element";
|
|
28059
28048
|
|
|
@@ -28412,7 +28401,7 @@ var StatsDragInput = ({
|
|
|
28412
28401
|
onKeyDown: (event) => {
|
|
28413
28402
|
if (editable) {
|
|
28414
28403
|
const eventTarget = event.target;
|
|
28415
|
-
if (eventTarget instanceof HTMLInputElement && event.key ===
|
|
28404
|
+
if (eventTarget instanceof HTMLInputElement && event.key === KEYS47.ENTER) {
|
|
28416
28405
|
handleInputValue(eventTarget.value, elements, appState);
|
|
28417
28406
|
app.focusContainer();
|
|
28418
28407
|
}
|
|
@@ -30140,7 +30129,7 @@ var StatsInner = memo5(
|
|
|
30140
30129
|
|
|
30141
30130
|
// components/ElementLinkDialog.tsx
|
|
30142
30131
|
import { useCallback as useCallback16, useEffect as useEffect36, useState as useState35 } from "react";
|
|
30143
|
-
import { normalizeLink as normalizeLink2, KEYS as
|
|
30132
|
+
import { normalizeLink as normalizeLink2, KEYS as KEYS48 } from "@excalidraw/common";
|
|
30144
30133
|
import {
|
|
30145
30134
|
defaultGetElementLinkFromSelection as defaultGetElementLinkFromSelection2,
|
|
30146
30135
|
getLinkIdAndTypeFromSelection as getLinkIdAndTypeFromSelection2
|
|
@@ -30196,10 +30185,10 @@ var ElementLinkDialog = ({
|
|
|
30196
30185
|
}, [sourceElementId, nextLink, elementsMap, linkEdited, scene, onClose]);
|
|
30197
30186
|
useEffect36(() => {
|
|
30198
30187
|
const handleKeyDown = (event) => {
|
|
30199
|
-
if (appState.openDialog?.name === "elementLinkSelector" && event.key ===
|
|
30188
|
+
if (appState.openDialog?.name === "elementLinkSelector" && event.key === KEYS48.ENTER) {
|
|
30200
30189
|
handleConfirm();
|
|
30201
30190
|
}
|
|
30202
|
-
if (appState.openDialog?.name === "elementLinkSelector" && event.key ===
|
|
30191
|
+
if (appState.openDialog?.name === "elementLinkSelector" && event.key === KEYS48.ESCAPE) {
|
|
30203
30192
|
onClose?.();
|
|
30204
30193
|
}
|
|
30205
30194
|
};
|
|
@@ -30225,7 +30214,7 @@ var ElementLinkDialog = ({
|
|
|
30225
30214
|
setNextLink(value);
|
|
30226
30215
|
},
|
|
30227
30216
|
onKeyDown: (event) => {
|
|
30228
|
-
if (event.key ===
|
|
30217
|
+
if (event.key === KEYS48.ENTER) {
|
|
30229
30218
|
handleConfirm();
|
|
30230
30219
|
}
|
|
30231
30220
|
},
|
|
@@ -30325,11 +30314,11 @@ var FixedSideContainer = ({
|
|
|
30325
30314
|
import React38, { useMemo as useMemo14 } from "react";
|
|
30326
30315
|
import clsx57 from "clsx";
|
|
30327
30316
|
import { isDarwin as isDarwin4, isFirefox as isFirefox4, isWindows as isWindows2 } from "@excalidraw/common";
|
|
30328
|
-
import { KEYS as
|
|
30317
|
+
import { KEYS as KEYS50 } from "@excalidraw/common";
|
|
30329
30318
|
import { SHAPES as SHAPES5 } from "@excalidraw/element/shapes";
|
|
30330
30319
|
|
|
30331
30320
|
// components/HelpDialog/BasicHelpDialog.tsx
|
|
30332
|
-
import { isFirefox as isFirefox3, KEYS as
|
|
30321
|
+
import { isFirefox as isFirefox3, KEYS as KEYS49 } from "@excalidraw/common";
|
|
30333
30322
|
import { SHAPES as SHAPES4 } from "@excalidraw/element/shapes";
|
|
30334
30323
|
import { Fragment as Fragment20, jsx as jsx132, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
30335
30324
|
var Section2 = (props) => /* @__PURE__ */ jsxs70(Fragment20, { children: [
|
|
@@ -30376,7 +30365,7 @@ function BasicHelpDialog() {
|
|
|
30376
30365
|
className: "HelpDialog__island--tools",
|
|
30377
30366
|
caption: t("helpDialog.tools"),
|
|
30378
30367
|
children: [
|
|
30379
|
-
/* @__PURE__ */ jsx132(Shortcut, { label: t("toolBar.hand"), shortcuts: [
|
|
30368
|
+
/* @__PURE__ */ jsx132(Shortcut, { label: t("toolBar.hand"), shortcuts: [KEYS49.H] }),
|
|
30380
30369
|
SHAPES4.filter(({ myocSimplifiedMode }) => myocSimplifiedMode).map(
|
|
30381
30370
|
({ value, key }) => /* @__PURE__ */ jsx132(
|
|
30382
30371
|
Shortcut,
|
|
@@ -30412,14 +30401,7 @@ function BasicHelpDialog() {
|
|
|
30412
30401
|
className: "HelpDialog__island--view",
|
|
30413
30402
|
caption: t("helpDialog.view"),
|
|
30414
30403
|
children: [
|
|
30415
|
-
/* @__PURE__ */ jsx132(Shortcut, { label: t("helpDialog.smartZoom"), shortcuts: [
|
|
30416
|
-
/* @__PURE__ */ jsx132(
|
|
30417
|
-
Shortcut,
|
|
30418
|
-
{
|
|
30419
|
-
label: t("buttons.zenMode"),
|
|
30420
|
-
shortcuts: [getShortcutKey("Alt+Z")]
|
|
30421
|
-
}
|
|
30422
|
-
),
|
|
30404
|
+
/* @__PURE__ */ jsx132(Shortcut, { label: t("helpDialog.smartZoom"), shortcuts: [KEYS49.F] }),
|
|
30423
30405
|
/* @__PURE__ */ jsx132(
|
|
30424
30406
|
Shortcut,
|
|
30425
30407
|
{
|
|
@@ -30599,7 +30581,7 @@ var HelpDialog = ({ onClose }) => {
|
|
|
30599
30581
|
className: "HelpDialog__island--tools",
|
|
30600
30582
|
caption: t("helpDialog.tools"),
|
|
30601
30583
|
children: [
|
|
30602
|
-
/* @__PURE__ */ jsx133(Shortcut2, { label: t("toolBar.hand"), shortcuts: [
|
|
30584
|
+
/* @__PURE__ */ jsx133(Shortcut2, { label: t("toolBar.hand"), shortcuts: [KEYS50.H] }),
|
|
30603
30585
|
SHAPES5.map(({ value, key }) => /* @__PURE__ */ jsx133(
|
|
30604
30586
|
Shortcut2,
|
|
30605
30587
|
{
|
|
@@ -30608,13 +30590,13 @@ var HelpDialog = ({ onClose }) => {
|
|
|
30608
30590
|
},
|
|
30609
30591
|
value
|
|
30610
30592
|
)),
|
|
30611
|
-
/* @__PURE__ */ jsx133(Shortcut2, { label: t("toolBar.frame"), shortcuts: [
|
|
30612
|
-
/* @__PURE__ */ jsx133(Shortcut2, { label: t("toolBar.laser"), shortcuts: [
|
|
30593
|
+
/* @__PURE__ */ jsx133(Shortcut2, { label: t("toolBar.frame"), shortcuts: [KEYS50.F] }),
|
|
30594
|
+
/* @__PURE__ */ jsx133(Shortcut2, { label: t("toolBar.laser"), shortcuts: [KEYS50.K] }),
|
|
30613
30595
|
/* @__PURE__ */ jsx133(
|
|
30614
30596
|
Shortcut2,
|
|
30615
30597
|
{
|
|
30616
30598
|
label: t("labels.eyeDropper"),
|
|
30617
|
-
shortcuts: [
|
|
30599
|
+
shortcuts: [KEYS50.I, "Shift+S", "Shift+G"]
|
|
30618
30600
|
}
|
|
30619
30601
|
),
|
|
30620
30602
|
/* @__PURE__ */ jsx133(
|
|
@@ -30696,7 +30678,7 @@ var HelpDialog = ({ onClose }) => {
|
|
|
30696
30678
|
isOr: true
|
|
30697
30679
|
}
|
|
30698
30680
|
),
|
|
30699
|
-
/* @__PURE__ */ jsx133(Shortcut2, { label: t("toolBar.lock"), shortcuts: [
|
|
30681
|
+
/* @__PURE__ */ jsx133(Shortcut2, { label: t("toolBar.lock"), shortcuts: [KEYS50.Q] }),
|
|
30700
30682
|
/* @__PURE__ */ jsx133(
|
|
30701
30683
|
Shortcut2,
|
|
30702
30684
|
{
|
|
@@ -30732,7 +30714,7 @@ var HelpDialog = ({ onClose }) => {
|
|
|
30732
30714
|
Shortcut2,
|
|
30733
30715
|
{
|
|
30734
30716
|
label: t("helpDialog.smartZoom"),
|
|
30735
|
-
shortcuts: [
|
|
30717
|
+
shortcuts: [KEYS50.F]
|
|
30736
30718
|
}
|
|
30737
30719
|
),
|
|
30738
30720
|
/* @__PURE__ */ jsx133(
|
|
@@ -30777,13 +30759,6 @@ var HelpDialog = ({ onClose }) => {
|
|
|
30777
30759
|
shortcuts: ["Shift+PgUp/PgDn"]
|
|
30778
30760
|
}
|
|
30779
30761
|
),
|
|
30780
|
-
/* @__PURE__ */ jsx133(
|
|
30781
|
-
Shortcut2,
|
|
30782
|
-
{
|
|
30783
|
-
label: t("buttons.zenMode"),
|
|
30784
|
-
shortcuts: [getShortcutKey("Alt+Z")]
|
|
30785
|
-
}
|
|
30786
|
-
),
|
|
30787
30762
|
/* @__PURE__ */ jsx133(
|
|
30788
30763
|
Shortcut2,
|
|
30789
30764
|
{
|
|
@@ -30923,20 +30898,6 @@ var HelpDialog = ({ onClose }) => {
|
|
|
30923
30898
|
shortcuts: [getShortcutKey("Shift+Alt+C")]
|
|
30924
30899
|
}
|
|
30925
30900
|
),
|
|
30926
|
-
/* @__PURE__ */ jsx133(
|
|
30927
|
-
Shortcut2,
|
|
30928
|
-
{
|
|
30929
|
-
label: t("labels.copyStyles"),
|
|
30930
|
-
shortcuts: [getShortcutKey("CtrlOrCmd+Alt+C")]
|
|
30931
|
-
}
|
|
30932
|
-
),
|
|
30933
|
-
/* @__PURE__ */ jsx133(
|
|
30934
|
-
Shortcut2,
|
|
30935
|
-
{
|
|
30936
|
-
label: t("labels.pasteStyles"),
|
|
30937
|
-
shortcuts: [getShortcutKey("CtrlOrCmd+Alt+V")]
|
|
30938
|
-
}
|
|
30939
|
-
),
|
|
30940
30901
|
/* @__PURE__ */ jsx133(
|
|
30941
30902
|
Shortcut2,
|
|
30942
30903
|
{
|
|
@@ -34322,6 +34283,8 @@ var StaticCanvas = (props) => {
|
|
|
34322
34283
|
wrapper.replaceChildren(canvas);
|
|
34323
34284
|
canvas.classList.add("excalidraw__canvas", "static");
|
|
34324
34285
|
}
|
|
34286
|
+
const gridColorBold = getComputedStyle(wrapper).getPropertyValue("--color-grid-bold").trim();
|
|
34287
|
+
const gridColorRegular = getComputedStyle(wrapper).getPropertyValue("--color-grid-regular").trim();
|
|
34325
34288
|
renderStaticScene(
|
|
34326
34289
|
{
|
|
34327
34290
|
canvas,
|
|
@@ -34331,7 +34294,11 @@ var StaticCanvas = (props) => {
|
|
|
34331
34294
|
allElementsMap: props.allElementsMap,
|
|
34332
34295
|
visibleElements: props.visibleElements,
|
|
34333
34296
|
appState: props.appState,
|
|
34334
|
-
renderConfig:
|
|
34297
|
+
renderConfig: {
|
|
34298
|
+
...props.renderConfig,
|
|
34299
|
+
gridColorBold,
|
|
34300
|
+
gridColorRegular
|
|
34301
|
+
}
|
|
34335
34302
|
},
|
|
34336
34303
|
isRenderThrottlingEnabled()
|
|
34337
34304
|
);
|
|
@@ -35004,7 +34971,7 @@ var App = class _App extends React44.Component {
|
|
|
35004
34971
|
onFocus: (e) => e.target.select(),
|
|
35005
34972
|
onBlur: () => this.resetEditingFrame(f),
|
|
35006
34973
|
onKeyDown: (event) => {
|
|
35007
|
-
if (event.key ===
|
|
34974
|
+
if (event.key === KEYS51.ESCAPE || event.key === KEYS51.ENTER) {
|
|
35008
34975
|
this.resetEditingFrame(f);
|
|
35009
34976
|
}
|
|
35010
34977
|
},
|
|
@@ -35812,6 +35779,63 @@ var App = class _App extends React44.Component {
|
|
|
35812
35779
|
});
|
|
35813
35780
|
});
|
|
35814
35781
|
__publicField(this, "cancelInProgressAnimation", null);
|
|
35782
|
+
__publicField(this, "scrollToViewport", (target, opts) => {
|
|
35783
|
+
this.cancelInProgressAnimation?.();
|
|
35784
|
+
const zoom = { value: getNormalizedZoom(target.zoom) };
|
|
35785
|
+
const animateDuration = opts?.duration ?? 500;
|
|
35786
|
+
if (opts?.animate && animateDuration > 0) {
|
|
35787
|
+
const origScrollX = this.state.scrollX;
|
|
35788
|
+
const origScrollY = this.state.scrollY;
|
|
35789
|
+
const origZoom = this.state.zoom.value;
|
|
35790
|
+
const cancel = easeToValuesRAF({
|
|
35791
|
+
fromValues: {
|
|
35792
|
+
scrollX: origScrollX,
|
|
35793
|
+
scrollY: origScrollY,
|
|
35794
|
+
zoom: origZoom
|
|
35795
|
+
},
|
|
35796
|
+
toValues: {
|
|
35797
|
+
scrollX: target.scrollX,
|
|
35798
|
+
scrollY: target.scrollY,
|
|
35799
|
+
zoom: zoom.value
|
|
35800
|
+
},
|
|
35801
|
+
interpolateValue: (from, to, progress, key) => {
|
|
35802
|
+
if (key === "zoom") {
|
|
35803
|
+
return from * Math.pow(to / from, easeOut4(progress));
|
|
35804
|
+
}
|
|
35805
|
+
return void 0;
|
|
35806
|
+
},
|
|
35807
|
+
onStep: ({ scrollX, scrollY, zoom: zoom2 }) => {
|
|
35808
|
+
this.setState({
|
|
35809
|
+
scrollX,
|
|
35810
|
+
scrollY,
|
|
35811
|
+
zoom: { value: zoom2 }
|
|
35812
|
+
});
|
|
35813
|
+
},
|
|
35814
|
+
onStart: () => {
|
|
35815
|
+
this.setState({ shouldCacheIgnoreZoom: true });
|
|
35816
|
+
},
|
|
35817
|
+
onEnd: () => {
|
|
35818
|
+
this.cancelInProgressAnimation = null;
|
|
35819
|
+
this.setState({ shouldCacheIgnoreZoom: false });
|
|
35820
|
+
},
|
|
35821
|
+
onCancel: () => {
|
|
35822
|
+
this.cancelInProgressAnimation = null;
|
|
35823
|
+
this.setState({ shouldCacheIgnoreZoom: false });
|
|
35824
|
+
},
|
|
35825
|
+
duration: animateDuration
|
|
35826
|
+
});
|
|
35827
|
+
this.cancelInProgressAnimation = () => {
|
|
35828
|
+
cancel();
|
|
35829
|
+
this.cancelInProgressAnimation = null;
|
|
35830
|
+
};
|
|
35831
|
+
} else {
|
|
35832
|
+
this.setState({
|
|
35833
|
+
scrollX: target.scrollX,
|
|
35834
|
+
scrollY: target.scrollY,
|
|
35835
|
+
zoom
|
|
35836
|
+
});
|
|
35837
|
+
}
|
|
35838
|
+
});
|
|
35815
35839
|
__publicField(this, "scrollToContent", (target = this.scene.getNonDeletedElements(), opts) => {
|
|
35816
35840
|
if (typeof target === "string") {
|
|
35817
35841
|
let id;
|
|
@@ -35839,7 +35863,6 @@ var App = class _App extends React44.Component {
|
|
|
35839
35863
|
}
|
|
35840
35864
|
return;
|
|
35841
35865
|
}
|
|
35842
|
-
this.cancelInProgressAnimation?.();
|
|
35843
35866
|
const targetElements = Array.isArray(target) ? target : [target];
|
|
35844
35867
|
let zoom = this.state.zoom;
|
|
35845
35868
|
let scrollX = this.state.scrollX;
|
|
@@ -35862,48 +35885,17 @@ var App = class _App extends React44.Component {
|
|
|
35862
35885
|
scrollX = scroll.scrollX;
|
|
35863
35886
|
scrollY = scroll.scrollY;
|
|
35864
35887
|
}
|
|
35865
|
-
|
|
35866
|
-
|
|
35867
|
-
|
|
35868
|
-
|
|
35869
|
-
|
|
35870
|
-
|
|
35871
|
-
|
|
35872
|
-
|
|
35873
|
-
|
|
35874
|
-
|
|
35875
|
-
|
|
35876
|
-
interpolateValue: (from, to, progress, key) => {
|
|
35877
|
-
if (key === "zoom") {
|
|
35878
|
-
return from * Math.pow(to / from, easeOut4(progress));
|
|
35879
|
-
}
|
|
35880
|
-
return void 0;
|
|
35881
|
-
},
|
|
35882
|
-
onStep: ({ scrollX: scrollX2, scrollY: scrollY2, zoom: zoom2 }) => {
|
|
35883
|
-
this.setState({
|
|
35884
|
-
scrollX: scrollX2,
|
|
35885
|
-
scrollY: scrollY2,
|
|
35886
|
-
zoom: { value: zoom2 }
|
|
35887
|
-
});
|
|
35888
|
-
},
|
|
35889
|
-
onStart: () => {
|
|
35890
|
-
this.setState({ shouldCacheIgnoreZoom: true });
|
|
35891
|
-
},
|
|
35892
|
-
onEnd: () => {
|
|
35893
|
-
this.setState({ shouldCacheIgnoreZoom: false });
|
|
35894
|
-
},
|
|
35895
|
-
onCancel: () => {
|
|
35896
|
-
this.setState({ shouldCacheIgnoreZoom: false });
|
|
35897
|
-
},
|
|
35898
|
-
duration: opts?.duration ?? 500
|
|
35899
|
-
});
|
|
35900
|
-
this.cancelInProgressAnimation = () => {
|
|
35901
|
-
cancel();
|
|
35902
|
-
this.cancelInProgressAnimation = null;
|
|
35903
|
-
};
|
|
35904
|
-
} else {
|
|
35905
|
-
this.setState({ scrollX, scrollY, zoom });
|
|
35906
|
-
}
|
|
35888
|
+
this.scrollToViewport(
|
|
35889
|
+
{
|
|
35890
|
+
scrollX,
|
|
35891
|
+
scrollY,
|
|
35892
|
+
zoom: zoom.value
|
|
35893
|
+
},
|
|
35894
|
+
{
|
|
35895
|
+
animate: opts?.animate,
|
|
35896
|
+
duration: opts?.duration
|
|
35897
|
+
}
|
|
35898
|
+
);
|
|
35907
35899
|
});
|
|
35908
35900
|
__publicField(this, "maybeUnfollowRemoteUser", () => {
|
|
35909
35901
|
if (this.state.userToFollow) {
|
|
@@ -36098,7 +36090,7 @@ var App = class _App extends React44.Component {
|
|
|
36098
36090
|
});
|
|
36099
36091
|
}
|
|
36100
36092
|
if (!isInputLike(event.target)) {
|
|
36101
|
-
if ((event.key ===
|
|
36093
|
+
if ((event.key === KEYS51.ESCAPE || event.key === KEYS51.ENTER) && this.state.croppingElementId) {
|
|
36102
36094
|
this.finishImageCropping();
|
|
36103
36095
|
return;
|
|
36104
36096
|
}
|
|
@@ -36106,13 +36098,13 @@ var App = class _App extends React44.Component {
|
|
|
36106
36098
|
this.scene.getNonDeletedElementsMap(),
|
|
36107
36099
|
this.state
|
|
36108
36100
|
);
|
|
36109
|
-
if (selectedElements.length === 1 && isImageElement9(selectedElements[0]) && event.key ===
|
|
36101
|
+
if (selectedElements.length === 1 && isImageElement9(selectedElements[0]) && event.key === KEYS51.ENTER) {
|
|
36110
36102
|
this.startImageCropping(selectedElements[0]);
|
|
36111
36103
|
return;
|
|
36112
36104
|
}
|
|
36113
|
-
if (event.key ===
|
|
36105
|
+
if (event.key === KEYS51.ESCAPE) {
|
|
36114
36106
|
this.updateEditorAtom(convertElementTypePopupAtom, null);
|
|
36115
|
-
} else if (event.key ===
|
|
36107
|
+
} else if (event.key === KEYS51.TAB && (document.activeElement === this.excalidrawContainerRef?.current || document.activeElement?.classList.contains(
|
|
36116
36108
|
CLASSES11.CONVERT_ELEMENT_TYPE_POPUP
|
|
36117
36109
|
))) {
|
|
36118
36110
|
event.preventDefault();
|
|
@@ -36131,13 +36123,13 @@ var App = class _App extends React44.Component {
|
|
|
36131
36123
|
});
|
|
36132
36124
|
}
|
|
36133
36125
|
}
|
|
36134
|
-
if (event.key ===
|
|
36126
|
+
if (event.key === KEYS51.ESCAPE && this.flowChartCreator.isCreatingChart) {
|
|
36135
36127
|
this.flowChartCreator.clear();
|
|
36136
36128
|
this.triggerRender(true);
|
|
36137
36129
|
return;
|
|
36138
36130
|
}
|
|
36139
36131
|
const arrowKeyPressed = isArrowKey2(event.key);
|
|
36140
|
-
if (event[
|
|
36132
|
+
if (event[KEYS51.CTRL_OR_CMD] && arrowKeyPressed && !event.shiftKey) {
|
|
36141
36133
|
event.preventDefault();
|
|
36142
36134
|
const selectedElements2 = getSelectedElements(
|
|
36143
36135
|
this.scene.getNonDeletedElementsMap(),
|
|
@@ -36221,7 +36213,7 @@ var App = class _App extends React44.Component {
|
|
|
36221
36213
|
}
|
|
36222
36214
|
}
|
|
36223
36215
|
}
|
|
36224
|
-
if (event[
|
|
36216
|
+
if (event[KEYS51.CTRL_OR_CMD] && event.key === KEYS51.P && !event.shiftKey && !event.altKey) {
|
|
36225
36217
|
this.setToast({
|
|
36226
36218
|
message: t("commandPalette.shortcutHint", {
|
|
36227
36219
|
shortcut: getShortcutFromShortcutName("commandPalette")
|
|
@@ -36230,15 +36222,15 @@ var App = class _App extends React44.Component {
|
|
|
36230
36222
|
event.preventDefault();
|
|
36231
36223
|
return;
|
|
36232
36224
|
}
|
|
36233
|
-
if (event[
|
|
36225
|
+
if (event[KEYS51.CTRL_OR_CMD] && event.key.toLowerCase() === KEYS51.V) {
|
|
36234
36226
|
IS_PLAIN_PASTE = event.shiftKey;
|
|
36235
36227
|
clearTimeout(IS_PLAIN_PASTE_TIMER);
|
|
36236
36228
|
IS_PLAIN_PASTE_TIMER = window.setTimeout(() => {
|
|
36237
36229
|
IS_PLAIN_PASTE = false;
|
|
36238
36230
|
}, 100);
|
|
36239
36231
|
}
|
|
36240
|
-
if (event[
|
|
36241
|
-
if (event.code ===
|
|
36232
|
+
if (event[KEYS51.CTRL_OR_CMD] && isWritableElement5(event.target)) {
|
|
36233
|
+
if (event.code === CODES11.MINUS || event.code === CODES11.EQUAL) {
|
|
36242
36234
|
event.preventDefault();
|
|
36243
36235
|
return;
|
|
36244
36236
|
}
|
|
@@ -36246,24 +36238,24 @@ var App = class _App extends React44.Component {
|
|
|
36246
36238
|
if (
|
|
36247
36239
|
// inside an input
|
|
36248
36240
|
isWritableElement5(event.target) && // unless pressing escape (finalize action)
|
|
36249
|
-
event.key !==
|
|
36241
|
+
event.key !== KEYS51.ESCAPE || // or unless using arrows (to move between buttons)
|
|
36250
36242
|
isArrowKey2(event.key) && isInputLike(event.target)
|
|
36251
36243
|
) {
|
|
36252
36244
|
return;
|
|
36253
36245
|
}
|
|
36254
|
-
if (event.key ===
|
|
36246
|
+
if (event.key === KEYS51.QUESTION_MARK) {
|
|
36255
36247
|
this.setState({
|
|
36256
36248
|
openDialog: { name: "help" }
|
|
36257
36249
|
});
|
|
36258
36250
|
return;
|
|
36259
|
-
} else if (event.key.toLowerCase() ===
|
|
36251
|
+
} else if (event.key.toLowerCase() === KEYS51.E && event.shiftKey && event[KEYS51.CTRL_OR_CMD]) {
|
|
36260
36252
|
event.preventDefault();
|
|
36261
36253
|
this.setState({ openDialog: { name: "imageExport" } });
|
|
36262
36254
|
return;
|
|
36263
36255
|
}
|
|
36264
|
-
if (event.key ===
|
|
36256
|
+
if (event.key === KEYS51.PAGE_UP || event.key === KEYS51.PAGE_DOWN) {
|
|
36265
36257
|
let offset = (event.shiftKey ? this.state.width : this.state.height) / this.state.zoom.value;
|
|
36266
|
-
if (event.key ===
|
|
36258
|
+
if (event.key === KEYS51.PAGE_DOWN) {
|
|
36267
36259
|
offset = -offset;
|
|
36268
36260
|
}
|
|
36269
36261
|
if (event.shiftKey) {
|
|
@@ -36279,7 +36271,7 @@ var App = class _App extends React44.Component {
|
|
|
36279
36271
|
if (this.state.openDialog?.name === "elementLinkSelector") {
|
|
36280
36272
|
return;
|
|
36281
36273
|
}
|
|
36282
|
-
if (event.key ===
|
|
36274
|
+
if (event.key === KEYS51.ALT) {
|
|
36283
36275
|
if (getFeatureFlag4("COMPLEX_BINDINGS")) {
|
|
36284
36276
|
this.handleSkipBindMode();
|
|
36285
36277
|
} else {
|
|
@@ -36290,7 +36282,7 @@ var App = class _App extends React44.Component {
|
|
|
36290
36282
|
return;
|
|
36291
36283
|
}
|
|
36292
36284
|
const shouldPreventToolSwitching = this.props.viewModeEnabled === true;
|
|
36293
|
-
if (!shouldPreventToolSwitching && this.state.viewModeEnabled && event.key ===
|
|
36285
|
+
if (!shouldPreventToolSwitching && this.state.viewModeEnabled && event.key === KEYS51.ESCAPE) {
|
|
36294
36286
|
this.setActiveTool({ type: "selection" });
|
|
36295
36287
|
return;
|
|
36296
36288
|
}
|
|
@@ -36321,7 +36313,7 @@ var App = class _App extends React44.Component {
|
|
|
36321
36313
|
}
|
|
36322
36314
|
event.stopPropagation();
|
|
36323
36315
|
return;
|
|
36324
|
-
} else if (event.key ===
|
|
36316
|
+
} else if (event.key === KEYS51.Q) {
|
|
36325
36317
|
this.toggleLock("keyboard");
|
|
36326
36318
|
event.stopPropagation();
|
|
36327
36319
|
return;
|
|
@@ -36330,7 +36322,7 @@ var App = class _App extends React44.Component {
|
|
|
36330
36322
|
if (this.state.viewModeEnabled) {
|
|
36331
36323
|
return;
|
|
36332
36324
|
}
|
|
36333
|
-
if (event[
|
|
36325
|
+
if (event[KEYS51.CTRL_OR_CMD] && !event.repeat) {
|
|
36334
36326
|
if (getFeatureFlag4("COMPLEX_BINDINGS")) {
|
|
36335
36327
|
this.resetDelayedBindMode();
|
|
36336
36328
|
}
|
|
@@ -36365,13 +36357,13 @@ var App = class _App extends React44.Component {
|
|
|
36365
36357
|
const step = this.getEffectiveGridSize() && (event.shiftKey ? ELEMENT_TRANSLATE_AMOUNT : this.getEffectiveGridSize()) || (event.shiftKey ? ELEMENT_SHIFT_TRANSLATE_AMOUNT : ELEMENT_TRANSLATE_AMOUNT);
|
|
36366
36358
|
let offsetX = 0;
|
|
36367
36359
|
let offsetY = 0;
|
|
36368
|
-
if (event.key ===
|
|
36360
|
+
if (event.key === KEYS51.ARROW_LEFT) {
|
|
36369
36361
|
offsetX = -step;
|
|
36370
|
-
} else if (event.key ===
|
|
36362
|
+
} else if (event.key === KEYS51.ARROW_RIGHT) {
|
|
36371
36363
|
offsetX = step;
|
|
36372
|
-
} else if (event.key ===
|
|
36364
|
+
} else if (event.key === KEYS51.ARROW_UP) {
|
|
36373
36365
|
offsetY = -step;
|
|
36374
|
-
} else if (event.key ===
|
|
36366
|
+
} else if (event.key === KEYS51.ARROW_DOWN) {
|
|
36375
36367
|
offsetY = step;
|
|
36376
36368
|
}
|
|
36377
36369
|
selectedElements.forEach((element) => {
|
|
@@ -36389,11 +36381,11 @@ var App = class _App extends React44.Component {
|
|
|
36389
36381
|
});
|
|
36390
36382
|
this.scene.triggerUpdate();
|
|
36391
36383
|
event.preventDefault();
|
|
36392
|
-
} else if (event.key ===
|
|
36384
|
+
} else if (event.key === KEYS51.ENTER) {
|
|
36393
36385
|
const selectedElements = this.scene.getSelectedElements(this.state);
|
|
36394
36386
|
if (selectedElements.length === 1) {
|
|
36395
36387
|
const selectedElement = selectedElements[0];
|
|
36396
|
-
if (event[
|
|
36388
|
+
if (event[KEYS51.CTRL_OR_CMD] || isLineElement8(selectedElement)) {
|
|
36397
36389
|
if (isLinearElement12(selectedElement)) {
|
|
36398
36390
|
if (!this.state.selectedLinearElement?.isEditing || this.state.selectedLinearElement.elementId !== selectedElement.id) {
|
|
36399
36391
|
this.store.scheduleCapture();
|
|
@@ -36428,26 +36420,26 @@ var App = class _App extends React44.Component {
|
|
|
36428
36420
|
}
|
|
36429
36421
|
}
|
|
36430
36422
|
}
|
|
36431
|
-
if (event.key ===
|
|
36423
|
+
if (event.key === KEYS51.SPACE && gesture.pointers.size === 0) {
|
|
36432
36424
|
isHoldingSpace = true;
|
|
36433
36425
|
setCursor(this.interactiveCanvas, CURSOR_TYPE4.GRAB);
|
|
36434
36426
|
event.preventDefault();
|
|
36435
36427
|
}
|
|
36436
|
-
if ((event.key ===
|
|
36428
|
+
if ((event.key === KEYS51.G || event.key === KEYS51.S) && !event.altKey && !event[KEYS51.CTRL_OR_CMD]) {
|
|
36437
36429
|
const selectedElements = this.scene.getSelectedElements(this.state);
|
|
36438
36430
|
if (this.state.activeTool.type === "selection" && !selectedElements.length) {
|
|
36439
36431
|
return;
|
|
36440
36432
|
}
|
|
36441
|
-
if (event.key ===
|
|
36433
|
+
if (event.key === KEYS51.G && (hasBackground(this.state.activeTool.type) || selectedElements.some((element) => hasBackground(element.type)))) {
|
|
36442
36434
|
this.setState({ openPopup: "elementBackground" });
|
|
36443
36435
|
event.stopPropagation();
|
|
36444
36436
|
}
|
|
36445
|
-
if (event.key ===
|
|
36437
|
+
if (event.key === KEYS51.S) {
|
|
36446
36438
|
this.setState({ openPopup: "elementStroke" });
|
|
36447
36439
|
event.stopPropagation();
|
|
36448
36440
|
}
|
|
36449
36441
|
}
|
|
36450
|
-
if (!event[
|
|
36442
|
+
if (!event[KEYS51.CTRL_OR_CMD] && event.shiftKey && event.key.toLowerCase() === KEYS51.F) {
|
|
36451
36443
|
const selectedElements = this.scene.getSelectedElements(this.state);
|
|
36452
36444
|
if (this.state.activeTool.type === "selection" && !selectedElements.length) {
|
|
36453
36445
|
return;
|
|
@@ -36463,8 +36455,8 @@ var App = class _App extends React44.Component {
|
|
|
36463
36455
|
}
|
|
36464
36456
|
}
|
|
36465
36457
|
const lowerCased = event.key.toLocaleLowerCase();
|
|
36466
|
-
const isPickingStroke = lowerCased ===
|
|
36467
|
-
const isPickingBackground = event.key ===
|
|
36458
|
+
const isPickingStroke = lowerCased === KEYS51.S && event.shiftKey && !event[KEYS51.CTRL_OR_CMD];
|
|
36459
|
+
const isPickingBackground = event.key === KEYS51.I || lowerCased === KEYS51.G && event.shiftKey;
|
|
36468
36460
|
if (isPickingStroke || isPickingBackground) {
|
|
36469
36461
|
this.openEyeDropper({
|
|
36470
36462
|
type: isPickingStroke ? "stroke" : "background"
|
|
@@ -36473,7 +36465,7 @@ var App = class _App extends React44.Component {
|
|
|
36473
36465
|
}
|
|
36474
36466
|
));
|
|
36475
36467
|
__publicField(this, "onKeyUp", withBatchedUpdates((event) => {
|
|
36476
|
-
if (event.key ===
|
|
36468
|
+
if (event.key === KEYS51.SPACE) {
|
|
36477
36469
|
if (this.state.viewModeEnabled && this.state.activeTool.type !== "laser" || this.state.openDialog?.name === "elementLinkSelector") {
|
|
36478
36470
|
setCursor(this.interactiveCanvas, CURSOR_TYPE4.GRAB);
|
|
36479
36471
|
} else if (isSelectionLikeTool(this.state.activeTool.type)) {
|
|
@@ -36489,10 +36481,10 @@ var App = class _App extends React44.Component {
|
|
|
36489
36481
|
}
|
|
36490
36482
|
isHoldingSpace = false;
|
|
36491
36483
|
}
|
|
36492
|
-
if (event.key ===
|
|
36484
|
+
if (event.key === KEYS51.ALT) {
|
|
36493
36485
|
maybeHandleArrowPointlikeDrag({ app: this, event });
|
|
36494
36486
|
}
|
|
36495
|
-
if (event.key ===
|
|
36487
|
+
if (event.key === KEYS51.ALT && this.state.bindMode === "skip" || !event[KEYS51.CTRL_OR_CMD] && !isBindingEnabled2(this.state)) {
|
|
36496
36488
|
this.setState({
|
|
36497
36489
|
bindMode: "orbit"
|
|
36498
36490
|
});
|
|
@@ -36520,7 +36512,7 @@ var App = class _App extends React44.Component {
|
|
|
36520
36512
|
}
|
|
36521
36513
|
}
|
|
36522
36514
|
}
|
|
36523
|
-
if (!event[
|
|
36515
|
+
if (!event[KEYS51.CTRL_OR_CMD]) {
|
|
36524
36516
|
const preferenceEnabled = this.state.bindingPreference === "enabled";
|
|
36525
36517
|
if (this.state.isBindingEnabled !== preferenceEnabled) {
|
|
36526
36518
|
flushSync3(() => {
|
|
@@ -36578,7 +36570,7 @@ var App = class _App extends React44.Component {
|
|
|
36578
36570
|
});
|
|
36579
36571
|
}
|
|
36580
36572
|
}
|
|
36581
|
-
if (!event[
|
|
36573
|
+
if (!event[KEYS51.CTRL_OR_CMD]) {
|
|
36582
36574
|
if (this.flowChartCreator.isCreatingChart) {
|
|
36583
36575
|
if (this.flowChartCreator.pendingNodes?.length) {
|
|
36584
36576
|
this.scene.insertElements(this.flowChartCreator.pendingNodes);
|
|
@@ -36960,7 +36952,7 @@ var App = class _App extends React44.Component {
|
|
|
36960
36952
|
);
|
|
36961
36953
|
if (selectedElements.length === 1 && isLinearElement12(selectedElements[0])) {
|
|
36962
36954
|
const selectedLinearElement = selectedElements[0];
|
|
36963
|
-
if ((event[
|
|
36955
|
+
if ((event[KEYS51.CTRL_OR_CMD] && isSimpleArrow(selectedLinearElement) || isLineElement8(selectedLinearElement)) && (!this.state.selectedLinearElement?.isEditing || this.state.selectedLinearElement.elementId !== selectedLinearElement.id)) {
|
|
36964
36956
|
this.actionManager.executeAction(actionToggleLinearEditor);
|
|
36965
36957
|
return;
|
|
36966
36958
|
} else if (this.state.selectedLinearElement && isElbowArrow10(selectedElements[0])) {
|
|
@@ -37045,7 +37037,7 @@ var App = class _App extends React44.Component {
|
|
|
37045
37037
|
}
|
|
37046
37038
|
}
|
|
37047
37039
|
resetCursor(this.interactiveCanvas);
|
|
37048
|
-
if (!event[
|
|
37040
|
+
if (!event[KEYS51.CTRL_OR_CMD] && !this.state.viewModeEnabled) {
|
|
37049
37041
|
const hitElement = this.getElementAtPosition(sceneX, sceneY);
|
|
37050
37042
|
if (isIframeLikeElement2(hitElement)) {
|
|
37051
37043
|
this.setState({
|
|
@@ -37611,7 +37603,7 @@ var App = class _App extends React44.Component {
|
|
|
37611
37603
|
setCursor(this.interactiveCanvas, CURSOR_TYPE4.AUTO);
|
|
37612
37604
|
} else if (
|
|
37613
37605
|
// if using cmd/ctrl, we're not dragging
|
|
37614
|
-
!event[
|
|
37606
|
+
!event[KEYS51.CTRL_OR_CMD] && // editing text -> don't show move cursor when hovering over its bbox
|
|
37615
37607
|
hitElement?.id !== this.state.editingTextElement?.id
|
|
37616
37608
|
) {
|
|
37617
37609
|
if ((hitElement || this.isHittingCommonBoundingBoxOfSelectedElements(
|
|
@@ -38307,7 +38299,7 @@ var App = class _App extends React44.Component {
|
|
|
38307
38299
|
) : makeNextSelectedElementIds2({}, prevState)
|
|
38308
38300
|
}));
|
|
38309
38301
|
} else if (hitElement != null) {
|
|
38310
|
-
if (event[
|
|
38302
|
+
if (event[KEYS51.CTRL_OR_CMD]) {
|
|
38311
38303
|
if (event.altKey) {
|
|
38312
38304
|
if (this.state.openDialog?.name === "elementLinkSelector") {
|
|
38313
38305
|
this.setOpenDialog(null);
|
|
@@ -38516,7 +38508,7 @@ var App = class _App extends React44.Component {
|
|
|
38516
38508
|
const [gridX, gridY] = getGridPoint2(
|
|
38517
38509
|
sceneX,
|
|
38518
38510
|
sceneY,
|
|
38519
|
-
this.lastPointerDownEvent?.[
|
|
38511
|
+
this.lastPointerDownEvent?.[KEYS51.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
38520
38512
|
);
|
|
38521
38513
|
const element = newIframeElement({
|
|
38522
38514
|
type: "iframe",
|
|
@@ -38546,7 +38538,7 @@ var App = class _App extends React44.Component {
|
|
|
38546
38538
|
const [gridX, gridY] = getGridPoint2(
|
|
38547
38539
|
sceneX,
|
|
38548
38540
|
sceneY,
|
|
38549
|
-
this.lastPointerDownEvent?.[
|
|
38541
|
+
this.lastPointerDownEvent?.[KEYS51.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
38550
38542
|
);
|
|
38551
38543
|
const embedLink = getEmbedLink2(link);
|
|
38552
38544
|
if (!embedLink) {
|
|
@@ -38586,7 +38578,7 @@ var App = class _App extends React44.Component {
|
|
|
38586
38578
|
const [gridX, gridY] = getGridPoint2(
|
|
38587
38579
|
sceneX,
|
|
38588
38580
|
sceneY,
|
|
38589
|
-
this.lastPointerDownEvent?.[
|
|
38581
|
+
this.lastPointerDownEvent?.[KEYS51.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
38590
38582
|
);
|
|
38591
38583
|
const topLayerFrame = addToFrameUnderCursor ? this.getTopLayerFrameAtSceneCoords({
|
|
38592
38584
|
x: gridX,
|
|
@@ -38692,7 +38684,7 @@ var App = class _App extends React44.Component {
|
|
|
38692
38684
|
const [gridX, gridY] = getGridPoint2(
|
|
38693
38685
|
pointerDownState.origin.x,
|
|
38694
38686
|
pointerDownState.origin.y,
|
|
38695
|
-
event[
|
|
38687
|
+
event[KEYS51.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
38696
38688
|
);
|
|
38697
38689
|
const topLayerFrame = this.getTopLayerFrameAtSceneCoords({
|
|
38698
38690
|
x: gridX,
|
|
@@ -38828,7 +38820,7 @@ var App = class _App extends React44.Component {
|
|
|
38828
38820
|
const [gridX, gridY] = getGridPoint2(
|
|
38829
38821
|
pointerDownState.origin.x,
|
|
38830
38822
|
pointerDownState.origin.y,
|
|
38831
|
-
this.lastPointerDownEvent?.[
|
|
38823
|
+
this.lastPointerDownEvent?.[KEYS51.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
38832
38824
|
);
|
|
38833
38825
|
const topLayerFrame = this.getTopLayerFrameAtSceneCoords({
|
|
38834
38826
|
x: gridX,
|
|
@@ -38876,7 +38868,7 @@ var App = class _App extends React44.Component {
|
|
|
38876
38868
|
const [gridX, gridY] = getGridPoint2(
|
|
38877
38869
|
pointerDownState.origin.x,
|
|
38878
38870
|
pointerDownState.origin.y,
|
|
38879
|
-
this.lastPointerDownEvent?.[
|
|
38871
|
+
this.lastPointerDownEvent?.[KEYS51.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
38880
38872
|
);
|
|
38881
38873
|
const constructorOpts = {
|
|
38882
38874
|
x: gridX,
|
|
@@ -39478,7 +39470,7 @@ var App = class _App extends React44.Component {
|
|
|
39478
39470
|
let [gridX, gridY] = getGridPoint2(
|
|
39479
39471
|
pointerCoords.x,
|
|
39480
39472
|
pointerCoords.y,
|
|
39481
|
-
event[
|
|
39473
|
+
event[KEYS51.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
39482
39474
|
);
|
|
39483
39475
|
const image = isInitializedImageElement3(newElement7) && this.imageCache.get(newElement7.fileId)?.image;
|
|
39484
39476
|
const aspectRatio = image && !(image instanceof Promise) ? image.width / image.height : null;
|
|
@@ -39544,7 +39536,7 @@ var App = class _App extends React44.Component {
|
|
|
39544
39536
|
const [x, y] = getGridPoint2(
|
|
39545
39537
|
pointerCoords.x - pointerDownState.resize.offset.x,
|
|
39546
39538
|
pointerCoords.y - pointerDownState.resize.offset.y,
|
|
39547
|
-
event[
|
|
39539
|
+
event[KEYS51.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
39548
39540
|
);
|
|
39549
39541
|
const croppingElement = this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);
|
|
39550
39542
|
if (transformHandleType && croppingElement && isImageElement9(croppingElement)) {
|
|
@@ -39556,7 +39548,7 @@ var App = class _App extends React44.Component {
|
|
|
39556
39548
|
const [gridX, gridY] = getGridPoint2(
|
|
39557
39549
|
pointerCoords.x,
|
|
39558
39550
|
pointerCoords.y,
|
|
39559
|
-
event[
|
|
39551
|
+
event[KEYS51.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
39560
39552
|
);
|
|
39561
39553
|
const dragOffset = {
|
|
39562
39554
|
x: gridX - pointerDownState.originInGrid.x,
|
|
@@ -39620,7 +39612,7 @@ var App = class _App extends React44.Component {
|
|
|
39620
39612
|
let [resizeX, resizeY] = getGridPoint2(
|
|
39621
39613
|
pointerCoords.x - pointerDownState.resize.offset.x,
|
|
39622
39614
|
pointerCoords.y - pointerDownState.resize.offset.y,
|
|
39623
|
-
event[
|
|
39615
|
+
event[KEYS51.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
39624
39616
|
);
|
|
39625
39617
|
const frameElementsOffsetsMap = /* @__PURE__ */ new Map();
|
|
39626
39618
|
selectedFrames.forEach((frame) => {
|
|
@@ -39639,7 +39631,7 @@ var App = class _App extends React44.Component {
|
|
|
39639
39631
|
const [gridX, gridY] = getGridPoint2(
|
|
39640
39632
|
pointerCoords.x,
|
|
39641
39633
|
pointerCoords.y,
|
|
39642
|
-
event[
|
|
39634
|
+
event[KEYS51.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
39643
39635
|
);
|
|
39644
39636
|
const dragOffset = {
|
|
39645
39637
|
x: gridX - pointerDownState.originInGrid.x,
|
|
@@ -39692,22 +39684,13 @@ var App = class _App extends React44.Component {
|
|
|
39692
39684
|
});
|
|
39693
39685
|
__publicField(this, "getContextMenuItems", (type) => {
|
|
39694
39686
|
const options = [];
|
|
39695
|
-
options.push(actionCopyAsPng, actionCopyAsSvg);
|
|
39696
39687
|
if (type === "canvas") {
|
|
39697
39688
|
if (this.state.viewModeEnabled) {
|
|
39698
|
-
return [
|
|
39699
|
-
...options,
|
|
39700
|
-
actionToggleGridMode,
|
|
39701
|
-
actionToggleZenMode,
|
|
39702
|
-
actionToggleViewMode,
|
|
39703
|
-
actionToggleStats
|
|
39704
|
-
];
|
|
39689
|
+
return [actionToggleGridMode, actionToggleViewMode, actionToggleStats];
|
|
39705
39690
|
}
|
|
39706
39691
|
return [
|
|
39707
39692
|
actionPaste,
|
|
39708
39693
|
CONTEXT_MENU_SEPARATOR,
|
|
39709
|
-
actionCopyAsPng,
|
|
39710
|
-
actionCopyAsSvg,
|
|
39711
39694
|
copyText,
|
|
39712
39695
|
CONTEXT_MENU_SEPARATOR,
|
|
39713
39696
|
actionSelectAll,
|
|
@@ -39717,7 +39700,6 @@ var App = class _App extends React44.Component {
|
|
|
39717
39700
|
actionToggleObjectsSnapMode,
|
|
39718
39701
|
actionToggleArrowBinding,
|
|
39719
39702
|
actionToggleMidpointSnapping,
|
|
39720
|
-
actionToggleZenMode,
|
|
39721
39703
|
actionToggleViewMode,
|
|
39722
39704
|
actionToggleStats
|
|
39723
39705
|
];
|
|
@@ -39744,21 +39726,17 @@ var App = class _App extends React44.Component {
|
|
|
39744
39726
|
actionWrapSelectionInFrame,
|
|
39745
39727
|
CONTEXT_MENU_SEPARATOR,
|
|
39746
39728
|
actionToggleCropEditor,
|
|
39729
|
+
actionArrangeElements,
|
|
39747
39730
|
actionNormaliseElements,
|
|
39748
39731
|
CONTEXT_MENU_SEPARATOR,
|
|
39749
39732
|
...options,
|
|
39750
39733
|
CONTEXT_MENU_SEPARATOR,
|
|
39751
|
-
actionCopyStyles,
|
|
39752
|
-
actionPasteStyles,
|
|
39753
|
-
CONTEXT_MENU_SEPARATOR,
|
|
39754
39734
|
actionGroup,
|
|
39755
39735
|
actionTextAutoResize,
|
|
39756
39736
|
actionUnbindText,
|
|
39757
39737
|
actionBindText,
|
|
39758
39738
|
actionWrapTextInContainer,
|
|
39759
39739
|
actionUngroup,
|
|
39760
|
-
CONTEXT_MENU_SEPARATOR,
|
|
39761
|
-
actionAddToLibrary,
|
|
39762
39740
|
...zIndexActions,
|
|
39763
39741
|
CONTEXT_MENU_SEPARATOR,
|
|
39764
39742
|
actionFlipHorizontal,
|
|
@@ -39779,7 +39757,7 @@ var App = class _App extends React44.Component {
|
|
|
39779
39757
|
__publicField(this, "handleWheel", withBatchedUpdates(
|
|
39780
39758
|
(event) => {
|
|
39781
39759
|
if (!(event.target instanceof HTMLCanvasElement || event.target instanceof HTMLTextAreaElement || event.target instanceof HTMLIFrameElement || event.target instanceof HTMLElement && event.target.classList.contains(CLASSES11.FRAME_NAME))) {
|
|
39782
|
-
if (event[
|
|
39760
|
+
if (event[KEYS51.CTRL_OR_CMD]) {
|
|
39783
39761
|
event.preventDefault();
|
|
39784
39762
|
}
|
|
39785
39763
|
return;
|
|
@@ -39960,6 +39938,7 @@ var App = class _App extends React44.Component {
|
|
|
39960
39938
|
history: {
|
|
39961
39939
|
clear: this.resetHistory
|
|
39962
39940
|
},
|
|
39941
|
+
scrollToViewport: this.scrollToViewport,
|
|
39963
39942
|
scrollToContent: this.scrollToContent,
|
|
39964
39943
|
getSceneElements: this.getSceneElements,
|
|
39965
39944
|
getAppState: () => this.state,
|
|
@@ -41945,12 +41924,12 @@ var App = class _App extends React44.Component {
|
|
|
41945
41924
|
const isElbowArrowOnly = selectedElements.findIndex(isElbowArrow10) === 0;
|
|
41946
41925
|
return {
|
|
41947
41926
|
origin,
|
|
41948
|
-
withCmdOrCtrl: event[
|
|
41927
|
+
withCmdOrCtrl: event[KEYS51.CTRL_OR_CMD],
|
|
41949
41928
|
originInGrid: tupleToCoors(
|
|
41950
41929
|
getGridPoint2(
|
|
41951
41930
|
origin.x,
|
|
41952
41931
|
origin.y,
|
|
41953
|
-
event[
|
|
41932
|
+
event[KEYS51.CTRL_OR_CMD] || isElbowArrowOnly ? null : this.getEffectiveGridSize()
|
|
41954
41933
|
)
|
|
41955
41934
|
),
|
|
41956
41935
|
scrollbars: isOverScrollBars(
|
|
@@ -42091,7 +42070,7 @@ var App = class _App extends React44.Component {
|
|
|
42091
42070
|
}
|
|
42092
42071
|
onKeyUpFromPointerDownHandler(pointerDownState) {
|
|
42093
42072
|
return withBatchedUpdates((event) => {
|
|
42094
|
-
event.key ===
|
|
42073
|
+
event.key === KEYS51.ALT && event.preventDefault();
|
|
42095
42074
|
if (this.maybeHandleResize(pointerDownState, event)) {
|
|
42096
42075
|
return;
|
|
42097
42076
|
}
|
|
@@ -42113,7 +42092,7 @@ var App = class _App extends React44.Component {
|
|
|
42113
42092
|
const [gridX2, gridY2] = getGridPoint2(
|
|
42114
42093
|
pointerCoords.x,
|
|
42115
42094
|
pointerCoords.y,
|
|
42116
|
-
event[
|
|
42095
|
+
event[KEYS51.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
42117
42096
|
);
|
|
42118
42097
|
let index = this.state.selectedLinearElement.initialState.segmentMidpoint.index;
|
|
42119
42098
|
if (index < 0) {
|
|
@@ -42178,7 +42157,7 @@ var App = class _App extends React44.Component {
|
|
|
42178
42157
|
const [gridX, gridY] = getGridPoint2(
|
|
42179
42158
|
pointerCoords.x,
|
|
42180
42159
|
pointerCoords.y,
|
|
42181
|
-
event[
|
|
42160
|
+
event[KEYS51.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
42182
42161
|
);
|
|
42183
42162
|
if (pointerDownState.resize.isResizing) {
|
|
42184
42163
|
pointerDownState.lastCoords.x = pointerCoords.x;
|
|
@@ -42226,7 +42205,7 @@ var App = class _App extends React44.Component {
|
|
|
42226
42205
|
this.state.selectedLinearElement,
|
|
42227
42206
|
pointerCoords,
|
|
42228
42207
|
this,
|
|
42229
|
-
!event[
|
|
42208
|
+
!event[KEYS51.CTRL_OR_CMD],
|
|
42230
42209
|
this.scene
|
|
42231
42210
|
);
|
|
42232
42211
|
if (!ret) {
|
|
@@ -42424,7 +42403,7 @@ var App = class _App extends React44.Component {
|
|
|
42424
42403
|
dragOffset,
|
|
42425
42404
|
this.scene,
|
|
42426
42405
|
snapOffset,
|
|
42427
|
-
event[
|
|
42406
|
+
event[KEYS51.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
42428
42407
|
);
|
|
42429
42408
|
}
|
|
42430
42409
|
this.setState({
|
|
@@ -43395,7 +43374,7 @@ var App = class _App extends React44.Component {
|
|
|
43395
43374
|
return;
|
|
43396
43375
|
}
|
|
43397
43376
|
const selectedTextEditingContainer = this.getSelectedTextEditingContainerAtPosition(hitElement, sceneCoords);
|
|
43398
|
-
if (activeTool.type === this.state.preferredSelectionTool.type && !this.state.editingTextElement && !pointerDownState.drag.hasOccurred && !pointerDownState.hit.wasAddedToSelection && !childEvent.shiftKey && !childEvent[
|
|
43377
|
+
if (activeTool.type === this.state.preferredSelectionTool.type && !this.state.editingTextElement && !pointerDownState.drag.hasOccurred && !pointerDownState.hit.wasAddedToSelection && !childEvent.shiftKey && !childEvent[KEYS51.CTRL_OR_CMD] && !childEvent.altKey && childEvent.pointerType !== "touch" && hitElement && (isTextElement19(hitElement) && this.state.selectedElementIds[hitElement.id] && this.scene.getSelectedElements(this.state).length === 1 || selectedTextEditingContainer)) {
|
|
43399
43378
|
this.startTextEditing({
|
|
43400
43379
|
sceneX: sceneCoords.x,
|
|
43401
43380
|
sceneY: sceneCoords.y,
|