@stlite/desktop 0.73.0 → 0.73.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "/static/css/main.c5766a64.css",
4
- "main.js": "/static/js/main.006fb699.js",
4
+ "main.js": "/static/js/main.6755d5f5.js",
5
5
  "static/js/3612.ffb1fe1f.chunk.js": "/static/js/3612.ffb1fe1f.chunk.js",
6
6
  "static/js/6573.144dfa36.chunk.js": "/static/js/6573.144dfa36.chunk.js",
7
7
  "static/js/5510.80a638ac.chunk.js": "/static/js/5510.80a638ac.chunk.js",
8
- "static/js/4041.b5a10716.chunk.js": "/static/js/4041.b5a10716.chunk.js",
8
+ "static/js/4041.19c1ca53.chunk.js": "/static/js/4041.19c1ca53.chunk.js",
9
9
  "static/js/5314.39021199.chunk.js": "/static/js/5314.39021199.chunk.js",
10
10
  "static/js/4230.7c65808e.chunk.js": "/static/js/4230.7c65808e.chunk.js",
11
11
  "static/css/9877.da3ff442.chunk.css": "/static/css/9877.da3ff442.chunk.css",
@@ -16,15 +16,15 @@
16
16
  "static/js/7234.0980b881.chunk.js": "/static/js/7234.0980b881.chunk.js",
17
17
  "static/js/6000.1159b8a4.chunk.js": "/static/js/6000.1159b8a4.chunk.js",
18
18
  "static/js/3494.e2c0ae04.chunk.js": "/static/js/3494.e2c0ae04.chunk.js",
19
- "static/js/7683.3e5291f1.chunk.js": "/static/js/7683.3e5291f1.chunk.js",
19
+ "static/js/7683.4b56186d.chunk.js": "/static/js/7683.4b56186d.chunk.js",
20
20
  "static/js/7755.8c689d54.chunk.js": "/static/js/7755.8c689d54.chunk.js",
21
21
  "static/js/1809.c32c00e6.chunk.js": "/static/js/1809.c32c00e6.chunk.js",
22
22
  "static/js/9182.d7d66fd1.chunk.js": "/static/js/9182.d7d66fd1.chunk.js",
23
- "static/js/5563.baae3e3b.chunk.js": "/static/js/5563.baae3e3b.chunk.js",
23
+ "static/js/5563.94a19736.chunk.js": "/static/js/5563.94a19736.chunk.js",
24
24
  "static/js/6176.91adb590.chunk.js": "/static/js/6176.91adb590.chunk.js",
25
25
  "static/js/2000.d1c979cc.chunk.js": "/static/js/2000.d1c979cc.chunk.js",
26
26
  "static/js/7186.df13463b.chunk.js": "/static/js/7186.df13463b.chunk.js",
27
- "static/js/6945.df6edd7e.chunk.js": "/static/js/6945.df6edd7e.chunk.js",
27
+ "static/js/6945.8aeefc8b.chunk.js": "/static/js/6945.8aeefc8b.chunk.js",
28
28
  "static/js/7956.c8053817.chunk.js": "/static/js/7956.c8053817.chunk.js",
29
29
  "static/js/3890.4f85e8b8.chunk.js": "/static/js/3890.4f85e8b8.chunk.js",
30
30
  "static/js/4684.97415310.chunk.js": "/static/js/4684.97415310.chunk.js",
@@ -169,6 +169,6 @@
169
169
  },
170
170
  "entrypoints": [
171
171
  "static/css/main.c5766a64.css",
172
- "static/js/main.006fb699.js"
172
+ "static/js/main.6755d5f5.js"
173
173
  ]
174
174
  }
package/build/index.html CHANGED
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>stlite</title><meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'wasm-unsafe-eval' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; worker-src 'self' blob:; script-src-elem 'self' 'unsafe-inline' https:; style-src-elem 'self' 'unsafe-inline' https:; font-src 'self' data: https:; connect-src https://data.streamlit.io/ https://*.mapbox.com/ 'self' https: data:; img-src https: blob: data: file:; media-src https: blob:; frame-src https:"><script defer="defer" src="/static/js/main.006fb699.js"></script><link href="/static/css/main.c5766a64.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>stlite</title><meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'wasm-unsafe-eval' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; worker-src 'self' blob:; script-src-elem 'self' 'unsafe-inline' https:; style-src-elem 'self' 'unsafe-inline' https:; font-src 'self' data: https:; connect-src https://data.streamlit.io/ https://*.mapbox.com/ 'self' https: data:; img-src https: blob: data: file:; media-src https: blob:; frame-src https:"><script defer="defer" src="/static/js/main.6755d5f5.js"></script><link href="/static/css/main.c5766a64.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[4041],{14041:(e,t,r)=>{r.r(t),r.d(t,{default:()=>d});var n=r(50016),u=r(57277),s=r(90076);function d({element:e,width:t,endpoints:r,elementMgr:d}){const i=(0,n.useRef)(null),{startTime:a,endTime:o,loop:c,autoplay:l}=e,m=(0,n.useMemo)((()=>{if(!e.id)return!0;const t=d.getElementState(e.id,"preventAutoplay");return t||d.setElementState(e.id,"preventAutoplay",!0),null!==t&&void 0!==t&&t}),[e.id,d]);(0,n.useEffect)((()=>{i.current&&(i.current.currentTime=a)}),[a]),(0,n.useEffect)((()=>{const t=i.current,r=()=>{t&&(t.currentTime=e.startTime)};return t&&t.addEventListener("loadedmetadata",r),()=>{t&&t.removeEventListener("loadedmetadata",r)}}),[e]),(0,n.useEffect)((()=>{const e=i.current;if(!e)return;let t=!1;const r=()=>{o>0&&e.currentTime>=o&&(c?(e.currentTime=a||0,e.play()):t||(t=!0,e.pause()))};return o>0&&e.addEventListener("timeupdate",r),()=>{e&&o>0&&e.removeEventListener("timeupdate",r)}}),[o,c,a]),(0,n.useEffect)((()=>{const e=i.current;if(!e)return;const t=()=>{c&&(e.currentTime=a||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}}),[c,a]);const f=(0,u.PY)(e.url),p=r.buildMediaURL(f);return(0,s.jsx)("audio",{className:"stAudio","data-testid":"stAudio",ref:i,controls:!0,autoPlay:l&&!m,src:p,style:{width:t}})}}}]);
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[4041],{14041:(e,t,r)=>{r.r(t),r.d(t,{default:()=>d});var n=r(50016),u=r(14052),s=r(90076);function d({element:e,width:t,endpoints:r,elementMgr:d}){const i=(0,n.useRef)(null),{startTime:a,endTime:o,loop:c,autoplay:l}=e,m=(0,n.useMemo)((()=>{if(!e.id)return!0;const t=d.getElementState(e.id,"preventAutoplay");return t||d.setElementState(e.id,"preventAutoplay",!0),null!==t&&void 0!==t&&t}),[e.id,d]);(0,n.useEffect)((()=>{i.current&&(i.current.currentTime=a)}),[a]),(0,n.useEffect)((()=>{const t=i.current,r=()=>{t&&(t.currentTime=e.startTime)};return t&&t.addEventListener("loadedmetadata",r),()=>{t&&t.removeEventListener("loadedmetadata",r)}}),[e]),(0,n.useEffect)((()=>{const e=i.current;if(!e)return;let t=!1;const r=()=>{o>0&&e.currentTime>=o&&(c?(e.currentTime=a||0,e.play()):t||(t=!0,e.pause()))};return o>0&&e.addEventListener("timeupdate",r),()=>{e&&o>0&&e.removeEventListener("timeupdate",r)}}),[o,c,a]),(0,n.useEffect)((()=>{const e=i.current;if(!e)return;const t=()=>{c&&(e.currentTime=a||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}}),[c,a]);const f=(0,u.PY)(e.url),p=r.buildMediaURL(f);return(0,s.jsx)("audio",{className:"stAudio","data-testid":"stAudio",ref:i,controls:!0,autoPlay:l&&!m,src:p,style:{width:t}})}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[5563],{15563:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var a=r(50016),n=r(13882),s=r(90421),i=r(57277),d=r(90076);const o=528;function l({element:e,width:t,endpoints:r,elementMgr:l}){const u=(0,a.useRef)(null),{type:c,url:p,startTime:m,subtitles:f,endTime:h,loop:v,autoplay:y,muted:E}=e,T=(0,i.PY)(p),L=(0,i.$m)(f),g=(0,a.useMemo)((()=>{if(!e.id)return!0;const t=l.getElementState(e.id,"preventAutoplay");return t||l.setElementState(e.id,"preventAutoplay",!0),null!==t&&void 0!==t&&t}),[e.id,l]);(0,a.useEffect)((()=>{u.current&&(u.current.currentTime=m)}),[m]),(0,a.useEffect)((()=>{const t=u.current,r=()=>{t&&(t.currentTime=e.startTime)};return t&&t.addEventListener("loadedmetadata",r),()=>{t&&t.removeEventListener("loadedmetadata",r)}}),[e]),(0,a.useEffect)((()=>{const e=u.current;if(!e)return;let t=!1;const r=()=>{h>0&&e.currentTime>=h&&(v?(e.currentTime=m||0,e.play()):t||(t=!0,e.pause()))};return h>0&&e.addEventListener("timeupdate",r),()=>{e&&h>0&&e.removeEventListener("timeupdate",r)}}),[h,v,m]),(0,a.useEffect)((()=>{const e=u.current;if(!e)return;const t=()=>{v&&(e.currentTime=m||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}}),[v,m]);const k=t=>{const{startTime:r,endTime:a,loop:n,autoplay:s,muted:i}=e,d=new URL(t);if(r&&!isNaN(r)&&d.searchParams.append("start",r.toString()),a&&!isNaN(a)&&d.searchParams.append("end",a.toString()),n){d.searchParams.append("loop","1");const e=d.pathname.split("/").pop();e&&d.searchParams.append("playlist",e)}return s&&d.searchParams.append("autoplay","1"),i&&d.searchParams.append("mute","1"),d.toString()};if(c===n.Ce.Type.YOUTUBE_IFRAME){const e=0!==t?.75*t:o;return(0,d.jsx)("iframe",{className:"stVideo","data-testid":"stVideo",title:T,src:k(T),width:t,height:e,style:{colorScheme:"normal"},frameBorder:"0",allow:"autoplay; encrypted-media",allowFullScreen:!0})}return(0,d.jsx)("video",{className:"stVideo","data-testid":"stVideo",ref:u,controls:!0,muted:E,autoPlay:y&&!g,src:r.buildMediaURL(T),style:{width:t,height:0===t?o:void 0},crossOrigin:s.LD&&L.length>0?"anonymous":void 0,children:L&&L.map(((e,t)=>(0,d.jsx)("track",{kind:"captions",src:r.buildMediaURL(e.url),label:e.label,default:0===t},t)))})}}}]);
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[5563],{15563:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var a=r(50016),n=r(13882),s=r(90421),i=r(14052),d=r(90076);const o=528;function l({element:e,width:t,endpoints:r,elementMgr:l}){const u=(0,a.useRef)(null),{type:c,url:p,startTime:m,subtitles:f,endTime:h,loop:v,autoplay:y,muted:E}=e,T=(0,i.PY)(p),L=(0,i.$m)(f),g=(0,a.useMemo)((()=>{if(!e.id)return!0;const t=l.getElementState(e.id,"preventAutoplay");return t||l.setElementState(e.id,"preventAutoplay",!0),null!==t&&void 0!==t&&t}),[e.id,l]);(0,a.useEffect)((()=>{u.current&&(u.current.currentTime=m)}),[m]),(0,a.useEffect)((()=>{const t=u.current,r=()=>{t&&(t.currentTime=e.startTime)};return t&&t.addEventListener("loadedmetadata",r),()=>{t&&t.removeEventListener("loadedmetadata",r)}}),[e]),(0,a.useEffect)((()=>{const e=u.current;if(!e)return;let t=!1;const r=()=>{h>0&&e.currentTime>=h&&(v?(e.currentTime=m||0,e.play()):t||(t=!0,e.pause()))};return h>0&&e.addEventListener("timeupdate",r),()=>{e&&h>0&&e.removeEventListener("timeupdate",r)}}),[h,v,m]),(0,a.useEffect)((()=>{const e=u.current;if(!e)return;const t=()=>{v&&(e.currentTime=m||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}}),[v,m]);const k=t=>{const{startTime:r,endTime:a,loop:n,autoplay:s,muted:i}=e,d=new URL(t);if(r&&!isNaN(r)&&d.searchParams.append("start",r.toString()),a&&!isNaN(a)&&d.searchParams.append("end",a.toString()),n){d.searchParams.append("loop","1");const e=d.pathname.split("/").pop();e&&d.searchParams.append("playlist",e)}return s&&d.searchParams.append("autoplay","1"),i&&d.searchParams.append("mute","1"),d.toString()};if(c===n.Ce.Type.YOUTUBE_IFRAME){const e=0!==t?.75*t:o;return(0,d.jsx)("iframe",{className:"stVideo","data-testid":"stVideo",title:T,src:k(T),width:t,height:e,style:{colorScheme:"normal"},frameBorder:"0",allow:"autoplay; encrypted-media",allowFullScreen:!0})}return(0,d.jsx)("video",{className:"stVideo","data-testid":"stVideo",ref:u,controls:!0,muted:E,autoPlay:y&&!g,src:r.buildMediaURL(T),style:{width:t,height:0===t?o:void 0},crossOrigin:s.LD&&L.length>0?"anonymous":void 0,children:L&&L.map(((e,t)=>(0,d.jsx)("track",{kind:"captions",src:r.buildMediaURL(e.url),label:e.label,default:0===t},t)))})}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[6945],{16945:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var i=n(50016),l=n(62363),r=n(9525),s=n(82729),d=n(28230),o=n(56806),a=n(19939),u=n(57277),c=n(90076);const f=function(e){const{disabled:t,element:n,widgetMgr:f,width:b,endpoints:h,fragmentId:w}=e,m={width:b},{libConfig:{enforceDownloadInNewTab:p=!1}}=i.useContext(a.n),k="primary"===n.type?r.KX.PRIMARY:r.KX.SECONDARY,A=(0,u.mn)(),g=!n.help||b;return(0,c.jsx)("div",{className:"stDownloadButton","data-testid":"stDownloadButton",style:m,children:(0,c.jsx)(s.F,{help:n.help,children:(0,c.jsx)(d.Ay,{kind:k,size:r.Pj.SMALL,disabled:t,onClick:()=>{if(f.setTriggerValue(n,{fromUi:!0},w),n.url.startsWith("/media"))return void(0,u.Yr)(A,n.url);const e=function(e,t,n){return(0,l.A)({enforceDownloadInNewTab:n,url:e.buildMediaURL(t),filename:""})}(h,n.url,p);e.click()},fluidWidth:!!n.useContainerWidth&&g,children:(0,c.jsx)(o.Y,{icon:n.icon,label:n.label})})})})}},62363:(e,t,n)=>{n.d(t,{A:()=>i});const i=({enforceDownloadInNewTab:e,url:t,filename:n})=>{const i=document.createElement("a");return i.setAttribute("href",t),e?i.setAttribute("target","_blank"):i.setAttribute("target","_self"),i.setAttribute("download",n),i}}}]);
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[6945],{16945:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var i=n(50016),l=n(62363),r=n(9525),s=n(82729),d=n(28230),o=n(56806),a=n(19939),u=n(14052),c=n(90076);const f=function(e){const{disabled:t,element:n,widgetMgr:f,width:b,endpoints:h,fragmentId:w}=e,m={width:b},{libConfig:{enforceDownloadInNewTab:p=!1}}=i.useContext(a.n),k="primary"===n.type?r.KX.PRIMARY:r.KX.SECONDARY,A=(0,u.mn)(),g=!n.help||b;return(0,c.jsx)("div",{className:"stDownloadButton","data-testid":"stDownloadButton",style:m,children:(0,c.jsx)(s.F,{help:n.help,children:(0,c.jsx)(d.Ay,{kind:k,size:r.Pj.SMALL,disabled:t,onClick:()=>{if(f.setTriggerValue(n,{fromUi:!0},w),n.url.startsWith("/media"))return void(0,u.Yr)(A,n.url);const e=function(e,t,n){return(0,l.A)({enforceDownloadInNewTab:n,url:e.buildMediaURL(t),filename:""})}(h,n.url,p);e.click()},fluidWidth:!!n.useContainerWidth&&g,children:(0,c.jsx)(o.Y,{icon:n.icon,label:n.label})})})})}},62363:(e,t,n)=>{n.d(t,{A:()=>i});const i=({enforceDownloadInNewTab:e,url:t,filename:n})=>{const i=document.createElement("a");return i.setAttribute("href",t),e?i.setAttribute("target","_blank"):i.setAttribute("target","_self"),i.setAttribute("download",n),i}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[7683,9163],{57683:(e,t,n)=>{n.r(t),n.d(t,{default:()=>x});n(50016);var i=n(81975),o=n(49694),l=n(25257),a=n(15144),s=n(18056),r=n(57277),d=n(84927);const c=(0,d.A)("div",{target:"e115fcil2"})((({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:e.spacing.lg,maxWidth:"100%"})),""),h=(0,d.A)("div",{target:"e115fcil1"})({name:"1xf0csu",styles:"display:flex;flex-direction:column;align-items:stretch;width:auto;flex-grow:0"}),m=(0,d.A)("div",{target:"e115fcil0"})((({theme:e})=>({fontFamily:e.genericFonts.bodyFont,fontSize:e.fontSizes.sm,color:e.colors.fadedText60,textAlign:"center",marginTop:e.spacing.xs,wordWrap:"break-word",padding:e.spacing.threeXS})),"");var u=n(90076),p=function(e){return e[e.OriginalWidth=-1]="OriginalWidth",e[e.ColumnWidth=-2]="ColumnWidth",e[e.AutoWidth=-3]="AutoWidth",e[e.MinImageOrContainer=-4]="MinImageOrContainer",e[e.MaxImageOrContainer=-5]="MaxImageOrContainer",e}(p||{});const x=(0,s.A)((function({element:e,width:t,endpoints:n,disableFullscreenMode:s}){const d=(0,r.$m)(e.imgs),{expanded:x,width:g,height:f,expand:v,collapse:w}=(0,a.i)(l.T);let C;const b=e.width;if([p.OriginalWidth,p.AutoWidth,p.MinImageOrContainer].includes(b))C=void 0;else if([p.ColumnWidth,p.MaxImageOrContainer].includes(b))C=x?g:t;else{if(!(b>0))throw Error(`Invalid image width: ${b}`);C=b}const y={};return f&&x?(y.maxHeight=f,y.objectFit="contain"):(y.width=C,y.maxWidth="100%"),(0,u.jsxs)(i.mx,{width:C,height:f,useContainerWidth:x,children:[(0,u.jsx)(o.A,{target:i.mx,isFullScreen:x,onExpand:v,onCollapse:w,disableFullscreenMode:s}),(0,u.jsx)(c,{className:"stImage","data-testid":"stImage",style:{width:C},children:d.map(((e,t)=>{const i=e;return(0,u.jsxs)(h,{"data-testid":"stImageContainer",children:[(0,u.jsx)("img",{style:y,src:n.buildMediaURL(i.url),alt:t.toString()}),i.caption&&(0,u.jsx)(m,{"data-testid":"stImageCaption",style:y,children:` ${i.caption} `})]},t)}))})]})}))},25257:(e,t,n)=>{n.d(t,{T:()=>i});const i=(0,n(50016).createContext)(null);i.displayName="ElementFullscreenContext"},18056:(e,t,n)=>{n.d(t,{A:()=>p});var i=n(50016),o=n(4134),l=n.n(o),a=n(83592);const s=(0,n(84927).A)("div",{target:"elp1w7k0"})((({theme:e,isExpanded:t})=>({...t?{position:"fixed",top:0,left:0,bottom:0,right:0,background:e.colors.bgColor,zIndex:e.zIndices.fullscreenWrapper,padding:e.spacing.md,paddingTop:e.sizes.fullScreenHeaderHeight,overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}})),"");var r=n(25257),d=n(19939),c=n(30753),h=n(15144);var m=n(90076);const u=({children:e,height:t,width:n})=>{const o=(0,a.u)(),{expanded:l,fullHeight:u,fullWidth:p,zoomIn:x,zoomOut:g}=(()=>{const{setFullScreen:e}=(0,i.useContext)(d.n),[t,n]=(0,i.useState)(!1),{fullHeight:o,fullWidth:l}=(0,h.i)(c.j),a=(0,i.useCallback)((t=>{n(t),e(t)}),[e]),s=(0,i.useCallback)((()=>{document.body.style.overflow="hidden",a(!0)}),[a]),r=(0,i.useCallback)((()=>{document.body.style.overflow="unset",a(!1)}),[a]),m=(0,i.useCallback)((e=>{27===e.keyCode&&t&&r()}),[r,t]);return(0,i.useEffect)((()=>(document.addEventListener("keydown",m,!1),()=>{document.removeEventListener("keydown",m,!1)})),[m]),(0,i.useMemo)((()=>({expanded:t,zoomIn:s,zoomOut:r,fullHeight:o,fullWidth:l})),[t,s,r,o,l])})(),f=(0,i.useMemo)((()=>({width:l?p:n,height:l?u:t,expanded:l,expand:x,collapse:g})),[l,u,p,t,n,x,g]);return(0,m.jsx)(r.T.Provider,{value:f,children:(0,m.jsx)(s,{isExpanded:l,"data-testid":"stFullScreenFrame",theme:o,children:e})})};const p=function(e){const t=t=>(0,m.jsx)(u,{width:t.width,children:(0,m.jsx)(e,{...t})});return t.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,l()(t,e)}},49694:(e,t,n)=>{n.d(t,{A:()=>p,K:()=>u});n(50016);var i=n(83592),o=n(43084),l=n(17948),a=n(72587),s=n(83774),r=n(28230),d=n(9525),c=n(20758),h=n(81975),m=n(90076);function u({label:e,show_label:t,icon:n,onClick:o}){const l=(0,i.u)(),h=t?e:"";return(0,m.jsx)("div",{"data-testid":"stElementToolbarButton",children:(0,m.jsx)(s.A,{content:(0,m.jsx)(a.Ay,{source:e,allowHTML:!1,style:{fontSize:l.fontSizes.sm}}),placement:s.W.TOP,onMouseEnterDelay:1e3,inline:!0,children:(0,m.jsxs)(r.Ay,{onClick:e=>{o&&o(),e.stopPropagation()},kind:d.KX.ELEMENT_TOOLBAR,"aria-label":e,children:[n&&(0,m.jsx)(c.A,{content:n,size:"md",testid:"stElementToolbarButtonIcon"}),h&&(0,m.jsx)("span",{children:h})]})})})}const p=({onExpand:e,onCollapse:t,isFullScreen:n,locked:i,children:a,target:s,disableFullscreenMode:r})=>(0,m.jsx)(h.Sq,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:i||n,target:s,children:(0,m.jsxs)(h.x8,{children:[a,e&&!r&&!n&&(0,m.jsx)(u,{label:"Fullscreen",icon:o.g,onClick:()=>e()}),t&&!r&&n&&(0,m.jsx)(u,{label:"Close fullscreen",icon:l.Q,onClick:()=>t()})]})})},81975:(e,t,n)=>{n.d(t,{Sq:()=>a,mx:()=>r,x8:()=>s});var i=n(84927),o=n(9320);const l="-2.4rem",a=(0,i.A)("div",{target:"e2wxzia2"})((({theme:e,locked:t,target:n})=>({padding:`${e.spacing.sm} 0 ${e.spacing.sm} ${e.spacing.sm}`,position:"absolute",top:t?l:"-1rem",right:e.spacing.none,transition:"none",...!t&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:l},...n&&{[`${n}:hover &, ${n}:active &, ${n}:focus-visible &`]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:l}}}})),""),s=(0,i.A)("div",{target:"e2wxzia1"})((({theme:e})=>({color:(0,o.iq)(e)?e.colors.fadedText60:e.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:"1px 2px 8px rgba(0, 0, 0, 0.08)",borderRadius:e.radii.default,backgroundColor:e.colors.lightenedBg05,width:"fit-content",zIndex:e.zIndices.sidebar+1})),""),r=(0,i.A)("div",{target:"e2wxzia0"})((({width:e,height:t,useContainerWidth:n})=>({position:"relative",height:n?t:"fit-content",width:n?e:"fit-content",maxWidth:"100%"})),"")},15144:(e,t,n)=>{n.d(t,{i:()=>o});var i=n(50016);const o=e=>{const t=(0,i.useContext)(e);var n;if(null===t||void 0===t)throw new Error(`useRequiredContext: ${null!==(n=e.displayName)&&void 0!==n?n:"context"} not found`);return t}},43084:(e,t,n)=>{n.d(t,{g:()=>a});var i=n(89575),o=n(50016),l=n(50088),a=o.forwardRef((function(e,t){return o.createElement(l.I,(0,i.A)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))}));a.displayName="Fullscreen"},17948:(e,t,n)=>{n.d(t,{Q:()=>a});var i=n(89575),o=n(50016),l=n(50088),a=o.forwardRef((function(e,t){return o.createElement(l.I,(0,i.A)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))}));a.displayName="FullscreenExit"}}]);
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[7683,9163],{57683:(e,t,n)=>{n.r(t),n.d(t,{default:()=>x});n(50016);var i=n(81975),o=n(49694),l=n(25257),a=n(15144),s=n(18056),r=n(14052),d=n(84927);const c=(0,d.A)("div",{target:"e115fcil2"})((({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:e.spacing.lg,maxWidth:"100%"})),""),h=(0,d.A)("div",{target:"e115fcil1"})({name:"1xf0csu",styles:"display:flex;flex-direction:column;align-items:stretch;width:auto;flex-grow:0"}),m=(0,d.A)("div",{target:"e115fcil0"})((({theme:e})=>({fontFamily:e.genericFonts.bodyFont,fontSize:e.fontSizes.sm,color:e.colors.fadedText60,textAlign:"center",marginTop:e.spacing.xs,wordWrap:"break-word",padding:e.spacing.threeXS})),"");var u=n(90076),p=function(e){return e[e.OriginalWidth=-1]="OriginalWidth",e[e.ColumnWidth=-2]="ColumnWidth",e[e.AutoWidth=-3]="AutoWidth",e[e.MinImageOrContainer=-4]="MinImageOrContainer",e[e.MaxImageOrContainer=-5]="MaxImageOrContainer",e}(p||{});const x=(0,s.A)((function({element:e,width:t,endpoints:n,disableFullscreenMode:s}){const d=(0,r.$m)(e.imgs),{expanded:x,width:g,height:f,expand:v,collapse:w}=(0,a.i)(l.T);let C;const b=e.width;if([p.OriginalWidth,p.AutoWidth,p.MinImageOrContainer].includes(b))C=void 0;else if([p.ColumnWidth,p.MaxImageOrContainer].includes(b))C=x?g:t;else{if(!(b>0))throw Error(`Invalid image width: ${b}`);C=b}const y={};return f&&x?(y.maxHeight=f,y.objectFit="contain"):(y.width=C,y.maxWidth="100%"),(0,u.jsxs)(i.mx,{width:C,height:f,useContainerWidth:x,children:[(0,u.jsx)(o.A,{target:i.mx,isFullScreen:x,onExpand:v,onCollapse:w,disableFullscreenMode:s}),(0,u.jsx)(c,{className:"stImage","data-testid":"stImage",style:{width:C},children:d.map(((e,t)=>{const i=e;return(0,u.jsxs)(h,{"data-testid":"stImageContainer",children:[(0,u.jsx)("img",{style:y,src:n.buildMediaURL(i.url),alt:t.toString()}),i.caption&&(0,u.jsx)(m,{"data-testid":"stImageCaption",style:y,children:` ${i.caption} `})]},t)}))})]})}))},25257:(e,t,n)=>{n.d(t,{T:()=>i});const i=(0,n(50016).createContext)(null);i.displayName="ElementFullscreenContext"},18056:(e,t,n)=>{n.d(t,{A:()=>p});var i=n(50016),o=n(4134),l=n.n(o),a=n(83592);const s=(0,n(84927).A)("div",{target:"elp1w7k0"})((({theme:e,isExpanded:t})=>({...t?{position:"fixed",top:0,left:0,bottom:0,right:0,background:e.colors.bgColor,zIndex:e.zIndices.fullscreenWrapper,padding:e.spacing.md,paddingTop:e.sizes.fullScreenHeaderHeight,overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}})),"");var r=n(25257),d=n(19939),c=n(30753),h=n(15144);var m=n(90076);const u=({children:e,height:t,width:n})=>{const o=(0,a.u)(),{expanded:l,fullHeight:u,fullWidth:p,zoomIn:x,zoomOut:g}=(()=>{const{setFullScreen:e}=(0,i.useContext)(d.n),[t,n]=(0,i.useState)(!1),{fullHeight:o,fullWidth:l}=(0,h.i)(c.j),a=(0,i.useCallback)((t=>{n(t),e(t)}),[e]),s=(0,i.useCallback)((()=>{document.body.style.overflow="hidden",a(!0)}),[a]),r=(0,i.useCallback)((()=>{document.body.style.overflow="unset",a(!1)}),[a]),m=(0,i.useCallback)((e=>{27===e.keyCode&&t&&r()}),[r,t]);return(0,i.useEffect)((()=>(document.addEventListener("keydown",m,!1),()=>{document.removeEventListener("keydown",m,!1)})),[m]),(0,i.useMemo)((()=>({expanded:t,zoomIn:s,zoomOut:r,fullHeight:o,fullWidth:l})),[t,s,r,o,l])})(),f=(0,i.useMemo)((()=>({width:l?p:n,height:l?u:t,expanded:l,expand:x,collapse:g})),[l,u,p,t,n,x,g]);return(0,m.jsx)(r.T.Provider,{value:f,children:(0,m.jsx)(s,{isExpanded:l,"data-testid":"stFullScreenFrame",theme:o,children:e})})};const p=function(e){const t=t=>(0,m.jsx)(u,{width:t.width,children:(0,m.jsx)(e,{...t})});return t.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,l()(t,e)}},49694:(e,t,n)=>{n.d(t,{A:()=>p,K:()=>u});n(50016);var i=n(83592),o=n(43084),l=n(17948),a=n(72587),s=n(83774),r=n(28230),d=n(9525),c=n(20758),h=n(81975),m=n(90076);function u({label:e,show_label:t,icon:n,onClick:o}){const l=(0,i.u)(),h=t?e:"";return(0,m.jsx)("div",{"data-testid":"stElementToolbarButton",children:(0,m.jsx)(s.A,{content:(0,m.jsx)(a.Ay,{source:e,allowHTML:!1,style:{fontSize:l.fontSizes.sm}}),placement:s.W.TOP,onMouseEnterDelay:1e3,inline:!0,children:(0,m.jsxs)(r.Ay,{onClick:e=>{o&&o(),e.stopPropagation()},kind:d.KX.ELEMENT_TOOLBAR,"aria-label":e,children:[n&&(0,m.jsx)(c.A,{content:n,size:"md",testid:"stElementToolbarButtonIcon"}),h&&(0,m.jsx)("span",{children:h})]})})})}const p=({onExpand:e,onCollapse:t,isFullScreen:n,locked:i,children:a,target:s,disableFullscreenMode:r})=>(0,m.jsx)(h.Sq,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:i||n,target:s,children:(0,m.jsxs)(h.x8,{children:[a,e&&!r&&!n&&(0,m.jsx)(u,{label:"Fullscreen",icon:o.g,onClick:()=>e()}),t&&!r&&n&&(0,m.jsx)(u,{label:"Close fullscreen",icon:l.Q,onClick:()=>t()})]})})},81975:(e,t,n)=>{n.d(t,{Sq:()=>a,mx:()=>r,x8:()=>s});var i=n(84927),o=n(9320);const l="-2.4rem",a=(0,i.A)("div",{target:"e2wxzia2"})((({theme:e,locked:t,target:n})=>({padding:`${e.spacing.sm} 0 ${e.spacing.sm} ${e.spacing.sm}`,position:"absolute",top:t?l:"-1rem",right:e.spacing.none,transition:"none",...!t&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:l},...n&&{[`${n}:hover &, ${n}:active &, ${n}:focus-visible &`]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:l}}}})),""),s=(0,i.A)("div",{target:"e2wxzia1"})((({theme:e})=>({color:(0,o.iq)(e)?e.colors.fadedText60:e.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:"1px 2px 8px rgba(0, 0, 0, 0.08)",borderRadius:e.radii.default,backgroundColor:e.colors.lightenedBg05,width:"fit-content",zIndex:e.zIndices.sidebar+1})),""),r=(0,i.A)("div",{target:"e2wxzia0"})((({width:e,height:t,useContainerWidth:n})=>({position:"relative",height:n?t:"fit-content",width:n?e:"fit-content",maxWidth:"100%"})),"")},15144:(e,t,n)=>{n.d(t,{i:()=>o});var i=n(50016);const o=e=>{const t=(0,i.useContext)(e);var n;if(null===t||void 0===t)throw new Error(`useRequiredContext: ${null!==(n=e.displayName)&&void 0!==n?n:"context"} not found`);return t}},43084:(e,t,n)=>{n.d(t,{g:()=>a});var i=n(89575),o=n(50016),l=n(50088),a=o.forwardRef((function(e,t){return o.createElement(l.I,(0,i.A)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))}));a.displayName="Fullscreen"},17948:(e,t,n)=>{n.d(t,{Q:()=>a});var i=n(89575),o=n(50016),l=n(50088),a=o.forwardRef((function(e,t){return o.createElement(l.I,(0,i.A)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))}));a.displayName="FullscreenExit"}}]);