@marimo-team/frontend 0.25.3-dev60 → 0.25.3-dev62

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{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r}from"./useEvent-Dfcbgjhg.js";import{t as i}from"./react-DVplv7_D.js";import{D as a,La as o,g as s,oo as c,x as l}from"./cells-T9_Y4Jlv.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./panels-B2UqDbHy.js";import{t as g}from"./compiler-runtime-BrajqUja.js";import{C as _}from"./config-DGX7JYor.js";import{r as v}from"./utils-B4K466FK.js";import{t as y}from"./session-B8Y-GJnS.js";import{T as b,_ as x,l as S,p as C}from"./config-DzdxZb17.js";import{t as w}from"./cn-ldLVeaqm.js";import{t as T}from"./jsx-runtime-B74pBk57.js";import{a as E,c as D,i as O,l as k,n as A,s as j,t as M}from"./alert-dialog-C-sWmKva.js";import{F as N,Ft as ee}from"./JsonOutput-Pm6OCP3J.js";import{n as te}from"./download-C8Gw-D0Y.js";import{i as P,n as F,r as ne,t as re}from"./tabs-CY8E4r9U.js";import{n as I,t as L}from"./button-D8gVKwe-.js";import{n as ie}from"./paths-bkIFVj8h.js";import{t as ae}from"./arrow-left-BaPN-xbg.js";import{t as R}from"./copy-Djr5m5ac.js";import{t as oe}from"./house-CpsMWsLL.js";import{t as z}from"./spinner-DyNE-o8o.js";import{l as B,s as V}from"./readonly-python-code-B81AjzXM.js";import{Jt as H,Qt as U,Xt as W,Yt as G,nn as K,tn as q}from"./input-BZdRe7pb.js";import{n as J}from"./copy-KlhazlhB.js";import{t as Y}from"./use-toast-Wu434mLr.js";import{r as se}from"./requests-lt0JK8Jt.js";import{t as ce}from"./shell-Fj8a65ii.js";import{t as le}from"./share-BZW3tzEX.js";import{a as X}from"./cell-link-DFqfW-Ym.js";import{n as ue,t as de}from"./react-resizable-panels.browser.esm-Dbe0MrFr.js";import{n as fe}from"./code-visibility-CV3S4xuf.js";import{n as pe,t as me}from"./marimo-icons-CqliHyTr.js";import{t as he}from"./state-Ck7FMD5A.js";var ge=e(i(),1),Z=g(),Q=T(),_e=()=>{let e=(0,Z.c)(25),[n,r]=t(he);if(n===null)return null;let i;e[0]===n?i=e[1]:(i=async()=>{try{await navigator.clipboard.writeText(n),Y({title:`Copied to clipboard`,description:`Error details have been copied to your clipboard.`})}catch{Y({title:`Failed to copy`,description:`Could not copy to clipboard.`,variant:`danger`})}},e[0]=n,e[1]=i);let a=i,o;e[2]===r?o=e[3]:(o=()=>{r(null)},e[2]=r,e[3]=o);let s=o,l=ve,u;e[4]===s?u=e[5]:(u=e=>!e&&s(),e[4]=s,e[5]=u);let d;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsxs)(D,{children:[(0,Q.jsxs)(k,{className:`flex items-center gap-2 text-destructive`,children:[(0,Q.jsx)(c,{className:`h-5 w-5`}),`Kernel Startup Failed`]}),(0,Q.jsx)(E,{children:`The kernel failed to start. This usually happens when the package manager can't install your notebook's dependencies.`})]}),e[6]=d):d=e[6];let f;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(`span`,{className:`text-sm font-medium text-muted-foreground`,children:`Error Details`}),e[7]=f):f=e[7];let p;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(R,{className:`h-3 w-3`}),e[8]=p):p=e[8];let m;e[9]===a?m=e[10]:(m=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[f,(0,Q.jsxs)(L,{variant:`outline`,size:`xs`,onClick:a,className:`flex items-center gap-1`,children:[p,`Copy`]})]}),e[9]=a,e[10]=m);let h;e[11]===n?h=e[12]:(h=(0,Q.jsx)(`pre`,{className:`bg-muted p-4 rounded-md text-sm font-mono overflow-auto max-h-80`,children:n}),e[11]=n,e[12]=h);let g;e[13]!==m||e[14]!==h?(g=(0,Q.jsxs)(`div`,{className:`my-4 overflow-hidden`,children:[m,h]}),e[13]=m,e[14]=h,e[15]=g):g=e[15];let _;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsxs)(L,{variant:`outline`,onClick:l,className:`flex items-center gap-2`,children:[(0,Q.jsx)(oe,{className:`h-4 w-4`}),`Return to Home`]}),e[16]=_):_=e[16];let v;e[17]===s?v=e[18]:(v=(0,Q.jsxs)(j,{children:[_,(0,Q.jsx)(A,{onClick:s,children:`Dismiss`})]}),e[17]=s,e[18]=v);let y;e[19]!==v||e[20]!==g?(y=(0,Q.jsxs)(O,{className:`max-w-2xl`,children:[d,g,v]}),e[19]=v,e[20]=g,e[21]=y):y=e[21];let b;return e[22]!==y||e[23]!==u?(b=(0,Q.jsx)(M,{open:!0,onOpenChange:u,children:y}),e[22]=y,e[23]=u,e[24]=b):b=e[24],b};function ve(){let e=document.baseURI.split(`?`)[0];window.open(e,`_self`)}var ye=e=>{let t=(0,Z.c)(2),{reason:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`div`,{className:`font-mono text-center text-base text-(--red-11)`,children:(0,Q.jsx)(`p`,{children:n})}),t[0]=n,t[1]=r),r},be=e=>{let t=(0,Z.c)(7),{connection:n,className:r,children:i}=e,a;t[0]!==n.reason||t[1]!==n.state?(a=n.state===b.CLOSED&&(0,Q.jsx)(ye,{reason:n.reason}),t[0]=n.reason,t[1]=n.state,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==r||t[5]!==a?(o=(0,Q.jsxs)(`div`,{className:r,children:[i,a]}),t[3]=i,t[4]=r,t[5]=a,t[6]=o):o=t[6],o},xe=n(e=>e(s)||!C(e(x).state)),Se=e=>{let t=(0,Z.c)(22),{appConfig:n,hideHeader:i}=e,{setCells:o}=a(),{sendComponentValues:s}=se(),c;t[0]===s?c=t[1]:(c=()=>(m.INSTANCE.start(s),Ce),t[0]=s,t[1]=c);let h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=[],t[2]=h):h=t[2],(0,ge.useEffect)(c,h);let g;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(g=y(),t[3]=g):g=t[3];let _;t[4]===o?_=t[5]:(_={autoInstantiate:!0,setCells:o,sessionId:g},t[4]=o,t[5]=_);let{connection:v,reconnect:b}=f(_),x=r(l),S;if(t[6]===Symbol.for(`react.memo_cache_sentinel`)){bb0:{if(typeof window>`u`){S=null;break bb0}let e=new URL(window.location.href);if(!e.searchParams.has(`file`)){S=null;break bb0}e.searchParams.delete(`file`);let t=e.searchParams.toString();S=t?`${e.pathname}?${t}`:e.pathname}t[6]=S}else S=t[6];let C=S,T;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Q.jsx)(_e,{}),t[7]=T):T=t[7];let E=i?`hidden`:`sm:pt-8`,D;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(D=C&&(0,Q.jsx)(`div`,{className:`flex items-center px-6 pt-4 sm:-mt-8`,children:(0,Q.jsxs)(`a`,{href:C,"aria-label":`Back to gallery`,className:w(I({variant:`text`,size:`sm`}),`gap-2 px-0 text-muted-foreground hover:text-foreground`),children:[(0,Q.jsx)(ae,{className:`size-4`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:`Back`})]})}),t[8]=D):D=t[8];let O;t[9]!==v||t[10]!==E?(O=(0,Q.jsx)(be,{connection:v,className:E,children:D}),t[9]=v,t[10]=E,t[11]=O):O=t[11];let k;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(z,{className:`mx-auto`}),(0,Q.jsx)(`p`,{className:`text-center text-sm text-muted-foreground mt-2`,children:`Connecting...`})]}),t[12]=k):k=t[12];let A;t[13]===n?A=t[14]:(A=(0,Q.jsx)(p,{requires:xe,delay:2e3,fallback:k,children:(0,Q.jsx)(d,{appConfig:n,mode:`read`})}),t[13]=n,t[14]=A);let j;return t[15]!==n.width||t[16]!==v||t[17]!==x||t[18]!==b||t[19]!==A||t[20]!==O?(j=(0,Q.jsxs)(u,{connection:v,isRunning:x,width:n.width,onReconnect:b,children:[T,O,A]}),t[15]=n.width,t[16]=v,t[17]=x,t[18]=b,t[19]=A,t[20]=O,t[21]=j):j=t[21],j};function Ce(){m.INSTANCE.stop()}var we=()=>{let e=(0,Z.c)(3),t=r(o);if(!S()||!t)return null;let n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(`span`,{children:[`Static`,` `,(0,Q.jsx)(`a`,{href:v.githubPage,target:`_blank`,rel:`noreferrer`,className:`text-(--sky-11) font-medium underline`,children:`marimo`}),` `,`notebook - Run or edit for full interactivity`]}),e[0]=n):n=e[0];let i;return e[1]===t?i=e[2]:(i=(0,Q.jsxs)(`div`,{className:`px-4 py-2 bg-(--sky-2) border-b border-(--sky-7) text-(--sky-11) flex justify-between items-center gap-4 print:hidden text-sm`,"data-testid":`static-notebook-banner`,children:[n,(0,Q.jsx)(`span`,{className:`shrink-0`,children:(0,Q.jsx)(Te,{code:t})})]}),e[1]=t,e[2]=i),i},Te=e=>{let t=(0,Z.c)(44),{code:n}=e,r=ie.basename(X()||`notebook.py`),[i]=_(),a=i.sharing?.molab??!0,o=Ee(window.location.href,r),s=o!==r,c=ce(o),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(K,{asChild:!0,children:(0,Q.jsx)(L,{"data-testid":`static-notebook-dialog-trigger`,variant:`outline`,size:`xs`,children:`Run or Edit`})}),t[0]=l):l=t[0];let u;t[1]===r?u=t[2]:(u=(0,Q.jsx)(q,{children:r}),t[1]=r,t[2]=u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(`a`,{href:v.githubPage,target:`_blank`,rel:`noreferrer`,className:`text-(--sky-11) hover:underline font-medium`,children:`marimo`}),t[3]=d):d=t[3];let f=s?`Run it`:`Download it, then run it`,p;t[4]===f?p=t[5]:(p=(0,Q.jsxs)(`p`,{children:[`This is a static`,` `,d,` `,`notebook. `,f,` `,`locally for full interactivity.`]}),t[4]=f,t[5]=p);let m;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsxs)(ne,{"aria-label":`Package manager`,children:[(0,Q.jsx)(P,{value:`uv`,children:`uv`}),(0,Q.jsx)(P,{value:`pip`,children:`pip`}),(0,Q.jsx)(P,{value:`conda`,children:`conda`})]}),t[6]=m):m=t[6];let h=`uvx marimo edit --sandbox ${c}`,g;t[7]===h?g=t[8]:(g=(0,Q.jsx)(F,{value:`uv`,children:(0,Q.jsx)($,{command:h})}),t[7]=h,t[8]=g);let y=`pip install marimo\nmarimo edit ${c}`,b;t[9]===y?b=t[10]:(b=(0,Q.jsx)(F,{value:`pip`,children:(0,Q.jsx)($,{command:y})}),t[9]=y,t[10]=b);let x=`conda install -c conda-forge marimo\nmarimo edit ${c}`,S;t[11]===x?S=t[12]:(S=(0,Q.jsx)(F,{value:`conda`,children:(0,Q.jsx)($,{command:x})}),t[11]=x,t[12]=S);let C;t[13]!==b||t[14]!==S||t[15]!==g?(C=(0,Q.jsxs)(re,{defaultValue:`uv`,children:[m,g,b,S]}),t[13]=b,t[14]=S,t[15]=g,t[16]=C):C=t[16];let w;t[17]!==n||t[18]!==a?(w=a&&(0,Q.jsx)(De,{code:n}),t[17]=n,t[18]=a,t[19]=w):w=t[19];let T;t[20]!==C||t[21]!==w||t[22]!==p?(T=(0,Q.jsx)(W,{asChild:!0,children:(0,Q.jsxs)(`div`,{className:`pt-3 text-left space-y-3`,children:[p,C,w]})}),t[20]=C,t[21]=w,t[22]=p,t[23]=T):T=t[23];let E;t[24]!==T||t[25]!==u?(E=(0,Q.jsxs)(U,{children:[u,T]}),t[24]=T,t[25]=u,t[26]=E):E=t[26];let D;t[27]===n?D=t[28]:(D=async()=>{await J(n),Y({title:`Copied to clipboard`})},t[27]=n,t[28]=D);let O;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsx)(R,{className:`w-3 h-3 mr-2`}),t[29]=O):O=t[29];let k;t[30]===D?k=t[31]:(k=(0,Q.jsxs)(L,{"data-testid":`copy-static-notebook-dialog-button`,variant:`outline`,size:`sm`,onClick:D,children:[O,`Copy code`]}),t[30]=D,t[31]=k);let A;t[32]!==n||t[33]!==r?(A=()=>{te(new Blob([n],{type:`text/plain`}),r)},t[32]=n,t[33]=r,t[34]=A):A=t[34];let j;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(ee,{className:`w-3 h-3 mr-2`}),t[35]=j):j=t[35];let M;t[36]===A?M=t[37]:(M=(0,Q.jsxs)(L,{"data-testid":`download-static-notebook-dialog-button`,variant:`outline`,size:`sm`,onClick:A,children:[j,`Download`]}),t[36]=A,t[37]=M);let N;t[38]!==k||t[39]!==M?(N=(0,Q.jsxs)(`div`,{className:`flex gap-3 pt-2`,children:[k,M]}),t[38]=k,t[39]=M,t[40]=N):N=t[40];let I;return t[41]!==E||t[42]!==N?(I=(0,Q.jsxs)(H,{children:[l,(0,Q.jsxs)(G,{children:[E,N]})]}),t[41]=E,t[42]=N,t[43]=I):I=t[43],I};function Ee(e,t){let n=new URL(e);if(n.protocol!==`http:`&&n.protocol!==`https:`)return t;let r=n.pathname.endsWith(`.html`)&&n.search===``,i=n.protocol===`https:`&&(n.hostname===`marimo.app`||n.hostname===`links.marimo.app`||n.hostname===`static.marimo.app`&&n.pathname.startsWith(`/static`)||n.pathname.includes(`/notebooks/nb`));return!r&&!i?t:(n.hash=``,n.href)}var $=e=>{let t=(0,Z.c)(10),{command:n}=e,r;t[0]===n?r=t[1]:(r=(0,Q.jsx)(`pre`,{className:`p-3 pr-10 font-mono text-(--sky-11) leading-relaxed whitespace-pre-wrap break-all`,children:n}),t[0]=n,t[1]=r);let i;t[2]===n?i=t[3]:(i=async()=>{await J(n),Y({title:`Command copied to clipboard`})},t[2]=n,t[3]=i);let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(R,{className:`w-3.5 h-3.5`}),t[4]=a):a=t[4];let o;t[5]===i?o=t[6]:(o=(0,Q.jsx)(L,{"aria-label":`Copy command`,className:`absolute right-2 top-2`,variant:`ghost`,size:`icon`,onClick:i,children:a}),t[5]=i,t[6]=o);let s;return t[7]!==r||t[8]!==o?(s=(0,Q.jsxs)(`div`,{className:`relative rounded-lg border bg-(--sky-2) border-(--sky-7)`,children:[r,o]}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s},De=e=>{let t=(0,Z.c)(8),{code:n}=e,r;t[0]===n?r=t[1]:(r=le({code:n,baseUrl:`${v.molab}/new`}),t[0]=n,t[1]=r);let i=r,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(pe,{size:12,strokeWidth:1.5,className:`mr-1.5 mt-px text-(--grass-11)`}),t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=(0,Q.jsx)(L,{asChild:!0,variant:`outline`,size:`xs`,className:`shrink-0`,children:(0,Q.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,children:[a,`Open in molab`]})}),t[3]=i,t[4]=o);let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsxs)(`p`,{className:`text-sm text-(--sky-12)`,children:[`Run this notebook in `,(0,Q.jsx)(`span`,{className:`font-semibold`,children:`molab`}),`, marimo's cloud-hosted notebook platform.`]}),t[5]=s):s=t[5];let c;return t[6]===o?c=t[7]:(c=(0,Q.jsxs)(`div`,{className:`pt-3 border-t flex gap-2 items-center`,children:[o,s]}),t[6]=o,t[7]=c),c},Oe=e=>{let t=(0,Z.c)(17),n=r(fe).kind,i=n===`static`||n===`wasm`,{selectedLayout:a}=B(),o;t[0]===a?o=t[1]:(o=V({selectedLayout:a,isReading:!0,searchParams:new URLSearchParams(window.location.search)}),t[0]=a,t[1]=o);let s=i&&o===`slides`,c;t[2]===s?c=t[3]:(c=!s&&(0,Q.jsx)(we,{}),t[2]=s,t[3]=c);let l;t[4]!==s||t[5]!==e.appConfig?(l=(0,Q.jsx)(Se,{appConfig:e.appConfig,hideHeader:s}),t[4]=s,t[5]=e.appConfig,t[6]=l):l=t[6];let u;t[7]!==i||t[8]!==s?(u=i&&!s&&(0,Q.jsx)(ke,{}),t[7]=i,t[8]=s,t[9]=u):u=t[9];let d;t[10]!==c||t[11]!==l||t[12]!==u?(d=(0,Q.jsxs)(de,{children:[c,l,u]}),t[10]=c,t[11]=l,t[12]=u,t[13]=d):d=t[13];let f;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(N,{}),t[14]=f):f=t[14];let p;return t[15]===d?p=t[16]:(p=(0,Q.jsx)(h,{children:(0,Q.jsxs)(ue,{direction:`horizontal`,autoSaveId:`marimo:chrome:v1:run1`,children:[d,f]})}),t[15]=d,t[16]=p),p},ke=()=>{let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(`div`,{className:`fixed bottom-0 right-0 z-50 print:hidden`,"data-testid":`watermark`,children:(0,Q.jsxs)(`a`,{href:v.githubPage,target:`_blank`,rel:`noreferrer`,className:`text-sm text-(--grass-11) font-bold tracking-wide transition-colors bg-(--grass-4) hover:bg-(--grass-5) border-t border-l border-(--grass-8) px-3 py-1 rounded-tl-md flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{children:`made with marimo`}),(0,Q.jsx)(me,{className:`h-4 w-auto`})]})}),e[0]=t):t=e[0],t};export{Oe as default};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r}from"./useEvent-Dfcbgjhg.js";import{t as i}from"./react-DVplv7_D.js";import{D as a,La as o,g as s,oo as c,x as l}from"./cells-T9_Y4Jlv.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./panels-DVvPamWL.js";import{t as g}from"./compiler-runtime-BrajqUja.js";import{C as _}from"./config-DGX7JYor.js";import{r as v}from"./utils-B4K466FK.js";import{t as y}from"./session-B8Y-GJnS.js";import{T as b,_ as x,l as S,p as C}from"./config-DzdxZb17.js";import{t as w}from"./cn-ldLVeaqm.js";import{t as T}from"./jsx-runtime-B74pBk57.js";import{a as E,c as D,i as O,l as k,n as A,s as j,t as M}from"./alert-dialog-C-sWmKva.js";import{F as N,Ft as ee}from"./JsonOutput-Pm6OCP3J.js";import{n as te}from"./download-C8Gw-D0Y.js";import{i as P,n as F,r as ne,t as re}from"./tabs-CY8E4r9U.js";import{n as I,t as L}from"./button-D8gVKwe-.js";import{n as ie}from"./paths-bkIFVj8h.js";import{t as ae}from"./arrow-left-BaPN-xbg.js";import{t as R}from"./copy-Djr5m5ac.js";import{t as oe}from"./house-CpsMWsLL.js";import{t as z}from"./spinner-DyNE-o8o.js";import{l as B,s as V}from"./readonly-python-code-B81AjzXM.js";import{Jt as H,Qt as U,Xt as W,Yt as G,nn as K,tn as q}from"./input-BZdRe7pb.js";import{n as J}from"./copy-KlhazlhB.js";import{t as Y}from"./use-toast-Wu434mLr.js";import{r as se}from"./requests-lt0JK8Jt.js";import{t as ce}from"./shell-Fj8a65ii.js";import{t as le}from"./share-BZW3tzEX.js";import{a as X}from"./cell-link-DFqfW-Ym.js";import{n as ue,t as de}from"./react-resizable-panels.browser.esm-Dbe0MrFr.js";import{n as fe}from"./code-visibility-CV3S4xuf.js";import{n as pe,t as me}from"./marimo-icons-CqliHyTr.js";import{t as he}from"./state-Ck7FMD5A.js";var ge=e(i(),1),Z=g(),Q=T(),_e=()=>{let e=(0,Z.c)(25),[n,r]=t(he);if(n===null)return null;let i;e[0]===n?i=e[1]:(i=async()=>{try{await navigator.clipboard.writeText(n),Y({title:`Copied to clipboard`,description:`Error details have been copied to your clipboard.`})}catch{Y({title:`Failed to copy`,description:`Could not copy to clipboard.`,variant:`danger`})}},e[0]=n,e[1]=i);let a=i,o;e[2]===r?o=e[3]:(o=()=>{r(null)},e[2]=r,e[3]=o);let s=o,l=ve,u;e[4]===s?u=e[5]:(u=e=>!e&&s(),e[4]=s,e[5]=u);let d;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsxs)(D,{children:[(0,Q.jsxs)(k,{className:`flex items-center gap-2 text-destructive`,children:[(0,Q.jsx)(c,{className:`h-5 w-5`}),`Kernel Startup Failed`]}),(0,Q.jsx)(E,{children:`The kernel failed to start. This usually happens when the package manager can't install your notebook's dependencies.`})]}),e[6]=d):d=e[6];let f;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(`span`,{className:`text-sm font-medium text-muted-foreground`,children:`Error Details`}),e[7]=f):f=e[7];let p;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(R,{className:`h-3 w-3`}),e[8]=p):p=e[8];let m;e[9]===a?m=e[10]:(m=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[f,(0,Q.jsxs)(L,{variant:`outline`,size:`xs`,onClick:a,className:`flex items-center gap-1`,children:[p,`Copy`]})]}),e[9]=a,e[10]=m);let h;e[11]===n?h=e[12]:(h=(0,Q.jsx)(`pre`,{className:`bg-muted p-4 rounded-md text-sm font-mono overflow-auto max-h-80`,children:n}),e[11]=n,e[12]=h);let g;e[13]!==m||e[14]!==h?(g=(0,Q.jsxs)(`div`,{className:`my-4 overflow-hidden`,children:[m,h]}),e[13]=m,e[14]=h,e[15]=g):g=e[15];let _;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsxs)(L,{variant:`outline`,onClick:l,className:`flex items-center gap-2`,children:[(0,Q.jsx)(oe,{className:`h-4 w-4`}),`Return to Home`]}),e[16]=_):_=e[16];let v;e[17]===s?v=e[18]:(v=(0,Q.jsxs)(j,{children:[_,(0,Q.jsx)(A,{onClick:s,children:`Dismiss`})]}),e[17]=s,e[18]=v);let y;e[19]!==v||e[20]!==g?(y=(0,Q.jsxs)(O,{className:`max-w-2xl`,children:[d,g,v]}),e[19]=v,e[20]=g,e[21]=y):y=e[21];let b;return e[22]!==y||e[23]!==u?(b=(0,Q.jsx)(M,{open:!0,onOpenChange:u,children:y}),e[22]=y,e[23]=u,e[24]=b):b=e[24],b};function ve(){let e=document.baseURI.split(`?`)[0];window.open(e,`_self`)}var ye=e=>{let t=(0,Z.c)(2),{reason:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`div`,{className:`font-mono text-center text-base text-(--red-11)`,children:(0,Q.jsx)(`p`,{children:n})}),t[0]=n,t[1]=r),r},be=e=>{let t=(0,Z.c)(7),{connection:n,className:r,children:i}=e,a;t[0]!==n.reason||t[1]!==n.state?(a=n.state===b.CLOSED&&(0,Q.jsx)(ye,{reason:n.reason}),t[0]=n.reason,t[1]=n.state,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==r||t[5]!==a?(o=(0,Q.jsxs)(`div`,{className:r,children:[i,a]}),t[3]=i,t[4]=r,t[5]=a,t[6]=o):o=t[6],o},xe=n(e=>e(s)||!C(e(x).state)),Se=e=>{let t=(0,Z.c)(22),{appConfig:n,hideHeader:i}=e,{setCells:o}=a(),{sendComponentValues:s}=se(),c;t[0]===s?c=t[1]:(c=()=>(m.INSTANCE.start(s),Ce),t[0]=s,t[1]=c);let h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=[],t[2]=h):h=t[2],(0,ge.useEffect)(c,h);let g;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(g=y(),t[3]=g):g=t[3];let _;t[4]===o?_=t[5]:(_={autoInstantiate:!0,setCells:o,sessionId:g},t[4]=o,t[5]=_);let{connection:v,reconnect:b}=f(_),x=r(l),S;if(t[6]===Symbol.for(`react.memo_cache_sentinel`)){bb0:{if(typeof window>`u`){S=null;break bb0}let e=new URL(window.location.href);if(!e.searchParams.has(`file`)){S=null;break bb0}e.searchParams.delete(`file`);let t=e.searchParams.toString();S=t?`${e.pathname}?${t}`:e.pathname}t[6]=S}else S=t[6];let C=S,T;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Q.jsx)(_e,{}),t[7]=T):T=t[7];let E=i?`hidden`:`sm:pt-8`,D;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(D=C&&(0,Q.jsx)(`div`,{className:`flex items-center px-6 pt-4 sm:-mt-8`,children:(0,Q.jsxs)(`a`,{href:C,"aria-label":`Back to gallery`,className:w(I({variant:`text`,size:`sm`}),`gap-2 px-0 text-muted-foreground hover:text-foreground`),children:[(0,Q.jsx)(ae,{className:`size-4`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:`Back`})]})}),t[8]=D):D=t[8];let O;t[9]!==v||t[10]!==E?(O=(0,Q.jsx)(be,{connection:v,className:E,children:D}),t[9]=v,t[10]=E,t[11]=O):O=t[11];let k;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(z,{className:`mx-auto`}),(0,Q.jsx)(`p`,{className:`text-center text-sm text-muted-foreground mt-2`,children:`Connecting...`})]}),t[12]=k):k=t[12];let A;t[13]===n?A=t[14]:(A=(0,Q.jsx)(p,{requires:xe,delay:2e3,fallback:k,children:(0,Q.jsx)(d,{appConfig:n,mode:`read`})}),t[13]=n,t[14]=A);let j;return t[15]!==n.width||t[16]!==v||t[17]!==x||t[18]!==b||t[19]!==A||t[20]!==O?(j=(0,Q.jsxs)(u,{connection:v,isRunning:x,width:n.width,onReconnect:b,children:[T,O,A]}),t[15]=n.width,t[16]=v,t[17]=x,t[18]=b,t[19]=A,t[20]=O,t[21]=j):j=t[21],j};function Ce(){m.INSTANCE.stop()}var we=()=>{let e=(0,Z.c)(3),t=r(o);if(!S()||!t)return null;let n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(`span`,{children:[`Static`,` `,(0,Q.jsx)(`a`,{href:v.githubPage,target:`_blank`,rel:`noreferrer`,className:`text-(--sky-11) font-medium underline`,children:`marimo`}),` `,`notebook - Run or edit for full interactivity`]}),e[0]=n):n=e[0];let i;return e[1]===t?i=e[2]:(i=(0,Q.jsxs)(`div`,{className:`px-4 py-2 bg-(--sky-2) border-b border-(--sky-7) text-(--sky-11) flex justify-between items-center gap-4 print:hidden text-sm`,"data-testid":`static-notebook-banner`,children:[n,(0,Q.jsx)(`span`,{className:`shrink-0`,children:(0,Q.jsx)(Te,{code:t})})]}),e[1]=t,e[2]=i),i},Te=e=>{let t=(0,Z.c)(44),{code:n}=e,r=ie.basename(X()||`notebook.py`),[i]=_(),a=i.sharing?.molab??!0,o=Ee(window.location.href,r),s=o!==r,c=ce(o),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(K,{asChild:!0,children:(0,Q.jsx)(L,{"data-testid":`static-notebook-dialog-trigger`,variant:`outline`,size:`xs`,children:`Run or Edit`})}),t[0]=l):l=t[0];let u;t[1]===r?u=t[2]:(u=(0,Q.jsx)(q,{children:r}),t[1]=r,t[2]=u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(`a`,{href:v.githubPage,target:`_blank`,rel:`noreferrer`,className:`text-(--sky-11) hover:underline font-medium`,children:`marimo`}),t[3]=d):d=t[3];let f=s?`Run it`:`Download it, then run it`,p;t[4]===f?p=t[5]:(p=(0,Q.jsxs)(`p`,{children:[`This is a static`,` `,d,` `,`notebook. `,f,` `,`locally for full interactivity.`]}),t[4]=f,t[5]=p);let m;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsxs)(ne,{"aria-label":`Package manager`,children:[(0,Q.jsx)(P,{value:`uv`,children:`uv`}),(0,Q.jsx)(P,{value:`pip`,children:`pip`}),(0,Q.jsx)(P,{value:`conda`,children:`conda`})]}),t[6]=m):m=t[6];let h=`uvx marimo edit --sandbox ${c}`,g;t[7]===h?g=t[8]:(g=(0,Q.jsx)(F,{value:`uv`,children:(0,Q.jsx)($,{command:h})}),t[7]=h,t[8]=g);let y=`pip install marimo\nmarimo edit ${c}`,b;t[9]===y?b=t[10]:(b=(0,Q.jsx)(F,{value:`pip`,children:(0,Q.jsx)($,{command:y})}),t[9]=y,t[10]=b);let x=`conda install -c conda-forge marimo\nmarimo edit ${c}`,S;t[11]===x?S=t[12]:(S=(0,Q.jsx)(F,{value:`conda`,children:(0,Q.jsx)($,{command:x})}),t[11]=x,t[12]=S);let C;t[13]!==b||t[14]!==S||t[15]!==g?(C=(0,Q.jsxs)(re,{defaultValue:`uv`,children:[m,g,b,S]}),t[13]=b,t[14]=S,t[15]=g,t[16]=C):C=t[16];let w;t[17]!==n||t[18]!==a?(w=a&&(0,Q.jsx)(De,{code:n}),t[17]=n,t[18]=a,t[19]=w):w=t[19];let T;t[20]!==C||t[21]!==w||t[22]!==p?(T=(0,Q.jsx)(W,{asChild:!0,children:(0,Q.jsxs)(`div`,{className:`pt-3 text-left space-y-3`,children:[p,C,w]})}),t[20]=C,t[21]=w,t[22]=p,t[23]=T):T=t[23];let E;t[24]!==T||t[25]!==u?(E=(0,Q.jsxs)(U,{children:[u,T]}),t[24]=T,t[25]=u,t[26]=E):E=t[26];let D;t[27]===n?D=t[28]:(D=async()=>{await J(n),Y({title:`Copied to clipboard`})},t[27]=n,t[28]=D);let O;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsx)(R,{className:`w-3 h-3 mr-2`}),t[29]=O):O=t[29];let k;t[30]===D?k=t[31]:(k=(0,Q.jsxs)(L,{"data-testid":`copy-static-notebook-dialog-button`,variant:`outline`,size:`sm`,onClick:D,children:[O,`Copy code`]}),t[30]=D,t[31]=k);let A;t[32]!==n||t[33]!==r?(A=()=>{te(new Blob([n],{type:`text/plain`}),r)},t[32]=n,t[33]=r,t[34]=A):A=t[34];let j;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(ee,{className:`w-3 h-3 mr-2`}),t[35]=j):j=t[35];let M;t[36]===A?M=t[37]:(M=(0,Q.jsxs)(L,{"data-testid":`download-static-notebook-dialog-button`,variant:`outline`,size:`sm`,onClick:A,children:[j,`Download`]}),t[36]=A,t[37]=M);let N;t[38]!==k||t[39]!==M?(N=(0,Q.jsxs)(`div`,{className:`flex gap-3 pt-2`,children:[k,M]}),t[38]=k,t[39]=M,t[40]=N):N=t[40];let I;return t[41]!==E||t[42]!==N?(I=(0,Q.jsxs)(H,{children:[l,(0,Q.jsxs)(G,{children:[E,N]})]}),t[41]=E,t[42]=N,t[43]=I):I=t[43],I};function Ee(e,t){let n=new URL(e);if(n.protocol!==`http:`&&n.protocol!==`https:`)return t;let r=n.pathname.endsWith(`.html`)&&n.search===``,i=n.protocol===`https:`&&(n.hostname===`marimo.app`||n.hostname===`links.marimo.app`||n.hostname===`static.marimo.app`&&n.pathname.startsWith(`/static`)||n.pathname.includes(`/notebooks/nb`));return!r&&!i?t:(n.hash=``,n.href)}var $=e=>{let t=(0,Z.c)(10),{command:n}=e,r;t[0]===n?r=t[1]:(r=(0,Q.jsx)(`pre`,{className:`p-3 pr-10 font-mono text-(--sky-11) leading-relaxed whitespace-pre-wrap break-all`,children:n}),t[0]=n,t[1]=r);let i;t[2]===n?i=t[3]:(i=async()=>{await J(n),Y({title:`Command copied to clipboard`})},t[2]=n,t[3]=i);let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(R,{className:`w-3.5 h-3.5`}),t[4]=a):a=t[4];let o;t[5]===i?o=t[6]:(o=(0,Q.jsx)(L,{"aria-label":`Copy command`,className:`absolute right-2 top-2`,variant:`ghost`,size:`icon`,onClick:i,children:a}),t[5]=i,t[6]=o);let s;return t[7]!==r||t[8]!==o?(s=(0,Q.jsxs)(`div`,{className:`relative rounded-lg border bg-(--sky-2) border-(--sky-7)`,children:[r,o]}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s},De=e=>{let t=(0,Z.c)(8),{code:n}=e,r;t[0]===n?r=t[1]:(r=le({code:n,baseUrl:`${v.molab}/new`}),t[0]=n,t[1]=r);let i=r,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(pe,{size:12,strokeWidth:1.5,className:`mr-1.5 mt-px text-(--grass-11)`}),t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=(0,Q.jsx)(L,{asChild:!0,variant:`outline`,size:`xs`,className:`shrink-0`,children:(0,Q.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,children:[a,`Open in molab`]})}),t[3]=i,t[4]=o);let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsxs)(`p`,{className:`text-sm text-(--sky-12)`,children:[`Run this notebook in `,(0,Q.jsx)(`span`,{className:`font-semibold`,children:`molab`}),`, marimo's cloud-hosted notebook platform.`]}),t[5]=s):s=t[5];let c;return t[6]===o?c=t[7]:(c=(0,Q.jsxs)(`div`,{className:`pt-3 border-t flex gap-2 items-center`,children:[o,s]}),t[6]=o,t[7]=c),c},Oe=e=>{let t=(0,Z.c)(17),n=r(fe).kind,i=n===`static`||n===`wasm`,{selectedLayout:a}=B(),o;t[0]===a?o=t[1]:(o=V({selectedLayout:a,isReading:!0,searchParams:new URLSearchParams(window.location.search)}),t[0]=a,t[1]=o);let s=i&&o===`slides`,c;t[2]===s?c=t[3]:(c=!s&&(0,Q.jsx)(we,{}),t[2]=s,t[3]=c);let l;t[4]!==s||t[5]!==e.appConfig?(l=(0,Q.jsx)(Se,{appConfig:e.appConfig,hideHeader:s}),t[4]=s,t[5]=e.appConfig,t[6]=l):l=t[6];let u;t[7]!==i||t[8]!==s?(u=i&&!s&&(0,Q.jsx)(ke,{}),t[7]=i,t[8]=s,t[9]=u):u=t[9];let d;t[10]!==c||t[11]!==l||t[12]!==u?(d=(0,Q.jsxs)(de,{children:[c,l,u]}),t[10]=c,t[11]=l,t[12]=u,t[13]=d):d=t[13];let f;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(N,{}),t[14]=f):f=t[14];let p;return t[15]===d?p=t[16]:(p=(0,Q.jsx)(h,{children:(0,Q.jsxs)(ue,{direction:`horizontal`,autoSaveId:`marimo:chrome:v1:run1`,children:[d,f]})}),t[15]=d,t[16]=p),p},ke=()=>{let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(`div`,{className:`fixed bottom-0 right-0 z-50 print:hidden`,"data-testid":`watermark`,children:(0,Q.jsxs)(`a`,{href:v.githubPage,target:`_blank`,rel:`noreferrer`,className:`text-sm text-(--grass-11) font-bold tracking-wide transition-colors bg-(--grass-4) hover:bg-(--grass-5) border-t border-l border-(--grass-8) px-3 py-1 rounded-tl-md flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{children:`made with marimo`}),(0,Q.jsx)(me,{className:`h-4 w-auto`})]})}),e[0]=t):t=e[0],t};export{Oe 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-Bu8_lPMx.js"></script>
69
+ <script type="module" crossorigin src="./assets/index-oc8deM9X.js"></script>
70
70
  <link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-B0Z9INg1.js">
71
71
  <link rel="modulepreload" crossorigin href="./assets/react-DVplv7_D.js">
72
72
  <link rel="modulepreload" crossorigin href="./assets/compiler-runtime-BrajqUja.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/frontend",
3
- "version": "0.25.3-dev60",
3
+ "version": "0.25.3-dev62",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -2,10 +2,10 @@
2
2
 
3
3
  import { describe, expect, it } from "vitest";
4
4
  import { attachments } from "../resources/attachments";
5
- import { createReducer } from "@marimo-team/client/reducer";
5
+ import { createNotebookReducer } from "@marimo-team/client";
6
6
  import { fixtureEvents } from "./fixtures";
7
7
 
8
- const reducer = createReducer({ attachments });
8
+ const reducer = createNotebookReducer({ attachments });
9
9
  const snapshot = fixtureEvents("notebook-events.sse");
10
10
  const records = snapshot.flatMap((event) =>
11
11
  event.event === "attachment" ? [event.data.attachment] : [],
@@ -3,10 +3,10 @@
3
3
  import { describe, expect, it } from "vitest";
4
4
  import type * as Protocol from "@marimo-team/client/protocol";
5
5
  import { document } from "../resources/document";
6
- import { createReducer } from "@marimo-team/client/reducer";
6
+ import { createNotebookReducer } from "@marimo-team/client";
7
7
  import { fixtureEvents } from "./fixtures";
8
8
 
9
- const reducer = createReducer({ document });
9
+ const reducer = createNotebookReducer({ document });
10
10
  const snapshot = fixtureEvents("notebook-events.sse");
11
11
  const edits = fixtureEvents("edits.sse");
12
12
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { Logger } from "@/utils/Logger";
4
4
  import type { Attachment, NotebookOutput } from "@marimo-team/client/protocol";
5
- import { createReducer } from "@marimo-team/client/reducer";
5
+ import { createNotebookReducer } from "@marimo-team/client";
6
6
  import { type Atom, atom, type createStore } from "jotai/vanilla";
7
7
  import {
8
8
  type ConnectionStatus,
@@ -69,7 +69,7 @@ export function createNotebookClient(store: ReturnType<typeof createStore>) {
69
69
  state: ConnectionState.NOT_STARTED,
70
70
  });
71
71
  // One atom holds the whole stream, which resource atoms derive from.
72
- const reducer = createReducer({ document, attachments });
72
+ const reducer = createNotebookReducer({ document, attachments });
73
73
  const streamAtom = atom(reducer.initial);
74
74
  // A resumed stream is live, but presence waits for this connection's ready.
75
75
  const readyAtom = atom(false);
@@ -1,10 +1,13 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
 
3
3
  import type { Attachment } from "@marimo-team/client/protocol";
4
- import type { Resource } from "@marimo-team/client/reducer";
4
+ import type { NotebookResource } from "@marimo-team/client";
5
5
 
6
6
  /** Attachment records retained with the stream's resume cursor. */
7
- export const attachments: Resource<readonly Attachment[], "attachment"> = {
7
+ export const attachments: NotebookResource<
8
+ readonly Attachment[],
9
+ "attachment"
10
+ > = {
8
11
  initial: [],
9
12
  on: {
10
13
  attachment: (state, { data: { attachment } }) =>
@@ -1,7 +1,7 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
 
3
3
  import type * as Protocol from "@marimo-team/client/protocol";
4
- import type { Resource } from "@marimo-team/client/reducer";
4
+ import type { NotebookResource } from "@marimo-team/client";
5
5
 
6
6
  /**
7
7
  * The notebook's content at one revision.
@@ -58,7 +58,7 @@ function publish(
58
58
  return { current: { revision, cells }, pending: null };
59
59
  }
60
60
 
61
- export const document: Resource<DocumentState, "cell" | "document"> = {
61
+ export const document: NotebookResource<DocumentState, "cell" | "document"> = {
62
62
  initial: { current: null, pending: null },
63
63
  on: {
64
64
  cell: (state, { data }) => {