streamlit-nightly 1.42.2.dev20250217__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.
- streamlit/elements/bokeh_chart.py +3 -1
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.NwWY1bYI.js → FileDownload.esm.DU-1rCSB.js} +1 -1
- streamlit/static/static/js/{FileDropzone.CZxPg3X2.js → FileDropzone.BI3MGDdT.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.Doa6Lh7Q.js → FormClearHelper.DzU-mNjk.js} +1 -1
- streamlit/static/static/js/{Hooks.CxtftrJy.js → Hooks.qUbVZL-A.js} +1 -1
- streamlit/static/static/js/{InputInstructions.CWLH2hJc.js → InputInstructions.CpNPMMpX.js} +1 -1
- streamlit/static/static/js/{ProgressBar.WE22u_Ob.js → ProgressBar.4yIafGOA.js} +2 -2
- streamlit/static/static/js/{RenderInPortalIfExists.BUcod3KW.js → RenderInPortalIfExists.31NYBozH.js} +1 -1
- streamlit/static/static/js/{Toolbar.C714dqzb.js → Toolbar.lnT7wtEH.js} +1 -1
- streamlit/static/static/js/{base-input.C0t7SpL6.js → base-input.DYDwDBVN.js} +4 -4
- streamlit/static/static/js/{createSuper.ViswZ8TH.js → createSuper.CP_bqXkl.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.BhPr4kO6.js → data-grid-overlay-editor.Bw6S-08j.js} +1 -1
- streamlit/static/static/js/{downloader.91Q7jIso.js → downloader.DZpOwdni.js} +1 -1
- streamlit/static/static/js/{es6.DNX_sNKu.js → es6.D670kkuw.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.CDWUcDmU.js → iframeResizer.contentWindow.CBWvp4oS.js} +1 -1
- streamlit/static/static/js/{index.BOAkIKUg.js → index.-wGNsvT9.js} +1 -1
- streamlit/static/static/js/{index.DxXPukev.js → index.0jzSLI-x.js} +2 -2
- streamlit/static/static/js/index.8M0nMTyK.js +1 -0
- streamlit/static/static/js/index.B-Bz2NGO.js +1 -0
- streamlit/static/static/js/index.B6KnC7nW.js +1 -0
- streamlit/static/static/js/index.B9mk7o4G.js +3 -0
- streamlit/static/static/js/index.BCorV1AX.js +1 -0
- streamlit/static/static/js/index.BMlBBPxY.js +9 -0
- streamlit/static/static/js/index.BhTUDBBK.js +1 -0
- streamlit/static/static/js/index.Bif_gpeX.js +1 -0
- streamlit/static/static/js/index.BkURA4Nq.js +3 -0
- streamlit/static/static/js/index.Byj6qntv.js +2 -0
- streamlit/static/static/js/index.C0O8ISw8.js +1 -0
- streamlit/static/static/js/index.C5VAa8DZ.js +1 -0
- streamlit/static/static/js/{index.BLBTL57W.js → index.CA6bEd5D.js} +10 -10
- streamlit/static/static/js/{index.mQsqDFei.js → index.CD53GuKN.js} +1 -1
- streamlit/static/static/js/index.CKT6gwZG.js +2 -0
- streamlit/static/static/js/{index.bLZVjplR.js → index.CLsHMaqe.js} +17 -17
- streamlit/static/static/js/index.Ch1c3KR1.js +1 -0
- streamlit/static/static/js/{index.DZlSz8lf.js → index.ChIZFRw0.js} +1 -1
- streamlit/static/static/js/{index.wclN5y6j.js → index.CrYKK91g.js} +63 -63
- streamlit/static/static/js/index.Cvgj5_qB.js +1 -0
- streamlit/static/static/js/{index.CPeAZG1R.js → index.D3VdaBwP.js} +1 -1
- streamlit/static/static/js/{index.CCj1lvY2.js → index.D6UL3iMZ.js} +82 -82
- streamlit/static/static/js/index.D8aCPmhr.js +1 -0
- streamlit/static/static/js/{index.BJ2gQSjT.js → index.DHBu5iL6.js} +2 -2
- streamlit/static/static/js/index.DJF89pFO.js +1 -0
- streamlit/static/static/js/{index.ChTsHUaC.js → index.DNEGP5ih.js} +1 -1
- streamlit/static/static/js/index.DRJutLeV.js +1 -0
- streamlit/static/static/js/{index.FawRMwD-.js → index.DS38XxzV.js} +1 -1
- streamlit/static/static/js/index.DdeHhk74.js +1 -0
- streamlit/static/static/js/index.De5HitMn.js +1 -0
- streamlit/static/static/js/index.DsvnAu-2.js +1 -0
- streamlit/static/static/js/index.Du4f6P1i.js +1 -0
- streamlit/static/static/js/index.HCbHLWBq.js +1 -0
- streamlit/static/static/js/index.XAUdgEdp.js +1 -0
- streamlit/static/static/js/{index.B3HJ1joN.js → index.edlGQJ3v.js} +6 -6
- streamlit/static/static/js/{input.CeAboTLQ.js → input.e-37_Dj1.js} +1 -1
- streamlit/static/static/js/{memory.BilaH12K.js → memory.B5p-2jga.js} +1 -1
- streamlit/static/static/js/{mergeWith.B34IaY8d.js → mergeWith.D8nk5iJa.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.BCo5wJKi.js → number-overlay-editor.DLD5-9zx.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.CRrAWWQi.js → possibleConstructorReturn.eeV6HB6T.js} +1 -1
- streamlit/static/static/js/{sandbox.ZIG5vd5E.js → sandbox.ChKquq8J.js} +1 -1
- streamlit/static/static/js/{textarea.B7ggnxCh.js → textarea.ZI_0MUsX.js} +1 -1
- streamlit/static/static/js/{timepicker.D1BZ0rZq.js → timepicker.C8N66VUc.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.bbNBXf55.js → toConsumableArray.DKg00cRh.js} +1 -1
- streamlit/static/static/js/{uniqueId.BRO0jXkb.js → uniqueId.fc9w8X88.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.DNqxSbNL.js → useBasicWidgetState.CySX_BlM.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.LSJywRT_.js → useOnInputChange.BF6Trlh5.js} +1 -1
- streamlit/static/static/js/withFullScreenWrapper.x2WsM7iA.js +1 -0
- streamlit/web/server/app_static_file_handler.py +1 -0
- {streamlit_nightly-1.42.2.dev20250217.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.42.2.dev20250217.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/RECORD +73 -73
- streamlit/static/static/js/index.-b7dNs6l.js +0 -1
- streamlit/static/static/js/index.0VYiXfju.js +0 -1
- streamlit/static/static/js/index.BNP-YHIi.js +0 -1
- streamlit/static/static/js/index.BU0eO7qf.js +0 -9
- streamlit/static/static/js/index.BVHKdy_B.js +0 -1
- streamlit/static/static/js/index.BY7jwxwh.js +0 -1
- streamlit/static/static/js/index.BeOYoTtD.js +0 -1
- streamlit/static/static/js/index.Byw8b24h.js +0 -1
- streamlit/static/static/js/index.C2dTzC3_.js +0 -2
- streamlit/static/static/js/index.CC8zeoS7.js +0 -1
- streamlit/static/static/js/index.CX29idWq.js +0 -1
- streamlit/static/static/js/index.CiWJLcV9.js +0 -1
- streamlit/static/static/js/index.DAlDuq3e.js +0 -3
- streamlit/static/static/js/index.Df7Lr-8j.js +0 -2
- streamlit/static/static/js/index.DoLrZkRU.js +0 -1
- streamlit/static/static/js/index.Dz2gm3-U.js +0 -1
- streamlit/static/static/js/index.VDF9za4g.js +0 -1
- streamlit/static/static/js/index.Vo9Xk_-P.js +0 -3
- streamlit/static/static/js/index.aoRAdNJI.js +0 -1
- streamlit/static/static/js/index.hEabuvQl.js +0 -1
- streamlit/static/static/js/index.idE2oxkV.js +0 -1
- streamlit/static/static/js/index.jaOfuXT_.js +0 -1
- streamlit/static/static/js/index.rqm-tyVr.js +0 -1
- streamlit/static/static/js/index.xj8ZjDtP.js +0 -1
- streamlit/static/static/js/withFullScreenWrapper.wyYj-oat.js +0 -1
- {streamlit_nightly-1.42.2.dev20250217.data → streamlit_nightly-1.42.2.dev20250218.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.42.2.dev20250217.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.42.2.dev20250217.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.42.2.dev20250217.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};
|