@marimo-team/islands 0.21.2-dev33 → 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
|
@@ -70858,7 +70858,7 @@ Image URL: ${r.imageUrl}`)), contextToXml({
|
|
|
70858
70858
|
return Logger.warn("Failed to get version from mount config"), null;
|
|
70859
70859
|
}
|
|
70860
70860
|
}
|
|
70861
|
-
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.21.2-
|
|
70861
|
+
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.21.2-dev34"), showCodeInRunModeAtom = atom(true);
|
|
70862
70862
|
atom(null);
|
|
70863
70863
|
var import_compiler_runtime$89 = require_compiler_runtime();
|
|
70864
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([
|