@nous-excalidraw/excalidraw 0.18.9-beta.21 → 0.18.9-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/{chunk-6PNL5SR6.js → chunk-NJT6NRP4.js} +3 -3
- package/dist/dev/{chunk-FGNDYJ2B.js → chunk-NLSPUT7I.js} +2 -2
- package/dist/dev/components/TTDDialog/{CodeMirrorEditor-LUWBT76B.js → CodeMirrorEditor-FWL3IAFT.js} +2 -2
- package/dist/dev/data/{image-5IO6LC6F.js → image-PPDUIIUO.js} +3 -3
- package/dist/dev/index.js +79 -63
- 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-YAGSAM37.js → chunk-NVZF4XB3.js} +2 -2
- package/dist/prod/{chunk-TFET7NMD.js → chunk-XN6AQKMR.js} +1 -1
- package/dist/prod/components/TTDDialog/{CodeMirrorEditor-QL4RYZUZ.js → CodeMirrorEditor-7VTRX6DQ.js} +1 -1
- package/dist/prod/data/image-S4BV24I2.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/actionFrame.d.ts +1 -471
- package/dist/types/excalidraw/components/App.d.ts +1 -5
- package/dist/types/excalidraw/index.d.ts +1 -0
- package/dist/types/excalidraw/scene/types.d.ts +0 -3
- package/dist/types/excalidraw/types.d.ts +3 -3
- package/package.json +1 -1
- package/dist/prod/data/image-LRQMDLTI.js +0 -1
- /package/dist/dev/{chunk-6PNL5SR6.js.map → chunk-NJT6NRP4.js.map} +0 -0
- /package/dist/dev/{chunk-FGNDYJ2B.js.map → chunk-NLSPUT7I.js.map} +0 -0
- /package/dist/dev/components/TTDDialog/{CodeMirrorEditor-LUWBT76B.js.map → CodeMirrorEditor-FWL3IAFT.js.map} +0 -0
- /package/dist/dev/data/{image-5IO6LC6F.js.map → image-PPDUIIUO.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
define_import_meta_env_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NLSPUT7I.js";
|
|
4
4
|
import {
|
|
5
5
|
__publicField
|
|
6
6
|
} from "./chunk-XDFCUUT6.js";
|
|
@@ -5112,7 +5112,7 @@ var parseFileContents = async (blob) => {
|
|
|
5112
5112
|
let contents;
|
|
5113
5113
|
if (blob.type === MIME_TYPES6.png) {
|
|
5114
5114
|
try {
|
|
5115
|
-
return await (await import("./data/image-
|
|
5115
|
+
return await (await import("./data/image-PPDUIIUO.js")).decodePngMetadata(blob);
|
|
5116
5116
|
} catch (error) {
|
|
5117
5117
|
if (error.message === "INVALID") {
|
|
5118
5118
|
throw new ImageSceneDataError(
|
|
@@ -5546,4 +5546,4 @@ export {
|
|
|
5546
5546
|
createFile,
|
|
5547
5547
|
normalizeFile
|
|
5548
5548
|
};
|
|
5549
|
-
//# sourceMappingURL=chunk-
|
|
5549
|
+
//# sourceMappingURL=chunk-NJT6NRP4.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// <define:import.meta.env>
|
|
2
|
-
var define_import_meta_env_default = { MODE: "development", VITE_APP_BACKEND_V2_GET_URL: "https://json-dev.excalidraw.com/api/v2/", VITE_APP_BACKEND_V2_POST_URL: "https://json-dev.excalidraw.com/api/v2/post/", VITE_APP_LIBRARY_URL: "https://libraries.excalidraw.com", VITE_APP_LIBRARY_BACKEND: "https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries", VITE_APP_WS_SERVER_URL: "http://localhost:3002", VITE_APP_PLUS_LP: "https://plus.excalidraw.com", VITE_APP_PLUS_APP: "http://localhost:3000", VITE_APP_AI_BACKEND: "http://localhost:3016", VITE_APP_FIREBASE_CONFIG: '{"apiKey":"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8","authDomain":"excalidraw-oss-dev.firebaseapp.com","projectId":"excalidraw-oss-dev","storageBucket":"excalidraw-oss-dev.appspot.com","messagingSenderId":"664559512677","appId":"1:664559512677:web:a385181f2928d328a7aa8c"}', VITE_APP_DEV_DISABLE_LIVE_RELOAD: "", VITE_APP_ENABLE_TRACKING: "true", FAST_REFRESH: "false", VITE_APP_PORT: "3001", VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX: "", VITE_APP_COLLAPSE_OVERLAY: "true", VITE_APP_ENABLE_ESLINT: "true", VITE_APP_ENABLE_PWA: "false", VITE_APP_PLUS_EXPORT_PUBLIC_KEY: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\nHQIDAQAB", VITE_APP_DISABLE_PREVENT_UNLOAD: "", PKG_NAME: "@nous-excalidraw/excalidraw", PKG_VERSION: "0.18.9-beta.
|
|
2
|
+
var define_import_meta_env_default = { MODE: "development", VITE_APP_BACKEND_V2_GET_URL: "https://json-dev.excalidraw.com/api/v2/", VITE_APP_BACKEND_V2_POST_URL: "https://json-dev.excalidraw.com/api/v2/post/", VITE_APP_LIBRARY_URL: "https://libraries.excalidraw.com", VITE_APP_LIBRARY_BACKEND: "https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries", VITE_APP_WS_SERVER_URL: "http://localhost:3002", VITE_APP_PLUS_LP: "https://plus.excalidraw.com", VITE_APP_PLUS_APP: "http://localhost:3000", VITE_APP_AI_BACKEND: "http://localhost:3016", VITE_APP_FIREBASE_CONFIG: '{"apiKey":"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8","authDomain":"excalidraw-oss-dev.firebaseapp.com","projectId":"excalidraw-oss-dev","storageBucket":"excalidraw-oss-dev.appspot.com","messagingSenderId":"664559512677","appId":"1:664559512677:web:a385181f2928d328a7aa8c"}', VITE_APP_DEV_DISABLE_LIVE_RELOAD: "", VITE_APP_ENABLE_TRACKING: "true", FAST_REFRESH: "false", VITE_APP_PORT: "3001", VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX: "", VITE_APP_COLLAPSE_OVERLAY: "true", VITE_APP_ENABLE_ESLINT: "true", VITE_APP_ENABLE_PWA: "false", VITE_APP_PLUS_EXPORT_PUBLIC_KEY: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\nHQIDAQAB", VITE_APP_DISABLE_PREVENT_UNLOAD: "", PKG_NAME: "@nous-excalidraw/excalidraw", PKG_VERSION: "0.18.9-beta.22", DEV: true };
|
|
3
3
|
|
|
4
4
|
export {
|
|
5
5
|
define_import_meta_env_default
|
|
6
6
|
};
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-NLSPUT7I.js.map
|
package/dist/dev/components/TTDDialog/{CodeMirrorEditor-LUWBT76B.js → CodeMirrorEditor-FWL3IAFT.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../chunk-
|
|
1
|
+
import "../../chunk-NLSPUT7I.js";
|
|
2
2
|
import "../../chunk-XDFCUUT6.js";
|
|
3
3
|
|
|
4
4
|
// components/TTDDialog/CodeMirrorEditor.tsx
|
|
@@ -256,4 +256,4 @@ var CodeMirrorEditor_default = CodeMirrorEditor;
|
|
|
256
256
|
export {
|
|
257
257
|
CodeMirrorEditor_default as default
|
|
258
258
|
};
|
|
259
|
-
//# sourceMappingURL=CodeMirrorEditor-
|
|
259
|
+
//# sourceMappingURL=CodeMirrorEditor-FWL3IAFT.js.map
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
decodePngMetadata,
|
|
3
3
|
encodePngMetadata,
|
|
4
4
|
getTEXtChunk
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-NJT6NRP4.js";
|
|
6
|
+
import "../chunk-NLSPUT7I.js";
|
|
7
7
|
import "../chunk-XDFCUUT6.js";
|
|
8
8
|
export {
|
|
9
9
|
decodePngMetadata,
|
|
10
10
|
encodePngMetadata,
|
|
11
11
|
getTEXtChunk
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=image-
|
|
13
|
+
//# sourceMappingURL=image-PPDUIIUO.js.map
|
package/dist/dev/index.js
CHANGED
|
@@ -65,10 +65,10 @@ import {
|
|
|
65
65
|
serializeAsJSON,
|
|
66
66
|
serializeLibraryAsJSON,
|
|
67
67
|
strokeRectWithRotation_simple
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-NJT6NRP4.js";
|
|
69
69
|
import {
|
|
70
70
|
define_import_meta_env_default
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-NLSPUT7I.js";
|
|
72
72
|
import {
|
|
73
73
|
en_default
|
|
74
74
|
} from "./chunk-IXBA2ET3.js";
|
|
@@ -175,7 +175,7 @@ import {
|
|
|
175
175
|
wrapEvent as wrapEvent2,
|
|
176
176
|
updateObject as updateObject2,
|
|
177
177
|
updateActiveTool as updateActiveTool8,
|
|
178
|
-
isTransparent as
|
|
178
|
+
isTransparent as isTransparent8,
|
|
179
179
|
easeToValuesRAF,
|
|
180
180
|
muteFSAbortError as muteFSAbortError2,
|
|
181
181
|
isTestEnv as isTestEnv5,
|
|
@@ -186,7 +186,7 @@ import {
|
|
|
186
186
|
normalizeEOL as normalizeEOL2,
|
|
187
187
|
getDateTime,
|
|
188
188
|
isShallowEqual as isShallowEqual9,
|
|
189
|
-
arrayToMap as
|
|
189
|
+
arrayToMap as arrayToMap28,
|
|
190
190
|
applyDarkModeFilter as applyDarkModeFilter4,
|
|
191
191
|
AppEventBus,
|
|
192
192
|
randomInteger as randomInteger4,
|
|
@@ -315,7 +315,7 @@ import {
|
|
|
315
315
|
isSelectedViaGroup as isSelectedViaGroup2,
|
|
316
316
|
selectGroupsForSelectedElements as selectGroupsForSelectedElements7,
|
|
317
317
|
syncInvalidIndices,
|
|
318
|
-
syncMovedIndices as
|
|
318
|
+
syncMovedIndices as syncMovedIndices5,
|
|
319
319
|
excludeElementsInFramesFromSelection,
|
|
320
320
|
getSelectionStateForElements as getSelectionStateForElements2,
|
|
321
321
|
makeNextSelectedElementIds as makeNextSelectedElementIds3,
|
|
@@ -9725,7 +9725,7 @@ var exportCanvas = async (type, elements, appState, files, {
|
|
|
9725
9725
|
let blob = canvasToBlob(tempCanvas);
|
|
9726
9726
|
if (appState.exportEmbedScene) {
|
|
9727
9727
|
blob = blob.then(
|
|
9728
|
-
(blob2) => import("./data/image-
|
|
9728
|
+
(blob2) => import("./data/image-PPDUIIUO.js").then(
|
|
9729
9729
|
({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
|
|
9730
9730
|
blob: blob2,
|
|
9731
9731
|
metadata: serializeAsJSON(elements, appState, files, "local")
|
|
@@ -20745,10 +20745,33 @@ import {
|
|
|
20745
20745
|
removeAllElementsFromFrame
|
|
20746
20746
|
} from "@nous-excalidraw/element";
|
|
20747
20747
|
import { getFrameChildren as getFrameChildren3 } from "@nous-excalidraw/element";
|
|
20748
|
-
import {
|
|
20748
|
+
import {
|
|
20749
|
+
KEYS as KEYS41,
|
|
20750
|
+
updateActiveTool as updateActiveTool7,
|
|
20751
|
+
arrayToMap as arrayToMap21,
|
|
20752
|
+
isTransparent as isTransparent7
|
|
20753
|
+
} from "@nous-excalidraw/common";
|
|
20749
20754
|
import { getElementsInGroup as getElementsInGroup5 } from "@nous-excalidraw/element";
|
|
20755
|
+
import { hasBackground as hasBackground2 } from "@nous-excalidraw/element";
|
|
20750
20756
|
import { getCommonBounds as getCommonBounds3 } from "@nous-excalidraw/element";
|
|
20751
20757
|
import { CaptureUpdateAction as CaptureUpdateAction35 } from "@nous-excalidraw/element";
|
|
20758
|
+
import { syncMovedIndices as syncMovedIndices4 } from "@nous-excalidraw/element";
|
|
20759
|
+
var FRAME_CHILD_DEFAULT_COLOR = "#373737";
|
|
20760
|
+
var ensureFrameChildrenAreVisible = (elements, frameChildren) => {
|
|
20761
|
+
const elementsMap = arrayToMap21(elements);
|
|
20762
|
+
for (const child of frameChildren) {
|
|
20763
|
+
if (hasBackground2(child.type) && isTransparent7(child.backgroundColor)) {
|
|
20764
|
+
mutateElement4(child, elementsMap, {
|
|
20765
|
+
backgroundColor: FRAME_CHILD_DEFAULT_COLOR
|
|
20766
|
+
});
|
|
20767
|
+
}
|
|
20768
|
+
if ((child.type === "line" || child.type === "arrow") && isTransparent7(child.strokeColor)) {
|
|
20769
|
+
mutateElement4(child, elementsMap, {
|
|
20770
|
+
strokeColor: FRAME_CHILD_DEFAULT_COLOR
|
|
20771
|
+
});
|
|
20772
|
+
}
|
|
20773
|
+
}
|
|
20774
|
+
};
|
|
20752
20775
|
var isSingleFrameSelected = (appState, app) => {
|
|
20753
20776
|
const selectedElements = app.scene.getSelectedElements(appState);
|
|
20754
20777
|
return selectedElements.length === 1 && isFrameLikeElement8(selectedElements[0]);
|
|
@@ -20888,14 +20911,34 @@ var actionWrapSelectionInFrame = register({
|
|
|
20888
20911
|
});
|
|
20889
20912
|
}
|
|
20890
20913
|
}
|
|
20914
|
+
const allElements = app.scene.getElementsIncludingDeleted();
|
|
20915
|
+
const selectedElementIds = new Set(
|
|
20916
|
+
selectedElements.map((element) => element.id)
|
|
20917
|
+
);
|
|
20918
|
+
let minIndex = allElements.length;
|
|
20919
|
+
for (let i = 0; i < allElements.length; i++) {
|
|
20920
|
+
if (selectedElementIds.has(allElements[i].id)) {
|
|
20921
|
+
minIndex = Math.min(minIndex, i);
|
|
20922
|
+
}
|
|
20923
|
+
}
|
|
20924
|
+
const elementsWithFrame = [
|
|
20925
|
+
...allElements.slice(0, minIndex),
|
|
20926
|
+
frame,
|
|
20927
|
+
...allElements.slice(minIndex)
|
|
20928
|
+
];
|
|
20891
20929
|
const nextElements = addElementsToFrame(
|
|
20892
|
-
|
|
20930
|
+
elementsWithFrame,
|
|
20893
20931
|
selectedElements,
|
|
20894
20932
|
frame,
|
|
20895
20933
|
appState
|
|
20896
20934
|
);
|
|
20935
|
+
const frameChildren = getFrameChildren3(nextElements, frame.id);
|
|
20936
|
+
ensureFrameChildrenAreVisible(nextElements, frameChildren);
|
|
20897
20937
|
return {
|
|
20898
|
-
elements:
|
|
20938
|
+
elements: syncMovedIndices4(
|
|
20939
|
+
nextElements,
|
|
20940
|
+
arrayToMap21([frame, ...frameChildren])
|
|
20941
|
+
),
|
|
20899
20942
|
appState: {
|
|
20900
20943
|
selectedElementIds: { [frame.id]: true }
|
|
20901
20944
|
},
|
|
@@ -20909,7 +20952,7 @@ import {
|
|
|
20909
20952
|
isWindows,
|
|
20910
20953
|
KEYS as KEYS42,
|
|
20911
20954
|
matchKey,
|
|
20912
|
-
arrayToMap as
|
|
20955
|
+
arrayToMap as arrayToMap22,
|
|
20913
20956
|
MOBILE_ACTION_BUTTON_BG as MOBILE_ACTION_BUTTON_BG4
|
|
20914
20957
|
} from "@nous-excalidraw/common";
|
|
20915
20958
|
import { CaptureUpdateAction as CaptureUpdateAction37 } from "@nous-excalidraw/element";
|
|
@@ -21136,7 +21179,7 @@ var createUndoAction = (history) => ({
|
|
|
21136
21179
|
perform: (elements, appState, value, app) => executeHistoryAction(
|
|
21137
21180
|
app,
|
|
21138
21181
|
appState,
|
|
21139
|
-
() => history.undo(
|
|
21182
|
+
() => history.undo(arrayToMap22(elements), appState)
|
|
21140
21183
|
),
|
|
21141
21184
|
keyTest: (event) => event[KEYS42.CTRL_OR_CMD] && matchKey(event, KEYS42.Z) && !event.shiftKey,
|
|
21142
21185
|
PanelComponent: ({ appState, updateData, data, app }) => {
|
|
@@ -21174,7 +21217,7 @@ var createRedoAction = (history) => ({
|
|
|
21174
21217
|
perform: (elements, appState, __, app) => executeHistoryAction(
|
|
21175
21218
|
app,
|
|
21176
21219
|
appState,
|
|
21177
|
-
() => history.redo(
|
|
21220
|
+
() => history.redo(arrayToMap22(elements), appState)
|
|
21178
21221
|
),
|
|
21179
21222
|
keyTest: (event) => event[KEYS42.CTRL_OR_CMD] && event.shiftKey && matchKey(event, KEYS42.Z) || isWindows && event.ctrlKey && !event.shiftKey && matchKey(event, KEYS42.Y),
|
|
21180
21223
|
PanelComponent: ({ appState, updateData, data, app }) => {
|
|
@@ -23711,7 +23754,7 @@ import {
|
|
|
23711
23754
|
import { getFrameChildren as getFrameChildren4 } from "@nous-excalidraw/element";
|
|
23712
23755
|
import { selectGroupsForSelectedElements as selectGroupsForSelectedElements6 } from "@nous-excalidraw/element";
|
|
23713
23756
|
import { getContainerElement as getContainerElement4 } from "@nous-excalidraw/element";
|
|
23714
|
-
import { arrayToMap as
|
|
23757
|
+
import { arrayToMap as arrayToMap23, easeOut as easeOut2, isShallowEqual as isShallowEqual4 } from "@nous-excalidraw/common";
|
|
23715
23758
|
|
|
23716
23759
|
// lasso/utils.ts
|
|
23717
23760
|
import { simplify as simplify2 } from "points-on-curve";
|
|
@@ -23907,7 +23950,7 @@ var LassoTrail = class extends AnimatedTrail {
|
|
|
23907
23950
|
if (!this.elementsSegments || !isShallowEqual4(currentCanvasTranslate, this.canvasTranslate ?? {})) {
|
|
23908
23951
|
this.canvasTranslate = currentCanvasTranslate;
|
|
23909
23952
|
this.elementsSegments = /* @__PURE__ */ new Map();
|
|
23910
|
-
const visibleElementsMap =
|
|
23953
|
+
const visibleElementsMap = arrayToMap23(this.app.visibleElements);
|
|
23911
23954
|
for (const element of this.app.visibleElements) {
|
|
23912
23955
|
const segments = getElementLineSegments2(element, visibleElementsMap);
|
|
23913
23956
|
this.elementsSegments.set(element.id, segments);
|
|
@@ -23951,7 +23994,7 @@ var LassoTrail = class extends AnimatedTrail {
|
|
|
23951
23994
|
};
|
|
23952
23995
|
|
|
23953
23996
|
// eraser/index.ts
|
|
23954
|
-
import { arrayToMap as
|
|
23997
|
+
import { arrayToMap as arrayToMap24, easeOut as easeOut3, THEME as THEME12 } from "@nous-excalidraw/common";
|
|
23955
23998
|
import {
|
|
23956
23999
|
computeBoundTextPosition as computeBoundTextPosition4,
|
|
23957
24000
|
doBoundsIntersect as doBoundsIntersect3,
|
|
@@ -24021,7 +24064,7 @@ var EraserTrail = class extends AnimatedTrail {
|
|
|
24021
24064
|
const candidateElements = this.app.visibleElements.filter(
|
|
24022
24065
|
(el) => !el.locked
|
|
24023
24066
|
);
|
|
24024
|
-
const candidateElementsMap =
|
|
24067
|
+
const candidateElementsMap = arrayToMap24(candidateElements);
|
|
24025
24068
|
for (const element of candidateElements) {
|
|
24026
24069
|
if (restoreToErase && this.elementsToErase.has(element.id)) {
|
|
24027
24070
|
const intersects = eraserTest(
|
|
@@ -25496,7 +25539,7 @@ import {
|
|
|
25496
25539
|
CLASSES as CLASSES10,
|
|
25497
25540
|
DEFAULT_SIDEBAR as DEFAULT_SIDEBAR6,
|
|
25498
25541
|
TOOL_TYPE as TOOL_TYPE2,
|
|
25499
|
-
arrayToMap as
|
|
25542
|
+
arrayToMap as arrayToMap26,
|
|
25500
25543
|
capitalizeString as capitalizeString5,
|
|
25501
25544
|
isShallowEqual as isShallowEqual6
|
|
25502
25545
|
} from "@nous-excalidraw/common";
|
|
@@ -26141,7 +26184,7 @@ import React31, { useLayoutEffect as useLayoutEffect5, useRef as useRef26, useSt
|
|
|
26141
26184
|
import { newTextElement as newTextElement3 } from "@nous-excalidraw/element";
|
|
26142
26185
|
|
|
26143
26186
|
// ../utils/src/withinBounds.ts
|
|
26144
|
-
import { arrayToMap as
|
|
26187
|
+
import { arrayToMap as arrayToMap25 } from "@nous-excalidraw/common";
|
|
26145
26188
|
import { getElementBounds as getElementBounds4 } from "@nous-excalidraw/element";
|
|
26146
26189
|
import {
|
|
26147
26190
|
isArrowElement as isArrowElement10,
|
|
@@ -26250,7 +26293,7 @@ var elementsOverlappingBBox = ({
|
|
|
26250
26293
|
errorMargin = 0
|
|
26251
26294
|
}) => {
|
|
26252
26295
|
if (isExcalidrawElement3(bounds)) {
|
|
26253
|
-
bounds = getElementBounds4(bounds,
|
|
26296
|
+
bounds = getElementBounds4(bounds, arrayToMap25(elements));
|
|
26254
26297
|
}
|
|
26255
26298
|
const adjustedBBox = [
|
|
26256
26299
|
bounds[0] - errorMargin,
|
|
@@ -28781,7 +28824,7 @@ var TTDDialogInput = ({
|
|
|
28781
28824
|
setShowSpinner(true);
|
|
28782
28825
|
}
|
|
28783
28826
|
}, SPINNER_DELAY_MS);
|
|
28784
|
-
import("./components/TTDDialog/CodeMirrorEditor-
|
|
28827
|
+
import("./components/TTDDialog/CodeMirrorEditor-FWL3IAFT.js").then((mod) => {
|
|
28785
28828
|
if (!cancelled) {
|
|
28786
28829
|
setEditorState({ type: "ready", component: mod.default });
|
|
28787
28830
|
}
|
|
@@ -35256,7 +35299,7 @@ var LayerUI = ({
|
|
|
35256
35299
|
}
|
|
35257
35300
|
if (selectedElements.length) {
|
|
35258
35301
|
for (const element of selectedElements) {
|
|
35259
|
-
mutateElement5(element,
|
|
35302
|
+
mutateElement5(element, arrayToMap26(elements), {
|
|
35260
35303
|
[altKey && eyeDropperState.swapPreviewOnAlt ? colorPickerType === "elementBackground" ? "strokeColor" : "backgroundColor" : colorPickerType === "elementBackground" ? "backgroundColor" : "strokeColor"]: color
|
|
35261
35304
|
});
|
|
35262
35305
|
ShapeCache3.delete(element);
|
|
@@ -35478,7 +35521,7 @@ import {
|
|
|
35478
35521
|
pointDistance as pointDistance8
|
|
35479
35522
|
} from "@nous-excalidraw/math";
|
|
35480
35523
|
import {
|
|
35481
|
-
arrayToMap as
|
|
35524
|
+
arrayToMap as arrayToMap27,
|
|
35482
35525
|
BIND_MODE_TIMEOUT,
|
|
35483
35526
|
DEFAULT_TRANSFORM_HANDLE_SPACING as DEFAULT_TRANSFORM_HANDLE_SPACING2,
|
|
35484
35527
|
FRAME_STYLE as FRAME_STYLE3,
|
|
@@ -36558,7 +36601,7 @@ var buildElementSelectionBorders = ({
|
|
|
36558
36601
|
editorInterface,
|
|
36559
36602
|
renderConfig
|
|
36560
36603
|
}) => {
|
|
36561
|
-
const locallySelectedIds =
|
|
36604
|
+
const locallySelectedIds = arrayToMap27(selectedElements);
|
|
36562
36605
|
const selections = [];
|
|
36563
36606
|
const isSingleLinearElementSelected = selectedElements.length === 1 && isLinearElement11(selectedElements[0]);
|
|
36564
36607
|
for (const element of elementsMap.values()) {
|
|
@@ -36945,8 +36988,7 @@ var renderTransformHandles = (context, renderConfig, appState, transformHandles,
|
|
|
36945
36988
|
fillCircle(context, x + width / 2, y + height / 2, width / 2, true);
|
|
36946
36989
|
} else if (CORNER_TRANSFORM_HANDLE_TYPES.has(handleType)) {
|
|
36947
36990
|
const cornerStroke = renderConfig.selectionColor || DEFAULT_SELECTION_COLOR;
|
|
36948
|
-
|
|
36949
|
-
context.fillStyle = isHovered ? cornerStroke : "#ffffff";
|
|
36991
|
+
context.fillStyle = "#ffffff";
|
|
36950
36992
|
context.save();
|
|
36951
36993
|
context.translate(x + width / 2, y + height / 2);
|
|
36952
36994
|
context.rotate(angle);
|
|
@@ -37624,7 +37666,6 @@ var InteractiveCanvas = (props) => {
|
|
|
37624
37666
|
remotePointerUsernames,
|
|
37625
37667
|
remotePointerUserStates,
|
|
37626
37668
|
selectionColor,
|
|
37627
|
-
hoveredCornerTransformHandleType: props.app.hoveredCornerTransformHandleType,
|
|
37628
37669
|
renderScrollbars: props.renderScrollbars,
|
|
37629
37670
|
// NOTE not memoized on so we don't rerender on cursor move
|
|
37630
37671
|
lastViewportPosition: props.app.lastViewportPosition
|
|
@@ -38284,7 +38325,6 @@ var _App = class _App extends React46.Component {
|
|
|
38284
38325
|
__publicField(this, "lastPointerMoveEvent", null);
|
|
38285
38326
|
/** current frame pointer cords */
|
|
38286
38327
|
__publicField(this, "lastPointerMoveCoords", null);
|
|
38287
|
-
__publicField(this, "hoveredCornerTransformHandleType", null);
|
|
38288
38328
|
__publicField(this, "lastCompletedCanvasClicks", []);
|
|
38289
38329
|
/** previous frame pointer coords */
|
|
38290
38330
|
__publicField(this, "previousPointerMoveCoords", null);
|
|
@@ -39231,7 +39271,7 @@ var _App = class _App extends React46.Component {
|
|
|
39231
39271
|
prevElements
|
|
39232
39272
|
);
|
|
39233
39273
|
nextElements = mappedNewSceneElements || nextElements;
|
|
39234
|
-
|
|
39274
|
+
syncMovedIndices5(nextElements, arrayToMap28(duplicatedElements));
|
|
39235
39275
|
const topLayerFrame = this.getTopLayerFrameAtSceneCoords({ x, y });
|
|
39236
39276
|
if (topLayerFrame) {
|
|
39237
39277
|
const eligibleElements = filterElementsEligibleAsFrameChildren(
|
|
@@ -40726,7 +40766,7 @@ var _App = class _App extends React46.Component {
|
|
|
40726
40766
|
sceneY
|
|
40727
40767
|
);
|
|
40728
40768
|
if (container) {
|
|
40729
|
-
if (hasBoundTextElement9(container) || !
|
|
40769
|
+
if (hasBoundTextElement9(container) || !isTransparent8(container.backgroundColor) || hitElementItself3({
|
|
40730
40770
|
point: pointFrom34(sceneX, sceneY),
|
|
40731
40771
|
element: container,
|
|
40732
40772
|
elementsMap: this.scene.getNonDeletedElementsMap(),
|
|
@@ -40856,25 +40896,6 @@ var _App = class _App extends React46.Component {
|
|
|
40856
40896
|
);
|
|
40857
40897
|
return frames.length ? frames[frames.length - 1] : null;
|
|
40858
40898
|
});
|
|
40859
|
-
__publicField(this, "getHoveredCornerTransformHandleType", (handleType) => {
|
|
40860
|
-
if (handleType === "nw" || handleType === "ne" || handleType === "sw" || handleType === "se") {
|
|
40861
|
-
return handleType;
|
|
40862
|
-
}
|
|
40863
|
-
return null;
|
|
40864
|
-
});
|
|
40865
|
-
__publicField(this, "syncHoveredCornerTransformHandleType", (handleType) => {
|
|
40866
|
-
const cornerHandleType = this.getHoveredCornerTransformHandleType(handleType);
|
|
40867
|
-
if (cornerHandleType !== this.hoveredCornerTransformHandleType) {
|
|
40868
|
-
this.hoveredCornerTransformHandleType = cornerHandleType;
|
|
40869
|
-
this.triggerRender(true);
|
|
40870
|
-
}
|
|
40871
|
-
});
|
|
40872
|
-
__publicField(this, "clearHoveredCornerTransformHandleType", () => {
|
|
40873
|
-
if (this.hoveredCornerTransformHandleType !== null) {
|
|
40874
|
-
this.hoveredCornerTransformHandleType = null;
|
|
40875
|
-
this.triggerRender(true);
|
|
40876
|
-
}
|
|
40877
|
-
});
|
|
40878
40899
|
__publicField(this, "clearHoverOutlineIfNeeded", () => {
|
|
40879
40900
|
if (this.state.hoverOutlineElementId != null || this.state.hoveredFrameId != null) {
|
|
40880
40901
|
this.setState({
|
|
@@ -41019,7 +41040,6 @@ var _App = class _App extends React46.Component {
|
|
|
41019
41040
|
}
|
|
41020
41041
|
if (isHoldingSpace || isPanning || isDraggingScrollBar || isHandToolActive(this.state)) {
|
|
41021
41042
|
this.clearHoverOutlineIfNeeded();
|
|
41022
|
-
this.clearHoveredCornerTransformHandleType();
|
|
41023
41043
|
return;
|
|
41024
41044
|
}
|
|
41025
41045
|
const isPointerOverScrollBars = isOverScrollBars(
|
|
@@ -41254,7 +41274,6 @@ var _App = class _App extends React46.Component {
|
|
|
41254
41274
|
}
|
|
41255
41275
|
}
|
|
41256
41276
|
this.clearHoverOutlineIfNeeded();
|
|
41257
|
-
this.clearHoveredCornerTransformHandleType();
|
|
41258
41277
|
return;
|
|
41259
41278
|
}
|
|
41260
41279
|
if (this.state.activeTool.type === "arrow") {
|
|
@@ -41286,7 +41305,6 @@ var _App = class _App extends React46.Component {
|
|
|
41286
41305
|
// over a link/embeddable, we change the cursor
|
|
41287
41306
|
!isLaserTool && this.state.activeTool.type !== "selection" && this.state.activeTool.type !== "lasso" && this.state.activeTool.type !== "text" && this.state.activeTool.type !== "eraser") {
|
|
41288
41307
|
this.clearHoverOutlineIfNeeded();
|
|
41289
|
-
this.clearHoveredCornerTransformHandleType();
|
|
41290
41308
|
return;
|
|
41291
41309
|
}
|
|
41292
41310
|
const elements = this.scene.getNonDeletedElements();
|
|
@@ -41294,7 +41312,6 @@ var _App = class _App extends React46.Component {
|
|
|
41294
41312
|
if (this.isHittingTextAutoResizeHandle(selectedElements, scenePointer)) {
|
|
41295
41313
|
setCursor(this.interactiveCanvas, CURSOR_TYPE4.POINTER);
|
|
41296
41314
|
this.clearHoverOutlineIfNeeded();
|
|
41297
|
-
this.clearHoveredCornerTransformHandleType();
|
|
41298
41315
|
return;
|
|
41299
41316
|
}
|
|
41300
41317
|
if (selectedElements.length === 1 && !isOverScrollBar && !this.state.selectedLinearElement?.isEditing) {
|
|
@@ -41324,9 +41341,6 @@ var _App = class _App extends React46.Component {
|
|
|
41324
41341
|
getCursorForResizingElement(elementWithTransformHandleType)
|
|
41325
41342
|
);
|
|
41326
41343
|
this.clearHoverOutlineIfNeeded();
|
|
41327
|
-
this.syncHoveredCornerTransformHandleType(
|
|
41328
|
-
elementWithTransformHandleType.transformHandleType
|
|
41329
|
-
);
|
|
41330
41344
|
return;
|
|
41331
41345
|
}
|
|
41332
41346
|
}
|
|
@@ -41347,11 +41361,9 @@ var _App = class _App extends React46.Component {
|
|
|
41347
41361
|
})
|
|
41348
41362
|
);
|
|
41349
41363
|
this.clearHoverOutlineIfNeeded();
|
|
41350
|
-
this.syncHoveredCornerTransformHandleType(transformHandleType);
|
|
41351
41364
|
return;
|
|
41352
41365
|
}
|
|
41353
41366
|
}
|
|
41354
|
-
this.clearHoveredCornerTransformHandleType();
|
|
41355
41367
|
if (isEraserActive(this.state)) {
|
|
41356
41368
|
this.clearHoverOutlineIfNeeded();
|
|
41357
41369
|
return;
|
|
@@ -43035,14 +43047,14 @@ var _App = class _App extends React46.Component {
|
|
|
43035
43047
|
}
|
|
43036
43048
|
})
|
|
43037
43049
|
);
|
|
43038
|
-
const initializedMap =
|
|
43050
|
+
const initializedMap = arrayToMap28(initialized);
|
|
43039
43051
|
const positioned = positionElementsOnGrid(
|
|
43040
43052
|
initialized.filter((el) => !el.isDeleted),
|
|
43041
43053
|
sceneX,
|
|
43042
43054
|
sceneY,
|
|
43043
43055
|
gridPadding
|
|
43044
43056
|
);
|
|
43045
|
-
const positionedMap =
|
|
43057
|
+
const positionedMap = arrayToMap28(positioned);
|
|
43046
43058
|
const nextElements = this.scene.getElementsIncludingDeleted().map((el) => positionedMap.get(el.id) ?? initializedMap.get(el.id) ?? el);
|
|
43047
43059
|
this.updateScene({
|
|
43048
43060
|
appState: {
|
|
@@ -43757,6 +43769,9 @@ var _App = class _App extends React46.Component {
|
|
|
43757
43769
|
registerAction: (action) => {
|
|
43758
43770
|
this.actionManager.registerAction(action);
|
|
43759
43771
|
},
|
|
43772
|
+
executeAction: (action, value = null) => {
|
|
43773
|
+
this.actionManager.executeAction(action, "api", value);
|
|
43774
|
+
},
|
|
43760
43775
|
refresh: this.refresh,
|
|
43761
43776
|
setToast: this.setToast,
|
|
43762
43777
|
id: this.id,
|
|
@@ -46398,9 +46413,9 @@ var _App = class _App extends React46.Component {
|
|
|
46398
46413
|
mappedClonedElements,
|
|
46399
46414
|
elements
|
|
46400
46415
|
);
|
|
46401
|
-
const elementsWithIndices =
|
|
46416
|
+
const elementsWithIndices = syncMovedIndices5(
|
|
46402
46417
|
mappedNewSceneElements || mappedClonedElements,
|
|
46403
|
-
|
|
46418
|
+
arrayToMap28(duplicatedElements)
|
|
46404
46419
|
);
|
|
46405
46420
|
flushSync3(() => {
|
|
46406
46421
|
if (pointerDownState.hit.element) {
|
|
@@ -47873,7 +47888,7 @@ import { isInvisiblySmallElement as isInvisiblySmallElement4 } from "@nous-excal
|
|
|
47873
47888
|
|
|
47874
47889
|
// data/reconcile.ts
|
|
47875
47890
|
import throttle4 from "lodash.throttle";
|
|
47876
|
-
import { arrayToMap as
|
|
47891
|
+
import { arrayToMap as arrayToMap29, isDevEnv as isDevEnv11, isTestEnv as isTestEnv6 } from "@nous-excalidraw/common";
|
|
47877
47892
|
import {
|
|
47878
47893
|
orderByFractionalIndex as orderByFractionalIndex2,
|
|
47879
47894
|
syncInvalidIndices as syncInvalidIndices2,
|
|
@@ -47910,7 +47925,7 @@ var validateIndicesThrottled = throttle4(
|
|
|
47910
47925
|
{ leading: true, trailing: false }
|
|
47911
47926
|
);
|
|
47912
47927
|
var reconcileElements = (localElements, remoteElements, localAppState) => {
|
|
47913
|
-
const localElementsMap =
|
|
47928
|
+
const localElementsMap = arrayToMap29(localElements);
|
|
47914
47929
|
const reconciledElements = [];
|
|
47915
47930
|
const added = /* @__PURE__ */ new Set();
|
|
47916
47931
|
for (const remoteElement of remoteElements) {
|
|
@@ -48379,6 +48394,7 @@ export {
|
|
|
48379
48394
|
TTDStreamFetch,
|
|
48380
48395
|
UserIdleState2 as UserIdleState,
|
|
48381
48396
|
WelcomeScreen_default as WelcomeScreen,
|
|
48397
|
+
actionWrapSelectionInFrame,
|
|
48382
48398
|
bumpVersion3 as bumpVersion,
|
|
48383
48399
|
convertToExcalidrawElements3 as convertToExcalidrawElements,
|
|
48384
48400
|
defaultLang,
|