@myoc/excalidraw 0.19.514 → 0.19.516
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +106 -0
- package/dist/dev/{chunk-FW62QUKV.js → chunk-IBY5YU6S.js} +2 -2
- package/dist/dev/{chunk-BI6BDZVY.js → chunk-YWH5H56B.js} +4 -3
- package/dist/dev/{chunk-BI6BDZVY.js.map → chunk-YWH5H56B.js.map} +2 -2
- package/dist/dev/data/{image-WGZL7YPK.js → image-VSXYAV2C.js} +3 -3
- package/dist/dev/index.js +16 -7
- 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-NVT4BTJO.js → chunk-KNCLLHEB.js} +1 -1
- package/dist/prod/{chunk-56AUOKVR.js → chunk-MDL47EFM.js} +2 -2
- package/dist/prod/data/image-ENA4T2CA.js +1 -0
- package/dist/prod/index.js +3 -3
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/element/src/newElement.d.ts +1 -0
- package/dist/types/element/src/types.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionFrame.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +1 -0
- package/dist/types/excalidraw/scene/Renderer.d.ts +1 -0
- package/package.json +4 -4
- package/dist/prod/data/image-ZQZIDAZL.js +0 -1
- /package/dist/dev/{chunk-FW62QUKV.js.map → chunk-IBY5YU6S.js.map} +0 -0
- /package/dist/dev/data/{image-WGZL7YPK.js.map → image-VSXYAV2C.js.map} +0 -0
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
decodePngMetadata,
|
|
3
3
|
encodePngMetadata,
|
|
4
4
|
getTEXtChunk
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-YWH5H56B.js";
|
|
6
|
+
import "../chunk-IBY5YU6S.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-VSXYAV2C.js.map
|
package/dist/dev/index.js
CHANGED
|
@@ -57,10 +57,10 @@ import {
|
|
|
57
57
|
saveAsJSON,
|
|
58
58
|
serializeAsJSON,
|
|
59
59
|
strokeRectWithRotation_simple
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-YWH5H56B.js";
|
|
61
61
|
import {
|
|
62
62
|
define_import_meta_env_default
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-IBY5YU6S.js";
|
|
64
64
|
import {
|
|
65
65
|
en_default
|
|
66
66
|
} from "./chunk-ZGRXNVW4.js";
|
|
@@ -9611,7 +9611,7 @@ var exportCanvas = async (type, elements, appState, files, {
|
|
|
9611
9611
|
let blob = canvasToBlob(tempCanvas);
|
|
9612
9612
|
if (appState.exportEmbedScene) {
|
|
9613
9613
|
blob = blob.then(
|
|
9614
|
-
(blob2) => import("./data/image-
|
|
9614
|
+
(blob2) => import("./data/image-VSXYAV2C.js").then(
|
|
9615
9615
|
({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
|
|
9616
9616
|
blob: blob2,
|
|
9617
9617
|
metadata: serializeAsJSON(elements, appState, files, "local")
|
|
@@ -36041,6 +36041,7 @@ var App = class _App extends React40.Component {
|
|
|
36041
36041
|
throw new Error(t("errors.unsupportedFileType"));
|
|
36042
36042
|
}
|
|
36043
36043
|
const mimeType = imageFile.type;
|
|
36044
|
+
let fileName = imageFile.name;
|
|
36044
36045
|
const fileNeedsResizing = imageFile.size >= this.state.dontResizeLimitMBs * 1024 * 1024;
|
|
36045
36046
|
setCursor(this.interactiveCanvas, "wait");
|
|
36046
36047
|
if (mimeType === MIME_TYPES7.svg) {
|
|
@@ -36059,6 +36060,11 @@ var App = class _App extends React40.Component {
|
|
|
36059
36060
|
imageFile = await this.props.compressImageFile(imageFile, {
|
|
36060
36061
|
maxWidthOrHeight
|
|
36061
36062
|
});
|
|
36063
|
+
const extensionIndex = imageFile.name.lastIndexOf(".");
|
|
36064
|
+
fileName = extensionIndex > 0 ? `${imageFile.name.slice(
|
|
36065
|
+
0,
|
|
36066
|
+
extensionIndex
|
|
36067
|
+
)}-resized${imageFile.name.slice(extensionIndex)}` : `${imageFile.name}-resized`;
|
|
36062
36068
|
console.info("Excalidraw: image resized");
|
|
36063
36069
|
} catch (error) {
|
|
36064
36070
|
console.error(
|
|
@@ -36090,7 +36096,8 @@ var App = class _App extends React40.Component {
|
|
|
36090
36096
|
try {
|
|
36091
36097
|
let initializedImageElement = this.getLatestInitializedImageElement(
|
|
36092
36098
|
placeholderImageElement,
|
|
36093
|
-
fileId
|
|
36099
|
+
fileId,
|
|
36100
|
+
fileName
|
|
36094
36101
|
);
|
|
36095
36102
|
this.addMissingFiles([
|
|
36096
36103
|
{
|
|
@@ -36114,7 +36121,8 @@ var App = class _App extends React40.Component {
|
|
|
36114
36121
|
if (imageHTML && this.state.newElement?.id !== initializedImageElement.id) {
|
|
36115
36122
|
initializedImageElement = this.getLatestInitializedImageElement(
|
|
36116
36123
|
placeholderImageElement,
|
|
36117
|
-
fileId
|
|
36124
|
+
fileId,
|
|
36125
|
+
fileName
|
|
36118
36126
|
);
|
|
36119
36127
|
const naturalDimensions = this.getImageNaturalDimensions(
|
|
36120
36128
|
initializedImageElement,
|
|
@@ -36135,12 +36143,13 @@ var App = class _App extends React40.Component {
|
|
|
36135
36143
|
* when the placeholder image could have been modified in the meantime,
|
|
36136
36144
|
* and when you don't want to loose those modifications
|
|
36137
36145
|
*/
|
|
36138
|
-
__publicField(this, "getLatestInitializedImageElement", (imagePlaceholder, fileId) => {
|
|
36146
|
+
__publicField(this, "getLatestInitializedImageElement", (imagePlaceholder, fileId, fileName) => {
|
|
36139
36147
|
const latestImageElement = this.scene.getElement(imagePlaceholder.id) ?? imagePlaceholder;
|
|
36140
36148
|
return newElementWith10(
|
|
36141
36149
|
latestImageElement,
|
|
36142
36150
|
{
|
|
36143
|
-
fileId
|
|
36151
|
+
fileId,
|
|
36152
|
+
fileName
|
|
36144
36153
|
}
|
|
36145
36154
|
);
|
|
36146
36155
|
});
|