@marimo-team/islands 0.19.3-dev8 → 0.19.4-dev0

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.
Files changed (74) hide show
  1. package/dist/{Combination-33P1MEPK.js → Combination-BOmAhdTT.js} +1 -1
  2. package/dist/{ConnectedDataExplorerComponent-BIfUtj_S.js → ConnectedDataExplorerComponent-D5KcOOzu.js} +7 -7
  3. package/dist/{any-language-editor-Bda9cY1_.js → any-language-editor-vYraVrwE.js} +3 -3
  4. package/dist/assets/__vite-browser-external-CgHmDpAZ.js +1 -0
  5. package/dist/assets/{worker-njnjDMwL.js → worker-BR7KVExK.js} +2 -2
  6. package/dist/{button-BlF-78eJ.js → button-D6ZIdUA3.js} +1 -1
  7. package/dist/{check-DDykH_Yi.js → check-S8ldILuD.js} +1 -1
  8. package/dist/{copy-B5nooU3m.js → copy-ACOJ1BXr.js} +1 -1
  9. package/dist/{error-banner-UH0Nxilf.js → error-banner-BhqH4mGj.js} +2 -2
  10. package/dist/{esm-D197NGQX.js → esm-DOBJQbuy.js} +4 -4
  11. package/dist/{glide-data-editor-Bv8bVIJ9.js → glide-data-editor-DsVDCmV2.js} +6 -6
  12. package/dist/{label-oKuiQuiM.js → label-BaX2bLJa.js} +4 -4
  13. package/dist/main.js +453 -459
  14. package/dist/{mermaid-JA6veDHv.js → mermaid-DZjjc-kI.js} +2 -2
  15. package/dist/{slides-component-CJJp5XN4.js → slides-component-BHWhzwDN.js} +1 -1
  16. package/dist/{spec-hsYzGr6F.js → spec-B1PGDiGh.js} +4 -4
  17. package/dist/style.css +1 -1
  18. package/dist/{types-DEmfj_i8.js → types-CbQF8CBX.js} +294 -255
  19. package/dist/{useAsyncData-BGpae_uu.js → useAsyncData-TLXJC7yx.js} +1 -1
  20. package/dist/{useDeepCompareMemoize-1wVjsLov.js → useDeepCompareMemoize-DVnEG7jx.js} +3 -3
  21. package/dist/{useTheme-DdLjooMf.js → useTheme-BllQjRdW.js} +1 -0
  22. package/dist/{vega-component-BGTsperM.js → vega-component-B2QrGnW8.js} +6 -6
  23. package/package.json +5 -5
  24. package/src/__mocks__/requests.ts +1 -0
  25. package/src/__tests__/mount.test.ts +128 -0
  26. package/src/components/app-config/__tests__/get-dirty-values.test.ts +1 -1
  27. package/src/components/app-config/ai-config.tsx +328 -28
  28. package/src/components/app-config/user-config-form.tsx +10 -3
  29. package/src/components/chat/acp/agent-panel.tsx +56 -43
  30. package/src/components/chat/chat-utils.ts +0 -19
  31. package/src/components/data-table/column-header.tsx +1 -1
  32. package/src/components/editor/KernelStartupErrorModal.tsx +2 -2
  33. package/src/components/editor/actions/name-cell-input.tsx +10 -4
  34. package/src/components/editor/ai/completion-handlers.tsx +1 -1
  35. package/src/components/editor/alerts/connecting-alert.tsx +33 -6
  36. package/src/components/editor/chrome/types.ts +2 -4
  37. package/src/components/editor/chrome/wrapper/app-chrome.tsx +55 -58
  38. package/src/components/editor/chrome/wrapper/footer-items/runtime-settings.tsx +150 -96
  39. package/src/components/editor/renderers/vertical-layout/__tests__/useFocusFirstEditor.test.ts +27 -0
  40. package/src/components/editor/renderers/vertical-layout/useFocusFirstEditor.ts +6 -0
  41. package/src/components/utils/lazy-mount.tsx +29 -8
  42. package/src/core/ai/ids/ids.ts +12 -4
  43. package/src/core/cells/cells.ts +2 -0
  44. package/src/core/cells/scrollCellIntoView.ts +3 -2
  45. package/src/core/codemirror/cm.ts +2 -0
  46. package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +123 -0
  47. package/src/core/codemirror/lsp/notebook-lsp.ts +44 -4
  48. package/src/core/codemirror/misc/__tests__/string-braces.test.ts +200 -0
  49. package/src/core/codemirror/misc/string-braces.ts +37 -0
  50. package/src/core/config/__tests__/config-schema.test.ts +36 -0
  51. package/src/core/config/config-schema.ts +1 -0
  52. package/src/core/export/__tests__/hooks.test.ts +504 -0
  53. package/src/core/export/hooks.ts +93 -4
  54. package/src/core/islands/bridge.ts +1 -0
  55. package/src/core/kernel/__tests__/handlers.test.ts +2 -2
  56. package/src/core/kernel/state.ts +1 -0
  57. package/src/core/network/__tests__/requests-lazy.test.ts +1 -1
  58. package/src/core/network/__tests__/requests-network.test.ts +0 -18
  59. package/src/core/network/requests-lazy.ts +3 -2
  60. package/src/core/network/requests-network.ts +10 -7
  61. package/src/core/network/requests-static.ts +1 -0
  62. package/src/core/network/requests-toasting.tsx +1 -0
  63. package/src/core/network/types.ts +2 -0
  64. package/src/core/wasm/bridge.ts +1 -0
  65. package/src/css/globals.css +2 -0
  66. package/src/hooks/__tests__/useInterval.test.tsx +104 -0
  67. package/src/hooks/useInterval.ts +32 -6
  68. package/src/mount.tsx +6 -0
  69. package/src/plugins/impl/chat/ChatPlugin.tsx +2 -4
  70. package/src/plugins/impl/chat/chat-ui.tsx +62 -191
  71. package/src/plugins/impl/chat/types.ts +5 -12
  72. package/src/plugins/impl/data-frames/DataFramePlugin.tsx +3 -1
  73. package/src/utils/events.ts +1 -0
  74. package/dist/assets/__vite-browser-external-CpAWmIPM.js +0 -1
@@ -1,7 +1,7 @@
1
1
  import { s as __toESM } from "./chunk-BNovOVIE.js";
2
2
  import { t as require_react } from "./react-DdA8EBol.js";
3
3
  import { t as require_compiler_runtime } from "./compiler-runtime-DHFVbq0b.js";
4
- import { h as useEvent_default } from "./useTheme-DdLjooMf.js";
4
+ import { h as useEvent_default } from "./useTheme-BllQjRdW.js";
5
5
  import { t as invariant } from "./invariant-BW72tHBT.js";
6
6
  var import_compiler_runtime = require_compiler_runtime(), import_react = /* @__PURE__ */ __toESM(require_react(), 1), Result = {
7
7
  error(e, s) {
@@ -4,11 +4,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4
4
  import { s as __toESM, t as __commonJSMin } from "./chunk-BNovOVIE.js";
5
5
  import { t as require_react } from "./react-DdA8EBol.js";
6
6
  import { t as require_compiler_runtime } from "./compiler-runtime-DHFVbq0b.js";
7
- import { N as createLucideIcon } from "./Combination-33P1MEPK.js";
8
- import { a as cva, u as cn } from "./button-BlF-78eJ.js";
7
+ import { N as createLucideIcon } from "./Combination-BOmAhdTT.js";
8
+ import { a as cva, u as cn } from "./button-D6ZIdUA3.js";
9
9
  import { s as Logger } from "./hotkeys-C4e3s3sJ.js";
10
10
  import { t as require_jsx_runtime } from "./jsx-runtime-CTBg5pdT.js";
11
- import { f as waitFor, p as isIslands, u as store, x as atom } from "./useTheme-DdLjooMf.js";
11
+ import { f as waitFor, p as isIslands, u as store, x as atom } from "./useTheme-BllQjRdW.js";
12
12
  import { r as KnownQueryParams } from "./constants-DuN_eoAL.js";
13
13
  import { i as tableFromIPC } from "./loader-DH7xXi-E.js";
14
14
  var CircleQuestionMark = createLucideIcon("circle-question-mark", [
@@ -588,6 +588,7 @@ const UserConfigSchema = looseObject({
588
588
  aws_access_key_id: string().optional(),
589
589
  aws_secret_access_key: string().optional()
590
590
  }).optional(),
591
+ custom_providers: record(string(), AiConfigSchema).prefault({}),
591
592
  models: AiModelsSchema.prefault({
592
593
  displayed_models: [],
593
594
  custom_models: []
@@ -1,19 +1,19 @@
1
1
  import { s as __toESM } from "./chunk-BNovOVIE.js";
2
2
  import { t as require_react } from "./react-DdA8EBol.js";
3
3
  import { t as require_compiler_runtime } from "./compiler-runtime-DHFVbq0b.js";
4
- import "./Combination-33P1MEPK.js";
5
- import { S as CircleQuestionMark, a as AlertTitle, m as asRemoteURL, n as arrow, o as isValid, r as Alert, t as useDeepCompareMemoize } from "./useDeepCompareMemoize-1wVjsLov.js";
6
- import { l as Events } from "./button-BlF-78eJ.js";
4
+ import "./Combination-BOmAhdTT.js";
5
+ import { S as CircleQuestionMark, a as AlertTitle, m as asRemoteURL, n as arrow, o as isValid, r as Alert, t as useDeepCompareMemoize } from "./useDeepCompareMemoize-DVnEG7jx.js";
6
+ import { l as Events } from "./button-D6ZIdUA3.js";
7
7
  import { o as Objects, s as Logger } from "./hotkeys-C4e3s3sJ.js";
8
8
  import { t as require_jsx_runtime } from "./jsx-runtime-CTBg5pdT.js";
9
9
  import "./react-dom-DJW8xUDg.js";
10
- import { l as Tooltip, n as ErrorBanner } from "./error-banner-UH0Nxilf.js";
11
- import { h as useEvent_default, n as useTheme } from "./useTheme-DdLjooMf.js";
10
+ import { l as Tooltip, n as ErrorBanner } from "./error-banner-BhqH4mGj.js";
11
+ import { h as useEvent_default, n as useTheme } from "./useTheme-BllQjRdW.js";
12
12
  import { t as _baseUniq_default } from "./_baseUniq-BUGws47x.js";
13
13
  import { i as debounce_default } from "./constants-DuN_eoAL.js";
14
14
  import { a as tooltipHandler, n as vegaLoadData } from "./loader-DH7xXi-E.js";
15
15
  import { n as formats } from "./vega-loader.browser-nTy1NZD3.js";
16
- import { t as useAsyncData } from "./useAsyncData-BGpae_uu.js";
16
+ import { t as useAsyncData } from "./useAsyncData-TLXJC7yx.js";
17
17
  import { t as j } from "./react-vega-z40f-dXy.js";
18
18
  import "./defaultLocale-DZtxSCkJ.js";
19
19
  import "./defaultLocale-DMZFeDB8.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/islands",
3
- "version": "0.19.3-dev8",
3
+ "version": "0.19.4-dev0",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -55,7 +55,7 @@
55
55
  "@lezer/markdown": "^1.6.2",
56
56
  "@lezer/python": "^1.1.18",
57
57
  "@marimo-team/codemirror-ai": "^0.3.5",
58
- "@marimo-team/codemirror-languageserver": "^1.16.8",
58
+ "@marimo-team/codemirror-languageserver": "^1.16.10",
59
59
  "@marimo-team/codemirror-mcp": "^0.1.5",
60
60
  "@marimo-team/codemirror-sql": "^0.2.4",
61
61
  "@marimo-team/llm-info": "workspace:*",
@@ -146,8 +146,8 @@
146
146
  "plotly.js": "^2.35.3",
147
147
  "pyodide": "0.27.7",
148
148
  "react-arborist": "^3.4.3",
149
- "react-aria": "^3.44.0",
150
- "react-aria-components": "^1.13.0",
149
+ "react-aria": "^3.45.0",
150
+ "react-aria-components": "^1.14.0",
151
151
  "react-codemirror-merge": "4.25.4",
152
152
  "react-dnd": "^16.0.1",
153
153
  "react-dnd-html5-backend": "^16.0.1",
@@ -173,7 +173,7 @@
173
173
  "thememirror": "^2.0.1",
174
174
  "timestring": "^7.0.0",
175
175
  "typescript-memoize": "^1.1.1",
176
- "use-acp": "0.2.5",
176
+ "use-acp": "0.2.6",
177
177
  "use-resize-observer": "^9.1.0",
178
178
  "vega-lite": "6.3.1",
179
179
  "vega-loader": "^5.1.0",
@@ -63,6 +63,7 @@ export const MockRequestClient = {
63
63
  autoExportAsHTML: vi.fn().mockResolvedValue({}),
64
64
  autoExportAsMarkdown: vi.fn().mockResolvedValue({}),
65
65
  autoExportAsIPYNB: vi.fn().mockResolvedValue({}),
66
+ updateCellOutputs: vi.fn().mockResolvedValue({}),
66
67
  addPackage: vi.fn().mockResolvedValue({}),
67
68
  removePackage: vi.fn().mockResolvedValue({}),
68
69
  getPackageList: vi.fn().mockResolvedValue({ packages: [] }),
@@ -0,0 +1,128 @@
1
+ /* Copyright 2026 Marimo. All rights reserved. */
2
+
3
+ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
4
+ import { connectionAtom } from "@/core/network/connection";
5
+ import { store } from "@/core/state/jotai";
6
+ import { WebSocketState } from "@/core/websocket/types";
7
+ import { mount, visibleForTesting } from "../mount";
8
+
9
+ // Mock React DOM
10
+ vi.mock("react-dom/client", () => ({
11
+ createRoot: vi.fn(() => ({
12
+ render: vi.fn(),
13
+ })),
14
+ }));
15
+
16
+ // Mock static state
17
+ vi.mock("@/core/static/static-state", () => ({
18
+ isStaticNotebook: vi.fn(() => false),
19
+ }));
20
+
21
+ // Mock other side-effect modules
22
+ vi.mock("@/core/vscode/vscode-bindings", () => ({
23
+ maybeRegisterVSCodeBindings: vi.fn(),
24
+ }));
25
+
26
+ vi.mock("@/plugins/plugins", () => ({
27
+ initializePlugins: vi.fn(),
28
+ }));
29
+
30
+ vi.mock("@/core/network/auth", () => ({
31
+ cleanupAuthQueryParams: vi.fn(),
32
+ }));
33
+
34
+ vi.mock("@/utils/vitals", () => ({
35
+ reportVitals: vi.fn(),
36
+ }));
37
+
38
+ // Mock preloadPage
39
+ vi.mock("@/core/MarimoApp", () => ({
40
+ MarimoApp: () => null,
41
+ preloadPage: vi.fn(),
42
+ }));
43
+
44
+ describe("mount", () => {
45
+ const mockElement = document.createElement("div");
46
+
47
+ beforeEach(() => {
48
+ visibleForTesting.reset();
49
+ // Reset connection atom to initial state
50
+ store.set(connectionAtom, { state: WebSocketState.NOT_STARTED });
51
+ });
52
+
53
+ afterEach(() => {
54
+ vi.clearAllMocks();
55
+ });
56
+
57
+ const baseOptions = {
58
+ filename: "test.py",
59
+ code: "",
60
+ version: "0.0.1",
61
+ mode: "edit" as const,
62
+ config: {},
63
+ configOverrides: {},
64
+ appConfig: {},
65
+ view: { showAppCode: true },
66
+ serverToken: "",
67
+ };
68
+
69
+ describe("connection state initialization", () => {
70
+ it("should set connection to CONNECTING when runtimeConfig has lazy=false", () => {
71
+ mount(
72
+ {
73
+ ...baseOptions,
74
+ runtimeConfig: [{ url: "http://localhost:8080", lazy: false }],
75
+ },
76
+ mockElement,
77
+ );
78
+
79
+ const connection = store.get(connectionAtom);
80
+ expect(connection.state).toBe(WebSocketState.CONNECTING);
81
+ });
82
+
83
+ it("should keep connection as NOT_STARTED when runtimeConfig has lazy=true", () => {
84
+ mount(
85
+ {
86
+ ...baseOptions,
87
+ runtimeConfig: [{ url: "http://localhost:8080", lazy: true }],
88
+ },
89
+ mockElement,
90
+ );
91
+
92
+ const connection = store.get(connectionAtom);
93
+ expect(connection.state).toBe(WebSocketState.NOT_STARTED);
94
+ });
95
+
96
+ it("should keep connection as NOT_STARTED when no runtimeConfig is provided", () => {
97
+ mount(
98
+ {
99
+ ...baseOptions,
100
+ runtimeConfig: [],
101
+ },
102
+ mockElement,
103
+ );
104
+
105
+ const connection = store.get(connectionAtom);
106
+ expect(connection.state).toBe(WebSocketState.NOT_STARTED);
107
+ });
108
+
109
+ it("should keep connection as NOT_STARTED for static notebooks even with lazy=false", async () => {
110
+ const { isStaticNotebook } = await import("@/core/static/static-state");
111
+ vi.mocked(isStaticNotebook).mockReturnValue(true);
112
+
113
+ // Reset mount state to allow another mount
114
+ visibleForTesting.reset();
115
+
116
+ mount(
117
+ {
118
+ ...baseOptions,
119
+ runtimeConfig: [{ url: "http://localhost:8080", lazy: false }],
120
+ },
121
+ mockElement,
122
+ );
123
+
124
+ const connection = store.get(connectionAtom);
125
+ expect(connection.state).toBe(WebSocketState.NOT_STARTED);
126
+ });
127
+ });
128
+ });
@@ -1,4 +1,4 @@
1
- /* Copyright 2024 Marimo. All rights reserved. */
1
+ /* Copyright 2026 Marimo. All rights reserved. */
2
2
 
3
3
  import { describe, expect, test } from "vitest";
4
4
  import { getDirtyValues } from "../user-config-form";