@marimo-team/islands 0.23.10-dev2 → 0.23.10-dev21
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-CyV83R2m.js → ConnectedDataExplorerComponent-DdeG-Hi-.js} +23 -23
- package/dist/{any-language-editor-DfdpyDv_.js → any-language-editor-CiES2a2h.js} +2 -2
- package/dist/assets/__vite-browser-external-eshhtsgZ.js +1 -0
- package/dist/assets/worker-CC0Oul9k.js +73 -0
- package/dist/{chat-ui-ar37brtL.js → chat-ui-BTobdMRF.js} +61 -61
- package/dist/{code-visibility-B88v1No3.js → code-visibility-Cu6I0RUK.js} +1212 -1046
- package/dist/{copy-BuQpJEzp.js → copy-5jQ_kGE1.js} +32 -32
- package/dist/{esm-BfhQmZjp.js → esm-CCuYCd3R.js} +1 -1
- package/dist/{extends-BgdxCfYu.js → extends-CkydH1Q5.js} +1 -1
- package/dist/{glide-data-editor-BOmK9ETQ.js → glide-data-editor-CRvL2R9l.js} +7 -7
- package/dist/{html-to-image-Cp8O1OWB.js → html-to-image-CjsdUYrb.js} +2258 -2238
- package/dist/{input-_2sjvfne.js → input-DVkbXbIX.js} +183 -181
- package/dist/main.js +1565 -1363
- package/dist/{process-output-CaUUWhh8.js → process-output-CI8a-CUx.js} +2 -2
- package/dist/{reveal-component-CfFoUPFg.js → reveal-component-EOadhR-6.js} +5 -5
- package/dist/{spec-B96zNUEA.js → spec-DMRQmLOc.js} +2 -2
- package/dist/{strings-Bu3vlb6W.js → strings-GCJA9n6d.js} +25 -24
- package/dist/style.css +1 -1
- package/dist/{useDateFormatter-BA4FCquG.js → useDateFormatter-BRcO_TGJ.js} +1 -1
- package/package.json +3 -3
- package/src/components/data-table/__tests__/data-table.test.tsx +154 -12
- package/src/components/data-table/hover-tooltip/__tests__/content.test.ts +60 -0
- package/src/components/data-table/hover-tooltip/content.ts +44 -0
- package/src/components/data-table/hover-tooltip/hover-tooltip.tsx +55 -0
- package/src/components/data-table/hover-tooltip/use-table-hover-tooltip.ts +159 -0
- package/src/components/data-table/renderers.tsx +27 -43
- package/src/components/datasources/__tests__/filter-empty.test.ts +183 -0
- package/src/components/datasources/datasources.tsx +92 -3
- package/src/components/editor/cell/cell-context-menu.tsx +15 -2
- package/src/components/editor/documentation.css +16 -0
- package/src/components/editor/file-tree/file-explorer.tsx +8 -18
- package/src/components/editor/file-tree/tree-actions.tsx +46 -1
- package/src/components/slides/__tests__/minimap-actions.test.tsx +166 -0
- package/src/components/slides/minimap.tsx +127 -10
- package/src/components/storage/__tests__/storage-inspector.test.ts +53 -0
- package/src/components/storage/storage-inspector.tsx +68 -48
- package/src/components/ui/__tests__/use-toast.test.ts +75 -0
- package/src/components/ui/use-toast.ts +33 -13
- package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +0 -28
- package/src/core/cells/__tests__/cell.test.ts +29 -2
- package/src/core/cells/cell.ts +5 -1
- package/src/core/codemirror/go-to-definition/__tests__/utils.test.ts +37 -0
- package/src/core/codemirror/go-to-definition/commands.ts +17 -9
- package/src/core/codemirror/go-to-definition/utils.ts +1 -0
- package/src/core/codemirror/language/languages/sql/utils.ts +3 -1
- package/src/core/datasets/data-source-connections.ts +2 -0
- package/src/core/network/__tests__/requests-static.test.ts +30 -0
- package/src/core/network/requests-static.ts +14 -10
- package/src/core/wasm/worker/bootstrap.ts +12 -4
- package/src/plugins/layout/DownloadPlugin.tsx +1 -1
- package/dist/assets/__vite-browser-external-Ci2ZQfXU.js +0 -1
- package/dist/assets/worker-ip3AI_sN.js +0 -73
|
@@ -80,7 +80,6 @@ exports[`cell reducer > can initialize stdin 3`] = `
|
|
|
80
80
|
"output": null,
|
|
81
81
|
"runElapsedTimeMs": null,
|
|
82
82
|
"runStartTimestamp": null,
|
|
83
|
-
"serialization": undefined,
|
|
84
83
|
"serializedEditorState": null,
|
|
85
84
|
"staleInputs": false,
|
|
86
85
|
"status": "queued",
|
|
@@ -110,7 +109,6 @@ exports[`cell reducer > can initialize stdin 4`] = `
|
|
|
110
109
|
"output": null,
|
|
111
110
|
"runElapsedTimeMs": null,
|
|
112
111
|
"runStartTimestamp": 20,
|
|
113
|
-
"serialization": undefined,
|
|
114
112
|
"serializedEditorState": null,
|
|
115
113
|
"staleInputs": false,
|
|
116
114
|
"status": "running",
|
|
@@ -147,7 +145,6 @@ exports[`cell reducer > can initialize stdin 5`] = `
|
|
|
147
145
|
"output": null,
|
|
148
146
|
"runElapsedTimeMs": null,
|
|
149
147
|
"runStartTimestamp": 20,
|
|
150
|
-
"serialization": undefined,
|
|
151
148
|
"serializedEditorState": null,
|
|
152
149
|
"staleInputs": false,
|
|
153
150
|
"status": "running",
|
|
@@ -184,7 +181,6 @@ exports[`cell reducer > can initialize stdin 6`] = `
|
|
|
184
181
|
"output": null,
|
|
185
182
|
"runElapsedTimeMs": null,
|
|
186
183
|
"runStartTimestamp": 20,
|
|
187
|
-
"serialization": undefined,
|
|
188
184
|
"serializedEditorState": null,
|
|
189
185
|
"staleInputs": false,
|
|
190
186
|
"status": "running",
|
|
@@ -227,7 +223,6 @@ exports[`cell reducer > can initialize stdin 7`] = `
|
|
|
227
223
|
"output": null,
|
|
228
224
|
"runElapsedTimeMs": null,
|
|
229
225
|
"runStartTimestamp": 20,
|
|
230
|
-
"serialization": undefined,
|
|
231
226
|
"serializedEditorState": null,
|
|
232
227
|
"staleInputs": false,
|
|
233
228
|
"status": "running",
|
|
@@ -271,7 +266,6 @@ exports[`cell reducer > can initialize stdin 8`] = `
|
|
|
271
266
|
"output": null,
|
|
272
267
|
"runElapsedTimeMs": null,
|
|
273
268
|
"runStartTimestamp": 20,
|
|
274
|
-
"serialization": undefined,
|
|
275
269
|
"serializedEditorState": null,
|
|
276
270
|
"staleInputs": false,
|
|
277
271
|
"status": "running",
|
|
@@ -321,7 +315,6 @@ exports[`cell reducer > can initialize stdin 9`] = `
|
|
|
321
315
|
"output": null,
|
|
322
316
|
"runElapsedTimeMs": null,
|
|
323
317
|
"runStartTimestamp": 20,
|
|
324
|
-
"serialization": undefined,
|
|
325
318
|
"serializedEditorState": null,
|
|
326
319
|
"staleInputs": false,
|
|
327
320
|
"status": "running",
|
|
@@ -387,7 +380,6 @@ exports[`cell reducer > can receive console when the cell is idle and will clear
|
|
|
387
380
|
"output": null,
|
|
388
381
|
"runElapsedTimeMs": null,
|
|
389
382
|
"runStartTimestamp": null,
|
|
390
|
-
"serialization": undefined,
|
|
391
383
|
"serializedEditorState": null,
|
|
392
384
|
"staleInputs": false,
|
|
393
385
|
"status": "queued",
|
|
@@ -424,7 +416,6 @@ exports[`cell reducer > can receive console when the cell is idle and will clear
|
|
|
424
416
|
"output": null,
|
|
425
417
|
"runElapsedTimeMs": null,
|
|
426
418
|
"runStartTimestamp": null,
|
|
427
|
-
"serialization": undefined,
|
|
428
419
|
"serializedEditorState": null,
|
|
429
420
|
"staleInputs": false,
|
|
430
421
|
"status": "queued",
|
|
@@ -454,7 +445,6 @@ exports[`cell reducer > can receive console when the cell is idle and will clear
|
|
|
454
445
|
"output": null,
|
|
455
446
|
"runElapsedTimeMs": null,
|
|
456
447
|
"runStartTimestamp": 20,
|
|
457
|
-
"serialization": undefined,
|
|
458
448
|
"serializedEditorState": null,
|
|
459
449
|
"staleInputs": false,
|
|
460
450
|
"status": "running",
|
|
@@ -491,7 +481,6 @@ exports[`cell reducer > can receive console when the cell is idle and will clear
|
|
|
491
481
|
"output": null,
|
|
492
482
|
"runElapsedTimeMs": 2000,
|
|
493
483
|
"runStartTimestamp": null,
|
|
494
|
-
"serialization": undefined,
|
|
495
484
|
"serializedEditorState": null,
|
|
496
485
|
"staleInputs": false,
|
|
497
486
|
"status": "idle",
|
|
@@ -521,7 +510,6 @@ exports[`cell reducer > can run a stale cell 1`] = `
|
|
|
521
510
|
"output": null,
|
|
522
511
|
"runElapsedTimeMs": null,
|
|
523
512
|
"runStartTimestamp": null,
|
|
524
|
-
"serialization": undefined,
|
|
525
513
|
"serializedEditorState": null,
|
|
526
514
|
"staleInputs": false,
|
|
527
515
|
"status": "queued",
|
|
@@ -551,7 +539,6 @@ exports[`cell reducer > can run a stale cell 2`] = `
|
|
|
551
539
|
"output": null,
|
|
552
540
|
"runElapsedTimeMs": null,
|
|
553
541
|
"runStartTimestamp": null,
|
|
554
|
-
"serialization": undefined,
|
|
555
542
|
"serializedEditorState": null,
|
|
556
543
|
"staleInputs": true,
|
|
557
544
|
"status": "queued",
|
|
@@ -581,7 +568,6 @@ exports[`cell reducer > can run a stopped cell 1`] = `
|
|
|
581
568
|
"output": null,
|
|
582
569
|
"runElapsedTimeMs": null,
|
|
583
570
|
"runStartTimestamp": null,
|
|
584
|
-
"serialization": undefined,
|
|
585
571
|
"serializedEditorState": null,
|
|
586
572
|
"staleInputs": false,
|
|
587
573
|
"status": "queued",
|
|
@@ -611,7 +597,6 @@ exports[`cell reducer > can run a stopped cell 2`] = `
|
|
|
611
597
|
"output": null,
|
|
612
598
|
"runElapsedTimeMs": null,
|
|
613
599
|
"runStartTimestamp": null,
|
|
614
|
-
"serialization": undefined,
|
|
615
600
|
"serializedEditorState": null,
|
|
616
601
|
"staleInputs": false,
|
|
617
602
|
"status": "idle",
|
|
@@ -652,7 +637,6 @@ exports[`cell reducer > can run a stopped cell 3`] = `
|
|
|
652
637
|
},
|
|
653
638
|
"runElapsedTimeMs": null,
|
|
654
639
|
"runStartTimestamp": null,
|
|
655
|
-
"serialization": undefined,
|
|
656
640
|
"serializedEditorState": null,
|
|
657
641
|
"staleInputs": false,
|
|
658
642
|
"status": "idle",
|
|
@@ -693,7 +677,6 @@ exports[`cell reducer > can run a stopped cell 4`] = `
|
|
|
693
677
|
},
|
|
694
678
|
"runElapsedTimeMs": null,
|
|
695
679
|
"runStartTimestamp": null,
|
|
696
|
-
"serialization": undefined,
|
|
697
680
|
"serializedEditorState": null,
|
|
698
681
|
"staleInputs": false,
|
|
699
682
|
"status": "queued",
|
|
@@ -723,7 +706,6 @@ exports[`cell reducer > can run a stopped cell 5`] = `
|
|
|
723
706
|
"output": null,
|
|
724
707
|
"runElapsedTimeMs": null,
|
|
725
708
|
"runStartTimestamp": 40,
|
|
726
|
-
"serialization": undefined,
|
|
727
709
|
"serializedEditorState": null,
|
|
728
710
|
"staleInputs": false,
|
|
729
711
|
"status": "running",
|
|
@@ -840,7 +822,6 @@ exports[`cell reducer > can run cell and receive cell messages 4`] = `
|
|
|
840
822
|
"output": null,
|
|
841
823
|
"runElapsedTimeMs": null,
|
|
842
824
|
"runStartTimestamp": null,
|
|
843
|
-
"serialization": undefined,
|
|
844
825
|
"serializedEditorState": null,
|
|
845
826
|
"staleInputs": false,
|
|
846
827
|
"status": "queued",
|
|
@@ -870,7 +851,6 @@ exports[`cell reducer > can run cell and receive cell messages 5`] = `
|
|
|
870
851
|
"output": null,
|
|
871
852
|
"runElapsedTimeMs": null,
|
|
872
853
|
"runStartTimestamp": 20,
|
|
873
|
-
"serialization": undefined,
|
|
874
854
|
"serializedEditorState": null,
|
|
875
855
|
"staleInputs": false,
|
|
876
856
|
"status": "running",
|
|
@@ -907,7 +887,6 @@ exports[`cell reducer > can run cell and receive cell messages 6`] = `
|
|
|
907
887
|
"output": null,
|
|
908
888
|
"runElapsedTimeMs": null,
|
|
909
889
|
"runStartTimestamp": 20,
|
|
910
|
-
"serialization": undefined,
|
|
911
890
|
"serializedEditorState": null,
|
|
912
891
|
"staleInputs": false,
|
|
913
892
|
"status": "running",
|
|
@@ -949,7 +928,6 @@ exports[`cell reducer > can run cell and receive cell messages 7`] = `
|
|
|
949
928
|
},
|
|
950
929
|
"runElapsedTimeMs": 13000,
|
|
951
930
|
"runStartTimestamp": null,
|
|
952
|
-
"serialization": undefined,
|
|
953
931
|
"serializedEditorState": null,
|
|
954
932
|
"staleInputs": false,
|
|
955
933
|
"status": "idle",
|
|
@@ -992,7 +970,6 @@ import numpy",
|
|
|
992
970
|
},
|
|
993
971
|
"runElapsedTimeMs": 13000,
|
|
994
972
|
"runStartTimestamp": null,
|
|
995
|
-
"serialization": undefined,
|
|
996
973
|
"serializedEditorState": null,
|
|
997
974
|
"staleInputs": false,
|
|
998
975
|
"status": "idle",
|
|
@@ -1034,7 +1011,6 @@ exports[`cell reducer > can run cell and receive cell messages 9`] = `
|
|
|
1034
1011
|
},
|
|
1035
1012
|
"runElapsedTimeMs": 13000,
|
|
1036
1013
|
"runStartTimestamp": null,
|
|
1037
|
-
"serialization": undefined,
|
|
1038
1014
|
"serializedEditorState": null,
|
|
1039
1015
|
"staleInputs": false,
|
|
1040
1016
|
"status": "idle",
|
|
@@ -1077,7 +1053,6 @@ import numpy",
|
|
|
1077
1053
|
},
|
|
1078
1054
|
"runElapsedTimeMs": 13000,
|
|
1079
1055
|
"runStartTimestamp": null,
|
|
1080
|
-
"serialization": undefined,
|
|
1081
1056
|
"serializedEditorState": null,
|
|
1082
1057
|
"staleInputs": false,
|
|
1083
1058
|
"status": "idle",
|
|
@@ -1127,7 +1102,6 @@ import numpy",
|
|
|
1127
1102
|
},
|
|
1128
1103
|
"runElapsedTimeMs": 11000,
|
|
1129
1104
|
"runStartTimestamp": null,
|
|
1130
|
-
"serialization": undefined,
|
|
1131
1105
|
"serializedEditorState": null,
|
|
1132
1106
|
"staleInputs": false,
|
|
1133
1107
|
"status": "idle",
|
|
@@ -1175,7 +1149,6 @@ import numpy",
|
|
|
1175
1149
|
},
|
|
1176
1150
|
"runElapsedTimeMs": 11000,
|
|
1177
1151
|
"runStartTimestamp": null,
|
|
1178
|
-
"serialization": undefined,
|
|
1179
1152
|
"serializedEditorState": null,
|
|
1180
1153
|
"staleInputs": false,
|
|
1181
1154
|
"status": "idle",
|
|
@@ -1303,7 +1276,6 @@ exports[`cell reducer > errors reset status to idle 4`] = `
|
|
|
1303
1276
|
},
|
|
1304
1277
|
"runElapsedTimeMs": null,
|
|
1305
1278
|
"runStartTimestamp": null,
|
|
1306
|
-
"serialization": undefined,
|
|
1307
1279
|
"serializedEditorState": null,
|
|
1308
1280
|
"staleInputs": false,
|
|
1309
1281
|
"status": "idle",
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
import { describe, expect, it } from "vitest";
|
|
3
|
-
import type { OutputMessage } from "@/core/kernel/messages";
|
|
3
|
+
import type { CellMessage, OutputMessage } from "@/core/kernel/messages";
|
|
4
4
|
import type { RuntimeState } from "@/core/network/types";
|
|
5
5
|
import type { Seconds } from "@/utils/time";
|
|
6
|
-
import { outputIsLoading, outputIsStale } from "../cell";
|
|
6
|
+
import { outputIsLoading, outputIsStale, transitionCell } from "../cell";
|
|
7
|
+
import { createCellRuntimeState } from "../types";
|
|
7
8
|
|
|
8
9
|
const STATUSES: RuntimeState[] = [
|
|
9
10
|
"queued",
|
|
@@ -191,3 +192,29 @@ describe("outputIsStale", () => {
|
|
|
191
192
|
expect(outputIsStale(cell, edited)).toBe(false);
|
|
192
193
|
});
|
|
193
194
|
});
|
|
195
|
+
|
|
196
|
+
describe("transitionCell serialization", () => {
|
|
197
|
+
function cellMessage(serialization?: string | null): CellMessage {
|
|
198
|
+
return {
|
|
199
|
+
cell_id: "cell-1",
|
|
200
|
+
...(serialization === undefined ? {} : { serialization }),
|
|
201
|
+
} as CellMessage;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
it("leaves the hint unchanged when serialization is omitted", () => {
|
|
205
|
+
const cell = createCellRuntimeState({ serialization: "Valid" });
|
|
206
|
+
expect(transitionCell(cell, cellMessage()).serialization).toBe("Valid");
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
it("clears the hint when serialization is null", () => {
|
|
210
|
+
const cell = createCellRuntimeState({ serialization: "Valid" });
|
|
211
|
+
expect(transitionCell(cell, cellMessage(null)).serialization).toBeNull();
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
it("sets the hint when serialization is a string", () => {
|
|
215
|
+
const cell = createCellRuntimeState();
|
|
216
|
+
expect(transitionCell(cell, cellMessage("Valid")).serialization).toBe(
|
|
217
|
+
"Valid",
|
|
218
|
+
);
|
|
219
|
+
});
|
|
220
|
+
});
|
package/src/core/cells/cell.ts
CHANGED
|
@@ -73,7 +73,11 @@ export function transitionCell(
|
|
|
73
73
|
nextCell.output = message.output ?? nextCell.output;
|
|
74
74
|
nextCell.staleInputs = message.stale_inputs ?? nextCell.staleInputs;
|
|
75
75
|
nextCell.status = message.status ?? nextCell.status;
|
|
76
|
-
|
|
76
|
+
// Tri-state partial update: an omitted field (undefined) leaves the hint
|
|
77
|
+
// unchanged; null explicitly clears it; a string sets it.
|
|
78
|
+
if (message.serialization !== undefined) {
|
|
79
|
+
nextCell.serialization = message.serialization;
|
|
80
|
+
}
|
|
77
81
|
|
|
78
82
|
let didInterruptFromThisMessage = false;
|
|
79
83
|
|
|
@@ -39,6 +39,43 @@ afterEach(() => {
|
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
describe("goToDefinitionAtCursorPosition", () => {
|
|
42
|
+
test("jumps to a reactive variable definition in another cell", async () => {
|
|
43
|
+
const definingCell = cellId("defining-cell");
|
|
44
|
+
const usageCell = cellId("usage-cell");
|
|
45
|
+
const definingCode = "a = 10";
|
|
46
|
+
const usageCode = "print(a)";
|
|
47
|
+
|
|
48
|
+
const definingView = createEditor(definingCode, definingCode.length);
|
|
49
|
+
const usageView = createEditor(usageCode, usageCode.indexOf("a"));
|
|
50
|
+
views.push(definingView, usageView);
|
|
51
|
+
|
|
52
|
+
const notebook = initialNotebookState();
|
|
53
|
+
notebook.cellHandles[definingCell] = {
|
|
54
|
+
current: { editorView: definingView, editorViewOrNull: definingView },
|
|
55
|
+
};
|
|
56
|
+
notebook.cellHandles[usageCell] = {
|
|
57
|
+
current: { editorView: usageView, editorViewOrNull: usageView },
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
store.set(notebookAtom, notebook);
|
|
61
|
+
store.set(variablesAtom, {
|
|
62
|
+
[variableName("a")]: {
|
|
63
|
+
dataType: "int",
|
|
64
|
+
declaredBy: [definingCell],
|
|
65
|
+
name: variableName("a"),
|
|
66
|
+
usedBy: [usageCell],
|
|
67
|
+
value: "10",
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const result = goToDefinitionAtCursorPosition(usageView);
|
|
72
|
+
|
|
73
|
+
expect(result).toBe(true);
|
|
74
|
+
await tick();
|
|
75
|
+
expect(definingView.state.selection.main.head).toBe(0);
|
|
76
|
+
expect(usageView.state.selection.main.head).toBe(usageCode.indexOf("a"));
|
|
77
|
+
});
|
|
78
|
+
|
|
42
79
|
test("prefers the current-cell local definition over a reactive global", async () => {
|
|
43
80
|
const globalCell = cellId("global-cell");
|
|
44
81
|
const localCell = cellId("local-cell");
|
|
@@ -28,10 +28,11 @@ interface VariableDeclaration {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
function goToPosition(view: EditorView, from: number): void {
|
|
31
|
-
|
|
32
|
-
//
|
|
33
|
-
//
|
|
31
|
+
// Focus on the next frame: a synchronous focus is a no-op while a Radix
|
|
32
|
+
// context menu still owns focus, and codemirror would otherwise add a
|
|
33
|
+
// cursor from the pointer click.
|
|
34
34
|
requestAnimationFrame(() => {
|
|
35
|
+
view.focus();
|
|
35
36
|
view.dispatch({
|
|
36
37
|
selection: {
|
|
37
38
|
anchor: from,
|
|
@@ -403,22 +404,29 @@ function findScopedDefinitionPosition(
|
|
|
403
404
|
}
|
|
404
405
|
|
|
405
406
|
/**
|
|
406
|
-
* This function
|
|
407
|
-
*
|
|
407
|
+
* This function selects a scoped definition for the given variable name, when
|
|
408
|
+
* a usage position is available, or optionally falls back to the first matching
|
|
409
|
+
* variable name in the given editor view.
|
|
408
410
|
* @param view The editor view which contains the variable name.
|
|
409
411
|
* @param variableName The name of the variable to select, if found in the editor.
|
|
410
412
|
* @param usagePosition The position of the variable usage, if available.
|
|
413
|
+
* @param fallbackToFirstMatch Whether to fall back to the first matching
|
|
414
|
+
* variable name when no scoped definition is found. Defaults to true.
|
|
411
415
|
*/
|
|
412
416
|
export function goToVariableDefinition(
|
|
413
417
|
view: EditorView,
|
|
414
418
|
variableName: string,
|
|
415
419
|
usagePosition?: number,
|
|
420
|
+
fallbackToFirstMatch = true,
|
|
416
421
|
): boolean {
|
|
417
422
|
const { state } = view;
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
423
|
+
let from: number | null = null;
|
|
424
|
+
if (usagePosition !== undefined) {
|
|
425
|
+
from = findScopedDefinitionPosition(state, variableName, usagePosition);
|
|
426
|
+
}
|
|
427
|
+
if (from === null && fallbackToFirstMatch) {
|
|
428
|
+
from = findFirstMatchingVariable(state, variableName);
|
|
429
|
+
}
|
|
422
430
|
|
|
423
431
|
if (from === null) {
|
|
424
432
|
return false;
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
} from "@codemirror/lang-sql";
|
|
15
15
|
import {
|
|
16
16
|
BigQueryDialect,
|
|
17
|
+
DremioDialect,
|
|
17
18
|
DuckDBDialect,
|
|
18
19
|
} from "@marimo-team/codemirror-sql/dialects";
|
|
19
20
|
import type { DataSourceConnection } from "@/core/kernel/messages";
|
|
@@ -97,6 +98,8 @@ export function guessDialect(
|
|
|
97
98
|
return PLSQL;
|
|
98
99
|
case "bigquery":
|
|
99
100
|
return BigQueryDialect;
|
|
101
|
+
case "dremio":
|
|
102
|
+
return DremioDialect;
|
|
100
103
|
case "timescaledb":
|
|
101
104
|
return PostgreSQL; // TimescaleDB is a PostgreSQL dialect
|
|
102
105
|
case "awsathena":
|
|
@@ -116,7 +119,6 @@ export function guessDialect(
|
|
|
116
119
|
case "spark":
|
|
117
120
|
case "databricks":
|
|
118
121
|
case "datafusion":
|
|
119
|
-
case "dremio":
|
|
120
122
|
Logger.debug("Unsupported dialect", { dialect });
|
|
121
123
|
return ModifiedStandardSQL;
|
|
122
124
|
default:
|
|
@@ -169,6 +169,7 @@ const {
|
|
|
169
169
|
return {
|
|
170
170
|
...db,
|
|
171
171
|
schemas: schemas,
|
|
172
|
+
schemas_resolved: true,
|
|
172
173
|
};
|
|
173
174
|
}),
|
|
174
175
|
};
|
|
@@ -213,6 +214,7 @@ const {
|
|
|
213
214
|
return {
|
|
214
215
|
...schema,
|
|
215
216
|
tables: tables,
|
|
217
|
+
tables_resolved: true,
|
|
216
218
|
};
|
|
217
219
|
}),
|
|
218
220
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
|
+
import { toast } from "@/components/ui/use-toast";
|
|
4
|
+
import { createStaticRequests } from "../requests-static";
|
|
5
|
+
|
|
6
|
+
vi.mock("@/components/ui/use-toast", () => ({ toast: vi.fn() }));
|
|
7
|
+
|
|
8
|
+
describe("createStaticRequests static-notebook toast", () => {
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
vi.mocked(toast).mockClear();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("requests a once-toast with a stable id on component value updates", async () => {
|
|
14
|
+
const requests = createStaticRequests();
|
|
15
|
+
await requests.sendComponentValues({} as never);
|
|
16
|
+
|
|
17
|
+
expect(toast).toHaveBeenCalledWith(
|
|
18
|
+
expect.objectContaining({ id: "static-notebook", once: true }),
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("uses the same once-toast for function requests", async () => {
|
|
23
|
+
const requests = createStaticRequests();
|
|
24
|
+
await requests.sendFunctionRequest({} as never);
|
|
25
|
+
|
|
26
|
+
expect(toast).toHaveBeenCalledWith(
|
|
27
|
+
expect.objectContaining({ id: "static-notebook", once: true }),
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -3,6 +3,18 @@ import { toast } from "@/components/ui/use-toast";
|
|
|
3
3
|
import { Logger } from "@/utils/Logger";
|
|
4
4
|
import type { EditRequests, RunRequests } from "./types";
|
|
5
5
|
|
|
6
|
+
const STATIC_NOTEBOOK_TOAST_ID = "static-notebook";
|
|
7
|
+
|
|
8
|
+
function showStaticNotebookToast() {
|
|
9
|
+
toast({
|
|
10
|
+
id: STATIC_NOTEBOOK_TOAST_ID,
|
|
11
|
+
once: true,
|
|
12
|
+
title: "Static notebook",
|
|
13
|
+
description:
|
|
14
|
+
"This notebook is not connected to a kernel. Any interactive elements will not work.",
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
6
18
|
export function createStaticRequests(): EditRequests & RunRequests {
|
|
7
19
|
const throwNotInEditMode = () => {
|
|
8
20
|
throw new Error("Unreachable. Expected to be in run mode");
|
|
@@ -10,11 +22,7 @@ export function createStaticRequests(): EditRequests & RunRequests {
|
|
|
10
22
|
|
|
11
23
|
return {
|
|
12
24
|
sendComponentValues: async () => {
|
|
13
|
-
|
|
14
|
-
title: "Static notebook",
|
|
15
|
-
description:
|
|
16
|
-
"This notebook is not connected to a kernel. Any interactive elements will not work.",
|
|
17
|
-
});
|
|
25
|
+
showStaticNotebookToast();
|
|
18
26
|
Logger.log("Updating UI elements is not supported in static mode");
|
|
19
27
|
return null;
|
|
20
28
|
},
|
|
@@ -27,11 +35,7 @@ export function createStaticRequests(): EditRequests & RunRequests {
|
|
|
27
35
|
return null;
|
|
28
36
|
},
|
|
29
37
|
sendFunctionRequest: async () => {
|
|
30
|
-
|
|
31
|
-
title: "Static notebook",
|
|
32
|
-
description:
|
|
33
|
-
"This notebook is not connected to a kernel. Any interactive elements will not work.",
|
|
34
|
-
});
|
|
38
|
+
showStaticNotebookToast();
|
|
35
39
|
Logger.log("Function requests are not supported in static mode");
|
|
36
40
|
return null;
|
|
37
41
|
},
|
|
@@ -55,6 +55,10 @@ export class DefaultWasmController implements WasmController {
|
|
|
55
55
|
// Load pyodide and packages
|
|
56
56
|
const span = t.startSpan("loadPyodide");
|
|
57
57
|
try {
|
|
58
|
+
// Without this, this fails in Firefox with
|
|
59
|
+
// `Could not extract indexURL path from pyodide module`
|
|
60
|
+
// This fixes for Firefox and does not break Chrome/others
|
|
61
|
+
const indexURL = `https://cdn.jsdelivr.net/pyodide/${opts.pyodideVersion}/full/`;
|
|
58
62
|
const pyodide = await loadPyodide({
|
|
59
63
|
// Perf: These get loaded while pyodide is being bootstrapped
|
|
60
64
|
packages: [
|
|
@@ -68,10 +72,14 @@ export class DefaultWasmController implements WasmController {
|
|
|
68
72
|
],
|
|
69
73
|
_makeSnapshot: MAKE_SNAPSHOT,
|
|
70
74
|
lockFileURL: `https://wasm.marimo.app/pyodide-lock.json?v=${opts.version}&pyodide=${opts.pyodideVersion}`,
|
|
71
|
-
|
|
72
|
-
//
|
|
73
|
-
//
|
|
74
|
-
|
|
75
|
+
indexURL,
|
|
76
|
+
// Since Pyodide 0.28.0, when lockFileURL is set, the package base URL
|
|
77
|
+
// defaults to the lockfile's URL (wasm.marimo.app) instead of indexURL.
|
|
78
|
+
// Unlike Node, browsers get no CDN fallback on a failed fetch, so we
|
|
79
|
+
// should pin packageBaseUrl back to the jsDelivr CDN to restore
|
|
80
|
+
// the resolution akin to pre-0.28.
|
|
81
|
+
packageBaseUrl: indexURL,
|
|
82
|
+
convertNullToNone: true,
|
|
75
83
|
});
|
|
76
84
|
this.pyodide = pyodide;
|
|
77
85
|
span.end("ok");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./worker-ip3AI_sN.js";var t=e(((e,t)=>{t.exports={}}));export default t();
|