@marimo-team/frontend 0.21.2-dev77 → 0.21.2-dev79

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 (144) hide show
  1. package/dist/assets/{CellStatus-4D4t9Se5.js → CellStatus-BWh3L8zx.js} +1 -1
  2. package/dist/assets/JsonOutput-CQSoWTC4.js +49 -0
  3. package/dist/assets/{LazyAnyLanguageCodeMirror-CUh_vzRs.js → LazyAnyLanguageCodeMirror-BTEcIffn.js} +2 -2
  4. package/dist/assets/{MarimoErrorOutput-J_vzYyfF.js → MarimoErrorOutput-3snr3JrQ.js} +1 -1
  5. package/dist/assets/{RenderHTML-DVx_CJaM.js → RenderHTML-C9ZqxJ8H.js} +1 -1
  6. package/dist/assets/{add-cell-with-ai-DW05jmla.js → add-cell-with-ai-u_AX7UAd.js} +1 -1
  7. package/dist/assets/{add-connection-dialog-DAPvoleG.js → add-connection-dialog-COHTxTf9.js} +1 -1
  8. package/dist/assets/{agent-panel-B5ZFhjWl.js → agent-panel-CcEQv7FH.js} +1 -1
  9. package/dist/assets/{ai-model-dropdown-DXkdDtQw.js → ai-model-dropdown-Dybmv5gR.js} +1 -1
  10. package/dist/assets/{any-language-editor-Dd68WerD.js → any-language-editor-DVOJvjS_.js} +1 -1
  11. package/dist/assets/{app-config-button-CDhEUKd2.js → app-config-button-BldM7HZH.js} +1 -1
  12. package/dist/assets/{cell-editor-KjmNYBNd.js → cell-editor-BExD1h53.js} +1 -1
  13. package/dist/assets/{cell-link-CUJsH4Qt.js → cell-link-DV3G9zVQ.js} +1 -1
  14. package/dist/assets/{cells-D3d90crn.js → cells-B8rT_yJt.js} +3 -3
  15. package/dist/assets/{chat-display-Cydxvy57.js → chat-display-DSlMdLnv.js} +1 -1
  16. package/dist/assets/{chat-panel-CnuHNef3.js → chat-panel-BhurwxDK.js} +1 -1
  17. package/dist/assets/{chat-ui-DhcktjN6.js → chat-ui-BL1vsaOH.js} +1 -1
  18. package/dist/assets/{column-preview-CPBNo3h2.js → column-preview-BEoyw-go.js} +1 -1
  19. package/dist/assets/{command-CKa4yQEB.js → command-DvKBTmQJ.js} +1 -1
  20. package/dist/assets/{command-palette-CRiPRNeS.js → command-palette-pDgtiL0o.js} +1 -1
  21. package/dist/assets/{common-oy4UCqe2.js → common-MJu6yCEK.js} +1 -1
  22. package/dist/assets/{components-ZL3KSgMv.js → components-CWfQv9p5.js} +1 -1
  23. package/dist/assets/{components-DWwg8zgi.js → components-fIfcCZSp.js} +1 -1
  24. package/dist/assets/{context-aware-panel-B6Ooz9Lw.js → context-aware-panel-DJFzC2uh.js} +1 -1
  25. package/dist/assets/{datasource-BKNy10yM.js → datasource-xomiPYKd.js} +1 -1
  26. package/dist/assets/{dependency-graph-panel--USfW8LF.js → dependency-graph-panel-B24Gr6L4.js} +1 -1
  27. package/dist/assets/{dist-CtwZk3-9.js → dist-030LgPdB.js} +1 -1
  28. package/dist/assets/{dist-D0u6iH16.js → dist-1ZGGzJka.js} +1 -1
  29. package/dist/assets/{dist-CD2iFgV9.js → dist-4rKUx1vk.js} +1 -1
  30. package/dist/assets/dist-BBGASQNR.js +1 -0
  31. package/dist/assets/{dist-BXJ3fDZF.js → dist-BKkfH6MG.js} +1 -1
  32. package/dist/assets/dist-BPKAv9Tp.js +1 -0
  33. package/dist/assets/dist-BRCCPMsT.js +1 -0
  34. package/dist/assets/{dist-CyIcJpsa.js → dist-BXtR56No.js} +1 -1
  35. package/dist/assets/{dist-Cr4DBs1J.js → dist-BZJrw9vI.js} +1 -1
  36. package/dist/assets/{dist-B8C_eg-r.js → dist-B_cxg-E4.js} +11 -11
  37. package/dist/assets/{dist-1xshPfUL.js → dist-Bh-vrbeU.js} +1 -1
  38. package/dist/assets/{dist-DWPT6HNN.js → dist-BrZ_53nc.js} +1 -1
  39. package/dist/assets/{dist-D8gpRGBx.js → dist-C9G2F7Z1.js} +1 -1
  40. package/dist/assets/{dist-CTbQ-BIR.js → dist-CEeVCRd_.js} +1 -1
  41. package/dist/assets/dist-CFY2_7zu.js +1 -0
  42. package/dist/assets/dist-CJ8RtgvK.js +1 -0
  43. package/dist/assets/dist-CKgHI4pK.js +1 -0
  44. package/dist/assets/dist-COABhHhr.js +1 -0
  45. package/dist/assets/{dist-C7LdPk_u.js → dist-CRmIdrta.js} +1 -1
  46. package/dist/assets/{dist-GpTdRCER.js → dist-CTTKEfeu.js} +1 -1
  47. package/dist/assets/dist-Cp7t_Bws.js +1 -0
  48. package/dist/assets/dist-CtXb4bUU.js +2 -0
  49. package/dist/assets/dist-CueE_NHP.js +1 -0
  50. package/dist/assets/{dist-hU6zxLMp.js → dist-CwHZ5Z_A.js} +1 -1
  51. package/dist/assets/{dist-bjNxb2zu.js → dist-CwjzLMbM.js} +1 -1
  52. package/dist/assets/{dist-avBkgR1-.js → dist-D0Vj4Kqc.js} +1 -1
  53. package/dist/assets/{dist-Ekqk7Je0.js → dist-D699xT6P.js} +1 -1
  54. package/dist/assets/{dist-DiGcGOAW.js → dist-DA4gn7fy.js} +1 -1
  55. package/dist/assets/{dist-B0eVr-Dy.js → dist-DBBqNJ3C.js} +1 -1
  56. package/dist/assets/{dist-BZciZZkq.js → dist-DKnn_Tta.js} +1 -1
  57. package/dist/assets/dist-DROvTz9O.js +1 -0
  58. package/dist/assets/dist-DWBTB8aa.js +1 -0
  59. package/dist/assets/{dist-CDZ4_qwn.js → dist-DbWhwe76.js} +1 -1
  60. package/dist/assets/dist-DeX768Hg.js +1 -0
  61. package/dist/assets/{dist-C7M_d4Do.js → dist-DmMcU97h.js} +1 -1
  62. package/dist/assets/dist-DrDZNjDr.js +1 -0
  63. package/dist/assets/{dist-CJiSj3UX.js → dist-DvbdggRI.js} +1 -1
  64. package/dist/assets/{dist-DlOT-x3-.js → dist-JipYR0-e.js} +1 -1
  65. package/dist/assets/dist-LxLdJkvD.js +1 -0
  66. package/dist/assets/{dist-DLGHskqp.js → dist-SDxzhwJU.js} +1 -1
  67. package/dist/assets/dist-VjWmUZA0.js +1 -0
  68. package/dist/assets/dist-X-byYzEZ.js +1 -0
  69. package/dist/assets/dist-Xnna0a3m.js +1 -0
  70. package/dist/assets/{dist-BdL_qHYN.js → dist-epQooxQL.js} +1 -1
  71. package/dist/assets/dist-y02bFELW.js +1 -0
  72. package/dist/assets/{documentation-panel-5DuYRVpR.js → documentation-panel-DHLN-LCs.js} +1 -1
  73. package/dist/assets/{download-B2JL3FPf.js → download-CNJtCoWG.js} +1 -1
  74. package/dist/assets/{edit-page-DfGN5LkL.js → edit-page-D0G0qKOk.js} +3 -3
  75. package/dist/assets/{error-panel-CIYHoFDO.js → error-panel-BprMlRWd.js} +1 -1
  76. package/dist/assets/{esm-CoDEg_kt.js → esm-BMWduMhT.js} +1 -1
  77. package/dist/assets/{esm-zS5lBxz4.js → esm-BjKAkBIt.js} +1 -1
  78. package/dist/assets/{file-explorer-panel-C5juz5FN.js → file-explorer-panel-DschbL1I.js} +1 -1
  79. package/dist/assets/{file-icons-czkv18pY.js → file-icons-I3TgHXBH.js} +1 -1
  80. package/dist/assets/{floating-outline-Bx41Ogvx.js → floating-outline-BUsBWnrz.js} +1 -1
  81. package/dist/assets/{focus-KRgSpKIE.js → focus-DWfOBGUg.js} +1 -1
  82. package/dist/assets/{form-BpdTXD_T.js → form-DNvI4VkE.js} +1 -1
  83. package/dist/assets/{globals-CZsfDi9Q.js → globals-B7uZUVXG.js} +1 -1
  84. package/dist/assets/{home-page-XfqMC-k1.js → home-page-B1ioyqaQ.js} +1 -1
  85. package/dist/assets/{hooks-Yfiwwbz5.js → hooks-dmmemJB9.js} +1 -1
  86. package/dist/assets/{html-to-image-BKYNhmqD.js → html-to-image-BtnUxAf2.js} +1 -1
  87. package/dist/assets/{index-DV3al739.js → index-aCOJQiAd.js} +4 -4
  88. package/dist/assets/{kiosk-mode-C16509ZW.js → kiosk-mode-DvjY7Q8k.js} +1 -1
  89. package/dist/assets/{layout-C_2FnBzQ.js → layout-BJa4d_WQ.js} +1 -1
  90. package/dist/assets/{logs-panel-ZXqTa5b8.js → logs-panel-Iivn5vVF.js} +1 -1
  91. package/dist/assets/{markdown-renderer-BqnSkpMX.js → markdown-renderer-f7AvSa1a.js} +1 -1
  92. package/dist/assets/{name-cell-input-BGh_NBkP.js → name-cell-input-CzVNuMqK.js} +1 -1
  93. package/dist/assets/{outline-panel-9Y7Q0KI9.js → outline-panel-QyE6tr_2.js} +1 -1
  94. package/dist/assets/{packages-panel-BJGVP3jn.js → packages-panel-D9pbtgFY.js} +1 -1
  95. package/dist/assets/{panels-DsPJWTv2.js → panels-CqWMsuFv.js} +1 -1
  96. package/dist/assets/{process-output-BRgFATKG.js → process-output-5fC8hAfT.js} +1 -1
  97. package/dist/assets/{readonly-python-code-CjFy5OHl.js → readonly-python-code-CvuT43MO.js} +1 -1
  98. package/dist/assets/{run-page-BrRRKiC4.js → run-page-BtXltq0k.js} +1 -1
  99. package/dist/assets/{scratchpad-panel-B8WYJRWc.js → scratchpad-panel-i-qE-Pfc.js} +1 -1
  100. package/dist/assets/{session-panel-CHHY9VOz.js → session-panel-CL3OYqfu.js} +1 -1
  101. package/dist/assets/{snippets-panel-X_jZzShK.js → snippets-panel-Cn-0B9yk.js} +1 -1
  102. package/dist/assets/{state-4QyTnTMc.js → state-DLmIk5GZ.js} +1 -1
  103. package/dist/assets/{switch-BPjRwF9v.js → switch-CdyDieX7.js} +1 -1
  104. package/dist/assets/{textarea-C5wPsFgU.js → textarea-y9GCP54I.js} +1 -1
  105. package/dist/assets/{tracing-DBH1SUb1.js → tracing-CggYKKpk.js} +1 -1
  106. package/dist/assets/{tracing-panel-D1han9g0.js → tracing-panel-BYfwYVLg.js} +2 -2
  107. package/dist/assets/{useAddCell-Cd-c9fz3.js → useAddCell-BGHDEB1g.js} +1 -1
  108. package/dist/assets/{useCellActionButton-B45cjFLa.js → useCellActionButton-BbGQe83V.js} +1 -1
  109. package/dist/assets/{useDeleteCell-DVXZOIwJ.js → useDeleteCell-DG1VBfwX.js} +1 -1
  110. package/dist/assets/{useDependencyPanelTab-Bwlgmsum.js → useDependencyPanelTab-luj9RYTO.js} +1 -1
  111. package/dist/assets/{useNotebookActions-BZ6aaIhX.js → useNotebookActions-DN_VG9PO.js} +1 -1
  112. package/dist/assets/{useRunCells-D5eTD8tT.js → useRunCells--USKPEQy.js} +1 -1
  113. package/dist/assets/{useSplitCell-Bi4Ew2Lt.js → useSplitCell-DGXfa81A.js} +1 -1
  114. package/dist/index.html +36 -36
  115. package/package.json +2 -1
  116. package/src/__tests__/setup.ts +15 -0
  117. package/src/components/data-table/TableActions.tsx +8 -2
  118. package/src/components/data-table/__tests__/data-table.test.tsx +63 -0
  119. package/src/components/data-table/data-table.tsx +10 -31
  120. package/src/components/data-table/hooks/use-scroll-container-height.ts +97 -0
  121. package/src/components/data-table/renderers.tsx +103 -46
  122. package/src/components/data-table/types.ts +14 -0
  123. package/src/core/islands/main.ts +0 -1
  124. package/src/core/websocket/useMarimoKernelConnection.tsx +1 -10
  125. package/dist/assets/JsonOutput-BVgaYt_7.js +0 -46
  126. package/dist/assets/dist-B7NwbXlb.js +0 -1
  127. package/dist/assets/dist-BDiiLamW.js +0 -2
  128. package/dist/assets/dist-BRF5jPsH.js +0 -1
  129. package/dist/assets/dist-BVFwO-BJ.js +0 -1
  130. package/dist/assets/dist-Bq3Z0YJc.js +0 -1
  131. package/dist/assets/dist-C2UCjrCj.js +0 -1
  132. package/dist/assets/dist-C5G9yFjI.js +0 -1
  133. package/dist/assets/dist-CDNIv_aA.js +0 -1
  134. package/dist/assets/dist-CRRNYOP4.js +0 -1
  135. package/dist/assets/dist-CVcK0lpx.js +0 -1
  136. package/dist/assets/dist-D5IpadHf.js +0 -1
  137. package/dist/assets/dist-D6UcS85E.js +0 -1
  138. package/dist/assets/dist-D7D_TkHI.js +0 -1
  139. package/dist/assets/dist-DBiFepQi.js +0 -1
  140. package/dist/assets/dist-DDcAAms9.js +0 -1
  141. package/dist/assets/dist-DboypqFS.js +0 -1
  142. package/dist/assets/dist-DucJ1hOW.js +0 -1
  143. package/dist/assets/dist-H-uU4H82.js +0 -1
  144. package/dist/assets/dist-JLLCRw8G.js +0 -1
@@ -1 +1 @@
1
- import{s as we}from"./chunk-LvLJmgfZ.js";import{d as L,l as Ze,p as Qe,u as de}from"./useEvent-O0nX5vok.js";import{t as et}from"./react-Bj1aDYRI.js";import{Cn as tt,E as ge,Ht as at,Mr as ot,_ as nt,bn as it,et as st,fr as lt,h as je,ir as rt,nr as dt,nt as ve,sr as ct,t as ht,tt as pt,vi as ce,vn as mt,yn as ut}from"./cells-D3d90crn.js";import{t as _}from"./compiler-runtime-B3qBwwSJ.js";import{n as ft}from"./assertNever-DWSyoPEi.js";import{s as Ce}from"./useLifecycle-DA9DjSPo.js";import{i as yt,n as ze}from"./add-connection-dialog-DAPvoleG.js";import{n as kt,x as bt}from"./ai-model-dropdown-DXkdDtQw.js";import{c as Me,m as H}from"./useEventListener-Dy81QR4n.js";import{y as xt}from"./utils-tNbLd14P.js";import{n as A,t as We}from"./constants-Rz_lD4HK.js";import{S as he,h as wt,x as gt}from"./config-DRN1Q5Ol.js";import{t as jt}from"./jsx-runtime-icT_Ltz2.js";import{r as vt,t as pe}from"./button-Ej3vmCIF.js";import{r as T}from"./requests-Bgjtqo_1.js";import{t as h}from"./createLucideIcon-Cm-Z7dYr.js";import{a as Se,f as Ct,i as De,m as zt,p as _e,u as Ae}from"./layout-C_2FnBzQ.js";import{t as Pe}from"./check-DZA_bRpw.js";import{c as Ne,d as me,n as Mt,o as Wt,r as ue,t as St}from"./download-B2JL3FPf.js";import{n as Dt}from"./maps-DQ4X82OB.js";import{r as _t}from"./useCellActionButton-B45cjFLa.js";import{t as At}from"./copy-CkudG0Ej.js";import{t as Pt}from"./download-DBW9RXtT.js";import{t as Nt}from"./eye-off-vwi9L975.js";import{t as It}from"./file-plus-corner-lLQw9OnR.js";import{t as J}from"./file-DzHkbIdO.js";import{t as Et}from"./github-BVtI-3F1.js";import{m as Lt}from"./form-BpdTXD_T.js";import{n as Ht,r as Tt,t as qt}from"./youtube-DE-Ej6FR.js";import{n as Rt,t as Bt}from"./square-CxAsQQ77.js";import{t as Ft}from"./image-DXfkah9d.js";import{t as Ot}from"./link-Cf10mh3t.js";import{r as Vt}from"./input-6cciao_l.js";import{t as Yt}from"./settings-dVFT0AvU.js";import{y as Kt}from"./textarea-C5wPsFgU.js";import{t as C}from"./use-toast-BhMe50aT.js";import{n as Ie,t as Ut}from"./paths-bMgYkaP2.js";import{o as $t}from"./session-DKzpcHdK.js";import{a as Gt,c as Jt,i as Xt,n as Zt,r as Qt,s as ea,t as ta}from"./select-dNVaT2hT.js";import{t as aa}from"./tooltip-BCGmr4TU.js";import{o as oa}from"./alert-dialog-BfHy00ko.js";import{a as na,c as ia,i as sa,n as la,r as ra}from"./dialog-Dr3dl0Mn.js";import{n as fe}from"./ImperativeModal-DyRrGcKH.js";import{r as da,t as ca}from"./share-BKUsoia0.js";import{n as X}from"./copy-CIPmwSuj.js";import{r as ha}from"./useRunCells-D5eTD8tT.js";import{a as pa}from"./cell-link-CUJsH4Qt.js";import{a as ma}from"./renderShortcut-BcNNtnIV.js";import{t as ua}from"./icons-CAcY8GzB.js";import{t as fa}from"./links-BwkQr4sn.js";import{r as ya,t as Ee}from"./hooks-Yfiwwbz5.js";import{t as Le}from"./types-CzVV1kKu.js";var ka=h("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),ba=h("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),He=h("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"}]]),Te=h("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"}]]),qe=h("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"}]]),xa=h("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"}]]),wa=h("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"}]]),ga=h("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"}]]),Re=h("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"}]]),ja=h("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"}]]),va=h("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"}]]),Ca=h("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Be=h("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"}]]),za=h("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"}]]),Ma=h("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"}]]),Fe=h("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"}]]),Oe=_(),ye=we(et(),1),a=we(jt(),1),Z="https://static.marimo.app";const Wa=e=>{let t=(0,Oe.c)(25),{onClose:n}=e,[o,s]=(0,ye.useState)(""),{exportAsHTML:r}=T(),l=`${o}-${Math.random().toString(36).slice(2,6)}`,i=`${Z}/static/${l}`,d;t[0]!==r||t[1]!==n||t[2]!==l?(d=async v=>{v.preventDefault(),n();let N=await r({download:!1,includeCode:!0,files:Ct.INSTANCE.filenames()}),z=C({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Z}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:N,path:l})}).catch(()=>{z.dismiss(),C({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:A.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),z.dismiss(),C({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."]})})},t[0]=r,t[1]=n,t[2]=l,t[3]=d):d=t[3];let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(ia,{children:"Share static notebook"}),t[4]=m):m=t[4];let w;t[5]===Symbol.for("react.memo_cache_sentinel")?(w=(0,a.jsxs)(na,{children:[m,(0,a.jsxs)(ra,{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:Z,target:"_blank",children:Z}),"."]})]}),t[5]=w):w=t[5];let g;t[6]===Symbol.for("react.memo_cache_sentinel")?(g=v=>{s(v.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},t[6]=g):g=t[6];let u;t[7]===o?u=t[8]:(u=(0,a.jsx)(Vt,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:g,required:!0,autoComplete:"off"}),t[7]=o,t[8]=u);let f;t[9]===i?f=t[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)(Sa,{text:i}),(0,a.jsx)("span",{className:"text-primary",children:i})]})]}),t[9]=i,t[10]=f);let y;t[11]!==u||t[12]!==f?(y=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[u,f]}),t[11]=u,t[12]=f,t[13]=y):y=t[13];let k;t[14]===n?k=t[15]:(k=(0,a.jsx)(pe,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),t[14]=n,t[15]=k);let b;t[16]===i?b=t[17]:(b=(0,a.jsx)(pe,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await X(i)},children:"Create"}),t[16]=i,t[17]=b);let x;t[18]!==k||t[19]!==b?(x=(0,a.jsxs)(sa,{children:[k,b]}),t[18]=k,t[19]=b,t[20]=x):x=t[20];let j;return t[21]!==d||t[22]!==x||t[23]!==y?(j=(0,a.jsx)(la,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:d,children:[w,y,x]})}),t[21]=d,t[22]=x,t[23]=y,t[24]=j):j=t[24],j};var Sa=e=>{let t=(0,Oe.c)(8),[n,o]=ye.useState(!1),s;t[0]===e.text?s=t[1]:(s=vt.stopPropagation(async m=>{m.preventDefault(),await X(e.text),o(!0),setTimeout(()=>o(!1),2e3)}),t[0]=e.text,t[1]=s);let r=s,l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(At,{size:14,strokeWidth:1.5}),t[2]=l):l=t[2];let i;t[3]===r?i=t[4]:(i=(0,a.jsx)(pe,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:l}),t[3]=r,t[4]=i);let d;return t[5]!==n||t[6]!==i?(d=(0,a.jsx)(aa,{content:"Copied!",open:n,children:i}),t[5]=n,t[6]=i,t[7]=d):d=t[7],d},Da=_();function _a(){let e=document.getElementsByClassName(We.outputArea);for(let t of e){let n=t.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=ce.findElement(t);if(!o){H.warn("Could not find HTMLCellId for visible output area",t);continue}return{cellId:ce.parse(o.id)}}}return H.warn("No visible output area found for scroll anchor"),null}function Aa(e){if(!e){H.warn("No scroll anchor provided to restore scroll position");return}let t=document.getElementById(ce.create(e.cellId));if(!t){H.warn("Could not find cell element to restore scroll position",e.cellId);return}if(!t.querySelector(`.${We.outputArea}`)){H.warn("Could not find output area to restore scroll position",e.cellId);return}t.scrollIntoView({block:"start",behavior:"auto"})}function Ve(){let e=(0,Da.c)(2),t=L(ve),n;return e[0]===t?n=e[1]:(n=()=>{let o=_a();t(s=>({mode:pt(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Aa(o)})})},e[0]=t,e[1]=n),n}const Ye=Qe(!1);var Pa=_();const Na=()=>{let e=(0,Pa.c)(7),{selectedLayout:t}=Se(),{setLayoutView:n}=De();if(he()&&!tt("wasm_layouts"))return null;let o;e[0]===n?o=e[1]:(o=i=>n(i),e[0]=n,e[1]=o);let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(ea,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)(Jt,{placeholder:"Select a view"})}),e[2]=s):s=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Zt,{children:(0,a.jsxs)(Qt,{children:[(0,a.jsx)(Gt,{children:"View as"}),Le.map(Ea)]})}),e[3]=r):r=e[3];let l;return e[4]!==t||e[5]!==o?(l=(0,a.jsxs)(ta,{"data-testid":"layout-select",value:t,onValueChange:o,children:[s,r]}),e[4]=t,e[5]=o,e[6]=l):l=e[6],l};function Ia(e){return(0,a.jsx)(Ke(e),{className:"h-4 w-4"})}function Ke(e){switch(e){case"vertical":return ja;case"grid":return Tt;case"slides":return Be;default:return ft(e),Bt}}function Ue(e){return Ce(e)}function Ea(e){return(0,a.jsx)(Xt,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Ia(e),(0,a.jsx)("span",{children:Ue(e)})]})},e)}async function La(e){let{filename:t,preset:n,downloadPDF:o}=e;await o({filename:t,webpdf:!1,preset:n,includeInputs:!0,rasterServer:"static"})}var Ha=_();function Ta(e){let t=(0,Ha.c)(5),{openPrompt:n,closeModal:o}=fe(),{sendCopy:s}=T(),r;return t[0]!==o||t[1]!==n||t[2]!==s||t[3]!==e?(r=()=>{if(!e)return null;let l=Ut.guessDeliminator(e);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${Ie.basename(e)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:i=>{let d=l.join(Ie.dirname(e),i);s({source:e,destination:d}).then(()=>{o(),C({title:"Notebook copied",description:"A copy of the notebook has been created."}),fa(d)})}})},t[0]=o,t[1]=n,t[2]=s,t[3]=e,t[4]=r):r=t[4],r}const qa=()=>{let{updateCellConfig:e}=ge(),{saveCellConfig:t}=T();return(0,ye.useCallback)(async()=>{let n=new at,o=je(),s=o.cellIds.inOrderIds,r={};for(let i of s){if(o.cellData[i]===void 0)continue;let{code:d,config:m}=o.cellData[i];m.hide_code||n.isSupported(d)&&(r[i]={hide_code:!0})}let l=Me.entries(r);if(l.length!==0){await t({configs:r});for(let[i,d]of l)e({cellId:i,config:d})}},[e])};var Ra=_();function $e(){let e=(0,Ra.c)(4),{openConfirm:t}=fe(),n=L(wt),{sendRestart:o}=T(),s;return e[0]!==t||e[1]!==o||e[2]!==n?(s=()=>{t({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)(oa,{onClick:async()=>{n({state:gt.CLOSING}),await o(),da()},"aria-label":"Confirm Restart",children:"Restart"})})},e[0]=t,e[1]=o,e[2]=n,e[3]=s):s=e[3],s}var Ba=_(),P=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation()};function Fa(){var be,xe;let e=(0,Ba.c)(51),t=pa(),{openModal:n,closeModal:o}=fe(),{toggleApplication:s}=mt(),{selectedPanel:r}=ut(),[l]=Ze(ve),i=de(st),d=qa(),[m]=xt(),{updateCellConfig:w,undoDeleteCell:g,clearAllCellOutputs:u,addSetupCellIfDoesntExist:f,collapseAllCells:y,expandAllCells:k}=ge(),b=$e(),x=ha(),j=Ta(t),v=L(Ye),N=L(kt),z=L(bt),{exportAsIPYNB:ee,exportAsMarkdown:te,readCode:I,saveCellConfig:ae,updateCellOutputs:M}=T(),W=ya(),oe=de(nt),ne=de(ht),{selectedLayout:q}=Se(),{setLayoutView:ie}=De(),R=Ve(),B=((be=m.sharing)==null?void 0:be.html)??!0,F=((xe=m.sharing)==null?void 0:xe.wasm)??!0,ke=!he(),se=q==="slides",Ge=so,Je=io,O;e[0]!==t||e[1]!==W||e[2]!==M?(O=async c=>{let{preset:p,title:E}=c;if(!t){Q();return}await Ne(E,async re=>{await Ee({takeScreenshots:()=>W({progress:re}),updateCellOutputs:M}),await La({filename:t,preset:p,downloadPDF:Mt})})},e[0]=t,e[1]=W,e[2]=M,e[3]=O):O=e[3];let S=O,V;e[4]===S?V=e[5]:(V=async()=>{if(ke){await S({preset:"document",title:"Downloading Document PDF..."});return}let c=new Event("export-beforeprint"),p=new Event("export-afterprint");window.dispatchEvent(c),setTimeout(no,0),setTimeout(()=>window.dispatchEvent(p),0)},e[4]=S,e[5]=V);let Y=V,K;e[6]!==ee||e[7]!==t||e[8]!==W||e[9]!==M?(K=async()=>{if(!t){Q();return}await Ne("Downloading IPYNB...",async c=>{await Ee({takeScreenshots:()=>W({progress:c}),updateCellOutputs:M});let p=await ee({download:!1});ue(new Blob([p],{type:"application/x-ipynb+json"}),me.toIPYNB(document.title))})},e[6]=ee,e[7]=t,e[8]=W,e[9]=M,e[10]=K):K=e[10];let le=K,U;e[11]===Symbol.for("react.memo_cache_sentinel")?(U=(0,a.jsx)(Pt,{size:14,strokeWidth:1.5}),e[11]=U):U=e[11];let $;e[12]===Symbol.for("react.memo_cache_sentinel")?($=(0,a.jsx)(_e,{size:14,strokeWidth:1.5}),e[12]=$):$=e[12];let D;e[13]===t?D=e[14]:(D=async()=>{if(!t){Q();return}await Ae({filename:t,includeCode:!0})},e[13]=t,e[14]=D);let G;return e[15]!==f||e[16]!==ne||e[17]!==u||e[18]!==o||e[19]!==y||e[20]!==j||e[21]!==S||e[22]!==k||e[23]!==te||e[24]!==t||e[25]!==Y||e[26]!==le||e[27]!==oe||e[28]!==d||e[29]!==se||e[30]!==i||e[31]!==n||e[32]!==I||e[33]!==b||e[34]!==x||e[35]!==ae||e[36]!==q||e[37]!==r||e[38]!==v||e[39]!==z||e[40]!==ie||e[41]!==N||e[42]!==B||e[43]!==F||e[44]!==D||e[45]!==s||e[46]!==R||e[47]!==g||e[48]!==w||e[49]!==l.mode?(G=[{icon:U,label:"Download",handle:P,dropdown:[{icon:$,label:"Download as HTML",handle:D},{icon:(0,a.jsx)(_e,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!t){Q();return}await Ae({filename:t,includeCode:!1})}},{icon:(0,a.jsx)(ua,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let c=await te({download:!1});ue(new Blob([c],{type:"text/plain"}),me.toMarkdown(document.title))}},{icon:(0,a.jsx)(va,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:le},{icon:(0,a.jsx)(zt,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let c=await I();ue(new Blob([c.contents],{type:"text/plain"}),me.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(Ft,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:l.mode!=="present",tooltip:l.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",ma("global.hideCode",!1)]}),handle:oo},se?{divider:!0,icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:P,dropdown:[{icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:Y},{icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:Je(!0),hidden:!ke,handle:async()=>{await S({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:Y}]},{icon:(0,a.jsx)(za,{size:14,strokeWidth:1.5}),label:"Share",handle:P,hidden:!B&&!F,dropdown:[{icon:(0,a.jsx)(Lt,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!B,handle:async()=>{n((0,a.jsx)(Wa,{onClose:o}))}},{icon:(0,a.jsx)(Ot,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!F,handle:async()=>{await X(ca({code:(await I()).contents})),C({title:"Copied",description:"Link copied to clipboard."})}}]},{icon:(0,a.jsx)(Ca,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:P,dropdown:it.flatMap(c=>{let{type:p,Icon:E,hidden:re,additionalKeywords:Xe}=c;return re?[]:{label:Ce(p),rightElement:Ge(r===p),icon:(0,a.jsx)(E,{size:14,strokeWidth:1.5}),handle:()=>s(p),additionalKeywords:Xe}})},{icon:(0,a.jsx)(Be,{size:14,strokeWidth:1.5}),label:"Present as",handle:P,dropdown:[{icon:l.mode==="present"?(0,a.jsx)(Kt,{size:14,strokeWidth:1.5}):(0,a.jsx)(Re,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{R()}},...Le.map((c,p)=>{let E=Ke(c);return{divider:p===0,label:Ue(c),icon:(0,a.jsx)(E,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:q===c&&(0,a.jsx)(Pe,{size:14})}),handle:()=>{ie(c),l.mode==="edit"&&R()}}})]},{icon:(0,a.jsx)(wa,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!t||he(),handle:j},{icon:(0,a.jsx)(He,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!t,handle:async()=>{await X((await I()).contents),C({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(_t,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!oe||i,handle:async()=>{let c=ot(je());await ae({configs:Me.fromEntries(c.map(ao))});for(let p of c)w({cellId:p,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(qe,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{f({})}},{icon:(0,a.jsx)(rt,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(ze,{onClose:o}))}},{icon:(0,a.jsx)(yt,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(ze,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(Fe,{size:14,strokeWidth:1.5}),label:"Undo cell deletion",hidden:!ne||i,handle:()=>{g()}},{icon:(0,a.jsx)(Ma,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:b,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(xa,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{x()}},{icon:(0,a.jsx)(ct,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{u()}},{icon:(0,a.jsx)(Nt,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:d,redundant:!0},{icon:(0,a.jsx)(ba,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:y,redundant:!0},{icon:(0,a.jsx)(ka,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:k,redundant:!0},{divider:!0,icon:(0,a.jsx)(Te,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>v(to)},{icon:(0,a.jsx)(ga,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>z(eo)},{icon:(0,a.jsx)(Yt,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>N(Qa),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(Dt,{size:14,strokeWidth:1.5}),label:"Resources",handle:P,dropdown:[{icon:(0,a.jsx)(lt,{size:14,strokeWidth:1.5}),label:"Documentation",handle:Za},{icon:(0,a.jsx)(Et,{size:14,strokeWidth:1.5}),label:"GitHub",handle:Xa},{icon:(0,a.jsx)(Ht,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:Ja},{icon:(0,a.jsx)(qt,{size:14,strokeWidth:1.5}),label:"YouTube",handle:Ga},{icon:(0,a.jsx)(dt,{size:14,strokeWidth:1.5}),label:"Changelog",handle:$a}]},{divider:!0,icon:(0,a.jsx)(Rt,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:Ua},{icon:(0,a.jsx)(It,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:Ka}].filter(Ya).map(Oa),e[15]=f,e[16]=ne,e[17]=u,e[18]=o,e[19]=y,e[20]=j,e[21]=S,e[22]=k,e[23]=te,e[24]=t,e[25]=Y,e[26]=le,e[27]=oe,e[28]=d,e[29]=se,e[30]=i,e[31]=n,e[32]=I,e[33]=b,e[34]=x,e[35]=ae,e[36]=q,e[37]=r,e[38]=v,e[39]=z,e[40]=ie,e[41]=N,e[42]=B,e[43]=F,e[44]=D,e[45]=s,e[46]=R,e[47]=g,e[48]=w,e[49]=l.mode,e[50]=G):G=e[50],G}function Oa(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(Va)}:e}function Va(e){return!e.hidden}function Ya(e){return!e.hidden}function Ka(){let e=$t();window.open(e,"_blank")}function Ua(){let e=document.baseURI.split("?")[0];window.open(e,"_self")}function $a(){window.open(A.releasesPage,"_blank")}function Ga(){window.open(A.youtube,"_blank")}function Ja(){window.open(A.discordLink,"_blank")}function Xa(){window.open(A.githubPage,"_blank")}function Za(){window.open(A.docsPage,"_blank")}function Qa(e){return!e}function eo(e){return!e}function to(e){return!e}function ao(e){return[e,{disabled:!1}]}async function oo(){let e=document.getElementById("App");e&&await Wt({element:e,filename:document.title,prepare:St})}function no(){return window.print()}function io(e){return e?(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 so(e){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:e&&(0,a.jsx)(Pe,{size:14})})}function Q(){C({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{Ve as a,qe as c,Ye as i,Te as l,$e as n,Fe as o,Na as r,Re as s,Fa as t,He as u};
1
+ import{s as we}from"./chunk-LvLJmgfZ.js";import{d as L,l as Ze,p as Qe,u as de}from"./useEvent-O0nX5vok.js";import{t as et}from"./react-Bj1aDYRI.js";import{Cn as tt,E as ge,Ht as at,Mr as ot,_ as nt,bn as it,et as st,fr as lt,h as je,ir as rt,nr as dt,nt as ve,sr as ct,t as ht,tt as pt,vi as ce,vn as mt,yn as ut}from"./cells-B8rT_yJt.js";import{t as _}from"./compiler-runtime-B3qBwwSJ.js";import{n as ft}from"./assertNever-DWSyoPEi.js";import{s as Ce}from"./useLifecycle-DA9DjSPo.js";import{i as yt,n as ze}from"./add-connection-dialog-COHTxTf9.js";import{n as kt,x as bt}from"./ai-model-dropdown-Dybmv5gR.js";import{c as Me,m as H}from"./useEventListener-Dy81QR4n.js";import{y as xt}from"./utils-tNbLd14P.js";import{n as A,t as We}from"./constants-Rz_lD4HK.js";import{S as he,h as wt,x as gt}from"./config-DRN1Q5Ol.js";import{t as jt}from"./jsx-runtime-icT_Ltz2.js";import{r as vt,t as pe}from"./button-Ej3vmCIF.js";import{r as T}from"./requests-Bgjtqo_1.js";import{t as h}from"./createLucideIcon-Cm-Z7dYr.js";import{a as Se,f as Ct,i as De,m as zt,p as _e,u as Ae}from"./layout-BJa4d_WQ.js";import{t as Pe}from"./check-DZA_bRpw.js";import{c as Ne,d as me,n as Mt,o as Wt,r as ue,t as St}from"./download-CNJtCoWG.js";import{n as Dt}from"./maps-DQ4X82OB.js";import{r as _t}from"./useCellActionButton-BbGQe83V.js";import{t as At}from"./copy-CkudG0Ej.js";import{t as Pt}from"./download-DBW9RXtT.js";import{t as Nt}from"./eye-off-vwi9L975.js";import{t as It}from"./file-plus-corner-lLQw9OnR.js";import{t as J}from"./file-DzHkbIdO.js";import{t as Et}from"./github-BVtI-3F1.js";import{m as Lt}from"./form-DNvI4VkE.js";import{n as Ht,r as Tt,t as qt}from"./youtube-DE-Ej6FR.js";import{n as Rt,t as Bt}from"./square-CxAsQQ77.js";import{t as Ft}from"./image-DXfkah9d.js";import{t as Ot}from"./link-Cf10mh3t.js";import{r as Vt}from"./input-6cciao_l.js";import{t as Yt}from"./settings-dVFT0AvU.js";import{y as Kt}from"./textarea-y9GCP54I.js";import{t as C}from"./use-toast-BhMe50aT.js";import{n as Ie,t as Ut}from"./paths-bMgYkaP2.js";import{o as $t}from"./session-DKzpcHdK.js";import{a as Gt,c as Jt,i as Xt,n as Zt,r as Qt,s as ea,t as ta}from"./select-dNVaT2hT.js";import{t as aa}from"./tooltip-BCGmr4TU.js";import{o as oa}from"./alert-dialog-BfHy00ko.js";import{a as na,c as ia,i as sa,n as la,r as ra}from"./dialog-Dr3dl0Mn.js";import{n as fe}from"./ImperativeModal-DyRrGcKH.js";import{r as da,t as ca}from"./share-BKUsoia0.js";import{n as X}from"./copy-CIPmwSuj.js";import{r as ha}from"./useRunCells--USKPEQy.js";import{a as pa}from"./cell-link-DV3G9zVQ.js";import{a as ma}from"./renderShortcut-BcNNtnIV.js";import{t as ua}from"./icons-CAcY8GzB.js";import{t as fa}from"./links-BwkQr4sn.js";import{r as ya,t as Ee}from"./hooks-dmmemJB9.js";import{t as Le}from"./types-CzVV1kKu.js";var ka=h("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),ba=h("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),He=h("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"}]]),Te=h("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"}]]),qe=h("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"}]]),xa=h("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"}]]),wa=h("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"}]]),ga=h("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"}]]),Re=h("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"}]]),ja=h("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"}]]),va=h("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"}]]),Ca=h("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Be=h("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"}]]),za=h("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"}]]),Ma=h("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"}]]),Fe=h("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"}]]),Oe=_(),ye=we(et(),1),a=we(jt(),1),Z="https://static.marimo.app";const Wa=e=>{let t=(0,Oe.c)(25),{onClose:n}=e,[o,s]=(0,ye.useState)(""),{exportAsHTML:r}=T(),l=`${o}-${Math.random().toString(36).slice(2,6)}`,i=`${Z}/static/${l}`,d;t[0]!==r||t[1]!==n||t[2]!==l?(d=async v=>{v.preventDefault(),n();let N=await r({download:!1,includeCode:!0,files:Ct.INSTANCE.filenames()}),z=C({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Z}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:N,path:l})}).catch(()=>{z.dismiss(),C({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:A.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),z.dismiss(),C({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."]})})},t[0]=r,t[1]=n,t[2]=l,t[3]=d):d=t[3];let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(ia,{children:"Share static notebook"}),t[4]=m):m=t[4];let w;t[5]===Symbol.for("react.memo_cache_sentinel")?(w=(0,a.jsxs)(na,{children:[m,(0,a.jsxs)(ra,{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:Z,target:"_blank",children:Z}),"."]})]}),t[5]=w):w=t[5];let g;t[6]===Symbol.for("react.memo_cache_sentinel")?(g=v=>{s(v.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},t[6]=g):g=t[6];let u;t[7]===o?u=t[8]:(u=(0,a.jsx)(Vt,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:g,required:!0,autoComplete:"off"}),t[7]=o,t[8]=u);let f;t[9]===i?f=t[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)(Sa,{text:i}),(0,a.jsx)("span",{className:"text-primary",children:i})]})]}),t[9]=i,t[10]=f);let y;t[11]!==u||t[12]!==f?(y=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[u,f]}),t[11]=u,t[12]=f,t[13]=y):y=t[13];let k;t[14]===n?k=t[15]:(k=(0,a.jsx)(pe,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),t[14]=n,t[15]=k);let b;t[16]===i?b=t[17]:(b=(0,a.jsx)(pe,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await X(i)},children:"Create"}),t[16]=i,t[17]=b);let x;t[18]!==k||t[19]!==b?(x=(0,a.jsxs)(sa,{children:[k,b]}),t[18]=k,t[19]=b,t[20]=x):x=t[20];let j;return t[21]!==d||t[22]!==x||t[23]!==y?(j=(0,a.jsx)(la,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:d,children:[w,y,x]})}),t[21]=d,t[22]=x,t[23]=y,t[24]=j):j=t[24],j};var Sa=e=>{let t=(0,Oe.c)(8),[n,o]=ye.useState(!1),s;t[0]===e.text?s=t[1]:(s=vt.stopPropagation(async m=>{m.preventDefault(),await X(e.text),o(!0),setTimeout(()=>o(!1),2e3)}),t[0]=e.text,t[1]=s);let r=s,l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(At,{size:14,strokeWidth:1.5}),t[2]=l):l=t[2];let i;t[3]===r?i=t[4]:(i=(0,a.jsx)(pe,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:l}),t[3]=r,t[4]=i);let d;return t[5]!==n||t[6]!==i?(d=(0,a.jsx)(aa,{content:"Copied!",open:n,children:i}),t[5]=n,t[6]=i,t[7]=d):d=t[7],d},Da=_();function _a(){let e=document.getElementsByClassName(We.outputArea);for(let t of e){let n=t.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=ce.findElement(t);if(!o){H.warn("Could not find HTMLCellId for visible output area",t);continue}return{cellId:ce.parse(o.id)}}}return H.warn("No visible output area found for scroll anchor"),null}function Aa(e){if(!e){H.warn("No scroll anchor provided to restore scroll position");return}let t=document.getElementById(ce.create(e.cellId));if(!t){H.warn("Could not find cell element to restore scroll position",e.cellId);return}if(!t.querySelector(`.${We.outputArea}`)){H.warn("Could not find output area to restore scroll position",e.cellId);return}t.scrollIntoView({block:"start",behavior:"auto"})}function Ve(){let e=(0,Da.c)(2),t=L(ve),n;return e[0]===t?n=e[1]:(n=()=>{let o=_a();t(s=>({mode:pt(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Aa(o)})})},e[0]=t,e[1]=n),n}const Ye=Qe(!1);var Pa=_();const Na=()=>{let e=(0,Pa.c)(7),{selectedLayout:t}=Se(),{setLayoutView:n}=De();if(he()&&!tt("wasm_layouts"))return null;let o;e[0]===n?o=e[1]:(o=i=>n(i),e[0]=n,e[1]=o);let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(ea,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)(Jt,{placeholder:"Select a view"})}),e[2]=s):s=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Zt,{children:(0,a.jsxs)(Qt,{children:[(0,a.jsx)(Gt,{children:"View as"}),Le.map(Ea)]})}),e[3]=r):r=e[3];let l;return e[4]!==t||e[5]!==o?(l=(0,a.jsxs)(ta,{"data-testid":"layout-select",value:t,onValueChange:o,children:[s,r]}),e[4]=t,e[5]=o,e[6]=l):l=e[6],l};function Ia(e){return(0,a.jsx)(Ke(e),{className:"h-4 w-4"})}function Ke(e){switch(e){case"vertical":return ja;case"grid":return Tt;case"slides":return Be;default:return ft(e),Bt}}function Ue(e){return Ce(e)}function Ea(e){return(0,a.jsx)(Xt,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Ia(e),(0,a.jsx)("span",{children:Ue(e)})]})},e)}async function La(e){let{filename:t,preset:n,downloadPDF:o}=e;await o({filename:t,webpdf:!1,preset:n,includeInputs:!0,rasterServer:"static"})}var Ha=_();function Ta(e){let t=(0,Ha.c)(5),{openPrompt:n,closeModal:o}=fe(),{sendCopy:s}=T(),r;return t[0]!==o||t[1]!==n||t[2]!==s||t[3]!==e?(r=()=>{if(!e)return null;let l=Ut.guessDeliminator(e);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${Ie.basename(e)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:i=>{let d=l.join(Ie.dirname(e),i);s({source:e,destination:d}).then(()=>{o(),C({title:"Notebook copied",description:"A copy of the notebook has been created."}),fa(d)})}})},t[0]=o,t[1]=n,t[2]=s,t[3]=e,t[4]=r):r=t[4],r}const qa=()=>{let{updateCellConfig:e}=ge(),{saveCellConfig:t}=T();return(0,ye.useCallback)(async()=>{let n=new at,o=je(),s=o.cellIds.inOrderIds,r={};for(let i of s){if(o.cellData[i]===void 0)continue;let{code:d,config:m}=o.cellData[i];m.hide_code||n.isSupported(d)&&(r[i]={hide_code:!0})}let l=Me.entries(r);if(l.length!==0){await t({configs:r});for(let[i,d]of l)e({cellId:i,config:d})}},[e])};var Ra=_();function $e(){let e=(0,Ra.c)(4),{openConfirm:t}=fe(),n=L(wt),{sendRestart:o}=T(),s;return e[0]!==t||e[1]!==o||e[2]!==n?(s=()=>{t({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)(oa,{onClick:async()=>{n({state:gt.CLOSING}),await o(),da()},"aria-label":"Confirm Restart",children:"Restart"})})},e[0]=t,e[1]=o,e[2]=n,e[3]=s):s=e[3],s}var Ba=_(),P=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation()};function Fa(){var be,xe;let e=(0,Ba.c)(51),t=pa(),{openModal:n,closeModal:o}=fe(),{toggleApplication:s}=mt(),{selectedPanel:r}=ut(),[l]=Ze(ve),i=de(st),d=qa(),[m]=xt(),{updateCellConfig:w,undoDeleteCell:g,clearAllCellOutputs:u,addSetupCellIfDoesntExist:f,collapseAllCells:y,expandAllCells:k}=ge(),b=$e(),x=ha(),j=Ta(t),v=L(Ye),N=L(kt),z=L(bt),{exportAsIPYNB:ee,exportAsMarkdown:te,readCode:I,saveCellConfig:ae,updateCellOutputs:M}=T(),W=ya(),oe=de(nt),ne=de(ht),{selectedLayout:q}=Se(),{setLayoutView:ie}=De(),R=Ve(),B=((be=m.sharing)==null?void 0:be.html)??!0,F=((xe=m.sharing)==null?void 0:xe.wasm)??!0,ke=!he(),se=q==="slides",Ge=so,Je=io,O;e[0]!==t||e[1]!==W||e[2]!==M?(O=async c=>{let{preset:p,title:E}=c;if(!t){Q();return}await Ne(E,async re=>{await Ee({takeScreenshots:()=>W({progress:re}),updateCellOutputs:M}),await La({filename:t,preset:p,downloadPDF:Mt})})},e[0]=t,e[1]=W,e[2]=M,e[3]=O):O=e[3];let S=O,V;e[4]===S?V=e[5]:(V=async()=>{if(ke){await S({preset:"document",title:"Downloading Document PDF..."});return}let c=new Event("export-beforeprint"),p=new Event("export-afterprint");window.dispatchEvent(c),setTimeout(no,0),setTimeout(()=>window.dispatchEvent(p),0)},e[4]=S,e[5]=V);let Y=V,K;e[6]!==ee||e[7]!==t||e[8]!==W||e[9]!==M?(K=async()=>{if(!t){Q();return}await Ne("Downloading IPYNB...",async c=>{await Ee({takeScreenshots:()=>W({progress:c}),updateCellOutputs:M});let p=await ee({download:!1});ue(new Blob([p],{type:"application/x-ipynb+json"}),me.toIPYNB(document.title))})},e[6]=ee,e[7]=t,e[8]=W,e[9]=M,e[10]=K):K=e[10];let le=K,U;e[11]===Symbol.for("react.memo_cache_sentinel")?(U=(0,a.jsx)(Pt,{size:14,strokeWidth:1.5}),e[11]=U):U=e[11];let $;e[12]===Symbol.for("react.memo_cache_sentinel")?($=(0,a.jsx)(_e,{size:14,strokeWidth:1.5}),e[12]=$):$=e[12];let D;e[13]===t?D=e[14]:(D=async()=>{if(!t){Q();return}await Ae({filename:t,includeCode:!0})},e[13]=t,e[14]=D);let G;return e[15]!==f||e[16]!==ne||e[17]!==u||e[18]!==o||e[19]!==y||e[20]!==j||e[21]!==S||e[22]!==k||e[23]!==te||e[24]!==t||e[25]!==Y||e[26]!==le||e[27]!==oe||e[28]!==d||e[29]!==se||e[30]!==i||e[31]!==n||e[32]!==I||e[33]!==b||e[34]!==x||e[35]!==ae||e[36]!==q||e[37]!==r||e[38]!==v||e[39]!==z||e[40]!==ie||e[41]!==N||e[42]!==B||e[43]!==F||e[44]!==D||e[45]!==s||e[46]!==R||e[47]!==g||e[48]!==w||e[49]!==l.mode?(G=[{icon:U,label:"Download",handle:P,dropdown:[{icon:$,label:"Download as HTML",handle:D},{icon:(0,a.jsx)(_e,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!t){Q();return}await Ae({filename:t,includeCode:!1})}},{icon:(0,a.jsx)(ua,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let c=await te({download:!1});ue(new Blob([c],{type:"text/plain"}),me.toMarkdown(document.title))}},{icon:(0,a.jsx)(va,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:le},{icon:(0,a.jsx)(zt,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let c=await I();ue(new Blob([c.contents],{type:"text/plain"}),me.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(Ft,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:l.mode!=="present",tooltip:l.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",ma("global.hideCode",!1)]}),handle:oo},se?{divider:!0,icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:P,dropdown:[{icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:Y},{icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:Je(!0),hidden:!ke,handle:async()=>{await S({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:Y}]},{icon:(0,a.jsx)(za,{size:14,strokeWidth:1.5}),label:"Share",handle:P,hidden:!B&&!F,dropdown:[{icon:(0,a.jsx)(Lt,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!B,handle:async()=>{n((0,a.jsx)(Wa,{onClose:o}))}},{icon:(0,a.jsx)(Ot,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!F,handle:async()=>{await X(ca({code:(await I()).contents})),C({title:"Copied",description:"Link copied to clipboard."})}}]},{icon:(0,a.jsx)(Ca,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:P,dropdown:it.flatMap(c=>{let{type:p,Icon:E,hidden:re,additionalKeywords:Xe}=c;return re?[]:{label:Ce(p),rightElement:Ge(r===p),icon:(0,a.jsx)(E,{size:14,strokeWidth:1.5}),handle:()=>s(p),additionalKeywords:Xe}})},{icon:(0,a.jsx)(Be,{size:14,strokeWidth:1.5}),label:"Present as",handle:P,dropdown:[{icon:l.mode==="present"?(0,a.jsx)(Kt,{size:14,strokeWidth:1.5}):(0,a.jsx)(Re,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{R()}},...Le.map((c,p)=>{let E=Ke(c);return{divider:p===0,label:Ue(c),icon:(0,a.jsx)(E,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:q===c&&(0,a.jsx)(Pe,{size:14})}),handle:()=>{ie(c),l.mode==="edit"&&R()}}})]},{icon:(0,a.jsx)(wa,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!t||he(),handle:j},{icon:(0,a.jsx)(He,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!t,handle:async()=>{await X((await I()).contents),C({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(_t,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!oe||i,handle:async()=>{let c=ot(je());await ae({configs:Me.fromEntries(c.map(ao))});for(let p of c)w({cellId:p,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(qe,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{f({})}},{icon:(0,a.jsx)(rt,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(ze,{onClose:o}))}},{icon:(0,a.jsx)(yt,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(ze,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(Fe,{size:14,strokeWidth:1.5}),label:"Undo cell deletion",hidden:!ne||i,handle:()=>{g()}},{icon:(0,a.jsx)(Ma,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:b,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(xa,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{x()}},{icon:(0,a.jsx)(ct,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{u()}},{icon:(0,a.jsx)(Nt,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:d,redundant:!0},{icon:(0,a.jsx)(ba,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:y,redundant:!0},{icon:(0,a.jsx)(ka,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:k,redundant:!0},{divider:!0,icon:(0,a.jsx)(Te,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>v(to)},{icon:(0,a.jsx)(ga,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>z(eo)},{icon:(0,a.jsx)(Yt,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>N(Qa),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(Dt,{size:14,strokeWidth:1.5}),label:"Resources",handle:P,dropdown:[{icon:(0,a.jsx)(lt,{size:14,strokeWidth:1.5}),label:"Documentation",handle:Za},{icon:(0,a.jsx)(Et,{size:14,strokeWidth:1.5}),label:"GitHub",handle:Xa},{icon:(0,a.jsx)(Ht,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:Ja},{icon:(0,a.jsx)(qt,{size:14,strokeWidth:1.5}),label:"YouTube",handle:Ga},{icon:(0,a.jsx)(dt,{size:14,strokeWidth:1.5}),label:"Changelog",handle:$a}]},{divider:!0,icon:(0,a.jsx)(Rt,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:Ua},{icon:(0,a.jsx)(It,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:Ka}].filter(Ya).map(Oa),e[15]=f,e[16]=ne,e[17]=u,e[18]=o,e[19]=y,e[20]=j,e[21]=S,e[22]=k,e[23]=te,e[24]=t,e[25]=Y,e[26]=le,e[27]=oe,e[28]=d,e[29]=se,e[30]=i,e[31]=n,e[32]=I,e[33]=b,e[34]=x,e[35]=ae,e[36]=q,e[37]=r,e[38]=v,e[39]=z,e[40]=ie,e[41]=N,e[42]=B,e[43]=F,e[44]=D,e[45]=s,e[46]=R,e[47]=g,e[48]=w,e[49]=l.mode,e[50]=G):G=e[50],G}function Oa(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(Va)}:e}function Va(e){return!e.hidden}function Ya(e){return!e.hidden}function Ka(){let e=$t();window.open(e,"_blank")}function Ua(){let e=document.baseURI.split("?")[0];window.open(e,"_self")}function $a(){window.open(A.releasesPage,"_blank")}function Ga(){window.open(A.youtube,"_blank")}function Ja(){window.open(A.discordLink,"_blank")}function Xa(){window.open(A.githubPage,"_blank")}function Za(){window.open(A.docsPage,"_blank")}function Qa(e){return!e}function eo(e){return!e}function to(e){return!e}function ao(e){return[e,{disabled:!1}]}async function oo(){let e=document.getElementById("App");e&&await Wt({element:e,filename:document.title,prepare:St})}function no(){return window.print()}function io(e){return e?(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 so(e){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:e&&(0,a.jsx)(Pe,{size:14})})}function Q(){C({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{Ve as a,qe as c,Ye as i,Te as l,$e as n,Fe as o,Na as r,Re as s,Fa as t,He as u};
@@ -1 +1 @@
1
- import{d as k,n as i,p as v}from"./useEvent-O0nX5vok.js";import{E as w,Lr as y,Nr as F,h as d,jn as b,pt as j}from"./cells-D3d90crn.js";import{t as x}from"./compiler-runtime-B3qBwwSJ.js";import{m as D}from"./useEventListener-Dy81QR4n.js";import{o as E}from"./dist-avBkgR1-.js";import{r as H}from"./requests-Bgjtqo_1.js";var u=x();const I=v(!1);function L(){let r=(0,u.c)(2),n=p(),t;return r[0]===n?t=r[1]:(t=()=>n(y(d())),r[0]=n,r[1]=t),i(t)}function N(r){let n=(0,u.c)(3),t=p(),e;return n[0]!==r||n[1]!==t?(e=()=>{r!==void 0&&t([r])},n[0]=r,n[1]=t,n[2]=e):e=n[2],i(e)}function V(){let r=(0,u.c)(2),n=p(),t;return r[0]===n?t=r[1]:(t=()=>n(F(d())),r[0]=n,r[1]=t),i(t)}function p(){let r=(0,u.c)(4),{prepareForRun:n}=w(),{sendRun:t}=H(),e=k(I),o;return r[0]!==n||r[1]!==t||r[2]!==e?(o=async s=>{if(s.length===0)return;let c=d();return e(!0),g({cellIds:s,sendRun:t,prepareForRun:n,notebook:c})},r[0]=n,r[1]=t,r[2]=e,r[3]=o):o=r[3],i(o)}async function g({cellIds:r,sendRun:n,prepareForRun:t,notebook:e}){var m,h,R;if(r.length===0)return;let{cellHandles:o,cellData:s}=e,c=[];for(let a of r){let l=(h=(m=o[a])==null?void 0:m.current)==null?void 0:h.editorView,f;l?(b(l)!=="markdown"&&E(l),f=j(l)):f=((R=s[a])==null?void 0:R.code)||"",c.push(f),t({cellId:a})}await n({cellIds:r,codes:c}).catch(a=>{D.error(a)})}export{p as a,N as i,g as n,L as o,V as r,I as t};
1
+ import{d as k,n as i,p as v}from"./useEvent-O0nX5vok.js";import{E as w,Lr as y,Nr as F,h as d,jn as b,pt as j}from"./cells-B8rT_yJt.js";import{t as x}from"./compiler-runtime-B3qBwwSJ.js";import{m as D}from"./useEventListener-Dy81QR4n.js";import{o as E}from"./dist-D0Vj4Kqc.js";import{r as H}from"./requests-Bgjtqo_1.js";var u=x();const I=v(!1);function L(){let r=(0,u.c)(2),n=p(),t;return r[0]===n?t=r[1]:(t=()=>n(y(d())),r[0]=n,r[1]=t),i(t)}function N(r){let n=(0,u.c)(3),t=p(),e;return n[0]!==r||n[1]!==t?(e=()=>{r!==void 0&&t([r])},n[0]=r,n[1]=t,n[2]=e):e=n[2],i(e)}function V(){let r=(0,u.c)(2),n=p(),t;return r[0]===n?t=r[1]:(t=()=>n(F(d())),r[0]=n,r[1]=t),i(t)}function p(){let r=(0,u.c)(4),{prepareForRun:n}=w(),{sendRun:t}=H(),e=k(I),o;return r[0]!==n||r[1]!==t||r[2]!==e?(o=async s=>{if(s.length===0)return;let c=d();return e(!0),g({cellIds:s,sendRun:t,prepareForRun:n,notebook:c})},r[0]=n,r[1]=t,r[2]=e,r[3]=o):o=r[3],i(o)}async function g({cellIds:r,sendRun:n,prepareForRun:t,notebook:e}){var m,h,R;if(r.length===0)return;let{cellHandles:o,cellData:s}=e,c=[];for(let a of r){let l=(h=(m=o[a])==null?void 0:m.current)==null?void 0:h.editorView,f;l?(b(l)!=="markdown"&&E(l),f=j(l)):f=((R=s[a])==null?void 0:R.code)||"",c.push(f),t({cellId:a})}await n({cellIds:r,codes:c}).catch(a=>{D.error(a)})}export{p as a,N as i,g as n,L as o,V as r,I as t};
@@ -1 +1 @@
1
- import{s as m}from"./chunk-LvLJmgfZ.js";import{n as p}from"./useEvent-O0nX5vok.js";import{E as d,f,pt as u}from"./cells-D3d90crn.js";import{t as c}from"./compiler-runtime-B3qBwwSJ.js";import{t as C}from"./jsx-runtime-icT_Ltz2.js";import{t as h}from"./use-toast-BhMe50aT.js";import{r as v}from"./useDeleteCell-DVXZOIwJ.js";var x=c(),b=m(C(),1);function j(){let t=(0,x.c)(3),{splitCell:i,undoSplitCell:r}=d(),o;return t[0]!==i||t[1]!==r?(o=s=>{let l=f(s.cellId);if(!l)return;let a=u(l);i(s);let{dismiss:n}=h({title:"Cell split",action:(0,b.jsx)(v,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{r({...s,snapshot:a}),e()},children:"Undo"})}),e=n},t[0]=i,t[1]=r,t[2]=o):o=t[2],p(o)}export{j as t};
1
+ import{s as m}from"./chunk-LvLJmgfZ.js";import{n as p}from"./useEvent-O0nX5vok.js";import{E as d,f,pt as u}from"./cells-B8rT_yJt.js";import{t as c}from"./compiler-runtime-B3qBwwSJ.js";import{t as C}from"./jsx-runtime-icT_Ltz2.js";import{t as h}from"./use-toast-BhMe50aT.js";import{r as v}from"./useDeleteCell-DG1VBfwX.js";var x=c(),b=m(C(),1);function j(){let t=(0,x.c)(3),{splitCell:i,undoSplitCell:r}=d(),o;return t[0]!==i||t[1]!==r?(o=s=>{let l=f(s.cellId);if(!l)return;let a=u(l);i(s);let{dismiss:n}=h({title:"Cell split",action:(0,b.jsx)(v,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{r({...s,snapshot:a}),e()},children:"Undo"})}),e=n},t[0]=i,t[1]=r,t[2]=o):o=t[2],p(o)}export{j as t};
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-DV3al739.js"></script>
69
+ <script type="module" crossorigin src="./assets/index-aCOJQiAd.js"></script>
70
70
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-TXkS1QI3.js">
71
71
  <link rel="modulepreload" crossorigin href="./assets/chunk-LvLJmgfZ.js">
72
72
  <link rel="modulepreload" crossorigin href="./assets/react-Bj1aDYRI.js">
@@ -120,15 +120,15 @@
120
120
  <link rel="modulepreload" crossorigin href="./assets/capabilities-D3x_db9Y.js">
121
121
  <link rel="modulepreload" crossorigin href="./assets/createReducer-Dvh64vBW.js">
122
122
  <link rel="modulepreload" crossorigin href="./assets/paths-bMgYkaP2.js">
123
- <link rel="modulepreload" crossorigin href="./assets/dist-B8C_eg-r.js">
124
- <link rel="modulepreload" crossorigin href="./assets/dist-avBkgR1-.js">
125
- <link rel="modulepreload" crossorigin href="./assets/dist-BDiiLamW.js">
126
- <link rel="modulepreload" crossorigin href="./assets/dist-1xshPfUL.js">
127
- <link rel="modulepreload" crossorigin href="./assets/dist-CD2iFgV9.js">
128
- <link rel="modulepreload" crossorigin href="./assets/dist-DiGcGOAW.js">
129
- <link rel="modulepreload" crossorigin href="./assets/dist-D0u6iH16.js">
130
- <link rel="modulepreload" crossorigin href="./assets/dist-CyIcJpsa.js">
131
- <link rel="modulepreload" crossorigin href="./assets/dist-CTbQ-BIR.js">
123
+ <link rel="modulepreload" crossorigin href="./assets/dist-B_cxg-E4.js">
124
+ <link rel="modulepreload" crossorigin href="./assets/dist-D0Vj4Kqc.js">
125
+ <link rel="modulepreload" crossorigin href="./assets/dist-CtXb4bUU.js">
126
+ <link rel="modulepreload" crossorigin href="./assets/dist-Bh-vrbeU.js">
127
+ <link rel="modulepreload" crossorigin href="./assets/dist-4rKUx1vk.js">
128
+ <link rel="modulepreload" crossorigin href="./assets/dist-DA4gn7fy.js">
129
+ <link rel="modulepreload" crossorigin href="./assets/dist-1ZGGzJka.js">
130
+ <link rel="modulepreload" crossorigin href="./assets/dist-BXtR56No.js">
131
+ <link rel="modulepreload" crossorigin href="./assets/dist-CEeVCRd_.js">
132
132
  <link rel="modulepreload" crossorigin href="./assets/stex-FMMSUPAS.js">
133
133
  <link rel="modulepreload" crossorigin href="./assets/toDate-Cfp9W_O9.js">
134
134
  <link rel="modulepreload" crossorigin href="./assets/purify.es-ByGlPBcv.js">
@@ -139,7 +139,7 @@
139
139
  <link rel="modulepreload" crossorigin href="./assets/toInteger-CO3ppIfA.js">
140
140
  <link rel="modulepreload" crossorigin href="./assets/database-zap-DTWCDKdn.js">
141
141
  <link rel="modulepreload" crossorigin href="./assets/main-DrBRErTM.js">
142
- <link rel="modulepreload" crossorigin href="./assets/cells-D3d90crn.js">
142
+ <link rel="modulepreload" crossorigin href="./assets/cells-B8rT_yJt.js">
143
143
  <link rel="modulepreload" crossorigin href="./assets/ErrorBoundary-Ba0LbbH4.js">
144
144
  <link rel="modulepreload" crossorigin href="./assets/kbd-DozzbQaK.js">
145
145
  <link rel="modulepreload" crossorigin href="./assets/useInstallPackage-DYIBbH-R.js">
@@ -153,34 +153,34 @@
153
153
  <link rel="modulepreload" crossorigin href="./assets/usePress-_02M8YzR.js">
154
154
  <link rel="modulepreload" crossorigin href="./assets/input-6cciao_l.js">
155
155
  <link rel="modulepreload" crossorigin href="./assets/ImperativeModal-DyRrGcKH.js">
156
- <link rel="modulepreload" crossorigin href="./assets/cell-link-CUJsH4Qt.js">
156
+ <link rel="modulepreload" crossorigin href="./assets/cell-link-DV3G9zVQ.js">
157
157
  <link rel="modulepreload" crossorigin href="./assets/multi-map-1zWiWMZF.js">
158
158
  <link rel="modulepreload" crossorigin href="./assets/alert-Cv0TRjV-.js">
159
159
  <link rel="modulepreload" crossorigin href="./assets/chevron-right-CvVxySQk.js">
160
160
  <link rel="modulepreload" crossorigin href="./assets/dropdown-menu-CA9akLlF.js">
161
161
  <link rel="modulepreload" crossorigin href="./assets/links-DXQarNcJ.js">
162
- <link rel="modulepreload" crossorigin href="./assets/datasource-BKNy10yM.js">
163
- <link rel="modulepreload" crossorigin href="./assets/state-4QyTnTMc.js">
162
+ <link rel="modulepreload" crossorigin href="./assets/datasource-xomiPYKd.js">
163
+ <link rel="modulepreload" crossorigin href="./assets/state-DLmIk5GZ.js">
164
164
  <link rel="modulepreload" crossorigin href="./assets/sparkles-DWCvxqYL.js">
165
- <link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-J_vzYyfF.js">
165
+ <link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-3snr3JrQ.js">
166
166
  <link rel="modulepreload" crossorigin href="./assets/copy-CIPmwSuj.js">
167
167
  <link rel="modulepreload" crossorigin href="./assets/copy-CkudG0Ej.js">
168
168
  <link rel="modulepreload" crossorigin href="./assets/copy-icon-BNQYrUYC.js">
169
169
  <link rel="modulepreload" crossorigin href="./assets/spinner-C5JoisA7.js">
170
- <link rel="modulepreload" crossorigin href="./assets/html-to-image-BKYNhmqD.js">
171
- <link rel="modulepreload" crossorigin href="./assets/focus-KRgSpKIE.js">
170
+ <link rel="modulepreload" crossorigin href="./assets/html-to-image-BtnUxAf2.js">
171
+ <link rel="modulepreload" crossorigin href="./assets/focus-DWfOBGUg.js">
172
172
  <link rel="modulepreload" crossorigin href="./assets/useAsyncData-VEt7lMhG.js">
173
- <link rel="modulepreload" crossorigin href="./assets/LazyAnyLanguageCodeMirror-CUh_vzRs.js">
173
+ <link rel="modulepreload" crossorigin href="./assets/LazyAnyLanguageCodeMirror-BTEcIffn.js">
174
174
  <link rel="modulepreload" crossorigin href="./assets/micromark-factory-space-4isUgE6w.js">
175
175
  <link rel="modulepreload" crossorigin href="./assets/chunk-5FQGJX7Z-KaqPPQRg.js">
176
- <link rel="modulepreload" crossorigin href="./assets/markdown-renderer-BqnSkpMX.js">
176
+ <link rel="modulepreload" crossorigin href="./assets/markdown-renderer-f7AvSa1a.js">
177
177
  <link rel="modulepreload" crossorigin href="./assets/dist-B1ExNQli.js">
178
- <link rel="modulepreload" crossorigin href="./assets/command-CKa4yQEB.js">
178
+ <link rel="modulepreload" crossorigin href="./assets/command-DvKBTmQJ.js">
179
179
  <link rel="modulepreload" crossorigin href="./assets/popover-C5P0DZBj.js">
180
180
  <link rel="modulepreload" crossorigin href="./assets/errors-Bhwg_4_Q.js">
181
- <link rel="modulepreload" crossorigin href="./assets/download-B2JL3FPf.js">
182
- <link rel="modulepreload" crossorigin href="./assets/useRunCells-D5eTD8tT.js">
183
- <link rel="modulepreload" crossorigin href="./assets/RenderHTML-DVx_CJaM.js">
181
+ <link rel="modulepreload" crossorigin href="./assets/download-CNJtCoWG.js">
182
+ <link rel="modulepreload" crossorigin href="./assets/useRunCells--USKPEQy.js">
183
+ <link rel="modulepreload" crossorigin href="./assets/RenderHTML-C9ZqxJ8H.js">
184
184
  <link rel="modulepreload" crossorigin href="./assets/table-C-4zXNgf.js">
185
185
  <link rel="modulepreload" crossorigin href="./assets/useIframeCapabilities-C0zkgwSm.js">
186
186
  <link rel="modulepreload" crossorigin href="./assets/error-banner-D6woGaqN.js">
@@ -197,42 +197,42 @@
197
197
  <link rel="modulepreload" crossorigin href="./assets/capitalize-BfkXNxmI.js">
198
198
  <link rel="modulepreload" crossorigin href="./assets/table-Od8PbuV-.js">
199
199
  <link rel="modulepreload" crossorigin href="./assets/message-circle-BaZF1NX9.js">
200
- <link rel="modulepreload" crossorigin href="./assets/JsonOutput-BVgaYt_7.js">
200
+ <link rel="modulepreload" crossorigin href="./assets/JsonOutput-CQSoWTC4.js">
201
201
  <link rel="modulepreload" crossorigin href="./assets/chart-no-axes-column-a9XtWmzk.js">
202
202
  <link rel="modulepreload" crossorigin href="./assets/square-function-B-8YRDsr.js">
203
203
  <link rel="modulepreload" crossorigin href="./assets/spec-DbOXZaHd.js">
204
204
  <link rel="modulepreload" crossorigin href="./assets/ellipsis-vertical-CAB7tdza.js">
205
205
  <link rel="modulepreload" crossorigin href="./assets/refresh-cw-Dd8FlTmm.js">
206
- <link rel="modulepreload" crossorigin href="./assets/components-ZL3KSgMv.js">
207
- <link rel="modulepreload" crossorigin href="./assets/column-preview-CPBNo3h2.js">
206
+ <link rel="modulepreload" crossorigin href="./assets/components-CWfQv9p5.js">
207
+ <link rel="modulepreload" crossorigin href="./assets/column-preview-BEoyw-go.js">
208
208
  <link rel="modulepreload" crossorigin href="./assets/icons-CAcY8GzB.js">
209
- <link rel="modulepreload" crossorigin href="./assets/switch-BPjRwF9v.js">
209
+ <link rel="modulepreload" crossorigin href="./assets/switch-CdyDieX7.js">
210
210
  <link rel="modulepreload" crossorigin href="./assets/toggle-wwEdkCCQ.js">
211
211
  <link rel="modulepreload" crossorigin href="./assets/events-GxnDgt0p.js">
212
- <link rel="modulepreload" crossorigin href="./assets/globals-CZsfDi9Q.js">
212
+ <link rel="modulepreload" crossorigin href="./assets/globals-B7uZUVXG.js">
213
213
  <link rel="modulepreload" crossorigin href="./assets/share-BKUsoia0.js">
214
214
  <link rel="modulepreload" crossorigin href="./assets/blob-BTrKZERf.js">
215
215
  <link rel="modulepreload" crossorigin href="./assets/memoize-Bw1ifb7c.js">
216
216
  <link rel="modulepreload" crossorigin href="./assets/get-DBdMgUNq.js">
217
217
  <link rel="modulepreload" crossorigin href="./assets/_baseSet-D5BgdrnX.js">
218
218
  <link rel="modulepreload" crossorigin href="./assets/react-resizable-panels.browser.esm-Dmf4Xg1J.js">
219
- <link rel="modulepreload" crossorigin href="./assets/context-aware-panel-B6Ooz9Lw.js">
220
- <link rel="modulepreload" crossorigin href="./assets/floating-outline-Bx41Ogvx.js">
221
- <link rel="modulepreload" crossorigin href="./assets/useAddCell-Cd-c9fz3.js">
219
+ <link rel="modulepreload" crossorigin href="./assets/context-aware-panel-DJFzC2uh.js">
220
+ <link rel="modulepreload" crossorigin href="./assets/floating-outline-BUsBWnrz.js">
221
+ <link rel="modulepreload" crossorigin href="./assets/useAddCell-BGHDEB1g.js">
222
222
  <link rel="modulepreload" crossorigin href="./assets/objectWithoutPropertiesLoose-D67umz3-.js">
223
- <link rel="modulepreload" crossorigin href="./assets/esm-CoDEg_kt.js">
223
+ <link rel="modulepreload" crossorigin href="./assets/esm-BMWduMhT.js">
224
224
  <link rel="modulepreload" crossorigin href="./assets/eye-off-vwi9L975.js">
225
225
  <link rel="modulepreload" crossorigin href="./assets/plus-D1HlXYzG.js">
226
- <link rel="modulepreload" crossorigin href="./assets/readonly-python-code-CjFy5OHl.js">
226
+ <link rel="modulepreload" crossorigin href="./assets/readonly-python-code-CvuT43MO.js">
227
227
  <link rel="modulepreload" crossorigin href="./assets/file-headphone-B5q2Ow55.js">
228
228
  <link rel="modulepreload" crossorigin href="./assets/file-DzHkbIdO.js">
229
229
  <link rel="modulepreload" crossorigin href="./assets/image-DXfkah9d.js">
230
- <link rel="modulepreload" crossorigin href="./assets/file-icons-czkv18pY.js">
230
+ <link rel="modulepreload" crossorigin href="./assets/file-icons-I3TgHXBH.js">
231
231
  <link rel="modulepreload" crossorigin href="./assets/label-KlZhD0Wz.js">
232
- <link rel="modulepreload" crossorigin href="./assets/textarea-C5wPsFgU.js">
232
+ <link rel="modulepreload" crossorigin href="./assets/textarea-y9GCP54I.js">
233
233
  <link rel="modulepreload" crossorigin href="./assets/refresh-ccw-DY_cTm_K.js">
234
234
  <link rel="modulepreload" crossorigin href="./assets/trash-2-B7Q-bnsg.js">
235
- <link rel="modulepreload" crossorigin href="./assets/form-BpdTXD_T.js">
235
+ <link rel="modulepreload" crossorigin href="./assets/form-DNvI4VkE.js">
236
236
  <link rel="modulepreload" crossorigin href="./assets/renderShortcut-BcNNtnIV.js">
237
237
  <link rel="modulepreload" crossorigin href="./assets/field-BEG4O-GE.js">
238
238
  <link rel="modulepreload" crossorigin href="./assets/VisuallyHidden-ClKJEaNK.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/frontend",
3
- "version": "0.21.2-dev77",
3
+ "version": "0.21.2-dev79",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -96,6 +96,7 @@
96
96
  "@tailwindcss/postcss": "^4.1.18",
97
97
  "@tailwindcss/typography": "^0.5.19",
98
98
  "@tanstack/react-table": "^8.21.3",
99
+ "@tanstack/react-virtual": "^3.13.23",
99
100
  "@textea/json-viewer": "^4.0.1",
100
101
  "@types/humanize-duration": "^3.27.4",
101
102
  "@types/js-cookie": "^3.0.6",
@@ -5,6 +5,21 @@ import { afterEach, beforeEach, vi } from "vitest";
5
5
  import "@testing-library/jest-dom/vitest";
6
6
  import "blob-polyfill";
7
7
 
8
+ // mock implementation because jsdom doesn't support ResizeObserver
9
+ // if we need to test ResizeObserver functionality
10
+ // we can use a library like "resize-observer-polyfill"
11
+ globalThis.ResizeObserver ??= class {
12
+ observe(_target: Element) {
13
+ /* noop */
14
+ }
15
+ unobserve(_target: Element) {
16
+ /* noop */
17
+ }
18
+ disconnect() {
19
+ /* noop */
20
+ }
21
+ } as never;
22
+
8
23
  // Global setup for all tests
9
24
  beforeEach(() => {
10
25
  // Reset all mocks before each test
@@ -9,6 +9,7 @@ import {
9
9
  SearchIcon,
10
10
  } from "lucide-react";
11
11
  import React from "react";
12
+ import { useLocale } from "react-aria";
12
13
  import type { GetRowIds } from "@/plugins/impl/DataTablePlugin";
13
14
  import { cn } from "@/utils/cn";
14
15
  import type { PanelType } from "../editor/chrome/panels/context-aware-panel/context-aware-panel";
@@ -16,7 +17,7 @@ import { Button } from "../ui/button";
16
17
  import { Tooltip } from "../ui/tooltip";
17
18
  import { toast } from "../ui/use-toast";
18
19
  import { type DownloadActionProps, DownloadAs } from "./download-actions";
19
- import { DataTablePagination } from "./pagination";
20
+ import { DataTablePagination, prettifyRowColumnCount } from "./pagination";
20
21
  import type { DataTableSelection } from "./types";
21
22
 
22
23
  interface TableActionsProps<TData> {
@@ -64,6 +65,7 @@ export const TableActions = <TData,>({
64
65
  isPanelOpen,
65
66
  tableLoading,
66
67
  }: TableActionsProps<TData>) => {
68
+ const { locale } = useLocale();
67
69
  const handleSelectAllRows = (value: boolean) => {
68
70
  if (!onRowSelectionChange) {
69
71
  return;
@@ -173,7 +175,7 @@ export const TableActions = <TData,>({
173
175
  </>
174
176
  )}
175
177
 
176
- {pagination && (
178
+ {pagination ? (
177
179
  <DataTablePagination
178
180
  totalColumns={totalColumns}
179
181
  selection={selection}
@@ -182,6 +184,10 @@ export const TableActions = <TData,>({
182
184
  tableLoading={tableLoading}
183
185
  showPageSizeSelector={showPageSizeSelector}
184
186
  />
187
+ ) : (
188
+ <span className="text-xs text-muted-foreground px-2">
189
+ {prettifyRowColumnCount(table.getRowCount(), totalColumns, locale)}
190
+ </span>
185
191
  )}
186
192
  <div className="ml-auto">
187
193
  {downloadAs && (
@@ -101,6 +101,69 @@ describe("DataTable", () => {
101
101
  expect(rows[2]).toHaveAttribute("title", "Jim Halpert");
102
102
  });
103
103
 
104
+ it("does not virtualize small datasets without pagination", () => {
105
+ const testData = Array.from({ length: 50 }, (_, i) => ({
106
+ id: i,
107
+ name: `Item ${i}`,
108
+ }));
109
+
110
+ const columns: ColumnDef<TestData>[] = [
111
+ { accessorKey: "id", header: "ID" },
112
+ { accessorKey: "name", header: "Name" },
113
+ ];
114
+
115
+ render(
116
+ <TooltipProvider>
117
+ <DataTable
118
+ data={testData}
119
+ columns={columns}
120
+ selection={null}
121
+ totalRows={50}
122
+ totalColumns={2}
123
+ pagination={false}
124
+ />
125
+ </TooltipProvider>,
126
+ );
127
+
128
+ // All 50 data rows + 1 header row should be in the DOM (no virtualization)
129
+ const rows = screen.getAllByRole("row");
130
+ expect(rows).toHaveLength(51);
131
+ });
132
+
133
+ it("virtualizes large datasets — renders fewer rows than the full dataset", () => {
134
+ const testData = Array.from({ length: 200 }, (_, i) => ({
135
+ id: i,
136
+ name: `Item ${i}`,
137
+ }));
138
+
139
+ const columns: ColumnDef<TestData>[] = [
140
+ { accessorKey: "id", header: "ID" },
141
+ { accessorKey: "name", header: "Name" },
142
+ ];
143
+
144
+ render(
145
+ <TooltipProvider>
146
+ <DataTable
147
+ data={testData}
148
+ columns={columns}
149
+ selection={null}
150
+ totalRows={200}
151
+ totalColumns={2}
152
+ pagination={false}
153
+ />
154
+ </TooltipProvider>,
155
+ );
156
+
157
+ // In jsdom the virtualizer sees a 0-height container and renders 0 data
158
+ // rows (no layout engine). The key assertion is that significantly fewer
159
+ // than 200 rows are in the DOM, which catches regressions where
160
+ // virtualization is accidentally disabled and all rows are rendered.
161
+ const rows = screen.getAllByRole("row");
162
+ // Subtract 1 for the header row
163
+ const dataRows = rows.length - 1;
164
+ expect(dataRows).toBeLessThan(200);
165
+ });
166
+
104
167
  it("should display updated data after rerender with manual sorting and pagination", () => {
105
168
  // Simulates the bug from issue #8023:
106
169
  // When a user sorts a table, rows that moved from page 2 to page 1
@@ -38,12 +38,17 @@ import type { DownloadActionProps } from "./download-actions";
38
38
  import { FilterPills } from "./filter-pills";
39
39
  import { FocusRowFeature } from "./focus-row/feature";
40
40
  import { useColumnPinning } from "./hooks/use-column-pinning";
41
+ import { useScrollContainerHeight } from "./hooks/use-scroll-container-height";
41
42
  import { CellSelectionStats } from "./range-focus/cell-selection-stats";
42
43
  import { CellSelectionProvider } from "./range-focus/provider";
43
44
  import { DataTableBody, renderTableHeader } from "./renderers";
44
45
  import { SearchBar } from "./SearchBar";
45
46
  import { TableActions } from "./TableActions";
46
- import type { DataTableSelection, TooManyRows } from "./types";
47
+ import {
48
+ type DataTableSelection,
49
+ MIN_ROWS_TO_VIRTUALIZE,
50
+ type TooManyRows,
51
+ } from "./types";
47
52
  import { getStableRowId } from "./utils";
48
53
 
49
54
  interface DataTableProps<TData> extends Partial<DownloadActionProps> {
@@ -268,36 +273,9 @@ const DataTableInternal = <TData,>({
268
273
  });
269
274
 
270
275
  const rowViewerPanelOpen = isPanelOpen?.("row-viewer") ?? false;
276
+ const virtualize = !pagination && data.length > MIN_ROWS_TO_VIRTUALIZE;
271
277
 
272
- const tableRef = React.useRef<HTMLTableElement | null>(null);
273
-
274
- // Why use a ref to set max-height on the wrapper?
275
- // - position: sticky only works when the sticky element's nearest scrollable
276
- // ancestor is its immediate container. If max-height/overflow are applied
277
- // on a grandparent, sticky table headers (th) will not stick.
278
- // - We keep the scroll wrapper colocated with the base Table component, but
279
- // derive the scroll boundary from maxHeight here to avoid coupling UI base
280
- // components to data-table specifics or expanding their API surface.
281
- // - Setting styles on the table's direct wrapper ensures the header sticks
282
- // reliably across browsers without changing upstream components.
283
- React.useEffect(() => {
284
- if (!tableRef.current) {
285
- return;
286
- }
287
- const wrapper = tableRef.current.parentElement as HTMLDivElement | null;
288
- if (!wrapper) {
289
- return;
290
- }
291
- if (maxHeight) {
292
- wrapper.style.maxHeight = `${maxHeight}px`;
293
- // Ensure wrapper scrolls
294
- if (!wrapper.style.overflow) {
295
- wrapper.style.overflow = "auto";
296
- }
297
- } else {
298
- wrapper.style.removeProperty("max-height");
299
- }
300
- }, [maxHeight]);
278
+ const tableRef = useScrollContainerHeight({ maxHeight, virtualize });
301
279
 
302
280
  return (
303
281
  <div className={cn(wrapperClassName, "flex flex-col space-y-1")}>
@@ -317,13 +295,14 @@ const DataTableInternal = <TData,>({
317
295
  {showLoadingBar && (
318
296
  <thead className="absolute top-0 left-0 h-[3px] w-1/2 bg-primary animate-slide" />
319
297
  )}
320
- {renderTableHeader(table, Boolean(maxHeight))}
298
+ {renderTableHeader(table, virtualize || Boolean(maxHeight))}
321
299
  <DataTableBody
322
300
  table={table}
323
301
  columns={columns}
324
302
  rowViewerPanelOpen={rowViewerPanelOpen}
325
303
  getRowIndex={getPaginatedRowIndex}
326
304
  viewedRowIdx={viewedRowIdx}
305
+ virtualize={virtualize}
327
306
  />
328
307
  </Table>
329
308
  </div>
@@ -0,0 +1,97 @@
1
+ /* Copyright 2026 Marimo. All rights reserved. */
2
+
3
+ import { useEffect, useLayoutEffect, useRef } from "react";
4
+ import {
5
+ DEFAULT_VIRTUAL_ROWS,
6
+ TABLE_HEADER_HEIGHT_PX,
7
+ TABLE_ROW_HEIGHT_PX,
8
+ } from "../types";
9
+
10
+ /**
11
+ * Manages the scroll container's max-height for the data table.
12
+ *
13
+ * Why set max-height on the table's direct wrapper via a ref?
14
+ * - `position: sticky` only works when the sticky element's nearest scrollable
15
+ * ancestor is its immediate container. If max-height/overflow are applied on
16
+ * a grandparent, sticky `<th>` elements will not stick.
17
+ * - The <Table> UI component wraps <table> in a div with overflow-auto. We
18
+ * derive the scroll boundary from this wrapper (tableRef.parentElement) to
19
+ * keep sticky headers working without coupling base UI components to
20
+ * data-table specifics or expanding their API surface.
21
+ *
22
+ * 3 scenarios:
23
+ * - maxHeight applied directly. This always takes preference
24
+ * - Virtualize without maxHeight: observed via ResizeObserver on <thead>
25
+ * so the container reacts to header size changes (charts loading, toggles).
26
+ * - No maxHeight and no virtualization: render everything
27
+ * in practice virtualization kicks in after 100 rows with pagination disabled
28
+ */
29
+ export function useScrollContainerHeight({
30
+ maxHeight,
31
+ virtualize,
32
+ }: {
33
+ maxHeight?: number;
34
+ virtualize: boolean;
35
+ }) {
36
+ const tableRef = useRef<HTMLTableElement | null>(null);
37
+
38
+ // Handle explicit maxHeight and non-virtualize cases synchronously
39
+ // before paint to avoid flickering.
40
+ useLayoutEffect(() => {
41
+ if (!tableRef.current) {
42
+ return;
43
+ }
44
+ const wrapper = tableRef.current.parentElement as HTMLDivElement | null;
45
+ if (!wrapper) {
46
+ return;
47
+ }
48
+ if (maxHeight) {
49
+ wrapper.style.maxHeight = `${maxHeight}px`;
50
+ if (!wrapper.style.overflow) {
51
+ wrapper.style.overflow = "auto";
52
+ }
53
+ } else if (!virtualize) {
54
+ wrapper.style.removeProperty("max-height");
55
+ }
56
+ // When virtualizing without an explicit maxHeight, the ResizeObserver
57
+ // below handles setting maxHeight reactively based on actual header size.
58
+ }, [maxHeight, virtualize]);
59
+
60
+ // When virtualizing without an explicit maxHeight, observe the <thead> for
61
+ // size changes (column summaries, charts loading async, header toggle) and
62
+ // recompute the scroll container height accordingly.
63
+ useEffect(() => {
64
+ if (!virtualize || maxHeight) {
65
+ return;
66
+ }
67
+ const table = tableRef.current;
68
+ if (!table) {
69
+ return;
70
+ }
71
+ const wrapper = table.parentElement as HTMLDivElement | null;
72
+ const thead = table.querySelector("thead");
73
+ if (!wrapper || !thead) {
74
+ return;
75
+ }
76
+ const updateMaxHeight = () => {
77
+ const headerHeight =
78
+ thead.getBoundingClientRect().height || TABLE_HEADER_HEIGHT_PX;
79
+ // Skip virtual spacer rows — they have arbitrary heights for scroll offset.
80
+ const firstDataRow = table.querySelector(
81
+ "tbody tr:not([data-virtual-spacer])",
82
+ );
83
+ const rowHeight =
84
+ firstDataRow?.getBoundingClientRect().height || TABLE_ROW_HEIGHT_PX;
85
+ wrapper.style.maxHeight = `${DEFAULT_VIRTUAL_ROWS * rowHeight + headerHeight}px`;
86
+ };
87
+
88
+ // Set initial height
89
+ updateMaxHeight();
90
+
91
+ const observer = new ResizeObserver(updateMaxHeight);
92
+ observer.observe(thead);
93
+ return () => observer.disconnect();
94
+ }, [virtualize, maxHeight]);
95
+
96
+ return tableRef;
97
+ }