@marimo-team/islands 0.23.10-dev4 → 0.23.10-dev7

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.
Files changed (25) hide show
  1. package/dist/{any-language-editor-DfdpyDv_.js → any-language-editor-CiES2a2h.js} +2 -2
  2. package/dist/{chat-ui-TL2w0gQI.js → chat-ui-K84W5ecY.js} +5 -5
  3. package/dist/{code-visibility-Dly0oW20.js → code-visibility-WES7G1ix.js} +1036 -882
  4. package/dist/{copy-BuQpJEzp.js → copy-5jQ_kGE1.js} +32 -32
  5. package/dist/{esm-BfhQmZjp.js → esm-CCuYCd3R.js} +1 -1
  6. package/dist/{extends-BgdxCfYu.js → extends-CkydH1Q5.js} +1 -1
  7. package/dist/{glide-data-editor-BOmK9ETQ.js → glide-data-editor-CgIxTzAP.js} +1 -1
  8. package/dist/{html-to-image-DS-GYb0Y.js → html-to-image-B93KtAVY.js} +4 -4
  9. package/dist/main.js +9 -9
  10. package/dist/{process-output-BdlB3Vhy.js → process-output-BOXi9fnS.js} +1 -1
  11. package/dist/{reveal-component-Dj7ybE5_.js → reveal-component-DRTYmMER.js} +2 -2
  12. package/package.json +1 -1
  13. package/src/components/data-table/__tests__/data-table.test.tsx +154 -12
  14. package/src/components/data-table/hover-tooltip/__tests__/content.test.ts +60 -0
  15. package/src/components/data-table/hover-tooltip/content.ts +44 -0
  16. package/src/components/data-table/hover-tooltip/hover-tooltip.tsx +55 -0
  17. package/src/components/data-table/hover-tooltip/use-table-hover-tooltip.ts +159 -0
  18. package/src/components/data-table/renderers.tsx +27 -43
  19. package/src/components/ui/__tests__/use-toast.test.ts +75 -0
  20. package/src/components/ui/use-toast.ts +33 -13
  21. package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +0 -28
  22. package/src/core/cells/__tests__/cell.test.ts +29 -2
  23. package/src/core/cells/cell.ts +5 -1
  24. package/src/core/network/__tests__/requests-static.test.ts +30 -0
  25. package/src/core/network/requests-static.ts +14 -10
@@ -1,9 +1,10 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
  import { describe, expect, it } from "vitest";
3
- import type { OutputMessage } from "@/core/kernel/messages";
3
+ import type { CellMessage, OutputMessage } from "@/core/kernel/messages";
4
4
  import type { RuntimeState } from "@/core/network/types";
5
5
  import type { Seconds } from "@/utils/time";
6
- import { outputIsLoading, outputIsStale } from "../cell";
6
+ import { outputIsLoading, outputIsStale, transitionCell } from "../cell";
7
+ import { createCellRuntimeState } from "../types";
7
8
 
8
9
  const STATUSES: RuntimeState[] = [
9
10
  "queued",
@@ -191,3 +192,29 @@ describe("outputIsStale", () => {
191
192
  expect(outputIsStale(cell, edited)).toBe(false);
192
193
  });
193
194
  });
195
+
196
+ describe("transitionCell serialization", () => {
197
+ function cellMessage(serialization?: string | null): CellMessage {
198
+ return {
199
+ cell_id: "cell-1",
200
+ ...(serialization === undefined ? {} : { serialization }),
201
+ } as CellMessage;
202
+ }
203
+
204
+ it("leaves the hint unchanged when serialization is omitted", () => {
205
+ const cell = createCellRuntimeState({ serialization: "Valid" });
206
+ expect(transitionCell(cell, cellMessage()).serialization).toBe("Valid");
207
+ });
208
+
209
+ it("clears the hint when serialization is null", () => {
210
+ const cell = createCellRuntimeState({ serialization: "Valid" });
211
+ expect(transitionCell(cell, cellMessage(null)).serialization).toBeNull();
212
+ });
213
+
214
+ it("sets the hint when serialization is a string", () => {
215
+ const cell = createCellRuntimeState();
216
+ expect(transitionCell(cell, cellMessage("Valid")).serialization).toBe(
217
+ "Valid",
218
+ );
219
+ });
220
+ });
@@ -73,7 +73,11 @@ export function transitionCell(
73
73
  nextCell.output = message.output ?? nextCell.output;
74
74
  nextCell.staleInputs = message.stale_inputs ?? nextCell.staleInputs;
75
75
  nextCell.status = message.status ?? nextCell.status;
76
- nextCell.serialization = message.serialization;
76
+ // Tri-state partial update: an omitted field (undefined) leaves the hint
77
+ // unchanged; null explicitly clears it; a string sets it.
78
+ if (message.serialization !== undefined) {
79
+ nextCell.serialization = message.serialization;
80
+ }
77
81
 
78
82
  let didInterruptFromThisMessage = false;
79
83
 
@@ -0,0 +1,30 @@
1
+ /* Copyright 2026 Marimo. All rights reserved. */
2
+ import { beforeEach, describe, expect, it, vi } from "vitest";
3
+ import { toast } from "@/components/ui/use-toast";
4
+ import { createStaticRequests } from "../requests-static";
5
+
6
+ vi.mock("@/components/ui/use-toast", () => ({ toast: vi.fn() }));
7
+
8
+ describe("createStaticRequests static-notebook toast", () => {
9
+ beforeEach(() => {
10
+ vi.mocked(toast).mockClear();
11
+ });
12
+
13
+ it("requests a once-toast with a stable id on component value updates", async () => {
14
+ const requests = createStaticRequests();
15
+ await requests.sendComponentValues({} as never);
16
+
17
+ expect(toast).toHaveBeenCalledWith(
18
+ expect.objectContaining({ id: "static-notebook", once: true }),
19
+ );
20
+ });
21
+
22
+ it("uses the same once-toast for function requests", async () => {
23
+ const requests = createStaticRequests();
24
+ await requests.sendFunctionRequest({} as never);
25
+
26
+ expect(toast).toHaveBeenCalledWith(
27
+ expect.objectContaining({ id: "static-notebook", once: true }),
28
+ );
29
+ });
30
+ });
@@ -3,6 +3,18 @@ import { toast } from "@/components/ui/use-toast";
3
3
  import { Logger } from "@/utils/Logger";
4
4
  import type { EditRequests, RunRequests } from "./types";
5
5
 
6
+ const STATIC_NOTEBOOK_TOAST_ID = "static-notebook";
7
+
8
+ function showStaticNotebookToast() {
9
+ toast({
10
+ id: STATIC_NOTEBOOK_TOAST_ID,
11
+ once: true,
12
+ title: "Static notebook",
13
+ description:
14
+ "This notebook is not connected to a kernel. Any interactive elements will not work.",
15
+ });
16
+ }
17
+
6
18
  export function createStaticRequests(): EditRequests & RunRequests {
7
19
  const throwNotInEditMode = () => {
8
20
  throw new Error("Unreachable. Expected to be in run mode");
@@ -10,11 +22,7 @@ export function createStaticRequests(): EditRequests & RunRequests {
10
22
 
11
23
  return {
12
24
  sendComponentValues: async () => {
13
- toast({
14
- title: "Static notebook",
15
- description:
16
- "This notebook is not connected to a kernel. Any interactive elements will not work.",
17
- });
25
+ showStaticNotebookToast();
18
26
  Logger.log("Updating UI elements is not supported in static mode");
19
27
  return null;
20
28
  },
@@ -27,11 +35,7 @@ export function createStaticRequests(): EditRequests & RunRequests {
27
35
  return null;
28
36
  },
29
37
  sendFunctionRequest: async () => {
30
- toast({
31
- title: "Static notebook",
32
- description:
33
- "This notebook is not connected to a kernel. Any interactive elements will not work.",
34
- });
38
+ showStaticNotebookToast();
35
39
  Logger.log("Function requests are not supported in static mode");
36
40
  return null;
37
41
  },