efficient-storefront-blocks 0.124.0 → 0.124.1

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.
@@ -61,6 +61,7 @@ export interface EventsProps {
61
61
  columns?: number;
62
62
  limit?: number;
63
63
  showAll?: boolean;
64
+ skipCurrentPost?: boolean;
64
65
  gap?: number | string;
65
66
  gapPhone?: unknown;
66
67
  layout?: string;
@@ -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 +1 @@
1
- "use client";import{jsxs as s,Fragment as o,jsx as a}from"react/jsx-runtime";import{HideTaker as c}from"efficient-web-builder/render/components/ViewHideRoot";import{RegionBridge as d,RegionWords as m,regionAttr as h}from"./card-text-region.js";const g=.72;function f(n,i=!0){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length===0)return;const t=e.map((r,l)=>r.length+(i&&e.length>1&&l===e.length-1?1:0));return`calc(100cqi / ${(Math.max(...t)*g).toFixed(2)})`}const x="font-heading2 text-[length:min(min(var(--size-headingMedium,clamp(48px,5.5vw,84px)),var(--hero-name-fit,9999px)),var(--sf-heading-max,9999px))] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[0.92] tracking-[-0.035em]";function p({name:n,accentLastWord:i,region:e}){const t=i?n.lastIndexOf(" "):-1,r=a(m,{region:e,at:"name",children:t===-1?n:s(o,{children:[n.slice(0,t)," ",s("em",{className:"font-normal italic text-accent",children:[n.slice(t+1),"."]})]})});return a(d,{region:e,sectionType:"ProductName",children:a(c,{as:"div",className:"w-full [container-type:inline-size]",children:a("h1",{...h(e,"name"),className:x,style:{"--hero-name-fit":f(n,i)},children:r})})})}export{p as default};
1
+ "use client";import{jsxs as s,Fragment as c,jsx as r}from"react/jsx-runtime";import{HideTaker as m}from"efficient-web-builder/render/components/ViewHideRoot";import{regionSheetStyle as d}from"efficient-web-builder/render/lib/document/part-styles";import{textRegionPartKey as f}from"efficient-web-builder/format/lib/sections/text-regions";import{RegionBridge as h,RegionWords as g,regionAttr as x}from"./card-text-region.js";const p=.72;function u(e,i=!0){const t=e.trim().split(/\s+/).filter(Boolean);if(t.length===0)return;const n=t.map((a,l)=>a.length+(i&&t.length>1&&l===t.length-1?1:0));return`calc(100cqi / ${(Math.max(...n)*p).toFixed(2)})`}const o="text-[length:min(min(var(--size-headingMedium,clamp(48px,5.5vw,84px)),var(--hero-name-fit,9999px)),var(--sf-heading-max,9999px))]",E=`font-heading2 ${o} [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[0.92] tracking-[-0.035em]`,_=o,N=e=>d(e?.partStyles?.[f("name")])?.textStyle!==void 0;function S({name:e,accentLastWord:i,region:t}){const n=i?e.lastIndexOf(" "):-1,a=r(g,{region:t,at:"name",children:n===-1?e:s(c,{children:[e.slice(0,n)," ",s("em",{className:"font-normal italic text-accent",children:[e.slice(n+1),"."]})]})});return r(h,{region:t,sectionType:"ProductName",children:r(m,{as:"div",className:"w-full [container-type:inline-size]",children:r("h1",{...x(t,"name"),className:N(t)?_:E,style:{"--hero-name-fit":u(e,i)},children:a})})})}export{S as default};
@@ -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 l}from"efficient-easel/screen/lib/content/view-tiers";import{declaredBlockSource as S}from"efficient-web-builder/format/lib/content/block-sources";import{nodeViewHidden as T}from"efficient-web-builder/format/lib/content/view-hide-class";import{isSectionGroupType as E,SECTION_GROUP_SLOT as I}from"efficient-web-builder/format/lib/document/section-groups";import{documentNodes as L,placedDocumentNodes as N}from"../document/document-nodes.js";const h="Events",y=3,O="count";function _(o){return o.showAll?Number.POSITIVE_INFINITY:typeof o.limit=="number"&&o.limit>0?o.limit:y}function A(o,n,s){return o.layout===O||s[n]?0:_(o)}function d(o){const n=N(o),s=new Map;for(const{node:t,order:r}of n){const e=t.props?.[I];E(t.type)&&Array.isArray(e)&&s.set(e,`group ${r}`)}return n.filter(({node:t})=>t.type===h&&S(t.props??{})==="").map(({node:t,lists:r})=>({id:String(t.props?.id??""),props:t.props??{},chain:r.map(e=>s.get(e)).find(e=>e!==void 0)??"page"}))}function g(o){const n={},s=new Map;for(const{id:t,props:r,chain:e}of d(o)){const i=s.get(e),p=r.continueList===!0&&i!==void 0,m=T(r),u=p?i.from:t,a={},f={};for(const c of l)f[c]=p?i.ends[c]:0,a[c]=f[c]+A(r,c,m);p&&(n[t]={...f,from:u}),s.set(e,{ends:a,from:u})}return n}function v(o,n){const s=new Set;for(const t of d(o)){if(t.id===n)return s.has(t.chain);s.add(t.chain)}return!1}function M(o){const n=g(o),s=new Map(L(o).map(r=>[String(r.props?.id??""),r.props?.posts])),t={};for(const[r,{from:e}]of Object.entries(n)){const i=s.get(e);Array.isArray(i)&&(t[r]=i)}return{starts:n,posts:t}}export{y as EVENTS_DEFAULT_LIMIT,O as EVENTS_LAYOUT_COUNT,g as continuedPostLists,v as hasPostListAbove,_ as postCap,M as postListStartsOf};
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};
@@ -1 +1 @@
1
- import{jsx as f}from"react/jsx-runtime";import{phoneKey as g}from"efficient-easel/draw";import h,{readFacets as x,readTags as k}from"../../../../../components/Events.js";import{declaredBlockSource as v,sourcedRows as y}from"efficient-web-builder/format/lib/content/block-sources";import{servedListOf as b,servedRowLists as E}from"../../../../content/served-lists.js";import{hidableText as H}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as S}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as l}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{say as a}from"efficient-web-builder/format/lib/editor-words";import{bandPadProps as A}from"../../../../sections/band-padding.js";import{EventsMeta as P,EVENTS_PH as m}from"./meta.js";import{nodeViewHidden as C}from"efficient-web-builder/format/lib/content/view-hide-class";const F=()=>[{key:"sample-1",title:a("First card"),excerpt:a("A line about it appears here.")},{key:"sample-2",title:a("Second card"),excerpt:a("A line about it appears here.")},{key:"sample-3",title:a("Third card"),excerpt:a("A line about it appears here.")},{key:"sample-4",title:a("Fourth card"),excerpt:a("A line about it appears here.")}],s=(e,i,t)=>({slug:e.key||`card-${i}`,title:e.title??"",excerpt:e.excerpt??"",cover:e.cover??"",meta:e.meta||void 0,dateLabel:e.dateLabel||void 0,href:e.href||"#",...t?.facets?{facets:t.facets}:{},...t?.tags?{tags:t.tags}:{}}),L=e=>E(e,i=>({facets:x(i.facets),tags:k(i.tags)})),O={...P,render:e=>{const i=S(e.headPlacement)==="own-box",t=d=>i?void 0:d,o=l(e.linkText,m.link,e.editor),n=v(e)!==""?y(e,!!e.editor?.isEditing,F()):null,c=n&&!n.sample?L(e):null,u=n?n.sample?[]:n.rows.map((d,r)=>s(d,r,b(c,d,r))):e.posts;return f(h,{num:t(l(e.num,m.num,e.editor)),title:t(l(e.title,m.title,e.editor)),link:t(o?{text:o,href:H(e.linkHref)||"/journal"}:void 0),omitHead:i,posts:u,servedCategory:e.servedCategory,sample:n?.sample?n.rows.map((d,r)=>s(d,r)):void 0,columns:e.columns,limit:e.limit,showAll:e.showAll,layout:e.layout,featuredWidth:e.featuredWidth,listCover:e.listCover,featuredDarken:e.featuredDarken,cardImage:e.cardImage,gap:e.gap,gapPhone:e[g("gap")],nameFilter:e.nameFilter===!0,pads:A(e),editing:e.editor?.isEditing,template:e.template,ownerId:String(e.id??""),viewHidden:C(e)})}};export{O as EventsRender};
1
+ import{jsx as f}from"react/jsx-runtime";import{phoneKey as g}from"efficient-easel/draw";import h,{readFacets as k,readTags as x}from"../../../../../components/Events.js";import{declaredBlockSource as v,sourcedRows as y}from"efficient-web-builder/format/lib/content/block-sources";import{servedListOf as b,servedRowLists as P}from"../../../../content/served-lists.js";import{hidableText as C}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as E}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as l}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{say as a}from"efficient-web-builder/format/lib/editor-words";import{bandPadProps as H}from"../../../../sections/band-padding.js";import{EventsMeta as S,EVENTS_PH as m}from"./meta.js";import{nodeViewHidden as A}from"efficient-web-builder/format/lib/content/view-hide-class";const F=()=>[{key:"sample-1",title:a("First card"),excerpt:a("A line about it appears here.")},{key:"sample-2",title:a("Second card"),excerpt:a("A line about it appears here.")},{key:"sample-3",title:a("Third card"),excerpt:a("A line about it appears here.")},{key:"sample-4",title:a("Fourth card"),excerpt:a("A line about it appears here.")}],o=(e,i,t)=>({slug:e.key||`card-${i}`,title:e.title??"",excerpt:e.excerpt??"",cover:e.cover??"",meta:e.meta||void 0,dateLabel:e.dateLabel||void 0,href:e.href||"#",...t?.facets?{facets:t.facets}:{},...t?.tags?{tags:t.tags}:{}}),L=e=>P(e,i=>({facets:k(i.facets),tags:x(i.tags)})),O={...S,render:e=>{const i=E(e.headPlacement)==="own-box",t=r=>i?void 0:r,s=l(e.linkText,m.link,e.editor),n=v(e)!==""?y(e,!!e.editor?.isEditing,F()):null,c=n&&!n.sample?L(e):null,u=n?n.sample?[]:n.rows.map((r,d)=>o(r,d,b(c,r,d))):e.posts;return f(h,{num:t(l(e.num,m.num,e.editor)),title:t(l(e.title,m.title,e.editor)),link:t(s?{text:s,href:C(e.linkHref)||"/journal"}:void 0),omitHead:i,posts:u,servedCategory:e.servedCategory,sample:n?.sample?n.rows.map((r,d)=>o(r,d)):void 0,columns:e.columns,limit:e.limit,showAll:e.showAll,skipCurrentPost:e.skipCurrentPost===!0,layout:e.layout,featuredWidth:e.featuredWidth,listCover:e.listCover,featuredDarken:e.featuredDarken,cardImage:e.cardImage,gap:e.gap,gapPhone:e[g("gap")],nameFilter:e.nameFilter===!0,pads:H(e),editing:e.editor?.isEditing,template:e.template,ownerId:String(e.id??""),viewHidden:A(e)})}};export{O as EventsRender};