@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
|
@@ -10,23 +10,23 @@ const mockObserve = vi.fn();
|
|
|
10
10
|
const mockDisconnect = vi.fn();
|
|
11
11
|
|
|
12
12
|
global.ResizeObserver = class MockResizeObserver {
|
|
13
|
-
callback: ResizeObserverCallback;
|
|
13
|
+
public callback: ResizeObserverCallback;
|
|
14
14
|
|
|
15
|
-
constructor(callback: ResizeObserverCallback) {
|
|
15
|
+
public constructor(callback: ResizeObserverCallback) {
|
|
16
16
|
this.callback = callback;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
observe(target: Element) {
|
|
19
|
+
public observe(target: Element) {
|
|
20
20
|
mockObserve(target);
|
|
21
21
|
// Simulate initial observation callback
|
|
22
22
|
this.callback([], this);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
unobserve() {
|
|
25
|
+
public unobserve() {
|
|
26
26
|
// noop
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
disconnect() {
|
|
29
|
+
public disconnect() {
|
|
30
30
|
mockDisconnect();
|
|
31
31
|
}
|
|
32
32
|
};
|
|
@@ -16,9 +16,9 @@ describe("useResizeObserver", () => {
|
|
|
16
16
|
it("should call observe when ref is provided", () => {
|
|
17
17
|
const observeSpy = vi.fn();
|
|
18
18
|
global.ResizeObserver = class MockedResizeObserver {
|
|
19
|
-
observe = observeSpy;
|
|
20
|
-
unobserve = vi.fn();
|
|
21
|
-
disconnect = vi.fn();
|
|
19
|
+
public observe = observeSpy;
|
|
20
|
+
public unobserve = vi.fn();
|
|
21
|
+
public disconnect = vi.fn();
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
renderHook(() =>
|
|
@@ -33,9 +33,9 @@ describe("useResizeObserver", () => {
|
|
|
33
33
|
it("should not call observe when ref is not provided", () => {
|
|
34
34
|
const observeSpy = vi.fn();
|
|
35
35
|
global.ResizeObserver = class MockedResizeObserver {
|
|
36
|
-
observe = observeSpy;
|
|
37
|
-
unobserve = vi.fn();
|
|
38
|
-
disconnect = vi.fn();
|
|
36
|
+
public observe = observeSpy;
|
|
37
|
+
public unobserve = vi.fn();
|
|
38
|
+
public disconnect = vi.fn();
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
renderHook(() =>
|
|
@@ -50,9 +50,9 @@ describe("useResizeObserver", () => {
|
|
|
50
50
|
it("should not call observe when skipped", () => {
|
|
51
51
|
const observeSpy = vi.fn();
|
|
52
52
|
global.ResizeObserver = class MockedResizeObserver {
|
|
53
|
-
observe = observeSpy;
|
|
54
|
-
unobserve = vi.fn();
|
|
55
|
-
disconnect = vi.fn();
|
|
53
|
+
public observe = observeSpy;
|
|
54
|
+
public unobserve = vi.fn();
|
|
55
|
+
public disconnect = vi.fn();
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
renderHook(() =>
|
|
@@ -68,9 +68,9 @@ describe("useResizeObserver", () => {
|
|
|
68
68
|
it("disconnect should be called once unmounted", () => {
|
|
69
69
|
const disconnectSpy = vi.fn();
|
|
70
70
|
global.ResizeObserver = class MockedResizeObserver {
|
|
71
|
-
observe = vi.fn();
|
|
72
|
-
unobserve = vi.fn();
|
|
73
|
-
disconnect = disconnectSpy;
|
|
71
|
+
public observe = vi.fn();
|
|
72
|
+
public unobserve = vi.fn();
|
|
73
|
+
public disconnect = disconnectSpy;
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
const { unmount } = renderHook(() =>
|
|
@@ -336,7 +336,7 @@ export function registerReactComponent<T>(plugin: IPlugin<T, unknown>): void {
|
|
|
336
336
|
private pluginRef = createRef<PluginSlotHandle>();
|
|
337
337
|
protected __type__ = customElementLocator;
|
|
338
338
|
|
|
339
|
-
constructor() {
|
|
339
|
+
public constructor() {
|
|
340
340
|
super();
|
|
341
341
|
// Create a shadow root so we can store the React tree on the shadow root, while the original
|
|
342
342
|
// element's children are still on the DOM
|
|
@@ -349,7 +349,7 @@ export function registerReactComponent<T>(plugin: IPlugin<T, unknown>): void {
|
|
|
349
349
|
});
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
-
connectedCallback() {
|
|
352
|
+
public connectedCallback() {
|
|
353
353
|
// Skip mounting if this element is in the light DOM of another
|
|
354
354
|
// marimo custom element. The parent element's shadow DOM will
|
|
355
355
|
// re-create this element via getChildren() -> renderHTML(), so
|
|
@@ -383,7 +383,7 @@ export function registerReactComponent<T>(plugin: IPlugin<T, unknown>): void {
|
|
|
383
383
|
});
|
|
384
384
|
}
|
|
385
385
|
|
|
386
|
-
disconnectedCallback() {
|
|
386
|
+
public disconnectedCallback() {
|
|
387
387
|
this.observer.disconnect();
|
|
388
388
|
this.root?.unmount();
|
|
389
389
|
if (this.mounted) {
|
|
@@ -419,7 +419,7 @@ export function registerReactComponent<T>(plugin: IPlugin<T, unknown>): void {
|
|
|
419
419
|
* Reset the plugin initial value and data.
|
|
420
420
|
* And then re-render the plugin.
|
|
421
421
|
*/
|
|
422
|
-
reset() {
|
|
422
|
+
public reset() {
|
|
423
423
|
this.dispatchEvent(
|
|
424
424
|
createInputEvent(parseAttrValue(this.dataset.initialValue), this),
|
|
425
425
|
);
|
|
@@ -429,7 +429,7 @@ export function registerReactComponent<T>(plugin: IPlugin<T, unknown>): void {
|
|
|
429
429
|
/**
|
|
430
430
|
* Re-render the plugin.
|
|
431
431
|
*/
|
|
432
|
-
rerender() {
|
|
432
|
+
public rerender() {
|
|
433
433
|
this.pluginRef.current?.reset();
|
|
434
434
|
}
|
|
435
435
|
|
|
@@ -19,7 +19,7 @@ export function initializeSidebarElement(): void {
|
|
|
19
19
|
private observer?: MutationObserver;
|
|
20
20
|
private uniqueId = Symbol(createId());
|
|
21
21
|
|
|
22
|
-
connectedCallback() {
|
|
22
|
+
public connectedCallback() {
|
|
23
23
|
// Render the component for the first time
|
|
24
24
|
this.mountReactComponent();
|
|
25
25
|
|
|
@@ -39,7 +39,7 @@ export function initializeSidebarElement(): void {
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
disconnectedCallback() {
|
|
42
|
+
public disconnectedCallback() {
|
|
43
43
|
if (this.observer) {
|
|
44
44
|
this.observer.disconnect();
|
|
45
45
|
this.unmountReactComponent();
|
|
@@ -20,9 +20,9 @@ interface Data {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export class ButtonPlugin implements IPlugin<number, Data> {
|
|
23
|
-
tagName = "marimo-button";
|
|
23
|
+
public tagName = "marimo-button";
|
|
24
24
|
|
|
25
|
-
validator = z.object({
|
|
25
|
+
public validator = z.object({
|
|
26
26
|
label: z.string(),
|
|
27
27
|
kind: zodIntent,
|
|
28
28
|
disabled: z.boolean().default(false),
|
|
@@ -31,7 +31,7 @@ export class ButtonPlugin implements IPlugin<number, Data> {
|
|
|
31
31
|
keyboardShortcut: z.string().optional(),
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
render(props: IPluginProps<number, Data>): JSX.Element {
|
|
34
|
+
public render(props: IPluginProps<number, Data>): JSX.Element {
|
|
35
35
|
const {
|
|
36
36
|
data: { disabled, kind, label, fullWidth, tooltip, keyboardShortcut },
|
|
37
37
|
} = props;
|
|
@@ -18,15 +18,15 @@ interface Data {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export class CheckboxPlugin implements IPlugin<T, Data> {
|
|
21
|
-
tagName = "marimo-checkbox";
|
|
21
|
+
public tagName = "marimo-checkbox";
|
|
22
22
|
|
|
23
|
-
validator = z.object({
|
|
23
|
+
public validator = z.object({
|
|
24
24
|
initialValue: z.boolean(),
|
|
25
25
|
label: z.string().nullable(),
|
|
26
26
|
disabled: z.boolean().optional(),
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
render(props: IPluginProps<T, Data>): JSX.Element {
|
|
29
|
+
public render(props: IPluginProps<T, Data>): JSX.Element {
|
|
30
30
|
return <CheckboxComponent {...props} />;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -25,9 +25,9 @@ interface Data {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export class CodeEditorPlugin implements IPlugin<T, Data> {
|
|
28
|
-
tagName = "marimo-code-editor";
|
|
28
|
+
public tagName = "marimo-code-editor";
|
|
29
29
|
|
|
30
|
-
validator = z.object({
|
|
30
|
+
public validator = z.object({
|
|
31
31
|
initialValue: z.string(),
|
|
32
32
|
language: z.string().default("python"),
|
|
33
33
|
placeholder: z.string(),
|
|
@@ -40,7 +40,7 @@ export class CodeEditorPlugin implements IPlugin<T, Data> {
|
|
|
40
40
|
debounce: z.union([z.boolean(), z.number()]).default(false),
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
render(props: IPluginProps<T, Data>): JSX.Element {
|
|
43
|
+
public render(props: IPluginProps<T, Data>): JSX.Element {
|
|
44
44
|
return (
|
|
45
45
|
<CodeEditorComponent
|
|
46
46
|
{...props.data}
|
|
@@ -19,9 +19,9 @@ interface Data {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export class DatePickerPlugin implements IPlugin<T, Data> {
|
|
22
|
-
tagName = "marimo-date";
|
|
22
|
+
public tagName = "marimo-date";
|
|
23
23
|
|
|
24
|
-
validator = z.object({
|
|
24
|
+
public validator = z.object({
|
|
25
25
|
initialValue: z.string(),
|
|
26
26
|
label: z.string().nullable(),
|
|
27
27
|
start: z.string(),
|
|
@@ -31,7 +31,7 @@ export class DatePickerPlugin implements IPlugin<T, Data> {
|
|
|
31
31
|
disabled: z.boolean().optional(),
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
render(props: IPluginProps<T, Data>): JSX.Element {
|
|
34
|
+
public render(props: IPluginProps<T, Data>): JSX.Element {
|
|
35
35
|
return (
|
|
36
36
|
<DatePickerComponent
|
|
37
37
|
{...props.data}
|
|
@@ -19,9 +19,9 @@ interface Data {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export class DateRangePickerPlugin implements IPlugin<T, Data> {
|
|
22
|
-
tagName = "marimo-date-range";
|
|
22
|
+
public tagName = "marimo-date-range";
|
|
23
23
|
|
|
24
|
-
validator = z.object({
|
|
24
|
+
public validator = z.object({
|
|
25
25
|
initialValue: z.tuple([z.string(), z.string()]),
|
|
26
26
|
label: z.string().nullable(),
|
|
27
27
|
start: z.string(),
|
|
@@ -31,7 +31,7 @@ export class DateRangePickerPlugin implements IPlugin<T, Data> {
|
|
|
31
31
|
disabled: z.boolean().optional(),
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
render(props: IPluginProps<T, Data>): JSX.Element {
|
|
34
|
+
public render(props: IPluginProps<T, Data>): JSX.Element {
|
|
35
35
|
return (
|
|
36
36
|
<DateRangePickerComponent
|
|
37
37
|
{...props.data}
|
|
@@ -20,9 +20,9 @@ interface Data {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export class DateTimePickerPlugin implements IPlugin<T, Data> {
|
|
23
|
-
tagName = "marimo-datetime";
|
|
23
|
+
public tagName = "marimo-datetime";
|
|
24
24
|
|
|
25
|
-
validator = z.object({
|
|
25
|
+
public validator = z.object({
|
|
26
26
|
initialValue: z.string(),
|
|
27
27
|
label: z.string().nullable(),
|
|
28
28
|
start: z.string(),
|
|
@@ -33,7 +33,7 @@ export class DateTimePickerPlugin implements IPlugin<T, Data> {
|
|
|
33
33
|
disabled: z.boolean().optional(),
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
render(props: IPluginProps<T, Data>): JSX.Element {
|
|
36
|
+
public render(props: IPluginProps<T, Data>): JSX.Element {
|
|
37
37
|
return (
|
|
38
38
|
<DateTimePickerComponent
|
|
39
39
|
{...props.data}
|
|
@@ -18,14 +18,14 @@ interface Data {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export class DictPlugin implements IPlugin<T, Data> {
|
|
21
|
-
tagName = "marimo-dict";
|
|
21
|
+
public tagName = "marimo-dict";
|
|
22
22
|
|
|
23
|
-
validator = z.object({
|
|
23
|
+
public validator = z.object({
|
|
24
24
|
label: z.string().nullable(),
|
|
25
25
|
elementIds: z.record(z.string(), z.string()),
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
render(props: IPluginProps<T, Data>): JSX.Element {
|
|
28
|
+
public render(props: IPluginProps<T, Data>): JSX.Element {
|
|
29
29
|
return (
|
|
30
30
|
<Dict {...props.data} value={props.value} setValue={props.setValue}>
|
|
31
31
|
{props.children}
|
|
@@ -17,9 +17,9 @@ interface Data {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export class DropdownPlugin implements IPlugin<string[], Data> {
|
|
20
|
-
tagName = "marimo-dropdown";
|
|
20
|
+
public tagName = "marimo-dropdown";
|
|
21
21
|
|
|
22
|
-
validator = z.object({
|
|
22
|
+
public validator = z.object({
|
|
23
23
|
initialValue: z.array(z.string()),
|
|
24
24
|
label: z.string().nullable(),
|
|
25
25
|
options: z.array(z.string()),
|
|
@@ -29,7 +29,7 @@ export class DropdownPlugin implements IPlugin<string[], Data> {
|
|
|
29
29
|
disabled: z.boolean().default(false),
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
render(props: IPluginProps<string[], Data>): JSX.Element {
|
|
32
|
+
public render(props: IPluginProps<string[], Data>): JSX.Element {
|
|
33
33
|
if (props.data.searchable) {
|
|
34
34
|
const value = props.value.length > 0 ? props.value[0] : null;
|
|
35
35
|
const setValue = (newValue: string | null) =>
|
|
@@ -34,9 +34,9 @@ interface Data {
|
|
|
34
34
|
type T = [string, string][];
|
|
35
35
|
|
|
36
36
|
export class FileUploadPlugin implements IPlugin<T, Data> {
|
|
37
|
-
tagName = "marimo-file";
|
|
37
|
+
public tagName = "marimo-file";
|
|
38
38
|
|
|
39
|
-
validator = z.object({
|
|
39
|
+
public validator = z.object({
|
|
40
40
|
filetypes: z.array(z.string()),
|
|
41
41
|
multiple: z.boolean(),
|
|
42
42
|
kind: z.enum(["button", "area"]),
|
|
@@ -44,7 +44,7 @@ export class FileUploadPlugin implements IPlugin<T, Data> {
|
|
|
44
44
|
max_size: z.number(),
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
-
render(props: IPluginProps<T, Data>): JSX.Element {
|
|
47
|
+
public render(props: IPluginProps<T, Data>): JSX.Element {
|
|
48
48
|
return (
|
|
49
49
|
<FileUpload
|
|
50
50
|
label={props.data.label}
|
|
@@ -23,11 +23,11 @@ interface Data {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export class MatrixPlugin implements IPlugin<T, Data> {
|
|
26
|
-
tagName = "marimo-matrix";
|
|
26
|
+
public tagName = "marimo-matrix";
|
|
27
27
|
|
|
28
|
-
cssStyles = [matrixCss];
|
|
28
|
+
public cssStyles = [matrixCss];
|
|
29
29
|
|
|
30
|
-
validator = z.object({
|
|
30
|
+
public validator = z.object({
|
|
31
31
|
initialValue: z.array(z.array(z.number())),
|
|
32
32
|
label: z.string().nullable(),
|
|
33
33
|
minValue: z.array(z.array(z.number())).nullish(),
|
|
@@ -42,7 +42,7 @@ export class MatrixPlugin implements IPlugin<T, Data> {
|
|
|
42
42
|
disabled: z.array(z.array(z.boolean())),
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
render(props: IPluginProps<T, Data>): JSX.Element {
|
|
45
|
+
public render(props: IPluginProps<T, Data>): JSX.Element {
|
|
46
46
|
return (
|
|
47
47
|
<MatrixComponent
|
|
48
48
|
{...props.data}
|
|
@@ -18,13 +18,13 @@ interface Data {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export class MicrophonePlugin implements IPlugin<Value, Data> {
|
|
21
|
-
tagName = "marimo-microphone";
|
|
21
|
+
public tagName = "marimo-microphone";
|
|
22
22
|
|
|
23
|
-
validator = z.object({
|
|
23
|
+
public validator = z.object({
|
|
24
24
|
label: z.string().nullish(),
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
render(props: IPluginProps<Value, Data>): JSX.Element {
|
|
27
|
+
public render(props: IPluginProps<Value, Data>): JSX.Element {
|
|
28
28
|
return <Microphone {...props} />;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -17,9 +17,9 @@ interface Data {
|
|
|
17
17
|
type T = string[];
|
|
18
18
|
|
|
19
19
|
export class MultiselectPlugin implements IPlugin<T, Data> {
|
|
20
|
-
tagName = "marimo-multiselect";
|
|
20
|
+
public tagName = "marimo-multiselect";
|
|
21
21
|
|
|
22
|
-
validator = z.object({
|
|
22
|
+
public validator = z.object({
|
|
23
23
|
initialValue: z.array(z.string()),
|
|
24
24
|
label: z.string().nullable(),
|
|
25
25
|
options: z.array(z.string()),
|
|
@@ -28,7 +28,7 @@ export class MultiselectPlugin implements IPlugin<T, Data> {
|
|
|
28
28
|
disabled: z.boolean().default(false),
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
render(props: IPluginProps<string[], Data>): JSX.Element {
|
|
31
|
+
public render(props: IPluginProps<string[], Data>): JSX.Element {
|
|
32
32
|
return (
|
|
33
33
|
<Multiselect
|
|
34
34
|
{...props.data}
|
|
@@ -20,9 +20,9 @@ interface Data {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export class NumberPlugin implements IPlugin<T | null, Data> {
|
|
23
|
-
tagName = "marimo-number";
|
|
23
|
+
public tagName = "marimo-number";
|
|
24
24
|
|
|
25
|
-
validator = z.object({
|
|
25
|
+
public validator = z.object({
|
|
26
26
|
initialValue: z.number().nullish(),
|
|
27
27
|
label: z.string().nullable(),
|
|
28
28
|
start: z.number().nullish(),
|
|
@@ -33,7 +33,7 @@ export class NumberPlugin implements IPlugin<T | null, Data> {
|
|
|
33
33
|
disabled: z.boolean().optional(),
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
render(props: IPluginProps<T | null, Data>): JSX.Element {
|
|
36
|
+
public render(props: IPluginProps<T | null, Data>): JSX.Element {
|
|
37
37
|
return (
|
|
38
38
|
<NumberComponent
|
|
39
39
|
{...props.data}
|
|
@@ -25,9 +25,9 @@ interface Data {
|
|
|
25
25
|
type S = string | null;
|
|
26
26
|
|
|
27
27
|
export class RadioPlugin implements IPlugin<S, Data> {
|
|
28
|
-
tagName = "marimo-radio";
|
|
28
|
+
public tagName = "marimo-radio";
|
|
29
29
|
|
|
30
|
-
validator = z.object({
|
|
30
|
+
public validator = z.object({
|
|
31
31
|
initialValue: z.string().nullable(),
|
|
32
32
|
inline: z.boolean().default(false),
|
|
33
33
|
label: z.string().nullable(),
|
|
@@ -35,7 +35,7 @@ export class RadioPlugin implements IPlugin<S, Data> {
|
|
|
35
35
|
disabled: z.boolean().optional(),
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
render(props: IPluginProps<S, Data>): JSX.Element {
|
|
38
|
+
public render(props: IPluginProps<S, Data>): JSX.Element {
|
|
39
39
|
return (
|
|
40
40
|
<Radio {...props.data} value={props.value} setValue={props.setValue} />
|
|
41
41
|
);
|
|
@@ -61,8 +61,12 @@ export const Radio = (props: RadioProps): JSX.Element => {
|
|
|
61
61
|
disabled={props.disabled}
|
|
62
62
|
>
|
|
63
63
|
{props.options.map((option, i) => (
|
|
64
|
-
<div className="flex items-
|
|
65
|
-
<RadioGroupItem
|
|
64
|
+
<div className="flex items-start space-x-2" key={i}>
|
|
65
|
+
<RadioGroupItem
|
|
66
|
+
value={option}
|
|
67
|
+
id={`${id}-${i.toString()}`}
|
|
68
|
+
className="shrink-0"
|
|
69
|
+
/>
|
|
66
70
|
<Label
|
|
67
71
|
htmlFor={`${id}-${i.toString()}`}
|
|
68
72
|
className="text-sm font-normal"
|
|
@@ -26,9 +26,9 @@ interface Data {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export class RangeSliderPlugin implements IPlugin<T, Data> {
|
|
29
|
-
tagName = "marimo-range-slider";
|
|
29
|
+
public tagName = "marimo-range-slider";
|
|
30
30
|
|
|
31
|
-
validator = z.object({
|
|
31
|
+
public validator = z.object({
|
|
32
32
|
initialValue: z.array(z.number()),
|
|
33
33
|
label: z.string().nullable(),
|
|
34
34
|
start: z.number(),
|
|
@@ -42,7 +42,7 @@ export class RangeSliderPlugin implements IPlugin<T, Data> {
|
|
|
42
42
|
disabled: z.boolean().optional(),
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
render(props: IPluginProps<T, Data>): JSX.Element {
|
|
45
|
+
public render(props: IPluginProps<T, Data>): JSX.Element {
|
|
46
46
|
const valueMap = (sliderValue: number): number => {
|
|
47
47
|
if (props.data.steps && props.data.steps.length > 0) {
|
|
48
48
|
return props.data.steps[sliderValue];
|
|
@@ -51,9 +51,9 @@ const zodTimestring = z.string().superRefine((s, ctx) => {
|
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
export class RefreshPlugin implements IPlugin<Value, Data> {
|
|
54
|
-
tagName = "marimo-refresh";
|
|
54
|
+
public tagName = "marimo-refresh";
|
|
55
55
|
|
|
56
|
-
validator = z.object({
|
|
56
|
+
public validator = z.object({
|
|
57
57
|
options: z
|
|
58
58
|
.array(z.union([zodTimestring, z.number().min(MIN_INTERVAL)]))
|
|
59
59
|
.default([]),
|
|
@@ -63,7 +63,7 @@ export class RefreshPlugin implements IPlugin<Value, Data> {
|
|
|
63
63
|
label: z.string().nullable(),
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
-
render(props: IPluginProps<Value, Data>): JSX.Element {
|
|
66
|
+
public render(props: IPluginProps<Value, Data>): JSX.Element {
|
|
67
67
|
return <RefreshComponent {...props} />;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -31,9 +31,9 @@ interface Data {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export class SliderPlugin implements IPlugin<T, Data> {
|
|
34
|
-
tagName = "marimo-slider";
|
|
34
|
+
public tagName = "marimo-slider";
|
|
35
35
|
|
|
36
|
-
validator = z.object({
|
|
36
|
+
public validator = z.object({
|
|
37
37
|
initialValue: z.number(),
|
|
38
38
|
label: z.string().nullable(),
|
|
39
39
|
start: z.number(),
|
|
@@ -48,7 +48,7 @@ export class SliderPlugin implements IPlugin<T, Data> {
|
|
|
48
48
|
disabled: z.boolean().optional(),
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
render(props: IPluginProps<T, Data>): JSX.Element {
|
|
51
|
+
public render(props: IPluginProps<T, Data>): JSX.Element {
|
|
52
52
|
// Create the valueMap function
|
|
53
53
|
const valueMap = (sliderValue: number): number => {
|
|
54
54
|
const { steps } = props.data;
|
|
@@ -13,15 +13,15 @@ interface Data {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export class SwitchPlugin implements IPlugin<T, Data> {
|
|
16
|
-
tagName = "marimo-switch";
|
|
16
|
+
public tagName = "marimo-switch";
|
|
17
17
|
|
|
18
|
-
validator = z.object({
|
|
18
|
+
public validator = z.object({
|
|
19
19
|
initialValue: z.boolean(),
|
|
20
20
|
label: z.string().nullable(),
|
|
21
21
|
disabled: z.boolean().optional(),
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
render(props: IPluginProps<T, Data>): JSX.Element {
|
|
24
|
+
public render(props: IPluginProps<T, Data>): JSX.Element {
|
|
25
25
|
return <SwitchComponent {...props} />;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -25,15 +25,15 @@ interface Data {
|
|
|
25
25
|
type T = string;
|
|
26
26
|
|
|
27
27
|
export class TabsPlugin implements IPlugin<T, Data> {
|
|
28
|
-
tagName = "marimo-tabs";
|
|
28
|
+
public tagName = "marimo-tabs";
|
|
29
29
|
|
|
30
|
-
validator = z.object({
|
|
30
|
+
public validator = z.object({
|
|
31
31
|
tabs: z.array(z.string()),
|
|
32
32
|
label: z.string().nullable(),
|
|
33
33
|
orientation: z.enum(["horizontal", "vertical"]).default("horizontal"),
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
render(props: IPluginProps<T, Data>): JSX.Element {
|
|
36
|
+
public render(props: IPluginProps<T, Data>): JSX.Element {
|
|
37
37
|
return (
|
|
38
38
|
<TabComponent
|
|
39
39
|
{...props.data}
|
|
@@ -25,9 +25,9 @@ interface Data {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export class TextAreaPlugin implements IPlugin<T, Data> {
|
|
28
|
-
tagName = "marimo-text-area";
|
|
28
|
+
public tagName = "marimo-text-area";
|
|
29
29
|
|
|
30
|
-
validator = z.object({
|
|
30
|
+
public validator = z.object({
|
|
31
31
|
initialValue: z.string(),
|
|
32
32
|
placeholder: z.string(),
|
|
33
33
|
label: z.string().nullable(),
|
|
@@ -39,7 +39,7 @@ export class TextAreaPlugin implements IPlugin<T, Data> {
|
|
|
39
39
|
fullWidth: z.boolean().default(false),
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
render(props: IPluginProps<T, Data>): JSX.Element {
|
|
42
|
+
public render(props: IPluginProps<T, Data>): JSX.Element {
|
|
43
43
|
return (
|
|
44
44
|
<TextAreaComponent
|
|
45
45
|
{...props.data}
|
|
@@ -33,9 +33,9 @@ interface Data {
|
|
|
33
33
|
const MASK_PLACEHOLDER = "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022";
|
|
34
34
|
|
|
35
35
|
export class TextInputPlugin implements IPlugin<T, Data> {
|
|
36
|
-
tagName = "marimo-text";
|
|
36
|
+
public tagName = "marimo-text";
|
|
37
37
|
|
|
38
|
-
validator = z.object({
|
|
38
|
+
public validator = z.object({
|
|
39
39
|
initialValue: z.string(),
|
|
40
40
|
placeholder: z.string(),
|
|
41
41
|
label: z.string().nullable(),
|
|
@@ -48,7 +48,7 @@ export class TextInputPlugin implements IPlugin<T, Data> {
|
|
|
48
48
|
passwordHasValue: z.boolean().optional(),
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
render(props: IPluginProps<T, Data>): JSX.Element {
|
|
51
|
+
public render(props: IPluginProps<T, Data>): JSX.Element {
|
|
52
52
|
// Force remount on cell re-run so masked state resets cleanly
|
|
53
53
|
const remountKey =
|
|
54
54
|
props.data.kind === "password"
|
|
@@ -54,8 +54,8 @@ beforeEach(() => {
|
|
|
54
54
|
// like clientX. Polyfill it so fireEvent.pointerDown/Move/Up work.
|
|
55
55
|
// oxlint-disable-next-line typescript/no-explicit-any
|
|
56
56
|
(globalThis as any).PointerEvent = class PointerEvent extends MouseEvent {
|
|
57
|
-
readonly pointerId: number;
|
|
58
|
-
constructor(type: string, init: PointerEventInit = {}) {
|
|
57
|
+
public readonly pointerId: number;
|
|
58
|
+
public constructor(type: string, init: PointerEventInit = {}) {
|
|
59
59
|
super(type, init);
|
|
60
60
|
this.pointerId = init.pointerId ?? 0;
|
|
61
61
|
}
|