efficient-storefront-blocks 0.108.0 → 0.109.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.
@@ -1,3 +1,3 @@
1
1
  {
2
- "efficient-web-builder": "68.1.0"
2
+ "efficient-web-builder": "68.2.0"
3
3
  }
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as k}from"react/jsx-runtime";import N from"next/link";import w,{FOOTER_LOGO_PX as j,WORDMARK_FIT_FLOOR_PX as v}from"efficient-web-builder/render/components/Logo";import{useSiteLogo as A}from"efficient-web-builder/render/components/SiteLogoContext";import{renderGold as I}from"efficient-web-builder/render/components/goldPhrases";import{BLOCK_ALIGN_TEXT as m}from"efficient-web-builder/format/lib/content/block-align";import{BOX_ALIGN_CLASS as t}from"efficient-web-builder/format/lib/content/box-layout";import{say as S}from"efficient-web-builder/format/lib/editor-words";import{HideTaker as T}from"efficient-web-builder/render/components/ViewHideRoot";const d={left:`${t.start} text-left`,center:`${t.center} ${m.center}`,right:`${t.end} ${m.right}`};function $({tagline:o,widthPct:c=100,align:i="left",reverse:f=!0,color:x=null,padTop:n=0,padRight:a=0,padBottom:s=0,padLeft:l=0,editing:p=!1}){const{src:g,reversedSrc:h,inkIsDark:u,wordmark:L,siteName:r}=A(),O=Math.round(j*(c/100)),_={...n?{paddingTop:n}:{},...a?{paddingRight:a}:{},...s?{paddingBottom:s}:{},...l?{paddingLeft:l}:{}};return k(T,{as:"div",className:["flex min-w-0 flex-col",Object.hasOwn(d,i)?d[i]:"","[container-type:inline-size]"].filter(Boolean).join(" "),style:_,children:[e(N,{href:"/","aria-label":r?`${r} home`:"Home",className:"inline-flex max-w-full overflow-x-clip",children:e(w,{variant:"footer",sizePx:O,src:g,reverse:f,color:x,reversedSrc:h,inkIsDark:u,wordmark:L,siteName:r,fitWordmarkToContainer:!0,fitFloorPx:v})}),o?e("p",{className:"mt-4 max-w-[280px] text-[13px] leading-[1.5] text-fg-dim",children:I(o)}):p?e("p",{className:"mt-4 max-w-[280px] text-[13px] italic leading-[1.5] text-fg-dim/60",children:S("Add a short brand tagline →")}):null]})}export{$ as default};
1
+ "use client";import{jsx as e,jsxs as k}from"react/jsx-runtime";import w from"next/link";import A,{FOOTER_LOGO_PX as I,WORDMARK_FIT_FLOOR_PX as j}from"efficient-web-builder/render/components/Logo";import{useSiteLogo as v}from"efficient-web-builder/render/components/SiteLogoContext";import{renderGold as G}from"efficient-web-builder/render/components/goldPhrases";import{BLOCK_ALIGN_BOX_WORD as t,BLOCK_ALIGN_TEXT as f}from"efficient-web-builder/format/lib/content/block-align";import{BOX_ALIGN_CLASS as o}from"efficient-web-builder/format/lib/content/box-layout";import{say as S}from"efficient-web-builder/format/lib/editor-words";import{HideTaker as T}from"efficient-web-builder/render/components/ViewHideRoot";const c={left:`${o[t.left]} text-left`,center:`${o[t.center]} ${f.center}`,right:`${o[t.right]} ${f.right}`};function $({tagline:i,widthPct:d=100,align:n="left",reverse:x=!0,color:p=null,padTop:a=0,padRight:l=0,padBottom:s=0,padLeft:m=0,editing:O=!1}){const{src:_,reversedSrc:g,inkIsDark:L,wordmark:h,siteName:r}=v(),u=Math.round(I*(d/100)),N={...a?{paddingTop:a}:{},...l?{paddingRight:l}:{},...s?{paddingBottom:s}:{},...m?{paddingLeft:m}:{}};return k(T,{as:"div",className:["flex min-w-0 flex-col",Object.hasOwn(c,n)?c[n]:"","[container-type:inline-size]"].filter(Boolean).join(" "),style:N,children:[e(w,{href:"/","aria-label":r?`${r} home`:"Home",className:"inline-flex max-w-full overflow-x-clip",children:e(A,{variant:"footer",sizePx:u,src:_,reverse:x,color:p,reversedSrc:g,inkIsDark:L,wordmark:h,siteName:r,fitWordmarkToContainer:!0,fitFloorPx:j})}),i?e("p",{className:"mt-4 max-w-[280px] text-[13px] leading-[1.5] text-fg-dim",children:G(i)}):O?e("p",{className:"mt-4 max-w-[280px] text-[13px] italic leading-[1.5] text-fg-dim/60",children:S("Add a short brand tagline →")}):null]})}export{$ as default};
@@ -1 +1 @@
1
- "use client";import{jsx as a,Fragment as u,jsxs as l}from"react/jsx-runtime";import Z from"next/link";import{BUY_ROW_CLASS as Ee}from"./buy-row.js";import{useEffect as ee,useRef as Le,useState as Oe}from"react";import{useCart as Ae}from"./CartContext.js";import{useSiteTakesOrders as Ce}from"./SiteRecordContext.js";import Ie from"./EmailCaptureForm.js";import{useEnglish as te}from"./EnglishVariant.js";import{MarkedLabel as P,heroView as $e}from"./product-hero/hero-view.js";import Me from"./ProductGallery.js";import{useRootIsDark as Pe}from"efficient-shell/theme";import{useStockAlertSignup as He}from"./useStockAlertSignup.js";import{SPARE_WORDS as ze,productCartLine as Fe}from"../lib/catalog/purchase.js";import{OPTION_ROW_ATTR as De}from"../lib/catalog/store-product.js";import{resolvingRowsAnswered as je}from"../lib/catalog/product-options.js";import{trackViewItem as Be}from"../lib/google-tag.js";import{DEFAULT_HERO_LAYOUT as Ue,DEFAULT_HERO_RATIO as Ge,DEFAULT_HERO_TEXT_ALIGN as Ve,parseHeroLayout as We,parseHeroRatio as Xe,parseHeroTextAlign as qe}from"../lib/sections/hero-arrangement.js";import{DEFAULT_HERO_GALLERY_MODE as Ke,DEFAULT_HERO_IMAGE_FIT as Ye}from"../lib/sections/hero-gallery.js";import{MAX_SPARES as Qe,UNITS_PER_SET as ae,formatPrice as le}from"../lib/commerce.js";import{formatSelectionPrice as Je,setPriceLabel as Ze}from"../lib/wheels/price-display.js";import{productIsDually as et,productIsTwoObjects as tt,setSuppressesRow as at}from"../lib/wheels/set-mode.js";import{CONTENT_CAP_GUTTER as ne}from"../lib/sections/content-cap-gutter.js";import{CardTemplateRows as re}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as lt}from"efficient-web-builder/render/components/SiteGutterFrame";import{BLOCK_ALIGN_TEXT as nt}from"efficient-web-builder/format/lib/content/block-align";import{BOX_ALIGN_CLASS as rt}from"efficient-web-builder/format/lib/content/box-layout";import{cardRow as st}from"efficient-web-builder/format/lib/content/card-template";import{optionCardRows as it}from"../lib/sections/filter-option-rows.js";import{HERO_OPTION_SLOT as ot}from"../lib/content/hero-option-seed.js";import ct from"./card-pieces/CardBuyButton.js";import mt from"./card-pieces/CardQuantity.js";import pt from"./card-pieces/CardSave.js";import dt from"./card-pieces/CardStatedFacts.js";import{HeroStateProvider as H}from"./card-pieces/ProductCardState.js";const ft=4e3;function ut(t){return t?[t.year,t.make,t.model,t.modification].join("-"):""}const ht=[{}],gt=.72;function bt(t){const s=t.trim().split(/\s+/).filter(Boolean);if(s.length===0)return;const p=s.map((i,o)=>i.length+(s.length>1&&o===s.length-1?1:0));return`calc(100cqi / ${(Math.max(...p)*gt).toFixed(2)})`}function xt({product:t,selection:s,onLightbox:p,editing:i=!1,pricePlacement:o="top",showVehicleFitment:d=!0,heroLayout:n=Ue,imageRatio:w=Ge,textAlign:ie=Ve,showSpecTable:oe=!0,showPriceQuote:_=!0,galleryMode:ce=Ke,imageFit:me=Ye,trustBullets:pe,nodeId:z,priceTemplate:de,optionTemplate:fe,optionPressTitles:ue}){const he=te(),b=We(n),F=qe(ie),S=Xe(w),ge=b==="imageRight"?`${100-S}fr ${S}fr`:`${S}fr ${100-S}fr`,{picked:be,pick:D,qty:j,setQty:xe,choice:v,setChoice:T,angleIdx:ve,setAngleIdx:ke,showValidation:ye,setShowValidation:R,manualMode:B,vehicle:E,rows:U,facts:Ne,part:h,outOfStock:G,offer:c,preOrder:L,canAddToCart:V,currency:x,price:f,set:W,msrpLabel:Se}=s,r=$e(t,s,i),O=et(t),Te=tt(t),A=d?r.vehicle:null,we=d?r.vehicleMemory:null,C=!Pe({whenUnset:!0}),{warmCatalog:X}=Ae(),g=Ce();ee(()=>{!i&&g&&X(t.kind,t.slug)},[i,g,t.kind,t.slug,X]);const q=U.filter(e=>!L||e.values.length>0),K=q.filter(e=>e.role==="resolves"),I=q.filter(e=>e.role==="describes"&&!at(Te,e.key)),Y=I.findIndex(e=>e.chosen===null),Q=(!A||!r.vehicleAnswersSpecs||s.fitmentSet)&&je(U,L)?Y===-1?I:I.slice(0,Y+1):[],_e=[...K,...Q];function Re(){return V?(R(!1),i?null:Fe(t,h,be,{choice:v,qty:j},{fitmentLabel:B?r.specCaption:E.appliedName?`For ${E.appliedName}`:"",fitmentKey:B?`manual|${r.specCaption}`:`vehicle|${ut(E.applied?.vehicle)}`})):(R(!0),window.setTimeout(()=>R(!1),ft),null)}const $={kind:"hero",msrpLabel:Se||null,amount:O?Ze(f,x):Je(f,x),unitLabel:f.priced?r.unitLabel:null,packBadge:f.setTotal!=null?`${c.quantityLabel}: ${le(W,x)}`:null,buy:{isSet:O,priced:f.priced,outOfStock:G,canAdd:V,totalLabel:f.setTotal!=null?le(W,x):null,lineToAdd:Re},qty:j,setQty:xe,takesQty:g&&!(O&&!f.priced),save:{slug:t.slug,name:t.name},facts:oe?Ne:null},M=a(H,{value:$,children:a(re,{ownerId:z??"",ownerType:"ProductHero",Template:de,rows:ht,fallback:null,children:e=>e})}),k={nodeId:z??"",template:fe,pressTitles:ue,editing:i},J=Le(null);return ee(()=>{i||J.current===t.slug||(J.current=t.slug,Be({itemId:h?`${t.slug}|${h.id}`:t.slug,itemName:t.name,variant:r.metaValue,pricePerSet:f.setTotal??f.fromSetTotal??0,currency:x}))},[i,t.slug,t.name,r.metaValue,h,f,x]),l(u,{children:[a("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:C?void 0:{background:"var(--section-bg)"},children:t.crumbs.map((e,m)=>l("span",{children:[m>0&&l(u,{children:[a("span",{className:"mx-3 text-accent",children:"/"}),a("wbr",{})]}),e.href?a(Z,{href:e.href,className:"hover:text-fg",children:a(P,{text:e.label})}):a("span",{className:"text-fg",children:a(P,{text:e.label})})]},`${e.label}-${m}`))}),l("section",{"data-hero-layout":b,"data-hero-align":F,className:[`grid gap-10 ${ne} 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:{...C?{}:{background:"var(--section-bg)"},...b==="stacked"?{}:{"--hero-cols":ge}},children:[a(Me,{product:t,view:r,angleIdx:ve,onSelect:ke,isLight:C,onLightbox:p,galleryMode:ce,imageFit:me,style:b==="imageRight"?{order:2}:void 0}),l("div",{className:["flex flex-col gap-7",F==="center"?`${rt.center} ${nt.center}`:""].filter(Boolean).join(" "),style:b==="imageRight"?{order:1}:void 0,children:[l("div",{className:"w-full [container-type:inline-size]",children:[l("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(P,{text:t.eyebrow})}),t.badge&&l(u,{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":bt(r.heading)},children:(()=>{const e=r.heading.lastIndexOf(" ");if(e===-1)return r.heading;const m=r.heading.slice(0,e),y=r.heading.slice(e+1);return l(u,{children:[m," ",l("em",{className:"font-normal italic text-accent",children:[y,"."]})]})})()})]}),o!=="belowSpecs"&&_&&M,we,K.map(e=>a(se,{row:e,onPick:D,options:k},e.key)),L&&r.preOrder?l(u,{children:[o==="belowSpecs"&&_&&M,r.preOrder]}):l(u,{children:[A,Q.map(e=>a(se,{row:e,onPick:D,options:k},e.key)),a(H,{value:$,children:a(dt,{})}),(c.packs.length>0||g&&(c.extra||c.spareCounts.length>0))&&l("div",{className:"border-b border-line pb-[26px]",children:[c.packs.length>0&&l(u,{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(N,{hero:k,values:c.packs,item:e=>({label:e.label}),picked:e=>v.unit===e.value,press:e=>()=>T(m=>({...m,unit:e.value}))})})]}),g&&c.extra&&l("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=>T(m=>({...m,spares:e.target.checked?Qe:0})),className:"h-4 w-4 cursor-pointer accent-[var(--accent)]"}),c.extra.label]}),g&&c.spareCounts.length>0&&l(u,{children:[a("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:ze.howMany}),a("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:flex-wrap",children:a(N,{hero:k,values:c.spareCounts,item:e=>({label:`${e.value} · ${e.label}`}),picked:e=>v.spares===e.value-ae,press:e=>()=>T(m=>({...m,spares:e.value-ae}))})})]}),g&&c.spareSide&&l(u,{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(N,{hero:k,values:c.spareSide.options,item:e=>({label:e.label}),picked:e=>v.spareSide===e.value,press:e=>()=>T(m=>({...m,spareSide:e.value}))})})]})]}),o==="belowSpecs"&&_&&M,a("div",{className:Ee,children:l(H,{value:$,children:[a(mt,{}),a(ct,{}),a(pt,{})]})}),G&&h&&a(vt,{partNumbers:h.components.map(e=>e.partNumber),productSlug:t.slug},h.id),ye&&(()=>{const e=_e.filter(y=>y.chosen===null).map(y=>he(y.prompt).replace(/^Select\s+/i,""));if(A&&r.vehicleAnswersSpecs&&!s.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 l("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."]})})()]}),pe]})]})]})}function se({row:t,onPick:s,options:p}){const i=te();if(t.values.length===0&&!t.empty)return null;const o=t.values.find(n=>n.value===t.chosen),d=o&&[o.label,o.note].filter(Boolean).join(" · ");return l("div",{className:"border-b border-line pb-[26px]",[De]:t.key,children:[l("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?l("p",{className:"font-mono text-[length:var(--size-body,12px)] leading-relaxed tracking-[0.1em] text-fg-dim",children:[t.empty.text," ",a(Z,{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(N,{hero:p,values:t.values,item:n=>({swatch:n.swatch??"",name:n.label}),picked:n=>n.value===t.chosen,press:n=>()=>s(t.key,n.value)})}):a("div",{className:"flex flex-wrap gap-1.5",children:a(N,{hero:p,values:t.values,item:n=>({label:n.label,note:n.note??""}),picked:n=>n.value===t.chosen,press:n=>()=>s(t.key,n.value)})})]})}function N({hero:t,values:s,item:p,picked:i,press:o}){const d=it(s,{item:p,selected:i,press:o});return a(lt,{children:a(re,{ownerId:t.nodeId,ownerType:"ProductHero",slot:ot,Template:t.template,rows:d.items.map(st),items:d.items,states:d.states,actions:t.editing?void 0:d.actions,pressTitles:t.pressTitles,fallback:null,children:n=>n})})}function vt({partNumbers:t,productSlug:s}){const[p,i]=Oe(""),{status:o,submit:d,reset:n}=He();function w(){d({partNumbers:t,email:p,productSlug:s})}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(Ie,{className:"-mt-1",email:p,onEmailChange:i,status:o,onResetVerdict:n,onSubmit:w,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{xt as default};
1
+ "use client";import{jsx as a,Fragment as u,jsxs as l}from"react/jsx-runtime";import Z from"next/link";import{BUY_ROW_CLASS as Oe}from"./buy-row.js";import{useEffect as ee,useRef as Re,useState as Ee}from"react";import{useCart as Ae}from"./CartContext.js";import{useSiteTakesOrders as Ce}from"./SiteRecordContext.js";import Ie from"./EmailCaptureForm.js";import{useEnglish as te}from"./EnglishVariant.js";import{MarkedLabel as P,heroView as $e}from"./product-hero/hero-view.js";import Me from"./ProductGallery.js";import{useRootIsDark as Pe}from"efficient-shell/theme";import{useStockAlertSignup as He}from"./useStockAlertSignup.js";import{SPARE_WORDS as ze,productCartLine as Be}from"../lib/catalog/purchase.js";import{OPTION_ROW_ATTR as De}from"../lib/catalog/store-product.js";import{resolvingRowsAnswered as Fe}from"../lib/catalog/product-options.js";import{trackViewItem as je}from"../lib/google-tag.js";import{DEFAULT_HERO_LAYOUT as Ue,DEFAULT_HERO_RATIO as Ge,DEFAULT_HERO_TEXT_ALIGN as Ve,parseHeroLayout as We,parseHeroRatio as Xe,parseHeroTextAlign as Ke}from"../lib/sections/hero-arrangement.js";import{DEFAULT_HERO_GALLERY_MODE as qe,DEFAULT_HERO_IMAGE_FIT as Ye}from"../lib/sections/hero-gallery.js";import{MAX_SPARES as Qe,UNITS_PER_SET as ae,formatPrice as le}from"../lib/commerce.js";import{formatSelectionPrice as Je,setPriceLabel as Ze}from"../lib/wheels/price-display.js";import{productIsDually as et,productIsTwoObjects as tt,setSuppressesRow as at}from"../lib/wheels/set-mode.js";import{CONTENT_CAP_GUTTER as ne}from"../lib/sections/content-cap-gutter.js";import{CardTemplateRows as re}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as lt}from"efficient-web-builder/render/components/SiteGutterFrame";import{BLOCK_ALIGN_BOX_WORD as nt,BLOCK_ALIGN_TEXT as rt}from"efficient-web-builder/format/lib/content/block-align";import{BOX_ALIGN_CLASS as st}from"efficient-web-builder/format/lib/content/box-layout";import{cardRow as it}from"efficient-web-builder/format/lib/content/card-template";import{optionCardRows as ot}from"../lib/sections/filter-option-rows.js";import{HERO_OPTION_SLOT as ct}from"../lib/content/hero-option-seed.js";import mt from"./card-pieces/CardBuyButton.js";import pt from"./card-pieces/CardQuantity.js";import dt from"./card-pieces/CardSave.js";import ft from"./card-pieces/CardStatedFacts.js";import{HeroStateProvider as H}from"./card-pieces/ProductCardState.js";const ut=4e3;function ht(t){return t?[t.year,t.make,t.model,t.modification].join("-"):""}const gt=[{}],bt=.72;function xt(t){const s=t.trim().split(/\s+/).filter(Boolean);if(s.length===0)return;const p=s.map((i,o)=>i.length+(s.length>1&&o===s.length-1?1:0));return`calc(100cqi / ${(Math.max(...p)*bt).toFixed(2)})`}function vt({product:t,selection:s,onLightbox:p,editing:i=!1,pricePlacement:o="top",showVehicleFitment:d=!0,heroLayout:n=Ue,imageRatio:_=Ge,textAlign:ie=Ve,showSpecTable:oe=!0,showPriceQuote:w=!0,galleryMode:ce=qe,imageFit:me=Ye,trustBullets:pe,nodeId:z,priceTemplate:de,optionTemplate:fe,optionPressTitles:ue}){const he=te(),b=We(n),B=Ke(ie),S=Xe(_),ge=b==="imageRight"?`${100-S}fr ${S}fr`:`${S}fr ${100-S}fr`,{picked:be,pick:D,qty:F,setQty:xe,choice:v,setChoice:T,angleIdx:ve,setAngleIdx:ke,showValidation:ye,setShowValidation:L,manualMode:j,vehicle:O,rows:U,facts:Ne,part:h,outOfStock:G,offer:c,preOrder:R,canAddToCart:V,currency:x,price:f,set:W,msrpLabel:Se}=s,r=$e(t,s,i),E=et(t),Te=tt(t),A=d?r.vehicle:null,_e=d?r.vehicleMemory:null,C=!Pe({whenUnset:!0}),{warmCatalog:X}=Ae(),g=Ce();ee(()=>{!i&&g&&X(t.kind,t.slug)},[i,g,t.kind,t.slug,X]);const K=U.filter(e=>!R||e.values.length>0),q=K.filter(e=>e.role==="resolves"),I=K.filter(e=>e.role==="describes"&&!at(Te,e.key)),Y=I.findIndex(e=>e.chosen===null),Q=(!A||!r.vehicleAnswersSpecs||s.fitmentSet)&&Fe(U,R)?Y===-1?I:I.slice(0,Y+1):[],we=[...q,...Q];function Le(){return V?(L(!1),i?null:Be(t,h,be,{choice:v,qty:F},{fitmentLabel:j?r.specCaption:O.appliedName?`For ${O.appliedName}`:"",fitmentKey:j?`manual|${r.specCaption}`:`vehicle|${ht(O.applied?.vehicle)}`})):(L(!0),window.setTimeout(()=>L(!1),ut),null)}const $={kind:"hero",msrpLabel:Se||null,amount:E?Ze(f,x):Je(f,x),unitLabel:f.priced?r.unitLabel:null,packBadge:f.setTotal!=null?`${c.quantityLabel}: ${le(W,x)}`:null,buy:{isSet:E,priced:f.priced,outOfStock:G,canAdd:V,totalLabel:f.setTotal!=null?le(W,x):null,lineToAdd:Le},qty:F,setQty:xe,takesQty:g&&!(E&&!f.priced),save:{slug:t.slug,name:t.name},facts:oe?Ne:null},M=a(H,{value:$,children:a(re,{ownerId:z??"",ownerType:"ProductHero",Template:de,rows:gt,fallback:null,children:e=>e})}),k={nodeId:z??"",template:fe,pressTitles:ue,editing:i},J=Re(null);return ee(()=>{i||J.current===t.slug||(J.current=t.slug,je({itemId:h?`${t.slug}|${h.id}`:t.slug,itemName:t.name,variant:r.metaValue,pricePerSet:f.setTotal??f.fromSetTotal??0,currency:x}))},[i,t.slug,t.name,r.metaValue,h,f,x]),l(u,{children:[a("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:C?void 0:{background:"var(--section-bg)"},children:t.crumbs.map((e,m)=>l("span",{children:[m>0&&l(u,{children:[a("span",{className:"mx-3 text-accent",children:"/"}),a("wbr",{})]}),e.href?a(Z,{href:e.href,className:"hover:text-fg",children:a(P,{text:e.label})}):a("span",{className:"text-fg",children:a(P,{text:e.label})})]},`${e.label}-${m}`))}),l("section",{"data-hero-layout":b,"data-hero-align":B,className:[`grid gap-10 ${ne} 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:{...C?{}:{background:"var(--section-bg)"},...b==="stacked"?{}:{"--hero-cols":ge}},children:[a(Me,{product:t,view:r,angleIdx:ve,onSelect:ke,isLight:C,onLightbox:p,galleryMode:ce,imageFit:me,style:b==="imageRight"?{order:2}:void 0}),l("div",{className:["flex flex-col gap-7",B==="center"?`${st[nt.center]} ${rt.center}`:""].filter(Boolean).join(" "),style:b==="imageRight"?{order:1}:void 0,children:[l("div",{className:"w-full [container-type:inline-size]",children:[l("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(P,{text:t.eyebrow})}),t.badge&&l(u,{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":xt(r.heading)},children:(()=>{const e=r.heading.lastIndexOf(" ");if(e===-1)return r.heading;const m=r.heading.slice(0,e),y=r.heading.slice(e+1);return l(u,{children:[m," ",l("em",{className:"font-normal italic text-accent",children:[y,"."]})]})})()})]}),o!=="belowSpecs"&&w&&M,_e,q.map(e=>a(se,{row:e,onPick:D,options:k},e.key)),R&&r.preOrder?l(u,{children:[o==="belowSpecs"&&w&&M,r.preOrder]}):l(u,{children:[A,Q.map(e=>a(se,{row:e,onPick:D,options:k},e.key)),a(H,{value:$,children:a(ft,{})}),(c.packs.length>0||g&&(c.extra||c.spareCounts.length>0))&&l("div",{className:"border-b border-line pb-[26px]",children:[c.packs.length>0&&l(u,{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(N,{hero:k,values:c.packs,item:e=>({label:e.label}),picked:e=>v.unit===e.value,press:e=>()=>T(m=>({...m,unit:e.value}))})})]}),g&&c.extra&&l("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=>T(m=>({...m,spares:e.target.checked?Qe:0})),className:"h-4 w-4 cursor-pointer accent-[var(--accent)]"}),c.extra.label]}),g&&c.spareCounts.length>0&&l(u,{children:[a("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:ze.howMany}),a("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:flex-wrap",children:a(N,{hero:k,values:c.spareCounts,item:e=>({label:`${e.value} · ${e.label}`}),picked:e=>v.spares===e.value-ae,press:e=>()=>T(m=>({...m,spares:e.value-ae}))})})]}),g&&c.spareSide&&l(u,{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(N,{hero:k,values:c.spareSide.options,item:e=>({label:e.label}),picked:e=>v.spareSide===e.value,press:e=>()=>T(m=>({...m,spareSide:e.value}))})})]})]}),o==="belowSpecs"&&w&&M,a("div",{className:Oe,children:l(H,{value:$,children:[a(pt,{}),a(mt,{}),a(dt,{})]})}),G&&h&&a(kt,{partNumbers:h.components.map(e=>e.partNumber),productSlug:t.slug},h.id),ye&&(()=>{const e=we.filter(y=>y.chosen===null).map(y=>he(y.prompt).replace(/^Select\s+/i,""));if(A&&r.vehicleAnswersSpecs&&!s.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 l("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."]})})()]}),pe]})]})]})}function se({row:t,onPick:s,options:p}){const i=te();if(t.values.length===0&&!t.empty)return null;const o=t.values.find(n=>n.value===t.chosen),d=o&&[o.label,o.note].filter(Boolean).join(" · ");return l("div",{className:"border-b border-line pb-[26px]",[De]:t.key,children:[l("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?l("p",{className:"font-mono text-[length:var(--size-body,12px)] leading-relaxed tracking-[0.1em] text-fg-dim",children:[t.empty.text," ",a(Z,{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(N,{hero:p,values:t.values,item:n=>({swatch:n.swatch??"",name:n.label}),picked:n=>n.value===t.chosen,press:n=>()=>s(t.key,n.value)})}):a("div",{className:"flex flex-wrap gap-1.5",children:a(N,{hero:p,values:t.values,item:n=>({label:n.label,note:n.note??""}),picked:n=>n.value===t.chosen,press:n=>()=>s(t.key,n.value)})})]})}function N({hero:t,values:s,item:p,picked:i,press:o}){const d=ot(s,{item:p,selected:i,press:o});return a(lt,{children:a(re,{ownerId:t.nodeId,ownerType:"ProductHero",slot:ct,Template:t.template,rows:d.items.map(it),items:d.items,states:d.states,actions:t.editing?void 0:d.actions,pressTitles:t.pressTitles,fallback:null,children:n=>n})})}function kt({partNumbers:t,productSlug:s}){const[p,i]=Ee(""),{status:o,submit:d,reset:n}=He();function _(){d({partNumbers:t,email:p,productSlug:s})}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(Ie,{className:"-mt-1",email:p,onEmailChange:i,status:o,onResetVerdict:n,onSubmit:_,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{vt as default};
@@ -15,3 +15,4 @@ export declare function shopperAddressMarkOf(props: Readonly<Record<string, unkn
15
15
  export declare function stampSelectedRanges(data: Data, query: AddressQuery, knownNames: readonly string[]): Data;
16
16
  export declare function stripSelectedRanges(data: Data): Data;
17
17
  export declare function pageReadsSelectedRanges(data: Data | null | undefined): boolean;
18
+ export declare function pageReadsRangeNames(data: Data | null | undefined): boolean;
@@ -1 +1 @@
1
- import{SHOW_FOR_PROP as E,showForOf as O}from"efficient-web-builder/format/lib/content/box-show-for-choices";import{asPlpSortKey as S,plpFilterQuery as A,plpFiltersFromParams as h}from"./plp-filters.js";import{marksCurrentLink as k,menuLayoutOf as L}from"../content/tab-strip.js";import{ALLOY_WHEELS_LISTING_TYPE as x,FILTER_BLOCK_TYPE as D,MENU_BLOCK_TYPE as R,documentNodes as g,mapDocumentNodes as y}from"../document/document-nodes.js";import{documentShopperScopes as F,pageReachFilterOf as T}from"./shopper-first-paint.js";const u="selectedRanges",i="shopperAddress",m="addressQuery",N=[x,R];function P(e){return N.includes(e.type)?e.type===R?k(L(e.props.direction),e.props.currentPage):!0:!1}function I(e){const r=e?.[m];return typeof r=="string"?r:""}function _(e){if(typeof e=="string")return new URLSearchParams(e.replace(/^\?/,""));if(e instanceof URLSearchParams)return e;const r=new URLSearchParams;for(const[s,t]of Object.entries(e))if(typeof t=="string")r.append(s,t);else if(Array.isArray(t))for(const o of t)typeof o=="string"&&r.append(s,o);return r}function U(e,r){const s=new Set(r),t=[];for(const o of h(_(e)).collections)s.has(o)&&!t.includes(o)&&t.push(o);return t}function K(e){const r=e?.[u];if(!r||!Array.isArray(r.selected)||!Array.isArray(r.known))return null;const s=o=>o.filter(n=>typeof n=="string"),t=s(r.known);return{selected:s(r.selected).filter(o=>t.includes(o)),known:t}}function M(e){const r=e?.[i];return!r||typeof r!="object"?null:{writes:r.writes===!0,sort:S(typeof r.sort=="string"?r.sort:void 0)}}function j(e,r,s){const t=[...new Set(s)],o={selected:U(r,t),known:t},n=T(e),c=new Map;if(n){const p=S(typeof n.props?.openingSort=="string"?n.props.openingSort:void 0);c.set(n,{[i]:{writes:!0,sort:p}});for(const[a,w]of F(e))w===n&&c.set(a,{[i]:{writes:!1,sort:p}})}const l=A(_(r));if(l)for(const p of g(e))P(p)&&c.set(p,{...c.get(p),[m]:l});const f=c.size?y(e,(p,a)=>c.has(a)?{...p,props:{...p.props,...c.get(a)}}:p):e,d=f.root??{};return{...f,root:{...d,props:{...d.props??{},[u]:o}}}}function v(e){const r=y(e,n=>{if(!(i in n.props)&&!(m in n.props))return n;const{[i]:c,[m]:l,...f}=n.props;return{...n,props:f}}),s=r.root;if(!s?.props||!(u in s.props))return r;const{[u]:t,...o}=s.props;return{...r,root:{...s,props:o}}}function B(e){return e?g(e).some(r=>r.type===D||P(r)||O(r.props[E])!==void 0):!1}export{u as SELECTED_RANGES_PROP,i as SHOPPER_ADDRESS_PROP,I as addressQueryOf,B as pageReadsSelectedRanges,U as readSelectedRanges,K as selectedRangesOf,M as shopperAddressMarkOf,j as stampSelectedRanges,v as stripSelectedRanges};
1
+ import{SHOW_FOR_PROP as O,showForOf as A}from"efficient-web-builder/format/lib/content/box-show-for-choices";import{asPlpSortKey as S,plpFilterQuery as h,plpFiltersFromParams as k}from"./plp-filters.js";import{marksCurrentLink as L,menuLayoutOf as x}from"../content/tab-strip.js";import{ALLOY_WHEELS_LISTING_TYPE as D,FILTER_BLOCK_TYPE as F,MENU_BLOCK_TYPE as g,documentNodes as R,mapDocumentNodes as y}from"../document/document-nodes.js";import{documentShopperScopes as N,pageReachFilterOf as T}from"./shopper-first-paint.js";const u="selectedRanges",i="shopperAddress",m="addressQuery",U=[D,g];function P(r){return U.includes(r.type)?r.type===g?L(x(r.props.direction),r.props.currentPage):!0:!1}function K(r){const e=r?.[m];return typeof e=="string"?e:""}function _(r){if(typeof r=="string")return new URLSearchParams(r.replace(/^\?/,""));if(r instanceof URLSearchParams)return r;const e=new URLSearchParams;for(const[s,t]of Object.entries(r))if(typeof t=="string")e.append(s,t);else if(Array.isArray(t))for(const o of t)typeof o=="string"&&e.append(s,o);return e}function Y(r,e){const s=new Set(e),t=[];for(const o of k(_(r)).collections)s.has(o)&&!t.includes(o)&&t.push(o);return t}function M(r){const e=r?.[u];if(!e||!Array.isArray(e.selected)||!Array.isArray(e.known))return null;const s=o=>o.filter(n=>typeof n=="string"),t=s(e.known);return{selected:s(e.selected).filter(o=>t.includes(o)),known:t}}function j(r){const e=r?.[i];return!e||typeof e!="object"?null:{writes:e.writes===!0,sort:S(typeof e.sort=="string"?e.sort:void 0)}}function v(r,e,s){const t=[...new Set(s)],o={selected:Y(e,t),known:t},n=T(r),c=new Map;if(n){const p=S(typeof n.props?.openingSort=="string"?n.props.openingSort:void 0);c.set(n,{[i]:{writes:!0,sort:p}});for(const[a,E]of N(r))E===n&&c.set(a,{[i]:{writes:!1,sort:p}})}const l=h(_(e));if(l)for(const p of R(r))P(p)&&c.set(p,{...c.get(p),[m]:l});const f=c.size?y(r,(p,a)=>c.has(a)?{...p,props:{...p.props,...c.get(a)}}:p):r,d=f.root??{};return{...f,root:{...d,props:{...d.props??{},[u]:o}}}}function B(r){const e=y(r,n=>{if(!(i in n.props)&&!(m in n.props))return n;const{[i]:c,[m]:l,...f}=n.props;return{...n,props:f}}),s=e.root;if(!s?.props||!(u in s.props))return e;const{[u]:t,...o}=s.props;return{...e,root:{...s,props:o}}}function w(r){return r.type===F||A(r.props[O])!==void 0}function G(r){return r?R(r).some(e=>w(e)||P(e)):!1}function W(r){return r?R(r).some(w):!1}export{u as SELECTED_RANGES_PROP,i as SHOPPER_ADDRESS_PROP,K as addressQueryOf,W as pageReadsRangeNames,G as pageReadsSelectedRanges,Y as readSelectedRanges,M as selectedRangesOf,j as shopperAddressMarkOf,v as stampSelectedRanges,B as stripSelectedRanges};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-storefront-blocks",
3
- "version": "0.108.0",
3
+ "version": "0.109.0",
4
4
  "description": "The EFFICIENT storefront's website editor — the website builder assembled with the storefront's own sections — for an app that edits a storefront website inside its own page. Built from the efficient-storefront-blocks repository.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Efficient Pty Ltd",
@@ -102,7 +102,7 @@
102
102
  "@stripe/stripe-js": "^9.9.0",
103
103
  "efficient-easel": "^34.3.0",
104
104
  "efficient-shell": "^13.0.0",
105
- "efficient-web-builder": "^68.0.0",
105
+ "efficient-web-builder": "^68.2.0",
106
106
  "next": ">=16",
107
107
  "react": ">=19",
108
108
  "react-dom": ">=19"