@marimo-team/islands 0.24.1-dev47 → 0.24.1-dev49
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/{common-DttbfuQx.js → common-CuYfB-UB.js} +1 -1
- package/dist/main.js +2 -2
- package/dist/{reveal-component-KZ-Xt-Rk.js → reveal-component-C7Dc57LE.js} +1 -1
- package/package.json +1 -1
- package/src/components/editor/actions/types.ts +1 -2
- package/src/components/editor/actions/useNotebookActions.tsx +1 -0
- package/src/components/editor/controls/__tests__/notebook-menu-dropdown.test.tsx +41 -32
|
@@ -31787,7 +31787,7 @@ function ZG() {
|
|
|
31787
31787
|
return i.warn("Failed to get version from mount config"), null;
|
|
31788
31788
|
}
|
|
31789
31789
|
}
|
|
31790
|
-
var QG = ZG() || "0.24.1-
|
|
31790
|
+
var QG = ZG() || "0.24.1-dev49", $G = Ti(QG), eK = Ti(!0);
|
|
31791
31791
|
Ti(null);
|
|
31792
31792
|
//#endregion
|
|
31793
31793
|
//#region src/core/meta/code-visibility.ts
|
package/dist/main.js
CHANGED
|
@@ -6,7 +6,7 @@ import { n as x, r as S, t as C } from "./copy-DgAphl4k.js";
|
|
|
6
6
|
import { $t as w, At as T, B as E, C as D, Cn as O, Ct as k, Dn as A, Dt as j, En as M, Et as N, F as P, Ft as F, G as I, Gn as L, Gt as ee, H as te, Hn as R, Ht as ne, I as z, In as re, J as ie, Jn as ae, K as oe, Kn as se, Kt as ce, L as le, Ln as ue, Mn as de, Nn as fe, On as pe, Ot as me, P as he, Pn as ge, Pt as _e, Q as ve, Qn as ye, R as be, Rt as xe, Sn as Se, St as Ce, Tt as we, U as Te, Un as Ee, Ut as De, Vt as Oe, W as ke, Wn as Ae, X as je, Y as Me, Yn as Ne, Yt as Pe, Zn as Fe, _ as Ie, _n as Le, _t as Re, a as ze, an as Be, b as Ve, bn as He, bt as Ue, ct as We, en as Ge, g as Ke, gt as qe, hn as Je, i as Ye, in as Xe, it as Ze, j as Qe, jn as $e, jt as et, k as tt, mn as nt, n as rt, nn as it, nt as at, o as ot, ot as st, pn as ct, q as lt, rn as ut, rt as dt, st as ft, tn as pt, un as mt, v as ht, vt as gt, xn as _t, xt as vt, y as yt, yn as bt, yt as xt, z as St, zn as Ct } from "./html-to-image-hKcfSWj_.js";
|
|
7
7
|
import { o as wt, s as Tt, u as Et } from "./dist-DTSuOdDc.js";
|
|
8
8
|
import { D as Dt, E as Ot, O as kt, S as At, T as jt, _ as Mt, a as Nt, c as Pt, d as Ft, f as It, g as Lt, h as Rt, i as zt, l as Bt, m as Vt, n as Ht, o as Ut, p as Wt, r as Gt, s as Kt, t as qt, u as Jt, v as Yt, w as Xt, x as Zt, y as Qt } from "./spec-DqUrBQpS.js";
|
|
9
|
-
import { $ as $t, $t as en, A as tn, At as nn, B as rn, Bt as an, C as on, Ct as sn, D as cn, Dt as ln, E as un, Et as dn, F as fn, Ft as pn, G as mn, Gt as hn, H as gn, Ht as _n, I as vn, It as yn, Jt as bn, K as xn, Kt as Sn, L as Cn, Lt as wn, M as Tn, Mt as En, N as Dn, Nt as On, O as kn, Ot as An, P as jn, Pt as Mn, Q as Nn, Qt as Pn, R as Fn, Rt as In, S as Ln, St as Rn, T as zn, Tt as Bn, U as Vn, Ut as Hn, V as Un, Vt as Wn, W as Gn, Wt as Kn, Xt as qn, Yt as Jn, Z as Yn, Zt as Xn, _ as Zn, an as Qn, at as $n, b as er, bt as tr, c as nr, cn as rr, ct as ir, d as ar, dn as or, dt as sr, en as cr, et as lr, f as ur, fn as dr, ft as fr, g as pr, gt as mr, h as hr, ht as gr, i as _r, it as vr, j as yr, jt as br, k as xr, kt as Sr, ln as Cr, lt as wr, m as Tr, mt as Er, n as Dr, nn as Or, nt as kr, on as Ar, ot as jr, p as Mr, pn as Nr, pt as Pr, q as Fr, qt as Ir, r as Lr, rn as Rr, rt as zr, sn as Br, st as Vr, t as Hr, tn as Ur, tt as Wr, u as Gr, un as Kr, ut as qr, v as Jr, w as Yr, wt as Xr, x as Zr, xt as Qr, y as $r, yt as ei, z as ti, zt as ni } from "./common-
|
|
9
|
+
import { $ as $t, $t as en, A as tn, At as nn, B as rn, Bt as an, C as on, Ct as sn, D as cn, Dt as ln, E as un, Et as dn, F as fn, Ft as pn, G as mn, Gt as hn, H as gn, Ht as _n, I as vn, It as yn, Jt as bn, K as xn, Kt as Sn, L as Cn, Lt as wn, M as Tn, Mt as En, N as Dn, Nt as On, O as kn, Ot as An, P as jn, Pt as Mn, Q as Nn, Qt as Pn, R as Fn, Rt as In, S as Ln, St as Rn, T as zn, Tt as Bn, U as Vn, Ut as Hn, V as Un, Vt as Wn, W as Gn, Wt as Kn, Xt as qn, Yt as Jn, Z as Yn, Zt as Xn, _ as Zn, an as Qn, at as $n, b as er, bt as tr, c as nr, cn as rr, ct as ir, d as ar, dn as or, dt as sr, en as cr, et as lr, f as ur, fn as dr, ft as fr, g as pr, gt as mr, h as hr, ht as gr, i as _r, it as vr, j as yr, jt as br, k as xr, kt as Sr, ln as Cr, lt as wr, m as Tr, mt as Er, n as Dr, nn as Or, nt as kr, on as Ar, ot as jr, p as Mr, pn as Nr, pt as Pr, q as Fr, qt as Ir, r as Lr, rn as Rr, rt as zr, sn as Br, st as Vr, t as Hr, tn as Ur, tt as Wr, u as Gr, un as Kr, ut as qr, v as Jr, w as Yr, wt as Xr, x as Zr, xt as Qr, y as $r, yt as ei, z as ti, zt as ni } from "./common-CuYfB-UB.js";
|
|
10
10
|
import { c as ri, i as ii, n as ai, o as oi, t as si } from "./useLifecycle-D-zb2Ha5.js";
|
|
11
11
|
import { t as ci } from "./check-DIJJHY-E.js";
|
|
12
12
|
import { A as li, C as ui, D as di, E as fi, F as pi, I as mi, M as hi, N as gi, P as _i, R as vi, S as yi, a as bi, b as xi, c as Si, i as Ci, j as wi, l as Ti, n as Ei, o as Di, r as Oi, s as ki, t as Ai, w as ji, x as Mi } from "./select-Bakm9EUs.js";
|
|
@@ -35256,7 +35256,7 @@ function Gq(e) {
|
|
|
35256
35256
|
}
|
|
35257
35257
|
//#endregion
|
|
35258
35258
|
//#region src/components/editor/renderers/slides-layout/slides-layout.tsx
|
|
35259
|
-
var Kq = q.lazy(() => import("./reveal-component-
|
|
35259
|
+
var Kq = q.lazy(() => import("./reveal-component-C7Dc57LE.js")), qq = (e) => {
|
|
35260
35260
|
let t = (0, Y.c)(33), { layout: n, setLayout: r, cells: i, mode: a } = e, o = Nm(k), s = a === "read" || o, c = Nm(lt) > 1, [l, u] = (0, q.useState)(null), d;
|
|
35261
35261
|
t[0] !== i || t[1] !== n ? (d = UU(i, n), t[0] = i, t[1] = n, t[2] = d) : d = t[2];
|
|
35262
35262
|
let { slideCells: f, skippedIds: p, noOutputIds: m, slideTypes: h, startCellIndex: g } = d, _;
|
|
@@ -4,7 +4,7 @@ import { t as o } from "./react-DMWcHin-.js";
|
|
|
4
4
|
import { t as s } from "./compiler-runtime-CAH9RLw2.js";
|
|
5
5
|
import { Ct as c, rt as l } from "./html-to-image-hKcfSWj_.js";
|
|
6
6
|
import { u } from "./dist-DTSuOdDc.js";
|
|
7
|
-
import { J as d, X as f, Y as p, in as m, l as h, n as g, rn as _, sn as v, t as y, u as b } from "./common-
|
|
7
|
+
import { J as d, X as f, Y as p, in as m, l as h, n as g, rn as _, sn as v, t as y, u as b } from "./common-CuYfB-UB.js";
|
|
8
8
|
import { R as x } from "./select-Bakm9EUs.js";
|
|
9
9
|
import { X as S } from "./dropdown-menu-DEu759Oe.js";
|
|
10
10
|
import { t as C } from "./jsx-runtime-CpoKNRgu.js";
|
package/package.json
CHANGED
|
@@ -45,8 +45,7 @@ export function flattenActions(
|
|
|
45
45
|
prevLabel = "",
|
|
46
46
|
): ActionButton[] {
|
|
47
47
|
return actions.flatMap((action) => {
|
|
48
|
-
|
|
49
|
-
if (!action.label) {
|
|
48
|
+
if (!action.label || action.hidden) {
|
|
50
49
|
return [];
|
|
51
50
|
}
|
|
52
51
|
if (isParentAction(action)) {
|
|
@@ -31,7 +31,9 @@ import {
|
|
|
31
31
|
exportOptionsAtom,
|
|
32
32
|
lastExportFormatAtom,
|
|
33
33
|
} from "../../actions/export-dialog/state";
|
|
34
|
+
import CommandPalette from "../command-palette";
|
|
34
35
|
import { NotebookMenuDropdown } from "../notebook-menu-dropdown";
|
|
36
|
+
import { commandPaletteAtom } from "../state";
|
|
35
37
|
|
|
36
38
|
const POSTGRES_SOURCE: DetectedDataSource = {
|
|
37
39
|
id: "postgres-libpq-environment",
|
|
@@ -66,6 +68,10 @@ vi.mock("@/core/wasm/utils", async (importOriginal) => {
|
|
|
66
68
|
return { ...actual, isWasm: vi.fn(() => false) };
|
|
67
69
|
});
|
|
68
70
|
|
|
71
|
+
global.HTMLElement.prototype.scrollIntoView = () => {
|
|
72
|
+
// jsdom does not implement scrollIntoView; cmdk calls it on selection.
|
|
73
|
+
};
|
|
74
|
+
|
|
69
75
|
function wrapper({ children }: { children: React.ReactNode }) {
|
|
70
76
|
return (
|
|
71
77
|
<Provider store={store}>
|
|
@@ -83,14 +89,19 @@ function openNotebookMenu() {
|
|
|
83
89
|
});
|
|
84
90
|
}
|
|
85
91
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
92
|
+
function renderNotebookControls() {
|
|
93
|
+
return render(
|
|
94
|
+
<>
|
|
95
|
+
<NotebookMenuDropdown />
|
|
96
|
+
<CommandPalette />
|
|
97
|
+
</>,
|
|
98
|
+
{ wrapper },
|
|
99
|
+
);
|
|
89
100
|
}
|
|
90
101
|
|
|
91
|
-
async function
|
|
92
|
-
|
|
93
|
-
fireEvent.click(await screen.
|
|
102
|
+
async function selectDownloadCommand(name: string) {
|
|
103
|
+
act(() => store.set(commandPaletteAtom, true));
|
|
104
|
+
fireEvent.click(await screen.findByText(`Download > ${name}`));
|
|
94
105
|
}
|
|
95
106
|
|
|
96
107
|
describe("NotebookMenuDropdown", () => {
|
|
@@ -108,6 +119,7 @@ describe("NotebookMenuDropdown", () => {
|
|
|
108
119
|
});
|
|
109
120
|
store.set(exportOptionsAtom, DEFAULT_EXPORT_OPTIONS);
|
|
110
121
|
store.set(lastExportFormatAtom, "html");
|
|
122
|
+
store.set(commandPaletteAtom, false);
|
|
111
123
|
vi.mocked(isWasm).mockReturnValue(false);
|
|
112
124
|
vi.stubGlobal("PointerEvent", MouseEvent);
|
|
113
125
|
vi.stubGlobal("matchMedia", () => ({
|
|
@@ -203,10 +215,22 @@ describe("NotebookMenuDropdown", () => {
|
|
|
203
215
|
await waitFor(() => expect(menuButton).toHaveFocus());
|
|
204
216
|
});
|
|
205
217
|
|
|
218
|
+
it("hides the download menu but keeps its command palette actions", async () => {
|
|
219
|
+
renderNotebookControls();
|
|
220
|
+
|
|
221
|
+
openNotebookMenu();
|
|
222
|
+
expect(
|
|
223
|
+
screen.queryByRole("menuitem", { name: "Download" }),
|
|
224
|
+
).not.toBeInTheDocument();
|
|
225
|
+
|
|
226
|
+
act(() => store.set(commandPaletteAtom, true));
|
|
227
|
+
expect(await screen.findByText("Download > Download as PNG")).toBeVisible();
|
|
228
|
+
});
|
|
229
|
+
|
|
206
230
|
it("opens the HTML shortcut with code excluded", async () => {
|
|
207
|
-
|
|
231
|
+
renderNotebookControls();
|
|
208
232
|
|
|
209
|
-
await
|
|
233
|
+
await selectDownloadCommand("Download as HTML (exclude code)");
|
|
210
234
|
|
|
211
235
|
expect(await screen.findByTestId("export-dialog")).toBeVisible();
|
|
212
236
|
expect(screen.getByTestId("export-format-html")).toHaveAttribute(
|
|
@@ -223,19 +247,9 @@ describe("NotebookMenuDropdown", () => {
|
|
|
223
247
|
selectedLayout: "slides",
|
|
224
248
|
layoutData: {},
|
|
225
249
|
});
|
|
226
|
-
|
|
250
|
+
renderNotebookControls();
|
|
227
251
|
|
|
228
|
-
await
|
|
229
|
-
fireEvent.click(
|
|
230
|
-
await screen.findByRole("menuitem", {
|
|
231
|
-
name: "Download as PDF",
|
|
232
|
-
}),
|
|
233
|
-
);
|
|
234
|
-
fireEvent.click(
|
|
235
|
-
await screen.findByRole("menuitem", {
|
|
236
|
-
name: /Slides Layout/,
|
|
237
|
-
}),
|
|
238
|
-
);
|
|
252
|
+
await selectDownloadCommand("Download as PDF > Slides Layout");
|
|
239
253
|
|
|
240
254
|
expect(await screen.findByTestId("export-dialog")).toBeVisible();
|
|
241
255
|
expect(screen.getByTestId("export-format-pdf")).toHaveAttribute(
|
|
@@ -251,27 +265,22 @@ describe("NotebookMenuDropdown", () => {
|
|
|
251
265
|
selectedLayout: "slides",
|
|
252
266
|
layoutData: {},
|
|
253
267
|
});
|
|
254
|
-
|
|
268
|
+
renderNotebookControls();
|
|
255
269
|
|
|
256
|
-
|
|
257
|
-
fireEvent.click(
|
|
258
|
-
await screen.findByRole("menuitem", {
|
|
259
|
-
name: "Download as PDF",
|
|
260
|
-
}),
|
|
261
|
-
);
|
|
270
|
+
act(() => store.set(commandPaletteAtom, true));
|
|
262
271
|
|
|
263
272
|
expect(
|
|
264
|
-
screen.
|
|
273
|
+
await screen.findByText("Download > Download as PDF > Document Layout"),
|
|
265
274
|
).toBeVisible();
|
|
266
275
|
expect(
|
|
267
|
-
screen.
|
|
276
|
+
screen.queryByText("Download > Download as PDF > Slides Layout"),
|
|
268
277
|
).not.toBeInTheDocument();
|
|
269
278
|
});
|
|
270
279
|
|
|
271
280
|
it("preselects each Python format from its download shortcut", async () => {
|
|
272
|
-
|
|
281
|
+
renderNotebookControls();
|
|
273
282
|
|
|
274
|
-
await
|
|
283
|
+
await selectDownloadCommand("Download notebook source");
|
|
275
284
|
|
|
276
285
|
expect(await screen.findByTestId("export-dialog")).toBeVisible();
|
|
277
286
|
expect(screen.getByTestId("export-format-script")).toHaveAttribute(
|
|
@@ -287,7 +296,7 @@ describe("NotebookMenuDropdown", () => {
|
|
|
287
296
|
expect(screen.queryByTestId("export-dialog")).not.toBeInTheDocument(),
|
|
288
297
|
);
|
|
289
298
|
|
|
290
|
-
await
|
|
299
|
+
await selectDownloadCommand("Download flat script");
|
|
291
300
|
|
|
292
301
|
expect(await screen.findByTestId("export-dialog")).toBeVisible();
|
|
293
302
|
expect(screen.getByRole("radio", { name: "Flat script" })).toBeChecked();
|