efficient-web-builder 74.12.0 → 75.0.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.
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{UiIcon as i}from"efficient-easel/draw/client";import{arrowButtonClass as v,arrowsRailClass as d,HERO_ARROW_DIRECTIONS as R,HERO_ARROW_LABELS as c}from"../../format/lib/hero-arrows.js";const b={prev:"pointer-events-auto absolute left-3 top-1/2 -translate-y-1/2",next:"pointer-events-auto absolute right-3 top-1/2 -translate-y-1/2"};function h({shape:n,placement:l,ref:s,labels:u=c,onPress:a,sides:r=!1,part:f,buttonPart:p}){const o=v(n);return t("div",{ref:s,className:r?void 0:d(l),style:{color:"var(--overlay-fg)"},...f,children:R.map(e=>t("button",{type:"button","data-hero-nav":e,"aria-label":u[e],className:r?`${b[e]} ${o}`:o,onClick:a?m=>a(e,m):void 0,...p,children:t(i,{name:"chevron-right",size:18,rounded:!0,style:e==="prev"?{rotate:"180deg"}:void 0})},e))})}export{h as default};
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import{UiIcon as u}from"efficient-easel/draw/client";import{arrowButtonClass as m,arrowsRailClass as f,HERO_ARROW_DIRECTIONS as i,HERO_ARROW_LABELS as R}from"../../format/lib/hero-arrows.js";function c({shape:a,placement:o,ref:t,part:s,buttonPart:l}){const n=m(a);return e("div",{ref:t,className:f(o),style:{color:"var(--overlay-fg)"},...s,children:i.map(r=>e("button",{type:"button","data-hero-nav":r,"aria-label":R[r],className:n,...l,children:e(u,{name:"chevron-right",size:18,rounded:!0,style:r==="prev"?{rotate:"180deg"}:void 0})},r))})}export{c as default};
@@ -2,6 +2,7 @@ import { type SlotComponent } from "efficient-easel/blocks";
2
2
  import { type HeroReelShape } from "../../format/lib/reel.js";
3
3
  import { type HeroArrowShape } from "../../format/lib/hero-arrows.js";
4
4
  import type { HeroCopyAlignment } from "../../format/lib/hero-group-placement.js";
5
+ import type { HeroTextureShape } from "../../format/lib/hero-texture.js";
5
6
  import { HERO_SLIDER_GOTO_EVENT, type HeroSliderGotoDetail } from "efficient-easel/draw";
6
7
  export declare const HERO_VIDEO_PLAY_LABEL = "Play video";
7
8
  export declare const HERO_VIDEO_HOLD_LABEL = "Hold video";
@@ -14,6 +15,7 @@ interface Props {
14
15
  textureOpacity?: number;
15
16
  showTexture?: boolean;
16
17
  textureColor?: string;
18
+ textureShape?: HeroTextureShape;
17
19
  phoneUpDown?: string;
18
20
  phoneSideways?: string;
19
21
  phoneWordsTop?: number;
@@ -44,4 +46,4 @@ interface Props {
44
46
  editing?: boolean;
45
47
  partMotion?: Record<string, unknown>;
46
48
  }
47
- export default function HeroSection({ slides: Slides, strip: Strip, alignment, textureOpacity, showTexture, textureColor, phoneUpDown, phoneSideways, phoneWordsTop, phoneWordsBottom, phoneBoxGap, wordsTop, wordsBottom, wordsTopTablet, wordsBottomTablet, autoplay, autoplayInterval, showTicker, tickerItems, heightDesktop, heightTablet, heightMobile, heightFixed, heightFixedTablet, heightFixedMobile, showPicker, pickerShape, pickerPlacement, showArrows, arrowsShape, arrowsPlacement, editing, partMotion, }: Props): import("react").JSX.Element;
49
+ export default function HeroSection({ slides: Slides, strip: Strip, alignment, textureOpacity, showTexture, textureColor, textureShape, phoneUpDown, phoneSideways, phoneWordsTop, phoneWordsBottom, phoneBoxGap, wordsTop, wordsBottom, wordsTopTablet, wordsBottomTablet, autoplay, autoplayInterval, showTicker, tickerItems, heightDesktop, heightTablet, heightMobile, heightFixed, heightFixedTablet, heightFixedMobile, showPicker, pickerShape, pickerPlacement, showArrows, arrowsShape, arrowsPlacement, editing, partMotion, }: Props): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as n,jsxs as $}from"react/jsx-runtime";import{HideTaker as je}from"./ViewHideRoot.js";import{useCallback as v,useEffect as k,useId as qe,useRef as u,useState as y}from"react";import{markOverlayPortal as se}from"../../format/lib/document/overlay-portal.js";import Fe from"./Ticker.js";import{HeroSlideStyleContext as Ke}from"./HeroSlide.js";import{heroPhoneFrame as Je}from"../lib/hero-poster-sizes.js";import Qe from"./HeroArrows.js";import Ue from"./Reel.js";import{TICKER_PART_ATTR as We}from"./PreviewTickerContext.js";import{useReducedMotion as Ze}from"./useReducedMotion.js";import{heroHeightBox as et,heroStoresRatio as tt}from"../../format/lib/content/section-height.js";import{HEADER_HEIGHT_CSS as rt}from"../lib/document/header-clearance.js";import{nextReel as ot,normaliseHeroReelShape as nt,reelShown as st}from"../../format/lib/reel.js";import{arrowsShown as ct,arrowStep as at}from"../../format/lib/hero-arrows.js";import{swipeEnabled as lt,swipeStep as it}from"../../format/lib/hero-swipe.js";import{videoControlShown as ut,videoHeld as mt}from"../../format/lib/hero-video-control.js";import{HERO_SLIDER_GOTO_EVENT as B}from"efficient-easel/draw";import{say as ce}from"../../format/lib/editor-words.js";import{markedChildren as ae}from"../../format/lib/marked-children.js";import{legacyTickerDrawn as dt,TICKER_MOTION_PART as le}from"../../format/lib/hero-ticker.js";import{ON_MEDIA_INK_STYLE as ft}from"../../format/lib/content/ink.js";import{HeroPartBox as ht,heroPartScroll as pt}from"./HeroPictures.js";import{entranceDrawn as vt}from"../lib/animation/entrance.js";import{readPartMotion as bt}from"../lib/animation/part-motion.js";import{scrim as ie}from"../../format/lib/content/scrim.js";import{partAttr as b}from"../../format/lib/content/part-names.js";const xt="Play video",wt="Hold video",kt="flex h-7 cursor-pointer items-center gap-1.5 rounded-full border border-overlay-chrome/25 bg-overlay-scrim/80 px-[11px] font-mono text-[11px] leading-none tracking-[0.05em] text-overlay-fg",yt=()=>ce("item"),ue=new Map;function Et(d,l){const m=d?.ownerDocument?.defaultView;if(m)return m.addEventListener(B,l),()=>m.removeEventListener(B,l)}function gt({slides:d,strip:l,alignment:m,textureOpacity:T,showTexture:S,textureColor:O,phoneUpDown:me,phoneSideways:de,phoneWordsTop:fe,phoneWordsBottom:he,phoneBoxGap:pe,wordsTop:ve,wordsBottom:be,wordsTopTablet:xe,wordsBottomTablet:we,autoplay:z,autoplayInterval:H,showTicker:ke,tickerItems:X,heightDesktop:ye,heightTablet:Ee,heightMobile:G,heightFixed:ge,heightFixedTablet:_e,heightFixedMobile:Y,showPicker:Re,pickerShape:Te,pickerPlacement:Se,showArrows:Oe,arrowsShape:He,arrowsPlacement:Ne,editing:s,partMotion:j}){const q=et({heightDesktop:ye,heightTablet:Ee,heightMobile:G,heightFixed:ge,heightFixedTablet:_e,heightFixedMobile:Y}),{className:Ae,style:Le}=q,N=tt(q),F=(l?.blockCount??0)>0,Pe=!F&&dt({showTicker:ke,tickerItems:X}),K=(X??[]).map(e=>e?.text?.trim()?e.text:s?yt():"").filter(Boolean),Me=vt(bt({_partMotion:j},le)),Ce=pt(j,le),f=u(null),J=u(null),Q=u(null),A=u(null),U=qe(),L=u(U),[E,De]=y([]),[Ie,W]=y(0),x=u(0),[Z,ee]=y(!1),[Ve,te]=y(null),[g,$e]=y(!1),P=Ze(),_=v(()=>f.current?.querySelector(".hero-track")??null,[]),i=v((e,t=!1)=>{W(e),te(o=>o===e?o:null),x.current=e,ue.set(L.current,e);const r=f.current?.querySelector(".hero-track");if(r)if(t){const o=r.style.transition;r.style.transition="none",r.style.transform=`translateX(-${Math.max(0,e)*100}%)`,r.offsetHeight,r.style.transition=o}else r.style.transform=`translateX(-${Math.max(0,e)*100}%)`},[]);k(()=>{const e=f.current,t=e?.getAttribute("data-easel-block")||e?.closest("[data-easel-block]")?.getAttribute("data-easel-block")||U;L.current=t;const r=ue.get(t);typeof r=="number"&&(W(r),x.current=r)},[]),k(()=>{const e=_();if(!e)return;const t=()=>{De(o=>ot(o,ae(e,"data-slide-name")))};t();const r=new MutationObserver(t);return r.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-slide-name","data-slide-process","data-slide-media"]}),()=>{r.disconnect()}},[_]),k(()=>{if(!s)return;const e=t=>{const r=t.detail;if(!r||typeof r.index!="number")return;const o=f.current,p=o?.getAttribute("data-easel-block")||o?.closest("[data-easel-block]")?.getAttribute("data-easel-block")||L.current;r.id&&r.id!==p||i(r.index,!0)};return Et(f.current,e)},[s,i]);const c=E.length,a=Math.min(Math.max(Ie,0),Math.max(0,c-1)),M=Ve===a,C=st({shown:Re,count:c}),re=ct({shown:Oe,count:c}),oe=ut({editing:s,shown:a,slides:E}),Be=mt({editing:s,playing:g,controlShown:oe}),R=lt({count:c,editing:s}),h=u(null),w=u(null),ze=v(e=>{if(h.current=null,w.current=null,!R||e.touches.length!==1)return;const t=e.touches[0];h.current={x:t.clientX,y:t.clientY},w.current={x:t.clientX,y:t.clientY}},[R]),Xe=v(e=>{if(!h.current)return;if(e.touches.length!==1){h.current=null;return}const t=e.touches[0];w.current={x:t.clientX,y:t.clientY}},[]),Ge=v(()=>{const e=h.current,t=w.current;if(h.current=null,w.current=null,!R||!e||!t)return;const r=it(t.x-e.x,t.y-e.y,x.current,c);r!==x.current&&i(r)},[R,c,i]);k(()=>{if(s||!z||Z||M||P||c<=1)return;const t=Math.max(1,typeof H=="number"?H:6)*1e3,r=window.setTimeout(()=>i((a+1)%c),t);return()=>window.clearTimeout(r)},[s,z,H,Z,M,P,c,a,i]),k(()=>{const e=[J.current,Q.current,A.current].filter(Boolean),t=e.map(o=>se(o)),r=o=>{const p=o.target,D=p.closest("[data-hero-nav]");if(D&&!A.current?.contains(D))return;const I=D,ne=I??p.closest("[data-idx]");if(!ne)return;o.stopPropagation(),o.preventDefault();const V=I?at(I.dataset.heroNav,x.current,c):Number(ne.dataset.idx);Number.isNaN(V)||(i(V,s),ae(_(),"data-slide-name")[V]?.click())};return e.forEach(o=>o.addEventListener("click",r,{capture:!0})),()=>{t.forEach(o=>o?.()),e.forEach(o=>o.removeEventListener("click",r,{capture:!0}))}},[c,i,_,s]);const Ye=v(e=>{if(!e)return;const t=se(e),r=o=>{o.stopPropagation(),o.preventDefault(),$e(p=>!p)};return e.addEventListener("click",r,{capture:!0}),()=>{t?.(),e.removeEventListener("click",r,{capture:!0})}},[]);return n(Ke.Provider,{value:{alignment:m,textureOpacity:T,textureOn:S,textureColor:O,quietVideo:Be,phoneUpDown:me,phoneSideways:de,phoneWordsTop:fe,phoneWordsBottom:he,phoneBoxGap:pe,wordsTop:ve,wordsBottom:be,wordsTopTablet:xe,wordsBottomTablet:we,holdReel:()=>te(a),reelHeld:M,shownSlide:a,ratioMin:N,posterPhoneFrame:Je(G,Y)},children:$(je,{ref:f,className:`relative mx-[var(--sf-hero-bleed-m,calc(50%_-_50vw))] w-[var(--sf-hero-bleed-w,100vw)] ${Ae} max-w-[var(--sf-hero-cap,none)] ${N?"overflow-clip":"overflow-hidden"}`,style:Le,onMouseEnter:()=>ee(!0),onMouseLeave:()=>ee(!1),onTouchStart:ze,onTouchMove:Xe,onTouchEnd:Ge,...b("hero"),children:[n(d,{className:N?"hero-track flex min-h-full [&>*]:min-h-full [&>*]:min-w-full [&>*]:shrink-0 [&>*]:basis-full":"hero-track flex h-full [&>*]:h-full [&>*]:min-w-full [&>*]:shrink-0 [&>*]:basis-full",style:{transform:`translateX(-${a*100}%)`,transition:P?"none":"transform 600ms cubic-bezier(.22,.61,.36,1)"},minEmptyHeight:400}),oe&&n("div",{ref:Ye,"data-hero-video-control":g?"playing":"held",className:"sf-hero-video-control absolute left-6 z-[7]",style:{top:`calc(${rt} + 16px)`},children:$("button",{type:"button",className:kt,children:[n("span",{"aria-hidden":"true",children:g?"❚❚":"▶"}),ce(g?wt:xt)]})}),(C||re)&&$("div",{className:"pointer-events-none absolute inset-y-0 left-[var(--sf-hero-chrome-x,var(--sf-site-gutter,40px))] right-[var(--sf-hero-chrome-x,var(--sf-site-gutter,40px))] z-[6] mx-auto max-w-[var(--sf-hero-chrome-cap,calc(var(--sf-site-width,1600px)_-_var(--sf-site-gutter,40px)*2))]",children:[C&&n(Ue,{ref:J,slides:E,active:a,shape:nt(Te),placement:Se}),re&&n(Qe,{ref:A,shape:He,placement:Ne,part:b("arrows"),buttonPart:b("arrow")})]}),C&&n("div",{ref:Q,className:"sf-hero-phone-dots absolute bottom-[80px] left-1/2 z-[6] hidden -translate-x-1/2 items-center gap-2",...b("dots"),children:E.map((e,t)=>n("button",{type:"button","data-idx":t,"aria-label":`Go to slide ${t+1}`,className:`h-2 rounded-full transition-all motion-reduce:transition-none ${t===a?"w-5 bg-accent":"w-2 bg-white/45 hover:bg-white/70"}`,...b("dot")},t))}),F&&l&&n("div",{className:"sf-hero-strip absolute inset-x-0 bottom-0 z-[5] border-t border-overlay-chrome/10",style:{background:ie(.55),...ft},...b("strip"),children:n(l,{})}),Pe&&K.length>0&&n(_t,{editing:!!s,entrance:Me,scroll:Ce,children:n(Fe,{items:K,backdrop:"dark-media"})})]})})}function _t({editing:d,entrance:l,scroll:m,children:T}){const S="sf-hero-ticker absolute inset-x-0 bottom-0 z-[5] border-t border-overlay-chrome/10 py-3.5",O=d?{[We]:""}:void 0;return n(ht,{entrance:l,scroll:m,editing:d,className:S,attrs:O,style:{background:ie(.55)},children:T})}export{B as HERO_SLIDER_GOTO_EVENT,wt as HERO_VIDEO_HOLD_LABEL,xt as HERO_VIDEO_PLAY_LABEL,gt as default,Et as subscribeSliderGoto};
1
+ "use client";import{jsx as n,jsxs as $}from"react/jsx-runtime";import{HideTaker as qe}from"./ViewHideRoot.js";import{useCallback as v,useEffect as k,useId as Fe,useRef as u,useState as y}from"react";import{markOverlayPortal as se}from"../../format/lib/document/overlay-portal.js";import Ke from"./Ticker.js";import{HeroSlideStyleContext as Je}from"./HeroSlide.js";import{heroPhoneFrame as Qe}from"../lib/hero-poster-sizes.js";import Ue from"./HeroArrows.js";import We from"./Reel.js";import{TICKER_PART_ATTR as Ze}from"./PreviewTickerContext.js";import{useReducedMotion as et}from"./useReducedMotion.js";import{heroHeightBox as tt,heroStoresRatio as rt}from"../../format/lib/content/section-height.js";import{HEADER_HEIGHT_CSS as ot}from"../lib/document/header-clearance.js";import{nextReel as nt,normaliseHeroReelShape as st,reelShown as ct}from"../../format/lib/reel.js";import{arrowsShown as at,arrowStep as lt}from"../../format/lib/hero-arrows.js";import{swipeEnabled as it,swipeStep as ut}from"../../format/lib/hero-swipe.js";import{videoControlShown as mt,videoHeld as dt}from"../../format/lib/hero-video-control.js";import{HERO_SLIDER_GOTO_EVENT as B}from"efficient-easel/draw";import{say as ce}from"../../format/lib/editor-words.js";import{markedChildren as ae}from"../../format/lib/marked-children.js";import{legacyTickerDrawn as ft,TICKER_MOTION_PART as le}from"../../format/lib/hero-ticker.js";import{ON_MEDIA_INK_STYLE as ht}from"../../format/lib/content/ink.js";import{HeroPartBox as pt,heroPartScroll as vt}from"./HeroPictures.js";import{entranceDrawn as bt}from"../lib/animation/entrance.js";import{readPartMotion as xt}from"../lib/animation/part-motion.js";import{scrim as ie}from"../../format/lib/content/scrim.js";import{partAttr as b}from"../../format/lib/content/part-names.js";const wt="Play video",kt="Hold video",yt="flex h-7 cursor-pointer items-center gap-1.5 rounded-full border border-overlay-chrome/25 bg-overlay-scrim/80 px-[11px] font-mono text-[11px] leading-none tracking-[0.05em] text-overlay-fg",Et=()=>ce("item"),ue=new Map;function gt(d,l){const m=d?.ownerDocument?.defaultView;if(m)return m.addEventListener(B,l),()=>m.removeEventListener(B,l)}function _t({slides:d,strip:l,alignment:m,textureOpacity:T,showTexture:S,textureColor:O,textureShape:me,phoneUpDown:de,phoneSideways:fe,phoneWordsTop:he,phoneWordsBottom:pe,phoneBoxGap:ve,wordsTop:be,wordsBottom:xe,wordsTopTablet:we,wordsBottomTablet:ke,autoplay:z,autoplayInterval:H,showTicker:ye,tickerItems:X,heightDesktop:Ee,heightTablet:ge,heightMobile:G,heightFixed:_e,heightFixedTablet:Re,heightFixedMobile:Y,showPicker:Te,pickerShape:Se,pickerPlacement:Oe,showArrows:He,arrowsShape:Ne,arrowsPlacement:Ae,editing:s,partMotion:j}){const q=tt({heightDesktop:Ee,heightTablet:ge,heightMobile:G,heightFixed:_e,heightFixedTablet:Re,heightFixedMobile:Y}),{className:Le,style:Pe}=q,N=rt(q),F=(l?.blockCount??0)>0,Me=!F&&ft({showTicker:ye,tickerItems:X}),K=(X??[]).map(e=>e?.text?.trim()?e.text:s?Et():"").filter(Boolean),Ce=bt(xt({_partMotion:j},le)),De=vt(j,le),f=u(null),J=u(null),Q=u(null),A=u(null),U=Fe(),L=u(U),[E,Ie]=y([]),[Ve,W]=y(0),x=u(0),[Z,ee]=y(!1),[$e,te]=y(null),[g,Be]=y(!1),P=et(),_=v(()=>f.current?.querySelector(".hero-track")??null,[]),i=v((e,t=!1)=>{W(e),te(o=>o===e?o:null),x.current=e,ue.set(L.current,e);const r=f.current?.querySelector(".hero-track");if(r)if(t){const o=r.style.transition;r.style.transition="none",r.style.transform=`translateX(-${Math.max(0,e)*100}%)`,r.offsetHeight,r.style.transition=o}else r.style.transform=`translateX(-${Math.max(0,e)*100}%)`},[]);k(()=>{const e=f.current,t=e?.getAttribute("data-easel-block")||e?.closest("[data-easel-block]")?.getAttribute("data-easel-block")||U;L.current=t;const r=ue.get(t);typeof r=="number"&&(W(r),x.current=r)},[]),k(()=>{const e=_();if(!e)return;const t=()=>{Ie(o=>nt(o,ae(e,"data-slide-name")))};t();const r=new MutationObserver(t);return r.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-slide-name","data-slide-process","data-slide-media"]}),()=>{r.disconnect()}},[_]),k(()=>{if(!s)return;const e=t=>{const r=t.detail;if(!r||typeof r.index!="number")return;const o=f.current,p=o?.getAttribute("data-easel-block")||o?.closest("[data-easel-block]")?.getAttribute("data-easel-block")||L.current;r.id&&r.id!==p||i(r.index,!0)};return gt(f.current,e)},[s,i]);const c=E.length,a=Math.min(Math.max(Ve,0),Math.max(0,c-1)),M=$e===a,C=ct({shown:Te,count:c}),re=at({shown:He,count:c}),oe=mt({editing:s,shown:a,slides:E}),ze=dt({editing:s,playing:g,controlShown:oe}),R=it({count:c,editing:s}),h=u(null),w=u(null),Xe=v(e=>{if(h.current=null,w.current=null,!R||e.touches.length!==1)return;const t=e.touches[0];h.current={x:t.clientX,y:t.clientY},w.current={x:t.clientX,y:t.clientY}},[R]),Ge=v(e=>{if(!h.current)return;if(e.touches.length!==1){h.current=null;return}const t=e.touches[0];w.current={x:t.clientX,y:t.clientY}},[]),Ye=v(()=>{const e=h.current,t=w.current;if(h.current=null,w.current=null,!R||!e||!t)return;const r=ut(t.x-e.x,t.y-e.y,x.current,c);r!==x.current&&i(r)},[R,c,i]);k(()=>{if(s||!z||Z||M||P||c<=1)return;const t=Math.max(1,typeof H=="number"?H:6)*1e3,r=window.setTimeout(()=>i((a+1)%c),t);return()=>window.clearTimeout(r)},[s,z,H,Z,M,P,c,a,i]),k(()=>{const e=[J.current,Q.current,A.current].filter(Boolean),t=e.map(o=>se(o)),r=o=>{const p=o.target,D=p.closest("[data-hero-nav]");if(D&&!A.current?.contains(D))return;const I=D,ne=I??p.closest("[data-idx]");if(!ne)return;o.stopPropagation(),o.preventDefault();const V=I?lt(I.dataset.heroNav,x.current,c):Number(ne.dataset.idx);Number.isNaN(V)||(i(V,s),ae(_(),"data-slide-name")[V]?.click())};return e.forEach(o=>o.addEventListener("click",r,{capture:!0})),()=>{t.forEach(o=>o?.()),e.forEach(o=>o.removeEventListener("click",r,{capture:!0}))}},[c,i,_,s]);const je=v(e=>{if(!e)return;const t=se(e),r=o=>{o.stopPropagation(),o.preventDefault(),Be(p=>!p)};return e.addEventListener("click",r,{capture:!0}),()=>{t?.(),e.removeEventListener("click",r,{capture:!0})}},[]);return n(Je.Provider,{value:{alignment:m,textureOpacity:T,textureOn:S,textureColor:O,textureShape:me,quietVideo:ze,phoneUpDown:de,phoneSideways:fe,phoneWordsTop:he,phoneWordsBottom:pe,phoneBoxGap:ve,wordsTop:be,wordsBottom:xe,wordsTopTablet:we,wordsBottomTablet:ke,holdReel:()=>te(a),reelHeld:M,shownSlide:a,ratioMin:N,posterPhoneFrame:Qe(G,Y)},children:$(qe,{ref:f,className:`relative mx-[var(--sf-hero-bleed-m,calc(50%_-_50vw))] w-[var(--sf-hero-bleed-w,100vw)] ${Le} max-w-[var(--sf-hero-cap,none)] ${N?"overflow-clip":"overflow-hidden"}`,style:Pe,onMouseEnter:()=>ee(!0),onMouseLeave:()=>ee(!1),onTouchStart:Xe,onTouchMove:Ge,onTouchEnd:Ye,...b("hero"),children:[n(d,{className:N?"hero-track flex min-h-full [&>*]:min-h-full [&>*]:min-w-full [&>*]:shrink-0 [&>*]:basis-full":"hero-track flex h-full [&>*]:h-full [&>*]:min-w-full [&>*]:shrink-0 [&>*]:basis-full",style:{transform:`translateX(-${a*100}%)`,transition:P?"none":"transform 600ms cubic-bezier(.22,.61,.36,1)"},minEmptyHeight:400}),oe&&n("div",{ref:je,"data-hero-video-control":g?"playing":"held",className:"sf-hero-video-control absolute left-6 z-[7]",style:{top:`calc(${ot} + 16px)`},children:$("button",{type:"button",className:yt,children:[n("span",{"aria-hidden":"true",children:g?"❚❚":"▶"}),ce(g?kt:wt)]})}),(C||re)&&$("div",{className:"pointer-events-none absolute inset-y-0 left-[var(--sf-hero-chrome-x,var(--sf-site-gutter,40px))] right-[var(--sf-hero-chrome-x,var(--sf-site-gutter,40px))] z-[6] mx-auto max-w-[var(--sf-hero-chrome-cap,calc(var(--sf-site-width,1600px)_-_var(--sf-site-gutter,40px)*2))]",children:[C&&n(We,{ref:J,slides:E,active:a,shape:st(Se),placement:Oe}),re&&n(Ue,{ref:A,shape:Ne,placement:Ae,part:b("arrows"),buttonPart:b("arrow")})]}),C&&n("div",{ref:Q,className:"sf-hero-phone-dots absolute bottom-[80px] left-1/2 z-[6] hidden -translate-x-1/2 items-center gap-2",...b("dots"),children:E.map((e,t)=>n("button",{type:"button","data-idx":t,"aria-label":`Go to slide ${t+1}`,className:`h-2 rounded-full transition-all motion-reduce:transition-none ${t===a?"w-5 bg-accent":"w-2 bg-white/45 hover:bg-white/70"}`,...b("dot")},t))}),F&&l&&n("div",{className:"sf-hero-strip absolute inset-x-0 bottom-0 z-[5] border-t border-overlay-chrome/10",style:{background:ie(.55),...ht},...b("strip"),children:n(l,{})}),Me&&K.length>0&&n(Rt,{editing:!!s,entrance:Ce,scroll:De,children:n(Ke,{items:K,backdrop:"dark-media"})})]})})}function Rt({editing:d,entrance:l,scroll:m,children:T}){const S="sf-hero-ticker absolute inset-x-0 bottom-0 z-[5] border-t border-overlay-chrome/10 py-3.5",O=d?{[Ze]:""}:void 0;return n(pt,{entrance:l,scroll:m,editing:d,className:S,attrs:O,style:{background:ie(.55)},children:T})}export{B as HERO_SLIDER_GOTO_EVENT,kt as HERO_VIDEO_HOLD_LABEL,wt as HERO_VIDEO_PLAY_LABEL,_t as default,gt as subscribeSliderGoto};
@@ -1,12 +1,14 @@
1
1
  import type { CSSProperties } from "react";
2
2
  import type { SlotComponent } from "efficient-easel/blocks";
3
3
  import { type HeroCopyAlignment } from "../../format/lib/hero-group-placement.js";
4
+ import { type HeroTextureShape } from "../../format/lib/hero-texture.js";
4
5
  import { type HeroMediaType } from "../../format/lib/hero-media-layout.js";
5
6
  export interface HeroSlideStyle {
6
7
  alignment?: HeroCopyAlignment;
7
8
  textureOpacity?: number;
8
9
  textureOn?: boolean;
9
10
  textureColor?: string;
11
+ textureShape?: HeroTextureShape;
10
12
  phoneUpDown?: string;
11
13
  phoneSideways?: string;
12
14
  phoneWordsTop?: number;
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as M}from"react/jsx-runtime";import{useTakeViewHide as Ie,withViewHide as Be}from"./ViewHideRoot.js";import{SIDE_ONCE_HOLDS_CLASS as De}from"../../format/lib/content/page-width.js";import{useSideSpaceOnce as Re}from"./SideSpaceOnce.js";import{createContext as Ve,useContext as Fe,useEffect as je,useRef as ze,useState as Y}from"react";import We from"./HeroPoster.js";import{HeroMediaLayer as $e,heroMediaReading as Me,HeroPickArea as Ye,heroPartEntrance as qe,heroPartHover as Ge,heroPartScroll as Ue,heroPictureOrigins as Ke,HeroPictureHover as Je,heroPicturesHover as Qe,HeroTint as Xe,HeroTwoPictures as Ze}from"./HeroPictures.js";import{HeroVideoBackdrop as eo,HeroVideoPlayer as oo}from"./HeroVideoPlay.js";import{BelowFirstScreen as ro,useFirstScreenPlace as to}from"../lib/first-screen.js";import{markedChildren as io}from"../../format/lib/marked-children.js";import{resolveMedia as r}from"../lib/media.js";import{heroPhoneStackStyle as so,heroPhoneWordsStyle as no,heroWordsSpace as ao}from"../../format/lib/hero-phone-stack.js";import{heroTextureGradient as lo,heroTextureShown as co}from"../../format/lib/hero-texture.js";import{ON_MEDIA_INK_STYLE as fo}from"../../format/lib/content/ink.js";import{DEFAULT_TINT as q}from"../../format/lib/content/tint.js";import{HERO_ABSENT_MEDIA_TYPE as po}from"../../format/lib/hero-media-layout.js";import{overlayGradient as uo,slideOverlayState as mo}from"../../format/lib/sections/hero-overlay.js";import ho from"./PhotoHoverSheet.js";import{partAttr as P}from"../../format/lib/content/part-names.js";const So=Ve({});function vo({name:g,process:d,mediaType:G=po.HeroSlide,mediaSrc:c,videoSpeed:H,poster:T,mediaAv1:U,mediaSrcPhone:K,mediaAv1Phone:J,posterPhone:Q,objectPosition:f,objectPositionPhone:p,objectPositionTablet:u,tintColor:E=q,tintOpacity:b=0,groups:k,editing:i=!1,themeClassName:_,themeStyle:X,overlayColor:Z,overlayPosition:ee,mediaLayout:oe,mediaLayoutPhone:re,mediaImage2:te,objectPosition2:ie,objectPosition2Phone:se,objectPosition2Tablet:ne,tintColor2:ae=q,tintOpacity2:le=0,videoSource:de,youtubeUrl:ce,videoPlayback:fe,partMotion:s,laterSlide:m=!1}){const pe=Re(),h=Ie(),{alignment:yo="left",textureOpacity:O,textureOn:ue,textureColor:me,quietVideo:he,phoneUpDown:Se,phoneSideways:ve,phoneWordsTop:ye,phoneWordsBottom:we,phoneBoxGap:xe,wordsTop:Pe,wordsBottom:ge,wordsTopTablet:He,wordsBottomTablet:Te,holdReel:Ee,reelHeld:be,shownSlide:S,ratioMin:A,posterPhoneFrame:ke}=Fe(So),L=ao(Pe,ge,He,Te),_e=to(),N=m&&_e==="first",C=ze(null),[Oe,Ae]=Y(S===void 0?void 0:!1);je(()=>{const x=C.current;Ae(S===void 0||!x?void 0:io(x.closest(".hero-track"),"data-slide-name")[S]===x)});const o=G==="video",v=o?r(c):void 0,I=o?r(T):r(c)??r(T),t=o?{av1:r(U),phone:r(K),av1Phone:r(J),poster:r(Q)}:{},Le=typeof H=="number"?H/100:1,{fromYouTube:n,onClick:B,youTubeId:D,backgroundFile:a,desktopLayout:Ne,phoneLayout:Ce,twoPictures:R}=Me({isVideo:o,videoSource:de,videoPlayback:fe,youtubeUrl:ce,mediaLayout:oe,mediaLayoutPhone:re}),[y,V]=Y(!1);y&&be===!1&&V(!1);const w=!y,l=mo({overlayColor:Z,overlayPosition:ee},me),F=o?null:qe(s,"image"),j=o?null:Ue(s,"image"),z=Qe(s),W=e(Je,{treatment:o?{}:Ge(s,"image"),children:e(We,{videoSrc:a?v:void 0,videoAv1Src:a?t.av1:void 0,videoSrcPhone:a?t.phone:void 0,videoAv1SrcPhone:a?t.av1Phone:void 0,posterSrc:I,posterSrcPhone:t.poster,showVideo:a,playbackRate:Le,objectPosition:f,objectPositionPhone:o?void 0:p,objectPositionTablet:o?void 0:u,quiet:he,slideShown:Oe,laterSlide:m,laterOfLead:N,phoneFrame:ke})}),$=M("section",{ref:C,className:Be(`${A?"relative flex min-h-full w-full flex-col overflow-clip":"relative h-full w-full overflow-hidden"}${_?` ${_}`:""}`,h.className),...h.attrs,style:X,"data-slide-name":g??"","data-slide-process":d??"","data-slide-media":a&&v?"video":"still",...z.hostAttrs,...P("slide"),children:[e(ho,{sheet:z.sheet}),e($e,{partMotion:s,editing:i,children:R?e(Ze,{laterSlide:m,desktopLayout:Ne,phoneLayout:Ce,editing:i,partMotion:s,first:{src:c,objectPosition:f,objectPositionPhone:p,objectPositionTablet:u,tintColor:E,tintOpacity:b},second:{src:te,objectPosition:ie,objectPositionPhone:se,objectPositionTablet:ne,tintColor:ae,tintOpacity:le}}):n||F||j?M(Ye,{part:o?"media":"image",editing:i,entrance:F,scroll:j,origins:Ke({objectPosition:f,objectPositionTablet:u,objectPositionPhone:p}),className:"absolute inset-0 z-[1]",children:[W,n&&e(eo,{youTubeId:D,ownPoster:!!I,background:!B,editing:i})]}):W}),B&&e(oo,{youTubeId:D,fileSrc:n?void 0:v,fileAv1Src:n?void 0:t.av1,fileSrcPhone:n?void 0:t.phone,fileAv1SrcPhone:n?void 0:t.av1Phone,playing:y,onPlay:()=>{V(!0),Ee?.()},editing:i}),w&&!R&&e(Xe,{color:E,opacity:b,passClicks:!1}),w&&co(ue)&&e("div",{className:"absolute inset-0 z-[2]",style:{background:l.own?uo(l.color,l.position??void 0):lo(l.color),...O!==void 0?{opacity:O/100}:null},...P("overlay")}),w&&e("div",{className:[A?"sf-hero-group-layer relative z-[3] mx-auto w-full flex-1 max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)]":"sf-hero-group-layer absolute inset-0 z-[3] mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)]",L.className??"pt-[140px] pb-14",pe?De:"",i?"sf-hero-group-layer-edit":""].filter(Boolean).join(" "),style:{...fo,...so(Se,ve),...no(ye,we,xe),...L.style},...P("hero-content"),children:k&&e(k,{className:"sf-hero-group-zone",minEmptyHeight:160})})]});return h.scope(N?e(ro,{children:$}):$)}const Vo=Array.from({length:3},(g,d)=>({name:`Slide ${d+1}`,process:"Category",mediaType:"image",mediaVideo:"",poster:""}));export{Vo as HERO_SLIDE_SEEDS,So as HeroSlideStyleContext,vo as default};
1
+ "use client";import{jsx as e,jsxs as M}from"react/jsx-runtime";import{useTakeViewHide as Be,withViewHide as De}from"./ViewHideRoot.js";import{SIDE_ONCE_HOLDS_CLASS as Re}from"../../format/lib/content/page-width.js";import{useSideSpaceOnce as Ve}from"./SideSpaceOnce.js";import{createContext as Fe,useContext as je,useEffect as ze,useRef as We,useState as Y}from"react";import $e from"./HeroPoster.js";import{HeroMediaLayer as Me,heroMediaReading as Ye,HeroPickArea as qe,heroPartEntrance as Ge,heroPartHover as Ue,heroPartScroll as Ke,heroPictureOrigins as Je,HeroPictureHover as Qe,heroPicturesHover as Xe,HeroTint as Ze,HeroTwoPictures as eo}from"./HeroPictures.js";import{HeroVideoBackdrop as oo,HeroVideoPlayer as ro}from"./HeroVideoPlay.js";import{BelowFirstScreen as to,useFirstScreenPlace as io}from"../lib/first-screen.js";import{markedChildren as so}from"../../format/lib/marked-children.js";import{resolveMedia as r}from"../lib/media.js";import{heroPhoneStackStyle as no,heroPhoneWordsStyle as ao,heroWordsSpace as lo}from"../../format/lib/hero-phone-stack.js";import{heroTextureGradient as co,heroTextureShown as po}from"../../format/lib/hero-texture.js";import{ON_MEDIA_INK_STYLE as fo}from"../../format/lib/content/ink.js";import{DEFAULT_TINT as q}from"../../format/lib/content/tint.js";import{HERO_ABSENT_MEDIA_TYPE as uo}from"../../format/lib/hero-media-layout.js";import{overlayGradient as mo,slideOverlayState as ho}from"../../format/lib/sections/hero-overlay.js";import So from"./PhotoHoverSheet.js";import{partAttr as P}from"../../format/lib/content/part-names.js";const vo=Fe({});function yo({name:g,process:d,mediaType:G=uo.HeroSlide,mediaSrc:c,videoSpeed:H,poster:T,mediaAv1:U,mediaSrcPhone:K,mediaAv1Phone:J,posterPhone:Q,objectPosition:p,objectPositionPhone:f,objectPositionTablet:u,tintColor:E=q,tintOpacity:b=0,groups:k,editing:i=!1,themeClassName:_,themeStyle:X,overlayColor:Z,overlayPosition:ee,mediaLayout:oe,mediaLayoutPhone:re,mediaImage2:te,objectPosition2:ie,objectPosition2Phone:se,objectPosition2Tablet:ne,tintColor2:ae=q,tintOpacity2:le=0,videoSource:de,youtubeUrl:ce,videoPlayback:pe,partMotion:s,laterSlide:m=!1}){const fe=Ve(),h=Be(),{alignment:wo="left",textureOpacity:O,textureOn:ue,textureColor:me,textureShape:he,quietVideo:Se,phoneUpDown:ve,phoneSideways:ye,phoneWordsTop:we,phoneWordsBottom:xe,phoneBoxGap:Pe,wordsTop:ge,wordsBottom:He,wordsTopTablet:Te,wordsBottomTablet:Ee,holdReel:be,reelHeld:ke,shownSlide:S,ratioMin:A,posterPhoneFrame:_e}=je(vo),L=lo(ge,He,Te,Ee),Oe=io(),N=m&&Oe==="first",C=We(null),[Ae,Le]=Y(S===void 0?void 0:!1);ze(()=>{const x=C.current;Le(S===void 0||!x?void 0:so(x.closest(".hero-track"),"data-slide-name")[S]===x)});const o=G==="video",v=o?r(c):void 0,I=o?r(T):r(c)??r(T),t=o?{av1:r(U),phone:r(K),av1Phone:r(J),poster:r(Q)}:{},Ne=typeof H=="number"?H/100:1,{fromYouTube:n,onClick:B,youTubeId:D,backgroundFile:a,desktopLayout:Ce,phoneLayout:Ie,twoPictures:R}=Ye({isVideo:o,videoSource:de,videoPlayback:pe,youtubeUrl:ce,mediaLayout:oe,mediaLayoutPhone:re}),[y,V]=Y(!1);y&&ke===!1&&V(!1);const w=!y,l=ho({overlayColor:Z,overlayPosition:ee},me),F=o?null:Ge(s,"image"),j=o?null:Ke(s,"image"),z=Xe(s),W=e(Qe,{treatment:o?{}:Ue(s,"image"),children:e($e,{videoSrc:a?v:void 0,videoAv1Src:a?t.av1:void 0,videoSrcPhone:a?t.phone:void 0,videoAv1SrcPhone:a?t.av1Phone:void 0,posterSrc:I,posterSrcPhone:t.poster,showVideo:a,playbackRate:Ne,objectPosition:p,objectPositionPhone:o?void 0:f,objectPositionTablet:o?void 0:u,quiet:Se,slideShown:Ae,laterSlide:m,laterOfLead:N,phoneFrame:_e})}),$=M("section",{ref:C,className:De(`${A?"relative flex min-h-full w-full flex-col overflow-clip":"relative h-full w-full overflow-hidden"}${_?` ${_}`:""}`,h.className),...h.attrs,style:X,"data-slide-name":g??"","data-slide-process":d??"","data-slide-media":a&&v?"video":"still",...z.hostAttrs,...P("slide"),children:[e(So,{sheet:z.sheet}),e(Me,{partMotion:s,editing:i,children:R?e(eo,{laterSlide:m,desktopLayout:Ce,phoneLayout:Ie,editing:i,partMotion:s,first:{src:c,objectPosition:p,objectPositionPhone:f,objectPositionTablet:u,tintColor:E,tintOpacity:b},second:{src:te,objectPosition:ie,objectPositionPhone:se,objectPositionTablet:ne,tintColor:ae,tintOpacity:le}}):n||F||j?M(qe,{part:o?"media":"image",editing:i,entrance:F,scroll:j,origins:Je({objectPosition:p,objectPositionTablet:u,objectPositionPhone:f}),className:"absolute inset-0 z-[1]",children:[W,n&&e(oo,{youTubeId:D,ownPoster:!!I,background:!B,editing:i})]}):W}),B&&e(ro,{youTubeId:D,fileSrc:n?void 0:v,fileAv1Src:n?void 0:t.av1,fileSrcPhone:n?void 0:t.phone,fileAv1SrcPhone:n?void 0:t.av1Phone,playing:y,onPlay:()=>{V(!0),be?.()},editing:i}),w&&!R&&e(Ze,{color:E,opacity:b,passClicks:!1}),w&&po(ue)&&e("div",{className:"absolute inset-0 z-[2]",style:{background:l.own?mo(l.color,l.position??void 0):co(l.color,he),...O!==void 0?{opacity:O/100}:null},...P("overlay")}),w&&e("div",{className:[A?"sf-hero-group-layer relative z-[3] mx-auto w-full flex-1 max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)]":"sf-hero-group-layer absolute inset-0 z-[3] mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)]",L.className??"pt-[140px] pb-14",fe?Re:"",i?"sf-hero-group-layer-edit":""].filter(Boolean).join(" "),style:{...fo,...no(ve,ye),...ao(we,xe,Pe),...L.style},...P("hero-content"),children:k&&e(k,{className:"sf-hero-group-zone",minEmptyHeight:160})})]});return h.scope(N?e(to,{children:$}):$)}const Fo=Array.from({length:3},(g,d)=>({name:`Slide ${d+1}`,process:"Category",mediaType:"image",mediaVideo:"",poster:""}));export{Fo as HERO_SLIDE_SEEDS,vo as HeroSlideStyleContext,yo as default};
@@ -1,24 +1,8 @@
1
1
  import type { HoverMediaCover } from "../../format/lib/animation/hover.js";
2
- import { type HeroArrowDirection } from "../../format/lib/hero-arrows.js";
3
- import { type HoverMediaPick } from "../../format/lib/content/hover-media.js";
2
+ import type { HoverMediaPick } from "../../format/lib/content/hover-media.js";
4
3
  export interface HoverMediaLayerProps {
5
4
  media: HoverMediaPick | null;
6
- name: string;
7
5
  cover?: HoverMediaCover;
8
6
  ground?: string;
9
- arrowsAbove?: boolean;
10
7
  }
11
- export interface HoverArrowsState {
12
- name: string;
13
- count: number;
14
- shown: boolean;
15
- press: (direction: HeroArrowDirection, e: {
16
- preventDefault(): void;
17
- stopPropagation(): void;
18
- }) => void;
19
- }
20
- export declare const HoverArrowsSlot: import("react").Context<((state: HoverArrowsState | null) => void) | null>;
21
- export declare function HoverMediaArrows({ state }: {
22
- state: HoverArrowsState;
23
- }): import("react").JSX.Element;
24
- export default function HoverMediaLayer({ media, name, cover, ground, arrowsAbove }: HoverMediaLayerProps): import("react").JSX.Element | null;
8
+ export default function HoverMediaLayer({ media, cover, ground }: HoverMediaLayerProps): import("react").JSX.Element | null;
@@ -1 +1 @@
1
- "use client";import{jsx as w,jsxs as P,Fragment as q}from"react/jsx-runtime";import{createContext as B,useCallback as V,useContext as G,useEffect as A,useRef as J,useState as E}from"react";import K from"./HeroArrows.js";import{arrowStep as Q,HERO_ARROW_DIRECTIONS as U}from"../../format/lib/hero-arrows.js";import{hoverArrowLabel as X,hoverMediaCount as Z}from"../../format/lib/content/hover-media.js";import{CARD_COPY_ATTR as ee,PHOTO_HOST_ATTR as te}from"../../format/lib/content/image-treatment.js";import{useDeferredPicture as ne}from"../lib/first-screen.js";import{sizedImage as $}from"../../format/lib/sized-image.js";const re=B(null);function N({name:t,count:s,press:o}){if(s<2)return null;const a=Object.fromEntries(U.map(l=>[l,X(l,t)]));return w(K,{shape:"solid",sides:!0,labels:a,onPress:o})}function Ae({state:t}){return w("div",{className:ce,style:{opacity:t.shown?1:0},children:N(t)})}const oe=200,k="data-hover-media-anchor";function se(t){const s=t.closest(`[${ee}]`);for(let o=t.parentElement;o;o=o.parentElement){const a=!s?.contains(o)&&[...o.children].some(d=>d.matches("a[href]"));if(o.hasAttribute(te)||a)return o.querySelectorAll(`[${k}]`).length===1?o:null}return null}const b="transition-opacity duration-200 motion-reduce:transition-none",ie={card:`pointer-events-none absolute inset-0 z-20 overflow-hidden rounded-[inherit] ${b}`,picture:`pointer-events-none absolute inset-0 z-20 overflow-hidden ${b}`},ce=`pointer-events-none absolute inset-0 ${b}`,ae={cover:"h-full w-full object-cover",contain:"h-full w-full object-contain"};function W(t){const s=$(t,{fallbackWidth:960});return s.src===t?{src:t}:{src:s.src,srcSet:`${s.src} 1x, ${$(t,{fallbackWidth:1280}).src} 2x`}}const Y=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(hover: hover) and (pointer: fine)").matches;function le({media:t,name:s,cover:o="card",ground:a,arrowsAbove:l=!1}){const d=J(null),z=ne(),[c,S]=E(!1),[L,x]=E(!1),[m,O]=E(0),[T,y]=E(!1),u=G(re),_=l&&u!==null,p=t?.urls??[],n=p.length;A(()=>{const i=d.current;if(!i||n===0)return;const e=se(i)??i.parentElement;if(!e)return;let r,h=!1;const g=()=>{r!==void 0&&clearTimeout(r),r=void 0,S(!1),x(!1),O(0),y(!1),h=!1},H=f=>{f.pointerType!=="mouse"||!Y()||(r!==void 0&&clearTimeout(r),r=setTimeout(()=>{r=void 0,S(!0)},oe))},I=f=>{if(f.pointerType==="mouse"){if(!h&&e.contains(document.activeElement)){r!==void 0&&clearTimeout(r),r=void 0;return}g()}},M=()=>{h=!0},j=()=>{!h&&Y()&&S(!0)},D=f=>{const F=f.relatedTarget;(!F||!e.contains(F))&&g()};return e.addEventListener("pointerenter",H),e.addEventListener("pointerleave",I),e.addEventListener("pointerdown",M),e.addEventListener("focusin",j),e.addEventListener("focusout",D),()=>{r!==void 0&&clearTimeout(r),e.removeEventListener("pointerenter",H),e.removeEventListener("pointerleave",I),e.removeEventListener("pointerdown",M),e.removeEventListener("focusin",j),e.removeEventListener("focusout",D)}},[n]),A(()=>{if(!c)return;const i=requestAnimationFrame(()=>x(!0));return()=>cancelAnimationFrame(i)},[c]),A(()=>{if(!c||!T||n<2)return;const i=new Image,e=W(p[(m+1)%n]);e.srcSet&&(i.srcset=e.srcSet),i.src=e.src},[c,T,m,n,p]);const R=V((i,e)=>{e.preventDefault(),e.stopPropagation(),y(!0),O(r=>Q(i,r,n))},[n]),C=!!t&&c&&n>1;if(A(()=>{if(!(!_||!u))return u(C?{name:s,count:n,shown:L,press:R}:null),()=>u(null)},[_,u,C,s,n,L,R]),!t||n===0)return null;const v=c?W(p[Math.min(m,n-1)]):null;return P(q,{children:[w("span",{ref:d,className:"sr-only","aria-live":"polite",[k]:"",children:c&&T?Z(m,n):""}),v?P("div",{"data-hover-media":"","data-hover-cover":o,className:ie[o],style:{opacity:L?1:0,...a?{backgroundColor:a}:{}},children:[w("img",{src:v.src,...v.srcSet?{srcSet:v.srcSet}:{},alt:"",decoding:"async",...z,className:ae[t.fit]}),_?null:N({name:s,count:n,press:R})]}):null]})}export{re as HoverArrowsSlot,Ae as HoverMediaArrows,le as default};
1
+ "use client";import{jsx as m,Fragment as C,jsxs as j}from"react/jsx-runtime";import{useEffect as S,useRef as F,useState as y}from"react";import{CARD_COPY_ATTR as $,PHOTO_HOST_ATTR as H}from"../../format/lib/content/image-treatment.js";import{useDeferredPicture as I}from"../lib/first-screen.js";import{sizedImage as R}from"../../format/lib/sized-image.js";const M=200,O="data-hover-media-anchor";function k(e){const o=e.closest(`[${$}]`);for(let r=e.parentElement;r;r=r.parentElement){const a=!o?.contains(r)&&[...r.children].some(s=>s.matches("a[href]"));if(r.hasAttribute(H)||a)return r.querySelectorAll(`[${O}]`).length===1?r:null}return null}const b="transition-opacity duration-200 motion-reduce:transition-none",D={card:`pointer-events-none absolute inset-0 z-20 overflow-hidden rounded-[inherit] ${b}`,picture:`pointer-events-none absolute inset-0 z-20 overflow-hidden ${b}`},N={cover:"h-full w-full object-cover",contain:"h-full w-full object-contain"};function P(e){const o=R(e,{fallbackWidth:960});return o.src===e?{src:e}:{src:o.src,srcSet:`${o.src} 1x, ${R(e,{fallbackWidth:1280}).src} 2x`}}const g=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(hover: hover) and (pointer: fine)").matches;function Y({media:e,cover:o="card",ground:r}){const a=F(null),v=I(),[s,l]=y(!1),[x,p]=y(!1),d=e?.urls.length??0;if(S(()=>{const i=a.current;if(!i||d===0)return;const t=k(i)??i.parentElement;if(!t)return;let n,f=!1;const h=()=>{n!==void 0&&clearTimeout(n),n=void 0,l(!1),p(!1),f=!1},E=c=>{c.pointerType!=="mouse"||!g()||(n!==void 0&&clearTimeout(n),n=setTimeout(()=>{n=void 0,l(!0)},M))},w=c=>{if(c.pointerType==="mouse"){if(!f&&t.contains(document.activeElement)){n!==void 0&&clearTimeout(n),n=void 0;return}h()}},A=()=>{f=!0},T=()=>{!f&&g()&&l(!0)},L=c=>{const _=c.relatedTarget;(!_||!t.contains(_))&&h()};return t.addEventListener("pointerenter",E),t.addEventListener("pointerleave",w),t.addEventListener("pointerdown",A),t.addEventListener("focusin",T),t.addEventListener("focusout",L),()=>{n!==void 0&&clearTimeout(n),t.removeEventListener("pointerenter",E),t.removeEventListener("pointerleave",w),t.removeEventListener("pointerdown",A),t.removeEventListener("focusin",T),t.removeEventListener("focusout",L)}},[d]),S(()=>{if(!s)return;const i=requestAnimationFrame(()=>p(!0));return()=>cancelAnimationFrame(i)},[s]),!e||d===0)return null;const u=s?P(e.urls[0]):null;return j(C,{children:[m("span",{ref:a,className:"sr-only",[O]:""}),u?m("div",{"data-hover-media":"","data-hover-cover":o,"data-hover-fit":e.fit,className:D[o],style:{opacity:x?1:0,...r?{backgroundColor:r}:{}},children:m("img",{src:u.src,...u.srcSet?{srcSet:u.srcSet}:{},alt:"",decoding:"async",...v,className:N[e.fit]})}):null]})}export{Y as default};
@@ -5,7 +5,6 @@ import { type HoverMediaPick } from "../../format/lib/content/hover-media.js";
5
5
  import type { PadValues } from "../lib/content/section-padding.js";
6
6
  export type ImageHoverLayer = {
7
7
  media: HoverMediaPick;
8
- name: string;
9
8
  cover: HoverMediaCover;
10
9
  };
11
10
  interface ImageBlockProps {
@@ -1 +1 @@
1
- import{jsx as e,Fragment as ie,jsxs as w}from"react/jsx-runtime";import{PagePicture as me}from"../lib/first-screen.js";import{SiteLink as ae}from"../lib/site-runtime.js";import{siteLinkDraws as ce}from"../../format/lib/content/box-link.js";import ne from"./BlockFrame.js";import{partAttr as F}from"../../format/lib/content/part-names.js";import{useCellPictureSizes as fe}from"./BoxCellContext.js";import{useBoxCell as pe,useFillsCell as ue}from"./InBoxContext.js";import{useInsideSiteGutter as de,useSectionEdge as ge}from"./SiteGutterFrame.js";import{useSitePhotography as he}from"./SitePhotographyContext.js";import{media as Se}from"../lib/media.js";import{CONTENT_SIZES as j,sizedImage as ve}from"../../format/lib/sized-image.js";import{imageCornerStyle as we}from"../../format/lib/content/image-corners.js";import{FILL_ROW as Fe,imageAspectClasses as Ne,pictureLayerClass as ye,imageFillFrom as Ce,imageAspectDrawn as be,imageAspectDrawsARatio as Ae,imageFocalPointActs as xe,imageFocalPointActsIn as E,imageAspectPhoneOf as ke,imageFillRowClasses as Ie,imageWidthFollowsBox as $e,imageShapeStyle as Oe}from"../../format/lib/content/image-aspect.js";import{drawsSiteGutter as _e}from"../../format/lib/content/site-gutter.js";import{imageFitClass as Pe,parseImageFit as Re}from"../../format/lib/content/image-fit.js";import{SECTION_FILL_CLASS as je}from"../../format/lib/content/section-min-height.js";import{PICTURE_WASH_CLASS as Ee,resolveImageTreatment as He}from"../../format/lib/content/image-treatment.js";import{boxDarkenStyle as ze}from"../../format/lib/content/box-background.js";import{HOVER_LAYER_GROUND as Le}from"../../format/lib/content/hover-media.js";import{phoneFocus as Te}from"../../format/lib/content/phone-focus.js";import{say as De}from"../../format/lib/editor-words.js";import{sectionEdgeAttrs as Ge}from"../lib/content/section-edge.js";import{useSideSpaceOnce as We}from"./SideSpaceOnce.js";import Be from"./PhotoHoverSheet.js";import Me from"./PictureWash.js";import Ze from"./HoverMediaLayer.js";import{PictureHoverMoveSheet as Ue,PictureHoverZoom as Ve,pictureHoverMoveOf as Ye}from"./PictureHoverMove.js";import{PictureZoom as qe}from"./PictureZoom.js";function Je({src:o,alt:H,aspect:z,aspectPhone:l,contained:N,grayscale:L,pictureHover:y,hoverLayer:s,darken:T,darkenStyle:C,href:D,fit:G,focal:b,focalPhone:W,focalTablet:B,corners:M,cornerSides:Z,cornersUnit:U,pad:A,ownSize:V=!1,editing:x=!1}){const c=He(L,he(),y),u=pe(),Y=ue(),d=ge(),q=fe(j),t=be(z,u?.picturesFillRow===!0),g=t===Fe,k=Ce(u?.fillFrom,u?.phoneRowFills===!0,l),i=g?Ie(k):null,h=ke(t,l),m=Re(G,"cover"),J=d||!$e(t,h,m)?j:q,I=we(M,Z,U),K=xe(m,t,l),S=Te(E("mobile",m,t,l)?W:void 0,E("tablet",m,t,l)?B:void 0),$={...c.style??{},...b&&K?{objectPosition:b}:{},...S.style},n=o?ve(Se(o)):null,r=Ye(y,C),Q=ze(T,C),X=r?.washHover??null,O=Oe(t,h),_=O?{...r?.style??{},...O}:r?.style??{},f=s&&o?e(Ze,{media:s.media,name:s.name,cover:s.cover,ground:Le[s.cover]}):null,P=o&&n?e(me,{src:n.src,...n.srcSet?{srcSet:n.srcSet,sizes:J}:{},alt:H,className:`${i?`${i.img} `:""}h-full w-full ${Ae(t,l)?Pe(m):""}${c.className?` ${c.className}`:""}${S.className?` ${S.className}`:""}`,...Object.keys($).length?{style:$}:{},...F("image")}):null,v=P?w(ie,{children:[e(Be,{sheet:c.sheet}),e(Ue,{move:r}),e(Ve,{move:r,className:ye(i),children:P}),e(Me,{wash:Q,hover:X,className:`pointer-events-none ${Ee}`})]}):e("div",{className:"flex aspect-[16/9] items-center justify-center border border-dashed border-line font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim",children:De("Image — set a path")}),p=(D??"").trim(),ee=p&&o?ce(p)?e(ae,{href:p,className:"block h-full w-full",newTab:"auto",children:v}):e("a",{href:p,className:"block h-full w-full",children:v}):v,te=de(),oe=We(),a=d&&!V?Ge(d,oe):null,R=A?{values:A,frame:g?0:24}:void 0,se=R!==void 0&&_e(a?!1:N,te),re=g?Y||x||se?je:"":"py-6",le=o&&m==="contain"?"":"bg-surface ";return!o&&!x?null:w(ne,{contained:a?!1:N,className:re,pad:R,...a?{fillWidth:a.className,style:a.style}:{},part:F("image-block"),children:[e("figure",{...i?{className:i.figure}:{},children:w("div",{className:`relative w-full overflow-hidden ${le}${Ne(t,h,k)}${r?` ${r.className}`:""}`,...I||Object.keys(_).length?{style:{...I,..._}}:{},...F("image-frame"),children:[e(qe,{fill:i,children:ee}),f&&s?.cover==="picture"?f:null]})}),f&&s?.cover==="card"?f:null]})}export{Je as default};
1
+ import{jsx as e,Fragment as ie,jsxs as w}from"react/jsx-runtime";import{PagePicture as me}from"../lib/first-screen.js";import{SiteLink as ae}from"../lib/site-runtime.js";import{siteLinkDraws as ce}from"../../format/lib/content/box-link.js";import ne from"./BlockFrame.js";import{partAttr as F}from"../../format/lib/content/part-names.js";import{useCellPictureSizes as fe}from"./BoxCellContext.js";import{useBoxCell as pe,useFillsCell as ue}from"./InBoxContext.js";import{useInsideSiteGutter as de,useSectionEdge as ge}from"./SiteGutterFrame.js";import{useSitePhotography as he}from"./SitePhotographyContext.js";import{media as Se}from"../lib/media.js";import{CONTENT_SIZES as j,sizedImage as ve}from"../../format/lib/sized-image.js";import{imageCornerStyle as we}from"../../format/lib/content/image-corners.js";import{FILL_ROW as Fe,imageAspectClasses as Ne,pictureLayerClass as ye,imageFillFrom as Ce,imageAspectDrawn as be,imageAspectDrawsARatio as Ae,imageFocalPointActs as xe,imageFocalPointActsIn as E,imageAspectPhoneOf as ke,imageFillRowClasses as Ie,imageWidthFollowsBox as $e,imageShapeStyle as Oe}from"../../format/lib/content/image-aspect.js";import{drawsSiteGutter as _e}from"../../format/lib/content/site-gutter.js";import{imageFitClass as Pe,parseImageFit as Re}from"../../format/lib/content/image-fit.js";import{SECTION_FILL_CLASS as je}from"../../format/lib/content/section-min-height.js";import{PICTURE_WASH_CLASS as Ee,resolveImageTreatment as He}from"../../format/lib/content/image-treatment.js";import{boxDarkenStyle as ze}from"../../format/lib/content/box-background.js";import{HOVER_LAYER_GROUND as Le}from"../../format/lib/content/hover-media.js";import{phoneFocus as Te}from"../../format/lib/content/phone-focus.js";import{say as De}from"../../format/lib/editor-words.js";import{sectionEdgeAttrs as Ge}from"../lib/content/section-edge.js";import{useSideSpaceOnce as We}from"./SideSpaceOnce.js";import Be from"./PhotoHoverSheet.js";import Me from"./PictureWash.js";import Ze from"./HoverMediaLayer.js";import{PictureHoverMoveSheet as Ue,PictureHoverZoom as Ve,pictureHoverMoveOf as Ye}from"./PictureHoverMove.js";import{PictureZoom as qe}from"./PictureZoom.js";function Je({src:o,alt:H,aspect:z,aspectPhone:r,contained:N,grayscale:L,pictureHover:y,hoverLayer:l,darken:T,darkenStyle:C,href:D,fit:G,focal:b,focalPhone:W,focalTablet:B,corners:M,cornerSides:Z,cornersUnit:U,pad:A,ownSize:V=!1,editing:x=!1}){const c=He(L,he(),y),u=pe(),Y=ue(),d=ge(),q=fe(j),t=be(z,u?.picturesFillRow===!0),g=t===Fe,k=Ce(u?.fillFrom,u?.phoneRowFills===!0,r),i=g?Ie(k):null,h=ke(t,r),m=Re(G,"cover"),J=d||!$e(t,h,m)?j:q,I=we(M,Z,U),K=xe(m,t,r),S=Te(E("mobile",m,t,r)?W:void 0,E("tablet",m,t,r)?B:void 0),$={...c.style??{},...b&&K?{objectPosition:b}:{},...S.style},n=o?ve(Se(o)):null,s=Ye(y,C),Q=ze(T,C),X=s?.washHover??null,O=Oe(t,h),_=O?{...s?.style??{},...O}:s?.style??{},f=l&&o?e(Ze,{media:l.media,cover:l.cover,ground:Le[l.cover]}):null,P=o&&n?e(me,{src:n.src,...n.srcSet?{srcSet:n.srcSet,sizes:J}:{},alt:H,className:`${i?`${i.img} `:""}h-full w-full ${Ae(t,r)?Pe(m):""}${c.className?` ${c.className}`:""}${S.className?` ${S.className}`:""}`,...Object.keys($).length?{style:$}:{},...F("image")}):null,v=P?w(ie,{children:[e(Be,{sheet:c.sheet}),e(Ue,{move:s}),e(Ve,{move:s,className:ye(i),children:P}),e(Me,{wash:Q,hover:X,className:`pointer-events-none ${Ee}`})]}):e("div",{className:"flex aspect-[16/9] items-center justify-center border border-dashed border-line font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim",children:De("Image — set a path")}),p=(D??"").trim(),ee=p&&o?ce(p)?e(ae,{href:p,className:"block h-full w-full",newTab:"auto",children:v}):e("a",{href:p,className:"block h-full w-full",children:v}):v,te=de(),oe=We(),a=d&&!V?Ge(d,oe):null,R=A?{values:A,frame:g?0:24}:void 0,se=R!==void 0&&_e(a?!1:N,te),re=g?Y||x||se?je:"":"py-6",le=o&&m==="contain"?"":"bg-surface ";return!o&&!x?null:w(ne,{contained:a?!1:N,className:re,pad:R,...a?{fillWidth:a.className,style:a.style}:{},part:F("image-block"),children:[e("figure",{...i?{className:i.figure}:{},children:w("div",{className:`relative w-full overflow-hidden ${le}${Ne(t,h,k)}${s?` ${s.className}`:""}`,...I||Object.keys(_).length?{style:{...I,..._}}:{},...F("image-frame"),children:[e(qe,{fill:i,children:ee}),f&&l?.cover==="picture"?f:null]})}),f&&l?.cover==="card"?f:null]})}export{Je as default};
@@ -1 +1 @@
1
- import{jsx as v}from"react/jsx-runtime";import A from"../../../../../components/HeroSection.js";import{HeroMeta as C}from"../../../../../../format/lib/document/blocks/general/Hero/meta.js";const R={...C,render:({slides:e,strip:o,alignment:t,textureOpacity:r,showTexture:i,textureColor:p,phoneUpDown:s,phoneSideways:h,phoneWordsTop:a,phoneWordsBottom:n,phoneBoxGap:d,wordsTop:l,wordsBottom:m,wordsTopTablet:w,wordsBottomTablet:c,autoplay:x,autoplayInterval:g,showTicker:T,tickerItems:b,heightDesktop:k,heightTablet:u,heightMobile:y,heightFixed:B,heightFixedTablet:M,heightFixedMobile:S,showPicker:f,pickerShape:F,pickerPlacement:H,showArrows:P,arrowsShape:j,arrowsPlacement:D,_partMotion:I,editor:W})=>v(A,{slides:e,strip:o,alignment:t,textureOpacity:r,showTexture:i,textureColor:p,phoneUpDown:s,phoneSideways:h,phoneWordsTop:a,phoneWordsBottom:n,phoneBoxGap:d,wordsTop:l,wordsBottom:m,wordsTopTablet:w,wordsBottomTablet:c,autoplay:x,autoplayInterval:g,showTicker:T,tickerItems:b,heightDesktop:k,heightTablet:u,heightMobile:y,heightFixed:B,heightFixedTablet:M,heightFixedMobile:S,showPicker:f,pickerShape:F,pickerPlacement:H,showArrows:P,arrowsShape:j,arrowsPlacement:D,editing:W?.isEditing,partMotion:I})};export{R as HeroRender};
1
+ import{jsx as A}from"react/jsx-runtime";import C from"../../../../../components/HeroSection.js";import{HeroMeta as E}from"../../../../../../format/lib/document/blocks/general/Hero/meta.js";const U={...E,render:({slides:e,strip:o,alignment:t,textureOpacity:r,showTexture:i,textureColor:p,textureShape:h,phoneUpDown:s,phoneSideways:a,phoneWordsTop:n,phoneWordsBottom:d,phoneBoxGap:l,wordsTop:m,wordsBottom:w,wordsTopTablet:x,wordsBottomTablet:c,autoplay:g,autoplayInterval:T,showTicker:b,tickerItems:k,heightDesktop:u,heightTablet:S,heightMobile:y,heightFixed:B,heightFixedTablet:M,heightFixedMobile:f,showPicker:F,pickerShape:H,pickerPlacement:P,showArrows:j,arrowsShape:D,arrowsPlacement:I,_partMotion:W,editor:v})=>A(C,{slides:e,strip:o,alignment:t,textureOpacity:r,showTexture:i,textureColor:p,textureShape:h,phoneUpDown:s,phoneSideways:a,phoneWordsTop:n,phoneWordsBottom:d,phoneBoxGap:l,wordsTop:m,wordsBottom:w,wordsTopTablet:x,wordsBottomTablet:c,autoplay:g,autoplayInterval:T,showTicker:b,tickerItems:k,heightDesktop:u,heightTablet:S,heightMobile:y,heightFixed:B,heightFixedTablet:M,heightFixedMobile:f,showPicker:F,pickerShape:H,pickerPlacement:P,showArrows:j,arrowsShape:D,arrowsPlacement:I,editing:v?.isEditing,partMotion:W})};export{U as HeroRender};
@@ -1 +1 @@
1
- import{jsx as g}from"react/jsx-runtime";import{phoneKey as w}from"efficient-easel/draw";import{CardRowDrawn as I}from"../../../../../components/CardRowContext.js";import R from"../../../../../components/ImageBlock.js";import{recordPictureAlt as O}from"../../../../../../format/lib/content/record-row.js";import{CARD_ROW_LINK_PROP as x,namedRowField as h,rowFieldSpec as B,rowFieldText as P}from"../../../../../../format/lib/content/card-template.js";import{cardRowHoverMedia as b,hoverLayerName as F}from"../../../../../../format/lib/content/hover-media.js";import{blockSizeOf as _,blockSizeValuesOf as z}from"../../../../content/block-size.js";import{padValuesOf as H}from"../../../../content/section-padding.js";import{pictureHoverOf as K}from"../../../../../../format/lib/animation/hover.js";import{viewFocusValues as V}from"../../../../../../format/lib/content/picture-focus-rows.js";import{ImageBlockMeta as j}from"../../../../../../format/lib/document/blocks/general/ImageBlock/meta.js";const G={...j,render:e=>{const r=K(e,"ImageBlock"),o=h(e),a=h(e,x);return!o&&!a&&r.kind!=="nextImage"?y(e,e.src,e.alt,r):g(I,{type:"ImageBlock",props:e,children:(t,n,i)=>{const d=o?B(n,o):null,l=o?n?d?.alt:O(o):null,f=o?t.src:e.src,c=(l&&P(i,l))??e.alt,m=r.media?b(n,r.media):null,s=F(i,typeof c=="string"?c:""),u=a?t.href:e.href;return y({...e,href:u},f,c,r,m&&r.media?{media:m,name:s,cover:r.media.cover}:null)}})}};function y(e,r,o,a,t=null){const{aspect:n,contained:i,grayscale:d,darken:l,darkenStyle:f,href:c,fit:m,corners:s,cornerSides:u,cornersUnit:S,editor:v}=e,k=V(e,"focal");return g(R,{src:r,alt:o,aspect:n,aspectPhone:e[w("aspect")],contained:i,grayscale:d,darken:l,darkenStyle:f,pictureHover:a,...t?{hoverLayer:t}:{},href:c,fit:m,focal:k.desktop,focalPhone:k.phone,focalTablet:k.tablet,corners:s,cornerSides:u,cornersUnit:S,pad:H(e),ownSize:_(z(e))!==null,editing:v?.isEditing===!0})}export{G as ImageBlockRender};
1
+ import{jsx as k}from"react/jsx-runtime";import{phoneKey as R}from"efficient-easel/draw";import{CardRowDrawn as v}from"../../../../../components/CardRowContext.js";import y from"../../../../../components/ImageBlock.js";import{recordPictureAlt as O}from"../../../../../../format/lib/content/record-row.js";import{CARD_ROW_LINK_PROP as x,namedRowField as g,rowFieldSpec as B,rowFieldText as P}from"../../../../../../format/lib/content/card-template.js";import{cardRowHoverMedia as b}from"../../../../../../format/lib/content/hover-media.js";import{blockSizeOf as F,blockSizeValuesOf as _}from"../../../../content/block-size.js";import{padValuesOf as z}from"../../../../content/section-padding.js";import{pictureHoverOf as H}from"../../../../../../format/lib/animation/hover.js";import{viewFocusValues as K}from"../../../../../../format/lib/content/picture-focus-rows.js";import{ImageBlockMeta as V}from"../../../../../../format/lib/document/blocks/general/ImageBlock/meta.js";const G={...V,render:e=>{const r=H(e,"ImageBlock"),o=g(e),n=g(e,x);return!o&&!n&&r.kind!=="nextImage"?h(e,e.src,e.alt,r):k(v,{type:"ImageBlock",props:e,children:(t,c,l)=>{const m=o?B(c,o):null,i=o?c?m?.alt:O(o):null,d=o?t.src:e.src,f=(i&&P(l,i))??e.alt,a=r.media?b(c,r.media):null,s=n?t.href:e.href;return h({...e,href:s},d,f,r,a&&r.media?{media:a,cover:r.media.cover}:null)}})}};function h(e,r,o,n,t=null){const{aspect:c,contained:l,grayscale:m,darken:i,darkenStyle:d,href:f,fit:a,corners:s,cornerSides:w,cornersUnit:S,editor:I}=e,u=K(e,"focal");return k(y,{src:r,alt:o,aspect:c,aspectPhone:e[R("aspect")],contained:l,grayscale:m,darken:i,darkenStyle:d,pictureHover:n,...t?{hoverLayer:t}:{},href:f,fit:a,focal:u.desktop,focalPhone:u.phone,focalTablet:u.tablet,corners:s,cornerSides:w,cornersUnit:S,pad:z(e),ownSize:F(_(e))!==null,editing:I?.isEditing===!0})}export{G as ImageBlockRender};