@plasmicapp/react-web 0.2.98 → 0.2.101

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.
@@ -845,7 +845,7 @@ var PlasmicImg = /*#__PURE__*/React__default.forwardRef(function PlasmicImg(prop
845
845
  fullHeight = _ref.fullHeight,
846
846
  aspectRatio = _ref.aspectRatio;
847
847
 
848
- var srcStr = src ? typeof src === "string" ? src : src.src : ""; // Assume external image if either dimension is null and use usual <img>
848
+ var srcStr = src ? typeof src === "string" ? src : typeof src.src === "string" ? src.src : src.src.src : ""; // Assume external image if either dimension is null and use usual <img>
849
849
 
850
850
  if (fullHeight == null || fullWidth == null) {
851
851
  return React__default.createElement("img", Object.assign({
@@ -862,6 +862,8 @@ var PlasmicImg = /*#__PURE__*/React__default.forwardRef(function PlasmicImg(prop
862
862
  displayWidth = "100%";
863
863
  }
864
864
 
865
+ var computedDisplayWidth = displayWidth;
866
+
865
867
  if (fullWidth && fullHeight && (!displayWidth || displayWidth === "auto") && !!getPixelLength(displayHeight)) {
866
868
  // If there's a pixel length specified for displayHeight but not displayWidth,
867
869
  // then we can derive the pixel length for displayWidth. Having an explicit
@@ -871,7 +873,7 @@ var PlasmicImg = /*#__PURE__*/React__default.forwardRef(function PlasmicImg(prop
871
873
  // We shouldn't do it for SVGs though, because `fullWidth` and
872
874
  // `fullHeight` might have rounded values so the final
873
875
  // `displayWidth` could differ by 1px or so.
874
- displayWidth = getPixelLength(displayHeight) * fullWidth / fullHeight;
876
+ computedDisplayWidth = getPixelLength(displayHeight) * fullWidth / fullHeight;
875
877
  }
876
878
  }
877
879
 
@@ -887,7 +889,7 @@ var PlasmicImg = /*#__PURE__*/React__default.forwardRef(function PlasmicImg(prop
887
889
  spacerHeight = Math.round(spacerWidth / aspectRatio);
888
890
  }
889
891
 
890
- var _getWidths = getWidths(displayWidth, fullWidth, {
892
+ var _getWidths = getWidths(computedDisplayWidth, fullWidth, {
891
893
  minWidth: displayMinWidth
892
894
  }),
893
895
  sizes = _getWidths.sizes,
@@ -899,7 +901,7 @@ var PlasmicImg = /*#__PURE__*/React__default.forwardRef(function PlasmicImg(prop
899
901
 
900
902
  var wrapperStyle = _extends({}, style || {});
901
903
 
902
- var spacerStyle = pick(style || {}, "objectFit", "objectPosition");
904
+ var spacerStyle = _extends({}, pick(style || {}, "objectFit", "objectPosition"));
903
905
 
904
906
  if (displayWidth != null && displayWidth !== "auto") {
905
907
  // If width is set, set it on the wrapper along with min/max width
@@ -931,22 +933,19 @@ var PlasmicImg = /*#__PURE__*/React__default.forwardRef(function PlasmicImg(prop
931
933
  }
932
934
 
933
935
  if (displayHeight != null && displayHeight !== "auto") {
934
- spacerStyle.height = "100%";
935
- wrapperStyle.height = displayHeight;
936
- wrapperStyle.minHeight = displayMinHeight;
937
- wrapperStyle.maxHeight = displayMaxHeight;
936
+ spacerStyle.height = "100%"; // wrapperStyle.height = displayHeight;
937
+ // wrapperStyle.minHeight = displayMinHeight;
938
+ // wrapperStyle.maxHeight = displayMaxHeight;
938
939
  } else {
939
940
  spacerStyle.height = displayHeight;
940
941
  wrapperStyle.height = "auto";
941
942
 
942
943
  if (displayMinHeight) {
943
- spacerStyle.minHeight = "100%";
944
- wrapperStyle.minHeight = displayMinHeight;
944
+ spacerStyle.minHeight = "100%"; // wrapperStyle.minHeight = displayMinHeight;
945
945
  }
946
946
 
947
947
  if (displayMaxHeight != null && displayMaxHeight !== "none") {
948
- spacerStyle.maxHeight = "100%";
949
- wrapperStyle.maxHeight = displayMaxHeight;
948
+ spacerStyle.maxHeight = "100%"; // wrapperStyle.maxHeight = displayMaxHeight;
950
949
  }
951
950
  }
952
951