@marimo-team/frontend 0.16.1 → 0.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ConnectedDataExplorerComponent-2wVcyvDj.js → ConnectedDataExplorerComponent-Brtw1DxF.js} +1 -1
- package/dist/assets/{ImageComparisonComponent-D2j6i0hv.js → ImageComparisonComponent-Dxl-PbZX.js} +1 -1
- package/dist/assets/{VegaLite-BckFaf2D.js → VegaLite-BXQF0Cx_.js} +1 -1
- package/dist/assets/_baseEach-BjSm9ht3.js +1 -0
- package/dist/assets/_baseMap-CV4Ezmtf.js +1 -0
- package/dist/assets/_baseUniq-Ci9yZGxz.js +1 -0
- package/dist/assets/{_createAggregator-C5CVY-0t.js → _createAggregator-VFK9K2d9.js} +1 -1
- package/dist/assets/{agent-panel-RGLNjkYe.js → agent-panel-BoscVLCT.js} +7 -7
- package/dist/assets/{any-language-editor-DjuXwGCA.js → any-language-editor-ChaY_VUU.js} +1 -1
- package/dist/assets/{architectureDiagram-W76B3OCA-Dyj4ds_R.js → architectureDiagram-W76B3OCA-CueUUFYd.js} +1 -1
- package/dist/assets/{between-horizontal-start-Dt2aKpPf.js → between-horizontal-start-DAHqmLYT.js} +1 -1
- package/dist/assets/{blockDiagram-QIGZ2CNN-o-i7DDvN.js → blockDiagram-QIGZ2CNN-BYYygyWn.js} +1 -1
- package/dist/assets/{c4Diagram-FPNF74CW-DGHEwWrx.js → c4Diagram-FPNF74CW-DAz3xEh1.js} +1 -1
- package/dist/assets/channel-6SqQ2U_X.js +1 -0
- package/dist/assets/chat-panel-DJkOLrw9.js +3 -0
- package/dist/assets/{chunk-4BX2VUAB-BJecb-Ri.js → chunk-4BX2VUAB-8g-RyHdt.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-CAATkc4w.js → chunk-55IACEB6-iWZZ8Mt6.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-DPuNbQ-f.js → chunk-FMBD7UC4-knjss4wk.js} +1 -1
- package/dist/assets/{chunk-K7UQS3LO-C8TWVLiH.js → chunk-K7UQS3LO-DVIwPBgZ.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-DiZZ09q4.js → chunk-QN33PNHL-CBU8pN6I.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-BIUM7usu.js → chunk-QZHKN3VN-5ljElUF4.js} +1 -1
- package/dist/assets/{chunk-TVAH2DTR-vGTArPBG.js → chunk-TVAH2DTR-DkIdGINc.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-D2KRqp_x.js → chunk-TZMSLE5B-CIFOSTqh.js} +1 -1
- package/dist/assets/{circle-play-cjeNez0N.js → circle-play-BOdsbq5u.js} +1 -1
- package/dist/assets/classDiagram-KNZD7YFC-DVqXcTYf.js +1 -0
- package/dist/assets/classDiagram-v2-RKCZMP56-DVqXcTYf.js +1 -0
- package/dist/assets/{clear-button-C97JtAez.js → clear-button-GAjXl0CQ.js} +1 -1
- package/dist/assets/clone-DSDb0xen.js +1 -0
- package/dist/assets/command-palette-BUXkqoLh.js +1 -0
- package/dist/assets/{common-Du9rSOwD.js → common-DahoYqdi.js} +1 -1
- package/dist/assets/{compile-CZXqyOxa.js → compile-Bg8uJ7vm.js} +1 -1
- package/dist/assets/{cose-bilkent-S5V4N54A-CqUN5Y9b.js → cose-bilkent-S5V4N54A-z_0gqD9K.js} +1 -1
- package/dist/assets/{dagre-5GWH7T2D-RJqTI9DM.js → dagre-5GWH7T2D-BMt7CNXL.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-DZN0q1LV.js → data-grid-overlay-editor-Ctn4XtXx.js} +1 -1
- package/dist/assets/datasources-panel-C7sqRIHs.js +1 -0
- package/dist/assets/{dependency-graph-panel-CEog_O7V.js → dependency-graph-panel-DNajptzv.js} +4 -4
- package/dist/assets/{diagram-N5W7TBWH-D-l4zZ9d.js → diagram-N5W7TBWH-BzwvLvAy.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-CCOmBUt-.js → diagram-QEK2KX5R-DRLJ56FS.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-C_I_9jnZ.js → diagram-S2PKOQOG-Bf8x4KTU.js} +1 -1
- package/dist/assets/{documentation-panel-C1BtMZ3M.js → documentation-panel-Dm6Ozl67.js} +1 -1
- package/dist/assets/{edit-page-B-oevUZ9.js → edit-page-CGc9EjuG.js} +53 -42
- package/dist/assets/{ellipsis-vertical-BEb-J8z6.js → ellipsis-vertical-Bj1YXvZe.js} +1 -1
- package/dist/assets/{empty-state-C99UyDE3.js → empty-state-CYev-D31.js} +1 -1
- package/dist/assets/{erDiagram-AWTI2OKA-BePOLi5M.js → erDiagram-AWTI2OKA-DmgzgN_I.js} +1 -1
- package/dist/assets/{error-panel-Bs34jXFh.js → error-panel-BYG4twCa.js} +1 -1
- package/dist/assets/{file-explorer-panel-Ck6UL861.js → file-explorer-panel-BSMiOApi.js} +1 -1
- package/dist/assets/{flowDiagram-PVAE7QVJ-BgjFu5l7.js → flowDiagram-PVAE7QVJ-BdRKkajr.js} +1 -1
- package/dist/assets/{ganttDiagram-OWAHRB6G-YOPb3XSV.js → ganttDiagram-OWAHRB6G-lfRAMnq_.js} +5 -5
- package/dist/assets/{gitGraphDiagram-NY62KEGX-CGhqaDTy.js → gitGraphDiagram-NY62KEGX-CQVTIrHF.js} +1 -1
- package/dist/assets/{glide-data-editor-9QUH6iso.js → glide-data-editor-D5A4pou7.js} +4 -4
- package/dist/assets/{graph-DQQFGrho.js → graph-CBNo279v.js} +1 -1
- package/dist/assets/{home-page-DRKpPCrF.js → home-page-CmdznBJR.js} +2 -2
- package/dist/assets/{index-SGLNXrGP.js → index-0dfGh-Gj.js} +1 -1
- package/dist/assets/{index-aE43R74q.js → index-BDYVSSzB.js} +1 -1
- package/dist/assets/{index-BJNCMUmG.js → index-B_KyDZ94.js} +1 -1
- package/dist/assets/{index-BjgnbONl.js → index-Bfy-I_lW.js} +1 -1
- package/dist/assets/{index-CUFv_thQ.js → index-Bh98Tp-z.js} +1 -1
- package/dist/assets/{index-C2MD0vgD.js → index-BhroIwBL.js} +1 -1
- package/dist/assets/{index-DdnKZNxM.js → index-BtQtesaI.js} +1 -1
- package/dist/assets/index-C0iXCvyY.css +1 -0
- package/dist/assets/index-C1SHFMCp.js +581 -0
- package/dist/assets/{index-C_tkBKNO.js → index-C6DWtSls.js} +1 -1
- package/dist/assets/{index-Aeo6WiK7.js → index-C71cdkH-.js} +1 -1
- package/dist/assets/{index-G5QZppK2.js → index-CT_FTqvK.js} +1 -1
- package/dist/assets/{index-B8jXZ12t.js → index-CU5rRr66.js} +1 -1
- package/dist/assets/{index-BAbIIxHU.js → index-Cb6duXQm.js} +1 -1
- package/dist/assets/{index-BW3k9Gss.js → index-D23e9zQj.js} +1 -1
- package/dist/assets/index-DUGecC2Z.js +68 -0
- package/dist/assets/{index-CFKO7WXI.js → index-DcGIOAQi.js} +1 -1
- package/dist/assets/{index-ClzeQrN7.js → index-PJfa9qXY.js} +1 -1
- package/dist/assets/{index-C1ez98sk.js → index-SPslPC2B.js} +1 -1
- package/dist/assets/{index-BprjMYH5.js → index-VPQlo4Uz.js} +1 -1
- package/dist/assets/{index-CfaDbEdi.js → index-qbTLKWyG.js} +1 -1
- package/dist/assets/infoDiagram-STP46IZ2-DBu8p9gd.js +2 -0
- package/dist/assets/{isEmpty-D-4c7sMv.js → isEmpty-CnOLuQIv.js} +1 -1
- package/dist/assets/{journeyDiagram-BIP6EPQ6-C94u3Mv3.js → journeyDiagram-BIP6EPQ6-6U_vHJBH.js} +1 -1
- package/dist/assets/{kanban-definition-6OIFK2YF-BEXYFzz7.js → kanban-definition-6OIFK2YF-DgnR14ys.js} +1 -1
- package/dist/assets/{layout-Bz2BJ2ru.js → layout-RHmq4fP9.js} +1 -1
- package/dist/assets/{linear-D8s7K76e.js → linear-CLdOVPGV.js} +1 -1
- package/dist/assets/links-Dd1icsEk.js +7 -0
- package/dist/assets/{logs-panel-DC7wpmPz.js → logs-panel-CjbuhBLx.js} +1 -1
- package/dist/assets/{markdown-renderer-DRdSWR9X.js → markdown-renderer-X5YJvAZq.js} +3 -3
- package/dist/assets/{mermaid-Y3x4hmD0.js → mermaid-Bl2T5oEC.js} +1 -1
- package/dist/assets/{mermaid.core-DzthE35Y.js → mermaid.core-CfukBvGI.js} +4 -4
- package/dist/assets/min-BXIes1Za.js +1 -0
- package/dist/assets/{mindmap-definition-Q6HEUPPD-DktvuLe1.js → mindmap-definition-Q6HEUPPD-BXCjP4Lu.js} +1 -1
- package/dist/assets/{number-overlay-editor-BEfwI1IT.js → number-overlay-editor-BUyqkSes.js} +1 -1
- package/dist/assets/{outline-panel-CdsnAy2w.js → outline-panel-BvGcPKdd.js} +1 -1
- package/dist/assets/{packages-panel-DiTA-d_D.js → packages-panel-BichDQWG.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-DQDNQ-de.js → pieDiagram-ADFJNKIX-CMzJFIJM.js} +1 -1
- package/dist/assets/{quadrantDiagram-LMRXKWRM-0kgIXc2-.js → quadrantDiagram-LMRXKWRM-CfGssUlO.js} +1 -1
- package/dist/assets/{react-plotly-DJqqfM7c.js → react-plotly-DR3hV0HW.js} +1 -1
- package/dist/assets/{requirementDiagram-4UW4RH46-B5rb0ypd.js → requirementDiagram-4UW4RH46-CfrFolth.js} +1 -1
- package/dist/assets/{run-page-CFmLrv1R.js → run-page-Bqd_4ePD.js} +1 -1
- package/dist/assets/{sankeyDiagram-GR3RE2ED-Dom7IlnF.js → sankeyDiagram-GR3RE2ED-D_UttKU0.js} +1 -1
- package/dist/assets/{scratchpad-panel-CuHWpHO8.js → scratchpad-panel-D5N15ji1.js} +1 -1
- package/dist/assets/secrets-panel-BpbnAO4R.js +1 -0
- package/dist/assets/{sequenceDiagram-C3RYC4MD-PNJWXQbw.js → sequenceDiagram-C3RYC4MD-MdfQQApP.js} +1 -1
- package/dist/assets/{slides-component-CJgaTRZ0.js → slides-component-C0z7rXmk.js} +1 -1
- package/dist/assets/{snippets-panel-B2EC1txM.js → snippets-panel-wlpZ_Wzx.js} +1 -1
- package/dist/assets/sortBy-BW_zNHP6.js +1 -0
- package/dist/assets/{state-CWict9RU.js → state-CDooX-dk.js} +1 -1
- package/dist/assets/{stateDiagram-KXAO66HF-BE58aJnr.js → stateDiagram-KXAO66HF-H7kfw3ot.js} +1 -1
- package/dist/assets/stateDiagram-v2-UMBNRL4Z-YMeb9qMR.js +1 -0
- package/dist/assets/{storage-DRaR04wR.js → storage-b1QCapTq.js} +6 -6
- package/dist/assets/{terminal-BX3Su5q7.js → terminal-CPV44BXz.js} +1 -1
- package/dist/assets/{time-hUzZfpNE.js → time-DDy3xv5Y.js} +1 -1
- package/dist/assets/{timeline-definition-XQNQX7LJ-CqQP9t51.js → timeline-definition-XQNQX7LJ-J-cPRT2_.js} +1 -1
- package/dist/assets/{tracing-B10Q1n-L.js → tracing-3eHHRUiJ.js} +2 -2
- package/dist/assets/{tracing-panel-Du8WCnno.js → tracing-panel-BMgy3D7d.js} +2 -2
- package/dist/assets/{trash-B81GTiv6.js → trash--tonOuDe.js} +1 -1
- package/dist/assets/{tree-6vW2ogkh.js → tree-ouIGEsVg.js} +1 -1
- package/dist/assets/{treemap-75Q7IDZK-CdwDwwsz.js → treemap-75Q7IDZK-CzJTJ_3R.js} +20 -20
- package/dist/assets/{variable-panel-D5qgJI7k.js → variable-panel-sFTn4Oih.js} +1 -1
- package/dist/assets/{vega-component-DJaJWMJM.js → vega-component-BkPkzX9r.js} +1 -1
- package/dist/assets/{xychartDiagram-6GGTOJPD-WFtXqaM9.js → xychartDiagram-6GGTOJPD-BZ8WOb_8.js} +1 -1
- package/dist/index.html +10 -3
- package/package.json +8 -8
- package/src/__mocks__/common.ts +5 -3
- package/src/__mocks__/notebook.ts +2 -2
- package/src/__mocks__/requests.ts +1 -0
- package/src/__tests__/main.test.tsx +2 -2
- package/src/components/ai/ai-provider-icon.tsx +2 -0
- package/src/components/app-config/ai-config.tsx +32 -1
- package/src/components/app-config/common.tsx +2 -2
- package/src/components/app-config/user-config-form.tsx +26 -0
- package/src/components/audio/audio-recorder.tsx +0 -1
- package/src/components/chat/acp/blocks.tsx +2 -2
- package/src/components/chat/acp/thread.tsx +3 -5
- package/src/components/chat/acp/utils.ts +5 -5
- package/src/components/chat/chat-panel.tsx +1 -1
- package/src/components/data-table/__tests__/columns.test.tsx +38 -0
- package/src/components/data-table/__tests__/data-table.test.tsx +2 -2
- package/src/components/data-table/cell-hover-template/feature.ts +1 -1
- package/src/components/data-table/cell-hover-template/types.ts +1 -1
- package/src/components/data-table/charts/__tests__/altair-generator.test.ts +1 -1
- package/src/components/data-table/charts/chart-spec/tooltips.ts +3 -3
- package/src/components/data-table/charts/components/chart-items.tsx +1 -1
- package/src/components/data-table/charts/components/form-fields.tsx +2 -2
- package/src/components/data-table/charts/constants.ts +1 -1
- package/src/components/data-table/column-explorer-panel/column-explorer.tsx +1 -1
- package/src/components/data-table/column-summary/chart-spec-model.tsx +2 -2
- package/src/components/data-table/columns.tsx +22 -3
- package/src/components/data-table/data-table.tsx +35 -3
- package/src/components/data-table/date-popover.tsx +1 -1
- package/src/components/data-table/download-actions.tsx +1 -1
- package/src/components/data-table/range-focus/__tests__/utils.test.ts +5 -5
- package/src/components/data-table/renderers.tsx +22 -13
- package/src/components/data-table/row-viewer-panel/row-viewer.tsx +1 -1
- package/src/components/data-table/schemas.ts +16 -0
- package/src/components/data-table/types.ts +4 -3
- package/src/components/datasources/column-preview.tsx +9 -6
- package/src/components/debugger/debugger-code.tsx +1 -1
- package/src/components/dependency-graph/custom-node.tsx +15 -6
- package/src/components/dependency-graph/dependency-graph-minimap.tsx +2 -2
- package/src/components/dependency-graph/dependency-graph-tree.tsx +2 -2
- package/src/components/dependency-graph/dependency-graph.tsx +1 -1
- package/src/components/dependency-graph/elements.ts +7 -7
- package/src/components/dependency-graph/utils/changes.ts +4 -4
- package/src/components/editor/Cell.tsx +7 -1
- package/src/components/editor/ai/transport/chat-transport.tsx +1 -1
- package/src/components/editor/chrome/panels/outline/useActiveOutline.tsx +1 -1
- package/src/components/editor/chrome/panels/packages-panel.tsx +1 -1
- package/src/components/editor/columns/storage.ts +1 -1
- package/src/components/editor/database/__tests__/__snapshots__/as-code.test.ts.snap +36 -0
- package/src/components/editor/database/__tests__/as-code.test.ts +30 -7
- package/src/components/editor/database/add-database-form.tsx +11 -0
- package/src/components/editor/database/as-code.ts +104 -5
- package/src/components/editor/database/schemas.ts +36 -18
- package/src/components/editor/errors/auto-fix.tsx +12 -2
- package/src/components/editor/errors/sql-validation-errors.tsx +40 -0
- package/src/components/editor/navigation/clipboard.ts +2 -2
- package/src/components/editor/output/ConsoleOutput.tsx +14 -2
- package/src/components/editor/output/JsonOutput.tsx +1 -1
- package/src/components/editor/output/MarimoErrorOutput.tsx +60 -1
- package/src/components/editor/output/MarimoTracebackOutput.tsx +17 -2
- package/src/components/editor/renderers/grid-layout/types.ts +2 -2
- package/src/components/editor/renderers/plugins.ts +1 -1
- package/src/components/editor/renderers/types.ts +1 -1
- package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +7 -7
- package/src/components/forms/form.tsx +5 -5
- package/src/components/ui/links.tsx +1 -0
- package/src/core/ai/__tests__/model-registry.test.ts +0 -10
- package/src/core/ai/context/providers/cell-output.ts +1 -18
- package/src/core/ai/context/providers/error.ts +2 -2
- package/src/core/ai/ids/ids.ts +1 -0
- package/src/core/ai/model-registry.ts +2 -1
- package/src/core/cells/cells.ts +5 -5
- package/src/core/cells/logs.ts +1 -1
- package/src/core/cells/types.ts +1 -1
- package/src/core/codemirror/__tests__/format.test.ts +6 -0
- package/src/core/codemirror/cells/traceback-decorations.ts +1 -1
- package/src/core/codemirror/editing/commands.ts +2 -2
- package/src/core/codemirror/find-replace/navigate.ts +1 -1
- package/src/core/codemirror/language/__tests__/extension.test.ts +24 -0
- package/src/core/codemirror/language/__tests__/sql-validation.test.ts +133 -0
- package/src/core/codemirror/language/__tests__/sql.test.ts +764 -79
- package/src/core/codemirror/language/languages/markdown.ts +4 -1
- package/src/core/codemirror/language/languages/sql/banner-validation-errors.ts +85 -0
- package/src/core/codemirror/language/languages/sql/completion-builder.ts +160 -0
- package/src/core/codemirror/language/languages/sql/completion-sources.tsx +9 -3
- package/src/core/codemirror/language/languages/sql/completion-store.ts +46 -50
- package/src/core/codemirror/language/languages/sql/renderers.tsx +485 -0
- package/src/core/codemirror/language/languages/sql/sql-mode.ts +20 -0
- package/src/core/codemirror/language/languages/sql/sql.ts +218 -4
- package/src/core/codemirror/language/languages/sql/utils.ts +4 -1
- package/src/core/codemirror/language/panel/panel.tsx +8 -2
- package/src/core/codemirror/language/panel/sql.tsx +86 -4
- package/src/core/codemirror/language/utils/ast.ts +3 -3
- package/src/core/codemirror/lsp/federated-lsp.ts +4 -4
- package/src/core/codemirror/lsp/lens.ts +4 -4
- package/src/core/codemirror/lsp/notebook-lsp.ts +1 -1
- package/src/core/codemirror/lsp/types.ts +1 -1
- package/src/core/codemirror/markdown/completions.ts +1 -1
- package/src/core/codemirror/reactive-references/analyzer.ts +2 -2
- package/src/core/codemirror/rtc/loro/awareness.ts +1 -1
- package/src/core/config/config-schema.ts +1 -0
- package/src/core/config/feature-flag.tsx +6 -2
- package/src/core/datasets/request-registry.ts +24 -1
- package/src/core/dom/events.ts +1 -1
- package/src/core/dom/outline.ts +2 -2
- package/src/core/dom/uiregistry.ts +2 -8
- package/src/core/errors/__tests__/errors.test.ts +22 -4
- package/src/core/errors/errors.ts +29 -1
- package/src/core/errors/state.ts +1 -1
- package/src/core/islands/bridge.ts +1 -0
- package/src/core/islands/main.ts +3 -2
- package/src/core/islands/parse.ts +1 -3
- package/src/core/kernel/messages.ts +2 -1
- package/src/core/network/CachingRequestRegistry.ts +74 -0
- package/src/core/network/DeferredRequestRegistry.ts +3 -1
- package/src/core/network/__tests__/CachingRequestRegistry.test.ts +73 -0
- package/src/core/network/requests-network.ts +7 -0
- package/src/core/network/requests-static.ts +1 -0
- package/src/core/network/requests-toasting.ts +1 -0
- package/src/core/network/types.ts +3 -1
- package/src/core/variables/state.ts +2 -2
- package/src/core/wasm/__tests__/state.test.ts +1 -1
- package/src/core/wasm/bridge.ts +5 -0
- package/src/core/websocket/useMarimoWebSocket.tsx +9 -2
- package/src/custom.d.ts +1 -1
- package/src/hooks/useCellRenderCount.ts +1 -0
- package/src/hooks/useResizeHandle.ts +4 -1
- package/src/plugins/core/RenderHTML.tsx +1 -2
- package/src/plugins/core/registerReactComponent.tsx +23 -19
- package/src/plugins/impl/DataTablePlugin.tsx +18 -6
- package/src/plugins/impl/FileUploadPlugin.tsx +1 -1
- package/src/plugins/impl/RefreshPlugin.tsx +1 -1
- package/src/plugins/impl/SliderPlugin.tsx +4 -0
- package/src/plugins/impl/anywidget/AnyWidgetPlugin.tsx +27 -9
- package/src/plugins/impl/anywidget/__tests__/AnyWidgetPlugin.test.tsx +58 -2
- package/src/plugins/impl/anywidget/__tests__/model.test.ts +3 -4
- package/src/plugins/impl/anywidget/model.ts +2 -3
- package/src/plugins/impl/data-editor/types.ts +1 -1
- package/src/plugins/impl/data-explorer/components/query-form.tsx +1 -1
- package/src/plugins/impl/data-frames/DataFramePlugin.tsx +17 -5
- package/src/plugins/impl/data-frames/types.ts +1 -1
- package/src/plugins/impl/panel/PanelPlugin.tsx +2 -2
- package/src/plugins/impl/plotly/PlotlyPlugin.tsx +3 -3
- package/src/plugins/impl/vega/__tests__/loader.test.ts +2 -2
- package/src/plugins/impl/vega/loader.ts +1 -1
- package/src/plugins/impl/vega/vega-component.tsx +1 -1
- package/src/plugins/impl/vega/vega-loader.ts +2 -2
- package/src/plugins/layout/NavigationMenuPlugin.tsx +1 -1
- package/src/plugins/layout/RoutesPlugin.tsx +1 -2
- package/src/plugins/plugins.ts +2 -2
- package/src/stories/dataframe.stories.tsx +2 -0
- package/src/utils/Logger.ts +1 -1
- package/src/utils/__tests__/data-views.test.ts +30 -68
- package/src/utils/__tests__/dom.test.ts +167 -0
- package/src/utils/__tests__/id-tree.test.ts +49 -1
- package/src/utils/__tests__/storage.test.ts +1 -1
- package/src/utils/__tests__/traceback.test.ts +13 -2
- package/src/utils/arrays.ts +1 -1
- package/src/utils/createReducer.ts +1 -5
- package/src/utils/data-views.ts +6 -19
- package/src/utils/dom.ts +55 -0
- package/src/utils/edit-distance.ts +1 -1
- package/src/utils/fileToBase64.ts +1 -1
- package/src/utils/id-tree.tsx +20 -18
- package/src/utils/json/base64.ts +13 -0
- package/src/utils/json/json-parser.ts +2 -2
- package/src/utils/lru.ts +4 -0
- package/src/utils/mergeRefs.ts +1 -1
- package/src/utils/objects.ts +3 -3
- package/src/utils/pluralize.ts +1 -1
- package/src/utils/routes.ts +2 -2
- package/src/utils/sets.ts +1 -1
- package/src/utils/traceback.ts +45 -15
- package/src/utils/tracer.ts +11 -9
- package/dist/assets/_baseEach-CvTX9w0Y.js +0 -1
- package/dist/assets/_baseMap-CtlwA90f.js +0 -1
- package/dist/assets/_baseUniq-BKktIGQ1.js +0 -1
- package/dist/assets/channel-Co6iMgWq.js +0 -1
- package/dist/assets/chat-panel-9alr8FS4.js +0 -3
- package/dist/assets/classDiagram-KNZD7YFC-BbJ0rY3y.js +0 -1
- package/dist/assets/classDiagram-v2-RKCZMP56-BbJ0rY3y.js +0 -1
- package/dist/assets/clone-BMP0PsTa.js +0 -1
- package/dist/assets/command-palette-B93Pjcky.js +0 -1
- package/dist/assets/datasources-panel-v7H3cR0p.js +0 -1
- package/dist/assets/index-2252nrk6.js +0 -68
- package/dist/assets/index-C7CoaNFb.js +0 -578
- package/dist/assets/index-DadI618h.css +0 -1
- package/dist/assets/infoDiagram-STP46IZ2-CJLOpSAf.js +0 -2
- package/dist/assets/links-BpXlz1GG.js +0 -7
- package/dist/assets/min-BBO3-1Hg.js +0 -1
- package/dist/assets/secrets-panel-CfHc5YD0.js +0 -1
- package/dist/assets/sortBy-DZnlX29-.js +0 -1
- package/dist/assets/stateDiagram-v2-UMBNRL4Z-CdThjimL.js +0 -1
- package/src/__tests__/lru.test.ts +0 -74
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as V,r as u,d as v,bY as O,bZ as D,b_ as G,b$ as R,c0 as q,c1 as P,j as e,aD as $,a6 as U,T as Y,a4 as Z,Y as _,a5 as z,c2 as F,a7 as E,Z as H,c3 as A,c4 as h,V as C,b9 as J,ba as K,a as L,c5 as Q,al as W,c6 as X,__tla as ee}from"./index-C1SHFMCp.js";import{V as re,C as te}from"./common-DahoYqdi.js";import{s as b}from"./sortBy-BW_zNHP6.js";import{a as ae,__tla as oe}from"./edit-page-CGc9EjuG.js";import{P as se}from"./empty-state-CYev-D31.js";import"./_baseEach-BjSm9ht3.js";import"./_baseMap-CV4Ezmtf.js";import"./links-Dd1icsEk.js";import{__tla as ie}from"./storage-b1QCapTq.js";import"./index-C71cdkH-.js";import"./index-qbTLKWyG.js";import"./index-Bfy-I_lW.js";import"./index-Bh98Tp-z.js";import"./index-BtQtesaI.js";import"./index-C6DWtSls.js";import"./index-B_KyDZ94.js";import"./index-DcGIOAQi.js";import"./index-BDYVSSzB.js";import"./index-Cb6duXQm.js";import"./index-PJfa9qXY.js";import"./index-CT_FTqvK.js";import"./index-BhroIwBL.js";import"./apl-CXdQSnD-.js";import"./asciiarmor-D5V0T9Cu.js";import"./asn1-DWPaVWf6.js";import"./brainfuck-CtZaYBKt.js";import"./cobol-stawOqaz.js";import"./clike-BgBwzOhw.js";import"./clojure-DiuoqK-z.js";import"./css-ZjFoif2m.js";import"./cmake-DXn5xaP-.js";import"./coffeescript-BTDxI-eT.js";import"./commonlisp-vq6DHwts.js";import"./cypher-gJDei3ni.js";import"./python-DD-Q2bae.js";import"./crystal-CRzZ78HM.js";import"./d-BShv7fp-.js";import"./diff-UJJ5BM9S.js";import"./dtd-DI9Herc-.js";import"./dylan-DkEP81N9.js";import"./ecl-DPFc0Uaf.js";import"./eiffel-DR5c0IrL.js";import"./elm-DompmV0j.js";import"./erlang-BuqgqA5h.js";import"./factor-CFXhaUWb.js";import"./simple-mode-C3vEBAcb.js";import"./forth-POgR1ypr.js";import"./fortran-DL7KluxX.js";import"./mllike-3c2dg9RT.js";import"./gas-bV0CklSb.js";import"./gherkin-B6X1vGSW.js";import"./groovy-DnIzCrpZ.js";import"./haskell-CLQs6EAM.js";import"./haxe-D25e-2l-.js";import"./idl-pcmmZuaN.js";import"./javascript-BpzJj0-u.js";import"./jinja2-DhgKlfW7.js";import"./julia-DjdwvFuI.js";import"./livescript-HO6ttBFx.js";import"./lua-8DXOpKDz.js";import"./mirc-DkvFAiy5.js";import"./mathematica-IIbmv7SK.js";import"./modelica-DSrSSXCg.js";import"./mumps-zvxmGV4l.js";import"./mbox-z_N2Mo3d.js";import"./nsis-BvKfQ9lQ.js";import"./ntriples-BSwWqoLa.js";import"./octave-C4hdQ5Hf.js";import"./oz-qQq7irPq.js";import"./pascal-CafrKXZF.js";import"./perl-tdMlh9QA.js";import"./pig-CwGJVRC4.js";import"./powershell-D1ly3AHC.js";import"./properties-_nPj978X.js";import"./protobuf-B4y9do6W.js";import"./pug-BTvK5tSS.js";import"./puppet-Bc-yJKzi.js";import"./q-B0kTJ4cI.js";import"./r-BA4EbLKE.js";import"./rpm-DI_rRufH.js";import"./ruby-CR-u2WLS.js";import"./sas-Bqaci40L.js";import"./scheme-qjP0V5Ag.js";import"./shell-BLav31RL.js";import"./sieve-r025o_jW.js";import"./smalltalk-C7J3IyEP.js";import"./sparql-BRLJFz69.js";import"./stylus-Bdo_Aemu.js";import"./swift-B_XXVlXX.js";import"./verilog-B4LBqg_1.js";import"./tcl-B2fODqDH.js";import"./textile-BuVhTOzU.js";import"./toml-wcPdHu67.js";import"./troff-Ce85hlLp.js";import"./ttcn-BxnYHtq8.js";import"./ttcn-cfg-CKJxb-l2.js";import"./turtle-BkSuIpt-.js";import"./webidl-CGwyPRYs.js";import"./vb-BHgjm0DN.js";import"./vbscript-Dawdd5GZ.js";import"./velocity-BdD_26Jv.js";import"./vhdl-CWWH2SUo.js";import"./xquery-CVDBqZPY.js";import"./yacas-I8QjZlxf.js";import"./z80-D8p3gKXp.js";import"./mscgen-B2igx18G.js";import"./index-SPslPC2B.js";import"./trash--tonOuDe.js";import"./_createAggregator-VFK9K2d9.js";import{__tla as le}from"./loro_wasm_bg-C1ks32Vm.js";let k,me=Promise.all([(()=>{try{return ee}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return ie}catch{}})(),(()=>{try{return le}catch{}})()]).then(async()=>{const B=V("square-equal",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 10h10",key:"1101jm"}],["path",{d:"M7 14h10",key:"1mhdw3"}]]),f="name",g="type-value",x="defs-refs",S=[{id:f,accessorFn:r=>[r.name,r.declaredBy],enableSorting:!0,sortingFn:"alphanumeric",header:({column:r})=>e.jsx(h,{header:"Name",column:r}),cell:({getValue:r})=>{const[t,s]=r();return e.jsx(re,{name:t,declaredBy:s})}},{id:g,accessorFn:r=>[r.dataType,r.value],enableSorting:!0,sortingFn:"alphanumeric",header:({column:r})=>e.jsx(h,{header:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{children:"Type"}),e.jsx("span",{children:"Value"})]}),column:r}),cell:({getValue:r})=>{const[t,s]=r();return e.jsxs("div",{className:"max-w-[150px]",children:[e.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs",children:t}),e.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap",title:s??"",children:s})]})}},{id:x,accessorFn:r=>[r.declaredBy,r.usedBy,r.name,r.declaredByNames,r.usedByNames],enableSorting:!0,sortingFn:"basic",header:({column:r})=>e.jsx(h,{header:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{children:"Declared By"}),e.jsx("span",{children:"Used By"})]}),column:r}),cell:({getValue:r})=>{const[t,s,i]=r(),l=m=>{const c=J(m);c&&K(c,i)};return e.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[e.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-center",children:[e.jsx("span",{title:"Declared by",children:e.jsx(B,{className:"w-3.5 h-3.5 text-muted-foreground"})}),t.length===1?e.jsx(C,{variant:"focus",cellId:t[0],skipScroll:!0,onClick:()=>l(t[0])}):e.jsx("div",{className:"text-destructive flex flex-row gap-2",children:t.slice(0,3).map((m,c)=>e.jsxs("span",{className:"flex",children:[e.jsx(C,{variant:"focus",cellId:m,skipScroll:!0,className:"whitespace-nowrap text-destructive",onClick:()=>l(m)},m),c<t.length-1&&", "]},m))})]}),e.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-baseline",children:[e.jsx("span",{title:"Used by",children:e.jsx(ae,{className:"w-3.5 h-3.5 text-muted-foreground"})}),e.jsx(te,{maxCount:3,cellIds:s,skipScroll:!0,onClick:l})]})]})}}],j=u.memo(({className:r,cellIds:t,variables:s})=>{const[i,l]=v.useState([]),[m,c]=v.useState(""),y=O(),{locale:I}=D(),w=u.useMemo(()=>{const o=a=>{const p=y[a];return A(p)?`cell-${t.indexOf(a)}`:p??`cell-${t.indexOf(a)}`};return Object.values(s).map(a=>({...a,declaredByNames:a.declaredBy.map(o),usedByNames:a.usedBy.map(o)}))},[s,y,t]),M=u.useMemo(()=>{const o=new Map;return t.forEach((a,p)=>o.set(a,p)),(function({variables:a,sort:p,cellIdToIndex:T}){p||(p={id:x,desc:!1});let n=[];switch(p.id){case f:n=b(a,d=>d.name);break;case g:n=b(a,d=>d.dataType);break;case x:n=b(a,d=>T.get(d.declaredBy[0]))}return p.desc?n.reverse():n})({variables:w,sort:i[0],cellIdToIndex:o})},[w,i,t]),N=G({data:M,columns:S,getCoreRowModel:P(),onGlobalFilterChange:c,getFilteredRowModel:q(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter:o=>o.columnDef.enableGlobalFilter??!0,globalFilterFn:"auto",manualSorting:!0,locale:I,onSortingChange:l,getSortedRowModel:R(),state:{sorting:i,globalFilter:m}});return e.jsxs(e.Fragment,{children:[e.jsx($,{className:"w-full",placeholder:"Search",value:m,onChange:o=>c(o.target.value)}),e.jsxs(U,{className:Y("w-full text-sm flex-1 border-separate border-spacing-0",r),children:[e.jsx(Z,{children:e.jsx(_,{className:"whitespace-nowrap text-xs",children:N.getFlatHeaders().map(o=>e.jsx(z,{className:"sticky top-0 bg-background border-b",children:F(o.column.columnDef.header,o.getContext())},o.id))})}),e.jsx(E,{children:N.getRowModel().rows.map(o=>e.jsx(_,{className:"hover:bg-accent",children:o.getVisibleCells().map(a=>e.jsx(H,{className:"border-b",children:F(a.column.columnDef.cell,a.getContext())},a.id))},o.id))})]})]})});j.displayName="VariableTable",k=()=>{const r=L.c(4),t=Q(),s=W();if(Object.keys(t).length===0){let l;return r[0]===Symbol.for("react.memo_cache_sentinel")?(l=e.jsx(se,{title:"No variables",description:"Global variables will appear here.",icon:e.jsx(X,{})}),r[0]=l):l=r[0],l}let i;return r[1]!==s.inOrderIds||r[2]!==t?(i=e.jsx(j,{className:"flex-1",cellIds:s.inOrderIds,variables:t}),r[1]=s.inOrderIds,r[2]=t,r[3]=i):i=r[3],i}});export{me as __tla,k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{dR as Z,dS as H,a as F,b as W,dT as D,dU as G,j as g,E as C,u as $,r as j,dV as T,cP as N,dW as R,L as _,cw as V,dX as q,dY as J,aJ as U,dZ as X,aC as Y,aE as B}from"./index-C1SHFMCp.js";import{M as y}from"./compile-Bg8uJ7vm.js";import{a as Q}from"./VegaLite-BXQF0Cx_.js";import"./time-DDy3xv5Y.js";import"./timer-Bqd5yn_a.js";import"./linear-CLdOVPGV.js";import"./init-DLRA0X12.js";import"./range-CtcPcB_L.js";import"./zoom-COrs4lFh.js";import"./ordinal-DDUp3AbE.js";import"./colors-bszWmPJw.js";import"./step-BwsUM5iJ.js";import"./arc-Cuwikxov.js";import"./index-BEQfoZiP.js";import"./index-CU5rRr66.js";const z=new Set(["boxplot","errorband","errorbar"]),S={getMarkType(t){const e=typeof t=="string"?t:t.type;if(z.has(e))throw new Error("Not supported");return e},isInteractive(t){const e=typeof t=="string"?t:t.type;return!z.has(e)},makeClickable(t){const e=typeof t=="string"?t:t.type;return e in y?typeof t=="string"?{type:t,cursor:"pointer",tooltip:!0}:{...t,type:e,cursor:"pointer",tooltip:!0}:t},getOpacity:t=>typeof t=="string"?null:"opacity"in t&&typeof t.opacity=="number"?t.opacity:null},tt=new Set(["color","fill","fillOpacity","opacity","shape","size"]);function et(t,e,r,i){const u={and:r.map(d=>({param:d}))};if(t==="opacity"){const d=S.getOpacity(i)||1;return{...e,opacity:{condition:{test:u,value:d},value:d/5}}}return e}const w={point:t=>t==null?"select_point":`select_point_${t}`,interval:t=>t==null?"select_interval":`select_interval_${t}`,legendSelection:t=>`legend_selection_${t}`,HIGHLIGHT:"highlight",PAN_ZOOM:"pan_zoom",hasPoint:t=>t.some(e=>e.startsWith("select_point")),hasInterval:t=>t.some(e=>e.startsWith("select_interval")),hasLegend:t=>t.some(e=>e.startsWith("legend_selection")),hasPanZoom:t=>t.some(e=>e.startsWith("pan_zoom"))},P={highlight:()=>({name:w.HIGHLIGHT,select:{type:"point",on:"mouseover"}}),interval:(t,e)=>({name:w.interval(e),select:{type:"interval",encodings:K(t),mark:{fill:"#669EFF",fillOpacity:.07,stroke:"#669EFF",strokeOpacity:.4},on:"[mousedown[!event.metaKey], mouseup] > mousemove[!event.metaKey]",translate:"[mousedown[!event.metaKey], mouseup] > mousemove[!event.metaKey]"}}),point:(t,e)=>({name:w.point(e),select:{type:"point",encodings:K(t),on:"click[!event.metaKey]"}}),legend:t=>({name:w.legendSelection(t),select:{type:"point",fields:[t]},bind:"legend"}),panZoom:()=>({name:w.PAN_ZOOM,bind:"scales",select:{type:"interval",on:"[mousedown[event.metaKey], window:mouseup] > window:mousemove!",translate:"[mousedown[event.metaKey], window:mouseup] > window:mousemove!",zoom:"wheel![event.metaKey]"}})};function K(t){switch(S.getMarkType(t.mark)){case y.image:case y.trail:return;case y.area:case y.arc:return["color"];case y.bar:{const e=(function(r){var d,l;if(!r||!("mark"in r))return;const i=(d=r.encoding)==null?void 0:d.x,u=(l=r.encoding)==null?void 0:l.y;if(i&&"type"in i&&i.type==="nominal")return"vertical";if(u&&"type"in u&&u.type==="nominal"||i&&"aggregate"in i)return"horizontal";if(u&&"aggregate"in u)return"vertical"})(t);return e==="horizontal"?["y"]:e==="vertical"?["x"]:void 0}case y.circle:case y.geoshape:case y.line:case y.point:case y.rect:case y.rule:case y.square:case y.text:case y.tick:return["x","y"]}}function A(t){return"params"in t&&t.params&&t.params.length>0?t.params.filter(e=>e!=null&&"select"in e&&e.select!==void 0).map(e=>e.name):"layer"in t?[...new Set(t.layer.flatMap(A))]:[]}function at(t,e){var f,v;let{chartSelection:r=!0,fieldSelection:i=!0}=e;if(!r&&!i)return t;if(((f=t.params)==null?void 0:f.some(c=>c.bind==="legend"))&&(i=!1),((v=t.params)==null?void 0:v.some(c=>!c.bind))&&(r=!1),"vconcat"in t){const c=t.vconcat.map(o=>"mark"in o?O(o):o);return{...t,vconcat:c}}if("hconcat"in t){const c=t.hconcat.map(o=>"mark"in o?O(o):o);return{...t,hconcat:c}}if("layer"in t){const c=t.layer.map((o,p)=>{if(!("mark"in o))return o;let s=o;return s=L(s,r,p),s=O(s),p===0&&(s=E(s)),s});return{...t,layer:c}}if(!("mark"in t)||!S.isInteractive(t.mark))return t;let l=t;return l=(function(c,o){if(o===!1)return c;let p=(function(h){if(!h||!("encoding"in h))return[];const{encoding:b}=h;return b?Object.entries(b).flatMap(a=>{const[n,m]=a;return m&&tt.has(n)?"field"in m&&typeof m.field=="string"?[m.field]:"condition"in m&&m.condition&&typeof m.condition=="object"&&"field"in m.condition&&m.condition.field&&typeof m.condition.field=="string"?[m.condition.field]:[]:[]}):[]})(c);Array.isArray(o)&&(p=p.filter(h=>o.includes(h)));const s=p.map(h=>P.legend(h)),x=[...c.params||[],...s];return{...c,params:x}})(l,i),l=L(l,r,void 0),l=O(l),l=E(l),l}function L(t,e,r){if(e===!1)return t;let i;try{i=S.getMarkType(t.mark)}catch{return t}if(i==="geoshape")return t;const u=e===!0?(function(f){switch(f){case"arc":case"area":return["point"];case"text":case"bar":default:return["point","interval"];case"line":return}})(i):[e];if(!u)return t;const d=u.map(f=>f==="interval"?P.interval(t,r):P.point(t,r)),l=[...t.params||[],...d];return{...t,params:l}}function E(t){let e;try{e=S.getMarkType(t.mark)}catch{}if(e==="geoshape")return t;const r=t.params||[];return r.some(i=>i.bind==="scales")?t:{...t,params:[...r,P.panZoom()]}}function O(t){const e="encoding"in t?t.encoding:void 0,r=t.params||[],i=r.map(u=>u.name);return r.length===0?t:S.isInteractive(t.mark)?{...t,mark:S.makeClickable(t.mark),encoding:et("opacity",e||{},i,t.mark)}:t}D("arrow",G);const nt=t=>{const e=F.c(11),{value:r,setValue:i,chartSelection:u,fieldSelection:d,spec:l}=t;let f,v;e[0]!==l?(f=async()=>(async function(s){if(!s)return s;const x="datasets"in s?{...s.datasets}:{},h=async a=>{if(!a)return a;if("layer"in a){const k=await Promise.all(a.layer.map(h));a={...a,layer:k}}if("hconcat"in a){const k=await Promise.all(a.hconcat.map(h));a={...a,hconcat:k}}if("vconcat"in a){const k=await Promise.all(a.vconcat.map(h));a={...a,vconcat:k}}if("spec"in a&&(a={...a,spec:await h(a.spec)}),!a.data||!("url"in a.data))return a;let n;try{n=Z(a.data.url)}catch{return a}const m=await H(n.href,a.data.format);return x[n.pathname]=m,{...a,data:{name:n.pathname}}},b=await h(s);return Object.keys(x).length===0?b:{...b,datasets:x}})(l),v=[l],e[0]=l,e[1]=f,e[2]=v):(f=e[1],v=e[2]);const{data:c,error:o}=W(f,v);if(o){let s;return e[3]!==o?(s=g.jsx(C,{error:o}),e[3]=o,e[4]=s):s=e[4],s}if(!c)return null;let p;return e[5]!==u||e[6]!==d||e[7]!==c||e[8]!==i||e[9]!==r?(p=g.jsx(rt,{value:r,setValue:i,chartSelection:u,fieldSelection:d,spec:c}),e[5]=u,e[6]=d,e[7]=c,e[8]=i,e[9]=r,e[10]=p):p=e[10],p},rt=({value:t,setValue:e,chartSelection:r,fieldSelection:i,spec:u})=>{const{theme:d}=$(),l=j.useRef(void 0),[f,v]=j.useState(),c=T(u),o=j.useMemo(()=>at((function(n){return n.data&&"url"in n.data&&(n.data.url=Z(n.data.url).href),n})(c),{chartSelection:r,fieldSelection:i}),[c,r,i]),p=j.useMemo(()=>A(o),[o]),s=N(n=>{e({...t,...n})}),x=T(p),h=j.useMemo(()=>x.reduce((n,m)=>(w.PAN_ZOOM===m||(n[m]=R((k,I)=>{_.debug("[Vega signal]",k,I);let M=V.mapValues(I,st);M=V.mapValues(M,ot),s({[k]:M})},100)),n),{}),[x,s]),b=N(n=>{_.error(n),_.debug(o),v(n)}),a=N(n=>{_.debug("[Vega view] created",n),l.current=n,v(void 0)});return g.jsxs(g.Fragment,{children:[f&&g.jsxs(q,{variant:"destructive",children:[g.jsx(J,{children:f.message}),g.jsx("div",{className:"text-md",children:f.stack})]}),g.jsxs("div",{className:"relative",onPointerDown:U.stopPropagation(),children:[g.jsx(Q,{spec:o,theme:d==="dark"?"dark":void 0,actions:it,signalListeners:h,onError:b,onNewView:a}),(()=>{const n=[];return w.hasPoint(p)&&n.push(["Point selection","click to select a point; hold shift for multi-select"]),w.hasInterval(p)&&n.push(["Interval selection","click and drag to select an interval"]),w.hasLegend(p)&&n.push(["Legend selection","click to select a legend item; hold shift for multi-select"]),w.hasPanZoom(p)&&n.push(["Pan","hold the meta key and drag"],["Zoom","hold the meta key and scroll"]),n.length===0?null:g.jsx(Y,{delayDuration:300,side:"left",content:g.jsx("div",{className:"text-xs flex flex-col",children:n.map((m,k)=>g.jsxs("div",{children:[g.jsxs("span",{className:"font-bold tracking-wide",children:[m[0],":"]})," ",m[1]]},k))}),children:g.jsx(B,{className:"absolute bottom-1 right-0 m-2 h-4 w-4 cursor-help text-muted-foreground hover:text-foreground"})})})()]})]})},it={source:!1,compiled:!1};function ot(t){return t instanceof Set?[...t]:t}function st(t){return Array.isArray(t)?t.map(e=>e instanceof Date&&X(e)?new Date(e).getTime():e):t}export{nt as default};
|
package/dist/assets/{xychartDiagram-6GGTOJPD-WFtXqaM9.js → xychartDiagram-6GGTOJPD-BZ8WOb_8.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var G,j,Q,K,q,Z,J,tt,it,et;import{_ as a,s as hi,g as oi,t as It,q as ri,a as li,b as ci,l as $t,K as gi,d as ui,z as xi,G as ft,F as Bt,H as di,M as pi,h as fi,ac as mi}from"./mermaid.core-
|
|
1
|
+
var G,j,Q,K,q,Z,J,tt,it,et;import{_ as a,s as hi,g as oi,t as It,q as ri,a as li,b as ci,l as $t,K as gi,d as ui,z as xi,G as ft,F as Bt,H as di,M as pi,h as fi,ac as mi}from"./mermaid.core-CfukBvGI.js";import"./transform-D9VCJYws.js";import{i as yi}from"./init-DLRA0X12.js";import{o as bi}from"./ordinal-DDUp3AbE.js";import{r as Ai}from"./range-CtcPcB_L.js";import{l as zt}from"./linear-CLdOVPGV.js";import{l as Ot}from"./step-BwsUM5iJ.js";import"./index-C1SHFMCp.js";import"./isEmpty-CnOLuQIv.js";import"./timer-Bqd5yn_a.js";function mt(){var e,t,i=bi().unknown(void 0),s=i.domain,n=i.range,c=0,g=1,p=!1,d=0,_=0,L=.5;function S(){var y=s().length,E=g<c,D=E?g:c,P=E?c:g;e=(P-D)/Math.max(1,y-d+2*_),p&&(e=Math.floor(e)),D+=(P-D-e*(y-d))*L,t=e*(1-d),p&&(D=Math.round(D),t=Math.round(t));var M=Ai(y).map(function(f){return D+e*f});return n(E?M.reverse():M)}return delete i.unknown,i.domain=function(y){return arguments.length?(s(y),S()):s()},i.range=function(y){return arguments.length?([c,g]=y,c=+c,g=+g,S()):[c,g]},i.rangeRound=function(y){return[c,g]=y,c=+c,g=+g,p=!0,S()},i.bandwidth=function(){return t},i.step=function(){return e},i.round=function(y){return arguments.length?(p=!!y,S()):p},i.padding=function(y){return arguments.length?(d=Math.min(1,_=+y),S()):d},i.paddingInner=function(y){return arguments.length?(d=Math.min(1,y),S()):d},i.paddingOuter=function(y){return arguments.length?(_=+y,S()):_},i.align=function(y){return arguments.length?(L=Math.max(0,Math.min(1,y)),S()):L},i.copy=function(){return mt(s(),[c,g]).round(p).paddingInner(d).paddingOuter(_).align(L)},yi.apply(S(),arguments)}var yt=(function(){var e=a(function(h,b,u,x){for(u=u||{},x=h.length;x--;u[h[x]]=b);return u},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],c=[1,6],g=[1,7],p=[1,5,10,12,14,16,18,19,21,23,34,35,36],d=[1,25],_=[1,26],L=[1,28],S=[1,29],y=[1,30],E=[1,31],D=[1,32],P=[1,33],M=[1,34],f=[1,35],k=[1,36],l=[1,37],z=[1,43],O=[1,42],Y=[1,47],F=[1,50],r=[1,10,12,14,16,18,19,21,23,34,35,36],v=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],C=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],T=[1,64],st={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:a(function(h,b,u,x,w,o,nt){var m=o.length-1;switch(w){case 5:x.setOrientation(o[m]);break;case 9:x.setDiagramTitle(o[m].text.trim());break;case 12:x.setLineData({text:"",type:"text"},o[m]);break;case 13:x.setLineData(o[m-1],o[m]);break;case 14:x.setBarData({text:"",type:"text"},o[m]);break;case 15:x.setBarData(o[m-1],o[m]);break;case 16:this.$=o[m].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=o[m].trim(),x.setAccDescription(this.$);break;case 19:case 27:this.$=o[m-1];break;case 20:this.$=[Number(o[m-2]),...o[m]];break;case 21:this.$=[Number(o[m])];break;case 22:x.setXAxisTitle(o[m]);break;case 23:x.setXAxisTitle(o[m-1]);break;case 24:x.setXAxisTitle({type:"text",text:""});break;case 25:x.setXAxisBand(o[m]);break;case 26:x.setXAxisRangeData(Number(o[m-2]),Number(o[m]));break;case 28:this.$=[o[m-2],...o[m]];break;case 29:this.$=[o[m]];break;case 30:x.setYAxisTitle(o[m]);break;case 31:x.setYAxisTitle(o[m-1]);break;case 32:x.setYAxisTitle({type:"text",text:""});break;case 33:x.setYAxisRangeData(Number(o[m-2]),Number(o[m]));break;case 37:case 38:this.$={text:o[m],type:"text"};break;case 39:this.$={text:o[m],type:"markdown"};break;case 40:this.$=o[m];break;case 41:this.$=o[m-1]+""+o[m]}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,34:n,35:c,36:g}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,34:n,35:c,36:g}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:c,36:g}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(p,[2,34]),e(p,[2,35]),e(p,[2,36]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,34:n,35:c,36:g}),{1:[2,3]},e(p,[2,5]),e(t,[2,7],{4:22,34:n,35:c,36:g}),{11:23,37:24,38:d,39:_,40:27,41:L,42:S,43:y,44:E,45:D,46:P,47:M,48:f,49:k,50:l},{11:39,13:38,24:z,27:O,29:40,30:41,37:24,38:d,39:_,40:27,41:L,42:S,43:y,44:E,45:D,46:P,47:M,48:f,49:k,50:l},{11:45,15:44,27:Y,33:46,37:24,38:d,39:_,40:27,41:L,42:S,43:y,44:E,45:D,46:P,47:M,48:f,49:k,50:l},{11:49,17:48,24:F,37:24,38:d,39:_,40:27,41:L,42:S,43:y,44:E,45:D,46:P,47:M,48:f,49:k,50:l},{11:52,17:51,24:F,37:24,38:d,39:_,40:27,41:L,42:S,43:y,44:E,45:D,46:P,47:M,48:f,49:k,50:l},{20:[1,53]},{22:[1,54]},e(r,[2,18]),{1:[2,2]},e(r,[2,8]),e(r,[2,9]),e(v,[2,37],{40:55,41:L,42:S,43:y,44:E,45:D,46:P,47:M,48:f,49:k,50:l}),e(v,[2,38]),e(v,[2,39]),e(C,[2,40]),e(C,[2,42]),e(C,[2,43]),e(C,[2,44]),e(C,[2,45]),e(C,[2,46]),e(C,[2,47]),e(C,[2,48]),e(C,[2,49]),e(C,[2,50]),e(C,[2,51]),e(r,[2,10]),e(r,[2,22],{30:41,29:56,24:z,27:O}),e(r,[2,24]),e(r,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:d,39:_,40:27,41:L,42:S,43:y,44:E,45:D,46:P,47:M,48:f,49:k,50:l},e(r,[2,11]),e(r,[2,30],{33:60,27:Y}),e(r,[2,32]),{31:[1,61]},e(r,[2,12]),{17:62,24:F},{25:63,27:T},e(r,[2,14]),{17:65,24:F},e(r,[2,16]),e(r,[2,17]),e(C,[2,41]),e(r,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(r,[2,31]),{27:[1,69]},e(r,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(r,[2,15]),e(r,[2,26]),e(r,[2,27]),{11:59,32:72,37:24,38:d,39:_,40:27,41:L,42:S,43:y,44:E,45:D,46:P,47:M,48:f,49:k,50:l},e(r,[2,33]),e(r,[2,19]),{25:73,27:T},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:a(function(h,b){if(!b.recoverable){var u=new Error(h);throw u.hash=b,u}this.trace(h)},"parseError"),parse:a(function(h){var b=this,u=[0],x=[],w=[null],o=[],nt=this.table,m="",rt=0,Lt=0,ni=o.slice.call(arguments,1),R=Object.create(this.lexer),N={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(N.yy[dt]=this.yy[dt]);R.setInput(h,N.yy),N.yy.lexer=R,N.yy.parser=this,R.yylloc===void 0&&(R.yylloc={});var pt=R.yylloc;o.push(pt);var ai=R.options&&R.options.ranges;function Pt(){var B;return typeof(B=x.pop()||R.lex()||1)!="number"&&(B instanceof Array&&(B=(x=B).pop()),B=b.symbols_[B]||B),B}typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,a(function(B){u.length=u.length-2*B,w.length=w.length-B,o.length=o.length-B},"popStack"),a(Pt,"lex");for(var I,V,$,vt,lt,W,Et,ct,H={};;){if(V=u[u.length-1],this.defaultActions[V]?$=this.defaultActions[V]:(I==null&&(I=Pt()),$=nt[V]&&nt[V][I]),$===void 0||!$.length||!$[0]){var Mt="";for(lt in ct=[],nt[V])this.terminals_[lt]&<>2&&ct.push("'"+this.terminals_[lt]+"'");Mt=R.showPosition?"Parse error on line "+(rt+1)+`:
|
|
2
2
|
`+R.showPosition()+`
|
|
3
3
|
Expecting `+ct.join(", ")+", got '"+(this.terminals_[I]||I)+"'":"Parse error on line "+(rt+1)+": Unexpected "+(I==1?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Mt,{text:R.match,token:this.terminals_[I]||I,line:R.yylineno,loc:pt,expected:ct})}if($[0]instanceof Array&&$.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+I);switch($[0]){case 1:u.push(I),w.push(R.yytext),o.push(R.yylloc),u.push($[1]),I=null,Lt=R.yyleng,m=R.yytext,rt=R.yylineno,pt=R.yylloc;break;case 2:if(W=this.productions_[$[1]][1],H.$=w[w.length-W],H._$={first_line:o[o.length-(W||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(W||1)].first_column,last_column:o[o.length-1].last_column},ai&&(H._$.range=[o[o.length-(W||1)].range[0],o[o.length-1].range[1]]),(vt=this.performAction.apply(H,[m,Lt,rt,N.yy,$[1],w,o].concat(ni)))!==void 0)return vt;W&&(u=u.slice(0,-1*W*2),w=w.slice(0,-1*W),o=o.slice(0,-1*W)),u.push(this.productions_[$[1]][0]),w.push(H.$),o.push(H._$),Et=nt[u[u.length-2]][u[u.length-1]],u.push(Et);break;case 3:return!0}}return!0},"parse")},ot=(function(){return{EOF:1,parseError:a(function(h,b){if(!this.yy.parser)throw new Error(h);this.yy.parser.parseError(h,b)},"parseError"),setInput:a(function(h,b){return this.yy=b||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var h=this._input[0];return this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h,h.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:a(function(h){var b=h.length,u=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),u.length-1&&(this.yylineno-=u.length-1);var w=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:u?(u.length===x.length?this.yylloc.first_column:0)+x[x.length-u.length].length-u[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[w[0],w[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:a(function(h){this.unput(this.match.slice(h))},"less"),pastInput:a(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var h=this.pastInput(),b=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
|
package/dist/index.html
CHANGED
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
var scrollbarHeight = 20; // Max between windows, mac, and linux
|
|
27
27
|
|
|
28
28
|
function setHeight() {
|
|
29
|
+
// Guard against race condition where iframe isn't ready
|
|
30
|
+
if (!obj.contentWindow?.document?.documentElement) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
29
33
|
var element = obj.contentWindow.document.documentElement;
|
|
30
34
|
// If there is no vertical scrollbar, we don't need to resize the iframe
|
|
31
35
|
if (element.scrollHeight === element.clientHeight) {
|
|
@@ -49,7 +53,10 @@
|
|
|
49
53
|
const resizeObserver = new ResizeObserver((entries) => {
|
|
50
54
|
setHeight();
|
|
51
55
|
});
|
|
52
|
-
|
|
56
|
+
// Only observe if iframe content is ready
|
|
57
|
+
if (obj.contentWindow?.document?.body) {
|
|
58
|
+
resizeObserver.observe(obj.contentWindow.document.body);
|
|
59
|
+
}
|
|
53
60
|
}
|
|
54
61
|
</script>
|
|
55
62
|
<marimo-filename hidden>{{ filename }}</marimo-filename>
|
|
@@ -59,8 +66,8 @@
|
|
|
59
66
|
<marimo-server-token data-token="{{ server_token }}" hidden></marimo-server-token>
|
|
60
67
|
<!-- /TODO -->
|
|
61
68
|
<title>{{ title }}</title>
|
|
62
|
-
<script type="module" crossorigin src="./assets/index-
|
|
63
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
69
|
+
<script type="module" crossorigin src="./assets/index-C1SHFMCp.js"></script>
|
|
70
|
+
<link rel="stylesheet" crossorigin href="./assets/index-C0iXCvyY.css">
|
|
64
71
|
</head>
|
|
65
72
|
<body>
|
|
66
73
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marimo-team/frontend",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.3",
|
|
4
4
|
"main": "dist/main.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@marimo-team/codemirror-ai": "^0.3.2",
|
|
53
53
|
"@marimo-team/codemirror-languageserver": "1.15.24",
|
|
54
54
|
"@marimo-team/codemirror-mcp": "^0.1.5",
|
|
55
|
-
"@marimo-team/codemirror-sql": "^0.2.
|
|
55
|
+
"@marimo-team/codemirror-sql": "^0.2.3",
|
|
56
56
|
"@marimo-team/llm-info": "workspace:*",
|
|
57
57
|
"@marimo-team/marimo-api": "workspace:*",
|
|
58
58
|
"@marimo-team/react-slotz": "^0.2.0",
|
|
@@ -205,9 +205,9 @@
|
|
|
205
205
|
"@codecov/vite-plugin": "^1.9.1",
|
|
206
206
|
"@csstools/postcss-light-dark-function": "^2.0.10",
|
|
207
207
|
"@playwright/test": "^1.55.0",
|
|
208
|
-
"@storybook/addon-docs": "^9.1.
|
|
209
|
-
"@storybook/addon-links": "^9.1.
|
|
210
|
-
"@storybook/react-vite": "^9.1.
|
|
208
|
+
"@storybook/addon-docs": "^9.1.8",
|
|
209
|
+
"@storybook/addon-links": "^9.1.8",
|
|
210
|
+
"@storybook/react-vite": "^9.1.8",
|
|
211
211
|
"@swc-jotai/react-refresh": "^0.3.0",
|
|
212
212
|
"@testing-library/jest-dom": "^6.8.0",
|
|
213
213
|
"@testing-library/react": "^16.3.0",
|
|
@@ -242,11 +242,11 @@
|
|
|
242
242
|
"react": "^19.1.1",
|
|
243
243
|
"react-compiler-runtime": "19.1.0-rc.3",
|
|
244
244
|
"react-dom": "^19.1.1",
|
|
245
|
-
"storybook": "^9.1.
|
|
245
|
+
"storybook": "^9.1.8",
|
|
246
246
|
"stylelint": "^16.23.1",
|
|
247
247
|
"stylelint-config-standard": "^36.0.1",
|
|
248
|
-
"tailwindcss": "^4.1.
|
|
249
|
-
"vite": "^6.3.
|
|
248
|
+
"tailwindcss": "^4.1.13",
|
|
249
|
+
"vite": "^6.3.6",
|
|
250
250
|
"vite-plugin-top-level-await": "^1.6.0",
|
|
251
251
|
"vite-plugin-wasm": "^3.5.0",
|
|
252
252
|
"vite-tsconfig-paths": "^5.1.4",
|
package/src/__mocks__/common.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
|
-
|
|
2
|
+
/** biome-ignore-all lint/suspicious/noConsole: for debugging */
|
|
3
3
|
import { type Mock, vi } from "vitest";
|
|
4
4
|
import { invariant } from "@/utils/invariant";
|
|
5
5
|
|
|
@@ -108,8 +108,10 @@ export const SetupMocks = {
|
|
|
108
108
|
delete store[key];
|
|
109
109
|
}),
|
|
110
110
|
clear: vi.fn(() => {
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
for (const key of Object.keys(store)) {
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
113
|
+
delete store[key];
|
|
114
|
+
}
|
|
113
115
|
}),
|
|
114
116
|
key: vi.fn((index: number) => Object.keys(store)[index] || null),
|
|
115
117
|
get length() {
|
|
@@ -134,11 +134,11 @@ export const MockNotebook = {
|
|
|
134
134
|
* Create a notebook state with error outputs for testing ErrorContextProvider
|
|
135
135
|
*/
|
|
136
136
|
notebookStateWithErrors: (
|
|
137
|
-
errors:
|
|
137
|
+
errors: {
|
|
138
138
|
cellId: CellId;
|
|
139
139
|
cellName: string;
|
|
140
140
|
errorData: MarimoError[];
|
|
141
|
-
}
|
|
141
|
+
}[],
|
|
142
142
|
): NotebookState => {
|
|
143
143
|
const cellData: Record<string, Partial<CellData>> = {};
|
|
144
144
|
|
|
@@ -40,6 +40,7 @@ export const MockRequestClient = {
|
|
|
40
40
|
previewSQLTable: vi.fn().mockResolvedValue({}),
|
|
41
41
|
previewSQLTableList: vi.fn().mockResolvedValue({ tables: [] }),
|
|
42
42
|
previewDataSourceConnection: vi.fn().mockResolvedValue({}),
|
|
43
|
+
validateSQL: vi.fn().mockResolvedValue({}),
|
|
43
44
|
openFile: vi.fn().mockResolvedValue({}),
|
|
44
45
|
getUsageStats: vi.fn().mockResolvedValue({}),
|
|
45
46
|
sendPdb: vi.fn().mockResolvedValue({}),
|
|
@@ -23,7 +23,7 @@ vi.mock("../utils/vitals", () => ({
|
|
|
23
23
|
}));
|
|
24
24
|
|
|
25
25
|
vi.mock("react-dom/client", () => ({
|
|
26
|
-
createRoot: vi.fn().mockImplementation((
|
|
26
|
+
createRoot: vi.fn().mockImplementation((_el) => {
|
|
27
27
|
return {
|
|
28
28
|
render: vi.fn(),
|
|
29
29
|
};
|
|
@@ -47,7 +47,7 @@ describe("main", () => {
|
|
|
47
47
|
|
|
48
48
|
it.each(["edit", "read", "home", "run"])(
|
|
49
49
|
"should mount with mode %s",
|
|
50
|
-
(
|
|
50
|
+
(_mode) => {
|
|
51
51
|
const el = document.createElement("div");
|
|
52
52
|
mount({ mode: "edit" }, el);
|
|
53
53
|
|
|
@@ -8,6 +8,7 @@ import GitHubIcon from "@marimo-team/llm-info/icons/github.svg?inline";
|
|
|
8
8
|
import GeminiIcon from "@marimo-team/llm-info/icons/googlegemini.svg?inline";
|
|
9
9
|
import OllamaIcon from "@marimo-team/llm-info/icons/ollama.svg?inline";
|
|
10
10
|
import OpenAIIcon from "@marimo-team/llm-info/icons/openai.svg?inline";
|
|
11
|
+
import OpenRouterIcon from "@marimo-team/llm-info/icons/openrouter.svg?inline";
|
|
11
12
|
import { BotIcon } from "lucide-react";
|
|
12
13
|
import * as React from "react";
|
|
13
14
|
import type { ProviderId } from "@/core/ai/ids/ids";
|
|
@@ -27,6 +28,7 @@ const icons: Record<ProviderId | Aliases, string> = {
|
|
|
27
28
|
bedrock: BedrockIcon,
|
|
28
29
|
deepseek: DeepseekIcon,
|
|
29
30
|
github: GitHubIcon,
|
|
31
|
+
openrouter: OpenRouterIcon,
|
|
30
32
|
marimo: marimoIcon,
|
|
31
33
|
};
|
|
32
34
|
|
|
@@ -734,6 +734,36 @@ export const AiProvidersConfig: React.FC<AiConfigProps> = ({
|
|
|
734
734
|
/>
|
|
735
735
|
</AccordionFormItem>
|
|
736
736
|
|
|
737
|
+
<AccordionFormItem
|
|
738
|
+
title="OpenRouter"
|
|
739
|
+
provider="openrouter"
|
|
740
|
+
isConfigured={hasValue("ai.openrouter.api_key")}
|
|
741
|
+
>
|
|
742
|
+
<ApiKey
|
|
743
|
+
form={form}
|
|
744
|
+
config={config}
|
|
745
|
+
name="ai.openrouter.api_key"
|
|
746
|
+
placeholder="or-..."
|
|
747
|
+
testId="ai-openrouter-api-key-input"
|
|
748
|
+
description={
|
|
749
|
+
<>
|
|
750
|
+
Your OpenRouter API key from {""}
|
|
751
|
+
<ExternalLink href="https://openrouter.ai/keys">
|
|
752
|
+
openrouter.ai
|
|
753
|
+
</ExternalLink>
|
|
754
|
+
.
|
|
755
|
+
</>
|
|
756
|
+
}
|
|
757
|
+
/>
|
|
758
|
+
<BaseUrl
|
|
759
|
+
form={form}
|
|
760
|
+
config={config}
|
|
761
|
+
name="ai.openrouter.base_url"
|
|
762
|
+
placeholder="https://openrouter.ai/api/v1/"
|
|
763
|
+
testId="ai-openrouter-base-url-input"
|
|
764
|
+
/>
|
|
765
|
+
</AccordionFormItem>
|
|
766
|
+
|
|
737
767
|
<AccordionFormItem
|
|
738
768
|
title="Azure"
|
|
739
769
|
provider="azure"
|
|
@@ -761,7 +791,8 @@ export const AiProvidersConfig: React.FC<AiConfigProps> = ({
|
|
|
761
791
|
form={form}
|
|
762
792
|
config={config}
|
|
763
793
|
name="ai.azure.base_url"
|
|
764
|
-
placeholder="https://<your-resource-name>.openai.azure.com"
|
|
794
|
+
placeholder="https://<your-resource-name>.openai.azure.com/openai/deployments/<deployment-name>?api-version=<api-version>"
|
|
795
|
+
defaultValue="https://<your-resource-name>.openai.azure.com/openai/deployments/<deployment-name>?api-version=<api-version>"
|
|
765
796
|
testId="ai-azure-base-url-input"
|
|
766
797
|
/>
|
|
767
798
|
</AccordionFormItem>
|
|
@@ -36,10 +36,10 @@ export const SettingDescription: React.FC<PropsWithChildren> = ({
|
|
|
36
36
|
return <p className="text-sm text-muted-foreground">{children}</p>;
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
export const SQL_OUTPUT_SELECT_OPTIONS:
|
|
39
|
+
export const SQL_OUTPUT_SELECT_OPTIONS: {
|
|
40
40
|
label: string;
|
|
41
41
|
value: SqlOutputType;
|
|
42
|
-
}
|
|
42
|
+
}[] = [
|
|
43
43
|
{ label: "Auto (Default)", value: "auto" },
|
|
44
44
|
{ label: "Native", value: "native" },
|
|
45
45
|
{ label: "Polars", value: "polars" },
|
|
@@ -1359,6 +1359,32 @@ export const UserConfigForm: React.FC = () => {
|
|
|
1359
1359
|
</div>
|
|
1360
1360
|
)}
|
|
1361
1361
|
/>
|
|
1362
|
+
<FormField
|
|
1363
|
+
control={form.control}
|
|
1364
|
+
name="experimental.chat_modes"
|
|
1365
|
+
render={({ field }) => (
|
|
1366
|
+
<div className="flex flex-col gap-y-1">
|
|
1367
|
+
<FormItem className={formItemClasses}>
|
|
1368
|
+
<FormLabel className="font-normal">Chat Mode</FormLabel>
|
|
1369
|
+
<FormControl>
|
|
1370
|
+
<Checkbox
|
|
1371
|
+
data-testid="chat-mode-checkbox"
|
|
1372
|
+
checked={field.value === true}
|
|
1373
|
+
onCheckedChange={field.onChange}
|
|
1374
|
+
/>
|
|
1375
|
+
</FormControl>
|
|
1376
|
+
</FormItem>
|
|
1377
|
+
<IsOverridden
|
|
1378
|
+
userConfig={config}
|
|
1379
|
+
name="experimental.chat_modes"
|
|
1380
|
+
/>
|
|
1381
|
+
<FormDescription>
|
|
1382
|
+
Switch between different modes in the Chat sidebar, to
|
|
1383
|
+
enable tool use.
|
|
1384
|
+
</FormDescription>
|
|
1385
|
+
</div>
|
|
1386
|
+
)}
|
|
1387
|
+
/>
|
|
1362
1388
|
</SettingGroup>
|
|
1363
1389
|
);
|
|
1364
1390
|
}
|
|
@@ -528,7 +528,7 @@ export const CurrentModeBlock = (props: {
|
|
|
528
528
|
};
|
|
529
529
|
|
|
530
530
|
export const ToolNotificationsBlock = (props: {
|
|
531
|
-
data:
|
|
531
|
+
data: (ToolCallNotificationEvent | ToolCallUpdateNotificationEvent)[];
|
|
532
532
|
}) => {
|
|
533
533
|
const toolCalls = mergeToolCalls(props.data);
|
|
534
534
|
|
|
@@ -561,7 +561,7 @@ export const ToolNotificationsBlock = (props: {
|
|
|
561
561
|
};
|
|
562
562
|
|
|
563
563
|
export const DiffBlocks = (props: {
|
|
564
|
-
data:
|
|
564
|
+
data: Extract<ToolCallContent, { type: "diff" }>[];
|
|
565
565
|
}) => {
|
|
566
566
|
return (
|
|
567
567
|
<div className="flex flex-col gap-2 text-muted-foreground">
|
|
@@ -99,23 +99,21 @@ export const AgentThread = ({
|
|
|
99
99
|
|
|
100
100
|
function isErrorGroup(
|
|
101
101
|
group: NotificationEvent[],
|
|
102
|
-
): group is
|
|
102
|
+
): group is Extract<NotificationEvent, { type: "error" }>[] {
|
|
103
103
|
// We only check the first since we know the group is the same type
|
|
104
104
|
return group[0].type === "error";
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
function isConnectionChangeGroup(
|
|
108
108
|
group: NotificationEvent[],
|
|
109
|
-
): group is
|
|
109
|
+
): group is Extract<NotificationEvent, { type: "connection_change" }>[] {
|
|
110
110
|
// We only check the first since we know the group is the same type
|
|
111
111
|
return group[0].type === "connection_change";
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
function isSessionNotificationGroup(
|
|
115
115
|
group: NotificationEvent[],
|
|
116
|
-
): group is
|
|
117
|
-
Extract<NotificationEvent, { type: "session_notification" }>
|
|
118
|
-
> {
|
|
116
|
+
): group is Extract<NotificationEvent, { type: "session_notification" }>[] {
|
|
119
117
|
// We only check the first since we know the group is the same type
|
|
120
118
|
return group[0].type === "session_notification";
|
|
121
119
|
}
|
|
@@ -3,7 +3,7 @@ import type { NotificationDataOf, SessionNotificationEventData } from "./types";
|
|
|
3
3
|
|
|
4
4
|
export function isToolCalls(
|
|
5
5
|
group: SessionNotificationEventData[],
|
|
6
|
-
): group is
|
|
6
|
+
): group is NotificationDataOf<"tool_call" | "tool_call_update">[] {
|
|
7
7
|
// We only check the first since we know the group is the same type
|
|
8
8
|
const first = group[0];
|
|
9
9
|
return (
|
|
@@ -14,7 +14,7 @@ export function isToolCalls(
|
|
|
14
14
|
|
|
15
15
|
export function isAgentThoughts(
|
|
16
16
|
group: SessionNotificationEventData[],
|
|
17
|
-
): group is
|
|
17
|
+
): group is NotificationDataOf<"agent_thought_chunk">[] {
|
|
18
18
|
// We only check the first since we know the group is the same type
|
|
19
19
|
const first = group[0];
|
|
20
20
|
return first.sessionUpdate === "agent_thought_chunk";
|
|
@@ -22,7 +22,7 @@ export function isAgentThoughts(
|
|
|
22
22
|
|
|
23
23
|
export function isUserMessages(
|
|
24
24
|
group: SessionNotificationEventData[],
|
|
25
|
-
): group is
|
|
25
|
+
): group is NotificationDataOf<"user_message_chunk">[] {
|
|
26
26
|
// We only check the first since we know the group is the same type
|
|
27
27
|
const first = group[0];
|
|
28
28
|
return first.sessionUpdate === "user_message_chunk";
|
|
@@ -30,7 +30,7 @@ export function isUserMessages(
|
|
|
30
30
|
|
|
31
31
|
export function isAgentMessages(
|
|
32
32
|
group: SessionNotificationEventData[],
|
|
33
|
-
): group is
|
|
33
|
+
): group is NotificationDataOf<"agent_message_chunk">[] {
|
|
34
34
|
// We only check the first since we know the group is the same type
|
|
35
35
|
const first = group[0];
|
|
36
36
|
return first.sessionUpdate === "agent_message_chunk";
|
|
@@ -38,7 +38,7 @@ export function isAgentMessages(
|
|
|
38
38
|
|
|
39
39
|
export function isPlans(
|
|
40
40
|
group: SessionNotificationEventData[],
|
|
41
|
-
): group is
|
|
41
|
+
): group is NotificationDataOf<"plan">[] {
|
|
42
42
|
// We only check the first since we know the group is the same type
|
|
43
43
|
const first = group[0];
|
|
44
44
|
return first.sessionUpdate === "plan";
|
|
@@ -369,7 +369,7 @@ const ChatInputFooter: React.FC<ChatInputFooterProps> = memo(
|
|
|
369
369
|
<TooltipProvider>
|
|
370
370
|
<div className="px-3 py-2 border-t border-border/20 flex flex-row items-center justify-between">
|
|
371
371
|
<div className="flex items-center gap-2">
|
|
372
|
-
<FeatureFlagged feature="
|
|
372
|
+
<FeatureFlagged feature="chat_modes">
|
|
373
373
|
<Select value={currentMode} onValueChange={saveModeChange}>
|
|
374
374
|
<SelectTrigger className="h-6 text-xs border-border shadow-none! ring-0! bg-muted hover:bg-muted/30 py-0 px-2 gap-1 capitalize">
|
|
375
375
|
{currentMode}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { render } from "@testing-library/react";
|
|
4
4
|
import { describe, expect, it, test } from "vitest";
|
|
5
|
+
import { TooltipProvider } from "@/components/ui/tooltip";
|
|
5
6
|
import { generateColumns, inferFieldTypes } from "../columns";
|
|
6
7
|
import { getMimeValues, isMimeValue, MimeCell } from "../mime-cell";
|
|
7
8
|
import type { FieldTypesWithExternalType } from "../types";
|
|
@@ -245,6 +246,43 @@ describe("generateColumns", () => {
|
|
|
245
246
|
expect(columns[0].id).toBe("name");
|
|
246
247
|
expect(columns[1].id).toBe("age");
|
|
247
248
|
});
|
|
249
|
+
|
|
250
|
+
it("should render header with tooltip when headerTooltip is provided", () => {
|
|
251
|
+
const columns = generateColumns({
|
|
252
|
+
rowHeaders: [],
|
|
253
|
+
selection: null,
|
|
254
|
+
fieldTypes,
|
|
255
|
+
headerTooltip: { name: "Custom Name Tooltip" },
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
// Get the header function for the first column
|
|
259
|
+
const headerFunction = columns[0].header;
|
|
260
|
+
expect(headerFunction).toBeTypeOf("function");
|
|
261
|
+
|
|
262
|
+
const mockColumn = {
|
|
263
|
+
id: "name",
|
|
264
|
+
getCanSort: () => false,
|
|
265
|
+
getCanFilter: () => false,
|
|
266
|
+
columnDef: {
|
|
267
|
+
meta: {
|
|
268
|
+
dtype: "string",
|
|
269
|
+
dataType: "string",
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
const { container } = render(
|
|
275
|
+
<TooltipProvider>
|
|
276
|
+
{/* @ts-expect-error: mock column and header function */}
|
|
277
|
+
{headerFunction({ column: mockColumn })}
|
|
278
|
+
</TooltipProvider>,
|
|
279
|
+
);
|
|
280
|
+
|
|
281
|
+
expect(container.textContent).toContain("name");
|
|
282
|
+
// The tooltip functionality is tested by verifying that the header renders correctly
|
|
283
|
+
// when headerTooltip is provided.
|
|
284
|
+
expect(container.firstChild).toBeTruthy();
|
|
285
|
+
});
|
|
248
286
|
});
|
|
249
287
|
|
|
250
288
|
describe("MimeCell", () => {
|
|
@@ -18,7 +18,7 @@ describe("DataTable", () => {
|
|
|
18
18
|
{ id: 2, name: "Test 2" },
|
|
19
19
|
];
|
|
20
20
|
|
|
21
|
-
const columns:
|
|
21
|
+
const columns: ColumnDef<TestData>[] = [
|
|
22
22
|
{ accessorKey: "name", header: "Name" },
|
|
23
23
|
];
|
|
24
24
|
|
|
@@ -70,7 +70,7 @@ describe("DataTable", () => {
|
|
|
70
70
|
{ id: 2, first: "Jim", last: "Halpert" },
|
|
71
71
|
];
|
|
72
72
|
|
|
73
|
-
const columns:
|
|
73
|
+
const columns: ColumnDef<RowData>[] = [
|
|
74
74
|
{ accessorKey: "first", header: "First" },
|
|
75
75
|
{ accessorKey: "last", header: "Last" },
|
|
76
76
|
];
|
|
@@ -11,7 +11,7 @@ function createSpec(spec: {
|
|
|
11
11
|
encoding: Record<
|
|
12
12
|
string,
|
|
13
13
|
| { field: string; type?: string }
|
|
14
|
-
|
|
|
14
|
+
| { field: string; tooltip?: Record<string, string> }[]
|
|
15
15
|
>;
|
|
16
16
|
resolve?: Record<string, unknown>;
|
|
17
17
|
title?: string;
|