efficient-storefront-blocks 0.126.5 → 0.127.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 +13 -0
- package/dist/chunks/{EditorPreviewCheckout-LFT3ZXWA.js → EditorPreviewCheckout-ZKCDEXJB.js} +1 -1
- package/dist/chunks/chunk-IEGDV4YL.js +1 -0
- package/dist/index.js +24 -24
- package/dist/render/components/wheels-plp/PlpNotifyMeDialog.js +1 -1
- package/dist/render/lib/catalog/from-wheel.js +1 -1
- package/dist/render/lib/wheels/set-mode.d.ts +2 -3
- package/dist/render/lib/wheels/set-mode.js +1 -1
- package/dist/render/lib/wheels/variant-spec.d.ts +1 -0
- package/dist/render/lib/wheels/variant-spec.js +1 -1
- package/dist/render/lib/wheels/variants.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/package.json +1 -1
- package/dist/chunks/chunk-WZCQINHM.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useId as y,useRef as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useId as y,useRef as P,useState as m}from"react";import{useCurrency as _}from"../CurrencyContext.js";import{formatPrice as I}from"../../lib/commerce.js";import{withRMark as k}from"efficient-web-builder/render/components/RMark";import E from"../PopupFrame.js";import{useStockAlertSignup as A}from"../useStockAlertSignup.js";import{UNPRICED_LABEL as D,resolveSetPrice as K}from"../../lib/wheels/price-display.js";import{variantOptionLabel as N}from"../../lib/wheels/variant-spec.js";function L({wheelName:p,productSlug:w,finishName:h,variants:i,initialSize:C,onClose:o,editing:z=!1}){const s=y(),f=y(),l=P(null),{currency:u}=_(),n=A(),[M,W]=m(()=>C??i[0]?.size??""),[c,j]=m(""),[x,B]=m(!1),a=i.find(r=>r.size===M)??i[0];if(!a)return null;const R=n.status==="sent",d=n.status==="sending",g=n.status==="invalid"?"Please enter a valid email address.":n.status==="error"?"Couldn't save that — please try again.":null;function S(){a&&n.submit({partNumbers:a.components.map(r=>r.partNumber),email:c,productSlug:w,subscribeToOffers:x,dryRun:z})}return e(E,{site:{blur:6,scroll:!0,focusRef:l,trapRef:l},labelledBy:s,onClose:o,children:t("div",{ref:l,tabIndex:-1,className:"relative w-[420px] max-w-full border-2 border-accent bg-surface text-left shadow-[0_24px_60px_rgba(0,0,0,0.55)] outline-none",children:[e("button",{type:"button",onClick:o,"aria-label":"Close",className:"absolute right-[10px] top-[10px] z-[2] flex h-9 w-9 cursor-pointer items-center justify-center text-fg-dim transition-colors hover:text-accent",children:e("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,children:e("path",{d:"M6 6l12 12M18 6 6 18"})})}),R?t("div",{className:"px-6 py-8 text-center",children:[e("span",{className:"mx-auto mb-4 grid h-16 w-16 place-items-center rounded-full border-[1.5px] border-accent bg-accent/15",children:e("svg",{width:"30",height:"30",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2.5","aria-hidden":!0,children:e("path",{d:"M20 6 9 17l-5-5"})})}),e("h3",{id:s,className:"font-display text-[22px] font-medium uppercase leading-tight tracking-[-0.02em]",children:"You're on the list"}),t("p",{className:"mx-auto mt-2 max-w-[34ch] text-[13px] leading-[1.6] text-fg-dim",children:["We'll alert ",e("strong",{className:"font-normal text-fg",children:c.trim()})," as soon as the ",k(p)," in ",N(a)," is back. Keep an eye on your inbox."]}),e("button",{type:"button",onClick:o,className:"mt-6 w-full cursor-pointer border border-line px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-fg transition-colors hover:border-accent hover:text-accent",children:"Continue browsing"})]}):t("form",{className:"p-6",noValidate:!0,onSubmit:r=>{r.preventDefault(),S()},children:[t("div",{className:"mb-2 flex items-center gap-3",children:[e("span",{className:"grid h-11 w-11 flex-none place-items-center border-[1.5px] border-accent bg-accent/15",children:t("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2","aria-hidden":!0,children:[e("path",{d:"M18 8a6 6 0 1 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"}),e("path",{d:"M13.7 21a2 2 0 0 1-3.4 0"})]})}),t("div",{children:[e("div",{className:"font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:"Back-in-stock alert"}),e("h3",{id:s,className:"mt-0.5 font-display text-[22px] font-medium uppercase leading-tight tracking-[-0.02em]",children:"Notify me"})]})]}),t("p",{className:"mb-5 text-[13px] leading-[1.6] text-fg-dim",children:["We'll email you the moment the"," ",e("strong",{className:"font-normal text-fg",children:k(p)}),h?` in ${h}`:""," ","is back in stock. No spam — one alert, then we're done."]}),t("fieldset",{className:"mb-4 border-0 p-0",children:[e("legend",{className:"mb-2 font-mono text-[10px] uppercase tracking-[0.16em] text-fg-dim",children:"Which fitment?"}),e("div",{className:"flex flex-wrap gap-2",children:i.map(r=>{const b=r.size===a.size;return t("button",{type:"button","aria-pressed":b,onClick:()=>W(r.size),className:["flex min-w-[calc(50%-4px)] flex-1 cursor-pointer flex-col items-start gap-0.5 border-[1.5px] px-3 py-3 text-left transition-colors",b?"border-accent bg-accent/15":"border-line hover:border-accent/60"].join(" "),children:[e("span",{className:"font-mono text-[12px] font-bold tracking-[0.08em] text-fg",children:N(r)}),e("span",{className:"font-mono text-[10px] tracking-[0.08em] text-fg-dim",children:(()=>{const v=K(r.components,u);return v.setTotal!=null?I(v.setTotal,u):D})()})]},r.size)})})]}),t("div",{className:"mb-4",children:[e("label",{htmlFor:f,className:"mb-2 block font-mono text-[10px] uppercase tracking-[0.16em] text-fg-dim",children:"Email address"}),e("input",{id:f,type:"email",value:c,onChange:r=>{j(r.target.value),(n.status==="invalid"||n.status==="error")&&n.reset()},placeholder:"you@example.com",disabled:d,className:"w-full border-2 border-line bg-bg px-4 py-3 font-display text-[15px] text-fg outline-none transition-colors placeholder:text-fg-dim hover:border-fg-dim focus:border-accent disabled:opacity-60"})]}),t("label",{className:"mb-5 flex cursor-pointer items-start gap-3 text-[12px] leading-[1.5] text-fg-dim",children:[e("input",{type:"checkbox",checked:x,onChange:r=>B(r.target.checked),className:"mt-0.5 h-[18px] w-[18px] flex-none cursor-pointer accent-[var(--accent)]"}),e("span",{children:"Also send me fitment tips and occasional offers for my vehicle."})]}),t("button",{type:"submit",disabled:d,className:"flex h-[50px] w-full cursor-pointer items-center justify-center gap-2 bg-btn px-4 font-mono text-[12px] font-bold uppercase tracking-[0.24em] text-btn-ink transition-colors hover:bg-fg disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:bg-btn",children:[t("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,children:[e("path",{d:"m22 2-7 20-4-9-9-4Z"}),e("path",{d:"M22 2 11 13"})]}),d?"Sending…":"Notify me when available"]}),g&&e("p",{role:"alert",className:"mt-3 text-[12px] leading-[1.5]",style:{color:"var(--alert)"},children:g}),t("div",{className:"mt-3 flex items-center justify-center gap-2 text-[11px] text-fg-dim",children:[t("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,children:[e("rect",{x:"3",y:"11",width:"18",height:"11",rx:"1"}),e("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"We never share your details."]})]})]})})}export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{variantsFittingVehicle as B}from"../wheels/plp-fitment-match.js";import{FALLBACK_FINISH as F}from"../wheels/finish-defaults.js";import{variantEtKey as
|
|
1
|
+
import{variantsFittingVehicle as B}from"../wheels/plp-fitment-match.js";import{FALLBACK_FINISH as F}from"../wheels/finish-defaults.js";import{variantEtKey as y,variantSizeGroupKey as V,variantSizeGroupLabel as N,variantSizeGroupNote as I}from"../wheels/variant-spec.js";import{trimDecimal as S}from"../wheels/spec-format.js";import{itemCollections as A}from"./plp-item.js";import{BUILT_IN_LISTING_PATH as g,withListingFilter as D}from"../links/link-rules.js";import{PLP_PARAM as _}from"../wheels/plp-filters.js";import{findVariant as L,isVariantOutOfStock as O}from"../wheels/variants.js";import{HAND_WORDS as T,NOT_HANDED_WORDS as x,variantIsHanded as f}from"../wheels/set-mode.js";const P="handed",k="plain";function G(e){const l=A(e).find(o=>o.trim()!=="");return l?{label:l,href:D(g,{param:_.collections,value:l})}:{label:e.process,href:g}}function q(e){const l=e.variants??[],o=e.finishes.map(t=>({value:t.name,label:t.name,swatch:t.color}));function i(t){const a=[];for(const v of l){const h=t(v);!h||a.some(z=>z.value===h.value)||a.push(h)}return a}const p=i(t=>({value:V(t),label:N(t),note:I(t)})),m=i(t=>t.boltPattern?{value:t.boltPattern,label:t.boltPattern}:null),b=i(t=>{const a=y(t);return a===null?null:{value:a,label:`ET ${a}`}}),n=i(t=>t.centreBore==null?null:{value:S(t.centreBore),label:`${S(t.centreBore)} mm`}),s=l.some(f)&&!l.every(f),r=s?i(t=>({value:f(t)?P:k,label:f(t)?T:x})):[],c=l.map(t=>({id:`${t.finishName}|${t.size}`,options:{finish:t.finishName,size:V(t),variantSize:t.size,...t.boltPattern?{boltPattern:t.boltPattern}:{},...y(t)!==null?{et:y(t)}:{},...t.centreBore==null?{}:{centreBore:S(t.centreBore)},...s?{pairing:f(t)?P:k}:{}},inStock:!O(t),image:null,components:t.components})),u=((e.defaultFinish?o.find(t=>t.value===e.defaultFinish):void 0)??o[0])?.value;return{kind:"alloy-wheel",source:e,slug:e.slug,name:e.name,eyebrow:e.process,badge:e.badge==="new"?"New 2026":e.badge?"Bestseller":"",href:`/wheels/${e.slug}`,crumbs:[{label:"Home",href:"/"},{label:"Wheels",href:"/wheels"},G(e),{label:e.name}],cover:e.coverImage??null,inStock:e.inStock===!0,mediaGroups:e.mediaGroups,optionFields:[{key:"finish",label:"Finish",prompt:"Select a finish",role:"resolves",display:"swatch",defaultValue:u},{key:"size",label:"Size",prompt:"Select a size",role:"resolves",display:"pill",empty:{text:"This wheel isn't available to order online in this finish.",linkText:"Contact us about it →",href:"/contact"}},{key:"boltPattern",label:"Bolt pattern",prompt:"Select a bolt pattern",role:"describes",display:"pill"},{key:"et",label:"Offset",prompt:"Select an offset",role:"describes",display:"pill"},{key:"centreBore",label:"Centre bore",prompt:"Select a centre bore",role:"describes",display:"pill"},{key:"pairing",label:"Wheels",prompt:"Select a pairing",role:"describes",display:"pill"}],optionValues:{finish:o,size:p,boltPattern:m,et:b,centreBore:n,pairing:r},parts:c,anchorPrices:e.prices,anchorMsrpPrices:e.msrpPrices??{}}}function J(e,l){if(e.kind!=="alloy-wheel"||l===null)return e;const o=new Set(B(e.source.variants??[],l));if(o.size===0)return e;const i=e.parts.filter(n=>{const s=H(e.source,n);return s!==null&&o.has(s)});if(i.length===0||i.length===e.parts.length)return e;const p=(n,s)=>new Set(n.map(r=>r.options[s]).filter(r=>r!==void 0)),m={},b=[];for(const n of e.optionFields){const s=p(e.parts,n.key),r=p(i,n.key),c=(e.optionValues[n.key]??[]).filter(u=>r.has(u.value)||!s.has(u.value));m[n.key]=c;const d=n.defaultValue!==void 0&&!c.some(u=>u.value===n.defaultValue)?c[0]?.value:n.defaultValue;b.push(d===n.defaultValue?n:{...n,defaultValue:d})}return{...e,optionFields:b,optionValues:m,parts:i}}function H(e,l){return l?L(e.variants??[],l.options.finish,l.options.variantSize)??null:null}function Q(e,l){return e.finishes.find(o=>o.name===l)??e.finishes[0]??F}export{q as fromWheel,H as partVariant,Q as wheelFinish,J as wheelForVehicle};
|
|
@@ -9,9 +9,8 @@ export interface WheelSetBuild {
|
|
|
9
9
|
}
|
|
10
10
|
export declare const TWO_OBJECT_ET_SPREAD_MM = 150;
|
|
11
11
|
export declare const AXLE_WORDS = "Front + rear";
|
|
12
|
-
export declare const HAND_WORDS = "
|
|
13
|
-
export declare const NOT_HANDED_WORDS = "
|
|
14
|
-
export declare const CARD_HAND_WORDS = "L/R";
|
|
12
|
+
export declare const HAND_WORDS = "Directional pair";
|
|
13
|
+
export declare const NOT_HANDED_WORDS = "Standard";
|
|
15
14
|
export declare function variantEtSpread(variant: WheelVariant): number;
|
|
16
15
|
export declare function variantIsTwoObjects(variant: WheelVariant): boolean;
|
|
17
16
|
export declare function productIsTwoObjects(product: StoreProduct): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as
|
|
1
|
+
import{parseOption as s}from"efficient-shell/format";import{WHEELS_PER_SET as r}from"../commerce.js";function a(e){return(e.components??[]).reduce((o,u)=>o+u.wheels,0)>r}function m(e){return e.kind==="alloy-wheel"&&(e.source.variants??[]).some(a)}const c=150,i="Front + rear",O="Directional pair",T="Standard";function l(e){return e.et==null||e.rearEt==null?0:Math.abs(e.rearEt-e.et)}function n(e){return l(e)>=c}function D(e){return e.kind==="alloy-wheel"&&(e.source.variants??[]).some(n)}function p(e){return e.directional===!0}function d(e){return e.kind==="staggered"}function I(e){return e.rearWidth!=null||e.rearEt!=null&&e.rearEt!==e.et}function P(e){return{twoObjects:n(e),handed:p(e),staggered:d(e)}}function b(e){return{twoObjects:E(e),handed:e.handed??!1,staggered:!1}}function g(e){return e.twoObjects?i:null}function W(e){return e.handed}function x(e){return new Set((e.components??[]).map(t=>t.partNumber)).size>1}function H(e){return e.kind==="alloy-wheel"&&(e.source.variants??[]).some(x)}function E(e){return(e.setWheelCount??0)>r}const S=new Set(["boltPattern"]);function y(e,t){return e&&S.has(t)}function C(e,t){return!e?.srcRight||!t||t!==e.src?null:e.srcRight}const f="per wheel";function L(e,t){return t?`${e} ${f}`:e}const _=[{label:"Pair",value:"pair"},{label:"One wheel",value:"one"}],h="pair";function N(e){return s(_,h,e)}export{i as AXLE_WORDS,O as HAND_WORDS,T as NOT_HANDED_WORDS,f as PER_WHEEL_UNIT,h as SET_PICTURE_DEFAULT,_ as SET_PICTURE_POINTS,c as TWO_OBJECT_ET_SPREAD_MM,N as parseSetPicture,H as productHasComposedRender,m as productIsDually,D as productIsTwoObjects,g as setBuildLabel,W as setIsWide,C as setSecondSrc,y as setSuppressesRow,E as summaryIsDually,b as summarySetBuild,l as variantEtSpread,x as variantHasComposedRender,I as variantHasDistinctRear,a as variantIsDually,p as variantIsHanded,d as variantIsStaggered,n as variantIsTwoObjects,P as variantSetBuild,L as wheelCardPriceLine};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { WheelVariant } from "../api/index.js";
|
|
2
2
|
export declare function variantSizeLabel(variant: WheelVariant): string;
|
|
3
3
|
export declare function variantFitmentLabel(variant: WheelVariant): string;
|
|
4
|
+
export declare function variantOptionLabel(variant: WheelVariant): string;
|
|
4
5
|
export declare function variantEtKey(variant: WheelVariant): string | null;
|
|
5
6
|
export declare function variantSizeGroupKey(variant: WheelVariant): string;
|
|
6
7
|
export declare function variantSizeGroupLabel(variant: WheelVariant): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{trimDecimal as
|
|
1
|
+
import{trimDecimal as l,wheelSizeLabel as i}from"./spec-format.js";import{variantHasDistinctRear as n}from"./set-mode.js";function o(e){return e.diameter==null||e.width==null?e.size:i(e.diameter,e.width,e.rearWidth)}function d(e){const r=[];e.boltPattern&&r.push(e.boltPattern),e.centreBore!=null&&r.push(`${l(e.centreBore)} bore`);const t=f(e);return t!==null&&r.push(`ET ${t}`),r.join(" · ")}function c(e){return[o(e),d(e)].filter(Boolean).join(" · ")}function f(e){return e.et==null?null:e.rearEt!=null&&e.rearEt!==e.et?`${e.et}/${e.rearEt}`:String(e.et)}function s(e){return e.diameter==null||e.width==null?JSON.stringify([e.size]):JSON.stringify([e.kind,e.diameter,e.width,e.rearWidth??null])}function m(e){return e.diameter==null||e.width==null?e.size:`${e.diameter}" ${e.kind}`}function $(e){return e.diameter==null||e.width==null?"":e.rearWidth!=null?`${l(e.width)} front / ${l(e.rearWidth)} rear`:`${l(e.width)} all round`}function w(e){if(e.diameter==null||e.width==null)return e.size;const r=(t,u)=>`${e.diameter} × ${l(t)}${u!=null?` ET ${u}`:""}`;return n(e)?`${r(e.width,e.et)} front · ${r(e.rearWidth??e.width,e.rearEt)} rear`:r(e.width,e.et)}function b(e,r){return r?e.filter(t=>t.finishName===r):[]}export{f as variantEtKey,d as variantFitmentLabel,c as variantOptionLabel,s as variantSizeGroupKey,m as variantSizeGroupLabel,$ as variantSizeGroupNote,o as variantSizeLabel,w as variantSpecLabel,b as variantsForFinish};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{WHEELS_PER_SET as s}from"../commerce.js";
|
|
1
|
+
import{WHEELS_PER_SET as s}from"../commerce.js";const f="dually";function d(e){const t=e.components.reduce((r,o)=>r+o.wheels,0)||s,n=e.kind,i=[n==="staggered"?"Staggered":n===f?"Dually":""].filter(Boolean);return i.length?`${i.join(" ")} set of ${t}`:`Set of ${t}`}function c(e,t){return[...new Set(e.filter(n=>!t||n.finishName===t).map(n=>n.size))]}function a(e,t,n){if(!(!t||!n))return e.find(i=>i.finishName===t&&i.size===n)}function u(e){return e!=null&&e.inStock===!1}function p(e,t){return t?e.filter(n=>n.finishName===t&&u(n)):[]}function g(e,t,n){return t.findIndex((i,r)=>n[r]!==!1&&c(e,i).length>0)}function h(e){const t=new Set((e.sizePairs??[]).map(r=>`${r.diameter}x${r.width}`)),n=e.spec?.pcds??[],i=e.spec?.etRange??[];return t.size===1&&n.length<=1&&(i.length===0||i[0]===i[i.length-1])}export{a as findVariant,g as firstSellableFinishIndex,h as isOneWheelDesign,u as isVariantOutOfStock,p as outOfStockVariantsForFinish,d as setLabel,c as sizesForFinish};
|