@cntrl-site/components 1.0.115 → 1.0.116
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/dist/Chronicles-BNvvaFYY.mjs +744 -0
- package/dist/Chronicles-Dj1gvNjE.js +196 -0
- package/dist/{ChroniclesComponent-D-yEbs9w.mjs → ChroniclesComponent-0ZWBPdbh.mjs} +542 -491
- package/dist/ChroniclesComponent-D4_6w8f7.js +1 -0
- package/dist/Components/Chronicles/Chronicles.d.ts +7 -1
- package/dist/Components/Chronicles/ChroniclesComponent.d.ts +26 -2
- package/dist/Components/LightboxJournal/LightboxJournal.d.ts +1 -0
- package/dist/Components/LightboxStrip/LightboxStrip.d.ts +1 -0
- package/dist/LightboxJournal-Bmw2zm4t.js +549 -0
- package/dist/{LightboxJournal-D59ex6wH.mjs → LightboxJournal-gePVKQJ4.mjs} +429 -403
- package/dist/{LightboxStrip-YspzBP8N.mjs → LightboxStrip-BPQiQhd3.mjs} +461 -435
- package/dist/LightboxStrip-CTxRwLYk.js +412 -0
- package/dist/{components-D4ZrIo2M.js → components-B8MjlzLL.js} +1 -1
- package/dist/{components-Ds6rhj3U.mjs → components-BQjon_-7.mjs} +1 -1
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +3 -3
- package/dist/elements.node.js +1 -1
- package/dist/elements.node.mjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +36 -32
- package/dist/sources.js +124 -25
- package/dist/sources.mjs +131 -32
- package/dist/types/SchemaV1.d.ts +3 -0
- package/package.json +1 -1
- package/dist/Chronicles-Cy2h3jlZ.mjs +0 -724
- package/dist/Chronicles-D0ojQzOP.js +0 -196
- package/dist/ChroniclesComponent-Os_r2IYg.js +0 -1
- package/dist/LightboxJournal-DAEZOPDi.js +0 -523
- package/dist/LightboxStrip-BDjI1jyH.js +0 -386
|
@@ -1,386 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),a=require("react"),jn=require("react-dom"),Mn=require("./useScopedStyles-Bf6yohVQ.js"),J=require("./useLightboxSwipeDismiss-Br9uE5G0.js"),Rt=require("./scalingValue-CSHYgTZl.js"),kn=require("./SvgImage-DFlmxAoL.js"),_n=require("./useLightboxScrollLock-Hf16Eq4g.js"),En=require("./textStylesToCss-CNN3zZTV.js"),Nn=(e,o,u,f)=>{const l=Math.min(Math.abs(e)/Math.max(f,1),1);return o+(u-o)*l},On=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},zn=e=>{const o=getComputedStyle(e).transform;return o==="none"?0:new DOMMatrixReadOnly(o).m41},Fn=(e,o,u,{duration:f,easing:l,onComplete:m})=>{const p=e.scrollLeft,w=u-p,I=p-u,F=(E,Q)=>{On(o),e.scrollLeft=E,Q&&(m==null||m())};if(Math.abs(w)<.5)return F(u,!0),()=>{};let j=!1,K=0;const L=()=>{o.removeEventListener("transitionend",G),clearTimeout(K)},G=E=>{E.target!==o||E.propertyName!=="transform"||j||(j=!0,L(),F(u,!0))};return o.addEventListener("transitionend",G),o.style.willChange="transform",o.style.transition="none",o.style.transform="translate3d(0, 0, 0)",o.offsetHeight,o.style.transition=`transform ${f}ms ${l}`,o.style.transform=`translate3d(${I}px, 0, 0)`,K=window.setTimeout(()=>{j||(j=!0,L(),F(u,!0))},f+64),()=>{j||(j=!0,L(),F(p-zn(o),!1))}},gt=300,Kn=900,Bn=1500,Dn="cubic-bezier(0.16, 1, 0.3, 1)",Hn=3e3,Xn=2,Gn=16,Vn=.05,Yn=1,It=.3,qn=50,Un=20,at=.004,Oe=["title1","title2","title3"],ze={title1:"1",title2:"2",title3:"3"},Zn={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Jn={title1:.02,title2:.02,title3:.02},Wt=e=>`max(${e}, ${Un}px)`,Fe=e=>{if(!Array.isArray(e)||e.length===0)return{};const o=e.find(l=>(l==null?void 0:l.type)==="paragraph")??e[0],u=o==null?void 0:o.children;if(!Array.isArray(u))return{};const f=u.map(l=>typeof(l==null?void 0:l.text)=="string"?l.text.trim():"").filter(Boolean);return{title1:f[0],title2:f[1],title3:f[2]}},Ke=e=>{if(!e)return{title1:"",title2:"",title3:""};if(e.title1||e.title2||e.title3)return{title1:e.title1??"",title2:e.title2??"",title3:e.title3??""};const o=Fe(e.text);return{title1:o.title1??"",title2:o.title2??"",title3:o.title3??""}},_=(e,o)=>`${e}${o.charAt(0).toUpperCase()}${o.slice(1)}`,Be=e=>[_(e,"fontFamily"),_(e,"fontSettings"),{type:"row",items:[_(e,"fontSize"),_(e,"lineHeight"),_(e,"letterSpacing"),_(e,"wordSpacing")]},_(e,"textAlign"),_(e,"textAppearance")],Qn=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Oe.map(e=>[ze[e],Be(e)]))}),ee=(e,o)=>{if(e<=0)return[];const u=o.slice(0,e),f=u.reduce((m,p)=>m+p,0);if(f<=1)return u;const{widths:l}=[...u].reverse().reduce(({overflow:m,widths:p},w)=>{if(m<=0||w<=0)return{overflow:m,widths:[w,...p]};const I=Math.min(m,w);return{overflow:m-I,widths:[w-I,...p]}},{overflow:f-1,widths:[]});return l},De=(e,o)=>ee(e,o),At=(e,o)=>{const u=o.filter((f,l)=>l!==e).reduce((f,l)=>f+l,0);return Math.max(1-u,0)},Ne=(e,o)=>{const u=e.map(f=>o[f.widthKey]??0);return{resolved:ee(e.length,u),effective:De(e.length,u)}},Pn=(e,o,u,f,l,m,p)=>{const w=[];return o&&w.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:l,text:o}),u&&w.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:m,text:u}),f&&w.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:p,text:f}),w},Pt=(e,o)=>{const u=f=>{const l=_(o,f);return e[l]};return{fontFamily:u("fontFamily")??"Arial",fontSettings:u("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:u("fontSize"),lineHeight:u("lineHeight"),letterSpacing:u("letterSpacing")??0,wordSpacing:u("wordSpacing")??0,textAlign:u("textAlign")??"left",textAppearance:u("textAppearance"),color:e[Zn[o]]}},tr=(e,o,u,f)=>e.slice(0,f).reduce((l,m,p)=>l+(m!=null&&m.marginLeftKey?u[m.marginLeftKey]??0:0)+(o[p]??0),0),te=(e,o,u)=>{var l,m;const f={fontSettings:{fontFamily:o.fontFamily,fontWeight:((l=o.fontSettings)==null?void 0:l.fontWeight)??400,fontStyle:((m=o.fontSettings)==null?void 0:m.fontStyle)??"normal"},fontSize:o.fontSize??Jn[e],lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,wordSpacing:o.wordSpacing,textAlign:o.textAlign,textAppearance:o.textAppearance,color:o.color??"#ffffff"};return En.textStylesToCss(f,u)},er=({prefix:e,images:o,settings:u,isEditor:f,isEditMode:l,isPreviewMode:m,onClose:p})=>{const{backgroundColor:w,thumbnailSize:I,thumbnailGap:F,thumbnailMarginBottom:j,imageGap:K,closeIcon:L,closeIconMaxWidth:G,closeIconColor:E,closeIconHoverColor:Q,thumbnailTrigger:ne,thumbnailVisibility:Ct,thumbnailObjectFit:xt,thumbnailActive:He,thumbnailActiveColor:Xe,title1Width:jt,title2Width:re,title3Width:oe,title1MarginLeft:W=0,title2MarginLeft:ie=0,title3MarginLeft:se=0,titleRowMarginBottom:le=0,titleHeaderLayout:ae="desktop",contentMarginTop:Ge,iconMarginLeft:Ve}=u,P=t=>Rt.scalingValue(t,f??!1),Ye=I??u.thumnailSize??.03,ce=P(Ye),Mt=P(F),kt=P(j??.02),ct=P(K??0),ue=P(Ge??0),qe=Wt(ue),fe=P(Ve??0),[tt,_t]=a.useState(0),A=a.useRef(tt);A.current=tt;const Ue=o[tt],{title1:Et,title2:Nt,title3:Ot}=Ke(Ue),he=te("title1",Pt(u,"title1"),f),de=te("title2",Pt(u,"title2"),f),me=te("title3",Pt(u,"title3"),f),C=ae==="mobile",V=!l&&(!f||m),ut=V,ft=V,Ze=V,pe=J.isImageRatioCover(xt),Je=pe?{"--image-aspect-ratio":J.getAspectRatio(xt)}:void 0,ge=!!(Et||Nt||Ot),x=a.useMemo(()=>Pn(e,Et,Nt,Ot,he,de,me),[e,tt,Et,Nt,Ot,he,de,me]),et=a.useMemo(()=>({title1Width:jt,title2Width:re,title3Width:oe}),[jt,re,oe]),bt=a.useMemo(()=>x.map(t=>et[t.widthKey]),[x,et]),N=a.useMemo(()=>ee(x.length,bt),[x.length,bt]),xe=a.useMemo(()=>De(x.length,bt),[x.length,bt]),vt=a.useMemo(()=>x.filter(t=>t.prefix==="title1"),[x]),M=a.useMemo(()=>x.filter(t=>t.prefix==="title2"||t.prefix==="title3"),[x]),yt=a.useMemo(()=>Ne(vt,et),[vt,et]),B=a.useMemo(()=>Ne(M,et),[M,et]),zt=a.useCallback((t,n)=>{const r=x.indexOf(t);if(!C||n==="single-row")return{effectiveWidth:xe[r]??0,resolvedWidth:N[r]??0,maxWidth:At(r,N)};if(n==="two-row-top"){const s=vt.indexOf(t);return{effectiveWidth:yt.effective[s]??0,resolvedWidth:yt.resolved[s]??0,maxWidth:At(s,yt.resolved)}}const i=M.indexOf(t);return{effectiveWidth:B.effective[i]??0,resolvedWidth:B.resolved[i]??0,maxWidth:At(i,B.resolved)}},[M,B,xe,N,x,vt,yt,C]),y=a.useCallback(t=>Rt.scalingValue(t,f??!1),[f]),Qe=y(le??0),k=a.useMemo(()=>({title1MarginLeft:W,title2MarginLeft:ie,title3MarginLeft:se}),[W,ie,se]),Pe=a.useCallback(t=>x.slice(0,t+1).reduce((n,r,i)=>n+(r!=null&&r.marginLeftKey?k[r.marginLeftKey]??0:0)+(N[i]??0),0)+(C?0:W??0),[x,k,N,C,W]),tn=a.useCallback(()=>C?0:W??0,[C,W]),Ft=a.useCallback(t=>M.slice(0,t).reduce((n,r,i)=>n+(r.marginLeftKey?k[r.marginLeftKey]??0:0)+(B.resolved[i]??0),0),[M,B.resolved,k]),en=a.useCallback(t=>{const n=M[t];return Ft(t)+(n.marginLeftKey?k[n.marginLeftKey]??0:0)+(B.resolved[t]??0)},[M,B.resolved,Ft,k]),Kt=(t,n)=>{const r=t.marginLeftKey?k[t.marginLeftKey]??0:0,{effectiveWidth:i,resolvedWidth:s,maxWidth:h}=zt(t,n),d=l&&n==="two-row-top";return c.jsxs("div",{className:`${e}-title-cell`,"data-title":t.prefix,style:{...n==="single-row"?{gridArea:t.prefix}:{},width:y(i),...r>0?{marginLeft:y(r)}:{}},children:[c.jsx("p",{className:t.className,style:t.style,children:t.text}),d&&t.marginLeftKey&&c.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(s),style:{position:"absolute",top:0,left:y(-r),width:`max(${y(r)}, 10px)`,height:"100%",pointerEvents:"auto"}}),d&&c.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(h),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:y(-at/2),width:y(at),height:"100%",pointerEvents:"auto"}})]},t.className)},nn=()=>{const t=C?-1:x.findIndex(i=>i.prefix==="title1"),n=!C&&(l||(W??0)>0)?(()=>{const i=W??0,s=t>=0?N[t]:jt??0;return c.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(s),style:{position:"absolute",top:0,left:0,width:`max(${y(i)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,r=x.flatMap((i,s)=>{if(!i.marginLeftKey)return[];const h=k[i.marginLeftKey]??0,d=tr(x,N,k,s)+tn();return c.jsx("div",{"data-controls":i.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(N[s]),style:{position:"absolute",top:0,left:y(d),width:`max(${y(h)}, 10px)`,height:"100%",pointerEvents:"auto"}},i.marginLeftKey)});return n?[n,...r]:r},rn=()=>x.map((t,n)=>{const r=At(n,N),s=Pe(n)-at/2;return c.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:c.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(r),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:y(s),width:y(at),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),on=()=>M.flatMap((t,n)=>{if(!t.marginLeftKey)return[];const r=k[t.marginLeftKey]??0,i=Ft(n),{resolvedWidth:s}=zt(t,"two-row-bottom");return c.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(s),style:{position:"absolute",top:0,left:y(i),width:`max(${y(r)}, 10px)`,height:"100%",pointerEvents:"auto"}},t.marginLeftKey)}),sn=()=>M.map((t,n)=>{const{maxWidth:r}=zt(t,"two-row-bottom"),s=en(n)-at/2;return c.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:c.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(r),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:y(s),width:y(at),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),ln=a.useRef(null),b=a.useRef(null),Bt=a.useRef(null),be=a.useRef(null),wt=a.useRef([]),S=a.useRef([]),nt=a.useRef(0),St=a.useRef(null),v=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),ht=a.useRef(null),rt=a.useRef(null),Dt=a.useRef(0),Ht=a.useRef("forward"),D=a.useRef(0),H=a.useRef(null),Y=a.useRef(!1),$=o.length>1&&(!l||!!m),Xt=$?3:1,an=a.useMemo(()=>Array.from({length:Xt},()=>o).flat(),[o,Xt]),[cn,ve]=a.useState(!1),[ye,we]=a.useState(!1),[un,Gt]=a.useState(!0),q=a.useRef(null),ot=a.useRef(null),Vt=a.useRef(!1),Se=a.useRef(!1),Yt=a.useRef(null),U=a.useRef(null),Le=ut&&!un,O=a.useCallback(()=>{ut&&(Gt(!0),U.current&&clearTimeout(U.current),U.current=setTimeout(()=>{v.current.isActive||Gt(!1)},Hn))},[ut]),dt=a.useCallback(()=>{l||Se.current||(Se.current=!0,we(!1),Yt.current=setTimeout(()=>{p()},gt))},[l,p]),$e=()=>c.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":Le?"true":"false",style:{width:Rt.scalingValue(G??0,f),height:Rt.scalingValue(G??0,f),marginRight:fe,"--close-icon-hover-color":Q},children:[c.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:dt,"aria-label":"Close",children:c.jsx(kn.SvgImage,{url:L,fill:E,hoverFill:f&&!m?E:Q,className:`${e}-close-icon-img`})}),l&&c.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:fe,height:"100%",pointerEvents:"auto"}})]}),Te=(t="two-row")=>c.jsx("div",{...t==="two-row"&&l?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:y(W??0),flexShrink:0,...t==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...t==="two-row"&&l?{pointerEvents:"auto"}:{}}}),fn=()=>{const t=x.find(i=>i.prefix==="title1"),n=x.filter(i=>i.prefix==="title2"||i.prefix==="title3"),r=n.length>0||l||(le??0)>0;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`${e}-header-row-top`,children:[(W??0)>0||l?Te():null,t&&Kt(t,"two-row-top"),L&&$e()]}),r?c.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[n.length>0?c.jsxs("div",{className:`${e}-header-row-bottom`,children:[n.map(i=>Kt(i,"two-row-bottom")),l&&c.jsxs(c.Fragment,{children:[on(),sn()]})]}):null,c.jsx("div",{"data-controls":l?"titleRowMarginBottom":void 0,"data-controls-axis":l?"y":void 0,"data-controls-reverse":l?"":void 0,className:l?`${e}-control`:void 0,style:{height:Qe,width:"100%",flexShrink:0,pointerEvents:l?"auto":"none"}})]}):null]})},hn=()=>c.jsxs(c.Fragment,{children:[(W??0)>0||l?Te("single-row"):null,x.map(t=>Kt(t,"single-row")),l?c.jsxs(c.Fragment,{children:[nn(),rn()]}):null,L?$e():null]}),qt=a.useCallback(t=>!!(t.closest("[data-controls]")||t.closest(`.${e}-thumbnails`)||t.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:dn,backdropStyle:mn,mediaAreaStyle:pn,overlayContentStyle:gn,swipeHandlers:xn,dismissAreaStyle:bn}=J.useLightboxSwipeDismiss({enabled:V??!1,onClose:dt,animMs:gt,isBlockedTarget:qt}),Ut=()=>{if(!$||o.length===0)return nt.current=0,0;const t=S.current[0],n=S.current[o.length];if(!t||!n)return nt.current;const r=n.offsetLeft-t.offsetLeft;return r>0&&(nt.current=r),nt.current},Z=(t=!1)=>{if(!$)return;const n=b.current,r=Ut();!n||r<=0||r<n.clientWidth*.25||(n.scrollLeft<=0?(n.scrollLeft+=r,t&&(v.current.scrollLeft+=r),Y.current&&(D.current+=r)):n.scrollLeft>=r*2&&(n.scrollLeft-=r,t&&(v.current.scrollLeft-=r),Y.current&&(D.current-=r)))},Re=(t,n=(r=>(r=b.current)==null?void 0:r.scrollLeft)()??0)=>{if(!$)return t;let i=o.length+t,s=1/0;for(let h=0;h<Xt;h++){const d=h*o.length+t,g=S.current[d];if(!g)continue;const T=Math.abs(g.offsetLeft-n);T<s&&(s=T,i=d)}return i},Ie=t=>{const n=b.current;return!t||!n?!1:t.offsetWidth>n.clientWidth+1},Zt=t=>{const n=b.current;if(!t||!n||!Ie(t))return!1;const r=t.offsetLeft,i=r+t.offsetWidth;return n.scrollLeft>=r-1&&n.scrollLeft+n.clientWidth<=i+1},it=(t=(n=>(n=b.current)==null?void 0:n.scrollLeft)()??0)=>{for(let i=0;i<S.current.length;i+=1){const s=S.current[i];if(s&&Zt(s))return i}let r={flatIndex:0,distance:1/0};return S.current.forEach((i,s)=>{if(!i)return;const h=Math.abs(i.offsetLeft-t);h<r.distance&&(r={flatIndex:s,distance:h})}),r.flatIndex},We=t=>{b.current&&S.current.forEach(n=>{n&&(n.style.scrollSnapAlign=Ie(n)&&t==="backward"?"end":"start")})},vn=(t,n,r)=>{const i=t-n,s=it(n),h=S.current[s];if(Zt(h))return it(t)%o.length;const d=S.current[s+1],g=h?d?d.offsetLeft-h.offsetLeft:h.offsetWidth:0,T=g>0?i>g*It?1:i<-g*It?-1:0:0;return T===0?r:$?(r+T+o.length)%o.length:Math.max(0,Math.min(o.length-1,r+T))},Ae=a.useCallback((t=!1)=>{if(Ct!=="on"||l)return;const n=be.current,r=A.current,i=wt.current[r];if(!n||!i||n.scrollWidth<=n.clientWidth)return;const s=n.scrollLeft,h=s+n.clientWidth,d=i.offsetLeft,g=d+i.offsetWidth;if(d>=s&&g<=h)return;const T=n.scrollWidth-n.clientWidth;let R=s;if(!t&&q.current===null){const lt=wt.current[r-1],pt=wt.current[r+1],Tt=lt?i.offsetLeft-lt.offsetLeft:pt?pt.offsetLeft-i.offsetLeft:i.offsetWidth;g>h?R+=Tt:d<s&&(R-=Tt)}else g>h?R=g-n.clientWidth:R=d;n.scrollLeft=Math.max(0,Math.min(T,R))},[l,Ct]),Jt=a.useCallback((t=!1)=>{t&&(Vt.current=!0),ot.current===null&&(ot.current=requestAnimationFrame(()=>{ot.current=null;const n=Vt.current;Vt.current=!1,Ae(n)}))},[Ae]),yn=a.useCallback(t=>{if(t===A.current)return;const n=A.current;A.current=t;const r=Math.abs(t-n)>1,i=$&&o.length>1&&(n===o.length-1&&t===0||n===0&&t===o.length-1);_t(t),Jt(r||i)},[o.length,$,Jt]),z=()=>{if(!b.current||o.length===0||q.current!==null||v.current.isActive&&v.current.hasMoved)return;const t=b.current.scrollLeft,n=it(t)%o.length;n!==A.current&&yn(n)},wn=()=>{q.current=null},X=t=>{const n=b.current;n&&(n.style.scrollSnapType=t?"":"none")},mt=()=>{var t;(t=rt.current)==null||t.call(rt),rt.current=null},Lt=()=>{H.current!==null&&(cancelAnimationFrame(H.current),H.current=null),Y.current=!1},Ce=()=>{const t=b.current;if(!t){H.current=null,Y.current=!1;return}const n=D.current-t.scrollLeft;if(Math.abs(n)<.5){t.scrollLeft=D.current,Z(),z(),H.current=null,Y.current=!1;return}t.scrollLeft+=n*Vn,Z(),z(),O(),H.current=requestAnimationFrame(Ce)},je=()=>{const t=Bt.current;t&&(t.style.transition="",t.style.transform="",t.style.willChange="")},Me=(t,n,r,i)=>{je(),t.scrollLeft=n,Dt.current=t.scrollLeft,Z(),r!==void 0?(A.current=r,_t(r)):z(),X(!0),i==null||i()},ke=(t,{behavior:n="smooth",activeIndex:r,onComplete:i}={})=>{const s=b.current,h=Bt.current;if(!s||!h)return;if(Lt(),mt(),X(!1),n==="auto"){Me(s,t,r,i);return}const d=Math.abs(t-s.scrollLeft),g=Nn(d,Kn,Bn,s.clientWidth*.55);rt.current=Fn(s,h,t,{duration:g,easing:Dn,onComplete:()=>{rt.current=null,Me(s,t,r,i)}})},Sn=(t="smooth")=>{const n=b.current;if(!n||o.length===0)return;const r=it()%o.length,i=Re(r,n.scrollLeft),s=S.current[i];s&&ke(s.offsetLeft,{behavior:t,activeIndex:r})},Ln=(t,n="smooth",r,i)=>{const s=b.current;if(!s||o.length===0)return;const h=(i??s.scrollLeft)-t,d=it(t),g=S.current[d];if(Zt(g)){X(!0),z();return}const T=S.current[d+1],R=g?T?T.offsetLeft-g.offsetLeft:g.offsetWidth:0;if((R>0?h>R*It?1:h<-R*It?-1:0:0)!==0){const An=r??d%o.length,Cn=vn(i??s.scrollLeft,t,An);st(Cn,n);return}const pt=i??s.scrollLeft,Tt=it(pt),Ee=S.current[Tt];if(Ee&&Math.abs(Ee.offsetLeft-pt)<1){X(!0),z();return}Sn("auto")},st=(t,n="smooth")=>{const r=b.current;if(!r||o.length===0)return;const i=Re(t,r.scrollLeft),s=S.current[i];s&&(n==="smooth"?q.current=t:q.current=null,A.current=t,_t(t),Jt(!0),ke(s.offsetLeft,{behavior:n,activeIndex:t,onComplete:n==="smooth"?wn:void 0}))},Qt=()=>{ht.current&&(window.removeEventListener("pointerup",ht.current),window.removeEventListener("pointercancel",ht.current),ht.current=null)},$n=(t,n,r,i,s)=>{const h=r-t,d=i-n,g=Math.abs(h),T=Math.abs(d);if(g<qn||g<=T)return!1;const R=h<0?1:-1,lt=$?(s+R+o.length)%o.length:Math.max(0,Math.min(o.length-1,s+R));return lt===s?!1:(st(lt),!0)},$t=t=>{if(!v.current.isActive)return;Qt();const n=b.current;if(!n)return;const{scrollLeft:r,startActiveIndex:i,hasMoved:s}=v.current,h=n.scrollLeft;Z(!0),v.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ve(!1),t!==void 0&&n.hasPointerCapture(t)&&n.releasePointerCapture(t),s?Ln(r,"smooth",i,h):(X(!0),z()),O()},Tn=(t,n)=>{const r=St.current;St.current=null,r&&($n(r.startX,r.startY,t,n,r.startActiveIndex),O())},Rn=t=>{if(!ft)return;if(t.pointerType==="touch"){if(Lt(),X(!0),qt(t.target))return;St.current={startX:t.clientX,startY:t.clientY,startActiveIndex:A.current};return}if(t.pointerType!=="mouse"||t.button!==0||qt(t.target))return;const n=b.current;if(!n)return;Lt(),mt(),je(),q.current=null,v.current={isActive:!0,startX:t.clientX,scrollLeft:n.scrollLeft,startActiveIndex:A.current,hasMoved:!1},X(!1),O(),n.setPointerCapture(t.pointerId),Qt();const r=i=>{i.pointerType==="mouse"&&$t(i.pointerId)};ht.current=r,window.addEventListener("pointerup",r),window.addEventListener("pointercancel",r)},In=t=>{if(!ft||t.pointerType!=="mouse")return;const n=b.current;if(!n||!v.current.isActive)return;if(t.buttons===0){$t(t.pointerId);return}const r=t.clientX-v.current.startX;Math.abs(r)>Yn&&(v.current.hasMoved=!0,ve(!0)),v.current.hasMoved&&(t.preventDefault(),n.scrollLeft=v.current.scrollLeft-r,Z(!0),z(),O())},_e=t=>{if(ft){if(t.pointerType==="touch"){t.type==="pointerup"?Tn(t.clientX,t.clientY):St.current=null;return}t.pointerType==="mouse"&&$t(t.pointerId)}},Wn=t=>{!ft||t.pointerType!=="mouse"||$t(t.pointerId)};return _n.useLightboxScrollLock(),a.useEffect(()=>{const t=requestAnimationFrame(()=>we(!0));return()=>{cancelAnimationFrame(t),mt(),Qt(),ot.current!==null&&(cancelAnimationFrame(ot.current),ot.current=null),Yt.current&&clearTimeout(Yt.current),U.current&&clearTimeout(U.current)}},[]),a.useEffect(()=>{if(!ut){Gt(!0);return}O();const t=()=>O();return document.addEventListener("pointermove",t,{passive:!0}),document.addEventListener("pointerdown",t,{passive:!0}),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerdown",t),U.current&&clearTimeout(U.current)}},[ut,O]),a.useEffect(()=>{const t=n=>{n.key==="Escape"&&dt()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[dt]),a.useLayoutEffect(()=>{Ut()},[ct,o.length,$]),a.useLayoutEffect(()=>{l||st(A.current,"auto")},[ct,l]),a.useLayoutEffect(()=>{st(0,"auto")},[o.length,$]),a.useEffect(()=>{const t=b.current;if(!t||l||!V)return;const n=r=>{if(r.preventDefault(),Math.abs(r.deltaY)<=Math.abs(r.deltaX))return;const i=r.deltaMode===1?Gn:r.deltaMode===2?t.clientHeight:1,s=r.deltaY*i*Xn;if(s!==0){if(mt(),Y.current||(Y.current=!0,D.current=t.scrollLeft,q.current=null,X(!1)),D.current+=s,!$){const h=t.scrollWidth-t.clientWidth;D.current=Math.max(0,Math.min(h,D.current))}O(),H.current===null&&(H.current=requestAnimationFrame(Ce))}};return t.addEventListener("wheel",n,{passive:!1}),()=>{t.removeEventListener("wheel",n),Lt()}},[l,V,$]),a.useEffect(()=>{const t=b.current;if(!t)return;const n=()=>{Z(v.current.isActive);const i=t.scrollLeft,s=i-Dt.current;Dt.current=i;const h=nt.current>0?nt.current*.5:1/0;if(s!==0&&Math.abs(s)<h){const d=s>0?"forward":"backward";d!==Ht.current&&(Ht.current=d,We(d))}v.current.isActive&&v.current.hasMoved||z()};t.addEventListener("scroll",n,{passive:!0});const r=new ResizeObserver(()=>{Ut(),Z(v.current.isActive),We(Ht.current),z()});return r.observe(t),()=>{mt(),t.removeEventListener("scroll",n),r.disconnect()}},[o.length,$]),c.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${f?` ${e}-lightbox-editor`:""}${l?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{dn||dt()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:ye?1:0,transition:`opacity ${gt}ms ease`,pointerEvents:ye?"auto":"none"},children:[c.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:w,...mn}}),c.jsxs("div",{ref:ln,className:`${e}-lightbox-dismiss-area`,style:bn,...xn,children:[c.jsx("div",{className:`${e}-lightbox-content`,style:pn,onClick:t=>t.stopPropagation(),children:c.jsx("div",{ref:b,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":ft&&o.length>0?"true":"false","data-mouse-dragging":cn?"true":"false",onPointerDown:Rn,onPointerMove:In,onPointerUp:_e,onPointerCancel:_e,onLostPointerCapture:Wn,children:c.jsx("div",{ref:Bt,className:`${e}-lightbox-strip-track`,style:{gap:ct},children:an.map((t,n)=>{const r=t.image.objectFit??"contain",i=n%o.length,s=Math.floor(n/o.length),h=Wt(ct),d=`calc(-0.5 * (${h} + ${ct}))`;return c.jsxs("div",{ref:g=>S.current[n]=g,className:`${e}-strip-item`,style:{height:ae==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[c.jsx("img",{src:t.image.assetId,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:r}}),l&&i<o.length-1&&s===0&&c.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:d,width:h,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${s}-${t.image.assetId}-${i}`)})})})}),c.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":Le?"true":"false",style:gn,children:[c.jsx("div",{style:{position:"relative",width:"100%",height:ue,flexShrink:0,pointerEvents:"none"},children:l&&c.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:qe,pointerEvents:"auto",zIndex:3}})}),c.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:c.jsx("div",{className:`${e}-lightbox-content-area${C?` ${e}-lightbox-content-area-stacked`:""}`,children:(ge||L)&&c.jsx("div",{className:`${e}-header ${C?`${e}-header-two-row`:`${e}-header-single-row`}`,children:C?fn():ge||L?hn():null})})})]}),o.length>1&&Ct==="on"&&(()=>{const t=Wt(kt),n=`calc(-0.5 * (${kt} + ${t}))`;return c.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:kt},children:c.jsx("div",{ref:be,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:r=>r.stopPropagation(),children:c.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":He,style:{gap:Mt,"--thumbnail-active-color":Xe},children:[o.map((r,i)=>{const s=Wt(Mt),h=`calc(-0.5 * (${s} + ${Mt}))`;return c.jsxs("div",{ref:d=>{wt.current[i]=d},style:{position:"relative",flex:"0 0 auto"},children:[c.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":tt===i?"true":"false",onClick:()=>V&&ne==="click"&&st(i),onMouseEnter:()=>Ze&&ne==="hover"&&st(i),"aria-label":r.image.name?`View ${r.image.name}`:`View image ${i+1}`,"aria-current":tt===i?"true":void 0,children:c.jsx("img",{className:`${e}-thumb-image${pe?` ${e}-thumb-image-cover`:""}`,src:r.image.assetId,alt:"",draggable:!1,style:{...Je,maxWidth:ce,maxHeight:ce,width:xt.display==="cover"?"auto":"100%",height:"auto",objectFit:xt.display==="cover"?"cover":"contain"}})}),l&&i<o.length-1&&c.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:h,width:s,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${r.image.assetId}-${i}`)}),l&&c.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":l?"":void 0,style:{position:"absolute",left:0,right:0,bottom:n,height:t,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function nr(e){return`
|
|
2
|
-
.${e}-wrapper {
|
|
3
|
-
position: relative;
|
|
4
|
-
width: 100%;
|
|
5
|
-
height: 100%;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.${e}-cover {
|
|
9
|
-
position: relative;
|
|
10
|
-
width: 100%;
|
|
11
|
-
height: 100%;
|
|
12
|
-
cursor: pointer;
|
|
13
|
-
pointer-events: auto;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.${e}-ratio-wrapper-cover {
|
|
17
|
-
aspect-ratio: var(--image-aspect-ratio);
|
|
18
|
-
height: auto;
|
|
19
|
-
overflow: hidden;
|
|
20
|
-
width: 100%;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.${e}-ratio-wrapper-fit {
|
|
24
|
-
height: 100%;
|
|
25
|
-
width: 100%;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.${e}-cover-image {
|
|
29
|
-
display: block;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.${e}-cover-image-cover {
|
|
33
|
-
object-fit: cover;
|
|
34
|
-
width: 100%;
|
|
35
|
-
height: 100%;
|
|
36
|
-
max-width: 100%;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.${e}-cover-image-fit {
|
|
40
|
-
object-fit: contain;
|
|
41
|
-
width: auto;
|
|
42
|
-
height: auto;
|
|
43
|
-
max-width: 100%;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.${e}-lightbox {
|
|
47
|
-
position: fixed;
|
|
48
|
-
inset: 0;
|
|
49
|
-
z-index: 9997;
|
|
50
|
-
display: flex;
|
|
51
|
-
flex-direction: column;
|
|
52
|
-
align-items: center;
|
|
53
|
-
justify-content: center;
|
|
54
|
-
overscroll-behavior: none;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.${e}-lightbox-editor {
|
|
58
|
-
inset: auto;
|
|
59
|
-
top: var(--cntrl-article-top, 0);
|
|
60
|
-
left: var(--cntrl-article-left, 0);
|
|
61
|
-
width: var(--cntrl-article-width, 100vw) !important;
|
|
62
|
-
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
63
|
-
overflow: hidden;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.${e}-lightbox-edit-mode {
|
|
67
|
-
z-index: 1;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.${e}-lightbox-edit-mode .${e}-lightbox-strip {
|
|
71
|
-
overflow-x: hidden;
|
|
72
|
-
touch-action: none;
|
|
73
|
-
scroll-snap-type: none;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.${e}-lightbox-content {
|
|
77
|
-
position: relative;
|
|
78
|
-
z-index: 1;
|
|
79
|
-
display: flex;
|
|
80
|
-
flex-direction: column;
|
|
81
|
-
align-items: center;
|
|
82
|
-
justify-content: center;
|
|
83
|
-
width: 100%;
|
|
84
|
-
height: 100%;
|
|
85
|
-
box-sizing: border-box;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.${e}-lightbox-backdrop {
|
|
89
|
-
position: absolute;
|
|
90
|
-
inset: 0;
|
|
91
|
-
pointer-events: none;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.${e}-lightbox-dismiss-area {
|
|
95
|
-
position: relative;
|
|
96
|
-
width: 100%;
|
|
97
|
-
height: 100%;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.${e}-lightbox-strip {
|
|
101
|
-
position: relative;
|
|
102
|
-
flex: 1;
|
|
103
|
-
width: 100%;
|
|
104
|
-
min-height: 0;
|
|
105
|
-
max-width: 100%;
|
|
106
|
-
overflow-x: auto;
|
|
107
|
-
scroll-snap-type: x mandatory;
|
|
108
|
-
box-sizing: border-box;
|
|
109
|
-
touch-action: pan-x;
|
|
110
|
-
scrollbar-width: none;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.${e}-lightbox-strip-track {
|
|
114
|
-
display: flex;
|
|
115
|
-
flex-direction: row;
|
|
116
|
-
flex-wrap: nowrap;
|
|
117
|
-
align-items: center;
|
|
118
|
-
height: 100%;
|
|
119
|
-
min-width: min-content;
|
|
120
|
-
backface-visibility: hidden;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.${e}-lightbox-strip[data-mouse-dragging="true"] {
|
|
124
|
-
scroll-snap-type: none;
|
|
125
|
-
cursor: grabbing;
|
|
126
|
-
user-select: none;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.${e}-lightbox-strip[data-mouse-draggable="true"] {
|
|
130
|
-
cursor: grab;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.${e}-lightbox-strip::-webkit-scrollbar {
|
|
134
|
-
display: none;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.${e}-strip-item {
|
|
138
|
-
position: relative;
|
|
139
|
-
flex: 0 0 auto;
|
|
140
|
-
height: 100%;
|
|
141
|
-
scroll-snap-align: start;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.${e}-strip-item img {
|
|
145
|
-
user-select: none;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.${e}-thumbnails-wrap {
|
|
149
|
-
position: absolute;
|
|
150
|
-
left: 16px;
|
|
151
|
-
right: 16px;
|
|
152
|
-
z-index: 2;
|
|
153
|
-
pointer-events: auto;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.${e}-thumbnails {
|
|
157
|
-
width: 100%;
|
|
158
|
-
overflow-x: auto;
|
|
159
|
-
scrollbar-width: none;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.${e}-thumbnails-track {
|
|
163
|
-
display: flex;
|
|
164
|
-
flex-direction: row;
|
|
165
|
-
flex-wrap: nowrap;
|
|
166
|
-
align-items: flex-end;
|
|
167
|
-
justify-content: center;
|
|
168
|
-
width: max-content;
|
|
169
|
-
min-width: 100%;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.${e}-lightbox-editor.${e}-lightbox-edit-mode .${e}-thumbnails {
|
|
173
|
-
overflow: visible;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.${e}-thumbnails::-webkit-scrollbar {
|
|
177
|
-
display: none;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.${e}-thumb {
|
|
181
|
-
flex: 0 0 auto;
|
|
182
|
-
display: flex;
|
|
183
|
-
align-items: center;
|
|
184
|
-
justify-content: center;
|
|
185
|
-
padding: 0;
|
|
186
|
-
border: none;
|
|
187
|
-
background: transparent;
|
|
188
|
-
cursor: pointer;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.${e}-thumbnails-track[data-thumbnail-active="outline"] .${e}-thumb .${e}-thumb-image {
|
|
192
|
-
box-sizing: border-box;
|
|
193
|
-
border: 2px solid transparent;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.${e}-thumbnails-track[data-thumbnail-active="outline"] .${e}-thumb[data-active="true"] .${e}-thumb-image {
|
|
197
|
-
border-color: var(--thumbnail-active-color, #ffffff);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.${e}-thumbnails-track[data-thumbnail-active="color"] .${e}-thumb:not([data-active="true"]) .${e}-thumb-image {
|
|
201
|
-
filter: grayscale(1);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.${e}-thumbnails-track[data-thumbnail-active="scale-up"] .${e}-thumb[data-active="true"] {
|
|
205
|
-
transform: scale(1.15);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.${e}-thumb-image {
|
|
209
|
-
display: block;
|
|
210
|
-
object-fit: contain;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.${e}-thumb-image-cover {
|
|
214
|
-
aspect-ratio: var(--image-aspect-ratio);
|
|
215
|
-
width: auto;
|
|
216
|
-
height: auto;
|
|
217
|
-
object-fit: cover;
|
|
218
|
-
}
|
|
219
|
-
.${e}-close-icon {
|
|
220
|
-
position: relative;
|
|
221
|
-
flex-shrink: 0;
|
|
222
|
-
grid-area: close;
|
|
223
|
-
pointer-events: auto;
|
|
224
|
-
z-index: 2;
|
|
225
|
-
display: flex;
|
|
226
|
-
align-items: center;
|
|
227
|
-
justify-content: center;
|
|
228
|
-
border: none;
|
|
229
|
-
background-color: transparent;
|
|
230
|
-
padding: 0;
|
|
231
|
-
opacity: 1;
|
|
232
|
-
transition: opacity ${gt}ms ease;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.${e}-close-icon[data-overlay-content-hidden="true"] {
|
|
236
|
-
opacity: 0;
|
|
237
|
-
pointer-events: none;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
.${e}-close-icon-inner {
|
|
241
|
-
all: unset;
|
|
242
|
-
position: relative;
|
|
243
|
-
cursor: pointer;
|
|
244
|
-
width: 100%;
|
|
245
|
-
height: 100%;
|
|
246
|
-
pointer-events: auto;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
.${e}-close-icon-img {
|
|
250
|
-
position: absolute;
|
|
251
|
-
top: 50%;
|
|
252
|
-
left: 50%;
|
|
253
|
-
transform: translate(-50%, -50%);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
.${e}-header {
|
|
257
|
-
position: relative;
|
|
258
|
-
display: grid;
|
|
259
|
-
flex: 1;
|
|
260
|
-
width: 100%;
|
|
261
|
-
min-width: 0;
|
|
262
|
-
z-index: 2;
|
|
263
|
-
box-sizing: border-box;
|
|
264
|
-
pointer-events: none;
|
|
265
|
-
word-break: break-word;
|
|
266
|
-
align-items: center;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.${e}-header-single-row {
|
|
270
|
-
grid-template-columns: auto auto auto auto 1fr auto;
|
|
271
|
-
grid-template-areas: "margin title1 title2 title3 . close";
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
.${e}-header-two-row {
|
|
275
|
-
height: 100%;
|
|
276
|
-
align-self: stretch;
|
|
277
|
-
display: flex;
|
|
278
|
-
flex-direction: column;
|
|
279
|
-
width: 100%;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
.${e}-header-row-top {
|
|
283
|
-
display: flex;
|
|
284
|
-
flex-direction: row;
|
|
285
|
-
align-items: center;
|
|
286
|
-
width: 100%;
|
|
287
|
-
flex-shrink: 0;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
.${e}-header-row-top .${e}-title-cell[data-title="title1"] {
|
|
291
|
-
flex: 0 0 auto;
|
|
292
|
-
min-width: 0;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
.${e}-header-row-top .${e}-close-icon {
|
|
296
|
-
flex-shrink: 0;
|
|
297
|
-
margin-left: auto;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.${e}-header-row-bottom-wrap {
|
|
301
|
-
display: flex;
|
|
302
|
-
flex-direction: column;
|
|
303
|
-
width: 100%;
|
|
304
|
-
margin-top: auto;
|
|
305
|
-
flex-shrink: 0;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
.${e}-header-row-bottom {
|
|
309
|
-
position: relative;
|
|
310
|
-
display: flex;
|
|
311
|
-
flex-direction: row;
|
|
312
|
-
align-items: flex-end;
|
|
313
|
-
width: 100%;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
.${e}-header-row-bottom .${e}-title-cell {
|
|
317
|
-
flex: 0 0 auto;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
.${e}-title-cell {
|
|
321
|
-
position: relative;
|
|
322
|
-
flex: 0 0 auto;
|
|
323
|
-
min-width: 0;
|
|
324
|
-
box-sizing: border-box;
|
|
325
|
-
}
|
|
326
|
-
.${e}-title1,
|
|
327
|
-
.${e}-title2,
|
|
328
|
-
.${e}-title3 {
|
|
329
|
-
margin: 0;
|
|
330
|
-
min-width: 0;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
.${e}-title-resize-handle {
|
|
334
|
-
background: transparent;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
.${e}-lightbox-content-inner {
|
|
338
|
-
position: absolute;
|
|
339
|
-
inset: 0;
|
|
340
|
-
z-index: 2;
|
|
341
|
-
pointer-events: none;
|
|
342
|
-
display: flex;
|
|
343
|
-
flex-direction: column;
|
|
344
|
-
opacity: 1;
|
|
345
|
-
transition: opacity ${gt}ms ease;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
.${e}-lightbox-content-inner[data-overlay-content-hidden="true"] {
|
|
349
|
-
opacity: 0;
|
|
350
|
-
pointer-events: none;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.${e}-lightbox-content-area {
|
|
354
|
-
position: relative;
|
|
355
|
-
display: flex;
|
|
356
|
-
flex-direction: row;
|
|
357
|
-
flex: 1;
|
|
358
|
-
min-width: 0;
|
|
359
|
-
min-height: 0;
|
|
360
|
-
align-items: flex-start;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
.${e}-lightbox-content-area-stacked {
|
|
364
|
-
align-items: stretch;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
.${e}-control {
|
|
368
|
-
position: relative;
|
|
369
|
-
z-index: 2;
|
|
370
|
-
pointer-events: auto;
|
|
371
|
-
flex-shrink: 0;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
.${e}-control::before {
|
|
375
|
-
content: "";
|
|
376
|
-
position: absolute;
|
|
377
|
-
top: 0;
|
|
378
|
-
left: 0;
|
|
379
|
-
width: 100%;
|
|
380
|
-
height: 100%;
|
|
381
|
-
min-width: 20px;
|
|
382
|
-
min-height: 20px;
|
|
383
|
-
pointer-events: auto;
|
|
384
|
-
z-index: 10;
|
|
385
|
-
}
|
|
386
|
-
`}const rr=({settings:e,content:o,isEditor:u,isEditMode:f,isPreviewMode:l,portalId:m})=>{const{prefix:p}=Mn.useScopedStyles(),{cover:w,coverFit:I}=e,F=a.useRef(null),[j,K]=a.useState(!1),L=o??[],G=j&&L.length>0,E=()=>{L.length!==0&&K(!0)};return a.useEffect(()=>{!u||f||l||K(!1)},[u,f,l]),c.jsxs(c.Fragment,{children:[c.jsxs("div",{ref:F,className:`${p}-wrapper`,children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:nr(p)}}),w&&c.jsx("div",{className:`${p}-cover ${J.isImageRatioCover(I)?`${p}-ratio-wrapper-cover`:`${p}-ratio-wrapper-fit`}`,onClick:()=>E(),style:{...J.isImageRatioCover(I)?{"--image-aspect-ratio":J.getAspectRatio(I)}:{}},"aria-label":"Open image gallery",children:c.jsx("img",{className:`${p}-cover-image ${J.isImageRatioCover(I)?`${p}-cover-image-cover`:`${p}-cover-image-fit`}`,src:w,alt:"cover"})})]}),G&&typeof document<"u"&&(()=>{const Q=(m?document.getElementById(m):null)??document.body;return jn.createPortal(c.jsx(er,{prefix:p,images:L,settings:e,isEditor:u,isEditMode:f,isPreviewMode:l,onClose:()=>K(!1)}),Q)})()]})};exports.LightboxStrip=rr;exports.STRIP_TEXT_STYLE_PREFIXES=Oe;exports.STRIP_TEXT_STYLE_TAB_LABELS=ze;exports.createStripTextStylePanelTab=Qn;exports.createStripTextStyleTabContentItems=Be;exports.extractTitlesFromLegacyText=Fe;exports.getStripTextStyleSettingKey=_;exports.resolveStripItemTitles=Ke;
|