efficient-storefront-blocks 0.126.5 → 0.128.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/chunks/{EditorPreviewCheckout-LFT3ZXWA.js → EditorPreviewCheckout-ZKCDEXJB.js} +1 -1
  3. package/dist/chunks/chunk-IEGDV4YL.js +1 -0
  4. package/dist/editor/lib/document/blocks/commerce/ProductPicture/fields.js +1 -1
  5. package/dist/editor/lib/storefront-editor-words.d.ts +1 -4
  6. package/dist/editor/lib/storefront-editor-words.js +1 -1
  7. package/dist/index.js +27 -27
  8. package/dist/render/app/globals.css +1 -1
  9. package/dist/render/components/GridCardTemplate.d.ts +1 -3
  10. package/dist/render/components/GridCardTemplate.js +1 -1
  11. package/dist/render/components/ProductCard.js +1 -1
  12. package/dist/render/components/ProductCardEyebrow.d.ts +0 -1
  13. package/dist/render/components/ProductCardEyebrow.js +1 -1
  14. package/dist/render/components/ProductGridSection.js +1 -1
  15. package/dist/render/components/WheelCardFrame.d.ts +2 -4
  16. package/dist/render/components/WheelCardFrame.js +1 -1
  17. package/dist/render/components/card-pieces/CardPicture.d.ts +1 -12
  18. package/dist/render/components/card-pieces/CardPicture.js +1 -1
  19. package/dist/render/components/card-pieces/CardPrice.d.ts +0 -1
  20. package/dist/render/components/card-pieces/CardPrice.js +1 -1
  21. package/dist/render/components/card-pieces/CardProductBadge.js +1 -1
  22. package/dist/render/components/card-pieces/CardProductPicture.d.ts +0 -1
  23. package/dist/render/components/card-pieces/CardProductPicture.js +1 -1
  24. package/dist/render/components/card-pieces/CardSurfaceFrame.d.ts +1 -2
  25. package/dist/render/components/card-pieces/CardSurfaceFrame.js +1 -1
  26. package/dist/render/components/card-pieces/ProductCardState.d.ts +0 -1
  27. package/dist/render/components/card-pieces/ProductCardState.js +1 -1
  28. package/dist/render/components/card-pieces/useHeldCardPicture.d.ts +1 -3
  29. package/dist/render/components/card-pieces/useHeldCardPicture.js +1 -1
  30. package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
  31. package/dist/render/components/wheels-plp/PlpNotifyMeDialog.js +1 -1
  32. package/dist/render/lib/catalog/from-wheel.js +1 -1
  33. package/dist/render/lib/document/blocks/commerce/ProductPicture/render.js +1 -1
  34. package/dist/render/lib/document/blocks/commerce/ProductPrice/render.js +1 -1
  35. package/dist/render/lib/sections/fill-row.d.ts +1 -9
  36. package/dist/render/lib/sections/fill-row.js +1 -1
  37. package/dist/render/lib/wheels/set-mode.d.ts +2 -18
  38. package/dist/render/lib/wheels/set-mode.js +1 -1
  39. package/dist/render/lib/wheels/variant-spec.d.ts +1 -0
  40. package/dist/render/lib/wheels/variant-spec.js +1 -1
  41. package/dist/render/lib/wheels/variants.js +1 -1
  42. package/dist/routine-index.json +1 -1
  43. package/dist/value-index.json +1 -1
  44. package/dist/words.d.ts +1 -4
  45. package/dist/words.js +1 -1
  46. package/package.json +1 -1
  47. package/dist/chunks/chunk-WZCQINHM.js +0 -1
  48. package/dist/render/lib/sections/grid-no-hole.d.ts +0 -17
  49. package/dist/render/lib/sections/grid-no-hole.js +0 -1
@@ -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 S,variantSizeGroupKey as V,variantSizeGroupLabel as N,variantSizeGroupNote as I}from"../wheels/variant-spec.js";import{trimDecimal as y}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 H,isVariantOutOfStock as L}from"../wheels/variants.js";import{HAND_WORDS as O,NOT_HANDED_WORDS as T,variantIsHanded as b}from"../wheels/set-mode.js";const P="handed",k="plain";function x(e){const n=A(e).find(o=>o.trim()!=="");return n?{label:n,href:D(g,{param:_.collections,value:n})}:{label:e.process,href:g}}function q(e){const n=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 n){const h=t(v);!h||a.some(z=>z.value===h.value)||a.push(h)}return a}const f=i(t=>({value:V(t),label:N(t),note:I(t)})),p=i(t=>t.boltPattern?{value:t.boltPattern,label:t.boltPattern}:null),m=i(t=>{const a=S(t);return a===null?null:{value:a,label:`ET ${a}`}}),l=i(t=>t.centreBore==null?null:{value:y(t.centreBore),label:`${y(t.centreBore)} mm`}),s=n.some(b),r=s?i(t=>({value:b(t)?P:k,label:b(t)?O:T})):[],c=n.map(t=>({id:`${t.finishName}|${t.size}`,options:{finish:t.finishName,size:V(t),variantSize:t.size,...t.boltPattern?{boltPattern:t.boltPattern}:{},...S(t)!==null?{et:S(t)}:{},...t.centreBore==null?{}:{centreBore:y(t.centreBore)},...s?{pairing:b(t)?P:k}:{}},inStock:!L(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"},x(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:f,boltPattern:p,et:m,centreBore:l,pairing:r},parts:c,anchorPrices:e.prices,anchorMsrpPrices:e.msrpPrices??{}}}function J(e,n){if(e.kind!=="alloy-wheel"||n===null)return e;const o=new Set(B(e.source.variants??[],n));if(o.size===0)return e;const i=e.parts.filter(l=>{const s=G(e.source,l);return s!==null&&o.has(s)});if(i.length===0||i.length===e.parts.length)return e;const f=(l,s)=>new Set(l.map(r=>r.options[s]).filter(r=>r!==void 0)),p={},m=[];for(const l of e.optionFields){const s=f(e.parts,l.key),r=f(i,l.key),c=(e.optionValues[l.key]??[]).filter(u=>r.has(u.value)||!s.has(u.value));p[l.key]=c;const d=l.defaultValue!==void 0&&!c.some(u=>u.value===l.defaultValue)?c[0]?.value:l.defaultValue;m.push(d===l.defaultValue?l:{...l,defaultValue:d})}return{...e,optionFields:m,optionValues:p,parts:i}}function G(e,n){return n?H(e.variants??[],n.options.finish,n.options.variantSize)??null:null}function Q(e,n){return e.finishes.find(o=>o.name===n)??e.finishes[0]??F}export{q as fromWheel,G as partVariant,Q as wheelFinish,J as wheelForVehicle};
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};
@@ -1 +1 @@
1
- import{jsx as a}from"react/jsx-runtime";import t from"../../../../../components/card-pieces/CardProductPicture.js";import r from"../../../../../components/card-pieces/HostPart.js";import{ProductPictureMeta as d}from"./meta.js";const g={...d,render:e=>a(r,{label:d.label??"",editing:!!e.editor?.isEditing,children:a(t,{imageBackground:e.imageBackground,cardImage:e.cardImage,coverIndex:e.coverIndex,indexBadge:e.indexBadge,showBadge:e.showBadge,setFlags:e.setFlags,frame:e.frame,setPicture:e.setPicture,swatch:e.swatch,shadow:e.shadow,shadowColor:e.shadowColor,shadowOn:e.shadowOn})})};export{g as ProductPictureRender};
1
+ import{jsx as a}from"react/jsx-runtime";import o from"../../../../../components/card-pieces/CardProductPicture.js";import t from"../../../../../components/card-pieces/HostPart.js";import{ProductPictureMeta as d}from"./meta.js";const g={...d,render:e=>a(t,{label:d.label??"",editing:!!e.editor?.isEditing,children:a(o,{imageBackground:e.imageBackground,cardImage:e.cardImage,coverIndex:e.coverIndex,indexBadge:e.indexBadge,showBadge:e.showBadge,setFlags:e.setFlags,frame:e.frame,swatch:e.swatch,shadow:e.shadow,shadowColor:e.shadowColor,shadowOn:e.shadowOn})})};export{g as ProductPictureRender};
@@ -1 +1 @@
1
- import{jsx as r,Fragment as d}from"react/jsx-runtime";import a,{PRICE_WORDS as l}from"../../../../../components/card-pieces/CardPrice.js";import{useGridCard as i}from"../../../../../components/GridCardTemplate.js";import s from"../../../../../components/card-pieces/HostPart.js";import{readPartStyles as c}from"efficient-web-builder/render/lib/document/part-styles";import{HideTaker as m}from"efficient-web-builder/render/components/ViewHideRoot";import{ProductPriceMeta as n}from"./meta.js";function u({children:e}){return i().ownerId?r(m,{children:e}):r(d,{children:e})}function f({region:e,priceWord:o}){const{rules:t}=i();return r(a,{quoteSets:t.quoteSets,setTotal:t.setTotal,wasFollowsSize:t.wasFollowsSize,priceWord:o,region:e})}const W={...n,render:e=>{const o=!!e.editor?.isEditing;return r(s,{label:n.label??"",editing:o,onHero:!0,children:r(u,{children:r(f,{priceWord:l.find(t=>t===e.priceWord),region:{nodeId:typeof e.id=="string"?e.id:void 0,partStyles:c(e),editing:o}})})})}};export{W as ProductPriceRender};
1
+ import{jsx as e,Fragment as d}from"react/jsx-runtime";import a,{PRICE_WORDS as l}from"../../../../../components/card-pieces/CardPrice.js";import{useGridCard as t}from"../../../../../components/GridCardTemplate.js";import c from"../../../../../components/card-pieces/HostPart.js";import{readPartStyles as m}from"efficient-web-builder/render/lib/document/part-styles";import{HideTaker as s}from"efficient-web-builder/render/components/ViewHideRoot";import{ProductPriceMeta as n}from"./meta.js";function f({children:r}){return t().ownerId?e(s,{children:r}):e(d,{children:r})}function u({region:r,priceWord:o}){const{rules:i}=t();return e(a,{setTotal:i.setTotal,wasFollowsSize:i.wasFollowsSize,priceWord:o,region:r})}const W={...n,render:r=>{const o=!!r.editor?.isEditing;return e(c,{label:n.label??"",editing:o,onHero:!0,children:e(f,{children:e(u,{priceWord:l.find(i=>i===r.priceWord),region:{nodeId:typeof r.id=="string"?r.id:void 0,partStyles:m(r),editing:o}})})})}};export{W as ProductPriceRender};
@@ -10,18 +10,10 @@ export declare function gridColumnsOf(gridClass: string): GridColumns;
10
10
  export declare function fillRowColumns(columns: number, cards: number): number;
11
11
  export declare function fillRow(grid: GridColumns, cards: number): GridColumns;
12
12
  export declare const CARD_TRACKS_CLASS = "sf-card-tracks";
13
- export declare const hasCardTracks: (gridClass: string) => boolean;
14
- export declare const gridTracks: (n: number, cardTracks?: boolean) => string;
15
13
  export interface FillRowCards {
16
14
  limit?: number;
17
15
  cards?: number;
18
16
  }
19
17
  export declare function fillRowCss(cls: string, gridClass: string, cards?: FillRowCards): string;
20
18
  export declare function centerRowCss(cls: string, gridClass: string, cards?: FillRowCards): string;
21
- export interface GridBand {
22
- min?: number;
23
- max?: number;
24
- columns: number;
25
- }
26
- export declare function gridBands({ base, steps }: GridColumns): GridBand[];
27
- export declare function inBand(band: GridBand, rules: readonly string[]): string;
19
+ export declare function hiddenCardsRule(cls: string, from: number): string;
@@ -1 +1 @@
1
- import{breakpointOf as x}from"efficient-web-builder/format/lib/content/view-lines";function $(n){const o=/(?:^|\s)grid-cols-(\d+)(?=\s|$)/.exec(n);if(!o)throw new Error(`gridColumnsOf: no base grid-cols-N in "${n}"`);const e=[...n.matchAll(/(?:^|\s)(max-[\w[\]-]+):grid-cols-(\d+)(?=\s|$)/g)].flatMap(t=>{const r=x(t[1]);return r?.max?[{below:r.px,columns:Number(t[2])}]:[]}).sort((t,r)=>r.below-t.below);return{base:Number(o[1]),steps:e}}function f(n,o){return Math.max(1,Math.min(n,Math.floor(o)))}function M(n,o){return{base:f(n.base,o),steps:n.steps.map(e=>({below:e.below,columns:f(e.columns,o)}))}}const h="sf-card-tracks",w=n=>n.split(/\s+/).includes(h),b=(n,o=!1)=>o?`--sf-cols:${n}`:`grid-template-columns:repeat(${n},minmax(0,1fr))`;function T(n,o,e={}){const t=w(o);return p(n,o,e,(r,i,u)=>[`${r}{${b(u,t)}}`])}function p(n,o,{limit:e,cards:t},r){const i=$(o),u=typeof e=="number"&&e>0?e:void 0,d=Math.max(i.base,...i.steps.map(s=>s.columns));if(t!==void 0&&Math.min(t,u??1/0)>=d)return"";const a=[];for(const s of R(i)){const m=u===void 0?s.columns:f(s.columns,u),l=[];m<s.columns&&l.push(...r(`.${n}.${n}`,s.columns,m));for(let c=m-1;c>=1;c--)l.push(...r(`.${n}:not(:has(> :nth-child(${c+1})))`,s.columns,c));a.push(k(s,l))}return a.join("")}function g(n,o,e){return[`${n}{grid-template-columns:repeat(${2*o},minmax(0,1fr))}`,`${n}>*{grid-column:span 2}`,`${n}>:first-child{grid-column:${o-e+1}/span 2}`]}function A(n,o,e={}){return p(n,o,e,g)}function R({base:n,steps:o}){return[{min:o[0]?.below,max:void 0,columns:n},...o.map((e,t)=>({min:o[t+1]?.below,max:e.below,columns:e.columns}))]}function k(n,o){if(o.length===0)return"";const e=n.min!==void 0&&n.max!==void 0?`(${n.min}px <= width < ${n.max}px)`:n.max!==void 0?`(width < ${n.max}px)`:n.min!==void 0?`(width >= ${n.min}px)`:void 0;return e?`@media ${e}{${o.join("")}}`:o.join("")}export{h as CARD_TRACKS_CLASS,A as centerRowCss,M as fillRow,f as fillRowColumns,T as fillRowCss,R as gridBands,$ as gridColumnsOf,b as gridTracks,w as hasCardTracks,k as inBand};
1
+ import{breakpointOf as x}from"efficient-web-builder/format/lib/content/view-lines";function $(n){const o=/(?:^|\s)grid-cols-(\d+)(?=\s|$)/.exec(n);if(!o)throw new Error(`gridColumnsOf: no base grid-cols-N in "${n}"`);const t=[...n.matchAll(/(?:^|\s)(max-[\w[\]-]+):grid-cols-(\d+)(?=\s|$)/g)].flatMap(e=>{const r=x(e[1]);return r?.max?[{below:r.px,columns:Number(e[2])}]:[]}).sort((e,r)=>r.below-e.below);return{base:Number(o[1]),steps:t}}function f(n,o){return Math.max(1,Math.min(n,Math.floor(o)))}function M(n,o){return{base:f(n.base,o),steps:n.steps.map(t=>({below:t.below,columns:f(t.columns,o)}))}}const h="sf-card-tracks",w=n=>n.split(/\s+/).includes(h),b=(n,o=!1)=>o?`--sf-cols:${n}`:`grid-template-columns:repeat(${n},minmax(0,1fr))`;function T(n,o,t={}){const e=w(o);return d(n,o,t,(r,u,i)=>[`${r}{${b(i,e)}}`])}function d(n,o,{limit:t,cards:e},r){const u=$(o),i=typeof t=="number"&&t>0?t:void 0,p=Math.max(u.base,...u.steps.map(s=>s.columns));if(e!==void 0&&Math.min(e,i??1/0)>=p)return"";const a=[];for(const s of R(u)){const m=i===void 0?s.columns:f(s.columns,i),l=[];m<s.columns&&l.push(...r(`.${n}.${n}`,s.columns,m));for(let c=m-1;c>=1;c--)l.push(...r(`.${n}:not(:has(> :nth-child(${c+1})))`,s.columns,c));a.push(k(s,l))}return a.join("")}function g(n,o,t){return[`${n}{grid-template-columns:repeat(${2*o},minmax(0,1fr))}`,`${n}>*{grid-column:span 2}`,`${n}>:first-child{grid-column:${o-t+1}/span 2}`]}function y(n,o,t={}){return d(n,o,t,g)}function R({base:n,steps:o}){return[{min:o[0]?.below,max:void 0,columns:n},...o.map((t,e)=>({min:o[e+1]?.below,max:t.below,columns:t.columns}))]}function k(n,o){if(o.length===0)return"";const t=n.min!==void 0&&n.max!==void 0?`(${n.min}px <= width < ${n.max}px)`:n.max!==void 0?`(width < ${n.max}px)`:n.min!==void 0?`(width >= ${n.min}px)`:void 0;return t?`@media ${t}{${o.join("")}}`:o.join("")}function A(n,o){return`.${n} > *:nth-child(n+${o}){display:none!important}`}export{h as CARD_TRACKS_CLASS,y as centerRowCss,M as fillRow,f as fillRowColumns,T as fillRowCss,$ as gridColumnsOf,A as hiddenCardsRule};
@@ -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 = "L/R pair";
13
- export declare const NOT_HANDED_WORDS = "Not handed";
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;
@@ -21,24 +20,9 @@ export declare function variantHasDistinctRear(variant: WheelVariant): boolean;
21
20
  export declare function variantSetBuild(variant: WheelVariant): WheelSetBuild;
22
21
  export declare function summarySetBuild(summary: WheelSummary): WheelSetBuild;
23
22
  export declare function setBuildLabel(build: WheelSetBuild): string | null;
24
- export declare function setIsWide(build: WheelSetBuild): boolean;
25
23
  export declare function variantHasComposedRender(variant: WheelVariant): boolean;
26
24
  export declare function productHasComposedRender(product: StoreProduct): boolean;
27
25
  export declare function summaryIsDually(summary: WheelSummary): boolean;
28
26
  export declare function setSuppressesRow(isTwoObjects: boolean, key: string): boolean;
29
- export declare function setSecondSrc(finish: {
30
- src?: string;
31
- srcRight?: string;
32
- } | null | undefined, painted: string | null): string | null;
33
27
  export declare const PER_WHEEL_UNIT = "per wheel";
34
28
  export declare function wheelCardPriceLine(label: string, priced: boolean): string;
35
- export declare const SET_PICTURE_POINTS: readonly [{
36
- readonly label: "Pair";
37
- readonly value: "pair";
38
- }, {
39
- readonly label: "One wheel";
40
- readonly value: "one";
41
- }];
42
- export type SetPicture = (typeof SET_PICTURE_POINTS)[number]["value"];
43
- export declare const SET_PICTURE_DEFAULT: SetPicture;
44
- export declare function parseSetPicture(raw: unknown): SetPicture;
@@ -1 +1 @@
1
- import{parseOption as u}from"efficient-shell/format";import{WHEELS_PER_SET as r}from"../commerce.js";function a(e){return(e.components??[]).reduce((o,s)=>o+s.wheels,0)>r}function O(e){return e.kind==="alloy-wheel"&&(e.source.variants??[]).some(a)}const c=150,l="Front + rear",m="L/R pair",T="Not handed",i="L/R";function p(e){return e.et==null||e.rearEt==null?0:Math.abs(e.rearEt-e.et)}function n(e){return p(e)>=c}function I(e){return e.kind==="alloy-wheel"&&(e.source.variants??[]).some(n)}function d(e){return e.directional===!0}function x(e){return e.kind==="staggered"}function P(e){return e.rearWidth!=null||e.rearEt!=null&&e.rearEt!==e.et}function g(e){return{twoObjects:n(e),handed:d(e),staggered:x(e)}}function W(e){return{twoObjects:S(e),handed:e.handed??!1,staggered:!1}}function b(e){const t=[e.twoObjects?l:"",e.handed?i:""].filter(Boolean);return t.length?t.join(" · "):null}function H(e){return e.handed}function E(e){return new Set((e.components??[]).map(t=>t.partNumber)).size>1}function C(e){return e.kind==="alloy-wheel"&&(e.source.variants??[]).some(E)}function S(e){return(e.setWheelCount??0)>r}const f=new Set(["boltPattern"]);function L(e,t){return e&&f.has(t)}function N(e,t){return!e?.srcRight||!t||t!==e.src?null:e.srcRight}const _="per wheel";function y(e,t){return t?`${e} ${_}`:e}const h=[{label:"Pair",value:"pair"},{label:"One wheel",value:"one"}],R="pair";function A(e){return u(h,R,e)}export{l as AXLE_WORDS,i as CARD_HAND_WORDS,m as HAND_WORDS,T as NOT_HANDED_WORDS,_ as PER_WHEEL_UNIT,R as SET_PICTURE_DEFAULT,h as SET_PICTURE_POINTS,c as TWO_OBJECT_ET_SPREAD_MM,A as parseSetPicture,C as productHasComposedRender,O as productIsDually,I as productIsTwoObjects,b as setBuildLabel,H as setIsWide,N as setSecondSrc,L as setSuppressesRow,S as summaryIsDually,W as summarySetBuild,p as variantEtSpread,E as variantHasComposedRender,P as variantHasDistinctRear,a as variantIsDually,d as variantIsHanded,x as variantIsStaggered,n as variantIsTwoObjects,g as variantSetBuild,y as wheelCardPriceLine};
1
+ import{WHEELS_PER_SET as r}from"../commerce.js";function u(e){return(e.components??[]).reduce((o,s)=>o+s.wheels,0)>r}function w(e){return e.kind==="alloy-wheel"&&(e.source.variants??[]).some(u)}const a=150,i="Front + rear",h="Directional pair",_="Standard";function c(e){return e.et==null||e.rearEt==null?0:Math.abs(e.rearEt-e.et)}function n(e){return c(e)>=a}function m(e){return e.kind==="alloy-wheel"&&(e.source.variants??[]).some(n)}function l(e){return e.directional===!0}function p(e){return e.kind==="staggered"}function D(e){return e.rearWidth!=null||e.rearEt!=null&&e.rearEt!==e.et}function O(e){return{twoObjects:n(e),handed:l(e),staggered:p(e)}}function R(e){return{twoObjects:x(e),handed:e.handed??!1,staggered:!1}}function T(e){return e.twoObjects?i:null}function d(e){return new Set((e.components??[]).map(t=>t.partNumber)).size>1}function W(e){return e.kind==="alloy-wheel"&&(e.source.variants??[]).some(d)}function x(e){return(e.setWheelCount??0)>r}const E=new Set(["boltPattern"]);function b(e,t){return e&&E.has(t)}const f="per wheel";function g(e,t){return t?`${e} ${f}`:e}export{i as AXLE_WORDS,h as HAND_WORDS,_ as NOT_HANDED_WORDS,f as PER_WHEEL_UNIT,a as TWO_OBJECT_ET_SPREAD_MM,W as productHasComposedRender,w as productIsDually,m as productIsTwoObjects,T as setBuildLabel,b as setSuppressesRow,x as summaryIsDually,R as summarySetBuild,c as variantEtSpread,d as variantHasComposedRender,D as variantHasDistinctRear,u as variantIsDually,l as variantIsHanded,p as variantIsStaggered,n as variantIsTwoObjects,O as variantSetBuild,g 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 u,wheelSizeLabel as i}from"./spec-format.js";import{variantHasDistinctRear as o}from"./set-mode.js";function h(e){return e.diameter==null||e.width==null?e.size:i(e.diameter,e.width,e.rearWidth)}function p(e){const r=[];e.boltPattern&&r.push(e.boltPattern),e.centreBore!=null&&r.push(`${u(e.centreBore)} bore`);const t=n(e);return t!==null&&r.push(`ET ${t}`),e.directional&&r.push("L/R pair"),r.join(" · ")}function n(e){return e.et==null?null:e.rearEt!=null&&e.rearEt!==e.et?`${e.et}/${e.rearEt}`:String(e.et)}function c(e){return e.diameter==null||e.width==null?JSON.stringify([e.size]):JSON.stringify([e.kind,e.diameter,e.width,e.rearWidth??null])}function s(e){return e.diameter==null||e.width==null?e.size:`${e.diameter}" ${e.kind}`}function m(e){return e.diameter==null||e.width==null?"":e.rearWidth!=null?`${u(e.width)} front / ${u(e.rearWidth)} rear`:`${u(e.width)} all round`}function $(e){if(e.diameter==null||e.width==null)return e.size;const r=(t,l)=>`${e.diameter} × ${u(t)}${l!=null?` ET ${l}`:""}`;return o(e)?`${r(e.width,e.et)} front · ${r(e.rearWidth??e.width,e.rearEt)} rear`:r(e.width,e.et)}function w(e,r){return r?e.filter(t=>t.finishName===r):[]}export{n as variantEtKey,p as variantFitmentLabel,c as variantSizeGroupKey,s as variantSizeGroupLabel,m as variantSizeGroupNote,h as variantSizeLabel,$ as variantSpecLabel,w as variantsForFinish};
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";import{variantIsHanded as f}from"./set-mode.js";const c="dually";function p(e){const t=e.components.reduce((r,o)=>r+o.wheels,0)||s,n=e.kind,i=[n==="staggered"?"Staggered":n===c?"Dually":"",f(e)?"L/R":""].filter(Boolean);return i.length?`${i.join(" ")} set of ${t}`:`Set of ${t}`}function u(e,t){return[...new Set(e.filter(n=>!t||n.finishName===t).map(n=>n.size))]}function g(e,t,n){if(!(!t||!n))return e.find(i=>i.finishName===t&&i.size===n)}function l(e){return e!=null&&e.inStock===!1}function h(e,t){return t?e.filter(n=>n.finishName===t&&l(n)):[]}function x(e,t,n){return t.findIndex((i,r)=>n[r]!==!1&&u(e,i).length>0)}function S(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{g as findVariant,x as firstSellableFinishIndex,S as isOneWheelDesign,l as isVariantOutOfStock,h as outOfStockVariantsForFinish,p as setLabel,u as sizesForFinish};
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};