@marimo-team/islands 0.23.16-dev25 → 0.23.16-dev28
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/{chat-ui-BMBk8I78.js → chat-ui-DuPGKU9z.js} +12 -12
- package/dist/{code-visibility-Btz9Lj-7.js → code-visibility-CTlBHNhq.js} +847 -823
- package/dist/{html-to-image-27MFfyOf.js → html-to-image-Bza3T2dl.js} +2124 -2114
- package/dist/main.js +5 -5
- package/dist/{process-output-BpssYna4.js → process-output-pCEXvnhG.js} +1 -1
- package/dist/{reveal-component-ByqpHkkW.js → reveal-component-CAfix0fI.js} +2 -2
- package/package.json +1 -1
- package/src/components/data-table/__tests__/__snapshots__/chart-spec-model.test.ts.snap +174 -21
- package/src/components/data-table/__tests__/chart-spec-model.test.ts +102 -1
- package/src/components/data-table/column-summary/chart-spec-model.tsx +163 -103
- package/src/components/data-table/column-summary/legacy-chart-spec.ts +15 -7
- package/src/components/data-table/column-summary/utils.ts +26 -7
- package/src/components/data-table/types.ts +1 -1
- package/src/core/codemirror/find-replace/__tests__/navigate.test.ts +42 -30
- package/src/core/codemirror/find-replace/navigate.ts +2 -0
- package/src/core/codemirror/go-to-definition/__tests__/commands.test.ts +24 -3
- package/src/core/codemirror/go-to-definition/commands.ts +3 -0
- package/src/core/codemirror/utils.ts +28 -0
- package/src/core/network/types.ts +3 -1
|
@@ -4,6 +4,7 @@ import { syntaxTree } from "@codemirror/language";
|
|
|
4
4
|
import type { EditorState } from "@codemirror/state";
|
|
5
5
|
import { EditorView } from "@codemirror/view";
|
|
6
6
|
import type { SyntaxNode, Tree, TreeCursor } from "@lezer/common";
|
|
7
|
+
import { scrollOwnerCell } from "../utils";
|
|
7
8
|
|
|
8
9
|
const SCOPE_CREATING_NODES = new Set([
|
|
9
10
|
"FunctionDefinition",
|
|
@@ -45,6 +46,8 @@ function goToPosition(view: EditorView, from: number): void {
|
|
|
45
46
|
}),
|
|
46
47
|
});
|
|
47
48
|
});
|
|
49
|
+
|
|
50
|
+
scrollOwnerCell(view);
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
function findFirstMatchingVariable(
|
|
@@ -52,6 +52,34 @@ export function focusInputAndMoveToEnd(
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Scrolls the `.marimo-cell` that owns `view` into view.
|
|
57
|
+
*
|
|
58
|
+
* `EditorView.scrollIntoView` doesn't work in columns mode: it stops at the
|
|
59
|
+
* first overflowing ancestor even if that ancestor doesn't actually scroll,
|
|
60
|
+
* so it never reaches the real horizontally-scrolling container. The
|
|
61
|
+
* browser's native `Element.scrollIntoView` doesn't have that problem.
|
|
62
|
+
*
|
|
63
|
+
* Deferred a frame so CodeMirror's own scroll settles first; otherwise it
|
|
64
|
+
* clamps this scroll right back.
|
|
65
|
+
*
|
|
66
|
+
* https://github.com/marimo-team/marimo/issues/10222
|
|
67
|
+
*/
|
|
68
|
+
export function scrollOwnerCell(view: EditorView): void {
|
|
69
|
+
const cell = view.dom.closest(".marimo-cell");
|
|
70
|
+
if (!cell) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
requestAnimationFrame(() => {
|
|
75
|
+
cell.scrollIntoView({
|
|
76
|
+
behavior: "instant",
|
|
77
|
+
block: "nearest",
|
|
78
|
+
inline: "nearest",
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
55
83
|
export function isInVimMode(ev: EditorView): boolean {
|
|
56
84
|
return getCM(ev)?.state.vim != null;
|
|
57
85
|
}
|
|
@@ -17,6 +17,8 @@ export type CellConfig = schemas["CellConfig"];
|
|
|
17
17
|
export type RuntimeState = schemas["CellNotification"]["status"];
|
|
18
18
|
export type CodeCompletionRequest = schemas["CodeCompletionRequest"];
|
|
19
19
|
export type DeleteCellRequest = schemas["DeleteCellRequest"];
|
|
20
|
+
export type AutoExportAsMarkdownRequest =
|
|
21
|
+
schemas["AutoExportAsMarkdownRequest"];
|
|
20
22
|
export type ExportAsHTMLRequest = schemas["ExportAsHTMLRequest"];
|
|
21
23
|
export type ExportAsMarkdownRequest = schemas["ExportAsMarkdownRequest"];
|
|
22
24
|
export type ExportAsIPYNBRequest = schemas["ExportAsIPYNBRequest"];
|
|
@@ -221,7 +223,7 @@ export interface EditRequests {
|
|
|
221
223
|
) => Promise<ExportedFile<string>>;
|
|
222
224
|
exportAsPDF: (request: ExportAsPDFRequest) => Promise<ExportedFile<Blob>>;
|
|
223
225
|
autoExportAsHTML: (request: ExportAsHTMLRequest) => Promise<null>;
|
|
224
|
-
autoExportAsMarkdown: (request:
|
|
226
|
+
autoExportAsMarkdown: (request: AutoExportAsMarkdownRequest) => Promise<null>;
|
|
225
227
|
autoExportAsIPYNB: (request: ExportAsIPYNBRequest) => Promise<null>;
|
|
226
228
|
updateCellOutputs: (request: UpdateCellOutputsRequest) => Promise<null>;
|
|
227
229
|
// Package requests
|