@marimo-team/frontend 0.19.7-dev23 → 0.19.7-dev24

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 +1 @@
1
- import{s as oe}from"./chunk-LvLJmgfZ.js";import{d as be,l as ye,n as V,p as ae,u as we}from"./useEvent-DO6uJBas.js";import{t as Ne}from"./react-BGmjiNul.js";import{N as ke,Zr as ze,_n as Ce,ai as Se,oi as n,w as Oe,__tla as Ae}from"./cells-Cvo5AIrZ.js";import"./react-dom-C9fstfnp.js";import{t as se}from"./compiler-runtime-DeeZ7FnK.js";import"./tooltip-CE4l3v3B.js";import{f as ie}from"./hotkeys-DghjL7BQ.js";import{y as Ie}from"./utils-CSDCHxwI.js";import{t as Le}from"./constants-B6Cb__3x.js";import"./config-BgpK7vqH.js";import{t as Me}from"./jsx-runtime-ZmTK25f3.js";import{t as z}from"./button-B3uq-Cpf.js";import{t as le}from"./cn-BKtXLv3a.js";import"./dist-DBwNzi3C.js";import{n as Pe,__tla as Ee}from"./JsonOutput-Dmfgex9T.js";import"./cjs-CH5Rj0g8.js";import"./main-U5Goe76G.js";import"./useNonce-_Aax6sXd.js";import{r as Re}from"./requests-BsVD4CdD.js";import{t as me}from"./createLucideIcon-CnW3RofX.js";import{d as De,__tla as He}from"./layout-BkGjQBnQ.js";import{n as Ve,t as qe,__tla as Te}from"./LazyAnyLanguageCodeMirror-ygeIsKeo.js";import"./download-kUMZIq8-.js";import"./markdown-renderer-CoQm4UxN.js";import{u as Ge}from"./toDate-CgbKQM5E.js";import{t as Ue,__tla as Ze}from"./cell-editor-Cqw8VDah.js";import{t as Be}from"./play-BPIh-ZEU.js";import{t as Fe}from"./spinner-DaIKav-i.js";import"./dist-Cayq-K1c.js";import"./dist-TiFCI16_.js";import"./dist-BIKFl48f.js";import"./dist-B0VqT_4z.js";import"./dist-BYyu59D8.js";import{r as Je}from"./useTheme-CuyH5VNX.js";import"./Combination-CMPwuAmi.js";import{t as C}from"./tooltip-CEc2ajau.js";import"./dates-CxJmszXT.js";import"./popover-D16ZremR.js";import"./vega-loader.browser-CRZ52CKf.js";import"./defaultLocale-D_rSvXvJ.js";import"./defaultLocale-C92Rrpmf.js";import"./purify.es-DNVQZNFu.js";import{__tla as Ke}from"./chunk-5FQGJX7Z-CVUXBqX6.js";import"./katex-Dc8yG8NU.js";import"./html-to-image-CJgqxZci.js";import{o as Qe}from"./focus-BeWVOW9Q.js";import{a as We}from"./renderShortcut-Dyrbz79Y.js";import"./esm-DpMp6qko.js";import{n as Xe,r as Ye,t as ne}from"./react-resizable-panels.browser.esm-Ctj_10o2.js";import"./name-cell-input-CHmzPoeN.js";import{n as $e,r as et}from"./panel-context-B7WTvLhE.js";import"./Inputs-D2Xn4HON.js";import{__tla as tt}from"./loro_wasm_bg-CDxXoyfI.js";import"./ws-BApgRfsy.js";import"./dist-C9XNJlLJ.js";import"./dist-fsvXrTzp.js";import"./dist-6cIjG-FS.js";import"./dist-CldbmzwA.js";import"./dist-OM63llNV.js";import"./dist-BmvOPdv_.js";import"./dist-DDGPBuw4.js";import"./dist-C4h-1T2Q.js";import"./dist-D_XLVesh.js";import"./esm-l4kcybiY.js";import{t as rt}from"./kiosk-mode-Djm3JPwk.js";let ce,ot=Promise.all([(()=>{try{return Ae}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return He}catch{}})(),(()=>{try{return Te}catch{}})(),(()=>{try{return Ze}catch{}})(),(()=>{try{return Ke}catch{}})(),(()=>{try{return tt}catch{}})()]).then(async()=>{var de=me("eraser",[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]),pe=me("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),he=se(),q=oe(Ne(),1),ue=15;const T=ze("marimo:scratchpadHistory:v1",[],Ce),fe=ae(!1),xe=ae(null,(e,s,i)=>{if(i=i.trim(),!i)return;let m=e(T);s(T,[i,...m.filter(c=>c!==i)].slice(0,ue))});var t=oe(Me(),1),_e={hide_code:!1,disabled:!1};const ve=()=>{var re;let e=(0,he.c)(60),s=ke(),[i]=Ie(),{theme:m}=Je(),c=(0,q.useRef)(null),G=Qe(),{createNewCell:U,updateCellCode:d}=Oe(),{sendRunScratchpad:p}=Re(),S=$e(),Z=et(),l=s.cellRuntime[n],B=l==null?void 0:l.output,O=l==null?void 0:l.status,F=l==null?void 0:l.consoleOutputs,r=((re=s.cellData.__scratch__)==null?void 0:re.code)??"",J=be(xe),[a,h]=ye(fe),u=we(T),A;e[0]!==J||e[1]!==r||e[2]!==p?(A=()=>{p({code:r}),J(r)},e[0]=J,e[1]=r,e[2]=p,e[3]=A):A=e[3];let f=V(A),I;e[4]!==r||e[5]!==U||e[6]!==G?(I=()=>{r.trim()&&U({code:r,before:!1,cellId:G??"__end__"})},e[4]=r,e[5]=U,e[6]=G,e[7]=I):I=e[7];let K=V(I),L;e[8]!==p||e[9]!==d?(L=()=>{d({cellId:n,code:"",formattingChange:!1}),p({code:""});let o=c.current;o&&o.dispatch({changes:{from:0,to:o.state.doc.length,insert:""}})},e[8]=p,e[9]=d,e[10]=L):L=e[10];let Q=V(L),M;e[11]!==h||e[12]!==d?(M=o=>{h(!1),d({cellId:n,code:o,formattingChange:!1});let k=c.current;k&&k.dispatch({changes:{from:0,to:k.state.doc.length,insert:o}})},e[11]=h,e[12]=d,e[13]=M):M=e[13];let W=V(M),[X,ge]=(0,q.useState)(),P;e[14]!==W||e[15]!==u||e[16]!==a||e[17]!==m?(P=()=>a?(0,t.jsx)("div",{className:"absolute inset-0 z-100 bg-background p-3 border-none overflow-auto",children:(0,t.jsx)("div",{className:"overflow-auto flex flex-col gap-3",children:u.map((o,k)=>(0,t.jsx)("div",{className:"border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden",onClick:()=>W(o),children:(0,t.jsx)(q.Suspense,{children:(0,t.jsx)(qe,{language:"python",theme:m,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:o.trim(),editable:!1,readOnly:!0})})},k))})}):null,e[14]=W,e[15]=u,e[16]=a,e[17]=m,e[18]=P):P=e[18];let Y=P,E;e[19]!==Q||e[20]!==K||e[21]!==f||e[22]!==u.length||e[23]!==a||e[24]!==h||e[25]!==O?(E=()=>(0,t.jsxs)("div",{className:"flex items-center shrink-0 border-b",children:[(0,t.jsx)(C,{content:We("cell.run"),children:(0,t.jsx)(z,{"data-testid":"scratchpad-run-button",onClick:f,disabled:a,variant:"text",size:"xs",children:(0,t.jsx)(Be,{color:"var(--grass-11)",size:16})})}),(0,t.jsx)(C,{content:"Clear code and outputs",children:(0,t.jsx)(z,{disabled:a,size:"xs",variant:"text",onClick:Q,children:(0,t.jsx)(de,{size:16})})}),(0,t.jsx)(rt,{children:(0,t.jsx)(C,{content:"Insert code",children:(0,t.jsx)(z,{disabled:a,size:"xs",variant:"text",onClick:K,children:(0,t.jsx)(Ve,{size:16})})})}),(O==="running"||O==="queued")&&(0,t.jsx)(Fe,{className:"inline",size:"small"}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsx)(C,{content:"Toggle history",children:(0,t.jsx)(z,{size:"xs",variant:"text",className:le(a&&"bg-(--sky-3) rounded-none"),onClick:()=>h(!a),disabled:u.length===0,children:(0,t.jsx)(pe,{size:16})})}),(0,t.jsx)(C,{content:(0,t.jsx)("span",{className:"block max-w-prose",children:"Use this scratchpad to experiment with code without restrictions on variable names. Variables defined here aren't saved to notebook memory, and the code is not saved in the notebook file."}),children:(0,t.jsx)(z,{size:"xs",variant:"text",children:(0,t.jsx)(Ge,{size:16})})})]}),e[19]=Q,e[20]=K,e[21]=f,e[22]=u.length,e[23]=a,e[24]=h,e[25]=O,e[26]=E):E=e[26];let $=E,je=S==="vertical",R;e[27]===Symbol.for("react.memo_cache_sentinel")?(R=Se.create(n),e[27]=R):R=e[27];let x;e[28]===$?x=e[29]:(x=$(),e[28]=$,e[29]=x);let D;e[30]===Symbol.for("react.memo_cache_sentinel")?(D=o=>{c.current=o},e[30]=D):D=e[30];let _;e[31]!==r||e[32]!==f||e[33]!==X||e[34]!==m||e[35]!==i?(_=(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsx)(Ue,{theme:m,showPlaceholder:!1,id:n,code:r,config:_e,status:"idle",serializedEditorState:null,runCell:f,userConfig:i,editorViewRef:c,setEditorView:D,hidden:!1,showHiddenCode:ie.NOOP,languageAdapter:X,setLanguageAdapter:ge})}),e[31]=r,e[32]=f,e[33]=X,e[34]=m,e[35]=i,e[36]=_):_=e[36];let v;e[37]===Y?v=e[38]:(v=Y(),e[37]=Y,e[38]=v);let g;e[39]!==v||e[40]!==x||e[41]!==_?(g=(0,t.jsx)(ne,{defaultSize:40,minSize:20,maxSize:70,children:(0,t.jsxs)("div",{className:"h-full flex flex-col overflow-hidden relative",children:[x,_,v]})}),e[39]=v,e[40]=x,e[41]=_,e[42]=g):g=e[42];let ee=je?"h-1":"w-1",j;e[43]===ee?j=e[44]:(j=le("bg-border hover:bg-primary/50 transition-colors",ee),e[43]=ee,e[44]=j);let b;e[45]===j?b=e[46]:(b=(0,t.jsx)(Ye,{className:j}),e[45]=j,e[46]=b);let y;e[47]===B?y=e[48]:(y=(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsx)(Pe,{allowExpand:!1,output:B,className:Le.outputArea,cellId:n,stale:!1,loading:!1})}),e[47]=B,e[48]=y);let w;e[49]===F?w=e[50]:(w=(0,t.jsx)("div",{className:"overflow-auto shrink-0 max-h-[50%]",children:(0,t.jsx)(De,{consoleOutputs:F,className:"overflow-auto",stale:!1,cellName:"_",onSubmitDebugger:ie.NOOP,cellId:n,debuggerActive:!1})}),e[49]=F,e[50]=w);let N;e[51]!==y||e[52]!==w?(N=(0,t.jsx)(ne,{defaultSize:60,minSize:20,children:(0,t.jsxs)("div",{className:"h-full flex flex-col divide-y overflow-hidden",children:[y,w]})}),e[51]=y,e[52]=w,e[53]=N):N=e[53];let H;return e[54]!==S||e[55]!==Z||e[56]!==g||e[57]!==b||e[58]!==N?(H=(0,t.jsx)("div",{className:"flex flex-col h-full overflow-hidden",id:R,children:(0,t.jsxs)(Xe,{direction:S,className:"h-full",children:[g,b,N]},Z)}),e[54]=S,e[55]=Z,e[56]=g,e[57]=b,e[58]=N,e[59]=H):H=e[59],H};let te;te=se(),ce=()=>{let e=(0,te.c)(1),s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(ve,{}),e[0]=s):s=e[0],s}});export{ot as __tla,ce as default};
1
+ import{s as oe}from"./chunk-LvLJmgfZ.js";import{d as be,l as ye,n as V,p as ae,u as we}from"./useEvent-DO6uJBas.js";import{t as Ne}from"./react-BGmjiNul.js";import{N as ke,Zr as ze,_n as Ce,ai as Se,oi as n,w as Oe,__tla as Ae}from"./cells-Cvo5AIrZ.js";import"./react-dom-C9fstfnp.js";import{t as se}from"./compiler-runtime-DeeZ7FnK.js";import"./tooltip-CE4l3v3B.js";import{f as ie}from"./hotkeys-DghjL7BQ.js";import{y as Ie}from"./utils-CSDCHxwI.js";import{t as Le}from"./constants-B6Cb__3x.js";import"./config-BgpK7vqH.js";import{t as Me}from"./jsx-runtime-ZmTK25f3.js";import{t as z}from"./button-B3uq-Cpf.js";import{t as le}from"./cn-BKtXLv3a.js";import"./dist-DBwNzi3C.js";import{n as Pe,__tla as Ee}from"./JsonOutput-Dmfgex9T.js";import"./cjs-CH5Rj0g8.js";import"./main-U5Goe76G.js";import"./useNonce-_Aax6sXd.js";import{r as Re}from"./requests-BsVD4CdD.js";import{t as me}from"./createLucideIcon-CnW3RofX.js";import{d as De,__tla as He}from"./layout-BkGjQBnQ.js";import{n as Ve,t as qe,__tla as Te}from"./LazyAnyLanguageCodeMirror-ygeIsKeo.js";import"./download-kUMZIq8-.js";import"./markdown-renderer-CoQm4UxN.js";import{u as Ge}from"./toDate-CgbKQM5E.js";import{t as Ue,__tla as Ze}from"./cell-editor-p88PqmUA.js";import{t as Be}from"./play-BPIh-ZEU.js";import{t as Fe}from"./spinner-DaIKav-i.js";import"./dist-Cayq-K1c.js";import"./dist-TiFCI16_.js";import"./dist-BIKFl48f.js";import"./dist-B0VqT_4z.js";import"./dist-BYyu59D8.js";import{r as Je}from"./useTheme-CuyH5VNX.js";import"./Combination-CMPwuAmi.js";import{t as C}from"./tooltip-CEc2ajau.js";import"./dates-CxJmszXT.js";import"./popover-D16ZremR.js";import"./vega-loader.browser-CRZ52CKf.js";import"./defaultLocale-D_rSvXvJ.js";import"./defaultLocale-C92Rrpmf.js";import"./purify.es-DNVQZNFu.js";import{__tla as Ke}from"./chunk-5FQGJX7Z-CVUXBqX6.js";import"./katex-Dc8yG8NU.js";import"./html-to-image-CJgqxZci.js";import{o as Qe}from"./focus-BeWVOW9Q.js";import{a as We}from"./renderShortcut-Dyrbz79Y.js";import"./esm-DpMp6qko.js";import{n as Xe,r as Ye,t as ne}from"./react-resizable-panels.browser.esm-Ctj_10o2.js";import"./name-cell-input-CHmzPoeN.js";import{n as $e,r as et}from"./panel-context-B7WTvLhE.js";import"./Inputs-D2Xn4HON.js";import{__tla as tt}from"./loro_wasm_bg-CDxXoyfI.js";import"./ws-BApgRfsy.js";import"./dist-C9XNJlLJ.js";import"./dist-fsvXrTzp.js";import"./dist-6cIjG-FS.js";import"./dist-CldbmzwA.js";import"./dist-OM63llNV.js";import"./dist-BmvOPdv_.js";import"./dist-DDGPBuw4.js";import"./dist-C4h-1T2Q.js";import"./dist-D_XLVesh.js";import"./esm-l4kcybiY.js";import{t as rt}from"./kiosk-mode-Djm3JPwk.js";let ce,ot=Promise.all([(()=>{try{return Ae}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return He}catch{}})(),(()=>{try{return Te}catch{}})(),(()=>{try{return Ze}catch{}})(),(()=>{try{return Ke}catch{}})(),(()=>{try{return tt}catch{}})()]).then(async()=>{var de=me("eraser",[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]),pe=me("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),he=se(),q=oe(Ne(),1),ue=15;const T=ze("marimo:scratchpadHistory:v1",[],Ce),fe=ae(!1),xe=ae(null,(e,s,i)=>{if(i=i.trim(),!i)return;let m=e(T);s(T,[i,...m.filter(c=>c!==i)].slice(0,ue))});var t=oe(Me(),1),_e={hide_code:!1,disabled:!1};const ve=()=>{var re;let e=(0,he.c)(60),s=ke(),[i]=Ie(),{theme:m}=Je(),c=(0,q.useRef)(null),G=Qe(),{createNewCell:U,updateCellCode:d}=Oe(),{sendRunScratchpad:p}=Re(),S=$e(),Z=et(),l=s.cellRuntime[n],B=l==null?void 0:l.output,O=l==null?void 0:l.status,F=l==null?void 0:l.consoleOutputs,r=((re=s.cellData.__scratch__)==null?void 0:re.code)??"",J=be(xe),[a,h]=ye(fe),u=we(T),A;e[0]!==J||e[1]!==r||e[2]!==p?(A=()=>{p({code:r}),J(r)},e[0]=J,e[1]=r,e[2]=p,e[3]=A):A=e[3];let f=V(A),I;e[4]!==r||e[5]!==U||e[6]!==G?(I=()=>{r.trim()&&U({code:r,before:!1,cellId:G??"__end__"})},e[4]=r,e[5]=U,e[6]=G,e[7]=I):I=e[7];let K=V(I),L;e[8]!==p||e[9]!==d?(L=()=>{d({cellId:n,code:"",formattingChange:!1}),p({code:""});let o=c.current;o&&o.dispatch({changes:{from:0,to:o.state.doc.length,insert:""}})},e[8]=p,e[9]=d,e[10]=L):L=e[10];let Q=V(L),M;e[11]!==h||e[12]!==d?(M=o=>{h(!1),d({cellId:n,code:o,formattingChange:!1});let k=c.current;k&&k.dispatch({changes:{from:0,to:k.state.doc.length,insert:o}})},e[11]=h,e[12]=d,e[13]=M):M=e[13];let W=V(M),[X,ge]=(0,q.useState)(),P;e[14]!==W||e[15]!==u||e[16]!==a||e[17]!==m?(P=()=>a?(0,t.jsx)("div",{className:"absolute inset-0 z-100 bg-background p-3 border-none overflow-auto",children:(0,t.jsx)("div",{className:"overflow-auto flex flex-col gap-3",children:u.map((o,k)=>(0,t.jsx)("div",{className:"border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden",onClick:()=>W(o),children:(0,t.jsx)(q.Suspense,{children:(0,t.jsx)(qe,{language:"python",theme:m,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:o.trim(),editable:!1,readOnly:!0})})},k))})}):null,e[14]=W,e[15]=u,e[16]=a,e[17]=m,e[18]=P):P=e[18];let Y=P,E;e[19]!==Q||e[20]!==K||e[21]!==f||e[22]!==u.length||e[23]!==a||e[24]!==h||e[25]!==O?(E=()=>(0,t.jsxs)("div",{className:"flex items-center shrink-0 border-b",children:[(0,t.jsx)(C,{content:We("cell.run"),children:(0,t.jsx)(z,{"data-testid":"scratchpad-run-button",onClick:f,disabled:a,variant:"text",size:"xs",children:(0,t.jsx)(Be,{color:"var(--grass-11)",size:16})})}),(0,t.jsx)(C,{content:"Clear code and outputs",children:(0,t.jsx)(z,{disabled:a,size:"xs",variant:"text",onClick:Q,children:(0,t.jsx)(de,{size:16})})}),(0,t.jsx)(rt,{children:(0,t.jsx)(C,{content:"Insert code",children:(0,t.jsx)(z,{disabled:a,size:"xs",variant:"text",onClick:K,children:(0,t.jsx)(Ve,{size:16})})})}),(O==="running"||O==="queued")&&(0,t.jsx)(Fe,{className:"inline",size:"small"}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsx)(C,{content:"Toggle history",children:(0,t.jsx)(z,{size:"xs",variant:"text",className:le(a&&"bg-(--sky-3) rounded-none"),onClick:()=>h(!a),disabled:u.length===0,children:(0,t.jsx)(pe,{size:16})})}),(0,t.jsx)(C,{content:(0,t.jsx)("span",{className:"block max-w-prose",children:"Use this scratchpad to experiment with code without restrictions on variable names. Variables defined here aren't saved to notebook memory, and the code is not saved in the notebook file."}),children:(0,t.jsx)(z,{size:"xs",variant:"text",children:(0,t.jsx)(Ge,{size:16})})})]}),e[19]=Q,e[20]=K,e[21]=f,e[22]=u.length,e[23]=a,e[24]=h,e[25]=O,e[26]=E):E=e[26];let $=E,je=S==="vertical",R;e[27]===Symbol.for("react.memo_cache_sentinel")?(R=Se.create(n),e[27]=R):R=e[27];let x;e[28]===$?x=e[29]:(x=$(),e[28]=$,e[29]=x);let D;e[30]===Symbol.for("react.memo_cache_sentinel")?(D=o=>{c.current=o},e[30]=D):D=e[30];let _;e[31]!==r||e[32]!==f||e[33]!==X||e[34]!==m||e[35]!==i?(_=(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsx)(Ue,{theme:m,showPlaceholder:!1,id:n,code:r,config:_e,status:"idle",serializedEditorState:null,runCell:f,userConfig:i,editorViewRef:c,setEditorView:D,hidden:!1,showHiddenCode:ie.NOOP,languageAdapter:X,setLanguageAdapter:ge})}),e[31]=r,e[32]=f,e[33]=X,e[34]=m,e[35]=i,e[36]=_):_=e[36];let v;e[37]===Y?v=e[38]:(v=Y(),e[37]=Y,e[38]=v);let g;e[39]!==v||e[40]!==x||e[41]!==_?(g=(0,t.jsx)(ne,{defaultSize:40,minSize:20,maxSize:70,children:(0,t.jsxs)("div",{className:"h-full flex flex-col overflow-hidden relative",children:[x,_,v]})}),e[39]=v,e[40]=x,e[41]=_,e[42]=g):g=e[42];let ee=je?"h-1":"w-1",j;e[43]===ee?j=e[44]:(j=le("bg-border hover:bg-primary/50 transition-colors",ee),e[43]=ee,e[44]=j);let b;e[45]===j?b=e[46]:(b=(0,t.jsx)(Ye,{className:j}),e[45]=j,e[46]=b);let y;e[47]===B?y=e[48]:(y=(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsx)(Pe,{allowExpand:!1,output:B,className:Le.outputArea,cellId:n,stale:!1,loading:!1})}),e[47]=B,e[48]=y);let w;e[49]===F?w=e[50]:(w=(0,t.jsx)("div",{className:"overflow-auto shrink-0 max-h-[50%]",children:(0,t.jsx)(De,{consoleOutputs:F,className:"overflow-auto",stale:!1,cellName:"_",onSubmitDebugger:ie.NOOP,cellId:n,debuggerActive:!1})}),e[49]=F,e[50]=w);let N;e[51]!==y||e[52]!==w?(N=(0,t.jsx)(ne,{defaultSize:60,minSize:20,children:(0,t.jsxs)("div",{className:"h-full flex flex-col divide-y overflow-hidden",children:[y,w]})}),e[51]=y,e[52]=w,e[53]=N):N=e[53];let H;return e[54]!==S||e[55]!==Z||e[56]!==g||e[57]!==b||e[58]!==N?(H=(0,t.jsx)("div",{className:"flex flex-col h-full overflow-hidden",id:R,children:(0,t.jsxs)(Xe,{direction:S,className:"h-full",children:[g,b,N]},Z)}),e[54]=S,e[55]=Z,e[56]=g,e[57]=b,e[58]=N,e[59]=H):H=e[59],H};let te;te=se(),ce=()=>{let e=(0,te.c)(1),s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(ve,{}),e[0]=s):s=e[0],s}});export{ot as __tla,ce as default};
package/dist/index.html CHANGED
@@ -66,7 +66,7 @@
66
66
  <marimo-server-token data-token="{{ server_token }}" hidden></marimo-server-token>
67
67
  <!-- /TODO -->
68
68
  <title>{{ title }}</title>
69
- <script type="module" crossorigin src="./assets/index-DCjsZDGq.js"></script>
69
+ <script type="module" crossorigin src="./assets/index-CSj0b_Pr.js"></script>
70
70
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-DItdS47A.js">
71
71
  <link rel="modulepreload" crossorigin href="./assets/clsx-D8GwTfvk.js">
72
72
  <link rel="modulepreload" crossorigin href="./assets/cn-BKtXLv3a.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/frontend",
3
- "version": "0.19.7-dev23",
3
+ "version": "0.19.7-dev24",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -3,6 +3,7 @@
3
3
  import type { JSX } from "react";
4
4
  import { FilenameInput } from "@/components/editor/header/filename-input";
5
5
  import { useUpdateFilename } from "@/core/saving/filename";
6
+ import { useSaveNotebook } from "@/core/saving/save-component";
6
7
  import { Paths } from "@/utils/paths";
7
8
 
8
9
  export const FilenameForm = ({
@@ -10,14 +11,26 @@ export const FilenameForm = ({
10
11
  }: {
11
12
  filename: string | null;
12
13
  }): JSX.Element => {
13
- const setFilename = useUpdateFilename();
14
+ const updateFilename = useUpdateFilename();
15
+ const { saveNotebook } = useSaveNotebook();
16
+
17
+ const handleNameChange = (newFilename: string) => {
18
+ const wasUnnamed = filename === null;
19
+ updateFilename(newFilename).then((name) => {
20
+ // When creating a new file (was unnamed), also save the content
21
+ if (name !== null && wasUnnamed) {
22
+ saveNotebook(name, true);
23
+ }
24
+ });
25
+ };
26
+
14
27
  return (
15
28
  <FilenameInput
16
29
  placeholderText={
17
30
  filename ? Paths.basename(filename) : "untitled marimo notebook"
18
31
  }
19
32
  initialValue={filename}
20
- onNameChange={setFilename}
33
+ onNameChange={handleNameChange}
21
34
  flexibleWidth={true}
22
35
  resetOnBlur={true}
23
36
  data-testid="filename-input"
@@ -109,6 +109,7 @@ const renderWithProvider = <T>(hook: () => T) => {
109
109
  // Shared mock setup
110
110
  const mockSaveOrNameNotebook = vi.fn();
111
111
  const mockSaveIfNotebookIsPersistent = vi.fn();
112
+ const mockSaveNotebook = vi.fn();
112
113
  const mockRunCell = vi.fn();
113
114
  const mockCopyCell = vi.fn();
114
115
  const mockPasteCell = vi.fn();
@@ -156,6 +157,7 @@ describe("useCellNavigationProps", () => {
156
157
  mockUseSaveNotebook.mockReturnValue({
157
158
  saveOrNameNotebook: mockSaveOrNameNotebook,
158
159
  saveIfNotebookIsPersistent: mockSaveIfNotebookIsPersistent,
160
+ saveNotebook: mockSaveNotebook,
159
161
  });
160
162
  mockUseCellActions.mockReturnValue(
161
163
  mockCellActions as unknown as CellActions,
@@ -190,6 +190,7 @@ export function useSaveNotebook() {
190
190
  return {
191
191
  saveOrNameNotebook,
192
192
  saveIfNotebookIsPersistent,
193
+ saveNotebook,
193
194
  };
194
195
  }
195
196