@myoc/excalidraw 0.19.541 → 0.19.543
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 +54 -2
- package/dist/dev/{chunk-2OVHIH4L.js → chunk-35XUJXYN.js} +3 -3
- package/dist/dev/{chunk-2OVHIH4L.js.map → chunk-35XUJXYN.js.map} +1 -1
- package/dist/dev/{chunk-3GXWFO3U.js → chunk-6OYO4QVO.js} +3 -3
- package/dist/dev/{chunk-JLFL3YO4.js → chunk-VQRWPJBP.js} +2 -2
- package/dist/dev/data/{image-OIDJZ5EF.js → image-MKDSIQJM.js} +3 -3
- package/dist/dev/index.css +76 -40
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +645 -458
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-JINXO2V2.js → en-CBVTFJ6O.js} +2 -2
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/{chunk-HIRMJCIV.js → chunk-6XZBDSSD.js} +2 -2
- package/dist/prod/{chunk-2C5S74BI.js → chunk-FAEGDXCJ.js} +1 -1
- package/dist/prod/{chunk-KGIBYNMP.js → chunk-VXOLR3OR.js} +4 -3
- package/dist/prod/data/image-UN6HXAW6.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +19 -19
- package/dist/prod/locales/{en-2ZA2LKRK.js → en-7BECMN3G.js} +1 -1
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/excalidraw/actions/actionSmartZoom.d.ts +79 -13
- package/dist/types/excalidraw/components/App.d.ts +9 -0
- package/package.json +4 -4
- package/dist/prod/data/image-GF26Y3QJ.js +0 -1
- /package/dist/dev/{chunk-3GXWFO3U.js.map → chunk-6OYO4QVO.js.map} +0 -0
- /package/dist/dev/{chunk-JLFL3YO4.js.map → chunk-VQRWPJBP.js.map} +0 -0
- /package/dist/dev/data/{image-OIDJZ5EF.js.map → image-MKDSIQJM.js.map} +0 -0
- /package/dist/dev/locales/{en-JINXO2V2.js.map → en-CBVTFJ6O.js.map} +0 -0
package/dist/dev/index.js
CHANGED
|
@@ -64,13 +64,13 @@ import {
|
|
|
64
64
|
serializeAsJSON,
|
|
65
65
|
strokeRectWithRotation_simple,
|
|
66
66
|
zoomToFitBounds
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-6OYO4QVO.js";
|
|
68
68
|
import {
|
|
69
69
|
define_import_meta_env_default
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-VQRWPJBP.js";
|
|
71
71
|
import {
|
|
72
72
|
en_default
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-35XUJXYN.js";
|
|
74
74
|
import {
|
|
75
75
|
percentages_default
|
|
76
76
|
} from "./chunk-72CYJXY3.js";
|
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
} from "@excalidraw/common";
|
|
98
98
|
|
|
99
99
|
// components/App.tsx
|
|
100
|
-
import
|
|
100
|
+
import clsx62 from "clsx";
|
|
101
101
|
import throttle3 from "lodash.throttle";
|
|
102
102
|
import React41, { useContext as useContext4 } from "react";
|
|
103
103
|
import { flushSync as flushSync2 } from "react-dom";
|
|
@@ -236,7 +236,7 @@ import {
|
|
|
236
236
|
isBindingElementType,
|
|
237
237
|
isBoundToContainer as isBoundToContainer10,
|
|
238
238
|
isFrameLikeElement as isFrameLikeElement17,
|
|
239
|
-
isImageElement as
|
|
239
|
+
isImageElement as isImageElement10,
|
|
240
240
|
isEmbeddableElement as isEmbeddableElement4,
|
|
241
241
|
isInitializedImageElement as isInitializedImageElement5,
|
|
242
242
|
isLinearElement as isLinearElement11,
|
|
@@ -330,7 +330,7 @@ import {
|
|
|
330
330
|
calculateFixedPointForNonElbowArrowBinding as calculateFixedPointForNonElbowArrowBinding2,
|
|
331
331
|
bindOrUnbindBindingElement as bindOrUnbindBindingElement2,
|
|
332
332
|
mutateElement as mutateElement7,
|
|
333
|
-
getElementBounds as
|
|
333
|
+
getElementBounds as getElementBounds5,
|
|
334
334
|
doBoundsIntersect as doBoundsIntersect4,
|
|
335
335
|
isPointInElement as isPointInElement3,
|
|
336
336
|
maxBindingDistance_simple as maxBindingDistance_simple4,
|
|
@@ -398,7 +398,7 @@ var globImport_locales_json = __glob({
|
|
|
398
398
|
"./locales/de-CH.json": () => import("./locales/de-CH-KLWBYLGC.js"),
|
|
399
399
|
"./locales/de-DE.json": () => import("./locales/de-DE-UB755M7G.js"),
|
|
400
400
|
"./locales/el-GR.json": () => import("./locales/el-GR-J2BFDAEA.js"),
|
|
401
|
-
"./locales/en.json": () => import("./locales/en-
|
|
401
|
+
"./locales/en.json": () => import("./locales/en-CBVTFJ6O.js"),
|
|
402
402
|
"./locales/es-ES.json": () => import("./locales/es-ES-GL35U3D6.js"),
|
|
403
403
|
"./locales/eu-ES.json": () => import("./locales/eu-ES-5LL7P4G7.js"),
|
|
404
404
|
"./locales/fa-IR.json": () => import("./locales/fa-IR-2D6AXPSB.js"),
|
|
@@ -10970,7 +10970,7 @@ var exportCanvas = async (type, elements, appState, files, {
|
|
|
10970
10970
|
let blob = canvasToBlob(tempCanvas);
|
|
10971
10971
|
if (appState.exportEmbedScene) {
|
|
10972
10972
|
blob = blob.then(
|
|
10973
|
-
(blob2) => import("./data/image-
|
|
10973
|
+
(blob2) => import("./data/image-MKDSIQJM.js").then(
|
|
10974
10974
|
({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
|
|
10975
10975
|
blob: blob2,
|
|
10976
10976
|
metadata: serializeAsJSON(elements, appState, files, "local")
|
|
@@ -13125,21 +13125,58 @@ var actionToggleGridMode = register({
|
|
|
13125
13125
|
});
|
|
13126
13126
|
|
|
13127
13127
|
// actions/actionSmartZoom.tsx
|
|
13128
|
+
import clsx23 from "clsx";
|
|
13128
13129
|
import { KEYS as KEYS27 } from "@excalidraw/common";
|
|
13129
13130
|
import { CaptureUpdateAction as CaptureUpdateAction22 } from "@excalidraw/element/store";
|
|
13131
|
+
import { getElementBounds } from "@excalidraw/element";
|
|
13132
|
+
import { isImageElement } from "@excalidraw/element/typeChecks";
|
|
13130
13133
|
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
13134
|
+
var SMART_ZOOM_KEY_HINT = "Press <kbd>F</kbd> quickly to smart zoom the canvas, or hold and click on an item to smart zoom to it";
|
|
13135
|
+
var smartZoomKeyHeldAtom = atom(false);
|
|
13136
|
+
var getNextSmartZoomImage = (elements, elementsMap, currentImageId, direction) => {
|
|
13137
|
+
const images = elements.filter(isImageElement).sort((imageA, imageB) => {
|
|
13138
|
+
const [leftA, topA] = getElementBounds(imageA, elementsMap);
|
|
13139
|
+
const [leftB, topB] = getElementBounds(imageB, elementsMap);
|
|
13140
|
+
return topA - topB || leftA - leftB;
|
|
13141
|
+
});
|
|
13142
|
+
if (images.length === 0) {
|
|
13143
|
+
return null;
|
|
13144
|
+
}
|
|
13145
|
+
const currentIndex = images.findIndex((image) => image.id === currentImageId);
|
|
13146
|
+
const nextIndex = direction === "next" ? (currentIndex + 1) % images.length : (currentIndex < 0 ? images.length - 1 : currentIndex - 1 + images.length) % images.length;
|
|
13147
|
+
return images[nextIndex];
|
|
13148
|
+
};
|
|
13149
|
+
var SmartZoomButton = ({ data, updateData }) => {
|
|
13150
|
+
const smartZoomKeyHeld = useAtomValue(smartZoomKeyHeldAtom);
|
|
13151
|
+
return /* @__PURE__ */ jsx53(
|
|
13152
|
+
IconButton,
|
|
13153
|
+
{
|
|
13154
|
+
type: "button",
|
|
13155
|
+
icon: arrowsToEyeIcon,
|
|
13156
|
+
"aria-label": t("labels.smartZoom"),
|
|
13157
|
+
title: `${t("labels.smartZoom")} - ${KEYS27.F.toLocaleUpperCase()}`,
|
|
13158
|
+
onClick: () => updateData(null),
|
|
13159
|
+
size: data?.size || "medium",
|
|
13160
|
+
"data-testid": "button-smart-zoom",
|
|
13161
|
+
keyBindingLabel: KEYS27.F.toLocaleUpperCase(),
|
|
13162
|
+
className: clsx23({
|
|
13163
|
+
"smart-zoom-button--key-held": smartZoomKeyHeld
|
|
13164
|
+
})
|
|
13165
|
+
}
|
|
13166
|
+
);
|
|
13167
|
+
};
|
|
13131
13168
|
var actionSmartZoom = register({
|
|
13132
13169
|
name: "smartZoom",
|
|
13133
13170
|
label: "toolBar.smartZoom",
|
|
13134
13171
|
trackEvent: { category: "toolbar" },
|
|
13135
13172
|
icon: arrowsToEyeIcon,
|
|
13136
13173
|
viewMode: true,
|
|
13137
|
-
perform: (elements, appState,
|
|
13174
|
+
perform: (elements, appState, targetElements, app) => {
|
|
13138
13175
|
const settings = getEffectiveEditorPreferences(
|
|
13139
13176
|
appState,
|
|
13140
13177
|
app.props.editorPreferences
|
|
13141
13178
|
).smartZoom;
|
|
13142
|
-
const selectedElements = getSelectedElements(elements, appState);
|
|
13179
|
+
const selectedElements = targetElements && targetElements.length > 0 ? targetElements : getSelectedElements(elements, appState);
|
|
13143
13180
|
app.viewport.setViewport({
|
|
13144
13181
|
target: selectedElements.length ? selectedElements : elements,
|
|
13145
13182
|
fit: settings.fitToViewport ? "contain" : "none",
|
|
@@ -13151,20 +13188,7 @@ var actionSmartZoom = register({
|
|
|
13151
13188
|
captureUpdate: CaptureUpdateAction22.NEVER
|
|
13152
13189
|
};
|
|
13153
13190
|
},
|
|
13154
|
-
|
|
13155
|
-
PanelComponent: ({ data, updateData }) => /* @__PURE__ */ jsx53(
|
|
13156
|
-
IconButton,
|
|
13157
|
-
{
|
|
13158
|
-
type: "button",
|
|
13159
|
-
icon: arrowsToEyeIcon,
|
|
13160
|
-
"aria-label": t("labels.smartZoom"),
|
|
13161
|
-
title: `${t("labels.smartZoom")} - ${KEYS27.F.toLocaleUpperCase()}`,
|
|
13162
|
-
onClick: () => updateData(null),
|
|
13163
|
-
size: data?.size || "medium",
|
|
13164
|
-
"data-testid": "button-smart-zoom",
|
|
13165
|
-
keyBindingLabel: KEYS27.F.toLocaleUpperCase()
|
|
13166
|
-
}
|
|
13167
|
-
)
|
|
13191
|
+
PanelComponent: SmartZoomButton
|
|
13168
13192
|
});
|
|
13169
13193
|
|
|
13170
13194
|
// actions/actionToggleObjectsSnapMode.tsx
|
|
@@ -13545,7 +13569,7 @@ import { CaptureUpdateAction as CaptureUpdateAction28 } from "@excalidraw/elemen
|
|
|
13545
13569
|
|
|
13546
13570
|
// components/hyperlink/Hyperlink.tsx
|
|
13547
13571
|
import { pointFrom as pointFrom3 } from "@excalidraw/math";
|
|
13548
|
-
import
|
|
13572
|
+
import clsx24 from "clsx";
|
|
13549
13573
|
import {
|
|
13550
13574
|
useCallback as useCallback6,
|
|
13551
13575
|
useEffect as useEffect20,
|
|
@@ -13719,7 +13743,7 @@ var Hyperlink = ({
|
|
|
13719
13743
|
isEditing ? /* @__PURE__ */ jsx54(
|
|
13720
13744
|
"input",
|
|
13721
13745
|
{
|
|
13722
|
-
className:
|
|
13746
|
+
className: clsx24("excalidraw-hyperlinkContainer-input"),
|
|
13723
13747
|
placeholder: t("labels.link.hint"),
|
|
13724
13748
|
ref: inputRef,
|
|
13725
13749
|
value: inputVal,
|
|
@@ -16407,7 +16431,7 @@ var actionToggleSearchMenu = register({
|
|
|
16407
16431
|
});
|
|
16408
16432
|
|
|
16409
16433
|
// actions/actionCropEditor.tsx
|
|
16410
|
-
import { isImageElement as
|
|
16434
|
+
import { isImageElement as isImageElement3 } from "@excalidraw/element";
|
|
16411
16435
|
import { CaptureUpdateAction as CaptureUpdateAction32 } from "@excalidraw/element";
|
|
16412
16436
|
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
16413
16437
|
var actionToggleCropEditor = register({
|
|
@@ -16433,7 +16457,7 @@ var actionToggleCropEditor = register({
|
|
|
16433
16457
|
},
|
|
16434
16458
|
predicate: (elements, appState, _, app) => {
|
|
16435
16459
|
const selectedElements = app.scene.getSelectedElements(appState);
|
|
16436
|
-
if (!appState.croppingElementId && selectedElements.length === 1 &&
|
|
16460
|
+
if (!appState.croppingElementId && selectedElements.length === 1 && isImageElement3(selectedElements[0])) {
|
|
16437
16461
|
return true;
|
|
16438
16462
|
}
|
|
16439
16463
|
return false;
|
|
@@ -16956,7 +16980,7 @@ var actionTextAutoResize = register({
|
|
|
16956
16980
|
|
|
16957
16981
|
// actions/actionToggleViewMode.tsx
|
|
16958
16982
|
import { CODES as CODES10, KEYS as KEYS37 } from "@excalidraw/common";
|
|
16959
|
-
import
|
|
16983
|
+
import clsx25 from "clsx";
|
|
16960
16984
|
import { CaptureUpdateAction as CaptureUpdateAction37 } from "@excalidraw/element";
|
|
16961
16985
|
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
16962
16986
|
var actionToggleViewMode = register({
|
|
@@ -16999,7 +17023,7 @@ var actionToggleViewMode = register({
|
|
|
16999
17023
|
onClick: () => updateData(null),
|
|
17000
17024
|
size: data?.size || "medium",
|
|
17001
17025
|
"data-testid": "button-view-mode",
|
|
17002
|
-
className:
|
|
17026
|
+
className: clsx25({
|
|
17003
17027
|
enabled: appState.viewModeEnabled
|
|
17004
17028
|
})
|
|
17005
17029
|
}
|
|
@@ -19592,7 +19616,7 @@ import {
|
|
|
19592
19616
|
elementOverlapsWithFrame as elementOverlapsWithFrame2,
|
|
19593
19617
|
getBoundTextElement as getBoundTextElement6,
|
|
19594
19618
|
getContainingFrame as getContainingFrame3,
|
|
19595
|
-
getElementBounds as
|
|
19619
|
+
getElementBounds as getElementBounds3,
|
|
19596
19620
|
intersectElementWithLineSegment as intersectElementWithLineSegment2,
|
|
19597
19621
|
isBoundToContainer as isBoundToContainer8,
|
|
19598
19622
|
pointInsideBoundsInclusive
|
|
@@ -19636,7 +19660,7 @@ var getLassoSelectedElementIds = (input) => {
|
|
|
19636
19660
|
lassoBounds[3] + PRECISION3
|
|
19637
19661
|
];
|
|
19638
19662
|
for (const element of selectableElements) {
|
|
19639
|
-
const bounds =
|
|
19663
|
+
const bounds = getElementBounds3(element, elementsMap);
|
|
19640
19664
|
const clipBounds = getFrameClipBounds(element, bounds, elementsMap);
|
|
19641
19665
|
const elementBounds = clipToBounds(bounds, clipBounds);
|
|
19642
19666
|
if (doBoundsIntersect2(lassoBounds, elementBounds) && !intersectedElements.has(element.id) && !enclosedElements.has(element.id)) {
|
|
@@ -19676,7 +19700,7 @@ var getFrameClipBounds = (element, elementBounds, elementsMap) => {
|
|
|
19676
19700
|
if (!frame) {
|
|
19677
19701
|
return null;
|
|
19678
19702
|
}
|
|
19679
|
-
const frameBounds =
|
|
19703
|
+
const frameBounds = getElementBounds3(frame, elementsMap);
|
|
19680
19704
|
if (boundsContainBounds2(frameBounds, elementBounds)) {
|
|
19681
19705
|
return null;
|
|
19682
19706
|
}
|
|
@@ -19946,7 +19970,7 @@ import {
|
|
|
19946
19970
|
computeBoundTextPosition as computeBoundTextPosition5,
|
|
19947
19971
|
doBoundsIntersect as doBoundsIntersect3,
|
|
19948
19972
|
getBoundTextElement as getBoundTextElement7,
|
|
19949
|
-
getElementBounds as
|
|
19973
|
+
getElementBounds as getElementBounds4,
|
|
19950
19974
|
getElementLineSegments as getElementLineSegments3,
|
|
19951
19975
|
getFreedrawOutlineAsSegments,
|
|
19952
19976
|
getFreedrawOutlinePoints as getFreedrawOutlinePoints2,
|
|
@@ -20092,7 +20116,7 @@ var eraserTest = (pathSegment, element, elementsMap, zoom) => {
|
|
|
20092
20116
|
Math.max(pathSegment[0][0], pathSegment[1][0]) + threshold,
|
|
20093
20117
|
Math.max(pathSegment[0][1], pathSegment[1][1]) + threshold
|
|
20094
20118
|
];
|
|
20095
|
-
const origElementBounds =
|
|
20119
|
+
const origElementBounds = getElementBounds4(element, elementsMap);
|
|
20096
20120
|
const elementBounds = [
|
|
20097
20121
|
origElementBounds[0] - threshold,
|
|
20098
20122
|
origElementBounds[1] - threshold,
|
|
@@ -21231,7 +21255,7 @@ import {
|
|
|
21231
21255
|
isBindableElement as isBindableElement2,
|
|
21232
21256
|
isElbowArrow as isElbowArrow6,
|
|
21233
21257
|
isFrameLikeElement as isFrameLikeElement11,
|
|
21234
|
-
isImageElement as
|
|
21258
|
+
isImageElement as isImageElement4,
|
|
21235
21259
|
isLinearElement as isLinearElement7,
|
|
21236
21260
|
isLineElement as isLineElement6,
|
|
21237
21261
|
maxBindingDistance_simple as maxBindingDistance_simple2,
|
|
@@ -22422,7 +22446,7 @@ var renderResetAutoResizeHandle = (text, context, appState, selectionColor, form
|
|
|
22422
22446
|
};
|
|
22423
22447
|
var renderImageStatusOverlays = (context, visibleElements, elementsMap, app, appState, selectionColor) => {
|
|
22424
22448
|
for (const element of visibleElements) {
|
|
22425
|
-
if (!
|
|
22449
|
+
if (!isImageElement4(element) || !element.fileId) {
|
|
22426
22450
|
continue;
|
|
22427
22451
|
}
|
|
22428
22452
|
const imageStatus = app.imageStatus.get(element.fileId);
|
|
@@ -22491,7 +22515,7 @@ var renderImageStatusOverlays = (context, visibleElements, elementsMap, app, app
|
|
|
22491
22515
|
}
|
|
22492
22516
|
};
|
|
22493
22517
|
var getImageStatusOverlayPosition = (element, elementsMap, appState, placement) => {
|
|
22494
|
-
if (!
|
|
22518
|
+
if (!isImageElement4(element)) {
|
|
22495
22519
|
return null;
|
|
22496
22520
|
}
|
|
22497
22521
|
const [x1, y1, x2, y2] = getElementAbsoluteCoords6(element, elementsMap);
|
|
@@ -22910,7 +22934,7 @@ var _renderInteractiveScene = ({
|
|
|
22910
22934
|
cx,
|
|
22911
22935
|
cy,
|
|
22912
22936
|
activeEmbeddable: appState.activeEmbeddable?.element === element && appState.activeEmbeddable.state === "active",
|
|
22913
|
-
padding: element.id === appState.croppingElementId ||
|
|
22937
|
+
padding: element.id === appState.croppingElementId || isImageElement4(element) ? 0 : void 0
|
|
22914
22938
|
});
|
|
22915
22939
|
}
|
|
22916
22940
|
}
|
|
@@ -22965,7 +22989,7 @@ var _renderInteractiveScene = ({
|
|
|
22965
22989
|
}
|
|
22966
22990
|
if (appState.croppingElementId && !appState.isCropping) {
|
|
22967
22991
|
const croppingElement = elementsMap.get(appState.croppingElementId);
|
|
22968
|
-
if (croppingElement &&
|
|
22992
|
+
if (croppingElement && isImageElement4(croppingElement)) {
|
|
22969
22993
|
renderCropHandles(
|
|
22970
22994
|
context,
|
|
22971
22995
|
renderConfig,
|
|
@@ -25334,7 +25358,7 @@ var BraveMeasureTextError = () => {
|
|
|
25334
25358
|
var BraveMeasureTextError_default = BraveMeasureTextError;
|
|
25335
25359
|
|
|
25336
25360
|
// components/ContextMenu.tsx
|
|
25337
|
-
import
|
|
25361
|
+
import clsx27 from "clsx";
|
|
25338
25362
|
import React20 from "react";
|
|
25339
25363
|
|
|
25340
25364
|
// actions/shortcuts.ts
|
|
@@ -25401,7 +25425,7 @@ import { useLayoutEffect as useLayoutEffect4, useRef as useRef16, useEffect as u
|
|
|
25401
25425
|
import { unstable_batchedUpdates as unstable_batchedUpdates2 } from "react-dom";
|
|
25402
25426
|
import { KEYS as KEYS41, queryFocusableElements } from "@excalidraw/common";
|
|
25403
25427
|
import { clamp as clamp10 } from "@excalidraw/math";
|
|
25404
|
-
import
|
|
25428
|
+
import clsx26 from "clsx";
|
|
25405
25429
|
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
25406
25430
|
var POPOVER_CONTAINER_GAP = 10;
|
|
25407
25431
|
var Popover7 = ({
|
|
@@ -25500,7 +25524,7 @@ var Popover7 = ({
|
|
|
25500
25524
|
return () => document.removeEventListener("pointerdown", handler, false);
|
|
25501
25525
|
}
|
|
25502
25526
|
}, [onCloseRequest]);
|
|
25503
|
-
return /* @__PURE__ */ jsx63("div", { className:
|
|
25527
|
+
return /* @__PURE__ */ jsx63("div", { className: clsx26("popover", className), ref: popoverRef, tabIndex: -1, children });
|
|
25504
25528
|
};
|
|
25505
25529
|
|
|
25506
25530
|
// components/ContextMenu.tsx
|
|
@@ -25603,7 +25627,7 @@ var ContextMenu2 = React20.memo(
|
|
|
25603
25627
|
"button",
|
|
25604
25628
|
{
|
|
25605
25629
|
type: "button",
|
|
25606
|
-
className:
|
|
25630
|
+
className: clsx27("context-menu-item", {
|
|
25607
25631
|
dangerous: actionName === "deleteSelectedElements",
|
|
25608
25632
|
checkmark: item.checked?.(appState)
|
|
25609
25633
|
}),
|
|
@@ -25626,7 +25650,7 @@ var ContextMenu2 = React20.memo(
|
|
|
25626
25650
|
|
|
25627
25651
|
// components/ViewportStatusFrame/ViewportStatusFrame.tsx
|
|
25628
25652
|
import { useId } from "react";
|
|
25629
|
-
import
|
|
25653
|
+
import clsx28 from "clsx";
|
|
25630
25654
|
import { Fragment as Fragment8, jsx as jsx65, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
25631
25655
|
var ViewportStatusBorder = ({
|
|
25632
25656
|
border,
|
|
@@ -25650,7 +25674,7 @@ var ViewportStatusBadge = ({
|
|
|
25650
25674
|
return /* @__PURE__ */ jsxs33(
|
|
25651
25675
|
"div",
|
|
25652
25676
|
{
|
|
25653
|
-
className:
|
|
25677
|
+
className: clsx28("viewport-status-frame__badge", {
|
|
25654
25678
|
"viewport-status-frame__badge--clickable": label.onClick
|
|
25655
25679
|
}),
|
|
25656
25680
|
role: "status",
|
|
@@ -25692,7 +25716,7 @@ var ViewportStatusBadge = ({
|
|
|
25692
25716
|
};
|
|
25693
25717
|
|
|
25694
25718
|
// components/LayerUI.tsx
|
|
25695
|
-
import
|
|
25719
|
+
import clsx60 from "clsx";
|
|
25696
25720
|
import React38 from "react";
|
|
25697
25721
|
import {
|
|
25698
25722
|
CLASSES as CLASSES9,
|
|
@@ -25728,7 +25752,7 @@ var useInitializeTunnels = () => {
|
|
|
25728
25752
|
};
|
|
25729
25753
|
|
|
25730
25754
|
// components/Actions.tsx
|
|
25731
|
-
import
|
|
25755
|
+
import clsx30 from "clsx";
|
|
25732
25756
|
import { useRef as useRef17 } from "react";
|
|
25733
25757
|
import { Popover as Popover8 } from "radix-ui";
|
|
25734
25758
|
import { CLASSES as CLASSES4 } from "@excalidraw/common";
|
|
@@ -25736,14 +25760,14 @@ import { isArrowElement as isArrowElement11 } from "@excalidraw/element";
|
|
|
25736
25760
|
|
|
25737
25761
|
// components/Stack.tsx
|
|
25738
25762
|
import { forwardRef as forwardRef2 } from "react";
|
|
25739
|
-
import
|
|
25763
|
+
import clsx29 from "clsx";
|
|
25740
25764
|
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
25741
25765
|
var RowStack = forwardRef2(
|
|
25742
25766
|
({ children, gap, align, justifyContent, className, style }, ref) => {
|
|
25743
25767
|
return /* @__PURE__ */ jsx66(
|
|
25744
25768
|
"div",
|
|
25745
25769
|
{
|
|
25746
|
-
className:
|
|
25770
|
+
className: clsx29("Stack Stack_horizontal", className),
|
|
25747
25771
|
style: {
|
|
25748
25772
|
"--gap": gap,
|
|
25749
25773
|
alignItems: align,
|
|
@@ -25761,7 +25785,7 @@ var ColStack = forwardRef2(
|
|
|
25761
25785
|
return /* @__PURE__ */ jsx66(
|
|
25762
25786
|
"div",
|
|
25763
25787
|
{
|
|
25764
|
-
className:
|
|
25788
|
+
className: clsx29("Stack Stack_vertical", className),
|
|
25765
25789
|
style: {
|
|
25766
25790
|
"--gap": gap,
|
|
25767
25791
|
justifyItems: align,
|
|
@@ -25786,7 +25810,7 @@ import {
|
|
|
25786
25810
|
suppportsHorizontalAlign,
|
|
25787
25811
|
hasBoundTextElement as hasBoundTextElement6,
|
|
25788
25812
|
isElbowArrow as isElbowArrow8,
|
|
25789
|
-
isImageElement as
|
|
25813
|
+
isImageElement as isImageElement5,
|
|
25790
25814
|
isLinearElement as isLinearElement9,
|
|
25791
25815
|
isTextElement as isTextElement11,
|
|
25792
25816
|
hasStrokeColor as hasStrokeColor2,
|
|
@@ -25850,21 +25874,21 @@ var getShapeActionPredicates = (appState, targetElements, elementsMap, app) => {
|
|
|
25850
25874
|
),
|
|
25851
25875
|
align: !isSingleElementBoundContainer && alignActionsPredicate(appState, app),
|
|
25852
25876
|
distribute: targetElements.length > 2,
|
|
25853
|
-
imageLayout: targetElements.length > 1 && targetElements.every(
|
|
25877
|
+
imageLayout: targetElements.length > 1 && targetElements.every(isImageElement5) && alignActionsPredicate(appState, app),
|
|
25854
25878
|
// per-element actions
|
|
25855
25879
|
// NOTE: the full panel treats a bound container as linkable; the compact /
|
|
25856
25880
|
// mobile layouts only link a truly single selection. Both are preserved via
|
|
25857
25881
|
// the two flags below.
|
|
25858
25882
|
link: singleSelected || isSingleElementBoundContainer,
|
|
25859
25883
|
linkSingleOnly: singleSelected,
|
|
25860
|
-
cropEditor: !appState.croppingElementId && singleSelected &&
|
|
25884
|
+
cropEditor: !appState.croppingElementId && singleSelected && isImageElement5(targetElements[0]),
|
|
25861
25885
|
lineEditor: !appState.selectedLinearElement?.isEditing && singleSelected && isLinearElement9(targetElements[0]) && !isElbowArrow8(targetElements[0])
|
|
25862
25886
|
};
|
|
25863
25887
|
};
|
|
25864
25888
|
|
|
25865
25889
|
// components/Actions.tsx
|
|
25866
25890
|
import { Fragment as Fragment9, jsx as jsx67, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
25867
|
-
var PROPERTIES_CLASSES =
|
|
25891
|
+
var PROPERTIES_CLASSES = clsx30([
|
|
25868
25892
|
CLASSES4.SHAPE_ACTIONS_THEME_SCOPE,
|
|
25869
25893
|
"properties-content"
|
|
25870
25894
|
]);
|
|
@@ -26017,7 +26041,7 @@ var CombinedShapeProperties = ({
|
|
|
26017
26041
|
"button",
|
|
26018
26042
|
{
|
|
26019
26043
|
type: "button",
|
|
26020
|
-
className:
|
|
26044
|
+
className: clsx30("compact-action-button properties-trigger", {
|
|
26021
26045
|
active: isOpen
|
|
26022
26046
|
}),
|
|
26023
26047
|
title: t("labels.stroke"),
|
|
@@ -26087,7 +26111,7 @@ var CombinedArrowProperties = ({
|
|
|
26087
26111
|
"button",
|
|
26088
26112
|
{
|
|
26089
26113
|
type: "button",
|
|
26090
|
-
className:
|
|
26114
|
+
className: clsx30("compact-action-button properties-trigger", {
|
|
26091
26115
|
active: isOpen
|
|
26092
26116
|
}),
|
|
26093
26117
|
title: t("labels.arrowtypes"),
|
|
@@ -26167,7 +26191,7 @@ var CombinedTextProperties = ({
|
|
|
26167
26191
|
"button",
|
|
26168
26192
|
{
|
|
26169
26193
|
type: "button",
|
|
26170
|
-
className:
|
|
26194
|
+
className: clsx30("compact-action-button properties-trigger", {
|
|
26171
26195
|
active: isOpen
|
|
26172
26196
|
}),
|
|
26173
26197
|
title: t("labels.textAlign"),
|
|
@@ -26238,7 +26262,7 @@ var CombinedExtraActions = ({
|
|
|
26238
26262
|
"button",
|
|
26239
26263
|
{
|
|
26240
26264
|
type: "button",
|
|
26241
|
-
className:
|
|
26265
|
+
className: clsx30("compact-action-button properties-trigger", {
|
|
26242
26266
|
active: isOpen
|
|
26243
26267
|
}),
|
|
26244
26268
|
title: t("labels.actions"),
|
|
@@ -26318,7 +26342,7 @@ var CompactShapeActions = ({
|
|
|
26318
26342
|
);
|
|
26319
26343
|
const { container } = useExcalidrawContainer();
|
|
26320
26344
|
return /* @__PURE__ */ jsxs34("div", { className: "compact-shape-actions", children: [
|
|
26321
|
-
predicates.strokeColor && /* @__PURE__ */ jsx67("div", { className:
|
|
26345
|
+
predicates.strokeColor && /* @__PURE__ */ jsx67("div", { className: clsx30("compact-action-item"), children: renderAction("changeStrokeColor") }),
|
|
26322
26346
|
predicates.backgroundColor && /* @__PURE__ */ jsx67("div", { className: "compact-action-item", children: renderAction(
|
|
26323
26347
|
appState.activeTool.type === "bucketfill" ? "changeBucketFillBackgroundColor" : "changeBackgroundColor"
|
|
26324
26348
|
) }),
|
|
@@ -26425,7 +26449,7 @@ var MobileShapeActions = ({
|
|
|
26425
26449
|
flex: 1
|
|
26426
26450
|
},
|
|
26427
26451
|
children: [
|
|
26428
|
-
predicates.strokeColor && /* @__PURE__ */ jsx67("div", { className:
|
|
26452
|
+
predicates.strokeColor && /* @__PURE__ */ jsx67("div", { className: clsx30("compact-action-item"), children: renderAction("changeStrokeColor") }),
|
|
26429
26453
|
predicates.backgroundColor && /* @__PURE__ */ jsx67("div", { className: "compact-action-item", children: renderAction(
|
|
26430
26454
|
appState.activeTool.type === "bucketfill" ? "changeBucketFillBackgroundColor" : "changeBackgroundColor"
|
|
26431
26455
|
) }),
|
|
@@ -26529,7 +26553,7 @@ var ExitZenModeButton = ({
|
|
|
26529
26553
|
"button",
|
|
26530
26554
|
{
|
|
26531
26555
|
type: "button",
|
|
26532
|
-
className:
|
|
26556
|
+
className: clsx30("disable-zen-mode", {
|
|
26533
26557
|
"disable-zen-mode--visible": showExitZenModeBtn
|
|
26534
26558
|
}),
|
|
26535
26559
|
children: t("buttons.exitZenMode")
|
|
@@ -26537,7 +26561,7 @@ var ExitZenModeButton = ({
|
|
|
26537
26561
|
);
|
|
26538
26562
|
|
|
26539
26563
|
// components/LoadingMessage.tsx
|
|
26540
|
-
import
|
|
26564
|
+
import clsx31 from "clsx";
|
|
26541
26565
|
import { useState as useState17, useEffect as useEffect24 } from "react";
|
|
26542
26566
|
import { THEME as THEME23 } from "@excalidraw/common";
|
|
26543
26567
|
import { jsx as jsx68, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
@@ -26561,7 +26585,7 @@ var LoadingMessage = ({
|
|
|
26561
26585
|
return /* @__PURE__ */ jsxs35(
|
|
26562
26586
|
"div",
|
|
26563
26587
|
{
|
|
26564
|
-
className:
|
|
26588
|
+
className: clsx31("LoadingMessage", {
|
|
26565
26589
|
"LoadingMessage--dark": theme === THEME23.DARK
|
|
26566
26590
|
}),
|
|
26567
26591
|
children: [
|
|
@@ -26574,7 +26598,7 @@ var LoadingMessage = ({
|
|
|
26574
26598
|
|
|
26575
26599
|
// components/MobileToolbar.tsx
|
|
26576
26600
|
import { useState as useState19, useEffect as useEffect26 } from "react";
|
|
26577
|
-
import
|
|
26601
|
+
import clsx35 from "clsx";
|
|
26578
26602
|
import { KEYS as KEYS43, capitalizeString as capitalizeString3 } from "@excalidraw/common";
|
|
26579
26603
|
|
|
26580
26604
|
// components/dropdownMenu/DropdownMenu.tsx
|
|
@@ -26583,7 +26607,7 @@ import { DropdownMenu as DropdownMenuPrimitive8 } from "radix-ui";
|
|
|
26583
26607
|
import { CLASSES as CLASSES6 } from "@excalidraw/common";
|
|
26584
26608
|
|
|
26585
26609
|
// components/dropdownMenu/DropdownMenuContent.tsx
|
|
26586
|
-
import
|
|
26610
|
+
import clsx32 from "clsx";
|
|
26587
26611
|
import { useCallback as useCallback7, useEffect as useEffect25, useRef as useRef18 } from "react";
|
|
26588
26612
|
import { CLASSES as CLASSES5, EVENT as EVENT6, KEYS as KEYS42 } from "@excalidraw/common";
|
|
26589
26613
|
import { DropdownMenu as DropdownMenuPrimitive2 } from "radix-ui";
|
|
@@ -26632,7 +26656,7 @@ var MenuContent = ({
|
|
|
26632
26656
|
document.removeEventListener(EVENT6.KEYDOWN, onKeyDown, option);
|
|
26633
26657
|
};
|
|
26634
26658
|
}, [callbacksRef, open]);
|
|
26635
|
-
const classNames =
|
|
26659
|
+
const classNames = clsx32(`dropdown-menu ${className}`, {
|
|
26636
26660
|
"dropdown-menu--mobile": editorInterface.formFactor === "phone"
|
|
26637
26661
|
}).trim();
|
|
26638
26662
|
return /* @__PURE__ */ jsx69(DropdownMenuContentPropsContext.Provider, { value: { onSelect }, children: /* @__PURE__ */ jsx69(
|
|
@@ -26733,7 +26757,7 @@ MenuSeparator.displayName = "DropdownMenuSeparator";
|
|
|
26733
26757
|
import { DropdownMenu as DropdownMenuPrimitive6 } from "radix-ui";
|
|
26734
26758
|
|
|
26735
26759
|
// components/dropdownMenu/DropdownMenuSubContent.tsx
|
|
26736
|
-
import
|
|
26760
|
+
import clsx33 from "clsx";
|
|
26737
26761
|
import { DropdownMenu as DropdownMenuPrimitive4 } from "radix-ui";
|
|
26738
26762
|
import { useCallback as useCallback8, useState as useState18 } from "react";
|
|
26739
26763
|
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
@@ -26744,7 +26768,7 @@ var DropdownMenuSubContent = ({
|
|
|
26744
26768
|
className
|
|
26745
26769
|
}) => {
|
|
26746
26770
|
const editorInterface = useEditorInterface();
|
|
26747
|
-
const classNames =
|
|
26771
|
+
const classNames = clsx33(`dropdown-menu dropdown-submenu ${className}`, {
|
|
26748
26772
|
"dropdown-menu--mobile": editorInterface.formFactor === "phone"
|
|
26749
26773
|
}).trim();
|
|
26750
26774
|
const callbacksRef = useCallback8((node) => {
|
|
@@ -26850,7 +26874,7 @@ DropdownMenuSub.displayName = "DropdownMenuSub";
|
|
|
26850
26874
|
var DropdownMenuSub_default = DropdownMenuSub;
|
|
26851
26875
|
|
|
26852
26876
|
// components/dropdownMenu/DropdownMenuTrigger.tsx
|
|
26853
|
-
import
|
|
26877
|
+
import clsx34 from "clsx";
|
|
26854
26878
|
import { DropdownMenu as DropdownMenuPrimitive7 } from "radix-ui";
|
|
26855
26879
|
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
26856
26880
|
var MenuTrigger = ({
|
|
@@ -26861,7 +26885,7 @@ var MenuTrigger = ({
|
|
|
26861
26885
|
...rest
|
|
26862
26886
|
}) => {
|
|
26863
26887
|
const editorInterface = useEditorInterface();
|
|
26864
|
-
const classNames =
|
|
26888
|
+
const classNames = clsx34(
|
|
26865
26889
|
`dropdown-menu-button ${className}`,
|
|
26866
26890
|
"zen-mode-transition",
|
|
26867
26891
|
{
|
|
@@ -27096,7 +27120,7 @@ var MobileToolbar = ({
|
|
|
27096
27120
|
/* @__PURE__ */ jsx78(
|
|
27097
27121
|
DropdownMenu_default.Trigger,
|
|
27098
27122
|
{
|
|
27099
|
-
className:
|
|
27123
|
+
className: clsx35(
|
|
27100
27124
|
"App-toolbar__extra-tools-trigger App-toolbar__extra-tools-trigger--mobile",
|
|
27101
27125
|
{
|
|
27102
27126
|
"App-toolbar__extra-tools-trigger--selected": extraToolSelected || isOtherShapesMenuOpen
|
|
@@ -27260,7 +27284,7 @@ var MobileToolbar = ({
|
|
|
27260
27284
|
};
|
|
27261
27285
|
|
|
27262
27286
|
// components/FixedSideContainer.tsx
|
|
27263
|
-
import
|
|
27287
|
+
import clsx36 from "clsx";
|
|
27264
27288
|
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
27265
27289
|
var FixedSideContainer = ({
|
|
27266
27290
|
children,
|
|
@@ -27269,7 +27293,7 @@ var FixedSideContainer = ({
|
|
|
27269
27293
|
}) => /* @__PURE__ */ jsx79(
|
|
27270
27294
|
"div",
|
|
27271
27295
|
{
|
|
27272
|
-
className:
|
|
27296
|
+
className: clsx36(
|
|
27273
27297
|
"FixedSideContainer",
|
|
27274
27298
|
`FixedSideContainer_side_${side}`,
|
|
27275
27299
|
className
|
|
@@ -27279,7 +27303,7 @@ var FixedSideContainer = ({
|
|
|
27279
27303
|
);
|
|
27280
27304
|
|
|
27281
27305
|
// components/PenModeButton.tsx
|
|
27282
|
-
import
|
|
27306
|
+
import clsx37 from "clsx";
|
|
27283
27307
|
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
27284
27308
|
var PenModeButton = (props) => {
|
|
27285
27309
|
if (!props.penDetected) {
|
|
@@ -27288,7 +27312,7 @@ var PenModeButton = (props) => {
|
|
|
27288
27312
|
return /* @__PURE__ */ jsx80(
|
|
27289
27313
|
IconButton,
|
|
27290
27314
|
{
|
|
27291
|
-
className:
|
|
27315
|
+
className: clsx37("ToolIcon__penMode", { "is-mobile": props.isMobile }),
|
|
27292
27316
|
type: "toggle",
|
|
27293
27317
|
icon: PenModeIcon,
|
|
27294
27318
|
checked: props.checked,
|
|
@@ -27444,7 +27468,7 @@ import React27, { useLayoutEffect as useLayoutEffect5, useRef as useRef20, useSt
|
|
|
27444
27468
|
import { newTextElement as newTextElement4 } from "@excalidraw/element";
|
|
27445
27469
|
|
|
27446
27470
|
// components/Dialog.tsx
|
|
27447
|
-
import
|
|
27471
|
+
import clsx39 from "clsx";
|
|
27448
27472
|
import { useEffect as useEffect27, useState as useState21 } from "react";
|
|
27449
27473
|
import { KEYS as KEYS45, queryFocusableElements as queryFocusableElements2 } from "@excalidraw/common";
|
|
27450
27474
|
|
|
@@ -27457,7 +27481,7 @@ var useCallbackRefState = () => {
|
|
|
27457
27481
|
};
|
|
27458
27482
|
|
|
27459
27483
|
// components/Modal.tsx
|
|
27460
|
-
import
|
|
27484
|
+
import clsx38 from "clsx";
|
|
27461
27485
|
import { useRef as useRef19 } from "react";
|
|
27462
27486
|
import { createPortal as createPortal2 } from "react-dom";
|
|
27463
27487
|
import { KEYS as KEYS44 } from "@excalidraw/common";
|
|
@@ -27465,7 +27489,7 @@ import { jsx as jsx82, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
|
27465
27489
|
var Modal = (props) => {
|
|
27466
27490
|
const { closeOnClickOutside = true } = props;
|
|
27467
27491
|
const modalRoot = useCreatePortalContainer({
|
|
27468
|
-
className:
|
|
27492
|
+
className: clsx38(
|
|
27469
27493
|
"excalidraw-modal-container",
|
|
27470
27494
|
props.portalContainerClassName
|
|
27471
27495
|
)
|
|
@@ -27488,7 +27512,7 @@ var Modal = (props) => {
|
|
|
27488
27512
|
/* @__PURE__ */ jsxs41(
|
|
27489
27513
|
"div",
|
|
27490
27514
|
{
|
|
27491
|
-
className:
|
|
27515
|
+
className: clsx38("Modal", props.className, {
|
|
27492
27516
|
"animations-disabled": animationsDisabledRef.current
|
|
27493
27517
|
}),
|
|
27494
27518
|
role: "dialog",
|
|
@@ -27578,7 +27602,7 @@ var Dialog = (props) => {
|
|
|
27578
27602
|
return /* @__PURE__ */ jsx83(
|
|
27579
27603
|
Modal,
|
|
27580
27604
|
{
|
|
27581
|
-
className:
|
|
27605
|
+
className: clsx39("Dialog", props.className, {
|
|
27582
27606
|
"Dialog--fullscreen": isFullscreen
|
|
27583
27607
|
}),
|
|
27584
27608
|
labelledBy: "dialog-title",
|
|
@@ -27838,7 +27862,7 @@ var Section = ({ heading, children, ...props }) => {
|
|
|
27838
27862
|
|
|
27839
27863
|
// components/UserList.tsx
|
|
27840
27864
|
import { Popover as Popover9 } from "radix-ui";
|
|
27841
|
-
import
|
|
27865
|
+
import clsx40 from "clsx";
|
|
27842
27866
|
import React28, { useLayoutEffect as useLayoutEffect6 } from "react";
|
|
27843
27867
|
import { supportsResizeObserver, isShallowEqual as isShallowEqual5 } from "@excalidraw/common";
|
|
27844
27868
|
import { Fragment as Fragment13, jsx as jsx86, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
@@ -28018,7 +28042,7 @@ var UserList = React28.memo(
|
|
|
28018
28042
|
)
|
|
28019
28043
|
] }, collaborator.socketId);
|
|
28020
28044
|
});
|
|
28021
|
-
return mobile ? /* @__PURE__ */ jsxs45("div", { className:
|
|
28045
|
+
return mobile ? /* @__PURE__ */ jsxs45("div", { className: clsx40("UserList UserList_mobile", className), children: [
|
|
28022
28046
|
/* @__PURE__ */ jsx86("div", { className: "UserList_mobile__avatars", children: collaboratorsArray.map(
|
|
28023
28047
|
(collaborator) => renderCollaborator({
|
|
28024
28048
|
actionManager,
|
|
@@ -28035,7 +28059,7 @@ var UserList = React28.memo(
|
|
|
28035
28059
|
] }) : /* @__PURE__ */ jsx86("div", { className: "UserList__wrapper", ref: userListWrapper, children: /* @__PURE__ */ jsx86(
|
|
28036
28060
|
"div",
|
|
28037
28061
|
{
|
|
28038
|
-
className:
|
|
28062
|
+
className: clsx40("UserList", className),
|
|
28039
28063
|
style: {
|
|
28040
28064
|
[`--max-avatars`]: firstNCollaborators.length + (currentUser ? PILL_EXTRA_WIDTH / AVATAR_SLOT_WIDTH : 0)
|
|
28041
28065
|
},
|
|
@@ -28065,7 +28089,7 @@ var UserList = React28.memo(
|
|
|
28065
28089
|
);
|
|
28066
28090
|
|
|
28067
28091
|
// components/footer/Footer.tsx
|
|
28068
|
-
import
|
|
28092
|
+
import clsx41 from "clsx";
|
|
28069
28093
|
|
|
28070
28094
|
// components/HelpButton.tsx
|
|
28071
28095
|
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
@@ -28101,7 +28125,7 @@ var Footer = ({
|
|
|
28101
28125
|
(defaultUIEnabled || zoomUIEnabled && app.isNavigationEnabled()) && /* @__PURE__ */ jsx88(
|
|
28102
28126
|
"div",
|
|
28103
28127
|
{
|
|
28104
|
-
className:
|
|
28128
|
+
className: clsx41(
|
|
28105
28129
|
"layer-ui__wrapper__footer-left zen-mode-transition",
|
|
28106
28130
|
{
|
|
28107
28131
|
"layer-ui__wrapper__footer-left--transition-left": appState.zenModeEnabled
|
|
@@ -28112,16 +28136,16 @@ var Footer = ({
|
|
|
28112
28136
|
Tooltip,
|
|
28113
28137
|
{
|
|
28114
28138
|
label: appState.viewModeEnabled ? "Edit mode" : t("labels.viewMode"),
|
|
28115
|
-
children: /* @__PURE__ */ jsx88("div", { className:
|
|
28139
|
+
children: /* @__PURE__ */ jsx88("div", { className: clsx41("view-mode-button"), children: actionManager.renderAction("viewMode") })
|
|
28116
28140
|
}
|
|
28117
28141
|
),
|
|
28118
|
-
/* @__PURE__ */ jsx88(Tooltip, { label: t("buttons.smartZoom"), children: /* @__PURE__ */ jsx88("div", { className:
|
|
28142
|
+
/* @__PURE__ */ jsx88(Tooltip, { label: t("buttons.smartZoom"), children: /* @__PURE__ */ jsx88("div", { className: clsx41("smart-zoom-button"), children: actionManager.renderAction("smartZoom") }) }),
|
|
28119
28143
|
zoomUIEnabled && app.isNavigationEnabled() && /* @__PURE__ */ jsx88(ZoomActions, { renderAction: actionManager.renderAction }),
|
|
28120
28144
|
defaultUIEnabled && !appState.viewModeEnabled && /* @__PURE__ */ jsx88(
|
|
28121
28145
|
UndoRedoActions,
|
|
28122
28146
|
{
|
|
28123
28147
|
renderAction: actionManager.renderAction,
|
|
28124
|
-
className:
|
|
28148
|
+
className: clsx41("zen-mode-transition", {
|
|
28125
28149
|
"layer-ui__wrapper__footer-left--transition-bottom": appState.zenModeEnabled
|
|
28126
28150
|
})
|
|
28127
28151
|
}
|
|
@@ -28133,7 +28157,7 @@ var Footer = ({
|
|
|
28133
28157
|
(defaultUIEnabled || renderWelcomeScreen) && /* @__PURE__ */ jsx88(
|
|
28134
28158
|
"div",
|
|
28135
28159
|
{
|
|
28136
|
-
className:
|
|
28160
|
+
className: clsx41(
|
|
28137
28161
|
"layer-ui__wrapper__footer-right zen-mode-transition",
|
|
28138
28162
|
{
|
|
28139
28163
|
"transition-right": appState.zenModeEnabled
|
|
@@ -28230,7 +28254,7 @@ __export(DefaultItems_exports, {
|
|
|
28230
28254
|
Socials: () => Socials,
|
|
28231
28255
|
ToggleTheme: () => ToggleTheme
|
|
28232
28256
|
});
|
|
28233
|
-
import
|
|
28257
|
+
import clsx43 from "clsx";
|
|
28234
28258
|
import { THEME as THEME24 } from "@excalidraw/common";
|
|
28235
28259
|
|
|
28236
28260
|
// components/OverwriteConfirm/OverwriteConfirmState.ts
|
|
@@ -28258,7 +28282,7 @@ async function openConfirmModal({
|
|
|
28258
28282
|
}
|
|
28259
28283
|
|
|
28260
28284
|
// components/RadioGroup.tsx
|
|
28261
|
-
import
|
|
28285
|
+
import clsx42 from "clsx";
|
|
28262
28286
|
import { jsx as jsx90, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
28263
28287
|
var RadioGroup = function({
|
|
28264
28288
|
onChange,
|
|
@@ -28269,7 +28293,7 @@ var RadioGroup = function({
|
|
|
28269
28293
|
return /* @__PURE__ */ jsx90("div", { className: "RadioGroup", children: choices.map((choice) => /* @__PURE__ */ jsxs47(
|
|
28270
28294
|
"div",
|
|
28271
28295
|
{
|
|
28272
|
-
className:
|
|
28296
|
+
className: clsx42("RadioGroup__choice", {
|
|
28273
28297
|
active: choice.value === value
|
|
28274
28298
|
}),
|
|
28275
28299
|
title: choice.ariaLabel,
|
|
@@ -28578,7 +28602,7 @@ var LiveCollaborationTrigger = ({
|
|
|
28578
28602
|
{
|
|
28579
28603
|
"data-testid": "collab-button",
|
|
28580
28604
|
icon: usersIcon,
|
|
28581
|
-
className:
|
|
28605
|
+
className: clsx43({
|
|
28582
28606
|
"active-collab": isCollaborating
|
|
28583
28607
|
}),
|
|
28584
28608
|
onSelect,
|
|
@@ -28843,7 +28867,7 @@ var MainMenu = Object.assign(
|
|
|
28843
28867
|
var MainMenu_default = MainMenu;
|
|
28844
28868
|
|
|
28845
28869
|
// components/FilledButton.tsx
|
|
28846
|
-
import
|
|
28870
|
+
import clsx44 from "clsx";
|
|
28847
28871
|
import { forwardRef as forwardRef3, useState as useState23 } from "react";
|
|
28848
28872
|
import { isPromiseLike as isPromiseLike4 } from "@excalidraw/common";
|
|
28849
28873
|
import { jsx as jsx94, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
@@ -28887,7 +28911,7 @@ var FilledButton = forwardRef3(
|
|
|
28887
28911
|
return /* @__PURE__ */ jsx94(
|
|
28888
28912
|
"button",
|
|
28889
28913
|
{
|
|
28890
|
-
className:
|
|
28914
|
+
className: clsx44(
|
|
28891
28915
|
"ExcButton",
|
|
28892
28916
|
`ExcButton--color-${color}`,
|
|
28893
28917
|
`ExcButton--variant-${variant}`,
|
|
@@ -29032,13 +29056,13 @@ var OverwriteConfirmDialog = Object.assign(
|
|
|
29032
29056
|
|
|
29033
29057
|
// components/Stats/index.tsx
|
|
29034
29058
|
import { round as round4 } from "@excalidraw/math";
|
|
29035
|
-
import
|
|
29059
|
+
import clsx46 from "clsx";
|
|
29036
29060
|
import throttle2 from "lodash.throttle";
|
|
29037
29061
|
import { useEffect as useEffect29, useMemo as useMemo9, useState as useState25, memo as memo2 } from "react";
|
|
29038
29062
|
import { STATS_PANELS } from "@excalidraw/common";
|
|
29039
29063
|
import { getCommonBounds as getCommonBounds10 } from "@excalidraw/element";
|
|
29040
29064
|
import { getUncroppedWidthAndHeight as getUncroppedWidthAndHeight3 } from "@excalidraw/element";
|
|
29041
|
-
import { isImageElement as
|
|
29065
|
+
import { isImageElement as isImageElement8 } from "@excalidraw/element";
|
|
29042
29066
|
import { frameAndChildrenSelectedTogether as frameAndChildrenSelectedTogether2 } from "@excalidraw/element";
|
|
29043
29067
|
import { elementsAreInSameGroup as elementsAreInSameGroup3 } from "@excalidraw/element";
|
|
29044
29068
|
|
|
@@ -29049,7 +29073,7 @@ import { isArrowElement as isArrowElement12, isElbowArrow as isElbowArrow9 } fro
|
|
|
29049
29073
|
import { updateBindings as updateBindings3 } from "@excalidraw/element";
|
|
29050
29074
|
|
|
29051
29075
|
// components/Stats/DragInput.tsx
|
|
29052
|
-
import
|
|
29076
|
+
import clsx45 from "clsx";
|
|
29053
29077
|
import { useEffect as useEffect28, useRef as useRef22, useState as useState24 } from "react";
|
|
29054
29078
|
import { EVENT as EVENT7, KEYS as KEYS46, cloneJSON as cloneJSON3 } from "@excalidraw/common";
|
|
29055
29079
|
import { deepCopyElement as deepCopyElement4 } from "@excalidraw/element";
|
|
@@ -29308,7 +29332,7 @@ var StatsDragInput = ({
|
|
|
29308
29332
|
return /* @__PURE__ */ jsxs54(
|
|
29309
29333
|
"div",
|
|
29310
29334
|
{
|
|
29311
|
-
className:
|
|
29335
|
+
className: clsx45("drag-input-container", !editable && "disabled"),
|
|
29312
29336
|
"data-testid": label,
|
|
29313
29337
|
children: [
|
|
29314
29338
|
/* @__PURE__ */ jsx97(
|
|
@@ -29574,7 +29598,7 @@ import {
|
|
|
29574
29598
|
getUncroppedWidthAndHeight
|
|
29575
29599
|
} from "@excalidraw/element";
|
|
29576
29600
|
import { resizeSingleElement } from "@excalidraw/element";
|
|
29577
|
-
import { isImageElement as
|
|
29601
|
+
import { isImageElement as isImageElement6 } from "@excalidraw/element";
|
|
29578
29602
|
import { isFrameLikeElement as isFrameLikeElement14 } from "@excalidraw/element";
|
|
29579
29603
|
import { getElementsInResizingFrame as getElementsInResizingFrame2 } from "@excalidraw/element";
|
|
29580
29604
|
import { replaceAllElementsInFrame as replaceAllElementsInFrame2 } from "@excalidraw/element";
|
|
@@ -29605,7 +29629,7 @@ var handleDimensionChange = ({
|
|
|
29605
29629
|
const aspectRatio = origElement.width / origElement.height;
|
|
29606
29630
|
if (originalAppState.croppingElementId === origElement.id) {
|
|
29607
29631
|
const element = elementsMap.get(origElement.id);
|
|
29608
|
-
if (!element || !
|
|
29632
|
+
if (!element || !isImageElement6(element) || !element.crop) {
|
|
29609
29633
|
return;
|
|
29610
29634
|
}
|
|
29611
29635
|
const crop = element.crop;
|
|
@@ -29805,7 +29829,7 @@ var DimensionDragInput = ({
|
|
|
29805
29829
|
appState
|
|
29806
29830
|
}) => {
|
|
29807
29831
|
let value = round2(property === "width" ? element.width : element.height, 2);
|
|
29808
|
-
if (appState.croppingElementId && appState.croppingElementId === element.id &&
|
|
29832
|
+
if (appState.croppingElementId && appState.croppingElementId === element.id && isImageElement6(element) && element.crop) {
|
|
29809
29833
|
const { width: uncroppedWidth, height: uncroppedHeight } = getUncroppedWidthAndHeight(element);
|
|
29810
29834
|
if (property === "width") {
|
|
29811
29835
|
const ratio = uncroppedWidth / element.crop.naturalWidth;
|
|
@@ -30801,7 +30825,7 @@ import {
|
|
|
30801
30825
|
getFlipAdjustedCropPosition,
|
|
30802
30826
|
getUncroppedWidthAndHeight as getUncroppedWidthAndHeight2
|
|
30803
30827
|
} from "@excalidraw/element";
|
|
30804
|
-
import { isImageElement as
|
|
30828
|
+
import { isImageElement as isImageElement7 } from "@excalidraw/element";
|
|
30805
30829
|
import { jsx as jsx106 } from "react/jsx-runtime";
|
|
30806
30830
|
var handlePositionChange2 = ({
|
|
30807
30831
|
accumulatedChange,
|
|
@@ -30828,7 +30852,7 @@ var handlePositionChange2 = ({
|
|
|
30828
30852
|
);
|
|
30829
30853
|
if (originalAppState.croppingElementId === origElement.id) {
|
|
30830
30854
|
const element = elementsMap.get(origElement.id);
|
|
30831
|
-
if (!element || !
|
|
30855
|
+
if (!element || !isImageElement7(element) || !element.crop) {
|
|
30832
30856
|
return;
|
|
30833
30857
|
}
|
|
30834
30858
|
const crop = element.crop;
|
|
@@ -30923,7 +30947,7 @@ var Position = ({ property, element, scene, appState }) => {
|
|
|
30923
30947
|
element.angle
|
|
30924
30948
|
);
|
|
30925
30949
|
let value = round3(property === "x" ? topLeftX : topLeftY, 2);
|
|
30926
|
-
if (appState.croppingElementId === element.id &&
|
|
30950
|
+
if (appState.croppingElementId === element.id && isImageElement7(element) && element.crop) {
|
|
30927
30951
|
const flipAdjustedPosition = getFlipAdjustedCropPosition(element);
|
|
30928
30952
|
if (flipAdjustedPosition) {
|
|
30929
30953
|
value = round3(
|
|
@@ -30978,7 +31002,7 @@ var StatsRow = ({
|
|
|
30978
31002
|
}) => /* @__PURE__ */ jsx107(
|
|
30979
31003
|
"div",
|
|
30980
31004
|
{
|
|
30981
|
-
className:
|
|
31005
|
+
className: clsx46("exc-stats__row", { "exc-stats__row--heading": heading }),
|
|
30982
31006
|
style: {
|
|
30983
31007
|
gridTemplateColumns: `repeat(${columns}, 1fr)`,
|
|
30984
31008
|
...style
|
|
@@ -31013,7 +31037,7 @@ var StatsInner = memo2(
|
|
|
31013
31037
|
const setAppState = useExcalidrawSetAppState();
|
|
31014
31038
|
const singleElement = selectedElements.length === 1 ? selectedElements[0] : null;
|
|
31015
31039
|
const multipleElements = selectedElements.length > 1 ? selectedElements : null;
|
|
31016
|
-
const cropMode = appState.croppingElementId &&
|
|
31040
|
+
const cropMode = appState.croppingElementId && isImageElement8(singleElement);
|
|
31017
31041
|
const unCroppedDimension = cropMode ? getUncroppedWidthAndHeight3(singleElement) : null;
|
|
31018
31042
|
const [sceneDimension, setSceneDimension] = useState25({
|
|
31019
31043
|
width: 0,
|
|
@@ -31115,11 +31139,11 @@ var StatsInner = memo2(
|
|
|
31115
31139
|
children: /* @__PURE__ */ jsxs55(StatsRows, { children: [
|
|
31116
31140
|
singleElement && /* @__PURE__ */ jsxs55(Fragment16, { children: [
|
|
31117
31141
|
cropMode && /* @__PURE__ */ jsx107(StatsRow, { heading: true, children: t("labels.unCroppedDimension") }),
|
|
31118
|
-
appState.croppingElementId &&
|
|
31142
|
+
appState.croppingElementId && isImageElement8(singleElement) && unCroppedDimension && /* @__PURE__ */ jsxs55(StatsRow, { columns: 2, children: [
|
|
31119
31143
|
/* @__PURE__ */ jsx107("div", { children: t("stats.width") }),
|
|
31120
31144
|
/* @__PURE__ */ jsx107("div", { children: round4(unCroppedDimension.width, 2) })
|
|
31121
31145
|
] }),
|
|
31122
|
-
appState.croppingElementId &&
|
|
31146
|
+
appState.croppingElementId && isImageElement8(singleElement) && unCroppedDimension && /* @__PURE__ */ jsxs55(StatsRow, { columns: 2, children: [
|
|
31123
31147
|
/* @__PURE__ */ jsx107("div", { children: t("stats.height") }),
|
|
31124
31148
|
/* @__PURE__ */ jsx107("div", { children: round4(unCroppedDimension.height, 2) })
|
|
31125
31149
|
] }),
|
|
@@ -31280,7 +31304,7 @@ import {
|
|
|
31280
31304
|
} from "@excalidraw/element";
|
|
31281
31305
|
|
|
31282
31306
|
// components/DialogActionButton.tsx
|
|
31283
|
-
import
|
|
31307
|
+
import clsx47 from "clsx";
|
|
31284
31308
|
import { jsx as jsx108, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
31285
31309
|
var DialogActionButton = ({
|
|
31286
31310
|
label,
|
|
@@ -31296,7 +31320,7 @@ var DialogActionButton = ({
|
|
|
31296
31320
|
return /* @__PURE__ */ jsxs56(
|
|
31297
31321
|
"button",
|
|
31298
31322
|
{
|
|
31299
|
-
className:
|
|
31323
|
+
className: clsx47("Dialog__action-button", cs, className),
|
|
31300
31324
|
type,
|
|
31301
31325
|
"aria-label": label,
|
|
31302
31326
|
onClick,
|
|
@@ -31312,7 +31336,7 @@ var DialogActionButton = ({
|
|
|
31312
31336
|
var DialogActionButton_default = DialogActionButton;
|
|
31313
31337
|
|
|
31314
31338
|
// components/TextField.tsx
|
|
31315
|
-
import
|
|
31339
|
+
import clsx49 from "clsx";
|
|
31316
31340
|
import {
|
|
31317
31341
|
forwardRef as forwardRef4,
|
|
31318
31342
|
useRef as useRef23,
|
|
@@ -31322,7 +31346,7 @@ import {
|
|
|
31322
31346
|
} from "react";
|
|
31323
31347
|
|
|
31324
31348
|
// components/Button.tsx
|
|
31325
|
-
import
|
|
31349
|
+
import clsx48 from "clsx";
|
|
31326
31350
|
import { composeEventHandlers as composeEventHandlers3 } from "@excalidraw/common";
|
|
31327
31351
|
import { jsx as jsx109 } from "react/jsx-runtime";
|
|
31328
31352
|
var Button = ({
|
|
@@ -31340,7 +31364,7 @@ var Button = ({
|
|
|
31340
31364
|
onSelect();
|
|
31341
31365
|
}),
|
|
31342
31366
|
type,
|
|
31343
|
-
className:
|
|
31367
|
+
className: clsx48("excalidraw-button", className, { selected }),
|
|
31344
31368
|
...rest,
|
|
31345
31369
|
children
|
|
31346
31370
|
}
|
|
@@ -31376,7 +31400,7 @@ var TextField = forwardRef4(
|
|
|
31376
31400
|
return /* @__PURE__ */ jsxs57(
|
|
31377
31401
|
"div",
|
|
31378
31402
|
{
|
|
31379
|
-
className:
|
|
31403
|
+
className: clsx49("ExcTextField", className, {
|
|
31380
31404
|
"ExcTextField--fullWidth": fullWidth,
|
|
31381
31405
|
"ExcTextField--hasIcon": !!icon
|
|
31382
31406
|
}),
|
|
@@ -31389,14 +31413,14 @@ var TextField = forwardRef4(
|
|
|
31389
31413
|
/* @__PURE__ */ jsxs57(
|
|
31390
31414
|
"div",
|
|
31391
31415
|
{
|
|
31392
|
-
className:
|
|
31416
|
+
className: clsx49("ExcTextField__input", {
|
|
31393
31417
|
"ExcTextField__input--readonly": readonly
|
|
31394
31418
|
}),
|
|
31395
31419
|
children: [
|
|
31396
31420
|
/* @__PURE__ */ jsx110(
|
|
31397
31421
|
"input",
|
|
31398
31422
|
{
|
|
31399
|
-
className:
|
|
31423
|
+
className: clsx49({
|
|
31400
31424
|
"is-redacted": "value" in rest && rest.value && isRedacted && !isTemporarilyUnredacted
|
|
31401
31425
|
}),
|
|
31402
31426
|
readOnly: readonly,
|
|
@@ -31585,7 +31609,7 @@ var ErrorDialog = ({
|
|
|
31585
31609
|
};
|
|
31586
31610
|
|
|
31587
31611
|
// components/GifPlaybackControls.tsx
|
|
31588
|
-
import
|
|
31612
|
+
import clsx50 from "clsx";
|
|
31589
31613
|
import React32 from "react";
|
|
31590
31614
|
import { MIME_TYPES as MIME_TYPES10, sceneCoordsToViewportCoords as sceneCoordsToViewportCoords4 } from "@excalidraw/common";
|
|
31591
31615
|
import {
|
|
@@ -31933,7 +31957,7 @@ var GifPlaybackControls = ({
|
|
|
31933
31957
|
"button",
|
|
31934
31958
|
{
|
|
31935
31959
|
type: "button",
|
|
31936
|
-
className:
|
|
31960
|
+
className: clsx50("gif-speed-picker__speed", {
|
|
31937
31961
|
"gif-speed-picker__speed--selected": speed === playback.speed
|
|
31938
31962
|
}),
|
|
31939
31963
|
onClick: () => setSpeed(speed),
|
|
@@ -32030,7 +32054,7 @@ var GifPlaybackControls = ({
|
|
|
32030
32054
|
liveAppState.openPopup === "gifFrameGallery" && /* @__PURE__ */ jsx113(
|
|
32031
32055
|
"div",
|
|
32032
32056
|
{
|
|
32033
|
-
className:
|
|
32057
|
+
className: clsx50("gif-frame-gallery", {
|
|
32034
32058
|
"gif-frame-gallery--dragging": isGifGalleryDragging
|
|
32035
32059
|
}),
|
|
32036
32060
|
style: {
|
|
@@ -32080,7 +32104,7 @@ var GifPlaybackControls = ({
|
|
|
32080
32104
|
"button",
|
|
32081
32105
|
{
|
|
32082
32106
|
type: "button",
|
|
32083
|
-
className:
|
|
32107
|
+
className: clsx50("gif-frame-gallery__frame", {
|
|
32084
32108
|
"gif-frame-gallery__frame--selected": index === frameIndex
|
|
32085
32109
|
}),
|
|
32086
32110
|
style: {
|
|
@@ -32121,7 +32145,7 @@ var GifPlaybackControls = ({
|
|
|
32121
32145
|
|
|
32122
32146
|
// components/HelpDialog.tsx
|
|
32123
32147
|
import React33, { useMemo as useMemo10 } from "react";
|
|
32124
|
-
import
|
|
32148
|
+
import clsx51 from "clsx";
|
|
32125
32149
|
import { isDarwin as isDarwin4, isFirefox as isFirefox4, isWindows } from "@excalidraw/common";
|
|
32126
32150
|
import { KEYS as KEYS49 } from "@excalidraw/common";
|
|
32127
32151
|
import { SHAPES as SHAPES3 } from "@excalidraw/element/shapes";
|
|
@@ -32373,14 +32397,14 @@ var HelpDialog = ({ onClose }) => {
|
|
|
32373
32397
|
() => isShowAll ? /* @__PURE__ */ jsx115(
|
|
32374
32398
|
"button",
|
|
32375
32399
|
{
|
|
32376
|
-
className:
|
|
32400
|
+
className: clsx51("toggle-button", {}),
|
|
32377
32401
|
onClick: () => setIsShowAll(false),
|
|
32378
32402
|
children: t("helpDialog.myoc.showingAll")
|
|
32379
32403
|
}
|
|
32380
32404
|
) : /* @__PURE__ */ jsx115(
|
|
32381
32405
|
"button",
|
|
32382
32406
|
{
|
|
32383
|
-
className:
|
|
32407
|
+
className: clsx51("toggle-button", {}),
|
|
32384
32408
|
onClick: () => setIsShowAll(true),
|
|
32385
32409
|
children: t("helpDialog.myoc.showingBasic")
|
|
32386
32410
|
}
|
|
@@ -32894,6 +32918,204 @@ var HelpDialog = ({ onClose }) => {
|
|
|
32894
32918
|
) });
|
|
32895
32919
|
};
|
|
32896
32920
|
|
|
32921
|
+
// components/HintViewer.tsx
|
|
32922
|
+
import { CANVAS_SEARCH_TAB as CANVAS_SEARCH_TAB2, DEFAULT_SIDEBAR as DEFAULT_SIDEBAR2 } from "@excalidraw/common";
|
|
32923
|
+
import {
|
|
32924
|
+
isArrowElement as isArrowElement14,
|
|
32925
|
+
isFlowchartNodeElement as isFlowchartNodeElement3,
|
|
32926
|
+
isImageElement as isImageElement9,
|
|
32927
|
+
isLinearElement as isLinearElement10,
|
|
32928
|
+
isLineElement as isLineElement8,
|
|
32929
|
+
isTextBindableContainer as isTextBindableContainer2,
|
|
32930
|
+
isTextElement as isTextElement16
|
|
32931
|
+
} from "@excalidraw/element";
|
|
32932
|
+
import { isNodeInFlowchart } from "@excalidraw/element";
|
|
32933
|
+
import { jsx as jsx116 } from "react/jsx-runtime";
|
|
32934
|
+
var getTaggedShortcutKey = (key) => Array.isArray(key) ? `<kbd>${key.map(getShortcutKey).join(" + ")}</kbd>` : `<kbd>${getShortcutKey(key)}</kbd>`;
|
|
32935
|
+
var getHints = ({
|
|
32936
|
+
appState,
|
|
32937
|
+
isMobile,
|
|
32938
|
+
editorInterface,
|
|
32939
|
+
app
|
|
32940
|
+
}) => {
|
|
32941
|
+
const { activeTool, isResizing, isRotating, lastPointerDownWith } = appState;
|
|
32942
|
+
const multiMode = appState.multiElement !== null;
|
|
32943
|
+
if (appState.openSidebar?.name === DEFAULT_SIDEBAR2.name && appState.openSidebar.tab === CANVAS_SEARCH_TAB2 && appState.searchMatches?.matches.length) {
|
|
32944
|
+
return t("hints.dismissSearch", {
|
|
32945
|
+
shortcut: getTaggedShortcutKey("Escape")
|
|
32946
|
+
});
|
|
32947
|
+
}
|
|
32948
|
+
if (appState.openSidebar && !editorInterface.canFitSidebar) {
|
|
32949
|
+
return null;
|
|
32950
|
+
}
|
|
32951
|
+
if (isEraserActive(appState)) {
|
|
32952
|
+
return t("hints.eraserRevert", {
|
|
32953
|
+
shortcut: getTaggedShortcutKey("Alt")
|
|
32954
|
+
});
|
|
32955
|
+
}
|
|
32956
|
+
const selectedElements = app.scene.getSelectedElements(appState);
|
|
32957
|
+
if (appState.selectedLinearElement?.isDragging && selectedElements[0]?.type === "arrow") {
|
|
32958
|
+
return t("hints.arrowBindModifiers", {
|
|
32959
|
+
shortcut_1: getTaggedShortcutKey("Ctrl"),
|
|
32960
|
+
shortcut_2: getTaggedShortcutKey("Alt")
|
|
32961
|
+
});
|
|
32962
|
+
}
|
|
32963
|
+
if (activeTool.type === "arrow" || activeTool.type === "line") {
|
|
32964
|
+
if (multiMode) {
|
|
32965
|
+
return t("hints.linearElementMulti", {
|
|
32966
|
+
shortcut_1: getTaggedShortcutKey("Escape"),
|
|
32967
|
+
shortcut_2: getTaggedShortcutKey("Enter")
|
|
32968
|
+
});
|
|
32969
|
+
}
|
|
32970
|
+
if (activeTool.type === "arrow") {
|
|
32971
|
+
return t("hints.arrowTool", {
|
|
32972
|
+
shortcut: getTaggedShortcutKey("A")
|
|
32973
|
+
});
|
|
32974
|
+
}
|
|
32975
|
+
return t("hints.linearElement");
|
|
32976
|
+
}
|
|
32977
|
+
if (activeTool.type === "freedraw") {
|
|
32978
|
+
return t("hints.freeDraw");
|
|
32979
|
+
}
|
|
32980
|
+
if (activeTool.type === "text") {
|
|
32981
|
+
return t("hints.text");
|
|
32982
|
+
}
|
|
32983
|
+
if (activeTool.type === "embeddable") {
|
|
32984
|
+
return t("hints.embeddable");
|
|
32985
|
+
}
|
|
32986
|
+
if (activeTool.type === "autoshape") {
|
|
32987
|
+
return t("hints.autoshape");
|
|
32988
|
+
}
|
|
32989
|
+
if (isResizing && lastPointerDownWith === "mouse" && selectedElements.length === 1) {
|
|
32990
|
+
const targetElement = selectedElements[0];
|
|
32991
|
+
if (isLinearElement10(targetElement) && targetElement.points.length === 2) {
|
|
32992
|
+
return t("hints.lockAngle", {
|
|
32993
|
+
shortcut: getTaggedShortcutKey("Shift")
|
|
32994
|
+
});
|
|
32995
|
+
}
|
|
32996
|
+
return isImageElement9(targetElement) ? t("hints.resizeImage", {
|
|
32997
|
+
shortcut_1: getTaggedShortcutKey("Shift"),
|
|
32998
|
+
shortcut_2: getTaggedShortcutKey("Alt")
|
|
32999
|
+
}) : t("hints.resize", {
|
|
33000
|
+
shortcut_1: getTaggedShortcutKey("Shift"),
|
|
33001
|
+
shortcut_2: getTaggedShortcutKey("Alt")
|
|
33002
|
+
});
|
|
33003
|
+
}
|
|
33004
|
+
if (isRotating && lastPointerDownWith === "mouse") {
|
|
33005
|
+
return t("hints.rotate", {
|
|
33006
|
+
shortcut: getTaggedShortcutKey("Shift")
|
|
33007
|
+
});
|
|
33008
|
+
}
|
|
33009
|
+
if (selectedElements.length === 1 && isTextElement16(selectedElements[0])) {
|
|
33010
|
+
return t("hints.text_selected", {
|
|
33011
|
+
shortcut: getTaggedShortcutKey("Enter")
|
|
33012
|
+
});
|
|
33013
|
+
}
|
|
33014
|
+
if (appState.editingTextElement) {
|
|
33015
|
+
return t("hints.text_editing", {
|
|
33016
|
+
shortcut_1: getTaggedShortcutKey("Escape"),
|
|
33017
|
+
shortcut_2: getTaggedShortcutKey(["CtrlOrCmd", "Enter"])
|
|
33018
|
+
});
|
|
33019
|
+
}
|
|
33020
|
+
if (appState.croppingElementId) {
|
|
33021
|
+
return t("hints.leaveCropEditor", {
|
|
33022
|
+
shortcut_1: getTaggedShortcutKey("Enter"),
|
|
33023
|
+
shortcut_2: getTaggedShortcutKey("Escape")
|
|
33024
|
+
});
|
|
33025
|
+
}
|
|
33026
|
+
if (selectedElements.length === 1 && isImageElement9(selectedElements[0])) {
|
|
33027
|
+
return t("hints.enterCropEditor", {
|
|
33028
|
+
shortcut_1: getTaggedShortcutKey("double click"),
|
|
33029
|
+
shortcut_2: getTaggedShortcutKey("Enter")
|
|
33030
|
+
});
|
|
33031
|
+
}
|
|
33032
|
+
if (activeTool.type === "selection") {
|
|
33033
|
+
if (appState.selectionElement && !selectedElements.length && !appState.editingTextElement && !appState.selectedLinearElement?.isEditing) {
|
|
33034
|
+
return t("hints.deepBoxSelect", {
|
|
33035
|
+
shortcut: getTaggedShortcutKey("CtrlOrCmd")
|
|
33036
|
+
});
|
|
33037
|
+
}
|
|
33038
|
+
if (isGridModeEnabled(app) && appState.selectedElementsAreBeingDragged) {
|
|
33039
|
+
return t("hints.disableSnapping", {
|
|
33040
|
+
shortcut: getTaggedShortcutKey("CtrlOrCmd")
|
|
33041
|
+
});
|
|
33042
|
+
}
|
|
33043
|
+
if (!selectedElements.length && !isMobile) {
|
|
33044
|
+
return t("hints.canvasPanning", {
|
|
33045
|
+
shortcut_1: getTaggedShortcutKey(t("keys.mmb")),
|
|
33046
|
+
shortcut_2: getTaggedShortcutKey("Space")
|
|
33047
|
+
});
|
|
33048
|
+
}
|
|
33049
|
+
if (selectedElements.length === 1) {
|
|
33050
|
+
if (isLinearElement10(selectedElements[0])) {
|
|
33051
|
+
if (isArrowElement14(selectedElements[0]) && appState.selectedLinearElement?.elementId === selectedElements[0].id && (appState.selectedLinearElement.hoverPointIndex === 0 || appState.selectedLinearElement.hoverPointIndex === selectedElements[0].points.length - 1)) {
|
|
33052
|
+
return t("hints.toggleArrowhead");
|
|
33053
|
+
}
|
|
33054
|
+
if (appState.selectedLinearElement?.isEditing) {
|
|
33055
|
+
return appState.selectedLinearElement.selectedPointsIndices ? t("hints.lineEditor_pointSelected", {
|
|
33056
|
+
shortcut_1: getTaggedShortcutKey("Delete"),
|
|
33057
|
+
shortcut_2: getTaggedShortcutKey(["CtrlOrCmd", "D"])
|
|
33058
|
+
}) : t("hints.lineEditor_nothingSelected", {
|
|
33059
|
+
shortcut_1: getTaggedShortcutKey("Shift"),
|
|
33060
|
+
shortcut_2: getTaggedShortcutKey("Alt")
|
|
33061
|
+
});
|
|
33062
|
+
}
|
|
33063
|
+
return isLineElement8(selectedElements[0]) ? t("hints.lineEditor_line_info", {
|
|
33064
|
+
shortcut: getTaggedShortcutKey("Enter")
|
|
33065
|
+
}) : t("hints.lineEditor_info", {
|
|
33066
|
+
shortcut_1: getTaggedShortcutKey("CtrlOrCmd"),
|
|
33067
|
+
shortcut_2: getTaggedShortcutKey(["CtrlOrCmd", "Enter"])
|
|
33068
|
+
});
|
|
33069
|
+
}
|
|
33070
|
+
if (!appState.newElement && !appState.selectedElementsAreBeingDragged && isTextBindableContainer2(selectedElements[0])) {
|
|
33071
|
+
const bindTextToElement = t("hints.bindTextToElement", {
|
|
33072
|
+
shortcut: getTaggedShortcutKey("Enter")
|
|
33073
|
+
});
|
|
33074
|
+
const createFlowchart = t("hints.createFlowchart", {
|
|
33075
|
+
shortcut: getTaggedShortcutKey(["CtrlOrCmd", "\u2191\u2193"])
|
|
33076
|
+
});
|
|
33077
|
+
if (isFlowchartNodeElement3(selectedElements[0])) {
|
|
33078
|
+
if (isNodeInFlowchart(
|
|
33079
|
+
selectedElements[0],
|
|
33080
|
+
app.scene.getNonDeletedElementsMap()
|
|
33081
|
+
)) {
|
|
33082
|
+
return [bindTextToElement, createFlowchart];
|
|
33083
|
+
}
|
|
33084
|
+
return [bindTextToElement, createFlowchart];
|
|
33085
|
+
}
|
|
33086
|
+
return bindTextToElement;
|
|
33087
|
+
}
|
|
33088
|
+
}
|
|
33089
|
+
}
|
|
33090
|
+
return null;
|
|
33091
|
+
};
|
|
33092
|
+
var HintViewer = ({
|
|
33093
|
+
appState,
|
|
33094
|
+
isMobile,
|
|
33095
|
+
editorInterface,
|
|
33096
|
+
app
|
|
33097
|
+
}) => {
|
|
33098
|
+
const smartZoomKeyHeld = useAtomValue(smartZoomKeyHeldAtom);
|
|
33099
|
+
const hints = smartZoomKeyHeld ? SMART_ZOOM_KEY_HINT : appState.viewModeEnabled ? null : getHints({
|
|
33100
|
+
appState,
|
|
33101
|
+
isMobile,
|
|
33102
|
+
editorInterface,
|
|
33103
|
+
app
|
|
33104
|
+
});
|
|
33105
|
+
if (!hints) {
|
|
33106
|
+
return null;
|
|
33107
|
+
}
|
|
33108
|
+
const hint = Array.isArray(hints) ? hints.map((hint2) => hint2.replace(/\. ?$/, "")).join(", ") : hints;
|
|
33109
|
+
const hintJSX = hint.split(/(<kbd>[^<]+<\/kbd>)/g).map((part, index) => {
|
|
33110
|
+
if (index % 2 === 1) {
|
|
33111
|
+
const shortcutMatch = part[0] === "<" && part.match(/^<kbd>([^<]+)<\/kbd>$/);
|
|
33112
|
+
return /* @__PURE__ */ jsx116("kbd", { children: shortcutMatch ? shortcutMatch[1] : part }, index);
|
|
33113
|
+
}
|
|
33114
|
+
return part;
|
|
33115
|
+
});
|
|
33116
|
+
return /* @__PURE__ */ jsx116("div", { className: "HintViewer", children: /* @__PURE__ */ jsx116("span", { children: hintJSX }) });
|
|
33117
|
+
};
|
|
33118
|
+
|
|
32897
33119
|
// components/ImageExportDialog.tsx
|
|
32898
33120
|
import { useEffect as useEffect31, useRef as useRef25, useState as useState30 } from "react";
|
|
32899
33121
|
import {
|
|
@@ -32928,11 +33150,11 @@ var useCopyStatus = () => {
|
|
|
32928
33150
|
};
|
|
32929
33151
|
|
|
32930
33152
|
// components/ImageExportDialog.tsx
|
|
32931
|
-
import { jsx as
|
|
33153
|
+
import { jsx as jsx117, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
32932
33154
|
var ErrorCanvasPreview = () => {
|
|
32933
33155
|
return /* @__PURE__ */ jsxs62("div", { children: [
|
|
32934
|
-
/* @__PURE__ */
|
|
32935
|
-
/* @__PURE__ */
|
|
33156
|
+
/* @__PURE__ */ jsx117("h3", { children: t("canvasError.cannotShowPreview") }),
|
|
33157
|
+
/* @__PURE__ */ jsx117("p", { children: /* @__PURE__ */ jsx117("span", { children: t("canvasError.canvasTooBig") }) }),
|
|
32936
33158
|
/* @__PURE__ */ jsxs62("em", { children: [
|
|
32937
33159
|
"(",
|
|
32938
33160
|
t("canvasError.canvasTooBigTip"),
|
|
@@ -33048,10 +33270,10 @@ var ImageExportModal = ({
|
|
|
33048
33270
|
embedScene
|
|
33049
33271
|
]);
|
|
33050
33272
|
return /* @__PURE__ */ jsxs62("div", { className: "ImageExportModal", children: [
|
|
33051
|
-
/* @__PURE__ */
|
|
33273
|
+
/* @__PURE__ */ jsx117("h3", { children: t("imageExportDialog.header") }),
|
|
33052
33274
|
/* @__PURE__ */ jsxs62("div", { className: "ImageExportModal__preview", children: [
|
|
33053
|
-
/* @__PURE__ */
|
|
33054
|
-
/* @__PURE__ */
|
|
33275
|
+
/* @__PURE__ */ jsx117("div", { className: "ImageExportModal__preview__canvas", ref: previewRef, children: renderError && /* @__PURE__ */ jsx117(ErrorCanvasPreview, {}) }),
|
|
33276
|
+
/* @__PURE__ */ jsx117("div", { className: "ImageExportModal__preview__filename", children: !nativeFileSystemSupported && /* @__PURE__ */ jsx117(
|
|
33055
33277
|
"input",
|
|
33056
33278
|
{
|
|
33057
33279
|
type: "text",
|
|
@@ -33070,13 +33292,13 @@ var ImageExportModal = ({
|
|
|
33070
33292
|
) })
|
|
33071
33293
|
] }),
|
|
33072
33294
|
/* @__PURE__ */ jsxs62("div", { className: "ImageExportModal__settings", children: [
|
|
33073
|
-
/* @__PURE__ */
|
|
33074
|
-
hasSelection && /* @__PURE__ */
|
|
33295
|
+
/* @__PURE__ */ jsx117("h3", { children: t("imageExportDialog.header") }),
|
|
33296
|
+
hasSelection && /* @__PURE__ */ jsx117(
|
|
33075
33297
|
ExportSetting,
|
|
33076
33298
|
{
|
|
33077
33299
|
label: t("imageExportDialog.label.onlySelected"),
|
|
33078
33300
|
name: "exportOnlySelected",
|
|
33079
|
-
children: /* @__PURE__ */
|
|
33301
|
+
children: /* @__PURE__ */ jsx117(
|
|
33080
33302
|
Switch,
|
|
33081
33303
|
{
|
|
33082
33304
|
name: "exportOnlySelected",
|
|
@@ -33088,12 +33310,12 @@ var ImageExportModal = ({
|
|
|
33088
33310
|
)
|
|
33089
33311
|
}
|
|
33090
33312
|
),
|
|
33091
|
-
/* @__PURE__ */
|
|
33313
|
+
/* @__PURE__ */ jsx117(
|
|
33092
33314
|
ExportSetting,
|
|
33093
33315
|
{
|
|
33094
33316
|
label: t("imageExportDialog.label.withBackground"),
|
|
33095
33317
|
name: "exportBackgroundSwitch",
|
|
33096
|
-
children: /* @__PURE__ */
|
|
33318
|
+
children: /* @__PURE__ */ jsx117(
|
|
33097
33319
|
Switch,
|
|
33098
33320
|
{
|
|
33099
33321
|
name: "exportBackgroundSwitch",
|
|
@@ -33110,12 +33332,12 @@ var ImageExportModal = ({
|
|
|
33110
33332
|
)
|
|
33111
33333
|
}
|
|
33112
33334
|
),
|
|
33113
|
-
/* @__PURE__ */
|
|
33335
|
+
/* @__PURE__ */ jsx117(
|
|
33114
33336
|
ExportSetting,
|
|
33115
33337
|
{
|
|
33116
33338
|
label: t("imageExportDialog.label.darkMode"),
|
|
33117
33339
|
name: "exportDarkModeSwitch",
|
|
33118
|
-
children: /* @__PURE__ */
|
|
33340
|
+
children: /* @__PURE__ */ jsx117(
|
|
33119
33341
|
Switch,
|
|
33120
33342
|
{
|
|
33121
33343
|
name: "exportDarkModeSwitch",
|
|
@@ -33131,13 +33353,13 @@ var ImageExportModal = ({
|
|
|
33131
33353
|
)
|
|
33132
33354
|
}
|
|
33133
33355
|
),
|
|
33134
|
-
/* @__PURE__ */
|
|
33356
|
+
/* @__PURE__ */ jsx117(
|
|
33135
33357
|
ExportSetting,
|
|
33136
33358
|
{
|
|
33137
33359
|
label: t("imageExportDialog.label.embedScene"),
|
|
33138
33360
|
tooltip: t("imageExportDialog.tooltip.embedScene"),
|
|
33139
33361
|
name: "exportEmbedSwitch",
|
|
33140
|
-
children: /* @__PURE__ */
|
|
33362
|
+
children: /* @__PURE__ */ jsx117(
|
|
33141
33363
|
Switch,
|
|
33142
33364
|
{
|
|
33143
33365
|
name: "exportEmbedSwitch",
|
|
@@ -33154,12 +33376,12 @@ var ImageExportModal = ({
|
|
|
33154
33376
|
)
|
|
33155
33377
|
}
|
|
33156
33378
|
),
|
|
33157
|
-
/* @__PURE__ */
|
|
33379
|
+
/* @__PURE__ */ jsx117(
|
|
33158
33380
|
ExportSetting,
|
|
33159
33381
|
{
|
|
33160
33382
|
label: t("imageExportDialog.label.scale"),
|
|
33161
33383
|
name: "exportScale",
|
|
33162
|
-
children: /* @__PURE__ */
|
|
33384
|
+
children: /* @__PURE__ */ jsx117(
|
|
33163
33385
|
RadioGroup,
|
|
33164
33386
|
{
|
|
33165
33387
|
name: "exportScale",
|
|
@@ -33177,7 +33399,7 @@ var ImageExportModal = ({
|
|
|
33177
33399
|
}
|
|
33178
33400
|
),
|
|
33179
33401
|
/* @__PURE__ */ jsxs62("div", { className: "ImageExportModal__settings__buttons", children: [
|
|
33180
|
-
/* @__PURE__ */
|
|
33402
|
+
/* @__PURE__ */ jsx117(
|
|
33181
33403
|
FilledButton,
|
|
33182
33404
|
{
|
|
33183
33405
|
className: "ImageExportModal__settings__buttons__button",
|
|
@@ -33189,7 +33411,7 @@ var ImageExportModal = ({
|
|
|
33189
33411
|
children: t("imageExportDialog.button.exportToPng")
|
|
33190
33412
|
}
|
|
33191
33413
|
),
|
|
33192
|
-
/* @__PURE__ */
|
|
33414
|
+
/* @__PURE__ */ jsx117(
|
|
33193
33415
|
FilledButton,
|
|
33194
33416
|
{
|
|
33195
33417
|
className: "ImageExportModal__settings__buttons__button",
|
|
@@ -33201,7 +33423,7 @@ var ImageExportModal = ({
|
|
|
33201
33423
|
children: t("imageExportDialog.button.exportToSvg")
|
|
33202
33424
|
}
|
|
33203
33425
|
),
|
|
33204
|
-
(probablySupportsClipboardBlob || isFirefox5) && /* @__PURE__ */
|
|
33426
|
+
(probablySupportsClipboardBlob || isFirefox5) && /* @__PURE__ */ jsx117(
|
|
33205
33427
|
FilledButton,
|
|
33206
33428
|
{
|
|
33207
33429
|
className: "ImageExportModal__settings__buttons__button",
|
|
@@ -33239,11 +33461,11 @@ var ExportSetting = ({
|
|
|
33239
33461
|
className: "ImageExportModal__settings__setting__label",
|
|
33240
33462
|
children: [
|
|
33241
33463
|
label,
|
|
33242
|
-
tooltip && /* @__PURE__ */
|
|
33464
|
+
tooltip && /* @__PURE__ */ jsx117(Tooltip, { label: tooltip, long: true, children: helpIcon })
|
|
33243
33465
|
]
|
|
33244
33466
|
}
|
|
33245
33467
|
),
|
|
33246
|
-
/* @__PURE__ */
|
|
33468
|
+
/* @__PURE__ */ jsx117("div", { className: "ImageExportModal__settings__setting__content", children })
|
|
33247
33469
|
] });
|
|
33248
33470
|
};
|
|
33249
33471
|
var ImageExportDialog = ({
|
|
@@ -33261,7 +33483,7 @@ var ImageExportDialog = ({
|
|
|
33261
33483
|
elementsSnapshot: cloneJSON4(elements)
|
|
33262
33484
|
};
|
|
33263
33485
|
});
|
|
33264
|
-
return /* @__PURE__ */
|
|
33486
|
+
return /* @__PURE__ */ jsx117(Dialog, { onCloseRequest, size: "wide", title: false, children: /* @__PURE__ */ jsx117(
|
|
33265
33487
|
ImageExportModal,
|
|
33266
33488
|
{
|
|
33267
33489
|
elementsSnapshot,
|
|
@@ -33276,11 +33498,11 @@ var ImageExportDialog = ({
|
|
|
33276
33498
|
};
|
|
33277
33499
|
|
|
33278
33500
|
// components/DefaultSidebar.tsx
|
|
33279
|
-
import
|
|
33280
|
-
import { CANVAS_SEARCH_TAB as
|
|
33501
|
+
import clsx56 from "clsx";
|
|
33502
|
+
import { CANVAS_SEARCH_TAB as CANVAS_SEARCH_TAB3, DEFAULT_SIDEBAR as DEFAULT_SIDEBAR3 } from "@excalidraw/common";
|
|
33281
33503
|
|
|
33282
33504
|
// components/SearchMenu.tsx
|
|
33283
|
-
import
|
|
33505
|
+
import clsx52 from "clsx";
|
|
33284
33506
|
import debounce3 from "lodash.debounce";
|
|
33285
33507
|
import { Fragment as Fragment21, memo as memo3, useEffect as useEffect32, useMemo as useMemo11, useRef as useRef26, useState as useState31 } from "react";
|
|
33286
33508
|
import {
|
|
@@ -33302,9 +33524,9 @@ import {
|
|
|
33302
33524
|
getFontString as getFontString15
|
|
33303
33525
|
} from "@excalidraw/common";
|
|
33304
33526
|
import { newTextElement as newTextElement5 } from "@excalidraw/element";
|
|
33305
|
-
import { isTextElement as
|
|
33527
|
+
import { isTextElement as isTextElement17, isFrameLikeElement as isFrameLikeElement16 } from "@excalidraw/element";
|
|
33306
33528
|
import { getDefaultFrameName } from "@excalidraw/element/frame";
|
|
33307
|
-
import { Fragment as Fragment22, jsx as
|
|
33529
|
+
import { Fragment as Fragment22, jsx as jsx118, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
33308
33530
|
var searchQueryAtom = atom("");
|
|
33309
33531
|
var searchItemInFocusAtom = atom(null);
|
|
33310
33532
|
var SEARCH_DEBOUNCE = 350;
|
|
@@ -33504,7 +33726,7 @@ var SearchMenu2 = () => {
|
|
|
33504
33726
|
const matchCount = `${searchMatches.items.length} ${searchMatches.items.length === 1 ? t("search.singleResult") : t("search.multipleResults")}`;
|
|
33505
33727
|
return /* @__PURE__ */ jsxs63("div", { className: "layer-ui__search", children: [
|
|
33506
33728
|
/* @__PURE__ */ jsxs63("div", { className: "layer-ui__search-header", children: [
|
|
33507
|
-
/* @__PURE__ */
|
|
33729
|
+
/* @__PURE__ */ jsx118(
|
|
33508
33730
|
TextField,
|
|
33509
33731
|
{
|
|
33510
33732
|
className: CLASSES7.SEARCH_MENU_INPUT_WRAPPER,
|
|
@@ -33540,7 +33762,7 @@ var SearchMenu2 = () => {
|
|
|
33540
33762
|
selectOnRender: true
|
|
33541
33763
|
}
|
|
33542
33764
|
),
|
|
33543
|
-
/* @__PURE__ */
|
|
33765
|
+
/* @__PURE__ */ jsx118(
|
|
33544
33766
|
Button,
|
|
33545
33767
|
{
|
|
33546
33768
|
"data-testid": "sidebar-close",
|
|
@@ -33561,9 +33783,9 @@ var SearchMenu2 = () => {
|
|
|
33561
33783
|
focusIndex + 1,
|
|
33562
33784
|
" / ",
|
|
33563
33785
|
matchCount
|
|
33564
|
-
] }) : /* @__PURE__ */
|
|
33786
|
+
] }) : /* @__PURE__ */ jsx118("div", { children: matchCount }),
|
|
33565
33787
|
/* @__PURE__ */ jsxs63("div", { className: "result-nav", children: [
|
|
33566
|
-
/* @__PURE__ */
|
|
33788
|
+
/* @__PURE__ */ jsx118(
|
|
33567
33789
|
Button,
|
|
33568
33790
|
{
|
|
33569
33791
|
onSelect: () => {
|
|
@@ -33573,7 +33795,7 @@ var SearchMenu2 = () => {
|
|
|
33573
33795
|
children: collapseDownIcon
|
|
33574
33796
|
}
|
|
33575
33797
|
),
|
|
33576
|
-
/* @__PURE__ */
|
|
33798
|
+
/* @__PURE__ */ jsx118(
|
|
33577
33799
|
Button,
|
|
33578
33800
|
{
|
|
33579
33801
|
onSelect: () => {
|
|
@@ -33585,9 +33807,9 @@ var SearchMenu2 = () => {
|
|
|
33585
33807
|
)
|
|
33586
33808
|
] })
|
|
33587
33809
|
] }),
|
|
33588
|
-
searchMatches.items.length === 0 && searchQuery && searchedQueryRef.current && /* @__PURE__ */
|
|
33810
|
+
searchMatches.items.length === 0 && searchQuery && searchedQueryRef.current && /* @__PURE__ */ jsx118("div", { style: { margin: "1rem auto" }, children: t("search.noMatch") })
|
|
33589
33811
|
] }),
|
|
33590
|
-
/* @__PURE__ */
|
|
33812
|
+
/* @__PURE__ */ jsx118(
|
|
33591
33813
|
MatchList,
|
|
33592
33814
|
{
|
|
33593
33815
|
matches: searchMatches,
|
|
@@ -33611,11 +33833,11 @@ var ListItem = (props) => {
|
|
|
33611
33833
|
),
|
|
33612
33834
|
props.preview.moreAfter ? "..." : ""
|
|
33613
33835
|
];
|
|
33614
|
-
return /* @__PURE__ */
|
|
33836
|
+
return /* @__PURE__ */ jsx118(
|
|
33615
33837
|
"div",
|
|
33616
33838
|
{
|
|
33617
33839
|
tabIndex: -1,
|
|
33618
|
-
className:
|
|
33840
|
+
className: clsx52("layer-ui__result-item", {
|
|
33619
33841
|
active: props.highlighted
|
|
33620
33842
|
}),
|
|
33621
33843
|
onClick: props.onClick,
|
|
@@ -33624,7 +33846,7 @@ var ListItem = (props) => {
|
|
|
33624
33846
|
ref?.scrollIntoView({ behavior: "auto", block: "nearest" });
|
|
33625
33847
|
}
|
|
33626
33848
|
},
|
|
33627
|
-
children: /* @__PURE__ */
|
|
33849
|
+
children: /* @__PURE__ */ jsx118("div", { className: "preview-text", children: preview.flatMap((text, idx) => /* @__PURE__ */ jsx118(Fragment21, { children: idx === 2 ? /* @__PURE__ */ jsx118("b", { children: text }) : text }, idx)) })
|
|
33628
33850
|
}
|
|
33629
33851
|
);
|
|
33630
33852
|
};
|
|
@@ -33634,16 +33856,16 @@ var MatchListBase = (props) => {
|
|
|
33634
33856
|
[props.matches]
|
|
33635
33857
|
);
|
|
33636
33858
|
const textMatches = useMemo11(
|
|
33637
|
-
() => props.matches.items.filter((match) =>
|
|
33859
|
+
() => props.matches.items.filter((match) => isTextElement17(match.element)),
|
|
33638
33860
|
[props.matches]
|
|
33639
33861
|
);
|
|
33640
33862
|
return /* @__PURE__ */ jsxs63("div", { className: "layer-ui__search-results", children: [
|
|
33641
33863
|
frameNameMatches.length > 0 && /* @__PURE__ */ jsxs63("div", { className: "layer-ui__search-result-container", children: [
|
|
33642
33864
|
/* @__PURE__ */ jsxs63("div", { className: "layer-ui__search-result-title", children: [
|
|
33643
|
-
/* @__PURE__ */
|
|
33644
|
-
/* @__PURE__ */
|
|
33865
|
+
/* @__PURE__ */ jsx118("div", { className: "title-icon", children: frameToolIcon }),
|
|
33866
|
+
/* @__PURE__ */ jsx118("div", { children: t("search.frames") })
|
|
33645
33867
|
] }),
|
|
33646
|
-
frameNameMatches.map((searchMatch, index) => /* @__PURE__ */
|
|
33868
|
+
frameNameMatches.map((searchMatch, index) => /* @__PURE__ */ jsx118(
|
|
33647
33869
|
ListItem,
|
|
33648
33870
|
{
|
|
33649
33871
|
searchQuery: props.searchQuery,
|
|
@@ -33653,14 +33875,14 @@ var MatchListBase = (props) => {
|
|
|
33653
33875
|
},
|
|
33654
33876
|
searchMatch.element.id + searchMatch.index
|
|
33655
33877
|
)),
|
|
33656
|
-
textMatches.length > 0 && /* @__PURE__ */
|
|
33878
|
+
textMatches.length > 0 && /* @__PURE__ */ jsx118("div", { className: "layer-ui__divider" })
|
|
33657
33879
|
] }),
|
|
33658
33880
|
textMatches.length > 0 && /* @__PURE__ */ jsxs63("div", { className: "layer-ui__search-result-container", children: [
|
|
33659
33881
|
/* @__PURE__ */ jsxs63("div", { className: "layer-ui__search-result-title", children: [
|
|
33660
|
-
/* @__PURE__ */
|
|
33661
|
-
/* @__PURE__ */
|
|
33882
|
+
/* @__PURE__ */ jsx118("div", { className: "title-icon", children: TextIcon }),
|
|
33883
|
+
/* @__PURE__ */ jsx118("div", { children: t("search.texts") })
|
|
33662
33884
|
] }),
|
|
33663
|
-
textMatches.map((searchMatch, index) => /* @__PURE__ */
|
|
33885
|
+
textMatches.map((searchMatch, index) => /* @__PURE__ */ jsx118(
|
|
33664
33886
|
ListItem,
|
|
33665
33887
|
{
|
|
33666
33888
|
searchQuery: props.searchQuery,
|
|
@@ -33837,7 +34059,7 @@ var handleSearch = debounce3(
|
|
|
33837
34059
|
}
|
|
33838
34060
|
const elements = app.scene.getNonDeletedElements();
|
|
33839
34061
|
const texts = elements.filter(
|
|
33840
|
-
(el) =>
|
|
34062
|
+
(el) => isTextElement17(el)
|
|
33841
34063
|
);
|
|
33842
34064
|
const frames2 = elements.filter(
|
|
33843
34065
|
(el) => isFrameLikeElement16(el)
|
|
@@ -33899,7 +34121,7 @@ var handleSearch = debounce3(
|
|
|
33899
34121
|
);
|
|
33900
34122
|
|
|
33901
34123
|
// components/Sidebar/Sidebar.tsx
|
|
33902
|
-
import
|
|
34124
|
+
import clsx55 from "clsx";
|
|
33903
34125
|
import {
|
|
33904
34126
|
useEffect as useEffect33,
|
|
33905
34127
|
useLayoutEffect as useLayoutEffect9,
|
|
@@ -33918,7 +34140,7 @@ import {
|
|
|
33918
34140
|
} from "@excalidraw/common";
|
|
33919
34141
|
|
|
33920
34142
|
// components/Sidebar/SidebarHeader.tsx
|
|
33921
|
-
import
|
|
34143
|
+
import clsx53 from "clsx";
|
|
33922
34144
|
import { useContext as useContext3 } from "react";
|
|
33923
34145
|
|
|
33924
34146
|
// components/Sidebar/common.ts
|
|
@@ -33926,7 +34148,7 @@ import React35 from "react";
|
|
|
33926
34148
|
var SidebarPropsContext = React35.createContext({});
|
|
33927
34149
|
|
|
33928
34150
|
// components/Sidebar/SidebarHeader.tsx
|
|
33929
|
-
import { jsx as
|
|
34151
|
+
import { jsx as jsx119, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
33930
34152
|
var SidebarHeader = ({
|
|
33931
34153
|
children,
|
|
33932
34154
|
className
|
|
@@ -33937,12 +34159,12 @@ var SidebarHeader = ({
|
|
|
33937
34159
|
return /* @__PURE__ */ jsxs64(
|
|
33938
34160
|
"div",
|
|
33939
34161
|
{
|
|
33940
|
-
className:
|
|
34162
|
+
className: clsx53("sidebar__header", className),
|
|
33941
34163
|
"data-testid": "sidebar-header",
|
|
33942
34164
|
children: [
|
|
33943
34165
|
children,
|
|
33944
34166
|
/* @__PURE__ */ jsxs64("div", { className: "sidebar__header__buttons", children: [
|
|
33945
|
-
renderDockButton && /* @__PURE__ */
|
|
34167
|
+
renderDockButton && /* @__PURE__ */ jsx119(Tooltip, { label: t("labels.sidebarLock"), children: /* @__PURE__ */ jsx119(
|
|
33946
34168
|
Button,
|
|
33947
34169
|
{
|
|
33948
34170
|
onSelect: () => props.onDock?.(!props.docked),
|
|
@@ -33953,7 +34175,7 @@ var SidebarHeader = ({
|
|
|
33953
34175
|
children: PinIcon
|
|
33954
34176
|
}
|
|
33955
34177
|
) }),
|
|
33956
|
-
/* @__PURE__ */
|
|
34178
|
+
/* @__PURE__ */ jsx119(
|
|
33957
34179
|
Button,
|
|
33958
34180
|
{
|
|
33959
34181
|
"data-testid": "sidebar-close",
|
|
@@ -33972,14 +34194,14 @@ SidebarHeader.displayName = "SidebarHeader";
|
|
|
33972
34194
|
|
|
33973
34195
|
// components/Sidebar/SidebarTabTrigger.tsx
|
|
33974
34196
|
import { Tabs as RadixTabs } from "radix-ui";
|
|
33975
|
-
import { jsx as
|
|
34197
|
+
import { jsx as jsx120 } from "react/jsx-runtime";
|
|
33976
34198
|
var SidebarTabTrigger = ({
|
|
33977
34199
|
children,
|
|
33978
34200
|
tab,
|
|
33979
34201
|
onSelect,
|
|
33980
34202
|
...rest
|
|
33981
34203
|
}) => {
|
|
33982
|
-
return /* @__PURE__ */
|
|
34204
|
+
return /* @__PURE__ */ jsx120(RadixTabs.Trigger, { value: tab, asChild: true, onSelect, children: /* @__PURE__ */ jsx120(
|
|
33983
34205
|
"button",
|
|
33984
34206
|
{
|
|
33985
34207
|
type: "button",
|
|
@@ -33993,18 +34215,18 @@ SidebarTabTrigger.displayName = "SidebarTabTrigger";
|
|
|
33993
34215
|
|
|
33994
34216
|
// components/Sidebar/SidebarTabTriggers.tsx
|
|
33995
34217
|
import { Tabs as RadixTabs2 } from "radix-ui";
|
|
33996
|
-
import { jsx as
|
|
34218
|
+
import { jsx as jsx121 } from "react/jsx-runtime";
|
|
33997
34219
|
var SidebarTabTriggers = ({
|
|
33998
34220
|
children,
|
|
33999
34221
|
...rest
|
|
34000
34222
|
}) => {
|
|
34001
|
-
return /* @__PURE__ */
|
|
34223
|
+
return /* @__PURE__ */ jsx121(RadixTabs2.List, { className: "sidebar-triggers", ...rest, children });
|
|
34002
34224
|
};
|
|
34003
34225
|
SidebarTabTriggers.displayName = "SidebarTabTriggers";
|
|
34004
34226
|
|
|
34005
34227
|
// components/Sidebar/SidebarTrigger.tsx
|
|
34006
|
-
import
|
|
34007
|
-
import { jsx as
|
|
34228
|
+
import clsx54 from "clsx";
|
|
34229
|
+
import { jsx as jsx122, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
34008
34230
|
var SidebarTrigger = ({
|
|
34009
34231
|
name,
|
|
34010
34232
|
tab,
|
|
@@ -34018,7 +34240,7 @@ var SidebarTrigger = ({
|
|
|
34018
34240
|
const setAppState = useExcalidrawSetAppState();
|
|
34019
34241
|
const appState = useUIAppState();
|
|
34020
34242
|
const isOpen = appState.openSidebar?.name === name;
|
|
34021
|
-
return /* @__PURE__ */
|
|
34243
|
+
return /* @__PURE__ */ jsx122(
|
|
34022
34244
|
"button",
|
|
34023
34245
|
{
|
|
34024
34246
|
type: "button",
|
|
@@ -34037,9 +34259,9 @@ var SidebarTrigger = ({
|
|
|
34037
34259
|
});
|
|
34038
34260
|
onToggle?.(nextOpen);
|
|
34039
34261
|
},
|
|
34040
|
-
children: /* @__PURE__ */ jsxs65("div", { className:
|
|
34041
|
-
icon && /* @__PURE__ */
|
|
34042
|
-
children && /* @__PURE__ */
|
|
34262
|
+
children: /* @__PURE__ */ jsxs65("div", { className: clsx54("sidebar-trigger", className), style, children: [
|
|
34263
|
+
icon && /* @__PURE__ */ jsx122("div", { children: icon }),
|
|
34264
|
+
children && /* @__PURE__ */ jsx122("div", { className: "sidebar-trigger__label", children })
|
|
34043
34265
|
] })
|
|
34044
34266
|
}
|
|
34045
34267
|
);
|
|
@@ -34048,7 +34270,7 @@ SidebarTrigger.displayName = "SidebarTrigger";
|
|
|
34048
34270
|
|
|
34049
34271
|
// components/Sidebar/SidebarTabs.tsx
|
|
34050
34272
|
import { Tabs as RadixTabs3 } from "radix-ui";
|
|
34051
|
-
import { jsx as
|
|
34273
|
+
import { jsx as jsx123 } from "react/jsx-runtime";
|
|
34052
34274
|
var SidebarTabs = ({
|
|
34053
34275
|
children,
|
|
34054
34276
|
...rest
|
|
@@ -34059,7 +34281,7 @@ var SidebarTabs = ({
|
|
|
34059
34281
|
return null;
|
|
34060
34282
|
}
|
|
34061
34283
|
const { name } = appState.openSidebar;
|
|
34062
|
-
return /* @__PURE__ */
|
|
34284
|
+
return /* @__PURE__ */ jsx123(
|
|
34063
34285
|
RadixTabs3.Root,
|
|
34064
34286
|
{
|
|
34065
34287
|
className: "sidebar-tabs-root",
|
|
@@ -34077,18 +34299,18 @@ SidebarTabs.displayName = "SidebarTabs";
|
|
|
34077
34299
|
|
|
34078
34300
|
// components/Sidebar/SidebarTab.tsx
|
|
34079
34301
|
import { Tabs as RadixTabs4 } from "radix-ui";
|
|
34080
|
-
import { jsx as
|
|
34302
|
+
import { jsx as jsx124 } from "react/jsx-runtime";
|
|
34081
34303
|
var SidebarTab = ({
|
|
34082
34304
|
tab,
|
|
34083
34305
|
children,
|
|
34084
34306
|
...rest
|
|
34085
34307
|
}) => {
|
|
34086
|
-
return /* @__PURE__ */
|
|
34308
|
+
return /* @__PURE__ */ jsx124(RadixTabs4.Content, { ...rest, value: tab, "data-testid": tab, children });
|
|
34087
34309
|
};
|
|
34088
34310
|
SidebarTab.displayName = "SidebarTab";
|
|
34089
34311
|
|
|
34090
34312
|
// components/Sidebar/Sidebar.tsx
|
|
34091
|
-
import { jsx as
|
|
34313
|
+
import { jsx as jsx125 } from "react/jsx-runtime";
|
|
34092
34314
|
import { createElement } from "react";
|
|
34093
34315
|
var isSidebarDockedAtom = atom(false);
|
|
34094
34316
|
var SidebarInner = forwardRef5(
|
|
@@ -34162,11 +34384,11 @@ var SidebarInner = forwardRef5(
|
|
|
34162
34384
|
document.removeEventListener(EVENT9.KEYDOWN, handleKeyDown);
|
|
34163
34385
|
};
|
|
34164
34386
|
}, [closeSidebar, docked, editorInterface.canFitSidebar]);
|
|
34165
|
-
return /* @__PURE__ */
|
|
34387
|
+
return /* @__PURE__ */ jsx125(
|
|
34166
34388
|
Island,
|
|
34167
34389
|
{
|
|
34168
34390
|
...rest,
|
|
34169
|
-
className:
|
|
34391
|
+
className: clsx55(
|
|
34170
34392
|
CLASSES8.SIDEBAR,
|
|
34171
34393
|
{ "sidebar--docked": docked },
|
|
34172
34394
|
className
|
|
@@ -34174,7 +34396,7 @@ var SidebarInner = forwardRef5(
|
|
|
34174
34396
|
"data-viewport-ui": editorInterface.formFactor !== "phone" ? "side" : void 0,
|
|
34175
34397
|
"data-viewport-ui-name": editorInterface.formFactor !== "phone" ? "sidebar" : void 0,
|
|
34176
34398
|
ref: islandRef,
|
|
34177
|
-
children: /* @__PURE__ */
|
|
34399
|
+
children: /* @__PURE__ */ jsx125(SidebarPropsContext.Provider, { value: headerPropsRef.current, children })
|
|
34178
34400
|
}
|
|
34179
34401
|
);
|
|
34180
34402
|
}
|
|
@@ -34221,18 +34443,18 @@ var Sidebar = Object.assign(
|
|
|
34221
34443
|
Sidebar.displayName = "Sidebar";
|
|
34222
34444
|
|
|
34223
34445
|
// components/DefaultSidebar.tsx
|
|
34224
|
-
import { jsx as
|
|
34446
|
+
import { jsx as jsx126, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
34225
34447
|
import { createElement as createElement2 } from "react";
|
|
34226
34448
|
var DefaultSidebarTrigger = withInternalFallback(
|
|
34227
34449
|
"DefaultSidebarTrigger",
|
|
34228
34450
|
(props) => {
|
|
34229
34451
|
const { DefaultSidebarTriggerTunnel } = useTunnels();
|
|
34230
|
-
return /* @__PURE__ */
|
|
34452
|
+
return /* @__PURE__ */ jsx126(DefaultSidebarTriggerTunnel.In, { children: /* @__PURE__ */ jsx126(
|
|
34231
34453
|
Sidebar.Trigger,
|
|
34232
34454
|
{
|
|
34233
34455
|
...props,
|
|
34234
34456
|
className: "default-sidebar-trigger",
|
|
34235
|
-
name:
|
|
34457
|
+
name: DEFAULT_SIDEBAR3.name
|
|
34236
34458
|
}
|
|
34237
34459
|
) });
|
|
34238
34460
|
}
|
|
@@ -34240,7 +34462,7 @@ var DefaultSidebarTrigger = withInternalFallback(
|
|
|
34240
34462
|
DefaultSidebarTrigger.displayName = "DefaultSidebarTrigger";
|
|
34241
34463
|
var DefaultTabTriggers = ({ children }) => {
|
|
34242
34464
|
const { DefaultSidebarTabTriggersTunnel } = useTunnels();
|
|
34243
|
-
return /* @__PURE__ */
|
|
34465
|
+
return /* @__PURE__ */ jsx126(DefaultSidebarTabTriggersTunnel.In, { children });
|
|
34244
34466
|
};
|
|
34245
34467
|
DefaultTabTriggers.displayName = "DefaultTabTriggers";
|
|
34246
34468
|
var DefaultSidebar = Object.assign(
|
|
@@ -34255,7 +34477,7 @@ var DefaultSidebar = Object.assign(
|
|
|
34255
34477
|
}) => {
|
|
34256
34478
|
const appState = useUIAppState();
|
|
34257
34479
|
const setAppState = useExcalidrawSetAppState();
|
|
34258
|
-
const isSearchSidebar = appState.openSidebar?.tab ===
|
|
34480
|
+
const isSearchSidebar = appState.openSidebar?.tab === CANVAS_SEARCH_TAB3;
|
|
34259
34481
|
const isDocked = isSearchSidebar ? false : docked ?? appState.defaultSidebarDockedPreference;
|
|
34260
34482
|
const canDock = !isSearchSidebar && docked == null && onDock !== false;
|
|
34261
34483
|
return /* @__PURE__ */ createElement2(
|
|
@@ -34264,7 +34486,7 @@ var DefaultSidebar = Object.assign(
|
|
|
34264
34486
|
...rest,
|
|
34265
34487
|
name: "default",
|
|
34266
34488
|
key: "default",
|
|
34267
|
-
className:
|
|
34489
|
+
className: clsx56(
|
|
34268
34490
|
"default-sidebar",
|
|
34269
34491
|
{ "default-sidebar--search-only": isSearchSidebar },
|
|
34270
34492
|
className
|
|
@@ -34278,8 +34500,8 @@ var DefaultSidebar = Object.assign(
|
|
|
34278
34500
|
} : void 0
|
|
34279
34501
|
},
|
|
34280
34502
|
/* @__PURE__ */ jsxs66(Sidebar.Tabs, { children: [
|
|
34281
|
-
!isSearchSidebar && /* @__PURE__ */
|
|
34282
|
-
/* @__PURE__ */
|
|
34503
|
+
!isSearchSidebar && /* @__PURE__ */ jsx126(Sidebar.Header, {}),
|
|
34504
|
+
/* @__PURE__ */ jsx126(Sidebar.Tab, { tab: CANVAS_SEARCH_TAB3, children: /* @__PURE__ */ jsx126(SearchMenu2, {}) }),
|
|
34283
34505
|
!isSearchSidebar && children
|
|
34284
34506
|
] })
|
|
34285
34507
|
);
|
|
@@ -34296,7 +34518,7 @@ import React37 from "react";
|
|
|
34296
34518
|
import { getFrame } from "@excalidraw/common";
|
|
34297
34519
|
|
|
34298
34520
|
// components/Card.tsx
|
|
34299
|
-
import { jsx as
|
|
34521
|
+
import { jsx as jsx127 } from "react/jsx-runtime";
|
|
34300
34522
|
var COLOR_MAP = {
|
|
34301
34523
|
primary: {
|
|
34302
34524
|
base: "var(--color-primary)",
|
|
@@ -34321,7 +34543,7 @@ var COLOR_MAP = {
|
|
|
34321
34543
|
}
|
|
34322
34544
|
};
|
|
34323
34545
|
var Card = ({ children, color }) => {
|
|
34324
|
-
return /* @__PURE__ */
|
|
34546
|
+
return /* @__PURE__ */ jsx127(
|
|
34325
34547
|
"div",
|
|
34326
34548
|
{
|
|
34327
34549
|
className: "Card",
|
|
@@ -34336,7 +34558,7 @@ var Card = ({ children, color }) => {
|
|
|
34336
34558
|
};
|
|
34337
34559
|
|
|
34338
34560
|
// components/JSONExportDialog.tsx
|
|
34339
|
-
import { Fragment as Fragment23, jsx as
|
|
34561
|
+
import { Fragment as Fragment23, jsx as jsx128, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
34340
34562
|
var JSONExportModal = ({
|
|
34341
34563
|
elements,
|
|
34342
34564
|
appState,
|
|
@@ -34348,15 +34570,15 @@ var JSONExportModal = ({
|
|
|
34348
34570
|
onCloseRequest
|
|
34349
34571
|
}) => {
|
|
34350
34572
|
const { onExportToBackend } = exportOpts;
|
|
34351
|
-
return /* @__PURE__ */
|
|
34573
|
+
return /* @__PURE__ */ jsx128("div", { className: "ExportDialog ExportDialog--json", children: /* @__PURE__ */ jsxs67("div", { className: "ExportDialog-cards", children: [
|
|
34352
34574
|
exportOpts.saveFileToDisk && /* @__PURE__ */ jsxs67(Card, { color: "lime", children: [
|
|
34353
|
-
/* @__PURE__ */
|
|
34354
|
-
/* @__PURE__ */
|
|
34575
|
+
/* @__PURE__ */ jsx128("div", { className: "Card-icon", children: exportToFileIcon }),
|
|
34576
|
+
/* @__PURE__ */ jsx128("h2", { children: t("exportDialog.disk_title") }),
|
|
34355
34577
|
/* @__PURE__ */ jsxs67("div", { className: "Card-details", children: [
|
|
34356
34578
|
t("exportDialog.disk_details"),
|
|
34357
34579
|
!nativeFileSystemSupported && actionManager.renderAction("changeProjectName")
|
|
34358
34580
|
] }),
|
|
34359
|
-
/* @__PURE__ */
|
|
34581
|
+
/* @__PURE__ */ jsx128(
|
|
34360
34582
|
IconButton,
|
|
34361
34583
|
{
|
|
34362
34584
|
className: "Card-button",
|
|
@@ -34371,10 +34593,10 @@ var JSONExportModal = ({
|
|
|
34371
34593
|
)
|
|
34372
34594
|
] }),
|
|
34373
34595
|
onExportToBackend && /* @__PURE__ */ jsxs67(Card, { color: "pink", children: [
|
|
34374
|
-
/* @__PURE__ */
|
|
34375
|
-
/* @__PURE__ */
|
|
34376
|
-
/* @__PURE__ */
|
|
34377
|
-
/* @__PURE__ */
|
|
34596
|
+
/* @__PURE__ */ jsx128("div", { className: "Card-icon", children: LinkIcon }),
|
|
34597
|
+
/* @__PURE__ */ jsx128("h2", { children: t("exportDialog.link_title") }),
|
|
34598
|
+
/* @__PURE__ */ jsx128("div", { className: "Card-details", children: t("exportDialog.link_details") }),
|
|
34599
|
+
/* @__PURE__ */ jsx128(
|
|
34378
34600
|
IconButton,
|
|
34379
34601
|
{
|
|
34380
34602
|
className: "Card-button",
|
|
@@ -34409,7 +34631,7 @@ var JSONExportDialog = ({
|
|
|
34409
34631
|
const handleClose = React37.useCallback(() => {
|
|
34410
34632
|
setAppState({ openDialog: null });
|
|
34411
34633
|
}, [setAppState]);
|
|
34412
|
-
return /* @__PURE__ */
|
|
34634
|
+
return /* @__PURE__ */ jsx128(Fragment23, { children: appState.openDialog?.name === "jsonExport" && /* @__PURE__ */ jsx128(Dialog, { onCloseRequest: handleClose, title: t("buttons.export"), children: /* @__PURE__ */ jsx128(
|
|
34413
34635
|
JSONExportModal,
|
|
34414
34636
|
{
|
|
34415
34637
|
elements,
|
|
@@ -34425,13 +34647,13 @@ var JSONExportDialog = ({
|
|
|
34425
34647
|
};
|
|
34426
34648
|
|
|
34427
34649
|
// components/LaserPointerButton.tsx
|
|
34428
|
-
import
|
|
34429
|
-
import { jsx as
|
|
34650
|
+
import clsx57 from "clsx";
|
|
34651
|
+
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
34430
34652
|
var LaserPointerButton = (props) => {
|
|
34431
|
-
return /* @__PURE__ */
|
|
34653
|
+
return /* @__PURE__ */ jsx129(
|
|
34432
34654
|
IconButton,
|
|
34433
34655
|
{
|
|
34434
|
-
className:
|
|
34656
|
+
className: clsx57("ToolIcon__LaserPointer", {
|
|
34435
34657
|
"is-mobile": props.isMobile
|
|
34436
34658
|
}),
|
|
34437
34659
|
type: "toggle",
|
|
@@ -34447,214 +34669,18 @@ var LaserPointerButton = (props) => {
|
|
|
34447
34669
|
};
|
|
34448
34670
|
|
|
34449
34671
|
// components/Toolbar.tsx
|
|
34450
|
-
import
|
|
34672
|
+
import clsx59 from "clsx";
|
|
34451
34673
|
import { useState as useState33 } from "react";
|
|
34452
34674
|
import { CANVAS_SEARCH_TAB as CANVAS_SEARCH_TAB4, DEFAULT_SIDEBAR as DEFAULT_SIDEBAR4, KEYS as KEYS52 } from "@excalidraw/common";
|
|
34453
34675
|
|
|
34454
|
-
// components/HintViewer.tsx
|
|
34455
|
-
import { CANVAS_SEARCH_TAB as CANVAS_SEARCH_TAB3, DEFAULT_SIDEBAR as DEFAULT_SIDEBAR3 } from "@excalidraw/common";
|
|
34456
|
-
import {
|
|
34457
|
-
isArrowElement as isArrowElement14,
|
|
34458
|
-
isFlowchartNodeElement as isFlowchartNodeElement3,
|
|
34459
|
-
isImageElement as isImageElement8,
|
|
34460
|
-
isLinearElement as isLinearElement10,
|
|
34461
|
-
isLineElement as isLineElement8,
|
|
34462
|
-
isTextBindableContainer as isTextBindableContainer2,
|
|
34463
|
-
isTextElement as isTextElement17
|
|
34464
|
-
} from "@excalidraw/element";
|
|
34465
|
-
import { isNodeInFlowchart } from "@excalidraw/element";
|
|
34466
|
-
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
34467
|
-
var getTaggedShortcutKey = (key) => Array.isArray(key) ? `<kbd>${key.map(getShortcutKey).join(" + ")}</kbd>` : `<kbd>${getShortcutKey(key)}</kbd>`;
|
|
34468
|
-
var getHints = ({
|
|
34469
|
-
appState,
|
|
34470
|
-
isMobile,
|
|
34471
|
-
editorInterface,
|
|
34472
|
-
app
|
|
34473
|
-
}) => {
|
|
34474
|
-
const { activeTool, isResizing, isRotating, lastPointerDownWith } = appState;
|
|
34475
|
-
const multiMode = appState.multiElement !== null;
|
|
34476
|
-
if (appState.openSidebar?.name === DEFAULT_SIDEBAR3.name && appState.openSidebar.tab === CANVAS_SEARCH_TAB3 && appState.searchMatches?.matches.length) {
|
|
34477
|
-
return t("hints.dismissSearch", {
|
|
34478
|
-
shortcut: getTaggedShortcutKey("Escape")
|
|
34479
|
-
});
|
|
34480
|
-
}
|
|
34481
|
-
if (appState.openSidebar && !editorInterface.canFitSidebar) {
|
|
34482
|
-
return null;
|
|
34483
|
-
}
|
|
34484
|
-
if (isEraserActive(appState)) {
|
|
34485
|
-
return t("hints.eraserRevert", {
|
|
34486
|
-
shortcut: getTaggedShortcutKey("Alt")
|
|
34487
|
-
});
|
|
34488
|
-
}
|
|
34489
|
-
const selectedElements = app.scene.getSelectedElements(appState);
|
|
34490
|
-
if (appState.selectedLinearElement?.isDragging && selectedElements[0]?.type === "arrow") {
|
|
34491
|
-
return t("hints.arrowBindModifiers", {
|
|
34492
|
-
shortcut_1: getTaggedShortcutKey("Ctrl"),
|
|
34493
|
-
shortcut_2: getTaggedShortcutKey("Alt")
|
|
34494
|
-
});
|
|
34495
|
-
}
|
|
34496
|
-
if (activeTool.type === "arrow" || activeTool.type === "line") {
|
|
34497
|
-
if (multiMode) {
|
|
34498
|
-
return t("hints.linearElementMulti", {
|
|
34499
|
-
shortcut_1: getTaggedShortcutKey("Escape"),
|
|
34500
|
-
shortcut_2: getTaggedShortcutKey("Enter")
|
|
34501
|
-
});
|
|
34502
|
-
}
|
|
34503
|
-
if (activeTool.type === "arrow") {
|
|
34504
|
-
return t("hints.arrowTool", {
|
|
34505
|
-
shortcut: getTaggedShortcutKey("A")
|
|
34506
|
-
});
|
|
34507
|
-
}
|
|
34508
|
-
return t("hints.linearElement");
|
|
34509
|
-
}
|
|
34510
|
-
if (activeTool.type === "freedraw") {
|
|
34511
|
-
return t("hints.freeDraw");
|
|
34512
|
-
}
|
|
34513
|
-
if (activeTool.type === "text") {
|
|
34514
|
-
return t("hints.text");
|
|
34515
|
-
}
|
|
34516
|
-
if (activeTool.type === "embeddable") {
|
|
34517
|
-
return t("hints.embeddable");
|
|
34518
|
-
}
|
|
34519
|
-
if (activeTool.type === "autoshape") {
|
|
34520
|
-
return t("hints.autoshape");
|
|
34521
|
-
}
|
|
34522
|
-
if (isResizing && lastPointerDownWith === "mouse" && selectedElements.length === 1) {
|
|
34523
|
-
const targetElement = selectedElements[0];
|
|
34524
|
-
if (isLinearElement10(targetElement) && targetElement.points.length === 2) {
|
|
34525
|
-
return t("hints.lockAngle", {
|
|
34526
|
-
shortcut: getTaggedShortcutKey("Shift")
|
|
34527
|
-
});
|
|
34528
|
-
}
|
|
34529
|
-
return isImageElement8(targetElement) ? t("hints.resizeImage", {
|
|
34530
|
-
shortcut_1: getTaggedShortcutKey("Shift"),
|
|
34531
|
-
shortcut_2: getTaggedShortcutKey("Alt")
|
|
34532
|
-
}) : t("hints.resize", {
|
|
34533
|
-
shortcut_1: getTaggedShortcutKey("Shift"),
|
|
34534
|
-
shortcut_2: getTaggedShortcutKey("Alt")
|
|
34535
|
-
});
|
|
34536
|
-
}
|
|
34537
|
-
if (isRotating && lastPointerDownWith === "mouse") {
|
|
34538
|
-
return t("hints.rotate", {
|
|
34539
|
-
shortcut: getTaggedShortcutKey("Shift")
|
|
34540
|
-
});
|
|
34541
|
-
}
|
|
34542
|
-
if (selectedElements.length === 1 && isTextElement17(selectedElements[0])) {
|
|
34543
|
-
return t("hints.text_selected", {
|
|
34544
|
-
shortcut: getTaggedShortcutKey("Enter")
|
|
34545
|
-
});
|
|
34546
|
-
}
|
|
34547
|
-
if (appState.editingTextElement) {
|
|
34548
|
-
return t("hints.text_editing", {
|
|
34549
|
-
shortcut_1: getTaggedShortcutKey("Escape"),
|
|
34550
|
-
shortcut_2: getTaggedShortcutKey(["CtrlOrCmd", "Enter"])
|
|
34551
|
-
});
|
|
34552
|
-
}
|
|
34553
|
-
if (appState.croppingElementId) {
|
|
34554
|
-
return t("hints.leaveCropEditor", {
|
|
34555
|
-
shortcut_1: getTaggedShortcutKey("Enter"),
|
|
34556
|
-
shortcut_2: getTaggedShortcutKey("Escape")
|
|
34557
|
-
});
|
|
34558
|
-
}
|
|
34559
|
-
if (selectedElements.length === 1 && isImageElement8(selectedElements[0])) {
|
|
34560
|
-
return t("hints.enterCropEditor", {
|
|
34561
|
-
shortcut: getTaggedShortcutKey("Enter")
|
|
34562
|
-
});
|
|
34563
|
-
}
|
|
34564
|
-
if (activeTool.type === "selection") {
|
|
34565
|
-
if (appState.selectionElement && !selectedElements.length && !appState.editingTextElement && !appState.selectedLinearElement?.isEditing) {
|
|
34566
|
-
return t("hints.deepBoxSelect", {
|
|
34567
|
-
shortcut: getTaggedShortcutKey("CtrlOrCmd")
|
|
34568
|
-
});
|
|
34569
|
-
}
|
|
34570
|
-
if (isGridModeEnabled(app) && appState.selectedElementsAreBeingDragged) {
|
|
34571
|
-
return t("hints.disableSnapping", {
|
|
34572
|
-
shortcut: getTaggedShortcutKey("CtrlOrCmd")
|
|
34573
|
-
});
|
|
34574
|
-
}
|
|
34575
|
-
if (!selectedElements.length && !isMobile) {
|
|
34576
|
-
return t("hints.canvasPanning", {
|
|
34577
|
-
shortcut_1: getTaggedShortcutKey(t("keys.mmb")),
|
|
34578
|
-
shortcut_2: getTaggedShortcutKey("Space")
|
|
34579
|
-
});
|
|
34580
|
-
}
|
|
34581
|
-
if (selectedElements.length === 1) {
|
|
34582
|
-
if (isLinearElement10(selectedElements[0])) {
|
|
34583
|
-
if (isArrowElement14(selectedElements[0]) && appState.selectedLinearElement?.elementId === selectedElements[0].id && (appState.selectedLinearElement.hoverPointIndex === 0 || appState.selectedLinearElement.hoverPointIndex === selectedElements[0].points.length - 1)) {
|
|
34584
|
-
return t("hints.toggleArrowhead");
|
|
34585
|
-
}
|
|
34586
|
-
if (appState.selectedLinearElement?.isEditing) {
|
|
34587
|
-
return appState.selectedLinearElement.selectedPointsIndices ? t("hints.lineEditor_pointSelected", {
|
|
34588
|
-
shortcut_1: getTaggedShortcutKey("Delete"),
|
|
34589
|
-
shortcut_2: getTaggedShortcutKey(["CtrlOrCmd", "D"])
|
|
34590
|
-
}) : t("hints.lineEditor_nothingSelected", {
|
|
34591
|
-
shortcut_1: getTaggedShortcutKey("Shift"),
|
|
34592
|
-
shortcut_2: getTaggedShortcutKey("Alt")
|
|
34593
|
-
});
|
|
34594
|
-
}
|
|
34595
|
-
return isLineElement8(selectedElements[0]) ? t("hints.lineEditor_line_info", {
|
|
34596
|
-
shortcut: getTaggedShortcutKey("Enter")
|
|
34597
|
-
}) : t("hints.lineEditor_info", {
|
|
34598
|
-
shortcut_1: getTaggedShortcutKey("CtrlOrCmd"),
|
|
34599
|
-
shortcut_2: getTaggedShortcutKey(["CtrlOrCmd", "Enter"])
|
|
34600
|
-
});
|
|
34601
|
-
}
|
|
34602
|
-
if (!appState.newElement && !appState.selectedElementsAreBeingDragged && isTextBindableContainer2(selectedElements[0])) {
|
|
34603
|
-
const bindTextToElement = t("hints.bindTextToElement", {
|
|
34604
|
-
shortcut: getTaggedShortcutKey("Enter")
|
|
34605
|
-
});
|
|
34606
|
-
const createFlowchart = t("hints.createFlowchart", {
|
|
34607
|
-
shortcut: getTaggedShortcutKey(["CtrlOrCmd", "\u2191\u2193"])
|
|
34608
|
-
});
|
|
34609
|
-
if (isFlowchartNodeElement3(selectedElements[0])) {
|
|
34610
|
-
if (isNodeInFlowchart(
|
|
34611
|
-
selectedElements[0],
|
|
34612
|
-
app.scene.getNonDeletedElementsMap()
|
|
34613
|
-
)) {
|
|
34614
|
-
return [bindTextToElement, createFlowchart];
|
|
34615
|
-
}
|
|
34616
|
-
return [bindTextToElement, createFlowchart];
|
|
34617
|
-
}
|
|
34618
|
-
return bindTextToElement;
|
|
34619
|
-
}
|
|
34620
|
-
}
|
|
34621
|
-
}
|
|
34622
|
-
return null;
|
|
34623
|
-
};
|
|
34624
|
-
var HintViewer = ({
|
|
34625
|
-
appState,
|
|
34626
|
-
isMobile,
|
|
34627
|
-
editorInterface,
|
|
34628
|
-
app
|
|
34629
|
-
}) => {
|
|
34630
|
-
const hints = getHints({
|
|
34631
|
-
appState,
|
|
34632
|
-
isMobile,
|
|
34633
|
-
editorInterface,
|
|
34634
|
-
app
|
|
34635
|
-
});
|
|
34636
|
-
if (!hints) {
|
|
34637
|
-
return null;
|
|
34638
|
-
}
|
|
34639
|
-
const hint = Array.isArray(hints) ? hints.map((hint2) => hint2.replace(/\. ?$/, "")).join(", ") : hints;
|
|
34640
|
-
const hintJSX = hint.split(/(<kbd>[^<]+<\/kbd>)/g).map((part, index) => {
|
|
34641
|
-
if (index % 2 === 1) {
|
|
34642
|
-
const shortcutMatch = part[0] === "<" && part.match(/^<kbd>([^<]+)<\/kbd>$/);
|
|
34643
|
-
return /* @__PURE__ */ jsx129("kbd", { children: shortcutMatch ? shortcutMatch[1] : part }, index);
|
|
34644
|
-
}
|
|
34645
|
-
return part;
|
|
34646
|
-
});
|
|
34647
|
-
return /* @__PURE__ */ jsx129("div", { className: "HintViewer", children: /* @__PURE__ */ jsx129("span", { children: hintJSX }) });
|
|
34648
|
-
};
|
|
34649
|
-
|
|
34650
34676
|
// components/LockButton.tsx
|
|
34651
|
-
import
|
|
34677
|
+
import clsx58 from "clsx";
|
|
34652
34678
|
import { jsx as jsx130 } from "react/jsx-runtime";
|
|
34653
34679
|
var LockButton = (props) => {
|
|
34654
34680
|
return /* @__PURE__ */ jsx130(
|
|
34655
34681
|
IconButton,
|
|
34656
34682
|
{
|
|
34657
|
-
className:
|
|
34683
|
+
className: clsx58("ToolIcon__lock", { "is-mobile": props.isMobile }),
|
|
34658
34684
|
type: "toggle",
|
|
34659
34685
|
icon: props.checked ? LockedIcon : UnlockedIcon,
|
|
34660
34686
|
checked: props.checked,
|
|
@@ -34795,7 +34821,7 @@ var ExtraToolsDropdown = ({
|
|
|
34795
34821
|
/* @__PURE__ */ jsx131(
|
|
34796
34822
|
DropdownMenu_default.Trigger,
|
|
34797
34823
|
{
|
|
34798
|
-
className:
|
|
34824
|
+
className: clsx59("App-toolbar__extra-tools-trigger", {
|
|
34799
34825
|
"App-toolbar__extra-tools-trigger--selected": myocSimplifiedToolSelected || frameToolSelected || embeddableToolSelected || !isMyocSimplifiedMode && isFullStylesPanel && drawShapeToolSelected || lassoToolSelected || bucketFillToolSelected || // in collab we're already highlighting the laser button
|
|
34800
34826
|
// outside toolbar, so let's not highlight extra-tools button
|
|
34801
34827
|
// on top of it
|
|
@@ -34957,7 +34983,7 @@ var Toolbar = ({
|
|
|
34957
34983
|
Island,
|
|
34958
34984
|
{
|
|
34959
34985
|
padding: 1,
|
|
34960
|
-
className:
|
|
34986
|
+
className: clsx59("App-toolbar", {
|
|
34961
34987
|
"zen-mode": appState.zenModeEnabled,
|
|
34962
34988
|
"App-toolbar--compact": isCompactStylesPanel
|
|
34963
34989
|
}),
|
|
@@ -35153,13 +35179,13 @@ var LayerUI = ({
|
|
|
35153
35179
|
Section,
|
|
35154
35180
|
{
|
|
35155
35181
|
heading: "selectedShapeActions",
|
|
35156
|
-
className:
|
|
35182
|
+
className: clsx60("selected-shape-actions zen-mode-transition", {
|
|
35157
35183
|
"transition-left": appState.zenModeEnabled
|
|
35158
35184
|
}),
|
|
35159
35185
|
children: isCompactStylesPanel ? /* @__PURE__ */ jsx132(
|
|
35160
35186
|
Island,
|
|
35161
35187
|
{
|
|
35162
|
-
className:
|
|
35188
|
+
className: clsx60("compact-shape-actions-island"),
|
|
35163
35189
|
padding: 0,
|
|
35164
35190
|
"data-viewport-ui": "side",
|
|
35165
35191
|
"data-viewport-ui-name": "stylesPanel",
|
|
@@ -35213,13 +35239,13 @@ var LayerUI = ({
|
|
|
35213
35239
|
Stack_default.Col,
|
|
35214
35240
|
{
|
|
35215
35241
|
gap: spacing.menuTopGap,
|
|
35216
|
-
className:
|
|
35242
|
+
className: clsx60("App-menu_top__left"),
|
|
35217
35243
|
children: [
|
|
35218
35244
|
renderCanvasActions(),
|
|
35219
35245
|
defaultUIEnabled && /* @__PURE__ */ jsx132(
|
|
35220
35246
|
"div",
|
|
35221
35247
|
{
|
|
35222
|
-
className:
|
|
35248
|
+
className: clsx60("selected-shape-actions-container", {
|
|
35223
35249
|
"selected-shape-actions-container--compact": isCompactStylesPanel
|
|
35224
35250
|
}),
|
|
35225
35251
|
children: shouldRenderSelectedShapeActions && renderSelectedShapeActions()
|
|
@@ -35238,13 +35264,23 @@ var LayerUI = ({
|
|
|
35238
35264
|
]
|
|
35239
35265
|
}
|
|
35240
35266
|
),
|
|
35267
|
+
defaultUIEnabled && appState.viewModeEnabled && // MyOC: Keep the held-F Smart Zoom hint visible in view mode.
|
|
35268
|
+
/* @__PURE__ */ jsx132("div", { className: "view-mode-hint", children: /* @__PURE__ */ jsx132(
|
|
35269
|
+
HintViewer,
|
|
35270
|
+
{
|
|
35271
|
+
appState,
|
|
35272
|
+
isMobile: editorInterface.formFactor === "phone",
|
|
35273
|
+
editorInterface,
|
|
35274
|
+
app
|
|
35275
|
+
}
|
|
35276
|
+
) }),
|
|
35241
35277
|
defaultUIEnabled && !appState.viewModeEnabled && appState.openDialog?.name !== "elementLinkSelector" && /* @__PURE__ */ jsx132(Section, { heading: "shapes", className: "shapes-section", children: (heading) => /* @__PURE__ */ jsxs69("div", { style: { position: "relative" }, children: [
|
|
35242
35278
|
renderWelcomeScreen && /* @__PURE__ */ jsx132(tunnels.WelcomeScreenToolbarHintTunnel.Out, {}),
|
|
35243
35279
|
/* @__PURE__ */ jsx132(Stack_default.Col, { gap: spacing.toolbarColGap, align: "start", children: /* @__PURE__ */ jsxs69(
|
|
35244
35280
|
Stack_default.Row,
|
|
35245
35281
|
{
|
|
35246
35282
|
gap: spacing.toolbarRowGap,
|
|
35247
|
-
className:
|
|
35283
|
+
className: clsx60("App-toolbar-container", {
|
|
35248
35284
|
"zen-mode": appState.zenModeEnabled
|
|
35249
35285
|
}),
|
|
35250
35286
|
children: [
|
|
@@ -35287,7 +35323,7 @@ var LayerUI = ({
|
|
|
35287
35323
|
/* @__PURE__ */ jsxs69(
|
|
35288
35324
|
"div",
|
|
35289
35325
|
{
|
|
35290
|
-
className:
|
|
35326
|
+
className: clsx60(
|
|
35291
35327
|
"layer-ui__wrapper__top-right zen-mode-transition",
|
|
35292
35328
|
{
|
|
35293
35329
|
"transition-right": appState.zenModeEnabled,
|
|
@@ -35701,7 +35737,7 @@ var InteractiveCanvas = (props) => {
|
|
|
35701
35737
|
onPointerCancel: props.onPointerCancel,
|
|
35702
35738
|
onTouchMove: props.onTouchMove,
|
|
35703
35739
|
onPointerDown: props.onPointerDown,
|
|
35704
|
-
onDoubleClick: props.
|
|
35740
|
+
onDoubleClick: props.onDoubleClick,
|
|
35705
35741
|
children: t("labels.drawingCanvas")
|
|
35706
35742
|
}
|
|
35707
35743
|
);
|
|
@@ -36032,7 +36068,7 @@ var NewElementCanvas = (props) => {
|
|
|
36032
36068
|
var NewElementCanvas_default = NewElementCanvas;
|
|
36033
36069
|
|
|
36034
36070
|
// components/CursorHint.tsx
|
|
36035
|
-
import
|
|
36071
|
+
import clsx61 from "clsx";
|
|
36036
36072
|
import { useLayoutEffect as useLayoutEffect10, useEffect as useEffect38, useRef as useRef32, useState as useState34 } from "react";
|
|
36037
36073
|
import { ARROW_TYPE as ARROW_TYPE2, EVENT as EVENT10 } from "@excalidraw/common";
|
|
36038
36074
|
import { jsx as jsx137 } from "react/jsx-runtime";
|
|
@@ -36151,7 +36187,7 @@ var CursorHint = () => {
|
|
|
36151
36187
|
"div",
|
|
36152
36188
|
{
|
|
36153
36189
|
ref: hintRef,
|
|
36154
|
-
className:
|
|
36190
|
+
className: clsx61("CursorHint", {
|
|
36155
36191
|
"CursorHint--fade-out": isFadingOut
|
|
36156
36192
|
}),
|
|
36157
36193
|
"data-testid": "cursor-hint",
|
|
@@ -36410,6 +36446,7 @@ var touchTimeout = 0;
|
|
|
36410
36446
|
var invalidateContextMenu = false;
|
|
36411
36447
|
var YOUTUBE_VIDEO_STATES = /* @__PURE__ */ new Map();
|
|
36412
36448
|
var MAX_EMBEDDABLE_VIEWPORT_SCALE = 4;
|
|
36449
|
+
var SMART_ZOOM_KEY_RELEASE_TIMEOUT = 300;
|
|
36413
36450
|
var getViewpointAwareResizeCursor = (cursor, viewpointFlip) => {
|
|
36414
36451
|
if (viewpointFlip.horizontal === viewpointFlip.vertical) {
|
|
36415
36452
|
return cursor;
|
|
@@ -36509,6 +36546,10 @@ var App = class _App extends React41.Component {
|
|
|
36509
36546
|
/** current frame pointer cords */
|
|
36510
36547
|
__publicField(this, "lastPointerMoveCoords", null);
|
|
36511
36548
|
__publicField(this, "lastCompletedCanvasClicks", []);
|
|
36549
|
+
__publicField(this, "lastKeyboardSmartZoomImageId", null);
|
|
36550
|
+
// MyOC: State for the press-and-hold Smart Zoom interaction.
|
|
36551
|
+
__publicField(this, "smartZoomKeyDownAt", null);
|
|
36552
|
+
__publicField(this, "smartZoomKeyHitElement", false);
|
|
36512
36553
|
/** previous frame pointer coords */
|
|
36513
36554
|
__publicField(this, "previousPointerMoveCoords", null);
|
|
36514
36555
|
__publicField(this, "drawShape", new AppDrawShape(this));
|
|
@@ -36966,6 +37007,7 @@ var App = class _App extends React41.Component {
|
|
|
36966
37007
|
// Lifecycle
|
|
36967
37008
|
__publicField(this, "onBlur", withBatchedUpdates(() => {
|
|
36968
37009
|
isHoldingSpace = false;
|
|
37010
|
+
this.resetSmartZoomKey();
|
|
36969
37011
|
this.setState({
|
|
36970
37012
|
isBindingEnabled: this.state.bindingPreference === "enabled"
|
|
36971
37013
|
});
|
|
@@ -37030,6 +37072,7 @@ var App = class _App extends React41.Component {
|
|
|
37030
37072
|
this.maybeCleanupAfterMissingPointerUp(null);
|
|
37031
37073
|
isHoldingSpace = false;
|
|
37032
37074
|
isHoldingZ = false;
|
|
37075
|
+
this.resetSmartZoomKey();
|
|
37033
37076
|
isPanning = false;
|
|
37034
37077
|
isDraggingScrollBar = false;
|
|
37035
37078
|
lastPointerUp = null;
|
|
@@ -38108,7 +38151,76 @@ var App = class _App extends React41.Component {
|
|
|
38108
38151
|
this.viewport.lastPosition.y = event.clientY;
|
|
38109
38152
|
}
|
|
38110
38153
|
));
|
|
38111
|
-
//
|
|
38154
|
+
// MyOC Smart Zoom input handling: F is a hold gesture that can target the
|
|
38155
|
+
// item under the pointer, or zoom the complete scene on a quick release.
|
|
38156
|
+
__publicField(this, "isPlainSmartZoomKey", (event) => !event[KEYS53.CTRL_OR_CMD] && !event.shiftKey && !event.altKey && event.key.toLocaleLowerCase() === KEYS53.F);
|
|
38157
|
+
__publicField(this, "updateSmartZoomCursor", (scenePointer) => {
|
|
38158
|
+
if (this.smartZoomKeyDownAt === null) {
|
|
38159
|
+
return;
|
|
38160
|
+
}
|
|
38161
|
+
const hitElement = scenePointer ? this.getElementAtPosition(scenePointer.x, scenePointer.y, {
|
|
38162
|
+
includeLockedElements: true
|
|
38163
|
+
}) : null;
|
|
38164
|
+
this.cursor.set(hitElement ? CURSOR_TYPE2.POINTER : "zoom-in");
|
|
38165
|
+
});
|
|
38166
|
+
__publicField(this, "resetSmartZoomKey", () => {
|
|
38167
|
+
const wasHeld = this.smartZoomKeyDownAt !== null;
|
|
38168
|
+
this.smartZoomKeyDownAt = null;
|
|
38169
|
+
this.smartZoomKeyHitElement = false;
|
|
38170
|
+
if (wasHeld) {
|
|
38171
|
+
this.cursor.reset();
|
|
38172
|
+
this.updateEditorAtom(smartZoomKeyHeldAtom, false);
|
|
38173
|
+
}
|
|
38174
|
+
});
|
|
38175
|
+
__publicField(this, "handleSmartZoomKeyDown", (event) => {
|
|
38176
|
+
if (!this.isPlainSmartZoomKey(event)) {
|
|
38177
|
+
return false;
|
|
38178
|
+
}
|
|
38179
|
+
if (!event.repeat && this.smartZoomKeyDownAt === null) {
|
|
38180
|
+
this.smartZoomKeyDownAt = Date.now();
|
|
38181
|
+
this.smartZoomKeyHitElement = false;
|
|
38182
|
+
this.updateEditorAtom(smartZoomKeyHeldAtom, true);
|
|
38183
|
+
this.updateSmartZoomCursor(this.lastPointerMoveCoords);
|
|
38184
|
+
}
|
|
38185
|
+
event.preventDefault();
|
|
38186
|
+
event.stopPropagation();
|
|
38187
|
+
return true;
|
|
38188
|
+
});
|
|
38189
|
+
__publicField(this, "handleSmartZoomKeyUp", (event) => {
|
|
38190
|
+
if (event.key.toLocaleLowerCase() !== KEYS53.F || this.smartZoomKeyDownAt === null) {
|
|
38191
|
+
return false;
|
|
38192
|
+
}
|
|
38193
|
+
const elapsed = Date.now() - this.smartZoomKeyDownAt;
|
|
38194
|
+
const shouldZoomAllElements = !this.smartZoomKeyHitElement && elapsed <= SMART_ZOOM_KEY_RELEASE_TIMEOUT;
|
|
38195
|
+
this.resetSmartZoomKey();
|
|
38196
|
+
event.stopPropagation();
|
|
38197
|
+
if (shouldZoomAllElements) {
|
|
38198
|
+
this.actionManager.executeAction(
|
|
38199
|
+
actionSmartZoom,
|
|
38200
|
+
"keyboard",
|
|
38201
|
+
this.scene.getNonDeletedElements()
|
|
38202
|
+
);
|
|
38203
|
+
}
|
|
38204
|
+
return true;
|
|
38205
|
+
});
|
|
38206
|
+
__publicField(this, "handleSmartZoomPointerDown", (event, scenePointer) => {
|
|
38207
|
+
if (event.button !== POINTER_BUTTON2.MAIN || this.smartZoomKeyDownAt === null) {
|
|
38208
|
+
return false;
|
|
38209
|
+
}
|
|
38210
|
+
const hitElement = this.getElementAtPosition(
|
|
38211
|
+
scenePointer.x,
|
|
38212
|
+
scenePointer.y,
|
|
38213
|
+
{ includeLockedElements: true }
|
|
38214
|
+
);
|
|
38215
|
+
if (!hitElement) {
|
|
38216
|
+
return false;
|
|
38217
|
+
}
|
|
38218
|
+
this.smartZoomKeyHitElement = true;
|
|
38219
|
+
event.preventDefault();
|
|
38220
|
+
event.stopPropagation();
|
|
38221
|
+
this.actionManager.executeAction(actionSmartZoom, "keyboard", [hitElement]);
|
|
38222
|
+
return true;
|
|
38223
|
+
});
|
|
38112
38224
|
__publicField(this, "onKeyDown", withBatchedUpdates(
|
|
38113
38225
|
(event) => {
|
|
38114
38226
|
if (!this.isInteractionEnabled()) {
|
|
@@ -38138,10 +38250,28 @@ var App = class _App extends React41.Component {
|
|
|
38138
38250
|
this.scene.getNonDeletedElementsMap(),
|
|
38139
38251
|
this.state
|
|
38140
38252
|
);
|
|
38141
|
-
if (selectedElements.length === 1 &&
|
|
38253
|
+
if (selectedElements.length === 1 && isImageElement10(selectedElements[0]) && event.key === KEYS53.ENTER) {
|
|
38142
38254
|
this.startImageCropping(selectedElements[0]);
|
|
38143
38255
|
return;
|
|
38144
38256
|
}
|
|
38257
|
+
if (selectedElements.length === 0 && (event.key === KEYS53.ARROW_LEFT || event.key === KEYS53.ARROW_RIGHT) && !event[KEYS53.CTRL_OR_CMD] && !event.shiftKey && !event.altKey) {
|
|
38258
|
+
const elementsMap = this.scene.getNonDeletedElementsMap();
|
|
38259
|
+
const targetImage = getNextSmartZoomImage(
|
|
38260
|
+
this.scene.getNonDeletedElements(),
|
|
38261
|
+
elementsMap,
|
|
38262
|
+
this.lastKeyboardSmartZoomImageId,
|
|
38263
|
+
event.key === KEYS53.ARROW_RIGHT ? "next" : "previous"
|
|
38264
|
+
);
|
|
38265
|
+
if (targetImage) {
|
|
38266
|
+
this.lastKeyboardSmartZoomImageId = targetImage.id;
|
|
38267
|
+
this.actionManager.executeAction(actionSmartZoom, "keyboard", [
|
|
38268
|
+
targetImage
|
|
38269
|
+
]);
|
|
38270
|
+
event.preventDefault();
|
|
38271
|
+
event.stopPropagation();
|
|
38272
|
+
return;
|
|
38273
|
+
}
|
|
38274
|
+
}
|
|
38145
38275
|
if (event.key === KEYS53.ESCAPE) {
|
|
38146
38276
|
this.updateEditorAtom(convertElementTypePopupAtom, null);
|
|
38147
38277
|
} else if (event.key === KEYS53.TAB && (document.activeElement === this.excalidrawContainerRef?.current || document.activeElement?.classList.contains(
|
|
@@ -38216,6 +38346,9 @@ var App = class _App extends React41.Component {
|
|
|
38216
38346
|
maybeHandleArrowPointlikeDrag({ app: this, event });
|
|
38217
38347
|
}
|
|
38218
38348
|
}
|
|
38349
|
+
if (this.handleSmartZoomKeyDown(event)) {
|
|
38350
|
+
return;
|
|
38351
|
+
}
|
|
38219
38352
|
if (this.actionManager.handleKeyDown(event)) {
|
|
38220
38353
|
return;
|
|
38221
38354
|
}
|
|
@@ -38422,6 +38555,9 @@ var App = class _App extends React41.Component {
|
|
|
38422
38555
|
if (!this.isInteractionEnabled()) {
|
|
38423
38556
|
return;
|
|
38424
38557
|
}
|
|
38558
|
+
if (this.handleSmartZoomKeyUp(event)) {
|
|
38559
|
+
return;
|
|
38560
|
+
}
|
|
38425
38561
|
if (event.key === KEYS53.SPACE) {
|
|
38426
38562
|
if (this.state.viewModeEnabled && this.state.activeTool.type !== "laser" || this.state.openDialog?.name === "elementLinkSelector") {
|
|
38427
38563
|
this.cursor.set(CURSOR_TYPE2.GRAB);
|
|
@@ -38905,12 +39041,26 @@ var App = class _App extends React41.Component {
|
|
|
38905
39041
|
) <= DOUBLE_TAP_POSITION_THRESHOLD;
|
|
38906
39042
|
});
|
|
38907
39043
|
__publicField(this, "handleCanvasDoubleClick", (event) => {
|
|
38908
|
-
if (!this.isInteractionEnabled() || this.state.editingTextElement || !this.shouldHandleBrowserCanvasDoubleClick(event.type)) {
|
|
39044
|
+
if (!this.isInteractionEnabled() || this.state.editingTextElement || !this.state.viewModeEnabled && !this.shouldHandleBrowserCanvasDoubleClick(event.type)) {
|
|
38909
39045
|
return;
|
|
38910
39046
|
}
|
|
38911
39047
|
if (this.state.multiElement) {
|
|
38912
39048
|
return;
|
|
38913
39049
|
}
|
|
39050
|
+
if (this.state.viewModeEnabled) {
|
|
39051
|
+
const { x: sceneX2, y: sceneY2 } = viewportCoordsToSceneCoords3(
|
|
39052
|
+
event,
|
|
39053
|
+
this.state
|
|
39054
|
+
);
|
|
39055
|
+
const hitElement2 = this.getElementAtPosition(sceneX2, sceneY2, {
|
|
39056
|
+
includeLockedElements: true
|
|
39057
|
+
});
|
|
39058
|
+
if (hitElement2) {
|
|
39059
|
+
this.cursor.reset();
|
|
39060
|
+
this.actionManager.executeAction(actionSmartZoom, "ui", [hitElement2]);
|
|
39061
|
+
}
|
|
39062
|
+
return;
|
|
39063
|
+
}
|
|
38914
39064
|
if (this.state.activeTool.type !== this.state.preferredSelectionTool.type && this.state.activeTool.type !== "autoshape") {
|
|
38915
39065
|
return;
|
|
38916
39066
|
}
|
|
@@ -38979,15 +39129,18 @@ var App = class _App extends React41.Component {
|
|
|
38979
39129
|
return;
|
|
38980
39130
|
}
|
|
38981
39131
|
}
|
|
38982
|
-
|
|
38983
|
-
|
|
39132
|
+
const hitElement = this.getElementAtPosition(sceneX, sceneY, {
|
|
39133
|
+
includeLockedElements: true
|
|
39134
|
+
});
|
|
39135
|
+
if (hitElement && isImageElement10(hitElement)) {
|
|
39136
|
+
this.actionManager.executeAction(actionSmartZoom, "ui", [hitElement]);
|
|
38984
39137
|
return;
|
|
38985
39138
|
}
|
|
38986
39139
|
this.cursor.reset();
|
|
38987
39140
|
const selectedGroupIds = getSelectedGroupIds4(this.state);
|
|
38988
39141
|
if (selectedGroupIds.length > 0) {
|
|
38989
|
-
const
|
|
38990
|
-
const selectedGroupId =
|
|
39142
|
+
const hitElement2 = this.getElementAtPosition(sceneX, sceneY);
|
|
39143
|
+
const selectedGroupId = hitElement2 && getSelectedGroupIdForElement(hitElement2, this.state.selectedGroupIds);
|
|
38991
39144
|
if (selectedGroupId) {
|
|
38992
39145
|
this.store.scheduleCapture();
|
|
38993
39146
|
this.setState((prevState) => ({
|
|
@@ -38995,7 +39148,7 @@ var App = class _App extends React41.Component {
|
|
|
38995
39148
|
...selectGroupsForSelectedElements7(
|
|
38996
39149
|
{
|
|
38997
39150
|
editingGroupId: selectedGroupId,
|
|
38998
|
-
selectedElementIds: { [
|
|
39151
|
+
selectedElementIds: { [hitElement2.id]: true }
|
|
38999
39152
|
},
|
|
39000
39153
|
this.scene.getNonDeletedElements(),
|
|
39001
39154
|
prevState,
|
|
@@ -39007,14 +39160,20 @@ var App = class _App extends React41.Component {
|
|
|
39007
39160
|
}
|
|
39008
39161
|
this.cursor.reset();
|
|
39009
39162
|
if (!this.state.viewModeEnabled) {
|
|
39010
|
-
const
|
|
39011
|
-
if (isIframeLikeElement2(
|
|
39163
|
+
const hitElement2 = this.getElementAtPosition(sceneX, sceneY);
|
|
39164
|
+
if (isIframeLikeElement2(hitElement2)) {
|
|
39012
39165
|
this.setState({
|
|
39013
|
-
activeEmbeddable: { element:
|
|
39166
|
+
activeEmbeddable: { element: hitElement2, state: "active" }
|
|
39014
39167
|
});
|
|
39015
39168
|
return;
|
|
39016
39169
|
}
|
|
39017
39170
|
if (!this.state.selectedLinearElement?.isEditing) {
|
|
39171
|
+
const lockedElement = this.getElementAtPosition(sceneX, sceneY, {
|
|
39172
|
+
includeLockedElements: true
|
|
39173
|
+
});
|
|
39174
|
+
if (lockedElement?.locked) {
|
|
39175
|
+
return;
|
|
39176
|
+
}
|
|
39018
39177
|
const container = (
|
|
39019
39178
|
// skip binding to container on dblclick when holding ctrl
|
|
39020
39179
|
!event[KEYS53.CTRL_OR_CMD] && this.getTextBindableContainerAtPosition(sceneX, sceneY)
|
|
@@ -39057,7 +39216,28 @@ var App = class _App extends React41.Component {
|
|
|
39057
39216
|
this.lastCompletedCanvasClicks = [];
|
|
39058
39217
|
return;
|
|
39059
39218
|
}
|
|
39219
|
+
if (this.smartZoomKeyHitElement) {
|
|
39220
|
+
event.preventDefault();
|
|
39221
|
+
event.stopPropagation();
|
|
39222
|
+
return;
|
|
39223
|
+
}
|
|
39060
39224
|
const scenePointer = viewportCoordsToSceneCoords3(event, this.state);
|
|
39225
|
+
if (this.smartZoomKeyDownAt !== null && !this.smartZoomKeyHitElement) {
|
|
39226
|
+
const hitElement = this.getElementAtPosition(
|
|
39227
|
+
scenePointer.x,
|
|
39228
|
+
scenePointer.y,
|
|
39229
|
+
{ includeLockedElements: true }
|
|
39230
|
+
);
|
|
39231
|
+
if (hitElement) {
|
|
39232
|
+
this.smartZoomKeyHitElement = true;
|
|
39233
|
+
event.preventDefault();
|
|
39234
|
+
event.stopPropagation();
|
|
39235
|
+
this.actionManager.executeAction(actionSmartZoom, "keyboard", [
|
|
39236
|
+
hitElement
|
|
39237
|
+
]);
|
|
39238
|
+
return;
|
|
39239
|
+
}
|
|
39240
|
+
}
|
|
39061
39241
|
const imageStatusAction = this.getImageStatusActionAtPosition(scenePointer);
|
|
39062
39242
|
if (imageStatusAction) {
|
|
39063
39243
|
event.preventDefault();
|
|
@@ -39081,7 +39261,7 @@ var App = class _App extends React41.Component {
|
|
|
39081
39261
|
const elements = this.visibleElements.length ? this.visibleElements : this.scene.getNonDeletedElements();
|
|
39082
39262
|
for (let index = elements.length - 1; index >= 0; index--) {
|
|
39083
39263
|
const element = elements[index];
|
|
39084
|
-
if (!
|
|
39264
|
+
if (!isImageElement10(element) || !element.fileId) {
|
|
39085
39265
|
continue;
|
|
39086
39266
|
}
|
|
39087
39267
|
const imageStatus = this.imageStatus.get(element.fileId);
|
|
@@ -39848,6 +40028,10 @@ var App = class _App extends React41.Component {
|
|
|
39848
40028
|
hoveredElementIds: updateStable(prevState.hoveredElementIds, {})
|
|
39849
40029
|
}));
|
|
39850
40030
|
}
|
|
40031
|
+
this.updateSmartZoomCursor({
|
|
40032
|
+
x: scenePointerX,
|
|
40033
|
+
y: scenePointerY
|
|
40034
|
+
});
|
|
39851
40035
|
});
|
|
39852
40036
|
__publicField(this, "handleEraser", (event, scenePointer) => {
|
|
39853
40037
|
const elementsToErase = this.eraserTrail.addPointToPath(
|
|
@@ -39891,6 +40075,9 @@ var App = class _App extends React41.Component {
|
|
|
39891
40075
|
x: scenePointerX,
|
|
39892
40076
|
y: scenePointerY
|
|
39893
40077
|
};
|
|
40078
|
+
if (this.handleSmartZoomPointerDown(event, scenePointer)) {
|
|
40079
|
+
return;
|
|
40080
|
+
}
|
|
39894
40081
|
const target = event.target;
|
|
39895
40082
|
if (target.setPointerCapture) {
|
|
39896
40083
|
target.setPointerCapture(event.pointerId);
|
|
@@ -41951,7 +42138,7 @@ var App = class _App extends React41.Component {
|
|
|
41951
42138
|
y: gridY,
|
|
41952
42139
|
width: distance2(pointerDownState.originInGrid.x, gridX),
|
|
41953
42140
|
height: distance2(pointerDownState.originInGrid.y, gridY),
|
|
41954
|
-
shouldMaintainAspectRatio:
|
|
42141
|
+
shouldMaintainAspectRatio: isImageElement10(newElement9) ? !shouldMaintainAspectRatio(event) : shouldMaintainAspectRatio(event),
|
|
41955
42142
|
shouldResizeFromCenter: shouldResizeFromCenter(event),
|
|
41956
42143
|
zoom: this.state.zoom.value,
|
|
41957
42144
|
scene: this.scene,
|
|
@@ -41987,12 +42174,12 @@ var App = class _App extends React41.Component {
|
|
|
41987
42174
|
event[KEYS53.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
41988
42175
|
);
|
|
41989
42176
|
const croppingElement = this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);
|
|
41990
|
-
if (transformHandleType && croppingElement &&
|
|
42177
|
+
if (transformHandleType && croppingElement && isImageElement10(croppingElement)) {
|
|
41991
42178
|
const croppingAtStateStart = pointerDownState.originalElements.get(
|
|
41992
42179
|
croppingElement.id
|
|
41993
42180
|
);
|
|
41994
42181
|
const image = isInitializedImageElement5(croppingElement) && this.imageCache.get(croppingElement.fileId)?.image;
|
|
41995
|
-
if (croppingAtStateStart &&
|
|
42182
|
+
if (croppingAtStateStart && isImageElement10(croppingAtStateStart) && image && !(image instanceof Promise)) {
|
|
41996
42183
|
const [gridX, gridY] = getGridPoint4(
|
|
41997
42184
|
pointerCoords.x,
|
|
41998
42185
|
pointerCoords.y,
|
|
@@ -42106,7 +42293,7 @@ var App = class _App extends React41.Component {
|
|
|
42106
42293
|
this.scene,
|
|
42107
42294
|
shouldRotateWithDiscreteAngle4(event),
|
|
42108
42295
|
shouldResizeFromCenter(event),
|
|
42109
|
-
selectedElements.some((element) =>
|
|
42296
|
+
selectedElements.some((element) => isImageElement10(element)) ? !shouldMaintainAspectRatio(event) : shouldMaintainAspectRatio(event),
|
|
42110
42297
|
resizeX,
|
|
42111
42298
|
resizeY,
|
|
42112
42299
|
pointerDownState.resize.center.x,
|
|
@@ -42142,17 +42329,17 @@ var App = class _App extends React41.Component {
|
|
|
42142
42329
|
return [];
|
|
42143
42330
|
}
|
|
42144
42331
|
const selectedElements = this.scene.getSelectedElements(this.state);
|
|
42145
|
-
if (selectedElements.length > 0 && selectedElements.every((element) =>
|
|
42332
|
+
if (selectedElements.length > 0 && selectedElements.every((element) => isImageElement10(element)) && (!hitElement || this.state.selectedElementIds[hitElement.id])) {
|
|
42146
42333
|
return [...getHostItems(selectedElements.map((element) => element.id))];
|
|
42147
42334
|
}
|
|
42148
|
-
if (hitElement &&
|
|
42335
|
+
if (hitElement && isImageElement10(hitElement)) {
|
|
42149
42336
|
return [...getHostItems([hitElement.id])];
|
|
42150
42337
|
}
|
|
42151
42338
|
return [];
|
|
42152
42339
|
});
|
|
42153
42340
|
__publicField(this, "getImageActionContextMenuItems", (hitElement) => {
|
|
42154
42341
|
const selectedElements = this.scene.getSelectedElements(this.state);
|
|
42155
|
-
if (selectedElements.length > 0 && selectedElements.every((element) =>
|
|
42342
|
+
if (selectedElements.length > 0 && selectedElements.every((element) => isImageElement10(element)) && (!hitElement || this.state.selectedElementIds[hitElement.id])) {
|
|
42156
42343
|
return [actionArrangeElements, actionNormaliseElements];
|
|
42157
42344
|
}
|
|
42158
42345
|
return [];
|
|
@@ -42839,8 +43026,8 @@ var App = class _App extends React41.Component {
|
|
|
42839
43026
|
);
|
|
42840
43027
|
const startElement = startDragged2 ? hoveredElement : arrow.startBinding && elementsMap.get(arrow.startBinding.elementId);
|
|
42841
43028
|
const endElement = endDragged2 ? hoveredElement : arrow.endBinding && elementsMap.get(arrow.endBinding.elementId);
|
|
42842
|
-
const startBounds = startElement &&
|
|
42843
|
-
const endBounds = endElement &&
|
|
43029
|
+
const startBounds = startElement && getElementBounds5(startElement, elementsMap);
|
|
43030
|
+
const endBounds = endElement && getElementBounds5(endElement, elementsMap);
|
|
42844
43031
|
isOverlapping = !!(startBounds && endBounds && startElement.id !== endElement.id && doBoundsIntersect4(startBounds, endBounds));
|
|
42845
43032
|
}
|
|
42846
43033
|
const startDragged = this.state.selectedLinearElement?.selectedPointsIndices?.includes(0);
|
|
@@ -43047,7 +43234,7 @@ var App = class _App extends React41.Component {
|
|
|
43047
43234
|
return /* @__PURE__ */ jsx139(
|
|
43048
43235
|
"div",
|
|
43049
43236
|
{
|
|
43050
|
-
className:
|
|
43237
|
+
className: clsx62("excalidraw__embeddable-container", {
|
|
43051
43238
|
"is-hovered": isHovered
|
|
43052
43239
|
}),
|
|
43053
43240
|
style: {
|
|
@@ -43164,7 +43351,7 @@ var App = class _App extends React41.Component {
|
|
|
43164
43351
|
"div",
|
|
43165
43352
|
{
|
|
43166
43353
|
translate: "no",
|
|
43167
|
-
className:
|
|
43354
|
+
className: clsx62(
|
|
43168
43355
|
"excalidraw excalidraw-container notranslate",
|
|
43169
43356
|
this.props.className,
|
|
43170
43357
|
{
|
|
@@ -44927,7 +45114,7 @@ var App = class _App extends React41.Component {
|
|
|
44927
45114
|
}
|
|
44928
45115
|
if (this.state.croppingElementId) {
|
|
44929
45116
|
const croppingElement = this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);
|
|
44930
|
-
if (croppingElement &&
|
|
45117
|
+
if (croppingElement && isImageElement10(croppingElement) && croppingElement.crop !== null && pointerDownState.hit.element === croppingElement) {
|
|
44931
45118
|
const crop = croppingElement.crop;
|
|
44932
45119
|
const image = isInitializedImageElement5(croppingElement) && this.imageCache.get(croppingElement.fileId)?.image;
|
|
44933
45120
|
if (image && !(image instanceof Promise)) {
|
|
@@ -46165,7 +46352,7 @@ var InitializeApp = (props) => {
|
|
|
46165
46352
|
};
|
|
46166
46353
|
|
|
46167
46354
|
// components/footer/FooterCenter.tsx
|
|
46168
|
-
import
|
|
46355
|
+
import clsx63 from "clsx";
|
|
46169
46356
|
import { jsx as jsx141 } from "react/jsx-runtime";
|
|
46170
46357
|
var FooterCenter = ({ children }) => {
|
|
46171
46358
|
const { FooterCenterTunnel } = useTunnels();
|
|
@@ -46173,7 +46360,7 @@ var FooterCenter = ({ children }) => {
|
|
|
46173
46360
|
return /* @__PURE__ */ jsx141(FooterCenterTunnel.In, { children: /* @__PURE__ */ jsx141(
|
|
46174
46361
|
"div",
|
|
46175
46362
|
{
|
|
46176
|
-
className:
|
|
46363
|
+
className: clsx63("footer-center zen-mode-transition", {
|
|
46177
46364
|
"layer-ui__wrapper__footer-left--transition-bottom": appState.zenModeEnabled
|
|
46178
46365
|
}),
|
|
46179
46366
|
children
|
|
@@ -46184,7 +46371,7 @@ var FooterCenter_default = FooterCenter;
|
|
|
46184
46371
|
FooterCenter.displayName = "FooterCenter";
|
|
46185
46372
|
|
|
46186
46373
|
// components/live-collaboration/LiveCollaborationTrigger.tsx
|
|
46187
|
-
import
|
|
46374
|
+
import clsx64 from "clsx";
|
|
46188
46375
|
import { MQ_MIN_WIDTH_DESKTOP } from "@excalidraw/common";
|
|
46189
46376
|
import { jsx as jsx142, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
46190
46377
|
var LiveCollaborationTrigger2 = ({
|
|
@@ -46199,7 +46386,7 @@ var LiveCollaborationTrigger2 = ({
|
|
|
46199
46386
|
Button,
|
|
46200
46387
|
{
|
|
46201
46388
|
...rest,
|
|
46202
|
-
className:
|
|
46389
|
+
className: clsx64("collab-button", { active: isCollaborating }),
|
|
46203
46390
|
type: "button",
|
|
46204
46391
|
onSelect,
|
|
46205
46392
|
style: { position: "relative", width: showIconOnly ? void 0 : "auto" },
|