@marimo-team/islands 0.25.3-dev388 → 0.25.3-dev394
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/{ConnectedDataExplorerComponent-BpCrAeX0.js → ConnectedDataExplorerComponent-1DGGwl88.js} +9 -9
- package/dist/{ErrorBoundary-_mFP3LkM.js → ErrorBoundary-DDIASniH.js} +6 -6
- package/dist/{abnfDiagram-VCTEODGH-ZqNgGZlz.js → abnfDiagram-VCTEODGH-CeQEbVik.js} +2 -2
- package/dist/{any-language-editor-CFbAr7vc.js → any-language-editor-C_s_ZoaK.js} +2 -2
- package/dist/{architectureDiagram-5GKGNRK7-BEUaR96d.js → architectureDiagram-5GKGNRK7-C8xUpTAb.js} +1 -1
- package/dist/{assertNever-5uYEbJc8.js → assertNever-DXGfUmPW.js} +2 -2
- package/dist/assets/__vite-browser-external-C9HF3uHE.js +1 -0
- package/dist/assets/worker-B4Cpvr8b.js +171 -0
- package/dist/{chat-ui-BKSYhGMh.js → chat-ui-B6bY_0LF.js} +774 -774
- package/dist/{check-BbhVyViy.js → check-ywinAQy6.js} +1 -1
- package/dist/{chunk-IMKFNOWR-BdEPmWQI.js → chunk-IMKFNOWR-DY7AWyNi.js} +1 -1
- package/dist/{chunk-SHT3W25Y-IvvXM3xf.js → chunk-SHT3W25Y-D4epY9MY.js} +1 -1
- package/dist/{chunk-SVP7TREG-C_qpJUv1.js → chunk-SVP7TREG-CKsl2Q6r.js} +1 -1
- package/dist/{chunk-TICWLB2K-C4agYVWP.js → chunk-TICWLB2K-CMsD2y0F.js} +1 -1
- package/dist/{classDiagram-ZZMXUADV-CT2iq8uF.js → classDiagram-ZZMXUADV-C4FsLnvt.js} +2 -2
- package/dist/{classDiagram-v2-VYDZK3BY-Coe_dD0r.js → classDiagram-v2-VYDZK3BY-BJRuFZeI.js} +2 -2
- package/dist/{code-visibility-DkMNjdNe.js → code-visibility-CByYqwFv.js} +13 -13
- package/dist/{common-Ces9ooG_.js → common-KkgATX2Y.js} +4918 -4910
- package/dist/{config-DJ8M-gPL.js → config-DOwBtRkI.js} +3 -3
- package/dist/{copy-icon-xWvA8ybp.js → copy-icon-BKcX0ltw.js} +2 -2
- package/dist/{createReducer-fp0gX_9U.js → createReducer-Bjx6kuxh.js} +1 -1
- package/dist/{cynefinDiagram-5FMLGOSQ-D0LKziUu.js → cynefinDiagram-5FMLGOSQ-DyI_lSsn.js} +1 -1
- package/dist/{dagre-GXQ25YYZ-Cmgziaw8.js → dagre-GXQ25YYZ-Buoy6sX-.js} +1 -1
- package/dist/{data-grid-overlay-editor-uNMslVKY.js → data-grid-overlay-editor-BHrTJhN3.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-D-lZsALU.js → diagram-S7CK7UJ4-CbSD1DUy.js} +1 -1
- package/dist/{diagram-UQ7AKVKN-TcbdsFoT.js → diagram-UQ7AKVKN-Dapj2rQm.js} +1 -1
- package/dist/{diagram-VX7I27RA-D5BqZi1q.js → diagram-VX7I27RA-CxA3txtC.js} +1 -1
- package/dist/{diagram-Z3DM3KII-MNc7jqvr.js → diagram-Z3DM3KII-BEZqz916.js} +1 -1
- package/dist/{dialog-Cm0VGdxc.js → dialog-mwa6XN15.js} +2 -2
- package/dist/{dropdown-menu-DfamXjVI.js → dropdown-menu-CmgUseHo.js} +5 -5
- package/dist/duckdb-keywords-CdzX4o33.js +3 -0
- package/dist/{ebnfDiagram-PWID7BFC-Cxt6ywyX.js → ebnfDiagram-PWID7BFC-Dmw-1JV3.js} +2 -2
- package/dist/{erDiagram-RLTQ6QDP-BLF-askI.js → erDiagram-RLTQ6QDP-DZpG4cbm.js} +1 -1
- package/dist/{error-banner-k06CAftu.js → error-banner-CHPLqogX.js} +1 -1
- package/dist/{error-entries-rtPWQkJk.js → error-entries-Bk96zt4w.js} +825 -690
- package/dist/{feedback-button-i960qUnq.js → feedback-button-2FaWjlaR.js} +12 -12
- package/dist/{flowDiagram-HODETNUW-CsLw2mWn.js → flowDiagram-HODETNUW-B02oHnBv.js} +2 -2
- package/dist/{formats-DQ-qq-dU.js → formats-BDqe9cfr.js} +1 -1
- package/dist/{glide-data-editor-_EEhlGzS.js → glide-data-editor-B9Yq6Wg1.js} +11 -11
- package/dist/{glide-utils-CHrghEu-.js → glide-utils-DYKWS2YV.js} +2 -2
- package/dist/{globals-DKkjIolp.js → globals-S4D5AVKN.js} +3 -3
- package/dist/{html-to-image-B5nTOeMI.js → html-to-image-BauFF9F_.js} +4842 -4821
- package/dist/{infoDiagram-27XIBGKW-CdSApBWg.js → infoDiagram-27XIBGKW-BPbQHO9m.js} +1 -1
- package/dist/{ishikawaDiagram-5VMMS53U-BnzQ8SI5.js → ishikawaDiagram-5VMMS53U-DmnKSNi7.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-D2llTpeX.js → kanban-definition-UXKFOSKX-u5PZbsBe.js} +1 -1
- package/dist/main.js +6236 -6175
- package/dist/{mermaid-BcNMyKmf.js → mermaid-ffopDjig.js} +34 -34
- package/dist/{mindmap-definition-YA3MSWOX-uoEsfD5R.js → mindmap-definition-YA3MSWOX-CX187lhP.js} +1 -1
- package/dist/{number-overlay-editor-D5U7jbrh.js → number-overlay-editor-l7DB2HCO.js} +1 -1
- package/dist/{pegDiagram-XKGWAZYB-DTWrE0S4.js → pegDiagram-XKGWAZYB-Bj6HGPak.js} +2 -2
- package/dist/{pencil-weySvN0N.js → pencil-CijoRsa3.js} +1 -1
- package/dist/{pieDiagram-E7YTZNPT-COME2oGN.js → pieDiagram-E7YTZNPT-C_wIgDJM.js} +1 -1
- package/dist/{process-output-DNxpsd4n.js → process-output-Deae7dX1.js} +4 -4
- package/dist/{railroadDiagram-O6MQD6OU-CUeFcNTY.js → railroadDiagram-O6MQD6OU-CwoJvnvC.js} +2 -2
- package/dist/{requirementDiagram-BXWQKSXE-BUR4lDZG.js → requirementDiagram-BXWQKSXE-C8JuhLLL.js} +1 -1
- package/dist/{reveal-component-BM9TozVQ.js → reveal-component-VR4UzAUv.js} +37 -37
- package/dist/{select-Ca-POp4c.js → select-DW32QOzC.js} +4 -4
- package/dist/{sequenceDiagram-WJ2MYXX4-CSPmml3q.js → sequenceDiagram-WJ2MYXX4-RbrRdoiV.js} +1 -1
- package/dist/{spec-BgSMwzks.js → spec-Ww0JjShW.js} +4 -4
- package/dist/{stateDiagram-D77RDMKH-BDUC8Pi9.js → stateDiagram-D77RDMKH-DWdIvCnU.js} +2 -2
- package/dist/{stateDiagram-v2-MP3YSRHH-BH-qyk8a.js → stateDiagram-v2-MP3YSRHH-BG0j9crW.js} +2 -2
- package/dist/{static-state-Cqzv5X7B.js → static-state-CnQdTBTW.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{swimlanes-42K2YHIH-CLE9Kiir.js → swimlanes-42K2YHIH-B6zUw4gq.js} +1 -1
- package/dist/{swimlanesDiagram-VR7AAH4N-Cv8kWAeA.js → swimlanesDiagram-VR7AAH4N-DjVEnsIG.js} +2 -2
- package/dist/{timeline-definition-24CTP7MA-fbRGX21i.js → timeline-definition-24CTP7MA-DSAxwqnC.js} +1 -1
- package/dist/{toast-0xspcdmv.js → toast-Crofa36R.js} +3 -3
- package/dist/{tooltip-BwlFTaNy.js → tooltip-Bg-SDCwa.js} +1 -1
- package/dist/{use-restore-focus-fKgXR0nb.js → use-restore-focus-CE9Sflmg.js} +1298 -1283
- package/dist/{useDateFormatter-B7LvPmsw.js → useDateFormatter-D5fsC9ot.js} +2 -2
- package/dist/{useDeepCompareMemoize-OhBYt-q2.js → useDeepCompareMemoize-Bvrue1iy.js} +1 -1
- package/dist/{useLifecycle-D9xcFAIN.js → useLifecycle-Ctr5lECo.js} +1 -1
- package/dist/{vega-component-Chak9Aon.js → vega-component-DQZhTzVQ.js} +6 -6
- package/dist/{vennDiagram-4TSXK5OY-BzKtg8gL.js → vennDiagram-4TSXK5OY-FAGYRdBj.js} +1 -1
- package/dist/{wardleyDiagram-VM6X3IG4-R0SgDvz1.js → wardleyDiagram-VM6X3IG4-BlB973r1.js} +1 -1
- package/dist/{xychartDiagram-S5SC5T6Z-DRskTHEM.js → xychartDiagram-S5SC5T6Z-CywvmjIK.js} +1 -1
- package/package.json +2 -2
- package/src/__mocks__/executions.ts +48 -8
- package/src/__mocks__/notebook.ts +20 -42
- package/src/components/app-config/__tests__/add-model-discovery.test.tsx +255 -0
- package/src/components/app-config/__tests__/model-discovery.test.tsx +183 -0
- package/src/components/app-config/ai-config.tsx +20 -24
- package/src/components/app-config/model-discovery.tsx +118 -184
- package/src/components/app-config/model-provider-config.ts +25 -0
- package/src/components/editor/Output.tsx +5 -4
- package/src/components/editor/__tests__/data-attributes.test.tsx +1 -6
- package/src/components/editor/__tests__/dynamic-favicon.test.tsx +11 -16
- package/src/components/editor/__tests__/output-persistence.test.tsx +6 -24
- package/src/components/editor/actions/__tests__/useSetOutputsExpanded.test.ts +6 -8
- package/src/components/editor/actions/useSetOutputsExpanded.ts +12 -4
- package/src/components/editor/cell/cell-context-menu.tsx +3 -2
- package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +89 -72
- package/src/components/editor/notebook-cell.tsx +15 -10
- package/src/components/editor/output/console/process-output.ts +4 -2
- package/src/components/editor/renderers/cells-renderer.tsx +3 -1
- package/src/components/editor/renderers/grid-layout/__tests__/grid-layout.test.tsx +5 -11
- package/src/components/editor/renderers/grid-layout/grid-layout.tsx +9 -8
- package/src/components/editor/renderers/types.ts +2 -2
- package/src/components/editor/renderers/vertical-layout/utils.ts +4 -4
- package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +5 -8
- package/src/components/scratchpad/scratchpad.tsx +6 -2
- package/src/components/slides/__tests__/cell-output-block.test.tsx +7 -8
- package/src/components/slides/__tests__/minimap-actions.test.tsx +3 -3
- package/src/components/slides/__tests__/slide-cell-view.test.tsx +1 -0
- package/src/components/slides/slide-cell-view.tsx +1 -3
- package/src/components/slides/slide.tsx +3 -3
- package/src/core/ai/context/__tests__/registry.test.ts +7 -11
- package/src/core/ai/context/providers/__tests__/cell-output.test.ts +113 -35
- package/src/core/ai/context/providers/__tests__/error.test.ts +74 -191
- package/src/core/ai/context/providers/cell-output.ts +11 -6
- package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +8 -103
- package/src/core/cells/__tests__/cells.test.ts +40 -292
- package/src/core/cells/__tests__/clear-outputs.test.ts +151 -0
- package/src/core/cells/__tests__/harness.ts +14 -12
- package/src/core/cells/__tests__/layout.test.ts +20 -26
- package/src/core/cells/__tests__/notebook-outline.test.ts +49 -43
- package/src/core/cells/__tests__/session.test.ts +26 -146
- package/src/core/cells/actions.ts +49 -9
- package/src/core/cells/cell.ts +0 -13
- package/src/core/cells/cells.ts +53 -62
- package/src/core/cells/focus.ts +6 -1
- package/src/core/cells/layout.ts +2 -3
- package/src/core/cells/outputs.ts +2 -2
- package/src/core/cells/session.ts +3 -38
- package/src/core/cells/types.ts +6 -8
- package/src/core/cells/utils.ts +4 -3
- package/src/core/codemirror/ai/__tests__/resources.test.ts +7 -11
- package/src/core/config/config-schema.ts +15 -0
- package/src/core/errors/__tests__/error-entries.test.ts +52 -18
- package/src/core/errors/error-entries.ts +21 -11
- package/src/core/executions/__tests__/freshness.test.ts +7 -4
- package/src/core/executions/__tests__/hooks.test.tsx +5 -1
- package/src/core/executions/__tests__/interrupt.test.ts +2 -0
- package/src/core/executions/__tests__/output-lifecycle.test.ts +201 -0
- package/src/core/executions/__tests__/output.test.ts +87 -3
- package/src/core/executions/__tests__/select.test.ts +17 -10
- package/src/core/executions/atoms.ts +73 -15
- package/src/core/executions/freshness.ts +1 -1
- package/src/core/executions/hooks.ts +18 -8
- package/src/core/executions/index.ts +6 -0
- package/src/core/executions/output.ts +122 -38
- package/src/core/executions/select.ts +2 -2
- package/src/core/export/__tests__/hooks.test.ts +20 -29
- package/src/core/export/hooks.ts +7 -9
- package/src/core/islands/__tests__/iframe-resizer.test.ts +91 -0
- package/src/core/islands/__tests__/main.test.ts +17 -0
- package/src/core/islands/components/__tests__/web-components.test.tsx +13 -15
- package/src/core/islands/components/output-wrapper.tsx +15 -20
- package/src/core/islands/iframe-resizer.ts +38 -0
- package/src/core/islands/main.ts +3 -0
- package/src/core/lifecycle/render-policy.ts +7 -4
- package/src/core/network/__tests__/ai.test.ts +41 -0
- package/src/core/network/ai.ts +12 -0
- package/src/core/notebook/document/__tests__/codemirror.test.ts +2 -0
- package/src/core/notebook/replica/__tests__/replica.test.ts +19 -0
- package/src/core/notebook/replica/__tests__/results.test.ts +45 -16
- package/src/core/notebook/replica/index.ts +1 -1
- package/src/core/notebook/replica/replica.ts +19 -4
- package/src/core/notebook/replica/resources/executions.ts +100 -9
- package/src/core/notebook/replica/resources/results.ts +46 -31
- package/src/core/transports/__tests__/static.test.ts +5 -3
- package/src/stories/cell.stories.tsx +40 -30
- package/src/stories/layout/vertical/one-column.stories.tsx +15 -7
- package/dist/assets/__vite-browser-external-C5NhJPNJ.js +0 -1
- package/dist/assets/worker-D-n8vtGi.js +0 -171
- package/dist/duckdb-keywords-BGArYVVK.js +0 -3
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
/** The active notebook's executions and runtime as the editor reads them. */
|
|
4
4
|
|
|
5
5
|
import type * as Protocol from "@marimo-team/client/protocol";
|
|
6
|
+
import { dequal } from "dequal";
|
|
6
7
|
import { atom, type createStore } from "jotai";
|
|
8
|
+
import { atomFamily, selectAtom } from "jotai/utils";
|
|
9
|
+
import type { CellId } from "@/core/cells/ids";
|
|
10
|
+
import type { Outline } from "@/core/cells/outline";
|
|
11
|
+
import { parseOutline } from "@/core/dom/outline";
|
|
7
12
|
import type { CellMessage } from "@/core/kernel/messages";
|
|
8
13
|
import {
|
|
9
14
|
ConnectionState,
|
|
@@ -13,7 +18,13 @@ import {
|
|
|
13
18
|
} from "@/core/notebook/replica";
|
|
14
19
|
import { activeNotebookReplicaAtom } from "@/core/session/active-notebook";
|
|
15
20
|
import { type CellFreshnessInputs, freshnessOf } from "./freshness";
|
|
16
|
-
import
|
|
21
|
+
import {
|
|
22
|
+
type CellOutput,
|
|
23
|
+
type CellOutputInputs,
|
|
24
|
+
type ClearedOutput,
|
|
25
|
+
cellOutputsView,
|
|
26
|
+
shownExecution,
|
|
27
|
+
} from "./output";
|
|
17
28
|
import {
|
|
18
29
|
anyRunning,
|
|
19
30
|
type CellExecutionInputs,
|
|
@@ -26,14 +37,15 @@ const NO_EXECUTIONS: Executions = {
|
|
|
26
37
|
runs: new Map(),
|
|
27
38
|
executions: new Map(),
|
|
28
39
|
latest: new Map(),
|
|
40
|
+
results: new Map(),
|
|
41
|
+
scratch: null,
|
|
29
42
|
};
|
|
30
43
|
const NO_RESULTS: Results = new Map();
|
|
31
44
|
const NO_CELLS: ReadonlyMap<Protocol.CellId, Protocol.Cell> = new Map();
|
|
32
45
|
const NO_REQUESTS: ReadonlySet<RunRequest> = new Set();
|
|
33
46
|
const NO_REQUESTED: ReadonlySet<Protocol.CellId> = new Set();
|
|
34
47
|
const NO_BLOCKED: ReadonlySet<Protocol.CellId> = new Set();
|
|
35
|
-
const NO_CLEARED: ReadonlyMap<Protocol.CellId,
|
|
36
|
-
new Map();
|
|
48
|
+
const NO_CLEARED: ReadonlyMap<Protocol.CellId, ClearedOutput> = new Map();
|
|
37
49
|
|
|
38
50
|
/** The notebook a replica is showing, which the editor's marks belong to. */
|
|
39
51
|
interface ShownNotebook {
|
|
@@ -97,7 +109,7 @@ function current<T>(
|
|
|
97
109
|
: empty;
|
|
98
110
|
}
|
|
99
111
|
|
|
100
|
-
function shownNotebook(store: Store): ShownNotebook | null {
|
|
112
|
+
function shownNotebook(store: Pick<Store, "get">): ShownNotebook | null {
|
|
101
113
|
const replica = store.get(activeNotebookReplicaAtom);
|
|
102
114
|
const notebook = replica === null ? null : store.get(replica.notebookAtom);
|
|
103
115
|
return replica === null || notebook === null
|
|
@@ -105,7 +117,7 @@ function shownNotebook(store: Store): ShownNotebook | null {
|
|
|
105
117
|
: { replica, id: notebook.id };
|
|
106
118
|
}
|
|
107
119
|
|
|
108
|
-
function mark<T>(store: Store, value: T): Marks<T> {
|
|
120
|
+
function mark<T>(store: Pick<Store, "get">, value: T): Marks<T> {
|
|
109
121
|
const notebook = shownNotebook(store);
|
|
110
122
|
return notebook === null ? null : { notebook, value };
|
|
111
123
|
}
|
|
@@ -173,36 +185,82 @@ export const cellFreshnessAtom = atom((get) =>
|
|
|
173
185
|
freshnessOf(get(cellFreshnessInputsAtom)),
|
|
174
186
|
);
|
|
175
187
|
|
|
176
|
-
/**
|
|
188
|
+
/** What each cell showed when this browser cleared it. */
|
|
177
189
|
const clearedOutputsAtom =
|
|
178
|
-
atom<Marks<ReadonlyMap<Protocol.CellId,
|
|
190
|
+
atom<Marks<ReadonlyMap<Protocol.CellId, ClearedOutput>>>(null);
|
|
191
|
+
|
|
192
|
+
const displayedNotebookAtom = atom((get): ShownNotebook | null => {
|
|
193
|
+
const replica = get(activeNotebookReplicaAtom);
|
|
194
|
+
const document = replica === null ? null : get(replica.shownDocumentAtom);
|
|
195
|
+
return replica === null || document === null
|
|
196
|
+
? null
|
|
197
|
+
: { replica, id: document.revision.notebook_id };
|
|
198
|
+
});
|
|
179
199
|
|
|
180
200
|
/** What every cell's output derives from. Pair with `cellOutputView`. */
|
|
181
201
|
export const cellOutputInputsAtom = atom((get): CellOutputInputs => {
|
|
182
202
|
const replica = get(activeNotebookReplicaAtom);
|
|
183
|
-
const notebookId =
|
|
184
|
-
replica === null ? null : (get(replica.notebookAtom)?.id ?? null);
|
|
203
|
+
const notebookId = get(displayedNotebookAtom)?.id ?? null;
|
|
185
204
|
return {
|
|
186
205
|
executions: replica === null ? NO_EXECUTIONS : get(replica.executionsAtom),
|
|
187
206
|
results: replica === null ? NO_RESULTS : get(replica.resultsAtom),
|
|
188
207
|
cleared: current(get(clearedOutputsAtom), replica, notebookId, NO_CLEARED),
|
|
208
|
+
cells:
|
|
209
|
+
replica === null
|
|
210
|
+
? NO_CELLS
|
|
211
|
+
: (get(replica.documentAtom)?.cells ?? NO_CELLS),
|
|
189
212
|
};
|
|
190
213
|
});
|
|
191
214
|
|
|
192
|
-
/**
|
|
215
|
+
/** What every cell shows, by cell id. Pair with `cellOutputAtom` for one cell. */
|
|
216
|
+
export const cellOutputsAtom = atom((get) =>
|
|
217
|
+
cellOutputsView(get(cellOutputInputsAtom)),
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* One cell's output, compared by value so its readers are left alone by
|
|
222
|
+
* other cells' runs. Released with the cell by `releaseCellOutputAtoms`.
|
|
223
|
+
*/
|
|
224
|
+
export const cellOutputAtom = atomFamily((cellId: CellId) =>
|
|
225
|
+
selectAtom(
|
|
226
|
+
cellOutputsAtom,
|
|
227
|
+
(outputs): CellOutput | null => outputs.get(cellId) ?? null,
|
|
228
|
+
dequal,
|
|
229
|
+
),
|
|
230
|
+
);
|
|
231
|
+
|
|
232
|
+
/** The headings in a cell's output, for the table of contents and folding. */
|
|
233
|
+
export const cellOutlineAtom = atomFamily((cellId: CellId) =>
|
|
234
|
+
atom((get): Outline | null => parseOutline(get(cellOutputAtom(cellId)))),
|
|
235
|
+
);
|
|
236
|
+
|
|
237
|
+
/** Drop the cached atoms of a cell that left the document. */
|
|
238
|
+
export function releaseCellOutputAtoms(cellId: CellId): void {
|
|
239
|
+
cellOutputAtom.remove(cellId);
|
|
240
|
+
cellOutlineAtom.remove(cellId);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/** Hide what `cellIds` show now, until each shows something new. */
|
|
193
244
|
export function clearCellOutputs(
|
|
194
|
-
store: Store,
|
|
245
|
+
store: Pick<Store, "get" | "set">,
|
|
195
246
|
cellIds: readonly Protocol.CellId[],
|
|
196
247
|
): void {
|
|
197
248
|
const inputs = store.get(cellOutputInputsAtom);
|
|
198
249
|
const next = new Map(inputs.cleared);
|
|
199
250
|
for (const cellId of cellIds) {
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
202
|
-
next.set(cellId,
|
|
251
|
+
const shown = shownExecution(inputs, cellId);
|
|
252
|
+
if (shown?.record.outcome != null) {
|
|
253
|
+
next.set(cellId, {
|
|
254
|
+
execution: shown.record.id,
|
|
255
|
+
version: shown.outputVersion,
|
|
256
|
+
});
|
|
203
257
|
}
|
|
204
258
|
}
|
|
205
|
-
store.
|
|
259
|
+
const notebook = store.get(displayedNotebookAtom);
|
|
260
|
+
store.set(
|
|
261
|
+
clearedOutputsAtom,
|
|
262
|
+
notebook === null ? null : { notebook, value: next },
|
|
263
|
+
);
|
|
206
264
|
}
|
|
207
265
|
|
|
208
266
|
/** The runtime's status, null while the notebook has none or the stream is not ready. */
|
|
@@ -163,7 +163,7 @@ export function freshnessOf(inputs: CellFreshnessInputs): CellFreshnessLookup {
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
return (id) => {
|
|
166
|
-
const result = inputs.results.get(id);
|
|
166
|
+
const result = inputs.results.get(id)?.record;
|
|
167
167
|
return result === null || result === undefined
|
|
168
168
|
? CURRENT
|
|
169
169
|
: ofRecord(result, new Set());
|
|
@@ -5,14 +5,17 @@ import { dequal } from "dequal";
|
|
|
5
5
|
import { useAtomValue } from "jotai";
|
|
6
6
|
import { selectAtom } from "jotai/utils";
|
|
7
7
|
import { useMemo } from "react";
|
|
8
|
-
import {
|
|
8
|
+
import type { CellId } from "@/core/cells/ids";
|
|
9
|
+
import type { Outline } from "@/core/cells/outline";
|
|
9
10
|
import {
|
|
10
11
|
cellExecutionInputsAtom,
|
|
11
12
|
cellFreshnessAtom,
|
|
13
|
+
cellOutlineAtom,
|
|
14
|
+
cellOutputAtom,
|
|
12
15
|
cellOutputInputsAtom,
|
|
13
16
|
} from "./atoms";
|
|
14
17
|
import type { CellFreshness } from "./freshness";
|
|
15
|
-
import { type CellOutput,
|
|
18
|
+
import { type CellOutput, scratchOutputView } from "./output";
|
|
16
19
|
import { type CellExecutionView, cellExecutionView } from "./select";
|
|
17
20
|
|
|
18
21
|
/**
|
|
@@ -52,13 +55,21 @@ export function useCellFreshness(id: Protocol.CellId): CellFreshness {
|
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
/** What the cell shows: its running value so far, else its result's outcome. */
|
|
55
|
-
export function useCellOutput(id:
|
|
58
|
+
export function useCellOutput(id: CellId): CellOutput | null {
|
|
59
|
+
return useAtomValue(cellOutputAtom(id));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Whether the cell has completed an execution, even one that shows nothing.
|
|
64
|
+
*
|
|
65
|
+
* Tells a cell that ran and has no output from one that has not run yet.
|
|
66
|
+
*/
|
|
67
|
+
export function useCellHasResult(id: Protocol.CellId): boolean {
|
|
56
68
|
const cellAtom = useMemo(
|
|
57
69
|
() =>
|
|
58
70
|
selectAtom(
|
|
59
71
|
cellOutputInputsAtom,
|
|
60
|
-
(inputs) =>
|
|
61
|
-
dequal,
|
|
72
|
+
(inputs) => inputs.results.get(id) != null,
|
|
62
73
|
),
|
|
63
74
|
[id],
|
|
64
75
|
);
|
|
@@ -66,9 +77,8 @@ export function useCellOutput(id: Protocol.CellId): CellOutput | null {
|
|
|
66
77
|
}
|
|
67
78
|
|
|
68
79
|
/** The headings in the cell's output, for the table of contents. */
|
|
69
|
-
export function useCellOutline(id:
|
|
70
|
-
|
|
71
|
-
return useMemo(() => parseOutline(output), [output]);
|
|
80
|
+
export function useCellOutline(id: CellId): Outline | null {
|
|
81
|
+
return useAtomValue(cellOutlineAtom(id));
|
|
72
82
|
}
|
|
73
83
|
|
|
74
84
|
/** What the scratchpad shows, from its latest scratch execution. */
|
|
@@ -12,11 +12,15 @@
|
|
|
12
12
|
export {
|
|
13
13
|
cellExecutionInputsAtom,
|
|
14
14
|
cellFreshnessAtom,
|
|
15
|
+
cellOutlineAtom,
|
|
16
|
+
cellOutputAtom,
|
|
15
17
|
cellOutputInputsAtom,
|
|
18
|
+
cellOutputsAtom,
|
|
16
19
|
clearCellOutputs,
|
|
17
20
|
notebookIsRunningAtom,
|
|
18
21
|
notebookQueuedOrRunningCountAtom,
|
|
19
22
|
observeCellMessage,
|
|
23
|
+
releaseCellOutputAtoms,
|
|
20
24
|
runtimeStatusAtom,
|
|
21
25
|
waitForRuntimeRunning,
|
|
22
26
|
} from "./atoms";
|
|
@@ -27,6 +31,7 @@ export { runCells, syncEdits } from "./run";
|
|
|
27
31
|
export {
|
|
28
32
|
useCellExecution,
|
|
29
33
|
useCellFreshness,
|
|
34
|
+
useCellHasResult,
|
|
30
35
|
useCellOutline,
|
|
31
36
|
useCellOutput,
|
|
32
37
|
useScratchOutput,
|
|
@@ -34,6 +39,7 @@ export {
|
|
|
34
39
|
export {
|
|
35
40
|
type CellError,
|
|
36
41
|
type CellOutput,
|
|
42
|
+
cellOutputsView,
|
|
37
43
|
cellOutputView,
|
|
38
44
|
type HostDiagnostic,
|
|
39
45
|
scratchOutputView,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import type * as Protocol from "@marimo-team/client/protocol";
|
|
13
13
|
import type { CellId } from "@/core/cells/ids";
|
|
14
14
|
import type { MarimoError, OutputMessage } from "@/core/kernel/messages";
|
|
15
|
-
import type { Executions, Results } from "@/core/notebook/replica";
|
|
15
|
+
import type { Executions, Result, Results } from "@/core/notebook/replica";
|
|
16
16
|
|
|
17
17
|
/** A host error shown as its message and the cells involved. */
|
|
18
18
|
export interface HostDiagnostic {
|
|
@@ -33,14 +33,23 @@ export type CellOutput = Omit<OutputMessage, "data"> & {
|
|
|
33
33
|
readonly data: OutputMessage["data"] | readonly CellError[];
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
/**
|
|
36
|
+
/** The execution and display revision hidden by this browser. */
|
|
37
|
+
export interface ClearedOutput {
|
|
38
|
+
readonly execution: Protocol.ExecutionId;
|
|
39
|
+
readonly version: number;
|
|
40
|
+
}
|
|
41
|
+
|
|
37
42
|
export interface CellOutputInputs {
|
|
38
43
|
readonly executions: Executions;
|
|
39
44
|
readonly results: Results;
|
|
40
|
-
/**
|
|
41
|
-
readonly cleared: ReadonlyMap<Protocol.CellId,
|
|
45
|
+
/** What each cell showed when this browser cleared it. */
|
|
46
|
+
readonly cleared: ReadonlyMap<Protocol.CellId, ClearedOutput>;
|
|
47
|
+
/** The confirmed document's cells, for the source an execution ran. */
|
|
48
|
+
readonly cells: ReadonlyMap<Protocol.CellId, Protocol.Cell>;
|
|
42
49
|
}
|
|
43
50
|
|
|
51
|
+
const NO_CELLS: ReadonlyMap<Protocol.CellId, Protocol.Cell> = new Map();
|
|
52
|
+
|
|
44
53
|
const ERROR_MIMETYPE = "application/vnd.marimo+error";
|
|
45
54
|
|
|
46
55
|
/** The protocol's ids are plain strings; the editor brands them. */
|
|
@@ -89,9 +98,9 @@ function errorOutput(
|
|
|
89
98
|
};
|
|
90
99
|
}
|
|
91
100
|
|
|
92
|
-
/** The cell an exception was blamed on,
|
|
101
|
+
/** The cell an exception was blamed on, which is the one cell the host relates to it. */
|
|
93
102
|
function raisingCell(error: Protocol.Error): CellId | null {
|
|
94
|
-
const raised = error.related.
|
|
103
|
+
const raised = error.related.at(0);
|
|
95
104
|
return raised === undefined ? null : brand(raised.cell_id);
|
|
96
105
|
}
|
|
97
106
|
|
|
@@ -170,8 +179,39 @@ function skippedOutput(
|
|
|
170
179
|
]);
|
|
171
180
|
}
|
|
172
181
|
|
|
173
|
-
/**
|
|
174
|
-
|
|
182
|
+
/**
|
|
183
|
+
* The source an execution ran, while the confirmed cell still has it.
|
|
184
|
+
*
|
|
185
|
+
* Fingerprints are opaque, so the editor cannot take one of its draft. The
|
|
186
|
+
* confirmed cell's fingerprint names the source the host holds, which is
|
|
187
|
+
* the execution's own until an edit is confirmed.
|
|
188
|
+
*/
|
|
189
|
+
function sourceOf(
|
|
190
|
+
record: Protocol.Execution,
|
|
191
|
+
cells: ReadonlyMap<Protocol.CellId, Protocol.Cell>,
|
|
192
|
+
): string | undefined {
|
|
193
|
+
const cell = record.cell_id === null ? undefined : cells.get(record.cell_id);
|
|
194
|
+
return cell !== undefined &&
|
|
195
|
+
cell.code !== null &&
|
|
196
|
+
cell.code_fingerprint === record.code_fingerprint
|
|
197
|
+
? cell.code
|
|
198
|
+
: undefined;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* What an execution's outcome shows, or null for an empty value, with the
|
|
203
|
+
* source it ran when `cells` still holds it.
|
|
204
|
+
*/
|
|
205
|
+
export function outcomeOutput(
|
|
206
|
+
record: Protocol.Execution,
|
|
207
|
+
cells: ReadonlyMap<Protocol.CellId, Protocol.Cell> = NO_CELLS,
|
|
208
|
+
): CellOutput | null {
|
|
209
|
+
const output = outcomeDisplay(record);
|
|
210
|
+
const code = sourceOf(record, cells);
|
|
211
|
+
return output === null || code === undefined ? output : { ...output, code };
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function outcomeDisplay(record: Protocol.Execution): CellOutput | null {
|
|
175
215
|
const outcome = record.outcome;
|
|
176
216
|
if (outcome === null) {
|
|
177
217
|
return null;
|
|
@@ -191,52 +231,96 @@ export function outcomeOutput(record: Protocol.Execution): CellOutput | null {
|
|
|
191
231
|
}
|
|
192
232
|
|
|
193
233
|
/**
|
|
194
|
-
*
|
|
234
|
+
* The execution whose outcome a cell shows: its running one once that has
|
|
235
|
+
* shown something, else its result.
|
|
195
236
|
*
|
|
196
237
|
* A running execution's outcome is null until it shows something, so the
|
|
197
238
|
* result stays up until then. Once it has shown, an empty display means
|
|
198
|
-
* the cell cleared its output, and nothing shows.
|
|
239
|
+
* the cell cleared its output, and nothing shows. A result that says the
|
|
240
|
+
* cell did not run comes down as soon as it does run.
|
|
199
241
|
*/
|
|
200
|
-
export function
|
|
201
|
-
inputs: CellOutputInputs,
|
|
242
|
+
export function shownExecution(
|
|
243
|
+
inputs: Pick<CellOutputInputs, "executions" | "results">,
|
|
202
244
|
id: Protocol.CellId,
|
|
203
|
-
):
|
|
245
|
+
): Result | null {
|
|
204
246
|
const latestId = inputs.executions.latest.get(id);
|
|
205
247
|
const latest =
|
|
206
248
|
latestId === undefined
|
|
207
249
|
? undefined
|
|
208
|
-
: inputs.executions.executions.get(latestId)
|
|
209
|
-
if (
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
250
|
+
: inputs.executions.executions.get(latestId);
|
|
251
|
+
if (
|
|
252
|
+
latest !== undefined &&
|
|
253
|
+
latest.record.outcome !== null &&
|
|
254
|
+
latest.record.status !== "completed"
|
|
255
|
+
) {
|
|
256
|
+
return latest;
|
|
213
257
|
}
|
|
214
|
-
const result = inputs.results.get(id);
|
|
215
|
-
if (
|
|
258
|
+
const result = inputs.results.get(id) ?? null;
|
|
259
|
+
if (
|
|
260
|
+
latest?.record.status === "running" &&
|
|
261
|
+
result?.record.outcome?.kind === "skipped"
|
|
262
|
+
) {
|
|
216
263
|
return null;
|
|
217
264
|
}
|
|
218
|
-
|
|
265
|
+
return result;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Whether `record` still shows what was cleared.
|
|
270
|
+
*
|
|
271
|
+
* A running execution that shows something new after the clear comes back,
|
|
272
|
+
* and so does a newer execution.
|
|
273
|
+
*/
|
|
274
|
+
function stillCleared(
|
|
275
|
+
cleared: ClearedOutput | undefined,
|
|
276
|
+
shown: Result,
|
|
277
|
+
): boolean {
|
|
278
|
+
return (
|
|
279
|
+
cleared?.execution === shown.record.id &&
|
|
280
|
+
cleared.version === shown.outputVersion
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** What a cell shows, unless this browser cleared it. */
|
|
285
|
+
export function cellOutputView(
|
|
286
|
+
inputs: CellOutputInputs,
|
|
287
|
+
id: Protocol.CellId,
|
|
288
|
+
): CellOutput | null {
|
|
289
|
+
const shown = shownExecution(inputs, id);
|
|
290
|
+
if (shown === null || stillCleared(inputs.cleared.get(id), shown)) {
|
|
219
291
|
return null;
|
|
220
292
|
}
|
|
221
|
-
return outcomeOutput(
|
|
293
|
+
return outcomeOutput(shown.record, inputs.cells);
|
|
222
294
|
}
|
|
223
295
|
|
|
224
|
-
/**
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
296
|
+
/**
|
|
297
|
+
* What each cell with a result or a running execution shows, by cell id.
|
|
298
|
+
*
|
|
299
|
+
* Cells showing nothing are left out, so a reader can tell "no output"
|
|
300
|
+
* from "has a cell" without the document.
|
|
301
|
+
*/
|
|
302
|
+
export function cellOutputsView(
|
|
303
|
+
inputs: CellOutputInputs,
|
|
304
|
+
): ReadonlyMap<CellId, CellOutput> {
|
|
305
|
+
const outputs = new Map<CellId, CellOutput>();
|
|
306
|
+
const cellIds = new Set([
|
|
307
|
+
...inputs.results.keys(),
|
|
308
|
+
...inputs.executions.latest.keys(),
|
|
309
|
+
]);
|
|
310
|
+
for (const cellId of cellIds) {
|
|
311
|
+
const output = cellOutputView(inputs, cellId);
|
|
312
|
+
if (output !== null) {
|
|
313
|
+
outputs.set(brand(cellId), output);
|
|
236
314
|
}
|
|
237
315
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
316
|
+
return outputs;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* The latest scratch display, retained until a newer execution shows one.
|
|
321
|
+
*/
|
|
322
|
+
export function scratchOutputView(executions: Executions): CellOutput | null {
|
|
323
|
+
return executions.scratch === null
|
|
324
|
+
? null
|
|
325
|
+
: outcomeOutput(executions.scratch.record);
|
|
242
326
|
}
|
|
@@ -96,7 +96,7 @@ function awaited(inputs: CellExecutionInputs, id: Protocol.CellId): boolean {
|
|
|
96
96
|
}
|
|
97
97
|
const planned =
|
|
98
98
|
latestOf(inputs.executions, id)?.record.run_id ??
|
|
99
|
-
inputs.results.get(id)?.run_id;
|
|
99
|
+
inputs.results.get(id)?.record.run_id;
|
|
100
100
|
for (const run of inputs.executions.runs.values()) {
|
|
101
101
|
if (
|
|
102
102
|
run.status !== "completed" &&
|
|
@@ -114,7 +114,7 @@ export function cellExecutionView(
|
|
|
114
114
|
id: Protocol.CellId,
|
|
115
115
|
): CellExecutionView {
|
|
116
116
|
const latest = latestOf(inputs.executions, id);
|
|
117
|
-
const result = inputs.results.get(id) ?? null;
|
|
117
|
+
const result = inputs.results.get(id)?.record ?? null;
|
|
118
118
|
let status: CellRunStatus = "idle";
|
|
119
119
|
let startedAt = result === null ? null : millis(result.started_at);
|
|
120
120
|
let rendered = false;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
|
+
import type * as Protocol from "@marimo-team/client/protocol";
|
|
3
4
|
import { renderHook } from "@testing-library/react";
|
|
4
5
|
import { createStore, Provider } from "jotai";
|
|
5
6
|
import type { ReactNode } from "react";
|
|
6
7
|
import * as React from "react";
|
|
7
8
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
8
9
|
import { MockModules, Mocks } from "@/__mocks__/common";
|
|
10
|
+
import { MockExecutions } from "@/__mocks__/executions";
|
|
9
11
|
import { cellId } from "@/__tests__/branded";
|
|
10
|
-
import type { CellId } from "@/core/cells/ids";
|
|
11
12
|
import { CellOutputId } from "@/core/cells/ids";
|
|
12
|
-
import type {
|
|
13
|
+
import type { CellOutput } from "@/core/executions";
|
|
13
14
|
import { ProgressState } from "@/utils/progress";
|
|
14
15
|
import {
|
|
15
16
|
captureTracker,
|
|
@@ -26,19 +27,10 @@ vi.mock("@/utils/Logger", () => ({ Logger: Mocks.quietLogger() }));
|
|
|
26
27
|
|
|
27
28
|
vi.mock("@/components/ui/use-toast", () => MockModules.toast());
|
|
28
29
|
|
|
29
|
-
// Mock cellsRuntimeAtom - must be defined inline in the factory function
|
|
30
|
-
vi.mock("@/core/cells/cells", async () => {
|
|
31
|
-
const { atom } = await import("jotai");
|
|
32
|
-
return {
|
|
33
|
-
cellsRuntimeAtom: atom({}),
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
|
|
37
30
|
const progress = ProgressState.indeterminate();
|
|
38
31
|
|
|
39
32
|
import { toPng } from "html-to-image";
|
|
40
33
|
import { toast } from "@/components/ui/use-toast";
|
|
41
|
-
import { cellsRuntimeAtom } from "@/core/cells/cells";
|
|
42
34
|
import { Logger } from "@/utils/Logger";
|
|
43
35
|
|
|
44
36
|
describe("useEnrichCellOutputs", () => {
|
|
@@ -53,26 +45,25 @@ describe("useEnrichCellOutputs", () => {
|
|
|
53
45
|
const wrapper = ({ children }: { children: ReactNode }) =>
|
|
54
46
|
React.createElement(Provider, { store }, children);
|
|
55
47
|
|
|
56
|
-
|
|
57
|
-
const setCellsRuntime = (
|
|
58
|
-
|
|
59
|
-
store.set(cellsRuntimeAtom as any, value);
|
|
48
|
+
/** Make the host report `records` as the cells' results. */
|
|
49
|
+
const setCellsRuntime = (records: Protocol.Execution[]) => {
|
|
50
|
+
MockExecutions.seed(store, records);
|
|
60
51
|
};
|
|
61
52
|
|
|
53
|
+
/** A completed execution per cell that shows its `output`. */
|
|
62
54
|
const createMockCellRuntimes = (
|
|
63
|
-
cells: Record<string,
|
|
64
|
-
):
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
)
|
|
75
|
-
};
|
|
55
|
+
cells: Record<string, { output: CellOutput | null }>,
|
|
56
|
+
): Protocol.Execution[] =>
|
|
57
|
+
Object.entries(cells).flatMap(([cellId, { output }]) =>
|
|
58
|
+
output === null
|
|
59
|
+
? []
|
|
60
|
+
: [
|
|
61
|
+
MockExecutions.shown(cellId, {
|
|
62
|
+
mimetype: output.mimetype,
|
|
63
|
+
data: String(output.data),
|
|
64
|
+
}),
|
|
65
|
+
],
|
|
66
|
+
);
|
|
76
67
|
|
|
77
68
|
it("should return empty object when no cells need screenshots", async () => {
|
|
78
69
|
vi.spyOn(document, "getElementById");
|
|
@@ -502,7 +493,7 @@ describe("useEnrichCellOutputs", () => {
|
|
|
502
493
|
output: null,
|
|
503
494
|
},
|
|
504
495
|
"cell-2": {
|
|
505
|
-
output:
|
|
496
|
+
output: null,
|
|
506
497
|
},
|
|
507
498
|
}),
|
|
508
499
|
);
|
package/src/core/export/hooks.ts
CHANGED
|
@@ -9,8 +9,8 @@ import { getImageDataUrlForCell } from "@/utils/download";
|
|
|
9
9
|
import { Logger } from "@/utils/Logger";
|
|
10
10
|
import { Objects } from "@/utils/objects";
|
|
11
11
|
import { ProgressState } from "@/utils/progress";
|
|
12
|
-
import { cellsRuntimeAtom } from "../cells/cells";
|
|
13
12
|
import type { CellId } from "../cells/ids";
|
|
13
|
+
import { cellOutputsAtom } from "../executions";
|
|
14
14
|
import { getExportLayout } from "./layout";
|
|
15
15
|
import { connectionAtom } from "../network/connection";
|
|
16
16
|
import { useRequestClient } from "../network/requests";
|
|
@@ -122,16 +122,15 @@ interface UseEnrichCellOutputsOptions {
|
|
|
122
122
|
export function useEnrichCellOutputs(): (
|
|
123
123
|
opts: UseEnrichCellOutputsOptions,
|
|
124
124
|
) => Promise<ScreenshotResults> {
|
|
125
|
-
const
|
|
125
|
+
const outputs = useAtomValue(cellOutputsAtom);
|
|
126
126
|
|
|
127
127
|
return async (
|
|
128
128
|
opts: UseEnrichCellOutputsOptions,
|
|
129
129
|
): Promise<ScreenshotResults> => {
|
|
130
130
|
const { progress } = opts;
|
|
131
131
|
|
|
132
|
-
// Prune tracked state for cells that no longer
|
|
133
|
-
|
|
134
|
-
captureTracker.prune(currentCellIds);
|
|
132
|
+
// Prune tracked state for cells that no longer show anything
|
|
133
|
+
captureTracker.prune(new Set(outputs.keys()));
|
|
135
134
|
|
|
136
135
|
const cellsToCaptureScreenshot: [CellId, unknown][] = [];
|
|
137
136
|
const inFlightWaiters: {
|
|
@@ -139,11 +138,10 @@ export function useEnrichCellOutputs(): (
|
|
|
139
138
|
promise: Promise<ScreenshotResult | undefined>;
|
|
140
139
|
}[] = [];
|
|
141
140
|
|
|
142
|
-
for (const [cellId,
|
|
143
|
-
const outputData =
|
|
141
|
+
for (const [cellId, output] of outputs) {
|
|
142
|
+
const outputData = output.data;
|
|
144
143
|
if (
|
|
145
|
-
|
|
146
|
-
MIME_TYPES_TO_CAPTURE_SCREENSHOTS.has(runtime.output.mimetype) &&
|
|
144
|
+
MIME_TYPES_TO_CAPTURE_SCREENSHOTS.has(output.mimetype) &&
|
|
147
145
|
outputData
|
|
148
146
|
) {
|
|
149
147
|
if (captureTracker.needsCapture(cellId, outputData)) {
|