@myoc/excalidraw 0.19.524 → 0.19.525

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-5JBEU7F3.js";
65
65
  import {
66
66
  define_import_meta_env_default
67
- } from "./chunk-W3K3P2GO.js";
67
+ } from "./chunk-BT3FFAFC.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-JSJUP7H5.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 {
@@ -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;
@@ -41196,7 +41198,12 @@ var App = class _App extends React40.Component {
41196
41198
  const imageContextMenuItems = this.getImageContextMenuItems(hitElement);
41197
41199
  if (type === "canvas") {
41198
41200
  if (this.state.viewModeEnabled) {
41199
- return [actionToggleGridMode, actionToggleViewMode, actionToggleStats];
41201
+ return [
41202
+ actionSmartZoom,
41203
+ actionToggleGridMode,
41204
+ actionToggleViewMode,
41205
+ actionToggleStats
41206
+ ];
41200
41207
  }
41201
41208
  return [
41202
41209
  actionPaste,
@@ -41214,6 +41221,7 @@ var App = class _App extends React40.Component {
41214
41221
  }
41215
41222
  if (this.state.viewModeEnabled) {
41216
41223
  return [
41224
+ actionSmartZoom,
41217
41225
  actionCopy,
41218
41226
  imageContextMenuItems.length > 0 && CONTEXT_MENU_SEPARATOR,
41219
41227
  ...imageContextMenuItems
@@ -41227,6 +41235,8 @@ var App = class _App extends React40.Component {
41227
41235
  actionBringToFront
41228
41236
  ] : [];
41229
41237
  return [
41238
+ CONTEXT_MENU_SEPARATOR,
41239
+ actionSmartZoom,
41230
41240
  CONTEXT_MENU_SEPARATOR,
41231
41241
  actionCut,
41232
41242
  actionCopy,