@marimo-team/islands 0.25.3-dev267 → 0.25.3-dev269
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-C4yCN38h.js → ConnectedDataExplorerComponent-eLHPh6uu.js} +8 -8
- package/dist/{ErrorBoundary-CewXPyL5.js → ErrorBoundary-DCtynjHZ.js} +4 -4
- package/dist/{abnfDiagram-VCTEODGH-o6Ay6Q63.js → abnfDiagram-VCTEODGH-hqd0IBtX.js} +2 -2
- package/dist/{architectureDiagram-5GKGNRK7-BhiwwlVg.js → architectureDiagram-5GKGNRK7-BzLAFcc0.js} +1 -1
- package/dist/{strings-BCKpLFNU.js → assertNever-DIU3JJbt.js} +14 -14
- package/dist/{chat-ui-CbgR5ivy.js → chat-ui-BWIkve2R.js} +17 -17
- package/dist/{chunk-IMKFNOWR-WMSMf4Nj.js → chunk-IMKFNOWR-DOeVvuyE.js} +1 -1
- package/dist/{chunk-SHT3W25Y-BRfADrzD.js → chunk-SHT3W25Y-DZoFI8wR.js} +1 -1
- package/dist/{chunk-SVP7TREG-CuK5QFre.js → chunk-SVP7TREG-CWu86PSW.js} +1 -1
- package/dist/{chunk-TICWLB2K-Bcun_jhJ.js → chunk-TICWLB2K-BrM0GoP3.js} +1 -1
- package/dist/{classDiagram-ZZMXUADV-CgWDbUDT.js → classDiagram-ZZMXUADV-DYi4V2bB.js} +2 -2
- package/dist/{classDiagram-v2-VYDZK3BY-DYmc9SFU.js → classDiagram-v2-VYDZK3BY-tN7FIk-m.js} +2 -2
- package/dist/{code-visibility-BKBl9Rh6.js → code-visibility-CMF5tcNj.js} +44 -47
- package/dist/{common-N3Jd_6m9.js → common-DYAjQ1bK.js} +4866 -4857
- package/dist/{config-CmeG_Pb6.js → config-BsPruWMR.js} +2 -2
- package/dist/{createReducer-C_syF8Td.js → createReducer-DdtT_7ji.js} +1 -1
- package/dist/{cynefinDiagram-5FMLGOSQ-PPKWipjT.js → cynefinDiagram-5FMLGOSQ-D5nCnDc-.js} +1 -1
- package/dist/{dagre-GXQ25YYZ-niRBZh--.js → dagre-GXQ25YYZ-BHkd7f_i.js} +1 -1
- package/dist/{data-grid-overlay-editor-Cp59CrqZ.js → data-grid-overlay-editor-B6oND8pX.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-DPiP9rot.js → diagram-S7CK7UJ4-D1ALppT2.js} +1 -1
- package/dist/{diagram-UQ7AKVKN-B0WZuaxV.js → diagram-UQ7AKVKN-DLv0b83L.js} +1 -1
- package/dist/{diagram-VX7I27RA-Rn42WBuN.js → diagram-VX7I27RA-7XJ7J6qg.js} +1 -1
- package/dist/{diagram-Z3DM3KII-BB93--ry.js → diagram-Z3DM3KII-7M7zbHp_.js} +1 -1
- package/dist/{dialog-BtprQCUw.js → dialog-DzCj1qQv.js} +1 -1
- package/dist/{dropdown-menu-BpImEfn3.js → dropdown-menu-CdXE15an.js} +3 -3
- package/dist/{ebnfDiagram-PWID7BFC-V4t5h6mZ.js → ebnfDiagram-PWID7BFC-DHH1qlmV.js} +2 -2
- package/dist/{erDiagram-RLTQ6QDP-C1MsAKXd.js → erDiagram-RLTQ6QDP-fI_0dGef.js} +1 -1
- package/dist/{error-entries-CJGdD2ky.js → error-entries-CxN-Nq3V.js} +519 -458
- package/dist/{feedback-button-Qc1f9iPq.js → feedback-button-BelKx6R5.js} +22 -22
- package/dist/{flowDiagram-HODETNUW-DHjeJP96.js → flowDiagram-HODETNUW-Brg9MA6i.js} +2 -2
- package/dist/{formats-gGospKWJ.js → formats-DbSvAPY-.js} +1 -1
- package/dist/{glide-data-editor-hCq3K0sd.js → glide-data-editor-CMZ-kv0S.js} +11 -11
- package/dist/{glide-utils-DC3sk6EX.js → glide-utils-BSw3SSHF.js} +1 -1
- package/dist/{globals-B2_uMYDY.js → globals-DV77npCG.js} +2 -2
- package/dist/{html-to-image-S7spRQCi.js → html-to-image-Bc2AvXHG.js} +5121 -5121
- package/dist/{infoDiagram-27XIBGKW-Dovv6iKx.js → infoDiagram-27XIBGKW-E9e403YT.js} +1 -1
- package/dist/{ishikawaDiagram-5VMMS53U-D2nyygsc.js → ishikawaDiagram-5VMMS53U-C-RlYDRo.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-KyVx0uTY.js → kanban-definition-UXKFOSKX-CLFl_uqK.js} +1 -1
- package/dist/main.js +5972 -6003
- package/dist/{mermaid-B-jKSwGt.js → mermaid-rd09e1JL.js} +34 -34
- package/dist/{mindmap-definition-YA3MSWOX-Bz9tKQFl.js → mindmap-definition-YA3MSWOX-BQ8TWtyB.js} +1 -1
- package/dist/{number-overlay-editor-CfNYvbdz.js → number-overlay-editor-CFTuKnrY.js} +1 -1
- package/dist/{pegDiagram-XKGWAZYB-C_qpq6Tv.js → pegDiagram-XKGWAZYB-CN8UHFPi.js} +2 -2
- package/dist/{pieDiagram-E7YTZNPT-Bp9ucgI4.js → pieDiagram-E7YTZNPT-DGuJ0EBd.js} +1 -1
- package/dist/{process-output-f34bkXTm.js → process-output-qecD7Dk8.js} +3 -3
- package/dist/{railroadDiagram-O6MQD6OU-tq-VEH6j.js → railroadDiagram-O6MQD6OU-BPDA8wy8.js} +2 -2
- package/dist/{requirementDiagram-BXWQKSXE-DW-vHadb.js → requirementDiagram-BXWQKSXE-ChzLGbGW.js} +1 -1
- package/dist/{reveal-component-CUxv-kkP.js → reveal-component-Doix35eL.js} +1094 -1094
- package/dist/{select-C33FVPPN.js → select-OxgozOC8.js} +1 -1
- package/dist/{sequenceDiagram-WJ2MYXX4-Dv9U9qRP.js → sequenceDiagram-WJ2MYXX4-DFX-bE6O.js} +1 -1
- package/dist/{spec-DH1lmF7Q.js → spec-oJn0RhpQ.js} +2 -2
- package/dist/{stateDiagram-D77RDMKH-DTmPQ0EB.js → stateDiagram-D77RDMKH-BR7cI3wK.js} +2 -2
- package/dist/{stateDiagram-v2-MP3YSRHH-CkCif0Iw.js → stateDiagram-v2-MP3YSRHH-oGqB5UDI.js} +2 -2
- package/dist/{static-state-BldGd99T.js → static-state-CuV6Pc3a.js} +1 -1
- package/dist/{swimlanes-42K2YHIH-21kCq6l8.js → swimlanes-42K2YHIH-DwSZl1yC.js} +1 -1
- package/dist/{swimlanesDiagram-VR7AAH4N-BpRJP6KU.js → swimlanesDiagram-VR7AAH4N-BHlcd-Ri.js} +2 -2
- package/dist/{timeline-definition-24CTP7MA-Ckgh4lS4.js → timeline-definition-24CTP7MA-DMmP-G2O.js} +1 -1
- package/dist/{toast-DpczUryP.js → toast-DbBHmxmB.js} +1 -1
- package/dist/{useAsyncData-DsZMvNXn.js → useAsyncData-BYIAoMqn.js} +1 -1
- package/dist/{useDateFormatter-Dk_xFci4.js → useDateFormatter-ButWkdcK.js} +1 -1
- package/dist/{useDeepCompareMemoize-KMBBux8C.js → useDeepCompareMemoize-Bz0c5GN6.js} +1 -1
- package/dist/{useTheme-BZ2GGLgm.js → useTheme-DPLobSFs.js} +7 -7
- package/dist/{utils-DXkj82sK.js → utils-EBklsC5R.js} +31 -31
- package/dist/{vega-component-CF9kI6C4.js → vega-component-rxIxAAh9.js} +6 -6
- package/dist/{vennDiagram-4TSXK5OY-CDei2Bt3.js → vennDiagram-4TSXK5OY-Db8GtH1G.js} +1 -1
- package/dist/{wardleyDiagram-VM6X3IG4-CXavT601.js → wardleyDiagram-VM6X3IG4-DmIiC3FU.js} +1 -1
- package/dist/{xychartDiagram-S5SC5T6Z-CvJhcZri.js → xychartDiagram-S5SC5T6Z-DS9OPrNq.js} +1 -1
- package/package.json +1 -1
- package/src/__mocks__/executions.ts +195 -0
- package/src/__mocks__/notebook.ts +0 -1
- package/src/__tests__/CellStatus.test.tsx +19 -20
- package/src/components/dependency-graph/minimap-content.tsx +3 -2
- package/src/components/editor/__tests__/data-attributes.test.tsx +0 -7
- package/src/components/editor/__tests__/output-persistence.test.tsx +2 -2
- package/src/components/editor/actions/__tests__/useCellActionButton.test.tsx +1 -0
- package/src/components/editor/actions/useCellActionButton.tsx +7 -3
- package/src/components/editor/alerts/stdin-blocking-alert.tsx +3 -1
- package/src/components/editor/cell/CellStatus.tsx +23 -19
- package/src/components/editor/cell/RunButton.tsx +16 -6
- package/src/components/editor/cell/__tests__/useRunCells.test.ts +45 -0
- package/src/components/editor/cell/cell-context-menu.tsx +4 -1
- package/src/components/editor/cell/code/cell-editor.tsx +7 -5
- package/src/components/editor/cell/collapse.tsx +4 -0
- package/src/components/editor/cell/useRunCells.ts +18 -3
- package/src/components/editor/chrome/wrapper/sidebar.tsx +2 -4
- package/src/components/editor/header/status.tsx +4 -2
- package/src/components/editor/navigation/navigation.ts +3 -2
- package/src/components/editor/notebook-cell.tsx +82 -83
- package/src/components/editor/renderers/grid-layout/__tests__/grid-layout.test.tsx +75 -0
- package/src/components/editor/renderers/grid-layout/grid-layout.tsx +22 -16
- package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +0 -1
- package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +12 -33
- package/src/components/editor/stdin-blocking-alert.tsx +3 -1
- package/src/components/scratchpad/scratchpad.tsx +4 -1
- package/src/components/slides/minimap.tsx +4 -2
- package/src/components/slides/reveal-component.tsx +14 -10
- package/src/components/slides/slide-cell-view.tsx +28 -24
- package/src/components/slides/slide.tsx +3 -4
- package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +0 -389
- package/src/core/cells/__tests__/cell.test.ts +49 -154
- package/src/core/cells/__tests__/cells.test.ts +18 -127
- package/src/core/cells/__tests__/pending-delete-service.test.tsx +11 -20
- package/src/core/cells/__tests__/utils.test.ts +75 -247
- package/src/core/cells/actions.ts +5 -2
- package/src/core/cells/cell.ts +31 -133
- package/src/core/cells/cells.ts +14 -29
- package/src/core/cells/document.ts +3 -3
- package/src/core/cells/focus.ts +27 -6
- package/src/core/cells/layout.ts +1 -1
- package/src/core/cells/pending-delete-service.ts +5 -7
- package/src/core/cells/types.ts +13 -36
- package/src/core/cells/utils.ts +37 -68
- package/src/core/edit-app.tsx +2 -1
- package/src/core/executions/__tests__/atoms.test.ts +99 -0
- package/src/core/executions/__tests__/select.test.ts +268 -0
- package/src/core/executions/atoms.ts +206 -0
- package/src/core/executions/hooks.ts +31 -0
- package/src/core/executions/index.ts +31 -0
- package/src/core/executions/select.ts +175 -0
- package/src/core/export/__tests__/hooks.test.ts +0 -5
- package/src/core/islands/bootstrap.ts +4 -1
- package/src/core/islands/components/output-wrapper.tsx +5 -5
- package/src/core/kernel/handlers.ts +2 -11
- package/src/core/kernel/state.ts +0 -15
- package/src/core/lifecycle/render-policy.ts +12 -26
- package/src/core/network/__tests__/requests-lazy.test.ts +5 -5
- package/src/core/network/requests-lazy.ts +3 -3
- package/src/core/notebook/operations.ts +1 -1
- package/src/core/run-app.tsx +2 -1
- package/src/core/runtime/__tests__/adapter.test.ts +3 -3
- package/src/core/runtime/adapter.ts +4 -4
- package/src/core/session/useNotebookSession.tsx +3 -3
- package/src/core/wasm/bridge.ts +1 -1
- package/src/plugins/core/RenderHTML.tsx +3 -5
- package/src/plugins/core/__test__/RenderHTML-copy.test.tsx +60 -0
- package/src/plugins/core/registerReactComponent.tsx +4 -13
- package/src/stories/cell-status.stories.tsx +17 -10
- package/src/stories/cell.stories.tsx +0 -31
- package/src/stories/layout/vertical/one-column.stories.tsx +0 -9
- package/src/utils/time.ts +10 -0
|
@@ -32,7 +32,7 @@ import { getReadonlyCodeDisplay } from "@/core/cells/readonly-code-display";
|
|
|
32
32
|
import { MarkdownLanguageAdapter } from "@/core/codemirror/language/languages/markdown";
|
|
33
33
|
import { useResolvedMarimoConfig } from "@/core/config/config";
|
|
34
34
|
import { CSSClasses } from "@/core/constants";
|
|
35
|
-
import {
|
|
35
|
+
import { runtimeStatusAtom, useCellExecution } from "@/core/executions";
|
|
36
36
|
import { useNotebookCodeAvailable } from "@/core/meta/code-visibility";
|
|
37
37
|
import { showCodeInRunModeAtom } from "@/core/meta/state";
|
|
38
38
|
import {
|
|
@@ -73,7 +73,7 @@ const VerticalLayoutRenderer: React.FC<VerticalLayoutProps> = ({
|
|
|
73
73
|
}) => {
|
|
74
74
|
const { invisible } = useDelayVisibility(cells.length, mode);
|
|
75
75
|
const kioskMode = useAtomValue(kioskModeAtom);
|
|
76
|
-
const
|
|
76
|
+
const runtimeStatus = useAtomValue(runtimeStatusAtom);
|
|
77
77
|
const [userConfig] = useResolvedMarimoConfig();
|
|
78
78
|
const showCodeInRunModePreference = useAtomValue(showCodeInRunModeAtom);
|
|
79
79
|
|
|
@@ -98,16 +98,11 @@ const VerticalLayoutRenderer: React.FC<VerticalLayoutProps> = ({
|
|
|
98
98
|
cellId={cell.id}
|
|
99
99
|
output={cell.output}
|
|
100
100
|
consoleOutputs={cell.consoleOutputs}
|
|
101
|
-
status={cell.status}
|
|
102
101
|
code={cell.code}
|
|
103
102
|
config={cell.config}
|
|
104
103
|
cellOutputArea={userConfig.display.cell_output}
|
|
105
|
-
stopped={cell.stopped}
|
|
106
104
|
showCode={showCode && canShowCode}
|
|
107
|
-
errored={cell.errored}
|
|
108
105
|
mode={mode}
|
|
109
|
-
runStartTimestamp={cell.runStartTimestamp}
|
|
110
|
-
interrupted={cell.interrupted}
|
|
111
106
|
staleInputs={cell.staleInputs}
|
|
112
107
|
name={cell.name}
|
|
113
108
|
kiosk={kioskMode}
|
|
@@ -134,8 +129,9 @@ const VerticalLayoutRenderer: React.FC<VerticalLayoutProps> = ({
|
|
|
134
129
|
}
|
|
135
130
|
|
|
136
131
|
if (cells.length === 0 && !invisible) {
|
|
137
|
-
//
|
|
138
|
-
|
|
132
|
+
// Until the host reports the runtime running, show loading state.
|
|
133
|
+
// A static notebook has no runtime to wait for.
|
|
134
|
+
if (runtimeStatus !== "running" && !isStaticNotebook()) {
|
|
139
135
|
return (
|
|
140
136
|
<div className="flex-1 flex flex-col items-center justify-center py-8">
|
|
141
137
|
<Loader2Icon className="w-8 h-8 animate-spin text-muted-foreground" />
|
|
@@ -304,14 +300,7 @@ const ActionButtons: React.FC<{
|
|
|
304
300
|
|
|
305
301
|
interface VerticalCellProps extends Pick<
|
|
306
302
|
CellRuntimeState,
|
|
307
|
-
| "
|
|
308
|
-
| "consoleOutputs"
|
|
309
|
-
| "status"
|
|
310
|
-
| "stopped"
|
|
311
|
-
| "errored"
|
|
312
|
-
| "interrupted"
|
|
313
|
-
| "staleInputs"
|
|
314
|
-
| "runStartTimestamp"
|
|
303
|
+
"output" | "consoleOutputs" | "staleInputs"
|
|
315
304
|
> {
|
|
316
305
|
cellOutputArea: "above" | "below";
|
|
317
306
|
cellId: CellId;
|
|
@@ -330,13 +319,8 @@ const VerticalCell = memo(
|
|
|
330
319
|
consoleOutputs,
|
|
331
320
|
cellOutputArea,
|
|
332
321
|
cellId,
|
|
333
|
-
status,
|
|
334
|
-
stopped,
|
|
335
|
-
errored,
|
|
336
322
|
config,
|
|
337
|
-
interrupted,
|
|
338
323
|
staleInputs,
|
|
339
|
-
runStartTimestamp,
|
|
340
324
|
code,
|
|
341
325
|
showCode,
|
|
342
326
|
mode,
|
|
@@ -345,18 +329,13 @@ const VerticalCell = memo(
|
|
|
345
329
|
showErrorTracebacks,
|
|
346
330
|
}: VerticalCellProps) => {
|
|
347
331
|
const cellRef = useRef<HTMLDivElement>(null);
|
|
332
|
+
const execution = useCellExecution(cellId);
|
|
333
|
+
const errored = execution.outcome === "error";
|
|
334
|
+
const interrupted = execution.outcome === "interrupted";
|
|
335
|
+
const stopped = execution.outcome === "skipped";
|
|
348
336
|
|
|
349
|
-
const outputStale = outputIsStale(
|
|
350
|
-
|
|
351
|
-
status,
|
|
352
|
-
output,
|
|
353
|
-
interrupted,
|
|
354
|
-
runStartTimestamp,
|
|
355
|
-
staleInputs,
|
|
356
|
-
},
|
|
357
|
-
false,
|
|
358
|
-
);
|
|
359
|
-
const loading = outputIsLoading(status);
|
|
337
|
+
const outputStale = outputIsStale(execution, staleInputs, false);
|
|
338
|
+
const loading = outputIsLoading(execution.status);
|
|
360
339
|
|
|
361
340
|
// Kiosk and not presenting
|
|
362
341
|
const kioskFull = kiosk && mode !== "present";
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { atom, useAtomValue } from "jotai";
|
|
4
4
|
import { notebookAtom } from "@/core/cells/cells";
|
|
5
|
+
import { cellExecutionInputsAtom, cellExecutionView } from "@/core/executions";
|
|
5
6
|
import { Banner } from "@/plugins/impl/common/error-banner";
|
|
6
7
|
import { Logger } from "@/utils/Logger";
|
|
7
8
|
import { Button } from "../ui/button";
|
|
@@ -11,12 +12,13 @@ import { DelayMount } from "../utils/delay-mount";
|
|
|
11
12
|
// Atom to check if there is a cell with unresolved stdin
|
|
12
13
|
const hasBlockingStdinAtom = atom((get) => {
|
|
13
14
|
const notebook = get(notebookAtom);
|
|
15
|
+
const executions = get(cellExecutionInputsAtom);
|
|
14
16
|
|
|
15
17
|
// Check each cell in order
|
|
16
18
|
for (const cellId of notebook.cellIds) {
|
|
17
19
|
// Check if the cell is idle and has unresolved stdin
|
|
18
20
|
const runtime = notebook.cellRuntime[cellId];
|
|
19
|
-
if (
|
|
21
|
+
if (cellExecutionView(executions, cellId).status === "idle") {
|
|
20
22
|
const hasUnresolvedStdin = runtime.consoleOutputs.some(
|
|
21
23
|
(output) => output.channel === "stdin" && output.response === undefined,
|
|
22
24
|
);
|
|
@@ -23,6 +23,7 @@ import { prepareCellCodeUpdate } from "@/core/codemirror/language/cell-code";
|
|
|
23
23
|
import { getEditorCodeAsPython } from "@/core/codemirror/language/utils";
|
|
24
24
|
import { useResolvedMarimoConfig } from "@/core/config/config";
|
|
25
25
|
import { CSSClasses } from "@/core/constants";
|
|
26
|
+
import { cellExecutionInputsAtom, scratchStatus } from "@/core/executions";
|
|
26
27
|
import { useRequestClient } from "@/core/network/requests";
|
|
27
28
|
import type { CellConfig } from "@/core/network/types";
|
|
28
29
|
import { LazyAnyLanguageCodeMirror } from "@/plugins/impl/code/LazyAnyLanguageCodeMirror";
|
|
@@ -67,7 +68,9 @@ export const ScratchPad: React.FC = () => {
|
|
|
67
68
|
const cellId = SCRATCH_CELL_ID;
|
|
68
69
|
const cellRuntime = notebookState.cellRuntime[cellId];
|
|
69
70
|
const output = cellRuntime?.output;
|
|
70
|
-
const status =
|
|
71
|
+
const status = scratchStatus(
|
|
72
|
+
useAtomValue(cellExecutionInputsAtom).executions,
|
|
73
|
+
);
|
|
71
74
|
const consoleOutputs = cellRuntime?.consoleOutputs;
|
|
72
75
|
const [code, setCode] = useAtom(scratchpadCodeAtom);
|
|
73
76
|
const codeListener = useMemo(
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { useDeleteCellCallback } from "@/components/editor/cell/useDeleteCell";
|
|
4
4
|
import { outputIsStale } from "@/core/cells/cell";
|
|
5
|
+
import { useCellExecution } from "@/core/executions";
|
|
5
6
|
import { useCellActions } from "@/core/cells/actions";
|
|
6
7
|
import type { CellId } from "@/core/cells/ids";
|
|
7
8
|
import { type CellColumnId, type Layout, useLayout } from "@/core/cells/layout";
|
|
@@ -627,6 +628,7 @@ const SlideThumbnailCard = ({
|
|
|
627
628
|
...props
|
|
628
629
|
}: SlideThumbnailCardProps) => {
|
|
629
630
|
const { width, height, scale } = dimensions;
|
|
631
|
+
const execution = useCellExecution(cell.id);
|
|
630
632
|
const visual = isNoOutput ? NO_OUTPUT_VISUAL : getSlideTypeVisual(slideType);
|
|
631
633
|
const isSkipped = isNoOutput || slideType === "skip";
|
|
632
634
|
|
|
@@ -675,9 +677,9 @@ const SlideThumbnailCard = ({
|
|
|
675
677
|
) : (
|
|
676
678
|
<Slide
|
|
677
679
|
cellId={cell.id}
|
|
678
|
-
status={
|
|
680
|
+
status={execution.status}
|
|
679
681
|
output={cell.output}
|
|
680
|
-
stale={outputIsStale(cell, false)}
|
|
682
|
+
stale={outputIsStale(execution, cell.staleInputs, false)}
|
|
681
683
|
/>
|
|
682
684
|
)}
|
|
683
685
|
</div>
|
|
@@ -20,6 +20,7 @@ import { Button } from "@/components/ui/button";
|
|
|
20
20
|
import { useFullScreenElement } from "@/components/ui/fullscreen";
|
|
21
21
|
import { Tooltip } from "@/components/ui/tooltip";
|
|
22
22
|
import { outputIsStale } from "@/core/cells/cell";
|
|
23
|
+
import { useCellExecution } from "@/core/executions";
|
|
23
24
|
import type { CellId } from "@/core/cells/ids";
|
|
24
25
|
import type { RuntimeCell } from "@/core/cells/types";
|
|
25
26
|
import type { RevealApi, RevealConfig } from "reveal.js";
|
|
@@ -351,16 +352,19 @@ function resolveSlideContentStyle(
|
|
|
351
352
|
* different scheme than `HTMLCellId`) and its inner `OutputArea` uses
|
|
352
353
|
* `display: contents`, which can't be targeted for background/border styling.
|
|
353
354
|
*/
|
|
354
|
-
export const CellOutputBlock = ({ cell }: { cell: RuntimeCell }) =>
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
355
|
+
export const CellOutputBlock = ({ cell }: { cell: RuntimeCell }) => {
|
|
356
|
+
const execution = useCellExecution(cell.id);
|
|
357
|
+
return (
|
|
358
|
+
<div className="flex flex-col" {...cellDomProps(cell.id, cell.name)}>
|
|
359
|
+
<CellOutputSlide
|
|
360
|
+
cellId={cell.id}
|
|
361
|
+
status={execution.status}
|
|
362
|
+
output={cell.output}
|
|
363
|
+
stale={outputIsStale(execution, cell.staleInputs, false)}
|
|
364
|
+
/>
|
|
365
|
+
</div>
|
|
366
|
+
);
|
|
367
|
+
};
|
|
364
368
|
|
|
365
369
|
const SubslideView = ({
|
|
366
370
|
subslide,
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
} from "@/core/cells/utils";
|
|
24
24
|
import type { CellData, CellRuntimeState } from "@/core/cells/types";
|
|
25
25
|
import type { LanguageAdapterType } from "@/core/codemirror/language/types";
|
|
26
|
+
import { useCellExecution } from "@/core/executions";
|
|
26
27
|
import { connectionAtom } from "@/core/network/connection";
|
|
27
28
|
import { useTheme } from "@/theme/useTheme";
|
|
28
29
|
import { cn } from "@/utils/cn";
|
|
@@ -62,21 +63,19 @@ export const SlideCellView = ({ cell }: { cell: RuntimeCell }) => {
|
|
|
62
63
|
|
|
63
64
|
const cellOutputPosition = userConfig.display.cell_output;
|
|
64
65
|
const hasOutput = cell.output != null;
|
|
66
|
+
const execution = useCellExecution(cell.id);
|
|
67
|
+
const errored = execution.outcome === "error";
|
|
68
|
+
const interrupted = execution.outcome === "interrupted";
|
|
69
|
+
const stopped = execution.outcome === "skipped";
|
|
65
70
|
|
|
66
|
-
const uninstantiated = isUninstantiated(
|
|
67
|
-
executionTime: cell.runElapsedTimeMs ?? cell.lastExecutionTime,
|
|
68
|
-
status: cell.status,
|
|
69
|
-
errored: cell.errored,
|
|
70
|
-
interrupted: cell.interrupted,
|
|
71
|
-
stopped: cell.stopped,
|
|
72
|
-
});
|
|
71
|
+
const uninstantiated = isUninstantiated(execution);
|
|
73
72
|
|
|
74
73
|
const needsRun = cellNeedsRun({
|
|
75
74
|
edited: cell.edited,
|
|
76
|
-
interrupted
|
|
75
|
+
interrupted,
|
|
77
76
|
staleInputs: cell.staleInputs,
|
|
78
77
|
disabled: cell.config.disabled,
|
|
79
|
-
|
|
78
|
+
blocked: execution.blocked,
|
|
80
79
|
});
|
|
81
80
|
|
|
82
81
|
const editorWrapperClassName = cn(
|
|
@@ -85,19 +84,19 @@ export const SlideCellView = ({ cell }: { cell: RuntimeCell }) => {
|
|
|
85
84
|
"interactive",
|
|
86
85
|
cellStatusClasses({
|
|
87
86
|
needsRun,
|
|
88
|
-
errored
|
|
89
|
-
stopped
|
|
87
|
+
errored,
|
|
88
|
+
stopped,
|
|
90
89
|
disabled: cell.config.disabled,
|
|
91
|
-
|
|
90
|
+
blocked: execution.blocked,
|
|
92
91
|
}),
|
|
93
92
|
);
|
|
94
93
|
|
|
95
94
|
const output = (
|
|
96
95
|
<CellOutputSlide
|
|
97
96
|
cellId={cell.id}
|
|
98
|
-
status={
|
|
97
|
+
status={execution.status}
|
|
99
98
|
output={cell.output}
|
|
100
|
-
stale={outputIsStale(cell, false)}
|
|
99
|
+
stale={outputIsStale(execution, cell.staleInputs, false)}
|
|
101
100
|
/>
|
|
102
101
|
);
|
|
103
102
|
|
|
@@ -105,14 +104,14 @@ export const SlideCellView = ({ cell }: { cell: RuntimeCell }) => {
|
|
|
105
104
|
<div className="absolute top-1 right-2 z-10 flex items-center gap-1.5">
|
|
106
105
|
<CellStatusComponent
|
|
107
106
|
editing={true}
|
|
108
|
-
status={
|
|
107
|
+
status={execution.status}
|
|
109
108
|
disabled={cell.config.disabled ?? false}
|
|
110
109
|
staleInputs={cell.staleInputs}
|
|
111
110
|
edited={cell.edited}
|
|
112
|
-
interrupted={
|
|
113
|
-
elapsedTime={
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
interrupted={interrupted}
|
|
112
|
+
elapsedTime={execution.duration}
|
|
113
|
+
startedAt={execution.startedAt}
|
|
114
|
+
blocked={execution.blocked}
|
|
116
115
|
uninstantiated={uninstantiated}
|
|
117
116
|
/>
|
|
118
117
|
<LanguageToggles
|
|
@@ -125,13 +124,17 @@ export const SlideCellView = ({ cell }: { cell: RuntimeCell }) => {
|
|
|
125
124
|
<div className="flex items-center shadow-none gap-1">
|
|
126
125
|
<RunButton
|
|
127
126
|
edited={cell.edited}
|
|
128
|
-
status={
|
|
127
|
+
status={execution.status}
|
|
128
|
+
blocked={execution.blocked}
|
|
129
129
|
needsRun={needsRun}
|
|
130
130
|
connectionState={connection.state}
|
|
131
131
|
config={cell.config}
|
|
132
132
|
onClick={runCell}
|
|
133
133
|
/>
|
|
134
|
-
<StopButton
|
|
134
|
+
<StopButton
|
|
135
|
+
status={execution.status}
|
|
136
|
+
connectionState={connection.state}
|
|
137
|
+
/>
|
|
135
138
|
</div>
|
|
136
139
|
</div>
|
|
137
140
|
);
|
|
@@ -148,7 +151,7 @@ export const SlideCellView = ({ cell }: { cell: RuntimeCell }) => {
|
|
|
148
151
|
id={cell.id}
|
|
149
152
|
code={cell.code}
|
|
150
153
|
config={cell.config}
|
|
151
|
-
status={
|
|
154
|
+
status={execution.status}
|
|
152
155
|
runCell={runCell}
|
|
153
156
|
setEditorView={(ev) => {
|
|
154
157
|
editorViewRef.current = ev;
|
|
@@ -188,15 +191,16 @@ export const SlideCellView = ({ cell }: { cell: RuntimeCell }) => {
|
|
|
188
191
|
export const SlideCellReadOnlyView = ({ cell }: { cell: RuntimeCell }) => {
|
|
189
192
|
const [userConfig] = useUserConfig();
|
|
190
193
|
const cellOutputPosition = userConfig.display.cell_output;
|
|
194
|
+
const execution = useCellExecution(cell.id);
|
|
191
195
|
|
|
192
196
|
const display = useMemo(() => getReadonlyCodeDisplay(cell.code), [cell.code]);
|
|
193
197
|
|
|
194
198
|
const output = (
|
|
195
199
|
<CellOutputSlide
|
|
196
200
|
cellId={cell.id}
|
|
197
|
-
status={
|
|
201
|
+
status={execution.status}
|
|
198
202
|
output={cell.output}
|
|
199
|
-
stale={outputIsStale(cell, false)}
|
|
203
|
+
stale={outputIsStale(execution, cell.staleInputs, false)}
|
|
200
204
|
/>
|
|
201
205
|
);
|
|
202
206
|
|
|
@@ -5,12 +5,11 @@ import { OutputArea } from "../editor/Output";
|
|
|
5
5
|
import { memo } from "react";
|
|
6
6
|
import type { CellId } from "@/core/cells/ids";
|
|
7
7
|
import type { CellRuntimeState } from "@/core/cells/types";
|
|
8
|
+
import type { CellRunStatus } from "@/core/executions";
|
|
8
9
|
|
|
9
|
-
interface SlideContentProps extends Pick<
|
|
10
|
-
CellRuntimeState,
|
|
11
|
-
"output" | "status"
|
|
12
|
-
> {
|
|
10
|
+
interface SlideContentProps extends Pick<CellRuntimeState, "output"> {
|
|
13
11
|
cellId: CellId;
|
|
12
|
+
status: CellRunStatus;
|
|
14
13
|
stale: boolean;
|
|
15
14
|
}
|
|
16
15
|
|