@marimo-team/frontend 0.15.5 → 0.16.0-dev96986
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-CNLoZkWr.js +19 -0
- package/dist/assets/{ImageComparisonComponent-CEXMKKA4.js → ImageComparisonComponent-SX7fDaTK.js} +1 -1
- package/dist/assets/{VegaLite-Bt14Ds9k.js → VegaLite-MJUW3b7C.js} +6 -6
- package/dist/assets/_baseEach-9_logFrf.js +1 -0
- package/dist/assets/_baseMap-NzEbKt5c.js +1 -0
- package/dist/assets/_baseUniq-C5LFcyNC.js +1 -0
- package/dist/assets/_createAggregator-ZRm2b6Zm.js +1 -0
- package/dist/assets/agent-panel-BBd11wNX.js +287 -0
- package/dist/assets/agent-panel-D92Mfy1i.css +1 -0
- package/dist/assets/{any-language-editor-DiwNT6zp.js → any-language-editor-DwAaEQfS.js} +1 -1
- package/dist/assets/architectureDiagram-W76B3OCA-BJmVXUoW.js +36 -0
- package/dist/assets/{between-horizontal-start-FyewyCGn.js → between-horizontal-start-KiwU-a3C.js} +1 -1
- package/dist/assets/{blockDiagram-QIGZ2CNN-BrOkAf_c.js → blockDiagram-QIGZ2CNN-DzxZjE7B.js} +1 -1
- package/dist/assets/{c4Diagram-FPNF74CW-BHPzDxE2.js → c4Diagram-FPNF74CW-DjmldG_J.js} +5 -5
- package/dist/assets/channel-DHcKBVM4.js +1 -0
- package/dist/assets/chat-panel-DgJZr0eS.js +3 -0
- package/dist/assets/{chunk-4BX2VUAB-DLxaCNYh.js → chunk-4BX2VUAB-EUTQThiZ.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-DdzvO3HR.js → chunk-55IACEB6-DZAiDJxy.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-R5o-nSiG.js → chunk-FMBD7UC4-Bd0Czs-J.js} +1 -1
- package/dist/assets/{chunk-K7UQS3LO-DxaMrGgG.js → chunk-K7UQS3LO-DEKMIknX.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-DqS9-FYm.js → chunk-QN33PNHL-E0jwHU_n.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-BZ-TzajS.js → chunk-QZHKN3VN-BzaIHJbq.js} +1 -1
- package/dist/assets/{chunk-TVAH2DTR-BsgP2dyv.js → chunk-TVAH2DTR-CZFYvqnm.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-D-h3ahXI.js → chunk-TZMSLE5B-BNqnFjtv.js} +1 -1
- package/dist/assets/{circle-play-CQtRZ-rT.js → circle-play-D3J_mYrF.js} +1 -1
- package/dist/assets/classDiagram-KNZD7YFC-D-xwLnlX.js +1 -0
- package/dist/assets/classDiagram-v2-RKCZMP56-D-xwLnlX.js +1 -0
- package/dist/assets/{clear-button-BY6Z_ViL.js → clear-button-ifzRuAR3.js} +1 -1
- package/dist/assets/clone-CSxIll62.js +1 -0
- package/dist/assets/command-palette-D2fdVSET.js +1 -0
- package/dist/assets/common-Ku-cF_2J.js +1 -0
- package/dist/assets/{compile-Ct_jzdKr.js → compile-BgZlHW1c.js} +1 -1
- package/dist/assets/cose-bilkent-S5V4N54A-CVM83SqK.js +1 -0
- package/dist/assets/dagre-5GWH7T2D-ouQPkxT3.js +4 -0
- package/dist/assets/{data-grid-overlay-editor-BN_wulc3.js → data-grid-overlay-editor-B47j5GJJ.js} +1 -1
- package/dist/assets/datasources-panel-Bt41Zir-.js +1 -0
- package/dist/assets/{dependency-graph-panel-BOmSCZf7.js → dependency-graph-panel-CZC_B7pK.js} +4 -4
- package/dist/assets/diagram-N5W7TBWH-CQ817ZdR.js +24 -0
- package/dist/assets/diagram-QEK2KX5R-DOK_psUO.js +43 -0
- package/dist/assets/diagram-S2PKOQOG-CVljmOW8.js +24 -0
- package/dist/assets/{documentation-panel-BxjJO_Gw.js → documentation-panel-C7yIvGg1.js} +1 -1
- package/dist/assets/edit-page-CyTMQV2u.js +129 -0
- package/dist/assets/{ellipsis-vertical-UHbmjI2n.js → ellipsis-vertical-C7FjlUsY.js} +1 -1
- package/dist/assets/{empty-state-BIBXzY_0.js → empty-state-DIOGM_CU.js} +1 -1
- package/dist/assets/{erDiagram-AWTI2OKA-E84mAle_.js → erDiagram-AWTI2OKA-DYu8cEdc.js} +1 -1
- package/dist/assets/{error-panel-MEvQ6K7h.js → error-panel-Ddb8RkFG.js} +1 -1
- package/dist/assets/file-explorer-panel-Oy9DbyFP.js +1 -0
- package/dist/assets/{flowDiagram-PVAE7QVJ-DfbIRSAW.js → flowDiagram-PVAE7QVJ-CmvW5iTb.js} +1 -1
- package/dist/assets/{ganttDiagram-OWAHRB6G-DR4HZ1z_.js → ganttDiagram-OWAHRB6G-BaKQlCaT.js} +4 -4
- package/dist/assets/gitGraphDiagram-NY62KEGX-CWO24eP6.js +65 -0
- package/dist/assets/{glide-data-editor-nNmo1lPq.js → glide-data-editor-CNDLEJ9a.js} +11 -11
- package/dist/assets/graph-BZKTtxsc.js +1 -0
- package/dist/assets/home-page-Bvwppn9N.js +9 -0
- package/dist/assets/{index-VPWqq2Pg.js → index-0XOUPdwT.js} +1 -1
- package/dist/assets/{index-uacyUula.js → index-BH7f3aiU.js} +1 -1
- package/dist/assets/{index-Dt9UWeWn.js → index-BJVyzkx5.js} +1 -1
- package/dist/assets/{index-BAH034Ue.js → index-B_d_JZGI.js} +1 -1
- package/dist/assets/{index-CB2pnVQG.js → index-BgXbBA39.js} +1 -1
- package/dist/assets/{index-B8llrTSo.js → index-Brf2DwUM.js} +1 -1
- package/dist/assets/{index-BLu5CX6z.js → index-CXrWwFX6.js} +1 -1
- package/dist/assets/{index-DyLSuOH1.js → index-CZaurnA9.js} +1 -1
- package/dist/assets/{index-BFSnz7iM.js → index-CerjupfZ.js} +1 -1
- package/dist/assets/{index-B7yXbrLa.js → index-D-tZfElD.js} +1 -1
- package/dist/assets/{index-c6If577Q.js → index-D3PqGupX.js} +1 -1
- package/dist/assets/{index-CSgxTUzD.js → index-DCkzth56.js} +1 -1
- package/dist/assets/{index-DWOaniGT.js → index-DFrGFNW1.js} +1 -1
- package/dist/assets/{index-CPN7TRA1.js → index-DZhOPkOB.js} +1 -1
- package/dist/assets/index-DadI618h.css +1 -0
- package/dist/assets/{index-DqzMPAC8.js → index-DkntzpX4.js} +2 -2
- package/dist/assets/{index-B1_GXGaP.js → index-DmgwT3sx.js} +1 -1
- package/dist/assets/index-PmY0x4Zd.js +578 -0
- package/dist/assets/{index-Bq516OmX.js → index-WXJFkQHg.js} +1 -1
- package/dist/assets/{index-DSU75csX.js → index-qE8lHQ-N.js} +1 -1
- package/dist/assets/{index-DMomwMcN.js → index-zrSUQXha.js} +1 -1
- package/dist/assets/infoDiagram-STP46IZ2-CAuVVehw.js +2 -0
- package/dist/assets/isEmpty-D1t7Gran.js +1 -0
- package/dist/assets/{journeyDiagram-BIP6EPQ6-BBiFyygf.js → journeyDiagram-BIP6EPQ6-D4Rp6H_h.js} +1 -1
- package/dist/assets/{kanban-definition-6OIFK2YF-DhgA6Nt6.js → kanban-definition-6OIFK2YF-DFt9DftA.js} +4 -4
- package/dist/assets/layout-D8WXi2_g.js +1 -0
- package/dist/assets/linear-BwY8e5hA.js +1 -0
- package/dist/assets/links-4B6ldZ5P.js +7 -0
- package/dist/assets/{logs-panel-B9SmTZAW.js → logs-panel-Dxiyt7dO.js} +1 -1
- package/dist/assets/{agent-panel-DpQ6muj-.css → markdown-renderer-ClyzDMmG.css} +1 -1
- package/dist/assets/markdown-renderer-VDu-NBKB.js +263 -0
- package/dist/assets/mermaid-B-O-Puyi.js +1 -0
- package/dist/assets/{mermaid.core-4nVOEVX3.js → mermaid.core-BFFCqfOn.js} +41 -41
- package/dist/assets/min-DtVSfYKl.js +1 -0
- package/dist/assets/{mindmap-definition-Q6HEUPPD-CVLQNn1q.js → mindmap-definition-Q6HEUPPD-kyvIY8Dg.js} +2 -2
- package/dist/assets/{number-overlay-editor-CzRzXLcd.js → number-overlay-editor-GjLB2UK4.js} +1 -1
- package/dist/assets/outline-panel-CMJjOoN7.js +1 -0
- package/dist/assets/packages-panel-nfXB-bKW.js +1 -0
- package/dist/assets/{pieDiagram-ADFJNKIX-C5IQ5DBZ.js → pieDiagram-ADFJNKIX-D8JFQcWR.js} +3 -3
- package/dist/assets/{quadrantDiagram-LMRXKWRM-CFXFnQxx.js → quadrantDiagram-LMRXKWRM-Nf8GzxXG.js} +1 -1
- package/dist/assets/{react-plotly-mzdv02_Y.js → react-plotly-CnW9p7ZA.js} +1 -1
- package/dist/assets/{requirementDiagram-4UW4RH46-D9bPC89T.js → requirementDiagram-4UW4RH46-CCUxF8BZ.js} +1 -1
- package/dist/assets/run-page-Bl4p3AbZ.js +1 -0
- package/dist/assets/sankeyDiagram-GR3RE2ED-Sr8kDwP1.js +10 -0
- package/dist/assets/scratchpad-panel-Ja1Mu-W3.js +1 -0
- package/dist/assets/secrets-panel-B-3fcSyP.js +1 -0
- package/dist/assets/{sequenceDiagram-C3RYC4MD-6N7_hY4k.js → sequenceDiagram-C3RYC4MD-CBJ152Q3.js} +4 -4
- package/dist/assets/{slides-component-DMjQomc3.css → slides-component-C-LoGC1U.css} +1 -1
- package/dist/assets/{slides-component-EcjC8sDK.js → slides-component-DGtsVP5o.js} +1 -1
- package/dist/assets/snippets-panel-ClNnwKBM.js +1 -0
- package/dist/assets/sortBy-D47H6Vyl.js +1 -0
- package/dist/assets/state-B_RCHTH5.js +1 -0
- package/dist/assets/stateDiagram-KXAO66HF-BlBFSAZr.js +1 -0
- package/dist/assets/stateDiagram-v2-UMBNRL4Z-DbA-iToo.js +1 -0
- package/dist/assets/storage-BNcWOH3-.js +26 -0
- package/dist/assets/terminal-CATzv5Hd.js +10 -0
- package/dist/assets/time-CsYqILfB.js +1 -0
- package/dist/assets/{timeline-definition-XQNQX7LJ-BEaynAiY.js → timeline-definition-XQNQX7LJ-CGrhjuAs.js} +1 -1
- package/dist/assets/tracing-DUbJtOyq.js +2 -0
- package/dist/assets/{tracing-panel-BmuHLPrY.js → tracing-panel-DmzqPUtc.js} +2 -2
- package/dist/assets/{trash-UBqfK4mR.js → trash-rxdjLzkf.js} +1 -1
- package/dist/assets/{tree-XiEycetl.js → tree-C2Ul1h1C.js} +1 -1
- package/dist/assets/{treemap-75Q7IDZK-CnuVFbBG.js → treemap-75Q7IDZK-N9hyUpyj.js} +20 -20
- package/dist/assets/{ts-tags-CloPe9IY.js → ts-tags-DxCDHihD.js} +1 -1
- package/dist/assets/variable-panel-BbgupOdG.js +1 -0
- package/dist/assets/{vega-component-DsTH4tuX.js → vega-component-CR_MHOBT.js} +1 -1
- package/dist/assets/worker-fHbtoWvT.js +1 -0
- package/dist/assets/{xychartDiagram-6GGTOJPD-Dcz3O-A3.js → xychartDiagram-6GGTOJPD-jdLZsMb2.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +10 -5
- package/src/__tests__/mocks.ts +43 -0
- package/src/components/app-config/user-config-form.tsx +78 -1
- package/src/components/chat/acp/__tests__/__snapshots__/prompt.test.ts.snap +116 -65
- package/src/components/chat/acp/__tests__/atoms.test.ts +1 -1
- package/src/components/chat/acp/__tests__/context-utils.test.ts +222 -0
- package/src/components/chat/acp/__tests__/prompt.test.ts +1 -1
- package/src/components/chat/acp/__tests__/state.test.ts +38 -42
- package/src/components/chat/acp/agent-docs.tsx +33 -6
- package/src/components/chat/acp/agent-panel.css +0 -18
- package/src/components/chat/acp/agent-panel.tsx +394 -72
- package/src/components/chat/acp/agent-selector.tsx +7 -1
- package/src/components/chat/acp/blocks.tsx +40 -10
- package/src/components/chat/acp/common.tsx +10 -2
- package/src/components/chat/acp/context-utils.ts +127 -0
- package/src/components/chat/acp/prompt.ts +96 -53
- package/src/components/chat/acp/state.ts +1 -1
- package/src/components/chat/acp/types.ts +8 -0
- package/src/components/chat/chat-panel.tsx +28 -89
- package/src/components/chat/chat-utils.ts +127 -1
- package/src/components/chat/markdown-renderer.css +39 -0
- package/src/components/chat/markdown-renderer.tsx +12 -47
- package/src/components/chat/tool-call-accordion.tsx +148 -26
- package/src/components/data-table/SearchBar.tsx +8 -7
- package/src/components/data-table/__tests__/column_formatting.test.ts +50 -35
- package/src/components/data-table/__tests__/data-table.test.tsx +39 -1
- package/src/components/data-table/cell-hover-template/feature.ts +14 -0
- package/src/components/data-table/cell-hover-template/types.ts +11 -0
- package/src/components/data-table/charts/components/form-fields.tsx +41 -37
- package/src/components/data-table/charts/forms/common-chart.tsx +2 -2
- package/src/components/data-table/column-explorer-panel/column-explorer.tsx +5 -2
- package/src/components/data-table/column-formatting/feature.ts +62 -29
- package/src/components/data-table/column-formatting/types.ts +1 -0
- package/src/components/data-table/column-header.tsx +3 -1
- package/src/components/data-table/column-summary/chart-spec-model.tsx +24 -7
- package/src/components/data-table/column-summary/column-summary.tsx +18 -9
- package/src/components/data-table/columns.tsx +42 -18
- package/src/components/data-table/data-table.tsx +10 -2
- package/src/components/data-table/date-popover.tsx +85 -75
- package/src/components/data-table/filter-pills.tsx +14 -9
- package/src/components/data-table/header-items.tsx +5 -1
- package/src/components/data-table/pagination.tsx +20 -13
- package/src/components/data-table/renderers.tsx +28 -0
- package/src/components/data-table/row-viewer-panel/row-viewer.tsx +10 -8
- package/src/components/datasources/column-preview.tsx +6 -2
- package/src/components/datasources/datasources.tsx +8 -12
- package/src/components/editor/Cell.tsx +6 -0
- package/src/components/editor/actions/name-cell-input.tsx +6 -1
- package/src/components/editor/actions/useCellActionButton.tsx +3 -1
- package/src/components/editor/ai/__tests__/completion-utils.test.ts +178 -1
- package/src/components/editor/ai/add-cell-with-ai.tsx +68 -66
- package/src/components/editor/ai/ai-completion-editor.tsx +29 -26
- package/src/components/editor/ai/completion-handlers.tsx +44 -6
- package/src/components/editor/ai/completion-utils.ts +92 -0
- package/src/components/editor/ai/transport/chat-transport.tsx +39 -0
- package/src/components/editor/cell/CellStatus.tsx +23 -20
- package/src/components/editor/cell/CreateCellButton.tsx +3 -4
- package/src/components/editor/cell/StagedAICell.tsx +51 -0
- package/src/components/editor/cell/cell-actions.tsx +2 -1
- package/src/components/editor/cell/code/language-toggle.tsx +3 -4
- package/src/components/editor/chrome/wrapper/footer-items/machine-stats.tsx +39 -28
- package/src/components/editor/controls/notebook-menu-dropdown.tsx +4 -2
- package/src/components/editor/file-tree/requesting-tree.tsx +14 -8
- package/src/components/editor/renderers/CellArray.tsx +3 -4
- package/src/components/editor/renderers/slides-layout/slides-layout.tsx +3 -3
- package/src/components/editor/renderers/slides-layout/types.ts +1 -0
- package/src/components/pages/home-page.tsx +4 -1
- package/src/components/slides/slides-component.tsx +1 -1
- package/src/components/slides/slides.css +6 -0
- package/src/components/terminal/__tests__/state.test.ts +207 -0
- package/src/components/terminal/hooks.ts +41 -0
- package/src/components/terminal/state.ts +75 -0
- package/src/components/terminal/terminal.tsx +334 -13
- package/src/components/terminal/theme.tsx +57 -0
- package/src/components/tracing/tracing-spec.ts +5 -4
- package/src/components/ui/range-slider.tsx +4 -2
- package/src/components/ui/slider.tsx +3 -1
- package/src/components/variables/variables-table.tsx +3 -0
- package/src/core/MarimoApp.tsx +9 -6
- package/src/core/ai/__tests__/staged-cells.test.ts +356 -0
- package/src/core/ai/context/__tests__/registry.test.ts +6 -4
- package/src/core/ai/context/providers/cell-output.ts +3 -2
- package/src/core/ai/context/providers/error.ts +3 -1
- package/src/core/ai/context/providers/file.ts +7 -2
- package/src/core/ai/context/providers/tables.ts +3 -2
- package/src/core/ai/context/providers/variable.ts +6 -4
- package/src/core/ai/staged-cells.ts +208 -0
- package/src/core/cells/cells.ts +1 -1
- package/src/core/cells/logs.ts +1 -1
- package/src/core/codemirror/find-replace/search-highlight.ts +3 -1
- package/src/core/codemirror/language/LanguageAdapters.ts +9 -3
- package/src/core/codemirror/lsp/federated-lsp.ts +1 -1
- package/src/core/codemirror/lsp/notebook-lsp.ts +8 -2
- package/src/core/codemirror/readonly/__tests__/extension.test.ts +1 -1
- package/src/core/codemirror/rtc/loro/awareness.ts +52 -17
- package/src/core/codemirror/rtc/loro/sync.ts +12 -4
- package/src/core/config/config-schema.ts +1 -0
- package/src/core/config/config.ts +4 -0
- package/src/core/hotkeys/hotkeys.ts +8 -4
- package/src/core/i18n/__tests__/locale-provider.test.tsx +176 -0
- package/src/core/i18n/locale-provider.tsx +35 -0
- package/src/core/i18n/with-locale.tsx +12 -0
- package/src/core/islands/components/web-components.tsx +13 -10
- package/src/core/islands/main.ts +2 -2
- package/src/core/kernel/RuntimeState.ts +4 -1
- package/src/core/kernel/messages.ts +8 -12
- package/src/core/network/DeferredRequestRegistry.ts +16 -4
- package/src/core/runtime/runtime.ts +5 -4
- package/src/core/saving/__tests__/filename.test.ts +37 -0
- package/src/core/static/__tests__/download-html.test.ts +43 -1
- package/src/core/wasm/bridge.ts +5 -1
- package/src/core/wasm/store.ts +4 -1
- package/src/core/wasm/worker/message-buffer.ts +3 -2
- package/src/core/websocket/types.ts +22 -16
- package/src/core/websocket/useMarimoWebSocket.tsx +2 -2
- package/src/css/app/Cell.css +11 -0
- package/src/hooks/useFormatting.ts +97 -0
- package/src/hooks/useTimer.ts +8 -5
- package/src/plugins/core/RenderHTML.tsx +36 -2
- package/src/plugins/core/__test__/RenderHTML.test.ts +72 -0
- package/src/plugins/core/registerReactComponent.tsx +44 -10
- package/src/plugins/impl/DataTablePlugin.tsx +4 -0
- package/src/plugins/impl/FileBrowserPlugin.tsx +8 -2
- package/src/plugins/impl/RangeSliderPlugin.tsx +5 -3
- package/src/plugins/impl/SliderPlugin.tsx +3 -1
- package/src/plugins/impl/anywidget/model.ts +16 -5
- package/src/plugins/impl/data-editor/types.ts +7 -5
- package/src/plugins/impl/data-explorer/components/column-summary.tsx +20 -13
- package/src/plugins/impl/panel/utils.ts +6 -4
- package/src/plugins/layout/OutlinePlugin.tsx +69 -0
- package/src/plugins/layout/StatPlugin.tsx +4 -1
- package/src/plugins/plugins.ts +2 -0
- package/src/stories/cell.stories.tsx +1 -1
- package/src/stories/layout/vertical/one-column.stories.tsx +1 -1
- package/src/utils/__tests__/cell-urls.test.ts +29 -0
- package/src/utils/__tests__/dates.test.ts +45 -24
- package/src/utils/__tests__/filenames.test.ts +18 -0
- package/src/utils/__tests__/numbers.test.ts +42 -30
- package/src/utils/__tests__/once.test.ts +187 -0
- package/src/utils/__tests__/path.test.ts +38 -0
- package/src/utils/__tests__/urls.test.ts +56 -1
- package/src/utils/dates.ts +15 -10
- package/src/utils/edit-distance.ts +8 -6
- package/src/utils/errors.ts +9 -0
- package/src/utils/id-tree.tsx +21 -10
- package/src/utils/localStorage.ts +13 -4
- package/src/utils/numbers.ts +11 -11
- package/src/utils/once.ts +32 -0
- package/src/utils/paths.ts +4 -1
- package/src/utils/pluralize.ts +12 -5
- package/src/utils/python-poet/poet.ts +30 -15
- package/src/utils/time.ts +5 -1
- package/dist/assets/ConnectedDataExplorerComponent-Cn5-l2X1.js +0 -19
- package/dist/assets/_baseEach-C1FLm7WW.js +0 -1
- package/dist/assets/_baseMap-DBVArUYD.js +0 -1
- package/dist/assets/_baseUniq-Dk7ZPJ3N.js +0 -1
- package/dist/assets/_createAggregator-Bn38fDd3.js +0 -1
- package/dist/assets/agent-panel-COUYnuIK.js +0 -475
- package/dist/assets/architectureDiagram-W76B3OCA-DBzWQKKu.js +0 -36
- package/dist/assets/channel-CjhbjOv4.js +0 -1
- package/dist/assets/chat-panel-BPXKoTnZ.js +0 -7
- package/dist/assets/chat-panel-Brrs_eeH.css +0 -1
- package/dist/assets/classDiagram-KNZD7YFC-DHs5cFzy.js +0 -1
- package/dist/assets/classDiagram-v2-RKCZMP56-DHs5cFzy.js +0 -1
- package/dist/assets/clone-DM1YNjEn.js +0 -1
- package/dist/assets/command-palette-S0bzQp7v.js +0 -1
- package/dist/assets/common-B8U9k2Ly.js +0 -1
- package/dist/assets/cose-bilkent-S5V4N54A-wz1Sfx7j.js +0 -1
- package/dist/assets/dagre-5GWH7T2D-BfpcVBgq.js +0 -4
- package/dist/assets/datasources-panel-DfuURLJw.js +0 -1
- package/dist/assets/diagram-N5W7TBWH-Bf0oqqQh.js +0 -24
- package/dist/assets/diagram-QEK2KX5R-ZTc3qikh.js +0 -43
- package/dist/assets/diagram-S2PKOQOG-tLScBy7Z.js +0 -24
- package/dist/assets/edit-page-DJ8kJZ9w.js +0 -129
- package/dist/assets/file-explorer-panel-CzNUJ63G.js +0 -1
- package/dist/assets/gitGraphDiagram-NY62KEGX-C1t6QtVa.js +0 -65
- package/dist/assets/graph-CssCVWIq.js +0 -1
- package/dist/assets/home-page-9eW6qida.js +0 -9
- package/dist/assets/index-CknhX2Vy.css +0 -1
- package/dist/assets/index-DcCIe7np.js +0 -28
- package/dist/assets/index-OC46250R.js +0 -570
- package/dist/assets/infoDiagram-STP46IZ2-CwiAoz9f.js +0 -2
- package/dist/assets/layout-DpQrxGW-.js +0 -1
- package/dist/assets/linear-NsreOeBF.js +0 -1
- package/dist/assets/links-CbvGxbsJ.js +0 -7
- package/dist/assets/mermaid-DSt0r6IQ.js +0 -1
- package/dist/assets/min-D259kI3t.js +0 -1
- package/dist/assets/outline-panel-uvsS-YEQ.js +0 -1
- package/dist/assets/packages-panel-xMz9W2hW.js +0 -1
- package/dist/assets/run-page-Bb68qdhQ.js +0 -1
- package/dist/assets/sankeyDiagram-GR3RE2ED-BSJOau8E.js +0 -10
- package/dist/assets/scratchpad-panel-BF4BO-U4.js +0 -1
- package/dist/assets/secrets-panel-CdIX44dQ.js +0 -1
- package/dist/assets/snippets-panel-Dco9h0rb.js +0 -1
- package/dist/assets/sortBy-aLGA-PGK.js +0 -1
- package/dist/assets/stateDiagram-KXAO66HF-Bd68WT3b.js +0 -1
- package/dist/assets/stateDiagram-v2-UMBNRL4Z-BXz_GSwb.js +0 -1
- package/dist/assets/storage-CGlP4lCF.js +0 -26
- package/dist/assets/terminal-CxkHubcu.js +0 -9
- package/dist/assets/time-D2nr1UgQ.js +0 -1
- package/dist/assets/tracing-kTqHxa7q.js +0 -2
- package/dist/assets/variable-panel-noTnH-AQ.js +0 -1
- package/dist/assets/worker-X5rxzQGQ.js +0 -1
|
@@ -10,6 +10,7 @@ import type { ReactCodeMirrorRef } from "@uiw/react-codemirror";
|
|
|
10
10
|
import type { FileUIPart } from "ai";
|
|
11
11
|
import { getAIContextRegistry } from "@/core/ai/context/context";
|
|
12
12
|
import { getCodes } from "@/core/codemirror/copilot/getCodes";
|
|
13
|
+
import type { LanguageAdapterType } from "@/core/codemirror/language/types";
|
|
13
14
|
import type { AiCompletionRequest } from "@/core/network/types";
|
|
14
15
|
import { store } from "@/core/state/jotai";
|
|
15
16
|
import { Logger } from "@/utils/Logger";
|
|
@@ -145,3 +146,94 @@ export function addContextCompletion(
|
|
|
145
146
|
startCompletion(inputRef.current.view);
|
|
146
147
|
}
|
|
147
148
|
}
|
|
149
|
+
|
|
150
|
+
export interface AiCompletion {
|
|
151
|
+
language: LanguageAdapterType;
|
|
152
|
+
code: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Extracts code blocks (delimited by triple backticks) and their language ("python", "sql", "markdown").
|
|
157
|
+
* Defaults to "python" if no language is specified or no code blocks are found.
|
|
158
|
+
* Returns an array of AiCompletion objects.
|
|
159
|
+
*/
|
|
160
|
+
export function codeToCells(code: string): AiCompletion[] {
|
|
161
|
+
if (code.trim().length === 0) {
|
|
162
|
+
return [];
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// If there are no backticks, assume code is in 1 cell and python
|
|
166
|
+
if (!code.includes("```")) {
|
|
167
|
+
return [{ language: "python", code: code }];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// If code has opening backticks, get the code after it
|
|
171
|
+
const cells: AiCompletion[] = [];
|
|
172
|
+
let start = 0;
|
|
173
|
+
|
|
174
|
+
let openIndex = code.indexOf("```", start);
|
|
175
|
+
while (openIndex !== -1) {
|
|
176
|
+
const newlineIndex = code.indexOf("\n", openIndex);
|
|
177
|
+
if (newlineIndex === -1) {
|
|
178
|
+
// If there's no newline after opening backticks, treat everything after as code
|
|
179
|
+
const remaining = code.slice(openIndex + 3);
|
|
180
|
+
const firstSpace = remaining.indexOf(" ");
|
|
181
|
+
const language =
|
|
182
|
+
firstSpace === -1 ? remaining : remaining.slice(0, firstSpace);
|
|
183
|
+
const finalLanguage =
|
|
184
|
+
language === "markdown"
|
|
185
|
+
? "markdown"
|
|
186
|
+
: language === "sql"
|
|
187
|
+
? "sql"
|
|
188
|
+
: "python";
|
|
189
|
+
// Extract code after the language identifier
|
|
190
|
+
const codeContent =
|
|
191
|
+
firstSpace === -1 ? "" : remaining.slice(firstSpace + 1);
|
|
192
|
+
if (codeContent.trim()) {
|
|
193
|
+
cells.push({ language: finalLanguage, code: codeContent.trim() });
|
|
194
|
+
}
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
let language = code.slice(openIndex + 3, newlineIndex).trim() || "";
|
|
199
|
+
language =
|
|
200
|
+
language === "markdown"
|
|
201
|
+
? "markdown"
|
|
202
|
+
: language === "sql"
|
|
203
|
+
? "sql"
|
|
204
|
+
: "python";
|
|
205
|
+
const codeStart = newlineIndex + 1;
|
|
206
|
+
|
|
207
|
+
const closeIndex = code.indexOf("```", codeStart);
|
|
208
|
+
if (closeIndex === -1) {
|
|
209
|
+
// If there's no closing backticks, treat everything after the opening as code
|
|
210
|
+
const codeContent = code.slice(codeStart).replace(/\n+$/, "");
|
|
211
|
+
if (codeContent.trim()) {
|
|
212
|
+
cells.push({
|
|
213
|
+
language: language as LanguageAdapterType,
|
|
214
|
+
code: codeContent,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// Remove trailing newlines
|
|
221
|
+
const codeContent = code.slice(codeStart, closeIndex).replace(/\n+$/, "");
|
|
222
|
+
if (codeContent.trim()) {
|
|
223
|
+
cells.push({
|
|
224
|
+
language: language as LanguageAdapterType,
|
|
225
|
+
code: codeContent,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
start = closeIndex + 3;
|
|
230
|
+
openIndex = code.indexOf("```", start);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// If no cells found, assume code is in 1 cell and python
|
|
234
|
+
if (cells.length === 0) {
|
|
235
|
+
cells.push({ language: "python", code: code });
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return cells;
|
|
239
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
DefaultChatTransport,
|
|
5
|
+
type HttpChatTransportInitOptions,
|
|
6
|
+
type UIMessage,
|
|
7
|
+
type UIMessageChunk,
|
|
8
|
+
} from "ai";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Thin wrapper around the DefaultChatTransport that calls a callback when a chunk is received.
|
|
12
|
+
*/
|
|
13
|
+
export class StreamingChunkTransport<
|
|
14
|
+
UI_MESSAGE extends UIMessage,
|
|
15
|
+
> extends DefaultChatTransport<UI_MESSAGE> {
|
|
16
|
+
private onChunkReceived: (chunk: UIMessageChunk) => void;
|
|
17
|
+
|
|
18
|
+
constructor(
|
|
19
|
+
options: HttpChatTransportInitOptions<UI_MESSAGE> = {},
|
|
20
|
+
onChunkReceived: (chunk: UIMessageChunk) => void,
|
|
21
|
+
) {
|
|
22
|
+
super(options);
|
|
23
|
+
this.onChunkReceived = onChunkReceived;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
protected override processResponseStream(
|
|
27
|
+
stream: ReadableStream<Uint8Array>,
|
|
28
|
+
): ReadableStream<UIMessageChunk> {
|
|
29
|
+
const onChunkReceived = this.onChunkReceived;
|
|
30
|
+
return super.processResponseStream(stream).pipeThrough(
|
|
31
|
+
new TransformStream<UIMessageChunk, UIMessageChunk>({
|
|
32
|
+
async transform(chunk, controller) {
|
|
33
|
+
onChunkReceived(chunk);
|
|
34
|
+
controller.enqueue(chunk);
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
RefreshCwIcon,
|
|
6
6
|
WorkflowIcon,
|
|
7
7
|
} from "lucide-react";
|
|
8
|
+
import { useDateFormatter } from "react-aria";
|
|
8
9
|
import { MultiIcon } from "@/components/icons/multi-icon";
|
|
9
10
|
import { Logger } from "@/utils/Logger";
|
|
10
11
|
import type { CellRuntimeState } from "../../../core/cells/types";
|
|
@@ -28,26 +29,6 @@ export interface CellStatusComponentProps
|
|
|
28
29
|
uninstantiated: boolean;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
// Looks like HH:MM:SS.SSS AM/PM
|
|
32
|
-
const timeFormatter = new Intl.DateTimeFormat("en-US", {
|
|
33
|
-
hour: "numeric",
|
|
34
|
-
minute: "numeric",
|
|
35
|
-
second: "numeric",
|
|
36
|
-
fractionalSecondDigits: 3,
|
|
37
|
-
hour12: true,
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// Looks like MM/DD HH:MM:SS.SSS AM/PM
|
|
41
|
-
const dateTimeFormatter = new Intl.DateTimeFormat("en-US", {
|
|
42
|
-
month: "numeric",
|
|
43
|
-
day: "numeric",
|
|
44
|
-
hour: "numeric",
|
|
45
|
-
minute: "numeric",
|
|
46
|
-
second: "numeric",
|
|
47
|
-
fractionalSecondDigits: 3,
|
|
48
|
-
hour12: true,
|
|
49
|
-
});
|
|
50
|
-
|
|
51
32
|
export const CellStatusComponent: React.FC<CellStatusComponentProps> = ({
|
|
52
33
|
editing,
|
|
53
34
|
status,
|
|
@@ -329,10 +310,32 @@ export const ElapsedTime = (props: { elapsedTime: string }) => {
|
|
|
329
310
|
const LastRanTime = (props: { lastRanTime: number }) => {
|
|
330
311
|
const date = new Date(props.lastRanTime * 1000);
|
|
331
312
|
const today = new Date();
|
|
313
|
+
|
|
314
|
+
// Looks like HH:MM:SS.SSS AM/PM
|
|
315
|
+
const timeFormatter = useDateFormatter({
|
|
316
|
+
hour: "numeric",
|
|
317
|
+
minute: "numeric",
|
|
318
|
+
second: "numeric",
|
|
319
|
+
fractionalSecondDigits: 3,
|
|
320
|
+
hour12: true,
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
// Looks like MM/DD HH:MM:SS.SSS AM/PM
|
|
324
|
+
const dateTimeFormatter = useDateFormatter({
|
|
325
|
+
month: "numeric",
|
|
326
|
+
day: "numeric",
|
|
327
|
+
hour: "numeric",
|
|
328
|
+
minute: "numeric",
|
|
329
|
+
second: "numeric",
|
|
330
|
+
fractionalSecondDigits: 3,
|
|
331
|
+
hour12: true,
|
|
332
|
+
});
|
|
333
|
+
|
|
332
334
|
const formatter =
|
|
333
335
|
date.toDateString() === today.toDateString()
|
|
334
336
|
? timeFormatter
|
|
335
337
|
: dateTimeFormatter;
|
|
338
|
+
|
|
336
339
|
return (
|
|
337
340
|
<span>
|
|
338
341
|
Ran at{" "}
|
|
@@ -9,8 +9,7 @@ import {
|
|
|
9
9
|
} from "@/components/ui/context-menu";
|
|
10
10
|
import { maybeAddMarimoImport } from "@/core/cells/add-missing-import";
|
|
11
11
|
import { useCellActions } from "@/core/cells/cells";
|
|
12
|
-
import {
|
|
13
|
-
import { SQLLanguageAdapter } from "@/core/codemirror/language/languages/sql/sql";
|
|
12
|
+
import { LanguageAdapters } from "@/core/codemirror/language/LanguageAdapters";
|
|
14
13
|
import {
|
|
15
14
|
getConnectionTooltip,
|
|
16
15
|
isAppInteractionDisabled,
|
|
@@ -103,7 +102,7 @@ const CreateCellButtonContextMenu = (props: {
|
|
|
103
102
|
evt.stopPropagation();
|
|
104
103
|
maybeAddMarimoImport({ autoInstantiate: true, createNewCell });
|
|
105
104
|
onClick({
|
|
106
|
-
code:
|
|
105
|
+
code: LanguageAdapters.markdown.defaultCode,
|
|
107
106
|
hideCode: true,
|
|
108
107
|
});
|
|
109
108
|
}}
|
|
@@ -118,7 +117,7 @@ const CreateCellButtonContextMenu = (props: {
|
|
|
118
117
|
onSelect={(evt) => {
|
|
119
118
|
evt.stopPropagation();
|
|
120
119
|
maybeAddMarimoImport({ autoInstantiate: true, createNewCell });
|
|
121
|
-
onClick({ code:
|
|
120
|
+
onClick({ code: LanguageAdapters.sql.defaultCode });
|
|
122
121
|
}}
|
|
123
122
|
>
|
|
124
123
|
<div className="mr-3 text-muted-foreground">
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { useAtomValue, useStore } from "jotai";
|
|
4
|
+
import { stagedAICellsAtom, useStagedCells } from "@/core/ai/staged-cells";
|
|
5
|
+
import type { CellId } from "@/core/cells/ids";
|
|
6
|
+
import { cn } from "@/utils/cn";
|
|
7
|
+
import { CompletionActionsCellFooter } from "../ai/completion-handlers";
|
|
8
|
+
|
|
9
|
+
export const StagedAICellBackground: React.FC<{
|
|
10
|
+
cellId: CellId;
|
|
11
|
+
className?: string;
|
|
12
|
+
}> = ({ cellId, className }) => {
|
|
13
|
+
const stagedAICells = useAtomValue(stagedAICellsAtom);
|
|
14
|
+
|
|
15
|
+
if (!stagedAICells.has(cellId)) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return <div className={cn("mo-ai-generated-cell", className)} />;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const StagedAICellFooter: React.FC<{ cellId: CellId }> = ({
|
|
23
|
+
cellId,
|
|
24
|
+
}) => {
|
|
25
|
+
const store = useStore();
|
|
26
|
+
const stagedAICells = useAtomValue(stagedAICellsAtom);
|
|
27
|
+
const { deleteStagedCell, removeStagedCell } = useStagedCells(store);
|
|
28
|
+
|
|
29
|
+
if (!stagedAICells.has(cellId)) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const handleAcceptCompletion = () => {
|
|
34
|
+
removeStagedCell(cellId);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const handleDeclineCompletion = () => {
|
|
38
|
+
deleteStagedCell(cellId);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div className="flex items-center justify-end gap-1.5 w-full pb-1 pt-2">
|
|
43
|
+
<CompletionActionsCellFooter
|
|
44
|
+
isLoading={false}
|
|
45
|
+
onAccept={handleAcceptCompletion}
|
|
46
|
+
onDecline={handleDeclineCompletion}
|
|
47
|
+
size="xs"
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
@@ -56,7 +56,8 @@ const CellActionsDropdownInternal = (
|
|
|
56
56
|
ref: React.Ref<CellActionsDropdownHandle>,
|
|
57
57
|
) => {
|
|
58
58
|
const [open, setOpen] = useState(false);
|
|
59
|
-
const
|
|
59
|
+
const closePopover = () => setOpen(false);
|
|
60
|
+
const actions = useCellActionButtons({ cell: props, closePopover });
|
|
60
61
|
|
|
61
62
|
// store the last focused element so we can restore it when the popover closes
|
|
62
63
|
const restoreFocus = useRestoreFocus();
|
|
@@ -7,8 +7,7 @@ import { useMemo } from "react";
|
|
|
7
7
|
import { Button } from "@/components/ui/button";
|
|
8
8
|
import { Tooltip } from "@/components/ui/tooltip";
|
|
9
9
|
import { switchLanguage } from "@/core/codemirror/language/extension";
|
|
10
|
-
import {
|
|
11
|
-
import { SQLLanguageAdapter } from "@/core/codemirror/language/languages/sql/sql";
|
|
10
|
+
import { LanguageAdapters } from "@/core/codemirror/language/LanguageAdapters";
|
|
12
11
|
import type { LanguageAdapter } from "@/core/codemirror/language/types";
|
|
13
12
|
import { Functions } from "@/utils/functions";
|
|
14
13
|
import { MarkdownIcon, PythonIcon } from "./icons";
|
|
@@ -27,11 +26,11 @@ export const LanguageToggles: React.FC<LanguageTogglesProps> = ({
|
|
|
27
26
|
onAfterToggle,
|
|
28
27
|
}) => {
|
|
29
28
|
const canUseMarkdown = useMemo(
|
|
30
|
-
() =>
|
|
29
|
+
() => LanguageAdapters.markdown.isSupported(code) || code.trim() === "",
|
|
31
30
|
[code],
|
|
32
31
|
);
|
|
33
32
|
const canUseSQL = useMemo(
|
|
34
|
-
() =>
|
|
33
|
+
() => LanguageAdapters.sql.isSupported(code) || code.trim() === "",
|
|
35
34
|
[code],
|
|
36
35
|
);
|
|
37
36
|
|
|
@@ -4,6 +4,7 @@ import { useAtomValue } from "jotai";
|
|
|
4
4
|
import { CpuIcon, MemoryStickIcon, MicrochipIcon } from "lucide-react";
|
|
5
5
|
import type React from "react";
|
|
6
6
|
import { useState } from "react";
|
|
7
|
+
import { useNumberFormatter } from "react-aria";
|
|
7
8
|
import { Tooltip } from "@/components/ui/tooltip";
|
|
8
9
|
import { connectionAtom } from "@/core/network/connection";
|
|
9
10
|
import { useRequestClient } from "@/core/network/requests";
|
|
@@ -56,23 +57,42 @@ const MemoryUsageBar: React.FC<{
|
|
|
56
57
|
}> = ({ memory, kernel, server }) => {
|
|
57
58
|
const { percent, total, available } = memory;
|
|
58
59
|
const roundedPercent = Math.round(percent);
|
|
60
|
+
|
|
61
|
+
const gbFormatter = useNumberFormatter({
|
|
62
|
+
maximumFractionDigits: 2,
|
|
63
|
+
});
|
|
64
|
+
const mbFormatter = useNumberFormatter({
|
|
65
|
+
maximumFractionDigits: 0,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const formatBytes = (bytes: number): string => {
|
|
69
|
+
if (bytes > 1024 * 1024 * 1024) {
|
|
70
|
+
return `${gbFormatter.format(bytes / (1024 * 1024 * 1024))} GB`;
|
|
71
|
+
}
|
|
72
|
+
return `${mbFormatter.format(bytes / (1024 * 1024))} MB`;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const formatGB = (bytes: number): string => {
|
|
76
|
+
return gbFormatter.format(bytes / (1024 * 1024 * 1024));
|
|
77
|
+
};
|
|
78
|
+
|
|
59
79
|
return (
|
|
60
80
|
<Tooltip
|
|
61
81
|
delayDuration={200}
|
|
62
82
|
content={
|
|
63
83
|
<div className="flex flex-col gap-1">
|
|
64
84
|
<span>
|
|
65
|
-
<b>computer memory:</b> {
|
|
66
|
-
({roundedPercent}%)
|
|
85
|
+
<b>computer memory:</b> {formatGB(total - available)} /{" "}
|
|
86
|
+
{formatGB(total)} GB ({roundedPercent}%)
|
|
67
87
|
</span>
|
|
68
88
|
{server?.memory && (
|
|
69
89
|
<span>
|
|
70
|
-
<b>marimo server:</b> {
|
|
90
|
+
<b>marimo server:</b> {formatBytes(server.memory)}
|
|
71
91
|
</span>
|
|
72
92
|
)}
|
|
73
93
|
{kernel?.memory && (
|
|
74
94
|
<span>
|
|
75
|
-
<b>kernel:</b> {
|
|
95
|
+
<b>kernel:</b> {formatBytes(kernel.memory)}
|
|
76
96
|
</span>
|
|
77
97
|
)}
|
|
78
98
|
</div>
|
|
@@ -122,6 +142,20 @@ const GPUBar: React.FC<{ gpus: GPU[] }> = ({ gpus }) => {
|
|
|
122
142
|
gpus.length,
|
|
123
143
|
);
|
|
124
144
|
|
|
145
|
+
const gbFormatter = useNumberFormatter({
|
|
146
|
+
maximumFractionDigits: 2,
|
|
147
|
+
});
|
|
148
|
+
const mbFormatter = useNumberFormatter({
|
|
149
|
+
maximumFractionDigits: 0,
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
const formatBytes = (bytes: number): string => {
|
|
153
|
+
if (bytes > 1024 * 1024 * 1024) {
|
|
154
|
+
return `${gbFormatter.format(bytes / (1024 * 1024 * 1024))} GB`;
|
|
155
|
+
}
|
|
156
|
+
return `${mbFormatter.format(bytes / (1024 * 1024))} MB`;
|
|
157
|
+
};
|
|
158
|
+
|
|
125
159
|
return (
|
|
126
160
|
<Tooltip
|
|
127
161
|
delayDuration={200}
|
|
@@ -132,7 +166,7 @@ const GPUBar: React.FC<{ gpus: GPU[] }> = ({ gpus }) => {
|
|
|
132
166
|
<b>
|
|
133
167
|
GPU {gpu.index} ({gpu.name}):
|
|
134
168
|
</b>{" "}
|
|
135
|
-
{
|
|
169
|
+
{formatBytes(gpu.memory.used)} / {formatBytes(gpu.memory.total)} (
|
|
136
170
|
{Math.round(gpu.memory.percent)}%)
|
|
137
171
|
</span>
|
|
138
172
|
))}
|
|
@@ -160,26 +194,3 @@ const Bar: React.FC<{ percent: number; colorClassName?: string }> = ({
|
|
|
160
194
|
</div>
|
|
161
195
|
);
|
|
162
196
|
};
|
|
163
|
-
|
|
164
|
-
function asGBorMB(bytes: number): string {
|
|
165
|
-
if (bytes > 1024 * 1024 * 1024) {
|
|
166
|
-
return `${asGB(bytes)} GB`;
|
|
167
|
-
}
|
|
168
|
-
return `${asMB(bytes)} MB`;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
function asMB(bytes: number) {
|
|
172
|
-
// 0 decimal places
|
|
173
|
-
const format = new Intl.NumberFormat("en-US", {
|
|
174
|
-
maximumFractionDigits: 0,
|
|
175
|
-
});
|
|
176
|
-
return format.format(bytes / (1024 * 1024));
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
function asGB(bytes: number) {
|
|
180
|
-
// At most 2 decimal places
|
|
181
|
-
const format = new Intl.NumberFormat("en-US", {
|
|
182
|
-
maximumFractionDigits: 2,
|
|
183
|
-
});
|
|
184
|
-
return format.format(bytes / (1024 * 1024 * 1024));
|
|
185
|
-
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { MenuIcon } from "lucide-react";
|
|
4
4
|
import React from "react";
|
|
5
|
+
import { useLocale } from "react-aria";
|
|
5
6
|
import { Button } from "@/components/editor/inputs/Inputs";
|
|
6
7
|
import {
|
|
7
8
|
DropdownMenu,
|
|
@@ -33,7 +34,7 @@ export const NotebookMenuDropdown: React.FC<Props> = ({
|
|
|
33
34
|
tooltip = "Actions",
|
|
34
35
|
}) => {
|
|
35
36
|
const actions = useNotebookActions();
|
|
36
|
-
|
|
37
|
+
const { locale } = useLocale();
|
|
37
38
|
// Create tooltip content with keyboard shortcut decoration
|
|
38
39
|
const tooltipContent = (
|
|
39
40
|
<div className="flex flex-col gap-2">
|
|
@@ -148,7 +149,8 @@ export const NotebookMenuDropdown: React.FC<Props> = ({
|
|
|
148
149
|
);
|
|
149
150
|
})}
|
|
150
151
|
<DropdownMenuSeparator />
|
|
151
|
-
<div className="flex-1 px-2 text-xs text-muted-foreground">
|
|
152
|
+
<div className="flex-1 px-2 text-xs text-muted-foreground flex flex-col gap-1">
|
|
153
|
+
<span>Locale: {locale}</span>
|
|
152
154
|
<span>Version: {getMarimoVersion()}</span>
|
|
153
155
|
</div>
|
|
154
156
|
</DropdownMenuContent>
|
|
@@ -13,15 +13,21 @@ import { type FilePath, PathBuilder } from "@/utils/paths";
|
|
|
13
13
|
|
|
14
14
|
export class RequestingTree {
|
|
15
15
|
private delegate = new SimpleTree<FileInfo>([]);
|
|
16
|
+
private callbacks: {
|
|
17
|
+
listFiles: EditRequests["sendListFiles"];
|
|
18
|
+
createFileOrFolder: EditRequests["sendCreateFileOrFolder"];
|
|
19
|
+
deleteFileOrFolder: EditRequests["sendDeleteFileOrFolder"];
|
|
20
|
+
renameFileOrFolder: EditRequests["sendRenameFileOrFolder"];
|
|
21
|
+
};
|
|
16
22
|
|
|
17
|
-
constructor(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
constructor(callbacks: {
|
|
24
|
+
listFiles: EditRequests["sendListFiles"];
|
|
25
|
+
createFileOrFolder: EditRequests["sendCreateFileOrFolder"];
|
|
26
|
+
deleteFileOrFolder: EditRequests["sendDeleteFileOrFolder"];
|
|
27
|
+
renameFileOrFolder: EditRequests["sendRenameFileOrFolder"];
|
|
28
|
+
}) {
|
|
29
|
+
this.callbacks = callbacks;
|
|
30
|
+
}
|
|
25
31
|
|
|
26
32
|
private rootPath: FilePath = "" as FilePath;
|
|
27
33
|
private onChange: (data: FileInfo[]) => void = Functions.NOOP;
|
|
@@ -20,8 +20,7 @@ import { SortableCellsProvider } from "@/components/sort/SortableCellsProvider";
|
|
|
20
20
|
import { Button } from "@/components/ui/button";
|
|
21
21
|
import { Tooltip } from "@/components/ui/tooltip";
|
|
22
22
|
import { maybeAddMarimoImport } from "@/core/cells/add-missing-import";
|
|
23
|
-
import {
|
|
24
|
-
import { SQLLanguageAdapter } from "@/core/codemirror/language/languages/sql/sql";
|
|
23
|
+
import { LanguageAdapters } from "@/core/codemirror/language/LanguageAdapters";
|
|
25
24
|
import { aiEnabledAtom } from "@/core/config/config";
|
|
26
25
|
import { isConnectedAtom } from "@/core/network/connection";
|
|
27
26
|
import { useBoolean } from "@/hooks/useBoolean";
|
|
@@ -288,7 +287,7 @@ const AddCellButtons: React.FC<{
|
|
|
288
287
|
createNewCell({
|
|
289
288
|
cellId: { type: "__end__", columnId },
|
|
290
289
|
before: false,
|
|
291
|
-
code:
|
|
290
|
+
code: LanguageAdapters.markdown.defaultCode,
|
|
292
291
|
hideCode: true,
|
|
293
292
|
});
|
|
294
293
|
}}
|
|
@@ -307,7 +306,7 @@ const AddCellButtons: React.FC<{
|
|
|
307
306
|
createNewCell({
|
|
308
307
|
cellId: { type: "__end__", columnId },
|
|
309
308
|
before: false,
|
|
310
|
-
code:
|
|
309
|
+
code: LanguageAdapters.sql.defaultCode,
|
|
311
310
|
});
|
|
312
311
|
}}
|
|
313
312
|
>
|
|
@@ -24,7 +24,7 @@ export const SlidesLayoutRenderer: React.FC<Props> = ({
|
|
|
24
24
|
const isReading = mode === "read";
|
|
25
25
|
|
|
26
26
|
const slides = (
|
|
27
|
-
<LazySlidesComponent forceKeyboardNavigation={true}>
|
|
27
|
+
<LazySlidesComponent forceKeyboardNavigation={true} className="flex-1">
|
|
28
28
|
{cells.map((cell) => {
|
|
29
29
|
const isOutputEmpty = cell.output == null || cell.output.data === "";
|
|
30
30
|
if (isOutputEmpty) {
|
|
@@ -45,10 +45,10 @@ export const SlidesLayoutRenderer: React.FC<Props> = ({
|
|
|
45
45
|
);
|
|
46
46
|
|
|
47
47
|
if (isReading) {
|
|
48
|
-
return <div className="p-4">{slides}</div>;
|
|
48
|
+
return <div className="p-4 flex flex-col flex-1 max-h-[95%]">{slides}</div>;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
return <div className="pr-
|
|
51
|
+
return <div className="pr-18 pb-5 flex-1 flex flex-col">{slides}</div>;
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
interface SlideProps extends Pick<CellRuntimeState, "output" | "status"> {
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* The serialized form of a slides layout.
|
|
6
6
|
* This must be backwards-compatible as it is stored on the user's disk.
|
|
7
7
|
*/
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
8
9
|
export type SerializedSlidesLayout = {};
|
|
9
10
|
|
|
10
11
|
export interface SlidesLayout extends SerializedSlidesLayout {
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
Tree,
|
|
22
22
|
type TreeApi,
|
|
23
23
|
} from "react-arborist";
|
|
24
|
+
import { useLocale } from "react-aria";
|
|
24
25
|
import { MarkdownIcon } from "@/components/editor/cell/code/icons";
|
|
25
26
|
import { useImperativeModal } from "@/components/modal/ImperativeModal";
|
|
26
27
|
import { AlertDialogDestructiveAction } from "@/components/ui/alert-dialog";
|
|
@@ -383,6 +384,8 @@ const NotebookList: React.FC<{
|
|
|
383
384
|
};
|
|
384
385
|
|
|
385
386
|
const MarimoFileComponent = ({ file }: { file: MarimoFile }) => {
|
|
387
|
+
const { locale } = useLocale();
|
|
388
|
+
|
|
386
389
|
// If path is a sessionId, then it has not been saved yet
|
|
387
390
|
// We want to keep the sessionId in this case
|
|
388
391
|
const isNewNotebook = isSessionId(file.path);
|
|
@@ -427,7 +430,7 @@ const MarimoFileComponent = ({ file }: { file: MarimoFile }) => {
|
|
|
427
430
|
</div>
|
|
428
431
|
{!!file.lastModified && (
|
|
429
432
|
<div className="text-xs text-muted-foreground opacity-80">
|
|
430
|
-
{timeAgo(file.lastModified * 1000)}
|
|
433
|
+
{timeAgo(file.lastModified * 1000, locale)}
|
|
431
434
|
</div>
|
|
432
435
|
)}
|
|
433
436
|
</div>
|
|
@@ -95,7 +95,7 @@ const SlidesComponent = ({
|
|
|
95
95
|
}}
|
|
96
96
|
className={cn(
|
|
97
97
|
"h-full w-full flex box-border overflow-y-auto overflow-x-hidden",
|
|
98
|
-
isFullscreen ? "p-20" : "p-6",
|
|
98
|
+
isFullscreen ? "p-20" : "p-6 pb-12",
|
|
99
99
|
)}
|
|
100
100
|
>
|
|
101
101
|
<div className="mo-slide-content">{child}</div>
|
|
@@ -68,6 +68,7 @@ so we are resetting this back to initial. */
|
|
|
68
68
|
width: 100%;
|
|
69
69
|
display: flex;
|
|
70
70
|
justify-content: center;
|
|
71
|
+
min-height: fit-content;
|
|
71
72
|
|
|
72
73
|
/* width is normally set to 100%, but we want the content to be centered around
|
|
73
74
|
the width needed. */
|
|
@@ -79,6 +80,11 @@ so we are resetting this back to initial. */
|
|
|
79
80
|
width: unset;
|
|
80
81
|
}
|
|
81
82
|
|
|
83
|
+
/* If the first output is the only child, make it flex 1 */
|
|
84
|
+
> *:only-child > .output:only-child {
|
|
85
|
+
flex: 1;
|
|
86
|
+
}
|
|
87
|
+
|
|
82
88
|
/* Components that should be full width when in slides mode */
|
|
83
89
|
div:has(> marimo-ui-element > marimo-vega) {
|
|
84
90
|
display: block !important;
|