@stlite/desktop 0.90.13 → 0.90.15
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 +14 -0
- package/build/assets/{ErrorOutline.esm-CJGMKtXr.js → ErrorOutline.esm-8R3U-65K.js} +1 -1
- package/build/assets/{FileDownload.esm-DVbGfwz7.js → FileDownload.esm-BFOXuaE0.js} +1 -1
- package/build/assets/{FileHelper-BAjDG49X.js → FileHelper-CX-ki3eU.js} +1 -1
- package/build/assets/{FormClearHelper-CaLJK07N.js → FormClearHelper-CXfZggoC.js} +1 -1
- package/build/assets/{Hooks-D54IehuR.js → Hooks-rH_bDoeH.js} +1 -1
- package/build/assets/{InputInstructions-BLplNLW9.js → InputInstructions-DBvcFAZU.js} +1 -1
- package/build/assets/{Particles-VYhfVp_p.js → Particles-CC5U4uC2.js} +1 -1
- package/build/assets/{ProgressBar-DX8k7XSZ.js → ProgressBar-CUUN2Jn1.js} +1 -1
- package/build/assets/{Toolbar-BbbydoLD.js → Toolbar-CAXs2ssX.js} +1 -1
- package/build/assets/{base-input-d4WKPeU6.js → base-input-CaoUSnQs.js} +1 -1
- package/build/assets/{checkbox-DUA9ewQT.js → checkbox-C6QD2M1R.js} +1 -1
- package/build/assets/{createSuper-CoIMxZYP.js → createSuper-C2tKBwhP.js} +1 -1
- package/build/assets/{data-grid-overlay-editor-cvHWuOOd.js → data-grid-overlay-editor-B6zYg3nK.js} +1 -1
- package/build/assets/{downloader-CR6bzPv-.js → downloader-Dkst_JYU.js} +1 -1
- package/build/assets/{es6-BCBcAdQS.js → es6-COIX_UTS.js} +2 -2
- package/build/assets/{iframeResizer.contentWindow-CEqjsNrn.js → iframeResizer.contentWindow-CLXvvjGK.js} +1 -1
- package/build/assets/{index-HqlJZ3Ag.js → index-B1mnHG1O.js} +1 -1
- package/build/assets/{index-C91sP-jG.js → index-BAuLAaYe.js} +1 -1
- package/build/assets/{index-BGUuVZft.js → index-BI0ZZeqT.js} +1 -1
- package/build/assets/{index-mHvUvPYI.js → index-BKmCVz-X.js} +1 -1
- package/build/assets/{index-Bwfh73dd.js → index-BS4li24f.js} +1 -1
- package/build/assets/{index-vLb3c1eZ.js → index-BeWWu5Gh.js} +1 -1
- package/build/assets/{index-CeNNLDtJ.js → index-Bot-HFGd.js} +1 -1
- package/build/assets/{index-Bhgfj5y5.js → index-Bt2KSUC2.js} +1 -1
- package/build/assets/{index-CdAXvPf5.js → index-Bvl3bY4R.js} +1 -1
- package/build/assets/{index-PHqcnj3c.js → index-C0Q8yE7v.js} +1 -1
- package/build/assets/{index-B3GOsGpL.js → index-C12OFcIh.js} +1 -1
- package/build/assets/{index-BdVfRySM.js → index-C7nKmor1.js} +1 -1
- package/build/assets/{index-DOiS7VE9.js → index-CADKCir8.js} +1 -1
- package/build/assets/{index-CTZrIDfL.js → index-CCXHPMUB.js} +1 -1
- package/build/assets/{index-j6pFDYKO.js → index-CJikVwcT.js} +1 -1
- package/build/assets/{index-NigQ67t-.js → index-CKIZeYUq.js} +1 -1
- package/build/assets/{index-XsxWL5x-.js → index-C_m1xqoG.js} +1 -1
- package/build/assets/{index-CD0SY35r.js → index-CcI6rcYL.js} +1 -1
- package/build/assets/{index-CJWk1YT9.js → index-CqPiUIzz.js} +1 -1
- package/build/assets/{index-BRiK5gVx.js → index-CzNOzdMD.js} +1 -1
- package/build/assets/{index-BMSSeqlt.js → index-D57JlMpf.js} +1 -1
- package/build/assets/{index-D_4iXBI5.js → index-DH8imcpD.js} +1 -1
- package/build/assets/{index-VVwti7cA.js → index-DKIJUmSp.js} +1 -1
- package/build/assets/{index-wUVGuFfU.js → index-DRv0ltn2.js} +1 -1
- package/build/assets/{index-B7yzG-4X.js → index-DZKUZQ4z.js} +5 -5
- package/build/assets/{index-CIRTE79j.js → index-DpusuKed.js} +1 -1
- package/build/assets/{index-DCv3Ovf7.js → index-P8waswk0.js} +1 -1
- package/build/assets/{index-CwPp5UqK.js → index-PiPju_F7.js} +1 -1
- package/build/assets/{index-B58bWjQH.js → index-R9kIgYTc.js} +1 -1
- package/build/assets/{index-CHBxMYoz.js → index-W7pMcdM5.js} +1 -1
- package/build/assets/{index-DoQHaClc.js → index-WXxfAlRg.js} +1 -1
- package/build/assets/{index-D9P3ZYiC.js → index-gnMTbBzT.js} +1 -1
- package/build/assets/{index-wnKDraWU.js → index-k4Zz_A0O.js} +217 -212
- package/build/assets/{index-BJK2Ym_S.js → index-k4zlsY75.js} +1 -1
- package/build/assets/{index-gb2ePejP.js → index-onhde1_u.js} +1 -1
- package/build/assets/{index-Dynm-1sH.js → index-qNX4xGHy.js} +1 -1
- package/build/assets/{index-BD2ZweM9.js → index-sKFQbsJX.js} +1 -1
- package/build/assets/{inherits-xHSaJdUZ.js → inherits-CEwp2qJ3.js} +1 -1
- package/build/assets/{input-PliHooUw.js → input-F2PGHPo-.js} +1 -1
- package/build/assets/{memory-BJMhKXeY.js → memory-DrewVBU3.js} +1 -1
- package/build/assets/{number-overlay-editor-DRf5xgI3.js → number-overlay-editor-b3bkPSy4.js} +1 -1
- package/build/assets/{sandbox-DBdCCxaG.js → sandbox-NITkBzy4.js} +1 -1
- package/build/assets/{slicedToArray-Cuk3tbTR.js → slicedToArray-CyBE-4ry.js} +1 -1
- package/build/assets/{timepicker-DjzHzJAt.js → timepicker-DRJ4YL4p.js} +1 -1
- package/build/assets/{uniqueId-ikSpJ9AP.js → uniqueId-CbEiG62v.js} +1 -1
- package/build/assets/{useBasicWidgetState-raTjAqZP.js → useBasicWidgetState-CMQ4ds3J.js} +1 -1
- package/build/assets/{useTextInputAutoExpand-Uac3U0I_.js → useTextInputAutoExpand-BfLYssNQ.js} +1 -1
- package/build/assets/{useUpdateUiValue-BbEmiOZQ.js → useUpdateUiValue-B81sk7L2.js} +1 -1
- package/build/assets/{withFullScreenWrapper-C7u7nPsK.js → withFullScreenWrapper-Bc57_5Q4.js} +1 -1
- package/build/assets/{worker-CiNU4sgs.js → worker-CO569BKa.js} +4 -4
- package/build/electron/worker.js +5 -5
- package/build/index.html +1 -1
- package/package.json +4 -4
- package/wheels/streamlit-1.50.0-cp313-none-any.whl +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as f,r as i,u as w,j as e,y as m,f as v,z as r,h as z,n as R,F as j,K as L}from"./index-
|
|
1
|
+
import{s as f,r as i,u as w,j as e,y as m,f as v,z as r,h as z,n as R,F as j,K as L}from"./index-k4Zz_A0O.js";const C=f("button",{target:"elibz2u2"})(({theme:o})=>({fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,color:o.colors.fadedText60,backgroundColor:o.colors.transparent,fontFamily:"inherit",margin:o.spacing.none,border:"none",boxShadow:"none",padding:o.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:o.colors.primary}}),""),E=f("div",{target:"elibz2u1"})(({theme:o})=>({display:"flex",flexDirection:"row",gap:o.spacing.lg,"> span":{marginTop:o.spacing.twoXS}}),""),k=f("div",{target:"elibz2u0"})(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,div:{display:"inline-flex"}}),"");function B(o){const t=z(o);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:o.spacing.md,width:o.sizes.toastWidth,marginTop:o.spacing.sm,borderTopLeftRadius:o.radii.default,borderTopRightRadius:o.radii.default,borderBottomLeftRadius:o.radii.default,borderBottomRightRadius:o.radii.default,paddingTop:o.spacing.lg,paddingBottom:o.spacing.lg,paddingLeft:o.spacing.twoXL,paddingRight:o.spacing.twoXL,backgroundColor:o.colors.bgColor,filter:t?"brightness(0.98)":"brightness(1.2)",color:o.colors.bodyText,boxShadow:t?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:o.colors.fadedText40,width:o.fontSizes.lg,height:o.fontSizes.lg,marginRight:`calc(-1 * ${o.spacing.lg} / 2)`,":hover":{color:o.colors.bodyText}}}}}function H(o){if(o.length>104){let s=o.replace(/^(.{104}[^\s]*).*/,"$1");return s.length>104&&(s=s.substring(0,104).split(" ").slice(0,-1).join(" ")),s.trim()}return o}function D({element:o}){const{body:t,icon:s,duration:d}=o,n=w(),l=H(t),c=t!==l,[a,y]=i.useState(!c),[b,S]=i.useState(0),x=i.useCallback(()=>{y(!a)},[a]),g=i.useMemo(()=>B(n),[n]),p=i.useMemo(()=>e.jsxs(E,{expanded:a,children:[s&&e.jsx(m,{iconValue:s,size:"xl",testid:"stToastDynamicIcon"}),e.jsxs(k,{children:[e.jsx(v,{source:a?t:l,allowHTML:!1,isToast:!0}),c&&e.jsx(C,{"data-testid":"stToastViewButton",onClick:x,children:a?"view less":"view more"})]})]}),[c,a,t,s,l,x]);i.useEffect(()=>{if(n.inSidebar)return;const h=R(d)?d===0?0:d*1e3:4e3,u=r.info(p,{overrides:{...g},autoHideDuration:h});return S(u),()=>{r.update(u,{overrides:{Body:{style:{display:"none"}}}}),r.clear(u)}},[]),i.useEffect(()=>{r.update(b,{children:p,overrides:{...g}})},[b,p,g]);const T=e.jsx(j,{kind:L.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`.\n See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information."});return e.jsx(e.Fragment,{children:n.inSidebar&&T})}const I=i.memo(D);export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as l,r as d,L as p,u,j as a,b as x,P as f,y as k,f as b}from"./index-
|
|
1
|
+
import{s as l,r as d,L as p,u,j as a,b as x,P as f,y as k,f as b}from"./index-k4Zz_A0O.js";const L=l("div",{target:"e11k5jya2"})({name:"b6wrti",styles:"display:flex;flex-direction:column;width:100%"}),C=l("a",{target:"e11k5jya1"})(({disabled:n,isCurrentPage:e,theme:o})=>({textDecoration:"none",width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:o.spacing.sm,borderRadius:o.radii.default,paddingLeft:o.spacing.sm,paddingRight:o.spacing.sm,marginTop:o.spacing.threeXS,marginBottom:o.spacing.threeXS,lineHeight:o.lineHeights.menuItem,backgroundColor:e?o.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:e?o.colors.darkenedBgMix25:o.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:o.colors.darkenedBgMix15},"@media print":{paddingLeft:o.spacing.none},...n?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed","&:hover":{color:o.colors.fadedText40,backgroundColor:o.colors.transparent}}:{}}),""),v=l("span",{target:"e11k5jya0"})(({disabled:n,theme:e})=>({color:e.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...n?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed"}:{}}),"");function y(n){const{onPageChange:e,currentPageScriptHash:o}=d.useContext(p),{colors:s}=u(),{disabled:t,element:r}=n,i=o===r.pageScriptHash,g=c=>{r.external?t&&c.preventDefault():(c.preventDefault(),t||e(r.pageScriptHash))};return a.jsx("div",{className:"stPageLink","data-testid":"stPageLink",children:a.jsx(x,{help:r.help,placement:f.TOP_RIGHT,containerWidth:!0,children:a.jsx(L,{children:a.jsxs(C,{"data-testid":"stPageLink-NavLink",disabled:t,isCurrentPage:i,href:r.page,target:r.external?"_blank":"",rel:"noreferrer",onClick:g,children:[r.icon&&a.jsx(k,{size:"lg",color:t?s.fadedText40:s.bodyText,iconValue:r.icon}),a.jsx(v,{disabled:t,children:a.jsx(b,{source:r.label,allowHTML:!1,isLabel:!0,boldLabel:i,largerLabel:!0,disableLinks:!0})})]})})})})}const T=d.memo(y);export{T as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as H,ak as _,s as w,r as s,a4 as O,u as G,a5 as S,j as l,W as K,Q as q,T as N,P as Q}from"./index-
|
|
1
|
+
import{l as H,ak as _,s as w,r as s,a4 as O,u as G,a5 as S,j as l,W as K,Q as q,T as N,P as Q}from"./index-k4Zz_A0O.js";import{u as $}from"./uniqueId-CbEiG62v.js";import{I as J}from"./InputInstructions-DBvcFAZU.js";import{u as M}from"./useBasicWidgetState-CMQ4ds3J.js";import{u as X,a as Y,b as Z}from"./useUpdateUiValue-B81sk7L2.js";import{u as tt,T as et}from"./useTextInputAutoExpand-BfLYssNQ.js";import"./FormClearHelper-CXfZggoC.js";import"./inputUtils-CptNuJwn.js";import"./base-input-CaoUSnQs.js";const it=(e,t)=>{let a="auto";if(e.heightConfig?.useStretch)a="100%";else if(e.heightConfig?.pixelHeight&&e.heightConfig.pixelHeight>0){const o=H(t.labelVisibility?.value)===_.Collapsed?2:30;a=`${e.heightConfig.pixelHeight-o}px`}return a},at=w("div",{target:"ezh4s2r0"})({name:"kdbhus",styles:"height:100%;display:flex;flex-direction:column"}),T=(e,t)=>e.getStringValue(t)??t.default??null,st=e=>e.default??null,ot=e=>e.value??null,rt=(e,t,a,o)=>{t.setStringValue(e,a.value,{fromUi:a.fromUi},o)},lt=({disabled:e,element:t,widgetMgr:a,fragmentId:o,outerElement:d})=>{const m=s.useRef($("text_area_")).current,{width:W,elementRef:y}=O(),[r,h]=s.useState(!1),[I,x]=s.useState(!1),n=d.heightConfig?.useContent??!1,V=d.heightConfig?.useStretch??!1,v=it(d,t),b=s.useRef(null),[u,c]=s.useState(()=>T(a,t)??null),A=s.useCallback(()=>{c(t.default??null),h(!0)},[t]),[F,g]=M({getStateFromWidgetMgr:T,getDefaultStateFromProto:st,getCurrStateFromProto:ot,updateWidgetMgrState:rt,element:t,widgetMgr:a,fragmentId:o,onFormCleared:A});X(F,u,c,r);const i=G(),{height:R,maxHeight:j,updateScrollHeight:C}=tt({textareaRef:b,dependencies:[t.placeholder]}),p=s.useCallback(()=>{h(!1),g({value:u,fromUi:!0})},[u,g]),k=s.useCallback(()=>{r&&p(),x(!1)},[r,p]),z=s.useCallback(()=>{x(!0)},[]),E=s.useCallback(()=>{n&&C()},[n,C]),P=Y({formId:t.formId,maxChars:t.maxChars,setDirty:h,setUiValue:c,setValueWithSource:g,additionalAction:E}),L=Z(t.formId,p,r,a,o,!0),{placeholder:U,formId:f}=t,D=S({formId:f})?a.allowFormEnterToSubmit(f):r,B=I&&W>i.breakpoints.hideWidgetDetails;return l.jsxs(at,{className:"stTextArea","data-testid":"stTextArea",ref:y,children:[l.jsx(K,{label:t.label,disabled:e,labelVisibility:H(t.labelVisibility?.value),htmlFor:m,children:t.help&&l.jsx(q,{children:l.jsx(N,{content:t.help,placement:Q.TOP_RIGHT})})}),l.jsx(et,{inputRef:n?b:void 0,value:u??"",placeholder:U,onBlur:k,onFocus:z,onChange:P,onKeyDown:L,"aria-label":t.label,disabled:e,id:m,overrides:{Input:{style:{fontWeight:i.fontWeights.normal,lineHeight:i.lineHeights.inputWidget,height:n?R:v,maxHeight:n?j:"",minHeight:i.sizes.largestElementHeight,resize:V?"none":"vertical",paddingRight:i.spacing.md,paddingLeft:i.spacing.md,paddingBottom:i.spacing.md,paddingTop:i.spacing.md,"::placeholder":{color:i.colors.fadedText60}}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:{borderLeftWidth:i.sizes.borderWidth,borderRightWidth:i.sizes.borderWidth,borderTopWidth:i.sizes.borderWidth,borderBottomWidth:i.sizes.borderWidth,flexGrow:1}}}}),B&&l.jsx(J,{dirty:r,value:u??"",maxLength:t.maxChars,type:"multiline",inForm:S({formId:f}),allowEnterToSubmit:D})]})},xt=s.memo(lt);export{xt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,E as J,_ as W,u as G,aN as F,aO as X,k as R,aP as $,aQ as Q,aR as j,aS as L,aT as Y,aU as Z,n as I,aV as M,x as P,aW as K,aX as q,aY as ee,J as te,a4 as ne,av as se,aZ as re,j as T,a_ as ae,a$ as oe,b0 as ce}from"./index-
|
|
1
|
+
import{r as a,E as J,_ as W,u as G,aN as F,aO as X,k as R,aP as $,aQ as Q,aR as j,aS as L,aT as Y,aU as Z,n as I,aV as M,x as P,aW as K,aX as q,aY as ee,J as te,a4 as ne,av as se,aZ as re,j as T,a_ as ae,a$ as oe,b0 as ce}from"./index-k4Zz_A0O.js";import{w as ie,E as le}from"./withFullScreenWrapper-Bc57_5Q4.js";import{a as H,S as _,T as ue}from"./Toolbar-CAXs2ssX.js";import{R as fe}from"./index-DZKUZQ4z.js";import{u as de}from"./FormClearHelper-CXfZggoC.js";import"./sprintf-DpPCfzXw.js";import"./checkbox-C6QD2M1R.js";import"./createDownloadLinkElement-ZaXNnPK4.js";import"./slicedToArray-CyBE-4ry.js";import"./inherits-CEwp2qJ3.js";import"./createSuper-C2tKBwhP.js";import"./FileDownload.esm-BFOXuaE0.js";var U=a.forwardRef(function(n,t){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(J,W({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"}))});U.displayName="InsertChart";var B=a.forwardRef(function(n,t){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(J,W({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M20 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 2v3H5V5h15zm-5 14h-5v-9h5v9zM5 10h3v9H5v-9zm12 9v-9h3v9h-3z"}))});B.displayName="TableChart";const me=20;function he(n){"params"in n&&"encoding"in n&&n.params.forEach(t=>{"select"in t&&(["interval","point"].includes(t.select)&&(t.select={type:t.select}),"type"in t.select&&t.select.type==="point"&&!("encodings"in t.select)&&R(t.select.encodings)&&(t.select.encodings=Object.keys(n.encoding)))})}const pe=(n,t,r,s,u,i,l,p)=>{const e=JSON.parse(n);if(s==="streamlit"?e.config=F(e.config,i):e.usermeta?.embedOptions?.theme==="streamlit"?(e.config=F(e.config,i),e.usermeta.embedOptions.theme=void 0):e.config=X(e.config,i),e.title&&(typeof e.title=="string"&&(e.title={text:e.title}),e.title.limit=e.title.limit??Math.max(l-40,0)),r&&(e.height=p),t&&(e.width=l,"vconcat"in e&&e.vconcat.forEach(d=>{d.width=l})),e.padding||(e.padding={}),R(e.padding.bottom)&&(e.padding.bottom=me),e.datasets)throw new Error("Datasets should not be passed as part of the spec");return u.length>0&&he(e),e},ge=(n,t,r,s,u)=>{const i=G(),{id:l,formId:p,spec:e,data:d,datasets:o,vegaLiteTheme:f,selectionMode:c}=n,g=a.useMemo(()=>c,[JSON.stringify(c)]),w=a.useMemo(()=>pe(e,s,u,f,g,i,t,r),[e,s,u,f,g,i,t,r]);return{id:l,formId:p,vegaLiteTheme:f,spec:w,selectionMode:g,data:d,datasets:o,useContainerWidth:s}},Se={DATAFRAME_INDEX:"(index)"};function ye(n){return!n||n.dimensions.numDataRows===0?null:A(n)}function we(n){const t=D(n);if(R(t))return null;const r={};for(const[s,u]of Object.entries(t))r[s]=A(u);return r}function D(n){if(n?.length===0)return null;const t={};return n.forEach(r=>{if(!r)return;const s=r.hasName?r.name:null;t[s]=r.data}),t}function A(n,t=0){if(n.dimensions.numDataRows===0)return[];const r=[],{numDataRows:s,numDataColumns:u,numIndexColumns:i}=n.dimensions,l=n.columnTypes[0]??void 0,p=l&&l.type===$.INDEX&&(Q(l)||j(l)||L(l));for(let e=t;e<s;e++){const d={};if(p){const{content:o}=n.getCell(e,0);d[Se.DATAFRAME_INDEX]=typeof o=="bigint"?Number(o):o}for(let o=0;o<u;o++){const f=o+i,{content:c,contentType:g}=n.getCell(e,f);if((c instanceof Date||typeof c=="number"&&Number.isFinite(c))&&(j(g)||L(g))&&!Y(g)){const w=new Date(c).getTimezoneOffset()*60*1e3;d[n.columnNames[0][f]]=c.valueOf()+w}else d[n.columnNames[0][f]]=typeof c=="bigint"?Number(c):c}r.push(d)}return r}const be=150,Ce=P.getLogger("useVegaLiteSelections"),Ee=(n,t,r)=>{const{id:s,formId:u,selectionMode:i}=n,l=a.useCallback(e=>{i.forEach(o=>{e.addSignalListener(o,Z(be,(f,c)=>{const g=e.getState({data:(S,y)=>i.some(E=>`${E}_store`===S),recurse:!1});I(g)&&t.setElementState(s,"viewState",g);let w=c;"vlPoint"in c&&"or"in c.vlPoint&&(w=c.vlPoint.or);const O={id:s,formId:u},h=JSON.parse(t.getStringValue(O)||"{}"),m={selection:{...h?.selection||{},[f]:w||{}}};M(h,m)||t.setStringValue(O,JSON.stringify(m),{fromUi:!0},r)}))});const d=t.getElementState(s,"viewState");if(I(d))try{return e.setState(d)}catch(o){Ce.warn("Failed to restore view state",o)}return e},[s,i,t,u,r]),p=a.useCallback(()=>{const e={selection:{}};i.forEach(c=>{e.selection[c]={}});const d={id:s,formId:u},o=t.getStringValue(d),f=o?JSON.parse(o):e;M(f,e)||t.setStringValue(d,JSON.stringify(e),{fromUi:!0},r)},[s,u,r,i,t]);return{maybeConfigureSelections:l,onFormCleared:p}},k="source",Ve=P.getLogger("useVegaEmbed");function ve(n,t,r){const s=a.useRef(null),u=a.useRef(null),i=a.useRef(k),l=a.useRef(null),p=a.useRef([]),{maybeConfigureSelections:e,onFormCleared:d}=Ee(n,t,r);de({widgetMgr:t,element:n,onFormCleared:d});const{data:o,datasets:f}=n;a.useEffect(()=>{s.current===null&&(l.current=o,p.current=f)},[o,f]);const c=a.useCallback(()=>{u.current&&u.current(),u.current=null,s.current=null},[]),g=a.useCallback(async(h,m)=>{if(h.current===null)throw new Error("Element missing.");c();const S={ast:!0,expr:q,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:y,view:E,finalize:x}=await K(h.current,m,S);s.current=e(E),u.current=x;const b=we(p.current),V=b?Object.keys(b):[];if(V.length===1){const[C]=V;i.current=C}else V.length===0&&y.data&&(i.current=k);const v=ye(l.current);if(v&&s.current.insert(i.current,v),b)for(const[C,N]of Object.entries(b))s.current.insert(C,N);return await s.current.runAsync(),await s.current.resize().runAsync(),s.current},[c,e]),w=a.useCallback((h,m,S,y)=>{if(!y||y.dimensions.numDataRows===0){try{h.remove(m,ee)}finally{}return}if(!S||S.dimensions.numDataRows===0){h.insert(m,A(y));return}y.hash!==S.hash&&(h.data(m,A(y)),Ve.info(`Had to clear the ${m} dataset before inserting data through Vega view.`))},[]),O=a.useCallback(async(h,m)=>{if(s.current===null)return null;const S=l.current,y=p.current;(S||h)&&w(s.current,i.current,S,h);const E=D(y)??{},x=D(m)??{};for(const[b,V]of Object.entries(x)){const v=b||i.current,C=E[v];w(s.current,v,C,V)}for(const b of Object.keys(E))!Object.hasOwn(x,b)&&b!==i.current&&w(s.current,b,null,null);return await s.current?.resize().runAsync(),l.current=h,p.current=m,s.current},[w]);return{createView:g,updateView:O,finalizeView:c}}function xe(n){try{const t=typeof n=="string"?JSON.parse(n):n;return!!(t.facet||t.encoding?.row||t.encoding?.column||t.encoding?.facet)}catch{return!1}}const Ne=({disableFullscreenMode:n,element:t,fragmentId:r,widgetMgr:s,widthConfig:u,heightConfig:i})=>{const[l,p]=a.useState(!1),[e,d]=a.useState(!1),{expanded:o,height:f,width:c,expand:g,collapse:w}=te(le),{width:O,height:h,elementRef:m}=ne([l],0),S=se(u)||t.useContainerWidth,y=re(i),E=xe(t.spec),x=ge(t,E?c??0:O,(o?f:h)??0,o?!0:S,o?!0:y),{createView:b,updateView:V,finalizeView:v}=ve(x,s,r),{data:C,datasets:N,spec:z}=x;return a.useLayoutEffect(()=>(m.current!==null&&b(m,z),v),[b,v,z,c,f,l,m]),a.useEffect(()=>{V(C,N)},[C,N,V]),a.useEffect(()=>{C||N?.[0]?.data?d(!0):d(!1)},[C,N]),l?T.jsx(fe,{data:C??N[0]?.data,height:f??h??void 0,customToolbarActions:[T.jsx(H,{label:"Show chart",icon:U,onClick:()=>{p(!1)}},"show-chart")]}):T.jsxs(_,{height:y?o?f:"100%":f,useContainerWidth:o?!0:S,children:[T.jsx(ue,{target:_,isFullScreen:o,onExpand:g,onCollapse:w,disableFullscreenMode:n,children:e&&T.jsx(H,{label:"Show data",icon:B,onClick:()=>{p(!0)}})}),T.jsx(ae,{styles:oe}),T.jsx(ce,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:S,useContainerHeight:y,ref:m})]})},Te=ie(Ne),ke=a.memo(Te);export{oe as StyledVegaLiteChartTooltips,F as applyStreamlitTheme,ke as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as m,$ as l,r as i,j as o,aq as p}from"./index-
|
|
1
|
+
import{s as m,$ as l,r as i,j as o,aq as p}from"./index-k4Zz_A0O.js";import{R as d,P as f}from"./Particles-CC5U4uC2.js";const g="/assets/flake-0.DgWaVvm5.png",x="/assets/flake-1.B2r5AHMK.png",E="/assets/flake-2.BnWSExPC.png",e=150,r=150,S=10,_=90,u=4e3,a=(t,n=0)=>Math.random()*(t-n)+n,A=()=>l`
|
|
2
2
|
from {
|
|
3
3
|
transform:
|
|
4
4
|
translateY(0)
|