@plasmicapp/react-web 0.2.426 → 0.2.428
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/all.d.ts +6 -1
- package/dist/index.cjs.js +6 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/react-web.esm.js +6 -3
- package/dist/react-web.esm.js.map +1 -1
- package/dist/render/PlasmicImg/index.d.ts +6 -1
- package/dist/render/PlasmicImg/index.spec.d.ts +1 -0
- package/package.json +3 -3
- package/skinny/dist/render/PlasmicImg/index.d.ts +6 -1
- package/skinny/dist/render/PlasmicImg/index.js +6 -3
- package/skinny/dist/render/PlasmicImg/index.js.map +1 -1
- package/skinny/dist/render/PlasmicImg/index.spec.d.ts +1 -0
package/dist/react-web.esm.js
CHANGED
|
@@ -729,7 +729,7 @@ var IMG_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
|
|
|
729
729
|
var DEVICE_SIZES = [640, 750, 828, 1080, 1200, 1920, 2048, 3840];
|
|
730
730
|
var ALL_SIZES = __spreadArray(__spreadArray([], __read(IMG_SIZES), false), __read(DEVICE_SIZES), false);
|
|
731
731
|
var PlasmicImg = React__default.forwardRef(function PlasmicImg(props, outerRef) {
|
|
732
|
-
var src = props.src, className = props.className, displayWidth = props.displayWidth, displayHeight = props.displayHeight, displayMinWidth = props.displayMinWidth, displayMinHeight = props.displayMinHeight, displayMaxWidth = props.displayMaxWidth, displayMaxHeight = props.displayMaxHeight, quality = props.quality, loader = props.loader, imgRef = props.imgRef, style = props.style, loading = props.loading, rest = __rest(props, ["src", "className", "displayWidth", "displayHeight", "displayMinWidth", "displayMinHeight", "displayMaxWidth", "displayMaxHeight", "quality", "loader", "imgRef", "style", "loading"]);
|
|
732
|
+
var src = props.src, className = props.className, displayWidth = props.displayWidth, displayHeight = props.displayHeight, displayMinWidth = props.displayMinWidth, displayMinHeight = props.displayMinHeight, displayMaxWidth = props.displayMaxWidth, displayMaxHeight = props.displayMaxHeight, quality = props.quality, format = props.format, loader = props.loader, imgRef = props.imgRef, style = props.style, loading = props.loading, rest = __rest(props, ["src", "className", "displayWidth", "displayHeight", "displayMinWidth", "displayMinHeight", "displayMaxWidth", "displayMaxHeight", "quality", "format", "loader", "imgRef", "style", "loading"]);
|
|
733
733
|
var imgProps = Object.assign({}, rest, {
|
|
734
734
|
// Default loading to "lazy" if not specified (which is different from the
|
|
735
735
|
// html img, which defaults to eager!)
|
|
@@ -852,6 +852,7 @@ var PlasmicImg = React__default.forwardRef(function PlasmicImg(props, outerRef)
|
|
|
852
852
|
sizes: sizes,
|
|
853
853
|
src: srcStr,
|
|
854
854
|
quality: quality,
|
|
855
|
+
format: format,
|
|
855
856
|
ref: imgRef,
|
|
856
857
|
style: style ? pick(style, "objectFit", "objectPosition") : undefined,
|
|
857
858
|
imgProps: imgProps,
|
|
@@ -862,9 +863,9 @@ function makePicture(opts) {
|
|
|
862
863
|
// If imageLoader is undefined, then this renders to just a normal
|
|
863
864
|
// <img />. Else it will render to a <picture> with a <source> for
|
|
864
865
|
// webp, and srcSet/sizes set according to width requirements.
|
|
865
|
-
var imageLoader = opts.imageLoader, widthDescs = opts.widthDescs, src = opts.src, quality = opts.quality, style = opts.style, className = opts.className, sizes = opts.sizes, imgProps = opts.imgProps, ref = opts.ref;
|
|
866
|
+
var imageLoader = opts.imageLoader, widthDescs = opts.widthDescs, src = opts.src, quality = opts.quality, format = opts.format, style = opts.style, className = opts.className, sizes = opts.sizes, imgProps = opts.imgProps, ref = opts.ref;
|
|
866
867
|
return (React__default.createElement("picture", { className: "__wab_picture" },
|
|
867
|
-
imageLoader && imageLoader.supportsUrl(src) && (React__default.createElement("source", { type: "image/webp", srcSet: widthDescs
|
|
868
|
+
imageLoader && imageLoader.supportsUrl(src) && !format && (React__default.createElement("source", { type: "image/webp", srcSet: widthDescs
|
|
868
869
|
.map(function (wd) {
|
|
869
870
|
return "".concat(imageLoader.transformUrl({
|
|
870
871
|
src: src,
|
|
@@ -878,6 +879,7 @@ function makePicture(opts) {
|
|
|
878
879
|
? imageLoader.transformUrl({
|
|
879
880
|
src: src,
|
|
880
881
|
quality: quality,
|
|
882
|
+
format: format,
|
|
881
883
|
width: widthDescs[widthDescs.length - 1].width,
|
|
882
884
|
})
|
|
883
885
|
: src, srcSet: imageLoader && imageLoader.supportsUrl(src)
|
|
@@ -886,6 +888,7 @@ function makePicture(opts) {
|
|
|
886
888
|
return "".concat(imageLoader.transformUrl({
|
|
887
889
|
src: src,
|
|
888
890
|
quality: quality,
|
|
891
|
+
format: format,
|
|
889
892
|
width: wd.width,
|
|
890
893
|
}), " ").concat(wd.desc);
|
|
891
894
|
})
|