@marimo-team/frontend 0.24.1-dev80 → 0.24.1-dev82
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/assets/{CellStatus-DMQfH9wD.js → CellStatus-GcHBZKLm.js} +1 -1
- package/dist/assets/{JsonOutput-B7sDhGzR.js → JsonOutput-CUJlEdsN.js} +8 -8
- package/dist/assets/{MarimoErrorOutput-C0vk393J.js → MarimoErrorOutput-DCAezqcJ.js} +2 -2
- package/dist/assets/{RenderHTML-BnMaGpV8.js → RenderHTML-D9-75ltP.js} +1 -1
- package/dist/assets/{RunButton-nocIODpS.js → RunButton-plSsbubG.js} +1 -1
- package/dist/assets/{add-cell-with-ai-B_TSaqjJ.js → add-cell-with-ai-Cfby28hZ.js} +14 -14
- package/dist/assets/{add-connection-dialog-DOuojDa-.js → add-connection-dialog-By0i0Fq5.js} +42 -42
- package/dist/assets/{agent-panel-CkKCGjDp.js → agent-panel-Cf482jaA.js} +4 -4
- package/dist/assets/ai-model-dropdown-DMfaGQ8o.js +3 -0
- package/dist/assets/app-config-button-93unbEYx.js +1 -0
- package/dist/assets/{blob-CYM8xQsK.js → blob-yxfhyyvD.js} +1 -1
- package/dist/assets/cell-editor-CZmqG6aB.js +21 -0
- package/dist/assets/{cell-link-DCOAqVkE.js → cell-link-hHrWcozB.js} +1 -1
- package/dist/assets/{cells-C6lBv8kg.js → cells-yuYDzbAy.js} +51 -51
- package/dist/assets/{chat-display-B6GBZDq8.js → chat-display-CnhvADgL.js} +1 -1
- package/dist/assets/{chat-panel-wWuBXhXw.js → chat-panel-CdE97AxM.js} +2 -2
- package/dist/assets/{chat-ui-CQ7A3qdB.js → chat-ui-BD3rpULw.js} +2 -2
- package/dist/assets/{column-preview-CatwdUda.js → column-preview-BEmcYaKl.js} +1 -1
- package/dist/assets/{command-palette-DcPM_WiO.js → command-palette-BGRRw0sn.js} +1 -1
- package/dist/assets/{common-B4aMxphz.js → common-Bs2kaOs2.js} +1 -1
- package/dist/assets/{components-D8-ffQsq.js → components-ByyAzQxP.js} +1 -1
- package/dist/assets/{datasource-D-_jFtGs.js → datasource-DeZYq5UY.js} +2 -2
- package/dist/assets/{dependency-graph-panel-BQli6zxh.js → dependency-graph-panel-g10osAFc.js} +4 -4
- package/dist/assets/{documentation-panel-_QE3nPOg.js → documentation-panel-CZ1mKkDh.js} +1 -1
- package/dist/assets/{download-Cqjqrhzo.js → download-D1crMjD8.js} +1 -1
- package/dist/assets/edit-page-Bk1sT7Wb.js +9 -0
- package/dist/assets/{error-entries-c5sIySli.js → error-entries-B6XTLRyE.js} +1 -1
- package/dist/assets/{error-panel-CXKrWK_u.js → error-panel-lexB3L6f.js} +1 -1
- package/dist/assets/{file-explorer-panel-BZiAb4x_.js → file-explorer-panel-DHRH2J-3.js} +1 -1
- package/dist/assets/{file-icons-uUY_hGYm.js → file-icons-Dx3v6lMu.js} +1 -1
- package/dist/assets/{file-name-input-DWUKg4LS.js → file-name-input-DzL8D_7x.js} +1 -1
- package/dist/assets/{floating-outline-DhGtHg6T.js → floating-outline-3rQEbxxk.js} +1 -1
- package/dist/assets/{home-page-Bka_7H02.js → home-page-Dnz4tfZB.js} +1 -1
- package/dist/assets/index-BID9w87A.js +29 -0
- package/dist/assets/layout-qHVpnnQT.js +9 -0
- package/dist/assets/{logs-panel-ragZa1sf.js → logs-panel-CSbUhhRo.js} +1 -1
- package/dist/assets/{markdown-renderer-B-uA_6mP.js → markdown-renderer-BgUTGtM0.js} +1 -1
- package/dist/assets/{name-cell-input-gC1flbyT.js → name-cell-input-pEE4FGAL.js} +1 -1
- package/dist/assets/{outline-panel-D7H7bhOh.js → outline-panel-BgnjEQWg.js} +1 -1
- package/dist/assets/{packages-panel-BZnsUm4S.js → packages-panel-BprfUOzZ.js} +1 -1
- package/dist/assets/panel-accordion-state-vpqEc3Kd.js +1 -0
- package/dist/assets/panels-3h7Cf8xJ.js +4 -0
- package/dist/assets/{process-output-DQQ8T5gv.js → process-output-siRm_lza.js} +1 -1
- package/dist/assets/{readonly-code-display-Bc0VX9i6.js → readonly-code-display-CLWV76FT.js} +1 -1
- package/dist/assets/readonly-python-code-Bor9b9pV.js +1 -0
- package/dist/assets/reveal-component-DNPksvzT.js +1069 -0
- package/dist/assets/run-page-C4aONLoP.js +1 -0
- package/dist/assets/{scratchpad-panel-BJHlMBZV.js → scratchpad-panel-BQSoRQvQ.js} +1 -1
- package/dist/assets/session-panel-DB5qEYqt.js +1 -0
- package/dist/assets/skeleton-BSxwEE0h.js +1 -0
- package/dist/assets/{snippets-panel-2jq36DdG.js → snippets-panel-B8Yi81tz.js} +1 -1
- package/dist/assets/state-D1N9_41P.js +3 -0
- package/dist/assets/state-O8w98G11.js +1 -0
- package/dist/assets/{tracing-91_akEkv.js → tracing-DuLkr7ts.js} +1 -1
- package/dist/assets/{tracing-panel-BvE81RYx.js → tracing-panel-CeLKVG8M.js} +2 -2
- package/dist/assets/{tree-actions-CGkbUSfG.js → tree-actions-Bh-Nnaub.js} +1 -1
- package/dist/assets/useAddCell-_JRYhAFd.js +1 -0
- package/dist/assets/useBoolean-Cu7Eado1.js +1 -0
- package/dist/assets/{useCellActionButton-cv6xOsnc.js → useCellActionButton-Bi8Lnv3F.js} +1 -1
- package/dist/assets/{useDeleteCell-DB-bhhnO.js → useDeleteCell-CBQiavzs.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-BDnVzNV-.js → useDependencyPanelTab-BOn3UJ07.js} +1 -1
- package/dist/assets/useNotebookActions--pblpIWF.js +10 -0
- package/dist/assets/{useRunCells-GCTS1YFv.js → useRunCells-BFQfLlUl.js} +1 -1
- package/dist/assets/{useSplitCell-DhT9BA2_.js → useSplitCell-Ig9P6lAn.js} +1 -1
- package/dist/index.html +20 -20
- package/package.json +1 -1
- package/src/__tests__/mount.test.ts +54 -2
- package/src/components/editor/__tests__/viewer-banner.test.tsx +1 -1
- package/src/components/editor/actions/export-dialog/__tests__/export-notebook.test.ts +9 -0
- package/src/components/editor/actions/export-dialog/export-notebook.ts +8 -1
- package/src/components/editor/actions/export-dialog/use-export-dialog.ts +2 -0
- package/src/components/editor/actions/useNotebookActions.tsx +1 -1
- package/src/components/editor/controls/__tests__/notebook-menu-dropdown.test.tsx +1 -1
- package/src/components/editor/renderers/__tests__/cells-renderer.test.tsx +1 -1
- package/src/components/editor/renderers/cells-renderer.tsx +15 -28
- package/src/components/editor/renderers/grid-layout/__tests__/plugin.test.ts +42 -0
- package/src/components/editor/renderers/grid-layout/plugin.tsx +20 -10
- package/src/components/editor/renderers/layout-select.tsx +1 -1
- package/src/components/editor/renderers/plugins.ts +7 -1
- package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +49 -15
- package/src/components/editor/renderers/slides-layout/slides-layout.tsx +16 -2
- package/src/components/editor/renderers/slides-layout/types.ts +15 -11
- package/src/components/editor/renderers/types.ts +5 -5
- package/src/components/editor/viewer-banner.tsx +1 -1
- package/src/components/pages/run-page.tsx +16 -7
- package/src/components/slides/__tests__/reveal-component.test.ts +33 -8
- package/src/components/slides/__tests__/speaker-view.test.ts +27 -0
- package/src/components/slides/reveal-component.tsx +110 -45
- package/src/components/slides/speaker-view.ts +22 -0
- package/src/components/static-html/share-modal.tsx +2 -0
- package/src/core/cells/__tests__/document-changes.test.ts +343 -26
- package/src/core/cells/document-changes.ts +181 -4
- package/src/core/export/hooks.ts +2 -0
- package/src/core/export/layout.ts +9 -0
- package/src/core/kernel/handlers.ts +7 -16
- package/src/core/kernel/state.ts +2 -0
- package/src/core/layout/__tests__/layout.test.ts +95 -0
- package/src/core/layout/layout.ts +59 -65
- package/src/core/layout/state.ts +121 -0
- package/src/core/meta/__tests__/code-visibility.test.tsx +28 -0
- package/src/core/meta/code-visibility.ts +3 -1
- package/src/core/run-app.tsx +6 -2
- package/src/core/saving/__tests__/save-component.test.ts +31 -1
- package/src/core/saving/save-component.tsx +39 -29
- package/src/core/saving/state.ts +1 -1
- package/src/core/static/download-html.ts +2 -0
- package/src/core/websocket/__tests__/useMarimoKernelConnection.hook.test.tsx +47 -14
- package/src/core/websocket/useMarimoKernelConnection.tsx +7 -2
- package/src/mount.tsx +24 -6
- package/dist/assets/ai-model-dropdown-CfWMIzjl.js +0 -3
- package/dist/assets/app-config-button-ii-Hj5CZ.js +0 -1
- package/dist/assets/cell-editor-BVb6iKbw.js +0 -21
- package/dist/assets/edit-page-RuyN164g.js +0 -9
- package/dist/assets/index-ChbtcNW2.js +0 -29
- package/dist/assets/layout-Uv1ZP5XB.js +0 -9
- package/dist/assets/panel-accordion-state-BLU7OiMD.js +0 -1
- package/dist/assets/panels-B3Y6fue9.js +0 -4
- package/dist/assets/readonly-python-code-D2HXwAfT.js +0 -1
- package/dist/assets/reveal-component-BN1C8zFu.js +0 -1069
- package/dist/assets/run-page-ByVvsH9G.js +0 -1
- package/dist/assets/session-panel-CdCKWAOf.js +0 -1
- package/dist/assets/skeleton-DirOIQrj.js +0 -1
- package/dist/assets/state-C9O-2hQL.js +0 -3
- package/dist/assets/state-DyxPdcEa.js +0 -1
- package/dist/assets/types-CoHi_MQq.js +0 -1
- package/dist/assets/useAddCell-DqvY2ulx.js +0 -1
- package/dist/assets/useBoolean-DWBCpKfT.js +0 -1
- package/dist/assets/useNotebookActions-Dxp4gTEa.js +0 -10
package/src/core/saving/state.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { dequal as isEqual } from "dequal";
|
|
|
4
4
|
import { atom } from "jotai";
|
|
5
5
|
import { arrayShallowEquals } from "@/utils/arrays";
|
|
6
6
|
import { type NotebookState, notebookAtom } from "../cells/cells";
|
|
7
|
-
import { type LayoutState, layoutStateAtom } from "../layout/
|
|
7
|
+
import { type LayoutState, layoutStateAtom } from "../layout/state";
|
|
8
8
|
import type { CellConfig } from "../network/types";
|
|
9
9
|
|
|
10
10
|
export interface LastSavedNotebook {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
3
|
import { downloadExportedFile } from "@/utils/download";
|
|
4
|
+
import { getExportLayout } from "../export/layout";
|
|
4
5
|
import { getRequestClient } from "../network/requests";
|
|
5
6
|
import { VirtualFileTracker } from "./virtual-file-tracker";
|
|
6
7
|
|
|
@@ -14,6 +15,7 @@ export async function downloadAsHTML(opts: { includeCode: boolean }) {
|
|
|
14
15
|
download: true,
|
|
15
16
|
includeCode: includeCode,
|
|
16
17
|
files: VirtualFileTracker.INSTANCE.filenames(),
|
|
18
|
+
layout: await getExportLayout(),
|
|
17
19
|
});
|
|
18
20
|
|
|
19
21
|
downloadExportedFile(exportedFile);
|
|
@@ -27,6 +27,7 @@ vi.mock("@/core/runtime/config", async () => {
|
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
import { useRuntimeManager } from "@/core/runtime/config";
|
|
30
|
+
import { initialRunCompletedAtom } from "../../kernel/state";
|
|
30
31
|
import { connectionAtom } from "../../network/connection";
|
|
31
32
|
import type { SessionId } from "../../kernel/session";
|
|
32
33
|
import { WebSocketClosedReason, WebSocketState } from "../types";
|
|
@@ -68,6 +69,23 @@ function makeRuntimeManager(
|
|
|
68
69
|
};
|
|
69
70
|
}
|
|
70
71
|
|
|
72
|
+
function renderConnectionHook(store: ReturnType<typeof createStore>) {
|
|
73
|
+
const wrapper: React.FC<React.PropsWithChildren> = ({ children }) => (
|
|
74
|
+
<JotaiProvider store={store}>
|
|
75
|
+
<ErrorBoundary fallback={null}>{children}</ErrorBoundary>
|
|
76
|
+
</JotaiProvider>
|
|
77
|
+
);
|
|
78
|
+
return renderHook(
|
|
79
|
+
() =>
|
|
80
|
+
useMarimoKernelConnection({
|
|
81
|
+
sessionId: "test-session" as SessionId,
|
|
82
|
+
autoInstantiate: false,
|
|
83
|
+
setCells: () => {},
|
|
84
|
+
}),
|
|
85
|
+
{ wrapper },
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
71
89
|
describe("useMarimoKernelConnection.reconnect()", () => {
|
|
72
90
|
let transport: MockTransport;
|
|
73
91
|
let isHealthy: Mock<() => Promise<boolean>>;
|
|
@@ -91,20 +109,7 @@ describe("useMarimoKernelConnection.reconnect()", () => {
|
|
|
91
109
|
});
|
|
92
110
|
|
|
93
111
|
function renderUseHook() {
|
|
94
|
-
|
|
95
|
-
<JotaiProvider store={store}>
|
|
96
|
-
<ErrorBoundary fallback={null}>{children}</ErrorBoundary>
|
|
97
|
-
</JotaiProvider>
|
|
98
|
-
);
|
|
99
|
-
return renderHook(
|
|
100
|
-
() =>
|
|
101
|
-
useMarimoKernelConnection({
|
|
102
|
-
sessionId: "test-session" as SessionId,
|
|
103
|
-
autoInstantiate: false,
|
|
104
|
-
setCells: () => {},
|
|
105
|
-
}),
|
|
106
|
-
{ wrapper },
|
|
107
|
-
);
|
|
112
|
+
return renderConnectionHook(store);
|
|
108
113
|
}
|
|
109
114
|
|
|
110
115
|
it("is a no-op when the transport is already OPEN", async () => {
|
|
@@ -155,3 +160,31 @@ describe("useMarimoKernelConnection.reconnect()", () => {
|
|
|
155
160
|
});
|
|
156
161
|
});
|
|
157
162
|
});
|
|
163
|
+
|
|
164
|
+
describe("useMarimoKernelConnection messages", () => {
|
|
165
|
+
it("records completion of the initial run", () => {
|
|
166
|
+
const store = createStore();
|
|
167
|
+
vi.mocked(useConnectionTransport).mockClear();
|
|
168
|
+
vi.mocked(useConnectionTransport).mockReturnValue(
|
|
169
|
+
makeTransport(WebSocket.OPEN),
|
|
170
|
+
);
|
|
171
|
+
vi.mocked(useRuntimeManager).mockReturnValue(
|
|
172
|
+
makeRuntimeManager() as unknown as ReturnType<typeof useRuntimeManager>,
|
|
173
|
+
);
|
|
174
|
+
renderConnectionHook(store);
|
|
175
|
+
|
|
176
|
+
const options = vi.mocked(useConnectionTransport).mock.calls.at(-1)?.[0];
|
|
177
|
+
expect(store.get(initialRunCompletedAtom)).toBe(false);
|
|
178
|
+
act(() => {
|
|
179
|
+
options?.onMessage(
|
|
180
|
+
new MessageEvent("message", {
|
|
181
|
+
data: JSON.stringify({
|
|
182
|
+
op: "completed-run",
|
|
183
|
+
data: { op: "completed-run", run_id: null },
|
|
184
|
+
}),
|
|
185
|
+
}),
|
|
186
|
+
);
|
|
187
|
+
});
|
|
188
|
+
expect(store.get(initialRunCompletedAtom)).toBe(true);
|
|
189
|
+
});
|
|
190
|
+
});
|
|
@@ -60,8 +60,8 @@ import {
|
|
|
60
60
|
} from "../kernel/handlers";
|
|
61
61
|
import { queryParamHandlers } from "../kernel/queryParamHandlers";
|
|
62
62
|
import type { SessionId } from "../kernel/session";
|
|
63
|
-
import { kernelStateAtom } from "../kernel/state";
|
|
64
|
-
import { type LayoutState, useLayoutActions } from "../layout/
|
|
63
|
+
import { initialRunCompletedAtom, kernelStateAtom } from "../kernel/state";
|
|
64
|
+
import { type LayoutState, useLayoutActions } from "../layout/state";
|
|
65
65
|
import { kioskModeAtom } from "../mode";
|
|
66
66
|
import { connectionAtom } from "../network/connection";
|
|
67
67
|
import type { RequestId } from "../network/DeferredRequestRegistry";
|
|
@@ -212,6 +212,7 @@ export function useMarimoKernelConnection(opts: {
|
|
|
212
212
|
};
|
|
213
213
|
const { addCellNotification } = useRunsActions();
|
|
214
214
|
const setKernelState = useSetAtom(kernelStateAtom);
|
|
215
|
+
const setInitialRunCompleted = useSetAtom(initialRunCompletedAtom);
|
|
215
216
|
const setAppConfig = useSetAppConfig();
|
|
216
217
|
const { setVariables, setMetadata } = useVariablesActions();
|
|
217
218
|
const { addColumnPreview } = useDatasetsActions();
|
|
@@ -240,6 +241,9 @@ export function useMarimoKernelConnection(opts: {
|
|
|
240
241
|
reloadSafe();
|
|
241
242
|
return;
|
|
242
243
|
case "kernel-ready": {
|
|
244
|
+
setInitialRunCompleted(
|
|
245
|
+
Boolean(msg.data.resumed || msg.data.auto_instantiated),
|
|
246
|
+
);
|
|
243
247
|
const existingCells = getExistingCells();
|
|
244
248
|
|
|
245
249
|
handleKernelReady(msg.data, {
|
|
@@ -268,6 +272,7 @@ export function useMarimoKernelConnection(opts: {
|
|
|
268
272
|
}
|
|
269
273
|
|
|
270
274
|
case "completed-run":
|
|
275
|
+
setInitialRunCompleted(true);
|
|
271
276
|
return;
|
|
272
277
|
case "interrupted":
|
|
273
278
|
return;
|
package/src/mount.tsx
CHANGED
|
@@ -27,7 +27,17 @@ import {
|
|
|
27
27
|
parseUserConfig,
|
|
28
28
|
} from "./core/config/config-schema";
|
|
29
29
|
import { MarimoApp, preloadPage } from "./core/MarimoApp";
|
|
30
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
initialLayoutState,
|
|
32
|
+
isSerializedLayout,
|
|
33
|
+
layoutStateAtom,
|
|
34
|
+
} from "./core/layout/state";
|
|
35
|
+
import {
|
|
36
|
+
type AppMode,
|
|
37
|
+
initialModeAtom,
|
|
38
|
+
kioskModeAtom,
|
|
39
|
+
viewStateAtom,
|
|
40
|
+
} from "./core/mode";
|
|
31
41
|
import { cleanupAuthQueryParams } from "./core/network/auth";
|
|
32
42
|
import { connectionAtom } from "./core/network/connection";
|
|
33
43
|
import { requestClientAtom } from "./core/network/requests";
|
|
@@ -202,6 +212,13 @@ const mountOptionsSchema = z.object({
|
|
|
202
212
|
* marimo app config
|
|
203
213
|
*/
|
|
204
214
|
appConfig: passthroughObject,
|
|
215
|
+
/**
|
|
216
|
+
* Serialized notebook layout
|
|
217
|
+
*/
|
|
218
|
+
layout: z
|
|
219
|
+
.unknown()
|
|
220
|
+
.optional()
|
|
221
|
+
.transform((val) => (isSerializedLayout(val) ? val : undefined)),
|
|
205
222
|
/**
|
|
206
223
|
* show code in run mode
|
|
207
224
|
*/
|
|
@@ -310,15 +327,15 @@ function initStore(options: unknown) {
|
|
|
310
327
|
store.set(marimoVersionAtom, parsedOptions.data.version);
|
|
311
328
|
store.set(showCodeInRunModeAtom, parsedOptions.data.view.showAppCode);
|
|
312
329
|
|
|
313
|
-
|
|
314
|
-
const shouldStartInPresentMode =
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
})();
|
|
330
|
+
const url = new URL(window.location.href);
|
|
331
|
+
const shouldStartInPresentMode =
|
|
332
|
+
url.searchParams.get(KnownQueryParams.viewAs) === "present";
|
|
333
|
+
const isKioskMode = url.searchParams.get(KnownQueryParams.kiosk) === "true";
|
|
318
334
|
|
|
319
335
|
const initialViewMode =
|
|
320
336
|
mode === "edit" && shouldStartInPresentMode ? "present" : mode;
|
|
321
337
|
store.set(viewStateAtom, { mode: initialViewMode, cellAnchor: null });
|
|
338
|
+
store.set(kioskModeAtom, isKioskMode);
|
|
322
339
|
store.set(serverTokenAtom, parsedOptions.data.serverToken);
|
|
323
340
|
|
|
324
341
|
// Config
|
|
@@ -354,6 +371,7 @@ function initStore(options: unknown) {
|
|
|
354
371
|
parsedOptions.data.session,
|
|
355
372
|
parsedOptions.data.notebook,
|
|
356
373
|
);
|
|
374
|
+
store.set(layoutStateAtom, initialLayoutState(parsedOptions.data.layout));
|
|
357
375
|
if (notebook) {
|
|
358
376
|
store.set(notebookAtom, notebook);
|
|
359
377
|
}
|