@marimo-team/frontend 0.18.5-dev184 → 0.18.5-dev187
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-DqLx71xI.js → CellStatus-Bo1x1B6n.js} +1 -1
- package/dist/assets/{JsonOutput-3u2O9mUd.js → JsonOutput-BCHaEg3R.js} +1 -1
- package/dist/assets/MarimoErrorOutput-BIIhR96K.js +7 -0
- package/dist/assets/{RenderHTML-Dp8s4Bzr.js → RenderHTML-BUhX0rkG.js} +1 -1
- package/dist/assets/{add-cell-with-ai-DTIq0l6h.js → add-cell-with-ai-CLrEdPGH.js} +1 -1
- package/dist/assets/{add-database-form-C20ZnUUx.js → add-database-form-DkSxzOXk.js} +1 -1
- package/dist/assets/{agent-panel-D08HI0-X.js → agent-panel-Bz7HLWO3.js} +2 -2
- package/dist/assets/{ai-model-dropdown-CK5sei5N.js → ai-model-dropdown-ea-cOLAL.js} +1 -1
- package/dist/assets/{app-config-button-Ce5Tkr5O.js → app-config-button-BFjdAlTt.js} +1 -1
- package/dist/assets/{cell-link-B7EjqLUL.js → cell-link-DNVmmRzI.js} +1 -1
- package/dist/assets/{cells-BLhvmrVl.js → cells-Dk_j8HX9.js} +50 -50
- package/dist/assets/{chat-components-DHkUyXWV.js → chat-components-BMWBGknq.js} +1 -1
- package/dist/assets/{chat-display-DZMIiHZy.js → chat-display-CEYX5MXY.js} +1 -1
- package/dist/assets/{chat-panel-Bm-_lPiR.js → chat-panel-DmUjYxAt.js} +1 -1
- package/dist/assets/{client-hHcgVFo7.js → client-D08Rbi3p.js} +1 -1
- package/dist/assets/{column-preview-B1AyyIgE.js → column-preview-Cqovvoyb.js} +1 -1
- package/dist/assets/{command-CDWT71Ts.js → command-gUA-HncX.js} +1 -1
- package/dist/assets/{command-palette-BcPZK2Wg.js → command-palette-Dt43cGFk.js} +1 -1
- package/dist/assets/{common-4ZdFNk6L.js → common-BWR26KIv.js} +1 -1
- package/dist/assets/{datasource-DNy_uzDr.js → datasource-i415crE1.js} +1 -1
- package/dist/assets/dependency-graph-panel-BwaKuCE7.js +4 -0
- package/dist/assets/{documentation-panel-BRHbbFlV.js → documentation-panel-C4aTmugE.js} +1 -1
- package/dist/assets/{download-DPiYP-j0.js → download-Dsuja3On.js} +1 -1
- package/dist/assets/edit-page-sCQCmucY.js +12 -0
- package/dist/assets/{error-panel-qGIXpWqc.js → error-panel-DCozbyWc.js} +1 -1
- package/dist/assets/{es-CR1H2K7u.js → es-DjCjT1hB.js} +1 -1
- package/dist/assets/{file-explorer-panel-DdOLBo1H.js → file-explorer-panel-BvRpCXWv.js} +1 -1
- package/dist/assets/{floating-outline-foC3RCPc.js → floating-outline-DYdnwTX9.js} +1 -1
- package/dist/assets/{focus-CgHW_IRL.js → focus-U1ePwk4d.js} +1 -1
- package/dist/assets/{form-NWifpNWT.js → form-D8BW7hlS.js} +1 -1
- package/dist/assets/{globals-CiRTn5Vt.js → globals-BBskDqJi.js} +1 -1
- package/dist/assets/{home-page-WElJkZm5.js → home-page-c43aYnLs.js} +1 -1
- package/dist/assets/index-BIeqDcea.css +2 -0
- package/dist/assets/{index-3FOfqUYt.js → index-DuCNx6yI.js} +3 -3
- package/dist/assets/{kiosk-mode-vS4t3di8.js → kiosk-mode-C23fjW_G.js} +1 -1
- package/dist/assets/{layout-D1qNIXxE.js → layout-DenYhPfS.js} +1 -1
- package/dist/assets/{logs-panel-BUqhCH8r.js → logs-panel-CmImbuAp.js} +1 -1
- package/dist/assets/{markdown-renderer-DgV_KnEf.js → markdown-renderer-COkLQ1b5.js} +1 -1
- package/dist/assets/{mode-BeOhz3YE.js → mode-BOijHAOc.js} +1 -1
- package/dist/assets/{name-cell-input-lVGcUDBb.js → name-cell-input-Cf2CUXDm.js} +1 -1
- package/dist/assets/{outline-panel-DHLUaY4X.js → outline-panel-CdaUT0TE.js} +1 -1
- package/dist/assets/{packages-panel-DhVyvWkj.js → packages-panel-CghFsvM0.js} +1 -1
- package/dist/assets/{panel-context-B3nGD1_W.js → panel-context-DUUPei-R.js} +1 -1
- package/dist/assets/{panels-BMfGXS7h.js → panels-CymS0QU-.js} +1 -1
- package/dist/assets/{process-output-C2mignv4.js → process-output-BAfpcew-.js} +1 -1
- package/dist/assets/{readonly-python-code-C3URGhHv.js → readonly-python-code-B8gfuyX1.js} +1 -1
- package/dist/assets/{run-page-BqTaOWHL.js → run-page-rr9Ilre7.js} +1 -1
- package/dist/assets/{scratchpad-panel-5FCgSkW8.js → scratchpad-panel-fzQUjA3o.js} +1 -1
- package/dist/assets/{session-panel-6od-_OeM.js → session-panel-BsMBi24k.js} +1 -1
- package/dist/assets/{snippets-panel-CAAC62vz.js → snippets-panel-DW6lWuPh.js} +1 -1
- package/dist/assets/{state-CGIjjAWG.js → state-DWEWL_KV.js} +1 -1
- package/dist/assets/{state-CoslvOiH.js → state-HUtu_wpA.js} +1 -1
- package/dist/assets/{switch-BLEwkiUl.js → switch-Cd5iA-KH.js} +1 -1
- package/dist/assets/{textarea-S24k5l8r.js → textarea-jTWtOsHe.js} +1 -1
- package/dist/assets/{tracing-Cl31yJ-W.js → tracing-CDJRdFd4.js} +1 -1
- package/dist/assets/{tracing-panel-Cw103_Tm.js → tracing-panel-BrBmQCJr.js} +2 -2
- package/dist/assets/{types-DiksLxkJ.js → types-CiMSegk1.js} +1 -1
- package/dist/assets/{useAddCell-DGhb_PpU.js → useAddCell-FisWjOQO.js} +1 -1
- package/dist/assets/{useCellActionButton-COxDEyF8.js → useCellActionButton-DLwn_yx9.js} +1 -1
- package/dist/assets/{useDeleteCell-BVWdwuvc.js → useDeleteCell-CFtiNna2.js} +1 -1
- package/dist/assets/useDependencyPanelTab-DWfKzMhf.js +1 -0
- package/dist/assets/{useNotebookActions-BeEH92nn.js → useNotebookActions-B4HR9n-p.js} +1 -1
- package/dist/assets/{useRunCells-Buew9vMX.js → useRunCells-DLQFWY1L.js} +1 -1
- package/dist/assets/{useSplitCell-LsoCeBEb.js → useSplitCell-DDFoE9WM.js} +1 -1
- package/dist/assets/{utilities.esm-BAGxBLhu.js → utilities.esm-DlnAwGsz.js} +1 -1
- package/dist/index.html +32 -32
- package/package.json +1 -1
- package/src/components/dependency-graph/dependency-graph.tsx +5 -22
- package/src/components/{editor/chrome/wrapper/minimap.tsx → dependency-graph/minimap-content.tsx} +49 -76
- package/src/components/dependency-graph/panels.tsx +4 -15
- package/src/components/dependency-graph/types.ts +0 -1
- package/src/components/editor/chrome/panels/dependency-graph-panel.tsx +12 -5
- package/src/components/editor/chrome/state.ts +62 -24
- package/src/components/editor/chrome/wrapper/app-chrome.tsx +36 -11
- package/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx +1 -1
- package/src/components/editor/chrome/wrapper/footer.tsx +9 -4
- package/src/components/editor/chrome/wrapper/minimap-state.ts +0 -2
- package/src/components/editor/chrome/wrapper/sidebar.tsx +2 -3
- package/src/components/editor/chrome/wrapper/useDependencyPanelTab.ts +16 -0
- package/src/components/editor/output/MarimoErrorOutput.tsx +2 -2
- package/src/components/terminal/hooks.ts +2 -2
- package/dist/assets/MarimoErrorOutput-HLzwepOd.js +0 -7
- package/dist/assets/cell-actions-By11JcES.js +0 -1
- package/dist/assets/dependency-graph-panel-Xl6gHQbe.js +0 -4
- package/dist/assets/edit-page-Dkay6iPX.js +0 -13
- package/dist/assets/index-G6ss-VDT.css +0 -2
- package/src/components/dependency-graph/dependency-graph-minimap.tsx +0 -197
- package/src/components/editor/chrome/wrapper/footer-items/minimap-status.tsx +0 -21
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
-
|
|
3
|
-
import type { Atom } from "jotai";
|
|
4
|
-
|
|
5
|
-
import React, {
|
|
6
|
-
type PropsWithChildren,
|
|
7
|
-
useEffect,
|
|
8
|
-
useMemo,
|
|
9
|
-
useRef,
|
|
10
|
-
useState,
|
|
11
|
-
} from "react";
|
|
12
|
-
import useEvent from "react-use-event-hook";
|
|
13
|
-
import ReactFlow, {
|
|
14
|
-
type CoordinateExtent,
|
|
15
|
-
type Edge,
|
|
16
|
-
type Node,
|
|
17
|
-
PanOnScrollMode,
|
|
18
|
-
useEdgesState,
|
|
19
|
-
useNodesState,
|
|
20
|
-
useStore,
|
|
21
|
-
} from "reactflow";
|
|
22
|
-
import { nodeTypes } from "@/components/dependency-graph/custom-node";
|
|
23
|
-
import type { CellId } from "@/core/cells/ids";
|
|
24
|
-
import type { CellData } from "@/core/cells/types";
|
|
25
|
-
import type { Variables } from "@/core/variables/types";
|
|
26
|
-
import { scrollAndHighlightCell } from "../editor/links/cell-link";
|
|
27
|
-
import { type NodeData, VerticalElementsBuilder } from "./elements";
|
|
28
|
-
import { GraphSelectionPanel } from "./panels";
|
|
29
|
-
import { useFitToViewOnDimensionChange } from "./utils/useFitToViewOnDimensionChange";
|
|
30
|
-
|
|
31
|
-
interface Props {
|
|
32
|
-
cellIds: CellId[];
|
|
33
|
-
variables: Variables;
|
|
34
|
-
cellAtoms: Atom<CellData>[];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const elementsBuilder = new VerticalElementsBuilder();
|
|
38
|
-
|
|
39
|
-
export const DependencyGraphMinimap: React.FC<PropsWithChildren<Props>> = ({
|
|
40
|
-
cellIds,
|
|
41
|
-
variables,
|
|
42
|
-
cellAtoms,
|
|
43
|
-
children,
|
|
44
|
-
}) => {
|
|
45
|
-
// State
|
|
46
|
-
const { nodes: initialNodes, edges: allEdges } =
|
|
47
|
-
elementsBuilder.createElements(cellIds, cellAtoms, variables, false);
|
|
48
|
-
const [edges, setEdges] = useEdgesState([]);
|
|
49
|
-
const [nodes, setNodes] = useNodesState(initialNodes);
|
|
50
|
-
const [selectedNodeId, setSelectedNodeId] = useState<CellId>();
|
|
51
|
-
const [selectedEdge, setSelectedEdge] = useState<Edge>();
|
|
52
|
-
const hasRenderer = useRef(false);
|
|
53
|
-
|
|
54
|
-
// Subscriptions
|
|
55
|
-
useFitToViewOnDimensionChange();
|
|
56
|
-
const height = useStore(({ height }) => height);
|
|
57
|
-
|
|
58
|
-
// If the cellIds change, update the nodes.
|
|
59
|
-
const syncChanges = useEvent(
|
|
60
|
-
(elements: { nodes: Node<NodeData>[]; edges: Edge[] }) => {
|
|
61
|
-
setNodes(elements.nodes);
|
|
62
|
-
setEdges([]);
|
|
63
|
-
},
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
// If the cellIds change, update the nodes.
|
|
67
|
-
// Only on the second render, because the first render is the initial render.
|
|
68
|
-
useEffect(() => {
|
|
69
|
-
if (!hasRenderer.current) {
|
|
70
|
-
hasRenderer.current = true;
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
syncChanges(
|
|
74
|
-
elementsBuilder.createElements(cellIds, cellAtoms, variables, false),
|
|
75
|
-
);
|
|
76
|
-
}, [cellIds, variables, cellAtoms, syncChanges]);
|
|
77
|
-
|
|
78
|
-
// If the selected node changes, update the edges.
|
|
79
|
-
useEffect(() => {
|
|
80
|
-
if (selectedNodeId) {
|
|
81
|
-
const selectedEdges = allEdges.filter((edge) => {
|
|
82
|
-
const { source, target, data } = edge;
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
(source === selectedNodeId && data.direction === "outputs") ||
|
|
86
|
-
(target === selectedNodeId && data.direction === "inputs")
|
|
87
|
-
);
|
|
88
|
-
});
|
|
89
|
-
setEdges(selectedEdges);
|
|
90
|
-
}
|
|
91
|
-
}, [selectedNodeId, setEdges, allEdges]);
|
|
92
|
-
|
|
93
|
-
const translateExtent = useTranslateExtent(nodes, height);
|
|
94
|
-
|
|
95
|
-
const handleClearSelection = () => {
|
|
96
|
-
setSelectedNodeId(undefined);
|
|
97
|
-
setSelectedEdge(undefined);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const renderGraphSelectionPanel = () => {
|
|
101
|
-
if (selectedEdge) {
|
|
102
|
-
return (
|
|
103
|
-
<GraphSelectionPanel
|
|
104
|
-
selection={{
|
|
105
|
-
type: "edge",
|
|
106
|
-
source: selectedEdge.source as CellId,
|
|
107
|
-
target: selectedEdge.target as CellId,
|
|
108
|
-
}}
|
|
109
|
-
onClearSelection={handleClearSelection}
|
|
110
|
-
variables={variables}
|
|
111
|
-
edges={edges}
|
|
112
|
-
/>
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
if (selectedNodeId) {
|
|
116
|
-
return (
|
|
117
|
-
<GraphSelectionPanel
|
|
118
|
-
selection={{ type: "node", id: selectedNodeId }}
|
|
119
|
-
variables={variables}
|
|
120
|
-
edges={edges}
|
|
121
|
-
onClearSelection={handleClearSelection}
|
|
122
|
-
/>
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return null;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
return (
|
|
130
|
-
<ReactFlow
|
|
131
|
-
nodes={nodes}
|
|
132
|
-
edges={edges}
|
|
133
|
-
nodeTypes={nodeTypes}
|
|
134
|
-
translateExtent={translateExtent}
|
|
135
|
-
onNodeClick={(_event, node) => {
|
|
136
|
-
const id = node.id;
|
|
137
|
-
setSelectedNodeId(id as CellId);
|
|
138
|
-
setSelectedEdge(undefined);
|
|
139
|
-
setEdges([]);
|
|
140
|
-
}}
|
|
141
|
-
onNodeDoubleClick={(_event, node) => {
|
|
142
|
-
scrollAndHighlightCell(node.id as CellId, "focus");
|
|
143
|
-
}}
|
|
144
|
-
onEdgeClick={(_event, edge) => {
|
|
145
|
-
setSelectedEdge(edge);
|
|
146
|
-
}}
|
|
147
|
-
// On
|
|
148
|
-
snapToGrid={true}
|
|
149
|
-
fitView={true}
|
|
150
|
-
elementsSelectable={true}
|
|
151
|
-
// Off
|
|
152
|
-
minZoom={1}
|
|
153
|
-
maxZoom={1}
|
|
154
|
-
draggable={false}
|
|
155
|
-
panOnScrollMode={PanOnScrollMode.Vertical}
|
|
156
|
-
zoomOnDoubleClick={false}
|
|
157
|
-
nodesDraggable={false}
|
|
158
|
-
nodesConnectable={false}
|
|
159
|
-
nodesFocusable={false}
|
|
160
|
-
edgesFocusable={false}
|
|
161
|
-
selectNodesOnDrag={false}
|
|
162
|
-
panOnDrag={false}
|
|
163
|
-
preventScrolling={false}
|
|
164
|
-
zoomOnPinch={false}
|
|
165
|
-
panOnScroll={true}
|
|
166
|
-
autoPanOnNodeDrag={false}
|
|
167
|
-
autoPanOnConnect={false}
|
|
168
|
-
>
|
|
169
|
-
{renderGraphSelectionPanel()}
|
|
170
|
-
{children}
|
|
171
|
-
</ReactFlow>
|
|
172
|
-
);
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
// Limit the extent of the graph to just the visible nodes.
|
|
176
|
-
// The top node and bottom node can be scrolled to the middle of the graph.
|
|
177
|
-
function useTranslateExtent(nodes: Node[], height: number): CoordinateExtent {
|
|
178
|
-
const PADDING_Y = 10;
|
|
179
|
-
|
|
180
|
-
return useMemo<CoordinateExtent>(() => {
|
|
181
|
-
const top = nodes.reduce(
|
|
182
|
-
(top, { position }) => Math.min(top, position.y - height / 2 - PADDING_Y),
|
|
183
|
-
Number.POSITIVE_INFINITY,
|
|
184
|
-
);
|
|
185
|
-
|
|
186
|
-
const bottom = nodes.reduce(
|
|
187
|
-
(bottom, { position }) =>
|
|
188
|
-
Math.max(bottom, position.y + height / 2 + PADDING_Y),
|
|
189
|
-
Number.NEGATIVE_INFINITY,
|
|
190
|
-
);
|
|
191
|
-
|
|
192
|
-
return [
|
|
193
|
-
[Number.NEGATIVE_INFINITY, top],
|
|
194
|
-
[Number.POSITIVE_INFINITY, bottom],
|
|
195
|
-
];
|
|
196
|
-
}, [nodes, height]);
|
|
197
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { useAtom } from "jotai";
|
|
4
|
-
import { MapIcon } from "lucide-react";
|
|
5
|
-
import { FooterItem } from "../footer-item";
|
|
6
|
-
import { minimapOpenAtom } from "../minimap-state";
|
|
7
|
-
|
|
8
|
-
export const MinimapStatusIcon: React.FC = () => {
|
|
9
|
-
const [open, setOpen] = useAtom(minimapOpenAtom);
|
|
10
|
-
|
|
11
|
-
return (
|
|
12
|
-
<FooterItem
|
|
13
|
-
tooltip="Toggle Minimap"
|
|
14
|
-
selected={open}
|
|
15
|
-
onClick={() => setOpen((prev) => !prev)}
|
|
16
|
-
data-testid="footer-minimap"
|
|
17
|
-
>
|
|
18
|
-
<MapIcon className="h-4 w-4" />
|
|
19
|
-
</FooterItem>
|
|
20
|
-
);
|
|
21
|
-
};
|