@marimo-team/islands 0.23.15-dev33 → 0.23.15-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-7p7rt9iw.js → ConnectedDataExplorerComponent-CU4fZJzG.js} +4 -4
- package/dist/{ErrorBoundary-B_CAG7_e.js → ErrorBoundary-DE6tzZf-.js} +1 -1
- package/dist/{ImageComparisonComponent-1i5IBhon.js → ImageComparisonComponent-CHrI72em.js} +129 -173
- package/dist/assets/__vite-browser-external-BQCLNwri.js +1 -0
- package/dist/assets/worker-DAWRHcPq.js +73 -0
- package/dist/{chat-ui-C0wkSwxB.js → chat-ui-DinOvbWu.js} +3111 -3111
- package/dist/{code-visibility-BI94mK4u.js → code-visibility-Dk8cVOny.js} +864 -946
- package/dist/{debounce-BOD3DbfP.js → constants-T20xxyNf.js} +24 -1
- package/dist/{formats-BX3uDQbB.js → formats-Dzx4J_z1.js} +1 -1
- package/dist/{glide-data-editor-CwZz71BD.js → glide-data-editor-CjTu7ukN.js} +3 -3
- package/dist/{html-to-image-D8Q5SLSJ.js → html-to-image-_wGfk8V-.js} +2241 -2277
- package/dist/{input-BGPrFH3g.js → input-DtsN7xm-.js} +2 -2
- package/dist/main.js +1201 -1297
- package/dist/{mermaid-UdmxG2PZ.js → mermaid-BYqXy_NE.js} +2 -2
- package/dist/{process-output-C_A12w9J.js → process-output-Mh4UrjwM.js} +1 -1
- package/dist/{reveal-component-ELidGmPF.js → reveal-component-B5DXLyO7.js} +605 -618
- package/dist/{spec-DSs9v0xx.js → spec-Cz-Bj1JI.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{toDate-CKpRx4TS.js → toDate-CWNNlFEX.js} +4 -3
- package/dist/{useAsyncData-BSOyAbac.js → useAsyncData-KfHB8wQR.js} +1 -1
- package/dist/{useDeepCompareMemoize-BTLeWzuR.js → useDeepCompareMemoize-nJMtxhm4.js} +1 -1
- package/dist/{useLifecycle-C6wHjkhW.js → useLifecycle-DegSo0lV.js} +1 -1
- package/dist/{useTheme-Df_vGflw.js → useTheme-6eZ3GOTS.js} +27 -62
- package/dist/{vega-component-DNHEV0u0.js → vega-component-DzyyM9fc.js} +6 -6
- package/package.json +1 -1
- package/src/components/chat/__tests__/chat-utils.test.ts +1 -244
- package/src/components/chat/chat-panel.tsx +67 -196
- package/src/components/chat/chat-utils.ts +2 -111
- package/src/components/editor/SortableCell.tsx +2 -6
- package/src/components/editor/actions/pair-with-agent-modal.tsx +64 -20
- package/src/components/editor/ai/add-cell-with-ai.tsx +5 -14
- package/src/components/editor/ai/ai-completion-editor.tsx +1 -4
- package/src/components/editor/cell/cell-context-menu.tsx +0 -7
- package/src/components/editor/chrome/panels/packages-panel.tsx +1 -11
- package/src/components/editor/columns/cell-column.tsx +4 -34
- package/src/components/editor/columns/sortable-column.tsx +4 -24
- package/src/components/editor/navigation/__tests__/navigation.test.ts +0 -33
- package/src/components/editor/navigation/navigation.ts +1 -8
- package/src/components/editor/notebook-cell.tsx +106 -203
- package/src/components/editor/renderers/cell-array.tsx +13 -26
- package/src/components/editor/renderers/cells-renderer.tsx +2 -8
- package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +0 -29
- package/src/components/editor/renderers/slides-layout/types.ts +0 -4
- package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +19 -19
- package/src/components/slides/reveal-component.tsx +4 -37
- package/src/components/slides/slide-form.tsx +0 -72
- package/src/core/cells/__tests__/utils.test.ts +0 -59
- package/src/core/cells/utils.ts +0 -51
- package/src/core/codemirror/completion/__tests__/signature-hint.test.ts +3 -97
- package/src/core/codemirror/completion/signature-hint.ts +11 -78
- package/src/core/constants.ts +0 -6
- package/src/core/islands/__tests__/bridge.test.ts +46 -341
- package/src/core/islands/__tests__/parse.test.ts +0 -105
- package/src/core/islands/bootstrap.ts +3 -8
- package/src/core/islands/bridge.ts +23 -116
- package/src/core/islands/components/web-components.tsx +15 -76
- package/src/core/islands/constants.ts +0 -1
- package/src/core/islands/main.ts +3 -69
- package/src/core/islands/parse.ts +23 -70
- package/src/core/islands/worker/worker.tsx +57 -145
- package/src/core/wasm/worker/bootstrap.ts +20 -113
- package/src/css/app/Cell.css +0 -10
- package/src/hooks/useHotkey.ts +4 -29
- package/src/plugins/impl/anywidget/__tests__/host.test.ts +9 -6
- package/src/plugins/impl/anywidget/__tests__/widget-binding.test.ts +61 -22
- package/src/plugins/impl/anywidget/model-proxy.ts +13 -0
- package/src/plugins/impl/anywidget/widget-binding.ts +34 -4
- package/src/plugins/impl/image-comparison/ImageComparisonComponent.tsx +2 -53
- package/src/plugins/impl/matplotlib/__tests__/matplotlib-renderer.test.ts +3 -71
- package/src/plugins/impl/matplotlib/matplotlib-renderer.ts +0 -1
- package/src/theme/useTheme.ts +1 -16
- package/dist/assets/__vite-browser-external-CjNAy01L.js +0 -1
- package/dist/assets/worker-B3XPCb6y.js +0 -98
- package/src/components/chat/__tests__/message-queue.test.tsx +0 -121
- package/src/components/editor/__tests__/output-persistence.test.tsx +0 -241
- package/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts +0 -153
- package/src/components/editor/actions/pair-with-agent-commands.ts +0 -109
- package/src/components/editor/columns/__tests__/cell-column.test.tsx +0 -105
- package/src/components/editor/renderers/__tests__/cells-renderer.test.tsx +0 -66
- package/src/core/islands/__tests__/main.test.ts +0 -176
- package/src/core/islands/components/__tests__/web-components.test.tsx +0 -214
- package/src/core/islands/worker/__tests__/controller.test.ts +0 -173
- package/src/hooks/__tests__/useHotkey.test.tsx +0 -88
- package/src/plugins/impl/image-comparison/__tests__/ImageComparisonComponent.test.tsx +0 -71
- package/src/theme/__tests__/useTheme.test.ts +0 -68
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { fireEvent, render } from "@testing-library/react";
|
|
4
|
-
import { describe, expect, it } from "vitest";
|
|
5
|
-
import ImageComparisonComponent from "../ImageComparisonComponent";
|
|
6
|
-
|
|
7
|
-
const baseProps = {
|
|
8
|
-
beforeSrc: "before.png",
|
|
9
|
-
afterSrc: "after.png",
|
|
10
|
-
value: 50,
|
|
11
|
-
direction: "horizontal" as const,
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
describe("ImageComparisonComponent", () => {
|
|
15
|
-
it("renders the comparison slider with both images", () => {
|
|
16
|
-
const { getByAltText, container } = render(
|
|
17
|
-
<ImageComparisonComponent {...baseProps} />,
|
|
18
|
-
);
|
|
19
|
-
expect(getByAltText("Before")).toBeTruthy();
|
|
20
|
-
expect(getByAltText("After")).toBeTruthy();
|
|
21
|
-
expect(container.querySelector("img-comparison-slider")).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it("shows a visible error instead of collapsing when an image fails to load", () => {
|
|
25
|
-
const brokenSrc = "https://example.com/does-not-exist.png";
|
|
26
|
-
const { getByAltText, queryByText, container } = render(
|
|
27
|
-
<ImageComparisonComponent {...baseProps} beforeSrc={brokenSrc} />,
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
// No error before the image fails.
|
|
31
|
-
expect(queryByText(/Failed to load/)).toBeNull();
|
|
32
|
-
|
|
33
|
-
fireEvent.error(getByAltText("Before"));
|
|
34
|
-
|
|
35
|
-
// The slider is replaced with a visible error mentioning the source, so
|
|
36
|
-
// the output is never a silent blank.
|
|
37
|
-
expect(container.querySelector("img-comparison-slider")).toBeNull();
|
|
38
|
-
const error = queryByText(/Failed to load image/);
|
|
39
|
-
expect(error).toBeTruthy();
|
|
40
|
-
expect(error?.textContent).toContain(brokenSrc);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it("clears the error when the sources change so new images can load", () => {
|
|
44
|
-
const brokenSrc = "https://example.com/does-not-exist.png";
|
|
45
|
-
const { getByAltText, queryByText, container, rerender } = render(
|
|
46
|
-
<ImageComparisonComponent {...baseProps} beforeSrc={brokenSrc} />,
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
fireEvent.error(getByAltText("Before"));
|
|
50
|
-
expect(queryByText(/Failed to load/)).toBeTruthy();
|
|
51
|
-
|
|
52
|
-
// Re-render with a new source (e.g. the user fixed the notebook): the error
|
|
53
|
-
// should clear and the slider should mount again rather than stay stuck.
|
|
54
|
-
rerender(<ImageComparisonComponent {...baseProps} beforeSrc="fixed.png" />);
|
|
55
|
-
expect(queryByText(/Failed to load/)).toBeNull();
|
|
56
|
-
expect(container.querySelector("img-comparison-slider")).toBeTruthy();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it("truncates long sources (e.g. data URLs) in the error message", () => {
|
|
60
|
-
const longSrc = `data:image/png;base64,${"A".repeat(200)}`;
|
|
61
|
-
const { getByAltText, queryByText } = render(
|
|
62
|
-
<ImageComparisonComponent {...baseProps} afterSrc={longSrc} />,
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
fireEvent.error(getByAltText("After"));
|
|
66
|
-
|
|
67
|
-
const error = queryByText(/Failed to load image/);
|
|
68
|
-
expect(error?.textContent).toContain("…");
|
|
69
|
-
expect(error?.textContent).not.toContain("A".repeat(200));
|
|
70
|
-
});
|
|
71
|
-
});
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { afterEach, describe, expect, it } from "vitest";
|
|
4
|
-
import { configOverridesAtom, userConfigAtom } from "@/core/config/config";
|
|
5
|
-
import { defaultUserConfig } from "@/core/config/config-schema";
|
|
6
|
-
import { store } from "@/core/state/jotai";
|
|
7
|
-
import type { Theme } from "../useTheme";
|
|
8
|
-
import { resolvedThemeAtom, visibleForTesting } from "../useTheme";
|
|
9
|
-
|
|
10
|
-
const { themeFromQueryParam } = visibleForTesting;
|
|
11
|
-
|
|
12
|
-
function setQuery(search: string): void {
|
|
13
|
-
window.history.replaceState({}, "", search === "" ? "/" : `/?${search}`);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function setConfigTheme(theme: Theme): void {
|
|
17
|
-
const config = defaultUserConfig();
|
|
18
|
-
store.set(userConfigAtom, {
|
|
19
|
-
...config,
|
|
20
|
-
display: { ...config.display, theme },
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
afterEach(() => {
|
|
25
|
-
setQuery("");
|
|
26
|
-
store.set(userConfigAtom, defaultUserConfig());
|
|
27
|
-
store.set(configOverridesAtom, {});
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
describe("themeFromQueryParam", () => {
|
|
31
|
-
it.each(["light", "dark", "system"] as const)(
|
|
32
|
-
"returns the valid theme %s",
|
|
33
|
-
(theme) => {
|
|
34
|
-
setQuery(`theme=${theme}`);
|
|
35
|
-
expect(themeFromQueryParam()).toBe(theme);
|
|
36
|
-
},
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
it("returns undefined when the param is absent", () => {
|
|
40
|
-
setQuery("");
|
|
41
|
-
expect(themeFromQueryParam()).toBeUndefined();
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it("returns undefined for an invalid value", () => {
|
|
45
|
-
setQuery("theme=blue");
|
|
46
|
-
expect(themeFromQueryParam()).toBeUndefined();
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
describe("resolvedThemeAtom with a theme query param", () => {
|
|
51
|
-
it("uses the saved config theme when no param is present", () => {
|
|
52
|
-
setConfigTheme("dark");
|
|
53
|
-
setQuery("");
|
|
54
|
-
expect(store.get(resolvedThemeAtom)).toBe("dark");
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it("lets the query param override the saved config theme", () => {
|
|
58
|
-
setConfigTheme("light");
|
|
59
|
-
setQuery("theme=dark");
|
|
60
|
-
expect(store.get(resolvedThemeAtom)).toBe("dark");
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it("falls back to the config theme for an invalid param value", () => {
|
|
64
|
-
setConfigTheme("dark");
|
|
65
|
-
setQuery("theme=blue");
|
|
66
|
-
expect(store.get(resolvedThemeAtom)).toBe("dark");
|
|
67
|
-
});
|
|
68
|
-
});
|