efficient-storefront-blocks 0.93.0 → 0.94.0

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.
Files changed (65) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/chunks/{EditorPreviewCheckout-FSEFJZSO.js → EditorPreviewCheckout-OPDSFBJH.js} +1 -1
  3. package/dist/chunks/{SiteEditorProvider-N76XROIW.js → SiteEditorProvider-ZP6NAWYT.js} +1 -1
  4. package/dist/chunks/{chunk-ITIVEB2I.js → chunk-ATCBSW73.js} +1 -1
  5. package/dist/chunks/{chunk-NSW5PCGW.js → chunk-CEFKTE5A.js} +1 -1
  6. package/dist/chunks/chunk-JKJ76CRT.js +388 -0
  7. package/dist/chunks/chunk-JTDOMQMQ.js +1 -0
  8. package/dist/chunks/{fitment-data-2SHEWSDK.js → fitment-data-IPAMN5IH.js} +1 -1
  9. package/dist/editor/components/GalleryPicturesSource.js +1 -1
  10. package/dist/editor/components/GalleryProductBinding.js +1 -1
  11. package/dist/editor/components/GalleryShowcaseSource.js +1 -1
  12. package/dist/editor/lib/document/blocks/commerce/ProductHero/fields.js +1 -1
  13. package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
  14. package/dist/editor/lib/storefront-document.js +1 -1
  15. package/dist/editor/lib/storefront-editor-words-kept.js +1 -1
  16. package/dist/editor/lib/storefront-editor-words.d.ts +3 -0
  17. package/dist/editor/lib/storefront-editor-words.js +1 -1
  18. package/dist/index.js +33 -33
  19. package/dist/links.js +1 -1
  20. package/dist/render/app/globals.css +37 -1
  21. package/dist/render/built-with.json +1 -1
  22. package/dist/render/components/DefaultProductHero.d.ts +12 -0
  23. package/dist/render/components/DefaultProductHero.js +1 -0
  24. package/dist/render/components/GridCardTemplate.d.ts +7 -4
  25. package/dist/render/components/GridCardTemplate.js +1 -1
  26. package/dist/render/components/ProductGridSection.js +1 -1
  27. package/dist/render/components/ProductHeroPanel.d.ts +2 -1
  28. package/dist/render/components/ProductHeroPanel.js +1 -1
  29. package/dist/render/components/card-pieces/CardBuyButton.js +1 -1
  30. package/dist/render/components/card-pieces/CardName.js +1 -1
  31. package/dist/render/components/card-pieces/CardProductPicture.js +1 -1
  32. package/dist/render/components/card-pieces/CardSizes.d.ts +10 -2
  33. package/dist/render/components/card-pieces/CardSizes.js +1 -1
  34. package/dist/render/components/card-pieces/CardSpecs.d.ts +2 -0
  35. package/dist/render/components/card-pieces/CardSpecs.js +1 -1
  36. package/dist/render/components/card-pieces/ProductCardState.d.ts +14 -4
  37. package/dist/render/components/card-pieces/ProductCardState.js +1 -1
  38. package/dist/render/components/catalog/ShopperChips.js +1 -1
  39. package/dist/render/components/wheels-plp/AlloyWheelsListing.d.ts +1 -1
  40. package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
  41. package/dist/render/lib/content/hero-option-seed.d.ts +28 -0
  42. package/dist/render/lib/content/hero-option-seed.js +1 -0
  43. package/dist/render/lib/document/blocks/commerce/ProductEyebrow/render.js +1 -1
  44. package/dist/render/lib/document/blocks/commerce/ProductHero/meta.d.ts +4 -0
  45. package/dist/render/lib/document/blocks/commerce/ProductHero/meta.js +1 -1
  46. package/dist/render/lib/document/blocks/commerce/ProductHero/render.js +1 -1
  47. package/dist/render/lib/document/blocks/commerce/ProductSpecs/render.js +1 -1
  48. package/dist/render/lib/document/card-templates.js +1 -1
  49. package/dist/render/lib/sections/filter-option-rows.d.ts +14 -0
  50. package/dist/render/lib/sections/filter-option-rows.js +1 -1
  51. package/dist/render/lib/sections/product-pictures.d.ts +2 -2
  52. package/dist/render/lib/sections/product-pictures.js +1 -1
  53. package/dist/render/lib/wheels/plp-hydrate.d.ts +4 -1
  54. package/dist/render/lib/wheels/plp-hydrate.js +1 -1
  55. package/dist/words.d.ts +4 -0
  56. package/dist/words.js +2 -2
  57. package/package.json +3 -3
  58. package/dist/chunks/chunk-IZEIMAJI.js +0 -1
  59. package/dist/chunks/chunk-OERUEODX.js +0 -388
  60. package/dist/render/components/TyrePlpCard.d.ts +0 -20
  61. package/dist/render/components/TyrePlpCard.js +0 -1
  62. package/dist/render/components/TyreSummaryCard.d.ts +0 -12
  63. package/dist/render/components/TyreSummaryCard.js +0 -1
  64. /package/dist/chunks/{chunk-OERUEODX.js.LEGAL.txt → chunk-JKJ76CRT.js.LEGAL.txt} +0 -0
  65. /package/dist/chunks/{chunk-XYG76Y4H.js → chunk-LRLOANKA.js} +0 -0
@@ -1 +1 @@
1
- "use client";import{jsx as n,Fragment as m,jsxs as p}from"react/jsx-runtime";import{Fragment as x}from"react";import{HideTaker as u}from"efficient-web-builder/render/components/ViewHideRoot";import{applyCardAnswers as h}from"../../lib/content/field-usage.js";import{wheelCardSpecFacts as f}from"../../lib/wheels/plp-fitment-match.js";import{CARD_TEXT_SIZE as i,useCatalogCard as g}from"./card-row.js";import{useProductCardState as C}from"./ProductCardState.js";const S="whitespace-nowrap",_=t=>typeof t=="string"?t:t.text,w=/^(.*\S) (\+\d+ more)$/;function $(t,r="·"){return t.map((a,c)=>{const e=_(a),l=typeof a!="string"&&a.accent,o=`${S}${l?" text-accent":""}`,d=c<t.length-1?`${e} ${r}`:e,s=w.exec(e);return p(x,{children:[s?p(m,{children:[n("span",{className:o,children:s[1]})," ",n("span",{className:o,children:c<t.length-1?`${s[2]} ${r}`:s[2]})]}):n("span",{className:o,children:d}),c<t.length-1?" ":null]},e)})}function F({children:t}){const r=g();return n(u,{className:r?`mt-2 h-[38px] overflow-hidden [.sf-card-rows_&]:h-auto [.sf-card-rows_&]:max-h-[76px] font-mono ${i.labelLarge} leading-[19px] tracking-[0.14em] text-fg-dim`:`mt-[4px] font-mono ${i.labelLarge} tracking-[0.1em] text-fg-dim`,children:t})}function E({sizes:t=!1,car:r=null,separator:a,fieldUsage:c=[]}){const e=C();if(e.kind!=="wheel")return null;const l=h(f(e.wheel,r,{sizes:t}),c).map(o=>o.text);return n(m,{children:$(l,a)})}function L(t){return n(F,{children:n(E,{...t})})}export{S as CARD_SPEC_FIELD_CLASS,E as CardSpecFacts,F as CardSpecLine,$ as cardSpecFields,L as default};
1
+ "use client";import{jsx as r,Fragment as l,jsxs as m}from"react/jsx-runtime";import{Fragment as u}from"react";import{HideTaker as h}from"efficient-web-builder/render/components/ViewHideRoot";import{applyCardAnswers as x,keepForCard as f}from"../../lib/content/field-usage.js";import{formatSizeRange as g}from"../../lib/wheels/size-range.js";import{wheelCardSpecFacts as C}from"../../lib/wheels/plp-fitment-match.js";import{CARD_TEXT_SIZE as p,useCatalogCard as S}from"./card-row.js";import{useProductCardState as _}from"./ProductCardState.js";const $="whitespace-nowrap",w=e=>typeof e=="string"?e:e.text,F=/^(.*\S) (\+\d+ more)$/;function k(e,n="·"){return e.map((o,a)=>{const t=w(o),i=typeof o!="string"&&o.accent,s=`${$}${i?" text-accent":""}`,d=a<e.length-1?`${t} ${n}`:t,c=F.exec(t);return m(u,{children:[c?m(l,{children:[r("span",{className:s,children:c[1]})," ",r("span",{className:s,children:a<e.length-1?`${c[2]} ${n}`:c[2]})]}):r("span",{className:s,children:d}),a<e.length-1?" ":null]},t)})}function z({children:e}){const n=S();return r(h,{className:n?`mt-2 h-[38px] overflow-hidden [.sf-card-rows_&]:h-auto [.sf-card-rows_&]:max-h-[76px] font-mono ${p.labelLarge} leading-[19px] tracking-[0.14em] text-fg-dim`:`mt-[4px] font-mono ${p.labelLarge} tracking-[0.1em] text-fg-dim`,children:e})}function L({sizes:e=!1,car:n=null,separator:o,fieldUsage:a=[]}){const t=_();if(t.kind==="tyre")return r(l,{children:j(t.tyre,a)});if(t.kind!=="wheel")return null;const i=x(C(t.wheel,n,{sizes:e}),a).map(s=>s.text);return r(l,{children:k(i,o)})}function j(e,n){const o=f(n);return[e.sizes.length>0?`${e.sizes.length} ${e.sizes.length===1?"size":"sizes"}`:null,o("rim_diameter")?g(e.rimDiameters):null].filter(Boolean).join(" · ")}function D(e){return r(z,{children:r(L,{...e})})}export{$ as CARD_SPEC_FIELD_CLASS,L as CardSpecFacts,z as CardSpecLine,k as cardSpecFields,D as default,j as tyreSpecLine};
@@ -1,9 +1,8 @@
1
1
  import { type ReactNode } from "react";
2
2
  import type { CartLine } from "../CartContext.js";
3
3
  import { type TyreDetailState } from "../useTyreDetail.js";
4
- import type { TyrePlpCardProps } from "../TyrePlpCard.js";
5
4
  import { type PlpCardSelection } from "../wheels-plp/usePlpCardSelection.js";
6
- import type { Bundle, Tyre, TyreVariant, WheelSummary } from "../../lib/api/index.js";
5
+ import type { Bundle, Tyre, TyreProductSummary, TyreVariant, WheelSummary } from "../../lib/api/index.js";
7
6
  import { type SelectionPriceDisplay } from "../../lib/wheels/price-display.js";
8
7
  export interface WheelCardState {
9
8
  readonly kind: "wheel";
@@ -17,7 +16,18 @@ export interface WheelCardState {
17
16
  readonly notifyOpen: boolean;
18
17
  readonly setNotifyOpen: (open: boolean) => void;
19
18
  }
20
- export type TyreCardProduct = Pick<TyrePlpCardProps, "brand" | "brandLogo" | "name" | "slug" | "sizes" | "fitSize" | "rimDiameters" | "prices" | "image">;
19
+ export interface TyreCardProduct {
20
+ brand?: string | null;
21
+ brandLogo?: string | null;
22
+ name: string;
23
+ slug?: string | null;
24
+ sizes: string[];
25
+ fitSize?: string | null;
26
+ rimDiameters: number[];
27
+ prices?: Record<string, number | null>;
28
+ image?: string | null;
29
+ }
30
+ export declare function tyreCardProduct(item: TyreProductSummary, fitSize?: string | null): TyreCardProduct;
21
31
  export interface TyreCardState {
22
32
  readonly kind: "tyre";
23
33
  readonly tyre: TyreCardProduct;
@@ -79,7 +89,7 @@ export declare function BundleCardStateProvider({ bundle, children }: {
79
89
  }): import("react").JSX.Element;
80
90
  export declare function TyreCardStateProvider({ tyre, currency, editing, children, }: {
81
91
  tyre: TyreCardProduct;
82
- currency: string;
92
+ currency?: string;
83
93
  editing?: boolean;
84
94
  children: ReactNode;
85
95
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as l}from"react/jsx-runtime";import{createContext as b,useCallback as z,useContext as S,useMemo as A,useState as P}from"react";import{useCurrency as h}from"../CurrencyContext.js";import{useTyreDetail as B}from"../useTyreDetail.js";import{usePlpCardSelection as N}from"../wheels-plp/usePlpCardSelection.js";import{tyrePagePath as W}from"../../lib/tyres/tyre-page-path.js";import{canOrderTyreVariant as T}from"../../lib/tyres/tyre-purchase.js";import{resolveSelectionPrice as j}from"../../lib/wheels/price-display.js";import{setBuildLabel as E,setIsWide as H,summarySetBuild as L}from"../../lib/wheels/set-mode.js";const n=b(null);function J(){const e=S(n);return e?.kind==="hero"?e:null}function K({value:e,children:t}){return l(n.Provider,{value:e,children:t})}function R(){const e=S(n);if(!e||e.kind==="hero")throw new Error("A product card piece was drawn outside a product card (no ProductCardState).");return e}function Q(){const e=S(n);return e?.kind==="hero"?null:e}function X(){const e=R();if(e.kind!=="wheel")throw new Error(`A wheel card piece was drawn on a ${e.kind} card.`);return e}const V=[];function Y({wheel:e,colours:t=V,defaultFinish:o,editing:a=!1,children:u}){const{currency:r}=h(),s=N(e,t,o),[f,p]=P(!1),d=L(e),c={kind:"wheel",wheel:e,sel:s,currency:r,price:j(e,s.selectedVariant,r,1),isSet:H(d),setWords:E(d),editing:a,notifyOpen:f,setNotifyOpen:p};return l(n.Provider,{value:c,children:u})}function Z({bundle:e,children:t}){const{currency:o}=h(),a={kind:"bundle",bundle:e,currency:o};return l(n.Provider,{value:a,children:t})}function ee({tyre:e,currency:t,editing:o=!1,children:a}){const{currency:u}=h(),{slug:r}=e,s=W(r),[f,p]=P(!1),d=z(()=>{r&&p(!0)},[r]),{state:c,tyre:m}=B(r??null,f),i=A(()=>m?.variants??[],[m]),[x,k]=P(null),w=i.length===1?i[0].size:null,y=x??w,v=i.find(g=>g.size===y),C=c==="ready",O={kind:"tyre",tyre:e,currency:t,activeCurrency:u,pagePath:s,arm:d,detailState:c,detail:m,variants:i,chosen:y,setSize:k,variant:v,canAdd:v!=null&&T(v,u),detailReady:C,unsellable:!s||c==="error"||C&&i.length===0,editing:o};return l(n.Provider,{value:O,children:a})}export{Z as BundleCardStateProvider,K as HeroStateProvider,ee as TyreCardStateProvider,Y as WheelCardStateProvider,J as useHeroStateOrNull,R as useProductCardState,Q as useProductCardStateOrNull,X as useWheelCardState};
1
+ "use client";import{jsx as l}from"react/jsx-runtime";import{createContext as O,useCallback as z,useContext as y,useMemo as A,useState as P}from"react";import{useCurrency as S}from"../CurrencyContext.js";import{useTyreDetail as B}from"../useTyreDetail.js";import{usePlpCardSelection as L}from"../wheels-plp/usePlpCardSelection.js";import{tyrePagePath as N}from"../../lib/tyres/tyre-page-path.js";import{canOrderTyreVariant as W}from"../../lib/tyres/tyre-purchase.js";import{resolveSelectionPrice as D}from"../../lib/wheels/price-display.js";import{setBuildLabel as T,setIsWide as j,summarySetBuild as E}from"../../lib/wheels/set-mode.js";function J(e,r=null){return{brand:e.brand,brandLogo:e.brandLogo,name:e.name,slug:e.slug,sizes:e.sizes,fitSize:r,rimDiameters:e.rimDiameters,prices:e.prices,image:e.coverImage}}const n=O(null);function K(){const e=y(n);return e?.kind==="hero"?e:null}function Q({value:e,children:r}){return l(n.Provider,{value:e,children:r})}function H(){const e=y(n);if(!e||e.kind==="hero")throw new Error("A product card piece was drawn outside a product card (no ProductCardState).");return e}function X(){const e=y(n);return e?.kind==="hero"?null:e}function Y(){const e=H();if(e.kind!=="wheel")throw new Error(`A wheel card piece was drawn on a ${e.kind} card.`);return e}const I=[];function Z({wheel:e,colours:r=I,defaultFinish:o,editing:a=!1,children:s}){const{currency:t}=S(),c=L(e,r,o),[p,f]=P(!1),d=E(e),i={kind:"wheel",wheel:e,sel:c,currency:t,price:D(e,c.selectedVariant,t,1),isSet:j(d),setWords:T(d),editing:a,notifyOpen:p,setNotifyOpen:f};return l(n.Provider,{value:i,children:s})}function ee({bundle:e,children:r}){const{currency:o}=S(),a={kind:"bundle",bundle:e,currency:o};return l(n.Provider,{value:a,children:r})}function re({tyre:e,currency:r,editing:o=!1,children:a}){const{currency:s}=S(),{slug:t}=e,c=N(t),[p,f]=P(!1),d=z(()=>{t&&f(!0)},[t]),{state:i,tyre:m}=B(t??null,p),u=A(()=>m?.variants??[],[m]),[x,g]=P(null),k=u.length===1?u[0].size:null,C=x??k,v=u.find(w=>w.size===C),h=i==="ready",b={kind:"tyre",tyre:e,currency:r??s,activeCurrency:s,pagePath:c,arm:d,detailState:i,detail:m,variants:u,chosen:C,setSize:g,variant:v,canAdd:v!=null&&W(v,s),detailReady:h,unsellable:!c||i==="error"||h&&u.length===0,editing:o};return l(n.Provider,{value:b,children:a})}export{ee as BundleCardStateProvider,Q as HeroStateProvider,re as TyreCardStateProvider,Z as WheelCardStateProvider,J as tyreCardProduct,K as useHeroStateOrNull,H as useProductCardState,X as useProductCardStateOrNull,Y as useWheelCardState};
@@ -1 +1 @@
1
- "use client";import{jsx as e,Fragment as T,jsxs as L}from"react/jsx-runtime";import{CardTemplateRows as G}from"efficient-web-builder/render/components/CardRowContext";import{cardRow as K}from"efficient-web-builder/format/lib/content/card-template";import{say as O}from"efficient-web-builder/format/lib/editor-words";import{useCurrency as B}from"../CurrencyContext.js";import{formatPrice as I}from"../../lib/commerce.js";import{filterChipItems as Y,filterStateWithoutChip as j}from"../../lib/sections/filter-option-rows.js";import{PlpResultRange as R,PlpToolbar as S}from"../wheels-plp/PlpToolbar.js";import A from"./ClearAllButton.js";import b from"./SortSelect.js";import{hasActivePlpFilters as M,plpSortKeysFor as H,PLP_SORT_LABELS as U}from"../../lib/wheels/plp-filters.js";import{itemKind as W,plpKindNoun as X}from"../../lib/catalog/plp-item.js";import{CATALOG_TEXT_SIZE as Z}from"../../lib/sections/catalog-text-size.js";import{EMPTY_PLP_FILTERS as $}from"../../lib/wheels/plp-filters.js";import{GALLERY_SORT_KEYS as q,GALLERY_SORT_LABELS as z}from"../../lib/sections/gallery-toolbar.js";import{useShopperMember as D}from"./ShopperScope.js";import{HideTaker as y}from"efficient-web-builder/render/components/ViewHideRoot";const J="✕";function Q({owner:n,showCount:r,showClear:s,showSort:l,firstShown:t,editing:a}){const{ref:i,scope:o,gallery:f}=D("chips",null,{count:r,sort:l}),{currency:c}=B(),m=(!o?.live&&t?{state:o?.state??{...$,sort:t.sort},update:()=>{},clear:()=>{},total:t.total,range:t.range,kinds:t.kinds}:null)??(o?{...o,kinds:[...new Set(o.rows.map(W))]}:null);if(!m&&f)return e(y,{as:"div",ref:i,"data-shopper-chips":"",children:e(V,{owner:n,gallery:f,showCount:r,showClear:s,showSort:l,editing:a})});if(!m)return e(y,{as:"div",ref:i,"data-shopper-chips":"",children:a&&e("p",{className:`font-mono ${Z.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:"Filter chips show the picks of a Filters block, or the Tags of a Gallery, in this Box"})});const{state:d,update:u,clear:_,total:p,range:x,kinds:h}=m,E=X(h.length?h:["alloy-wheel"]),P=M(d),C=Y(d,c,I).map(g=>({...g,mark:J,press:()=>u(N=>j(N,g))})),w=L(T,{children:[r&&e("div",{"data-shopper-count":"",className:"contents",children:e(R,{total:p,range:x??{from:p?1:0,to:p},noun:E})}),C.length>0&&e(v,{owner:n,chips:C,editing:a}),s&&P&&e(A,{onClick:_})]}),F=H(h.length?h:["alloy-wheel"]);return e(y,{as:"div",ref:i,"data-shopper-chips":"",children:e(S,{start:w,end:l?e(b,{value:d.sort,keys:F,labels:U,onChange:g=>u({sort:g,page:1})}):void 0})})}function v({owner:n,chips:r,selected:s,editing:l}){return e("ul",{className:"flex list-none flex-wrap items-center gap-2",children:e(G,{ownerId:n.id,ownerType:"FilterChipsBlock",Template:n.template,rows:r.map(K),items:r,states:s===void 0?void 0:r.map((t,a)=>a===s?{selected:!0}:void 0),actions:l?void 0:r.map(t=>({press:t.press})),fallback:null,wrapCopy:t=>e("li",{children:t}),children:t=>t})})}function V({owner:n,gallery:r,showCount:s,showClear:l,showSort:t,editing:a}){const{tags:i,tag:o,sort:f,shown:c,pick:k,setSort:m,clear:d}=r,u=[{label:O("All"),mark:"",press:()=>k(null)},...i.map(p=>({label:p,mark:"",press:()=>k(p)}))],_=L(T,{children:[s&&e("div",{"data-shopper-count":"",className:"contents",children:e(R,{total:c,range:{from:c?1:0,to:c},noun:ee})}),i.length>0&&e(v,{owner:n,chips:u,selected:o===null?0:i.indexOf(o)+1,editing:a}),l&&o!==null&&e(A,{onClick:d})]});return e(S,{start:_,end:t?e(b,{value:f,keys:q,labels:z,onChange:m}):void 0})}const ee={many:"items"};export{Q as default};
1
+ "use client";import{jsx as e,Fragment as T,jsxs as L}from"react/jsx-runtime";import{CardTemplateRows as G}from"efficient-web-builder/render/components/CardRowContext";import{cardRow as K}from"efficient-web-builder/format/lib/content/card-template";import{say as O}from"efficient-web-builder/format/lib/editor-words";import{useCurrency as B}from"../CurrencyContext.js";import{formatPrice as I}from"../../lib/commerce.js";import{filterChipItems as Y,filterStateWithoutChip as j,optionCardRows as M}from"../../lib/sections/filter-option-rows.js";import{PlpResultRange as R,PlpToolbar as S}from"../wheels-plp/PlpToolbar.js";import A from"./ClearAllButton.js";import b from"./SortSelect.js";import{hasActivePlpFilters as H,plpSortKeysFor as U,PLP_SORT_LABELS as W}from"../../lib/wheels/plp-filters.js";import{itemKind as X,plpKindNoun as Z}from"../../lib/catalog/plp-item.js";import{CATALOG_TEXT_SIZE as $}from"../../lib/sections/catalog-text-size.js";import{EMPTY_PLP_FILTERS as q}from"../../lib/wheels/plp-filters.js";import{GALLERY_SORT_KEYS as z,GALLERY_SORT_LABELS as D}from"../../lib/sections/gallery-toolbar.js";import{useShopperMember as J}from"./ShopperScope.js";import{HideTaker as _}from"efficient-web-builder/render/components/ViewHideRoot";const Q="✕";function V({owner:n,showCount:l,showClear:a,showSort:i,firstShown:r,editing:t}){const{ref:o,scope:s,gallery:f}=J("chips",null,{count:l,sort:i}),{currency:c}=B(),m=(!s?.live&&r?{state:s?.state??{...q,sort:r.sort},update:()=>{},clear:()=>{},total:r.total,range:r.range,kinds:r.kinds}:null)??(s?{...s,kinds:[...new Set(s.rows.map(X))]}:null);if(!m&&f)return e(_,{as:"div",ref:o,"data-shopper-chips":"",children:e(ee,{owner:n,gallery:f,showCount:l,showClear:a,showSort:i,editing:t})});if(!m)return e(_,{as:"div",ref:o,"data-shopper-chips":"",children:t&&e("p",{className:`font-mono ${$.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:"Filter chips show the picks of a Filters block, or the Tags of a Gallery, in this Box"})});const{state:d,update:u,clear:C,total:p,range:w,kinds:h}=m,x=Z(h.length?h:["alloy-wheel"]),E=H(d),y=Y(d,c,I).map(g=>({...g,mark:Q,press:()=>u(N=>j(N,g))})),P=L(T,{children:[l&&e("div",{"data-shopper-count":"",className:"contents",children:e(R,{total:p,range:w??{from:p?1:0,to:p},noun:x})}),y.length>0&&e(v,{owner:n,chips:y,editing:t}),a&&E&&e(A,{onClick:C})]}),F=U(h.length?h:["alloy-wheel"]);return e(_,{as:"div",ref:o,"data-shopper-chips":"",children:e(S,{start:P,end:i?e(b,{value:d.sort,keys:F,labels:W,onChange:g=>u({sort:g,page:1})}):void 0})})}function v({owner:n,chips:l,selected:a,editing:i}){const r=M(l,{item:t=>t,selected:(t,o)=>o===a,press:t=>t.press});return e("ul",{className:"flex list-none flex-wrap items-center gap-2",children:e(G,{ownerId:n.id,ownerType:"FilterChipsBlock",Template:n.template,rows:r.items.map(K),items:r.items,states:a===void 0?void 0:r.states,actions:i?void 0:r.actions,fallback:null,wrapCopy:t=>e("li",{children:t}),children:t=>t})})}function ee({owner:n,gallery:l,showCount:a,showClear:i,showSort:r,editing:t}){const{tags:o,tag:s,sort:f,shown:c,pick:k,setSort:m,clear:d}=l,u=[{label:O("All"),mark:"",press:()=>k(null)},...o.map(p=>({label:p,mark:"",press:()=>k(p)}))],C=L(T,{children:[a&&e("div",{"data-shopper-count":"",className:"contents",children:e(R,{total:c,range:{from:c?1:0,to:c},noun:te})}),o.length>0&&e(v,{owner:n,chips:u,selected:s===null?0:o.indexOf(s)+1,editing:t}),i&&s!==null&&e(A,{onClick:d})]});return e(S,{start:C,end:r?e(b,{value:f,keys:z,labels:D,onChange:m}):void 0})}const te={many:"items"};export{V as default};
@@ -32,4 +32,4 @@ export declare const PLP_GATE_DEFAULTS: {
32
32
  readonly heading: "Let's find wheels that fit your car.";
33
33
  readonly intro: "Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you.";
34
34
  };
35
- export default function AlloyWheelsListing({ heading, intro, askForCar, gateHeading, gateIntro, perPage, columns, defaultSort, hiddenFacets, fieldUsage, showPrice, showInStock, kinds, products, wheels, requestQuery, editing, ownerId, template, cardImage, hover, titleLevel, }: AlloyWheelsListingProps): import("react").JSX.Element | null;
35
+ export default function AlloyWheelsListing({ heading, intro, askForCar, gateHeading, gateIntro, perPage, columns, defaultSort, hiddenFacets, fieldUsage, showPrice, showInStock, kinds, products, wheels, requestQuery, editing, ownerId, template, hover, titleLevel, }: AlloyWheelsListingProps): import("react").JSX.Element | null;
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as p,Fragment as $e}from"react/jsx-runtime";import{useScopeClass as He}from"../../lib/use-scope-class.js";import{useCallback as m,useEffect as Ye,useMemo as i,useRef as qe,useState as Je}from"react";import{cardHoverOf as Qe}from"efficient-web-builder/format/lib/animation/hover";import{SHARED_ROWS_LIST_CLASS as Ue}from"efficient-web-builder/render/lib/content/box-shared-columns";import{NO_FIELD_ANSWERS as Xe,answersForKind as ne}from"../../lib/content/field-usage.js";import{useCurrency as Ze}from"../CurrencyContext.js";import et from"../NoCurrencyNote.js";import{usePreviewDevice as tt}from"efficient-easel/screen/components/PreviewDeviceContext";import{renderGold as ot,renderHeadline as rt}from"efficient-web-builder/render/components/goldPhrases";import{useUnifiedProductCatalog as nt}from"../useProductCatalog.js";import{scrollBehavior as st}from"efficient-web-builder/render/components/useReducedMotion";import{normalizePlpColumns as it,PLP_GRID_GAP_VAR as se,plpGridVars as lt}from"../../lib/wheels/plp-grid.js";import{plpCardImageSizes as at}from"../../lib/sections/card-image-sizes.js";import{CARD_ROWS_GRID_CLASS as ct,cardRowsGridStyle as pt}from"../WheelCardFrame.js";import{applyPlpFilters as mt,buildPlpFacets as dt,buildPlpTypeOptions as ut,buildTyreSizeBoxes as ht,EMPTY_PLP_FILTERS as ie,hasActivePlpFilters as ft,paginatePlp as gt,pickTyreSize as yt,plpTyreSizeBoxesShown as St,plpInStockCount as xt,plpOpeningSort as wt,plpPriceBounds as bt,plpShownKinds as vt,plpSortKeysFor as Pt,PLP_SORT_LABELS as kt}from"../../lib/wheels/plp-filters.js";import{itemKind as L,itemSlug as le,itemTyreSizes as Ct,plpBrandVaries as Nt,plpProcessVaries as Tt,plpItemsOfKinds as _t,plpKindNoun as V,resolvePlpKinds as At}from"../../lib/catalog/plp-item.js";import{plpGateWords as zt,plpVehicleCopy as Lt}from"../../lib/catalog/plp-vehicle-copy.js";import{oemBadgeSize as It,oemTyreSizes as Ot}from"../../lib/tyres/tyre-vehicle-fitment.js";import Rt from"../TyreSummaryCard.js";import{wheelsFittingVehicle as Gt}from"../../lib/wheels/plp-fitment-match.js";import Vt from"./PlpActiveChips.js";import{GridCardProvider as Ft,GridMixedCards as Bt,gridIndexCss as Et,LISTING_CARD_RULES as Kt}from"../GridCardTemplate.js";import{wheelCardEyebrowShows as jt}from"../ProductCardEyebrow.js";import Mt from"./PlpPagination.js";import Dt from"./PlpSidebar.js";import{PlpResultRange as Wt,PlpToolbar as $t}from"./PlpToolbar.js";import Ht from"../catalog/SortSelect.js";import Yt from"./PlpVehicleBar.js";import qt from"./PlpVehicleGate.js";import{useVehicleCatalog as Jt}from"./useVehicleCatalog.js";import{useVehicleFit as Qt}from"../fitment/useVehicleFit.js";import{usePlpFiltersInUrl as Ut}from"./usePlpFiltersInUrl.js";import{say as F}from"efficient-web-builder/format/lib/editor-words";const Vo={heading:"Let's find wheels that fit your car.",intro:"Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you."};function Xt({level:v,className:P,children:k}){return r(v===2?"h2":"h1",{className:P,children:k})}const Zt=Qe({},"AlloyWheelsListing");function eo({heading:v="",intro:P="",askForCar:k=!0,gateHeading:B="",gateIntro:ae="",perPage:E=24,columns:ce,defaultSort:pe="recommended",hiddenFacets:me=[],fieldUsage:f=Xe,showPrice:K=!0,showInStock:de=!0,kinds:ue,products:he,wheels:fe,requestQuery:ge,editing:d=!1,ownerId:ye="",template:Se,cardImage:xe,hover:we=Zt,titleLevel:be}){const{currency:l}=Ze(),u=At(ue),j=tt(),M=it(ce),ve=lt(M,d?j:null),Pe=at(M,d?j:null),D=He("plp"),ke=Et(D),Ce=nt(),W=he??fe??Ce??[],$=i(()=>_t(W,u),[W,u.join(",")]),o=Qt({editing:d,enabled:k,autoApply:!0}),[Ne,I]=Je(!1),Te=wt(pe,u),g=o.applied?.vehicle??null,[e,x]=Ut({editing:d,openingSort:Te,appliedVehicle:g,vehicleRestored:o.restored,requestQuery:ge}),c=vt(u,e.kind),s=m(t=>x(t),[x]),H=m((t,h)=>{const a=e[t],De=a.map(String).includes(h)?a.filter(We=>String(We)!==h):[...a,t==="diameters"?Number(h):h];s({...e,[t]:De,page:1})},[e,s]),Y=m(t=>s({...e,priceMax:t,page:1}),[e,s]),q=m(t=>s({...e,inStockOnly:t,page:1}),[e,s]),J=m(t=>s({...ie,kind:t,inStockOnly:e.inStockOnly,priceMax:e.priceMax,sort:e.sort}),[e.inStockOnly,e.priceMax,e.sort,s]),_e=m(t=>s({...e,sort:t,page:1}),[e,s]),Ae=m(t=>{s({...e,page:t}),typeof window<"u"&&window.scrollTo({top:0,behavior:st()})},[e,s]),Q=m(()=>s({...ie,sort:e.sort}),[e.sort,s]),{clear:N}=o,U=m(()=>{N(),I(!0),x(t=>({...t,page:1}))},[N]),ze=m(()=>{N(),I(!1),x(t=>({...t,page:1}))},[N]),T=g?[g.make,g.model,g.year,g.modification].join("|"):"",_=qe(null);Ye(()=>{if(o.restored){if(_.current===null){_.current=T;return}_.current!==T&&(_.current=T,x(t=>t.page===1?t:{...t,page:1}))}},[o.restored,T,x]);const A=Jt({catalog:$,shownKinds:u,vehicle:g,editing:d}),n=i(()=>{if(!o.fit)return A;const t=A.filter(a=>L(a)==="alloy-wheel"),h=new Set(Gt(t,o.fit).map(a=>a.slug));return A.filter(a=>L(a)!=="alloy-wheel"||h.has(le(a)))},[A,o.fit]),w=me.join(","),Le=i(()=>{const t=new Set(w?w.split(","):[]);return dt(n,e,l,c,f).filter(h=>!t.has(h.key))},[n,e,l,w,c.join(","),f]),y=i(()=>mt(n,e,l),[n,e,l]),X=c.length>1,Z=i(()=>ne(f,"alloy-wheel"),[f]),Ie=i(()=>ne(f,"tyre"),[f]),z=i(()=>Nt(y),[y]),O=i(()=>Tt(y),[y]),R=X?V(["alloy-wheel"]).one:null,Oe=i(()=>({kindLabel:R,brand:z,process:O}),[R,z,O]),Re=jt({kind:!!R,brand:z,process:O},Z),Ge=i(()=>K?bt(n,l):null,[n,l,K]),Ve=i(()=>xt(n,e,l),[n,e,l]),Fe=i(()=>ut(n,u,e,l),[n,u.join(","),e,l]),Be=m((t,h)=>{const a=yt(n.flatMap(Ct),e.tyreSizes[0]??"",t,h);s({...e,tyreSizes:a?[a]:[],page:1})},[n,e,s]),Ee=i(()=>{const t=new Set(w?w.split(","):[]);return!St(n,c)||t.has("tyreSizes")?null:ht(n,e,l)},[n,e,l,w,c.join(","),f]),S=i(()=>gt(y,e.page,E),[y,e.page,E]),b=V(c),G=Lt(c),ee=zt(B,ae,c,u),te=c.length===1&&c[0]==="tyre",oe=o.applied?.stock??null,C=i(()=>Ot(oe),[oe]),Ke=i(()=>n.filter(t=>c.includes(L(t))).length,[n,c.join(",")]),re=$.length===0,je=!re&&n.length===0,Me=k&&!d&&!o.applied&&!Ne;return u.length===0?null:p("section",{children:[k&&r(Yt,{cascade:o.cascade,appliedName:o.appliedName,fit:o.fit,fitSummary:te&&C.length>0?`Takes ${C.join(" · ")}`:null,resolving:o.resolving,unresolved:te?!!o.applied&&!o.resolving&&C.length===0:o.unresolved,matchCount:Ke,copy:G,onAmend:ze,onClear:U}),Me&&r(qt,{cascade:o.cascade,heading:ee.heading,intro:ee.intro,ready:o.restored,copy:G,onSkip:()=>I(!0)}),p("div",{className:"px-5 py-10 md:px-[max(2.5rem,calc((100%_-_var(--sf-content-cap,100%))/2_+_2.5rem))]",children:[(v||P)&&p("header",{className:"mb-6",children:[v&&r(Xt,{level:be,className:"font-display text-[clamp(28px,4vw,40px)] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[1.05] tracking-[-0.02em]",children:rt(v,!1)}),P&&r("p",{className:"mt-2 max-w-[60ch] text-[15px] text-fg-dim",children:ot(P)})]}),p("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[r(Dt,{facets:Le,filters:e,typeOptions:Fe,sizeBoxes:Ee,sizeMatches:e.tyreSizes.length>0?y.length:null,noun:b,priceBounds:Ge,inStockCount:de?Ve:null,onToggle:H,onPickType:J,onPickSize:Be,onPriceMax:Y,onInStockOnly:q,onClearAll:Q}),p("div",{className:"min-w-0 flex-1",children:[r($t,{className:"mb-4",start:p($e,{children:[r(Wt,{total:S.total,range:{from:S.from,to:S.to},noun:b}),r(Vt,{filters:e,onToggle:H,onPriceMax:Y,onInStockOnly:q,onPickType:J})]}),end:r(Ht,{value:e.sort,keys:Pt(u),labels:kt,onChange:_e})}),re?r("div",{className:"border border-dashed border-line p-10",children:r("p",{className:"font-mono text-[12px] uppercase tracking-[0.16em] text-fg-dim",children:d?b.many==="wheels"?F("No wheels in this website's catalog yet — curate products to see them here."):b.many==="tyres"?F("No tyres in this website's catalog yet — curate products to see them here."):F("No products in this website's catalog yet — curate products to see them here."):"Our catalog is being updated. Please check back shortly."})}):je?p("div",{className:"border border-line p-10",children:[p("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No confirmed fit for your ",o.appliedName]}),r("p",{className:"mt-2 max-w-[52ch] text-[14px] text-fg-dim",children:G.nothingFits}),p("button",{type:"button",onClick:U,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:["Show all ",b.many]})]}):S.total===0?p("div",{className:"border border-line p-10",children:[p("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No ",b.many," match those filters"]}),r("p",{className:"mt-2 max-w-[46ch] text-[14px] text-fg-dim",children:"Try widening the price range or clearing a filter."}),ft(e)&&r("button",{type:"button",onClick:Q,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:"Clear all filters"})]}):p(Ft,{value:{ownerId:ye,ownerType:"AlloyWheelsListing",Template:Se,hover:we,imageSizes:Pe,fieldUsage:Z,reserveEyebrow:Re,editing:d,eyebrow:Oe,fit:o.fit,colours:e.finishes,setGridGap:`var(${se})`,rules:Kt},children:[r("style",{children:ke}),r("div",{className:`plp-card-grid ${D} ${ct} ${Ue}`,style:{...ve,...pt(`var(${se})`)},children:r(Bt,{items:S.items,isWheel:t=>L(t)!=="tyre",other:t=>r(Rt,{item:t,currency:l,fitSize:C.length>0?It(t.sizes,C):null,kindLabel:X?V(["tyre"]).one:null,showBrand:z,editing:d,fieldUsage:Ie,cardImage:xe},`tyre:${le(t)}`)})})]}),r(Mt,{page:S.page,pageCount:S.pageCount,onPage:Ae}),r(et,{editing:d})]})]})]})]})}export{Vo as PLP_GATE_DEFAULTS,eo as default};
1
+ "use client";import{jsx as r,jsxs as p,Fragment as De}from"react/jsx-runtime";import{useScopeClass as We}from"../../lib/use-scope-class.js";import{useCallback as m,useEffect as $e,useMemo as i,useRef as He,useState as Ye}from"react";import{cardHoverOf as qe}from"efficient-web-builder/format/lib/animation/hover";import{SHARED_ROWS_LIST_CLASS as Je}from"efficient-web-builder/render/lib/content/box-shared-columns";import{NO_FIELD_ANSWERS as Qe,answersForKind as oe}from"../../lib/content/field-usage.js";import{useCurrency as Ue}from"../CurrencyContext.js";import Xe from"../NoCurrencyNote.js";import{usePreviewDevice as Ze}from"efficient-easel/screen/components/PreviewDeviceContext";import{renderGold as et,renderHeadline as tt}from"efficient-web-builder/render/components/goldPhrases";import{useUnifiedProductCatalog as ot}from"../useProductCatalog.js";import{scrollBehavior as rt}from"efficient-web-builder/render/components/useReducedMotion";import{normalizePlpColumns as nt,PLP_GRID_GAP_VAR as re,plpGridVars as st}from"../../lib/wheels/plp-grid.js";import{plpCardImageSizes as it}from"../../lib/sections/card-image-sizes.js";import{CARD_ROWS_GRID_CLASS as lt,cardRowsGridStyle as at}from"../WheelCardFrame.js";import{applyPlpFilters as ct,buildPlpFacets as pt,buildPlpTypeOptions as mt,buildTyreSizeBoxes as dt,EMPTY_PLP_FILTERS as ne,hasActivePlpFilters as ut,paginatePlp as ht,pickTyreSize as ft,plpTyreSizeBoxesShown as gt,plpInStockCount as yt,plpOpeningSort as St,plpPriceBounds as xt,plpShownKinds as wt,plpSortKeysFor as bt,PLP_SORT_LABELS as vt}from"../../lib/wheels/plp-filters.js";import{itemKind as z,itemSlug as Pt,itemTyreSizes as kt,plpBrandVaries as Nt,plpProcessVaries as Ct,plpItemsOfKinds as Tt,plpKindNoun as se,resolvePlpKinds as _t}from"../../lib/catalog/plp-item.js";import{plpGateWords as At,plpVehicleCopy as zt}from"../../lib/catalog/plp-vehicle-copy.js";import{oemBadgeSize as Lt,oemTyreSizes as Ot}from"../../lib/tyres/tyre-vehicle-fitment.js";import{wheelsFittingVehicle as It}from"../../lib/wheels/plp-fitment-match.js";import Rt from"./PlpActiveChips.js";import{GridCardProvider as Ft,GridMixedCards as Gt,gridIndexCss as Vt,LISTING_CARD_RULES as Et}from"../GridCardTemplate.js";import{wheelCardEyebrowShows as Kt}from"../ProductCardEyebrow.js";import jt from"./PlpPagination.js";import Bt from"./PlpSidebar.js";import{PlpResultRange as Mt,PlpToolbar as Dt}from"./PlpToolbar.js";import Wt from"../catalog/SortSelect.js";import $t from"./PlpVehicleBar.js";import Ht from"./PlpVehicleGate.js";import{useVehicleCatalog as Yt}from"./useVehicleCatalog.js";import{useVehicleFit as qt}from"../fitment/useVehicleFit.js";import{usePlpFiltersInUrl as Jt}from"./usePlpFiltersInUrl.js";import{say as G}from"efficient-web-builder/format/lib/editor-words";const Io={heading:"Let's find wheels that fit your car.",intro:"Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you."};function Qt({level:v,className:P,children:k}){return r(v===2?"h2":"h1",{className:P,children:k})}const Ut=qe({},"AlloyWheelsListing");function Xt({heading:v="",intro:P="",askForCar:k=!0,gateHeading:V="",gateIntro:ie="",perPage:E=24,columns:le,defaultSort:ae="recommended",hiddenFacets:ce=[],fieldUsage:f=Qe,showPrice:K=!0,showInStock:pe=!0,kinds:me,products:de,wheels:ue,requestQuery:he,editing:h=!1,ownerId:fe="",template:ge,hover:ye=Ut,titleLevel:Se}){const{currency:a}=Ue(),d=_t(me),j=Ze(),B=nt(le),xe=st(B,h?j:null),we=it(B,h?j:null),M=We("plp"),be=Vt(M),ve=ot(),D=de??ue??ve??[],W=i(()=>Tt(D,d),[D,d.join(",")]),o=qt({editing:h,enabled:k,autoApply:!0}),[Pe,L]=Ye(!1),ke=St(ae,d),g=o.applied?.vehicle??null,[e,x]=Jt({editing:h,openingSort:ke,appliedVehicle:g,vehicleRestored:o.restored,requestQuery:he}),c=wt(d,e.kind),s=m(t=>x(t),[x]),$=m((t,u)=>{const l=e[t],Be=l.map(String).includes(u)?l.filter(Me=>String(Me)!==u):[...l,t==="diameters"?Number(u):u];s({...e,[t]:Be,page:1})},[e,s]),H=m(t=>s({...e,priceMax:t,page:1}),[e,s]),Y=m(t=>s({...e,inStockOnly:t,page:1}),[e,s]),q=m(t=>s({...ne,kind:t,inStockOnly:e.inStockOnly,priceMax:e.priceMax,sort:e.sort}),[e.inStockOnly,e.priceMax,e.sort,s]),Ne=m(t=>s({...e,sort:t,page:1}),[e,s]),Ce=m(t=>{s({...e,page:t}),typeof window<"u"&&window.scrollTo({top:0,behavior:rt()})},[e,s]),J=m(()=>s({...ne,sort:e.sort}),[e.sort,s]),{clear:C}=o,Q=m(()=>{C(),L(!0),x(t=>({...t,page:1}))},[C]),Te=m(()=>{C(),L(!1),x(t=>({...t,page:1}))},[C]),T=g?[g.make,g.model,g.year,g.modification].join("|"):"",_=He(null);$e(()=>{if(o.restored){if(_.current===null){_.current=T;return}_.current!==T&&(_.current=T,x(t=>t.page===1?t:{...t,page:1}))}},[o.restored,T,x]);const A=Yt({catalog:W,shownKinds:d,vehicle:g,editing:h}),n=i(()=>{if(!o.fit)return A;const t=A.filter(l=>z(l)==="alloy-wheel"),u=new Set(It(t,o.fit).map(l=>l.slug));return A.filter(l=>z(l)!=="alloy-wheel"||u.has(Pt(l)))},[A,o.fit]),w=ce.join(","),_e=i(()=>{const t=new Set(w?w.split(","):[]);return pt(n,e,a,c,f).filter(u=>!t.has(u.key))},[n,e,a,w,c.join(","),f]),y=i(()=>ct(n,e,a),[n,e,a]),Ae=c.length>1,U=i(()=>oe(f,"alloy-wheel"),[f]),ze=i(()=>oe(f,"tyre"),[f]),O=i(()=>Nt(y),[y]),I=i(()=>Ct(y),[y]),R=Ae?se(["alloy-wheel"]).one:null,Le=i(()=>({kindLabel:R,brand:O,process:I}),[R,O,I]),Oe=Kt({kind:!!R,brand:O,process:I},U),Ie=i(()=>K?xt(n,a):null,[n,a,K]),Re=i(()=>yt(n,e,a),[n,e,a]),Fe=i(()=>mt(n,d,e,a),[n,d.join(","),e,a]),Ge=m((t,u)=>{const l=ft(n.flatMap(kt),e.tyreSizes[0]??"",t,u);s({...e,tyreSizes:l?[l]:[],page:1})},[n,e,s]),Ve=i(()=>{const t=new Set(w?w.split(","):[]);return!gt(n,c)||t.has("tyreSizes")?null:dt(n,e,a)},[n,e,a,w,c.join(","),f]),S=i(()=>ht(y,e.page,E),[y,e.page,E]),b=se(c),F=zt(c),X=At(V,ie,c,d),Z=c.length===1&&c[0]==="tyre",ee=o.applied?.stock??null,N=i(()=>Ot(ee),[ee]),Ee=i(()=>n.filter(t=>c.includes(z(t))).length,[n,c.join(",")]),te=W.length===0,Ke=!te&&n.length===0,je=k&&!h&&!o.applied&&!Pe;return d.length===0?null:p("section",{children:[k&&r($t,{cascade:o.cascade,appliedName:o.appliedName,fit:o.fit,fitSummary:Z&&N.length>0?`Takes ${N.join(" · ")}`:null,resolving:o.resolving,unresolved:Z?!!o.applied&&!o.resolving&&N.length===0:o.unresolved,matchCount:Ee,copy:F,onAmend:Te,onClear:Q}),je&&r(Ht,{cascade:o.cascade,heading:X.heading,intro:X.intro,ready:o.restored,copy:F,onSkip:()=>L(!0)}),p("div",{className:"px-5 py-10 md:px-[max(2.5rem,calc((100%_-_var(--sf-content-cap,100%))/2_+_2.5rem))]",children:[(v||P)&&p("header",{className:"mb-6",children:[v&&r(Qt,{level:Se,className:"font-display text-[clamp(28px,4vw,40px)] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[1.05] tracking-[-0.02em]",children:tt(v,!1)}),P&&r("p",{className:"mt-2 max-w-[60ch] text-[15px] text-fg-dim",children:et(P)})]}),p("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[r(Bt,{facets:_e,filters:e,typeOptions:Fe,sizeBoxes:Ve,sizeMatches:e.tyreSizes.length>0?y.length:null,noun:b,priceBounds:Ie,inStockCount:pe?Re:null,onToggle:$,onPickType:q,onPickSize:Ge,onPriceMax:H,onInStockOnly:Y,onClearAll:J}),p("div",{className:"min-w-0 flex-1",children:[r(Dt,{className:"mb-4",start:p(De,{children:[r(Mt,{total:S.total,range:{from:S.from,to:S.to},noun:b}),r(Rt,{filters:e,onToggle:$,onPriceMax:H,onInStockOnly:Y,onPickType:q})]}),end:r(Wt,{value:e.sort,keys:bt(d),labels:vt,onChange:Ne})}),te?r("div",{className:"border border-dashed border-line p-10",children:r("p",{className:"font-mono text-[12px] uppercase tracking-[0.16em] text-fg-dim",children:h?b.many==="wheels"?G("No wheels in this website's catalog yet — curate products to see them here."):b.many==="tyres"?G("No tyres in this website's catalog yet — curate products to see them here."):G("No products in this website's catalog yet — curate products to see them here."):"Our catalog is being updated. Please check back shortly."})}):Ke?p("div",{className:"border border-line p-10",children:[p("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No confirmed fit for your ",o.appliedName]}),r("p",{className:"mt-2 max-w-[52ch] text-[14px] text-fg-dim",children:F.nothingFits}),p("button",{type:"button",onClick:Q,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:["Show all ",b.many]})]}):S.total===0?p("div",{className:"border border-line p-10",children:[p("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No ",b.many," match those filters"]}),r("p",{className:"mt-2 max-w-[46ch] text-[14px] text-fg-dim",children:"Try widening the price range or clearing a filter."}),ut(e)&&r("button",{type:"button",onClick:J,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:"Clear all filters"})]}):p(Ft,{value:{ownerId:fe,ownerType:"AlloyWheelsListing",Template:ge,hover:ye,imageSizes:we,fieldUsage:U,tyreFieldUsage:ze,reserveEyebrow:Oe,editing:h,eyebrow:Le,fit:o.fit,colours:e.finishes,setGridGap:`var(${re})`,rules:Et},children:[r("style",{children:be}),r("div",{className:`plp-card-grid ${M} ${lt} ${Je}`,style:{...xe,...at(`var(${re})`)},children:r(Gt,{items:S.items,tyreOf:t=>z(t)==="tyre"?t:null,tyreFit:t=>N.length>0?Lt(t.sizes,N):null})})]}),r(jt,{page:S.page,pageCount:S.pageCount,onPage:Ce}),r(Xe,{editing:h})]})]})]})]})}export{Io as PLP_GATE_DEFAULTS,Xt as default};
@@ -0,0 +1,28 @@
1
+ import { type SeededNode } from "efficient-web-builder/format/lib/document/seed-parts";
2
+ type Props = Record<string, unknown>;
3
+ export declare const HERO_OPTION_SLOT = "optionTemplate";
4
+ export declare const HERO_OPTION_SLOT_LABEL = "Option template";
5
+ export declare const HERO_OPTION_FIELDS: readonly [{
6
+ readonly key: "swatch";
7
+ readonly label: "Finish colour";
8
+ readonly kind: "colour";
9
+ }, {
10
+ readonly key: "name";
11
+ readonly label: "Finish name";
12
+ }, {
13
+ readonly key: "label";
14
+ readonly label: "Option";
15
+ }, {
16
+ readonly key: "note";
17
+ readonly label: "Option note";
18
+ }];
19
+ export interface HeroOptionRow {
20
+ swatch?: string;
21
+ name?: string;
22
+ label?: string;
23
+ note?: string;
24
+ }
25
+ export declare const HERO_OPTION_ALLOW: readonly ["Text", "Flex"];
26
+ export declare function heroOptionSeed(nodeId: string): SeededNode[];
27
+ export declare function withHeroOptionTemplate(props: Props): Props;
28
+ export {};
@@ -0,0 +1 @@
1
+ import{BOX_SWATCH_PROP as d}from"efficient-web-builder/format/lib/content/box-background";import{BOX_HIDE_WHEN_ROW_EMPTY as O}from"efficient-web-builder/format/lib/content/card-template";import{BOX_TYPE as t,CONTAINER_BLOCKS_SLOT as i}from"efficient-web-builder/format/lib/document/container-blocks";import{rowFieldTextSeed as r}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{BOX as l,DIM as _,INNER_BOX as p,TEXT as c,boxPadding as a,seedNodes as h,token as T}from"efficient-web-builder/format/lib/document/seed-parts";const m="optionTemplate",b="Option template",f=[{key:"swatch",label:"Finish colour",kind:"colour"},{key:"name",label:"Finish name"},{key:"label",label:"Option"},{key:"note",label:"Option note"}],x=["Text",t],s=(e,o,n={})=>({textStyle:"body-5",...T("label",e),case:"upper",letterSpacing:o,lineHeight:1.5,...n}),w={...l,direction:"row",align:"center",phoneRow:2,sharePhone:"content",wrapPhone:"nowrap"},E=()=>({type:t,props:{...l,direction:"column",name:"Option",...a(12,12),sectionBorder:{width:2}},slots:{[i]:[{type:t,props:{...w,name:"Finish",gap:12,gapPhone:12,[O]:["swatch"]},slots:{[i]:[{type:t,props:{...p,name:"Swatch"},slots:{[i]:[{type:t,props:{...p,name:"Dot",...a(9,9),sectionCorners:10,sectionBorder:{width:1},[d]:"swatch"}}]}},r("name",{...c,tag:"span",minWidth:0},s(12,.18,{weight:700}))]}},{type:t,props:{...p,name:"Words",gap:4,gapPhone:4,...a(0,4),[O]:["label"]},slots:{[i]:[r("label",{...c,tag:"span"},s(14,.18)),r("note",{..._,tag:"span"},s(11,.12))]}}]}});function P(e){return h([E()],(o,n)=>n==="0"?`${e}~option`:`${e}~option.${n.slice(2)}`)}function H(e){if(e[m]!==void 0)return e;const o=typeof e.id=="string"&&e.id.trim()?e.id:"ProductHero";return{...e,[m]:P(o)}}export{x as HERO_OPTION_ALLOW,f as HERO_OPTION_FIELDS,m as HERO_OPTION_SLOT,b as HERO_OPTION_SLOT_LABEL,P as heroOptionSeed,H as withHeroOptionTemplate};
@@ -1 +1 @@
1
- "use client";import{jsx as n}from"react/jsx-runtime";import{withRMark as d}from"efficient-web-builder/render/components/RMark";import c from"../../../../../components/card-pieces/CardEyebrow.js";import{readPartStyles as u}from"efficient-web-builder/render/lib/document/part-styles";import b from"../../../../../components/card-pieces/HostPart.js";import{useProductCardState as f}from"../../../../../components/card-pieces/ProductCardState.js";import{useGridCard as w}from"../../../../../components/GridCardTemplate.js";import{itemBrand as p}from"../../../../catalog/plp-item.js";import{wheelCardEyebrow as y}from"../../../../../components/ProductCardEyebrow.js";import{ProductEyebrowMeta as s}from"./meta.js";function g({region:r}){const o=f(),{fieldUsage:l,reserveEyebrow:a,eyebrow:t}=w(),e=o.kind==="wheel"?o.wheel:null,i=e&&t.brand?p(e):null,m={kindLabel:e?t.kindLabel:null,brand:i?d(i):null,process:e&&t.process&&e.process?d(e.process):null};return n(c,{reserve:a,region:r,children:y(m,l)})}const L={...s,render:r=>{const o=!!r.editor?.isEditing;return n(b,{label:s.label??"",editing:o,children:n(g,{region:{nodeId:typeof r.id=="string"?r.id:void 0,partStyles:u(r),editing:o}})})}};export{L as ProductEyebrowRender};
1
+ "use client";import{jsx as t}from"react/jsx-runtime";import{withRMark as l}from"efficient-web-builder/render/components/RMark";import a from"../../../../../components/card-pieces/CardEyebrow.js";import{readPartStyles as p}from"efficient-web-builder/render/lib/document/part-styles";import y from"../../../../../components/card-pieces/HostPart.js";import{useProductCardState as w}from"../../../../../components/card-pieces/ProductCardState.js";import{useGridCard as g}from"../../../../../components/GridCardTemplate.js";import{itemBrand as h,plpKindNoun as k}from"../../../../catalog/plp-item.js";import{productCardEyebrow as E,wheelCardEyebrow as C}from"../../../../../components/ProductCardEyebrow.js";import{keepForCard as P}from"../../../../content/field-usage.js";import{ProductEyebrowMeta as s}from"./meta.js";function v({region:r}){const e=w(),{fieldUsage:m,tyreFieldUsage:c,reserveEyebrow:d,eyebrow:n}=g();if(e.kind==="tyre"){const b=(n.tyreBrand??n.brand)&&P(c)("brand")&&e.tyre.brand||null,f=n.kindLabel?k(["tyre"]).one:null;return t(a,{reserve:d,region:r,children:E(f,b)})}const o=e.kind==="wheel"?e.wheel:null,i=o&&n.brand?h(o):null,u={kindLabel:o?n.kindLabel:null,brand:i?l(i):null,process:o&&n.process&&o.process?l(o.process):null};return t(a,{reserve:d,region:r,children:C(u,m)})}const I={...s,render:r=>{const e=!!r.editor?.isEditing;return t(y,{label:s.label??"",editing:e,children:t(v,{region:{nodeId:typeof r.id=="string"?r.id:void 0,partStyles:p(r),editing:e}})})}};export{I as ProductEyebrowRender};
@@ -4,6 +4,10 @@ export declare const ProductHeroSlots: {
4
4
  allow: string[];
5
5
  type: "slot";
6
6
  };
7
+ optionTemplate: {
8
+ type: "slot";
9
+ allow: ("Flex" | "Text")[];
10
+ };
7
11
  trustBullets: {
8
12
  type: "slot";
9
13
  allow: string[];
@@ -1 +1 @@
1
- import{DEFAULT_HERO_PRICE_PLACEMENT as e}from"../../../../sections/hero-price-placement.js";import{DEFAULT_HERO_LAYOUT as r,DEFAULT_HERO_RATIO as l,DEFAULT_HERO_TEXT_ALIGN as E}from"../../../../sections/hero-arrangement.js";import{DEFAULT_HERO_GALLERY_MODE as _,DEFAULT_HERO_IMAGE_FIT as L}from"../../../../sections/hero-gallery.js";import{cardTemplateSlot as T}from"efficient-web-builder/format/lib/content/card-template";import{HERO_PRICE_BLOCK as m}from"../../../../content/hero-price-seed.js";import{TRUST_BULLETS_ALLOW as a,TRUST_BULLETS_SLOT as o}from"../../../../sections/hero-trust-bullets.js";const t=T(),i="ProductBuyButton",c={template:{...t,allow:[...t.allow,m,i]},[o]:{type:"slot",allow:a}},U={label:"Product Hero",fields:c,defaultProps:{source:null,pricePlacement:e,showVehicleFitment:!0,heroLayout:r,imageRatio:l,textAlign:E,showSpecTable:!0,showPriceQuote:!0,galleryMode:_,imageFit:L,[o]:[]}};export{U as ProductHeroMeta,c as ProductHeroSlots};
1
+ import{DEFAULT_HERO_PRICE_PLACEMENT as e}from"../../../../sections/hero-price-placement.js";import{DEFAULT_HERO_LAYOUT as r,DEFAULT_HERO_RATIO as _,DEFAULT_HERO_TEXT_ALIGN as l}from"../../../../sections/hero-arrangement.js";import{DEFAULT_HERO_GALLERY_MODE as E,DEFAULT_HERO_IMAGE_FIT as L}from"../../../../sections/hero-gallery.js";import{cardTemplateSlot as T}from"efficient-web-builder/format/lib/content/card-template";import{HERO_PRICE_BLOCK as O}from"../../../../content/hero-price-seed.js";import{HERO_OPTION_ALLOW as m,HERO_OPTION_SLOT as a}from"../../../../content/hero-option-seed.js";import{TRUST_BULLETS_ALLOW as i,TRUST_BULLETS_SLOT as o}from"../../../../sections/hero-trust-bullets.js";const t=T(),R="ProductBuyButton",p={template:{...t,allow:[...t.allow,O,R]},[a]:{type:"slot",allow:[...m]},[o]:{type:"slot",allow:i}},S={label:"Product Hero",fields:p,defaultProps:{source:null,pricePlacement:e,showVehicleFitment:!0,heroLayout:r,imageRatio:_,textAlign:l,showSpecTable:!0,showPriceQuote:!0,galleryMode:E,imageFit:L,[o]:[]}};export{S as ProductHeroMeta,p as ProductHeroSlots};
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{SITE_WIDTH_CAP as h}from"efficient-web-builder/format/lib/content/page-width";import{resolveWidth as H}from"efficient-web-builder/format/lib/content/section-width";import L from"../../../../../components/LinkedProductHero.js";import m from"../../../../../components/pdp-dynamic/DynamicProductHero.js";import P from"../../../../../components/SectionNotice.js";import{trustBulletsRow as g,trustBulletsSlot as A}from"../../../../../components/product-hero/trust-bullets.js";import{TRUST_BULLETS_SLOT as R}from"../../../../sections/hero-trust-bullets.js";import{useCurrentProduct as F}from"../../../current-product.js";import{isEditorOnDynamicPage as y}from"efficient-web-builder/format/lib/document/editor-page-context";import{DEFAULT_HERO_PRICE_PLACEMENT as O,parseHeroPricePlacement as w}from"../../../../sections/hero-price-placement.js";import{DEFAULT_HERO_LAYOUT as D,DEFAULT_HERO_RATIO as I,DEFAULT_HERO_TEXT_ALIGN as U,parseHeroLayout as S,parseHeroRatio as p,parseHeroTextAlign as M}from"../../../../sections/hero-arrangement.js";import{DEFAULT_HERO_GALLERY_MODE as k,DEFAULT_HERO_IMAGE_FIT as x,parseHeroGalleryMode as B,parseHeroImageFit as C}from"../../../../sections/hero-gallery.js";import{say as G}from"efficient-web-builder/format/lib/editor-words";import{ProductHeroMeta as N}from"./meta.js";import{HideTaker as V}from"efficient-web-builder/render/components/ViewHideRoot";function b({source:e,editing:t=!1,pricePlacement:i=O,showVehicleFitment:o=!0,heroLayout:l=D,imageRatio:a=I,textAlign:u=U,showSpecTable:c=!0,showPriceQuote:d=!0,galleryMode:f=k,imageFit:s=x,trustBullets:E,nodeId:T,priceTemplate:_}){const n={heroLayout:l,imageRatio:a,textAlign:u,showSpecTable:c,showPriceQuote:d,galleryMode:f,imageFit:s,trustBullets:g(E,t),nodeId:T,priceTemplate:_};return F()||t&&y()?r(m,{editing:t,pricePlacement:i,showVehicleFitment:o,...n}):e?.slug?r(L,{slug:e.slug,kind:e.kind??"wheel",editing:t,pricePlacement:i,showVehicleFitment:o,...n}):t?r(P,{size:"tall",children:G("Pick a product in the panel to fill this hero.")}):r(m,{pricePlacement:i,showVehicleFitment:o,...n})}function j(e,t){return H(e,"full").mode!=="page"?t:r(V,{as:"div",style:{"--sf-content-cap":h},children:t})}const me={...N,render:e=>j(e,r(b,{source:e.source,editing:e.editor?.isEditing,pricePlacement:w(e.pricePlacement),showVehicleFitment:e.showVehicleFitment??!0,heroLayout:S(e.heroLayout),imageRatio:p(e.imageRatio),textAlign:M(e.textAlign),showSpecTable:e.showSpecTable??!0,showPriceQuote:e.showPriceQuote??!0,galleryMode:B(e.galleryMode),imageFit:C(e.imageFit),trustBullets:A(e[R]),nodeId:typeof e.id=="string"?e.id:void 0,priceTemplate:typeof e.template=="function"?e.template:void 0}))};export{me as ProductHeroRender};
1
+ import{jsx as r}from"react/jsx-runtime";import{SITE_WIDTH_CAP as L}from"efficient-web-builder/format/lib/content/page-width";import{resolveWidth as P}from"efficient-web-builder/format/lib/content/section-width";import g from"../../../../../components/LinkedProductHero.js";import m from"../../../../../components/pdp-dynamic/DynamicProductHero.js";import A from"../../../../../components/SectionNotice.js";import{trustBulletsRow as R,trustBulletsSlot as O}from"../../../../../components/product-hero/trust-bullets.js";import{TRUST_BULLETS_SLOT as y}from"../../../../sections/hero-trust-bullets.js";import{HERO_OPTION_SLOT as l}from"../../../../content/hero-option-seed.js";import{useCurrentProduct as F}from"../../../current-product.js";import{isEditorOnDynamicPage as w}from"efficient-web-builder/format/lib/document/editor-page-context";import{DEFAULT_HERO_PRICE_PLACEMENT as D,parseHeroPricePlacement as I}from"../../../../sections/hero-price-placement.js";import{DEFAULT_HERO_LAYOUT as S,DEFAULT_HERO_RATIO as U,DEFAULT_HERO_TEXT_ALIGN as p,parseHeroLayout as M,parseHeroRatio as k,parseHeroTextAlign as x}from"../../../../sections/hero-arrangement.js";import{DEFAULT_HERO_GALLERY_MODE as B,DEFAULT_HERO_IMAGE_FIT as C,parseHeroGalleryMode as G,parseHeroImageFit as N}from"../../../../sections/hero-gallery.js";import{say as V}from"efficient-web-builder/format/lib/editor-words";import{ProductHeroMeta as b}from"./meta.js";import{HideTaker as j}from"efficient-web-builder/render/components/ViewHideRoot";function v({source:e,editing:t=!1,pricePlacement:i=D,showVehicleFitment:o=!0,heroLayout:a=S,imageRatio:u=U,textAlign:c=p,showSpecTable:f=!0,showPriceQuote:d=!0,galleryMode:T=B,imageFit:s=C,trustBullets:E,nodeId:_,priceTemplate:H,optionTemplate:h}){const n={heroLayout:a,imageRatio:u,textAlign:c,showSpecTable:f,showPriceQuote:d,galleryMode:T,imageFit:s,trustBullets:R(E,t),nodeId:_,priceTemplate:H,optionTemplate:h};return F()||t&&w()?r(m,{editing:t,pricePlacement:i,showVehicleFitment:o,...n}):e?.slug?r(g,{slug:e.slug,kind:e.kind??"wheel",editing:t,pricePlacement:i,showVehicleFitment:o,...n}):t?r(A,{size:"tall",children:V("Pick a product in the panel to fill this hero.")}):r(m,{pricePlacement:i,showVehicleFitment:o,...n})}function Q(e,t){return P(e,"full").mode!=="page"?t:r(j,{as:"div",style:{"--sf-content-cap":L},children:t})}const ue={...b,render:e=>Q(e,r(v,{source:e.source,editing:e.editor?.isEditing,pricePlacement:I(e.pricePlacement),showVehicleFitment:e.showVehicleFitment??!0,heroLayout:M(e.heroLayout),imageRatio:k(e.imageRatio),textAlign:x(e.textAlign),showSpecTable:e.showSpecTable??!0,showPriceQuote:e.showPriceQuote??!0,galleryMode:G(e.galleryMode),imageFit:N(e.imageFit),trustBullets:O(e[y]),nodeId:typeof e.id=="string"?e.id:void 0,priceTemplate:typeof e.template=="function"?e.template:void 0,optionTemplate:typeof e[l]=="function"?e[l]:void 0}))};export{ue as ProductHeroRender};
@@ -1 +1 @@
1
- "use client";import{jsx as r}from"react/jsx-runtime";import o from"../../../../../components/card-pieces/HostPart.js";import{CardSpecFacts as c,CardSpecLine as d}from"../../../../../components/card-pieces/CardSpecs.js";import{useGridCard as n}from"../../../../../components/GridCardTemplate.js";import{ProductSpecsMeta as i}from"./meta.js";function a({sizes:e}){const{fieldUsage:t,fit:s}=n();return r(d,{children:r(c,{sizes:e,fieldUsage:t,car:s})})}const S={...i,render:e=>r(o,{label:i.label??"",editing:!!e.editor?.isEditing,children:r(a,{sizes:e.sizes===!0})})};export{S as ProductSpecsRender};
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import c from"../../../../../components/card-pieces/HostPart.js";import{CardSpecFacts as a,CardSpecLine as n}from"../../../../../components/card-pieces/CardSpecs.js";import{useGridCard as m}from"../../../../../components/GridCardTemplate.js";import{useProductCardState as l}from"../../../../../components/card-pieces/ProductCardState.js";import{ProductSpecsMeta as t}from"./meta.js";function f({sizes:e}){const{fieldUsage:i,tyreFieldUsage:o,fit:s}=m(),d=l().kind==="tyre";return r(n,{children:r(a,{sizes:e,fieldUsage:d?o:i,car:s})})}const x={...t,render:e=>r(c,{label:t.label??"",editing:!!e.editor?.isEditing,children:r(f,{sizes:e.sizes===!0})})};export{x as ProductSpecsRender};
@@ -1 +1 @@
1
- import{CARD_ROW_FIELD_PROP as h,CARD_ROW_LINK_PROP as g,registerCardTemplates as D}from"efficient-web-builder/format/lib/content/card-template";import{DIM as o,INNER_BOX as a,TEXT as s,boxPadding as d,fillSlot as w,labelLook as N,labelStyle as B,seedNodes as A,token as p}from"efficient-web-builder/format/lib/document/seed-parts";import{BOX_TYPE as i,CONTAINER_BLOCKS_SLOT as n}from"efficient-web-builder/format/lib/document/container-blocks";import{BOX_ROW_IMAGE_PROP as F}from"efficient-web-builder/format/lib/content/box-card-rule";import{POST_CARD_HEIGHT as I}from"efficient-web-builder/format/lib/post-card-layout";import{EVENTS_FEATURED_DARKEN as K,EVENTS_FEATURED_DARKEN_STYLE as P,EVENTS_FEATURED_PLACEMENT as U}from"../content/events-featured-look.js";import{SH_LINK as H}from"efficient-web-builder/render/lib/document/blocks/general/section-to-box-row-parts";import{rowFieldTextSeed as l}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{withRelatedTabletColumns as b}from"../sections/product-grid-columns.js";import{bundleColumns as x}from"../sections/bundle-to-grid.js";import{HERO_PRICE_BLOCK as M,withHeroPriceTemplate as V}from"../content/hero-price-seed.js";import{CARD_LIST_TYPE as E}from"efficient-web-builder/format/lib/content/card-template";import{FILTER_OPTIONS_FIELD as v,withFilterChipsTemplate as W,withFilterTemplate as G}from"../content/filter-card-seed.js";import{MENU_LINK_BLOCK as Y,withMenuTemplate as $}from"../content/menu-card-seed.js";import{ARTICLE_BODY_BLOCK as X,withArticleBodyTemplate as j}from"../content/article-body-seed.js";import{PRODUCT_BUY_BLOCK as z,PRODUCT_CARD_FIELDS as q,PRODUCT_COLOUR_BLOCK as Q,PRODUCT_EYEBROW_BLOCK as Z,PRODUCT_NAME_BLOCK as J,PRODUCT_PICTURE_BLOCK as ee,PRODUCT_PRICE_BLOCK as te,PRODUCT_SIZE_BLOCK as le,PRODUCT_SPECS_BLOCK as oe,productCardSeed as ae,withKitCardTemplate as m,withListingCardTemplate as ie,withProductCardTemplate as T}from"../content/product-card-seed.js";const u="tags",r=N(12),O={textStyle:"heading-3",...p("headingSmall",20),weight:500,lineHeight:1.2,letterSpacing:-.02},C={textStyle:"body-1",...p("body",14),lineHeight:1.55},ne={...O,...p("headingSmall",30)},re={sectionPaddingTop:24,sectionPaddingRight:28,sectionPaddingBottom:32,sectionPaddingLeft:28,sectionPaddingTopPhone:24,sectionPaddingRightPhone:28,sectionPaddingBottomPhone:32,sectionPaddingLeftPhone:28},se=I.fallback,de=480,ce=70,pe=()=>({type:i,props:{...a,name:"Featured",[F]:"cover",darken:K,darkenStyle:P,darkenPhone:ce,darkenStylePhone:P,placement:U,direction:"column",gap:8,gapPhone:8,...d(32,32,20,20),sectionHeightMode:"fixed",sectionHeightValue:se,sectionHeightUnit:"px",sectionHeightModePhone:"fixed",sectionHeightValuePhone:de,sectionHeightUnitPhone:"px",[g]:"href"},slots:{[n]:[l("meta",{...s,tag:"p"},r,!0),l("title",{...s,tag:"h3",widthFit:"fill"},ne),l("excerpt",{...o,tag:"p",widthFit:"fill",maxWidth:384},C),l("dateLabel",{...o,tag:"p"},{...r,color:"muted"})]}}),be=()=>({type:i,props:{...a,name:"Post",gap:0,gapPhone:0,...d(0,0,0,0),...w("surface"),shadow:!0},slots:{[n]:[{type:"ImageBlock",props:{[h]:"cover",aspect:"16/10",contained:!1}},{type:i,props:{...a,name:"Words",gap:12,gapPhone:12,...re},slots:{[n]:[{type:i,props:{...a,name:"Meta",direction:"row",wrap:!0,share:"content",sharePhone:"content",phoneRow:2,gap:12,gapPhone:12,...d(0,0,0,0)},slots:{[n]:[l("meta",{...s,tag:"p"},r,!0),l("dateLabel",{...o,tag:"p"},{...r,color:"muted"},!0)]}},l("title",{...s,tag:"h3",widthFit:"fill"},O),l("excerpt",{...o,tag:"p",widthFit:"fill"},C),{type:E,props:{[h]:u},slots:{template:[{type:i,props:{...a,name:"Chip",...d(4,8,4,8),sectionBorder:{width:1}},slots:{[n]:[l("label",{...o,tag:"p"},r)]}}]}},{type:"ButtonBlock",props:{variant:"ghost",label:"Read more",href:"",[g]:"href",...H,icon:"arrow-right",iconPosition:"after",_partStyles:{label:B(12)}}}]}}]}}),Ee=()=>[pe(),be()];function me(e){if(e.template!==void 0)return e;const t=typeof e.id=="string"&&e.id.trim()?e.id:"Events",L=["featured","post"];return{...e,template:A(Ee(),(he,S)=>{const[_,...k]=S.split("."),y=L[Number(_)]??`card${_}`;return k.length?`${t}~${y}.${k.join(".")}`:`${t}~${y}`})}}const Te={fields:[{key:"cover",label:"Cover",kind:"image",alt:"title"},{key:"meta",label:"Eyebrow"},{key:"dateLabel",label:"Date"},{key:"title",label:"Title"},{key:"excerpt",label:"Excerpt",multiline:!0},{key:"href",label:"Link",kind:"link"},{key:u,label:"Tags",kind:"list",fields:[{key:"label",label:"Tag"}]}],blocks:[{type:E,label:"Card list"}],seedOnInsert:me},_e=["showCardPrice","showCardFinishes","showCardSizes","showCardBuy","showCardPage"],ke=e=>Object.fromEntries(Object.entries(e).filter(([t])=>!_e.includes(t))),R={fields:[{key:"label",label:"Label"},{key:"href",label:"Link",kind:"link"}],blocks:[{type:Y,label:"Menu link"}],seed:$},f=e=>e.dynamic===!0&&e.relationship==="bundles",Ke=(e={})=>ae(e),c={fields:q,blocks:[{type:ee,label:"Picture"},{type:Z,label:"Eyebrow"},{type:J,label:"Name"},{type:oe,label:"Specs"},{type:te,label:"Price"},{type:Q,label:"Colour"},{type:le,label:"Size"},{type:z,label:"Buy"}],seed:e=>{if(e.dynamic!==!0)return T(e);const t=b(e);return f(e)?m(t):T(t)}},ye=[{block:"Reviews",fields:[{key:"quote",label:"Quote"},{key:"title",label:"Title"},{key:"name",label:"Name"},{key:"role",label:"Role · location"},{key:"rating",label:"Rating"},{key:"dateLabel",label:"Date"}],blocks:[{type:"RatingBlock",label:"Rating"}]},{block:"SpecTable",fields:[{key:"label",label:"Label"},{key:"value",label:"Value"}]},{block:"DetailRows",fields:[{key:"eyebrow",label:"Eyebrow"},{key:"title",label:"Title"},{key:"copy",label:"Body",multiline:!0},{key:"image",label:"Image",kind:"image",alt:"title"},{key:"tag",label:"Image tag"}]},{block:"FooterMenu",...R},{block:"MenuBlock",...R},{block:"ProductGrid",...c},{block:"AlloyWheelsListing",...c,seed:ie},{block:"RelatedProducts",...c,seed:e=>{const t=b({...ke(e),dynamic:!0});return f(t)?m(t):T(t,{legacyWellHonoured:!0})}},{block:"BundleOffer",...c,seed:e=>m(b({...e,columns:x(e),dynamic:!0}))},{block:"ProductHero",fields:[],blocks:[{type:M,label:"Price"}],seed:V},{block:"FilterBlock",fields:[{key:"label",label:"Filter name"},{key:v,label:"Options",kind:"list",fields:[{key:"label",label:"Option"},{key:"count",label:"Count"}]}],blocks:[{type:E,label:"Card list"}],seed:G},{block:"FilterChipsBlock",fields:[{key:"label",label:"Pick"},{key:"mark",label:"Remove mark"}],seed:W},{block:X,fields:[{key:"heading",label:"Subhead"},{key:"paragraph",label:"Paragraph",multiline:!0}],seed:j},{block:"Events",...Te}];D(ye);export{ye as STOREFRONT_CARD_TEMPLATES,f as drawsKits,Ee as eventsCardSeeds,Ke as productGridCardSeed,me as withEventsTemplate};
1
+ import{CARD_ROW_FIELD_PROP as h,CARD_ROW_LINK_PROP as O,registerCardTemplates as D}from"efficient-web-builder/format/lib/content/card-template";import{DIM as o,INNER_BOX as a,TEXT as s,boxPadding as d,fillSlot as N,labelLook as w,labelStyle as B,seedNodes as A,token as E}from"efficient-web-builder/format/lib/document/seed-parts";import{BOX_TYPE as i,CONTAINER_BLOCKS_SLOT as n}from"efficient-web-builder/format/lib/document/container-blocks";import{BOX_ROW_IMAGE_PROP as I}from"efficient-web-builder/format/lib/content/box-card-rule";import{POST_CARD_HEIGHT as F}from"efficient-web-builder/format/lib/post-card-layout";import{EVENTS_FEATURED_DARKEN as H,EVENTS_FEATURED_DARKEN_STYLE as P,EVENTS_FEATURED_PLACEMENT as K}from"../content/events-featured-look.js";import{SH_LINK as U}from"efficient-web-builder/render/lib/document/blocks/general/section-to-box-row-parts";import{rowFieldTextSeed as l}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{withRelatedTabletColumns as p}from"../sections/product-grid-columns.js";import{bundleColumns as M}from"../sections/bundle-to-grid.js";import{HERO_PRICE_BLOCK as x,withHeroPriceTemplate as V}from"../content/hero-price-seed.js";import{HERO_OPTION_FIELDS as v,HERO_OPTION_SLOT as W,HERO_OPTION_SLOT_LABEL as G,withHeroOptionTemplate as Y}from"../content/hero-option-seed.js";import{CARD_LIST_TYPE as b,CARD_TEMPLATE_SLOT as $}from"efficient-web-builder/format/lib/content/card-template";import{FILTER_OPTIONS_FIELD as X,withFilterChipsTemplate as j,withFilterTemplate as z}from"../content/filter-card-seed.js";import{MENU_LINK_BLOCK as q,withMenuTemplate as Q}from"../content/menu-card-seed.js";import{ARTICLE_BODY_BLOCK as Z,withArticleBodyTemplate as J}from"../content/article-body-seed.js";import{PRODUCT_BUY_BLOCK as ee,PRODUCT_CARD_FIELDS as te,PRODUCT_COLOUR_BLOCK as le,PRODUCT_EYEBROW_BLOCK as oe,PRODUCT_NAME_BLOCK as ae,PRODUCT_PICTURE_BLOCK as ie,PRODUCT_PRICE_BLOCK as ne,PRODUCT_SIZE_BLOCK as re,PRODUCT_SPECS_BLOCK as se,productCardSeed as de,withKitCardTemplate as m,withListingCardTemplate as ce,withProductCardTemplate as T}from"../content/product-card-seed.js";const g="tags",r=w(12),u={textStyle:"heading-3",...E("headingSmall",20),weight:500,lineHeight:1.2,letterSpacing:-.02},R={textStyle:"body-1",...E("body",14),lineHeight:1.55},Ee={...u,...E("headingSmall",30)},pe={sectionPaddingTop:24,sectionPaddingRight:28,sectionPaddingBottom:32,sectionPaddingLeft:28,sectionPaddingTopPhone:24,sectionPaddingRightPhone:28,sectionPaddingBottomPhone:32,sectionPaddingLeftPhone:28},be=F.fallback,me=480,Te=70,_e=()=>({type:i,props:{...a,name:"Featured",[I]:"cover",darken:H,darkenStyle:P,darkenPhone:Te,darkenStylePhone:P,placement:K,direction:"column",gap:8,gapPhone:8,...d(32,32,20,20),sectionHeightMode:"fixed",sectionHeightValue:be,sectionHeightUnit:"px",sectionHeightModePhone:"fixed",sectionHeightValuePhone:me,sectionHeightUnitPhone:"px",[O]:"href"},slots:{[n]:[l("meta",{...s,tag:"p"},r,!0),l("title",{...s,tag:"h3",widthFit:"fill"},Ee),l("excerpt",{...o,tag:"p",widthFit:"fill",maxWidth:384},R),l("dateLabel",{...o,tag:"p"},{...r,color:"muted"})]}}),ke=()=>({type:i,props:{...a,name:"Post",gap:0,gapPhone:0,...d(0,0,0,0),...N("surface"),shadow:!0},slots:{[n]:[{type:"ImageBlock",props:{[h]:"cover",aspect:"16/10",contained:!1}},{type:i,props:{...a,name:"Words",gap:12,gapPhone:12,...pe},slots:{[n]:[{type:i,props:{...a,name:"Meta",direction:"row",wrap:!0,share:"content",sharePhone:"content",phoneRow:2,gap:12,gapPhone:12,...d(0,0,0,0)},slots:{[n]:[l("meta",{...s,tag:"p"},r,!0),l("dateLabel",{...o,tag:"p"},{...r,color:"muted"},!0)]}},l("title",{...s,tag:"h3",widthFit:"fill"},u),l("excerpt",{...o,tag:"p",widthFit:"fill"},R),{type:b,props:{[h]:g},slots:{template:[{type:i,props:{...a,name:"Chip",...d(4,8,4,8),sectionBorder:{width:1}},slots:{[n]:[l("label",{...o,tag:"p"},r)]}}]}},{type:"ButtonBlock",props:{variant:"ghost",label:"Read more",href:"",[O]:"href",...U,icon:"arrow-right",iconPosition:"after",_partStyles:{label:B(12)}}}]}}]}}),ye=()=>[_e(),ke()];function he(e){if(e.template!==void 0)return e;const t=typeof e.id=="string"&&e.id.trim()?e.id:"Events",f=["featured","post"];return{...e,template:A(ye(),(Re,S)=>{const[_,...k]=S.split("."),y=f[Number(_)]??`card${_}`;return k.length?`${t}~${y}.${k.join(".")}`:`${t}~${y}`})}}const Oe={fields:[{key:"cover",label:"Cover",kind:"image",alt:"title"},{key:"meta",label:"Eyebrow"},{key:"dateLabel",label:"Date"},{key:"title",label:"Title"},{key:"excerpt",label:"Excerpt",multiline:!0},{key:"href",label:"Link",kind:"link"},{key:g,label:"Tags",kind:"list",fields:[{key:"label",label:"Tag"}]}],blocks:[{type:b,label:"Card list"}],seedOnInsert:he},Pe=["showCardPrice","showCardFinishes","showCardSizes","showCardBuy","showCardPage"],ge=e=>Object.fromEntries(Object.entries(e).filter(([t])=>!Pe.includes(t))),C={fields:[{key:"label",label:"Label"},{key:"href",label:"Link",kind:"link"}],blocks:[{type:q,label:"Menu link"}],seed:Q},L=e=>e.dynamic===!0&&e.relationship==="bundles",ve=(e={})=>de(e),c={fields:te,blocks:[{type:ie,label:"Picture"},{type:oe,label:"Eyebrow"},{type:ae,label:"Name"},{type:se,label:"Specs"},{type:ne,label:"Price"},{type:le,label:"Colour"},{type:re,label:"Size"},{type:ee,label:"Buy"}],seed:e=>{if(e.dynamic!==!0)return T(e);const t=p(e);return L(e)?m(t):T(t)}},ue=[{block:"Reviews",fields:[{key:"quote",label:"Quote"},{key:"title",label:"Title"},{key:"name",label:"Name"},{key:"role",label:"Role · location"},{key:"rating",label:"Rating"},{key:"dateLabel",label:"Date"}],blocks:[{type:"RatingBlock",label:"Rating"}]},{block:"SpecTable",fields:[{key:"label",label:"Label"},{key:"value",label:"Value"}]},{block:"DetailRows",fields:[{key:"eyebrow",label:"Eyebrow"},{key:"title",label:"Title"},{key:"copy",label:"Body",multiline:!0},{key:"image",label:"Image",kind:"image",alt:"title"},{key:"tag",label:"Image tag"}]},{block:"FooterMenu",...C},{block:"MenuBlock",...C},{block:"ProductGrid",...c},{block:"AlloyWheelsListing",...c,seed:ce},{block:"RelatedProducts",...c,seed:e=>{const t=p({...ge(e),dynamic:!0});return L(t)?m(t):T(t,{legacyWellHonoured:!0})}},{block:"BundleOffer",...c,seed:e=>m(p({...e,columns:M(e),dynamic:!0}))},{block:"ProductHero",slots:[{slot:$},{slot:W,label:G}],fields:v,blocks:[{type:x,label:"Price"}],seed:e=>Y(V(e))},{block:"FilterBlock",fields:[{key:"label",label:"Filter name"},{key:X,label:"Options",kind:"list",fields:[{key:"label",label:"Option"},{key:"count",label:"Count"}]}],blocks:[{type:b,label:"Card list"}],seed:z},{block:"FilterChipsBlock",fields:[{key:"label",label:"Pick"},{key:"mark",label:"Remove mark"}],seed:j},{block:Z,fields:[{key:"heading",label:"Subhead"},{key:"paragraph",label:"Paragraph",multiline:!0}],seed:J},{block:"Events",...Oe}];D(ue);export{ue as STOREFRONT_CARD_TEMPLATES,L as drawsKits,ye as eventsCardSeeds,ve as productGridCardSeed,he as withEventsTemplate};
@@ -34,4 +34,18 @@ export declare function filterOptionSelected(state: PlpFilterState, key: FilterG
34
34
  export declare function filterGroupItems(groups: readonly FacetLike[], state: PlpFilterState, inStock: number | null): FilterGroupItem[];
35
35
  export declare function filterChipItems(state: PlpFilterState, currency: Parameters<typeof plpActiveChips>[1], formatMoney: Parameters<typeof plpActiveChips>[2]): FilterChipItem[];
36
36
  export declare function filterStateWithoutChip(state: PlpFilterState, chip: Pick<FilterChipItem, "key" | "value">): PlpFilterState;
37
+ export interface OptionCardRows<I> {
38
+ items: I[];
39
+ states: {
40
+ selected: boolean;
41
+ }[];
42
+ actions: {
43
+ press: () => void;
44
+ }[];
45
+ }
46
+ export declare function optionCardRows<T, I>(options: readonly T[], { item, selected, press }: {
47
+ item: (option: T, index: number) => I;
48
+ selected: (option: T, index: number) => boolean;
49
+ press: (option: T, index: number) => () => void;
50
+ }): OptionCardRows<I>;
37
51
  export {};
@@ -1 +1 @@
1
- import{plpActiveChips as a}from"../wheels/plp-filters.js";import{STOCK_WORDS as s}from"../content/stock-words.js";const i="inStock",c="Availability",p="price";function o(n,e,t){if(e===i)return n.inStockOnly===!0;if(e===p)return!1;if(e==="lugs")return(n.lugs??[]).map(String).includes(t);const r=n[e];return Array.isArray(r)&&r.map(String).includes(t)}function k(n,e,t){const r=n.map(l=>({key:l.key,label:l.label,options:l.options.map(u=>({value:u.value,label:u.label,count:String(u.count),state:{selected:o(e,l.key,u.value)}}))}));return t!==null&&r.push({key:i,label:c,options:[{value:i,label:s.inStock,count:String(t),state:{selected:o(e,i,i)}}]}),r}function m(n,e,t){return a(n,e,t).map(r=>({key:r.key,value:String(r.value),label:r.label}))}function y(n,e){const t={...n,page:1};switch(e.key){case"price":return{...t,priceMax:null};case"priceMin":return{...t,priceMin:null};case"inStock":return{...t,inStockOnly:!1};case"kind":return{...t,kind:null};case"lugs":return{...t,lugs:(n.lugs??[]).filter(r=>String(r)!==e.value)};default:{const r=n[e.key].filter(l=>String(l)!==e.value);return{...t,[e.key]:r}}}}export{i as FILTER_IN_STOCK_KEY,c as FILTER_IN_STOCK_LABEL,p as FILTER_PRICE_KEY,m as filterChipItems,k as filterGroupItems,o as filterOptionSelected,y as filterStateWithoutChip};
1
+ import{plpActiveChips as o}from"../wheels/plp-filters.js";import{STOCK_WORDS as s}from"../content/stock-words.js";const u="inStock",c="Availability",p="price";function a(r,e,t){if(e===u)return r.inStockOnly===!0;if(e===p)return!1;if(e==="lugs")return(r.lugs??[]).map(String).includes(t);const n=r[e];return Array.isArray(n)&&n.map(String).includes(t)}function m(r,e,t){const n=r.map(l=>({key:l.key,label:l.label,options:l.options.map(i=>({value:i.value,label:i.label,count:String(i.count),state:{selected:a(e,l.key,i.value)}}))}));return t!==null&&n.push({key:u,label:c,options:[{value:u,label:s.inStock,count:String(t),state:{selected:a(e,u,u)}}]}),n}function k(r,e,t){return o(r,e,t).map(n=>({key:n.key,value:String(n.value),label:n.label}))}function y(r,e){const t={...r,page:1};switch(e.key){case"price":return{...t,priceMax:null};case"priceMin":return{...t,priceMin:null};case"inStock":return{...t,inStockOnly:!1};case"kind":return{...t,kind:null};case"lugs":return{...t,lugs:(r.lugs??[]).filter(n=>String(n)!==e.value)};default:{const n=r[e.key].filter(l=>String(l)!==e.value);return{...t,[e.key]:n}}}}function d(r,{item:e,selected:t,press:n}){return{items:r.map(e),states:r.map((l,i)=>({selected:t(l,i)})),actions:r.map((l,i)=>({press:n(l,i)}))}}export{u as FILTER_IN_STOCK_KEY,c as FILTER_IN_STOCK_LABEL,p as FILTER_PRICE_KEY,k as filterChipItems,m as filterGroupItems,a as filterOptionSelected,y as filterStateWithoutChip,d as optionCardRows};
@@ -1,9 +1,9 @@
1
1
  import { type GalleryLayoutKey } from "efficient-web-builder/format/lib/content/gallery-layout";
2
- import { type HoverMediaKind } from "efficient-web-builder/format/lib/animation/hover";
2
+ import { type MediaZone } from "efficient-easel/screen/lib/content/media-zones";
3
3
  import type { ProductSourceOptions } from "./product-source.js";
4
4
  export declare const PRODUCT_PICTURES_SOURCE = "product-pictures";
5
5
  export declare const EVERY_IMAGE_ZONE = "all";
6
- export type ImageZone = Exclude<HoverMediaKind, "renderings">;
6
+ export type ImageZone = Exclude<MediaZone, "rendering" | "videos">;
7
7
  export declare const IMAGE_ZONES: readonly ImageZone[];
8
8
  export interface ProductPicturesOptions extends ProductSourceOptions {
9
9
  mediaZone?: string;
@@ -1 +1 @@
1
- import{sourcedRows as E}from"efficient-web-builder/format/lib/content/block-sources";import{say as s}from"efficient-web-builder/format/lib/editor-words";import{resolveGalleryLayout as _}from"efficient-web-builder/format/lib/content/gallery-layout";import{HOVER_MEDIA_KINDS as O}from"efficient-web-builder/format/lib/animation/hover";import{servedListOf as P,servedRowLists as R,servedWords as T}from"../content/served-lists.js";const U="product-pictures",b="all",D=O.filter(e=>e!=="renderings"),S="twoThenThreesPhoto";function G(e){const o=typeof e.layout=="string"&&e.layout?e.layout:void 0;return o&&_(o)||e.columns!=null&&e.columns!==""?o:S}const x=12,A=4,I=e=>Array.from({length:e},(o,n)=>({key:`sample-${n+1}`,process:s("Category"),eyebrow:s("Vehicle"),name:s("Product name"),meta:s("Finish")}));function N(e,o,n){const c=typeof n=="number"&&n>0?Math.floor(n):void 0,{rows:p,sample:f}=E(e,o,I(c??A)),y=f?null:R(e,t=>T(t.photos,x)),l=new Set,u=[];return p.forEach((t,m)=>{const r=t.cover??"";if(!f&&!r)return;const a=t.key||`row-${m+1}`;if(l.has(a))return;l.add(a);const i=P(y,t,m)??[],h=i[0]===r?i.slice(1):i.filter(d=>d!==r);u.push({image:r,photos:h.map(d=>({src:d})),href:t.href||void 0,process:t.process||void 0,eyebrow:t.eyebrow||void 0,name:t.name||void 0,meta:t.meta||void 0,tile:{id:a,tag:t.process??"",name:t.name??""}})}),c?u.slice(0,c):u}export{b as EVERY_IMAGE_ZONE,D as IMAGE_ZONES,S as PRODUCT_PICTURES_LAYOUT,U as PRODUCT_PICTURES_SOURCE,N as productPictureTiles,G as productPicturesLayout};
1
+ import{sourcedRows as E}from"efficient-web-builder/format/lib/content/block-sources";import{say as s}from"efficient-web-builder/format/lib/editor-words";import{resolveGalleryLayout as _}from"efficient-web-builder/format/lib/content/gallery-layout";import{MEDIA_ZONES as O}from"efficient-easel/screen/lib/content/media-zones";import{servedListOf as P,servedRowLists as T,servedWords as R}from"../content/served-lists.js";const U="product-pictures",b="all",D=O.filter(e=>e!=="rendering"&&e!=="videos"),S="twoThenThreesPhoto";function G(e){const o=typeof e.layout=="string"&&e.layout?e.layout:void 0;return o&&_(o)||e.columns!=null&&e.columns!==""?o:S}const v=12,x=4,A=e=>Array.from({length:e},(o,n)=>({key:`sample-${n+1}`,process:s("Category"),eyebrow:s("Vehicle"),name:s("Product name"),meta:s("Finish")}));function N(e,o,n){const c=typeof n=="number"&&n>0?Math.floor(n):void 0,{rows:p,sample:f}=E(e,o,A(c??x)),y=f?null:T(e,t=>R(t.photos,v)),l=new Set,u=[];return p.forEach((t,m)=>{const r=t.cover??"";if(!f&&!r)return;const i=t.key||`row-${m+1}`;if(l.has(i))return;l.add(i);const a=P(y,t,m)??[],h=a[0]===r?a.slice(1):a.filter(d=>d!==r);u.push({image:r,photos:h.map(d=>({src:d})),href:t.href||void 0,process:t.process||void 0,eyebrow:t.eyebrow||void 0,name:t.name||void 0,meta:t.meta||void 0,tile:{id:i,tag:t.process??"",name:t.name??""}})}),c?u.slice(0,c):u}export{b as EVERY_IMAGE_ZONE,D as IMAGE_ZONES,S as PRODUCT_PICTURES_LAYOUT,U as PRODUCT_PICTURES_SOURCE,N as productPictureTiles,G as productPicturesLayout};
@@ -22,7 +22,10 @@ export declare function hydrateFieldUsage(data: Data, answers: readonly FieldUsa
22
22
  export declare function listingCatalogKinds(data: Data | null | undefined): ProductKind[];
23
23
  export declare function listingCatalogBound(data: Data | null | undefined): number | undefined;
24
24
  export declare function listingWantsWheelsOnly(kinds: readonly ProductKind[]): boolean;
25
- export declare function hydrateWheelsListing(data: Data, products: ProductSummary[] | WheelSummary[]): Data;
25
+ export declare function hydrateWheelsListing(data: Data, products: ProductSummary[] | WheelSummary[], { everyHoverPhoto }?: HydrateOptions): Data;
26
+ export interface HydrateOptions {
27
+ everyHoverPhoto?: boolean;
28
+ }
26
29
  export declare function stampListingQuery(data: Data, query: string): Data;
27
30
  export declare function dehydrateWheelsListing(data: Data): Data;
28
31
  export declare function dehydrateWheelsListingNode<T extends ContentNode>(stamped: T): T;
@@ -1 +1 @@
1
- import{cardHoverOf as I}from"efficient-web-builder/format/lib/animation/hover";import{resolvePlpKinds as k}from"../catalog/plp-item.js";import{gridPagingOf as W}from"../sections/product-grid-pages.js";import{gridKindsOf as L,gridRowsOf as C,isAllProductsSource as N,isLinkedSource as U}from"./grid-source.js";import{FILTER_BLOCK_TYPE as O,PRODUCT_GRID_TYPE as R,documentNodes as v,mapDocumentNodes as D}from"../document/document-nodes.js";import{selectedRangesOf as H,stripSelectedRanges as h}from"./selected-ranges.js";import{withShopperFirstPaint as Y,withoutShopperFirstPaint as B,withoutShopperFirstPaintNode as T}from"./shopper-first-paint.js";const u="AlloyWheelsListing",m="catalog",w="catalogTotal",K=12,M="CatalogFilterBar",f="fieldUsage",S="requestQuery";function l(e){return e.props?.source}function i(e){return e?.type===R&&U(l(e))}function a(e){return e?.type===M||e?.type===O}function A(e,r){if(r)return;const{limit:t,cap:n}=W(e.props??{});return n?Math.ceil(t)+K:void 0}function _(e){return e?.type===u||i(e)||a(e)}const c=e=>v(e);function Q(e){return e?c(e).some(r=>r?.type===u||i(r)):!1}function te(e){return e?Q(e)||c(e).some(r=>T(r)!==r)||h(e)!==e:!1}function re(e){return e?c(e).some(_):!1}function ne(e,r){return r.length===0?e:g(e,_,t=>({...t,props:{...t.props??{},[f]:r}}))}function q(e){if(!e)return[];const r=new Set;for(const t of c(e)){if(t?.type!==u&&!i(t))continue;const n=t.props?.kinds;for(const o of i(t)?L(l(t),n):k(n))r.add(o)}return[...r]}function oe(e){if(!e)return;const r=c(e);if(r.some(a))return;const t=q(e).length;let n;for(const o of r){if(o?.type===u)return;if(!i(o))continue;const s=A(o,!1),p=o.props??{},d=new Set(L(l(o),p.kinds)),E=["num","title","description","linkText"].some(x=>typeof p[x]=="string"&&p[x]!=="");if(s===void 0||!N(l(o))||d.size!==t||E)return;n=Math.max(n??0,s)}return n}function se(e){return e.length===1&&e[0]==="alloy-wheel"}function ie(e,r){const t=H(e.root?.props),n=c(e).some(a);return Y(b(e,o=>i(o)?z(o,r,A(o,n)):{...o,props:{...y(o).props,products:F(o,r)}}),t)}function F(e,r){const t=I(e.props??{},e.type??""),n=t.kind==="nextImage"&&t.media&&t.media.kind!=="renderings"?t.media.kind:null;return r.map(o=>{const{hoverMedia:s,...p}=o;return s===void 0?o:n&&s?.[n]?{...p,hoverMedia:{[n]:s[n]}}:p})}function z(e,r,t){const n=F(e,C(l(e),e.props?.kinds,r)),o={...P(e).props};return t!==void 0&&n.length>t?(o[m]=n.slice(0,t),o[w]=n.length):o[m]=n,{...e,props:o}}function pe(e,r){const t=r.replace(/^\?/,"");return t?g(e,n=>n?.type===u,n=>({...n,props:{...n.props??{},[S]:t}})):e}function ue(e){return B(g(h(e),_,r=>a(r)?G(r):i(r)?P(r):y(r)))}function G(e){if(!e.props||!(f in e.props))return e;const{[f]:r,...t}=e.props;return{...e,props:t}}function P(e){const{[m]:r,[w]:t,[f]:n,...o}=e.props??{},s=o.source;if(s&&"wheels"in s){const{wheels:p,...d}=s;o.source=d}return{...e,props:o}}function ce(e){const r=h({content:[e]}).content[0],t=T(r);return i(t)?P(t):a(t)?G(t):t?.type===u?y(t):t}function y(e){const{wheels:r,products:t,[f]:n,[S]:o,...s}=e.props??{};return{...e,props:s}}function b(e,r){return g(e,t=>t?.type===u||i(t),r)}function g(e,r,t){return D(e,n=>r(n)?t(n):n)}export{u as ALLOY_WHEELS_LISTING_TYPE,M as CATALOG_FILTER_BAR_TYPE,f as FIELD_USAGE_PROP,O as FILTER_BLOCK_TYPE,m as GRID_CATALOG_PROP,w as GRID_CATALOG_TOTAL_PROP,K as GRID_TOP_UP_SPARE,S as LISTING_QUERY_PROP,R as PRODUCT_GRID_TYPE,ue as dehydrateWheelsListing,ce as dehydrateWheelsListingNode,ne as hydrateFieldUsage,ie as hydrateWheelsListing,oe as listingCatalogBound,q as listingCatalogKinds,se as listingWantsWheelsOnly,te as pageHasHydratedValues,Q as pageHasWheelsListing,re as pageReadsFieldUsage,pe as stampListingQuery};
1
+ import{cardHoverOf as G}from"efficient-web-builder/format/lib/animation/hover";import{resolvePlpKinds as k}from"../catalog/plp-item.js";import{gridPagingOf as I}from"../sections/product-grid-pages.js";import{gridKindsOf as L,gridRowsOf as W,isAllProductsSource as v,isLinkedSource as C}from"./grid-source.js";import{FILTER_BLOCK_TYPE as O,PRODUCT_GRID_TYPE as R,documentNodes as N,mapDocumentNodes as U}from"../document/document-nodes.js";import{selectedRangesOf as D,stripSelectedRanges as h}from"./selected-ranges.js";import{withShopperFirstPaint as H,withoutShopperFirstPaint as Y,withoutShopperFirstPaintNode as T}from"./shopper-first-paint.js";const u="AlloyWheelsListing",m="catalog",w="catalogTotal",B=12,K="CatalogFilterBar",f="fieldUsage",S="requestQuery";function l(e){return e.props?.source}function p(e){return e?.type===R&&C(l(e))}function a(e){return e?.type===K||e?.type===O}function A(e,r){if(r)return;const{limit:t,cap:n}=I(e.props??{});return n?Math.ceil(t)+B:void 0}function _(e){return e?.type===u||p(e)||a(e)}const c=e=>N(e);function M(e){return e?c(e).some(r=>r?.type===u||p(r)):!1}function re(e){return e?M(e)||c(e).some(r=>T(r)!==r)||h(e)!==e:!1}function ne(e){return e?c(e).some(_):!1}function oe(e,r){return r.length===0?e:d(e,_,t=>({...t,props:{...t.props??{},[f]:r}}))}function Q(e){if(!e)return[];const r=new Set;for(const t of c(e)){if(t?.type!==u&&!p(t))continue;const n=t.props?.kinds;for(const o of p(t)?L(l(t),n):k(n))r.add(o)}return[...r]}function se(e){if(!e)return;const r=c(e);if(r.some(a))return;const t=Q(e).length;let n;for(const o of r){if(o?.type===u)return;if(!p(o))continue;const s=A(o,!1),i=o.props??{},g=new Set(L(l(o),i.kinds)),F=["num","title","description","linkText"].some(x=>typeof i[x]=="string"&&i[x]!=="");if(s===void 0||!v(l(o))||g.size!==t||F)return;n=Math.max(n??0,s)}return n}function ie(e){return e.length===1&&e[0]==="alloy-wheel"}function pe(e,r,{everyHoverPhoto:t=!1}={}){const n=D(e.root?.props),o=c(e).some(a),s=t?q:z;return H(V(e,i=>p(i)?b(i,r,A(i,o),s):{...i,props:{...y(i).props,products:s(i,r)}}),n)}const q=(e,r)=>[...r];function z(e,r){const t=G(e.props??{},e.type??""),n=t.kind==="nextImage"&&t.media&&t.media.kind!=="renderings"?t.media.kind:null;return r.map(o=>{const{hoverMedia:s,...i}=o;return s===void 0?o:n&&s?.[n]?{...i,hoverMedia:{[n]:s[n]}}:i})}function b(e,r,t,n){const o=n(e,W(l(e),e.props?.kinds,r)),s={...P(e).props};return t!==void 0&&o.length>t?(s[m]=o.slice(0,t),s[w]=o.length):s[m]=o,{...e,props:s}}function ue(e,r){const t=r.replace(/^\?/,"");return t?d(e,n=>n?.type===u,n=>({...n,props:{...n.props??{},[S]:t}})):e}function ce(e){return Y(d(h(e),_,r=>a(r)?E(r):p(r)?P(r):y(r)))}function E(e){if(!e.props||!(f in e.props))return e;const{[f]:r,...t}=e.props;return{...e,props:t}}function P(e){const{[m]:r,[w]:t,[f]:n,...o}=e.props??{},s=o.source;if(s&&"wheels"in s){const{wheels:i,...g}=s;o.source=g}return{...e,props:o}}function fe(e){const r=h({content:[e]}).content[0],t=T(r);return p(t)?P(t):a(t)?E(t):t?.type===u?y(t):t}function y(e){const{wheels:r,products:t,[f]:n,[S]:o,...s}=e.props??{};return{...e,props:s}}function V(e,r){return d(e,t=>t?.type===u||p(t),r)}function d(e,r,t){return U(e,n=>r(n)?t(n):n)}export{u as ALLOY_WHEELS_LISTING_TYPE,K as CATALOG_FILTER_BAR_TYPE,f as FIELD_USAGE_PROP,O as FILTER_BLOCK_TYPE,m as GRID_CATALOG_PROP,w as GRID_CATALOG_TOTAL_PROP,B as GRID_TOP_UP_SPARE,S as LISTING_QUERY_PROP,R as PRODUCT_GRID_TYPE,ce as dehydrateWheelsListing,fe as dehydrateWheelsListingNode,oe as hydrateFieldUsage,pe as hydrateWheelsListing,se as listingCatalogBound,Q as listingCatalogKinds,ie as listingWantsWheelsOnly,re as pageHasHydratedValues,M as pageHasWheelsListing,ne as pageReadsFieldUsage,ue as stampListingQuery};
package/dist/words.d.ts CHANGED
@@ -1371,6 +1371,7 @@ export type WebBuilderPhrase =
1371
1371
  | "What this card does when a shopper points at it, or taps it on a phone. Highlight fills it with the surface color and turns its text the main color."
1372
1372
  | "What this does when a shopper points at it, or taps it on a phone."
1373
1373
  | "What this picture does when a shopper points at it. Black and white shows it in grey until then. A phone shows its colour."
1374
+ | "What this picture does when a shopper points at the card. Show next image covers the card or the picture with this product's photos, with arrows; a phone shows the picture as it is. Black and white shows it in grey until then."
1374
1375
  | "What this picture does when a shopper points at the card. Show next image fades to the card's next photo. Black and white shows it in grey until then. A phone shows the first photo in colour."
1375
1376
  | "What we count."
1376
1377
  | "WhatsApp"
@@ -1747,6 +1748,7 @@ export type StorefrontBlocksPhrase =
1747
1748
  | "Frequency options"
1748
1749
  | "From our *customers.*"
1749
1750
  | "Gallery A"
1751
+ | "Gallery A comes from the product’s Lifestyle photos, Gallery B from its Product photos and the Others gallery from its Others — edit those in the product’s Media tab and refresh. Each media group is a card: the car set on the group is the eyebrow (a card keeps its caption when the group has no car), its finish the meta line; the card’s title is the product name and its tag the category. Headings, intro copy and stats stay yours."
1750
1752
  | "Gallery A comes from the product’s Relative / lifestyle photos, Gallery B from its Product photos and the Others gallery from its Others — edit those in the product’s Media tab and refresh. Each media group is a card: its name is the eyebrow, its finish the meta line; the card’s title is the product name and its tag the category. Headings, intro copy and stats stay yours."
1751
1753
  | "Gallery A comes from the product’s Relative / lifestyle photos, Gallery B from its Product photos and the Others gallery from its Others — edit those in the product’s Media tab and refresh. Each media group is a card: the car set on the group is the eyebrow (a card keeps its caption when the group has no car), its finish the meta line; the card’s title is the product name and its tag the category. Headings, intro copy and stats stay yours."
1752
1754
  | "Gallery B"
@@ -1929,6 +1931,7 @@ export type StorefrontBlocksPhrase =
1929
1931
  | "Open now badge"
1930
1932
  | "Opening sort"
1931
1933
  | "Option label"
1934
+ | "Option template"
1932
1935
  | "Options"
1933
1936
  | "Others gallery"
1934
1937
  | "Outside"
@@ -1958,6 +1961,7 @@ export type StorefrontBlocksPhrase =
1958
1961
  | "Picture fit"
1959
1962
  | "Pills"
1960
1963
  | "Pinning one overrides the section’s Cover image."
1964
+ | "Pools every product’s grouped media: each one’s Lifestyle photos feed Gallery A, its Product photos Gallery B and its Others the Others gallery. Every media group becomes a card, attributed to its own product (title, link and tag). Narrow the set with the Category filter above. Headings, intro copy and stats stay yours."
1961
1965
  | "Pools every product’s grouped media: each one’s Relative / lifestyle photos feed Gallery A, its Product photos Gallery B and its Others the Others gallery. Every media group becomes a card, attributed to its own product (title, link and tag). Narrow the set with the Category filter above. Headings, intro copy and stats stay yours."
1962
1966
  | "Popup's own"
1963
1967
  | "Popups"