@marimo-team/frontend 0.16.2 → 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-B5cPvWoQ.js → ConnectedDataExplorerComponent-Brtw1DxF.js} +1 -1
- package/dist/assets/{ImageComparisonComponent-CqR26LSv.js → ImageComparisonComponent-Dxl-PbZX.js} +1 -1
- package/dist/assets/{VegaLite-DvQDATwI.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-ZcHkHPNJ.js → _createAggregator-VFK9K2d9.js} +1 -1
- package/dist/assets/{agent-panel-B91RoLct.js → agent-panel-BoscVLCT.js} +7 -7
- package/dist/assets/{any-language-editor-CxfHcm5h.js → any-language-editor-ChaY_VUU.js} +1 -1
- package/dist/assets/{architectureDiagram-W76B3OCA-BQsvK8uR.js → architectureDiagram-W76B3OCA-CueUUFYd.js} +1 -1
- package/dist/assets/{between-horizontal-start-BmYToIaM.js → between-horizontal-start-DAHqmLYT.js} +1 -1
- package/dist/assets/{blockDiagram-QIGZ2CNN-r3HgCj4w.js → blockDiagram-QIGZ2CNN-BYYygyWn.js} +1 -1
- package/dist/assets/{c4Diagram-FPNF74CW-BJbPNt41.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-Dv4MZ9Hj.js → chunk-4BX2VUAB-8g-RyHdt.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-CM4AHquB.js → chunk-55IACEB6-iWZZ8Mt6.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-C_Zz0ENB.js → chunk-FMBD7UC4-knjss4wk.js} +1 -1
- package/dist/assets/{chunk-K7UQS3LO-DYSmiXYq.js → chunk-K7UQS3LO-DVIwPBgZ.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-QM4OPuQP.js → chunk-QN33PNHL-CBU8pN6I.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-CfAsGyeB.js → chunk-QZHKN3VN-5ljElUF4.js} +1 -1
- package/dist/assets/{chunk-TVAH2DTR-6j_Cpjsi.js → chunk-TVAH2DTR-DkIdGINc.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-BHslFJQE.js → chunk-TZMSLE5B-CIFOSTqh.js} +1 -1
- package/dist/assets/{circle-play-CK3UZRYQ.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-C4fDVSv8.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-D-lbuUwz.js → common-DahoYqdi.js} +1 -1
- package/dist/assets/{compile-DVQe1Mzk.js → compile-Bg8uJ7vm.js} +1 -1
- package/dist/assets/{cose-bilkent-S5V4N54A-D-IS7WC8.js → cose-bilkent-S5V4N54A-z_0gqD9K.js} +1 -1
- package/dist/assets/{dagre-5GWH7T2D-lYu-tEWT.js → dagre-5GWH7T2D-BMt7CNXL.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-C5peOCit.js → data-grid-overlay-editor-Ctn4XtXx.js} +1 -1
- package/dist/assets/{datasources-panel-D3NA20uZ.js → datasources-panel-C7sqRIHs.js} +1 -1
- package/dist/assets/{dependency-graph-panel-BGVYOfkV.js → dependency-graph-panel-DNajptzv.js} +4 -4
- package/dist/assets/{diagram-N5W7TBWH-BnvIuYUp.js → diagram-N5W7TBWH-BzwvLvAy.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-DemedRK3.js → diagram-QEK2KX5R-DRLJ56FS.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-iiY7AuyH.js → diagram-S2PKOQOG-Bf8x4KTU.js} +1 -1
- package/dist/assets/{documentation-panel-C3dSwOSQ.js → documentation-panel-Dm6Ozl67.js} +1 -1
- package/dist/assets/edit-page-CGc9EjuG.js +140 -0
- package/dist/assets/{ellipsis-vertical-CazJl8M7.js → ellipsis-vertical-Bj1YXvZe.js} +1 -1
- package/dist/assets/{empty-state-DW308mFO.js → empty-state-CYev-D31.js} +1 -1
- package/dist/assets/{erDiagram-AWTI2OKA-6wQ8Ugg0.js → erDiagram-AWTI2OKA-DmgzgN_I.js} +1 -1
- package/dist/assets/{error-panel-D1VnJ1yP.js → error-panel-BYG4twCa.js} +1 -1
- package/dist/assets/{file-explorer-panel-0oVd4t-D.js → file-explorer-panel-BSMiOApi.js} +1 -1
- package/dist/assets/{flowDiagram-PVAE7QVJ-C55IUWjm.js → flowDiagram-PVAE7QVJ-BdRKkajr.js} +1 -1
- package/dist/assets/{ganttDiagram-OWAHRB6G-DmqCM6ME.js → ganttDiagram-OWAHRB6G-lfRAMnq_.js} +5 -5
- package/dist/assets/{gitGraphDiagram-NY62KEGX-DBvhAeM_.js → gitGraphDiagram-NY62KEGX-CQVTIrHF.js} +1 -1
- package/dist/assets/{glide-data-editor-CHNuHidQ.js → glide-data-editor-D5A4pou7.js} +11 -11
- package/dist/assets/{graph-CG6BgUWQ.js → graph-CBNo279v.js} +1 -1
- package/dist/assets/{home-page-dgivXuSR.js → home-page-CmdznBJR.js} +3 -3
- package/dist/assets/{index-BTGpssVX.js → index-0dfGh-Gj.js} +1 -1
- package/dist/assets/{index-C7dtgr9A.js → index-BDYVSSzB.js} +1 -1
- package/dist/assets/{index-C02SqeRj.js → index-B_KyDZ94.js} +1 -1
- package/dist/assets/{index-mkubqy9-.js → index-Bfy-I_lW.js} +1 -1
- package/dist/assets/{index-BelfnXwL.js → index-Bh98Tp-z.js} +1 -1
- package/dist/assets/{index-CAQvMTzM.js → index-BhroIwBL.js} +1 -1
- package/dist/assets/{index-BneyUujp.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-Csd6QrCV.js → index-C6DWtSls.js} +1 -1
- package/dist/assets/{index-BYVZlBF8.js → index-C71cdkH-.js} +1 -1
- package/dist/assets/{index-z4krxQ4j.js → index-CT_FTqvK.js} +1 -1
- package/dist/assets/{index-Db36XTG_.js → index-CU5rRr66.js} +1 -1
- package/dist/assets/{index-CtPksxf0.js → index-Cb6duXQm.js} +1 -1
- package/dist/assets/{index-DAZ-9ri2.js → index-D23e9zQj.js} +1 -1
- package/dist/assets/index-DUGecC2Z.js +68 -0
- package/dist/assets/{index-M_pBKDSe.js → index-DcGIOAQi.js} +1 -1
- package/dist/assets/{index-DONRrmA2.js → index-PJfa9qXY.js} +1 -1
- package/dist/assets/{index-sbO9UaUU.js → index-SPslPC2B.js} +1 -1
- package/dist/assets/{index-DdIhdEVw.js → index-VPQlo4Uz.js} +1 -1
- package/dist/assets/{index-_luCZMLM.js → index-qbTLKWyG.js} +1 -1
- package/dist/assets/infoDiagram-STP46IZ2-DBu8p9gd.js +2 -0
- package/dist/assets/{isEmpty-CqX_YTIf.js → isEmpty-CnOLuQIv.js} +1 -1
- package/dist/assets/{journeyDiagram-BIP6EPQ6-Y5w_Tqe_.js → journeyDiagram-BIP6EPQ6-6U_vHJBH.js} +1 -1
- package/dist/assets/{kanban-definition-6OIFK2YF-DbXs5Rxi.js → kanban-definition-6OIFK2YF-DgnR14ys.js} +1 -1
- package/dist/assets/{layout-BCNPDACj.js → layout-RHmq4fP9.js} +1 -1
- package/dist/assets/{linear-uO6UVhXt.js → linear-CLdOVPGV.js} +1 -1
- package/dist/assets/links-Dd1icsEk.js +7 -0
- package/dist/assets/{logs-panel-BEQ1eRUp.js → logs-panel-CjbuhBLx.js} +1 -1
- package/dist/assets/{markdown-renderer-Dmzbb00W.js → markdown-renderer-X5YJvAZq.js} +3 -3
- package/dist/assets/{mermaid-qRc4MXIj.js → mermaid-Bl2T5oEC.js} +1 -1
- package/dist/assets/{mermaid.core-CvvJtCRj.js → mermaid.core-CfukBvGI.js} +4 -4
- package/dist/assets/min-BXIes1Za.js +1 -0
- package/dist/assets/{mindmap-definition-Q6HEUPPD-G5NognM-.js → mindmap-definition-Q6HEUPPD-BXCjP4Lu.js} +1 -1
- package/dist/assets/{number-overlay-editor-DPr5sHFu.js → number-overlay-editor-BUyqkSes.js} +1 -1
- package/dist/assets/{outline-panel-gxQXvVi4.js → outline-panel-BvGcPKdd.js} +1 -1
- package/dist/assets/{packages-panel-B1T0VPlg.js → packages-panel-BichDQWG.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-DK9SHkfc.js → pieDiagram-ADFJNKIX-CMzJFIJM.js} +1 -1
- package/dist/assets/{quadrantDiagram-LMRXKWRM-D1DdWF8C.js → quadrantDiagram-LMRXKWRM-CfGssUlO.js} +1 -1
- package/dist/assets/{react-plotly-CTwajqCb.js → react-plotly-DR3hV0HW.js} +1 -1
- package/dist/assets/{requirementDiagram-4UW4RH46-DnjDAypr.js → requirementDiagram-4UW4RH46-CfrFolth.js} +1 -1
- package/dist/assets/{run-page-CQY9im22.js → run-page-Bqd_4ePD.js} +1 -1
- package/dist/assets/{sankeyDiagram-GR3RE2ED-B67Va-ER.js → sankeyDiagram-GR3RE2ED-D_UttKU0.js} +1 -1
- package/dist/assets/scratchpad-panel-D5N15ji1.js +1 -0
- package/dist/assets/secrets-panel-BpbnAO4R.js +1 -0
- package/dist/assets/{sequenceDiagram-C3RYC4MD-DiWgZPtN.js → sequenceDiagram-C3RYC4MD-MdfQQApP.js} +1 -1
- package/dist/assets/{slides-component-DhpPRtQp.js → slides-component-C0z7rXmk.js} +1 -1
- package/dist/assets/{snippets-panel-CLkBXhJ2.js → snippets-panel-wlpZ_Wzx.js} +1 -1
- package/dist/assets/{sortBy-D4OG7w4O.js → sortBy-BW_zNHP6.js} +1 -1
- package/dist/assets/{state-Dz_3JyED.js → state-CDooX-dk.js} +1 -1
- package/dist/assets/{stateDiagram-KXAO66HF-ByF2AULw.js → stateDiagram-KXAO66HF-H7kfw3ot.js} +1 -1
- package/dist/assets/stateDiagram-v2-UMBNRL4Z-YMeb9qMR.js +1 -0
- package/dist/assets/{storage-Dr0CC44z.js → storage-b1QCapTq.js} +6 -6
- package/dist/assets/{terminal-BtdissBf.js → terminal-CPV44BXz.js} +1 -1
- package/dist/assets/{time-DKdOTnQg.js → time-DDy3xv5Y.js} +1 -1
- package/dist/assets/{timeline-definition-XQNQX7LJ-DzER9bf6.js → timeline-definition-XQNQX7LJ-J-cPRT2_.js} +1 -1
- package/dist/assets/{tracing-Dpx5M-u3.js → tracing-3eHHRUiJ.js} +2 -2
- package/dist/assets/{tracing-panel-hCjBkSER.js → tracing-panel-BMgy3D7d.js} +2 -2
- package/dist/assets/{trash-C6Ko-g5q.js → trash--tonOuDe.js} +1 -1
- package/dist/assets/{tree-BHN2gcCF.js → tree-ouIGEsVg.js} +6 -6
- package/dist/assets/{treemap-75Q7IDZK-DR79Mhzt.js → treemap-75Q7IDZK-CzJTJ_3R.js} +20 -20
- package/dist/assets/{variable-panel-PFBCFz36.js → variable-panel-sFTn4Oih.js} +1 -1
- package/dist/assets/{vega-component-Db6-uY4C.js → vega-component-BkPkzX9r.js} +1 -1
- package/dist/assets/{xychartDiagram-6GGTOJPD-DWzBP3tZ.js → xychartDiagram-6GGTOJPD-BZ8WOb_8.js} +1 -1
- package/dist/index.html +10 -3
- package/package.json +6 -6
- package/src/__mocks__/common.ts +5 -3
- package/src/__mocks__/notebook.ts +2 -2
- 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__/data-table.test.tsx +2 -2
- 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 +1 -1
- 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 +6 -5
- package/src/components/data-table/row-viewer-panel/row-viewer.tsx +1 -1
- 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 +6 -2
- 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 +12 -6
- package/src/components/editor/navigation/clipboard.ts +2 -2
- package/src/components/editor/output/ConsoleOutput.tsx +1 -1
- package/src/components/editor/output/JsonOutput.tsx +1 -1
- package/src/components/editor/output/MarimoErrorOutput.tsx +25 -25
- 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/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 +1 -1
- package/src/core/codemirror/language/__tests__/sql-validation.test.ts +1 -1
- 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/{validation-errors.ts → banner-validation-errors.ts} +9 -3
- 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.ts +151 -24
- package/src/core/codemirror/language/languages/sql/utils.ts +4 -1
- package/src/core/codemirror/language/panel/sql.tsx +6 -1
- 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 +3 -1
- package/src/core/datasets/request-registry.ts +17 -10
- 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/main.ts +2 -2
- package/src/core/islands/parse.ts +1 -3
- package/src/core/kernel/messages.ts +1 -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/types.ts +1 -1
- package/src/core/variables/state.ts +2 -2
- package/src/core/wasm/__tests__/state.test.ts +1 -1
- package/src/core/websocket/useMarimoWebSocket.tsx +5 -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/impl/DataTablePlugin.tsx +7 -2
- 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/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/utils/Logger.ts +1 -1
- package/src/utils/__tests__/data-views.test.ts +30 -68
- package/src/utils/__tests__/dom.test.ts +10 -10
- 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/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--KDTwKbG.js +0 -1
- package/dist/assets/_baseMap-Cu3o-eyO.js +0 -1
- package/dist/assets/_baseUniq-y7ZXnMo1.js +0 -1
- package/dist/assets/channel-DFaEx1fu.js +0 -1
- package/dist/assets/chat-panel-IoPMv8e2.js +0 -3
- package/dist/assets/classDiagram-KNZD7YFC-BsZtvV5O.js +0 -1
- package/dist/assets/classDiagram-v2-RKCZMP56-BsZtvV5O.js +0 -1
- package/dist/assets/clone-YBEvPE-s.js +0 -1
- package/dist/assets/command-palette-D7hOfvf6.js +0 -1
- package/dist/assets/edit-page-C5TsEeSo.js +0 -129
- package/dist/assets/index-CGDMlQfO.css +0 -1
- package/dist/assets/index-CelXfcd8.js +0 -580
- package/dist/assets/index-Cxyk7pt-.js +0 -68
- package/dist/assets/infoDiagram-STP46IZ2-wTALjfPc.js +0 -2
- package/dist/assets/links-Drv7cJgN.js +0 -7
- package/dist/assets/min-DYUOb1RR.js +0 -1
- package/dist/assets/scratchpad-panel-DlDfcDtW.js +0 -1
- package/dist/assets/secrets-panel-BDGyuGZA.js +0 -1
- package/dist/assets/stateDiagram-v2-UMBNRL4Z-CtBJqosP.js +0 -1
- package/src/__tests__/lru.test.ts +0 -74
|
@@ -103,6 +103,9 @@ export class MarkdownLanguageAdapter
|
|
|
103
103
|
code: string,
|
|
104
104
|
metadata: MarkdownLanguageAdapterMetadata,
|
|
105
105
|
): [string, number] {
|
|
106
|
+
// NB. Must be kept consistent with marimo/_convert/utils.py
|
|
107
|
+
// ::markdown_to_marimo
|
|
108
|
+
|
|
106
109
|
// Empty string
|
|
107
110
|
if (code === "") {
|
|
108
111
|
// Need at least a space, otherwise the output will be 6 quotes
|
|
@@ -152,7 +155,7 @@ export class MarkdownLanguageAdapter
|
|
|
152
155
|
const tree = pythonLanguage.parser.parse(pythonCode);
|
|
153
156
|
|
|
154
157
|
// This is the exact match of mo.md() signature
|
|
155
|
-
const enterOrder:
|
|
158
|
+
const enterOrder: { match: string | RegExp; stop?: boolean }[] = [
|
|
156
159
|
{ match: "Script" },
|
|
157
160
|
{ match: "ExpressionStatement" },
|
|
158
161
|
{ match: "CallExpression" },
|
|
@@ -29,20 +29,26 @@ export function clearSqlValidationError(cellId: CellId) {
|
|
|
29
29
|
store.set(sqlValidationErrorsAtom, newErrors);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
export function clearAllSqlValidationErrors() {
|
|
33
|
+
store.set(sqlValidationErrorsAtom, new Map<CellId, SQLValidationError>());
|
|
34
|
+
}
|
|
35
|
+
|
|
32
36
|
export function setSqlValidationError({
|
|
33
37
|
cellId,
|
|
34
|
-
|
|
38
|
+
errorMessage,
|
|
35
39
|
dialect,
|
|
36
40
|
}: {
|
|
37
41
|
cellId: CellId;
|
|
38
|
-
|
|
42
|
+
errorMessage: string;
|
|
39
43
|
dialect: SupportedDialects | null;
|
|
40
44
|
}) {
|
|
41
45
|
const sqlValidationErrors = store.get(sqlValidationErrorsAtom);
|
|
42
46
|
const newErrors = new Map(sqlValidationErrors);
|
|
43
47
|
|
|
44
48
|
const errorResult: SQLValidationError =
|
|
45
|
-
dialect === "DuckDB"
|
|
49
|
+
dialect === "DuckDB"
|
|
50
|
+
? handleDuckdbError(errorMessage)
|
|
51
|
+
: splitErrorMessage(errorMessage);
|
|
46
52
|
|
|
47
53
|
newErrors.set(cellId, errorResult);
|
|
48
54
|
store.set(sqlValidationErrorsAtom, newErrors);
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import type { Completion } from "@codemirror/autocomplete";
|
|
4
|
+
import type { SQLNamespace } from "@codemirror/lang-sql";
|
|
5
|
+
import { createRoot } from "react-dom/client";
|
|
6
|
+
import type {
|
|
7
|
+
Database,
|
|
8
|
+
DatabaseSchema,
|
|
9
|
+
DataTable,
|
|
10
|
+
DataTableColumn,
|
|
11
|
+
} from "@/core/kernel/messages";
|
|
12
|
+
import {
|
|
13
|
+
renderColumnInfo,
|
|
14
|
+
renderDatabaseInfo,
|
|
15
|
+
renderSchemaInfo,
|
|
16
|
+
renderTableInfo,
|
|
17
|
+
} from "./renderers";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Simple builder for SQL completion schemas.
|
|
21
|
+
*/
|
|
22
|
+
export class CompletionBuilder {
|
|
23
|
+
private schema: Record<string, SQLNamespace> = {};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Add a table with its columns at the specified path
|
|
27
|
+
*/
|
|
28
|
+
addTable(path: string[], table: DataTable): this {
|
|
29
|
+
const tableNamespace: SQLNamespace = {
|
|
30
|
+
self: tableToCompletion({
|
|
31
|
+
table: table,
|
|
32
|
+
}),
|
|
33
|
+
children: table.columns.map((col) =>
|
|
34
|
+
columnToCompletion({
|
|
35
|
+
column: col,
|
|
36
|
+
}),
|
|
37
|
+
),
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
this.setAt([...path, table.name], tableNamespace);
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Add a schema at the specified path
|
|
46
|
+
*/
|
|
47
|
+
addSchema(path: string[], schema: DatabaseSchema): this {
|
|
48
|
+
const schemaObject: SQLNamespace = {
|
|
49
|
+
self: schemaToCompletion({
|
|
50
|
+
namespace: schema,
|
|
51
|
+
path: path,
|
|
52
|
+
}),
|
|
53
|
+
children: {},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
this.setAt(path, schemaObject);
|
|
57
|
+
return this;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Add a database at the specified path
|
|
62
|
+
*/
|
|
63
|
+
addDatabase(path: string[], database: Database): this {
|
|
64
|
+
const databaseObject: SQLNamespace = {
|
|
65
|
+
self: databaseToCompletion({
|
|
66
|
+
namespace: database,
|
|
67
|
+
path: path,
|
|
68
|
+
}),
|
|
69
|
+
children: {},
|
|
70
|
+
};
|
|
71
|
+
this.setAt(path, databaseObject);
|
|
72
|
+
return this;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Set a value at a nested path, creating intermediate objects as needed
|
|
77
|
+
*/
|
|
78
|
+
private setAt(path: string[], value: SQLNamespace): void {
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
80
|
+
let current: any = this.schema;
|
|
81
|
+
for (const key of path.slice(0, -1)) {
|
|
82
|
+
if (!current[key]) {
|
|
83
|
+
current[key] = { children: {} };
|
|
84
|
+
}
|
|
85
|
+
current = current[key].children;
|
|
86
|
+
}
|
|
87
|
+
current[path[path.length - 1]] = value;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Build the final schema
|
|
92
|
+
*/
|
|
93
|
+
build(): SQLNamespace {
|
|
94
|
+
return this.schema;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Reset for reuse
|
|
99
|
+
*/
|
|
100
|
+
reset(): this {
|
|
101
|
+
this.schema = {};
|
|
102
|
+
return this;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function columnToCompletion(opts: { column: DataTableColumn }): Completion {
|
|
107
|
+
return {
|
|
108
|
+
label: opts.column.name,
|
|
109
|
+
type: "column",
|
|
110
|
+
info: () => {
|
|
111
|
+
const dom = document.createElement("div");
|
|
112
|
+
createRoot(dom).render(renderColumnInfo(opts.column));
|
|
113
|
+
return { dom: dom };
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function tableToCompletion(opts: { table: DataTable }): Completion {
|
|
119
|
+
return {
|
|
120
|
+
label: opts.table.name,
|
|
121
|
+
type: "table",
|
|
122
|
+
info: () => {
|
|
123
|
+
const dom = document.createElement("div");
|
|
124
|
+
createRoot(dom).render(renderTableInfo(opts.table));
|
|
125
|
+
return { dom: dom };
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function schemaToCompletion(opts: {
|
|
131
|
+
namespace: DatabaseSchema;
|
|
132
|
+
path: string[];
|
|
133
|
+
}): Completion {
|
|
134
|
+
return {
|
|
135
|
+
label: opts.namespace.name,
|
|
136
|
+
detail: opts.path.join("."),
|
|
137
|
+
type: "schema",
|
|
138
|
+
info: () => {
|
|
139
|
+
const dom = document.createElement("div");
|
|
140
|
+
createRoot(dom).render(renderSchemaInfo(opts.namespace));
|
|
141
|
+
return { dom: dom };
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function databaseToCompletion(opts: {
|
|
147
|
+
namespace: Database;
|
|
148
|
+
path: string[];
|
|
149
|
+
}): Completion {
|
|
150
|
+
return {
|
|
151
|
+
label: opts.namespace.name,
|
|
152
|
+
detail: opts.path.join("."),
|
|
153
|
+
type: "database",
|
|
154
|
+
info: () => {
|
|
155
|
+
const dom = document.createElement("div");
|
|
156
|
+
createRoot(dom).render(renderDatabaseInfo(opts.namespace));
|
|
157
|
+
return { dom: dom };
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
}
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
} from "@codemirror/lang-sql";
|
|
8
8
|
import type { EditorState } from "@codemirror/state";
|
|
9
9
|
import { DefaultSqlTooltipRenders } from "@marimo-team/codemirror-sql";
|
|
10
|
+
import { once } from "@/utils/once";
|
|
10
11
|
import { languageMetadataField } from "../../metadata";
|
|
11
12
|
import { SCHEMA_CACHE } from "./completion-store";
|
|
12
13
|
import type { SQLLanguageAdapterMetadata } from "./sql";
|
|
@@ -28,7 +29,12 @@ export function tablesCompletionSource(): CompletionSource {
|
|
|
28
29
|
return null;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
const completions = schemaCompletionSource(config)(ctx);
|
|
33
|
+
if (!completions) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return completions;
|
|
32
38
|
};
|
|
33
39
|
}
|
|
34
40
|
|
|
@@ -84,7 +90,7 @@ export function customKeywordCompletionSource(): CompletionSource {
|
|
|
84
90
|
}
|
|
85
91
|
|
|
86
92
|
// e.g. lazily load keyword docs
|
|
87
|
-
const getKeywordDocs = async (): Promise<Record<string, unknown>> => {
|
|
93
|
+
const getKeywordDocs = once(async (): Promise<Record<string, unknown>> => {
|
|
88
94
|
const keywords = await import(
|
|
89
95
|
"@marimo-team/codemirror-sql/data/common-keywords.json"
|
|
90
96
|
);
|
|
@@ -96,4 +102,4 @@ const getKeywordDocs = async (): Promise<Record<string, unknown>> => {
|
|
|
96
102
|
...keywords.default.keywords,
|
|
97
103
|
...duckdbKeywords.default.keywords,
|
|
98
104
|
};
|
|
99
|
-
};
|
|
105
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
3
|
import type { SQLConfig, SQLDialect } from "@codemirror/lang-sql";
|
|
4
|
+
import { atom } from "jotai";
|
|
4
5
|
import { isSchemaless } from "@/components/datasources/utils";
|
|
5
6
|
import { dataConnectionsMapAtom } from "@/core/datasets/data-source-connections";
|
|
6
7
|
import type { ConnectionName } from "@/core/datasets/engines";
|
|
@@ -8,14 +9,22 @@ import { datasetTablesAtom } from "@/core/datasets/state";
|
|
|
8
9
|
import type { DataSourceConnection } from "@/core/kernel/messages";
|
|
9
10
|
import { store } from "@/core/state/jotai";
|
|
10
11
|
import { LRUCache } from "@/utils/lru";
|
|
12
|
+
import { CompletionBuilder } from "./completion-builder";
|
|
11
13
|
import { guessDialect, ModifiedStandardSQL } from "./utils";
|
|
12
14
|
|
|
13
|
-
type TableToCols = Record<string, string[]>;
|
|
14
|
-
type Schemas = Record<string, TableToCols>;
|
|
15
15
|
type CachedSchema = Pick<SQLConfig, "schema" | "defaultSchema"> & {
|
|
16
16
|
shouldAddLocalTables: boolean;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
const datasetTableCompletionsAtom = atom((get) => {
|
|
20
|
+
const tables = get(datasetTablesAtom);
|
|
21
|
+
const builder = new CompletionBuilder();
|
|
22
|
+
for (const table of tables) {
|
|
23
|
+
builder.addTable([], table);
|
|
24
|
+
}
|
|
25
|
+
return builder.build();
|
|
26
|
+
});
|
|
27
|
+
|
|
19
28
|
class SQLCompletionStore {
|
|
20
29
|
private cache: LRUCache<DataSourceConnection, CachedSchema>;
|
|
21
30
|
|
|
@@ -33,81 +42,74 @@ class SQLCompletionStore {
|
|
|
33
42
|
}
|
|
34
43
|
|
|
35
44
|
private getConnectionSchema(connection: DataSourceConnection): CachedSchema {
|
|
36
|
-
const
|
|
37
|
-
const
|
|
45
|
+
const { default_database, databases, default_schema } = connection;
|
|
46
|
+
const builder = new CompletionBuilder();
|
|
38
47
|
|
|
39
48
|
// When there is only one database, it is the default
|
|
40
|
-
const defaultDb =
|
|
41
|
-
(db) =>
|
|
42
|
-
db.name === connection.default_database ||
|
|
43
|
-
connection.databases.length === 1,
|
|
49
|
+
const defaultDb = databases.find(
|
|
50
|
+
(db) => db.name === default_database || databases.length === 1,
|
|
44
51
|
);
|
|
45
52
|
|
|
46
|
-
const dbToVerify = defaultDb ??
|
|
53
|
+
const dbToVerify = defaultDb ?? databases[0];
|
|
47
54
|
const isSchemalessDb =
|
|
48
55
|
dbToVerify?.schemas.some((schema) => isSchemaless(schema.name)) ?? false;
|
|
49
56
|
|
|
50
57
|
// For schemaless databases, treat databases as schemas
|
|
51
58
|
if (isSchemalessDb) {
|
|
52
|
-
|
|
53
|
-
const dbToTablesMap: Record<string, any> = {};
|
|
54
|
-
|
|
55
|
-
for (const db of connection.databases) {
|
|
59
|
+
for (const db of databases) {
|
|
56
60
|
const isDefaultDb = db.name === defaultDb?.name;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
dbToTablesMap[db.name] = dbToTablesMap[db.name] || {};
|
|
68
|
-
dbToTablesMap[db.name][table.name] = columns;
|
|
69
|
-
}
|
|
61
|
+
const tables = db.schemas.flatMap((schema) => schema.tables);
|
|
62
|
+
builder.addDatabase([db.name], db);
|
|
63
|
+
|
|
64
|
+
for (const table of tables) {
|
|
65
|
+
if (isDefaultDb) {
|
|
66
|
+
// For default database, add tables directly to top level
|
|
67
|
+
builder.addTable([], table);
|
|
68
|
+
} else {
|
|
69
|
+
// Otherwise nest under database name
|
|
70
|
+
builder.addTable([db.name], table);
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
return {
|
|
75
76
|
shouldAddLocalTables: false,
|
|
76
|
-
schema:
|
|
77
|
+
schema: builder.build(),
|
|
77
78
|
defaultSchema: defaultDb?.name,
|
|
78
79
|
};
|
|
79
80
|
}
|
|
80
81
|
|
|
81
|
-
// For default db, we can use the schema name directly
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
// For default db, we can use the schema name directly so add them to the top level
|
|
83
|
+
if (defaultDb) {
|
|
84
|
+
for (const schema of defaultDb.schemas) {
|
|
85
|
+
builder.addSchema([schema.name], schema);
|
|
86
|
+
|
|
87
|
+
for (const table of schema.tables) {
|
|
88
|
+
builder.addTable([schema.name], table);
|
|
89
|
+
}
|
|
87
90
|
}
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
// Otherwise, we need to use the fully qualified name
|
|
91
|
-
for (const database of
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
for (const database of databases) {
|
|
95
|
+
// We still want to add the default database here in case
|
|
96
|
+
// users want fully qualified names for completions
|
|
97
|
+
|
|
98
|
+
builder.addDatabase([database.name], database);
|
|
96
99
|
|
|
97
100
|
for (const schema of database.schemas) {
|
|
98
|
-
|
|
101
|
+
builder.addSchema([database.name, schema.name], schema);
|
|
99
102
|
|
|
100
103
|
for (const table of schema.tables) {
|
|
101
|
-
|
|
102
|
-
databaseMap[database.name][schema.name][table.name] = columns;
|
|
104
|
+
builder.addTable([database.name, schema.name], table);
|
|
103
105
|
}
|
|
104
106
|
}
|
|
105
107
|
}
|
|
106
108
|
|
|
107
109
|
return {
|
|
108
110
|
shouldAddLocalTables: true,
|
|
109
|
-
schema:
|
|
110
|
-
defaultSchema:
|
|
111
|
+
schema: builder.build(),
|
|
112
|
+
defaultSchema: default_schema ?? undefined,
|
|
111
113
|
};
|
|
112
114
|
}
|
|
113
115
|
|
|
@@ -142,15 +144,9 @@ class SQLCompletionStore {
|
|
|
142
144
|
}
|
|
143
145
|
|
|
144
146
|
const getTablesMap = () => {
|
|
145
|
-
const localTables = store.get(datasetTablesAtom);
|
|
146
147
|
// If there is a conflict with connection tables,
|
|
147
148
|
// the engine will prioritize the connection tables without special handling
|
|
148
|
-
|
|
149
|
-
for (const table of localTables) {
|
|
150
|
-
const tableColumns = table.columns.map((col) => col.name);
|
|
151
|
-
tablesMap[table.name] = tableColumns;
|
|
152
|
-
}
|
|
153
|
-
return tablesMap;
|
|
149
|
+
return store.get(datasetTableCompletionsAtom);
|
|
154
150
|
};
|
|
155
151
|
|
|
156
152
|
const schema = this.cache.getOrCreate(connection);
|