@marimo-team/frontend 0.18.5-dev198 → 0.18.5-dev200

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 +0,0 @@
1
- import{u as n}from"./useEvent-DlWF5OMa.js";import{r as e}from"./mode-BOijHAOc.js";const l=r=>{let{children:t}=r;return n(e)?null:t},o=r=>{let{children:t}=r;return n(e)?t:null};export{o as n,l as t};
@@ -1 +0,0 @@
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-DlWF5OMa.js";import{t as Ne}from"./react-BGmjiNul.js";import{C as ke,Kr as ze,M as Ce,ei as Se,fn as Oe,ti as m,__tla as Ae}from"./cells-Dk_j8HX9.js";import"./react-dom-C9fstfnp.js";import{t as se}from"./compiler-runtime-DeeZ7FnK.js";import"./tooltip-CrRUCOBw.js";import{f as ie}from"./hotkeys-uKX61F1_.js";import{v as Ie}from"./utils-CJJIceVn.js";import{t as Me}from"./constants-Bkp4R3bQ.js";import"./config-babG4OBR.js";import{t as Le}from"./jsx-runtime-DN_bIXfG.js";import{t as z}from"./button-DuYGqRtX.js";import{t as le}from"./cn-C1rgT0yh.js";import"./dist-CAcX026F.js";import{n as Pe,__tla as Ee}from"./JsonOutput-BCHaEg3R.js";import"./cjs-Bj40p_Np.js";import"./main-CwSdzVhm.js";import"./useNonce-EAuSVK-5.js";import{r as Re}from"./requests-C0HaHO6a.js";import{t as ne}from"./createLucideIcon-CW2xpJ57.js";import{d as De,__tla as He}from"./layout-DenYhPfS.js";import{n as Ve,t as qe,__tla as Te}from"./LazyAnyLanguageCodeMirror-jpEDlD0M.js";import"./download-Dsuja3On.js";import"./markdown-renderer-COkLQ1b5.js";import{u as Ge}from"./toDate-5JckKRQn.js";import{i as Ke,n as Ue,r as Be,__tla as Fe}from"./panel-context-DUUPei-R.js";import{t as Je}from"./play-BJDBXApx.js";import{t as Qe}from"./spinner-C1czjtp7.js";import"./dist-HGZzCB0y.js";import"./dist-CVj-_Iiz.js";import"./dist-BVf1IY4_.js";import"./dist-Cq_4nPfh.js";import"./dist-RKnr9SNh.js";import{r as We}from"./useTheme-DfP1CWaW.js";import"./Combination-D1TsGrBC.js";import{t as C}from"./tooltip-CvjcEpZC.js";import"./dates-CdsE1R40.js";import"./popover-DtnzNVk-.js";import"./vega-loader.browser-C8wT63Va.js";import"./defaultLocale-BLUna9fQ.js";import"./defaultLocale-DzliDDTm.js";import"./purify.es-N-2faAGj.js";import{__tla as Xe}from"./chunk-OGVTOU66-CjNLT2C3.js";import"./katex-AwOI3EvM.js";import"./marked.esm-CHnOtnr3.js";import"./es-DjCjT1hB.js";import{o as Ye}from"./focus-U1ePwk4d.js";import{a as Ze}from"./renderShortcut-D0Pei-OA.js";import"./esm-B3JckBtM.js";import{n as $e,r as et,t as me}from"./react-resizable-panels.browser.esm-BqxQegSf.js";import"./name-cell-input-Cf2CUXDm.js";import"./Inputs-DmoeP8nh.js";import{__tla as tt}from"./loro_wasm_bg-CghhyG7y.js";import"./ws-itdlXHqs.js";import"./dist-BRZzJw_5.js";import"./dist-P7JHert4.js";import"./dist-CoiWxjLF.js";import"./dist-cVYW_wBR.js";import"./dist-BAmo7Mv9.js";import"./dist-3oAtECdQ.js";import"./dist-D6Pwf0VF.js";import"./dist-D9HMoxdZ.js";import"./dist-JtCdI6tY.js";import"./esm-CCqLcax5.js";import{t as rt}from"./kiosk-mode-C23fjW_G.js";let ce,ot=Promise.all([(()=>{try{return Ae}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return He}catch{}})(),(()=>{try{return Te}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return Xe}catch{}})(),(()=>{try{return tt}catch{}})()]).then(async()=>{var de=ne("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=ne("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),fe=15;const T=ze("marimo:scratchpadHistory:v1",[],Oe),ue=ae(!1),xe=ae(null,(e,s,i)=>{if(i=i.trim(),!i)return;let n=e(T);s(T,[i,...n.filter(c=>c!==i)].slice(0,fe))});var t=oe(Le(),1),_e={hide_code:!1,disabled:!1};const ve=()=>{var re;let e=(0,he.c)(60),s=Ce(),[i]=Ie(),{theme:n}=We(),c=(0,q.useRef)(null),G=Ye(),{createNewCell:K,updateCellCode:d}=ke(),{sendRunScratchpad:p}=Re(),S=Ue(),U=Be(),l=s.cellRuntime[m],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(ue),f=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 u=V(A),I;e[4]!==r||e[5]!==K||e[6]!==G?(I=()=>{r.trim()&&K({code:r,before:!1,cellId:G??"__end__"})},e[4]=r,e[5]=K,e[6]=G,e[7]=I):I=e[7];let Q=V(I),M;e[8]!==p||e[9]!==d?(M=()=>{d({cellId:m,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]=M):M=e[10];let W=V(M),L;e[11]!==h||e[12]!==d?(L=o=>{h(!1),d({cellId:m,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]=L):L=e[13];let X=V(L),[Y,ge]=(0,q.useState)(),P;e[14]!==X||e[15]!==f||e[16]!==a||e[17]!==n?(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:f.map((o,k)=>(0,t.jsx)("div",{className:"border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden",onClick:()=>X(o),children:(0,t.jsx)(q.Suspense,{children:(0,t.jsx)(qe,{language:"python",theme:n,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:o.trim(),editable:!1,readOnly:!0})})},k))})}):null,e[14]=X,e[15]=f,e[16]=a,e[17]=n,e[18]=P):P=e[18];let Z=P,E;e[19]!==W||e[20]!==Q||e[21]!==u||e[22]!==f.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:Ze("cell.run"),children:(0,t.jsx)(z,{"data-testid":"scratchpad-run-button",onClick:u,disabled:a,variant:"text",size:"xs",children:(0,t.jsx)(Je,{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:W,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:Q,children:(0,t.jsx)(Ve,{size:16})})})}),(O==="running"||O==="queued")&&(0,t.jsx)(Qe,{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:f.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]=W,e[20]=Q,e[21]=u,e[22]=f.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(m),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]!==u||e[33]!==Y||e[34]!==n||e[35]!==i?(_=(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsx)(Ke,{theme:n,showPlaceholder:!1,id:m,code:r,config:_e,status:"idle",serializedEditorState:null,runCell:u,userConfig:i,editorViewRef:c,setEditorView:D,hidden:!1,showHiddenCode:ie.NOOP,languageAdapter:Y,setLanguageAdapter:ge})}),e[31]=r,e[32]=u,e[33]=Y,e[34]=n,e[35]=i,e[36]=_):_=e[36];let v;e[37]===Z?v=e[38]:(v=Z(),e[37]=Z,e[38]=v);let g;e[39]!==v||e[40]!==x||e[41]!==_?(g=(0,t.jsx)(me,{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)(et,{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:Me.outputArea,cellId:m,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:m,debuggerActive:!1})}),e[49]=F,e[50]=w);let N;e[51]!==y||e[52]!==w?(N=(0,t.jsx)(me,{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]!==U||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)($e,{direction:S,className:"h-full",children:[g,b,N]},U)}),e[54]=S,e[55]=U,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 +0,0 @@
1
- import{s as z}from"./chunk-LvLJmgfZ.js";import"./useEvent-DlWF5OMa.js";import{t as P}from"./react-BGmjiNul.js";import{C as D}from"./cells-Dk_j8HX9.js";import"./react-dom-C9fstfnp.js";import{t as I}from"./compiler-runtime-DeeZ7FnK.js";import{n as F}from"./constants-Bkp4R3bQ.js";import"./config-babG4OBR.js";import{t as O}from"./jsx-runtime-DN_bIXfG.js";import{i as W,t as g}from"./button-DuYGqRtX.js";import{t as q}from"./cn-C1rgT0yh.js";import{at as A}from"./dist-CAcX026F.js";import"./cjs-Bj40p_Np.js";import"./main-CwSdzVhm.js";import"./useNonce-EAuSVK-5.js";import{r as B}from"./requests-C0HaHO6a.js";import{n as $,t as G}from"./LazyAnyLanguageCodeMirror-jpEDlD0M.js";import{h as L}from"./select-D0g5GnIs.js";import{t as R}from"./spinner-C1czjtp7.js";import{t as T}from"./plus-CHesBJpY.js";import"./dist-HGZzCB0y.js";import"./dist-CVj-_Iiz.js";import"./dist-BVf1IY4_.js";import"./dist-Cq_4nPfh.js";import"./dist-RKnr9SNh.js";import{r as U}from"./useTheme-DfP1CWaW.js";import"./Combination-D1TsGrBC.js";import{t as V}from"./tooltip-CvjcEpZC.js";import{a as J,c as K,i as Q,n as X,r as Y}from"./dialog-DUEuLcT2.js";import{n as Z}from"./ImperativeModal-q6QlC2aZ.js";import{n as ee}from"./error-banner-DU5Qb8a8.js";import{t as te}from"./RenderHTML-BUhX0rkG.js";import"./purify.es-N-2faAGj.js";import{n as se}from"./useAsyncData-BJJJOr9W.js";import{a as re,o as le,r as oe,t as ie,u as ae}from"./command-gUA-HncX.js";import{o as ne}from"./focus-U1ePwk4d.js";import{t as me}from"./empty-state-B0XJ9ZUi.js";import{t as M}from"./kiosk-mode-C23fjW_G.js";var E=I(),w=z(P(),1),s=z(O(),1);const ce=t=>{let e=(0,E.c)(6),{children:r}=t,{openModal:i,closeModal:o}=Z(),l;e[0]!==o||e[1]!==i?(l=()=>i((0,s.jsx)(de,{onClose:o})),e[0]=o,e[1]=i,e[2]=l):l=e[2];let a;return e[3]!==r||e[4]!==l?(a=(0,s.jsx)(W,{onClick:l,children:r}),e[3]=r,e[4]=l,e[5]=a):a=e[5],a};var de=t=>{let e=(0,E.c)(4),{onClose:r}=t,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)(K,{children:"Contribute a Snippet"}),e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=(0,s.jsxs)(J,{children:[i,(0,s.jsxs)(Y,{children:["Have a useful snippet you want to share with the community? Make a pull request"," ",(0,s.jsx)("a",{href:F.githubPage,target:"_blank",className:"underline",children:"on GitHub"}),"."]})]}),e[1]=o):o=e[1];let l;return e[2]===r?l=e[3]:(l=(0,s.jsxs)(X,{className:"max-w-md",children:[o,(0,s.jsx)(Q,{children:(0,s.jsx)(g,{"data-testid":"snippet-close-button",variant:"default",onClick:r,children:"Close"})})]}),e[2]=r,e[3]=l),l},C=I(),pe=[A.lineWrapping],he=()=>{let t=(0,C.c)(22),{readSnippets:e}=B(),[r,i]=w.useState(),o;t[0]===e?o=t[1]:(o=()=>e(),t[0]=e,t[1]=o);let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=[],t[2]=l):l=t[2];let{data:a,error:m,isPending:N}=se(o,l);if(m){let n;return t[3]===m?n=t[4]:(n=(0,s.jsx)(ee,{error:m}),t[3]=m,t[4]=n),n}if(N||!a){let n;return t[5]===Symbol.for("react.memo_cache_sentinel")?(n=(0,s.jsx)(R,{size:"medium",centered:!0}),t[5]=n):n=t[5],n}let _=r?"h-1/3":"h-full",p;t[6]===_?p=t[7]:(p=q("border-b rounded-none",_),t[6]=_,t[7]=p);let h;t[8]===Symbol.for("react.memo_cache_sentinel")?(h=(0,s.jsx)(re,{placeholder:"Search snippets...",className:"h-6 m-1",rootClassName:"flex-1 border-r"}),t[8]=h):h=t[8];let b,f;t[9]===Symbol.for("react.memo_cache_sentinel")?(b=(0,s.jsxs)("div",{className:"flex items-center w-full",children:[h,(0,s.jsx)(ce,{children:(0,s.jsx)("button",{className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:(0,s.jsx)(T,{className:"h-4 w-4"})})})]}),f=(0,s.jsx)(oe,{children:"No results"}),t[9]=b,t[10]=f):(b=t[9],f=t[10]);let x;t[11]===Symbol.for("react.memo_cache_sentinel")?(x=n=>i(n),t[11]=x):x=t[11];let u;t[12]===a.snippets?u=t[13]:(u=(0,s.jsx)(xe,{onSelect:x,snippets:a.snippets}),t[12]=a.snippets,t[13]=u);let c;t[14]!==p||t[15]!==u?(c=(0,s.jsxs)(ie,{className:p,children:[b,f,u]}),t[14]=p,t[15]=u,t[16]=c):c=t[16];let d;t[17]===r?d=t[18]:(d=(0,s.jsx)(w.Suspense,{children:(0,s.jsx)("div",{className:"h-2/3 snippet-viewer flex flex-col",children:r?(0,s.jsx)(fe,{snippet:r,onClose:()=>i(void 0)},r.title):(0,s.jsx)(me,{title:"",description:"Click on a snippet to view its content."})})}),t[17]=r,t[18]=d);let j;return t[19]!==d||t[20]!==c?(j=(0,s.jsxs)("div",{className:"flex-1 overflow-hidden",children:[c,d]}),t[19]=d,t[20]=c,t[21]=j):j=t[21],j},fe=t=>{let e=(0,C.c)(33),{snippet:r,onClose:i}=t,{theme:o}=U(),{createNewCell:l}=D(),a=ne(),m;e[0]!==l||e[1]!==a||e[2]!==r.sections?(m=()=>{for(let v of[...r.sections].reverse())v.code&&l({code:v.code,before:!1,cellId:a??"__end__",skipIfCodeExists:!0})},e[0]=l,e[1]=a,e[2]=r.sections,e[3]=m):m=e[3];let N=m,_;e[4]!==l||e[5]!==a?(_=v=>{l({code:v,before:!1,cellId:a??"__end__"})},e[4]=l,e[5]=a,e[6]=_):_=e[6];let p=_,h;e[7]===r.title?h=e[8]:(h=(0,s.jsx)("span",{children:r.title}),e[7]=r.title,e[8]=h);let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=(0,s.jsx)(L,{className:"h-4 w-4"}),e[9]=b):b=e[9];let f;e[10]===i?f=e[11]:(f=(0,s.jsx)(g,{size:"sm",variant:"ghost",onClick:i,className:"h-6 w-6 p-0 hover:bg-muted-foreground/10",children:b}),e[10]=i,e[11]=f);let x;e[12]!==h||e[13]!==f?(x=(0,s.jsxs)("div",{className:"text-sm font-semibold bg-muted border-y px-2 py-1 flex justify-between items-center",children:[h,f]}),e[12]=h,e[13]=f,e[14]=x):x=e[14];let u;e[15]===Symbol.for("react.memo_cache_sentinel")?(u=(0,s.jsx)($,{className:"ml-2 h-4 w-4"}),e[15]=u):u=e[15];let c;e[16]===N?c=e[17]:(c=(0,s.jsx)("div",{className:"flex justify-end",children:(0,s.jsx)(M,{children:(0,s.jsxs)(g,{className:"float-right",size:"xs",variant:"outline",onClick:N,children:["Insert snippet",u]})})}),e[16]=N,e[17]=c);let d;if(e[18]!==p||e[19]!==r.sections||e[20]!==r.title||e[21]!==o){let v;e[23]!==p||e[24]!==r.title||e[25]!==o?(v=H=>{let{code:y,html:k,id:S}=H;return k?(0,s.jsx)("div",{children:te({html:k})},`${r.title}-${S}`):y?(0,s.jsxs)("div",{className:"relative hover-actions-parent pr-2",children:[(0,s.jsx)(M,{children:(0,s.jsx)(V,{content:"Insert snippet",children:(0,s.jsx)(g,{className:"absolute -top-2 -right-1 z-10 hover-action px-2 bg-background",size:"sm",variant:"outline",onClick:()=>{p(y)},children:(0,s.jsx)($,{className:"h-5 w-5"})})})}),(0,s.jsx)(w.Suspense,{children:(0,s.jsx)(G,{theme:o==="dark"?"dark":"light",language:"python",className:"cm border rounded overflow-hidden",extensions:pe,value:y,readOnly:!0},`${r.title}-${S}`)})]},`${r.title}-${S}`):null},e[23]=p,e[24]=r.title,e[25]=o,e[26]=v):v=e[26],d=r.sections.map(v),e[18]=p,e[19]=r.sections,e[20]=r.title,e[21]=o,e[22]=d}else d=e[22];let j;e[27]!==c||e[28]!==d?(j=(0,s.jsxs)("div",{className:"px-2 py-2 space-y-4 overflow-auto flex-1",children:[c,d]}),e[27]=c,e[28]=d,e[29]=j):j=e[29];let n;return e[30]!==j||e[31]!==x?(n=(0,s.jsxs)(s.Fragment,{children:[x,j]}),e[30]=j,e[31]=x,e[32]=n):n=e[32],n},xe=t=>{let e=(0,C.c)(7),{snippets:r,onSelect:i}=t,o;if(e[0]!==i||e[1]!==r){let a;e[3]===i?a=e[4]:(a=m=>(0,s.jsx)(le,{className:"rounded-none",onSelect:()=>i(m),children:(0,s.jsx)("div",{className:"flex flex-row gap-2 items-center",children:(0,s.jsx)("span",{className:"mt-1 text-accent-foreground",children:m.title})})},m.title),e[3]=i,e[4]=a),o=r.map(a),e[0]=i,e[1]=r,e[2]=o}else o=e[2];let l;return e[5]===o?l=e[6]:(l=(0,s.jsx)(ae,{className:"flex flex-col overflow-auto",children:o}),e[5]=o,e[6]=l),l};export{he as default};