@marimo-team/islands 0.18.5-dev202 → 0.19.0
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/main.js
CHANGED
|
@@ -101068,7 +101068,7 @@ Defaulting to \`null\`.`;
|
|
|
101068
101068
|
return Logger.warn("Failed to get version from mount config"), null;
|
|
101069
101069
|
}
|
|
101070
101070
|
}
|
|
101071
|
-
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.
|
|
101071
|
+
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.19.0"), showCodeInRunModeAtom = atom(true);
|
|
101072
101072
|
atom(null);
|
|
101073
101073
|
var VIRTUAL_FILE_REGEX = /\/@file\/([^\s"&'/]+)\.([\dA-Za-z]+)/g, VirtualFileTracker = class e {
|
|
101074
101074
|
constructor() {
|
package/package.json
CHANGED
|
@@ -193,6 +193,29 @@ export const AppChrome: React.FC<PropsWithChildren> = ({ children }) => {
|
|
|
193
193
|
});
|
|
194
194
|
}, [isDeveloperPanelOpen]);
|
|
195
195
|
|
|
196
|
+
// Auto-correct developer panel selection when the selected tab is no longer available
|
|
197
|
+
useEffect(() => {
|
|
198
|
+
if (!isDeveloperPanelOpen) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
const isSelectionValid = devPanelItems.some(
|
|
202
|
+
(p) => p.type === selectedDeveloperPanelTab,
|
|
203
|
+
);
|
|
204
|
+
if (!isSelectionValid) {
|
|
205
|
+
if (devPanelItems.length > 0) {
|
|
206
|
+
openApplication(devPanelItems[0].type);
|
|
207
|
+
} else {
|
|
208
|
+
setIsDeveloperPanelOpen(false);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}, [
|
|
212
|
+
isDeveloperPanelOpen,
|
|
213
|
+
devPanelItems,
|
|
214
|
+
selectedDeveloperPanelTab,
|
|
215
|
+
openApplication,
|
|
216
|
+
setIsDeveloperPanelOpen,
|
|
217
|
+
]);
|
|
218
|
+
|
|
196
219
|
const appBodyPanel = (
|
|
197
220
|
<Panel id="app" key="app" className="relative h-full">
|
|
198
221
|
<Suspense>{children}</Suspense>
|
|
@@ -4,7 +4,7 @@ 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 {
|
|
@@ -23,8 +23,10 @@ import {
|
|
|
23
23
|
} from "../types";
|
|
24
24
|
|
|
25
25
|
export const Sidebar: React.FC = () => {
|
|
26
|
-
const { selectedPanel, selectedDeveloperPanelTab } =
|
|
27
|
-
|
|
26
|
+
const { selectedPanel, selectedDeveloperPanelTab, isSidebarOpen } =
|
|
27
|
+
useChromeState();
|
|
28
|
+
const { toggleApplication, openApplication, setIsSidebarOpen } =
|
|
29
|
+
useChromeActions();
|
|
28
30
|
const [panelLayout, setPanelLayout] = useAtom(panelLayoutAtom);
|
|
29
31
|
// Subscribe to capabilities to re-render when they change
|
|
30
32
|
const capabilities = useAtomValue(capabilitiesAtom);
|
|
@@ -91,6 +93,27 @@ export const Sidebar: React.FC = () => {
|
|
|
91
93
|
toggleApplication(item.type);
|
|
92
94
|
};
|
|
93
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
|
+
|
|
94
117
|
return (
|
|
95
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">
|
|
96
119
|
<ReorderableList<PanelDescriptor>
|