@marimo-team/islands 0.24.3-dev2 → 0.24.3-dev4
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-qIKbwYin.js → ConnectedDataExplorerComponent-C9OF_75w.js} +1 -1
- package/dist/{any-language-editor-CpTnK43-.js → any-language-editor-DmQ7dyCx.js} +1 -1
- package/dist/{chat-ui-DttQ-5Ut.js → chat-ui-DjTMZRVP.js} +1300 -1300
- package/dist/{common-C4UahYwr.js → common-BDlauhCU.js} +6465 -6264
- package/dist/{error-banner-WDhUzJyg.js → error-banner-CsXbEEjo.js} +160 -160
- package/dist/{html-to-image-BTYnN4ev.js → html-to-image-BhNoIBSU.js} +2 -2
- package/dist/main.js +209 -209
- package/dist/{mermaid-BsHdQeQf.js → mermaid-Bi23Ibnw.js} +1 -1
- package/dist/{process-output-CsALk6tp.js → process-output-CpK6fX_C.js} +2 -2
- package/dist/{reveal-component-ChYEzi00.js → reveal-component-BthxSdRc.js} +2 -2
- package/dist/{vega-component-D-IXRnlx.js → vega-component-CPehZbUb.js} +1 -1
- package/package.json +1 -1
- package/src/__mocks__/requests.ts +7 -2
- package/src/components/editor/chrome/panels/__tests__/packages-panel.test.tsx +143 -0
- package/src/components/editor/chrome/panels/packages-panel.tsx +145 -51
- package/src/components/editor/package-alert.tsx +25 -1
- package/src/core/packages/__tests__/useInstallPackage.test.tsx +47 -1
- package/src/core/packages/toast-components.tsx +26 -0
- package/src/core/packages/useInstallPackage.ts +7 -2
- package/src/core/wasm/bridge.ts +1 -0
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
|
+
import { useRestartKernel } from "@/components/editor/actions/useRestartKernel";
|
|
3
4
|
import { Kbd } from "@/components/ui/kbd";
|
|
5
|
+
import { ToastAction } from "@/components/ui/toast";
|
|
4
6
|
import { toast } from "@/components/ui/use-toast";
|
|
5
7
|
|
|
8
|
+
export const RESTART_REQUIRED_DESCRIPTION =
|
|
9
|
+
"Your dependency changes are saved. Restart the kernel to use the updated environment. Restarting clears in-memory variables.";
|
|
10
|
+
|
|
11
|
+
const RestartKernelAction = () => {
|
|
12
|
+
const restartKernel = useRestartKernel();
|
|
13
|
+
return (
|
|
14
|
+
<ToastAction
|
|
15
|
+
altText="Restart the kernel to use the updated dependencies"
|
|
16
|
+
onClick={restartKernel}
|
|
17
|
+
>
|
|
18
|
+
Restart Kernel
|
|
19
|
+
</ToastAction>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const showPackageRestartToast = () => {
|
|
24
|
+
toast({
|
|
25
|
+
title: "Changes saved — restart required",
|
|
26
|
+
description: RESTART_REQUIRED_DESCRIPTION,
|
|
27
|
+
duration: Infinity,
|
|
28
|
+
action: <RestartKernelAction />,
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
6
32
|
export const showAddPackageToast = (
|
|
7
33
|
packageName: string | string[],
|
|
8
34
|
error?: string | null,
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { Logger } from "@/utils/Logger";
|
|
5
5
|
import { useRequestClient } from "../network/requests";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
showAddPackageToast,
|
|
8
|
+
showPackageRestartToast,
|
|
9
|
+
} from "./toast-components";
|
|
7
10
|
|
|
8
11
|
export function useInstallPackages(): {
|
|
9
12
|
handleInstallPackages: (
|
|
@@ -30,7 +33,9 @@ export function useInstallPackages(): {
|
|
|
30
33
|
// response only carries an aggregate success/error. Report a single
|
|
31
34
|
// toast covering all requested packages rather than implying a
|
|
32
35
|
// per-package outcome we don't actually have.
|
|
33
|
-
if (response.
|
|
36
|
+
if (response.restartRequired) {
|
|
37
|
+
showPackageRestartToast();
|
|
38
|
+
} else if (response.success) {
|
|
34
39
|
showAddPackageToast(packages);
|
|
35
40
|
} else {
|
|
36
41
|
showAddPackageToast(packages, response.error);
|