@maily-to/core 0.3.4 → 0.3.5

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.
@@ -4498,7 +4498,8 @@ function ImageView(props) {
4498
4498
  newHeight = IMAGE_MAX_HEIGHT;
4499
4499
  }
4500
4500
  if (node.attrs.lockAspectRatio) {
4501
- newHeight = getNewHeight(newWidth, node.attrs.aspectRatio);
4501
+ const aspectRatio = node.attrs.aspectRatio && isFinite(node.attrs.aspectRatio) && node.attrs.aspectRatio > 0 ? node.attrs.aspectRatio : currentWidth / currentHeight;
4502
+ newHeight = getNewHeight(newWidth, aspectRatio);
4502
4503
  }
4503
4504
  setResizingStyle({ width: newWidth, height: newHeight });
4504
4505
  if (!event2.buttons) {
@@ -4674,8 +4675,8 @@ function ImageView(props) {
4674
4675
  "data-drag-handle": editor.isEditable,
4675
4676
  className: cn("mly-image-drop-zone", isDraggingOver && "mly-drag-over"),
4676
4677
  style: __spreadValues(__spreadProps(__spreadValues({}, hasImageSrc && status === "loaded" ? __spreadValues({
4677
- width: width ? `${width}px` : void 0,
4678
- height: height ? `${height}px` : void 0
4678
+ width: width && width !== "auto" ? `${width}px` : void 0,
4679
+ height: height && height !== "auto" ? `${height}px` : void 0
4679
4680
  }, resizingStyle) : {}), {
4680
4681
  overflow: "hidden",
4681
4682
  position: "relative",
@@ -4727,8 +4728,8 @@ function ImageView(props) {
4727
4728
  objectFit: "fill",
4728
4729
  marginBottom: 0,
4729
4730
  borderRadius,
4730
- width: (resizingStyle == null ? void 0 : resizingStyle.width) ? `${resizingStyle.width}px` : width ? `${width}px` : "auto",
4731
- height: (resizingStyle == null ? void 0 : resizingStyle.height) ? `${resizingStyle.height}px` : height ? `${height}px` : "auto"
4731
+ width: (resizingStyle == null ? void 0 : resizingStyle.width) ? `${resizingStyle.width}px` : width && width !== "auto" ? `${width}px` : "auto",
4732
+ height: (resizingStyle == null ? void 0 : resizingStyle.height) ? `${resizingStyle.height}px` : height && height !== "auto" ? `${height}px` : "auto"
4732
4733
  }),
4733
4734
  draggable: editor.isEditable,
4734
4735
  className: cn(