@marimo-team/frontend 0.16.0-dev96986 → 0.16.0
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-BErMbWvG.js +19 -0
- package/dist/assets/{ImageComparisonComponent-SX7fDaTK.js → ImageComparisonComponent-fTHv1Ih0.js} +1 -1
- package/dist/assets/{VegaLite-MJUW3b7C.js → VegaLite-Bdi-TyfY.js} +1 -1
- package/dist/assets/_baseEach-CNBxBxvS.js +1 -0
- package/dist/assets/_baseMap-D1WHjKrd.js +1 -0
- package/dist/assets/_baseUniq-CCgDNtZb.js +1 -0
- package/dist/assets/{_createAggregator-ZRm2b6Zm.js → _createAggregator-DcD0kTA5.js} +1 -1
- package/dist/assets/{agent-panel-BBd11wNX.js → agent-panel-Crv430aI.js} +57 -76
- package/dist/assets/{any-language-editor-DwAaEQfS.js → any-language-editor-CQh552Wu.js} +1 -1
- package/dist/assets/{architectureDiagram-W76B3OCA-BJmVXUoW.js → architectureDiagram-W76B3OCA-BAJeBxzt.js} +1 -1
- package/dist/assets/{between-horizontal-start-KiwU-a3C.js → between-horizontal-start-Boxgxbt_.js} +1 -1
- package/dist/assets/{blockDiagram-QIGZ2CNN-DzxZjE7B.js → blockDiagram-QIGZ2CNN-CL-1svEK.js} +1 -1
- package/dist/assets/{c4Diagram-FPNF74CW-DjmldG_J.js → c4Diagram-FPNF74CW-BbEqbCTl.js} +1 -1
- package/dist/assets/channel-_2eNSz0n.js +1 -0
- package/dist/assets/chat-panel-CXh5Wl6C.js +3 -0
- package/dist/assets/{chunk-4BX2VUAB-EUTQThiZ.js → chunk-4BX2VUAB-C--8TXeE.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-DZAiDJxy.js → chunk-55IACEB6-Bj00HDqq.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-Bd0Czs-J.js → chunk-FMBD7UC4-C-lhB6hN.js} +1 -1
- package/dist/assets/{chunk-K7UQS3LO-DEKMIknX.js → chunk-K7UQS3LO-B-pGTXPt.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-E0jwHU_n.js → chunk-QN33PNHL-DqUzGhvm.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-BzaIHJbq.js → chunk-QZHKN3VN-TntJHfSk.js} +1 -1
- package/dist/assets/{chunk-TVAH2DTR-CZFYvqnm.js → chunk-TVAH2DTR-HUJb1psV.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-BNqnFjtv.js → chunk-TZMSLE5B-BK3C__t3.js} +1 -1
- package/dist/assets/{circle-play-D3J_mYrF.js → circle-play-DBLOv1Yu.js} +1 -1
- package/dist/assets/classDiagram-KNZD7YFC-BGmh9POF.js +1 -0
- package/dist/assets/classDiagram-v2-RKCZMP56-BGmh9POF.js +1 -0
- package/dist/assets/{clear-button-ifzRuAR3.js → clear-button-BeoFbEKH.js} +1 -1
- package/dist/assets/clone-BFDSPAj3.js +1 -0
- package/dist/assets/{command-palette-D2fdVSET.js → command-palette-CXZiSv0I.js} +1 -1
- package/dist/assets/{common-Ku-cF_2J.js → common-C7oJcmCT.js} +1 -1
- package/dist/assets/{compile-BgZlHW1c.js → compile-7L0MwhyI.js} +1 -1
- package/dist/assets/{cose-bilkent-S5V4N54A-CVM83SqK.js → cose-bilkent-S5V4N54A-BMkGLcVC.js} +1 -1
- package/dist/assets/{dagre-5GWH7T2D-ouQPkxT3.js → dagre-5GWH7T2D-BJtRienS.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-B47j5GJJ.js → data-grid-overlay-editor-DBkmGtNs.js} +1 -1
- package/dist/assets/datasources-panel-B7FbYLiy.js +1 -0
- package/dist/assets/{dependency-graph-panel-CZC_B7pK.js → dependency-graph-panel-DEdOxp2X.js} +1 -1
- package/dist/assets/{diagram-N5W7TBWH-CQ817ZdR.js → diagram-N5W7TBWH-CmECY3nb.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-DOK_psUO.js → diagram-QEK2KX5R-DMOVSNKD.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-CVljmOW8.js → diagram-S2PKOQOG-BiJ96PNQ.js} +1 -1
- package/dist/assets/{documentation-panel-C7yIvGg1.js → documentation-panel-xULhaEv3.js} +1 -1
- package/dist/assets/edit-page-BrYda9VE.js +129 -0
- package/dist/assets/{ellipsis-vertical-C7FjlUsY.js → ellipsis-vertical-BBqXIlc2.js} +1 -1
- package/dist/assets/{empty-state-DIOGM_CU.js → empty-state-B3dA3G5P.js} +1 -1
- package/dist/assets/{erDiagram-AWTI2OKA-DYu8cEdc.js → erDiagram-AWTI2OKA-MP1DiFRo.js} +1 -1
- package/dist/assets/{error-panel-Ddb8RkFG.js → error-panel-Cc1sv-Ag.js} +1 -1
- package/dist/assets/file-explorer-panel-Bw59Kva1.js +1 -0
- package/dist/assets/{flowDiagram-PVAE7QVJ-CmvW5iTb.js → flowDiagram-PVAE7QVJ-BX7caPp7.js} +1 -1
- package/dist/assets/{ganttDiagram-OWAHRB6G-BaKQlCaT.js → ganttDiagram-OWAHRB6G-B462g4Yf.js} +4 -4
- package/dist/assets/{gitGraphDiagram-NY62KEGX-CWO24eP6.js → gitGraphDiagram-NY62KEGX-CGgvZ9-9.js} +1 -1
- package/dist/assets/{glide-data-editor-CNDLEJ9a.js → glide-data-editor-C0gUFZON.js} +11 -11
- package/dist/assets/{graph-BZKTtxsc.js → graph-CHRVBzY5.js} +1 -1
- package/dist/assets/home-page-Fb2osjys.js +9 -0
- package/dist/assets/{index-zrSUQXha.js → index-BVgAenPd.js} +1 -1
- package/dist/assets/{index-Brf2DwUM.js → index-BY93Ejhl.js} +1 -1
- package/dist/assets/{index-CerjupfZ.js → index-C-8WADat.js} +1 -1
- package/dist/assets/{index-DZhOPkOB.js → index-C-GhZ7ti.js} +1 -1
- package/dist/assets/{index-CZaurnA9.js → index-C1v_Z9et.js} +1 -1
- package/dist/assets/{index-0XOUPdwT.js → index-C4Tn5NvJ.js} +1 -1
- package/dist/assets/{index-B_d_JZGI.js → index-C77h_TXN.js} +1 -1
- package/dist/assets/{index-BJVyzkx5.js → index-CQDrxQ0j.js} +1 -1
- package/dist/assets/{index-DFrGFNW1.js → index-CWMgowgL.js} +1 -1
- package/dist/assets/{index-DmgwT3sx.js → index-Clbi_Yaq.js} +1 -1
- package/dist/assets/{index-D-tZfElD.js → index-CpTPJo4k.js} +1 -1
- package/dist/assets/index-Cx0bsY1w.css +1 -0
- package/dist/assets/{index-DkntzpX4.js → index-D1vmG6DS.js} +1 -1
- package/dist/assets/{index-D3PqGupX.js → index-D9UKkrr2.js} +1 -1
- package/dist/assets/{index-BgXbBA39.js → index-DEQvTChO.js} +1 -1
- package/dist/assets/index-DKEudB02.js +578 -0
- package/dist/assets/{index-DCkzth56.js → index-DRMm6SNo.js} +1 -1
- package/dist/assets/{index-WXJFkQHg.js → index-DoRmcrKM.js} +1 -1
- package/dist/assets/{index-qE8lHQ-N.js → index-lYa_leQE.js} +1 -1
- package/dist/assets/{index-CXrWwFX6.js → index-vmICa5KN.js} +1 -1
- package/dist/assets/{index-BH7f3aiU.js → index-z9bohSQJ.js} +1 -1
- package/dist/assets/infoDiagram-STP46IZ2-CVyrdLc8.js +2 -0
- package/dist/assets/{isEmpty-D1t7Gran.js → isEmpty-DU_ogP_D.js} +1 -1
- package/dist/assets/{journeyDiagram-BIP6EPQ6-D4Rp6H_h.js → journeyDiagram-BIP6EPQ6-C6EgLP_Q.js} +1 -1
- package/dist/assets/{kanban-definition-6OIFK2YF-DFt9DftA.js → kanban-definition-6OIFK2YF-BXzYO1yj.js} +1 -1
- package/dist/assets/{layout-D8WXi2_g.js → layout-jihVw5-i.js} +1 -1
- package/dist/assets/{linear-BwY8e5hA.js → linear-C4blANlC.js} +1 -1
- package/dist/assets/links-D59GIweI.js +7 -0
- package/dist/assets/{logs-panel-Dxiyt7dO.js → logs-panel-D401qzZh.js} +1 -1
- package/dist/assets/{markdown-renderer-VDu-NBKB.js → markdown-renderer-Cd9eYyaL.js} +20 -20
- package/dist/assets/{mermaid-B-O-Puyi.js → mermaid-BEVuRz_O.js} +1 -1
- package/dist/assets/{mermaid.core-BFFCqfOn.js → mermaid.core-CaSnaLH0.js} +4 -4
- package/dist/assets/min-DUMu_zeK.js +1 -0
- package/dist/assets/{mindmap-definition-Q6HEUPPD-kyvIY8Dg.js → mindmap-definition-Q6HEUPPD-BXUM5MT2.js} +1 -1
- package/dist/assets/{number-overlay-editor-GjLB2UK4.js → number-overlay-editor-4uWXGlPG.js} +1 -1
- package/dist/assets/outline-panel-DIzkvm2I.js +1 -0
- package/dist/assets/{packages-panel-nfXB-bKW.js → packages-panel-CJL0MVlj.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-D8JFQcWR.js → pieDiagram-ADFJNKIX-Dxt5PVNo.js} +1 -1
- package/dist/assets/{quadrantDiagram-LMRXKWRM-Nf8GzxXG.js → quadrantDiagram-LMRXKWRM-D4pUaA31.js} +1 -1
- package/dist/assets/{react-plotly-CnW9p7ZA.js → react-plotly-cJZ0VWBq.js} +1 -1
- package/dist/assets/{requirementDiagram-4UW4RH46-CCUxF8BZ.js → requirementDiagram-4UW4RH46-DVRTjgas.js} +1 -1
- package/dist/assets/{run-page-Bl4p3AbZ.js → run-page-BUEnMC9w.js} +1 -1
- package/dist/assets/{sankeyDiagram-GR3RE2ED-Sr8kDwP1.js → sankeyDiagram-GR3RE2ED-CVFnD9C-.js} +1 -1
- package/dist/assets/{scratchpad-panel-Ja1Mu-W3.js → scratchpad-panel-BIgRENkI.js} +1 -1
- package/dist/assets/{secrets-panel-B-3fcSyP.js → secrets-panel-xY5-V_BD.js} +1 -1
- package/dist/assets/{sequenceDiagram-C3RYC4MD-CBJ152Q3.js → sequenceDiagram-C3RYC4MD-_lY4ZN_S.js} +1 -1
- package/dist/assets/{slides-component-C-LoGC1U.css → slides-component-DMjQomc3.css} +1 -1
- package/dist/assets/{slides-component-DGtsVP5o.js → slides-component-Xjymwj7X.js} +1 -1
- package/dist/assets/snippets-panel-CTPYW41n.js +1 -0
- package/dist/assets/sortBy-BNZKwiq_.js +1 -0
- package/dist/assets/{state-B_RCHTH5.js → state-C4NiC9tO.js} +1 -1
- package/dist/assets/{stateDiagram-KXAO66HF-BlBFSAZr.js → stateDiagram-KXAO66HF-Da0JQWCn.js} +1 -1
- package/dist/assets/stateDiagram-v2-UMBNRL4Z-D5lYZOOt.js +1 -0
- package/dist/assets/storage-CMdLzB_c.js +26 -0
- package/dist/assets/{terminal-CATzv5Hd.js → terminal-BPwTkXae.js} +1 -1
- package/dist/assets/{time-CsYqILfB.js → time-Dv5_Ouz_.js} +1 -1
- package/dist/assets/{timeline-definition-XQNQX7LJ-CGrhjuAs.js → timeline-definition-XQNQX7LJ-Dxh5Zu2e.js} +1 -1
- package/dist/assets/tracing-BCIurUfa.js +2 -0
- package/dist/assets/{tracing-panel-DmzqPUtc.js → tracing-panel-DAzrzNmm.js} +2 -2
- package/dist/assets/{trash-rxdjLzkf.js → trash-Dc6DSjz_.js} +1 -1
- package/dist/assets/{tree-C2Ul1h1C.js → tree-jheoerAX.js} +1 -1
- package/dist/assets/{treemap-75Q7IDZK-N9hyUpyj.js → treemap-75Q7IDZK-IgpxeGaf.js} +27 -27
- package/dist/assets/variable-panel-DYAiLBmF.js +1 -0
- package/dist/assets/{vega-component-CR_MHOBT.js → vega-component-BpfpiPKI.js} +1 -1
- package/dist/assets/worker-X5rxzQGQ.js +1 -0
- package/dist/assets/{xychartDiagram-6GGTOJPD-jdLZsMb2.js → xychartDiagram-6GGTOJPD-CmNigJ31.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +2 -3
- package/src/components/app-config/user-config-form.tsx +1 -46
- package/src/components/chat/acp/__tests__/__snapshots__/prompt.test.ts.snap +43 -62
- 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 +27 -24
- package/src/components/chat/acp/blocks.tsx +6 -6
- package/src/components/chat/acp/prompt.ts +43 -62
- package/src/components/chat/chat-panel.tsx +1 -5
- package/src/components/chat/markdown-renderer.tsx +10 -6
- package/src/components/chat/tool-call-accordion.tsx +20 -52
- package/src/components/data-table/SearchBar.tsx +7 -8
- package/src/components/data-table/__tests__/column_formatting.test.ts +35 -50
- package/src/components/data-table/__tests__/data-table.test.tsx +1 -39
- package/src/components/data-table/charts/components/form-fields.tsx +37 -41
- package/src/components/data-table/charts/forms/common-chart.tsx +2 -2
- package/src/components/data-table/column-explorer-panel/column-explorer.tsx +2 -5
- package/src/components/data-table/column-formatting/feature.ts +29 -62
- package/src/components/data-table/column-formatting/types.ts +0 -1
- package/src/components/data-table/column-header.tsx +1 -3
- package/src/components/data-table/column-summary/chart-spec-model.tsx +7 -24
- package/src/components/data-table/column-summary/column-summary.tsx +9 -18
- package/src/components/data-table/columns.tsx +18 -42
- package/src/components/data-table/data-table.tsx +2 -10
- package/src/components/data-table/date-popover.tsx +75 -85
- package/src/components/data-table/filter-pills.tsx +9 -14
- package/src/components/data-table/header-items.tsx +1 -5
- package/src/components/data-table/pagination.tsx +13 -20
- package/src/components/data-table/renderers.tsx +0 -28
- package/src/components/data-table/row-viewer-panel/row-viewer.tsx +8 -10
- package/src/components/datasources/column-preview.tsx +2 -6
- package/src/components/datasources/datasources.tsx +12 -8
- package/src/components/editor/ai/transport/chat-transport.tsx +1 -4
- package/src/components/editor/cell/CellStatus.tsx +20 -23
- package/src/components/editor/cell/CreateCellButton.tsx +4 -3
- package/src/components/editor/cell/code/language-toggle.tsx +4 -3
- package/src/components/editor/chrome/wrapper/footer-items/machine-stats.tsx +28 -39
- package/src/components/editor/controls/notebook-menu-dropdown.tsx +2 -4
- package/src/components/editor/file-tree/requesting-tree.tsx +8 -14
- package/src/components/editor/renderers/CellArray.tsx +4 -3
- package/src/components/editor/renderers/slides-layout/slides-layout.tsx +3 -3
- package/src/components/editor/renderers/slides-layout/types.ts +0 -1
- package/src/components/pages/home-page.tsx +1 -4
- package/src/components/slides/slides-component.tsx +1 -1
- package/src/components/slides/slides.css +0 -6
- package/src/components/terminal/theme.tsx +0 -1
- package/src/components/tracing/tracing-spec.ts +4 -5
- package/src/components/ui/range-slider.tsx +2 -4
- package/src/components/ui/slider.tsx +1 -3
- package/src/components/variables/variables-table.tsx +0 -3
- package/src/core/MarimoApp.tsx +6 -9
- package/src/core/ai/context/__tests__/registry.test.ts +4 -6
- package/src/core/ai/context/providers/cell-output.ts +2 -3
- package/src/core/ai/context/providers/error.ts +1 -3
- package/src/core/ai/context/providers/file.ts +2 -7
- package/src/core/ai/context/providers/tables.ts +2 -3
- package/src/core/ai/context/providers/variable.ts +4 -6
- package/src/core/cells/logs.ts +1 -1
- package/src/core/codemirror/find-replace/search-highlight.ts +1 -3
- package/src/core/codemirror/language/LanguageAdapters.ts +3 -9
- package/src/core/codemirror/lsp/notebook-lsp.ts +2 -8
- package/src/core/codemirror/readonly/__tests__/extension.test.ts +1 -1
- package/src/core/codemirror/rtc/loro/awareness.ts +17 -52
- package/src/core/codemirror/rtc/loro/sync.ts +4 -12
- package/src/core/config/config-schema.ts +0 -1
- package/src/core/config/config.ts +0 -4
- package/src/core/hotkeys/hotkeys.ts +4 -8
- package/src/core/islands/components/web-components.tsx +10 -13
- package/src/core/kernel/RuntimeState.ts +1 -4
- package/src/core/kernel/messages.ts +2 -2
- package/src/core/network/DeferredRequestRegistry.ts +4 -16
- package/src/core/runtime/runtime.ts +4 -5
- package/src/core/wasm/bridge.ts +1 -5
- package/src/core/wasm/store.ts +1 -4
- package/src/core/wasm/worker/message-buffer.ts +2 -3
- package/src/core/websocket/types.ts +16 -22
- package/src/hooks/useTimer.ts +5 -8
- package/src/plugins/core/registerReactComponent.tsx +10 -16
- package/src/plugins/impl/DataTablePlugin.tsx +0 -4
- package/src/plugins/impl/RangeSliderPlugin.tsx +3 -5
- package/src/plugins/impl/SliderPlugin.tsx +1 -3
- package/src/plugins/impl/anywidget/model.ts +5 -16
- package/src/plugins/impl/data-editor/types.ts +5 -7
- package/src/plugins/impl/data-explorer/components/column-summary.tsx +13 -20
- package/src/plugins/impl/panel/utils.ts +4 -6
- package/src/plugins/layout/StatPlugin.tsx +1 -4
- package/src/plugins/plugins.ts +0 -2
- package/src/utils/__tests__/dates.test.ts +24 -45
- package/src/utils/__tests__/numbers.test.ts +30 -42
- package/src/utils/dates.ts +10 -15
- package/src/utils/edit-distance.ts +6 -8
- package/src/utils/errors.ts +1 -1
- package/src/utils/id-tree.tsx +10 -21
- package/src/utils/localStorage.ts +4 -13
- package/src/utils/numbers.ts +11 -11
- package/src/utils/once.ts +0 -32
- package/src/utils/paths.ts +1 -4
- package/src/utils/pluralize.ts +5 -12
- package/src/utils/python-poet/poet.ts +15 -30
- package/src/utils/time.ts +1 -5
- package/dist/assets/ConnectedDataExplorerComponent-CNLoZkWr.js +0 -19
- package/dist/assets/_baseEach-9_logFrf.js +0 -1
- package/dist/assets/_baseMap-NzEbKt5c.js +0 -1
- package/dist/assets/_baseUniq-C5LFcyNC.js +0 -1
- package/dist/assets/channel-DHcKBVM4.js +0 -1
- package/dist/assets/chat-panel-DgJZr0eS.js +0 -3
- package/dist/assets/classDiagram-KNZD7YFC-D-xwLnlX.js +0 -1
- package/dist/assets/classDiagram-v2-RKCZMP56-D-xwLnlX.js +0 -1
- package/dist/assets/clone-CSxIll62.js +0 -1
- package/dist/assets/datasources-panel-Bt41Zir-.js +0 -1
- package/dist/assets/edit-page-CyTMQV2u.js +0 -129
- package/dist/assets/file-explorer-panel-Oy9DbyFP.js +0 -1
- package/dist/assets/home-page-Bvwppn9N.js +0 -9
- package/dist/assets/index-DadI618h.css +0 -1
- package/dist/assets/index-PmY0x4Zd.js +0 -578
- package/dist/assets/infoDiagram-STP46IZ2-CAuVVehw.js +0 -2
- package/dist/assets/links-4B6ldZ5P.js +0 -7
- package/dist/assets/min-DtVSfYKl.js +0 -1
- package/dist/assets/outline-panel-CMJjOoN7.js +0 -1
- package/dist/assets/snippets-panel-ClNnwKBM.js +0 -1
- package/dist/assets/sortBy-D47H6Vyl.js +0 -1
- package/dist/assets/stateDiagram-v2-UMBNRL4Z-DbA-iToo.js +0 -1
- package/dist/assets/storage-BNcWOH3-.js +0 -26
- package/dist/assets/tracing-DUbJtOyq.js +0 -2
- package/dist/assets/variable-panel-BbgupOdG.js +0 -1
- package/dist/assets/worker-fHbtoWvT.js +0 -1
- package/src/components/data-table/cell-hover-template/feature.ts +0 -14
- package/src/components/data-table/cell-hover-template/types.ts +0 -11
- package/src/core/i18n/__tests__/locale-provider.test.tsx +0 -176
- package/src/core/i18n/locale-provider.tsx +0 -35
- package/src/core/i18n/with-locale.tsx +0 -12
- package/src/hooks/useFormatting.ts +0 -97
- package/src/plugins/layout/OutlinePlugin.tsx +0 -69
- package/src/utils/__tests__/once.test.ts +0 -187
|
@@ -20,13 +20,11 @@ export class VariableContextProvider extends AIContextProvider<VariableContextIt
|
|
|
20
20
|
readonly mentionPrefix = "@";
|
|
21
21
|
readonly contextType = "variable";
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
constructor(
|
|
24
|
+
private variables: Variables,
|
|
25
|
+
private tablesMap: DatasetTablesMap,
|
|
26
|
+
) {
|
|
27
27
|
super();
|
|
28
|
-
this.variables = variables;
|
|
29
|
-
this.tablesMap = tablesMap;
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
getItems(): VariableContextItem[] {
|
package/src/core/cells/logs.ts
CHANGED
|
@@ -102,7 +102,7 @@ export function formatLogTimestamp(timestamp: number): string {
|
|
|
102
102
|
try {
|
|
103
103
|
// parse from UTC
|
|
104
104
|
const date = fromUnixTime(timestamp);
|
|
105
|
-
return date.toLocaleTimeString(
|
|
105
|
+
return date.toLocaleTimeString("en-US", {
|
|
106
106
|
hour12: true,
|
|
107
107
|
hour: "numeric",
|
|
108
108
|
minute: "numeric",
|
|
@@ -91,10 +91,8 @@ const HighlightMargin = 250;
|
|
|
91
91
|
export const searchHighlighter = ViewPlugin.fromClass(
|
|
92
92
|
class {
|
|
93
93
|
decorations: DecorationSet;
|
|
94
|
-
readonly view: EditorView;
|
|
95
94
|
|
|
96
|
-
constructor(view: EditorView) {
|
|
97
|
-
this.view = view;
|
|
95
|
+
constructor(readonly view: EditorView) {
|
|
98
96
|
this.decorations = this.highlight(view.state.field(searchState));
|
|
99
97
|
}
|
|
100
98
|
|
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
|
-
import { once } from "@/utils/once";
|
|
4
3
|
import { MarkdownLanguageAdapter } from "./languages/markdown";
|
|
5
4
|
import { PythonLanguageAdapter } from "./languages/python";
|
|
6
5
|
import { SQLLanguageAdapter } from "./languages/sql/sql";
|
|
7
6
|
import type { LanguageAdapter, LanguageAdapterType } from "./types";
|
|
8
7
|
|
|
9
|
-
// Create cached instances
|
|
10
|
-
const createPythonAdapter = once(() => new PythonLanguageAdapter());
|
|
11
|
-
const createMarkdownAdapter = once(() => new MarkdownLanguageAdapter());
|
|
12
|
-
const createSqlAdapter = once(() => new SQLLanguageAdapter());
|
|
13
|
-
|
|
14
8
|
export const LanguageAdapters: Record<LanguageAdapterType, LanguageAdapter> = {
|
|
15
9
|
// Getters to prevent circular dependencies
|
|
16
10
|
get python() {
|
|
17
|
-
return
|
|
11
|
+
return new PythonLanguageAdapter();
|
|
18
12
|
},
|
|
19
13
|
get markdown() {
|
|
20
|
-
return
|
|
14
|
+
return new MarkdownLanguageAdapter();
|
|
21
15
|
},
|
|
22
16
|
get sql() {
|
|
23
|
-
return
|
|
17
|
+
return new SQLLanguageAdapter();
|
|
24
18
|
},
|
|
25
19
|
};
|
|
26
20
|
|
|
@@ -18,19 +18,13 @@ import { getLSPDocument } from "./utils";
|
|
|
18
18
|
|
|
19
19
|
class Snapshotter {
|
|
20
20
|
private documentVersion = 0;
|
|
21
|
-
private readonly getNotebookCode: () => {
|
|
22
|
-
cellIds: CellId[];
|
|
23
|
-
codes: Record<CellId, string>;
|
|
24
|
-
};
|
|
25
21
|
|
|
26
22
|
constructor(
|
|
27
|
-
getNotebookCode: () => {
|
|
23
|
+
private readonly getNotebookCode: () => {
|
|
28
24
|
cellIds: CellId[];
|
|
29
25
|
codes: Record<CellId, string>;
|
|
30
26
|
},
|
|
31
|
-
) {
|
|
32
|
-
this.getNotebookCode = getNotebookCode;
|
|
33
|
-
}
|
|
27
|
+
) {}
|
|
34
28
|
|
|
35
29
|
/**
|
|
36
30
|
* Map from the global document version to the cell id and version.
|
|
@@ -9,7 +9,7 @@ import { connectionAtom } from "../../../network/connection";
|
|
|
9
9
|
import { dynamicReadonly, isEditorReadonly } from "../extension";
|
|
10
10
|
|
|
11
11
|
function makeStoreWithConnection(
|
|
12
|
-
state:
|
|
12
|
+
state: WebSocketState.CONNECTING | WebSocketState.OPEN,
|
|
13
13
|
) {
|
|
14
14
|
const store = createStore();
|
|
15
15
|
store.set(connectionAtom, { state });
|
|
@@ -202,25 +202,13 @@ export const createSelectionLayer = (): Extension =>
|
|
|
202
202
|
* Renders a blinking cursor to indicate the cursor of another user.
|
|
203
203
|
*/
|
|
204
204
|
export class RemoteCursorMarker implements LayerMarker {
|
|
205
|
-
private left: number;
|
|
206
|
-
private top: number;
|
|
207
|
-
private height: number;
|
|
208
|
-
private name: string;
|
|
209
|
-
private colorClassName: string;
|
|
210
|
-
|
|
211
205
|
constructor(
|
|
212
|
-
left: number,
|
|
213
|
-
top: number,
|
|
214
|
-
height: number,
|
|
215
|
-
name: string,
|
|
216
|
-
colorClassName: string,
|
|
217
|
-
) {
|
|
218
|
-
this.left = left;
|
|
219
|
-
this.top = top;
|
|
220
|
-
this.height = height;
|
|
221
|
-
this.name = name;
|
|
222
|
-
this.colorClassName = colorClassName;
|
|
223
|
-
}
|
|
206
|
+
private left: number,
|
|
207
|
+
private top: number,
|
|
208
|
+
private height: number,
|
|
209
|
+
private name: string,
|
|
210
|
+
private colorClassName: string,
|
|
211
|
+
) {}
|
|
224
212
|
|
|
225
213
|
draw(): HTMLElement {
|
|
226
214
|
const elt = document.createElement("div");
|
|
@@ -365,30 +353,16 @@ export interface CursorPosition {
|
|
|
365
353
|
|
|
366
354
|
export class AwarenessPlugin implements PluginValue {
|
|
367
355
|
sub: Subscription;
|
|
368
|
-
public view: EditorView;
|
|
369
|
-
public doc: LoroDoc;
|
|
370
|
-
public user: UserState;
|
|
371
|
-
public awareness: Awareness<AwarenessState>;
|
|
372
|
-
private getTextFromDoc: (doc: LoroDoc) => LoroText;
|
|
373
|
-
private scopeId: ScopeId;
|
|
374
|
-
private getUserId?: () => Uid;
|
|
375
356
|
|
|
376
357
|
constructor(
|
|
377
|
-
view: EditorView,
|
|
378
|
-
doc: LoroDoc,
|
|
379
|
-
user: UserState,
|
|
380
|
-
awareness: Awareness<AwarenessState>,
|
|
381
|
-
getTextFromDoc: (doc: LoroDoc) => LoroText,
|
|
382
|
-
scopeId: ScopeId,
|
|
383
|
-
getUserId?: () => Uid,
|
|
358
|
+
public view: EditorView,
|
|
359
|
+
public doc: LoroDoc,
|
|
360
|
+
public user: UserState,
|
|
361
|
+
public awareness: Awareness<AwarenessState>,
|
|
362
|
+
private getTextFromDoc: (doc: LoroDoc) => LoroText,
|
|
363
|
+
private scopeId: ScopeId,
|
|
364
|
+
private getUserId?: () => Uid,
|
|
384
365
|
) {
|
|
385
|
-
this.view = view;
|
|
386
|
-
this.doc = doc;
|
|
387
|
-
this.user = user;
|
|
388
|
-
this.awareness = awareness;
|
|
389
|
-
this.getTextFromDoc = getTextFromDoc;
|
|
390
|
-
this.scopeId = scopeId;
|
|
391
|
-
this.getUserId = getUserId;
|
|
392
366
|
this.sub = this.doc.subscribe((e) => {
|
|
393
367
|
if (e.by === "local") {
|
|
394
368
|
// update remote cursor position
|
|
@@ -461,21 +435,12 @@ export class AwarenessPlugin implements PluginValue {
|
|
|
461
435
|
}
|
|
462
436
|
export class RemoteAwarenessPlugin implements PluginValue {
|
|
463
437
|
_awarenessListener?: AwarenessListener;
|
|
464
|
-
public view: EditorView;
|
|
465
|
-
public doc: LoroDoc;
|
|
466
|
-
public awareness: Awareness<AwarenessState>;
|
|
467
|
-
private scopeId: ScopeId;
|
|
468
|
-
|
|
469
438
|
constructor(
|
|
470
|
-
view: EditorView,
|
|
471
|
-
doc: LoroDoc,
|
|
472
|
-
awareness: Awareness<AwarenessState>,
|
|
473
|
-
scopeId: ScopeId,
|
|
439
|
+
public view: EditorView,
|
|
440
|
+
public doc: LoroDoc,
|
|
441
|
+
public awareness: Awareness<AwarenessState>,
|
|
442
|
+
private scopeId: ScopeId,
|
|
474
443
|
) {
|
|
475
|
-
this.view = view;
|
|
476
|
-
this.doc = doc;
|
|
477
|
-
this.awareness = awareness;
|
|
478
|
-
this.scopeId = scopeId;
|
|
479
444
|
const listener: AwarenessListener = async (arg, origin) => {
|
|
480
445
|
if (origin === "local") {
|
|
481
446
|
return;
|
|
@@ -40,21 +40,13 @@ export const loroSyncAnnotation = Annotation.define();
|
|
|
40
40
|
export class LoroSyncPluginValue implements PluginValue {
|
|
41
41
|
sub?: Subscription;
|
|
42
42
|
private isInitDispatch = false;
|
|
43
|
-
private view: EditorView;
|
|
44
|
-
private doc: LoroDoc;
|
|
45
|
-
private docPath: string[];
|
|
46
|
-
private getTextFromDoc: (doc: LoroDoc) => LoroText;
|
|
47
43
|
|
|
48
44
|
constructor(
|
|
49
|
-
view: EditorView,
|
|
50
|
-
doc: LoroDoc,
|
|
51
|
-
docPath: string[],
|
|
52
|
-
getTextFromDoc: (doc: LoroDoc) => LoroText,
|
|
45
|
+
private view: EditorView,
|
|
46
|
+
private doc: LoroDoc,
|
|
47
|
+
private docPath: string[],
|
|
48
|
+
private getTextFromDoc: (doc: LoroDoc) => LoroText,
|
|
53
49
|
) {
|
|
54
|
-
this.view = view;
|
|
55
|
-
this.doc = doc;
|
|
56
|
-
this.docPath = docPath;
|
|
57
|
-
this.getTextFromDoc = getTextFromDoc;
|
|
58
50
|
this.sub = doc.subscribe(this.onRemoteUpdate);
|
|
59
51
|
Promise.resolve().then(() => {
|
|
60
52
|
this.isInitDispatch = true;
|
|
@@ -82,10 +82,6 @@ export const editorFontSizeAtom = atom<number>((get) => {
|
|
|
82
82
|
return get(resolvedMarimoConfigAtom).display.code_editor_font_size;
|
|
83
83
|
});
|
|
84
84
|
|
|
85
|
-
export const localeAtom = atom<string | null | undefined>((get) => {
|
|
86
|
-
return get(resolvedMarimoConfigAtom).display.locale;
|
|
87
|
-
});
|
|
88
|
-
|
|
89
85
|
export function isAiEnabled(config: UserConfig) {
|
|
90
86
|
return (
|
|
91
87
|
Boolean(config.ai?.models?.chat_model) ||
|
|
@@ -452,13 +452,10 @@ export class HotkeyProvider implements IHotkeyProvider {
|
|
|
452
452
|
return new HotkeyProvider(DEFAULT_HOT_KEY, { platform });
|
|
453
453
|
}
|
|
454
454
|
|
|
455
|
-
private hotkeys: Record<HotkeyAction, Hotkey>;
|
|
456
|
-
|
|
457
455
|
constructor(
|
|
458
|
-
hotkeys: Record<HotkeyAction, Hotkey>,
|
|
456
|
+
private hotkeys: Record<HotkeyAction, Hotkey>,
|
|
459
457
|
options: HotkeyProviderOptions = {},
|
|
460
458
|
) {
|
|
461
|
-
this.hotkeys = hotkeys;
|
|
462
459
|
this.platform = options.platform ?? resolvePlatform();
|
|
463
460
|
this.mod = this.platform === "mac" ? "Cmd" : "Ctrl";
|
|
464
461
|
}
|
|
@@ -506,14 +503,13 @@ export class HotkeyProvider implements IHotkeyProvider {
|
|
|
506
503
|
}
|
|
507
504
|
|
|
508
505
|
export class OverridingHotkeyProvider extends HotkeyProvider {
|
|
509
|
-
private readonly overrides: Partial<Record<HotkeyAction, string | undefined>>;
|
|
510
|
-
|
|
511
506
|
constructor(
|
|
512
|
-
overrides: Partial<
|
|
507
|
+
private readonly overrides: Partial<
|
|
508
|
+
Record<HotkeyAction, string | undefined>
|
|
509
|
+
>,
|
|
513
510
|
options: HotkeyProviderOptions = {},
|
|
514
511
|
) {
|
|
515
512
|
super(DEFAULT_HOT_KEY, options);
|
|
516
|
-
this.overrides = overrides;
|
|
517
513
|
}
|
|
518
514
|
|
|
519
515
|
override getHotkey(action: HotkeyAction): ResolvedHotkey {
|
|
@@ -7,7 +7,6 @@ import { ErrorBoundary } from "@/components/editor/boundary/ErrorBoundary";
|
|
|
7
7
|
import { TooltipProvider } from "@/components/ui/tooltip";
|
|
8
8
|
import { notebookAtom } from "@/core/cells/cells";
|
|
9
9
|
import { UI_ELEMENT_REGISTRY } from "@/core/dom/uiregistry";
|
|
10
|
-
import { LocaleProvider } from "@/core/i18n/locale-provider";
|
|
11
10
|
import { renderHTML } from "@/plugins/core/RenderHTML";
|
|
12
11
|
import { invariant } from "@/utils/invariant";
|
|
13
12
|
import type { CellId } from "../../cells/ids";
|
|
@@ -81,18 +80,16 @@ export class MarimoIslandElement extends HTMLElement {
|
|
|
81
80
|
this.root?.render(
|
|
82
81
|
<ErrorBoundary>
|
|
83
82
|
<Provider store={store}>
|
|
84
|
-
<
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
</TooltipProvider>
|
|
95
|
-
</LocaleProvider>
|
|
83
|
+
<TooltipProvider>
|
|
84
|
+
<MarimoOutputWrapper
|
|
85
|
+
cellId={this.cellId}
|
|
86
|
+
codeCallback={codeCallback}
|
|
87
|
+
alwaysShowRun={alwaysShowRun}
|
|
88
|
+
>
|
|
89
|
+
{initialHtml}
|
|
90
|
+
</MarimoOutputWrapper>
|
|
91
|
+
{editor}
|
|
92
|
+
</TooltipProvider>
|
|
96
93
|
</Provider>
|
|
97
94
|
</ErrorBoundary>,
|
|
98
95
|
);
|
|
@@ -29,11 +29,8 @@ export class RuntimeState {
|
|
|
29
29
|
* ObjectIds of UIElements whose values need to be updated in the kernel
|
|
30
30
|
*/
|
|
31
31
|
private _sendComponentValues: RunRequests["sendComponentValues"] | undefined;
|
|
32
|
-
private uiElementRegistry: UIElementRegistry;
|
|
33
32
|
|
|
34
|
-
constructor(uiElementRegistry: UIElementRegistry) {
|
|
35
|
-
this.uiElementRegistry = uiElementRegistry;
|
|
36
|
-
}
|
|
33
|
+
constructor(private uiElementRegistry: UIElementRegistry) {}
|
|
37
34
|
|
|
38
35
|
private get sendComponentValues(): RunRequests["sendComponentValues"] {
|
|
39
36
|
if (!this._sendComponentValues) {
|
|
@@ -46,9 +46,9 @@ export type Capabilities = OperationMessageData<"kernel-ready">["capabilities"];
|
|
|
46
46
|
export type MessageOperationUnion = schemas["KnownUnions"]["operation"];
|
|
47
47
|
|
|
48
48
|
export type OperationMessageType = MessageOperationUnion["op"];
|
|
49
|
-
export
|
|
49
|
+
export type OperationMessage = {
|
|
50
50
|
data: MessageOperationUnion;
|
|
51
|
-
}
|
|
51
|
+
};
|
|
52
52
|
|
|
53
53
|
export type OperationMessageData<T extends OperationMessageType> = Omit<
|
|
54
54
|
Extract<MessageOperationUnion, { op: T }>,
|
|
@@ -18,29 +18,17 @@ export const RequestId = {
|
|
|
18
18
|
*/
|
|
19
19
|
export class DeferredRequestRegistry<REQ, RES> {
|
|
20
20
|
public requests = new Map<RequestId, Deferred<RES>>();
|
|
21
|
-
public operation: string;
|
|
22
|
-
private makeRequest: (id: RequestId, req: REQ) => Promise<void>;
|
|
23
|
-
private opts: {
|
|
24
|
-
/**
|
|
25
|
-
* Resolve existing requests with an empty response.
|
|
26
|
-
*/
|
|
27
|
-
resolveExistingRequests?: () => RES;
|
|
28
|
-
};
|
|
29
21
|
|
|
30
22
|
constructor(
|
|
31
|
-
operation: string,
|
|
32
|
-
makeRequest: (id: RequestId, req: REQ) => Promise<void>,
|
|
33
|
-
opts: {
|
|
23
|
+
public operation: string,
|
|
24
|
+
private makeRequest: (id: RequestId, req: REQ) => Promise<void>,
|
|
25
|
+
private opts: {
|
|
34
26
|
/**
|
|
35
27
|
* Resolve existing requests with an empty response.
|
|
36
28
|
*/
|
|
37
29
|
resolveExistingRequests?: () => RES;
|
|
38
30
|
} = {},
|
|
39
|
-
) {
|
|
40
|
-
this.operation = operation;
|
|
41
|
-
this.makeRequest = makeRequest;
|
|
42
|
-
this.opts = opts;
|
|
43
|
-
}
|
|
31
|
+
) {}
|
|
44
32
|
|
|
45
33
|
async request(opts: REQ): Promise<RES> {
|
|
46
34
|
if (this.opts.resolveExistingRequests) {
|
|
@@ -10,12 +10,11 @@ import type { RuntimeConfig } from "./types";
|
|
|
10
10
|
|
|
11
11
|
export class RuntimeManager {
|
|
12
12
|
private initialHealthyCheck = new Deferred<void>();
|
|
13
|
-
private config: RuntimeConfig;
|
|
14
|
-
private lazy: boolean;
|
|
15
13
|
|
|
16
|
-
constructor(
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
constructor(
|
|
15
|
+
private config: RuntimeConfig,
|
|
16
|
+
private lazy = false,
|
|
17
|
+
) {
|
|
19
18
|
// Validate the URL on construction
|
|
20
19
|
try {
|
|
21
20
|
new URL(this.config.url);
|
package/src/core/wasm/bridge.ts
CHANGED
|
@@ -576,11 +576,7 @@ export class PyodideWebsocket implements IReconnectingWebSocket {
|
|
|
576
576
|
messageSubscriptions = new Set<(event: MessageEvent) => void>();
|
|
577
577
|
errorSubscriptions = new Set<(event: Event) => void>();
|
|
578
578
|
|
|
579
|
-
private bridge: Pick<PyodideBridge, "consumeMessages"
|
|
580
|
-
|
|
581
|
-
constructor(bridge: Pick<PyodideBridge, "consumeMessages">) {
|
|
582
|
-
this.bridge = bridge;
|
|
583
|
-
}
|
|
579
|
+
constructor(private bridge: Pick<PyodideBridge, "consumeMessages">) {}
|
|
584
580
|
|
|
585
581
|
private consumeMessages() {
|
|
586
582
|
this.bridge.consumeMessages((message) => {
|
package/src/core/wasm/store.ts
CHANGED
|
@@ -87,10 +87,7 @@ const emptyFileStore: FileStore = {
|
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
export class CompositeFileStore implements FileStore {
|
|
90
|
-
private stores: FileStore[]
|
|
91
|
-
constructor(stores: FileStore[]) {
|
|
92
|
-
this.stores = stores;
|
|
93
|
-
}
|
|
90
|
+
constructor(private stores: FileStore[]) {}
|
|
94
91
|
|
|
95
92
|
insert(index: number, store: FileStore) {
|
|
96
93
|
this.stores.splice(index, 0, store);
|
|
@@ -7,9 +7,8 @@
|
|
|
7
7
|
export class MessageBuffer<T> {
|
|
8
8
|
private buffer: T[];
|
|
9
9
|
private started = false;
|
|
10
|
-
|
|
11
|
-
constructor(onMessage: (data: T) => void) {
|
|
12
|
-
this.onMessage = onMessage;
|
|
10
|
+
|
|
11
|
+
constructor(private onMessage: (data: T) => void) {
|
|
13
12
|
this.buffer = [];
|
|
14
13
|
}
|
|
15
14
|
|
|
@@ -2,28 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
import type ReconnectingWebSocket from "partysocket/ws";
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
CONNECTING
|
|
7
|
-
OPEN
|
|
8
|
-
CLOSING
|
|
9
|
-
CLOSED
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
ALREADY_RUNNING: "ALREADY_RUNNING",
|
|
18
|
-
MALFORMED_QUERY: "MALFORMED_QUERY",
|
|
19
|
-
} as const;
|
|
20
|
-
|
|
21
|
-
export type WebSocketClosedReason =
|
|
22
|
-
(typeof WebSocketClosedReason)[keyof typeof WebSocketClosedReason];
|
|
5
|
+
export enum WebSocketState {
|
|
6
|
+
CONNECTING = "CONNECTING",
|
|
7
|
+
OPEN = "CONNECTED",
|
|
8
|
+
CLOSING = "CLOSING",
|
|
9
|
+
CLOSED = "CLOSED",
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export enum WebSocketClosedReason {
|
|
13
|
+
KERNEL_DISCONNECTED = "KERNEL_DISCONNECTED",
|
|
14
|
+
ALREADY_RUNNING = "ALREADY_RUNNING",
|
|
15
|
+
MALFORMED_QUERY = "MALFORMED_QUERY",
|
|
16
|
+
}
|
|
23
17
|
|
|
24
18
|
export type ConnectionStatus =
|
|
25
19
|
| {
|
|
26
|
-
state:
|
|
20
|
+
state: WebSocketState.CLOSED;
|
|
27
21
|
code: WebSocketClosedReason;
|
|
28
22
|
/**
|
|
29
23
|
* Human-readable reason for closing the connection.
|
|
@@ -37,9 +31,9 @@ export type ConnectionStatus =
|
|
|
37
31
|
}
|
|
38
32
|
| {
|
|
39
33
|
state:
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
34
|
+
| WebSocketState.CONNECTING
|
|
35
|
+
| WebSocketState.OPEN
|
|
36
|
+
| WebSocketState.CLOSING;
|
|
43
37
|
};
|
|
44
38
|
|
|
45
39
|
type PublicInterface<T> = {
|
package/src/hooks/useTimer.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
|
-
import { useNumberFormatter } from "react-aria";
|
|
5
4
|
import useEvent from "react-use-event-hook";
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -12,12 +11,6 @@ export function useTimer() {
|
|
|
12
11
|
const [time, setTime] = useState(0);
|
|
13
12
|
const interval = useRef<number>(undefined);
|
|
14
13
|
|
|
15
|
-
// one decimal place, exactly
|
|
16
|
-
const numberFormatter = useNumberFormatter({
|
|
17
|
-
minimumFractionDigits: 1,
|
|
18
|
-
maximumFractionDigits: 1,
|
|
19
|
-
});
|
|
20
|
-
|
|
21
14
|
const start = useEvent(() => {
|
|
22
15
|
interval.current = window.setInterval(() => {
|
|
23
16
|
setTime((time) => time + 0.1);
|
|
@@ -43,7 +36,11 @@ export function useTimer() {
|
|
|
43
36
|
}, []);
|
|
44
37
|
|
|
45
38
|
return {
|
|
46
|
-
|
|
39
|
+
// one decimal place, exactly
|
|
40
|
+
time: new Intl.NumberFormat("en-US", {
|
|
41
|
+
minimumFractionDigits: 1,
|
|
42
|
+
maximumFractionDigits: 1,
|
|
43
|
+
}).format(time),
|
|
47
44
|
start,
|
|
48
45
|
stop,
|
|
49
46
|
clear,
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
* component. The factory handles the logic of communicating UI element values
|
|
9
9
|
* to and from the rest of marimo.
|
|
10
10
|
*/
|
|
11
|
-
import { Provider } from "jotai";
|
|
12
11
|
import React, {
|
|
13
12
|
createRef,
|
|
14
13
|
type JSX,
|
|
@@ -30,7 +29,6 @@ import { createInputEvent, MarimoValueUpdateEvent } from "@/core/dom/events";
|
|
|
30
29
|
import { getUIElementObjectId } from "@/core/dom/ui-element";
|
|
31
30
|
import { UIElementRegistry } from "@/core/dom/uiregistry";
|
|
32
31
|
import { FUNCTIONS_REGISTRY } from "@/core/functions/FunctionRegistry";
|
|
33
|
-
import { LocaleProvider } from "@/core/i18n/locale-provider";
|
|
34
32
|
import { store } from "@/core/state/jotai";
|
|
35
33
|
import {
|
|
36
34
|
type HTMLElementNotDerivedFromRef,
|
|
@@ -365,20 +363,16 @@ export function registerReactComponent<T>(plugin: IPlugin<T, unknown>): void {
|
|
|
365
363
|
|
|
366
364
|
invariant(this.root, "Root must be defined");
|
|
367
365
|
this.root.render(
|
|
368
|
-
<
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
{this.getChildren()}
|
|
379
|
-
</PluginSlot>
|
|
380
|
-
</LocaleProvider>
|
|
381
|
-
</Provider>,
|
|
366
|
+
<PluginSlot
|
|
367
|
+
hostElement={this}
|
|
368
|
+
plugin={plugin}
|
|
369
|
+
ref={this.pluginRef}
|
|
370
|
+
getInitialValue={() => {
|
|
371
|
+
return parseInitialValue(this, UIElementRegistry.INSTANCE);
|
|
372
|
+
}}
|
|
373
|
+
>
|
|
374
|
+
{this.getChildren()}
|
|
375
|
+
</PluginSlot>,
|
|
382
376
|
);
|
|
383
377
|
}
|
|
384
378
|
|
|
@@ -254,7 +254,6 @@ export const DataTablePlugin = createPlugin<S>("marimo-table")
|
|
|
254
254
|
maxColumns: z.union([z.number(), z.literal("all")]).default("all"),
|
|
255
255
|
hasStableRowId: z.boolean().default(false),
|
|
256
256
|
cellStyles: z.record(z.record(z.object({}).passthrough())).optional(),
|
|
257
|
-
hoverTemplate: z.string().optional(),
|
|
258
257
|
// Whether to load the data lazily.
|
|
259
258
|
lazy: z.boolean().default(false),
|
|
260
259
|
// If lazy, this will preload the first page of data
|
|
@@ -386,7 +385,6 @@ interface DataTableProps<T> extends Data<T>, DataTableFunctions {
|
|
|
386
385
|
// Filters
|
|
387
386
|
enableFilters?: boolean;
|
|
388
387
|
cellStyles?: CellStyleState | null;
|
|
389
|
-
hoverTemplate?: string | null;
|
|
390
388
|
toggleDisplayHeader?: () => void;
|
|
391
389
|
host: HTMLElement;
|
|
392
390
|
cellId?: CellId | null;
|
|
@@ -709,7 +707,6 @@ const DataTableComponent = ({
|
|
|
709
707
|
totalColumns,
|
|
710
708
|
get_row_ids,
|
|
711
709
|
cellStyles,
|
|
712
|
-
hoverTemplate,
|
|
713
710
|
toggleDisplayHeader,
|
|
714
711
|
calculate_top_k_rows,
|
|
715
712
|
preview_column,
|
|
@@ -907,7 +904,6 @@ const DataTableComponent = ({
|
|
|
907
904
|
rowSelection={rowSelection}
|
|
908
905
|
cellSelection={cellSelection}
|
|
909
906
|
cellStyling={cellStyles}
|
|
910
|
-
hoverTemplate={hoverTemplate}
|
|
911
907
|
downloadAs={showDownload ? downloadAs : undefined}
|
|
912
908
|
enableSearch={enableSearch}
|
|
913
909
|
searchQuery={searchQuery}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import { isEqual } from "lodash-es";
|
|
4
4
|
import { type JSX, useEffect, useId, useState } from "react";
|
|
5
|
-
import { useLocale } from "react-aria";
|
|
6
5
|
import { z } from "zod";
|
|
7
6
|
import { cn } from "@/utils/cn";
|
|
8
7
|
import { prettyScientificNumber } from "@/utils/numbers";
|
|
@@ -83,7 +82,6 @@ const RangeSliderComponent = ({
|
|
|
83
82
|
valueMap,
|
|
84
83
|
}: RangeSliderProps): JSX.Element => {
|
|
85
84
|
const id = useId();
|
|
86
|
-
const { locale } = useLocale();
|
|
87
85
|
|
|
88
86
|
// Hold internal value
|
|
89
87
|
const [internalValue, setInternalValue] = useState(value);
|
|
@@ -152,9 +150,9 @@ const RangeSliderComponent = ({
|
|
|
152
150
|
/>
|
|
153
151
|
{showValue && (
|
|
154
152
|
<div className="text-xs text-muted-foreground min-w-[16px]">
|
|
155
|
-
{`${prettyScientificNumber(
|
|
156
|
-
|
|
157
|
-
|
|
153
|
+
{`${prettyScientificNumber(
|
|
154
|
+
valueMap(internalValue[0]),
|
|
155
|
+
)}, ${prettyScientificNumber(valueMap(internalValue[1]))}`}
|
|
158
156
|
</div>
|
|
159
157
|
)}
|
|
160
158
|
</div>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
2
|
import { type JSX, useEffect, useId, useState } from "react";
|
|
3
|
-
import { useLocale } from "react-aria";
|
|
4
3
|
import { z } from "zod";
|
|
5
4
|
import { NumberField } from "@/components/ui/number-field";
|
|
6
5
|
import { cn } from "@/utils/cn";
|
|
@@ -86,7 +85,6 @@ const SliderComponent = ({
|
|
|
86
85
|
disabled,
|
|
87
86
|
}: SliderProps): JSX.Element => {
|
|
88
87
|
const id = useId();
|
|
89
|
-
const { locale } = useLocale();
|
|
90
88
|
|
|
91
89
|
// Hold internal value
|
|
92
90
|
const [internalValue, setInternalValue] = useState(value);
|
|
@@ -140,7 +138,7 @@ const SliderComponent = ({
|
|
|
140
138
|
/>
|
|
141
139
|
{showValue && (
|
|
142
140
|
<div className="text-xs text-muted-foreground min-w-[16px]">
|
|
143
|
-
{prettyScientificNumber(valueMap(internalValue)
|
|
141
|
+
{prettyScientificNumber(valueMap(internalValue))}
|
|
144
142
|
</div>
|
|
145
143
|
)}
|
|
146
144
|
{includeInput && (
|