@marimo-team/frontend 0.21.2-dev5 → 0.21.2-dev52
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
|
@@ -14,8 +14,9 @@ import {
|
|
|
14
14
|
vi,
|
|
15
15
|
} from "vitest";
|
|
16
16
|
import { MockNotebook } from "@/__mocks__/notebook";
|
|
17
|
+
import { cellId } from "@/__tests__/branded";
|
|
17
18
|
import type { CellHandle } from "@/components/editor/notebook-cell";
|
|
18
|
-
import { CellId, SETUP_CELL_ID } from "@/core/cells/ids";
|
|
19
|
+
import { CellId, SCRATCH_CELL_ID, SETUP_CELL_ID } from "@/core/cells/ids";
|
|
19
20
|
import { foldAllBulk, unfoldAllBulk } from "@/core/codemirror/editing/commands";
|
|
20
21
|
import { adaptiveLanguageConfiguration } from "@/core/codemirror/language/extension";
|
|
21
22
|
import { OverridingHotkeyProvider } from "@/core/hotkeys/hotkeys";
|
|
@@ -84,7 +85,7 @@ function createEditor(content: string) {
|
|
|
84
85
|
extensions: [
|
|
85
86
|
python(),
|
|
86
87
|
adaptiveLanguageConfiguration({
|
|
87
|
-
cellId: "cell1"
|
|
88
|
+
cellId: cellId("cell1"),
|
|
88
89
|
completionConfig: {
|
|
89
90
|
activate_on_typing: true,
|
|
90
91
|
signature_hint_on_typing: false,
|
|
@@ -113,14 +114,16 @@ describe("cell reducer", () => {
|
|
|
113
114
|
|
|
114
115
|
const actions = createActions((action) => {
|
|
115
116
|
state = reducer(state, action);
|
|
116
|
-
for (const [
|
|
117
|
+
for (const [cellIdString, handle] of Object.entries(state.cellHandles)) {
|
|
118
|
+
// @ts-expect-error - Typescript Object.entries doesn't know that keys are CellId
|
|
119
|
+
const cid: CellId = cellIdString;
|
|
117
120
|
if (!handle.current) {
|
|
118
|
-
const view = createEditor(state.cellData[
|
|
121
|
+
const view = createEditor(state.cellData[cid].code);
|
|
119
122
|
const handle: CellHandle = {
|
|
120
123
|
editorView: view,
|
|
121
124
|
editorViewOrNull: view,
|
|
122
125
|
};
|
|
123
|
-
state.cellHandles[
|
|
126
|
+
state.cellHandles[cid] = { current: handle };
|
|
124
127
|
}
|
|
125
128
|
}
|
|
126
129
|
cells = flattenTopLevelNotebookCells(state);
|
|
@@ -131,7 +134,7 @@ describe("cell reducer", () => {
|
|
|
131
134
|
|
|
132
135
|
beforeAll(() => {
|
|
133
136
|
CellId.create = () => {
|
|
134
|
-
return `${i++}`
|
|
137
|
+
return cellId(`${i++}`);
|
|
135
138
|
};
|
|
136
139
|
});
|
|
137
140
|
|
|
@@ -221,7 +224,7 @@ describe("cell reducer", () => {
|
|
|
221
224
|
`);
|
|
222
225
|
|
|
223
226
|
// Verify scrollKey is set to the restored cell
|
|
224
|
-
expect(state.scrollKey).toBe("2"
|
|
227
|
+
expect(state.scrollKey).toBe("2");
|
|
225
228
|
});
|
|
226
229
|
|
|
227
230
|
it("can delete a SQL cell and undo delete", () => {
|
|
@@ -362,7 +365,7 @@ describe("cell reducer", () => {
|
|
|
362
365
|
`);
|
|
363
366
|
|
|
364
367
|
// Add a column breakpoint to test left/right movement
|
|
365
|
-
actions.addColumnBreakpoint({ cellId: "1"
|
|
368
|
+
actions.addColumnBreakpoint({ cellId: cellId("1") });
|
|
366
369
|
expect(formatCells(state)).toMatchInlineSnapshot(`
|
|
367
370
|
"
|
|
368
371
|
> col 0
|
|
@@ -422,7 +425,7 @@ describe("cell reducer", () => {
|
|
|
422
425
|
|
|
423
426
|
// Try to move cell right when it's already in rightmost column (should noop)
|
|
424
427
|
actions.moveCell({
|
|
425
|
-
cellId: "1"
|
|
428
|
+
cellId: cellId("1"),
|
|
426
429
|
direction: "right",
|
|
427
430
|
});
|
|
428
431
|
expect(formatCells(state)).toMatchInlineSnapshot(`
|
|
@@ -442,7 +445,7 @@ describe("cell reducer", () => {
|
|
|
442
445
|
before: false,
|
|
443
446
|
});
|
|
444
447
|
actions.createNewCell({
|
|
445
|
-
cellId: "1"
|
|
448
|
+
cellId: cellId("1"),
|
|
446
449
|
before: false,
|
|
447
450
|
});
|
|
448
451
|
expect(formatCells(state)).toMatchInlineSnapshot(`
|
|
@@ -458,7 +461,7 @@ describe("cell reducer", () => {
|
|
|
458
461
|
// drag first cell to the end
|
|
459
462
|
actions.dropCellOverCell({
|
|
460
463
|
cellId: firstCellId,
|
|
461
|
-
overCellId: "2"
|
|
464
|
+
overCellId: cellId("2"),
|
|
462
465
|
});
|
|
463
466
|
expect(formatCells(state)).toMatchInlineSnapshot(`
|
|
464
467
|
"
|
|
@@ -473,7 +476,7 @@ describe("cell reducer", () => {
|
|
|
473
476
|
// drag it back to the middle
|
|
474
477
|
actions.dropCellOverCell({
|
|
475
478
|
cellId: firstCellId,
|
|
476
|
-
overCellId: "2"
|
|
479
|
+
overCellId: cellId("2"),
|
|
477
480
|
});
|
|
478
481
|
expect(formatCells(state)).toMatchInlineSnapshot(`
|
|
479
482
|
"
|
|
@@ -1001,7 +1004,7 @@ describe("cell reducer", () => {
|
|
|
1001
1004
|
data: [
|
|
1002
1005
|
{
|
|
1003
1006
|
msg: "This cell wasn't run because an ancestor was stopped with `mo.stop`: ",
|
|
1004
|
-
raising_cell: "2"
|
|
1007
|
+
raising_cell: "2",
|
|
1005
1008
|
type: "ancestor-stopped",
|
|
1006
1009
|
},
|
|
1007
1010
|
],
|
|
@@ -1284,8 +1287,8 @@ describe("cell reducer", () => {
|
|
|
1284
1287
|
|
|
1285
1288
|
it("can send a cell to the top", () => {
|
|
1286
1289
|
actions.createNewCell({ cellId: firstCellId, before: false });
|
|
1287
|
-
actions.createNewCell({ cellId: "1"
|
|
1288
|
-
actions.sendToTop({ cellId: "2"
|
|
1290
|
+
actions.createNewCell({ cellId: cellId("1"), before: false });
|
|
1291
|
+
actions.sendToTop({ cellId: cellId("2") });
|
|
1289
1292
|
expect(formatCells(state)).toMatchInlineSnapshot(`
|
|
1290
1293
|
"
|
|
1291
1294
|
[2] ''
|
|
@@ -1299,7 +1302,7 @@ describe("cell reducer", () => {
|
|
|
1299
1302
|
|
|
1300
1303
|
it("can send a cell to the bottom", () => {
|
|
1301
1304
|
actions.createNewCell({ cellId: firstCellId, before: false });
|
|
1302
|
-
actions.createNewCell({ cellId: "1"
|
|
1305
|
+
actions.createNewCell({ cellId: cellId("1"), before: false });
|
|
1303
1306
|
actions.sendToBottom({ cellId: firstCellId });
|
|
1304
1307
|
expect(formatCells(state)).toMatchInlineSnapshot(`
|
|
1305
1308
|
"
|
|
@@ -1314,12 +1317,12 @@ describe("cell reducer", () => {
|
|
|
1314
1317
|
|
|
1315
1318
|
it("can focus cells", () => {
|
|
1316
1319
|
actions.createNewCell({ cellId: firstCellId, before: false });
|
|
1317
|
-
actions.createNewCell({ cellId: "1"
|
|
1320
|
+
actions.createNewCell({ cellId: cellId("1"), before: false });
|
|
1318
1321
|
|
|
1319
|
-
actions.focusCell({ cellId: "1"
|
|
1322
|
+
actions.focusCell({ cellId: cellId("1"), where: "before" });
|
|
1320
1323
|
expect(focusAndScrollCellIntoView).toHaveBeenCalledWith(
|
|
1321
1324
|
expect.objectContaining({
|
|
1322
|
-
cellId: "0"
|
|
1325
|
+
cellId: cellId("0"),
|
|
1323
1326
|
}),
|
|
1324
1327
|
);
|
|
1325
1328
|
|
|
@@ -1336,7 +1339,7 @@ describe("cell reducer", () => {
|
|
|
1336
1339
|
});
|
|
1337
1340
|
|
|
1338
1341
|
it("can set cell IDs and codes", () => {
|
|
1339
|
-
const newIds = ["3", "4", "5"]
|
|
1342
|
+
const newIds = [cellId("3"), cellId("4"), cellId("5")];
|
|
1340
1343
|
const newCodes = ["code1", "code2", "code3"];
|
|
1341
1344
|
|
|
1342
1345
|
actions.setCellIds({ cellIds: newIds });
|
|
@@ -1371,76 +1374,91 @@ describe("cell reducer", () => {
|
|
|
1371
1374
|
it("can can add a new cell with/without stale code", () => {
|
|
1372
1375
|
actions.setCellCodes({
|
|
1373
1376
|
codes: ["new code"],
|
|
1374
|
-
ids: ["2"]
|
|
1377
|
+
ids: [cellId("2")],
|
|
1375
1378
|
codeIsStale: false,
|
|
1376
1379
|
});
|
|
1377
1380
|
|
|
1378
|
-
expect(state.cellData["2"
|
|
1379
|
-
expect(state.cellData["2"
|
|
1380
|
-
expect(state.cellData["2"
|
|
1381
|
+
expect(state.cellData[cellId("2")].code).toBe("new code");
|
|
1382
|
+
expect(state.cellData[cellId("2")].edited).toBe(false);
|
|
1383
|
+
expect(state.cellData[cellId("2")].lastCodeRun).toBe("new code");
|
|
1381
1384
|
|
|
1382
1385
|
actions.setCellCodes({
|
|
1383
1386
|
codes: ["new code 2"],
|
|
1384
|
-
ids: ["9"]
|
|
1387
|
+
ids: [cellId("9")],
|
|
1385
1388
|
codeIsStale: true,
|
|
1386
1389
|
});
|
|
1387
1390
|
|
|
1388
|
-
expect(state.cellData["9"
|
|
1389
|
-
expect(state.cellData["9"
|
|
1390
|
-
expect(state.cellData["9"
|
|
1391
|
+
expect(state.cellData[cellId("9")].code).toBe("new code 2");
|
|
1392
|
+
expect(state.cellData[cellId("9")].edited).toBe(true);
|
|
1393
|
+
expect(state.cellData[cellId("9")].lastCodeRun).toBe(null);
|
|
1391
1394
|
});
|
|
1392
1395
|
|
|
1393
1396
|
it("can partial update cell codes", () => {
|
|
1394
1397
|
actions.createNewCell({ cellId: firstCellId, before: false });
|
|
1395
|
-
actions.createNewCell({ cellId: "1"
|
|
1398
|
+
actions.createNewCell({ cellId: cellId("1"), before: false });
|
|
1396
1399
|
|
|
1397
|
-
expect(state.cellIds.inOrderIds).toEqual([
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1400
|
+
expect(state.cellIds.inOrderIds).toEqual([
|
|
1401
|
+
cellId("0"),
|
|
1402
|
+
cellId("1"),
|
|
1403
|
+
cellId("2"),
|
|
1404
|
+
]);
|
|
1405
|
+
expect(state.cellData[cellId("0")].code).toBe("");
|
|
1406
|
+
expect(state.cellData[cellId("1")].code).toBe("");
|
|
1407
|
+
expect(state.cellData[cellId("2")].code).toBe("");
|
|
1401
1408
|
|
|
1402
1409
|
// Update cell 1
|
|
1403
1410
|
actions.setCellCodes({
|
|
1404
1411
|
codes: ["new code 2"],
|
|
1405
|
-
ids: ["1"]
|
|
1412
|
+
ids: [cellId("1")],
|
|
1406
1413
|
codeIsStale: false,
|
|
1407
1414
|
});
|
|
1408
1415
|
|
|
1409
|
-
expect(state.cellIds.inOrderIds).toEqual([
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1416
|
+
expect(state.cellIds.inOrderIds).toEqual([
|
|
1417
|
+
cellId("0"),
|
|
1418
|
+
cellId("1"),
|
|
1419
|
+
cellId("2"),
|
|
1420
|
+
]);
|
|
1421
|
+
expect(state.cellData[cellId("0")].code).toBe("");
|
|
1422
|
+
expect(state.cellData[cellId("1")].code).toBe("new code 2");
|
|
1423
|
+
expect(state.cellData[cellId("1")].edited).toBe(false);
|
|
1424
|
+
expect(state.cellData[cellId("2")].code).toBe("");
|
|
1414
1425
|
});
|
|
1415
1426
|
|
|
1416
1427
|
it("can set cell codes with new cell ids, while preserving the old cell data", () => {
|
|
1417
1428
|
actions.setCellCodes({
|
|
1418
1429
|
codes: ["code1", "code2", "code3"],
|
|
1419
|
-
ids: ["3", "4", "5"]
|
|
1430
|
+
ids: [cellId("3"), cellId("4"), cellId("5")],
|
|
1420
1431
|
codeIsStale: false,
|
|
1421
1432
|
});
|
|
1422
|
-
expect(state.cellData["3"
|
|
1423
|
-
expect(state.cellData["4"
|
|
1424
|
-
expect(state.cellData["5"
|
|
1433
|
+
expect(state.cellData[cellId("3")].code).toBe("code1");
|
|
1434
|
+
expect(state.cellData[cellId("4")].code).toBe("code2");
|
|
1435
|
+
expect(state.cellData[cellId("5")].code).toBe("code3");
|
|
1425
1436
|
|
|
1426
1437
|
// Update with some new cell ids and some old cell ids
|
|
1427
|
-
actions.setCellIds({
|
|
1438
|
+
actions.setCellIds({
|
|
1439
|
+
cellIds: [cellId("1"), cellId("2"), cellId("3"), cellId("4")],
|
|
1440
|
+
});
|
|
1428
1441
|
actions.setCellCodes({
|
|
1429
1442
|
codes: ["new1", "new2", "code1", "code2"],
|
|
1430
|
-
ids: ["1", "2", "3", "4"]
|
|
1443
|
+
ids: [cellId("1"), cellId("2"), cellId("3"), cellId("4")],
|
|
1431
1444
|
codeIsStale: false,
|
|
1432
1445
|
});
|
|
1433
|
-
expect(state.cellData["1"
|
|
1434
|
-
expect(state.cellData["2"
|
|
1435
|
-
expect(state.cellData["3"
|
|
1436
|
-
expect(state.cellData["4"
|
|
1437
|
-
expect(state.cellIds.inOrderIds).toEqual([
|
|
1446
|
+
expect(state.cellData[cellId("1")].code).toBe("new1");
|
|
1447
|
+
expect(state.cellData[cellId("2")].code).toBe("new2");
|
|
1448
|
+
expect(state.cellData[cellId("3")].code).toBe("code1");
|
|
1449
|
+
expect(state.cellData[cellId("4")].code).toBe("code2");
|
|
1450
|
+
expect(state.cellIds.inOrderIds).toEqual([
|
|
1451
|
+
cellId("1"),
|
|
1452
|
+
cellId("2"),
|
|
1453
|
+
cellId("3"),
|
|
1454
|
+
cellId("4"),
|
|
1455
|
+
]);
|
|
1438
1456
|
// Cell 5 data is preserved (possibly used for tracing), but it's not in the cellIds
|
|
1439
|
-
expect(state.cellData["5"
|
|
1457
|
+
expect(state.cellData[cellId("5")]).not.toBeUndefined();
|
|
1440
1458
|
});
|
|
1441
1459
|
|
|
1442
1460
|
it("can set cell codes with names and configs", () => {
|
|
1443
|
-
const newIds = ["3", "4"]
|
|
1461
|
+
const newIds = [cellId("3"), cellId("4")];
|
|
1444
1462
|
actions.setCellIds({ cellIds: newIds });
|
|
1445
1463
|
actions.setCellCodes({
|
|
1446
1464
|
codes: ["code1", "code2"],
|
|
@@ -1453,17 +1471,17 @@ describe("cell reducer", () => {
|
|
|
1453
1471
|
],
|
|
1454
1472
|
});
|
|
1455
1473
|
|
|
1456
|
-
expect(state.cellData["3"
|
|
1457
|
-
expect(state.cellData["3"
|
|
1458
|
-
expect(state.cellData["3"
|
|
1474
|
+
expect(state.cellData[cellId("3")].name).toBe("setup_cell");
|
|
1475
|
+
expect(state.cellData[cellId("3")].config.hide_code).toBe(true);
|
|
1476
|
+
expect(state.cellData[cellId("3")].config.disabled).toBe(false);
|
|
1459
1477
|
|
|
1460
|
-
expect(state.cellData["4"
|
|
1461
|
-
expect(state.cellData["4"
|
|
1462
|
-
expect(state.cellData["4"
|
|
1478
|
+
expect(state.cellData[cellId("4")].name).toBe("analysis");
|
|
1479
|
+
expect(state.cellData[cellId("4")].config.hide_code).toBe(false);
|
|
1480
|
+
expect(state.cellData[cellId("4")].config.disabled).toBe(true);
|
|
1463
1481
|
});
|
|
1464
1482
|
|
|
1465
1483
|
it("can set cell codes without names/configs (backward compat)", () => {
|
|
1466
|
-
const newIds = ["3"]
|
|
1484
|
+
const newIds = [cellId("3")];
|
|
1467
1485
|
actions.setCellIds({ cellIds: newIds });
|
|
1468
1486
|
actions.setCellCodes({
|
|
1469
1487
|
codes: ["code1"],
|
|
@@ -1472,9 +1490,9 @@ describe("cell reducer", () => {
|
|
|
1472
1490
|
});
|
|
1473
1491
|
|
|
1474
1492
|
// Should use defaults when names/configs not provided
|
|
1475
|
-
expect(state.cellData["3"
|
|
1476
|
-
expect(state.cellData["3"
|
|
1477
|
-
expect(state.cellData["3"
|
|
1493
|
+
expect(state.cellData[cellId("3")].code).toBe("code1");
|
|
1494
|
+
expect(state.cellData[cellId("3")].config.hide_code).toBe(false);
|
|
1495
|
+
expect(state.cellData[cellId("3")].config.disabled).toBe(false);
|
|
1478
1496
|
});
|
|
1479
1497
|
|
|
1480
1498
|
it("can update names and configs on existing cells via setCellCodes", () => {
|
|
@@ -1521,12 +1539,12 @@ describe("cell reducer", () => {
|
|
|
1521
1539
|
it("can collapse and expand cells", () => {
|
|
1522
1540
|
actions.createNewCell({ cellId: firstCellId, before: false });
|
|
1523
1541
|
actions.createNewCell({
|
|
1524
|
-
cellId: "1"
|
|
1542
|
+
cellId: cellId("1"),
|
|
1525
1543
|
before: false,
|
|
1526
1544
|
code: "# Header",
|
|
1527
1545
|
});
|
|
1528
1546
|
actions.createNewCell({
|
|
1529
|
-
cellId: "2"
|
|
1547
|
+
cellId: cellId("2"),
|
|
1530
1548
|
before: false,
|
|
1531
1549
|
code: "## Subheader",
|
|
1532
1550
|
});
|
|
@@ -1549,25 +1567,25 @@ describe("cell reducer", () => {
|
|
|
1549
1567
|
it("can collapse and expand all cells in multiple columns", () => {
|
|
1550
1568
|
actions.createNewCell({ cellId: firstCellId, before: false });
|
|
1551
1569
|
actions.createNewCell({
|
|
1552
|
-
cellId: "1"
|
|
1570
|
+
cellId: cellId("1"),
|
|
1553
1571
|
before: false,
|
|
1554
1572
|
code: "# First Column Header",
|
|
1555
1573
|
});
|
|
1556
1574
|
actions.createNewCell({
|
|
1557
|
-
cellId: "2"
|
|
1575
|
+
cellId: cellId("2"),
|
|
1558
1576
|
before: false,
|
|
1559
1577
|
code: "## First Column Subheader",
|
|
1560
1578
|
});
|
|
1561
1579
|
|
|
1562
|
-
actions.addColumnBreakpoint({ cellId: "2"
|
|
1580
|
+
actions.addColumnBreakpoint({ cellId: cellId("2") });
|
|
1563
1581
|
|
|
1564
1582
|
actions.createNewCell({
|
|
1565
|
-
cellId: "3"
|
|
1583
|
+
cellId: cellId("3"),
|
|
1566
1584
|
before: false,
|
|
1567
1585
|
code: "# Second Column Header",
|
|
1568
1586
|
});
|
|
1569
1587
|
actions.createNewCell({
|
|
1570
|
-
cellId: "4"
|
|
1588
|
+
cellId: cellId("4"),
|
|
1571
1589
|
before: false,
|
|
1572
1590
|
code: "## Second Column Subheader",
|
|
1573
1591
|
});
|
|
@@ -1616,17 +1634,17 @@ describe("cell reducer", () => {
|
|
|
1616
1634
|
it("can collapse and expand nested cells in one call", () => {
|
|
1617
1635
|
actions.createNewCell({ cellId: firstCellId, before: false });
|
|
1618
1636
|
actions.createNewCell({
|
|
1619
|
-
cellId: "1"
|
|
1637
|
+
cellId: cellId("1"),
|
|
1620
1638
|
before: false,
|
|
1621
1639
|
code: "# Header",
|
|
1622
1640
|
});
|
|
1623
1641
|
actions.createNewCell({
|
|
1624
|
-
cellId: "2"
|
|
1642
|
+
cellId: cellId("2"),
|
|
1625
1643
|
before: false,
|
|
1626
1644
|
code: "## Subheader",
|
|
1627
1645
|
});
|
|
1628
1646
|
actions.createNewCell({
|
|
1629
|
-
cellId: "3"
|
|
1647
|
+
cellId: cellId("3"),
|
|
1630
1648
|
before: false,
|
|
1631
1649
|
code: "### Subsubheader",
|
|
1632
1650
|
});
|
|
@@ -1670,10 +1688,10 @@ describe("cell reducer", () => {
|
|
|
1670
1688
|
|
|
1671
1689
|
it("can show hidden cells", () => {
|
|
1672
1690
|
actions.createNewCell({ cellId: firstCellId, before: false });
|
|
1673
|
-
actions.createNewCell({ cellId: "1"
|
|
1691
|
+
actions.createNewCell({ cellId: cellId("1"), before: false });
|
|
1674
1692
|
actions.collapseCell({ cellId: firstCellId });
|
|
1675
1693
|
|
|
1676
|
-
actions.showCellIfHidden({ cellId: "1"
|
|
1694
|
+
actions.showCellIfHidden({ cellId: cellId("1") });
|
|
1677
1695
|
expect(state.cellIds.atOrThrow(FIRST_COLUMN).isCollapsed(firstCellId)).toBe(
|
|
1678
1696
|
false,
|
|
1679
1697
|
);
|
|
@@ -1748,8 +1766,8 @@ describe("cell reducer", () => {
|
|
|
1748
1766
|
|
|
1749
1767
|
it("can add a column breakpoint", () => {
|
|
1750
1768
|
actions.createNewCell({ cellId: firstCellId, before: false });
|
|
1751
|
-
actions.createNewCell({ cellId: "1"
|
|
1752
|
-
actions.createNewCell({ cellId: "2"
|
|
1769
|
+
actions.createNewCell({ cellId: cellId("1"), before: false });
|
|
1770
|
+
actions.createNewCell({ cellId: cellId("2"), before: false });
|
|
1753
1771
|
|
|
1754
1772
|
expect(state.cellIds.getColumns().length).toBe(1);
|
|
1755
1773
|
expect(formatCells(state)).toMatchInlineSnapshot(`
|
|
@@ -1764,7 +1782,7 @@ describe("cell reducer", () => {
|
|
|
1764
1782
|
"
|
|
1765
1783
|
`);
|
|
1766
1784
|
|
|
1767
|
-
actions.addColumnBreakpoint({ cellId: "2"
|
|
1785
|
+
actions.addColumnBreakpoint({ cellId: cellId("2") });
|
|
1768
1786
|
|
|
1769
1787
|
expect(state.cellIds.getColumns().length).toBe(2);
|
|
1770
1788
|
expect(formatCells(state)).toMatchInlineSnapshot(`
|
|
@@ -1782,23 +1800,29 @@ describe("cell reducer", () => {
|
|
|
1782
1800
|
`);
|
|
1783
1801
|
|
|
1784
1802
|
// Check that the cells are in the correct columns
|
|
1785
|
-
expect(state.cellIds.getColumns()[0].topLevelIds).toEqual([
|
|
1786
|
-
|
|
1803
|
+
expect(state.cellIds.getColumns()[0].topLevelIds).toEqual([
|
|
1804
|
+
cellId("0"),
|
|
1805
|
+
cellId("1"),
|
|
1806
|
+
]);
|
|
1807
|
+
expect(state.cellIds.getColumns()[1].topLevelIds).toEqual([
|
|
1808
|
+
cellId("2"),
|
|
1809
|
+
cellId("3"),
|
|
1810
|
+
]);
|
|
1787
1811
|
});
|
|
1788
1812
|
|
|
1789
1813
|
it("cannot add a column breakpoint before the first cell", () => {
|
|
1790
1814
|
expect(state.cellIds.getColumns().length).toBe(1);
|
|
1791
1815
|
actions.createNewCell({ cellId: firstCellId, before: false });
|
|
1792
|
-
actions.createNewCell({ cellId: "1"
|
|
1816
|
+
actions.createNewCell({ cellId: cellId("1"), before: false });
|
|
1793
1817
|
actions.addColumnBreakpoint({ cellId: firstCellId });
|
|
1794
1818
|
expect(state.cellIds.getColumns().length).toBe(1);
|
|
1795
1819
|
});
|
|
1796
1820
|
|
|
1797
1821
|
it("can delete a column", () => {
|
|
1798
1822
|
actions.createNewCell({ cellId: firstCellId, before: false });
|
|
1799
|
-
actions.createNewCell({ cellId: "1"
|
|
1800
|
-
actions.createNewCell({ cellId: "2"
|
|
1801
|
-
actions.addColumnBreakpoint({ cellId: "2"
|
|
1823
|
+
actions.createNewCell({ cellId: cellId("1"), before: false });
|
|
1824
|
+
actions.createNewCell({ cellId: cellId("2"), before: false });
|
|
1825
|
+
actions.addColumnBreakpoint({ cellId: cellId("2") });
|
|
1802
1826
|
|
|
1803
1827
|
expect(state.cellIds.getColumns().length).toBe(2);
|
|
1804
1828
|
expect(formatCells(state)).toMatchInlineSnapshot(`
|
|
@@ -1842,7 +1866,7 @@ describe("cell reducer", () => {
|
|
|
1842
1866
|
|
|
1843
1867
|
it("deleting the last column does nothing", () => {
|
|
1844
1868
|
actions.createNewCell({ cellId: firstCellId, before: false });
|
|
1845
|
-
actions.createNewCell({ cellId: "1"
|
|
1869
|
+
actions.createNewCell({ cellId: cellId("1"), before: false });
|
|
1846
1870
|
|
|
1847
1871
|
const initialState = { ...state };
|
|
1848
1872
|
|
|
@@ -1854,8 +1878,8 @@ describe("cell reducer", () => {
|
|
|
1854
1878
|
|
|
1855
1879
|
it("can drop a cell over another cell", () => {
|
|
1856
1880
|
actions.createNewCell({ cellId: firstCellId, before: false });
|
|
1857
|
-
actions.createNewCell({ cellId: "1"
|
|
1858
|
-
actions.createNewCell({ cellId: "2"
|
|
1881
|
+
actions.createNewCell({ cellId: cellId("1"), before: false });
|
|
1882
|
+
actions.createNewCell({ cellId: cellId("2"), before: false });
|
|
1859
1883
|
|
|
1860
1884
|
expect(formatCells(state)).toMatchInlineSnapshot(`
|
|
1861
1885
|
"
|
|
@@ -1870,8 +1894,8 @@ describe("cell reducer", () => {
|
|
|
1870
1894
|
`);
|
|
1871
1895
|
|
|
1872
1896
|
actions.dropCellOverCell({
|
|
1873
|
-
cellId: "0"
|
|
1874
|
-
overCellId: "3"
|
|
1897
|
+
cellId: cellId("0"),
|
|
1898
|
+
overCellId: cellId("3"),
|
|
1875
1899
|
});
|
|
1876
1900
|
|
|
1877
1901
|
expect(formatCells(state)).toMatchInlineSnapshot(`
|
|
@@ -1889,7 +1913,7 @@ describe("cell reducer", () => {
|
|
|
1889
1913
|
|
|
1890
1914
|
it("can drop a cell over a new column", () => {
|
|
1891
1915
|
actions.createNewCell({ cellId: firstCellId, before: false });
|
|
1892
|
-
actions.createNewCell({ cellId: "1"
|
|
1916
|
+
actions.createNewCell({ cellId: cellId("1"), before: false });
|
|
1893
1917
|
|
|
1894
1918
|
expect(state.cellIds.getColumns().length).toBe(1);
|
|
1895
1919
|
expect(formatCells(state)).toMatchInlineSnapshot(`
|
|
@@ -1902,7 +1926,7 @@ describe("cell reducer", () => {
|
|
|
1902
1926
|
"
|
|
1903
1927
|
`);
|
|
1904
1928
|
|
|
1905
|
-
actions.dropOverNewColumn({ cellId: "1"
|
|
1929
|
+
actions.dropOverNewColumn({ cellId: cellId("1") });
|
|
1906
1930
|
|
|
1907
1931
|
expect(state.cellIds.getColumns().length).toBe(2);
|
|
1908
1932
|
expect(formatCells(state)).toMatchInlineSnapshot(`
|
|
@@ -1918,15 +1942,18 @@ describe("cell reducer", () => {
|
|
|
1918
1942
|
`);
|
|
1919
1943
|
|
|
1920
1944
|
// Check that the cells are in the correct columns
|
|
1921
|
-
expect(state.cellIds.getColumns()[0].topLevelIds).toEqual([
|
|
1922
|
-
|
|
1945
|
+
expect(state.cellIds.getColumns()[0].topLevelIds).toEqual([
|
|
1946
|
+
cellId("0"),
|
|
1947
|
+
cellId("2"),
|
|
1948
|
+
]);
|
|
1949
|
+
expect(state.cellIds.getColumns()[1].topLevelIds).toEqual([cellId("1")]);
|
|
1923
1950
|
});
|
|
1924
1951
|
|
|
1925
1952
|
it("can drop a column over another column", () => {
|
|
1926
1953
|
actions.createNewCell({ cellId: firstCellId, before: false });
|
|
1927
|
-
actions.createNewCell({ cellId: "1"
|
|
1928
|
-
actions.createNewCell({ cellId: "2"
|
|
1929
|
-
actions.addColumnBreakpoint({ cellId: "2"
|
|
1954
|
+
actions.createNewCell({ cellId: cellId("1"), before: false });
|
|
1955
|
+
actions.createNewCell({ cellId: cellId("2"), before: false });
|
|
1956
|
+
actions.addColumnBreakpoint({ cellId: cellId("2") });
|
|
1930
1957
|
|
|
1931
1958
|
expect(state.cellIds.getColumns().length).toBe(2);
|
|
1932
1959
|
expect(formatCells(state)).toMatchInlineSnapshot(`
|
|
@@ -1964,17 +1991,23 @@ describe("cell reducer", () => {
|
|
|
1964
1991
|
`);
|
|
1965
1992
|
|
|
1966
1993
|
// Check that the columns have swapped positions
|
|
1967
|
-
expect(state.cellIds.getColumns()[0].topLevelIds).toEqual([
|
|
1968
|
-
|
|
1994
|
+
expect(state.cellIds.getColumns()[0].topLevelIds).toEqual([
|
|
1995
|
+
cellId("2"),
|
|
1996
|
+
cellId("3"),
|
|
1997
|
+
]);
|
|
1998
|
+
expect(state.cellIds.getColumns()[1].topLevelIds).toEqual([
|
|
1999
|
+
cellId("0"),
|
|
2000
|
+
cellId("1"),
|
|
2001
|
+
]);
|
|
1969
2002
|
});
|
|
1970
2003
|
|
|
1971
2004
|
it("can compact columns", () => {
|
|
1972
2005
|
// Create initial state with 3 columns, including an empty one
|
|
1973
2006
|
actions.createNewCell({ cellId: firstCellId, before: false });
|
|
1974
|
-
actions.createNewCell({ cellId: "1"
|
|
1975
|
-
actions.addColumnBreakpoint({ cellId: "1"
|
|
1976
|
-
actions.addColumnBreakpoint({ cellId: "2"
|
|
1977
|
-
actions.dropOverNewColumn({ cellId: "2"
|
|
2007
|
+
actions.createNewCell({ cellId: cellId("1"), before: false });
|
|
2008
|
+
actions.addColumnBreakpoint({ cellId: cellId("1") });
|
|
2009
|
+
actions.addColumnBreakpoint({ cellId: cellId("2") });
|
|
2010
|
+
actions.dropOverNewColumn({ cellId: cellId("2") });
|
|
1978
2011
|
|
|
1979
2012
|
expect(state.cellIds.getColumns().length).toBe(4);
|
|
1980
2013
|
expect(formatCells(state)).toMatchInlineSnapshot(`
|
|
@@ -1994,10 +2027,10 @@ describe("cell reducer", () => {
|
|
|
1994
2027
|
`);
|
|
1995
2028
|
|
|
1996
2029
|
// Check initial column structure
|
|
1997
|
-
expect(state.cellIds.getColumns()[0].topLevelIds).toEqual(["0"]);
|
|
1998
|
-
expect(state.cellIds.getColumns()[1].topLevelIds).toEqual(["1"]);
|
|
2030
|
+
expect(state.cellIds.getColumns()[0].topLevelIds).toEqual([cellId("0")]);
|
|
2031
|
+
expect(state.cellIds.getColumns()[1].topLevelIds).toEqual([cellId("1")]);
|
|
1999
2032
|
expect(state.cellIds.getColumns()[2].topLevelIds).toEqual([]);
|
|
2000
|
-
expect(state.cellIds.getColumns()[3].topLevelIds).toEqual(["2"]);
|
|
2033
|
+
expect(state.cellIds.getColumns()[3].topLevelIds).toEqual([cellId("2")]);
|
|
2001
2034
|
|
|
2002
2035
|
// Compact columns
|
|
2003
2036
|
actions.compactColumns();
|
|
@@ -2017,9 +2050,9 @@ describe("cell reducer", () => {
|
|
|
2017
2050
|
`);
|
|
2018
2051
|
|
|
2019
2052
|
// Check compacted column structure
|
|
2020
|
-
expect(state.cellIds.getColumns()[0].topLevelIds).toEqual(["0"]);
|
|
2021
|
-
expect(state.cellIds.getColumns()[1].topLevelIds).toEqual(["1"]);
|
|
2022
|
-
expect(state.cellIds.getColumns()[2].topLevelIds).toEqual(["2"]);
|
|
2053
|
+
expect(state.cellIds.getColumns()[0].topLevelIds).toEqual([cellId("0")]);
|
|
2054
|
+
expect(state.cellIds.getColumns()[1].topLevelIds).toEqual([cellId("1")]);
|
|
2055
|
+
expect(state.cellIds.getColumns()[2].topLevelIds).toEqual([cellId("2")]);
|
|
2023
2056
|
});
|
|
2024
2057
|
|
|
2025
2058
|
it("can clear output of a single cell", () => {
|
|
@@ -2406,7 +2439,7 @@ describe("cell reducer", () => {
|
|
|
2406
2439
|
const initialState = { ...state };
|
|
2407
2440
|
|
|
2408
2441
|
actions.moveToNextCell({
|
|
2409
|
-
cellId:
|
|
2442
|
+
cellId: SCRATCH_CELL_ID,
|
|
2410
2443
|
before: false,
|
|
2411
2444
|
noCreate: false,
|
|
2412
2445
|
});
|
|
@@ -2498,7 +2531,7 @@ describe("cell reducer", () => {
|
|
|
2498
2531
|
});
|
|
2499
2532
|
|
|
2500
2533
|
it("can mark a non-existent cell as touched without error", () => {
|
|
2501
|
-
const nonExistentCellId = "non-existent"
|
|
2534
|
+
const nonExistentCellId = cellId("non-existent");
|
|
2502
2535
|
|
|
2503
2536
|
expect(() => {
|
|
2504
2537
|
actions.markTouched({ cellId: nonExistentCellId });
|
|
@@ -2829,7 +2862,7 @@ describe("isCellCodeHidden", () => {
|
|
|
2829
2862
|
const firstCellId = state.cellIds.inOrderIds[0];
|
|
2830
2863
|
|
|
2831
2864
|
it("returns false when hide_code is false and cell is not untouched", () => {
|
|
2832
|
-
const testCellId = "test-cell"
|
|
2865
|
+
const testCellId = cellId("test-cell");
|
|
2833
2866
|
const testState: NotebookState = {
|
|
2834
2867
|
...state,
|
|
2835
2868
|
cellData: {
|
|
@@ -2849,7 +2882,7 @@ describe("isCellCodeHidden", () => {
|
|
|
2849
2882
|
});
|
|
2850
2883
|
|
|
2851
2884
|
it("returns true when hide_code is true and cell is not untouched", () => {
|
|
2852
|
-
const testCellId = "test-cell"
|
|
2885
|
+
const testCellId = cellId("test-cell");
|
|
2853
2886
|
const testState: NotebookState = {
|
|
2854
2887
|
...state,
|
|
2855
2888
|
cellData: {
|
|
@@ -2869,7 +2902,7 @@ describe("isCellCodeHidden", () => {
|
|
|
2869
2902
|
});
|
|
2870
2903
|
|
|
2871
2904
|
it("returns false when hide_code is true but cell is untouched", () => {
|
|
2872
|
-
const testCellId = "test-cell"
|
|
2905
|
+
const testCellId = cellId("test-cell");
|
|
2873
2906
|
const testState: NotebookState = {
|
|
2874
2907
|
...state,
|
|
2875
2908
|
cellData: {
|
|
@@ -2889,7 +2922,7 @@ describe("isCellCodeHidden", () => {
|
|
|
2889
2922
|
});
|
|
2890
2923
|
|
|
2891
2924
|
it("returns false when hide_code is false and cell is untouched", () => {
|
|
2892
|
-
const testCellId = "test-cell"
|
|
2925
|
+
const testCellId = cellId("test-cell");
|
|
2893
2926
|
const testState: NotebookState = {
|
|
2894
2927
|
...state,
|
|
2895
2928
|
cellData: {
|
|
@@ -2917,8 +2950,8 @@ describe("createTracebackInfoAtom", () => {
|
|
|
2917
2950
|
notebookAtom,
|
|
2918
2951
|
MockNotebook.notebookState({
|
|
2919
2952
|
cellData: {
|
|
2920
|
-
cell1: {
|
|
2921
|
-
id: "cell1"
|
|
2953
|
+
[cellId("cell1")]: {
|
|
2954
|
+
id: cellId("cell1"),
|
|
2922
2955
|
name: "cell1",
|
|
2923
2956
|
code: "",
|
|
2924
2957
|
},
|
|
@@ -2927,7 +2960,7 @@ describe("createTracebackInfoAtom", () => {
|
|
|
2927
2960
|
);
|
|
2928
2961
|
|
|
2929
2962
|
const tracebackAtom = exportedForTesting.createTracebackInfoAtom(
|
|
2930
|
-
"cell1"
|
|
2963
|
+
cellId("cell1"),
|
|
2931
2964
|
);
|
|
2932
2965
|
const traceback = store.get(tracebackAtom);
|
|
2933
2966
|
|
|
@@ -2939,10 +2972,14 @@ describe("createTracebackInfoAtom", () => {
|
|
|
2939
2972
|
notebookAtom,
|
|
2940
2973
|
MockNotebook.notebookState({
|
|
2941
2974
|
cellData: {
|
|
2942
|
-
|
|
2975
|
+
[cellId("cell1")]: {
|
|
2976
|
+
id: cellId("cell1"),
|
|
2977
|
+
name: "cell1",
|
|
2978
|
+
code: "x = 1",
|
|
2979
|
+
},
|
|
2943
2980
|
},
|
|
2944
2981
|
cellRuntime: {
|
|
2945
|
-
cell1: {
|
|
2982
|
+
[cellId("cell1")]: {
|
|
2946
2983
|
output: {
|
|
2947
2984
|
channel: "marimo-error",
|
|
2948
2985
|
data: [{ type: "syntax", msg: "Syntax error", lineno: 5 }],
|
|
@@ -2954,7 +2991,7 @@ describe("createTracebackInfoAtom", () => {
|
|
|
2954
2991
|
);
|
|
2955
2992
|
|
|
2956
2993
|
const tracebackAtom = exportedForTesting.createTracebackInfoAtom(
|
|
2957
|
-
"cell1"
|
|
2994
|
+
cellId("cell1"),
|
|
2958
2995
|
);
|
|
2959
2996
|
const traceback = store.get(tracebackAtom);
|
|
2960
2997
|
|
|
@@ -2962,7 +2999,7 @@ describe("createTracebackInfoAtom", () => {
|
|
|
2962
2999
|
expect(traceback).toHaveLength(1);
|
|
2963
3000
|
expect(traceback![0]).toEqual({
|
|
2964
3001
|
kind: "cell",
|
|
2965
|
-
cellId: "cell1",
|
|
3002
|
+
cellId: cellId("cell1"),
|
|
2966
3003
|
lineNumber: 5,
|
|
2967
3004
|
});
|
|
2968
3005
|
});
|
|
@@ -2972,10 +3009,14 @@ describe("createTracebackInfoAtom", () => {
|
|
|
2972
3009
|
notebookAtom,
|
|
2973
3010
|
MockNotebook.notebookState({
|
|
2974
3011
|
cellData: {
|
|
2975
|
-
|
|
3012
|
+
[cellId("cell1")]: {
|
|
3013
|
+
id: cellId("cell1"),
|
|
3014
|
+
name: "cell1",
|
|
3015
|
+
code: "x = 1",
|
|
3016
|
+
},
|
|
2976
3017
|
},
|
|
2977
3018
|
cellRuntime: {
|
|
2978
|
-
cell1: {
|
|
3019
|
+
[cellId("cell1")]: {
|
|
2979
3020
|
output: {
|
|
2980
3021
|
channel: "marimo-error",
|
|
2981
3022
|
data: [{ type: "syntax", msg: "Syntax error", lineno: 0 }],
|
|
@@ -2987,7 +3028,7 @@ describe("createTracebackInfoAtom", () => {
|
|
|
2987
3028
|
);
|
|
2988
3029
|
|
|
2989
3030
|
const tracebackAtom = exportedForTesting.createTracebackInfoAtom(
|
|
2990
|
-
"cell1"
|
|
3031
|
+
cellId("cell1"),
|
|
2991
3032
|
);
|
|
2992
3033
|
const traceback = store.get(tracebackAtom);
|
|
2993
3034
|
expect(traceback).toBeDefined();
|
|
@@ -3000,10 +3041,14 @@ describe("createTracebackInfoAtom", () => {
|
|
|
3000
3041
|
notebookAtom,
|
|
3001
3042
|
MockNotebook.notebookState({
|
|
3002
3043
|
cellData: {
|
|
3003
|
-
|
|
3044
|
+
[cellId("cell1")]: {
|
|
3045
|
+
id: cellId("cell1"),
|
|
3046
|
+
name: "cell1",
|
|
3047
|
+
code: "x = 1",
|
|
3048
|
+
},
|
|
3004
3049
|
},
|
|
3005
3050
|
cellRuntime: {
|
|
3006
|
-
cell1: {
|
|
3051
|
+
[cellId("cell1")]: {
|
|
3007
3052
|
output: {
|
|
3008
3053
|
channel: "marimo-error",
|
|
3009
3054
|
data: [{ type: "syntax", msg: "Syntax error", lineno: null }],
|
|
@@ -3015,7 +3060,7 @@ describe("createTracebackInfoAtom", () => {
|
|
|
3015
3060
|
);
|
|
3016
3061
|
|
|
3017
3062
|
const tracebackAtom = exportedForTesting.createTracebackInfoAtom(
|
|
3018
|
-
"cell1"
|
|
3063
|
+
cellId("cell1"),
|
|
3019
3064
|
);
|
|
3020
3065
|
const traceback = store.get(tracebackAtom);
|
|
3021
3066
|
|
|
@@ -3027,10 +3072,14 @@ describe("createTracebackInfoAtom", () => {
|
|
|
3027
3072
|
notebookAtom,
|
|
3028
3073
|
MockNotebook.notebookState({
|
|
3029
3074
|
cellData: {
|
|
3030
|
-
|
|
3075
|
+
[cellId("cell1")]: {
|
|
3076
|
+
id: cellId("cell1"),
|
|
3077
|
+
name: "cell1",
|
|
3078
|
+
code: "x = 1",
|
|
3079
|
+
},
|
|
3031
3080
|
},
|
|
3032
3081
|
cellRuntime: {
|
|
3033
|
-
cell1: {
|
|
3082
|
+
[cellId("cell1")]: {
|
|
3034
3083
|
output: {
|
|
3035
3084
|
channel: "marimo-error",
|
|
3036
3085
|
data: [
|
|
@@ -3045,7 +3094,7 @@ describe("createTracebackInfoAtom", () => {
|
|
|
3045
3094
|
);
|
|
3046
3095
|
|
|
3047
3096
|
const tracebackAtom = exportedForTesting.createTracebackInfoAtom(
|
|
3048
|
-
"cell1"
|
|
3097
|
+
cellId("cell1"),
|
|
3049
3098
|
);
|
|
3050
3099
|
const traceback = store.get(tracebackAtom);
|
|
3051
3100
|
expect(traceback).toBeDefined();
|
|
@@ -3059,10 +3108,14 @@ describe("createTracebackInfoAtom", () => {
|
|
|
3059
3108
|
notebookAtom,
|
|
3060
3109
|
MockNotebook.notebookState({
|
|
3061
3110
|
cellData: {
|
|
3062
|
-
|
|
3111
|
+
[cellId("cell1")]: {
|
|
3112
|
+
id: cellId("cell1"),
|
|
3113
|
+
name: "cell1",
|
|
3114
|
+
code: "x = 1",
|
|
3115
|
+
},
|
|
3063
3116
|
},
|
|
3064
3117
|
cellRuntime: {
|
|
3065
|
-
cell1: {
|
|
3118
|
+
[cellId("cell1")]: {
|
|
3066
3119
|
output: {
|
|
3067
3120
|
channel: "marimo-error",
|
|
3068
3121
|
data: [{ type: "syntax", msg: "Syntax error", lineno: 1 }],
|
|
@@ -3075,7 +3128,7 @@ describe("createTracebackInfoAtom", () => {
|
|
|
3075
3128
|
);
|
|
3076
3129
|
|
|
3077
3130
|
const tracebackAtom = exportedForTesting.createTracebackInfoAtom(
|
|
3078
|
-
"cell1"
|
|
3131
|
+
cellId("cell1"),
|
|
3079
3132
|
);
|
|
3080
3133
|
const traceback = store.get(tracebackAtom);
|
|
3081
3134
|
|
|
@@ -3087,10 +3140,14 @@ describe("createTracebackInfoAtom", () => {
|
|
|
3087
3140
|
notebookAtom,
|
|
3088
3141
|
MockNotebook.notebookState({
|
|
3089
3142
|
cellData: {
|
|
3090
|
-
|
|
3143
|
+
[cellId("cell1")]: {
|
|
3144
|
+
id: cellId("cell1"),
|
|
3145
|
+
name: "cell1",
|
|
3146
|
+
code: "x = 1",
|
|
3147
|
+
},
|
|
3091
3148
|
},
|
|
3092
3149
|
cellRuntime: {
|
|
3093
|
-
cell1: {
|
|
3150
|
+
[cellId("cell1")]: {
|
|
3094
3151
|
output: {
|
|
3095
3152
|
channel: "marimo-error",
|
|
3096
3153
|
data: [{ type: "syntax", msg: "Syntax error", lineno: 1 }],
|
|
@@ -3103,7 +3160,7 @@ describe("createTracebackInfoAtom", () => {
|
|
|
3103
3160
|
);
|
|
3104
3161
|
|
|
3105
3162
|
const tracebackAtom = exportedForTesting.createTracebackInfoAtom(
|
|
3106
|
-
"cell1"
|
|
3163
|
+
cellId("cell1"),
|
|
3107
3164
|
);
|
|
3108
3165
|
const traceback = store.get(tracebackAtom);
|
|
3109
3166
|
|