efficient-storefront-blocks 0.130.0 → 0.130.1

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.
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as u}from"react/jsx-runtime";import D from"./SectionBand.js";import{useScopeClass as E}from"../lib/use-scope-class.js";import I from"efficient-web-builder/render/components/SectionHeader";import O from"./SectionFootnote.js";import R from"./TyreCard.js";import z from"./ViewMoreLink.js";import{renderGold as g,renderHeadline as F}from"efficient-web-builder/render/components/goldPhrases";import{useCurrency as L}from"./CurrencyContext.js";import{tyrePagePath as H}from"../lib/tyres/tyre-page-path.js";import{TYRE_ILLUSTRATION_NOTE as P}from"../lib/wheels/tyre-render.js";import{cardImageShapeTokens as B}from"efficient-web-builder/format/lib/content/card-image-shape";import{DEFAULT_CARD_INDEX_FORMAT as $,cardIndexCss as U}from"efficient-web-builder/format/lib/sections/product-card-style";import{say as Y}from"efficient-web-builder/format/lib/editor-words";const G="border-b border-line py-[120px] max-view-desktop:py-20";function x({frameClassName:i,style:o,children:t}){return i!==void 0?e("section",{className:i,style:o,children:t}):e(D,{className:G,style:o,children:t})}const l={2:"grid grid-cols-2 gap-2 max-view-tablet:grid-cols-1",3:"grid grid-cols-3 gap-2 max-view-desktop:grid-cols-2 max-view-tablet:grid-cols-1",4:"grid grid-cols-4 gap-2 max-view-desktop:grid-cols-2 max-view-tablet:grid-cols-1"};function V({num:i,title:o,description:t,tyres:h,footnote:b,footnoteLinkText:y,footnoteLinkHref:T,viewMore:n,editing:k=!1,frameClassName:c,omitHead:w=!1,columns:m=3,cardImage:N,outline:S,indexBadge:_}){const{currency:v,formatPrice:C}=L(),s=h??[],d=E("ct"),f=_??$,a=U(d,f),j=s.some(r=>!r.image),A=[b,j?P:null].filter(Boolean).join(" "),p=w?null:e(I,{num:i!=null?g(i):void 0,title:o!=null?F(o,!1):void 0,description:t!=null?g(t):void 0,accent:!0});return s.length===0?k?u(x,{frameClassName:c,children:[p,e("p",{className:"border-t border-line py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:Y("No compatible tyres found for this wheel’s sizes yet — tyres appear automatically when a matching size is active and priced in the catalog.")})]}):null:u(x,{frameClassName:c,style:B(N),children:[a&&e("style",{children:a}),p,e("div",{className:`${a?`${d} `:""}${(Object.hasOwn(l,m)?l[m]:void 0)??l[3]}`,children:s.map(r=>e(R,{outline:S,showIndex:f!=="off",size:r.size,specs:r.specs,prices:r.prices,image:r.image,inStock:r.inStock,href:H(r.slug),currency:v,formatPrice:C},r.sku))}),n&&e("div",{className:"mt-10 flex",children:e(z,{href:n.href,label:n.label})}),e(O,{text:A,linkText:y,linkHref:T})]})}export{V as default};
1
+ "use client";import{jsx as e,jsxs as h}from"react/jsx-runtime";import I from"./SectionBand.js";import{SPEC_TABLE_BAND as x}from"../lib/sections/spec-table-band.js";import{useScopeClass as L}from"../lib/use-scope-class.js";import O from"efficient-web-builder/render/components/SectionHeader";import z from"./SectionFootnote.js";import B from"./TyreCard.js";import D from"./ViewMoreLink.js";import{renderGold as T,renderHeadline as F}from"efficient-web-builder/render/components/goldPhrases";import{useCurrency as P}from"./CurrencyContext.js";import{tyrePagePath as R}from"../lib/tyres/tyre-page-path.js";import{TYRE_ILLUSTRATION_NOTE as H}from"../lib/wheels/tyre-render.js";import{cardImageShapeTokens as $}from"efficient-web-builder/format/lib/content/card-image-shape";import{DEFAULT_CARD_INDEX_FORMAT as U,cardIndexCss as Y}from"efficient-web-builder/format/lib/sections/product-card-style";import{say as G}from"efficient-web-builder/format/lib/editor-words";function b({frameClassName:i,omitHead:t,style:o,children:n}){return i!==void 0?e("section",{className:i,style:o,children:n}):e(I,{className:t?x.ownBox:x.inline,style:o,children:n})}const m={2:"grid grid-cols-2 gap-2 max-view-tablet:grid-cols-1",3:"grid grid-cols-3 gap-2 max-view-desktop:grid-cols-2 max-view-tablet:grid-cols-1",4:"grid grid-cols-4 gap-2 max-view-desktop:grid-cols-2 max-view-tablet:grid-cols-1"};function V({num:i,title:t,description:o,tyres:n,footnote:k,footnoteLinkText:w,footnoteLinkHref:y,viewMore:s,editing:N=!1,frameClassName:d,omitHead:a=!1,columns:f=3,cardImage:S,outline:_,indexBadge:C}){const{currency:v,formatPrice:E}=P(),l=n??[],p=L("ct"),u=C??U,c=Y(p,u),j=l.some(r=>!r.image),A=[k,j?H:null].filter(Boolean).join(" "),g=a?null:e(O,{num:i!=null?T(i):void 0,title:t!=null?F(t,!1):void 0,description:o!=null?T(o):void 0,accent:!0});return l.length===0?N?h(b,{frameClassName:d,omitHead:a,children:[g,e("p",{className:"border-t border-line py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:G("No compatible tyres found for this wheel’s sizes yet — tyres appear automatically when a matching size is active and priced in the catalog.")})]}):null:h(b,{frameClassName:d,omitHead:a,style:$(S),children:[c&&e("style",{children:c}),g,e("div",{className:`${c?`${p} `:""}${(Object.hasOwn(m,f)?m[f]:void 0)??m[3]}`,children:l.map(r=>e(B,{outline:_,showIndex:u!=="off",size:r.size,specs:r.specs,prices:r.prices,image:r.image,inStock:r.inStock,href:R(r.slug),currency:v,formatPrice:E},r.sku))}),s&&e("div",{className:"mt-10 flex",children:e(D,{href:s.href,label:s.label})}),e(z,{text:A,linkText:w,linkHref:y})]})}export{V as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as $}from"react/jsx-runtime";import G from"../SectionBand.js";import{useScopeClass as Z}from"../../lib/use-scope-class.js";import{useEffect as q,useState as J}from"react";import{cardHoverOf as Q}from"efficient-web-builder/format/lib/animation/hover";const Y=Q({},"ProductGrid");import ee from"../CompatibleTyres.js";import{cardRowsGrid as re,GridBundleCards as te,GridCardProvider as oe,GridCards as ne,gridIndexCss as se}from"../GridCardTemplate.js";import{productGridColumnsClass as le}from"../../lib/sections/product-grid-columns.js";import{containerGapProps as B}from"efficient-web-builder/format/lib/content/container-gap";import{cardImageShapeTokens as D}from"efficient-web-builder/format/lib/content/card-image-shape";import{NO_FIELD_ANSWERS as ie}from"../../lib/content/field-usage.js";import{gridClassImageSizes as de}from"../../lib/sections/card-image-sizes.js";import{fillRowCss as ae}from"../../lib/sections/fill-row.js";import ce from"efficient-web-builder/render/components/SectionHeader";import pe from"../ViewMoreLink.js";import{useSiteMenuLinks as me}from"../catalog/SiteMenuLinks.js";import{renderGold as O,renderHeadline as ue}from"efficient-web-builder/render/components/goldPhrases";import fe from"./KindGate.js";import{loadProductCatalog as he}from"../useProductCatalog.js";import{PLP_KINDS as be}from"../../lib/catalog/plp-item.js";import{relatedCardCount as we,relatedViewMore as ye}from"../../lib/catalog/related-cards.js";import{answersWithProducts as M,DEFAULT_RELATIONSHIP as ge,relationshipApplies as W,relationshipByKey as xe}from"../../lib/catalog/relationships.js";import{useCurrentProduct as Ee}from"../../lib/document/current-product.js";import{PLACEHOLDER_RELATED as j}from"../../lib/wheels/placeholder-wheel.js";import{say as P}from"efficient-web-builder/format/lib/editor-words";const K={label:"text-[length:var(--size-label,13px)]"},ke=be;function ve(o){return e(fe,{kinds:ke,type:"RelatedProducts",editing:o.editing,children:e(Pe,{...o})})}function Pe({num:o,title:r,description:i,columns:d=3,cardCount:C,relationship:N=ge,footnote:w,footnoteLinkText:y,footnoteLinkHref:S,editing:n=!1,omitHead:a=!1,hover:R,ownerId:c="",template:m,cardImage:l,outline:g,indexBadge:u,columnsPhone:x,columnsTablet:E,gap:k,gapPhone:_}){const L={columns:d,columnsPhone:x,columnsTablet:E,gap:k,gapPhone:_,hover:R,ownerId:c,template:m,editing:n},s=Ee(),F=me(),v=we(C),t=xe(N),T=t?M(t):!1,[U,H]=J([]);if(q(()=>{if(s||!n||!T)return;let p=!1;return he().then(b=>{const X=b.length>0?b:j;p||H(X)}).catch(()=>{p||H(j)}),()=>{p=!0}},[s,n,T]),!t)return null;const f=a?null:e(ce,{num:o?O(o):void 0,title:ue(r||t.heading,!1),description:i?O(i):void 0,accent:!0});if(!M(t)){if(s&&!W(t,s.product.kind))return n?e(z,{relationship:t,cardImage:l}):null;const p=s?t.resolve(s.product,s.relatedWheels):null,b=p?.kind==="bundle"?p.bundles.slice(0,v):[];return b.length===0?n?e(V,{header:f,omitHead:a,cardImage:l,words:P("Bundles containing this product appear here on a product page.")}):null:e(I,{header:f,cards:{bundles:b},...L})}const A=ye(t,F);if(!s)return n?e(I,{header:f,cards:{wheels:U.slice(0,v)},viewMore:A,...L}):null;if(!W(t,s.product.kind))return n?e(z,{relationship:t,cardImage:l}):null;const h=t.resolve(s.product,s.relatedWheels);return h.kind==="tyre"?e(ee,{omitHead:a,columns:d,cardImage:l,outline:g,indexBadge:u,num:o,title:r||t.heading,description:i,tyres:[...h.tyres].slice(0,v),footnote:w,footnoteLinkText:y,footnoteLinkHref:S,viewMore:A,editing:n}):h.kind!=="alloy-wheel"?null:h.wheels.length===0?n?e(V,{header:f,omitHead:a,cardImage:l,words:P("Related products appear here on a product page.")}):null:e(I,{header:f,cards:{wheels:[...h.wheels].slice(0,v)},viewMore:A,...L})}function z({relationship:o,cardImage:r}){return e(G,{className:"border-b border-line py-14 max-view-desktop:py-10",style:D(r),children:e("p",{className:`font-mono ${K.label} uppercase tracking-[0.18em] text-fg-dim`,children:P("“{relationship}” does not apply to this product. It is hidden on the live page.",{relationship:P(o.label)})})})}const Ce="border-b border-line py-[120px] max-view-desktop:py-20",Ne="border-b border-line pt-0 pb-[120px] max-view-desktop:pt-0 max-view-desktop:pb-20";function V({header:o,omitHead:r,cardImage:i,words:d}){return $(G,{className:r?Ne:Ce,style:D(i),children:[o,e("p",{className:`border-t border-line py-6 font-mono ${K.label} uppercase tracking-[0.18em] text-fg-dim`,children:d})]})}function I({header:o,cards:r,viewMore:i,columns:d,columnsPhone:C,columnsTablet:N,gap:w,gapPhone:y,hover:S,ownerId:n,template:a,editing:R}){const c=Z("rp"),m="wheels"in r?r.wheels.length:r.bundles.length;if(m===0)return null;const l=le(d,C,N),g="bundles"in r,u=g?B("ProductGrid",w,"both",y):re(B("ProductGrid",w,"both",y)),x=se(c),E=ae(c,l,{cards:m}),k=_=>e("div",{className:g?`${c} mt-10 grid${u.className} ${l}`:`${c} grid${u.className} bg-[var(--catalog-grid-bg)] ${l}`,style:u.style,children:_});return $(G,{className:"border-b border-line py-[120px] max-view-desktop:py-20",children:[x&&e("style",{children:x}),E&&e("style",{children:E}),o,e(oe,{value:{ownerId:n,Template:a,hover:S??Y,imageSizes:de(l,m),fieldUsage:ie,reserveEyebrow:!1,editing:R},children:"wheels"in r?e(ne,{wheels:r.wheels,children:k}):e(te,{bundles:r.bundles,children:k})}),i?e("div",{className:"mt-10 flex",children:e(pe,{href:i.href,label:i.label})}):null]})}export{Pe as RelatedProductsBody,ve as default,ke as supportedKinds};
1
+ "use client";import{jsx as e,jsxs as $}from"react/jsx-runtime";import A from"../SectionBand.js";import{useScopeClass as q}from"../../lib/use-scope-class.js";import{useEffect as J,useState as Q}from"react";import{cardHoverOf as Y}from"efficient-web-builder/format/lib/animation/hover";const ee=Y({},"ProductGrid");import re from"../CompatibleTyres.js";import{cardRowsGrid as te,GridBundleCards as oe,GridCardProvider as ne,GridCards as le,gridIndexCss as se}from"../GridCardTemplate.js";import{productGridColumnsClass as ie}from"../../lib/sections/product-grid-columns.js";import{containerGapProps as H}from"efficient-web-builder/format/lib/content/container-gap";import{SPEC_TABLE_BAND as S}from"../../lib/sections/spec-table-band.js";import{cardImageShapeTokens as M}from"efficient-web-builder/format/lib/content/card-image-shape";import{NO_FIELD_ANSWERS as ae}from"../../lib/content/field-usage.js";import{gridClassImageSizes as de}from"../../lib/sections/card-image-sizes.js";import{fillRowCss as ce}from"../../lib/sections/fill-row.js";import pe from"efficient-web-builder/render/components/SectionHeader";import ue from"../ViewMoreLink.js";import{useSiteMenuLinks as me}from"../catalog/SiteMenuLinks.js";import{renderGold as O,renderHeadline as fe}from"efficient-web-builder/render/components/goldPhrases";import he from"./KindGate.js";import{loadProductCatalog as ge}from"../useProductCatalog.js";import{PLP_KINDS as be}from"../../lib/catalog/plp-item.js";import{relatedCardCount as we,relatedViewMore as ye}from"../../lib/catalog/related-cards.js";import{answersWithProducts as j,DEFAULT_RELATIONSHIP as xe,relationshipApplies as K,relationshipByKey as Ce}from"../../lib/catalog/relationships.js";import{useCurrentProduct as ke}from"../../lib/document/current-product.js";import{PLACEHOLDER_RELATED as W}from"../../lib/wheels/placeholder-wheel.js";import{say as v}from"efficient-web-builder/format/lib/editor-words";const z={label:"text-[length:var(--size-label,13px)]"},Ee=be;function Pe(o){return e(he,{kinds:Ee,type:"RelatedProducts",editing:o.editing,children:e(Se,{...o})})}function Se({num:o,title:r,description:s,columns:d=3,cardCount:N,relationship:L=xe,footnote:w,footnoteLinkText:y,footnoteLinkHref:G,editing:n=!1,omitHead:a=!1,hover:R,ownerId:T="",template:c,cardImage:i,outline:p,indexBadge:x,columnsPhone:m,columnsTablet:C,gap:k,gapPhone:E}){const f={columns:d,columnsPhone:m,columnsTablet:C,gap:k,gapPhone:E,hover:R,ownerId:T,template:c,editing:n,omitHead:a},l=ke(),U=me(),P=we(N),t=Ce(L),I=t?j(t):!1,[Z,D]=Q([]);if(J(()=>{if(l||!n||!I)return;let u=!1;return ge().then(b=>{const X=b.length>0?b:W;u||D(X)}).catch(()=>{u||D(W)}),()=>{u=!0}},[l,n,I]),!t)return null;const h=a?null:e(pe,{num:o?O(o):void 0,title:fe(r||t.heading,!1),description:s?O(s):void 0,accent:!0});if(!j(t)){if(l&&!K(t,l.product.kind))return n?e(V,{relationship:t,cardImage:i}):null;const u=l?t.resolve(l.product,l.relatedWheels):null,b=u?.kind==="bundle"?u.bundles.slice(0,P):[];return b.length===0?n?e(F,{header:h,omitHead:a,cardImage:i,words:v("Bundles containing this product appear here on a product page.")}):null:e(B,{header:h,cards:{bundles:b},...f})}const _=ye(t,U);if(!l)return n?e(B,{header:h,cards:{wheels:Z.slice(0,P)},viewMore:_,...f}):null;if(!K(t,l.product.kind))return n?e(V,{relationship:t,cardImage:i}):null;const g=t.resolve(l.product,l.relatedWheels);return g.kind==="tyre"?e(re,{omitHead:a,columns:d,cardImage:i,outline:p,indexBadge:x,num:o,title:r||t.heading,description:s,tyres:[...g.tyres].slice(0,P),footnote:w,footnoteLinkText:y,footnoteLinkHref:G,viewMore:_,editing:n}):g.kind!=="alloy-wheel"?null:g.wheels.length===0?n?e(F,{header:h,omitHead:a,cardImage:i,words:v("Related products appear here on a product page.")}):null:e(B,{header:h,cards:{wheels:[...g.wheels].slice(0,P)},viewMore:_,...f})}function V({relationship:o,cardImage:r}){return e(A,{className:"border-b border-line py-14 max-view-desktop:py-10",style:M(r),children:e("p",{className:`font-mono ${z.label} uppercase tracking-[0.18em] text-fg-dim`,children:v("“{relationship}” does not apply to this product. It is hidden on the live page.",{relationship:v(o.label)})})})}function F({header:o,omitHead:r,cardImage:s,words:d}){return $(A,{className:r?S.ownBox:S.inline,style:M(s),children:[o,e("p",{className:`border-t border-line py-6 font-mono ${z.label} uppercase tracking-[0.18em] text-fg-dim`,children:d})]})}function B({header:o,cards:r,viewMore:s,columns:d,columnsPhone:N,columnsTablet:L,gap:w,gapPhone:y,hover:G,ownerId:n,template:a,editing:R,omitHead:T}){const c=q("rp"),i="wheels"in r?r.wheels.length:r.bundles.length;if(i===0)return null;const p=ie(d,N,L),x="bundles"in r,m=x?H("ProductGrid",w,"both",y):te(H("ProductGrid",w,"both",y)),C=se(c),k=ce(c,p,{cards:i}),E=f=>e("div",{className:x?`${c} mt-10 grid${m.className} ${p}`:`${c} grid${m.className} bg-[var(--catalog-grid-bg)] ${p}`,style:m.style,children:f});return $(A,{className:T?S.ownBox:S.inline,children:[C&&e("style",{children:C}),k&&e("style",{children:k}),o,e(ne,{value:{ownerId:n,Template:a,hover:G??ee,imageSizes:de(p,i),fieldUsage:ae,reserveEyebrow:!1,editing:R},children:"wheels"in r?e(le,{wheels:r.wheels,children:E}):e(oe,{bundles:r.bundles,children:E})}),s?e("div",{className:"mt-10 flex",children:e(ue,{href:s.href,label:s.label})}):null]})}export{Se as RelatedProductsBody,Pe as default,Ee as supportedKinds};
@@ -1 +1 @@
1
- import{ProductGridSlots as t}from"../ProductGrid/meta.js";import{BAND_120_80_OWN as e}from"../../../../content/block-own-pads.js";const r={ownPad:e,label:"Bundle Products",fields:{template:t.template},defaultProps:{num:"",title:"",description:"",columns:3}};export{r as BundleOfferMeta};
1
+ import{ProductGridSlots as t}from"../ProductGrid/meta.js";import{BAND_120_OWN as e}from"../../../../content/block-own-pads.js";const r={ownPad:e,label:"Bundle Products",fields:{template:t.template},defaultProps:{num:"",title:"",description:"",columns:3}};export{r as BundleOfferMeta};
@@ -1 +1 @@
1
- import{PH as o}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{BAND_120_80_OWN as t}from"../../../../content/block-own-pads.js";const i={num:o.sectionNumber,title:"Compatible *tyres.*",description:o.body,footnote:"Tyres shown are fitment-matched companions.",footnoteLinkText:"Enquire about tyres"},r={ownPad:t,label:"Compatible Tyres",defaultProps:{num:"",title:"",description:"",footnote:"",footnoteLinkText:"",footnoteLinkHref:""}};export{i as COMPATIBLETYRES_PH,r as CompatibleTyresMeta};
1
+ import{PH as o}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{BAND_120_OWN as t}from"../../../../content/block-own-pads.js";const i={num:o.sectionNumber,title:"Compatible *tyres.*",description:o.body,footnote:"Tyres shown are fitment-matched companions.",footnoteLinkText:"Enquire about tyres"},r={ownPad:t,label:"Compatible Tyres",defaultProps:{num:"",title:"",description:"",footnote:"",footnoteLinkText:"",footnoteLinkHref:""}};export{i as COMPATIBLETYRES_PH,r as CompatibleTyresMeta};
@@ -1 +1 @@
1
- import{RELATED_CARDS_DEFAULT as t}from"../../../../catalog/related-cards.js";import{DEFAULT_RELATIONSHIP as o}from"../../../../catalog/relationships.js";import{ProductGridSlots as r}from"../ProductGrid/meta.js";import{BAND_120_80_OWN as e}from"../../../../content/block-own-pads.js";const a={ownPad:e,label:"Related Products",fields:{template:r.template},defaultProps:{num:"",title:"",description:"",cardCount:t,columns:3,relationship:o}};export{a as RelatedProductsMeta};
1
+ import{RELATED_CARDS_DEFAULT as t}from"../../../../catalog/related-cards.js";import{DEFAULT_RELATIONSHIP as o}from"../../../../catalog/relationships.js";import{ProductGridSlots as r}from"../ProductGrid/meta.js";import{BAND_120_OWN as e}from"../../../../content/block-own-pads.js";const a={ownPad:e,label:"Related Products",fields:{template:r.template},defaultProps:{num:"",title:"",description:"",cardCount:t,columns:3,relationship:o}};export{a as RelatedProductsMeta};