efficient-storefront-blocks 0.94.0 → 0.95.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 +24 -0
- package/README.md +1 -0
- package/dist/chunks/{EditorPreviewCheckout-OPDSFBJH.js → EditorPreviewCheckout-3F3CP5MR.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-ZP6NAWYT.js → SiteEditorProvider-HN7TFLUJ.js} +1 -1
- package/dist/chunks/chunk-7SMQDDLZ.js +1 -0
- package/dist/chunks/{chunk-ATCBSW73.js → chunk-CYLLSHDF.js} +1 -1
- package/dist/chunks/chunk-SUKEQRMP.js +389 -0
- package/dist/chunks/{chunk-CEFKTE5A.js → chunk-WLMM7L6N.js} +1 -1
- package/dist/chunks/{fitment-data-IPAMN5IH.js → fitment-data-Z62WUQGC.js} +1 -1
- package/dist/editor/lib/document/blocks/commerce/AlloyWheelsListing/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/AppointmentBooking/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/BookingBox/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/ContactRouting/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/index.d.ts +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +1 -1
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.js +33 -33
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/AppointmentBooking.d.ts +3 -1
- package/dist/render/components/AppointmentBooking.js +1 -1
- package/dist/render/components/ContactRouting.d.ts +9 -1
- package/dist/render/components/ContactRouting.js +1 -1
- package/dist/render/components/CountrySelect.js +1 -1
- package/dist/render/components/FooterMenu.js +1 -1
- package/dist/render/components/MenuLinkBlock.js +1 -1
- package/dist/render/components/SpecTable.js +1 -1
- package/dist/render/components/booking/BookingBox.d.ts +5 -1
- package/dist/render/components/booking/BookingBox.js +1 -1
- package/dist/render/components/booking/BookingFormState.d.ts +9 -0
- package/dist/render/components/booking/BookingFormState.js +1 -1
- package/dist/render/components/booking/BookingRegions.d.ts +9 -1
- package/dist/render/components/booking/BookingRegions.js +1 -1
- package/dist/render/components/card-ground-cell.d.ts +2 -0
- package/dist/render/components/card-ground-cell.js +1 -0
- package/dist/render/components/wheels-plp/AlloyWheelsListing.d.ts +2 -1
- package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
- package/dist/render/components/wheels-plp/PlpFacetRows.d.ts +14 -0
- package/dist/render/components/wheels-plp/PlpFacetRows.js +1 -0
- package/dist/render/components/wheels-plp/PlpSidebar.d.ts +7 -1
- package/dist/render/components/wheels-plp/PlpSidebar.js +1 -1
- package/dist/render/components/wheels-plp/PlpTypePicker.d.ts +8 -2
- package/dist/render/components/wheels-plp/PlpTypePicker.js +1 -1
- package/dist/render/lib/booking/appointment-time.d.ts +1 -0
- package/dist/render/lib/booking/appointment-time.js +1 -1
- package/dist/render/lib/content/booking-card-seed.d.ts +31 -0
- package/dist/render/lib/content/booking-card-seed.js +1 -0
- package/dist/render/lib/content/contact-card-seed.d.ts +11 -0
- package/dist/render/lib/content/contact-card-seed.js +1 -0
- package/dist/render/lib/content/copy-mark.d.ts +1 -0
- package/dist/render/lib/content/copy-mark.js +1 -0
- package/dist/render/lib/content/facet-row-seed.d.ts +139 -0
- package/dist/render/lib/content/facet-row-seed.js +1 -0
- package/dist/render/lib/content/tab-strip.d.ts +3 -2
- package/dist/render/lib/content/tab-strip.js +1 -1
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/meta.d.ts +4 -0
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/render.js +1 -1
- package/dist/render/lib/document/blocks/service/AppointmentBooking/meta.d.ts +8 -0
- package/dist/render/lib/document/blocks/service/AppointmentBooking/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/AppointmentBooking/render.js +1 -1
- package/dist/render/lib/document/blocks/service/BookingBox/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/BookingBox/render.js +1 -1
- package/dist/render/lib/document/blocks/service/ContactRouting/meta.d.ts +14 -0
- package/dist/render/lib/document/blocks/service/ContactRouting/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/ContactRouting/render.js +1 -1
- package/dist/render/lib/document/card-templates.js +1 -1
- package/dist/render/lib/document/storefront-root.js +1 -1
- package/dist/render/lib/menu-link.d.ts +1 -0
- package/dist/render/lib/menu-link.js +1 -1
- package/dist/render/lib/sections/filter-option-rows.d.ts +5 -4
- package/dist/render/lib/sections/filter-option-rows.js +1 -1
- package/dist/render/lib/wheels/plp-filters.d.ts +4 -0
- package/dist/render/lib/wheels/plp-filters.js +1 -1
- package/dist/words.d.ts +12 -1
- package/dist/words.js +4 -4
- package/package.json +2 -2
- package/dist/chunks/chunk-JKJ76CRT.js +0 -388
- package/dist/chunks/chunk-JTDOMQMQ.js +0 -1
- /package/dist/chunks/{chunk-LRLOANKA.js → chunk-GW5M2ATK.js} +0 -0
- /package/dist/chunks/{chunk-JKJ76CRT.js.LEGAL.txt → chunk-SUKEQRMP.js.LEGAL.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{answerOrder as G,answersForKind as k,facetFieldKey as L,keepForFilter as H,NO_FIELD_ANSWERS as J,orderByAnswers as Q}from"../content/field-usage.js";import{STOCK_WORDS as ee}from"../content/stock-words.js";import{parseOption as te}from"efficient-web-builder/format/lib/parse-option";import{comparePrice as R,FROM_PREFIX_START as ne,priceIn as re,withinPriceRange as
|
|
1
|
+
import{answerOrder as G,answersForKind as k,facetFieldKey as L,keepForFilter as H,NO_FIELD_ANSWERS as J,orderByAnswers as Q}from"../content/field-usage.js";import{STOCK_WORDS as ee}from"../content/stock-words.js";import{parseOption as te}from"efficient-web-builder/format/lib/parse-option";import{comparePrice as R,FROM_PREFIX_START as ne,priceIn as re,withinPriceRange as se}from"./price-display.js";import{trimDecimal as ie,wheelSizeLabel as oe}from"./spec-format.js";import{itemLugs as le,lugFilterLabel as ce}from"./lug-count.js";import{itemBrand as z,itemCollections as ae,itemDiameters as ue,itemFinishFamilies as pe,itemFinishes as fe,itemInStock as F,itemIsNew as E,itemKind as M,itemName as O,itemPcds as de,itemPrices as g,itemSpeedRatings as me,itemTyreSizes as _,itemTyreTypes as he,PLP_ANY_TYPE_LABEL as Se,PLP_KIND_LABELS as N,PLP_KINDS as ye}from"../catalog/plp-item.js";import{parseTyreSize as ge,tyreSizeLabel as v,tyreSizeLabels as Pe,TYRE_SIZE_PARTS as S,TYRE_SIZE_PART_LABELS as xe}from"../tyres/tyre-size.js";const we={recommended:"Recommended","price-asc":"Price · low to high","price-desc":"Price · high to low",new:"Newest",name:"Name A–Z"},I=Object.keys(we);function B(e){return te(I,"recommended",e)}function be(e){return I.filter(t=>t!=="recommended"||e.length<=1)}function Ke(e,t){const r=B(e);return be(t).includes(r)?r:"name"}const P=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],T={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},Me={diameters:"tyreSizes"};function C(e){if(e.length===0)return[];const t=P.filter(r=>e.every(n=>T[r].includes(n)));return t.filter(r=>{const n=Me[r];return!n||!t.includes(n)})}function De(e,t){return t&&e.includes(t)?[t]:[...e]}function K(e){const t=new Set;for(const r of e)t.add(M(r));return[...t]}const Ye={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function $e(e){return`${_e(e.width)}×${e.diameter}`}function We(e){return[...new Set((e.sizePairs??[]).map(t=>oe(t.diameter,t.width)))]}function _e(e){return ie(e)}function x(e,t,r,n=null,i="fail"){const s=M(e),o=l=>i==="fail"||(l==="lugs"?s==="alloy-wheel":T[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(!Y(e,l).some(u=>f.includes(u)))return!1}if(n!=="lugs"&&t.lugs&&t.lugs.length>0&&o("lugs")){const l=le(e);if(l===null||!t.lugs.includes(l))return!1}return!(n!=="price"&&!se(g(e),r,t.priceMin??null,t.priceMax)||n!=="inStock"&&t.inStockOnly&&!F(e))}function Ze(e,t,r){return e.filter(n=>F(n)&&x(n,t,r,"inStock")).length}function D(e,t,r){const n=[...e],i=(o,l)=>O(o).localeCompare(O(l)),s=K(e).length>1;switch(t){case"price-asc":return n.sort((o,l)=>R(g(o),g(l),r,"asc"));case"price-desc":return n.sort((o,l)=>R(g(o),g(l),r,"desc"));case"name":return n.sort(i);case"new":return n.sort((o,l)=>{const a=(E(l)?1:0)-(E(o)?1:0);return a!==0||!s?a:i(o,l)});default:return n}}function je(e,t,r){return D(e.filter(n=>x(n,t,r)),t.sort,r)}function qe(e,t,r){return D(e.filter(n=>x(n,t,r,null,"pass")),t.sort,r)}function Ue(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 Ve=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 Y(e,t){switch(t){case"tyreSizes":return[...new Set(_(e).flatMap(Pe))];case"brands":return z(e)?[z(e)]:[];case"finishes":return pe(e);case"diameters":return ue(e).map(String);case"collections":return ae(e);case"pcds":return de(e);case"tyreTypes":return he(e);case"speedRatings":return me(e)}}function Ae(e){const t=new Map;for(const r of e)for(const n of fe(r))n.color&&!t.has(n.family)&&t.set(n.family,n.color);return t}function Xe(e,t,r,n=K(e),i=J,s="fail"){const o=c=>ke(c,n,i),l=Ae(e),f=(s==="pass"?P.filter(c=>n.some(y=>T[c].includes(y))):C(n)).filter(c=>c!=="tyreSizes").filter(o).map(c=>{const y=t[c].map(String),A=new Set,b=new Map,w=new Map;for(const p of e){const h=Y(p,c);for(const d of h)A.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))b.set(d,(b.get(d)??0)+1)}const X=[...A].map(p=>({value:p,label:c==="diameters"?`${p}″`:p,count:b.get(p)??0,checked:y.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:X}}).filter(c=>c.options.length>$),u=[];for(const c of f){const y=Le(c.key,n,i);y!==void 0&&u.push({fieldKey:c.key,filterOrder:y})}return[...Q(f,c=>c.key,u,"filterOrder")]}const $=1;function Ge(e){return e.showCollection===!1?["collections"]:[]}function ke(e,t,r){return t.length===0||r.length===0?!0:t.some(n=>H(k(r,n))(L(e,n)))}function Le(e,t,r){if(r.length===0)return;let n;for(const i of t){const s=G(k(r,i),"filter")(L(e,i));s!==void 0&&(n===void 0||s<n)&&(n=s)}return n}function Re(e){const t=new Set;for(const r of e)for(const n of _(r))t.add(v(n));return t.size}function He(e,t){return C(t).includes("tyreSizes")?Re(e)>$:!1}function W(e){const t=ge(e);if(t)return t;const[r,n]=e.split("/");return{width:r?Number(r):void 0,profile:n?Number(n):void 0}}function ze(e,t,r){return S.slice(0,S.indexOf(r)).every(n=>{const i=t[n];return i==null||e[n]===i})}function Je(e,t,r){const n=W(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=>ze(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:xe[s],value:n[s]??null,options:l}})}function Qe(e,t,r,n){const i={...W(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 et(e,t,r,n){if(t.length<2)return[];const i=e.filter(s=>x(s,r,n,"kind"));return[{kind:null,label:Se,count:i.length,checked:r.kind===null},...t.map(s=>({kind:s,label:N[s],count:i.filter(o=>M(o)===s).length,checked:r.kind===s}))]}function tt(e,t){if(e.length===0)return null;const r=e.map(s=>re(g(s),t)).filter(s=>s!==null);if(r.length===0)return null;const n=Math.floor(Math.min(...r)),i=Math.ceil(Math.max(...r));return i>n?{min:n,max:i}:null}function nt(e,t,r){const n=[];e.kind&&n.push({key:"kind",value:e.kind,label:N[e.kind]}),e.inStockOnly&&n.push({key:"inStock",value:"",label:ee.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:ce(i)});return e.priceMin!=null&&n.push({key:"priceMin",value:"",label:`${ne}${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",q="inStock",U="sort",V="page";function rt(e){const t=s=>e.getAll(s).flatMap(o=>o.split(",")).filter(Boolean),r=Number(e.get(j)),n=Number(e.get(V)),i=e.get(Z);return{tyreSizes:t(m.tyreSizes),brands:t(m.brands),finishes:t(m.finishes),diameters:t(m.diameters).map(Number).filter(Number.isFinite),collections:t(m.collections),pcds:t(m.pcds),tyreTypes:t(m.tyreTypes),speedRatings:t(m.speedRatings),priceMax:Number.isFinite(r)&&r>0?r:null,inStockOnly:e.get(q)==="1",kind:ye.find(s=>s===i)??null,sort:B(e.get(U)),page:Number.isFinite(n)&&n>=1?Math.floor(n):1}}function st(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.priceMax!=null&&t.set(j,String(e.priceMax)),e.inStockOnly&&t.set(q,"1"),e.kind&&t.set(Z,e.kind),e.sort!=="recommended"&&t.set(U,e.sort),e.page>1&&t.set(V,String(e.page)),t}function it(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 ot(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{Ye as EMPTY_PLP_FILTERS,P as PLP_FACET_KEYS,Te as PLP_FACET_LABELS,$ as PLP_ONE_VALUE_MAX,m as PLP_PARAM,we as PLP_SORT_LABELS,Z as PLP_TYPE_PARAM,je as applyPlpFilters,qe as applyShopperFilters,B as asPlpSortKey,Xe as buildPlpFacets,et as buildPlpTypeOptions,Je as buildTyreSizeBoxes,ke as facetWantedByAnyKind,_e as formatWidth,Ue as hasActivePlpFilters,Ve as isDeadPlpOption,x as itemMatchesPlp,Ge as listingHiddenFacets,ot as paginatePlp,Qe as pickTyreSize,nt as plpActiveChips,C as plpFacetKeysFor,rt as plpFiltersFromParams,st as plpFiltersToParams,Ze as plpInStockCount,Ke as plpOpeningSort,it as plpPageSequence,tt as plpPriceBounds,De as plpShownKinds,be as plpSortKeysFor,He as plpTyreSizeBoxesShown,Re as plpTyreSizeCount,$e as sizePairLabel,D as sortPlpItems,We as wheelSizeLabels};
|
package/dist/words.d.ts
CHANGED
|
@@ -483,6 +483,8 @@ export type WebBuilderPhrase =
|
|
|
483
483
|
| "Eyebrow style"
|
|
484
484
|
| "Facebook"
|
|
485
485
|
| "Fade"
|
|
486
|
+
| "Fade in"
|
|
487
|
+
| "Fade out"
|
|
486
488
|
| "Feature"
|
|
487
489
|
| "Feature Banner"
|
|
488
490
|
| "Feature Rows"
|
|
@@ -788,6 +790,8 @@ export type WebBuilderPhrase =
|
|
|
788
790
|
| "Month DD, YYYY"
|
|
789
791
|
| "More"
|
|
790
792
|
| "Most popular"
|
|
793
|
+
| "Move down"
|
|
794
|
+
| "Move up"
|
|
791
795
|
| "Multi-column container for blocks."
|
|
792
796
|
| "Muted"
|
|
793
797
|
| "Name"
|
|
@@ -896,6 +900,7 @@ export type WebBuilderPhrase =
|
|
|
896
900
|
| "Panorama 21:9"
|
|
897
901
|
| "Paragraph"
|
|
898
902
|
| "Paragraph size — 13px"
|
|
903
|
+
| "Parallax"
|
|
899
904
|
| "Part of {name}"
|
|
900
905
|
| "Paste a link to each profile. A platform left empty shows nothing on the site."
|
|
901
906
|
| "Payment Logos"
|
|
@@ -912,6 +917,7 @@ export type WebBuilderPhrase =
|
|
|
912
917
|
| "Pick who to reach, then a form that routes the message."
|
|
913
918
|
| "Picture"
|
|
914
919
|
| "Picture first"
|
|
920
|
+
| "Pin while scrolling"
|
|
915
921
|
| "Pinterest"
|
|
916
922
|
| "Place"
|
|
917
923
|
| "Placement"
|
|
@@ -947,6 +953,7 @@ export type WebBuilderPhrase =
|
|
|
947
953
|
| "Product photos"
|
|
948
954
|
| "Product record"
|
|
949
955
|
| "Product record (spec tiles)"
|
|
956
|
+
| "Product renderings"
|
|
950
957
|
| "Product tiles"
|
|
951
958
|
| "Products, prices and forms always show as they are now."
|
|
952
959
|
| "Promotions & sign-ups"
|
|
@@ -1022,6 +1029,8 @@ export type WebBuilderPhrase =
|
|
|
1022
1029
|
| "Scale"
|
|
1023
1030
|
| "Screen"
|
|
1024
1031
|
| "Screen 16:10"
|
|
1032
|
+
| "Screens"
|
|
1033
|
+
| "Scroll"
|
|
1025
1034
|
| "Scroll-Over Text"
|
|
1026
1035
|
| "Scrolling Bar"
|
|
1027
1036
|
| "Search"
|
|
@@ -1419,6 +1428,8 @@ export type WebBuilderPhrase =
|
|
|
1419
1428
|
| "Your unpublished changes are kept"
|
|
1420
1429
|
| "Zigzag"
|
|
1421
1430
|
| "Zoom"
|
|
1431
|
+
| "Zoom in"
|
|
1432
|
+
| "Zoom out"
|
|
1422
1433
|
| "all theme colors"
|
|
1423
1434
|
| "arrangement"
|
|
1424
1435
|
| "body text"
|
|
@@ -1710,6 +1721,7 @@ export type StorefrontBlocksPhrase =
|
|
|
1710
1721
|
| "Filter by brand, colour, size and fitment to find your set."
|
|
1711
1722
|
| "Filter by name"
|
|
1712
1723
|
| "Filter chips"
|
|
1724
|
+
| "Filter option template"
|
|
1713
1725
|
| "Filters"
|
|
1714
1726
|
| "Filters button"
|
|
1715
1727
|
| "Filters shown"
|
|
@@ -2029,7 +2041,6 @@ export type StorefrontBlocksPhrase =
|
|
|
2029
2041
|
| "Sample reviewer"
|
|
2030
2042
|
| "Save this address to my account"
|
|
2031
2043
|
| "Saving…"
|
|
2032
|
-
| "Scroll"
|
|
2033
2044
|
| "Search forms…"
|
|
2034
2045
|
| "Search your catalog…"
|
|
2035
2046
|
| "Second card"
|