streamlit-nightly 1.42.1.dev20250216__py2.py3-none-any.whl → 1.42.2.dev20250218__py2.py3-none-any.whl

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.
Files changed (111) hide show
  1. streamlit/elements/bokeh_chart.py +5 -4
  2. streamlit/elements/graphviz_chart.py +2 -3
  3. streamlit/elements/lib/column_types.py +97 -44
  4. streamlit/elements/lib/subtitle_utils.py +2 -2
  5. streamlit/elements/lib/utils.py +1 -2
  6. streamlit/elements/vega_charts.py +2 -5
  7. streamlit/runtime/caching/cache_utils.py +2 -3
  8. streamlit/runtime/caching/hashing.py +1 -2
  9. streamlit/runtime/forward_msg_cache.py +1 -5
  10. streamlit/runtime/fragment.py +3 -5
  11. streamlit/runtime/memory_media_file_storage.py +1 -2
  12. streamlit/static/index.html +1 -1
  13. streamlit/static/static/js/{FileDownload.esm.K0RIIaSL.js → FileDownload.esm.DU-1rCSB.js} +1 -1
  14. streamlit/static/static/js/{FileDropzone.DRcTUuNN.js → FileDropzone.BI3MGDdT.js} +1 -1
  15. streamlit/static/static/js/{FormClearHelper.Dha_cfuU.js → FormClearHelper.DzU-mNjk.js} +1 -1
  16. streamlit/static/static/js/{Hooks.BrulV197.js → Hooks.qUbVZL-A.js} +1 -1
  17. streamlit/static/static/js/{InputInstructions.C_m6JNSV.js → InputInstructions.CpNPMMpX.js} +1 -1
  18. streamlit/static/static/js/{ProgressBar.CXgDz0lS.js → ProgressBar.4yIafGOA.js} +2 -2
  19. streamlit/static/static/js/{RenderInPortalIfExists.DbjYtj_E.js → RenderInPortalIfExists.31NYBozH.js} +1 -1
  20. streamlit/static/static/js/{Toolbar.B5RomQbU.js → Toolbar.lnT7wtEH.js} +1 -1
  21. streamlit/static/static/js/{base-input.B_U9Mij-.js → base-input.DYDwDBVN.js} +4 -4
  22. streamlit/static/static/js/{createSuper.DiPn7x2M.js → createSuper.CP_bqXkl.js} +1 -1
  23. streamlit/static/static/js/{data-grid-overlay-editor.CxpMznuV.js → data-grid-overlay-editor.Bw6S-08j.js} +1 -1
  24. streamlit/static/static/js/{downloader.CMxfwi0g.js → downloader.DZpOwdni.js} +1 -1
  25. streamlit/static/static/js/{es6.CWDfc2yc.js → es6.D670kkuw.js} +2 -2
  26. streamlit/static/static/js/{iframeResizer.contentWindow.CyCMpBzy.js → iframeResizer.contentWindow.CBWvp4oS.js} +1 -1
  27. streamlit/static/static/js/{index.CLXysuIS.js → index.-wGNsvT9.js} +1 -1
  28. streamlit/static/static/js/{index.CmyE8x29.js → index.0jzSLI-x.js} +2 -2
  29. streamlit/static/static/js/index.8M0nMTyK.js +1 -0
  30. streamlit/static/static/js/index.B-Bz2NGO.js +1 -0
  31. streamlit/static/static/js/index.B6KnC7nW.js +1 -0
  32. streamlit/static/static/js/index.B9mk7o4G.js +3 -0
  33. streamlit/static/static/js/index.BCorV1AX.js +1 -0
  34. streamlit/static/static/js/index.BMlBBPxY.js +9 -0
  35. streamlit/static/static/js/index.BhTUDBBK.js +1 -0
  36. streamlit/static/static/js/index.Bif_gpeX.js +1 -0
  37. streamlit/static/static/js/index.BkURA4Nq.js +3 -0
  38. streamlit/static/static/js/index.Byj6qntv.js +2 -0
  39. streamlit/static/static/js/index.C0O8ISw8.js +1 -0
  40. streamlit/static/static/js/index.C5VAa8DZ.js +1 -0
  41. streamlit/static/static/js/{index.FVzOj77v.js → index.CA6bEd5D.js} +10 -10
  42. streamlit/static/static/js/{index.XB-MiuZp.js → index.CD53GuKN.js} +1 -1
  43. streamlit/static/static/js/index.CKT6gwZG.js +2 -0
  44. streamlit/static/static/js/{index.DeuQX1T6.js → index.CLsHMaqe.js} +17 -17
  45. streamlit/static/static/js/index.Ch1c3KR1.js +1 -0
  46. streamlit/static/static/js/{index.CnzapoES.js → index.ChIZFRw0.js} +1 -1
  47. streamlit/static/static/js/{index.68LnD3a5.js → index.CrYKK91g.js} +63 -63
  48. streamlit/static/static/js/index.Cvgj5_qB.js +1 -0
  49. streamlit/static/static/js/{index.Ctuil2Zq.js → index.D3VdaBwP.js} +1 -1
  50. streamlit/static/static/js/{index.BW9gD4O1.js → index.D6UL3iMZ.js} +82 -82
  51. streamlit/static/static/js/index.D8aCPmhr.js +1 -0
  52. streamlit/static/static/js/{index.B7-ka68B.js → index.DHBu5iL6.js} +2 -2
  53. streamlit/static/static/js/index.DJF89pFO.js +1 -0
  54. streamlit/static/static/js/{index.CxT-55oh.js → index.DNEGP5ih.js} +1 -1
  55. streamlit/static/static/js/index.DRJutLeV.js +1 -0
  56. streamlit/static/static/js/{index.CZjrVNQ3.js → index.DS38XxzV.js} +1 -1
  57. streamlit/static/static/js/index.DdeHhk74.js +1 -0
  58. streamlit/static/static/js/index.De5HitMn.js +1 -0
  59. streamlit/static/static/js/index.DsvnAu-2.js +1 -0
  60. streamlit/static/static/js/index.Du4f6P1i.js +1 -0
  61. streamlit/static/static/js/index.HCbHLWBq.js +1 -0
  62. streamlit/static/static/js/index.XAUdgEdp.js +1 -0
  63. streamlit/static/static/js/{index.vyj1usur.js → index.edlGQJ3v.js} +28 -28
  64. streamlit/static/static/js/{input.D-b9-dhW.js → input.e-37_Dj1.js} +1 -1
  65. streamlit/static/static/js/{memory.C27_0JRm.js → memory.B5p-2jga.js} +1 -1
  66. streamlit/static/static/js/{mergeWith.D8F46YVj.js → mergeWith.D8nk5iJa.js} +1 -1
  67. streamlit/static/static/js/{number-overlay-editor.CaHpEyvW.js → number-overlay-editor.DLD5-9zx.js} +1 -1
  68. streamlit/static/static/js/{possibleConstructorReturn.CnSJ4CFa.js → possibleConstructorReturn.eeV6HB6T.js} +1 -1
  69. streamlit/static/static/js/{sandbox.Cx5mAMmC.js → sandbox.ChKquq8J.js} +1 -1
  70. streamlit/static/static/js/{textarea.YeGMY3Ts.js → textarea.ZI_0MUsX.js} +1 -1
  71. streamlit/static/static/js/{timepicker.BSApuR_7.js → timepicker.C8N66VUc.js} +1 -1
  72. streamlit/static/static/js/{toConsumableArray.DFJurSxu.js → toConsumableArray.DKg00cRh.js} +1 -1
  73. streamlit/static/static/js/{uniqueId.B4ugkryR.js → uniqueId.fc9w8X88.js} +1 -1
  74. streamlit/static/static/js/{useBasicWidgetState.e9cw5rKa.js → useBasicWidgetState.CySX_BlM.js} +1 -1
  75. streamlit/static/static/js/{useOnInputChange.CHDPgswc.js → useOnInputChange.BF6Trlh5.js} +1 -1
  76. streamlit/static/static/js/withFullScreenWrapper.x2WsM7iA.js +1 -0
  77. streamlit/testing/v1/app_test.py +2 -4
  78. streamlit/util.py +6 -9
  79. streamlit/watcher/util.py +2 -7
  80. streamlit/web/server/app_static_file_handler.py +17 -1
  81. {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/METADATA +1 -1
  82. {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/RECORD +86 -86
  83. streamlit/static/static/js/index.11KmKkMp.js +0 -1
  84. streamlit/static/static/js/index.B5QCo4O8.js +0 -1
  85. streamlit/static/static/js/index.B9xlEQvM.js +0 -3
  86. streamlit/static/static/js/index.Bb_vborY.js +0 -1
  87. streamlit/static/static/js/index.BoLiyuG0.js +0 -1
  88. streamlit/static/static/js/index.CBswNuTs.js +0 -1
  89. streamlit/static/static/js/index.CGHmjGTj.js +0 -1
  90. streamlit/static/static/js/index.CMM3vxd_.js +0 -1
  91. streamlit/static/static/js/index.CTrIDSw5.js +0 -1
  92. streamlit/static/static/js/index.CrDkQv4h.js +0 -1
  93. streamlit/static/static/js/index.CxX3WJZV.js +0 -9
  94. streamlit/static/static/js/index.D4y-ZpWF.js +0 -3
  95. streamlit/static/static/js/index.DUqWz4q7.js +0 -1
  96. streamlit/static/static/js/index.DaR46enR.js +0 -1
  97. streamlit/static/static/js/index.DcCioSks.js +0 -2
  98. streamlit/static/static/js/index.Di8ddb5O.js +0 -1
  99. streamlit/static/static/js/index.Djk5RccG.js +0 -1
  100. streamlit/static/static/js/index.DsPUu3xS.js +0 -2
  101. streamlit/static/static/js/index.FjL8doTL.js +0 -1
  102. streamlit/static/static/js/index.OiKVkRzb.js +0 -1
  103. streamlit/static/static/js/index.YBzhCbWe.js +0 -1
  104. streamlit/static/static/js/index.ZlPieA63.js +0 -1
  105. streamlit/static/static/js/index.eP8uJaty.js +0 -1
  106. streamlit/static/static/js/index.fz6QTJde.js +0 -1
  107. streamlit/static/static/js/withFullScreenWrapper.BKBYrOn-.js +0 -1
  108. {streamlit_nightly-1.42.1.dev20250216.data → streamlit_nightly-1.42.2.dev20250218.data}/scripts/streamlit.cmd +0 -0
  109. {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/WHEEL +0 -0
  110. {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/entry_points.txt +0 -0
  111. {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
1
+ import{r as s,E as N,_ as $,n as g,D as ht,y as q,j as n,b7 as J,bs as ft,C as w,bn as Q,b2 as Z,bm as U,aY as mt,bD as yt,bh as Ct,bE as b,bq as vt,F as tt,be as bt,bF as It,K as B,bj as xt,bi as wt}from"./index.CLsHMaqe.js";import{g as St,F as Ft,C as Et,I as zt,E as Ut,u as Ht,a as Tt}from"./FileDropzone.BI3MGDdT.js";import{I as Dt}from"./InputInstructions.CpNPMMpX.js";import{i as kt}from"./inputUtils.CQWz5UKz.js";import{a as j}from"./index.DW_MHI2K.js";import{U as V}from"./UploadFileInfo.C-jY39rj.js";import{T as Bt}from"./textarea.ZI_0MUsX.js";import"./base-input.DYDwDBVN.js";var et=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(N,$({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.createElement("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5a2.5 2.5 0 015 0v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5a2.5 2.5 0 005 0V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"}))});et.displayName="AttachFile";var ot=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(N,$({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});ot.displayName="ErrorOutline";var nt=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(N,$({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("rect",{width:24,height:24,fill:"none"}),s.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});nt.displayName="Send";const Rt=g("div",{target:"e126hk1x0"})("border:none;position:relative;display:flex;"),Lt=g("div",{target:"e126hk1x1"})(({theme:t,extended:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.widgetBorderColor??t.colors.transparent,borderRadius:t.radii.chatInput,backgroundColor:t.colors.widgetBackgroundColor??t.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,maxHeight:e?"none":t.sizes.minElementHeight,gap:t.spacing.sm,overflow:"hidden",":focus-within":{borderColor:t.colors.primary}})),Mt=g("button",{target:"e126hk1x2"})(({theme:t,disabled:e,extended:l})=>{const d=ht(t),[c,h]=d?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:l?"0":t.radii.chatInput,borderTopLeftRadius:l?t.radii.default:"0",borderBottomRightRadius:t.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:e?c:h,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:d?t.colors.gray10:t.colors.gray90},"&:hover":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray}}}),Vt=g("div",{target:"e126hk1x3"})(({theme:t})=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,marginBottom:`-${t.sizes.borderWidth}`,pointerEvents:"none"})),Nt=g("div",{target:"e126hk1x4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),$t=g("div",{target:"e1hhpaco0"})(({theme:t,height:e})=>({backgroundColor:t.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${t.sizes.emptyDropdownHeight}, ${e})`,width:"100%",zIndex:t.zIndices.priority})),At=g("div",{target:"e1hhpaco1"})(({theme:t,height:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.primary,borderRadius:t.radii.chatInput,backgroundColor:t.colors.widgetBackgroundColor??t.colors.secondaryBg,color:t.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",height:e,width:"100%",fontWeight:t.fontWeights.bold})),Wt=g("div",{target:"e1hhpaco2"})(({theme:t})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${t.sizes.borderWidth}`})),Pt=g("div",{target:"e1hhpaco3"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20})),Kt=g("div",{target:"e1hhpaco4"})(({theme:t})=>({left:0,right:0,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"})),Ot=g("div",{target:"e1hhpaco5"})(({})=>({display:"flex"})),_t=g("div",{target:"e1hhpaco6"})(({})=>({flex:"0 0 auto"})),Xt=g("div",{target:"e1hhpaco7"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS})),Gt=g("div",{target:"e1hhpaco8"})(({theme:t})=>({color:t.colors.fadedText60})),Yt=g("div",{target:"e1hhpaco9"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60})),jt=g("div",{target:"e1hhpaco10"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60})),qt=g("small",{target:"e1hhpaco11"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}));function Jt({children:t,content:e}){const l=q();return n(ft,{content:e,placement:J.TOP,overrides:{Body:{style:{top:`-${l.sizes.minElementHeight}`}}},children:t})}const Qt=({fileInfo:t})=>{const{type:e}=t.status;switch(e){case"uploading":return n(yt,{usingCustomTheme:!1,"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return n(Jt,{content:t.status.errorMessage,children:n(U,{content:ot,size:"lg"})});case"uploaded":return n(U,{content:zt,size:"lg"});default:return mt(e),null}},Zt=({fileInfo:t,onDelete:e})=>w(Xt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[n(Gt,{children:n(Qt,{fileInfo:t})}),n(Yt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),n(jt,{children:St(t.size,Ft.Byte)}),n(qt,{"data-testid":"stChatInputDeleteBtn",children:n(Q,{onClick:()=>e(t.id),kind:Z.MINIMAL,children:n(U,{content:Et,size:"lg"})})})]}),te=({items:t,onDelete:e})=>n(Kt,{"data-testid":"stChatUploadedFiles",children:n(Ot,{children:t.map(l=>n(_t,{children:n(Zt,{fileInfo:l,onDelete:e})},l.id))})}),ee=({getNextLocalFileId:t,addFiles:e,updateFile:l,uploadClient:d,element:c,onUploadProgress:h,onUploadComplete:S})=>(f,y)=>{const m=j.CancelToken.source(),p=new V(y.name,y.size,t(),{type:"uploading",cancelToken:m,progress:1});e([p]),d.uploadFile({formId:"",...c},f.uploadUrl,y,u=>h(u,p.id),m.token).then(()=>S(p.id,f)).catch(u=>{j.isCancel(u)||l(p.id,p.setStatus({type:"error",errorMessage:u?u.toString():"Unknown error"}))})},oe=({acceptMultipleFiles:t,uploadClient:e,uploadFile:l,addFiles:d,getNextLocalFileId:c,deleteExistingFiles:h,onUploadComplete:S})=>(f,y)=>{if(!t&&f.length===0&&y.length>1){const m=y.findIndex(p=>{var u;return((u=p.errors)==null?void 0:u[0].code)===Ut.TooManyFiles});m>=0&&(f.push(y[m].file),y.splice(m,1))}if(!t&&f.length>0&&h(),e.fetchFileURLs(f).then(m=>{Ct(m,f).forEach(([p,u])=>{l(p,u)})}).catch(m=>{d(f.map(p=>new V(p.name,p.size,c(),{type:"error",errorMessage:m})))}),y.length>0){const m=y.map(p=>new V(p.file.name,p.file.size,c(),{type:"error",errorMessage:p.errors.map(u=>u.message).filter(u=>!!u).join(", ")}));d(m)}S()},ne=({getRootProps:t,getInputProps:e,acceptFile:l,disabled:d,theme:c})=>w(Wt,{children:[w("div",{"data-testid":"stChatInputFileUploadButton",...t(),children:[n("input",{...e()}),n(vt,{content:`Upload or drag and drop ${l===b.Multiple?"files":"a file"}`,placement:J.TOP,onMouseEnterDelay:500,children:n(Q,{kind:Z.MINIMAL,disabled:d,children:n(U,{content:et,size:"lg",color:c.colors.fadedText60})})})]}),n(Pt,{})]}),ae=({getRootProps:t,getInputProps:e,acceptFile:l,inputHeight:d})=>w(tt,{children:[n($t,{height:d,...t(),children:n("input",{...e()})}),n(At,{height:d,children:`Drag and drop ${l===b.Multiple?"files":"a file"} here`})]}),re=6.5,R=1,L=(t,e,l)=>l.map(d=>d.id===t?e:d),M=(t,e)=>e.find(l=>l.id===t);function ie({element:t,widgetMgr:e,fragmentId:l,uploadClient:d}){const c=q(),h=s.useRef(null),S=s.useRef(0),f=s.useRef({minHeight:0,maxHeight:0}),{values:[y],elementRef:m}=bt(s.useMemo(()=>["width"],[])),[p,u]=s.useState(!1),[F,T]=s.useState(t.default),[E,A]=s.useState(0),[H,at]=s.useState(!1),[I,x]=s.useState([]),[z,D]=s.useState(!1),v=It(t.acceptFile),W=s.useCallback(o=>x(a=>[...a,...o]),[]),P=s.useCallback(o=>{x(a=>{const i=M(o,a);return B(i)?a:(i.status.type==="uploading"&&i.status.cancelToken.cancel(),i.status.type==="uploaded"&&i.status.fileUrls.deleteUrl&&d.deleteFile(i.status.fileUrls.deleteUrl),a.filter(r=>r.id!==o))})},[d]),rt=()=>{const o=I.filter(a=>a.status.type==="uploaded").map(a=>{const{name:i,size:r,status:C}=a,{fileId:ut,fileUrls:gt}=C;return new xt({fileId:ut,fileUrls:gt,name:i,size:r})});return new wt({uploadedFileInfo:o})},K=()=>S.current++,it=oe({acceptMultipleFiles:v===b.Multiple,uploadClient:d,uploadFile:ee({getNextLocalFileId:K,addFiles:W,updateFile:(o,a)=>{x(i=>L(o,a,i))},uploadClient:d,element:t,onUploadProgress:(o,a)=>{x(i=>{const r=M(a,i);if(B(r)||r.status.type!=="uploading")return i;const C=Math.round(o.loaded*100/o.total);return r.status.progress===C?i:L(a,r.setStatus({type:"uploading",cancelToken:r.status.cancelToken,progress:C}),i)})},onUploadComplete:(o,a)=>{x(i=>{const r=M(o,i);return B(r)||r.status.type!=="uploading"?i:L(r.id,r.setStatus({type:"uploaded",fileId:a.fileId,fileUrls:a}),i)})}}),addFiles:W,getNextLocalFileId:K,deleteExistingFiles:()=>I.forEach(o=>P(o.id)),onUploadComplete:()=>{h.current&&h.current.focus()}}),{getRootProps:O,getInputProps:_}=Ht({onDrop:it,multiple:v===b.Multiple,accept:Tt(t.fileType)}),st=()=>{let o=0;const{current:a}=h;if(a){const i=a.placeholder;a.placeholder="",a.style.height="auto",o=a.scrollHeight,a.placeholder=i,a.style.height=""}return o},X=()=>{if(h.current&&h.current.focus(),!p||t.disabled)return;const o={data:F,fileUploaderState:rt()};e.setChatInputValue(t,o,{fromUi:!0},l),u(!1),x([]),T(""),A(0)},lt=o=>{const{metaKey:a,ctrlKey:i,shiftKey:r}=o;kt(o)&&!r&&!i&&!a&&(o.preventDefault(),X())},dt=o=>{const{value:a}=o.target,{maxChars:i}=t;i!==0&&a.length>i||(T(a),A(st()))};s.useEffect(()=>I.some(o=>o.status.type==="uploading")?u(!1):u(F!==""||I.length>0),[I,F]),s.useEffect(()=>{if(t.setValue){t.setValue=!1;const o=t.value||"";T(o)}},[t]),s.useEffect(()=>{if(h.current){const{offsetHeight:o}=h.current;f.current.minHeight=o,f.current.maxHeight=o*re}},[h]),s.useEffect(()=>{const o=r=>{var C;r.preventDefault(),r.stopPropagation(),!z&&((C=r.dataTransfer)!=null&&C.types.includes("Files"))&&D(!0)},a=r=>{r.preventDefault(),r.stopPropagation(),z&&(r.clientX<=0&&r.clientY<=0||r.clientX>=window.innerWidth&&r.clientY>=window.innerHeight)&&D(!1)},i=r=>{r.preventDefault(),r.stopPropagation(),z&&D(!1)};return window.addEventListener("dragover",o),window.addEventListener("drop",i),window.addEventListener("dragleave",a),()=>{window.removeEventListener("dragover",o),window.removeEventListener("drop",i),window.removeEventListener("dragleave",a)}},[z]),s.useEffect(()=>{const{minHeight:o}=f.current;at(E>0&&h.current?Math.abs(E-o)>R:!1)},[E]);const{disabled:k,placeholder:G,maxChars:ct}=t,{maxHeight:Y}=f.current,pt=v!==b.None&&z;return w(tt,{children:[v===b.None?null:n(te,{items:[...I],onDelete:P}),n(Rt,{className:"stChatInput","data-testid":"stChatInput",ref:m,children:pt?n(ae,{getRootProps:O,getInputProps:_,acceptFile:v,inputHeight:H?`${E+R}px`:c.sizes.minElementHeight}):w(Lt,{extended:H,children:[v===b.None?null:n(ne,{getRootProps:O,getInputProps:_,acceptFile:v,disabled:k,theme:c}),n(Bt,{inputRef:h,value:F,placeholder:G,onChange:dt,onKeyDown:lt,"aria-label":G,disabled:k,rows:1,overrides:{Root:{style:{minHeight:c.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:c.lineHeights.inputWidget,"::placeholder":{opacity:"0.7"},height:H?`${E+R}px`:"auto",maxHeight:Y?`${Y}px`:"none",paddingLeft:c.spacing.none,paddingBottom:c.spacing.sm,paddingTop:c.spacing.sm,paddingRight:`calc(${c.iconSizes.xl} + 2 * ${c.spacing.sm} + ${c.spacing.sm})`}}}}),y>c.breakpoints.hideWidgetDetails&&n(Nt,{children:n(Dt,{dirty:p,value:F,maxLength:ct,type:"chat",inForm:!1})}),n(Vt,{children:n(Mt,{onClick:X,disabled:!p||k,extended:H,"data-testid":"stChatInputSubmitButton",children:n(U,{content:nt,size:"xl",color:"inherit"})})})]})})]})}const fe=s.memo(ie);export{fe as default};
@@ -1,4 +1,4 @@
1
- import{r as reactExports,j as jsx}from"./index.DeuQX1T6.js";/*!
1
+ import{r as reactExports,j as jsx}from"./index.CLsHMaqe.js";/*!
2
2
  * Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors
3
3
  * All rights reserved.
4
4
  *