efficient-storefront-blocks 0.130.2 → 0.130.4
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/dist/chunks/{CustomHtmlCodeWindow-MSEPX5HA.js → CustomHtmlCodeWindow-Q52YFW2U.js} +1 -1
- package/dist/chunks/{EditorPreviewCheckout-GQZSREXK.js → EditorPreviewCheckout-E4WBOYOR.js} +1 -1
- package/dist/chunks/SiteEditorProvider-XWNSHTWJ.js +1 -0
- package/dist/chunks/{chunk-B22AOLEU.js → chunk-2ESL6V6A.js} +1 -1
- package/dist/chunks/{chunk-YZZMDZT2.js → chunk-F36A4DQB.js} +1 -1
- package/dist/chunks/{chunk-EHNNMX2W.js → chunk-LNFDRN7J.js} +3 -3
- package/dist/chunks/{chunk-AZNXYX4W.js → chunk-MWASWPCB.js} +1 -1
- package/dist/chunks/{chunk-UJNY3ZUO.js → chunk-NVAI6WFJ.js} +1 -1
- package/dist/chunks/{chunk-4HYAKN2G.js → chunk-RQM4VZZW.js} +1 -1
- package/dist/chunks/{chunk-AJHYWZA6.js → chunk-RYJPQW5E.js} +1 -1
- package/dist/chunks/{chunk-4TGKSUNO.js → chunk-UT3TWN4Y.js} +1 -1
- package/dist/chunks/{fitment-data-JRGRP6YG.js → fitment-data-D7EDIBQ7.js} +1 -1
- package/dist/chunks/{section-css-style-GHS565I6.js → section-css-style-IGADRKZW.js} +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductGrid/fields.js +1 -1
- package/dist/index.js +26 -26
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/pdp-dynamic/DynamicRelatedProducts.d.ts +9 -1
- package/dist/render/components/pdp-dynamic/DynamicRelatedProducts.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductGrid/render.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/dist/words.d.ts +2 -0
- package/dist/words.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/SiteEditorProvider-U4Y5HLNK.js +0 -1
- /package/dist/chunks/{chunk-B22AOLEU.js.LEGAL.txt → chunk-2ESL6V6A.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-PN7RMJTO.js → chunk-ATQPMU57.js} +0 -0
- /package/dist/chunks/{chunk-EHNNMX2W.js.LEGAL.txt → chunk-LNFDRN7J.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-AUQKCN7Q.js → chunk-PWMBT2HT.js} +0 -0
- /package/dist/chunks/{chunk-POFTB7WN.js → chunk-Z7GIOCFP.js} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CardHoverDrawn } from "efficient-web-builder/format/lib/animation/hover";
|
|
2
2
|
import { type CardIndexFormat, type CardOutline } from "efficient-web-builder/format/lib/sections/product-card-style";
|
|
3
|
+
import { type CardGround, type CardWords } from "../GridCardTemplate.js";
|
|
3
4
|
import type { SlotComponent } from "efficient-easel/blocks";
|
|
4
5
|
export declare const supportedKinds: readonly ("alloy-wheel" | "tyre")[];
|
|
5
6
|
interface Props {
|
|
@@ -24,7 +25,14 @@ interface Props {
|
|
|
24
25
|
columnsTablet?: unknown;
|
|
25
26
|
gap?: number | string;
|
|
26
27
|
gapPhone?: unknown;
|
|
28
|
+
cardGround?: CardGround;
|
|
29
|
+
cardWords?: CardWords;
|
|
30
|
+
viewMoreLink?: {
|
|
31
|
+
hidden: true;
|
|
32
|
+
} | {
|
|
33
|
+
label: string;
|
|
34
|
+
};
|
|
27
35
|
}
|
|
28
36
|
export default function DynamicRelatedProducts(props: Props): import("react").JSX.Element;
|
|
29
|
-
export declare function RelatedProductsBody({ num, title, description, columns, cardCount, relationship: key, footnote, footnoteLinkText, footnoteLinkHref, editing, omitHead, hover, ownerId, template, cardImage, outline, indexBadge, columnsPhone, columnsTablet, gap, gapPhone, }: Props): import("react").JSX.Element | null;
|
|
37
|
+
export declare function RelatedProductsBody({ num, title, description, columns, cardCount, relationship: key, footnote, footnoteLinkText, footnoteLinkHref, editing, omitHead, hover, ownerId, template, cardImage, outline, indexBadge, columnsPhone, columnsTablet, gap, gapPhone, cardGround, cardWords, viewMoreLink, }: Props): import("react").JSX.Element | null;
|
|
30
38
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as j}from"react/jsx-runtime";import D from"../SectionBand.js";import{useScopeClass as ee}from"../../lib/use-scope-class.js";import{useEffect as re,useState as te}from"react";import{cardHoverOf as oe}from"efficient-web-builder/format/lib/animation/hover";const ne=oe({},"ProductGrid");import le from"../CompatibleTyres.js";import{cardGroundOf as se,cardRowsGrid as ie,cardWordsOf as de,GridBundleCards as ae,GridCardProvider as ce,GridCards as ue,gridIndexCss as pe}from"../GridCardTemplate.js";import{productGridColumnsClass as me}from"../../lib/sections/product-grid-columns.js";import{containerGapProps as K}from"efficient-web-builder/format/lib/content/container-gap";import{SPEC_TABLE_BAND as k}from"../../lib/sections/spec-table-band.js";import{cardImageShapeTokens as z}from"efficient-web-builder/format/lib/content/card-image-shape";import{NO_FIELD_ANSWERS as fe}from"../../lib/content/field-usage.js";import{gridClassImageSizes as he}from"../../lib/sections/card-image-sizes.js";import{fillRowCss as ge}from"../../lib/sections/fill-row.js";import be from"efficient-web-builder/render/components/SectionHeader";import we from"../ViewMoreLink.js";import{useSiteMenuLinks as ye}from"../catalog/SiteMenuLinks.js";import{renderGold as M,renderHeadline as xe}from"efficient-web-builder/render/components/goldPhrases";import Ce from"./KindGate.js";import{loadProductCatalog as Ee}from"../useProductCatalog.js";import{PLP_KINDS as Pe}from"../../lib/catalog/plp-item.js";import{relatedCardCount as Se,relatedViewMore as Ne}from"../../lib/catalog/related-cards.js";import{answersWithProducts as V,DEFAULT_RELATIONSHIP as ke,relationshipApplies as F,relationshipByKey as ve}from"../../lib/catalog/relationships.js";import{useCurrentProduct as Ge}from"../../lib/document/current-product.js";import{PLACEHOLDER_RELATED as U}from"../../lib/wheels/placeholder-wheel.js";import{say as v}from"efficient-web-builder/format/lib/editor-words";const Z={label:"text-[length:var(--size-label,13px)]"},Re=Pe;function Te(o){return e(Ce,{kinds:Re,type:"RelatedProducts",editing:o.editing,children:e(Le,{...o})})}function Le({num:o,title:r,description:s,columns:a=3,cardCount:G,relationship:R=ke,footnote:y,footnoteLinkText:x,footnoteLinkHref:T,editing:n=!1,omitHead:i=!1,hover:L,ownerId:_="",template:A,cardImage:d,outline:c,indexBadge:m,columnsPhone:u,columnsTablet:C,gap:f,gapPhone:E,cardGround:P,cardWords:S,viewMoreLink:h}){const B={columns:a,columnsPhone:u,columnsTablet:C,gap:f,gapPhone:E,hover:L,ownerId:_,template:A,editing:n,omitHead:i,cardGround:P,cardWords:S},l=Ge(),J=ye(),N=Se(G),t=ve(R),H=t?V(t):!1,[Q,O]=te([]);if(re(()=>{if(l||!n||!H)return;let p=!1;return Ee().then(w=>{const Y=w.length>0?w:U;p||O(Y)}).catch(()=>{p||O(U)}),()=>{p=!0}},[l,n,H]),!t)return null;const g=i?null:e(be,{num:o?M(o):void 0,title:xe(r||t.heading,!1),description:s?M(s):void 0,accent:!0});if(!V(t)){if(l&&!F(t,l.product.kind))return n?e(X,{relationship:t,cardImage:d}):null;const p=l?t.resolve(l.product,l.relatedWheels):null,w=p?.kind==="bundle"?p.bundles.slice(0,N):[];return w.length===0?n?e(q,{header:g,omitHead:i,cardImage:d,words:v("Bundles containing this product appear here on a product page.")}):null:e($,{header:g,cards:{bundles:w},...B})}const W=Ne(t,J),I=h===void 0?W:"hidden"in h?void 0:{href:W.href,label:h.label};if(!l)return n?e($,{header:g,cards:{wheels:Q.slice(0,N)},viewMore:I,...B}):null;if(!F(t,l.product.kind))return n?e(X,{relationship:t,cardImage:d}):null;const b=t.resolve(l.product,l.relatedWheels);return b.kind==="tyre"?e(le,{omitHead:i,columns:a,cardImage:d,outline:c,indexBadge:m,num:o,title:r||t.heading,description:s,tyres:[...b.tyres].slice(0,N),footnote:y,footnoteLinkText:x,footnoteLinkHref:T,viewMore:I,editing:n}):b.kind!=="alloy-wheel"?null:b.wheels.length===0?n?e(q,{header:g,omitHead:i,cardImage:d,words:v("Related products appear here on a product page.")}):null:e($,{header:g,cards:{wheels:[...b.wheels].slice(0,N)},viewMore:I,...B})}function X({relationship:o,cardImage:r}){return e(D,{className:"border-b border-line py-14 max-view-desktop:py-10",style:z(r),children:e("p",{className:`font-mono ${Z.label} uppercase tracking-[0.18em] text-fg-dim`,children:v("“{relationship}” does not apply to this product. It is hidden on the live page.",{relationship:v(o.label)})})})}function q({header:o,omitHead:r,cardImage:s,words:a}){return j(D,{className:r?k.ownBox:k.inline,style:z(s),children:[o,e("p",{className:`border-t border-line py-6 font-mono ${Z.label} uppercase tracking-[0.18em] text-fg-dim`,children:a})]})}function $({header:o,cards:r,viewMore:s,columns:a,columnsPhone:G,columnsTablet:R,gap:y,gapPhone:x,hover:T,ownerId:n,template:i,editing:L,omitHead:_,cardGround:A,cardWords:d}){const c=ee("rp"),m="wheels"in r?r.wheels.length:r.bundles.length;if(m===0)return null;const u=me(a,G,R),C="bundles"in r,f=C?K("ProductGrid",y,"both",x):ie(K("ProductGrid",y,"both",x)),E=pe(c),P=ge(c,u,{cards:m}),S=h=>e("div",{className:C?`${c} mt-10 grid${f.className} ${u}`:`${c} grid${f.className} bg-[var(--catalog-grid-bg)] ${u}`,style:f.style,children:h});return j(D,{className:_?k.ownBox:k.inline,children:[E&&e("style",{children:E}),P&&e("style",{children:P}),o,e(ce,{value:{ownerId:n,Template:i,hover:T??ne,imageSizes:he(u,m),fieldUsage:fe,reserveEyebrow:!1,editing:L,ground:se(A),words:de(d)},children:"wheels"in r?e(ue,{wheels:r.wheels,children:S}):e(ae,{bundles:r.bundles,children:S})}),s?e("div",{className:"mt-10 flex",children:e(we,{href:s.href,label:s.label})}):null]})}export{Le as RelatedProductsBody,Te as default,Re as supportedKinds};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as g}from"react/jsx-runtime";import{gridLimitOf as
|
|
1
|
+
import{jsx as g}from"react/jsx-runtime";import{gridLimitOf as H}from"../../../../sections/product-grid-pages.js";import{FIRST_COUNT_IN_CHIPS_PROP as s}from"../../../../wheels/shopper-first-paint.js";import{phoneKey as a,tabletKey as P}from"efficient-easel/draw";import G from"../../../../../components/pdp-dynamic/DynamicRelatedProducts.js";import{DEFAULT_RELATIONSHIP as R}from"../../../../catalog/relationships.js";import{resolveWidth as _}from"efficient-web-builder/format/lib/content/section-width";import k,{FEW_CARDS as y}from"../../../../../components/ProductGridSection.js";import{cardGroundOf as h,cardWordsOf as w}from"../../../../../components/GridCardTemplate.js";import{relatedCardCount as O}from"../../../../catalog/related-cards.js";import{hidableText as S,readHidable as v}from"efficient-easel/screen/lib/document/hidable";import{cardHoverOf as T}from"efficient-web-builder/format/lib/animation/hover";import{parseSectionHeadPlacement as x}from"efficient-web-builder/format/lib/sections/section-head-placement";import{PH as m}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{phHide as t}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{PRODUCTGRID_PH as c}from"../placeholders.js";import{PRODUCT_GRID_TYPE as b}from"../../../document-nodes.js";import{parseMoreProducts as D}from"../../../../sections/product-grid-pages.js";import{ProductGridMeta as W}from"./meta.js";import{bandPadProps as E}from"../../../../sections/band-padding.js";function U(e){const{text:n,hidden:d}=v(e);return d?{hidden:!0}:n.trim()?{label:n.trim()}:void 0}const ne={...W,render:e=>{const n=typeof e.id=="string"?e.id:"",d=e.template;if(e.dynamic){const i=x(e.headPlacement)==="own-box",r=I=>i?void 0:I;return g(G,{num:r(t(e.num,c.num,e.editor)),title:r(t(e.title,m.sectionHeading,e.editor)),description:r(t(e.description,m.body,e.editor)),omitHead:i,columns:typeof e.columns=="number"?e.columns:3,columnsPhone:e[a("columns")],columnsTablet:e[P("columns")],gap:e.gap,gapPhone:e[a("gap")],cardCount:O(e.limit),relationship:typeof e.relationship=="string"?e.relationship:R,hover:T(e,b),ownerId:n,template:d,cardImage:e.cardImage,outline:e.outline,indexBadge:e.indexBadge,cardGround:h(e.cardGround),cardWords:w(e.cardWords),viewMoreLink:U(e.linkText),editing:e.editor?.isEditing})}const l=t(e.linkText,c.link,e.editor),u=e.source,C=_(e,"full"),f=x(e.headPlacement)==="own-box",o=i=>f?void 0:i;return g(k,{fewCards:y.find(i=>i.value===e.fewCards)?.value,cardGround:h(e.cardGround),cardWords:w(e.cardWords),gap:e.gap,gapPhone:e[a("gap")],contentCapped:C.mode==="page",num:o(t(e.num,c.num,e.editor)),title:o(t(e.title,m.sectionHeading,e.editor)),titleSize:e.titleSize,noTop:f,pads:E(e),description:o(t(e.description,m.body,e.editor)),link:o(l?{text:l,href:S(e.linkHref)||"#"}:void 0),products:e.products,wheels:e.wheels,source:u?.slug?u:void 0,catalog:e.catalog,catalogTotal:e.catalogTotal,firstCountInChips:e[s]===!0,kinds:e.kinds,fieldUsage:e.fieldUsage,columns:e.columns,columnsPhone:e[a("columns")],columnsTablet:e[P("columns")],limit:H({limit:e.limit,showAll:e.showAll}),moreProducts:D(e.moreProducts),perPage:e.perPage,editing:e.editor?.isEditing,hover:T(e,b),ownerId:n,template:d})}};export{ne as ProductGridRender};
|