@myoc/excalidraw 0.18.2 → 0.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/{chunk-WT7JKXOQ.js → chunk-RAK2YFHC.js} +23 -6
- package/dist/dev/chunk-RAK2YFHC.js.map +7 -0
- package/dist/dev/{chunk-WBHLRU4Z.js → chunk-RE5EMAXD.js} +2 -2
- package/dist/dev/data/{image-N5NBMO74.js → image-KBZ4SRRJ.js} +3 -3
- package/dist/dev/index.css +22 -7
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +832 -744
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/{chunk-SIW4TYTH.js → chunk-4WWMDLFD.js} +1 -1
- package/dist/prod/{chunk-GALOWMDI.js → chunk-RUGBXGWF.js} +16 -14
- package/dist/prod/data/image-X6CIZAGC.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +15 -15
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/common/src/constants.d.ts +2 -0
- package/dist/types/common/src/utils.d.ts +1 -0
- package/dist/types/element/src/textElement.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionSmartZoom.d.ts +2 -2
- package/dist/types/excalidraw/components/App.d.ts +3 -3
- package/dist/types/excalidraw/eraser/index.d.ts +14 -0
- package/dist/types/excalidraw/lasso/utils.d.ts +1 -2
- package/dist/types/math/src/types.d.ts +1 -0
- package/package.json +1 -1
- package/dist/dev/chunk-WT7JKXOQ.js.map +0 -7
- package/dist/prod/data/image-NMU2LHCK.js +0 -1
- /package/dist/dev/{chunk-WBHLRU4Z.js.map → chunk-RE5EMAXD.js.map} +0 -0
- /package/dist/dev/data/{image-N5NBMO74.js.map → image-KBZ4SRRJ.js.map} +0 -0
package/dist/dev/index.js
CHANGED
|
@@ -158,6 +158,7 @@ import {
|
|
|
158
158
|
STATS_PANELS,
|
|
159
159
|
STROKE_WIDTH,
|
|
160
160
|
SVGStringToFile,
|
|
161
|
+
SVG_DOCUMENT_PREAMBLE,
|
|
161
162
|
SVG_NS,
|
|
162
163
|
Scene_default,
|
|
163
164
|
SelectionIcon,
|
|
@@ -582,6 +583,7 @@ import {
|
|
|
582
583
|
shouldMaintainAspectRatio,
|
|
583
584
|
shouldResizeFromCenter,
|
|
584
585
|
shouldRotateWithDiscreteAngle,
|
|
586
|
+
shouldTestInside,
|
|
585
587
|
supportsResizeObserver,
|
|
586
588
|
suppportsHorizontalAlign,
|
|
587
589
|
svgIcon,
|
|
@@ -614,10 +616,10 @@ import {
|
|
|
614
616
|
wrapEvent,
|
|
615
617
|
wrapText,
|
|
616
618
|
zoomAreaIcon
|
|
617
|
-
} from "./chunk-
|
|
619
|
+
} from "./chunk-RAK2YFHC.js";
|
|
618
620
|
import {
|
|
619
621
|
define_import_meta_env_default
|
|
620
|
-
} from "./chunk-
|
|
622
|
+
} from "./chunk-RE5EMAXD.js";
|
|
621
623
|
import {
|
|
622
624
|
en_default
|
|
623
625
|
} from "./chunk-6MXLCRC3.js";
|
|
@@ -10729,7 +10731,9 @@ var exportCanvas = async (type, elements, appState, files, {
|
|
|
10729
10731
|
if (type === "svg") {
|
|
10730
10732
|
return fileSave(
|
|
10731
10733
|
svgPromise.then((svg) => {
|
|
10732
|
-
return new Blob([svg.outerHTML], {
|
|
10734
|
+
return new Blob([SVG_DOCUMENT_PREAMBLE + svg.outerHTML], {
|
|
10735
|
+
type: MIME_TYPES.svg
|
|
10736
|
+
});
|
|
10733
10737
|
}),
|
|
10734
10738
|
{
|
|
10735
10739
|
description: "Export to SVG",
|
|
@@ -10759,7 +10763,7 @@ var exportCanvas = async (type, elements, appState, files, {
|
|
|
10759
10763
|
let blob = canvasToBlob(tempCanvas);
|
|
10760
10764
|
if (appState.exportEmbedScene) {
|
|
10761
10765
|
blob = blob.then(
|
|
10762
|
-
(blob2) => import("./data/image-
|
|
10766
|
+
(blob2) => import("./data/image-KBZ4SRRJ.js").then(
|
|
10763
10767
|
({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
|
|
10764
10768
|
blob: blob2,
|
|
10765
10769
|
metadata: serializeAsJSON(elements, appState, files, "local")
|
|
@@ -12849,7 +12853,8 @@ var actionBindText = register({
|
|
|
12849
12853
|
containerId: container.id,
|
|
12850
12854
|
verticalAlign: VERTICAL_ALIGN.MIDDLE,
|
|
12851
12855
|
textAlign: TEXT_ALIGN.CENTER,
|
|
12852
|
-
autoResize: true
|
|
12856
|
+
autoResize: true,
|
|
12857
|
+
angle: isArrowElement(container) ? 0 : container?.angle ?? 0
|
|
12853
12858
|
});
|
|
12854
12859
|
mutateElement(container, {
|
|
12855
12860
|
boundElements: (container.boundElements || []).concat({
|
|
@@ -22211,7 +22216,7 @@ import { jsx as jsx75 } from "react/jsx-runtime";
|
|
|
22211
22216
|
var actionSmartZoom = register({
|
|
22212
22217
|
name: "smartZoom",
|
|
22213
22218
|
label: "toolBar.smartZoom",
|
|
22214
|
-
trackEvent: { category: "
|
|
22219
|
+
trackEvent: { category: "toolbar" },
|
|
22215
22220
|
icon: eyeIcon,
|
|
22216
22221
|
viewMode: true,
|
|
22217
22222
|
perform: (elements, appState, _, app) => {
|
|
@@ -22232,58 +22237,174 @@ var actionSmartZoom = register({
|
|
|
22232
22237
|
};
|
|
22233
22238
|
},
|
|
22234
22239
|
keyTest: (event) => !event[KEYS.CTRL_OR_CMD] && !event.shiftKey && !event.altKey && event.key.toLocaleLowerCase() === KEYS.F,
|
|
22235
|
-
PanelComponent: ({
|
|
22240
|
+
PanelComponent: ({ data, updateData }) => /* @__PURE__ */ jsx75(
|
|
22236
22241
|
ToolButton,
|
|
22237
22242
|
{
|
|
22238
22243
|
type: "button",
|
|
22239
22244
|
icon: eyeIcon,
|
|
22240
|
-
title: `${t("labels.smartZoom")} \u2014 ${KEYS.F.toUpperCase()}`,
|
|
22241
22245
|
"aria-label": t("labels.smartZoom"),
|
|
22242
22246
|
onClick: () => updateData(null),
|
|
22243
|
-
|
|
22247
|
+
size: data?.size || "medium",
|
|
22248
|
+
"data-testid": "button-smart-zoom",
|
|
22249
|
+
keyBindingLabel: KEYS.F.toLocaleUpperCase()
|
|
22244
22250
|
}
|
|
22245
22251
|
)
|
|
22246
22252
|
});
|
|
22247
22253
|
|
|
22248
|
-
//
|
|
22249
|
-
|
|
22250
|
-
var
|
|
22251
|
-
|
|
22252
|
-
|
|
22253
|
-
|
|
22254
|
-
|
|
22255
|
-
|
|
22256
|
-
|
|
22257
|
-
|
|
22258
|
-
|
|
22259
|
-
|
|
22260
|
-
|
|
22261
|
-
|
|
22262
|
-
|
|
22263
|
-
|
|
22264
|
-
|
|
22265
|
-
|
|
22266
|
-
|
|
22267
|
-
|
|
22268
|
-
|
|
22269
|
-
|
|
22270
|
-
|
|
22254
|
+
// eraser/index.ts
|
|
22255
|
+
var POINTS_ON_TRAIL = 2;
|
|
22256
|
+
var EraserTrail = class extends AnimatedTrail {
|
|
22257
|
+
constructor(animationFrameHandler, app) {
|
|
22258
|
+
super(animationFrameHandler, app, {
|
|
22259
|
+
streamline: 0.2,
|
|
22260
|
+
size: 5,
|
|
22261
|
+
keepHead: true,
|
|
22262
|
+
sizeMapping: (c) => {
|
|
22263
|
+
const DECAY_TIME = 200;
|
|
22264
|
+
const DECAY_LENGTH = 10;
|
|
22265
|
+
const t2 = Math.max(
|
|
22266
|
+
0,
|
|
22267
|
+
1 - (performance.now() - c.pressure) / DECAY_TIME
|
|
22268
|
+
);
|
|
22269
|
+
const l = (DECAY_LENGTH - Math.min(DECAY_LENGTH, c.totalLength - c.currentIndex)) / DECAY_LENGTH;
|
|
22270
|
+
return Math.min(easeOut(l), easeOut(t2));
|
|
22271
|
+
},
|
|
22272
|
+
fill: () => app.state.theme === THEME.LIGHT ? "rgba(0, 0, 0, 0.2)" : "rgba(255, 255, 255, 0.2)"
|
|
22273
|
+
});
|
|
22274
|
+
__publicField(this, "elementsToErase", /* @__PURE__ */ new Set());
|
|
22275
|
+
__publicField(this, "groupsToErase", /* @__PURE__ */ new Set());
|
|
22276
|
+
__publicField(this, "segmentsCache", /* @__PURE__ */ new Map());
|
|
22277
|
+
__publicField(this, "geometricShapesCache", /* @__PURE__ */ new Map());
|
|
22278
|
+
}
|
|
22279
|
+
startPath(x, y) {
|
|
22280
|
+
this.endPath();
|
|
22281
|
+
super.startPath(x, y);
|
|
22282
|
+
this.elementsToErase.clear();
|
|
22283
|
+
}
|
|
22284
|
+
addPointToPath(x, y, restore2 = false) {
|
|
22285
|
+
super.addPointToPath(x, y);
|
|
22286
|
+
const elementsToEraser = this.updateElementsToBeErased(restore2);
|
|
22287
|
+
return elementsToEraser;
|
|
22288
|
+
}
|
|
22289
|
+
updateElementsToBeErased(restoreToErase) {
|
|
22290
|
+
let eraserPath = super.getCurrentTrail()?.originalPoints?.map((p) => pointFrom(p[0], p[1])) || [];
|
|
22291
|
+
eraserPath = eraserPath?.slice(eraserPath.length - POINTS_ON_TRAIL);
|
|
22292
|
+
const candidateElements = this.app.visibleElements.filter(
|
|
22293
|
+
(el) => !el.locked
|
|
22294
|
+
);
|
|
22295
|
+
const candidateElementsMap = arrayToMap(candidateElements);
|
|
22296
|
+
const pathSegments = eraserPath.reduce((acc, point, index) => {
|
|
22297
|
+
if (index === 0) {
|
|
22298
|
+
return acc;
|
|
22271
22299
|
}
|
|
22272
|
-
|
|
22273
|
-
|
|
22274
|
-
|
|
22275
|
-
|
|
22276
|
-
|
|
22277
|
-
|
|
22278
|
-
|
|
22279
|
-
|
|
22280
|
-
|
|
22281
|
-
|
|
22300
|
+
acc.push(lineSegment(eraserPath[index - 1], point));
|
|
22301
|
+
return acc;
|
|
22302
|
+
}, []);
|
|
22303
|
+
if (pathSegments.length === 0) {
|
|
22304
|
+
return [];
|
|
22305
|
+
}
|
|
22306
|
+
for (const element of candidateElements) {
|
|
22307
|
+
if (restoreToErase && this.elementsToErase.has(element.id)) {
|
|
22308
|
+
const intersects = eraserTest(
|
|
22309
|
+
pathSegments,
|
|
22310
|
+
element,
|
|
22311
|
+
this.segmentsCache,
|
|
22312
|
+
this.geometricShapesCache,
|
|
22313
|
+
candidateElementsMap,
|
|
22314
|
+
this.app
|
|
22315
|
+
);
|
|
22316
|
+
if (intersects) {
|
|
22317
|
+
const shallowestGroupId = element.groupIds.at(-1);
|
|
22318
|
+
if (this.groupsToErase.has(shallowestGroupId)) {
|
|
22319
|
+
const elementsInGroup = getElementsInGroup(
|
|
22320
|
+
this.app.scene.getNonDeletedElementsMap(),
|
|
22321
|
+
shallowestGroupId
|
|
22322
|
+
);
|
|
22323
|
+
for (const elementInGroup of elementsInGroup) {
|
|
22324
|
+
this.elementsToErase.delete(elementInGroup.id);
|
|
22325
|
+
}
|
|
22326
|
+
this.groupsToErase.delete(shallowestGroupId);
|
|
22327
|
+
}
|
|
22328
|
+
if (isBoundToContainer(element)) {
|
|
22329
|
+
this.elementsToErase.delete(element.containerId);
|
|
22330
|
+
}
|
|
22331
|
+
if (hasBoundTextElement(element)) {
|
|
22332
|
+
const boundText = getBoundTextElementId(element);
|
|
22333
|
+
if (boundText) {
|
|
22334
|
+
this.elementsToErase.delete(boundText);
|
|
22335
|
+
}
|
|
22336
|
+
}
|
|
22337
|
+
this.elementsToErase.delete(element.id);
|
|
22338
|
+
}
|
|
22339
|
+
} else if (!restoreToErase && !this.elementsToErase.has(element.id)) {
|
|
22340
|
+
const intersects = eraserTest(
|
|
22341
|
+
pathSegments,
|
|
22342
|
+
element,
|
|
22343
|
+
this.segmentsCache,
|
|
22344
|
+
this.geometricShapesCache,
|
|
22345
|
+
candidateElementsMap,
|
|
22346
|
+
this.app
|
|
22347
|
+
);
|
|
22348
|
+
if (intersects) {
|
|
22349
|
+
const shallowestGroupId = element.groupIds.at(-1);
|
|
22350
|
+
if (!this.groupsToErase.has(shallowestGroupId)) {
|
|
22351
|
+
const elementsInGroup = getElementsInGroup(
|
|
22352
|
+
this.app.scene.getNonDeletedElementsMap(),
|
|
22353
|
+
shallowestGroupId
|
|
22354
|
+
);
|
|
22355
|
+
for (const elementInGroup of elementsInGroup) {
|
|
22356
|
+
this.elementsToErase.add(elementInGroup.id);
|
|
22357
|
+
}
|
|
22358
|
+
this.groupsToErase.add(shallowestGroupId);
|
|
22359
|
+
}
|
|
22360
|
+
if (hasBoundTextElement(element)) {
|
|
22361
|
+
const boundText = getBoundTextElementId(element);
|
|
22362
|
+
if (boundText) {
|
|
22363
|
+
this.elementsToErase.add(boundText);
|
|
22364
|
+
}
|
|
22365
|
+
}
|
|
22366
|
+
if (isBoundToContainer(element)) {
|
|
22367
|
+
this.elementsToErase.add(element.containerId);
|
|
22368
|
+
}
|
|
22369
|
+
this.elementsToErase.add(element.id);
|
|
22370
|
+
}
|
|
22282
22371
|
}
|
|
22283
|
-
|
|
22284
|
-
|
|
22372
|
+
}
|
|
22373
|
+
return Array.from(this.elementsToErase);
|
|
22374
|
+
}
|
|
22375
|
+
endPath() {
|
|
22376
|
+
super.endPath();
|
|
22377
|
+
super.clearTrails();
|
|
22378
|
+
this.elementsToErase.clear();
|
|
22379
|
+
this.groupsToErase.clear();
|
|
22380
|
+
this.segmentsCache.clear();
|
|
22381
|
+
}
|
|
22382
|
+
};
|
|
22383
|
+
var eraserTest = (pathSegments, element, elementsSegments, shapesCache, elementsMap, app) => {
|
|
22384
|
+
let shape = shapesCache.get(element.id);
|
|
22385
|
+
if (!shape) {
|
|
22386
|
+
shape = getElementShape(element, elementsMap);
|
|
22387
|
+
shapesCache.set(element.id, shape);
|
|
22388
|
+
}
|
|
22389
|
+
const lastPoint = pathSegments[pathSegments.length - 1][1];
|
|
22390
|
+
if (shouldTestInside(element) && isPointInShape(lastPoint, shape)) {
|
|
22391
|
+
return true;
|
|
22392
|
+
}
|
|
22393
|
+
let elementSegments = elementsSegments.get(element.id);
|
|
22394
|
+
if (!elementSegments) {
|
|
22395
|
+
elementSegments = getElementLineSegments(element, elementsMap);
|
|
22396
|
+
elementsSegments.set(element.id, elementSegments);
|
|
22397
|
+
}
|
|
22398
|
+
return pathSegments.some(
|
|
22399
|
+
(pathSegment) => elementSegments?.some(
|
|
22400
|
+
(elementSegment) => lineSegmentIntersectionPoints(
|
|
22401
|
+
pathSegment,
|
|
22402
|
+
elementSegment,
|
|
22403
|
+
app.getElementHitThreshold()
|
|
22404
|
+
) !== null
|
|
22405
|
+
)
|
|
22406
|
+
);
|
|
22285
22407
|
};
|
|
22286
|
-
var BraveMeasureTextError_default = BraveMeasureTextError;
|
|
22287
22408
|
|
|
22288
22409
|
// components/ContextMenu.tsx
|
|
22289
22410
|
import clsx32 from "clsx";
|
|
@@ -22292,7 +22413,7 @@ import React27 from "react";
|
|
|
22292
22413
|
// components/Popover.tsx
|
|
22293
22414
|
import { useLayoutEffect as useLayoutEffect4, useRef as useRef23, useEffect as useEffect28 } from "react";
|
|
22294
22415
|
import { unstable_batchedUpdates as unstable_batchedUpdates2 } from "react-dom";
|
|
22295
|
-
import { jsx as
|
|
22416
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
22296
22417
|
var Popover6 = ({
|
|
22297
22418
|
children,
|
|
22298
22419
|
left,
|
|
@@ -22392,11 +22513,11 @@ var Popover6 = ({
|
|
|
22392
22513
|
return () => document.removeEventListener("pointerdown", handler, false);
|
|
22393
22514
|
}
|
|
22394
22515
|
}, [onCloseRequest]);
|
|
22395
|
-
return /* @__PURE__ */
|
|
22516
|
+
return /* @__PURE__ */ jsx76("div", { className: "popover", ref: popoverRef, tabIndex: -1, children });
|
|
22396
22517
|
};
|
|
22397
22518
|
|
|
22398
22519
|
// components/ContextMenu.tsx
|
|
22399
|
-
import { jsx as
|
|
22520
|
+
import { jsx as jsx77, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
22400
22521
|
var CONTEXT_MENU_SEPARATOR = "separator";
|
|
22401
22522
|
var ContextMenu = React27.memo(
|
|
22402
22523
|
({ actionManager, items, top, left, onClose }) => {
|
|
@@ -22413,7 +22534,7 @@ var ContextMenu = React27.memo(
|
|
|
22413
22534
|
}
|
|
22414
22535
|
return acc;
|
|
22415
22536
|
}, []);
|
|
22416
|
-
return /* @__PURE__ */
|
|
22537
|
+
return /* @__PURE__ */ jsx77(
|
|
22417
22538
|
Popover6,
|
|
22418
22539
|
{
|
|
22419
22540
|
onCloseRequest: () => {
|
|
@@ -22426,7 +22547,7 @@ var ContextMenu = React27.memo(
|
|
|
22426
22547
|
offsetTop: appState.offsetTop,
|
|
22427
22548
|
viewportWidth: appState.width,
|
|
22428
22549
|
viewportHeight: appState.height,
|
|
22429
|
-
children: /* @__PURE__ */
|
|
22550
|
+
children: /* @__PURE__ */ jsx77(
|
|
22430
22551
|
"ul",
|
|
22431
22552
|
{
|
|
22432
22553
|
className: "context-menu",
|
|
@@ -22436,7 +22557,7 @@ var ContextMenu = React27.memo(
|
|
|
22436
22557
|
if (!filteredItems[idx - 1] || filteredItems[idx - 1] === CONTEXT_MENU_SEPARATOR) {
|
|
22437
22558
|
return null;
|
|
22438
22559
|
}
|
|
22439
|
-
return /* @__PURE__ */
|
|
22560
|
+
return /* @__PURE__ */ jsx77("hr", { className: "context-menu-item-separator" }, idx);
|
|
22440
22561
|
}
|
|
22441
22562
|
const actionName = item.name;
|
|
22442
22563
|
let label = "";
|
|
@@ -22453,7 +22574,7 @@ var ContextMenu = React27.memo(
|
|
|
22453
22574
|
label = t(item.label);
|
|
22454
22575
|
}
|
|
22455
22576
|
}
|
|
22456
|
-
return /* @__PURE__ */
|
|
22577
|
+
return /* @__PURE__ */ jsx77(
|
|
22457
22578
|
"li",
|
|
22458
22579
|
{
|
|
22459
22580
|
"data-testid": actionName,
|
|
@@ -22462,7 +22583,7 @@ var ContextMenu = React27.memo(
|
|
|
22462
22583
|
actionManager.executeAction(item, "contextMenu");
|
|
22463
22584
|
});
|
|
22464
22585
|
},
|
|
22465
|
-
children: /* @__PURE__ */
|
|
22586
|
+
children: /* @__PURE__ */ jsxs40(
|
|
22466
22587
|
"button",
|
|
22467
22588
|
{
|
|
22468
22589
|
type: "button",
|
|
@@ -22471,8 +22592,8 @@ var ContextMenu = React27.memo(
|
|
|
22471
22592
|
checkmark: item.checked?.(appState)
|
|
22472
22593
|
}),
|
|
22473
22594
|
children: [
|
|
22474
|
-
/* @__PURE__ */
|
|
22475
|
-
/* @__PURE__ */
|
|
22595
|
+
/* @__PURE__ */ jsx77("div", { className: "context-menu-item__label", children: label }),
|
|
22596
|
+
/* @__PURE__ */ jsx77("kbd", { className: "context-menu-item__shortcut", children: actionName ? getShortcutFromShortcutName(actionName) : "" })
|
|
22476
22597
|
]
|
|
22477
22598
|
}
|
|
22478
22599
|
)
|
|
@@ -22488,18 +22609,18 @@ var ContextMenu = React27.memo(
|
|
|
22488
22609
|
);
|
|
22489
22610
|
|
|
22490
22611
|
// components/FollowMode/FollowMode.tsx
|
|
22491
|
-
import { jsx as
|
|
22612
|
+
import { jsx as jsx78, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
22492
22613
|
var FollowMode = ({
|
|
22493
22614
|
height,
|
|
22494
22615
|
width,
|
|
22495
22616
|
userToFollow,
|
|
22496
22617
|
onDisconnect
|
|
22497
22618
|
}) => {
|
|
22498
|
-
return /* @__PURE__ */
|
|
22499
|
-
/* @__PURE__ */
|
|
22619
|
+
return /* @__PURE__ */ jsx78("div", { className: "follow-mode", style: { width, height }, children: /* @__PURE__ */ jsxs41("div", { className: "follow-mode__badge", children: [
|
|
22620
|
+
/* @__PURE__ */ jsxs41("div", { className: "follow-mode__badge__label", children: [
|
|
22500
22621
|
"Following",
|
|
22501
22622
|
" ",
|
|
22502
|
-
/* @__PURE__ */
|
|
22623
|
+
/* @__PURE__ */ jsx78(
|
|
22503
22624
|
"span",
|
|
22504
22625
|
{
|
|
22505
22626
|
className: "follow-mode__badge__username",
|
|
@@ -22508,7 +22629,7 @@ var FollowMode = ({
|
|
|
22508
22629
|
}
|
|
22509
22630
|
)
|
|
22510
22631
|
] }),
|
|
22511
|
-
/* @__PURE__ */
|
|
22632
|
+
/* @__PURE__ */ jsx78(
|
|
22512
22633
|
"button",
|
|
22513
22634
|
{
|
|
22514
22635
|
type: "button",
|
|
@@ -22553,7 +22674,7 @@ var useInitializeTunnels = () => {
|
|
|
22553
22674
|
// components/LoadingMessage.tsx
|
|
22554
22675
|
import clsx33 from "clsx";
|
|
22555
22676
|
import { useState as useState23, useEffect as useEffect29 } from "react";
|
|
22556
|
-
import { jsx as
|
|
22677
|
+
import { jsx as jsx79, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
22557
22678
|
var LoadingMessage = ({
|
|
22558
22679
|
delay,
|
|
22559
22680
|
theme
|
|
@@ -22571,15 +22692,15 @@ var LoadingMessage = ({
|
|
|
22571
22692
|
if (isWaiting) {
|
|
22572
22693
|
return null;
|
|
22573
22694
|
}
|
|
22574
|
-
return /* @__PURE__ */
|
|
22695
|
+
return /* @__PURE__ */ jsxs42(
|
|
22575
22696
|
"div",
|
|
22576
22697
|
{
|
|
22577
22698
|
className: clsx33("LoadingMessage", {
|
|
22578
22699
|
"LoadingMessage--dark": theme === THEME.DARK
|
|
22579
22700
|
}),
|
|
22580
22701
|
children: [
|
|
22581
|
-
/* @__PURE__ */
|
|
22582
|
-
/* @__PURE__ */
|
|
22702
|
+
/* @__PURE__ */ jsx79("div", { children: /* @__PURE__ */ jsx79(Spinner_default, {}) }),
|
|
22703
|
+
/* @__PURE__ */ jsx79("div", { className: "LoadingMessage-text", children: t("labels.loadingScene") })
|
|
22583
22704
|
]
|
|
22584
22705
|
}
|
|
22585
22706
|
);
|
|
@@ -22587,12 +22708,12 @@ var LoadingMessage = ({
|
|
|
22587
22708
|
|
|
22588
22709
|
// components/FixedSideContainer.tsx
|
|
22589
22710
|
import clsx34 from "clsx";
|
|
22590
|
-
import { jsx as
|
|
22711
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
22591
22712
|
var FixedSideContainer = ({
|
|
22592
22713
|
children,
|
|
22593
22714
|
side,
|
|
22594
22715
|
className
|
|
22595
|
-
}) => /* @__PURE__ */
|
|
22716
|
+
}) => /* @__PURE__ */ jsx80(
|
|
22596
22717
|
"div",
|
|
22597
22718
|
{
|
|
22598
22719
|
className: clsx34(
|
|
@@ -22606,9 +22727,9 @@ var FixedSideContainer = ({
|
|
|
22606
22727
|
|
|
22607
22728
|
// components/HandButton.tsx
|
|
22608
22729
|
import clsx35 from "clsx";
|
|
22609
|
-
import { jsx as
|
|
22730
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
22610
22731
|
var HandButton = (props) => {
|
|
22611
|
-
return /* @__PURE__ */
|
|
22732
|
+
return /* @__PURE__ */ jsx81(
|
|
22612
22733
|
ToolButton,
|
|
22613
22734
|
{
|
|
22614
22735
|
className: clsx35("Shape", { fillable: false }),
|
|
@@ -22627,7 +22748,7 @@ var HandButton = (props) => {
|
|
|
22627
22748
|
};
|
|
22628
22749
|
|
|
22629
22750
|
// components/HintViewer.tsx
|
|
22630
|
-
import { jsx as
|
|
22751
|
+
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
22631
22752
|
var getHints = ({
|
|
22632
22753
|
appState,
|
|
22633
22754
|
isMobile,
|
|
@@ -22740,19 +22861,19 @@ var HintViewer = ({
|
|
|
22740
22861
|
const hint = Array.isArray(hints) ? hints.map((hint2) => {
|
|
22741
22862
|
return getShortcutKey(hint2).replace(/\. ?$/, "");
|
|
22742
22863
|
}).join(". ") : getShortcutKey(hints);
|
|
22743
|
-
return /* @__PURE__ */
|
|
22864
|
+
return /* @__PURE__ */ jsx82("div", { className: "HintViewer", children: /* @__PURE__ */ jsx82("span", { children: hint }) });
|
|
22744
22865
|
};
|
|
22745
22866
|
|
|
22746
22867
|
// components/LockButton.tsx
|
|
22747
22868
|
import clsx36 from "clsx";
|
|
22748
|
-
import { jsx as
|
|
22869
|
+
import { jsx as jsx83, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
22749
22870
|
var DEFAULT_SIZE = "medium";
|
|
22750
22871
|
var ICONS2 = {
|
|
22751
22872
|
CHECKED: LockedIcon,
|
|
22752
22873
|
UNCHECKED: UnlockedIcon
|
|
22753
22874
|
};
|
|
22754
22875
|
var LockButton = (props) => {
|
|
22755
|
-
return /* @__PURE__ */
|
|
22876
|
+
return /* @__PURE__ */ jsxs43(
|
|
22756
22877
|
"label",
|
|
22757
22878
|
{
|
|
22758
22879
|
className: clsx36(
|
|
@@ -22764,7 +22885,7 @@ var LockButton = (props) => {
|
|
|
22764
22885
|
),
|
|
22765
22886
|
title: `${props.title} \u2014 Q`,
|
|
22766
22887
|
children: [
|
|
22767
|
-
/* @__PURE__ */
|
|
22888
|
+
/* @__PURE__ */ jsx83(
|
|
22768
22889
|
"input",
|
|
22769
22890
|
{
|
|
22770
22891
|
className: "ToolIcon_type_checkbox",
|
|
@@ -22776,7 +22897,7 @@ var LockButton = (props) => {
|
|
|
22776
22897
|
"data-testid": "toolbar-lock"
|
|
22777
22898
|
}
|
|
22778
22899
|
),
|
|
22779
|
-
/* @__PURE__ */
|
|
22900
|
+
/* @__PURE__ */ jsx83("div", { className: "ToolIcon__icon", children: props.checked ? ICONS2.CHECKED : ICONS2.UNCHECKED })
|
|
22780
22901
|
]
|
|
22781
22902
|
}
|
|
22782
22903
|
);
|
|
@@ -22784,13 +22905,13 @@ var LockButton = (props) => {
|
|
|
22784
22905
|
|
|
22785
22906
|
// components/PenModeButton.tsx
|
|
22786
22907
|
import clsx37 from "clsx";
|
|
22787
|
-
import { jsx as
|
|
22908
|
+
import { jsx as jsx84, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
22788
22909
|
var DEFAULT_SIZE2 = "medium";
|
|
22789
22910
|
var PenModeButton = (props) => {
|
|
22790
22911
|
if (!props.penDetected) {
|
|
22791
22912
|
return null;
|
|
22792
22913
|
}
|
|
22793
|
-
return /* @__PURE__ */
|
|
22914
|
+
return /* @__PURE__ */ jsxs44(
|
|
22794
22915
|
"label",
|
|
22795
22916
|
{
|
|
22796
22917
|
className: clsx37(
|
|
@@ -22802,7 +22923,7 @@ var PenModeButton = (props) => {
|
|
|
22802
22923
|
),
|
|
22803
22924
|
title: `${props.title}`,
|
|
22804
22925
|
children: [
|
|
22805
|
-
/* @__PURE__ */
|
|
22926
|
+
/* @__PURE__ */ jsx84(
|
|
22806
22927
|
"input",
|
|
22807
22928
|
{
|
|
22808
22929
|
className: "ToolIcon_type_checkbox",
|
|
@@ -22813,25 +22934,25 @@ var PenModeButton = (props) => {
|
|
|
22813
22934
|
"aria-label": props.title
|
|
22814
22935
|
}
|
|
22815
22936
|
),
|
|
22816
|
-
/* @__PURE__ */
|
|
22937
|
+
/* @__PURE__ */ jsx84("div", { className: "ToolIcon__icon", children: PenModeIcon })
|
|
22817
22938
|
]
|
|
22818
22939
|
}
|
|
22819
22940
|
);
|
|
22820
22941
|
};
|
|
22821
22942
|
|
|
22822
22943
|
// components/Section.tsx
|
|
22823
|
-
import { Fragment as Fragment10, jsx as
|
|
22944
|
+
import { Fragment as Fragment10, jsx as jsx85, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
22824
22945
|
var Section = ({ heading, children, ...props }) => {
|
|
22825
22946
|
const { id } = useExcalidrawContainer();
|
|
22826
|
-
const header = /* @__PURE__ */
|
|
22827
|
-
return /* @__PURE__ */
|
|
22947
|
+
const header = /* @__PURE__ */ jsx85("h2", { className: "visually-hidden", id: `${id}-${heading}-title`, children: t(`headings.${heading}`) });
|
|
22948
|
+
return /* @__PURE__ */ jsx85("section", { ...props, "aria-labelledby": `${id}-${heading}-title`, children: typeof children === "function" ? children(header) : /* @__PURE__ */ jsxs45(Fragment10, { children: [
|
|
22828
22949
|
header,
|
|
22829
22950
|
children
|
|
22830
22951
|
] }) });
|
|
22831
22952
|
};
|
|
22832
22953
|
|
|
22833
22954
|
// components/MobileMenu.tsx
|
|
22834
|
-
import { Fragment as Fragment11, jsx as
|
|
22955
|
+
import { Fragment as Fragment11, jsx as jsx86, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
22835
22956
|
var MobileMenu = ({
|
|
22836
22957
|
appState,
|
|
22837
22958
|
elements,
|
|
@@ -22854,12 +22975,12 @@ var MobileMenu = ({
|
|
|
22854
22975
|
DefaultSidebarTriggerTunnel
|
|
22855
22976
|
} = useTunnels();
|
|
22856
22977
|
const renderToolbar = () => {
|
|
22857
|
-
return /* @__PURE__ */
|
|
22858
|
-
renderWelcomeScreen && /* @__PURE__ */
|
|
22859
|
-
/* @__PURE__ */
|
|
22860
|
-
/* @__PURE__ */
|
|
22978
|
+
return /* @__PURE__ */ jsxs46(FixedSideContainer, { side: "top", className: "App-top-bar", children: [
|
|
22979
|
+
renderWelcomeScreen && /* @__PURE__ */ jsx86(WelcomeScreenCenterTunnel.Out, {}),
|
|
22980
|
+
/* @__PURE__ */ jsx86(Section, { heading: "shapes", children: (heading) => /* @__PURE__ */ jsx86(Stack_default.Col, { gap: 4, align: "center", children: /* @__PURE__ */ jsxs46(Stack_default.Row, { gap: 1, className: "App-toolbar-container", children: [
|
|
22981
|
+
/* @__PURE__ */ jsxs46(Island, { padding: 1, className: "App-toolbar App-toolbar--mobile", children: [
|
|
22861
22982
|
heading,
|
|
22862
|
-
/* @__PURE__ */
|
|
22983
|
+
/* @__PURE__ */ jsx86(Stack_default.Row, { gap: 1, children: /* @__PURE__ */ jsx86(
|
|
22863
22984
|
ShapesSwitcher,
|
|
22864
22985
|
{
|
|
22865
22986
|
appState,
|
|
@@ -22870,9 +22991,9 @@ var MobileMenu = ({
|
|
|
22870
22991
|
) })
|
|
22871
22992
|
] }),
|
|
22872
22993
|
renderTopRightUI && renderTopRightUI(true, appState),
|
|
22873
|
-
/* @__PURE__ */
|
|
22874
|
-
!appState.viewModeEnabled && appState.openDialog?.name !== "elementLinkSelector" && /* @__PURE__ */
|
|
22875
|
-
/* @__PURE__ */
|
|
22994
|
+
/* @__PURE__ */ jsxs46("div", { className: "mobile-misc-tools-container", children: [
|
|
22995
|
+
!appState.viewModeEnabled && appState.openDialog?.name !== "elementLinkSelector" && /* @__PURE__ */ jsx86(DefaultSidebarTriggerTunnel.Out, {}),
|
|
22996
|
+
/* @__PURE__ */ jsx86(
|
|
22876
22997
|
PenModeButton,
|
|
22877
22998
|
{
|
|
22878
22999
|
checked: appState.penMode,
|
|
@@ -22882,7 +23003,7 @@ var MobileMenu = ({
|
|
|
22882
23003
|
penDetected: appState.penDetected
|
|
22883
23004
|
}
|
|
22884
23005
|
),
|
|
22885
|
-
/* @__PURE__ */
|
|
23006
|
+
/* @__PURE__ */ jsx86(
|
|
22886
23007
|
LockButton,
|
|
22887
23008
|
{
|
|
22888
23009
|
checked: appState.activeTool.locked,
|
|
@@ -22891,7 +23012,7 @@ var MobileMenu = ({
|
|
|
22891
23012
|
isMobile: true
|
|
22892
23013
|
}
|
|
22893
23014
|
),
|
|
22894
|
-
/* @__PURE__ */
|
|
23015
|
+
/* @__PURE__ */ jsx86(
|
|
22895
23016
|
HandButton,
|
|
22896
23017
|
{
|
|
22897
23018
|
checked: isHandToolActive(appState),
|
|
@@ -22902,7 +23023,7 @@ var MobileMenu = ({
|
|
|
22902
23023
|
)
|
|
22903
23024
|
] })
|
|
22904
23025
|
] }) }) }),
|
|
22905
|
-
/* @__PURE__ */
|
|
23026
|
+
/* @__PURE__ */ jsx86(
|
|
22906
23027
|
HintViewer,
|
|
22907
23028
|
{
|
|
22908
23029
|
appState,
|
|
@@ -22915,25 +23036,25 @@ var MobileMenu = ({
|
|
|
22915
23036
|
};
|
|
22916
23037
|
const renderAppToolbar = () => {
|
|
22917
23038
|
if (appState.viewModeEnabled || appState.openDialog?.name === "elementLinkSelector") {
|
|
22918
|
-
return /* @__PURE__ */
|
|
23039
|
+
return /* @__PURE__ */ jsx86("div", { className: "App-toolbar-content", children: /* @__PURE__ */ jsx86(MainMenuTunnel.Out, {}) });
|
|
22919
23040
|
}
|
|
22920
|
-
return /* @__PURE__ */
|
|
22921
|
-
/* @__PURE__ */
|
|
23041
|
+
return /* @__PURE__ */ jsxs46("div", { className: "App-toolbar-content", children: [
|
|
23042
|
+
/* @__PURE__ */ jsxs46("div", { children: [
|
|
23043
|
+
actionManager.renderAction("smartZoom"),
|
|
23044
|
+
actionManager.renderAction("undo"),
|
|
23045
|
+
actionManager.renderAction("redo")
|
|
23046
|
+
] }),
|
|
22922
23047
|
actionManager.renderAction("toggleEditMenu"),
|
|
22923
23048
|
actionManager.renderAction(
|
|
22924
23049
|
appState.multiElement ? "finalize" : "duplicateSelection"
|
|
22925
23050
|
),
|
|
22926
|
-
actionManager.renderAction("deleteSelectedElements")
|
|
22927
|
-
/* @__PURE__ */ jsxs47("div", { children: [
|
|
22928
|
-
actionManager.renderAction("undo"),
|
|
22929
|
-
actionManager.renderAction("redo")
|
|
22930
|
-
] })
|
|
23051
|
+
actionManager.renderAction("deleteSelectedElements")
|
|
22931
23052
|
] });
|
|
22932
23053
|
};
|
|
22933
|
-
return /* @__PURE__ */
|
|
23054
|
+
return /* @__PURE__ */ jsxs46(Fragment11, { children: [
|
|
22934
23055
|
renderSidebars(),
|
|
22935
23056
|
!appState.viewModeEnabled && appState.openDialog?.name !== "elementLinkSelector" && renderToolbar(),
|
|
22936
|
-
/* @__PURE__ */
|
|
23057
|
+
/* @__PURE__ */ jsx86(
|
|
22937
23058
|
"div",
|
|
22938
23059
|
{
|
|
22939
23060
|
className: "App-bottom-bar",
|
|
@@ -22942,8 +23063,8 @@ var MobileMenu = ({
|
|
|
22942
23063
|
marginLeft: SCROLLBAR_WIDTH + SCROLLBAR_MARGIN * 2,
|
|
22943
23064
|
marginRight: SCROLLBAR_WIDTH + SCROLLBAR_MARGIN * 2
|
|
22944
23065
|
},
|
|
22945
|
-
children: /* @__PURE__ */
|
|
22946
|
-
appState.openMenu === "shape" && !appState.viewModeEnabled && appState.openDialog?.name !== "elementLinkSelector" && showSelectedShapeActions(appState, elements) ? /* @__PURE__ */
|
|
23066
|
+
children: /* @__PURE__ */ jsxs46(Island, { padding: 0, children: [
|
|
23067
|
+
appState.openMenu === "shape" && !appState.viewModeEnabled && appState.openDialog?.name !== "elementLinkSelector" && showSelectedShapeActions(appState, elements) ? /* @__PURE__ */ jsx86(Section, { className: "App-mobile-menu", heading: "selectedShapeActions", children: /* @__PURE__ */ jsx86(
|
|
22947
23068
|
SelectedShapeActions,
|
|
22948
23069
|
{
|
|
22949
23070
|
appState,
|
|
@@ -22952,9 +23073,9 @@ var MobileMenu = ({
|
|
|
22952
23073
|
app
|
|
22953
23074
|
}
|
|
22954
23075
|
) }) : null,
|
|
22955
|
-
/* @__PURE__ */
|
|
23076
|
+
/* @__PURE__ */ jsxs46("footer", { className: "App-toolbar", children: [
|
|
22956
23077
|
renderAppToolbar(),
|
|
22957
|
-
appState.scrolledOutside && !appState.openMenu && !appState.openSidebar && /* @__PURE__ */
|
|
23078
|
+
appState.scrolledOutside && !appState.openMenu && !appState.openSidebar && /* @__PURE__ */ jsx86(
|
|
22958
23079
|
"button",
|
|
22959
23080
|
{
|
|
22960
23081
|
type: "button",
|
|
@@ -22977,7 +23098,7 @@ var MobileMenu = ({
|
|
|
22977
23098
|
// components/PasteChartDialog.tsx
|
|
22978
23099
|
import oc2 from "open-color";
|
|
22979
23100
|
import React29, { useLayoutEffect as useLayoutEffect5, useRef as useRef24, useState as useState24 } from "react";
|
|
22980
|
-
import { jsx as
|
|
23101
|
+
import { jsx as jsx87, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
22981
23102
|
var ChartPreviewBtn = (props) => {
|
|
22982
23103
|
const previewRef = useRef24(null);
|
|
22983
23104
|
const [chartElements, setChartElements] = useState24(
|
|
@@ -23020,7 +23141,7 @@ var ChartPreviewBtn = (props) => {
|
|
|
23020
23141
|
previewNode.replaceChildren();
|
|
23021
23142
|
};
|
|
23022
23143
|
}, [props.spreadsheet, props.chartType, props.selected]);
|
|
23023
|
-
return /* @__PURE__ */
|
|
23144
|
+
return /* @__PURE__ */ jsx87(
|
|
23024
23145
|
"button",
|
|
23025
23146
|
{
|
|
23026
23147
|
type: "button",
|
|
@@ -23030,7 +23151,7 @@ var ChartPreviewBtn = (props) => {
|
|
|
23030
23151
|
props.onClick(props.chartType, chartElements);
|
|
23031
23152
|
}
|
|
23032
23153
|
},
|
|
23033
|
-
children: /* @__PURE__ */
|
|
23154
|
+
children: /* @__PURE__ */ jsx87("div", { ref: previewRef })
|
|
23034
23155
|
}
|
|
23035
23156
|
);
|
|
23036
23157
|
};
|
|
@@ -23056,7 +23177,7 @@ var PasteChartDialog = ({
|
|
|
23056
23177
|
}
|
|
23057
23178
|
});
|
|
23058
23179
|
};
|
|
23059
|
-
return /* @__PURE__ */
|
|
23180
|
+
return /* @__PURE__ */ jsx87(
|
|
23060
23181
|
Dialog,
|
|
23061
23182
|
{
|
|
23062
23183
|
size: "small",
|
|
@@ -23064,8 +23185,8 @@ var PasteChartDialog = ({
|
|
|
23064
23185
|
title: t("labels.pasteCharts"),
|
|
23065
23186
|
className: "PasteChartDialog",
|
|
23066
23187
|
autofocus: false,
|
|
23067
|
-
children: /* @__PURE__ */
|
|
23068
|
-
/* @__PURE__ */
|
|
23188
|
+
children: /* @__PURE__ */ jsxs47("div", { className: "container", children: [
|
|
23189
|
+
/* @__PURE__ */ jsx87(
|
|
23069
23190
|
ChartPreviewBtn,
|
|
23070
23191
|
{
|
|
23071
23192
|
chartType: "bar",
|
|
@@ -23074,7 +23195,7 @@ var PasteChartDialog = ({
|
|
|
23074
23195
|
onClick: handleChartClick
|
|
23075
23196
|
}
|
|
23076
23197
|
),
|
|
23077
|
-
/* @__PURE__ */
|
|
23198
|
+
/* @__PURE__ */ jsx87(
|
|
23078
23199
|
ChartPreviewBtn,
|
|
23079
23200
|
{
|
|
23080
23201
|
chartType: "line",
|
|
@@ -23092,14 +23213,14 @@ var PasteChartDialog = ({
|
|
|
23092
23213
|
import * as Popover7 from "@radix-ui/react-popover";
|
|
23093
23214
|
import clsx38 from "clsx";
|
|
23094
23215
|
import React30, { useLayoutEffect as useLayoutEffect6 } from "react";
|
|
23095
|
-
import { Fragment as Fragment12, jsx as
|
|
23216
|
+
import { Fragment as Fragment12, jsx as jsx88, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
23096
23217
|
var DEFAULT_MAX_AVATARS = 4;
|
|
23097
23218
|
var SHOW_COLLABORATORS_FILTER_AT = 8;
|
|
23098
23219
|
var ConditionalTooltipWrapper = ({
|
|
23099
23220
|
shouldWrap,
|
|
23100
23221
|
children,
|
|
23101
23222
|
username
|
|
23102
|
-
}) => shouldWrap ? /* @__PURE__ */
|
|
23223
|
+
}) => shouldWrap ? /* @__PURE__ */ jsx88(Tooltip, { label: username || "Unknown user", children }) : /* @__PURE__ */ jsx88(Fragment12, { children });
|
|
23103
23224
|
var renderCollaborator = ({
|
|
23104
23225
|
actionManager,
|
|
23105
23226
|
collaborator,
|
|
@@ -23115,7 +23236,7 @@ var renderCollaborator = ({
|
|
|
23115
23236
|
isBeingFollowed
|
|
23116
23237
|
};
|
|
23117
23238
|
const avatarJSX = actionManager.renderAction("goToCollaborator", data);
|
|
23118
|
-
return /* @__PURE__ */
|
|
23239
|
+
return /* @__PURE__ */ jsx88(
|
|
23119
23240
|
ConditionalTooltipWrapper,
|
|
23120
23241
|
{
|
|
23121
23242
|
username: collaborator.username,
|
|
@@ -23190,7 +23311,7 @@ var UserList = React30.memo(
|
|
|
23190
23311
|
isBeingFollowed: collaborator.socketId === userToFollow
|
|
23191
23312
|
})
|
|
23192
23313
|
);
|
|
23193
|
-
return mobile ? /* @__PURE__ */
|
|
23314
|
+
return mobile ? /* @__PURE__ */ jsx88("div", { className: clsx38("UserList UserList_mobile", className), children: uniqueCollaboratorsArray.map(
|
|
23194
23315
|
(collaborator) => renderCollaborator({
|
|
23195
23316
|
actionManager,
|
|
23196
23317
|
collaborator,
|
|
@@ -23198,19 +23319,19 @@ var UserList = React30.memo(
|
|
|
23198
23319
|
shouldWrapWithTooltip: true,
|
|
23199
23320
|
isBeingFollowed: collaborator.socketId === userToFollow
|
|
23200
23321
|
})
|
|
23201
|
-
) }) : /* @__PURE__ */
|
|
23322
|
+
) }) : /* @__PURE__ */ jsx88("div", { className: "UserList__wrapper", ref: userListWrapper, children: /* @__PURE__ */ jsxs48(
|
|
23202
23323
|
"div",
|
|
23203
23324
|
{
|
|
23204
23325
|
className: clsx38("UserList", className),
|
|
23205
23326
|
style: { [`--max-avatars`]: maxAvatars },
|
|
23206
23327
|
children: [
|
|
23207
23328
|
firstNAvatarsJSX,
|
|
23208
|
-
uniqueCollaboratorsArray.length > maxAvatars - 1 && /* @__PURE__ */
|
|
23209
|
-
/* @__PURE__ */
|
|
23329
|
+
uniqueCollaboratorsArray.length > maxAvatars - 1 && /* @__PURE__ */ jsxs48(Popover7.Root, { children: [
|
|
23330
|
+
/* @__PURE__ */ jsxs48(Popover7.Trigger, { className: "UserList__more", children: [
|
|
23210
23331
|
"+",
|
|
23211
23332
|
uniqueCollaboratorsArray.length - maxAvatars + 1
|
|
23212
23333
|
] }),
|
|
23213
|
-
/* @__PURE__ */
|
|
23334
|
+
/* @__PURE__ */ jsx88(
|
|
23214
23335
|
Popover7.Content,
|
|
23215
23336
|
{
|
|
23216
23337
|
style: {
|
|
@@ -23220,21 +23341,21 @@ var UserList = React30.memo(
|
|
|
23220
23341
|
},
|
|
23221
23342
|
align: "end",
|
|
23222
23343
|
sideOffset: 10,
|
|
23223
|
-
children: /* @__PURE__ */
|
|
23224
|
-
uniqueCollaboratorsArray.length >= SHOW_COLLABORATORS_FILTER_AT && /* @__PURE__ */
|
|
23344
|
+
children: /* @__PURE__ */ jsxs48(Island, { padding: 2, children: [
|
|
23345
|
+
uniqueCollaboratorsArray.length >= SHOW_COLLABORATORS_FILTER_AT && /* @__PURE__ */ jsx88(
|
|
23225
23346
|
QuickSearch,
|
|
23226
23347
|
{
|
|
23227
23348
|
placeholder: t("quickSearch.placeholder"),
|
|
23228
23349
|
onChange: setSearchTerm
|
|
23229
23350
|
}
|
|
23230
23351
|
),
|
|
23231
|
-
/* @__PURE__ */
|
|
23352
|
+
/* @__PURE__ */ jsx88(
|
|
23232
23353
|
ScrollableList,
|
|
23233
23354
|
{
|
|
23234
23355
|
className: "dropdown-menu UserList__collaborators",
|
|
23235
23356
|
placeholder: t("userList.empty"),
|
|
23236
23357
|
children: filteredCollaborators.length > 0 ? [
|
|
23237
|
-
/* @__PURE__ */
|
|
23358
|
+
/* @__PURE__ */ jsx88("div", { className: "hint", children: t("userList.hint.text") }),
|
|
23238
23359
|
filteredCollaborators.map(
|
|
23239
23360
|
(collaborator) => renderCollaborator({
|
|
23240
23361
|
actionManager,
|
|
@@ -23247,7 +23368,7 @@ var UserList = React30.memo(
|
|
|
23247
23368
|
] : []
|
|
23248
23369
|
}
|
|
23249
23370
|
),
|
|
23250
|
-
/* @__PURE__ */
|
|
23371
|
+
/* @__PURE__ */ jsx88(
|
|
23251
23372
|
Popover7.Arrow,
|
|
23252
23373
|
{
|
|
23253
23374
|
width: 20,
|
|
@@ -23291,8 +23412,8 @@ var UserList = React30.memo(
|
|
|
23291
23412
|
import clsx39 from "clsx";
|
|
23292
23413
|
|
|
23293
23414
|
// components/HelpButton.tsx
|
|
23294
|
-
import { jsx as
|
|
23295
|
-
var HelpButton = (props) => /* @__PURE__ */
|
|
23415
|
+
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
23416
|
+
var HelpButton = (props) => /* @__PURE__ */ jsx89(
|
|
23296
23417
|
"button",
|
|
23297
23418
|
{
|
|
23298
23419
|
className: "help-icon",
|
|
@@ -23305,7 +23426,7 @@ var HelpButton = (props) => /* @__PURE__ */ jsx90(
|
|
|
23305
23426
|
);
|
|
23306
23427
|
|
|
23307
23428
|
// components/footer/Footer.tsx
|
|
23308
|
-
import { jsx as
|
|
23429
|
+
import { jsx as jsx90, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
23309
23430
|
var Footer = ({
|
|
23310
23431
|
appState,
|
|
23311
23432
|
actionManager,
|
|
@@ -23315,27 +23436,28 @@ var Footer = ({
|
|
|
23315
23436
|
const { FooterCenterTunnel, WelcomeScreenHelpHintTunnel } = useTunnels();
|
|
23316
23437
|
const device = useDevice();
|
|
23317
23438
|
const showFinalize = !appState.viewModeEnabled && appState.multiElement && device.isTouchScreen;
|
|
23318
|
-
return /* @__PURE__ */
|
|
23439
|
+
return /* @__PURE__ */ jsxs49(
|
|
23319
23440
|
"footer",
|
|
23320
23441
|
{
|
|
23321
23442
|
role: "contentinfo",
|
|
23322
23443
|
className: "layer-ui__wrapper__footer App-menu App-menu_bottom",
|
|
23323
23444
|
children: [
|
|
23324
|
-
/* @__PURE__ */
|
|
23445
|
+
/* @__PURE__ */ jsx90(
|
|
23325
23446
|
"div",
|
|
23326
23447
|
{
|
|
23327
23448
|
className: clsx39("layer-ui__wrapper__footer-left zen-mode-transition", {
|
|
23328
23449
|
"layer-ui__wrapper__footer-left--transition-left": appState.zenModeEnabled
|
|
23329
23450
|
}),
|
|
23330
|
-
children: /* @__PURE__ */
|
|
23331
|
-
/* @__PURE__ */
|
|
23451
|
+
children: /* @__PURE__ */ jsx90(Stack_default.Col, { gap: 2, children: /* @__PURE__ */ jsxs49(Section, { heading: "canvasActions", children: [
|
|
23452
|
+
/* @__PURE__ */ jsx90(Tooltip, { label: t("buttons.smartZoom"), children: /* @__PURE__ */ jsx90("div", { className: clsx39("smart-zoom-button"), children: actionManager.renderAction("smartZoom") }) }),
|
|
23453
|
+
/* @__PURE__ */ jsx90(
|
|
23332
23454
|
ZoomActions,
|
|
23333
23455
|
{
|
|
23334
23456
|
renderAction: actionManager.renderAction,
|
|
23335
23457
|
zoom: appState.zoom
|
|
23336
23458
|
}
|
|
23337
23459
|
),
|
|
23338
|
-
!appState.viewModeEnabled && /* @__PURE__ */
|
|
23460
|
+
!appState.viewModeEnabled && /* @__PURE__ */ jsx90(
|
|
23339
23461
|
UndoRedoActions,
|
|
23340
23462
|
{
|
|
23341
23463
|
renderAction: actionManager.renderAction,
|
|
@@ -23344,7 +23466,7 @@ var Footer = ({
|
|
|
23344
23466
|
})
|
|
23345
23467
|
}
|
|
23346
23468
|
),
|
|
23347
|
-
showFinalize && /* @__PURE__ */
|
|
23469
|
+
showFinalize && /* @__PURE__ */ jsx90(
|
|
23348
23470
|
FinalizeAction,
|
|
23349
23471
|
{
|
|
23350
23472
|
renderAction: actionManager.renderAction,
|
|
@@ -23356,16 +23478,16 @@ var Footer = ({
|
|
|
23356
23478
|
] }) })
|
|
23357
23479
|
}
|
|
23358
23480
|
),
|
|
23359
|
-
/* @__PURE__ */
|
|
23360
|
-
/* @__PURE__ */
|
|
23481
|
+
/* @__PURE__ */ jsx90(FooterCenterTunnel.Out, {}),
|
|
23482
|
+
/* @__PURE__ */ jsx90(
|
|
23361
23483
|
"div",
|
|
23362
23484
|
{
|
|
23363
23485
|
className: clsx39("layer-ui__wrapper__footer-right zen-mode-transition", {
|
|
23364
23486
|
"transition-right": appState.zenModeEnabled
|
|
23365
23487
|
}),
|
|
23366
|
-
children: /* @__PURE__ */
|
|
23367
|
-
renderWelcomeScreen && /* @__PURE__ */
|
|
23368
|
-
/* @__PURE__ */
|
|
23488
|
+
children: /* @__PURE__ */ jsxs49("div", { style: { position: "relative" }, children: [
|
|
23489
|
+
renderWelcomeScreen && /* @__PURE__ */ jsx90(WelcomeScreenHelpHintTunnel.Out, {}),
|
|
23490
|
+
/* @__PURE__ */ jsx90(
|
|
23369
23491
|
HelpButton,
|
|
23370
23492
|
{
|
|
23371
23493
|
onClick: () => actionManager.executeAction(actionShortcuts)
|
|
@@ -23374,7 +23496,7 @@ var Footer = ({
|
|
|
23374
23496
|
] })
|
|
23375
23497
|
}
|
|
23376
23498
|
),
|
|
23377
|
-
/* @__PURE__ */
|
|
23499
|
+
/* @__PURE__ */ jsx90(
|
|
23378
23500
|
ExitZenModeAction,
|
|
23379
23501
|
{
|
|
23380
23502
|
actionManager,
|
|
@@ -23409,7 +23531,7 @@ import React31 from "react";
|
|
|
23409
23531
|
var SidebarPropsContext = React31.createContext({});
|
|
23410
23532
|
|
|
23411
23533
|
// components/Sidebar/SidebarHeader.tsx
|
|
23412
|
-
import { jsx as
|
|
23534
|
+
import { jsx as jsx91, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
23413
23535
|
var SidebarHeader = ({
|
|
23414
23536
|
children,
|
|
23415
23537
|
className
|
|
@@ -23417,15 +23539,15 @@ var SidebarHeader = ({
|
|
|
23417
23539
|
const device = useDevice();
|
|
23418
23540
|
const props = useContext2(SidebarPropsContext);
|
|
23419
23541
|
const renderDockButton = !!(device.editor.canFitSidebar && props.shouldRenderDockButton);
|
|
23420
|
-
return /* @__PURE__ */
|
|
23542
|
+
return /* @__PURE__ */ jsxs50(
|
|
23421
23543
|
"div",
|
|
23422
23544
|
{
|
|
23423
23545
|
className: clsx40("sidebar__header", className),
|
|
23424
23546
|
"data-testid": "sidebar-header",
|
|
23425
23547
|
children: [
|
|
23426
23548
|
children,
|
|
23427
|
-
/* @__PURE__ */
|
|
23428
|
-
renderDockButton && /* @__PURE__ */
|
|
23549
|
+
/* @__PURE__ */ jsxs50("div", { className: "sidebar__header__buttons", children: [
|
|
23550
|
+
renderDockButton && /* @__PURE__ */ jsx91(Tooltip, { label: t("labels.sidebarLock"), children: /* @__PURE__ */ jsx91(
|
|
23429
23551
|
Button,
|
|
23430
23552
|
{
|
|
23431
23553
|
onSelect: () => props.onDock?.(!props.docked),
|
|
@@ -23436,7 +23558,7 @@ var SidebarHeader = ({
|
|
|
23436
23558
|
children: PinIcon
|
|
23437
23559
|
}
|
|
23438
23560
|
) }),
|
|
23439
|
-
/* @__PURE__ */
|
|
23561
|
+
/* @__PURE__ */ jsx91(
|
|
23440
23562
|
Button,
|
|
23441
23563
|
{
|
|
23442
23564
|
"data-testid": "sidebar-close",
|
|
@@ -23455,14 +23577,14 @@ SidebarHeader.displayName = "SidebarHeader";
|
|
|
23455
23577
|
|
|
23456
23578
|
// components/Sidebar/SidebarTabTrigger.tsx
|
|
23457
23579
|
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
23458
|
-
import { jsx as
|
|
23580
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
23459
23581
|
var SidebarTabTrigger = ({
|
|
23460
23582
|
children,
|
|
23461
23583
|
tab,
|
|
23462
23584
|
onSelect,
|
|
23463
23585
|
...rest
|
|
23464
23586
|
}) => {
|
|
23465
|
-
return /* @__PURE__ */
|
|
23587
|
+
return /* @__PURE__ */ jsx92(RadixTabs.Trigger, { value: tab, asChild: true, onSelect, children: /* @__PURE__ */ jsx92(
|
|
23466
23588
|
"button",
|
|
23467
23589
|
{
|
|
23468
23590
|
type: "button",
|
|
@@ -23476,18 +23598,18 @@ SidebarTabTrigger.displayName = "SidebarTabTrigger";
|
|
|
23476
23598
|
|
|
23477
23599
|
// components/Sidebar/SidebarTabTriggers.tsx
|
|
23478
23600
|
import * as RadixTabs2 from "@radix-ui/react-tabs";
|
|
23479
|
-
import { jsx as
|
|
23601
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
23480
23602
|
var SidebarTabTriggers = ({
|
|
23481
23603
|
children,
|
|
23482
23604
|
...rest
|
|
23483
23605
|
}) => {
|
|
23484
|
-
return /* @__PURE__ */
|
|
23606
|
+
return /* @__PURE__ */ jsx93(RadixTabs2.List, { className: "sidebar-triggers", ...rest, children });
|
|
23485
23607
|
};
|
|
23486
23608
|
SidebarTabTriggers.displayName = "SidebarTabTriggers";
|
|
23487
23609
|
|
|
23488
23610
|
// components/Sidebar/SidebarTrigger.tsx
|
|
23489
23611
|
import clsx41 from "clsx";
|
|
23490
|
-
import { jsx as
|
|
23612
|
+
import { jsx as jsx94, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
23491
23613
|
var SidebarTrigger = ({
|
|
23492
23614
|
name,
|
|
23493
23615
|
tab,
|
|
@@ -23500,8 +23622,8 @@ var SidebarTrigger = ({
|
|
|
23500
23622
|
}) => {
|
|
23501
23623
|
const setAppState = useExcalidrawSetAppState();
|
|
23502
23624
|
const appState = useUIAppState();
|
|
23503
|
-
return /* @__PURE__ */
|
|
23504
|
-
/* @__PURE__ */
|
|
23625
|
+
return /* @__PURE__ */ jsxs51("label", { title, className: "sidebar-trigger__label-element", children: [
|
|
23626
|
+
/* @__PURE__ */ jsx94(
|
|
23505
23627
|
"input",
|
|
23506
23628
|
{
|
|
23507
23629
|
className: "ToolIcon_type_checkbox",
|
|
@@ -23517,9 +23639,9 @@ var SidebarTrigger = ({
|
|
|
23517
23639
|
"aria-keyshortcuts": "0"
|
|
23518
23640
|
}
|
|
23519
23641
|
),
|
|
23520
|
-
/* @__PURE__ */
|
|
23521
|
-
icon && /* @__PURE__ */
|
|
23522
|
-
children && /* @__PURE__ */
|
|
23642
|
+
/* @__PURE__ */ jsxs51("div", { className: clsx41("sidebar-trigger", className), style, children: [
|
|
23643
|
+
icon && /* @__PURE__ */ jsx94("div", { children: icon }),
|
|
23644
|
+
children && /* @__PURE__ */ jsx94("div", { className: "sidebar-trigger__label", children })
|
|
23523
23645
|
] })
|
|
23524
23646
|
] });
|
|
23525
23647
|
};
|
|
@@ -23527,7 +23649,7 @@ SidebarTrigger.displayName = "SidebarTrigger";
|
|
|
23527
23649
|
|
|
23528
23650
|
// components/Sidebar/SidebarTabs.tsx
|
|
23529
23651
|
import * as RadixTabs3 from "@radix-ui/react-tabs";
|
|
23530
|
-
import { jsx as
|
|
23652
|
+
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
23531
23653
|
var SidebarTabs = ({
|
|
23532
23654
|
children,
|
|
23533
23655
|
...rest
|
|
@@ -23538,7 +23660,7 @@ var SidebarTabs = ({
|
|
|
23538
23660
|
return null;
|
|
23539
23661
|
}
|
|
23540
23662
|
const { name } = appState.openSidebar;
|
|
23541
|
-
return /* @__PURE__ */
|
|
23663
|
+
return /* @__PURE__ */ jsx95(
|
|
23542
23664
|
RadixTabs3.Root,
|
|
23543
23665
|
{
|
|
23544
23666
|
className: "sidebar-tabs-root",
|
|
@@ -23556,18 +23678,18 @@ SidebarTabs.displayName = "SidebarTabs";
|
|
|
23556
23678
|
|
|
23557
23679
|
// components/Sidebar/SidebarTab.tsx
|
|
23558
23680
|
import * as RadixTabs4 from "@radix-ui/react-tabs";
|
|
23559
|
-
import { jsx as
|
|
23681
|
+
import { jsx as jsx96 } from "react/jsx-runtime";
|
|
23560
23682
|
var SidebarTab = ({
|
|
23561
23683
|
tab,
|
|
23562
23684
|
children,
|
|
23563
23685
|
...rest
|
|
23564
23686
|
}) => {
|
|
23565
|
-
return /* @__PURE__ */
|
|
23687
|
+
return /* @__PURE__ */ jsx96(RadixTabs4.Content, { ...rest, value: tab, "data-testid": tab, children });
|
|
23566
23688
|
};
|
|
23567
23689
|
SidebarTab.displayName = "SidebarTab";
|
|
23568
23690
|
|
|
23569
23691
|
// components/Sidebar/Sidebar.tsx
|
|
23570
|
-
import { jsx as
|
|
23692
|
+
import { jsx as jsx97 } from "react/jsx-runtime";
|
|
23571
23693
|
import { createElement } from "react";
|
|
23572
23694
|
var isSidebarDockedAtom = atom(false);
|
|
23573
23695
|
var SidebarInner = forwardRef4(
|
|
@@ -23641,13 +23763,13 @@ var SidebarInner = forwardRef4(
|
|
|
23641
23763
|
document.removeEventListener("keydown" /* KEYDOWN */, handleKeyDown);
|
|
23642
23764
|
};
|
|
23643
23765
|
}, [closeLibrary, docked, device.editor.canFitSidebar]);
|
|
23644
|
-
return /* @__PURE__ */
|
|
23766
|
+
return /* @__PURE__ */ jsx97(
|
|
23645
23767
|
Island,
|
|
23646
23768
|
{
|
|
23647
23769
|
...rest,
|
|
23648
23770
|
className: clsx42("sidebar", { "sidebar--docked": docked }, className),
|
|
23649
23771
|
ref: islandRef,
|
|
23650
|
-
children: /* @__PURE__ */
|
|
23772
|
+
children: /* @__PURE__ */ jsx97(SidebarPropsContext.Provider, { value: headerPropsRef.current, children })
|
|
23651
23773
|
}
|
|
23652
23774
|
);
|
|
23653
23775
|
}
|
|
@@ -23695,7 +23817,7 @@ Sidebar.displayName = "Sidebar";
|
|
|
23695
23817
|
|
|
23696
23818
|
// components/hoc/withInternalFallback.tsx
|
|
23697
23819
|
import { useLayoutEffect as useLayoutEffect8, useRef as useRef26 } from "react";
|
|
23698
|
-
import { jsx as
|
|
23820
|
+
import { jsx as jsx98 } from "react/jsx-runtime";
|
|
23699
23821
|
var withInternalFallback = (componentName, Component) => {
|
|
23700
23822
|
const renderAtom = atom(0);
|
|
23701
23823
|
const WrapperComponent = (props) => {
|
|
@@ -23740,7 +23862,7 @@ var withInternalFallback = (componentName, Component) => {
|
|
|
23740
23862
|
) {
|
|
23741
23863
|
return null;
|
|
23742
23864
|
}
|
|
23743
|
-
return /* @__PURE__ */
|
|
23865
|
+
return /* @__PURE__ */ jsx98(Component, { ...props });
|
|
23744
23866
|
};
|
|
23745
23867
|
WrapperComponent.displayName = componentName;
|
|
23746
23868
|
return WrapperComponent;
|
|
@@ -23789,14 +23911,14 @@ async function openConfirmModal({
|
|
|
23789
23911
|
|
|
23790
23912
|
// components/RadioGroup.tsx
|
|
23791
23913
|
import clsx43 from "clsx";
|
|
23792
|
-
import { jsx as
|
|
23914
|
+
import { jsx as jsx99, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
23793
23915
|
var RadioGroup = function({
|
|
23794
23916
|
onChange,
|
|
23795
23917
|
value,
|
|
23796
23918
|
choices,
|
|
23797
23919
|
name
|
|
23798
23920
|
}) {
|
|
23799
|
-
return /* @__PURE__ */
|
|
23921
|
+
return /* @__PURE__ */ jsx99("div", { className: "RadioGroup", children: choices.map((choice) => /* @__PURE__ */ jsxs52(
|
|
23800
23922
|
"div",
|
|
23801
23923
|
{
|
|
23802
23924
|
className: clsx43("RadioGroup__choice", {
|
|
@@ -23804,7 +23926,7 @@ var RadioGroup = function({
|
|
|
23804
23926
|
}),
|
|
23805
23927
|
title: choice.ariaLabel,
|
|
23806
23928
|
children: [
|
|
23807
|
-
/* @__PURE__ */
|
|
23929
|
+
/* @__PURE__ */ jsx99(
|
|
23808
23930
|
"input",
|
|
23809
23931
|
{
|
|
23810
23932
|
name,
|
|
@@ -23822,7 +23944,7 @@ var RadioGroup = function({
|
|
|
23822
23944
|
};
|
|
23823
23945
|
|
|
23824
23946
|
// components/dropdownMenu/DropdownMenuItemContentRadio.tsx
|
|
23825
|
-
import { Fragment as Fragment13, jsx as
|
|
23947
|
+
import { Fragment as Fragment13, jsx as jsx100, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
23826
23948
|
var DropdownMenuItemContentRadio = ({
|
|
23827
23949
|
value,
|
|
23828
23950
|
shortcut,
|
|
@@ -23832,10 +23954,10 @@ var DropdownMenuItemContentRadio = ({
|
|
|
23832
23954
|
name
|
|
23833
23955
|
}) => {
|
|
23834
23956
|
const device = useDevice();
|
|
23835
|
-
return /* @__PURE__ */
|
|
23836
|
-
/* @__PURE__ */
|
|
23837
|
-
/* @__PURE__ */
|
|
23838
|
-
/* @__PURE__ */
|
|
23957
|
+
return /* @__PURE__ */ jsxs53(Fragment13, { children: [
|
|
23958
|
+
/* @__PURE__ */ jsxs53("div", { className: "dropdown-menu-item-base dropdown-menu-item-bare", children: [
|
|
23959
|
+
/* @__PURE__ */ jsx100("label", { className: "dropdown-menu-item__text", htmlFor: name, children }),
|
|
23960
|
+
/* @__PURE__ */ jsx100(
|
|
23839
23961
|
RadioGroup,
|
|
23840
23962
|
{
|
|
23841
23963
|
name,
|
|
@@ -23845,14 +23967,14 @@ var DropdownMenuItemContentRadio = ({
|
|
|
23845
23967
|
}
|
|
23846
23968
|
)
|
|
23847
23969
|
] }),
|
|
23848
|
-
shortcut && !device.editor.isMobile && /* @__PURE__ */
|
|
23970
|
+
shortcut && !device.editor.isMobile && /* @__PURE__ */ jsx100("div", { className: "dropdown-menu-item__shortcut dropdown-menu-item__shortcut--orphaned", children: shortcut })
|
|
23849
23971
|
] });
|
|
23850
23972
|
};
|
|
23851
23973
|
DropdownMenuItemContentRadio.displayName = "DropdownMenuItemContentRadio";
|
|
23852
23974
|
var DropdownMenuItemContentRadio_default = DropdownMenuItemContentRadio;
|
|
23853
23975
|
|
|
23854
23976
|
// components/main-menu/DefaultItems.tsx
|
|
23855
|
-
import { Fragment as Fragment14, jsx as
|
|
23977
|
+
import { Fragment as Fragment14, jsx as jsx101, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
23856
23978
|
var LoadScene = () => {
|
|
23857
23979
|
const { t: t2 } = useI18n();
|
|
23858
23980
|
const actionManager = useExcalidrawActionManager();
|
|
@@ -23865,19 +23987,19 @@ var LoadScene = () => {
|
|
|
23865
23987
|
title: t2("overwriteConfirm.modal.loadFromFile.title"),
|
|
23866
23988
|
actionLabel: t2("overwriteConfirm.modal.loadFromFile.button"),
|
|
23867
23989
|
color: "warning",
|
|
23868
|
-
description: /* @__PURE__ */
|
|
23990
|
+
description: /* @__PURE__ */ jsx101(
|
|
23869
23991
|
Trans_default,
|
|
23870
23992
|
{
|
|
23871
23993
|
i18nKey: "overwriteConfirm.modal.loadFromFile.description",
|
|
23872
|
-
bold: (text) => /* @__PURE__ */
|
|
23873
|
-
br: () => /* @__PURE__ */
|
|
23994
|
+
bold: (text) => /* @__PURE__ */ jsx101("strong", { children: text }),
|
|
23995
|
+
br: () => /* @__PURE__ */ jsx101("br", {})
|
|
23874
23996
|
}
|
|
23875
23997
|
)
|
|
23876
23998
|
})) {
|
|
23877
23999
|
actionManager.executeAction(actionLoadScene);
|
|
23878
24000
|
}
|
|
23879
24001
|
};
|
|
23880
|
-
return /* @__PURE__ */
|
|
24002
|
+
return /* @__PURE__ */ jsx101(
|
|
23881
24003
|
DropdownMenuItem_default,
|
|
23882
24004
|
{
|
|
23883
24005
|
icon: LoadIcon,
|
|
@@ -23896,7 +24018,7 @@ var SaveToActiveFile = () => {
|
|
|
23896
24018
|
if (!actionManager.isActionEnabled(actionSaveToActiveFile)) {
|
|
23897
24019
|
return null;
|
|
23898
24020
|
}
|
|
23899
|
-
return /* @__PURE__ */
|
|
24021
|
+
return /* @__PURE__ */ jsx101(
|
|
23900
24022
|
DropdownMenuItem_default,
|
|
23901
24023
|
{
|
|
23902
24024
|
shortcut: getShortcutFromShortcutName("saveScene"),
|
|
@@ -23912,7 +24034,7 @@ SaveToActiveFile.displayName = "SaveToActiveFile";
|
|
|
23912
24034
|
var SaveAsImage = () => {
|
|
23913
24035
|
const setAppState = useExcalidrawSetAppState();
|
|
23914
24036
|
const { t: t2 } = useI18n();
|
|
23915
|
-
return /* @__PURE__ */
|
|
24037
|
+
return /* @__PURE__ */ jsx101(
|
|
23916
24038
|
DropdownMenuItem_default,
|
|
23917
24039
|
{
|
|
23918
24040
|
icon: ExportImageIcon,
|
|
@@ -23928,7 +24050,7 @@ SaveAsImage.displayName = "SaveAsImage";
|
|
|
23928
24050
|
var CommandPalette2 = (opts) => {
|
|
23929
24051
|
const setAppState = useExcalidrawSetAppState();
|
|
23930
24052
|
const { t: t2 } = useI18n();
|
|
23931
|
-
return /* @__PURE__ */
|
|
24053
|
+
return /* @__PURE__ */ jsx101(
|
|
23932
24054
|
DropdownMenuItem_default,
|
|
23933
24055
|
{
|
|
23934
24056
|
icon: boltIcon,
|
|
@@ -23948,7 +24070,7 @@ CommandPalette2.displayName = "CommandPalette";
|
|
|
23948
24070
|
var SearchMenu = (opts) => {
|
|
23949
24071
|
const { t: t2 } = useI18n();
|
|
23950
24072
|
const actionManager = useExcalidrawActionManager();
|
|
23951
|
-
return /* @__PURE__ */
|
|
24073
|
+
return /* @__PURE__ */ jsx101(
|
|
23952
24074
|
DropdownMenuItem_default,
|
|
23953
24075
|
{
|
|
23954
24076
|
icon: searchIcon,
|
|
@@ -23967,7 +24089,7 @@ SearchMenu.displayName = "SearchMenu";
|
|
|
23967
24089
|
var Help = () => {
|
|
23968
24090
|
const { t: t2 } = useI18n();
|
|
23969
24091
|
const actionManager = useExcalidrawActionManager();
|
|
23970
|
-
return /* @__PURE__ */
|
|
24092
|
+
return /* @__PURE__ */ jsx101(
|
|
23971
24093
|
DropdownMenuItem_default,
|
|
23972
24094
|
{
|
|
23973
24095
|
"data-testid": "help-menu-item",
|
|
@@ -23989,7 +24111,7 @@ var ToggleTheme = (props) => {
|
|
|
23989
24111
|
return null;
|
|
23990
24112
|
}
|
|
23991
24113
|
if (props?.allowSystemTheme) {
|
|
23992
|
-
return /* @__PURE__ */
|
|
24114
|
+
return /* @__PURE__ */ jsx101(
|
|
23993
24115
|
DropdownMenuItemContentRadio_default,
|
|
23994
24116
|
{
|
|
23995
24117
|
name: "theme",
|
|
@@ -24016,7 +24138,7 @@ var ToggleTheme = (props) => {
|
|
|
24016
24138
|
}
|
|
24017
24139
|
);
|
|
24018
24140
|
}
|
|
24019
|
-
return /* @__PURE__ */
|
|
24141
|
+
return /* @__PURE__ */ jsx101(
|
|
24020
24142
|
DropdownMenuItem_default,
|
|
24021
24143
|
{
|
|
24022
24144
|
onSelect: (event) => {
|
|
@@ -24046,8 +24168,8 @@ var ChangeCanvasBackground = () => {
|
|
|
24046
24168
|
if (appState.viewModeEnabled || !appProps.UIOptions.canvasActions.changeViewBackgroundColor) {
|
|
24047
24169
|
return null;
|
|
24048
24170
|
}
|
|
24049
|
-
return /* @__PURE__ */
|
|
24050
|
-
/* @__PURE__ */
|
|
24171
|
+
return /* @__PURE__ */ jsxs54("div", { style: { marginTop: "0.5rem" }, children: [
|
|
24172
|
+
/* @__PURE__ */ jsx101(
|
|
24051
24173
|
"div",
|
|
24052
24174
|
{
|
|
24053
24175
|
"data-testid": "canvas-background-label",
|
|
@@ -24055,14 +24177,14 @@ var ChangeCanvasBackground = () => {
|
|
|
24055
24177
|
children: t2("labels.canvasBackground")
|
|
24056
24178
|
}
|
|
24057
24179
|
),
|
|
24058
|
-
/* @__PURE__ */
|
|
24180
|
+
/* @__PURE__ */ jsx101("div", { style: { padding: "0 0.625rem" }, children: actionManager.renderAction("changeViewBackgroundColor") })
|
|
24059
24181
|
] });
|
|
24060
24182
|
};
|
|
24061
24183
|
ChangeCanvasBackground.displayName = "ChangeCanvasBackground";
|
|
24062
24184
|
var Export = () => {
|
|
24063
24185
|
const { t: t2 } = useI18n();
|
|
24064
24186
|
const setAppState = useExcalidrawSetAppState();
|
|
24065
|
-
return /* @__PURE__ */
|
|
24187
|
+
return /* @__PURE__ */ jsx101(
|
|
24066
24188
|
DropdownMenuItem_default,
|
|
24067
24189
|
{
|
|
24068
24190
|
icon: ExportIcon,
|
|
@@ -24078,8 +24200,8 @@ var Export = () => {
|
|
|
24078
24200
|
Export.displayName = "Export";
|
|
24079
24201
|
var Socials = () => {
|
|
24080
24202
|
const { t: t2 } = useI18n();
|
|
24081
|
-
return /* @__PURE__ */
|
|
24082
|
-
/* @__PURE__ */
|
|
24203
|
+
return /* @__PURE__ */ jsxs54(Fragment14, { children: [
|
|
24204
|
+
/* @__PURE__ */ jsx101(
|
|
24083
24205
|
DropdownMenuItemLink_default,
|
|
24084
24206
|
{
|
|
24085
24207
|
icon: GithubIcon,
|
|
@@ -24088,7 +24210,7 @@ var Socials = () => {
|
|
|
24088
24210
|
children: "GitHub"
|
|
24089
24211
|
}
|
|
24090
24212
|
),
|
|
24091
|
-
/* @__PURE__ */
|
|
24213
|
+
/* @__PURE__ */ jsx101(
|
|
24092
24214
|
DropdownMenuItemLink_default,
|
|
24093
24215
|
{
|
|
24094
24216
|
icon: XBrandIcon,
|
|
@@ -24097,7 +24219,7 @@ var Socials = () => {
|
|
|
24097
24219
|
children: t2("labels.followUs")
|
|
24098
24220
|
}
|
|
24099
24221
|
),
|
|
24100
|
-
/* @__PURE__ */
|
|
24222
|
+
/* @__PURE__ */ jsx101(
|
|
24101
24223
|
DropdownMenuItemLink_default,
|
|
24102
24224
|
{
|
|
24103
24225
|
icon: DiscordIcon,
|
|
@@ -24114,7 +24236,7 @@ var LiveCollaborationTrigger = ({
|
|
|
24114
24236
|
isCollaborating
|
|
24115
24237
|
}) => {
|
|
24116
24238
|
const { t: t2 } = useI18n();
|
|
24117
|
-
return /* @__PURE__ */
|
|
24239
|
+
return /* @__PURE__ */ jsx101(
|
|
24118
24240
|
DropdownMenuItem_default,
|
|
24119
24241
|
{
|
|
24120
24242
|
"data-testid": "collab-button",
|
|
@@ -24130,7 +24252,7 @@ var LiveCollaborationTrigger = ({
|
|
|
24130
24252
|
LiveCollaborationTrigger.displayName = "LiveCollaborationTrigger";
|
|
24131
24253
|
|
|
24132
24254
|
// components/main-menu/MainMenu.tsx
|
|
24133
|
-
import { jsx as
|
|
24255
|
+
import { jsx as jsx102, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
24134
24256
|
var MainMenu = Object.assign(
|
|
24135
24257
|
withInternalFallback(
|
|
24136
24258
|
"MainMenu",
|
|
@@ -24143,8 +24265,8 @@ var MainMenu = Object.assign(
|
|
|
24143
24265
|
const appState = useUIAppState();
|
|
24144
24266
|
const setAppState = useExcalidrawSetAppState();
|
|
24145
24267
|
const onClickOutside = device.editor.isMobile ? void 0 : () => setAppState({ openMenu: null });
|
|
24146
|
-
return /* @__PURE__ */
|
|
24147
|
-
/* @__PURE__ */
|
|
24268
|
+
return /* @__PURE__ */ jsx102(MainMenuTunnel.In, { children: /* @__PURE__ */ jsxs55(DropdownMenu_default, { open: appState.openMenu === "canvas", children: [
|
|
24269
|
+
/* @__PURE__ */ jsx102(
|
|
24148
24270
|
DropdownMenu_default.Trigger,
|
|
24149
24271
|
{
|
|
24150
24272
|
onToggle: () => {
|
|
@@ -24157,7 +24279,7 @@ var MainMenu = Object.assign(
|
|
|
24157
24279
|
children: HamburgerMenuIcon
|
|
24158
24280
|
}
|
|
24159
24281
|
),
|
|
24160
|
-
/* @__PURE__ */
|
|
24282
|
+
/* @__PURE__ */ jsxs55(
|
|
24161
24283
|
DropdownMenu_default.Content,
|
|
24162
24284
|
{
|
|
24163
24285
|
onClickOutside,
|
|
@@ -24166,9 +24288,9 @@ var MainMenu = Object.assign(
|
|
|
24166
24288
|
}),
|
|
24167
24289
|
children: [
|
|
24168
24290
|
children,
|
|
24169
|
-
device.editor.isMobile && appState.collaborators.size > 0 && /* @__PURE__ */
|
|
24170
|
-
/* @__PURE__ */
|
|
24171
|
-
/* @__PURE__ */
|
|
24291
|
+
device.editor.isMobile && appState.collaborators.size > 0 && /* @__PURE__ */ jsxs55("fieldset", { className: "UserList-Wrapper", children: [
|
|
24292
|
+
/* @__PURE__ */ jsx102("legend", { children: t("labels.collaborators") }),
|
|
24293
|
+
/* @__PURE__ */ jsx102(
|
|
24172
24294
|
UserList,
|
|
24173
24295
|
{
|
|
24174
24296
|
mobile: true,
|
|
@@ -24198,7 +24320,7 @@ var MainMenu_default = MainMenu;
|
|
|
24198
24320
|
// components/FilledButton.tsx
|
|
24199
24321
|
import clsx45 from "clsx";
|
|
24200
24322
|
import { forwardRef as forwardRef5, useState as useState26 } from "react";
|
|
24201
|
-
import { jsx as
|
|
24323
|
+
import { jsx as jsx103, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
24202
24324
|
var FilledButton = forwardRef5(
|
|
24203
24325
|
({
|
|
24204
24326
|
children,
|
|
@@ -24235,7 +24357,7 @@ var FilledButton = forwardRef5(
|
|
|
24235
24357
|
};
|
|
24236
24358
|
const _status = isLoading ? "loading" : status;
|
|
24237
24359
|
color = _status === "success" ? "success" : color;
|
|
24238
|
-
return /* @__PURE__ */
|
|
24360
|
+
return /* @__PURE__ */ jsx103(
|
|
24239
24361
|
"button",
|
|
24240
24362
|
{
|
|
24241
24363
|
className: clsx45(
|
|
@@ -24252,9 +24374,9 @@ var FilledButton = forwardRef5(
|
|
|
24252
24374
|
"aria-label": label,
|
|
24253
24375
|
ref,
|
|
24254
24376
|
disabled: _status === "loading" || _status === "success",
|
|
24255
|
-
children: /* @__PURE__ */
|
|
24256
|
-
_status === "loading" ? /* @__PURE__ */
|
|
24257
|
-
icon && /* @__PURE__ */
|
|
24377
|
+
children: /* @__PURE__ */ jsxs56("div", { className: "ExcButton__contents", children: [
|
|
24378
|
+
_status === "loading" ? /* @__PURE__ */ jsx103(Spinner_default, { className: "ExcButton__statusIcon" }) : _status === "success" && /* @__PURE__ */ jsx103("div", { className: "ExcButton__statusIcon", children: tablerCheckIcon }),
|
|
24379
|
+
icon && /* @__PURE__ */ jsx103("div", { className: "ExcButton__icon", "aria-hidden": true, children: icon }),
|
|
24258
24380
|
variant !== "icon" && (children ?? label)
|
|
24259
24381
|
] })
|
|
24260
24382
|
}
|
|
@@ -24263,17 +24385,17 @@ var FilledButton = forwardRef5(
|
|
|
24263
24385
|
);
|
|
24264
24386
|
|
|
24265
24387
|
// components/OverwriteConfirm/OverwriteConfirmActions.tsx
|
|
24266
|
-
import { jsx as
|
|
24388
|
+
import { jsx as jsx104, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
24267
24389
|
var Action = ({
|
|
24268
24390
|
title,
|
|
24269
24391
|
children,
|
|
24270
24392
|
actionLabel,
|
|
24271
24393
|
onClick
|
|
24272
24394
|
}) => {
|
|
24273
|
-
return /* @__PURE__ */
|
|
24274
|
-
/* @__PURE__ */
|
|
24275
|
-
/* @__PURE__ */
|
|
24276
|
-
/* @__PURE__ */
|
|
24395
|
+
return /* @__PURE__ */ jsxs57("div", { className: "OverwriteConfirm__Actions__Action", children: [
|
|
24396
|
+
/* @__PURE__ */ jsx104("h4", { children: title }),
|
|
24397
|
+
/* @__PURE__ */ jsx104("div", { className: "OverwriteConfirm__Actions__Action__content", children }),
|
|
24398
|
+
/* @__PURE__ */ jsx104(
|
|
24277
24399
|
FilledButton,
|
|
24278
24400
|
{
|
|
24279
24401
|
variant: "outlined",
|
|
@@ -24290,7 +24412,7 @@ var ExportToImage = () => {
|
|
|
24290
24412
|
const { t: t2 } = useI18n();
|
|
24291
24413
|
const actionManager = useExcalidrawActionManager();
|
|
24292
24414
|
const setAppState = useExcalidrawSetAppState();
|
|
24293
|
-
return /* @__PURE__ */
|
|
24415
|
+
return /* @__PURE__ */ jsx104(
|
|
24294
24416
|
Action,
|
|
24295
24417
|
{
|
|
24296
24418
|
title: t2("overwriteConfirm.action.exportToImage.title"),
|
|
@@ -24306,7 +24428,7 @@ var ExportToImage = () => {
|
|
|
24306
24428
|
var SaveToDisk = () => {
|
|
24307
24429
|
const { t: t2 } = useI18n();
|
|
24308
24430
|
const actionManager = useExcalidrawActionManager();
|
|
24309
|
-
return /* @__PURE__ */
|
|
24431
|
+
return /* @__PURE__ */ jsx104(
|
|
24310
24432
|
Action,
|
|
24311
24433
|
{
|
|
24312
24434
|
title: t2("overwriteConfirm.action.saveToDisk.title"),
|
|
@@ -24320,7 +24442,7 @@ var SaveToDisk = () => {
|
|
|
24320
24442
|
};
|
|
24321
24443
|
var Actions = Object.assign(
|
|
24322
24444
|
({ children }) => {
|
|
24323
|
-
return /* @__PURE__ */
|
|
24445
|
+
return /* @__PURE__ */ jsx104("div", { className: "OverwriteConfirm__Actions", children });
|
|
24324
24446
|
},
|
|
24325
24447
|
{
|
|
24326
24448
|
ExportToImage,
|
|
@@ -24329,7 +24451,7 @@ var Actions = Object.assign(
|
|
|
24329
24451
|
);
|
|
24330
24452
|
|
|
24331
24453
|
// components/OverwriteConfirm/OverwriteConfirm.tsx
|
|
24332
|
-
import { jsx as
|
|
24454
|
+
import { jsx as jsx105, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
24333
24455
|
var OverwriteConfirmDialog = Object.assign(
|
|
24334
24456
|
withInternalFallback(
|
|
24335
24457
|
"OverwriteConfirmDialog",
|
|
@@ -24349,17 +24471,17 @@ var OverwriteConfirmDialog = Object.assign(
|
|
|
24349
24471
|
overwriteConfirmState.onConfirm();
|
|
24350
24472
|
setState((state) => ({ ...state, active: false }));
|
|
24351
24473
|
};
|
|
24352
|
-
return /* @__PURE__ */
|
|
24353
|
-
/* @__PURE__ */
|
|
24354
|
-
/* @__PURE__ */
|
|
24474
|
+
return /* @__PURE__ */ jsx105(OverwriteConfirmDialogTunnel.In, { children: /* @__PURE__ */ jsx105(Dialog, { onCloseRequest: handleClose, title: false, size: 916, children: /* @__PURE__ */ jsxs58("div", { className: "OverwriteConfirm", children: [
|
|
24475
|
+
/* @__PURE__ */ jsx105("h3", { children: overwriteConfirmState.title }),
|
|
24476
|
+
/* @__PURE__ */ jsxs58(
|
|
24355
24477
|
"div",
|
|
24356
24478
|
{
|
|
24357
24479
|
className: `OverwriteConfirm__Description OverwriteConfirm__Description--color-${overwriteConfirmState.color}`,
|
|
24358
24480
|
children: [
|
|
24359
|
-
/* @__PURE__ */
|
|
24360
|
-
/* @__PURE__ */
|
|
24361
|
-
/* @__PURE__ */
|
|
24362
|
-
/* @__PURE__ */
|
|
24481
|
+
/* @__PURE__ */ jsx105("div", { className: "OverwriteConfirm__Description__icon", children: alertTriangleIcon }),
|
|
24482
|
+
/* @__PURE__ */ jsx105("div", { children: overwriteConfirmState.description }),
|
|
24483
|
+
/* @__PURE__ */ jsx105("div", { className: "OverwriteConfirm__Description__spacer" }),
|
|
24484
|
+
/* @__PURE__ */ jsx105(
|
|
24363
24485
|
FilledButton,
|
|
24364
24486
|
{
|
|
24365
24487
|
color: overwriteConfirmState.color,
|
|
@@ -24371,7 +24493,7 @@ var OverwriteConfirmDialog = Object.assign(
|
|
|
24371
24493
|
]
|
|
24372
24494
|
}
|
|
24373
24495
|
),
|
|
24374
|
-
/* @__PURE__ */
|
|
24496
|
+
/* @__PURE__ */ jsx105(Actions, { children })
|
|
24375
24497
|
] }) }) });
|
|
24376
24498
|
}
|
|
24377
24499
|
),
|
|
@@ -24388,7 +24510,7 @@ import clsx47 from "clsx";
|
|
|
24388
24510
|
import clsx46 from "clsx";
|
|
24389
24511
|
import debounce2 from "lodash.debounce";
|
|
24390
24512
|
import { Fragment as Fragment15, memo as memo4, useEffect as useEffect31, useRef as useRef27, useState as useState27 } from "react";
|
|
24391
|
-
import { Fragment as Fragment16, jsx as
|
|
24513
|
+
import { Fragment as Fragment16, jsx as jsx106, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
24392
24514
|
var searchQueryAtom = atom("");
|
|
24393
24515
|
var searchItemInFocusAtom = atom(null);
|
|
24394
24516
|
var SEARCH_DEBOUNCE = 350;
|
|
@@ -24590,8 +24712,8 @@ var SearchMenu2 = () => {
|
|
|
24590
24712
|
});
|
|
24591
24713
|
}, [setAppState, stableState, app]);
|
|
24592
24714
|
const matchCount = `${searchMatches.items.length} ${searchMatches.items.length === 1 ? t("search.singleResult") : t("search.multipleResults")}`;
|
|
24593
|
-
return /* @__PURE__ */
|
|
24594
|
-
/* @__PURE__ */
|
|
24715
|
+
return /* @__PURE__ */ jsxs59("div", { className: "layer-ui__search", children: [
|
|
24716
|
+
/* @__PURE__ */ jsx106("div", { className: "layer-ui__search-header", children: /* @__PURE__ */ jsx106(
|
|
24595
24717
|
TextField,
|
|
24596
24718
|
{
|
|
24597
24719
|
className: CLASSES.SEARCH_MENU_INPUT_WRAPPER,
|
|
@@ -24624,15 +24746,15 @@ var SearchMenu2 = () => {
|
|
|
24624
24746
|
selectOnRender: true
|
|
24625
24747
|
}
|
|
24626
24748
|
) }),
|
|
24627
|
-
/* @__PURE__ */
|
|
24628
|
-
searchMatches.items.length > 0 && /* @__PURE__ */
|
|
24629
|
-
focusIndex !== null && focusIndex > -1 ? /* @__PURE__ */
|
|
24749
|
+
/* @__PURE__ */ jsxs59("div", { className: "layer-ui__search-count", children: [
|
|
24750
|
+
searchMatches.items.length > 0 && /* @__PURE__ */ jsxs59(Fragment16, { children: [
|
|
24751
|
+
focusIndex !== null && focusIndex > -1 ? /* @__PURE__ */ jsxs59("div", { children: [
|
|
24630
24752
|
focusIndex + 1,
|
|
24631
24753
|
" / ",
|
|
24632
24754
|
matchCount
|
|
24633
|
-
] }) : /* @__PURE__ */
|
|
24634
|
-
/* @__PURE__ */
|
|
24635
|
-
/* @__PURE__ */
|
|
24755
|
+
] }) : /* @__PURE__ */ jsx106("div", { children: matchCount }),
|
|
24756
|
+
/* @__PURE__ */ jsxs59("div", { className: "result-nav", children: [
|
|
24757
|
+
/* @__PURE__ */ jsx106(
|
|
24636
24758
|
Button,
|
|
24637
24759
|
{
|
|
24638
24760
|
onSelect: () => {
|
|
@@ -24642,7 +24764,7 @@ var SearchMenu2 = () => {
|
|
|
24642
24764
|
children: collapseDownIcon
|
|
24643
24765
|
}
|
|
24644
24766
|
),
|
|
24645
|
-
/* @__PURE__ */
|
|
24767
|
+
/* @__PURE__ */ jsx106(
|
|
24646
24768
|
Button,
|
|
24647
24769
|
{
|
|
24648
24770
|
onSelect: () => {
|
|
@@ -24654,9 +24776,9 @@ var SearchMenu2 = () => {
|
|
|
24654
24776
|
)
|
|
24655
24777
|
] })
|
|
24656
24778
|
] }),
|
|
24657
|
-
searchMatches.items.length === 0 && searchQuery && searchedQueryRef.current && /* @__PURE__ */
|
|
24779
|
+
searchMatches.items.length === 0 && searchQuery && searchedQueryRef.current && /* @__PURE__ */ jsx106("div", { style: { margin: "1rem auto" }, children: t("search.noMatch") })
|
|
24658
24780
|
] }),
|
|
24659
|
-
/* @__PURE__ */
|
|
24781
|
+
/* @__PURE__ */ jsx106(
|
|
24660
24782
|
MatchList,
|
|
24661
24783
|
{
|
|
24662
24784
|
matches: searchMatches,
|
|
@@ -24680,7 +24802,7 @@ var ListItem = (props) => {
|
|
|
24680
24802
|
),
|
|
24681
24803
|
props.preview.moreAfter ? "..." : ""
|
|
24682
24804
|
];
|
|
24683
|
-
return /* @__PURE__ */
|
|
24805
|
+
return /* @__PURE__ */ jsx106(
|
|
24684
24806
|
"div",
|
|
24685
24807
|
{
|
|
24686
24808
|
tabIndex: -1,
|
|
@@ -24693,12 +24815,12 @@ var ListItem = (props) => {
|
|
|
24693
24815
|
ref?.scrollIntoView({ behavior: "auto", block: "nearest" });
|
|
24694
24816
|
}
|
|
24695
24817
|
},
|
|
24696
|
-
children: /* @__PURE__ */
|
|
24818
|
+
children: /* @__PURE__ */ jsx106("div", { className: "preview-text", children: preview.flatMap((text, idx) => /* @__PURE__ */ jsx106(Fragment15, { children: idx === 2 ? /* @__PURE__ */ jsx106("b", { children: text }) : text }, idx)) })
|
|
24697
24819
|
}
|
|
24698
24820
|
);
|
|
24699
24821
|
};
|
|
24700
24822
|
var MatchListBase = (props) => {
|
|
24701
|
-
return /* @__PURE__ */
|
|
24823
|
+
return /* @__PURE__ */ jsx106("div", { className: "layer-ui__search-result-container", children: props.matches.items.map((searchMatch, index) => /* @__PURE__ */ jsx106(
|
|
24702
24824
|
ListItem,
|
|
24703
24825
|
{
|
|
24704
24826
|
searchQuery: props.searchQuery,
|
|
@@ -24879,13 +25001,13 @@ var handleSearch = debounce2(
|
|
|
24879
25001
|
);
|
|
24880
25002
|
|
|
24881
25003
|
// components/DefaultSidebar.tsx
|
|
24882
|
-
import { jsx as
|
|
25004
|
+
import { jsx as jsx107, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
24883
25005
|
import { createElement as createElement2 } from "react";
|
|
24884
25006
|
var DefaultSidebarTrigger = withInternalFallback(
|
|
24885
25007
|
"DefaultSidebarTrigger",
|
|
24886
25008
|
(props) => {
|
|
24887
25009
|
const { DefaultSidebarTriggerTunnel } = useTunnels();
|
|
24888
|
-
return /* @__PURE__ */
|
|
25010
|
+
return /* @__PURE__ */ jsx107(DefaultSidebarTriggerTunnel.In, { children: /* @__PURE__ */ jsx107(
|
|
24889
25011
|
Sidebar.Trigger,
|
|
24890
25012
|
{
|
|
24891
25013
|
...props,
|
|
@@ -24898,7 +25020,7 @@ var DefaultSidebarTrigger = withInternalFallback(
|
|
|
24898
25020
|
DefaultSidebarTrigger.displayName = "DefaultSidebarTrigger";
|
|
24899
25021
|
var DefaultTabTriggers = ({ children }) => {
|
|
24900
25022
|
const { DefaultSidebarTabTriggersTunnel } = useTunnels();
|
|
24901
|
-
return /* @__PURE__ */
|
|
25023
|
+
return /* @__PURE__ */ jsx107(DefaultSidebarTabTriggersTunnel.In, { children });
|
|
24902
25024
|
};
|
|
24903
25025
|
DefaultTabTriggers.displayName = "DefaultTabTriggers";
|
|
24904
25026
|
var DefaultSidebar = Object.assign(
|
|
@@ -24934,14 +25056,14 @@ var DefaultSidebar = Object.assign(
|
|
|
24934
25056
|
)
|
|
24935
25057
|
)
|
|
24936
25058
|
},
|
|
24937
|
-
/* @__PURE__ */
|
|
24938
|
-
/* @__PURE__ */
|
|
24939
|
-
/* @__PURE__ */
|
|
24940
|
-
/* @__PURE__ */
|
|
24941
|
-
/* @__PURE__ */
|
|
25059
|
+
/* @__PURE__ */ jsxs60(Sidebar.Tabs, { children: [
|
|
25060
|
+
/* @__PURE__ */ jsx107(Sidebar.Header, { children: /* @__PURE__ */ jsxs60(Sidebar.TabTriggers, { children: [
|
|
25061
|
+
/* @__PURE__ */ jsx107(Sidebar.TabTrigger, { tab: CANVAS_SEARCH_TAB, children: searchIcon }),
|
|
25062
|
+
/* @__PURE__ */ jsx107(Sidebar.TabTrigger, { tab: LIBRARY_SIDEBAR_TAB, children: LibraryIcon }),
|
|
25063
|
+
/* @__PURE__ */ jsx107(DefaultSidebarTabTriggersTunnel.Out, {})
|
|
24942
25064
|
] }) }),
|
|
24943
|
-
/* @__PURE__ */
|
|
24944
|
-
/* @__PURE__ */
|
|
25065
|
+
/* @__PURE__ */ jsx107(Sidebar.Tab, { tab: LIBRARY_SIDEBAR_TAB, children: /* @__PURE__ */ jsx107(LibraryMenu, {}) }),
|
|
25066
|
+
/* @__PURE__ */ jsx107(Sidebar.Tab, { tab: CANVAS_SEARCH_TAB, children: /* @__PURE__ */ jsx107(SearchMenu2, {}) }),
|
|
24945
25067
|
children
|
|
24946
25068
|
] })
|
|
24947
25069
|
);
|
|
@@ -24961,7 +25083,7 @@ import { useState as useState28, useRef as useRef29, useEffect as useEffect33, u
|
|
|
24961
25083
|
|
|
24962
25084
|
// components/TTDDialog/TTDDialogInput.tsx
|
|
24963
25085
|
import { useEffect as useEffect32, useRef as useRef28 } from "react";
|
|
24964
|
-
import { jsx as
|
|
25086
|
+
import { jsx as jsx108 } from "react/jsx-runtime";
|
|
24965
25087
|
var TTDDialogInput = ({
|
|
24966
25088
|
input,
|
|
24967
25089
|
placeholder,
|
|
@@ -24989,7 +25111,7 @@ var TTDDialogInput = ({
|
|
|
24989
25111
|
};
|
|
24990
25112
|
}
|
|
24991
25113
|
}, []);
|
|
24992
|
-
return /* @__PURE__ */
|
|
25114
|
+
return /* @__PURE__ */ jsx108(
|
|
24993
25115
|
"textarea",
|
|
24994
25116
|
{
|
|
24995
25117
|
className: "ttd-dialog-input",
|
|
@@ -25003,16 +25125,16 @@ var TTDDialogInput = ({
|
|
|
25003
25125
|
};
|
|
25004
25126
|
|
|
25005
25127
|
// components/TTDDialog/TTDDialogOutput.tsx
|
|
25006
|
-
import { jsx as
|
|
25128
|
+
import { jsx as jsx109, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
25007
25129
|
var ErrorComp = ({ error }) => {
|
|
25008
|
-
return /* @__PURE__ */
|
|
25130
|
+
return /* @__PURE__ */ jsxs61(
|
|
25009
25131
|
"div",
|
|
25010
25132
|
{
|
|
25011
25133
|
"data-testid": "ttd-dialog-output-error",
|
|
25012
25134
|
className: "ttd-dialog-output-error",
|
|
25013
25135
|
children: [
|
|
25014
25136
|
"Error! ",
|
|
25015
|
-
/* @__PURE__ */
|
|
25137
|
+
/* @__PURE__ */ jsx109("p", { children: error })
|
|
25016
25138
|
]
|
|
25017
25139
|
}
|
|
25018
25140
|
);
|
|
@@ -25022,22 +25144,22 @@ var TTDDialogOutput = ({
|
|
|
25022
25144
|
canvasRef,
|
|
25023
25145
|
loaded
|
|
25024
25146
|
}) => {
|
|
25025
|
-
return /* @__PURE__ */
|
|
25026
|
-
error && /* @__PURE__ */
|
|
25027
|
-
loaded ? /* @__PURE__ */
|
|
25147
|
+
return /* @__PURE__ */ jsxs61("div", { className: "ttd-dialog-output-wrapper", children: [
|
|
25148
|
+
error && /* @__PURE__ */ jsx109(ErrorComp, { error: error.message }),
|
|
25149
|
+
loaded ? /* @__PURE__ */ jsx109(
|
|
25028
25150
|
"div",
|
|
25029
25151
|
{
|
|
25030
25152
|
ref: canvasRef,
|
|
25031
25153
|
style: { opacity: error ? "0.15" : 1 },
|
|
25032
25154
|
className: "ttd-dialog-output-canvas-container"
|
|
25033
25155
|
}
|
|
25034
|
-
) : /* @__PURE__ */
|
|
25156
|
+
) : /* @__PURE__ */ jsx109(Spinner_default, { size: "2rem" })
|
|
25035
25157
|
] });
|
|
25036
25158
|
};
|
|
25037
25159
|
|
|
25038
25160
|
// components/TTDDialog/TTDDialogPanel.tsx
|
|
25039
25161
|
import clsx48 from "clsx";
|
|
25040
|
-
import { jsx as
|
|
25162
|
+
import { jsx as jsx110, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
25041
25163
|
var TTDDialogPanel = ({
|
|
25042
25164
|
label,
|
|
25043
25165
|
children,
|
|
@@ -25048,13 +25170,13 @@ var TTDDialogPanel = ({
|
|
|
25048
25170
|
renderSubmitShortcut,
|
|
25049
25171
|
renderBottomRight
|
|
25050
25172
|
}) => {
|
|
25051
|
-
return /* @__PURE__ */
|
|
25052
|
-
/* @__PURE__ */
|
|
25053
|
-
/* @__PURE__ */
|
|
25173
|
+
return /* @__PURE__ */ jsxs62("div", { className: "ttd-dialog-panel", children: [
|
|
25174
|
+
/* @__PURE__ */ jsxs62("div", { className: "ttd-dialog-panel__header", children: [
|
|
25175
|
+
/* @__PURE__ */ jsx110("label", { children: label }),
|
|
25054
25176
|
renderTopRight?.()
|
|
25055
25177
|
] }),
|
|
25056
25178
|
children,
|
|
25057
|
-
/* @__PURE__ */
|
|
25179
|
+
/* @__PURE__ */ jsxs62(
|
|
25058
25180
|
"div",
|
|
25059
25181
|
{
|
|
25060
25182
|
className: clsx48("ttd-dialog-panel-button-container", {
|
|
@@ -25062,7 +25184,7 @@ var TTDDialogPanel = ({
|
|
|
25062
25184
|
}),
|
|
25063
25185
|
style: { display: "flex", alignItems: "center" },
|
|
25064
25186
|
children: [
|
|
25065
|
-
/* @__PURE__ */
|
|
25187
|
+
/* @__PURE__ */ jsxs62(
|
|
25066
25188
|
Button,
|
|
25067
25189
|
{
|
|
25068
25190
|
className: "ttd-dialog-panel-button",
|
|
@@ -25070,11 +25192,11 @@ var TTDDialogPanel = ({
|
|
|
25070
25192
|
},
|
|
25071
25193
|
disabled: panelActionDisabled || onTextSubmitInProgess,
|
|
25072
25194
|
children: [
|
|
25073
|
-
/* @__PURE__ */
|
|
25195
|
+
/* @__PURE__ */ jsxs62("div", { className: clsx48({ invisible: onTextSubmitInProgess }), children: [
|
|
25074
25196
|
panelAction?.label,
|
|
25075
|
-
panelAction?.icon && /* @__PURE__ */
|
|
25197
|
+
panelAction?.icon && /* @__PURE__ */ jsx110("span", { children: panelAction.icon })
|
|
25076
25198
|
] }),
|
|
25077
|
-
onTextSubmitInProgess && /* @__PURE__ */
|
|
25199
|
+
onTextSubmitInProgess && /* @__PURE__ */ jsx110(Spinner_default, {})
|
|
25078
25200
|
]
|
|
25079
25201
|
}
|
|
25080
25202
|
),
|
|
@@ -25087,17 +25209,17 @@ var TTDDialogPanel = ({
|
|
|
25087
25209
|
};
|
|
25088
25210
|
|
|
25089
25211
|
// components/TTDDialog/TTDDialogPanels.tsx
|
|
25090
|
-
import { jsx as
|
|
25212
|
+
import { jsx as jsx111 } from "react/jsx-runtime";
|
|
25091
25213
|
var TTDDialogPanels = ({ children }) => {
|
|
25092
|
-
return /* @__PURE__ */
|
|
25214
|
+
return /* @__PURE__ */ jsx111("div", { className: "ttd-dialog-panels", children });
|
|
25093
25215
|
};
|
|
25094
25216
|
|
|
25095
25217
|
// components/TTDDialog/TTDDialogSubmitShortcut.tsx
|
|
25096
|
-
import { jsx as
|
|
25218
|
+
import { jsx as jsx112, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
25097
25219
|
var TTDDialogSubmitShortcut = () => {
|
|
25098
|
-
return /* @__PURE__ */
|
|
25099
|
-
/* @__PURE__ */
|
|
25100
|
-
/* @__PURE__ */
|
|
25220
|
+
return /* @__PURE__ */ jsxs63("div", { className: "ttd-dialog-submit-shortcut", children: [
|
|
25221
|
+
/* @__PURE__ */ jsx112("div", { className: "ttd-dialog-submit-shortcut__key", children: getShortcutKey("CtrlOrCmd") }),
|
|
25222
|
+
/* @__PURE__ */ jsx112("div", { className: "ttd-dialog-submit-shortcut__key", children: getShortcutKey("Enter") })
|
|
25101
25223
|
] });
|
|
25102
25224
|
};
|
|
25103
25225
|
|
|
@@ -25205,7 +25327,7 @@ var insertToEditor = ({
|
|
|
25205
25327
|
};
|
|
25206
25328
|
|
|
25207
25329
|
// components/TTDDialog/MermaidToExcalidraw.tsx
|
|
25208
|
-
import { Fragment as Fragment17, jsx as
|
|
25330
|
+
import { Fragment as Fragment17, jsx as jsx113, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
25209
25331
|
var MERMAID_EXAMPLE = "flowchart TD\n A[Christmas] -->|Get money| B(Go shopping)\n B --> C{Let me think}\n C -->|One| D[Laptop]\n C -->|Two| E[iPhone]\n C -->|Three| F[Car]";
|
|
25210
25332
|
var debouncedSaveMermaidDefinition = debounce(saveMermaidDataToStorage, 300);
|
|
25211
25333
|
var MermaidToExcalidraw = ({
|
|
@@ -25247,18 +25369,18 @@ var MermaidToExcalidraw = ({
|
|
|
25247
25369
|
shouldSaveMermaidDataToStorage: true
|
|
25248
25370
|
});
|
|
25249
25371
|
};
|
|
25250
|
-
return /* @__PURE__ */
|
|
25251
|
-
/* @__PURE__ */
|
|
25372
|
+
return /* @__PURE__ */ jsxs64(Fragment17, { children: [
|
|
25373
|
+
/* @__PURE__ */ jsx113("div", { className: "ttd-dialog-desc", children: /* @__PURE__ */ jsx113(
|
|
25252
25374
|
Trans_default,
|
|
25253
25375
|
{
|
|
25254
25376
|
i18nKey: "mermaid.description",
|
|
25255
|
-
flowchartLink: (el) => /* @__PURE__ */
|
|
25256
|
-
sequenceLink: (el) => /* @__PURE__ */
|
|
25257
|
-
classLink: (el) => /* @__PURE__ */
|
|
25377
|
+
flowchartLink: (el) => /* @__PURE__ */ jsx113("a", { href: "https://mermaid.js.org/syntax/flowchart.html", children: el }),
|
|
25378
|
+
sequenceLink: (el) => /* @__PURE__ */ jsx113("a", { href: "https://mermaid.js.org/syntax/sequenceDiagram.html", children: el }),
|
|
25379
|
+
classLink: (el) => /* @__PURE__ */ jsx113("a", { href: "https://mermaid.js.org/syntax/classDiagram.html", children: el })
|
|
25258
25380
|
}
|
|
25259
25381
|
) }),
|
|
25260
|
-
/* @__PURE__ */
|
|
25261
|
-
/* @__PURE__ */
|
|
25382
|
+
/* @__PURE__ */ jsxs64(TTDDialogPanels, { children: [
|
|
25383
|
+
/* @__PURE__ */ jsx113(TTDDialogPanel, { label: t("mermaid.syntax"), children: /* @__PURE__ */ jsx113(
|
|
25262
25384
|
TTDDialogInput,
|
|
25263
25385
|
{
|
|
25264
25386
|
input: text,
|
|
@@ -25269,7 +25391,7 @@ var MermaidToExcalidraw = ({
|
|
|
25269
25391
|
}
|
|
25270
25392
|
}
|
|
25271
25393
|
) }),
|
|
25272
|
-
/* @__PURE__ */
|
|
25394
|
+
/* @__PURE__ */ jsx113(
|
|
25273
25395
|
TTDDialogPanel,
|
|
25274
25396
|
{
|
|
25275
25397
|
label: t("mermaid.preview"),
|
|
@@ -25280,8 +25402,8 @@ var MermaidToExcalidraw = ({
|
|
|
25280
25402
|
label: t("mermaid.button"),
|
|
25281
25403
|
icon: ArrowRightIcon
|
|
25282
25404
|
},
|
|
25283
|
-
renderSubmitShortcut: () => /* @__PURE__ */
|
|
25284
|
-
children: /* @__PURE__ */
|
|
25405
|
+
renderSubmitShortcut: () => /* @__PURE__ */ jsx113(TTDDialogSubmitShortcut, {}),
|
|
25406
|
+
children: /* @__PURE__ */ jsx113(
|
|
25285
25407
|
TTDDialogOutput,
|
|
25286
25408
|
{
|
|
25287
25409
|
canvasRef,
|
|
@@ -25299,12 +25421,12 @@ var MermaidToExcalidraw_default = MermaidToExcalidraw;
|
|
|
25299
25421
|
// components/TTDDialog/TTDDialogTabs.tsx
|
|
25300
25422
|
import * as RadixTabs5 from "@radix-ui/react-tabs";
|
|
25301
25423
|
import { useRef as useRef30 } from "react";
|
|
25302
|
-
import { jsx as
|
|
25424
|
+
import { jsx as jsx114 } from "react/jsx-runtime";
|
|
25303
25425
|
var TTDDialogTabs = (props) => {
|
|
25304
25426
|
const setAppState = useExcalidrawSetAppState();
|
|
25305
25427
|
const rootRef = useRef30(null);
|
|
25306
25428
|
const minHeightRef = useRef30(0);
|
|
25307
|
-
return /* @__PURE__ */
|
|
25429
|
+
return /* @__PURE__ */ jsx114(
|
|
25308
25430
|
RadixTabs5.Root,
|
|
25309
25431
|
{
|
|
25310
25432
|
ref: rootRef,
|
|
@@ -25337,42 +25459,42 @@ var TTDDialogTabs_default = TTDDialogTabs;
|
|
|
25337
25459
|
|
|
25338
25460
|
// components/TTDDialog/TTDDialogTabTriggers.tsx
|
|
25339
25461
|
import * as RadixTabs6 from "@radix-ui/react-tabs";
|
|
25340
|
-
import { jsx as
|
|
25462
|
+
import { jsx as jsx115 } from "react/jsx-runtime";
|
|
25341
25463
|
var TTDDialogTabTriggers = ({
|
|
25342
25464
|
children,
|
|
25343
25465
|
...rest
|
|
25344
25466
|
}) => {
|
|
25345
|
-
return /* @__PURE__ */
|
|
25467
|
+
return /* @__PURE__ */ jsx115(RadixTabs6.List, { className: "ttd-dialog-triggers", ...rest, children });
|
|
25346
25468
|
};
|
|
25347
25469
|
TTDDialogTabTriggers.displayName = "TTDDialogTabTriggers";
|
|
25348
25470
|
|
|
25349
25471
|
// components/TTDDialog/TTDDialogTabTrigger.tsx
|
|
25350
25472
|
import * as RadixTabs7 from "@radix-ui/react-tabs";
|
|
25351
|
-
import { jsx as
|
|
25473
|
+
import { jsx as jsx116 } from "react/jsx-runtime";
|
|
25352
25474
|
var TTDDialogTabTrigger = ({
|
|
25353
25475
|
children,
|
|
25354
25476
|
tab,
|
|
25355
25477
|
onSelect,
|
|
25356
25478
|
...rest
|
|
25357
25479
|
}) => {
|
|
25358
|
-
return /* @__PURE__ */
|
|
25480
|
+
return /* @__PURE__ */ jsx116(RadixTabs7.Trigger, { value: tab, asChild: true, onSelect, children: /* @__PURE__ */ jsx116("button", { type: "button", className: "ttd-dialog-tab-trigger", ...rest, children }) });
|
|
25359
25481
|
};
|
|
25360
25482
|
TTDDialogTabTrigger.displayName = "TTDDialogTabTrigger";
|
|
25361
25483
|
|
|
25362
25484
|
// components/TTDDialog/TTDDialogTab.tsx
|
|
25363
25485
|
import * as RadixTabs8 from "@radix-ui/react-tabs";
|
|
25364
|
-
import { jsx as
|
|
25486
|
+
import { jsx as jsx117 } from "react/jsx-runtime";
|
|
25365
25487
|
var TTDDialogTab = ({
|
|
25366
25488
|
tab,
|
|
25367
25489
|
children,
|
|
25368
25490
|
...rest
|
|
25369
25491
|
}) => {
|
|
25370
|
-
return /* @__PURE__ */
|
|
25492
|
+
return /* @__PURE__ */ jsx117(RadixTabs8.Content, { ...rest, value: tab, children });
|
|
25371
25493
|
};
|
|
25372
25494
|
TTDDialogTab.displayName = "TTDDialogTab";
|
|
25373
25495
|
|
|
25374
25496
|
// components/TTDDialog/TTDDialog.tsx
|
|
25375
|
-
import { jsx as
|
|
25497
|
+
import { jsx as jsx118, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
25376
25498
|
var MIN_PROMPT_LENGTH = 3;
|
|
25377
25499
|
var MAX_PROMPT_LENGTH = 1e3;
|
|
25378
25500
|
var rateLimitsAtom = atom(null);
|
|
@@ -25382,7 +25504,7 @@ var TTDDialog = (props) => {
|
|
|
25382
25504
|
if (appState.openDialog?.name !== "ttd") {
|
|
25383
25505
|
return null;
|
|
25384
25506
|
}
|
|
25385
|
-
return /* @__PURE__ */
|
|
25507
|
+
return /* @__PURE__ */ jsx118(TTDDialogBase, { ...props, tab: appState.openDialog.tab });
|
|
25386
25508
|
};
|
|
25387
25509
|
var TTDDialogBase = withInternalFallback(
|
|
25388
25510
|
"TTDDialogBase",
|
|
@@ -25496,7 +25618,7 @@ TTD mermaid definition render errror: ${error3.message}`,
|
|
|
25496
25618
|
}, [mermaidToExcalidrawLib.api]);
|
|
25497
25619
|
const data = useRef31({ elements: [], files: null });
|
|
25498
25620
|
const [error, setError] = useState29(null);
|
|
25499
|
-
return /* @__PURE__ */
|
|
25621
|
+
return /* @__PURE__ */ jsx118(
|
|
25500
25622
|
Dialog,
|
|
25501
25623
|
{
|
|
25502
25624
|
className: "ttd-dialog",
|
|
@@ -25507,11 +25629,11 @@ TTD mermaid definition render errror: ${error3.message}`,
|
|
|
25507
25629
|
title: false,
|
|
25508
25630
|
...rest,
|
|
25509
25631
|
autofocus: false,
|
|
25510
|
-
children: /* @__PURE__ */
|
|
25511
|
-
"__fallback" in rest && rest.__fallback ? /* @__PURE__ */
|
|
25512
|
-
/* @__PURE__ */
|
|
25632
|
+
children: /* @__PURE__ */ jsxs65(TTDDialogTabs_default, { dialog: "ttd", tab, children: [
|
|
25633
|
+
"__fallback" in rest && rest.__fallback ? /* @__PURE__ */ jsx118("p", { className: "dialog-mermaid-title", children: t("mermaid.title") }) : /* @__PURE__ */ jsxs65(TTDDialogTabTriggers, { children: [
|
|
25634
|
+
/* @__PURE__ */ jsx118(TTDDialogTabTrigger, { tab: "text-to-diagram", children: /* @__PURE__ */ jsxs65("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
25513
25635
|
t("labels.textToDiagram"),
|
|
25514
|
-
/* @__PURE__ */
|
|
25636
|
+
/* @__PURE__ */ jsx118(
|
|
25515
25637
|
"div",
|
|
25516
25638
|
{
|
|
25517
25639
|
style: {
|
|
@@ -25529,18 +25651,18 @@ TTD mermaid definition render errror: ${error3.message}`,
|
|
|
25529
25651
|
}
|
|
25530
25652
|
)
|
|
25531
25653
|
] }) }),
|
|
25532
|
-
/* @__PURE__ */
|
|
25654
|
+
/* @__PURE__ */ jsx118(TTDDialogTabTrigger, { tab: "mermaid", children: "Mermaid" })
|
|
25533
25655
|
] }),
|
|
25534
|
-
/* @__PURE__ */
|
|
25656
|
+
/* @__PURE__ */ jsx118(TTDDialogTab, { className: "ttd-dialog-content", tab: "mermaid", children: /* @__PURE__ */ jsx118(
|
|
25535
25657
|
MermaidToExcalidraw_default,
|
|
25536
25658
|
{
|
|
25537
25659
|
mermaidToExcalidrawLib
|
|
25538
25660
|
}
|
|
25539
25661
|
) }),
|
|
25540
|
-
!("__fallback" in rest) && /* @__PURE__ */
|
|
25541
|
-
/* @__PURE__ */
|
|
25542
|
-
/* @__PURE__ */
|
|
25543
|
-
/* @__PURE__ */
|
|
25662
|
+
!("__fallback" in rest) && /* @__PURE__ */ jsxs65(TTDDialogTab, { className: "ttd-dialog-content", tab: "text-to-diagram", children: [
|
|
25663
|
+
/* @__PURE__ */ jsx118("div", { className: "ttd-dialog-desc", children: "Currently we use Mermaid as a middle step, so you'll get best results if you describe a diagram, workflow, flow chart, and similar." }),
|
|
25664
|
+
/* @__PURE__ */ jsxs65(TTDDialogPanels, { children: [
|
|
25665
|
+
/* @__PURE__ */ jsx118(
|
|
25544
25666
|
TTDDialogPanel,
|
|
25545
25667
|
{
|
|
25546
25668
|
label: t("labels.prompt"),
|
|
@@ -25555,7 +25677,7 @@ TTD mermaid definition render errror: ${error3.message}`,
|
|
|
25555
25677
|
if (!rateLimits) {
|
|
25556
25678
|
return null;
|
|
25557
25679
|
}
|
|
25558
|
-
return /* @__PURE__ */
|
|
25680
|
+
return /* @__PURE__ */ jsxs65(
|
|
25559
25681
|
"div",
|
|
25560
25682
|
{
|
|
25561
25683
|
className: "ttd-dialog-rate-limit",
|
|
@@ -25571,10 +25693,10 @@ TTD mermaid definition render errror: ${error3.message}`,
|
|
|
25571
25693
|
}
|
|
25572
25694
|
);
|
|
25573
25695
|
},
|
|
25574
|
-
renderSubmitShortcut: () => /* @__PURE__ */
|
|
25696
|
+
renderSubmitShortcut: () => /* @__PURE__ */ jsx118(TTDDialogSubmitShortcut, {}),
|
|
25575
25697
|
renderBottomRight: () => {
|
|
25576
25698
|
if (typeof ttdGeneration?.generatedResponse === "string") {
|
|
25577
|
-
return /* @__PURE__ */
|
|
25699
|
+
return /* @__PURE__ */ jsxs65(
|
|
25578
25700
|
"div",
|
|
25579
25701
|
{
|
|
25580
25702
|
className: "excalidraw-link",
|
|
@@ -25591,14 +25713,14 @@ TTD mermaid definition render errror: ${error3.message}`,
|
|
|
25591
25713
|
},
|
|
25592
25714
|
children: [
|
|
25593
25715
|
"View as Mermaid",
|
|
25594
|
-
/* @__PURE__ */
|
|
25716
|
+
/* @__PURE__ */ jsx118(InlineIcon, { icon: ArrowRightIcon })
|
|
25595
25717
|
]
|
|
25596
25718
|
}
|
|
25597
25719
|
);
|
|
25598
25720
|
}
|
|
25599
25721
|
const ratio = prompt.length / MAX_PROMPT_LENGTH;
|
|
25600
25722
|
if (ratio > 0.8) {
|
|
25601
|
-
return /* @__PURE__ */
|
|
25723
|
+
return /* @__PURE__ */ jsxs65(
|
|
25602
25724
|
"div",
|
|
25603
25725
|
{
|
|
25604
25726
|
style: {
|
|
@@ -25618,7 +25740,7 @@ TTD mermaid definition render errror: ${error3.message}`,
|
|
|
25618
25740
|
}
|
|
25619
25741
|
return null;
|
|
25620
25742
|
},
|
|
25621
|
-
children: /* @__PURE__ */
|
|
25743
|
+
children: /* @__PURE__ */ jsx118(
|
|
25622
25744
|
TTDDialogInput,
|
|
25623
25745
|
{
|
|
25624
25746
|
onChange: handleTextChange,
|
|
@@ -25631,7 +25753,7 @@ TTD mermaid definition render errror: ${error3.message}`,
|
|
|
25631
25753
|
)
|
|
25632
25754
|
}
|
|
25633
25755
|
),
|
|
25634
|
-
/* @__PURE__ */
|
|
25756
|
+
/* @__PURE__ */ jsx118(
|
|
25635
25757
|
TTDDialogPanel,
|
|
25636
25758
|
{
|
|
25637
25759
|
label: "Preview",
|
|
@@ -25643,7 +25765,7 @@ TTD mermaid definition render errror: ${error3.message}`,
|
|
|
25643
25765
|
label: "Insert",
|
|
25644
25766
|
icon: ArrowRightIcon
|
|
25645
25767
|
},
|
|
25646
|
-
children: /* @__PURE__ */
|
|
25768
|
+
children: /* @__PURE__ */ jsx118(
|
|
25647
25769
|
TTDDialogOutput,
|
|
25648
25770
|
{
|
|
25649
25771
|
canvasRef: someRandomDivRef,
|
|
@@ -25772,7 +25894,7 @@ var updateBindings = (latestElement, elementsMap, elements, scene, options) => {
|
|
|
25772
25894
|
};
|
|
25773
25895
|
|
|
25774
25896
|
// components/Stats/DragInput.tsx
|
|
25775
|
-
import { jsx as
|
|
25897
|
+
import { jsx as jsx119, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
25776
25898
|
var StatsDragInput = ({
|
|
25777
25899
|
label,
|
|
25778
25900
|
icon,
|
|
@@ -25873,13 +25995,13 @@ var StatsDragInput = ({
|
|
|
25873
25995
|
if (!editable) {
|
|
25874
25996
|
return null;
|
|
25875
25997
|
}
|
|
25876
|
-
return /* @__PURE__ */
|
|
25998
|
+
return /* @__PURE__ */ jsxs66(
|
|
25877
25999
|
"div",
|
|
25878
26000
|
{
|
|
25879
26001
|
className: clsx49("drag-input-container", !editable && "disabled"),
|
|
25880
26002
|
"data-testid": label,
|
|
25881
26003
|
children: [
|
|
25882
|
-
/* @__PURE__ */
|
|
26004
|
+
/* @__PURE__ */ jsx119(
|
|
25883
26005
|
"div",
|
|
25884
26006
|
{
|
|
25885
26007
|
className: "drag-input-label",
|
|
@@ -25959,10 +26081,10 @@ var StatsDragInput = ({
|
|
|
25959
26081
|
labelRef.current.style.cursor = "ew-resize";
|
|
25960
26082
|
}
|
|
25961
26083
|
},
|
|
25962
|
-
children: icon ? /* @__PURE__ */
|
|
26084
|
+
children: icon ? /* @__PURE__ */ jsx119(InlineIcon, { icon }) : label
|
|
25963
26085
|
}
|
|
25964
26086
|
),
|
|
25965
|
-
/* @__PURE__ */
|
|
26087
|
+
/* @__PURE__ */ jsx119(
|
|
25966
26088
|
"input",
|
|
25967
26089
|
{
|
|
25968
26090
|
className: "drag-input",
|
|
@@ -26009,7 +26131,7 @@ var StatsDragInput = ({
|
|
|
26009
26131
|
var DragInput_default = StatsDragInput;
|
|
26010
26132
|
|
|
26011
26133
|
// components/Stats/Angle.tsx
|
|
26012
|
-
import { jsx as
|
|
26134
|
+
import { jsx as jsx120 } from "react/jsx-runtime";
|
|
26013
26135
|
var STEP_SIZE = 15;
|
|
26014
26136
|
var handleDegreeChange = ({
|
|
26015
26137
|
accumulatedChange,
|
|
@@ -26057,7 +26179,7 @@ var handleDegreeChange = ({
|
|
|
26057
26179
|
}
|
|
26058
26180
|
};
|
|
26059
26181
|
var Angle = ({ element, scene, appState, property }) => {
|
|
26060
|
-
return /* @__PURE__ */
|
|
26182
|
+
return /* @__PURE__ */ jsx120(
|
|
26061
26183
|
DragInput_default,
|
|
26062
26184
|
{
|
|
26063
26185
|
label: "A",
|
|
@@ -26075,7 +26197,7 @@ var Angle = ({ element, scene, appState, property }) => {
|
|
|
26075
26197
|
var Angle_default = Angle;
|
|
26076
26198
|
|
|
26077
26199
|
// components/Stats/CanvasGrid.tsx
|
|
26078
|
-
import { jsx as
|
|
26200
|
+
import { jsx as jsx121 } from "react/jsx-runtime";
|
|
26079
26201
|
var STEP_SIZE2 = 5;
|
|
26080
26202
|
var CanvasGrid = ({
|
|
26081
26203
|
property,
|
|
@@ -26083,7 +26205,7 @@ var CanvasGrid = ({
|
|
|
26083
26205
|
appState,
|
|
26084
26206
|
setAppState
|
|
26085
26207
|
}) => {
|
|
26086
|
-
return /* @__PURE__ */
|
|
26208
|
+
return /* @__PURE__ */ jsx121(
|
|
26087
26209
|
DragInput_default,
|
|
26088
26210
|
{
|
|
26089
26211
|
label: "Grid step",
|
|
@@ -26126,7 +26248,7 @@ var CanvasGrid = ({
|
|
|
26126
26248
|
var CanvasGrid_default = CanvasGrid;
|
|
26127
26249
|
|
|
26128
26250
|
// components/Stats/Dimension.tsx
|
|
26129
|
-
import { jsx as
|
|
26251
|
+
import { jsx as jsx122 } from "react/jsx-runtime";
|
|
26130
26252
|
var STEP_SIZE3 = 10;
|
|
26131
26253
|
var _shouldKeepAspectRatio = (element) => {
|
|
26132
26254
|
return element.type === "image";
|
|
@@ -26306,7 +26428,7 @@ var DimensionDragInput = ({
|
|
|
26306
26428
|
value = round(element.crop.height * ratio, 2);
|
|
26307
26429
|
}
|
|
26308
26430
|
}
|
|
26309
|
-
return /* @__PURE__ */
|
|
26431
|
+
return /* @__PURE__ */ jsx122(
|
|
26310
26432
|
DragInput_default,
|
|
26311
26433
|
{
|
|
26312
26434
|
label: property === "width" ? "W" : "H",
|
|
@@ -26323,7 +26445,7 @@ var DimensionDragInput = ({
|
|
|
26323
26445
|
var Dimension_default = DimensionDragInput;
|
|
26324
26446
|
|
|
26325
26447
|
// components/Stats/FontSize.tsx
|
|
26326
|
-
import { jsx as
|
|
26448
|
+
import { jsx as jsx123 } from "react/jsx-runtime";
|
|
26327
26449
|
var MIN_FONT_SIZE2 = 4;
|
|
26328
26450
|
var STEP_SIZE4 = 4;
|
|
26329
26451
|
var handleFontSizeChange = ({
|
|
@@ -26371,7 +26493,7 @@ var FontSize = ({ element, scene, appState, property }) => {
|
|
|
26371
26493
|
if (!_element) {
|
|
26372
26494
|
return null;
|
|
26373
26495
|
}
|
|
26374
|
-
return /* @__PURE__ */
|
|
26496
|
+
return /* @__PURE__ */ jsx123(
|
|
26375
26497
|
DragInput_default,
|
|
26376
26498
|
{
|
|
26377
26499
|
label: "F",
|
|
@@ -26388,7 +26510,7 @@ var FontSize = ({ element, scene, appState, property }) => {
|
|
|
26388
26510
|
var FontSize_default = FontSize;
|
|
26389
26511
|
|
|
26390
26512
|
// components/Stats/MultiAngle.tsx
|
|
26391
|
-
import { jsx as
|
|
26513
|
+
import { jsx as jsx124 } from "react/jsx-runtime";
|
|
26392
26514
|
var STEP_SIZE5 = 15;
|
|
26393
26515
|
var handleDegreeChange2 = ({
|
|
26394
26516
|
accumulatedChange,
|
|
@@ -26468,7 +26590,7 @@ var MultiAngle = ({
|
|
|
26468
26590
|
const editable = editableLatestIndividualElements.some(
|
|
26469
26591
|
(el) => isPropertyEditable(el, "angle")
|
|
26470
26592
|
);
|
|
26471
|
-
return /* @__PURE__ */
|
|
26593
|
+
return /* @__PURE__ */ jsx124(
|
|
26472
26594
|
DragInput_default,
|
|
26473
26595
|
{
|
|
26474
26596
|
label: "A",
|
|
@@ -26487,7 +26609,7 @@ var MultiAngle_default = MultiAngle;
|
|
|
26487
26609
|
|
|
26488
26610
|
// components/Stats/MultiDimension.tsx
|
|
26489
26611
|
import { useMemo as useMemo7 } from "react";
|
|
26490
|
-
import { jsx as
|
|
26612
|
+
import { jsx as jsx125 } from "react/jsx-runtime";
|
|
26491
26613
|
var STEP_SIZE6 = 10;
|
|
26492
26614
|
var getResizedUpdates = (anchorX, anchorY, scale, origElement) => {
|
|
26493
26615
|
const offsetX = origElement.x - anchorX;
|
|
@@ -26755,7 +26877,7 @@ var MultiDimension = ({
|
|
|
26755
26877
|
);
|
|
26756
26878
|
const value = new Set(sizes).size === 1 ? Math.round(sizes[0] * 100) / 100 : "Mixed";
|
|
26757
26879
|
const editable = sizes.length > 0;
|
|
26758
|
-
return /* @__PURE__ */
|
|
26880
|
+
return /* @__PURE__ */ jsx125(
|
|
26759
26881
|
DragInput_default,
|
|
26760
26882
|
{
|
|
26761
26883
|
label: property === "width" ? "W" : "H",
|
|
@@ -26772,7 +26894,7 @@ var MultiDimension = ({
|
|
|
26772
26894
|
var MultiDimension_default = MultiDimension;
|
|
26773
26895
|
|
|
26774
26896
|
// components/Stats/MultiFontSize.tsx
|
|
26775
|
-
import { jsx as
|
|
26897
|
+
import { jsx as jsx126 } from "react/jsx-runtime";
|
|
26776
26898
|
var MIN_FONT_SIZE3 = 4;
|
|
26777
26899
|
var STEP_SIZE7 = 4;
|
|
26778
26900
|
var getApplicableTextElements = (elements, elementsMap) => elements.reduce(
|
|
@@ -26872,7 +26994,7 @@ var MultiFontSize = ({
|
|
|
26872
26994
|
);
|
|
26873
26995
|
const value = new Set(fontSizes).size === 1 ? fontSizes[0] : "Mixed";
|
|
26874
26996
|
const editable = fontSizes.length > 0;
|
|
26875
|
-
return /* @__PURE__ */
|
|
26997
|
+
return /* @__PURE__ */ jsx126(
|
|
26876
26998
|
DragInput_default,
|
|
26877
26999
|
{
|
|
26878
27000
|
label: "F",
|
|
@@ -26891,7 +27013,7 @@ var MultiFontSize_default = MultiFontSize;
|
|
|
26891
27013
|
|
|
26892
27014
|
// components/Stats/MultiPosition.tsx
|
|
26893
27015
|
import { useMemo as useMemo8 } from "react";
|
|
26894
|
-
import { jsx as
|
|
27016
|
+
import { jsx as jsx127 } from "react/jsx-runtime";
|
|
26895
27017
|
var STEP_SIZE8 = 10;
|
|
26896
27018
|
var moveElements = (property, changeInTopX, changeInTopY, elements, originalElements, elementsMap, originalElementsMap, scene) => {
|
|
26897
27019
|
for (let i = 0; i < elements.length; i++) {
|
|
@@ -27062,7 +27184,7 @@ var MultiPosition = ({
|
|
|
27062
27184
|
[atomicUnits, elementsMap, property]
|
|
27063
27185
|
);
|
|
27064
27186
|
const value = new Set(positions).size === 1 ? positions[0] : "Mixed";
|
|
27065
|
-
return /* @__PURE__ */
|
|
27187
|
+
return /* @__PURE__ */ jsx127(
|
|
27066
27188
|
DragInput_default,
|
|
27067
27189
|
{
|
|
27068
27190
|
label: property === "x" ? "X" : "Y",
|
|
@@ -27078,7 +27200,7 @@ var MultiPosition = ({
|
|
|
27078
27200
|
var MultiPosition_default = MultiPosition;
|
|
27079
27201
|
|
|
27080
27202
|
// components/Stats/Position.tsx
|
|
27081
|
-
import { jsx as
|
|
27203
|
+
import { jsx as jsx128 } from "react/jsx-runtime";
|
|
27082
27204
|
var STEP_SIZE9 = 10;
|
|
27083
27205
|
var handlePositionChange2 = ({
|
|
27084
27206
|
accumulatedChange,
|
|
@@ -27217,7 +27339,7 @@ var Position = ({
|
|
|
27217
27339
|
);
|
|
27218
27340
|
}
|
|
27219
27341
|
}
|
|
27220
|
-
return /* @__PURE__ */
|
|
27342
|
+
return /* @__PURE__ */ jsx128(
|
|
27221
27343
|
DragInput_default,
|
|
27222
27344
|
{
|
|
27223
27345
|
label: property === "x" ? "X" : "Y",
|
|
@@ -27233,7 +27355,7 @@ var Position = ({
|
|
|
27233
27355
|
var Position_default = Position;
|
|
27234
27356
|
|
|
27235
27357
|
// components/Stats/index.tsx
|
|
27236
|
-
import { Fragment as Fragment18, jsx as
|
|
27358
|
+
import { Fragment as Fragment18, jsx as jsx129, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
27237
27359
|
var STATS_TIMEOUT = 50;
|
|
27238
27360
|
var Stats = (props) => {
|
|
27239
27361
|
const appState = useExcalidrawAppState();
|
|
@@ -27243,7 +27365,7 @@ var Stats = (props) => {
|
|
|
27243
27365
|
includeBoundTextElement: false
|
|
27244
27366
|
});
|
|
27245
27367
|
const gridModeEnabled = isGridModeEnabled(props.app);
|
|
27246
|
-
return /* @__PURE__ */
|
|
27368
|
+
return /* @__PURE__ */ jsx129(
|
|
27247
27369
|
StatsInner,
|
|
27248
27370
|
{
|
|
27249
27371
|
...props,
|
|
@@ -27260,7 +27382,7 @@ var StatsRow = ({
|
|
|
27260
27382
|
heading,
|
|
27261
27383
|
style,
|
|
27262
27384
|
...rest
|
|
27263
|
-
}) => /* @__PURE__ */
|
|
27385
|
+
}) => /* @__PURE__ */ jsx129(
|
|
27264
27386
|
"div",
|
|
27265
27387
|
{
|
|
27266
27388
|
className: clsx50("exc-stats__row", { "exc-stats__row--heading": heading }),
|
|
@@ -27278,7 +27400,7 @@ var StatsRows = ({
|
|
|
27278
27400
|
order,
|
|
27279
27401
|
style,
|
|
27280
27402
|
...rest
|
|
27281
|
-
}) => /* @__PURE__ */
|
|
27403
|
+
}) => /* @__PURE__ */ jsx129("div", { className: "exc-stats__rows", style: { order, ...style }, ...rest, children });
|
|
27282
27404
|
StatsRows.displayName = "StatsRows";
|
|
27283
27405
|
Stats.StatsRow = StatsRow;
|
|
27284
27406
|
Stats.StatsRows = StatsRows;
|
|
@@ -27327,15 +27449,15 @@ var StatsInner = memo5(
|
|
|
27327
27449
|
const _frameAndChildrenSelectedTogether = useMemo9(() => {
|
|
27328
27450
|
return frameAndChildrenSelectedTogether(selectedElements);
|
|
27329
27451
|
}, [selectedElements]);
|
|
27330
|
-
return /* @__PURE__ */
|
|
27331
|
-
/* @__PURE__ */
|
|
27332
|
-
/* @__PURE__ */
|
|
27333
|
-
/* @__PURE__ */
|
|
27452
|
+
return /* @__PURE__ */ jsx129("div", { className: "exc-stats", children: /* @__PURE__ */ jsxs67(Island, { padding: 3, children: [
|
|
27453
|
+
/* @__PURE__ */ jsxs67("div", { className: "title", children: [
|
|
27454
|
+
/* @__PURE__ */ jsx129("h2", { children: t("stats.title") }),
|
|
27455
|
+
/* @__PURE__ */ jsx129("div", { className: "close", onClick: onClose, children: CloseIcon })
|
|
27334
27456
|
] }),
|
|
27335
|
-
/* @__PURE__ */
|
|
27457
|
+
/* @__PURE__ */ jsxs67(
|
|
27336
27458
|
Collapsible_default,
|
|
27337
27459
|
{
|
|
27338
|
-
label: /* @__PURE__ */
|
|
27460
|
+
label: /* @__PURE__ */ jsx129("h3", { children: t("stats.generalStats") }),
|
|
27339
27461
|
open: !!(appState.stats.panels & STATS_PANELS.generalStats),
|
|
27340
27462
|
openTrigger: () => setAppState((state) => {
|
|
27341
27463
|
return {
|
|
@@ -27346,23 +27468,23 @@ var StatsInner = memo5(
|
|
|
27346
27468
|
};
|
|
27347
27469
|
}),
|
|
27348
27470
|
children: [
|
|
27349
|
-
/* @__PURE__ */
|
|
27350
|
-
/* @__PURE__ */
|
|
27351
|
-
/* @__PURE__ */
|
|
27352
|
-
/* @__PURE__ */
|
|
27353
|
-
/* @__PURE__ */
|
|
27471
|
+
/* @__PURE__ */ jsxs67(StatsRows, { children: [
|
|
27472
|
+
/* @__PURE__ */ jsx129(StatsRow, { heading: true, children: t("stats.scene") }),
|
|
27473
|
+
/* @__PURE__ */ jsxs67(StatsRow, { columns: 2, children: [
|
|
27474
|
+
/* @__PURE__ */ jsx129("div", { children: t("stats.shapes") }),
|
|
27475
|
+
/* @__PURE__ */ jsx129("div", { children: elements.length })
|
|
27354
27476
|
] }),
|
|
27355
|
-
/* @__PURE__ */
|
|
27356
|
-
/* @__PURE__ */
|
|
27357
|
-
/* @__PURE__ */
|
|
27477
|
+
/* @__PURE__ */ jsxs67(StatsRow, { columns: 2, children: [
|
|
27478
|
+
/* @__PURE__ */ jsx129("div", { children: t("stats.width") }),
|
|
27479
|
+
/* @__PURE__ */ jsx129("div", { children: sceneDimension.width })
|
|
27358
27480
|
] }),
|
|
27359
|
-
/* @__PURE__ */
|
|
27360
|
-
/* @__PURE__ */
|
|
27361
|
-
/* @__PURE__ */
|
|
27481
|
+
/* @__PURE__ */ jsxs67(StatsRow, { columns: 2, children: [
|
|
27482
|
+
/* @__PURE__ */ jsx129("div", { children: t("stats.height") }),
|
|
27483
|
+
/* @__PURE__ */ jsx129("div", { children: sceneDimension.height })
|
|
27362
27484
|
] }),
|
|
27363
|
-
gridModeEnabled && /* @__PURE__ */
|
|
27364
|
-
/* @__PURE__ */
|
|
27365
|
-
/* @__PURE__ */
|
|
27485
|
+
gridModeEnabled && /* @__PURE__ */ jsxs67(Fragment18, { children: [
|
|
27486
|
+
/* @__PURE__ */ jsx129(StatsRow, { heading: true, children: "Canvas" }),
|
|
27487
|
+
/* @__PURE__ */ jsx129(StatsRow, { children: /* @__PURE__ */ jsx129(
|
|
27366
27488
|
CanvasGrid_default,
|
|
27367
27489
|
{
|
|
27368
27490
|
property: "gridStep",
|
|
@@ -27377,17 +27499,17 @@ var StatsInner = memo5(
|
|
|
27377
27499
|
]
|
|
27378
27500
|
}
|
|
27379
27501
|
),
|
|
27380
|
-
!_frameAndChildrenSelectedTogether && selectedElements.length > 0 && /* @__PURE__ */
|
|
27502
|
+
!_frameAndChildrenSelectedTogether && selectedElements.length > 0 && /* @__PURE__ */ jsx129(
|
|
27381
27503
|
"div",
|
|
27382
27504
|
{
|
|
27383
27505
|
id: "elementStats",
|
|
27384
27506
|
style: {
|
|
27385
27507
|
marginTop: 12
|
|
27386
27508
|
},
|
|
27387
|
-
children: /* @__PURE__ */
|
|
27509
|
+
children: /* @__PURE__ */ jsx129(
|
|
27388
27510
|
Collapsible_default,
|
|
27389
27511
|
{
|
|
27390
|
-
label: /* @__PURE__ */
|
|
27512
|
+
label: /* @__PURE__ */ jsx129("h3", { children: t("stats.elementProperties") }),
|
|
27391
27513
|
open: !!(appState.stats.panels & STATS_PANELS.elementProperties),
|
|
27392
27514
|
openTrigger: () => setAppState((state) => {
|
|
27393
27515
|
return {
|
|
@@ -27397,18 +27519,18 @@ var StatsInner = memo5(
|
|
|
27397
27519
|
}
|
|
27398
27520
|
};
|
|
27399
27521
|
}),
|
|
27400
|
-
children: /* @__PURE__ */
|
|
27401
|
-
singleElement && /* @__PURE__ */
|
|
27402
|
-
cropMode && /* @__PURE__ */
|
|
27403
|
-
appState.croppingElementId && isImageElement(singleElement) && unCroppedDimension && /* @__PURE__ */
|
|
27404
|
-
/* @__PURE__ */
|
|
27405
|
-
/* @__PURE__ */
|
|
27522
|
+
children: /* @__PURE__ */ jsxs67(StatsRows, { children: [
|
|
27523
|
+
singleElement && /* @__PURE__ */ jsxs67(Fragment18, { children: [
|
|
27524
|
+
cropMode && /* @__PURE__ */ jsx129(StatsRow, { heading: true, children: t("labels.unCroppedDimension") }),
|
|
27525
|
+
appState.croppingElementId && isImageElement(singleElement) && unCroppedDimension && /* @__PURE__ */ jsxs67(StatsRow, { columns: 2, children: [
|
|
27526
|
+
/* @__PURE__ */ jsx129("div", { children: t("stats.width") }),
|
|
27527
|
+
/* @__PURE__ */ jsx129("div", { children: round(unCroppedDimension.width, 2) })
|
|
27406
27528
|
] }),
|
|
27407
|
-
appState.croppingElementId && isImageElement(singleElement) && unCroppedDimension && /* @__PURE__ */
|
|
27408
|
-
/* @__PURE__ */
|
|
27409
|
-
/* @__PURE__ */
|
|
27529
|
+
appState.croppingElementId && isImageElement(singleElement) && unCroppedDimension && /* @__PURE__ */ jsxs67(StatsRow, { columns: 2, children: [
|
|
27530
|
+
/* @__PURE__ */ jsx129("div", { children: t("stats.height") }),
|
|
27531
|
+
/* @__PURE__ */ jsx129("div", { children: round(unCroppedDimension.height, 2) })
|
|
27410
27532
|
] }),
|
|
27411
|
-
/* @__PURE__ */
|
|
27533
|
+
/* @__PURE__ */ jsx129(
|
|
27412
27534
|
StatsRow,
|
|
27413
27535
|
{
|
|
27414
27536
|
heading: true,
|
|
@@ -27417,7 +27539,7 @@ var StatsInner = memo5(
|
|
|
27417
27539
|
children: appState.croppingElementId ? t("labels.imageCropping") : t(`element.${singleElement.type}`)
|
|
27418
27540
|
}
|
|
27419
27541
|
),
|
|
27420
|
-
/* @__PURE__ */
|
|
27542
|
+
/* @__PURE__ */ jsx129(StatsRow, { children: /* @__PURE__ */ jsx129(
|
|
27421
27543
|
Position_default,
|
|
27422
27544
|
{
|
|
27423
27545
|
element: singleElement,
|
|
@@ -27427,7 +27549,7 @@ var StatsInner = memo5(
|
|
|
27427
27549
|
appState
|
|
27428
27550
|
}
|
|
27429
27551
|
) }),
|
|
27430
|
-
/* @__PURE__ */
|
|
27552
|
+
/* @__PURE__ */ jsx129(StatsRow, { children: /* @__PURE__ */ jsx129(
|
|
27431
27553
|
Position_default,
|
|
27432
27554
|
{
|
|
27433
27555
|
element: singleElement,
|
|
@@ -27437,7 +27559,7 @@ var StatsInner = memo5(
|
|
|
27437
27559
|
appState
|
|
27438
27560
|
}
|
|
27439
27561
|
) }),
|
|
27440
|
-
/* @__PURE__ */
|
|
27562
|
+
/* @__PURE__ */ jsx129(StatsRow, { children: /* @__PURE__ */ jsx129(
|
|
27441
27563
|
Dimension_default,
|
|
27442
27564
|
{
|
|
27443
27565
|
property: "width",
|
|
@@ -27446,7 +27568,7 @@ var StatsInner = memo5(
|
|
|
27446
27568
|
appState
|
|
27447
27569
|
}
|
|
27448
27570
|
) }),
|
|
27449
|
-
/* @__PURE__ */
|
|
27571
|
+
/* @__PURE__ */ jsx129(StatsRow, { children: /* @__PURE__ */ jsx129(
|
|
27450
27572
|
Dimension_default,
|
|
27451
27573
|
{
|
|
27452
27574
|
property: "height",
|
|
@@ -27455,7 +27577,7 @@ var StatsInner = memo5(
|
|
|
27455
27577
|
appState
|
|
27456
27578
|
}
|
|
27457
27579
|
) }),
|
|
27458
|
-
!isElbowArrow(singleElement) && /* @__PURE__ */
|
|
27580
|
+
!isElbowArrow(singleElement) && /* @__PURE__ */ jsx129(StatsRow, { children: /* @__PURE__ */ jsx129(
|
|
27459
27581
|
Angle_default,
|
|
27460
27582
|
{
|
|
27461
27583
|
property: "angle",
|
|
@@ -27464,7 +27586,7 @@ var StatsInner = memo5(
|
|
|
27464
27586
|
appState
|
|
27465
27587
|
}
|
|
27466
27588
|
) }),
|
|
27467
|
-
/* @__PURE__ */
|
|
27589
|
+
/* @__PURE__ */ jsx129(StatsRow, { children: /* @__PURE__ */ jsx129(
|
|
27468
27590
|
FontSize_default,
|
|
27469
27591
|
{
|
|
27470
27592
|
property: "fontSize",
|
|
@@ -27474,13 +27596,13 @@ var StatsInner = memo5(
|
|
|
27474
27596
|
}
|
|
27475
27597
|
) })
|
|
27476
27598
|
] }),
|
|
27477
|
-
multipleElements && /* @__PURE__ */
|
|
27478
|
-
elementsAreInSameGroup(multipleElements) && /* @__PURE__ */
|
|
27479
|
-
/* @__PURE__ */
|
|
27480
|
-
/* @__PURE__ */
|
|
27481
|
-
/* @__PURE__ */
|
|
27599
|
+
multipleElements && /* @__PURE__ */ jsxs67(Fragment18, { children: [
|
|
27600
|
+
elementsAreInSameGroup(multipleElements) && /* @__PURE__ */ jsx129(StatsRow, { heading: true, children: t("element.group") }),
|
|
27601
|
+
/* @__PURE__ */ jsxs67(StatsRow, { columns: 2, style: { margin: "0.3125rem 0" }, children: [
|
|
27602
|
+
/* @__PURE__ */ jsx129("div", { children: t("stats.shapes") }),
|
|
27603
|
+
/* @__PURE__ */ jsx129("div", { children: selectedElements.length })
|
|
27482
27604
|
] }),
|
|
27483
|
-
/* @__PURE__ */
|
|
27605
|
+
/* @__PURE__ */ jsx129(StatsRow, { children: /* @__PURE__ */ jsx129(
|
|
27484
27606
|
MultiPosition_default,
|
|
27485
27607
|
{
|
|
27486
27608
|
property: "x",
|
|
@@ -27491,7 +27613,7 @@ var StatsInner = memo5(
|
|
|
27491
27613
|
appState
|
|
27492
27614
|
}
|
|
27493
27615
|
) }),
|
|
27494
|
-
/* @__PURE__ */
|
|
27616
|
+
/* @__PURE__ */ jsx129(StatsRow, { children: /* @__PURE__ */ jsx129(
|
|
27495
27617
|
MultiPosition_default,
|
|
27496
27618
|
{
|
|
27497
27619
|
property: "y",
|
|
@@ -27502,7 +27624,7 @@ var StatsInner = memo5(
|
|
|
27502
27624
|
appState
|
|
27503
27625
|
}
|
|
27504
27626
|
) }),
|
|
27505
|
-
/* @__PURE__ */
|
|
27627
|
+
/* @__PURE__ */ jsx129(StatsRow, { children: /* @__PURE__ */ jsx129(
|
|
27506
27628
|
MultiDimension_default,
|
|
27507
27629
|
{
|
|
27508
27630
|
property: "width",
|
|
@@ -27513,7 +27635,7 @@ var StatsInner = memo5(
|
|
|
27513
27635
|
appState
|
|
27514
27636
|
}
|
|
27515
27637
|
) }),
|
|
27516
|
-
/* @__PURE__ */
|
|
27638
|
+
/* @__PURE__ */ jsx129(StatsRow, { children: /* @__PURE__ */ jsx129(
|
|
27517
27639
|
MultiDimension_default,
|
|
27518
27640
|
{
|
|
27519
27641
|
property: "height",
|
|
@@ -27524,7 +27646,7 @@ var StatsInner = memo5(
|
|
|
27524
27646
|
appState
|
|
27525
27647
|
}
|
|
27526
27648
|
) }),
|
|
27527
|
-
/* @__PURE__ */
|
|
27649
|
+
/* @__PURE__ */ jsx129(StatsRow, { children: /* @__PURE__ */ jsx129(
|
|
27528
27650
|
MultiAngle_default,
|
|
27529
27651
|
{
|
|
27530
27652
|
property: "angle",
|
|
@@ -27533,7 +27655,7 @@ var StatsInner = memo5(
|
|
|
27533
27655
|
appState
|
|
27534
27656
|
}
|
|
27535
27657
|
) }),
|
|
27536
|
-
/* @__PURE__ */
|
|
27658
|
+
/* @__PURE__ */ jsx129(StatsRow, { children: /* @__PURE__ */ jsx129(
|
|
27537
27659
|
MultiFontSize_default,
|
|
27538
27660
|
{
|
|
27539
27661
|
property: "fontSize",
|
|
@@ -27558,7 +27680,7 @@ var StatsInner = memo5(
|
|
|
27558
27680
|
|
|
27559
27681
|
// components/ElementLinkDialog.tsx
|
|
27560
27682
|
import { useCallback as useCallback12, useEffect as useEffect37, useState as useState32 } from "react";
|
|
27561
|
-
import { jsx as
|
|
27683
|
+
import { jsx as jsx130, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
27562
27684
|
var ElementLinkDialog = ({
|
|
27563
27685
|
sourceElementId,
|
|
27564
27686
|
onClose,
|
|
@@ -27620,13 +27742,13 @@ var ElementLinkDialog = ({
|
|
|
27620
27742
|
window.removeEventListener("keydown", handleKeyDown);
|
|
27621
27743
|
};
|
|
27622
27744
|
}, [appState, onClose, handleConfirm]);
|
|
27623
|
-
return /* @__PURE__ */
|
|
27624
|
-
/* @__PURE__ */
|
|
27625
|
-
/* @__PURE__ */
|
|
27626
|
-
/* @__PURE__ */
|
|
27745
|
+
return /* @__PURE__ */ jsxs68("div", { className: "ElementLinkDialog", children: [
|
|
27746
|
+
/* @__PURE__ */ jsxs68("div", { className: "ElementLinkDialog__header", children: [
|
|
27747
|
+
/* @__PURE__ */ jsx130("h2", { children: t("elementLink.title") }),
|
|
27748
|
+
/* @__PURE__ */ jsx130("p", { children: t("elementLink.desc") })
|
|
27627
27749
|
] }),
|
|
27628
|
-
/* @__PURE__ */
|
|
27629
|
-
/* @__PURE__ */
|
|
27750
|
+
/* @__PURE__ */ jsxs68("div", { className: "ElementLinkDialog__input", children: [
|
|
27751
|
+
/* @__PURE__ */ jsx130(
|
|
27630
27752
|
TextField,
|
|
27631
27753
|
{
|
|
27632
27754
|
value: nextLink ?? "",
|
|
@@ -27645,7 +27767,7 @@ var ElementLinkDialog = ({
|
|
|
27645
27767
|
selectOnRender: true
|
|
27646
27768
|
}
|
|
27647
27769
|
),
|
|
27648
|
-
originalLink && nextLink && /* @__PURE__ */
|
|
27770
|
+
originalLink && nextLink && /* @__PURE__ */ jsx130(
|
|
27649
27771
|
ToolButton,
|
|
27650
27772
|
{
|
|
27651
27773
|
type: "button",
|
|
@@ -27661,8 +27783,8 @@ var ElementLinkDialog = ({
|
|
|
27661
27783
|
}
|
|
27662
27784
|
)
|
|
27663
27785
|
] }),
|
|
27664
|
-
/* @__PURE__ */
|
|
27665
|
-
/* @__PURE__ */
|
|
27786
|
+
/* @__PURE__ */ jsxs68("div", { className: "ElementLinkDialog__actions", children: [
|
|
27787
|
+
/* @__PURE__ */ jsx130(
|
|
27666
27788
|
DialogActionButton_default,
|
|
27667
27789
|
{
|
|
27668
27790
|
label: t("buttons.cancel"),
|
|
@@ -27674,7 +27796,7 @@ var ElementLinkDialog = ({
|
|
|
27674
27796
|
}
|
|
27675
27797
|
}
|
|
27676
27798
|
),
|
|
27677
|
-
/* @__PURE__ */
|
|
27799
|
+
/* @__PURE__ */ jsx130(
|
|
27678
27800
|
DialogActionButton_default,
|
|
27679
27801
|
{
|
|
27680
27802
|
label: t("buttons.confirm"),
|
|
@@ -27689,7 +27811,7 @@ var ElementLinkDialog_default = ElementLinkDialog;
|
|
|
27689
27811
|
|
|
27690
27812
|
// components/ErrorDialog.tsx
|
|
27691
27813
|
import React35, { useState as useState33 } from "react";
|
|
27692
|
-
import { Fragment as Fragment19, jsx as
|
|
27814
|
+
import { Fragment as Fragment19, jsx as jsx131 } from "react/jsx-runtime";
|
|
27693
27815
|
var ErrorDialog = ({
|
|
27694
27816
|
children,
|
|
27695
27817
|
onClose
|
|
@@ -27703,13 +27825,13 @@ var ErrorDialog = ({
|
|
|
27703
27825
|
}
|
|
27704
27826
|
excalidrawContainer?.focus();
|
|
27705
27827
|
}, [onClose, excalidrawContainer]);
|
|
27706
|
-
return /* @__PURE__ */
|
|
27828
|
+
return /* @__PURE__ */ jsx131(Fragment19, { children: modalIsShown && /* @__PURE__ */ jsx131(
|
|
27707
27829
|
Dialog,
|
|
27708
27830
|
{
|
|
27709
27831
|
size: "small",
|
|
27710
27832
|
onCloseRequest: handleClose,
|
|
27711
27833
|
title: t("errorDialog.title"),
|
|
27712
|
-
children: /* @__PURE__ */
|
|
27834
|
+
children: /* @__PURE__ */ jsx131("div", { style: { whiteSpace: "pre-wrap" }, children })
|
|
27713
27835
|
}
|
|
27714
27836
|
) });
|
|
27715
27837
|
};
|
|
@@ -27719,14 +27841,14 @@ import React36, { useMemo as useMemo10 } from "react";
|
|
|
27719
27841
|
import clsx51 from "clsx";
|
|
27720
27842
|
|
|
27721
27843
|
// components/HelpDialog/BasicHelpDialog.tsx
|
|
27722
|
-
import { Fragment as Fragment20, jsx as
|
|
27723
|
-
var Section2 = (props) => /* @__PURE__ */
|
|
27724
|
-
/* @__PURE__ */
|
|
27725
|
-
/* @__PURE__ */
|
|
27844
|
+
import { Fragment as Fragment20, jsx as jsx132, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
27845
|
+
var Section2 = (props) => /* @__PURE__ */ jsxs69(Fragment20, { children: [
|
|
27846
|
+
/* @__PURE__ */ jsx132("h3", { children: props.title }),
|
|
27847
|
+
/* @__PURE__ */ jsx132("div", { className: "HelpDialog__islands-container", children: props.children })
|
|
27726
27848
|
] });
|
|
27727
|
-
var ShortcutIsland = (props) => /* @__PURE__ */
|
|
27728
|
-
/* @__PURE__ */
|
|
27729
|
-
/* @__PURE__ */
|
|
27849
|
+
var ShortcutIsland = (props) => /* @__PURE__ */ jsxs69("div", { className: `HelpDialog__island ${props.className}`, children: [
|
|
27850
|
+
/* @__PURE__ */ jsx132("h4", { className: "HelpDialog__island-title", children: props.caption }),
|
|
27851
|
+
/* @__PURE__ */ jsx132("div", { className: "HelpDialog__island-content", children: props.children })
|
|
27730
27852
|
] });
|
|
27731
27853
|
function* intersperse(as, delim) {
|
|
27732
27854
|
let first = true;
|
|
@@ -27748,25 +27870,25 @@ var Shortcut = ({
|
|
|
27748
27870
|
}) => {
|
|
27749
27871
|
const splitShortcutKeys = shortcuts.map((shortcut) => {
|
|
27750
27872
|
const keys = shortcut.endsWith("++") ? [...shortcut.slice(0, -2).split("+"), "+"] : shortcut.split("+");
|
|
27751
|
-
return keys.map((key) => /* @__PURE__ */
|
|
27873
|
+
return keys.map((key) => /* @__PURE__ */ jsx132(ShortcutKey, { children: upperCaseSingleChars(key) }, key));
|
|
27752
27874
|
});
|
|
27753
|
-
return /* @__PURE__ */
|
|
27754
|
-
/* @__PURE__ */
|
|
27755
|
-
/* @__PURE__ */
|
|
27875
|
+
return /* @__PURE__ */ jsxs69("div", { className: "HelpDialog__shortcut", children: [
|
|
27876
|
+
/* @__PURE__ */ jsx132("div", { children: label }),
|
|
27877
|
+
/* @__PURE__ */ jsx132("div", { className: "HelpDialog__key-container", children: [...intersperse(splitShortcutKeys, isOr ? t("helpDialog.or") : null)] })
|
|
27756
27878
|
] });
|
|
27757
27879
|
};
|
|
27758
|
-
var ShortcutKey = (props) => /* @__PURE__ */
|
|
27880
|
+
var ShortcutKey = (props) => /* @__PURE__ */ jsx132("kbd", { className: "HelpDialog__key", ...props });
|
|
27759
27881
|
function BasicHelpDialog() {
|
|
27760
|
-
return /* @__PURE__ */
|
|
27761
|
-
/* @__PURE__ */
|
|
27882
|
+
return /* @__PURE__ */ jsxs69(Section2, { title: t("helpDialog.shortcuts"), children: [
|
|
27883
|
+
/* @__PURE__ */ jsxs69(
|
|
27762
27884
|
ShortcutIsland,
|
|
27763
27885
|
{
|
|
27764
27886
|
className: "HelpDialog__island--tools",
|
|
27765
27887
|
caption: t("helpDialog.tools"),
|
|
27766
27888
|
children: [
|
|
27767
|
-
/* @__PURE__ */
|
|
27889
|
+
/* @__PURE__ */ jsx132(Shortcut, { label: t("toolBar.hand"), shortcuts: [KEYS.H] }),
|
|
27768
27890
|
SHAPES2.filter(({ myocSimplifiedMode }) => myocSimplifiedMode).map(
|
|
27769
|
-
({ value, key }) => /* @__PURE__ */
|
|
27891
|
+
({ value, key }) => /* @__PURE__ */ jsx132(
|
|
27770
27892
|
Shortcut,
|
|
27771
27893
|
{
|
|
27772
27894
|
label: t(`toolBar.${value}`),
|
|
@@ -27775,7 +27897,7 @@ function BasicHelpDialog() {
|
|
|
27775
27897
|
value
|
|
27776
27898
|
)
|
|
27777
27899
|
),
|
|
27778
|
-
/* @__PURE__ */
|
|
27900
|
+
/* @__PURE__ */ jsx132(
|
|
27779
27901
|
Shortcut,
|
|
27780
27902
|
{
|
|
27781
27903
|
label: t("helpDialog.cropStart"),
|
|
@@ -27783,7 +27905,7 @@ function BasicHelpDialog() {
|
|
|
27783
27905
|
isOr: true
|
|
27784
27906
|
}
|
|
27785
27907
|
),
|
|
27786
|
-
/* @__PURE__ */
|
|
27908
|
+
/* @__PURE__ */ jsx132(
|
|
27787
27909
|
Shortcut,
|
|
27788
27910
|
{
|
|
27789
27911
|
label: t("helpDialog.cropFinish"),
|
|
@@ -27794,28 +27916,28 @@ function BasicHelpDialog() {
|
|
|
27794
27916
|
]
|
|
27795
27917
|
}
|
|
27796
27918
|
),
|
|
27797
|
-
/* @__PURE__ */
|
|
27919
|
+
/* @__PURE__ */ jsxs69(
|
|
27798
27920
|
ShortcutIsland,
|
|
27799
27921
|
{
|
|
27800
27922
|
className: "HelpDialog__island--view",
|
|
27801
27923
|
caption: t("helpDialog.view"),
|
|
27802
27924
|
children: [
|
|
27803
|
-
/* @__PURE__ */
|
|
27804
|
-
/* @__PURE__ */
|
|
27925
|
+
/* @__PURE__ */ jsx132(Shortcut, { label: t("helpDialog.smartZoom"), shortcuts: [KEYS.F] }),
|
|
27926
|
+
/* @__PURE__ */ jsx132(
|
|
27805
27927
|
Shortcut,
|
|
27806
27928
|
{
|
|
27807
27929
|
label: t("buttons.zenMode"),
|
|
27808
27930
|
shortcuts: [getShortcutKey("Alt+Z")]
|
|
27809
27931
|
}
|
|
27810
27932
|
),
|
|
27811
|
-
/* @__PURE__ */
|
|
27933
|
+
/* @__PURE__ */ jsx132(
|
|
27812
27934
|
Shortcut,
|
|
27813
27935
|
{
|
|
27814
27936
|
label: t("buttons.objectsSnapMode"),
|
|
27815
27937
|
shortcuts: [getShortcutKey("Alt+S")]
|
|
27816
27938
|
}
|
|
27817
27939
|
),
|
|
27818
|
-
/* @__PURE__ */
|
|
27940
|
+
/* @__PURE__ */ jsx132(
|
|
27819
27941
|
Shortcut,
|
|
27820
27942
|
{
|
|
27821
27943
|
label: t("commandPalette.title"),
|
|
@@ -27828,76 +27950,76 @@ function BasicHelpDialog() {
|
|
|
27828
27950
|
]
|
|
27829
27951
|
}
|
|
27830
27952
|
),
|
|
27831
|
-
/* @__PURE__ */
|
|
27953
|
+
/* @__PURE__ */ jsxs69(
|
|
27832
27954
|
ShortcutIsland,
|
|
27833
27955
|
{
|
|
27834
27956
|
className: "HelpDialog__island--editor",
|
|
27835
27957
|
caption: t("helpDialog.editor"),
|
|
27836
27958
|
children: [
|
|
27837
|
-
/* @__PURE__ */
|
|
27959
|
+
/* @__PURE__ */ jsx132(
|
|
27838
27960
|
Shortcut,
|
|
27839
27961
|
{
|
|
27840
27962
|
label: t("labels.pasteAsPlaintext"),
|
|
27841
27963
|
shortcuts: [getShortcutKey("CtrlOrCmd+Shift+V")]
|
|
27842
27964
|
}
|
|
27843
27965
|
),
|
|
27844
|
-
/* @__PURE__ */
|
|
27966
|
+
/* @__PURE__ */ jsx132(
|
|
27845
27967
|
Shortcut,
|
|
27846
27968
|
{
|
|
27847
27969
|
label: t("labels.multiSelect"),
|
|
27848
27970
|
shortcuts: [getShortcutKey(`Shift+${t("helpDialog.click")}`)]
|
|
27849
27971
|
}
|
|
27850
27972
|
),
|
|
27851
|
-
/* @__PURE__ */
|
|
27973
|
+
/* @__PURE__ */ jsx132(
|
|
27852
27974
|
Shortcut,
|
|
27853
27975
|
{
|
|
27854
27976
|
label: t("helpDialog.deepSelect"),
|
|
27855
27977
|
shortcuts: [getShortcutKey(`CtrlOrCmd+${t("helpDialog.click")}`)]
|
|
27856
27978
|
}
|
|
27857
27979
|
),
|
|
27858
|
-
/* @__PURE__ */
|
|
27980
|
+
/* @__PURE__ */ jsx132(
|
|
27859
27981
|
Shortcut,
|
|
27860
27982
|
{
|
|
27861
27983
|
label: t("helpDialog.deepBoxSelect"),
|
|
27862
27984
|
shortcuts: [getShortcutKey(`CtrlOrCmd+${t("helpDialog.drag")}`)]
|
|
27863
27985
|
}
|
|
27864
27986
|
),
|
|
27865
|
-
(probablySupportsClipboardBlob || isFirefox) && /* @__PURE__ */
|
|
27987
|
+
(probablySupportsClipboardBlob || isFirefox) && /* @__PURE__ */ jsx132(
|
|
27866
27988
|
Shortcut,
|
|
27867
27989
|
{
|
|
27868
27990
|
label: t("labels.copyAsPng"),
|
|
27869
27991
|
shortcuts: [getShortcutKey("Shift+Alt+C")]
|
|
27870
27992
|
}
|
|
27871
27993
|
),
|
|
27872
|
-
/* @__PURE__ */
|
|
27994
|
+
/* @__PURE__ */ jsx132(
|
|
27873
27995
|
Shortcut,
|
|
27874
27996
|
{
|
|
27875
27997
|
label: t("helpDialog.toggleElementLock"),
|
|
27876
27998
|
shortcuts: [getShortcutKey("CtrlOrCmd+Shift+L")]
|
|
27877
27999
|
}
|
|
27878
28000
|
),
|
|
27879
|
-
/* @__PURE__ */
|
|
28001
|
+
/* @__PURE__ */ jsx132(
|
|
27880
28002
|
Shortcut,
|
|
27881
28003
|
{
|
|
27882
28004
|
label: t("labels.group"),
|
|
27883
28005
|
shortcuts: [getShortcutKey("CtrlOrCmd+G")]
|
|
27884
28006
|
}
|
|
27885
28007
|
),
|
|
27886
|
-
/* @__PURE__ */
|
|
28008
|
+
/* @__PURE__ */ jsx132(
|
|
27887
28009
|
Shortcut,
|
|
27888
28010
|
{
|
|
27889
28011
|
label: t("labels.ungroup"),
|
|
27890
28012
|
shortcuts: [getShortcutKey("CtrlOrCmd+Shift+G")]
|
|
27891
28013
|
}
|
|
27892
28014
|
),
|
|
27893
|
-
/* @__PURE__ */
|
|
28015
|
+
/* @__PURE__ */ jsx132(
|
|
27894
28016
|
Shortcut,
|
|
27895
28017
|
{
|
|
27896
28018
|
label: t("labels.flipHorizontal"),
|
|
27897
28019
|
shortcuts: [getShortcutKey("Shift+H")]
|
|
27898
28020
|
}
|
|
27899
28021
|
),
|
|
27900
|
-
/* @__PURE__ */
|
|
28022
|
+
/* @__PURE__ */ jsx132(
|
|
27901
28023
|
Shortcut,
|
|
27902
28024
|
{
|
|
27903
28025
|
label: t("labels.flipVertical"),
|
|
@@ -27911,14 +28033,14 @@ function BasicHelpDialog() {
|
|
|
27911
28033
|
}
|
|
27912
28034
|
|
|
27913
28035
|
// components/HelpDialog.tsx
|
|
27914
|
-
import { Fragment as Fragment21, jsx as
|
|
27915
|
-
var Section3 = (props) => /* @__PURE__ */
|
|
27916
|
-
/* @__PURE__ */
|
|
27917
|
-
/* @__PURE__ */
|
|
28036
|
+
import { Fragment as Fragment21, jsx as jsx133, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
28037
|
+
var Section3 = (props) => /* @__PURE__ */ jsxs70(Fragment21, { children: [
|
|
28038
|
+
/* @__PURE__ */ jsx133("h3", { children: props.title }),
|
|
28039
|
+
/* @__PURE__ */ jsx133("div", { className: "HelpDialog__islands-container", children: props.children })
|
|
27918
28040
|
] });
|
|
27919
|
-
var ShortcutIsland2 = (props) => /* @__PURE__ */
|
|
27920
|
-
/* @__PURE__ */
|
|
27921
|
-
/* @__PURE__ */
|
|
28041
|
+
var ShortcutIsland2 = (props) => /* @__PURE__ */ jsxs70("div", { className: `HelpDialog__island ${props.className}`, children: [
|
|
28042
|
+
/* @__PURE__ */ jsx133("h4", { className: "HelpDialog__island-title", children: props.caption }),
|
|
28043
|
+
/* @__PURE__ */ jsx133("div", { className: "HelpDialog__island-content", children: props.children })
|
|
27922
28044
|
] });
|
|
27923
28045
|
function* intersperse2(as, delim) {
|
|
27924
28046
|
let first = true;
|
|
@@ -27940,14 +28062,14 @@ var Shortcut2 = ({
|
|
|
27940
28062
|
}) => {
|
|
27941
28063
|
const splitShortcutKeys = shortcuts.map((shortcut) => {
|
|
27942
28064
|
const keys = shortcut.endsWith("++") ? [...shortcut.slice(0, -2).split("+"), "+"] : shortcut.split("+");
|
|
27943
|
-
return keys.map((key) => /* @__PURE__ */
|
|
28065
|
+
return keys.map((key) => /* @__PURE__ */ jsx133(ShortcutKey2, { children: upperCaseSingleChars2(key) }, key));
|
|
27944
28066
|
});
|
|
27945
|
-
return /* @__PURE__ */
|
|
27946
|
-
/* @__PURE__ */
|
|
27947
|
-
/* @__PURE__ */
|
|
28067
|
+
return /* @__PURE__ */ jsxs70("div", { className: "HelpDialog__shortcut", children: [
|
|
28068
|
+
/* @__PURE__ */ jsx133("div", { children: label }),
|
|
28069
|
+
/* @__PURE__ */ jsx133("div", { className: "HelpDialog__key-container", children: [...intersperse2(splitShortcutKeys, isOr ? t("helpDialog.or") : null)] })
|
|
27948
28070
|
] });
|
|
27949
28071
|
};
|
|
27950
|
-
var ShortcutKey2 = (props) => /* @__PURE__ */
|
|
28072
|
+
var ShortcutKey2 = (props) => /* @__PURE__ */ jsx133("kbd", { className: "HelpDialog__key", ...props });
|
|
27951
28073
|
var HelpDialog = ({ onClose }) => {
|
|
27952
28074
|
const [isShowAll, setIsShowAll] = React36.useState(false);
|
|
27953
28075
|
const handleClose = React36.useCallback(() => {
|
|
@@ -27956,14 +28078,14 @@ var HelpDialog = ({ onClose }) => {
|
|
|
27956
28078
|
}
|
|
27957
28079
|
}, [onClose]);
|
|
27958
28080
|
const showAllButton = useMemo10(
|
|
27959
|
-
() => isShowAll ? /* @__PURE__ */
|
|
28081
|
+
() => isShowAll ? /* @__PURE__ */ jsx133(
|
|
27960
28082
|
"button",
|
|
27961
28083
|
{
|
|
27962
28084
|
className: clsx51("toggle-button", {}),
|
|
27963
28085
|
onClick: () => setIsShowAll(false),
|
|
27964
28086
|
children: t("helpDialog.myoc.showingAll")
|
|
27965
28087
|
}
|
|
27966
|
-
) : /* @__PURE__ */
|
|
28088
|
+
) : /* @__PURE__ */ jsx133(
|
|
27967
28089
|
"button",
|
|
27968
28090
|
{
|
|
27969
28091
|
className: clsx51("toggle-button", {}),
|
|
@@ -27973,22 +28095,22 @@ var HelpDialog = ({ onClose }) => {
|
|
|
27973
28095
|
),
|
|
27974
28096
|
[isShowAll]
|
|
27975
28097
|
);
|
|
27976
|
-
return /* @__PURE__ */
|
|
28098
|
+
return /* @__PURE__ */ jsx133(Fragment21, { children: /* @__PURE__ */ jsx133(
|
|
27977
28099
|
Dialog,
|
|
27978
28100
|
{
|
|
27979
28101
|
onCloseRequest: handleClose,
|
|
27980
28102
|
title: t("helpDialog.title"),
|
|
27981
28103
|
className: "HelpDialog",
|
|
27982
28104
|
titleButton: showAllButton,
|
|
27983
|
-
children: isShowAll ? /* @__PURE__ */
|
|
27984
|
-
/* @__PURE__ */
|
|
28105
|
+
children: isShowAll ? /* @__PURE__ */ jsxs70(Section3, { title: t("helpDialog.shortcuts"), children: [
|
|
28106
|
+
/* @__PURE__ */ jsxs70(
|
|
27985
28107
|
ShortcutIsland2,
|
|
27986
28108
|
{
|
|
27987
28109
|
className: "HelpDialog__island--tools",
|
|
27988
28110
|
caption: t("helpDialog.tools"),
|
|
27989
28111
|
children: [
|
|
27990
|
-
/* @__PURE__ */
|
|
27991
|
-
SHAPES.map(({ value, key }) => /* @__PURE__ */
|
|
28112
|
+
/* @__PURE__ */ jsx133(Shortcut2, { label: t("toolBar.hand"), shortcuts: [KEYS.H] }),
|
|
28113
|
+
SHAPES.map(({ value, key }) => /* @__PURE__ */ jsx133(
|
|
27992
28114
|
Shortcut2,
|
|
27993
28115
|
{
|
|
27994
28116
|
label: t(`toolBar.${value}`),
|
|
@@ -27996,30 +28118,30 @@ var HelpDialog = ({ onClose }) => {
|
|
|
27996
28118
|
},
|
|
27997
28119
|
value
|
|
27998
28120
|
)),
|
|
27999
|
-
/* @__PURE__ */
|
|
28000
|
-
/* @__PURE__ */
|
|
28001
|
-
/* @__PURE__ */
|
|
28121
|
+
/* @__PURE__ */ jsx133(Shortcut2, { label: t("toolBar.frame"), shortcuts: [KEYS.F] }),
|
|
28122
|
+
/* @__PURE__ */ jsx133(Shortcut2, { label: t("toolBar.laser"), shortcuts: [KEYS.K] }),
|
|
28123
|
+
/* @__PURE__ */ jsx133(
|
|
28002
28124
|
Shortcut2,
|
|
28003
28125
|
{
|
|
28004
28126
|
label: t("labels.eyeDropper"),
|
|
28005
28127
|
shortcuts: [KEYS.I, "Shift+S", "Shift+G"]
|
|
28006
28128
|
}
|
|
28007
28129
|
),
|
|
28008
|
-
/* @__PURE__ */
|
|
28130
|
+
/* @__PURE__ */ jsx133(
|
|
28009
28131
|
Shortcut2,
|
|
28010
28132
|
{
|
|
28011
28133
|
label: t("helpDialog.editLineArrowPoints"),
|
|
28012
28134
|
shortcuts: [getShortcutKey("CtrlOrCmd+Enter")]
|
|
28013
28135
|
}
|
|
28014
28136
|
),
|
|
28015
|
-
/* @__PURE__ */
|
|
28137
|
+
/* @__PURE__ */ jsx133(
|
|
28016
28138
|
Shortcut2,
|
|
28017
28139
|
{
|
|
28018
28140
|
label: t("helpDialog.editText"),
|
|
28019
28141
|
shortcuts: [getShortcutKey("Enter")]
|
|
28020
28142
|
}
|
|
28021
28143
|
),
|
|
28022
|
-
/* @__PURE__ */
|
|
28144
|
+
/* @__PURE__ */ jsx133(
|
|
28023
28145
|
Shortcut2,
|
|
28024
28146
|
{
|
|
28025
28147
|
label: t("helpDialog.textNewLine"),
|
|
@@ -28029,7 +28151,7 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28029
28151
|
]
|
|
28030
28152
|
}
|
|
28031
28153
|
),
|
|
28032
|
-
/* @__PURE__ */
|
|
28154
|
+
/* @__PURE__ */ jsx133(
|
|
28033
28155
|
Shortcut2,
|
|
28034
28156
|
{
|
|
28035
28157
|
label: t("helpDialog.textFinish"),
|
|
@@ -28039,7 +28161,7 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28039
28161
|
]
|
|
28040
28162
|
}
|
|
28041
28163
|
),
|
|
28042
|
-
/* @__PURE__ */
|
|
28164
|
+
/* @__PURE__ */ jsx133(
|
|
28043
28165
|
Shortcut2,
|
|
28044
28166
|
{
|
|
28045
28167
|
label: t("helpDialog.curvedArrow"),
|
|
@@ -28052,7 +28174,7 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28052
28174
|
isOr: false
|
|
28053
28175
|
}
|
|
28054
28176
|
),
|
|
28055
|
-
/* @__PURE__ */
|
|
28177
|
+
/* @__PURE__ */ jsx133(
|
|
28056
28178
|
Shortcut2,
|
|
28057
28179
|
{
|
|
28058
28180
|
label: t("helpDialog.curvedLine"),
|
|
@@ -28065,7 +28187,7 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28065
28187
|
isOr: false
|
|
28066
28188
|
}
|
|
28067
28189
|
),
|
|
28068
|
-
/* @__PURE__ */
|
|
28190
|
+
/* @__PURE__ */ jsx133(
|
|
28069
28191
|
Shortcut2,
|
|
28070
28192
|
{
|
|
28071
28193
|
label: t("helpDialog.cropStart"),
|
|
@@ -28076,7 +28198,7 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28076
28198
|
isOr: true
|
|
28077
28199
|
}
|
|
28078
28200
|
),
|
|
28079
|
-
/* @__PURE__ */
|
|
28201
|
+
/* @__PURE__ */ jsx133(
|
|
28080
28202
|
Shortcut2,
|
|
28081
28203
|
{
|
|
28082
28204
|
label: t("helpDialog.cropFinish"),
|
|
@@ -28084,15 +28206,15 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28084
28206
|
isOr: true
|
|
28085
28207
|
}
|
|
28086
28208
|
),
|
|
28087
|
-
/* @__PURE__ */
|
|
28088
|
-
/* @__PURE__ */
|
|
28209
|
+
/* @__PURE__ */ jsx133(Shortcut2, { label: t("toolBar.lock"), shortcuts: [KEYS.Q] }),
|
|
28210
|
+
/* @__PURE__ */ jsx133(
|
|
28089
28211
|
Shortcut2,
|
|
28090
28212
|
{
|
|
28091
28213
|
label: t("helpDialog.preventBinding"),
|
|
28092
28214
|
shortcuts: [getShortcutKey("CtrlOrCmd")]
|
|
28093
28215
|
}
|
|
28094
28216
|
),
|
|
28095
|
-
/* @__PURE__ */
|
|
28217
|
+
/* @__PURE__ */ jsx133(
|
|
28096
28218
|
Shortcut2,
|
|
28097
28219
|
{
|
|
28098
28220
|
label: t("toolBar.link"),
|
|
@@ -28102,104 +28224,104 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28102
28224
|
]
|
|
28103
28225
|
}
|
|
28104
28226
|
),
|
|
28105
|
-
/* @__PURE__ */
|
|
28227
|
+
/* @__PURE__ */ jsxs70(
|
|
28106
28228
|
ShortcutIsland2,
|
|
28107
28229
|
{
|
|
28108
28230
|
className: "HelpDialog__island--view",
|
|
28109
28231
|
caption: t("helpDialog.view"),
|
|
28110
28232
|
children: [
|
|
28111
|
-
/* @__PURE__ */
|
|
28233
|
+
/* @__PURE__ */ jsx133(
|
|
28112
28234
|
Shortcut2,
|
|
28113
28235
|
{
|
|
28114
28236
|
label: t("helpDialog.smartZoom"),
|
|
28115
28237
|
shortcuts: [KEYS.F]
|
|
28116
28238
|
}
|
|
28117
28239
|
),
|
|
28118
|
-
/* @__PURE__ */
|
|
28240
|
+
/* @__PURE__ */ jsx133(
|
|
28119
28241
|
Shortcut2,
|
|
28120
28242
|
{
|
|
28121
28243
|
label: t("buttons.zoomIn"),
|
|
28122
28244
|
shortcuts: [getShortcutKey("CtrlOrCmd++")]
|
|
28123
28245
|
}
|
|
28124
28246
|
),
|
|
28125
|
-
/* @__PURE__ */
|
|
28247
|
+
/* @__PURE__ */ jsx133(
|
|
28126
28248
|
Shortcut2,
|
|
28127
28249
|
{
|
|
28128
28250
|
label: t("buttons.zoomOut"),
|
|
28129
28251
|
shortcuts: [getShortcutKey("CtrlOrCmd+-")]
|
|
28130
28252
|
}
|
|
28131
28253
|
),
|
|
28132
|
-
/* @__PURE__ */
|
|
28254
|
+
/* @__PURE__ */ jsx133(
|
|
28133
28255
|
Shortcut2,
|
|
28134
28256
|
{
|
|
28135
28257
|
label: t("buttons.resetZoom"),
|
|
28136
28258
|
shortcuts: [getShortcutKey("CtrlOrCmd+0")]
|
|
28137
28259
|
}
|
|
28138
28260
|
),
|
|
28139
|
-
/* @__PURE__ */
|
|
28261
|
+
/* @__PURE__ */ jsx133(
|
|
28140
28262
|
Shortcut2,
|
|
28141
28263
|
{
|
|
28142
28264
|
label: t("helpDialog.zoomToSelection"),
|
|
28143
28265
|
shortcuts: ["Shift+2"]
|
|
28144
28266
|
}
|
|
28145
28267
|
),
|
|
28146
|
-
/* @__PURE__ */
|
|
28268
|
+
/* @__PURE__ */ jsx133(
|
|
28147
28269
|
Shortcut2,
|
|
28148
28270
|
{
|
|
28149
28271
|
label: t("helpDialog.movePageUpDown"),
|
|
28150
28272
|
shortcuts: ["PgUp/PgDn"]
|
|
28151
28273
|
}
|
|
28152
28274
|
),
|
|
28153
|
-
/* @__PURE__ */
|
|
28275
|
+
/* @__PURE__ */ jsx133(
|
|
28154
28276
|
Shortcut2,
|
|
28155
28277
|
{
|
|
28156
28278
|
label: t("helpDialog.movePageLeftRight"),
|
|
28157
28279
|
shortcuts: ["Shift+PgUp/PgDn"]
|
|
28158
28280
|
}
|
|
28159
28281
|
),
|
|
28160
|
-
/* @__PURE__ */
|
|
28282
|
+
/* @__PURE__ */ jsx133(
|
|
28161
28283
|
Shortcut2,
|
|
28162
28284
|
{
|
|
28163
28285
|
label: t("buttons.zenMode"),
|
|
28164
28286
|
shortcuts: [getShortcutKey("Alt+Z")]
|
|
28165
28287
|
}
|
|
28166
28288
|
),
|
|
28167
|
-
/* @__PURE__ */
|
|
28289
|
+
/* @__PURE__ */ jsx133(
|
|
28168
28290
|
Shortcut2,
|
|
28169
28291
|
{
|
|
28170
28292
|
label: t("buttons.objectsSnapMode"),
|
|
28171
28293
|
shortcuts: [getShortcutKey("Alt+S")]
|
|
28172
28294
|
}
|
|
28173
28295
|
),
|
|
28174
|
-
/* @__PURE__ */
|
|
28296
|
+
/* @__PURE__ */ jsx133(
|
|
28175
28297
|
Shortcut2,
|
|
28176
28298
|
{
|
|
28177
28299
|
label: t("labels.toggleGrid"),
|
|
28178
28300
|
shortcuts: [getShortcutKey("CtrlOrCmd+'")]
|
|
28179
28301
|
}
|
|
28180
28302
|
),
|
|
28181
|
-
/* @__PURE__ */
|
|
28303
|
+
/* @__PURE__ */ jsx133(
|
|
28182
28304
|
Shortcut2,
|
|
28183
28305
|
{
|
|
28184
28306
|
label: t("labels.viewMode"),
|
|
28185
28307
|
shortcuts: [getShortcutKey("Alt+R")]
|
|
28186
28308
|
}
|
|
28187
28309
|
),
|
|
28188
|
-
/* @__PURE__ */
|
|
28310
|
+
/* @__PURE__ */ jsx133(
|
|
28189
28311
|
Shortcut2,
|
|
28190
28312
|
{
|
|
28191
28313
|
label: t("stats.fullTitle"),
|
|
28192
28314
|
shortcuts: [getShortcutKey("Alt+/")]
|
|
28193
28315
|
}
|
|
28194
28316
|
),
|
|
28195
|
-
/* @__PURE__ */
|
|
28317
|
+
/* @__PURE__ */ jsx133(
|
|
28196
28318
|
Shortcut2,
|
|
28197
28319
|
{
|
|
28198
28320
|
label: t("search.title"),
|
|
28199
28321
|
shortcuts: [getShortcutFromShortcutName("searchMenu")]
|
|
28200
28322
|
}
|
|
28201
28323
|
),
|
|
28202
|
-
/* @__PURE__ */
|
|
28324
|
+
/* @__PURE__ */ jsx133(
|
|
28203
28325
|
Shortcut2,
|
|
28204
28326
|
{
|
|
28205
28327
|
label: t("commandPalette.title"),
|
|
@@ -28212,13 +28334,13 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28212
28334
|
]
|
|
28213
28335
|
}
|
|
28214
28336
|
),
|
|
28215
|
-
/* @__PURE__ */
|
|
28337
|
+
/* @__PURE__ */ jsxs70(
|
|
28216
28338
|
ShortcutIsland2,
|
|
28217
28339
|
{
|
|
28218
28340
|
className: "HelpDialog__island--editor",
|
|
28219
28341
|
caption: t("helpDialog.editor"),
|
|
28220
28342
|
children: [
|
|
28221
|
-
/* @__PURE__ */
|
|
28343
|
+
/* @__PURE__ */ jsx133(
|
|
28222
28344
|
Shortcut2,
|
|
28223
28345
|
{
|
|
28224
28346
|
label: t("labels.moveCanvas"),
|
|
@@ -28229,56 +28351,56 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28229
28351
|
isOr: true
|
|
28230
28352
|
}
|
|
28231
28353
|
),
|
|
28232
|
-
/* @__PURE__ */
|
|
28354
|
+
/* @__PURE__ */ jsx133(
|
|
28233
28355
|
Shortcut2,
|
|
28234
28356
|
{
|
|
28235
28357
|
label: t("labels.delete"),
|
|
28236
28358
|
shortcuts: [getShortcutKey("Delete")]
|
|
28237
28359
|
}
|
|
28238
28360
|
),
|
|
28239
|
-
/* @__PURE__ */
|
|
28361
|
+
/* @__PURE__ */ jsx133(
|
|
28240
28362
|
Shortcut2,
|
|
28241
28363
|
{
|
|
28242
28364
|
label: t("labels.cut"),
|
|
28243
28365
|
shortcuts: [getShortcutKey("CtrlOrCmd+X")]
|
|
28244
28366
|
}
|
|
28245
28367
|
),
|
|
28246
|
-
/* @__PURE__ */
|
|
28368
|
+
/* @__PURE__ */ jsx133(
|
|
28247
28369
|
Shortcut2,
|
|
28248
28370
|
{
|
|
28249
28371
|
label: t("labels.copy"),
|
|
28250
28372
|
shortcuts: [getShortcutKey("CtrlOrCmd+C")]
|
|
28251
28373
|
}
|
|
28252
28374
|
),
|
|
28253
|
-
/* @__PURE__ */
|
|
28375
|
+
/* @__PURE__ */ jsx133(
|
|
28254
28376
|
Shortcut2,
|
|
28255
28377
|
{
|
|
28256
28378
|
label: t("labels.paste"),
|
|
28257
28379
|
shortcuts: [getShortcutKey("CtrlOrCmd+V")]
|
|
28258
28380
|
}
|
|
28259
28381
|
),
|
|
28260
|
-
/* @__PURE__ */
|
|
28382
|
+
/* @__PURE__ */ jsx133(
|
|
28261
28383
|
Shortcut2,
|
|
28262
28384
|
{
|
|
28263
28385
|
label: t("labels.pasteAsPlaintext"),
|
|
28264
28386
|
shortcuts: [getShortcutKey("CtrlOrCmd+Shift+V")]
|
|
28265
28387
|
}
|
|
28266
28388
|
),
|
|
28267
|
-
/* @__PURE__ */
|
|
28389
|
+
/* @__PURE__ */ jsx133(
|
|
28268
28390
|
Shortcut2,
|
|
28269
28391
|
{
|
|
28270
28392
|
label: t("labels.selectAll"),
|
|
28271
28393
|
shortcuts: [getShortcutKey("CtrlOrCmd+A")]
|
|
28272
28394
|
}
|
|
28273
28395
|
),
|
|
28274
|
-
/* @__PURE__ */
|
|
28396
|
+
/* @__PURE__ */ jsx133(
|
|
28275
28397
|
Shortcut2,
|
|
28276
28398
|
{
|
|
28277
28399
|
label: t("labels.multiSelect"),
|
|
28278
28400
|
shortcuts: [getShortcutKey(`Shift+${t("helpDialog.click")}`)]
|
|
28279
28401
|
}
|
|
28280
28402
|
),
|
|
28281
|
-
/* @__PURE__ */
|
|
28403
|
+
/* @__PURE__ */ jsx133(
|
|
28282
28404
|
Shortcut2,
|
|
28283
28405
|
{
|
|
28284
28406
|
label: t("helpDialog.deepSelect"),
|
|
@@ -28287,7 +28409,7 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28287
28409
|
]
|
|
28288
28410
|
}
|
|
28289
28411
|
),
|
|
28290
|
-
/* @__PURE__ */
|
|
28412
|
+
/* @__PURE__ */ jsx133(
|
|
28291
28413
|
Shortcut2,
|
|
28292
28414
|
{
|
|
28293
28415
|
label: t("helpDialog.deepBoxSelect"),
|
|
@@ -28296,28 +28418,28 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28296
28418
|
]
|
|
28297
28419
|
}
|
|
28298
28420
|
),
|
|
28299
|
-
(probablySupportsClipboardBlob || isFirefox) && /* @__PURE__ */
|
|
28421
|
+
(probablySupportsClipboardBlob || isFirefox) && /* @__PURE__ */ jsx133(
|
|
28300
28422
|
Shortcut2,
|
|
28301
28423
|
{
|
|
28302
28424
|
label: t("labels.copyAsPng"),
|
|
28303
28425
|
shortcuts: [getShortcutKey("Shift+Alt+C")]
|
|
28304
28426
|
}
|
|
28305
28427
|
),
|
|
28306
|
-
/* @__PURE__ */
|
|
28428
|
+
/* @__PURE__ */ jsx133(
|
|
28307
28429
|
Shortcut2,
|
|
28308
28430
|
{
|
|
28309
28431
|
label: t("labels.copyStyles"),
|
|
28310
28432
|
shortcuts: [getShortcutKey("CtrlOrCmd+Alt+C")]
|
|
28311
28433
|
}
|
|
28312
28434
|
),
|
|
28313
|
-
/* @__PURE__ */
|
|
28435
|
+
/* @__PURE__ */ jsx133(
|
|
28314
28436
|
Shortcut2,
|
|
28315
28437
|
{
|
|
28316
28438
|
label: t("labels.pasteStyles"),
|
|
28317
28439
|
shortcuts: [getShortcutKey("CtrlOrCmd+Alt+V")]
|
|
28318
28440
|
}
|
|
28319
28441
|
),
|
|
28320
|
-
/* @__PURE__ */
|
|
28442
|
+
/* @__PURE__ */ jsx133(
|
|
28321
28443
|
Shortcut2,
|
|
28322
28444
|
{
|
|
28323
28445
|
label: t("labels.sendToBack"),
|
|
@@ -28326,7 +28448,7 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28326
28448
|
]
|
|
28327
28449
|
}
|
|
28328
28450
|
),
|
|
28329
|
-
/* @__PURE__ */
|
|
28451
|
+
/* @__PURE__ */ jsx133(
|
|
28330
28452
|
Shortcut2,
|
|
28331
28453
|
{
|
|
28332
28454
|
label: t("labels.bringToFront"),
|
|
@@ -28335,49 +28457,49 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28335
28457
|
]
|
|
28336
28458
|
}
|
|
28337
28459
|
),
|
|
28338
|
-
/* @__PURE__ */
|
|
28460
|
+
/* @__PURE__ */ jsx133(
|
|
28339
28461
|
Shortcut2,
|
|
28340
28462
|
{
|
|
28341
28463
|
label: t("labels.sendBackward"),
|
|
28342
28464
|
shortcuts: [getShortcutKey("CtrlOrCmd+[")]
|
|
28343
28465
|
}
|
|
28344
28466
|
),
|
|
28345
|
-
/* @__PURE__ */
|
|
28467
|
+
/* @__PURE__ */ jsx133(
|
|
28346
28468
|
Shortcut2,
|
|
28347
28469
|
{
|
|
28348
28470
|
label: t("labels.bringForward"),
|
|
28349
28471
|
shortcuts: [getShortcutKey("CtrlOrCmd+]")]
|
|
28350
28472
|
}
|
|
28351
28473
|
),
|
|
28352
|
-
/* @__PURE__ */
|
|
28474
|
+
/* @__PURE__ */ jsx133(
|
|
28353
28475
|
Shortcut2,
|
|
28354
28476
|
{
|
|
28355
28477
|
label: t("labels.alignTop"),
|
|
28356
28478
|
shortcuts: [getShortcutKey("CtrlOrCmd+Shift+Up")]
|
|
28357
28479
|
}
|
|
28358
28480
|
),
|
|
28359
|
-
/* @__PURE__ */
|
|
28481
|
+
/* @__PURE__ */ jsx133(
|
|
28360
28482
|
Shortcut2,
|
|
28361
28483
|
{
|
|
28362
28484
|
label: t("labels.alignBottom"),
|
|
28363
28485
|
shortcuts: [getShortcutKey("CtrlOrCmd+Shift+Down")]
|
|
28364
28486
|
}
|
|
28365
28487
|
),
|
|
28366
|
-
/* @__PURE__ */
|
|
28488
|
+
/* @__PURE__ */ jsx133(
|
|
28367
28489
|
Shortcut2,
|
|
28368
28490
|
{
|
|
28369
28491
|
label: t("labels.alignLeft"),
|
|
28370
28492
|
shortcuts: [getShortcutKey("CtrlOrCmd+Shift+Left")]
|
|
28371
28493
|
}
|
|
28372
28494
|
),
|
|
28373
|
-
/* @__PURE__ */
|
|
28495
|
+
/* @__PURE__ */ jsx133(
|
|
28374
28496
|
Shortcut2,
|
|
28375
28497
|
{
|
|
28376
28498
|
label: t("labels.alignRight"),
|
|
28377
28499
|
shortcuts: [getShortcutKey("CtrlOrCmd+Shift+Right")]
|
|
28378
28500
|
}
|
|
28379
28501
|
),
|
|
28380
|
-
/* @__PURE__ */
|
|
28502
|
+
/* @__PURE__ */ jsx133(
|
|
28381
28503
|
Shortcut2,
|
|
28382
28504
|
{
|
|
28383
28505
|
label: t("labels.duplicateSelection"),
|
|
@@ -28387,21 +28509,21 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28387
28509
|
]
|
|
28388
28510
|
}
|
|
28389
28511
|
),
|
|
28390
|
-
/* @__PURE__ */
|
|
28512
|
+
/* @__PURE__ */ jsx133(
|
|
28391
28513
|
Shortcut2,
|
|
28392
28514
|
{
|
|
28393
28515
|
label: t("helpDialog.toggleElementLock"),
|
|
28394
28516
|
shortcuts: [getShortcutKey("CtrlOrCmd+Shift+L")]
|
|
28395
28517
|
}
|
|
28396
28518
|
),
|
|
28397
|
-
/* @__PURE__ */
|
|
28519
|
+
/* @__PURE__ */ jsx133(
|
|
28398
28520
|
Shortcut2,
|
|
28399
28521
|
{
|
|
28400
28522
|
label: t("buttons.undo"),
|
|
28401
28523
|
shortcuts: [getShortcutKey("CtrlOrCmd+Z")]
|
|
28402
28524
|
}
|
|
28403
28525
|
),
|
|
28404
|
-
/* @__PURE__ */
|
|
28526
|
+
/* @__PURE__ */ jsx133(
|
|
28405
28527
|
Shortcut2,
|
|
28406
28528
|
{
|
|
28407
28529
|
label: t("buttons.redo"),
|
|
@@ -28411,63 +28533,63 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28411
28533
|
] : [getShortcutKey("CtrlOrCmd+Shift+Z")]
|
|
28412
28534
|
}
|
|
28413
28535
|
),
|
|
28414
|
-
/* @__PURE__ */
|
|
28536
|
+
/* @__PURE__ */ jsx133(
|
|
28415
28537
|
Shortcut2,
|
|
28416
28538
|
{
|
|
28417
28539
|
label: t("labels.group"),
|
|
28418
28540
|
shortcuts: [getShortcutKey("CtrlOrCmd+G")]
|
|
28419
28541
|
}
|
|
28420
28542
|
),
|
|
28421
|
-
/* @__PURE__ */
|
|
28543
|
+
/* @__PURE__ */ jsx133(
|
|
28422
28544
|
Shortcut2,
|
|
28423
28545
|
{
|
|
28424
28546
|
label: t("labels.ungroup"),
|
|
28425
28547
|
shortcuts: [getShortcutKey("CtrlOrCmd+Shift+G")]
|
|
28426
28548
|
}
|
|
28427
28549
|
),
|
|
28428
|
-
/* @__PURE__ */
|
|
28550
|
+
/* @__PURE__ */ jsx133(
|
|
28429
28551
|
Shortcut2,
|
|
28430
28552
|
{
|
|
28431
28553
|
label: t("labels.flipHorizontal"),
|
|
28432
28554
|
shortcuts: [getShortcutKey("Shift+H")]
|
|
28433
28555
|
}
|
|
28434
28556
|
),
|
|
28435
|
-
/* @__PURE__ */
|
|
28557
|
+
/* @__PURE__ */ jsx133(
|
|
28436
28558
|
Shortcut2,
|
|
28437
28559
|
{
|
|
28438
28560
|
label: t("labels.flipVertical"),
|
|
28439
28561
|
shortcuts: [getShortcutKey("Shift+V")]
|
|
28440
28562
|
}
|
|
28441
28563
|
),
|
|
28442
|
-
/* @__PURE__ */
|
|
28564
|
+
/* @__PURE__ */ jsx133(
|
|
28443
28565
|
Shortcut2,
|
|
28444
28566
|
{
|
|
28445
28567
|
label: t("labels.showStroke"),
|
|
28446
28568
|
shortcuts: [getShortcutKey("S")]
|
|
28447
28569
|
}
|
|
28448
28570
|
),
|
|
28449
|
-
/* @__PURE__ */
|
|
28571
|
+
/* @__PURE__ */ jsx133(
|
|
28450
28572
|
Shortcut2,
|
|
28451
28573
|
{
|
|
28452
28574
|
label: t("labels.showBackground"),
|
|
28453
28575
|
shortcuts: [getShortcutKey("G")]
|
|
28454
28576
|
}
|
|
28455
28577
|
),
|
|
28456
|
-
/* @__PURE__ */
|
|
28578
|
+
/* @__PURE__ */ jsx133(
|
|
28457
28579
|
Shortcut2,
|
|
28458
28580
|
{
|
|
28459
28581
|
label: t("labels.showFonts"),
|
|
28460
28582
|
shortcuts: [getShortcutKey("Shift+F")]
|
|
28461
28583
|
}
|
|
28462
28584
|
),
|
|
28463
|
-
/* @__PURE__ */
|
|
28585
|
+
/* @__PURE__ */ jsx133(
|
|
28464
28586
|
Shortcut2,
|
|
28465
28587
|
{
|
|
28466
28588
|
label: t("labels.decreaseFontSize"),
|
|
28467
28589
|
shortcuts: [getShortcutKey("CtrlOrCmd+Shift+<")]
|
|
28468
28590
|
}
|
|
28469
28591
|
),
|
|
28470
|
-
/* @__PURE__ */
|
|
28592
|
+
/* @__PURE__ */ jsx133(
|
|
28471
28593
|
Shortcut2,
|
|
28472
28594
|
{
|
|
28473
28595
|
label: t("labels.increaseFontSize"),
|
|
@@ -28477,7 +28599,7 @@ var HelpDialog = ({ onClose }) => {
|
|
|
28477
28599
|
]
|
|
28478
28600
|
}
|
|
28479
28601
|
)
|
|
28480
|
-
] }) : /* @__PURE__ */
|
|
28602
|
+
] }) : /* @__PURE__ */ jsx133(BasicHelpDialog, {})
|
|
28481
28603
|
}
|
|
28482
28604
|
) });
|
|
28483
28605
|
};
|
|
@@ -28510,7 +28632,7 @@ var useCopyStatus = () => {
|
|
|
28510
28632
|
|
|
28511
28633
|
// components/Switch.tsx
|
|
28512
28634
|
import clsx52 from "clsx";
|
|
28513
|
-
import { jsx as
|
|
28635
|
+
import { jsx as jsx134 } from "react/jsx-runtime";
|
|
28514
28636
|
var Switch = ({
|
|
28515
28637
|
title,
|
|
28516
28638
|
name,
|
|
@@ -28518,7 +28640,7 @@ var Switch = ({
|
|
|
28518
28640
|
onChange,
|
|
28519
28641
|
disabled = false
|
|
28520
28642
|
}) => {
|
|
28521
|
-
return /* @__PURE__ */
|
|
28643
|
+
return /* @__PURE__ */ jsx134("div", { className: clsx52("Switch", { toggled: checked, disabled }), children: /* @__PURE__ */ jsx134(
|
|
28522
28644
|
"input",
|
|
28523
28645
|
{
|
|
28524
28646
|
name,
|
|
@@ -28538,13 +28660,13 @@ var Switch = ({
|
|
|
28538
28660
|
};
|
|
28539
28661
|
|
|
28540
28662
|
// components/ImageExportDialog.tsx
|
|
28541
|
-
import { jsx as
|
|
28663
|
+
import { jsx as jsx135, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
28542
28664
|
var supportsContextFilters = "filter" in document.createElement("canvas").getContext("2d");
|
|
28543
28665
|
var ErrorCanvasPreview = () => {
|
|
28544
|
-
return /* @__PURE__ */
|
|
28545
|
-
/* @__PURE__ */
|
|
28546
|
-
/* @__PURE__ */
|
|
28547
|
-
/* @__PURE__ */
|
|
28666
|
+
return /* @__PURE__ */ jsxs71("div", { children: [
|
|
28667
|
+
/* @__PURE__ */ jsx135("h3", { children: t("canvasError.cannotShowPreview") }),
|
|
28668
|
+
/* @__PURE__ */ jsx135("p", { children: /* @__PURE__ */ jsx135("span", { children: t("canvasError.canvasTooBig") }) }),
|
|
28669
|
+
/* @__PURE__ */ jsxs71("em", { children: [
|
|
28548
28670
|
"(",
|
|
28549
28671
|
t("canvasError.canvasTooBigTip"),
|
|
28550
28672
|
")"
|
|
@@ -28642,11 +28764,11 @@ var ImageExportModal = ({
|
|
|
28642
28764
|
exportScale,
|
|
28643
28765
|
embedScene
|
|
28644
28766
|
]);
|
|
28645
|
-
return /* @__PURE__ */
|
|
28646
|
-
/* @__PURE__ */
|
|
28647
|
-
/* @__PURE__ */
|
|
28648
|
-
/* @__PURE__ */
|
|
28649
|
-
/* @__PURE__ */
|
|
28767
|
+
return /* @__PURE__ */ jsxs71("div", { className: "ImageExportModal", children: [
|
|
28768
|
+
/* @__PURE__ */ jsx135("h3", { children: t("imageExportDialog.header") }),
|
|
28769
|
+
/* @__PURE__ */ jsxs71("div", { className: "ImageExportModal__preview", children: [
|
|
28770
|
+
/* @__PURE__ */ jsx135("div", { className: "ImageExportModal__preview__canvas", ref: previewRef, children: renderError && /* @__PURE__ */ jsx135(ErrorCanvasPreview, {}) }),
|
|
28771
|
+
/* @__PURE__ */ jsx135("div", { className: "ImageExportModal__preview__filename", children: !nativeFileSystemSupported && /* @__PURE__ */ jsx135(
|
|
28650
28772
|
"input",
|
|
28651
28773
|
{
|
|
28652
28774
|
type: "text",
|
|
@@ -28664,14 +28786,14 @@ var ImageExportModal = ({
|
|
|
28664
28786
|
}
|
|
28665
28787
|
) })
|
|
28666
28788
|
] }),
|
|
28667
|
-
/* @__PURE__ */
|
|
28668
|
-
/* @__PURE__ */
|
|
28669
|
-
hasSelection && /* @__PURE__ */
|
|
28789
|
+
/* @__PURE__ */ jsxs71("div", { className: "ImageExportModal__settings", children: [
|
|
28790
|
+
/* @__PURE__ */ jsx135("h3", { children: t("imageExportDialog.header") }),
|
|
28791
|
+
hasSelection && /* @__PURE__ */ jsx135(
|
|
28670
28792
|
ExportSetting,
|
|
28671
28793
|
{
|
|
28672
28794
|
label: t("imageExportDialog.label.onlySelected"),
|
|
28673
28795
|
name: "exportOnlySelected",
|
|
28674
|
-
children: /* @__PURE__ */
|
|
28796
|
+
children: /* @__PURE__ */ jsx135(
|
|
28675
28797
|
Switch,
|
|
28676
28798
|
{
|
|
28677
28799
|
name: "exportOnlySelected",
|
|
@@ -28683,12 +28805,12 @@ var ImageExportModal = ({
|
|
|
28683
28805
|
)
|
|
28684
28806
|
}
|
|
28685
28807
|
),
|
|
28686
|
-
/* @__PURE__ */
|
|
28808
|
+
/* @__PURE__ */ jsx135(
|
|
28687
28809
|
ExportSetting,
|
|
28688
28810
|
{
|
|
28689
28811
|
label: t("imageExportDialog.label.withBackground"),
|
|
28690
28812
|
name: "exportBackgroundSwitch",
|
|
28691
|
-
children: /* @__PURE__ */
|
|
28813
|
+
children: /* @__PURE__ */ jsx135(
|
|
28692
28814
|
Switch,
|
|
28693
28815
|
{
|
|
28694
28816
|
name: "exportBackgroundSwitch",
|
|
@@ -28705,12 +28827,12 @@ var ImageExportModal = ({
|
|
|
28705
28827
|
)
|
|
28706
28828
|
}
|
|
28707
28829
|
),
|
|
28708
|
-
supportsContextFilters && /* @__PURE__ */
|
|
28830
|
+
supportsContextFilters && /* @__PURE__ */ jsx135(
|
|
28709
28831
|
ExportSetting,
|
|
28710
28832
|
{
|
|
28711
28833
|
label: t("imageExportDialog.label.darkMode"),
|
|
28712
28834
|
name: "exportDarkModeSwitch",
|
|
28713
|
-
children: /* @__PURE__ */
|
|
28835
|
+
children: /* @__PURE__ */ jsx135(
|
|
28714
28836
|
Switch,
|
|
28715
28837
|
{
|
|
28716
28838
|
name: "exportDarkModeSwitch",
|
|
@@ -28727,13 +28849,13 @@ var ImageExportModal = ({
|
|
|
28727
28849
|
)
|
|
28728
28850
|
}
|
|
28729
28851
|
),
|
|
28730
|
-
/* @__PURE__ */
|
|
28852
|
+
/* @__PURE__ */ jsx135(
|
|
28731
28853
|
ExportSetting,
|
|
28732
28854
|
{
|
|
28733
28855
|
label: t("imageExportDialog.label.embedScene"),
|
|
28734
28856
|
tooltip: t("imageExportDialog.tooltip.embedScene"),
|
|
28735
28857
|
name: "exportEmbedSwitch",
|
|
28736
|
-
children: /* @__PURE__ */
|
|
28858
|
+
children: /* @__PURE__ */ jsx135(
|
|
28737
28859
|
Switch,
|
|
28738
28860
|
{
|
|
28739
28861
|
name: "exportEmbedSwitch",
|
|
@@ -28750,12 +28872,12 @@ var ImageExportModal = ({
|
|
|
28750
28872
|
)
|
|
28751
28873
|
}
|
|
28752
28874
|
),
|
|
28753
|
-
/* @__PURE__ */
|
|
28875
|
+
/* @__PURE__ */ jsx135(
|
|
28754
28876
|
ExportSetting,
|
|
28755
28877
|
{
|
|
28756
28878
|
label: t("imageExportDialog.label.scale"),
|
|
28757
28879
|
name: "exportScale",
|
|
28758
|
-
children: /* @__PURE__ */
|
|
28880
|
+
children: /* @__PURE__ */ jsx135(
|
|
28759
28881
|
RadioGroup,
|
|
28760
28882
|
{
|
|
28761
28883
|
name: "exportScale",
|
|
@@ -28772,8 +28894,8 @@ var ImageExportModal = ({
|
|
|
28772
28894
|
)
|
|
28773
28895
|
}
|
|
28774
28896
|
),
|
|
28775
|
-
/* @__PURE__ */
|
|
28776
|
-
/* @__PURE__ */
|
|
28897
|
+
/* @__PURE__ */ jsxs71("div", { className: "ImageExportModal__settings__buttons", children: [
|
|
28898
|
+
/* @__PURE__ */ jsx135(
|
|
28777
28899
|
FilledButton,
|
|
28778
28900
|
{
|
|
28779
28901
|
className: "ImageExportModal__settings__buttons__button",
|
|
@@ -28785,7 +28907,7 @@ var ImageExportModal = ({
|
|
|
28785
28907
|
children: t("imageExportDialog.button.exportToPng")
|
|
28786
28908
|
}
|
|
28787
28909
|
),
|
|
28788
|
-
/* @__PURE__ */
|
|
28910
|
+
/* @__PURE__ */ jsx135(
|
|
28789
28911
|
FilledButton,
|
|
28790
28912
|
{
|
|
28791
28913
|
className: "ImageExportModal__settings__buttons__button",
|
|
@@ -28797,7 +28919,7 @@ var ImageExportModal = ({
|
|
|
28797
28919
|
children: t("imageExportDialog.button.exportToSvg")
|
|
28798
28920
|
}
|
|
28799
28921
|
),
|
|
28800
|
-
(probablySupportsClipboardBlob || isFirefox) && /* @__PURE__ */
|
|
28922
|
+
(probablySupportsClipboardBlob || isFirefox) && /* @__PURE__ */ jsx135(
|
|
28801
28923
|
FilledButton,
|
|
28802
28924
|
{
|
|
28803
28925
|
className: "ImageExportModal__settings__buttons__button",
|
|
@@ -28827,19 +28949,19 @@ var ExportSetting = ({
|
|
|
28827
28949
|
tooltip,
|
|
28828
28950
|
name
|
|
28829
28951
|
}) => {
|
|
28830
|
-
return /* @__PURE__ */
|
|
28831
|
-
/* @__PURE__ */
|
|
28952
|
+
return /* @__PURE__ */ jsxs71("div", { className: "ImageExportModal__settings__setting", title: label, children: [
|
|
28953
|
+
/* @__PURE__ */ jsxs71(
|
|
28832
28954
|
"label",
|
|
28833
28955
|
{
|
|
28834
28956
|
htmlFor: name,
|
|
28835
28957
|
className: "ImageExportModal__settings__setting__label",
|
|
28836
28958
|
children: [
|
|
28837
28959
|
label,
|
|
28838
|
-
tooltip && /* @__PURE__ */
|
|
28960
|
+
tooltip && /* @__PURE__ */ jsx135(Tooltip, { label: tooltip, long: true, children: helpIcon })
|
|
28839
28961
|
]
|
|
28840
28962
|
}
|
|
28841
28963
|
),
|
|
28842
|
-
/* @__PURE__ */
|
|
28964
|
+
/* @__PURE__ */ jsx135("div", { className: "ImageExportModal__settings__setting__content", children })
|
|
28843
28965
|
] });
|
|
28844
28966
|
};
|
|
28845
28967
|
var ImageExportDialog = ({
|
|
@@ -28857,7 +28979,7 @@ var ImageExportDialog = ({
|
|
|
28857
28979
|
elementsSnapshot: cloneJSON(elements)
|
|
28858
28980
|
};
|
|
28859
28981
|
});
|
|
28860
|
-
return /* @__PURE__ */
|
|
28982
|
+
return /* @__PURE__ */ jsx135(Dialog, { onCloseRequest, size: "wide", title: false, children: /* @__PURE__ */ jsx135(
|
|
28861
28983
|
ImageExportModal,
|
|
28862
28984
|
{
|
|
28863
28985
|
elementsSnapshot,
|
|
@@ -28875,9 +28997,9 @@ import React38 from "react";
|
|
|
28875
28997
|
|
|
28876
28998
|
// components/Card.tsx
|
|
28877
28999
|
import OpenColor3 from "open-color";
|
|
28878
|
-
import { jsx as
|
|
29000
|
+
import { jsx as jsx136 } from "react/jsx-runtime";
|
|
28879
29001
|
var Card = ({ children, color }) => {
|
|
28880
|
-
return /* @__PURE__ */
|
|
29002
|
+
return /* @__PURE__ */ jsx136(
|
|
28881
29003
|
"div",
|
|
28882
29004
|
{
|
|
28883
29005
|
className: "Card",
|
|
@@ -28892,7 +29014,7 @@ var Card = ({ children, color }) => {
|
|
|
28892
29014
|
};
|
|
28893
29015
|
|
|
28894
29016
|
// components/JSONExportDialog.tsx
|
|
28895
|
-
import { Fragment as Fragment22, jsx as
|
|
29017
|
+
import { Fragment as Fragment22, jsx as jsx137, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
28896
29018
|
var JSONExportModal = ({
|
|
28897
29019
|
elements,
|
|
28898
29020
|
appState,
|
|
@@ -28904,15 +29026,15 @@ var JSONExportModal = ({
|
|
|
28904
29026
|
onCloseRequest
|
|
28905
29027
|
}) => {
|
|
28906
29028
|
const { onExportToBackend } = exportOpts;
|
|
28907
|
-
return /* @__PURE__ */
|
|
28908
|
-
exportOpts.saveFileToDisk && /* @__PURE__ */
|
|
28909
|
-
/* @__PURE__ */
|
|
28910
|
-
/* @__PURE__ */
|
|
28911
|
-
/* @__PURE__ */
|
|
29029
|
+
return /* @__PURE__ */ jsx137("div", { className: "ExportDialog ExportDialog--json", children: /* @__PURE__ */ jsxs72("div", { className: "ExportDialog-cards", children: [
|
|
29030
|
+
exportOpts.saveFileToDisk && /* @__PURE__ */ jsxs72(Card, { color: "lime", children: [
|
|
29031
|
+
/* @__PURE__ */ jsx137("div", { className: "Card-icon", children: exportToFileIcon }),
|
|
29032
|
+
/* @__PURE__ */ jsx137("h2", { children: t("exportDialog.disk_title") }),
|
|
29033
|
+
/* @__PURE__ */ jsxs72("div", { className: "Card-details", children: [
|
|
28912
29034
|
t("exportDialog.disk_details"),
|
|
28913
29035
|
!nativeFileSystemSupported && actionManager.renderAction("changeProjectName")
|
|
28914
29036
|
] }),
|
|
28915
|
-
/* @__PURE__ */
|
|
29037
|
+
/* @__PURE__ */ jsx137(
|
|
28916
29038
|
ToolButton,
|
|
28917
29039
|
{
|
|
28918
29040
|
className: "Card-button",
|
|
@@ -28926,11 +29048,11 @@ var JSONExportModal = ({
|
|
|
28926
29048
|
}
|
|
28927
29049
|
)
|
|
28928
29050
|
] }),
|
|
28929
|
-
onExportToBackend && /* @__PURE__ */
|
|
28930
|
-
/* @__PURE__ */
|
|
28931
|
-
/* @__PURE__ */
|
|
28932
|
-
/* @__PURE__ */
|
|
28933
|
-
/* @__PURE__ */
|
|
29051
|
+
onExportToBackend && /* @__PURE__ */ jsxs72(Card, { color: "pink", children: [
|
|
29052
|
+
/* @__PURE__ */ jsx137("div", { className: "Card-icon", children: LinkIcon }),
|
|
29053
|
+
/* @__PURE__ */ jsx137("h2", { children: t("exportDialog.link_title") }),
|
|
29054
|
+
/* @__PURE__ */ jsx137("div", { className: "Card-details", children: t("exportDialog.link_details") }),
|
|
29055
|
+
/* @__PURE__ */ jsx137(
|
|
28934
29056
|
ToolButton,
|
|
28935
29057
|
{
|
|
28936
29058
|
className: "Card-button",
|
|
@@ -28965,7 +29087,7 @@ var JSONExportDialog = ({
|
|
|
28965
29087
|
const handleClose = React38.useCallback(() => {
|
|
28966
29088
|
setAppState({ openDialog: null });
|
|
28967
29089
|
}, [setAppState]);
|
|
28968
|
-
return /* @__PURE__ */
|
|
29090
|
+
return /* @__PURE__ */ jsx137(Fragment22, { children: appState.openDialog?.name === "jsonExport" && /* @__PURE__ */ jsx137(Dialog, { onCloseRequest: handleClose, title: t("buttons.export"), children: /* @__PURE__ */ jsx137(
|
|
28969
29091
|
JSONExportModal,
|
|
28970
29092
|
{
|
|
28971
29093
|
elements,
|
|
@@ -28982,10 +29104,10 @@ var JSONExportDialog = ({
|
|
|
28982
29104
|
|
|
28983
29105
|
// components/LaserPointerButton.tsx
|
|
28984
29106
|
import clsx53 from "clsx";
|
|
28985
|
-
import { jsx as
|
|
29107
|
+
import { jsx as jsx138, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
28986
29108
|
var DEFAULT_SIZE3 = "small";
|
|
28987
29109
|
var LaserPointerButton = (props) => {
|
|
28988
|
-
return /* @__PURE__ */
|
|
29110
|
+
return /* @__PURE__ */ jsxs73(
|
|
28989
29111
|
"label",
|
|
28990
29112
|
{
|
|
28991
29113
|
className: clsx53(
|
|
@@ -28997,7 +29119,7 @@ var LaserPointerButton = (props) => {
|
|
|
28997
29119
|
),
|
|
28998
29120
|
title: `${props.title}`,
|
|
28999
29121
|
children: [
|
|
29000
|
-
/* @__PURE__ */
|
|
29122
|
+
/* @__PURE__ */ jsx138(
|
|
29001
29123
|
"input",
|
|
29002
29124
|
{
|
|
29003
29125
|
className: "ToolIcon_type_checkbox",
|
|
@@ -29009,33 +29131,33 @@ var LaserPointerButton = (props) => {
|
|
|
29009
29131
|
"data-testid": "toolbar-LaserPointer"
|
|
29010
29132
|
}
|
|
29011
29133
|
),
|
|
29012
|
-
/* @__PURE__ */
|
|
29134
|
+
/* @__PURE__ */ jsx138("div", { className: "ToolIcon__icon", children: laserPointerToolIcon })
|
|
29013
29135
|
]
|
|
29014
29136
|
}
|
|
29015
29137
|
);
|
|
29016
29138
|
};
|
|
29017
29139
|
|
|
29018
29140
|
// components/LayerUI.tsx
|
|
29019
|
-
import { Fragment as Fragment23, jsx as
|
|
29141
|
+
import { Fragment as Fragment23, jsx as jsx139, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
29020
29142
|
var DefaultMainMenu = ({ UIOptions }) => {
|
|
29021
|
-
return /* @__PURE__ */
|
|
29022
|
-
/* @__PURE__ */
|
|
29023
|
-
/* @__PURE__ */
|
|
29024
|
-
UIOptions.canvasActions.export && /* @__PURE__ */
|
|
29025
|
-
UIOptions.canvasActions.saveAsImage && /* @__PURE__ */
|
|
29026
|
-
/* @__PURE__ */
|
|
29027
|
-
/* @__PURE__ */
|
|
29028
|
-
/* @__PURE__ */
|
|
29029
|
-
/* @__PURE__ */
|
|
29030
|
-
/* @__PURE__ */
|
|
29031
|
-
/* @__PURE__ */
|
|
29032
|
-
/* @__PURE__ */
|
|
29143
|
+
return /* @__PURE__ */ jsxs74(MainMenu_default, { __fallback: true, children: [
|
|
29144
|
+
/* @__PURE__ */ jsx139(MainMenu_default.DefaultItems.LoadScene, {}),
|
|
29145
|
+
/* @__PURE__ */ jsx139(MainMenu_default.DefaultItems.SaveToActiveFile, {}),
|
|
29146
|
+
UIOptions.canvasActions.export && /* @__PURE__ */ jsx139(MainMenu_default.DefaultItems.Export, {}),
|
|
29147
|
+
UIOptions.canvasActions.saveAsImage && /* @__PURE__ */ jsx139(MainMenu_default.DefaultItems.SaveAsImage, {}),
|
|
29148
|
+
/* @__PURE__ */ jsx139(MainMenu_default.DefaultItems.SearchMenu, {}),
|
|
29149
|
+
/* @__PURE__ */ jsx139(MainMenu_default.DefaultItems.Help, {}),
|
|
29150
|
+
/* @__PURE__ */ jsx139(MainMenu_default.Separator, {}),
|
|
29151
|
+
/* @__PURE__ */ jsx139(MainMenu_default.Group, { title: "Excalidraw links", children: /* @__PURE__ */ jsx139(MainMenu_default.DefaultItems.Socials, {}) }),
|
|
29152
|
+
/* @__PURE__ */ jsx139(MainMenu_default.Separator, {}),
|
|
29153
|
+
/* @__PURE__ */ jsx139(MainMenu_default.DefaultItems.ToggleTheme, {}),
|
|
29154
|
+
/* @__PURE__ */ jsx139(MainMenu_default.DefaultItems.ChangeCanvasBackground, {})
|
|
29033
29155
|
] });
|
|
29034
29156
|
};
|
|
29035
29157
|
var DefaultOverwriteConfirmDialog = () => {
|
|
29036
|
-
return /* @__PURE__ */
|
|
29037
|
-
/* @__PURE__ */
|
|
29038
|
-
/* @__PURE__ */
|
|
29158
|
+
return /* @__PURE__ */ jsxs74(OverwriteConfirmDialog, { __fallback: true, children: [
|
|
29159
|
+
/* @__PURE__ */ jsx139(OverwriteConfirmDialog.Actions.SaveToDisk, {}),
|
|
29160
|
+
/* @__PURE__ */ jsx139(OverwriteConfirmDialog.Actions.ExportToImage, {})
|
|
29039
29161
|
] });
|
|
29040
29162
|
};
|
|
29041
29163
|
var LayerUI = ({
|
|
@@ -29067,7 +29189,7 @@ var LayerUI = ({
|
|
|
29067
29189
|
if (!UIOptions.canvasActions.export) {
|
|
29068
29190
|
return null;
|
|
29069
29191
|
}
|
|
29070
|
-
return /* @__PURE__ */
|
|
29192
|
+
return /* @__PURE__ */ jsx139(
|
|
29071
29193
|
JSONExportDialog,
|
|
29072
29194
|
{
|
|
29073
29195
|
elements,
|
|
@@ -29084,7 +29206,7 @@ var LayerUI = ({
|
|
|
29084
29206
|
if (!UIOptions.canvasActions.saveAsImage || appState.openDialog?.name !== "imageExport") {
|
|
29085
29207
|
return null;
|
|
29086
29208
|
}
|
|
29087
|
-
return /* @__PURE__ */
|
|
29209
|
+
return /* @__PURE__ */ jsx139(
|
|
29088
29210
|
ImageExportDialog,
|
|
29089
29211
|
{
|
|
29090
29212
|
elements,
|
|
@@ -29097,18 +29219,18 @@ var LayerUI = ({
|
|
|
29097
29219
|
}
|
|
29098
29220
|
);
|
|
29099
29221
|
};
|
|
29100
|
-
const renderCanvasActions = () => /* @__PURE__ */
|
|
29101
|
-
/* @__PURE__ */
|
|
29102
|
-
renderWelcomeScreen && /* @__PURE__ */
|
|
29222
|
+
const renderCanvasActions = () => /* @__PURE__ */ jsxs74("div", { style: { position: "relative" }, children: [
|
|
29223
|
+
/* @__PURE__ */ jsx139(tunnels.MainMenuTunnel.Out, {}),
|
|
29224
|
+
renderWelcomeScreen && /* @__PURE__ */ jsx139(tunnels.WelcomeScreenMenuHintTunnel.Out, {})
|
|
29103
29225
|
] });
|
|
29104
|
-
const renderSelectedShapeActions = () => /* @__PURE__ */
|
|
29226
|
+
const renderSelectedShapeActions = () => /* @__PURE__ */ jsx139(
|
|
29105
29227
|
Section,
|
|
29106
29228
|
{
|
|
29107
29229
|
heading: "selectedShapeActions",
|
|
29108
29230
|
className: clsx54("selected-shape-actions zen-mode-transition", {
|
|
29109
29231
|
"transition-left": appState.zenModeEnabled
|
|
29110
29232
|
}),
|
|
29111
|
-
children: /* @__PURE__ */
|
|
29233
|
+
children: /* @__PURE__ */ jsx139(
|
|
29112
29234
|
Island,
|
|
29113
29235
|
{
|
|
29114
29236
|
className: CLASSES.SHAPE_ACTIONS_MENU,
|
|
@@ -29118,7 +29240,7 @@ var LayerUI = ({
|
|
|
29118
29240
|
// approximate height of hamburgerMenu + footer
|
|
29119
29241
|
maxHeight: `${appState.height - 166}px`
|
|
29120
29242
|
},
|
|
29121
|
-
children: /* @__PURE__ */
|
|
29243
|
+
children: /* @__PURE__ */ jsx139(
|
|
29122
29244
|
SelectedShapeActions,
|
|
29123
29245
|
{
|
|
29124
29246
|
appState,
|
|
@@ -29137,14 +29259,14 @@ var LayerUI = ({
|
|
|
29137
29259
|
elements
|
|
29138
29260
|
);
|
|
29139
29261
|
const shouldShowStats = appState.stats.open && !appState.zenModeEnabled && !appState.viewModeEnabled && appState.openDialog?.name !== "elementLinkSelector";
|
|
29140
|
-
return /* @__PURE__ */
|
|
29141
|
-
/* @__PURE__ */
|
|
29262
|
+
return /* @__PURE__ */ jsx139(FixedSideContainer, { side: "top", children: /* @__PURE__ */ jsxs74("div", { className: "App-menu App-menu_top", children: [
|
|
29263
|
+
/* @__PURE__ */ jsxs74(Stack_default.Col, { gap: 6, className: clsx54("App-menu_top__left"), children: [
|
|
29142
29264
|
renderCanvasActions(),
|
|
29143
29265
|
shouldRenderSelectedShapeActions && renderSelectedShapeActions()
|
|
29144
29266
|
] }),
|
|
29145
|
-
!appState.viewModeEnabled && appState.openDialog?.name !== "elementLinkSelector" && /* @__PURE__ */
|
|
29146
|
-
renderWelcomeScreen && /* @__PURE__ */
|
|
29147
|
-
/* @__PURE__ */
|
|
29267
|
+
!appState.viewModeEnabled && appState.openDialog?.name !== "elementLinkSelector" && /* @__PURE__ */ jsx139(Section, { heading: "shapes", className: "shapes-section", children: (heading) => /* @__PURE__ */ jsxs74("div", { style: { position: "relative" }, children: [
|
|
29268
|
+
renderWelcomeScreen && /* @__PURE__ */ jsx139(tunnels.WelcomeScreenToolbarHintTunnel.Out, {}),
|
|
29269
|
+
/* @__PURE__ */ jsx139(Stack_default.Col, { gap: 4, align: "start", children: /* @__PURE__ */ jsxs74(
|
|
29148
29270
|
Stack_default.Row,
|
|
29149
29271
|
{
|
|
29150
29272
|
gap: 1,
|
|
@@ -29152,7 +29274,7 @@ var LayerUI = ({
|
|
|
29152
29274
|
"zen-mode": appState.zenModeEnabled
|
|
29153
29275
|
}),
|
|
29154
29276
|
children: [
|
|
29155
|
-
/* @__PURE__ */
|
|
29277
|
+
/* @__PURE__ */ jsxs74(
|
|
29156
29278
|
Island,
|
|
29157
29279
|
{
|
|
29158
29280
|
padding: 1,
|
|
@@ -29160,7 +29282,7 @@ var LayerUI = ({
|
|
|
29160
29282
|
"zen-mode": appState.zenModeEnabled
|
|
29161
29283
|
}),
|
|
29162
29284
|
children: [
|
|
29163
|
-
/* @__PURE__ */
|
|
29285
|
+
/* @__PURE__ */ jsx139(
|
|
29164
29286
|
HintViewer,
|
|
29165
29287
|
{
|
|
29166
29288
|
appState,
|
|
@@ -29170,8 +29292,8 @@ var LayerUI = ({
|
|
|
29170
29292
|
}
|
|
29171
29293
|
),
|
|
29172
29294
|
heading,
|
|
29173
|
-
/* @__PURE__ */
|
|
29174
|
-
/* @__PURE__ */
|
|
29295
|
+
/* @__PURE__ */ jsxs74(Stack_default.Row, { gap: 1, children: [
|
|
29296
|
+
/* @__PURE__ */ jsx139(
|
|
29175
29297
|
PenModeButton,
|
|
29176
29298
|
{
|
|
29177
29299
|
zenModeEnabled: appState.zenModeEnabled,
|
|
@@ -29181,7 +29303,7 @@ var LayerUI = ({
|
|
|
29181
29303
|
penDetected: appState.penDetected
|
|
29182
29304
|
}
|
|
29183
29305
|
),
|
|
29184
|
-
/* @__PURE__ */
|
|
29306
|
+
/* @__PURE__ */ jsx139(
|
|
29185
29307
|
HandButton,
|
|
29186
29308
|
{
|
|
29187
29309
|
checked: isHandToolActive(appState),
|
|
@@ -29190,7 +29312,7 @@ var LayerUI = ({
|
|
|
29190
29312
|
isMobile: true
|
|
29191
29313
|
}
|
|
29192
29314
|
),
|
|
29193
|
-
/* @__PURE__ */
|
|
29315
|
+
/* @__PURE__ */ jsx139(
|
|
29194
29316
|
ShapesSwitcher,
|
|
29195
29317
|
{
|
|
29196
29318
|
appState,
|
|
@@ -29203,7 +29325,7 @@ var LayerUI = ({
|
|
|
29203
29325
|
]
|
|
29204
29326
|
}
|
|
29205
29327
|
),
|
|
29206
|
-
isCollaborating && /* @__PURE__ */
|
|
29328
|
+
isCollaborating && /* @__PURE__ */ jsx139(
|
|
29207
29329
|
Island,
|
|
29208
29330
|
{
|
|
29209
29331
|
style: {
|
|
@@ -29211,7 +29333,7 @@ var LayerUI = ({
|
|
|
29211
29333
|
alignSelf: "center",
|
|
29212
29334
|
height: "fit-content"
|
|
29213
29335
|
},
|
|
29214
|
-
children: /* @__PURE__ */
|
|
29336
|
+
children: /* @__PURE__ */ jsx139(
|
|
29215
29337
|
LaserPointerButton,
|
|
29216
29338
|
{
|
|
29217
29339
|
title: t("toolBar.laser"),
|
|
@@ -29226,7 +29348,7 @@ var LayerUI = ({
|
|
|
29226
29348
|
}
|
|
29227
29349
|
) })
|
|
29228
29350
|
] }) }),
|
|
29229
|
-
/* @__PURE__ */
|
|
29351
|
+
/* @__PURE__ */ jsxs74(
|
|
29230
29352
|
"div",
|
|
29231
29353
|
{
|
|
29232
29354
|
className: clsx54(
|
|
@@ -29236,7 +29358,7 @@ var LayerUI = ({
|
|
|
29236
29358
|
}
|
|
29237
29359
|
),
|
|
29238
29360
|
children: [
|
|
29239
|
-
appState.collaborators.size > 0 && /* @__PURE__ */
|
|
29361
|
+
appState.collaborators.size > 0 && /* @__PURE__ */ jsx139(
|
|
29240
29362
|
UserList,
|
|
29241
29363
|
{
|
|
29242
29364
|
collaborators: appState.collaborators,
|
|
@@ -29245,8 +29367,8 @@ var LayerUI = ({
|
|
|
29245
29367
|
),
|
|
29246
29368
|
renderTopRightUI?.(device.editor.isMobile, appState),
|
|
29247
29369
|
!appState.viewModeEnabled && appState.openDialog?.name !== "elementLinkSelector" && // hide button when sidebar docked
|
|
29248
|
-
(!isSidebarDocked || appState.openSidebar?.name !== DEFAULT_SIDEBAR.name) && /* @__PURE__ */
|
|
29249
|
-
shouldShowStats && /* @__PURE__ */
|
|
29370
|
+
(!isSidebarDocked || appState.openSidebar?.name !== DEFAULT_SIDEBAR.name) && /* @__PURE__ */ jsx139(tunnels.DefaultSidebarTriggerTunnel.Out, {}),
|
|
29371
|
+
shouldShowStats && /* @__PURE__ */ jsx139(
|
|
29250
29372
|
Stats,
|
|
29251
29373
|
{
|
|
29252
29374
|
app,
|
|
@@ -29262,7 +29384,7 @@ var LayerUI = ({
|
|
|
29262
29384
|
] }) });
|
|
29263
29385
|
};
|
|
29264
29386
|
const renderSidebars = () => {
|
|
29265
|
-
return /* @__PURE__ */
|
|
29387
|
+
return /* @__PURE__ */ jsx139(
|
|
29266
29388
|
DefaultSidebar,
|
|
29267
29389
|
{
|
|
29268
29390
|
__fallback: true,
|
|
@@ -29277,10 +29399,10 @@ var LayerUI = ({
|
|
|
29277
29399
|
);
|
|
29278
29400
|
};
|
|
29279
29401
|
const isSidebarDocked = useAtomValue(isSidebarDockedAtom);
|
|
29280
|
-
const layerUIJSX = /* @__PURE__ */
|
|
29402
|
+
const layerUIJSX = /* @__PURE__ */ jsxs74(Fragment23, { children: [
|
|
29281
29403
|
children,
|
|
29282
|
-
/* @__PURE__ */
|
|
29283
|
-
/* @__PURE__ */
|
|
29404
|
+
/* @__PURE__ */ jsx139(DefaultMainMenu, { UIOptions }),
|
|
29405
|
+
/* @__PURE__ */ jsx139(
|
|
29284
29406
|
DefaultSidebar.Trigger,
|
|
29285
29407
|
{
|
|
29286
29408
|
__fallback: true,
|
|
@@ -29299,11 +29421,11 @@ var LayerUI = ({
|
|
|
29299
29421
|
children: t("toolBar.library")
|
|
29300
29422
|
}
|
|
29301
29423
|
),
|
|
29302
|
-
/* @__PURE__ */
|
|
29303
|
-
appState.openDialog?.name === "ttd" && /* @__PURE__ */
|
|
29304
|
-
appState.isLoading && /* @__PURE__ */
|
|
29305
|
-
appState.errorMessage && /* @__PURE__ */
|
|
29306
|
-
eyeDropperState && !device.editor.isMobile && /* @__PURE__ */
|
|
29424
|
+
/* @__PURE__ */ jsx139(DefaultOverwriteConfirmDialog, {}),
|
|
29425
|
+
appState.openDialog?.name === "ttd" && /* @__PURE__ */ jsx139(TTDDialog, { __fallback: true }),
|
|
29426
|
+
appState.isLoading && /* @__PURE__ */ jsx139(LoadingMessage, { delay: 250 }),
|
|
29427
|
+
appState.errorMessage && /* @__PURE__ */ jsx139(ErrorDialog, { onClose: () => setAppState({ errorMessage: null }), children: appState.errorMessage }),
|
|
29428
|
+
eyeDropperState && !device.editor.isMobile && /* @__PURE__ */ jsx139(
|
|
29307
29429
|
EyeDropper,
|
|
29308
29430
|
{
|
|
29309
29431
|
colorPickerType: eyeDropperState.colorPickerType,
|
|
@@ -29342,7 +29464,7 @@ var LayerUI = ({
|
|
|
29342
29464
|
}
|
|
29343
29465
|
}
|
|
29344
29466
|
),
|
|
29345
|
-
appState.openDialog?.name === "help" && /* @__PURE__ */
|
|
29467
|
+
appState.openDialog?.name === "help" && /* @__PURE__ */ jsx139(
|
|
29346
29468
|
HelpDialog,
|
|
29347
29469
|
{
|
|
29348
29470
|
onClose: () => {
|
|
@@ -29350,7 +29472,7 @@ var LayerUI = ({
|
|
|
29350
29472
|
}
|
|
29351
29473
|
}
|
|
29352
29474
|
),
|
|
29353
|
-
appState.openDialog?.name === "elementLinkSelector" && /* @__PURE__ */
|
|
29475
|
+
appState.openDialog?.name === "elementLinkSelector" && /* @__PURE__ */ jsx139(
|
|
29354
29476
|
ElementLinkDialog_default,
|
|
29355
29477
|
{
|
|
29356
29478
|
sourceElementId: appState.openDialog.sourceElementId,
|
|
@@ -29364,10 +29486,10 @@ var LayerUI = ({
|
|
|
29364
29486
|
generateLinkForSelection
|
|
29365
29487
|
}
|
|
29366
29488
|
),
|
|
29367
|
-
/* @__PURE__ */
|
|
29489
|
+
/* @__PURE__ */ jsx139(tunnels.OverwriteConfirmDialogTunnel.Out, {}),
|
|
29368
29490
|
renderImageExportDialog(),
|
|
29369
29491
|
renderJSONExportDialog(),
|
|
29370
|
-
appState.pasteDialog.shown && /* @__PURE__ */
|
|
29492
|
+
appState.pasteDialog.shown && /* @__PURE__ */ jsx139(
|
|
29371
29493
|
PasteChartDialog,
|
|
29372
29494
|
{
|
|
29373
29495
|
setAppState,
|
|
@@ -29377,7 +29499,7 @@ var LayerUI = ({
|
|
|
29377
29499
|
})
|
|
29378
29500
|
}
|
|
29379
29501
|
),
|
|
29380
|
-
device.editor.isMobile && /* @__PURE__ */
|
|
29502
|
+
device.editor.isMobile && /* @__PURE__ */ jsx139(
|
|
29381
29503
|
MobileMenu,
|
|
29382
29504
|
{
|
|
29383
29505
|
app,
|
|
@@ -29398,16 +29520,16 @@ var LayerUI = ({
|
|
|
29398
29520
|
UIOptions
|
|
29399
29521
|
}
|
|
29400
29522
|
),
|
|
29401
|
-
!device.editor.isMobile && /* @__PURE__ */
|
|
29402
|
-
/* @__PURE__ */
|
|
29523
|
+
!device.editor.isMobile && /* @__PURE__ */ jsxs74(Fragment23, { children: [
|
|
29524
|
+
/* @__PURE__ */ jsxs74(
|
|
29403
29525
|
"div",
|
|
29404
29526
|
{
|
|
29405
29527
|
className: "layer-ui__wrapper",
|
|
29406
29528
|
style: appState.openSidebar && isSidebarDocked && device.editor.canFitSidebar ? { width: `calc(100% - var(--right-sidebar-width))` } : {},
|
|
29407
29529
|
children: [
|
|
29408
|
-
renderWelcomeScreen && /* @__PURE__ */
|
|
29530
|
+
renderWelcomeScreen && /* @__PURE__ */ jsx139(tunnels.WelcomeScreenCenterTunnel.Out, {}),
|
|
29409
29531
|
renderFixedSideContainer(),
|
|
29410
|
-
/* @__PURE__ */
|
|
29532
|
+
/* @__PURE__ */ jsx139(
|
|
29411
29533
|
Footer_default,
|
|
29412
29534
|
{
|
|
29413
29535
|
appState,
|
|
@@ -29416,7 +29538,7 @@ var LayerUI = ({
|
|
|
29416
29538
|
renderWelcomeScreen
|
|
29417
29539
|
}
|
|
29418
29540
|
),
|
|
29419
|
-
appState.scrolledOutside && /* @__PURE__ */
|
|
29541
|
+
appState.scrolledOutside && /* @__PURE__ */ jsx139(
|
|
29420
29542
|
"button",
|
|
29421
29543
|
{
|
|
29422
29544
|
type: "button",
|
|
@@ -29435,7 +29557,7 @@ var LayerUI = ({
|
|
|
29435
29557
|
renderSidebars()
|
|
29436
29558
|
] })
|
|
29437
29559
|
] });
|
|
29438
|
-
return /* @__PURE__ */
|
|
29560
|
+
return /* @__PURE__ */ jsx139(UIAppStateContext.Provider, { value: appState, children: /* @__PURE__ */ jsx139(TunnelsJotaiProvider, { children: /* @__PURE__ */ jsx139(TunnelsContext.Provider, { value: tunnels, children: layerUIJSX }) }) });
|
|
29439
29561
|
};
|
|
29440
29562
|
var stripIrrelevantAppStateProps = (appState) => {
|
|
29441
29563
|
const {
|
|
@@ -29469,10 +29591,10 @@ var LayerUI_default = React39.memo(LayerUI, areEqual2);
|
|
|
29469
29591
|
|
|
29470
29592
|
// components/MagicButton.tsx
|
|
29471
29593
|
import clsx55 from "clsx";
|
|
29472
|
-
import { jsx as
|
|
29594
|
+
import { jsx as jsx140, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
29473
29595
|
var DEFAULT_SIZE4 = "small";
|
|
29474
29596
|
var ElementCanvasButton = (props) => {
|
|
29475
|
-
return /* @__PURE__ */
|
|
29597
|
+
return /* @__PURE__ */ jsxs75(
|
|
29476
29598
|
"label",
|
|
29477
29599
|
{
|
|
29478
29600
|
className: clsx55(
|
|
@@ -29484,7 +29606,7 @@ var ElementCanvasButton = (props) => {
|
|
|
29484
29606
|
),
|
|
29485
29607
|
title: `${props.title}`,
|
|
29486
29608
|
children: [
|
|
29487
|
-
/* @__PURE__ */
|
|
29609
|
+
/* @__PURE__ */ jsx140(
|
|
29488
29610
|
"input",
|
|
29489
29611
|
{
|
|
29490
29612
|
className: "ToolIcon_type_checkbox",
|
|
@@ -29495,7 +29617,7 @@ var ElementCanvasButton = (props) => {
|
|
|
29495
29617
|
"aria-label": props.title
|
|
29496
29618
|
}
|
|
29497
29619
|
),
|
|
29498
|
-
/* @__PURE__ */
|
|
29620
|
+
/* @__PURE__ */ jsx140("div", { className: "ToolIcon__icon", children: props.icon })
|
|
29499
29621
|
]
|
|
29500
29622
|
}
|
|
29501
29623
|
);
|
|
@@ -29503,7 +29625,7 @@ var ElementCanvasButton = (props) => {
|
|
|
29503
29625
|
|
|
29504
29626
|
// components/SVGLayer.tsx
|
|
29505
29627
|
import { useEffect as useEffect39, useRef as useRef35 } from "react";
|
|
29506
|
-
import { jsx as
|
|
29628
|
+
import { jsx as jsx141 } from "react/jsx-runtime";
|
|
29507
29629
|
var SVGLayer = ({ trails }) => {
|
|
29508
29630
|
const svgRef = useRef35(null);
|
|
29509
29631
|
useEffect39(() => {
|
|
@@ -29518,12 +29640,12 @@ var SVGLayer = ({ trails }) => {
|
|
|
29518
29640
|
}
|
|
29519
29641
|
};
|
|
29520
29642
|
}, trails);
|
|
29521
|
-
return /* @__PURE__ */
|
|
29643
|
+
return /* @__PURE__ */ jsx141("div", { className: "SVGLayer", children: /* @__PURE__ */ jsx141("svg", { ref: svgRef }) });
|
|
29522
29644
|
};
|
|
29523
29645
|
|
|
29524
29646
|
// components/canvases/InteractiveCanvas.tsx
|
|
29525
29647
|
import React40, { useEffect as useEffect40, useRef as useRef36 } from "react";
|
|
29526
|
-
import { jsx as
|
|
29648
|
+
import { jsx as jsx142 } from "react/jsx-runtime";
|
|
29527
29649
|
var InteractiveCanvas = (props) => {
|
|
29528
29650
|
const isComponentMounted = useRef36(false);
|
|
29529
29651
|
useEffect40(() => {
|
|
@@ -29593,7 +29715,7 @@ var InteractiveCanvas = (props) => {
|
|
|
29593
29715
|
isRenderThrottlingEnabled()
|
|
29594
29716
|
);
|
|
29595
29717
|
});
|
|
29596
|
-
return /* @__PURE__ */
|
|
29718
|
+
return /* @__PURE__ */ jsx142(
|
|
29597
29719
|
"canvas",
|
|
29598
29720
|
{
|
|
29599
29721
|
className: "excalidraw__canvas interactive",
|
|
@@ -29668,7 +29790,7 @@ var InteractiveCanvas_default = React40.memo(InteractiveCanvas, areEqual3);
|
|
|
29668
29790
|
|
|
29669
29791
|
// components/canvases/StaticCanvas.tsx
|
|
29670
29792
|
import React41, { useEffect as useEffect41, useRef as useRef37 } from "react";
|
|
29671
|
-
import { jsx as
|
|
29793
|
+
import { jsx as jsx143 } from "react/jsx-runtime";
|
|
29672
29794
|
var StaticCanvas = (props) => {
|
|
29673
29795
|
const wrapperRef = useRef37(null);
|
|
29674
29796
|
const isComponentMounted = useRef37(false);
|
|
@@ -29713,7 +29835,7 @@ var StaticCanvas = (props) => {
|
|
|
29713
29835
|
isRenderThrottlingEnabled()
|
|
29714
29836
|
);
|
|
29715
29837
|
});
|
|
29716
|
-
return /* @__PURE__ */
|
|
29838
|
+
return /* @__PURE__ */ jsx143("div", { className: "excalidraw__canvas-wrapper", ref: wrapperRef });
|
|
29717
29839
|
};
|
|
29718
29840
|
var getRelevantAppStateProps2 = (appState) => {
|
|
29719
29841
|
const relevantAppStateProps = {
|
|
@@ -29817,7 +29939,7 @@ var renderNewElementScene = (renderConfig, throttle5) => {
|
|
|
29817
29939
|
};
|
|
29818
29940
|
|
|
29819
29941
|
// components/canvases/NewElementCanvas.tsx
|
|
29820
|
-
import { jsx as
|
|
29942
|
+
import { jsx as jsx144 } from "react/jsx-runtime";
|
|
29821
29943
|
var NewElementCanvas = (props) => {
|
|
29822
29944
|
const canvasRef = useRef38(null);
|
|
29823
29945
|
useEffect42(() => {
|
|
@@ -29838,7 +29960,7 @@ var NewElementCanvas = (props) => {
|
|
|
29838
29960
|
isRenderThrottlingEnabled()
|
|
29839
29961
|
);
|
|
29840
29962
|
});
|
|
29841
|
-
return /* @__PURE__ */
|
|
29963
|
+
return /* @__PURE__ */ jsx144(
|
|
29842
29964
|
"canvas",
|
|
29843
29965
|
{
|
|
29844
29966
|
className: "excalidraw__canvas",
|
|
@@ -29856,7 +29978,7 @@ var NewElementCanvas_default = NewElementCanvas;
|
|
|
29856
29978
|
|
|
29857
29979
|
// components/Toast.tsx
|
|
29858
29980
|
import { useCallback as useCallback14, useEffect as useEffect43, useRef as useRef39 } from "react";
|
|
29859
|
-
import { jsx as
|
|
29981
|
+
import { jsx as jsx145, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
29860
29982
|
var DEFAULT_TOAST_TIMEOUT = 5e3;
|
|
29861
29983
|
var Toast = ({
|
|
29862
29984
|
message,
|
|
@@ -29883,7 +30005,7 @@ var Toast = ({
|
|
|
29883
30005
|
}, [scheduleTimeout, message, duration, shouldAutoClose]);
|
|
29884
30006
|
const onMouseEnter = shouldAutoClose ? () => clearTimeout(timerRef?.current) : void 0;
|
|
29885
30007
|
const onMouseLeave = shouldAutoClose ? scheduleTimeout : void 0;
|
|
29886
|
-
return /* @__PURE__ */
|
|
30008
|
+
return /* @__PURE__ */ jsxs76(
|
|
29887
30009
|
"div",
|
|
29888
30010
|
{
|
|
29889
30011
|
className: "Toast",
|
|
@@ -29891,8 +30013,8 @@ var Toast = ({
|
|
|
29891
30013
|
onMouseLeave,
|
|
29892
30014
|
style,
|
|
29893
30015
|
children: [
|
|
29894
|
-
/* @__PURE__ */
|
|
29895
|
-
closable && /* @__PURE__ */
|
|
30016
|
+
/* @__PURE__ */ jsx145("p", { className: "Toast__message", children: message }),
|
|
30017
|
+
closable && /* @__PURE__ */ jsx145(
|
|
29896
30018
|
ToolButton,
|
|
29897
30019
|
{
|
|
29898
30020
|
icon: CloseIcon,
|
|
@@ -29907,6 +30029,46 @@ var Toast = ({
|
|
|
29907
30029
|
);
|
|
29908
30030
|
};
|
|
29909
30031
|
|
|
30032
|
+
// components/BraveMeasureTextError.tsx
|
|
30033
|
+
import { jsx as jsx146, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
30034
|
+
var BraveMeasureTextError = () => {
|
|
30035
|
+
return /* @__PURE__ */ jsxs77("div", { "data-testid": "brave-measure-text-error", children: [
|
|
30036
|
+
/* @__PURE__ */ jsx146("p", { children: /* @__PURE__ */ jsx146(
|
|
30037
|
+
Trans_default,
|
|
30038
|
+
{
|
|
30039
|
+
i18nKey: "errors.brave_measure_text_error.line1",
|
|
30040
|
+
bold: (el) => /* @__PURE__ */ jsx146("span", { style: { fontWeight: 600 }, children: el })
|
|
30041
|
+
}
|
|
30042
|
+
) }),
|
|
30043
|
+
/* @__PURE__ */ jsx146("p", { children: /* @__PURE__ */ jsx146(
|
|
30044
|
+
Trans_default,
|
|
30045
|
+
{
|
|
30046
|
+
i18nKey: "errors.brave_measure_text_error.line2",
|
|
30047
|
+
bold: (el) => /* @__PURE__ */ jsx146("span", { style: { fontWeight: 600 }, children: el })
|
|
30048
|
+
}
|
|
30049
|
+
) }),
|
|
30050
|
+
/* @__PURE__ */ jsx146("p", { children: /* @__PURE__ */ jsx146(
|
|
30051
|
+
Trans_default,
|
|
30052
|
+
{
|
|
30053
|
+
i18nKey: "errors.brave_measure_text_error.line3",
|
|
30054
|
+
link: (el) => /* @__PURE__ */ jsx146("a", { href: "http://docs.excalidraw.com/docs/@excalidraw/excalidraw/faq#turning-off-aggresive-block-fingerprinting-in-brave-browser", children: el })
|
|
30055
|
+
}
|
|
30056
|
+
) }),
|
|
30057
|
+
/* @__PURE__ */ jsx146("p", { children: /* @__PURE__ */ jsx146(
|
|
30058
|
+
Trans_default,
|
|
30059
|
+
{
|
|
30060
|
+
i18nKey: "errors.brave_measure_text_error.line4",
|
|
30061
|
+
issueLink: (el) => /* @__PURE__ */ jsx146("a", { href: "https://github.com/excalidraw/excalidraw/issues/new", children: el }),
|
|
30062
|
+
discordLink: (el) => /* @__PURE__ */ jsxs77("a", { href: "https://discord.gg/UexuTaE", children: [
|
|
30063
|
+
el,
|
|
30064
|
+
"."
|
|
30065
|
+
] })
|
|
30066
|
+
}
|
|
30067
|
+
) })
|
|
30068
|
+
] });
|
|
30069
|
+
};
|
|
30070
|
+
var BraveMeasureTextError_default = BraveMeasureTextError;
|
|
30071
|
+
|
|
29910
30072
|
// components/App.tsx
|
|
29911
30073
|
import { Fragment as Fragment24, jsx as jsx147, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
29912
30074
|
var AppContext = React42.createContext(null);
|
|
@@ -30017,19 +30179,7 @@ var App = class _App extends React42.Component {
|
|
|
30017
30179
|
__publicField(this, "lastViewportPosition", { x: 0, y: 0 });
|
|
30018
30180
|
__publicField(this, "animationFrameHandler", new AnimationFrameHandler());
|
|
30019
30181
|
__publicField(this, "laserTrails", new LaserTrails(this.animationFrameHandler, this));
|
|
30020
|
-
__publicField(this, "eraserTrail", new
|
|
30021
|
-
streamline: 0.2,
|
|
30022
|
-
size: 5,
|
|
30023
|
-
keepHead: true,
|
|
30024
|
-
sizeMapping: (c) => {
|
|
30025
|
-
const DECAY_TIME = 200;
|
|
30026
|
-
const DECAY_LENGTH = 10;
|
|
30027
|
-
const t2 = Math.max(0, 1 - (performance.now() - c.pressure) / DECAY_TIME);
|
|
30028
|
-
const l = (DECAY_LENGTH - Math.min(DECAY_LENGTH, c.totalLength - c.currentIndex)) / DECAY_LENGTH;
|
|
30029
|
-
return Math.min(easeOut(l), easeOut(t2));
|
|
30030
|
-
},
|
|
30031
|
-
fill: () => this.state.theme === THEME.LIGHT ? "rgba(0, 0, 0, 0.2)" : "rgba(255, 255, 255, 0.2)"
|
|
30032
|
-
}));
|
|
30182
|
+
__publicField(this, "eraserTrail", new EraserTrail(this.animationFrameHandler, this));
|
|
30033
30183
|
__publicField(this, "lassoTrail", new LassoTrail(this.animationFrameHandler, this));
|
|
30034
30184
|
__publicField(this, "onChangeEmitter", new Emitter());
|
|
30035
30185
|
__publicField(this, "onPointerDownEmitter", new Emitter());
|
|
@@ -31939,7 +32089,7 @@ var App = class _App extends React42.Component {
|
|
|
31939
32089
|
x: sceneX,
|
|
31940
32090
|
y: sceneY
|
|
31941
32091
|
});
|
|
31942
|
-
const element = existingTextElement
|
|
32092
|
+
const element = existingTextElement || newTextElement({
|
|
31943
32093
|
x: parentCenterPosition ? parentCenterPosition.elementCenterX : sceneX,
|
|
31944
32094
|
y: parentCenterPosition ? parentCenterPosition.elementCenterY : sceneY,
|
|
31945
32095
|
strokeColor: this.state.currentItemStrokeColor,
|
|
@@ -31957,7 +32107,7 @@ var App = class _App extends React42.Component {
|
|
|
31957
32107
|
containerId: shouldBindToContainer ? container?.id : void 0,
|
|
31958
32108
|
groupIds: container?.groupIds ?? [],
|
|
31959
32109
|
lineHeight,
|
|
31960
|
-
angle: container
|
|
32110
|
+
angle: container ? isArrowElement(container) ? 0 : container.angle : 0,
|
|
31961
32111
|
frameId: topLayerFrame ? topLayerFrame.id : null
|
|
31962
32112
|
});
|
|
31963
32113
|
if (!existingTextElement && shouldBindToContainer && container) {
|
|
@@ -32575,80 +32725,14 @@ var App = class _App extends React42.Component {
|
|
|
32575
32725
|
}));
|
|
32576
32726
|
}
|
|
32577
32727
|
});
|
|
32578
|
-
__publicField(this, "handleEraser", (event,
|
|
32579
|
-
this.eraserTrail.addPointToPath(
|
|
32580
|
-
|
|
32581
|
-
|
|
32582
|
-
|
|
32583
|
-
const processElements = (elements) => {
|
|
32584
|
-
for (const element of elements) {
|
|
32585
|
-
if (element.locked) {
|
|
32586
|
-
return;
|
|
32587
|
-
}
|
|
32588
|
-
if (event.altKey) {
|
|
32589
|
-
if (this.elementsPendingErasure.delete(element.id)) {
|
|
32590
|
-
didChange = true;
|
|
32591
|
-
}
|
|
32592
|
-
} else if (!this.elementsPendingErasure.has(element.id)) {
|
|
32593
|
-
didChange = true;
|
|
32594
|
-
this.elementsPendingErasure.add(element.id);
|
|
32595
|
-
}
|
|
32596
|
-
if (didChange && element.groupIds?.length) {
|
|
32597
|
-
const shallowestGroupId = element.groupIds.at(-1);
|
|
32598
|
-
if (!processedGroups.has(shallowestGroupId)) {
|
|
32599
|
-
processedGroups.add(shallowestGroupId);
|
|
32600
|
-
const elems = getElementsInGroup(
|
|
32601
|
-
nonDeletedElements,
|
|
32602
|
-
shallowestGroupId
|
|
32603
|
-
);
|
|
32604
|
-
for (const elem of elems) {
|
|
32605
|
-
if (event.altKey) {
|
|
32606
|
-
this.elementsPendingErasure.delete(elem.id);
|
|
32607
|
-
} else {
|
|
32608
|
-
this.elementsPendingErasure.add(elem.id);
|
|
32609
|
-
}
|
|
32610
|
-
}
|
|
32611
|
-
}
|
|
32612
|
-
}
|
|
32613
|
-
}
|
|
32614
|
-
};
|
|
32615
|
-
const distance2 = pointDistance(
|
|
32616
|
-
pointFrom(pointerDownState.lastCoords.x, pointerDownState.lastCoords.y),
|
|
32617
|
-
pointFrom(scenePointer.x, scenePointer.y)
|
|
32728
|
+
__publicField(this, "handleEraser", (event, scenePointer) => {
|
|
32729
|
+
const elementsToErase = this.eraserTrail.addPointToPath(
|
|
32730
|
+
scenePointer.x,
|
|
32731
|
+
scenePointer.y,
|
|
32732
|
+
event.altKey
|
|
32618
32733
|
);
|
|
32619
|
-
|
|
32620
|
-
|
|
32621
|
-
let samplingInterval = 0;
|
|
32622
|
-
while (samplingInterval <= distance2) {
|
|
32623
|
-
const hitElements = this.getElementsAtPosition(p.x, p.y);
|
|
32624
|
-
processElements(hitElements);
|
|
32625
|
-
if (samplingInterval === distance2) {
|
|
32626
|
-
break;
|
|
32627
|
-
}
|
|
32628
|
-
samplingInterval = Math.min(samplingInterval + threshold, distance2);
|
|
32629
|
-
const distanceRatio = samplingInterval / distance2;
|
|
32630
|
-
const nextX = (1 - distanceRatio) * p.x + distanceRatio * scenePointer.x;
|
|
32631
|
-
const nextY = (1 - distanceRatio) * p.y + distanceRatio * scenePointer.y;
|
|
32632
|
-
p.x = nextX;
|
|
32633
|
-
p.y = nextY;
|
|
32634
|
-
}
|
|
32635
|
-
pointerDownState.lastCoords.x = scenePointer.x;
|
|
32636
|
-
pointerDownState.lastCoords.y = scenePointer.y;
|
|
32637
|
-
if (didChange) {
|
|
32638
|
-
for (const element of this.scene.getNonDeletedElements()) {
|
|
32639
|
-
if (isBoundToContainer(element) && (this.elementsPendingErasure.has(element.id) || this.elementsPendingErasure.has(element.containerId))) {
|
|
32640
|
-
if (event.altKey) {
|
|
32641
|
-
this.elementsPendingErasure.delete(element.id);
|
|
32642
|
-
this.elementsPendingErasure.delete(element.containerId);
|
|
32643
|
-
} else {
|
|
32644
|
-
this.elementsPendingErasure.add(element.id);
|
|
32645
|
-
this.elementsPendingErasure.add(element.containerId);
|
|
32646
|
-
}
|
|
32647
|
-
}
|
|
32648
|
-
}
|
|
32649
|
-
this.elementsPendingErasure = new Set(this.elementsPendingErasure);
|
|
32650
|
-
this.triggerRender();
|
|
32651
|
-
}
|
|
32734
|
+
this.elementsPendingErasure = new Set(elementsToErase);
|
|
32735
|
+
this.triggerRender();
|
|
32652
32736
|
});
|
|
32653
32737
|
// set touch moving for mobile context menu
|
|
32654
32738
|
__publicField(this, "handleTouchMove", (event) => {
|
|
@@ -35202,8 +35286,8 @@ var App = class _App extends React42.Component {
|
|
|
35202
35286
|
{
|
|
35203
35287
|
trails: [
|
|
35204
35288
|
this.laserTrails,
|
|
35205
|
-
this.
|
|
35206
|
-
this.
|
|
35289
|
+
this.lassoTrail,
|
|
35290
|
+
this.eraserTrail
|
|
35207
35291
|
]
|
|
35208
35292
|
}
|
|
35209
35293
|
),
|
|
@@ -36534,7 +36618,7 @@ var App = class _App extends React42.Component {
|
|
|
36534
36618
|
return;
|
|
36535
36619
|
}
|
|
36536
36620
|
if (isEraserActive(this.state)) {
|
|
36537
|
-
this.handleEraser(event,
|
|
36621
|
+
this.handleEraser(event, pointerCoords);
|
|
36538
36622
|
return;
|
|
36539
36623
|
}
|
|
36540
36624
|
if (this.state.activeTool.type === "laser") {
|
|
@@ -38250,7 +38334,9 @@ var ExcalidrawBase = (props) => {
|
|
|
38250
38334
|
validateEmbeddable,
|
|
38251
38335
|
renderEmbeddable,
|
|
38252
38336
|
showDeprecatedFonts,
|
|
38253
|
-
wheelZoomsOnDefault
|
|
38337
|
+
wheelZoomsOnDefault,
|
|
38338
|
+
strokeColorTopPicks,
|
|
38339
|
+
backgroundColorTopPicks
|
|
38254
38340
|
} = props;
|
|
38255
38341
|
const canvasActions = props.UIOptions?.canvasActions;
|
|
38256
38342
|
const UIOptions = {
|
|
@@ -38321,6 +38407,8 @@ var ExcalidrawBase = (props) => {
|
|
|
38321
38407
|
aiEnabled: false,
|
|
38322
38408
|
showDeprecatedFonts,
|
|
38323
38409
|
wheelZoomsOnDefault,
|
|
38410
|
+
strokeColorTopPicks,
|
|
38411
|
+
backgroundColorTopPicks,
|
|
38324
38412
|
children
|
|
38325
38413
|
}
|
|
38326
38414
|
) }) });
|