efficient-storefront-blocks 0.124.0 → 0.125.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 +36 -0
- package/dist/chunks/{CustomHtmlCodeWindow-6QU56I6L.js → CustomHtmlCodeWindow-ROUI64CY.js} +3 -3
- package/dist/chunks/{EditorPreviewCheckout-TRX42H6I.js → EditorPreviewCheckout-F2HXHGBN.js} +1 -1
- package/dist/chunks/SiteEditorProvider-B7766ULW.js +1 -0
- package/dist/chunks/{chunk-S5N6H2MP.js → chunk-2KEZPQPW.js} +1 -1
- package/dist/chunks/{chunk-ESQTNC7T.js → chunk-ESVLXH7T.js} +3 -3
- package/dist/chunks/chunk-KFZLLS45.js +2 -0
- package/dist/chunks/chunk-MU65AZLZ.js +96 -0
- package/dist/chunks/{chunk-CDKQFBBA.js → chunk-O3YXHDC6.js} +1 -1
- package/dist/chunks/chunk-SEA3MICI.js +7 -0
- package/dist/chunks/{chunk-YCL4MPLF.js → chunk-T2LZCAFH.js} +1 -1
- package/dist/chunks/chunk-WWQ5LOLU.js +337 -0
- package/dist/chunks/{fitment-data-MXT6XIW5.js → fitment-data-X7PIIXMU.js} +1 -1
- package/dist/chunks/section-css-style-Q23EN42Q.js +1 -0
- package/dist/editor/lib/document/blocks/commerce/ProductGallery/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductHero/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductSku/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/commerce/ProductSku/fields.js +1 -0
- package/dist/editor/lib/document/blocks/commerce/SpecTable/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
- package/dist/editor/lib/document/blocks/commerce/index.js +1 -1
- package/dist/editor/lib/document/blocks/service/Events/fields.js +1 -1
- package/dist/editor/lib/document/config.js +1 -1
- package/dist/editor/lib/document/section-text-regions.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +7 -0
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/index.js +38 -29
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/Events.d.ts +1 -0
- package/dist/render/components/Events.js +1 -1
- package/dist/render/components/GalleryGrid.js +3 -3
- package/dist/render/components/GalleryItem.d.ts +6 -0
- package/dist/render/components/GalleryItem.js +1 -1
- package/dist/render/components/LinkedProductHero.d.ts +1 -0
- package/dist/render/components/ProductGallery.d.ts +1 -1
- package/dist/render/components/ProductGallery.js +1 -1
- package/dist/render/components/ProductHeroPanel.d.ts +2 -1
- package/dist/render/components/ProductHeroPanel.js +1 -1
- package/dist/render/components/card-pieces/HeadlineName.js +1 -1
- package/dist/render/components/card-pieces/ProductCardState.d.ts +1 -0
- package/dist/render/components/pdp-dynamic/DynamicProductHero.d.ts +1 -0
- package/dist/render/components/pdp-dynamic/DynamicSpecTable.d.ts +1 -0
- package/dist/render/components/pdp-dynamic/DynamicSpecTable.js +1 -1
- package/dist/render/components/product-hero/hero-view.d.ts +1 -0
- package/dist/render/components/product-hero/hero-view.js +1 -1
- package/dist/render/components/useStickyColumns.d.ts +2 -0
- package/dist/render/components/useStickyColumns.js +1 -0
- package/dist/render/lib/catalog/from-wheel.js +1 -1
- package/dist/render/lib/catalog/part-skus.d.ts +2 -0
- package/dist/render/lib/catalog/part-skus.js +1 -0
- package/dist/render/lib/content/hero-seed.d.ts +1 -1
- package/dist/render/lib/content/hero-seed.js +1 -1
- package/dist/render/lib/content/post-list-continue.d.ts +1 -0
- package/dist/render/lib/content/post-list-continue.js +1 -1
- package/dist/render/lib/content/product-card-seed.d.ts +1 -0
- package/dist/render/lib/content/product-card-seed.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductHero/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductName/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductSku/meta.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/ProductSku/meta.js +1 -0
- package/dist/render/lib/document/blocks/commerce/ProductSku/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/ProductSku/render.js +1 -0
- package/dist/render/lib/document/blocks/commerce/SpecTable/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/metas.d.ts +1 -0
- package/dist/render/lib/document/blocks/commerce/metas.js +1 -1
- package/dist/render/lib/document/blocks/commerce/renders.d.ts +1 -0
- package/dist/render/lib/document/blocks/commerce/renders.js +1 -1
- package/dist/render/lib/document/blocks/service/Events/render.js +1 -1
- package/dist/render/lib/document/card-templates.js +1 -1
- package/dist/render/lib/document/lazy-draws.js +1 -1
- package/dist/render/lib/sections/hero-gallery.d.ts +2 -2
- package/dist/render/lib/sections/hero-gallery.js +1 -1
- package/dist/render/lib/sections/hero-sticky.d.ts +4 -0
- package/dist/render/lib/sections/hero-sticky.js +1 -0
- package/dist/render/lib/sections/product-card-text-regions.d.ts +1 -0
- package/dist/render/lib/sections/product-card-text-regions.js +1 -1
- package/dist/render/lib/wheels/spec-sheet.d.ts +19 -0
- package/dist/render/lib/wheels/spec-sheet.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/dist/words.d.ts +12 -0
- package/dist/words.js +4 -4
- package/package.json +3 -15
- package/dist/chunks/SiteEditorProvider-IBJ5A5V3.js +0 -1
- package/dist/chunks/chunk-EKCLPISP.js +0 -96
- package/dist/chunks/chunk-MC6E4ZLD.js +0 -339
- package/dist/chunks/chunk-O5WPKRAC.js +0 -2
- package/dist/chunks/chunk-T7CS442T.js +0 -4
- package/dist/chunks/section-css-style-ZZ3ZOGPR.js +0 -1
- /package/dist/chunks/{chunk-27GSFHNV.js → chunk-AUQZLQEO.js} +0 -0
- /package/dist/chunks/{chunk-ESQTNC7T.js.LEGAL.txt → chunk-ESVLXH7T.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-JJ5MCDPE.js → chunk-NMB6BD73.js} +0 -0
- /package/dist/chunks/{chunk-MC6E4ZLD.js.LEGAL.txt → chunk-WWQ5LOLU.js.LEGAL.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as s,jsxs as c,Fragment as De}from"react/jsx-runtime";import{Children as Me,useContext as Pe,useState as le}from"react";import{servedWords as Ue}from"../lib/content/served-lists.js";import{TAB_PILLS as B}from"../lib/content/tab-strip.js";import{useScopeClass as ze}from"../lib/use-scope-class.js";import{containerGapProps as Ve}from"efficient-web-builder/format/lib/content/container-gap";import je from"efficient-web-builder/render/components/SectionHeader";import C from"efficient-web-builder/render/components/PostCard";import Ye from"efficient-web-builder/render/components/PostDate";import Be from"efficient-web-builder/render/components/Placeholder";import{SiteLink as A}from"efficient-web-builder/render/lib/site-runtime";import{renderGold as b,renderHeadline as L}from"efficient-web-builder/render/components/goldPhrases";import{say as O}from"efficient-web-builder/format/lib/editor-words";import{cardImageShapeTokens as He}from"efficient-web-builder/format/lib/content/card-image-shape";import{SITE_COLUMN as H}from"efficient-web-builder/format/lib/content/page-width";import{fillRowCss as We}from"../lib/sections/fill-row.js";import{FRAME_120 as ce,FRAME_ROOM_COUNT as Ke,SECTION_FRAME_INLINE as de,SECTION_FRAME_OWN_BOX as fe,framedBandPad as W,headIsEmpty as Ge,withBandClasses as K}from"../lib/sections/band-padding.js";import{HideTaker as G,ViewHideContext as Je,viewHideClaim as Xe}from"efficient-web-builder/render/components/ViewHideRoot";import{CardTemplateRows as qe,useCardRow as Qe}from"efficient-web-builder/render/components/CardRowContext";import{SECTION_FILL_CLASS as Ze}from"efficient-web-builder/format/lib/content/section-min-height";import{postPath as me}from"efficient-web-builder/format/lib/links/page-link-rules";import{EVENTS_FEATURED_DARKEN as et,EVENTS_FEATURED_DARKEN_STYLE as tt,EVENTS_FEATURED_PLACEMENT as st}from"../lib/content/events-featured-look.js";import{PostListStarts as nt}from"./PostListStartsProvider.js";import{EVENTS_DEFAULT_LIMIT as at,EVENTS_LAYOUT_COUNT as pe,postCap as rt}from"../lib/content/post-list-continue.js";import{VIEW_TIERS as J}from"efficient-easel/screen/lib/content/view-tiers";import{hiddenKeyOf as ot}from"efficient-easel/screen/lib/content/view-hide";import{nodeHiddenEverywhere as it,nodeViewHideWords as lt,viewHideClass as ue}from"efficient-web-builder/format/lib/content/view-hide-class";const ct=4;function vs(e){return Ue(e,ct)}function Ns(e){if(!e||typeof e!="object"||Array.isArray(e))return;const n={};for(const[t,a]of Object.entries(e))if(t.trim()){if(typeof a=="string")a.trim()&&(n[t]=a.trim());else if(Array.isArray(a)){const o=a.filter(d=>typeof d=="string"&&!!d.trim()).map(d=>d.trim());o.length&&(n[t]=o)}}return Object.keys(n).length?n:void 0}function ge(e,n){const t=e.facets?.[n];return t===void 0?[]:typeof t=="string"?[t]:t}const dt=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});function ft(e){const n=[],t=new Map;for(const a of e)for(const o of Object.keys(a.facets??{})){t.has(o)||(n.push(o),t.set(o,new Set));for(const d of ge(a,o))t.get(o).add(d)}return n.map(a=>({label:a,values:[...t.get(a)].sort(dt.compare)}))}function mt(e,n){return Object.entries(n).every(([t,a])=>a===""||ge(e,t).includes(a))}const he="featured",xe="tabs",ve="portrait",E="spread",bs=[{label:"Even grid",value:"even"},{label:"Featured first",value:he},{label:"Tabs",value:xe},{label:"Photo cards",value:ve},{label:"Staggered spread",value:E},{label:"Count",value:pe}],pt=[ve,E],Es="even",X={min:2,max:11,step:1,fallback:7,unit:"of 12"},ut=st,gt=et,ht=tt;function xt(e){const n=typeof e=="number"?e:Number.parseFloat(String(e??"")),t=Number.isFinite(n)?Math.min(X.max,Math.max(X.min,Math.round(n))):X.fallback;return`${t}fr ${12-t}fr`}const Ne={1:"grid-cols-1",2:"grid-cols-2 max-view-wide:grid-cols-1",3:"grid-cols-3 max-view-wide:grid-cols-1",4:"grid-cols-4 max-view-desktop:grid-cols-2 max-view-wide:grid-cols-1"},vt={2:"grid-cols-2",3:"grid-cols-3 max-view-wide:grid-cols-2",4:"grid-cols-4 max-view-desktop:grid-cols-3 max-view-wide:grid-cols-2"},Nt={2:"grid-cols-2 max-view-wide:grid-cols-1",3:"grid-cols-3 max-view-wide:grid-cols-1",4:"grid-cols-4 max-view-desktop:grid-cols-3 max-view-wide:grid-cols-1"};function be(e,n){return{key:e.slug,title:e.title??"",excerpt:e.excerpt??"",cover:e.cover??"",meta:e.meta??"",dateLabel:e.dateLabel??"",href:e.href||(n?"#":me(e.slug))}}function bt(e,n){return{...be(e,n),tags:(e.tags??[]).map(t=>({label:t}))}}const Ee=new WeakMap,Et={className:"hidden"},Tt={className:Ze};function Te(e,n){const t=e.blockIds[0],a=e;function o(d){const h=Qe(),T=n&&h?.index===0;return s(a,{...d,cell:u=>u===t===T?Tt:Et})}return Object.assign(o,{blockCount:1,blockIds:e.blockIds})}function yt(e,n){const t=e;if(typeof t!="function"||(t.blockCount??0)<2||!Array.isArray(t.blockIds))return e;let a=Ee.get(t);return a||(a={lead:Te(t,!0),rest:Te(t,!1)},Ee.set(t,a)),n?a.lead:a.rest}const _t="Find by name",wt="Nobody by that name.",Ct="Nobody matches.",At="Any",Lt="No posts in this category yet.",Ot="All posts",St=me("").replace(/\/$/,"");function $t(e){return typeof e=="string"?e.trim():""}function It(){return c("div",{className:"flex min-h-[40vh] flex-col items-center justify-center gap-6 text-center font-mono text-[length:var(--size-label,14px)] uppercase text-fg-dim",children:[s("p",{role:"status",className:"tracking-[0.2em]",children:Lt}),c(A,{href:St,className:"inline-flex min-h-11 items-center tracking-[0.22em] hover:text-fg",children:[Ot," ",s("span",{className:"text-accent",children:"→"})]})]})}function Rt(e,n){const t=o=>o.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase().trim(),a=t(n);return a===""||t(e).includes(a)}function ye({typed:e,onType:n,wide:t=!1}){return c("label",{className:`flex max-w-[360px] flex-col gap-1.5${t?" w-full":""}`,children:[s("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:_t}),s("input",{type:"search",value:e,onChange:a=>n(a.target.value),autoComplete:"off",className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent"})]})}function _e({tags:e}){return s("ul",{"aria-label":"Details",className:"flex gap-1.5 overflow-hidden",children:e.map((n,t)=>s("li",{className:"shrink-0 rounded-[var(--sf-button-radius,4px)] border border-line px-2 py-0.5 text-[length:var(--size-label,12px)] text-fg-dim",children:n},`${n}-${t}`))})}function kt({card:e,scaffold:n,lower:t=!1}){return c(A,{href:e.href||"#",className:`sf-card group relative isolate flex aspect-[3/4] overflow-hidden bg-surface${t?" min-[801px]:mt-16":""}`,"aria-disabled":n||void 0,tabIndex:n?-1:void 0,children:[s("div",{className:"absolute inset-0 transition-transform duration-700 group-hover:scale-[1.03] motion-reduce:transition-none motion-reduce:group-hover:scale-100",children:s(Be,{label:`card-${e.slug}`,src:e.cover||void 0,sizes:"(max-width: 800px) 50vw, 25vw"})}),s("div",{"aria-hidden":!0,className:"absolute inset-0 z-0",style:{background:"linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--bg) 88%, transparent) 100%)"}}),e.meta&&s("span",{className:"absolute left-3 top-3 z-[1] rounded-[var(--sf-button-radius,999px)] bg-bg/85 px-2.5 py-1 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] text-accent",children:b(e.meta)}),c("div",{className:"relative z-[1] mt-auto flex w-full flex-col gap-1 p-4 max-view-wide:p-3",children:[s("h3",{className:"font-heading3 text-[length:var(--size-headingSmall,24px)] leading-[1.1] tracking-[-0.01em] text-fg",children:L(e.title,!1)}),(e.publishedAt||e.dateLabel)&&s("p",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-accent",children:e.publishedAt?s(Ye,{at:e.publishedAt}):b(e.dateLabel??"")}),e.tags&&e.tags.length>0&&s(_e,{tags:e.tags}),e.excerpt&&s("p",{className:"line-clamp-2 text-[length:var(--size-body,14px)] leading-[1.45] text-fg-dim",children:b(e.excerpt)})]})]})}function Ft({cards:e,scaffold:n}){return s("nav",{"aria-label":"Days",className:B.nav,children:s("ul",{className:B.list,children:e.map((t,a)=>{const o=!!t.meta;return s("li",{children:c(A,{href:t.href||"#","aria-current":o?"page":void 0,"aria-disabled":n||void 0,tabIndex:n?-1:void 0,className:B.tab(o),children:[s("span",{className:"font-heading3 text-[length:var(--size-body,15px)] leading-[1.2]",children:L(t.title,!1)}),t.excerpt&&s("span",{className:`font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.14em] ${o?"opacity-80":"text-fg-dim"}`,children:b(t.excerpt)})]})},`${t.slug}-${a}`)})})})}function Dt({count:e,words:n,href:t}){const a=c("span",{className:"inline-flex items-baseline gap-3",children:[s("span",{className:"font-heading text-[length:var(--size-headingLarge,64px)] leading-none text-accent",children:e}),n!==void 0&&s("span",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg",children:n})]});return t?s(A,{href:t,className:"inline-flex hover:opacity-85",children:a}):a}const q="[&>[data-sf-repeat]>*]:h-full [&>[data-sf-repeat]>*>*]:h-full",Mt="[&>[data-sf-repeat]]:h-full [&>[data-sf-repeat]>*]:h-full [&>[data-sf-repeat]>*>*]:h-full",Pt=`relative z-[2] bg-bg ${Ke}`,Ut={top:32,bottom:32};function zt(e){const{starts:n,posts:t}=Pe(nt),a=n[e.ownerId??""];if(!a)return s(Q,{...e,start:0});const o=t?.[e.ownerId??""]??e.posts,d=Vt(a);return d.length===1?s(Q,{...e,posts:o,start:d[0].start}):s(De,{children:d.map(({start:h,views:T})=>{const u=jt(T,e.viewHidden);return it(we(u))?null:s(Je.Provider,{value:Yt(u),children:s(Q,{...e,posts:o,start:h})},h)})})}function Vt(e){const n=[];for(const t of J){const a=n.find(o=>o.start===e[t]);a?a.views.push(t):n.push({start:e[t],views:[t]})}return n}const jt=(e,n)=>Object.fromEntries(J.map(t=>[t,!e.includes(t)||!!n?.[t]])),we=e=>Object.fromEntries(J.map(n=>[ot(n),e[n]])),Yt=e=>Xe(ue(e),lt(we(e)),{sectionClassName:ue(e,{atSectionLine:!0}),line:"section"});function Q({start:e,num:n,title:t,link:a,posts:o,servedCategory:d,columns:h,limit:T,showAll:u=!1,editing:S=!1,cardImage:Ce,gap:Ae,gapPhone:Le,layout:g,featuredWidth:Oe,listCover:Se=!0,featuredDarken:$e,omitHead:x=!1,sample:$,nameFilter:Ie=!1,pads:I,template:Z,ownerId:Re=""}){const[R,ee]=le(""),[te,ke]=le({}),y=ze("ev"),se=e>0?(o??[]).slice(e):o??[],ne=u?se.length:rt({limit:T}),k=se.slice(0,ne),p=S&&k.length===0;if(k.length===0&&!S){if(!$t(d))return null;const r=W(I,ce,{noTop:x,nonNegative:!0});return s(G,{as:"section",...r.attrs,className:K(x?fe:de,r),style:r.style,children:s("div",{className:H,children:s(It,{})})})}const ae=u?at:ne,f=p?$?.length?$.slice(0,u?$.length:ae):Array.from({length:ae},(r,l)=>({slug:`placeholder-${l}`,title:O("Blog post title"),excerpt:O("A short summary of the post appears here."),cover:"",meta:O("Journal"),dateLabel:O("Date")})):k,i=Ve("Events",Ae,"both",Le),w=g===he&&f.length>1,re=xt(Oe),F=g===xe,D=g===pe,oe=pt.includes(g??""),M=Ie&&!F&&!D&&!w,P=M?ft(f):[],N=M?f.filter(r=>Rt(r.title,R)&&mt(r,te)):f,_=D?W(I,Ut,{nonNegative:!0}):W(I,ce,{noTop:x,nonNegative:!0}),U=_.style,Fe=!S&&Ge(n,t,a?.text),z=(Z?.blockCount??0)>0?Nt:vt,V=g===E?z[3]:z[Math.min(4,Math.max(2,h??3))]??z[3],j=Ne[Math.min(4,Math.max(1,h??3))]??Ne[3],ie=F||w||g===E?"":We(y,oe?V:j,{cards:N.length}),Y=(r,l,m)=>s(qe,{ownerId:Re,ownerType:"Events",Template:yt(Z,w),rows:r.map(v=>be(v,p)),items:r.map(v=>bt(v,p)),fallback:l,children:v=>m(Me.toArray(v))});return D?s(G,{as:"section",..._.attrs,className:K(Pt,_),style:Object.keys(U).length?U:void 0,children:s("div",{className:H,children:s(Dt,{count:f.length,words:x||t===void 0?void 0:L(t,!1),href:x?void 0:a?.href})})}):s(G,{as:"section",..._.attrs,className:K(x?fe:de,_),style:{...He(Ce),...U},children:c("div",{className:H,children:[x||Fe?null:s(je,{num:n!==void 0?b(n):void 0,title:t!==void 0?L(t,!1):void 0,link:a?{text:b(a.text),href:a.href}:void 0}),M&&c("div",{className:"mb-6 flex flex-col gap-2",children:[P.length===0?s(ye,{typed:R,onType:ee}):c("div",{className:"flex flex-wrap items-end gap-3",children:[s(ye,{typed:R,onType:ee,wide:!0}),P.map(({label:r,values:l})=>c("label",{className:"flex min-w-[140px] flex-col gap-1.5 max-view-wide:flex-1",children:[s("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:r}),c("select",{value:te[r]??"",onChange:m=>ke(v=>({...v,[r]:m.target.value})),className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent",children:[s("option",{value:"",children:At}),l.map(m=>s("option",{value:m,children:m},m))]})]},r))]}),N.length===0&&s("p",{role:"status",className:"text-[length:var(--size-body,14px)] text-fg-dim",children:P.length===0?wt:Ct})]}),ie&&s("style",{children:ie}),F?s(Ft,{cards:f,scaffold:p}):oe?Y(N,s("div",{className:`${y} sf-card-grid grid${i.className} ${V}`,style:i.style,children:N.map((r,l)=>s(kt,{card:r,scaffold:p,lower:g===E&&l%3===1},`${r.slug}-${l}`))}),r=>s("div",{className:`${y} sf-card-grid grid${i.className} ${V} ${q}`,style:i.style,children:g===E?r.map((l,m)=>s("div",{className:`${Mt}${m%3===1?" view-wide:mt-16":""}`,children:l},m)):r})):w?Y(f,c("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-view-wide:grid-cols-1${i.className}`,style:{...i.style,"--sf-events-split":re},children:[s(C,{post:f[0],href:f[0].href,scaffold:p,layout:"cover",darken:$e??gt,darkenStyle:ht,placement:ut},`${f[0].slug}-0`),s("div",{className:`grid auto-rows-min${i.className}`,style:i.style,children:f.slice(1).map((r,l)=>s(C,{post:r,href:r.href,scaffold:p,showCover:Se},`${r.slug}-${l+1}`))})]}),r=>c("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-view-wide:grid-cols-1${i.className} ${q}`,style:{...i.style,"--sf-events-split":re},children:[r[0],s("div",{className:`grid auto-rows-min${i.className}`,style:i.style,children:r.slice(1)})]})):Y(N,s("div",{className:`${y} sf-card-grid grid${i.className} ${j}`,style:i.style,children:N.map((r,l)=>r.tags&&r.tags.length>0?c("div",{className:"flex flex-col gap-2",children:[s(C,{post:r,href:r.href,scaffold:p}),s(_e,{tags:r.tags})]},`${r.slug}-${l}`):s(C,{post:r,href:r.href,scaffold:p},`${r.slug}-${l}`))}),r=>s("div",{className:`${y} sf-card-grid grid${i.className} ${j} ${q}`,style:i.style,children:r}))]})})}export{X as EVENTS_FEATURED_WIDTH,bs as EVENTS_LAYOUTS,Es as EVENTS_LAYOUT_FALLBACK,he as EVENTS_LAYOUT_FEATURED,ve as EVENTS_LAYOUT_PORTRAIT,E as EVENTS_LAYOUT_SPREAD,xe as EVENTS_LAYOUT_TABS,pt as EVENTS_PHOTO_LAYOUTS,ct as MAX_CARD_TAGS,zt as default,ft as facetChoices,mt as matchesFacets,Rt as matchesName,Ns as readFacets,vs as readTags};
|
|
1
|
+
import{jsx as s,jsxs as c,Fragment as Ue}from"react/jsx-runtime";import{Children as ze,useContext as Ve,useState as de}from"react";import{servedWords as Ye}from"../lib/content/served-lists.js";import{TAB_PILLS as B}from"../lib/content/tab-strip.js";import{useScopeClass as je}from"../lib/use-scope-class.js";import{containerGapProps as Be}from"efficient-web-builder/format/lib/content/container-gap";import He from"efficient-web-builder/render/components/SectionHeader";import A from"efficient-web-builder/render/components/PostCard";import We from"efficient-web-builder/render/components/PostDate";import Ke from"efficient-web-builder/render/components/Placeholder";import{SiteLink as O}from"efficient-web-builder/render/lib/site-runtime";import{renderGold as T,renderHeadline as L}from"efficient-web-builder/render/components/goldPhrases";import{say as S}from"efficient-web-builder/format/lib/editor-words";import{cardImageShapeTokens as Ge}from"efficient-web-builder/format/lib/content/card-image-shape";import{SITE_COLUMN as H}from"efficient-web-builder/format/lib/content/page-width";import{fillRowCss as Je}from"../lib/sections/fill-row.js";import{FRAME_120 as fe,FRAME_ROOM_COUNT as Xe,SECTION_FRAME_INLINE as me,SECTION_FRAME_OWN_BOX as pe,framedBandPad as W,headIsEmpty as qe,withBandClasses as K}from"../lib/sections/band-padding.js";import{HideTaker as G,ViewHideContext as Qe,viewHideClaim as Ze}from"efficient-web-builder/render/components/ViewHideRoot";import{CardTemplateRows as et,useCardRow as tt}from"efficient-web-builder/render/components/CardRowContext";import{SECTION_FILL_CLASS as st}from"efficient-web-builder/format/lib/content/section-min-height";import{postPath as ue}from"efficient-web-builder/format/lib/links/page-link-rules";import{EVENTS_FEATURED_DARKEN as nt,EVENTS_FEATURED_DARKEN_STYLE as rt,EVENTS_FEATURED_PLACEMENT as at}from"../lib/content/events-featured-look.js";import{PostListStarts as ot}from"./PostListStartsProvider.js";import{useCurrentRecordOf as it}from"../lib/document/current-record.js";import{BLOG_POST_RECORD_TYPE as lt}from"../lib/content/article-body.js";import{EVENTS_DEFAULT_LIMIT as ct,EVENTS_LAYOUT_COUNT as ge,postCap as dt}from"../lib/content/post-list-continue.js";import{VIEW_TIERS as J}from"efficient-easel/screen/lib/content/view-tiers";import{hiddenKeyOf as ft}from"efficient-easel/screen/lib/content/view-hide";import{nodeHiddenEverywhere as mt,nodeViewHideWords as pt,viewHideClass as he}from"efficient-web-builder/format/lib/content/view-hide-class";const ut=4;function Cs(e){return Ye(e,ut)}function ws(e){if(!e||typeof e!="object"||Array.isArray(e))return;const n={};for(const[t,r]of Object.entries(e))if(t.trim()){if(typeof r=="string")r.trim()&&(n[t]=r.trim());else if(Array.isArray(r)){const o=r.filter(d=>typeof d=="string"&&!!d.trim()).map(d=>d.trim());o.length&&(n[t]=o)}}return Object.keys(n).length?n:void 0}function xe(e,n){const t=e.facets?.[n];return t===void 0?[]:typeof t=="string"?[t]:t}const gt=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});function ht(e){const n=[],t=new Map;for(const r of e)for(const o of Object.keys(r.facets??{})){t.has(o)||(n.push(o),t.set(o,new Set));for(const d of xe(r,o))t.get(o).add(d)}return n.map(r=>({label:r,values:[...t.get(r)].sort(gt.compare)}))}function xt(e,n){return Object.entries(n).every(([t,r])=>r===""||xe(e,t).includes(r))}const ve="featured",Ne="tabs",be="portrait",y="spread",As=[{label:"Even grid",value:"even"},{label:"Featured first",value:ve},{label:"Tabs",value:Ne},{label:"Photo cards",value:be},{label:"Staggered spread",value:y},{label:"Count",value:ge}],vt=[be,y],Os="even",X={min:2,max:11,step:1,fallback:7,unit:"of 12"},Nt=at,bt=nt,Et=rt;function Tt(e){const n=typeof e=="number"?e:Number.parseFloat(String(e??"")),t=Number.isFinite(n)?Math.min(X.max,Math.max(X.min,Math.round(n))):X.fallback;return`${t}fr ${12-t}fr`}const Ee={1:"grid-cols-1",2:"grid-cols-2 max-view-wide:grid-cols-1",3:"grid-cols-3 max-view-wide:grid-cols-1",4:"grid-cols-4 max-view-desktop:grid-cols-2 max-view-wide:grid-cols-1"},yt={2:"grid-cols-2",3:"grid-cols-3 max-view-wide:grid-cols-2",4:"grid-cols-4 max-view-desktop:grid-cols-3 max-view-wide:grid-cols-2"},_t={2:"grid-cols-2 max-view-wide:grid-cols-1",3:"grid-cols-3 max-view-wide:grid-cols-1",4:"grid-cols-4 max-view-desktop:grid-cols-3 max-view-wide:grid-cols-1"};function Te(e,n){return{key:e.slug,title:e.title??"",excerpt:e.excerpt??"",cover:e.cover??"",meta:e.meta??"",dateLabel:e.dateLabel??"",href:e.href||(n?"#":ue(e.slug))}}function Ct(e,n){return{...Te(e,n),tags:(e.tags??[]).map(t=>({label:t}))}}const ye=new WeakMap,wt={className:"hidden"},At={className:st};function _e(e,n){const t=e.blockIds[0],r=e;function o(d){const u=tt(),N=n&&u?.index===0;return s(r,{...d,cell:h=>h===t===N?At:wt})}return Object.assign(o,{blockCount:1,blockIds:e.blockIds})}function Ot(e,n){const t=e;if(typeof t!="function"||(t.blockCount??0)<2||!Array.isArray(t.blockIds))return e;let r=ye.get(t);return r||(r={lead:_e(t,!0),rest:_e(t,!1)},ye.set(t,r)),n?r.lead:r.rest}const Lt="Find by name",St="Nobody by that name.",$t="Nobody matches.",kt="Any",Rt="No posts in this category yet.",It="All posts",Ft=ue("").replace(/\/$/,"");function Pt(e){return typeof e=="string"?e.trim():""}function Dt(){return c("div",{className:"flex min-h-[40vh] flex-col items-center justify-center gap-6 text-center font-mono text-[length:var(--size-label,14px)] uppercase text-fg-dim",children:[s("p",{role:"status",className:"tracking-[0.2em]",children:Rt}),c(O,{href:Ft,className:"inline-flex min-h-11 items-center tracking-[0.22em] hover:text-fg",children:[It," ",s("span",{className:"text-accent",children:"→"})]})]})}function Mt(e,n){const t=o=>o.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase().trim(),r=t(n);return r===""||t(e).includes(r)}function Ce({typed:e,onType:n,wide:t=!1}){return c("label",{className:`flex max-w-[360px] flex-col gap-1.5${t?" w-full":""}`,children:[s("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:Lt}),s("input",{type:"search",value:e,onChange:r=>n(r.target.value),autoComplete:"off",className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent"})]})}function we({tags:e}){return s("ul",{"aria-label":"Details",className:"flex gap-1.5 overflow-hidden",children:e.map((n,t)=>s("li",{className:"shrink-0 rounded-[var(--sf-button-radius,4px)] border border-line px-2 py-0.5 text-[length:var(--size-label,12px)] text-fg-dim",children:n},`${n}-${t}`))})}function Ut({card:e,scaffold:n,lower:t=!1}){return c(O,{href:e.href||"#",className:`sf-card group relative isolate flex aspect-[3/4] overflow-hidden bg-surface${t?" min-[801px]:mt-16":""}`,"aria-disabled":n||void 0,tabIndex:n?-1:void 0,children:[s("div",{className:"absolute inset-0 transition-transform duration-700 group-hover:scale-[1.03] motion-reduce:transition-none motion-reduce:group-hover:scale-100",children:s(Ke,{label:`card-${e.slug}`,src:e.cover||void 0,sizes:"(max-width: 800px) 50vw, 25vw"})}),s("div",{"aria-hidden":!0,className:"absolute inset-0 z-0",style:{background:"linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--bg) 88%, transparent) 100%)"}}),e.meta&&s("span",{className:"absolute left-3 top-3 z-[1] rounded-[var(--sf-button-radius,999px)] bg-bg/85 px-2.5 py-1 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] text-accent",children:T(e.meta)}),c("div",{className:"relative z-[1] mt-auto flex w-full flex-col gap-1 p-4 max-view-wide:p-3",children:[s("h3",{className:"font-heading3 text-[length:var(--size-headingSmall,24px)] leading-[1.1] tracking-[-0.01em] text-fg",children:L(e.title,!1)}),(e.publishedAt||e.dateLabel)&&s("p",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-accent",children:e.publishedAt?s(We,{at:e.publishedAt}):T(e.dateLabel??"")}),e.tags&&e.tags.length>0&&s(we,{tags:e.tags}),e.excerpt&&s("p",{className:"line-clamp-2 text-[length:var(--size-body,14px)] leading-[1.45] text-fg-dim",children:T(e.excerpt)})]})]})}function zt({cards:e,scaffold:n}){return s("nav",{"aria-label":"Days",className:B.nav,children:s("ul",{className:B.list,children:e.map((t,r)=>{const o=!!t.meta;return s("li",{children:c(O,{href:t.href||"#","aria-current":o?"page":void 0,"aria-disabled":n||void 0,tabIndex:n?-1:void 0,className:B.tab(o),children:[s("span",{className:"font-heading3 text-[length:var(--size-body,15px)] leading-[1.2]",children:L(t.title,!1)}),t.excerpt&&s("span",{className:`font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.14em] ${o?"opacity-80":"text-fg-dim"}`,children:T(t.excerpt)})]})},`${t.slug}-${r}`)})})})}function Vt({count:e,words:n,href:t}){const r=c("span",{className:"inline-flex items-baseline gap-3",children:[s("span",{className:"font-heading text-[length:var(--size-headingLarge,64px)] leading-none text-accent",children:e}),n!==void 0&&s("span",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg",children:n})]});return t?s(O,{href:t,className:"inline-flex hover:opacity-85",children:r}):r}const q="[&>[data-sf-repeat]>*]:h-full [&>[data-sf-repeat]>*>*]:h-full",Yt="[&>[data-sf-repeat]]:h-full [&>[data-sf-repeat]>*]:h-full [&>[data-sf-repeat]>*>*]:h-full",jt=`relative z-[2] bg-bg ${Xe}`,Bt={top:32,bottom:32};function Ht(e){const{starts:n,posts:t}=Ve(ot),r=n[e.ownerId??""];if(!r)return s(Q,{...e,start:0});const o=t?.[e.ownerId??""]??e.posts,d=r.skipCurrentPost===!0,u=Wt(r);return u.length===1?s(Q,{...e,posts:o,start:u[0].start,skipCurrentPost:d}):s(Ue,{children:u.map(({start:N,views:h})=>{const b=Kt(h,e.viewHidden);return mt(Ae(b))?null:s(Qe.Provider,{value:Gt(b),children:s(Q,{...e,posts:o,start:N,skipCurrentPost:d})},N)})})}function Wt(e){const n=[];for(const t of J){const r=n.find(o=>o.start===e[t]);r?r.views.push(t):n.push({start:e[t],views:[t]})}return n}const Kt=(e,n)=>Object.fromEntries(J.map(t=>[t,!e.includes(t)||!!n?.[t]])),Ae=e=>Object.fromEntries(J.map(n=>[ft(n),e[n]])),Gt=e=>Ze(he(e),pt(Ae(e)),{sectionClassName:he(e,{atSectionLine:!0}),line:"section"});function Q({start:e,num:n,title:t,link:r,posts:o,servedCategory:d,columns:u,limit:N,showAll:h=!1,editing:b=!1,cardImage:Oe,gap:Le,gapPhone:Se,layout:g,featuredWidth:$e,listCover:ke=!0,featuredDarken:Re,omitHead:x=!1,sample:$,nameFilter:Ie=!1,pads:k,template:Z,ownerId:Fe="",skipCurrentPost:Pe=!1}){const[R,ee]=de(""),[te,De]=de({}),_=je("ev"),se=it(lt),ne=Pe&&se?(o??[]).filter(a=>a.slug!==se.key):o??[],re=e>0?ne.slice(e):ne,ae=h?re.length:dt({limit:N}),I=re.slice(0,ae),p=b&&I.length===0;if(I.length===0&&!b){if(!Pt(d))return null;const a=W(k,fe,{noTop:x,nonNegative:!0});return s(G,{as:"section",...a.attrs,className:K(x?pe:me,a),style:a.style,children:s("div",{className:H,children:s(Dt,{})})})}const oe=h?ct:ae,f=p?$?.length?$.slice(0,h?$.length:oe):Array.from({length:oe},(a,l)=>({slug:`placeholder-${l}`,title:S("Blog post title"),excerpt:S("A short summary of the post appears here."),cover:"",meta:S("Journal"),dateLabel:S("Date")})):I,i=Be("Events",Le,"both",Se),w=g===ve&&f.length>1,ie=Tt($e),F=g===Ne,P=g===ge,le=vt.includes(g??""),D=Ie&&!F&&!P&&!w,M=D?ht(f):[],E=D?f.filter(a=>Mt(a.title,R)&&xt(a,te)):f,C=P?W(k,Bt,{nonNegative:!0}):W(k,fe,{noTop:x,nonNegative:!0}),U=C.style,Me=!b&&qe(n,t,r?.text),z=(Z?.blockCount??0)>0?_t:yt,V=g===y?z[3]:z[Math.min(4,Math.max(2,u??3))]??z[3],Y=Ee[Math.min(4,Math.max(1,u??3))]??Ee[3],ce=F||w||g===y?"":Je(_,le?V:Y,{cards:E.length}),j=(a,l,m)=>s(et,{ownerId:Fe,ownerType:"Events",Template:Ot(Z,w),rows:a.map(v=>Te(v,p)),items:a.map(v=>Ct(v,p)),fallback:l,children:v=>m(ze.toArray(v))});return P?s(G,{as:"section",...C.attrs,className:K(jt,C),style:Object.keys(U).length?U:void 0,children:s("div",{className:H,children:s(Vt,{count:f.length,words:x||t===void 0?void 0:L(t,!1),href:x?void 0:r?.href})})}):s(G,{as:"section",...C.attrs,className:K(x?pe:me,C),style:{...Ge(Oe),...U},children:c("div",{className:H,children:[x||Me?null:s(He,{num:n!==void 0?T(n):void 0,title:t!==void 0?L(t,!1):void 0,link:r?{text:T(r.text),href:r.href}:void 0}),D&&c("div",{className:"mb-6 flex flex-col gap-2",children:[M.length===0?s(Ce,{typed:R,onType:ee}):c("div",{className:"flex flex-wrap items-end gap-3",children:[s(Ce,{typed:R,onType:ee,wide:!0}),M.map(({label:a,values:l})=>c("label",{className:"flex min-w-[140px] flex-col gap-1.5 max-view-wide:flex-1",children:[s("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:a}),c("select",{value:te[a]??"",onChange:m=>De(v=>({...v,[a]:m.target.value})),className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent",children:[s("option",{value:"",children:kt}),l.map(m=>s("option",{value:m,children:m},m))]})]},a))]}),E.length===0&&s("p",{role:"status",className:"text-[length:var(--size-body,14px)] text-fg-dim",children:M.length===0?St:$t})]}),ce&&s("style",{children:ce}),F?s(zt,{cards:f,scaffold:p}):le?j(E,s("div",{className:`${_} sf-card-grid grid${i.className} ${V}`,style:i.style,children:E.map((a,l)=>s(Ut,{card:a,scaffold:p,lower:g===y&&l%3===1},`${a.slug}-${l}`))}),a=>s("div",{className:`${_} sf-card-grid grid${i.className} ${V} ${q}`,style:i.style,children:g===y?a.map((l,m)=>s("div",{className:`${Yt}${m%3===1?" view-wide:mt-16":""}`,children:l},m)):a})):w?j(f,c("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-view-wide:grid-cols-1${i.className}`,style:{...i.style,"--sf-events-split":ie},children:[s(A,{post:f[0],href:f[0].href,scaffold:p,layout:"cover",darken:Re??bt,darkenStyle:Et,placement:Nt},`${f[0].slug}-0`),s("div",{className:`grid auto-rows-min${i.className}`,style:i.style,children:f.slice(1).map((a,l)=>s(A,{post:a,href:a.href,scaffold:p,showCover:ke},`${a.slug}-${l+1}`))})]}),a=>c("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-view-wide:grid-cols-1${i.className} ${q}`,style:{...i.style,"--sf-events-split":ie},children:[a[0],s("div",{className:`grid auto-rows-min${i.className}`,style:i.style,children:a.slice(1)})]})):j(E,s("div",{className:`${_} sf-card-grid grid${i.className} ${Y}`,style:i.style,children:E.map((a,l)=>a.tags&&a.tags.length>0?c("div",{className:"flex flex-col gap-2",children:[s(A,{post:a,href:a.href,scaffold:p}),s(we,{tags:a.tags})]},`${a.slug}-${l}`):s(A,{post:a,href:a.href,scaffold:p},`${a.slug}-${l}`))}),a=>s("div",{className:`${_} sf-card-grid grid${i.className} ${Y} ${q}`,style:i.style,children:a}))]})})}export{X as EVENTS_FEATURED_WIDTH,As as EVENTS_LAYOUTS,Os as EVENTS_LAYOUT_FALLBACK,ve as EVENTS_LAYOUT_FEATURED,be as EVENTS_LAYOUT_PORTRAIT,y as EVENTS_LAYOUT_SPREAD,Ne as EVENTS_LAYOUT_TABS,vt as EVENTS_PHOTO_LAYOUTS,ut as MAX_CARD_TAGS,Ht as default,ht as facetChoices,xt as matchesFacets,Mt as matchesName,ws as readFacets,Cs as readTags};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
2
|
-
`),b=
|
|
3
|
-
`):[]:
|
|
1
|
+
"use client";import{jsx as t,jsxs as oe}from"react/jsx-runtime";import{useCallback as R,useMemo as f,useState as M}from"react";import{usePathname as ae}from"next/navigation";import{containerGapProps as ie}from"efficient-web-builder/format/lib/content/container-gap";import de from"efficient-web-builder/render/components/Btn";import ce,{GALLERY_GRID_ATTR as me,GalleryLinksContext as pe,GalleryTilesContext as fe}from"./GalleryItem.js";import{useShopperGallery as ge}from"./catalog/ShopperScope.js";import{galleryShownIds as ye,galleryToolbarIdle as ue,WALL_PLACED_CELL as he,WALL_PLACED_CSS as we,wallSpanAt as Le}from"../lib/sections/gallery-toolbar.js";import{useSiteSells as xe}from"./SiteRecordContext.js";import{SharedPartKinds as Se}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as ve}from"efficient-web-builder/render/components/goldPhrases";import Ne from"efficient-web-builder/render/components/SectionHeader";import{FRAME_120 as Ce,framedBandPad as Ge,headIsEmpty as _e,withBandClasses as Pe}from"../lib/sections/band-padding.js";import{galleryFrame as ke,galleryTemplate as be}from"../lib/sections/gallery-frame.js";import{SITE_COLUMN as Ae}from"efficient-web-builder/format/lib/content/page-width";import{resolveGridColumns as Ie,resolveGridMobileColumns as Te}from"efficient-web-builder/format/lib/content/grid-span";import{galleryLayoutClass as Ee,galleryLayoutCss as Re,resolveGalleryLayout as Me}from"efficient-web-builder/format/lib/content/gallery-layout";import{HideTaker as Oe}from"efficient-web-builder/render/components/ViewHideRoot";function je({items:c,template:O,nodeId:j,sourced:a,num:v,title:h,linkText:N,linkHref:B,galleryHref:g="/gallery",submitHref:$="/contact",previewHover:D,display:z,displayPhone:F,styleOwner:W,layout:K,layoutPhone:U,columns:y,columnsMobile:V,gap:Y,gapPhone:q,omitHead:w=!1,pads:H,editing:C=!1}){const J=ae(),Q=xe(),X=g!==J&&(Q||g!=="/gallery"),L={layout:K,layoutPhone:U},m=Me(L),Z=!m&&y!=null&&y!=="",i=ie("GalleryB",Y,"both",q),G=m?{className:`sf-card-grid sf-gallery-zone ${Ee(L)} grid${i.className}`,style:i.style}:Z?{className:`sf-card-grid sf-grid-zone grid${i.className}`,style:{...i.style,"--sf-grid-cols":String(Ie(y)),"--sf-grid-cols-phone":String(Te(V,y))}}:{className:`sf-card-grid grid grid-cols-4${i.className} max-[1500px]:grid-cols-3 max-view-wide:grid-cols-1`,style:i.style},_=N?{text:N,href:B||"#"}:void 0,ee=h?ve(h,!1):void 0,[P,le]=M({}),k=R((e,s)=>{le(l=>{const o=l[e.id];if(s){if(!o)return l;const{[e.id]:Be,...ne}=l;return ne}return o&&o.tag===e.tag&&o.name===e.name?l:{...l,[e.id]:e}})},[]),u=a?.map(e=>e.tile.id).join(`
|
|
2
|
+
`),b=f(()=>u!==void 0?u?u.split(`
|
|
3
|
+
`):[]:c?.blockIds,[u,c?.blockIds]),d=f(()=>(b??[]).map(e=>P[e]).filter(e=>!!e),[b,P]),{ref:se,toolbar:p}=ge(d),A=p!==null&&!ue(p,d),r=f(()=>A&&p?ye(d,p):null,[A,p,d]),n=f(()=>r??d.map(e=>e.id),[r,d]),[I,te]=M(null),T=R((e,s)=>{const l=n.indexOf(e);l<0||n.length<2||te({id:n[(l+s+n.length)%n.length],at:s>0?"first":"last"})},[n]),re=f(()=>{const e=new Map((r??[]).map((s,l)=>[s,l]));return{report:k,positionOf:s=>{const l=r?e.get(s):void 0;return l===void 0?null:{index:l+1,total:r.length}},walkCount:n.length,walk:T,opening:I}},[k,r,n.length,T,I]),x=r?e=>{const s=r.indexOf(e);if(s<0)return{style:{display:"none"}};if(!m)return{style:{order:s}};const l=Le(m,s,r.length);return{className:he,style:{order:s,"--sf-wall-c":l.col,"--sf-wall-r":l.row,"--sf-wall-cp":l.colPhone,"--sf-wall-rp":l.rowPhone}}}:void 0,S=Ge(H,Ce,{noTop:w,nonNegative:!0}),E=be(O,!a);return t(Oe,{as:"section",ref:se,...S.attrs,className:Pe(ke(w,!!E),S),style:S.style,children:oe("div",{className:Ae,children:[w||!C&&_e(v,h,_?.text)?null:t(Ne,{num:v,title:ee,link:_}),m&&t("style",{dangerouslySetInnerHTML:{__html:Re(L)+(r?we:"")}}),(c||a)&&t(pe.Provider,{value:{galleryHref:g,submitHref:$,previewHover:D,display:z,displayPhone:F,styleOwner:W,wordsAtRest:!!a,ownerId:j,Template:E},children:t(fe.Provider,{value:re,children:t(Se,{children:t("div",{[me]:"",style:{display:"contents"},children:a?t("div",{...G,children:a.map(({tile:e,...s})=>{const l=t(ce,{...s,tile:e,editing:C},e.id),o=x?.(e.id);return o?t("div",{className:o.className,style:o.style,children:l},e.id):l})}):c?t(c,{...G,minEmptyHeight:320,...x?{cell:x}:{}}):null})})})}),X&&t("div",{className:"mt-12 flex flex-col items-center gap-3",children:t(de,{href:g,variant:"ghost",children:"See Gallery"})})]})})}export{je as default};
|
|
@@ -32,6 +32,12 @@ export declare const GALLERY_TILE_PARTS: readonly [{
|
|
|
32
32
|
export declare const GalleryTilesContext: import("react").Context<{
|
|
33
33
|
report: (tile: GalleryTile, gone?: boolean) => void;
|
|
34
34
|
positionOf: (id: string) => TilePosition | null;
|
|
35
|
+
walkCount: number;
|
|
36
|
+
walk: (fromId: string, dir: 1 | -1) => void;
|
|
37
|
+
opening: {
|
|
38
|
+
id: string;
|
|
39
|
+
at: "first" | "last";
|
|
40
|
+
} | null;
|
|
35
41
|
} | null>;
|
|
36
42
|
export declare const GALLERY_GRID_ATTR = "data-gallery-grid";
|
|
37
43
|
export declare const GALLERY_TILE_ATTR = "data-gallery-tile";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as n,Fragment as
|
|
1
|
+
"use client";import{jsx as r,jsxs as n,Fragment as x}from"react/jsx-runtime";import{createContext as V,useCallback as le,useContext as X,useEffect as q,useRef as ae,useState as P}from"react";import z from"next/link";import{slugify as se}from"efficient-shell/format";import{CardTemplateRows as ie}from"efficient-web-builder/render/components/CardRowContext";import{BOX_HOLDS_NO_GUTTER_CLASS as ce}from"efficient-web-builder/format/lib/content/page-width";import pe,{galleryTileNumber as de}from"./GalleryCard.js";import me,{LightboxClose as fe,LIGHTBOX_CLOSE_TINT as he}from"./Lightbox.js";import{useSiteSells as xe}from"./SiteRecordContext.js";import{renderGold as f,renderHeadline as Z}from"efficient-web-builder/render/components/goldPhrases";import{sizedImage as ue}from"efficient-web-builder/format/lib/sized-image";import{useBrowserLayoutEffect as ge}from"efficient-shell/hooks";import{HideTaker as J}from"efficient-web-builder/render/components/ViewHideRoot";const be="(max-width: 1100px) 100vw, min(59vw, 1050px)",ve=V({}),Ye=[{id:"tag",label:"Tag"},{id:"eyebrow",label:"Eyebrow"},{id:"title",label:"Title"},{id:"meta",label:"Meta"},{id:"number",label:"Card number"}],we=V(null),ye="data-gallery-grid",I="data-gallery-tile";function ke(t,o){const[a,i]=P(null);return q(()=>{const c=t.current,s=c?.closest(`[${ye}]`);if(!c||!s)return;const w=()=>{const k=Array.from(s.querySelectorAll(`[${I}]`)),N=k.indexOf(c),u=N>=0?{index:N+1,total:k.length}:null;i(g=>g?.index===u?.index&&g?.total===u?.total?g:u)};if(w(),!o)return;const y=new MutationObserver(w);return y.observe(s,{childList:!0,subtree:!0}),()=>y.disconnect()},[t,o]),a}const De={process:"Category",eyebrow:"Subtitle",name:"Item name",meta:"Detail"},Ne=()=>({image:"",href:"#",process:"",eyebrow:"",name:"",meta:""}),We=Array.from({length:6},Ne);function Se(t){const o=(t.photos??[]).map(s=>s?.src).filter(s=>!!s),a=t.image||o[0]||"",i=[a,...o].filter(s=>!!s),c=se(t.name)||"gallery-item";return{car:t.eyebrow??"",wheel:t.name??"",process:t.process??"",finish:t.meta??"",imageLabel:`${c}.jpg`,detailLabel:`${c}-detail.jpg`,imageSrc:a||void 0,detailSrc:o[0]||a||void 0,photos:i,href:t.href}}function Le({editing:t=!1,previewHover:o,ratio:a,captionPlace:i,tile:c,...s}){const{galleryHref:w="/gallery",submitHref:y="/contact",previewHover:k,display:N,displayPhone:u,styleOwner:g,photosOnly:ee=!1,wordsAtRest:te=!1,Template:j,ownerId:re}=X(ve),e=Se(s),b=xe()&&!ee,A=!b&&!Te(e),p=e.photos??(e.imageSrc?[e.imageSrc]:[]),G=ae(null),H=le(l=>{G.current=l},[]),oe=ke(G,t),h=X(we),S=h?.report,d=c?.id,R=c?.tag??"",$=c?.name??"";ge(()=>{if(!S||!d)return;const l={id:d,tag:R,name:$};return S(l),()=>S(l,!0)},[S,d,R,$]);const v=(d?h?.positionOf(d):null)??oe,B=t&&(!!o||!!k),[ne,m]=P(!1),[L,C]=P(0),M=!!d&&!!h&&h.walkCount>1,Y=l=>{const E=L+l;if(M&&(E<0||E>=p.length)){m(!1),h.walk(d,l);return}C((E+p.length)%p.length)},D=()=>Y(-1),W=()=>Y(1),_=p.length>1||M,T=h?.opening;q(()=>{!T||T.id!==d||(C(T.at==="last"?Math.max(0,p.length-1):0),m(!0))},[T,d]);const O=p[L]??e.imageSrc??"",F=p.slice(1),U=j?r("div",{className:`block w-full min-w-0 ${ce}`,children:r(ie,{ownerId:re??"GalleryB",ownerType:"GalleryB",Template:j,rows:[{key:d??e.imageSrc??"tile",image:e.imageSrc??"",tag:e.process,number:v?de(v.index,v.total):"",eyebrow:e.car,name:e.wheel,meta:e.finish,href:e.href??""}],items:[{hoverMedia:F.length?{photos:[{finish:"",items:F.map(l=>({url:l,kind:"image"}))}]}:null}],previewHover:B,fallback:null,children:l=>l})}):r(pe,{build:e,forceHover:B,alwaysShowOverlay:te,index:v?.index,total:v?.total,ratio:a,captionPlace:i,display:N,displayPhone:u,styleOwner:g,editing:t});return n(x,{children:[t?r(J,{as:"div",ref:H,[I]:"",className:"block w-full text-left",children:U}):r(J,{as:"button",ref:H,[I]:"",type:"button","aria-label":b?`Open ${e.car||"build"} on ${e.wheel||"wheel"}`:Q(e),onClick:()=>{C(0),m(!0)},className:"block w-full cursor-pointer text-left focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",children:U}),r(me,{open:ne,onClose:()=>m(!1),label:b?`${e.car} on ${e.wheel}`:Q(e),onPrev:_?D:void 0,onNext:_?W:void 0,className:"flex items-center justify-center p-6 max-[700px]:p-3",children:n("div",{onClick:l=>l.stopPropagation(),className:`relative grid w-[min(1800px,100%)] max-h-[calc(100vh-48px)] ${A?"grid-cols-1":"grid-cols-[1.4fr_1fr]"} overflow-hidden border border-line bg-bg max-view-desktop:grid-cols-1 max-view-desktop:overflow-auto`,style:{boxShadow:"0 60px 120px -20px color-mix(in srgb, var(--sf-shadow-color, #141416) 70%, transparent)"},children:[r(fe,{label:"Close popup",className:"absolute right-[24px] top-[24px] z-[5] flex h-[56px] w-[56px] items-center justify-center border border-line font-mono text-[length:var(--size-label,21px)] text-fg-dim transition-colors hover:border-accent hover:text-fg",style:{background:he},children:"✕"}),n("div",{className:"relative flex min-h-[690px] items-center justify-center overflow-hidden bg-surface-2 max-view-desktop:min-h-[450px]",children:[O&&r("img",{...ue(O,{fallbackWidth:1280}),sizes:be,alt:`${(b?e.car:e.wheel||e.car)||"Photo"} — ${L+1} of ${p.length}`,className:"block h-full max-h-[88vh] w-full object-cover"},O),_&&n(x,{children:[r("button",{type:"button","aria-label":"Previous photo",onClick:D,className:"absolute left-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"◁"}),r("button",{type:"button","aria-label":"Next photo",onClick:W,className:"absolute right-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"▷"}),p.length>1&&n("span",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 border border-fg-dim/30 bg-overlay-scrim/50 px-4 py-1.5 font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em] text-fg-dim backdrop-blur-[4px]",children:[L+1," / ",p.length]})]})]}),b?n("div",{className:"flex flex-col gap-[30px] px-[60px] py-[72px] max-view-desktop:px-9 max-view-desktop:py-[54px]",children:[e.process&&r("span",{className:"font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.3em] text-accent",children:f(e.process)}),e.wheel&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:Z(e.wheel,!1)}),e.car&&n("div",{className:"font-heading3 text-[length:var(--size-headingSmall,27px)] leading-[1.4] text-fg",children:["on ",r("em",{className:"font-serif font-normal italic text-accent tracking-[-0.01em]",children:f(e.car,!0)})]}),n("dl",{className:"mt-3 grid grid-cols-[auto_1fr] gap-x-7 gap-y-[18px] border-y border-line py-[30px] font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em]",children:[e.wheel&&n(x,{children:[r("dt",{className:"text-fg-dim",children:"Wheel"}),r("dd",{className:"text-fg",children:f(e.wheel)})]}),e.process&&n(x,{children:[r("dt",{className:"text-fg-dim",children:"Process"}),r("dd",{className:"text-fg",children:f(e.process)})]}),e.finish&&n(x,{children:[r("dt",{className:"text-fg-dim",children:"Finish"}),r("dd",{className:"text-fg",children:f(e.finish)})]}),e.car&&n(x,{children:[r("dt",{className:"text-fg-dim",children:"Vehicle"}),r("dd",{className:"text-fg",children:f(e.car)})]})]}),n("div",{className:"mt-auto flex flex-col gap-3.5 pt-6",children:[n(z,{href:e.href||"/wheels",onClick:()=>m(!1),className:"group flex items-center justify-between gap-6 border border-btn bg-btn px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-btn-ink transition-colors hover:border-fg hover:bg-fg",children:[r("span",{children:"View product"}),r("span",{className:"transition-transform group-hover:translate-x-[6px]",children:"→"})]}),n(z,{href:w,onClick:()=>m(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"See more builds"}),r("span",{children:"→"})]}),n(z,{href:y,onClick:()=>m(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"Submit your build"}),r("span",{children:"→"})]})]})]}):!A&&r(Ce,{build:e})]})})]})}function K(t){return[t.process,t.car,t.finish].filter((o,a,i)=>!!o&&o!==t.wheel&&i.indexOf(o)===a)}function Te(t){return!!t.wheel||K(t).length>0}function Q(t){const o=t.wheel||t.car;return o?`Open photo of ${o}`:"Open photo"}function Ce({build:t}){const o=t.wheel,a=K(t);return n("div",{className:"flex flex-col gap-[24px] px-[60px] py-[72px] max-view-desktop:px-9 max-view-desktop:py-[54px]",children:[o&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:Z(o,!1)}),a.map(i=>r("p",{className:"text-[length:var(--size-body,18px)] leading-[1.5] text-fg",children:f(i)},i))]})}export{ye as GALLERY_GRID_ATTR,De as GALLERY_ITEM_HINTS,We as GALLERY_ITEM_SEEDS,I as GALLERY_TILE_ATTR,Ye as GALLERY_TILE_PARTS,ve as GalleryLinksContext,we as GalleryTilesContext,Le as default};
|
|
@@ -7,6 +7,7 @@ interface HeroArrangement extends HeroTemplateProps {
|
|
|
7
7
|
imageRatio?: number;
|
|
8
8
|
textAlign?: HeroTextAlign;
|
|
9
9
|
showSpecTable?: boolean;
|
|
10
|
+
stickyColumns?: boolean;
|
|
10
11
|
}
|
|
11
12
|
export default function LinkedProductHero({ slug, kind, editing, showVehicleFitment, initialRecord, ...arrangement }: {
|
|
12
13
|
slug: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CSSProperties } from "react";
|
|
2
2
|
import { type HeroView } from "./product-hero/hero-view.js";
|
|
3
3
|
import type { StoreProduct } from "../lib/catalog/store-product.js";
|
|
4
4
|
import { type HeroGalleryMode, type HeroImageFit } from "../lib/sections/hero-gallery.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as n,Fragment as x,jsxs as h}from"react/jsx-runtime";import{useRef as v}from"react";import{photoLabel as g}from"./product-hero/hero-view.js";import{stageControls as H,useHeldStagePhoto as E}from"./product-hero/stage-photo.js";import{DEFAULT_HERO_GALLERY_MODE as M,DEFAULT_HERO_IMAGE_FIT as $,parseHeroGalleryMode as z,parseHeroImageFit as A,resolveHeroImageFit as F}from"../lib/sections/hero-gallery.js";import{productHasComposedRender as R}from"../lib/wheels/set-mode.js";import{HideTaker as _}from"efficient-web-builder/render/components/ViewHideRoot";import{swipeEnabled as O,swipeStep as P}from"efficient-web-builder/format/lib/hero-swipe";function B({product:a,view:e,angleIdx:l,onSelect:m,isLight:o,onLightbox:r,galleryMode:i=M,imageFit:p=$,style:t,takesViewHide:c=!1}){const s=z(i),u=F(A(p),R(a)),f=n(V,{name:a.name,view:e,angleIdx:l,onSelect:m,isLight:o,onLightbox:r,fit:u});return s==="stacked"?n(_,{as:"div",takes:c,"data-hero-gallery":s,"data-hero-fit":u,style:t,children:e.photos.length<2?f:h(x,{children:[n(w,{name:a.name,view:e,isLight:o,onLightbox:r,fit:u}),n(G,{angleIdx:l,total:y(e),onSelect:m,children:f})]})}):h(_,{as:"div",takes:c,"data-hero-gallery":s,"data-hero-fit":u,className:s==="tiled"?"flex items-start gap-3 max-view-tablet:gap-2":void 0,style:t,children:[n("div",{className:s==="tiled"?"min-w-0 flex-1":void 0,children:f}),s!=="main"&&n(D,{name:a.name,view:e,angleIdx:l,onSelect:m,isLight:o,tiled:s==="tiled"})]})}function y(a){return a.photos.length>0?a.photos.length:a.thumbFallbackCells}const j="relative flex aspect-square items-center justify-center overflow-hidden",C=(a,e,l)=>[a,e.metaValue,l].filter(Boolean).join(" — "),k=(a,e)=>`Open ${[a,e.metaValue].filter(Boolean).join(" ")} at full resolution`;function w({name:a,view:e,isLight:l,onLightbox:m,fit:o}){return n("div",{"data-hero-stack":!0,className:"flex flex-col gap-2 max-view-tablet:hidden",children:e.photos.map((r,i)=>{const p=C(a,e,g(e,i));return n("div",{"data-hero-stack-photo":!0,className:[j,l?"bg-bg":""].join(" "),style:{color:e.tint},children:e.stageImage({photo:r,alt:p,label:k(a,e),onZoom:()=>m(r,p),fit:o,eager:i===0})},r)})})}function G({angleIdx:a,total:e,onSelect:l,children:m}){const o=v(null),r=v(null),i=O({count:e}),p=t=>({x:t.touches[0].clientX,y:t.touches[0].clientY});return n("div",{"data-hero-phone-stage":!0,className:"view-tablet:hidden",onTouchStart:t=>{o.current=i&&t.touches.length===1?p(t):null,r.current=o.current},onTouchMove:t=>{o.current&&(t.touches.length!==1?o.current=null:r.current=p(t))},onTouchEnd:()=>{const t=o.current,c=r.current;if(o.current=null,r.current=null,!t||!c)return;const s=P(c.x-t.x,c.y-t.y,a,e);s!==a&&l(s)},children:m})}const I=6;function V({name:a,view:e,angleIdx:l,onSelect:m,isLight:o,onLightbox:r,fit:i}){const p=e.photos[Math.min(l,e.photos.length-1)],t=E(e.photos,p),c=y(e),s=c>=2,u=String(c).padStart(2,"0"),f=Math.min(l,Math.max(e.photos.length-1,0)),L=s||e.captions[f]?g(e,f):"",N=C(a,e,L),b="max-view-tablet:static",S=[`${j} max-view-tablet:col-span-2`,o?"bg-bg":""].join(" ");return h("div",{className:"relative max-view-tablet:grid max-view-tablet:grid-cols-[minmax(0,1fr)_auto] max-view-tablet:items-start max-view-tablet:gap-x-3 max-view-tablet:gap-y-2",style:{color:e.tint},children:[h("div",{className:`absolute left-0 top-0 z-10 flex items-center gap-3 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.2em] text-fg ${b} max-view-tablet:min-w-0 max-view-tablet:flex-wrap max-view-tablet:gap-x-2 max-view-tablet:gap-y-1`,children:[s&&h(x,{children:[h("span",{className:"text-accent",children:[String(l+1).padStart(2,"0")," / ",u]}),n("span",{className:"text-fg-dim",children:"·"})]}),n("span",{children:a}),e.metaValue&&h(x,{children:[n("span",{className:"text-fg-dim",children:"·"}),n("span",{className:"text-accent",children:e.metaValue})]})]}),s&&n("div",{className:`absolute right-5 top-5 z-10 flex gap-1 ${b}`,children:H(l,c,m).map(d=>n("button",{type:"button","aria-label":d.label,title:d.label,onClick:d.onClick,className:"flex h-7 w-7 items-center justify-center border border-fg-dim/60 text-fg transition-colors hover:border-accent hover:text-accent",children:d.glyph},d.label))}),h("div",{className:S,children:[["top-3 left-3","top-3 right-3","bottom-3 left-3","bottom-3 right-3"].map((d,T)=>n("span",{className:`absolute ${d} h-3 w-3 border border-fg-dim/40`,style:{borderTop:d.includes("top")?"1px solid var(--site-line)":"none",borderBottom:d.includes("bottom")?"1px solid var(--site-line)":"none",borderLeft:d.includes("left")?"1px solid var(--site-line)":"none",borderRight:d.includes("right")?"1px solid var(--site-line)":"none"}},T)),e.stageImage({photo:t,alt:N,label:k(a,e),onZoom:()=>r(t,N),fit:i})]}),h("div",{className:`absolute bottom-0 left-0 right-0 z-10 flex items-end justify-between gap-3 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim ${b} max-view-tablet:col-span-2 max-view-tablet:flex-wrap`,children:[h("span",{className:"flex min-w-0 flex-col gap-1",children:[e.specCaption&&n("span",{children:e.specCaption}),e.referenceNote&&n("span",{"data-hero-reference-note":!0,children:e.referenceNote}),e.galleryHint&&n("span",{"data-hero-gallery-hint":!0,children:e.galleryHint})]}),n("span",{children:e.originCaption})]})]})}function D({name:a,view:e,angleIdx:l,onSelect:m,isLight:o,tiled:r=!1}){const i=y(e);return i<2?null:n("div",{className:r?"order-[-1] flex w-16 flex-col gap-2 max-view-tablet:w-12 max-view-tablet:gap-1":"mt-2 grid grid-cols-4 gap-2 max-view-tablet:gap-1",style:!r&&i>4?{gridTemplateColumns:`repeat(${Math.min(i,I)}, minmax(0, 1fr))`}:void 0,children:Array.from({length:i}).map((p,t)=>{const c=e.photos[t];return h("button",{type:"button",onClick:()=>m(t),"aria-label":`View ${g(e,t)}`,"aria-pressed":t===l,className:["relative flex aspect-square items-center justify-center overflow-hidden transition-colors",o?"bg-bg":"",t===l?"border border-accent":"border border-transparent hover:border-fg-dim"].join(" "),style:{color:e.tint},children:[n("span",{className:"absolute top-1.5 left-2 z-10 font-mono text-[length:var(--size-label,8px)] uppercase tracking-[0.18em] text-fg-dim",children:String(t+1).padStart(2,"0")}),e.thumbImage({photo:c,alt:`${a} — ${g(e,t)}`})]},t)})})}export{B as default};
|
|
@@ -20,6 +20,7 @@ interface Props extends HeroTemplateProps {
|
|
|
20
20
|
imageRatio?: number;
|
|
21
21
|
textAlign?: HeroTextAlign;
|
|
22
22
|
showSpecTable?: boolean;
|
|
23
|
+
stickyColumns?: boolean;
|
|
23
24
|
}
|
|
24
|
-
export default function ProductHeroPanel({ product, selection, onLightbox, editing, showVehicleFitment, heroLayout, imageRatio, textAlign, showSpecTable, nodeId, template, optionTemplate, optionPressTitles, buyTemplate, }: Props): import("react").JSX.Element;
|
|
25
|
+
export default function ProductHeroPanel({ product, selection, onLightbox, editing, showVehicleFitment, heroLayout, imageRatio, textAlign, showSpecTable, stickyColumns, nodeId, template, optionTemplate, optionPressTitles, buyTemplate, }: Props): import("react").JSX.Element;
|
|
25
26
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,Fragment as g,jsxs as c}from"react/jsx-runtime";import J from"next/link";import{useEffect as Z,useRef as Re,useState as Ee}from"react";import{useCart as Ae}from"./CartContext.js";import{useSiteTakesOrders as Le}from"./SiteRecordContext.js";import Ce from"./EmailCaptureForm.js";import{useEnglish as ee}from"./EnglishVariant.js";import{MarkedLabel as te,heroView as Pe}from"./product-hero/hero-view.js";import{useRootIsDark as Ie}from"efficient-shell/theme";import{useStockAlertSignup as $e}from"./useStockAlertSignup.js";import{SPARE_WORDS as He,productCartLine as Me}from"../lib/catalog/purchase.js";import{OPTION_ROW_ATTR as je}from"../lib/catalog/store-product.js";import{resolvingRowsAnswered as ze}from"../lib/catalog/product-options.js";import{trackViewItem as De}from"../lib/google-tag.js";import{DEFAULT_HERO_LAYOUT as Ue,DEFAULT_HERO_RATIO as Be,DEFAULT_HERO_TEXT_ALIGN as Ve,parseHeroLayout as Fe,parseHeroRatio as Qe,parseHeroTextAlign as Ye}from"../lib/sections/hero-arrangement.js";import{MAX_SPARES as Ke,UNITS_PER_SET as ae,formatPrice as le}from"../lib/commerce.js";import{formatSelectionPrice as We,setPriceLabel as Xe}from"../lib/wheels/price-display.js";import{productIsDually as Ge,productIsTwoObjects as qe,setSuppressesRow as Je}from"../lib/wheels/set-mode.js";import{CONTENT_CAP_GUTTER as ne}from"../lib/sections/content-cap-gutter.js";import{BLOCK_ALIGN_TEXT as Ze}from"efficient-web-builder/format/lib/content/block-align";import{CardTemplateRows as C}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as P}from"efficient-web-builder/render/components/SiteGutterFrame";import{cardRow as et}from"efficient-web-builder/format/lib/content/card-template";import{optionCardRows as tt}from"../lib/sections/filter-option-rows.js";import{HERO_OPTION_SLOT as at}from"../lib/content/hero-option-seed.js";import{HERO_BUY_SLOT as lt,HERO_QUANTITY_PART as nt,HERO_SAVE_PART as rt}from"../lib/content/hero-buy-seed.js";import{HERO_PART as f}from"../lib/content/hero-seed.js";import st from"./card-pieces/CardQuantity.js";import it from"./card-pieces/CardSave.js";import ot from"./card-pieces/CardStatedFacts.js";import{HeroStateProvider as ct}from"./card-pieces/ProductCardState.js";import{PRODUCT_HERO_TYPE as I}from"../lib/document/document-nodes.js";const mt=4e3;function pt(e){return e?[e.year,e.make,e.model,e.modification].join("-"):""}const re=[{}],dt=(e,r)=>r===nt?t(st,{}):r===rt?t(it,{}):null,ut="[&>[data-sf-repeat]]:contents [&>[data-sf-repeat]>div]:contents";function ft({product:e,selection:r,onLightbox:o,editing:s=!1,showVehicleFitment:i=!0,heroLayout:l=Ue,imageRatio:n=Be,textAlign:y=Ve,showSpecTable:ie=!0,nodeId:w,template:oe,optionTemplate:ce,optionPressTitles:me,buyTemplate:pe}){const de=ee(),v=Fe(l),$=Ye(y),k=Qe(n),ue=v==="imageRight"?`${100-k}fr ${k}fr`:`${k}fr ${100-k}fr`,{picked:fe,pick:H,qty:M,setQty:he,choice:j,setChoice:be,angleIdx:gt,setAngleIdx:xt,showValidation:ge,setShowValidation:S,manualMode:z,vehicle:N,rows:D,facts:xe,part:d,outOfStock:U,offer:B,preOrder:_,canAddToCart:V,currency:h,price:p,set:F,msrpLabel:ve}=r,m=Pe(e,r,s),O=Ge(e),ke=qe(e),R=i?m.vehicle:null,Te=i?m.vehicleMemory:null,Q=!Ie({whenUnset:!0}),{warmCatalog:Y}=Ae(),T=Le();Z(()=>{!s&&T&&Y(e.kind,e.slug)},[s,T,e.kind,e.slug,Y]);const K=D.filter(a=>!_||a.values.length>0),W=K.filter(a=>a.role==="resolves"),E=K.filter(a=>a.role==="describes"&&!Je(ke,a.key)),X=E.findIndex(a=>a.chosen===null),G=(!R||!m.vehicleAnswersSpecs||r.fitmentSet)&&ze(D,_)?X===-1?E:E.slice(0,X+1):[],ye=[...W,...G];function we(){return V?(S(!1),s?null:Me(e,d,fe,{choice:j,qty:M},{fitmentLabel:z?m.specCaption:N.appliedName?`For ${N.appliedName}`:"",fitmentKey:z?`manual|${m.specCaption}`:`vehicle|${pt(N.applied?.vehicle)}`})):(S(!0),window.setTimeout(()=>S(!1),mt),null)}const Se={kind:"hero",msrpLabel:ve||null,amount:O?Xe(p,h):We(p,h),unitLabel:p.priced?m.unitLabel:null,packBadge:p.setTotal!=null?`${B.quantityLabel}: ${le(F,h)}`:null,buy:{isSet:O,priced:p.priced,outOfStock:U,canAdd:V,totalLabel:p.setTotal!=null?le(F,h):null,lineToAdd:we},qty:M,setQty:he,takesQty:T&&!(O&&!p.priced),save:{slug:e.slug,name:e.name},facts:ie?xe:null,title:{eyebrow:e.eyebrow,name:m.heading,badge:e.badge||null},product:e,selection:r,openLightbox:o},A={nodeId:w??"",template:ce,pressTitles:me,editing:s},u=!!(_&&m.preOrder),Ne={[f.fitmentLine]:Te,[f.options]:c(g,{children:[W.map(a=>t(se,{row:a,onPick:H,options:A},a.key)),!u&&R,!u&&G.map(a=>t(se,{row:a,onPick:H,options:A},a.key))]}),[f.facts]:u?null:t(ot,{}),[f.howMany]:u?null:t(ht,{offer:B,takesOrders:T,choice:j,setChoice:be,options:A}),[f.buy]:u?m.preOrder:t(P,{children:t(C,{ownerId:w??"",ownerType:I,slot:lt,Template:pe,rows:re,fallback:null,hostParts:dt,children:a=>a})}),[f.notify]:!u&&U&&d?t(bt,{partNumbers:d.components.map(a=>a.partNumber),productSlug:e.slug},d.id):null,[f.reminder]:!u&&ge?Oe():null},_e=(a,b)=>Ne[b]??null;function Oe(){const a=ye.filter(L=>L.chosen===null).map(L=>de(L.prompt).replace(/^Select\s+/i,""));if(R&&m.vehicleAnswersSpecs&&!r.fitmentSet&&a.push("vehicle fitment"),a.length===0)return null;const b=a.length===1?a[0]:a.length===2?`${a[0]} and ${a[1]}`:`${a.slice(0,-1).join(", ")}, and ${a.at(-1)}`;return c("p",{role:"alert",className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em]",style:{color:"var(--alert)"},children:["Please select ",b," first."]})}const q=Re(null);return Z(()=>{s||q.current===e.slug||(q.current=e.slug,De({itemId:d?`${e.slug}|${d.id}`:e.slug,itemName:e.name,variant:m.metaValue,pricePerSet:p.setTotal??p.fromSetTotal??0,currency:h}))},[s,e.slug,e.name,m.metaValue,d,p,h]),c(g,{children:[t("nav",{className:`border-b border-line ${ne} pt-4 pb-4 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]`,style:Q?void 0:{background:"var(--section-bg)"},children:e.crumbs.map((a,b)=>c("span",{children:[b>0&&c(g,{children:[t("span",{className:"mx-3 text-accent",children:"/"}),t("wbr",{})]}),a.href?t(J,{href:a.href,className:"hover:text-fg",children:t(te,{text:a.label})}):t("span",{className:"text-fg",children:t(te,{text:a.label})})]},`${a.label}-${b}`))}),t("section",{"data-hero-layout":v,"data-hero-align":$,className:[`grid gap-10 ${ne} py-14 max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))] max-view-tablet:py-8 ${ut}`,$==="center"?Ze.center:"",v==="stacked"?"grid-cols-1":"[grid-template-columns:var(--hero-cols)] max-view-desktop:[grid-template-columns:minmax(0,1fr)]"].filter(Boolean).join(" "),style:{...Q?{}:{background:"var(--section-bg)"},...v==="stacked"?{}:{"--hero-cols":ue}},children:t(ct,{value:Se,children:t(P,{children:t(C,{ownerId:w??"",ownerType:I,Template:oe,rows:re,fallback:null,hostParts:_e,children:a=>a})})})})]})}function ht({offer:e,takesOrders:r,choice:o,setChoice:s,options:i}){return e.packs.length>0||r&&(e.extra||e.spareCounts.length>0)?c("div",{className:"border-b border-line pb-[26px]",children:[e.packs.length>0&&c(g,{children:[t("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:"How many"}),t("div",{className:"flex flex-wrap gap-1.5",children:t(x,{hero:i,values:e.packs,item:l=>({label:l.label}),picked:l=>o.unit===l.value,press:l=>()=>s(n=>({...n,unit:l.value}))})})]}),r&&e.extra&&c("label",{className:`${e.packs.length>0?"mt-3.5 ":""}flex cursor-pointer items-center gap-3 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-fg`,children:[t("input",{type:"checkbox",checked:o.spares>0,onChange:l=>s(n=>({...n,spares:l.target.checked?Ke:0})),className:"h-4 w-4 cursor-pointer accent-[var(--accent)]"}),e.extra.label]}),r&&e.spareCounts.length>0&&c(g,{children:[t("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:He.howMany}),t("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:flex-wrap",children:t(x,{hero:i,values:e.spareCounts,item:l=>({label:`${l.value} · ${l.label}`}),picked:l=>o.spares===l.value-ae,press:l=>()=>s(n=>({...n,spares:l.value-ae}))})})]}),r&&e.spareSide&&c(g,{children:[t("div",{className:"mb-3.5 mt-[26px] font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:e.spareSide.label}),t("div",{className:"flex flex-wrap gap-1.5",children:t(x,{hero:i,values:e.spareSide.options,item:l=>({label:l.label}),picked:l=>o.spareSide===l.value,press:l=>()=>s(n=>({...n,spareSide:l.value}))})})]})]}):null}function se({row:e,onPick:r,options:o}){const s=ee();if(e.values.length===0&&!e.empty)return null;const i=e.values.find(n=>n.value===e.chosen),l=i&&[i.label,i.note].filter(Boolean).join(" · ");return c("div",{className:"border-b border-line pb-[26px]",[je]:e.key,children:[c("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:[s(e.label)," · ",t("span",{className:"text-accent",children:l??s(e.prompt)})]}),e.values.length===0?c("p",{className:"font-mono text-[length:var(--size-body,12px)] leading-relaxed tracking-[0.1em] text-fg-dim",children:[e.empty.text," ",t(J,{href:e.empty.href,className:"text-accent hover:underline",children:e.empty.linkText})]}):e.display==="swatch"?t("div",{className:"flex flex-wrap gap-2 [&>*]:max-w-full",children:t(x,{hero:o,values:e.values,item:n=>({swatch:n.swatch??"",name:n.label}),picked:n=>n.value===e.chosen,press:n=>()=>r(e.key,n.value)})}):t("div",{className:"flex flex-wrap gap-1.5",children:t(x,{hero:o,values:e.values,item:n=>({label:n.label,note:n.note??""}),picked:n=>n.value===e.chosen,press:n=>()=>r(e.key,n.value)})})]})}function x({hero:e,values:r,item:o,picked:s,press:i}){const l=tt(r,{item:o,selected:s,press:i});return t(P,{children:t(C,{ownerId:e.nodeId,ownerType:I,slot:at,Template:e.template,rows:l.items.map(et),items:l.items,states:l.states,actions:e.editing?void 0:l.actions,pressTitles:e.pressTitles,fallback:null,children:n=>n})})}function bt({partNumbers:e,productSlug:r}){const[o,s]=Ee(""),{status:i,submit:l,reset:n}=$e();function y(){l({partNumbers:e,email:o,productSlug:r})}return i==="sent"?t("p",{className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-accent",children:"We'll email you when it's back."}):t(Ce,{className:"-mt-1",email:o,onEmailChange:s,status:i,onResetVerdict:n,onSubmit:y,inputAriaLabel:"Email for the back-in-stock alert",submitLabel:"Notify me when back",buttonClassName:"cursor-pointer whitespace-nowrap border-2 border-btn px-4 font-mono text-[length:var(--size-label,11px)] font-bold uppercase tracking-[0.22em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-btn",errorMessage:"Couldn't save that — please try again."})}export{ft as default};
|
|
1
|
+
"use client";import{jsx as t,Fragment as g,jsxs as c}from"react/jsx-runtime";import{partSkus as Le}from"../lib/catalog/part-skus.js";import ee from"next/link";import{useEffect as te,useRef as ae,useState as Ie}from"react";import{useCart as Pe}from"./CartContext.js";import{useSiteTakesOrders as $e}from"./SiteRecordContext.js";import He from"./EmailCaptureForm.js";import{useEnglish as le}from"./EnglishVariant.js";import{MarkedLabel as ne,heroView as Me}from"./product-hero/hero-view.js";import{useRootIsDark as Ue}from"efficient-shell/theme";import{useStockAlertSignup as je}from"./useStockAlertSignup.js";import{SPARE_WORDS as ze,productCartLine as De}from"../lib/catalog/purchase.js";import{OPTION_ROW_ATTR as Be}from"../lib/catalog/store-product.js";import{resolvingRowsAnswered as Ve}from"../lib/catalog/product-options.js";import{trackViewItem as Fe}from"../lib/google-tag.js";import{DEFAULT_HERO_LAYOUT as Ye,DEFAULT_HERO_RATIO as Ke,DEFAULT_HERO_TEXT_ALIGN as Qe,parseHeroLayout as We,parseHeroRatio as Xe,parseHeroTextAlign as Ge}from"../lib/sections/hero-arrangement.js";import{MAX_SPARES as qe,UNITS_PER_SET as re,formatPrice as se}from"../lib/commerce.js";import{formatSelectionPrice as Je,setPriceLabel as Ze}from"../lib/wheels/price-display.js";import{productIsDually as et,productIsTwoObjects as tt,setSuppressesRow as at}from"../lib/wheels/set-mode.js";import{CONTENT_CAP_GUTTER as ie}from"../lib/sections/content-cap-gutter.js";import{STICKY_COLUMNS_CLASS as lt,STICKY_SECTION_ATTR as nt}from"../lib/sections/hero-sticky.js";import{useStickyColumns as rt}from"./useStickyColumns.js";import{BLOCK_ALIGN_TEXT as st}from"efficient-web-builder/format/lib/content/block-align";import{CardTemplateRows as I}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as P}from"efficient-web-builder/render/components/SiteGutterFrame";import{cardRow as it}from"efficient-web-builder/format/lib/content/card-template";import{optionCardRows as ot}from"../lib/sections/filter-option-rows.js";import{HERO_OPTION_SLOT as ct}from"../lib/content/hero-option-seed.js";import{HERO_BUY_SLOT as mt,HERO_QUANTITY_PART as pt,HERO_SAVE_PART as dt}from"../lib/content/hero-buy-seed.js";import{HERO_PART as f}from"../lib/content/hero-seed.js";import ut from"./card-pieces/CardQuantity.js";import ft from"./card-pieces/CardSave.js";import ht from"./card-pieces/CardStatedFacts.js";import{HeroStateProvider as bt}from"./card-pieces/ProductCardState.js";import{PRODUCT_HERO_TYPE as $}from"../lib/document/document-nodes.js";const gt=4e3;function xt(e){return e?[e.year,e.make,e.model,e.modification].join("-"):""}const oe=[{}],vt=(e,r)=>r===pt?t(ut,{}):r===dt?t(ft,{}):null,kt="[&>[data-sf-repeat]]:contents [&>[data-sf-repeat]>div]:contents";function Tt({product:e,selection:r,onLightbox:o,editing:s=!1,showVehicleFitment:i=!0,heroLayout:l=Ye,imageRatio:n=Ke,textAlign:y=Qe,showSpecTable:me=!0,stickyColumns:pe=!1,nodeId:S,template:de,optionTemplate:ue,optionPressTitles:fe,buyTemplate:he}){const be=le(),x=We(l),H=Ge(y),k=Xe(n),N=pe===!0&&x!=="stacked",M=ae(null);rt(M,N);const ge=x==="imageRight"?`${100-k}fr ${k}fr`:`${k}fr ${100-k}fr`,{picked:xe,pick:U,qty:j,setQty:ve,choice:z,setChoice:ke,angleIdx:Nt,setAngleIdx:wt,showValidation:Te,setShowValidation:w,manualMode:D,vehicle:_,rows:B,facts:ye,part:d,outOfStock:V,offer:F,preOrder:O,canAddToCart:Y,currency:h,price:p,set:K,msrpLabel:Se}=r,m=Me(e,r,s),R=et(e),Ne=tt(e),C=i?m.vehicle:null,we=i?m.vehicleMemory:null,Q=!Ue({whenUnset:!0}),{warmCatalog:W}=Pe(),T=$e();te(()=>{!s&&T&&W(e.kind,e.slug)},[s,T,e.kind,e.slug,W]);const X=B.filter(a=>!O||a.values.length>0),G=X.filter(a=>a.role==="resolves"),A=X.filter(a=>a.role==="describes"&&!at(Ne,a.key)),q=A.findIndex(a=>a.chosen===null),J=(!C||!m.vehicleAnswersSpecs||r.fitmentSet)&&Ve(B,O)?q===-1?A:A.slice(0,q+1):[],_e=[...G,...J];function Oe(){return Y?(w(!1),s?null:De(e,d,xe,{choice:z,qty:j},{fitmentLabel:D?m.specCaption:_.appliedName?`For ${_.appliedName}`:"",fitmentKey:D?`manual|${m.specCaption}`:`vehicle|${xt(_.applied?.vehicle)}`})):(w(!0),window.setTimeout(()=>w(!1),gt),null)}const Re={kind:"hero",msrpLabel:Se||null,amount:R?Ze(p,h):Je(p,h),unitLabel:p.priced?m.unitLabel:null,packBadge:p.setTotal!=null?`${F.quantityLabel}: ${se(K,h)}`:null,buy:{isSet:R,priced:p.priced,outOfStock:V,canAdd:Y,totalLabel:p.setTotal!=null?se(K,h):null,lineToAdd:Oe},qty:j,setQty:ve,takesQty:T&&!(R&&!p.priced),save:{slug:e.slug,name:e.name},facts:me?ye:null,title:{eyebrow:e.eyebrow,name:m.heading,badge:e.badge||null},product:e,selection:r,openLightbox:o,sku:Le(d)},E={nodeId:S??"",template:ue,pressTitles:fe,editing:s},u=!!(O&&m.preOrder),Ce={[f.fitmentLine]:we,[f.options]:c(g,{children:[G.map(a=>t(ce,{row:a,onPick:U,options:E},a.key)),!u&&C,!u&&J.map(a=>t(ce,{row:a,onPick:U,options:E},a.key))]}),[f.facts]:u?null:t(ht,{}),[f.howMany]:u?null:t(yt,{offer:F,takesOrders:T,choice:z,setChoice:ke,options:E}),[f.buy]:u?m.preOrder:t(P,{children:t(I,{ownerId:S??"",ownerType:$,slot:mt,Template:he,rows:oe,fallback:null,hostParts:vt,children:a=>a})}),[f.notify]:!u&&V&&d?t(St,{partNumbers:d.components.map(a=>a.partNumber),productSlug:e.slug},d.id):null,[f.reminder]:!u&&Te?Ee():null},Ae=(a,b)=>Ce[b]??null;function Ee(){const a=_e.filter(L=>L.chosen===null).map(L=>be(L.prompt).replace(/^Select\s+/i,""));if(C&&m.vehicleAnswersSpecs&&!r.fitmentSet&&a.push("vehicle fitment"),a.length===0)return null;const b=a.length===1?a[0]:a.length===2?`${a[0]} and ${a[1]}`:`${a.slice(0,-1).join(", ")}, and ${a.at(-1)}`;return c("p",{role:"alert",className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em]",style:{color:"var(--alert)"},children:["Please select ",b," first."]})}const Z=ae(null);return te(()=>{s||Z.current===e.slug||(Z.current=e.slug,Fe({itemId:d?`${e.slug}|${d.id}`:e.slug,itemName:e.name,variant:m.metaValue,pricePerSet:p.setTotal??p.fromSetTotal??0,currency:h}))},[s,e.slug,e.name,m.metaValue,d,p,h]),c(g,{children:[t("nav",{className:`border-b border-line ${ie} pt-4 pb-4 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]`,style:Q?void 0:{background:"var(--section-bg)"},children:e.crumbs.map((a,b)=>c("span",{children:[b>0&&c(g,{children:[t("span",{className:"mx-3 text-accent",children:"/"}),t("wbr",{})]}),a.href?t(ee,{href:a.href,className:"hover:text-fg",children:t(ne,{text:a.label})}):t("span",{className:"text-fg",children:t(ne,{text:a.label})})]},`${a.label}-${b}`))}),t("section",{ref:M,"data-hero-layout":x,"data-hero-align":H,...N?{[nt]:""}:{},className:[`grid gap-10 ${ie} py-14 max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))] max-view-tablet:py-8 ${kt}`,H==="center"?st.center:"",x==="stacked"?"grid-cols-1":"[grid-template-columns:var(--hero-cols)] max-view-desktop:[grid-template-columns:minmax(0,1fr)]",N?lt:""].filter(Boolean).join(" "),style:{...Q?{}:{background:"var(--section-bg)"},...x==="stacked"?{}:{"--hero-cols":ge}},children:t(bt,{value:Re,children:t(P,{children:t(I,{ownerId:S??"",ownerType:$,Template:de,rows:oe,fallback:null,hostParts:Ae,children:a=>a})})})})]})}function yt({offer:e,takesOrders:r,choice:o,setChoice:s,options:i}){return e.packs.length>0||r&&(e.extra||e.spareCounts.length>0)?c("div",{className:"border-b border-line pb-[26px]",children:[e.packs.length>0&&c(g,{children:[t("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:"How many"}),t("div",{className:"flex flex-wrap gap-1.5",children:t(v,{hero:i,values:e.packs,item:l=>({label:l.label}),picked:l=>o.unit===l.value,press:l=>()=>s(n=>({...n,unit:l.value}))})})]}),r&&e.extra&&c("label",{className:`${e.packs.length>0?"mt-3.5 ":""}flex cursor-pointer items-center gap-3 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-fg`,children:[t("input",{type:"checkbox",checked:o.spares>0,onChange:l=>s(n=>({...n,spares:l.target.checked?qe:0})),className:"h-4 w-4 cursor-pointer accent-[var(--accent)]"}),e.extra.label]}),r&&e.spareCounts.length>0&&c(g,{children:[t("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:ze.howMany}),t("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:flex-wrap",children:t(v,{hero:i,values:e.spareCounts,item:l=>({label:`${l.value} · ${l.label}`}),picked:l=>o.spares===l.value-re,press:l=>()=>s(n=>({...n,spares:l.value-re}))})})]}),r&&e.spareSide&&c(g,{children:[t("div",{className:"mb-3.5 mt-[26px] font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:e.spareSide.label}),t("div",{className:"flex flex-wrap gap-1.5",children:t(v,{hero:i,values:e.spareSide.options,item:l=>({label:l.label}),picked:l=>o.spareSide===l.value,press:l=>()=>s(n=>({...n,spareSide:l.value}))})})]})]}):null}function ce({row:e,onPick:r,options:o}){const s=le();if(e.values.length===0&&!e.empty)return null;const i=e.values.find(n=>n.value===e.chosen),l=i&&[i.label,i.note].filter(Boolean).join(" · ");return c("div",{className:"border-b border-line pb-[26px]",[Be]:e.key,children:[c("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:[s(e.label)," · ",t("span",{className:"text-accent",children:l??s(e.prompt)})]}),e.values.length===0?c("p",{className:"font-mono text-[length:var(--size-body,12px)] leading-relaxed tracking-[0.1em] text-fg-dim",children:[e.empty.text," ",t(ee,{href:e.empty.href,className:"text-accent hover:underline",children:e.empty.linkText})]}):e.display==="swatch"?t("div",{className:"flex flex-wrap gap-2 [&>*]:max-w-full",children:t(v,{hero:o,values:e.values,item:n=>({swatch:n.swatch??"",name:n.label}),picked:n=>n.value===e.chosen,press:n=>()=>r(e.key,n.value)})}):t("div",{className:"flex flex-wrap gap-1.5",children:t(v,{hero:o,values:e.values,item:n=>({label:n.label,note:n.note??""}),picked:n=>n.value===e.chosen,press:n=>()=>r(e.key,n.value)})})]})}function v({hero:e,values:r,item:o,picked:s,press:i}){const l=ot(r,{item:o,selected:s,press:i});return t(P,{children:t(I,{ownerId:e.nodeId,ownerType:$,slot:ct,Template:e.template,rows:l.items.map(it),items:l.items,states:l.states,actions:e.editing?void 0:l.actions,pressTitles:e.pressTitles,fallback:null,children:n=>n})})}function St({partNumbers:e,productSlug:r}){const[o,s]=Ie(""),{status:i,submit:l,reset:n}=je();function y(){l({partNumbers:e,email:o,productSlug:r})}return i==="sent"?t("p",{className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-accent",children:"We'll email you when it's back."}):t(He,{className:"-mt-1",email:o,onEmailChange:s,status:i,onResetVerdict:n,onSubmit:y,inputAriaLabel:"Email for the back-in-stock alert",submitLabel:"Notify me when back",buttonClassName:"cursor-pointer whitespace-nowrap border-2 border-btn px-4 font-mono text-[length:var(--size-label,11px)] font-bold uppercase tracking-[0.22em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-btn",errorMessage:"Couldn't save that — please try again."})}export{Tt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as
|
|
1
|
+
"use client";import{jsxs as r,Fragment as m,jsx as s}from"react/jsx-runtime";import{HideTaker as d}from"efficient-web-builder/render/components/ViewHideRoot";import{PART_SIZE_CAP_VAR as h,partCanvasDeclarations as f,regionSheetStyle as p}from"efficient-web-builder/render/lib/document/part-styles";import{textRegionPartKey as o}from"efficient-web-builder/format/lib/sections/text-regions";import{RegionBridge as g,RegionWords as x,regionAttr as S}from"./card-text-region.js";const E=.72;function u(e,n=!0){const t=e.trim().split(/\s+/).filter(Boolean);if(t.length===0)return;const i=t.map((a,c)=>a.length+(n&&t.length>1&&c===t.length-1?1:0));return`calc(100cqi / ${(Math.max(...i)*E).toFixed(2)})`}const l="text-[length:min(min(var(--size-headingMedium,clamp(48px,5.5vw,84px)),var(--hero-name-fit,9999px)),var(--sf-heading-max,9999px))]",_=`font-heading2 ${l} [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[0.92] tracking-[-0.035em]`,A=l,N=e=>p(e?.partStyles?.[o("name")])?.textStyle!==void 0,y=["desktop","tablet","mobile"],v=e=>{const n=e?.partStyles?.[o("name")];return!!n&&y.some(t=>!!f(n,t).fontSize)},w=(e,n)=>({"--hero-name-fit":e,...e&&n?{[h]:e}:{}});function R({name:e,accentLastWord:n,region:t}){const i=n?e.lastIndexOf(" "):-1,a=s(x,{region:t,at:"name",children:i===-1?e:r(m,{children:[e.slice(0,i)," ",r("em",{className:"font-normal italic text-accent",children:[e.slice(i+1),"."]})]})});return s(g,{region:t,sectionType:"ProductName",children:s(d,{as:"div",className:"w-full [container-type:inline-size]",children:s("h1",{...S(t,"name"),className:N(t)?A:_,style:w(u(e,n),v(t)),children:a})})})}export{R as default};
|
|
@@ -83,6 +83,7 @@ export interface HeroState {
|
|
|
83
83
|
readonly product: StoreProduct;
|
|
84
84
|
readonly selection: ProductSelection;
|
|
85
85
|
readonly openLightbox: (src: string, alt: string) => void;
|
|
86
|
+
readonly sku?: readonly string[];
|
|
86
87
|
}
|
|
87
88
|
export interface HeroTitle {
|
|
88
89
|
readonly eyebrow: string;
|
|
@@ -6,6 +6,7 @@ interface HeroArrangement extends HeroTemplateProps {
|
|
|
6
6
|
imageRatio?: number;
|
|
7
7
|
textAlign?: HeroTextAlign;
|
|
8
8
|
showSpecTable?: boolean;
|
|
9
|
+
stickyColumns?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare const supportedKinds: readonly ("alloy-wheel" | "tyre")[];
|
|
11
12
|
export default function DynamicProductHero({ editing, showVehicleFitment, ...arrangement }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as a}from"react/jsx-runtime";import m from"../SpecTable.js";import
|
|
1
|
+
"use client";import{jsx as a}from"react/jsx-runtime";import m from"../SpecTable.js";import T from"./KindGate.js";import{DynamicEuTyreLabelBlock as x}from"./DynamicEuTyreLabel.js";import{wheelSheetOf as D}from"../../lib/wheels/wheel-sheet.js";import{buildTyreSpecSheet as E}from"../../lib/tyres/spec-sheet.js";import{dropSpecRows as I}from"../../lib/wheels/spec-sheet.js";import{useCurrentProduct as _}from"../../lib/document/current-product.js";import{NO_FIELD_ANSWERS as L,applySpecAnswers as b}from"../../lib/content/field-usage.js";import{useSampleProduct as N}from"./useSampleProduct.js";const O=["alloy-wheel","tyre"];function k(r,n,o){const s=r.variants??[];return(n?s.find(e=>e.sku===n):void 0)??(o?s.find(e=>e.size===o):void 0)??s[0]??null}const v=[];function R(r){return a(T,{kinds:O,type:"SpecTable",editing:r.editing,children:a(j,{...r})})}function j({num:r,title:n,description:o,showDiagram:s=!0,editing:e=!1,nodeId:d,omitHead:i=!1,template:p,showEuLabel:S=!1,hideRows:y=v}){const t=_(),w=N(e&&!t),l=t?.product??w,c=l?.kind==="tyre"?l.source:null,u=t?.fieldUsage??L;if(c){const h=k(c,t?.selection.part?.id,t?.selection.shown.size),g=E({brand:c.brand,variant:h});return a(m,{capped:!1,builtInLabels:!0,num:r,title:n,description:o,rows:b(g.rows,u),diagram:null,editing:e,nodeId:d,omitHead:i,template:p,footer:S&&!i?a(x,{editing:e}):void 0})}const f=D(t,l);return a(m,{capped:!1,builtInLabels:!0,num:r,title:n,description:o,rows:I(b(f.rows,u),y),diagram:s&&!i?f.diagram:null,diagramElsewhere:i,editing:e,nodeId:d,omitHead:i,template:p})}export{R as default,O as supportedKinds};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as a,Fragment as b,jsxs as x}from"react/jsx-runtime";import N from"./TyreHeroFitment.js";import{STAGE_IMAGE_SIZES as y}from"./stage-photo.js";import{HeroVehicleMemory as w}from"./VehicleQuestion.js";import E from"./WheelHeroFitment.js";import C from"../PreOrderPanel.js";import j from"efficient-web-builder/render/components/RMark";import z from"../TyreImage.js";import F from"../WheelImage.js";import k from"../WheelSvg.js";import{partVariant as P,wheelFinish as H}from"../../lib/catalog/from-wheel.js";import{tyreModelLine as L}from"../../lib/tyres/tyre-brand-name.js";import{axisRenderingsFor as R,lugRenderingsFor as S}from"../../lib/wheels/cover-rendering.js";import{finishAngles as _}from"../../lib/wheels/finish-photos.js";import{selectedStuds as A}from"../../lib/wheels/selected-studs.js";import{REFERENCE_NOTE as T,stageIsFallback as B}from"../../lib/wheels/render-fit.js";import{PER_WHEEL_UNIT as O}from"../../lib/wheels/set-mode.js";import{variantSpecLabel as I}from"../../lib/wheels/variant-spec.js";function ne(t,e){return t.captions[e]?.trim()||`Photo ${e+1}`}function se({text:t}){return t==="FusionForge®"?x(b,{children:["FusionForge",a(j,{})]}):a(b,{children:t})}function le(t,e,
|
|
1
|
+
"use client";import{jsx as a,Fragment as b,jsxs as x}from"react/jsx-runtime";import N from"./TyreHeroFitment.js";import{STAGE_IMAGE_SIZES as y}from"./stage-photo.js";import{HeroVehicleMemory as w}from"./VehicleQuestion.js";import E from"./WheelHeroFitment.js";import C from"../PreOrderPanel.js";import j from"efficient-web-builder/render/components/RMark";import z from"../TyreImage.js";import F from"../WheelImage.js";import k from"../WheelSvg.js";import{partVariant as P,wheelFinish as H}from"../../lib/catalog/from-wheel.js";import{tyreModelLine as L}from"../../lib/tyres/tyre-brand-name.js";import{axisRenderingsFor as R,lugRenderingsFor as S}from"../../lib/wheels/cover-rendering.js";import{finishAngles as _}from"../../lib/wheels/finish-photos.js";import{selectedStuds as A}from"../../lib/wheels/selected-studs.js";import{REFERENCE_NOTE as T,stageIsFallback as B}from"../../lib/wheels/render-fit.js";import{PER_WHEEL_UNIT as O}from"../../lib/wheels/set-mode.js";import{variantSpecLabel as I}from"../../lib/wheels/variant-spec.js";function ne(t,e){return t.captions[e]?.trim()||`Photo ${e+1}`}function se({text:t}){return t==="FusionForge®"?x(b,{children:["FusionForge",a(j,{})]}):a(b,{children:t})}function le(t,e,p){if(t.kind==="tyre"){const r=t.source,l=e.shown.size??r.sizes[0]??"",s=r.variants.find(m=>m.size===l),f=s?.specs.tireType??r.variants[0]?.specs.tireType??null,d=[s?.image,r.coverImage].filter(m=>!!m);return{heading:L(r.brand,r.name),photos:d.slice(0,1),tint:void 0,stageImage:()=>a(z,{image:s?.image??r.coverImage,size:l,type:f,sizes:y,priority:!0,className:"h-full w-full"}),thumbImage:()=>null,captions:[],thumbFallbackCells:0,galleryHint:"",referenceNote:"",metaValue:l,specCaption:s?[s.specs.loadIndex,s.specs.speedRating].filter(Boolean).join(""):"",originCaption:r.brand,unitLabel:"per tyre",vehicle:a(N,{slug:r.slug,variants:r.variants,vehicle:e.vehicle,manualMode:e.manualMode,setManualMode:e.setManualMode}),vehicleMemory:e.manualMode?null:a(w,{vehicle:e.vehicle}),vehicleAnswersSpecs:!1,preOrder:null}}const o=t.source,n=H(o,e.shown.finish),i=P(o,e.part),h=A(e),M=i?.components.find(r=>r.hand!=="right")??i?.components[0],c=R(n,M?.renderKey),u=c?null:S(n,h),v=c?[...c]:u?[...u]:_(n),g=v.length>0?v:o.coverImage?[o.coverImage]:[];return{heading:t.name,photos:g,tint:n.color,stageImage:({photo:r,alt:l,label:s,onZoom:f,fit:d,eager:m=!0})=>a(F,{src:r,alt:l,fill:!0,sizes:y,className:d==="cover"?"object-cover":"object-contain",priority:m,onImageClick:f,imageButtonClassName:"relative block h-[88%] w-[88%] cursor-zoom-in",imageButtonLabel:s,fallback:a(k,{spokes:o.spokes,mesh:o.mesh,className:"block h-[70%] w-[70%]"})}),thumbImage:({photo:r,alt:l})=>a(F,{src:r,alt:l,fill:!0,sizes:"(max-width: 720px) 20vw, (max-width: 1100px) 10vw, 120px",className:"object-contain",imageWrapperClassName:"relative h-[80%] w-[80%]",fallback:a(k,{spokes:o.spokes,mesh:o.mesh,className:"block h-[55%] w-[55%]"})}),captions:g.map(r=>n.captions?.[r]),thumbFallbackCells:4,galleryHint:V(g,n,h,e.manualMode),referenceNote:!c&&B(n,i,h,u!=null)?T:"",metaValue:n.name,specCaption:i?I(i):"",originCaption:o.process==="FusionForge®"?"FusionForge® · Hybrid":`${o.process} · 1-piece`,unitLabel:O,vehicle:a(E,{selection:e,spec:i?I(i):"",vehicle:e.vehicle,wheel:o}),vehicleMemory:e.manualMode?null:a(w,{vehicle:e.vehicle}),vehicleAnswersSpecs:!0,preOrder:a(C,{wheel:o,editing:p})}}function V(t,e,p,o){return t.length>=2||p!=null||!Object.values(e.lugRenderings??{}).some(i=>Array.isArray(i)&&i.filter(Boolean).length>=2)?"":o?"Pick a bolt pattern to see every angle":"Pick your vehicle to see every angle"}export{se as MarkedLabel,le as heroView,ne as photoLabel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useEffect as a}from"react";import{STICK_CELL_ATTR as f,STICK_HEIGHT_VAR as m}from"../lib/sections/hero-sticky.js";function p(s){const c=s.ownerDocument.defaultView,r=[],e=i=>{for(const o of Array.from(i.children))o instanceof HTMLElement&&(c?.getComputedStyle(o).display==="contents"?e(o):r.push(o))};return e(s),r}function b(s,c){a(()=>{const r=s.current;if(!c||!r)return;let e=[];const i=()=>{for(const t of e)t.style.setProperty(m,`${t.offsetHeight}px`)},o=new ResizeObserver(i),l=()=>{const t=p(r);if(!(t.length===e.length&&t.every((n,d)=>n===e[d]))){for(const n of e)o.unobserve(n);e=t;for(const n of e)n.setAttribute(f,""),o.observe(n);i()}};l();const u=new MutationObserver(l);return u.observe(r,{childList:!0,subtree:!0}),()=>{u.disconnect(),o.disconnect();for(const t of e)t.removeAttribute(f),t.style.removeProperty(m)}},[s,c])}export{b as useStickyColumns};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{variantsFittingVehicle as
|
|
1
|
+
import{variantsFittingVehicle as B}from"../wheels/plp-fitment-match.js";import{FALLBACK_FINISH as F}from"../wheels/finish-defaults.js";import{variantEtKey as S,variantSizeGroupKey as V,variantSizeGroupLabel as N,variantSizeGroupNote as I}from"../wheels/variant-spec.js";import{trimDecimal as y}from"../wheels/spec-format.js";import{itemCollections as A}from"./plp-item.js";import{BUILT_IN_LISTING_PATH as g,withListingFilter as D}from"../links/link-rules.js";import{PLP_PARAM as _}from"../wheels/plp-filters.js";import{findVariant as H,isVariantOutOfStock as L}from"../wheels/variants.js";import{HAND_WORDS as O,NOT_HANDED_WORDS as T,variantIsHanded as b}from"../wheels/set-mode.js";const P="handed",k="plain";function x(e){const n=A(e).find(o=>o.trim()!=="");return n?{label:n,href:D(g,{param:_.collections,value:n})}:{label:e.process,href:g}}function q(e){const n=e.variants??[],o=e.finishes.map(t=>({value:t.name,label:t.name,swatch:t.color}));function i(t){const a=[];for(const v of n){const h=t(v);!h||a.some(z=>z.value===h.value)||a.push(h)}return a}const f=i(t=>({value:V(t),label:N(t),note:I(t)})),p=i(t=>t.boltPattern?{value:t.boltPattern,label:t.boltPattern}:null),m=i(t=>{const a=S(t);return a===null?null:{value:a,label:`ET ${a}`}}),l=i(t=>t.centreBore==null?null:{value:y(t.centreBore),label:`${y(t.centreBore)} mm`}),s=n.some(b),r=s?i(t=>({value:b(t)?P:k,label:b(t)?O:T})):[],c=n.map(t=>({id:`${t.finishName}|${t.size}`,options:{finish:t.finishName,size:V(t),variantSize:t.size,...t.boltPattern?{boltPattern:t.boltPattern}:{},...S(t)!==null?{et:S(t)}:{},...t.centreBore==null?{}:{centreBore:y(t.centreBore)},...s?{pairing:b(t)?P:k}:{}},inStock:!L(t),image:null,components:t.components})),u=((e.defaultFinish?o.find(t=>t.value===e.defaultFinish):void 0)??o[0])?.value;return{kind:"alloy-wheel",source:e,slug:e.slug,name:e.name,eyebrow:e.process,badge:e.badge==="new"?"New 2026":e.badge?"Bestseller":"",href:`/wheels/${e.slug}`,crumbs:[{label:"Home",href:"/"},{label:"Wheels",href:"/wheels"},x(e),{label:e.name}],cover:e.coverImage??null,inStock:e.inStock===!0,mediaGroups:e.mediaGroups,optionFields:[{key:"finish",label:"Finish",prompt:"Select a finish",role:"resolves",display:"swatch",defaultValue:u},{key:"size",label:"Size",prompt:"Select a size",role:"resolves",display:"pill",empty:{text:"This wheel isn't available to order online in this finish.",linkText:"Contact us about it →",href:"/contact"}},{key:"boltPattern",label:"Bolt pattern",prompt:"Select a bolt pattern",role:"describes",display:"pill"},{key:"et",label:"Offset",prompt:"Select an offset",role:"describes",display:"pill"},{key:"centreBore",label:"Centre bore",prompt:"Select a centre bore",role:"describes",display:"pill"},{key:"pairing",label:"Wheels",prompt:"Select a pairing",role:"describes",display:"pill"}],optionValues:{finish:o,size:f,boltPattern:p,et:m,centreBore:l,pairing:r},parts:c,anchorPrices:e.prices,anchorMsrpPrices:e.msrpPrices??{}}}function J(e,n){if(e.kind!=="alloy-wheel"||n===null)return e;const o=new Set(B(e.source.variants??[],n));if(o.size===0)return e;const i=e.parts.filter(l=>{const s=G(e.source,l);return s!==null&&o.has(s)});if(i.length===0||i.length===e.parts.length)return e;const f=(l,s)=>new Set(l.map(r=>r.options[s]).filter(r=>r!==void 0)),p={},m=[];for(const l of e.optionFields){const s=f(e.parts,l.key),r=f(i,l.key),c=(e.optionValues[l.key]??[]).filter(u=>r.has(u.value)||!s.has(u.value));p[l.key]=c;const d=l.defaultValue!==void 0&&!c.some(u=>u.value===l.defaultValue)?c[0]?.value:l.defaultValue;m.push(d===l.defaultValue?l:{...l,defaultValue:d})}return{...e,optionFields:m,optionValues:p,parts:i}}function G(e,n){return n?H(e.variants??[],n.options.finish,n.options.variantSize)??null:null}function Q(e,n){return e.finishes.find(o=>o.name===n)??e.finishes[0]??F}export{q as fromWheel,G as partVariant,Q as wheelFinish,J as wheelForVehicle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(e){return e?[...new Set(e.components.map(n=>n.partNumber).filter(Boolean))]:[]}export{t as partSkus};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type BlockSeed } from "efficient-web-builder/format/lib/document/seed-parts";
|
|
2
2
|
type Props = Record<string, unknown>;
|
|
3
3
|
export declare const HERO_GALLERY_BLOCK = "ProductGallery";
|
|
4
|
-
export declare const HERO_TEMPLATE_BLOCKS: readonly ["ProductGallery", "ProductEyebrow", "ProductName", "ProductPrice"];
|
|
4
|
+
export declare const HERO_TEMPLATE_BLOCKS: readonly ["ProductGallery", "ProductEyebrow", "ProductName", "ProductPrice", "ProductSku"];
|
|
5
5
|
export declare const HERO_PART: {
|
|
6
6
|
readonly fitmentLine: "fitment-line";
|
|
7
7
|
readonly options: "options";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{phoneKey as T}from"efficient-easel/draw";import{PART_MOTION_PROP as
|
|
1
|
+
import{phoneKey as T}from"efficient-easel/draw";import{PART_MOTION_PROP as C}from"efficient-web-builder/render/lib/animation/part-motion";import{PART_STYLES_PROP as D,readPartStyles as Y}from"efficient-web-builder/render/lib/document/part-styles";import{BOX_TYPE as d,CONTAINER_BLOCKS_SLOT as y}from"efficient-web-builder/format/lib/document/container-blocks";import{INNER_BOX as k,boxPadding as G,seedNodes as F}from"efficient-web-builder/format/lib/document/seed-parts";import{CARD_TEMPLATE_SLOT as _}from"efficient-web-builder/format/lib/content/card-template";import{BOX_BLOCK_SPACING_POINTS as j}from"efficient-web-builder/format/lib/content/box-layout";import{say as p}from"efficient-web-builder/format/lib/editor-words";import{HIDDEN_KEY as B}from"efficient-easel/screen/lib/content/view-hide";import{isNode as X}from"efficient-easel/data";import{seedNodeId as v}from"./seed-ids.js";import{hostPartSeed as l}from"./host-part-seed.js";import{PRODUCT_EYEBROW_BLOCK as N,PRODUCT_NAME_BLOCK as x,PRODUCT_PRICE_BLOCK as E,PRODUCT_SKU_BLOCK as Q}from"./product-card-seed.js";import{PRODUCT_HERO_TYPE as W}from"../document/document-nodes.js";import{parseHeroLayout as A,parseHeroTextAlign as H}from"../sections/hero-arrangement.js";import{parseHeroGalleryMode as $,parseHeroImageFit as q}from"../sections/hero-gallery.js";import{parseHeroPricePlacement as z}from"../sections/hero-price-placement.js";import{TRUST_BULLETS_SLOT as R}from"../sections/hero-trust-bullets.js";import{EYEBROW_BADGE_PROP as J,NAME_ACCENT_PROP as V,TITLE_LOOK_PROP as b}from"./title-look.js";const g="ProductGallery",Se=[g,N,x,E,Q],u={fitmentLine:"fitment-line",options:"options",facts:"facts",howMany:"how-many",buy:"buy",notify:"notify",reminder:"reminder"},Z=28,M="@price";function ee(e){const{[M]:t,...r}=e&&typeof e=="object"?e:{};return{price:t,others:r}}const te=j[0].value,L=(e,t,r={})=>({...k,name:e,gap:t,[T("gap")]:t,...G(0,0),blockSpacing:te,...r});function re(e,t={}){const r=z(e.pricePlacement),o={type:E,props:K(e)?{...t,[B]:!0}:t},n={type:d,props:L("Stage",0),slots:{[y]:[{type:g,props:{galleryMode:$(e.galleryMode),imageFit:q(e.imageFit)}}]}},s={type:d,props:L("Buy column",Z,H(e.textAlign)==="center"?{align:"center"}:{}),slots:{[y]:[{type:d,props:L("Title",0),slots:{[y]:[{type:N,props:{[b]:"headline",[J]:!0}},{type:x,props:{[b]:"headline",[V]:!0}}]}},...r==="top"?[o]:[],l(u.fitmentLine,p("Remembered car")),l(u.options,p("Options")),l(u.facts,p("Settled facts")),l(u.howMany,p("Quantity")),...r==="belowSpecs"?[o]:[],l(u.buy,p("Buy row")),l(u.notify,p("Notify me")),l(u.reminder,p("Reminder"))]}};return A(e.heroLayout)==="imageRight"?[s,n]:[n,s]}const K=e=>e.showPriceQuote===!1,oe={sectionBorder:{top:1,style:"solid"}},I=20;function ne(e){return O(e).map((t,r)=>{if(r!==0)return t;const o={...t.props},n=i=>typeof i=="number"?i:void 0,s=n(t.props.sectionPaddingTop)??0;return o.sectionPaddingTop=I+s,o[T("sectionPaddingTop")]=I+(n(t.props[T("sectionPaddingTop")])??s),t.props.sectionBorder||Object.assign(o,oe),{type:t.type,props:o}})}function O(e){return Array.isArray(e)?e.filter(t=>X(t)):[]}const U="templateShape",w="hero";function ie(e){const t=e[_];if(e[U]===w||!Array.isArray(t))return null;if(t.length===0)return[];const r=O(t);return r.length===t.length&&r.every(o=>o.type!==d)?r:null}function se(e,t={},r=[],o){const n=v(e,W),s=F(re(e,t),(c,m)=>`${n}~hero.${m}`);if(r.length===0&&!o)return s;const i=A(e.heroLayout)==="imageRight"?0:1;return s.map((c,m)=>{if(m!==i)return c;const P=f=>({...f,props:{...f.props,[B]:!0}}),a=o&&K(e)?o.map(P):o,S=c.props[y].flatMap(f=>a&&f.type===E?a.length>0?a:[P(f)]:[f]);return{...c,props:{...c.props,[y]:[...S,...r]}}})}function Ce(e){const t=ie(e);if(e[_]!==void 0&&!t)return e;const r={...e,[U]:w},o={};for(const[n,s]of[[D,Y(e)],[C,e[C]]]){const{price:i,others:c}=ee(s);i&&(o[n]={[M]:i},Object.keys(c).length>0?r[n]=c:delete r[n])}return r[_]=se(e,o,ne(e[R]),t??void 0),Array.isArray(e[R])&&(r[R]=[]),r}function h(e){if(e.type===g)return!0;const t=e.props[y];return Array.isArray(t)&&O(t).some(h)}function Be(e,t){const r=e[_];if(!t.heroLayout&&!t.textAlign||!Array.isArray(r)||r.length!==2)return e;const o=O(r);if(o.length!==2||o.some(a=>a.type!==d))return e;const n=o.findIndex(h);if(n===-1||h(o[1-n]))return e;const s=o[n];let i=o[1-n],c=!1;if(t.textAlign){const a=H(e.textAlign)==="center";if(a&&i.props.align!=="center")i={...i,props:{...i.props,align:"center"}},c=!0;else if(!a&&i.props.align==="center"){const{align:S,...f}=i.props;i={...i,props:f},c=!0}}const m=A(e.heroLayout)==="imageRight";if(t.heroLayout&&n===0===m&&(c=!0),!c)return e;const P=(t.heroLayout?m:n===1)?[i,s]:[s,i];return{...e,[_]:P}}export{g as HERO_GALLERY_BLOCK,u as HERO_PART,Se as HERO_TEMPLATE_BLOCKS,w as HERO_TEMPLATE_SHAPE,U as HERO_TEMPLATE_SHAPE_PROP,re as heroSeeds,Be as heroTemplateFollowsArrangement,Ce as withHeroTemplate};
|
|
@@ -5,6 +5,7 @@ export declare const EVENTS_DEFAULT_LIMIT = 3;
|
|
|
5
5
|
export declare const EVENTS_LAYOUT_COUNT = "count";
|
|
6
6
|
export type PostListStart = Readonly<Record<ViewTier, number> & {
|
|
7
7
|
from: string;
|
|
8
|
+
skipCurrentPost?: true;
|
|
8
9
|
}>;
|
|
9
10
|
export declare function postCap(props: Readonly<{
|
|
10
11
|
showAll?: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{VIEW_TIERS as
|
|
1
|
+
import{VIEW_TIERS as S}from"efficient-easel/screen/lib/content/view-tiers";import{declaredBlockSource as T}from"efficient-web-builder/format/lib/content/block-sources";import{nodeViewHidden as E}from"efficient-web-builder/format/lib/content/view-hide-class";import{isSectionGroupType as I,SECTION_GROUP_SLOT as L}from"efficient-web-builder/format/lib/document/section-groups";import{documentNodes as N,placedDocumentNodes as h}from"../document/document-nodes.js";const y="Events",O=3,_="count";function A(o){return o.showAll?Number.POSITIVE_INFINITY:typeof o.limit=="number"&&o.limit>0?o.limit:O}function g(o,n,r){return o.layout===_||r[n]?0:A(o)}function m(o){const n=h(o),r=new Map;for(const{node:t,order:s}of n){const e=t.props?.[L];I(t.type)&&Array.isArray(e)&&r.set(e,`group ${s}`)}return n.filter(({node:t})=>t.type===y&&T(t.props??{})==="").map(({node:t,lists:s})=>({id:String(t.props?.id??""),props:t.props??{},chain:s.map(e=>r.get(e)).find(e=>e!==void 0)??"page"}))}function w(o){const n={},r=new Map;for(const{id:t,props:s,chain:e}of m(o)){const i=r.get(e),p=s.continueList===!0&&i!==void 0,l=E(s),u=p?i.from:t,a=p?i.skip:s.skipCurrentPost===!0,d={},f={};for(const c of S)f[c]=p?i.ends[c]:0,d[c]=f[c]+g(s,c,l);p&&(n[t]={...f,from:u,...a?{skipCurrentPost:!0}:{}}),r.set(e,{ends:d,from:u,skip:a})}return n}function C(o,n){const r=new Set;for(const t of m(o)){if(t.id===n)return r.has(t.chain);r.add(t.chain)}return!1}function v(o){const n=w(o),r=new Map(N(o).map(s=>[String(s.props?.id??""),s.props?.posts])),t={};for(const[s,{from:e}]of Object.entries(n)){const i=r.get(e);Array.isArray(i)&&(t[s]=i)}return{starts:n,posts:t}}export{O as EVENTS_DEFAULT_LIMIT,_ as EVENTS_LAYOUT_COUNT,w as continuedPostLists,C as hasPostListAbove,A as postCap,v as postListStartsOf};
|
|
@@ -8,6 +8,7 @@ export declare const PRODUCT_COLOUR_BLOCK = "ProductColour";
|
|
|
8
8
|
export declare const PRODUCT_SIZE_BLOCK = "ProductSize";
|
|
9
9
|
export declare const PRODUCT_EYEBROW_BLOCK = "ProductEyebrow";
|
|
10
10
|
export declare const PRODUCT_NAME_BLOCK = "ProductName";
|
|
11
|
+
export declare const PRODUCT_SKU_BLOCK = "ProductSku";
|
|
11
12
|
export declare const PRODUCT_CARD_SLOT_BLOCKS: readonly ["ProductPicture", "ProductEyebrow", "ProductName", "ProductSpecs", "ProductPrice", "ProductColour", "ProductSize", "ProductBuy"];
|
|
12
13
|
export declare const PRODUCT_CARD_FIELDS: readonly [{
|
|
13
14
|
readonly key: "name";
|