@planetaexo/design-system 0.58.0 → 0.58.2
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/index.cjs +13 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10082,6 +10082,9 @@ function Picture(_a) {
|
|
|
10082
10082
|
io.observe(el);
|
|
10083
10083
|
return () => io.disconnect();
|
|
10084
10084
|
}, [eager, visible, rootMargin]);
|
|
10085
|
+
React31.useEffect(() => {
|
|
10086
|
+
setLoaded(false);
|
|
10087
|
+
}, [src]);
|
|
10085
10088
|
const webp = webpVariantUrl(src);
|
|
10086
10089
|
const realSrc = visible ? src : PLACEHOLDER_SRC;
|
|
10087
10090
|
const decodingResolved = decoding != null ? decoding : eager ? void 0 : "async";
|
|
@@ -10094,12 +10097,14 @@ function Picture(_a) {
|
|
|
10094
10097
|
onError == null ? void 0 : onError(e);
|
|
10095
10098
|
};
|
|
10096
10099
|
const showLoader = visible && !loaded;
|
|
10100
|
+
const hideImg = visible && !loaded;
|
|
10101
|
+
const mergedStyle = __spreadValues(__spreadValues({}, imgProps.style), hideImg ? { opacity: 0 } : {});
|
|
10097
10102
|
if (!webp) {
|
|
10098
10103
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10099
10104
|
showLoader && /* @__PURE__ */ jsx(PictureLoader, {}),
|
|
10100
10105
|
/* @__PURE__ */ jsx(
|
|
10101
10106
|
"img",
|
|
10102
|
-
__spreadValues({
|
|
10107
|
+
__spreadProps(__spreadValues({
|
|
10103
10108
|
ref,
|
|
10104
10109
|
src: realSrc,
|
|
10105
10110
|
"data-src": visible ? void 0 : src,
|
|
@@ -10107,7 +10112,9 @@ function Picture(_a) {
|
|
|
10107
10112
|
loading: loading != null ? loading : eager ? void 0 : "lazy",
|
|
10108
10113
|
onLoad: handleLoad,
|
|
10109
10114
|
onError: handleError
|
|
10110
|
-
}, imgProps)
|
|
10115
|
+
}, imgProps), {
|
|
10116
|
+
style: mergedStyle
|
|
10117
|
+
})
|
|
10111
10118
|
)
|
|
10112
10119
|
] });
|
|
10113
10120
|
}
|
|
@@ -10118,7 +10125,7 @@ function Picture(_a) {
|
|
|
10118
10125
|
extraSources,
|
|
10119
10126
|
/* @__PURE__ */ jsx(
|
|
10120
10127
|
"img",
|
|
10121
|
-
__spreadValues({
|
|
10128
|
+
__spreadProps(__spreadValues({
|
|
10122
10129
|
ref,
|
|
10123
10130
|
src: realSrc,
|
|
10124
10131
|
"data-src": visible ? void 0 : src,
|
|
@@ -10127,7 +10134,9 @@ function Picture(_a) {
|
|
|
10127
10134
|
loading: loading != null ? loading : eager ? void 0 : "lazy",
|
|
10128
10135
|
onLoad: handleLoad,
|
|
10129
10136
|
onError: handleError
|
|
10130
|
-
}, imgProps)
|
|
10137
|
+
}, imgProps), {
|
|
10138
|
+
style: mergedStyle
|
|
10139
|
+
})
|
|
10131
10140
|
)
|
|
10132
10141
|
] })
|
|
10133
10142
|
] });
|