@marimo-team/islands 0.26.1-dev30 → 0.26.1-dev32
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/{ErrorBoundary-BsbtzE4_.js → ErrorBoundary-DNNIFuTM.js} +1 -1
- package/dist/{code-visibility-XN_3KbPf.js → code-visibility-YkZwgZG-.js} +1 -1
- package/dist/{common-LxQtzU-2.js → common-DzcBVc1n.js} +1 -1
- package/dist/{data-grid-overlay-editor-DOgicOan.js → data-grid-overlay-editor-CwD8iv-7.js} +1 -1
- package/dist/{feedback-button-Bdpv5VWt.js → feedback-button-CKqqu90c.js} +2 -2
- package/dist/{glide-data-editor-CZTp4A6s.js → glide-data-editor-DR6q02yS.js} +3 -3
- package/dist/{globals-CI6U88UW.js → globals-u2po2Pmw.js} +1 -1
- package/dist/main.js +7 -7
- package/dist/{number-overlay-editor-D8MSe8ZJ.js → number-overlay-editor-BGGm1yGE.js} +1 -1
- package/dist/{reveal-component-CNHAgCQ4.js → reveal-component-DHtY4cDL.js} +2 -2
- package/package.json +1 -1
- package/src/components/editor/chrome/panels/__tests__/secrets-panel.test.tsx +57 -0
- package/src/components/editor/chrome/panels/secrets-panel.tsx +36 -9
- package/src/components/editor/chrome/panels/secrets-utils.ts +20 -0
- package/src/plugins/impl/TextInputPlugin.tsx +2 -1
- package/src/plugins/impl/__test__/text-labels.test.tsx +46 -1
|
@@ -148,7 +148,7 @@ function L(e) {
|
|
|
148
148
|
}
|
|
149
149
|
//#endregion
|
|
150
150
|
//#region src/components/editor/boundary/ErrorBoundary.tsx
|
|
151
|
-
var R = (0, T.lazy)(() => import("./feedback-button-
|
|
151
|
+
var R = (0, T.lazy)(() => import("./feedback-button-CKqqu90c.js").then((e) => ({ default: e.FeedbackModal }))), z = (e) => {
|
|
152
152
|
let t = (0, w.c)(2), n;
|
|
153
153
|
return t[0] === e.children ? n = t[1] : (n = /* @__PURE__ */ (0, N.jsx)(O, {
|
|
154
154
|
FallbackComponent: B,
|
|
@@ -14,7 +14,7 @@ function y() {
|
|
|
14
14
|
return e.warn("Failed to get version from mount config"), null;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
var b = y() || "0.26.1-
|
|
17
|
+
var b = y() || "0.26.1-dev32", x = s(b), S = s(!0);
|
|
18
18
|
s(null);
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/core/wasm/state.ts
|
|
@@ -33,7 +33,7 @@ import { a as ya, i as ba, n as xa, o as Sa, r as Ca, t as wa } from "./dialog-v
|
|
|
33
33
|
import { o as Ta } from "./dist-BG-7Qpaj.js";
|
|
34
34
|
import { t as Ea } from "./useAsyncData-P5-Oovhq.js";
|
|
35
35
|
import { n as W, t as G } from "./objectWithoutPropertiesLoose-BRDcTsfB.js";
|
|
36
|
-
import { n as Da, t as Oa } from "./ErrorBoundary-
|
|
36
|
+
import { n as Da, t as Oa } from "./ErrorBoundary-DNNIFuTM.js";
|
|
37
37
|
import { W as ka, n as Aa } from "./vega-loader.browser-Co9gYE8Z.js";
|
|
38
38
|
import { a as ja, n as Ma, r as Na, t as Pa } from "./loader-qPmiRXZd.js";
|
|
39
39
|
import { t as Fa } from "./useIframeCapabilities-_0KX0nu_.js";
|
|
@@ -2,7 +2,7 @@ import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
|
|
|
2
2
|
import { t } from "./react-Bgs_wQh3.js";
|
|
3
3
|
import { t as n } from "./react-dom-DdqGVp5N.js";
|
|
4
4
|
import { c as r, l as i, u as a } from "./data-grid-types-DBNnjiYJ.js";
|
|
5
|
-
import { a as o, i as s, n as c, r as l } from "./glide-data-editor-
|
|
5
|
+
import { a as o, i as s, n as c, r as l } from "./glide-data-editor-DR6q02yS.js";
|
|
6
6
|
//#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/data-grid-overlay-editor-style.js
|
|
7
7
|
var u = /* @__PURE__ */ e(t(), 1), d = /* @__PURE__ */ e(n(), 1), f = /*#__PURE__*/ o("div")({
|
|
8
8
|
name: "DataGridOverlayEditorStyle",
|
|
@@ -4,13 +4,13 @@ import { t as r } from "./react-Bgs_wQh3.js";
|
|
|
4
4
|
import { t as i } from "./compiler-runtime-C5KHtL5D.js";
|
|
5
5
|
import { t as a } from "./copy-icon-rYV2znAe.js";
|
|
6
6
|
import { $t as o, A as s, L as c, Y as l, i as u, in as d, j as f, n as p, z as m } from "./error-entries-DFHEq_SO.js";
|
|
7
|
-
import { n as h, t as ee } from "./globals-
|
|
7
|
+
import { n as h, t as ee } from "./globals-u2po2Pmw.js";
|
|
8
8
|
import { r as g } from "./assertNever-BHnIohkX.js";
|
|
9
9
|
import { t as _ } from "./jsx-runtime-D8btoEHk.js";
|
|
10
10
|
import { Bt as v, Ct as te, m as y } from "./use-restore-focus-ocw7t85i.js";
|
|
11
11
|
import { a as ne, i as re, n as ie, r as ae } from "./dialog-vs6x3On9.js";
|
|
12
12
|
import { t as oe } from "./useAsyncData-P5-Oovhq.js";
|
|
13
|
-
import { t as se } from "./code-visibility-
|
|
13
|
+
import { t as se } from "./code-visibility-YkZwgZG-.js";
|
|
14
14
|
//#region src/components/ui/skeleton.tsx
|
|
15
15
|
var b = /* @__PURE__ */ e(r(), 1), x = i(), S = _(), ce = (e) => {
|
|
16
16
|
let n = (0, x.c)(8), r, i;
|
|
@@ -14,7 +14,7 @@ import { t as F } from "./jsx-runtime-D8btoEHk.js";
|
|
|
14
14
|
import { d as ae, r as I } from "./use-restore-focus-ocw7t85i.js";
|
|
15
15
|
import { t as oe } from "./useEvent-BoN7U38T.js";
|
|
16
16
|
import { n as L, t as se } from "./objectWithoutPropertiesLoose-BRDcTsfB.js";
|
|
17
|
-
import { t as ce } from "./ErrorBoundary-
|
|
17
|
+
import { t as ce } from "./ErrorBoundary-DNNIFuTM.js";
|
|
18
18
|
import { A as le, C as ue, D as de, E as fe, F as pe, I as me, L as he, M as ge, N as R, O as z, P as _e, R as ve, S as ye, T as be, _ as xe, a as Se, b as B, c as Ce, d as we, f as V, g as Te, h as Ee, i as De, j as H, k as Oe, l as ke, m as Ae, n as je, o as Me, p as Ne, r as U, s as Pe, t as Fe, u as Ie, v as Le, w as Re, x as ze, y as Be, z as Ve } from "./data-grid-types-DBNnjiYJ.js";
|
|
19
19
|
//#region ../node_modules/.pnpm/@emotion+memoize@0.9.0/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
|
|
20
20
|
function He(e) {
|
|
@@ -7061,7 +7061,7 @@ function ds(e, t, n, r, i) {
|
|
|
7061
7061
|
}
|
|
7062
7062
|
//#endregion
|
|
7063
7063
|
//#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/data-editor/data-editor.js
|
|
7064
|
-
var fs = /* @__PURE__ */ e(Tr(), 1), ps = /* @__PURE__ */ e(kr(), 1), ms = W.lazy(async () => await import("./data-grid-overlay-editor-
|
|
7064
|
+
var fs = /* @__PURE__ */ e(Tr(), 1), ps = /* @__PURE__ */ e(kr(), 1), ms = W.lazy(async () => await import("./data-grid-overlay-editor-CwD8iv-7.js")), hs = 0;
|
|
7065
7065
|
function gs(e) {
|
|
7066
7066
|
return (0, fs.default)((0, ps.default)((0, ps.default)(e).filter((e) => e.span !== void 0).map((e) => (0, ao.default)((e.span?.[0] ?? 0) + 1, (e.span?.[1] ?? 0) + 1))));
|
|
7067
7067
|
}
|
|
@@ -9284,7 +9284,7 @@ function Ys(e, t, n, r, i) {
|
|
|
9284
9284
|
}
|
|
9285
9285
|
//#endregion
|
|
9286
9286
|
//#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/cells/number-cell.js
|
|
9287
|
-
var Xs = W.lazy(async () => await import("./number-overlay-editor-
|
|
9287
|
+
var Xs = W.lazy(async () => await import("./number-overlay-editor-BGGm1yGE.js")), Zs = {
|
|
9288
9288
|
getAccessibilityString: (e) => e.data?.toString() ?? "",
|
|
9289
9289
|
kind: U.Number,
|
|
9290
9290
|
needsHover: (e) => e.hoverEffect === !0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h as e } from "./tooltip-DSWC_Td_.js";
|
|
2
2
|
import { Ct as t } from "./use-restore-focus-ocw7t85i.js";
|
|
3
|
-
import { r as n } from "./code-visibility-
|
|
3
|
+
import { r as n } from "./code-visibility-YkZwgZG-.js";
|
|
4
4
|
var r = e("triangle-alert", [
|
|
5
5
|
["path", {
|
|
6
6
|
d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
|
package/dist/main.js
CHANGED
|
@@ -6,7 +6,7 @@ import { i as x, n as S, r as C, t as w } from "./copy-icon-rYV2znAe.js";
|
|
|
6
6
|
import { B as T, Bt as E, Ct as D, E as O, F as k, Ft as A, I as j, It as M, J as N, L as P, Lt as F, M as I, Mt as L, O as R, Ot as z, P as B, R as ee, Rt as te, Ut as ne, Vt as re, Wt as ie, Y as ae, _ as oe, a as se, at as ce, b as le, bt as ue, c as de, ct as fe, ft as pe, ht as me, i as he, it as ge, j as _e, kt as ve, lt as ye, mt as be, n as xe, nt as Se, o as Ce, ot as we, pt as Te, tt as Ee, ut as De, vt as Oe, xt as ke, z as Ae, zt as je } from "./html-to-image-D6Gtk5ik.js";
|
|
7
7
|
import { a as Me, f as Ne, h as Pe, i as Fe, m as Ie, n as Le, o as Re, r as ze, t as Be } from "./tooltip-DSWC_Td_.js";
|
|
8
8
|
import { D as Ve, E as He, S as Ue, T as We, _ as Ge, a as Ke, c as qe, d as Je, f as Ye, g as Xe, h as Ze, i as Qe, l as $e, m as et, n as tt, o as nt, p as rt, r as it, s as at, t as ot, u as st, v as ct, w as lt, x as ut, y as dt } from "./spec-C4uOz0Em.js";
|
|
9
|
-
import { $ as ft, $t as pt, A as mt, An as ht, At as gt, B as _t, Bt as vt, C as yt, D as bt, Dn as xt, Dt as St, E as Ct, En as wt, Et as Tt, F as Et, Ft as Dt, G as Ot, Gt as kt, H as At, Ht as jt, I as Mt, It as Nt, J as Pt, Jt as Ft, K as It, Kt as Lt, L as Rt, Lt as zt, M as Bt, Mn as Vt, Mt as Ht, N as Ut, Nt as Wt, O as Gt, On as Kt, Ot as qt, P as Jt, Pt as Yt, Q as Xt, Qt as Zt, R as Qt, Rt as $t, S as en, Sn as tn, St as nn, T as rn, Tn as an, Tt as on, U as sn, Ut as cn, V as ln, Vt as un, W as dn, Wt as fn, X as pn, Xt as mn, Y as hn, Yt as gn, Z as _n, Zt as vn, _ as yn, _n as bn, _t as xn, an as Sn, at as Cn, b as wn, bn as Tn, bt as En, c as Dn, cn as On, ct as kn, d as An, dn as jn, dt as Mn, en as Nn, f as Pn, fn as Fn, ft as In, g as Ln, gn as Rn, gt as zn, h as Bn, hn as Vn, ht as Hn, in as Un, it as Wn, j as Gn, jn as Kn, jt as qn, k as Jn, kn as Yn, kt as Xn, ln as Zn, lt as Qn, m as $n, mn as er, mt as tr, nn as nr, on as rr, ot as ir, p as ar, pn as or, pt as sr, q as cr, qt as lr, r as ur, rn as dr, rt as fr, sn as pr, st as mr, t as hr, tn as gr, u as _r, un as vr, ut as yr, v as br, vn as xr, vt as Sr, w as Cr, wn as wr, x as Tr, xn as Er, xt as Dr, y as Or, yn as kr, yt as Ar, z as jr, zt as Mr } from "./common-
|
|
9
|
+
import { $ as ft, $t as pt, A as mt, An as ht, At as gt, B as _t, Bt as vt, C as yt, D as bt, Dn as xt, Dt as St, E as Ct, En as wt, Et as Tt, F as Et, Ft as Dt, G as Ot, Gt as kt, H as At, Ht as jt, I as Mt, It as Nt, J as Pt, Jt as Ft, K as It, Kt as Lt, L as Rt, Lt as zt, M as Bt, Mn as Vt, Mt as Ht, N as Ut, Nt as Wt, O as Gt, On as Kt, Ot as qt, P as Jt, Pt as Yt, Q as Xt, Qt as Zt, R as Qt, Rt as $t, S as en, Sn as tn, St as nn, T as rn, Tn as an, Tt as on, U as sn, Ut as cn, V as ln, Vt as un, W as dn, Wt as fn, X as pn, Xt as mn, Y as hn, Yt as gn, Z as _n, Zt as vn, _ as yn, _n as bn, _t as xn, an as Sn, at as Cn, b as wn, bn as Tn, bt as En, c as Dn, cn as On, ct as kn, d as An, dn as jn, dt as Mn, en as Nn, f as Pn, fn as Fn, ft as In, g as Ln, gn as Rn, gt as zn, h as Bn, hn as Vn, ht as Hn, in as Un, it as Wn, j as Gn, jn as Kn, jt as qn, k as Jn, kn as Yn, kt as Xn, ln as Zn, lt as Qn, m as $n, mn as er, mt as tr, nn as nr, on as rr, ot as ir, p as ar, pn as or, pt as sr, q as cr, qt as lr, r as ur, rn as dr, rt as fr, sn as pr, st as mr, t as hr, tn as gr, u as _r, un as vr, ut as yr, v as br, vn as xr, vt as Sr, w as Cr, wn as wr, x as Tr, xn as Er, xt as Dr, y as Or, yn as kr, yt as Ar, z as jr, zt as Mr } from "./common-DzcBVc1n.js";
|
|
10
10
|
import { a as Nr, n as Pr, s as Fr, t as Ir } from "./useLifecycle-CCV7yZ-v.js";
|
|
11
11
|
import { t as Lr } from "./check-LtjuWmNn.js";
|
|
12
12
|
import { A as Rr, C as zr, D as Br, M as Vr, O as Hr, a as Ur, c as Wr, d as Gr, i as Kr, k as qr, l as Jr, n as Yr, o as Xr, r as Zr, s as Qr, t as $r, w as ei, x as ti } from "./select-CKLRKIzB.js";
|
|
@@ -16,7 +16,7 @@ import { $t as Ui, A as Wi, At as Gi, C as Ki, Ct as qi, Dt as Ji, Ft as Yi, H a
|
|
|
16
16
|
import { a as Na, d as Pa, i as Fa, n as Ia, o as La, r as Ra, s as za, t as Ba, u as Va } from "./process-output-ZBdibqlG.js";
|
|
17
17
|
import { t as Ha } from "./pencil-AWgwbH4D.js";
|
|
18
18
|
import { a as Ua, c as Wa, d as Ga, f as Ka, i as qa, l as Ja, r as Ya } from "./glide-utils-CZ-O-CB_.js";
|
|
19
|
-
import { n as Xa, t as Za } from "./globals-
|
|
19
|
+
import { n as Xa, t as Za } from "./globals-u2po2Pmw.js";
|
|
20
20
|
import { a as Qa, i as $a, n as eo, r as to, s as no, t as ro } from "./assertNever-BHnIohkX.js";
|
|
21
21
|
import { t as io } from "./react-dom-DdqGVp5N.js";
|
|
22
22
|
import { t as ao } from "./jsx-runtime-D8btoEHk.js";
|
|
@@ -40,10 +40,10 @@ import { i as ic } from "./dist-BG-7Qpaj.js";
|
|
|
40
40
|
import { p as ac } from "./dist-BidYR5m4.js";
|
|
41
41
|
import { t as oc } from "./useAsyncData-P5-Oovhq.js";
|
|
42
42
|
import { n as sc, r as cc, t as lc } from "./useDeepCompareMemoize-BsaXfZ8C.js";
|
|
43
|
-
import { t as uc } from "./ErrorBoundary-
|
|
43
|
+
import { t as uc } from "./ErrorBoundary-DNNIFuTM.js";
|
|
44
44
|
import { G as dc, W as fc } from "./vega-loader.browser-Co9gYE8Z.js";
|
|
45
45
|
import { a as pc, n as mc } from "./loader-qPmiRXZd.js";
|
|
46
|
-
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-
|
|
46
|
+
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-YkZwgZG-.js";
|
|
47
47
|
import { t as Sc } from "./esm-DY8dGAjJ.js";
|
|
48
48
|
//#region ../node_modules/.pnpm/iconify-icon@2.3.0/node_modules/iconify-icon/dist/iconify-icon.mjs
|
|
49
49
|
var Cc = Object.freeze({
|
|
@@ -13027,7 +13027,7 @@ function BO(e, t) {
|
|
|
13027
13027
|
}
|
|
13028
13028
|
//#endregion
|
|
13029
13029
|
//#region src/plugins/impl/DataEditorPlugin.tsx
|
|
13030
|
-
var VO = J.lazy(() => import("./glide-data-editor-
|
|
13030
|
+
var VO = J.lazy(() => import("./glide-data-editor-DR6q02yS.js").then((e) => e.t)), HO = SD("marimo-data-editor", { cssStyles: [GD, KD] }).withData(G({
|
|
13031
13031
|
initialValue: G({ edits: V(G({
|
|
13032
13032
|
rowIdx: W(),
|
|
13033
13033
|
columnId: K(),
|
|
@@ -24398,7 +24398,7 @@ var lL = class {
|
|
|
24398
24398
|
t[3] === i ? f = t[4] : (f = i ? () => {
|
|
24399
24399
|
o.current = !0;
|
|
24400
24400
|
} : void 0, t[3] = i, t[4] = f);
|
|
24401
|
-
let p = f, [m, h] = (0, J.useState)(e.value), g =
|
|
24401
|
+
let p = f, [m, h] = (0, J.useState)(e.value), g = e.debounce === !0 ? s : m, _;
|
|
24402
24402
|
t[5] !== e.kind || t[6] !== g ? (_ = mL(e.kind, g), t[5] = e.kind, t[6] = g, t[7] = _) : _ = t[7];
|
|
24403
24403
|
let v = _, y;
|
|
24404
24404
|
t[8] === Symbol.for("react.memo_cache_sentinel") ? (y = {
|
|
@@ -32750,7 +32750,7 @@ function UU(e) {
|
|
|
32750
32750
|
}
|
|
32751
32751
|
//#endregion
|
|
32752
32752
|
//#region src/components/editor/renderers/slides-layout/slides-layout.tsx
|
|
32753
|
-
var WU = J.lazy(() => import("./reveal-component-
|
|
32753
|
+
var WU = J.lazy(() => import("./reveal-component-DHtY4cDL.js")), GU = (e) => {
|
|
32754
32754
|
let t = (0, X.c)(33), { layout: n, setLayout: r, cells: i, mode: a } = e, o = uo(Gs), s = a === "read" || o, c = uo(wa) > 1, [l, u] = (0, J.useState)(null), d;
|
|
32755
32755
|
t[0] !== i || t[1] !== n ? (d = Vz(i, n), t[0] = i, t[1] = n, t[2] = d) : d = t[2];
|
|
32756
32756
|
let { slideCells: f, skippedIds: p, noOutputIds: m, slideTypes: h, startCellIndex: g } = d, _;
|
|
@@ -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-DR6q02yS.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",
|
|
@@ -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-DSWC_Td_.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-DzcBVc1n.js";
|
|
7
7
|
import { M as w } from "./select-CKLRKIzB.js";
|
|
8
8
|
import { X as T } from "./dropdown-menu-D65ZUqka.js";
|
|
9
9
|
import { t as E } from "./jsx-runtime-D8btoEHk.js";
|
|
10
10
|
import { Bt as D, Ut as O, f as k, i as ee } from "./use-restore-focus-ocw7t85i.js";
|
|
11
11
|
import { t as A } from "./useEvent-BoN7U38T.js";
|
|
12
12
|
import { o as te } from "./static-state-DZ1nSa6e.js";
|
|
13
|
-
import { n as ne, t as re } from "./code-visibility-
|
|
13
|
+
import { n as ne, t as re } from "./code-visibility-YkZwgZG-.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,57 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
import { fireEvent, render, screen } from "@testing-library/react";
|
|
3
|
+
import { describe, expect, it, vi } from "vitest";
|
|
4
|
+
import { ModalProvider } from "@/components/modal/ImperativeModal";
|
|
5
|
+
import type { ListSecretKeysResponse } from "@/core/network/types";
|
|
6
|
+
import SecretsPanel from "../secrets-panel";
|
|
7
|
+
import { filterSecretKeys } from "../secrets-utils";
|
|
8
|
+
|
|
9
|
+
const { providers } = vi.hoisted(() => {
|
|
10
|
+
const providers: ListSecretKeysResponse["keys"] = [
|
|
11
|
+
{ name: ".env", provider: "dotenv", keys: ["OPENAI_API_KEY", "DB_URL"] },
|
|
12
|
+
{ name: "Environment", provider: "env", keys: ["HOME", "OPENAI_ORG"] },
|
|
13
|
+
];
|
|
14
|
+
return { providers };
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
vi.mock("@/core/secrets/request-registry", () => ({
|
|
18
|
+
SECRETS_REGISTRY: {
|
|
19
|
+
request: vi.fn(async () => ({ secrets: providers })),
|
|
20
|
+
},
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
describe("filterSecretKeys", () => {
|
|
24
|
+
it("returns all providers for an empty or blank search", () => {
|
|
25
|
+
expect(filterSecretKeys(providers, "")).toEqual(providers);
|
|
26
|
+
expect(filterSecretKeys(providers, " ")).toEqual(providers);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("matches part of a key, ignoring case and surrounding spaces, and drops providers with no match", () => {
|
|
30
|
+
expect(filterSecretKeys(providers, " url ")).toEqual([
|
|
31
|
+
{ name: ".env", provider: "dotenv", keys: ["DB_URL"] },
|
|
32
|
+
]);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe("SecretsPanel", () => {
|
|
37
|
+
it("filters the table as the user types", async () => {
|
|
38
|
+
render(
|
|
39
|
+
<ModalProvider>
|
|
40
|
+
<SecretsPanel />
|
|
41
|
+
</ModalProvider>,
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const search = await screen.findByRole("textbox", {
|
|
45
|
+
name: "Search environment variables",
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
fireEvent.change(search, { target: { value: "openai" } });
|
|
49
|
+
expect(screen.getByText("OPENAI_API_KEY")).toBeInTheDocument();
|
|
50
|
+
expect(screen.getByText("OPENAI_ORG")).toBeInTheDocument();
|
|
51
|
+
expect(screen.queryByText("DB_URL")).not.toBeInTheDocument();
|
|
52
|
+
expect(screen.queryByText("HOME")).not.toBeInTheDocument();
|
|
53
|
+
|
|
54
|
+
fireEvent.change(search, { target: { value: "missing" } });
|
|
55
|
+
expect(screen.getByText("No results")).toBeInTheDocument();
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -6,6 +6,7 @@ import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels";
|
|
|
6
6
|
import { Spinner } from "@/components/icons/spinner";
|
|
7
7
|
import { useImperativeModal } from "@/components/modal/ImperativeModal";
|
|
8
8
|
import { Badge } from "@/components/ui/badge";
|
|
9
|
+
import { SearchInput } from "@/components/ui/input";
|
|
9
10
|
import {
|
|
10
11
|
Table,
|
|
11
12
|
TableBody,
|
|
@@ -21,10 +22,12 @@ import { ErrorBanner } from "@/plugins/impl/common/error-banner";
|
|
|
21
22
|
import { cn } from "@/utils/cn";
|
|
22
23
|
import { copyToClipboard } from "@/utils/copy";
|
|
23
24
|
import { PanelEmptyState } from "./empty-state";
|
|
25
|
+
import { filterSecretKeys } from "./secrets-utils";
|
|
24
26
|
import { sortProviders, WriteSecretModal } from "./write-secret-modal";
|
|
25
27
|
|
|
26
28
|
const SecretsPanel: React.FC = () => {
|
|
27
29
|
const { openModal, closeModal } = useImperativeModal();
|
|
30
|
+
const [search, setSearch] = React.useState("");
|
|
28
31
|
const {
|
|
29
32
|
data: secretKeyProviders,
|
|
30
33
|
isPending,
|
|
@@ -59,15 +62,25 @@ const SecretsPanel: React.FC = () => {
|
|
|
59
62
|
);
|
|
60
63
|
}
|
|
61
64
|
|
|
65
|
+
const filteredProviders = filterSecretKeys(secretKeyProviders, search);
|
|
66
|
+
|
|
62
67
|
return (
|
|
63
68
|
<PanelGroup direction="horizontal" className="h-full">
|
|
64
69
|
<Panel defaultSize={50} minSize={30} maxSize={80}>
|
|
65
70
|
<div className="flex flex-col h-full">
|
|
66
|
-
<div className="flex
|
|
71
|
+
<div className="flex items-center h-8 border-b">
|
|
72
|
+
<SearchInput
|
|
73
|
+
placeholder="Search environment variables..."
|
|
74
|
+
aria-label="Search environment variables"
|
|
75
|
+
className="h-6 min-w-0"
|
|
76
|
+
rootClassName="flex-1 min-w-0 h-full border-b-0 border-r"
|
|
77
|
+
value={search}
|
|
78
|
+
onChange={(e) => setSearch(e.target.value)}
|
|
79
|
+
/>
|
|
67
80
|
<button
|
|
68
81
|
type="button"
|
|
69
82
|
aria-label="Add environment variable"
|
|
70
|
-
className="
|
|
83
|
+
className="shrink-0 px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground"
|
|
71
84
|
onClick={() =>
|
|
72
85
|
openModal(
|
|
73
86
|
<WriteSecretModal
|
|
@@ -84,23 +97,37 @@ const SecretsPanel: React.FC = () => {
|
|
|
84
97
|
<PlusIcon className="h-4 w-4" />
|
|
85
98
|
</button>
|
|
86
99
|
</div>
|
|
87
|
-
<Table className="overflow-auto flex-1 mb-16">
|
|
100
|
+
<Table className="table-fixed overflow-auto flex-1 mb-16">
|
|
88
101
|
<TableHeader>
|
|
89
102
|
<TableRow>
|
|
90
103
|
<TableHead>Environment Variable</TableHead>
|
|
91
|
-
<TableHead>Source</TableHead>
|
|
92
|
-
<TableHead />
|
|
104
|
+
<TableHead className="w-1/4">Source</TableHead>
|
|
105
|
+
<TableHead className="w-10" />
|
|
93
106
|
</TableRow>
|
|
94
107
|
</TableHeader>
|
|
95
108
|
<TableBody>
|
|
96
|
-
{
|
|
109
|
+
{filteredProviders.length === 0 && (
|
|
110
|
+
<TableRow>
|
|
111
|
+
<TableCell
|
|
112
|
+
colSpan={3}
|
|
113
|
+
className="text-center text-muted-foreground"
|
|
114
|
+
>
|
|
115
|
+
No results
|
|
116
|
+
</TableCell>
|
|
117
|
+
</TableRow>
|
|
118
|
+
)}
|
|
119
|
+
{filteredProviders.map((provider) => {
|
|
97
120
|
return provider.keys.map((key) => (
|
|
98
121
|
<TableRow key={`${provider.name}-${key}`} className="group">
|
|
99
|
-
<TableCell>{key}</TableCell>
|
|
122
|
+
<TableCell className="break-all">{key}</TableCell>
|
|
100
123
|
<TableCell>
|
|
101
124
|
{provider.provider !== "env" && (
|
|
102
|
-
<Badge
|
|
103
|
-
|
|
125
|
+
<Badge
|
|
126
|
+
variant="outline"
|
|
127
|
+
className="select-none max-w-full"
|
|
128
|
+
title={provider.name}
|
|
129
|
+
>
|
|
130
|
+
<span className="truncate">{provider.name}</span>
|
|
104
131
|
</Badge>
|
|
105
132
|
)}
|
|
106
133
|
</TableCell>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
import type { ListSecretKeysResponse } from "@/core/network/types";
|
|
3
|
+
|
|
4
|
+
type SecretKeyProviders = ListSecretKeysResponse["keys"];
|
|
5
|
+
|
|
6
|
+
export function filterSecretKeys(
|
|
7
|
+
providers: SecretKeyProviders,
|
|
8
|
+
search: string,
|
|
9
|
+
): SecretKeyProviders {
|
|
10
|
+
const query = search.trim().toLowerCase();
|
|
11
|
+
if (!query) {
|
|
12
|
+
return providers;
|
|
13
|
+
}
|
|
14
|
+
return providers
|
|
15
|
+
.map((provider) => ({
|
|
16
|
+
...provider,
|
|
17
|
+
keys: provider.keys.filter((key) => key.toLowerCase().includes(query)),
|
|
18
|
+
}))
|
|
19
|
+
.filter((provider) => provider.keys.length > 0);
|
|
20
|
+
}
|
|
@@ -100,7 +100,8 @@ const TextComponent = (props: TextComponentProps) => {
|
|
|
100
100
|
: undefined;
|
|
101
101
|
|
|
102
102
|
const [valueOnBlur, setValueOnBlur] = useState(props.value);
|
|
103
|
-
|
|
103
|
+
// With debounce=true, the value only changes on blur or Enter.
|
|
104
|
+
const valueToValidate = props.debounce === true ? value : valueOnBlur;
|
|
104
105
|
const isValid = validate(props.kind, valueToValidate);
|
|
105
106
|
|
|
106
107
|
const icon: Record<InputType, JSX.Element | null> = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
import { act, fireEvent, render, screen } from "@testing-library/react";
|
|
3
|
-
import { expect, test, vi } from "vitest";
|
|
3
|
+
import { describe, expect, test, vi } from "vitest";
|
|
4
4
|
import type { IPlugin } from "../../types";
|
|
5
5
|
import { TextInputPlugin } from "../TextInputPlugin";
|
|
6
6
|
import { TextAreaPlugin } from "../TextAreaPlugin";
|
|
@@ -108,6 +108,51 @@ for (const kind of ["text", "password", "email", "url"] as const) {
|
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
describe("email validation with debounce=true", () => {
|
|
112
|
+
const plugin = new TextInputPlugin();
|
|
113
|
+
const props = (value: string) => ({
|
|
114
|
+
host: document.createElement("div"),
|
|
115
|
+
value,
|
|
116
|
+
setValue: vi.fn(),
|
|
117
|
+
functions: {},
|
|
118
|
+
data: plugin.validator.parse({
|
|
119
|
+
initialValue: "",
|
|
120
|
+
placeholder: "",
|
|
121
|
+
label: "Email",
|
|
122
|
+
kind: "email",
|
|
123
|
+
debounce: true,
|
|
124
|
+
}),
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
test("marks an invalid email once it is committed on blur", () => {
|
|
128
|
+
const { rerender } = render(plugin.render(props("")));
|
|
129
|
+
const control = screen.getByLabelText("Email");
|
|
130
|
+
fireEvent.change(control, { target: { value: "not-an-email" } });
|
|
131
|
+
fireEvent.blur(control);
|
|
132
|
+
rerender(plugin.render(props("not-an-email")));
|
|
133
|
+
expect(control).toHaveClass("border-destructive");
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
test("marks an invalid email once it is committed with Enter", () => {
|
|
137
|
+
const first = props("");
|
|
138
|
+
const { rerender } = render(plugin.render(first));
|
|
139
|
+
const control = screen.getByLabelText("Email");
|
|
140
|
+
fireEvent.change(control, { target: { value: "not-an-email" } });
|
|
141
|
+
fireEvent.keyDown(control, { key: "Enter" });
|
|
142
|
+
expect(first.setValue).toHaveBeenCalledWith("not-an-email");
|
|
143
|
+
rerender(plugin.render(props("not-an-email")));
|
|
144
|
+
expect(control).toHaveClass("border-destructive");
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
test("clears the error once the email is corrected", () => {
|
|
148
|
+
const { rerender } = render(plugin.render(props("not-an-email")));
|
|
149
|
+
const control = screen.getByLabelText("Email");
|
|
150
|
+
expect(control).toHaveClass("border-destructive");
|
|
151
|
+
rerender(plugin.render(props("me@example.com")));
|
|
152
|
+
expect(control).not.toHaveClass("border-destructive");
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
|
|
111
156
|
function testMultipleInstances<D>(plugin: IPlugin<string, D>) {
|
|
112
157
|
test(`${plugin.tagName} keeps repeated labels independently associated`, () => {
|
|
113
158
|
const props = {
|