@myoc/excalidraw 0.19.530 → 0.19.532

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.
@@ -2,12 +2,12 @@ import {
2
2
  decodePngMetadata,
3
3
  encodePngMetadata,
4
4
  getTEXtChunk
5
- } from "../chunk-ROEGCKS3.js";
6
- import "../chunk-XSA46KXZ.js";
5
+ } from "../chunk-ITMOGRAW.js";
6
+ import "../chunk-ASAPRLCW.js";
7
7
  import "../chunk-XDFCUUT6.js";
8
8
  export {
9
9
  decodePngMetadata,
10
10
  encodePngMetadata,
11
11
  getTEXtChunk
12
12
  };
13
- //# sourceMappingURL=image-AYT4E6ZF.js.map
13
+ //# sourceMappingURL=image-S7APFFV6.js.map
package/dist/dev/index.js CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  ImageSceneDataError,
7
7
  ImageURLToFile,
8
8
  SVGStringToFile,
9
+ UnsupportedImageFileTypeError,
9
10
  bootstrapCanvas,
10
11
  canChangeRoundness,
11
12
  canHaveArrowheads,
@@ -62,10 +63,10 @@ import {
62
63
  serializeAsJSON,
63
64
  strokeRectWithRotation_simple,
64
65
  zoomToFitBounds
65
- } from "./chunk-ROEGCKS3.js";
66
+ } from "./chunk-ITMOGRAW.js";
66
67
  import {
67
68
  define_import_meta_env_default
68
- } from "./chunk-XSA46KXZ.js";
69
+ } from "./chunk-ASAPRLCW.js";
69
70
  import {
70
71
  en_default
71
72
  } from "./chunk-SKCAT7JG.js";
@@ -10936,7 +10937,7 @@ var exportCanvas = async (type, elements, appState, files, {
10936
10937
  let blob = canvasToBlob(tempCanvas);
10937
10938
  if (appState.exportEmbedScene) {
10938
10939
  blob = blob.then(
10939
- (blob2) => import("./data/image-AYT4E6ZF.js").then(
10940
+ (blob2) => import("./data/image-S7APFFV6.js").then(
10940
10941
  ({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
10941
10942
  blob: blob2,
10942
10943
  metadata: serializeAsJSON(elements, appState, files, "local")
@@ -37006,10 +37007,26 @@ var App = class _App extends React40.Component {
37006
37007
  }
37007
37008
  ));
37008
37009
  __publicField(this, "addImageElementsToScene", async (imageFiles, sceneX, sceneY) => {
37010
+ const normalizedImageFiles = await Promise.all(
37011
+ imageFiles.map(async ({ file: file2, customData }) => ({
37012
+ file: await normalizeFile(file2),
37013
+ customData: customData ?? {}
37014
+ }))
37015
+ );
37016
+ const unsupportedImage = normalizedImageFiles.find(
37017
+ ({ file: file2 }) => !isSupportedImageFile(file2)
37018
+ );
37019
+ if (unsupportedImage) {
37020
+ throw new UnsupportedImageFileTypeError(
37021
+ unsupportedImage.file,
37022
+ t("errors.unsupportedFileType")
37023
+ );
37024
+ }
37009
37025
  await this.insertImages(
37010
- imageFiles.map(({ file: file2 }) => file2),
37026
+ normalizedImageFiles.map(({ file: file2 }) => file2),
37011
37027
  sceneX,
37012
- sceneY
37028
+ sceneY,
37029
+ normalizedImageFiles.map(({ customData }) => customData)
37013
37030
  );
37014
37031
  });
37015
37032
  __publicField(this, "addImagePlaceholder", async (fileId, file2) => {
@@ -45957,6 +45974,7 @@ export {
45957
45974
  Sidebar,
45958
45975
  Stats,
45959
45976
  THEME26 as THEME,
45977
+ UnsupportedImageFileTypeError,
45960
45978
  UserIdleState2 as UserIdleState,
45961
45979
  WelcomeScreen_default as WelcomeScreen,
45962
45980
  applyDarkModeFilter11 as applyDarkModeFilter,