efficient-storefront-blocks 0.132.1 → 0.132.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.
@@ -4458,7 +4458,8 @@ em.text-accent {
4458
4458
  position: static;
4459
4459
  margin: 0;
4460
4460
  }
4461
- .sf-card-ground-studio [data-part="box"]:has(> * > [data-part="image-block"]) [data-part="image-frame"] > [data-part="image"] {
4461
+ .sf-card-ground-studio [data-part="box"]:has(> * > [data-part="image-block"]) [data-part="image-frame"] > [data-part="image"],
4462
+ .sf-card-ground-studio [data-part="box"]:has(> * > [data-part="image-block"]) [data-part="image-frame"] > * > [data-picture-zoom] {
4462
4463
  position: absolute;
4463
4464
  left: 11.5cqw;
4464
4465
  top: 28.6cqw;
@@ -4630,6 +4631,7 @@ em.text-accent {
4630
4631
  background-image: none;
4631
4632
  }
4632
4633
  .sf-card-ground-studio.sf-card-words-over [data-part="box"]:has(> * > [data-part="box"] > * > [data-part="image-block"]:only-child) > * > [data-part="box"]:has(> * > [data-part="image-block"]:only-child) [data-part="image-frame"] > [data-part="image"],
4634
+ .sf-card-ground-studio.sf-card-words-over [data-part="box"]:has(> * > [data-part="box"] > * > [data-part="image-block"]:only-child) > * > [data-part="box"]:has(> * > [data-part="image-block"]:only-child) [data-part="image-frame"] > * > [data-picture-zoom],
4633
4635
  .sf-card-ground-studio.sf-card-words-over [data-part="box"]:has(> * > [data-part="box"] > * > [data-part="image-block"]:only-child) > * > [data-part="box"]:has(> * > [data-part="image-block"]:only-child) [data-hover-media][data-hover-fit="contain"] > img {
4634
4636
  left: calc(50% - var(--sf-studio-over-wheel) / 2);
4635
4637
  top: calc(100% - var(--sf-studio-over-wheel));
@@ -25,4 +25,5 @@ export declare const PICTURE_FRAMES: readonly ["well", "full"];
25
25
  export type PictureFrame = (typeof PICTURE_FRAMES)[number];
26
26
  export declare const DEFAULT_PICTURE_FRAME: PictureFrame;
27
27
  export declare const WHEEL_ZOOM_CLASS = "transition-transform duration-(--page-motion-hover-duration) ease-(--page-ease-media) motion-safe:group-hover:scale-(--sf-photo-zoom)";
28
+ export declare const PICTURE_ZOOM_WELL_ATTR = "data-picture-zoom";
28
29
  export default function CardProductPicture(settings: CardProductPictureSettings): import("react").JSX.Element | null;
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as i,Fragment as C}from"react/jsx-runtime";import{parseOption as Z}from"efficient-shell/format";import I from"next/image";import{useState as te}from"react";import{HideTaker as A}from"efficient-web-builder/render/components/ViewHideRoot";import{CARD_INDEX_BADGE_CLASS as R,CARD_INDEX_CLASS as $,parseCardIndexFormat as G}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as oe,cardImageBackgroundPaints as X,resolveCardImageBackground as ne}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as E}from"efficient-web-builder/format/lib/content/card-image-shape";import{BOX_SWATCH_PROP as se,boxSwatchFill as ie}from"efficient-web-builder/format/lib/content/box-background";import{useCardRow as ce}from"efficient-web-builder/render/components/CardRowContext";import{pictureShadowFilter as me}from"efficient-easel/screen/lib/document/shadow-values";import{PICTURE_HOVER_KEYS as de,pictureHoverZoomOf as ue}from"efficient-web-builder/format/lib/animation/hover";import{PICTURE_ZOOM_VAR as fe}from"efficient-web-builder/format/lib/content/image-treatment";import{sayCount as he}from"efficient-web-builder/format/lib/editor-words";import{coverSrcForWheel as ge,parseCoverIndex as pe,resolvePaintedSrc as be}from"../../lib/wheels/cover-rendering.js";import we from"../WheelPlaceholder.js";import Se from"../BrandPlate.js";import ve from"../TyreImage.js";import{cardSpinOf as Ce}from"../card-spin.js";import{useCardHoverLayer as ye,useGridCard as B}from"../GridCardTemplate.js";import j from"./CardPicture.js";import T from"./CardProductBadge.js";import{useHeldCardPicture as xe}from"./useHeldCardPicture.js";import{useProductCardState as _e}from"./ProductCardState.js";import{blockParts as ke}from"../../lib/block-parts.js";const o=ke("ProductCard"),Fe=[{label:"Auto",value:"auto"},{label:"Always",value:"always"}],Pe=a=>Z(Fe.map(r=>r.value),"auto",a),Ne=["well","full"],Ae="well",H=a=>Z(Ne,Ae,a);function Ee({children:a}){return e("div",{className:"h-full w-full transition-transform duration-500 motion-safe:group-hover:scale-[1.03]",children:a})}const K="transition-transform duration-(--page-motion-hover-duration) ease-(--page-ease-media) motion-safe:group-hover:scale-(--sf-photo-zoom)";function V({zoom:a,image:r,layer:l,imageClass:n}){return i("div",{className:"contents",style:{[fe]:a},children:[e("div",{className:`${n} ${K}`,children:r}),l?e("div",{className:`pointer-events-none absolute inset-0 z-20 ${K}`,children:l}):null]})}function D({fill:a,badge:r,children:l}){const n=X(a);return i("div",{className:`sf-card-image relative aspect-[4/3] overflow-hidden${n?"":" bg-surface"}`,style:n?{backgroundColor:a}:void 0,...o("image-frame"),children:[l,r]})}function L(a,r){const l=ce();return ie({[se]:a},l?.row)??ne(r,oe)}function ze(a){const r=_e();return r.kind==="bundle"?e(Oe,{state:r,...a}):r.kind==="tyre"?e(Ie,{state:r,...a}):r.kind!=="wheel"?null:e(Re,{state:r,...a})}function Oe({state:a,imageBackground:r,cardImage:l,showBadge:n,frame:w,swatch:h}){const{bundle:t}=a,{imageSizes:g}=B(),c=H(w)==="full",p=t.components.length,b=t.image?c?e(I,{alt:t.name,src:t.image,fill:!0,sizes:g,className:"object-cover",draggable:!1,...o("image")}):e(I,{alt:t.name,src:t.image,width:1e3,height:1e3,sizes:g,className:"block h-full w-full object-cover",draggable:!1,...o("image")}):e("div",{className:"flex h-full w-full items-center justify-center font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.3em] text-fg-dim",children:he("{n} piece","{n} pieces",p,{})}),u=e(Ee,{children:b}),f=L(h,r),m=n!==!1?e(T,{edge:c}):null;return e(A,{style:E(l),...o("image-block"),children:c?e(D,{fill:f,badge:m,children:u}):i(C,{children:[m,e(j,{image:u,imageBackgroundFill:f})]})})}function Ie({state:a,imageBackground:r,cardImage:l,indexBadge:n,frame:w,swatch:h}){const{tyre:t}=a,{imageSizes:g}=B(),c=L(h,r),p=G(n),b=p!=="off"?e("span",{"aria-hidden":!0,"data-format":p,className:`${$} ${R}`,...o("card-number")}):null,u=e(ve,{image:t.image,className:"h-full w-full",sizes:g,showBackground:!1}),f=e(Se,{brand:t.brand,logo:t.brandLogo});return e(A,{style:E(l),...o("image-block"),children:H(w)==="full"?i(D,{fill:c,badge:b,children:[u,f]}):i(C,{children:[b,e(j,{image:u,imageBackgroundFill:c,plate:f})]})})}function Re({state:a,imageBackground:r,cardImage:l,coverIndex:n,indexBadge:w,showBadge:h,setFlags:t,frame:g,swatch:c,shadow:p,shadowColor:b,shadowOn:u,hoverZoom:f}){const{wheel:m,sel:d}=a,{hover:Y,imageSizes:W,fit:q,rules:y}=B(),x=Ce(Y),J=ge(m,pe(n),d.finish?.name,d.shownSrc,q?.holes),[M,Q]=te(()=>new Set),U=s=>{d.pictureFailed(s),Q(v=>v.has(s)?v:new Set(v).add(s))},ee=be({overrideSrc:J,hookSrc:d.shownSrc,failed:M}),z=m.rendersHaveAlpha===!0||Pe(u)==="always"?me(p,b):null,ae=z?{...x.style,filter:z}:x.style,re=(s,v)=>e(I,{alt:v,src:s,width:1e3,height:1e3,sizes:W,className:`block h-full w-full object-contain ${x.className}`,style:ae,draggable:!1,onError:()=>U(s),...o("image")},s),le=d.finish?`${m.name} — ${d.finish.name}`:m.name,_=xe({src:ee,alt:le,sizes:W,failed:M,onFailed:U,near:d.nearScreen,holdEmpty:d.awaitingProbe}),k=i(C,{children:[_.src?re(_.src,_.alt):e(we,{imageLabel:m.name,spin:x}),_.trial]}),O=G(w),F=O!=="off",P=L(c,r),N=ye("picture",X(P)?P:void 0),S=ue({[de.zoom]:f});if(H(g)==="full"){const s=i(C,{children:[F?e("span",{"aria-hidden":!0,"data-format":O,className:`${$} ${R}`,...o("card-number")}):null,e(T,{show:h!==!1,numbered:F,sale:y.sale,axleSets:y.axleSets,setFlags:t!==!1,edge:!0})]});return e(A,{style:E(l),...o("image-block"),children:e(D,{fill:P,badge:s,children:S?e(V,{zoom:S,image:e("div",{className:"flex h-full w-full items-center justify-center",children:k}),layer:N,imageClass:"h-full w-full"}):i(C,{children:[e("div",{className:"flex h-full w-full items-center justify-center",children:k}),N]})})})}return i(A,{style:E(l),...o("image-block"),children:[F?e("span",{"aria-hidden":!0,"data-format":O,className:`${$} ${R}`,...o("card-number")}):null,e(T,{show:h!==!1,numbered:F,sale:y.sale,axleSets:y.axleSets,setFlags:t!==!1}),e(j,{image:S?e(V,{zoom:S,image:k,layer:N,imageClass:"h-full w-full"}):k,imageBackgroundFill:P,plate:S?null:N,shadowed:!!z})]})}export{Ae as DEFAULT_PICTURE_FRAME,Ne as PICTURE_FRAMES,Fe as SHADOW_ON,K as WHEEL_ZOOM_CLASS,ze as default,Pe as shadowOnOf};
1
+ "use client";import{jsx as e,jsxs as i,Fragment as v}from"react/jsx-runtime";import{parseOption as Z}from"efficient-shell/format";import R from"next/image";import{useState as le}from"react";import{HideTaker as E}from"efficient-web-builder/render/components/ViewHideRoot";import{CARD_INDEX_BADGE_CLASS as I,CARD_INDEX_CLASS as T,parseCardIndexFormat as G}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as oe,cardImageBackgroundPaints as X,resolveCardImageBackground as ne}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as N}from"efficient-web-builder/format/lib/content/card-image-shape";import{BOX_SWATCH_PROP as se,boxSwatchFill as ie}from"efficient-web-builder/format/lib/content/box-background";import{useCardRow as ce}from"efficient-web-builder/render/components/CardRowContext";import{pictureShadowFilter as me}from"efficient-easel/screen/lib/document/shadow-values";import{PICTURE_HOVER_KEYS as de,pictureHoverZoomOf as ue}from"efficient-web-builder/format/lib/animation/hover";import{PICTURE_ZOOM_VAR as fe}from"efficient-web-builder/format/lib/content/image-treatment";import{sayCount as he}from"efficient-web-builder/format/lib/editor-words";import{coverSrcForWheel as ge,parseCoverIndex as pe,resolvePaintedSrc as be}from"../../lib/wheels/cover-rendering.js";import we from"../WheelPlaceholder.js";import Se from"../BrandPlate.js";import Ce from"../TyreImage.js";import{cardSpinOf as ve}from"../card-spin.js";import{useCardHoverLayer as _e,useGridCard as $}from"../GridCardTemplate.js";import B from"./CardPicture.js";import j from"./CardProductBadge.js";import{useHeldCardPicture as ye}from"./useHeldCardPicture.js";import{useProductCardState as xe}from"./ProductCardState.js";import{blockParts as Pe}from"../../lib/block-parts.js";const o=Pe("ProductCard"),ke=[{label:"Auto",value:"auto"},{label:"Always",value:"always"}],Fe=a=>Z(ke.map(r=>r.value),"auto",a),Ae=["well","full"],Ee="well",L=a=>Z(Ae,Ee,a);function Ne({children:a}){return e("div",{className:"h-full w-full transition-transform duration-500 motion-safe:group-hover:scale-[1.03]",children:a})}const K="transition-transform duration-(--page-motion-hover-duration) ease-(--page-ease-media) motion-safe:group-hover:scale-(--sf-photo-zoom)",Oe="data-picture-zoom";function V({zoom:a,image:r,layer:t,imageClass:n}){return i("div",{className:"contents",style:{[fe]:a},children:[e("div",{className:`${n} ${K}`,[Oe]:"",children:r}),t?e("div",{className:`pointer-events-none absolute inset-0 z-20 ${K}`,children:t}):null]})}function H({fill:a,badge:r,children:t}){const n=X(a);return i("div",{className:`sf-card-image relative aspect-[4/3] overflow-hidden${n?"":" bg-surface"}`,style:n?{backgroundColor:a}:void 0,...o("image-frame"),children:[t,r]})}function W(a,r){const t=ce();return ie({[se]:a},t?.row)??ne(r,oe)}function ze(a){const r=xe();return r.kind==="bundle"?e(Re,{state:r,...a}):r.kind==="tyre"?e(Ie,{state:r,...a}):r.kind!=="wheel"?null:e(Te,{state:r,...a})}function Re({state:a,imageBackground:r,cardImage:t,showBadge:n,frame:w,swatch:h}){const{bundle:l}=a,{imageSizes:g}=$(),c=L(w)==="full",p=l.components.length,b=l.image?c?e(R,{alt:l.name,src:l.image,fill:!0,sizes:g,className:"object-cover",draggable:!1,...o("image")}):e(R,{alt:l.name,src:l.image,width:1e3,height:1e3,sizes:g,className:"block h-full w-full object-cover",draggable:!1,...o("image")}):e("div",{className:"flex h-full w-full items-center justify-center font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.3em] text-fg-dim",children:he("{n} piece","{n} pieces",p,{})}),u=e(Ne,{children:b}),f=W(h,r),m=n!==!1?e(j,{edge:c}):null;return e(E,{style:N(t),...o("image-block"),children:c?e(H,{fill:f,badge:m,children:u}):i(v,{children:[m,e(B,{image:u,imageBackgroundFill:f})]})})}function Ie({state:a,imageBackground:r,cardImage:t,indexBadge:n,frame:w,swatch:h}){const{tyre:l}=a,{imageSizes:g}=$(),c=W(h,r),p=G(n),b=p!=="off"?e("span",{"aria-hidden":!0,"data-format":p,className:`${T} ${I}`,...o("card-number")}):null,u=e(Ce,{image:l.image,className:"h-full w-full",sizes:g,showBackground:!1}),f=e(Se,{brand:l.brand,logo:l.brandLogo});return e(E,{style:N(t),...o("image-block"),children:L(w)==="full"?i(H,{fill:c,badge:b,children:[u,f]}):i(v,{children:[b,e(B,{image:u,imageBackgroundFill:c,plate:f})]})})}function Te({state:a,imageBackground:r,cardImage:t,coverIndex:n,indexBadge:w,showBadge:h,setFlags:l,frame:g,swatch:c,shadow:p,shadowColor:b,shadowOn:u,hoverZoom:f}){const{wheel:m,sel:d}=a,{hover:Y,imageSizes:D,fit:q,rules:_}=$(),y=ve(Y),J=ge(m,pe(n),d.finish?.name,d.shownSrc,q?.holes),[M,Q]=le(()=>new Set),U=s=>{d.pictureFailed(s),Q(C=>C.has(s)?C:new Set(C).add(s))},ee=be({overrideSrc:J,hookSrc:d.shownSrc,failed:M}),O=m.rendersHaveAlpha===!0||Fe(u)==="always"?me(p,b):null,ae=O?{...y.style,filter:O}:y.style,re=(s,C)=>e(R,{alt:C,src:s,width:1e3,height:1e3,sizes:D,className:`block h-full w-full object-contain ${y.className}`,style:ae,draggable:!1,onError:()=>U(s),...o("image")},s),te=d.finish?`${m.name} — ${d.finish.name}`:m.name,x=ye({src:ee,alt:te,sizes:D,failed:M,onFailed:U,near:d.nearScreen,holdEmpty:d.awaitingProbe}),P=i(v,{children:[x.src?re(x.src,x.alt):e(we,{imageLabel:m.name,spin:y}),x.trial]}),z=G(w),k=z!=="off",F=W(c,r),A=_e("picture",X(F)?F:void 0),S=ue({[de.zoom]:f});if(L(g)==="full"){const s=i(v,{children:[k?e("span",{"aria-hidden":!0,"data-format":z,className:`${T} ${I}`,...o("card-number")}):null,e(j,{show:h!==!1,numbered:k,sale:_.sale,axleSets:_.axleSets,setFlags:l!==!1,edge:!0})]});return e(E,{style:N(t),...o("image-block"),children:e(H,{fill:F,badge:s,children:S?e(V,{zoom:S,image:e("div",{className:"flex h-full w-full items-center justify-center",children:P}),layer:A,imageClass:"h-full w-full"}):i(v,{children:[e("div",{className:"flex h-full w-full items-center justify-center",children:P}),A]})})})}return i(E,{style:N(t),...o("image-block"),children:[k?e("span",{"aria-hidden":!0,"data-format":z,className:`${T} ${I}`,...o("card-number")}):null,e(j,{show:h!==!1,numbered:k,sale:_.sale,axleSets:_.axleSets,setFlags:l!==!1}),e(B,{image:S?e(V,{zoom:S,image:P,layer:A,imageClass:"h-full w-full"}):P,imageBackgroundFill:F,plate:S?null:A,shadowed:!!O})]})}export{Ee as DEFAULT_PICTURE_FRAME,Ae as PICTURE_FRAMES,Oe as PICTURE_ZOOM_WELL_ATTR,ke as SHADOW_ON,K as WHEEL_ZOOM_CLASS,ze as default,Fe as shadowOnOf};