@marimo-team/frontend 0.23.2-dev34 → 0.23.2-dev37

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 (28) hide show
  1. package/dist/assets/JsonOutput-CcRaYhT-.js +49 -0
  2. package/dist/assets/{add-connection-dialog-CvW9PqJP.js → add-connection-dialog-dNJgn8Ox.js} +1 -1
  3. package/dist/assets/{agent-panel-BY93mGPz.js → agent-panel-CZV8iRUC.js} +1 -1
  4. package/dist/assets/{cell-editor-BuWf57Zv.js → cell-editor-OuSBQcHa.js} +1 -1
  5. package/dist/assets/{column-preview-C2YkNo17.js → column-preview-hHmxmCnB.js} +1 -1
  6. package/dist/assets/{command-palette-CuOexXE2.js → command-palette-BlNedegf.js} +1 -1
  7. package/dist/assets/{edit-page-CbFov0Yo.js → edit-page-Cw8d_f2S.js} +3 -3
  8. package/dist/assets/{file-explorer-panel-C8zn6wBR.js → file-explorer-panel-CxfXG24m.js} +1 -1
  9. package/dist/assets/{form-At6i3Yzy.js → form-3fPAWHbK.js} +1 -1
  10. package/dist/assets/{hooks-VGJ78Nrp.js → hooks-B4ys0c0n.js} +1 -1
  11. package/dist/assets/{index-2q53zW3f.js → index-lpZP7WFc.js} +3 -3
  12. package/dist/assets/{layout-CXXNDlTM.js → layout-Dz6l5gDf.js} +1 -1
  13. package/dist/assets/{panels-CEjP9uzR.js → panels-DwDu5SGI.js} +1 -1
  14. package/dist/assets/{run-page-DoZQ-xVU.js → run-page-C2kQLw9h.js} +1 -1
  15. package/dist/assets/{scratchpad-panel-DlYvyY5N.js → scratchpad-panel-BN9Sv2Hh.js} +1 -1
  16. package/dist/assets/{session-panel-CmlXm8pu.js → session-panel-CMI4faW3.js} +1 -1
  17. package/dist/assets/{state-Bhr3ApM1.js → state-BoK4XWzN.js} +1 -1
  18. package/dist/assets/{useNotebookActions-Dk7vM9RB.js → useNotebookActions-D_eNWvNH.js} +1 -1
  19. package/dist/index.html +5 -5
  20. package/package.json +1 -1
  21. package/src/components/data-table/__tests__/sentinel-cell.test.tsx +83 -0
  22. package/src/components/data-table/__tests__/utils.test.ts +128 -0
  23. package/src/components/data-table/column-header.tsx +11 -2
  24. package/src/components/data-table/columns.tsx +16 -2
  25. package/src/components/data-table/sentinel-cell.tsx +90 -0
  26. package/src/components/data-table/types.ts +23 -0
  27. package/src/components/data-table/utils.ts +74 -1
  28. package/dist/assets/JsonOutput-VCohkYHD.js +0 -49
@@ -1 +1 @@
1
- import{s as ze}from"./chunk-LvLJmgfZ.js";import{d as $,l as mt,p as pt,u as me}from"./useEvent-D91BmmQi.js";import{t as ut}from"./react-Bj1aDYRI.js";import{E as Me,En as ft,Jt as xt,Rr as yt,Ti as pe,Tn as kt,_ as bt,cr as wt,ct as We,h as _e,kn as jt,ot as gt,pr as vt,st as Ct,t as zt,ur as Mt,vr as Wt,wn as _t}from"./cells-CkQXmtbU.js";import{t as N}from"./compiler-runtime-B3qBwwSJ.js";import{n as Nt,x as St}from"./ai-model-dropdown-CHNX-Yvn.js";import{_ as H,d as Ne}from"./useEventListener-BR0C1MaI.js";import{y as Dt}from"./utils-DIGrmLDO.js";import{n as S,t as Se}from"./constants-DMpttj8Q.js";import{S as ue,h as At,n as Pt,o as It,x as Et}from"./config-Calf6e81.js";import{n as Lt}from"./switch-CqJGGLBT.js";import{t as Tt}from"./jsx-runtime-BqBOg78p.js";import{o as Rt}from"./alert-dialog-BGBdrcqJ.js";import{a as $t,c as fe,o as xe,s as Ht}from"./popover-UExmgBsf.js";import{a as qt,c as Ut,i as Ot,n as Vt,r as Bt,s as Ft,t as Yt}from"./select-5i7URBEn.js";import{gt as Kt}from"./JsonOutput-VCohkYHD.js";import{c as De,d as ye,n as Gt,o as Jt,r as ke,t as Qt}from"./download-aayD25Wi.js";import{m as Xt}from"./form-At6i3Yzy.js";import{t as Ae}from"./tooltip-Gcwqb_SK.js";import{r as Pe,t as q}from"./button-D9nb17Rw.js";import{i as Zt,r as ea,t as Ie}from"./strings-md4mFbOQ.js";import{r as U}from"./requests-DIwGYs0l.js";import{t as b}from"./createLucideIcon-D5guW7EU.js";import{A as Ee,a as Le,i as Te,j as ta,k as aa,u as Re}from"./layout-CXXNDlTM.js";import{t as be}from"./check-BH35Ndha.js";import{n as oa}from"./maps-C48Oksn0.js";import{r as na}from"./useCellActionButton-GNljpGS_.js";import{t as $e}from"./copy-BwrPA9zQ.js";import{t as sa}from"./eye-off-n1Li95bE.js";import{t as ae}from"./file-BrdxGLRX.js";import{t as la}from"./github-BKS_2Qwn.js";import{n as ia,r as ra,t as da}from"./youtube-CXGBiuia.js";import{i as ca,n as He}from"./add-connection-dialog-CvW9PqJP.js";import{n as ha,t as ma}from"./square-k2WwJdZy.js";import{t as pa}from"./image-HpSc22eh.js";import{t as ua}from"./link-DlqtQzll.js";import{r as fa}from"./input-2egRGOhT.js";import{t as xa}from"./settings-C_KZ1Eue.js";import{t as ya}from"./sparkles-BRTQ46qC.js";import{y as ka}from"./textarea-jLEyGvlo.js";import{t as D}from"./use-toast-PYIpV284.js";import{n as qe,t as ba}from"./paths-DsQUzvvb.js";import{o as wa}from"./session-DdhIEena.js";import{n as O}from"./copy-BnK_ki61.js";import{r as ja}from"./useRunCells-BGxIfw3R.js";import{a as Ue,c as Oe,i as Ve,n as Be,r as Fe}from"./dialog-CqE8CV1Y.js";import{n as we}from"./ImperativeModal-CAFE3UV7.js";import{r as ga,t as Ye}from"./share-CJEPnWjm.js";import{a as va}from"./cell-link-CeI1GPxX.js";import{a as Ca}from"./renderShortcut-B-72v1dC.js";import{t as za}from"./icons-C66kZH_4.js";import{n as Ke}from"./marimo-icons-Ce24dQVN.js";import{t as Ma}from"./links-DhwG_EVu.js";import{r as Wa,t as Ge}from"./hooks-VGJ78Nrp.js";import{t as Je}from"./types-DOn3dVLe.js";var _a=b("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),Na=b("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),Qe=b("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),Xe=b("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]),Ze=b("diamond-plus",[["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",key:"1ey20j"}],["path",{d:"M8 12h8",key:"1wcyev"}]]),Sa=b("fast-forward",[["path",{d:"M12 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 12 18z",key:"b19h5q"}],["path",{d:"M2 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 2 18z",key:"h7h5ge"}]]),Da=b("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]),Aa=b("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),et=b("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),Pa=b("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),Ia=b("notebook",[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M16 2v20",key:"rotuqe"}]]),Ea=b("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),tt=b("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),La=b("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),Ta=b("square-power",[["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M7.998 9.003a5 5 0 1 0 8-.005",key:"1pek45"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),at=b("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),je=N(),A=ze(ut(),1),a=ze(Tt(),1);function Ra(){return"uvx marimo@latest"}function $a(t,e,n){let o=n?" --with-token":"",s=`${Ra()} pair prompt --url '${e}'${o}`;switch(t){case"claude":return`claude "$(${s} --claude)"`;case"codex":return`codex "$(${s} --codex)"`;case"opencode":return`opencode "$(${s} --opencode)"`;default:ea(t)}}function Ha(t){return t.length<=4?"****":`${"*".repeat(Math.min(t.length-4,8))}${t.slice(-4)}`}var qa="npx skills add marimo-team/marimo-pair";function Ua(){let t=(0,je.c)(2),[e,n]=(0,A.useState)(null),o,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{fetch(Pt("/auth/token").href,{headers:Lt.headers()}).then(Oa).then(r=>n((r==null?void 0:r.token)??null)).catch(()=>n(null))},s=[],t[0]=o,t[1]=s):(o=t[0],s=t[1]),(0,A.useEffect)(o,s),e}function Oa(t){return t.ok?t.json():null}const Va=t=>{let e=(0,je.c)(32),{onClose:n}=t,[o,s]=(0,A.useState)("claude"),r=It(),i=Ua(),l=!!i,d;e[0]!==o||e[1]!==l||e[2]!==r.httpURL?(d=$a(o,r.httpURL.toString(),l),e[0]=o,e[1]=l,e[2]=r.httpURL,e[3]=d):d=e[3];let c=d,p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsx)(Oe,{children:"Pair with an agent"}),e[4]=p):p=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=(0,a.jsxs)(Ue,{children:[p,(0,a.jsxs)(Fe,{children:["Use an AI coding agent to pair-program on this notebook."," ",(0,a.jsx)("a",{href:"https://links.marimo.app/marimo-pair",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Learn more"}),"."]})]}),e[5]=u):u=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"1. Install the skill"}),(0,a.jsx)(V,{command:qa})]}),e[6]=h):h=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=(0,a.jsx)("span",{className:"text-sm font-medium",children:"2. Run in your terminal"}),e[7]=f):f=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=_=>s(_),e[8]=x):x=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=(0,a.jsxs)(Ht,{className:"w-full",children:[(0,a.jsx)(fe,{value:"claude",className:"flex-1",children:"Claude"}),(0,a.jsx)(fe,{value:"codex",className:"flex-1",children:"Codex"}),(0,a.jsx)(fe,{value:"opencode",className:"flex-1",children:"OpenCode"})]}),e[9]=w):w=e[9];let y;e[10]===c?y=e[11]:(y=(0,a.jsx)(xe,{value:"claude",className:"mt-3",children:(0,a.jsx)(V,{command:c})}),e[10]=c,e[11]=y);let k;e[12]===c?k=e[13]:(k=(0,a.jsx)(xe,{value:"codex",className:"mt-3",children:(0,a.jsx)(V,{command:c})}),e[12]=c,e[13]=k);let j;e[14]===c?j=e[15]:(j=(0,a.jsx)(xe,{value:"opencode",className:"mt-3",children:(0,a.jsx)(V,{command:c})}),e[14]=c,e[15]=j);let g;e[16]!==o||e[17]!==j||e[18]!==y||e[19]!==k?(g=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[f,(0,a.jsxs)($t,{value:o,onValueChange:x,children:[w,y,k,j]})]}),e[16]=o,e[17]=j,e[18]=y,e[19]=k,e[20]=g):g=e[20];let z;e[21]!==i||e[22]!==l?(z=l&&i&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"3. Paste when prompted for token"}),(0,a.jsx)(V,{command:i,display:Ha(i)})]}),e[21]=i,e[22]=l,e[23]=z):z=e[23];let v;e[24]!==g||e[25]!==z?(v=(0,a.jsxs)("div",{className:"flex flex-col gap-4 py-2",children:[h,g,z]}),e[24]=g,e[25]=z,e[26]=v):v=e[26];let M;e[27]===n?M=e[28]:(M=(0,a.jsx)(Ve,{children:(0,a.jsx)(q,{variant:"secondary",onClick:n,children:"Close"})}),e[27]=n,e[28]=M);let W;return e[29]!==v||e[30]!==M?(W=(0,a.jsxs)(Be,{className:"sm:max-w-lg",children:[u,v,M]}),e[29]=v,e[30]=M,e[31]=W):W=e[31],W};var V=t=>{let e=(0,je.c)(15),{command:n,display:o}=t,[s,r]=(0,A.useState)(!1),i;e[0]===n?i=e[1]:(i=Pe.stopPropagation(async x=>{x.preventDefault(),await O(n),r(!0),setTimeout(()=>r(!1),2e3)}),e[0]=n,e[1]=i);let l=i,d=o??n,c;e[2]===d?c=e[3]:(c=(0,a.jsx)("code",{className:"flex-1 select-all break-words",children:d}),e[2]=d,e[3]=c);let p;e[4]===s?p=e[5]:(p=s?(0,a.jsx)(be,{size:14,strokeWidth:1.5}):(0,a.jsx)($e,{size:14,strokeWidth:1.5}),e[4]=s,e[5]=p);let u;e[6]!==l||e[7]!==p?(u=(0,a.jsx)(q,{onClick:l,size:"xs",variant:"ghost",children:p}),e[6]=l,e[7]=p,e[8]=u):u=e[8];let h;e[9]!==s||e[10]!==u?(h=(0,a.jsx)(Ae,{content:"Copied!",open:s,children:u}),e[9]=s,e[10]=u,e[11]=h):h=e[11];let f;return e[12]!==c||e[13]!==h?(f=(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-xs",children:[c,h]}),e[12]=c,e[13]=h,e[14]=f):f=e[14],f},ot=N(),oe="https://static.marimo.app";const Ba=t=>{let e=(0,ot.c)(25),{onClose:n}=t,[o,s]=(0,A.useState)(""),{exportAsHTML:r}=U(),i=`${o}-${Math.random().toString(36).slice(2,6)}`,l=`${oe}/static/${i}`,d;e[0]!==r||e[1]!==n||e[2]!==i?(d=async g=>{g.preventDefault(),n();let z=await r({download:!1,includeCode:!0,files:aa.INSTANCE.filenames()}),v=D({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${oe}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:z,path:i})}).catch(()=>{v.dismiss(),D({title:"Error uploading static page",description:(0,a.jsxs)("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",(0,a.jsx)("a",{href:S.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),v.dismiss(),D({title:"Static page uploaded!",description:(0,a.jsxs)("div",{children:["The URL has been copied to your clipboard.",(0,a.jsx)("br",{}),"You can share it with anyone."]})})},e[0]=r,e[1]=n,e[2]=i,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(Oe,{children:"Share static notebook"}),e[4]=c):c=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsxs)(Ue,{children:[c,(0,a.jsxs)(Fe,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",(0,a.jsx)("a",{href:oe,target:"_blank",children:oe}),"."]})]}),e[5]=p):p=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=g=>{s(g.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},e[6]=u):u=e[6];let h;e[7]===o?h=e[8]:(h=(0,a.jsx)(fa,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:u,required:!0,autoComplete:"off"}),e[7]=o,e[8]=h);let f;e[9]===l?f=e[10]:(f=(0,a.jsxs)("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(Fa,{text:l}),(0,a.jsx)("span",{className:"text-primary",children:l})]})]}),e[9]=l,e[10]=f);let x;e[11]!==h||e[12]!==f?(x=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[h,f]}),e[11]=h,e[12]=f,e[13]=x):x=e[13];let w;e[14]===n?w=e[15]:(w=(0,a.jsx)(q,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=w);let y;e[16]===l?y=e[17]:(y=(0,a.jsx)(q,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await O(l)},children:"Create"}),e[16]=l,e[17]=y);let k;e[18]!==w||e[19]!==y?(k=(0,a.jsxs)(Ve,{children:[w,y]}),e[18]=w,e[19]=y,e[20]=k):k=e[20];let j;return e[21]!==d||e[22]!==k||e[23]!==x?(j=(0,a.jsx)(Be,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:d,children:[p,x,k]})}),e[21]=d,e[22]=k,e[23]=x,e[24]=j):j=e[24],j};var Fa=t=>{let e=(0,ot.c)(8),[n,o]=A.useState(!1),s;e[0]===t.text?s=e[1]:(s=Pe.stopPropagation(async c=>{c.preventDefault(),await O(t.text),o(!0),setTimeout(()=>o(!1),2e3)}),e[0]=t.text,e[1]=s);let r=s,i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)($e,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2];let l;e[3]===r?l=e[4]:(l=(0,a.jsx)(q,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:i}),e[3]=r,e[4]=l);let d;return e[5]!==n||e[6]!==l?(d=(0,a.jsx)(Ae,{content:"Copied!",open:n,children:l}),e[5]=n,e[6]=l,e[7]=d):d=e[7],d},Ya=N();function Ka(){let t=document.getElementsByClassName(Se.outputArea);for(let e of t){let n=e.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=pe.findElement(e);if(!o){H.warn("Could not find HTMLCellId for visible output area",e);continue}return{cellId:pe.parse(o.id)}}}return H.warn("No visible output area found for scroll anchor"),null}function Ga(t){if(!t){H.warn("No scroll anchor provided to restore scroll position");return}let e=document.getElementById(pe.create(t.cellId));if(!e){H.warn("Could not find cell element to restore scroll position",t.cellId);return}if(!e.querySelector(`.${Se.outputArea}`)){H.warn("Could not find output area to restore scroll position",t.cellId);return}e.scrollIntoView({block:"start",behavior:"auto"})}function nt(){let t=(0,Ya.c)(2),e=$(We),n;return t[0]===e?n=t[1]:(n=()=>{let o=Ka();e(s=>({mode:Ct(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ga(o)})})},t[0]=e,t[1]=n),n}const st=pt(!1);var Ja=N();const Qa=()=>{let t=(0,Ja.c)(7),{selectedLayout:e}=Le(),{setLayoutView:n}=Te();if(ue()&&!jt("wasm_layouts"))return null;let o;t[0]===n?o=t[1]:(o=l=>n(l),t[0]=n,t[1]=o);let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(Ft,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)(Ut,{placeholder:"Select a view"})}),t[2]=s):s=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Vt,{children:(0,a.jsxs)(Bt,{children:[(0,a.jsx)(qt,{children:"View as"}),Je.map(Za)]})}),t[3]=r):r=t[3];let i;return t[4]!==e||t[5]!==o?(i=(0,a.jsxs)(Yt,{"data-testid":"layout-select",value:e,onValueChange:o,children:[s,r]}),t[4]=e,t[5]=o,t[6]=i):i=t[6],i};function Xa(t){return(0,a.jsx)(lt(t),{className:"h-4 w-4"})}function lt(t){switch(t){case"vertical":return Pa;case"grid":return ra;case"slides":return tt;default:return Zt(t),ma}}function it(t){return Ie.startCase(t)}function Za(t){return(0,a.jsx)(Ot,{value:t,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Xa(t),(0,a.jsx)("span",{children:it(t)})]})},t)}async function eo(t){let{filename:e,preset:n,downloadPDF:o}=t;await o({filename:e,webpdf:!1,preset:n,includeInputs:!0,rasterServer:"static"})}var to=N();function ao(t){let e=(0,to.c)(5),{openPrompt:n,closeModal:o}=we(),{sendCopy:s}=U(),r;return e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==t?(r=()=>{if(!t)return null;let i=ba.guessDeliminator(t);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${qe.basename(t)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:l=>{let d=i.join(qe.dirname(t),l);s({source:t,destination:d}).then(()=>{o(),D({title:"Notebook copied",description:"A copy of the notebook has been created."}),Ma(d)})}})},e[0]=o,e[1]=n,e[2]=s,e[3]=t,e[4]=r):r=e[4],r}const oo=()=>{let{updateCellConfig:t}=Me(),{saveCellConfig:e}=U();return(0,A.useCallback)(async()=>{let n=new xt,o=_e(),s=o.cellIds.inOrderIds,r={};for(let l of s){if(o.cellData[l]===void 0)continue;let{code:d,config:c}=o.cellData[l];c.hide_code||n.isSupported(d)&&(r[l]={hide_code:!0})}let i=Ne.entries(r);if(i.length!==0){await e({configs:r});for(let[l,d]of i)t({cellId:l,config:d})}},[t])};var no=N();function rt(){let t=(0,no.c)(4),{openConfirm:e}=we(),n=$(At),{sendRestart:o}=U(),s;return t[0]!==e||t[1]!==o||t[2]!==n?(s=()=>{e({title:"Restart Kernel",description:"This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.",variant:"destructive",confirmAction:(0,a.jsx)(Rt,{onClick:async()=>{n({state:Et.CLOSING}),await o(),ga()},"aria-label":"Confirm Restart",children:"Restart"})})},t[0]=e,t[1]=o,t[2]=n,t[3]=s):s=t[3],s}var so=N(),T=t=>{t==null||t.preventDefault(),t==null||t.stopPropagation()};function lo(){var ve,Ce;let t=(0,so.c)(51),e=va(),{openModal:n,closeModal:o}=we(),{toggleApplication:s}=_t(),{selectedPanel:r}=kt(),[i]=mt(We),l=me(gt),d=oo(),[c]=Dt(),{updateCellConfig:p,undoDeleteCell:u,clearAllCellOutputs:h,addSetupCellIfDoesntExist:f,collapseAllCells:x,expandAllCells:w}=Me(),y=rt(),k=ja(),j=ao(e),g=$(st),z=$(Nt),v=$(St),{exportAsIPYNB:M,exportAsMarkdown:W,readCode:_,saveCellConfig:se,updateCellOutputs:P}=U(),I=Wa(),le=me(bt),ie=me(zt),{selectedLayout:B}=Le(),{setLayoutView:re}=Te(),F=nt(),Y=((ve=c.sharing)==null?void 0:ve.html)??!0,K=((Ce=c.sharing)==null?void 0:Ce.wasm)??!0,ge=!ue(),de=B==="slides",dt=zo,ct=Co,G;t[0]!==e||t[1]!==I||t[2]!==P?(G=async m=>{let{preset:C,title:R}=m;if(!e){ne();return}await De(R,async he=>{await Ge({takeScreenshots:()=>I({progress:he}),updateCellOutputs:P}),await eo({filename:e,preset:C,downloadPDF:Gt})})},t[0]=e,t[1]=I,t[2]=P,t[3]=G):G=t[3];let E=G,J;t[4]===E?J=t[5]:(J=async()=>{if(ge){await E({preset:"document",title:"Downloading Document PDF..."});return}let m=new Event("export-beforeprint"),C=new Event("export-afterprint");window.dispatchEvent(m),setTimeout(vo,0),setTimeout(()=>window.dispatchEvent(C),0)},t[4]=E,t[5]=J);let Q=J,X;t[6]!==M||t[7]!==e||t[8]!==I||t[9]!==P?(X=async()=>{if(!e){ne();return}await De("Downloading IPYNB...",async m=>{await Ge({takeScreenshots:()=>I({progress:m}),updateCellOutputs:P});let C=await M({download:!1});ke(new Blob([C],{type:"application/x-ipynb+json"}),ye.toIPYNB(document.title))})},t[6]=M,t[7]=e,t[8]=I,t[9]=P,t[10]=X):X=t[10];let ce=X,Z;t[11]===Symbol.for("react.memo_cache_sentinel")?(Z=(0,a.jsx)(Kt,{size:14,strokeWidth:1.5}),t[11]=Z):Z=t[11];let ee;t[12]===Symbol.for("react.memo_cache_sentinel")?(ee=(0,a.jsx)(Ee,{size:14,strokeWidth:1.5}),t[12]=ee):ee=t[12];let L;t[13]===e?L=t[14]:(L=async()=>{if(!e){ne();return}await Re({filename:e,includeCode:!0})},t[13]=e,t[14]=L);let te;return t[15]!==f||t[16]!==ie||t[17]!==h||t[18]!==o||t[19]!==x||t[20]!==j||t[21]!==E||t[22]!==w||t[23]!==W||t[24]!==e||t[25]!==Q||t[26]!==ce||t[27]!==le||t[28]!==d||t[29]!==de||t[30]!==l||t[31]!==n||t[32]!==_||t[33]!==y||t[34]!==k||t[35]!==se||t[36]!==B||t[37]!==r||t[38]!==g||t[39]!==v||t[40]!==re||t[41]!==z||t[42]!==Y||t[43]!==K||t[44]!==L||t[45]!==s||t[46]!==F||t[47]!==u||t[48]!==p||t[49]!==i.mode?(te=[{icon:Z,label:"Download",handle:T,dropdown:[{icon:ee,label:"Download as HTML",handle:L},{icon:(0,a.jsx)(Ee,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!e){ne();return}await Re({filename:e,includeCode:!1})}},{icon:(0,a.jsx)(za,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let m=await W({download:!1});ke(new Blob([m],{type:"text/plain"}),ye.toMarkdown(document.title))}},{icon:(0,a.jsx)(Ia,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:ce},{icon:(0,a.jsx)(ta,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let m=await _();ke(new Blob([m.contents],{type:"text/plain"}),ye.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(pa,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:i.mode!=="present",tooltip:i.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",Ca("global.hideCode",!1)]}),handle:go},de?{divider:!0,icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:T,dropdown:[{icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:Q},{icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:ct(!0),hidden:!ge,handle:async()=>{await E({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:Q}]},{icon:(0,a.jsx)(ya,{size:14,strokeWidth:1.5}),label:"Pair with an agent",handle:async()=>{n((0,a.jsx)(Va,{onClose:o}))}},{icon:(0,a.jsx)(La,{size:14,strokeWidth:1.5}),label:"Share",handle:T,hidden:!Y&&!K,dropdown:[{icon:(0,a.jsx)(Xt,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!Y,handle:async()=>{n((0,a.jsx)(Ba,{onClose:o}))}},{icon:(0,a.jsx)(ua,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!K,handle:async()=>{await O(Ye({code:(await _()).contents})),D({title:"Copied",description:"Link copied to clipboard."})}},{icon:(0,a.jsx)(Ke,{size:14,strokeWidth:1.5}),label:"Create molab notebook",handle:async()=>{let m=Ye({code:(await _()).contents,baseUrl:`${S.molab}/new`});window.open(m,"_blank")}}]},{icon:(0,a.jsx)(Ea,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:T,dropdown:ft.flatMap(m=>{let{type:C,Icon:R,hidden:he,additionalKeywords:ht}=m;return he?[]:{label:Ie.startCase(C),rightElement:dt(r===C),icon:(0,a.jsx)(R,{size:14,strokeWidth:1.5}),handle:()=>s(C),additionalKeywords:ht}})},{icon:(0,a.jsx)(tt,{size:14,strokeWidth:1.5}),label:"Present as",handle:T,dropdown:[{icon:i.mode==="present"?(0,a.jsx)(ka,{size:14,strokeWidth:1.5}):(0,a.jsx)(et,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{F()}},...Je.map((m,C)=>{let R=lt(m);return{divider:C===0,label:it(m),icon:(0,a.jsx)(R,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:B===m&&(0,a.jsx)(be,{size:14})}),handle:()=>{re(m),i.mode==="edit"&&F()}}})]},{icon:(0,a.jsx)(Da,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!e||ue(),handle:j},{icon:(0,a.jsx)(Qe,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!e,handle:async()=>{await O((await _()).contents),D({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(na,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!le||l,handle:async()=>{let m=yt(_e());await se({configs:Ne.fromEntries(m.map(jo))});for(let C of m)p({cellId:C,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(Ze,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{f({})}},{icon:(0,a.jsx)(Mt,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(He,{onClose:o}))}},{icon:(0,a.jsx)(ca,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(He,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(at,{size:14,strokeWidth:1.5}),label:"Undo cell deletion",hidden:!ie||l,handle:()=>{u()}},{icon:(0,a.jsx)(Ta,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:y,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(Sa,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{k()}},{icon:(0,a.jsx)(vt,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{h()}},{icon:(0,a.jsx)(sa,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:d,redundant:!0},{icon:(0,a.jsx)(Na,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:x,redundant:!0},{icon:(0,a.jsx)(_a,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:w,redundant:!0},{divider:!0,icon:(0,a.jsx)(Xe,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>g(wo)},{icon:(0,a.jsx)(Aa,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>v(bo)},{icon:(0,a.jsx)(xa,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>z(ko),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(oa,{size:14,strokeWidth:1.5}),label:"Resources",handle:T,dropdown:[{icon:(0,a.jsx)(Wt,{size:14,strokeWidth:1.5}),label:"Documentation",handle:yo},{icon:(0,a.jsx)(la,{size:14,strokeWidth:1.5}),label:"GitHub",handle:xo},{icon:(0,a.jsx)(ia,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:fo},{icon:(0,a.jsx)(da,{size:14,strokeWidth:1.5}),label:"YouTube",handle:uo},{icon:(0,a.jsx)(wt,{size:14,strokeWidth:1.5}),label:"Changelog",handle:po}]},{divider:!0,icon:(0,a.jsx)(ha,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:mo},{icon:(0,a.jsx)(Ke,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:ho}].filter(co).map(io),t[15]=f,t[16]=ie,t[17]=h,t[18]=o,t[19]=x,t[20]=j,t[21]=E,t[22]=w,t[23]=W,t[24]=e,t[25]=Q,t[26]=ce,t[27]=le,t[28]=d,t[29]=de,t[30]=l,t[31]=n,t[32]=_,t[33]=y,t[34]=k,t[35]=se,t[36]=B,t[37]=r,t[38]=g,t[39]=v,t[40]=re,t[41]=z,t[42]=Y,t[43]=K,t[44]=L,t[45]=s,t[46]=F,t[47]=u,t[48]=p,t[49]=i.mode,t[50]=te):te=t[50],te}function io(t){return t.dropdown?{...t,dropdown:t.dropdown.filter(ro)}:t}function ro(t){return!t.hidden}function co(t){return!t.hidden}function ho(){let t=wa();window.open(t,"_blank")}function mo(){let t=document.baseURI.split("?")[0];window.open(t,"_self")}function po(){window.open(S.releasesPage,"_blank")}function uo(){window.open(S.youtube,"_blank")}function fo(){window.open(S.discordLink,"_blank")}function xo(){window.open(S.githubPage,"_blank")}function yo(){window.open(S.docsPage,"_blank")}function ko(t){return!t}function bo(t){return!t}function wo(t){return!t}function jo(t){return[t,{disabled:!1}]}async function go(){let t=document.getElementById("App");t&&await Jt({element:t,filename:document.title,prepare:Qt})}function vo(){return window.print()}function Co(t){return t?(0,a.jsx)("span",{className:"ml-3 shrink-0 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-emerald-700",children:"Recommended"}):null}function zo(t){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:t&&(0,a.jsx)(be,{size:14})})}function ne(){D({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{nt as a,Ze as c,st as i,Xe as l,rt as n,at as o,Qa as r,et as s,lo as t,Qe as u};
1
+ import{s as ze}from"./chunk-LvLJmgfZ.js";import{d as $,l as mt,p as pt,u as me}from"./useEvent-D91BmmQi.js";import{t as ut}from"./react-Bj1aDYRI.js";import{E as Me,En as ft,Jt as xt,Rr as yt,Ti as pe,Tn as kt,_ as bt,cr as wt,ct as We,h as _e,kn as jt,ot as gt,pr as vt,st as Ct,t as zt,ur as Mt,vr as Wt,wn as _t}from"./cells-CkQXmtbU.js";import{t as N}from"./compiler-runtime-B3qBwwSJ.js";import{n as Nt,x as St}from"./ai-model-dropdown-CHNX-Yvn.js";import{_ as H,d as Ne}from"./useEventListener-BR0C1MaI.js";import{y as Dt}from"./utils-DIGrmLDO.js";import{n as S,t as Se}from"./constants-DMpttj8Q.js";import{S as ue,h as At,n as Pt,o as It,x as Et}from"./config-Calf6e81.js";import{n as Lt}from"./switch-CqJGGLBT.js";import{t as Tt}from"./jsx-runtime-BqBOg78p.js";import{o as Rt}from"./alert-dialog-BGBdrcqJ.js";import{a as $t,c as fe,o as xe,s as Ht}from"./popover-UExmgBsf.js";import{a as qt,c as Ut,i as Ot,n as Vt,r as Bt,s as Ft,t as Yt}from"./select-5i7URBEn.js";import{gt as Kt}from"./JsonOutput-CcRaYhT-.js";import{c as De,d as ye,n as Gt,o as Jt,r as ke,t as Qt}from"./download-aayD25Wi.js";import{m as Xt}from"./form-3fPAWHbK.js";import{t as Ae}from"./tooltip-Gcwqb_SK.js";import{r as Pe,t as q}from"./button-D9nb17Rw.js";import{i as Zt,r as ea,t as Ie}from"./strings-md4mFbOQ.js";import{r as U}from"./requests-DIwGYs0l.js";import{t as b}from"./createLucideIcon-D5guW7EU.js";import{A as Ee,a as Le,i as Te,j as ta,k as aa,u as Re}from"./layout-Dz6l5gDf.js";import{t as be}from"./check-BH35Ndha.js";import{n as oa}from"./maps-C48Oksn0.js";import{r as na}from"./useCellActionButton-GNljpGS_.js";import{t as $e}from"./copy-BwrPA9zQ.js";import{t as sa}from"./eye-off-n1Li95bE.js";import{t as ae}from"./file-BrdxGLRX.js";import{t as la}from"./github-BKS_2Qwn.js";import{n as ia,r as ra,t as da}from"./youtube-CXGBiuia.js";import{i as ca,n as He}from"./add-connection-dialog-dNJgn8Ox.js";import{n as ha,t as ma}from"./square-k2WwJdZy.js";import{t as pa}from"./image-HpSc22eh.js";import{t as ua}from"./link-DlqtQzll.js";import{r as fa}from"./input-2egRGOhT.js";import{t as xa}from"./settings-C_KZ1Eue.js";import{t as ya}from"./sparkles-BRTQ46qC.js";import{y as ka}from"./textarea-jLEyGvlo.js";import{t as D}from"./use-toast-PYIpV284.js";import{n as qe,t as ba}from"./paths-DsQUzvvb.js";import{o as wa}from"./session-DdhIEena.js";import{n as O}from"./copy-BnK_ki61.js";import{r as ja}from"./useRunCells-BGxIfw3R.js";import{a as Ue,c as Oe,i as Ve,n as Be,r as Fe}from"./dialog-CqE8CV1Y.js";import{n as we}from"./ImperativeModal-CAFE3UV7.js";import{r as ga,t as Ye}from"./share-CJEPnWjm.js";import{a as va}from"./cell-link-CeI1GPxX.js";import{a as Ca}from"./renderShortcut-B-72v1dC.js";import{t as za}from"./icons-C66kZH_4.js";import{n as Ke}from"./marimo-icons-Ce24dQVN.js";import{t as Ma}from"./links-DhwG_EVu.js";import{r as Wa,t as Ge}from"./hooks-B4ys0c0n.js";import{t as Je}from"./types-DOn3dVLe.js";var _a=b("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),Na=b("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),Qe=b("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),Xe=b("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]),Ze=b("diamond-plus",[["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",key:"1ey20j"}],["path",{d:"M8 12h8",key:"1wcyev"}]]),Sa=b("fast-forward",[["path",{d:"M12 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 12 18z",key:"b19h5q"}],["path",{d:"M2 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 2 18z",key:"h7h5ge"}]]),Da=b("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]),Aa=b("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),et=b("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),Pa=b("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),Ia=b("notebook",[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M16 2v20",key:"rotuqe"}]]),Ea=b("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),tt=b("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),La=b("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),Ta=b("square-power",[["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M7.998 9.003a5 5 0 1 0 8-.005",key:"1pek45"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),at=b("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),je=N(),A=ze(ut(),1),a=ze(Tt(),1);function Ra(){return"uvx marimo@latest"}function $a(t,e,n){let o=n?" --with-token":"",s=`${Ra()} pair prompt --url '${e}'${o}`;switch(t){case"claude":return`claude "$(${s} --claude)"`;case"codex":return`codex "$(${s} --codex)"`;case"opencode":return`opencode "$(${s} --opencode)"`;default:ea(t)}}function Ha(t){return t.length<=4?"****":`${"*".repeat(Math.min(t.length-4,8))}${t.slice(-4)}`}var qa="npx skills add marimo-team/marimo-pair";function Ua(){let t=(0,je.c)(2),[e,n]=(0,A.useState)(null),o,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{fetch(Pt("/auth/token").href,{headers:Lt.headers()}).then(Oa).then(r=>n((r==null?void 0:r.token)??null)).catch(()=>n(null))},s=[],t[0]=o,t[1]=s):(o=t[0],s=t[1]),(0,A.useEffect)(o,s),e}function Oa(t){return t.ok?t.json():null}const Va=t=>{let e=(0,je.c)(32),{onClose:n}=t,[o,s]=(0,A.useState)("claude"),r=It(),i=Ua(),l=!!i,d;e[0]!==o||e[1]!==l||e[2]!==r.httpURL?(d=$a(o,r.httpURL.toString(),l),e[0]=o,e[1]=l,e[2]=r.httpURL,e[3]=d):d=e[3];let c=d,p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsx)(Oe,{children:"Pair with an agent"}),e[4]=p):p=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=(0,a.jsxs)(Ue,{children:[p,(0,a.jsxs)(Fe,{children:["Use an AI coding agent to pair-program on this notebook."," ",(0,a.jsx)("a",{href:"https://links.marimo.app/marimo-pair",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Learn more"}),"."]})]}),e[5]=u):u=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"1. Install the skill"}),(0,a.jsx)(V,{command:qa})]}),e[6]=h):h=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=(0,a.jsx)("span",{className:"text-sm font-medium",children:"2. Run in your terminal"}),e[7]=f):f=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=_=>s(_),e[8]=x):x=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=(0,a.jsxs)(Ht,{className:"w-full",children:[(0,a.jsx)(fe,{value:"claude",className:"flex-1",children:"Claude"}),(0,a.jsx)(fe,{value:"codex",className:"flex-1",children:"Codex"}),(0,a.jsx)(fe,{value:"opencode",className:"flex-1",children:"OpenCode"})]}),e[9]=w):w=e[9];let y;e[10]===c?y=e[11]:(y=(0,a.jsx)(xe,{value:"claude",className:"mt-3",children:(0,a.jsx)(V,{command:c})}),e[10]=c,e[11]=y);let k;e[12]===c?k=e[13]:(k=(0,a.jsx)(xe,{value:"codex",className:"mt-3",children:(0,a.jsx)(V,{command:c})}),e[12]=c,e[13]=k);let j;e[14]===c?j=e[15]:(j=(0,a.jsx)(xe,{value:"opencode",className:"mt-3",children:(0,a.jsx)(V,{command:c})}),e[14]=c,e[15]=j);let g;e[16]!==o||e[17]!==j||e[18]!==y||e[19]!==k?(g=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[f,(0,a.jsxs)($t,{value:o,onValueChange:x,children:[w,y,k,j]})]}),e[16]=o,e[17]=j,e[18]=y,e[19]=k,e[20]=g):g=e[20];let z;e[21]!==i||e[22]!==l?(z=l&&i&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"3. Paste when prompted for token"}),(0,a.jsx)(V,{command:i,display:Ha(i)})]}),e[21]=i,e[22]=l,e[23]=z):z=e[23];let v;e[24]!==g||e[25]!==z?(v=(0,a.jsxs)("div",{className:"flex flex-col gap-4 py-2",children:[h,g,z]}),e[24]=g,e[25]=z,e[26]=v):v=e[26];let M;e[27]===n?M=e[28]:(M=(0,a.jsx)(Ve,{children:(0,a.jsx)(q,{variant:"secondary",onClick:n,children:"Close"})}),e[27]=n,e[28]=M);let W;return e[29]!==v||e[30]!==M?(W=(0,a.jsxs)(Be,{className:"sm:max-w-lg",children:[u,v,M]}),e[29]=v,e[30]=M,e[31]=W):W=e[31],W};var V=t=>{let e=(0,je.c)(15),{command:n,display:o}=t,[s,r]=(0,A.useState)(!1),i;e[0]===n?i=e[1]:(i=Pe.stopPropagation(async x=>{x.preventDefault(),await O(n),r(!0),setTimeout(()=>r(!1),2e3)}),e[0]=n,e[1]=i);let l=i,d=o??n,c;e[2]===d?c=e[3]:(c=(0,a.jsx)("code",{className:"flex-1 select-all break-words",children:d}),e[2]=d,e[3]=c);let p;e[4]===s?p=e[5]:(p=s?(0,a.jsx)(be,{size:14,strokeWidth:1.5}):(0,a.jsx)($e,{size:14,strokeWidth:1.5}),e[4]=s,e[5]=p);let u;e[6]!==l||e[7]!==p?(u=(0,a.jsx)(q,{onClick:l,size:"xs",variant:"ghost",children:p}),e[6]=l,e[7]=p,e[8]=u):u=e[8];let h;e[9]!==s||e[10]!==u?(h=(0,a.jsx)(Ae,{content:"Copied!",open:s,children:u}),e[9]=s,e[10]=u,e[11]=h):h=e[11];let f;return e[12]!==c||e[13]!==h?(f=(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-xs",children:[c,h]}),e[12]=c,e[13]=h,e[14]=f):f=e[14],f},ot=N(),oe="https://static.marimo.app";const Ba=t=>{let e=(0,ot.c)(25),{onClose:n}=t,[o,s]=(0,A.useState)(""),{exportAsHTML:r}=U(),i=`${o}-${Math.random().toString(36).slice(2,6)}`,l=`${oe}/static/${i}`,d;e[0]!==r||e[1]!==n||e[2]!==i?(d=async g=>{g.preventDefault(),n();let z=await r({download:!1,includeCode:!0,files:aa.INSTANCE.filenames()}),v=D({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${oe}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:z,path:i})}).catch(()=>{v.dismiss(),D({title:"Error uploading static page",description:(0,a.jsxs)("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",(0,a.jsx)("a",{href:S.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),v.dismiss(),D({title:"Static page uploaded!",description:(0,a.jsxs)("div",{children:["The URL has been copied to your clipboard.",(0,a.jsx)("br",{}),"You can share it with anyone."]})})},e[0]=r,e[1]=n,e[2]=i,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(Oe,{children:"Share static notebook"}),e[4]=c):c=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsxs)(Ue,{children:[c,(0,a.jsxs)(Fe,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",(0,a.jsx)("a",{href:oe,target:"_blank",children:oe}),"."]})]}),e[5]=p):p=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=g=>{s(g.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},e[6]=u):u=e[6];let h;e[7]===o?h=e[8]:(h=(0,a.jsx)(fa,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:u,required:!0,autoComplete:"off"}),e[7]=o,e[8]=h);let f;e[9]===l?f=e[10]:(f=(0,a.jsxs)("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(Fa,{text:l}),(0,a.jsx)("span",{className:"text-primary",children:l})]})]}),e[9]=l,e[10]=f);let x;e[11]!==h||e[12]!==f?(x=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[h,f]}),e[11]=h,e[12]=f,e[13]=x):x=e[13];let w;e[14]===n?w=e[15]:(w=(0,a.jsx)(q,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=w);let y;e[16]===l?y=e[17]:(y=(0,a.jsx)(q,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await O(l)},children:"Create"}),e[16]=l,e[17]=y);let k;e[18]!==w||e[19]!==y?(k=(0,a.jsxs)(Ve,{children:[w,y]}),e[18]=w,e[19]=y,e[20]=k):k=e[20];let j;return e[21]!==d||e[22]!==k||e[23]!==x?(j=(0,a.jsx)(Be,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:d,children:[p,x,k]})}),e[21]=d,e[22]=k,e[23]=x,e[24]=j):j=e[24],j};var Fa=t=>{let e=(0,ot.c)(8),[n,o]=A.useState(!1),s;e[0]===t.text?s=e[1]:(s=Pe.stopPropagation(async c=>{c.preventDefault(),await O(t.text),o(!0),setTimeout(()=>o(!1),2e3)}),e[0]=t.text,e[1]=s);let r=s,i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)($e,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2];let l;e[3]===r?l=e[4]:(l=(0,a.jsx)(q,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:i}),e[3]=r,e[4]=l);let d;return e[5]!==n||e[6]!==l?(d=(0,a.jsx)(Ae,{content:"Copied!",open:n,children:l}),e[5]=n,e[6]=l,e[7]=d):d=e[7],d},Ya=N();function Ka(){let t=document.getElementsByClassName(Se.outputArea);for(let e of t){let n=e.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=pe.findElement(e);if(!o){H.warn("Could not find HTMLCellId for visible output area",e);continue}return{cellId:pe.parse(o.id)}}}return H.warn("No visible output area found for scroll anchor"),null}function Ga(t){if(!t){H.warn("No scroll anchor provided to restore scroll position");return}let e=document.getElementById(pe.create(t.cellId));if(!e){H.warn("Could not find cell element to restore scroll position",t.cellId);return}if(!e.querySelector(`.${Se.outputArea}`)){H.warn("Could not find output area to restore scroll position",t.cellId);return}e.scrollIntoView({block:"start",behavior:"auto"})}function nt(){let t=(0,Ya.c)(2),e=$(We),n;return t[0]===e?n=t[1]:(n=()=>{let o=Ka();e(s=>({mode:Ct(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ga(o)})})},t[0]=e,t[1]=n),n}const st=pt(!1);var Ja=N();const Qa=()=>{let t=(0,Ja.c)(7),{selectedLayout:e}=Le(),{setLayoutView:n}=Te();if(ue()&&!jt("wasm_layouts"))return null;let o;t[0]===n?o=t[1]:(o=l=>n(l),t[0]=n,t[1]=o);let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(Ft,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)(Ut,{placeholder:"Select a view"})}),t[2]=s):s=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Vt,{children:(0,a.jsxs)(Bt,{children:[(0,a.jsx)(qt,{children:"View as"}),Je.map(Za)]})}),t[3]=r):r=t[3];let i;return t[4]!==e||t[5]!==o?(i=(0,a.jsxs)(Yt,{"data-testid":"layout-select",value:e,onValueChange:o,children:[s,r]}),t[4]=e,t[5]=o,t[6]=i):i=t[6],i};function Xa(t){return(0,a.jsx)(lt(t),{className:"h-4 w-4"})}function lt(t){switch(t){case"vertical":return Pa;case"grid":return ra;case"slides":return tt;default:return Zt(t),ma}}function it(t){return Ie.startCase(t)}function Za(t){return(0,a.jsx)(Ot,{value:t,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Xa(t),(0,a.jsx)("span",{children:it(t)})]})},t)}async function eo(t){let{filename:e,preset:n,downloadPDF:o}=t;await o({filename:e,webpdf:!1,preset:n,includeInputs:!0,rasterServer:"static"})}var to=N();function ao(t){let e=(0,to.c)(5),{openPrompt:n,closeModal:o}=we(),{sendCopy:s}=U(),r;return e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==t?(r=()=>{if(!t)return null;let i=ba.guessDeliminator(t);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${qe.basename(t)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:l=>{let d=i.join(qe.dirname(t),l);s({source:t,destination:d}).then(()=>{o(),D({title:"Notebook copied",description:"A copy of the notebook has been created."}),Ma(d)})}})},e[0]=o,e[1]=n,e[2]=s,e[3]=t,e[4]=r):r=e[4],r}const oo=()=>{let{updateCellConfig:t}=Me(),{saveCellConfig:e}=U();return(0,A.useCallback)(async()=>{let n=new xt,o=_e(),s=o.cellIds.inOrderIds,r={};for(let l of s){if(o.cellData[l]===void 0)continue;let{code:d,config:c}=o.cellData[l];c.hide_code||n.isSupported(d)&&(r[l]={hide_code:!0})}let i=Ne.entries(r);if(i.length!==0){await e({configs:r});for(let[l,d]of i)t({cellId:l,config:d})}},[t])};var no=N();function rt(){let t=(0,no.c)(4),{openConfirm:e}=we(),n=$(At),{sendRestart:o}=U(),s;return t[0]!==e||t[1]!==o||t[2]!==n?(s=()=>{e({title:"Restart Kernel",description:"This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.",variant:"destructive",confirmAction:(0,a.jsx)(Rt,{onClick:async()=>{n({state:Et.CLOSING}),await o(),ga()},"aria-label":"Confirm Restart",children:"Restart"})})},t[0]=e,t[1]=o,t[2]=n,t[3]=s):s=t[3],s}var so=N(),T=t=>{t==null||t.preventDefault(),t==null||t.stopPropagation()};function lo(){var ve,Ce;let t=(0,so.c)(51),e=va(),{openModal:n,closeModal:o}=we(),{toggleApplication:s}=_t(),{selectedPanel:r}=kt(),[i]=mt(We),l=me(gt),d=oo(),[c]=Dt(),{updateCellConfig:p,undoDeleteCell:u,clearAllCellOutputs:h,addSetupCellIfDoesntExist:f,collapseAllCells:x,expandAllCells:w}=Me(),y=rt(),k=ja(),j=ao(e),g=$(st),z=$(Nt),v=$(St),{exportAsIPYNB:M,exportAsMarkdown:W,readCode:_,saveCellConfig:se,updateCellOutputs:P}=U(),I=Wa(),le=me(bt),ie=me(zt),{selectedLayout:B}=Le(),{setLayoutView:re}=Te(),F=nt(),Y=((ve=c.sharing)==null?void 0:ve.html)??!0,K=((Ce=c.sharing)==null?void 0:Ce.wasm)??!0,ge=!ue(),de=B==="slides",dt=zo,ct=Co,G;t[0]!==e||t[1]!==I||t[2]!==P?(G=async m=>{let{preset:C,title:R}=m;if(!e){ne();return}await De(R,async he=>{await Ge({takeScreenshots:()=>I({progress:he}),updateCellOutputs:P}),await eo({filename:e,preset:C,downloadPDF:Gt})})},t[0]=e,t[1]=I,t[2]=P,t[3]=G):G=t[3];let E=G,J;t[4]===E?J=t[5]:(J=async()=>{if(ge){await E({preset:"document",title:"Downloading Document PDF..."});return}let m=new Event("export-beforeprint"),C=new Event("export-afterprint");window.dispatchEvent(m),setTimeout(vo,0),setTimeout(()=>window.dispatchEvent(C),0)},t[4]=E,t[5]=J);let Q=J,X;t[6]!==M||t[7]!==e||t[8]!==I||t[9]!==P?(X=async()=>{if(!e){ne();return}await De("Downloading IPYNB...",async m=>{await Ge({takeScreenshots:()=>I({progress:m}),updateCellOutputs:P});let C=await M({download:!1});ke(new Blob([C],{type:"application/x-ipynb+json"}),ye.toIPYNB(document.title))})},t[6]=M,t[7]=e,t[8]=I,t[9]=P,t[10]=X):X=t[10];let ce=X,Z;t[11]===Symbol.for("react.memo_cache_sentinel")?(Z=(0,a.jsx)(Kt,{size:14,strokeWidth:1.5}),t[11]=Z):Z=t[11];let ee;t[12]===Symbol.for("react.memo_cache_sentinel")?(ee=(0,a.jsx)(Ee,{size:14,strokeWidth:1.5}),t[12]=ee):ee=t[12];let L;t[13]===e?L=t[14]:(L=async()=>{if(!e){ne();return}await Re({filename:e,includeCode:!0})},t[13]=e,t[14]=L);let te;return t[15]!==f||t[16]!==ie||t[17]!==h||t[18]!==o||t[19]!==x||t[20]!==j||t[21]!==E||t[22]!==w||t[23]!==W||t[24]!==e||t[25]!==Q||t[26]!==ce||t[27]!==le||t[28]!==d||t[29]!==de||t[30]!==l||t[31]!==n||t[32]!==_||t[33]!==y||t[34]!==k||t[35]!==se||t[36]!==B||t[37]!==r||t[38]!==g||t[39]!==v||t[40]!==re||t[41]!==z||t[42]!==Y||t[43]!==K||t[44]!==L||t[45]!==s||t[46]!==F||t[47]!==u||t[48]!==p||t[49]!==i.mode?(te=[{icon:Z,label:"Download",handle:T,dropdown:[{icon:ee,label:"Download as HTML",handle:L},{icon:(0,a.jsx)(Ee,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!e){ne();return}await Re({filename:e,includeCode:!1})}},{icon:(0,a.jsx)(za,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let m=await W({download:!1});ke(new Blob([m],{type:"text/plain"}),ye.toMarkdown(document.title))}},{icon:(0,a.jsx)(Ia,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:ce},{icon:(0,a.jsx)(ta,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let m=await _();ke(new Blob([m.contents],{type:"text/plain"}),ye.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(pa,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:i.mode!=="present",tooltip:i.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",Ca("global.hideCode",!1)]}),handle:go},de?{divider:!0,icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:T,dropdown:[{icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:Q},{icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:ct(!0),hidden:!ge,handle:async()=>{await E({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:Q}]},{icon:(0,a.jsx)(ya,{size:14,strokeWidth:1.5}),label:"Pair with an agent",handle:async()=>{n((0,a.jsx)(Va,{onClose:o}))}},{icon:(0,a.jsx)(La,{size:14,strokeWidth:1.5}),label:"Share",handle:T,hidden:!Y&&!K,dropdown:[{icon:(0,a.jsx)(Xt,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!Y,handle:async()=>{n((0,a.jsx)(Ba,{onClose:o}))}},{icon:(0,a.jsx)(ua,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!K,handle:async()=>{await O(Ye({code:(await _()).contents})),D({title:"Copied",description:"Link copied to clipboard."})}},{icon:(0,a.jsx)(Ke,{size:14,strokeWidth:1.5}),label:"Create molab notebook",handle:async()=>{let m=Ye({code:(await _()).contents,baseUrl:`${S.molab}/new`});window.open(m,"_blank")}}]},{icon:(0,a.jsx)(Ea,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:T,dropdown:ft.flatMap(m=>{let{type:C,Icon:R,hidden:he,additionalKeywords:ht}=m;return he?[]:{label:Ie.startCase(C),rightElement:dt(r===C),icon:(0,a.jsx)(R,{size:14,strokeWidth:1.5}),handle:()=>s(C),additionalKeywords:ht}})},{icon:(0,a.jsx)(tt,{size:14,strokeWidth:1.5}),label:"Present as",handle:T,dropdown:[{icon:i.mode==="present"?(0,a.jsx)(ka,{size:14,strokeWidth:1.5}):(0,a.jsx)(et,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{F()}},...Je.map((m,C)=>{let R=lt(m);return{divider:C===0,label:it(m),icon:(0,a.jsx)(R,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:B===m&&(0,a.jsx)(be,{size:14})}),handle:()=>{re(m),i.mode==="edit"&&F()}}})]},{icon:(0,a.jsx)(Da,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!e||ue(),handle:j},{icon:(0,a.jsx)(Qe,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!e,handle:async()=>{await O((await _()).contents),D({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(na,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!le||l,handle:async()=>{let m=yt(_e());await se({configs:Ne.fromEntries(m.map(jo))});for(let C of m)p({cellId:C,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(Ze,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{f({})}},{icon:(0,a.jsx)(Mt,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(He,{onClose:o}))}},{icon:(0,a.jsx)(ca,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(He,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(at,{size:14,strokeWidth:1.5}),label:"Undo cell deletion",hidden:!ie||l,handle:()=>{u()}},{icon:(0,a.jsx)(Ta,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:y,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(Sa,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{k()}},{icon:(0,a.jsx)(vt,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{h()}},{icon:(0,a.jsx)(sa,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:d,redundant:!0},{icon:(0,a.jsx)(Na,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:x,redundant:!0},{icon:(0,a.jsx)(_a,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:w,redundant:!0},{divider:!0,icon:(0,a.jsx)(Xe,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>g(wo)},{icon:(0,a.jsx)(Aa,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>v(bo)},{icon:(0,a.jsx)(xa,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>z(ko),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(oa,{size:14,strokeWidth:1.5}),label:"Resources",handle:T,dropdown:[{icon:(0,a.jsx)(Wt,{size:14,strokeWidth:1.5}),label:"Documentation",handle:yo},{icon:(0,a.jsx)(la,{size:14,strokeWidth:1.5}),label:"GitHub",handle:xo},{icon:(0,a.jsx)(ia,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:fo},{icon:(0,a.jsx)(da,{size:14,strokeWidth:1.5}),label:"YouTube",handle:uo},{icon:(0,a.jsx)(wt,{size:14,strokeWidth:1.5}),label:"Changelog",handle:po}]},{divider:!0,icon:(0,a.jsx)(ha,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:mo},{icon:(0,a.jsx)(Ke,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:ho}].filter(co).map(io),t[15]=f,t[16]=ie,t[17]=h,t[18]=o,t[19]=x,t[20]=j,t[21]=E,t[22]=w,t[23]=W,t[24]=e,t[25]=Q,t[26]=ce,t[27]=le,t[28]=d,t[29]=de,t[30]=l,t[31]=n,t[32]=_,t[33]=y,t[34]=k,t[35]=se,t[36]=B,t[37]=r,t[38]=g,t[39]=v,t[40]=re,t[41]=z,t[42]=Y,t[43]=K,t[44]=L,t[45]=s,t[46]=F,t[47]=u,t[48]=p,t[49]=i.mode,t[50]=te):te=t[50],te}function io(t){return t.dropdown?{...t,dropdown:t.dropdown.filter(ro)}:t}function ro(t){return!t.hidden}function co(t){return!t.hidden}function ho(){let t=wa();window.open(t,"_blank")}function mo(){let t=document.baseURI.split("?")[0];window.open(t,"_self")}function po(){window.open(S.releasesPage,"_blank")}function uo(){window.open(S.youtube,"_blank")}function fo(){window.open(S.discordLink,"_blank")}function xo(){window.open(S.githubPage,"_blank")}function yo(){window.open(S.docsPage,"_blank")}function ko(t){return!t}function bo(t){return!t}function wo(t){return!t}function jo(t){return[t,{disabled:!1}]}async function go(){let t=document.getElementById("App");t&&await Jt({element:t,filename:document.title,prepare:Qt})}function vo(){return window.print()}function Co(t){return t?(0,a.jsx)("span",{className:"ml-3 shrink-0 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-emerald-700",children:"Recommended"}):null}function zo(t){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:t&&(0,a.jsx)(be,{size:14})})}function ne(){D({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{nt as a,Ze as c,st as i,Xe as l,rt as n,at as o,Qa as r,et as s,lo as t,Qe as u};
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-2q53zW3f.js"></script>
69
+ <script type="module" crossorigin src="./assets/index-lpZP7WFc.js"></script>
70
70
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-BFv3hW2s.js">
71
71
  <link rel="modulepreload" crossorigin href="./assets/chunk-LvLJmgfZ.js">
72
72
  <link rel="modulepreload" crossorigin href="./assets/react-Bj1aDYRI.js">
@@ -190,14 +190,14 @@
190
190
  <link rel="modulepreload" crossorigin href="./assets/ellipsis-KAhMaCIV.js">
191
191
  <link rel="modulepreload" crossorigin href="./assets/message-circle-QFYtD-Lc.js">
192
192
  <link rel="modulepreload" crossorigin href="./assets/react-resizable-panels.browser.esm-xQHRvEag.js">
193
- <link rel="modulepreload" crossorigin href="./assets/JsonOutput-VCohkYHD.js">
193
+ <link rel="modulepreload" crossorigin href="./assets/JsonOutput-CcRaYhT-.js">
194
194
  <link rel="modulepreload" crossorigin href="./assets/chart-no-axes-column-nqk474t8.js">
195
195
  <link rel="modulepreload" crossorigin href="./assets/square-function-DN3RwIjj.js">
196
196
  <link rel="modulepreload" crossorigin href="./assets/spec-6oUobewY.js">
197
197
  <link rel="modulepreload" crossorigin href="./assets/ellipsis-vertical-CkwWkOQL.js">
198
198
  <link rel="modulepreload" crossorigin href="./assets/refresh-cw-BmiNHssk.js">
199
199
  <link rel="modulepreload" crossorigin href="./assets/components-4Llkti3I.js">
200
- <link rel="modulepreload" crossorigin href="./assets/column-preview-C2YkNo17.js">
200
+ <link rel="modulepreload" crossorigin href="./assets/column-preview-hHmxmCnB.js">
201
201
  <link rel="modulepreload" crossorigin href="./assets/icons-C66kZH_4.js">
202
202
  <link rel="modulepreload" crossorigin href="./assets/floating-outline--H6knKWf.js">
203
203
  <link rel="modulepreload" crossorigin href="./assets/useAddCell-pxYjm9Vz.js">
@@ -218,12 +218,12 @@
218
218
  <link rel="modulepreload" crossorigin href="./assets/memoize-Tp7rARFe.js">
219
219
  <link rel="modulepreload" crossorigin href="./assets/get-C-qh_et5.js">
220
220
  <link rel="modulepreload" crossorigin href="./assets/_baseSet-CxV9N1bc.js">
221
- <link rel="modulepreload" crossorigin href="./assets/state-Bhr3ApM1.js">
221
+ <link rel="modulepreload" crossorigin href="./assets/state-BoK4XWzN.js">
222
222
  <link rel="modulepreload" crossorigin href="./assets/label-DTR8T0AE.js">
223
223
  <link rel="modulepreload" crossorigin href="./assets/textarea-jLEyGvlo.js">
224
224
  <link rel="modulepreload" crossorigin href="./assets/refresh-ccw-BuMhEaS9.js">
225
225
  <link rel="modulepreload" crossorigin href="./assets/trash-2-C5AzNaHr.js">
226
- <link rel="modulepreload" crossorigin href="./assets/form-At6i3Yzy.js">
226
+ <link rel="modulepreload" crossorigin href="./assets/form-3fPAWHbK.js">
227
227
  <link rel="modulepreload" crossorigin href="./assets/renderShortcut-B-72v1dC.js">
228
228
  <link rel="modulepreload" crossorigin href="./assets/field-Dpiu3eud.js">
229
229
  <link rel="modulepreload" crossorigin href="./assets/RSPContexts-CrATdGvz.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/frontend",
3
- "version": "0.23.2-dev34",
3
+ "version": "0.23.2-dev37",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -0,0 +1,83 @@
1
+ /* Copyright 2026 Marimo. All rights reserved. */
2
+
3
+ import { render } from "@testing-library/react";
4
+ import { describe, expect, it } from "vitest";
5
+ import { SentinelCell } from "../sentinel-cell";
6
+ import type { CellValueSentinel } from "../types";
7
+
8
+ function renderSentinel(sentinel: CellValueSentinel) {
9
+ const { container } = render(<SentinelCell sentinel={sentinel} />);
10
+ return container.querySelector("span")!;
11
+ }
12
+
13
+ describe("SentinelCell", () => {
14
+ it("renders null as None", () => {
15
+ const span = renderSentinel({ type: "null", value: null });
16
+ expect(span.textContent).toBe("None");
17
+ expect(span.getAttribute("aria-label")).toBe("None");
18
+ expect(span.className).toContain("italic");
19
+ expect(span.className).toContain("bg-muted");
20
+ });
21
+
22
+ it("renders empty string as <empty>", () => {
23
+ const span = renderSentinel({ type: "empty-string", value: "" });
24
+ expect(span.textContent).toBe("<empty>");
25
+ expect(span.getAttribute("aria-label")).toBe("empty string");
26
+ });
27
+
28
+ it("renders single space", () => {
29
+ const span = renderSentinel({ type: "whitespace", value: " " });
30
+ expect(span.textContent).toBe("\u2423");
31
+ expect(span.getAttribute("aria-label")).toBe("1 space");
32
+ });
33
+
34
+ it("renders multiple spaces", () => {
35
+ const span = renderSentinel({ type: "whitespace", value: " " });
36
+ expect(span.textContent).toBe("\u2423\u2423\u2423");
37
+ expect(span.getAttribute("aria-label")).toBe("3 spaces");
38
+ });
39
+
40
+ it("renders tab", () => {
41
+ const span = renderSentinel({ type: "whitespace", value: "\t" });
42
+ expect(span.textContent).toBe("\\t");
43
+ expect(span.getAttribute("aria-label")).toBe("1 tab");
44
+ });
45
+
46
+ it("renders newline", () => {
47
+ const span = renderSentinel({ type: "whitespace", value: "\n" });
48
+ expect(span.textContent).toBe("\\n");
49
+ expect(span.getAttribute("aria-label")).toBe("1 newline");
50
+ });
51
+
52
+ it("renders mixed whitespace", () => {
53
+ const span = renderSentinel({ type: "whitespace", value: "\t \n" });
54
+ expect(span.textContent).toBe("\\t\u2423\\n");
55
+ expect(span.getAttribute("aria-label")).toBe("1 tab, 1 space, 1 newline");
56
+ });
57
+
58
+ it("renders NaN", () => {
59
+ const span = renderSentinel({ type: "nan", value: Number.NaN });
60
+ expect(span.textContent).toBe("NaN");
61
+ });
62
+
63
+ it("renders inf", () => {
64
+ const span = renderSentinel({ type: "positive-infinity", value: Infinity });
65
+ expect(span.textContent).toBe("inf");
66
+ expect(span.getAttribute("title")).toBe("Infinity");
67
+ });
68
+
69
+ it("renders -inf", () => {
70
+ const span = renderSentinel({
71
+ type: "negative-infinity",
72
+ value: -Infinity,
73
+ });
74
+ expect(span.textContent).toBe("-inf");
75
+ expect(span.getAttribute("title")).toBe("-Infinity");
76
+ });
77
+
78
+ it("renders NaT", () => {
79
+ const span = renderSentinel({ type: "nat", value: "NaT" });
80
+ expect(span.textContent).toBe("NaT");
81
+ expect(span.getAttribute("title")).toBe("NaT (Not a Time)");
82
+ });
83
+ });
@@ -3,6 +3,7 @@
3
3
  import type { Table } from "@tanstack/react-table";
4
4
  import { describe, expect, it } from "vitest";
5
5
  import {
6
+ detectSentinel,
6
7
  getClipboardContent,
7
8
  getPageIndexForRow,
8
9
  getRawValue,
@@ -186,6 +187,133 @@ describe("getClipboardContent", () => {
186
187
  });
187
188
  });
188
189
 
190
+ describe("detectSentinel", () => {
191
+ it("should detect null and undefined", () => {
192
+ expect(detectSentinel(null, undefined)).toEqual({
193
+ type: "null",
194
+ value: null,
195
+ });
196
+ expect(detectSentinel(undefined, undefined)).toEqual({
197
+ type: "null",
198
+ value: undefined,
199
+ });
200
+ });
201
+
202
+ it("should detect empty string", () => {
203
+ expect(detectSentinel("", "string")).toEqual({
204
+ type: "empty-string",
205
+ value: "",
206
+ });
207
+ });
208
+
209
+ it("should detect whitespace-only strings", () => {
210
+ expect(detectSentinel(" ", "string")).toEqual({
211
+ type: "whitespace",
212
+ value: " ",
213
+ });
214
+ expect(detectSentinel(" ", "string")).toEqual({
215
+ type: "whitespace",
216
+ value: " ",
217
+ });
218
+ expect(detectSentinel("\t", "string")).toEqual({
219
+ type: "whitespace",
220
+ value: "\t",
221
+ });
222
+ expect(detectSentinel("\n", "string")).toEqual({
223
+ type: "whitespace",
224
+ value: "\n",
225
+ });
226
+ expect(detectSentinel("\t \n", "string")).toEqual({
227
+ type: "whitespace",
228
+ value: "\t \n",
229
+ });
230
+ });
231
+
232
+ it("should detect NaN", () => {
233
+ expect(detectSentinel(Number.NaN, "number")).toEqual({
234
+ type: "nan",
235
+ value: Number.NaN,
236
+ });
237
+ });
238
+
239
+ it("should detect Infinity", () => {
240
+ expect(detectSentinel(Number.POSITIVE_INFINITY, "number")).toEqual({
241
+ type: "positive-infinity",
242
+ value: Number.POSITIVE_INFINITY,
243
+ });
244
+ expect(detectSentinel(Number.NEGATIVE_INFINITY, "number")).toEqual({
245
+ type: "negative-infinity",
246
+ value: Number.NEGATIVE_INFINITY,
247
+ });
248
+ });
249
+
250
+ it("should return null for normal values", () => {
251
+ expect(detectSentinel("hello", "string")).toBeNull();
252
+ expect(detectSentinel(42, "number")).toBeNull();
253
+ expect(detectSentinel(0, "number")).toBeNull();
254
+ expect(detectSentinel(-1.5, "number")).toBeNull();
255
+ expect(detectSentinel(true, "boolean")).toBeNull();
256
+ expect(detectSentinel(false, "boolean")).toBeNull();
257
+ expect(detectSentinel({}, "unknown")).toBeNull();
258
+ expect(detectSentinel([], "unknown")).toBeNull();
259
+ });
260
+
261
+ it("should not match literal null-like strings", () => {
262
+ expect(detectSentinel("null", "string")).toBeNull();
263
+ expect(detectSentinel("NULL", "string")).toBeNull();
264
+ expect(detectSentinel("None", "string")).toBeNull();
265
+ });
266
+
267
+ it("should not match string NaN/Infinity in non-numeric columns", () => {
268
+ expect(detectSentinel("NaN", "string")).toBeNull();
269
+ expect(detectSentinel("Infinity", "string")).toBeNull();
270
+ expect(detectSentinel("-Infinity", "string")).toBeNull();
271
+ });
272
+
273
+ it("should match string NaN/Infinity in numeric columns", () => {
274
+ expect(detectSentinel("NaN", "number")).toEqual({
275
+ type: "nan",
276
+ value: "NaN",
277
+ });
278
+ expect(detectSentinel("Infinity", "number")).toEqual({
279
+ type: "positive-infinity",
280
+ value: "Infinity",
281
+ });
282
+ expect(detectSentinel("-Infinity", "number")).toEqual({
283
+ type: "negative-infinity",
284
+ value: "-Infinity",
285
+ });
286
+ expect(detectSentinel("inf", "number")).toEqual({
287
+ type: "positive-infinity",
288
+ value: "inf",
289
+ });
290
+ expect(detectSentinel("-inf", "number")).toEqual({
291
+ type: "negative-infinity",
292
+ value: "-inf",
293
+ });
294
+ });
295
+
296
+ it("should still not match normal strings in numeric columns", () => {
297
+ expect(detectSentinel("hello", "number")).toBeNull();
298
+ expect(detectSentinel("42", "number")).toBeNull();
299
+ });
300
+
301
+ it("should not match NaT in non-temporal columns", () => {
302
+ expect(detectSentinel("NaT", "string")).toBeNull();
303
+ });
304
+
305
+ it("should match NaT in temporal columns", () => {
306
+ expect(detectSentinel("NaT", "datetime")).toEqual({
307
+ type: "nat",
308
+ value: "NaT",
309
+ });
310
+ expect(detectSentinel("NaT", "date")).toEqual({
311
+ type: "nat",
312
+ value: "NaT",
313
+ });
314
+ });
315
+ });
316
+
189
317
  function createMockTableWithMeta<TData>(rawData?: TData[]): Table<TData> {
190
318
  return {
191
319
  options: {
@@ -53,6 +53,7 @@ import {
53
53
  SelectValue,
54
54
  } from "../ui/select";
55
55
  import { type ColumnFilterForType, Filter } from "./filters";
56
+ import { SentinelCell } from "./sentinel-cell";
56
57
  import {
57
58
  ClearFilterMenuItem,
58
59
  FilterButtons,
@@ -65,7 +66,7 @@ import {
65
66
  renderSortFilterIcon,
66
67
  renderSorts,
67
68
  } from "./header-items";
68
- import { stringifyUnknownValue } from "./utils";
69
+ import { detectSentinel, stringifyUnknownValue } from "./utils";
69
70
 
70
71
  const TOP_K_ROWS = 30;
71
72
 
@@ -647,6 +648,10 @@ const PopoverFilterByValues = <TData, TValue>({
647
648
  {filteredData.map(([value, count], rowIndex) => {
648
649
  const isSelected = chosenValues.has(value);
649
650
  const valueString = stringifyUnknownValue({ value });
651
+ const sentinel = detectSentinel(
652
+ value,
653
+ column.columnDef.meta?.dataType,
654
+ );
650
655
 
651
656
  return (
652
657
  <CommandItem
@@ -661,7 +666,11 @@ const PopoverFilterByValues = <TData, TValue>({
661
666
  className="mr-3 h-3.5 w-3.5"
662
667
  />
663
668
  <span className="flex-1 overflow-hidden max-h-20 line-clamp-3">
664
- {valueString}
669
+ {sentinel ? (
670
+ <SentinelCell sentinel={sentinel} />
671
+ ) : (
672
+ valueString
673
+ )}
665
674
  </span>
666
675
  <span className="ml-3">{count}</span>
667
676
  </CommandItem>
@@ -37,7 +37,10 @@ import {
37
37
  extractTimezone,
38
38
  type FieldTypesWithExternalType,
39
39
  INDEX_COLUMN_NAME,
40
+ isNumericType,
40
41
  } from "./types";
42
+ import { SentinelCell } from "./sentinel-cell";
43
+ import { detectSentinel } from "./utils";
41
44
  import { uniformSample } from "./uniformSample";
42
45
  import { MarkdownUrlDetector, UrlDetector } from "./url-detector";
43
46
 
@@ -163,7 +166,7 @@ export function generateColumns<T>({
163
166
  }
164
167
  // Auto right-align numeric columns
165
168
  const dataType = getMeta(key).dataType;
166
- if (dataType === "number" || dataType === "integer") {
169
+ if (isNumericType(dataType)) {
167
170
  return "right";
168
171
  }
169
172
  return undefined;
@@ -269,7 +272,7 @@ export function generateColumns<T>({
269
272
  !isCellSelected;
270
273
 
271
274
  const dataType = column.columnDef.meta?.dataType;
272
- const isNumeric = dataType === "number" || dataType === "integer";
275
+ const isNumeric = isNumericType(dataType);
273
276
  const cellStyles = getCellStyleClass({
274
277
  justify,
275
278
  wrapped,
@@ -522,6 +525,17 @@ export function renderCellValue<TData, TValue>({
522
525
 
523
526
  const isWrapped = column.getColumnWrapping?.() === "wrap";
524
527
 
528
+ // Sentinel values (null, whitespace, NaN, Infinity, NaT) rendered specially.
529
+ // Empty strings are left as-is
530
+ const sentinel = detectSentinel(value, dataType);
531
+ if (sentinel && sentinel.type !== "empty-string") {
532
+ return (
533
+ <div onClick={selectCell} className={cellStyles}>
534
+ <SentinelCell sentinel={sentinel} />
535
+ </div>
536
+ );
537
+ }
538
+
525
539
  if (dataType === "datetime" && typeof value === "string") {
526
540
  try {
527
541
  if (!isValid(value)) {
@@ -0,0 +1,90 @@
1
+ /* Copyright 2026 Marimo. All rights reserved. */
2
+
3
+ import type { CellValueSentinel, CellValueSentinelType } from "./types";
4
+
5
+ const WHITESPACE_CHARS: Record<string, { marker: string; name: string }> = {
6
+ " ": { marker: "\u2423", name: "space" }, // open box (space symbol)
7
+ "\t": { marker: "\\t", name: "tab" },
8
+ "\n": { marker: "\\n", name: "newline" },
9
+ "\r": { marker: "\\r", name: "newline" },
10
+ };
11
+
12
+ function renderWhitespaceMarkers(str: string): string {
13
+ return [...str].map((ch) => WHITESPACE_CHARS[ch]?.marker ?? ch).join("");
14
+ }
15
+
16
+ function describeWhitespace(str: string): string {
17
+ const counts: Record<string, number> = {};
18
+ for (const ch of str) {
19
+ const name = WHITESPACE_CHARS[ch]?.name ?? "character";
20
+ counts[name] = (counts[name] ?? 0) + 1;
21
+ }
22
+ return Object.entries(counts)
23
+ .map(([name, count]) => `${count} ${name}${count > 1 ? "s" : ""}`)
24
+ .join(", ");
25
+ }
26
+
27
+ interface SentinelConfig {
28
+ label: (value: CellValueSentinel["value"]) => string;
29
+ tooltip: (value: CellValueSentinel["value"]) => string;
30
+ ariaLabel: (value: CellValueSentinel["value"]) => string;
31
+ }
32
+
33
+ const SENTINEL_CONFIG: Record<CellValueSentinelType, SentinelConfig> = {
34
+ null: {
35
+ label: () => "None",
36
+ tooltip: () => "None",
37
+ ariaLabel: () => "None",
38
+ },
39
+ "empty-string": {
40
+ label: () => "<empty>",
41
+ tooltip: () => "<empty>",
42
+ ariaLabel: () => "empty string",
43
+ },
44
+ whitespace: {
45
+ label: (value) => renderWhitespaceMarkers(String(value)),
46
+ tooltip: (value) => describeWhitespace(String(value)),
47
+ ariaLabel: (value) => describeWhitespace(String(value)),
48
+ },
49
+ nan: {
50
+ label: () => "NaN",
51
+ tooltip: () => "NaN",
52
+ ariaLabel: () => "NaN",
53
+ },
54
+ "positive-infinity": {
55
+ label: () => "inf",
56
+ tooltip: () => "Infinity",
57
+ ariaLabel: () => "infinity",
58
+ },
59
+ "negative-infinity": {
60
+ label: () => "-inf",
61
+ tooltip: () => "-Infinity",
62
+ ariaLabel: () => "negative infinity",
63
+ },
64
+ nat: {
65
+ label: () => "NaT",
66
+ tooltip: () => "NaT (Not a Time)",
67
+ ariaLabel: () => "Not a Time",
68
+ },
69
+ };
70
+
71
+ export function SentinelCell({
72
+ sentinel,
73
+ }: {
74
+ sentinel: CellValueSentinel;
75
+ }): React.ReactElement {
76
+ const config = SENTINEL_CONFIG[sentinel.type];
77
+ const label = config.label(sentinel.value);
78
+ const tooltip = config.tooltip(sentinel.value);
79
+ const ariaLabel = config.ariaLabel(sentinel.value);
80
+
81
+ return (
82
+ <span
83
+ className="italic text-muted-foreground bg-muted rounded px-1"
84
+ aria-label={ariaLabel}
85
+ title={tooltip}
86
+ >
87
+ <span className="opacity-70">{label}</span>
88
+ </span>
89
+ );
90
+ }
@@ -95,6 +95,29 @@ export type DataTableSelection =
95
95
  | "multi-cell"
96
96
  | null;
97
97
 
98
+ export type CellValueSentinel =
99
+ | { type: "null"; value: null | undefined }
100
+ | { type: "empty-string"; value: string }
101
+ | { type: "whitespace"; value: string }
102
+ | { type: "nan"; value: number | string }
103
+ | { type: "positive-infinity"; value: number | string }
104
+ | { type: "negative-infinity"; value: number | string }
105
+ | { type: "nat"; value: string };
106
+
107
+ export type CellValueSentinelType = CellValueSentinel["type"];
108
+
109
+ export function isNumericType(
110
+ dataType: DataType | undefined,
111
+ ): dataType is "number" | "integer" {
112
+ return dataType === "number" || dataType === "integer";
113
+ }
114
+
115
+ export function isTemporalType(
116
+ dataType: DataType | undefined,
117
+ ): dataType is "date" | "datetime" | "time" {
118
+ return dataType === "date" || dataType === "datetime" || dataType === "time";
119
+ }
120
+
98
121
  export function extractTimezone(dtype: string | undefined): string | undefined {
99
122
  if (!dtype) {
100
123
  return undefined;