@marimo-team/islands 0.26.1-dev104 → 0.26.1-dev105
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-BJBdnd0O.js → ConnectedDataExplorerComponent-C6dY5fiI.js} +1 -1
- package/dist/{ErrorBoundary-DLR6xE2E.js → ErrorBoundary-Bn664FZa.js} +1 -1
- package/dist/{chat-ui-Bs3rgm2m.js → chat-ui-zGgiq5zN.js} +3 -3
- package/dist/{code-visibility-BhWW3jkv.js → code-visibility-CMgSFUs7.js} +2 -2
- package/dist/{common-i4mVHMGl.js → common-DWnR77Qk.js} +5 -5
- package/dist/{createReducer-BUQhgLOI.js → createReducer-m7yAXmDu.js} +16 -19
- package/dist/{data-grid-overlay-editor-7durYJXa.js → data-grid-overlay-editor-zS1h3iMI.js} +1 -1
- package/dist/{error-entries-BcAyFIeh.js → error-entries-DVclFjaE.js} +23 -26
- package/dist/{feedback-button-CeuzSBrq.js → feedback-button-BMGqp8Ff.js} +3 -3
- package/dist/{glide-data-editor-BLGr2vQF.js → glide-data-editor-Bra6h4KB.js} +3 -3
- package/dist/{globals-DorvG5dC.js → globals-_bXqC0R8.js} +1 -1
- package/dist/{html-to-image-BmLTjaGw.js → html-to-image-Cst4BlIm.js} +5685 -5678
- package/dist/main.js +36 -36
- package/dist/{number-overlay-editor-DQAdvZrn.js → number-overlay-editor-XLUhOVa7.js} +1 -1
- package/dist/{process-output-CcNpl5Qu.js → process-output-DizFa5IE.js} +2 -2
- package/dist/{reveal-component-B6xeeht1.js → reveal-component-llpC324_.js} +2 -2
- package/package.json +1 -1
- package/src/components/editor/cell/__tests__/cell-actions.test.tsx +74 -0
- package/src/components/editor/cell/cell-action-body.tsx +28 -0
- package/src/components/editor/cell/cell-actions.tsx +60 -72
- package/src/components/editor/cell/cell-context-menu.tsx +36 -62
- package/src/components/editor/navigation/navigation.ts +1 -1
- package/src/core/cells/__tests__/use-cell-actions.test.tsx +48 -0
- package/src/core/cells/actions.ts +68 -89
- package/src/core/cells/cells.ts +2 -0
- package/src/utils/__tests__/createReducer.test.tsx +4 -3
- package/src/utils/createReducer.ts +19 -12
package/dist/main.js
CHANGED
|
@@ -3,20 +3,20 @@ import { _ as a, a as o, d as s, g as c, h as l, i as u, l as d, m as f, n as p,
|
|
|
3
3
|
import { t as y } from "./react-Bgs_wQh3.js";
|
|
4
4
|
import { t as b } from "./compiler-runtime-C5KHtL5D.js";
|
|
5
5
|
import { i as x, n as S, r as C, t as w } from "./copy-icon-CmNLxT5_.js";
|
|
6
|
-
import { $ as T, Bt as E, E as D, Et as O, F as k, Ft as A, G as j, I as M, It as N, K as P, L as F, Lt as I, M as L, Mt as R, Nt as z, O as B, P as ee, Pt as te, Q as ne, Rt as re, Tt as ie, Vt as ae, _ as oe, _t as se, a as ce, at as le, b as ue, bt as de, c as fe, dt as pe, ft as me, ht as he, i as ge, j as _e, kt as ve, lt as ye, n as be, nt as xe, o as Se, ot as Ce, rt as we, st as Te, tt as Ee, ut as De, yt as Oe } from "./html-to-image-
|
|
6
|
+
import { $ as T, Bt as E, E as D, Et as O, F as k, Ft as A, G as j, I as M, It as N, K as P, L as F, Lt as I, M as L, Mt as R, Nt as z, O as B, P as ee, Pt as te, Q as ne, Rt as re, Tt as ie, Vt as ae, _ as oe, _t as se, a as ce, at as le, b as ue, bt as de, c as fe, dt as pe, ft as me, ht as he, i as ge, j as _e, kt as ve, lt as ye, n as be, nt as xe, o as Se, ot as Ce, rt as we, st as Te, tt as Ee, ut as De, yt as Oe } from "./html-to-image-Cst4BlIm.js";
|
|
7
7
|
import { a as ke, f as Ae, h as je, i as Me, m as Ne, n as Pe, o as Fe, r as Ie, t as Le } from "./tooltip-DyLdBIM4.js";
|
|
8
8
|
import { D as Re, E as ze, S as Be, T as Ve, _ as He, a as Ue, c as We, d as Ge, f as Ke, g as qe, h as Je, i as Ye, l as Xe, m as Ze, n as Qe, o as $e, p as et, r as tt, s as nt, t as rt, u as it, v as at, w as ot, x as st, y as ct } from "./spec-Dz-Avv1m.js";
|
|
9
|
-
import { $ as lt, $t as ut, A as dt, An as ft, At as pt, B as mt, Bt as ht, C as gt, D as _t, Dn as vt, Dt as yt, E as bt, En as xt, Et as St, F as Ct, Ft as wt, G as Tt, Gt as Et, H as Dt, Ht as Ot, I as kt, It as At, J as jt, Jt as Mt, K as Nt, Kt as Pt, L as Ft, Lt as It, M as Lt, Mn as Rt, Mt as zt, N as Bt, Nt as Vt, O as Ht, On as Ut, Ot as Wt, P as Gt, Pt as Kt, Q as qt, Qt as Jt, R as Yt, Rt as Xt, S as Zt, Sn as Qt, St as $t, T as en, Tn as tn, Tt as nn, U as rn, Ut as an, V as on, Vt as sn, W as cn, Wt as ln, X as un, Xt as dn, Y as fn, Yt as pn, Z as mn, Zt as hn, _ as gn, _n, _t as vn, an as yn, at as bn, b as xn, bn as Sn, bt as Cn, c as wn, cn as Tn, ct as En, d as Dn, dn as On, dt as kn, en as An, f as jn, fn as Mn, ft as Nn, g as Pn, gn as Fn, gt as In, h as Ln, hn as Rn, ht as zn, in as Bn, it as Vn, j as Hn, jn as Un, jt as Wn, k as Gn, kn as Kn, kt as qn, ln as Jn, lt as Yn, m as Xn, mn as Zn, mt as Qn, nn as $n, on as er, ot as tr, p as nr, pn as rr, pt as ir, q as ar, qt as or, r as sr, rn as cr, rt as lr, sn as ur, st as dr, t as fr, tn as pr, u as mr, un as hr, ut as gr, v as _r, vn as vr, vt as yr, w as br, wn as xr, x as Sr, xn as Cr, xt as wr, y as Tr, yn as Er, yt as Dr, z as Or, zt as kr } from "./common-
|
|
9
|
+
import { $ as lt, $t as ut, A as dt, An as ft, At as pt, B as mt, Bt as ht, C as gt, D as _t, Dn as vt, Dt as yt, E as bt, En as xt, Et as St, F as Ct, Ft as wt, G as Tt, Gt as Et, H as Dt, Ht as Ot, I as kt, It as At, J as jt, Jt as Mt, K as Nt, Kt as Pt, L as Ft, Lt as It, M as Lt, Mn as Rt, Mt as zt, N as Bt, Nt as Vt, O as Ht, On as Ut, Ot as Wt, P as Gt, Pt as Kt, Q as qt, Qt as Jt, R as Yt, Rt as Xt, S as Zt, Sn as Qt, St as $t, T as en, Tn as tn, Tt as nn, U as rn, Ut as an, V as on, Vt as sn, W as cn, Wt as ln, X as un, Xt as dn, Y as fn, Yt as pn, Z as mn, Zt as hn, _ as gn, _n, _t as vn, an as yn, at as bn, b as xn, bn as Sn, bt as Cn, c as wn, cn as Tn, ct as En, d as Dn, dn as On, dt as kn, en as An, f as jn, fn as Mn, ft as Nn, g as Pn, gn as Fn, gt as In, h as Ln, hn as Rn, ht as zn, in as Bn, it as Vn, j as Hn, jn as Un, jt as Wn, k as Gn, kn as Kn, kt as qn, ln as Jn, lt as Yn, m as Xn, mn as Zn, mt as Qn, nn as $n, on as er, ot as tr, p as nr, pn as rr, pt as ir, q as ar, qt as or, r as sr, rn as cr, rt as lr, sn as ur, st as dr, t as fr, tn as pr, u as mr, un as hr, ut as gr, v as _r, vn as vr, vt as yr, w as br, wn as xr, x as Sr, xn as Cr, xt as wr, y as Tr, yn as Er, yt as Dr, z as Or, zt as kr } from "./common-DWnR77Qk.js";
|
|
10
10
|
import { a as Ar, n as jr, s as Mr, t as Nr } from "./useLifecycle-tPpAt-OE.js";
|
|
11
11
|
import { t as Pr } from "./check-DUIc04aK.js";
|
|
12
12
|
import { A as Fr, C as Ir, D as Lr, M as Rr, O as zr, a as Br, c as Vr, d as Hr, i as Ur, k as Wr, l as Gr, n as Kr, o as qr, r as Jr, s as Yr, t as Xr, w as Zr, x as Qr } from "./select-CEnB18uc.js";
|
|
13
13
|
import { $ as $r, At as ei, Cn as ti, E as ni, H as ri, K as ii, Nt as ai, Q as oi, Sn as si, T as ci, V as li, X as ui, Y as di, Z as fi, _ as pi, a as mi, b as hi, c as gi, f as _i, g as vi, h as yi, i as bi, m as xi, mt as Si, n as Ci, r as wi, rt as Ti, s as Ei, t as Di, v as Oi, vt as ki, w as Ai, x as ji, xn as Mi, y as Ni } from "./dropdown-menu-D0DeN-aL.js";
|
|
14
14
|
import { t as Pi } from "./circle-question-mark-evCnVIut.js";
|
|
15
|
-
import { $t as Fi, A as Ii, At as Li, Bt as Ri, C as zi, Ct as Bi, Dt as Vi, Ft as Hi, H as Ui, I as Wi, It as Gi, J as Ki, Jt as qi, Nt as Ji, Pt as Yi, Qt as Xi, S as Zi, St as Qi, T as $i, U as ea, V as ta, W as na, X as ra, Y as ia, Zt as aa, _ as oa, bt as sa,
|
|
16
|
-
import { a as Ta, d as Ea, i as Da, n as Oa, o as ka, r as Aa, s as ja, t as Ma, u as Na } from "./process-output-
|
|
15
|
+
import { $t as Fi, A as Ii, At as Li, Bt as Ri, C as zi, Ct as Bi, Dt as Vi, Ft as Hi, H as Ui, I as Wi, It as Gi, J as Ki, Jt as qi, Nt as Ji, Pt as Yi, Qt as Xi, S as Zi, St as Qi, T as $i, U as ea, V as ta, W as na, X as ra, Y as ia, Zt as aa, _ as oa, bt as sa, en as ca, f as la, g as ua, h as da, ht as fa, l as pa, m as ma, mt as ha, nt as ga, rn as _a, rt as va, s as ya, tn as ba, v as xa, vt as Sa, w as Ca, xt as wa } from "./error-entries-DVclFjaE.js";
|
|
16
|
+
import { a as Ta, d as Ea, i as Da, n as Oa, o as ka, r as Aa, s as ja, t as Ma, u as Na } from "./process-output-DizFa5IE.js";
|
|
17
17
|
import { t as Pa } from "./pencil-CxMgOe04.js";
|
|
18
18
|
import { a as Fa, c as Ia, d as La, f as Ra, i as za, l as Ba, r as Va } from "./glide-utils-CD8BaFTm.js";
|
|
19
|
-
import { n as Ha, t as Ua } from "./globals-
|
|
19
|
+
import { n as Ha, t as Ua } from "./globals-_bXqC0R8.js";
|
|
20
20
|
import { a as Wa, i as Ga, n as Ka, r as qa, s as Ja, t as Ya } from "./assertNever-5vhHGKOK.js";
|
|
21
21
|
import { t as Xa } from "./react-dom-DdqGVp5N.js";
|
|
22
22
|
import { t as Za } from "./jsx-runtime-D8btoEHk.js";
|
|
@@ -29,7 +29,7 @@ import { t as Es } from "./objects-DCmMvZtn.js";
|
|
|
29
29
|
import { t as Ds } from "./invariant-DLmrl-hA.js";
|
|
30
30
|
import { t as Os } from "./useEvent-BoN7U38T.js";
|
|
31
31
|
import { o as ks, r as As, t as js } from "./arrays-DoQ-AILx.js";
|
|
32
|
-
import { t as Ms } from "./createReducer-
|
|
32
|
+
import { t as Ms } from "./createReducer-m7yAXmDu.js";
|
|
33
33
|
import { H as Ns, M as Ps, f as Fs, t as Is, z as q } from "./dist-BIaGGUbU.js";
|
|
34
34
|
import { c as Ls, i as Rs, n as zs, o as Bs, r as Vs, t as Hs, u as Us } from "./static-state-iw0PrHK4.js";
|
|
35
35
|
import { i as Ws, n as Gs, r as Ks } from "./formats-CcQrzFo8.js";
|
|
@@ -42,9 +42,9 @@ import { p as ic } from "./dist-BidYR5m4.js";
|
|
|
42
42
|
import { t as ac } from "./useAsyncData-P5-Oovhq.js";
|
|
43
43
|
import { n as oc, r as sc, t as cc } from "./useDeepCompareMemoize-CHx-NxMl.js";
|
|
44
44
|
import { o as lc, r as uc, s as dc } from "./loader-CGrYn73j.js";
|
|
45
|
-
import { t as fc } from "./ErrorBoundary-
|
|
45
|
+
import { t as fc } from "./ErrorBoundary-Bn664FZa.js";
|
|
46
46
|
import { G as pc, W as mc } from "./vega-loader.browser-Co9gYE8Z.js";
|
|
47
|
-
import { a as hc, c as gc, i as _c, l as vc, o as yc, s as bc, t as xc } from "./code-visibility-
|
|
47
|
+
import { a as hc, c as gc, i as _c, l as vc, o as yc, s as bc, t as xc } from "./code-visibility-CMgSFUs7.js";
|
|
48
48
|
import { t as Sc } from "./esm-DY8dGAjJ.js";
|
|
49
49
|
//#region ../node_modules/.pnpm/iconify-icon@2.3.0/node_modules/iconify-icon/dist/iconify-icon.mjs
|
|
50
50
|
var Cc = Object.freeze({
|
|
@@ -4696,8 +4696,8 @@ function j_(e, t, n) {
|
|
|
4696
4696
|
} : e;
|
|
4697
4697
|
}
|
|
4698
4698
|
var M_ = {
|
|
4699
|
-
state:
|
|
4700
|
-
code:
|
|
4699
|
+
state: ba.CLOSED,
|
|
4700
|
+
code: ca.KERNEL_DISCONNECTED,
|
|
4701
4701
|
reason: "kernel not found"
|
|
4702
4702
|
}, N_ = {
|
|
4703
4703
|
...M_,
|
|
@@ -4710,7 +4710,7 @@ function F_(e) {
|
|
|
4710
4710
|
return e instanceof Kg && P_(e.cause) ? e.cause : e instanceof Kg && e.cause instanceof Jo ? N_ : M_;
|
|
4711
4711
|
}
|
|
4712
4712
|
function I_(e) {
|
|
4713
|
-
let t = _o({ state:
|
|
4713
|
+
let t = _o({ state: ba.NOT_STARTED }), n = _o(0), r = S_({
|
|
4714
4714
|
document: D_,
|
|
4715
4715
|
analysis: C_,
|
|
4716
4716
|
attachments: w_,
|
|
@@ -4723,7 +4723,7 @@ function I_(e) {
|
|
|
4723
4723
|
}), a = _o((e) => e(i).stream), o = _o((e) => {
|
|
4724
4724
|
let { stream: t, retained: n } = e(i);
|
|
4725
4725
|
return n ?? t;
|
|
4726
|
-
}), s = _o((e) => e(a).phase === "live" && e(t).state ===
|
|
4726
|
+
}), s = _o((e) => e(a).phase === "live" && e(t).state === ba.OPEN), l = _o((e) => e(s) ? e(a).notebook : null), u = _o((e) => e(a).resources.document.current), d = _o((e) => e(i).analyzed), f = _o((e) => e(o).resources.document.current), p = _o((e) => e(s) ? e(a).resources.attachments : w_.initial), m = _o((e) => e(s) ? e(a).resources.runtime : null), h = _o((e) => e(o).resources.executions), g = _o((e) => e(h).results), _ = _o(null), v;
|
|
4727
4727
|
function y(t) {
|
|
4728
4728
|
e.set(i, (e) => {
|
|
4729
4729
|
let { stream: n, retained: r } = e;
|
|
@@ -4754,7 +4754,7 @@ function I_(e) {
|
|
|
4754
4754
|
});
|
|
4755
4755
|
}
|
|
4756
4756
|
function b(n) {
|
|
4757
|
-
n.state ===
|
|
4757
|
+
n.state === ba.CONNECTING && y(r.resume(e.get(a))), e.set(t, n);
|
|
4758
4758
|
}
|
|
4759
4759
|
function x(t) {
|
|
4760
4760
|
e.set(i, {
|
|
@@ -4790,7 +4790,7 @@ function I_(e) {
|
|
|
4790
4790
|
cursor: t,
|
|
4791
4791
|
signal: d,
|
|
4792
4792
|
onStatus: (t) => {
|
|
4793
|
-
t === "connecting" ? b({ state:
|
|
4793
|
+
t === "connecting" ? b({ state: ba.CONNECTING }) : t === "connected" && (e.set(n, (e) => e + 1), b({ state: ba.OPEN }));
|
|
4794
4794
|
}
|
|
4795
4795
|
});
|
|
4796
4796
|
i.subscribe((e) => E(i, e), (e) => {
|
|
@@ -4880,11 +4880,11 @@ function I_(e) {
|
|
|
4880
4880
|
}
|
|
4881
4881
|
let D = {
|
|
4882
4882
|
end: () => {
|
|
4883
|
-
d.aborted || (u.abort(), v === D && (v = void 0, e.set(_, null)), x({ state:
|
|
4883
|
+
d.aborted || (u.abort(), v === D && (v = void 0, e.set(_, null)), x({ state: ba.NOT_STARTED }));
|
|
4884
4884
|
},
|
|
4885
4885
|
reconnect: async () => {
|
|
4886
4886
|
if (!(d.aborted || h || m?.status !== "closed")) {
|
|
4887
|
-
h = !0, b({ state:
|
|
4887
|
+
h = !0, b({ state: ba.CONNECTING });
|
|
4888
4888
|
try {
|
|
4889
4889
|
let t = await f();
|
|
4890
4890
|
if (d.aborted) return;
|
|
@@ -4901,7 +4901,7 @@ function I_(e) {
|
|
|
4901
4901
|
}
|
|
4902
4902
|
}
|
|
4903
4903
|
};
|
|
4904
|
-
return v = D, b({ state:
|
|
4904
|
+
return v = D, b({ state: ba.CONNECTING }), S(), D.end;
|
|
4905
4905
|
}
|
|
4906
4906
|
}
|
|
4907
4907
|
//#endregion
|
|
@@ -12629,7 +12629,7 @@ var VD = (e) => {
|
|
|
12629
12629
|
output: t
|
|
12630
12630
|
};
|
|
12631
12631
|
} };
|
|
12632
|
-
} }, qD = J.lazy(() => import("./chat-ui-
|
|
12632
|
+
} }, qD = J.lazy(() => import("./chat-ui-zGgiq5zN.js").then((e) => ({ default: e.Chatbot }))), JD = V(G({
|
|
12633
12633
|
id: K(),
|
|
12634
12634
|
role: H([
|
|
12635
12635
|
"system",
|
|
@@ -13098,7 +13098,7 @@ function KO(e, t) {
|
|
|
13098
13098
|
}
|
|
13099
13099
|
//#endregion
|
|
13100
13100
|
//#region src/plugins/impl/DataEditorPlugin.tsx
|
|
13101
|
-
var qO = J.lazy(() => import("./glide-data-editor-
|
|
13101
|
+
var qO = J.lazy(() => import("./glide-data-editor-Bra6h4KB.js").then((e) => e.t)), JO = OD("marimo-data-editor", { cssStyles: [ZD, QD] }).withData(G({
|
|
13102
13102
|
initialValue: G({ edits: V(G({
|
|
13103
13103
|
rowIdx: W(),
|
|
13104
13104
|
columnId: K(),
|
|
@@ -18257,7 +18257,7 @@ function xM(e) {
|
|
|
18257
18257
|
}
|
|
18258
18258
|
//#endregion
|
|
18259
18259
|
//#region src/plugins/impl/data-explorer/DataExplorerPlugin.tsx
|
|
18260
|
-
var SM = J.lazy(() => import("./ConnectedDataExplorerComponent-
|
|
18260
|
+
var SM = J.lazy(() => import("./ConnectedDataExplorerComponent-C6dY5fiI.js")), CM = OD("marimo-data-explorer").withData(G({
|
|
18261
18261
|
label: K().nullish(),
|
|
18262
18262
|
data: K()
|
|
18263
18263
|
})).renderer((e) => /* @__PURE__ */ (0, Y.jsx)(SM, {
|
|
@@ -24942,7 +24942,7 @@ function lR(e) {
|
|
|
24942
24942
|
let n = e.target;
|
|
24943
24943
|
e.isIntersecting ? (!s.current || n.getBoundingClientRect().top < s.current.getBoundingClientRect().top) && (s.current = n, t = !0) : n === s.current && (s.current = null, t = !0);
|
|
24944
24944
|
}), t && s.current) {
|
|
24945
|
-
let e =
|
|
24945
|
+
let e = _a(s.current), t = "id" in e ? e.id : e.path;
|
|
24946
24946
|
r(t), a(l.current.get(s.current));
|
|
24947
24947
|
}
|
|
24948
24948
|
}, {
|
|
@@ -24951,7 +24951,7 @@ function lR(e) {
|
|
|
24951
24951
|
threshold: 0
|
|
24952
24952
|
}), e.forEach((t) => {
|
|
24953
24953
|
if (t) {
|
|
24954
|
-
let n =
|
|
24954
|
+
let n = _a(t[0]), r = e.map(uR).filter((e) => "id" in n ? e.id === n.id : e.textContent === t[0].textContent).indexOf(t[0]);
|
|
24955
24955
|
l.current.set(t[0], r), o.current?.observe(t[0]);
|
|
24956
24956
|
}
|
|
24957
24957
|
}), () => {
|
|
@@ -24992,7 +24992,7 @@ function pR(e, t) {
|
|
|
24992
24992
|
//#endregion
|
|
24993
24993
|
//#region src/components/editor/chrome/panels/outline/floating-outline.tsx
|
|
24994
24994
|
var mR = () => {
|
|
24995
|
-
let e = (0, X.c)(22), { items: t } = Ao(
|
|
24995
|
+
let e = (0, X.c)(22), { items: t } = Ao(oa), n;
|
|
24996
24996
|
e[0] === t ? n = e[1] : (n = dR(t), e[0] = t, e[1] = n);
|
|
24997
24997
|
let { activeHeaderId: r, activeOccurrences: i } = lR(n), [a, o] = J.useState(!1), [s, c] = J.useState(!1), u = a || s;
|
|
24998
24998
|
if (t.length < 2) return null;
|
|
@@ -25076,7 +25076,7 @@ var mR = () => {
|
|
|
25076
25076
|
children: u
|
|
25077
25077
|
}), t[10] = s, t[11] = c, t[12] = u, t[13] = d) : d = t[13], d;
|
|
25078
25078
|
}, _R = (e) => {
|
|
25079
|
-
let t = (0, X.c)(12), { label: n } = e, { items: r } = Ao(
|
|
25079
|
+
let t = (0, X.c)(12), { label: n } = e, { items: r } = Ao(oa), i;
|
|
25080
25080
|
t[0] === r ? i = t[1] : (i = dR(r), t[0] = r, t[1] = i);
|
|
25081
25081
|
let { activeHeaderId: a, activeOccurrences: o } = lR(i);
|
|
25082
25082
|
if (r.length === 0) {
|
|
@@ -30043,7 +30043,7 @@ var lB = (e) => {
|
|
|
30043
30043
|
function uB() {
|
|
30044
30044
|
let e = (0, X.c)(3), { deleteCells: t, undoDeleteCell: n } = ee(), r;
|
|
30045
30045
|
return e[0] !== t || e[1] !== n ? (r = (e) => {
|
|
30046
|
-
let { cellId: r } = e, i = (io.get(
|
|
30046
|
+
let { cellId: r } = e, i = (io.get(ua).cellData[r]?.code ?? "").trim() === "";
|
|
30047
30047
|
if (t({ cellIds: [r] }) && !i) {
|
|
30048
30048
|
let { dismiss: e } = x({
|
|
30049
30049
|
title: "Cell deleted",
|
|
@@ -32903,7 +32903,7 @@ function uW(e) {
|
|
|
32903
32903
|
}
|
|
32904
32904
|
//#endregion
|
|
32905
32905
|
//#region src/components/editor/renderers/slides-layout/slides-layout.tsx
|
|
32906
|
-
var dW = J.lazy(() => import("./reveal-component-
|
|
32906
|
+
var dW = J.lazy(() => import("./reveal-component-llpC324_.js")), fW = (e) => {
|
|
32907
32907
|
let t = (0, X.c)(33), { layout: n, setLayout: r, cells: i, mode: a } = e, o = Ao(Bs), s = a === "read" || o, c = Ao(ha) > 1, [l, u] = (0, J.useState)(null), d;
|
|
32908
32908
|
t[0] !== i || t[1] !== n ? (d = cB(i, n), t[0] = i, t[1] = n, t[2] = d) : d = t[2];
|
|
32909
32909
|
let { slideCells: f, skippedIds: p, noOutputIds: m, slideTypes: h, startCellIndex: g } = d, _;
|
|
@@ -33228,7 +33228,7 @@ var CW = (e) => {
|
|
|
33228
33228
|
function wW(e, t) {
|
|
33229
33229
|
let n = (0, X.c)(13), [r, i] = (0, J.useState)(e), [a, o] = (0, J.useState)(!1), s;
|
|
33230
33230
|
n[0] !== t || n[1] !== e ? (s = (n) => {
|
|
33231
|
-
n !== e && (!n || wa(n) ? t(n) : t(sa(n,
|
|
33231
|
+
n !== e && (!n || wa(n) ? t(n) : t(sa(n, la())));
|
|
33232
33232
|
}, n[0] = t, n[1] = e, n[2] = s) : s = n[2];
|
|
33233
33233
|
let c = s, l;
|
|
33234
33234
|
n[3] === r ? l = n[4] : (l = wa(r) ? "" : r, n[3] = r, n[4] = l);
|
|
@@ -33989,7 +33989,7 @@ function hG({ state: e, plugin: t, cells: n }) {
|
|
|
33989
33989
|
}) : t.getInitialLayout(n));
|
|
33990
33990
|
}
|
|
33991
33991
|
function gG() {
|
|
33992
|
-
let e =
|
|
33992
|
+
let e = ma(), t = io.get(fG), { selectedLayout: n } = t;
|
|
33993
33993
|
if (n === "vertical") return null;
|
|
33994
33994
|
let r = oG.find((e) => e.type === n);
|
|
33995
33995
|
if (r === void 0) return c.error(`Unknown layout type: ${n}`), null;
|
|
@@ -34430,7 +34430,7 @@ var qG = (e) => {
|
|
|
34430
34430
|
return FG(this);
|
|
34431
34431
|
}
|
|
34432
34432
|
getCellIdFromIndex(e) {
|
|
34433
|
-
let { cellIds: t } = io.get(
|
|
34433
|
+
let { cellIds: t } = io.get(ua);
|
|
34434
34434
|
return t.at(e);
|
|
34435
34435
|
}
|
|
34436
34436
|
connectedCallback() {
|
|
@@ -34448,7 +34448,7 @@ var qG = (e) => {
|
|
|
34448
34448
|
this.querySelector(e.outputTagName) && (this.renderConfig = this.extractRenderConfig(), this.querySelector(e.outputTagName)?.remove(), this.querySelector(e.codeTagName)?.remove()), this.runtimeCellId = this.isReactive && this.runtimeAppId === this.appId ? this.cellId : void 0, this.runtimeAppId = this.appId, this.syncCellIdsSubscription(), this.renderIsland();
|
|
34449
34449
|
};
|
|
34450
34450
|
syncCellIdsSubscription() {
|
|
34451
|
-
this.isReactive ? this.unsubscribeCellIds ??= io.sub(
|
|
34451
|
+
this.isReactive ? this.unsubscribeCellIds ??= io.sub(ya, () => {
|
|
34452
34452
|
this.runtimeCellId = this.cellId, this.renderIsland();
|
|
34453
34453
|
}) : (this.unsubscribeCellIds?.(), this.unsubscribeCellIds = void 0);
|
|
34454
34454
|
}
|
|
@@ -34522,7 +34522,7 @@ async function eK(e) {
|
|
|
34522
34522
|
c.log(`Initializing ${i.length} island(s)`);
|
|
34523
34523
|
for (let e of i) e.classList.add(Yu.NAMESPACE);
|
|
34524
34524
|
let o = pa((e) => {
|
|
34525
|
-
t.set(
|
|
34525
|
+
t.set(ua, (t) => xa(t, e));
|
|
34526
34526
|
});
|
|
34527
34527
|
t.sub(gc, () => {
|
|
34528
34528
|
let e = t.get(gc), r = n.querySelectorAll(Gu.ISLAND);
|
|
@@ -34547,7 +34547,7 @@ async function eK(e) {
|
|
|
34547
34547
|
shownDocumentAtom: s.shownDocumentAtom,
|
|
34548
34548
|
backendAtom: s.backendAtom
|
|
34549
34549
|
});
|
|
34550
|
-
u.start({ signal: l.signal }), t.set(oo, u),
|
|
34550
|
+
u.start({ signal: l.signal }), t.set(oo, u), va({
|
|
34551
34551
|
store: t,
|
|
34552
34552
|
model: u,
|
|
34553
34553
|
reconcile: o.reconcileDocument,
|
|
@@ -34595,7 +34595,7 @@ function tK(e, t, n, r) {
|
|
|
34595
34595
|
return;
|
|
34596
34596
|
case "kernel-ready":
|
|
34597
34597
|
vG(e, {
|
|
34598
|
-
cells: zi(n.get(
|
|
34598
|
+
cells: zi(n.get(ua)),
|
|
34599
34599
|
resetCellRuntimes: t.resetCellRuntimes,
|
|
34600
34600
|
setLayoutData: a.NOOP,
|
|
34601
34601
|
setCapabilities: a.NOOP
|
|
@@ -34958,7 +34958,7 @@ var vK = class {
|
|
|
34958
34958
|
timestamp: t.data.time ? Date.parse(t.data.time) / 1e3 : Date.now() / 1e3
|
|
34959
34959
|
}
|
|
34960
34960
|
});
|
|
34961
|
-
this.store.set(
|
|
34961
|
+
this.store.set(ua, (t) => xa(t, {
|
|
34962
34962
|
type: "addLogs",
|
|
34963
34963
|
payload: { logs: e }
|
|
34964
34964
|
}));
|
|
@@ -34993,7 +34993,7 @@ var vK = class {
|
|
|
34993
34993
|
appId: n.id,
|
|
34994
34994
|
sessionGeneration: ++this.nextSessionGeneration
|
|
34995
34995
|
}, a = this.session, o = t && a !== void 0;
|
|
34996
|
-
this.activeSessions.set(r.sessionGeneration, /* @__PURE__ */ new Map()), o && (this.resetNotebookStream(), this.store.set(
|
|
34996
|
+
this.activeSessions.set(r.sessionGeneration, /* @__PURE__ */ new Map()), o && (this.resetNotebookStream(), this.store.set(ua, da())), (t || !a) && (t && this.sessionReady.status !== "pending" && (this.sessionReady = new Ys()), this.session = {
|
|
34997
34997
|
...r,
|
|
34998
34998
|
code: t ? e : void 0
|
|
34999
34999
|
});
|
|
@@ -35012,7 +35012,7 @@ var vK = class {
|
|
|
35012
35012
|
t?.code === void 0 || e && t.appId !== e || (this.activeSessions.delete(t.sessionGeneration), await this.rpc.proxy.request.stopSession({
|
|
35013
35013
|
appId: t.appId,
|
|
35014
35014
|
sessionGeneration: t.sessionGeneration
|
|
35015
|
-
}), this.store.set(bc, null), this.session = void 0, this.sessionReady = new Ys(), this.resetNotebookStream(), this.store.set(
|
|
35015
|
+
}), this.store.set(bc, null), this.session = void 0, this.sessionReady = new Ys(), this.resetNotebookStream(), this.store.set(ua, da()));
|
|
35016
35016
|
});
|
|
35017
35017
|
}
|
|
35018
35018
|
enqueueAppTransition(e) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
|
|
2
2
|
import { t } from "./react-Bgs_wQh3.js";
|
|
3
|
-
import { a as n } from "./glide-data-editor-
|
|
3
|
+
import { a as n } from "./glide-data-editor-Bra6h4KB.js";
|
|
4
4
|
//#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.18.1_marked@15.0.12_react-dom@19.3.1__a94b4518d090e84da26f3a68e82f2953/node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/private/number-overlay-editor-style.js
|
|
5
5
|
var r = /* @__PURE__ */ e(t()), i = /*#__PURE__*/ n("div")({
|
|
6
6
|
name: "NumberOverlayEditorStyle",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as e } from "./html-to-image-
|
|
1
|
+
import { T as e } from "./html-to-image-Cst4BlIm.js";
|
|
2
2
|
import { h as t } from "./tooltip-DyLdBIM4.js";
|
|
3
|
-
import { Tt as n, wt as r } from "./error-entries-
|
|
3
|
+
import { Tt as n, wt as r } from "./error-entries-DVclFjaE.js";
|
|
4
4
|
import { r as i } from "./assertNever-5vhHGKOK.js";
|
|
5
5
|
var a = t("file", [["path", {
|
|
6
6
|
d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
|
|
@@ -3,14 +3,14 @@ import { g as t, h as n, m as r, r as i, t as a } from "./button-Z2R2272J.js";
|
|
|
3
3
|
import { t as o } from "./react-Bgs_wQh3.js";
|
|
4
4
|
import { t as s } from "./compiler-runtime-C5KHtL5D.js";
|
|
5
5
|
import { h as c, t as l } from "./tooltip-DyLdBIM4.js";
|
|
6
|
-
import { Cn as u, En as d, Sn as f, dn as p, et as m, f as h, i as g, l as _, n as v, nt as y, r as b, t as x, tt as S, u as C } from "./common-
|
|
6
|
+
import { Cn as u, En as d, Sn as f, dn as p, et as m, f as h, i as g, l as _, n as v, nt as y, r as b, t as x, tt as S, u as C } from "./common-DWnR77Qk.js";
|
|
7
7
|
import { M as w } from "./select-CEnB18uc.js";
|
|
8
8
|
import { X as T } from "./dropdown-menu-D0DeN-aL.js";
|
|
9
9
|
import { t as E } from "./jsx-runtime-D8btoEHk.js";
|
|
10
10
|
import { Kt as D, Ut as O, f as k, i as ee } from "./use-restore-focus-DJ_-uSn_.js";
|
|
11
11
|
import { t as A } from "./useEvent-BoN7U38T.js";
|
|
12
12
|
import { o as te } from "./static-state-iw0PrHK4.js";
|
|
13
|
-
import { n as ne, t as re } from "./code-visibility-
|
|
13
|
+
import { n as ne, t as re } from "./code-visibility-CMgSFUs7.js";
|
|
14
14
|
/* empty css */
|
|
15
15
|
var j = c("sticky-note", [["path", {
|
|
16
16
|
d: "M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",
|
package/package.json
CHANGED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
act,
|
|
5
|
+
fireEvent,
|
|
6
|
+
render,
|
|
7
|
+
screen,
|
|
8
|
+
waitFor,
|
|
9
|
+
} from "@testing-library/react";
|
|
10
|
+
import { createRef } from "react";
|
|
11
|
+
import { expect, it, vi } from "vitest";
|
|
12
|
+
import { cellId } from "@/__tests__/branded";
|
|
13
|
+
import { useCellActionButtons } from "../../actions/useCellActionButton";
|
|
14
|
+
import {
|
|
15
|
+
CellActionsDropdown,
|
|
16
|
+
type CellActionsDropdownHandle,
|
|
17
|
+
} from "../cell-actions";
|
|
18
|
+
|
|
19
|
+
vi.mock("../../actions/useCellActionButton", () => ({
|
|
20
|
+
useCellActionButtons: vi.fn(),
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
it("builds actions only for the open cell and restores focus on dismissal", async () => {
|
|
24
|
+
HTMLElement.prototype.scrollIntoView = vi.fn();
|
|
25
|
+
const dropdown = createRef<CellActionsDropdownHandle>();
|
|
26
|
+
const select = vi.fn(() => document.activeElement);
|
|
27
|
+
vi.mocked(useCellActionButtons).mockReturnValue([
|
|
28
|
+
[{ label: "Run cell", handle: select }],
|
|
29
|
+
]);
|
|
30
|
+
render(
|
|
31
|
+
<>
|
|
32
|
+
{Array.from({ length: 20 }, (_, i) => (
|
|
33
|
+
<CellActionsDropdown
|
|
34
|
+
key={i}
|
|
35
|
+
ref={i === 7 ? dropdown : undefined}
|
|
36
|
+
cellId={cellId(String(i))}
|
|
37
|
+
name=""
|
|
38
|
+
config={{}}
|
|
39
|
+
status="idle"
|
|
40
|
+
blocked={false}
|
|
41
|
+
hasOutput={false}
|
|
42
|
+
hasConsoleOutput={false}
|
|
43
|
+
getEditorView={() => null}
|
|
44
|
+
showTooltip={false}
|
|
45
|
+
>
|
|
46
|
+
<button type="button">Actions {i}</button>
|
|
47
|
+
</CellActionsDropdown>
|
|
48
|
+
))}
|
|
49
|
+
</>,
|
|
50
|
+
);
|
|
51
|
+
expect(useCellActionButtons).not.toHaveBeenCalled();
|
|
52
|
+
|
|
53
|
+
const trigger = screen.getByRole("button", { name: "Actions 7" });
|
|
54
|
+
trigger.focus();
|
|
55
|
+
act(() => dropdown.current?.toggle());
|
|
56
|
+
const search = await screen.findByRole("combobox");
|
|
57
|
+
expect(search).toHaveFocus();
|
|
58
|
+
fireEvent.keyDown(search, { key: "Escape" });
|
|
59
|
+
await waitFor(() => expect(trigger).toHaveFocus());
|
|
60
|
+
expect(select).not.toHaveBeenCalled();
|
|
61
|
+
|
|
62
|
+
fireEvent.click(trigger);
|
|
63
|
+
fireEvent.click(await screen.findByRole("option", { name: "Run cell" }));
|
|
64
|
+
await waitFor(() => expect(select).toHaveBeenCalledTimes(1));
|
|
65
|
+
expect(select).toHaveReturnedWith(trigger);
|
|
66
|
+
expect(screen.queryByRole("dialog")).toBeNull();
|
|
67
|
+
expect(
|
|
68
|
+
new Set(
|
|
69
|
+
vi
|
|
70
|
+
.mocked(useCellActionButtons)
|
|
71
|
+
.mock.calls.map(([{ cell }]) => cell?.cellId),
|
|
72
|
+
),
|
|
73
|
+
).toEqual(new Set([cellId("7")]));
|
|
74
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { renderMinimalShortcut } from "@/components/shortcuts/renderShortcut";
|
|
4
|
+
import { Tooltip } from "@/components/ui/tooltip";
|
|
5
|
+
import type { ActionButton } from "../actions/types";
|
|
6
|
+
|
|
7
|
+
export function CellActionBody({ action }: { action: ActionButton }) {
|
|
8
|
+
const body = (
|
|
9
|
+
<div className="flex items-center flex-1">
|
|
10
|
+
{action.icon && (
|
|
11
|
+
<div className="mr-2 w-5 text-muted-foreground">{action.icon}</div>
|
|
12
|
+
)}
|
|
13
|
+
<div className="flex-1">{action.label}</div>
|
|
14
|
+
<div className="shrink-0 text-sm">
|
|
15
|
+
{action.hotkey && renderMinimalShortcut(action.hotkey)}
|
|
16
|
+
{action.rightElement}
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
return action.tooltip ? (
|
|
22
|
+
<Tooltip content={action.tooltip} delayDuration={100}>
|
|
23
|
+
{body}
|
|
24
|
+
</Tooltip>
|
|
25
|
+
) : (
|
|
26
|
+
body
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -13,10 +13,7 @@ import React, {
|
|
|
13
13
|
} from "react";
|
|
14
14
|
import useEvent from "react-use-event-hook";
|
|
15
15
|
import { getCellForDomProps } from "@/components/data-table/cell-utils";
|
|
16
|
-
import {
|
|
17
|
-
renderMinimalShortcut,
|
|
18
|
-
renderShortcut,
|
|
19
|
-
} from "@/components/shortcuts/renderShortcut";
|
|
16
|
+
import { renderShortcut } from "@/components/shortcuts/renderShortcut";
|
|
20
17
|
import {
|
|
21
18
|
Command,
|
|
22
19
|
CommandEmpty,
|
|
@@ -31,7 +28,6 @@ import {
|
|
|
31
28
|
PopoverTrigger,
|
|
32
29
|
} from "@/components/ui/popover";
|
|
33
30
|
import {
|
|
34
|
-
Tooltip,
|
|
35
31
|
TooltipContent,
|
|
36
32
|
TooltipRoot,
|
|
37
33
|
TooltipTrigger,
|
|
@@ -45,6 +41,7 @@ import {
|
|
|
45
41
|
useCellActionButtons,
|
|
46
42
|
} from "../actions/useCellActionButton";
|
|
47
43
|
import { raf2 } from "../navigation/focus-utils";
|
|
44
|
+
import { CellActionBody } from "./cell-action-body";
|
|
48
45
|
|
|
49
46
|
interface Props extends CellActionButtonProps {
|
|
50
47
|
children: React.ReactNode;
|
|
@@ -61,14 +58,7 @@ const CellActionsDropdownInternal = (
|
|
|
61
58
|
) => {
|
|
62
59
|
const [open, setOpen] = useState(false);
|
|
63
60
|
const pendingAction = useRef<(() => void) | null>(null);
|
|
64
|
-
const closePopover = () => setOpen(false);
|
|
65
61
|
const buttonRef = useRef<HTMLButtonElement>(null);
|
|
66
|
-
const actions = useCellActionButtons({ cell: props, closePopover });
|
|
67
|
-
|
|
68
|
-
const visibleActions = actions
|
|
69
|
-
.map((group) => group.filter((action) => !action.redundant))
|
|
70
|
-
.filter((group) => group.length > 0);
|
|
71
|
-
|
|
72
62
|
// store the last focused element so we can restore it when the popover closes
|
|
73
63
|
const restoreFocus = useRestoreFocus();
|
|
74
64
|
|
|
@@ -119,66 +109,13 @@ const CellActionsDropdownInternal = (
|
|
|
119
109
|
}
|
|
120
110
|
}}
|
|
121
111
|
>
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
<CommandEmpty>No results</CommandEmpty>
|
|
130
|
-
{visibleActions.map((group, i) => (
|
|
131
|
-
<Fragment key={i}>
|
|
132
|
-
<CommandGroup key={i}>
|
|
133
|
-
{group.map((action) => {
|
|
134
|
-
let body = (
|
|
135
|
-
<div className="flex items-center flex-1">
|
|
136
|
-
{action.icon && (
|
|
137
|
-
<div className="mr-2 w-5 text-muted-foreground">
|
|
138
|
-
{action.icon}
|
|
139
|
-
</div>
|
|
140
|
-
)}
|
|
141
|
-
<div className="flex-1">{action.label}</div>
|
|
142
|
-
<div className="shrink-0 text-sm">
|
|
143
|
-
{action.hotkey && renderMinimalShortcut(action.hotkey)}
|
|
144
|
-
{action.rightElement}
|
|
145
|
-
</div>
|
|
146
|
-
</div>
|
|
147
|
-
);
|
|
148
|
-
|
|
149
|
-
if (action.tooltip) {
|
|
150
|
-
body = (
|
|
151
|
-
<Tooltip content={action.tooltip} delayDuration={100}>
|
|
152
|
-
{body}
|
|
153
|
-
</Tooltip>
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
return (
|
|
158
|
-
<CommandItem
|
|
159
|
-
key={action.label}
|
|
160
|
-
// Disable with classname instead of disabled prop
|
|
161
|
-
// otherwise the tooltip doesn't work
|
|
162
|
-
className={cn(action.disabled && "opacity-50!")}
|
|
163
|
-
onSelect={() => {
|
|
164
|
-
if (action.disableClick || action.disabled) {
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
pendingAction.current = action.handle;
|
|
168
|
-
setOpen(false);
|
|
169
|
-
}}
|
|
170
|
-
variant={action.variant}
|
|
171
|
-
>
|
|
172
|
-
{body}
|
|
173
|
-
</CommandItem>
|
|
174
|
-
);
|
|
175
|
-
})}
|
|
176
|
-
</CommandGroup>
|
|
177
|
-
{i < visibleActions.length - 1 && <CommandSeparator />}
|
|
178
|
-
</Fragment>
|
|
179
|
-
))}
|
|
180
|
-
</CommandList>
|
|
181
|
-
</Command>
|
|
112
|
+
<CellActionsCommand
|
|
113
|
+
cell={props}
|
|
114
|
+
closePopover={(action) => {
|
|
115
|
+
pendingAction.current = action ?? null;
|
|
116
|
+
setOpen(false);
|
|
117
|
+
}}
|
|
118
|
+
/>
|
|
182
119
|
</PopoverContent>
|
|
183
120
|
);
|
|
184
121
|
|
|
@@ -213,6 +150,57 @@ const CellActionsDropdownInternal = (
|
|
|
213
150
|
);
|
|
214
151
|
};
|
|
215
152
|
|
|
153
|
+
function CellActionsCommand({
|
|
154
|
+
cell,
|
|
155
|
+
closePopover,
|
|
156
|
+
}: {
|
|
157
|
+
cell: CellActionButtonProps;
|
|
158
|
+
closePopover: (action?: () => void) => void;
|
|
159
|
+
}) {
|
|
160
|
+
const actions = useCellActionButtons({ cell, closePopover });
|
|
161
|
+
|
|
162
|
+
const visibleActions = actions
|
|
163
|
+
.map((group) => group.filter((action) => !action.redundant))
|
|
164
|
+
.filter((group) => group.length > 0);
|
|
165
|
+
|
|
166
|
+
return (
|
|
167
|
+
<Command>
|
|
168
|
+
<CommandInput
|
|
169
|
+
placeholder="Search actions..."
|
|
170
|
+
className="h-6 m-1"
|
|
171
|
+
{...getCellForDomProps(cell.cellId)}
|
|
172
|
+
/>
|
|
173
|
+
<CommandList>
|
|
174
|
+
<CommandEmpty>No results</CommandEmpty>
|
|
175
|
+
{visibleActions.map((group, i) => (
|
|
176
|
+
<Fragment key={i}>
|
|
177
|
+
<CommandGroup key={i}>
|
|
178
|
+
{group.map((action) => (
|
|
179
|
+
<CommandItem
|
|
180
|
+
key={action.label}
|
|
181
|
+
// Disable with classname instead of disabled prop
|
|
182
|
+
// otherwise the tooltip doesn't work
|
|
183
|
+
className={cn(action.disabled && "opacity-50!")}
|
|
184
|
+
onSelect={() => {
|
|
185
|
+
if (action.disableClick || action.disabled) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
closePopover(action.handle);
|
|
189
|
+
}}
|
|
190
|
+
variant={action.variant}
|
|
191
|
+
>
|
|
192
|
+
<CellActionBody action={action} />
|
|
193
|
+
</CommandItem>
|
|
194
|
+
))}
|
|
195
|
+
</CommandGroup>
|
|
196
|
+
{i < visibleActions.length - 1 && <CommandSeparator />}
|
|
197
|
+
</Fragment>
|
|
198
|
+
))}
|
|
199
|
+
</CommandList>
|
|
200
|
+
</Command>
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
|
|
216
204
|
export const CellActionsDropdown = React.memo(
|
|
217
205
|
React.forwardRef(CellActionsDropdownInternal),
|
|
218
206
|
);
|