@snowcone-app/ui 0.2.0 → 0.2.1
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/CHANGELOG.md +6 -0
- package/dist/index.cjs +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/composed/HeroProductImage.tsx +13 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#609](https://github.com/snowcone-app/snowcone-monorepo/pull/609) [`a858719`](https://github.com/snowcone-app/snowcone-monorepo/commit/a85871910d0e48111b12636c32560b568a057291) Thanks [@kevinsproles](https://github.com/kevinsproles)! - HeroProductImage now shows a pulsing loading skeleton until the first mockup image has actually painted, instead of a blank white area while the render is fetched.
|
|
8
|
+
|
|
3
9
|
## 0.2.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -10088,6 +10088,7 @@ var HeroProductImage = (0, import_react44.memo)(function HeroProductImage2({
|
|
|
10088
10088
|
const [prevUrl, setPrevUrl] = (0, import_react44.useState)(null);
|
|
10089
10089
|
const [showNew, setShowNew] = (0, import_react44.useState)(false);
|
|
10090
10090
|
const [renderedUrl, setRenderedUrl] = (0, import_react44.useState)(displayUrl);
|
|
10091
|
+
const [firstImageLoaded, setFirstImageLoaded] = (0, import_react44.useState)(false);
|
|
10091
10092
|
const prevDisplayUrlRef = (0, import_react44.useRef)(displayUrl);
|
|
10092
10093
|
const signHintShownRef = (0, import_react44.useRef)(false);
|
|
10093
10094
|
(0, import_react44.useEffect)(() => {
|
|
@@ -10167,6 +10168,7 @@ var HeroProductImage = (0, import_react44.memo)(function HeroProductImage2({
|
|
|
10167
10168
|
style,
|
|
10168
10169
|
"data-hero-image": "true",
|
|
10169
10170
|
children: [
|
|
10171
|
+
!firstImageLoaded && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "absolute inset-0 bg-muted-foreground/20 animate-pulse" }),
|
|
10170
10172
|
renderedUrl && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
10171
10173
|
"img",
|
|
10172
10174
|
{
|
|
@@ -10179,6 +10181,7 @@ var HeroProductImage = (0, import_react44.memo)(function HeroProductImage2({
|
|
|
10179
10181
|
fetchPriority: "high",
|
|
10180
10182
|
onClick,
|
|
10181
10183
|
onLoad: () => {
|
|
10184
|
+
setFirstImageLoaded(true);
|
|
10182
10185
|
if (!onLoadCalledRef.current && onLoad) {
|
|
10183
10186
|
onLoadCalledRef.current = true;
|
|
10184
10187
|
onLoad();
|
|
@@ -10186,6 +10189,7 @@ var HeroProductImage = (0, import_react44.memo)(function HeroProductImage2({
|
|
|
10186
10189
|
onUrlGeneratedRef.current?.(renderedUrl);
|
|
10187
10190
|
},
|
|
10188
10191
|
onError: () => {
|
|
10192
|
+
setFirstImageLoaded(true);
|
|
10189
10193
|
onError?.();
|
|
10190
10194
|
if (process.env.NODE_ENV !== "production" && !signHintShownRef.current && renderedUrl && /\/[A-Za-z0-9]+\?/.test(renderedUrl) && !/[?&]signature=/.test(renderedUrl)) {
|
|
10191
10195
|
signHintShownRef.current = true;
|
|
@@ -10211,8 +10215,7 @@ var HeroProductImage = (0, import_react44.memo)(function HeroProductImage2({
|
|
|
10211
10215
|
},
|
|
10212
10216
|
onTransitionEnd: handleCrossfadeEnd
|
|
10213
10217
|
}
|
|
10214
|
-
)
|
|
10215
|
-
!renderedUrl && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "absolute inset-0 bg-zinc-200" })
|
|
10218
|
+
)
|
|
10216
10219
|
]
|
|
10217
10220
|
}
|
|
10218
10221
|
);
|