@marimo-team/islands 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/{ConnectedDataExplorerComponent-KvtsEmcw.js → ConnectedDataExplorerComponent-CareOso9.js} +2 -2
- package/dist/{ImageComparisonComponent-R2tjqLSx.js → ImageComparisonComponent-I_Z738Uj.js} +1 -1
- package/dist/{_baseUniq-BykZEXIq.js → _baseUniq-D-Kb4EU4.js} +1 -1
- package/dist/{any-language-editor-CMt4Y6oz.js → any-language-editor-BRWmYor8.js} +1 -1
- package/dist/{architectureDiagram-W76B3OCA-mQ3sJdEW.js → architectureDiagram-W76B3OCA-bZJcJYGH.js} +4 -4
- package/dist/assets/{worker-B0C57BK8.js → worker-DMlIUTIq.js} +18 -17
- package/dist/{blockDiagram-QIGZ2CNN-BxLRv5EM.js → blockDiagram-QIGZ2CNN-DyXjO8fR.js} +5 -5
- package/dist/{c4Diagram-FPNF74CW-Cfz16aWq.js → c4Diagram-FPNF74CW-Bfs9ui2r.js} +2 -2
- package/dist/{channel-zr1uJJ5g.js → channel-CMup9X3Z.js} +1 -1
- package/dist/{chunk-4BX2VUAB-B8iHvpDe.js → chunk-4BX2VUAB-CW-ni6M_.js} +1 -1
- package/dist/{chunk-55IACEB6-CJs4dL1H.js → chunk-55IACEB6-Bj-Indya.js} +1 -1
- package/dist/{chunk-FMBD7UC4-C5irHg20.js → chunk-FMBD7UC4-9IC8qSSk.js} +1 -1
- package/dist/{chunk-K7UQS3LO-B2XW75WS.js → chunk-K7UQS3LO-aapkEuWN.js} +4 -4
- package/dist/{chunk-QN33PNHL-BtwctqGa.js → chunk-QN33PNHL-Bo5dJ5T5.js} +1 -1
- package/dist/{chunk-QZHKN3VN-Sb8ZD0FY.js → chunk-QZHKN3VN-BkMzjJYY.js} +1 -1
- package/dist/{chunk-TVAH2DTR-CEJ5zkLX.js → chunk-TVAH2DTR-Wqy_C_Rn.js} +3 -3
- package/dist/{chunk-TZMSLE5B-Ccm4T92V.js → chunk-TZMSLE5B-DjBmEAUz.js} +1 -1
- package/dist/{classDiagram-v2-RKCZMP56-DWTbT0ww.js → classDiagram-KNZD7YFC-DUsaN1O4.js} +2 -2
- package/dist/{classDiagram-KNZD7YFC-DWTbT0ww.js → classDiagram-v2-RKCZMP56-DUsaN1O4.js} +2 -2
- package/dist/{clone-CDDiMerE.js → clone-Dkt_7KOK.js} +1 -1
- package/dist/{cose-bilkent-S5V4N54A-B74aLjZ_.js → cose-bilkent-S5V4N54A-ClBuGZWI.js} +2 -2
- package/dist/{dagre-5GWH7T2D-Cie_wUzI.js → dagre-5GWH7T2D-BzmDIGaM.js} +6 -6
- package/dist/{data-grid-overlay-editor-OsCMRzfP.js → data-grid-overlay-editor-NiU9Ea77.js} +2 -2
- package/dist/{diagram-N5W7TBWH-CCeFeV2B.js → diagram-N5W7TBWH-BlO1yw_g.js} +5 -5
- package/dist/{diagram-QEK2KX5R-BPROiVV7.js → diagram-QEK2KX5R-BvK83LUx.js} +3 -3
- package/dist/{diagram-S2PKOQOG-BkLFbUa_.js → diagram-S2PKOQOG-DvBzRYd7.js} +3 -3
- package/dist/{dockerfile-CuJXUZQ_.js → dockerfile-CPQG2tLO.js} +1 -1
- package/dist/{erDiagram-AWTI2OKA-CpBWOTMK.js → erDiagram-AWTI2OKA-Doy9FRTX.js} +4 -4
- package/dist/{flowDiagram-PVAE7QVJ-C_X4bmq3.js → flowDiagram-PVAE7QVJ-D_tX_HU1.js} +5 -5
- package/dist/{ganttDiagram-OWAHRB6G-CruldwEp.js → ganttDiagram-OWAHRB6G-CV03BHVY.js} +4 -4
- package/dist/{gitGraphDiagram-NY62KEGX-ZJnVxaQP.js → gitGraphDiagram-NY62KEGX-w3szEguZ.js} +4 -4
- package/dist/{glide-data-editor-CnOBht4I.js → glide-data-editor-akznFrmp.js} +3 -3
- package/dist/{graph-DjTtWtcG.js → graph-CjrrDHdT.js} +3 -3
- package/dist/index-CIJJs0Tu.js +40382 -0
- package/dist/{index-CZ9vIBEc.js → index-DMo6cbcV.js} +3 -3
- package/dist/{index-saLjL5eo.js → index-DlV2CtJb.js} +1 -1
- package/dist/{index-DSpjUDnr.js → index-Y-Vbae6Z.js} +1 -1
- package/dist/{infoDiagram-STP46IZ2-RZgl96nR.js → infoDiagram-STP46IZ2-BcBV2j75.js} +2 -2
- package/dist/{journeyDiagram-BIP6EPQ6-9ytZy-zY.js → journeyDiagram-BIP6EPQ6-BTGMSgvB.js} +3 -3
- package/dist/{kanban-definition-6OIFK2YF-CpjPWkgX.js → kanban-definition-6OIFK2YF-aopNqZ1Y.js} +2 -2
- package/dist/{layout-BAvhX25D.js → layout-Dvo9pb_w.js} +4 -4
- package/dist/{linear-BKZuvJrK.js → linear-CHnELER9.js} +1 -1
- package/dist/{main-pE28kbH0.js → main-kLZGkzVQ.js} +34849 -34052
- package/dist/main.js +1 -1
- package/dist/{mermaid-BGd7kEsf.js → mermaid-DgM4_4bD.js} +30 -30
- package/dist/{min-DmsBJf5S.js → min-cX4DuL_n.js} +2 -2
- package/dist/{mindmap-definition-Q6HEUPPD-BerypnVD.js → mindmap-definition-Q6HEUPPD-DZjbYryy.js} +3 -3
- package/dist/{number-overlay-editor-A7ZQ6sSs.js → number-overlay-editor-8MpIObf7.js} +2 -2
- package/dist/{pieDiagram-ADFJNKIX-ChcQLZM2.js → pieDiagram-ADFJNKIX-D6L1IYAc.js} +3 -3
- package/dist/{quadrantDiagram-LMRXKWRM-BOMxo-5G.js → quadrantDiagram-LMRXKWRM-nOyuc3Bf.js} +2 -2
- package/dist/{react-plotly-8f0vAPdB.js → react-plotly-ChkfYiVe.js} +1 -1
- package/dist/{requirementDiagram-4UW4RH46-rql0vkIr.js → requirementDiagram-4UW4RH46-OVV8wsju.js} +3 -3
- package/dist/{sankeyDiagram-GR3RE2ED-BMz3hqw4.js → sankeyDiagram-GR3RE2ED-qZHMdnE_.js} +1 -1
- package/dist/{sequenceDiagram-C3RYC4MD-DFK39LUK.js → sequenceDiagram-C3RYC4MD-D0bOqf-t.js} +3 -3
- package/dist/{slides-component-BNsZuUgg.js → slides-component-CNzLDdA3.js} +1 -1
- package/dist/{stateDiagram-KXAO66HF-B_3SWOCl.js → stateDiagram-KXAO66HF-CFNCnNJS.js} +4 -4
- package/dist/{stateDiagram-v2-UMBNRL4Z-BWAYN6aU.js → stateDiagram-v2-UMBNRL4Z-CnIh27m8.js} +2 -2
- package/dist/style.css +1 -1
- package/dist/{time-DCvYzQ5t.js → time-Z7CJSfOW.js} +2 -2
- package/dist/{timeline-definition-XQNQX7LJ-CSbxJ5mV.js → timeline-definition-XQNQX7LJ-BYLMfrvK.js} +1 -1
- package/dist/{treemap-75Q7IDZK-LMXGKln_.js → treemap-75Q7IDZK-BEh1HacP.js} +5 -5
- package/dist/{vega-component-CRmon7pH.js → vega-component-iMjXd3tD.js} +2 -2
- package/dist/{xychartDiagram-6GGTOJPD-DaUD4dq3.js → xychartDiagram-6GGTOJPD-Bmi13ZSG.js} +2 -2
- 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/index-DeOkA9fC.js +0 -40315
- package/src/__tests__/lru.test.ts +0 -74
package/src/core/ai/ids/ids.ts
CHANGED
|
@@ -19,6 +19,7 @@ export const PROVIDER_SORT_ORDER: ProviderId[] = [
|
|
|
19
19
|
"openai",
|
|
20
20
|
"google",
|
|
21
21
|
"github",
|
|
22
|
+
"openrouter",
|
|
22
23
|
"deepseek",
|
|
23
24
|
"azure",
|
|
24
25
|
"bedrock",
|
|
@@ -201,7 +202,7 @@ export class AiModelRegistry {
|
|
|
201
202
|
return this.modelsByProviderMap;
|
|
202
203
|
}
|
|
203
204
|
|
|
204
|
-
getListModelsByProvider():
|
|
205
|
+
getListModelsByProvider(): [ProviderId, AiModel[]][] {
|
|
205
206
|
const modelsByProvider = this.getGroupedModelsByProvider();
|
|
206
207
|
const arrayModels = [...modelsByProvider.entries()];
|
|
207
208
|
const providerToOrderIdx = getProviderMap().providerToOrderIdx;
|
package/src/core/cells/cells.ts
CHANGED
|
@@ -84,14 +84,14 @@ export interface NotebookState {
|
|
|
84
84
|
*
|
|
85
85
|
* (CodeMirror types the serialized config as any.)
|
|
86
86
|
*/
|
|
87
|
-
history:
|
|
87
|
+
history: {
|
|
88
88
|
name: string;
|
|
89
89
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
90
90
|
serializedEditorState: any;
|
|
91
91
|
column: CellColumnId;
|
|
92
92
|
index: CellIndex;
|
|
93
93
|
isSetupCell: boolean;
|
|
94
|
-
}
|
|
94
|
+
}[];
|
|
95
95
|
/**
|
|
96
96
|
* Key of cell to scroll to; typically set by actions that re-order the cell
|
|
97
97
|
* array. Call the SCROLL_TO_TARGET action to scroll to the specified cell
|
|
@@ -1128,10 +1128,10 @@ const {
|
|
|
1128
1128
|
|
|
1129
1129
|
// Find the start/end of the collapsed ranges
|
|
1130
1130
|
const nodes = [...column.nodes];
|
|
1131
|
-
const rangeIndexes:
|
|
1131
|
+
const rangeIndexes: {
|
|
1132
1132
|
start: CellIndex;
|
|
1133
1133
|
end: CellIndex;
|
|
1134
|
-
}
|
|
1134
|
+
}[] = [];
|
|
1135
1135
|
const reversedCollapseRanges = [];
|
|
1136
1136
|
|
|
1137
1137
|
// Iterate in reverse order (bottom-up) to process children first
|
|
@@ -1668,7 +1668,7 @@ export const getCellEditorView = (cellId: CellId) => {
|
|
|
1668
1668
|
|
|
1669
1669
|
export function flattenTopLevelNotebookCells(
|
|
1670
1670
|
state: NotebookState,
|
|
1671
|
-
):
|
|
1671
|
+
): (CellData & CellRuntimeState)[] {
|
|
1672
1672
|
const { cellIds, cellData, cellRuntime } = state;
|
|
1673
1673
|
return cellIds.getColumns().flatMap((column) =>
|
|
1674
1674
|
column.topLevelIds.map((cellId) => ({
|
package/src/core/cells/logs.ts
CHANGED
|
@@ -87,7 +87,7 @@ const CellLogLogger = {
|
|
|
87
87
|
? "red"
|
|
88
88
|
: "orange";
|
|
89
89
|
const status = payload.level.toUpperCase();
|
|
90
|
-
|
|
90
|
+
/** biome-ignore lint/suspicious/noConsole: for debugging */
|
|
91
91
|
console.log(
|
|
92
92
|
`%c[${status}]`,
|
|
93
93
|
`color:${color}; padding:2px 0; border-radius:2px; font-weight:bold`,
|
package/src/core/cells/types.ts
CHANGED
|
@@ -93,7 +93,7 @@ export interface CellRuntimeState {
|
|
|
93
93
|
/** TOC outline */
|
|
94
94
|
outline: Outline | null;
|
|
95
95
|
/** messages encoding the cell's console outputs. */
|
|
96
|
-
consoleOutputs:
|
|
96
|
+
consoleOutputs: WithResponse<OutputMessage>[];
|
|
97
97
|
/** current status of the cell */
|
|
98
98
|
status: RuntimeState;
|
|
99
99
|
/** whether the cell has stale inputs*/
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { python } from "@codemirror/lang-python";
|
|
4
4
|
import { EditorState } from "@codemirror/state";
|
|
5
5
|
import { EditorView } from "@codemirror/view";
|
|
6
|
+
import { atom } from "jotai";
|
|
6
7
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
7
8
|
import { MockRequestClient } from "@/__mocks__/requests";
|
|
8
9
|
import type { NotebookState } from "@/core/cells/cells";
|
|
@@ -34,6 +35,11 @@ vi.mock("@/core/cells/utils", () => ({
|
|
|
34
35
|
|
|
35
36
|
vi.mock("@/core/config/config", () => ({
|
|
36
37
|
getResolvedMarimoConfig: vi.fn(),
|
|
38
|
+
resolvedMarimoConfigAtom: atom({
|
|
39
|
+
display: {
|
|
40
|
+
theme: "light",
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
37
43
|
}));
|
|
38
44
|
|
|
39
45
|
const updateCellCode = vi.fn();
|
|
@@ -29,7 +29,7 @@ function createErrorDecorations(state: EditorState, errors: TracebackInfos) {
|
|
|
29
29
|
|
|
30
30
|
// Filter and sort errors by line number to ensure they're added in order
|
|
31
31
|
const relevantErrors = errors
|
|
32
|
-
.filter((error) => error.cellId === cellId)
|
|
32
|
+
.filter((error) => error.kind === "cell" && error.cellId === cellId)
|
|
33
33
|
.sort((a, b) => a.lineNumber - b.lineNumber);
|
|
34
34
|
|
|
35
35
|
for (const error of relevantErrors) {
|
|
@@ -3,14 +3,14 @@ import { foldAll, unfoldAll } from "@codemirror/language";
|
|
|
3
3
|
import type { Command, EditorView } from "@codemirror/view";
|
|
4
4
|
import type { Nullable } from "vitest";
|
|
5
5
|
|
|
6
|
-
export type BulkCommand = (targets:
|
|
6
|
+
export type BulkCommand = (targets: Nullable<EditorView>[]) => boolean;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Make a bulk command from a single {@type Command} that applies
|
|
10
10
|
* the given command to all targets.
|
|
11
11
|
*/
|
|
12
12
|
export function makeBulkCommand(command: Command) {
|
|
13
|
-
return (targets:
|
|
13
|
+
return (targets: Nullable<EditorView>[]) => {
|
|
14
14
|
let changed = false;
|
|
15
15
|
for (const target of targets) {
|
|
16
16
|
if (target) {
|
|
@@ -110,7 +110,7 @@ export const findPrev = findInDirection("prev");
|
|
|
110
110
|
*/
|
|
111
111
|
export const replaceAll = searchCommand(({ query }) => {
|
|
112
112
|
const views = getAllEditorViews();
|
|
113
|
-
const undoHandlers:
|
|
113
|
+
const undoHandlers: (() => void)[] = [];
|
|
114
114
|
for (const view of views) {
|
|
115
115
|
if (view.state.readOnly) {
|
|
116
116
|
continue;
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
languageAdapterState,
|
|
15
15
|
switchLanguage,
|
|
16
16
|
} from "../extension";
|
|
17
|
-
import { exportedForTesting as sqlValidationErrorsForTesting } from "../languages/sql/validation-errors";
|
|
17
|
+
import { exportedForTesting as sqlValidationErrorsForTesting } from "../languages/sql/banner-validation-errors";
|
|
18
18
|
import { languageMetadataField } from "../metadata";
|
|
19
19
|
|
|
20
20
|
let view: EditorView | null = null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
3
|
import { describe, expect, it } from "vitest";
|
|
4
|
-
import { exportedForTesting } from "../languages/sql/validation-errors";
|
|
4
|
+
import { exportedForTesting } from "../languages/sql/banner-validation-errors";
|
|
5
5
|
|
|
6
6
|
describe("Error Message Splitting", () => {
|
|
7
7
|
it("should handle error message splitting correctly", () => {
|