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.
- package/CHANGELOG.md +29 -0
- package/dist/editor/lib/animation/hover-fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Hero/fields.js +1 -1
- package/dist/format/lib/content/hover-media.d.ts +0 -6
- package/dist/format/lib/content/hover-media.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +6 -2
- package/dist/format/lib/editor-words-catalogue.js +2 -2
- package/dist/format/lib/editor-words-kept.js +1 -1
- package/dist/format/lib/hero-texture.d.ts +7 -1
- package/dist/format/lib/hero-texture.js +1 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/HeroArrows.d.ts +3 -6
- package/dist/render/components/HeroArrows.js +1 -1
- package/dist/render/components/HeroSection.d.ts +3 -1
- package/dist/render/components/HeroSection.js +1 -1
- package/dist/render/components/HeroSlide.d.ts +2 -0
- package/dist/render/components/HeroSlide.js +1 -1
- package/dist/render/components/HoverMediaLayer.d.ts +2 -18
- package/dist/render/components/HoverMediaLayer.js +1 -1
- package/dist/render/components/ImageBlock.d.ts +0 -1
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/lib/document/blocks/general/Hero/render.js +1 -1
- package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
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
|
|
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
|
|
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 {
|
|
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
|
|
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
|
|
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:
|
|
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
|
|
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
|
|
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};
|