@marimo-team/frontend 0.21.2-dev5 → 0.21.2-dev53
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.
- package/dist/assets/{CellStatus-CDSBsjjF.js → CellStatus-DX8MnBMk.js} +1 -1
- package/dist/assets/{ConnectedDataExplorerComponent-Buaffg3u.js → ConnectedDataExplorerComponent-7yXYooWG.js} +1 -1
- package/dist/assets/{DeferredRequestRegistry-O6RDJKs0.js → DeferredRequestRegistry-B8jPCuU1.js} +1 -1
- package/dist/assets/{ImperativeModal-qEtcJ95s.js → ImperativeModal-C3CD5-Aq.js} +1 -1
- package/dist/assets/JsonOutput-DqjAyzM8.js +46 -0
- package/dist/assets/{LazyAnyLanguageCodeMirror-m8w66E4s.js → LazyAnyLanguageCodeMirror-CcCHIX38.js} +2 -2
- package/dist/assets/{MarimoErrorOutput-az74f3Mp.js → MarimoErrorOutput-Dat_S09q.js} +5 -5
- package/dist/assets/RenderHTML-C7XM39M2.js +1 -0
- package/dist/assets/{add-cell-with-ai-DUn4LN4W.js → add-cell-with-ai-y2xroEGf.js} +9 -9
- package/dist/assets/{add-connection-dialog-CBz0AUVX.js → add-connection-dialog-QDBOmil3.js} +23 -23
- package/dist/assets/{agent-panel-u83dsDsM.js → agent-panel-DziFrEjJ.js} +6 -6
- package/dist/assets/ai-model-dropdown-CiJpv5wN.js +5 -0
- package/dist/assets/{alert-dialog-9WfvUF7e.js → alert-dialog-ebk_-wsU.js} +1 -1
- package/dist/assets/{any-language-editor-DwQMnAM3.js → any-language-editor-DZYnKlJB.js} +1 -1
- package/dist/assets/{app-config-button-rDu-lCIB.js → app-config-button-CpAv9Tiu.js} +1 -1
- package/dist/assets/{architectureDiagram-VXUJARFQ-DfMHHFZ3.js → architectureDiagram-VXUJARFQ-DKmk99ac.js} +1 -1
- package/dist/assets/{azure-BTXHztTw.js → azure-Dw5gKmUz.js} +1 -1
- package/dist/assets/{blockDiagram-VD42YOAC-CuEDwbg7.js → blockDiagram-VD42YOAC-TpAhP5OQ.js} +1 -1
- package/dist/assets/{c4Diagram-YG6GDRKO-CD9uz7WG.js → c4Diagram-YG6GDRKO-Dg8hCyKf.js} +1 -1
- package/dist/assets/{cache-panel-qIxnndwr.js → cache-panel-D0OsHk_D.js} +1 -1
- package/dist/assets/cell-editor-RbAVpSFb.js +22 -0
- package/dist/assets/{cell-link-Q_UEP94Z.js → cell-link-CNgO3c-T.js} +1 -1
- package/dist/assets/{cells-fq1RMGX_.js → cells-39RE4UzS.js} +77 -76
- package/dist/assets/channel-D1wPYhc9.js +1 -0
- package/dist/assets/{chat-display-D_Fuuy6r.js → chat-display-BPUVrlA6.js} +1 -1
- package/dist/assets/{chat-panel-BO-JoQSp.js → chat-panel-esz5TfF-.js} +2 -2
- package/dist/assets/{chunk-5FQGJX7Z-CM1a_K7I.js → chunk-5FQGJX7Z-sGWxL7Ey.js} +3 -3
- package/dist/assets/{chunk-ABZYJK2D-D_Wumzom.js → chunk-ABZYJK2D-DXJ7hnjx.js} +1 -1
- package/dist/assets/{chunk-ATLVNIR6-BZ0lTgIn.js → chunk-ATLVNIR6-CTEqcLEc.js} +1 -1
- package/dist/assets/{chunk-B4BG7PRW-Dw1S6osV.js → chunk-B4BG7PRW-CkAIqtPf.js} +1 -1
- package/dist/assets/{chunk-DI55MBZ5-Q63FTCPP.js → chunk-DI55MBZ5-C4F9vu8o.js} +1 -1
- package/dist/assets/{chunk-EXTU4WIE-CfkJ_R7W.js → chunk-EXTU4WIE-BT0Py-4P.js} +1 -1
- package/dist/assets/{chunk-JA3XYJ7Z-B41fGeoj.js → chunk-JA3XYJ7Z-CGd7jja_.js} +1 -1
- package/dist/assets/{chunk-JZLCHNYA-D43EJxQw.js → chunk-JZLCHNYA-CqY-RYTj.js} +1 -1
- package/dist/assets/{chunk-N4CR4FBY-DCtw0-ni.js → chunk-N4CR4FBY-aUDjVzN7.js} +2 -2
- package/dist/assets/{chunk-QN33PNHL-CLA2rsaS.js → chunk-QN33PNHL-DHnCb5-U.js} +1 -1
- package/dist/assets/{chunk-QXUST7PY-De1DpbnL.js → chunk-QXUST7PY-CRO5kYCE.js} +1 -1
- package/dist/assets/{chunk-S3R3BYOJ-qrwvlUdq.js → chunk-S3R3BYOJ-CSHQgcuP.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-C4KcThb0.js → chunk-TZMSLE5B-CE7o9asH.js} +1 -1
- package/dist/assets/classDiagram-2ON5EDUG-BDIQSKYv.js +1 -0
- package/dist/assets/classDiagram-v2-WZHVMYZB-Cdh4cVOB.js +1 -0
- package/dist/assets/{code-block-37QAKDTI-D4FF4cnN.js → code-block-37QAKDTI-DMpe1jNG.js} +1 -1
- package/dist/assets/{column-preview-WsubyItX.js → column-preview-BUKHsglA.js} +1 -1
- package/dist/assets/{command-rfxSsiHU.js → command-DmzEbs6L.js} +1 -1
- package/dist/assets/{command-palette-Bez4BqJF.js → command-palette-BX5gNpUr.js} +1 -1
- package/dist/assets/{common-BYwO983A.js → common-B4yshY-H.js} +1 -1
- package/dist/assets/{components-Ozq0825a.js → components-DCqJqyys.js} +1 -1
- package/dist/assets/{components-Bpgzv_5_.js → components-oKCjx6cN.js} +1 -1
- package/dist/assets/{config-3Aq84phF.js → config-DqxNMQDN.js} +1 -1
- package/dist/assets/{context-CIAP2NOh.js → context-CRmPPhx9.js} +1 -1
- package/dist/assets/{context-aware-panel-CfsfBlhO.js → context-aware-panel-DC0Te9Hj.js} +2 -2
- package/dist/assets/copy-KjcPgPw9.js +1 -0
- package/dist/assets/{copy-icon-BgmMM9Zg.js → copy-icon-P0kzz1Pr.js} +1 -1
- package/dist/assets/{dagre-6UL2VRFP-BhMnPhuU.js → dagre-6UL2VRFP-XqoNLMQ3.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-kbv73SQ7.js → data-grid-overlay-editor-Cus1-BFN.js} +1 -1
- package/dist/assets/{datasource-F9sJtuof.js → datasource-DKHG39NV.js} +2 -2
- package/dist/assets/{dates-CHaNfieI.js → dates-CTqMeMGY.js} +1 -1
- package/dist/assets/{dependency-graph-panel-AOBcX2tP.js → dependency-graph-panel-7GKT3dyD.js} +4 -4
- package/dist/assets/{diagram-PSM6KHXK-Cr2t4zul.js → diagram-PSM6KHXK-BuzKNNcN.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-DLU_hSO4.js → diagram-QEK2KX5R-A5LBQS11.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-C7EkNAO3.js → diagram-S2PKOQOG-dkJE8SA0.js} +1 -1
- package/dist/assets/{dialog-CVN1lcMF.js → dialog-1_jIyAb_.js} +1 -1
- package/dist/assets/{dist-DJBpXGro.js → dist-6P6vjf93.js} +1 -1
- package/dist/assets/dist-BWGxTsTP.js +1 -0
- package/dist/assets/{dist-CblX3KGI.js → dist-B_buFm3B.js} +1 -1
- package/dist/assets/{dist-CXLJUPFl.js → dist-BatEf-0f.js} +1 -1
- package/dist/assets/dist-C3AnARPE.js +1 -0
- package/dist/assets/{dist-BNC_tnlW.js → dist-C6ohaMKU.js} +1 -1
- package/dist/assets/{dist-BoDHthoc.js → dist-CO9Pg2Rc.js} +1 -1
- package/dist/assets/{dist-By6zhkxZ.js → dist-CSV6H5w_.js} +1 -1
- package/dist/assets/{dist-6FIAeDIu.js → dist-CYs1oP7g.js} +1 -1
- package/dist/assets/{dist-DbK_4_qo.js → dist-DD9ZJMK5.js} +1 -1
- package/dist/assets/{dist-DlTbNRBn.js → dist-DReDpc2z.js} +1 -1
- package/dist/assets/dist-DSlq5ZeQ.js +1 -0
- package/dist/assets/{dist-DrceDAhM.js → dist-DXyIIB32.js} +1 -1
- package/dist/assets/{dist-CcGcwrUD.js → dist-DkaderFA.js} +1 -1
- package/dist/assets/{dist-BiZQlfhr.js → dist-Dq3BlK4R.js} +1 -1
- package/dist/assets/{dist-ClzRAVN-.js → dist-Dxov2ltb.js} +1 -1
- package/dist/assets/{dist-BXXPfIam.js → dist-EtGG9C1A.js} +1 -1
- package/dist/assets/{dist-C3MmXcLA.js → dist-NjId5Gdz.js} +1 -1
- package/dist/assets/dist-ZM59OWYL.js +1 -0
- package/dist/assets/dist-_TwZ4tIe.js +1 -0
- package/dist/assets/dist-f9b2H4q_.js +1 -0
- package/dist/assets/{dist-mxGLXOFm.js → dist-feWVQ4dq.js} +1 -1
- package/dist/assets/{documentation-panel-D28MpqbI.js → documentation-panel-D5d_BbHV.js} +1 -1
- package/dist/assets/{download-B9_ToVd4.js → download-B1vXaivj.js} +4 -4
- package/dist/assets/{dropdown-menu-DdPu5Kfu.js → dropdown-menu-BehqiLFL.js} +1 -1
- package/dist/assets/{edit-page-otS-QvnC.js → edit-page-B5cAZdO7.js} +7 -7
- package/dist/assets/{en-US-BO8E69bZ.js → en-US-f8tajDx1.js} +1 -1
- package/dist/assets/{erDiagram-Q2GNP2WA-DqlEo_Us.js → erDiagram-Q2GNP2WA-CgH6udOW.js} +1 -1
- package/dist/assets/{error-banner-BRG6IPhC.js → error-banner-J5F3weEj.js} +1 -1
- package/dist/assets/{error-panel-RRoj_iOR.js → error-panel-DnhKJ5Ou.js} +1 -1
- package/dist/assets/{es-CzkousWe.js → es-DYI7U61K.js} +1 -1
- package/dist/assets/{esm-CBkHtTOV.js → esm-BC1J92im.js} +1 -1
- package/dist/assets/{esm-DhTsVMLM.js → esm-DKLLCu3N.js} +1 -1
- package/dist/assets/{field-B1jGbQlH.js → field-B08lvxnl.js} +1 -1
- package/dist/assets/file-explorer-panel-BUk69TND.js +26 -0
- package/dist/assets/{file-icons-CWLHDa1J.js → file-icons-3DTS8ZM7.js} +1 -1
- package/dist/assets/{floating-outline-BvQKiC0F.js → floating-outline-DmugATcB.js} +1 -1
- package/dist/assets/{flowDiagram-NV44I4VS-CQlIJ12H.js → flowDiagram-NV44I4VS-D85BL4rA.js} +1 -1
- package/dist/assets/{focus-DYwTiH9-.js → focus-DlJH7sfh.js} +1 -1
- package/dist/assets/{form-CrQYrsUC.js → form-760_EqmF.js} +2 -2
- package/dist/assets/{formats-rhOJovGE.js → formats-wYuh1bqp.js} +1 -1
- package/dist/assets/{formatting-B4ZCH3ol.js → formatting-CraOPe94.js} +1 -1
- package/dist/assets/{gallery-page-eRea0yic.js → gallery-page--paiPvYX.js} +1 -1
- package/dist/assets/{ganttDiagram-JELNMOA3-B3EGIuZL.js → ganttDiagram-JELNMOA3-DzCOXWlF.js} +1 -1
- package/dist/assets/{gitGraphDiagram-V2S2FVAM-h5SlguJK.js → gitGraphDiagram-V2S2FVAM-BUHURX6t.js} +1 -1
- package/dist/assets/{glide-data-editor-xt5xNZeV.js → glide-data-editor-DYdoQTO5.js} +4 -4
- package/dist/assets/{globals-BsV5fVR-.js → globals-7M5DRsIb.js} +1 -1
- package/dist/assets/home-page-CxQ1e98h.js +4 -0
- package/dist/assets/{hooks-CHx5dUUq.js → hooks-C3jEff2O.js} +1 -1
- package/dist/assets/html-to-image-DTFXm6_Z.js +2 -0
- package/dist/assets/{index-GjXovVsl.css → index-BmoocKR0.css} +1 -1
- package/dist/assets/index-DNchElHl.js +38 -0
- package/dist/assets/{infoDiagram-HS3SLOUP-pzpClObZ.js → infoDiagram-HS3SLOUP-GG5r0Y5G.js} +1 -1
- package/dist/assets/{input-CUwqpKjd.js → input-CN1ZeRYm.js} +1 -1
- package/dist/assets/{isValid-BGe7pJXT.js → isValid-DY4Mgbr7.js} +1 -1
- package/dist/assets/{journeyDiagram-XKPGCS4Q-BrdRi92v.js → journeyDiagram-XKPGCS4Q-B1dvnV4D.js} +1 -1
- package/dist/assets/{kanban-definition-3W4ZIXB7-B6WqgFqh.js → kanban-definition-3W4ZIXB7-CefbrXQv.js} +1 -1
- package/dist/assets/{kiosk-mode-DNjEnIWb.js → kiosk-mode-CyTnrzwK.js} +1 -1
- package/dist/assets/{layout-CwFtCyW8.js → layout-3b3tzmbb.js} +3 -3
- package/dist/assets/{linear-BP9rwmWK.js → linear-BDnrHGYO.js} +1 -1
- package/dist/assets/{links-CIQwYQ48.js → links-CptYD1FP.js} +1 -1
- package/dist/assets/{logs-panel-BU1tNEVc.js → logs-panel-C4k_2IHW.js} +1 -1
- package/dist/assets/{markdown-renderer-MR9df58W.js → markdown-renderer-DSy5IuAx.js} +1 -1
- package/dist/assets/{menu-items-UxKrm8hS.js → menu-items-BpHXKv51.js} +1 -1
- package/dist/assets/mermaid-4DMBBIKO-g7AL4SLJ.js +1 -0
- package/dist/assets/{mermaid-Djr3jUAB.js → mermaid-C43VbdrM.js} +3 -3
- package/dist/assets/{mermaid-parser.core-DR82IMb2.js → mermaid-parser.core-CdM8D_p_.js} +1 -1
- package/dist/assets/{mindmap-definition-VGOIOE7T-DAmJpbPM.js → mindmap-definition-VGOIOE7T-CcV7D-wF.js} +1 -1
- package/dist/assets/{mode-AcL8c6qH.js → mode-D-iRbN9x.js} +1 -1
- package/dist/assets/{multi-map-Pp1P2DOX.js → multi-map-C8RbwBrw.js} +1 -1
- package/dist/assets/{name-cell-input-DVFEv_aO.js → name-cell-input-Dyb0ZO4X.js} +1 -1
- package/dist/assets/{number-overlay-editor-D__AflXQ.js → number-overlay-editor-BBJO1mf8.js} +1 -1
- package/dist/assets/{outline-panel-CP0oIuiU.js → outline-panel-D7CJwO8u.js} +1 -1
- package/dist/assets/{packages-panel-CzRELimG.js → packages-panel-Bp1SYjgc.js} +1 -1
- package/dist/assets/{panels-wTweRyIv.js → panels-D0aw6jdc.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-DbGIFRoq.js → pieDiagram-ADFJNKIX-C1fBf15W.js} +1 -1
- package/dist/assets/{popover-BPGG2gPG.js → popover-Bvoif-Mg.js} +1 -1
- package/dist/assets/{precisionRound-BOmLQIKI.js → precisionRound-CCOoIlcP.js} +1 -1
- package/dist/assets/{process-output-CTVsT--B.js → process-output-BxPWHcIi.js} +1 -1
- package/dist/assets/{quadrantDiagram-AYHSOK5B-CLAtyple.js → quadrantDiagram-AYHSOK5B-RVooN-fX.js} +1 -1
- package/dist/assets/{react-vega-BZav_-2n.js → react-vega-BKRQSy0g.js} +1 -1
- package/dist/assets/react-vega-DXESF7qN.js +1 -0
- package/dist/assets/{readonly-python-code-DH-1xZGq.js → readonly-python-code-D95oshJa.js} +1 -1
- package/dist/assets/{renderShortcut-CnD1Dah5.js → renderShortcut-BYvKm38e.js} +1 -1
- package/dist/assets/{request-registry-B-7cIM_I.js → request-registry-XB2EzJHm.js} +1 -1
- package/dist/assets/{requirementDiagram-UZGBJVZJ-DDDTB1LD.js → requirementDiagram-UZGBJVZJ-DtqOYJpH.js} +1 -1
- package/dist/assets/{run-page-FCvGnICa.js → run-page-B7CASued.js} +1 -1
- package/dist/assets/{sankeyDiagram-TZEHDZUN-DAWPOfBw.js → sankeyDiagram-TZEHDZUN-DmcooLA8.js} +1 -1
- package/dist/assets/{scratchpad-panel-k9lrm-rC.js → scratchpad-panel-BIVRgYOU.js} +1 -1
- package/dist/assets/{secrets-panel-B1Z-6dmz.js → secrets-panel-C24hZEiO.js} +1 -1
- package/dist/assets/{select-CxT2Geqr.js → select-Cnd3vm9n.js} +1 -1
- package/dist/assets/{sequenceDiagram-WL72ISMW-D_qAidD2.js → sequenceDiagram-WL72ISMW-S2qeLb7J.js} +1 -1
- package/dist/assets/{session-panel-WhN0qilM.js → session-panel-CNabBHQm.js} +1 -1
- package/dist/assets/{share-BdH_5I58.js → share-NjpZ54PJ.js} +1 -1
- package/dist/assets/{snippets-panel-BCDHUuku.js → snippets-panel-D1JAeJj1.js} +1 -1
- package/dist/assets/{spec-DbmSqx09.js → spec-DnVBmJUh.js} +1 -1
- package/dist/assets/{state-Ce7CVShi.js → state-BagvlaEz.js} +1 -1
- package/dist/assets/{state-3V5UxC3B.js → state-Cz_wrzCz.js} +1 -1
- package/dist/assets/{state-CBmCYWFH.js → state-DMQXxemS.js} +1 -1
- package/dist/assets/{stateDiagram-FKZM4ZOC-C7qgDrGA.js → stateDiagram-FKZM4ZOC-uuQ60pIl.js} +1 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-D-GWhQTG.js +1 -0
- package/dist/assets/stex-CruVQx-P.js +1 -0
- package/dist/assets/{switch-CVKxYu_0.js → switch-Bwpd2AFq.js} +1 -1
- package/dist/assets/{terminal-Cr7wbEjz.js → terminal-Gl8Fi44y.js} +1 -1
- package/dist/assets/{time-D2GKc0U6.js → time-Bw8f15NM.js} +1 -1
- package/dist/assets/{timeline-definition-IT6M3QCI-hd6uJKGs.js → timeline-definition-IT6M3QCI-TKWeDnSQ.js} +1 -1
- package/dist/assets/{toggle-RCwU-rnE.js → toggle-C_gNjXg8.js} +1 -1
- package/dist/assets/{tooltip-D9723Brr.js → tooltip-CR_izE8Q.js} +1 -1
- package/dist/assets/tracing-DwAC7DWN.js +1 -0
- package/dist/assets/tracing-panel-D1iNgclL.js +2 -0
- package/dist/assets/{tree-Ch2-GuhG.js → tree-WVrWjdwv.js} +3 -3
- package/dist/assets/{useAddCell-YC7rpcmD.js → useAddCell-D6Q7JziZ.js} +1 -1
- package/dist/assets/{useBoolean-m1e6E3Ao.js → useBoolean-CrltYVhE.js} +1 -1
- package/dist/assets/{useCellActionButton-GUb2fXU8.js → useCellActionButton-B2G9OaX9.js} +1 -1
- package/dist/assets/{useDateFormatter-CpE7XQLs.js → useDateFormatter-DOoVZUts.js} +1 -1
- package/dist/assets/{useDeleteCell-DRUDRiy0.js → useDeleteCell-d8veThW7.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-nFVMlEx0.js → useDependencyPanelTab-B3iIj3MO.js} +1 -1
- package/dist/assets/{useInstallPackage-C9V-on2J.js → useInstallPackage-CQEr5429.js} +1 -1
- package/dist/assets/{useNotebookActions-ChLHy-0O.js → useNotebookActions-SAEOWcBo.js} +1 -1
- package/dist/assets/{useNumberFormatter-DbDKSvEd.js → useNumberFormatter-BXZcbTzH.js} +1 -1
- package/dist/assets/{usePress-BHGkpw8X.js → usePress-alQ5Crny.js} +1 -1
- package/dist/assets/{useRunCells-5m6jCnyo.js → useRunCells-Dhl8ZTGh.js} +1 -1
- package/dist/assets/{useSplitCell-DGD9smMq.js → useSplitCell-BSnFazbH.js} +1 -1
- package/dist/assets/{utils-CdjCA1J8.js → utils-C24l2A1T.js} +1 -1
- package/dist/assets/{vega-component-CRbeDmeM.js → vega-component-9Pf4pVZL.js} +1 -1
- package/dist/assets/{vega-loader.browser-CZV6_g2i.js → vega-loader.browser-BJ9oKrvH.js} +1 -1
- package/dist/assets/{write-secret-modal-BCvuRAFb.js → write-secret-modal-BFCsWMoW.js} +1 -1
- package/dist/assets/{xychartDiagram-PRI3JC2R-CXlUBSbQ.js → xychartDiagram-PRI3JC2R-CIp-yeSa.js} +1 -1
- package/dist/index.html +125 -125
- package/package.json +1 -1
- package/src/__mocks__/notebook.ts +9 -9
- package/src/__tests__/branded.ts +20 -0
- package/src/components/app-config/user-config-form.tsx +5 -4
- package/src/components/data-table/__tests__/utils.test.ts +138 -1
- package/src/components/data-table/charts/__tests__/storage.test.ts +7 -7
- package/src/components/data-table/context-menu.tsx +9 -5
- package/src/components/data-table/data-table.tsx +3 -0
- package/src/components/data-table/range-focus/__tests__/atoms.test.ts +8 -2
- package/src/components/data-table/range-focus/__tests__/test-utils.ts +2 -0
- package/src/components/data-table/range-focus/__tests__/utils.test.ts +82 -8
- package/src/components/data-table/range-focus/atoms.ts +2 -2
- package/src/components/data-table/range-focus/utils.ts +50 -12
- package/src/components/data-table/types.ts +7 -0
- package/src/components/data-table/utils.ts +87 -0
- package/src/components/editor/__tests__/data-attributes.test.tsx +8 -8
- package/src/components/editor/ai/__tests__/completion-utils.test.ts +15 -15
- package/src/components/editor/navigation/__tests__/clipboard.test.ts +2 -2
- package/src/components/editor/navigation/__tests__/selection.test.ts +7 -6
- package/src/components/editor/navigation/__tests__/state.test.ts +8 -7
- package/src/components/editor/output/MarimoErrorOutput.tsx +7 -7
- package/src/components/editor/output/__tests__/traceback.test.tsx +4 -4
- package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +4 -4
- package/src/components/editor/renderers/vertical-layout/useFocusFirstEditor.ts +8 -1
- package/src/components/storage/storage-file-viewer.tsx +35 -1
- package/src/components/storage/storage-inspector.tsx +9 -4
- package/src/components/storage/storage-snippets.ts +3 -3
- package/src/components/tracing/tracing.tsx +3 -1
- package/src/components/ui/range-slider.tsx +108 -1
- package/src/core/ai/__tests__/staged-cells.test.ts +9 -8
- package/src/core/ai/context/providers/__tests__/cell-output.test.ts +31 -31
- package/src/core/ai/context/providers/__tests__/datasource.test.ts +3 -3
- package/src/core/ai/context/providers/__tests__/tables.test.ts +3 -2
- package/src/core/ai/context/providers/__tests__/variable.test.ts +84 -63
- package/src/core/ai/tools/__tests__/edit-notebook-tool.test.ts +10 -9
- package/src/core/ai/tools/__tests__/run-cells-tool.test.ts +6 -6
- package/src/core/ai/tools/edit-notebook-tool.ts +3 -3
- package/src/core/cells/__tests__/add-missing-import.test.ts +3 -3
- package/src/core/cells/__tests__/cells.test.ts +192 -135
- package/src/core/cells/__tests__/focus.test.ts +5 -4
- package/src/core/cells/__tests__/logs.test.ts +13 -12
- package/src/core/cells/__tests__/pending-delete-service.test.tsx +3 -3
- package/src/core/cells/__tests__/runs.test.ts +22 -21
- package/src/core/cells/__tests__/scrollCellIntoView.test.ts +8 -7
- package/src/core/cells/__tests__/session.test.ts +23 -22
- package/src/core/cells/cells.ts +1 -1
- package/src/core/cells/ids.ts +5 -5
- package/src/core/cells/logs.ts +2 -2
- package/src/core/cells/runs.ts +6 -8
- package/src/core/codemirror/__tests__/format.test.ts +34 -36
- package/src/core/codemirror/__tests__/setup.test.ts +2 -2
- package/src/core/codemirror/cells/__tests__/extensions.test.ts +114 -0
- package/src/core/codemirror/cells/__tests__/traceback-decorations.test.ts +33 -32
- package/src/core/codemirror/cells/extensions.ts +66 -23
- package/src/core/codemirror/completion/__tests__/keymap.test.ts +15 -35
- package/src/core/codemirror/completion/keymap.ts +14 -4
- package/src/core/codemirror/copilot/__tests__/getCodes.test.ts +12 -13
- package/src/core/codemirror/language/__tests__/utils.test.ts +3 -3
- package/src/core/codemirror/language/embedded/__tests__/embedded-python.test.ts +7 -8
- package/src/core/codemirror/language/languages/python.ts +4 -0
- package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +4 -3
- package/src/core/codemirror/lsp/notebook-lsp.ts +28 -2
- package/src/core/codemirror/reactive-references/__tests__/analyzer.test.ts +7 -6
- package/src/core/codemirror/reactive-references/analyzer.ts +2 -2
- package/src/core/codemirror/rtc/loro/__tests__/sync.test.ts +52 -0
- package/src/core/codemirror/rtc/loro/sync.ts +1 -0
- package/src/core/datasets/__tests__/data-source.test.ts +5 -6
- package/src/core/datasets/state.ts +1 -1
- package/src/core/errors/__tests__/errors.test.ts +2 -1
- package/src/core/export/__tests__/hooks.test.ts +37 -36
- package/src/core/islands/main.ts +2 -7
- package/src/core/kernel/__tests__/handlers.test.ts +5 -4
- package/src/core/kernel/handlers.ts +7 -4
- package/src/core/network/DeferredRequestRegistry.ts +2 -2
- package/src/core/network/__tests__/CachingRequestRegistry.test.ts +9 -10
- package/src/core/network/__tests__/DeferredRequestRegistry.test.ts +4 -6
- package/src/core/static/__tests__/virtual-file-tracker.test.ts +8 -8
- package/src/core/static/virtual-file-tracker.ts +1 -1
- package/src/core/storage/__tests__/state.test.ts +31 -21
- package/src/core/storage/state.ts +1 -1
- package/src/core/variables/__tests__/state.test.ts +6 -6
- package/src/core/variables/types.ts +2 -2
- package/src/core/wasm/__tests__/state.test.ts +8 -8
- package/src/core/websocket/useMarimoKernelConnection.tsx +12 -15
- package/src/css/md-tooltip.css +4 -39
- package/src/css/md.css +7 -0
- package/src/plugins/core/RenderHTML.tsx +17 -0
- package/src/plugins/core/__test__/RenderHTML.test.ts +45 -0
- package/src/plugins/core/sanitize-html.ts +25 -18
- package/src/plugins/impl/DataTablePlugin.tsx +23 -2
- package/src/plugins/impl/SliderPlugin.tsx +1 -3
- package/src/plugins/impl/__tests__/SliderPlugin.test.tsx +120 -0
- package/src/plugins/impl/anywidget/model.ts +1 -2
- package/src/stories/cell.stories.tsx +8 -8
- package/src/stories/layout/vertical/one-column.stories.tsx +9 -8
- package/src/stories/log-viewer.stories.tsx +8 -8
- package/src/stories/variables.stories.tsx +2 -2
- package/src/utils/__tests__/download.test.tsx +21 -20
- package/src/utils/copy.ts +18 -5
- package/src/utils/download.ts +4 -3
- package/src/utils/html-to-image.ts +6 -0
- package/src/utils/json/base64.ts +3 -3
- package/src/utils/traceback.ts +5 -3
- package/dist/assets/JsonOutput-DKXKGKvX.js +0 -46
- package/dist/assets/RenderHTML-DJ8khuob.js +0 -1
- package/dist/assets/ai-model-dropdown-DPTa_EpU.js +0 -5
- package/dist/assets/cell-editor-DX7IcqNr.js +0 -23
- package/dist/assets/channel-CkT8Qdo2.js +0 -1
- package/dist/assets/classDiagram-2ON5EDUG-BhMT_rTz.js +0 -1
- package/dist/assets/classDiagram-v2-WZHVMYZB-D-F4WEyb.js +0 -1
- package/dist/assets/copy-YwM0Pd7v.js +0 -1
- package/dist/assets/dist-BTqMkf4j.js +0 -1
- package/dist/assets/dist-DHw9sXeN.js +0 -1
- package/dist/assets/dist-Du0qZeXz.js +0 -1
- package/dist/assets/dist-a0FfbvMD.js +0 -1
- package/dist/assets/dist-cfkfP0ni.js +0 -1
- package/dist/assets/dist-pzQ9JG-p.js +0 -1
- package/dist/assets/file-explorer-panel-CB8vF5ob.js +0 -26
- package/dist/assets/home-page-itW0tRmv.js +0 -4
- package/dist/assets/html-to-image-BnSc-Wa0.js +0 -2
- package/dist/assets/index-0n92c_W7.js +0 -38
- package/dist/assets/mermaid-4DMBBIKO-PoHnhmy8.js +0 -1
- package/dist/assets/react-vega-Da-Ps9UW.js +0 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-CEqeIlM0.js +0 -1
- package/dist/assets/stex-BBWVYm-R.js +0 -1
- package/dist/assets/tracing-DUVd0jtl.js +0 -1
- package/dist/assets/tracing-panel-CuTxPn_x.js +0 -2
- /package/dist/assets/{Combination-Cs9nbinQ.js → Combination-CSPK4t6z.js} +0 -0
- /package/dist/assets/{Deferred-BMfCOLaw.js → Deferred-CfyqLOPG.js} +0 -0
- /package/dist/assets/{SSRProvider-DC7ElCZZ.js → SSRProvider-CwqN9FWV.js} +0 -0
- /package/dist/assets/{badge-hTpPIsMT.js → badge-DImLVznf.js} +0 -0
- /package/dist/assets/{blob-CObhN-9g.js → blob-DgooIGjS.js} +0 -0
- /package/dist/assets/{bot-message-square-CK6eoGWy.js → bot-message-square-Dw41U6lL.js} +0 -0
- /package/dist/assets/{chart-no-axes-column-DV8gdCvH.js → chart-no-axes-column-a9XtWmzk.js} +0 -0
- /package/dist/assets/{check-BE0hEwVo.js → check-DZA_bRpw.js} +0 -0
- /package/dist/assets/{chevron-right-D0GQBpTb.js → chevron-right-CvVxySQk.js} +0 -0
- /package/dist/assets/{circle-check-gLIOLu8x.js → circle-check-CbaVeozR.js} +0 -0
- /package/dist/assets/{circle-play-DYGULlKZ.js → circle-play-DYn5nR6N.js} +0 -0
- /package/dist/assets/{circle-plus-CGG-gArM.js → circle-plus-nCze0-py.js} +0 -0
- /package/dist/assets/{clipboard-paste-DoYSN8Sv.js → clipboard-paste-EHXeKq9D.js} +0 -0
- /package/dist/assets/{code-xml-DwHPF_nL.js → code-xml-BlrJCgNZ.js} +0 -0
- /package/dist/assets/{copy-CkudG0Ej.js → copy-D6N1-xc1.js} +0 -0
- /package/dist/assets/{database-zap-DTWCDKdn.js → database-zap-BIGMFOfP.js} +0 -0
- /package/dist/assets/{defaultLocale-DK1MWd7f.js → defaultLocale-CGfP-Ye3.js} +0 -0
- /package/dist/assets/{defaultLocale-OkOxlkkM.js → defaultLocale-CuYNS33t.js} +0 -0
- /package/dist/assets/{dist-8UD0A5sU.js → dist-BF9S272t.js} +0 -0
- /package/dist/assets/{dist-apDpadc4.js → dist-Bk1itfBD.js} +0 -0
- /package/dist/assets/{dist-CQqv2gQL.js → dist-Dm11d0_A.js} +0 -0
- /package/dist/assets/{download-DBW9RXtT.js → download-nLboiTtW.js} +0 -0
- /package/dist/assets/{ellipsis-0_zJdF6H.js → ellipsis-d7eaKIFn.js} +0 -0
- /package/dist/assets/{ellipsis-vertical-CAB7tdza.js → ellipsis-vertical-DBQ5kWTo.js} +0 -0
- /package/dist/assets/{emotion-is-prop-valid.esm-D1keIaYa.js → emotion-is-prop-valid.esm-D7FeWASw.js} +0 -0
- /package/dist/assets/{errors-Bfogio62.js → errors-0IrrdfSG.js} +0 -0
- /package/dist/assets/{extends-DRbCSry7.js → extends-aq1t6BkR.js} +0 -0
- /package/dist/assets/{eye-off-vwi9L975.js → eye-off-CF3GmvXV.js} +0 -0
- /package/dist/assets/{file-DzHkbIdO.js → file-C-yMeaec.js} +0 -0
- /package/dist/assets/{file-headphone-B5q2Ow55.js → file-headphone-CPAP8asn.js} +0 -0
- /package/dist/assets/{file-plus-corner-lLQw9OnR.js → file-plus-corner-ks__N1mr.js} +0 -0
- /package/dist/assets/{github-BVtI-3F1.js → github-CRD4USKm.js} +0 -0
- /package/dist/assets/{image-DXfkah9d.js → image-CfyJzBP9.js} +0 -0
- /package/dist/assets/{link-Cf10mh3t.js → link-_dbp0XNB.js} +0 -0
- /package/dist/assets/{maps-OKerBHH8.js → maps-DQsjfyTy.js} +0 -0
- /package/dist/assets/{numbers-CYnquDho.js → numbers-Cno6K0UF.js} +0 -0
- /package/dist/assets/{objectWithoutPropertiesLoose-DP4vAkvg.js → objectWithoutPropertiesLoose-Dxmp_Bd_.js} +0 -0
- /package/dist/assets/{ordinal-BjO5SoTk.js → ordinal-CMAUv8ku.js} +0 -0
- /package/dist/assets/{paths-D2lG83Oh.js → paths-BVwhPRFT.js} +0 -0
- /package/dist/assets/{play-DKSqmedg.js → play-Bu_0ogGD.js} +0 -0
- /package/dist/assets/{plus-dVmh0yTy.js → plus-DJ99CUbx.js} +0 -0
- /package/dist/assets/{preload-helper-BW0IMuFq.js → preload-helper-y72bE5iF.js} +0 -0
- /package/dist/assets/{prop-types-RrUi-pOT.js → prop-types-DRf51_gT.js} +0 -0
- /package/dist/assets/{purify.es-BBn8CPhf.js → purify.es-Cf8RQecB.js} +0 -0
- /package/dist/assets/{range-DNqFcYmr.js → range-ClqUI25v.js} +0 -0
- /package/dist/assets/{refresh-ccw-DLpfIr8v.js → refresh-ccw-DQ6SJ8UC.js} +0 -0
- /package/dist/assets/{refresh-cw-CHAHPgkx.js → refresh-cw-Dg9tCj4k.js} +0 -0
- /package/dist/assets/{rotate-ccw-hLlF_82X.js → rotate-ccw-BCkZViUZ.js} +0 -0
- /package/dist/assets/{save-8fSvKYJT.js → save-CUdcv5qm.js} +0 -0
- /package/dist/assets/{session-BrEm7qNv.js → session-CByuQ-M-.js} +0 -0
- /package/dist/assets/{settings-CzQUw9rV.js → settings-B7nhfCat.js} +0 -0
- /package/dist/assets/{spinner-C5JoisA7.js → spinner-pCogyRyo.js} +0 -0
- /package/dist/assets/{square-CxAsQQ77.js → square-KVNDGpgy.js} +0 -0
- /package/dist/assets/{square-function-B006EYFX.js → square-function-BMNCw7Qb.js} +0 -0
- /package/dist/assets/{stex-0ac7Aukl.js → stex-C6JeW1YI.js} +0 -0
- /package/dist/assets/{table-BCnp9gKC.js → table-Od8PbuV-.js} +0 -0
- /package/dist/assets/{toDate-BqKH-Jd9.js → toDate-Cfp9W_O9.js} +0 -0
- /package/dist/assets/{trash-2-CAoNMkjq.js → trash-2-Bc_J7TQO.js} +0 -0
- /package/dist/assets/{trash-BZMAQneW.js → trash-Cxd189Vw.js} +0 -0
- /package/dist/assets/{triangle-alert-qZo1ox6x.js → triangle-alert-CzLrbLGN.js} +0 -0
- /package/dist/assets/{types-C1RN112u.js → types-CLOMZuqU.js} +0 -0
- /package/dist/assets/{use-toast-Hc8CXlvz.js → use-toast-BtZldTi5.js} +0 -0
- /package/dist/assets/{useDebounce-B0dx2Gp0.js → useDebounce-DwTO_rGp.js} +0 -0
- /package/dist/assets/{useTheme-BYXBU1of.js → useTheme-KDW4sktg.js} +0 -0
- /package/dist/assets/{uuid-ClFZlR7U.js → uuid-BukULOeS.js} +0 -0
- /package/dist/assets/{workflow-BmeqNuSH.js → workflow-BqHyyStM.js} +0 -0
- /package/dist/assets/{x-BI1M8X_v.js → x-CdLP7-v3.js} +0 -0
- /package/dist/assets/{youtube-DE-Ej6FR.js → youtube-CfU-SnDw.js} +0 -0
|
@@ -6,6 +6,7 @@ import type { ReactNode } from "react";
|
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
8
8
|
import { MockModules, Mocks } from "@/__mocks__/common";
|
|
9
|
+
import { cellId } from "@/__tests__/branded";
|
|
9
10
|
import type { CellId } from "@/core/cells/ids";
|
|
10
11
|
import { CellOutputId } from "@/core/cells/ids";
|
|
11
12
|
import type { CellRuntimeState } from "@/core/cells/types";
|
|
@@ -63,7 +64,7 @@ describe("useEnrichCellOutputs", () => {
|
|
|
63
64
|
): Record<CellId, CellRuntimeState> => {
|
|
64
65
|
return Object.fromEntries(
|
|
65
66
|
Object.entries(cells).map(([cellId, cell]) => [
|
|
66
|
-
cellId
|
|
67
|
+
cellId,
|
|
67
68
|
{
|
|
68
69
|
output: cell.output || null,
|
|
69
70
|
status: cell.status || "idle",
|
|
@@ -106,7 +107,7 @@ describe("useEnrichCellOutputs", () => {
|
|
|
106
107
|
});
|
|
107
108
|
|
|
108
109
|
it("should capture screenshots for cells with text/html output", async () => {
|
|
109
|
-
const
|
|
110
|
+
const cid = cellId("cell-1");
|
|
110
111
|
const mockElement = document.createElement("div");
|
|
111
112
|
const mockDataUrl = "data:image/png;base64,mockImageData";
|
|
112
113
|
|
|
@@ -116,7 +117,7 @@ describe("useEnrichCellOutputs", () => {
|
|
|
116
117
|
|
|
117
118
|
setCellsRuntime(
|
|
118
119
|
createMockCellRuntimes({
|
|
119
|
-
[
|
|
120
|
+
[cid]: {
|
|
120
121
|
output: {
|
|
121
122
|
channel: "output",
|
|
122
123
|
mimetype: "text/html",
|
|
@@ -133,7 +134,7 @@ describe("useEnrichCellOutputs", () => {
|
|
|
133
134
|
const output = await takeScreenshots({ progress });
|
|
134
135
|
|
|
135
136
|
expect(document.getElementById).toHaveBeenCalledWith(
|
|
136
|
-
CellOutputId.create(
|
|
137
|
+
CellOutputId.create(cid),
|
|
137
138
|
);
|
|
138
139
|
expect(toPng).toHaveBeenCalledWith(
|
|
139
140
|
mockElement,
|
|
@@ -143,12 +144,12 @@ describe("useEnrichCellOutputs", () => {
|
|
|
143
144
|
}),
|
|
144
145
|
);
|
|
145
146
|
expect(output).toEqual({
|
|
146
|
-
[
|
|
147
|
+
[cid]: ["image/png", mockDataUrl],
|
|
147
148
|
});
|
|
148
149
|
});
|
|
149
150
|
|
|
150
151
|
it("should skip cells where output has not changed", async () => {
|
|
151
|
-
const
|
|
152
|
+
const cid = cellId("cell-1");
|
|
152
153
|
const mockElement = document.createElement("div");
|
|
153
154
|
const mockDataUrl = "data:image/png;base64,mockImageData";
|
|
154
155
|
const htmlData = "<div>Chart</div>";
|
|
@@ -158,7 +159,7 @@ describe("useEnrichCellOutputs", () => {
|
|
|
158
159
|
|
|
159
160
|
setCellsRuntime(
|
|
160
161
|
createMockCellRuntimes({
|
|
161
|
-
[
|
|
162
|
+
[cid]: {
|
|
162
163
|
output: {
|
|
163
164
|
channel: "output",
|
|
164
165
|
mimetype: "text/html",
|
|
@@ -176,7 +177,7 @@ describe("useEnrichCellOutputs", () => {
|
|
|
176
177
|
// First call - should capture
|
|
177
178
|
let takeScreenshots = result.current;
|
|
178
179
|
let output = await takeScreenshots({ progress });
|
|
179
|
-
expect(output).toEqual({ [
|
|
180
|
+
expect(output).toEqual({ [cid]: ["image/png", mockDataUrl] });
|
|
180
181
|
expect(toPng).toHaveBeenCalledTimes(1);
|
|
181
182
|
|
|
182
183
|
// Rerender to get updated atom state
|
|
@@ -190,7 +191,7 @@ describe("useEnrichCellOutputs", () => {
|
|
|
190
191
|
});
|
|
191
192
|
|
|
192
193
|
it("should handle screenshot errors gracefully", async () => {
|
|
193
|
-
const
|
|
194
|
+
const cid = cellId("cell-1");
|
|
194
195
|
const mockElement = document.createElement("div");
|
|
195
196
|
const error = new Error("Screenshot failed");
|
|
196
197
|
|
|
@@ -199,7 +200,7 @@ describe("useEnrichCellOutputs", () => {
|
|
|
199
200
|
|
|
200
201
|
setCellsRuntime(
|
|
201
202
|
createMockCellRuntimes({
|
|
202
|
-
[
|
|
203
|
+
[cid]: {
|
|
203
204
|
output: {
|
|
204
205
|
channel: "output",
|
|
205
206
|
mimetype: "text/html",
|
|
@@ -217,13 +218,13 @@ describe("useEnrichCellOutputs", () => {
|
|
|
217
218
|
|
|
218
219
|
expect(output).toEqual({}); // Failed screenshot should be filtered out
|
|
219
220
|
expect(Logger.error).toHaveBeenCalledWith(
|
|
220
|
-
`Error screenshotting cell ${
|
|
221
|
+
`Error screenshotting cell ${cid}:`,
|
|
221
222
|
error,
|
|
222
223
|
);
|
|
223
224
|
});
|
|
224
225
|
|
|
225
226
|
it("should retry failed screenshots on next call", async () => {
|
|
226
|
-
const
|
|
227
|
+
const cid = cellId("cell-1");
|
|
227
228
|
const mockElement = document.createElement("div");
|
|
228
229
|
const error = new Error("Screenshot failed");
|
|
229
230
|
const mockDataUrl = "data:image/png;base64,retrySuccess";
|
|
@@ -236,7 +237,7 @@ describe("useEnrichCellOutputs", () => {
|
|
|
236
237
|
|
|
237
238
|
setCellsRuntime(
|
|
238
239
|
createMockCellRuntimes({
|
|
239
|
-
[
|
|
240
|
+
[cid]: {
|
|
240
241
|
output: {
|
|
241
242
|
channel: "output",
|
|
242
243
|
mimetype: "text/html",
|
|
@@ -262,18 +263,18 @@ describe("useEnrichCellOutputs", () => {
|
|
|
262
263
|
// Second call - should retry since the first one failed
|
|
263
264
|
takeScreenshots = result.current;
|
|
264
265
|
output = await takeScreenshots({ progress });
|
|
265
|
-
expect(output).toEqual({ [
|
|
266
|
+
expect(output).toEqual({ [cid]: ["image/png", mockDataUrl] });
|
|
266
267
|
expect(toPng).toHaveBeenCalledTimes(2);
|
|
267
268
|
});
|
|
268
269
|
|
|
269
270
|
it("should handle missing DOM elements", async () => {
|
|
270
|
-
const
|
|
271
|
+
const cid = cellId("cell-1");
|
|
271
272
|
|
|
272
273
|
vi.spyOn(document, "getElementById").mockReturnValue(null);
|
|
273
274
|
|
|
274
275
|
setCellsRuntime(
|
|
275
276
|
createMockCellRuntimes({
|
|
276
|
-
[
|
|
277
|
+
[cid]: {
|
|
277
278
|
output: {
|
|
278
279
|
channel: "output",
|
|
279
280
|
mimetype: "text/html",
|
|
@@ -291,14 +292,14 @@ describe("useEnrichCellOutputs", () => {
|
|
|
291
292
|
|
|
292
293
|
expect(output).toEqual({});
|
|
293
294
|
expect(Logger.error).toHaveBeenCalledWith(
|
|
294
|
-
`Output element not found for cell ${
|
|
295
|
+
`Output element not found for cell ${cid}`,
|
|
295
296
|
);
|
|
296
297
|
expect(toPng).not.toHaveBeenCalled();
|
|
297
298
|
});
|
|
298
299
|
|
|
299
300
|
it("should process multiple cells in parallel", async () => {
|
|
300
|
-
const cell1 = "cell-1"
|
|
301
|
-
const cell2 = "cell-2"
|
|
301
|
+
const cell1 = "cell-1";
|
|
302
|
+
const cell2 = "cell-2";
|
|
302
303
|
const mockElement1 = document.createElement("div");
|
|
303
304
|
const mockElement2 = document.createElement("div");
|
|
304
305
|
const mockDataUrl1 = "data:image/png;base64,image1";
|
|
@@ -347,8 +348,8 @@ describe("useEnrichCellOutputs", () => {
|
|
|
347
348
|
|
|
348
349
|
it("should filter out null results from failed screenshots", async () => {
|
|
349
350
|
// Setup: one successful, one failed screenshot
|
|
350
|
-
const cell1 = "cell-1"
|
|
351
|
-
const cell2 = "cell-2"
|
|
351
|
+
const cell1 = "cell-1";
|
|
352
|
+
const cell2 = "cell-2";
|
|
352
353
|
const mockElement1 = document.createElement("div");
|
|
353
354
|
const mockDataUrl = "data:image/png;base64,image1";
|
|
354
355
|
|
|
@@ -394,7 +395,7 @@ describe("useEnrichCellOutputs", () => {
|
|
|
394
395
|
});
|
|
395
396
|
|
|
396
397
|
it("should only capture screenshots for cells with changed output", async () => {
|
|
397
|
-
const
|
|
398
|
+
const cid = cellId("cell-1");
|
|
398
399
|
const mockElement = document.createElement("div");
|
|
399
400
|
const mockDataUrl1 = "data:image/png;base64,image1";
|
|
400
401
|
const mockDataUrl2 = "data:image/png;base64,image2";
|
|
@@ -407,7 +408,7 @@ describe("useEnrichCellOutputs", () => {
|
|
|
407
408
|
// First call - cell should be captured
|
|
408
409
|
setCellsRuntime(
|
|
409
410
|
createMockCellRuntimes({
|
|
410
|
-
[
|
|
411
|
+
[cid]: {
|
|
411
412
|
output: {
|
|
412
413
|
channel: "output",
|
|
413
414
|
mimetype: "text/html",
|
|
@@ -425,7 +426,7 @@ describe("useEnrichCellOutputs", () => {
|
|
|
425
426
|
// First screenshot
|
|
426
427
|
let takeScreenshots = result.current;
|
|
427
428
|
let output = await takeScreenshots({ progress });
|
|
428
|
-
expect(output).toEqual({ [
|
|
429
|
+
expect(output).toEqual({ [cid]: ["image/png", mockDataUrl1] });
|
|
429
430
|
|
|
430
431
|
// Second call - same output, should not be captured
|
|
431
432
|
rerender();
|
|
@@ -436,7 +437,7 @@ describe("useEnrichCellOutputs", () => {
|
|
|
436
437
|
// Third call - output changed, should be captured
|
|
437
438
|
setCellsRuntime(
|
|
438
439
|
createMockCellRuntimes({
|
|
439
|
-
[
|
|
440
|
+
[cid]: {
|
|
440
441
|
output: {
|
|
441
442
|
channel: "output",
|
|
442
443
|
mimetype: "text/html",
|
|
@@ -450,7 +451,7 @@ describe("useEnrichCellOutputs", () => {
|
|
|
450
451
|
rerender();
|
|
451
452
|
takeScreenshots = result.current;
|
|
452
453
|
output = await takeScreenshots({ progress });
|
|
453
|
-
expect(output).toEqual({ [
|
|
454
|
+
expect(output).toEqual({ [cid]: ["image/png", mockDataUrl2] });
|
|
454
455
|
expect(toPng).toHaveBeenCalledTimes(2);
|
|
455
456
|
});
|
|
456
457
|
|
|
@@ -523,7 +524,7 @@ describe("useEnrichCellOutputs", () => {
|
|
|
523
524
|
|
|
524
525
|
it("should return correctly formatted result with CellId and tuple", async () => {
|
|
525
526
|
// Expected format: Record<CellId, ["image/png", string]>
|
|
526
|
-
const
|
|
527
|
+
const cid = cellId("test-cell");
|
|
527
528
|
const mockElement = document.createElement("div");
|
|
528
529
|
const mockDataUrl = "data:image/png;base64,testData";
|
|
529
530
|
|
|
@@ -532,7 +533,7 @@ describe("useEnrichCellOutputs", () => {
|
|
|
532
533
|
|
|
533
534
|
setCellsRuntime(
|
|
534
535
|
createMockCellRuntimes({
|
|
535
|
-
[
|
|
536
|
+
[cid]: {
|
|
536
537
|
output: {
|
|
537
538
|
channel: "output",
|
|
538
539
|
mimetype: "text/html",
|
|
@@ -549,8 +550,8 @@ describe("useEnrichCellOutputs", () => {
|
|
|
549
550
|
const output = await takeScreenshots({ progress });
|
|
550
551
|
|
|
551
552
|
// Verify the exact return type structure
|
|
552
|
-
expect(output).toHaveProperty(
|
|
553
|
-
const cellOutput = output[
|
|
553
|
+
expect(output).toHaveProperty(cid);
|
|
554
|
+
const cellOutput = output[cid];
|
|
554
555
|
expect(cellOutput).toBeDefined();
|
|
555
556
|
expect(Array.isArray(cellOutput)).toBe(true);
|
|
556
557
|
if (cellOutput) {
|
|
@@ -566,9 +567,9 @@ describe("updateCellOutputsWithScreenshots", () => {
|
|
|
566
567
|
});
|
|
567
568
|
|
|
568
569
|
it("should call updateCellOutputs when there are screenshots", async () => {
|
|
569
|
-
const
|
|
570
|
+
const cid = cellId("cell-1");
|
|
570
571
|
const mockScreenshots = {
|
|
571
|
-
[
|
|
572
|
+
[cid]: ["image/png", "data:image/png;base64,test"] as [
|
|
572
573
|
"image/png",
|
|
573
574
|
string,
|
|
574
575
|
],
|
|
@@ -603,8 +604,8 @@ describe("updateCellOutputsWithScreenshots", () => {
|
|
|
603
604
|
});
|
|
604
605
|
|
|
605
606
|
it("should handle multiple cell screenshots", async () => {
|
|
606
|
-
const cell1 = "cell-1"
|
|
607
|
-
const cell2 = "cell-2"
|
|
607
|
+
const cell1 = "cell-1";
|
|
608
|
+
const cell2 = "cell-2";
|
|
608
609
|
const mockScreenshots = {
|
|
609
610
|
[cell1]: ["image/png", "data:image/png;base64,image1"] as [
|
|
610
611
|
"image/png",
|
|
@@ -654,9 +655,9 @@ describe("updateCellOutputsWithScreenshots", () => {
|
|
|
654
655
|
});
|
|
655
656
|
|
|
656
657
|
it("should catch errors from updateCellOutputs and show toast", async () => {
|
|
657
|
-
const
|
|
658
|
+
const cid = cellId("cell-1");
|
|
658
659
|
const mockScreenshots = {
|
|
659
|
-
[
|
|
660
|
+
[cid]: ["image/png", "data:image/png;base64,test"] as [
|
|
660
661
|
"image/png",
|
|
661
662
|
string,
|
|
662
663
|
],
|
package/src/core/islands/main.ts
CHANGED
|
@@ -28,7 +28,6 @@ import {
|
|
|
28
28
|
notebookAtom,
|
|
29
29
|
notebookReducer,
|
|
30
30
|
} from "../cells/cells";
|
|
31
|
-
import type { UIElementId } from "../cells/ids";
|
|
32
31
|
import { defineCustomElement } from "../dom/defineCustomElement";
|
|
33
32
|
import { MarimoValueInputEvent } from "../dom/events";
|
|
34
33
|
import { UI_ELEMENT_REGISTRY } from "../dom/uiregistry";
|
|
@@ -41,7 +40,6 @@ import {
|
|
|
41
40
|
import { queryParamHandlers } from "../kernel/queryParamHandlers";
|
|
42
41
|
import { RuntimeState } from "../kernel/RuntimeState";
|
|
43
42
|
import { initialModeAtom } from "../mode";
|
|
44
|
-
import type { RequestId } from "../network/DeferredRequestRegistry";
|
|
45
43
|
import { requestClientAtom } from "../network/requests";
|
|
46
44
|
import { store } from "../state/jotai";
|
|
47
45
|
import { IslandsPyodideBridge } from "./bridge";
|
|
@@ -153,7 +151,7 @@ export async function initialize() {
|
|
|
153
151
|
return;
|
|
154
152
|
case "send-ui-element-message":
|
|
155
153
|
UI_ELEMENT_REGISTRY.broadcastMessage(
|
|
156
|
-
msg.data.ui_element
|
|
154
|
+
msg.data.ui_element,
|
|
157
155
|
msg.data.message,
|
|
158
156
|
safeExtractSetUIElementMessageBuffers(msg.data),
|
|
159
157
|
);
|
|
@@ -163,10 +161,7 @@ export async function initialize() {
|
|
|
163
161
|
handleRemoveUIElements(msg.data);
|
|
164
162
|
return;
|
|
165
163
|
case "function-call-result":
|
|
166
|
-
FUNCTIONS_REGISTRY.resolve(
|
|
167
|
-
msg.data.function_call_id as RequestId,
|
|
168
|
-
msg.data,
|
|
169
|
-
);
|
|
164
|
+
FUNCTIONS_REGISTRY.resolve(msg.data.function_call_id, msg.data);
|
|
170
165
|
return;
|
|
171
166
|
case "cell-op":
|
|
172
167
|
handleCellNotificationeration(msg.data, actions.handleCellMessage);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
import { describe, expect, it, vi } from "vitest";
|
|
3
|
+
import { cellId } from "@/__tests__/branded";
|
|
3
4
|
import { buildCellData, buildLayoutState } from "../handlers";
|
|
4
5
|
import type { NotificationMessageData } from "../messages";
|
|
5
6
|
import { queryParamHandlers } from "../queryParamHandlers";
|
|
@@ -65,7 +66,7 @@ describe("queryParamHandlers", () => {
|
|
|
65
66
|
describe("buildCellData", () => {
|
|
66
67
|
it("should build cell data from kernel-ready data", () => {
|
|
67
68
|
const kernelReadyData: NotificationMessageData<"kernel-ready"> = {
|
|
68
|
-
cell_ids: ["cell1", "cell2"],
|
|
69
|
+
cell_ids: [cellId("cell1"), cellId("cell2")],
|
|
69
70
|
codes: ["x = 1", "y = 2"],
|
|
70
71
|
names: ["__", "__"],
|
|
71
72
|
configs: [
|
|
@@ -127,7 +128,7 @@ describe("buildCellData", () => {
|
|
|
127
128
|
|
|
128
129
|
it("should mark cells as edited when code differs from last executed code", () => {
|
|
129
130
|
const kernelReadyData: NotificationMessageData<"kernel-ready"> = {
|
|
130
|
-
cell_ids: ["cell1", "cell2"],
|
|
131
|
+
cell_ids: [cellId("cell1"), cellId("cell2")],
|
|
131
132
|
codes: ["x = 1", "y = 3"],
|
|
132
133
|
names: ["__", "__"],
|
|
133
134
|
configs: [
|
|
@@ -201,7 +202,7 @@ describe("buildCellData", () => {
|
|
|
201
202
|
describe("buildLayoutState", () => {
|
|
202
203
|
it("should build default layout state when no layout is provided", () => {
|
|
203
204
|
const kernelReadyData: NotificationMessageData<"kernel-ready"> = {
|
|
204
|
-
cell_ids: ["cell1"],
|
|
205
|
+
cell_ids: [cellId("cell1")],
|
|
205
206
|
codes: ["x = 1"],
|
|
206
207
|
names: ["__"],
|
|
207
208
|
configs: [{ disabled: false, hide_code: false }],
|
|
@@ -243,7 +244,7 @@ describe("buildLayoutState", () => {
|
|
|
243
244
|
|
|
244
245
|
it("should build layout state with vertical layout", () => {
|
|
245
246
|
const kernelReadyData: NotificationMessageData<"kernel-ready"> = {
|
|
246
|
-
cell_ids: ["cell1", "cell2"],
|
|
247
|
+
cell_ids: [cellId("cell1"), cellId("cell2")],
|
|
247
248
|
codes: ["x = 1", "y = 2"],
|
|
248
249
|
names: ["__", "__"],
|
|
249
250
|
configs: [
|
|
@@ -3,7 +3,7 @@ import { deserializeLayout } from "@/components/editor/renderers/plugins";
|
|
|
3
3
|
import type { LayoutType } from "@/components/editor/renderers/types";
|
|
4
4
|
import { Logger } from "@/utils/Logger";
|
|
5
5
|
import { Objects } from "@/utils/objects";
|
|
6
|
-
import type {
|
|
6
|
+
import type { UIElementId } from "../cells/ids";
|
|
7
7
|
import { type CellData, createCell } from "../cells/types";
|
|
8
8
|
import { type AppConfig, AppConfigSchema } from "../config/config-schema";
|
|
9
9
|
import { UI_ELEMENT_REGISTRY } from "../dom/uiregistry";
|
|
@@ -47,7 +47,7 @@ export function buildCellData(data: KernelReadyData): CellData[] {
|
|
|
47
47
|
const edited = lastCodeRun ? lastCodeRun !== code : false;
|
|
48
48
|
|
|
49
49
|
return createCell({
|
|
50
|
-
id: cellId
|
|
50
|
+
id: cellId,
|
|
51
51
|
code,
|
|
52
52
|
edited,
|
|
53
53
|
name: names[i],
|
|
@@ -160,7 +160,10 @@ export function handleKernelReady(
|
|
|
160
160
|
// If resumed, restore UI element values from kernel and we're done
|
|
161
161
|
if (resumed) {
|
|
162
162
|
for (const [objectId, value] of Objects.entries(ui_values || {})) {
|
|
163
|
-
|
|
163
|
+
// @ts-expect-error - TODO: We need to fix the types for KernelReadyNotification["ui_values"]
|
|
164
|
+
// It is currently typed as Record<string, any> and should be Record<UIElementId, unknown>
|
|
165
|
+
const uiObjectId: UIElementId = objectId;
|
|
166
|
+
UI_ELEMENT_REGISTRY.set(uiObjectId, value);
|
|
164
167
|
}
|
|
165
168
|
return;
|
|
166
169
|
}
|
|
@@ -196,7 +199,7 @@ export function handleRemoveUIElements(
|
|
|
196
199
|
// This removes the element from the registry to (1) clean-up
|
|
197
200
|
// memory and (2) make sure that the old value doesn't get re-used
|
|
198
201
|
// if the same cell-id is later reused for another element.
|
|
199
|
-
const cellId = data.cell_id
|
|
202
|
+
const cellId = data.cell_id;
|
|
200
203
|
UI_ELEMENT_REGISTRY.removeElementsByCell(cellId);
|
|
201
204
|
VirtualFileTracker.INSTANCE.removeForCellId(cellId);
|
|
202
205
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-redeclare */
|
|
3
|
+
import type { components } from "@marimo-team/marimo-api";
|
|
3
4
|
import { Deferred } from "@/utils/Deferred";
|
|
4
5
|
import { generateUUID } from "@/utils/uuid";
|
|
5
|
-
import type { TypedString } from "../../utils/typed";
|
|
6
6
|
|
|
7
|
-
export type RequestId =
|
|
7
|
+
export type RequestId = components["schemas"]["RequestId"];
|
|
8
8
|
export const RequestId = {
|
|
9
9
|
create(): RequestId {
|
|
10
10
|
return generateUUID() as RequestId;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
2
3
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
4
|
+
import { requestId } from "@/__tests__/branded";
|
|
3
5
|
import { CachingRequestRegistry } from "../CachingRequestRegistry";
|
|
4
|
-
import {
|
|
5
|
-
DeferredRequestRegistry,
|
|
6
|
-
type RequestId,
|
|
7
|
-
} from "../DeferredRequestRegistry";
|
|
6
|
+
import { DeferredRequestRegistry } from "../DeferredRequestRegistry";
|
|
8
7
|
|
|
9
8
|
vi.mock("@/utils/uuid", () => ({
|
|
10
9
|
generateUUID: vi.fn().mockReturnValue("uuid"),
|
|
11
10
|
}));
|
|
12
11
|
|
|
13
12
|
describe("CachingRequestRegistry", () => {
|
|
14
|
-
const REQUEST_ID = "uuid"
|
|
13
|
+
const REQUEST_ID = requestId("uuid");
|
|
15
14
|
let makeRequestMock = vi.fn();
|
|
16
15
|
let delegate: DeferredRequestRegistry<unknown, unknown>;
|
|
17
16
|
let caching: CachingRequestRegistry<unknown, unknown>;
|
|
@@ -31,7 +30,7 @@ describe("CachingRequestRegistry", () => {
|
|
|
31
30
|
|
|
32
31
|
// Resolve first request
|
|
33
32
|
delegate.resolve(REQUEST_ID, "response");
|
|
34
|
-
await expect(p1).resolves.toBe("response");
|
|
33
|
+
await expect(p1).resolves.toBe(requestId("response"));
|
|
35
34
|
|
|
36
35
|
// Second call with equivalent request gets served from cache
|
|
37
36
|
const p2 = caching.request({ a: 1 });
|
|
@@ -50,8 +49,8 @@ describe("CachingRequestRegistry", () => {
|
|
|
50
49
|
expect(p1).toStrictEqual(p2);
|
|
51
50
|
|
|
52
51
|
// Resolve and ensure both resolve to same result
|
|
53
|
-
delegate.resolve(REQUEST_ID, "ok");
|
|
54
|
-
await expect(p1).resolves.toBe("ok");
|
|
52
|
+
delegate.resolve(REQUEST_ID, requestId("ok"));
|
|
53
|
+
await expect(p1).resolves.toBe(requestId("ok"));
|
|
55
54
|
await expect(p2).resolves.toBe("ok");
|
|
56
55
|
});
|
|
57
56
|
|
|
@@ -67,7 +66,7 @@ describe("CachingRequestRegistry", () => {
|
|
|
67
66
|
expect(makeRequestMock).toHaveBeenCalledTimes(2);
|
|
68
67
|
|
|
69
68
|
// Resolve the second request
|
|
70
|
-
delegate.resolve(REQUEST_ID, "ok");
|
|
71
|
-
await expect(p2).resolves.toBe("ok");
|
|
69
|
+
delegate.resolve(REQUEST_ID, requestId("ok"));
|
|
70
|
+
await expect(p2).resolves.toBe(requestId("ok"));
|
|
72
71
|
});
|
|
73
72
|
});
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
type RequestId,
|
|
6
|
-
} from "../DeferredRequestRegistry";
|
|
3
|
+
import { requestId } from "@/__tests__/branded";
|
|
4
|
+
import { DeferredRequestRegistry } from "../DeferredRequestRegistry";
|
|
7
5
|
|
|
8
6
|
vi.mock("@/utils/uuid", () => ({
|
|
9
7
|
generateUUID: vi.fn().mockReturnValue("uuid"),
|
|
10
8
|
}));
|
|
11
9
|
|
|
12
10
|
describe("DeferredRequestRegistry", () => {
|
|
13
|
-
const REQUEST_ID = "uuid"
|
|
11
|
+
const REQUEST_ID = requestId("uuid");
|
|
14
12
|
let makeRequestMock = vi.fn();
|
|
15
13
|
let registry: DeferredRequestRegistry<unknown, unknown>;
|
|
16
14
|
|
|
@@ -26,7 +24,7 @@ describe("DeferredRequestRegistry", () => {
|
|
|
26
24
|
|
|
27
25
|
// resolve
|
|
28
26
|
registry.resolve(REQUEST_ID, "response");
|
|
29
|
-
await expect(promise).resolves.toBe("response");
|
|
27
|
+
await expect(promise).resolves.toBe(requestId("response"));
|
|
30
28
|
});
|
|
31
29
|
|
|
32
30
|
it("should handle request failure", async () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
import { describe, expect, it } from "vitest";
|
|
3
|
-
import
|
|
3
|
+
import { cellId } from "@/__tests__/branded";
|
|
4
4
|
import type { OutputMessage } from "@/core/kernel/messages";
|
|
5
5
|
import { findVirtualFiles, VirtualFileTracker } from "../virtual-file-tracker";
|
|
6
6
|
|
|
@@ -103,32 +103,32 @@ describe("findVirtualFiles", () => {
|
|
|
103
103
|
describe("VirtualFileTracker", () => {
|
|
104
104
|
it("should track virtual files, append, clear", () => {
|
|
105
105
|
const tracker = VirtualFileTracker.INSTANCE;
|
|
106
|
-
const
|
|
106
|
+
const cid = cellId("test-cell-id");
|
|
107
107
|
tracker.track({
|
|
108
|
-
cell_id:
|
|
108
|
+
cell_id: cid,
|
|
109
109
|
output: {
|
|
110
110
|
mimetype: "text/html",
|
|
111
111
|
data: "Some text /@file/test-file.js more text",
|
|
112
112
|
} as OutputMessage,
|
|
113
113
|
});
|
|
114
|
-
expect(tracker.virtualFiles.get(
|
|
114
|
+
expect(tracker.virtualFiles.get(cid)).toEqual(
|
|
115
115
|
new Set(["/@file/test-file.js"]),
|
|
116
116
|
);
|
|
117
117
|
|
|
118
118
|
// can append
|
|
119
119
|
tracker.track({
|
|
120
|
-
cell_id:
|
|
120
|
+
cell_id: cid,
|
|
121
121
|
output: {
|
|
122
122
|
mimetype: "text/html",
|
|
123
123
|
data: "Some text /@file/another-file.txt more text",
|
|
124
124
|
} as OutputMessage,
|
|
125
125
|
});
|
|
126
|
-
expect(tracker.virtualFiles.get(
|
|
126
|
+
expect(tracker.virtualFiles.get(cid)).toEqual(
|
|
127
127
|
new Set(["/@file/test-file.js", "/@file/another-file.txt"]),
|
|
128
128
|
);
|
|
129
129
|
|
|
130
130
|
// can clear
|
|
131
|
-
tracker.removeForCellId(
|
|
132
|
-
expect(tracker.virtualFiles.get(
|
|
131
|
+
tracker.removeForCellId(cid);
|
|
132
|
+
expect(tracker.virtualFiles.get(cid)).toEqual(undefined);
|
|
133
133
|
});
|
|
134
134
|
});
|