@marimo-team/frontend 0.18.5-dev201 → 0.18.5-dev203
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-Bo1x1B6n.js → CellStatus-CJVmn-JU.js} +1 -1
- package/dist/assets/{JsonOutput-BCHaEg3R.js → JsonOutput-BLd1jTNA.js} +1 -1
- package/dist/assets/{MarimoErrorOutput-BIIhR96K.js → MarimoErrorOutput-Orp0blpZ.js} +2 -2
- package/dist/assets/{RenderHTML-BUhX0rkG.js → RenderHTML-BzGWfPTJ.js} +1 -1
- package/dist/assets/{add-cell-with-ai-CLrEdPGH.js → add-cell-with-ai-Dx5UA23s.js} +1 -1
- package/dist/assets/{add-database-form-DkSxzOXk.js → add-database-form-MNQmbAaT.js} +1 -1
- package/dist/assets/{agent-panel-Bz7HLWO3.js → agent-panel-BS2q53WX.js} +2 -2
- package/dist/assets/{ai-model-dropdown-ea-cOLAL.js → ai-model-dropdown-DZ7evAGU.js} +1 -1
- package/dist/assets/{app-config-button-BFjdAlTt.js → app-config-button-CsABtw-A.js} +1 -1
- package/dist/assets/{cell-editor-B-NH54Cv.js → cell-editor-D4tKLHiP.js} +4 -4
- package/dist/assets/{cell-link-DNVmmRzI.js → cell-link-BoUpLV2S.js} +1 -1
- package/dist/assets/{cells-Dk_j8HX9.js → cells-D_SkyFDn.js} +47 -47
- package/dist/assets/{chat-components-BMWBGknq.js → chat-components-6dWNbFjV.js} +1 -1
- package/dist/assets/{chat-display-CEYX5MXY.js → chat-display-Cfg38gMM.js} +1 -1
- package/dist/assets/{chat-panel-DmUjYxAt.js → chat-panel-CofEklYU.js} +1 -1
- package/dist/assets/{client-D08Rbi3p.js → client-BUus2uot.js} +1 -1
- package/dist/assets/{column-preview-MV5ZRt10.js → column-preview-9nPwQyJZ.js} +1 -1
- package/dist/assets/{command-gUA-HncX.js → command-Qt3ng7cb.js} +1 -1
- package/dist/assets/{command-palette-Dt43cGFk.js → command-palette-ptrGtoIl.js} +1 -1
- package/dist/assets/{common-BWR26KIv.js → common-DE3UmpZO.js} +1 -1
- package/dist/assets/{datasource-i415crE1.js → datasource-CR_zEq5o.js} +1 -1
- package/dist/assets/{dependency-graph-panel-BwaKuCE7.js → dependency-graph-panel-Dy8lj02R.js} +1 -1
- package/dist/assets/{documentation-panel-C4aTmugE.js → documentation-panel-C0769uWv.js} +1 -1
- package/dist/assets/{download-Dsuja3On.js → download-CITws1-y.js} +1 -1
- package/dist/assets/edit-page-Boj4r8n8.js +12 -0
- package/dist/assets/{error-panel-DCozbyWc.js → error-panel-B-EvbVVc.js} +1 -1
- package/dist/assets/{es-DjCjT1hB.js → es-CEEVxHsX.js} +1 -1
- package/dist/assets/{file-explorer-panel-BvRpCXWv.js → file-explorer-panel-BqkMxs-d.js} +1 -1
- package/dist/assets/{floating-outline-DYdnwTX9.js → floating-outline-p0aHdM2W.js} +1 -1
- package/dist/assets/{focus-U1ePwk4d.js → focus-D18AHojc.js} +1 -1
- package/dist/assets/{form-D8BW7hlS.js → form-DEraWoX5.js} +1 -1
- package/dist/assets/{globals-BBskDqJi.js → globals-D3SeIm1j.js} +1 -1
- package/dist/assets/{home-page-c43aYnLs.js → home-page-9rDRaLCP.js} +1 -1
- package/dist/assets/{index-MoQWZ3Gl.js → index-CGfe1Tpd.js} +3 -3
- package/dist/assets/{kiosk-mode-lhqhA8En.js → kiosk-mode-DL9UBacr.js} +1 -1
- package/dist/assets/{layout-DenYhPfS.js → layout-Bd6wzfjT.js} +1 -1
- package/dist/assets/{logs-panel-CmImbuAp.js → logs-panel-C7VsvCHz.js} +1 -1
- package/dist/assets/{markdown-renderer-COkLQ1b5.js → markdown-renderer-C_xfLXiO.js} +1 -1
- package/dist/assets/{mode-BOijHAOc.js → mode-BFwdGSZ7.js} +1 -1
- package/dist/assets/{name-cell-input-Cf2CUXDm.js → name-cell-input-CsDYsdH3.js} +1 -1
- package/dist/assets/{outline-panel-CdaUT0TE.js → outline-panel-BlhMaZpZ.js} +1 -1
- package/dist/assets/{packages-panel-CghFsvM0.js → packages-panel-YNB3ay32.js} +1 -1
- package/dist/assets/{panels-CymS0QU-.js → panels-DfOJ05Sp.js} +1 -1
- package/dist/assets/{process-output-BAfpcew-.js → process-output-4w8xDO0j.js} +1 -1
- package/dist/assets/{readonly-python-code-B8gfuyX1.js → readonly-python-code-DjP4vjBQ.js} +1 -1
- package/dist/assets/{run-page-rr9Ilre7.js → run-page-DRgXZvWr.js} +1 -1
- package/dist/assets/{scratchpad-panel-DWsu0wnU.js → scratchpad-panel-BYCWZWFJ.js} +1 -1
- package/dist/assets/{session-panel-BJRncUge.js → session-panel-C0b1PCJc.js} +1 -1
- package/dist/assets/{snippets-panel-Dv7eGWsB.js → snippets-panel-CpjS6w9M.js} +1 -1
- package/dist/assets/{state-DWEWL_KV.js → state-BTRRCWOH.js} +1 -1
- package/dist/assets/{state-HUtu_wpA.js → state-kFdt1US2.js} +1 -1
- package/dist/assets/{switch-Cd5iA-KH.js → switch-C9iBa4rX.js} +1 -1
- package/dist/assets/{textarea-jTWtOsHe.js → textarea-D2hGxqGj.js} +1 -1
- package/dist/assets/{tracing-CDJRdFd4.js → tracing-CKdq5KMT.js} +1 -1
- package/dist/assets/{tracing-panel-BrBmQCJr.js → tracing-panel-DXjACxb_.js} +2 -2
- package/dist/assets/{types-CiMSegk1.js → types-VzFAm7Cv.js} +1 -1
- package/dist/assets/{useAddCell-FisWjOQO.js → useAddCell-CVfRv5mq.js} +1 -1
- package/dist/assets/{useCellActionButton-DLwn_yx9.js → useCellActionButton-Woqd9LSB.js} +1 -1
- package/dist/assets/{useDeleteCell-CFtiNna2.js → useDeleteCell-GHwc6J4l.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-DWfKzMhf.js → useDependencyPanelTab-B0ZsFCYF.js} +1 -1
- package/dist/assets/{useNotebookActions-B4HR9n-p.js → useNotebookActions-DQW0wwU6.js} +1 -1
- package/dist/assets/{useRunCells-DLQFWY1L.js → useRunCells-BZ_OFvV4.js} +1 -1
- package/dist/assets/{useSplitCell-DDFoE9WM.js → useSplitCell-BnJiHHep.js} +1 -1
- package/dist/assets/{utilities.esm-DlnAwGsz.js → utilities.esm-FYD46c3d.js} +1 -1
- package/dist/index.html +31 -31
- package/package.json +1 -1
- package/src/components/editor/chrome/state.ts +3 -3
- package/src/components/editor/chrome/types.ts +5 -3
- package/src/components/editor/chrome/wrapper/app-chrome.tsx +34 -4
- package/src/components/editor/chrome/wrapper/sidebar.tsx +37 -7
- package/dist/assets/edit-page-DIpr3pNk.js +0 -12
|
@@ -4,13 +4,14 @@ import { useAtom, useAtomValue } from "jotai";
|
|
|
4
4
|
import { MessageCircleQuestionIcon } from "lucide-react";
|
|
5
5
|
import type React from "react";
|
|
6
6
|
import type { PropsWithChildren } from "react";
|
|
7
|
-
import { useMemo } from "react";
|
|
7
|
+
import { useEffect, useMemo } from "react";
|
|
8
8
|
import { ReorderableList } from "@/components/ui/reorderable-list";
|
|
9
9
|
import { Tooltip } from "@/components/ui/tooltip";
|
|
10
10
|
import {
|
|
11
11
|
cellErrorCount,
|
|
12
12
|
notebookQueuedOrRunningCountAtom,
|
|
13
13
|
} from "@/core/cells/cells";
|
|
14
|
+
import { capabilitiesAtom } from "@/core/config/capabilities";
|
|
14
15
|
import { cn } from "@/utils/cn";
|
|
15
16
|
import { FeedbackButton } from "../components/feedback-button";
|
|
16
17
|
import { panelLayoutAtom, useChromeActions, useChromeState } from "../state";
|
|
@@ -22,9 +23,13 @@ import {
|
|
|
22
23
|
} from "../types";
|
|
23
24
|
|
|
24
25
|
export const Sidebar: React.FC = () => {
|
|
25
|
-
const { selectedPanel, selectedDeveloperPanelTab } =
|
|
26
|
-
|
|
26
|
+
const { selectedPanel, selectedDeveloperPanelTab, isSidebarOpen } =
|
|
27
|
+
useChromeState();
|
|
28
|
+
const { toggleApplication, openApplication, setIsSidebarOpen } =
|
|
29
|
+
useChromeActions();
|
|
27
30
|
const [panelLayout, setPanelLayout] = useAtom(panelLayoutAtom);
|
|
31
|
+
// Subscribe to capabilities to re-render when they change
|
|
32
|
+
const capabilities = useAtomValue(capabilitiesAtom);
|
|
28
33
|
|
|
29
34
|
const renderIcon = ({ Icon }: PanelDescriptor, className?: string) => {
|
|
30
35
|
return <Icon className={cn("h-5 w-5", className)} />;
|
|
@@ -35,7 +40,7 @@ export const Sidebar: React.FC = () => {
|
|
|
35
40
|
const availableSidebarPanels = useMemo(() => {
|
|
36
41
|
const devPanelIds = new Set(panelLayout.developerPanel);
|
|
37
42
|
return PANELS.filter((p) => {
|
|
38
|
-
if (isPanelHidden(p)) {
|
|
43
|
+
if (isPanelHidden(p, capabilities)) {
|
|
39
44
|
return false;
|
|
40
45
|
}
|
|
41
46
|
// Exclude panels that are in the developer panel
|
|
@@ -44,15 +49,19 @@ export const Sidebar: React.FC = () => {
|
|
|
44
49
|
}
|
|
45
50
|
return true;
|
|
46
51
|
});
|
|
47
|
-
}, [panelLayout.developerPanel]);
|
|
52
|
+
}, [panelLayout.developerPanel, capabilities]);
|
|
48
53
|
|
|
49
54
|
// Convert current sidebar items to PanelDescriptors
|
|
55
|
+
// Filter out hidden panels (e.g., when capability is not available)
|
|
50
56
|
const sidebarItems = useMemo(() => {
|
|
51
57
|
return panelLayout.sidebar.flatMap((id) => {
|
|
52
58
|
const panel = PANEL_MAP.get(id);
|
|
53
|
-
|
|
59
|
+
if (!panel || isPanelHidden(panel, capabilities)) {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
return [panel];
|
|
54
63
|
});
|
|
55
|
-
}, [panelLayout.sidebar]);
|
|
64
|
+
}, [panelLayout.sidebar, capabilities]);
|
|
56
65
|
|
|
57
66
|
const handleSetSidebarItems = (items: PanelDescriptor[]) => {
|
|
58
67
|
setPanelLayout((prev) => ({
|
|
@@ -84,6 +93,27 @@ export const Sidebar: React.FC = () => {
|
|
|
84
93
|
toggleApplication(item.type);
|
|
85
94
|
};
|
|
86
95
|
|
|
96
|
+
// Auto-correct sidebar selection when the selected panel is no longer available
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (!isSidebarOpen) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const isSelectionValid = sidebarItems.some((p) => p.type === selectedPanel);
|
|
102
|
+
if (!isSelectionValid) {
|
|
103
|
+
if (sidebarItems.length > 0) {
|
|
104
|
+
openApplication(sidebarItems[0].type);
|
|
105
|
+
} else {
|
|
106
|
+
setIsSidebarOpen(false);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}, [
|
|
110
|
+
isSidebarOpen,
|
|
111
|
+
sidebarItems,
|
|
112
|
+
selectedPanel,
|
|
113
|
+
openApplication,
|
|
114
|
+
setIsSidebarOpen,
|
|
115
|
+
]);
|
|
116
|
+
|
|
87
117
|
return (
|
|
88
118
|
<div className="h-full pt-4 pb-1 px-1 flex flex-col items-start text-muted-foreground text-md select-none no-print text-sm z-50 dark:bg-background print:hidden hide-on-fullscreen">
|
|
89
119
|
<ReorderableList<PanelDescriptor>
|