@nous-excalidraw/excalidraw 0.18.2 → 0.18.3

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/index.js CHANGED
@@ -65,10 +65,10 @@ import {
65
65
  serializeAsJSON,
66
66
  serializeLibraryAsJSON,
67
67
  strokeRectWithRotation_simple
68
- } from "./chunk-VTFWC67S.js";
68
+ } from "./chunk-4Q2BPT5H.js";
69
69
  import {
70
70
  define_import_meta_env_default
71
- } from "./chunk-UFTMCXXK.js";
71
+ } from "./chunk-GDIPPJNS.js";
72
72
  import {
73
73
  en_default
74
74
  } from "./chunk-4JOINNOK.js";
@@ -9630,7 +9630,7 @@ var exportCanvas = async (type, elements, appState, files, {
9630
9630
  let blob = canvasToBlob(tempCanvas);
9631
9631
  if (appState.exportEmbedScene) {
9632
9632
  blob = blob.then(
9633
- (blob2) => import("./data/image-R33I73P5.js").then(
9633
+ (blob2) => import("./data/image-X4CDE7NB.js").then(
9634
9634
  ({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
9635
9635
  blob: blob2,
9636
9636
  metadata: serializeAsJSON(elements, appState, files, "local")
@@ -28481,7 +28481,7 @@ var TTDDialogInput = ({
28481
28481
  setShowSpinner(true);
28482
28482
  }
28483
28483
  }, SPINNER_DELAY_MS);
28484
- import("./components/TTDDialog/CodeMirrorEditor-TCVBULR7.js").then((mod) => {
28484
+ import("./components/TTDDialog/CodeMirrorEditor-R36AGSC4.js").then((mod) => {
28485
28485
  if (!cancelled) {
28486
28486
  setEditorState({ type: "ready", component: mod.default });
28487
28487
  }
@@ -39743,6 +39743,16 @@ var App = class _App extends React46.Component {
39743
39743
  this.startImageCropping(selectedElements[0]);
39744
39744
  return;
39745
39745
  }
39746
+ if (selectedElements.length === 1 && isFrameLikeElement15(selectedElements[0])) {
39747
+ this.scrollToContent(selectedElements[0], {
39748
+ animate: true,
39749
+ duration: 500,
39750
+ viewportZoomFactor: 0.6,
39751
+ fitToViewport: true,
39752
+ canvasOffsets: this.getEditorUIOffsets()
39753
+ });
39754
+ return;
39755
+ }
39746
39756
  resetCursor(this.interactiveCanvas);
39747
39757
  const selectedGroupIds = getSelectedGroupIds4(this.state);
39748
39758
  if (selectedGroupIds.length > 0) {
@@ -41981,41 +41991,13 @@ var App = class _App extends React46.Component {
41981
41991
  const hasSupportedImage = files.some(
41982
41992
  (file2) => isSupportedImageFile(file2)
41983
41993
  );
41984
- if (!isSinglePngOrSvgSceneCandidate && !hasSupportedImage) {
41994
+ if (hasSupportedImage) {
41985
41995
  return;
41986
41996
  }
41987
- }
41988
- if (fileItems.length === 1) {
41989
- const { file: file2, fileHandle } = fileItems[0];
41990
- if (file2 && (file2.type === MIME_TYPES9.png || file2.type === MIME_TYPES9.svg)) {
41991
- try {
41992
- const scene = await loadFromBlob(
41993
- file2,
41994
- this.state,
41995
- this.scene.getElementsIncludingDeleted(),
41996
- fileHandle
41997
- );
41998
- this.syncActionResult({
41999
- ...scene,
42000
- appState: {
42001
- ...scene.appState || this.state,
42002
- isLoading: false
42003
- },
42004
- replaceFiles: true,
42005
- captureUpdate: CaptureUpdateAction40.IMMEDIATELY
42006
- });
42007
- return;
42008
- } catch (error) {
42009
- if (error.name !== "EncodingError") {
42010
- throw new Error(t("alerts.couldNotLoadInvalidFile"));
42011
- }
42012
- }
41997
+ if (!isSinglePngOrSvgSceneCandidate && !hasSupportedImage) {
41998
+ return;
42013
41999
  }
42014
42000
  }
42015
- const imageFiles = fileItems.map((data) => data.file).filter((file2) => isSupportedImageFile(file2));
42016
- if (imageFiles.length > 0 && this.isToolSupported("image")) {
42017
- return this.insertImages(imageFiles, sceneX, sceneY);
42018
- }
42019
42001
  const excalidrawLibrary_ids = dataTransferList.getData(
42020
42002
  MIME_TYPES9.excalidrawlibIds
42021
42003
  );