efficient-storefront-blocks 0.119.2 → 0.120.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 +64 -0
- package/dist/chunks/{EditorPreviewCheckout-URRXDD74.js → EditorPreviewCheckout-BJXYQD6G.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-IA4YGOTE.js → SiteEditorProvider-YXH7PBRW.js} +1 -1
- package/dist/chunks/{chunk-R4NVEFBL.js → chunk-3E2YAOJH.js} +1 -1
- package/dist/chunks/{chunk-P6T6KGL3.js → chunk-3K5ORZAD.js} +1 -1
- package/dist/chunks/{chunk-DJBGDTYI.js → chunk-JM7XA3F6.js} +26 -26
- package/dist/chunks/{fitment-data-PUHJNPTL.js → fitment-data-SMLFCY4A.js} +1 -1
- package/dist/contract.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductEyebrow/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductGallery/fields.d.ts +0 -4
- package/dist/editor/lib/document/blocks/commerce/ProductGallery/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductHero/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductName/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
- package/dist/editor/lib/document/blocks/commerce/title-look-row.d.ts +4 -0
- package/dist/editor/lib/document/blocks/commerce/title-look-row.js +1 -0
- package/dist/editor/lib/document/config.d.ts +1 -0
- package/dist/editor/lib/document/config.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +12 -5
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.js +31 -31
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/LinkedProductHero.d.ts +4 -13
- package/dist/render/components/LinkedProductHero.js +1 -1
- package/dist/render/components/ProductHeroPanel.d.ts +4 -12
- package/dist/render/components/ProductHeroPanel.js +1 -1
- package/dist/render/components/PublishedFooter.d.ts +3 -1
- package/dist/render/components/PublishedFooter.js +1 -1
- package/dist/render/components/PublishedHeader.d.ts +3 -1
- package/dist/render/components/PublishedHeader.js +1 -1
- package/dist/render/components/card-pieces/CardName.d.ts +2 -0
- package/dist/render/components/card-pieces/CardName.js +1 -1
- package/dist/render/components/card-pieces/HeadlineEyebrow.d.ts +7 -0
- package/dist/render/components/card-pieces/HeadlineEyebrow.js +1 -0
- package/dist/render/components/card-pieces/HeadlineName.d.ts +6 -0
- package/dist/render/components/card-pieces/HeadlineName.js +1 -0
- package/dist/render/components/card-pieces/ProductCardState.d.ts +12 -0
- package/dist/render/components/card-pieces/ProductCardState.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicProductGallery.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicProductHero.d.ts +4 -13
- package/dist/render/components/pdp-dynamic/DynamicProductHero.js +1 -1
- package/dist/render/lib/content/hero-seed.d.ts +22 -0
- package/dist/render/lib/content/hero-seed.js +1 -0
- package/dist/render/lib/content/title-look.d.ts +8 -0
- package/dist/render/lib/content/title-look.js +1 -0
- package/dist/render/lib/document/blocks/commerce/ProductEyebrow/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductHero/meta.d.ts +0 -4
- package/dist/render/lib/document/blocks/commerce/ProductHero/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductHero/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductName/render.js +1 -1
- package/dist/render/lib/document/card-templates.js +1 -1
- package/dist/render/lib/document/render-config.d.ts +1 -0
- package/dist/render/lib/document/render-config.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-producthero.d.ts +1 -0
- package/dist/render/lib/document/section-to-box-rows-producthero.js +1 -0
- package/dist/render/lib/sections/hero-price-placement.d.ts +2 -5
- package/dist/render/lib/sections/hero-price-placement.js +1 -1
- package/dist/render/lib/sections/hero-trust-bullets.d.ts +0 -1
- package/dist/render/lib/sections/hero-trust-bullets.js +1 -1
- package/dist/words.d.ts +12 -5
- package/dist/words.js +1 -1
- package/package.json +4 -3
- package/dist/render/components/product-hero/trust-bullets.d.ts +0 -5
- package/dist/render/components/product-hero/trust-bullets.js +0 -1
- package/dist/render/lib/content/hero-price-seed.d.ts +0 -4
- package/dist/render/lib/content/hero-price-seed.js +0 -1
- /package/dist/chunks/{chunk-YY4RMNWM.js → chunk-ITCY3GG4.js} +0 -0
- /package/dist/chunks/{chunk-DJBGDTYI.js.LEGAL.txt → chunk-JM7XA3F6.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-5VQNKBJK.js → chunk-MR37ISPW.js} +0 -0
|
@@ -1,31 +1,22 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type HeroPriceTemplateProps } from "./ProductHeroPanel.js";
|
|
3
|
-
import type { HeroPricePlacement } from "../lib/sections/hero-price-placement.js";
|
|
1
|
+
import { type HeroTemplateProps } from "./ProductHeroPanel.js";
|
|
4
2
|
import type { HeroLayout, HeroTextAlign } from "../lib/sections/hero-arrangement.js";
|
|
5
|
-
import type { HeroGalleryMode, HeroImageFit } from "../lib/sections/hero-gallery.js";
|
|
6
3
|
import { type LinkedHeroRecord } from "../lib/document/linked-hero-hydrate.js";
|
|
7
4
|
export type { LinkedHeroRecord };
|
|
8
|
-
interface HeroArrangement extends
|
|
5
|
+
interface HeroArrangement extends HeroTemplateProps {
|
|
9
6
|
heroLayout?: HeroLayout;
|
|
10
7
|
imageRatio?: number;
|
|
11
8
|
textAlign?: HeroTextAlign;
|
|
12
9
|
showSpecTable?: boolean;
|
|
13
|
-
showPriceQuote?: boolean;
|
|
14
|
-
galleryMode?: HeroGalleryMode;
|
|
15
|
-
imageFit?: HeroImageFit;
|
|
16
|
-
trustBullets?: ReactNode;
|
|
17
10
|
}
|
|
18
|
-
export default function LinkedProductHero({ slug, kind, editing,
|
|
11
|
+
export default function LinkedProductHero({ slug, kind, editing, showVehicleFitment, initialRecord, ...arrangement }: {
|
|
19
12
|
slug: string;
|
|
20
13
|
kind?: "wheel" | "tyre";
|
|
21
14
|
editing?: boolean;
|
|
22
15
|
initialRecord?: LinkedHeroRecord;
|
|
23
|
-
pricePlacement?: HeroPricePlacement;
|
|
24
16
|
showVehicleFitment?: boolean;
|
|
25
17
|
} & HeroArrangement): import("react").JSX.Element;
|
|
26
|
-
export declare function LinkedHeroLoaded({ record, editing,
|
|
18
|
+
export declare function LinkedHeroLoaded({ record, editing, showVehicleFitment, ...arrangement }: {
|
|
27
19
|
record: LinkedHeroRecord;
|
|
28
20
|
editing?: boolean;
|
|
29
|
-
pricePlacement?: HeroPricePlacement;
|
|
30
21
|
showVehicleFitment?: boolean;
|
|
31
22
|
} & HeroArrangement): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as i,Fragment as
|
|
1
|
+
"use client";import{jsx as i,Fragment as g,jsxs as L}from"react/jsx-runtime";import{useEffect as y,useState as a}from"react";import w from"./ProductHeroPanel.js";import P from"./ProductLightbox.js";import h from"./SectionNotice.js";import{useLightbox as b}from"./useLightbox.js";import{useProductSelection as j}from"./useProductSelection.js";import{fromTyre as k}from"../lib/catalog/from-tyre.js";import{fromWheel as F}from"../lib/catalog/from-wheel.js";import{products as p}from"../lib/api/index.js";import{matchingLinkedRecord as H}from"../lib/document/linked-hero-hydrate.js";function S({slug:e,kind:r="wheel",editing:c=!1,showVehicleFitment:s=!0,initialRecord:n,...l}){const t=H(n,r,e),[u,m]=a(t??null),[x,f]=a(!1);return y(()=>{if(f(!1),t){m(t);return}let d=!1;return m(null),(r==="tyre"?p.getTyre(e).then(o=>({kind:"tyre",tyre:o})):p.getWheel(e).then(o=>({kind:"wheel",wheel:o}))).then(o=>{d||m(o)}).catch(()=>{d||f(!0)}),()=>{d=!0}},[e,r,t]),x?i(h,{size:"tall",children:"Couldn’t load this product."}):u?i(_,{record:u,editing:c,showVehicleFitment:s,...l}):i(h,{size:"tall",children:"Loading product…"})}function _({record:e,editing:r=!1,showVehicleFitment:c=!0,...s}){const n=e.kind==="tyre"?k(e.tyre):F(e.wheel),l=j(n,{editing:r}),t=b();return L(g,{children:[i(w,{product:n,selection:l,onLightbox:t.open,editing:r,showVehicleFitment:c,...s}),i(P,{item:t.item,onClose:t.close})]})}export{_ as LinkedHeroLoaded,S as default};
|
|
@@ -1,33 +1,25 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
1
|
import type { ProductSelection } from "./useProductSelection.js";
|
|
3
2
|
import { type StoreProduct } from "../lib/catalog/store-product.js";
|
|
4
|
-
import type { HeroPricePlacement } from "../lib/sections/hero-price-placement.js";
|
|
5
3
|
import { type HeroLayout, type HeroTextAlign } from "../lib/sections/hero-arrangement.js";
|
|
6
|
-
import { type HeroGalleryMode, type HeroImageFit } from "../lib/sections/hero-gallery.js";
|
|
7
4
|
import type { CardPressTitle } from "efficient-web-builder/render/lib/document/card-press-titles";
|
|
8
5
|
import type { SlotComponent } from "efficient-easel/blocks";
|
|
9
|
-
export interface
|
|
6
|
+
export interface HeroTemplateProps {
|
|
10
7
|
nodeId?: string;
|
|
11
|
-
|
|
8
|
+
template: SlotComponent | undefined;
|
|
12
9
|
optionTemplate?: SlotComponent;
|
|
13
10
|
buyTemplate: SlotComponent | undefined;
|
|
14
11
|
optionPressTitles?: readonly CardPressTitle[];
|
|
15
12
|
}
|
|
16
|
-
interface Props extends
|
|
13
|
+
interface Props extends HeroTemplateProps {
|
|
17
14
|
product: StoreProduct;
|
|
18
15
|
selection: ProductSelection;
|
|
19
16
|
onLightbox: (src: string, alt: string) => void;
|
|
20
17
|
editing?: boolean;
|
|
21
|
-
pricePlacement?: HeroPricePlacement;
|
|
22
18
|
showVehicleFitment?: boolean;
|
|
23
19
|
heroLayout?: HeroLayout;
|
|
24
20
|
imageRatio?: number;
|
|
25
21
|
textAlign?: HeroTextAlign;
|
|
26
22
|
showSpecTable?: boolean;
|
|
27
|
-
showPriceQuote?: boolean;
|
|
28
|
-
galleryMode?: HeroGalleryMode;
|
|
29
|
-
imageFit?: HeroImageFit;
|
|
30
|
-
trustBullets?: ReactNode;
|
|
31
23
|
}
|
|
32
|
-
export default function ProductHeroPanel({ product, selection, onLightbox, editing,
|
|
24
|
+
export default function ProductHeroPanel({ product, selection, onLightbox, editing, showVehicleFitment, heroLayout, imageRatio, textAlign, showSpecTable, nodeId, template, optionTemplate, optionPressTitles, buyTemplate, }: Props): import("react").JSX.Element;
|
|
33
25
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as a,Fragment as h,jsxs as n}from"react/jsx-runtime";import te from"next/link";import{useEffect as ae,useRef as Ce,useState as Ie}from"react";import{useCart as $e}from"./CartContext.js";import{useSiteTakesOrders as Pe}from"./SiteRecordContext.js";import He from"./EmailCaptureForm.js";import{useEnglish as le}from"./EnglishVariant.js";import{MarkedLabel as M,heroView as Me}from"./product-hero/hero-view.js";import De from"./ProductGallery.js";import{useRootIsDark as ze}from"efficient-shell/theme";import{useStockAlertSignup as Fe}from"./useStockAlertSignup.js";import{SPARE_WORDS as Ue,productCartLine as Be}from"../lib/catalog/purchase.js";import{OPTION_ROW_ATTR as je}from"../lib/catalog/store-product.js";import{resolvingRowsAnswered as Ge}from"../lib/catalog/product-options.js";import{trackViewItem as Ve}from"../lib/google-tag.js";import{DEFAULT_HERO_LAYOUT as We,DEFAULT_HERO_RATIO as Ye,DEFAULT_HERO_TEXT_ALIGN as Xe,parseHeroLayout as Ke,parseHeroRatio as qe,parseHeroTextAlign as Qe}from"../lib/sections/hero-arrangement.js";import{DEFAULT_HERO_GALLERY_MODE as Je,DEFAULT_HERO_IMAGE_FIT as Ze}from"../lib/sections/hero-gallery.js";import{MAX_SPARES as et,UNITS_PER_SET as ne,formatPrice as re}from"../lib/commerce.js";import{formatSelectionPrice as tt,setPriceLabel as at}from"../lib/wheels/price-display.js";import{productIsDually as lt,productIsTwoObjects as nt,setSuppressesRow as rt}from"../lib/wheels/set-mode.js";import{CONTENT_CAP_GUTTER as se}from"../lib/sections/content-cap-gutter.js";import{CardTemplateRows as D}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as ie}from"efficient-web-builder/render/components/SiteGutterFrame";import{BLOCK_ALIGN_BOX_WORD as st,BLOCK_ALIGN_TEXT as it}from"efficient-web-builder/format/lib/content/block-align";import{BOX_ALIGN_CLASS as ot}from"efficient-web-builder/format/lib/content/box-layout";import{cardRow as ct}from"efficient-web-builder/format/lib/content/card-template";import{optionCardRows as mt}from"../lib/sections/filter-option-rows.js";import{HERO_OPTION_SLOT as pt}from"../lib/content/hero-option-seed.js";import{HERO_BUY_SLOT as dt,HERO_QUANTITY_PART as ft,HERO_SAVE_PART as ht}from"../lib/content/hero-buy-seed.js";import ut from"./card-pieces/CardQuantity.js";import gt from"./card-pieces/CardSave.js";import bt from"./card-pieces/CardStatedFacts.js";import{HeroStateProvider as z}from"./card-pieces/ProductCardState.js";import{PRODUCT_HERO_TYPE as F}from"../lib/document/document-nodes.js";const xt=4e3;function vt(t){return t?[t.year,t.make,t.model,t.modification].join("-"):""}const oe=[{}],kt=oe,Tt=(t,r)=>r===ft?a(ut,{}):r===ht?a(gt,{}):null,yt=.72;function _t(t){const r=t.trim().split(/\s+/).filter(Boolean);if(r.length===0)return;const p=r.map((i,o)=>i.length+(r.length>1&&o===r.length-1?1:0));return`calc(100cqi / ${(Math.max(...p)*yt).toFixed(2)})`}function Nt({product:t,selection:r,onLightbox:p,editing:i=!1,pricePlacement:o="top",showVehicleFitment:d=!0,heroLayout:l=We,imageRatio:S=Ye,textAlign:me=Xe,showSpecTable:pe=!0,showPriceQuote:w=!0,galleryMode:de=Je,imageFit:fe=Ze,trustBullets:he,nodeId:O,priceTemplate:ue,optionTemplate:ge,optionPressTitles:be,buyTemplate:xe}){const ve=le(),b=Ke(l),U=Qe(me),_=qe(S),ke=b==="imageRight"?`${100-_}fr ${_}fr`:`${_}fr ${100-_}fr`,{picked:Te,pick:B,qty:j,setQty:ye,choice:v,setChoice:N,angleIdx:_e,setAngleIdx:Ne,showValidation:Se,setShowValidation:R,manualMode:G,vehicle:E,rows:V,facts:we,part:u,outOfStock:W,offer:c,preOrder:L,canAddToCart:Y,currency:x,price:f,set:X,msrpLabel:Oe}=r,s=Me(t,r,i),A=lt(t),Re=nt(t),C=d?s.vehicle:null,Ee=d?s.vehicleMemory:null,I=!ze({whenUnset:!0}),{warmCatalog:K}=$e(),g=Pe();ae(()=>{!i&&g&&K(t.kind,t.slug)},[i,g,t.kind,t.slug,K]);const q=V.filter(e=>!L||e.values.length>0),Q=q.filter(e=>e.role==="resolves"),$=q.filter(e=>e.role==="describes"&&!rt(Re,e.key)),J=$.findIndex(e=>e.chosen===null),Z=(!C||!s.vehicleAnswersSpecs||r.fitmentSet)&&Ge(V,L)?J===-1?$:$.slice(0,J+1):[],Le=[...Q,...Z];function Ae(){return Y?(R(!1),i?null:Be(t,u,Te,{choice:v,qty:j},{fitmentLabel:G?s.specCaption:E.appliedName?`For ${E.appliedName}`:"",fitmentKey:G?`manual|${s.specCaption}`:`vehicle|${vt(E.applied?.vehicle)}`})):(R(!0),window.setTimeout(()=>R(!1),xt),null)}const P={kind:"hero",msrpLabel:Oe||null,amount:A?at(f,x):tt(f,x),unitLabel:f.priced?s.unitLabel:null,packBadge:f.setTotal!=null?`${c.quantityLabel}: ${re(X,x)}`:null,buy:{isSet:A,priced:f.priced,outOfStock:W,canAdd:Y,totalLabel:f.setTotal!=null?re(X,x):null,lineToAdd:Ae},qty:j,setQty:ye,takesQty:g&&!(A&&!f.priced),save:{slug:t.slug,name:t.name},facts:pe?we:null},H=a(z,{value:P,children:a(D,{ownerId:O??"",ownerType:F,Template:ue,rows:oe,fallback:null,children:e=>e})}),k={nodeId:O??"",template:ge,pressTitles:be,editing:i},ee=Ce(null);return ae(()=>{i||ee.current===t.slug||(ee.current=t.slug,Ve({itemId:u?`${t.slug}|${u.id}`:t.slug,itemName:t.name,variant:s.metaValue,pricePerSet:f.setTotal??f.fromSetTotal??0,currency:x}))},[i,t.slug,t.name,s.metaValue,u,f,x]),n(h,{children:[a("nav",{className:`border-b border-line ${se} pt-4 pb-4 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]`,style:I?void 0:{background:"var(--section-bg)"},children:t.crumbs.map((e,m)=>n("span",{children:[m>0&&n(h,{children:[a("span",{className:"mx-3 text-accent",children:"/"}),a("wbr",{})]}),e.href?a(te,{href:e.href,className:"hover:text-fg",children:a(M,{text:e.label})}):a("span",{className:"text-fg",children:a(M,{text:e.label})})]},`${e.label}-${m}`))}),n("section",{"data-hero-layout":b,"data-hero-align":U,className:[`grid gap-10 ${se} py-14 max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))] max-view-tablet:py-8`,b==="stacked"?"grid-cols-1":"[grid-template-columns:var(--hero-cols)] max-view-desktop:[grid-template-columns:minmax(0,1fr)]"].join(" "),style:{...I?{}:{background:"var(--section-bg)"},...b==="stacked"?{}:{"--hero-cols":ke}},children:[a(De,{product:t,view:s,angleIdx:_e,onSelect:Ne,isLight:I,onLightbox:p,galleryMode:de,imageFit:fe,style:b==="imageRight"?{order:2}:void 0}),n("div",{className:["flex flex-col gap-7",U==="center"?`${ot[st.center]} ${it.center}`:""].filter(Boolean).join(" "),style:b==="imageRight"?{order:1}:void 0,children:[n("div",{className:"w-full [container-type:inline-size]",children:[n("div",{className:"mb-2.5 flex items-center gap-2.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.2em] text-accent",children:[a("span",{children:a(M,{text:t.eyebrow})}),t.badge&&n(h,{children:[a("span",{children:"·"}),a("span",{children:t.badge})]})]}),a("h1",{className:"font-heading2 text-[length:min(min(var(--size-headingMedium,clamp(48px,5.5vw,84px)),var(--hero-name-fit,9999px)),var(--sf-heading-max,9999px))] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[0.92] tracking-[-0.035em]",style:{"--hero-name-fit":_t(s.heading)},children:(()=>{const e=s.heading.lastIndexOf(" ");if(e===-1)return s.heading;const m=s.heading.slice(0,e),T=s.heading.slice(e+1);return n(h,{children:[m," ",n("em",{className:"font-normal italic text-accent",children:[T,"."]})]})})()})]}),o!=="belowSpecs"&&w&&H,Ee,Q.map(e=>a(ce,{row:e,onPick:B,options:k},e.key)),L&&s.preOrder?n(h,{children:[o==="belowSpecs"&&w&&H,s.preOrder]}):n(h,{children:[C,Z.map(e=>a(ce,{row:e,onPick:B,options:k},e.key)),a(z,{value:P,children:a(bt,{})}),(c.packs.length>0||g&&(c.extra||c.spareCounts.length>0))&&n("div",{className:"border-b border-line pb-[26px]",children:[c.packs.length>0&&n(h,{children:[a("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:"How many"}),a("div",{className:"flex flex-wrap gap-1.5",children:a(y,{hero:k,values:c.packs,item:e=>({label:e.label}),picked:e=>v.unit===e.value,press:e=>()=>N(m=>({...m,unit:e.value}))})})]}),g&&c.extra&&n("label",{className:`${c.packs.length>0?"mt-3.5 ":""}flex cursor-pointer items-center gap-3 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-fg`,children:[a("input",{type:"checkbox",checked:v.spares>0,onChange:e=>N(m=>({...m,spares:e.target.checked?et:0})),className:"h-4 w-4 cursor-pointer accent-[var(--accent)]"}),c.extra.label]}),g&&c.spareCounts.length>0&&n(h,{children:[a("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:Ue.howMany}),a("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:flex-wrap",children:a(y,{hero:k,values:c.spareCounts,item:e=>({label:`${e.value} · ${e.label}`}),picked:e=>v.spares===e.value-ne,press:e=>()=>N(m=>({...m,spares:e.value-ne}))})})]}),g&&c.spareSide&&n(h,{children:[a("div",{className:"mb-3.5 mt-[26px] font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:c.spareSide.label}),a("div",{className:"flex flex-wrap gap-1.5",children:a(y,{hero:k,values:c.spareSide.options,item:e=>({label:e.label}),picked:e=>v.spareSide===e.value,press:e=>()=>N(m=>({...m,spareSide:e.value}))})})]})]}),o==="belowSpecs"&&w&&H,a(z,{value:P,children:a(ie,{children:a(D,{ownerId:O??"",ownerType:F,slot:dt,Template:xe,rows:kt,fallback:null,hostParts:Tt,children:e=>e})})}),W&&u&&a(St,{partNumbers:u.components.map(e=>e.partNumber),productSlug:t.slug},u.id),Se&&(()=>{const e=Le.filter(T=>T.chosen===null).map(T=>ve(T.prompt).replace(/^Select\s+/i,""));if(C&&s.vehicleAnswersSpecs&&!r.fitmentSet&&e.push("vehicle fitment"),e.length===0)return null;const m=e.length===1?e[0]:e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e.at(-1)}`;return n("p",{role:"alert",className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em]",style:{color:"var(--alert)"},children:["Please select ",m," first."]})})()]}),he]})]})]})}function ce({row:t,onPick:r,options:p}){const i=le();if(t.values.length===0&&!t.empty)return null;const o=t.values.find(l=>l.value===t.chosen),d=o&&[o.label,o.note].filter(Boolean).join(" · ");return n("div",{className:"border-b border-line pb-[26px]",[je]:t.key,children:[n("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:[i(t.label)," · ",a("span",{className:"text-accent",children:d??i(t.prompt)})]}),t.values.length===0?n("p",{className:"font-mono text-[length:var(--size-body,12px)] leading-relaxed tracking-[0.1em] text-fg-dim",children:[t.empty.text," ",a(te,{href:t.empty.href,className:"text-accent hover:underline",children:t.empty.linkText})]}):t.display==="swatch"?a("div",{className:"flex flex-wrap gap-2 [&>*]:max-w-full",children:a(y,{hero:p,values:t.values,item:l=>({swatch:l.swatch??"",name:l.label}),picked:l=>l.value===t.chosen,press:l=>()=>r(t.key,l.value)})}):a("div",{className:"flex flex-wrap gap-1.5",children:a(y,{hero:p,values:t.values,item:l=>({label:l.label,note:l.note??""}),picked:l=>l.value===t.chosen,press:l=>()=>r(t.key,l.value)})})]})}function y({hero:t,values:r,item:p,picked:i,press:o}){const d=mt(r,{item:p,selected:i,press:o});return a(ie,{children:a(D,{ownerId:t.nodeId,ownerType:F,slot:pt,Template:t.template,rows:d.items.map(ct),items:d.items,states:d.states,actions:t.editing?void 0:d.actions,pressTitles:t.pressTitles,fallback:null,children:l=>l})})}function St({partNumbers:t,productSlug:r}){const[p,i]=Ie(""),{status:o,submit:d,reset:l}=Fe();function S(){d({partNumbers:t,email:p,productSlug:r})}return o==="sent"?a("p",{className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-accent",children:"We'll email you when it's back."}):a(He,{className:"-mt-1",email:p,onEmailChange:i,status:o,onResetVerdict:l,onSubmit:S,inputAriaLabel:"Email for the back-in-stock alert",submitLabel:"Notify me when back",buttonClassName:"cursor-pointer whitespace-nowrap border-2 border-btn px-4 font-mono text-[length:var(--size-label,11px)] font-bold uppercase tracking-[0.22em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-btn",errorMessage:"Couldn't save that — please try again."})}export{Nt as default};
|
|
1
|
+
"use client";import{jsx as t,Fragment as g,jsxs as c}from"react/jsx-runtime";import J from"next/link";import{useEffect as Z,useRef as Re,useState as Ee}from"react";import{useCart as Ae}from"./CartContext.js";import{useSiteTakesOrders as Le}from"./SiteRecordContext.js";import Ce from"./EmailCaptureForm.js";import{useEnglish as ee}from"./EnglishVariant.js";import{MarkedLabel as te,heroView as Pe}from"./product-hero/hero-view.js";import{useRootIsDark as Ie}from"efficient-shell/theme";import{useStockAlertSignup as $e}from"./useStockAlertSignup.js";import{SPARE_WORDS as He,productCartLine as Me}from"../lib/catalog/purchase.js";import{OPTION_ROW_ATTR as je}from"../lib/catalog/store-product.js";import{resolvingRowsAnswered as ze}from"../lib/catalog/product-options.js";import{trackViewItem as De}from"../lib/google-tag.js";import{DEFAULT_HERO_LAYOUT as Ue,DEFAULT_HERO_RATIO as Be,DEFAULT_HERO_TEXT_ALIGN as Ve,parseHeroLayout as Fe,parseHeroRatio as Qe,parseHeroTextAlign as Ye}from"../lib/sections/hero-arrangement.js";import{MAX_SPARES as Ke,UNITS_PER_SET as ae,formatPrice as le}from"../lib/commerce.js";import{formatSelectionPrice as We,setPriceLabel as Xe}from"../lib/wheels/price-display.js";import{productIsDually as Ge,productIsTwoObjects as qe,setSuppressesRow as Je}from"../lib/wheels/set-mode.js";import{CONTENT_CAP_GUTTER as ne}from"../lib/sections/content-cap-gutter.js";import{BLOCK_ALIGN_TEXT as Ze}from"efficient-web-builder/format/lib/content/block-align";import{CardTemplateRows as C}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as P}from"efficient-web-builder/render/components/SiteGutterFrame";import{cardRow as et}from"efficient-web-builder/format/lib/content/card-template";import{optionCardRows as tt}from"../lib/sections/filter-option-rows.js";import{HERO_OPTION_SLOT as at}from"../lib/content/hero-option-seed.js";import{HERO_BUY_SLOT as lt,HERO_QUANTITY_PART as nt,HERO_SAVE_PART as rt}from"../lib/content/hero-buy-seed.js";import{HERO_PART as f}from"../lib/content/hero-seed.js";import st from"./card-pieces/CardQuantity.js";import it from"./card-pieces/CardSave.js";import ot from"./card-pieces/CardStatedFacts.js";import{HeroStateProvider as ct}from"./card-pieces/ProductCardState.js";import{PRODUCT_HERO_TYPE as I}from"../lib/document/document-nodes.js";const mt=4e3;function pt(e){return e?[e.year,e.make,e.model,e.modification].join("-"):""}const re=[{}],dt=(e,r)=>r===nt?t(st,{}):r===rt?t(it,{}):null,ut="[&>[data-sf-repeat]]:contents [&>[data-sf-repeat]>div]:contents";function ft({product:e,selection:r,onLightbox:o,editing:s=!1,showVehicleFitment:i=!0,heroLayout:l=Ue,imageRatio:n=Be,textAlign:y=Ve,showSpecTable:ie=!0,nodeId:w,template:oe,optionTemplate:ce,optionPressTitles:me,buyTemplate:pe}){const de=ee(),v=Fe(l),$=Ye(y),k=Qe(n),ue=v==="imageRight"?`${100-k}fr ${k}fr`:`${k}fr ${100-k}fr`,{picked:fe,pick:H,qty:M,setQty:he,choice:j,setChoice:be,angleIdx:gt,setAngleIdx:xt,showValidation:ge,setShowValidation:S,manualMode:z,vehicle:N,rows:D,facts:xe,part:d,outOfStock:U,offer:B,preOrder:_,canAddToCart:V,currency:h,price:p,set:F,msrpLabel:ve}=r,m=Pe(e,r,s),O=Ge(e),ke=qe(e),R=i?m.vehicle:null,Te=i?m.vehicleMemory:null,Q=!Ie({whenUnset:!0}),{warmCatalog:Y}=Ae(),T=Le();Z(()=>{!s&&T&&Y(e.kind,e.slug)},[s,T,e.kind,e.slug,Y]);const K=D.filter(a=>!_||a.values.length>0),W=K.filter(a=>a.role==="resolves"),E=K.filter(a=>a.role==="describes"&&!Je(ke,a.key)),X=E.findIndex(a=>a.chosen===null),G=(!R||!m.vehicleAnswersSpecs||r.fitmentSet)&&ze(D,_)?X===-1?E:E.slice(0,X+1):[],ye=[...W,...G];function we(){return V?(S(!1),s?null:Me(e,d,fe,{choice:j,qty:M},{fitmentLabel:z?m.specCaption:N.appliedName?`For ${N.appliedName}`:"",fitmentKey:z?`manual|${m.specCaption}`:`vehicle|${pt(N.applied?.vehicle)}`})):(S(!0),window.setTimeout(()=>S(!1),mt),null)}const Se={kind:"hero",msrpLabel:ve||null,amount:O?Xe(p,h):We(p,h),unitLabel:p.priced?m.unitLabel:null,packBadge:p.setTotal!=null?`${B.quantityLabel}: ${le(F,h)}`:null,buy:{isSet:O,priced:p.priced,outOfStock:U,canAdd:V,totalLabel:p.setTotal!=null?le(F,h):null,lineToAdd:we},qty:M,setQty:he,takesQty:T&&!(O&&!p.priced),save:{slug:e.slug,name:e.name},facts:ie?xe:null,title:{eyebrow:e.eyebrow,name:m.heading,badge:e.badge||null},product:e,selection:r,openLightbox:o},A={nodeId:w??"",template:ce,pressTitles:me,editing:s},u=!!(_&&m.preOrder),Ne={[f.fitmentLine]:Te,[f.options]:c(g,{children:[W.map(a=>t(se,{row:a,onPick:H,options:A},a.key)),!u&&R,!u&&G.map(a=>t(se,{row:a,onPick:H,options:A},a.key))]}),[f.facts]:u?null:t(ot,{}),[f.howMany]:u?null:t(ht,{offer:B,takesOrders:T,choice:j,setChoice:be,options:A}),[f.buy]:u?m.preOrder:t(P,{children:t(C,{ownerId:w??"",ownerType:I,slot:lt,Template:pe,rows:re,fallback:null,hostParts:dt,children:a=>a})}),[f.notify]:!u&&U&&d?t(bt,{partNumbers:d.components.map(a=>a.partNumber),productSlug:e.slug},d.id):null,[f.reminder]:!u&&ge?Oe():null},_e=(a,b)=>Ne[b]??null;function Oe(){const a=ye.filter(L=>L.chosen===null).map(L=>de(L.prompt).replace(/^Select\s+/i,""));if(R&&m.vehicleAnswersSpecs&&!r.fitmentSet&&a.push("vehicle fitment"),a.length===0)return null;const b=a.length===1?a[0]:a.length===2?`${a[0]} and ${a[1]}`:`${a.slice(0,-1).join(", ")}, and ${a.at(-1)}`;return c("p",{role:"alert",className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em]",style:{color:"var(--alert)"},children:["Please select ",b," first."]})}const q=Re(null);return Z(()=>{s||q.current===e.slug||(q.current=e.slug,De({itemId:d?`${e.slug}|${d.id}`:e.slug,itemName:e.name,variant:m.metaValue,pricePerSet:p.setTotal??p.fromSetTotal??0,currency:h}))},[s,e.slug,e.name,m.metaValue,d,p,h]),c(g,{children:[t("nav",{className:`border-b border-line ${ne} pt-4 pb-4 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]`,style:Q?void 0:{background:"var(--section-bg)"},children:e.crumbs.map((a,b)=>c("span",{children:[b>0&&c(g,{children:[t("span",{className:"mx-3 text-accent",children:"/"}),t("wbr",{})]}),a.href?t(J,{href:a.href,className:"hover:text-fg",children:t(te,{text:a.label})}):t("span",{className:"text-fg",children:t(te,{text:a.label})})]},`${a.label}-${b}`))}),t("section",{"data-hero-layout":v,"data-hero-align":$,className:[`grid gap-10 ${ne} py-14 max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))] max-view-tablet:py-8 ${ut}`,$==="center"?Ze.center:"",v==="stacked"?"grid-cols-1":"[grid-template-columns:var(--hero-cols)] max-view-desktop:[grid-template-columns:minmax(0,1fr)]"].filter(Boolean).join(" "),style:{...Q?{}:{background:"var(--section-bg)"},...v==="stacked"?{}:{"--hero-cols":ue}},children:t(ct,{value:Se,children:t(P,{children:t(C,{ownerId:w??"",ownerType:I,Template:oe,rows:re,fallback:null,hostParts:_e,children:a=>a})})})})]})}function ht({offer:e,takesOrders:r,choice:o,setChoice:s,options:i}){return e.packs.length>0||r&&(e.extra||e.spareCounts.length>0)?c("div",{className:"border-b border-line pb-[26px]",children:[e.packs.length>0&&c(g,{children:[t("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:"How many"}),t("div",{className:"flex flex-wrap gap-1.5",children:t(x,{hero:i,values:e.packs,item:l=>({label:l.label}),picked:l=>o.unit===l.value,press:l=>()=>s(n=>({...n,unit:l.value}))})})]}),r&&e.extra&&c("label",{className:`${e.packs.length>0?"mt-3.5 ":""}flex cursor-pointer items-center gap-3 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-fg`,children:[t("input",{type:"checkbox",checked:o.spares>0,onChange:l=>s(n=>({...n,spares:l.target.checked?Ke:0})),className:"h-4 w-4 cursor-pointer accent-[var(--accent)]"}),e.extra.label]}),r&&e.spareCounts.length>0&&c(g,{children:[t("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:He.howMany}),t("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:flex-wrap",children:t(x,{hero:i,values:e.spareCounts,item:l=>({label:`${l.value} · ${l.label}`}),picked:l=>o.spares===l.value-ae,press:l=>()=>s(n=>({...n,spares:l.value-ae}))})})]}),r&&e.spareSide&&c(g,{children:[t("div",{className:"mb-3.5 mt-[26px] font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:e.spareSide.label}),t("div",{className:"flex flex-wrap gap-1.5",children:t(x,{hero:i,values:e.spareSide.options,item:l=>({label:l.label}),picked:l=>o.spareSide===l.value,press:l=>()=>s(n=>({...n,spareSide:l.value}))})})]})]}):null}function se({row:e,onPick:r,options:o}){const s=ee();if(e.values.length===0&&!e.empty)return null;const i=e.values.find(n=>n.value===e.chosen),l=i&&[i.label,i.note].filter(Boolean).join(" · ");return c("div",{className:"border-b border-line pb-[26px]",[je]:e.key,children:[c("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:[s(e.label)," · ",t("span",{className:"text-accent",children:l??s(e.prompt)})]}),e.values.length===0?c("p",{className:"font-mono text-[length:var(--size-body,12px)] leading-relaxed tracking-[0.1em] text-fg-dim",children:[e.empty.text," ",t(J,{href:e.empty.href,className:"text-accent hover:underline",children:e.empty.linkText})]}):e.display==="swatch"?t("div",{className:"flex flex-wrap gap-2 [&>*]:max-w-full",children:t(x,{hero:o,values:e.values,item:n=>({swatch:n.swatch??"",name:n.label}),picked:n=>n.value===e.chosen,press:n=>()=>r(e.key,n.value)})}):t("div",{className:"flex flex-wrap gap-1.5",children:t(x,{hero:o,values:e.values,item:n=>({label:n.label,note:n.note??""}),picked:n=>n.value===e.chosen,press:n=>()=>r(e.key,n.value)})})]})}function x({hero:e,values:r,item:o,picked:s,press:i}){const l=tt(r,{item:o,selected:s,press:i});return t(P,{children:t(C,{ownerId:e.nodeId,ownerType:I,slot:at,Template:e.template,rows:l.items.map(et),items:l.items,states:l.states,actions:e.editing?void 0:l.actions,pressTitles:e.pressTitles,fallback:null,children:n=>n})})}function bt({partNumbers:e,productSlug:r}){const[o,s]=Ee(""),{status:i,submit:l,reset:n}=$e();function y(){l({partNumbers:e,email:o,productSlug:r})}return i==="sent"?t("p",{className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-accent",children:"We'll email you when it's back."}):t(Ce,{className:"-mt-1",email:o,onEmailChange:s,status:i,onResetVerdict:n,onSubmit:y,inputAriaLabel:"Email for the back-in-stock alert",submitLabel:"Notify me when back",buttonClassName:"cursor-pointer whitespace-nowrap border-2 border-btn px-4 font-mono text-[length:var(--size-label,11px)] font-bold uppercase tracking-[0.22em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-btn",errorMessage:"Couldn't save that — please try again."})}export{ft as default};
|
|
@@ -5,7 +5,7 @@ export type FooterLogoSource = {
|
|
|
5
5
|
logoReversed?: string | null;
|
|
6
6
|
logoInkIsDark?: boolean | null;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
declare function PublishedFooter({ footerBlock, rootProps, headerSettings, siteName, legalName, foundedYear, socialLinks, }: {
|
|
9
9
|
footerBlock: FooterBlock;
|
|
10
10
|
rootProps?: Record<string, unknown> | null;
|
|
11
11
|
headerSettings?: FooterLogoSource | null;
|
|
@@ -14,3 +14,5 @@ export default function PublishedFooter({ footerBlock, rootProps, headerSettings
|
|
|
14
14
|
foundedYear?: number | null;
|
|
15
15
|
socialLinks?: SocialLinks;
|
|
16
16
|
}): import("react").JSX.Element;
|
|
17
|
+
declare const _default: import("react").MemoExoticComponent<typeof PublishedFooter>;
|
|
18
|
+
export default _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{memo as f}from"react";import{Render as d}from"efficient-easel/render";import{useRenderKeep as u}from"efficient-web-builder/render/lib/document/render-keep";import c from"./PostListStartsProvider.js";import{postListStartsOf as k}from"../lib/content/post-list-continue.js";import{renderConfig as I}from"../lib/document/render-config.js";import{SITE_FOOTER_KIND as g}from"efficient-web-builder/format/lib/content/footer";import{PublishedFooterContext as P}from"efficient-web-builder/render/components/PublishedFooterContext";import{publishedChromeData as v}from"efficient-web-builder/render/lib/document/published-passes";import{EMPTY_SOCIAL_LINKS as L}from"efficient-web-builder/format/lib/content/social-links";function R({footerBlock:s,rootProps:l,headerSettings:o,siteName:i,legalName:m,foundedYear:n,socialLinks:p}){const a=u(),t=v({root:{props:{...l??{},kind:g}},content:[s],zones:{}}),e=k(t);return r(P.Provider,{value:{logoUrl:o?.logoUrl??null,logoReversed:o?.logoReversed??null,logoInkIsDark:o?.logoInkIsDark??null,siteName:i,legalName:m??null,foundedYear:n??null,socialLinks:p??L},children:r(c,{starts:e.starts,posts:e.posts,children:r(d,{config:I(),data:t,keep:a})})})}var S=f(R);export{S as default};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { FooterBlock } from "efficient-web-builder/format/lib/content/footer";
|
|
2
|
-
|
|
2
|
+
declare function PublishedHeader({ group }: {
|
|
3
3
|
group: FooterBlock;
|
|
4
4
|
}): import("react").JSX.Element;
|
|
5
|
+
declare const _default: import("react").MemoExoticComponent<typeof PublishedHeader>;
|
|
6
|
+
export default _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{memo as p}from"react";import{Render as m}from"efficient-easel/render";import{useRenderKeep as a}from"efficient-web-builder/render/lib/document/render-keep";import n from"./PostListStartsProvider.js";import{postListStartsOf as d}from"../lib/content/post-list-continue.js";import f from"./BoxHeaderBar.js";import{headerRenderConfig as h}from"../lib/document/render-config.js";import{headerBarOf as c}from"../lib/document/published-header-bar.js";import{publishedChromeData as l}from"efficient-web-builder/render/lib/document/published-passes";function x({group:s}){const i=a(),o=l({root:{props:{}},content:[s],zones:{}}),t=c(o),e=d(o);return r(f,{sticky:t.sticky,topTextColor:t.topTextColor,heightPx:t.heightPx,theme:t.theme,bandCapped:t.bandCapped,children:r(n,{starts:e.starts,posts:e.posts,children:r(m,{config:h(),data:o,keep:i})})})}var H=p(x);export{H as default};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
+
import { type ProductCardState } from "./ProductCardState.js";
|
|
2
3
|
import { type CardTextRegion } from "./card-text-region.js";
|
|
4
|
+
export declare function cardNameWords(state: ProductCardState | null): string | null;
|
|
3
5
|
export default function CardName({ children: name, region, fixedHeight, }: {
|
|
4
6
|
children?: ReactNode;
|
|
5
7
|
region?: CardTextRegion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as o,jsxs as l}from"react/jsx-runtime";import{HideTaker as c}from"efficient-web-builder/render/components/ViewHideRoot";import{withRMark as s}from"efficient-web-builder/render/components/RMark";import{tyreModelLine as u}from"../../lib/tyres/tyre-brand-name.js";import{CARD_TEXT_SIZE as r,useCatalogCard as f}from"./card-row.js";import{useProductCardStateOrNull as p}from"./ProductCardState.js";import{RegionBridge as h,RegionWords as g,regionAttr as k}from"./card-text-region.js";function w(e){return e?.kind==="wheel"?e.wheel.name:e?.kind==="bundle"?e.bundle.name:e?.kind==="tyre"?u(e.tyre.brand??"",e.tyre.name):null}function x({children:e,region:a,fixedHeight:m=!0}){const t=f(),n=p(),i=n?.kind==="wheel"?s(n.wheel.name):w(n);e===void 0&&i===null&&process.env.NODE_ENV!=="production"&&console.warn("[CardName] no name given and no wheel card state: the name block is empty");const d=n?.kind==="tyre"?n.tyre.treadPattern?.trim():"";return l(h,{region:a,sectionType:"ProductName",children:[o(c,{...k(a,"name"),className:t&&!m?`font-heading3 ${r.headingSmall2} font-medium uppercase leading-none tracking-[-0.02em]`:t?`mt-2 h-[60px] overflow-hidden break-words [.sf-card-rows_&]:h-auto [.sf-card-rows_&]:max-h-[60px] font-heading3 ${r.headingSmall2} font-medium uppercase leading-none tracking-[-0.02em]`:`mt-2 font-heading3 ${r.headingSmall1} font-medium tracking-[-0.02em]`,children:o(g,{region:a,at:"name",children:e??i})}),d?o("div",{className:`sf-card-pattern mt-1 font-mono ${r.labelSmall} uppercase tracking-[0.18em] text-accent`,children:d}):null]})}export{w as cardNameWords,x as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type CardTextRegion } from "./card-text-region.js";
|
|
3
|
+
export default function HeadlineEyebrow({ eyebrow, badge, region }: {
|
|
4
|
+
eyebrow: ReactNode;
|
|
5
|
+
badge: string | null;
|
|
6
|
+
region?: CardTextRegion;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,Fragment as o,jsxs as t}from"react/jsx-runtime";import{HideTaker as s}from"efficient-web-builder/render/components/ViewHideRoot";import{RegionBridge as a,RegionWords as c,regionAttr as l}from"./card-text-region.js";const d="mb-2.5 flex items-center gap-2.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.2em] text-accent";function m({eyebrow:i,badge:n,region:r}){return e(a,{region:r,sectionType:"ProductEyebrow",children:e(s,{as:"div",...l(r,"eyebrow"),className:d,children:t(c,{region:r,at:"eyebrow",children:[e("span",{children:i}),n&&t(o,{children:[e("span",{children:"·"}),e("span",{children:n})]})]})})})}export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsxs as s,Fragment as o,jsx as a}from"react/jsx-runtime";import{HideTaker as c}from"efficient-web-builder/render/components/ViewHideRoot";import{RegionBridge as d,RegionWords as m,regionAttr as h}from"./card-text-region.js";const g=.72;function f(n,i=!0){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length===0)return;const t=e.map((r,l)=>r.length+(i&&e.length>1&&l===e.length-1?1:0));return`calc(100cqi / ${(Math.max(...t)*g).toFixed(2)})`}const x="font-heading2 text-[length:min(min(var(--size-headingMedium,clamp(48px,5.5vw,84px)),var(--hero-name-fit,9999px)),var(--sf-heading-max,9999px))] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[0.92] tracking-[-0.035em]";function p({name:n,accentLastWord:i,region:e}){const t=i?n.lastIndexOf(" "):-1,r=a(m,{region:e,at:"name",children:t===-1?n:s(o,{children:[n.slice(0,t)," ",s("em",{className:"font-normal italic text-accent",children:[n.slice(t+1),"."]})]})});return a(d,{region:e,sectionType:"ProductName",children:a(c,{as:"div",className:"w-full [container-type:inline-size]",children:a("h1",{...h(e,"name"),className:x,style:{"--hero-name-fit":f(n,i)},children:r})})})}export{p as default};
|
|
@@ -5,6 +5,8 @@ import { type PlpCardSelection } from "../wheels-plp/usePlpCardSelection.js";
|
|
|
5
5
|
import type { Bundle, Tyre, TyreProductSummary, TyreVariant, WheelSummary } from "../../lib/api/index.js";
|
|
6
6
|
import type { OptionFact } from "../../lib/catalog/product-options.js";
|
|
7
7
|
import { type SelectionPriceDisplay } from "../../lib/wheels/price-display.js";
|
|
8
|
+
import type { StoreProduct } from "../../lib/catalog/store-product.js";
|
|
9
|
+
import type { ProductSelection } from "../useProductSelection.js";
|
|
8
10
|
export interface WheelCardState {
|
|
9
11
|
readonly kind: "wheel";
|
|
10
12
|
readonly wheel: WheelSummary;
|
|
@@ -77,8 +79,18 @@ export interface HeroState {
|
|
|
77
79
|
readonly name: string;
|
|
78
80
|
} | null;
|
|
79
81
|
readonly facts: readonly OptionFact[] | null;
|
|
82
|
+
readonly title: HeroTitle;
|
|
83
|
+
readonly product: StoreProduct;
|
|
84
|
+
readonly selection: ProductSelection;
|
|
85
|
+
readonly openLightbox: (src: string, alt: string) => void;
|
|
86
|
+
}
|
|
87
|
+
export interface HeroTitle {
|
|
88
|
+
readonly eyebrow: string;
|
|
89
|
+
readonly name: string;
|
|
90
|
+
readonly badge: string | null;
|
|
80
91
|
}
|
|
81
92
|
export declare function useHeroStateOrNull(): HeroState | null;
|
|
93
|
+
export declare function useNearestProduct(): Pick<HeroState, "product" | "selection" | "openLightbox"> | null;
|
|
82
94
|
export declare function HeroStateProvider({ value, children }: {
|
|
83
95
|
value: HeroState;
|
|
84
96
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as l}from"react/jsx-runtime";import{createContext as
|
|
1
|
+
"use client";import{jsx as l}from"react/jsx-runtime";import{createContext as L,useCallback as O,useContext as h,useMemo as z,useState as v}from"react";import{useCurrency as x}from"../CurrencyContext.js";import{useTyreDetail as N}from"../useTyreDetail.js";import{usePlpCardSelection as A}from"../wheels-plp/usePlpCardSelection.js";import{tyrePagePath as B}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";import{useCurrentProduct as H}from"../../lib/document/current-product.js";function X(e,r=null){return{brand:e.brand,brandLogo:e.brandLogo,name:e.name,treadPattern:e.treadPattern,slug:e.slug,sizes:e.sizes,fitSize:r,rimDiameters:e.rimDiameters,prices:e.prices,image:e.coverImage}}const n=L(null);function I(){const e=h(n);return e?.kind==="hero"?e:null}function Y(){const e=I(),r=H();return e?{product:e.product,selection:e.selection,openLightbox:e.openLightbox}:r?{product:r.product,selection:r.selection,openLightbox:r.openLightbox}:null}function Z({value:e,children:r}){return l(n.Provider,{value:e,children:r})}function R(){const e=h(n);if(!e||e.kind==="hero")throw new Error("A product card piece was drawn outside a product card (no ProductCardState).");return e}function ee(){const e=h(n);return e?.kind==="hero"?null:e}function re(){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 te({wheel:e,colours:r=V,defaultFinish:o,editing:a=!1,children:s}){const{currency:t}=x(),c=A(e,r,o),[p,f]=v(!1),d=E(e),u={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:u,children:s})}function ne({bundle:e,children:r}){const{currency:o}=x(),a={kind:"bundle",bundle:e,currency:o};return l(n.Provider,{value:a,children:r})}function oe({tyre:e,currency:r,editing:o=!1,children:a}){const{currency:s}=x(),{slug:t}=e,c=B(t),[p,f]=v(!1),d=O(()=>{t&&f(!0)},[t]),{state:u,tyre:m}=N(t??null,p),i=z(()=>m?.variants??[],[m]),[S,g]=v(null),b=i.length===1?i[0].size:null,y=S??b,P=i.find(w=>w.size===y),C=u==="ready",k={kind:"tyre",tyre:e,currency:r??s,activeCurrency:s,pagePath:c,arm:d,detailState:u,detail:m,variants:i,chosen:y,setSize:g,variant:P,canAdd:P!=null&&W(P,s),detailReady:C,unsellable:!c||u==="error"||C&&i.length===0,editing:o};return l(n.Provider,{value:k,children:a})}export{ne as BundleCardStateProvider,Z as HeroStateProvider,oe as TyreCardStateProvider,te as WheelCardStateProvider,X as tyreCardProduct,I as useHeroStateOrNull,Y as useNearestProduct,R as useProductCardState,ee as useProductCardStateOrNull,re as useWheelCardState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as o,Fragment as m,jsxs as c}from"react/jsx-runtime";import l from"../ProductGallery.js";import a from"../ProductLightbox.js";import{SECTION_NOTICE_TEXT_CLASS as p}from"../SectionNotice.js";import{heroView as d}from"../product-hero/hero-view.js";import{useRootIsDark as f}from"efficient-shell/theme";import{useLightbox as g}from"../useLightbox.js";import{useProductSelection as x}from"../useProductSelection.js";import{
|
|
1
|
+
"use client";import{jsx as o,Fragment as m,jsxs as c}from"react/jsx-runtime";import l from"../ProductGallery.js";import a from"../ProductLightbox.js";import{SECTION_NOTICE_TEXT_CLASS as p}from"../SectionNotice.js";import{heroView as d}from"../product-hero/hero-view.js";import{useRootIsDark as f}from"efficient-shell/theme";import{useLightbox as g}from"../useLightbox.js";import{useProductSelection as x}from"../useProductSelection.js";import{useNearestProduct as h}from"../card-pieces/ProductCardState.js";import{say as L}from"efficient-web-builder/format/lib/editor-words";import{useSampleProduct as S}from"./useSampleProduct.js";import{HideTaker as b}from"efficient-web-builder/render/components/ViewHideRoot";function y({editing:e=!1,...t}){const r=h();return r?o(n,{product:r.product,selection:r.selection,onLightbox:r.openLightbox,editing:e,...t}):e?o(I,{...t}):null}function n({product:e,selection:t,onLightbox:r,editing:i,...s}){const u=!f({whenUnset:!0});return o(l,{product:e,view:d(e,t,i),angleIdx:t.angleIdx,onSelect:t.setAngleIdx,isLight:u,onLightbox:r,...s,takesViewHide:!0})}function I(e){const t=S(!0);return t?o(P,{product:t,...e}):o(b,{as:"p",className:p,children:L("Loading sample product…")})}function P({product:e,...t}){const r=x(e,{editing:!0}),i=g();return c(m,{children:[o(n,{product:e,selection:r,onLightbox:i.open,editing:!0,...t}),o(a,{item:i.item,onClose:i.close})]})}export{y as default};
|
|
@@ -1,28 +1,19 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type HeroPriceTemplateProps } from "../ProductHeroPanel.js";
|
|
1
|
+
import { type HeroTemplateProps } from "../ProductHeroPanel.js";
|
|
3
2
|
import type { StoreProduct } from "../../lib/catalog/store-product.js";
|
|
4
|
-
import type { HeroPricePlacement } from "../../lib/sections/hero-price-placement.js";
|
|
5
3
|
import type { HeroLayout, HeroTextAlign } from "../../lib/sections/hero-arrangement.js";
|
|
6
|
-
|
|
7
|
-
interface HeroArrangement extends HeroPriceTemplateProps {
|
|
4
|
+
interface HeroArrangement extends HeroTemplateProps {
|
|
8
5
|
heroLayout?: HeroLayout;
|
|
9
6
|
imageRatio?: number;
|
|
10
7
|
textAlign?: HeroTextAlign;
|
|
11
8
|
showSpecTable?: boolean;
|
|
12
|
-
showPriceQuote?: boolean;
|
|
13
|
-
galleryMode?: HeroGalleryMode;
|
|
14
|
-
imageFit?: HeroImageFit;
|
|
15
|
-
trustBullets?: ReactNode;
|
|
16
9
|
}
|
|
17
10
|
export declare const supportedKinds: readonly ("alloy-wheel" | "tyre")[];
|
|
18
|
-
export default function DynamicProductHero({ editing,
|
|
11
|
+
export default function DynamicProductHero({ editing, showVehicleFitment, ...arrangement }: {
|
|
19
12
|
editing?: boolean;
|
|
20
|
-
pricePlacement?: HeroPricePlacement;
|
|
21
13
|
showVehicleFitment?: boolean;
|
|
22
14
|
} & HeroArrangement): import("react").JSX.Element;
|
|
23
|
-
export declare function SampleHeroLoaded({ product,
|
|
15
|
+
export declare function SampleHeroLoaded({ product, showVehicleFitment, ...arrangement }: {
|
|
24
16
|
product: StoreProduct;
|
|
25
|
-
pricePlacement?: HeroPricePlacement;
|
|
26
17
|
showVehicleFitment: boolean;
|
|
27
18
|
} & HeroArrangement): import("react").JSX.Element;
|
|
28
19
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,Fragment as
|
|
1
|
+
"use client";import{jsx as t,Fragment as u,jsxs as m}from"react/jsx-runtime";import c from"../ProductHeroPanel.js";import p from"../ProductLightbox.js";import s from"../SectionNotice.js";import d from"./KindGate.js";import{useLightbox as l}from"../useLightbox.js";import{useProductSelection as a}from"../useProductSelection.js";import{PLP_KINDS as f}from"../../lib/catalog/plp-item.js";import{useCurrentProduct as h}from"../../lib/document/current-product.js";import{useSampleProduct as x}from"./useSampleProduct.js";import{say as g}from"efficient-web-builder/format/lib/editor-words";import{PRODUCT_HERO_TYPE as P}from"../../lib/document/document-nodes.js";const L=f;function b({editing:o=!1,showVehicleFitment:r=!0,...e}){const i=h();return t(d,{kinds:L,type:P,editing:o,children:i?t(c,{product:i.product,selection:i.selection,onLightbox:i.openLightbox,editing:o,showVehicleFitment:r,...e}):o?t(S,{showVehicleFitment:r,...e}):t(s,{size:"tall",children:"Bound to the current product — preview on a product page."})})}function S({showVehicleFitment:o,...r}){const e=x(!0);return e?t(_,{product:e,showVehicleFitment:o,...r}):t(s,{size:"tall",children:g("Loading sample product…")})}function _({product:o,showVehicleFitment:r,...e}){const i=a(o,{editing:!0}),n=l();return m(u,{children:[t(c,{product:o,selection:i,onLightbox:n.open,editing:!0,showVehicleFitment:r,...e}),t(p,{item:n.item,onClose:n.close})]})}export{_ as SampleHeroLoaded,b as default,L as supportedKinds};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type BlockSeed } from "efficient-web-builder/format/lib/document/seed-parts";
|
|
2
|
+
type Props = Record<string, unknown>;
|
|
3
|
+
export declare const HERO_GALLERY_BLOCK = "ProductGallery";
|
|
4
|
+
export declare const HERO_TEMPLATE_BLOCKS: readonly ["ProductGallery", "ProductEyebrow", "ProductName", "ProductPrice"];
|
|
5
|
+
export declare const HERO_PART: {
|
|
6
|
+
readonly fitmentLine: "fitment-line";
|
|
7
|
+
readonly options: "options";
|
|
8
|
+
readonly facts: "facts";
|
|
9
|
+
readonly howMany: "how-many";
|
|
10
|
+
readonly buy: "buy";
|
|
11
|
+
readonly notify: "notify";
|
|
12
|
+
readonly reminder: "reminder";
|
|
13
|
+
};
|
|
14
|
+
export declare function heroSeeds(props: Props, priceProps?: Props): BlockSeed[];
|
|
15
|
+
export declare const HERO_TEMPLATE_SHAPE_PROP = "templateShape";
|
|
16
|
+
export declare const HERO_TEMPLATE_SHAPE = "hero";
|
|
17
|
+
export declare function withHeroTemplate(props: Props): Props;
|
|
18
|
+
export declare function heroTemplateFollowsArrangement(props: Props, changed: Readonly<{
|
|
19
|
+
heroLayout?: boolean;
|
|
20
|
+
textAlign?: boolean;
|
|
21
|
+
}>): Props;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{phoneKey as T}from"efficient-easel/draw";import{PART_MOTION_PROP as B}from"efficient-web-builder/render/lib/animation/part-motion";import{PART_STYLES_PROP as Y,readPartStyles as D}from"efficient-web-builder/render/lib/document/part-styles";import{BOX_TYPE as d,CONTAINER_BLOCKS_SLOT as y}from"efficient-web-builder/format/lib/document/container-blocks";import{INNER_BOX as k,boxPadding as G,seedNodes as F}from"efficient-web-builder/format/lib/document/seed-parts";import{CARD_TEMPLATE_SLOT as _}from"efficient-web-builder/format/lib/content/card-template";import{BOX_BLOCK_SPACING_POINTS as j}from"efficient-web-builder/format/lib/content/box-layout";import{say as p}from"efficient-web-builder/format/lib/editor-words";import{HIDDEN_KEY as C}from"efficient-easel/screen/lib/content/view-hide";import{isNode as X}from"efficient-easel/data";import{seedNodeId as v}from"./seed-ids.js";import{hostPartSeed as l}from"./host-part-seed.js";import{PRODUCT_EYEBROW_BLOCK as N,PRODUCT_NAME_BLOCK as x,PRODUCT_PRICE_BLOCK as E}from"./product-card-seed.js";import{PRODUCT_HERO_TYPE as Q}from"../document/document-nodes.js";import{parseHeroLayout as A,parseHeroTextAlign as H}from"../sections/hero-arrangement.js";import{parseHeroGalleryMode as W,parseHeroImageFit as $}from"../sections/hero-gallery.js";import{parseHeroPricePlacement as q}from"../sections/hero-price-placement.js";import{TRUST_BULLETS_SLOT as g}from"../sections/hero-trust-bullets.js";import{EYEBROW_BADGE_PROP as z,NAME_ACCENT_PROP as J,TITLE_LOOK_PROP as b}from"./title-look.js";const R="ProductGallery",he=[R,N,x,E],u={fitmentLine:"fitment-line",options:"options",facts:"facts",howMany:"how-many",buy:"buy",notify:"notify",reminder:"reminder"},V=28,M="@price";function Z(e){const{[M]:t,...r}=e&&typeof e=="object"?e:{};return{price:t,others:r}}const ee=j[0].value,L=(e,t,r={})=>({...k,name:e,gap:t,[T("gap")]:t,...G(0,0),blockSpacing:ee,...r});function te(e,t={}){const r=q(e.pricePlacement),o={type:E,props:I(e)?{...t,[C]:!0}:t},n={type:d,props:L("Stage",0),slots:{[y]:[{type:R,props:{galleryMode:W(e.galleryMode),imageFit:$(e.imageFit)}}]}},s={type:d,props:L("Buy column",V,H(e.textAlign)==="center"?{align:"center"}:{}),slots:{[y]:[{type:d,props:L("Title",0),slots:{[y]:[{type:N,props:{[b]:"headline",[z]:!0}},{type:x,props:{[b]:"headline",[J]:!0}}]}},...r==="top"?[o]:[],l(u.fitmentLine,p("Remembered car")),l(u.options,p("Options")),l(u.facts,p("Settled facts")),l(u.howMany,p("Quantity")),...r==="belowSpecs"?[o]:[],l(u.buy,p("Buy row")),l(u.notify,p("Notify me")),l(u.reminder,p("Reminder"))]}};return A(e.heroLayout)==="imageRight"?[s,n]:[n,s]}const I=e=>e.showPriceQuote===!1,re={sectionBorder:{top:1,style:"solid"}},K=20;function oe(e){return O(e).map((t,r)=>{if(r!==0)return t;const o={...t.props},n=i=>typeof i=="number"?i:void 0,s=n(t.props.sectionPaddingTop)??0;return o.sectionPaddingTop=K+s,o[T("sectionPaddingTop")]=K+(n(t.props[T("sectionPaddingTop")])??s),t.props.sectionBorder||Object.assign(o,re),{type:t.type,props:o}})}function O(e){return Array.isArray(e)?e.filter(t=>X(t)):[]}const U="templateShape",w="hero";function ne(e){const t=e[_];if(e[U]===w||!Array.isArray(t))return null;if(t.length===0)return[];const r=O(t);return r.length===t.length&&r.every(o=>o.type!==d)?r:null}function ie(e,t={},r=[],o){const n=v(e,Q),s=F(te(e,t),(c,m)=>`${n}~hero.${m}`);if(r.length===0&&!o)return s;const i=A(e.heroLayout)==="imageRight"?0:1;return s.map((c,m)=>{if(m!==i)return c;const P=f=>({...f,props:{...f.props,[C]:!0}}),a=o&&I(e)?o.map(P):o,S=c.props[y].flatMap(f=>a&&f.type===E?a.length>0?a:[P(f)]:[f]);return{...c,props:{...c.props,[y]:[...S,...r]}}})}function Se(e){const t=ne(e);if(e[_]!==void 0&&!t)return e;const r={...e,[U]:w},o={};for(const[n,s]of[[Y,D(e)],[B,e[B]]]){const{price:i,others:c}=Z(s);i&&(o[n]={[M]:i},Object.keys(c).length>0?r[n]=c:delete r[n])}return r[_]=ie(e,o,oe(e[g]),t??void 0),Array.isArray(e[g])&&(r[g]=[]),r}function h(e){if(e.type===R)return!0;const t=e.props[y];return Array.isArray(t)&&O(t).some(h)}function Be(e,t){const r=e[_];if(!t.heroLayout&&!t.textAlign||!Array.isArray(r)||r.length!==2)return e;const o=O(r);if(o.length!==2||o.some(a=>a.type!==d))return e;const n=o.findIndex(h);if(n===-1||h(o[1-n]))return e;const s=o[n];let i=o[1-n],c=!1;if(t.textAlign){const a=H(e.textAlign)==="center";if(a&&i.props.align!=="center")i={...i,props:{...i.props,align:"center"}},c=!0;else if(!a&&i.props.align==="center"){const{align:S,...f}=i.props;i={...i,props:f},c=!0}}const m=A(e.heroLayout)==="imageRight";if(t.heroLayout&&n===0===m&&(c=!0),!c)return e;const P=(t.heroLayout?m:n===1)?[i,s]:[s,i];return{...e,[_]:P}}export{R as HERO_GALLERY_BLOCK,u as HERO_PART,he as HERO_TEMPLATE_BLOCKS,w as HERO_TEMPLATE_SHAPE,U as HERO_TEMPLATE_SHAPE_PROP,te as heroSeeds,Be as heroTemplateFollowsArrangement,Se as withHeroTemplate};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const TITLE_LOOK_PROP = "titleLook";
|
|
2
|
+
export declare const TITLE_LOOKS: readonly ["card", "headline"];
|
|
3
|
+
type TitleLook = (typeof TITLE_LOOKS)[number];
|
|
4
|
+
export declare const DEFAULT_TITLE_LOOK: TitleLook;
|
|
5
|
+
export declare const parseTitleLook: (v: unknown) => TitleLook;
|
|
6
|
+
export declare const NAME_ACCENT_PROP = "accentLastWord";
|
|
7
|
+
export declare const EYEBROW_BADGE_PROP = "showBadge";
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t="titleLook",c=["card","headline"],e="card",n=o=>o==="headline"?"headline":e,r="accentLastWord",L="showBadge";export{e as DEFAULT_TITLE_LOOK,L as EYEBROW_BADGE_PROP,r as NAME_ACCENT_PROP,c as TITLE_LOOKS,t as TITLE_LOOK_PROP,n as parseTitleLook};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t}from"react/jsx-runtime";import{withRMark as
|
|
1
|
+
"use client";import{Fragment as b,jsx as t}from"react/jsx-runtime";import{withRMark as s}from"efficient-web-builder/render/components/RMark";import f from"../../../../../components/card-pieces/CardEyebrow.js";import{readPartStyles as y}from"efficient-web-builder/render/lib/document/part-styles";import p from"../../../../../components/card-pieces/HostPart.js";import{useHeroStateOrNull as w,useProductCardStateOrNull as E}from"../../../../../components/card-pieces/ProductCardState.js";import g from"../../../../../components/card-pieces/HeadlineEyebrow.js";import{MarkedLabel as h}from"../../../../../components/product-hero/hero-view.js";import{EYEBROW_BADGE_PROP as k,TITLE_LOOK_PROP as P,parseTitleLook as C}from"../../../../content/title-look.js";import{useGridCard as m}from"../../../../../components/GridCardTemplate.js";import{itemBrand as L,plpKindNoun as O}from"../../../../catalog/plp-item.js";import{productCardEyebrow as _,wheelCardEyebrow as B}from"../../../../../components/ProductCardEyebrow.js";import{keepForCard as R}from"../../../../content/field-usage.js";import{ProductEyebrowMeta as c}from"./meta.js";function x(r){const{fieldUsage:e,tyreFieldUsage:l,eyebrow:o}=m();if(r.kind==="tyre"){const a=(o.tyreBrand??o.brand)&&R(l)("brand")&&r.tyre.brand||null,u=o.kindLabel?O(["tyre"]).one:null;return _(u,a)}const n=r.kind==="wheel"?r.wheel:null,d=n&&o.brand?L(n):null,i={kindLabel:n?o.kindLabel:null,brand:d?s(d):null,process:n&&o.process&&n.process?s(n.process):null};return B(i,e)}function F({state:r,children:e}){return t(b,{children:e(x(r),null)})}function H({props:r,region:e}){const l=w(),o=E(),{reserveEyebrow:n}=m(),d=C(r[P])==="headline",i=(a,u)=>d?t(g,{eyebrow:a,badge:r[k]===!0?u:null,region:e}):t(f,{reserve:n,region:e,children:a});return l?i(l.title.eyebrow?t(h,{text:l.title.eyebrow}):null,l.title.badge):o?t(F,{state:o,children:i}):null}const q={...c,render:r=>{const e=!!r.editor?.isEditing;return t(p,{label:c.label??"",editing:e,onHero:!0,children:t(H,{props:r,region:{nodeId:typeof r.id=="string"?r.id:void 0,partStyles:y(r),editing:e}})})}};export{q as ProductEyebrowRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_HERO_PRICE_PLACEMENT as
|
|
1
|
+
import{DEFAULT_HERO_PRICE_PLACEMENT as t}from"../../../../sections/hero-price-placement.js";import{DEFAULT_HERO_LAYOUT as e,DEFAULT_HERO_RATIO as r,DEFAULT_HERO_TEXT_ALIGN as l}from"../../../../sections/hero-arrangement.js";import{DEFAULT_HERO_GALLERY_MODE as E,DEFAULT_HERO_IMAGE_FIT as _}from"../../../../sections/hero-gallery.js";import{cardTemplateSlot as O}from"efficient-web-builder/format/lib/content/card-template";import{HERO_TEMPLATE_BLOCKS as m}from"../../../../content/hero-seed.js";import{HERO_OPTION_ALLOW as L,HERO_OPTION_SLOT as T}from"../../../../content/hero-option-seed.js";import{HERO_BUY_ALLOW as a,HERO_BUY_SLOT as i}from"../../../../content/hero-buy-seed.js";const o=O(),p={template:{...o,allow:[...o.allow,...m]},[T]:{type:"slot",allow:[...L]},[i]:{type:"slot",allow:[...a]}},f={label:"Product Hero",fields:p,defaultProps:{source:null,pricePlacement:t,showVehicleFitment:!0,heroLayout:e,imageRatio:r,textAlign:l,showSpecTable:!0,showPriceQuote:!0,galleryMode:E,imageFit:_}};export{f as ProductHeroMeta,p as ProductHeroSlots};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{SITE_WIDTH_CAP as O}from"efficient-web-builder/format/lib/content/page-width";import{resolveWidth as g}from"efficient-web-builder/format/lib/content/section-width";import E from"../../../../../components/LinkedProductHero.js";import d from"../../../../../components/pdp-dynamic/DynamicProductHero.js";import P from"../../../../../components/SectionNotice.js";import{HERO_OPTION_SLOT as n}from"../../../../content/hero-option-seed.js";import{HERO_BUY_SLOT as a}from"../../../../content/hero-buy-seed.js";import{cardPressTitlesOf as L}from"efficient-web-builder/render/lib/document/card-press-titles";import{useCurrentProduct as y}from"../../../current-product.js";import{LINKED_HERO_RECORD_PROP as A,matchingLinkedRecord as k}from"../../../linked-hero-hydrate.js";import{isEditorOnDynamicPage as D}from"efficient-web-builder/format/lib/document/editor-page-context";import{DEFAULT_HERO_LAYOUT as w,DEFAULT_HERO_RATIO as I,DEFAULT_HERO_TEXT_ALIGN as x,parseHeroLayout as F,parseHeroRatio as S,parseHeroTextAlign as C}from"../../../../sections/hero-arrangement.js";import{say as U}from"efficient-web-builder/format/lib/editor-words";import{ProductHeroMeta as p}from"./meta.js";import{HideTaker as N}from"efficient-web-builder/render/components/ViewHideRoot";function b({source:e,editing:t=!1,showVehicleFitment:r=!0,heroLayout:f=w,imageRatio:u=I,textAlign:c=x,showSpecTable:l=!0,nodeId:T,template:s,optionTemplate:h,optionPressTitles:R,buyTemplate:_,linkedRecord:H}){const o={heroLayout:f,imageRatio:u,textAlign:c,showSpecTable:l,nodeId:T,template:s,optionTemplate:h,optionPressTitles:R,buyTemplate:_};if(y()||t&&D())return i(d,{editing:t,showVehicleFitment:r,...o});if(e?.slug){const m=e.kind??"wheel";return i(E,{slug:e.slug,kind:m,initialRecord:k(H,m,e.slug),editing:t,showVehicleFitment:r,...o})}return t?i(P,{size:"tall",children:U("Pick a product in the panel to fill this hero.")}):i(d,{showVehicleFitment:r,...o})}function V(e,t){return g(e,"full").mode!=="page"?t:i(N,{as:"div",style:{"--sf-content-cap":O},children:t})}const ie={...p,render:e=>V(e,i(b,{source:e.source,editing:e.editor?.isEditing,showVehicleFitment:e.showVehicleFitment??!0,heroLayout:F(e.heroLayout),imageRatio:S(e.imageRatio),textAlign:C(e.textAlign),showSpecTable:e.showSpecTable??!0,nodeId:typeof e.id=="string"?e.id:void 0,template:typeof e.template=="function"?e.template:void 0,optionTemplate:typeof e[n]=="function"?e[n]:void 0,optionPressTitles:L(e,n),buyTemplate:typeof e[a]=="function"?e[a]:void 0,linkedRecord:e[A]}))};export{ie as ProductHeroRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as i}from"react/jsx-runtime";import d
|
|
1
|
+
"use client";import{jsx as i}from"react/jsx-runtime";import a,{cardNameWords as d}from"../../../../../components/card-pieces/CardName.js";import m from"../../../../../components/card-pieces/HeadlineName.js";import{readPartStyles as l}from"efficient-web-builder/render/lib/document/part-styles";import f from"../../../../../components/card-pieces/HostPart.js";import{useHeroStateOrNull as u,useProductCardStateOrNull as c}from"../../../../../components/card-pieces/ProductCardState.js";import{NAME_ACCENT_PROP as s,TITLE_LOOK_PROP as N,parseTitleLook as P}from"../../../../content/title-look.js";import{ProductNameMeta as o}from"./meta.js";function g({props:e,region:t}){const r=u(),n=c();return P(e[N])==="headline"?i(m,{name:r?r.title.name:d(n)??"",accentLastWord:e[s]===!0,region:t}):i(a,{region:t,fixedHeight:e.fixedHeight!==!1,children:r?r.title.name:void 0})}const S={...o,render:e=>{const t=!!e.editor?.isEditing;return i(f,{label:o.label??"",editing:t,onHero:!0,children:i(g,{props:e,region:{nodeId:typeof e.id=="string"?e.id:void 0,partStyles:l(e),editing:t}})})}};export{S as ProductNameRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CARD_LIST_TYPE as R,CARD_ROW_FIELD_PROP as y,CARD_ROW_LINK_PROP as m,CARD_TEMPLATE_SLOT as E,registerCardTemplates as de}from"efficient-web-builder/format/lib/content/card-template";import{DIM as d,INNER_BOX as o,LABEL_FACE as C,TEXT as n,boxPadding as r,fillSlot as H,labelLook as T,labelStyle as K,seedNodes as f,token as _}from"efficient-web-builder/format/lib/document/seed-parts";import{BOX_SHOW_KEY as M,BOX_SHOW_ON_CARD_HOVER as x,HOVER_KEY as Te,PICTURE_HOVER_KEYS as Y}from"efficient-web-builder/format/lib/animation/hover";import{BOX_TYPE as a,CONTAINER_BLOCKS_SLOT as i}from"efficient-web-builder/format/lib/document/container-blocks";import{BOX_ROW_IMAGE_PROP as k}from"efficient-web-builder/format/lib/content/box-card-rule";import{POST_CARD_HEIGHT as pe}from"efficient-web-builder/format/lib/post-card-layout";import{EVENTS_FEATURED_DARKEN as ce,EVENTS_FEATURED_DARKEN_STYLE as G,EVENTS_FEATURED_PLACEMENT as Oe}from"../content/events-featured-look.js";import{COLLECTION_DARKEN as Le,COLLECTION_HOVER_DARKEN as me,COLLECTION_HOVER_ZOOM as U}from"../content/collection-card-look.js";import{COLLECTION_CARD_REGIONS as b,COLLECTION_CARD_TEXT_SIZE as be}from"efficient-web-builder/format/lib/sections/collection-card-text-regions";import{SH_LINK as V}from"efficient-web-builder/render/lib/document/blocks/general/section-to-box-row-parts";import{rowFieldTextSeed as t}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{withRelatedTabletColumns as S}from"../sections/product-grid-columns.js";import{bundleColumns as he}from"../sections/bundle-to-grid.js";import{HERO_PRICE_BLOCK as ge,withHeroPriceTemplate as Pe}from"../content/hero-price-seed.js";import{HERO_BUY_SLOT as Re,HERO_BUY_SLOT_LABEL as ye,withHeroBuyTemplate as Ce}from"../content/hero-buy-seed.js";import{HERO_OPTION_FIELDS as W,HERO_OPTION_SLOT as fe,HERO_OPTION_SLOT_LABEL as ke,withHeroOptionTemplate as Se}from"../content/hero-option-seed.js";import{FILTER_OPTIONS_FIELD as Ae,withFilterChipsTemplate as Ie,withFilterTemplate as ue}from"../content/filter-card-seed.js";import{FACET_ROW_FIELDS as h,FACET_TEMPLATE_LABEL as v,FACET_TEMPLATE_SLOT as $,withFacetTemplate as X}from"../content/facet-row-seed.js";import{RAIL_HEAD_TEMPLATE_LABEL as Ne,RAIL_HEAD_TEMPLATE_SLOT as De,RAIL_ROW_FIELDS as A,RAIL_TEMPLATE_LABEL as we,RAIL_TEMPLATE_SLOT as Be,withRailTemplates as Z}from"../content/rail-row-seed.js";import{MENU_LINK_BLOCK as Fe,withMenuTemplate as He}from"../content/menu-card-seed.js";import{CONTACT_CHANNEL_FIELDS as j,CONTACT_CHANNEL_SLOT as Ke,CONTACT_REASON_FIELDS as Me,CONTACT_REASON_SLOT as xe,CONTACT_TOPIC_FIELDS as z,CONTACT_TOPIC_SLOT as Ye,withContactTemplates as Ge}from"../content/contact-card-seed.js";import{ARTICLE_BODY_BLOCK as Ue,withArticleBodyTemplate as Ve}from"efficient-web-builder/format/lib/document/article-body-seed";import{APPOINTMENT_BOOKING_TYPE as We,BOOKING_BOX_TYPE as ve,BOOKING_OPTION_FIELDS as $e,BOOKING_TEMPLATE_SLOTS as Xe,withBookingTemplates as Ze}from"../content/booking-card-seed.js";import{PRODUCT_BUY_BLOCK as je,PRODUCT_CARD_FIELDS as I,PRODUCT_COLOUR_BLOCK as ze,PRODUCT_EYEBROW_BLOCK as qe,PRODUCT_NAME_BLOCK as Qe,PRODUCT_PICTURE_BLOCK as Je,PRODUCT_PRICE_BLOCK as et,PRODUCT_SIZE_BLOCK as tt,PRODUCT_SPECS_BLOCK as lt,productCardSeed as ot,withKitCardTemplate as u,withListingCardTemplate as at,withProductCardTemplate as N}from"../content/product-card-seed.js";import{ALLOY_WHEELS_LISTING_TYPE as it,FILTER_BLOCK_TYPE as nt,FILTER_CHIPS_TYPE as rt,MENU_BLOCK_TYPE as st,PRODUCT_GRID_TYPE as Et,PRODUCT_HERO_TYPE as _t}from"./document-nodes.js";import{withSeededSlot as D}from"../content/seed-ids.js";import{FITMENT_HEAD_FIELDS as q,FITMENT_HEAD_TEMPLATE_LABEL as dt,FITMENT_HEAD_TEMPLATE_SLOT as Tt,FITMENT_ROW_FIELDS as Q,FITMENT_ROW_TEMPLATE_LABEL as pt,FITMENT_ROW_TEMPLATE_SLOT as ct}from"../content/fitment-row-seed.js";const J="tags",p=T(12),ee={textStyle:"heading-3",..._("headingSmall",20),weight:500,lineHeight:1.2,letterSpacing:-.02},te={textStyle:"body-1",..._("body",14),lineHeight:1.55},Ot={...ee,..._("headingSmall",30)},Lt={sectionPaddingTop:24,sectionPaddingRight:28,sectionPaddingBottom:32,sectionPaddingLeft:28,sectionPaddingTopPhone:24,sectionPaddingRightPhone:28,sectionPaddingBottomPhone:32,sectionPaddingLeftPhone:28},mt=pe.fallback,bt=480,ht=70,gt=()=>({type:a,props:{...o,name:"Featured",[k]:"cover",darken:ce,darkenStyle:G,darkenPhone:ht,darkenStylePhone:G,placement:Oe,direction:"column",gap:8,gapPhone:8,...r(32,32,20,20),sectionHeightMode:"fixed",sectionHeightValue:mt,sectionHeightUnit:"px",sectionHeightModePhone:"fixed",sectionHeightValuePhone:bt,sectionHeightUnitPhone:"px",[m]:"href"},slots:{[i]:[t("meta",{...n,tag:"p"},p,!0),t("title",{...n,tag:"h3",widthFit:"fill"},Ot),t("excerpt",{...d,tag:"p",widthFit:"fill",maxWidth:384},te),t("dateLabel",{...d,tag:"p"},{...p,color:"muted"})]}}),Pt=()=>({type:a,props:{...o,name:"Post",gap:0,gapPhone:0,...r(0,0,0,0),...H("surface"),shadow:!0},slots:{[i]:[{type:"ImageBlock",props:{[y]:"cover",aspect:"16/10",contained:!1}},{type:a,props:{...o,name:"Words",gap:12,gapPhone:12,...Lt},slots:{[i]:[{type:a,props:{...o,name:"Meta",direction:"row",wrap:!0,share:"content",sharePhone:"content",phoneRow:2,gap:12,gapPhone:12,...r(0,0,0,0)},slots:{[i]:[t("meta",{...n,tag:"p"},p,!0),t("dateLabel",{...d,tag:"p"},{...p,color:"muted"},!0)]}},t("title",{...n,tag:"h3",widthFit:"fill"},ee),t("excerpt",{...d,tag:"p",widthFit:"fill"},te),{type:R,props:{[y]:J},slots:{template:[{type:a,props:{...o,name:"Chip",...r(4,8,4,8),sectionBorder:{width:1}},slots:{[i]:[t("label",{...d,tag:"p"},p)]}}]}},{type:"ButtonBlock",props:{variant:"ghost",label:"Read more",href:"",[m]:"href",...V,icon:"arrow-right",iconPosition:"after",_partStyles:{label:K(12)}}}]}}]}}),Rt=()=>[gt(),Pt()];function yt(e){const l=["featured","post"];return D(e,E,"Events",L=>f(Rt(),(s,_e)=>{const[w,...B]=_e.split("."),F=l[Number(w)]??`card${w}`;return B.length?`${L}~${F}.${B.join(".")}`:`${L}~${F}`}))}const Ct={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:J,label:"Tags",kind:"list",fields:[{key:"label",label:"Tag"}]}],blocks:[{type:R,label:"Card list"}],seedOnInsert:yt},c=e=>Number(/(\d+)px/.exec(e)?.[1]),O={tag:c(b.tag.builtIn),name:c(b.name.builtIn),namePhone:c(be.namePhone),body:c(b.body.builtIn),link:c(b.link.builtIn)},ft={...T(O.tag),letterSpacing:.25},kt={textStyle:"heading-2",..._("headingMedium",O.name,O.namePhone),weight:500,lineHeight:1,letterSpacing:-.03},St={textStyle:"body-1",..._("body",O.body),lineHeight:1.5,paragraphSpacing:12},le=()=>[t("tag",{...n,tag:"p"},ft,!0),t("name",{...n,tag:"h3",widthFit:"fill"},kt),t("desc",{...n,tag:"p",widthFit:"fill",maxWidth:420},St),{type:"ButtonBlock",props:{variant:"ghost",label:"Explore",href:"",[m]:"href",...V,icon:"arrow-right",iconPosition:"after",_partStyles:{label:K(O.link)}}}],oe={_hidden:!0,_hiddenTablet:!0,_hiddenPhone:!1},At=()=>({type:a,props:{...o,name:"Collection",gap:0,gapPhone:0,...r(0,0,0,0),[m]:"href"},slots:{[i]:[{type:a,props:{...o,name:"Picture",[k]:"image",boxShape:"portrait",darken:Le,placement:"bottom-left",direction:"column",gap:12,gapPhone:12,...r(32,32),hoverZoom:U,hoverDarken:me,_hiddenPhone:!0},slots:{[i]:le()}},{type:"ImageBlock",props:{[y]:"image",aspect:"4/5",contained:!1,hoverZoom:U,...oe}},{type:a,props:{...o,name:"Words",gap:12,gapPhone:12,...r(24,24),...H("surface"),...oe},slots:{[i]:le()}}]}});function It(e){return D(e,E,"Collections",l=>f([At()],(L,s)=>`${l}~card${s?`.${s}`:""}`))}const ut={fields:[{key:"tag",label:"Eyebrow"},{key:"name",label:"Title"},{key:"desc",label:"Description",multiline:!0},{key:"image",label:"Image",kind:"image",alt:"name"},{key:"href",label:"Link",kind:"link"}],seedOnInsert:It},Nt=35,Dt=50,wt=106,Bt=85,Ft="nextImage",Ht="#f5f1e8",ae="#c4c1ba",ie={...C,...T(11),letterSpacing:.24,color:"main"},Kt={...ie,color:ae},Mt={...C,...T(12,11),color:"main"},xt={textStyle:"heading-3",..._("headingSmall",22,16),weight:500,lineHeight:1.05,letterSpacing:-.02,color:Ht},Yt={...C,...T(12),letterSpacing:.12,color:ae},g=r(0,0,0,0),Gt=()=>({type:a,props:{...o,name:"Tile",placement:"top-left",share:"content",gap:0,gapPhone:0,...g,[k]:"image",boxShape:"square",darken:Nt,[Te]:Ft,[Y.zoom]:wt,[Y.darken]:Dt},slots:{[i]:[{type:a,props:{...o,name:"Top row",direction:"row",justify:"between",align:"start",share:"content",phoneRow:2,sharePhone:"content",wrapPhone:"nowrap",widthFit:"fill",gap:8,gapPhone:8,...g,sectionPaddingTop:12,sectionPaddingLeft:12,sectionPaddingRight:12,sectionPaddingTopPhone:10,sectionPaddingLeftPhone:10,sectionPaddingRightPhone:10},slots:{[i]:[{type:a,props:{...o,name:"Tag",direction:"row",share:"content",minWidth:0,...g,[M]:x},slots:{[i]:[t("tag",{...n,tag:"p",textFit:"ellipsis"},ie)]}},t("number",{...n,tag:"p",textFit:"line"},Kt)]}},{type:a,props:{...o,name:"Words",justify:"end",align:"start",placement:"bottom-left",share:"content",widthFit:"fill",sectionHeightMode:"fill",gap:8,gapPhone:8,...r(24,24,12,14),sectionPaddingTopPhone:4,darken:Bt,darkenStyle:"bottom",[M]:x},slots:{[i]:[{type:a,props:{...o,name:"Heading",widthFit:"fill",gap:4,gapPhone:4,...g},slots:{[i]:[t("eyebrow",{...n,tag:"p",_hiddenPhone:!0},Mt),t("name",{...n,tag:"h3"},xt)]}},t("meta",{...n,tag:"p"},Yt)]}}]}});function Ut(e){return D(e,E,"GalleryB",l=>f([Gt()],(L,s)=>`${l}~tile${s?`.${s}`:""}`))}const Vt={fields:[{key:"image",label:"Image",kind:"image",alt:"name"},{key:"tag",label:"Tag"},{key:"number",label:"Card number"},{key:"eyebrow",label:"Eyebrow"},{key:"name",label:"Title"},{key:"meta",label:"Meta"},{key:"href",label:"Product link",kind:"link"}],seedOnInsert:Ut},Wt=["showCardPrice","showCardFinishes","showCardSizes","showCardBuy","showCardPage"],vt=e=>Object.fromEntries(Object.entries(e).filter(([l])=>!Wt.includes(l))),ne={fields:[{key:"label",label:"Label"},{key:"href",label:"Link",kind:"link"}],blocks:[{type:Fe,label:"Menu link"}],seed:He},re=e=>e.dynamic===!0&&e.relationship==="bundles",gl=(e={})=>ot(e),P={fields:I,blocks:[{type:Je,label:"Picture"},{type:qe,label:"Eyebrow"},{type:Qe,label:"Name"},{type:lt,label:"Specs"},{type:et,label:"Price"},{type:ze,label:"Colour"},{type:tt,label:"Size"},{type:je,label:"Buy"}],seed:e=>{if(e.dynamic!==!0)return N(e);const l=S(e);return re(e)?u(l):N(l)}},se=[{key:"label",label:"Filter name"},{key:Ae,label:"Options",kind:"list",fields:[{key:"label",label:"Option"},{key:"count",label:"Count"}]}],Ee=[{slot:Be,label:we,fields:A},{slot:De,label:Ne,fields:[]}],$t=[{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",...ne},{block:st,...ne},{block:Et,...P},{block:it,...P,slots:[{slot:E,fields:I},{slot:$,label:v,fields:h},...Ee],fields:[...I,...h,...A],seed:e=>Z(X(at(e)))},{block:"RelatedProducts",...P,seed:e=>{const l=S({...vt(e),dynamic:!0});return re(l)?u(l):N(l,{legacyWellHonoured:!0})}},{block:"BundleOffer",...P,seed:e=>u(S({...e,columns:he(e),dynamic:!0}))},{block:_t,slots:[{slot:E,fields:[]},{slot:fe,label:ke,fields:W},{slot:Re,label:ye,fields:[]}],fields:W,blocks:[{type:ge,label:"Price"}],seed:e=>Ce(Se(Pe(e)))},{block:nt,slots:[{slot:E,fields:se},{slot:$,label:v,fields:h},...Ee],fields:[...se,...h,...A],blocks:[{type:R,label:"Card list"}],seed:e=>Z(X(ue(e)))},{block:rt,fields:[{key:"label",label:"Pick"},{key:"mark",label:"Remove mark"}],seed:Ie},{block:"ContactRouting",slots:[{slot:Ye,label:"Topic card",fields:z},{slot:xe,label:"Reason chip",fields:Me},{slot:Ke,label:"Channel row",fields:j}],fields:[...z,...j],seed:Ge},{block:Ue,fields:[{key:"heading",label:"Subhead"},{key:"paragraph",label:"Paragraph",multiline:!0}],seed:Ve},...[ve,We].map(e=>({block:e,slots:Xe,fields:$e,seed:l=>Ze(e,l)})),{block:"Events",...Ct},{block:"Collections",...ut},{block:"GalleryB",...Vt},{block:"FitmentTable",fields:[...q,...Q],slots:[{slot:Tt,label:dt,fields:q},{slot:ct,label:pt,fields:Q}]}];de($t);export{$t as STOREFRONT_CARD_TEMPLATES,At as collectionCardSeed,re as drawsKits,Rt as eventsCardSeeds,Gt as galleryTileSeed,gl as productGridCardSeed,It as withCollectionsTemplate,yt as withEventsTemplate,Ut as withGalleryTemplate};
|
|
1
|
+
import{CARD_LIST_TYPE as R,CARD_ROW_FIELD_PROP as y,CARD_ROW_LINK_PROP as m,CARD_TEMPLATE_SLOT as E,registerCardTemplates as ce}from"efficient-web-builder/format/lib/content/card-template";import{DIM as d,INNER_BOX as o,LABEL_FACE as C,TEXT as n,boxPadding as r,fillSlot as H,labelLook as p,labelStyle as K,seedNodes as f,token as _}from"efficient-web-builder/format/lib/document/seed-parts";import{BOX_SHOW_KEY as M,BOX_SHOW_ON_CARD_HOVER as Y,HOVER_KEY as Oe,PICTURE_HOVER_KEYS as x}from"efficient-web-builder/format/lib/animation/hover";import{BOX_TYPE as a,CONTAINER_BLOCKS_SLOT as i}from"efficient-web-builder/format/lib/document/container-blocks";import{BOX_ROW_IMAGE_PROP as k}from"efficient-web-builder/format/lib/content/box-card-rule";import{POST_CARD_HEIGHT as Le}from"efficient-web-builder/format/lib/post-card-layout";import{EVENTS_FEATURED_DARKEN as me,EVENTS_FEATURED_DARKEN_STYLE as G,EVENTS_FEATURED_PLACEMENT as be}from"../content/events-featured-look.js";import{COLLECTION_DARKEN as he,COLLECTION_HOVER_DARKEN as ge,COLLECTION_HOVER_ZOOM as U}from"../content/collection-card-look.js";import{COLLECTION_CARD_REGIONS as b,COLLECTION_CARD_TEXT_SIZE as Pe}from"efficient-web-builder/format/lib/sections/collection-card-text-regions";import{SH_LINK as V}from"efficient-web-builder/render/lib/document/blocks/general/section-to-box-row-parts";import{rowFieldTextSeed as t}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{withRelatedTabletColumns as S}from"../sections/product-grid-columns.js";import{bundleColumns as Re}from"../sections/bundle-to-grid.js";import{HERO_GALLERY_BLOCK as ye,withHeroTemplate as Ce}from"../content/hero-seed.js";import{HERO_BUY_SLOT as fe,HERO_BUY_SLOT_LABEL as ke,withHeroBuyTemplate as Se}from"../content/hero-buy-seed.js";import{HERO_OPTION_FIELDS as W,HERO_OPTION_SLOT as Ae,HERO_OPTION_SLOT_LABEL as Ie,withHeroOptionTemplate as ue}from"../content/hero-option-seed.js";import{FILTER_OPTIONS_FIELD as Ne,withFilterChipsTemplate as De,withFilterTemplate as we}from"../content/filter-card-seed.js";import{FACET_ROW_FIELDS as h,FACET_TEMPLATE_LABEL as v,FACET_TEMPLATE_SLOT as $,withFacetTemplate as X}from"../content/facet-row-seed.js";import{RAIL_HEAD_TEMPLATE_LABEL as Be,RAIL_HEAD_TEMPLATE_SLOT as Fe,RAIL_ROW_FIELDS as A,RAIL_TEMPLATE_LABEL as He,RAIL_TEMPLATE_SLOT as Ke,withRailTemplates as Z}from"../content/rail-row-seed.js";import{MENU_LINK_BLOCK as Me,withMenuTemplate as Ye}from"../content/menu-card-seed.js";import{CONTACT_CHANNEL_FIELDS as j,CONTACT_CHANNEL_SLOT as xe,CONTACT_REASON_FIELDS as Ge,CONTACT_REASON_SLOT as Ue,CONTACT_TOPIC_FIELDS as z,CONTACT_TOPIC_SLOT as Ve,withContactTemplates as We}from"../content/contact-card-seed.js";import{ARTICLE_BODY_BLOCK as ve,withArticleBodyTemplate as $e}from"efficient-web-builder/format/lib/document/article-body-seed";import{APPOINTMENT_BOOKING_TYPE as Xe,BOOKING_BOX_TYPE as Ze,BOOKING_OPTION_FIELDS as je,BOOKING_TEMPLATE_SLOTS as ze,withBookingTemplates as qe}from"../content/booking-card-seed.js";import{PRODUCT_BUY_BLOCK as Qe,PRODUCT_CARD_FIELDS as I,PRODUCT_COLOUR_BLOCK as Je,PRODUCT_EYEBROW_BLOCK as q,PRODUCT_NAME_BLOCK as Q,PRODUCT_PICTURE_BLOCK as et,PRODUCT_PRICE_BLOCK as J,PRODUCT_SIZE_BLOCK as tt,PRODUCT_SPECS_BLOCK as lt,productCardSeed as ot,withKitCardTemplate as u,withListingCardTemplate as at,withProductCardTemplate as N}from"../content/product-card-seed.js";import{ALLOY_WHEELS_LISTING_TYPE as it,FILTER_BLOCK_TYPE as nt,FILTER_CHIPS_TYPE as rt,MENU_BLOCK_TYPE as st,PRODUCT_GRID_TYPE as Et,PRODUCT_HERO_TYPE as _t}from"./document-nodes.js";import{withSeededSlot as D}from"../content/seed-ids.js";import{FITMENT_HEAD_FIELDS as ee,FITMENT_HEAD_TEMPLATE_LABEL as dt,FITMENT_HEAD_TEMPLATE_SLOT as pt,FITMENT_ROW_FIELDS as te,FITMENT_ROW_TEMPLATE_LABEL as Tt,FITMENT_ROW_TEMPLATE_SLOT as ct}from"../content/fitment-row-seed.js";const le="tags",T=p(12),oe={textStyle:"heading-3",..._("headingSmall",20),weight:500,lineHeight:1.2,letterSpacing:-.02},ae={textStyle:"body-1",..._("body",14),lineHeight:1.55},Ot={...oe,..._("headingSmall",30)},Lt={sectionPaddingTop:24,sectionPaddingRight:28,sectionPaddingBottom:32,sectionPaddingLeft:28,sectionPaddingTopPhone:24,sectionPaddingRightPhone:28,sectionPaddingBottomPhone:32,sectionPaddingLeftPhone:28},mt=Le.fallback,bt=480,ht=70,gt=()=>({type:a,props:{...o,name:"Featured",[k]:"cover",darken:me,darkenStyle:G,darkenPhone:ht,darkenStylePhone:G,placement:be,direction:"column",gap:8,gapPhone:8,...r(32,32,20,20),sectionHeightMode:"fixed",sectionHeightValue:mt,sectionHeightUnit:"px",sectionHeightModePhone:"fixed",sectionHeightValuePhone:bt,sectionHeightUnitPhone:"px",[m]:"href"},slots:{[i]:[t("meta",{...n,tag:"p"},T,!0),t("title",{...n,tag:"h3",widthFit:"fill"},Ot),t("excerpt",{...d,tag:"p",widthFit:"fill",maxWidth:384},ae),t("dateLabel",{...d,tag:"p"},{...T,color:"muted"})]}}),Pt=()=>({type:a,props:{...o,name:"Post",gap:0,gapPhone:0,...r(0,0,0,0),...H("surface"),shadow:!0},slots:{[i]:[{type:"ImageBlock",props:{[y]:"cover",aspect:"16/10",contained:!1}},{type:a,props:{...o,name:"Words",gap:12,gapPhone:12,...Lt},slots:{[i]:[{type:a,props:{...o,name:"Meta",direction:"row",wrap:!0,share:"content",sharePhone:"content",phoneRow:2,gap:12,gapPhone:12,...r(0,0,0,0)},slots:{[i]:[t("meta",{...n,tag:"p"},T,!0),t("dateLabel",{...d,tag:"p"},{...T,color:"muted"},!0)]}},t("title",{...n,tag:"h3",widthFit:"fill"},oe),t("excerpt",{...d,tag:"p",widthFit:"fill"},ae),{type:R,props:{[y]:le},slots:{template:[{type:a,props:{...o,name:"Chip",...r(4,8,4,8),sectionBorder:{width:1}},slots:{[i]:[t("label",{...d,tag:"p"},T)]}}]}},{type:"ButtonBlock",props:{variant:"ghost",label:"Read more",href:"",[m]:"href",...V,icon:"arrow-right",iconPosition:"after",_partStyles:{label:K(12)}}}]}}]}}),Rt=()=>[gt(),Pt()];function yt(e){const l=["featured","post"];return D(e,E,"Events",L=>f(Rt(),(s,Te)=>{const[w,...B]=Te.split("."),F=l[Number(w)]??`card${w}`;return B.length?`${L}~${F}.${B.join(".")}`:`${L}~${F}`}))}const Ct={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:le,label:"Tags",kind:"list",fields:[{key:"label",label:"Tag"}]}],blocks:[{type:R,label:"Card list"}],seedOnInsert:yt},c=e=>Number(/(\d+)px/.exec(e)?.[1]),O={tag:c(b.tag.builtIn),name:c(b.name.builtIn),namePhone:c(Pe.namePhone),body:c(b.body.builtIn),link:c(b.link.builtIn)},ft={...p(O.tag),letterSpacing:.25},kt={textStyle:"heading-2",..._("headingMedium",O.name,O.namePhone),weight:500,lineHeight:1,letterSpacing:-.03},St={textStyle:"body-1",..._("body",O.body),lineHeight:1.5,paragraphSpacing:12},ie=()=>[t("tag",{...n,tag:"p"},ft,!0),t("name",{...n,tag:"h3",widthFit:"fill"},kt),t("desc",{...n,tag:"p",widthFit:"fill",maxWidth:420},St),{type:"ButtonBlock",props:{variant:"ghost",label:"Explore",href:"",[m]:"href",...V,icon:"arrow-right",iconPosition:"after",_partStyles:{label:K(O.link)}}}],ne={_hidden:!0,_hiddenTablet:!0,_hiddenPhone:!1},At=()=>({type:a,props:{...o,name:"Collection",gap:0,gapPhone:0,...r(0,0,0,0),[m]:"href"},slots:{[i]:[{type:a,props:{...o,name:"Picture",[k]:"image",boxShape:"portrait",darken:he,placement:"bottom-left",direction:"column",gap:12,gapPhone:12,...r(32,32),hoverZoom:U,hoverDarken:ge,_hiddenPhone:!0},slots:{[i]:ie()}},{type:"ImageBlock",props:{[y]:"image",aspect:"4/5",contained:!1,hoverZoom:U,...ne}},{type:a,props:{...o,name:"Words",gap:12,gapPhone:12,...r(24,24),...H("surface"),...ne},slots:{[i]:ie()}}]}});function It(e){return D(e,E,"Collections",l=>f([At()],(L,s)=>`${l}~card${s?`.${s}`:""}`))}const ut={fields:[{key:"tag",label:"Eyebrow"},{key:"name",label:"Title"},{key:"desc",label:"Description",multiline:!0},{key:"image",label:"Image",kind:"image",alt:"name"},{key:"href",label:"Link",kind:"link"}],seedOnInsert:It},Nt=35,Dt=50,wt=106,Bt=85,Ft="nextImage",Ht="#f5f1e8",re="#c4c1ba",se={...C,...p(11),letterSpacing:.24,color:"main"},Kt={...se,color:re},Mt={...C,...p(12,11),color:"main"},Yt={textStyle:"heading-3",..._("headingSmall",22,16),weight:500,lineHeight:1.05,letterSpacing:-.02,color:Ht},xt={...C,...p(12),letterSpacing:.12,color:re},g=r(0,0,0,0),Gt=()=>({type:a,props:{...o,name:"Tile",placement:"top-left",share:"content",gap:0,gapPhone:0,...g,[k]:"image",boxShape:"square",darken:Nt,[Oe]:Ft,[x.zoom]:wt,[x.darken]:Dt},slots:{[i]:[{type:a,props:{...o,name:"Top row",direction:"row",justify:"between",align:"start",share:"content",phoneRow:2,sharePhone:"content",wrapPhone:"nowrap",widthFit:"fill",gap:8,gapPhone:8,...g,sectionPaddingTop:12,sectionPaddingLeft:12,sectionPaddingRight:12,sectionPaddingTopPhone:10,sectionPaddingLeftPhone:10,sectionPaddingRightPhone:10},slots:{[i]:[{type:a,props:{...o,name:"Tag",direction:"row",share:"content",minWidth:0,...g,[M]:Y},slots:{[i]:[t("tag",{...n,tag:"p",textFit:"ellipsis"},se)]}},t("number",{...n,tag:"p",textFit:"line"},Kt)]}},{type:a,props:{...o,name:"Words",justify:"end",align:"start",placement:"bottom-left",share:"content",widthFit:"fill",sectionHeightMode:"fill",gap:8,gapPhone:8,...r(24,24,12,14),sectionPaddingTopPhone:4,darken:Bt,darkenStyle:"bottom",[M]:Y},slots:{[i]:[{type:a,props:{...o,name:"Heading",widthFit:"fill",gap:4,gapPhone:4,...g},slots:{[i]:[t("eyebrow",{...n,tag:"p",_hiddenPhone:!0},Mt),t("name",{...n,tag:"h3"},Yt)]}},t("meta",{...n,tag:"p"},xt)]}}]}});function Ut(e){return D(e,E,"GalleryB",l=>f([Gt()],(L,s)=>`${l}~tile${s?`.${s}`:""}`))}const Vt={fields:[{key:"image",label:"Image",kind:"image",alt:"name"},{key:"tag",label:"Tag"},{key:"number",label:"Card number"},{key:"eyebrow",label:"Eyebrow"},{key:"name",label:"Title"},{key:"meta",label:"Meta"},{key:"href",label:"Product link",kind:"link"}],seedOnInsert:Ut},Wt=["showCardPrice","showCardFinishes","showCardSizes","showCardBuy","showCardPage"],vt=e=>Object.fromEntries(Object.entries(e).filter(([l])=>!Wt.includes(l))),Ee={fields:[{key:"label",label:"Label"},{key:"href",label:"Link",kind:"link"}],blocks:[{type:Me,label:"Menu link"}],seed:Ye},_e=e=>e.dynamic===!0&&e.relationship==="bundles",gl=(e={})=>ot(e),P={fields:I,blocks:[{type:et,label:"Picture"},{type:q,label:"Eyebrow"},{type:Q,label:"Name"},{type:lt,label:"Specs"},{type:J,label:"Price"},{type:Je,label:"Colour"},{type:tt,label:"Size"},{type:Qe,label:"Buy"}],seed:e=>{if(e.dynamic!==!0)return N(e);const l=S(e);return _e(e)?u(l):N(l)}},de=[{key:"label",label:"Filter name"},{key:Ne,label:"Options",kind:"list",fields:[{key:"label",label:"Option"},{key:"count",label:"Count"}]}],pe=[{slot:Ke,label:He,fields:A},{slot:Fe,label:Be,fields:[]}],$t=[{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",...Ee},{block:st,...Ee},{block:Et,...P},{block:it,...P,slots:[{slot:E,fields:I},{slot:$,label:v,fields:h},...pe],fields:[...I,...h,...A],seed:e=>Z(X(at(e)))},{block:"RelatedProducts",...P,seed:e=>{const l=S({...vt(e),dynamic:!0});return _e(l)?u(l):N(l,{legacyWellHonoured:!0})}},{block:"BundleOffer",...P,seed:e=>u(S({...e,columns:Re(e),dynamic:!0}))},{block:_t,slots:[{slot:E,fields:[]},{slot:Ae,label:Ie,fields:W},{slot:fe,label:ke,fields:[]}],fields:W,blocks:[{type:ye,label:"Product Gallery"},{type:q,label:"Eyebrow"},{type:Q,label:"Name"},{type:J,label:"Price"}],seed:e=>Se(ue(Ce(e)))},{block:nt,slots:[{slot:E,fields:de},{slot:$,label:v,fields:h},...pe],fields:[...de,...h,...A],blocks:[{type:R,label:"Card list"}],seed:e=>Z(X(we(e)))},{block:rt,fields:[{key:"label",label:"Pick"},{key:"mark",label:"Remove mark"}],seed:De},{block:"ContactRouting",slots:[{slot:Ve,label:"Topic card",fields:z},{slot:Ue,label:"Reason chip",fields:Ge},{slot:xe,label:"Channel row",fields:j}],fields:[...z,...j],seed:We},{block:ve,fields:[{key:"heading",label:"Subhead"},{key:"paragraph",label:"Paragraph",multiline:!0}],seed:$e},...[Ze,Xe].map(e=>({block:e,slots:ze,fields:je,seed:l=>qe(e,l)})),{block:"Events",...Ct},{block:"Collections",...ut},{block:"GalleryB",...Vt},{block:"FitmentTable",fields:[...ee,...te],slots:[{slot:pt,label:dt,fields:ee},{slot:ct,label:Tt,fields:te}]}];ce($t);export{$t as STOREFRONT_CARD_TEMPLATES,At as collectionCardSeed,_e as drawsKits,Rt as eventsCardSeeds,Gt as galleryTileSeed,gl as productGridCardSeed,It as withCollectionsTemplate,yt as withEventsTemplate,Ut as withGalleryTemplate};
|
|
@@ -7,6 +7,7 @@ import "./section-to-box-rows-productgrid.js";
|
|
|
7
7
|
import "./section-to-box-rows-events.js";
|
|
8
8
|
import "./section-to-box-rows-collections.js";
|
|
9
9
|
import "./section-to-box-rows-gallery.js";
|
|
10
|
+
import "./section-to-box-rows-producthero.js";
|
|
10
11
|
import "./section-to-box-rows-fitment.js";
|
|
11
12
|
import "./section-to-box-rows-detail.js";
|
|
12
13
|
import "./section-to-box-rows-service.js";
|