@marimo-team/islands 0.23.14-dev6 → 0.23.14-dev61

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 (171) hide show
  1. package/dist/{ConnectedDataExplorerComponent-Du3_nUzI.js → ConnectedDataExplorerComponent-CU4fZJzG.js} +4 -4
  2. package/dist/assets/__vite-browser-external-BQCLNwri.js +1 -0
  3. package/dist/assets/{worker-DEDLIQQV.js → worker-DAWRHcPq.js} +2 -2
  4. package/dist/{chat-ui-BZxLHwyD.js → chat-ui-DinOvbWu.js} +3248 -3044
  5. package/dist/{click-outside-container-BDd67_1U.js → click-outside-container-BLPjMamz.js} +141 -113
  6. package/dist/{code-visibility-C90Am97q.js → code-visibility-EvXXzjfW.js} +1169 -960
  7. package/dist/data-grid-overlay-editor-C6lxUJp-.js +136 -0
  8. package/dist/{dist-D_bzzWBm.js → dist-Bf9f8MuT.js} +3 -3
  9. package/dist/{formats-d6MhLuQ9.js → formats-Dzx4J_z1.js} +1 -1
  10. package/dist/{glide-data-editor-DkzAInWG.js → glide-data-editor-CjTu7ukN.js} +2084 -1889
  11. package/dist/{html-to-image-CGp_08St.js → html-to-image-_wGfk8V-.js} +2389 -2322
  12. package/dist/{input-CbEz_aj_.js → input-DtsN7xm-.js} +1 -1
  13. package/dist/main.js +3630 -1801
  14. package/dist/{mermaid-CJW9vIyO.js → mermaid-BYqXy_NE.js} +2 -2
  15. package/dist/{number-overlay-editor-D-a0qCT8.js → number-overlay-editor-BLJXvX9c.js} +1 -1
  16. package/dist/{process-output-R6JsYrv3.js → process-output-Mh4UrjwM.js} +1 -1
  17. package/dist/{reveal-component-C_u9FY4_.js → reveal-component-CKfV5wlk.js} +600 -596
  18. package/dist/{spec-Bv-XlYiv.js → spec-Cz-Bj1JI.js} +1 -1
  19. package/dist/style.css +1 -1
  20. package/dist/{toDate-D-l5s8nn.js → toDate-CWNNlFEX.js} +15 -7
  21. package/dist/{useAsyncData-1Dhzjfwf.js → useAsyncData-KfHB8wQR.js} +1 -1
  22. package/dist/{useDeepCompareMemoize-CDWT3BDz.js → useDeepCompareMemoize-nJMtxhm4.js} +1 -1
  23. package/dist/{useLifecycle-AHlswLw-.js → useLifecycle-DegSo0lV.js} +1 -1
  24. package/dist/{useTheme-BrYvK-_A.js → useTheme-6eZ3GOTS.js} +31 -26
  25. package/dist/{vega-component-Pk6lyc_a.js → vega-component-DzyyM9fc.js} +5 -5
  26. package/package.json +4 -4
  27. package/src/__mocks__/requests.ts +1 -0
  28. package/src/__tests__/CellStatus.test.tsx +1 -2
  29. package/src/components/app-config/user-config-form.tsx +52 -0
  30. package/src/components/chat/acp/agent-panel.tsx +35 -1
  31. package/src/components/chat/chat-panel.tsx +68 -29
  32. package/src/components/data-table/__tests__/column-explorer.test.tsx +25 -0
  33. package/src/components/data-table/__tests__/column-visibility-dropdown.test.tsx +60 -3
  34. package/src/components/data-table/charts/__tests__/altair-generator.test.ts +24 -0
  35. package/src/components/data-table/charts/__tests__/merge-index-fields.test.ts +33 -0
  36. package/src/components/data-table/charts/chart-spec/altair-generator.ts +4 -1
  37. package/src/components/data-table/charts/charts.tsx +23 -1
  38. package/src/components/data-table/column-explorer-panel/column-explorer.tsx +33 -12
  39. package/src/components/data-table/column-visibility-dropdown.tsx +15 -0
  40. package/src/components/debugger/debugger-code.tsx +7 -2
  41. package/src/components/editor/actions/useNotebookActions.tsx +2 -2
  42. package/src/components/editor/cell/CellStatus.tsx +1 -20
  43. package/src/components/editor/cell/PendingDeleteConfirmation.tsx +1 -1
  44. package/src/components/editor/cell/cell-context-menu.tsx +2 -2
  45. package/src/components/editor/chrome/panels/snippets-panel.tsx +3 -3
  46. package/src/components/editor/chrome/wrapper/__tests__/useOpenAiAssistant.test.ts +36 -0
  47. package/src/components/editor/chrome/wrapper/footer-items/pyodide-status.tsx +6 -36
  48. package/src/components/editor/chrome/wrapper/useAiPanel.ts +3 -1
  49. package/src/components/editor/chrome/wrapper/useOpenAiAssistant.ts +88 -0
  50. package/src/components/editor/code/__tests__/readonly-python-code.test.tsx +79 -0
  51. package/src/components/editor/code/readonly-python-code.tsx +60 -33
  52. package/src/components/editor/errors/__tests__/auto-fix.test.ts +23 -0
  53. package/src/components/editor/errors/auto-fix.tsx +88 -34
  54. package/src/components/editor/errors/fix-mode.ts +1 -1
  55. package/src/components/editor/notebook-cell.tsx +7 -0
  56. package/src/components/editor/output/ImageOutput.tsx +20 -6
  57. package/src/components/editor/output/MarimoTracebackOutput.tsx +28 -2
  58. package/src/components/editor/output/__tests__/ImageOutput.test.tsx +53 -0
  59. package/src/components/editor/output/__tests__/traceback.test.tsx +14 -6
  60. package/src/components/editor/renderers/grid-layout/grid-layout.tsx +7 -2
  61. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +7 -3
  62. package/src/components/lifecycle/ProgressiveBoundary.tsx +42 -0
  63. package/src/components/lifecycle/RuntimeStatusBadge.tsx +59 -0
  64. package/src/components/lifecycle/__tests__/ProgressiveBoundary.test.tsx +147 -0
  65. package/src/components/lifecycle/__tests__/RuntimeStatusBadge.test.tsx +72 -0
  66. package/src/components/slides/__tests__/slide.test.tsx +33 -0
  67. package/src/components/slides/minimap.tsx +7 -1
  68. package/src/components/slides/reveal-component.tsx +3 -0
  69. package/src/components/slides/slide-cell-view.tsx +10 -6
  70. package/src/components/slides/slide.tsx +16 -13
  71. package/src/components/tracing/tracing.tsx +2 -1
  72. package/src/core/ai/config.ts +2 -2
  73. package/src/core/ai/context/__tests__/registry.test.ts +133 -3
  74. package/src/core/ai/context/providers/__tests__/datasource.test.ts +3 -1
  75. package/src/core/ai/context/providers/__tests__/error.test.ts +200 -15
  76. package/src/core/ai/context/providers/datasource.ts +27 -2
  77. package/src/core/ai/context/providers/error.ts +226 -36
  78. package/src/core/ai/context/registry.ts +77 -43
  79. package/src/core/ai/state.ts +11 -0
  80. package/src/core/cells/__tests__/cell.test.ts +39 -0
  81. package/src/core/cells/__tests__/readonly-code-display.test.ts +46 -0
  82. package/src/core/cells/cell.ts +5 -3
  83. package/src/core/cells/readonly-code-display.ts +35 -0
  84. package/src/core/codemirror/__tests__/setup.test.ts +33 -1
  85. package/src/core/codemirror/ai/resources.ts +15 -10
  86. package/src/core/codemirror/cells/__tests__/debugger-decorations.test.ts +185 -0
  87. package/src/core/codemirror/cells/__tests__/debugger-state.test.ts +224 -0
  88. package/src/core/codemirror/cells/__tests__/line-timing-decorations.test.ts +126 -0
  89. package/src/core/codemirror/cells/debugger-decorations.ts +188 -0
  90. package/src/core/codemirror/cells/debugger-state.ts +133 -0
  91. package/src/core/codemirror/cells/extensions.ts +32 -4
  92. package/src/core/codemirror/cells/line-timing-decorations.ts +165 -0
  93. package/src/core/codemirror/go-to-definition/__tests__/utils.test.ts +75 -3
  94. package/src/core/codemirror/go-to-definition/extension.ts +3 -3
  95. package/src/core/codemirror/go-to-definition/underline.ts +5 -14
  96. package/src/core/codemirror/go-to-definition/utils.ts +49 -1
  97. package/src/core/codemirror/utils.ts +15 -0
  98. package/src/core/config/__tests__/config-schema.test.ts +17 -0
  99. package/src/core/config/config-schema.ts +1 -0
  100. package/src/core/config/config.ts +10 -0
  101. package/src/core/config/feature-flag.tsx +4 -0
  102. package/src/core/edit-app.tsx +8 -5
  103. package/src/core/errors/errors.ts +2 -1
  104. package/src/core/islands/bootstrap.ts +4 -3
  105. package/src/core/islands/bridge.ts +1 -0
  106. package/src/core/lifecycle/__tests__/render-policy.test.ts +247 -0
  107. package/src/core/lifecycle/render-policy.ts +125 -0
  108. package/src/core/mime.ts +11 -4
  109. package/src/core/network/__tests__/api.test.ts +17 -0
  110. package/src/core/network/__tests__/requests-toasting.test.tsx +46 -0
  111. package/src/core/network/api.ts +17 -6
  112. package/src/core/network/requests-lazy.ts +1 -0
  113. package/src/core/network/requests-network.ts +8 -0
  114. package/src/core/network/requests-static.ts +1 -0
  115. package/src/core/network/requests-toasting.tsx +10 -1
  116. package/src/core/network/types.ts +2 -0
  117. package/src/core/run-app.tsx +27 -23
  118. package/src/core/runtime/__tests__/adapter.test.ts +160 -0
  119. package/src/core/runtime/__tests__/runtime.test.ts +45 -0
  120. package/src/core/runtime/adapter.ts +182 -0
  121. package/src/core/runtime/runtime.ts +30 -16
  122. package/src/core/wasm/PyodideLoader.tsx +20 -62
  123. package/src/core/wasm/bridge.ts +13 -4
  124. package/src/core/wasm/state.ts +8 -19
  125. package/src/core/websocket/__tests__/useMarimoKernelConnection.test.ts +4 -0
  126. package/src/core/websocket/__tests__/useWebSocket.test.ts +49 -0
  127. package/src/core/websocket/transports/__tests__/sse.test.ts +338 -0
  128. package/src/core/websocket/transports/sse.ts +308 -0
  129. package/src/core/websocket/useMarimoKernelConnection.tsx +58 -7
  130. package/src/core/websocket/useWebSocket.tsx +12 -2
  131. package/src/css/app/codemirror.css +14 -0
  132. package/src/hooks/__tests__/useDelayElapsed.test.tsx +55 -0
  133. package/src/hooks/useDelayElapsed.ts +27 -0
  134. package/src/mount.tsx +3 -3
  135. package/src/plugins/core/RenderHTML.tsx +35 -1
  136. package/src/plugins/core/__test__/RenderHTML.test.ts +44 -0
  137. package/src/plugins/impl/DataTablePlugin.tsx +1 -0
  138. package/src/plugins/impl/anywidget/AnyWidgetPlugin.tsx +33 -254
  139. package/src/plugins/impl/anywidget/__tests__/AnyWidgetPlugin.test.tsx +116 -174
  140. package/src/plugins/impl/anywidget/__tests__/host.test.ts +313 -0
  141. package/src/plugins/impl/anywidget/__tests__/model-proxy.test.ts +158 -0
  142. package/src/plugins/impl/anywidget/__tests__/model.test.ts +8 -177
  143. package/src/plugins/impl/anywidget/__tests__/registry.test.ts +708 -0
  144. package/src/plugins/impl/anywidget/__tests__/resolve-widget.test.ts +132 -0
  145. package/src/plugins/impl/anywidget/__tests__/widget-binding.test.ts +305 -133
  146. package/src/plugins/impl/anywidget/__tests__/widget-ref.test.ts +28 -0
  147. package/src/plugins/impl/anywidget/host.ts +54 -0
  148. package/src/plugins/impl/anywidget/model-proxy.ts +70 -0
  149. package/src/plugins/impl/anywidget/model.ts +59 -239
  150. package/src/plugins/impl/anywidget/registry.ts +268 -0
  151. package/src/plugins/impl/anywidget/resolve-widget.ts +138 -0
  152. package/src/plugins/impl/anywidget/runtime.ts +422 -0
  153. package/src/plugins/impl/anywidget/types.ts +14 -0
  154. package/src/plugins/impl/anywidget/widget-binding.ts +280 -119
  155. package/src/plugins/impl/anywidget/widget-ref.ts +29 -0
  156. package/src/plugins/impl/data-editor/__tests__/glide-data-editor.test.tsx +187 -0
  157. package/src/plugins/impl/data-editor/glide-data-editor.tsx +6 -0
  158. package/src/plugins/impl/data-editor/glide-portal.tsx +73 -0
  159. package/src/plugins/impl/mpl-interactive/MplInteractivePlugin.tsx +3 -2
  160. package/src/plugins/impl/mpl-interactive/__tests__/MplInteractivePlugin.test.tsx +16 -13
  161. package/src/plugins/impl/mpl-interactive/mpl-websocket-shim.ts +1 -1
  162. package/src/utils/errors.ts +15 -0
  163. package/src/utils/time.ts +20 -0
  164. package/dist/assets/__vite-browser-external-DAm_YW43.js +0 -1
  165. package/dist/data-grid-overlay-editor-mfEJ5475.js +0 -128
  166. package/src/components/editor/chrome/panels/__tests__/snippet-display.test.ts +0 -22
  167. package/src/components/editor/chrome/panels/snippet-display.ts +0 -27
  168. package/src/core/ai/context/providers/__tests__/__snapshots__/error.test.ts.snap +0 -3
  169. package/src/core/wasm/__tests__/PyodideLoader.test.ts +0 -72
  170. package/src/core/wasm/__tests__/state.test.ts +0 -124
  171. package/src/plugins/impl/anywidget/schemas.ts +0 -32
@@ -1,72 +0,0 @@
1
- /* Copyright 2026 Marimo. All rights reserved. */
2
-
3
- import { describe, expect, it } from "vitest";
4
- import { shouldShowSpinner } from "../PyodideLoader";
5
-
6
- describe("shouldShowSpinner", () => {
7
- it("shows the spinner when there are no cells yet (Pyodide hasn't parsed)", () => {
8
- expect(
9
- shouldShowSpinner({
10
- hasCells: false,
11
- hasOutput: false,
12
- mode: "read",
13
- codeHidden: false,
14
- }),
15
- ).toBe(true);
16
-
17
- expect(
18
- shouldShowSpinner({
19
- hasCells: false,
20
- hasOutput: true,
21
- mode: "edit",
22
- codeHidden: false,
23
- }),
24
- ).toBe(true);
25
- });
26
-
27
- it("renders children once cells exist with code visible", () => {
28
- // run mode, code visible, no outputs yet — the user can read the code
29
- expect(
30
- shouldShowSpinner({
31
- hasCells: true,
32
- hasOutput: false,
33
- mode: "read",
34
- codeHidden: false,
35
- }),
36
- ).toBe(false);
37
- });
38
-
39
- it("renders children once cells exist with cached outputs (snapshot case)", () => {
40
- expect(
41
- shouldShowSpinner({
42
- hasCells: true,
43
- hasOutput: true,
44
- mode: "read",
45
- codeHidden: true,
46
- }),
47
- ).toBe(false);
48
- });
49
-
50
- it("keeps the spinner up in headless run mode with no outputs", () => {
51
- // read mode + code hidden + no outputs = nothing visible to render
52
- expect(
53
- shouldShowSpinner({
54
- hasCells: true,
55
- hasOutput: false,
56
- mode: "read",
57
- codeHidden: true,
58
- }),
59
- ).toBe(true);
60
- });
61
-
62
- it("never blocks edit mode once cells exist", () => {
63
- expect(
64
- shouldShowSpinner({
65
- hasCells: true,
66
- hasOutput: false,
67
- mode: "edit",
68
- codeHidden: true,
69
- }),
70
- ).toBe(false);
71
- });
72
- });
@@ -1,124 +0,0 @@
1
- /* Copyright 2026 Marimo. All rights reserved. */
2
-
3
- import { createRef } from "react";
4
- import { describe, expect, it } from "vitest";
5
- import { cellId } from "@/__tests__/branded";
6
- import type { NotebookState } from "@/core/cells/cells";
7
- import { initialNotebookState, notebookAtom } from "@/core/cells/cells";
8
- import { createCell, createCellRuntimeState } from "@/core/cells/types";
9
- import type { OutputMessage } from "@/core/kernel/messages";
10
- import { store } from "@/core/state/jotai";
11
- import { CollapsibleTree, MultiColumn } from "@/utils/id-tree";
12
- import { hasAnyOutputAtom } from "../state";
13
-
14
- describe("hasAnyOutputAtom", () => {
15
- const createNotebookState = (
16
- outputs: (OutputMessage | null)[],
17
- ): NotebookState => ({
18
- ...initialNotebookState(),
19
- cellIds: new MultiColumn([
20
- CollapsibleTree.from(outputs.map((_, i) => cellId(`${i}`))),
21
- ]),
22
- cellData: Object.fromEntries(
23
- outputs.map((_, i) => [
24
- cellId(`${i}`),
25
- createCell({ id: cellId(`${i}`) }),
26
- ]),
27
- ),
28
- cellRuntime: Object.fromEntries(
29
- outputs.map((output, i) => [
30
- `${i}`,
31
- createCellRuntimeState({
32
- output,
33
- status: "queued",
34
- outline: { items: [] },
35
- }),
36
- ]),
37
- ),
38
- cellHandles: Object.fromEntries(
39
- outputs.map((_, i) => [cellId(`${i}`), createRef()]),
40
- ),
41
- });
42
-
43
- it("should return false when there are no outputs", () => {
44
- store.set(notebookAtom, createNotebookState([null, null]));
45
- expect(store.get(hasAnyOutputAtom)).toBe(false);
46
- });
47
-
48
- it("should return false when all outputs are empty", () => {
49
- store.set(
50
- notebookAtom,
51
- createNotebookState([
52
- { channel: "output", mimetype: "text/plain", data: "", timestamp: 0 },
53
- { channel: "output", mimetype: "text/plain", data: "", timestamp: 0 },
54
- ]),
55
- );
56
- expect(store.get(hasAnyOutputAtom)).toBe(false);
57
- });
58
-
59
- it("should return true when there is at least one non-empty output", () => {
60
- store.set(
61
- notebookAtom,
62
- createNotebookState([
63
- { channel: "output", mimetype: "text/plain", data: "", timestamp: 0 },
64
- {
65
- channel: "output",
66
- mimetype: "text/plain",
67
- data: "hello",
68
- timestamp: 0,
69
- },
70
- ]),
71
- );
72
- expect(store.get(hasAnyOutputAtom)).toBe(true);
73
- });
74
-
75
- it("should handle various output types", () => {
76
- store.set(
77
- notebookAtom,
78
- createNotebookState([
79
- {
80
- channel: "output",
81
- mimetype: "application/json",
82
- data: { foo: "bar" },
83
- timestamp: 0,
84
- },
85
- { channel: "output", mimetype: "text/plain", data: "", timestamp: 0 },
86
- ]),
87
- );
88
- expect(store.get(hasAnyOutputAtom)).toBe(true);
89
- });
90
-
91
- it("should return true when all outputs are idle", () => {
92
- const notebookState = createNotebookState([null, null]);
93
- const cellId0 = cellId("0");
94
- const cellId1 = cellId("1");
95
- // Some idle cell, so returns false
96
- store.set(notebookAtom, {
97
- ...notebookState,
98
- cellRuntime: {
99
- ...notebookState.cellRuntime,
100
- [cellId0]: {
101
- ...notebookState.cellRuntime[cellId0],
102
- status: "idle",
103
- },
104
- },
105
- });
106
- expect(store.get(hasAnyOutputAtom)).toBe(false);
107
-
108
- // All cells are idle, so returns true
109
- store.set(notebookAtom, {
110
- ...notebookState,
111
- cellRuntime: {
112
- [cellId0]: {
113
- ...notebookState.cellRuntime[cellId0],
114
- status: "idle",
115
- },
116
- [cellId1]: {
117
- ...notebookState.cellRuntime[cellId1],
118
- status: "idle",
119
- },
120
- },
121
- });
122
- expect(store.get(hasAnyOutputAtom)).toBe(true);
123
- });
124
- });
@@ -1,32 +0,0 @@
1
- /* Copyright 2026 Marimo. All rights reserved. */
2
- import { z } from "zod";
3
-
4
- const BufferPathSchema = z.array(z.array(z.union([z.string(), z.number()])));
5
- const StateSchema = z.record(z.string(), z.any());
6
-
7
- export const AnyWidgetMessageSchema = z.discriminatedUnion("method", [
8
- z.object({
9
- method: z.literal("open"),
10
- state: StateSchema,
11
- buffer_paths: BufferPathSchema.optional(),
12
- }),
13
- z.object({
14
- method: z.literal("update"),
15
- state: StateSchema,
16
- buffer_paths: BufferPathSchema.optional(),
17
- }),
18
- z.object({
19
- method: z.literal("custom"),
20
- content: z.any(),
21
- }),
22
- z.object({
23
- method: z.literal("echo_update"),
24
- buffer_paths: BufferPathSchema,
25
- state: StateSchema,
26
- }),
27
- z.object({
28
- method: z.literal("close"),
29
- }),
30
- ]);
31
-
32
- export type AnyWidgetMessage = z.infer<typeof AnyWidgetMessageSchema>;