@myoc/excalidraw 0.18.14 → 0.18.16
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-BVQKKPYJ.js → chunk-3HLOFB5F.js} +4 -4
- package/dist/dev/{chunk-BVQKKPYJ.js.map → chunk-3HLOFB5F.js.map} +2 -2
- package/dist/dev/{chunk-4MUT22YZ.js → chunk-QQGTICP4.js} +2 -2
- package/dist/dev/data/{image-5CKNIDBA.js → image-XPEIZ6XQ.js} +3 -3
- package/dist/dev/index.js +26 -32
- package/dist/dev/index.js.map +2 -2
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/{chunk-5P7BZ5EW.js → chunk-7HNFGNL7.js} +1 -1
- package/dist/prod/{chunk-UXVBAUYA.js → chunk-KKQVTSHB.js} +3 -3
- package/dist/prod/data/image-QD7FUQED.js +1 -0
- package/dist/prod/index.js +11 -11
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +12 -12
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionExport.d.ts +9 -9
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionFrame.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionGroup.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionLink.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionMenu.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionProperties.d.ts +15 -15
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionStyles.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +1 -1
- package/dist/types/excalidraw/types.d.ts +1 -3
- package/package.json +3 -2
- package/dist/prod/data/image-55FCGPA5.js +0 -1
- /package/dist/dev/{chunk-4MUT22YZ.js.map → chunk-QQGTICP4.js.map} +0 -0
- /package/dist/dev/data/{image-5CKNIDBA.js.map → image-XPEIZ6XQ.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// <define:import.meta.env>
|
|
2
|
-
var define_import_meta_env_default = { 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:3015", 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: "3000", 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: "@myoc/excalidraw", PKG_VERSION: "0.18.
|
|
2
|
+
var define_import_meta_env_default = { 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:3015", 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: "3000", 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: "@myoc/excalidraw", PKG_VERSION: "0.18.15", DEV: true };
|
|
3
3
|
|
|
4
4
|
export {
|
|
5
5
|
define_import_meta_env_default
|
|
6
6
|
};
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-QQGTICP4.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-3HLOFB5F.js";
|
|
6
|
+
import "../chunk-QQGTICP4.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-XPEIZ6XQ.js.map
|
package/dist/dev/index.js
CHANGED
|
@@ -618,10 +618,10 @@ import {
|
|
|
618
618
|
wrapEvent,
|
|
619
619
|
wrapText,
|
|
620
620
|
zoomAreaIcon
|
|
621
|
-
} from "./chunk-
|
|
621
|
+
} from "./chunk-3HLOFB5F.js";
|
|
622
622
|
import {
|
|
623
623
|
define_import_meta_env_default
|
|
624
|
-
} from "./chunk-
|
|
624
|
+
} from "./chunk-QQGTICP4.js";
|
|
625
625
|
import {
|
|
626
626
|
en_default
|
|
627
627
|
} from "./chunk-PEI7EPYO.js";
|
|
@@ -10907,7 +10907,7 @@ var exportCanvas = async (type, elements, appState, files, {
|
|
|
10907
10907
|
let blob = canvasToBlob(tempCanvas);
|
|
10908
10908
|
if (appState.exportEmbedScene) {
|
|
10909
10909
|
blob = blob.then(
|
|
10910
|
-
(blob2) => import("./data/image-
|
|
10910
|
+
(blob2) => import("./data/image-XPEIZ6XQ.js").then(
|
|
10911
10911
|
({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
|
|
10912
10912
|
blob: blob2,
|
|
10913
10913
|
metadata: serializeAsJSON(elements, appState, files, "local")
|
|
@@ -34091,6 +34091,7 @@ var App = class _App extends React42.Component {
|
|
|
34091
34091
|
throw new Error(t("errors.unsupportedFileType"));
|
|
34092
34092
|
}
|
|
34093
34093
|
const mimeType = imageFile.type;
|
|
34094
|
+
const fileNeedsResizing = imageFile.size >= this.state.dontResizeLimitMBs * 1024 * 1024;
|
|
34094
34095
|
setCursor(this.interactiveCanvas, "wait");
|
|
34095
34096
|
if (mimeType === MIME_TYPES.svg) {
|
|
34096
34097
|
try {
|
|
@@ -34102,39 +34103,36 @@ var App = class _App extends React42.Component {
|
|
|
34102
34103
|
console.warn(error);
|
|
34103
34104
|
throw new Error(t("errors.svgImageInsertError"));
|
|
34104
34105
|
}
|
|
34106
|
+
} else if (fileNeedsResizing) {
|
|
34107
|
+
try {
|
|
34108
|
+
imageFile = await resizeImageFile(imageFile, {
|
|
34109
|
+
maxWidthOrHeight: DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT
|
|
34110
|
+
});
|
|
34111
|
+
console.info("Excalidraw: image resized");
|
|
34112
|
+
} catch (error) {
|
|
34113
|
+
console.error(
|
|
34114
|
+
"Error trying to resizing image file on insertion",
|
|
34115
|
+
error
|
|
34116
|
+
);
|
|
34117
|
+
}
|
|
34118
|
+
}
|
|
34119
|
+
if (imageFile.size > MAX_ALLOWED_FILE_BYTES) {
|
|
34120
|
+
throw new Error(
|
|
34121
|
+
t("errors.fileTooBig", {
|
|
34122
|
+
maxSize: `${Math.trunc(MAX_ALLOWED_FILE_BYTES / 1024 / 1024)}MB`
|
|
34123
|
+
})
|
|
34124
|
+
);
|
|
34105
34125
|
}
|
|
34106
34126
|
const fileId = await (this.props.generateIdForFile?.(
|
|
34107
34127
|
imageFile
|
|
34108
34128
|
) || generateIdFromFile(imageFile));
|
|
34129
|
+
console.info("Excalidraw File ID:", fileId);
|
|
34109
34130
|
if (!fileId) {
|
|
34110
34131
|
console.warn(
|
|
34111
34132
|
"Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."
|
|
34112
34133
|
);
|
|
34113
34134
|
throw new Error(t("errors.imageInsertError"));
|
|
34114
34135
|
}
|
|
34115
|
-
const existingFileData = this.files[fileId];
|
|
34116
|
-
if (!existingFileData?.dataURL) {
|
|
34117
|
-
const sizeLimitInKBs = this.state.dontResizeLimitMBs * 1024 * 1024;
|
|
34118
|
-
if (imageFile.size >= sizeLimitInKBs) {
|
|
34119
|
-
try {
|
|
34120
|
-
imageFile = await resizeImageFile(imageFile, {
|
|
34121
|
-
maxWidthOrHeight: DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT
|
|
34122
|
-
});
|
|
34123
|
-
} catch (error) {
|
|
34124
|
-
console.error(
|
|
34125
|
-
"Error trying to resizing image file on insertion",
|
|
34126
|
-
error
|
|
34127
|
-
);
|
|
34128
|
-
}
|
|
34129
|
-
}
|
|
34130
|
-
if (imageFile.size > MAX_ALLOWED_FILE_BYTES) {
|
|
34131
|
-
throw new Error(
|
|
34132
|
-
t("errors.fileTooBig", {
|
|
34133
|
-
maxSize: `${Math.trunc(MAX_ALLOWED_FILE_BYTES / 1024 / 1024)}MB`
|
|
34134
|
-
})
|
|
34135
|
-
);
|
|
34136
|
-
}
|
|
34137
|
-
}
|
|
34138
34136
|
if (showCursorImagePreview) {
|
|
34139
34137
|
const dataURL2 = this.files[fileId]?.dataURL;
|
|
34140
34138
|
const resizedFile = dataURL2 && dataURLToFile(dataURL2);
|
|
@@ -35128,8 +35126,7 @@ var App = class _App extends React42.Component {
|
|
|
35128
35126
|
objectsSnapModeEnabled = false,
|
|
35129
35127
|
theme = defaultAppState.theme,
|
|
35130
35128
|
name = `${t("labels.untitled")}-${getDateTime()}`,
|
|
35131
|
-
wheelZoomsOnDefault = false
|
|
35132
|
-
dontResizeLimitMBs
|
|
35129
|
+
wheelZoomsOnDefault = false
|
|
35133
35130
|
} = props;
|
|
35134
35131
|
this.state = {
|
|
35135
35132
|
...defaultAppState,
|
|
@@ -35143,8 +35140,7 @@ var App = class _App extends React42.Component {
|
|
|
35143
35140
|
name,
|
|
35144
35141
|
width: window.innerWidth,
|
|
35145
35142
|
height: window.innerHeight,
|
|
35146
|
-
wheelZoomsOnDefault
|
|
35147
|
-
dontResizeLimitMBs
|
|
35143
|
+
wheelZoomsOnDefault
|
|
35148
35144
|
};
|
|
35149
35145
|
this.id = nanoid();
|
|
35150
35146
|
this.library = new library_default(this);
|
|
@@ -38755,7 +38751,6 @@ var ExcalidrawBase = (props) => {
|
|
|
38755
38751
|
renderEmbeddable,
|
|
38756
38752
|
showDeprecatedFonts,
|
|
38757
38753
|
wheelZoomsOnDefault,
|
|
38758
|
-
dontResizeLimitMBs,
|
|
38759
38754
|
strokeColorTopPicks,
|
|
38760
38755
|
backgroundColorTopPicks,
|
|
38761
38756
|
renderScrollbars
|
|
@@ -38829,7 +38824,6 @@ var ExcalidrawBase = (props) => {
|
|
|
38829
38824
|
aiEnabled: false,
|
|
38830
38825
|
showDeprecatedFonts,
|
|
38831
38826
|
wheelZoomsOnDefault,
|
|
38832
|
-
dontResizeLimitMBs,
|
|
38833
38827
|
strokeColorTopPicks,
|
|
38834
38828
|
backgroundColorTopPicks,
|
|
38835
38829
|
renderScrollbars,
|