@snowcone-app/ui 0.10.21 → 0.10.22
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 +9 -0
- package/dist/index.cjs +13 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -6
- package/dist/index.d.ts +13 -6
- package/dist/index.js +13 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/composed/HeroProductImage.tsx +32 -21
- package/src/composed/__tests__/HeroProductImage.strip.test.tsx +14 -6
- package/src/composed/carousels/types.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.10.22
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#5689](https://github.com/snowcone-app/snowcone-monorepo/pull/5689) [`0e8fe65`](https://github.com/snowcone-app/snowcone-monorepo/commit/0e8fe65bbdda5a894924cff83da29eceb45b55ba) Thanks [@kevinsproles](https://github.com/kevinsproles)! - A strip crop takes a width as a downscale (rendercenter rc#899: the box delivers min(width, the crop's own px), never enlarging), and the whole strip is a view (`2.7@0.25`, rc#900). UI: `HeroProductImage` `stripView` takes `{ view, width }` (stamped `data-strip-width`); its `"whole-strip"` intent is gone (ask `MOCKUP_VIEW_WHOLE_STRIP`). SDK: the catalog type's `mockups[].strip` carries `heightPx` (the strip's height in the stored picture's px: 1440, or 2160 on a 5760 plate), so a page caps its width by the real crop.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`0e8fe65`](https://github.com/snowcone-app/snowcone-monorepo/commit/0e8fe65bbdda5a894924cff83da29eceb45b55ba)]:
|
|
10
|
+
- @snowcone-app/sdk@0.31.6
|
|
11
|
+
|
|
3
12
|
## 0.10.21
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -10910,7 +10910,7 @@ function buildHeroMockupUrl(args) {
|
|
|
10910
10910
|
return (0, import_sdk11.getMockupUrl)(args.productCode, {
|
|
10911
10911
|
shop: snow.shop,
|
|
10912
10912
|
design: publicDesign,
|
|
10913
|
-
..."stripView" in args.size ? { aspect: "8:3", stripView: args.size.stripView
|
|
10913
|
+
..."stripView" in args.size ? { aspect: "8:3", stripView: args.size.stripView, ...args.size.width !== void 0 ? { width: args.size.width } : {} } : { width: args.size.width },
|
|
10914
10914
|
view: args.mockupId,
|
|
10915
10915
|
variant: args.variantId,
|
|
10916
10916
|
...args.bg ? { bg: args.bg } : {},
|
|
@@ -10918,11 +10918,11 @@ function buildHeroMockupUrl(args) {
|
|
|
10918
10918
|
});
|
|
10919
10919
|
}
|
|
10920
10920
|
function isCrop(stripView) {
|
|
10921
|
-
return stripView !== void 0
|
|
10921
|
+
return stripView !== void 0;
|
|
10922
10922
|
}
|
|
10923
|
-
function heroSize(stripView, width) {
|
|
10924
|
-
if (isCrop(stripView)) return { stripView };
|
|
10925
|
-
return
|
|
10923
|
+
function heroSize(stripView, cropWidth, width) {
|
|
10924
|
+
if (isCrop(stripView)) return cropWidth !== void 0 ? { stripView, width: cropWidth } : { stripView };
|
|
10925
|
+
return { width };
|
|
10926
10926
|
}
|
|
10927
10927
|
var EMPTY_IMAGES = [];
|
|
10928
10928
|
var HeroProductImage = (0, import_react46.memo)(function HeroProductImage2({
|
|
@@ -10957,9 +10957,11 @@ var HeroProductImage = (0, import_react46.memo)(function HeroProductImage2({
|
|
|
10957
10957
|
unavailableText = "Preview unavailable",
|
|
10958
10958
|
viewportPolicy = false,
|
|
10959
10959
|
fit = "cover",
|
|
10960
|
-
stripView,
|
|
10960
|
+
stripView: stripViewProp,
|
|
10961
10961
|
onShown
|
|
10962
10962
|
}) {
|
|
10963
|
+
const stripView = typeof stripViewProp === "object" ? stripViewProp.view : stripViewProp;
|
|
10964
|
+
const cropWidth = typeof stripViewProp === "object" ? stripViewProp.width : void 0;
|
|
10963
10965
|
const context = useProductOptional();
|
|
10964
10966
|
const designContext = useDesignOptional();
|
|
10965
10967
|
const shopContext = useShopOptional();
|
|
@@ -11020,11 +11022,12 @@ var HeroProductImage = (0, import_react46.memo)(function HeroProductImage2({
|
|
|
11020
11022
|
placements: allPlacements,
|
|
11021
11023
|
mockupId: actualMockupId,
|
|
11022
11024
|
variantId: actualGvid,
|
|
11023
|
-
size: heroSize(stripView, width),
|
|
11025
|
+
size: heroSize(stripView, cropWidth, width),
|
|
11024
11026
|
bg: mockupBg
|
|
11025
11027
|
});
|
|
11026
11028
|
}, [
|
|
11027
11029
|
stripView,
|
|
11030
|
+
cropWidth,
|
|
11028
11031
|
realtimeUrl,
|
|
11029
11032
|
mode,
|
|
11030
11033
|
context?.loading,
|
|
@@ -11399,7 +11402,7 @@ var HeroProductImage = (0, import_react46.memo)(function HeroProductImage2({
|
|
|
11399
11402
|
placements: allPlacements,
|
|
11400
11403
|
mockupId: actualMockupId,
|
|
11401
11404
|
variantId: actualGvid,
|
|
11402
|
-
size: heroSize(stripView, width),
|
|
11405
|
+
size: heroSize(stripView, cropWidth, width),
|
|
11403
11406
|
bg: mockupBg
|
|
11404
11407
|
});
|
|
11405
11408
|
if (!url) return;
|
|
@@ -11445,6 +11448,7 @@ var HeroProductImage = (0, import_react46.memo)(function HeroProductImage2({
|
|
|
11445
11448
|
images,
|
|
11446
11449
|
width,
|
|
11447
11450
|
stripView,
|
|
11451
|
+
cropWidth,
|
|
11448
11452
|
effects,
|
|
11449
11453
|
// Use primitive values extracted at the top of the component
|
|
11450
11454
|
artworkSrc,
|
|
@@ -11580,6 +11584,7 @@ var HeroProductImage = (0, import_react46.memo)(function HeroProductImage2({
|
|
|
11580
11584
|
"data-mockup-id": actualMockupId || void 0,
|
|
11581
11585
|
"data-fit": fit,
|
|
11582
11586
|
"data-strip-view": stripView,
|
|
11587
|
+
"data-strip-width": cropWidth,
|
|
11583
11588
|
"data-picture-failed": imgFailed ? "E_PICTURE_UNDISPLAYED" : void 0,
|
|
11584
11589
|
"data-picture-failed-src": failedSrc,
|
|
11585
11590
|
"data-mockup-unavailable": unavailable ? unavailable.code : void 0,
|