efficient-storefront-blocks 0.118.2 → 0.118.3

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.
@@ -3,14 +3,8 @@ import { type HeroPriceTemplateProps } from "./ProductHeroPanel.js";
3
3
  import type { HeroPricePlacement } from "../lib/sections/hero-price-placement.js";
4
4
  import type { HeroLayout, HeroTextAlign } from "../lib/sections/hero-arrangement.js";
5
5
  import type { HeroGalleryMode, HeroImageFit } from "../lib/sections/hero-gallery.js";
6
- import { type Tyre, type Wheel } from "../lib/api/index.js";
7
- export type LinkedHeroRecord = {
8
- kind: "wheel";
9
- wheel: Wheel;
10
- } | {
11
- kind: "tyre";
12
- tyre: Tyre;
13
- };
6
+ import { type LinkedHeroRecord } from "../lib/document/linked-hero-hydrate.js";
7
+ export type { LinkedHeroRecord };
14
8
  interface HeroArrangement extends HeroPriceTemplateProps {
15
9
  heroLayout?: HeroLayout;
16
10
  imageRatio?: number;
@@ -21,10 +15,11 @@ interface HeroArrangement extends HeroPriceTemplateProps {
21
15
  imageFit?: HeroImageFit;
22
16
  trustBullets?: ReactNode;
23
17
  }
24
- export default function LinkedProductHero({ slug, kind, editing, pricePlacement, showVehicleFitment, ...arrangement }: {
18
+ export default function LinkedProductHero({ slug, kind, editing, pricePlacement, showVehicleFitment, initialRecord, ...arrangement }: {
25
19
  slug: string;
26
20
  kind?: "wheel" | "tyre";
27
21
  editing?: boolean;
22
+ initialRecord?: LinkedHeroRecord;
28
23
  pricePlacement?: HeroPricePlacement;
29
24
  showVehicleFitment?: boolean;
30
25
  } & HeroArrangement): import("react").JSX.Element;
@@ -34,4 +29,3 @@ export declare function LinkedHeroLoaded({ record, editing, pricePlacement, show
34
29
  pricePlacement?: HeroPricePlacement;
35
30
  showVehicleFitment?: boolean;
36
31
  } & HeroArrangement): import("react").JSX.Element;
37
- export {};
@@ -1 +1 @@
1
- "use client";import{jsx as i,Fragment as x,jsxs as g}from"react/jsx-runtime";import{useEffect as L,useState as f}from"react";import P from"./ProductHeroPanel.js";import y from"./ProductLightbox.js";import a from"./SectionNotice.js";import{useLightbox as w}from"./useLightbox.js";import{useProductSelection as b}from"./useProductSelection.js";import{fromTyre as j}from"../lib/catalog/from-tyre.js";import{fromWheel as k}from"../lib/catalog/from-wheel.js";import{products as h}from"../lib/api/index.js";function F({slug:e,kind:r="wheel",editing:l=!1,pricePlacement:s,showVehicleFitment:m=!0,...n}){const[c,t]=f(null),[p,u]=f(!1);return L(()=>{let d=!1;return t(null),u(!1),(r==="tyre"?h.getTyre(e).then(o=>({kind:"tyre",tyre:o})):h.getWheel(e).then(o=>({kind:"wheel",wheel:o}))).then(o=>{d||t(o)}).catch(()=>{d||u(!0)}),()=>{d=!0}},[e,r]),p?i(a,{size:"tall",children:"Couldn’t load this product."}):c?i(H,{record:c,editing:l,pricePlacement:s,showVehicleFitment:m,...n}):i(a,{size:"tall",children:"Loading product…"})}function H({record:e,editing:r=!1,pricePlacement:l,showVehicleFitment:s=!0,...m}){const n=e.kind==="tyre"?j(e.tyre):k(e.wheel),c=b(n,{editing:r}),t=w();return g(x,{children:[i(P,{product:n,selection:c,onLightbox:t.open,editing:r,pricePlacement:l,showVehicleFitment:s,...m}),i(y,{item:t.item,onClose:t.close})]})}export{H as LinkedHeroLoaded,F as default};
1
+ "use client";import{jsx as i,Fragment as L,jsxs as P}from"react/jsx-runtime";import{useEffect as y,useState as h}from"react";import w from"./ProductHeroPanel.js";import b from"./ProductLightbox.js";import p from"./SectionNotice.js";import{useLightbox as j}from"./useLightbox.js";import{useProductSelection as k}from"./useProductSelection.js";import{fromTyre as F}from"../lib/catalog/from-tyre.js";import{fromWheel as H}from"../lib/catalog/from-wheel.js";import{products as x}from"../lib/api/index.js";import{matchingLinkedRecord as S}from"../lib/document/linked-hero-hydrate.js";function _({slug:e,kind:r="wheel",editing:c=!1,pricePlacement:l,showVehicleFitment:s=!0,initialRecord:n,...m}){const t=S(n,r,e),[f,d]=h(t??null),[g,a]=h(!1);return y(()=>{if(a(!1),t){d(t);return}let u=!1;return d(null),(r==="tyre"?x.getTyre(e).then(o=>({kind:"tyre",tyre:o})):x.getWheel(e).then(o=>({kind:"wheel",wheel:o}))).then(o=>{u||d(o)}).catch(()=>{u||a(!0)}),()=>{u=!0}},[e,r,t]),g?i(p,{size:"tall",children:"Couldn’t load this product."}):f?i(z,{record:f,editing:c,pricePlacement:l,showVehicleFitment:s,...m}):i(p,{size:"tall",children:"Loading product…"})}function z({record:e,editing:r=!1,pricePlacement:c,showVehicleFitment:l=!0,...s}){const n=e.kind==="tyre"?F(e.tyre):H(e.wheel),m=k(n,{editing:r}),t=j();return P(L,{children:[i(w,{product:n,selection:m,onLightbox:t.open,editing:r,pricePlacement:c,showVehicleFitment:l,...s}),i(b,{item:t.item,onClose:t.close})]})}export{z as LinkedHeroLoaded,_ as default};
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{SITE_WIDTH_CAP as g}from"efficient-web-builder/format/lib/content/page-width";import{resolveWidth as R}from"efficient-web-builder/format/lib/content/section-width";import A from"../../../../../components/LinkedProductHero.js";import l from"../../../../../components/pdp-dynamic/DynamicProductHero.js";import y from"../../../../../components/SectionNotice.js";import{trustBulletsRow as F,trustBulletsSlot as w}from"../../../../../components/product-hero/trust-bullets.js";import{TRUST_BULLETS_SLOT as D}from"../../../../sections/hero-trust-bullets.js";import{HERO_OPTION_SLOT as m}from"../../../../content/hero-option-seed.js";import{HERO_BUY_SLOT as u}from"../../../../content/hero-buy-seed.js";import{cardPressTitlesOf as I}from"efficient-web-builder/render/lib/document/card-press-titles";import{useCurrentProduct as S}from"../../../current-product.js";import{isEditorOnDynamicPage as U}from"efficient-web-builder/format/lib/document/editor-page-context";import{DEFAULT_HERO_PRICE_PLACEMENT as B,parseHeroPricePlacement as M}from"../../../../sections/hero-price-placement.js";import{DEFAULT_HERO_LAYOUT as k,DEFAULT_HERO_RATIO as p,DEFAULT_HERO_TEXT_ALIGN as x,parseHeroLayout as C,parseHeroRatio as G,parseHeroTextAlign as N}from"../../../../sections/hero-arrangement.js";import{DEFAULT_HERO_GALLERY_MODE as b,DEFAULT_HERO_IMAGE_FIT as V,parseHeroGalleryMode as Y,parseHeroImageFit as j}from"../../../../sections/hero-gallery.js";import{say as v}from"efficient-web-builder/format/lib/editor-words";import{ProductHeroMeta as Q}from"./meta.js";import{HideTaker as W}from"efficient-web-builder/render/components/ViewHideRoot";function z({source:e,editing:t=!1,pricePlacement:i=B,showVehicleFitment:o=!0,heroLayout:a=k,imageRatio:c=p,textAlign:f=x,showSpecTable:d=!0,showPriceQuote:T=!0,galleryMode:s=b,imageFit:E=V,trustBullets:_,nodeId:H,priceTemplate:P,optionTemplate:L,optionPressTitles:h,buyTemplate:O}){const n={heroLayout:a,imageRatio:c,textAlign:f,showSpecTable:d,showPriceQuote:T,galleryMode:s,imageFit:E,trustBullets:F(_,t),nodeId:H,priceTemplate:P,optionTemplate:L,optionPressTitles:h,buyTemplate:O};return S()||t&&U()?r(l,{editing:t,pricePlacement:i,showVehicleFitment:o,...n}):e?.slug?r(A,{slug:e.slug,kind:e.kind??"wheel",editing:t,pricePlacement:i,showVehicleFitment:o,...n}):t?r(y,{size:"tall",children:v("Pick a product in the panel to fill this hero.")}):r(l,{pricePlacement:i,showVehicleFitment:o,...n})}function X(e,t){return R(e,"full").mode!=="page"?t:r(W,{as:"div",style:{"--sf-content-cap":g},children:t})}const Ee={...Q,render:e=>X(e,r(z,{source:e.source,editing:e.editor?.isEditing,pricePlacement:M(e.pricePlacement),showVehicleFitment:e.showVehicleFitment??!0,heroLayout:C(e.heroLayout),imageRatio:G(e.imageRatio),textAlign:N(e.textAlign),showSpecTable:e.showSpecTable??!0,showPriceQuote:e.showPriceQuote??!0,galleryMode:Y(e.galleryMode),imageFit:j(e.imageFit),trustBullets:w(e[D]),nodeId:typeof e.id=="string"?e.id:void 0,priceTemplate:typeof e.template=="function"?e.template:void 0,optionTemplate:typeof e[m]=="function"?e[m]:void 0,optionPressTitles:I(e,m),buyTemplate:typeof e[u]=="function"?e[u]:void 0}))};export{Ee as ProductHeroRender};
1
+ import{jsx as r}from"react/jsx-runtime";import{SITE_WIDTH_CAP as A}from"efficient-web-builder/format/lib/content/page-width";import{resolveWidth as y}from"efficient-web-builder/format/lib/content/section-width";import F from"../../../../../components/LinkedProductHero.js";import a from"../../../../../components/pdp-dynamic/DynamicProductHero.js";import D from"../../../../../components/SectionNotice.js";import{trustBulletsRow as I,trustBulletsSlot as w}from"../../../../../components/product-hero/trust-bullets.js";import{TRUST_BULLETS_SLOT as S}from"../../../../sections/hero-trust-bullets.js";import{HERO_OPTION_SLOT as m}from"../../../../content/hero-option-seed.js";import{HERO_BUY_SLOT as u}from"../../../../content/hero-buy-seed.js";import{cardPressTitlesOf as U}from"efficient-web-builder/render/lib/document/card-press-titles";import{useCurrentProduct as k}from"../../../current-product.js";import{LINKED_HERO_RECORD_PROP as B,matchingLinkedRecord as C}from"../../../linked-hero-hydrate.js";import{isEditorOnDynamicPage as M}from"efficient-web-builder/format/lib/document/editor-page-context";import{DEFAULT_HERO_PRICE_PLACEMENT as x,parseHeroPricePlacement as p}from"../../../../sections/hero-price-placement.js";import{DEFAULT_HERO_LAYOUT as N,DEFAULT_HERO_RATIO as G,DEFAULT_HERO_TEXT_ALIGN as b,parseHeroLayout as V,parseHeroRatio as Y,parseHeroTextAlign as j}from"../../../../sections/hero-arrangement.js";import{DEFAULT_HERO_GALLERY_MODE as v,DEFAULT_HERO_IMAGE_FIT as Q,parseHeroGalleryMode as W,parseHeroImageFit as z}from"../../../../sections/hero-gallery.js";import{say as K}from"efficient-web-builder/format/lib/editor-words";import{ProductHeroMeta as X}from"./meta.js";import{HideTaker as q}from"efficient-web-builder/render/components/ViewHideRoot";function J({source:e,editing:t=!1,pricePlacement:i=x,showVehicleFitment:o=!0,heroLayout:c=N,imageRatio:d=G,textAlign:f=b,showSpecTable:T=!0,showPriceQuote:E=!0,galleryMode:_=v,imageFit:s=Q,trustBullets:R,nodeId:P,priceTemplate:H,optionTemplate:L,optionPressTitles:O,buyTemplate:h,linkedRecord:g}){const n={heroLayout:c,imageRatio:d,textAlign:f,showSpecTable:T,showPriceQuote:E,galleryMode:_,imageFit:s,trustBullets:I(R,t),nodeId:P,priceTemplate:H,optionTemplate:L,optionPressTitles:O,buyTemplate:h};if(k()||t&&M())return r(a,{editing:t,pricePlacement:i,showVehicleFitment:o,...n});if(e?.slug){const l=e.kind??"wheel";return r(F,{slug:e.slug,kind:l,initialRecord:C(g,l,e.slug),editing:t,pricePlacement:i,showVehicleFitment:o,...n})}return t?r(D,{size:"tall",children:K("Pick a product in the panel to fill this hero.")}):r(a,{pricePlacement:i,showVehicleFitment:o,...n})}function Z(e,t){return y(e,"full").mode!=="page"?t:r(q,{as:"div",style:{"--sf-content-cap":A},children:t})}const Le={...X,render:e=>Z(e,r(J,{source:e.source,editing:e.editor?.isEditing,pricePlacement:p(e.pricePlacement),showVehicleFitment:e.showVehicleFitment??!0,heroLayout:V(e.heroLayout),imageRatio:Y(e.imageRatio),textAlign:j(e.textAlign),showSpecTable:e.showSpecTable??!0,showPriceQuote:e.showPriceQuote??!0,galleryMode:W(e.galleryMode),imageFit:z(e.imageFit),trustBullets:w(e[S]),nodeId:typeof e.id=="string"?e.id:void 0,priceTemplate:typeof e.template=="function"?e.template:void 0,optionTemplate:typeof e[m]=="function"?e[m]:void 0,optionPressTitles:U(e,m),buyTemplate:typeof e[u]=="function"?e[u]:void 0,linkedRecord:e[B]}))};export{Le as ProductHeroRender};
@@ -0,0 +1,8 @@
1
+ import type { Data } from "efficient-easel/blocks";
2
+ import type { Tyre, Wheel } from "../api/index.js";
3
+ import { type LinkedHeroRecord } from "./linked-hero-hydrate.js";
4
+ export interface LinkedHeroReads {
5
+ getWheel(slug: string): Promise<Wheel>;
6
+ getTyre(slug: string): Promise<Tyre>;
7
+ }
8
+ export declare function fetchLinkedHeroRecords(data: Data | null | undefined, reads: LinkedHeroReads): Promise<LinkedHeroRecord[]>;
@@ -0,0 +1 @@
1
+ import{linkedHeroSources as o}from"./linked-hero-hydrate.js";async function a(n,r){return(await Promise.allSettled(o(n).map(({kind:e,slug:l})=>e==="tyre"?r.getTyre(l).then(t=>({kind:"tyre",tyre:t})):r.getWheel(l).then(t=>({kind:"wheel",wheel:t}))))).flatMap(e=>e.status==="fulfilled"?[e.value]:[])}export{a as fetchLinkedHeroRecords};
@@ -0,0 +1,25 @@
1
+ import type { Data } from "efficient-easel/blocks";
2
+ import type { Tyre, Wheel } from "../api/index.js";
3
+ export type LinkedHeroRecord = {
4
+ kind: "wheel";
5
+ wheel: Wheel;
6
+ } | {
7
+ kind: "tyre";
8
+ tyre: Tyre;
9
+ };
10
+ export interface LinkedHeroSource {
11
+ kind: "wheel" | "tyre";
12
+ slug: string;
13
+ }
14
+ export declare const LINKED_HERO_RECORD_PROP = "linkedRecord";
15
+ interface ContentNode {
16
+ type?: string;
17
+ props?: Record<string, unknown>;
18
+ }
19
+ export declare function matchingLinkedRecord(value: unknown, kind: "wheel" | "tyre", slug: string): LinkedHeroRecord | undefined;
20
+ export declare function linkedHeroSources(data: Data | null | undefined): LinkedHeroSource[];
21
+ export declare function pageHasLinkedHero(data: Data | null | undefined): boolean;
22
+ export declare function hydrateLinkedHeroes(data: Data, records: readonly LinkedHeroRecord[]): Data;
23
+ export declare function stripLinkedHeroRecord<T extends ContentNode>(node: T): T;
24
+ export declare function stripLinkedHeroRecords(data: Data): Data;
25
+ export {};
@@ -0,0 +1 @@
1
+ import{PRODUCT_HERO_TYPE as p,documentNodes as f,mapDocumentNodes as s}from"./document-nodes.js";const u="linkedRecord";function i(r){if(r?.type!==p)return null;const e=r.props?.source;return typeof e?.slug!="string"||!e.slug?null:{kind:e.kind==="tyre"?"tyre":"wheel",slug:e.slug}}function d(r,e,n){const t=r;if(!t||t.kind!==e)return;const o=e==="tyre"?t.tyre:t.wheel;return o&&typeof o=="object"&&o.slug===n?t:void 0}function l(r){const e=[];for(const n of f(r)){const t=i(n);t&&!e.some(o=>o.kind===t.kind&&o.slug===t.slug)&&e.push(t)}return e}function R(r){return l(r).length>0}function y(r,e){return e.length===0?r:s(r,n=>{const t=i(n);if(!t)return n;const o=e.find(c=>d(c,t.kind,t.slug));return o?{...n,props:{...n.props??{},[u]:o}}:n})}function g(r){if(!r?.props||!(u in r.props))return r;const{[u]:e,...n}=r.props;return{...r,props:n}}function H(r){return s(r,e=>g(e))}export{u as LINKED_HERO_RECORD_PROP,y as hydrateLinkedHeroes,l as linkedHeroSources,d as matchingLinkedRecord,R as pageHasLinkedHero,g as stripLinkedHeroRecord,H as stripLinkedHeroRecords};
@@ -1 +1 @@
1
- import{cardHoverOf as E}from"efficient-web-builder/format/lib/animation/hover";import{resolvePlpKinds as G}from"../catalog/plp-item.js";import{GRID_TOP_UP_SPARE as L,gridPagingOf as I}from"../sections/product-grid-pages.js";import{gridKindsOf as O,gridRowsOf as W,isAllProductsSource as v,isLinkedSource as C}from"./grid-source.js";import{ALLOY_WHEELS_LISTING_TYPE as u,FILTER_BLOCK_TYPE as T,PRODUCT_GRID_TYPE as R,documentNodes as N,mapDocumentNodes as U}from"../document/document-nodes.js";import{selectedRangesOf as D,stripSelectedRanges as g}from"./selected-ranges.js";import{withShopperFirstPaint as H,withoutShopperFirstPaint as B,withoutShopperFirstPaintNode as w}from"./shopper-first-paint.js";const h="catalog",F="catalogTotal",K="CatalogFilterBar",f="fieldUsage";function l(e){return e.props?.source}function p(e){return e?.type===R&&C(l(e))}function a(e){return e?.type===K||e?.type===T}function S(e,t){if(t)return;const{limit:r,cap:o}=I(e.props??{});return o?Math.ceil(r)+L:void 0}function m(e){return e?.type===u||p(e)||a(e)}const c=e=>N(e);function Y(e){return e?c(e).some(t=>t?.type===u||p(t)):!1}function te(e){return e?Y(e)||c(e).some(t=>w(t)!==t)||g(e)!==e:!1}function re(e){return e?c(e).some(m):!1}function ne(e,t){return t.length===0?e:x(e,m,r=>({...r,props:{...r.props??{},[f]:t}}))}function M(e){if(!e)return[];const t=new Set;for(const r of c(e)){if(r?.type!==u&&!p(r))continue;const o=r.props?.kinds;for(const n of p(r)?O(l(r),o):G(o))t.add(n)}return[...t]}function oe(e){if(!e)return;const t=c(e);if(t.some(a))return;const r=M(e).length;let o;for(const n of t){if(n?.type===u)return;if(!p(n))continue;const s=S(n,!1),i=n.props??{},d=new Set(O(l(n),i.kinds)),A=["num","title","description","linkText"].some(y=>typeof i[y]=="string"&&i[y]!=="");if(s===void 0||!v(l(n))||d.size!==r||A)return;o=Math.max(o??0,s)}return o}function se(e){return e.length===1&&e[0]==="alloy-wheel"}function ie(e,t,{everyHoverPhoto:r=!1}={}){const o=D(e.root?.props),n=c(e).some(a),s=r?z:b;return H(j(e,i=>p(i)?V(i,t,S(i,n),s):{...i,props:{...P(i).props,products:s(i,t)}}),o)}const z=(e,t)=>[...t];function b(e,t){const r=E(e.props??{},e.type??""),o=r.kind==="nextImage"&&r.media&&r.media.kind!=="renderings"?r.media.kind:null;return t.map(n=>{const{hoverMedia:s,...i}=n;return s===void 0?n:o&&s?.[o]?{...i,hoverMedia:{[o]:s[o]}}:i})}function V(e,t,r,o){const n=o(e,W(l(e),e.props?.kinds,t)),s={..._(e).props};return r!==void 0&&n.length>r?(s[h]=n.slice(0,r),s[F]=n.length):s[h]=n,{...e,props:s}}function pe(e){return B(x(g(e),m,t=>a(t)?k(t):p(t)?_(t):P(t)))}function k(e){if(!e.props||!(f in e.props))return e;const{[f]:t,...r}=e.props;return{...e,props:r}}function _(e){const{[h]:t,[F]:r,[f]:o,...n}=e.props??{},s=n.source;if(s&&"wheels"in s){const{wheels:i,...d}=s;n.source=d}return{...e,props:n}}function ue(e){const t=g({content:[e]}).content[0],r=w(t);return p(r)?_(r):a(r)?k(r):r?.type===u?P(r):r}function P(e){const{wheels:t,products:r,[f]:o,...n}=e.props??{};return{...e,props:n}}function j(e,t){return x(e,r=>r?.type===u||p(r),t)}function x(e,t,r){return U(e,o=>t(o)?r(o):o)}export{K as CATALOG_FILTER_BAR_TYPE,f as FIELD_USAGE_PROP,T as FILTER_BLOCK_TYPE,h as GRID_CATALOG_PROP,F as GRID_CATALOG_TOTAL_PROP,L as GRID_TOP_UP_SPARE,R as PRODUCT_GRID_TYPE,pe as dehydrateWheelsListing,ue as dehydrateWheelsListingNode,ne as hydrateFieldUsage,ie as hydrateWheelsListing,oe as listingCatalogBound,M as listingCatalogKinds,se as listingWantsWheelsOnly,te as pageHasHydratedValues,Y as pageHasWheelsListing,re as pageReadsFieldUsage};
1
+ import{cardHoverOf as G}from"efficient-web-builder/format/lib/animation/hover";import{resolvePlpKinds as I}from"../catalog/plp-item.js";import{GRID_TOP_UP_SPARE as O,gridPagingOf as W}from"../sections/product-grid-pages.js";import{gridKindsOf as R,gridRowsOf as v,isAllProductsSource as C,isLinkedSource as H}from"./grid-source.js";import{ALLOY_WHEELS_LISTING_TYPE as u,FILTER_BLOCK_TYPE as T,PRODUCT_GRID_TYPE as w,documentNodes as N,mapDocumentNodes as U}from"../document/document-nodes.js";import{stripLinkedHeroRecords as g}from"../document/linked-hero-hydrate.js";import{selectedRangesOf as D,stripSelectedRanges as h}from"./selected-ranges.js";import{withShopperFirstPaint as B,withoutShopperFirstPaint as K,withoutShopperFirstPaintNode as k}from"./shopper-first-paint.js";const m="catalog",F="catalogTotal",Y="CatalogFilterBar",f="fieldUsage";function l(e){return e.props?.source}function p(e){return e?.type===w&&H(l(e))}function a(e){return e?.type===Y||e?.type===T}function S(e,r){if(r)return;const{limit:t,cap:o}=W(e.props??{});return o?Math.ceil(t)+O:void 0}function _(e){return e?.type===u||p(e)||a(e)}const c=e=>N(e);function M(e){return e?c(e).some(r=>r?.type===u||p(r)):!1}function ne(e){return e?M(e)||c(e).some(r=>k(r)!==r)||h(e)!==e||g(e)!==e:!1}function oe(e){return e?c(e).some(_):!1}function se(e,r){return r.length===0?e:y(e,_,t=>({...t,props:{...t.props??{},[f]:r}}))}function z(e){if(!e)return[];const r=new Set;for(const t of c(e)){if(t?.type!==u&&!p(t))continue;const o=t.props?.kinds;for(const n of p(t)?R(l(t),o):I(o))r.add(n)}return[...r]}function ie(e){if(!e)return;const r=c(e);if(r.some(a))return;const t=z(e).length;let o;for(const n of r){if(n?.type===u)return;if(!p(n))continue;const s=S(n,!1),i=n.props??{},d=new Set(R(l(n),i.kinds)),E=["num","title","description","linkText"].some(L=>typeof i[L]=="string"&&i[L]!=="");if(s===void 0||!C(l(n))||d.size!==t||E)return;o=Math.max(o??0,s)}return o}function pe(e){return e.length===1&&e[0]==="alloy-wheel"}function ue(e,r,{everyHoverPhoto:t=!1}={}){const o=D(e.root?.props),n=c(e).some(a),s=t?b:V;return B(q(e,i=>p(i)?j(i,r,S(i,n),s):{...i,props:{...x(i).props,products:s(i,r)}}),o)}const b=(e,r)=>[...r];function V(e,r){const t=G(e.props??{},e.type??""),o=t.kind==="nextImage"&&t.media&&t.media.kind!=="renderings"?t.media.kind:null;return r.map(n=>{const{hoverMedia:s,...i}=n;return s===void 0?n:o&&s?.[o]?{...i,hoverMedia:{[o]:s[o]}}:i})}function j(e,r,t,o){const n=o(e,v(l(e),e.props?.kinds,r)),s={...P(e).props};return t!==void 0&&n.length>t?(s[m]=n.slice(0,t),s[F]=n.length):s[m]=n,{...e,props:s}}function ce(e){return K(y(g(h(e)),_,r=>a(r)?A(r):p(r)?P(r):x(r)))}function A(e){if(!e.props||!(f in e.props))return e;const{[f]:r,...t}=e.props;return{...e,props:t}}function P(e){const{[m]:r,[F]:t,[f]:o,...n}=e.props??{},s=n.source;if(s&&"wheels"in s){const{wheels:i,...d}=s;n.source=d}return{...e,props:n}}function fe(e){const r=g(h({content:[e]})).content[0],t=k(r);return p(t)?P(t):a(t)?A(t):t?.type===u?x(t):t}function x(e){const{wheels:r,products:t,[f]:o,...n}=e.props??{};return{...e,props:n}}function q(e,r){return y(e,t=>t?.type===u||p(t),r)}function y(e,r,t){return U(e,o=>r(o)?t(o):o)}export{Y as CATALOG_FILTER_BAR_TYPE,f as FIELD_USAGE_PROP,T as FILTER_BLOCK_TYPE,m as GRID_CATALOG_PROP,F as GRID_CATALOG_TOTAL_PROP,O as GRID_TOP_UP_SPARE,w as PRODUCT_GRID_TYPE,ce as dehydrateWheelsListing,fe as dehydrateWheelsListingNode,se as hydrateFieldUsage,ue as hydrateWheelsListing,ie as listingCatalogBound,z as listingCatalogKinds,pe as listingWantsWheelsOnly,ne as pageHasHydratedValues,M as pageHasWheelsListing,oe as pageReadsFieldUsage};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-storefront-blocks",
3
- "version": "0.118.2",
3
+ "version": "0.118.3",
4
4
  "description": "The EFFICIENT storefront's website editor — the website builder assembled with the storefront's own sections — for an app that edits a storefront website inside its own page. Built from the efficient-storefront-blocks repository.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Efficient Pty Ltd",