efficient-storefront-blocks 0.125.19 → 0.125.20
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.js +25 -25
- package/dist/render/app/globals.css +0 -16
- package/dist/render/components/GridCardTemplate.d.ts +0 -2
- package/dist/render/components/GridCardTemplate.js +1 -1
- package/dist/render/components/card-pieces/CardProductPicture.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/package.json +1 -1
|
@@ -4480,19 +4480,3 @@ em.text-accent {
|
|
|
4480
4480
|
.sf-card-tracks:has(> :nth-child(12)):not(:has(> :nth-child(13))) {
|
|
4481
4481
|
--sf-card-skip: calc(100% / 5 + 1px - clamp(0px, (100% - (min(6, var(--sf-cols)) * var(--sf-card-min) * 1px + (min(6, var(--sf-cols)) - 1) * var(--sf-card-gap))) * 1000, 100000px) - clamp(0px, (5 + 1 - var(--sf-cols)) * 100000px, 100000px));
|
|
4482
4482
|
}
|
|
4483
|
-
|
|
4484
|
-
/* CARD HOVER ZOOM (2026-11-24, owner review of the new inovit.com home). A
|
|
4485
|
-
section at Show next image whose card has no next picture zooms the wheel a
|
|
4486
|
-
little instead (components/GridCardTemplate `useCardHoverZooms`). `scale`,
|
|
4487
|
-
not `transform`: no layout move, and the card's own lift (`transform` on
|
|
4488
|
-
.sf-card) is left alone. Only on a pointer that hovers; reduced motion
|
|
4489
|
-
keeps the wheel still. scripts/test-card-hover-next-rendering.tsx. */
|
|
4490
|
-
.sf-card-hover-zoom img {
|
|
4491
|
-
transition: scale calc(var(--motion-base) * 2) ease; /* 320 ms: about 300, from the shell token */
|
|
4492
|
-
}
|
|
4493
|
-
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
|
|
4494
|
-
.sf-card:hover .sf-card-hover-zoom img,
|
|
4495
|
-
.sf-card:focus-within .sf-card-hover-zoom img {
|
|
4496
|
-
scale: 1.04;
|
|
4497
|
-
}
|
|
4498
|
-
}
|
|
@@ -80,8 +80,6 @@ export declare const bundlePagePath: (bundle: Bundle) => string;
|
|
|
80
80
|
export declare function bundleCardRow(bundle: Bundle): SourceRow;
|
|
81
81
|
export declare function useCardHoverLayer(cover: HoverMediaCover, ground?: string): ReactNode;
|
|
82
82
|
export declare function cardHoverRow(wheel: WheelSummary, finish: string | undefined): HoverMediaRow;
|
|
83
|
-
export declare const CARD_HOVER_ZOOM_CLASS = "sf-card-hover-zoom";
|
|
84
|
-
export declare function useCardHoverZooms(): boolean;
|
|
85
83
|
export declare function GridCards({ wheels, finishes, children, }: {
|
|
86
84
|
wheels: readonly WheelSummary[];
|
|
87
85
|
finishes?: readonly (string | undefined)[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,Fragment as x,jsxs as
|
|
1
|
+
"use client";import{jsx as t,Fragment as x,jsxs as A}from"react/jsx-runtime";import{createContext as D,useContext as E,useMemo as y}from"react";import{parseOption as h}from"efficient-shell/format";import{CardRowContext as G,CardTemplateRows as p,useCardRow as k}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as L}from"efficient-web-builder/render/components/SiteGutterFrame";import{SECTION_FILL_PASS_CLASS as F}from"efficient-web-builder/format/lib/content/section-min-height";import{cardHoverOf as N}from"efficient-web-builder/format/lib/animation/hover";import{pickHoverMedia as U}from"efficient-web-builder/format/lib/content/hover-media";import W from"efficient-web-builder/render/components/HoverMediaLayer";import{NO_FIELD_ANSWERS as v}from"../lib/content/field-usage.js";import{CARD_IMAGE_SIZES as j}from"../lib/sections/card-image-sizes.js";import{productTone as $,productToneVaried as H,randomCardColour as b}from"../lib/sections/card-tone.js";import{CardLookContext as C}from"./card-pieces/card-row.js";import{CardBuyDialog as B}from"./card-pieces/CardBuyButton.js";import M from"./card-pieces/CardSurfaceFrame.js";import{BundleCardStateProvider as V,TyreCardStateProvider as z,useProductCardState as R,useWheelCardState as _,WheelCardStateProvider as q,tyreCardProduct as Y}from"./card-pieces/ProductCardState.js";import{tyrePagePath as K}from"../lib/tyres/tyre-page-path.js";import{say as X}from"efficient-web-builder/format/lib/editor-words";import{CARD_INDEX_OPTIONS as J,cardIndexCss as Q}from"efficient-web-builder/format/lib/sections/product-card-style";import{SHARED_ROWS_LIST_CLASS as Z}from"efficient-web-builder/render/lib/content/box-shared-columns";import{GAP_ZONE_CLASS as ee}from"efficient-web-builder/format/lib/content/container-gap";import{CARD_ROWS_GRID_CLASS as re,cardRowsGap as oe,cardRowsGridStyle as te}from"./WheelCardFrame.js";import{blockParts as ne}from"../lib/block-parts.js";const ae=ne("ProductCard");function Je(e){return J.map(({value:r})=>r==="off"?"":Q(e,r).replace(".sf-card-index::before",`.sf-card-index[data-format="${r}"]::before`)).join("")}function Qe(e){return e.className.includes(ee)?{className:`${e.className} ${re} ${Z}`,style:{...e.style,...te(oe(e))}}:e}const se={sale:!1,axleSets:!0,setTotal:!1,wasFollowsSize:!1,quoteSets:!0,showSingle:!1,armOnContact:!1},Ze={sale:!0,axleSets:!1,setTotal:!0,wasFollowsSize:!0,quoteSets:!1,showSingle:!0,armOnContact:!0},de={kindLabel:null,brand:!1,process:!0,tyreBrand:!0},ie=[],le=[{label:"Flat",value:"flat"},{label:"Soft grey",value:"soft"}],er=e=>h(le.map(r=>r.value),"flat",e),ce=[{label:"Under the picture",value:"under"},{label:"Over the picture",value:"over"}],rr=e=>h(ce.map(r=>r.value),"under",e),ue="sf-card-words-over",T={ownerId:"",ownerType:"ProductGrid",Template:void 0,hover:N({},"ProductGrid"),imageSizes:j,fieldUsage:v,tyreFieldUsage:v,reserveEyebrow:!1,editing:!1,eyebrow:de,fit:null,colours:ie,rules:se,ground:"flat",words:"under"},O=D(T);function m(){return E(O)}function or({value:e,children:r}){const o=y(()=>({...T,...me(e)}),[e]);return t(O.Provider,{value:o,children:r})}const me=e=>Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0));function w(e,r){const o=e.designCode??e.slug??"";return{name:e.name??"",eyebrow:e.process??"",note:"",href:e.slug?`/wheels/${e.slug}`:"",colour:$(r),colourVaried:H(r,o),colourRandom:b(o)}}function fe(e){const r=e.designCode||e.slug||"";return{name:e.name??"",eyebrow:e.brand??"",note:"",href:K(e.slug)??"",colour:"",colourVaried:"",colourRandom:b(r)}}const I=e=>`/bundles/${e.slug}`;function pe(e){return{name:e.name,eyebrow:"",note:e.subtitle??"",href:I(e),colour:"",colourVaried:"",colourRandom:""}}const Ce="sf-card sf-card-fill group relative flex flex-col bg-[var(--card-bg)] transition-colors duration-200 hover:bg-[var(--card-bg-hover)] [.sf-card-rows>&]:mb-[var(--sf-card-row-gap)]",we="sf-card group relative flex flex-col border border-line bg-bg transition-colors hover:border-accent",ge="col-span-2 max-view-wide:col-span-1 @max-[720px]:col-span-1 [&:has([data-set-picture=one])]:col-span-1",Se=`relative flex-1 ${F}`;function g({copy:e,href:r,label:o,wide:n=!1,kit:a=!1,probes:s,arm:f,layer:c}){const{editing:i,ground:d,words:u}=m(),l=[d==="soft"?"sf-card-ground-soft":"",u==="over"?ue:""].filter(Boolean);return t(M,{surface:a?we:[Ce,...l].join(" "),span:n?ge:void 0,href:r,label:o,linked:!i,probes:s,arm:f,layer:c,children:t("div",{className:Se,...ae("card-content"),children:t(L,{children:e})})})}const xe="var(--card-bg)";function ye(e,r=xe){const o=he();return!o||o.cover!==e||!o.media?null:t(W,{media:o.media,name:o.name,cover:e,ground:r})}function he(){const{hover:e}=m(),r=R();if(e.kind!=="nextImage"||!e.media||r.kind!=="wheel")return null;const o=r.sel.finish?.name,n=ve(r.wheel,o);return{cover:e.media.cover,name:r.wheel.name,media:U(n,e.media,o)}}function ve(e,r){const o=e.finishes?.find(a=>a.name===r),n=o?.angles?.length?o.angles:r&&r===e.defaultFinish?e.defaultFinishRenderings??[]:[];return{...e,finishes:r?[{name:r,angles:n.slice(1)}]:[]}}function be({children:e}){const r=k(),{wheel:o,sel:n}=_(),a=n.finish?.color,s=y(()=>r?{...r,row:w(o,a)}:null,[r,o,a]);return s?t(G.Provider,{value:s,children:e}):t(x,{children:e})}function Re({copy:e}){const{wheel:r,sel:o,isSet:n}=_(),{rules:a}=m(),s=ye("card");return A(x,{children:[t(g,{copy:t(be,{children:e}),href:r.slug?`/wheels/${r.slug}`:"",label:r.name,wide:n,probes:o.probes,arm:a.armOnContact?o.arm:void 0,layer:s}),t(B,{})]})}function P(e,r,o,n){const a=r.item;return t(q,{wheel:a,colours:o.colours,defaultFinish:n?.[r.index],editing:o.editing,children:t(C.Provider,{value:"catalog",children:t(Re,{copy:e})})})}function tr({wheels:e,finishes:r,children:o}){const n=m(),{ownerId:a,ownerType:s,Template:f,editing:c}=n;return t(p,{ownerId:a,ownerType:s,Template:f,rows:e.map(i=>w(i)),items:e,fallback:c?t(S,{}):null,wrapCopy:(i,d)=>P(i,d,n,r),children:o})}function nr({items:e,tyreOf:r,tyreFit:o}){const n=m(),{ownerId:a,ownerType:s,Template:f,editing:c}=n,i=e.map(d=>r(d));return t(p,{ownerId:a,ownerType:s,Template:f,rows:e.map((d,u)=>{const l=i[u];return l?fe(l):w(d)}),items:e,fallback:c?t(S,{}):null,wrapCopy:(d,u)=>{const l=i[u.index];return l?Te(d,Y(l,o?.(l)??null),c):P(d,u,n)},children:d=>d})}function _e({copy:e}){const r=R();if(r.kind!=="tyre")throw new Error("A tyre card surface was drawn outside its tyre state.");return t(g,{copy:e,href:r.pagePath??"",label:r.tyre.name,arm:r.arm})}function Te(e,r,o){return t(z,{tyre:r,editing:o,children:t(C.Provider,{value:"catalog",children:t(_e,{copy:e})})})}function Oe(e,r){const o=r.item;return t(V,{bundle:o,children:t(C.Provider,{value:"catalog",children:t(g,{copy:e,href:I(o),label:o.name,kit:!0})})})}function ar({bundles:e,children:r}){const{ownerId:o,ownerType:n,Template:a,editing:s}=m();return t(p,{ownerId:o,ownerType:n,Template:a,rows:e.map(pe),items:e,fallback:s?t(S,{}):null,wrapCopy:Oe,children:r})}function S(){return t("div",{"data-grid-card-empty":"",className:"p-4 text-center font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.2em] text-fg-dim",children:X("The card is empty. Add parts to its card template in Layers.")})}export{le as CARD_GROUNDS,ce as CARD_WORDS,ue as CARD_WORDS_OVER_CLASS,se as GRID_CARD_RULES,ar as GridBundleCards,or as GridCardProvider,tr as GridCards,nr as GridMixedCards,Ze as LISTING_CARD_RULES,pe as bundleCardRow,I as bundlePagePath,er as cardGroundOf,ve as cardHoverRow,Qe as cardRowsGrid,rr as cardWordsOf,Je as gridIndexCss,w as productCardRow,fe as tyreCardRow,ye as useCardHoverLayer,m as useGridCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as d,Fragment as v}from"react/jsx-runtime";import{parseOption as
|
|
1
|
+
"use client";import{jsx as e,jsxs as d,Fragment as v}from"react/jsx-runtime";import{parseOption as Z}from"efficient-shell/format";import I from"next/image";import{useState as ne}from"react";import{HideTaker as _}from"efficient-web-builder/render/components/ViewHideRoot";import{CARD_INDEX_BADGE_CLASS as z,CARD_INDEX_CLASS as O,parseCardIndexFormat as q}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as oe,cardImageBackgroundPaints as J,resolveCardImageBackground as se}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as A}from"efficient-web-builder/format/lib/content/card-image-shape";import{BOX_SWATCH_PROP as ie,boxSwatchFill as ce}from"efficient-web-builder/format/lib/content/box-background";import{useCardRow as de}from"efficient-web-builder/render/components/CardRowContext";import{pictureShadowFilter as me}from"efficient-easel/screen/lib/document/shadow-values";import{sayCount as ue}from"efficient-web-builder/format/lib/editor-words";import{parseSetPicture as fe,setSecondSrc as ge}from"../../lib/wheels/set-mode.js";import{coverSrcForWheel as pe,parseCoverIndex as he,resolvePaintedSrc as be}from"../../lib/wheels/cover-rendering.js";import Se from"../WheelPlaceholder.js";import we from"../BrandPlate.js";import ke from"../TyreImage.js";import{cardSpinOf as ye}from"../card-spin.js";import{useCardHoverLayer as Ce,useGridCard as j}from"../GridCardTemplate.js";import R from"./CardPicture.js";import D from"./CardProductBadge.js";import{useHeldCardPicture as Fe}from"./useHeldCardPicture.js";import{useProductCardState as xe}from"./ProductCardState.js";import{blockParts as Pe}from"../../lib/block-parts.js";const n=Pe("ProductCard"),ve=[{label:"Auto",value:"auto"},{label:"Always",value:"always"}],_e=a=>Z(ve.map(r=>r.value),"auto",a),Ae=["well","full"],Ne="well",G=a=>Z(Ae,Ne,a);function Be({children:a}){return e("div",{className:"h-full w-full transition-transform duration-500 motion-safe:group-hover:scale-[1.03]",children:a})}function T({fill:a,badge:r,children:o}){const m=J(a);return d("div",{className:`sf-card-image relative aspect-[4/3] overflow-hidden${m?"":" bg-surface"}`,style:m?{backgroundColor:a}:void 0,...n("image-frame"),children:[o,r]})}function H(a,r){const o=de();return ce({[ie]:a},o?.row)??se(r,oe)}function $e(a){const r=xe();return r.kind==="bundle"?e(Ee,{state:r,...a}):r.kind==="tyre"?e(Ie,{state:r,...a}):r.kind!=="wheel"?null:e(ze,{state:r,...a})}function Ee({state:a,imageBackground:r,cardImage:o,showBadge:m,frame:w,swatch:p}){const{bundle:t}=a,{imageSizes:h}=j(),u=G(w)==="full",b=t.components.length,S=t.image?u?e(I,{alt:t.name,src:t.image,fill:!0,sizes:h,className:"object-cover",draggable:!1,...n("image")}):e(I,{alt:t.name,src:t.image,width:1e3,height:1e3,sizes:h,className:"block h-full w-full object-cover",draggable:!1,...n("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:ue("{n} piece","{n} pieces",b,{})}),f=e(Be,{children:S}),g=H(p,r),i=m!==!1?e(D,{edge:u}):null;return e(_,{style:A(o),...n("image-block"),children:u?e(T,{fill:g,badge:i,children:f}):d(v,{children:[i,e(R,{image:f,imageBackgroundFill:g})]})})}function Ie({state:a,imageBackground:r,cardImage:o,indexBadge:m,frame:w,swatch:p}){const{tyre:t}=a,{imageSizes:h}=j(),u=H(p,r),b=q(m),S=b!=="off"?e("span",{"aria-hidden":!0,"data-format":b,className:`${O} ${z}`,...n("card-number")}):null,f=e(ke,{image:t.image,className:"h-full w-full",sizes:h,showBackground:!1}),g=e(we,{brand:t.brand,logo:t.brandLogo});return e(_,{style:A(o),...n("image-block"),children:G(w)==="full"?d(T,{fill:u,badge:S,children:[f,g]}):d(v,{children:[S,e(R,{image:f,imageBackgroundFill:u,plate:g})]})})}function ze({state:a,imageBackground:r,cardImage:o,coverIndex:m,indexBadge:w,showBadge:p,setFlags:t,frame:h,setPicture:u,swatch:b,shadow:S,shadowColor:f,shadowOn:g}){const{wheel:i,sel:c,isSet:N}=a,{hover:Q,imageSizes:L,fit:V,rules:y,setGridGap:Y}=j(),C=ye(Q),ee=pe(i,he(m),c.finish?.name,c.shownSrc,V?.holes),[W,ae]=ne(()=>new Set),M=l=>{c.pictureFailed(l),ae(k=>k.has(l)?k:new Set(k).add(l))},U=be({overrideSrc:ee,hookSrc:c.shownSrc,failed:W}),B=i.rendersHaveAlpha===!0||_e(g)==="always"?me(S,f):null,re=B?{...C.style,filter:B}:C.style,$=(l,k)=>e(I,{alt:k,src:l,width:1e3,height:1e3,sizes:L,className:`block h-full w-full object-contain ${C.className}`,style:re,draggable:!1,onError:()=>M(l),...n("image")},l),te=c.finish?`${i.name} — ${c.finish.name}`:i.name,F=N&&fe(u)==="pair",le=F?ge(i.finishes?.find(l=>l.name===c.finish?.name),U):null,s=Fe({src:U,second:le,alt:te,sizes:L,failed:W,onFailed:M,near:c.nearScreen,holdEmpty:c.awaitingProbe}),X=d(v,{children:[s.src?$(s.src,s.alt):e(Se,{imageLabel:i.name,spin:C}),s.trial]}),E=q(w),x=E!=="off",P=H(b,r),K=Ce("picture",J(P)?P:void 0);if(G(h)==="full"){const l=d(v,{children:[x?e("span",{"aria-hidden":!0,"data-format":E,className:`${O} ${z}`,...n("card-number")}):null,e(D,{show:p!==!1,numbered:x,sale:y.sale,axleSets:y.axleSets,setFlags:t!==!1,edge:!0})]});return e(_,{style:A(o),"data-set-picture":N&&!F?"one":void 0,...n("image-block"),children:d(T,{fill:P,badge:l,children:[d("div",{className:"flex h-full w-full items-center justify-center",children:[X,s.second?$(s.second,`${s.alt} — right`):null]}),K]})})}return d(_,{style:A(o),"data-set-picture":N&&!F?"one":void 0,...n("image-block"),children:[x?e("span",{"aria-hidden":!0,"data-format":E,className:`${O} ${z}`,...n("card-number")}):null,e(D,{show:p!==!1,numbered:x,sale:y.sale,axleSets:y.axleSets,setFlags:t!==!1}),e(R,{image:X,imageSecond:s.second?$(s.second,`${s.alt} — right`):void 0,wide:F,imageBackgroundFill:P,setGridGap:Y,plate:K,shadowed:!!B})]})}export{Ne as DEFAULT_PICTURE_FRAME,Ae as PICTURE_FRAMES,ve as SHADOW_ON,$e as default,_e as shadowOnOf};
|