@marimo-team/frontend 0.19.8-dev4 → 0.19.8-dev40

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 (342) hide show
  1. package/dist/assets/{CellStatus-CTtb89yx.js → CellStatus-D-CCv4h6.js} +1 -1
  2. package/dist/assets/{Combination-C_mRvd_Z.js → Combination-izwufzWe.js} +1 -1
  3. package/dist/assets/{ConnectedDataExplorerComponent-CX7YQX42.js → ConnectedDataExplorerComponent-C1BlkUlk.js} +1 -1
  4. package/dist/assets/{DeferredRequestRegistry-CO2AyNfd.js → DeferredRequestRegistry-tv0PqJZ0.js} +1 -1
  5. package/dist/assets/{ErrorBoundary-ChCiwl15.js → ErrorBoundary-B9Ifj8Jf.js} +1 -1
  6. package/dist/assets/{ImageComparisonComponent-BVBGmVcA.js → ImageComparisonComponent-BVXYpigZ.js} +1 -1
  7. package/dist/assets/{ImperativeModal-CKeCkc1k.js → ImperativeModal-DZr52ffu.js} +1 -1
  8. package/dist/assets/{Inputs-CBxLLWdV.js → Inputs-CbenuziM.js} +1 -1
  9. package/dist/assets/{JsonOutput-BTBD86gT.js → JsonOutput-CU0ad2LH.js} +11 -11
  10. package/dist/assets/{LazyAnyLanguageCodeMirror-Be7SB10I.js → LazyAnyLanguageCodeMirror-BqosdyZU.js} +2 -2
  11. package/dist/assets/MarimoErrorOutput-BydcsyYP.js +7 -0
  12. package/dist/assets/{RenderHTML-IBhB_MjX.js → RenderHTML-3amWMGgo.js} +1 -1
  13. package/dist/assets/{SSRProvider-DBS9qs3r.js → SSRProvider-DrpctNAg.js} +1 -1
  14. package/dist/assets/__vite-browser-external-D-ioOGDE.js +1 -0
  15. package/dist/assets/__vite-browser-external-DBckR0WR.js +1 -0
  16. package/dist/assets/{add-cell-with-ai-DsiiVErB.js → add-cell-with-ai-B07D0AiE.js} +6 -6
  17. package/dist/assets/{add-database-form-B1frIn24.js → add-database-form-BnEY6X5s.js} +3 -3
  18. package/dist/assets/{agent-panel-B_Ur2utx.js → agent-panel-C1O0Y8Bi.js} +5 -5
  19. package/dist/assets/{ai-model-dropdown-Dix8JIRc.js → ai-model-dropdown-Cugcw6NV.js} +4 -4
  20. package/dist/assets/{alert-adkp2Qj8.js → alert-Cx8eFRUM.js} +1 -1
  21. package/dist/assets/{alert-dialog-CordKci7.js → alert-dialog-Ctz24SMn.js} +1 -1
  22. package/dist/assets/{any-language-editor-Z9d2XKUM.js → any-language-editor-DyXJSyeK.js} +1 -1
  23. package/dist/assets/{app-config-button-CYFJH9oz.js → app-config-button-66OSct-U.js} +1 -1
  24. package/dist/assets/{architectureDiagram-VXUJARFQ-B-zQV2Ro.js → architectureDiagram-VXUJARFQ-B8zMpJcM.js} +1 -1
  25. package/dist/assets/{arrow-left-Cb_73j1f.js → arrow-left-VDC1u5rq.js} +1 -1
  26. package/dist/assets/{badge-Ce8wRjuQ.js → badge-D4keL3YC.js} +1 -1
  27. package/dist/assets/blob-Bgnx1kuY.js +1 -0
  28. package/dist/assets/{blockDiagram-VD42YOAC-B7BRAty8.js → blockDiagram-VD42YOAC-CF1a-_t0.js} +1 -1
  29. package/dist/assets/{bundle.esm-B-jCcPJK.js → bundle.esm-CBAPjfrh.js} +1 -1
  30. package/dist/assets/{button-YC1gW_kJ.js → button-CZ3Cs4qb.js} +1 -1
  31. package/dist/assets/{c4Diagram-YG6GDRKO-C5JyC9v_.js → c4Diagram-YG6GDRKO-YIsEsUdQ.js} +1 -1
  32. package/dist/assets/{cache-panel-BfCxvTOh.js → cache-panel-C_9WDApV.js} +1 -1
  33. package/dist/assets/{card-BAxUmnnT.js → card-DdlNjkEA.js} +1 -1
  34. package/dist/assets/{cell-editor-BQ5bBOiS.js → cell-editor-DZgQrVMs.js} +14 -14
  35. package/dist/assets/{cell-link-DW0zobk9.js → cell-link-B37i0WNz.js} +1 -1
  36. package/dist/assets/{cells-BcMpgRWV.js → cells-B0XKj2oa.js} +32 -32
  37. package/dist/assets/channel-CXFsg7SH.js +1 -0
  38. package/dist/assets/{chart-no-axes-column-W42b2ZIs.js → chart-no-axes-column-qvVRjhv1.js} +1 -1
  39. package/dist/assets/{chat-components-BpIX7pUp.js → chat-components-BNjAKvAv.js} +1 -1
  40. package/dist/assets/{chat-display-CVXM0cmr.js → chat-display-q9RdcWB-.js} +1 -1
  41. package/dist/assets/chat-panel-viPqlAXC.js +3 -0
  42. package/dist/assets/check-Dr3SxUsb.js +1 -0
  43. package/dist/assets/{chevron-right-DwagBitu.js → chevron-right--18M_6o9.js} +1 -1
  44. package/dist/assets/{chunk-5FQGJX7Z-Bmb7yu_c.js → chunk-5FQGJX7Z-T2jyw7ZD.js} +3 -3
  45. package/dist/assets/{chunk-ABZYJK2D-Coo5qi7b.js → chunk-ABZYJK2D-D1A06qKo.js} +3 -3
  46. package/dist/assets/{chunk-ATLVNIR6-C0ULYreM.js → chunk-ATLVNIR6-C5FWd1qN.js} +1 -1
  47. package/dist/assets/{chunk-B4BG7PRW-D6Q5lT5Z.js → chunk-B4BG7PRW-BEayfxv_.js} +1 -1
  48. package/dist/assets/{chunk-DI55MBZ5-BUUtkB-8.js → chunk-DI55MBZ5-BSrtupT8.js} +1 -1
  49. package/dist/assets/{chunk-EXTU4WIE-DQy5cN5X.js → chunk-EXTU4WIE-wi_fHsHN.js} +1 -1
  50. package/dist/assets/{chunk-JA3XYJ7Z-99Y1UR46.js → chunk-JA3XYJ7Z-tKDxhnhw.js} +1 -1
  51. package/dist/assets/{chunk-JZLCHNYA-DRGkEV50.js → chunk-JZLCHNYA-DtvI9B9X.js} +1 -1
  52. package/dist/assets/{chunk-N4CR4FBY-DHFG9ldR.js → chunk-N4CR4FBY-BQcJpHO7.js} +2 -2
  53. package/dist/assets/{chunk-QN33PNHL-DB8FgLRd.js → chunk-QN33PNHL-BboKw3W6.js} +1 -1
  54. package/dist/assets/{chunk-QXUST7PY-_zxuSm7L.js → chunk-QXUST7PY-C4Ihfbmy.js} +1 -1
  55. package/dist/assets/{chunk-S3R3BYOJ-PVCoxQeQ.js → chunk-S3R3BYOJ-D1UiABQX.js} +1 -1
  56. package/dist/assets/{chunk-TZMSLE5B-KYGSDxPK.js → chunk-TZMSLE5B-BjrxQwUX.js} +1 -1
  57. package/dist/assets/{circle-check-C57eOpl0.js → circle-check-DquVD4wZ.js} +1 -1
  58. package/dist/assets/{circle-play-BuOtSgid.js → circle-play-EowqxNIC.js} +1 -1
  59. package/dist/assets/{circle-plus-CnWl9uZo.js → circle-plus-haI9GLDP.js} +1 -1
  60. package/dist/assets/classDiagram-2ON5EDUG-BHD5dOKT.js +1 -0
  61. package/dist/assets/classDiagram-v2-WZHVMYZB-VYd80hrd.js +1 -0
  62. package/dist/assets/{clear-button-CF0iBcV9.js → clear-button-DI7_bdOB.js} +1 -1
  63. package/dist/assets/{click-outside-container-B12FHFHm.js → click-outside-container-Npdlddni.js} +1 -1
  64. package/dist/assets/{clipboard-paste-BiDF-cqm.js → clipboard-paste-CpyPR-HZ.js} +1 -1
  65. package/dist/assets/{code-block-37QAKDTI-D5PRUB7R.js → code-block-37QAKDTI-FUPT3-7o.js} +1 -1
  66. package/dist/assets/{code-xml-XLwHyDBr.js → code-xml-CgN_Yig7.js} +1 -1
  67. package/dist/assets/{column-preview-v3J210SK.js → column-preview-DrmYyyvE.js} +1 -1
  68. package/dist/assets/{command-DOzj5zu3.js → command-DTFQw11F.js} +1 -1
  69. package/dist/assets/{command-palette-B94wuFEk.js → command-palette-CrOe4bpD.js} +1 -1
  70. package/dist/assets/{common-DHF6uQdA.js → common-C0Pspoza.js} +1 -1
  71. package/dist/assets/compiler-runtime-B3qBwwSJ.js +1 -0
  72. package/dist/assets/{config-C3-Nti03.js → config-D2-Bw6QC.js} +1 -1
  73. package/dist/assets/{context-CJp-B2dx.js → context-Ga_vV5mE.js} +1 -1
  74. package/dist/assets/{copy-CQ15EONK.js → copy-D-8y6iMN.js} +1 -1
  75. package/dist/assets/{copy-icon-C1fNHY3M.js → copy-icon-C9v8EtBA.js} +1 -1
  76. package/dist/assets/createLucideIcon-BCdY6lG5.js +1 -0
  77. package/dist/assets/{createReducer-Dnna-AUO.js → createReducer-B3rBsy4P.js} +1 -1
  78. package/dist/assets/{dagre-6UL2VRFP-khPiqbzB.js → dagre-6UL2VRFP-CX3NGWnu.js} +1 -1
  79. package/dist/assets/{data-grid-overlay-editor-Ca1ELXWD.js → data-grid-overlay-editor-BTyw6887.js} +1 -1
  80. package/dist/assets/{database-zap-B9y7063w.js → database-zap-k4ePIFAU.js} +1 -1
  81. package/dist/assets/{datasource-BZ3O2HG1.js → datasource-2_-ICoTV.js} +1 -1
  82. package/dist/assets/{dates-Cx863TsG.js → dates-CT5PUuFo.js} +1 -1
  83. package/dist/assets/{dependency-graph-panel-s45LIDec.js → dependency-graph-panel-z8kf8Tus.js} +4 -4
  84. package/dist/assets/{diagram-PSM6KHXK-C7-DZLOE.js → diagram-PSM6KHXK-C0Sfgs1J.js} +1 -1
  85. package/dist/assets/{diagram-QEK2KX5R-Ct2_XsRV.js → diagram-QEK2KX5R-DYSkW6Ju.js} +1 -1
  86. package/dist/assets/{diagram-S2PKOQOG-C82IZoPA.js → diagram-S2PKOQOG-CfHqQVo3.js} +1 -1
  87. package/dist/assets/{dialog-Dstm3Ubn.js → dialog-tQELcltn.js} +1 -1
  88. package/dist/assets/{dist-oarhZoo6.js → dist-BMEHQAhk.js} +1 -1
  89. package/dist/assets/{dist-PT7WsOdN.js → dist-DDGMbl6p.js} +1 -1
  90. package/dist/assets/{dist-BhLw_JdQ.js → dist-h1RhtzUB.js} +1 -1
  91. package/dist/assets/{documentation-panel-DRqbOPwM.js → documentation-panel-DIp1L-6Y.js} +1 -1
  92. package/dist/assets/{download-zuPzhwvm.js → download-CxmzcjnR.js} +1 -1
  93. package/dist/assets/{download-B9SUL40m.js → download-Dg7clfkc.js} +1 -1
  94. package/dist/assets/{dropdown-menu-D8v7RjW8.js → dropdown-menu-BUgFWmX1.js} +1 -1
  95. package/dist/assets/{edit-page-Dlr4v1eI.js → edit-page-DRwTenyP.js} +7 -7
  96. package/dist/assets/{ellipsis-5ip-qDfN.js → ellipsis-DfDsMPvA.js} +1 -1
  97. package/dist/assets/{ellipsis-vertical-C7jYiLCo.js → ellipsis-vertical-J1F7_WS9.js} +1 -1
  98. package/dist/assets/{empty-state-BAGXXrn8.js → empty-state-DrmGF88A.js} +1 -1
  99. package/dist/assets/{en-US-XLBup7bs.js → en-US-DU2jJCpg.js} +1 -1
  100. package/dist/assets/{erDiagram-Q2GNP2WA-Ftt2qDiM.js → erDiagram-Q2GNP2WA-BfRyUS6D.js} +1 -1
  101. package/dist/assets/{error-banner-JIexM8h5.js → error-banner-w4pz2qUB.js} +1 -1
  102. package/dist/assets/{error-panel-TqjIx6nC.js → error-panel-Cz3rrpG9.js} +1 -1
  103. package/dist/assets/{errors-B5AI4nf5.js → errors-CPlNr33a.js} +1 -1
  104. package/dist/assets/{es-CPSXxuS6.js → es-GXAIFcot.js} +5 -5
  105. package/dist/assets/{esm-BbNm2fB0.js → esm-BK6tLEHQ.js} +1 -1
  106. package/dist/assets/{eye-off-BhExYOph.js → eye-off-AK_9uodG.js} +1 -1
  107. package/dist/assets/{field-1uCBX4j4.js → field-D9jE8HEt.js} +1 -1
  108. package/dist/assets/{file-Cs1JbsV6.js → file-Ch78NKWp.js} +1 -1
  109. package/dist/assets/{file-explorer-panel-jku_uMQn.js → file-explorer-panel-BJWXa6fg.js} +1 -1
  110. package/dist/assets/{file-plus-corner-Da9I6dgU.js → file-plus-corner-CvAy4H5W.js} +1 -1
  111. package/dist/assets/{file-video-camera-DW3v07j2.js → file-video-camera-C3wGzBnE.js} +1 -1
  112. package/dist/assets/{floating-outline-CZbF47gm.js → floating-outline-BSd7WV6r.js} +1 -1
  113. package/dist/assets/{flowDiagram-NV44I4VS-Ca9aZp-3.js → flowDiagram-NV44I4VS-DKkZCUwG.js} +1 -1
  114. package/dist/assets/{focus-BxGelf2n.js → focus-CZLCQiuh.js} +1 -1
  115. package/dist/assets/{form-DQt-Ldr4.js → form-BQhIjeKF.js} +1 -1
  116. package/dist/assets/{formats-CobRswjh.js → formats-DGZwRUPy.js} +1 -1
  117. package/dist/assets/gallery-page-1AmSypJ6.js +1 -0
  118. package/dist/assets/{ganttDiagram-JELNMOA3-PYFPdyuJ.js → ganttDiagram-JELNMOA3-J8yLTqxn.js} +1 -1
  119. package/dist/assets/{gitGraphDiagram-NY62KEGX-CfGWoYOo.js → gitGraphDiagram-NY62KEGX-DXw3a-uS.js} +1 -1
  120. package/dist/assets/{glide-data-editor-8ek3zzAO.js → glide-data-editor-Cw8eE9Xn.js} +4 -4
  121. package/dist/assets/globals-DvWD0xHx.js +1 -0
  122. package/dist/assets/{home-page-xDhfcHL1.js → home-page-BaZhe30b.js} +1 -1
  123. package/dist/assets/{hooks-MQa8CSUr.js → hooks-B2h7NTXb.js} +1 -1
  124. package/dist/assets/{house-DhFkiXz7.js → house-BI81AWSn.js} +1 -1
  125. package/dist/assets/{html-to-image-DKqpcM7V.js → html-to-image-Cc7t14sm.js} +1 -1
  126. package/dist/assets/{icons-Dw4USSvE.js → icons-DjR3qLG_.js} +1 -1
  127. package/dist/assets/{index-DuqUGjtK.js → index-CQQ-Toaw.js} +18 -18
  128. package/dist/assets/index-GcHhnSIR.css +2 -0
  129. package/dist/assets/{infoDiagram-WHAUD3N6-Csbwq6Ks.js → infoDiagram-WHAUD3N6-32du45zK.js} +1 -1
  130. package/dist/assets/{input-DcAGg_4_.js → input-DHHmNa19.js} +1 -1
  131. package/dist/assets/{isValid-BLB2jskA.js → isValid-DpSSOU5z.js} +1 -1
  132. package/dist/assets/{journeyDiagram-XKPGCS4Q-DArwMxlY.js → journeyDiagram-XKPGCS4Q-Bmx7dA25.js} +1 -1
  133. package/dist/assets/{kanban-definition-3W4ZIXB7-CPjBJiO_.js → kanban-definition-3W4ZIXB7-DJzhLwsl.js} +1 -1
  134. package/dist/assets/{katex-DYp6oq7P.js → katex-CbllUrnh.js} +1 -1
  135. package/dist/assets/katex-axIMlGRc.js +1 -0
  136. package/dist/assets/{kbd-uRyPZ9w_.js → kbd-k3Sn_RwW.js} +1 -1
  137. package/dist/assets/kiosk-mode-S90PbrZr.js +1 -0
  138. package/dist/assets/{label-CL9Xfexh.js → label-C--1sWU6.js} +1 -1
  139. package/dist/assets/{layout-D-YPCWvX.js → layout-BRVYycwo.js} +4 -4
  140. package/dist/assets/{linear-BxhToEEF.js → linear-DWpCiijk.js} +1 -1
  141. package/dist/assets/{link-BsTPF7B0.js → link-DxicfMbs.js} +1 -1
  142. package/dist/assets/{links-BhgWpHdU.js → links-fh_IXIKE.js} +1 -1
  143. package/dist/assets/{logs-panel-DKSJRyF4.js → logs-panel-DU1PTK6I.js} +1 -1
  144. package/dist/assets/{loro_wasm_bg-BnAHSQ7o.js → loro_wasm_bg-CdafknAX.js} +2 -2
  145. package/dist/assets/loro_wasm_bg-WKwciKJa.wasm +0 -0
  146. package/dist/assets/{loro_wasm_bg-CKQGJrH5.js → loro_wasm_bg-aCueZs8k.js} +1 -1
  147. package/dist/assets/{maps-t9yNKYA8.js → maps-D2_Mq1pZ.js} +1 -1
  148. package/dist/assets/markdown-renderer-Y3WEBmX7.js +10 -0
  149. package/dist/assets/{menu-items-NblnuU_B.js → menu-items-vwmjPhjW.js} +1 -1
  150. package/dist/assets/mermaid-4DMBBIKO-Dn0v3H8Z.js +1 -0
  151. package/dist/assets/{mermaid-Bzaf_nA9.js → mermaid-dAaJQU1M.js} +3 -3
  152. package/dist/assets/{mhchem-DLDYYsJK.js → mhchem-2XRJK9de.js} +1 -1
  153. package/dist/assets/{mindmap-definition-VGOIOE7T-DVB4z5Yy.js → mindmap-definition-VGOIOE7T-whTFv8Zv.js} +1 -1
  154. package/dist/assets/{mode-CevBiFCd.js → mode-CTf4rB7H.js} +1 -1
  155. package/dist/assets/{multi-icon-CLzAg610.js → multi-icon-BWLbAXq5.js} +1 -1
  156. package/dist/assets/{multi-map-W4zci54U.js → multi-map-A4XNra08.js} +1 -1
  157. package/dist/assets/{name-cell-input-DwvdP1Ck.js → name-cell-input-Bmq-KdJ-.js} +1 -1
  158. package/dist/assets/{number-overlay-editor-CvIcqV0W.js → number-overlay-editor-65UcMR52.js} +1 -1
  159. package/dist/assets/{outline-panel-Bg_CP1WV.js → outline-panel-Cfpy5BTW.js} +1 -1
  160. package/dist/assets/{packages-panel-DBgrbk-q.js → packages-panel-C2SNGD_P.js} +1 -1
  161. package/dist/assets/{panel-context-C-UJlFyL.js → panel-context-2mVKaSYm.js} +1 -1
  162. package/dist/assets/panels-D47UNcb0.js +1 -0
  163. package/dist/assets/{pieDiagram-ADFJNKIX-vwwb5uL8.js → pieDiagram-ADFJNKIX-4n07I4VV.js} +1 -1
  164. package/dist/assets/{play-BPIh-ZEU.js → play-GLWQQs7F.js} +1 -1
  165. package/dist/assets/{plus-BD5o34_i.js → plus-B7DF33lD.js} +1 -1
  166. package/dist/assets/{popover-BZZFx3Q8.js → popover-B-131r4d.js} +1 -1
  167. package/dist/assets/{precisionRound-CU2C3Vxx.js → precisionRound-C3fmBb6j.js} +1 -1
  168. package/dist/assets/{process-output-Cl2N-HlT.js → process-output-CdIpMer6.js} +1 -1
  169. package/dist/assets/{quadrantDiagram-AYHSOK5B-Y8bEZ32G.js → quadrantDiagram-AYHSOK5B-CNm24EC2.js} +1 -1
  170. package/dist/assets/{react-BGmjiNul.js → react-Bj1aDYRI.js} +1 -1
  171. package/dist/assets/{react-dom-C9fstfnp.js → react-dom-CSu739Rf.js} +1 -1
  172. package/dist/assets/{react-plotly-CZMBCa5P.js → react-plotly-OyYr93y7.js} +1 -1
  173. package/dist/assets/{react-resizable-panels.browser.esm-BFvP7Upm.js → react-resizable-panels.browser.esm-Mq45xjWt.js} +1 -1
  174. package/dist/assets/{react-vega-BCDifxTe.js → react-vega-BEiHA2e9.js} +1 -1
  175. package/dist/assets/react-vega-BrNLU7si.js +1 -0
  176. package/dist/assets/readonly-python-code-o3TsTcFg.js +1 -0
  177. package/dist/assets/{refresh-ccw-DLEiQDS3.js → refresh-ccw-DN_xCV6A.js} +1 -1
  178. package/dist/assets/{refresh-cw-CQd-1kjx.js → refresh-cw-Dx8TEWFP.js} +1 -1
  179. package/dist/assets/{renderShortcut-zxgoVTeP.js → renderShortcut-Xr6z-RjZ.js} +1 -1
  180. package/dist/assets/request-registry-BWqkV683.js +1 -0
  181. package/dist/assets/{requests-BsVD4CdD.js → requests-B4FYHTZl.js} +1 -1
  182. package/dist/assets/requests-BQkjRazP.js +1 -0
  183. package/dist/assets/{requirementDiagram-UZGBJVZJ-ChckaTrX.js → requirementDiagram-UZGBJVZJ-B7BwuJGh.js} +1 -1
  184. package/dist/assets/{rotate-ccw-B_yU4f05.js → rotate-ccw-DPbJxVVN.js} +1 -1
  185. package/dist/assets/run-page-BRiD7IM8.js +1 -0
  186. package/dist/assets/{runs-X54OGDTq.js → runs-DyBOFmAK.js} +1 -1
  187. package/dist/assets/{sankeyDiagram-TZEHDZUN-DtU4O0-i.js → sankeyDiagram-TZEHDZUN-C8KpmdhC.js} +1 -1
  188. package/dist/assets/{save-PMHbdtqc.js → save-DZodxFnE.js} +1 -1
  189. package/dist/assets/{save-worker-DtF6B3PS.js → save-worker-CtJsIYIM.js} +3 -3
  190. package/dist/assets/{scratchpad-panel-CIxZIJ-1.js → scratchpad-panel-9Nh-KCKz.js} +1 -1
  191. package/dist/assets/{secrets-panel-TwfjwIVv.js → secrets-panel-CEMSgQv5.js} +1 -1
  192. package/dist/assets/{select-CX1Yi8J8.js → select-B7bfltkI.js} +1 -1
  193. package/dist/assets/{sequenceDiagram-WL72ISMW-BGXrTemh.js → sequenceDiagram-WL72ISMW-D0_AcPzd.js} +1 -1
  194. package/dist/assets/{session-panel-CNeWVmTR.js → session-panel-9cibvZIi.js} +1 -1
  195. package/dist/assets/{settings-DOXWMfVd.js → settings-OBbrbhij.js} +1 -1
  196. package/dist/assets/{share-Ba-pHZtq.js → share-rXkgGlhr.js} +1 -1
  197. package/dist/assets/{slides-component-CGMJm_kL.js → slides-component-C0UAH9QZ.js} +1 -1
  198. package/dist/assets/{snippets-panel-DMN_ZSXA.js → snippets-panel-BLiaEg0s.js} +1 -1
  199. package/dist/assets/{spec-D1kBp3jX.js → spec-Ch0xnJY4.js} +1 -1
  200. package/dist/assets/{spinner-DaIKav-i.js → spinner-DA8-7wQv.js} +1 -1
  201. package/dist/assets/{square-C8Tw_XXG.js → square-DPZjfUaq.js} +1 -1
  202. package/dist/assets/{square-function-CqXXKtIq.js → square-function-B6mgCeFJ.js} +1 -1
  203. package/dist/assets/{state-n1Xz9vt7.js → state-DAl4qLSi.js} +1 -1
  204. package/dist/assets/{state-BLsnFVwy.js → state-Q32Iqos3.js} +1 -1
  205. package/dist/assets/{stateDiagram-FKZM4ZOC-BwSf7RIr.js → stateDiagram-FKZM4ZOC-Dz_iVJd6.js} +1 -1
  206. package/dist/assets/stateDiagram-v2-4FDKWEC3-CupainMB.js +1 -0
  207. package/dist/assets/{switch-CfRu5JBF.js → switch-D5W4wgWK.js} +1 -1
  208. package/dist/assets/{table-qbh6Daed.js → table-BOsFCeLh.js} +1 -1
  209. package/dist/assets/{table-DZR6ewbN.js → table-CfDbAm78.js} +1 -1
  210. package/dist/assets/{terminal-C0fH4d_0.js → terminal-BLSSaFMR.js} +1 -1
  211. package/dist/assets/{textarea-3ZXdUni1.js → textarea-UfsPtSW1.js} +1 -1
  212. package/dist/assets/{time-EL4bnqqQ.js → time-CSCsAxXS.js} +1 -1
  213. package/dist/assets/{timeline-definition-IT6M3QCI-BZakpQwy.js → timeline-definition-IT6M3QCI-DPXEeoSm.js} +1 -1
  214. package/dist/assets/{toDate-CgbKQM5E.js → toDate-DETS9bBd.js} +1 -1
  215. package/dist/assets/{toggle-CWS-iCmF.js → toggle-CriARMQK.js} +1 -1
  216. package/dist/assets/{tooltip-DH6k_bBY.js → tooltip-C_WgOOcZ.js} +1 -1
  217. package/dist/assets/{tooltip-DxKBXCGp.js → tooltip-DqsDDLgU.js} +1 -1
  218. package/dist/assets/{tracing-zzjDz6Hy.js → tracing-BqFhwuOc.js} +1 -1
  219. package/dist/assets/tracing-panel-R9i0TrmX.js +2 -0
  220. package/dist/assets/{trash-2-CyqGun26.js → trash-2-B8SQYdQq.js} +1 -1
  221. package/dist/assets/{trash-DMqDgJ5r.js → trash-Cv0yH8fs.js} +1 -1
  222. package/dist/assets/{tree-DHpFOpHo.js → tree-Hg81oJmp.js} +1 -1
  223. package/dist/assets/{triangle-alert-B65rDESJ.js → triangle-alert-U93NZYDl.js} +1 -1
  224. package/dist/assets/{types-CS34eOZi.js → types-C1UhS3qM.js} +1 -1
  225. package/dist/assets/{types-CW-zyy80.js → types-DIb0tcCO.js} +1 -1
  226. package/dist/assets/{use-toast-rmUWldD_.js → use-toast-T0_cQDma.js} +1 -1
  227. package/dist/assets/useAddCell-CXRk4Ma4.js +1 -0
  228. package/dist/assets/{useAsyncData-BAVCkkQP.js → useAsyncData-CgmD3hjw.js} +1 -1
  229. package/dist/assets/{useBoolean-BjVFTMam.js → useBoolean-IZsSX_XF.js} +1 -1
  230. package/dist/assets/useCellActionButton-Du-bZZ06.js +1 -0
  231. package/dist/assets/{useDateFormatter-D89e9xZY.js → useDateFormatter-CieT0-H-.js} +1 -1
  232. package/dist/assets/{useDebounce-CU_caGaU.js → useDebounce-B28kFfrM.js} +1 -1
  233. package/dist/assets/{useDeepCompareMemoize-DiyglPgJ.js → useDeepCompareMemoize-CFtQU7An.js} +1 -1
  234. package/dist/assets/{useDeleteCell-B8CxYiji.js → useDeleteCell-D0DAGwMP.js} +1 -1
  235. package/dist/assets/{useDependencyPanelTab-YtWR0xDK.js → useDependencyPanelTab-CN5-nxOy.js} +1 -1
  236. package/dist/assets/useEvent-BhXAndur.js +1 -0
  237. package/dist/assets/{useEventListener-DIUKKfEy.js → useEventListener-Cb-RVVEn.js} +1 -1
  238. package/dist/assets/{useIframeCapabilities-DzIlROXe.js → useIframeCapabilities-CC8VH6kZ.js} +1 -1
  239. package/dist/assets/{useInstallPackage-C-gjrVjb.js → useInstallPackage-Co79H1lQ.js} +1 -1
  240. package/dist/assets/{useInterval-y9MtYlSD.js → useInterval-BNfubus2.js} +1 -1
  241. package/dist/assets/{useLifecycle-D35CBukS.js → useLifecycle-ClI_npeg.js} +1 -1
  242. package/dist/assets/{useNonce-_Aax6sXd.js → useNonce-CS26E0hA.js} +1 -1
  243. package/dist/assets/{useNotebookActions-Dfh_7NPm.js → useNotebookActions--9xrGXss.js} +1 -1
  244. package/dist/assets/{useNumberFormatter-CTkflual.js → useNumberFormatter-BX4DTYtT.js} +1 -1
  245. package/dist/assets/{usePress-CoEeT5jq.js → usePress-3CRs0fQg.js} +1 -1
  246. package/dist/assets/{useRunCells-rjrIgU8v.js → useRunCells-DaW_oMnr.js} +1 -1
  247. package/dist/assets/{useSplitCell-fcjSuBNO.js → useSplitCell-Cjr7nuBc.js} +1 -1
  248. package/dist/assets/{useTheme-EGf2UOFo.js → useTheme-CTORu22_.js} +1 -1
  249. package/dist/assets/utilities.esm-CME5sKpT.js +3 -0
  250. package/dist/assets/{utils-DXvhzCGS.js → utils-YqBXNpsM.js} +1 -1
  251. package/dist/assets/{vega-component-DAJbxD47.js → vega-component-7jd4fFCJ.js} +1 -1
  252. package/dist/assets/{vega-loader.browser-DXARUlxo.js → vega-loader.browser-BegSZk0G.js} +1 -1
  253. package/dist/assets/{worker-CUL1lW-N.js → worker-CyCdlLVf.js} +3 -3
  254. package/dist/assets/{workflow-CMjI9cxl.js → workflow-B12dAR4X.js} +1 -1
  255. package/dist/assets/{write-secret-modal-CgAvgY9w.js → write-secret-modal-DO-EOoNO.js} +1 -1
  256. package/dist/assets/{x-CoXDX2vQ.js → x-ZP5cObgf.js} +1 -1
  257. package/dist/assets/{xychartDiagram-PRI3JC2R-CAHFvN1H.js → xychartDiagram-PRI3JC2R-DINfGlOV.js} +1 -1
  258. package/dist/assets/{youtube-8p26v8EM.js → youtube--tNPNRy6.js} +1 -1
  259. package/dist/assets/zod-H_cgTO0M.js +40 -0
  260. package/dist/index.html +139 -139
  261. package/package.json +18 -18
  262. package/src/components/app-config/ai-config.tsx +11 -2
  263. package/src/components/app-config/user-config-form.tsx +0 -54
  264. package/src/components/chat/acp/__tests__/state.test.ts +69 -0
  265. package/src/components/chat/acp/state.ts +6 -6
  266. package/src/components/chat/chat-panel.tsx +47 -30
  267. package/src/components/data-table/__tests__/data-table.test.tsx +94 -2
  268. package/src/components/editor/actions/useCellActionButton.tsx +14 -1
  269. package/src/components/editor/cell/CreateCellButton.tsx +2 -1
  270. package/src/components/editor/cell/code/cell-editor.tsx +12 -0
  271. package/src/components/editor/database/__tests__/__snapshots__/as-code.test.ts.snap +15 -0
  272. package/src/components/editor/database/__tests__/as-code.test.ts +8 -0
  273. package/src/components/editor/database/as-code.ts +3 -0
  274. package/src/components/editor/database/schemas.ts +9 -0
  275. package/src/components/editor/renderers/cell-array.tsx +2 -1
  276. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +12 -0
  277. package/src/components/pages/gallery-page.tsx +37 -6
  278. package/src/core/MarimoApp.tsx +12 -8
  279. package/src/core/ai/context/providers/file.ts +1 -1
  280. package/src/core/cells/__tests__/cells.test.ts +120 -0
  281. package/src/core/cells/__tests__/session.test.ts +37 -1
  282. package/src/core/cells/cells.ts +14 -0
  283. package/src/core/cells/session.ts +20 -8
  284. package/src/core/codemirror/language/languages/markdown.ts +7 -0
  285. package/src/core/config/feature-flag.tsx +0 -4
  286. package/src/core/dom/uiregistry.ts +4 -1
  287. package/src/core/run-app.tsx +11 -4
  288. package/src/core/static/__tests__/files.test.ts +195 -1
  289. package/src/core/static/files.ts +39 -9
  290. package/src/plugins/core/registerReactComponent.tsx +9 -1
  291. package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +164 -0
  292. package/src/plugins/impl/anywidget/AnyWidgetPlugin.tsx +7 -1
  293. package/src/utils/__tests__/blob.test.ts +3 -3
  294. package/src/utils/__tests__/id-tree.test.ts +22 -7
  295. package/src/utils/__tests__/mime-types.test.ts +8 -10
  296. package/src/utils/__tests__/url-parser.test.ts +22 -0
  297. package/src/utils/blob.ts +14 -27
  298. package/src/utils/id-tree.tsx +11 -19
  299. package/src/utils/mime-types.ts +5 -5
  300. package/src/utils/url-parser.ts +1 -1
  301. package/dist/assets/MarimoErrorOutput-DuaUr0W-.js +0 -7
  302. package/dist/assets/__vite-browser-external-BkzFKOxE.js +0 -1
  303. package/dist/assets/__vite-browser-external-CPyDqUtZ.js +0 -1
  304. package/dist/assets/blob-t6qcPM7K.js +0 -1
  305. package/dist/assets/channel-ownMsSXG.js +0 -1
  306. package/dist/assets/chat-panel-FiDMP_Qr.js +0 -3
  307. package/dist/assets/check-DdfN0k2d.js +0 -1
  308. package/dist/assets/classDiagram-2ON5EDUG-CSgD2v8F.js +0 -1
  309. package/dist/assets/classDiagram-v2-WZHVMYZB-YTETTIT0.js +0 -1
  310. package/dist/assets/compiler-runtime-DeeZ7FnK.js +0 -1
  311. package/dist/assets/createLucideIcon-CnW3RofX.js +0 -1
  312. package/dist/assets/gallery-page-D_5X4kKx.js +0 -1
  313. package/dist/assets/globals-D4t_HyAp.js +0 -1
  314. package/dist/assets/index-CikhHYAB.css +0 -2
  315. package/dist/assets/katex-BZrXWsTs.js +0 -1
  316. package/dist/assets/kiosk-mode-C9XznhoS.js +0 -1
  317. package/dist/assets/loro_wasm_bg-DV7Kb4_M.wasm +0 -0
  318. package/dist/assets/markdown-renderer-Bu12gPyJ.js +0 -10
  319. package/dist/assets/mermaid-4DMBBIKO-RE7Z6-fl.js +0 -1
  320. package/dist/assets/panels-CaoDGKmF.js +0 -1
  321. package/dist/assets/react-vega-DkHO4e2L.js +0 -1
  322. package/dist/assets/readonly-python-code-H1kzT-lB.js +0 -1
  323. package/dist/assets/request-registry-CjZcQuTP.js +0 -1
  324. package/dist/assets/requests-BSPGoGJL.js +0 -1
  325. package/dist/assets/run-page-BmTC7uxn.js +0 -1
  326. package/dist/assets/stateDiagram-v2-4FDKWEC3-SWMI9LKY.js +0 -1
  327. package/dist/assets/tracing-panel-DogOVTzf.js +0 -2
  328. package/dist/assets/useAddCell-mkD8zurm.js +0 -1
  329. package/dist/assets/useCellActionButton-BZ46_Pdt.js +0 -1
  330. package/dist/assets/useEvent-DO6uJBas.js +0 -1
  331. package/dist/assets/utilities.esm-CkqwfzLw.js +0 -3
  332. package/dist/assets/zod-Cg4WLWh2.js +0 -40
  333. /package/dist/assets/{copy-DHrHayPa.js → copy-BaRrAFL-.js} +0 -0
  334. /package/dist/assets/{defaultLocale-BLne0bXb.js → defaultLocale-B6z1Qyqt.js} +0 -0
  335. /package/dist/assets/{defaultLocale-JieDVWC_.js → defaultLocale-YteS-k_t.js} +0 -0
  336. /package/dist/assets/{emotion-is-prop-valid.esm-C59xfSYt.js → emotion-is-prop-valid.esm-Dangy3Bv.js} +0 -0
  337. /package/dist/assets/{extends-BiFDv3jB.js → extends-Dqvpuc10.js} +0 -0
  338. /package/dist/assets/{objectWithoutPropertiesLoose-DfWeGRFv.js → objectWithoutPropertiesLoose-DoKw85w0.js} +0 -0
  339. /package/dist/assets/{ordinal-C93T4L8H.js → ordinal-DAqJmfoU.js} +0 -0
  340. /package/dist/assets/{prop-types-DaaA-ptl.js → prop-types-DVDiRdwc.js} +0 -0
  341. /package/dist/assets/{purify.es-DZrAQFIu.js → purify.es-B-nzWya6.js} +0 -0
  342. /package/dist/assets/{range-1DwpgXvM.js → range-7fnH_zLA.js} +0 -0
@@ -101,10 +101,17 @@ function PluginSlotInternal<T>(
101
101
  return plugin.validator.safeParse(parseDataset(hostElement));
102
102
  });
103
103
 
104
+ // Incremented on each reset to invalidate memoized function references.
105
+ // This ensures that plugin functions (e.g., search) are re-created when
106
+ // the underlying UI element instance changes (new object-id), even if
107
+ // the element's data attributes haven't changed.
108
+ const [resetNonce, setResetNonce] = useState(0);
109
+
104
110
  useImperativeHandle(ref, () => ({
105
111
  reset: () => {
106
112
  setValue(getInitialValue());
107
113
  setParsedResult(plugin.validator.safeParse(parseDataset(hostElement)));
114
+ setResetNonce((n) => n + 1);
108
115
  },
109
116
  setChildren: (children) => {
110
117
  setChildNodes(children);
@@ -224,7 +231,8 @@ function PluginSlotInternal<T>(
224
231
  }
225
232
 
226
233
  return methods;
227
- }, [plugin.functions, hostElement]);
234
+ // eslint-disable-next-line react-hooks/exhaustive-deps
235
+ }, [plugin.functions, hostElement, resetNonce]);
228
236
 
229
237
  // If we failed to parse the initial value, render an error
230
238
  if (!parsedResult.success) {
@@ -0,0 +1,164 @@
1
+ /* Copyright 2026 Marimo. All rights reserved. */
2
+
3
+ import { TooltipProvider } from "@radix-ui/react-tooltip";
4
+ import { act, render, screen, waitFor } from "@testing-library/react";
5
+ import { Provider } from "jotai";
6
+ import { beforeAll, describe, expect, it, vi } from "vitest";
7
+ import type { DownloadAsArgs } from "@/components/data-table/schemas";
8
+ import type { FieldTypesWithExternalType } from "@/components/data-table/types";
9
+ import { store } from "@/core/state/jotai";
10
+ import {
11
+ type GetDataUrl,
12
+ type GetRowIds,
13
+ LoadingDataTableComponent,
14
+ } from "../DataTablePlugin";
15
+
16
+ beforeAll(() => {
17
+ global.ResizeObserver = class ResizeObserver {
18
+ observe() {
19
+ // do nothing
20
+ }
21
+ unobserve() {
22
+ // do nothing
23
+ }
24
+ disconnect() {
25
+ // do nothing
26
+ }
27
+ };
28
+ });
29
+
30
+ describe("LoadingDataTableComponent", () => {
31
+ /**
32
+ * Regression test for https://github.com/marimo-team/marimo/issues/8023
33
+ *
34
+ * When a table is replaced via mo.output.replace() with updated data,
35
+ * but the initial page data (unsorted first page) hasn't changed,
36
+ * the useAsyncData hook's deps may all remain the same.
37
+ * Previously, the `search` function reference was memoized on
38
+ * [plugin.functions, hostElement] and wouldn't change on reset(),
39
+ * so the useAsyncData effect wouldn't re-fire.
40
+ *
41
+ * The fix adds a resetNonce to the functionMethods memo deps,
42
+ * so when the plugin is reset (table instance changes), the search
43
+ * function reference changes, triggering useAsyncData to re-fetch.
44
+ *
45
+ * This test verifies that when the search function reference changes
46
+ * (simulating reset()), the component re-fetches data even if
47
+ * props.data hasn't changed.
48
+ */
49
+ it("should refetch data when search function reference changes", async () => {
50
+ const host = document.createElement("div");
51
+ const setValue = vi.fn();
52
+
53
+ // The initial page data string - identical for both renders.
54
+ // This simulates the case where only a row on page 2 changed,
55
+ // so the first page data is the same.
56
+ const initialPageData = JSON.stringify([
57
+ { id: 1, status: "pending", value: 10 },
58
+ { id: 2, status: "pending", value: 20 },
59
+ { id: 3, status: "pending", value: 30 },
60
+ ]);
61
+
62
+ const searchResult = {
63
+ data: [
64
+ { id: 1, status: "pending", value: 10 },
65
+ { id: 2, status: "pending", value: 20 },
66
+ { id: 3, status: "pending", value: 30 },
67
+ ],
68
+ total_rows: 4,
69
+ cell_styles: null,
70
+ cell_hover_texts: null,
71
+ };
72
+
73
+ const searchFn1 = vi.fn().mockResolvedValue(searchResult);
74
+ const searchFn2 = vi.fn().mockResolvedValue(searchResult);
75
+
76
+ const fieldTypes: FieldTypesWithExternalType = [
77
+ ["id", ["integer", "integer"]],
78
+ ["status", ["string", "string"]],
79
+ ["value", ["integer", "integer"]],
80
+ ];
81
+
82
+ const commonProps = {
83
+ label: null,
84
+ totalRows: 4,
85
+ pagination: true,
86
+ pageSize: 3,
87
+ selection: "single" as const,
88
+ showDownload: false,
89
+ showFilters: false,
90
+ showColumnSummaries: false as const,
91
+ showDataTypes: false,
92
+ showPageSizeSelector: false,
93
+ showColumnExplorer: false,
94
+ showRowExplorer: false,
95
+ showChartBuilder: false,
96
+ rowHeaders: [] as FieldTypesWithExternalType,
97
+ fieldTypes,
98
+ totalColumns: 3,
99
+ maxColumns: "all" as const,
100
+ hasStableRowId: false,
101
+ lazy: false,
102
+ host,
103
+ enableSearch: true,
104
+ value: [] as (number | string | { rowId: string; columnName?: string })[],
105
+ setValue,
106
+ download_as: vi.fn() as DownloadAsArgs,
107
+ get_column_summaries: vi.fn().mockResolvedValue({
108
+ data: null,
109
+ stats: {},
110
+ bin_values: {},
111
+ value_counts: {},
112
+ show_charts: false,
113
+ }),
114
+ get_data_url: vi.fn() as GetDataUrl,
115
+ get_row_ids: vi.fn() as GetRowIds,
116
+ };
117
+
118
+ const Wrapper = ({ children }: { children: React.ReactNode }) => (
119
+ <Provider store={store}>
120
+ <TooltipProvider>{children}</TooltipProvider>
121
+ </Provider>
122
+ );
123
+
124
+ // Render with first search function
125
+ const { rerender } = render(
126
+ <Wrapper>
127
+ <LoadingDataTableComponent
128
+ {...commonProps}
129
+ data={initialPageData}
130
+ search={searchFn1}
131
+ />
132
+ </Wrapper>,
133
+ );
134
+
135
+ // Wait for the table to render with data
136
+ await waitFor(() => {
137
+ expect(screen.getAllByRole("row").length).toBeGreaterThan(1);
138
+ });
139
+
140
+ // Search was called on initial load (fire-and-forget for canShowInitialPage)
141
+ expect(searchFn1).toHaveBeenCalled();
142
+
143
+ // Now rerender with the same data but a NEW search function reference.
144
+ // This simulates what happens after reset() when resetNonce increments
145
+ // and functionMethods is recreated.
146
+ await act(async () => {
147
+ rerender(
148
+ <Wrapper>
149
+ <LoadingDataTableComponent
150
+ {...commonProps}
151
+ data={initialPageData}
152
+ search={searchFn2}
153
+ />
154
+ </Wrapper>,
155
+ );
156
+ });
157
+
158
+ // The new search function should be called because the search
159
+ // dependency changed in useAsyncData.
160
+ await waitFor(() => {
161
+ expect(searchFn2).toHaveBeenCalled();
162
+ });
163
+ });
164
+ });
@@ -8,6 +8,8 @@ import useEvent from "react-use-event-hook";
8
8
  import { z } from "zod";
9
9
  import { MarimoIncomingMessageEvent } from "@/core/dom/events";
10
10
  import { asRemoteURL } from "@/core/runtime/config";
11
+ import { resolveVirtualFileURL } from "@/core/static/files";
12
+ import { isStaticNotebook } from "@/core/static/static-state";
11
13
  import { useAsyncData } from "@/hooks/useAsyncData";
12
14
  import { useDeepCompareMemoize } from "@/hooks/useDeepCompareMemoize";
13
15
  import {
@@ -93,7 +95,11 @@ const AnyWidgetSlot = (
93
95
  error,
94
96
  refetch,
95
97
  } = useAsyncData(async () => {
96
- const url = asRemoteURL(jsUrl).toString();
98
+ let url = asRemoteURL(jsUrl).toString();
99
+ // In static notebooks, resolve virtual files to blob URLs for import()
100
+ if (isStaticNotebook()) {
101
+ url = resolveVirtualFileURL(url);
102
+ }
97
103
  return await import(/* @vite-ignore */ url);
98
104
  // Re-render on jsHash change (which is a hash of the contents of the file)
99
105
  // instead of a jsUrl change because URLs may change without the contents
@@ -20,7 +20,7 @@ describe("Blob serialization and deserialization", () => {
20
20
 
21
21
  test("deserializeBlob should deserialize a base64 string to a Blob", async () => {
22
22
  const serialized = await serializeBlob(testBlob);
23
- const deserialized = await deserializeBlob(serialized);
23
+ const deserialized = deserializeBlob(serialized);
24
24
  expect(deserialized).toBeDefined();
25
25
  expect(deserialized.size).toBe(testBlob.size);
26
26
  expect(deserialized.type).toBe(testBlob.type);
@@ -28,7 +28,7 @@ describe("Blob serialization and deserialization", () => {
28
28
 
29
29
  test("deserialized Blob should contain the original content", async () => {
30
30
  const serialized = await serializeBlob(testBlob);
31
- const deserialized = await deserializeBlob(serialized);
31
+ const deserialized = deserializeBlob(serialized);
32
32
  const reader = new FileReader();
33
33
  // eslint-disable-next-line unicorn/prefer-blob-reading-methods
34
34
  reader.readAsText(deserialized);
@@ -45,7 +45,7 @@ describe("Blob serialization and deserialization", () => {
45
45
  type: "image/png",
46
46
  });
47
47
  const serialized = await serializeBlob(imageBlob);
48
- const deserialized = await deserializeBlob(serialized);
48
+ const deserialized = deserializeBlob(serialized);
49
49
  expect(deserialized).toBeDefined();
50
50
  expect(deserialized.size).toBe(imageBlob.size);
51
51
  expect(deserialized.type).toBe(imageBlob.type);
@@ -214,16 +214,19 @@ describe("CollapsibleTree", () => {
214
214
  `);
215
215
  });
216
216
 
217
- it("fails to expand", () => {
217
+ it("fails to expand when node not found", () => {
218
218
  expect(() => tree.expand("five")).toThrowErrorMatchingInlineSnapshot(
219
219
  "[Error: Node five not found in tree. Valid ids: one,two,three,four]",
220
220
  );
221
- expect(() => {
222
- tree.expand("one");
223
- tree.expand("one");
224
- }).toThrowErrorMatchingInlineSnapshot(
225
- "[Error: Node one is already expanded]",
226
- );
221
+ });
222
+
223
+ it("expand on already expanded node is a no-op", () => {
224
+ // Expanding an already expanded node should return the same tree (no-op)
225
+ const result = tree.expand("one");
226
+ expect(result).toBe(tree);
227
+ // Can call multiple times without error
228
+ const result2 = tree.expand("one");
229
+ expect(result2).toBe(tree);
227
230
  });
228
231
 
229
232
  it("moves nodes correctly", () => {
@@ -378,6 +381,18 @@ describe("CollapsibleTree", () => {
378
381
  `);
379
382
  });
380
383
 
384
+ it("can delete non-collapsed nodes without throwing", () => {
385
+ // Deleting a non-collapsed node should not throw
386
+ // (previously this would throw "Node is already expanded" internally)
387
+ const result = tree.deleteAtIndex(1);
388
+ expect(result.toString()).toMatchInlineSnapshot(`
389
+ "one
390
+ three
391
+ four
392
+ "
393
+ `);
394
+ });
395
+
381
396
  it("fails to delete nodes", () => {
382
397
  expect(() => tree.deleteAtIndex(5)).toThrowErrorMatchingInlineSnapshot(
383
398
  "[Error: Node at index 5 not found in tree]",
@@ -132,7 +132,7 @@ describe("mime-types", () => {
132
132
 
133
133
  describe("sortByPrecedence", () => {
134
134
  it("should sort entries by precedence order", () => {
135
- const entries: Array<[MimeType, string]> = [
135
+ const entries: [MimeType, string][] = [
136
136
  ["text/plain", "plain"],
137
137
  ["text/html", "html"],
138
138
  ["image/png", "png"],
@@ -151,7 +151,7 @@ describe("mime-types", () => {
151
151
  });
152
152
 
153
153
  it("should place unknown mime types at the end", () => {
154
- const entries: Array<[MimeType, string]> = [
154
+ const entries: [MimeType, string][] = [
155
155
  ["text/plain", "plain"],
156
156
  ["text/html", "html"],
157
157
  ["application/json", "json"],
@@ -173,7 +173,7 @@ describe("mime-types", () => {
173
173
  });
174
174
 
175
175
  it("should handle empty precedence", () => {
176
- const entries: Array<[MimeType, string]> = [
176
+ const entries: [MimeType, string][] = [
177
177
  ["text/plain", "plain"],
178
178
  ["text/html", "html"],
179
179
  ];
@@ -184,7 +184,7 @@ describe("mime-types", () => {
184
184
  });
185
185
 
186
186
  it("should not mutate original array", () => {
187
- const entries: Array<[MimeType, string]> = [
187
+ const entries: [MimeType, string][] = [
188
188
  ["text/plain", "plain"],
189
189
  ["text/html", "html"],
190
190
  ];
@@ -198,7 +198,7 @@ describe("mime-types", () => {
198
198
 
199
199
  describe("processMimeBundle", () => {
200
200
  it("should filter and sort mime entries", () => {
201
- const entries: Array<[MimeType, string]> = [
201
+ const entries: [MimeType, string][] = [
202
202
  ["text/plain", "plain"],
203
203
  ["text/html", "html"],
204
204
  ["image/png", "png"],
@@ -226,7 +226,7 @@ describe("mime-types", () => {
226
226
  });
227
227
 
228
228
  it("should use default config when not provided", () => {
229
- const entries: Array<[MimeType, string]> = [
229
+ const entries: [MimeType, string][] = [
230
230
  ["text/html", "html"],
231
231
  ["image/png", "png"],
232
232
  ["text/markdown", "md"],
@@ -240,9 +240,7 @@ describe("mime-types", () => {
240
240
 
241
241
  it("should preserve data associated with mime types", () => {
242
242
  const htmlData = { content: "<h1>Hello</h1>" };
243
- const entries: Array<[MimeType, typeof htmlData]> = [
244
- ["text/html", htmlData],
245
- ];
243
+ const entries: [MimeType, typeof htmlData][] = [["text/html", htmlData]];
246
244
 
247
245
  const result = processMimeBundle(entries);
248
246
 
@@ -250,7 +248,7 @@ describe("mime-types", () => {
250
248
  });
251
249
 
252
250
  it("should sort by precedence after filtering", () => {
253
- const entries: Array<[MimeType, string]> = [
251
+ const entries: [MimeType, string][] = [
254
252
  ["text/plain", "plain"],
255
253
  ["text/markdown", "md"],
256
254
  ["text/html", "html"],
@@ -76,4 +76,26 @@ describe("parseContent", () => {
76
76
  url: "https://avatars.githubusercontent.com/u/123",
77
77
  });
78
78
  });
79
+
80
+ it("preserves newlines between URLs", () => {
81
+ const parts = parseContent("https://marimo.io\nhttps://github.com\n");
82
+ expect(parts).toEqual([
83
+ { type: "url", url: "https://marimo.io" },
84
+ { type: "text", value: "\n" },
85
+ { type: "url", url: "https://github.com" },
86
+ { type: "text", value: "\n" },
87
+ ]);
88
+ });
89
+
90
+ it("preserves whitespace in mixed content", () => {
91
+ const parts = parseContent(
92
+ "Line 1: https://marimo.io\nLine 2: https://github.com",
93
+ );
94
+ expect(parts).toEqual([
95
+ { type: "text", value: "Line 1: " },
96
+ { type: "url", url: "https://marimo.io" },
97
+ { type: "text", value: "\nLine 2: " },
98
+ { type: "url", url: "https://github.com" },
99
+ ]);
100
+ });
79
101
  });
package/src/utils/blob.ts CHANGED
@@ -14,32 +14,19 @@ export function serializeBlob<T>(blob: Blob): Promise<DataURLString> {
14
14
  });
15
15
  }
16
16
 
17
- export function deserializeBlob(serializedBlob: DataURLString): Promise<Blob> {
18
- return new Promise((resolve, reject) => {
19
- try {
20
- // Extract the base64 data from the data URL
21
- const [prefix, base64Data] = serializedBlob.split(",", 2);
22
- const mimeType = /^data:(.+);base64$/.exec(prefix)?.[1];
23
- // Decode the base64 string
24
- const binaryString = atob(base64Data);
25
- // Convert the binary string to an array buffer
26
- const len = binaryString.length;
27
- const bytes = new Uint8Array(len);
28
- for (let i = 0; i < len; i++) {
29
- bytes[i] = binaryString.charCodeAt(i);
30
- }
31
- // Create a new Blob from the array buffer
32
- const blob = new Blob([bytes], { type: mimeType });
33
- resolve(blob);
34
- } catch (error) {
35
- reject(ensureError(error));
36
- }
37
- });
38
- }
39
-
40
- function ensureError(error: unknown): Error {
41
- if (error instanceof Error) {
42
- return error;
17
+ export function deserializeBlob(serializedBlob: DataURLString): Blob {
18
+ // Extract the base64 data from the data URL
19
+ const [prefix, base64Data] = serializedBlob.split(",", 2);
20
+ const mimeType = /^data:(.+);base64$/.exec(prefix)?.[1];
21
+ // Decode the base64 string
22
+ const binaryString = atob(base64Data);
23
+ // Convert the binary string to an array buffer
24
+ const len = binaryString.length;
25
+ const bytes = new Uint8Array(len);
26
+ for (let i = 0; i < len; i++) {
27
+ bytes[i] = binaryString.charCodeAt(i);
43
28
  }
44
- return new Error(`${error}`);
29
+ // Create a new Blob from the array buffer
30
+ const blob = new Blob([bytes], { type: mimeType });
31
+ return blob;
45
32
  }
@@ -360,7 +360,8 @@ export class CollapsibleTree<T> {
360
360
  }
361
361
 
362
362
  /**
363
- * Expand a node and all of its children
363
+ * Expand a node and all of its children.
364
+ * If the node is already expanded, returns the same tree (no-op).
364
365
  */
365
366
  expand(id: T): CollapsibleTree<T> {
366
367
  const nodeIndex = this.nodes.findIndex((n) => n.value === id);
@@ -373,7 +374,8 @@ export class CollapsibleTree<T> {
373
374
  let nodes = [...this.nodes];
374
375
  const node = nodes[nodeIndex];
375
376
  if (!node.isCollapsed) {
376
- throw new Error(`Node ${id} is already expanded`);
377
+ // Already expanded, no-op
378
+ return this;
377
379
  }
378
380
 
379
381
  nodes[nodeIndex] = new TreeNode(node.value, false, []);
@@ -495,13 +497,9 @@ export class CollapsibleTree<T> {
495
497
  */
496
498
  deleteAtIndex(idx: number): CollapsibleTree<T> {
497
499
  const id = this.atOrThrow(idx);
498
- let tree = this.withNodes(this.nodes);
499
- try {
500
- tree = tree.expand(id);
501
- } catch {
502
- // Don't care if its not expanded
503
- }
504
- return this.withNodes(arrayDelete(tree.nodes, idx));
500
+ // Expand the node first (if collapsed) to bring children back to top level
501
+ const tree = this.expand(id);
502
+ return tree.withNodes(arrayDelete(tree.nodes, idx));
505
503
  }
506
504
 
507
505
  delete(id: T): CollapsibleTree<T> {
@@ -524,16 +522,10 @@ export class CollapsibleTree<T> {
524
522
  if (found.length === 0) {
525
523
  return this;
526
524
  }
527
- let result = this.withNodes(this.nodes);
528
- for (const node of found) {
529
- try {
530
- result = result.expand(node);
531
- } catch {
532
- // Don't care if its the last node and its not expanded
533
- }
534
- }
535
-
536
- return result;
525
+ return found.reduce<CollapsibleTree<T>>(
526
+ (acc, node) => acc.expand(node),
527
+ this,
528
+ );
537
529
  }
538
530
 
539
531
  /**
@@ -26,7 +26,7 @@ export interface MimeTypeConfig {
26
26
  */
27
27
  export interface ProcessedMimeTypes<T> {
28
28
  /** The filtered and sorted mime entries */
29
- entries: Array<[MimeType, T]>;
29
+ entries: [MimeType, T][];
30
30
  /** Mime types that were hidden by rules */
31
31
  hidden: MimeType[];
32
32
  }
@@ -146,9 +146,9 @@ export function applyHidingRules(
146
146
  * Mime types not in the map are placed at the end, preserving their original order.
147
147
  */
148
148
  export function sortByPrecedence<T>(
149
- entries: Array<[MimeType, T]>,
149
+ entries: [MimeType, T][],
150
150
  precedence: ReadonlyMap<MimeType, number>,
151
- ): Array<[MimeType, T]> {
151
+ ): [MimeType, T][] {
152
152
  const unknownPrecedence = precedence.size;
153
153
 
154
154
  return [...entries].sort((a, b) => {
@@ -162,7 +162,7 @@ export function sortByPrecedence<T>(
162
162
  * Main entry point: processes mime entries by applying hiding rules and sorting.
163
163
  */
164
164
  export function processMimeBundle<T>(
165
- entries: Array<[MimeType, T]>,
165
+ entries: [MimeType, T][],
166
166
  config: MimeTypeConfig = getDefaultMimeConfig(),
167
167
  ): ProcessedMimeTypes<T> {
168
168
  if (entries.length === 0) {
@@ -176,6 +176,6 @@ export function processMimeBundle<T>(
176
176
 
177
177
  return {
178
178
  entries: sortedEntries,
179
- hidden: Array.from(hidden),
179
+ hidden: [...hidden],
180
180
  };
181
181
  }
@@ -19,7 +19,7 @@ export function parseContent(text: string): ContentPart[] {
19
19
  return [{ type: "image", url: text }];
20
20
  }
21
21
 
22
- const parts = text.split(urlRegex).filter((part) => part.trim() !== "");
22
+ const parts = text.split(urlRegex).filter((part) => part !== "");
23
23
  return parts.map((part) => {
24
24
  const isUrl = urlRegex.test(part);
25
25
  if (isUrl) {
@@ -1,7 +0,0 @@
1
- import{s as Y}from"./chunk-LvLJmgfZ.js";import{d as ye,f as ve,l as Ne,u as be}from"./useEvent-DO6uJBas.js";import{t as we}from"./react-BGmjiNul.js";import{J as ke,Ln as Ie,Lr as $e,Rr as G,Yr as _e,hn as Fe,sn as Ae,w as Te,y as Ce}from"./cells-BcMpgRWV.js";import{t as E}from"./compiler-runtime-DeeZ7FnK.js";import{t as Se}from"./invariant-CAG_dYON.js";import{r as Me}from"./utils-DXvhzCGS.js";import{t as ze}from"./jsx-runtime-ZmTK25f3.js";import{r as K,t as $}from"./button-YC1gW_kJ.js";import{t as X}from"./cn-BKtXLv3a.js";import{t as H}from"./createLucideIcon-CnW3RofX.js";import{r as qe}from"./x-CoXDX2vQ.js";import{a as Ee,p as Le,r as Pe,t as We}from"./dropdown-menu-D8v7RjW8.js";import{a as Ve,n as Be}from"./state-BLsnFVwy.js";import{c as Z,n as Qe}from"./datasource-BZ3O2HG1.js";import{a as De}from"./dist-BYyu59D8.js";import{t as ee}from"./tooltip-DH6k_bBY.js";import{a as Oe,i as He,n as Re,r as Ue}from"./multi-map-W4zci54U.js";import{t as te}from"./kbd-uRyPZ9w_.js";import{t as A}from"./links-BhgWpHdU.js";import{r as Je,t as Ye}from"./alert-adkp2Qj8.js";import{o as Ge,t as Ke}from"./useInstallPackage-C-gjrVjb.js";import{n as b}from"./cell-link-DW0zobk9.js";var Xe=H("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),T=H("square-arrow-out-up-right",[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]]),re=H("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);function Ze(r){let e=null,s=r.cursor();do s.name==="ExpressionStatement"&&(e=s.node);while(s.next());return e}function et(r){let e=r.split(`
2
- `),s=" ",n=Ze(De.parse(r));if(!n)return["def _():",...R(e,s),`${s}return`,"","","_()"].join(`
3
- `);let i=r.slice(0,n.from).trim(),l=r.slice(n.from).trim(),a=i.split(`
4
- `),c=l.split(`
5
- `);return["def _():",...R(a,s),`${s}return ${c[0]}`,...R(c.slice(1),s),"","","_()"].join(`
6
- `)}function R(r,e){if(r.length===1&&r[0]==="")return[];let s=[];for(let n of r)n===""?s.push(""):s.push(e+n);return s}function tt(r,e){var s;if(r.type==="multiple-defs")return[{title:"Fix: Wrap in a function",description:"Make this cell's variables local by wrapping the cell in a function.",fixType:"manual",onFix:async n=>{Se(n.editor,"Editor is null");let i=et(n.editor.state.doc.toString());n.editor.dispatch({changes:{from:0,to:n.editor.state.doc.length,insert:i}})}}];if(r.type==="exception"&&r.exception_type==="NameError"){let n=(s=r.msg.match(/name '(.+)' is not defined/))==null?void 0:s[1];if(!n||!(n in se))return[];let i=rt(n);return[{title:`Fix: Add '${i}'`,description:"Add a new cell for the missing import",fixType:"manual",onFix:async l=>{l.addCodeBelow(i)}}]}return r.type==="sql-error"&&e.aiEnabled?[{title:"Fix with AI",description:"Fix the SQL statement",fixType:"ai",onFix:async n=>{var a;let i=Qe(n.cellId),l=`Fix the SQL statement: ${r.msg}.`;i&&(l+=`
7
- Database schema: ${i}`),(a=n.aiFix)==null||a.setAiCompletionCell({cellId:n.cellId,initialPrompt:l,triggerImmediately:n.aiFix.triggerFix})}}]:[]}function rt(r){let e=se[r];return e===r?`import ${e}`:`import ${e} as ${r}`}var se={mo:"marimo",alt:"altair",bokeh:"bokeh",dask:"dask",np:"numpy",pd:"pandas",pl:"polars",plotly:"plotly",plt:"matplotlib.pyplot",px:"plotly.express",scipy:"scipy",sk:"sklearn",sns:"seaborn",stats:"scipy.stats",tf:"tensorflow",torch:"torch",xr:"xarray",dt:"datetime",json:"json",math:"math",os:"os",re:"re",sys:"sys"},st=E(),nt=_e("marimo:ai-autofix-mode","autofix",Fe);function lt(){let r=(0,st.c)(3),[e,s]=Ne(nt),n;return r[0]!==e||r[1]!==s?(n={fixMode:e,setFixMode:s},r[0]=e,r[1]=s,r[2]=n):n=r[2],n}var U=E(),t=Y(ze(),1);const N=r=>{let e=(0,U.c)(21),{errors:s,cellId:n,className:i}=r,l=ve(),{createNewCell:a}=Te(),c=be(Me),o;if(e[0]!==c||e[1]!==s){let x;e[3]===c?x=e[4]:(x=y=>tt(y,{aiEnabled:c}),e[3]=c,e[4]=x),o=s.flatMap(x),e[0]=c,e[1]=s,e[2]=o}else o=e[2];let m=o,p=ye(Be);if(m.length===0)return null;let d=m[0],f;e[5]!==n||e[6]!==a||e[7]!==d||e[8]!==p||e[9]!==l?(f=x=>{var w;let y=(w=l.get(Ce).cellHandles[n].current)==null?void 0:w.editorView;d.onFix({addCodeBelow:_=>{a({cellId:n,autoFocus:!1,before:!1,code:_})},editor:y,cellId:n,aiFix:{setAiCompletionCell:p,triggerFix:x}}),y==null||y.focus()},e[5]=n,e[6]=a,e[7]=d,e[8]=p,e[9]=l,e[10]=f):f=e[10];let u=f,j;e[11]===i?j=e[12]:(j=X("my-2",i),e[11]=i,e[12]=j);let h;e[13]!==d.description||e[14]!==d.fixType||e[15]!==d.title||e[16]!==u?(h=d.fixType==="ai"?(0,t.jsx)(oe,{tooltip:d.description,openPrompt:()=>u(!1),applyAutofix:()=>u(!0)}):(0,t.jsx)(ee,{content:d.description,align:"start",children:(0,t.jsxs)($,{size:"xs",variant:"outline",className:"font-normal",onClick:()=>u(!1),children:[(0,t.jsx)(Z,{className:"h-3 w-3 mr-2"}),d.title]})}),e[13]=d.description,e[14]=d.fixType,e[15]=d.title,e[16]=u,e[17]=h):h=e[17];let g;return e[18]!==j||e[19]!==h?(g=(0,t.jsx)("div",{className:j,children:h}),e[18]=j,e[19]=h,e[20]=g):g=e[20],g};var ne=Ve,le=Z,ie="Suggest a prompt",ae="Fix with AI";const oe=r=>{let e=(0,U.c)(21),{tooltip:s,openPrompt:n,applyAutofix:i}=r,{fixMode:l,setFixMode:a}=lt(),c=l==="prompt"?n:i,o;e[0]===l?o=e[1]:(o=l==="prompt"?(0,t.jsx)(ne,{className:"h-3 w-3 mr-2 mb-0.5"}):(0,t.jsx)(le,{className:"h-3 w-3 mr-2 mb-0.5"}),e[0]=l,e[1]=o);let m=l==="prompt"?ie:ae,p;e[2]!==c||e[3]!==o||e[4]!==m?(p=(0,t.jsxs)($,{size:"xs",variant:"outline",className:"font-normal rounded-r-none border-r-0",onClick:c,children:[o,m]}),e[2]=c,e[3]=o,e[4]=m,e[5]=p):p=e[5];let d;e[6]!==p||e[7]!==s?(d=(0,t.jsx)(ee,{content:s,align:"start",children:p}),e[6]=p,e[7]=s,e[8]=d):d=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=(0,t.jsx)(Le,{asChild:!0,children:(0,t.jsx)($,{size:"xs",variant:"outline",className:"rounded-l-none px-2","aria-label":"Fix options",children:(0,t.jsx)(qe,{className:"h-3 w-3"})})}),e[9]=f):f=e[9];let u;e[10]!==l||e[11]!==a?(u=()=>{a(l==="prompt"?"autofix":"prompt")},e[10]=l,e[11]=a,e[12]=u):u=e[12];let j=l==="prompt"?"autofix":"prompt",h;e[13]===j?h=e[14]:(h=(0,t.jsx)(it,{mode:j}),e[13]=j,e[14]=h);let g;e[15]!==u||e[16]!==h?(g=(0,t.jsxs)(We,{children:[f,(0,t.jsx)(Pe,{align:"end",className:"w-56",children:(0,t.jsx)(Ee,{className:"flex items-center gap-2",onClick:u,children:h})})]}),e[15]=u,e[16]=h,e[17]=g):g=e[17];let x;return e[18]!==g||e[19]!==d?(x=(0,t.jsxs)("div",{className:"flex",children:[d,g]}),e[18]=g,e[19]=d,e[20]=x):x=e[20],x};var it=r=>{let e=(0,U.c)(12),{mode:s}=r,n;e[0]===s?n=e[1]:(n=s==="prompt"?(0,t.jsx)(ne,{className:"h-4 w-4"}):(0,t.jsx)(le,{className:"h-4 w-4"}),e[0]=s,e[1]=n);let i=n,l=s==="prompt"?ie:ae,a=s==="prompt"?"Edit the prompt before applying":"Apply AI fixes automatically",c;e[2]===l?c=e[3]:(c=(0,t.jsx)("span",{className:"font-medium",children:l}),e[2]=l,e[3]=c);let o;e[4]===a?o=e[5]:(o=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:a}),e[4]=a,e[5]=o);let m;e[6]!==c||e[7]!==o?(m=(0,t.jsxs)("div",{className:"flex flex-col",children:[c,o]}),e[6]=c,e[7]=o,e[8]=m):m=e[8];let p;return e[9]!==i||e[10]!==m?(p=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[i,m]}),e[9]=i,e[10]=m,e[11]=p):p=e[11],p},ce=/(https?:\/\/\S+)/,at=/\.(png|jpe?g|gif|webp|svg|ico)(\?.*)?$/i,de=/^data:image\//i,ot=["avatars.githubusercontent.com"];function me(r){return de.test(r)?[{type:"image",url:r}]:r.split(ce).filter(e=>e.trim()!=="").map(e=>ce.test(e)?at.test(e)||de.test(e)||ot.some(s=>e.includes(s))?{type:"image",url:e}:{type:"url",url:e}:{type:"text",value:e})}var pe=E(),L=Y(we(),1),ct=new ke;const J=r=>{let e=RegExp("\x1B\\[[0-9;]*m","g");return r.replaceAll(e,"")};var ue=/(pip\s+install|uv\s+add|uv\s+pip\s+install)\s+/gi;function dt(r){ue.lastIndex=0;let e=ue.exec(r);if(!e)return null;let s=e.index+e[0].length,n=r.slice(s).split(/\s+/),i="",l=0;for(let c of n){let o=c.trim();if(!o)continue;if(o.startsWith("-")){l+=o.length+1;continue}let m=o.match(/^[\w,.[\]-]+/);if(m){i=m[0];break}break}if(!i)return null;let a=s+l+i.length;return{package:i,endIndex:a}}function k(r,e=""){if(!r)return null;if(!/https?:\/\//.test(r))return r;let s=me(r);return s.length===1&&s[0].type==="text"?r:(0,t.jsx)(t.Fragment,{children:s.map((n,i)=>{let l=e?`${e}-${i}`:i;if(n.type==="url"){let a=J(n.url);return(0,t.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",onClick:K.stopPropagation(),className:"text-link hover:underline",children:a},l)}if(n.type==="image"){let a=J(n.url);return(0,t.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",onClick:K.stopPropagation(),className:"text-link hover:underline",children:a},l)}return(0,t.jsx)(L.Fragment,{children:n.value},l)})})}var mt=r=>{let e=(0,pe.c)(6),{packages:s,children:n}=r,{handleInstallPackages:i}=Ke(),l;e[0]!==i||e[1]!==s?(l=c=>{i(s),c.preventDefault()},e[0]=i,e[1]=s,e[2]=l):l=e[2];let a;return e[3]!==n||e[4]!==l?(a=(0,t.jsx)("button",{onClick:l,className:"text-link hover:underline",type:"button",children:n}),e[3]=n,e[4]=l,e[5]=a):a=e[5],a};const pt=r=>{if(!(r instanceof G.Text))return;let e=J(r.data);if(!/(pip\s+install|uv\s+add|uv\s+pip\s+install)/i.test(e))return;let s=[],n=/(pip\s+install|uv\s+add|uv\s+pip\s+install)\s+/gi,i;for(;(i=n.exec(e))!==null;){let c=i.index,o=dt(e.slice(c));o&&s.push({match:i,result:o})}if(s.length===0)return;let l=[],a=0;if(s.forEach((c,o)=>{let{match:m,result:p}=c,d=m.index,f=d+p.endIndex;if(a<d){let j=e.slice(a,d);l.push((0,t.jsx)(L.Fragment,{children:k(j,`before-${o}`)},`before-${o}`))}let u=e.slice(d,f);l.push((0,t.jsx)(mt,{packages:[p.package],children:u},`install-${o}`)),a=f}),a<e.length){let c=e.slice(a);l.push((0,t.jsx)(L.Fragment,{children:k(c,"after")},"after"))}return(0,t.jsx)(t.Fragment,{children:l})},ut=r=>{if(!(r instanceof G.Text))return;let e=r.data;if(!/https?:\/\//.test(e))return;let s=k(e);if(typeof s!="string")return(0,t.jsx)(t.Fragment,{children:s})},ht=(...r)=>e=>{for(let s of r){let n=s(e);if(n!==void 0)return n}},xt=(r,e)=>(0,t.jsx)("span",{children:$e(ct.ansi_to_html(r),{replace:s=>e(s)})}),ft=r=>{let e=(0,pe.c)(4),{text:s}=r,n;e[0]===s?n=e[1]:(n=xt(s,ht(pt,ut)),e[0]=s,e[1]=n);let i=n,l;return e[2]===i?l=e[3]:(l=(0,t.jsx)(t.Fragment,{children:i}),e[2]=i,e[3]=l),l};var he=E(),I=r=>{let e=(0,he.c)(10),s=r.title??"Tip",n;e[0]===s?n=e[1]:(n=(0,t.jsx)(Oe,{className:"pt-2 pb-2 font-normal",children:s}),e[0]=s,e[1]=n);let i;e[2]===r.children?i=e[3]:(i=(0,t.jsx)(Ue,{className:"mr-24 text-[0.84375rem]",children:r.children}),e[2]=r.children,e[3]=i);let l;e[4]!==n||e[5]!==i?(l=(0,t.jsxs)(He,{value:"item-1",className:"text-muted-foreground",children:[n,i]}),e[4]=n,e[5]=i,e[6]=l):l=e[6];let a;return e[7]!==r.className||e[8]!==l?(a=(0,t.jsx)(Re,{type:"single",collapsible:!0,className:r.className,children:l}),e[7]=r.className,e[8]=l,e[9]=a):a=e[9],a};const jt=r=>{let e=(0,he.c)(31),{errors:s,cellId:n,className:i}=r,l=Ae(),a="This cell wasn't run because it has errors",c="destructive",o="text-error";if(s.some(gt))a="Interrupted";else if(s.some(yt))a="An internal error occurred";else if(s.some(vt))a="Ancestor prevented from running",c="default",o="text-secondary-foreground";else if(s.some(Nt))a="Ancestor stopped",c="default",o="text-secondary-foreground";else if(s.some(bt))a="SQL error";else{let x;e[0]===s?x=e[1]:(x=s.find(wt),e[0]=s,e[1]=x);let y=x;y&&"exception_type"in y&&(a=y.exception_type)}let m,p,d,f,u,j;if(e[2]!==c||e[3]!==n||e[4]!==l||e[5]!==i||e[6]!==s||e[7]!==o||e[8]!==a){let x=s.filter(kt),y=s.filter(It),w=s.filter($t),_=s.filter(_t),P=s.filter(Ft),C=s.filter(At),S=s.filter(Tt),W=s.filter(Ct),V=s.filter(St),B=s.filter(Mt),F=s.filter(zt),Q=s.filter(qt),D=s.filter(Et),M;e[15]===l?M=e[16]:(M=()=>{l.openApplication("scratchpad")},e[15]=l,e[16]=M);let xe=M,fe=()=>{let v=[];if(F.length>0||Q.length>0){let q=F.some(Lt),ge=!q&&F.some(Pt);v.push((0,t.jsxs)("div",{children:[F.map(Wt),Q.map(Vt),q&&(0,t.jsxs)($,{size:"xs",variant:"outline",className:"mt-2 font-normal",onClick:()=>Ge(l),children:[(0,t.jsx)(Xe,{className:"h-3.5 w-3.5 mr-1.5 mb-0.5"}),(0,t.jsx)("span",{children:"Open package manager"})]}),ge&&(0,t.jsxs)($,{size:"xs",variant:"outline",className:"mt-2 font-normal",onClick:()=>l.openApplication("terminal"),children:[(0,t.jsx)(re,{className:"h-3.5 w-3.5 mr-1.5"}),(0,t.jsx)("span",{children:"Open terminal"})]}),n&&(0,t.jsx)(N,{errors:[...F,...Q],cellId:n})]},"syntax-unknown"))}if(x.length>0&&v.push((0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground font-medium",children:"The setup cell cannot be run because it has references."}),(0,t.jsx)("ul",{className:"list-disc",children:x.flatMap(Bt)}),n&&(0,t.jsx)(N,{errors:x,cellId:n}),(0,t.jsxs)(I,{title:"Why can't the setup cell have references?",className:"mb-2",children:[(0,t.jsx)("p",{className:"pb-2",children:"The setup cell contains logic that must be run before any other cell runs, including top-level imports used by top-level functions. For this reason, it can't refer to other cells' variables."}),(0,t.jsx)("p",{className:"py-2",children:"Try simplifying the setup cell to only contain only necessary variables."}),(0,t.jsxs)("p",{className:"py-2",children:[(0,t.jsxs)(A,{href:"https://links.marimo.app/errors-setup",children:["Learn more at our docs"," ",(0,t.jsx)(T,{size:"0.75rem",className:"inline"})]}),"."]})]})]},"setup-refs")),y.length>0&&v.push((0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground font-medium",children:"This cell is in a cycle."}),(0,t.jsx)("ul",{className:"list-disc",children:y.flatMap(Qt)}),n&&(0,t.jsx)(N,{errors:y,cellId:n}),(0,t.jsxs)(I,{title:"What are cycles and how do I resolve them?",className:"mb-2",children:[(0,t.jsx)("p",{className:"pb-2",children:"An example of a cycle is if one cell declares a variable 'a' and reads 'b', and another cell declares 'b' and and reads 'a'. Cycles like this make it impossible for marimo to know how to run your cells, and generally suggest that your code has a bug."}),(0,t.jsx)("p",{className:"py-2",children:"Try merging these cells into a single cell to eliminate the cycle."}),(0,t.jsxs)("p",{className:"py-2",children:[(0,t.jsxs)(A,{href:"https://links.marimo.app/errors-cycles",children:["Learn more at our docs"," ",(0,t.jsx)(T,{size:"0.75rem",className:"inline"})]}),"."]})]})]},"cycle")),w.length>0){let q=w[0].name;v.push((0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground font-medium",children:"This cell redefines variables from other cells."}),w.map(Ot),n&&(0,t.jsx)(N,{errors:w,cellId:n}),(0,t.jsxs)(I,{title:"Why can't I redefine variables?",children:[(0,t.jsx)("p",{className:"pb-2",children:"marimo requires that each variable is defined in just one cell. This constraint enables reactive and reproducible execution, arbitrary cell reordering, seamless UI elements, execution as a script, and more."}),(0,t.jsxs)("p",{className:"py-2",children:["Try merging this cell with the mentioned cells or wrapping it in a function. Alternatively, prefix variables with an underscore (e.g., ",(0,t.jsxs)(te,{className:"inline",children:["_",q]}),"). to make them private to this cell."]}),(0,t.jsxs)("p",{className:"py-2",children:[(0,t.jsxs)(A,{href:"https://links.marimo.app/errors-multiple-definitions",children:["Learn more at our docs"," ",(0,t.jsx)(T,{size:"0.75rem",className:"inline"})]}),"."]})]}),(0,t.jsx)(I,{title:"Need a scratchpad?",children:(0,t.jsxs)("div",{className:"flex flex-row gap-2 items-center",children:[(0,t.jsxs)($,{size:"xs",variant:"link",className:"my-2 font-normal mx-0 px-0",onClick:xe,children:[(0,t.jsx)(Ie,{className:"h-3"}),(0,t.jsx)("span",{children:"Try the scratchpad"})]}),(0,t.jsx)("span",{children:"to experiment without restrictions on variable names."})]})})]},"multiple-defs"))}return _.length>0&&v.push((0,t.jsxs)("div",{children:[_.map(Ht),n&&(0,t.jsx)(N,{errors:_,cellId:n}),(0,t.jsxs)(I,{title:"Why can't I use `import *`?",children:[(0,t.jsx)("p",{className:"pb-2",children:"Star imports are incompatible with marimo's git-friendly file format and reproducible reactive execution."}),(0,t.jsx)("p",{className:"py-2",children:"marimo's Python file format stores code in functions, so notebooks can be imported as regular Python modules without executing all their code. But Python disallows `import *` everywhere except at the top-level of a module."}),(0,t.jsx)("p",{className:"py-2",children:"Star imports would also silently add names to globals, which would be incompatible with reactive execution."}),(0,t.jsxs)("p",{className:"py-2",children:[(0,t.jsxs)(A,{href:"https://links.marimo.app/errors-import-star",children:["Learn more at our docs"," ",(0,t.jsx)(T,{size:"0.75rem",className:"inline"})]}),"."]})]})]},"import-star")),P.length>0&&v.push((0,t.jsxs)("div",{children:[P.map(Rt),n&&(0,t.jsx)(N,{errors:P,cellId:n})]},"interruption")),C.length>0&&v.push((0,t.jsxs)("ul",{children:[C.map(Ut),C.some(Jt)&&(0,t.jsx)(I,{children:"Fix the error in the mentioned cells, or handle the exceptions with try/except blocks."}),n&&(0,t.jsx)(N,{errors:C,cellId:n})]},"exception")),S.length>0&&v.push((0,t.jsxs)("ul",{children:[S.map(Yt),n&&(0,t.jsx)(N,{errors:S,cellId:n}),(0,t.jsx)(I,{children:S.some(Gt)?"Ensure that the referenced cells define the required variables, or turn off strict execution.":"Something is wrong with your declarations. Fix any discrepancies, or turn off strict execution."})]},"strict-exception")),W.length>0&&v.push((0,t.jsxs)("div",{children:[W.map(Kt),n&&(0,t.jsx)(N,{errors:W,cellId:n})]},"internal")),V.length>0&&v.push((0,t.jsxs)("div",{children:[V.map(Xt),n&&(0,t.jsx)(N,{errors:V,cellId:n})]},"ancestor-prevented")),B.length>0&&v.push((0,t.jsxs)("div",{children:[B.map(Zt),n&&(0,t.jsx)(N,{errors:B,cellId:n})]},"ancestor-stopped")),D.length>0&&v.push((0,t.jsxs)("div",{children:[D.map(er),n&&(0,t.jsx)(N,{errors:D,cellId:n,className:"mt-2.5"})]},"sql-errors")),v},O=`font-code font-medium tracking-wide ${o}`,z;e[17]!==O||e[18]!==a?(z=(0,t.jsx)(Je,{className:O,children:a}),e[17]=O,e[18]=a,e[19]=z):z=e[19];let je=z;m=Ye,f=c,e[20]===i?u=e[21]:(u=X("border-none font-code text-sm text-[0.84375rem] px-0 text-muted-foreground normal [&:has(svg)]:pl-0 space-y-4",i),e[20]=i,e[21]=u),j=je,p="flex flex-col gap-8",d=fe(),e[2]=c,e[3]=n,e[4]=l,e[5]=i,e[6]=s,e[7]=o,e[8]=a,e[9]=m,e[10]=p,e[11]=d,e[12]=f,e[13]=u,e[14]=j}else m=e[9],p=e[10],d=e[11],f=e[12],u=e[13],j=e[14];let h;e[22]!==p||e[23]!==d?(h=(0,t.jsx)("div",{children:(0,t.jsx)("div",{className:p,children:d})}),e[22]=p,e[23]=d,e[24]=h):h=e[24];let g;return e[25]!==m||e[26]!==f||e[27]!==u||e[28]!==j||e[29]!==h?(g=(0,t.jsxs)(m,{variant:f,className:u,children:[j,h]}),e[25]=m,e[26]=f,e[27]=u,e[28]=j,e[29]=h,e[30]=g):g=e[30],g};function gt(r){return r.type==="interruption"}function yt(r){return r.type==="internal"}function vt(r){return r.type==="ancestor-prevented"}function Nt(r){return r.type==="ancestor-stopped"}function bt(r){return r.type==="sql-error"}function wt(r){return r.type==="exception"}function kt(r){return r.type==="setup-refs"}function It(r){return r.type==="cycle"}function $t(r){return r.type==="multiple-defs"}function _t(r){return r.type==="import-star"}function Ft(r){return r.type==="interruption"}function At(r){return r.type==="exception"}function Tt(r){return r.type==="strict-exception"}function Ct(r){return r.type==="internal"}function St(r){return r.type==="ancestor-prevented"}function Mt(r){return r.type==="ancestor-stopped"}function zt(r){return r.type==="syntax"}function qt(r){return r.type==="unknown"}function Et(r){return r.type==="sql-error"}function Lt(r){return r.msg.includes("!pip")}function Pt(r){return r.msg.includes("use os.subprocess")}function Wt(r,e){return(0,t.jsx)("pre",{children:k(r.msg,`syntax-${e}`)},`syntax-${e}`)}function Vt(r,e){return(0,t.jsx)("pre",{children:k(r.msg,`unknown-${e}`)},`unknown-${e}`)}function Bt(r,e){return r.edges_with_vars.map((s,n)=>(0,t.jsxs)("li",{className:"my-0.5 ml-8 text-muted-foreground/40",children:[(0,t.jsx)(b,{cellId:s[0]}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[": "," ",s[1].length===1?s[1][0]:s[1].join(", ")]})]},`setup-refs-${e}-${n}`))}function Qt(r,e){return r.edges_with_vars.map((s,n)=>(0,t.jsxs)("li",{className:"my-0.5 ml-8 text-muted-foreground/40",children:[(0,t.jsx)(b,{cellId:s[0]}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[" -> ",s[1].length===1?s[1][0]:s[1].join(", ")," -> "]}),(0,t.jsx)(b,{cellId:s[2]})]},`cycle-${e}-${n}`))}function Dt(r,e){return(0,t.jsx)("li",{className:"my-0.5 ml-8 text-muted-foreground/40",children:(0,t.jsx)(b,{cellId:r})},`cell-${e}`)}function Ot(r,e){return(0,t.jsxs)(L.Fragment,{children:[(0,t.jsx)("p",{className:"text-muted-foreground mt-2",children:`'${r.name}' was also defined by:`}),(0,t.jsx)("ul",{className:"list-disc",children:r.cells.map(Dt)})]},`multiple-defs-${e}`)}function Ht(r,e){return(0,t.jsx)("p",{className:"text-muted-foreground",children:r.msg},`import-star-${e}`)}function Rt(r,e){return(0,t.jsx)("p",{children:"This cell was interrupted and needs to be re-run."},`interruption-${e}`)}function Ut(r,e){return r.exception_type==="NameError"&&r.msg.startsWith("name 'mo'")?(0,t.jsx)("li",{className:"my-2",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:"name 'mo' is not defined."}),(0,t.jsxs)("p",{className:"text-muted-foreground mt-2",children:["The marimo module (imported as"," ",(0,t.jsx)(te,{className:"inline",children:"mo"}),") is required for Markdown, SQL, and UI elements."]})]})},`exception-${e}`):r.exception_type==="NameError"&&r.msg.startsWith("name '_")?(0,t.jsx)("li",{className:"my-2",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:r.msg}),(0,t.jsxs)("p",{className:"text-muted-foreground mt-2",children:["Variables prefixed with an underscore are local to a cell"," ","(",(0,t.jsxs)(A,{href:"https://links.marimo.app/local-variables",children:["docs"," ",(0,t.jsx)(T,{size:"0.75rem",className:"inline"})]}),")."]}),(0,t.jsx)("div",{className:"text-muted-foreground mt-2",children:"See the console area for a traceback."})]})},`exception-${e}`):(0,t.jsx)("li",{className:"my-2",children:r.raising_cell==null?(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:k(r.msg,`exception-${e}`)}),(0,t.jsx)("div",{className:"text-muted-foreground mt-2",children:"See the console area for a traceback."})]}):(0,t.jsxs)("div",{children:[k(r.msg,`exception-${e}`),(0,t.jsx)(b,{cellId:r.raising_cell})]})},`exception-${e}`)}function Jt(r){return r.raising_cell!=null}function Yt(r,e){return(0,t.jsx)("li",{className:"my-2",children:r.blamed_cell==null?(0,t.jsx)("p",{children:r.msg}):(0,t.jsxs)("div",{children:[r.msg,(0,t.jsx)(b,{cellId:r.blamed_cell})]})},`strict-exception-${e}`)}function Gt(r){return r.blamed_cell!=null}function Kt(r,e){return(0,t.jsx)("p",{children:r.msg},`internal-${e}`)}function Xt(r,e){return(0,t.jsxs)("div",{children:[r.msg,r.blamed_cell==null?(0,t.jsxs)("span",{children:["(",(0,t.jsx)(b,{cellId:r.raising_cell}),")"]}):(0,t.jsxs)("span",{children:["(",(0,t.jsx)(b,{cellId:r.raising_cell}),"\xA0blames\xA0",(0,t.jsx)(b,{cellId:r.blamed_cell}),")"]})]},`ancestor-prevented-${e}`)}function Zt(r,e){return(0,t.jsxs)("div",{children:[r.msg,(0,t.jsx)(b,{cellId:r.raising_cell})]},`ancestor-stopped-${e}`)}function er(r,e){return(0,t.jsx)("div",{className:"space-y-2 mt-2",children:(0,t.jsx)("p",{className:"text-muted-foreground whitespace-pre-wrap",children:r.msg})},`sql-error-${e}`)}export{re as a,oe as i,ft as n,me as r,jt as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./worker-CUL1lW-N.js";var t=e(((e,t)=>{t.exports={}}));export default t();
@@ -1 +0,0 @@
1
- import{t as e}from"./save-worker-DtF6B3PS.js";var t=e(((e,t)=>{t.exports={}}));export default t();
@@ -1 +0,0 @@
1
- function u(r){return new Promise((a,i)=>{let t=new FileReader;t.onload=e=>{var n;a((n=e.target)==null?void 0:n.result)},t.onerror=e=>{i(Error(`Failed to read blob: ${e.type}`))},t.readAsDataURL(r)})}function b(r){return new Promise((a,i)=>{var t;try{let[e,n]=r.split(",",2),d=(t=/^data:(.+);base64$/.exec(e))==null?void 0:t[1],l=atob(n),s=l.length,c=new Uint8Array(s);for(let o=0;o<s;o++)c[o]=l.charCodeAt(o);a(new Blob([c],{type:d}))}catch(e){i(f(e))}})}function f(r){return r instanceof Error?r:Error(`${r}`)}export{u as n,b as t};
@@ -1 +0,0 @@
1
- import{et as r,tt as e}from"./chunk-ABZYJK2D-Coo5qi7b.js";var o=(t,a)=>e.lang.round(r.parse(t)[a]);export{o as t};