efficient-storefront-blocks 0.65.0 → 0.66.2
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 +59 -0
- package/README.md +0 -1
- package/dist/chunks/EditorPreviewCheckout-HAUEGHGC.js +4 -0
- package/dist/chunks/{SiteEditorProvider-ZYGNRWSB.js → SiteEditorProvider-KOPR3UDU.js} +1 -1
- package/dist/chunks/{chunk-I7BIOONR.js → chunk-S66TL4Z3.js} +1 -1
- package/dist/chunks/{chunk-YAO6XQYA.js → chunk-TAGGXC3A.js} +1 -1
- package/dist/chunks/chunk-VEI75RPM.js +1 -0
- package/dist/chunks/{chunk-OU2WWXMT.js → chunk-Z7PJKX2P.js} +1 -1
- package/dist/chunks/{fitment-data-IKFCBT6E.js → fitment-data-UQDOQP66.js} +1 -1
- package/dist/consent.js +1 -1
- package/dist/editor/components/CollectionPicker.js +1 -1
- package/dist/editor/components/EditProductLink.js +1 -1
- package/dist/editor/components/FormPicker.js +1 -1
- package/dist/editor/components/GalleryProductBinding.d.ts +1 -1
- package/dist/editor/components/GalleryProductBinding.js +1 -1
- package/dist/editor/components/GalleryShowcaseSource.d.ts +1 -1
- package/dist/editor/components/GalleryShowcaseSource.js +1 -1
- package/dist/editor/components/HeaderSettingsPanel.js +1 -1
- package/dist/editor/components/MenuLinkRangeField.js +1 -1
- package/dist/editor/components/PerViewStepperField.js +1 -1
- package/dist/editor/lib/puck/blocks/service/ContactRouting/fields.js +1 -1
- package/dist/editor/lib/puck/config.d.ts +0 -4
- package/dist/editor/lib/puck/config.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +2 -4
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.d.ts +0 -17
- package/dist/index.js +43 -43
- package/dist/render/app/globals.css +18 -4
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/CartContext.d.ts +5 -0
- package/dist/render/components/CartContext.js +1 -1
- package/dist/render/components/ContactRouting.d.ts +11 -1
- package/dist/render/components/ContactRouting.js +1 -1
- package/dist/render/components/DetailRows.d.ts +2 -0
- package/dist/render/components/DetailRows.js +1 -1
- package/dist/render/components/Events.d.ts +11 -1
- package/dist/render/components/Events.js +1 -1
- package/dist/render/components/GalleryGrid.d.ts +4 -1
- package/dist/render/components/GalleryGrid.js +1 -1
- package/dist/render/components/GalleryItem.d.ts +1 -0
- package/dist/render/components/GalleryItem.js +1 -1
- package/dist/render/components/ProductGallery.js +1 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/checkout/CheckoutPageClient.js +3 -3
- package/dist/render/components/fitment/FitmentPickerGrid.js +1 -1
- package/dist/render/components/fitment/PickerField.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicDetailRows.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.d.ts +2 -0
- package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.js +1 -1
- package/dist/render/components/pdp-dynamic/RecordPhotoGallery.d.ts +12 -0
- package/dist/render/components/pdp-dynamic/RecordPhotoGallery.js +1 -0
- package/dist/render/lib/api/types.d.ts +1 -0
- package/dist/render/lib/checkout/match-subdivision.d.ts +2 -0
- package/dist/render/lib/checkout/match-subdivision.js +1 -0
- package/dist/render/lib/consent/choice.d.ts +0 -2
- package/dist/render/lib/consent/choice.js +1 -1
- package/dist/render/lib/consent/rules.d.ts +0 -1
- package/dist/render/lib/consent/rules.js +1 -1
- package/dist/render/lib/content/source-values.d.ts +4 -0
- package/dist/render/lib/content/source-values.js +1 -0
- package/dist/render/lib/content/stock-words.d.ts +0 -4
- package/dist/render/lib/content/stock-words.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/GalleryB/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/GalleryItem/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/Events/render.js +1 -1
- package/dist/render/lib/puck/blocks/text-part-shapes.json +6 -3
- package/dist/render/lib/puck/current-record.d.ts +1 -0
- package/dist/render/lib/puck/current-record.js +1 -1
- package/dist/render/lib/sections/fill-row.d.ts +8 -0
- package/dist/render/lib/sections/fill-row.js +1 -1
- package/dist/render/lib/sections/grid-no-hole.d.ts +12 -0
- package/dist/render/lib/sections/grid-no-hole.js +1 -0
- package/dist/render/lib/sections/own-padding.d.ts +3 -0
- package/dist/render/lib/sections/own-padding.js +1 -0
- package/dist/render/lib/wheels/catalog-filters-to-listing.d.ts +0 -1
- package/dist/render/lib/wheels/catalog-filters-to-listing.js +1 -1
- package/dist/render/lib/wheels/catalog-filters.d.ts +0 -1
- package/dist/render/lib/wheels/catalog-filters.js +1 -1
- package/dist/words.d.ts +3 -4
- package/dist/words.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/EditorPreviewCheckout-4KZCYPQT.js +0 -4
- package/dist/chunks/chunk-GR7OHU32.js +0 -1
- /package/dist/chunks/{chunk-B44XQA2J.js → chunk-IHYVLVY3.js} +0 -0
- /package/dist/chunks/{chunk-YAO6XQYA.js.LEGAL.txt → chunk-TAGGXC3A.js.LEGAL.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as y}from"react/jsx-runtime";import{createContext as m,useContext as i}from"react";import{say as o}from"efficient-web-builder/format/lib/editor-words";import{declaredRecordType as R,PRODUCT_RECORD_TYPE as s}from"efficient-web-builder/format/lib/content/record-types";function h(t){const e=t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim().toLowerCase();return e?e[0].toUpperCase()+e.slice(1):t}const C=/^\d{4}-\d{2}-\d{2}$/;function x(t){return t?t.schema?.length?t.schema.filter(e=>typeof e?.key=="string"&&e.key in t.fields):Object.entries(t.fields).flatMap(([e,r])=>{const n=Array.isArray(r)?g(r[0])?"rows":"images":typeof r=="string"?C.test(r)?"date":"text":null;return n?[{key:e,label:h(e),kind:n}]:[]}):[]}function P(t,{firstField:e=!1}={}){if(!t)return[];const r=x(t).filter(n=>n.kind==="images");return(e?r.slice(0,1):r).flatMap(n=>{const a=t.fields[n.key];return Array.isArray(a)?a.flatMap(l=>{const c=l?.url;if(typeof c!="string"||!c)return[];const p=l.alt,d=l.video;return[{url:c,alt:typeof p=="string"?p:"",...typeof d=="string"&&d?{video:d}:{}}]}):[]})}function k(t){const e=new Date(`${t}T00:00:00Z`);return Number.isNaN(e.getTime())?t:e.toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric",timeZone:"UTC"})}function g(t){const e=t;return typeof e?.label=="string"&&!!e.label.trim()&&typeof e.value=="string"&&!!e.value.trim()}function b(t){return t?x(t).flatMap(e=>{const r=t.fields[e.key];return e.kind==="rows"?Array.isArray(r)?r.filter(g).map(({label:n,value:a})=>({label:n,value:a})):[]:e.kind!=="text"&&e.kind!=="date"?[]:typeof r!="string"||!r.trim()?[]:[{label:e.label,value:e.kind==="date"?k(r):r}]}):[]}const u=m(null);function O(t){const e=t?.appState?.data?.root;return R(e?.props)!==s}const f=m(s);function _({type:t,children:e}){return y(f.Provider,{value:t,children:e})}function w(){return i(f)}function S(t){const e=i(u),r=i(f);return e?e.type!==s:t&&r!==s}const E={type:"sample",key:"sample",get title(){return o("Record title")},get fields(){return{first:o("A detail of this record"),second:o("Another detail"),third:o("A third")}},value:void 0,get schema(){return[{key:"first",label:o("First detail"),kind:"text"},{key:"second",label:o("Second detail"),kind:"text"},{key:"third",label:o("Third detail"),kind:"text"}]}},M=4;function U({record:t,children:e}){return y(u.Provider,{value:t,children:e})}function F(){return i(u)}function L(t){const e=i(u);return e!==null&&e.type===t?e:null}export{U as CurrentRecordProvider,_ as DeclaredRecordTypeProvider,M as SAMPLE_PICTURE_COUNT,E as SAMPLE_RECORD,O as editorPageDrawsOtherRecord,b as recordFacts,x as recordFieldSpecs,P as recordPictures,F as useCurrentRecord,L as useCurrentRecordOf,w as useDeclaredRecordType,S as useDrawsOtherRecord};
|
|
@@ -9,8 +9,16 @@ export interface GridColumns {
|
|
|
9
9
|
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
|
+
export declare const gridTracks: (n: number) => string;
|
|
12
13
|
export interface FillRowCards {
|
|
13
14
|
limit?: number;
|
|
14
15
|
cards?: number;
|
|
15
16
|
}
|
|
16
17
|
export declare function fillRowCss(cls: string, gridClass: string, { limit, cards }?: FillRowCards): string;
|
|
18
|
+
export interface GridBand {
|
|
19
|
+
min?: number;
|
|
20
|
+
max?: number;
|
|
21
|
+
columns: number;
|
|
22
|
+
}
|
|
23
|
+
export declare function gridBands({ base, steps }: GridColumns): GridBand[];
|
|
24
|
+
export declare function inBand(band: GridBand, rules: readonly string[]): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a(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-\[(\d+)px\]:grid-cols-(\d+)(?=\s|$)/g)].map(t=>({below:Number(t[1]),columns:Number(t[2])})).sort((t,u)=>u.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 w(n,o){return{base:f(n.base,o),steps:n.steps.map(e=>({below:e.below,columns:f(e.columns,o)}))}}const d=n=>`grid-template-columns:repeat(${n},minmax(0,1fr))`;function $(n,o,{limit:e,cards:t}={}){const u=a(o),r=typeof e=="number"&&e>0?e:void 0,p=Math.max(u.base,...u.steps.map(i=>i.columns));if(t!==void 0&&Math.min(t,r??1/0)>=p)return"";const l=[];for(const i of x(u)){const s=r===void 0?i.columns:f(i.columns,r),c=[];s<i.columns&&c.push(`.${n}.${n}{${d(s)}}`);for(let m=s-1;m>=1;m--)c.push(`.${n}:not(:has(> :nth-child(${m+1}))){${d(m)}}`);l.push(h(i,c))}return l.join("")}function x({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 h(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{w as fillRow,f as fillRowColumns,$ as fillRowCss,x as gridBands,a as gridColumnsOf,d as gridTracks,h as inBand};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type GridBand } from "./fill-row.js";
|
|
2
|
+
export declare const SET_CARD_SINGLE_BELOW = 800;
|
|
3
|
+
export declare function packsFull(spans: readonly number[], columns: number): boolean;
|
|
4
|
+
export declare function cardsWithoutHole(spans: readonly number[], columns: number, limit: number | undefined, topUp?: boolean): number;
|
|
5
|
+
export interface NoHoleBand {
|
|
6
|
+
band: GridBand;
|
|
7
|
+
cards: number;
|
|
8
|
+
tracks: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function noHoleBands(gridClass: string, spans: readonly number[], limit: number | undefined, topUp?: boolean): NoHoleBand[];
|
|
11
|
+
export declare function showsASetCard(spans: readonly number[], limit: number | undefined): boolean;
|
|
12
|
+
export declare function noHoleCss(cls: string, bands: readonly NoHoleBand[], cards: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{gridBands as l,gridColumnsOf as h,gridTracks as d,inBand as x}from"./fill-row.js";const m=800;function p(t,r){const n=[],f=(o,e,i)=>{for(let c=e;c<e+i;c++)if(n[o][c])return!1;return!0};for(const o of t){const e=Math.max(1,Math.min(r,o));for(let i=0;;i++){n[i]??=Array(r).fill(!1);let c=0;for(;c+e<=r&&!f(i,c,e);)c++;if(!(c+e>r)){for(let s=c;s<c+e;s++)n[i][s]=!0;break}}}return n.every(o=>o.every(Boolean))}const a=(t,r)=>t.reduce((n,f)=>n+Math.max(1,Math.min(r,f)),0),u=(t,r)=>p(t,Math.min(r,Math.max(1,a(t,r))));function w(t,r,n,f=!0){const o=Math.min(t.length,n&&n>0?n:t.length);if(o===0||u(t.slice(0,o),r))return o;if(f){for(let e=o+1;e<=t.length;e++)if(u(t.slice(0,e),r))return e}for(let e=o-1;e>=1;e--)if(u(t.slice(0,e),r))return e;return o}const M=(t,r)=>r.max!==void 0&&r.max<=m?t.map(()=>1):t;function k(t,r,n,f=!0){return l(h(t)).map(o=>{const e=M(r,o),i=w(e,o.columns,n,f),c=a(e.slice(0,i),o.columns);return{band:o,cards:i,tracks:Math.min(o.columns,Math.max(1,c))}})}function $(t,r){return t.slice(0,r&&r>0?r:t.length).some(n=>n>1)}function B(t,r,n){const f=[`.${t}{grid-auto-flow:row dense}`];for(const{band:o,cards:e,tracks:i}of r){const c=[];e<n&&c.push(`.${t} > *:nth-child(n+${e+1}){display:none}`),i<o.columns&&c.push(`.${t}.${t}{${d(i)}}`),f.push(x(o,c))}return f.join("")}export{m as SET_CARD_SINGLE_BELOW,w as cardsWithoutHole,k as noHoleBands,B as noHoleCss,p as packsFull,$ as showsASetCard};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(n){return typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function r(n,o){const t=e(n),i=e(o);return{...t===void 0?{}:{paddingTop:t},...i===void 0?{}:{paddingBottom:i}}}function d(n){return n==null||n===!1||typeof n=="string"&&!n.trim()}function f(n,o,t){return d(n)&&d(o)&&d(t)}export{f as headIsEmpty,r as ownPadding};
|
|
@@ -2,7 +2,6 @@ import { type PlpFilterState } from "./plp-filters.js";
|
|
|
2
2
|
import type { CatalogFilterState } from "./catalog-filters.js";
|
|
3
3
|
import type { VehicleSelection } from "./fitment-options.js";
|
|
4
4
|
export type UnmappableCatalogFacet = "lugs" | "priceMin";
|
|
5
|
-
export declare const UNMAPPABLE_FACET_LABELS: Record<UnmappableCatalogFacet, string>;
|
|
6
5
|
export declare const RESULTS_LINK_BLOCKED_NOTE: string;
|
|
7
6
|
export declare function unmappableCatalogFacets(f: CatalogFilterState): UnmappableCatalogFacet[];
|
|
8
7
|
export declare function catalogFiltersToListingFilters(f: CatalogFilterState): PlpFilterState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EMPTY_PLP_FILTERS as h,plpFiltersToParams as
|
|
1
|
+
import{EMPTY_PLP_FILTERS as h,plpFiltersToParams as d}from"./plp-filters.js";import{appendVehicleParams as g}from"./plp-vehicle-params.js";const x="The results link is off while the Lugs filter is on. The product listing page filters on bolt pattern and has no lug filter, so a shopper's lug choice could not be carried across — they would land on a wider set of products than they asked for. Turn Lugs off to use the results link.";function F(s){const t=[];return s.lugs!=null&&t.push("lugs"),s.priceMin!=null&&t.push("priceMin"),t}function f(s){return s==="default"?"recommended":s}function m(s){return{...h,collections:s.process?[s.process]:[],diameters:s.size!=null?[s.size]:[],finishes:s.finish?[s.finish]:[],priceMax:s.priceMax,sort:f(s.sort)}}function P(s,t,l){const e=s.indexOf("#"),a=e===-1?"":s.slice(e),o=e===-1?s:s.slice(0,e),i=o.indexOf("?"),c=i===-1?o:o.slice(0,i),n=new URLSearchParams(i===-1?"":o.slice(i+1));for(const[u,p]of d(m(t)))n.set(u,p);g(n,l);const r=n.toString();return`${c}${r?`?${r}`:""}${a}`}export{x as RESULTS_LINK_BLOCKED_NOTE,m as catalogFiltersToListingFilters,P as listingLinkFromCatalogFilters,F as unmappableCatalogFacets};
|
|
@@ -16,4 +16,3 @@ export declare const EMPTY_FILTERS: CatalogFilterState;
|
|
|
16
16
|
export declare function wheelMatchesFilters(wheel: WheelSummary, f: CatalogFilterState, currency: Currency): boolean;
|
|
17
17
|
export declare function sortWheels(wheels: WheelSummary[], sort: SortKey, currency: Currency): WheelSummary[];
|
|
18
18
|
export declare function applyCatalogFilters(wheels: WheelSummary[], f: CatalogFilterState, currency: Currency, fit?: VehicleFitment | null): WheelSummary[];
|
|
19
|
-
export declare function hasActiveFilters(f: CatalogFilterState): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{wheelsFittingVehicle as l}from"./plp-fitment-match.js";import{comparePrice as n,withinPriceRange as
|
|
1
|
+
import{wheelsFittingVehicle as l}from"./plp-fitment-match.js";import{comparePrice as n,withinPriceRange as o}from"./price-display.js";import{itemLugs as u}from"./lug-count.js";const d={default:"Sort · Featured",new:"Newest","price-asc":"Price · Low","price-desc":"Price · High",name:"Name A–Z"},h={process:null,size:null,lugs:null,finish:null,priceMin:null,priceMax:null,sort:"default"};function a(r,e,i){return!(e.process&&r.process!==e.process||e.size&&!r.sizes.includes(e.size)||e.lugs!=null&&u(r)!==e.lugs||e.finish&&!r.finishes.some(s=>s.family===e.finish)||!o(r.prices,i,e.priceMin,e.priceMax))}function p(r,e,i){return[...r].sort((s,t)=>{switch(e){case"price-asc":return n(s.prices,t.prices,i,"asc");case"price-desc":return n(s.prices,t.prices,i,"desc");case"name":return s.name.localeCompare(t.name);case"new":return(t.badge==="new"?1:0)-(s.badge==="new"?1:0);default:return 0}})}function x(r,e,i,s=null){const t=l(r,s);return p(t.filter(c=>a(c,e,i)),e.sort,i)}export{h as EMPTY_FILTERS,d as SORT_LABELS,x as applyCatalogFilters,p as sortWheels,a as wheelMatchesFilters};
|
package/dist/words.d.ts
CHANGED
|
@@ -599,6 +599,7 @@ export type WebBuilderPhrase =
|
|
|
599
599
|
| "Image stage"
|
|
600
600
|
| "Image tint"
|
|
601
601
|
| "Image width"
|
|
602
|
+
| "Image — set a path"
|
|
602
603
|
| "In its own box"
|
|
603
604
|
| "In progress (accent)"
|
|
604
605
|
| "In the product"
|
|
@@ -1343,7 +1344,6 @@ export type StorefrontBlocksPhrase =
|
|
|
1343
1344
|
| "A short description of your newsletter or publication."
|
|
1344
1345
|
| "A short summary of the post appears here."
|
|
1345
1346
|
| "A third"
|
|
1346
|
-
| "About us"
|
|
1347
1347
|
| "Accessories"
|
|
1348
1348
|
| "Account and cart"
|
|
1349
1349
|
| "Add a line of footer text."
|
|
@@ -1596,7 +1596,7 @@ export type StorefrontBlocksPhrase =
|
|
|
1596
1596
|
| "Issues"
|
|
1597
1597
|
| "Item name"
|
|
1598
1598
|
| "Items to display"
|
|
1599
|
-
| "Its
|
|
1599
|
+
| "Its photos become the card cover and lightbox, and its car fills the Vehicle below. No group → the product’s cover image."
|
|
1600
1600
|
| "Join our email list"
|
|
1601
1601
|
| "Joins the “{audience}” audience"
|
|
1602
1602
|
| "Joins the “{audience}” audience, but only when the consent box is ticked"
|
|
@@ -1644,7 +1644,6 @@ export type StorefrontBlocksPhrase =
|
|
|
1644
1644
|
| "Lugs"
|
|
1645
1645
|
| "M"
|
|
1646
1646
|
| "Main + thumbs"
|
|
1647
|
-
| "Main heading & *highlight*"
|
|
1648
1647
|
| "Main only"
|
|
1649
1648
|
| "Make"
|
|
1650
1649
|
| "Manage menus →"
|
|
@@ -1746,7 +1745,6 @@ export type StorefrontBlocksPhrase =
|
|
|
1746
1745
|
| "Posts to display"
|
|
1747
1746
|
| "Price / quote"
|
|
1748
1747
|
| "Price and details come from the product record — edit them in the Products database and this block updates to match. The name follows the product’s design name unless it’s overridden per storefront in {place}."
|
|
1749
|
-
| "Price from"
|
|
1750
1748
|
| "Price on request"
|
|
1751
1749
|
| "Price position"
|
|
1752
1750
|
| "Price · High"
|
|
@@ -1964,6 +1962,7 @@ export type StorefrontBlocksPhrase =
|
|
|
1964
1962
|
| "Use company default"
|
|
1965
1963
|
| "Use my real delivery options"
|
|
1966
1964
|
| "Using your company logo from the database."
|
|
1965
|
+
| "Vehicle"
|
|
1967
1966
|
| "Vehicle catalog unavailable in this preview — the picker fills from the live fitment API on the published site."
|
|
1968
1967
|
| "Vehicle fitment"
|
|
1969
1968
|
| "Vehicle list unavailable"
|