@snowcone-app/ui 0.10.5 → 0.10.7
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 +12 -0
- package/dist/index.cjs +14 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +14 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/composed/HeroProductImage.tsx +11 -2
- package/src/composed/__tests__/HeroProductImage.fit.test.tsx +30 -0
- package/src/composed/carousels/MobileProductCarousel.tsx +4 -0
- package/src/composed/zoom/EnhancedImageViewer.tsx +2 -1
- package/src/composed/zoom/types.ts +2 -0
- package/src/patterns/RealtimeProvider.tsx +7 -0
- package/src/patterns/__tests__/RealtimeProvider.shapeCrop.test.tsx +94 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.10.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#4552](https://github.com/snowcone-app/snowcone-monorepo/pull/4552) [`d38922a`](https://github.com/snowcone-app/snowcone-monorepo/commit/d38922a33990995da2794b6c8beb189072cdff75) Thanks [@kevinsproles](https://github.com/kevinsproles)! - The gallery's size picture opens whole on a phone. `HeroProductImage` gains `fit: "cover" | "whole"` (default `cover`, unchanged for every hero today), stamped as `data-fit`. The phone carousel passes `whole` for a `galleryRole: "size-picture"` slide, and so does the zoom viewer when it is opened on that slide (`ZoomImage.fit`). A size picture is a diagram with a caption, not a hero: it is never cropped to the slide's centre.
|
|
8
|
+
|
|
9
|
+
## 0.10.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#4553](https://github.com/snowcone-app/snowcone-monorepo/pull/4553) [`f143972`](https://github.com/snowcone-app/snowcone-monorepo/commit/f143972795596b86d69e5130ecd88454a82d54b2) Thanks [@kevinsproles](https://github.com/kevinsproles)! - Phone editor: a session-shape change that adds pictures without a frozen cropped-delivery background (the catch-up after an edit, a swipe) sends that config full-frame. Cropped delivery re-arms once every picture has a background. Asking for cropped frames there sent each new picture a frame it couldn't composite: an `E_OVERLAY_NO_BACKGROUND` fallback storm, with the visible pictures' frame acks stalled behind it.
|
|
14
|
+
|
|
3
15
|
## 0.10.5
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -6500,6 +6500,9 @@ function RealtimeProvider({
|
|
|
6500
6500
|
return;
|
|
6501
6501
|
}
|
|
6502
6502
|
if (lastShapeRef.current && lastShapeRef.current.width !== shape.width) invalidateBackgrounds();
|
|
6503
|
+
if (croppedActiveRef.current && shape.mockupIds.some((id) => !backgroundsRef.current.has(id))) {
|
|
6504
|
+
croppedActiveRef.current = false;
|
|
6505
|
+
}
|
|
6503
6506
|
lastShapeRef.current = shape;
|
|
6504
6507
|
base.mockupIds = shape.mockupIds;
|
|
6505
6508
|
base.width = shape.width;
|
|
@@ -10892,7 +10895,8 @@ var HeroProductImage = (0, import_react46.memo)(function HeroProductImage2({
|
|
|
10892
10895
|
emptyText = "No artwork",
|
|
10893
10896
|
errorText = "Error loading",
|
|
10894
10897
|
unavailableText = "Preview unavailable",
|
|
10895
|
-
viewportPolicy = false
|
|
10898
|
+
viewportPolicy = false,
|
|
10899
|
+
fit = "cover"
|
|
10896
10900
|
}) {
|
|
10897
10901
|
const context = useProductOptional();
|
|
10898
10902
|
const designContext = useDesignOptional();
|
|
@@ -11498,6 +11502,7 @@ var HeroProductImage = (0, import_react46.memo)(function HeroProductImage2({
|
|
|
11498
11502
|
className: `relative overflow-hidden ${className || ""}`,
|
|
11499
11503
|
style,
|
|
11500
11504
|
"data-hero-image": "true",
|
|
11505
|
+
"data-fit": fit,
|
|
11501
11506
|
"data-mockup-unavailable": unavailable ? unavailable.code : void 0,
|
|
11502
11507
|
children: [
|
|
11503
11508
|
unavailable && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
@@ -11514,7 +11519,7 @@ var HeroProductImage = (0, import_react46.memo)(function HeroProductImage2({
|
|
|
11514
11519
|
{
|
|
11515
11520
|
alt: `Product mockup${placement ? ` - ${placement}` : ""}`,
|
|
11516
11521
|
crossOrigin: "anonymous",
|
|
11517
|
-
className:
|
|
11522
|
+
className: `absolute inset-0 w-full h-full ${fit === "whole" ? "object-contain" : "object-cover"}`,
|
|
11518
11523
|
draggable,
|
|
11519
11524
|
src: renderedUrl,
|
|
11520
11525
|
loading: "eager",
|
|
@@ -11572,7 +11577,7 @@ var HeroProductImage = (0, import_react46.memo)(function HeroProductImage2({
|
|
|
11572
11577
|
{
|
|
11573
11578
|
alt: "",
|
|
11574
11579
|
crossOrigin: "anonymous",
|
|
11575
|
-
className:
|
|
11580
|
+
className: `absolute inset-0 w-full h-full ${fit === "whole" ? "object-contain" : "object-cover"}`,
|
|
11576
11581
|
src: prevUrl,
|
|
11577
11582
|
style: {
|
|
11578
11583
|
opacity: showNew ? 0 : 1,
|
|
@@ -12770,8 +12775,8 @@ var EnhancedImageViewer = ({
|
|
|
12770
12775
|
style: {
|
|
12771
12776
|
width: "100%",
|
|
12772
12777
|
height: "100%",
|
|
12773
|
-
|
|
12774
|
-
|
|
12778
|
+
// Crop 16:9 to fill the screen (a hero), or the whole picture for a size picture (a diagram).
|
|
12779
|
+
objectFit: images[propCurrentIndex ?? -1]?.fit === "whole" ? "contain" : "cover"
|
|
12775
12780
|
}
|
|
12776
12781
|
},
|
|
12777
12782
|
`${imageUrl}-${propCurrentIndex}`
|
|
@@ -13608,7 +13613,8 @@ var MobileProductCarousel = (0, import_react56.memo)(function MobileProductCarou
|
|
|
13608
13613
|
errorText,
|
|
13609
13614
|
unavailableText,
|
|
13610
13615
|
className: "w-full h-full object-cover cursor-pointer pointer-events-none",
|
|
13611
|
-
viewportPolicy: true
|
|
13616
|
+
viewportPolicy: true,
|
|
13617
|
+
fit: image.galleryRole === "size-picture" ? "whole" : "cover"
|
|
13612
13618
|
}
|
|
13613
13619
|
) : image.isRealMockup && !currentArtwork ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(LoadingOverlayPrismCandyInline, { visible: true, variant: "light" }) : /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
13614
13620
|
StaticCarouselImage,
|
|
@@ -13692,7 +13698,8 @@ var MobileProductCarousel = (0, import_react56.memo)(function MobileProductCarou
|
|
|
13692
13698
|
src,
|
|
13693
13699
|
alt: img.label,
|
|
13694
13700
|
naturalWidth: img.naturalWidth,
|
|
13695
|
-
naturalHeight: img.naturalHeight
|
|
13701
|
+
naturalHeight: img.naturalHeight,
|
|
13702
|
+
...img.galleryRole === "size-picture" ? { fit: "whole" } : {}
|
|
13696
13703
|
} : null;
|
|
13697
13704
|
}).filter((img) => img !== null);
|
|
13698
13705
|
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|