efficient-storefront-blocks 0.130.3 → 0.130.5
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 +35 -0
- package/dist/editor/lib/document/blocks/commerce/ProductGrid/fields.js +1 -1
- package/dist/index.js +26 -26
- package/dist/render/app/globals.css +43 -0
- 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/package.json +1 -1
|
@@ -4528,6 +4528,49 @@ em.text-accent {
|
|
|
4528
4528
|
margin: 0;
|
|
4529
4529
|
}
|
|
4530
4530
|
|
|
4531
|
+
/* ─── Studio with "Words: Over the picture" (Product Grid; INOVIT product page 2026-11-18) ───
|
|
4532
|
+
The product page's "You may also like" draws ONE grey card: the studio
|
|
4533
|
+
ground on the whole card, the wheel and its floor shadows where Studio puts
|
|
4534
|
+
them, and the words inside the card at its foot (the design's `.ptile .pph`
|
|
4535
|
+
and `.ct`). Only the pair draws this; Studio with the words under (the home
|
|
4536
|
+
design), and every other ground, never match these rules.
|
|
4537
|
+
The card box (the box that holds the picture box) is the card: 10:13, as
|
|
4538
|
+
Studio's picture is, and its Padding row is the words' distance from the
|
|
4539
|
+
card's edges (24, 12 on a phone, on the new inovit.com), as it is for
|
|
4540
|
+
"Over the picture". The picture box covers the whole card box, under the
|
|
4541
|
+
words, so its ground, wheel and shadows are drawn as Studio draws them;
|
|
4542
|
+
the words stay in the flow at the card box's foot. Short cards and long
|
|
4543
|
+
words are the card box's: the words may reach over the floor shadows, as
|
|
4544
|
+
in the design on a phone.
|
|
4545
|
+
The picture box must hold the Picture part alone (`:only-child`): in a
|
|
4546
|
+
template whose one Box holds the picture and the words together (the seed
|
|
4547
|
+
card), nothing here matches and the pair draws as before. The picture box
|
|
4548
|
+
is taken out of the flow only inside such a card box, so a template whose
|
|
4549
|
+
Picture and Words boxes are root blocks (no card box) draws as before too. */
|
|
4550
|
+
.sf-card-ground-studio.sf-card-words-over [data-part="box"]:has(> * > [data-part="box"] > * > [data-part="image-block"]:only-child) {
|
|
4551
|
+
position: relative;
|
|
4552
|
+
isolation: isolate;
|
|
4553
|
+
aspect-ratio: 10 / 13;
|
|
4554
|
+
display: flex;
|
|
4555
|
+
flex-direction: column;
|
|
4556
|
+
}
|
|
4557
|
+
/* Its row of parts takes the card's height (a percentage height does not
|
|
4558
|
+
resolve against an aspect ratio), so "Over the picture"'s `flex-end` puts
|
|
4559
|
+
the words at the foot. It is a column even when the card box's Direction
|
|
4560
|
+
is a row: the words are always under the wheel's place, never beside it. */
|
|
4561
|
+
.sf-card-ground-studio.sf-card-words-over [data-part="box"]:has(> * > [data-part="box"] > * > [data-part="image-block"]:only-child) > :has(> [data-part="box"] > * > [data-part="image-block"]:only-child) {
|
|
4562
|
+
flex: 1 1 auto;
|
|
4563
|
+
flex-direction: column;
|
|
4564
|
+
}
|
|
4565
|
+
.sf-card-ground-studio.sf-card-words-over [data-part="box"]:has(> * > [data-part="box"] > * > [data-part="image-block"]:only-child) > * > [data-part="box"]:has(> * > [data-part="image-block"]:only-child) {
|
|
4566
|
+
position: absolute;
|
|
4567
|
+
inset: 0;
|
|
4568
|
+
z-index: -1;
|
|
4569
|
+
aspect-ratio: auto;
|
|
4570
|
+
min-height: 0;
|
|
4571
|
+
container-type: inline-size;
|
|
4572
|
+
}
|
|
4573
|
+
|
|
4531
4574
|
/* A CARD GRID NEVER DRAWS A CARD UNDER ITS MINIMUM WIDTH (2026-11-24).
|
|
4532
4575
|
A Product Grid set to 4 or 6 columns drew its cards at about 155 px when the
|
|
4533
4576
|
grid itself was narrow (a half-width box, a narrow frame): its tracks were
|
|
@@ -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};
|