efficient-storefront-blocks 0.90.0 → 0.92.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.
- package/CHANGELOG.md +36 -0
- package/dist/chunks/{EditorPreviewCheckout-M4LID5YF.js → EditorPreviewCheckout-VHPWPS3N.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-2JWQZN2Q.js → SiteEditorProvider-C4HT4BT4.js} +1 -1
- package/dist/chunks/chunk-7L5DVQZ4.js +1 -0
- package/dist/chunks/chunk-PW7BA4ZJ.js +1 -0
- package/dist/chunks/{chunk-3XIZADE6.js → chunk-RAOSZKA3.js} +1 -1
- package/dist/chunks/chunk-S2WLJ6H2.js +388 -0
- package/dist/chunks/{fitment-data-3VLLTJW6.js → fitment-data-URJZ24LU.js} +1 -1
- package/dist/contract.js +11 -19
- package/dist/editor/components/GalleryShowcaseSource.js +1 -1
- package/dist/editor/lib/document/block-align-row.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/AlloyWheelsListing/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/GalleryItem/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
- package/dist/editor/lib/document/blocks/service/AppointmentBooking/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/ContactRouting/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/Events/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/index.d.ts +1 -1
- package/dist/editor/lib/document/config.d.ts +2 -0
- package/dist/editor/lib/document/config.js +1 -1
- package/dist/editor/lib/efficient-block-sources.js +1 -1
- package/dist/editor/lib/storefront-editor-words-kept.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +8 -7
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/index.js +53 -39
- package/dist/links.js +1 -1
- package/dist/render/app/globals.css +10 -1
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/AppointmentBooking.d.ts +2 -1
- package/dist/render/components/AppointmentBooking.js +1 -1
- package/dist/render/components/ContactRouting.d.ts +2 -1
- package/dist/render/components/ContactRouting.js +1 -1
- package/dist/render/components/Events.d.ts +3 -1
- package/dist/render/components/Events.js +1 -1
- package/dist/render/components/FooterMenu.d.ts +3 -1
- package/dist/render/components/FooterMenu.js +1 -1
- package/dist/render/components/FooterPayment.js +1 -1
- package/dist/render/components/FooterSocial.js +1 -1
- package/dist/render/components/GridCardTemplate.d.ts +30 -1
- package/dist/render/components/GridCardTemplate.js +1 -1
- package/dist/render/components/ProductGridSection.d.ts +2 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/PublishedFooter.js +1 -1
- package/dist/render/components/PublishedHeader.js +1 -1
- package/dist/render/components/RatingBlockView.d.ts +5 -0
- package/dist/render/components/RatingBlockView.js +1 -0
- package/dist/render/components/ReviewForm.js +1 -1
- package/dist/render/components/TyrePlpCard.d.ts +2 -1
- package/dist/render/components/TyrePlpCard.js +1 -1
- package/dist/render/components/TyreSummaryCard.d.ts +2 -1
- package/dist/render/components/TyreSummaryCard.js +1 -1
- package/dist/render/components/WheelCardFrame.d.ts +1 -2
- package/dist/render/components/WheelCardFrame.js +1 -1
- package/dist/render/components/card-pieces/CardPicture.d.ts +1 -1
- package/dist/render/components/card-pieces/CardProductPicture.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.js +1 -1
- package/dist/render/components/pdp-dynamic/RecordPhotoGallery.d.ts +2 -1
- package/dist/render/components/pdp-dynamic/RecordPhotoGallery.js +1 -1
- package/dist/render/components/wheels-plp/AlloyWheelsListing.d.ts +5 -14
- package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
- package/dist/render/lib/api/index.d.ts +3 -1
- package/dist/render/lib/api/index.js +1 -1
- package/dist/render/lib/chrome-cache.d.ts +1 -0
- package/dist/render/lib/chrome-cache.js +1 -1
- package/dist/render/lib/content/events-featured-look.d.ts +3 -0
- package/dist/render/lib/content/events-featured-look.js +1 -0
- package/dist/render/lib/content/menu-card-seed.d.ts +4 -0
- package/dist/render/lib/content/menu-card-seed.js +1 -1
- package/dist/render/lib/content/menu-entry-type.d.ts +2 -0
- package/dist/render/lib/content/menu-entry-type.js +1 -0
- package/dist/render/lib/content/product-card-seed.d.ts +7 -0
- package/dist/render/lib/content/product-card-seed.js +1 -1
- package/dist/render/lib/content/rating.d.ts +1 -0
- package/dist/render/lib/content/rating.js +1 -0
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/meta.d.ts +6 -0
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductColour/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductEyebrow/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductGrid/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductPrice/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductSpecs/render.js +1 -1
- package/dist/render/lib/document/blocks/service/AppointmentBooking/render.js +1 -1
- package/dist/render/lib/document/blocks/service/ContactRouting/render.js +1 -1
- package/dist/render/lib/document/blocks/service/Events/meta.d.ts +6 -0
- package/dist/render/lib/document/blocks/service/Events/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/Events/render.js +1 -1
- package/dist/render/lib/document/blocks/service/RatingBlock/meta.d.ts +2 -1
- package/dist/render/lib/document/blocks/service/RatingBlock/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/RatingBlock/render.js +1 -1
- package/dist/render/lib/document/card-templates.d.ts +3 -1
- package/dist/render/lib/document/card-templates.js +1 -1
- package/dist/render/lib/document/footer-page-blocks.js +1 -1
- package/dist/render/lib/document/published-chrome-data.d.ts +2 -0
- package/dist/render/lib/document/published-chrome-data.js +1 -0
- package/dist/render/lib/document/render-config.d.ts +2 -0
- package/dist/render/lib/document/render-config.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-detail.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-events.d.ts +1 -0
- package/dist/render/lib/document/section-to-box-rows-events.js +1 -0
- package/dist/render/lib/document/section-to-box-rows-reviews.d.ts +2 -1
- package/dist/render/lib/document/section-to-box-rows-reviews.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-service.d.ts +1 -0
- package/dist/render/lib/document/section-to-box-rows-service.js +1 -0
- package/dist/render/lib/document/section-to-box-rows-spec.js +1 -1
- package/dist/render/lib/sections/grid-no-hole.d.ts +1 -1
- package/dist/render/lib/sections/product-pictures.d.ts +2 -1
- package/dist/render/lib/sections/product-pictures.js +1 -1
- package/dist/render/lib/wheels/plp-hydrate.d.ts +3 -0
- package/dist/render/lib/wheels/plp-hydrate.js +1 -1
- package/dist/words.d.ts +19 -7
- package/dist/words.js +5 -5
- package/package.json +4 -2
- package/dist/chunks/chunk-6TDIG6W3.js +0 -395
- package/dist/chunks/chunk-JMUP4FBL.js +0 -1
- package/dist/chunks/chunk-U6UPMVSX.js +0 -1
- package/dist/render/components/wheels-plp/PlpCard.d.ts +0 -29
- package/dist/render/components/wheels-plp/PlpCard.js +0 -1
- package/dist/render/lib/content/legacy-block-align.d.ts +0 -2
- package/dist/render/lib/content/legacy-block-align.js +0 -1
- /package/dist/chunks/{chunk-N445XY3W.js → chunk-JB6ISWYA.js} +0 -0
- /package/dist/chunks/{chunk-6TDIG6W3.js.LEGAL.txt → chunk-S2WLJ6H2.js.LEGAL.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as f,Fragment as tt}from"react/jsx-runtime";import{useScopeClass as rt}from"../lib/use-scope-class.js";import{useEffect as A,useMemo as u,useState as me}from"react";import{cardHoverOf as nt}from"efficient-web-builder/format/lib/animation/hover";import{containerGapProps as it}from"efficient-web-builder/format/lib/content/container-gap";import st from"next/link";import{cardRowsGrid as ot,GridCardProvider as at,GridCards as lt,gridIndexCss as mt}from"./GridCardTemplate.js";import{gridClassImageSizes as dt}from"../lib/sections/card-image-sizes.js";import{fillRowCss as de}from"../lib/sections/fill-row.js";import{hiddenCardsRule as ce,noHoleBands as pe,noHoleCss as ue,ONE_WHEEL_MARK as ct,oneWheelScope as ge,pairScope as pt,showsASetCard as fe}from"../lib/sections/grid-no-hole.js";import{setIsWide as ut,summarySetBuild as gt}from"../lib/wheels/set-mode.js";import{answersForKind as he,NO_FIELD_ANSWERS as ft}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as ht}from"./ProductCardEyebrow.js";import xt from"./NoCurrencyNote.js";import{SITE_WIDTH_CAP as wt,centredCap as vt}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as yt,SectionWheelsProvider as bt}from"./ProductRef.js";import{useCurrency as St}from"./CurrencyContext.js";import{COLLECTION_ATTR as Ct,useCatalogFilter as Mt}from"./catalog/CatalogFilterContext.js";import{useIsoLayoutEffect as $t,useShopperMember as Nt}from"./catalog/ShopperScope.js";import Et from"./wheels-plp/PlpPagination.js";import{CATALOG_TEXT_SIZE as Tt}from"../lib/sections/catalog-text-size.js";import{applyShopperFilters as zt,hasActivePlpFilters as Pt}from"../lib/wheels/plp-filters.js";import Lt from"./catalog/ClearAllButton.js";import{gridPagingOf as It,gridShownOf as _t}from"../lib/sections/product-grid-pages.js";import Ot from"./SectionBand.js";import{useInsideBox as At,useInsideSiteGutter as Ht}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as Bt}from"../lib/sections/product-grid-columns.js";import{renderGold as V,renderHeadline as Rt}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as Gt}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as kt}from"../lib/wheels/wheel-summary-casing.js";import Ft from"./TyreSummaryCard.js";import{itemKind as Y,plpKindNoun as xe}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as Wt,gridKindsOf as we,gridRowsOf as jt}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as Ut}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as Kt}from"efficient-web-builder/render/lib/document/header-clearance";import{finishFamiliesOf as Xt}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as Dt}from"../lib/wheels/lug-count.js";import{diametersOf as Zt}from"../lib/wheels/size-range.js";import{say as qt}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as Vt}from"../lib/sections/product-grid-title.js";const Yt=nt({},"ProductGrid"),i={headingMediumUpTo800Xs:"max-view-wide:text-[length:var(--size-headingMedium,28px)]",headingMediumUpTo800Small:"max-view-wide:text-[length:var(--size-headingMedium,32px)]",headingMediumUpTo800Large:"max-view-wide:text-[length:var(--size-headingMedium,36px)]",headingMediumUpTo800Xl:"max-view-wide:text-[length:var(--size-headingMedium,40px)]",body:"text-[length:var(--size-body,13px)]",headingMedium1:"text-[length:var(--size-headingMedium,40px)]",headingMedium2:"text-[length:var(--size-headingMedium,48px)]",headingMedium3:"text-[length:var(--size-headingMedium,56px)]",headingMedium4:"text-[length:var(--size-headingMedium,64px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},ve=[{value:"para",label:"Paragraph size — 13px",cls:`font-mono font-normal uppercase tracking-[0.22em] ${i.labelLarge}`},{value:"sm",label:"Small — 40px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium1} ${i.headingMediumUpTo800Xs}`},{value:"md",label:"Medium — 48px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium2} ${i.headingMediumUpTo800Small}`},{value:"lg",label:"Large — 56px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium3} ${i.headingMediumUpTo800Large}`},{value:"xl",label:"Extra large — 64px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium4} ${i.headingMediumUpTo800Xl}`}];function Jt(M){return(ve.find(h=>h.value===M)??ve.find(h=>h.value===Vt)).cls}function Qt({num:M,catalog:h,firstCountInChips:ye=!1,kinds:T,title:H,titleSize:be,padTop:J,description:z,link:$,products:Se,wheels:Ce,source:p,columns:Me,columnsPhone:$e,columnsTablet:Ne,limit:Ee,moreProducts:Te,perPage:ze,editing:x,contentCapped:Pe=!1,hover:Le,fieldUsage:w,ownerId:Ie="",template:_e,gap:Oe,gapPhone:Ae}){const B=u(()=>w?he(w,"alloy-wheel"):void 0,[w]),He=u(()=>w?he(w,"tyre"):void 0,[w]),e=rt("pg"),{paged:v,per:y,limit:l,cap:N}=It({moreProducts:Te,perPage:ze,limit:Ee}),d=Bt(Me,$e,Ne),Q=Pe,Be=Ht(),Re=At(),Ge=Be||Re,ee=Ut(x===!0&&!!p),o=u(()=>p?kt(jt(p,T,ee??h??[])):null,[h,ee,p,T]),R=Nt("grid",o),a=o?R.scope:null,g=Wt(p),b=g!==null&&!a,{filters:P,reportCount:G,reportLugs:k,reportSizes:F,reportFinishes:W,reportCategories:j,vehicle:te}=Mt(),{currency:S}=St(),U=b&&!!P.process&&P.process!==g,K=a?.state,n=u(()=>o?K?zt(o,K,S):b?Gt(o,P,S,te.fit):o:null,[o,K,b,P,S,te.fit]),[ke,Fe]=me(1),X=v&&n?Math.max(1,Math.ceil(n.length/y)):1,C=Math.min(X,Math.max(1,a?a.state.page:ke)),{reportShown:D}=R,re=a!==null;$t(()=>{if(!re||!n)return D(null);D(_t(n.length,{paged:v,per:y,cap:N},C))},[re,n,D,v,C,y,N]);const We=r=>a?a.update({page:r}):Fe(r),s=u(()=>v&&n?n.slice((C-1)*y,C*y):n,[v,n,C,y]);A(()=>(j(e,g===null?[]:[g]),()=>j(e,[])),[g,j,e]),A(()=>{if(b)return G(e,U?0:n?.length??0),()=>G(e,0)},[b,U,n,G,e]);const L=u(()=>({lugs:Dt(o??[]),sizes:Zt(o??[]),finishes:Xt(o??[])}),[o]);A(()=>(k(e,L.lugs),F(e,L.sizes),W(e,L.finishes),()=>{k(e,[]),F(e,[]),W(e,[])}),[L,k,F,W,e]);const Z=it("ProductGrid",Oe,"both",Ae),je=`${e} grid${Z.className} bg-[var(--catalog-grid-bg)] ${d}`,ne=ot(Z),Ue=`${e} grid${ne.className} bg-[var(--catalog-grid-bg)] ${d}`,Ke=ne.style,Xe=u(()=>{const r=(n??[]).filter(c=>Y(c)!=="tyre");if(r.length===0)return!1;const m=r.some(c=>!!c.process);return r.some(c=>!!c.setWords)||ht({kind:!1,brand:!1,process:m},B??[])},[n,B]),De=s?s.length>0?t("div",{className:Ue,style:Ke,children:s.map((r,m)=>Y(r)==="tyre"?t(Ft,{item:r,currency:S,editing:x,fieldUsage:He},`tyre:${r.slug}-${m}`):t(lt,{wheels:[r],children:E=>E},`${r.slug}-${m}`))}):a&&Pt(a.state)?f("div",{className:"flex min-h-[320px] flex-col items-center justify-center gap-4 bg-surface-2 p-4 text-center",children:[t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:`No ${xe(we(p,T)).many} match those filters`}),t(Lt,{onClick:a.clear})]}):x?t("div",{className:"flex min-h-[320px] items-center justify-center rounded bg-surface-2 p-4 text-center",children:t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:qt("No products in “{name}” yet",{name:p?.name??""})})}):null:t(Se,{className:je,style:Z.style,minEmptyHeight:320}),Ze=a?a.countInChips:ye,I=n&&!Ze?n.length:null,ie=xe(we(p,T)),qe=M||H||z||$?f("div",{className:`${Kt} sticky top-[var(--sf-header-h,88px)] z-30 mb-5 flex items-center justify-between gap-4 max-view-wide:flex-wrap max-view-wide:gap-y-2 border-b border-line bg-bg/95 py-3 backdrop-blur-md ${Q||Ge?"":"-mx-[var(--sf-site-gutter,40px)] px-[var(--sf-site-gutter,40px)] max-view-wide:-mx-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]"}`,children:[f("div",{className:"flex min-w-0 items-end gap-6 max-view-wide:flex-col max-view-wide:items-stretch max-view-wide:gap-3",children:[M&&t("span",{className:`font-mono ${i.labelLarge} leading-none uppercase tracking-[0.22em] text-fg-dim`,children:V(M)}),H&&t("h2",{className:`${Jt(be)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,children:Rt(H,!1)})]}),(z||$||I!==null)&&f("div",{className:"flex items-center gap-5 max-view-wide:gap-3 view-wide:grow view-wide:justify-end",children:[z&&t("span",{className:`max-w-[340px] truncate font-display ${i.body} leading-[1.4] text-fg-dim max-view-wide:hidden view-wide:w-0 view-wide:grow view-wide:text-right`,children:V(z)}),$&&f(st,{href:$.href,className:`inline-flex items-center gap-2 whitespace-nowrap font-mono ${i.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,children:[V($.text),t("span",{"aria-hidden":!0,children:"→"})]}),I!==null&&f("span",{className:`whitespace-nowrap font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:[I," ",I===1?ie.one:ie.many]})]})]}):null,Ve=typeof J=="number"?{"--pg-pt":`${J}px`}:{},_=u(()=>{if(!s)return null;const r=s.map(m=>Y(m)!=="tyre"&&ut(gt(m))?2:1);return fe(r,l)?pe(d,r,l):null},[s,d,l]),[Ye,Je]=me("");A(()=>{if(s)return;const r=document.querySelector(`.${e}`);if(!r)return;const m=()=>{const c=[...r.children].map(le=>le.classList.contains("col-span-2")&&!le.querySelector(ct)?2:1);Je(fe(c,l)?ue(e,pe(d,c,l,!1),c.length):"")};m();const E=new MutationObserver(m);return E.observe(r,{childList:!0}),()=>E.disconnect()},[s,e,d,l]);const Qe=_?_[0].tracks:s?N?Math.min(s.length,l):s.length:void 0,O=_?ue(pt(e),_,s.length)+(N?ce(ge(e),l+1):"")+de(ge(e),d,{limit:l,cards:s.length}):Ye,se=O?"":de(e,d,{limit:l,cards:s?.length}),oe=mt(e),ae=f(tt,{children:[N&&!O&&t("style",{children:ce(e,l+1)}),O&&t("style",{children:O}),se&&t("style",{children:se}),oe&&t("style",{children:oe}),qe,De,v&&X>1&&t(Et,{textSize:Tt.labelSmall,page:C,pageCount:X,onPage:We}),t(xt,{editing:x})]});if(U)return null;const q=t(Ot,{rootRef:R.ref,attrs:b&&g!==null?{[Ct]:g}:void 0,className:"relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] pt-[var(--pg-pt)] pb-[120px] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:pt-[70px] max-view-wide:pb-[70px]",column:null,inAnyBox:!0,style:Ve,defaults:{"--pg-pt":"120px"},children:Q?t("div",{style:vt(wt),children:ae}):ae}),et=o?q:x?t(yt,{currency:S,children:q}):t(bt,{wheels:Ce,currency:S,children:q});return t(at,{value:{ownerId:Ie,Template:_e,hover:Le??Yt,imageSizes:dt(d,Qe),fieldUsage:B??ft,reserveEyebrow:Xe,editing:x===!0},children:et})}export{ve as TITLE_SIZES,Qt as default};
|
|
1
|
+
"use client";import{jsx as t,jsxs as f,Fragment as rt}from"react/jsx-runtime";import{useScopeClass as nt}from"../lib/use-scope-class.js";import{useEffect as O,useMemo as u,useState as me}from"react";import{cardHoverOf as it}from"efficient-web-builder/format/lib/animation/hover";import{containerGapProps as st}from"efficient-web-builder/format/lib/content/container-gap";import ot from"next/link";import{cardRowsGrid as at,GridCardProvider as lt,GridMixedCards as mt,gridIndexCss as dt}from"./GridCardTemplate.js";import{gridClassImageSizes as ct}from"../lib/sections/card-image-sizes.js";import{fillRowCss as de}from"../lib/sections/fill-row.js";import{hiddenCardsRule as ce,noHoleBands as pe,noHoleCss as ue,ONE_WHEEL_MARK as pt,oneWheelScope as ge,pairScope as ut,showsASetCard as fe}from"../lib/sections/grid-no-hole.js";import{setIsWide as gt,summarySetBuild as ft}from"../lib/wheels/set-mode.js";import{answersForKind as he,NO_FIELD_ANSWERS as ht}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as xt}from"./ProductCardEyebrow.js";import wt from"./NoCurrencyNote.js";import{SITE_WIDTH_CAP as vt,centredCap as yt}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as bt,SectionWheelsProvider as St}from"./ProductRef.js";import{useCurrency as Ct}from"./CurrencyContext.js";import{COLLECTION_ATTR as Mt,useCatalogFilter as Nt}from"./catalog/CatalogFilterContext.js";import{useIsoLayoutEffect as $t,useShopperMember as Et}from"./catalog/ShopperScope.js";import Tt from"./wheels-plp/PlpPagination.js";import{CATALOG_TEXT_SIZE as zt}from"../lib/sections/catalog-text-size.js";import{applyShopperFilters as Pt,hasActivePlpFilters as Lt}from"../lib/wheels/plp-filters.js";import It from"./catalog/ClearAllButton.js";import{gridPagingOf as _t,gridShownOf as Ot}from"../lib/sections/product-grid-pages.js";import At from"./SectionBand.js";import{useInsideBox as Ht,useInsideSiteGutter as Bt}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as Rt}from"../lib/sections/product-grid-columns.js";import{renderGold as Y,renderHeadline as Gt}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as kt}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as Ft}from"../lib/wheels/wheel-summary-casing.js";import Wt from"./TyreSummaryCard.js";import{itemKind as J,plpKindNoun as xe}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as jt,gridKindsOf as we,gridRowsOf as Ut}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as Kt}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as Xt}from"efficient-web-builder/render/lib/document/header-clearance";import{finishFamiliesOf as Dt}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as Zt}from"../lib/wheels/lug-count.js";import{diametersOf as qt}from"../lib/wheels/size-range.js";import{say as Vt}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as Yt}from"../lib/sections/product-grid-title.js";const Jt=it({},"ProductGrid"),i={headingMediumUpTo800Xs:"max-view-wide:text-[length:var(--size-headingMedium,28px)]",headingMediumUpTo800Small:"max-view-wide:text-[length:var(--size-headingMedium,32px)]",headingMediumUpTo800Large:"max-view-wide:text-[length:var(--size-headingMedium,36px)]",headingMediumUpTo800Xl:"max-view-wide:text-[length:var(--size-headingMedium,40px)]",body:"text-[length:var(--size-body,13px)]",headingMedium1:"text-[length:var(--size-headingMedium,40px)]",headingMedium2:"text-[length:var(--size-headingMedium,48px)]",headingMedium3:"text-[length:var(--size-headingMedium,56px)]",headingMedium4:"text-[length:var(--size-headingMedium,64px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},ve=[{value:"para",label:"Paragraph size — 13px",cls:`font-mono font-normal uppercase tracking-[0.22em] ${i.labelLarge}`},{value:"sm",label:"Small — 40px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium1} ${i.headingMediumUpTo800Xs}`},{value:"md",label:"Medium — 48px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium2} ${i.headingMediumUpTo800Small}`},{value:"lg",label:"Large — 56px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium3} ${i.headingMediumUpTo800Large}`},{value:"xl",label:"Extra large — 64px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium4} ${i.headingMediumUpTo800Xl}`}];function Qt(M){return(ve.find(h=>h.value===M)??ve.find(h=>h.value===Yt)).cls}function er({num:M,catalog:h,catalogTotal:ye,firstCountInChips:be=!1,kinds:E,title:A,titleSize:Se,padTop:Q,description:T,link:N,products:Ce,wheels:Me,source:p,columns:Ne,columnsPhone:$e,columnsTablet:Ee,limit:Te,moreProducts:ze,perPage:Pe,editing:x,contentCapped:Le=!1,hover:Ie,fieldUsage:w,ownerId:_e="",template:Oe,gap:Ae,gapPhone:He}){const H=u(()=>w?he(w,"alloy-wheel"):void 0,[w]),Be=u(()=>w?he(w,"tyre"):void 0,[w]),e=nt("pg"),{paged:v,per:y,limit:l,cap:$}=_t({moreProducts:ze,perPage:Pe,limit:Te}),m=Rt(Ne,$e,Ee),ee=Le,Re=Bt(),Ge=Ht(),ke=Re||Ge,B=Kt(x===!0&&!!p),o=u(()=>p?Ft(Ut(p,E,B??h??[])):null,[h,B,p,E]),R=Et("grid",o),a=o?R.scope:null,g=jt(p),b=g!==null&&!a,{filters:z,reportCount:G,reportLugs:k,reportSizes:F,reportFinishes:W,reportCategories:j,vehicle:te}=Nt(),{currency:S}=Ct(),U=b&&!!z.process&&z.process!==g,K=a?.state,n=u(()=>o?K?Pt(o,K,S):b?kt(o,z,S,te.fit):o:null,[o,K,b,z,S,te.fit]),[Fe,We]=me(1),X=v&&n?Math.max(1,Math.ceil(n.length/y)):1,C=Math.min(X,Math.max(1,a?a.state.page:Fe)),{reportShown:D}=R,re=a!==null;$t(()=>{if(!re||!n)return D(null);D(Ot(n.length,{paged:v,per:y,cap:$},C))},[re,n,D,v,C,y,$]);const je=r=>a?a.update({page:r}):We(r),s=u(()=>v&&n?n.slice((C-1)*y,C*y):n,[v,n,C,y]);O(()=>(j(e,g===null?[]:[g]),()=>j(e,[])),[g,j,e]),O(()=>{if(b)return G(e,U?0:n?.length??0),()=>G(e,0)},[b,U,n,G,e]);const P=u(()=>({lugs:Zt(o??[]),sizes:qt(o??[]),finishes:Dt(o??[])}),[o]);O(()=>(k(e,P.lugs),F(e,P.sizes),W(e,P.finishes),()=>{k(e,[]),F(e,[]),W(e,[])}),[P,k,F,W,e]);const Z=st("ProductGrid",Ae,"both",He),Ue=`${e} grid${Z.className} bg-[var(--catalog-grid-bg)] ${m}`,ne=at(Z),Ke=`${e} grid${ne.className} bg-[var(--catalog-grid-bg)] ${m}`,Xe=ne.style,De=u(()=>{const r=(n??[]).filter(c=>J(c)!=="tyre");if(r.length===0)return!1;const d=r.some(c=>!!c.process);return r.some(c=>!!c.setWords)||xt({kind:!1,brand:!1,process:d},H??[])},[n,H]),Ze=s?s.length>0?t("div",{className:Ke,style:Xe,children:t(mt,{items:s,isWheel:r=>J(r)!=="tyre",other:(r,d)=>t(Wt,{item:r,currency:S,editing:x,fieldUsage:Be},`tyre:${r.slug}-${d}`)})}):a&&Lt(a.state)?f("div",{className:"flex min-h-[320px] flex-col items-center justify-center gap-4 bg-surface-2 p-4 text-center",children:[t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:`No ${xe(we(p,E)).many} match those filters`}),t(It,{onClick:a.clear})]}):x?t("div",{className:"flex min-h-[320px] items-center justify-center rounded bg-surface-2 p-4 text-center",children:t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:Vt("No products in “{name}” yet",{name:p?.name??""})})}):null:t(Ce,{className:Ue,style:Z.style,minEmptyHeight:320}),qe=a?a.countInChips:be,L=n&&!qe?n===o&&!B?ye??n.length:n.length:null,ie=xe(we(p,E)),Ve=M||A||T||N?f("div",{className:`${Xt} sticky top-[var(--sf-header-h,88px)] z-30 mb-5 flex items-center justify-between gap-4 max-view-wide:flex-wrap max-view-wide:gap-y-2 border-b border-line bg-bg/95 py-3 backdrop-blur-md ${ee||ke?"":"-mx-[var(--sf-site-gutter,40px)] px-[var(--sf-site-gutter,40px)] max-view-wide:-mx-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]"}`,children:[f("div",{className:"flex min-w-0 items-end gap-6 max-view-wide:flex-col max-view-wide:items-stretch max-view-wide:gap-3",children:[M&&t("span",{className:`font-mono ${i.labelLarge} leading-none uppercase tracking-[0.22em] text-fg-dim`,children:Y(M)}),A&&t("h2",{className:`${Qt(Se)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,children:Gt(A,!1)})]}),(T||N||L!==null)&&f("div",{className:"flex items-center gap-5 max-view-wide:gap-3 view-wide:grow view-wide:justify-end",children:[T&&t("span",{className:`max-w-[340px] truncate font-display ${i.body} leading-[1.4] text-fg-dim max-view-wide:hidden view-wide:w-0 view-wide:grow view-wide:text-right`,children:Y(T)}),N&&f(ot,{href:N.href,className:`inline-flex items-center gap-2 whitespace-nowrap font-mono ${i.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,children:[Y(N.text),t("span",{"aria-hidden":!0,children:"→"})]}),L!==null&&f("span",{className:`whitespace-nowrap font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:[L," ",L===1?ie.one:ie.many]})]})]}):null,Ye=typeof Q=="number"?{"--pg-pt":`${Q}px`}:{},I=u(()=>{if(!s)return null;const r=s.map(d=>J(d)!=="tyre"&>(ft(d))?2:1);return fe(r,l)?pe(m,r,l):null},[s,m,l]),[Je,Qe]=me("");O(()=>{if(s)return;const r=document.querySelector(`.${e}`);if(!r)return;const d=()=>{const c=[...r.children].map(le=>le.classList.contains("col-span-2")&&!le.querySelector(pt)?2:1);Qe(fe(c,l)?ue(e,pe(m,c,l,!1),c.length):"")};d();const V=new MutationObserver(d);return V.observe(r,{childList:!0}),()=>V.disconnect()},[s,e,m,l]);const et=I?I[0].tracks:s?$?Math.min(s.length,l):s.length:void 0,_=I?ue(ut(e),I,s.length)+($?ce(ge(e),l+1):"")+de(ge(e),m,{limit:l,cards:s.length}):Je,se=_?"":de(e,m,{limit:l,cards:s?.length}),oe=dt(e),ae=f(rt,{children:[$&&!_&&t("style",{children:ce(e,l+1)}),_&&t("style",{children:_}),se&&t("style",{children:se}),oe&&t("style",{children:oe}),Ve,Ze,v&&X>1&&t(Tt,{textSize:zt.labelSmall,page:C,pageCount:X,onPage:je}),t(wt,{editing:x})]});if(U)return null;const q=t(At,{rootRef:R.ref,attrs:b&&g!==null?{[Mt]:g}:void 0,className:"relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] pt-[var(--pg-pt)] pb-[120px] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:pt-[70px] max-view-wide:pb-[70px]",column:null,inAnyBox:!0,style:Ye,defaults:{"--pg-pt":"120px"},children:ee?t("div",{style:yt(vt),children:ae}):ae}),tt=o?q:x?t(bt,{currency:S,children:q}):t(St,{wheels:Me,currency:S,children:q});return t(lt,{value:{ownerId:_e,Template:Oe,hover:Ie??Jt,imageSizes:ct(m,et),fieldUsage:H??ht,reserveEyebrow:De,editing:x===!0},children:tt})}export{ve as TITLE_SIZES,er as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r}from"react/jsx-runtime";import{Render as
|
|
1
|
+
"use client";import{jsx as r}from"react/jsx-runtime";import{Render as u}from"efficient-easel/render";import{renderConfig as a}from"../lib/document/render-config.js";import{publishedChromeData as d}from"../lib/document/published-chrome-data.js";import{SITE_FOOTER_KIND as f}from"efficient-web-builder/format/lib/content/footer";import{PublishedFooterContext as p}from"efficient-web-builder/render/components/PublishedFooterContext";import{EMPTY_SOCIAL_LINKS as I}from"efficient-web-builder/format/lib/content/social-links";function c({footerBlock:l,rootProps:e,headerSettings:o,siteName:n,legalName:t,foundedYear:i,socialLinks:m}){const s=d({root:{props:{...e??{},kind:f}},content:[l],zones:{}});return r(p.Provider,{value:{logoUrl:o?.logoUrl??null,logoReversed:o?.logoReversed??null,logoInkIsDark:o?.logoInkIsDark??null,siteName:n,legalName:t??null,foundedYear:i??null,socialLinks:m??I},children:r(u,{config:a(),data:s})})}export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{Render as n}from"efficient-easel/render";import i from"./BoxHeaderBar.js";import{headerRenderConfig as p}from"../lib/document/render-config.js";import{publishedChromeData as s}from"../lib/document/published-chrome-data.js";import{chromeOwnWidth as a}from"efficient-web-builder/format/lib/content/section-width";function c({group:t}){const r=s({root:{props:{}},content:[t],zones:{}}),o=t.props??{};return e(i,{sticky:o.sticky,topTextColor:o.topTextColor,heightPx:o.heightPx,theme:o.sectionAccent,bandCapped:a(t.props??{}).background==="content",children:e(n,{config:p(),data:r})})}export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as i}from"react/jsx-runtime";import e,{RATING_STARS as u}from"./RatingStars.js";import{useCardRow as c}from"efficient-web-builder/render/components/CardRowContext";import{HideTaker as p}from"efficient-web-builder/render/components/ViewHideRoot";import{RATING_NONE as n}from"../lib/content/rating.js";function f({rating:m,field:r,editing:s}){const t=c(),o=Number.parseFloat(r&&t?t.row[r]??"":""),a=r&&t?Number.isFinite(o)&&o>n?o:n:m;return a>n?i(e,{rating:a}):!s||r&&t?null:i(p,{className:"opacity-60",children:i(e,{rating:u})})}export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,
|
|
1
|
+
"use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import{useState as a}from"react";import{products as _}from"../lib/api/index.js";import j from"efficient-web-builder/render/components/SectionEyebrow";import n,{FieldCaption as q}from"./WebFormField.js";import{renderHeadline as z}from"efficient-web-builder/render/components/goldPhrases";import{FIELD_INPUT_CLASS as l}from"../lib/field-input.js";import{HideTaker as T}from"efficient-web-builder/render/components/ViewHideRoot";import A from"./SectionBand.js";const I="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",M="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-0 pb-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]";function B({eyebrow:u,title:p,designCode:d,omitHead:w=!1,editing:x=!1}={}){const[g,N]=a(""),[o,y]=a(""),[r,S]=a(0),[m,R]=a(""),[f,k]=a(""),[c,h]=a(!1),[C,E]=a(!1),[v,i]=a(null);async function F(t){if(t.preventDefault(),!(x||c)){if(r<1){i("Choose a star rating.");return}h(!0),i(null);try{await _.submitReview({authorName:g.trim(),...o.trim()?{email:o.trim()}:{},rating:r,...m.trim()?{title:m.trim()}:{},body:f.trim(),...d?.trim()?{designCode:d.trim()}:{}}),E(!0)}catch{i("Something went wrong — your review wasn't sent. Please try again.")}finally{h(!1)}}}const b=C?e("p",{role:"status",className:"max-w-[560px] font-serif text-[19px] italic leading-[1.6] text-fg-dim",children:"Thanks — your review will appear once approved."}):s("form",{className:"flex max-w-[720px] flex-col gap-5",onSubmit:F,children:[s("div",{className:"grid grid-cols-2 gap-3 max-[640px]:grid-cols-1",children:[e(n,{label:"Name",required:!0,children:e("input",{type:"text",required:!0,value:g,onChange:t=>N(t.target.value),className:l})}),e(n,{label:"Email — never shown publicly",children:e("input",{type:"email",value:o,onChange:t=>y(t.target.value),className:l})})]}),s("div",{className:"flex flex-col gap-2",children:[e(q,{required:!0,children:"Rating"}),e("div",{role:"group","aria-label":"Rating",className:"flex gap-1",children:[1,2,3,4,5].map(t=>e("button",{type:"button","aria-pressed":r>=t,"aria-label":`${t} star${t===1?"":"s"}`,onClick:()=>{S(t),i(null)},className:["cursor-pointer text-[30px] leading-none transition-colors",r>=t?"text-accent":"text-fg-dim/30 hover:text-fg-dim"].join(" "),children:"★"},t))})]}),e(n,{label:"Review title (optional)",children:e("input",{type:"text",value:m,onChange:t=>R(t.target.value),className:l})}),e(n,{label:"Your review",required:!0,children:e("textarea",{required:!0,rows:5,value:f,onChange:t=>k(t.target.value),className:l+" resize-y"})}),v&&e("p",{role:"alert",className:"font-mono text-[12px] uppercase tracking-[0.18em] text-alert",children:v}),e("button",{type:x?"button":"submit",disabled:c,className:"cursor-pointer self-start bg-btn px-8 py-4 font-mono text-[14px] uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg hover:text-bg disabled:cursor-wait disabled:opacity-60",children:c?"Sending…":"Submit review →"})]});return w?e(A,{className:"relative z-[2] border-t border-line bg-surface",column:M,children:b}):e(T,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:s("div",{className:I,children:[(u??"").trim()&&e(j,{text:u??"",scaled:!1,className:"mb-4 block"}),(p??"").trim()&&e("h2",{className:"mb-12 font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] text-fg max-view-wide:mb-8 max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:z(p??"",!1)}),b]})})}export{B as default};
|
|
@@ -6,6 +6,7 @@ export interface TyrePlpCardProps {
|
|
|
6
6
|
kindLabel?: string | null;
|
|
7
7
|
showBrand?: boolean;
|
|
8
8
|
fieldUsage?: readonly FieldUsageAnswer[];
|
|
9
|
+
cardImage?: number | null;
|
|
9
10
|
name: string;
|
|
10
11
|
slug?: string | null;
|
|
11
12
|
sizes: string[];
|
|
@@ -16,4 +17,4 @@ export interface TyrePlpCardProps {
|
|
|
16
17
|
currency: string;
|
|
17
18
|
editing?: boolean;
|
|
18
19
|
}
|
|
19
|
-
export default function TyrePlpCard({ brand, brandLogo, brandPlate, kindLabel, showBrand, name, slug, sizes, fitSize, rimDiameters, prices, image, currency, editing, fieldUsage, }: TyrePlpCardProps): import("react").JSX.Element;
|
|
20
|
+
export default function TyrePlpCard({ brand, brandLogo, brandPlate, kindLabel, showBrand, name, slug, sizes, fitSize, rimDiameters, prices, image, currency, editing, fieldUsage, cardImage, }: TyrePlpCardProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r}from"react/jsx-runtime";import w from"./BrandPlate.js";import
|
|
1
|
+
"use client";import{jsx as r}from"react/jsx-runtime";import w from"./BrandPlate.js";import C from"./card-pieces/CardBuyButton.js";import P from"./card-pieces/CardFinishSwatches.js";import b from"./card-pieces/CardPrice.js";import S from"./card-pieces/CardSizes.js";import{TyreCardStateProvider as k,useProductCardState as x}from"./card-pieces/ProductCardState.js";import{productCardEyebrow as z}from"./ProductCardEyebrow.js";import B from"./TyreImage.js";import T from"./WheelCardFrame.js";import{cardImageShapeTokens as L}from"efficient-web-builder/format/lib/content/card-image-shape";import{keepForCard as E,NO_FIELD_ANSWERS as F}from"../lib/content/field-usage.js";import{tyreModelLine as I}from"../lib/tyres/tyre-brand-name.js";import{formatSizeRange as j}from"../lib/wheels/size-range.js";function _(t){const e=L(t);return Object.keys(e).length>0?e:void 0}function v({brand:t,brandLogo:e,brandPlate:s=!0,kindLabel:d=null,showBrand:l=!0,name:i,slug:u,sizes:p,fitSize:o=null,rimDiameters:a,prices:c,image:f,currency:n,editing:y=!1,fieldUsage:h=F,cardImage:m}){return r(k,{tyre:{brand:t,brandLogo:e,name:i,slug:u,sizes:p,fitSize:o,rimDiameters:a,prices:c,image:f},currency:n,editing:y,children:r(N,{brandPlate:s,kindLabel:d,showBrand:l,fieldUsage:h,cardImage:m})})}function N({brandPlate:t,kindLabel:e,showBrand:s,fieldUsage:d,cardImage:l}){const i=x();if(i.kind!=="tyre")throw new Error("TyrePlpCard drew outside its own tyre state.");const{tyre:u,pagePath:p,arm:o}=i,{brand:a,brandLogo:c,name:f,sizes:n,rimDiameters:y,image:h}=u,m=E(d),g=[n.length>0?`${n.length} ${n.length===1?"size":"sizes"}`:null,m("rim_diameter")?j(y):null].filter(Boolean).join(" · ");return r(T,{href:p,identityLink:!0,containerProps:{style:_(l),onPointerEnter:o,onTouchStart:o,onFocusCapture:o},image:r(B,{image:h,className:"h-full w-full",sizes:"(max-width: 640px) 90vw, (max-width: 1024px) 45vw, 280px",showBackground:!1}),plate:t?r(w,{brand:a,logo:c}):null,eyebrow:z(e,s&&m("brand")&&a||null),name:I(a??"",f),spec:g,price:r(b,{}),swatches:r(P,{}),sizes:r(S,{}),buy:r(C,{})})}export{v as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TyreProductSummary } from "../lib/api/index.js";
|
|
2
2
|
import type { FieldUsageAnswer } from "../lib/content/field-usage.js";
|
|
3
|
-
export default function TyreSummaryCard({ item, currency, kindLabel, showBrand, fitSize, editing, fieldUsage, }: {
|
|
3
|
+
export default function TyreSummaryCard({ item, currency, kindLabel, showBrand, fitSize, editing, fieldUsage, cardImage, }: {
|
|
4
4
|
item: TyreProductSummary;
|
|
5
5
|
currency: string;
|
|
6
6
|
fitSize?: string | null;
|
|
@@ -8,4 +8,5 @@ export default function TyreSummaryCard({ item, currency, kindLabel, showBrand,
|
|
|
8
8
|
showBrand?: boolean;
|
|
9
9
|
editing?: boolean;
|
|
10
10
|
fieldUsage?: readonly FieldUsageAnswer[];
|
|
11
|
+
cardImage?: number | null;
|
|
11
12
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as o}from"react/jsx-runtime";import
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import u from"./TyrePlpCard.js";function g({item:r,currency:e,kindLabel:a=null,showBrand:s=!0,fitSize:n=null,editing:d=!1,fieldUsage:i,cardImage:l}){return o(u,{brand:r.brand,brandLogo:r.brandLogo,kindLabel:a,showBrand:s,name:r.name,slug:r.slug,sizes:r.sizes,fitSize:n,rimDiameters:r.rimDiameters,prices:r.prices,image:r.coverImage,currency:e,editing:d,fieldUsage:i,cardImage:l})}export{g as default};
|
|
@@ -7,10 +7,9 @@ export declare const cardRowsGap: (zone: {
|
|
|
7
7
|
}) => string;
|
|
8
8
|
export { CARD_PAD_X_PX, GRID_GAP_PX, SET_PLATE_PX, SET_STACK_GAP_PX, SET_STACK_MAX_PX, setBandGapCss, setBandGapPx, setPlateWidthCss, } from "./card-pieces/CardPicture.js";
|
|
9
9
|
export { CARD_SPEC_FIELD_CLASS, cardSpecFields, type CardSpecField } from "./card-pieces/CardSpecs.js";
|
|
10
|
-
export default function WheelCardFrame({ variant, wide,
|
|
10
|
+
export default function WheelCardFrame({ variant, wide, href, identityLink, outline, imageBackgroundFill, containerProps, probes, indexBadge, badges, image, imageSecond, plate, eyebrow, reserveEyebrow, name, spec, price, swatches, sizes, buy, wholeCardLink, }: {
|
|
11
11
|
variant?: "compact" | "catalog";
|
|
12
12
|
wide?: boolean;
|
|
13
|
-
setGridGap?: string;
|
|
14
13
|
href?: string | null;
|
|
15
14
|
identityLink?: boolean;
|
|
16
15
|
outline?: CardOutline;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,Fragment as
|
|
1
|
+
"use client";import{jsx as r,Fragment as m,jsxs as o}from"react/jsx-runtime";import{GAP_LENGTH_VAR as X,GAP_PHONE_LENGTH_VAR as y}from"efficient-web-builder/format/lib/content/container-gap";import g from"next/link";import{CardLookContext as j,CardRow as s}from"./card-pieces/card-row.js";import k from"./card-pieces/CardEyebrow.js";import I from"./card-pieces/CardName.js";import O from"./card-pieces/CardPicture.js";import{CardSpecLine as W}from"./card-pieces/CardSpecs.js";import{cardOutlineClass as B}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as H}from"efficient-web-builder/format/lib/content/card-image-background";const rr="sf-card-rows",ar=a=>({rowGap:0,"--sf-card-row-gap":a}),or=a=>y in a.style?"var(--sf-card-row-gap-auto)":`var(${X})`;import{CARD_PAD_X_PX as cr,GRID_GAP_PX as tr,SET_PLATE_PX as ir,SET_STACK_GAP_PX as lr,SET_STACK_MAX_PX as dr,setBandGapCss as nr,setBandGapPx as fr,setPlateWidthCss as mr}from"./card-pieces/CardPicture.js";import{CARD_SPEC_FIELD_CLASS as _r,cardSpecFields as gr}from"./card-pieces/CardSpecs.js";function K({variant:a="catalog",wide:p=!1,href:e,identityLink:w=!1,outline:C="none",imageBackgroundFill:u=H,containerProps:_,probes:c,indexBadge:t,badges:i,image:x,imageSecond:h,plate:A,eyebrow:v,reserveEyebrow:P=!1,name:G,spec:S,price:R,swatches:b,sizes:E,buy:L,wholeCardLink:D=!1}){const F=a==="catalog",N=r(O,{image:x,imageSecond:h,plate:A,wide:p,imageBackgroundFill:u}),l=[F?"sf-card sf-card-fill group relative flex min-h-[460px] flex-col bg-[var(--card-bg)] px-8 pt-8 pb-8 transition-colors duration-200 hover:bg-[var(--card-bg-hover)] [.sf-card-rows>&]:row-span-9 [.sf-card-rows>&]:mb-[var(--sf-card-row-gap)] [.sf-card-rows>&]:grid [.sf-card-rows>&]:grid-rows-subgrid [.sf-card-rows>&]:gap-y-0":"sf-card sf-card-fill group relative block bg-[var(--card-bg)] p-5 transition-colors duration-300 hover:bg-[var(--card-bg-hover)]",B(C),p?"col-span-2 max-view-wide:col-span-1 @max-[720px]:col-span-1":""].filter(Boolean).join(" "),d=o(m,{children:[N,r(k,{reserve:P,children:v}),r(I,{children:G})]}),n=o(m,{children:[r(W,{children:S}),R??o(m,{children:[r(s,{}),r(s,{})]}),b??r(s,{}),E??r(s,{}),L??r(s,{})]}),f=T=>r(j.Provider,{value:a,children:T});return f(e?w?o("article",{..._,className:l,children:[c,t,i,r(g,{href:e,className:`flex flex-col ${D?"after:absolute after:inset-0 after:content-['']":""} [.sf-card-rows>*>&]:row-span-3 [.sf-card-rows>*>&]:grid [.sf-card-rows>*>&]:grid-rows-subgrid [.sf-card-rows>*>&]:gap-y-0`,children:d}),n]}):o(g,{href:e,className:l,children:[c,t,i,d,n]}):o("article",{..._,className:l,children:[c,t,i,d,n]}))}export{cr as CARD_PAD_X_PX,rr as CARD_ROWS_GRID_CLASS,_r as CARD_SPEC_FIELD_CLASS,tr as GRID_GAP_PX,ir as SET_PLATE_PX,lr as SET_STACK_GAP_PX,dr as SET_STACK_MAX_PX,or as cardRowsGap,ar as cardRowsGridStyle,gr as cardSpecFields,K as default,nr as setBandGapCss,fr as setBandGapPx,mr as setPlateWidthCss};
|
|
@@ -6,7 +6,7 @@ export declare const setBandGapPx: (showImageBackground: boolean) => number;
|
|
|
6
6
|
export declare const setBandGapCss: (showImageBackground: boolean, gridGap?: string) => string;
|
|
7
7
|
export declare const SET_PLATE_PX = 252;
|
|
8
8
|
export declare const SET_STACK_GAP_PX = 16;
|
|
9
|
-
export declare const SET_STACK_MAX_PX: 800
|
|
9
|
+
export declare const SET_STACK_MAX_PX: 800;
|
|
10
10
|
export interface CardPictureSettings {
|
|
11
11
|
image: ReactNode;
|
|
12
12
|
imageSecond?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as m,Fragment as
|
|
1
|
+
"use client";import{jsx as e,jsxs as m,Fragment as k}from"react/jsx-runtime";import v from"next/image";import{useState as Z}from"react";import{HideTaker as _}from"efficient-web-builder/render/components/ViewHideRoot";import{CARD_INDEX_BADGE_CLASS as z,CARD_INDEX_CLASS as G,parseCardIndexFormat as q}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as B,cardImageBackgroundPaints as J,resolveCardImageBackground as D}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as N}from"efficient-web-builder/format/lib/content/card-image-shape";import{sayCount as Q}from"efficient-web-builder/format/lib/editor-words";import{parseSetPicture as V,setSecondSrc as Y}from"../../lib/wheels/set-mode.js";import{coverSrcForWheel as ee,parseCoverIndex as re,resolvePaintedSrc as te}from"../../lib/wheels/cover-rendering.js";import ae from"../WheelPlaceholder.js";import{cardSpinOf as ne}from"../card-spin.js";import{useGridCard as R}from"../GridCardTemplate.js";import T from"./CardPicture.js";import A from"./CardProductBadge.js";import{useHeldCardPicture as le}from"./useHeldCardPicture.js";import{useProductCardState as se}from"./ProductCardState.js";const Ee=["well","full"],ie="well",L=r=>r==="full"?"full":ie;function oe({children:r}){return e("div",{className:"h-full w-full transition-transform duration-500 motion-safe:group-hover:scale-[1.03]",children:r})}function M({fill:r,badge:n,children:o}){const c=J(r);return m("div",{className:`sf-card-image relative aspect-[4/3] overflow-hidden${c?"":" bg-surface"}`,style:c?{backgroundColor:r}:void 0,children:[o,n]})}function ce(r){const n=se();return n.kind==="bundle"?e(de,{state:n,...r}):n.kind!=="wheel"?null:e(me,{state:n,...r})}function de({state:r,imageBackground:n,cardImage:o,showBadge:c,frame:x}){const{bundle:s}=r,{imageSizes:p}=R(),f=L(x)==="full",i=s.components.length,t=s.image?f?e(v,{alt:s.name,src:s.image,fill:!0,sizes:p,className:"object-cover",draggable:!1}):e(v,{alt:s.name,src:s.image,width:1e3,height:1e3,sizes:p,className:"block h-full w-full object-cover",draggable:!1}):e("div",{className:"flex h-full w-full items-center justify-center font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.3em] text-fg-dim",children:Q("{n} piece","{n} pieces",i,{})}),d=e(oe,{children:t}),g=D(n,B),u=c!==!1?e(A,{edge:f}):null;return e(_,{style:N(o),children:f?e(M,{fill:g,badge:u,children:d}):m(k,{children:[u,e(T,{image:d,imageBackgroundFill:g})]})})}function me({state:r,imageBackground:n,cardImage:o,coverIndex:c,indexBadge:x,showBadge:s,frame:p,setPicture:f}){const{wheel:i,sel:t,isSet:d}=r,{hover:g,imageSizes:u,fit:O,rules:S,setGridGap:U}=R(),C=ne(g),W=ee(i,re(c),t.finish?.name,t.shownSrc,O?.holes),[E,H]=Z(()=>new Set),y=a=>{t.pictureFailed(a),H(h=>h.has(a)?h:new Set(h).add(a))},I=te({overrideSrc:W,hookSrc:t.shownSrc,failed:E}),F=(a,h)=>e(v,{alt:h,src:a,width:1e3,height:1e3,sizes:u,className:`block h-full w-full object-contain ${C.className}`,style:C.style,draggable:!1,onError:()=>y(a)},a),X=t.finish?`${i.name} — ${t.finish.name}`:i.name,b=d&&V(f)==="pair",K=b?Y(i.finishes?.find(a=>a.name===t.finish?.name),I):null,l=le({src:I,second:K,alt:X,sizes:u,failed:E,onFailed:y,near:t.nearScreen,holdEmpty:t.awaitingProbe}),$=m(k,{children:[l.src?F(l.src,l.alt):e(ae,{imageLabel:i.name,spin:C}),l.trial]}),P=q(x),w=P!=="off",j=D(n,B);if(L(p)==="full"){const a=m(k,{children:[w?e("span",{"aria-hidden":!0,"data-format":P,className:`${G} ${z}`}):null,e(A,{show:s!==!1,numbered:w,sale:S.sale,axleSets:S.axleSets,edge:!0})]});return e(_,{style:N(o),"data-set-picture":d&&!b?"one":void 0,children:e(M,{fill:j,badge:a,children:m("div",{className:"flex h-full w-full items-center justify-center",children:[$,l.second?F(l.second,`${l.alt} — right`):null]})})})}return m(_,{style:N(o),"data-set-picture":d&&!b?"one":void 0,children:[w?e("span",{"aria-hidden":!0,"data-format":P,className:`${G} ${z}`}):null,e(A,{show:s!==!1,numbered:w,sale:S.sale,axleSets:S.axleSets}),e(T,{image:$,imageSecond:l.second?F(l.second,`${l.alt} — right`):void 0,wide:b,imageBackgroundFill:j,setGridGap:U})]})}export{ie as DEFAULT_PICTURE_FRAME,Ee as PICTURE_FRAMES,ce as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as S}from"react/jsx-runtime";import C from"efficient-web-builder/render/components/Btn";import j,{GALLERY_GRID_ATTR as D,GalleryLinksContext as F}from"../GalleryItem.js";import{SharedPartKinds as K}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as U}from"efficient-web-builder/render/components/goldPhrases";import Z from"efficient-web-builder/render/components/SectionHeader";import $ from"./KindGate.js";import z from"./RecordPhotoGallery.js";import{headIsEmpty as V,ownPadding as W}from"../../lib/sections/own-padding.js";import{PLP_KINDS as X}from"../../lib/catalog/plp-item.js";import{useCurrentProduct as Y}from"../../lib/document/current-product.js";import{SAMPLE_PICTURE_COUNT as T,SAMPLE_RECORD as q,recordPictures as J,useCurrentRecord as Q,useDrawsOtherRecord as ee}from"../../lib/document/current-record.js";import{mediaGroupVehicle as re}from"../../lib/content/source-values.js";import{useSampleProduct as te}from"./useSampleProduct.js";import{say as _}from"efficient-web-builder/format/lib/editor-words";import{galleryLayoutRatio as ie,resolveGalleryLayout as oe}from"efficient-web-builder/format/lib/content/gallery-layout";import{HideTaker as L}from"efficient-web-builder/render/components/ViewHideRoot";const ae=X,O=["photos","lifestyle","accessories","others"];function se(e,o){if(!e)return[];if(o==="all")return O.flatMap(s=>e[s]??[]);const r=O.includes(o)?o:null;return r?e[r]??[]:[]}const k="relative z-[2] bg-bg py-[120px] max-view-wide:py-[70px]",H="relative z-[2] bg-bg pt-0 pb-[120px] max-view-wide:pt-0 max-view-wide:pb-[70px]",M="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]";function ne(e){return ee(!!e.editing)?t(le,{...e}):t($,{kinds:ae,type:"GalleryB",editing:e.editing,children:t(me,{...e})})}function le(e){const{editing:o=!1}=e,r=Q(),s=r?J(r,{firstField:!0}).map(a=>({images:[a.url],eyebrow:a.alt&&a.alt!==r.title?a.alt:void 0,...a.video?{video:a.video}:{}})):o?Array.from({length:T},()=>({images:[""]})):[];return t(A,{...e,tiles:s,owner:{name:(r??q).title},photosOnly:!0,emptyHint:_("This record’s pictures appear here on its page. A record with no pictures draws nothing.")})}function Ae(e){const{rows:o,limit:r,layout:s,editing:a=!1,title:h}=e,d=oe(s),c=typeof r=="number"&&r>0?Math.floor(r):void 0,p=o.filter(n=>typeof n.cover=="string"&&n.cover).map(n=>({images:[n.cover],...n.video?{video:n.video}:{}})),g=a&&p.length===0?Array.from({length:c??T},()=>({images:[""]})):p;return t(A,{...e,tiles:c?g.slice(0,c):g,owner:{name:(h??"").replace(/==/g,"").trim()},photosOnly:!0,tilesAcross:d?.across===3?3:4,tileRatio:d?ie(d):null,emptyHint:_("The website’s pictures appear here, in the order they are put in. A website with no pictures draws nothing.")})}function me({omitHead:e=!1,num:o,title:r,linkText:s,linkHref:a,galleryHref:h="/gallery",submitHref:d="/contact",zone:c="all",photoDisplay:p="covers",previewHover:g,display:n,displayPhone:y,styleOwner:v,editing:f=!1,padTop:G,padBottom:x}){const w=Y(),N=te(f&&!w),u=w?.product??N,b=se(u?.mediaGroups,c).map(i=>({images:(i.items??[]).filter(m=>m.kind==="image").map(m=>m.url),vehicle:re(i),finish:i.finish})).filter(i=>i.images.length>0),R=(p==="auto"?b.length>=4?"covers":"all":p)==="all"?b.flatMap(i=>i.images.map(m=>({images:[m],vehicle:i.vehicle,finish:i.finish}))):b;return t(A,{omitHead:e,num:o,title:r,linkText:s,linkHref:a,galleryHref:h,submitHref:d,previewHover:g,display:n,displayPhone:y,styleOwner:v,editing:f,padTop:G,padBottom:x,tiles:u?R.map(i=>({images:i.images,eyebrow:i.vehicle||void 0,meta:i.finish})):[],owner:{name:u?.name??"",href:u?.href,process:u?.eyebrow},emptyHint:_("This product’s photos appear here on a product page. Add media groups in the product’s Media tab.")})}function A({omitHead:e=!1,num:o,title:r,linkText:s,linkHref:a,galleryHref:h="/gallery",submitHref:d="/contact",previewHover:c,display:p,displayPhone:g,styleOwner:n,editing:y=!1,tiles:v,owner:f,emptyHint:G,photosOnly:x=!1,tilesAcross:w,tileRatio:N=null,padTop:u,padBottom:b}){const P=s?{text:s,href:a||"#"}:void 0,R=r?U(r,!1):void 0,i=e?null:t(Z,{num:o,title:R,link:P}),m=!y&&V(o,r,P?.text)?null:i,E=W(u,b);return v.length===0?y?t(L,{as:"section",className:e?H:k,style:E,children:S("div",{className:M,children:[m,t("p",{className:"mt-8 border-t border-line py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:G})]})}):null:t(L,{as:"section",className:e?H:k,style:E,children:S("div",{className:M,children:[m,x?t(z,{pictures:v.map(l=>({url:l.images[0]??"",alt:l.eyebrow,video:l.video})),name:f.name,editing:y,...w?{fit:"tiles",across:w,ratio:N}:{}}):t(F.Provider,{value:{galleryHref:h,submitHref:d,previewHover:c,display:p,displayPhone:g,styleOwner:n,photosOnly:x},children:t(K,{children:t("div",{[D]:"",className:"grid grid-cols-4 gap-2 max-[1500px]:grid-cols-3 max-view-wide:grid-cols-1 max-view-wide:gap-1",children:v.map((l,I)=>t(j,{image:l.images[0],photos:l.images.slice(1).map(B=>({src:B})),href:f.href,process:f.process,eyebrow:l.eyebrow,name:f.name,meta:l.meta,editing:y},`${l.eyebrow}-${I}`))})})}),!x&&t("div",{className:"mt-12 flex flex-col items-center gap-3",children:t(C,{href:h,variant:"ghost",children:"See Gallery"})})]})})}export{Ae as SourcedGalleryGrid,ne as default,ae as supportedKinds};
|
|
@@ -4,10 +4,11 @@ export interface GalleryPicture {
|
|
|
4
4
|
video?: string;
|
|
5
5
|
}
|
|
6
6
|
export declare function pictureLabel(picture: GalleryPicture, name: string): string;
|
|
7
|
-
export default function RecordPhotoGallery({ pictures, name, editing, fit, across, }: {
|
|
7
|
+
export default function RecordPhotoGallery({ pictures, name, editing, fit, across, ratio, }: {
|
|
8
8
|
pictures: readonly GalleryPicture[];
|
|
9
9
|
fit?: "section" | "column" | "tiles";
|
|
10
10
|
across?: 3 | 4;
|
|
11
|
+
ratio?: readonly [number, number] | null;
|
|
11
12
|
name: string;
|
|
12
13
|
editing?: boolean;
|
|
13
14
|
}): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,Fragment as
|
|
1
|
+
"use client";import{jsx as t,Fragment as v,jsxs as c}from"react/jsx-runtime";import{useCallback as M,useRef as P,useState as $}from"react";import{sizedImage as R}from"efficient-web-builder/format/lib/sized-image";import U from"efficient-web-builder/render/components/Placeholder";import z,{LightboxClose as G,LIGHTBOX_CLOSE_TINT as D}from"../Lightbox.js";import{GALLERY_GRID_ATTR as S}from"../GalleryItem.js";const H="(max-width: 1600px) 100vw, 1600px",X="(max-width: 1100px) 100vw, 50vw",Z="(max-width: 800px) 30vw, 200px",F="100vw";function g(s,l){return s.video?l?`Play video of ${l}`:"Play video":l?`Open photo of ${l}`:"Open photo"}function W({small:s=!1}){return t("span",{"aria-hidden":!0,"data-play-badge":"",className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:t("span",{className:`flex items-center justify-center rounded-full bg-bg/75 text-fg ${s?"h-8 w-8 text-[length:12px]":"h-16 w-16 text-[length:22px]"}`,children:"▶"})})}const q="relative block w-full overflow-hidden bg-surface-2",Y="block h-[min(78vh,820px)] w-full object-cover max-view-wide:h-[min(70vh,560px)]",J="block aspect-[4/5] max-h-[80vh] w-full object-cover",K="grid grid-cols-4 gap-2",Q="relative block aspect-square w-full overflow-hidden bg-surface-2",O="block h-full w-full object-cover",V="grid grid-cols-6 gap-2 max-view-wide:grid-cols-4",ee={3:"grid grid-cols-3 gap-2 max-view-wide:grid-cols-2",4:"grid grid-cols-4 gap-2 max-view-wide:grid-cols-2"},te="relative block aspect-[4/5] w-full overflow-hidden bg-surface-2",le="relative block w-full overflow-hidden bg-surface-2",oe="(max-width: 800px) 50vw, 25vw",se="cursor-pointer text-left focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",T="absolute top-1/2 z-[2] flex h-14 w-14 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,22px)] text-fg-dim transition-colors hover:border-accent hover:text-accent max-[700px]:h-11 max-[700px]:w-11";function ne({pictures:s,name:l,editing:w=!1,fit:y="section",across:j=4,ratio:f=null}){const[B,_]=$(!1),[i,h]=$(0),x=P(null),C=M(e=>{e?x.current=e:(x.current?.pause(),x.current=null)},[]),o=s.length,N=y==="column";if(o===0)return null;const k=()=>h(e=>(e-1+o)%o),E=()=>h(e=>(e+1)%o),A=e=>{h(e),_(!0)},r=s[Math.min(i,o-1)],u=(e,n,a,p)=>e.url?t("span",{className:`${a} relative`,children:t(U,{label:e.alt||l||"photo",src:e.url,alt:e.alt||l,sizes:n,objectFit:"cover",showBackground:!1})}):t("span",{"aria-hidden":!0,className:`${a} bg-surface-2`}),d=y==="tiles",b=f?{aspectRatio:`${f[0]} / ${f[1]}`}:null,m=(e,n,a)=>{const p=c(v,{children:[d?u(e,oe,O,800):a?N?u(e,X,J,1200):u(e,H,Y,1600):u(e,Z,O,400),e.video&&t(W,{small:!a&&!d})]}),I=d?b?le:te:a?q:Q,L=d&&b?b:void 0;return w?t("div",{className:I,style:L,children:p}):t("button",{type:"button","aria-label":g(e,l),onClick:()=>A(n),className:`${I} ${se}`,style:L,children:p})};return c(v,{children:[d?t("ul",{[S]:"","data-record-gallery":"tiles",className:ee[j===3?3:4],children:s.map((e,n)=>t("li",{children:m(e,n,!1)},`${e.url}-${n}`))}):c("div",{[S]:"","data-record-gallery":"",className:"flex flex-col gap-2",children:[m(s[0],0,!0),o>1&&t("ul",{className:N?K:V,children:s.slice(1).map((e,n)=>t("li",{children:m(e,n+1,!1)},`${e.url}-${n+1}`))})]}),!w&&t(z,{open:B,onClose:()=>_(!1),label:g(r,l),onPrev:o>1?k:void 0,onNext:o>1?E:void 0,className:"flex items-center justify-center p-6 max-[700px]:p-3",children:c("div",{onClick:e=>e.stopPropagation(),className:"relative flex h-full w-full items-center justify-center",children:[t(G,{className:"absolute right-0 top-0 z-[3] flex h-12 w-12 cursor-pointer items-center justify-center border border-line font-mono text-[length:var(--size-label,18px)] text-fg-dim transition-colors hover:border-accent hover:text-fg",style:{background:D},children:"✕"}),r.video?t("video",{ref:C,controls:!0,playsInline:!0,preload:"metadata",poster:r.url,src:r.video,"aria-label":g(r,l),className:"block max-h-[calc(100vh-120px)] max-w-full bg-bg"},`video-${i}`):t("img",{...R(r.url,{fallbackWidth:1600}),sizes:F,alt:`${r.alt||l||"Photo"} — ${i+1} of ${o}`,className:"block max-h-[calc(100vh-120px)] max-w-full object-contain"},`photo-${i}`),o>1&&c(v,{children:[t("button",{type:"button","aria-label":"Previous photo",onClick:k,className:`${T} left-0`,children:"◁"}),t("button",{type:"button","aria-label":"Next photo",onClick:E,className:`${T} right-0`,children:"▷"}),c("span",{"data-gallery-counter":"",className:"absolute bottom-0 left-1/2 -translate-x-1/2 border border-fg-dim/30 bg-overlay-scrim/50 px-4 py-1.5 font-mono text-[length:var(--size-label,14px)] uppercase tracking-[0.22em] text-fg-dim backdrop-blur-[4px]",children:[i+1," / ",o]})]})]})})]})}export{ne as default,g as pictureLabel};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type {
|
|
3
|
-
import { type CardIndexFormat, type CardOutline } from "efficient-web-builder/format/lib/sections/product-card-style";
|
|
1
|
+
import { type CardHoverDrawn } from "efficient-web-builder/format/lib/animation/hover";
|
|
2
|
+
import type { SlotComponent } from "efficient-easel/blocks";
|
|
4
3
|
import { type FieldUsageAnswer } from "../../lib/content/field-usage.js";
|
|
5
4
|
import type { ProductSummary, WheelSummary } from "../../lib/api/index.js";
|
|
6
5
|
import { type PlpColumns } from "../../lib/wheels/plp-grid.js";
|
|
@@ -24,21 +23,13 @@ export interface AlloyWheelsListingProps {
|
|
|
24
23
|
requestQuery?: string;
|
|
25
24
|
wheels?: WheelSummary[];
|
|
26
25
|
editing?: boolean;
|
|
27
|
-
|
|
26
|
+
ownerId?: string;
|
|
27
|
+
template?: SlotComponent;
|
|
28
28
|
cardImage?: number | null;
|
|
29
29
|
hover?: CardHoverDrawn;
|
|
30
|
-
imageBackground?: CardImageBackground;
|
|
31
|
-
showBadge?: boolean;
|
|
32
|
-
showCardSizes?: boolean;
|
|
33
|
-
showCardBuy?: boolean;
|
|
34
|
-
showCardPage?: boolean;
|
|
35
|
-
showCardPrice?: boolean;
|
|
36
|
-
showCardFinishes?: boolean;
|
|
37
|
-
outline?: CardOutline;
|
|
38
|
-
indexBadge?: CardIndexFormat;
|
|
39
30
|
}
|
|
40
31
|
export declare const PLP_GATE_DEFAULTS: {
|
|
41
32
|
readonly heading: "Let's find wheels that fit your car.";
|
|
42
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.";
|
|
43
34
|
};
|
|
44
|
-
export default function AlloyWheelsListing({ heading, intro, askForCar, gateHeading, gateIntro, perPage, columns, defaultSort, hiddenFacets, fieldUsage, showPrice, showInStock, kinds, products, wheels, requestQuery, editing,
|
|
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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as p,Fragment as
|
|
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};
|
|
@@ -335,7 +335,9 @@ export declare const fitment: {
|
|
|
335
335
|
export declare const products: {
|
|
336
336
|
listWheels: (process?: string | null, opts?: ListReadOpts) => Promise<WheelSummary[]>;
|
|
337
337
|
listWheelsBySlug: (slugs: readonly string[], opts?: ListReadOpts) => Promise<WheelSummary[]>;
|
|
338
|
-
listCatalog: (kinds: readonly ProductKind[], vehicle?: TyreFitVehicleQuery | null
|
|
338
|
+
listCatalog: (kinds: readonly ProductKind[], vehicle?: TyreFitVehicleQuery | null, opts?: {
|
|
339
|
+
maxRows?: number;
|
|
340
|
+
}) => Promise<ProductSummary[]>;
|
|
339
341
|
getWheel: (slug: string) => Promise<Wheel>;
|
|
340
342
|
getTyre: (slug: string) => Promise<Tyre>;
|
|
341
343
|
listBundles: (opts?: ListReadOpts) => Promise<Bundle[]>;
|