@marimo-team/islands 0.21.2-dev32 → 0.21.2-dev34
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/main.js
CHANGED
|
@@ -29779,7 +29779,9 @@ ${c.sqlString}
|
|
|
29779
29779
|
"D103"
|
|
29780
29780
|
], _ = [
|
|
29781
29781
|
"W292",
|
|
29782
|
-
"E402"
|
|
29782
|
+
"E402",
|
|
29783
|
+
"E302",
|
|
29784
|
+
"E305"
|
|
29783
29785
|
], v = [
|
|
29784
29786
|
"B018",
|
|
29785
29787
|
"I001"
|
|
@@ -70856,7 +70858,7 @@ Image URL: ${r.imageUrl}`)), contextToXml({
|
|
|
70856
70858
|
return Logger.warn("Failed to get version from mount config"), null;
|
|
70857
70859
|
}
|
|
70858
70860
|
}
|
|
70859
|
-
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.21.2-
|
|
70861
|
+
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.21.2-dev34"), showCodeInRunModeAtom = atom(true);
|
|
70860
70862
|
atom(null);
|
|
70861
70863
|
var import_compiler_runtime$89 = require_compiler_runtime();
|
|
70862
70864
|
function useKeydownOnElement(e, r) {
|
package/package.json
CHANGED
|
@@ -1,44 +1,24 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { completionKeymap } from "../keymap";
|
|
3
|
+
import { completionKeymap as defaultCompletionKeymap } from "@codemirror/autocomplete";
|
|
4
|
+
import { describe, expect, it } from "vitest";
|
|
5
|
+
import { filterCompletionBindings } from "../keymap";
|
|
7
6
|
|
|
8
7
|
describe("completionKeymap", () => {
|
|
9
|
-
it("
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
vi.spyOn(view.state, "field").mockReturnValue("pending");
|
|
17
|
-
|
|
18
|
-
view.dispatch({ changes: [], effects: [], annotations: [] });
|
|
19
|
-
const result = false; // Mock the expected result
|
|
20
|
-
|
|
21
|
-
// Should return false to propagate the Escape key
|
|
22
|
-
expect(result).toBe(false);
|
|
23
|
-
|
|
24
|
-
view.destroy();
|
|
8
|
+
it("upstream includes the macOS-only completion bindings we care about", () => {
|
|
9
|
+
expect(
|
|
10
|
+
defaultCompletionKeymap.some((binding) => binding.mac === "Alt-`"),
|
|
11
|
+
).toBe(true);
|
|
12
|
+
expect(
|
|
13
|
+
defaultCompletionKeymap.some((binding) => binding.mac === "Alt-i"),
|
|
14
|
+
).toBe(true);
|
|
25
15
|
});
|
|
26
16
|
|
|
27
|
-
it("
|
|
28
|
-
const
|
|
29
|
-
extensions: [completionKeymap()],
|
|
30
|
-
});
|
|
31
|
-
const view = new EditorView({ state });
|
|
32
|
-
|
|
33
|
-
// Mock completionStatus to return "active"
|
|
34
|
-
vi.spyOn(view.state, "field").mockReturnValue("active");
|
|
35
|
-
|
|
36
|
-
view.dispatch({ changes: [], effects: [], annotations: [] });
|
|
37
|
-
const result = true; // Mock the expected result
|
|
38
|
-
|
|
39
|
-
// Should return true to stop propagation
|
|
40
|
-
expect(result).toBe(true);
|
|
17
|
+
it("removes Alt-backtick and Escape while keeping Alt-i", () => {
|
|
18
|
+
const filtered = filterCompletionBindings(defaultCompletionKeymap);
|
|
41
19
|
|
|
42
|
-
|
|
20
|
+
expect(filtered.some((binding) => binding.mac === "Alt-`")).toBe(false);
|
|
21
|
+
expect(filtered.some((binding) => binding.key === "Escape")).toBe(false);
|
|
22
|
+
expect(filtered.some((binding) => binding.mac === "Alt-i")).toBe(true);
|
|
43
23
|
});
|
|
44
24
|
});
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
moveCompletionSelection,
|
|
7
7
|
} from "@codemirror/autocomplete";
|
|
8
8
|
import { type Extension, Prec } from "@codemirror/state";
|
|
9
|
-
import { keymap } from "@codemirror/view";
|
|
9
|
+
import { type KeyBinding, keymap } from "@codemirror/view";
|
|
10
10
|
import { isInVimMode } from "../utils";
|
|
11
11
|
|
|
12
12
|
const KEYS_TO_REMOVE = new Set<string | undefined>([
|
|
@@ -22,10 +22,20 @@ const KEYS_TO_REMOVE = new Set<string | undefined>([
|
|
|
22
22
|
"Alt-`",
|
|
23
23
|
]);
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
function hasRemovedKeybinding(binding: KeyBinding): boolean {
|
|
26
|
+
return [binding.key, binding.mac, binding.linux, binding.win].some((key) =>
|
|
27
|
+
KEYS_TO_REMOVE.has(key),
|
|
28
28
|
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function filterCompletionBindings(
|
|
32
|
+
bindings: readonly KeyBinding[],
|
|
33
|
+
): readonly KeyBinding[] {
|
|
34
|
+
return bindings.filter((binding) => !hasRemovedKeybinding(binding));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function completionKeymap(): Extension {
|
|
38
|
+
const withoutKeysToRemove = filterCompletionBindings(defaultCompletionKeymap);
|
|
29
39
|
|
|
30
40
|
return Prec.highest(
|
|
31
41
|
keymap.of([
|
|
@@ -69,6 +69,10 @@ const pylspClient = once((lspConfig: LSPConfig) => {
|
|
|
69
69
|
"W292", // No newline at end of file
|
|
70
70
|
// Modules can be imported in any cell
|
|
71
71
|
"E402", // Module level import not at top of file
|
|
72
|
+
// Blank line rules are not useful in marimo because cells are joined
|
|
73
|
+
// without extra blank lines, which can trigger these rules at cell boundaries
|
|
74
|
+
"E302", // Expected 2 blank lines, found 0
|
|
75
|
+
"E305", // Expected 2 blank lines after class or function definition, found 0
|
|
72
76
|
];
|
|
73
77
|
const ignoredRuffRules = [
|
|
74
78
|
// Even ruff documentation of this rule explains it is not useful in notebooks
|