efficient-storefront-blocks 0.123.3 → 0.124.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 +7 -0
- package/dist/chunks/CustomHtmlCodeWindow-6QU56I6L.js +26 -0
- package/dist/chunks/{EditorPreviewCheckout-NQFCOASP.js → EditorPreviewCheckout-TRX42H6I.js} +4 -4
- package/dist/chunks/SiteEditorProvider-IBJ5A5V3.js +1 -0
- package/dist/chunks/chunk-27GSFHNV.js +1 -0
- package/dist/chunks/chunk-CDKQFBBA.js +1 -0
- package/dist/chunks/chunk-EKCLPISP.js +96 -0
- package/dist/chunks/{chunk-K5OPN6GZ.js → chunk-ESQTNC7T.js} +19 -18
- package/dist/chunks/chunk-JJ5MCDPE.js +1 -0
- package/dist/chunks/chunk-MC6E4ZLD.js +339 -0
- package/dist/chunks/chunk-O5WPKRAC.js +2 -0
- package/dist/chunks/chunk-S5N6H2MP.js +1 -0
- package/dist/chunks/chunk-T7CS442T.js +4 -0
- package/dist/chunks/chunk-YCL4MPLF.js +1 -0
- package/dist/chunks/fitment-data-MXT6XIW5.js +1 -0
- package/dist/chunks/{section-css-style-J4DULHLY.js → section-css-style-ZZ3ZOGPR.js} +1 -1
- package/dist/editor/components/HeaderSettingsPanel.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/index.js +136 -25
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/BoxHeaderBar.js +1 -1
- package/dist/render/components/GalleryShowcase.js +1 -1
- package/dist/render/components/card-pieces/CardProductPicture.js +1 -1
- package/dist/render/components/checkout/CheckoutPageClient.js +1 -1
- package/dist/render/lib/api/index.js +1 -1
- package/dist/render/lib/content/english-variant.js +1 -1
- package/dist/render/lib/content/header-bar.js +1 -1
- package/dist/render/lib/content/tab-strip.js +1 -1
- package/dist/render/lib/content/title-look.js +1 -1
- package/dist/render/lib/document/blocks/commerce/DetailRows/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/FitmentPicker/render.js +1 -1
- package/dist/render/lib/document/blocks/service/OpeningHours/render.js +1 -1
- package/dist/render/lib/document/blocks/service/SignUp/render.js +1 -1
- package/dist/render/lib/document/subscribe-content-type.js +1 -1
- package/dist/render/lib/sections/catalog-filter-layout.js +1 -1
- package/dist/render/lib/sections/fitment-cell-look.js +1 -1
- package/dist/render/lib/sections/hero-arrangement.js +1 -1
- package/dist/render/lib/sections/hero-gallery.js +1 -1
- package/dist/render/lib/sections/hero-price-placement.js +1 -1
- package/dist/render/lib/sections/product-grid-pages.js +1 -1
- package/dist/render/lib/sections/shopper-filters.js +1 -1
- package/dist/render/lib/wheels/plp-filters.js +1 -1
- package/dist/render/lib/wheels/set-mode.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/dist/words.d.ts +17 -0
- package/dist/words.js +4 -4
- package/package.json +16 -4
- package/dist/chunks/SiteEditorProvider-D2OPKHNG.js +0 -1
- package/dist/chunks/chunk-2CQGGANM.js +0 -342
- package/dist/chunks/chunk-BVHE65VQ.js +0 -96
- package/dist/chunks/chunk-EMEK5XSJ.js +0 -1
- package/dist/chunks/chunk-GUMG6SIC.js +0 -1
- package/dist/chunks/chunk-QL4PL74K.js +0 -1
- package/dist/chunks/chunk-ZROLUHOX.js +0 -1
- package/dist/chunks/fitment-data-32VKLJVO.js +0 -1
- /package/dist/chunks/{chunk-K5OPN6GZ.js.LEGAL.txt → chunk-ESQTNC7T.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-2CQGGANM.js.LEGAL.txt → chunk-MC6E4ZLD.js.LEGAL.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{answerOrder as q,answersForKind as R,facetFieldKey as k,keepForFilter as J,NO_FIELD_ANSWERS as ee,orderByAnswers as te}from"../content/field-usage.js";import{STOCK_WORDS as ne}from"../content/stock-words.js";import{parseOption as L}from"efficient-
|
|
1
|
+
import{answerOrder as q,answersForKind as R,facetFieldKey as k,keepForFilter as J,NO_FIELD_ANSWERS as ee,orderByAnswers as te}from"../content/field-usage.js";import{STOCK_WORDS as ne}from"../content/stock-words.js";import{parseOption as L}from"efficient-shell/format";import{comparePrice as z,FROM_PREFIX_START as re,priceIn as ie,withinPriceRange as se}from"./price-display.js";import{trimDecimal as oe,wheelSizeLabel as le}from"./spec-format.js";import{itemLugs as ce,lugFilterLabel as ae}from"./lug-count.js";import{itemBrand as F,itemCollections as ue,itemDiameters as pe,itemFinishFamilies as fe,itemFinishes as de,itemInStock as E,itemIsNew as O,itemKind as b,itemName as N,itemPcds as me,itemPrices as y,itemSpeedRatings as he,itemTyreSizes as _,itemTyreTypes as Se,PLP_ANY_TYPE_LABEL as ge,PLP_KIND_LABELS as I,PLP_KINDS as ye}from"../catalog/plp-item.js";import{parseTyreSize as Pe,tyreSizeLabel as v,tyreSizeLabels as xe,TYRE_SIZE_PARTS as S,TYRE_SIZE_PART_LABELS as we}from"../tyres/tyre-size.js";const Me={recommended:"Recommended","price-asc":"Price · low to high","price-desc":"Price · high to low",new:"Newest",name:"Name A–Z"},B=Object.keys(Me);function C(e){return L(B,"recommended",e)}function be(e){return B.filter(t=>t!=="recommended"||e.length<=1)}function Ue(e,t){const r=C(e);return L(be(t),"name",r)}const P=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],A={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},_e={diameters:"tyreSizes"};function K(e){if(e.length===0)return[];const t=P.filter(r=>e.every(n=>A[r].includes(n)));return t.filter(r=>{const n=_e[r];return!n||!t.includes(n)})}function Ze(e,t){return t&&e.includes(t)?[t]:[...e]}function D(e){const t=new Set;for(const r of e)t.add(b(r));return[...t]}const je={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,priceMin:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function Ve(e){return`${Ae(e.width)}×${e.diameter}`}function Xe(e){return[...new Set((e.sizePairs??[]).map(t=>le(t.diameter,t.width)))]}function Ae(e){return oe(e)}function x(e,t,r,n=null,i="fail"){const s=b(e),o=l=>i==="fail"||(l==="lugs"?s==="alloy-wheel":A[l].includes(s));if(n!=="kind"&&t.kind&&s!==t.kind)return!1;for(const l of P){if(n===l)continue;const a=t[l];if(a.length===0||!o(l))continue;const f=a.map(String);if(!$(e,l).some(u=>f.includes(u)))return!1}if(n!=="lugs"&&t.lugs&&t.lugs.length>0&&o("lugs")){const l=ce(e);if(l===null||!t.lugs.includes(l))return!1}return!(n!=="price"&&!se(y(e),r,t.priceMin??null,t.priceMax)||n!=="inStock"&&t.inStockOnly&&!E(e))}function Ge(e,t,r){return e.filter(n=>E(n)&&x(n,t,r,"inStock")).length}function Y(e,t,r){const n=[...e],i=(o,l)=>N(o).localeCompare(N(l)),s=D(e).length>1;switch(t){case"price-asc":return n.sort((o,l)=>z(y(o),y(l),r,"asc"));case"price-desc":return n.sort((o,l)=>z(y(o),y(l),r,"desc"));case"name":return n.sort(i);case"new":return n.sort((o,l)=>{const a=(O(l)?1:0)-(O(o)?1:0);return a!==0||!s?a:i(o,l)});default:return n}}function He(e,t,r){return Y(e.filter(n=>x(n,t,r)),t.sort,r)}function Qe(e,t,r){return Y(e.filter(n=>x(n,t,r,null,"pass")),t.sort,r)}function qe(e){return P.some(t=>e[t].length>0)||(e.lugs?.length??0)>0||e.priceMin!=null||e.priceMax!=null||e.inStockOnly||e.kind!=null}const Je=e=>e.count===0&&!e.checked,Te={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size · diameter",collections:"Collection",pcds:"PCD · fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function $(e,t){switch(t){case"tyreSizes":return[...new Set(_(e).flatMap(xe))];case"brands":return F(e)?[F(e)]:[];case"finishes":return fe(e);case"diameters":return pe(e).map(String);case"collections":return ue(e);case"pcds":return me(e);case"tyreTypes":return Se(e);case"speedRatings":return he(e)}}function Re(e){const t=new Map;for(const r of e)for(const n of de(r))n.color&&!t.has(n.family)&&t.set(n.family,n.color);return t}function et(e,t,r,n=D(e),i=ee,s="fail"){const o=c=>ke(c,n,i),l=Re(e),f=(s==="pass"?P.filter(c=>n.some(g=>A[c].includes(g))):K(n)).filter(c=>c!=="tyreSizes").filter(o).map(c=>{const g=t[c].map(String),T=new Set,M=new Map,w=new Map;for(const p of e){const h=$(p,c);for(const d of h)T.add(d);for(const d of new Set(h))w.set(d,(w.get(d)??0)+1);if(x(p,t,r,c,s))for(const d of new Set(h))M.set(d,(M.get(d)??0)+1)}const Q=[...T].map(p=>({value:p,label:c==="diameters"?`${p}″`:p,count:M.get(p)??0,checked:g.includes(p),swatch:c==="finishes"?l.get(p)??null:null})).sort((p,h)=>{if(c==="diameters")return Number(p.value)-Number(h.value);const d=(w.get(h.value)??0)-(w.get(p.value)??0);return d!==0?d:p.value.localeCompare(h.value)});return{key:c,label:Te[c],options:Q}}).filter(c=>c.options.length>W),u=[];for(const c of f){const g=Le(c.key,n,i);g!==void 0&&u.push({fieldKey:c.key,filterOrder:g})}return[...te(f,c=>c.key,u,"filterOrder")]}const W=1;function tt(e){return e.showCollection===!1?["collections"]:[]}function ke(e,t,r){return t.length===0||r.length===0?!0:t.some(n=>J(R(r,n))(k(e,n)))}function Le(e,t,r){if(r.length===0)return;let n;for(const i of t){const s=q(R(r,i),"filter")(k(e,i));s!==void 0&&(n===void 0||s<n)&&(n=s)}return n}function ze(e){const t=new Set;for(const r of e)for(const n of _(r))t.add(v(n));return t.size}function nt(e,t){return K(t).includes("tyreSizes")?ze(e)>W:!1}function U(e){const t=Pe(e);if(t)return t;const[r,n]=e.split("/");return{width:r?Number(r):void 0,profile:n?Number(n):void 0}}function Fe(e,t,r){return S.slice(0,S.indexOf(r)).every(n=>{const i=t[n];return i==null||e[n]===i})}function rt(e,t,r){const n=U(t.tyreSizes[0]??""),i=new Set(e.filter(s=>x(s,t,r,"tyreSizes")));return S.map(s=>{const o=new Map;for(const a of e){const f=_(a).filter(u=>Fe(u,n,s));for(const u of new Set(f.map(c=>c[s])))o.has(u)||o.set(u,0),i.has(a)&&o.set(u,(o.get(u)??0)+1)}const l=[...o.keys()].sort((a,f)=>a-f).map(a=>({value:a,label:s==="rim"?`R${a}`:String(a),count:o.get(a)??0}));return{part:s,label:we[s],value:n[s]??null,options:l}})}function it(e,t,r,n){const i={...U(t)},s=S.indexOf(r);i[r]=n??void 0;for(const o of S.slice(s+1))i[o]!=null&&e.some(f=>S.slice(0,S.indexOf(o)+1).every(u=>i[u]==null||f[u]===i[u]))||(i[o]=void 0);return v(i)}function st(e,t,r,n){if(t.length<2)return[];const i=e.filter(s=>x(s,r,n,"kind"));return[{kind:null,label:ge,count:i.length,checked:r.kind===null},...t.map(s=>({kind:s,label:I[s],count:i.filter(o=>b(o)===s).length,checked:r.kind===s}))]}function Ee(e,t){return e.map(r=>ie(y(r),t)).filter(r=>r!==null)}function Oe(e){if(e.length===0)return null;const t=Math.floor(Math.min(...e)),r=Math.ceil(Math.max(...e));return r>t?{min:t,max:r}:null}function ot(e,t){return Oe(Ee(e,t))}function lt(e,t,r){const n=[];e.kind&&n.push({key:"kind",value:e.kind,label:I[e.kind]}),e.inStockOnly&&n.push({key:"inStock",value:"",label:ne.inStock});for(const i of P)for(const s of e[i]){const o=String(s);n.push({key:i,value:o,label:i==="diameters"?`${o}″`:i==="pcds"?`PCD ${o}`:o})}for(const i of e.lugs??[])n.push({key:"lugs",value:String(i),label:ae(i)});return e.priceMin!=null&&n.push({key:"priceMin",value:"",label:`${re}${r(e.priceMin,t)}`}),e.priceMax!=null&&n.push({key:"price",value:"",label:`Up to ${r(e.priceMax,t)}`}),n}const m={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},Z="type",j="maxPrice",V="minPrice",X="inStock",G="sort",H="page";function Ne(e){const t=typeof e=="string"?new URLSearchParams(e):e,r=l=>t.getAll(l).flatMap(a=>a.split(",")).filter(Boolean),n=Number(t.get(j)),i=Number(t.get(V)),s=Number(t.get(H)),o=t.get(Z);return{tyreSizes:r(m.tyreSizes),brands:r(m.brands),finishes:r(m.finishes),diameters:r(m.diameters).map(Number).filter(Number.isFinite),collections:r(m.collections),pcds:r(m.pcds),tyreTypes:r(m.tyreTypes),speedRatings:r(m.speedRatings),priceMax:Number.isFinite(n)&&n>0?n:null,priceMin:Number.isFinite(i)&&i>0?i:null,inStockOnly:t.get(X)==="1",kind:ye.find(l=>l===o)??null,sort:C(t.get(G)),page:Number.isFinite(s)&&s>=1?Math.floor(s):1}}function Ie(e){const t=new URLSearchParams;for(const r of P){const n=e[r];n.length>0&&t.set(m[r],n.join(","))}return e.priceMin!=null&&t.set(V,String(e.priceMin)),e.priceMax!=null&&t.set(j,String(e.priceMax)),e.inStockOnly&&t.set(X,"1"),e.kind&&t.set(Z,e.kind),e.sort!=="recommended"&&t.set(G,e.sort),e.page>1&&t.set(H,String(e.page)),t}function ct(e){return Ie(Ne(e)).toString()}function at(e,t){if(e<=7)return Array.from({length:e},(s,o)=>o+1);const r=[1],n=Math.max(2,t-1),i=Math.min(e-1,t+1);n>2&&r.push(null);for(let s=n;s<=i;s++)r.push(s);return i<e-1&&r.push(null),r.push(e),r}function ut(e,t,r){const n=e.length,i=Math.max(1,Math.floor(r)),s=Math.max(1,Math.ceil(n/i)),o=Math.min(Math.max(1,Math.floor(t)),s),l=(o-1)*i;return{items:e.slice(l,l+i),page:o,pageCount:s,total:n,from:n===0?0:l+1,to:Math.min(l+i,n)}}export{je as EMPTY_PLP_FILTERS,P as PLP_FACET_KEYS,Te as PLP_FACET_LABELS,W as PLP_ONE_VALUE_MAX,m as PLP_PARAM,Me as PLP_SORT_LABELS,Z as PLP_TYPE_PARAM,He as applyPlpFilters,Qe as applyShopperFilters,C as asPlpSortKey,et as buildPlpFacets,st as buildPlpTypeOptions,rt as buildTyreSizeBoxes,ke as facetWantedByAnyKind,Ae as formatWidth,qe as hasActivePlpFilters,Je as isDeadPlpOption,x as itemMatchesPlp,tt as listingHiddenFacets,ut as paginatePlp,it as pickTyreSize,lt as plpActiveChips,K as plpFacetKeysFor,ct as plpFilterQuery,Ne as plpFiltersFromParams,Ie as plpFiltersToParams,Ge as plpInStockCount,Ue as plpOpeningSort,at as plpPageSequence,ot as plpPriceBounds,Oe as plpPriceBoundsOf,Ee as plpPricedAmounts,Ze as plpShownKinds,be as plpSortKeysFor,nt as plpTyreSizeBoxesShown,ze as plpTyreSizeCount,Ve as sizePairLabel,Y as sortPlpItems,Xe as wheelSizeLabels};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as u}from"efficient-
|
|
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};
|