@myoc/excalidraw 0.19.3 → 0.19.5-ffbfd9327
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/dev/{chunk-BVSQPBD5.js → chunk-45NC7SKS.js} +2 -2
- package/dist/dev/{chunk-ZCRRPXDS.js → chunk-M3QOUBGT.js} +3 -3
- package/dist/dev/data/{image-BVTQCISX.js → image-SLFRXHXO.js} +3 -3
- package/dist/dev/index.js +140 -222
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/{chunk-2E373UDT.js → chunk-EPVOD37P.js} +2 -2
- package/dist/prod/{chunk-VE3EUABP.js → chunk-HMWQJTVU.js} +1 -1
- package/dist/prod/data/image-7G5BLOPB.js +1 -0
- package/dist/prod/index.js +15 -15
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/element/src/index.d.ts +1 -0
- package/dist/types/element/src/shapes.d.ts +149 -2
- package/package.json +4 -4
- package/dist/prod/data/image-UFCJS6AE.js +0 -1
- package/dist/types/excalidraw/components/shapes.d.ts +0 -190
- /package/dist/dev/{chunk-BVSQPBD5.js.map → chunk-45NC7SKS.js.map} +0 -0
- /package/dist/dev/{chunk-ZCRRPXDS.js.map → chunk-M3QOUBGT.js.map} +0 -0
- /package/dist/dev/data/{image-BVTQCISX.js.map → image-SLFRXHXO.js.map} +0 -0
package/dist/dev/index.js
CHANGED
|
@@ -65,10 +65,10 @@ import {
|
|
|
65
65
|
serializeAsJSON,
|
|
66
66
|
serializeLibraryAsJSON,
|
|
67
67
|
strokeRectWithRotation_simple
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-M3QOUBGT.js";
|
|
69
69
|
import {
|
|
70
70
|
define_import_meta_env_default
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-45NC7SKS.js";
|
|
72
72
|
import {
|
|
73
73
|
en_default
|
|
74
74
|
} from "./chunk-WBVI4CIR.js";
|
|
@@ -111,7 +111,7 @@ import {
|
|
|
111
111
|
shouldMaintainAspectRatio,
|
|
112
112
|
shouldRotateWithDiscreteAngle as shouldRotateWithDiscreteAngle3,
|
|
113
113
|
isArrowKey as isArrowKey2,
|
|
114
|
-
KEYS as
|
|
114
|
+
KEYS as KEYS54,
|
|
115
115
|
APP_NAME as APP_NAME2,
|
|
116
116
|
CURSOR_TYPE as CURSOR_TYPE4,
|
|
117
117
|
DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,
|
|
@@ -9543,7 +9543,7 @@ var exportCanvas = async (type, elements, appState, files, {
|
|
|
9543
9543
|
let blob = canvasToBlob(tempCanvas);
|
|
9544
9544
|
if (appState.exportEmbedScene) {
|
|
9545
9545
|
blob = blob.then(
|
|
9546
|
-
(blob2) => import("./data/image-
|
|
9546
|
+
(blob2) => import("./data/image-SLFRXHXO.js").then(
|
|
9547
9547
|
({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
|
|
9548
9548
|
blob: blob2,
|
|
9549
9549
|
metadata: serializeAsJSON(elements, appState, files, "local")
|
|
@@ -12438,7 +12438,7 @@ import { useEffect as useEffect28, useRef as useRef24, useMemo as useMemo8, useS
|
|
|
12438
12438
|
import {
|
|
12439
12439
|
DEFAULT_SIDEBAR as DEFAULT_SIDEBAR2,
|
|
12440
12440
|
EVENT as EVENT10,
|
|
12441
|
-
KEYS as
|
|
12441
|
+
KEYS as KEYS37,
|
|
12442
12442
|
capitalizeString as capitalizeString3,
|
|
12443
12443
|
isWritableElement as isWritableElement3
|
|
12444
12444
|
} from "@excalidraw/common";
|
|
@@ -12611,7 +12611,7 @@ var Panel = ({
|
|
|
12611
12611
|
}
|
|
12612
12612
|
}
|
|
12613
12613
|
}, [genericElements, app.scene]);
|
|
12614
|
-
const
|
|
12614
|
+
const SHAPES6 = conversionType === "linear" ? [
|
|
12615
12615
|
["line", LineIcon],
|
|
12616
12616
|
["sharpArrow", sharpArrowIcon],
|
|
12617
12617
|
["curvedArrow", roundArrowIcon],
|
|
@@ -12633,7 +12633,7 @@ var Panel = ({
|
|
|
12633
12633
|
zIndex: 2
|
|
12634
12634
|
},
|
|
12635
12635
|
className: CLASSES.CONVERT_ELEMENT_TYPE_POPUP,
|
|
12636
|
-
children:
|
|
12636
|
+
children: SHAPES6.map(([type, icon]) => {
|
|
12637
12637
|
const isSelected = sameType && (conversionType === "generic" && genericElements[0].type === type || conversionType === "linear" && getLinearElementSubType(linearElements[0]) === type);
|
|
12638
12638
|
return /* @__PURE__ */ jsx51(
|
|
12639
12639
|
ToolButton,
|
|
@@ -16492,98 +16492,8 @@ var Dialog = (props) => {
|
|
|
16492
16492
|
);
|
|
16493
16493
|
};
|
|
16494
16494
|
|
|
16495
|
-
// components/
|
|
16496
|
-
import {
|
|
16497
|
-
var SHAPES = [
|
|
16498
|
-
{
|
|
16499
|
-
icon: SelectionIcon,
|
|
16500
|
-
value: "selection",
|
|
16501
|
-
key: KEYS35.V,
|
|
16502
|
-
fillable: true,
|
|
16503
|
-
myocSimplifiedMode: true
|
|
16504
|
-
},
|
|
16505
|
-
{
|
|
16506
|
-
icon: RectangleIcon,
|
|
16507
|
-
value: "rectangle",
|
|
16508
|
-
key: KEYS35.R,
|
|
16509
|
-
fillable: true,
|
|
16510
|
-
myocSimplifiedMode: false
|
|
16511
|
-
},
|
|
16512
|
-
{
|
|
16513
|
-
icon: DiamondIcon,
|
|
16514
|
-
value: "diamond",
|
|
16515
|
-
key: KEYS35.D,
|
|
16516
|
-
fillable: true,
|
|
16517
|
-
myocSimplifiedMode: false
|
|
16518
|
-
},
|
|
16519
|
-
{
|
|
16520
|
-
icon: EllipseIcon,
|
|
16521
|
-
value: "ellipse",
|
|
16522
|
-
key: KEYS35.O,
|
|
16523
|
-
fillable: true,
|
|
16524
|
-
myocSimplifiedMode: false
|
|
16525
|
-
},
|
|
16526
|
-
{
|
|
16527
|
-
icon: ArrowIcon,
|
|
16528
|
-
value: "arrow",
|
|
16529
|
-
key: KEYS35.A,
|
|
16530
|
-
fillable: true,
|
|
16531
|
-
myocSimplifiedMode: false
|
|
16532
|
-
},
|
|
16533
|
-
{
|
|
16534
|
-
icon: LineIcon,
|
|
16535
|
-
value: "line",
|
|
16536
|
-
key: KEYS35.L,
|
|
16537
|
-
fillable: true,
|
|
16538
|
-
myocSimplifiedMode: false
|
|
16539
|
-
},
|
|
16540
|
-
{
|
|
16541
|
-
icon: FreedrawIcon,
|
|
16542
|
-
value: "freedraw",
|
|
16543
|
-
key: [KEYS35.P, KEYS35.X],
|
|
16544
|
-
fillable: false,
|
|
16545
|
-
myocSimplifiedMode: true
|
|
16546
|
-
},
|
|
16547
|
-
{
|
|
16548
|
-
icon: TextIcon,
|
|
16549
|
-
value: "text",
|
|
16550
|
-
key: KEYS35.T,
|
|
16551
|
-
fillable: false,
|
|
16552
|
-
myocSimplifiedMode: true
|
|
16553
|
-
},
|
|
16554
|
-
{
|
|
16555
|
-
icon: ImageIcon,
|
|
16556
|
-
value: "image",
|
|
16557
|
-
key: [KEYS35.I],
|
|
16558
|
-
fillable: false,
|
|
16559
|
-
myocSimplifiedMode: true
|
|
16560
|
-
},
|
|
16561
|
-
{
|
|
16562
|
-
icon: EraserIcon,
|
|
16563
|
-
value: "eraser",
|
|
16564
|
-
key: KEYS35.E,
|
|
16565
|
-
fillable: false,
|
|
16566
|
-
myocSimplifiedMode: true
|
|
16567
|
-
}
|
|
16568
|
-
];
|
|
16569
|
-
var getToolbarTools = (app) => {
|
|
16570
|
-
return app.state.preferredSelectionTool.type === "lasso" ? [
|
|
16571
|
-
{
|
|
16572
|
-
value: "lasso",
|
|
16573
|
-
icon: SelectionIcon,
|
|
16574
|
-
key: KEYS35.V,
|
|
16575
|
-
fillable: true,
|
|
16576
|
-
myocSimplifiedMode: true
|
|
16577
|
-
},
|
|
16578
|
-
...SHAPES.slice(1)
|
|
16579
|
-
] : SHAPES;
|
|
16580
|
-
};
|
|
16581
|
-
var findShapeByKey = (key, app) => {
|
|
16582
|
-
const shape = getToolbarTools(app).find((shape2, index) => {
|
|
16583
|
-
return shape2.key && (typeof shape2.key === "string" ? shape2.key === key : shape2.key.includes(key));
|
|
16584
|
-
});
|
|
16585
|
-
return shape?.value || null;
|
|
16586
|
-
};
|
|
16495
|
+
// components/CommandPalette/CommandPalette.tsx
|
|
16496
|
+
import { SHAPES as SHAPES2 } from "@excalidraw/element/shapes";
|
|
16587
16497
|
|
|
16588
16498
|
// components/Actions.tsx
|
|
16589
16499
|
import clsx35 from "clsx";
|
|
@@ -16591,7 +16501,7 @@ import { useMemo as useMemo7, useRef as useRef22, useState as useState23 } from
|
|
|
16591
16501
|
import * as Popover7 from "@radix-ui/react-popover";
|
|
16592
16502
|
import {
|
|
16593
16503
|
CLASSES as CLASSES3,
|
|
16594
|
-
KEYS as
|
|
16504
|
+
KEYS as KEYS36,
|
|
16595
16505
|
capitalizeString as capitalizeString2,
|
|
16596
16506
|
isTransparent as isTransparent2
|
|
16597
16507
|
} from "@excalidraw/common";
|
|
@@ -16609,7 +16519,7 @@ import {
|
|
|
16609
16519
|
} from "@excalidraw/element";
|
|
16610
16520
|
|
|
16611
16521
|
// actions/actionToggleViewMode.tsx
|
|
16612
|
-
import { CODES as CODES11, KEYS as
|
|
16522
|
+
import { CODES as CODES11, KEYS as KEYS35 } from "@excalidraw/common";
|
|
16613
16523
|
import clsx33 from "clsx";
|
|
16614
16524
|
import { CaptureUpdateAction as CaptureUpdateAction30 } from "@excalidraw/element";
|
|
16615
16525
|
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
@@ -16635,7 +16545,7 @@ var actionToggleViewMode = register({
|
|
|
16635
16545
|
predicate: (elements, appState, appProps) => {
|
|
16636
16546
|
return typeof appProps.viewModeEnabled === "undefined";
|
|
16637
16547
|
},
|
|
16638
|
-
keyTest: (event) => !event[
|
|
16548
|
+
keyTest: (event) => !event[KEYS35.CTRL_OR_CMD] && event.altKey && event.code === CODES11.R,
|
|
16639
16549
|
PanelComponent: ({ data, updateData, appState }) => /* @__PURE__ */ jsx72(
|
|
16640
16550
|
ToolButton,
|
|
16641
16551
|
{
|
|
@@ -16652,6 +16562,9 @@ var actionToggleViewMode = register({
|
|
|
16652
16562
|
)
|
|
16653
16563
|
});
|
|
16654
16564
|
|
|
16565
|
+
// components/Actions.tsx
|
|
16566
|
+
import { getToolbarTools, SHAPES } from "@excalidraw/element/shapes";
|
|
16567
|
+
|
|
16655
16568
|
// components/ToolPopover.tsx
|
|
16656
16569
|
import { useEffect as useEffect27, useState as useState22 } from "react";
|
|
16657
16570
|
import clsx34 from "clsx";
|
|
@@ -17647,7 +17560,7 @@ var ShapesSwitcher = ({
|
|
|
17647
17560
|
icon: app.state.activeTool.locked ? LockedIcon : UnlockedIcon,
|
|
17648
17561
|
"data-testid": `toolbar-lock`,
|
|
17649
17562
|
selected: app.state.activeTool.locked,
|
|
17650
|
-
shortcut:
|
|
17563
|
+
shortcut: KEYS36.Q,
|
|
17651
17564
|
children: capitalizeString2(t("toolBar.lock-short"))
|
|
17652
17565
|
}
|
|
17653
17566
|
)
|
|
@@ -17759,7 +17672,7 @@ var CommandShortcutHint = ({
|
|
|
17759
17672
|
] });
|
|
17760
17673
|
};
|
|
17761
17674
|
var isCommandPaletteToggleShortcut = (event) => {
|
|
17762
|
-
return !event.altKey && event[
|
|
17675
|
+
return !event.altKey && event[KEYS37.CTRL_OR_CMD] && (event.shiftKey && event.key.toLowerCase() === KEYS37.P || event.key === KEYS37.SLASH);
|
|
17763
17676
|
};
|
|
17764
17677
|
var CommandPalette = Object.assign(
|
|
17765
17678
|
(props) => {
|
|
@@ -18064,7 +17977,7 @@ function CommandPaletteInner({
|
|
|
18064
17977
|
}));
|
|
18065
17978
|
}
|
|
18066
17979
|
},
|
|
18067
|
-
...
|
|
17980
|
+
...SHAPES2.reduce((acc, shape) => {
|
|
18068
17981
|
const { value, icon, key } = shape;
|
|
18069
17982
|
if (appProps2.UIOptions.tools?.[value] === false) {
|
|
18070
17983
|
return acc;
|
|
@@ -18096,7 +18009,7 @@ function CommandPaletteInner({
|
|
|
18096
18009
|
label: t("toolBar.lock"),
|
|
18097
18010
|
category: DEFAULT_CATEGORIES.tools,
|
|
18098
18011
|
icon: uiAppState2.activeTool.locked ? LockedIcon : UnlockedIcon,
|
|
18099
|
-
shortcut:
|
|
18012
|
+
shortcut: KEYS37.Q.toLocaleUpperCase(),
|
|
18100
18013
|
viewMode: false,
|
|
18101
18014
|
perform: () => {
|
|
18102
18015
|
app.toggleLock();
|
|
@@ -18172,13 +18085,13 @@ function CommandPaletteInner({
|
|
|
18172
18085
|
}
|
|
18173
18086
|
);
|
|
18174
18087
|
const handleKeyDown = useStableCallback((event) => {
|
|
18175
|
-
const ignoreAlphanumerics = isWritableElement3(event.target) || isCommandPaletteToggleShortcut(event) || event.key ===
|
|
18176
|
-
if (ignoreAlphanumerics && event.key !==
|
|
18088
|
+
const ignoreAlphanumerics = isWritableElement3(event.target) || isCommandPaletteToggleShortcut(event) || event.key === KEYS37.ESCAPE;
|
|
18089
|
+
if (ignoreAlphanumerics && event.key !== KEYS37.ARROW_UP && event.key !== KEYS37.ARROW_DOWN && event.key !== KEYS37.ENTER) {
|
|
18177
18090
|
return;
|
|
18178
18091
|
}
|
|
18179
18092
|
const matchingCommands = Object.values(commandsByCategory).flat();
|
|
18180
18093
|
const shouldConsiderLastUsed = lastUsed && !commandSearch && isCommandAvailable(lastUsed);
|
|
18181
|
-
if (event.key ===
|
|
18094
|
+
if (event.key === KEYS37.ARROW_UP) {
|
|
18182
18095
|
event.preventDefault();
|
|
18183
18096
|
const index = matchingCommands.findIndex(
|
|
18184
18097
|
(item) => item.label === currentCommand?.label
|
|
@@ -18208,7 +18121,7 @@ function CommandPaletteInner({
|
|
|
18208
18121
|
}
|
|
18209
18122
|
return;
|
|
18210
18123
|
}
|
|
18211
|
-
if (event.key ===
|
|
18124
|
+
if (event.key === KEYS37.ARROW_DOWN) {
|
|
18212
18125
|
event.preventDefault();
|
|
18213
18126
|
const index = matchingCommands.findIndex(
|
|
18214
18127
|
(item) => item.label === currentCommand?.label
|
|
@@ -18233,7 +18146,7 @@ function CommandPaletteInner({
|
|
|
18233
18146
|
}
|
|
18234
18147
|
return;
|
|
18235
18148
|
}
|
|
18236
|
-
if (event.key ===
|
|
18149
|
+
if (event.key === KEYS37.ENTER) {
|
|
18237
18150
|
if (currentCommand) {
|
|
18238
18151
|
setTimeout(() => {
|
|
18239
18152
|
executeCommand(currentCommand, event);
|
|
@@ -18560,7 +18473,7 @@ import {
|
|
|
18560
18473
|
} from "@excalidraw/math";
|
|
18561
18474
|
import {
|
|
18562
18475
|
DRAGGING_THRESHOLD,
|
|
18563
|
-
KEYS as
|
|
18476
|
+
KEYS as KEYS39,
|
|
18564
18477
|
shouldRotateWithDiscreteAngle as shouldRotateWithDiscreteAngle2,
|
|
18565
18478
|
getGridPoint,
|
|
18566
18479
|
invariant as invariant11,
|
|
@@ -18576,7 +18489,7 @@ import {
|
|
|
18576
18489
|
|
|
18577
18490
|
// ../element/src/binding.ts
|
|
18578
18491
|
import {
|
|
18579
|
-
KEYS as
|
|
18492
|
+
KEYS as KEYS38,
|
|
18580
18493
|
arrayToMap as arrayToMap17,
|
|
18581
18494
|
getFeatureFlag,
|
|
18582
18495
|
invariant as invariant10,
|
|
@@ -19970,7 +19883,7 @@ var actionTogglePolygon = register({
|
|
|
19970
19883
|
|
|
19971
19884
|
// actions/actionToggleSearchMenu.ts
|
|
19972
19885
|
import {
|
|
19973
|
-
KEYS as
|
|
19886
|
+
KEYS as KEYS40,
|
|
19974
19887
|
CANVAS_SEARCH_TAB,
|
|
19975
19888
|
CLASSES as CLASSES4,
|
|
19976
19889
|
DEFAULT_SIDEBAR as DEFAULT_SIDEBAR3
|
|
@@ -20012,7 +19925,7 @@ var actionToggleSearchMenu = register({
|
|
|
20012
19925
|
predicate: (element, appState, props) => {
|
|
20013
19926
|
return props.gridModeEnabled === void 0;
|
|
20014
19927
|
},
|
|
20015
|
-
keyTest: (event) => event[
|
|
19928
|
+
keyTest: (event) => event[KEYS40.CTRL_OR_CMD] && event.key === KEYS40.F
|
|
20016
19929
|
});
|
|
20017
19930
|
|
|
20018
19931
|
// actions/actionCropEditor.tsx
|
|
@@ -20235,7 +20148,7 @@ var actionWrapSelectionInFrame = register({
|
|
|
20235
20148
|
// actions/actionHistory.tsx
|
|
20236
20149
|
import {
|
|
20237
20150
|
isWindows,
|
|
20238
|
-
KEYS as
|
|
20151
|
+
KEYS as KEYS41,
|
|
20239
20152
|
matchKey as matchKey2,
|
|
20240
20153
|
arrayToMap as arrayToMap23,
|
|
20241
20154
|
MOBILE_ACTION_BUTTON_BG as MOBILE_ACTION_BUTTON_BG4
|
|
@@ -20466,7 +20379,7 @@ var createUndoAction = (history) => ({
|
|
|
20466
20379
|
appState,
|
|
20467
20380
|
() => history.undo(arrayToMap23(elements), appState)
|
|
20468
20381
|
),
|
|
20469
|
-
keyTest: (event) => event[
|
|
20382
|
+
keyTest: (event) => event[KEYS41.CTRL_OR_CMD] && matchKey2(event, KEYS41.Z) && !event.shiftKey,
|
|
20470
20383
|
PanelComponent: ({ appState, updateData, data, app }) => {
|
|
20471
20384
|
const { isUndoStackEmpty } = useEmitter(
|
|
20472
20385
|
history.onHistoryChangedEmitter,
|
|
@@ -20504,7 +20417,7 @@ var createRedoAction = (history) => ({
|
|
|
20504
20417
|
appState,
|
|
20505
20418
|
() => history.redo(arrayToMap23(elements), appState)
|
|
20506
20419
|
),
|
|
20507
|
-
keyTest: (event) => event[
|
|
20420
|
+
keyTest: (event) => event[KEYS41.CTRL_OR_CMD] && event.shiftKey && matchKey2(event, KEYS41.Z) || isWindows && event.ctrlKey && !event.shiftKey && matchKey2(event, KEYS41.Y),
|
|
20508
20421
|
PanelComponent: ({ appState, updateData, data, app }) => {
|
|
20509
20422
|
const { isRedoStackEmpty } = useEmitter(
|
|
20510
20423
|
history.onHistoryChangedEmitter,
|
|
@@ -20775,7 +20688,7 @@ import {
|
|
|
20775
20688
|
rangeIntersection,
|
|
20776
20689
|
rangesOverlap
|
|
20777
20690
|
} from "@excalidraw/math";
|
|
20778
|
-
import { TOOL_TYPE, KEYS as
|
|
20691
|
+
import { TOOL_TYPE, KEYS as KEYS42 } from "@excalidraw/common";
|
|
20779
20692
|
import {
|
|
20780
20693
|
getCommonBounds as getCommonBounds4,
|
|
20781
20694
|
getDraggedElementsBounds,
|
|
@@ -20821,7 +20734,7 @@ var isSnappingEnabled = ({
|
|
|
20821
20734
|
}) => {
|
|
20822
20735
|
if (event) {
|
|
20823
20736
|
const isLassoDragging = app.state.activeTool.type === "lasso" && app.state.selectedElementsAreBeingDragged;
|
|
20824
|
-
return (app.state.activeTool.type !== "lasso" || isLassoDragging) && (app.state.objectsSnapModeEnabled && !event[
|
|
20737
|
+
return (app.state.activeTool.type !== "lasso" || isLassoDragging) && (app.state.objectsSnapModeEnabled && !event[KEYS42.CTRL_OR_CMD] || !app.state.objectsSnapModeEnabled && event[KEYS42.CTRL_OR_CMD] && !isGridModeEnabled(app));
|
|
20825
20738
|
}
|
|
20826
20739
|
if (selectedElements.length === 1 && selectedElements[0].type === "arrow") {
|
|
20827
20740
|
return false;
|
|
@@ -22150,7 +22063,7 @@ var isRenderThrottlingEnabled = (() => {
|
|
|
22150
22063
|
// wysiwyg/textWysiwyg.tsx
|
|
22151
22064
|
import {
|
|
22152
22065
|
CODES as CODES12,
|
|
22153
|
-
KEYS as
|
|
22066
|
+
KEYS as KEYS43,
|
|
22154
22067
|
CLASSES as CLASSES5,
|
|
22155
22068
|
POINTER_BUTTON,
|
|
22156
22069
|
THEME as THEME11,
|
|
@@ -22440,7 +22353,7 @@ var textWysiwyg = ({
|
|
|
22440
22353
|
app.actionManager.executeAction(actionDecreaseFontSize);
|
|
22441
22354
|
} else if (actionIncreaseFontSize.keyTest(event)) {
|
|
22442
22355
|
app.actionManager.executeAction(actionIncreaseFontSize);
|
|
22443
|
-
} else if (event.key ===
|
|
22356
|
+
} else if (event.key === KEYS43.ESCAPE) {
|
|
22444
22357
|
event.preventDefault();
|
|
22445
22358
|
submittedViaKeyboard = true;
|
|
22446
22359
|
handleSubmit();
|
|
@@ -22448,14 +22361,14 @@ var textWysiwyg = ({
|
|
|
22448
22361
|
event.preventDefault();
|
|
22449
22362
|
handleSubmit();
|
|
22450
22363
|
app.actionManager.executeAction(actionSaveToActiveFile);
|
|
22451
|
-
} else if (event.key ===
|
|
22364
|
+
} else if (event.key === KEYS43.ENTER && event[KEYS43.CTRL_OR_CMD]) {
|
|
22452
22365
|
event.preventDefault();
|
|
22453
22366
|
if (event.isComposing || event.keyCode === 229) {
|
|
22454
22367
|
return;
|
|
22455
22368
|
}
|
|
22456
22369
|
submittedViaKeyboard = true;
|
|
22457
22370
|
handleSubmit();
|
|
22458
|
-
} else if (event.key ===
|
|
22371
|
+
} else if (event.key === KEYS43.TAB || event[KEYS43.CTRL_OR_CMD] && (event.code === CODES12.BRACKET_LEFT || event.code === CODES12.BRACKET_RIGHT)) {
|
|
22459
22372
|
event.preventDefault();
|
|
22460
22373
|
if (event.isComposing) {
|
|
22461
22374
|
return;
|
|
@@ -23007,7 +22920,7 @@ var LassoTrail = class extends AnimatedTrail {
|
|
|
23007
22920
|
};
|
|
23008
22921
|
|
|
23009
22922
|
// actions/actionSmartZoom.tsx
|
|
23010
|
-
import { KEYS as
|
|
22923
|
+
import { KEYS as KEYS44 } from "@excalidraw/common";
|
|
23011
22924
|
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
23012
22925
|
var actionSmartZoom = register({
|
|
23013
22926
|
name: "smartZoom",
|
|
@@ -23032,7 +22945,7 @@ var actionSmartZoom = register({
|
|
|
23032
22945
|
captureUpdate: CaptureUpdateAction38.NEVER
|
|
23033
22946
|
};
|
|
23034
22947
|
},
|
|
23035
|
-
keyTest: (event) => !event[
|
|
22948
|
+
keyTest: (event) => !event[KEYS44.CTRL_OR_CMD] && !event.shiftKey && !event.altKey && event.key.toLocaleLowerCase() === KEYS44.F,
|
|
23036
22949
|
PanelComponent: ({ data, updateData }) => /* @__PURE__ */ jsx81(
|
|
23037
22950
|
ToolButton,
|
|
23038
22951
|
{
|
|
@@ -23042,7 +22955,7 @@ var actionSmartZoom = register({
|
|
|
23042
22955
|
onClick: () => updateData(null),
|
|
23043
22956
|
size: data?.size || "medium",
|
|
23044
22957
|
"data-testid": "button-smart-zoom",
|
|
23045
|
-
keyBindingLabel:
|
|
22958
|
+
keyBindingLabel: KEYS44.F.toLocaleUpperCase()
|
|
23046
22959
|
}
|
|
23047
22960
|
)
|
|
23048
22961
|
});
|
|
@@ -23308,7 +23221,7 @@ import React30 from "react";
|
|
|
23308
23221
|
// components/Popover.tsx
|
|
23309
23222
|
import { useLayoutEffect as useLayoutEffect4, useRef as useRef25, useEffect as useEffect30 } from "react";
|
|
23310
23223
|
import { unstable_batchedUpdates as unstable_batchedUpdates2 } from "react-dom";
|
|
23311
|
-
import { KEYS as
|
|
23224
|
+
import { KEYS as KEYS45, queryFocusableElements as queryFocusableElements2 } from "@excalidraw/common";
|
|
23312
23225
|
import clsx37 from "clsx";
|
|
23313
23226
|
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
23314
23227
|
var Popover8 = ({
|
|
@@ -23333,7 +23246,7 @@ var Popover8 = ({
|
|
|
23333
23246
|
container.focus();
|
|
23334
23247
|
}
|
|
23335
23248
|
const handleKeyDown = (event) => {
|
|
23336
|
-
if (event.key ===
|
|
23249
|
+
if (event.key === KEYS45.TAB) {
|
|
23337
23250
|
const focusableElements = queryFocusableElements2(container);
|
|
23338
23251
|
const { activeElement } = document;
|
|
23339
23252
|
const currentIndex = focusableElements.findIndex(
|
|
@@ -23620,11 +23533,11 @@ var LoadingMessage = ({
|
|
|
23620
23533
|
// components/MobileToolBar.tsx
|
|
23621
23534
|
import { useState as useState27 } from "react";
|
|
23622
23535
|
import clsx41 from "clsx";
|
|
23623
|
-
import { KEYS as
|
|
23536
|
+
import { KEYS as KEYS47, capitalizeString as capitalizeString4 } from "@excalidraw/common";
|
|
23624
23537
|
|
|
23625
23538
|
// components/HandButton.tsx
|
|
23626
23539
|
import clsx40 from "clsx";
|
|
23627
|
-
import { KEYS as
|
|
23540
|
+
import { KEYS as KEYS46 } from "@excalidraw/common";
|
|
23628
23541
|
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
23629
23542
|
var HandButton = (props) => {
|
|
23630
23543
|
return /* @__PURE__ */ jsx87(
|
|
@@ -23636,9 +23549,9 @@ var HandButton = (props) => {
|
|
|
23636
23549
|
name: "editor-current-shape",
|
|
23637
23550
|
checked: props.checked,
|
|
23638
23551
|
title: `${props.title} \u2014 H`,
|
|
23639
|
-
keyBindingLabel: !props.isMobile ?
|
|
23552
|
+
keyBindingLabel: !props.isMobile ? KEYS46.H.toLocaleUpperCase() : void 0,
|
|
23640
23553
|
"aria-label": `${props.title} \u2014 H`,
|
|
23641
|
-
"aria-keyshortcuts":
|
|
23554
|
+
"aria-keyshortcuts": KEYS46.H,
|
|
23642
23555
|
"data-testid": `toolbar-hand`,
|
|
23643
23556
|
onChange: () => props.onChange?.()
|
|
23644
23557
|
}
|
|
@@ -23646,6 +23559,7 @@ var HandButton = (props) => {
|
|
|
23646
23559
|
};
|
|
23647
23560
|
|
|
23648
23561
|
// components/MobileToolBar.tsx
|
|
23562
|
+
import { SHAPES as SHAPES3 } from "@excalidraw/element/shapes";
|
|
23649
23563
|
import { jsx as jsx88, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
23650
23564
|
var SELECTION_TOOLS = [
|
|
23651
23565
|
{
|
|
@@ -23688,7 +23602,7 @@ var MobileToolBar = ({
|
|
|
23688
23602
|
const showTextToolOutside = toolbarWidth >= MIN_WIDTH + 1 * ADDITIONAL_WIDTH;
|
|
23689
23603
|
const showImageToolOutside = toolbarWidth >= MIN_WIDTH + 2 * ADDITIONAL_WIDTH;
|
|
23690
23604
|
const showFrameToolOutside = toolbarWidth >= MIN_WIDTH + 3 * ADDITIONAL_WIDTH;
|
|
23691
|
-
const simplifiedShapeTools =
|
|
23605
|
+
const simplifiedShapeTools = SHAPES3.filter(
|
|
23692
23606
|
(s) => s.myocSimplifiedMode === false
|
|
23693
23607
|
);
|
|
23694
23608
|
const extraTools = [
|
|
@@ -23873,7 +23787,7 @@ var MobileToolBar = ({
|
|
|
23873
23787
|
icon: app.state.activeTool.locked ? LockedIcon : UnlockedIcon,
|
|
23874
23788
|
"data-testid": `toolbar-lock`,
|
|
23875
23789
|
selected: app.state.activeTool.locked,
|
|
23876
|
-
shortcut:
|
|
23790
|
+
shortcut: KEYS47.Q,
|
|
23877
23791
|
children: capitalizeString4(t("toolBar.lock-short"))
|
|
23878
23792
|
}
|
|
23879
23793
|
),
|
|
@@ -23882,7 +23796,7 @@ var MobileToolBar = ({
|
|
|
23882
23796
|
{
|
|
23883
23797
|
onSelect: () => app.setActiveTool({ type: "text" }),
|
|
23884
23798
|
icon: TextIcon,
|
|
23885
|
-
shortcut:
|
|
23799
|
+
shortcut: KEYS47.T.toLocaleUpperCase(),
|
|
23886
23800
|
"data-testid": "toolbar-text",
|
|
23887
23801
|
selected: activeTool.type === "text",
|
|
23888
23802
|
children: t("toolBar.text")
|
|
@@ -24455,7 +24369,7 @@ import {
|
|
|
24455
24369
|
CLASSES as CLASSES6,
|
|
24456
24370
|
EVENT as EVENT11,
|
|
24457
24371
|
isDevEnv as isDevEnv7,
|
|
24458
|
-
KEYS as
|
|
24372
|
+
KEYS as KEYS48,
|
|
24459
24373
|
updateObject
|
|
24460
24374
|
} from "@excalidraw/common";
|
|
24461
24375
|
|
|
@@ -24695,7 +24609,7 @@ var SidebarInner = forwardRef4(
|
|
|
24695
24609
|
);
|
|
24696
24610
|
useEffect32(() => {
|
|
24697
24611
|
const handleKeyDown = (event) => {
|
|
24698
|
-
if (event.key ===
|
|
24612
|
+
if (event.key === KEYS48.ESCAPE && (!docked || !editorInterface.canFitSidebar)) {
|
|
24699
24613
|
closeLibrary();
|
|
24700
24614
|
}
|
|
24701
24615
|
};
|
|
@@ -25481,7 +25395,7 @@ import {
|
|
|
25481
25395
|
import { isElementCompletelyInViewport } from "@excalidraw/element";
|
|
25482
25396
|
import { measureText as measureText5 } from "@excalidraw/element";
|
|
25483
25397
|
import {
|
|
25484
|
-
KEYS as
|
|
25398
|
+
KEYS as KEYS49,
|
|
25485
25399
|
randomInteger as randomInteger3,
|
|
25486
25400
|
addEventListener as addEventListener2,
|
|
25487
25401
|
getFontString as getFontString8
|
|
@@ -25654,7 +25568,7 @@ var SearchMenu2 = () => {
|
|
|
25654
25568
|
});
|
|
25655
25569
|
useEffect33(() => {
|
|
25656
25570
|
const eventHandler = (event) => {
|
|
25657
|
-
if (event.key ===
|
|
25571
|
+
if (event.key === KEYS49.ESCAPE && !app.state.openDialog && !app.state.openPopup) {
|
|
25658
25572
|
event.preventDefault();
|
|
25659
25573
|
event.stopPropagation();
|
|
25660
25574
|
setAppState({
|
|
@@ -25662,7 +25576,7 @@ var SearchMenu2 = () => {
|
|
|
25662
25576
|
});
|
|
25663
25577
|
return;
|
|
25664
25578
|
}
|
|
25665
|
-
if (event[
|
|
25579
|
+
if (event[KEYS49.CTRL_OR_CMD] && event.key === KEYS49.F) {
|
|
25666
25580
|
event.preventDefault();
|
|
25667
25581
|
event.stopPropagation();
|
|
25668
25582
|
if (app.state.openDialog) {
|
|
@@ -25680,14 +25594,14 @@ var SearchMenu2 = () => {
|
|
|
25680
25594
|
}
|
|
25681
25595
|
if (event.target instanceof HTMLElement && event.target.closest(".layer-ui__search")) {
|
|
25682
25596
|
if (stableState.searchMatches.items.length) {
|
|
25683
|
-
if (event.key ===
|
|
25597
|
+
if (event.key === KEYS49.ENTER) {
|
|
25684
25598
|
event.stopPropagation();
|
|
25685
25599
|
stableState.goToNextItem();
|
|
25686
25600
|
}
|
|
25687
|
-
if (event.key ===
|
|
25601
|
+
if (event.key === KEYS49.ARROW_UP) {
|
|
25688
25602
|
event.stopPropagation();
|
|
25689
25603
|
stableState.goToPreviousItem();
|
|
25690
|
-
} else if (event.key ===
|
|
25604
|
+
} else if (event.key === KEYS49.ARROW_DOWN) {
|
|
25691
25605
|
event.stopPropagation();
|
|
25692
25606
|
stableState.goToNextItem();
|
|
25693
25607
|
}
|
|
@@ -26176,7 +26090,7 @@ import { updateBindings as updateBindings3 } from "@excalidraw/element";
|
|
|
26176
26090
|
// components/Stats/DragInput.tsx
|
|
26177
26091
|
import clsx53 from "clsx";
|
|
26178
26092
|
import { useEffect as useEffect34, useRef as useRef30, useState as useState32 } from "react";
|
|
26179
|
-
import { EVENT as EVENT13, KEYS as
|
|
26093
|
+
import { EVENT as EVENT13, KEYS as KEYS50, cloneJSON as cloneJSON3 } from "@excalidraw/common";
|
|
26180
26094
|
import { deepCopyElement as deepCopyElement4 } from "@excalidraw/element";
|
|
26181
26095
|
import { CaptureUpdateAction as CaptureUpdateAction39 } from "@excalidraw/element";
|
|
26182
26096
|
|
|
@@ -26535,7 +26449,7 @@ var StatsDragInput = ({
|
|
|
26535
26449
|
onKeyDown: (event) => {
|
|
26536
26450
|
if (editable) {
|
|
26537
26451
|
const eventTarget = event.target;
|
|
26538
|
-
if (eventTarget instanceof HTMLInputElement && event.key ===
|
|
26452
|
+
if (eventTarget instanceof HTMLInputElement && event.key === KEYS50.ENTER) {
|
|
26539
26453
|
handleInputValue(eventTarget.value, elements, appState);
|
|
26540
26454
|
app.focusContainer();
|
|
26541
26455
|
}
|
|
@@ -28263,7 +28177,7 @@ var StatsInner = memo5(
|
|
|
28263
28177
|
|
|
28264
28178
|
// components/ElementLinkDialog.tsx
|
|
28265
28179
|
import { useCallback as useCallback13, useEffect as useEffect36, useState as useState34 } from "react";
|
|
28266
|
-
import { normalizeLink as normalizeLink2, KEYS as
|
|
28180
|
+
import { normalizeLink as normalizeLink2, KEYS as KEYS51 } from "@excalidraw/common";
|
|
28267
28181
|
import {
|
|
28268
28182
|
defaultGetElementLinkFromSelection as defaultGetElementLinkFromSelection2,
|
|
28269
28183
|
getLinkIdAndTypeFromSelection as getLinkIdAndTypeFromSelection2
|
|
@@ -28319,10 +28233,10 @@ var ElementLinkDialog = ({
|
|
|
28319
28233
|
}, [sourceElementId, nextLink, elementsMap, linkEdited, scene, onClose]);
|
|
28320
28234
|
useEffect36(() => {
|
|
28321
28235
|
const handleKeyDown = (event) => {
|
|
28322
|
-
if (appState.openDialog?.name === "elementLinkSelector" && event.key ===
|
|
28236
|
+
if (appState.openDialog?.name === "elementLinkSelector" && event.key === KEYS51.ENTER) {
|
|
28323
28237
|
handleConfirm();
|
|
28324
28238
|
}
|
|
28325
|
-
if (appState.openDialog?.name === "elementLinkSelector" && event.key ===
|
|
28239
|
+
if (appState.openDialog?.name === "elementLinkSelector" && event.key === KEYS51.ESCAPE) {
|
|
28326
28240
|
onClose?.();
|
|
28327
28241
|
}
|
|
28328
28242
|
};
|
|
@@ -28348,7 +28262,7 @@ var ElementLinkDialog = ({
|
|
|
28348
28262
|
setNextLink(value);
|
|
28349
28263
|
},
|
|
28350
28264
|
onKeyDown: (event) => {
|
|
28351
|
-
if (event.key ===
|
|
28265
|
+
if (event.key === KEYS51.ENTER) {
|
|
28352
28266
|
handleConfirm();
|
|
28353
28267
|
}
|
|
28354
28268
|
},
|
|
@@ -28448,11 +28362,12 @@ var FixedSideContainer = ({
|
|
|
28448
28362
|
import React39, { useMemo as useMemo13 } from "react";
|
|
28449
28363
|
import clsx56 from "clsx";
|
|
28450
28364
|
import { isDarwin as isDarwin4, isFirefox as isFirefox4, isWindows as isWindows2 } from "@excalidraw/common";
|
|
28451
|
-
import { KEYS as
|
|
28452
|
-
import { SHAPES as
|
|
28365
|
+
import { KEYS as KEYS53 } from "@excalidraw/common";
|
|
28366
|
+
import { SHAPES as SHAPES5 } from "@excalidraw/element/shapes";
|
|
28453
28367
|
|
|
28454
28368
|
// components/HelpDialog/BasicHelpDialog.tsx
|
|
28455
|
-
import { isFirefox as isFirefox3, KEYS as
|
|
28369
|
+
import { isFirefox as isFirefox3, KEYS as KEYS52 } from "@excalidraw/common";
|
|
28370
|
+
import { SHAPES as SHAPES4 } from "@excalidraw/element/shapes";
|
|
28456
28371
|
import { Fragment as Fragment20, jsx as jsx127, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
28457
28372
|
var Section2 = (props) => /* @__PURE__ */ jsxs67(Fragment20, { children: [
|
|
28458
28373
|
/* @__PURE__ */ jsx127("h3", { children: props.title }),
|
|
@@ -28498,8 +28413,8 @@ function BasicHelpDialog() {
|
|
|
28498
28413
|
className: "HelpDialog__island--tools",
|
|
28499
28414
|
caption: t("helpDialog.tools"),
|
|
28500
28415
|
children: [
|
|
28501
|
-
/* @__PURE__ */ jsx127(Shortcut, { label: t("toolBar.hand"), shortcuts: [
|
|
28502
|
-
|
|
28416
|
+
/* @__PURE__ */ jsx127(Shortcut, { label: t("toolBar.hand"), shortcuts: [KEYS52.H] }),
|
|
28417
|
+
SHAPES4.filter(({ myocSimplifiedMode }) => myocSimplifiedMode).map(
|
|
28503
28418
|
({ value, key }) => /* @__PURE__ */ jsx127(
|
|
28504
28419
|
Shortcut,
|
|
28505
28420
|
{
|
|
@@ -28534,7 +28449,7 @@ function BasicHelpDialog() {
|
|
|
28534
28449
|
className: "HelpDialog__island--view",
|
|
28535
28450
|
caption: t("helpDialog.view"),
|
|
28536
28451
|
children: [
|
|
28537
|
-
/* @__PURE__ */ jsx127(Shortcut, { label: t("helpDialog.smartZoom"), shortcuts: [
|
|
28452
|
+
/* @__PURE__ */ jsx127(Shortcut, { label: t("helpDialog.smartZoom"), shortcuts: [KEYS52.F] }),
|
|
28538
28453
|
/* @__PURE__ */ jsx127(
|
|
28539
28454
|
Shortcut,
|
|
28540
28455
|
{
|
|
@@ -28721,8 +28636,8 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28721
28636
|
className: "HelpDialog__island--tools",
|
|
28722
28637
|
caption: t("helpDialog.tools"),
|
|
28723
28638
|
children: [
|
|
28724
|
-
/* @__PURE__ */ jsx128(Shortcut2, { label: t("toolBar.hand"), shortcuts: [
|
|
28725
|
-
|
|
28639
|
+
/* @__PURE__ */ jsx128(Shortcut2, { label: t("toolBar.hand"), shortcuts: [KEYS53.H] }),
|
|
28640
|
+
SHAPES5.map(({ value, key }) => /* @__PURE__ */ jsx128(
|
|
28726
28641
|
Shortcut2,
|
|
28727
28642
|
{
|
|
28728
28643
|
label: t(`toolBar.${value}`),
|
|
@@ -28730,13 +28645,13 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28730
28645
|
},
|
|
28731
28646
|
value
|
|
28732
28647
|
)),
|
|
28733
|
-
/* @__PURE__ */ jsx128(Shortcut2, { label: t("toolBar.frame"), shortcuts: [
|
|
28734
|
-
/* @__PURE__ */ jsx128(Shortcut2, { label: t("toolBar.laser"), shortcuts: [
|
|
28648
|
+
/* @__PURE__ */ jsx128(Shortcut2, { label: t("toolBar.frame"), shortcuts: [KEYS53.F] }),
|
|
28649
|
+
/* @__PURE__ */ jsx128(Shortcut2, { label: t("toolBar.laser"), shortcuts: [KEYS53.K] }),
|
|
28735
28650
|
/* @__PURE__ */ jsx128(
|
|
28736
28651
|
Shortcut2,
|
|
28737
28652
|
{
|
|
28738
28653
|
label: t("labels.eyeDropper"),
|
|
28739
|
-
shortcuts: [
|
|
28654
|
+
shortcuts: [KEYS53.I, "Shift+S", "Shift+G"]
|
|
28740
28655
|
}
|
|
28741
28656
|
),
|
|
28742
28657
|
/* @__PURE__ */ jsx128(
|
|
@@ -28818,7 +28733,7 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28818
28733
|
isOr: true
|
|
28819
28734
|
}
|
|
28820
28735
|
),
|
|
28821
|
-
/* @__PURE__ */ jsx128(Shortcut2, { label: t("toolBar.lock"), shortcuts: [
|
|
28736
|
+
/* @__PURE__ */ jsx128(Shortcut2, { label: t("toolBar.lock"), shortcuts: [KEYS53.Q] }),
|
|
28822
28737
|
/* @__PURE__ */ jsx128(
|
|
28823
28738
|
Shortcut2,
|
|
28824
28739
|
{
|
|
@@ -28854,7 +28769,7 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28854
28769
|
Shortcut2,
|
|
28855
28770
|
{
|
|
28856
28771
|
label: t("helpDialog.smartZoom"),
|
|
28857
|
-
shortcuts: [
|
|
28772
|
+
shortcuts: [KEYS53.F]
|
|
28858
28773
|
}
|
|
28859
28774
|
),
|
|
28860
28775
|
/* @__PURE__ */ jsx128(
|
|
@@ -32307,6 +32222,9 @@ var Toast = ({
|
|
|
32307
32222
|
);
|
|
32308
32223
|
};
|
|
32309
32224
|
|
|
32225
|
+
// components/App.tsx
|
|
32226
|
+
import { findShapeByKey } from "@excalidraw/element/shapes";
|
|
32227
|
+
|
|
32310
32228
|
// components/UnlockPopup.tsx
|
|
32311
32229
|
import {
|
|
32312
32230
|
getCommonBounds as getCommonBounds10,
|
|
@@ -32635,7 +32553,7 @@ var App = class _App extends React45.Component {
|
|
|
32635
32553
|
onFocus: (e) => e.target.select(),
|
|
32636
32554
|
onBlur: () => this.resetEditingFrame(f),
|
|
32637
32555
|
onKeyDown: (event) => {
|
|
32638
|
-
if (event.key ===
|
|
32556
|
+
if (event.key === KEYS54.ESCAPE || event.key === KEYS54.ENTER) {
|
|
32639
32557
|
this.resetEditingFrame(f);
|
|
32640
32558
|
}
|
|
32641
32559
|
},
|
|
@@ -33719,7 +33637,7 @@ var App = class _App extends React45.Component {
|
|
|
33719
33637
|
});
|
|
33720
33638
|
}
|
|
33721
33639
|
if (!isInputLike(event.target)) {
|
|
33722
|
-
if ((event.key ===
|
|
33640
|
+
if ((event.key === KEYS54.ESCAPE || event.key === KEYS54.ENTER) && this.state.croppingElementId) {
|
|
33723
33641
|
this.finishImageCropping();
|
|
33724
33642
|
return;
|
|
33725
33643
|
}
|
|
@@ -33727,13 +33645,13 @@ var App = class _App extends React45.Component {
|
|
|
33727
33645
|
this.scene.getNonDeletedElementsMap(),
|
|
33728
33646
|
this.state
|
|
33729
33647
|
);
|
|
33730
|
-
if (selectedElements.length === 1 && isImageElement9(selectedElements[0]) && event.key ===
|
|
33648
|
+
if (selectedElements.length === 1 && isImageElement9(selectedElements[0]) && event.key === KEYS54.ENTER) {
|
|
33731
33649
|
this.startImageCropping(selectedElements[0]);
|
|
33732
33650
|
return;
|
|
33733
33651
|
}
|
|
33734
|
-
if (event.key ===
|
|
33652
|
+
if (event.key === KEYS54.ESCAPE) {
|
|
33735
33653
|
this.updateEditorAtom(convertElementTypePopupAtom, null);
|
|
33736
|
-
} else if (event.key ===
|
|
33654
|
+
} else if (event.key === KEYS54.TAB && (document.activeElement === this.excalidrawContainerRef?.current || document.activeElement?.classList.contains(
|
|
33737
33655
|
CLASSES9.CONVERT_ELEMENT_TYPE_POPUP
|
|
33738
33656
|
))) {
|
|
33739
33657
|
event.preventDefault();
|
|
@@ -33752,13 +33670,13 @@ var App = class _App extends React45.Component {
|
|
|
33752
33670
|
});
|
|
33753
33671
|
}
|
|
33754
33672
|
}
|
|
33755
|
-
if (event.key ===
|
|
33673
|
+
if (event.key === KEYS54.ESCAPE && this.flowChartCreator.isCreatingChart) {
|
|
33756
33674
|
this.flowChartCreator.clear();
|
|
33757
33675
|
this.triggerRender(true);
|
|
33758
33676
|
return;
|
|
33759
33677
|
}
|
|
33760
33678
|
const arrowKeyPressed = isArrowKey2(event.key);
|
|
33761
|
-
if (event[
|
|
33679
|
+
if (event[KEYS54.CTRL_OR_CMD] && arrowKeyPressed && !event.shiftKey) {
|
|
33762
33680
|
event.preventDefault();
|
|
33763
33681
|
const selectedElements2 = getSelectedElements(
|
|
33764
33682
|
this.scene.getNonDeletedElementsMap(),
|
|
@@ -33842,7 +33760,7 @@ var App = class _App extends React45.Component {
|
|
|
33842
33760
|
}
|
|
33843
33761
|
}
|
|
33844
33762
|
}
|
|
33845
|
-
if (event[
|
|
33763
|
+
if (event[KEYS54.CTRL_OR_CMD] && event.key === KEYS54.P && !event.shiftKey && !event.altKey) {
|
|
33846
33764
|
this.setToast({
|
|
33847
33765
|
message: t("commandPalette.shortcutHint", {
|
|
33848
33766
|
shortcut: getShortcutFromShortcutName("commandPalette")
|
|
@@ -33851,14 +33769,14 @@ var App = class _App extends React45.Component {
|
|
|
33851
33769
|
event.preventDefault();
|
|
33852
33770
|
return;
|
|
33853
33771
|
}
|
|
33854
|
-
if (event[
|
|
33772
|
+
if (event[KEYS54.CTRL_OR_CMD] && event.key.toLowerCase() === KEYS54.V) {
|
|
33855
33773
|
IS_PLAIN_PASTE = event.shiftKey;
|
|
33856
33774
|
clearTimeout(IS_PLAIN_PASTE_TIMER);
|
|
33857
33775
|
IS_PLAIN_PASTE_TIMER = window.setTimeout(() => {
|
|
33858
33776
|
IS_PLAIN_PASTE = false;
|
|
33859
33777
|
}, 100);
|
|
33860
33778
|
}
|
|
33861
|
-
if (event[
|
|
33779
|
+
if (event[KEYS54.CTRL_OR_CMD] && isWritableElement5(event.target)) {
|
|
33862
33780
|
if (event.code === CODES13.MINUS || event.code === CODES13.EQUAL) {
|
|
33863
33781
|
event.preventDefault();
|
|
33864
33782
|
return;
|
|
@@ -33867,24 +33785,24 @@ var App = class _App extends React45.Component {
|
|
|
33867
33785
|
if (
|
|
33868
33786
|
// inside an input
|
|
33869
33787
|
isWritableElement5(event.target) && // unless pressing escape (finalize action)
|
|
33870
|
-
event.key !==
|
|
33788
|
+
event.key !== KEYS54.ESCAPE || // or unless using arrows (to move between buttons)
|
|
33871
33789
|
isArrowKey2(event.key) && isInputLike(event.target)
|
|
33872
33790
|
) {
|
|
33873
33791
|
return;
|
|
33874
33792
|
}
|
|
33875
|
-
if (event.key ===
|
|
33793
|
+
if (event.key === KEYS54.QUESTION_MARK) {
|
|
33876
33794
|
this.setState({
|
|
33877
33795
|
openDialog: { name: "help" }
|
|
33878
33796
|
});
|
|
33879
33797
|
return;
|
|
33880
|
-
} else if (event.key.toLowerCase() ===
|
|
33798
|
+
} else if (event.key.toLowerCase() === KEYS54.E && event.shiftKey && event[KEYS54.CTRL_OR_CMD]) {
|
|
33881
33799
|
event.preventDefault();
|
|
33882
33800
|
this.setState({ openDialog: { name: "imageExport" } });
|
|
33883
33801
|
return;
|
|
33884
33802
|
}
|
|
33885
|
-
if (event.key ===
|
|
33803
|
+
if (event.key === KEYS54.PAGE_UP || event.key === KEYS54.PAGE_DOWN) {
|
|
33886
33804
|
let offset = (event.shiftKey ? this.state.width : this.state.height) / this.state.zoom.value;
|
|
33887
|
-
if (event.key ===
|
|
33805
|
+
if (event.key === KEYS54.PAGE_DOWN) {
|
|
33888
33806
|
offset = -offset;
|
|
33889
33807
|
}
|
|
33890
33808
|
if (event.shiftKey) {
|
|
@@ -33900,7 +33818,7 @@ var App = class _App extends React45.Component {
|
|
|
33900
33818
|
if (this.state.openDialog?.name === "elementLinkSelector") {
|
|
33901
33819
|
return;
|
|
33902
33820
|
}
|
|
33903
|
-
if (event.key ===
|
|
33821
|
+
if (event.key === KEYS54.ALT && getFeatureFlag4("COMPLEX_BINDINGS")) {
|
|
33904
33822
|
this.handleSkipBindMode();
|
|
33905
33823
|
}
|
|
33906
33824
|
if (this.actionManager.handleKeyDown(event)) {
|
|
@@ -33909,7 +33827,7 @@ var App = class _App extends React45.Component {
|
|
|
33909
33827
|
if (this.state.viewModeEnabled) {
|
|
33910
33828
|
return;
|
|
33911
33829
|
}
|
|
33912
|
-
if (event[
|
|
33830
|
+
if (event[KEYS54.CTRL_OR_CMD] && this.state.isBindingEnabled) {
|
|
33913
33831
|
if (getFeatureFlag4("COMPLEX_BINDINGS")) {
|
|
33914
33832
|
this.resetDelayedBindMode();
|
|
33915
33833
|
}
|
|
@@ -33939,13 +33857,13 @@ var App = class _App extends React45.Component {
|
|
|
33939
33857
|
const step = this.getEffectiveGridSize() && (event.shiftKey ? ELEMENT_TRANSLATE_AMOUNT : this.getEffectiveGridSize()) || (event.shiftKey ? ELEMENT_SHIFT_TRANSLATE_AMOUNT : ELEMENT_TRANSLATE_AMOUNT);
|
|
33940
33858
|
let offsetX = 0;
|
|
33941
33859
|
let offsetY = 0;
|
|
33942
|
-
if (event.key ===
|
|
33860
|
+
if (event.key === KEYS54.ARROW_LEFT) {
|
|
33943
33861
|
offsetX = -step;
|
|
33944
|
-
} else if (event.key ===
|
|
33862
|
+
} else if (event.key === KEYS54.ARROW_RIGHT) {
|
|
33945
33863
|
offsetX = step;
|
|
33946
|
-
} else if (event.key ===
|
|
33864
|
+
} else if (event.key === KEYS54.ARROW_UP) {
|
|
33947
33865
|
offsetY = -step;
|
|
33948
|
-
} else if (event.key ===
|
|
33866
|
+
} else if (event.key === KEYS54.ARROW_DOWN) {
|
|
33949
33867
|
offsetY = step;
|
|
33950
33868
|
}
|
|
33951
33869
|
selectedElements.forEach((element) => {
|
|
@@ -33963,11 +33881,11 @@ var App = class _App extends React45.Component {
|
|
|
33963
33881
|
});
|
|
33964
33882
|
this.scene.triggerUpdate();
|
|
33965
33883
|
event.preventDefault();
|
|
33966
|
-
} else if (event.key ===
|
|
33884
|
+
} else if (event.key === KEYS54.ENTER) {
|
|
33967
33885
|
const selectedElements = this.scene.getSelectedElements(this.state);
|
|
33968
33886
|
if (selectedElements.length === 1) {
|
|
33969
33887
|
const selectedElement = selectedElements[0];
|
|
33970
|
-
if (event[
|
|
33888
|
+
if (event[KEYS54.CTRL_OR_CMD] || isLineElement8(selectedElement)) {
|
|
33971
33889
|
if (isLinearElement12(selectedElement)) {
|
|
33972
33890
|
if (!this.state.selectedLinearElement?.isEditing || this.state.selectedLinearElement.elementId !== selectedElement.id) {
|
|
33973
33891
|
this.store.scheduleCapture();
|
|
@@ -34018,31 +33936,31 @@ var App = class _App extends React45.Component {
|
|
|
34018
33936
|
}
|
|
34019
33937
|
this.setActiveTool({ type: shape });
|
|
34020
33938
|
event.stopPropagation();
|
|
34021
|
-
} else if (event.key ===
|
|
33939
|
+
} else if (event.key === KEYS54.Q) {
|
|
34022
33940
|
this.toggleLock("keyboard");
|
|
34023
33941
|
event.stopPropagation();
|
|
34024
33942
|
}
|
|
34025
33943
|
}
|
|
34026
|
-
if (event.key ===
|
|
33944
|
+
if (event.key === KEYS54.SPACE && gesture.pointers.size === 0) {
|
|
34027
33945
|
isHoldingSpace = true;
|
|
34028
33946
|
setCursor(this.interactiveCanvas, CURSOR_TYPE4.GRAB);
|
|
34029
33947
|
event.preventDefault();
|
|
34030
33948
|
}
|
|
34031
|
-
if ((event.key ===
|
|
33949
|
+
if ((event.key === KEYS54.G || event.key === KEYS54.S) && !event.altKey && !event[KEYS54.CTRL_OR_CMD]) {
|
|
34032
33950
|
const selectedElements = this.scene.getSelectedElements(this.state);
|
|
34033
33951
|
if (this.state.activeTool.type === "selection" && !selectedElements.length) {
|
|
34034
33952
|
return;
|
|
34035
33953
|
}
|
|
34036
|
-
if (event.key ===
|
|
33954
|
+
if (event.key === KEYS54.G && (hasBackground(this.state.activeTool.type) || selectedElements.some((element) => hasBackground(element.type)))) {
|
|
34037
33955
|
this.setState({ openPopup: "elementBackground" });
|
|
34038
33956
|
event.stopPropagation();
|
|
34039
33957
|
}
|
|
34040
|
-
if (event.key ===
|
|
33958
|
+
if (event.key === KEYS54.S) {
|
|
34041
33959
|
this.setState({ openPopup: "elementStroke" });
|
|
34042
33960
|
event.stopPropagation();
|
|
34043
33961
|
}
|
|
34044
33962
|
}
|
|
34045
|
-
if (!event[
|
|
33963
|
+
if (!event[KEYS54.CTRL_OR_CMD] && event.shiftKey && event.key.toLowerCase() === KEYS54.F) {
|
|
34046
33964
|
const selectedElements = this.scene.getSelectedElements(this.state);
|
|
34047
33965
|
if (this.state.activeTool.type === "selection" && !selectedElements.length) {
|
|
34048
33966
|
return;
|
|
@@ -34057,7 +33975,7 @@ var App = class _App extends React45.Component {
|
|
|
34057
33975
|
this.setState({ openPopup: "fontFamily" });
|
|
34058
33976
|
}
|
|
34059
33977
|
}
|
|
34060
|
-
if (event.key ===
|
|
33978
|
+
if (event.key === KEYS54.K && !event.altKey && !event[KEYS54.CTRL_OR_CMD]) {
|
|
34061
33979
|
if (this.state.activeTool.type === "laser") {
|
|
34062
33980
|
this.setActiveTool({ type: this.state.preferredSelectionTool.type });
|
|
34063
33981
|
} else {
|
|
@@ -34066,8 +33984,8 @@ var App = class _App extends React45.Component {
|
|
|
34066
33984
|
return;
|
|
34067
33985
|
}
|
|
34068
33986
|
const lowerCased = event.key.toLocaleLowerCase();
|
|
34069
|
-
const isPickingStroke = lowerCased ===
|
|
34070
|
-
const isPickingBackground = event.key ===
|
|
33987
|
+
const isPickingStroke = lowerCased === KEYS54.S && event.shiftKey;
|
|
33988
|
+
const isPickingBackground = event.key === KEYS54.I || lowerCased === KEYS54.G && event.shiftKey;
|
|
34071
33989
|
if (isPickingStroke || isPickingBackground) {
|
|
34072
33990
|
this.openEyeDropper({
|
|
34073
33991
|
type: isPickingStroke ? "stroke" : "background"
|
|
@@ -34076,7 +33994,7 @@ var App = class _App extends React45.Component {
|
|
|
34076
33994
|
}
|
|
34077
33995
|
));
|
|
34078
33996
|
__publicField(this, "onKeyUp", withBatchedUpdates((event) => {
|
|
34079
|
-
if (event.key ===
|
|
33997
|
+
if (event.key === KEYS54.SPACE) {
|
|
34080
33998
|
if (this.state.viewModeEnabled || this.state.openDialog?.name === "elementLinkSelector") {
|
|
34081
33999
|
setCursor(this.interactiveCanvas, CURSOR_TYPE4.GRAB);
|
|
34082
34000
|
} else if (isSelectionLikeTool(this.state.activeTool.type)) {
|
|
@@ -34092,7 +34010,7 @@ var App = class _App extends React45.Component {
|
|
|
34092
34010
|
}
|
|
34093
34011
|
isHoldingSpace = false;
|
|
34094
34012
|
}
|
|
34095
|
-
if (event.key ===
|
|
34013
|
+
if (event.key === KEYS54.ALT && this.state.bindMode === "skip" || !event[KEYS54.CTRL_OR_CMD] && !isBindingEnabled2(this.state)) {
|
|
34096
34014
|
this.setState({
|
|
34097
34015
|
bindMode: "orbit"
|
|
34098
34016
|
});
|
|
@@ -34120,7 +34038,7 @@ var App = class _App extends React45.Component {
|
|
|
34120
34038
|
}
|
|
34121
34039
|
}
|
|
34122
34040
|
}
|
|
34123
|
-
if (!event[
|
|
34041
|
+
if (!event[KEYS54.CTRL_OR_CMD] && !this.state.isBindingEnabled) {
|
|
34124
34042
|
this.setState({ isBindingEnabled: true });
|
|
34125
34043
|
}
|
|
34126
34044
|
if (isArrowKey2(event.key)) {
|
|
@@ -34172,7 +34090,7 @@ var App = class _App extends React45.Component {
|
|
|
34172
34090
|
});
|
|
34173
34091
|
}
|
|
34174
34092
|
}
|
|
34175
|
-
if (!event[
|
|
34093
|
+
if (!event[KEYS54.CTRL_OR_CMD]) {
|
|
34176
34094
|
if (this.flowChartCreator.isCreatingChart) {
|
|
34177
34095
|
if (this.flowChartCreator.pendingNodes?.length) {
|
|
34178
34096
|
this.scene.insertElements(this.flowChartCreator.pendingNodes);
|
|
@@ -34501,7 +34419,7 @@ var App = class _App extends React45.Component {
|
|
|
34501
34419
|
);
|
|
34502
34420
|
if (selectedElements.length === 1 && isLinearElement12(selectedElements[0])) {
|
|
34503
34421
|
const selectedLinearElement = selectedElements[0];
|
|
34504
|
-
if ((event[
|
|
34422
|
+
if ((event[KEYS54.CTRL_OR_CMD] && isSimpleArrow(selectedLinearElement) || isLineElement8(selectedLinearElement)) && (!this.state.selectedLinearElement?.isEditing || this.state.selectedLinearElement.elementId !== selectedLinearElement.id)) {
|
|
34505
34423
|
this.actionManager.executeAction(actionToggleLinearEditor);
|
|
34506
34424
|
return;
|
|
34507
34425
|
} else if (this.state.selectedLinearElement && isElbowArrow10(selectedElements[0])) {
|
|
@@ -34586,7 +34504,7 @@ var App = class _App extends React45.Component {
|
|
|
34586
34504
|
}
|
|
34587
34505
|
}
|
|
34588
34506
|
resetCursor(this.interactiveCanvas);
|
|
34589
|
-
if (!event[
|
|
34507
|
+
if (!event[KEYS54.CTRL_OR_CMD] && !this.state.viewModeEnabled) {
|
|
34590
34508
|
const hitElement = this.getElementAtPosition(sceneX, sceneY);
|
|
34591
34509
|
if (isIframeLikeElement2(hitElement)) {
|
|
34592
34510
|
this.setState({
|
|
@@ -35104,7 +35022,7 @@ var App = class _App extends React45.Component {
|
|
|
35104
35022
|
setCursor(this.interactiveCanvas, CURSOR_TYPE4.AUTO);
|
|
35105
35023
|
} else if (
|
|
35106
35024
|
// if using cmd/ctrl, we're not dragging
|
|
35107
|
-
!event[
|
|
35025
|
+
!event[KEYS54.CTRL_OR_CMD]
|
|
35108
35026
|
) {
|
|
35109
35027
|
if ((hitElement || this.isHittingCommonBoundingBoxOfSelectedElements(
|
|
35110
35028
|
scenePointer,
|
|
@@ -35788,7 +35706,7 @@ var App = class _App extends React45.Component {
|
|
|
35788
35706
|
) : makeNextSelectedElementIds2({}, prevState)
|
|
35789
35707
|
}));
|
|
35790
35708
|
} else if (hitElement != null) {
|
|
35791
|
-
if (event[
|
|
35709
|
+
if (event[KEYS54.CTRL_OR_CMD]) {
|
|
35792
35710
|
if (event.altKey) {
|
|
35793
35711
|
if (this.state.openDialog?.name === "elementLinkSelector") {
|
|
35794
35712
|
this.setOpenDialog(null);
|
|
@@ -35996,7 +35914,7 @@ var App = class _App extends React45.Component {
|
|
|
35996
35914
|
const [gridX, gridY] = getGridPoint2(
|
|
35997
35915
|
sceneX,
|
|
35998
35916
|
sceneY,
|
|
35999
|
-
this.lastPointerDownEvent?.[
|
|
35917
|
+
this.lastPointerDownEvent?.[KEYS54.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
36000
35918
|
);
|
|
36001
35919
|
const element = newIframeElement({
|
|
36002
35920
|
type: "iframe",
|
|
@@ -36026,7 +35944,7 @@ var App = class _App extends React45.Component {
|
|
|
36026
35944
|
const [gridX, gridY] = getGridPoint2(
|
|
36027
35945
|
sceneX,
|
|
36028
35946
|
sceneY,
|
|
36029
|
-
this.lastPointerDownEvent?.[
|
|
35947
|
+
this.lastPointerDownEvent?.[KEYS54.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
36030
35948
|
);
|
|
36031
35949
|
const embedLink = getEmbedLink2(link);
|
|
36032
35950
|
if (!embedLink) {
|
|
@@ -36066,7 +35984,7 @@ var App = class _App extends React45.Component {
|
|
|
36066
35984
|
const [gridX, gridY] = getGridPoint2(
|
|
36067
35985
|
sceneX,
|
|
36068
35986
|
sceneY,
|
|
36069
|
-
this.lastPointerDownEvent?.[
|
|
35987
|
+
this.lastPointerDownEvent?.[KEYS54.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
36070
35988
|
);
|
|
36071
35989
|
const topLayerFrame = addToFrameUnderCursor ? this.getTopLayerFrameAtSceneCoords({
|
|
36072
35990
|
x: gridX,
|
|
@@ -36170,7 +36088,7 @@ var App = class _App extends React45.Component {
|
|
|
36170
36088
|
const [gridX, gridY] = getGridPoint2(
|
|
36171
36089
|
pointerDownState.origin.x,
|
|
36172
36090
|
pointerDownState.origin.y,
|
|
36173
|
-
event[
|
|
36091
|
+
event[KEYS54.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
36174
36092
|
);
|
|
36175
36093
|
const topLayerFrame = this.getTopLayerFrameAtSceneCoords({
|
|
36176
36094
|
x: gridX,
|
|
@@ -36297,7 +36215,7 @@ var App = class _App extends React45.Component {
|
|
|
36297
36215
|
const [gridX, gridY] = getGridPoint2(
|
|
36298
36216
|
pointerDownState.origin.x,
|
|
36299
36217
|
pointerDownState.origin.y,
|
|
36300
|
-
this.lastPointerDownEvent?.[
|
|
36218
|
+
this.lastPointerDownEvent?.[KEYS54.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
36301
36219
|
);
|
|
36302
36220
|
const topLayerFrame = this.getTopLayerFrameAtSceneCoords({
|
|
36303
36221
|
x: gridX,
|
|
@@ -36345,7 +36263,7 @@ var App = class _App extends React45.Component {
|
|
|
36345
36263
|
const [gridX, gridY] = getGridPoint2(
|
|
36346
36264
|
pointerDownState.origin.x,
|
|
36347
36265
|
pointerDownState.origin.y,
|
|
36348
|
-
this.lastPointerDownEvent?.[
|
|
36266
|
+
this.lastPointerDownEvent?.[KEYS54.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
36349
36267
|
);
|
|
36350
36268
|
const constructorOpts = {
|
|
36351
36269
|
x: gridX,
|
|
@@ -36953,7 +36871,7 @@ var App = class _App extends React45.Component {
|
|
|
36953
36871
|
let [gridX, gridY] = getGridPoint2(
|
|
36954
36872
|
pointerCoords.x,
|
|
36955
36873
|
pointerCoords.y,
|
|
36956
|
-
event[
|
|
36874
|
+
event[KEYS54.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
36957
36875
|
);
|
|
36958
36876
|
const image = isInitializedImageElement3(newElement5) && this.imageCache.get(newElement5.fileId)?.image;
|
|
36959
36877
|
const aspectRatio = image && !(image instanceof Promise) ? image.width / image.height : null;
|
|
@@ -37019,7 +36937,7 @@ var App = class _App extends React45.Component {
|
|
|
37019
36937
|
const [x, y] = getGridPoint2(
|
|
37020
36938
|
pointerCoords.x - pointerDownState.resize.offset.x,
|
|
37021
36939
|
pointerCoords.y - pointerDownState.resize.offset.y,
|
|
37022
|
-
event[
|
|
36940
|
+
event[KEYS54.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
37023
36941
|
);
|
|
37024
36942
|
const croppingElement = this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);
|
|
37025
36943
|
if (transformHandleType && croppingElement && isImageElement9(croppingElement)) {
|
|
@@ -37031,7 +36949,7 @@ var App = class _App extends React45.Component {
|
|
|
37031
36949
|
const [gridX, gridY] = getGridPoint2(
|
|
37032
36950
|
pointerCoords.x,
|
|
37033
36951
|
pointerCoords.y,
|
|
37034
|
-
event[
|
|
36952
|
+
event[KEYS54.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
37035
36953
|
);
|
|
37036
36954
|
const dragOffset = {
|
|
37037
36955
|
x: gridX - pointerDownState.originInGrid.x,
|
|
@@ -37095,7 +37013,7 @@ var App = class _App extends React45.Component {
|
|
|
37095
37013
|
let [resizeX, resizeY] = getGridPoint2(
|
|
37096
37014
|
pointerCoords.x - pointerDownState.resize.offset.x,
|
|
37097
37015
|
pointerCoords.y - pointerDownState.resize.offset.y,
|
|
37098
|
-
event[
|
|
37016
|
+
event[KEYS54.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
37099
37017
|
);
|
|
37100
37018
|
const frameElementsOffsetsMap = /* @__PURE__ */ new Map();
|
|
37101
37019
|
selectedFrames.forEach((frame) => {
|
|
@@ -37114,7 +37032,7 @@ var App = class _App extends React45.Component {
|
|
|
37114
37032
|
const [gridX, gridY] = getGridPoint2(
|
|
37115
37033
|
pointerCoords.x,
|
|
37116
37034
|
pointerCoords.y,
|
|
37117
|
-
event[
|
|
37035
|
+
event[KEYS54.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
37118
37036
|
);
|
|
37119
37037
|
const dragOffset = {
|
|
37120
37038
|
x: gridX - pointerDownState.originInGrid.x,
|
|
@@ -37252,7 +37170,7 @@ var App = class _App extends React45.Component {
|
|
|
37252
37170
|
__publicField(this, "handleWheel", withBatchedUpdates(
|
|
37253
37171
|
(event) => {
|
|
37254
37172
|
if (!(event.target instanceof HTMLCanvasElement || event.target instanceof HTMLTextAreaElement || event.target instanceof HTMLIFrameElement || event.target instanceof HTMLElement && event.target.classList.contains(CLASSES9.FRAME_NAME))) {
|
|
37255
|
-
if (event[
|
|
37173
|
+
if (event[KEYS54.CTRL_OR_CMD]) {
|
|
37256
37174
|
event.preventDefault();
|
|
37257
37175
|
}
|
|
37258
37176
|
return;
|
|
@@ -39261,12 +39179,12 @@ var App = class _App extends React45.Component {
|
|
|
39261
39179
|
const isElbowArrowOnly = selectedElements.findIndex(isElbowArrow10) === 0;
|
|
39262
39180
|
return {
|
|
39263
39181
|
origin,
|
|
39264
|
-
withCmdOrCtrl: event[
|
|
39182
|
+
withCmdOrCtrl: event[KEYS54.CTRL_OR_CMD],
|
|
39265
39183
|
originInGrid: tupleToCoors(
|
|
39266
39184
|
getGridPoint2(
|
|
39267
39185
|
origin.x,
|
|
39268
39186
|
origin.y,
|
|
39269
|
-
event[
|
|
39187
|
+
event[KEYS54.CTRL_OR_CMD] || isElbowArrowOnly ? null : this.getEffectiveGridSize()
|
|
39270
39188
|
)
|
|
39271
39189
|
),
|
|
39272
39190
|
scrollbars: isOverScrollBars(
|
|
@@ -39407,7 +39325,7 @@ var App = class _App extends React45.Component {
|
|
|
39407
39325
|
}
|
|
39408
39326
|
onKeyUpFromPointerDownHandler(pointerDownState) {
|
|
39409
39327
|
return withBatchedUpdates((event) => {
|
|
39410
|
-
event.key ===
|
|
39328
|
+
event.key === KEYS54.ALT && event.preventDefault();
|
|
39411
39329
|
if (this.maybeHandleResize(pointerDownState, event)) {
|
|
39412
39330
|
return;
|
|
39413
39331
|
}
|
|
@@ -39429,7 +39347,7 @@ var App = class _App extends React45.Component {
|
|
|
39429
39347
|
const [gridX2, gridY2] = getGridPoint2(
|
|
39430
39348
|
pointerCoords.x,
|
|
39431
39349
|
pointerCoords.y,
|
|
39432
|
-
event[
|
|
39350
|
+
event[KEYS54.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
39433
39351
|
);
|
|
39434
39352
|
let index = this.state.selectedLinearElement.initialState.segmentMidpoint.index;
|
|
39435
39353
|
if (index < 0) {
|
|
@@ -39494,7 +39412,7 @@ var App = class _App extends React45.Component {
|
|
|
39494
39412
|
const [gridX, gridY] = getGridPoint2(
|
|
39495
39413
|
pointerCoords.x,
|
|
39496
39414
|
pointerCoords.y,
|
|
39497
|
-
event[
|
|
39415
|
+
event[KEYS54.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
39498
39416
|
);
|
|
39499
39417
|
if (pointerDownState.resize.isResizing) {
|
|
39500
39418
|
pointerDownState.lastCoords.x = pointerCoords.x;
|
|
@@ -39519,7 +39437,7 @@ var App = class _App extends React45.Component {
|
|
|
39519
39437
|
this.state.selectedLinearElement,
|
|
39520
39438
|
pointerCoords,
|
|
39521
39439
|
this,
|
|
39522
|
-
!event[
|
|
39440
|
+
!event[KEYS54.CTRL_OR_CMD],
|
|
39523
39441
|
this.scene
|
|
39524
39442
|
);
|
|
39525
39443
|
if (!ret) {
|
|
@@ -39717,7 +39635,7 @@ var App = class _App extends React45.Component {
|
|
|
39717
39635
|
dragOffset,
|
|
39718
39636
|
this.scene,
|
|
39719
39637
|
snapOffset,
|
|
39720
|
-
event[
|
|
39638
|
+
event[KEYS54.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
39721
39639
|
);
|
|
39722
39640
|
}
|
|
39723
39641
|
this.setState({
|