@haoxin-web/excalidraw 1.0.0 → 1.0.2
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/README.md +20 -20
- package/dist/dev/{chunk-PTYT4VPM.js → chunk-3RD5RWFE.js} +86 -86
- package/dist/dev/{chunk-VC7V2GEZ.js → chunk-R3GBEHWA.js} +2 -2
- package/dist/dev/{chunk-VC7V2GEZ.js.map → chunk-R3GBEHWA.js.map} +1 -1
- package/dist/dev/data/{image-CVHJEERS.js → image-6VUVQVTV.js} +3 -3
- package/dist/dev/index.css.map +2 -2
- package/dist/dev/index.js +710 -568
- package/dist/dev/index.js.map +3 -3
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/chunk-2BSXP2T3.js +6 -0
- package/dist/prod/{chunk-ZHX5UPTB.js → chunk-T5E2FHQC.js} +1 -1
- package/dist/prod/data/image-C6AOHNJE.js +1 -0
- package/dist/prod/index.js +26 -26
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +21 -14
- package/dist/types/excalidraw/components/Actions.d.ts +3 -2
- package/dist/types/excalidraw/components/App.d.ts +1 -0
- package/dist/types/excalidraw/components/HandButton.d.ts +2 -1
- package/dist/types/excalidraw/components/LayerUI.d.ts +4 -1
- package/dist/types/excalidraw/components/LeftMainToolbar.d.ts +1 -0
- package/dist/types/excalidraw/components/LeftToolFlyouts.d.ts +1 -0
- package/dist/types/excalidraw/components/MobileMenu.d.ts +2 -1
- package/dist/types/excalidraw/components/footer/Footer.d.ts +2 -1
- package/dist/types/excalidraw/types.d.ts +4 -0
- package/package.json +4 -4
- package/dist/prod/chunk-5BVJZ5IS.js +0 -6
- package/dist/prod/data/image-7GV76HIR.js +0 -1
- /package/dist/dev/{chunk-PTYT4VPM.js.map → chunk-3RD5RWFE.js.map} +0 -0
- /package/dist/dev/data/{image-CVHJEERS.js.map → image-6VUVQVTV.js.map} +0 -0
package/dist/dev/index.js
CHANGED
|
@@ -69,10 +69,10 @@ import {
|
|
|
69
69
|
serializeLibraryAsJSON,
|
|
70
70
|
strokeEllipseWithRotation,
|
|
71
71
|
strokeRectWithRotation
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-3RD5RWFE.js";
|
|
73
73
|
import {
|
|
74
74
|
define_import_meta_env_default
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-R3GBEHWA.js";
|
|
76
76
|
import {
|
|
77
77
|
en_default
|
|
78
78
|
} from "./chunk-ZSSURRA2.js";
|
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
|
|
88
88
|
// index.tsx
|
|
89
89
|
import React48, { useEffect as useEffect49 } from "react";
|
|
90
|
-
import { DEFAULT_UI_OPTIONS, isShallowEqual as isShallowEqual9 } from "haoxin-excalidraw-
|
|
90
|
+
import { DEFAULT_UI_OPTIONS, isShallowEqual as isShallowEqual9 } from "@haoxin-web/excalidraw-common";
|
|
91
91
|
|
|
92
92
|
// components/App.tsx
|
|
93
93
|
import clsx57 from "clsx";
|
|
@@ -107,7 +107,7 @@ import {
|
|
|
107
107
|
vectorSubtract as vectorSubtract2,
|
|
108
108
|
vectorDot,
|
|
109
109
|
vectorNormalize as vectorNormalize4
|
|
110
|
-
} from "haoxin-excalidraw-
|
|
110
|
+
} from "@haoxin-web/excalidraw-math";
|
|
111
111
|
import {
|
|
112
112
|
COLOR_PALETTE as COLOR_PALETTE6,
|
|
113
113
|
CODES as CODES13,
|
|
@@ -192,7 +192,7 @@ import {
|
|
|
192
192
|
isMobile,
|
|
193
193
|
MINIMUM_ARROW_SIZE,
|
|
194
194
|
DOUBLE_TAP_POSITION_THRESHOLD
|
|
195
|
-
} from "haoxin-excalidraw-
|
|
195
|
+
} from "@haoxin-web/excalidraw-common";
|
|
196
196
|
import {
|
|
197
197
|
getObservedAppState,
|
|
198
198
|
getCommonBounds as getCommonBounds12,
|
|
@@ -324,29 +324,29 @@ import {
|
|
|
324
324
|
isSimpleArrow,
|
|
325
325
|
StoreDelta as StoreDelta2,
|
|
326
326
|
positionElementsOnGrid
|
|
327
|
-
} from "haoxin-excalidraw-
|
|
327
|
+
} from "@haoxin-web/excalidraw-element";
|
|
328
328
|
|
|
329
329
|
// actions/actionDeleteSelected.tsx
|
|
330
|
-
import { KEYS, updateActiveTool } from "haoxin-excalidraw-
|
|
331
|
-
import { getNonDeletedElements } from "haoxin-excalidraw-
|
|
332
|
-
import { fixBindingsAfterDeletion } from "haoxin-excalidraw-
|
|
333
|
-
import { LinearElementEditor } from "haoxin-excalidraw-
|
|
334
|
-
import { newElementWith } from "haoxin-excalidraw-
|
|
335
|
-
import { getContainerElement } from "haoxin-excalidraw-
|
|
330
|
+
import { KEYS, updateActiveTool } from "@haoxin-web/excalidraw-common";
|
|
331
|
+
import { getNonDeletedElements } from "@haoxin-web/excalidraw-element";
|
|
332
|
+
import { fixBindingsAfterDeletion } from "@haoxin-web/excalidraw-element";
|
|
333
|
+
import { LinearElementEditor } from "@haoxin-web/excalidraw-element";
|
|
334
|
+
import { newElementWith } from "@haoxin-web/excalidraw-element";
|
|
335
|
+
import { getContainerElement } from "@haoxin-web/excalidraw-element";
|
|
336
336
|
import {
|
|
337
337
|
isBoundToContainer,
|
|
338
338
|
isElbowArrow,
|
|
339
339
|
isFrameLikeElement
|
|
340
|
-
} from "haoxin-excalidraw-
|
|
341
|
-
import { getFrameChildren } from "haoxin-excalidraw-
|
|
340
|
+
} from "@haoxin-web/excalidraw-element";
|
|
341
|
+
import { getFrameChildren } from "@haoxin-web/excalidraw-element";
|
|
342
342
|
import {
|
|
343
343
|
getElementsInGroup,
|
|
344
344
|
selectGroupsForSelectedElements
|
|
345
|
-
} from "haoxin-excalidraw-
|
|
346
|
-
import { CaptureUpdateAction } from "haoxin-excalidraw-
|
|
345
|
+
} from "@haoxin-web/excalidraw-element";
|
|
346
|
+
import { CaptureUpdateAction } from "@haoxin-web/excalidraw-element";
|
|
347
347
|
|
|
348
348
|
// i18n.ts
|
|
349
|
-
import { isDevEnv } from "haoxin-excalidraw-
|
|
349
|
+
import { isDevEnv } from "@haoxin-web/excalidraw-common";
|
|
350
350
|
|
|
351
351
|
// editor-jotai.ts
|
|
352
352
|
import {
|
|
@@ -547,7 +547,7 @@ var useI18n = () => {
|
|
|
547
547
|
import clsx from "clsx";
|
|
548
548
|
import oc from "open-color";
|
|
549
549
|
import React from "react";
|
|
550
|
-
import { THEME } from "haoxin-excalidraw-
|
|
550
|
+
import { THEME } from "@haoxin-web/excalidraw-common";
|
|
551
551
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
552
552
|
var iconFillColor = (theme) => "var(--icon-fill-color)";
|
|
553
553
|
var handlerColor = (theme) => theme === THEME.LIGHT ? oc.white : "#1e1e1e";
|
|
@@ -2846,7 +2846,7 @@ var elementLinkIcon = createIcon(
|
|
|
2846
2846
|
// components/ToolButton.tsx
|
|
2847
2847
|
import clsx2 from "clsx";
|
|
2848
2848
|
import React3, { useEffect, useRef, useState } from "react";
|
|
2849
|
-
import { isPromiseLike } from "haoxin-excalidraw-
|
|
2849
|
+
import { isPromiseLike } from "@haoxin-web/excalidraw-common";
|
|
2850
2850
|
|
|
2851
2851
|
// components/Spinner.tsx
|
|
2852
2852
|
import React2 from "react";
|
|
@@ -3262,14 +3262,14 @@ var actionDeleteSelected = register({
|
|
|
3262
3262
|
});
|
|
3263
3263
|
|
|
3264
3264
|
// actions/actionZindex.tsx
|
|
3265
|
-
import { KEYS as KEYS2, CODES, getShortcutKey, isDarwin } from "haoxin-excalidraw-
|
|
3265
|
+
import { KEYS as KEYS2, CODES, getShortcutKey, isDarwin } from "@haoxin-web/excalidraw-common";
|
|
3266
3266
|
import {
|
|
3267
3267
|
moveOneLeft,
|
|
3268
3268
|
moveOneRight,
|
|
3269
3269
|
moveAllLeft,
|
|
3270
3270
|
moveAllRight
|
|
3271
|
-
} from "haoxin-excalidraw-
|
|
3272
|
-
import { CaptureUpdateAction as CaptureUpdateAction2 } from "haoxin-excalidraw-
|
|
3271
|
+
} from "@haoxin-web/excalidraw-element";
|
|
3272
|
+
import { CaptureUpdateAction as CaptureUpdateAction2 } from "@haoxin-web/excalidraw-element";
|
|
3273
3273
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
3274
3274
|
var actionSendBackward = register({
|
|
3275
3275
|
name: "sendBackward",
|
|
@@ -3375,12 +3375,12 @@ var actionBringToFront = register({
|
|
|
3375
3375
|
});
|
|
3376
3376
|
|
|
3377
3377
|
// actions/actionSelectAll.ts
|
|
3378
|
-
import { getNonDeletedElements as getNonDeletedElements2 } from "haoxin-excalidraw-
|
|
3379
|
-
import { LinearElementEditor as LinearElementEditor2 } from "haoxin-excalidraw-
|
|
3380
|
-
import { isLinearElement, isTextElement } from "haoxin-excalidraw-
|
|
3381
|
-
import { arrayToMap, KEYS as KEYS3 } from "haoxin-excalidraw-
|
|
3382
|
-
import { selectGroupsForSelectedElements as selectGroupsForSelectedElements2 } from "haoxin-excalidraw-
|
|
3383
|
-
import { CaptureUpdateAction as CaptureUpdateAction3 } from "haoxin-excalidraw-
|
|
3378
|
+
import { getNonDeletedElements as getNonDeletedElements2 } from "@haoxin-web/excalidraw-element";
|
|
3379
|
+
import { LinearElementEditor as LinearElementEditor2 } from "@haoxin-web/excalidraw-element";
|
|
3380
|
+
import { isLinearElement, isTextElement } from "@haoxin-web/excalidraw-element";
|
|
3381
|
+
import { arrayToMap, KEYS as KEYS3 } from "@haoxin-web/excalidraw-common";
|
|
3382
|
+
import { selectGroupsForSelectedElements as selectGroupsForSelectedElements2 } from "@haoxin-web/excalidraw-element";
|
|
3383
|
+
import { CaptureUpdateAction as CaptureUpdateAction3 } from "@haoxin-web/excalidraw-element";
|
|
3384
3384
|
var actionSelectAll = register({
|
|
3385
3385
|
name: "selectAll",
|
|
3386
3386
|
label: "labels.selectAll",
|
|
@@ -3426,16 +3426,16 @@ import {
|
|
|
3426
3426
|
KEYS as KEYS4,
|
|
3427
3427
|
arrayToMap as arrayToMap2,
|
|
3428
3428
|
getShortcutKey as getShortcutKey2
|
|
3429
|
-
} from "haoxin-excalidraw-
|
|
3430
|
-
import { getNonDeletedElements as getNonDeletedElements3 } from "haoxin-excalidraw-
|
|
3431
|
-
import { LinearElementEditor as LinearElementEditor3 } from "haoxin-excalidraw-
|
|
3429
|
+
} from "@haoxin-web/excalidraw-common";
|
|
3430
|
+
import { getNonDeletedElements as getNonDeletedElements3 } from "@haoxin-web/excalidraw-element";
|
|
3431
|
+
import { LinearElementEditor as LinearElementEditor3 } from "@haoxin-web/excalidraw-element";
|
|
3432
3432
|
import {
|
|
3433
3433
|
getSelectedElements as getSelectedElements2,
|
|
3434
3434
|
getSelectionStateForElements
|
|
3435
|
-
} from "haoxin-excalidraw-
|
|
3436
|
-
import { syncMovedIndices } from "haoxin-excalidraw-
|
|
3437
|
-
import { duplicateElements } from "haoxin-excalidraw-
|
|
3438
|
-
import { CaptureUpdateAction as CaptureUpdateAction4 } from "haoxin-excalidraw-
|
|
3435
|
+
} from "@haoxin-web/excalidraw-element";
|
|
3436
|
+
import { syncMovedIndices } from "@haoxin-web/excalidraw-element";
|
|
3437
|
+
import { duplicateElements } from "@haoxin-web/excalidraw-element";
|
|
3438
|
+
import { CaptureUpdateAction as CaptureUpdateAction4 } from "@haoxin-web/excalidraw-element";
|
|
3439
3439
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
3440
3440
|
var actionDuplicateSelection = register({
|
|
3441
3441
|
name: "duplicateSelection",
|
|
@@ -3523,7 +3523,7 @@ var actionDuplicateSelection = register({
|
|
|
3523
3523
|
});
|
|
3524
3524
|
|
|
3525
3525
|
// actions/actionProperties.tsx
|
|
3526
|
-
import { pointFrom } from "haoxin-excalidraw-
|
|
3526
|
+
import { pointFrom } from "@haoxin-web/excalidraw-math";
|
|
3527
3527
|
import { useEffect as useEffect13, useMemo as useMemo4, useRef as useRef11, useState as useState6 } from "react";
|
|
3528
3528
|
import {
|
|
3529
3529
|
DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,
|
|
@@ -3545,19 +3545,19 @@ import {
|
|
|
3545
3545
|
getLineHeight,
|
|
3546
3546
|
isTransparent as isTransparent2,
|
|
3547
3547
|
reduceToCommonValue
|
|
3548
|
-
} from "haoxin-excalidraw-
|
|
3549
|
-
import { canBecomePolygon, getNonDeletedElements as getNonDeletedElements4 } from "haoxin-excalidraw-
|
|
3548
|
+
} from "@haoxin-web/excalidraw-common";
|
|
3549
|
+
import { canBecomePolygon, getNonDeletedElements as getNonDeletedElements4 } from "@haoxin-web/excalidraw-element";
|
|
3550
3550
|
import {
|
|
3551
3551
|
bindLinearElement,
|
|
3552
3552
|
calculateFixedPointForElbowArrowBinding,
|
|
3553
3553
|
updateBoundElements
|
|
3554
|
-
} from "haoxin-excalidraw-
|
|
3555
|
-
import { LinearElementEditor as LinearElementEditor4 } from "haoxin-excalidraw-
|
|
3556
|
-
import { newElementWith as newElementWith2 } from "haoxin-excalidraw-
|
|
3554
|
+
} from "@haoxin-web/excalidraw-element";
|
|
3555
|
+
import { LinearElementEditor as LinearElementEditor4 } from "@haoxin-web/excalidraw-element";
|
|
3556
|
+
import { newElementWith as newElementWith2 } from "@haoxin-web/excalidraw-element";
|
|
3557
3557
|
import {
|
|
3558
3558
|
getBoundTextElement,
|
|
3559
3559
|
redrawTextBoundingBox
|
|
3560
|
-
} from "haoxin-excalidraw-
|
|
3560
|
+
} from "@haoxin-web/excalidraw-element";
|
|
3561
3561
|
import {
|
|
3562
3562
|
isArrowElement,
|
|
3563
3563
|
isBoundToContainer as isBoundToContainer2,
|
|
@@ -3566,16 +3566,16 @@ import {
|
|
|
3566
3566
|
isLineElement,
|
|
3567
3567
|
isTextElement as isTextElement2,
|
|
3568
3568
|
isUsingAdaptiveRadius
|
|
3569
|
-
} from "haoxin-excalidraw-
|
|
3570
|
-
import { hasStrokeColor } from "haoxin-excalidraw-
|
|
3569
|
+
} from "@haoxin-web/excalidraw-element";
|
|
3570
|
+
import { hasStrokeColor } from "@haoxin-web/excalidraw-element";
|
|
3571
3571
|
import {
|
|
3572
3572
|
updateElbowArrowPoints,
|
|
3573
3573
|
CaptureUpdateAction as CaptureUpdateAction5,
|
|
3574
3574
|
toggleLinePolygonState
|
|
3575
|
-
} from "haoxin-excalidraw-
|
|
3575
|
+
} from "@haoxin-web/excalidraw-element";
|
|
3576
3576
|
|
|
3577
3577
|
// analytics.ts
|
|
3578
|
-
import { isDevEnv as isDevEnv2 } from "haoxin-excalidraw-
|
|
3578
|
+
import { isDevEnv as isDevEnv2 } from "@haoxin-web/excalidraw-common";
|
|
3579
3579
|
var ALLOWED_CATEGORIES_TO_TRACK = /* @__PURE__ */ new Set(["command_palette", "export"]);
|
|
3580
3580
|
var trackEvent = (category, action, label, value) => {
|
|
3581
3581
|
try {
|
|
@@ -3674,7 +3674,7 @@ import {
|
|
|
3674
3674
|
COLOR_OUTLINE_CONTRAST_THRESHOLD as COLOR_OUTLINE_CONTRAST_THRESHOLD2,
|
|
3675
3675
|
COLOR_PALETTE as COLOR_PALETTE2,
|
|
3676
3676
|
isTransparent
|
|
3677
|
-
} from "haoxin-excalidraw-
|
|
3677
|
+
} from "@haoxin-web/excalidraw-common";
|
|
3678
3678
|
|
|
3679
3679
|
// components/ButtonSeparator.tsx
|
|
3680
3680
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
@@ -3693,7 +3693,7 @@ var ButtonSeparator = () => /* @__PURE__ */ jsx9(
|
|
|
3693
3693
|
// components/EyeDropper.tsx
|
|
3694
3694
|
import { useEffect as useEffect3, useRef as useRef3 } from "react";
|
|
3695
3695
|
import { createPortal } from "react-dom";
|
|
3696
|
-
import { EVENT as EVENT2, KEYS as KEYS5, rgbToHex } from "haoxin-excalidraw-
|
|
3696
|
+
import { EVENT as EVENT2, KEYS as KEYS5, rgbToHex } from "@haoxin-web/excalidraw-common";
|
|
3697
3697
|
|
|
3698
3698
|
// context/ui-appState.ts
|
|
3699
3699
|
import React4 from "react";
|
|
@@ -3702,7 +3702,7 @@ var useUIAppState = () => React4.useContext(UIAppStateContext);
|
|
|
3702
3702
|
|
|
3703
3703
|
// hooks/useCreatePortalContainer.ts
|
|
3704
3704
|
import { useState as useState2, useLayoutEffect } from "react";
|
|
3705
|
-
import { THEME as THEME2 } from "haoxin-excalidraw-
|
|
3705
|
+
import { THEME as THEME2 } from "@haoxin-web/excalidraw-common";
|
|
3706
3706
|
var useCreatePortalContainer = (opts) => {
|
|
3707
3707
|
const [div, setDiv] = useState2(null);
|
|
3708
3708
|
const device = useDevice();
|
|
@@ -3733,7 +3733,7 @@ var useCreatePortalContainer = (opts) => {
|
|
|
3733
3733
|
|
|
3734
3734
|
// hooks/useOutsideClick.ts
|
|
3735
3735
|
import { useEffect as useEffect2 } from "react";
|
|
3736
|
-
import { EVENT } from "haoxin-excalidraw-
|
|
3736
|
+
import { EVENT } from "@haoxin-web/excalidraw-common";
|
|
3737
3737
|
function useOutsideClick(ref, callback, isInside) {
|
|
3738
3738
|
useEffect2(() => {
|
|
3739
3739
|
function onOutsideClick(event) {
|
|
@@ -3932,7 +3932,7 @@ var EyeDropper = ({ onCancel, onChange, onSelect, colorPickerType }) => {
|
|
|
3932
3932
|
import * as Popover from "@radix-ui/react-popover";
|
|
3933
3933
|
import clsx6 from "clsx";
|
|
3934
3934
|
import React6 from "react";
|
|
3935
|
-
import { isInteractive } from "haoxin-excalidraw-
|
|
3935
|
+
import { isInteractive } from "@haoxin-web/excalidraw-common";
|
|
3936
3936
|
|
|
3937
3937
|
// components/Island.tsx
|
|
3938
3938
|
import React5 from "react";
|
|
@@ -4012,10 +4012,10 @@ var PropertiesPopover = React6.forwardRef(
|
|
|
4012
4012
|
// components/ColorPicker/ColorInput.tsx
|
|
4013
4013
|
import clsx7 from "clsx";
|
|
4014
4014
|
import { useCallback, useEffect as useEffect4, useRef as useRef4, useState as useState3 } from "react";
|
|
4015
|
-
import { KEYS as KEYS6, getShortcutKey as getShortcutKey3 } from "haoxin-excalidraw-
|
|
4015
|
+
import { KEYS as KEYS6, getShortcutKey as getShortcutKey3 } from "@haoxin-web/excalidraw-common";
|
|
4016
4016
|
|
|
4017
4017
|
// components/ColorPicker/colorPickerUtils.ts
|
|
4018
|
-
import { MAX_CUSTOM_COLORS_USED_IN_CANVAS } from "haoxin-excalidraw-
|
|
4018
|
+
import { MAX_CUSTOM_COLORS_USED_IN_CANVAS } from "@haoxin-web/excalidraw-common";
|
|
4019
4019
|
var getColorNameAndShadeFromColor = ({
|
|
4020
4020
|
palette: palette2,
|
|
4021
4021
|
color
|
|
@@ -4215,12 +4215,12 @@ var ColorInput = ({
|
|
|
4215
4215
|
|
|
4216
4216
|
// components/ColorPicker/Picker.tsx
|
|
4217
4217
|
import React7, { useEffect as useEffect8, useImperativeHandle, useState as useState4 } from "react";
|
|
4218
|
-
import { EVENT as EVENT3 } from "haoxin-excalidraw-
|
|
4218
|
+
import { EVENT as EVENT3 } from "@haoxin-web/excalidraw-common";
|
|
4219
4219
|
import {
|
|
4220
4220
|
DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,
|
|
4221
4221
|
DEFAULT_ELEMENT_STROKE_COLOR_INDEX,
|
|
4222
4222
|
KEYS as KEYS8
|
|
4223
|
-
} from "haoxin-excalidraw-
|
|
4223
|
+
} from "@haoxin-web/excalidraw-common";
|
|
4224
4224
|
|
|
4225
4225
|
// components/ColorPicker/CustomColorList.tsx
|
|
4226
4226
|
import clsx8 from "clsx";
|
|
@@ -4453,7 +4453,7 @@ var ShadeList = ({ color, onChange, palette: palette2 }) => {
|
|
|
4453
4453
|
};
|
|
4454
4454
|
|
|
4455
4455
|
// components/ColorPicker/keyboardNavHandlers.ts
|
|
4456
|
-
import { COLORS_PER_ROW, COLOR_PALETTE, KEYS as KEYS7 } from "haoxin-excalidraw-
|
|
4456
|
+
import { COLORS_PER_ROW, COLOR_PALETTE, KEYS as KEYS7 } from "@haoxin-web/excalidraw-common";
|
|
4457
4457
|
var arrowHandler = (eventKey, currentIndex, length) => {
|
|
4458
4458
|
const rows = Math.ceil(length / COLORS_PER_ROW);
|
|
4459
4459
|
currentIndex = currentIndex ?? -1;
|
|
@@ -4770,7 +4770,7 @@ import {
|
|
|
4770
4770
|
DEFAULT_CANVAS_BACKGROUND_PICKS,
|
|
4771
4771
|
DEFAULT_ELEMENT_BACKGROUND_PICKS,
|
|
4772
4772
|
DEFAULT_ELEMENT_STROKE_PICKS
|
|
4773
|
-
} from "haoxin-excalidraw-
|
|
4773
|
+
} from "@haoxin-web/excalidraw-common";
|
|
4774
4774
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
4775
4775
|
var TopPicks = ({
|
|
4776
4776
|
onChange,
|
|
@@ -4994,7 +4994,7 @@ var ColorPicker = ({
|
|
|
4994
4994
|
// components/FontPicker/FontPicker.tsx
|
|
4995
4995
|
import * as Popover4 from "@radix-ui/react-popover";
|
|
4996
4996
|
import React12, { useCallback as useCallback3, useMemo as useMemo3 } from "react";
|
|
4997
|
-
import { FONT_FAMILY as FONT_FAMILY2 } from "haoxin-excalidraw-
|
|
4997
|
+
import { FONT_FAMILY as FONT_FAMILY2 } from "@haoxin-web/excalidraw-common";
|
|
4998
4998
|
|
|
4999
4999
|
// components/FontPicker/FontPickerList.tsx
|
|
5000
5000
|
import React11, {
|
|
@@ -5009,7 +5009,7 @@ import {
|
|
|
5009
5009
|
debounce,
|
|
5010
5010
|
FONT_FAMILY,
|
|
5011
5011
|
getFontFamilyString
|
|
5012
|
-
} from "haoxin-excalidraw-
|
|
5012
|
+
} from "@haoxin-web/excalidraw-common";
|
|
5013
5013
|
|
|
5014
5014
|
// components/QuickSearch.tsx
|
|
5015
5015
|
import clsx13 from "clsx";
|
|
@@ -5064,7 +5064,7 @@ MenuGroup.displayName = "DropdownMenuGroup";
|
|
|
5064
5064
|
|
|
5065
5065
|
// components/dropdownMenu/DropdownMenuItem.tsx
|
|
5066
5066
|
import { useEffect as useEffect9, useRef as useRef9 } from "react";
|
|
5067
|
-
import { THEME as THEME3 } from "haoxin-excalidraw-
|
|
5067
|
+
import { THEME as THEME3 } from "@haoxin-web/excalidraw-common";
|
|
5068
5068
|
|
|
5069
5069
|
// components/Ellipsify.tsx
|
|
5070
5070
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
@@ -5106,7 +5106,7 @@ var DropdownMenuItemContent_default = MenuItemContent;
|
|
|
5106
5106
|
|
|
5107
5107
|
// components/dropdownMenu/common.ts
|
|
5108
5108
|
import React9, { useContext } from "react";
|
|
5109
|
-
import { EVENT as EVENT4, composeEventHandlers } from "haoxin-excalidraw-
|
|
5109
|
+
import { EVENT as EVENT4, composeEventHandlers } from "@haoxin-web/excalidraw-common";
|
|
5110
5110
|
var DropdownMenuContentPropsContext = React9.createContext({});
|
|
5111
5111
|
var getDropdownMenuItemClassName = (className = "", selected = false, hovered = false) => {
|
|
5112
5112
|
return `dropdown-menu-item dropdown-menu-item-base ${className}
|
|
@@ -5213,7 +5213,7 @@ DropdownMenuItem.Badge = DropDownMenuItemBadge;
|
|
|
5213
5213
|
var DropdownMenuItem_default = DropdownMenuItem;
|
|
5214
5214
|
|
|
5215
5215
|
// components/FontPicker/keyboardNavHandlers.ts
|
|
5216
|
-
import { KEYS as KEYS9 } from "haoxin-excalidraw-
|
|
5216
|
+
import { KEYS as KEYS9 } from "@haoxin-web/excalidraw-common";
|
|
5217
5217
|
var fontPickerKeyHandler = ({
|
|
5218
5218
|
event,
|
|
5219
5219
|
inputRef,
|
|
@@ -5576,7 +5576,7 @@ var FontPicker = React12.memo(
|
|
|
5576
5576
|
import * as Popover5 from "@radix-ui/react-popover";
|
|
5577
5577
|
import clsx15 from "clsx";
|
|
5578
5578
|
import React13, { useEffect as useEffect11 } from "react";
|
|
5579
|
-
import { isArrowKey, KEYS as KEYS10 } from "haoxin-excalidraw-
|
|
5579
|
+
import { isArrowKey, KEYS as KEYS10 } from "@haoxin-web/excalidraw-common";
|
|
5580
5580
|
|
|
5581
5581
|
// components/InlineIcon.tsx
|
|
5582
5582
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
@@ -7235,7 +7235,7 @@ var actionChangeArrowType = register({
|
|
|
7235
7235
|
});
|
|
7236
7236
|
|
|
7237
7237
|
// actions/actionCanvas.tsx
|
|
7238
|
-
import { clamp, roundToStep } from "haoxin-excalidraw-
|
|
7238
|
+
import { clamp, roundToStep } from "@haoxin-web/excalidraw-math";
|
|
7239
7239
|
import {
|
|
7240
7240
|
DEFAULT_CANVAS_BACKGROUND_PICKS as DEFAULT_CANVAS_BACKGROUND_PICKS2,
|
|
7241
7241
|
CURSOR_TYPE as CURSOR_TYPE2,
|
|
@@ -7247,11 +7247,11 @@ import {
|
|
|
7247
7247
|
updateActiveTool as updateActiveTool2,
|
|
7248
7248
|
CODES as CODES2,
|
|
7249
7249
|
KEYS as KEYS12
|
|
7250
|
-
} from "haoxin-excalidraw-
|
|
7251
|
-
import { getNonDeletedElements as getNonDeletedElements5 } from "haoxin-excalidraw-
|
|
7252
|
-
import { newElementWith as newElementWith3 } from "haoxin-excalidraw-
|
|
7253
|
-
import { getCommonBounds } from "haoxin-excalidraw-
|
|
7254
|
-
import { CaptureUpdateAction as CaptureUpdateAction6 } from "haoxin-excalidraw-
|
|
7250
|
+
} from "@haoxin-web/excalidraw-common";
|
|
7251
|
+
import { getNonDeletedElements as getNonDeletedElements5 } from "@haoxin-web/excalidraw-element";
|
|
7252
|
+
import { newElementWith as newElementWith3 } from "@haoxin-web/excalidraw-element";
|
|
7253
|
+
import { getCommonBounds } from "@haoxin-web/excalidraw-element";
|
|
7254
|
+
import { CaptureUpdateAction as CaptureUpdateAction6 } from "@haoxin-web/excalidraw-element";
|
|
7255
7255
|
|
|
7256
7256
|
// components/Tooltip.tsx
|
|
7257
7257
|
import { useEffect as useEffect14 } from "react";
|
|
@@ -7336,7 +7336,7 @@ var Tooltip = ({
|
|
|
7336
7336
|
|
|
7337
7337
|
// cursor.ts
|
|
7338
7338
|
import OpenColor from "open-color";
|
|
7339
|
-
import { CURSOR_TYPE, MIME_TYPES, THEME as THEME4 } from "haoxin-excalidraw-
|
|
7339
|
+
import { CURSOR_TYPE, MIME_TYPES, THEME as THEME4 } from "@haoxin-web/excalidraw-common";
|
|
7340
7340
|
var laserPointerCursorSVG_tag = `<svg viewBox="0 0 24 24" stroke-width="1" width="28" height="28" xmlns="http://www.w3.org/2000/svg">`;
|
|
7341
7341
|
var laserPointerCursorBackgroundSVG = `<path d="M6.164 11.755a5.314 5.314 0 0 1-4.932-5.298 5.314 5.314 0 0 1 5.311-5.311 5.314 5.314 0 0 1 5.307 5.113l8.773 8.773a3.322 3.322 0 0 1 0 4.696l-.895.895a3.322 3.322 0 0 1-4.696 0l-8.868-8.868Z" style="fill:#fff"/>`;
|
|
7342
7342
|
var laserPointerCursorIconSVG = `<path stroke="#1b1b1f" fill="#fff" d="m7.868 11.113 7.773 7.774a2.359 2.359 0 0 0 1.667.691 2.368 2.368 0 0 0 2.357-2.358c0-.625-.248-1.225-.69-1.667L11.201 7.78 9.558 9.469l-1.69 1.643v.001Zm10.273 3.606-3.333 3.333m-3.25-6.583 2 2m-7-7 3 3M3.664 3.625l1 1M2.529 6.922l1.407-.144m5.735-2.932-1.118.866M4.285 9.823l.758-1.194m1.863-6.207-.13 1.408"/>`;
|
|
@@ -7507,6 +7507,9 @@ var actionZoomIn = register({
|
|
|
7507
7507
|
viewMode: true,
|
|
7508
7508
|
icon: ZoomInIcon,
|
|
7509
7509
|
trackEvent: { category: "canvas" },
|
|
7510
|
+
predicate: (elements, appState, appProps) => {
|
|
7511
|
+
return appProps.showZoomActions !== false;
|
|
7512
|
+
},
|
|
7510
7513
|
perform: (_elements, appState, _, app) => {
|
|
7511
7514
|
return {
|
|
7512
7515
|
appState: {
|
|
@@ -7538,7 +7541,9 @@ var actionZoomIn = register({
|
|
|
7538
7541
|
}
|
|
7539
7542
|
}
|
|
7540
7543
|
),
|
|
7541
|
-
keyTest: (event
|
|
7544
|
+
keyTest: (event, appState, elements, app) => {
|
|
7545
|
+
return app.props.showZoomActions !== false && (event.code === CODES2.EQUAL || event.code === CODES2.NUM_ADD) && (event[KEYS12.CTRL_OR_CMD] || event.shiftKey);
|
|
7546
|
+
}
|
|
7542
7547
|
});
|
|
7543
7548
|
var actionZoomOut = register({
|
|
7544
7549
|
name: "zoomOut",
|
|
@@ -7546,6 +7551,9 @@ var actionZoomOut = register({
|
|
|
7546
7551
|
icon: ZoomOutIcon,
|
|
7547
7552
|
viewMode: true,
|
|
7548
7553
|
trackEvent: { category: "canvas" },
|
|
7554
|
+
predicate: (elements, appState, appProps) => {
|
|
7555
|
+
return appProps.showZoomActions !== false;
|
|
7556
|
+
},
|
|
7549
7557
|
perform: (_elements, appState, _, app) => {
|
|
7550
7558
|
return {
|
|
7551
7559
|
appState: {
|
|
@@ -7577,7 +7585,9 @@ var actionZoomOut = register({
|
|
|
7577
7585
|
}
|
|
7578
7586
|
}
|
|
7579
7587
|
),
|
|
7580
|
-
keyTest: (event
|
|
7588
|
+
keyTest: (event, appState, elements, app) => {
|
|
7589
|
+
return app.props.showZoomActions !== false && (event.code === CODES2.MINUS || event.code === CODES2.NUM_SUBTRACT) && (event[KEYS12.CTRL_OR_CMD] || event.shiftKey);
|
|
7590
|
+
}
|
|
7581
7591
|
});
|
|
7582
7592
|
var actionResetZoom = register({
|
|
7583
7593
|
name: "resetZoom",
|
|
@@ -7585,6 +7595,9 @@ var actionResetZoom = register({
|
|
|
7585
7595
|
icon: ZoomResetIcon,
|
|
7586
7596
|
viewMode: true,
|
|
7587
7597
|
trackEvent: { category: "canvas" },
|
|
7598
|
+
predicate: (elements, appState, appProps) => {
|
|
7599
|
+
return appProps.showZoomActions !== false;
|
|
7600
|
+
},
|
|
7588
7601
|
perform: (_elements, appState, _, app) => {
|
|
7589
7602
|
return {
|
|
7590
7603
|
appState: {
|
|
@@ -7618,7 +7631,9 @@ var actionResetZoom = register({
|
|
|
7618
7631
|
]
|
|
7619
7632
|
}
|
|
7620
7633
|
) }),
|
|
7621
|
-
keyTest: (event
|
|
7634
|
+
keyTest: (event, appState, elements, app) => {
|
|
7635
|
+
return app.props.showZoomActions !== false && (event.code === CODES2.ZERO || event.code === CODES2.NUM_ZERO) && (event[KEYS12.CTRL_OR_CMD] || event.shiftKey);
|
|
7636
|
+
}
|
|
7622
7637
|
});
|
|
7623
7638
|
var zoomValueToFitBoundsOnViewport = (bounds, viewportDimensions, viewportZoomFactor = 1) => {
|
|
7624
7639
|
const [x1, y1, x2, y2] = bounds;
|
|
@@ -7714,6 +7729,9 @@ var actionZoomToFitSelectionInViewport = register({
|
|
|
7714
7729
|
label: "labels.zoomToFitViewport",
|
|
7715
7730
|
icon: zoomAreaIcon,
|
|
7716
7731
|
trackEvent: { category: "canvas" },
|
|
7732
|
+
predicate: (elements, appState, appProps) => {
|
|
7733
|
+
return appProps.showZoomActions !== false;
|
|
7734
|
+
},
|
|
7717
7735
|
perform: (elements, appState, _, app) => {
|
|
7718
7736
|
const selectedElements = app.scene.getSelectedElements(appState);
|
|
7719
7737
|
return zoomToFit({
|
|
@@ -7728,13 +7746,18 @@ var actionZoomToFitSelectionInViewport = register({
|
|
|
7728
7746
|
},
|
|
7729
7747
|
// NOTE shift-2 should have been assigned actionZoomToFitSelection.
|
|
7730
7748
|
// TBD on how proceed
|
|
7731
|
-
keyTest: (event
|
|
7749
|
+
keyTest: (event, appState, elements, app) => {
|
|
7750
|
+
return app.props.showZoomActions !== false && event.code === CODES2.TWO && event.shiftKey && !event.altKey && !event[KEYS12.CTRL_OR_CMD];
|
|
7751
|
+
}
|
|
7732
7752
|
});
|
|
7733
7753
|
var actionZoomToFitSelection = register({
|
|
7734
7754
|
name: "zoomToFitSelection",
|
|
7735
7755
|
label: "helpDialog.zoomToSelection",
|
|
7736
7756
|
icon: zoomAreaIcon,
|
|
7737
7757
|
trackEvent: { category: "canvas" },
|
|
7758
|
+
predicate: (elements, appState, appProps) => {
|
|
7759
|
+
return appProps.showZoomActions !== false;
|
|
7760
|
+
},
|
|
7738
7761
|
perform: (elements, appState, _, app) => {
|
|
7739
7762
|
const selectedElements = app.scene.getSelectedElements(appState);
|
|
7740
7763
|
return zoomToFit({
|
|
@@ -7748,7 +7771,9 @@ var actionZoomToFitSelection = register({
|
|
|
7748
7771
|
});
|
|
7749
7772
|
},
|
|
7750
7773
|
// NOTE this action should use shift-2 per figma, alas
|
|
7751
|
-
keyTest: (event
|
|
7774
|
+
keyTest: (event, appState, elements, app) => {
|
|
7775
|
+
return app.props.showZoomActions !== false && event.code === CODES2.THREE && event.shiftKey && !event.altKey && !event[KEYS12.CTRL_OR_CMD];
|
|
7776
|
+
}
|
|
7752
7777
|
});
|
|
7753
7778
|
var actionZoomToFit = register({
|
|
7754
7779
|
name: "zoomToFit",
|
|
@@ -7756,6 +7781,9 @@ var actionZoomToFit = register({
|
|
|
7756
7781
|
icon: zoomAreaIcon,
|
|
7757
7782
|
viewMode: true,
|
|
7758
7783
|
trackEvent: { category: "canvas" },
|
|
7784
|
+
predicate: (elements, appState, appProps) => {
|
|
7785
|
+
return appProps.showZoomActions !== false;
|
|
7786
|
+
},
|
|
7759
7787
|
perform: (elements, appState, _, app) => zoomToFit({
|
|
7760
7788
|
targetElements: elements,
|
|
7761
7789
|
appState: {
|
|
@@ -7765,7 +7793,9 @@ var actionZoomToFit = register({
|
|
|
7765
7793
|
fitToViewport: false,
|
|
7766
7794
|
canvasOffsets: app.getEditorUIOffsets()
|
|
7767
7795
|
}),
|
|
7768
|
-
keyTest: (event
|
|
7796
|
+
keyTest: (event, appState, elements, app) => {
|
|
7797
|
+
return app.props.showZoomActions !== false && event.code === CODES2.ONE && event.shiftKey && !event.altKey && !event[KEYS12.CTRL_OR_CMD];
|
|
7798
|
+
}
|
|
7769
7799
|
});
|
|
7770
7800
|
var actionToggleTheme = register({
|
|
7771
7801
|
name: "toggleTheme",
|
|
@@ -7861,6 +7891,9 @@ var actionToggleHandTool = register({
|
|
|
7861
7891
|
trackEvent: { category: "toolbar" },
|
|
7862
7892
|
icon: handIcon,
|
|
7863
7893
|
viewMode: false,
|
|
7894
|
+
predicate: (elements, appState, appProps) => {
|
|
7895
|
+
return appProps.showPanActions !== false;
|
|
7896
|
+
},
|
|
7864
7897
|
perform: (elements, appState, _, app) => {
|
|
7865
7898
|
let activeTool;
|
|
7866
7899
|
if (isHandToolActive(appState)) {
|
|
@@ -7888,12 +7921,14 @@ var actionToggleHandTool = register({
|
|
|
7888
7921
|
captureUpdate: CaptureUpdateAction6.IMMEDIATELY
|
|
7889
7922
|
};
|
|
7890
7923
|
},
|
|
7891
|
-
keyTest: (event
|
|
7924
|
+
keyTest: (event, appState, elements, app) => {
|
|
7925
|
+
return app.props.showPanActions !== false && !event.altKey && !event[KEYS12.CTRL_OR_CMD] && event.key === KEYS12.H;
|
|
7926
|
+
}
|
|
7892
7927
|
});
|
|
7893
7928
|
|
|
7894
7929
|
// actions/actionEmbeddable.ts
|
|
7895
|
-
import { updateActiveTool as updateActiveTool3 } from "haoxin-excalidraw-
|
|
7896
|
-
import { CaptureUpdateAction as CaptureUpdateAction7 } from "haoxin-excalidraw-
|
|
7930
|
+
import { updateActiveTool as updateActiveTool3 } from "@haoxin-web/excalidraw-common";
|
|
7931
|
+
import { CaptureUpdateAction as CaptureUpdateAction7 } from "@haoxin-web/excalidraw-element";
|
|
7897
7932
|
var actionSetEmbeddableAsActiveTool = register({
|
|
7898
7933
|
name: "setEmbeddableAsActiveTool",
|
|
7899
7934
|
trackEvent: { category: "toolbar" },
|
|
@@ -7921,32 +7956,32 @@ var actionSetEmbeddableAsActiveTool = register({
|
|
|
7921
7956
|
});
|
|
7922
7957
|
|
|
7923
7958
|
// actions/actionFinalize.tsx
|
|
7924
|
-
import { pointFrom as pointFrom2 } from "haoxin-excalidraw-
|
|
7959
|
+
import { pointFrom as pointFrom2 } from "@haoxin-web/excalidraw-math";
|
|
7925
7960
|
import {
|
|
7926
7961
|
maybeBindLinearElement,
|
|
7927
7962
|
bindOrUnbindLinearElement,
|
|
7928
7963
|
isBindingEnabled
|
|
7929
|
-
} from "haoxin-excalidraw-
|
|
7964
|
+
} from "@haoxin-web/excalidraw-element/binding";
|
|
7930
7965
|
import {
|
|
7931
7966
|
isValidPolygon,
|
|
7932
7967
|
LinearElementEditor as LinearElementEditor5,
|
|
7933
7968
|
newElementWith as newElementWith4
|
|
7934
|
-
} from "haoxin-excalidraw-
|
|
7969
|
+
} from "@haoxin-web/excalidraw-element";
|
|
7935
7970
|
import {
|
|
7936
7971
|
isBindingElement,
|
|
7937
7972
|
isFreeDrawElement,
|
|
7938
7973
|
isLinearElement as isLinearElement3,
|
|
7939
7974
|
isLineElement as isLineElement2
|
|
7940
|
-
} from "haoxin-excalidraw-
|
|
7975
|
+
} from "@haoxin-web/excalidraw-element";
|
|
7941
7976
|
import {
|
|
7942
7977
|
KEYS as KEYS13,
|
|
7943
7978
|
arrayToMap as arrayToMap4,
|
|
7944
7979
|
tupleToCoors,
|
|
7945
7980
|
updateActiveTool as updateActiveTool4
|
|
7946
|
-
} from "haoxin-excalidraw-
|
|
7947
|
-
import { isPathALoop } from "haoxin-excalidraw-
|
|
7948
|
-
import { isInvisiblySmallElement } from "haoxin-excalidraw-
|
|
7949
|
-
import { CaptureUpdateAction as CaptureUpdateAction8 } from "haoxin-excalidraw-
|
|
7981
|
+
} from "@haoxin-web/excalidraw-common";
|
|
7982
|
+
import { isPathALoop } from "@haoxin-web/excalidraw-element";
|
|
7983
|
+
import { isInvisiblySmallElement } from "@haoxin-web/excalidraw-element";
|
|
7984
|
+
import { CaptureUpdateAction as CaptureUpdateAction8 } from "@haoxin-web/excalidraw-element";
|
|
7950
7985
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
7951
7986
|
var actionFinalize = register({
|
|
7952
7987
|
name: "finalize",
|
|
@@ -8168,9 +8203,9 @@ import {
|
|
|
8168
8203
|
DEFAULT_EXPORT_PADDING as DEFAULT_EXPORT_PADDING2,
|
|
8169
8204
|
EXPORT_SCALES,
|
|
8170
8205
|
THEME as THEME7
|
|
8171
|
-
} from "haoxin-excalidraw-
|
|
8172
|
-
import { getNonDeletedElements as getNonDeletedElements7 } from "haoxin-excalidraw-
|
|
8173
|
-
import { CaptureUpdateAction as CaptureUpdateAction9 } from "haoxin-excalidraw-
|
|
8206
|
+
} from "@haoxin-web/excalidraw-common";
|
|
8207
|
+
import { getNonDeletedElements as getNonDeletedElements7 } from "@haoxin-web/excalidraw-element";
|
|
8208
|
+
import { CaptureUpdateAction as CaptureUpdateAction9 } from "@haoxin-web/excalidraw-element";
|
|
8174
8209
|
|
|
8175
8210
|
// components/CheckboxItem.tsx
|
|
8176
8211
|
import clsx16 from "clsx";
|
|
@@ -8204,7 +8239,7 @@ var CheckboxItem = ({ children, checked, onChange, className }) => {
|
|
|
8204
8239
|
};
|
|
8205
8240
|
|
|
8206
8241
|
// components/DarkModeToggle.tsx
|
|
8207
|
-
import { THEME as THEME6 } from "haoxin-excalidraw-
|
|
8242
|
+
import { THEME as THEME6 } from "@haoxin-web/excalidraw-common";
|
|
8208
8243
|
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
8209
8244
|
var DarkModeToggle = (props) => {
|
|
8210
8245
|
const title = props.title || (props.value === THEME6.DARK ? t("buttons.lightMode") : t("buttons.darkMode"));
|
|
@@ -8239,7 +8274,7 @@ var ICONS = {
|
|
|
8239
8274
|
|
|
8240
8275
|
// components/ProjectName.tsx
|
|
8241
8276
|
import { useState as useState7 } from "react";
|
|
8242
|
-
import { focusNearestParent, KEYS as KEYS14 } from "haoxin-excalidraw-
|
|
8277
|
+
import { focusNearestParent, KEYS as KEYS14 } from "@haoxin-web/excalidraw-common";
|
|
8243
8278
|
import { jsx as jsx40, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
8244
8279
|
var ProjectName = (props) => {
|
|
8245
8280
|
const { id } = useExcalidrawContainer();
|
|
@@ -8288,10 +8323,10 @@ import {
|
|
|
8288
8323
|
MIME_TYPES as MIME_TYPES3,
|
|
8289
8324
|
cloneJSON,
|
|
8290
8325
|
SVG_DOCUMENT_PREAMBLE
|
|
8291
|
-
} from "haoxin-excalidraw-
|
|
8292
|
-
import { getNonDeletedElements as getNonDeletedElements6 } from "haoxin-excalidraw-
|
|
8293
|
-
import { isFrameLikeElement as isFrameLikeElement3 } from "haoxin-excalidraw-
|
|
8294
|
-
import { getElementsOverlappingFrame } from "haoxin-excalidraw-
|
|
8326
|
+
} from "@haoxin-web/excalidraw-common";
|
|
8327
|
+
import { getNonDeletedElements as getNonDeletedElements6 } from "@haoxin-web/excalidraw-element";
|
|
8328
|
+
import { isFrameLikeElement as isFrameLikeElement3 } from "@haoxin-web/excalidraw-element";
|
|
8329
|
+
import { getElementsOverlappingFrame } from "@haoxin-web/excalidraw-element";
|
|
8295
8330
|
|
|
8296
8331
|
// clipboard.ts
|
|
8297
8332
|
import {
|
|
@@ -8302,17 +8337,17 @@ import {
|
|
|
8302
8337
|
isMemberOf,
|
|
8303
8338
|
isPromiseLike as isPromiseLike2,
|
|
8304
8339
|
EVENT as EVENT5
|
|
8305
|
-
} from "haoxin-excalidraw-
|
|
8306
|
-
import { mutateElement } from "haoxin-excalidraw-
|
|
8307
|
-
import { deepCopyElement } from "haoxin-excalidraw-
|
|
8340
|
+
} from "@haoxin-web/excalidraw-common";
|
|
8341
|
+
import { mutateElement } from "@haoxin-web/excalidraw-element";
|
|
8342
|
+
import { deepCopyElement } from "@haoxin-web/excalidraw-element";
|
|
8308
8343
|
import {
|
|
8309
8344
|
isFrameLikeElement as isFrameLikeElement2,
|
|
8310
8345
|
isInitializedImageElement
|
|
8311
|
-
} from "haoxin-excalidraw-
|
|
8312
|
-
import { getContainingFrame } from "haoxin-excalidraw-
|
|
8346
|
+
} from "@haoxin-web/excalidraw-element";
|
|
8347
|
+
import { getContainingFrame } from "@haoxin-web/excalidraw-element";
|
|
8313
8348
|
|
|
8314
8349
|
// charts.ts
|
|
8315
|
-
import { pointFrom as pointFrom3 } from "haoxin-excalidraw-
|
|
8350
|
+
import { pointFrom as pointFrom3 } from "@haoxin-web/excalidraw-math";
|
|
8316
8351
|
import {
|
|
8317
8352
|
COLOR_PALETTE as COLOR_PALETTE3,
|
|
8318
8353
|
DEFAULT_CHART_COLOR_INDEX,
|
|
@@ -8322,12 +8357,12 @@ import {
|
|
|
8322
8357
|
VERTICAL_ALIGN as VERTICAL_ALIGN2,
|
|
8323
8358
|
randomId,
|
|
8324
8359
|
isDevEnv as isDevEnv3
|
|
8325
|
-
} from "haoxin-excalidraw-
|
|
8360
|
+
} from "@haoxin-web/excalidraw-common";
|
|
8326
8361
|
import {
|
|
8327
8362
|
newTextElement,
|
|
8328
8363
|
newLinearElement,
|
|
8329
8364
|
newElement
|
|
8330
|
-
} from "haoxin-excalidraw-
|
|
8365
|
+
} from "@haoxin-web/excalidraw-element";
|
|
8331
8366
|
var BAR_WIDTH = 32;
|
|
8332
8367
|
var BAR_GAP = 12;
|
|
8333
8368
|
var BAR_HEIGHT = 256;
|
|
@@ -9145,7 +9180,7 @@ var exportCanvas = async (type, elements, appState, files, {
|
|
|
9145
9180
|
let blob = canvasToBlob(tempCanvas);
|
|
9146
9181
|
if (appState.exportEmbedScene) {
|
|
9147
9182
|
blob = blob.then(
|
|
9148
|
-
(blob2) => import("./data/image-
|
|
9183
|
+
(blob2) => import("./data/image-6VUVQVTV.js").then(
|
|
9149
9184
|
({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
|
|
9150
9185
|
blob: blob2,
|
|
9151
9186
|
metadata: serializeAsJSON(elements, appState, files, "local")
|
|
@@ -9485,8 +9520,8 @@ import {
|
|
|
9485
9520
|
CODES as CODES3,
|
|
9486
9521
|
KEYS as KEYS16,
|
|
9487
9522
|
getLineHeight as getLineHeight2
|
|
9488
|
-
} from "haoxin-excalidraw-
|
|
9489
|
-
import { newElementWith as newElementWith5 } from "haoxin-excalidraw-
|
|
9523
|
+
} from "@haoxin-web/excalidraw-common";
|
|
9524
|
+
import { newElementWith as newElementWith5 } from "@haoxin-web/excalidraw-element";
|
|
9490
9525
|
import {
|
|
9491
9526
|
hasBoundTextElement,
|
|
9492
9527
|
canApplyRoundnessTypeToElement,
|
|
@@ -9495,12 +9530,12 @@ import {
|
|
|
9495
9530
|
isArrowElement as isArrowElement2,
|
|
9496
9531
|
isExcalidrawElement,
|
|
9497
9532
|
isTextElement as isTextElement3
|
|
9498
|
-
} from "haoxin-excalidraw-
|
|
9533
|
+
} from "@haoxin-web/excalidraw-element";
|
|
9499
9534
|
import {
|
|
9500
9535
|
getBoundTextElement as getBoundTextElement2,
|
|
9501
9536
|
redrawTextBoundingBox as redrawTextBoundingBox2
|
|
9502
|
-
} from "haoxin-excalidraw-
|
|
9503
|
-
import { CaptureUpdateAction as CaptureUpdateAction10 } from "haoxin-excalidraw-
|
|
9537
|
+
} from "@haoxin-web/excalidraw-element";
|
|
9538
|
+
import { CaptureUpdateAction as CaptureUpdateAction10 } from "@haoxin-web/excalidraw-element";
|
|
9504
9539
|
var copiedStyles = "{}";
|
|
9505
9540
|
var actionCopyStyles = register({
|
|
9506
9541
|
name: "copyStyles",
|
|
@@ -9610,10 +9645,10 @@ var actionPasteStyles = register({
|
|
|
9610
9645
|
});
|
|
9611
9646
|
|
|
9612
9647
|
// actions/actionMenu.tsx
|
|
9613
|
-
import { KEYS as KEYS17 } from "haoxin-excalidraw-
|
|
9614
|
-
import { getNonDeletedElements as getNonDeletedElements8 } from "haoxin-excalidraw-
|
|
9615
|
-
import { showSelectedShapeActions } from "haoxin-excalidraw-
|
|
9616
|
-
import { CaptureUpdateAction as CaptureUpdateAction11 } from "haoxin-excalidraw-
|
|
9648
|
+
import { KEYS as KEYS17 } from "@haoxin-web/excalidraw-common";
|
|
9649
|
+
import { getNonDeletedElements as getNonDeletedElements8 } from "@haoxin-web/excalidraw-element";
|
|
9650
|
+
import { showSelectedShapeActions } from "@haoxin-web/excalidraw-element";
|
|
9651
|
+
import { CaptureUpdateAction as CaptureUpdateAction11 } from "@haoxin-web/excalidraw-element";
|
|
9617
9652
|
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
9618
9653
|
var actionToggleCanvasMenu = register({
|
|
9619
9654
|
name: "toggleCanvasMenu",
|
|
@@ -9687,9 +9722,9 @@ var actionShortcuts = register({
|
|
|
9687
9722
|
});
|
|
9688
9723
|
|
|
9689
9724
|
// actions/actionGroup.tsx
|
|
9690
|
-
import { getNonDeletedElements as getNonDeletedElements9 } from "haoxin-excalidraw-
|
|
9691
|
-
import { newElementWith as newElementWith6 } from "haoxin-excalidraw-
|
|
9692
|
-
import { isBoundToContainer as isBoundToContainer3 } from "haoxin-excalidraw-
|
|
9725
|
+
import { getNonDeletedElements as getNonDeletedElements9 } from "@haoxin-web/excalidraw-element";
|
|
9726
|
+
import { newElementWith as newElementWith6 } from "@haoxin-web/excalidraw-element";
|
|
9727
|
+
import { isBoundToContainer as isBoundToContainer3 } from "@haoxin-web/excalidraw-element";
|
|
9693
9728
|
import {
|
|
9694
9729
|
frameAndChildrenSelectedTogether,
|
|
9695
9730
|
getElementsInResizingFrame,
|
|
@@ -9698,8 +9733,8 @@ import {
|
|
|
9698
9733
|
groupByFrameLikes,
|
|
9699
9734
|
removeElementsFromFrame,
|
|
9700
9735
|
replaceAllElementsInFrame
|
|
9701
|
-
} from "haoxin-excalidraw-
|
|
9702
|
-
import { KEYS as KEYS18, randomId as randomId2, arrayToMap as arrayToMap6, getShortcutKey as getShortcutKey6 } from "haoxin-excalidraw-
|
|
9736
|
+
} from "@haoxin-web/excalidraw-element";
|
|
9737
|
+
import { KEYS as KEYS18, randomId as randomId2, arrayToMap as arrayToMap6, getShortcutKey as getShortcutKey6 } from "@haoxin-web/excalidraw-common";
|
|
9703
9738
|
import {
|
|
9704
9739
|
getSelectedGroupIds,
|
|
9705
9740
|
selectGroup,
|
|
@@ -9708,9 +9743,9 @@ import {
|
|
|
9708
9743
|
addToGroup,
|
|
9709
9744
|
removeFromSelectedGroups,
|
|
9710
9745
|
isElementInGroup
|
|
9711
|
-
} from "haoxin-excalidraw-
|
|
9712
|
-
import { syncMovedIndices as syncMovedIndices2 } from "haoxin-excalidraw-
|
|
9713
|
-
import { CaptureUpdateAction as CaptureUpdateAction12 } from "haoxin-excalidraw-
|
|
9746
|
+
} from "@haoxin-web/excalidraw-element";
|
|
9747
|
+
import { syncMovedIndices as syncMovedIndices2 } from "@haoxin-web/excalidraw-element";
|
|
9748
|
+
import { CaptureUpdateAction as CaptureUpdateAction12 } from "@haoxin-web/excalidraw-element";
|
|
9714
9749
|
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
9715
9750
|
var allElementsInSameGroup = (elements) => {
|
|
9716
9751
|
if (elements.length >= 2) {
|
|
@@ -9936,7 +9971,7 @@ var actionUngroup = register({
|
|
|
9936
9971
|
|
|
9937
9972
|
// actions/actionNavigate.tsx
|
|
9938
9973
|
import clsx18 from "clsx";
|
|
9939
|
-
import { CaptureUpdateAction as CaptureUpdateAction13 } from "haoxin-excalidraw-
|
|
9974
|
+
import { CaptureUpdateAction as CaptureUpdateAction13 } from "@haoxin-web/excalidraw-element";
|
|
9940
9975
|
|
|
9941
9976
|
// clients.ts
|
|
9942
9977
|
import {
|
|
@@ -9945,7 +9980,7 @@ import {
|
|
|
9945
9980
|
COLOR_WHITE,
|
|
9946
9981
|
THEME as THEME8,
|
|
9947
9982
|
UserIdleState
|
|
9948
|
-
} from "haoxin-excalidraw-
|
|
9983
|
+
} from "@haoxin-web/excalidraw-common";
|
|
9949
9984
|
|
|
9950
9985
|
// renderer/roundRect.ts
|
|
9951
9986
|
var roundRect = (context, x, y, width, height, radius, strokeColor) => {
|
|
@@ -10295,9 +10330,9 @@ var actionGoToCollaborator = register({
|
|
|
10295
10330
|
});
|
|
10296
10331
|
|
|
10297
10332
|
// actions/actionAddToLibrary.ts
|
|
10298
|
-
import { LIBRARY_DISABLED_TYPES, randomId as randomId3 } from "haoxin-excalidraw-
|
|
10299
|
-
import { deepCopyElement as deepCopyElement2 } from "haoxin-excalidraw-
|
|
10300
|
-
import { CaptureUpdateAction as CaptureUpdateAction14 } from "haoxin-excalidraw-
|
|
10333
|
+
import { LIBRARY_DISABLED_TYPES, randomId as randomId3 } from "@haoxin-web/excalidraw-common";
|
|
10334
|
+
import { deepCopyElement as deepCopyElement2 } from "@haoxin-web/excalidraw-element";
|
|
10335
|
+
import { CaptureUpdateAction as CaptureUpdateAction14 } from "@haoxin-web/excalidraw-element";
|
|
10301
10336
|
var actionAddToLibrary = register({
|
|
10302
10337
|
name: "addToLibrary",
|
|
10303
10338
|
trackEvent: { category: "element" },
|
|
@@ -10350,13 +10385,13 @@ var actionAddToLibrary = register({
|
|
|
10350
10385
|
});
|
|
10351
10386
|
|
|
10352
10387
|
// actions/actionAlign.tsx
|
|
10353
|
-
import { getNonDeletedElements as getNonDeletedElements10 } from "haoxin-excalidraw-
|
|
10354
|
-
import { isFrameLikeElement as isFrameLikeElement5 } from "haoxin-excalidraw-
|
|
10355
|
-
import { updateFrameMembershipOfSelectedElements } from "haoxin-excalidraw-
|
|
10356
|
-
import { KEYS as KEYS19, arrayToMap as arrayToMap7, getShortcutKey as getShortcutKey7 } from "haoxin-excalidraw-
|
|
10357
|
-
import { alignElements } from "haoxin-excalidraw-
|
|
10358
|
-
import { CaptureUpdateAction as CaptureUpdateAction15 } from "haoxin-excalidraw-
|
|
10359
|
-
import { getSelectedElementsByGroup } from "haoxin-excalidraw-
|
|
10388
|
+
import { getNonDeletedElements as getNonDeletedElements10 } from "@haoxin-web/excalidraw-element";
|
|
10389
|
+
import { isFrameLikeElement as isFrameLikeElement5 } from "@haoxin-web/excalidraw-element";
|
|
10390
|
+
import { updateFrameMembershipOfSelectedElements } from "@haoxin-web/excalidraw-element";
|
|
10391
|
+
import { KEYS as KEYS19, arrayToMap as arrayToMap7, getShortcutKey as getShortcutKey7 } from "@haoxin-web/excalidraw-common";
|
|
10392
|
+
import { alignElements } from "@haoxin-web/excalidraw-element";
|
|
10393
|
+
import { CaptureUpdateAction as CaptureUpdateAction15 } from "@haoxin-web/excalidraw-element";
|
|
10394
|
+
import { getSelectedElementsByGroup } from "@haoxin-web/excalidraw-element";
|
|
10360
10395
|
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
10361
10396
|
var alignActionsPredicate = (appState, app) => {
|
|
10362
10397
|
const selectedElements = app.scene.getSelectedElements(appState);
|
|
@@ -10570,13 +10605,13 @@ var actionAlignHorizontallyCentered = register({
|
|
|
10570
10605
|
});
|
|
10571
10606
|
|
|
10572
10607
|
// actions/actionDistribute.tsx
|
|
10573
|
-
import { getNonDeletedElements as getNonDeletedElements11 } from "haoxin-excalidraw-
|
|
10574
|
-
import { isFrameLikeElement as isFrameLikeElement6 } from "haoxin-excalidraw-
|
|
10575
|
-
import { CODES as CODES4, KEYS as KEYS20, arrayToMap as arrayToMap8, getShortcutKey as getShortcutKey8 } from "haoxin-excalidraw-
|
|
10576
|
-
import { updateFrameMembershipOfSelectedElements as updateFrameMembershipOfSelectedElements2 } from "haoxin-excalidraw-
|
|
10577
|
-
import { distributeElements } from "haoxin-excalidraw-
|
|
10578
|
-
import { CaptureUpdateAction as CaptureUpdateAction16 } from "haoxin-excalidraw-
|
|
10579
|
-
import { getSelectedElementsByGroup as getSelectedElementsByGroup2 } from "haoxin-excalidraw-
|
|
10608
|
+
import { getNonDeletedElements as getNonDeletedElements11 } from "@haoxin-web/excalidraw-element";
|
|
10609
|
+
import { isFrameLikeElement as isFrameLikeElement6 } from "@haoxin-web/excalidraw-element";
|
|
10610
|
+
import { CODES as CODES4, KEYS as KEYS20, arrayToMap as arrayToMap8, getShortcutKey as getShortcutKey8 } from "@haoxin-web/excalidraw-common";
|
|
10611
|
+
import { updateFrameMembershipOfSelectedElements as updateFrameMembershipOfSelectedElements2 } from "@haoxin-web/excalidraw-element";
|
|
10612
|
+
import { distributeElements } from "@haoxin-web/excalidraw-element";
|
|
10613
|
+
import { CaptureUpdateAction as CaptureUpdateAction16 } from "@haoxin-web/excalidraw-element";
|
|
10614
|
+
import { getSelectedElementsByGroup as getSelectedElementsByGroup2 } from "@haoxin-web/excalidraw-element";
|
|
10580
10615
|
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
10581
10616
|
var enableActionGroup2 = (appState, app) => {
|
|
10582
10617
|
const selectedElements = app.scene.getSelectedElements(appState);
|
|
@@ -10662,23 +10697,23 @@ var distributeVertically = register({
|
|
|
10662
10697
|
});
|
|
10663
10698
|
|
|
10664
10699
|
// actions/actionFlip.ts
|
|
10665
|
-
import { getNonDeletedElements as getNonDeletedElements12 } from "haoxin-excalidraw-
|
|
10700
|
+
import { getNonDeletedElements as getNonDeletedElements12 } from "@haoxin-web/excalidraw-element";
|
|
10666
10701
|
import {
|
|
10667
10702
|
bindOrUnbindLinearElements,
|
|
10668
10703
|
isBindingEnabled as isBindingEnabled2
|
|
10669
|
-
} from "haoxin-excalidraw-
|
|
10670
|
-
import { getCommonBoundingBox } from "haoxin-excalidraw-
|
|
10671
|
-
import { newElementWith as newElementWith7 } from "haoxin-excalidraw-
|
|
10672
|
-
import { deepCopyElement as deepCopyElement3 } from "haoxin-excalidraw-
|
|
10673
|
-
import { resizeMultipleElements } from "haoxin-excalidraw-
|
|
10704
|
+
} from "@haoxin-web/excalidraw-element";
|
|
10705
|
+
import { getCommonBoundingBox } from "@haoxin-web/excalidraw-element";
|
|
10706
|
+
import { newElementWith as newElementWith7 } from "@haoxin-web/excalidraw-element";
|
|
10707
|
+
import { deepCopyElement as deepCopyElement3 } from "@haoxin-web/excalidraw-element";
|
|
10708
|
+
import { resizeMultipleElements } from "@haoxin-web/excalidraw-element";
|
|
10674
10709
|
import {
|
|
10675
10710
|
isArrowElement as isArrowElement3,
|
|
10676
10711
|
isElbowArrow as isElbowArrow3,
|
|
10677
10712
|
isLinearElement as isLinearElement4
|
|
10678
|
-
} from "haoxin-excalidraw-
|
|
10679
|
-
import { updateFrameMembershipOfSelectedElements as updateFrameMembershipOfSelectedElements3 } from "haoxin-excalidraw-
|
|
10680
|
-
import { CODES as CODES5, KEYS as KEYS21, arrayToMap as arrayToMap9 } from "haoxin-excalidraw-
|
|
10681
|
-
import { CaptureUpdateAction as CaptureUpdateAction17 } from "haoxin-excalidraw-
|
|
10713
|
+
} from "@haoxin-web/excalidraw-element";
|
|
10714
|
+
import { updateFrameMembershipOfSelectedElements as updateFrameMembershipOfSelectedElements3 } from "@haoxin-web/excalidraw-element";
|
|
10715
|
+
import { CODES as CODES5, KEYS as KEYS21, arrayToMap as arrayToMap9 } from "@haoxin-web/excalidraw-common";
|
|
10716
|
+
import { CaptureUpdateAction as CaptureUpdateAction17 } from "@haoxin-web/excalidraw-element";
|
|
10682
10717
|
var actionFlipHorizontal = register({
|
|
10683
10718
|
name: "flipHorizontal",
|
|
10684
10719
|
label: "labels.flipHorizontal",
|
|
@@ -10808,10 +10843,10 @@ var flipElements = (selectedElements, elementsMap, appState, flipDirection, app)
|
|
|
10808
10843
|
};
|
|
10809
10844
|
|
|
10810
10845
|
// actions/actionClipboard.tsx
|
|
10811
|
-
import { isTextElement as isTextElement4 } from "haoxin-excalidraw-
|
|
10812
|
-
import { getTextFromElements } from "haoxin-excalidraw-
|
|
10813
|
-
import { CODES as CODES6, KEYS as KEYS22, isFirefox as isFirefox2 } from "haoxin-excalidraw-
|
|
10814
|
-
import { CaptureUpdateAction as CaptureUpdateAction18 } from "haoxin-excalidraw-
|
|
10846
|
+
import { isTextElement as isTextElement4 } from "@haoxin-web/excalidraw-element";
|
|
10847
|
+
import { getTextFromElements } from "@haoxin-web/excalidraw-element";
|
|
10848
|
+
import { CODES as CODES6, KEYS as KEYS22, isFirefox as isFirefox2 } from "@haoxin-web/excalidraw-common";
|
|
10849
|
+
import { CaptureUpdateAction as CaptureUpdateAction18 } from "@haoxin-web/excalidraw-element";
|
|
10815
10850
|
var actionCopy = register({
|
|
10816
10851
|
name: "copy",
|
|
10817
10852
|
label: "labels.copy",
|
|
@@ -11044,8 +11079,8 @@ var copyText = register({
|
|
|
11044
11079
|
});
|
|
11045
11080
|
|
|
11046
11081
|
// actions/actionToggleGridMode.tsx
|
|
11047
|
-
import { CODES as CODES7, KEYS as KEYS23 } from "haoxin-excalidraw-
|
|
11048
|
-
import { CaptureUpdateAction as CaptureUpdateAction19 } from "haoxin-excalidraw-
|
|
11082
|
+
import { CODES as CODES7, KEYS as KEYS23 } from "@haoxin-web/excalidraw-common";
|
|
11083
|
+
import { CaptureUpdateAction as CaptureUpdateAction19 } from "@haoxin-web/excalidraw-element";
|
|
11049
11084
|
var actionToggleGridMode = register({
|
|
11050
11085
|
name: "gridMode",
|
|
11051
11086
|
icon: gridIcon,
|
|
@@ -11074,8 +11109,8 @@ var actionToggleGridMode = register({
|
|
|
11074
11109
|
});
|
|
11075
11110
|
|
|
11076
11111
|
// actions/actionToggleZenMode.tsx
|
|
11077
|
-
import { CODES as CODES8, KEYS as KEYS24 } from "haoxin-excalidraw-
|
|
11078
|
-
import { CaptureUpdateAction as CaptureUpdateAction20 } from "haoxin-excalidraw-
|
|
11112
|
+
import { CODES as CODES8, KEYS as KEYS24 } from "@haoxin-web/excalidraw-common";
|
|
11113
|
+
import { CaptureUpdateAction as CaptureUpdateAction20 } from "@haoxin-web/excalidraw-element";
|
|
11079
11114
|
var actionToggleZenMode = register({
|
|
11080
11115
|
name: "zenMode",
|
|
11081
11116
|
label: "buttons.zenMode",
|
|
@@ -11102,8 +11137,8 @@ var actionToggleZenMode = register({
|
|
|
11102
11137
|
});
|
|
11103
11138
|
|
|
11104
11139
|
// actions/actionToggleObjectsSnapMode.tsx
|
|
11105
|
-
import { CODES as CODES9, KEYS as KEYS25 } from "haoxin-excalidraw-
|
|
11106
|
-
import { CaptureUpdateAction as CaptureUpdateAction21 } from "haoxin-excalidraw-
|
|
11140
|
+
import { CODES as CODES9, KEYS as KEYS25 } from "@haoxin-web/excalidraw-common";
|
|
11141
|
+
import { CaptureUpdateAction as CaptureUpdateAction21 } from "@haoxin-web/excalidraw-element";
|
|
11107
11142
|
var actionToggleObjectsSnapMode = register({
|
|
11108
11143
|
name: "objectsSnapMode",
|
|
11109
11144
|
label: "buttons.objectsSnapMode",
|
|
@@ -11131,8 +11166,8 @@ var actionToggleObjectsSnapMode = register({
|
|
|
11131
11166
|
});
|
|
11132
11167
|
|
|
11133
11168
|
// actions/actionToggleStats.tsx
|
|
11134
|
-
import { CODES as CODES10, KEYS as KEYS26 } from "haoxin-excalidraw-
|
|
11135
|
-
import { CaptureUpdateAction as CaptureUpdateAction22 } from "haoxin-excalidraw-
|
|
11169
|
+
import { CODES as CODES10, KEYS as KEYS26 } from "@haoxin-web/excalidraw-common";
|
|
11170
|
+
import { CaptureUpdateAction as CaptureUpdateAction22 } from "@haoxin-web/excalidraw-element";
|
|
11136
11171
|
var actionToggleStats = register({
|
|
11137
11172
|
name: "stats",
|
|
11138
11173
|
label: "stats.fullTitle",
|
|
@@ -11161,29 +11196,29 @@ import {
|
|
|
11161
11196
|
VERTICAL_ALIGN as VERTICAL_ALIGN3,
|
|
11162
11197
|
arrayToMap as arrayToMap10,
|
|
11163
11198
|
getFontString
|
|
11164
|
-
} from "haoxin-excalidraw-
|
|
11199
|
+
} from "@haoxin-web/excalidraw-common";
|
|
11165
11200
|
import {
|
|
11166
11201
|
getOriginalContainerHeightFromCache,
|
|
11167
11202
|
resetOriginalContainerCache,
|
|
11168
11203
|
updateOriginalContainerCache
|
|
11169
|
-
} from "haoxin-excalidraw-
|
|
11204
|
+
} from "@haoxin-web/excalidraw-element";
|
|
11170
11205
|
import {
|
|
11171
11206
|
computeBoundTextPosition,
|
|
11172
11207
|
computeContainerDimensionForBoundText,
|
|
11173
11208
|
getBoundTextElement as getBoundTextElement3,
|
|
11174
11209
|
redrawTextBoundingBox as redrawTextBoundingBox3
|
|
11175
|
-
} from "haoxin-excalidraw-
|
|
11210
|
+
} from "@haoxin-web/excalidraw-element";
|
|
11176
11211
|
import {
|
|
11177
11212
|
hasBoundTextElement as hasBoundTextElement2,
|
|
11178
11213
|
isArrowElement as isArrowElement4,
|
|
11179
11214
|
isTextBindableContainer,
|
|
11180
11215
|
isTextElement as isTextElement5,
|
|
11181
11216
|
isUsingAdaptiveRadius as isUsingAdaptiveRadius2
|
|
11182
|
-
} from "haoxin-excalidraw-
|
|
11183
|
-
import { measureText } from "haoxin-excalidraw-
|
|
11184
|
-
import { syncMovedIndices as syncMovedIndices3 } from "haoxin-excalidraw-
|
|
11185
|
-
import { newElement as newElement2 } from "haoxin-excalidraw-
|
|
11186
|
-
import { CaptureUpdateAction as CaptureUpdateAction23 } from "haoxin-excalidraw-
|
|
11217
|
+
} from "@haoxin-web/excalidraw-element";
|
|
11218
|
+
import { measureText } from "@haoxin-web/excalidraw-element";
|
|
11219
|
+
import { syncMovedIndices as syncMovedIndices3 } from "@haoxin-web/excalidraw-element";
|
|
11220
|
+
import { newElement as newElement2 } from "@haoxin-web/excalidraw-element";
|
|
11221
|
+
import { CaptureUpdateAction as CaptureUpdateAction23 } from "@haoxin-web/excalidraw-element";
|
|
11187
11222
|
var actionUnbindText = register({
|
|
11188
11223
|
name: "unbindText",
|
|
11189
11224
|
label: "labels.unbindText",
|
|
@@ -11417,12 +11452,12 @@ var actionWrapTextInContainer = register({
|
|
|
11417
11452
|
});
|
|
11418
11453
|
|
|
11419
11454
|
// actions/actionLink.tsx
|
|
11420
|
-
import { isEmbeddableElement as isEmbeddableElement2 } from "haoxin-excalidraw-
|
|
11421
|
-
import { KEYS as KEYS28, getShortcutKey as getShortcutKey9 } from "haoxin-excalidraw-
|
|
11422
|
-
import { CaptureUpdateAction as CaptureUpdateAction24 } from "haoxin-excalidraw-
|
|
11455
|
+
import { isEmbeddableElement as isEmbeddableElement2 } from "@haoxin-web/excalidraw-element";
|
|
11456
|
+
import { KEYS as KEYS28, getShortcutKey as getShortcutKey9 } from "@haoxin-web/excalidraw-common";
|
|
11457
|
+
import { CaptureUpdateAction as CaptureUpdateAction24 } from "@haoxin-web/excalidraw-element";
|
|
11423
11458
|
|
|
11424
11459
|
// components/hyperlink/Hyperlink.tsx
|
|
11425
|
-
import { pointFrom as pointFrom4 } from "haoxin-excalidraw-
|
|
11460
|
+
import { pointFrom as pointFrom4 } from "@haoxin-web/excalidraw-math";
|
|
11426
11461
|
import clsx19 from "clsx";
|
|
11427
11462
|
import {
|
|
11428
11463
|
useCallback as useCallback4,
|
|
@@ -11431,19 +11466,19 @@ import {
|
|
|
11431
11466
|
useRef as useRef12,
|
|
11432
11467
|
useState as useState9
|
|
11433
11468
|
} from "react";
|
|
11434
|
-
import { EVENT as EVENT6, HYPERLINK_TOOLTIP_DELAY, KEYS as KEYS27 } from "haoxin-excalidraw-
|
|
11435
|
-
import { getElementAbsoluteCoords } from "haoxin-excalidraw-
|
|
11436
|
-
import { hitElementBoundingBox } from "haoxin-excalidraw-
|
|
11437
|
-
import { isElementLink } from "haoxin-excalidraw-
|
|
11438
|
-
import { getEmbedLink, embeddableURLValidator } from "haoxin-excalidraw-
|
|
11469
|
+
import { EVENT as EVENT6, HYPERLINK_TOOLTIP_DELAY, KEYS as KEYS27 } from "@haoxin-web/excalidraw-common";
|
|
11470
|
+
import { getElementAbsoluteCoords } from "@haoxin-web/excalidraw-element";
|
|
11471
|
+
import { hitElementBoundingBox } from "@haoxin-web/excalidraw-element";
|
|
11472
|
+
import { isElementLink } from "@haoxin-web/excalidraw-element";
|
|
11473
|
+
import { getEmbedLink, embeddableURLValidator } from "@haoxin-web/excalidraw-element";
|
|
11439
11474
|
import {
|
|
11440
11475
|
sceneCoordsToViewportCoords,
|
|
11441
11476
|
viewportCoordsToSceneCoords,
|
|
11442
11477
|
wrapEvent,
|
|
11443
11478
|
isLocalLink,
|
|
11444
11479
|
normalizeLink
|
|
11445
|
-
} from "haoxin-excalidraw-
|
|
11446
|
-
import { isEmbeddableElement } from "haoxin-excalidraw-
|
|
11480
|
+
} from "@haoxin-web/excalidraw-common";
|
|
11481
|
+
import { isEmbeddableElement } from "@haoxin-web/excalidraw-element";
|
|
11447
11482
|
import { jsx as jsx48, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
11448
11483
|
var POPUP_WIDTH = 380;
|
|
11449
11484
|
var POPUP_HEIGHT = 42;
|
|
@@ -11822,13 +11857,13 @@ var actionLink = register({
|
|
|
11822
11857
|
});
|
|
11823
11858
|
|
|
11824
11859
|
// actions/actionElementLock.ts
|
|
11825
|
-
import { KEYS as KEYS29, arrayToMap as arrayToMap11, randomId as randomId4 } from "haoxin-excalidraw-
|
|
11860
|
+
import { KEYS as KEYS29, arrayToMap as arrayToMap11, randomId as randomId4 } from "@haoxin-web/excalidraw-common";
|
|
11826
11861
|
import {
|
|
11827
11862
|
elementsAreInSameGroup,
|
|
11828
11863
|
newElementWith as newElementWith8,
|
|
11829
11864
|
selectGroupsFromGivenElements
|
|
11830
|
-
} from "haoxin-excalidraw-
|
|
11831
|
-
import { CaptureUpdateAction as CaptureUpdateAction25 } from "haoxin-excalidraw-
|
|
11865
|
+
} from "@haoxin-web/excalidraw-element";
|
|
11866
|
+
import { CaptureUpdateAction as CaptureUpdateAction25 } from "@haoxin-web/excalidraw-element";
|
|
11832
11867
|
var shouldLock = (elements) => elements.every((el) => !el.locked);
|
|
11833
11868
|
var actionToggleElementLock = register({
|
|
11834
11869
|
name: "toggleElementLock",
|
|
@@ -11974,12 +12009,12 @@ import {
|
|
|
11974
12009
|
isElbowArrow as isElbowArrow7,
|
|
11975
12010
|
isLinearElement as isLinearElement9,
|
|
11976
12011
|
isLineElement as isLineElement4
|
|
11977
|
-
} from "haoxin-excalidraw-
|
|
11978
|
-
import { arrayToMap as arrayToMap20, invariant as invariant8 } from "haoxin-excalidraw-
|
|
12012
|
+
} from "@haoxin-web/excalidraw-element";
|
|
12013
|
+
import { arrayToMap as arrayToMap20, invariant as invariant8 } from "@haoxin-web/excalidraw-common";
|
|
11979
12014
|
import {
|
|
11980
12015
|
toggleLinePolygonState as toggleLinePolygonState3,
|
|
11981
12016
|
CaptureUpdateAction as CaptureUpdateAction28
|
|
11982
|
-
} from "haoxin-excalidraw-
|
|
12017
|
+
} from "@haoxin-web/excalidraw-element";
|
|
11983
12018
|
|
|
11984
12019
|
// components/CommandPalette/CommandPalette.tsx
|
|
11985
12020
|
import clsx32 from "clsx";
|
|
@@ -11992,18 +12027,18 @@ import {
|
|
|
11992
12027
|
capitalizeString as capitalizeString2,
|
|
11993
12028
|
getShortcutKey as getShortcutKey11,
|
|
11994
12029
|
isWritableElement
|
|
11995
|
-
} from "haoxin-excalidraw-
|
|
12030
|
+
} from "@haoxin-web/excalidraw-common";
|
|
11996
12031
|
|
|
11997
12032
|
// actions/actionToggleShapeSwitch.tsx
|
|
11998
|
-
import { CaptureUpdateAction as CaptureUpdateAction26 } from "haoxin-excalidraw-
|
|
12033
|
+
import { CaptureUpdateAction as CaptureUpdateAction26 } from "@haoxin-web/excalidraw-element";
|
|
11999
12034
|
|
|
12000
12035
|
// components/ConvertElementTypePopup.tsx
|
|
12001
12036
|
import { useEffect as useEffect16, useMemo as useMemo5, useRef as useRef13, useState as useState10 } from "react";
|
|
12002
12037
|
import {
|
|
12003
12038
|
getLinearElementSubType,
|
|
12004
12039
|
updateElbowArrowPoints as updateElbowArrowPoints2
|
|
12005
|
-
} from "haoxin-excalidraw-
|
|
12006
|
-
import { pointFrom as pointFrom5, pointRotateRads } from "haoxin-excalidraw-
|
|
12040
|
+
} from "@haoxin-web/excalidraw-element";
|
|
12041
|
+
import { pointFrom as pointFrom5, pointRotateRads } from "@haoxin-web/excalidraw-math";
|
|
12007
12042
|
import {
|
|
12008
12043
|
hasBoundTextElement as hasBoundTextElement3,
|
|
12009
12044
|
isArrowBoundToElement,
|
|
@@ -12011,18 +12046,18 @@ import {
|
|
|
12011
12046
|
isElbowArrow as isElbowArrow4,
|
|
12012
12047
|
isLinearElement as isLinearElement5,
|
|
12013
12048
|
isUsingAdaptiveRadius as isUsingAdaptiveRadius3
|
|
12014
|
-
} from "haoxin-excalidraw-
|
|
12049
|
+
} from "@haoxin-web/excalidraw-element";
|
|
12015
12050
|
import {
|
|
12016
12051
|
getCommonBoundingBox as getCommonBoundingBox2,
|
|
12017
12052
|
getElementAbsoluteCoords as getElementAbsoluteCoords2
|
|
12018
|
-
} from "haoxin-excalidraw-
|
|
12053
|
+
} from "@haoxin-web/excalidraw-element";
|
|
12019
12054
|
import {
|
|
12020
12055
|
getBoundTextElement as getBoundTextElement4,
|
|
12021
12056
|
getBoundTextMaxHeight,
|
|
12022
12057
|
getBoundTextMaxWidth,
|
|
12023
12058
|
redrawTextBoundingBox as redrawTextBoundingBox4
|
|
12024
|
-
} from "haoxin-excalidraw-
|
|
12025
|
-
import { wrapText } from "haoxin-excalidraw-
|
|
12059
|
+
} from "@haoxin-web/excalidraw-element";
|
|
12060
|
+
import { wrapText } from "@haoxin-web/excalidraw-element";
|
|
12026
12061
|
import {
|
|
12027
12062
|
assertNever,
|
|
12028
12063
|
CLASSES,
|
|
@@ -12031,16 +12066,16 @@ import {
|
|
|
12031
12066
|
mapFind,
|
|
12032
12067
|
reduceToCommonValue as reduceToCommonValue2,
|
|
12033
12068
|
updateActiveTool as updateActiveTool5
|
|
12034
|
-
} from "haoxin-excalidraw-
|
|
12035
|
-
import { measureText as measureText2 } from "haoxin-excalidraw-
|
|
12036
|
-
import { LinearElementEditor as LinearElementEditor6 } from "haoxin-excalidraw-
|
|
12069
|
+
} from "@haoxin-web/excalidraw-common";
|
|
12070
|
+
import { measureText as measureText2 } from "@haoxin-web/excalidraw-element";
|
|
12071
|
+
import { LinearElementEditor as LinearElementEditor6 } from "@haoxin-web/excalidraw-element";
|
|
12037
12072
|
import {
|
|
12038
12073
|
newArrowElement,
|
|
12039
12074
|
newElement as newElement3,
|
|
12040
12075
|
newLinearElement as newLinearElement2
|
|
12041
|
-
} from "haoxin-excalidraw-
|
|
12042
|
-
import { ShapeCache } from "haoxin-excalidraw-
|
|
12043
|
-
import { updateBindings } from "haoxin-excalidraw-
|
|
12076
|
+
} from "@haoxin-web/excalidraw-element";
|
|
12077
|
+
import { ShapeCache } from "@haoxin-web/excalidraw-element";
|
|
12078
|
+
import { updateBindings } from "@haoxin-web/excalidraw-element";
|
|
12044
12079
|
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
12045
12080
|
var GAP_HORIZONTAL = 8;
|
|
12046
12081
|
var GAP_VERTICAL = 10;
|
|
@@ -12631,8 +12666,8 @@ import {
|
|
|
12631
12666
|
canCreateLinkFromElements,
|
|
12632
12667
|
defaultGetElementLinkFromSelection,
|
|
12633
12668
|
getLinkIdAndTypeFromSelection
|
|
12634
|
-
} from "haoxin-excalidraw-
|
|
12635
|
-
import { CaptureUpdateAction as CaptureUpdateAction27 } from "haoxin-excalidraw-
|
|
12669
|
+
} from "@haoxin-web/excalidraw-element";
|
|
12670
|
+
import { CaptureUpdateAction as CaptureUpdateAction27 } from "@haoxin-web/excalidraw-element";
|
|
12636
12671
|
var actionCopyElementLink = register({
|
|
12637
12672
|
name: "copyElementLink",
|
|
12638
12673
|
label: "labels.copyElementLink",
|
|
@@ -12715,7 +12750,7 @@ var actionLinkToElement = register({
|
|
|
12715
12750
|
});
|
|
12716
12751
|
|
|
12717
12752
|
// actions/shortcuts.ts
|
|
12718
|
-
import { isDarwin as isDarwin2, getShortcutKey as getShortcutKey10 } from "haoxin-excalidraw-
|
|
12753
|
+
import { isDarwin as isDarwin2, getShortcutKey as getShortcutKey10 } from "@haoxin-web/excalidraw-common";
|
|
12719
12754
|
var shortcutMap = {
|
|
12720
12755
|
toggleTheme: [getShortcutKey10("Shift+Alt+D")],
|
|
12721
12756
|
saveScene: [getShortcutKey10("CtrlOrCmd+S")],
|
|
@@ -12993,7 +13028,7 @@ var deburr = (str) => {
|
|
|
12993
13028
|
// components/Dialog.tsx
|
|
12994
13029
|
import clsx28 from "clsx";
|
|
12995
13030
|
import { useEffect as useEffect26, useState as useState19 } from "react";
|
|
12996
|
-
import { KEYS as KEYS32, queryFocusableElements } from "haoxin-excalidraw-
|
|
13031
|
+
import { KEYS as KEYS32, queryFocusableElements } from "@haoxin-web/excalidraw-common";
|
|
12997
13032
|
|
|
12998
13033
|
// hooks/useCallbackRefState.ts
|
|
12999
13034
|
import { useCallback as useCallback5, useState as useState11 } from "react";
|
|
@@ -13016,7 +13051,7 @@ import {
|
|
|
13016
13051
|
LIBRARY_DISABLED_TYPES as LIBRARY_DISABLED_TYPES2,
|
|
13017
13052
|
randomId as randomId5,
|
|
13018
13053
|
isShallowEqual
|
|
13019
|
-
} from "haoxin-excalidraw-
|
|
13054
|
+
} from "@haoxin-web/excalidraw-common";
|
|
13020
13055
|
|
|
13021
13056
|
// data/library.ts
|
|
13022
13057
|
import { useEffect as useEffect18, useRef as useRef14 } from "react";
|
|
@@ -13035,12 +13070,12 @@ import {
|
|
|
13035
13070
|
toValidURL,
|
|
13036
13071
|
Queue,
|
|
13037
13072
|
Emitter
|
|
13038
|
-
} from "haoxin-excalidraw-
|
|
13039
|
-
import { hashElementsVersion, hashString } from "haoxin-excalidraw-
|
|
13040
|
-
import { getCommonBoundingBox as getCommonBoundingBox3 } from "haoxin-excalidraw-
|
|
13073
|
+
} from "@haoxin-web/excalidraw-common";
|
|
13074
|
+
import { hashElementsVersion, hashString } from "@haoxin-web/excalidraw-element";
|
|
13075
|
+
import { getCommonBoundingBox as getCommonBoundingBox3 } from "@haoxin-web/excalidraw-element";
|
|
13041
13076
|
|
|
13042
13077
|
// ../utils/src/export.ts
|
|
13043
|
-
import { MIME_TYPES as MIME_TYPES4 } from "haoxin-excalidraw-
|
|
13078
|
+
import { MIME_TYPES as MIME_TYPES4 } from "@haoxin-web/excalidraw-common";
|
|
13044
13079
|
var exportToCanvas2 = ({
|
|
13045
13080
|
elements,
|
|
13046
13081
|
appState,
|
|
@@ -13177,7 +13212,7 @@ var exportToClipboard = async (opts) => {
|
|
|
13177
13212
|
|
|
13178
13213
|
// hooks/useLibraryItemSvg.ts
|
|
13179
13214
|
import { useEffect as useEffect17, useState as useState12 } from "react";
|
|
13180
|
-
import { COLOR_PALETTE as COLOR_PALETTE4 } from "haoxin-excalidraw-
|
|
13215
|
+
import { COLOR_PALETTE as COLOR_PALETTE4 } from "@haoxin-web/excalidraw-common";
|
|
13181
13216
|
var libraryItemSvgsCache = atom(/* @__PURE__ */ new Map());
|
|
13182
13217
|
var exportLibraryItemToSvg = async (elements) => {
|
|
13183
13218
|
return await exportToSvg2({
|
|
@@ -13797,7 +13832,7 @@ var useHandleLibrary = (opts) => {
|
|
|
13797
13832
|
import clsx20 from "clsx";
|
|
13798
13833
|
|
|
13799
13834
|
// components/LibraryMenuBrowseButton.tsx
|
|
13800
|
-
import { VERSIONS } from "haoxin-excalidraw-
|
|
13835
|
+
import { VERSIONS } from "@haoxin-web/excalidraw-common";
|
|
13801
13836
|
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
13802
13837
|
var LibraryMenuBrowseButton = ({
|
|
13803
13838
|
theme,
|
|
@@ -13855,8 +13890,8 @@ import {
|
|
|
13855
13890
|
useRef as useRef18,
|
|
13856
13891
|
useState as useState17
|
|
13857
13892
|
} from "react";
|
|
13858
|
-
import { MIME_TYPES as MIME_TYPES6, arrayToMap as arrayToMap13 } from "haoxin-excalidraw-
|
|
13859
|
-
import { duplicateElements as duplicateElements2 } from "haoxin-excalidraw-
|
|
13893
|
+
import { MIME_TYPES as MIME_TYPES6, arrayToMap as arrayToMap13 } from "@haoxin-web/excalidraw-common";
|
|
13894
|
+
import { duplicateElements as duplicateElements2 } from "@haoxin-web/excalidraw-element";
|
|
13860
13895
|
|
|
13861
13896
|
// hooks/useScrollPosition.ts
|
|
13862
13897
|
import throttle from "lodash.throttle";
|
|
@@ -13885,7 +13920,7 @@ var useScrollPosition = (elementRef) => {
|
|
|
13885
13920
|
// components/LibraryMenuHeaderContent.tsx
|
|
13886
13921
|
import clsx25 from "clsx";
|
|
13887
13922
|
import { useCallback as useCallback7, useState as useState14 } from "react";
|
|
13888
|
-
import { muteFSAbortError } from "haoxin-excalidraw-
|
|
13923
|
+
import { muteFSAbortError } from "@haoxin-web/excalidraw-common";
|
|
13889
13924
|
|
|
13890
13925
|
// components/ConfirmDialog.tsx
|
|
13891
13926
|
import { flushSync } from "react-dom";
|
|
@@ -13993,7 +14028,7 @@ import {
|
|
|
13993
14028
|
VERSIONS as VERSIONS2,
|
|
13994
14029
|
chunk,
|
|
13995
14030
|
getExportSource
|
|
13996
|
-
} from "haoxin-excalidraw-
|
|
14031
|
+
} from "@haoxin-web/excalidraw-common";
|
|
13997
14032
|
|
|
13998
14033
|
// data/EditorLocalStorage.ts
|
|
13999
14034
|
var EditorLocalStorage = class {
|
|
@@ -14566,7 +14601,7 @@ var PublishLibrary_default = PublishLibrary;
|
|
|
14566
14601
|
// components/dropdownMenu/DropdownMenuContent.tsx
|
|
14567
14602
|
import clsx23 from "clsx";
|
|
14568
14603
|
import { useEffect as useEffect21, useRef as useRef16 } from "react";
|
|
14569
|
-
import { EVENT as EVENT8, KEYS as KEYS30 } from "haoxin-excalidraw-
|
|
14604
|
+
import { EVENT as EVENT8, KEYS as KEYS30 } from "@haoxin-web/excalidraw-common";
|
|
14570
14605
|
|
|
14571
14606
|
// components/Stack.tsx
|
|
14572
14607
|
import { forwardRef as forwardRef2 } from "react";
|
|
@@ -15649,7 +15684,7 @@ var LibraryMenu = memo3(() => {
|
|
|
15649
15684
|
import clsx27 from "clsx";
|
|
15650
15685
|
import { useRef as useRef20 } from "react";
|
|
15651
15686
|
import { createPortal as createPortal2 } from "react-dom";
|
|
15652
|
-
import { KEYS as KEYS31 } from "haoxin-excalidraw-
|
|
15687
|
+
import { KEYS as KEYS31 } from "@haoxin-web/excalidraw-common";
|
|
15653
15688
|
import { jsx as jsx67, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
15654
15689
|
var Modal = (props) => {
|
|
15655
15690
|
const { closeOnClickOutside = true } = props;
|
|
@@ -15804,7 +15839,7 @@ import {
|
|
|
15804
15839
|
|
|
15805
15840
|
// components/Button.tsx
|
|
15806
15841
|
import clsx29 from "clsx";
|
|
15807
|
-
import { composeEventHandlers as composeEventHandlers2 } from "haoxin-excalidraw-
|
|
15842
|
+
import { composeEventHandlers as composeEventHandlers2 } from "@haoxin-web/excalidraw-common";
|
|
15808
15843
|
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
15809
15844
|
var Button = ({
|
|
15810
15845
|
type = "button",
|
|
@@ -15906,7 +15941,7 @@ var TextField = forwardRef3(
|
|
|
15906
15941
|
);
|
|
15907
15942
|
|
|
15908
15943
|
// components/shapes.tsx
|
|
15909
|
-
import { KEYS as KEYS33 } from "haoxin-excalidraw-
|
|
15944
|
+
import { KEYS as KEYS33 } from "@haoxin-web/excalidraw-common";
|
|
15910
15945
|
var SHAPES = [
|
|
15911
15946
|
{
|
|
15912
15947
|
icon: SelectionIcon,
|
|
@@ -16071,19 +16106,19 @@ import {
|
|
|
16071
16106
|
KEYS as KEYS34,
|
|
16072
16107
|
capitalizeString,
|
|
16073
16108
|
isTransparent as isTransparent3
|
|
16074
|
-
} from "haoxin-excalidraw-
|
|
16109
|
+
} from "@haoxin-web/excalidraw-common";
|
|
16075
16110
|
import {
|
|
16076
16111
|
shouldAllowVerticalAlign,
|
|
16077
16112
|
suppportsHorizontalAlign
|
|
16078
|
-
} from "haoxin-excalidraw-
|
|
16113
|
+
} from "@haoxin-web/excalidraw-element";
|
|
16079
16114
|
import {
|
|
16080
16115
|
hasBoundTextElement as hasBoundTextElement4,
|
|
16081
16116
|
isElbowArrow as isElbowArrow5,
|
|
16082
16117
|
isImageElement,
|
|
16083
16118
|
isLinearElement as isLinearElement6,
|
|
16084
16119
|
isTextElement as isTextElement6
|
|
16085
|
-
} from "haoxin-excalidraw-
|
|
16086
|
-
import { hasStrokeColor as hasStrokeColor2, toolIsArrow } from "haoxin-excalidraw-
|
|
16120
|
+
} from "@haoxin-web/excalidraw-element";
|
|
16121
|
+
import { hasStrokeColor as hasStrokeColor2, toolIsArrow } from "@haoxin-web/excalidraw-element";
|
|
16087
16122
|
|
|
16088
16123
|
// context/tunnels.ts
|
|
16089
16124
|
import { createIsolation as createIsolation2 } from "jotai-scope";
|
|
@@ -16265,19 +16300,27 @@ var ShapesSwitcher = ({
|
|
|
16265
16300
|
}
|
|
16266
16301
|
if (value === "freedraw") {
|
|
16267
16302
|
window.dispatchEvent(
|
|
16268
|
-
new CustomEvent("leftflyout:toggle", {
|
|
16303
|
+
new CustomEvent("leftflyout:toggle", {
|
|
16304
|
+
detail: { group: "freedraw" }
|
|
16305
|
+
})
|
|
16269
16306
|
);
|
|
16270
16307
|
} else if (value === "line") {
|
|
16271
16308
|
window.dispatchEvent(
|
|
16272
|
-
new CustomEvent("leftflyout:toggle", {
|
|
16309
|
+
new CustomEvent("leftflyout:toggle", {
|
|
16310
|
+
detail: { group: "line" }
|
|
16311
|
+
})
|
|
16273
16312
|
);
|
|
16274
16313
|
} else if (value === "rectangle") {
|
|
16275
16314
|
window.dispatchEvent(
|
|
16276
|
-
new CustomEvent("leftflyout:toggle", {
|
|
16315
|
+
new CustomEvent("leftflyout:toggle", {
|
|
16316
|
+
detail: { group: "shapes" }
|
|
16317
|
+
})
|
|
16277
16318
|
);
|
|
16278
16319
|
} else if (value === "text") {
|
|
16279
16320
|
window.dispatchEvent(
|
|
16280
|
-
new CustomEvent("leftflyout:toggle", {
|
|
16321
|
+
new CustomEvent("leftflyout:toggle", {
|
|
16322
|
+
detail: { group: "text" }
|
|
16323
|
+
})
|
|
16281
16324
|
);
|
|
16282
16325
|
}
|
|
16283
16326
|
if (value === "selection") {
|
|
@@ -16345,23 +16388,18 @@ var ShapesSwitcher = ({
|
|
|
16345
16388
|
};
|
|
16346
16389
|
var ZoomActions = ({
|
|
16347
16390
|
renderAction,
|
|
16348
|
-
zoom
|
|
16349
|
-
|
|
16350
|
-
|
|
16351
|
-
|
|
16352
|
-
|
|
16353
|
-
|
|
16354
|
-
|
|
16355
|
-
|
|
16356
|
-
|
|
16357
|
-
|
|
16358
|
-
|
|
16359
|
-
|
|
16360
|
-
" ",
|
|
16361
|
-
renderAction("redo")
|
|
16362
|
-
] }) }),
|
|
16363
|
-
/* @__PURE__ */ jsx71("div", { className: "clear-button-container", children: /* @__PURE__ */ jsx71(Tooltip, { label: t("labels.clearCanvas"), children: renderAction("clearCanvas") }) })
|
|
16364
|
-
] });
|
|
16391
|
+
zoom,
|
|
16392
|
+
visible = true
|
|
16393
|
+
}) => {
|
|
16394
|
+
if (!visible) {
|
|
16395
|
+
return null;
|
|
16396
|
+
}
|
|
16397
|
+
return /* @__PURE__ */ jsx71(Stack_default.Col, { gap: 1, className: CLASSES2.ZOOM_ACTIONS, children: /* @__PURE__ */ jsxs39(Stack_default.Row, { align: "center", children: [
|
|
16398
|
+
renderAction("zoomOut"),
|
|
16399
|
+
renderAction("resetZoom"),
|
|
16400
|
+
renderAction("zoomIn")
|
|
16401
|
+
] }) });
|
|
16402
|
+
};
|
|
16365
16403
|
var ExitZenModeAction = ({
|
|
16366
16404
|
actionManager,
|
|
16367
16405
|
showExitZenModeBtn
|
|
@@ -17169,14 +17207,14 @@ import {
|
|
|
17169
17207
|
getSizeFromPoints as getSizeFromPoints2,
|
|
17170
17208
|
randomInteger as randomInteger2,
|
|
17171
17209
|
getUpdatedTimestamp
|
|
17172
|
-
} from "haoxin-excalidraw-
|
|
17210
|
+
} from "@haoxin-web/excalidraw-common";
|
|
17173
17211
|
|
|
17174
17212
|
// ../element/src/shape.ts
|
|
17175
17213
|
import { simplify } from "points-on-curve";
|
|
17176
17214
|
|
|
17177
17215
|
// ../utils/src/shape.ts
|
|
17178
17216
|
import { pointsOnBezierCurves } from "points-on-curve";
|
|
17179
|
-
import { invariant } from "haoxin-excalidraw-
|
|
17217
|
+
import { invariant } from "@haoxin-web/excalidraw-common";
|
|
17180
17218
|
import {
|
|
17181
17219
|
curve,
|
|
17182
17220
|
lineSegment,
|
|
@@ -17193,8 +17231,8 @@ import {
|
|
|
17193
17231
|
vectorAdd,
|
|
17194
17232
|
vectorFromPoint,
|
|
17195
17233
|
vectorScale
|
|
17196
|
-
} from "haoxin-excalidraw-
|
|
17197
|
-
import { getElementAbsoluteCoords as getElementAbsoluteCoords3 } from "haoxin-excalidraw-
|
|
17234
|
+
} from "@haoxin-web/excalidraw-math";
|
|
17235
|
+
import { getElementAbsoluteCoords as getElementAbsoluteCoords3 } from "@haoxin-web/excalidraw-element";
|
|
17198
17236
|
var getCurvePathOps = (shape) => {
|
|
17199
17237
|
if (!shape) {
|
|
17200
17238
|
return [];
|
|
@@ -17212,20 +17250,20 @@ import {
|
|
|
17212
17250
|
pointFrom as pointFrom18,
|
|
17213
17251
|
pointDistance as pointDistance7,
|
|
17214
17252
|
pointRotateRads as pointRotateRads12
|
|
17215
|
-
} from "haoxin-excalidraw-
|
|
17253
|
+
} from "@haoxin-web/excalidraw-math";
|
|
17216
17254
|
import {
|
|
17217
17255
|
ROUGHNESS,
|
|
17218
17256
|
isTransparent as isTransparent5,
|
|
17219
17257
|
assertNever as assertNever3,
|
|
17220
17258
|
COLOR_PALETTE as COLOR_PALETTE5,
|
|
17221
17259
|
LINE_POLYGON_POINT_MERGE_DISTANCE
|
|
17222
|
-
} from "haoxin-excalidraw-
|
|
17260
|
+
} from "@haoxin-web/excalidraw-common";
|
|
17223
17261
|
import { RoughGenerator } from "roughjs/bin/generator";
|
|
17224
17262
|
|
|
17225
17263
|
// ../element/src/renderElement.ts
|
|
17226
17264
|
import rough2 from "roughjs/bin/rough";
|
|
17227
17265
|
import { getStroke } from "perfect-freehand";
|
|
17228
|
-
import { isRightAngleRads } from "haoxin-excalidraw-
|
|
17266
|
+
import { isRightAngleRads } from "@haoxin-web/excalidraw-math";
|
|
17229
17267
|
import {
|
|
17230
17268
|
BOUND_TEXT_PADDING as BOUND_TEXT_PADDING4,
|
|
17231
17269
|
DEFAULT_REDUCED_GLOBAL_ALPHA,
|
|
@@ -17237,7 +17275,7 @@ import {
|
|
|
17237
17275
|
getFontString as getFontString5,
|
|
17238
17276
|
isRTL,
|
|
17239
17277
|
getVerticalOffset
|
|
17240
|
-
} from "haoxin-excalidraw-
|
|
17278
|
+
} from "@haoxin-web/excalidraw-common";
|
|
17241
17279
|
|
|
17242
17280
|
// ../element/src/bounds.ts
|
|
17243
17281
|
import rough from "roughjs/bin/rough";
|
|
@@ -17246,7 +17284,7 @@ import {
|
|
|
17246
17284
|
invariant as invariant7,
|
|
17247
17285
|
rescalePoints,
|
|
17248
17286
|
sizeOf
|
|
17249
|
-
} from "haoxin-excalidraw-
|
|
17287
|
+
} from "@haoxin-web/excalidraw-common";
|
|
17250
17288
|
import {
|
|
17251
17289
|
degreesToRadians,
|
|
17252
17290
|
lineSegment as lineSegment5,
|
|
@@ -17254,7 +17292,7 @@ import {
|
|
|
17254
17292
|
pointFrom as pointFrom14,
|
|
17255
17293
|
pointFromArray as pointFromArray3,
|
|
17256
17294
|
pointRotateRads as pointRotateRads9
|
|
17257
|
-
} from "haoxin-excalidraw-
|
|
17295
|
+
} from "@haoxin-web/excalidraw-math";
|
|
17258
17296
|
import { pointsOnBezierCurves as pointsOnBezierCurves2 } from "points-on-curve";
|
|
17259
17297
|
|
|
17260
17298
|
// ../element/src/linearElementEditor.ts
|
|
@@ -17267,7 +17305,7 @@ import {
|
|
|
17267
17305
|
vectorFromPoint as vectorFromPoint6,
|
|
17268
17306
|
curveLength,
|
|
17269
17307
|
curvePointAtLength
|
|
17270
|
-
} from "haoxin-excalidraw-
|
|
17308
|
+
} from "@haoxin-web/excalidraw-math";
|
|
17271
17309
|
import {
|
|
17272
17310
|
DRAGGING_THRESHOLD,
|
|
17273
17311
|
KEYS as KEYS37,
|
|
@@ -17276,11 +17314,11 @@ import {
|
|
|
17276
17314
|
invariant as invariant6,
|
|
17277
17315
|
tupleToCoors as tupleToCoors4,
|
|
17278
17316
|
viewportCoordsToSceneCoords as viewportCoordsToSceneCoords3
|
|
17279
|
-
} from "haoxin-excalidraw-
|
|
17317
|
+
} from "@haoxin-web/excalidraw-common";
|
|
17280
17318
|
import {
|
|
17281
17319
|
deconstructLinearOrFreeDrawElement as deconstructLinearOrFreeDrawElement2,
|
|
17282
17320
|
isPathALoop as isPathALoop3
|
|
17283
|
-
} from "haoxin-excalidraw-
|
|
17321
|
+
} from "@haoxin-web/excalidraw-element";
|
|
17284
17322
|
|
|
17285
17323
|
// ../element/src/binding.ts
|
|
17286
17324
|
import {
|
|
@@ -17291,7 +17329,7 @@ import {
|
|
|
17291
17329
|
invariant as invariant5,
|
|
17292
17330
|
isDevEnv as isDevEnv7,
|
|
17293
17331
|
isTestEnv as isTestEnv4
|
|
17294
|
-
} from "haoxin-excalidraw-
|
|
17332
|
+
} from "@haoxin-web/excalidraw-common";
|
|
17295
17333
|
import {
|
|
17296
17334
|
lineSegment as lineSegment4,
|
|
17297
17335
|
pointFrom as pointFrom12,
|
|
@@ -17307,10 +17345,10 @@ import {
|
|
|
17307
17345
|
pointsEqual as pointsEqual5,
|
|
17308
17346
|
lineSegmentIntersectionPoints as lineSegmentIntersectionPoints2,
|
|
17309
17347
|
PRECISION as PRECISION2
|
|
17310
|
-
} from "haoxin-excalidraw-
|
|
17348
|
+
} from "@haoxin-web/excalidraw-math";
|
|
17311
17349
|
|
|
17312
17350
|
// ../element/src/collision.ts
|
|
17313
|
-
import { isTransparent as isTransparent4 } from "haoxin-excalidraw-
|
|
17351
|
+
import { isTransparent as isTransparent4 } from "@haoxin-web/excalidraw-common";
|
|
17314
17352
|
import {
|
|
17315
17353
|
curveIntersectLineSegment,
|
|
17316
17354
|
isPointWithinBounds,
|
|
@@ -17323,11 +17361,11 @@ import {
|
|
|
17323
17361
|
vectorFromPoint as vectorFromPoint2,
|
|
17324
17362
|
vectorNormalize,
|
|
17325
17363
|
vectorScale as vectorScale2
|
|
17326
|
-
} from "haoxin-excalidraw-
|
|
17364
|
+
} from "@haoxin-web/excalidraw-math";
|
|
17327
17365
|
import {
|
|
17328
17366
|
ellipse as ellipse2,
|
|
17329
17367
|
ellipseSegmentInterceptPoints
|
|
17330
|
-
} from "haoxin-excalidraw-
|
|
17368
|
+
} from "@haoxin-web/excalidraw-math/ellipse";
|
|
17331
17369
|
|
|
17332
17370
|
// ../element/src/utils.ts
|
|
17333
17371
|
import {
|
|
@@ -17335,7 +17373,7 @@ import {
|
|
|
17335
17373
|
DEFAULT_PROPORTIONAL_RADIUS,
|
|
17336
17374
|
LINE_CONFIRM_THRESHOLD,
|
|
17337
17375
|
ROUNDNESS as ROUNDNESS4
|
|
17338
|
-
} from "haoxin-excalidraw-
|
|
17376
|
+
} from "@haoxin-web/excalidraw-common";
|
|
17339
17377
|
import {
|
|
17340
17378
|
curve as curve2,
|
|
17341
17379
|
curveCatmullRomCubicApproxPoints,
|
|
@@ -17345,7 +17383,7 @@ import {
|
|
|
17345
17383
|
pointFrom as pointFrom7,
|
|
17346
17384
|
pointFromArray as pointFromArray2,
|
|
17347
17385
|
rectangle
|
|
17348
|
-
} from "haoxin-excalidraw-
|
|
17386
|
+
} from "@haoxin-web/excalidraw-math";
|
|
17349
17387
|
var isPathALoop2 = (points, zoomValue = 1) => {
|
|
17350
17388
|
if (points.length >= 3) {
|
|
17351
17389
|
const [first, last] = [points[0], points[points.length - 1]];
|
|
@@ -17370,8 +17408,8 @@ var getCornerRadius = (x, element) => {
|
|
|
17370
17408
|
};
|
|
17371
17409
|
|
|
17372
17410
|
// ../element/src/typeChecks.ts
|
|
17373
|
-
import { ROUNDNESS as ROUNDNESS5 } from "haoxin-excalidraw-
|
|
17374
|
-
import { pointsEqual } from "haoxin-excalidraw-
|
|
17411
|
+
import { ROUNDNESS as ROUNDNESS5 } from "@haoxin-web/excalidraw-common";
|
|
17412
|
+
import { pointsEqual } from "@haoxin-web/excalidraw-math";
|
|
17375
17413
|
var isEmbeddableElement3 = (element) => {
|
|
17376
17414
|
return !!element && element.type === "embeddable";
|
|
17377
17415
|
};
|
|
@@ -17414,8 +17452,8 @@ import {
|
|
|
17414
17452
|
getFontString as getFontString4,
|
|
17415
17453
|
isProdEnv as isProdEnv2,
|
|
17416
17454
|
invariant as invariant2
|
|
17417
|
-
} from "haoxin-excalidraw-
|
|
17418
|
-
import { pointFrom as pointFrom8, pointRotateRads as pointRotateRads3 } from "haoxin-excalidraw-
|
|
17455
|
+
} from "@haoxin-web/excalidraw-common";
|
|
17456
|
+
import { pointFrom as pointFrom8, pointRotateRads as pointRotateRads3 } from "@haoxin-web/excalidraw-math";
|
|
17419
17457
|
|
|
17420
17458
|
// ../element/src/textMeasurements.ts
|
|
17421
17459
|
import {
|
|
@@ -17425,22 +17463,22 @@ import {
|
|
|
17425
17463
|
getFontString as getFontString3,
|
|
17426
17464
|
isTestEnv,
|
|
17427
17465
|
normalizeEOL
|
|
17428
|
-
} from "haoxin-excalidraw-
|
|
17466
|
+
} from "@haoxin-web/excalidraw-common";
|
|
17429
17467
|
var DUMMY_TEXT = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase();
|
|
17430
17468
|
|
|
17431
17469
|
// ../element/src/textWrapping.ts
|
|
17432
|
-
import { isDevEnv as isDevEnv4, isTestEnv as isTestEnv2 } from "haoxin-excalidraw-
|
|
17470
|
+
import { isDevEnv as isDevEnv4, isTestEnv as isTestEnv2 } from "@haoxin-web/excalidraw-common";
|
|
17433
17471
|
|
|
17434
17472
|
// ../element/src/distance.ts
|
|
17435
17473
|
import {
|
|
17436
17474
|
curvePointDistance,
|
|
17437
17475
|
distanceToLineSegment,
|
|
17438
17476
|
pointRotateRads as pointRotateRads4
|
|
17439
|
-
} from "haoxin-excalidraw-
|
|
17440
|
-
import { ellipse, ellipseDistanceFromPoint } from "haoxin-excalidraw-
|
|
17477
|
+
} from "@haoxin-web/excalidraw-math";
|
|
17478
|
+
import { ellipse, ellipseDistanceFromPoint } from "@haoxin-web/excalidraw-math/ellipse";
|
|
17441
17479
|
|
|
17442
17480
|
// ../element/src/heading.ts
|
|
17443
|
-
import { invariant as invariant3, isDevEnv as isDevEnv5, isTestEnv as isTestEnv3 } from "haoxin-excalidraw-
|
|
17481
|
+
import { invariant as invariant3, isDevEnv as isDevEnv5, isTestEnv as isTestEnv3 } from "@haoxin-web/excalidraw-common";
|
|
17444
17482
|
import {
|
|
17445
17483
|
pointFrom as pointFrom10,
|
|
17446
17484
|
pointFromVector as pointFromVector3,
|
|
@@ -17451,7 +17489,7 @@ import {
|
|
|
17451
17489
|
vectorCross,
|
|
17452
17490
|
vectorFromPoint as vectorFromPoint3,
|
|
17453
17491
|
vectorScale as vectorScale3
|
|
17454
|
-
} from "haoxin-excalidraw-
|
|
17492
|
+
} from "@haoxin-web/excalidraw-math";
|
|
17455
17493
|
var HEADING_RIGHT = [1, 0];
|
|
17456
17494
|
var HEADING_DOWN = [0, 1];
|
|
17457
17495
|
var HEADING_LEFT = [-1, 0];
|
|
@@ -17486,7 +17524,7 @@ import {
|
|
|
17486
17524
|
vectorCross as vectorCross2,
|
|
17487
17525
|
vectorFromPoint as vectorFromPoint4,
|
|
17488
17526
|
vectorScale as vectorScale4
|
|
17489
|
-
} from "haoxin-excalidraw-
|
|
17527
|
+
} from "@haoxin-web/excalidraw-math";
|
|
17490
17528
|
import {
|
|
17491
17529
|
BinaryHeap,
|
|
17492
17530
|
invariant as invariant4,
|
|
@@ -17495,19 +17533,19 @@ import {
|
|
|
17495
17533
|
getSizeFromPoints,
|
|
17496
17534
|
isDevEnv as isDevEnv6,
|
|
17497
17535
|
arrayToMap as arrayToMap14
|
|
17498
|
-
} from "haoxin-excalidraw-
|
|
17536
|
+
} from "@haoxin-web/excalidraw-common";
|
|
17499
17537
|
|
|
17500
17538
|
// ../element/src/sizeHelpers.ts
|
|
17501
17539
|
import {
|
|
17502
17540
|
SHIFT_LOCKING_ANGLE,
|
|
17503
17541
|
viewportCoordsToSceneCoords as viewportCoordsToSceneCoords2
|
|
17504
|
-
} from "haoxin-excalidraw-
|
|
17542
|
+
} from "@haoxin-web/excalidraw-common";
|
|
17505
17543
|
import {
|
|
17506
17544
|
normalizeRadians,
|
|
17507
17545
|
radiansBetweenAngles,
|
|
17508
17546
|
radiansDifference
|
|
17509
|
-
} from "haoxin-excalidraw-
|
|
17510
|
-
import { pointsEqual as pointsEqual6 } from "haoxin-excalidraw-
|
|
17547
|
+
} from "@haoxin-web/excalidraw-math";
|
|
17548
|
+
import { pointsEqual as pointsEqual6 } from "@haoxin-web/excalidraw-math";
|
|
17511
17549
|
|
|
17512
17550
|
// ../element/src/bounds.ts
|
|
17513
17551
|
var getDiamondPoints = (element) => {
|
|
@@ -17675,34 +17713,34 @@ import {
|
|
|
17675
17713
|
pointFromVector as pointFromVector5,
|
|
17676
17714
|
clamp as clamp4,
|
|
17677
17715
|
isCloseTo
|
|
17678
|
-
} from "haoxin-excalidraw-
|
|
17716
|
+
} from "@haoxin-web/excalidraw-math";
|
|
17679
17717
|
|
|
17680
17718
|
// ../element/src/frame.ts
|
|
17681
|
-
import { arrayToMap as arrayToMap19 } from "haoxin-excalidraw-
|
|
17682
|
-
import { isPointWithinBounds as isPointWithinBounds2, pointFrom as pointFrom17 } from "haoxin-excalidraw-
|
|
17719
|
+
import { arrayToMap as arrayToMap19 } from "@haoxin-web/excalidraw-common";
|
|
17720
|
+
import { isPointWithinBounds as isPointWithinBounds2, pointFrom as pointFrom17 } from "@haoxin-web/excalidraw-math";
|
|
17683
17721
|
|
|
17684
17722
|
// ../utils/src/bbox.ts
|
|
17685
17723
|
import {
|
|
17686
17724
|
vectorCross as vectorCross4,
|
|
17687
17725
|
vectorFromPoint as vectorFromPoint8
|
|
17688
|
-
} from "haoxin-excalidraw-
|
|
17726
|
+
} from "@haoxin-web/excalidraw-math";
|
|
17689
17727
|
|
|
17690
17728
|
// ../utils/src/withinBounds.ts
|
|
17691
|
-
import { arrayToMap as arrayToMap17 } from "haoxin-excalidraw-
|
|
17692
|
-
import { getElementBounds as getElementBounds2 } from "haoxin-excalidraw-
|
|
17729
|
+
import { arrayToMap as arrayToMap17 } from "@haoxin-web/excalidraw-common";
|
|
17730
|
+
import { getElementBounds as getElementBounds2 } from "@haoxin-web/excalidraw-element";
|
|
17693
17731
|
import {
|
|
17694
17732
|
isArrowElement as isArrowElement7,
|
|
17695
17733
|
isExcalidrawElement as isExcalidrawElement2,
|
|
17696
17734
|
isFreeDrawElement as isFreeDrawElement3,
|
|
17697
17735
|
isLinearElement as isLinearElement8,
|
|
17698
17736
|
isTextElement as isTextElement8
|
|
17699
|
-
} from "haoxin-excalidraw-
|
|
17737
|
+
} from "@haoxin-web/excalidraw-element";
|
|
17700
17738
|
import {
|
|
17701
17739
|
rangeIncludesValue,
|
|
17702
17740
|
pointFrom as pointFrom16,
|
|
17703
17741
|
pointRotateRads as pointRotateRads11,
|
|
17704
17742
|
rangeInclusive
|
|
17705
|
-
} from "haoxin-excalidraw-
|
|
17743
|
+
} from "@haoxin-web/excalidraw-math";
|
|
17706
17744
|
var getNonLinearElementRelativePoints = (element) => {
|
|
17707
17745
|
if (element.type === "diamond") {
|
|
17708
17746
|
return [
|
|
@@ -17828,7 +17866,7 @@ var elementsOverlappingBBox = ({
|
|
|
17828
17866
|
};
|
|
17829
17867
|
|
|
17830
17868
|
// ../element/src/selection.ts
|
|
17831
|
-
import { arrayToMap as arrayToMap18, isShallowEqual as isShallowEqual2 } from "haoxin-excalidraw-
|
|
17869
|
+
import { arrayToMap as arrayToMap18, isShallowEqual as isShallowEqual2 } from "@haoxin-web/excalidraw-common";
|
|
17832
17870
|
|
|
17833
17871
|
// ../element/src/groups.ts
|
|
17834
17872
|
var selectGroupsForSelectedElements4 = function() {
|
|
@@ -18818,8 +18856,8 @@ import {
|
|
|
18818
18856
|
CANVAS_SEARCH_TAB,
|
|
18819
18857
|
CLASSES as CLASSES3,
|
|
18820
18858
|
DEFAULT_SIDEBAR as DEFAULT_SIDEBAR3
|
|
18821
|
-
} from "haoxin-excalidraw-
|
|
18822
|
-
import { CaptureUpdateAction as CaptureUpdateAction29 } from "haoxin-excalidraw-
|
|
18859
|
+
} from "@haoxin-web/excalidraw-common";
|
|
18860
|
+
import { CaptureUpdateAction as CaptureUpdateAction29 } from "@haoxin-web/excalidraw-element";
|
|
18823
18861
|
var actionToggleSearchMenu = register({
|
|
18824
18862
|
name: "searchMenu",
|
|
18825
18863
|
icon: searchIcon,
|
|
@@ -18860,8 +18898,8 @@ var actionToggleSearchMenu = register({
|
|
|
18860
18898
|
});
|
|
18861
18899
|
|
|
18862
18900
|
// actions/actionCropEditor.tsx
|
|
18863
|
-
import { isImageElement as isImageElement3 } from "haoxin-excalidraw-
|
|
18864
|
-
import { CaptureUpdateAction as CaptureUpdateAction30 } from "haoxin-excalidraw-
|
|
18901
|
+
import { isImageElement as isImageElement3 } from "@haoxin-web/excalidraw-element";
|
|
18902
|
+
import { CaptureUpdateAction as CaptureUpdateAction30 } from "@haoxin-web/excalidraw-element";
|
|
18865
18903
|
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
18866
18904
|
var actionToggleCropEditor = register({
|
|
18867
18905
|
name: "cropEditor",
|
|
@@ -18907,19 +18945,19 @@ var actionToggleCropEditor = register({
|
|
|
18907
18945
|
});
|
|
18908
18946
|
|
|
18909
18947
|
// actions/actionFrame.ts
|
|
18910
|
-
import { getNonDeletedElements as getNonDeletedElements13 } from "haoxin-excalidraw-
|
|
18911
|
-
import { mutateElement as mutateElement4 } from "haoxin-excalidraw-
|
|
18912
|
-
import { newFrameElement } from "haoxin-excalidraw-
|
|
18913
|
-
import { isFrameLikeElement as isFrameLikeElement8 } from "haoxin-excalidraw-
|
|
18948
|
+
import { getNonDeletedElements as getNonDeletedElements13 } from "@haoxin-web/excalidraw-element";
|
|
18949
|
+
import { mutateElement as mutateElement4 } from "@haoxin-web/excalidraw-element";
|
|
18950
|
+
import { newFrameElement } from "@haoxin-web/excalidraw-element";
|
|
18951
|
+
import { isFrameLikeElement as isFrameLikeElement8 } from "@haoxin-web/excalidraw-element";
|
|
18914
18952
|
import {
|
|
18915
18953
|
addElementsToFrame,
|
|
18916
18954
|
removeAllElementsFromFrame
|
|
18917
|
-
} from "haoxin-excalidraw-
|
|
18918
|
-
import { getFrameChildren as getFrameChildren3 } from "haoxin-excalidraw-
|
|
18919
|
-
import { KEYS as KEYS39, updateActiveTool as updateActiveTool6 } from "haoxin-excalidraw-
|
|
18920
|
-
import { getElementsInGroup as getElementsInGroup4 } from "haoxin-excalidraw-
|
|
18921
|
-
import { getCommonBounds as getCommonBounds3 } from "haoxin-excalidraw-
|
|
18922
|
-
import { CaptureUpdateAction as CaptureUpdateAction31 } from "haoxin-excalidraw-
|
|
18955
|
+
} from "@haoxin-web/excalidraw-element";
|
|
18956
|
+
import { getFrameChildren as getFrameChildren3 } from "@haoxin-web/excalidraw-element";
|
|
18957
|
+
import { KEYS as KEYS39, updateActiveTool as updateActiveTool6 } from "@haoxin-web/excalidraw-common";
|
|
18958
|
+
import { getElementsInGroup as getElementsInGroup4 } from "@haoxin-web/excalidraw-element";
|
|
18959
|
+
import { getCommonBounds as getCommonBounds3 } from "@haoxin-web/excalidraw-element";
|
|
18960
|
+
import { CaptureUpdateAction as CaptureUpdateAction31 } from "@haoxin-web/excalidraw-element";
|
|
18923
18961
|
var isSingleFrameSelected = (appState, app) => {
|
|
18924
18962
|
const selectedElements = app.scene.getSelectedElements(appState);
|
|
18925
18963
|
return selectedElements.length === 1 && isFrameLikeElement8(selectedElements[0]);
|
|
@@ -19076,17 +19114,17 @@ var actionWrapSelectionInFrame = register({
|
|
|
19076
19114
|
});
|
|
19077
19115
|
|
|
19078
19116
|
// actions/actionHistory.tsx
|
|
19079
|
-
import { isWindows, KEYS as KEYS40, matchKey, arrayToMap as arrayToMap21 } from "haoxin-excalidraw-
|
|
19080
|
-
import { CaptureUpdateAction as CaptureUpdateAction33 } from "haoxin-excalidraw-
|
|
19081
|
-
import { orderByFractionalIndex } from "haoxin-excalidraw-
|
|
19117
|
+
import { isWindows, KEYS as KEYS40, matchKey, arrayToMap as arrayToMap21 } from "@haoxin-web/excalidraw-common";
|
|
19118
|
+
import { CaptureUpdateAction as CaptureUpdateAction33 } from "@haoxin-web/excalidraw-element";
|
|
19119
|
+
import { orderByFractionalIndex } from "@haoxin-web/excalidraw-element";
|
|
19082
19120
|
|
|
19083
19121
|
// history.ts
|
|
19084
|
-
import { Emitter as Emitter2 } from "haoxin-excalidraw-
|
|
19122
|
+
import { Emitter as Emitter2 } from "@haoxin-web/excalidraw-common";
|
|
19085
19123
|
import {
|
|
19086
19124
|
CaptureUpdateAction as CaptureUpdateAction32,
|
|
19087
19125
|
StoreChange,
|
|
19088
19126
|
StoreDelta
|
|
19089
|
-
} from "haoxin-excalidraw-
|
|
19127
|
+
} from "@haoxin-web/excalidraw-element";
|
|
19090
19128
|
var HistoryDelta = class extends StoreDelta {
|
|
19091
19129
|
/**
|
|
19092
19130
|
* Apply the delta to the passed elements and appState, does not modify the snapshot.
|
|
@@ -19362,11 +19400,11 @@ var createRedoAction = (history) => ({
|
|
|
19362
19400
|
});
|
|
19363
19401
|
|
|
19364
19402
|
// actions/actionTextAutoResize.ts
|
|
19365
|
-
import { getFontString as getFontString6 } from "haoxin-excalidraw-
|
|
19366
|
-
import { newElementWith as newElementWith10 } from "haoxin-excalidraw-
|
|
19367
|
-
import { measureText as measureText4 } from "haoxin-excalidraw-
|
|
19368
|
-
import { isTextElement as isTextElement9 } from "haoxin-excalidraw-
|
|
19369
|
-
import { CaptureUpdateAction as CaptureUpdateAction34 } from "haoxin-excalidraw-
|
|
19403
|
+
import { getFontString as getFontString6 } from "@haoxin-web/excalidraw-common";
|
|
19404
|
+
import { newElementWith as newElementWith10 } from "@haoxin-web/excalidraw-element";
|
|
19405
|
+
import { measureText as measureText4 } from "@haoxin-web/excalidraw-element";
|
|
19406
|
+
import { isTextElement as isTextElement9 } from "@haoxin-web/excalidraw-element";
|
|
19407
|
+
import { CaptureUpdateAction as CaptureUpdateAction34 } from "@haoxin-web/excalidraw-element";
|
|
19370
19408
|
var actionTextAutoResize = register({
|
|
19371
19409
|
name: "autoResize",
|
|
19372
19410
|
label: "labels.autoResize",
|
|
@@ -19402,8 +19440,8 @@ var actionTextAutoResize = register({
|
|
|
19402
19440
|
});
|
|
19403
19441
|
|
|
19404
19442
|
// actions/actionToggleViewMode.tsx
|
|
19405
|
-
import { CODES as CODES11, KEYS as KEYS41 } from "haoxin-excalidraw-
|
|
19406
|
-
import { CaptureUpdateAction as CaptureUpdateAction35 } from "haoxin-excalidraw-
|
|
19443
|
+
import { CODES as CODES11, KEYS as KEYS41 } from "@haoxin-web/excalidraw-common";
|
|
19444
|
+
import { CaptureUpdateAction as CaptureUpdateAction35 } from "@haoxin-web/excalidraw-element";
|
|
19407
19445
|
var actionToggleViewMode = register({
|
|
19408
19446
|
name: "viewMode",
|
|
19409
19447
|
label: "labels.viewMode",
|
|
@@ -19430,7 +19468,7 @@ var actionToggleViewMode = register({
|
|
|
19430
19468
|
});
|
|
19431
19469
|
|
|
19432
19470
|
// actions/manager.tsx
|
|
19433
|
-
import { isPromiseLike as isPromiseLike3 } from "haoxin-excalidraw-
|
|
19471
|
+
import { isPromiseLike as isPromiseLike3 } from "@haoxin-web/excalidraw-common";
|
|
19434
19472
|
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
19435
19473
|
var trackAction = (action, source, appState, elements, app, value) => {
|
|
19436
19474
|
if (action.trackEvent) {
|
|
@@ -19462,12 +19500,12 @@ var ActionManager = class {
|
|
|
19462
19500
|
*/
|
|
19463
19501
|
__publicField(this, "renderAction", (name, data) => {
|
|
19464
19502
|
const canvasActions = this.app.props.UIOptions.canvasActions;
|
|
19465
|
-
|
|
19466
|
-
|
|
19503
|
+
const elements = this.getElementsIncludingDeleted();
|
|
19504
|
+
const appState = this.getAppState();
|
|
19505
|
+
const action = this.actions[name];
|
|
19506
|
+
if (action && "PanelComponent" in action && (name in canvasActions ? canvasActions[name] : true) && (!action.predicate || action.predicate(elements, appState, this.app.props, this.app))) {
|
|
19467
19507
|
const PanelComponent = action.PanelComponent;
|
|
19468
19508
|
PanelComponent.displayName = "PanelComponent";
|
|
19469
|
-
const elements = this.getElementsIncludingDeleted();
|
|
19470
|
-
const appState = this.getAppState();
|
|
19471
19509
|
const updateData = (formState) => {
|
|
19472
19510
|
trackAction(action, "ui", appState, elements, this.app, formState);
|
|
19473
19511
|
this.updater(
|
|
@@ -19520,13 +19558,11 @@ var ActionManager = class {
|
|
|
19520
19558
|
}
|
|
19521
19559
|
handleKeyDown(event) {
|
|
19522
19560
|
const canvasActions = this.app.props.UIOptions.canvasActions;
|
|
19561
|
+
const elements = this.getElementsIncludingDeleted();
|
|
19562
|
+
const appState = this.getAppState();
|
|
19563
|
+
const appProps = this.app.props;
|
|
19523
19564
|
const data = Object.values(this.actions).sort((a, b) => (b.keyPriority || 0) - (a.keyPriority || 0)).filter(
|
|
19524
|
-
(action2) => (action2.name in canvasActions ? canvasActions[action2.name] : true) && action2.keyTest && action2.keyTest(
|
|
19525
|
-
event,
|
|
19526
|
-
this.getAppState(),
|
|
19527
|
-
this.getElementsIncludingDeleted(),
|
|
19528
|
-
this.app
|
|
19529
|
-
)
|
|
19565
|
+
(action2) => (action2.name in canvasActions ? canvasActions[action2.name] : true) && action2.keyTest && (!action2.predicate || action2.predicate(elements, appState, appProps, this.app)) && action2.keyTest(event, appState, elements, this.app)
|
|
19530
19566
|
);
|
|
19531
19567
|
if (data.length !== 1) {
|
|
19532
19568
|
if (data.length > 1) {
|
|
@@ -19535,11 +19571,9 @@ var ActionManager = class {
|
|
|
19535
19571
|
return false;
|
|
19536
19572
|
}
|
|
19537
19573
|
const action = data[0];
|
|
19538
|
-
if (
|
|
19574
|
+
if (appState.viewModeEnabled && action.viewMode !== true) {
|
|
19539
19575
|
return false;
|
|
19540
19576
|
}
|
|
19541
|
-
const elements = this.getElementsIncludingDeleted();
|
|
19542
|
-
const appState = this.getAppState();
|
|
19543
19577
|
const value = null;
|
|
19544
19578
|
trackAction(action, "keyboard", appState, elements, this.app, null);
|
|
19545
19579
|
event.preventDefault();
|
|
@@ -19631,19 +19665,19 @@ import {
|
|
|
19631
19665
|
rangeInclusive as rangeInclusive2,
|
|
19632
19666
|
rangeIntersection,
|
|
19633
19667
|
rangesOverlap
|
|
19634
|
-
} from "haoxin-excalidraw-
|
|
19635
|
-
import { TOOL_TYPE, KEYS as KEYS42 } from "haoxin-excalidraw-
|
|
19668
|
+
} from "@haoxin-web/excalidraw-math";
|
|
19669
|
+
import { TOOL_TYPE, KEYS as KEYS42 } from "@haoxin-web/excalidraw-common";
|
|
19636
19670
|
import {
|
|
19637
19671
|
getCommonBounds as getCommonBounds4,
|
|
19638
19672
|
getDraggedElementsBounds,
|
|
19639
19673
|
getElementAbsoluteCoords as getElementAbsoluteCoords5
|
|
19640
|
-
} from "haoxin-excalidraw-
|
|
19641
|
-
import { isBoundToContainer as isBoundToContainer5 } from "haoxin-excalidraw-
|
|
19642
|
-
import { getMaximumGroups } from "haoxin-excalidraw-
|
|
19674
|
+
} from "@haoxin-web/excalidraw-element";
|
|
19675
|
+
import { isBoundToContainer as isBoundToContainer5 } from "@haoxin-web/excalidraw-element";
|
|
19676
|
+
import { getMaximumGroups } from "@haoxin-web/excalidraw-element";
|
|
19643
19677
|
import {
|
|
19644
19678
|
getSelectedElements as getSelectedElements4,
|
|
19645
19679
|
getVisibleAndNonSelectedElements
|
|
19646
|
-
} from "haoxin-excalidraw-
|
|
19680
|
+
} from "@haoxin-web/excalidraw-element";
|
|
19647
19681
|
var SNAP_DISTANCE = 8;
|
|
19648
19682
|
var VISIBLE_GAPS_LIMIT_PER_AXIS = 99999;
|
|
19649
19683
|
var getSnapDistance = (zoomValue) => {
|
|
@@ -20601,7 +20635,7 @@ var isActiveToolNonLinearSnappable = (activeToolType) => {
|
|
|
20601
20635
|
};
|
|
20602
20636
|
|
|
20603
20637
|
// data/transform.ts
|
|
20604
|
-
import { pointFrom as pointFrom20 } from "haoxin-excalidraw-
|
|
20638
|
+
import { pointFrom as pointFrom20 } from "@haoxin-web/excalidraw-math";
|
|
20605
20639
|
import {
|
|
20606
20640
|
DEFAULT_FONT_FAMILY as DEFAULT_FONT_FAMILY5,
|
|
20607
20641
|
DEFAULT_FONT_SIZE as DEFAULT_FONT_SIZE6,
|
|
@@ -20616,8 +20650,8 @@ import {
|
|
|
20616
20650
|
isDevEnv as isDevEnv8,
|
|
20617
20651
|
toBrandedType,
|
|
20618
20652
|
getLineHeight as getLineHeight3
|
|
20619
|
-
} from "haoxin-excalidraw-
|
|
20620
|
-
import { bindLinearElement as bindLinearElement2 } from "haoxin-excalidraw-
|
|
20653
|
+
} from "@haoxin-web/excalidraw-common";
|
|
20654
|
+
import { bindLinearElement as bindLinearElement2 } from "@haoxin-web/excalidraw-element";
|
|
20621
20655
|
import {
|
|
20622
20656
|
newArrowElement as newArrowElement2,
|
|
20623
20657
|
newElement as newElement4,
|
|
@@ -20626,14 +20660,14 @@ import {
|
|
|
20626
20660
|
newLinearElement as newLinearElement3,
|
|
20627
20661
|
newMagicFrameElement,
|
|
20628
20662
|
newTextElement as newTextElement2
|
|
20629
|
-
} from "haoxin-excalidraw-
|
|
20630
|
-
import { measureText as measureText5, normalizeText } from "haoxin-excalidraw-
|
|
20631
|
-
import { isArrowElement as isArrowElement8 } from "haoxin-excalidraw-
|
|
20632
|
-
import { syncInvalidIndices } from "haoxin-excalidraw-
|
|
20633
|
-
import { redrawTextBoundingBox as redrawTextBoundingBox5 } from "haoxin-excalidraw-
|
|
20634
|
-
import { LinearElementEditor as LinearElementEditor8 } from "haoxin-excalidraw-
|
|
20635
|
-
import { getCommonBounds as getCommonBounds5 } from "haoxin-excalidraw-
|
|
20636
|
-
import { Scene } from "haoxin-excalidraw-
|
|
20663
|
+
} from "@haoxin-web/excalidraw-element";
|
|
20664
|
+
import { measureText as measureText5, normalizeText } from "@haoxin-web/excalidraw-element";
|
|
20665
|
+
import { isArrowElement as isArrowElement8 } from "@haoxin-web/excalidraw-element";
|
|
20666
|
+
import { syncInvalidIndices } from "@haoxin-web/excalidraw-element";
|
|
20667
|
+
import { redrawTextBoundingBox as redrawTextBoundingBox5 } from "@haoxin-web/excalidraw-element";
|
|
20668
|
+
import { LinearElementEditor as LinearElementEditor8 } from "@haoxin-web/excalidraw-element";
|
|
20669
|
+
import { getCommonBounds as getCommonBounds5 } from "@haoxin-web/excalidraw-element";
|
|
20670
|
+
import { Scene } from "@haoxin-web/excalidraw-element";
|
|
20637
20671
|
var DEFAULT_LINEAR_ELEMENT_PROPS = {
|
|
20638
20672
|
width: 100,
|
|
20639
20673
|
height: 0
|
|
@@ -21136,14 +21170,14 @@ var convertToExcalidrawElements = (elementsSkeleton, opts) => {
|
|
|
21136
21170
|
};
|
|
21137
21171
|
|
|
21138
21172
|
// scene/Renderer.ts
|
|
21139
|
-
import { isElementInViewport as isElementInViewport2 } from "haoxin-excalidraw-
|
|
21140
|
-
import { memoize, toBrandedType as toBrandedType2 } from "haoxin-excalidraw-
|
|
21173
|
+
import { isElementInViewport as isElementInViewport2 } from "@haoxin-web/excalidraw-element";
|
|
21174
|
+
import { memoize, toBrandedType as toBrandedType2 } from "@haoxin-web/excalidraw-common";
|
|
21141
21175
|
|
|
21142
21176
|
// renderer/interactiveScene.ts
|
|
21143
21177
|
import {
|
|
21144
21178
|
pointFrom as pointFrom22,
|
|
21145
21179
|
pointsEqual as pointsEqual8
|
|
21146
|
-
} from "haoxin-excalidraw-
|
|
21180
|
+
} from "@haoxin-web/excalidraw-math";
|
|
21147
21181
|
import oc2 from "open-color";
|
|
21148
21182
|
import {
|
|
21149
21183
|
arrayToMap as arrayToMap23,
|
|
@@ -21152,15 +21186,15 @@ import {
|
|
|
21152
21186
|
invariant as invariant9,
|
|
21153
21187
|
THEME as THEME11,
|
|
21154
21188
|
throttleRAF
|
|
21155
|
-
} from "haoxin-excalidraw-
|
|
21156
|
-
import { FIXED_BINDING_DISTANCE as FIXED_BINDING_DISTANCE2, maxBindingGap } from "haoxin-excalidraw-
|
|
21157
|
-
import { LinearElementEditor as LinearElementEditor9 } from "haoxin-excalidraw-
|
|
21189
|
+
} from "@haoxin-web/excalidraw-common";
|
|
21190
|
+
import { FIXED_BINDING_DISTANCE as FIXED_BINDING_DISTANCE2, maxBindingGap } from "@haoxin-web/excalidraw-element";
|
|
21191
|
+
import { LinearElementEditor as LinearElementEditor9 } from "@haoxin-web/excalidraw-element";
|
|
21158
21192
|
import {
|
|
21159
21193
|
getOmitSidesForDevice,
|
|
21160
21194
|
getTransformHandles,
|
|
21161
21195
|
getTransformHandlesFromCoords,
|
|
21162
21196
|
shouldShowBoundingBox
|
|
21163
|
-
} from "haoxin-excalidraw-
|
|
21197
|
+
} from "@haoxin-web/excalidraw-element";
|
|
21164
21198
|
import {
|
|
21165
21199
|
isElbowArrow as isElbowArrow8,
|
|
21166
21200
|
isFrameLikeElement as isFrameLikeElement9,
|
|
@@ -21168,19 +21202,19 @@ import {
|
|
|
21168
21202
|
isLinearElement as isLinearElement10,
|
|
21169
21203
|
isLineElement as isLineElement5,
|
|
21170
21204
|
isTextElement as isTextElement10
|
|
21171
|
-
} from "haoxin-excalidraw-
|
|
21172
|
-
import { renderSelectionElement } from "haoxin-excalidraw-
|
|
21205
|
+
} from "@haoxin-web/excalidraw-element";
|
|
21206
|
+
import { renderSelectionElement } from "@haoxin-web/excalidraw-element";
|
|
21173
21207
|
import {
|
|
21174
21208
|
getElementsInGroup as getElementsInGroup5,
|
|
21175
21209
|
getSelectedGroupIds as getSelectedGroupIds2,
|
|
21176
21210
|
isSelectedViaGroup,
|
|
21177
21211
|
selectGroupsFromGivenElements as selectGroupsFromGivenElements3
|
|
21178
|
-
} from "haoxin-excalidraw-
|
|
21179
|
-
import { getCommonBounds as getCommonBounds7, getElementAbsoluteCoords as getElementAbsoluteCoords6 } from "haoxin-excalidraw-
|
|
21212
|
+
} from "@haoxin-web/excalidraw-element";
|
|
21213
|
+
import { getCommonBounds as getCommonBounds7, getElementAbsoluteCoords as getElementAbsoluteCoords6 } from "@haoxin-web/excalidraw-element";
|
|
21180
21214
|
|
|
21181
21215
|
// renderer/renderSnaps.ts
|
|
21182
|
-
import { pointFrom as pointFrom21 } from "haoxin-excalidraw-
|
|
21183
|
-
import { THEME as THEME10 } from "haoxin-excalidraw-
|
|
21216
|
+
import { pointFrom as pointFrom21 } from "@haoxin-web/excalidraw-math";
|
|
21217
|
+
import { THEME as THEME10 } from "@haoxin-web/excalidraw-common";
|
|
21184
21218
|
var SNAP_COLOR_LIGHT = "#ff6b6b";
|
|
21185
21219
|
var SNAP_COLOR_DARK = "#ff0000";
|
|
21186
21220
|
var SNAP_WIDTH = 1;
|
|
@@ -21311,8 +21345,8 @@ var drawGapLine = (from, to, direction, appState, context) => {
|
|
|
21311
21345
|
};
|
|
21312
21346
|
|
|
21313
21347
|
// scene/scrollbars.ts
|
|
21314
|
-
import { getGlobalCSSVariable } from "haoxin-excalidraw-
|
|
21315
|
-
import { getCommonBounds as getCommonBounds6 } from "haoxin-excalidraw-
|
|
21348
|
+
import { getGlobalCSSVariable } from "@haoxin-web/excalidraw-common";
|
|
21349
|
+
import { getCommonBounds as getCommonBounds6 } from "@haoxin-web/excalidraw-element";
|
|
21316
21350
|
var SCROLLBAR_MARGIN = 4;
|
|
21317
21351
|
var SCROLLBAR_WIDTH = 6;
|
|
21318
21352
|
var SCROLLBAR_COLOR = "rgba(0,0,0,0.3)";
|
|
@@ -22285,8 +22319,8 @@ var Renderer = class {
|
|
|
22285
22319
|
};
|
|
22286
22320
|
|
|
22287
22321
|
// components/ElementCanvasButtons.tsx
|
|
22288
|
-
import { sceneCoordsToViewportCoords as sceneCoordsToViewportCoords3 } from "haoxin-excalidraw-
|
|
22289
|
-
import { getElementAbsoluteCoords as getElementAbsoluteCoords7 } from "haoxin-excalidraw-
|
|
22322
|
+
import { sceneCoordsToViewportCoords as sceneCoordsToViewportCoords3 } from "@haoxin-web/excalidraw-common";
|
|
22323
|
+
import { getElementAbsoluteCoords as getElementAbsoluteCoords7 } from "@haoxin-web/excalidraw-element";
|
|
22290
22324
|
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
22291
22325
|
var CONTAINER_PADDING = 5;
|
|
22292
22326
|
var getContainerCoords2 = (element, appState, elementsMap) => {
|
|
@@ -22325,7 +22359,7 @@ var ElementCanvasButtons = ({
|
|
|
22325
22359
|
};
|
|
22326
22360
|
|
|
22327
22361
|
// laser-trails.ts
|
|
22328
|
-
import { DEFAULT_LASER_COLOR, easeOut } from "haoxin-excalidraw-
|
|
22362
|
+
import { DEFAULT_LASER_COLOR, easeOut } from "@haoxin-web/excalidraw-common";
|
|
22329
22363
|
|
|
22330
22364
|
// animated-trail.ts
|
|
22331
22365
|
import { LaserPointer } from "@excalidraw/laser-pointer";
|
|
@@ -22333,7 +22367,7 @@ import {
|
|
|
22333
22367
|
SVG_NS,
|
|
22334
22368
|
getSvgPathFromStroke as getSvgPathFromStroke2,
|
|
22335
22369
|
sceneCoordsToViewportCoords as sceneCoordsToViewportCoords4
|
|
22336
|
-
} from "haoxin-excalidraw-
|
|
22370
|
+
} from "@haoxin-web/excalidraw-common";
|
|
22337
22371
|
var AnimatedTrail = class {
|
|
22338
22372
|
constructor(animationFrameHandler, app, options) {
|
|
22339
22373
|
this.animationFrameHandler = animationFrameHandler;
|
|
@@ -22560,7 +22594,7 @@ var LaserTrails = class {
|
|
|
22560
22594
|
// reactUtils.ts
|
|
22561
22595
|
import { version as ReactVersion } from "react";
|
|
22562
22596
|
import { unstable_batchedUpdates } from "react-dom";
|
|
22563
|
-
import { throttleRAF as throttleRAF2 } from "haoxin-excalidraw-
|
|
22597
|
+
import { throttleRAF as throttleRAF2 } from "@haoxin-web/excalidraw-common";
|
|
22564
22598
|
var withBatchedUpdates = (func) => (event) => {
|
|
22565
22599
|
unstable_batchedUpdates(func, event);
|
|
22566
22600
|
};
|
|
@@ -22606,13 +22640,13 @@ import {
|
|
|
22606
22640
|
getFontFamilyString as getFontFamilyString3,
|
|
22607
22641
|
isTestEnv as isTestEnv5,
|
|
22608
22642
|
MIME_TYPES as MIME_TYPES8
|
|
22609
|
-
} from "haoxin-excalidraw-
|
|
22643
|
+
} from "@haoxin-web/excalidraw-common";
|
|
22610
22644
|
import {
|
|
22611
22645
|
originalContainerCache,
|
|
22612
22646
|
updateOriginalContainerCache as updateOriginalContainerCache3
|
|
22613
|
-
} from "haoxin-excalidraw-
|
|
22614
|
-
import { LinearElementEditor as LinearElementEditor10 } from "haoxin-excalidraw-
|
|
22615
|
-
import { bumpVersion as bumpVersion2 } from "haoxin-excalidraw-
|
|
22647
|
+
} from "@haoxin-web/excalidraw-element";
|
|
22648
|
+
import { LinearElementEditor as LinearElementEditor10 } from "@haoxin-web/excalidraw-element";
|
|
22649
|
+
import { bumpVersion as bumpVersion2 } from "@haoxin-web/excalidraw-element";
|
|
22616
22650
|
import {
|
|
22617
22651
|
getBoundTextElementId,
|
|
22618
22652
|
getContainerElement as getContainerElement3,
|
|
@@ -22623,15 +22657,15 @@ import {
|
|
|
22623
22657
|
computeContainerDimensionForBoundText as computeContainerDimensionForBoundText2,
|
|
22624
22658
|
computeBoundTextPosition as computeBoundTextPosition2,
|
|
22625
22659
|
getBoundTextElement as getBoundTextElement6
|
|
22626
|
-
} from "haoxin-excalidraw-
|
|
22627
|
-
import { getTextWidth } from "haoxin-excalidraw-
|
|
22628
|
-
import { normalizeText as normalizeText2 } from "haoxin-excalidraw-
|
|
22629
|
-
import { wrapText as wrapText3 } from "haoxin-excalidraw-
|
|
22660
|
+
} from "@haoxin-web/excalidraw-element";
|
|
22661
|
+
import { getTextWidth } from "@haoxin-web/excalidraw-element";
|
|
22662
|
+
import { normalizeText as normalizeText2 } from "@haoxin-web/excalidraw-element";
|
|
22663
|
+
import { wrapText as wrapText3 } from "@haoxin-web/excalidraw-element";
|
|
22630
22664
|
import {
|
|
22631
22665
|
isArrowElement as isArrowElement9,
|
|
22632
22666
|
isBoundToContainer as isBoundToContainer6,
|
|
22633
22667
|
isTextElement as isTextElement11
|
|
22634
|
-
} from "haoxin-excalidraw-
|
|
22668
|
+
} from "@haoxin-web/excalidraw-element";
|
|
22635
22669
|
var getTransform = (width, height, angle, appState, maxWidth, maxHeight) => {
|
|
22636
22670
|
const { zoom } = appState;
|
|
22637
22671
|
const degree = 180 * angle / Math.PI;
|
|
@@ -22797,10 +22831,7 @@ var textWysiwyg = ({
|
|
|
22797
22831
|
const strike = styleFromElement.strikethrough ?? app.state.currentTextStrikethrough ? true : false;
|
|
22798
22832
|
editable.style.fontWeight = bold ? "700" : "400";
|
|
22799
22833
|
editable.style.fontStyle = italic ? "italic" : "normal";
|
|
22800
|
-
editable.style.textDecoration = [
|
|
22801
|
-
underline ? "underline" : "",
|
|
22802
|
-
strike ? "line-through" : ""
|
|
22803
|
-
].filter(Boolean).join(" ") || "none";
|
|
22834
|
+
editable.style.textDecoration = [underline ? "underline" : "", strike ? "line-through" : ""].filter(Boolean).join(" ") || "none";
|
|
22804
22835
|
editable.scrollTop = 0;
|
|
22805
22836
|
if (isTestEnv5()) {
|
|
22806
22837
|
editable.style.fontFamily = getFontFamilyString3(updatedTextElement);
|
|
@@ -22888,15 +22919,30 @@ var textWysiwyg = ({
|
|
|
22888
22919
|
};
|
|
22889
22920
|
}
|
|
22890
22921
|
editable.onkeydown = (event) => {
|
|
22891
|
-
if (!event.shiftKey && actionZoomIn.keyTest(
|
|
22922
|
+
if (!event.shiftKey && actionZoomIn.keyTest(
|
|
22923
|
+
event,
|
|
22924
|
+
app.state,
|
|
22925
|
+
Object.values(app.scene.getNonDeletedElementsMap()),
|
|
22926
|
+
app
|
|
22927
|
+
)) {
|
|
22892
22928
|
event.preventDefault();
|
|
22893
22929
|
app.actionManager.executeAction(actionZoomIn);
|
|
22894
22930
|
updateWysiwygStyle();
|
|
22895
|
-
} else if (!event.shiftKey && actionZoomOut.keyTest(
|
|
22931
|
+
} else if (!event.shiftKey && actionZoomOut.keyTest(
|
|
22932
|
+
event,
|
|
22933
|
+
app.state,
|
|
22934
|
+
Object.values(app.scene.getNonDeletedElementsMap()),
|
|
22935
|
+
app
|
|
22936
|
+
)) {
|
|
22896
22937
|
event.preventDefault();
|
|
22897
22938
|
app.actionManager.executeAction(actionZoomOut);
|
|
22898
22939
|
updateWysiwygStyle();
|
|
22899
|
-
} else if (!event.shiftKey && actionResetZoom.keyTest(
|
|
22940
|
+
} else if (!event.shiftKey && actionResetZoom.keyTest(
|
|
22941
|
+
event,
|
|
22942
|
+
app.state,
|
|
22943
|
+
Object.values(app.scene.getNonDeletedElementsMap()),
|
|
22944
|
+
app
|
|
22945
|
+
)) {
|
|
22900
22946
|
event.preventDefault();
|
|
22901
22947
|
app.actionManager.executeAction(actionResetZoom);
|
|
22902
22948
|
updateWysiwygStyle();
|
|
@@ -23171,18 +23217,18 @@ var isMaybeMermaidDefinition = (text) => {
|
|
|
23171
23217
|
// lasso/index.ts
|
|
23172
23218
|
import {
|
|
23173
23219
|
pointFrom as pointFrom23
|
|
23174
|
-
} from "haoxin-excalidraw-
|
|
23175
|
-
import { getElementLineSegments as getElementLineSegments2 } from "haoxin-excalidraw-
|
|
23176
|
-
import { LinearElementEditor as LinearElementEditor11 } from "haoxin-excalidraw-
|
|
23220
|
+
} from "@haoxin-web/excalidraw-math";
|
|
23221
|
+
import { getElementLineSegments as getElementLineSegments2 } from "@haoxin-web/excalidraw-element";
|
|
23222
|
+
import { LinearElementEditor as LinearElementEditor11 } from "@haoxin-web/excalidraw-element";
|
|
23177
23223
|
import {
|
|
23178
23224
|
isFrameLikeElement as isFrameLikeElement10,
|
|
23179
23225
|
isLinearElement as isLinearElement11,
|
|
23180
23226
|
isTextElement as isTextElement12
|
|
23181
|
-
} from "haoxin-excalidraw-
|
|
23182
|
-
import { getFrameChildren as getFrameChildren4 } from "haoxin-excalidraw-
|
|
23183
|
-
import { selectGroupsForSelectedElements as selectGroupsForSelectedElements5 } from "haoxin-excalidraw-
|
|
23184
|
-
import { getContainerElement as getContainerElement4 } from "haoxin-excalidraw-
|
|
23185
|
-
import { arrayToMap as arrayToMap24, easeOut as easeOut2, isShallowEqual as isShallowEqual3 } from "haoxin-excalidraw-
|
|
23227
|
+
} from "@haoxin-web/excalidraw-element";
|
|
23228
|
+
import { getFrameChildren as getFrameChildren4 } from "@haoxin-web/excalidraw-element";
|
|
23229
|
+
import { selectGroupsForSelectedElements as selectGroupsForSelectedElements5 } from "@haoxin-web/excalidraw-element";
|
|
23230
|
+
import { getContainerElement as getContainerElement4 } from "@haoxin-web/excalidraw-element";
|
|
23231
|
+
import { arrayToMap as arrayToMap24, easeOut as easeOut2, isShallowEqual as isShallowEqual3 } from "@haoxin-web/excalidraw-common";
|
|
23186
23232
|
|
|
23187
23233
|
// lasso/utils.ts
|
|
23188
23234
|
import { simplify as simplify2 } from "points-on-curve";
|
|
@@ -23190,14 +23236,14 @@ import {
|
|
|
23190
23236
|
polygonFromPoints as polygonFromPoints2,
|
|
23191
23237
|
lineSegment as lineSegment6,
|
|
23192
23238
|
polygonIncludesPointNonZero
|
|
23193
|
-
} from "haoxin-excalidraw-
|
|
23239
|
+
} from "@haoxin-web/excalidraw-math";
|
|
23194
23240
|
import {
|
|
23195
23241
|
computeBoundTextPosition as computeBoundTextPosition3,
|
|
23196
23242
|
doBoundsIntersect as doBoundsIntersect2,
|
|
23197
23243
|
getBoundTextElement as getBoundTextElement7,
|
|
23198
23244
|
getElementBounds as getElementBounds3,
|
|
23199
23245
|
intersectElementWithLineSegment as intersectElementWithLineSegment2
|
|
23200
|
-
} from "haoxin-excalidraw-
|
|
23246
|
+
} from "@haoxin-web/excalidraw-element";
|
|
23201
23247
|
var getLassoSelectedElementIds = (input) => {
|
|
23202
23248
|
const {
|
|
23203
23249
|
lassoPath,
|
|
@@ -23422,18 +23468,18 @@ var LassoTrail = class extends AnimatedTrail {
|
|
|
23422
23468
|
};
|
|
23423
23469
|
|
|
23424
23470
|
// eraser/index.ts
|
|
23425
|
-
import { arrayToMap as arrayToMap25, easeOut as easeOut3, THEME as THEME12 } from "haoxin-excalidraw-
|
|
23471
|
+
import { arrayToMap as arrayToMap25, easeOut as easeOut3, THEME as THEME12 } from "@haoxin-web/excalidraw-common";
|
|
23426
23472
|
import {
|
|
23427
23473
|
computeBoundTextPosition as computeBoundTextPosition4,
|
|
23428
23474
|
getBoundTextElement as getBoundTextElement8,
|
|
23429
23475
|
intersectElementWithLineSegment as intersectElementWithLineSegment3,
|
|
23430
23476
|
isPointInElement
|
|
23431
|
-
} from "haoxin-excalidraw-
|
|
23432
|
-
import { lineSegment as lineSegment7, pointFrom as pointFrom24 } from "haoxin-excalidraw-
|
|
23433
|
-
import { getElementsInGroup as getElementsInGroup6 } from "haoxin-excalidraw-
|
|
23434
|
-
import { shouldTestInside as shouldTestInside2 } from "haoxin-excalidraw-
|
|
23435
|
-
import { hasBoundTextElement as hasBoundTextElement6, isBoundToContainer as isBoundToContainer7 } from "haoxin-excalidraw-
|
|
23436
|
-
import { getBoundTextElementId as getBoundTextElementId2 } from "haoxin-excalidraw-
|
|
23477
|
+
} from "@haoxin-web/excalidraw-element";
|
|
23478
|
+
import { lineSegment as lineSegment7, pointFrom as pointFrom24 } from "@haoxin-web/excalidraw-math";
|
|
23479
|
+
import { getElementsInGroup as getElementsInGroup6 } from "@haoxin-web/excalidraw-element";
|
|
23480
|
+
import { shouldTestInside as shouldTestInside2 } from "@haoxin-web/excalidraw-element";
|
|
23481
|
+
import { hasBoundTextElement as hasBoundTextElement6, isBoundToContainer as isBoundToContainer7 } from "@haoxin-web/excalidraw-element";
|
|
23482
|
+
import { getBoundTextElementId as getBoundTextElementId2 } from "@haoxin-web/excalidraw-element";
|
|
23437
23483
|
var EraserTrail = class extends AnimatedTrail {
|
|
23438
23484
|
constructor(animationFrameHandler, app) {
|
|
23439
23485
|
super(animationFrameHandler, app, {
|
|
@@ -23613,7 +23659,7 @@ import React29 from "react";
|
|
|
23613
23659
|
// components/Popover.tsx
|
|
23614
23660
|
import { useLayoutEffect as useLayoutEffect4, useRef as useRef24, useEffect as useEffect29 } from "react";
|
|
23615
23661
|
import { unstable_batchedUpdates as unstable_batchedUpdates2 } from "react-dom";
|
|
23616
|
-
import { KEYS as KEYS44, queryFocusableElements as queryFocusableElements2 } from "haoxin-excalidraw-
|
|
23662
|
+
import { KEYS as KEYS44, queryFocusableElements as queryFocusableElements2 } from "@haoxin-web/excalidraw-common";
|
|
23617
23663
|
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
23618
23664
|
var Popover6 = ({
|
|
23619
23665
|
children,
|
|
@@ -23866,14 +23912,21 @@ import {
|
|
|
23866
23912
|
arrayToMap as arrayToMap26,
|
|
23867
23913
|
capitalizeString as capitalizeString3,
|
|
23868
23914
|
isShallowEqual as isShallowEqual5
|
|
23869
|
-
} from "haoxin-excalidraw-
|
|
23870
|
-
import { mutateElement as mutateElement5 } from "haoxin-excalidraw-
|
|
23871
|
-
import { ShapeCache as ShapeCache3 } from "haoxin-excalidraw-
|
|
23915
|
+
} from "@haoxin-web/excalidraw-common";
|
|
23916
|
+
import { mutateElement as mutateElement5 } from "@haoxin-web/excalidraw-element";
|
|
23917
|
+
import { ShapeCache as ShapeCache3 } from "@haoxin-web/excalidraw-element";
|
|
23872
23918
|
|
|
23873
23919
|
// components/LeftMainToolbar.tsx
|
|
23874
|
-
import { TOOL_TYPE as TOOL_TYPE2 } from "haoxin-excalidraw-
|
|
23920
|
+
import { TOOL_TYPE as TOOL_TYPE2 } from "@haoxin-web/excalidraw-common";
|
|
23875
23921
|
import { jsx as jsx83, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
23876
|
-
var LeftMainToolbar = ({
|
|
23922
|
+
var LeftMainToolbar = ({
|
|
23923
|
+
appState,
|
|
23924
|
+
app,
|
|
23925
|
+
visible = true
|
|
23926
|
+
}) => {
|
|
23927
|
+
if (!visible) {
|
|
23928
|
+
return null;
|
|
23929
|
+
}
|
|
23877
23930
|
const active = appState.activeTool.type;
|
|
23878
23931
|
let lineGroupIcon = LineIcon;
|
|
23879
23932
|
let shapesGroupIcon = RectangleIcon;
|
|
@@ -24021,7 +24074,7 @@ var LeftMainToolbar_default = LeftMainToolbar;
|
|
|
24021
24074
|
// components/LoadingMessage.tsx
|
|
24022
24075
|
import clsx34 from "clsx";
|
|
24023
24076
|
import { useState as useState24, useEffect as useEffect30 } from "react";
|
|
24024
|
-
import { THEME as THEME13 } from "haoxin-excalidraw-
|
|
24077
|
+
import { THEME as THEME13 } from "@haoxin-web/excalidraw-common";
|
|
24025
24078
|
import { jsx as jsx84, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
24026
24079
|
var LoadingMessage = ({
|
|
24027
24080
|
delay,
|
|
@@ -24056,7 +24109,7 @@ var LoadingMessage = ({
|
|
|
24056
24109
|
|
|
24057
24110
|
// components/MobileMenu.tsx
|
|
24058
24111
|
import { useEffect as useEffect31 } from "react";
|
|
24059
|
-
import { showSelectedShapeActions as showSelectedShapeActions2 } from "haoxin-excalidraw-
|
|
24112
|
+
import { showSelectedShapeActions as showSelectedShapeActions2 } from "@haoxin-web/excalidraw-element";
|
|
24060
24113
|
|
|
24061
24114
|
// components/FixedSideContainer.tsx
|
|
24062
24115
|
import clsx35 from "clsx";
|
|
@@ -24079,9 +24132,12 @@ var FixedSideContainer = ({
|
|
|
24079
24132
|
|
|
24080
24133
|
// components/HandButton.tsx
|
|
24081
24134
|
import clsx36 from "clsx";
|
|
24082
|
-
import { KEYS as KEYS45 } from "haoxin-excalidraw-
|
|
24135
|
+
import { KEYS as KEYS45 } from "@haoxin-web/excalidraw-common";
|
|
24083
24136
|
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
24084
24137
|
var HandButton = (props) => {
|
|
24138
|
+
if (props.visible === false) {
|
|
24139
|
+
return null;
|
|
24140
|
+
}
|
|
24085
24141
|
return /* @__PURE__ */ jsx86(
|
|
24086
24142
|
ToolButton,
|
|
24087
24143
|
{
|
|
@@ -24101,7 +24157,7 @@ var HandButton = (props) => {
|
|
|
24101
24157
|
};
|
|
24102
24158
|
|
|
24103
24159
|
// components/HintViewer.tsx
|
|
24104
|
-
import { CANVAS_SEARCH_TAB as CANVAS_SEARCH_TAB2, DEFAULT_SIDEBAR as DEFAULT_SIDEBAR4 } from "haoxin-excalidraw-
|
|
24160
|
+
import { CANVAS_SEARCH_TAB as CANVAS_SEARCH_TAB2, DEFAULT_SIDEBAR as DEFAULT_SIDEBAR4 } from "@haoxin-web/excalidraw-common";
|
|
24105
24161
|
import {
|
|
24106
24162
|
isFlowchartNodeElement,
|
|
24107
24163
|
isImageElement as isImageElement5,
|
|
@@ -24109,9 +24165,9 @@ import {
|
|
|
24109
24165
|
isLineElement as isLineElement6,
|
|
24110
24166
|
isTextBindableContainer as isTextBindableContainer2,
|
|
24111
24167
|
isTextElement as isTextElement13
|
|
24112
|
-
} from "haoxin-excalidraw-
|
|
24113
|
-
import { getShortcutKey as getShortcutKey12 } from "haoxin-excalidraw-
|
|
24114
|
-
import { isNodeInFlowchart } from "haoxin-excalidraw-
|
|
24168
|
+
} from "@haoxin-web/excalidraw-element";
|
|
24169
|
+
import { getShortcutKey as getShortcutKey12 } from "@haoxin-web/excalidraw-common";
|
|
24170
|
+
import { isNodeInFlowchart } from "@haoxin-web/excalidraw-element";
|
|
24115
24171
|
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
24116
24172
|
var getHints = ({
|
|
24117
24173
|
appState,
|
|
@@ -24328,7 +24384,8 @@ var MobileMenu = ({
|
|
|
24328
24384
|
device,
|
|
24329
24385
|
renderWelcomeScreen,
|
|
24330
24386
|
UIOptions,
|
|
24331
|
-
app
|
|
24387
|
+
app,
|
|
24388
|
+
showPanActions
|
|
24332
24389
|
}) => {
|
|
24333
24390
|
const {
|
|
24334
24391
|
WelcomeScreenCenterTunnel,
|
|
@@ -24353,7 +24410,8 @@ var MobileMenu = ({
|
|
|
24353
24410
|
checked: isHandToolActive(appState),
|
|
24354
24411
|
onChange: () => onHandToolToggle(),
|
|
24355
24412
|
title: t("toolBar.hand"),
|
|
24356
|
-
isMobile: true
|
|
24413
|
+
isMobile: true,
|
|
24414
|
+
visible: showPanActions !== false
|
|
24357
24415
|
}
|
|
24358
24416
|
),
|
|
24359
24417
|
/* @__PURE__ */ jsx91(
|
|
@@ -24431,15 +24489,22 @@ var MobileMenu = ({
|
|
|
24431
24489
|
marginRight: SCROLLBAR_WIDTH + SCROLLBAR_MARGIN * 2
|
|
24432
24490
|
},
|
|
24433
24491
|
children: /* @__PURE__ */ jsxs50(Island, { padding: 0, children: [
|
|
24434
|
-
appState.openMenu === "shape" && showSelectedShapeActions2(appState, elements) ? /* @__PURE__ */ jsx91(
|
|
24435
|
-
|
|
24492
|
+
appState.openMenu === "shape" && showSelectedShapeActions2(appState, elements) ? /* @__PURE__ */ jsx91(
|
|
24493
|
+
Section,
|
|
24436
24494
|
{
|
|
24437
|
-
|
|
24438
|
-
|
|
24439
|
-
|
|
24440
|
-
|
|
24495
|
+
className: "App-mobile-menu",
|
|
24496
|
+
heading: "selectedShapeActions",
|
|
24497
|
+
children: /* @__PURE__ */ jsx91(
|
|
24498
|
+
SelectedShapeActions,
|
|
24499
|
+
{
|
|
24500
|
+
appState,
|
|
24501
|
+
elementsMap: app.scene.getNonDeletedElementsMap(),
|
|
24502
|
+
renderAction: actionManager.renderAction,
|
|
24503
|
+
app
|
|
24504
|
+
}
|
|
24505
|
+
)
|
|
24441
24506
|
}
|
|
24442
|
-
)
|
|
24507
|
+
) : null,
|
|
24443
24508
|
/* @__PURE__ */ jsxs50("footer", { className: "App-toolbar", children: [
|
|
24444
24509
|
renderAppToolbar(),
|
|
24445
24510
|
appState.scrolledOutside && !appState.openMenu && !appState.openSidebar && /* @__PURE__ */ jsx91(
|
|
@@ -24580,7 +24645,7 @@ var PasteChartDialog = ({
|
|
|
24580
24645
|
import * as Popover7 from "@radix-ui/react-popover";
|
|
24581
24646
|
import clsx39 from "clsx";
|
|
24582
24647
|
import React32, { useLayoutEffect as useLayoutEffect6 } from "react";
|
|
24583
|
-
import { supportsResizeObserver, isShallowEqual as isShallowEqual4 } from "haoxin-excalidraw-
|
|
24648
|
+
import { supportsResizeObserver, isShallowEqual as isShallowEqual4 } from "@haoxin-web/excalidraw-common";
|
|
24584
24649
|
import { Fragment as Fragment14, jsx as jsx93, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
24585
24650
|
var DEFAULT_MAX_AVATARS = 4;
|
|
24586
24651
|
var SHOW_COLLABORATORS_FILTER_AT = 8;
|
|
@@ -24799,8 +24864,10 @@ var Footer = ({
|
|
|
24799
24864
|
appState,
|
|
24800
24865
|
actionManager,
|
|
24801
24866
|
showExitZenModeBtn,
|
|
24802
|
-
renderWelcomeScreen
|
|
24867
|
+
renderWelcomeScreen,
|
|
24868
|
+
showZoomActions
|
|
24803
24869
|
}) => {
|
|
24870
|
+
const effectiveShowZoomActions = showZoomActions !== false;
|
|
24804
24871
|
const { FooterCenterTunnel, WelcomeScreenHelpHintTunnel } = useTunnels();
|
|
24805
24872
|
return /* @__PURE__ */ jsxs53(
|
|
24806
24873
|
"footer",
|
|
@@ -24808,30 +24875,23 @@ var Footer = ({
|
|
|
24808
24875
|
role: "contentinfo",
|
|
24809
24876
|
className: "layer-ui__wrapper__footer App-menu App-menu_bottom",
|
|
24810
24877
|
children: [
|
|
24811
|
-
/* @__PURE__ */ jsx95(
|
|
24878
|
+
effectiveShowZoomActions && /* @__PURE__ */ jsx95(
|
|
24812
24879
|
"div",
|
|
24813
24880
|
{
|
|
24814
|
-
className: clsx40(
|
|
24815
|
-
"layer-ui__wrapper__footer-left
|
|
24816
|
-
|
|
24817
|
-
|
|
24818
|
-
|
|
24819
|
-
|
|
24820
|
-
|
|
24821
|
-
|
|
24822
|
-
|
|
24823
|
-
|
|
24824
|
-
|
|
24825
|
-
|
|
24826
|
-
|
|
24827
|
-
|
|
24828
|
-
renderAction: actionManager.renderAction,
|
|
24829
|
-
className: clsx40("zen-mode-transition", {
|
|
24830
|
-
"layer-ui__wrapper__footer-left--transition-bottom": appState.zenModeEnabled
|
|
24831
|
-
})
|
|
24832
|
-
}
|
|
24833
|
-
)
|
|
24834
|
-
] }) })
|
|
24881
|
+
className: clsx40(
|
|
24882
|
+
"layer-ui__wrapper__footer-left zen-mode-transition",
|
|
24883
|
+
{
|
|
24884
|
+
"layer-ui__wrapper__footer-left--transition-left": appState.zenModeEnabled
|
|
24885
|
+
}
|
|
24886
|
+
),
|
|
24887
|
+
children: /* @__PURE__ */ jsx95(Stack_default.Col, { gap: 2, children: /* @__PURE__ */ jsx95(Section, { heading: "canvasActions", children: /* @__PURE__ */ jsx95(
|
|
24888
|
+
ZoomActions,
|
|
24889
|
+
{
|
|
24890
|
+
renderAction: actionManager.renderAction,
|
|
24891
|
+
zoom: appState.zoom,
|
|
24892
|
+
visible: effectiveShowZoomActions
|
|
24893
|
+
}
|
|
24894
|
+
) }) })
|
|
24835
24895
|
}
|
|
24836
24896
|
),
|
|
24837
24897
|
/* @__PURE__ */ jsx95(FooterCenterTunnel.Out, {}),
|
|
@@ -24878,7 +24938,7 @@ import {
|
|
|
24878
24938
|
useImperativeHandle as useImperativeHandle3,
|
|
24879
24939
|
useCallback as useCallback11
|
|
24880
24940
|
} from "react";
|
|
24881
|
-
import { EVENT as EVENT10, isDevEnv as isDevEnv9, KEYS as KEYS46, updateObject } from "haoxin-excalidraw-
|
|
24941
|
+
import { EVENT as EVENT10, isDevEnv as isDevEnv9, KEYS as KEYS46, updateObject } from "@haoxin-web/excalidraw-common";
|
|
24882
24942
|
|
|
24883
24943
|
// components/Sidebar/SidebarHeader.tsx
|
|
24884
24944
|
import clsx41 from "clsx";
|
|
@@ -25174,7 +25234,7 @@ var Sidebar = Object.assign(
|
|
|
25174
25234
|
Sidebar.displayName = "Sidebar";
|
|
25175
25235
|
|
|
25176
25236
|
// components/main-menu/MainMenu.tsx
|
|
25177
|
-
import { composeEventHandlers as composeEventHandlers3 } from "haoxin-excalidraw-
|
|
25237
|
+
import { composeEventHandlers as composeEventHandlers3 } from "@haoxin-web/excalidraw-common";
|
|
25178
25238
|
|
|
25179
25239
|
// components/hoc/withInternalFallback.tsx
|
|
25180
25240
|
import { useLayoutEffect as useLayoutEffect8, useRef as useRef27 } from "react";
|
|
@@ -25246,7 +25306,7 @@ __export(DefaultItems_exports, {
|
|
|
25246
25306
|
ToggleTheme: () => ToggleTheme
|
|
25247
25307
|
});
|
|
25248
25308
|
import clsx45 from "clsx";
|
|
25249
|
-
import { THEME as THEME14 } from "haoxin-excalidraw-
|
|
25309
|
+
import { THEME as THEME14 } from "@haoxin-web/excalidraw-common";
|
|
25250
25310
|
|
|
25251
25311
|
// components/OverwriteConfirm/OverwriteConfirmState.ts
|
|
25252
25312
|
var overwriteConfirmStateAtom = atom({
|
|
@@ -25702,16 +25762,20 @@ var MainMenu_default = MainMenu;
|
|
|
25702
25762
|
// components/LeftToolFlyouts.tsx
|
|
25703
25763
|
import { useEffect as useEffect33, useRef as useRef28, useState as useState27 } from "react";
|
|
25704
25764
|
import clsx46 from "clsx";
|
|
25705
|
-
import { isTextElement as isTextElement14 } from "haoxin-excalidraw-
|
|
25706
|
-
import { getBoundTextElement as getBoundTextElement9, getContainerElement as getContainerElement5, redrawTextBoundingBox as redrawTextBoundingBox7, newElementWith as newElementWith11 } from "haoxin-excalidraw-
|
|
25707
|
-
import { DEFAULT_ELEMENT_STROKE_COLOR_PALETTE as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE2, STROKE_WIDTH as STROKE_WIDTH2 } from "haoxin-excalidraw-
|
|
25765
|
+
import { isTextElement as isTextElement14 } from "@haoxin-web/excalidraw-element";
|
|
25766
|
+
import { getBoundTextElement as getBoundTextElement9, getContainerElement as getContainerElement5, redrawTextBoundingBox as redrawTextBoundingBox7, newElementWith as newElementWith11 } from "@haoxin-web/excalidraw-element";
|
|
25767
|
+
import { DEFAULT_ELEMENT_STROKE_COLOR_PALETTE as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE2, STROKE_WIDTH as STROKE_WIDTH2 } from "@haoxin-web/excalidraw-common";
|
|
25708
25768
|
import { jsx as jsx108, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
25709
25769
|
var LeftToolFlyouts = ({
|
|
25710
25770
|
appState,
|
|
25711
25771
|
app,
|
|
25712
25772
|
actionManager,
|
|
25713
|
-
elements
|
|
25773
|
+
elements,
|
|
25774
|
+
showToolBar = true
|
|
25714
25775
|
}) => {
|
|
25776
|
+
if (!showToolBar) {
|
|
25777
|
+
return null;
|
|
25778
|
+
}
|
|
25715
25779
|
const activeTool = appState.activeTool.type;
|
|
25716
25780
|
const selectedStrokeWidth = getFormValue(
|
|
25717
25781
|
elements,
|
|
@@ -26452,7 +26516,7 @@ var LeftToolFlyouts_default = LeftToolFlyouts;
|
|
|
26452
26516
|
// components/FilledButton.tsx
|
|
26453
26517
|
import clsx47 from "clsx";
|
|
26454
26518
|
import { forwardRef as forwardRef5, useState as useState28 } from "react";
|
|
26455
|
-
import { isPromiseLike as isPromiseLike4 } from "haoxin-excalidraw-
|
|
26519
|
+
import { isPromiseLike as isPromiseLike4 } from "@haoxin-web/excalidraw-common";
|
|
26456
26520
|
import { jsx as jsx109, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
26457
26521
|
var FilledButton = forwardRef5(
|
|
26458
26522
|
({
|
|
@@ -26643,10 +26707,10 @@ import {
|
|
|
26643
26707
|
DEFAULT_SIDEBAR as DEFAULT_SIDEBAR5,
|
|
26644
26708
|
LIBRARY_SIDEBAR_TAB as LIBRARY_SIDEBAR_TAB2,
|
|
26645
26709
|
composeEventHandlers as composeEventHandlers4
|
|
26646
|
-
} from "haoxin-excalidraw-
|
|
26710
|
+
} from "@haoxin-web/excalidraw-common";
|
|
26647
26711
|
|
|
26648
26712
|
// components/SearchMenu.tsx
|
|
26649
|
-
import { round as round2 } from "haoxin-excalidraw-
|
|
26713
|
+
import { round as round2 } from "@haoxin-web/excalidraw-math";
|
|
26650
26714
|
import clsx48 from "clsx";
|
|
26651
26715
|
import debounce2 from "lodash.debounce";
|
|
26652
26716
|
import { Fragment as Fragment17, memo as memo4, useEffect as useEffect34, useMemo as useMemo8, useRef as useRef29, useState as useState29 } from "react";
|
|
@@ -26656,18 +26720,18 @@ import {
|
|
|
26656
26720
|
FONT_FAMILY as FONT_FAMILY4,
|
|
26657
26721
|
FRAME_STYLE as FRAME_STYLE3,
|
|
26658
26722
|
getLineHeight as getLineHeight4
|
|
26659
|
-
} from "haoxin-excalidraw-
|
|
26660
|
-
import { isElementCompletelyInViewport } from "haoxin-excalidraw-
|
|
26661
|
-
import { measureText as measureText6 } from "haoxin-excalidraw-
|
|
26723
|
+
} from "@haoxin-web/excalidraw-common";
|
|
26724
|
+
import { isElementCompletelyInViewport } from "@haoxin-web/excalidraw-element";
|
|
26725
|
+
import { measureText as measureText6 } from "@haoxin-web/excalidraw-element";
|
|
26662
26726
|
import {
|
|
26663
26727
|
KEYS as KEYS47,
|
|
26664
26728
|
randomInteger as randomInteger3,
|
|
26665
26729
|
addEventListener,
|
|
26666
26730
|
getFontString as getFontString9
|
|
26667
|
-
} from "haoxin-excalidraw-
|
|
26668
|
-
import { newTextElement as newTextElement3 } from "haoxin-excalidraw-
|
|
26669
|
-
import { isTextElement as isTextElement15, isFrameLikeElement as isFrameLikeElement11 } from "haoxin-excalidraw-
|
|
26670
|
-
import { getDefaultFrameName } from "haoxin-excalidraw-
|
|
26731
|
+
} from "@haoxin-web/excalidraw-common";
|
|
26732
|
+
import { newTextElement as newTextElement3 } from "@haoxin-web/excalidraw-element";
|
|
26733
|
+
import { isTextElement as isTextElement15, isFrameLikeElement as isFrameLikeElement11 } from "@haoxin-web/excalidraw-element";
|
|
26734
|
+
import { getDefaultFrameName } from "@haoxin-web/excalidraw-element/frame";
|
|
26671
26735
|
import { Fragment as Fragment18, jsx as jsx112, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
26672
26736
|
var searchQueryAtom = atom("");
|
|
26673
26737
|
var searchItemInFocusAtom = atom(null);
|
|
@@ -27336,15 +27400,15 @@ var DefaultSidebar = Object.assign(
|
|
|
27336
27400
|
|
|
27337
27401
|
// components/TTDDialog/TTDDialog.tsx
|
|
27338
27402
|
import { useEffect as useEffect37, useRef as useRef33, useState as useState31 } from "react";
|
|
27339
|
-
import { isFiniteNumber } from "haoxin-excalidraw-
|
|
27403
|
+
import { isFiniteNumber } from "@haoxin-web/excalidraw-math";
|
|
27340
27404
|
|
|
27341
27405
|
// components/TTDDialog/MermaidToExcalidraw.tsx
|
|
27342
27406
|
import { useState as useState30, useRef as useRef31, useEffect as useEffect36, useDeferredValue } from "react";
|
|
27343
|
-
import { EDITOR_LS_KEYS as EDITOR_LS_KEYS3, debounce as debounce3, isDevEnv as isDevEnv10 } from "haoxin-excalidraw-
|
|
27407
|
+
import { EDITOR_LS_KEYS as EDITOR_LS_KEYS3, debounce as debounce3, isDevEnv as isDevEnv10 } from "@haoxin-web/excalidraw-common";
|
|
27344
27408
|
|
|
27345
27409
|
// components/TTDDialog/TTDDialogInput.tsx
|
|
27346
27410
|
import { useEffect as useEffect35, useRef as useRef30 } from "react";
|
|
27347
|
-
import { EVENT as EVENT12, KEYS as KEYS48 } from "haoxin-excalidraw-
|
|
27411
|
+
import { EVENT as EVENT12, KEYS as KEYS48 } from "@haoxin-web/excalidraw-common";
|
|
27348
27412
|
import { jsx as jsx114 } from "react/jsx-runtime";
|
|
27349
27413
|
var TTDDialogInput = ({
|
|
27350
27414
|
input,
|
|
@@ -27477,7 +27541,7 @@ var TTDDialogPanels = ({ children }) => {
|
|
|
27477
27541
|
};
|
|
27478
27542
|
|
|
27479
27543
|
// components/TTDDialog/TTDDialogSubmitShortcut.tsx
|
|
27480
|
-
import { getShortcutKey as getShortcutKey13 } from "haoxin-excalidraw-
|
|
27544
|
+
import { getShortcutKey as getShortcutKey13 } from "@haoxin-web/excalidraw-common";
|
|
27481
27545
|
import { jsx as jsx118, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
27482
27546
|
var TTDDialogSubmitShortcut = () => {
|
|
27483
27547
|
return /* @__PURE__ */ jsxs68("div", { className: "ttd-dialog-submit-shortcut", children: [
|
|
@@ -27487,7 +27551,7 @@ var TTDDialogSubmitShortcut = () => {
|
|
|
27487
27551
|
};
|
|
27488
27552
|
|
|
27489
27553
|
// components/TTDDialog/common.ts
|
|
27490
|
-
import { DEFAULT_EXPORT_PADDING as DEFAULT_EXPORT_PADDING3, EDITOR_LS_KEYS as EDITOR_LS_KEYS2 } from "haoxin-excalidraw-
|
|
27554
|
+
import { DEFAULT_EXPORT_PADDING as DEFAULT_EXPORT_PADDING3, EDITOR_LS_KEYS as EDITOR_LS_KEYS2 } from "@haoxin-web/excalidraw-common";
|
|
27491
27555
|
var resetPreview = ({
|
|
27492
27556
|
canvasRef,
|
|
27493
27557
|
setError
|
|
@@ -27685,7 +27749,7 @@ var MermaidToExcalidraw_default = MermaidToExcalidraw;
|
|
|
27685
27749
|
// components/TTDDialog/TTDDialogTabs.tsx
|
|
27686
27750
|
import * as RadixTabs5 from "@radix-ui/react-tabs";
|
|
27687
27751
|
import { useRef as useRef32 } from "react";
|
|
27688
|
-
import { isMemberOf as isMemberOf2 } from "haoxin-excalidraw-
|
|
27752
|
+
import { isMemberOf as isMemberOf2 } from "@haoxin-web/excalidraw-common";
|
|
27689
27753
|
import { jsx as jsx120 } from "react/jsx-runtime";
|
|
27690
27754
|
var TTDDialogTabs = (props) => {
|
|
27691
27755
|
const setAppState = useExcalidrawSetAppState();
|
|
@@ -28049,41 +28113,41 @@ TTD mermaid definition render errror: ${error3.message}`,
|
|
|
28049
28113
|
);
|
|
28050
28114
|
|
|
28051
28115
|
// components/Stats/index.tsx
|
|
28052
|
-
import { round as round5 } from "haoxin-excalidraw-
|
|
28116
|
+
import { round as round5 } from "@haoxin-web/excalidraw-math";
|
|
28053
28117
|
import clsx52 from "clsx";
|
|
28054
28118
|
import throttle2 from "lodash.throttle";
|
|
28055
28119
|
import { useEffect as useEffect39, useMemo as useMemo11, useState as useState33, memo as memo5 } from "react";
|
|
28056
|
-
import { STATS_PANELS } from "haoxin-excalidraw-
|
|
28057
|
-
import { getCommonBounds as getCommonBounds10 } from "haoxin-excalidraw-
|
|
28058
|
-
import { getUncroppedWidthAndHeight as getUncroppedWidthAndHeight3 } from "haoxin-excalidraw-
|
|
28059
|
-
import { isElbowArrow as isElbowArrow10, isImageElement as isImageElement8 } from "haoxin-excalidraw-
|
|
28060
|
-
import { frameAndChildrenSelectedTogether as frameAndChildrenSelectedTogether2 } from "haoxin-excalidraw-
|
|
28061
|
-
import { elementsAreInSameGroup as elementsAreInSameGroup2 } from "haoxin-excalidraw-
|
|
28120
|
+
import { STATS_PANELS } from "@haoxin-web/excalidraw-common";
|
|
28121
|
+
import { getCommonBounds as getCommonBounds10 } from "@haoxin-web/excalidraw-element";
|
|
28122
|
+
import { getUncroppedWidthAndHeight as getUncroppedWidthAndHeight3 } from "@haoxin-web/excalidraw-element";
|
|
28123
|
+
import { isElbowArrow as isElbowArrow10, isImageElement as isImageElement8 } from "@haoxin-web/excalidraw-element";
|
|
28124
|
+
import { frameAndChildrenSelectedTogether as frameAndChildrenSelectedTogether2 } from "@haoxin-web/excalidraw-element";
|
|
28125
|
+
import { elementsAreInSameGroup as elementsAreInSameGroup2 } from "@haoxin-web/excalidraw-element";
|
|
28062
28126
|
|
|
28063
28127
|
// components/Stats/Angle.tsx
|
|
28064
|
-
import { degreesToRadians as degreesToRadians2, radiansToDegrees } from "haoxin-excalidraw-
|
|
28065
|
-
import { getBoundTextElement as getBoundTextElement11 } from "haoxin-excalidraw-
|
|
28066
|
-
import { isArrowElement as isArrowElement10, isElbowArrow as isElbowArrow9 } from "haoxin-excalidraw-
|
|
28067
|
-
import { updateBindings as updateBindings3 } from "haoxin-excalidraw-
|
|
28128
|
+
import { degreesToRadians as degreesToRadians2, radiansToDegrees } from "@haoxin-web/excalidraw-math";
|
|
28129
|
+
import { getBoundTextElement as getBoundTextElement11 } from "@haoxin-web/excalidraw-element";
|
|
28130
|
+
import { isArrowElement as isArrowElement10, isElbowArrow as isElbowArrow9 } from "@haoxin-web/excalidraw-element";
|
|
28131
|
+
import { updateBindings as updateBindings3 } from "@haoxin-web/excalidraw-element";
|
|
28068
28132
|
|
|
28069
28133
|
// components/Stats/DragInput.tsx
|
|
28070
28134
|
import clsx51 from "clsx";
|
|
28071
28135
|
import { useEffect as useEffect38, useRef as useRef34, useState as useState32 } from "react";
|
|
28072
|
-
import { EVENT as EVENT13, KEYS as KEYS49, cloneJSON as cloneJSON4 } from "haoxin-excalidraw-
|
|
28073
|
-
import { deepCopyElement as deepCopyElement4 } from "haoxin-excalidraw-
|
|
28074
|
-
import { CaptureUpdateAction as CaptureUpdateAction36 } from "haoxin-excalidraw-
|
|
28136
|
+
import { EVENT as EVENT13, KEYS as KEYS49, cloneJSON as cloneJSON4 } from "@haoxin-web/excalidraw-common";
|
|
28137
|
+
import { deepCopyElement as deepCopyElement4 } from "@haoxin-web/excalidraw-element";
|
|
28138
|
+
import { CaptureUpdateAction as CaptureUpdateAction36 } from "@haoxin-web/excalidraw-element";
|
|
28075
28139
|
|
|
28076
28140
|
// components/Stats/utils.ts
|
|
28077
|
-
import { pointFrom as pointFrom25, pointRotateRads as pointRotateRads14 } from "haoxin-excalidraw-
|
|
28078
|
-
import { getBoundTextElement as getBoundTextElement10 } from "haoxin-excalidraw-
|
|
28079
|
-
import { isFrameLikeElement as isFrameLikeElement12 } from "haoxin-excalidraw-
|
|
28141
|
+
import { pointFrom as pointFrom25, pointRotateRads as pointRotateRads14 } from "@haoxin-web/excalidraw-math";
|
|
28142
|
+
import { getBoundTextElement as getBoundTextElement10 } from "@haoxin-web/excalidraw-element";
|
|
28143
|
+
import { isFrameLikeElement as isFrameLikeElement12 } from "@haoxin-web/excalidraw-element";
|
|
28080
28144
|
import {
|
|
28081
28145
|
getSelectedGroupIds as getSelectedGroupIds3,
|
|
28082
28146
|
getElementsInGroup as getElementsInGroup7,
|
|
28083
28147
|
isInGroup
|
|
28084
|
-
} from "haoxin-excalidraw-
|
|
28085
|
-
import { getFrameChildren as getFrameChildren5 } from "haoxin-excalidraw-
|
|
28086
|
-
import { updateBindings as updateBindings2 } from "haoxin-excalidraw-
|
|
28148
|
+
} from "@haoxin-web/excalidraw-element";
|
|
28149
|
+
import { getFrameChildren as getFrameChildren5 } from "@haoxin-web/excalidraw-element";
|
|
28150
|
+
import { updateBindings as updateBindings2 } from "@haoxin-web/excalidraw-element";
|
|
28087
28151
|
var SMALLEST_DELTA = 0.01;
|
|
28088
28152
|
var STEP_SIZE = 10;
|
|
28089
28153
|
var isPropertyEditable = (element, property) => {
|
|
@@ -28570,17 +28634,17 @@ var CanvasGrid = ({
|
|
|
28570
28634
|
var CanvasGrid_default = CanvasGrid;
|
|
28571
28635
|
|
|
28572
28636
|
// components/Stats/Dimension.tsx
|
|
28573
|
-
import { clamp as clamp5, round as round3 } from "haoxin-excalidraw-
|
|
28574
|
-
import { MIN_WIDTH_OR_HEIGHT } from "haoxin-excalidraw-
|
|
28637
|
+
import { clamp as clamp5, round as round3 } from "@haoxin-web/excalidraw-math";
|
|
28638
|
+
import { MIN_WIDTH_OR_HEIGHT } from "@haoxin-web/excalidraw-common";
|
|
28575
28639
|
import {
|
|
28576
28640
|
MINIMAL_CROP_SIZE,
|
|
28577
28641
|
getUncroppedWidthAndHeight
|
|
28578
|
-
} from "haoxin-excalidraw-
|
|
28579
|
-
import { resizeSingleElement } from "haoxin-excalidraw-
|
|
28580
|
-
import { isImageElement as isImageElement6 } from "haoxin-excalidraw-
|
|
28581
|
-
import { isFrameLikeElement as isFrameLikeElement13 } from "haoxin-excalidraw-
|
|
28582
|
-
import { getElementsInResizingFrame as getElementsInResizingFrame2 } from "haoxin-excalidraw-
|
|
28583
|
-
import { replaceAllElementsInFrame as replaceAllElementsInFrame2 } from "haoxin-excalidraw-
|
|
28642
|
+
} from "@haoxin-web/excalidraw-element";
|
|
28643
|
+
import { resizeSingleElement } from "@haoxin-web/excalidraw-element";
|
|
28644
|
+
import { isImageElement as isImageElement6 } from "@haoxin-web/excalidraw-element";
|
|
28645
|
+
import { isFrameLikeElement as isFrameLikeElement13 } from "@haoxin-web/excalidraw-element";
|
|
28646
|
+
import { getElementsInResizingFrame as getElementsInResizingFrame2 } from "@haoxin-web/excalidraw-element";
|
|
28647
|
+
import { replaceAllElementsInFrame as replaceAllElementsInFrame2 } from "@haoxin-web/excalidraw-element";
|
|
28584
28648
|
import { jsx as jsx128 } from "react/jsx-runtime";
|
|
28585
28649
|
var STEP_SIZE4 = 10;
|
|
28586
28650
|
var _shouldKeepAspectRatio = (element) => {
|
|
@@ -28840,8 +28904,8 @@ var Dimension_default = DimensionDragInput;
|
|
|
28840
28904
|
import {
|
|
28841
28905
|
getBoundTextElement as getBoundTextElement12,
|
|
28842
28906
|
redrawTextBoundingBox as redrawTextBoundingBox8
|
|
28843
|
-
} from "haoxin-excalidraw-
|
|
28844
|
-
import { hasBoundTextElement as hasBoundTextElement7, isTextElement as isTextElement16 } from "haoxin-excalidraw-
|
|
28907
|
+
} from "@haoxin-web/excalidraw-element";
|
|
28908
|
+
import { hasBoundTextElement as hasBoundTextElement7, isTextElement as isTextElement16 } from "@haoxin-web/excalidraw-element";
|
|
28845
28909
|
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
28846
28910
|
var MIN_FONT_SIZE = 4;
|
|
28847
28911
|
var STEP_SIZE5 = 4;
|
|
@@ -28907,10 +28971,10 @@ var FontSize = ({ element, scene, appState, property }) => {
|
|
|
28907
28971
|
var FontSize_default = FontSize;
|
|
28908
28972
|
|
|
28909
28973
|
// components/Stats/MultiAngle.tsx
|
|
28910
|
-
import { degreesToRadians as degreesToRadians3, radiansToDegrees as radiansToDegrees2 } from "haoxin-excalidraw-
|
|
28911
|
-
import { getBoundTextElement as getBoundTextElement13 } from "haoxin-excalidraw-
|
|
28912
|
-
import { isArrowElement as isArrowElement11 } from "haoxin-excalidraw-
|
|
28913
|
-
import { isInGroup as isInGroup2 } from "haoxin-excalidraw-
|
|
28974
|
+
import { degreesToRadians as degreesToRadians3, radiansToDegrees as radiansToDegrees2 } from "@haoxin-web/excalidraw-math";
|
|
28975
|
+
import { getBoundTextElement as getBoundTextElement13 } from "@haoxin-web/excalidraw-element";
|
|
28976
|
+
import { isArrowElement as isArrowElement11 } from "@haoxin-web/excalidraw-element";
|
|
28977
|
+
import { isInGroup as isInGroup2 } from "@haoxin-web/excalidraw-element";
|
|
28914
28978
|
import { jsx as jsx130 } from "react/jsx-runtime";
|
|
28915
28979
|
var STEP_SIZE6 = 15;
|
|
28916
28980
|
var handleDegreeChange2 = ({
|
|
@@ -29001,24 +29065,24 @@ var MultiAngle = ({
|
|
|
29001
29065
|
var MultiAngle_default = MultiAngle;
|
|
29002
29066
|
|
|
29003
29067
|
// components/Stats/MultiDimension.tsx
|
|
29004
|
-
import { pointFrom as pointFrom26 } from "haoxin-excalidraw-
|
|
29068
|
+
import { pointFrom as pointFrom26 } from "@haoxin-web/excalidraw-math";
|
|
29005
29069
|
import { useMemo as useMemo9 } from "react";
|
|
29006
|
-
import { MIN_WIDTH_OR_HEIGHT as MIN_WIDTH_OR_HEIGHT2 } from "haoxin-excalidraw-
|
|
29070
|
+
import { MIN_WIDTH_OR_HEIGHT as MIN_WIDTH_OR_HEIGHT2 } from "@haoxin-web/excalidraw-common";
|
|
29007
29071
|
import {
|
|
29008
29072
|
getElementsInResizingFrame as getElementsInResizingFrame3,
|
|
29009
29073
|
isFrameLikeElement as isFrameLikeElement14,
|
|
29010
29074
|
replaceAllElementsInFrame as replaceAllElementsInFrame3,
|
|
29011
29075
|
updateBoundElements as updateBoundElements2
|
|
29012
|
-
} from "haoxin-excalidraw-
|
|
29076
|
+
} from "@haoxin-web/excalidraw-element";
|
|
29013
29077
|
import {
|
|
29014
29078
|
rescalePointsInElement,
|
|
29015
29079
|
resizeSingleElement as resizeSingleElement2
|
|
29016
|
-
} from "haoxin-excalidraw-
|
|
29017
|
-
import { getBoundTextElement as getBoundTextElement14, handleBindTextResize as handleBindTextResize2 } from "haoxin-excalidraw-
|
|
29018
|
-
import { isTextElement as isTextElement17 } from "haoxin-excalidraw-
|
|
29080
|
+
} from "@haoxin-web/excalidraw-element";
|
|
29081
|
+
import { getBoundTextElement as getBoundTextElement14, handleBindTextResize as handleBindTextResize2 } from "@haoxin-web/excalidraw-element";
|
|
29082
|
+
import { isTextElement as isTextElement17 } from "@haoxin-web/excalidraw-element";
|
|
29019
29083
|
|
|
29020
29084
|
// ../utils/src/index.ts
|
|
29021
|
-
import { getCommonBounds as getCommonBounds8 } from "haoxin-excalidraw-
|
|
29085
|
+
import { getCommonBounds as getCommonBounds8 } from "@haoxin-web/excalidraw-element";
|
|
29022
29086
|
|
|
29023
29087
|
// components/Stats/MultiDimension.tsx
|
|
29024
29088
|
import { jsx as jsx131 } from "react/jsx-runtime";
|
|
@@ -29365,9 +29429,9 @@ var MultiDimension_default = MultiDimension;
|
|
|
29365
29429
|
import {
|
|
29366
29430
|
getBoundTextElement as getBoundTextElement15,
|
|
29367
29431
|
redrawTextBoundingBox as redrawTextBoundingBox9
|
|
29368
|
-
} from "haoxin-excalidraw-
|
|
29369
|
-
import { hasBoundTextElement as hasBoundTextElement8, isTextElement as isTextElement18 } from "haoxin-excalidraw-
|
|
29370
|
-
import { isInGroup as isInGroup3 } from "haoxin-excalidraw-
|
|
29432
|
+
} from "@haoxin-web/excalidraw-element";
|
|
29433
|
+
import { hasBoundTextElement as hasBoundTextElement8, isTextElement as isTextElement18 } from "@haoxin-web/excalidraw-element";
|
|
29434
|
+
import { isInGroup as isInGroup3 } from "@haoxin-web/excalidraw-element";
|
|
29371
29435
|
import { jsx as jsx132 } from "react/jsx-runtime";
|
|
29372
29436
|
var MIN_FONT_SIZE2 = 4;
|
|
29373
29437
|
var STEP_SIZE8 = 4;
|
|
@@ -29476,10 +29540,10 @@ var MultiFontSize = ({
|
|
|
29476
29540
|
var MultiFontSize_default = MultiFontSize;
|
|
29477
29541
|
|
|
29478
29542
|
// components/Stats/MultiPosition.tsx
|
|
29479
|
-
import { pointFrom as pointFrom27, pointRotateRads as pointRotateRads15 } from "haoxin-excalidraw-
|
|
29543
|
+
import { pointFrom as pointFrom27, pointRotateRads as pointRotateRads15 } from "@haoxin-web/excalidraw-math";
|
|
29480
29544
|
import { useMemo as useMemo10 } from "react";
|
|
29481
|
-
import { isTextElement as isTextElement19 } from "haoxin-excalidraw-
|
|
29482
|
-
import { getCommonBounds as getCommonBounds9 } from "haoxin-excalidraw-
|
|
29545
|
+
import { isTextElement as isTextElement19 } from "@haoxin-web/excalidraw-element";
|
|
29546
|
+
import { getCommonBounds as getCommonBounds9 } from "@haoxin-web/excalidraw-element";
|
|
29483
29547
|
import { jsx as jsx133 } from "react/jsx-runtime";
|
|
29484
29548
|
var moveElements = (property, changeInTopX, changeInTopY, originalElements, originalElementsMap, scene) => {
|
|
29485
29549
|
for (let i = 0; i < originalElements.length; i++) {
|
|
@@ -29656,12 +29720,12 @@ var MultiPosition = ({
|
|
|
29656
29720
|
var MultiPosition_default = MultiPosition;
|
|
29657
29721
|
|
|
29658
29722
|
// components/Stats/Position.tsx
|
|
29659
|
-
import { clamp as clamp6, pointFrom as pointFrom28, pointRotateRads as pointRotateRads16, round as round4 } from "haoxin-excalidraw-
|
|
29723
|
+
import { clamp as clamp6, pointFrom as pointFrom28, pointRotateRads as pointRotateRads16, round as round4 } from "@haoxin-web/excalidraw-math";
|
|
29660
29724
|
import {
|
|
29661
29725
|
getFlipAdjustedCropPosition,
|
|
29662
29726
|
getUncroppedWidthAndHeight as getUncroppedWidthAndHeight2
|
|
29663
|
-
} from "haoxin-excalidraw-
|
|
29664
|
-
import { isImageElement as isImageElement7 } from "haoxin-excalidraw-
|
|
29727
|
+
} from "@haoxin-web/excalidraw-element";
|
|
29728
|
+
import { isImageElement as isImageElement7 } from "@haoxin-web/excalidraw-element";
|
|
29665
29729
|
import { jsx as jsx134 } from "react/jsx-runtime";
|
|
29666
29730
|
var handlePositionChange2 = ({
|
|
29667
29731
|
accumulatedChange,
|
|
@@ -30136,11 +30200,11 @@ var StatsInner = memo5(
|
|
|
30136
30200
|
|
|
30137
30201
|
// components/ElementLinkDialog.tsx
|
|
30138
30202
|
import { useCallback as useCallback12, useEffect as useEffect40, useState as useState34 } from "react";
|
|
30139
|
-
import { normalizeLink as normalizeLink2, KEYS as KEYS50 } from "haoxin-excalidraw-
|
|
30203
|
+
import { normalizeLink as normalizeLink2, KEYS as KEYS50 } from "@haoxin-web/excalidraw-common";
|
|
30140
30204
|
import {
|
|
30141
30205
|
defaultGetElementLinkFromSelection as defaultGetElementLinkFromSelection2,
|
|
30142
30206
|
getLinkIdAndTypeFromSelection as getLinkIdAndTypeFromSelection2
|
|
30143
|
-
} from "haoxin-excalidraw-
|
|
30207
|
+
} from "@haoxin-web/excalidraw-element";
|
|
30144
30208
|
import { jsx as jsx136, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
30145
30209
|
var ElementLinkDialog = ({
|
|
30146
30210
|
sourceElementId,
|
|
@@ -30300,8 +30364,8 @@ var ErrorDialog = ({
|
|
|
30300
30364
|
|
|
30301
30365
|
// components/HelpDialog.tsx
|
|
30302
30366
|
import React39 from "react";
|
|
30303
|
-
import { isDarwin as isDarwin3, isFirefox as isFirefox3, isWindows as isWindows2 } from "haoxin-excalidraw-
|
|
30304
|
-
import { KEYS as KEYS51, getShortcutKey as getShortcutKey14 } from "haoxin-excalidraw-
|
|
30367
|
+
import { isDarwin as isDarwin3, isFirefox as isFirefox3, isWindows as isWindows2 } from "@haoxin-web/excalidraw-common";
|
|
30368
|
+
import { KEYS as KEYS51, getShortcutKey as getShortcutKey14 } from "@haoxin-web/excalidraw-common";
|
|
30305
30369
|
import { Fragment as Fragment22, jsx as jsx138, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
30306
30370
|
var Header = () => /* @__PURE__ */ jsxs74("div", { className: "HelpDialog__header", children: [
|
|
30307
30371
|
/* @__PURE__ */ jsxs74(
|
|
@@ -31005,7 +31069,7 @@ import {
|
|
|
31005
31069
|
isFirefox as isFirefox4,
|
|
31006
31070
|
EXPORT_SCALES as EXPORT_SCALES2,
|
|
31007
31071
|
cloneJSON as cloneJSON5
|
|
31008
|
-
} from "haoxin-excalidraw-
|
|
31072
|
+
} from "@haoxin-web/excalidraw-common";
|
|
31009
31073
|
|
|
31010
31074
|
// hooks/useCopiedIndicator.ts
|
|
31011
31075
|
import { useCallback as useCallback13, useRef as useRef35, useState as useState36 } from "react";
|
|
@@ -31394,7 +31458,7 @@ var ImageExportDialog = ({
|
|
|
31394
31458
|
|
|
31395
31459
|
// components/JSONExportDialog.tsx
|
|
31396
31460
|
import React41 from "react";
|
|
31397
|
-
import { getFrame } from "haoxin-excalidraw-
|
|
31461
|
+
import { getFrame } from "@haoxin-web/excalidraw-common";
|
|
31398
31462
|
|
|
31399
31463
|
// components/Card.tsx
|
|
31400
31464
|
import OpenColor3 from "open-color";
|
|
@@ -31857,7 +31921,10 @@ var LayerUI = ({
|
|
|
31857
31921
|
children,
|
|
31858
31922
|
app,
|
|
31859
31923
|
isCollaborating,
|
|
31860
|
-
generateLinkForSelection
|
|
31924
|
+
generateLinkForSelection,
|
|
31925
|
+
showZoomActions,
|
|
31926
|
+
showPanActions,
|
|
31927
|
+
showToolBar = true
|
|
31861
31928
|
}) => {
|
|
31862
31929
|
const device = useDevice();
|
|
31863
31930
|
const tunnels = useInitializeTunnels();
|
|
@@ -31902,13 +31969,20 @@ var LayerUI = ({
|
|
|
31902
31969
|
renderWelcomeScreen && /* @__PURE__ */ jsx145(tunnels.WelcomeScreenMenuHintTunnel.Out, {})
|
|
31903
31970
|
] });
|
|
31904
31971
|
const renderLeftToolbar = () => {
|
|
31905
|
-
if (appState.viewModeEnabled || appState.openDialog?.name === "elementLinkSelector") {
|
|
31972
|
+
if (appState.viewModeEnabled || appState.openDialog?.name === "elementLinkSelector" || !showToolBar) {
|
|
31906
31973
|
return null;
|
|
31907
31974
|
}
|
|
31908
31975
|
return /* @__PURE__ */ jsx145(FixedSideContainer, { side: "left", children: /* @__PURE__ */ jsx145("div", { className: "App-menu App-menu_left", children: /* @__PURE__ */ jsx145(Section, { heading: "shapes", className: "shapes-section-left", children: (heading) => /* @__PURE__ */ jsxs79("div", { style: { position: "relative" }, children: [
|
|
31909
31976
|
renderWelcomeScreen && /* @__PURE__ */ jsx145(tunnels.WelcomeScreenToolbarHintTunnel.Out, {}),
|
|
31910
31977
|
/* @__PURE__ */ jsxs79(Stack_default.Col, { gap: 4, align: "center", children: [
|
|
31911
|
-
/* @__PURE__ */ jsx145(
|
|
31978
|
+
/* @__PURE__ */ jsx145(
|
|
31979
|
+
LeftMainToolbar_default,
|
|
31980
|
+
{
|
|
31981
|
+
appState,
|
|
31982
|
+
app,
|
|
31983
|
+
visible: showToolBar
|
|
31984
|
+
}
|
|
31985
|
+
),
|
|
31912
31986
|
isCollaborating && /* @__PURE__ */ jsx145(
|
|
31913
31987
|
Island,
|
|
31914
31988
|
{
|
|
@@ -31934,7 +32008,15 @@ var LayerUI = ({
|
|
|
31934
32008
|
const renderFixedSideContainer = () => {
|
|
31935
32009
|
const shouldShowStats = appState.stats.open && !appState.zenModeEnabled && !appState.viewModeEnabled && appState.openDialog?.name !== "elementLinkSelector";
|
|
31936
32010
|
return /* @__PURE__ */ jsx145(FixedSideContainer, { side: "top", children: /* @__PURE__ */ jsxs79("div", { className: "App-menu App-menu_top", children: [
|
|
31937
|
-
/* @__PURE__ */ jsx145(
|
|
32011
|
+
/* @__PURE__ */ jsx145(
|
|
32012
|
+
Stack_default.Col,
|
|
32013
|
+
{
|
|
32014
|
+
gap: 6,
|
|
32015
|
+
className: clsx55("App-menu_top__left"),
|
|
32016
|
+
style: { display: "none" },
|
|
32017
|
+
children: renderCanvasActions()
|
|
32018
|
+
}
|
|
32019
|
+
),
|
|
31938
32020
|
/* @__PURE__ */ jsxs79(
|
|
31939
32021
|
"div",
|
|
31940
32022
|
{
|
|
@@ -32102,7 +32184,8 @@ var LayerUI = ({
|
|
|
32102
32184
|
renderSidebars,
|
|
32103
32185
|
device,
|
|
32104
32186
|
renderWelcomeScreen,
|
|
32105
|
-
UIOptions
|
|
32187
|
+
UIOptions,
|
|
32188
|
+
showPanActions
|
|
32106
32189
|
}
|
|
32107
32190
|
),
|
|
32108
32191
|
!device.editor.isMobile && /* @__PURE__ */ jsxs79(Fragment24, { children: [
|
|
@@ -32121,7 +32204,8 @@ var LayerUI = ({
|
|
|
32121
32204
|
appState,
|
|
32122
32205
|
actionManager,
|
|
32123
32206
|
showExitZenModeBtn,
|
|
32124
|
-
renderWelcomeScreen
|
|
32207
|
+
renderWelcomeScreen,
|
|
32208
|
+
showZoomActions
|
|
32125
32209
|
}
|
|
32126
32210
|
),
|
|
32127
32211
|
appState.scrolledOutside && /* @__PURE__ */ jsx145(
|
|
@@ -32145,16 +32229,17 @@ var LayerUI = ({
|
|
|
32145
32229
|
] });
|
|
32146
32230
|
return /* @__PURE__ */ jsx145(UIAppStateContext.Provider, { value: appState, children: /* @__PURE__ */ jsx145(TunnelsJotaiProvider, { children: /* @__PURE__ */ jsxs79(TunnelsContext.Provider, { value: tunnels, children: [
|
|
32147
32231
|
layerUIJSX,
|
|
32148
|
-
!appState.viewModeEnabled && /* @__PURE__ */ jsx145(
|
|
32232
|
+
!appState.viewModeEnabled && showToolBar && /* @__PURE__ */ jsx145(
|
|
32149
32233
|
LeftToolFlyouts_default,
|
|
32150
32234
|
{
|
|
32151
32235
|
appState,
|
|
32152
32236
|
app,
|
|
32153
32237
|
actionManager,
|
|
32154
|
-
elements
|
|
32238
|
+
elements,
|
|
32239
|
+
showToolBar
|
|
32155
32240
|
}
|
|
32156
32241
|
),
|
|
32157
|
-
!device.editor.isMobile && !appState.viewModeEnabled && /* @__PURE__ */ jsx145(
|
|
32242
|
+
!device.editor.isMobile && !appState.viewModeEnabled && showToolBar && /* @__PURE__ */ jsx145(
|
|
32158
32243
|
TopLeftToolbar,
|
|
32159
32244
|
{
|
|
32160
32245
|
appState,
|
|
@@ -32255,7 +32340,7 @@ import {
|
|
|
32255
32340
|
CURSOR_TYPE as CURSOR_TYPE3,
|
|
32256
32341
|
isShallowEqual as isShallowEqual6,
|
|
32257
32342
|
sceneCoordsToViewportCoords as sceneCoordsToViewportCoords5
|
|
32258
|
-
} from "haoxin-excalidraw-
|
|
32343
|
+
} from "@haoxin-web/excalidraw-common";
|
|
32259
32344
|
import { jsx as jsx148 } from "react/jsx-runtime";
|
|
32260
32345
|
var InteractiveCanvas = (props) => {
|
|
32261
32346
|
const isComponentMounted = useRef39(false);
|
|
@@ -32400,7 +32485,7 @@ var InteractiveCanvas_default = React44.memo(InteractiveCanvas, areEqual3);
|
|
|
32400
32485
|
|
|
32401
32486
|
// components/canvases/StaticCanvas.tsx
|
|
32402
32487
|
import React45, { useEffect as useEffect45, useRef as useRef40 } from "react";
|
|
32403
|
-
import { isShallowEqual as isShallowEqual7 } from "haoxin-excalidraw-
|
|
32488
|
+
import { isShallowEqual as isShallowEqual7 } from "@haoxin-web/excalidraw-common";
|
|
32404
32489
|
import { jsx as jsx149 } from "react/jsx-runtime";
|
|
32405
32490
|
var StaticCanvas = (props) => {
|
|
32406
32491
|
const wrapperRef = useRef40(null);
|
|
@@ -32486,13 +32571,13 @@ var StaticCanvas_default = React45.memo(StaticCanvas, areEqual4);
|
|
|
32486
32571
|
import { useEffect as useEffect46, useRef as useRef41 } from "react";
|
|
32487
32572
|
|
|
32488
32573
|
// renderer/renderNewElementScene.ts
|
|
32489
|
-
import { throttleRAF as throttleRAF3 } from "haoxin-excalidraw-
|
|
32574
|
+
import { throttleRAF as throttleRAF3 } from "@haoxin-web/excalidraw-common";
|
|
32490
32575
|
import {
|
|
32491
32576
|
getTargetFrame,
|
|
32492
32577
|
isInvisiblySmallElement as isInvisiblySmallElement2,
|
|
32493
32578
|
renderElement,
|
|
32494
32579
|
shouldApplyFrameClip
|
|
32495
|
-
} from "haoxin-excalidraw-
|
|
32580
|
+
} from "@haoxin-web/excalidraw-element";
|
|
32496
32581
|
var _renderNewElementScene = ({
|
|
32497
32582
|
canvas,
|
|
32498
32583
|
rc,
|
|
@@ -32652,8 +32737,8 @@ import {
|
|
|
32652
32737
|
getCommonBounds as getCommonBounds11,
|
|
32653
32738
|
getElementsInGroup as getElementsInGroup8,
|
|
32654
32739
|
selectGroupsFromGivenElements as selectGroupsFromGivenElements4
|
|
32655
|
-
} from "haoxin-excalidraw-
|
|
32656
|
-
import { sceneCoordsToViewportCoords as sceneCoordsToViewportCoords6 } from "haoxin-excalidraw-
|
|
32740
|
+
} from "@haoxin-web/excalidraw-element";
|
|
32741
|
+
import { sceneCoordsToViewportCoords as sceneCoordsToViewportCoords6 } from "@haoxin-web/excalidraw-common";
|
|
32657
32742
|
import { flushSync as flushSync2 } from "react-dom";
|
|
32658
32743
|
import { jsx as jsx152 } from "react/jsx-runtime";
|
|
32659
32744
|
var UnlockPopup = ({
|
|
@@ -33857,10 +33942,27 @@ var App = class _App extends React46.Component {
|
|
|
33857
33942
|
}
|
|
33858
33943
|
});
|
|
33859
33944
|
/** use when changing scrollX/scrollY/zoom based on user interaction */
|
|
33860
|
-
__publicField(this, "translateCanvas", (state) => {
|
|
33945
|
+
__publicField(this, "translateCanvas", (state, callback) => {
|
|
33946
|
+
if (this.props.showPanActions === false) {
|
|
33947
|
+
if (typeof state === "function") {
|
|
33948
|
+
const wrappedStateFn = (prevState) => {
|
|
33949
|
+
const nextState = state(prevState);
|
|
33950
|
+
if (nextState.scrollX !== prevState.scrollX || nextState.scrollY !== prevState.scrollY) {
|
|
33951
|
+
return prevState;
|
|
33952
|
+
}
|
|
33953
|
+
return nextState;
|
|
33954
|
+
};
|
|
33955
|
+
this.cancelInProgressAnimation?.();
|
|
33956
|
+
this.maybeUnfollowRemoteUser();
|
|
33957
|
+
this.setState(wrappedStateFn, callback);
|
|
33958
|
+
return;
|
|
33959
|
+
} else if (state.scrollX !== void 0 || state.scrollY !== void 0) {
|
|
33960
|
+
return;
|
|
33961
|
+
}
|
|
33962
|
+
}
|
|
33861
33963
|
this.cancelInProgressAnimation?.();
|
|
33862
33964
|
this.maybeUnfollowRemoteUser();
|
|
33863
|
-
this.setState(state);
|
|
33965
|
+
this.setState(state, callback);
|
|
33864
33966
|
});
|
|
33865
33967
|
__publicField(this, "setToast", (toast) => {
|
|
33866
33968
|
this.setState({ toast });
|
|
@@ -33953,7 +34055,7 @@ var App = class _App extends React46.Component {
|
|
|
33953
34055
|
* This method has the same signature as updateScene but marks the
|
|
33954
34056
|
* onChange callback with source: "updateSceneSilently" so consumers
|
|
33955
34057
|
* can choose how to handle it.
|
|
33956
|
-
*
|
|
34058
|
+
*
|
|
33957
34059
|
* Use this method when you need to update the canvas programmatically
|
|
33958
34060
|
* and want to inform consumers that this was a programmatic update.
|
|
33959
34061
|
*/
|
|
@@ -34043,6 +34145,24 @@ var App = class _App extends React46.Component {
|
|
|
34043
34145
|
left: Math.max(propertiesPanelRect?.right ?? 0, 0) + PADDING
|
|
34044
34146
|
};
|
|
34045
34147
|
});
|
|
34148
|
+
__publicField(this, "zoomToFit", () => {
|
|
34149
|
+
console.log("\u{1F50D} \u8C03\u7528 zoomToFit \u65B9\u6CD5");
|
|
34150
|
+
const result = zoomToFit({
|
|
34151
|
+
targetElements: this.scene.getNonDeletedElements(),
|
|
34152
|
+
appState: {
|
|
34153
|
+
...this.state,
|
|
34154
|
+
userToFollow: null
|
|
34155
|
+
},
|
|
34156
|
+
fitToViewport: false,
|
|
34157
|
+
canvasOffsets: {}
|
|
34158
|
+
});
|
|
34159
|
+
if (result) {
|
|
34160
|
+
console.log("\u2705 zoomToFit \u6210\u529F\u6267\u884C\uFF0C\u66F4\u65B0\u573A\u666F");
|
|
34161
|
+
this.updateScene(result);
|
|
34162
|
+
} else {
|
|
34163
|
+
console.log("\u26A0\uFE0F zoomToFit \u6CA1\u6709\u8FD4\u56DE\u7ED3\u679C\uFF0C\u53EF\u80FD\u6CA1\u6709\u5143\u7D20\u9700\u8981\u7F29\u653E");
|
|
34164
|
+
}
|
|
34165
|
+
});
|
|
34046
34166
|
// Input handling
|
|
34047
34167
|
__publicField(this, "onKeyDown", withBatchedUpdates(
|
|
34048
34168
|
(event) => {
|
|
@@ -34368,7 +34488,7 @@ var App = class _App extends React46.Component {
|
|
|
34368
34488
|
event.stopPropagation();
|
|
34369
34489
|
}
|
|
34370
34490
|
}
|
|
34371
|
-
if (event.key === KEYS52.SPACE && gesture.pointers.size === 0) {
|
|
34491
|
+
if (event.key === KEYS52.SPACE && gesture.pointers.size === 0 && this.props.showPanActions !== false) {
|
|
34372
34492
|
isHoldingSpace = true;
|
|
34373
34493
|
setCursor(this.interactiveCanvas, CURSOR_TYPE4.GRAB);
|
|
34374
34494
|
event.preventDefault();
|
|
@@ -35755,7 +35875,7 @@ var App = class _App extends React46.Component {
|
|
|
35755
35875
|
});
|
|
35756
35876
|
// Returns whether the event is a panning
|
|
35757
35877
|
__publicField(this, "handleCanvasPanUsingWheelOrSpaceDrag", (event) => {
|
|
35758
|
-
if (!(gesture.pointers.size <= 1 && (event.button === POINTER_BUTTON2.WHEEL || event.button === POINTER_BUTTON2.MAIN && isHoldingSpace || isHandToolActive(this.state) || this.state.viewModeEnabled))) {
|
|
35878
|
+
if (!(this.props.showPanActions !== false && gesture.pointers.size <= 1 && (event.button === POINTER_BUTTON2.WHEEL || event.button === POINTER_BUTTON2.MAIN && isHoldingSpace || isHandToolActive(this.state) || this.state.viewModeEnabled))) {
|
|
35759
35879
|
return false;
|
|
35760
35880
|
}
|
|
35761
35881
|
isPanning = true;
|
|
@@ -37336,17 +37456,19 @@ var App = class _App extends React46.Component {
|
|
|
37336
37456
|
this.resetShouldCacheIgnoreZoomDebounced();
|
|
37337
37457
|
return;
|
|
37338
37458
|
}
|
|
37339
|
-
if (event.shiftKey) {
|
|
37459
|
+
if (event.shiftKey && this.props.showPanActions !== false) {
|
|
37340
37460
|
this.translateCanvas(({ zoom, scrollX }) => ({
|
|
37341
37461
|
// on Mac, shift+wheel tends to result in deltaX
|
|
37342
37462
|
scrollX: scrollX - (deltaY || deltaX) / zoom.value
|
|
37343
37463
|
}));
|
|
37344
37464
|
return;
|
|
37345
37465
|
}
|
|
37346
|
-
this.
|
|
37347
|
-
|
|
37348
|
-
|
|
37349
|
-
|
|
37466
|
+
if (this.props.showPanActions !== false) {
|
|
37467
|
+
this.translateCanvas(({ zoom, scrollX, scrollY }) => ({
|
|
37468
|
+
scrollX: scrollX - deltaX / zoom.value,
|
|
37469
|
+
scrollY: scrollY - deltaY / zoom.value
|
|
37470
|
+
}));
|
|
37471
|
+
}
|
|
37350
37472
|
}
|
|
37351
37473
|
));
|
|
37352
37474
|
__publicField(this, "savePointer", (x, y, button) => {
|
|
@@ -37466,6 +37588,7 @@ var App = class _App extends React46.Component {
|
|
|
37466
37588
|
clear: this.resetHistory
|
|
37467
37589
|
},
|
|
37468
37590
|
scrollToContent: this.scrollToContent,
|
|
37591
|
+
zoomToFit: this.zoomToFit,
|
|
37469
37592
|
getSceneElements: this.getSceneElements,
|
|
37470
37593
|
getAppState: () => this.state,
|
|
37471
37594
|
getFiles: () => this.files,
|
|
@@ -37939,6 +38062,9 @@ var App = class _App extends React46.Component {
|
|
|
37939
38062
|
app: this,
|
|
37940
38063
|
isCollaborating: this.props.isCollaborating,
|
|
37941
38064
|
generateLinkForSelection: this.props.generateLinkForSelection,
|
|
38065
|
+
showZoomActions: this.props.showZoomActions,
|
|
38066
|
+
showPanActions: this.props.showPanActions,
|
|
38067
|
+
showToolBar: this.props.showToolBar,
|
|
37942
38068
|
children: this.props.children
|
|
37943
38069
|
}
|
|
37944
38070
|
),
|
|
@@ -38839,8 +38965,14 @@ var App = class _App extends React46.Component {
|
|
|
38839
38965
|
const currentStyle = _element.customData?.textStyle || {};
|
|
38840
38966
|
const pick = (cur, st) => cur === void 0 ? !!st : !!cur;
|
|
38841
38967
|
const nextStyle = {
|
|
38842
|
-
bold: pick(
|
|
38843
|
-
|
|
38968
|
+
bold: pick(
|
|
38969
|
+
currentStyle.bold,
|
|
38970
|
+
this.state.currentTextBold
|
|
38971
|
+
),
|
|
38972
|
+
italic: pick(
|
|
38973
|
+
currentStyle.italic,
|
|
38974
|
+
this.state.currentTextItalic
|
|
38975
|
+
),
|
|
38844
38976
|
underline: pick(
|
|
38845
38977
|
currentStyle.underline,
|
|
38846
38978
|
this.state.currentTextUnderline
|
|
@@ -38860,7 +38992,10 @@ var App = class _App extends React46.Component {
|
|
|
38860
38992
|
elementsMap,
|
|
38861
38993
|
nextOriginalText
|
|
38862
38994
|
),
|
|
38863
|
-
customData: {
|
|
38995
|
+
customData: {
|
|
38996
|
+
..._element.customData || {},
|
|
38997
|
+
textStyle: nextStyle
|
|
38998
|
+
}
|
|
38864
38999
|
});
|
|
38865
39000
|
}
|
|
38866
39001
|
return _element;
|
|
@@ -41058,18 +41193,18 @@ import {
|
|
|
41058
41193
|
hashElementsVersion as hashElementsVersion2,
|
|
41059
41194
|
hashString as hashString2,
|
|
41060
41195
|
getNonDeletedElements as getNonDeletedElements14
|
|
41061
|
-
} from "haoxin-excalidraw-
|
|
41062
|
-
import { getTextFromElements as getTextFromElements2 } from "haoxin-excalidraw-
|
|
41063
|
-
import { isInvisiblySmallElement as isInvisiblySmallElement4 } from "haoxin-excalidraw-
|
|
41196
|
+
} from "@haoxin-web/excalidraw-element";
|
|
41197
|
+
import { getTextFromElements as getTextFromElements2 } from "@haoxin-web/excalidraw-element";
|
|
41198
|
+
import { isInvisiblySmallElement as isInvisiblySmallElement4 } from "@haoxin-web/excalidraw-element";
|
|
41064
41199
|
|
|
41065
41200
|
// data/reconcile.ts
|
|
41066
41201
|
import throttle4 from "lodash.throttle";
|
|
41067
|
-
import { arrayToMap as arrayToMap28, isDevEnv as isDevEnv12, isTestEnv as isTestEnv7 } from "haoxin-excalidraw-
|
|
41202
|
+
import { arrayToMap as arrayToMap28, isDevEnv as isDevEnv12, isTestEnv as isTestEnv7 } from "@haoxin-web/excalidraw-common";
|
|
41068
41203
|
import {
|
|
41069
41204
|
orderByFractionalIndex as orderByFractionalIndex2,
|
|
41070
41205
|
syncInvalidIndices as syncInvalidIndices3,
|
|
41071
41206
|
validateFractionalIndices
|
|
41072
|
-
} from "haoxin-excalidraw-
|
|
41207
|
+
} from "@haoxin-web/excalidraw-element";
|
|
41073
41208
|
var shouldDiscardRemoteElement = (localAppState, local, remote) => {
|
|
41074
41209
|
if (local && // local element is being edited
|
|
41075
41210
|
(local.id === localAppState.editingTextElement?.id || local.id === localAppState.resizingElement?.id || local.id === localAppState.newElement?.id || // local element is newer
|
|
@@ -41134,8 +41269,8 @@ var reconcileElements = (localElements, remoteElements, localAppState) => {
|
|
|
41134
41269
|
};
|
|
41135
41270
|
|
|
41136
41271
|
// index.tsx
|
|
41137
|
-
import { getFreeDrawSvgPath as getFreeDrawSvgPath2 } from "haoxin-excalidraw-
|
|
41138
|
-
import { isLinearElement as isLinearElement14 } from "haoxin-excalidraw-
|
|
41272
|
+
import { getFreeDrawSvgPath as getFreeDrawSvgPath2 } from "@haoxin-web/excalidraw-element";
|
|
41273
|
+
import { isLinearElement as isLinearElement14 } from "@haoxin-web/excalidraw-element";
|
|
41139
41274
|
import {
|
|
41140
41275
|
FONT_FAMILY as FONT_FAMILY5,
|
|
41141
41276
|
THEME as THEME16,
|
|
@@ -41144,17 +41279,17 @@ import {
|
|
|
41144
41279
|
DEFAULT_LASER_COLOR as DEFAULT_LASER_COLOR2,
|
|
41145
41280
|
UserIdleState as UserIdleState2,
|
|
41146
41281
|
normalizeLink as normalizeLink4
|
|
41147
|
-
} from "haoxin-excalidraw-
|
|
41282
|
+
} from "@haoxin-web/excalidraw-common";
|
|
41148
41283
|
import {
|
|
41149
41284
|
mutateElement as mutateElement2,
|
|
41150
41285
|
newElementWith as newElementWith13,
|
|
41151
41286
|
bumpVersion
|
|
41152
|
-
} from "haoxin-excalidraw-
|
|
41153
|
-
import { CaptureUpdateAction as CaptureUpdateAction38 } from "haoxin-excalidraw-
|
|
41287
|
+
} from "@haoxin-web/excalidraw-element";
|
|
41288
|
+
import { CaptureUpdateAction as CaptureUpdateAction38 } from "@haoxin-web/excalidraw-element";
|
|
41154
41289
|
import {
|
|
41155
41290
|
sceneCoordsToViewportCoords as sceneCoordsToViewportCoords2,
|
|
41156
41291
|
viewportCoordsToSceneCoords as viewportCoordsToSceneCoords5
|
|
41157
|
-
} from "haoxin-excalidraw-
|
|
41292
|
+
} from "@haoxin-web/excalidraw-common";
|
|
41158
41293
|
|
|
41159
41294
|
// components/TTDDialog/TTDDialogTrigger.tsx
|
|
41160
41295
|
import { jsx as jsx161, jsxs as jsxs88 } from "react/jsx-runtime";
|
|
@@ -41182,7 +41317,7 @@ var TTDDialogTrigger = ({
|
|
|
41182
41317
|
TTDDialogTrigger.displayName = "TTDDialogTrigger";
|
|
41183
41318
|
|
|
41184
41319
|
// index.tsx
|
|
41185
|
-
import { getCommonBounds as getCommonBounds13, getVisibleSceneBounds as getVisibleSceneBounds2 } from "haoxin-excalidraw-
|
|
41320
|
+
import { getCommonBounds as getCommonBounds13, getVisibleSceneBounds as getVisibleSceneBounds2 } from "@haoxin-web/excalidraw-element";
|
|
41186
41321
|
|
|
41187
41322
|
// components/DiagramToCodePlugin/DiagramToCodePlugin.tsx
|
|
41188
41323
|
import { useLayoutEffect as useLayoutEffect9 } from "react";
|
|
@@ -41197,11 +41332,12 @@ var DiagramToCodePlugin = (props) => {
|
|
|
41197
41332
|
};
|
|
41198
41333
|
|
|
41199
41334
|
// index.tsx
|
|
41200
|
-
import { isElementLink as isElementLink3 } from "haoxin-excalidraw-
|
|
41201
|
-
import { setCustomTextMetricsProvider } from "haoxin-excalidraw-
|
|
41335
|
+
import { isElementLink as isElementLink3 } from "@haoxin-web/excalidraw-element";
|
|
41336
|
+
import { setCustomTextMetricsProvider } from "@haoxin-web/excalidraw-element";
|
|
41202
41337
|
import { jsx as jsx162 } from "react/jsx-runtime";
|
|
41203
41338
|
polyfill_default();
|
|
41204
41339
|
var ExcalidrawBase = (props) => {
|
|
41340
|
+
console.log("\u4F7F\u7528\u4E86\u7EC4\u4EF6=====Excalidraw component initialized");
|
|
41205
41341
|
const {
|
|
41206
41342
|
onChange,
|
|
41207
41343
|
onIncrement,
|
|
@@ -41235,7 +41371,10 @@ var ExcalidrawBase = (props) => {
|
|
|
41235
41371
|
renderEmbeddable,
|
|
41236
41372
|
aiEnabled,
|
|
41237
41373
|
showDeprecatedFonts,
|
|
41238
|
-
renderScrollbars
|
|
41374
|
+
renderScrollbars,
|
|
41375
|
+
showZoomActions,
|
|
41376
|
+
showPanActions,
|
|
41377
|
+
showToolBar
|
|
41239
41378
|
} = props;
|
|
41240
41379
|
const canvasActions = props.UIOptions?.canvasActions;
|
|
41241
41380
|
const UIOptions = {
|
|
@@ -41307,6 +41446,9 @@ var ExcalidrawBase = (props) => {
|
|
|
41307
41446
|
aiEnabled: aiEnabled !== false,
|
|
41308
41447
|
showDeprecatedFonts,
|
|
41309
41448
|
renderScrollbars,
|
|
41449
|
+
showZoomActions,
|
|
41450
|
+
showPanActions,
|
|
41451
|
+
showToolBar,
|
|
41310
41452
|
children
|
|
41311
41453
|
}
|
|
41312
41454
|
) }) });
|