@snowcone-app/ui 0.10.8 → 0.10.10
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 +15 -0
- package/dist/index.cjs +13 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/composed/HeroProductImage.tsx +9 -0
- package/src/composed/__tests__/HeroProductImage.failed.test.tsx +37 -0
- package/src/patterns/RealtimeProvider.tsx +2 -1
package/dist/index.js
CHANGED
|
@@ -5963,6 +5963,7 @@ function RealtimeProvider({
|
|
|
5963
5963
|
console.error(
|
|
5964
5964
|
`[RealtimeProvider] E_BLOB_PICTURE_BOUND: ${owner} has more than ${MAX_FRAMES_PER_PICTURE} frames waiting to be shown; dropping its oldest unshown frame (the picture on screen is kept).`
|
|
5965
5965
|
);
|
|
5966
|
+
ackUrl(victim);
|
|
5966
5967
|
revokeBlobUrl(victim);
|
|
5967
5968
|
}
|
|
5968
5969
|
blobsByOwnerRef.current.set(owner, list);
|
|
@@ -5974,7 +5975,7 @@ function RealtimeProvider({
|
|
|
5974
5975
|
}
|
|
5975
5976
|
registeredBlobUrlsRef.current.add(url);
|
|
5976
5977
|
return url;
|
|
5977
|
-
}, [revokeBlobUrl]);
|
|
5978
|
+
}, [revokeBlobUrl, ackUrl]);
|
|
5978
5979
|
const releaseOlderFrames = useCallback10((owner) => {
|
|
5979
5980
|
const list = blobsByOwnerRef.current.get(owner);
|
|
5980
5981
|
const shown = shownBlobByOwnerRef.current.get(owner);
|
|
@@ -11095,6 +11096,15 @@ var HeroProductImage = memo3(function HeroProductImage2({
|
|
|
11095
11096
|
const [firstImageLoaded, setFirstImageLoaded] = useState31(false);
|
|
11096
11097
|
const [loaderMounted, setLoaderMounted] = useState31(true);
|
|
11097
11098
|
const [imgFailed, setImgFailed] = useState31(false);
|
|
11099
|
+
const failedSrc = (() => {
|
|
11100
|
+
if (!imgFailed || !renderedUrl) return void 0;
|
|
11101
|
+
try {
|
|
11102
|
+
const u = new URL(renderedUrl, typeof location !== "undefined" ? location.href : "https://x");
|
|
11103
|
+
return u.protocol === "blob:" ? "blob" : u.host + u.pathname;
|
|
11104
|
+
} catch {
|
|
11105
|
+
return "?";
|
|
11106
|
+
}
|
|
11107
|
+
})();
|
|
11098
11108
|
const [retryNonce, setRetryNonce] = useState31(0);
|
|
11099
11109
|
const retriedUrlRef = useRef23(null);
|
|
11100
11110
|
const prevDisplayUrlRef = useRef23(displayUrl);
|
|
@@ -11185,6 +11195,8 @@ var HeroProductImage = memo3(function HeroProductImage2({
|
|
|
11185
11195
|
style,
|
|
11186
11196
|
"data-hero-image": "true",
|
|
11187
11197
|
"data-fit": fit,
|
|
11198
|
+
"data-picture-failed": imgFailed ? "E_PICTURE_UNDISPLAYED" : void 0,
|
|
11199
|
+
"data-picture-failed-src": failedSrc,
|
|
11188
11200
|
"data-mockup-unavailable": unavailable ? unavailable.code : void 0,
|
|
11189
11201
|
children: [
|
|
11190
11202
|
unavailable && /* @__PURE__ */ jsx61(
|