@myoc/excalidraw 0.19.529 → 0.19.530

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
@@ -62,10 +62,10 @@ import {
62
62
  serializeAsJSON,
63
63
  strokeRectWithRotation_simple,
64
64
  zoomToFitBounds
65
- } from "./chunk-7GX2B2N5.js";
65
+ } from "./chunk-ROEGCKS3.js";
66
66
  import {
67
67
  define_import_meta_env_default
68
- } from "./chunk-H5L4PT3U.js";
68
+ } from "./chunk-XSA46KXZ.js";
69
69
  import {
70
70
  en_default
71
71
  } from "./chunk-SKCAT7JG.js";
@@ -10936,7 +10936,7 @@ var exportCanvas = async (type, elements, appState, files, {
10936
10936
  let blob = canvasToBlob(tempCanvas);
10937
10937
  if (appState.exportEmbedScene) {
10938
10938
  blob = blob.then(
10939
- (blob2) => import("./data/image-GYAOLTNI.js").then(
10939
+ (blob2) => import("./data/image-AYT4E6ZF.js").then(
10940
10940
  ({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
10941
10941
  blob: blob2,
10942
10942
  metadata: serializeAsJSON(elements, appState, files, "local")
@@ -13009,6 +13009,7 @@ var actionSmartZoom = register({
13009
13009
  type: "button",
13010
13010
  icon: arrowsToEyeIcon,
13011
13011
  "aria-label": t("labels.smartZoom"),
13012
+ title: `${t("labels.smartZoom")} - ${KEYS26.F.toLocaleUpperCase()}`,
13012
13013
  onClick: () => updateData(null),
13013
13014
  size: data?.size || "medium",
13014
13015
  "data-testid": "button-smart-zoom",
@@ -25568,6 +25569,7 @@ var getShapeActionPredicates = (appState, targetElements, elementsMap, app) => {
25568
25569
  ),
25569
25570
  align: !isSingleElementBoundContainer && alignActionsPredicate(appState, app),
25570
25571
  distribute: targetElements.length > 2,
25572
+ imageLayout: targetElements.length > 1 && targetElements.every(isImageElement4) && alignActionsPredicate(appState, app),
25571
25573
  // per-element actions
25572
25574
  // NOTE: the full panel treats a bound container as linkable; the compact /
25573
25575
  // mobile layouts only link a truly single selection. Both are preserved via
@@ -25598,7 +25600,8 @@ var LayersFieldset = ({
25598
25600
  ] });
25599
25601
  var AlignFieldset = ({
25600
25602
  renderAction,
25601
- showDistribute
25603
+ showDistribute,
25604
+ showImageLayout
25602
25605
  }) => {
25603
25606
  const isRTL3 = document.documentElement.getAttribute("dir") === "rtl";
25604
25607
  return /* @__PURE__ */ jsxs33("fieldset", { children: [
@@ -25631,7 +25634,12 @@ var AlignFieldset = ({
25631
25634
  showDistribute && renderAction("distributeVertically")
25632
25635
  ]
25633
25636
  }
25634
- )
25637
+ ),
25638
+ showImageLayout && /* @__PURE__ */ jsxs33(Fragment9, { children: [
25639
+ /* @__PURE__ */ jsx66("div", { style: { flexBasis: "100%", height: 0 } }),
25640
+ renderAction("arrangeElements"),
25641
+ renderAction("normaliseElements")
25642
+ ] })
25635
25643
  ] })
25636
25644
  ] });
25637
25645
  };
@@ -25678,7 +25686,8 @@ var SelectedShapeActions = ({
25678
25686
  AlignFieldset,
25679
25687
  {
25680
25688
  renderAction,
25681
- showDistribute: predicates.distribute
25689
+ showDistribute: predicates.distribute,
25690
+ showImageLayout: predicates.imageLayout
25682
25691
  }
25683
25692
  ),
25684
25693
  predicates.showExtraActions && /* @__PURE__ */ jsxs33("fieldset", { children: [
@@ -25690,7 +25699,8 @@ var SelectedShapeActions = ({
25690
25699
  renderAction("ungroup"),
25691
25700
  predicates.link && renderAction("hyperlink"),
25692
25701
  predicates.cropEditor && renderAction("cropEditor"),
25693
- predicates.lineEditor && renderAction("toggleLinearEditor")
25702
+ predicates.lineEditor && renderAction("toggleLinearEditor"),
25703
+ renderAction("smartZoom")
25694
25704
  ] })
25695
25705
  ] })
25696
25706
  ] });
@@ -25976,7 +25986,8 @@ var CombinedExtraActions = ({
25976
25986
  AlignFieldset,
25977
25987
  {
25978
25988
  renderAction,
25979
- showDistribute: predicates.distribute
25989
+ showDistribute: predicates.distribute,
25990
+ showImageLayout: predicates.imageLayout
25980
25991
  }
25981
25992
  ),
25982
25993
  /* @__PURE__ */ jsxs33("fieldset", { children: [
@@ -25986,6 +25997,7 @@ var CombinedExtraActions = ({
25986
25997
  renderAction("ungroup"),
25987
25998
  predicates.linkSingleOnly && renderAction("hyperlink"),
25988
25999
  predicates.cropEditor && renderAction("cropEditor"),
26000
+ renderAction("smartZoom"),
25989
26001
  showDuplicate && renderAction("duplicateSelection"),
25990
26002
  showDelete && renderAction("deleteSelectedElements")
25991
26003
  ] })
@@ -27103,7 +27115,9 @@ var MobileMenu = ({
27103
27115
  {
27104
27116
  className: "App-bottom-bar",
27105
27117
  style: {
27106
- marginBottom: SCROLLBAR_WIDTH + SCROLLBAR_MARGIN
27118
+ marginBottom: SCROLLBAR_WIDTH + SCROLLBAR_MARGIN,
27119
+ left: 14,
27120
+ transform: "none"
27107
27121
  },
27108
27122
  "data-viewport-ui": "bottom",
27109
27123
  children: [
@@ -27124,7 +27138,14 @@ var MobileMenu = ({
27124
27138
  }
27125
27139
  )
27126
27140
  ] }),
27127
- !appState.viewModeEnabled && /* @__PURE__ */ jsx80(Island, { className: "App-toolbar", children: appState.openDialog?.name !== "elementLinkSelector" && renderToolbar() })
27141
+ !appState.viewModeEnabled && /* @__PURE__ */ jsx80(
27142
+ Island,
27143
+ {
27144
+ className: "App-toolbar",
27145
+ style: { justifyContent: "flex-start" },
27146
+ children: appState.openDialog?.name !== "elementLinkSelector" && renderToolbar()
27147
+ }
27148
+ )
27128
27149
  ]
27129
27150
  }
27130
27151
  ),
@@ -41184,6 +41205,13 @@ var App = class _App extends React40.Component {
41184
41205
  }
41185
41206
  return [];
41186
41207
  });
41208
+ __publicField(this, "getImageActionContextMenuItems", (hitElement) => {
41209
+ const selectedElements = this.scene.getSelectedElements(this.state);
41210
+ if (selectedElements.length > 0 && selectedElements.every((element) => isImageElement9(element)) && (!hitElement || this.state.selectedElementIds[hitElement.id])) {
41211
+ return [actionArrangeElements, actionNormaliseElements];
41212
+ }
41213
+ return [];
41214
+ });
41187
41215
  __publicField(this, "getElementLinkContextMenuItems", (hitElement) => {
41188
41216
  if (!hitElement?.link) {
41189
41217
  return [];
@@ -41213,6 +41241,7 @@ var App = class _App extends React40.Component {
41213
41241
  });
41214
41242
  __publicField(this, "getContextMenuItems", (type, hitElement) => {
41215
41243
  const imageContextMenuItems = this.getImageContextMenuItems(hitElement);
41244
+ const imageActionContextMenuItems = this.getImageActionContextMenuItems(hitElement);
41216
41245
  const elementLinkContextMenuItems = this.getElementLinkContextMenuItems(hitElement);
41217
41246
  if (type === "canvas") {
41218
41247
  if (this.state.viewModeEnabled) {
@@ -41263,6 +41292,8 @@ var App = class _App extends React40.Component {
41263
41292
  actionPaste,
41264
41293
  imageContextMenuItems.length > 0 && CONTEXT_MENU_SEPARATOR,
41265
41294
  ...imageContextMenuItems,
41295
+ imageActionContextMenuItems.length > 0 && CONTEXT_MENU_SEPARATOR,
41296
+ ...imageActionContextMenuItems,
41266
41297
  CONTEXT_MENU_SEPARATOR,
41267
41298
  actionSelectAllElementsInFrame,
41268
41299
  actionRemoveAllElementsFromFrame,