@marimo-team/islands 0.25.1-dev4 → 0.25.1-dev40
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/{ConnectedDataExplorerComponent-KVhjDMSe.js → ConnectedDataExplorerComponent-CwMXfDQR.js} +3 -3
- package/dist/{ErrorBoundary-pV36lYEK.js → ErrorBoundary-CAJO-M56.js} +1 -1
- package/dist/{ImageComparisonComponent-Dlm5aWnH.js → ImageComparisonComponent-Cpfz30OZ.js} +51 -52
- package/dist/{abnfDiagram-VCTEODGH-CpN0FRda.js → abnfDiagram-VCTEODGH-AFhOQTt8.js} +3 -3
- package/dist/{architectureDiagram-5GKGNRK7-DDyj5SRB.js → architectureDiagram-5GKGNRK7-BngksAAQ.js} +5 -5
- package/dist/{blockDiagram-I7D4REHJ-BbXEXJRu.js → blockDiagram-I7D4REHJ-CvBmppdy.js} +9 -9
- package/dist/{c4Diagram-7LVT6UL2-DcLsbQmR.js → c4Diagram-7LVT6UL2-EceL4_jH.js} +7 -7
- package/dist/{cells-B5-y5EY3.js → cells-Cv93oav_.js} +3 -3
- package/dist/{channel-B5XnTarr.js → channel-z7HZXHwv.js} +1 -1
- package/dist/{chat-ui-HJZsTl7o.js → chat-ui-DLSF8a04.js} +4 -4
- package/dist/{chunk-4HAMMTFA-D2qv8E0X.js → chunk-4HAMMTFA-BPTTOOC5.js} +5 -5
- package/dist/{chunk-75Z2AOVW-5_HsvXwr.js → chunk-75Z2AOVW-C4AOleKf.js} +1 -1
- package/dist/{chunk-DU6HZSFF-BUgAHvnM.js → chunk-DU6HZSFF-1TwWR6gh.js} +1 -1
- package/dist/{chunk-F27PBJKO-DHmYWZXr.js → chunk-F27PBJKO-DMI1PBe4.js} +1 -1
- package/dist/{chunk-GMAD6QVW-Czynz8aA.js → chunk-GMAD6QVW-vStrMz2P.js} +3 -3
- package/dist/{chunk-GVQU2GXP-yQEdulRS.js → chunk-GVQU2GXP-2HwWgs4u.js} +2 -2
- package/dist/{chunk-IMKFNOWR-BfwTebD0.js → chunk-IMKFNOWR-UOVZuZVn.js} +5 -5
- package/dist/{chunk-L3NEJ4N5-DwRWnDDK.js → chunk-L3NEJ4N5-RhC7i0I2.js} +5 -5
- package/dist/{chunk-OSK3NFVY-BBKU_Ign.js → chunk-OSK3NFVY-CZV09N-U.js} +6 -6
- package/dist/{chunk-P2QGCYS3-C0iGU29N.js → chunk-P2QGCYS3-0TAWai9C.js} +1 -1
- package/dist/{chunk-POPQ4Y6H-BCbS3Ozc.js → chunk-POPQ4Y6H-Cc3_56GX.js} +1 -1
- package/dist/{chunk-PWAF6VOD-CTFCL0jI.js → chunk-PWAF6VOD-lNxB9k8z.js} +1 -1
- package/dist/{chunk-SHT3W25Y-BspJEJ5H.js → chunk-SHT3W25Y-CrEPyWy1.js} +7 -7
- package/dist/{chunk-SVP7TREG-DX3rFNTe.js → chunk-SVP7TREG-uIyyySp6.js} +2 -2
- package/dist/{chunk-TICWLB2K-fVF7Uujg.js → chunk-TICWLB2K-DdXM3eg6.js} +5 -5
- package/dist/classDiagram-ZZMXUADV-BiATbBE4.js +30 -0
- package/dist/classDiagram-v2-VYDZK3BY-JnH97GYw.js +30 -0
- package/dist/{code-visibility-CgZS2a3W.js → code-visibility-XU9RAJNV.js} +2 -2
- package/dist/{common-DnMDPPaW.js → common-C0fbrgB8.js} +13 -13
- package/dist/{cynefinDiagram-5FMLGOSQ-CFQrqzSX.js → cynefinDiagram-5FMLGOSQ-zknaAsGy.js} +3 -3
- package/dist/{dagre-GXQ25YYZ-xHNAUTyG.js → dagre-GXQ25YYZ-BhMOoMGJ.js} +10 -10
- package/dist/{data-grid-overlay-editor-hHYgD_Sm.js → data-grid-overlay-editor-BnhbJgoq.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-Bt1rPbAx.js → diagram-S7CK7UJ4-V5-Z-EDY.js} +4 -4
- package/dist/{diagram-UQ7AKVKN-D1sq5FoZ.js → diagram-UQ7AKVKN-qw8AjDal.js} +3 -3
- package/dist/{diagram-VSXAHHWV-BKpmG23x.js → diagram-VSXAHHWV-CR7BJygZ.js} +2 -2
- package/dist/{diagram-VX7I27RA-BMwGFVD6.js → diagram-VX7I27RA-DfuqFb1E.js} +5 -5
- package/dist/{diagram-Z3DM3KII--KLDR9Pl.js → diagram-Z3DM3KII-DpWwlYZB.js} +3 -3
- package/dist/{dist-BaHjhkpZ.js → dist-CcyKTBTF.js} +1 -1
- package/dist/{ebnfDiagram-PWID7BFC-WnG4cvSQ.js → ebnfDiagram-PWID7BFC-C20OnNMZ.js} +3 -3
- package/dist/{erDiagram-RLTQ6QDP-DhzKiYHc.js → erDiagram-RLTQ6QDP-DBXLWO9v.js} +12 -12
- package/dist/{error-entries-Bkbpx0T0.js → error-entries-DLl0XqoW.js} +1 -1
- package/dist/{feedback-button-CvKssdG_.js → feedback-button-B0QSkbSp.js} +4 -4
- package/dist/flowDiagram-HODETNUW-DL52nMkt.js +16 -0
- package/dist/{formats-C8rLgZT9.js → formats-Cl_67ghI.js} +1 -1
- package/dist/{ganttDiagram-EL5Y4UJY-DbzEBLbl.js → ganttDiagram-EL5Y4UJY-cRRaDt88.js} +2 -2
- package/dist/{gitGraphDiagram-WWUBYQGX-BMf0iKi1.js → gitGraphDiagram-WWUBYQGX-Pox5k9-Y.js} +2 -2
- package/dist/{glide-data-editor-Ohetlgag.js → glide-data-editor-ymIQdwrb.js} +3 -3
- package/dist/{globals-CPNNcOJI.js → globals-B0S3-e_D.js} +1 -1
- package/dist/{html-to-image-BAgJOlSW.js → html-to-image-CGVgroef.js} +2 -2
- package/dist/{infoDiagram-27XIBGKW-BagtCX_5.js → infoDiagram-27XIBGKW-ntpxMfrq.js} +2 -2
- package/dist/{ishikawaDiagram-5VMMS53U-DByDehYy.js → ishikawaDiagram-5VMMS53U-BllIlHE5.js} +3 -3
- package/dist/{journeyDiagram-3NMN7TZE-D2LcKDUO.js → journeyDiagram-3NMN7TZE-EPJDPlt0.js} +2 -2
- package/dist/{kanban-definition-UXKFOSKX-BxwkbBI_.js → kanban-definition-UXKFOSKX-GYtNMjtS.js} +9 -9
- package/dist/{katex-C6D4cX_N.js → katex-BNCmKUol.js} +983 -1120
- package/dist/{loader-D2W4oM-3.js → loader-DEZSzvma.js} +253 -248
- package/dist/main.js +72 -69
- package/dist/{mermaid-DPNuhemn.js → mermaid-Dnzoxjt1.js} +49 -49
- package/dist/{mhchem-DWCF06w9.js → mhchem-BEc7A1or.js} +1 -1
- package/dist/{mindmap-definition-YA3MSWOX-Cgvojw3y.js → mindmap-definition-YA3MSWOX-Cth76xgH.js} +11 -11
- package/dist/{number-overlay-editor-CHWg5gGO.js → number-overlay-editor-DB3HJDI1.js} +1 -1
- package/dist/{pegDiagram-XKGWAZYB-DahHhYyN.js → pegDiagram-XKGWAZYB-Cu4uOXii.js} +3 -3
- package/dist/{pieDiagram-E7YTZNPT-CCtX0oCK.js → pieDiagram-E7YTZNPT-Bh3eDa9s.js} +3 -3
- package/dist/{process-output-zDX4jbhd.js → process-output-CGfg-JmZ.js} +2 -2
- package/dist/{quadrantDiagram-AXDQQJYC-DftINo6g.js → quadrantDiagram-AXDQQJYC--kqzFC3w.js} +1 -1
- package/dist/{railroadDiagram-O6MQD6OU-Du5NsPUb.js → railroadDiagram-O6MQD6OU-DG-M6Rnc.js} +3 -3
- package/dist/{react-vega-5AcMW8gG.js → react-vega-ewj7q_U5.js} +1 -1
- package/dist/{requirementDiagram-BXWQKSXE-0pmmxL6_.js → requirementDiagram-BXWQKSXE-DCwsThh0.js} +11 -11
- package/dist/{reveal-component-BujcZI2B.js → reveal-component-CfTzIkA2.js} +3 -3
- package/dist/{sankeyDiagram-P5KCCOFB-CDKR5TJH.js → sankeyDiagram-P5KCCOFB-BdzhT0BM.js} +1 -1
- package/dist/{sequenceDiagram-WJ2MYXX4-DB-ChWwU.js → sequenceDiagram-WJ2MYXX4-CbXB1_PU.js} +4 -4
- package/dist/{stateDiagram-D77RDMKH-orN6AwMx.js → stateDiagram-D77RDMKH-A-Zf3Sb2.js} +13 -13
- package/dist/stateDiagram-v2-MP3YSRHH-D9YMnUGx.js +30 -0
- package/dist/style.css +1 -1
- package/dist/{swimlanes-42K2YHIH-BkSDcqDT.js → swimlanes-42K2YHIH-B_pMf0J4.js} +10 -10
- package/dist/swimlanesDiagram-VR7AAH4N-Ctgy-yGP.js +30 -0
- package/dist/{timeline-definition-24CTP7MA-BuqJUIRZ.js → timeline-definition-24CTP7MA-DTXFjTTM.js} +3 -3
- package/dist/{vega-component-CNf5gcrm.js → vega-component-tFOzgarw.js} +4 -4
- package/dist/{vega-embed-container-CbnTccZi.js → vega-embed-container-sSR5hAsy.js} +2 -2
- package/dist/{vega-loader.browser-D95WfUcj.js → vega-loader.browser-DNST6uVf.js} +2 -2
- package/dist/{vennDiagram-4TSXK5OY-CTUlJ2PK.js → vennDiagram-4TSXK5OY-BPHjZo0R.js} +3 -3
- package/dist/{wardleyDiagram-VM6X3IG4-3evLUb0M.js → wardleyDiagram-VM6X3IG4-6fTLYBuD.js} +3 -3
- package/dist/{xychartDiagram-S5SC5T6Z-DL2E3K8-.js → xychartDiagram-S5SC5T6Z-BYjwjrzE.js} +5 -5
- package/package.json +1 -2
- package/src/__mocks__/common.ts +3 -3
- package/src/__tests__/CellStatus.test.tsx +1 -1
- package/src/__tests__/setup.ts +7 -7
- package/src/components/app-config/ai-config.tsx +2 -0
- package/src/components/app-config/optional-features.tsx +1 -1
- package/src/components/chat/chat-panel.tsx +19 -8
- package/src/components/data-table/charts/__tests__/chart-panel.test.tsx +286 -0
- package/src/components/data-table/charts/charts.tsx +26 -13
- package/src/components/data-table/column-summary/chart-spec-model.tsx +4 -4
- package/src/components/dependency-graph/elements.ts +2 -2
- package/src/components/editor/__tests__/package-alert.test.tsx +140 -0
- package/src/components/editor/actions/__tests__/pair-with-agent.test.tsx +107 -0
- package/src/components/editor/actions/pair-with-agent.tsx +119 -0
- package/src/components/editor/actions/useNotebookActions.tsx +2 -1
- package/src/components/editor/ai/add-cell-with-ai.tsx +2 -0
- package/src/components/editor/ai/staged-cell-submission.ts +2 -2
- package/src/components/editor/ai/transport/chat-transport.tsx +1 -1
- package/src/components/editor/chrome/components/contribute-snippet-button.tsx +6 -1
- package/src/components/editor/connections/database/as-code.ts +44 -44
- package/src/components/editor/connections/storage/as-code.ts +3 -3
- package/src/components/editor/file-tree/requesting-tree.tsx +16 -13
- package/src/components/editor/navigation/clipboard.ts +2 -2
- package/src/components/editor/notebook-cell.tsx +2 -2
- package/src/components/editor/output/MarimoTracebackOutput.tsx +1 -1
- package/src/components/editor/output/VideoOutput.tsx +1 -1
- package/src/components/editor/output/ansi-reduce.ts +21 -17
- package/src/components/editor/output/console/ConsoleOutput.tsx +3 -3
- package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +59 -0
- package/src/components/editor/output/console/text-rendering.tsx +3 -1
- package/src/components/editor/package-alert.tsx +20 -7
- package/src/components/home/components.tsx +1 -0
- package/src/components/pages/run-page.tsx +1 -0
- package/src/components/slides/__tests__/minimap-actions.test.tsx +7 -7
- package/src/components/slides/__tests__/minimap.test.ts +12 -12
- package/src/components/slides/__tests__/slide-scroll-hint.test.tsx +8 -8
- package/src/components/static-html/share-modal.tsx +2 -1
- package/src/components/static-html/static-banner.tsx +2 -2
- package/src/components/ui/links.tsx +6 -1
- package/src/components/ui/typography.tsx +16 -8
- package/src/core/ai/context/__tests__/registry.test.ts +31 -28
- package/src/core/ai/context/providers/cell-output.ts +8 -8
- package/src/core/ai/context/providers/datasource.ts +10 -7
- package/src/core/ai/context/providers/error.ts +7 -7
- package/src/core/ai/context/providers/file.ts +8 -8
- package/src/core/ai/context/providers/tables.ts +7 -7
- package/src/core/ai/context/providers/variable.ts +7 -7
- package/src/core/ai/context/registry.ts +18 -18
- package/src/core/ai/ids/ids.ts +5 -5
- package/src/core/ai/model-registry.ts +12 -9
- package/src/core/ai/staged-cells.ts +6 -6
- package/src/core/ai/tools/base.ts +6 -6
- package/src/core/ai/tools/edit-notebook-tool.ts +6 -6
- package/src/core/ai/tools/registry.ts +4 -4
- package/src/core/ai/tools/run-cells-tool.ts +7 -7
- package/src/core/ai/tools/sample-tool.ts +6 -6
- package/src/core/cells/__tests__/cells.test.ts +27 -0
- package/src/core/cells/cells.ts +2 -1
- package/src/core/codemirror/cells/debugger-decorations.ts +13 -7
- package/src/core/codemirror/cells/line-timing-decorations.ts +9 -9
- package/src/core/codemirror/cells/traceback-decorations.ts +7 -4
- package/src/core/codemirror/code-lens/extension.ts +13 -13
- package/src/core/codemirror/copilot/__tests__/language-server.test.ts +6 -6
- package/src/core/codemirror/copilot/__tests__/transport.test.ts +12 -12
- package/src/core/codemirror/copilot/language-server.ts +13 -13
- package/src/core/codemirror/copilot/transport.ts +1 -1
- package/src/core/codemirror/find-replace/search-highlight.ts +5 -5
- package/src/core/codemirror/go-to-definition/underline.ts +3 -3
- package/src/core/codemirror/keymaps/vim.ts +3 -3
- package/src/core/codemirror/language/languages/markdown.ts +8 -8
- package/src/core/codemirror/language/languages/python.ts +7 -7
- package/src/core/codemirror/language/languages/sql/completion-builder.ts +5 -5
- package/src/core/codemirror/language/languages/sql/completion-store.ts +4 -4
- package/src/core/codemirror/language/languages/sql/sql.ts +21 -21
- package/src/core/codemirror/lsp/__tests__/transports.test.ts +10 -10
- package/src/core/codemirror/lsp/federated-lsp.ts +29 -27
- package/src/core/codemirror/lsp/notebook-lsp.ts +21 -21
- package/src/core/codemirror/misc/__tests__/dnd.test.ts +10 -10
- package/src/core/codemirror/misc/__tests__/paste.test.ts +7 -4
- package/src/core/codemirror/reactive-references/extension.ts +3 -3
- package/src/core/codemirror/rtc/loro/awareness.ts +12 -12
- package/src/core/codemirror/rtc/loro/sync.ts +5 -5
- package/src/core/codemirror/vim/cursor-visibility.ts +3 -3
- package/src/core/dom/ui-element.ts +5 -5
- package/src/core/dom/uiregistry.ts +10 -10
- package/src/core/hotkeys/hotkeys.ts +9 -9
- package/src/core/islands/__tests__/bridge.test.ts +4 -4
- package/src/core/islands/__tests__/test-utils.tsx +4 -4
- package/src/core/islands/bridge.ts +85 -82
- package/src/core/islands/components/web-components.tsx +7 -7
- package/src/core/islands/worker/__tests__/controller.test.ts +1 -1
- package/src/core/islands/worker/controller.ts +6 -3
- package/src/core/islands/worker-factory.ts +2 -2
- package/src/core/kernel/RuntimeState.ts +4 -4
- package/src/core/lsp/__tests__/transport.test.ts +19 -19
- package/src/core/lsp/transport.ts +5 -5
- package/src/core/network/CachingRequestRegistry.ts +2 -2
- package/src/core/network/DeferredRequestRegistry.ts +4 -4
- package/src/core/runtime/runtime.ts +25 -20
- package/src/core/static/virtual-file-tracker.ts +5 -5
- package/src/core/wasm/__tests__/bridge.test.ts +2 -2
- package/src/core/wasm/bridge.ts +130 -126
- package/src/core/wasm/router.ts +5 -5
- package/src/core/wasm/store.ts +4 -4
- package/src/core/wasm/worker/bootstrap.ts +8 -5
- package/src/core/wasm/worker/message-buffer.ts +3 -3
- package/src/core/websocket/transports/__tests__/ws.test.ts +8 -8
- package/src/core/websocket/transports/basic.ts +15 -8
- package/src/core/websocket/transports/sse.ts +7 -7
- package/src/core/websocket/transports/transport.ts +3 -3
- package/src/core/websocket/transports/ws.ts +9 -7
- package/src/css/globals.css +18 -21
- package/src/css/katex.min.css +260 -241
- package/src/hooks/__tests__/useOverflowDetection.test.tsx +5 -5
- package/src/hooks/__tests__/useResizeObserver.test.tsx +12 -12
- package/src/plugins/core/registerReactComponent.tsx +5 -5
- package/src/plugins/core/sidebar-element.tsx +2 -2
- package/src/plugins/impl/ButtonPlugin.tsx +3 -3
- package/src/plugins/impl/CheckboxPlugin.tsx +3 -3
- package/src/plugins/impl/CodeEditorPlugin.tsx +3 -3
- package/src/plugins/impl/DatePickerPlugin.tsx +3 -3
- package/src/plugins/impl/DateRangePlugin.tsx +3 -3
- package/src/plugins/impl/DateTimePickerPlugin.tsx +3 -3
- package/src/plugins/impl/DictPlugin.tsx +3 -3
- package/src/plugins/impl/DropdownPlugin.tsx +3 -3
- package/src/plugins/impl/FileUploadPlugin.tsx +3 -3
- package/src/plugins/impl/MatrixPlugin.tsx +4 -4
- package/src/plugins/impl/MicrophonePlugin.tsx +3 -3
- package/src/plugins/impl/MultiselectPlugin.tsx +3 -3
- package/src/plugins/impl/NumberPlugin.tsx +3 -3
- package/src/plugins/impl/RadioPlugin.tsx +9 -5
- package/src/plugins/impl/RangeSliderPlugin.tsx +3 -3
- package/src/plugins/impl/RefreshPlugin.tsx +3 -3
- package/src/plugins/impl/SliderPlugin.tsx +3 -3
- package/src/plugins/impl/SwitchPlugin.tsx +3 -3
- package/src/plugins/impl/TabsPlugin.tsx +3 -3
- package/src/plugins/impl/TextAreaPlugin.tsx +3 -3
- package/src/plugins/impl/TextInputPlugin.tsx +3 -3
- package/src/plugins/impl/__tests__/MatrixPlugin.test.tsx +2 -2
- package/src/plugins/impl/anywidget/model.ts +10 -10
- package/src/plugins/impl/anywidget/registry.ts +12 -9
- package/src/plugins/impl/anywidget/runtime.ts +11 -9
- package/src/plugins/impl/anywidget/widget-binding.ts +6 -6
- package/src/plugins/impl/image-comparison/ImageComparisonComponent.tsx +7 -6
- package/src/plugins/impl/matplotlib/MatplotlibPlugin.tsx +3 -3
- package/src/plugins/impl/matplotlib/__tests__/matplotlib-renderer.test.ts +2 -2
- package/src/plugins/impl/matplotlib/matplotlib-renderer.ts +2 -2
- package/src/plugins/impl/mpl-interactive/mpl-websocket-shim.ts +10 -10
- package/src/plugins/impl/panel/utils.ts +5 -5
- package/src/plugins/impl/plotly/PlotlyPlugin.tsx +3 -3
- package/src/plugins/impl/vega/VegaPlugin.tsx +3 -3
- package/src/plugins/impl/vega/__tests__/use-vega-container-remeasure.test.ts +7 -7
- package/src/plugins/impl/vega/__tests__/utils.test.ts +16 -1
- package/src/plugins/impl/vega/__tests__/vega.test.ts +37 -0
- package/src/plugins/impl/vega/loader.ts +23 -1
- package/src/plugins/impl/vega/utils.ts +5 -4
- package/src/plugins/layout/AccordionPlugin.tsx +3 -3
- package/src/plugins/layout/CalloutPlugin.tsx +3 -3
- package/src/plugins/layout/ImageComparisonPlugin.tsx +5 -3
- package/src/plugins/layout/JsonOutputPlugin.tsx +3 -3
- package/src/plugins/layout/MimeRenderPlugin.tsx +3 -3
- package/src/plugins/layout/NavigationMenuPlugin.tsx +3 -3
- package/src/plugins/layout/OutlinePlugin.tsx +3 -3
- package/src/plugins/layout/ProgressPlugin.tsx +3 -3
- package/src/plugins/layout/RoutesPlugin.tsx +6 -8
- package/src/plugins/layout/StatPlugin.tsx +3 -3
- package/src/plugins/layout/TexPlugin.tsx +3 -3
- package/src/plugins/layout/carousel/CarouselPlugin.tsx +4 -4
- package/src/plugins/layout/mermaid/MermaidPlugin.tsx +3 -3
- package/src/utils/Deferred.ts +6 -6
- package/src/utils/async-capture-tracker.ts +10 -7
- package/src/utils/errors.ts +5 -5
- package/src/utils/id-tree.tsx +83 -80
- package/src/utils/lru.ts +1 -1
- package/src/utils/multi-map.ts +14 -12
- package/src/utils/paths.ts +6 -6
- package/src/utils/pluralize.ts +3 -3
- package/src/utils/progress.ts +6 -6
- package/src/utils/python-poet/poet.ts +14 -14
- package/src/utils/routes.ts +4 -2
- package/src/utils/semaphore.ts +6 -6
- package/src/utils/storage/storage.ts +6 -6
- package/src/utils/storage/typed.ts +16 -12
- package/src/utils/time.ts +9 -9
- package/src/utils/timed-cache.ts +4 -4
- package/src/utils/tracer.ts +9 -6
- package/dist/classDiagram-ZZMXUADV-Fe-V14Sc.js +0 -30
- package/dist/classDiagram-v2-VYDZK3BY-xTDg7lOs.js +0 -30
- package/dist/flowDiagram-HODETNUW-6dMdB8pR.js +0 -16
- package/dist/katex-DFBiSucW.js +0 -21840
- package/dist/stateDiagram-v2-MP3YSRHH-o05_rJN8.js +0 -30
- package/dist/swimlanesDiagram-VR7AAH4N-D_nFQfRc.js +0 -30
|
@@ -45,21 +45,22 @@ function toArray<T>(value: T | T[] | undefined): T[] {
|
|
|
45
45
|
|
|
46
46
|
export function getVegaFieldTypes(
|
|
47
47
|
types: Record<string, DataType> | undefined | null,
|
|
48
|
+
{ parseDates = false }: { parseDates?: boolean } = {},
|
|
48
49
|
): FieldTypes | "auto" {
|
|
49
50
|
if (!types || Object.keys(types).length === 0) {
|
|
50
51
|
// If fieldTypes is provided, use it to parse the data
|
|
51
52
|
// Otherwise, infer the data types
|
|
52
53
|
return "auto";
|
|
53
54
|
}
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
55
|
+
// Preserve date-only strings for callers such as the data editor.
|
|
56
|
+
// Parsing creates Date objects that JSON serializes as full timestamps.
|
|
57
|
+
// Charts opt into date parsing for temporal axes.
|
|
57
58
|
return Objects.mapValues(types, (type): VegaDataType => {
|
|
58
59
|
if (type === "geometry") {
|
|
59
60
|
return "string";
|
|
60
61
|
}
|
|
61
62
|
if (type === "date") {
|
|
62
|
-
return "string";
|
|
63
|
+
return parseDates ? "date" : "string";
|
|
63
64
|
}
|
|
64
65
|
if (type === "time") {
|
|
65
66
|
return "string";
|
|
@@ -27,15 +27,15 @@ interface Data {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export class AccordionPlugin implements IStatelessPlugin<Data> {
|
|
30
|
-
tagName = "marimo-accordion";
|
|
30
|
+
public tagName = "marimo-accordion";
|
|
31
31
|
|
|
32
|
-
validator = z.object({
|
|
32
|
+
public validator = z.object({
|
|
33
33
|
labels: z.array(z.string()),
|
|
34
34
|
multiple: z.boolean(),
|
|
35
35
|
expanded: z.array(z.string()).default([]),
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
render(props: IStatelessPluginProps<Data>): JSX.Element {
|
|
38
|
+
public render(props: IStatelessPluginProps<Data>): JSX.Element {
|
|
39
39
|
return (
|
|
40
40
|
<AccordionComponent {...props.data}>{props.children}</AccordionComponent>
|
|
41
41
|
);
|
|
@@ -25,15 +25,15 @@ interface Data {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export class CalloutPlugin implements IStatelessPlugin<Data> {
|
|
28
|
-
tagName = "marimo-callout-output";
|
|
28
|
+
public tagName = "marimo-callout-output";
|
|
29
29
|
|
|
30
|
-
validator = z.object({
|
|
30
|
+
public validator = z.object({
|
|
31
31
|
html: z.string(),
|
|
32
32
|
kind: zodIntent,
|
|
33
33
|
title: z.string().optional(),
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
render({ data }: IStatelessPluginProps<Data>): JSX.Element {
|
|
36
|
+
public render({ data }: IStatelessPluginProps<Data>): JSX.Element {
|
|
37
37
|
return (
|
|
38
38
|
<CalloutOutput html={data.html} kind={data.kind} title={data.title} />
|
|
39
39
|
);
|
|
@@ -12,9 +12,9 @@ const LazyImageComparisonComponent = React.lazy(
|
|
|
12
12
|
);
|
|
13
13
|
|
|
14
14
|
export class ImageComparisonPlugin implements IStatelessPlugin<ImageComparisonData> {
|
|
15
|
-
tagName = "marimo-image-comparison";
|
|
15
|
+
public tagName = "marimo-image-comparison";
|
|
16
16
|
|
|
17
|
-
validator = z.object({
|
|
17
|
+
public validator = z.object({
|
|
18
18
|
beforeSrc: z.string(),
|
|
19
19
|
afterSrc: z.string(),
|
|
20
20
|
value: z.number().min(0).max(100).default(50),
|
|
@@ -23,7 +23,9 @@ export class ImageComparisonPlugin implements IStatelessPlugin<ImageComparisonDa
|
|
|
23
23
|
height: z.string().optional(),
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
render(
|
|
26
|
+
public render(
|
|
27
|
+
props: IStatelessPluginProps<ImageComparisonData>,
|
|
28
|
+
): JSX.Element {
|
|
27
29
|
return (
|
|
28
30
|
<React.Suspense fallback={<div>Loading image comparison...</div>}>
|
|
29
31
|
<LazyImageComparisonComponent {...props.data} />
|
|
@@ -21,15 +21,15 @@ interface Data {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export class JsonOutputPlugin implements IStatelessPlugin<Data> {
|
|
24
|
-
tagName = "marimo-json-output";
|
|
24
|
+
public tagName = "marimo-json-output";
|
|
25
25
|
|
|
26
|
-
validator = z.object({
|
|
26
|
+
public validator = z.object({
|
|
27
27
|
name: z.string().nullish(),
|
|
28
28
|
jsonData: z.unknown(),
|
|
29
29
|
valueTypes: z.enum(["json", "python"]).default("python"),
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
render({ data }: IStatelessPluginProps<Data>): JSX.Element {
|
|
32
|
+
public render({ data }: IStatelessPluginProps<Data>): JSX.Element {
|
|
33
33
|
// `false` defaults to no text label
|
|
34
34
|
const name = data.name === undefined ? false : data.name || "";
|
|
35
35
|
return (
|
|
@@ -15,9 +15,9 @@ interface Data {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export class MimeRendererPlugin implements IStatelessPlugin<Data> {
|
|
18
|
-
tagName = "marimo-mime-renderer";
|
|
18
|
+
public tagName = "marimo-mime-renderer";
|
|
19
19
|
|
|
20
|
-
validator = z.object({
|
|
20
|
+
public validator = z.object({
|
|
21
21
|
mime: z.string().transform((val) => val as OutputMessage["mimetype"]),
|
|
22
22
|
data: z
|
|
23
23
|
.union([
|
|
@@ -29,7 +29,7 @@ export class MimeRendererPlugin implements IStatelessPlugin<Data> {
|
|
|
29
29
|
.transform((val) => val as OutputMessage["data"]),
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
render({ data }: IStatelessPluginProps<Data>): JSX.Element {
|
|
32
|
+
public render({ data }: IStatelessPluginProps<Data>): JSX.Element {
|
|
33
33
|
if (!data.data) {
|
|
34
34
|
return <div />;
|
|
35
35
|
}
|
|
@@ -195,7 +195,7 @@ const NavigationMenuViewportPortal = ({
|
|
|
195
195
|
};
|
|
196
196
|
|
|
197
197
|
export class NavigationMenuPlugin implements IStatelessPlugin<Data> {
|
|
198
|
-
tagName = "marimo-nav-menu";
|
|
198
|
+
public tagName = "marimo-nav-menu";
|
|
199
199
|
|
|
200
200
|
private menuItemValidator = z.object({
|
|
201
201
|
label: z.string(),
|
|
@@ -208,14 +208,14 @@ export class NavigationMenuPlugin implements IStatelessPlugin<Data> {
|
|
|
208
208
|
items: z.array(this.menuItemValidator),
|
|
209
209
|
});
|
|
210
210
|
|
|
211
|
-
validator = z.object({
|
|
211
|
+
public validator = z.object({
|
|
212
212
|
items: z.array(
|
|
213
213
|
z.union([this.menuItemValidator, this.menuItemGroupValidator]),
|
|
214
214
|
),
|
|
215
215
|
orientation: z.enum(["horizontal", "vertical"]),
|
|
216
216
|
});
|
|
217
217
|
|
|
218
|
-
render(props: IStatelessPluginProps<Data>): JSX.Element {
|
|
218
|
+
public render(props: IStatelessPluginProps<Data>): JSX.Element {
|
|
219
219
|
return <NavMenuComponent {...props.data} />;
|
|
220
220
|
}
|
|
221
221
|
}
|
|
@@ -51,13 +51,13 @@ const OutlineContent: React.FC<{ label?: string }> = ({ label }) => {
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
export class OutlinePlugin implements IStatelessPlugin<Data> {
|
|
54
|
-
tagName = "marimo-outline";
|
|
54
|
+
public tagName = "marimo-outline";
|
|
55
55
|
|
|
56
|
-
validator = z.object({
|
|
56
|
+
public validator = z.object({
|
|
57
57
|
label: z.string().optional(),
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
render(props: IStatelessPluginProps<Data>): JSX.Element {
|
|
60
|
+
public render(props: IStatelessPluginProps<Data>): JSX.Element {
|
|
61
61
|
const { label } = props.data;
|
|
62
62
|
|
|
63
63
|
return (
|
|
@@ -41,9 +41,9 @@ interface Data {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export class ProgressPlugin implements IStatelessPlugin<Data> {
|
|
44
|
-
tagName = "marimo-progress";
|
|
44
|
+
public tagName = "marimo-progress";
|
|
45
45
|
|
|
46
|
-
validator = z.object({
|
|
46
|
+
public validator = z.object({
|
|
47
47
|
title: z.string().optional(),
|
|
48
48
|
subtitle: z.string().optional(),
|
|
49
49
|
progress: z.union([z.number(), z.boolean()]),
|
|
@@ -52,7 +52,7 @@ export class ProgressPlugin implements IStatelessPlugin<Data> {
|
|
|
52
52
|
rate: z.number().optional(),
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
render(props: IStatelessPluginProps<Data>): JSX.Element {
|
|
55
|
+
public render(props: IStatelessPluginProps<Data>): JSX.Element {
|
|
56
56
|
return <ProgressComponent {...props.data} />;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
import React, {
|
|
3
|
-
type JSX,
|
|
4
3
|
type PropsWithChildren,
|
|
5
4
|
useEffect,
|
|
6
5
|
useMemo,
|
|
@@ -22,13 +21,13 @@ interface Data {
|
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
export class RoutesPlugin implements IStatelessPlugin<Data> {
|
|
25
|
-
tagName = "marimo-routes";
|
|
24
|
+
public tagName = "marimo-routes";
|
|
26
25
|
|
|
27
|
-
validator = z.object({
|
|
26
|
+
public validator = z.object({
|
|
28
27
|
routes: z.array(z.string()),
|
|
29
28
|
});
|
|
30
29
|
|
|
31
|
-
render(props: IStatelessPluginProps<Data>):
|
|
30
|
+
public render(props: IStatelessPluginProps<Data>): React.ReactElement {
|
|
32
31
|
return <RoutesComponent {...props.data}>{props.children}</RoutesComponent>;
|
|
33
32
|
}
|
|
34
33
|
}
|
|
@@ -36,7 +35,7 @@ export class RoutesPlugin implements IStatelessPlugin<Data> {
|
|
|
36
35
|
const RoutesComponent = ({
|
|
37
36
|
routes,
|
|
38
37
|
children,
|
|
39
|
-
}: PropsWithChildren<Data>):
|
|
38
|
+
}: PropsWithChildren<Data>): React.ReactNode => {
|
|
40
39
|
const childCount = React.Children.count(children);
|
|
41
40
|
if (childCount !== routes.length) {
|
|
42
41
|
throw new Error(
|
|
@@ -69,12 +68,11 @@ const RoutesComponent = ({
|
|
|
69
68
|
}, [handleFindMatch]);
|
|
70
69
|
|
|
71
70
|
if (!matched) {
|
|
72
|
-
|
|
73
|
-
return <></>;
|
|
71
|
+
return null;
|
|
74
72
|
}
|
|
75
73
|
|
|
76
74
|
const matchedIndex = routes.indexOf(matched);
|
|
77
75
|
const child = React.Children.toArray(children)[matchedIndex];
|
|
78
76
|
|
|
79
|
-
return
|
|
77
|
+
return child;
|
|
80
78
|
};
|
|
@@ -25,9 +25,9 @@ interface Data {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export class StatPlugin implements IStatelessPlugin<Data> {
|
|
28
|
-
tagName = "marimo-stat";
|
|
28
|
+
public tagName = "marimo-stat";
|
|
29
29
|
|
|
30
|
-
validator = z.object({
|
|
30
|
+
public validator = z.object({
|
|
31
31
|
value: z.union([z.string(), z.number(), z.boolean()]).optional(),
|
|
32
32
|
label: z.string().optional(),
|
|
33
33
|
caption: z.string().optional(),
|
|
@@ -37,7 +37,7 @@ export class StatPlugin implements IStatelessPlugin<Data> {
|
|
|
37
37
|
slot: z.any().optional(),
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
render({ data }: IStatelessPluginProps<Data>): JSX.Element {
|
|
40
|
+
public render({ data }: IStatelessPluginProps<Data>): JSX.Element {
|
|
41
41
|
return <StatComponent {...data} />;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -15,11 +15,11 @@ import type {
|
|
|
15
15
|
* LaTeX.
|
|
16
16
|
*/
|
|
17
17
|
export class TexPlugin implements IStatelessPlugin<{}> {
|
|
18
|
-
tagName = "marimo-tex";
|
|
18
|
+
public tagName = "marimo-tex";
|
|
19
19
|
|
|
20
|
-
validator = z.object({});
|
|
20
|
+
public validator = z.object({});
|
|
21
21
|
|
|
22
|
-
render(props: IStatelessPluginProps<{}>): JSX.Element {
|
|
22
|
+
public render(props: IStatelessPluginProps<{}>): JSX.Element {
|
|
23
23
|
return (
|
|
24
24
|
<TexComponent
|
|
25
25
|
host={props.host}
|
|
@@ -20,15 +20,15 @@ interface Data {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export class CarouselPlugin implements IStatelessPlugin<Data> {
|
|
23
|
-
tagName = "marimo-carousel";
|
|
23
|
+
public tagName = "marimo-carousel";
|
|
24
24
|
|
|
25
|
-
validator = z.object({
|
|
25
|
+
public validator = z.object({
|
|
26
26
|
index: z.string().nullish(),
|
|
27
27
|
height: z.union([z.string(), z.number()]).nullish(),
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
// TODO: Move async when we support async css
|
|
31
|
-
cssStyles = [
|
|
31
|
+
public cssStyles = [
|
|
32
32
|
swiperCss,
|
|
33
33
|
swiperCssVirtual,
|
|
34
34
|
swiperCssNavigation,
|
|
@@ -38,7 +38,7 @@ export class CarouselPlugin implements IStatelessPlugin<Data> {
|
|
|
38
38
|
swiperSlidesCss,
|
|
39
39
|
];
|
|
40
40
|
|
|
41
|
-
render(props: IStatelessPluginProps<Data>): JSX.Element {
|
|
41
|
+
public render(props: IStatelessPluginProps<Data>): JSX.Element {
|
|
42
42
|
return (
|
|
43
43
|
<LazySlidesComponent {...props.data} wrapAround={true}>
|
|
44
44
|
{props.children}
|
|
@@ -14,15 +14,15 @@ interface Data {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export class MermaidPlugin implements IStatelessPlugin<Data> {
|
|
17
|
-
tagName = "marimo-mermaid";
|
|
17
|
+
public tagName = "marimo-mermaid";
|
|
18
18
|
|
|
19
|
-
validator = z.object({
|
|
19
|
+
public validator = z.object({
|
|
20
20
|
diagram: z.string(),
|
|
21
21
|
theme: z.string().optional(),
|
|
22
22
|
theme_variables: z.record(z.string(), z.string()).optional(),
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
render(props: IStatelessPluginProps<Data>): JSX.Element {
|
|
25
|
+
public render(props: IStatelessPluginProps<Data>): JSX.Element {
|
|
26
26
|
return (
|
|
27
27
|
<LazyMermaid
|
|
28
28
|
diagram={props.data.diagram}
|
package/src/utils/Deferred.ts
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
* cases where you need to check if a promise has settled without awaiting it.
|
|
8
8
|
*/
|
|
9
9
|
export class Deferred<T> {
|
|
10
|
-
promise: Promise<T>;
|
|
11
|
-
resolve!: (value: T | PromiseLike<T>) => void;
|
|
12
|
-
reject!: (reason?: unknown) => void;
|
|
13
|
-
status: "pending" | "resolved" | "rejected" = "pending";
|
|
14
|
-
value: T | undefined = undefined;
|
|
10
|
+
public promise: Promise<T>;
|
|
11
|
+
public resolve!: (value: T | PromiseLike<T>) => void;
|
|
12
|
+
public reject!: (reason?: unknown) => void;
|
|
13
|
+
public status: "pending" | "resolved" | "rejected" = "pending";
|
|
14
|
+
public value: T | undefined = undefined;
|
|
15
15
|
|
|
16
|
-
constructor() {
|
|
16
|
+
public constructor() {
|
|
17
17
|
this.promise = new Promise<T>((resolve, reject) => {
|
|
18
18
|
this.reject = (reason: unknown) => {
|
|
19
19
|
this.status = "rejected";
|
|
@@ -66,7 +66,7 @@ export class AsyncCaptureTracker<K, R = unknown> {
|
|
|
66
66
|
* - Captured with a different value
|
|
67
67
|
* - In-flight with a different value (will be aborted on {@link startCapture})
|
|
68
68
|
*/
|
|
69
|
-
needsCapture(key: K, inputValue: unknown): boolean {
|
|
69
|
+
public needsCapture(key: K, inputValue: unknown): boolean {
|
|
70
70
|
if (this.capturedInputs.get(key) === inputValue) {
|
|
71
71
|
return false;
|
|
72
72
|
}
|
|
@@ -82,7 +82,10 @@ export class AsyncCaptureTracker<K, R = unknown> {
|
|
|
82
82
|
* that resolves when the capture completes (with the result, or `undefined`
|
|
83
83
|
* on failure/abort). Returns `null` otherwise.
|
|
84
84
|
*/
|
|
85
|
-
waitForInFlight(
|
|
85
|
+
public waitForInFlight(
|
|
86
|
+
key: K,
|
|
87
|
+
inputValue: unknown,
|
|
88
|
+
): Promise<R | undefined> | null {
|
|
86
89
|
const flight = this.inFlight.get(key);
|
|
87
90
|
if (flight && flight.inputValue === inputValue) {
|
|
88
91
|
return flight.deferred.promise;
|
|
@@ -97,7 +100,7 @@ export class AsyncCaptureTracker<K, R = unknown> {
|
|
|
97
100
|
*
|
|
98
101
|
* @returns A {@link CaptureHandle} scoped to this attempt.
|
|
99
102
|
*/
|
|
100
|
-
startCapture(key: K, inputValue: unknown): CaptureHandle<R> {
|
|
103
|
+
public startCapture(key: K, inputValue: unknown): CaptureHandle<R> {
|
|
101
104
|
const prev = this.inFlight.get(key);
|
|
102
105
|
if (prev) {
|
|
103
106
|
this.cancelEntry(prev);
|
|
@@ -133,7 +136,7 @@ export class AsyncCaptureTracker<K, R = unknown> {
|
|
|
133
136
|
* Remove tracking for keys not in the given set.
|
|
134
137
|
* Aborts in-flight captures and resolves their waiters with `undefined`.
|
|
135
138
|
*/
|
|
136
|
-
prune(currentKeys: Set<K>): void {
|
|
139
|
+
public prune(currentKeys: Set<K>): void {
|
|
137
140
|
for (const key of this.capturedInputs.keys()) {
|
|
138
141
|
if (!currentKeys.has(key)) {
|
|
139
142
|
this.capturedInputs.delete(key);
|
|
@@ -148,12 +151,12 @@ export class AsyncCaptureTracker<K, R = unknown> {
|
|
|
148
151
|
}
|
|
149
152
|
|
|
150
153
|
/** Whether any captures are currently in-flight. */
|
|
151
|
-
get isCapturing(): boolean {
|
|
154
|
+
public get isCapturing(): boolean {
|
|
152
155
|
return this.inFlight.size > 0;
|
|
153
156
|
}
|
|
154
157
|
|
|
155
158
|
/** Abort all in-flight captures. Resolves all waiters with `undefined`. */
|
|
156
|
-
abort(): void {
|
|
159
|
+
public abort(): void {
|
|
157
160
|
for (const entry of this.inFlight.values()) {
|
|
158
161
|
this.cancelEntry(entry);
|
|
159
162
|
}
|
|
@@ -161,7 +164,7 @@ export class AsyncCaptureTracker<K, R = unknown> {
|
|
|
161
164
|
}
|
|
162
165
|
|
|
163
166
|
/** Reset all state. */
|
|
164
|
-
reset(): void {
|
|
167
|
+
public reset(): void {
|
|
165
168
|
this.abort();
|
|
166
169
|
this.capturedInputs.clear();
|
|
167
170
|
}
|
package/src/utils/errors.ts
CHANGED
|
@@ -68,9 +68,9 @@ function safeJSONParse(message: string): unknown {
|
|
|
68
68
|
* kept as `cause` so `prettyError` can surface its `detail`.
|
|
69
69
|
*/
|
|
70
70
|
export class HTTPError extends Error {
|
|
71
|
-
readonly status: number;
|
|
71
|
+
public readonly status: number;
|
|
72
72
|
|
|
73
|
-
constructor(status: number, statusText: string, body?: unknown) {
|
|
73
|
+
public constructor(status: number, statusText: string, body?: unknown) {
|
|
74
74
|
super(statusText, { cause: body });
|
|
75
75
|
this.name = "HTTPError";
|
|
76
76
|
this.status = status;
|
|
@@ -78,7 +78,7 @@ export class HTTPError extends Error {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
export class CellNotInitializedError extends Error {
|
|
81
|
-
constructor(
|
|
81
|
+
public constructor(
|
|
82
82
|
message = "The cell containing this UI element has not been run yet. Please run the cell first.",
|
|
83
83
|
) {
|
|
84
84
|
super(message);
|
|
@@ -87,7 +87,7 @@ export class CellNotInitializedError extends Error {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
export class FunctionNotFoundError extends Error {
|
|
90
|
-
constructor(
|
|
90
|
+
public constructor(
|
|
91
91
|
message = "This UI element could not reach its function on the kernel. Try re-running the cell.",
|
|
92
92
|
) {
|
|
93
93
|
super(message);
|
|
@@ -96,7 +96,7 @@ export class FunctionNotFoundError extends Error {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
export class NoKernelConnectedError extends Error {
|
|
99
|
-
constructor(message = "Not yet connected to a kernel.") {
|
|
99
|
+
public constructor(message = "Not yet connected to a kernel.") {
|
|
100
100
|
super(message);
|
|
101
101
|
this.name = "NoKernelConnectedError";
|
|
102
102
|
}
|