@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.
Files changed (386) hide show
  1. package/dist/assets/{CellStatus-CDSBsjjF.js → CellStatus-DX8MnBMk.js} +1 -1
  2. package/dist/assets/{ConnectedDataExplorerComponent-Buaffg3u.js → ConnectedDataExplorerComponent-7yXYooWG.js} +1 -1
  3. package/dist/assets/{DeferredRequestRegistry-O6RDJKs0.js → DeferredRequestRegistry-B8jPCuU1.js} +1 -1
  4. package/dist/assets/{ImperativeModal-qEtcJ95s.js → ImperativeModal-C3CD5-Aq.js} +1 -1
  5. package/dist/assets/JsonOutput-DqjAyzM8.js +46 -0
  6. package/dist/assets/{LazyAnyLanguageCodeMirror-m8w66E4s.js → LazyAnyLanguageCodeMirror-CcCHIX38.js} +2 -2
  7. package/dist/assets/{MarimoErrorOutput-az74f3Mp.js → MarimoErrorOutput-Dat_S09q.js} +5 -5
  8. package/dist/assets/RenderHTML-C7XM39M2.js +1 -0
  9. package/dist/assets/{add-cell-with-ai-DUn4LN4W.js → add-cell-with-ai-y2xroEGf.js} +9 -9
  10. package/dist/assets/{add-connection-dialog-CBz0AUVX.js → add-connection-dialog-QDBOmil3.js} +23 -23
  11. package/dist/assets/{agent-panel-u83dsDsM.js → agent-panel-DziFrEjJ.js} +6 -6
  12. package/dist/assets/ai-model-dropdown-CiJpv5wN.js +5 -0
  13. package/dist/assets/{alert-dialog-9WfvUF7e.js → alert-dialog-ebk_-wsU.js} +1 -1
  14. package/dist/assets/{any-language-editor-DwQMnAM3.js → any-language-editor-DZYnKlJB.js} +1 -1
  15. package/dist/assets/{app-config-button-rDu-lCIB.js → app-config-button-CpAv9Tiu.js} +1 -1
  16. package/dist/assets/{architectureDiagram-VXUJARFQ-DfMHHFZ3.js → architectureDiagram-VXUJARFQ-DKmk99ac.js} +1 -1
  17. package/dist/assets/{azure-BTXHztTw.js → azure-Dw5gKmUz.js} +1 -1
  18. package/dist/assets/{blockDiagram-VD42YOAC-CuEDwbg7.js → blockDiagram-VD42YOAC-TpAhP5OQ.js} +1 -1
  19. package/dist/assets/{c4Diagram-YG6GDRKO-CD9uz7WG.js → c4Diagram-YG6GDRKO-Dg8hCyKf.js} +1 -1
  20. package/dist/assets/{cache-panel-qIxnndwr.js → cache-panel-D0OsHk_D.js} +1 -1
  21. package/dist/assets/cell-editor-RbAVpSFb.js +22 -0
  22. package/dist/assets/{cell-link-Q_UEP94Z.js → cell-link-CNgO3c-T.js} +1 -1
  23. package/dist/assets/{cells-fq1RMGX_.js → cells-39RE4UzS.js} +77 -76
  24. package/dist/assets/channel-D1wPYhc9.js +1 -0
  25. package/dist/assets/{chat-display-D_Fuuy6r.js → chat-display-BPUVrlA6.js} +1 -1
  26. package/dist/assets/{chat-panel-BO-JoQSp.js → chat-panel-esz5TfF-.js} +2 -2
  27. package/dist/assets/{chunk-5FQGJX7Z-CM1a_K7I.js → chunk-5FQGJX7Z-sGWxL7Ey.js} +3 -3
  28. package/dist/assets/{chunk-ABZYJK2D-D_Wumzom.js → chunk-ABZYJK2D-DXJ7hnjx.js} +1 -1
  29. package/dist/assets/{chunk-ATLVNIR6-BZ0lTgIn.js → chunk-ATLVNIR6-CTEqcLEc.js} +1 -1
  30. package/dist/assets/{chunk-B4BG7PRW-Dw1S6osV.js → chunk-B4BG7PRW-CkAIqtPf.js} +1 -1
  31. package/dist/assets/{chunk-DI55MBZ5-Q63FTCPP.js → chunk-DI55MBZ5-C4F9vu8o.js} +1 -1
  32. package/dist/assets/{chunk-EXTU4WIE-CfkJ_R7W.js → chunk-EXTU4WIE-BT0Py-4P.js} +1 -1
  33. package/dist/assets/{chunk-JA3XYJ7Z-B41fGeoj.js → chunk-JA3XYJ7Z-CGd7jja_.js} +1 -1
  34. package/dist/assets/{chunk-JZLCHNYA-D43EJxQw.js → chunk-JZLCHNYA-CqY-RYTj.js} +1 -1
  35. package/dist/assets/{chunk-N4CR4FBY-DCtw0-ni.js → chunk-N4CR4FBY-aUDjVzN7.js} +2 -2
  36. package/dist/assets/{chunk-QN33PNHL-CLA2rsaS.js → chunk-QN33PNHL-DHnCb5-U.js} +1 -1
  37. package/dist/assets/{chunk-QXUST7PY-De1DpbnL.js → chunk-QXUST7PY-CRO5kYCE.js} +1 -1
  38. package/dist/assets/{chunk-S3R3BYOJ-qrwvlUdq.js → chunk-S3R3BYOJ-CSHQgcuP.js} +1 -1
  39. package/dist/assets/{chunk-TZMSLE5B-C4KcThb0.js → chunk-TZMSLE5B-CE7o9asH.js} +1 -1
  40. package/dist/assets/classDiagram-2ON5EDUG-BDIQSKYv.js +1 -0
  41. package/dist/assets/classDiagram-v2-WZHVMYZB-Cdh4cVOB.js +1 -0
  42. package/dist/assets/{code-block-37QAKDTI-D4FF4cnN.js → code-block-37QAKDTI-DMpe1jNG.js} +1 -1
  43. package/dist/assets/{column-preview-WsubyItX.js → column-preview-BUKHsglA.js} +1 -1
  44. package/dist/assets/{command-rfxSsiHU.js → command-DmzEbs6L.js} +1 -1
  45. package/dist/assets/{command-palette-Bez4BqJF.js → command-palette-BX5gNpUr.js} +1 -1
  46. package/dist/assets/{common-BYwO983A.js → common-B4yshY-H.js} +1 -1
  47. package/dist/assets/{components-Ozq0825a.js → components-DCqJqyys.js} +1 -1
  48. package/dist/assets/{components-Bpgzv_5_.js → components-oKCjx6cN.js} +1 -1
  49. package/dist/assets/{config-3Aq84phF.js → config-DqxNMQDN.js} +1 -1
  50. package/dist/assets/{context-CIAP2NOh.js → context-CRmPPhx9.js} +1 -1
  51. package/dist/assets/{context-aware-panel-CfsfBlhO.js → context-aware-panel-DC0Te9Hj.js} +2 -2
  52. package/dist/assets/copy-KjcPgPw9.js +1 -0
  53. package/dist/assets/{copy-icon-BgmMM9Zg.js → copy-icon-P0kzz1Pr.js} +1 -1
  54. package/dist/assets/{dagre-6UL2VRFP-BhMnPhuU.js → dagre-6UL2VRFP-XqoNLMQ3.js} +1 -1
  55. package/dist/assets/{data-grid-overlay-editor-kbv73SQ7.js → data-grid-overlay-editor-Cus1-BFN.js} +1 -1
  56. package/dist/assets/{datasource-F9sJtuof.js → datasource-DKHG39NV.js} +2 -2
  57. package/dist/assets/{dates-CHaNfieI.js → dates-CTqMeMGY.js} +1 -1
  58. package/dist/assets/{dependency-graph-panel-AOBcX2tP.js → dependency-graph-panel-7GKT3dyD.js} +4 -4
  59. package/dist/assets/{diagram-PSM6KHXK-Cr2t4zul.js → diagram-PSM6KHXK-BuzKNNcN.js} +1 -1
  60. package/dist/assets/{diagram-QEK2KX5R-DLU_hSO4.js → diagram-QEK2KX5R-A5LBQS11.js} +1 -1
  61. package/dist/assets/{diagram-S2PKOQOG-C7EkNAO3.js → diagram-S2PKOQOG-dkJE8SA0.js} +1 -1
  62. package/dist/assets/{dialog-CVN1lcMF.js → dialog-1_jIyAb_.js} +1 -1
  63. package/dist/assets/{dist-DJBpXGro.js → dist-6P6vjf93.js} +1 -1
  64. package/dist/assets/dist-BWGxTsTP.js +1 -0
  65. package/dist/assets/{dist-CblX3KGI.js → dist-B_buFm3B.js} +1 -1
  66. package/dist/assets/{dist-CXLJUPFl.js → dist-BatEf-0f.js} +1 -1
  67. package/dist/assets/dist-C3AnARPE.js +1 -0
  68. package/dist/assets/{dist-BNC_tnlW.js → dist-C6ohaMKU.js} +1 -1
  69. package/dist/assets/{dist-BoDHthoc.js → dist-CO9Pg2Rc.js} +1 -1
  70. package/dist/assets/{dist-By6zhkxZ.js → dist-CSV6H5w_.js} +1 -1
  71. package/dist/assets/{dist-6FIAeDIu.js → dist-CYs1oP7g.js} +1 -1
  72. package/dist/assets/{dist-DbK_4_qo.js → dist-DD9ZJMK5.js} +1 -1
  73. package/dist/assets/{dist-DlTbNRBn.js → dist-DReDpc2z.js} +1 -1
  74. package/dist/assets/dist-DSlq5ZeQ.js +1 -0
  75. package/dist/assets/{dist-DrceDAhM.js → dist-DXyIIB32.js} +1 -1
  76. package/dist/assets/{dist-CcGcwrUD.js → dist-DkaderFA.js} +1 -1
  77. package/dist/assets/{dist-BiZQlfhr.js → dist-Dq3BlK4R.js} +1 -1
  78. package/dist/assets/{dist-ClzRAVN-.js → dist-Dxov2ltb.js} +1 -1
  79. package/dist/assets/{dist-BXXPfIam.js → dist-EtGG9C1A.js} +1 -1
  80. package/dist/assets/{dist-C3MmXcLA.js → dist-NjId5Gdz.js} +1 -1
  81. package/dist/assets/dist-ZM59OWYL.js +1 -0
  82. package/dist/assets/dist-_TwZ4tIe.js +1 -0
  83. package/dist/assets/dist-f9b2H4q_.js +1 -0
  84. package/dist/assets/{dist-mxGLXOFm.js → dist-feWVQ4dq.js} +1 -1
  85. package/dist/assets/{documentation-panel-D28MpqbI.js → documentation-panel-D5d_BbHV.js} +1 -1
  86. package/dist/assets/{download-B9_ToVd4.js → download-B1vXaivj.js} +4 -4
  87. package/dist/assets/{dropdown-menu-DdPu5Kfu.js → dropdown-menu-BehqiLFL.js} +1 -1
  88. package/dist/assets/{edit-page-otS-QvnC.js → edit-page-B5cAZdO7.js} +7 -7
  89. package/dist/assets/{en-US-BO8E69bZ.js → en-US-f8tajDx1.js} +1 -1
  90. package/dist/assets/{erDiagram-Q2GNP2WA-DqlEo_Us.js → erDiagram-Q2GNP2WA-CgH6udOW.js} +1 -1
  91. package/dist/assets/{error-banner-BRG6IPhC.js → error-banner-J5F3weEj.js} +1 -1
  92. package/dist/assets/{error-panel-RRoj_iOR.js → error-panel-DnhKJ5Ou.js} +1 -1
  93. package/dist/assets/{es-CzkousWe.js → es-DYI7U61K.js} +1 -1
  94. package/dist/assets/{esm-CBkHtTOV.js → esm-BC1J92im.js} +1 -1
  95. package/dist/assets/{esm-DhTsVMLM.js → esm-DKLLCu3N.js} +1 -1
  96. package/dist/assets/{field-B1jGbQlH.js → field-B08lvxnl.js} +1 -1
  97. package/dist/assets/file-explorer-panel-BUk69TND.js +26 -0
  98. package/dist/assets/{file-icons-CWLHDa1J.js → file-icons-3DTS8ZM7.js} +1 -1
  99. package/dist/assets/{floating-outline-BvQKiC0F.js → floating-outline-DmugATcB.js} +1 -1
  100. package/dist/assets/{flowDiagram-NV44I4VS-CQlIJ12H.js → flowDiagram-NV44I4VS-D85BL4rA.js} +1 -1
  101. package/dist/assets/{focus-DYwTiH9-.js → focus-DlJH7sfh.js} +1 -1
  102. package/dist/assets/{form-CrQYrsUC.js → form-760_EqmF.js} +2 -2
  103. package/dist/assets/{formats-rhOJovGE.js → formats-wYuh1bqp.js} +1 -1
  104. package/dist/assets/{formatting-B4ZCH3ol.js → formatting-CraOPe94.js} +1 -1
  105. package/dist/assets/{gallery-page-eRea0yic.js → gallery-page--paiPvYX.js} +1 -1
  106. package/dist/assets/{ganttDiagram-JELNMOA3-B3EGIuZL.js → ganttDiagram-JELNMOA3-DzCOXWlF.js} +1 -1
  107. package/dist/assets/{gitGraphDiagram-V2S2FVAM-h5SlguJK.js → gitGraphDiagram-V2S2FVAM-BUHURX6t.js} +1 -1
  108. package/dist/assets/{glide-data-editor-xt5xNZeV.js → glide-data-editor-DYdoQTO5.js} +4 -4
  109. package/dist/assets/{globals-BsV5fVR-.js → globals-7M5DRsIb.js} +1 -1
  110. package/dist/assets/home-page-CxQ1e98h.js +4 -0
  111. package/dist/assets/{hooks-CHx5dUUq.js → hooks-C3jEff2O.js} +1 -1
  112. package/dist/assets/html-to-image-DTFXm6_Z.js +2 -0
  113. package/dist/assets/{index-GjXovVsl.css → index-BmoocKR0.css} +1 -1
  114. package/dist/assets/index-DNchElHl.js +38 -0
  115. package/dist/assets/{infoDiagram-HS3SLOUP-pzpClObZ.js → infoDiagram-HS3SLOUP-GG5r0Y5G.js} +1 -1
  116. package/dist/assets/{input-CUwqpKjd.js → input-CN1ZeRYm.js} +1 -1
  117. package/dist/assets/{isValid-BGe7pJXT.js → isValid-DY4Mgbr7.js} +1 -1
  118. package/dist/assets/{journeyDiagram-XKPGCS4Q-BrdRi92v.js → journeyDiagram-XKPGCS4Q-B1dvnV4D.js} +1 -1
  119. package/dist/assets/{kanban-definition-3W4ZIXB7-B6WqgFqh.js → kanban-definition-3W4ZIXB7-CefbrXQv.js} +1 -1
  120. package/dist/assets/{kiosk-mode-DNjEnIWb.js → kiosk-mode-CyTnrzwK.js} +1 -1
  121. package/dist/assets/{layout-CwFtCyW8.js → layout-3b3tzmbb.js} +3 -3
  122. package/dist/assets/{linear-BP9rwmWK.js → linear-BDnrHGYO.js} +1 -1
  123. package/dist/assets/{links-CIQwYQ48.js → links-CptYD1FP.js} +1 -1
  124. package/dist/assets/{logs-panel-BU1tNEVc.js → logs-panel-C4k_2IHW.js} +1 -1
  125. package/dist/assets/{markdown-renderer-MR9df58W.js → markdown-renderer-DSy5IuAx.js} +1 -1
  126. package/dist/assets/{menu-items-UxKrm8hS.js → menu-items-BpHXKv51.js} +1 -1
  127. package/dist/assets/mermaid-4DMBBIKO-g7AL4SLJ.js +1 -0
  128. package/dist/assets/{mermaid-Djr3jUAB.js → mermaid-C43VbdrM.js} +3 -3
  129. package/dist/assets/{mermaid-parser.core-DR82IMb2.js → mermaid-parser.core-CdM8D_p_.js} +1 -1
  130. package/dist/assets/{mindmap-definition-VGOIOE7T-DAmJpbPM.js → mindmap-definition-VGOIOE7T-CcV7D-wF.js} +1 -1
  131. package/dist/assets/{mode-AcL8c6qH.js → mode-D-iRbN9x.js} +1 -1
  132. package/dist/assets/{multi-map-Pp1P2DOX.js → multi-map-C8RbwBrw.js} +1 -1
  133. package/dist/assets/{name-cell-input-DVFEv_aO.js → name-cell-input-Dyb0ZO4X.js} +1 -1
  134. package/dist/assets/{number-overlay-editor-D__AflXQ.js → number-overlay-editor-BBJO1mf8.js} +1 -1
  135. package/dist/assets/{outline-panel-CP0oIuiU.js → outline-panel-D7CJwO8u.js} +1 -1
  136. package/dist/assets/{packages-panel-CzRELimG.js → packages-panel-Bp1SYjgc.js} +1 -1
  137. package/dist/assets/{panels-wTweRyIv.js → panels-D0aw6jdc.js} +1 -1
  138. package/dist/assets/{pieDiagram-ADFJNKIX-DbGIFRoq.js → pieDiagram-ADFJNKIX-C1fBf15W.js} +1 -1
  139. package/dist/assets/{popover-BPGG2gPG.js → popover-Bvoif-Mg.js} +1 -1
  140. package/dist/assets/{precisionRound-BOmLQIKI.js → precisionRound-CCOoIlcP.js} +1 -1
  141. package/dist/assets/{process-output-CTVsT--B.js → process-output-BxPWHcIi.js} +1 -1
  142. package/dist/assets/{quadrantDiagram-AYHSOK5B-CLAtyple.js → quadrantDiagram-AYHSOK5B-RVooN-fX.js} +1 -1
  143. package/dist/assets/{react-vega-BZav_-2n.js → react-vega-BKRQSy0g.js} +1 -1
  144. package/dist/assets/react-vega-DXESF7qN.js +1 -0
  145. package/dist/assets/{readonly-python-code-DH-1xZGq.js → readonly-python-code-D95oshJa.js} +1 -1
  146. package/dist/assets/{renderShortcut-CnD1Dah5.js → renderShortcut-BYvKm38e.js} +1 -1
  147. package/dist/assets/{request-registry-B-7cIM_I.js → request-registry-XB2EzJHm.js} +1 -1
  148. package/dist/assets/{requirementDiagram-UZGBJVZJ-DDDTB1LD.js → requirementDiagram-UZGBJVZJ-DtqOYJpH.js} +1 -1
  149. package/dist/assets/{run-page-FCvGnICa.js → run-page-B7CASued.js} +1 -1
  150. package/dist/assets/{sankeyDiagram-TZEHDZUN-DAWPOfBw.js → sankeyDiagram-TZEHDZUN-DmcooLA8.js} +1 -1
  151. package/dist/assets/{scratchpad-panel-k9lrm-rC.js → scratchpad-panel-BIVRgYOU.js} +1 -1
  152. package/dist/assets/{secrets-panel-B1Z-6dmz.js → secrets-panel-C24hZEiO.js} +1 -1
  153. package/dist/assets/{select-CxT2Geqr.js → select-Cnd3vm9n.js} +1 -1
  154. package/dist/assets/{sequenceDiagram-WL72ISMW-D_qAidD2.js → sequenceDiagram-WL72ISMW-S2qeLb7J.js} +1 -1
  155. package/dist/assets/{session-panel-WhN0qilM.js → session-panel-CNabBHQm.js} +1 -1
  156. package/dist/assets/{share-BdH_5I58.js → share-NjpZ54PJ.js} +1 -1
  157. package/dist/assets/{snippets-panel-BCDHUuku.js → snippets-panel-D1JAeJj1.js} +1 -1
  158. package/dist/assets/{spec-DbmSqx09.js → spec-DnVBmJUh.js} +1 -1
  159. package/dist/assets/{state-Ce7CVShi.js → state-BagvlaEz.js} +1 -1
  160. package/dist/assets/{state-3V5UxC3B.js → state-Cz_wrzCz.js} +1 -1
  161. package/dist/assets/{state-CBmCYWFH.js → state-DMQXxemS.js} +1 -1
  162. package/dist/assets/{stateDiagram-FKZM4ZOC-C7qgDrGA.js → stateDiagram-FKZM4ZOC-uuQ60pIl.js} +1 -1
  163. package/dist/assets/stateDiagram-v2-4FDKWEC3-D-GWhQTG.js +1 -0
  164. package/dist/assets/stex-CruVQx-P.js +1 -0
  165. package/dist/assets/{switch-CVKxYu_0.js → switch-Bwpd2AFq.js} +1 -1
  166. package/dist/assets/{terminal-Cr7wbEjz.js → terminal-Gl8Fi44y.js} +1 -1
  167. package/dist/assets/{time-D2GKc0U6.js → time-Bw8f15NM.js} +1 -1
  168. package/dist/assets/{timeline-definition-IT6M3QCI-hd6uJKGs.js → timeline-definition-IT6M3QCI-TKWeDnSQ.js} +1 -1
  169. package/dist/assets/{toggle-RCwU-rnE.js → toggle-C_gNjXg8.js} +1 -1
  170. package/dist/assets/{tooltip-D9723Brr.js → tooltip-CR_izE8Q.js} +1 -1
  171. package/dist/assets/tracing-DwAC7DWN.js +1 -0
  172. package/dist/assets/tracing-panel-D1iNgclL.js +2 -0
  173. package/dist/assets/{tree-Ch2-GuhG.js → tree-WVrWjdwv.js} +3 -3
  174. package/dist/assets/{useAddCell-YC7rpcmD.js → useAddCell-D6Q7JziZ.js} +1 -1
  175. package/dist/assets/{useBoolean-m1e6E3Ao.js → useBoolean-CrltYVhE.js} +1 -1
  176. package/dist/assets/{useCellActionButton-GUb2fXU8.js → useCellActionButton-B2G9OaX9.js} +1 -1
  177. package/dist/assets/{useDateFormatter-CpE7XQLs.js → useDateFormatter-DOoVZUts.js} +1 -1
  178. package/dist/assets/{useDeleteCell-DRUDRiy0.js → useDeleteCell-d8veThW7.js} +1 -1
  179. package/dist/assets/{useDependencyPanelTab-nFVMlEx0.js → useDependencyPanelTab-B3iIj3MO.js} +1 -1
  180. package/dist/assets/{useInstallPackage-C9V-on2J.js → useInstallPackage-CQEr5429.js} +1 -1
  181. package/dist/assets/{useNotebookActions-ChLHy-0O.js → useNotebookActions-SAEOWcBo.js} +1 -1
  182. package/dist/assets/{useNumberFormatter-DbDKSvEd.js → useNumberFormatter-BXZcbTzH.js} +1 -1
  183. package/dist/assets/{usePress-BHGkpw8X.js → usePress-alQ5Crny.js} +1 -1
  184. package/dist/assets/{useRunCells-5m6jCnyo.js → useRunCells-Dhl8ZTGh.js} +1 -1
  185. package/dist/assets/{useSplitCell-DGD9smMq.js → useSplitCell-BSnFazbH.js} +1 -1
  186. package/dist/assets/{utils-CdjCA1J8.js → utils-C24l2A1T.js} +1 -1
  187. package/dist/assets/{vega-component-CRbeDmeM.js → vega-component-9Pf4pVZL.js} +1 -1
  188. package/dist/assets/{vega-loader.browser-CZV6_g2i.js → vega-loader.browser-BJ9oKrvH.js} +1 -1
  189. package/dist/assets/{write-secret-modal-BCvuRAFb.js → write-secret-modal-BFCsWMoW.js} +1 -1
  190. package/dist/assets/{xychartDiagram-PRI3JC2R-CXlUBSbQ.js → xychartDiagram-PRI3JC2R-CIp-yeSa.js} +1 -1
  191. package/dist/index.html +125 -125
  192. package/package.json +1 -1
  193. package/src/__mocks__/notebook.ts +9 -9
  194. package/src/__tests__/branded.ts +20 -0
  195. package/src/components/app-config/user-config-form.tsx +5 -4
  196. package/src/components/data-table/__tests__/utils.test.ts +138 -1
  197. package/src/components/data-table/charts/__tests__/storage.test.ts +7 -7
  198. package/src/components/data-table/context-menu.tsx +9 -5
  199. package/src/components/data-table/data-table.tsx +3 -0
  200. package/src/components/data-table/range-focus/__tests__/atoms.test.ts +8 -2
  201. package/src/components/data-table/range-focus/__tests__/test-utils.ts +2 -0
  202. package/src/components/data-table/range-focus/__tests__/utils.test.ts +82 -8
  203. package/src/components/data-table/range-focus/atoms.ts +2 -2
  204. package/src/components/data-table/range-focus/utils.ts +50 -12
  205. package/src/components/data-table/types.ts +7 -0
  206. package/src/components/data-table/utils.ts +87 -0
  207. package/src/components/editor/__tests__/data-attributes.test.tsx +8 -8
  208. package/src/components/editor/ai/__tests__/completion-utils.test.ts +15 -15
  209. package/src/components/editor/navigation/__tests__/clipboard.test.ts +2 -2
  210. package/src/components/editor/navigation/__tests__/selection.test.ts +7 -6
  211. package/src/components/editor/navigation/__tests__/state.test.ts +8 -7
  212. package/src/components/editor/output/MarimoErrorOutput.tsx +7 -7
  213. package/src/components/editor/output/__tests__/traceback.test.tsx +4 -4
  214. package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +4 -4
  215. package/src/components/editor/renderers/vertical-layout/useFocusFirstEditor.ts +8 -1
  216. package/src/components/storage/storage-file-viewer.tsx +35 -1
  217. package/src/components/storage/storage-inspector.tsx +9 -4
  218. package/src/components/storage/storage-snippets.ts +3 -3
  219. package/src/components/tracing/tracing.tsx +3 -1
  220. package/src/components/ui/range-slider.tsx +108 -1
  221. package/src/core/ai/__tests__/staged-cells.test.ts +9 -8
  222. package/src/core/ai/context/providers/__tests__/cell-output.test.ts +31 -31
  223. package/src/core/ai/context/providers/__tests__/datasource.test.ts +3 -3
  224. package/src/core/ai/context/providers/__tests__/tables.test.ts +3 -2
  225. package/src/core/ai/context/providers/__tests__/variable.test.ts +84 -63
  226. package/src/core/ai/tools/__tests__/edit-notebook-tool.test.ts +10 -9
  227. package/src/core/ai/tools/__tests__/run-cells-tool.test.ts +6 -6
  228. package/src/core/ai/tools/edit-notebook-tool.ts +3 -3
  229. package/src/core/cells/__tests__/add-missing-import.test.ts +3 -3
  230. package/src/core/cells/__tests__/cells.test.ts +192 -135
  231. package/src/core/cells/__tests__/focus.test.ts +5 -4
  232. package/src/core/cells/__tests__/logs.test.ts +13 -12
  233. package/src/core/cells/__tests__/pending-delete-service.test.tsx +3 -3
  234. package/src/core/cells/__tests__/runs.test.ts +22 -21
  235. package/src/core/cells/__tests__/scrollCellIntoView.test.ts +8 -7
  236. package/src/core/cells/__tests__/session.test.ts +23 -22
  237. package/src/core/cells/cells.ts +1 -1
  238. package/src/core/cells/ids.ts +5 -5
  239. package/src/core/cells/logs.ts +2 -2
  240. package/src/core/cells/runs.ts +6 -8
  241. package/src/core/codemirror/__tests__/format.test.ts +34 -36
  242. package/src/core/codemirror/__tests__/setup.test.ts +2 -2
  243. package/src/core/codemirror/cells/__tests__/extensions.test.ts +114 -0
  244. package/src/core/codemirror/cells/__tests__/traceback-decorations.test.ts +33 -32
  245. package/src/core/codemirror/cells/extensions.ts +66 -23
  246. package/src/core/codemirror/completion/__tests__/keymap.test.ts +15 -35
  247. package/src/core/codemirror/completion/keymap.ts +14 -4
  248. package/src/core/codemirror/copilot/__tests__/getCodes.test.ts +12 -13
  249. package/src/core/codemirror/language/__tests__/utils.test.ts +3 -3
  250. package/src/core/codemirror/language/embedded/__tests__/embedded-python.test.ts +7 -8
  251. package/src/core/codemirror/language/languages/python.ts +4 -0
  252. package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +4 -3
  253. package/src/core/codemirror/lsp/notebook-lsp.ts +28 -2
  254. package/src/core/codemirror/reactive-references/__tests__/analyzer.test.ts +7 -6
  255. package/src/core/codemirror/reactive-references/analyzer.ts +2 -2
  256. package/src/core/codemirror/rtc/loro/__tests__/sync.test.ts +52 -0
  257. package/src/core/codemirror/rtc/loro/sync.ts +1 -0
  258. package/src/core/datasets/__tests__/data-source.test.ts +5 -6
  259. package/src/core/datasets/state.ts +1 -1
  260. package/src/core/errors/__tests__/errors.test.ts +2 -1
  261. package/src/core/export/__tests__/hooks.test.ts +37 -36
  262. package/src/core/islands/main.ts +2 -7
  263. package/src/core/kernel/__tests__/handlers.test.ts +5 -4
  264. package/src/core/kernel/handlers.ts +7 -4
  265. package/src/core/network/DeferredRequestRegistry.ts +2 -2
  266. package/src/core/network/__tests__/CachingRequestRegistry.test.ts +9 -10
  267. package/src/core/network/__tests__/DeferredRequestRegistry.test.ts +4 -6
  268. package/src/core/static/__tests__/virtual-file-tracker.test.ts +8 -8
  269. package/src/core/static/virtual-file-tracker.ts +1 -1
  270. package/src/core/storage/__tests__/state.test.ts +31 -21
  271. package/src/core/storage/state.ts +1 -1
  272. package/src/core/variables/__tests__/state.test.ts +6 -6
  273. package/src/core/variables/types.ts +2 -2
  274. package/src/core/wasm/__tests__/state.test.ts +8 -8
  275. package/src/core/websocket/useMarimoKernelConnection.tsx +12 -15
  276. package/src/css/md-tooltip.css +4 -39
  277. package/src/css/md.css +7 -0
  278. package/src/plugins/core/RenderHTML.tsx +17 -0
  279. package/src/plugins/core/__test__/RenderHTML.test.ts +45 -0
  280. package/src/plugins/core/sanitize-html.ts +25 -18
  281. package/src/plugins/impl/DataTablePlugin.tsx +23 -2
  282. package/src/plugins/impl/SliderPlugin.tsx +1 -3
  283. package/src/plugins/impl/__tests__/SliderPlugin.test.tsx +120 -0
  284. package/src/plugins/impl/anywidget/model.ts +1 -2
  285. package/src/stories/cell.stories.tsx +8 -8
  286. package/src/stories/layout/vertical/one-column.stories.tsx +9 -8
  287. package/src/stories/log-viewer.stories.tsx +8 -8
  288. package/src/stories/variables.stories.tsx +2 -2
  289. package/src/utils/__tests__/download.test.tsx +21 -20
  290. package/src/utils/copy.ts +18 -5
  291. package/src/utils/download.ts +4 -3
  292. package/src/utils/html-to-image.ts +6 -0
  293. package/src/utils/json/base64.ts +3 -3
  294. package/src/utils/traceback.ts +5 -3
  295. package/dist/assets/JsonOutput-DKXKGKvX.js +0 -46
  296. package/dist/assets/RenderHTML-DJ8khuob.js +0 -1
  297. package/dist/assets/ai-model-dropdown-DPTa_EpU.js +0 -5
  298. package/dist/assets/cell-editor-DX7IcqNr.js +0 -23
  299. package/dist/assets/channel-CkT8Qdo2.js +0 -1
  300. package/dist/assets/classDiagram-2ON5EDUG-BhMT_rTz.js +0 -1
  301. package/dist/assets/classDiagram-v2-WZHVMYZB-D-F4WEyb.js +0 -1
  302. package/dist/assets/copy-YwM0Pd7v.js +0 -1
  303. package/dist/assets/dist-BTqMkf4j.js +0 -1
  304. package/dist/assets/dist-DHw9sXeN.js +0 -1
  305. package/dist/assets/dist-Du0qZeXz.js +0 -1
  306. package/dist/assets/dist-a0FfbvMD.js +0 -1
  307. package/dist/assets/dist-cfkfP0ni.js +0 -1
  308. package/dist/assets/dist-pzQ9JG-p.js +0 -1
  309. package/dist/assets/file-explorer-panel-CB8vF5ob.js +0 -26
  310. package/dist/assets/home-page-itW0tRmv.js +0 -4
  311. package/dist/assets/html-to-image-BnSc-Wa0.js +0 -2
  312. package/dist/assets/index-0n92c_W7.js +0 -38
  313. package/dist/assets/mermaid-4DMBBIKO-PoHnhmy8.js +0 -1
  314. package/dist/assets/react-vega-Da-Ps9UW.js +0 -1
  315. package/dist/assets/stateDiagram-v2-4FDKWEC3-CEqeIlM0.js +0 -1
  316. package/dist/assets/stex-BBWVYm-R.js +0 -1
  317. package/dist/assets/tracing-DUVd0jtl.js +0 -1
  318. package/dist/assets/tracing-panel-CuTxPn_x.js +0 -2
  319. /package/dist/assets/{Combination-Cs9nbinQ.js → Combination-CSPK4t6z.js} +0 -0
  320. /package/dist/assets/{Deferred-BMfCOLaw.js → Deferred-CfyqLOPG.js} +0 -0
  321. /package/dist/assets/{SSRProvider-DC7ElCZZ.js → SSRProvider-CwqN9FWV.js} +0 -0
  322. /package/dist/assets/{badge-hTpPIsMT.js → badge-DImLVznf.js} +0 -0
  323. /package/dist/assets/{blob-CObhN-9g.js → blob-DgooIGjS.js} +0 -0
  324. /package/dist/assets/{bot-message-square-CK6eoGWy.js → bot-message-square-Dw41U6lL.js} +0 -0
  325. /package/dist/assets/{chart-no-axes-column-DV8gdCvH.js → chart-no-axes-column-a9XtWmzk.js} +0 -0
  326. /package/dist/assets/{check-BE0hEwVo.js → check-DZA_bRpw.js} +0 -0
  327. /package/dist/assets/{chevron-right-D0GQBpTb.js → chevron-right-CvVxySQk.js} +0 -0
  328. /package/dist/assets/{circle-check-gLIOLu8x.js → circle-check-CbaVeozR.js} +0 -0
  329. /package/dist/assets/{circle-play-DYGULlKZ.js → circle-play-DYn5nR6N.js} +0 -0
  330. /package/dist/assets/{circle-plus-CGG-gArM.js → circle-plus-nCze0-py.js} +0 -0
  331. /package/dist/assets/{clipboard-paste-DoYSN8Sv.js → clipboard-paste-EHXeKq9D.js} +0 -0
  332. /package/dist/assets/{code-xml-DwHPF_nL.js → code-xml-BlrJCgNZ.js} +0 -0
  333. /package/dist/assets/{copy-CkudG0Ej.js → copy-D6N1-xc1.js} +0 -0
  334. /package/dist/assets/{database-zap-DTWCDKdn.js → database-zap-BIGMFOfP.js} +0 -0
  335. /package/dist/assets/{defaultLocale-DK1MWd7f.js → defaultLocale-CGfP-Ye3.js} +0 -0
  336. /package/dist/assets/{defaultLocale-OkOxlkkM.js → defaultLocale-CuYNS33t.js} +0 -0
  337. /package/dist/assets/{dist-8UD0A5sU.js → dist-BF9S272t.js} +0 -0
  338. /package/dist/assets/{dist-apDpadc4.js → dist-Bk1itfBD.js} +0 -0
  339. /package/dist/assets/{dist-CQqv2gQL.js → dist-Dm11d0_A.js} +0 -0
  340. /package/dist/assets/{download-DBW9RXtT.js → download-nLboiTtW.js} +0 -0
  341. /package/dist/assets/{ellipsis-0_zJdF6H.js → ellipsis-d7eaKIFn.js} +0 -0
  342. /package/dist/assets/{ellipsis-vertical-CAB7tdza.js → ellipsis-vertical-DBQ5kWTo.js} +0 -0
  343. /package/dist/assets/{emotion-is-prop-valid.esm-D1keIaYa.js → emotion-is-prop-valid.esm-D7FeWASw.js} +0 -0
  344. /package/dist/assets/{errors-Bfogio62.js → errors-0IrrdfSG.js} +0 -0
  345. /package/dist/assets/{extends-DRbCSry7.js → extends-aq1t6BkR.js} +0 -0
  346. /package/dist/assets/{eye-off-vwi9L975.js → eye-off-CF3GmvXV.js} +0 -0
  347. /package/dist/assets/{file-DzHkbIdO.js → file-C-yMeaec.js} +0 -0
  348. /package/dist/assets/{file-headphone-B5q2Ow55.js → file-headphone-CPAP8asn.js} +0 -0
  349. /package/dist/assets/{file-plus-corner-lLQw9OnR.js → file-plus-corner-ks__N1mr.js} +0 -0
  350. /package/dist/assets/{github-BVtI-3F1.js → github-CRD4USKm.js} +0 -0
  351. /package/dist/assets/{image-DXfkah9d.js → image-CfyJzBP9.js} +0 -0
  352. /package/dist/assets/{link-Cf10mh3t.js → link-_dbp0XNB.js} +0 -0
  353. /package/dist/assets/{maps-OKerBHH8.js → maps-DQsjfyTy.js} +0 -0
  354. /package/dist/assets/{numbers-CYnquDho.js → numbers-Cno6K0UF.js} +0 -0
  355. /package/dist/assets/{objectWithoutPropertiesLoose-DP4vAkvg.js → objectWithoutPropertiesLoose-Dxmp_Bd_.js} +0 -0
  356. /package/dist/assets/{ordinal-BjO5SoTk.js → ordinal-CMAUv8ku.js} +0 -0
  357. /package/dist/assets/{paths-D2lG83Oh.js → paths-BVwhPRFT.js} +0 -0
  358. /package/dist/assets/{play-DKSqmedg.js → play-Bu_0ogGD.js} +0 -0
  359. /package/dist/assets/{plus-dVmh0yTy.js → plus-DJ99CUbx.js} +0 -0
  360. /package/dist/assets/{preload-helper-BW0IMuFq.js → preload-helper-y72bE5iF.js} +0 -0
  361. /package/dist/assets/{prop-types-RrUi-pOT.js → prop-types-DRf51_gT.js} +0 -0
  362. /package/dist/assets/{purify.es-BBn8CPhf.js → purify.es-Cf8RQecB.js} +0 -0
  363. /package/dist/assets/{range-DNqFcYmr.js → range-ClqUI25v.js} +0 -0
  364. /package/dist/assets/{refresh-ccw-DLpfIr8v.js → refresh-ccw-DQ6SJ8UC.js} +0 -0
  365. /package/dist/assets/{refresh-cw-CHAHPgkx.js → refresh-cw-Dg9tCj4k.js} +0 -0
  366. /package/dist/assets/{rotate-ccw-hLlF_82X.js → rotate-ccw-BCkZViUZ.js} +0 -0
  367. /package/dist/assets/{save-8fSvKYJT.js → save-CUdcv5qm.js} +0 -0
  368. /package/dist/assets/{session-BrEm7qNv.js → session-CByuQ-M-.js} +0 -0
  369. /package/dist/assets/{settings-CzQUw9rV.js → settings-B7nhfCat.js} +0 -0
  370. /package/dist/assets/{spinner-C5JoisA7.js → spinner-pCogyRyo.js} +0 -0
  371. /package/dist/assets/{square-CxAsQQ77.js → square-KVNDGpgy.js} +0 -0
  372. /package/dist/assets/{square-function-B006EYFX.js → square-function-BMNCw7Qb.js} +0 -0
  373. /package/dist/assets/{stex-0ac7Aukl.js → stex-C6JeW1YI.js} +0 -0
  374. /package/dist/assets/{table-BCnp9gKC.js → table-Od8PbuV-.js} +0 -0
  375. /package/dist/assets/{toDate-BqKH-Jd9.js → toDate-Cfp9W_O9.js} +0 -0
  376. /package/dist/assets/{trash-2-CAoNMkjq.js → trash-2-Bc_J7TQO.js} +0 -0
  377. /package/dist/assets/{trash-BZMAQneW.js → trash-Cxd189Vw.js} +0 -0
  378. /package/dist/assets/{triangle-alert-qZo1ox6x.js → triangle-alert-CzLrbLGN.js} +0 -0
  379. /package/dist/assets/{types-C1RN112u.js → types-CLOMZuqU.js} +0 -0
  380. /package/dist/assets/{use-toast-Hc8CXlvz.js → use-toast-BtZldTi5.js} +0 -0
  381. /package/dist/assets/{useDebounce-B0dx2Gp0.js → useDebounce-DwTO_rGp.js} +0 -0
  382. /package/dist/assets/{useTheme-BYXBU1of.js → useTheme-KDW4sktg.js} +0 -0
  383. /package/dist/assets/{uuid-ClFZlR7U.js → uuid-BukULOeS.js} +0 -0
  384. /package/dist/assets/{workflow-BmeqNuSH.js → workflow-BqHyyStM.js} +0 -0
  385. /package/dist/assets/{x-BI1M8X_v.js → x-CdLP7-v3.js} +0 -0
  386. /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" as CellId,
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 [cellId, handle] of Object.entries(state.cellHandles)) {
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[cellId as CellId].code);
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[cellId as CellId] = { current: handle };
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++}` as CellId;
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" as CellId);
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" as CellId });
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" as CellId,
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" as CellId,
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" as CellId,
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" as CellId,
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" as CellId,
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" as CellId, before: false });
1288
- actions.sendToTop({ cellId: "2" as CellId });
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" as CellId, before: false });
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" as CellId, before: false });
1320
+ actions.createNewCell({ cellId: cellId("1"), before: false });
1318
1321
 
1319
- actions.focusCell({ cellId: "1" as CellId, where: "before" });
1322
+ actions.focusCell({ cellId: cellId("1"), where: "before" });
1320
1323
  expect(focusAndScrollCellIntoView).toHaveBeenCalledWith(
1321
1324
  expect.objectContaining({
1322
- cellId: "0" as CellId,
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"] as CellId[];
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"] as CellId[],
1377
+ ids: [cellId("2")],
1375
1378
  codeIsStale: false,
1376
1379
  });
1377
1380
 
1378
- expect(state.cellData["2" as CellId].code).toBe("new code");
1379
- expect(state.cellData["2" as CellId].edited).toBe(false);
1380
- expect(state.cellData["2" as CellId].lastCodeRun).toBe("new code");
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"] as CellId[],
1387
+ ids: [cellId("9")],
1385
1388
  codeIsStale: true,
1386
1389
  });
1387
1390
 
1388
- expect(state.cellData["9" as CellId].code).toBe("new code 2");
1389
- expect(state.cellData["9" as CellId].edited).toBe(true);
1390
- expect(state.cellData["9" as CellId].lastCodeRun).toBe(null);
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" as CellId, before: false });
1398
+ actions.createNewCell({ cellId: cellId("1"), before: false });
1396
1399
 
1397
- expect(state.cellIds.inOrderIds).toEqual(["0", "1", "2"]);
1398
- expect(state.cellData["0" as CellId].code).toBe("");
1399
- expect(state.cellData["1" as CellId].code).toBe("");
1400
- expect(state.cellData["2" as CellId].code).toBe("");
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"] as CellId[],
1412
+ ids: [cellId("1")],
1406
1413
  codeIsStale: false,
1407
1414
  });
1408
1415
 
1409
- expect(state.cellIds.inOrderIds).toEqual(["0", "1", "2"]);
1410
- expect(state.cellData["0" as CellId].code).toBe("");
1411
- expect(state.cellData["1" as CellId].code).toBe("new code 2");
1412
- expect(state.cellData["1" as CellId].edited).toBe(false);
1413
- expect(state.cellData["2" as CellId].code).toBe("");
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"] as CellId[],
1430
+ ids: [cellId("3"), cellId("4"), cellId("5")],
1420
1431
  codeIsStale: false,
1421
1432
  });
1422
- expect(state.cellData["3" as CellId].code).toBe("code1");
1423
- expect(state.cellData["4" as CellId].code).toBe("code2");
1424
- expect(state.cellData["5" as CellId].code).toBe("code3");
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({ cellIds: ["1", "2", "3", "4"] as CellId[] });
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"] as CellId[],
1443
+ ids: [cellId("1"), cellId("2"), cellId("3"), cellId("4")],
1431
1444
  codeIsStale: false,
1432
1445
  });
1433
- expect(state.cellData["1" as CellId].code).toBe("new1");
1434
- expect(state.cellData["2" as CellId].code).toBe("new2");
1435
- expect(state.cellData["3" as CellId].code).toBe("code1");
1436
- expect(state.cellData["4" as CellId].code).toBe("code2");
1437
- expect(state.cellIds.inOrderIds).toEqual(["1", "2", "3", "4"]);
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" as CellId]).not.toBeUndefined();
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"] as CellId[];
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" as CellId].name).toBe("setup_cell");
1457
- expect(state.cellData["3" as CellId].config.hide_code).toBe(true);
1458
- expect(state.cellData["3" as CellId].config.disabled).toBe(false);
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" as CellId].name).toBe("analysis");
1461
- expect(state.cellData["4" as CellId].config.hide_code).toBe(false);
1462
- expect(state.cellData["4" as CellId].config.disabled).toBe(true);
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"] as CellId[];
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" as CellId].code).toBe("code1");
1476
- expect(state.cellData["3" as CellId].config.hide_code).toBe(false);
1477
- expect(state.cellData["3" as CellId].config.disabled).toBe(false);
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" as CellId,
1542
+ cellId: cellId("1"),
1525
1543
  before: false,
1526
1544
  code: "# Header",
1527
1545
  });
1528
1546
  actions.createNewCell({
1529
- cellId: "2" as CellId,
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" as CellId,
1570
+ cellId: cellId("1"),
1553
1571
  before: false,
1554
1572
  code: "# First Column Header",
1555
1573
  });
1556
1574
  actions.createNewCell({
1557
- cellId: "2" as CellId,
1575
+ cellId: cellId("2"),
1558
1576
  before: false,
1559
1577
  code: "## First Column Subheader",
1560
1578
  });
1561
1579
 
1562
- actions.addColumnBreakpoint({ cellId: "2" as CellId });
1580
+ actions.addColumnBreakpoint({ cellId: cellId("2") });
1563
1581
 
1564
1582
  actions.createNewCell({
1565
- cellId: "3" as CellId,
1583
+ cellId: cellId("3"),
1566
1584
  before: false,
1567
1585
  code: "# Second Column Header",
1568
1586
  });
1569
1587
  actions.createNewCell({
1570
- cellId: "4" as CellId,
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" as CellId,
1637
+ cellId: cellId("1"),
1620
1638
  before: false,
1621
1639
  code: "# Header",
1622
1640
  });
1623
1641
  actions.createNewCell({
1624
- cellId: "2" as CellId,
1642
+ cellId: cellId("2"),
1625
1643
  before: false,
1626
1644
  code: "## Subheader",
1627
1645
  });
1628
1646
  actions.createNewCell({
1629
- cellId: "3" as CellId,
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" as CellId, before: false });
1691
+ actions.createNewCell({ cellId: cellId("1"), before: false });
1674
1692
  actions.collapseCell({ cellId: firstCellId });
1675
1693
 
1676
- actions.showCellIfHidden({ cellId: "1" as CellId });
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" as CellId, before: false });
1752
- actions.createNewCell({ cellId: "2" as CellId, before: false });
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" as CellId });
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(["0", "1"]);
1786
- expect(state.cellIds.getColumns()[1].topLevelIds).toEqual(["2", "3"]);
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" as CellId, before: false });
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" as CellId, before: false });
1800
- actions.createNewCell({ cellId: "2" as CellId, before: false });
1801
- actions.addColumnBreakpoint({ cellId: "2" as CellId });
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" as CellId, before: false });
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" as CellId, before: false });
1858
- actions.createNewCell({ cellId: "2" as CellId, before: false });
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" as CellId,
1874
- overCellId: "3" as CellId,
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" as CellId, before: false });
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" as CellId });
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(["0", "2"]);
1922
- expect(state.cellIds.getColumns()[1].topLevelIds).toEqual(["1"]);
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" as CellId, before: false });
1928
- actions.createNewCell({ cellId: "2" as CellId, before: false });
1929
- actions.addColumnBreakpoint({ cellId: "2" as CellId });
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(["2", "3"]);
1968
- expect(state.cellIds.getColumns()[1].topLevelIds).toEqual(["0", "1"]);
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" as CellId, before: false });
1975
- actions.addColumnBreakpoint({ cellId: "1" as CellId });
1976
- actions.addColumnBreakpoint({ cellId: "2" as CellId });
1977
- actions.dropOverNewColumn({ cellId: "2" as CellId });
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: "__scratch__" as 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" as CellId;
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" as CellId;
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" as CellId;
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" as CellId;
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" as CellId;
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" as CellId,
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" as CellId,
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
- cell1: { id: "cell1" as CellId, name: "cell1", code: "x = 1" },
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" as CellId,
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
- cell1: { id: "cell1" as CellId, name: "cell1", code: "x = 1" },
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" as CellId,
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
- cell1: { id: "cell1" as CellId, name: "cell1", code: "x = 1" },
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" as CellId,
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
- cell1: { id: "cell1" as CellId, name: "cell1", code: "x = 1" },
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" as CellId,
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
- cell1: { id: "cell1" as CellId, name: "cell1", code: "x = 1" },
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" as CellId,
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
- cell1: { id: "cell1" as CellId, name: "cell1", code: "x = 1" },
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" as CellId,
3163
+ cellId("cell1"),
3107
3164
  );
3108
3165
  const traceback = store.get(tracebackAtom);
3109
3166