@marimo-team/frontend 0.25.1-dev7 → 0.25.1
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/{ConnectedDataExplorerComponent-DeqCS430.js → ConnectedDataExplorerComponent-DJ5jwKfp.js} +1 -1
- package/dist/assets/{ErrorBoundary-DDm0F3Ge.js → ErrorBoundary-BeE1cdgM.js} +2 -2
- package/dist/assets/{ImageComparisonComponent-DLxkuRy3.js → ImageComparisonComponent-pCLPT6RA.js} +1 -1
- package/dist/assets/{LazyAnyLanguageCodeMirror-DPoyi1KJ.js → LazyAnyLanguageCodeMirror-B_IYTCX5.js} +2 -2
- package/dist/assets/{RunButton-1O-85ifv.js → RunButton-C2kFUhyO.js} +8 -8
- package/dist/assets/{abnfDiagram-VCTEODGH-DhJEqQ9k.js → abnfDiagram-VCTEODGH-CSPJSGaM.js} +1 -1
- package/dist/assets/add-cell-with-ai-BFgdVPaN.js +76 -0
- package/dist/assets/{agent-panel-nJz0jCo0.js → agent-panel-Dh7yWh9P.js} +5 -5
- package/dist/assets/ai-model-dropdown-DJ2elMLM.js +5 -0
- package/dist/assets/{any-language-editor-CxgTzMTD.js → any-language-editor-Cj_HzlZY.js} +1 -1
- package/dist/assets/app-config-button-DBCTefOX.js +1 -0
- package/dist/assets/{architectureDiagram-5GKGNRK7-BwF4-SE1.js → architectureDiagram-5GKGNRK7-7iukRoC9.js} +1 -1
- package/dist/assets/{blockDiagram-I7D4REHJ-B7xaFbfk.js → blockDiagram-I7D4REHJ-cuhpQB60.js} +1 -1
- package/dist/assets/{c4Diagram-7LVT6UL2-BbMz-zwF.js → c4Diagram-7LVT6UL2-CMQEYn6T.js} +1 -1
- package/dist/assets/{cache-panel-Bd7XcHQd.js → cache-panel-C0oB1kE2.js} +1 -1
- package/dist/assets/{cells-Cu3p4E4U.js → cells-CzugpTQu.js} +4 -4
- package/dist/assets/channel-CGdeorQk.js +1 -0
- package/dist/assets/{chat-display-CKr8MVOE.js → chat-display-DevO4F8W.js} +1 -1
- package/dist/assets/chat-panel-BGw0bqDk.js +4 -0
- package/dist/assets/{chat-ui-BH1aZhD7.js → chat-ui-CZZFGlZi.js} +4 -4
- package/dist/assets/{chunk-4HAMMTFA-F3WVmmmo.js → chunk-4HAMMTFA-C6Tl7kEY.js} +1 -1
- package/dist/assets/{chunk-75Z2AOVW-DA_lihEi.js → chunk-75Z2AOVW-BzzYECN7.js} +1 -1
- package/dist/assets/{chunk-DU6HZSFF-J-califE.js → chunk-DU6HZSFF-BlpgvKzl.js} +2 -2
- package/dist/assets/{chunk-F27PBJKO-BzJrz4xx.js → chunk-F27PBJKO-BVIgLGPF.js} +1 -1
- package/dist/assets/{chunk-GMAD6QVW-mXoq4V-T.js → chunk-GMAD6QVW-hv6IsAru.js} +1 -1
- package/dist/assets/{chunk-GVQU2GXP-B-87l3Xt.js → chunk-GVQU2GXP-Duv4ZYb-.js} +1 -1
- package/dist/assets/{chunk-IMKFNOWR-Cypkx_kh.js → chunk-IMKFNOWR-BIILwBhp.js} +1 -1
- package/dist/assets/{chunk-L3NEJ4N5-DLeZO9l0.js → chunk-L3NEJ4N5-B2hafvRU.js} +1 -1
- package/dist/assets/{chunk-OSK3NFVY-PWoOtECb.js → chunk-OSK3NFVY-SNGRdtNA.js} +1 -1
- package/dist/assets/{chunk-P2QGCYS3-DsJshZeL.js → chunk-P2QGCYS3-_SeE0QXb.js} +1 -1
- package/dist/assets/{chunk-POPQ4Y6H-CCg5TpSp.js → chunk-POPQ4Y6H-BB5NNJFE.js} +1 -1
- package/dist/assets/{chunk-PWAF6VOD-CrFPAGFi.js → chunk-PWAF6VOD-BZoBqp8x.js} +1 -1
- package/dist/assets/{chunk-SHT3W25Y-V37g5TGQ.js → chunk-SHT3W25Y-BtLGdeDB.js} +1 -1
- package/dist/assets/{chunk-SVP7TREG-CTD0ZEkK.js → chunk-SVP7TREG-B0UfxhUP.js} +1 -1
- package/dist/assets/{chunk-TICWLB2K-BmUJmjwl.js → chunk-TICWLB2K-BP7vel_P.js} +1 -1
- package/dist/assets/classDiagram-ZZMXUADV-CoNXKNMZ.js +1 -0
- package/dist/assets/classDiagram-v2-VYDZK3BY-CoNXKNMZ.js +1 -0
- package/dist/assets/{code-visibility-7811giS9.js → code-visibility-BFNYI7hr.js} +1 -1
- package/dist/assets/{command-palette-ZCeZiFkl.js → command-palette-DN4JoOLD.js} +1 -1
- package/dist/assets/{common-BdqirnCM.js → common-DUCPhoyP.js} +1 -1
- package/dist/assets/{components-BFIaoBwJ.js → components-CK7CeYlo.js} +1 -1
- package/dist/assets/{components-CzFNo5Dk.js → components-DAmFBASm.js} +1 -1
- package/dist/assets/{cynefinDiagram-5FMLGOSQ-CTXT8KNm.js → cynefinDiagram-5FMLGOSQ-BARZRQBb.js} +1 -1
- package/dist/assets/{dagre-B5pirN9r.js → dagre-DVyyr7Cb.js} +1 -1
- package/dist/assets/{dagre-GXQ25YYZ-6LiieueL.js → dagre-GXQ25YYZ-79s0lOP0.js} +1 -1
- package/dist/assets/data-grid-overlay-editor-DPfnIudL.js +1 -0
- package/dist/assets/{dependency-graph-panel-CHbDGV22.js → dependency-graph-panel-BN4CLayU.js} +3 -3
- package/dist/assets/{diagram-S7CK7UJ4-BZL5Ql7I.js → diagram-S7CK7UJ4-BCviGhvd.js} +1 -1
- package/dist/assets/{diagram-UQ7AKVKN-AhAtqSJG.js → diagram-UQ7AKVKN-Ds-BT46T.js} +1 -1
- package/dist/assets/{diagram-VSXAHHWV-DOQllF_r.js → diagram-VSXAHHWV-CK4GkM-q.js} +1 -1
- package/dist/assets/{diagram-VX7I27RA-COX-CxL0.js → diagram-VX7I27RA-BtL2eh0t.js} +1 -1
- package/dist/assets/{diagram-Z3DM3KII-DXw7fg_D.js → diagram-Z3DM3KII-C6SmbLBS.js} +1 -1
- package/dist/assets/{dist-0HQ0BMF5.js → dist-CQvJDryh.js} +1 -1
- package/dist/assets/{documentation-panel-DUlFjJdz.js → documentation-panel-CzRbXV5u.js} +1 -1
- package/dist/assets/{ebnfDiagram-PWID7BFC-Ds-CB5Z_.js → ebnfDiagram-PWID7BFC-D_JU4cMQ.js} +1 -1
- package/dist/assets/edit-page-jGNYBqQo.js +174 -0
- package/dist/assets/{erDiagram-RLTQ6QDP-RdxnwvNA.js → erDiagram-RLTQ6QDP-Z9MJ6X-r.js} +1 -1
- package/dist/assets/{error-entries-BUsiy4Fq.js → error-entries-CDSsy76p.js} +1 -1
- package/dist/assets/{error-panel-DmaQ2MSS.js → error-panel-ABvjFG3p.js} +1 -1
- package/dist/assets/{feedback-button-DJMAFZ1t.js → feedback-button-CZhLiwkO.js} +2 -2
- package/dist/assets/{file-explorer-panel-BZ4A-j8a.js → file-explorer-panel-DTiEpmVE.js} +1 -1
- package/dist/assets/file-name-input-C1C8xrjA.js +3 -0
- package/dist/assets/filename-fxG7K_MU.js +1 -0
- package/dist/assets/flowDiagram-HODETNUW-ncLciK2K.js +1 -0
- package/dist/assets/{gallery-page-DFoyByKn.js → gallery-page-Moi4ZdJ0.js} +1 -1
- package/dist/assets/{ganttDiagram-EL5Y4UJY-d9Qqbnau.js → ganttDiagram-EL5Y4UJY-Cgy11k0G.js} +1 -1
- package/dist/assets/{gitGraphDiagram-WWUBYQGX-DBunV_fz.js → gitGraphDiagram-WWUBYQGX-CVH8fay_.js} +1 -1
- package/dist/assets/glide-data-editor-CbsCWu-K.js +131 -0
- package/dist/assets/{graphlib-CWJvl2Lb.js → graphlib-3maKwbRO.js} +1 -1
- package/dist/assets/has-cJsIKK9t.js +1 -0
- package/dist/assets/{home-page-D_6gPong.js → home-page-UAgVOkCZ.js} +2 -2
- package/dist/assets/index--sT8xf-8.css +2 -0
- package/dist/assets/index-DafnX1Xx.js +62 -0
- package/dist/assets/{infoDiagram-27XIBGKW-B0jMwBBO.js → infoDiagram-27XIBGKW-Dk8U81nJ.js} +1 -1
- package/dist/assets/{ishikawaDiagram-5VMMS53U-4eji-_U4.js → ishikawaDiagram-5VMMS53U-CzHQlMUQ.js} +1 -1
- package/dist/assets/{journeyDiagram-3NMN7TZE-Cp4mxQrE.js → journeyDiagram-3NMN7TZE-DRc8ACzh.js} +1 -1
- package/dist/assets/{kanban-definition-UXKFOSKX-BYgV-VZ3.js → kanban-definition-UXKFOSKX-CVyVYiI6.js} +1 -1
- package/dist/assets/katex-DkE0ukCy.js +257 -0
- package/dist/assets/{logs-panel-CvwX6Xnb.js → logs-panel-Bz5ysVX4.js} +1 -1
- package/dist/assets/{mermaid-BmcDudwo.js → mermaid-D_jPUVqz.js} +4 -4
- package/dist/assets/mhchem-CmzEtQj8.js +1 -0
- package/dist/assets/{mindmap-definition-YA3MSWOX-Cz5xXQnv.js → mindmap-definition-YA3MSWOX-D5t6Aq5Z.js} +1 -1
- package/dist/assets/{number-overlay-editor-Jcf1i5Xj.js → number-overlay-editor-FAD8sjFU.js} +1 -1
- package/dist/assets/{outline-panel-4icYQ4vr.js → outline-panel-85oiQ0XX.js} +1 -1
- package/dist/assets/packages-panel-ClKIaP5S.js +1 -0
- package/dist/assets/{panels-CM1tqwz-.js → panels-B48zp96D.js} +9 -9
- package/dist/assets/{pegDiagram-XKGWAZYB-CCOAs3UH.js → pegDiagram-XKGWAZYB-BTkTm4ej.js} +1 -1
- package/dist/assets/{pieDiagram-E7YTZNPT-BBxiPx1C.js → pieDiagram-E7YTZNPT-Bq6X88M1.js} +1 -1
- package/dist/assets/{process-output-CXjf0zEE.js → process-output-Cg2ta3vY.js} +1 -1
- package/dist/assets/{quadrantDiagram-AXDQQJYC-BE-xlTLH.js → quadrantDiagram-AXDQQJYC-D_wrOwLk.js} +1 -1
- package/dist/assets/{railroadDiagram-O6MQD6OU-BRv2wsAz.js → railroadDiagram-O6MQD6OU-fv8HXW_g.js} +1 -1
- package/dist/assets/{requirementDiagram-BXWQKSXE-HAdL90iQ.js → requirementDiagram-BXWQKSXE-DDOOMUfC.js} +1 -1
- package/dist/assets/{reveal-component-CiQEczuZ.js → reveal-component-CR43gpTZ.js} +3 -3
- package/dist/assets/run-page-NR_KFWk8.js +1 -0
- package/dist/assets/{sankeyDiagram-P5KCCOFB-BWLQCyjK.js → sankeyDiagram-P5KCCOFB-CvvUY6tS.js} +1 -1
- package/dist/assets/{scratchpad-panel-Btg5EoIW.js → scratchpad-panel-DHc-oVb1.js} +1 -1
- package/dist/assets/{secrets-panel-C-17vrf1.js → secrets-panel-C-65ZjnM.js} +1 -1
- package/dist/assets/{sequenceDiagram-WJ2MYXX4-Bs66qtoH.js → sequenceDiagram-WJ2MYXX4-DdpBhQaS.js} +1 -1
- package/dist/assets/session-panel-DiwQqIbt.js +1 -0
- package/dist/assets/{SelectionIndicator-DLJBcP4e.js → shell-BSnvn9t7.js} +1 -1
- package/dist/assets/snippets-panel-BLmXrneD.js +1 -0
- package/dist/assets/{stateDiagram-D77RDMKH-CZZcOZaL.js → stateDiagram-D77RDMKH-D3p19fac.js} +1 -1
- package/dist/assets/stateDiagram-v2-MP3YSRHH-CplsDaDl.js +1 -0
- package/dist/assets/{swimlanes-42K2YHIH-DmvAwXeY.js → swimlanes-42K2YHIH-CLxCSvU4.js} +1 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-DPoIFx8T.js +8 -0
- package/dist/assets/{swiper-component-C-iHKt3a.js → swiper-component-rqJChT_P.js} +1 -1
- package/dist/assets/{terminal-BJXvwDtX.js → terminal-CY4h1UmO.js} +1 -1
- package/dist/assets/{timeline-definition-24CTP7MA-DMBmrnDz.js → timeline-definition-24CTP7MA-Cw2PY--x.js} +1 -1
- package/dist/assets/tooltip-PLkI_UfK.js +61 -0
- package/dist/assets/{tracing-C1gfnMTz.js → tracing-Q8NAdlrA.js} +1 -1
- package/dist/assets/tracing-panel-Ci4kY4dr.js +2 -0
- package/dist/assets/{useCellActionButton-ChAk7KSd.js → useCellActionButton-DpYtVfFe.js} +1 -1
- package/dist/assets/{vega-component-Dyn2ovlw.js → vega-component-BpoSew4K.js} +1 -1
- package/dist/assets/{vega-embed-container-SaZMhvDB.js → vega-embed-container-BOJG8mCA.js} +1 -1
- package/dist/assets/{vennDiagram-4TSXK5OY-CU4ZQxbP.js → vennDiagram-4TSXK5OY-D8bN6lVl.js} +1 -1
- package/dist/assets/{wardleyDiagram-VM6X3IG4-CqJhzIbP.js → wardleyDiagram-VM6X3IG4-CbZdo0SA.js} +1 -1
- package/dist/assets/{write-secret-modal-CBUZw27N.js → write-secret-modal-BiG2tahJ.js} +1 -1
- package/dist/assets/{xychartDiagram-S5SC5T6Z-CS6EJwUz.js → xychartDiagram-S5SC5T6Z-DUUQ9tau.js} +1 -1
- package/dist/index.html +8 -7
- package/package.json +1 -2
- package/src/__mocks__/common.ts +3 -3
- package/src/__tests__/CellStatus.test.tsx +1 -1
- package/src/__tests__/setup.ts +7 -7
- package/src/components/app-config/ai-config.tsx +2 -0
- package/src/components/app-config/optional-features.tsx +1 -1
- package/src/components/chat/chat-panel.tsx +19 -8
- package/src/components/data-table/TableTopBar.tsx +2 -2
- package/src/components/data-table/__tests__/export-actions.test.tsx +662 -0
- package/src/components/data-table/charts/__tests__/chart-panel.test.tsx +286 -0
- package/src/components/data-table/charts/charts.tsx +26 -13
- package/src/components/data-table/column-summary/chart-spec-model.tsx +4 -4
- package/src/components/data-table/data-table.tsx +1 -1
- package/src/components/data-table/export-actions.tsx +642 -176
- package/src/components/data-table/schemas.ts +25 -3
- package/src/components/dependency-graph/elements.ts +2 -2
- package/src/components/editor/__tests__/package-alert.test.tsx +140 -0
- package/src/components/editor/actions/__tests__/pair-with-agent.test.tsx +107 -0
- package/src/components/editor/actions/pair-with-agent.tsx +119 -0
- package/src/components/editor/actions/useNotebookActions.tsx +2 -1
- package/src/components/editor/ai/add-cell-with-ai.tsx +2 -0
- package/src/components/editor/ai/staged-cell-submission.ts +2 -2
- package/src/components/editor/ai/transport/chat-transport.tsx +1 -1
- package/src/components/editor/chrome/components/contribute-snippet-button.tsx +6 -1
- package/src/components/editor/connections/database/as-code.ts +44 -44
- package/src/components/editor/connections/storage/as-code.ts +3 -3
- package/src/components/editor/file-tree/requesting-tree.tsx +16 -13
- package/src/components/editor/navigation/clipboard.ts +2 -2
- package/src/components/editor/notebook-cell.tsx +2 -2
- package/src/components/editor/output/MarimoTracebackOutput.tsx +1 -1
- package/src/components/editor/output/VideoOutput.tsx +1 -1
- package/src/components/editor/output/ansi-reduce.ts +21 -17
- package/src/components/editor/output/console/ConsoleOutput.tsx +3 -3
- package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +59 -0
- package/src/components/editor/output/console/text-rendering.tsx +3 -1
- package/src/components/editor/package-alert.tsx +20 -7
- package/src/components/home/components.tsx +1 -0
- package/src/components/markdown/markdown-renderer.css +1 -1
- package/src/components/pages/run-page.tsx +1 -0
- package/src/components/slides/__tests__/minimap-actions.test.tsx +7 -7
- package/src/components/slides/__tests__/minimap.test.ts +12 -12
- package/src/components/slides/__tests__/slide-scroll-hint.test.tsx +8 -8
- package/src/components/static-html/__tests__/share-modal.test.tsx +154 -0
- package/src/components/static-html/__tests__/stage-for-publish.test.ts +111 -0
- package/src/components/static-html/share-modal.tsx +114 -144
- package/src/components/static-html/stage-for-publish.ts +56 -0
- package/src/components/static-html/static-banner.tsx +2 -2
- package/src/components/ui/links.tsx +6 -1
- package/src/components/ui/typography.tsx +16 -8
- package/src/core/ai/context/__tests__/registry.test.ts +31 -28
- package/src/core/ai/context/providers/cell-output.ts +8 -8
- package/src/core/ai/context/providers/datasource.ts +10 -7
- package/src/core/ai/context/providers/error.ts +7 -7
- package/src/core/ai/context/providers/file.ts +8 -8
- package/src/core/ai/context/providers/tables.ts +7 -7
- package/src/core/ai/context/providers/variable.ts +7 -7
- package/src/core/ai/context/registry.ts +18 -18
- package/src/core/ai/ids/ids.ts +5 -5
- package/src/core/ai/model-registry.ts +12 -9
- package/src/core/ai/staged-cells.ts +6 -6
- package/src/core/ai/tools/base.ts +6 -6
- package/src/core/ai/tools/edit-notebook-tool.ts +6 -6
- package/src/core/ai/tools/registry.ts +4 -4
- package/src/core/ai/tools/run-cells-tool.ts +7 -7
- package/src/core/ai/tools/sample-tool.ts +6 -6
- package/src/core/cells/__tests__/cells.test.ts +27 -0
- package/src/core/cells/cells.ts +2 -1
- package/src/core/codemirror/cells/debugger-decorations.ts +13 -7
- package/src/core/codemirror/cells/line-timing-decorations.ts +9 -9
- package/src/core/codemirror/cells/traceback-decorations.ts +7 -4
- package/src/core/codemirror/code-lens/extension.ts +13 -13
- package/src/core/codemirror/copilot/__tests__/language-server.test.ts +6 -6
- package/src/core/codemirror/copilot/__tests__/transport.test.ts +12 -12
- package/src/core/codemirror/copilot/language-server.ts +13 -13
- package/src/core/codemirror/copilot/transport.ts +1 -1
- package/src/core/codemirror/find-replace/search-highlight.ts +5 -5
- package/src/core/codemirror/go-to-definition/underline.ts +3 -3
- package/src/core/codemirror/keymaps/vim.ts +3 -3
- package/src/core/codemirror/language/languages/markdown.ts +8 -8
- package/src/core/codemirror/language/languages/python.ts +7 -7
- package/src/core/codemirror/language/languages/sql/completion-builder.ts +5 -5
- package/src/core/codemirror/language/languages/sql/completion-store.ts +4 -4
- package/src/core/codemirror/language/languages/sql/sql.ts +21 -21
- package/src/core/codemirror/lsp/__tests__/transports.test.ts +10 -10
- package/src/core/codemirror/lsp/federated-lsp.ts +29 -27
- package/src/core/codemirror/lsp/notebook-lsp.ts +21 -21
- package/src/core/codemirror/misc/__tests__/dnd.test.ts +10 -10
- package/src/core/codemirror/misc/__tests__/paste.test.ts +7 -4
- package/src/core/codemirror/reactive-references/extension.ts +3 -3
- package/src/core/codemirror/rtc/loro/awareness.ts +12 -12
- package/src/core/codemirror/rtc/loro/sync.ts +5 -5
- package/src/core/codemirror/vim/cursor-visibility.ts +3 -3
- package/src/core/dom/ui-element.ts +5 -5
- package/src/core/dom/uiregistry.ts +10 -10
- package/src/core/hotkeys/hotkeys.ts +9 -9
- package/src/core/islands/__tests__/bridge.test.ts +4 -4
- package/src/core/islands/__tests__/test-utils.tsx +4 -4
- package/src/core/islands/bridge.ts +85 -82
- package/src/core/islands/components/web-components.tsx +7 -7
- package/src/core/islands/worker/__tests__/controller.test.ts +1 -1
- package/src/core/islands/worker/controller.ts +6 -3
- package/src/core/islands/worker-factory.ts +2 -2
- package/src/core/kernel/RuntimeState.ts +4 -4
- package/src/core/lsp/__tests__/transport.test.ts +19 -19
- package/src/core/lsp/transport.ts +5 -5
- package/src/core/network/CachingRequestRegistry.ts +2 -2
- package/src/core/network/DeferredRequestRegistry.ts +4 -4
- package/src/core/network/__tests__/export-asset-url.test.ts +45 -0
- package/src/core/network/export-asset-url.ts +19 -0
- package/src/core/network/requests-network.ts +2 -7
- package/src/core/runtime/runtime.ts +25 -20
- package/src/core/static/virtual-file-tracker.ts +5 -5
- package/src/core/wasm/__tests__/bridge.test.ts +2 -2
- package/src/core/wasm/bridge.ts +132 -133
- package/src/core/wasm/router.ts +5 -5
- package/src/core/wasm/store.ts +4 -4
- package/src/core/wasm/worker/bootstrap.ts +8 -5
- package/src/core/wasm/worker/message-buffer.ts +3 -3
- package/src/core/websocket/transports/__tests__/ws.test.ts +8 -8
- package/src/core/websocket/transports/basic.ts +15 -8
- package/src/core/websocket/transports/sse.ts +7 -7
- package/src/core/websocket/transports/transport.ts +3 -3
- package/src/core/websocket/transports/ws.ts +9 -7
- package/src/css/globals.css +18 -21
- package/src/css/katex.min.css +260 -241
- package/src/hooks/__tests__/useOverflowDetection.test.tsx +5 -5
- package/src/hooks/__tests__/useResizeObserver.test.tsx +12 -12
- package/src/plugins/core/registerReactComponent.tsx +5 -5
- package/src/plugins/core/sidebar-element.tsx +2 -2
- package/src/plugins/impl/ButtonPlugin.tsx +3 -3
- package/src/plugins/impl/CheckboxPlugin.tsx +3 -3
- package/src/plugins/impl/CodeEditorPlugin.tsx +3 -3
- package/src/plugins/impl/DatePickerPlugin.tsx +3 -3
- package/src/plugins/impl/DateRangePlugin.tsx +3 -3
- package/src/plugins/impl/DateTimePickerPlugin.tsx +3 -3
- package/src/plugins/impl/DictPlugin.tsx +3 -3
- package/src/plugins/impl/DropdownPlugin.tsx +3 -3
- package/src/plugins/impl/FileUploadPlugin.tsx +3 -3
- package/src/plugins/impl/MatrixPlugin.tsx +4 -4
- package/src/plugins/impl/MicrophonePlugin.tsx +3 -3
- package/src/plugins/impl/MultiselectPlugin.tsx +3 -3
- package/src/plugins/impl/NumberPlugin.tsx +3 -3
- package/src/plugins/impl/RadioPlugin.tsx +9 -5
- package/src/plugins/impl/RangeSliderPlugin.tsx +3 -3
- package/src/plugins/impl/RefreshPlugin.tsx +3 -3
- package/src/plugins/impl/SliderPlugin.tsx +3 -3
- package/src/plugins/impl/SwitchPlugin.tsx +3 -3
- package/src/plugins/impl/TabsPlugin.tsx +3 -3
- package/src/plugins/impl/TextAreaPlugin.tsx +3 -3
- package/src/plugins/impl/TextInputPlugin.tsx +3 -3
- package/src/plugins/impl/__tests__/MatrixPlugin.test.tsx +2 -2
- package/src/plugins/impl/anywidget/model.ts +10 -10
- package/src/plugins/impl/anywidget/registry.ts +12 -9
- package/src/plugins/impl/anywidget/runtime.ts +11 -9
- package/src/plugins/impl/anywidget/widget-binding.ts +6 -6
- package/src/plugins/impl/image-comparison/ImageComparisonComponent.tsx +7 -6
- package/src/plugins/impl/matplotlib/MatplotlibPlugin.tsx +3 -3
- package/src/plugins/impl/matplotlib/__tests__/matplotlib-renderer.test.ts +2 -2
- package/src/plugins/impl/matplotlib/matplotlib-renderer.ts +2 -2
- package/src/plugins/impl/mpl-interactive/mpl-websocket-shim.ts +10 -10
- package/src/plugins/impl/panel/utils.ts +5 -5
- package/src/plugins/impl/plotly/PlotlyPlugin.tsx +3 -3
- package/src/plugins/impl/vega/VegaPlugin.tsx +3 -3
- package/src/plugins/impl/vega/__tests__/use-vega-container-remeasure.test.ts +7 -7
- package/src/plugins/impl/vega/__tests__/utils.test.ts +16 -1
- package/src/plugins/impl/vega/__tests__/vega.test.ts +37 -0
- package/src/plugins/impl/vega/loader.ts +23 -1
- package/src/plugins/impl/vega/utils.ts +5 -4
- package/src/plugins/layout/AccordionPlugin.tsx +3 -3
- package/src/plugins/layout/CalloutPlugin.tsx +3 -3
- package/src/plugins/layout/ImageComparisonPlugin.tsx +5 -3
- package/src/plugins/layout/JsonOutputPlugin.tsx +3 -3
- package/src/plugins/layout/MimeRenderPlugin.tsx +3 -3
- package/src/plugins/layout/NavigationMenuPlugin.tsx +3 -3
- package/src/plugins/layout/OutlinePlugin.tsx +3 -3
- package/src/plugins/layout/ProgressPlugin.tsx +3 -3
- package/src/plugins/layout/RoutesPlugin.tsx +6 -8
- package/src/plugins/layout/StatPlugin.tsx +3 -3
- package/src/plugins/layout/TexPlugin.tsx +3 -3
- package/src/plugins/layout/carousel/CarouselPlugin.tsx +4 -4
- package/src/plugins/layout/mermaid/MermaidPlugin.tsx +3 -3
- package/src/utils/Deferred.ts +6 -6
- package/src/utils/async-capture-tracker.ts +10 -7
- package/src/utils/errors.ts +5 -5
- package/src/utils/id-tree.tsx +83 -80
- package/src/utils/lru.ts +1 -1
- package/src/utils/multi-map.ts +14 -12
- package/src/utils/paths.ts +6 -6
- package/src/utils/pluralize.ts +3 -3
- package/src/utils/progress.ts +6 -6
- package/src/utils/python-poet/poet.ts +14 -14
- package/src/utils/routes.ts +4 -2
- package/src/utils/semaphore.ts +6 -6
- package/src/utils/storage/storage.ts +6 -6
- package/src/utils/storage/typed.ts +16 -12
- package/src/utils/time.ts +9 -9
- package/src/utils/timed-cache.ts +4 -4
- package/src/utils/tracer.ts +9 -6
- package/dist/assets/add-cell-with-ai-B_rl7cPp.js +0 -76
- package/dist/assets/ai-model-dropdown-BmCwaRek.js +0 -3
- package/dist/assets/app-config-button-CtDuDui6.js +0 -1
- package/dist/assets/channel-ni7ei-yz.js +0 -1
- package/dist/assets/chat-panel-J4XhiL6i.js +0 -4
- package/dist/assets/classDiagram-ZZMXUADV-BS3U2jc1.js +0 -1
- package/dist/assets/classDiagram-v2-VYDZK3BY-BS3U2jc1.js +0 -1
- package/dist/assets/data-grid-overlay-editor-87bCN9IO.js +0 -1
- package/dist/assets/edit-page-D--nkMAI.js +0 -176
- package/dist/assets/file-name-input-CCRQJdng.js +0 -3
- package/dist/assets/flowDiagram-HODETNUW-DN8oq7vL.js +0 -1
- package/dist/assets/glide-data-editor-jH9-4ffy.js +0 -131
- package/dist/assets/has-W-yPT2HD.js +0 -1
- package/dist/assets/index-2TQenOiQ.css +0 -2
- package/dist/assets/index-Bjli4tSW.js +0 -62
- package/dist/assets/katex-mNPPSsir.js +0 -257
- package/dist/assets/katex-ukvJUC1e.js +0 -257
- package/dist/assets/mhchem-DcHTrqjv.js +0 -1
- package/dist/assets/packages-panel-pQzYAoH5.js +0 -1
- package/dist/assets/run-page-BTAjlR7y.js +0 -1
- package/dist/assets/session-panel-BYf4LDAo.js +0 -1
- package/dist/assets/snippets-panel-BAYAZKCH.js +0 -1
- package/dist/assets/stateDiagram-v2-MP3YSRHH-sU5f30Vy.js +0 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-CNzkvYiI.js +0 -8
- package/dist/assets/tooltip-B1vGi-z4.js +0 -61
- package/dist/assets/tracing-panel-CzJ8ckHz.js +0 -2
package/src/core/wasm/bridge.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { notebookIsRunningAtom } from "../cells/cells";
|
|
|
14
14
|
import type { CommandMessage } from "../kernel/messages";
|
|
15
15
|
import { getInitialAppMode } from "../mode";
|
|
16
16
|
import { API } from "../network/api";
|
|
17
|
+
import { withDevAssetUrl } from "../network/export-asset-url";
|
|
17
18
|
import type {
|
|
18
19
|
EditRequests,
|
|
19
20
|
EnvironmentInfo,
|
|
@@ -57,7 +58,7 @@ type SaveWorker = ReturnType<
|
|
|
57
58
|
>["proxy"]["request"];
|
|
58
59
|
|
|
59
60
|
export class PyodideBridge implements RunRequests, EditRequests {
|
|
60
|
-
static get INSTANCE(): PyodideBridge {
|
|
61
|
+
public static get INSTANCE(): PyodideBridge {
|
|
61
62
|
const KEY = "_marimo_private_PyodideBridge";
|
|
62
63
|
if (!window[KEY]) {
|
|
63
64
|
window[KEY] = new PyodideBridge();
|
|
@@ -207,12 +208,14 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
207
208
|
}
|
|
208
209
|
}
|
|
209
210
|
|
|
210
|
-
attachMessageConsumer(
|
|
211
|
+
public attachMessageConsumer(
|
|
212
|
+
consumer: (message: MessageEvent<string>) => void,
|
|
213
|
+
) {
|
|
211
214
|
this.messageConsumer = consumer;
|
|
212
215
|
this.rpc.proxy.send.consumerReady({});
|
|
213
216
|
}
|
|
214
217
|
|
|
215
|
-
sendRename: EditRequests["sendRename"] = async ({ filename }) => {
|
|
218
|
+
public sendRename: EditRequests["sendRename"] = async ({ filename }) => {
|
|
216
219
|
if (filename === null) {
|
|
217
220
|
return null;
|
|
218
221
|
}
|
|
@@ -227,7 +230,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
227
230
|
return null;
|
|
228
231
|
};
|
|
229
232
|
|
|
230
|
-
sendSave: EditRequests["sendSave"] = async (request) => {
|
|
233
|
+
public sendSave: EditRequests["sendSave"] = async (request) => {
|
|
231
234
|
if (!this.saveRpc) {
|
|
232
235
|
Logger.warn("Save RPC not initialized");
|
|
233
236
|
return null;
|
|
@@ -254,11 +257,11 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
254
257
|
return null;
|
|
255
258
|
};
|
|
256
259
|
|
|
257
|
-
sendCopy: EditRequests["sendCopy"] = async () => {
|
|
260
|
+
public sendCopy: EditRequests["sendCopy"] = async () => {
|
|
258
261
|
throwNotImplemented();
|
|
259
262
|
};
|
|
260
263
|
|
|
261
|
-
sendStdin: EditRequests["sendStdin"] = async (request) => {
|
|
264
|
+
public sendStdin: EditRequests["sendStdin"] = async (request) => {
|
|
262
265
|
await this.rpc.proxy.request.bridge({
|
|
263
266
|
functionName: "put_input",
|
|
264
267
|
payload: request.text,
|
|
@@ -266,15 +269,15 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
266
269
|
return null;
|
|
267
270
|
};
|
|
268
271
|
|
|
269
|
-
sendPdb: EditRequests["sendPdb"] = async () => {
|
|
272
|
+
public sendPdb: EditRequests["sendPdb"] = async () => {
|
|
270
273
|
throwNotImplemented();
|
|
271
274
|
};
|
|
272
275
|
|
|
273
|
-
sendSetBreakpoints: EditRequests["sendSetBreakpoints"] = async () => {
|
|
276
|
+
public sendSetBreakpoints: EditRequests["sendSetBreakpoints"] = async () => {
|
|
274
277
|
throwNotImplemented();
|
|
275
278
|
};
|
|
276
279
|
|
|
277
|
-
sendRun: EditRequests["sendRun"] = async (request) => {
|
|
280
|
+
public sendRun: EditRequests["sendRun"] = async (request) => {
|
|
278
281
|
await this.rpc.proxy.request.loadPackages(request.codes.join("\n"));
|
|
279
282
|
|
|
280
283
|
await this.putControlRequest({
|
|
@@ -283,7 +286,9 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
283
286
|
});
|
|
284
287
|
return null;
|
|
285
288
|
};
|
|
286
|
-
sendRunScratchpad: EditRequests["sendRunScratchpad"] = async (
|
|
289
|
+
public sendRunScratchpad: EditRequests["sendRunScratchpad"] = async (
|
|
290
|
+
request,
|
|
291
|
+
) => {
|
|
287
292
|
await this.rpc.proxy.request.loadPackages(request.code);
|
|
288
293
|
|
|
289
294
|
await this.putControlRequest({
|
|
@@ -292,18 +297,18 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
292
297
|
});
|
|
293
298
|
return null;
|
|
294
299
|
};
|
|
295
|
-
sendInterrupt: EditRequests["sendInterrupt"] = async () => {
|
|
300
|
+
public sendInterrupt: EditRequests["sendInterrupt"] = async () => {
|
|
296
301
|
if (this.interruptBuffer !== undefined) {
|
|
297
302
|
// 2 sends a SIGINT
|
|
298
303
|
this.interruptBuffer[0] = 2;
|
|
299
304
|
}
|
|
300
305
|
return null;
|
|
301
306
|
};
|
|
302
|
-
sendShutdown: EditRequests["sendShutdown"] = async () => {
|
|
307
|
+
public sendShutdown: EditRequests["sendShutdown"] = async () => {
|
|
303
308
|
window.close();
|
|
304
309
|
return null;
|
|
305
310
|
};
|
|
306
|
-
sendFormat: EditRequests["sendFormat"] = async (request) => {
|
|
311
|
+
public sendFormat: EditRequests["sendFormat"] = async (request) => {
|
|
307
312
|
const response = await this.rpc.proxy.request.bridge({
|
|
308
313
|
functionName: "format",
|
|
309
314
|
payload: request,
|
|
@@ -311,7 +316,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
311
316
|
return response as FormatResponse;
|
|
312
317
|
};
|
|
313
318
|
|
|
314
|
-
sendDeleteCell: EditRequests["sendDeleteCell"] = async (request) => {
|
|
319
|
+
public sendDeleteCell: EditRequests["sendDeleteCell"] = async (request) => {
|
|
315
320
|
await this.putControlRequest({
|
|
316
321
|
type: "delete-cell",
|
|
317
322
|
...request,
|
|
@@ -319,7 +324,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
319
324
|
return null;
|
|
320
325
|
};
|
|
321
326
|
|
|
322
|
-
sendInstallMissingPackages: EditRequests["sendInstallMissingPackages"] =
|
|
327
|
+
public sendInstallMissingPackages: EditRequests["sendInstallMissingPackages"] =
|
|
323
328
|
async (request) => {
|
|
324
329
|
this.putControlRequest({
|
|
325
330
|
type: "install-packages",
|
|
@@ -327,23 +332,22 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
327
332
|
});
|
|
328
333
|
return null;
|
|
329
334
|
};
|
|
330
|
-
sendCodeCompletionRequest: EditRequests["sendCodeCompletionRequest"] =
|
|
331
|
-
request
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
};
|
|
335
|
+
public sendCodeCompletionRequest: EditRequests["sendCodeCompletionRequest"] =
|
|
336
|
+
async (request) => {
|
|
337
|
+
// Because the Pyodide worker is single-threaded, sending
|
|
338
|
+
// code completion requests while the kernel is running is useless
|
|
339
|
+
// and runs the risk of choking the kernel
|
|
340
|
+
const isRunning = store.get(notebookIsRunningAtom);
|
|
341
|
+
if (!isRunning) {
|
|
342
|
+
await this.rpc.proxy.request.bridge({
|
|
343
|
+
functionName: "code_complete",
|
|
344
|
+
payload: request,
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
return null;
|
|
348
|
+
};
|
|
345
349
|
|
|
346
|
-
saveUserConfig: EditRequests["saveUserConfig"] = async (request) => {
|
|
350
|
+
public saveUserConfig: EditRequests["saveUserConfig"] = async (request) => {
|
|
347
351
|
await this.rpc.proxy.request.bridge({
|
|
348
352
|
functionName: "save_user_config",
|
|
349
353
|
payload: request,
|
|
@@ -361,7 +365,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
361
365
|
});
|
|
362
366
|
};
|
|
363
367
|
|
|
364
|
-
saveAppConfig: EditRequests["saveAppConfig"] = async (request) => {
|
|
368
|
+
public saveAppConfig: EditRequests["saveAppConfig"] = async (request) => {
|
|
365
369
|
await this.rpc.proxy.request.bridge({
|
|
366
370
|
functionName: "save_app_config",
|
|
367
371
|
payload: request,
|
|
@@ -369,7 +373,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
369
373
|
return null;
|
|
370
374
|
};
|
|
371
375
|
|
|
372
|
-
saveCellConfig: EditRequests["saveCellConfig"] = async (request) => {
|
|
376
|
+
public saveCellConfig: EditRequests["saveCellConfig"] = async (request) => {
|
|
373
377
|
await this.putControlRequest({
|
|
374
378
|
type: "update-cell-config",
|
|
375
379
|
...request,
|
|
@@ -377,7 +381,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
377
381
|
return null;
|
|
378
382
|
};
|
|
379
383
|
|
|
380
|
-
sendRestart = async (): Promise<null> => {
|
|
384
|
+
public sendRestart = async (): Promise<null> => {
|
|
381
385
|
// Save first
|
|
382
386
|
const code = await this.readCode();
|
|
383
387
|
if (code.contents) {
|
|
@@ -388,7 +392,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
388
392
|
return null;
|
|
389
393
|
};
|
|
390
394
|
|
|
391
|
-
readCode: EditRequests["readCode"] = async () => {
|
|
395
|
+
public readCode: EditRequests["readCode"] = async () => {
|
|
392
396
|
if (!this.saveRpc) {
|
|
393
397
|
Logger.warn("Save RPC not initialized");
|
|
394
398
|
return { contents: "" };
|
|
@@ -397,7 +401,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
397
401
|
return { contents };
|
|
398
402
|
};
|
|
399
403
|
|
|
400
|
-
readSnippets: EditRequests["readSnippets"] = async () => {
|
|
404
|
+
public readSnippets: EditRequests["readSnippets"] = async () => {
|
|
401
405
|
const response = await this.rpc.proxy.request.bridge({
|
|
402
406
|
functionName: "read_snippets",
|
|
403
407
|
payload: undefined,
|
|
@@ -405,7 +409,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
405
409
|
return response as Snippets;
|
|
406
410
|
};
|
|
407
411
|
|
|
408
|
-
openFile: EditRequests["openFile"] = async ({ path }) => {
|
|
412
|
+
public openFile: EditRequests["openFile"] = async ({ path }) => {
|
|
409
413
|
const url = createShareableLink({
|
|
410
414
|
code: null,
|
|
411
415
|
baseUrl: window.location.origin,
|
|
@@ -414,7 +418,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
414
418
|
return null;
|
|
415
419
|
};
|
|
416
420
|
|
|
417
|
-
sendListFiles: EditRequests["sendListFiles"] = async (request) => {
|
|
421
|
+
public sendListFiles: EditRequests["sendListFiles"] = async (request) => {
|
|
418
422
|
const response = await this.rpc.proxy.request.bridge({
|
|
419
423
|
functionName: "list_files",
|
|
420
424
|
payload: request,
|
|
@@ -422,7 +426,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
422
426
|
return response as FileListResponse;
|
|
423
427
|
};
|
|
424
428
|
|
|
425
|
-
getFileRoots: EditRequests["getFileRoots"] = async () => {
|
|
429
|
+
public getFileRoots: EditRequests["getFileRoots"] = async () => {
|
|
426
430
|
const response = await this.rpc.proxy.request.bridge({
|
|
427
431
|
functionName: "file_roots",
|
|
428
432
|
payload: undefined,
|
|
@@ -430,7 +434,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
430
434
|
return response as FileRootsResponse;
|
|
431
435
|
};
|
|
432
436
|
|
|
433
|
-
sendSearchFiles: EditRequests["sendSearchFiles"] = async (request) => {
|
|
437
|
+
public sendSearchFiles: EditRequests["sendSearchFiles"] = async (request) => {
|
|
434
438
|
const response = await this.rpc.proxy.request.bridge({
|
|
435
439
|
functionName: "search_files",
|
|
436
440
|
payload: request,
|
|
@@ -438,7 +442,9 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
438
442
|
return response as FileSearchResponse;
|
|
439
443
|
};
|
|
440
444
|
|
|
441
|
-
sendComponentValues: RunRequests["sendComponentValues"] = async (
|
|
445
|
+
public sendComponentValues: RunRequests["sendComponentValues"] = async (
|
|
446
|
+
request,
|
|
447
|
+
) => {
|
|
442
448
|
await this.putControlRequest({
|
|
443
449
|
type: "update-ui-element",
|
|
444
450
|
...request,
|
|
@@ -447,11 +453,13 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
447
453
|
return null;
|
|
448
454
|
};
|
|
449
455
|
|
|
450
|
-
sendInstantiate: RunRequests["sendInstantiate"] = async (request) => {
|
|
456
|
+
public sendInstantiate: RunRequests["sendInstantiate"] = async (request) => {
|
|
451
457
|
return null;
|
|
452
458
|
};
|
|
453
459
|
|
|
454
|
-
sendFunctionRequest: RunRequests["sendFunctionRequest"] = async (
|
|
460
|
+
public sendFunctionRequest: RunRequests["sendFunctionRequest"] = async (
|
|
461
|
+
request,
|
|
462
|
+
) => {
|
|
455
463
|
await this.putControlRequest({
|
|
456
464
|
type: "invoke-function",
|
|
457
465
|
...request,
|
|
@@ -459,39 +467,37 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
459
467
|
return null;
|
|
460
468
|
};
|
|
461
469
|
|
|
462
|
-
sendCreateFileOrFolder: EditRequests["sendCreateFileOrFolder"] =
|
|
463
|
-
request
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
};
|
|
470
|
+
public sendCreateFileOrFolder: EditRequests["sendCreateFileOrFolder"] =
|
|
471
|
+
async (request) => {
|
|
472
|
+
// The WASM RPC boundary can only carry JSON, so we base64-encode the
|
|
473
|
+
// file bytes here. The HTTP transport uses multipart/form-data instead.
|
|
474
|
+
let contents: string | null = null;
|
|
475
|
+
if (request.file) {
|
|
476
|
+
const dataUrl = await serializeBlob(request.file);
|
|
477
|
+
contents = dataUrl.split(",")[1] ?? "";
|
|
478
|
+
}
|
|
479
|
+
const response = await this.rpc.proxy.request.bridge({
|
|
480
|
+
functionName: "create_file_or_directory",
|
|
481
|
+
payload: {
|
|
482
|
+
path: request.path,
|
|
483
|
+
type: request.type,
|
|
484
|
+
name: request.name,
|
|
485
|
+
contents,
|
|
486
|
+
},
|
|
487
|
+
});
|
|
488
|
+
return response as FileCreateResponse;
|
|
489
|
+
};
|
|
483
490
|
|
|
484
|
-
sendDeleteFileOrFolder: EditRequests["sendDeleteFileOrFolder"] =
|
|
485
|
-
request
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
};
|
|
491
|
+
public sendDeleteFileOrFolder: EditRequests["sendDeleteFileOrFolder"] =
|
|
492
|
+
async (request) => {
|
|
493
|
+
const response = await this.rpc.proxy.request.bridge({
|
|
494
|
+
functionName: "delete_file_or_directory",
|
|
495
|
+
payload: request,
|
|
496
|
+
});
|
|
497
|
+
return response as FileDeleteResponse;
|
|
498
|
+
};
|
|
493
499
|
|
|
494
|
-
sendCopyFileOrFolder: EditRequests["sendCopyFileOrFolder"] = async (
|
|
500
|
+
public sendCopyFileOrFolder: EditRequests["sendCopyFileOrFolder"] = async (
|
|
495
501
|
request,
|
|
496
502
|
) => {
|
|
497
503
|
const response = await this.rpc.proxy.request.bridge({
|
|
@@ -501,17 +507,16 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
501
507
|
return response as FileCopyResponse;
|
|
502
508
|
};
|
|
503
509
|
|
|
504
|
-
sendRenameFileOrFolder: EditRequests["sendRenameFileOrFolder"] =
|
|
505
|
-
request
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
};
|
|
510
|
+
public sendRenameFileOrFolder: EditRequests["sendRenameFileOrFolder"] =
|
|
511
|
+
async (request) => {
|
|
512
|
+
const response = await this.rpc.proxy.request.bridge({
|
|
513
|
+
functionName: "move_file_or_directory",
|
|
514
|
+
payload: request,
|
|
515
|
+
});
|
|
516
|
+
return response as FileMoveResponse;
|
|
517
|
+
};
|
|
513
518
|
|
|
514
|
-
sendUpdateFile: EditRequests["sendUpdateFile"] = async (request) => {
|
|
519
|
+
public sendUpdateFile: EditRequests["sendUpdateFile"] = async (request) => {
|
|
515
520
|
const response = await this.rpc.proxy.request.bridge({
|
|
516
521
|
functionName: "update_file",
|
|
517
522
|
payload: request,
|
|
@@ -519,7 +524,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
519
524
|
return response as FileUpdateResponse;
|
|
520
525
|
};
|
|
521
526
|
|
|
522
|
-
sendFileDetails: EditRequests["sendFileDetails"] = async (request) => {
|
|
527
|
+
public sendFileDetails: EditRequests["sendFileDetails"] = async (request) => {
|
|
523
528
|
const response = await this.rpc.proxy.request.bridge({
|
|
524
529
|
functionName: "file_details",
|
|
525
530
|
payload: request,
|
|
@@ -527,24 +532,18 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
527
532
|
return response as FileDetailsResponse;
|
|
528
533
|
};
|
|
529
534
|
|
|
530
|
-
exportAsHTML: EditRequests["exportAsHTML"] = async (
|
|
535
|
+
public exportAsHTML: EditRequests["exportAsHTML"] = async (
|
|
531
536
|
request: ExportAsHTMLRequest,
|
|
532
537
|
) => {
|
|
533
538
|
await this.pendingSessionSave;
|
|
534
|
-
if (
|
|
535
|
-
process.env.NODE_ENV === "development" ||
|
|
536
|
-
process.env.NODE_ENV === "test"
|
|
537
|
-
) {
|
|
538
|
-
request.assetUrl = window.location.origin;
|
|
539
|
-
}
|
|
540
539
|
const response = await this.rpc.proxy.request.bridge({
|
|
541
540
|
functionName: "export_html",
|
|
542
|
-
payload: request,
|
|
541
|
+
payload: withDevAssetUrl(request),
|
|
543
542
|
});
|
|
544
543
|
return response as ExportedFile<string>;
|
|
545
544
|
};
|
|
546
545
|
|
|
547
|
-
exportAsMarkdown: EditRequests["exportAsMarkdown"] = async (
|
|
546
|
+
public exportAsMarkdown: EditRequests["exportAsMarkdown"] = async (
|
|
548
547
|
request: ExportAsMarkdownRequest,
|
|
549
548
|
) => {
|
|
550
549
|
await this.pendingSessionSave;
|
|
@@ -555,7 +554,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
555
554
|
return response as ExportedFile<string>;
|
|
556
555
|
};
|
|
557
556
|
|
|
558
|
-
exportAsScript: EditRequests["exportAsScript"] = async (
|
|
557
|
+
public exportAsScript: EditRequests["exportAsScript"] = async (
|
|
559
558
|
request: ExportAsScriptRequest,
|
|
560
559
|
) => {
|
|
561
560
|
await this.pendingSessionSave;
|
|
@@ -566,7 +565,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
566
565
|
return response as ExportedFile<string>;
|
|
567
566
|
};
|
|
568
567
|
|
|
569
|
-
previewDatasetColumn: EditRequests["previewDatasetColumn"] = async (
|
|
568
|
+
public previewDatasetColumn: EditRequests["previewDatasetColumn"] = async (
|
|
570
569
|
request,
|
|
571
570
|
) => {
|
|
572
571
|
await this.putControlRequest({
|
|
@@ -576,7 +575,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
576
575
|
return null;
|
|
577
576
|
};
|
|
578
577
|
|
|
579
|
-
previewSQLTable: EditRequests["previewSQLTable"] = async (request) => {
|
|
578
|
+
public previewSQLTable: EditRequests["previewSQLTable"] = async (request) => {
|
|
580
579
|
await this.putControlRequest({
|
|
581
580
|
type: "preview-sql-table",
|
|
582
581
|
...request,
|
|
@@ -584,7 +583,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
584
583
|
return null;
|
|
585
584
|
};
|
|
586
585
|
|
|
587
|
-
previewSQLTableList: EditRequests["previewSQLTableList"] = async (
|
|
586
|
+
public previewSQLTableList: EditRequests["previewSQLTableList"] = async (
|
|
588
587
|
request,
|
|
589
588
|
) => {
|
|
590
589
|
await this.putControlRequest({
|
|
@@ -594,7 +593,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
594
593
|
return null;
|
|
595
594
|
};
|
|
596
595
|
|
|
597
|
-
previewSQLSchemaList: EditRequests["previewSQLSchemaList"] = async (
|
|
596
|
+
public previewSQLSchemaList: EditRequests["previewSQLSchemaList"] = async (
|
|
598
597
|
request,
|
|
599
598
|
) => {
|
|
600
599
|
await this.putControlRequest({
|
|
@@ -604,7 +603,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
604
603
|
return null;
|
|
605
604
|
};
|
|
606
605
|
|
|
607
|
-
previewDataSourceConnection: EditRequests["previewDataSourceConnection"] =
|
|
606
|
+
public previewDataSourceConnection: EditRequests["previewDataSourceConnection"] =
|
|
608
607
|
async (request) => {
|
|
609
608
|
await this.putControlRequest({
|
|
610
609
|
type: "list-data-source-connection",
|
|
@@ -613,7 +612,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
613
612
|
return null;
|
|
614
613
|
};
|
|
615
614
|
|
|
616
|
-
validateSQL: EditRequests["validateSQL"] = async (request) => {
|
|
615
|
+
public validateSQL: EditRequests["validateSQL"] = async (request) => {
|
|
617
616
|
await this.putControlRequest({
|
|
618
617
|
type: "validate-sql",
|
|
619
618
|
...request,
|
|
@@ -621,7 +620,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
621
620
|
return null;
|
|
622
621
|
};
|
|
623
622
|
|
|
624
|
-
sendModelValue: RunRequests["sendModelValue"] = async (request) => {
|
|
623
|
+
public sendModelValue: RunRequests["sendModelValue"] = async (request) => {
|
|
625
624
|
await this.putControlRequest({
|
|
626
625
|
type: "model",
|
|
627
626
|
...request,
|
|
@@ -629,31 +628,31 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
629
628
|
return null;
|
|
630
629
|
};
|
|
631
630
|
|
|
632
|
-
sendDocumentTransaction = () => Promise.resolve(null);
|
|
631
|
+
public sendDocumentTransaction = () => Promise.resolve(null);
|
|
633
632
|
|
|
634
|
-
addPackage: EditRequests["addPackage"] = async (request) => {
|
|
633
|
+
public addPackage: EditRequests["addPackage"] = async (request) => {
|
|
635
634
|
return this.rpc.proxy.request.addPackage(request);
|
|
636
635
|
};
|
|
637
|
-
removePackage: EditRequests["removePackage"] = async (request) => {
|
|
636
|
+
public removePackage: EditRequests["removePackage"] = async (request) => {
|
|
638
637
|
return this.rpc.proxy.request.removePackage(request);
|
|
639
638
|
};
|
|
640
|
-
getPackageList = async () => {
|
|
639
|
+
public getPackageList = async () => {
|
|
641
640
|
const response = await this.rpc.proxy.request.listPackages();
|
|
642
641
|
return response;
|
|
643
642
|
};
|
|
644
643
|
|
|
645
|
-
getSandbox: EditRequests["getSandbox"] = async () => ({
|
|
644
|
+
public getSandbox: EditRequests["getSandbox"] = async () => ({
|
|
646
645
|
backend: null,
|
|
647
646
|
manifest: null,
|
|
648
647
|
filename: null,
|
|
649
648
|
});
|
|
650
|
-
updateManifest: EditRequests["updateManifest"] = async () => {
|
|
649
|
+
public updateManifest: EditRequests["updateManifest"] = async () => {
|
|
651
650
|
throw new Error("Sandboxes are not supported in WebAssembly");
|
|
652
651
|
};
|
|
653
|
-
syncSandbox: EditRequests["syncSandbox"] = async () => {
|
|
652
|
+
public syncSandbox: EditRequests["syncSandbox"] = async () => {
|
|
654
653
|
throw new Error("Sandboxes are not supported in WebAssembly");
|
|
655
654
|
};
|
|
656
|
-
getDependencyTree: EditRequests["getDependencyTree"] = async () => {
|
|
655
|
+
public getDependencyTree: EditRequests["getDependencyTree"] = async () => {
|
|
657
656
|
// WASM doesn't support dependency trees yet
|
|
658
657
|
return {
|
|
659
658
|
tree: {
|
|
@@ -666,7 +665,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
666
665
|
};
|
|
667
666
|
};
|
|
668
667
|
|
|
669
|
-
listSecretKeys: EditRequests["listSecretKeys"] = async (request) => {
|
|
668
|
+
public listSecretKeys: EditRequests["listSecretKeys"] = async (request) => {
|
|
670
669
|
await this.putControlRequest({
|
|
671
670
|
type: "list-secret-keys",
|
|
672
671
|
...request,
|
|
@@ -674,7 +673,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
674
673
|
return null;
|
|
675
674
|
};
|
|
676
675
|
|
|
677
|
-
discoverDataSources: EditRequests["discoverDataSources"] = async (
|
|
676
|
+
public discoverDataSources: EditRequests["discoverDataSources"] = async (
|
|
678
677
|
request,
|
|
679
678
|
) => {
|
|
680
679
|
await this.putControlRequest({
|
|
@@ -684,33 +683,33 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
684
683
|
return null;
|
|
685
684
|
};
|
|
686
685
|
|
|
687
|
-
getUsageStats = throwNotImplemented;
|
|
688
|
-
getEnvironmentInfo: EditRequests["getEnvironmentInfo"] = async () => {
|
|
686
|
+
public getUsageStats = throwNotImplemented;
|
|
687
|
+
public getEnvironmentInfo: EditRequests["getEnvironmentInfo"] = async () => {
|
|
689
688
|
const response = await this.rpc.proxy.request.bridge({
|
|
690
689
|
functionName: "get_environment_info",
|
|
691
690
|
payload: undefined,
|
|
692
691
|
});
|
|
693
692
|
return response as EnvironmentInfo;
|
|
694
693
|
};
|
|
695
|
-
openTutorial = throwNotImplemented;
|
|
696
|
-
getRecentFiles = throwNotImplemented;
|
|
697
|
-
getWorkspaceFiles = throwNotImplemented;
|
|
698
|
-
getRunningNotebooks = throwNotImplemented;
|
|
699
|
-
shutdownSession = throwNotImplemented;
|
|
700
|
-
getExportAvailability = throwNotImplemented;
|
|
701
|
-
installExportRequirements = throwNotImplemented;
|
|
702
|
-
exportAsIPYNB = throwNotImplemented;
|
|
703
|
-
exportAsPDF = throwNotImplemented;
|
|
704
|
-
autoExportAsHTML = throwNotImplemented;
|
|
705
|
-
autoExportAsMarkdown = throwNotImplemented;
|
|
706
|
-
autoExportAsIPYNB = throwNotImplemented;
|
|
707
|
-
updateCellOutputs = throwNotImplemented;
|
|
708
|
-
writeSecret = throwNotImplemented;
|
|
709
|
-
invokeAiTool = throwNotImplemented;
|
|
710
|
-
clearCache = throwNotImplemented;
|
|
711
|
-
getCacheInfo = throwNotImplemented;
|
|
712
|
-
listStorageEntries = throwNotImplemented;
|
|
713
|
-
downloadStorage = throwNotImplemented;
|
|
694
|
+
public openTutorial = throwNotImplemented;
|
|
695
|
+
public getRecentFiles = throwNotImplemented;
|
|
696
|
+
public getWorkspaceFiles = throwNotImplemented;
|
|
697
|
+
public getRunningNotebooks = throwNotImplemented;
|
|
698
|
+
public shutdownSession = throwNotImplemented;
|
|
699
|
+
public getExportAvailability = throwNotImplemented;
|
|
700
|
+
public installExportRequirements = throwNotImplemented;
|
|
701
|
+
public exportAsIPYNB = throwNotImplemented;
|
|
702
|
+
public exportAsPDF = throwNotImplemented;
|
|
703
|
+
public autoExportAsHTML = throwNotImplemented;
|
|
704
|
+
public autoExportAsMarkdown = throwNotImplemented;
|
|
705
|
+
public autoExportAsIPYNB = throwNotImplemented;
|
|
706
|
+
public updateCellOutputs = throwNotImplemented;
|
|
707
|
+
public writeSecret = throwNotImplemented;
|
|
708
|
+
public invokeAiTool = throwNotImplemented;
|
|
709
|
+
public clearCache = throwNotImplemented;
|
|
710
|
+
public getCacheInfo = throwNotImplemented;
|
|
711
|
+
public listStorageEntries = throwNotImplemented;
|
|
712
|
+
public downloadStorage = throwNotImplemented;
|
|
714
713
|
|
|
715
714
|
private async putControlRequest(operation: CommandMessage) {
|
|
716
715
|
await this.rpc.proxy.request.bridge({
|
package/src/core/wasm/router.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
class URLPyodideRouter {
|
|
3
|
-
getFilename(): string | null {
|
|
3
|
+
public getFilename(): string | null {
|
|
4
4
|
return this.getSearchParam("filename");
|
|
5
5
|
}
|
|
6
|
-
setFilename(filename: string) {
|
|
6
|
+
public setFilename(filename: string) {
|
|
7
7
|
this.setSearchParam("filename", filename);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
getCodeFromSearchParam(): string | null {
|
|
10
|
+
public getCodeFromSearchParam(): string | null {
|
|
11
11
|
return this.getSearchParam("code");
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
getCodeFromHash(): string | null {
|
|
14
|
+
public getCodeFromHash(): string | null {
|
|
15
15
|
const hash = window.location.hash;
|
|
16
16
|
const prefix = "#code/";
|
|
17
17
|
if (!hash.startsWith(prefix)) {
|
|
@@ -20,7 +20,7 @@ class URLPyodideRouter {
|
|
|
20
20
|
return hash.slice(prefix.length);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
setCodeForHash(code: string) {
|
|
23
|
+
public setCodeForHash(code: string) {
|
|
24
24
|
window.location.hash = `#code/${code}`;
|
|
25
25
|
}
|
|
26
26
|
|
package/src/core/wasm/store.ts
CHANGED
|
@@ -99,19 +99,19 @@ const emptyFileStore: FileStore = {
|
|
|
99
99
|
|
|
100
100
|
export class CompositeFileStore implements FileStore {
|
|
101
101
|
private stores: FileStore[];
|
|
102
|
-
constructor(stores: FileStore[]) {
|
|
102
|
+
public constructor(stores: FileStore[]) {
|
|
103
103
|
this.stores = stores;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
insert(index: number, store: FileStore) {
|
|
106
|
+
public insert(index: number, store: FileStore) {
|
|
107
107
|
this.stores.splice(index, 0, store);
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
saveFile(contents: string) {
|
|
110
|
+
public saveFile(contents: string) {
|
|
111
111
|
this.stores.forEach((store) => store.saveFile(contents));
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
readFile() {
|
|
114
|
+
public readFile() {
|
|
115
115
|
for (const store of this.stores) {
|
|
116
116
|
const contents = store.readFile();
|
|
117
117
|
if (contents) {
|