@myoc/excalidraw 0.19.524 → 0.19.526

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
@@ -61,10 +61,10 @@ import {
61
61
  serializeAsJSON,
62
62
  strokeRectWithRotation_simple,
63
63
  zoomToFitBounds
64
- } from "./chunk-3SND5YQP.js";
64
+ } from "./chunk-UKYYHFTM.js";
65
65
  import {
66
66
  define_import_meta_env_default
67
- } from "./chunk-W3K3P2GO.js";
67
+ } from "./chunk-WQAS3ONQ.js";
68
68
  import {
69
69
  en_default
70
70
  } from "./chunk-SKCAT7JG.js";
@@ -10935,7 +10935,7 @@ var exportCanvas = async (type, elements, appState, files, {
10935
10935
  let blob = canvasToBlob(tempCanvas);
10936
10936
  if (appState.exportEmbedScene) {
10937
10937
  blob = blob.then(
10938
- (blob2) => import("./data/image-F4TDOTKO.js").then(
10938
+ (blob2) => import("./data/image-ILRWTLER.js").then(
10939
10939
  ({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
10940
10940
  blob: blob2,
10941
10941
  metadata: serializeAsJSON(elements, appState, files, "local")
@@ -12445,6 +12445,7 @@ var DEFAULT_SMART_ZOOM_PREFERENCES = {
12445
12445
  fitToViewport: true,
12446
12446
  animate: true,
12447
12447
  duration: 200,
12448
+ respectUIElements: false,
12448
12449
  viewportZoomFactor: 0.8
12449
12450
  };
12450
12451
  var getEffectiveEditorPreferences = (appState, editorPreferences) => {
@@ -12993,7 +12994,7 @@ var actionSmartZoom = register({
12993
12994
  target: selectedElements.length ? selectedElements : elements,
12994
12995
  fit: settings.fitToViewport ? "contain" : "none",
12995
12996
  animation: settings.animate ? { duration: settings.duration } : false,
12996
- offsets: { ui: true },
12997
+ offsets: settings.respectUIElements ? { ui: true } : void 0,
12997
12998
  viewportZoomFactor: settings.viewportZoomFactor
12998
12999
  });
12999
13000
  return {
@@ -22349,7 +22350,7 @@ var renderImageStatusOverlays = (context, visibleElements, elementsMap, app, app
22349
22350
  continue;
22350
22351
  }
22351
22352
  const imageStatus = app.imageStatus.get(element.fileId);
22352
- const hasError = imageStatus?.downloadError === null ? false : element.status === "error" || !!imageStatus?.downloadError;
22353
+ const hasError = !!imageStatus?.downloadError;
22353
22354
  if (hasError) {
22354
22355
  const icon = getImageStatusOverlayPosition(
22355
22356
  element,
@@ -25184,6 +25185,7 @@ var shortcutMap = {
25184
25185
  zoomToFitSelection: [],
25185
25186
  zoomToFit: [],
25186
25187
  zoomToFitSelectionInViewport: [],
25188
+ smartZoom: [getShortcutKey("F")],
25187
25189
  saveFileToDisk: [getShortcutKey("CtrlOrCmd+S")],
25188
25190
  saveToActiveFile: [getShortcutKey("CtrlOrCmd+S")],
25189
25191
  toggleShortcuts: [getShortcutKey("?")],
@@ -36131,7 +36133,7 @@ var App = class _App extends React40.Component {
36131
36133
  this.addNewImagesToImageCache();
36132
36134
  }
36133
36135
  if (actionResult.appState || editingTextElement || this.state.contextMenu) {
36134
- let viewModeEnabled = actionResult?.appState?.viewModeEnabled || false;
36136
+ let viewModeEnabled = actionResult?.appState?.viewModeEnabled ?? this.state.viewModeEnabled;
36135
36137
  const theme = actionResult?.appState?.theme || this.props.theme || THEME25.LIGHT;
36136
36138
  const name = actionResult?.appState?.name ?? this.state.name;
36137
36139
  const errorMessage = actionResult?.appState?.errorMessage ?? this.state.errorMessage;
@@ -40630,14 +40632,21 @@ var App = class _App extends React40.Component {
40630
40632
  transitionStart: performance.now()
40631
40633
  });
40632
40634
  }
40633
- if (erroredFiles.size) {
40635
+ if (erroredFiles.size || updatedFiles.size) {
40634
40636
  this.store.scheduleAction(CaptureUpdateAction40.NEVER);
40635
40637
  this.scene.replaceAllElements(
40636
40638
  this.scene.getElementsIncludingDeleted().map((element) => {
40637
- if (isInitializedImageElement3(element) && erroredFiles.has(element.fileId)) {
40638
- return newElementWith10(element, {
40639
- status: "error"
40640
- });
40639
+ if (isInitializedImageElement3(element)) {
40640
+ if (erroredFiles.has(element.fileId)) {
40641
+ return newElementWith10(element, {
40642
+ status: "error"
40643
+ });
40644
+ }
40645
+ if (updatedFiles.has(element.fileId) && element.status === "error") {
40646
+ return newElementWith10(element, {
40647
+ status: "saved"
40648
+ });
40649
+ }
40641
40650
  }
40642
40651
  return element;
40643
40652
  })
@@ -41196,7 +41205,12 @@ var App = class _App extends React40.Component {
41196
41205
  const imageContextMenuItems = this.getImageContextMenuItems(hitElement);
41197
41206
  if (type === "canvas") {
41198
41207
  if (this.state.viewModeEnabled) {
41199
- return [actionToggleGridMode, actionToggleViewMode, actionToggleStats];
41208
+ return [
41209
+ actionSmartZoom,
41210
+ actionToggleGridMode,
41211
+ actionToggleViewMode,
41212
+ actionToggleStats
41213
+ ];
41200
41214
  }
41201
41215
  return [
41202
41216
  actionPaste,
@@ -41214,6 +41228,7 @@ var App = class _App extends React40.Component {
41214
41228
  }
41215
41229
  if (this.state.viewModeEnabled) {
41216
41230
  return [
41231
+ actionSmartZoom,
41217
41232
  actionCopy,
41218
41233
  imageContextMenuItems.length > 0 && CONTEXT_MENU_SEPARATOR,
41219
41234
  ...imageContextMenuItems
@@ -41227,6 +41242,8 @@ var App = class _App extends React40.Component {
41227
41242
  actionBringToFront
41228
41243
  ] : [];
41229
41244
  return [
41245
+ CONTEXT_MENU_SEPARATOR,
41246
+ actionSmartZoom,
41230
41247
  CONTEXT_MENU_SEPARATOR,
41231
41248
  actionCut,
41232
41249
  actionCopy,