@marimo-team/frontend 0.16.0 → 0.16.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-2wVcyvDj.js +19 -0
- package/dist/assets/{ImageComparisonComponent-fTHv1Ih0.js → ImageComparisonComponent-D2j6i0hv.js} +1 -1
- package/dist/assets/{VegaLite-Bdi-TyfY.js → VegaLite-BckFaf2D.js} +1 -1
- package/dist/assets/_baseEach-CvTX9w0Y.js +1 -0
- package/dist/assets/_baseMap-CtlwA90f.js +1 -0
- package/dist/assets/_baseUniq-BKktIGQ1.js +1 -0
- package/dist/assets/{_createAggregator-DcD0kTA5.js → _createAggregator-C5CVY-0t.js} +1 -1
- package/dist/assets/{agent-panel-Crv430aI.js → agent-panel-RGLNjkYe.js} +76 -57
- package/dist/assets/{any-language-editor-CQh552Wu.js → any-language-editor-DjuXwGCA.js} +1 -1
- package/dist/assets/{architectureDiagram-W76B3OCA-BAJeBxzt.js → architectureDiagram-W76B3OCA-Dyj4ds_R.js} +1 -1
- package/dist/assets/{between-horizontal-start-Boxgxbt_.js → between-horizontal-start-Dt2aKpPf.js} +1 -1
- package/dist/assets/{blockDiagram-QIGZ2CNN-CL-1svEK.js → blockDiagram-QIGZ2CNN-o-i7DDvN.js} +1 -1
- package/dist/assets/{c4Diagram-FPNF74CW-BbEqbCTl.js → c4Diagram-FPNF74CW-DGHEwWrx.js} +1 -1
- package/dist/assets/channel-Co6iMgWq.js +1 -0
- package/dist/assets/chat-panel-9alr8FS4.js +3 -0
- package/dist/assets/{chunk-4BX2VUAB-C--8TXeE.js → chunk-4BX2VUAB-BJecb-Ri.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-Bj00HDqq.js → chunk-55IACEB6-CAATkc4w.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-C-lhB6hN.js → chunk-FMBD7UC4-DPuNbQ-f.js} +1 -1
- package/dist/assets/{chunk-K7UQS3LO-B-pGTXPt.js → chunk-K7UQS3LO-C8TWVLiH.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-DqUzGhvm.js → chunk-QN33PNHL-DiZZ09q4.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-TntJHfSk.js → chunk-QZHKN3VN-BIUM7usu.js} +1 -1
- package/dist/assets/{chunk-TVAH2DTR-HUJb1psV.js → chunk-TVAH2DTR-vGTArPBG.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-BK3C__t3.js → chunk-TZMSLE5B-D2KRqp_x.js} +1 -1
- package/dist/assets/{circle-play-DBLOv1Yu.js → circle-play-cjeNez0N.js} +1 -1
- package/dist/assets/classDiagram-KNZD7YFC-BbJ0rY3y.js +1 -0
- package/dist/assets/classDiagram-v2-RKCZMP56-BbJ0rY3y.js +1 -0
- package/dist/assets/{clear-button-BeoFbEKH.js → clear-button-C97JtAez.js} +1 -1
- package/dist/assets/clone-BMP0PsTa.js +1 -0
- package/dist/assets/{command-palette-CXZiSv0I.js → command-palette-B93Pjcky.js} +1 -1
- package/dist/assets/{common-C7oJcmCT.js → common-Du9rSOwD.js} +1 -1
- package/dist/assets/{compile-7L0MwhyI.js → compile-CZXqyOxa.js} +1 -1
- package/dist/assets/{cose-bilkent-S5V4N54A-BMkGLcVC.js → cose-bilkent-S5V4N54A-CqUN5Y9b.js} +1 -1
- package/dist/assets/{dagre-5GWH7T2D-BJtRienS.js → dagre-5GWH7T2D-RJqTI9DM.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-DBkmGtNs.js → data-grid-overlay-editor-DZN0q1LV.js} +1 -1
- package/dist/assets/datasources-panel-v7H3cR0p.js +1 -0
- package/dist/assets/{dependency-graph-panel-DEdOxp2X.js → dependency-graph-panel-CEog_O7V.js} +1 -1
- package/dist/assets/{diagram-N5W7TBWH-CmECY3nb.js → diagram-N5W7TBWH-D-l4zZ9d.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-DMOVSNKD.js → diagram-QEK2KX5R-CCOmBUt-.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-BiJ96PNQ.js → diagram-S2PKOQOG-C_I_9jnZ.js} +1 -1
- package/dist/assets/{documentation-panel-xULhaEv3.js → documentation-panel-C1BtMZ3M.js} +1 -1
- package/dist/assets/edit-page-B-oevUZ9.js +129 -0
- package/dist/assets/{ellipsis-vertical-BBqXIlc2.js → ellipsis-vertical-BEb-J8z6.js} +1 -1
- package/dist/assets/{empty-state-B3dA3G5P.js → empty-state-C99UyDE3.js} +1 -1
- package/dist/assets/{erDiagram-AWTI2OKA-MP1DiFRo.js → erDiagram-AWTI2OKA-BePOLi5M.js} +1 -1
- package/dist/assets/{error-panel-Cc1sv-Ag.js → error-panel-Bs34jXFh.js} +1 -1
- package/dist/assets/file-explorer-panel-Ck6UL861.js +1 -0
- package/dist/assets/{flowDiagram-PVAE7QVJ-BX7caPp7.js → flowDiagram-PVAE7QVJ-BgjFu5l7.js} +1 -1
- package/dist/assets/{ganttDiagram-OWAHRB6G-B462g4Yf.js → ganttDiagram-OWAHRB6G-YOPb3XSV.js} +4 -4
- package/dist/assets/{gitGraphDiagram-NY62KEGX-CGgvZ9-9.js → gitGraphDiagram-NY62KEGX-CGhqaDTy.js} +1 -1
- package/dist/assets/{glide-data-editor-C0gUFZON.js → glide-data-editor-9QUH6iso.js} +11 -11
- package/dist/assets/{graph-CHRVBzY5.js → graph-DQQFGrho.js} +1 -1
- package/dist/assets/home-page-DRKpPCrF.js +9 -0
- package/dist/assets/{index-C1v_Z9et.js → index-2252nrk6.js} +1 -1
- package/dist/assets/{index-CQDrxQ0j.js → index-Aeo6WiK7.js} +1 -1
- package/dist/assets/{index-C4Tn5NvJ.js → index-B8jXZ12t.js} +1 -1
- package/dist/assets/{index-DoRmcrKM.js → index-BAbIIxHU.js} +1 -1
- package/dist/assets/{index-BY93Ejhl.js → index-BJNCMUmG.js} +1 -1
- package/dist/assets/{index-CpTPJo4k.js → index-BW3k9Gss.js} +1 -1
- package/dist/assets/{index-D1vmG6DS.js → index-BjgnbONl.js} +1 -1
- package/dist/assets/{index-z9bohSQJ.js → index-BprjMYH5.js} +1 -1
- package/dist/assets/{index-BVgAenPd.js → index-C1ez98sk.js} +1 -1
- package/dist/assets/{index-D9UKkrr2.js → index-C2MD0vgD.js} +1 -1
- package/dist/assets/index-C7CoaNFb.js +578 -0
- package/dist/assets/{index-C-GhZ7ti.js → index-CFKO7WXI.js} +1 -1
- package/dist/assets/{index-lYa_leQE.js → index-CUFv_thQ.js} +1 -1
- package/dist/assets/{index-vmICa5KN.js → index-C_tkBKNO.js} +1 -1
- package/dist/assets/{index-C77h_TXN.js → index-CfaDbEdi.js} +1 -1
- package/dist/assets/{index-DEQvTChO.js → index-ClzeQrN7.js} +1 -1
- package/dist/assets/index-DadI618h.css +1 -0
- package/dist/assets/{index-DRMm6SNo.js → index-DdnKZNxM.js} +1 -1
- package/dist/assets/{index-CWMgowgL.js → index-G5QZppK2.js} +1 -1
- package/dist/assets/{index-Clbi_Yaq.js → index-SGLNXrGP.js} +1 -1
- package/dist/assets/{index-C-8WADat.js → index-aE43R74q.js} +1 -1
- package/dist/assets/infoDiagram-STP46IZ2-CJLOpSAf.js +2 -0
- package/dist/assets/{isEmpty-DU_ogP_D.js → isEmpty-D-4c7sMv.js} +1 -1
- package/dist/assets/{journeyDiagram-BIP6EPQ6-C6EgLP_Q.js → journeyDiagram-BIP6EPQ6-C94u3Mv3.js} +1 -1
- package/dist/assets/{kanban-definition-6OIFK2YF-BXzYO1yj.js → kanban-definition-6OIFK2YF-BEXYFzz7.js} +1 -1
- package/dist/assets/{layout-jihVw5-i.js → layout-Bz2BJ2ru.js} +1 -1
- package/dist/assets/{linear-C4blANlC.js → linear-D8s7K76e.js} +1 -1
- package/dist/assets/links-BpXlz1GG.js +7 -0
- package/dist/assets/{logs-panel-D401qzZh.js → logs-panel-DC7wpmPz.js} +1 -1
- package/dist/assets/{markdown-renderer-Cd9eYyaL.js → markdown-renderer-DRdSWR9X.js} +20 -20
- package/dist/assets/{mermaid-BEVuRz_O.js → mermaid-Y3x4hmD0.js} +1 -1
- package/dist/assets/{mermaid.core-CaSnaLH0.js → mermaid.core-DzthE35Y.js} +4 -4
- package/dist/assets/min-BBO3-1Hg.js +1 -0
- package/dist/assets/{mindmap-definition-Q6HEUPPD-BXUM5MT2.js → mindmap-definition-Q6HEUPPD-DktvuLe1.js} +1 -1
- package/dist/assets/{number-overlay-editor-4uWXGlPG.js → number-overlay-editor-BEfwI1IT.js} +1 -1
- package/dist/assets/outline-panel-CdsnAy2w.js +1 -0
- package/dist/assets/{packages-panel-CJL0MVlj.js → packages-panel-DiTA-d_D.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-Dxt5PVNo.js → pieDiagram-ADFJNKIX-DQDNQ-de.js} +1 -1
- package/dist/assets/{quadrantDiagram-LMRXKWRM-D4pUaA31.js → quadrantDiagram-LMRXKWRM-0kgIXc2-.js} +1 -1
- package/dist/assets/{react-plotly-cJZ0VWBq.js → react-plotly-DJqqfM7c.js} +1 -1
- package/dist/assets/{requirementDiagram-4UW4RH46-DVRTjgas.js → requirementDiagram-4UW4RH46-B5rb0ypd.js} +1 -1
- package/dist/assets/{run-page-BUEnMC9w.js → run-page-CFmLrv1R.js} +1 -1
- package/dist/assets/{sankeyDiagram-GR3RE2ED-CVFnD9C-.js → sankeyDiagram-GR3RE2ED-Dom7IlnF.js} +1 -1
- package/dist/assets/{scratchpad-panel-BIgRENkI.js → scratchpad-panel-CuHWpHO8.js} +1 -1
- package/dist/assets/{secrets-panel-xY5-V_BD.js → secrets-panel-CfHc5YD0.js} +1 -1
- package/dist/assets/{sequenceDiagram-C3RYC4MD-_lY4ZN_S.js → sequenceDiagram-C3RYC4MD-PNJWXQbw.js} +1 -1
- package/dist/assets/{slides-component-DMjQomc3.css → slides-component-C-LoGC1U.css} +1 -1
- package/dist/assets/{slides-component-Xjymwj7X.js → slides-component-CJgaTRZ0.js} +1 -1
- package/dist/assets/snippets-panel-B2EC1txM.js +1 -0
- package/dist/assets/sortBy-DZnlX29-.js +1 -0
- package/dist/assets/{state-C4NiC9tO.js → state-CWict9RU.js} +1 -1
- package/dist/assets/{stateDiagram-KXAO66HF-Da0JQWCn.js → stateDiagram-KXAO66HF-BE58aJnr.js} +1 -1
- package/dist/assets/stateDiagram-v2-UMBNRL4Z-CdThjimL.js +1 -0
- package/dist/assets/storage-DRaR04wR.js +26 -0
- package/dist/assets/{terminal-BPwTkXae.js → terminal-BX3Su5q7.js} +1 -1
- package/dist/assets/{time-Dv5_Ouz_.js → time-hUzZfpNE.js} +1 -1
- package/dist/assets/{timeline-definition-XQNQX7LJ-Dxh5Zu2e.js → timeline-definition-XQNQX7LJ-CqQP9t51.js} +1 -1
- package/dist/assets/tracing-B10Q1n-L.js +2 -0
- package/dist/assets/{tracing-panel-DAzrzNmm.js → tracing-panel-Du8WCnno.js} +2 -2
- package/dist/assets/{trash-Dc6DSjz_.js → trash-B81GTiv6.js} +1 -1
- package/dist/assets/{tree-jheoerAX.js → tree-6vW2ogkh.js} +1 -1
- package/dist/assets/{treemap-75Q7IDZK-IgpxeGaf.js → treemap-75Q7IDZK-CdwDwwsz.js} +27 -27
- package/dist/assets/variable-panel-D5qgJI7k.js +1 -0
- package/dist/assets/{vega-component-BpfpiPKI.js → vega-component-DJaJWMJM.js} +1 -1
- package/dist/assets/worker-fHbtoWvT.js +1 -0
- package/dist/assets/{xychartDiagram-6GGTOJPD-CmNigJ31.js → xychartDiagram-6GGTOJPD-WFtXqaM9.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +3 -2
- package/src/components/app-config/user-config-form.tsx +46 -1
- package/src/components/chat/acp/__tests__/__snapshots__/prompt.test.ts.snap +62 -43
- package/src/components/chat/acp/__tests__/atoms.test.ts +1 -1
- package/src/components/chat/acp/__tests__/state.test.ts +36 -36
- package/src/components/chat/acp/agent-panel.tsx +24 -27
- package/src/components/chat/acp/blocks.tsx +6 -6
- package/src/components/chat/acp/prompt.ts +62 -43
- package/src/components/chat/chat-panel.tsx +5 -1
- package/src/components/chat/markdown-renderer.tsx +6 -10
- package/src/components/chat/tool-call-accordion.tsx +52 -20
- 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/ai/transport/chat-transport.tsx +4 -1
- package/src/components/editor/cell/CellStatus.tsx +23 -20
- package/src/components/editor/cell/CreateCellButton.tsx +3 -4
- 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/theme.tsx +1 -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/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 +34 -1
- package/src/core/cells/__tests__/add-missing-import.test.ts +67 -22
- package/src/core/cells/add-missing-import.ts +24 -7
- package/src/core/cells/cells.ts +26 -27
- 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/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/kernel/RuntimeState.ts +4 -1
- package/src/core/kernel/messages.ts +2 -2
- package/src/core/network/DeferredRequestRegistry.ts +16 -4
- package/src/core/runtime/runtime.ts +5 -4
- 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/hooks/useFormatting.ts +97 -0
- package/src/hooks/useTimer.ts +8 -5
- package/src/plugins/core/registerReactComponent.tsx +16 -10
- package/src/plugins/impl/DataTablePlugin.tsx +4 -0
- 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/utils/__tests__/dates.test.ts +45 -24
- package/src/utils/__tests__/numbers.test.ts +42 -30
- package/src/utils/__tests__/once.test.ts +187 -0
- package/src/utils/dates.ts +15 -10
- package/src/utils/edit-distance.ts +8 -6
- package/src/utils/errors.ts +1 -1
- 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-BErMbWvG.js +0 -19
- package/dist/assets/_baseEach-CNBxBxvS.js +0 -1
- package/dist/assets/_baseMap-D1WHjKrd.js +0 -1
- package/dist/assets/_baseUniq-CCgDNtZb.js +0 -1
- package/dist/assets/channel-_2eNSz0n.js +0 -1
- package/dist/assets/chat-panel-CXh5Wl6C.js +0 -3
- package/dist/assets/classDiagram-KNZD7YFC-BGmh9POF.js +0 -1
- package/dist/assets/classDiagram-v2-RKCZMP56-BGmh9POF.js +0 -1
- package/dist/assets/clone-BFDSPAj3.js +0 -1
- package/dist/assets/datasources-panel-B7FbYLiy.js +0 -1
- package/dist/assets/edit-page-BrYda9VE.js +0 -129
- package/dist/assets/file-explorer-panel-Bw59Kva1.js +0 -1
- package/dist/assets/home-page-Fb2osjys.js +0 -9
- package/dist/assets/index-Cx0bsY1w.css +0 -1
- package/dist/assets/index-DKEudB02.js +0 -578
- package/dist/assets/infoDiagram-STP46IZ2-CVyrdLc8.js +0 -2
- package/dist/assets/links-D59GIweI.js +0 -7
- package/dist/assets/min-DUMu_zeK.js +0 -1
- package/dist/assets/outline-panel-DIzkvm2I.js +0 -1
- package/dist/assets/snippets-panel-CTPYW41n.js +0 -1
- package/dist/assets/sortBy-BNZKwiq_.js +0 -1
- package/dist/assets/stateDiagram-v2-UMBNRL4Z-D5lYZOOt.js +0 -1
- package/dist/assets/storage-CMdLzB_c.js +0 -26
- package/dist/assets/tracing-BCIurUfa.js +0 -2
- package/dist/assets/variable-panel-DYAiLBmF.js +0 -1
- package/dist/assets/worker-X5rxzQGQ.js +0 -1
|
@@ -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">
|
|
@@ -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;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
3
|
import type { TopLevelSpec } from "vega-lite";
|
|
4
|
+
import type { TimeUnit } from "vega-lite/build/src/timeunit";
|
|
4
5
|
import type { CellId } from "@/core/cells/ids";
|
|
5
6
|
import type { CellRun } from "@/core/cells/runs";
|
|
6
7
|
import type { ResolvedTheme } from "@/theme/useTheme";
|
|
@@ -30,6 +31,8 @@ export function createGanttBaseSpec(
|
|
|
30
31
|
chartPosition: ChartPosition,
|
|
31
32
|
theme: ResolvedTheme,
|
|
32
33
|
): Readonly<TopLevelSpec> {
|
|
34
|
+
// @ts-expect-error - Supported by vega/vega-lite but invalid "TimeUnit" option from exported type
|
|
35
|
+
const timeUnit: TimeUnit = "hoursminutessecondsmilliseconds";
|
|
33
36
|
return {
|
|
34
37
|
$schema: "https://vega.github.io/schema/vega-lite/v5.json",
|
|
35
38
|
background: theme === "dark" ? "black" : undefined,
|
|
@@ -76,15 +79,13 @@ export function createGanttBaseSpec(
|
|
|
76
79
|
{
|
|
77
80
|
field: startTimestampField,
|
|
78
81
|
type: "temporal",
|
|
79
|
-
|
|
80
|
-
timeUnit: "hoursminutessecondsmilliseconds",
|
|
82
|
+
timeUnit: timeUnit,
|
|
81
83
|
title: "Start",
|
|
82
84
|
},
|
|
83
85
|
{
|
|
84
86
|
field: endTimestampField,
|
|
85
87
|
type: "temporal",
|
|
86
|
-
|
|
87
|
-
timeUnit: "hoursminutessecondsmilliseconds",
|
|
88
|
+
timeUnit: timeUnit,
|
|
88
89
|
title: "End",
|
|
89
90
|
},
|
|
90
91
|
],
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
4
4
|
import { TooltipPortal } from "@radix-ui/react-tooltip";
|
|
5
5
|
import * as React from "react";
|
|
6
|
+
import { useLocale } from "react-aria";
|
|
6
7
|
import { cn } from "@/utils/cn";
|
|
7
8
|
import { prettyScientificNumber } from "@/utils/numbers";
|
|
8
9
|
import { useBoolean } from "../../hooks/useBoolean";
|
|
@@ -20,6 +21,7 @@ const RangeSlider = React.forwardRef<
|
|
|
20
21
|
}
|
|
21
22
|
>(({ className, valueMap, ...props }, ref) => {
|
|
22
23
|
const [open, openActions] = useBoolean(false);
|
|
24
|
+
const { locale } = useLocale();
|
|
23
25
|
|
|
24
26
|
return (
|
|
25
27
|
<SliderPrimitive.Root
|
|
@@ -66,7 +68,7 @@ const RangeSlider = React.forwardRef<
|
|
|
66
68
|
<TooltipPortal>
|
|
67
69
|
{props.value != null && props.value.length === 2 && (
|
|
68
70
|
<TooltipContent key={props.value[0]}>
|
|
69
|
-
{prettyScientificNumber(valueMap(props.value[0]))}
|
|
71
|
+
{prettyScientificNumber(valueMap(props.value[0]), { locale })}
|
|
70
72
|
</TooltipContent>
|
|
71
73
|
)}
|
|
72
74
|
</TooltipPortal>
|
|
@@ -87,7 +89,7 @@ const RangeSlider = React.forwardRef<
|
|
|
87
89
|
<TooltipPortal>
|
|
88
90
|
{props.value != null && props.value.length === 2 && (
|
|
89
91
|
<TooltipContent key={props.value[1]}>
|
|
90
|
-
{prettyScientificNumber(valueMap(props.value[1]))}
|
|
92
|
+
{prettyScientificNumber(valueMap(props.value[1]), { locale })}
|
|
91
93
|
</TooltipContent>
|
|
92
94
|
)}
|
|
93
95
|
</TooltipPortal>
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
4
4
|
import { TooltipPortal } from "@radix-ui/react-tooltip";
|
|
5
5
|
import * as React from "react";
|
|
6
|
+
import { useLocale } from "react-aria";
|
|
6
7
|
import { cn } from "@/utils/cn";
|
|
7
8
|
import { prettyScientificNumber } from "@/utils/numbers";
|
|
8
9
|
import { useBoolean } from "../../hooks/useBoolean";
|
|
@@ -20,6 +21,7 @@ const Slider = React.forwardRef<
|
|
|
20
21
|
}
|
|
21
22
|
>(({ className, valueMap, ...props }, ref) => {
|
|
22
23
|
const [open, openActions] = useBoolean(false);
|
|
24
|
+
const { locale } = useLocale();
|
|
23
25
|
|
|
24
26
|
return (
|
|
25
27
|
<SliderPrimitive.Root
|
|
@@ -66,7 +68,7 @@ const Slider = React.forwardRef<
|
|
|
66
68
|
<TooltipPortal>
|
|
67
69
|
{props.value != null && props.value.length === 1 && (
|
|
68
70
|
<TooltipContent key={props.value[0]}>
|
|
69
|
-
{prettyScientificNumber(valueMap(props.value[0]))}
|
|
71
|
+
{prettyScientificNumber(valueMap(props.value[0]), { locale })}
|
|
70
72
|
</TooltipContent>
|
|
71
73
|
)}
|
|
72
74
|
</TooltipPortal>
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
import { sortBy } from "lodash-es";
|
|
15
15
|
import { SquareEqualIcon, WorkflowIcon } from "lucide-react";
|
|
16
16
|
import React, { memo, useMemo } from "react";
|
|
17
|
+
import { useLocale } from "react-aria";
|
|
17
18
|
import { CellLink } from "@/components/editor/links/cell-link";
|
|
18
19
|
import { getCellEditorView, useCellNames } from "@/core/cells/cells";
|
|
19
20
|
import type { CellId } from "@/core/cells/ids";
|
|
@@ -233,6 +234,7 @@ export const VariableTable: React.FC<Props> = memo(
|
|
|
233
234
|
const [sorting, setSorting] = React.useState<SortingState>([]);
|
|
234
235
|
const [globalFilter, setGlobalFilter] = React.useState("");
|
|
235
236
|
const cellNames = useCellNames();
|
|
237
|
+
const { locale } = useLocale();
|
|
236
238
|
|
|
237
239
|
const resolvedVariables: ResolvedVariable[] = useMemo(() => {
|
|
238
240
|
const getName = (id: CellId) => {
|
|
@@ -279,6 +281,7 @@ export const VariableTable: React.FC<Props> = memo(
|
|
|
279
281
|
globalFilterFn: "auto",
|
|
280
282
|
// sorting
|
|
281
283
|
manualSorting: true,
|
|
284
|
+
locale: locale,
|
|
282
285
|
onSortingChange: setSorting,
|
|
283
286
|
getSortedRowModel: getSortedRowModel(),
|
|
284
287
|
state: {
|
package/src/core/MarimoApp.tsx
CHANGED
|
@@ -15,6 +15,7 @@ import { ErrorBoundary } from "../components/editor/boundary/ErrorBoundary";
|
|
|
15
15
|
import { ModalProvider } from "../components/modal/ImperativeModal";
|
|
16
16
|
import { Toaster } from "../components/ui/toaster";
|
|
17
17
|
import { TooltipProvider } from "../components/ui/tooltip";
|
|
18
|
+
import { LocaleProvider } from "./i18n/locale-provider";
|
|
18
19
|
import { slotsController } from "./slots/slots";
|
|
19
20
|
|
|
20
21
|
// Force tailwind classnames
|
|
@@ -69,7 +70,7 @@ export const MarimoApp: React.FC = memo(() => {
|
|
|
69
70
|
<CssVariables
|
|
70
71
|
variables={{ "--marimo-code-editor-font-size": editorFontSize }}
|
|
71
72
|
>
|
|
72
|
-
{renderBody()}
|
|
73
|
+
<LocaleProvider>{renderBody()}</LocaleProvider>
|
|
73
74
|
</CssVariables>
|
|
74
75
|
</Providers>
|
|
75
76
|
);
|
|
@@ -85,11 +86,13 @@ const Providers = memo(({ children }: PropsWithChildren) => {
|
|
|
85
86
|
<Suspense>
|
|
86
87
|
<TooltipProvider>
|
|
87
88
|
<SlotzProvider controller={slotsController}>
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
<LocaleProvider>
|
|
90
|
+
<ModalProvider>
|
|
91
|
+
{children}
|
|
92
|
+
<Toaster />
|
|
93
|
+
<TailwindIndicator />
|
|
94
|
+
</ModalProvider>
|
|
95
|
+
</LocaleProvider>
|
|
93
96
|
</SlotzProvider>
|
|
94
97
|
</TooltipProvider>
|
|
95
98
|
</Suspense>
|
|
@@ -101,11 +101,13 @@ class AttachmentContextProvider extends AIContextProvider<MockContextItem> {
|
|
|
101
101
|
readonly mentionPrefix = "@";
|
|
102
102
|
readonly contextType = "attachment";
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
) {
|
|
104
|
+
private items: MockContextItem[];
|
|
105
|
+
private attachments: FileUIPart[];
|
|
106
|
+
|
|
107
|
+
constructor(items: MockContextItem[] = [], attachments: FileUIPart[] = []) {
|
|
108
108
|
super();
|
|
109
|
+
this.items = items;
|
|
110
|
+
this.attachments = attachments;
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
getItems(): MockContextItem[] {
|
|
@@ -86,9 +86,10 @@ export class CellOutputContextProvider extends AIContextProvider<CellOutputConte
|
|
|
86
86
|
readonly title = "Cell Outputs";
|
|
87
87
|
readonly mentionPrefix = "@";
|
|
88
88
|
readonly contextType = "cell-output";
|
|
89
|
-
|
|
90
|
-
constructor(
|
|
89
|
+
private store: JotaiStore;
|
|
90
|
+
constructor(store: JotaiStore) {
|
|
91
91
|
super();
|
|
92
|
+
this.store = store;
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
getItems(): CellOutputContextItem[] {
|
|
@@ -64,9 +64,11 @@ export class ErrorContextProvider extends AIContextProvider<ErrorContextItem> {
|
|
|
64
64
|
readonly title = "Errors";
|
|
65
65
|
readonly mentionPrefix = "@";
|
|
66
66
|
readonly contextType = "error";
|
|
67
|
+
private store: JotaiStore;
|
|
67
68
|
|
|
68
|
-
constructor(
|
|
69
|
+
constructor(store: JotaiStore) {
|
|
69
70
|
super();
|
|
71
|
+
this.store = store;
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
getItems(): ErrorContextItem[] {
|
|
@@ -43,11 +43,16 @@ export class FileContextProvider extends AIContextProvider<FileContextItem> {
|
|
|
43
43
|
readonly mentionPrefix = "#";
|
|
44
44
|
readonly contextType = "file";
|
|
45
45
|
|
|
46
|
+
private apiRequests: EditRequests & RunRequests;
|
|
47
|
+
private config: FileSearchConfig;
|
|
48
|
+
|
|
46
49
|
constructor(
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
apiRequests: EditRequests & RunRequests,
|
|
51
|
+
config: FileSearchConfig = DEFAULT_FILE_SEARCH_CONFIG,
|
|
49
52
|
) {
|
|
50
53
|
super();
|
|
54
|
+
this.apiRequests = apiRequests;
|
|
55
|
+
this.config = config;
|
|
51
56
|
}
|
|
52
57
|
|
|
53
58
|
/**
|
|
@@ -17,9 +17,10 @@ export class TableContextProvider extends AIContextProvider<TableContextItem> {
|
|
|
17
17
|
readonly title = "Tables";
|
|
18
18
|
readonly mentionPrefix = "@";
|
|
19
19
|
readonly contextType = "data";
|
|
20
|
-
|
|
21
|
-
constructor(
|
|
20
|
+
private tablesMap: DatasetTablesMap;
|
|
21
|
+
constructor(tablesMap: DatasetTablesMap) {
|
|
22
22
|
super();
|
|
23
|
+
this.tablesMap = tablesMap;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
getItems(): TableContextItem[] {
|