@marimo-team/islands 0.25.3-dev46 → 0.25.3-dev48

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 (36) hide show
  1. package/dist/{ErrorBoundary-BWVs0-U9.js → ErrorBoundary-DHfwqB0K.js} +1 -1
  2. package/dist/{code-visibility-Dnpf43An.js → code-visibility-5llx6KCK.js} +1 -1
  3. package/dist/{common-C6wfOJsp.js → common-DBC1NAar.js} +89 -61
  4. package/dist/{data-grid-overlay-editor-CPTzwTJV.js → data-grid-overlay-editor-D01HzlXg.js} +1 -1
  5. package/dist/{feedback-button-B-CAcq1F.js → feedback-button-gTC25Y-p.js} +2 -2
  6. package/dist/{glide-data-editor-DOh16wcn.js → glide-data-editor-BXXphavz.js} +3 -3
  7. package/dist/{globals-C9VhYRAQ.js → globals-BcxqBRmX.js} +1 -1
  8. package/dist/main.js +1491 -1403
  9. package/dist/{number-overlay-editor-DDSvabGl.js → number-overlay-editor-CaspWg5p.js} +1 -1
  10. package/dist/{reveal-component-5Vf1xGy3.js → reveal-component-CWk_paD2.js} +2 -2
  11. package/package.json +1 -1
  12. package/src/components/chat/__tests__/message-queue.test.tsx +17 -0
  13. package/src/components/chat/chat-panel.tsx +3 -7
  14. package/src/components/chat/chat-utils.ts +4 -8
  15. package/src/components/data-table/__tests__/context-menu-interaction.test.tsx +130 -0
  16. package/src/components/data-table/context-menu.tsx +36 -20
  17. package/src/components/editor/cell/CreateCellButton.tsx +8 -10
  18. package/src/components/editor/cell/code/__tests__/language-toggle.test.tsx +54 -0
  19. package/src/components/editor/cell/code/cell-editor.tsx +1 -1
  20. package/src/components/editor/cell/code/language-toggle.tsx +8 -7
  21. package/src/components/editor/file-tree/file-viewer.tsx +4 -2
  22. package/src/components/editor/output/console/ConsoleOutput.tsx +8 -18
  23. package/src/components/slides/slide-cell-view.tsx +1 -1
  24. package/src/core/static/files.ts +2 -0
  25. package/src/hooks/useInputHistory.ts +4 -7
  26. package/src/hooks/useResizeObserver.ts +4 -7
  27. package/src/plugins/impl/anywidget/__tests__/registry.test.ts +2 -0
  28. package/src/plugins/impl/anywidget/__tests__/widget-binding.test.ts +241 -2
  29. package/src/plugins/impl/anywidget/runtime.ts +21 -9
  30. package/src/plugins/impl/anywidget/widget-binding.ts +160 -82
  31. package/src/plugins/impl/mpl-interactive/MplInteractivePlugin.tsx +5 -3
  32. package/src/plugins/impl/panel/PanelPlugin.tsx +15 -16
  33. package/src/plugins/impl/panel/__tests__/utils.test.ts +39 -1
  34. package/src/plugins/impl/panel/utils.ts +17 -0
  35. package/src/stories/__tests__/editor-story.test.tsx +33 -0
  36. package/src/stories/editor.stories.tsx +24 -17
@@ -135,7 +135,7 @@ function F(e) {
135
135
  }
136
136
  //#endregion
137
137
  //#region src/components/editor/boundary/ErrorBoundary.tsx
138
- var I = (0, T.lazy)(() => import("./feedback-button-B-CAcq1F.js").then((e) => ({ default: e.FeedbackModal }))), L = (e) => {
138
+ var I = (0, T.lazy)(() => import("./feedback-button-gTC25Y-p.js").then((e) => ({ default: e.FeedbackModal }))), L = (e) => {
139
139
  let t = (0, w.c)(2), n;
140
140
  return t[0] === e.children ? n = t[1] : (n = /* @__PURE__ */ (0, j.jsx)(O, {
141
141
  FallbackComponent: R,
@@ -18,7 +18,7 @@ function x() {
18
18
  return e.warn("Failed to get version from mount config"), null;
19
19
  }
20
20
  }
21
- var S = x() || "0.25.3-dev46", C = u(S), w = u(!0);
21
+ var S = x() || "0.25.3-dev48", C = u(S), w = u(!0);
22
22
  u(null);
23
23
  //#endregion
24
24
  //#region src/core/wasm/state.ts
@@ -12,7 +12,7 @@ import { t as lt } from "./check-C209OH-W.js";
12
12
  import { A as ut, C as dt, M as ft, O as pt, S as mt, _ as ht, b as gt, c as _t, d as vt, g as yt, h as bt, i as xt, l as St, m as Ct, n as wt, p as Tt, s as Et, t as Dt, u as Ot, v as kt, y as At } from "./select-D2iqeJYk.js";
13
13
  import { $ as jt, $t as Mt, A as Nt, At as Pt, B as Ft, Bt as It, Ct as Lt, D as Rt, Dt as zt, E as Bt, Et as Vt, F as Ht, Ft as Ut, G as Wt, Gt, H as Kt, Ht as qt, I as Jt, It as Yt, J as Xt, Jt as Zt, Kt as Qt, L as $t, Lt as en, M as tn, Mt as nn, N as rn, Nt as an, O as on, Ot as sn, P as cn, Pt as ln, Q as un, Qt as dn, R as fn, Rt as pn, S as mn, St as hn, T as gn, Tt as _n, U as vn, Ut as yn, V as bn, Vt as xn, W as Sn, Wt as Cn, X as wn, Xt as Tn, Y as En, Yt as Dn, Z as On, Zt as kn, _ as An, _n as jn, _t as Mn, a as Nn, at as Pn, b as Fn, bt as In, cn as Ln, ct as Rn, d as zn, dn as Bn, dt as Vn, et as Hn, f as Un, fn as Wn, ft as Gn, gn as Kn, gt as qn, h as Jn, hn as Yn, ht as Xn, i as Zn, in as Qn, it as $n, j as er, jt as tr, k as nr, kt as rr, l as ir, lt as ar, mn as or, mt as sr, n as cr, nn as lr, nt as ur, o as dr, on as fr, ot as pr, pn as mr, pt as hr, qt as gr, rn as _r, rt as vr, s as yr, sn as br, st as xr, t as Sr, tn as Cr, tt as wr, u as Tr, un as Er, vn as Dr, vt as Or, w as kr, wt as Ar, x as jr, xt as Mr, y as Nr, yt as Pr, z as Fr, zt as Ir } from "./dropdown-menu-ugNoZmKx.js";
14
14
  import { a as Lr, c as Rr, d as zr, i as Br, l as Vr, n as Hr, o as Ur, r as Wr, t as Gr, v as Kr, x as qr, y as Jr } from "./toDate-C0jaysq2.js";
15
- import { n as Yr, t as Xr } from "./ErrorBoundary-BWVs0-U9.js";
15
+ import { n as Yr, t as Xr } from "./ErrorBoundary-DHfwqB0K.js";
16
16
  import { t as Zr } from "./clsx-CoeGtWvn.js";
17
17
  import { t as Qr } from "./react-dom-DUmH0GXv.js";
18
18
  import { t as $r } from "./jsx-runtime-3BD1kT0s.js";
@@ -24218,77 +24218,105 @@ function EL({ type: e, value: t, comparison: n = "eq", dataType: r, dtype: i })
24218
24218
  }
24219
24219
  }
24220
24220
  var DL = (e) => {
24221
- let t = (0, J.c)(12), { contextMenuRef: n, tableBody: r, tableRef: a, copyAllCells: o } = e, s;
24222
- t[0] !== n || t[1] !== a ? (s = (e) => {
24221
+ let t = (0, J.c)(19), { contextMenuRef: n, tableBody: r, tableRef: a, copyAllCells: o } = e, [s, c] = (0, K.useState)(null), l = (0, K.useRef)(null), u;
24222
+ t[0] !== n || t[1] !== a ? (u = (e) => {
24223
+ if (l.current?.classList.remove("bg-(--green-4)"), l.current = null, !e) {
24224
+ n.current = null;
24225
+ return;
24226
+ }
24223
24227
  let t = n.current;
24224
- if (!t) return;
24228
+ if (c(t), !t) return;
24225
24229
  let r = a.current?.querySelector(`[${fe}="${t.id}"]`);
24226
24230
  if (!r) {
24227
24231
  i.error("Context menu cell not found in table");
24228
24232
  return;
24229
24233
  }
24230
- e ? r.classList.add("bg-(--green-4)") : r.classList.remove("bg-(--green-4)");
24231
- }, t[0] = n, t[1] = a, t[2] = s) : s = t[2];
24232
- let c = zi(s), l;
24233
- t[3] === r ? l = t[4] : (l = /* @__PURE__ */ (0, q.jsx)(dL, {
24234
+ r.classList.add("bg-(--green-4)"), l.current = r;
24235
+ }, t[0] = n, t[1] = a, t[2] = u) : u = t[2];
24236
+ let d = zi(u), f;
24237
+ t[3] === d ? f = t[4] : (f = (e) => {
24238
+ e || d(!1);
24239
+ }, t[3] = d, t[4] = f);
24240
+ let p;
24241
+ t[5] === d ? p = t[6] : (p = () => d(!0), t[5] = d, t[6] = p);
24242
+ let m;
24243
+ t[7] !== p || t[8] !== r ? (m = /* @__PURE__ */ (0, q.jsx)(dL, {
24234
24244
  asChild: !0,
24245
+ onContextMenu: p,
24235
24246
  children: r
24236
- }), t[3] = r, t[4] = l);
24237
- let u;
24238
- t[5] !== n || t[6] !== o ? (u = /* @__PURE__ */ (0, q.jsx)(fL, { children: /* @__PURE__ */ (0, q.jsx)(OL, {
24239
- cellRef: n,
24247
+ }), t[7] = p, t[8] = r, t[9] = m) : m = t[9];
24248
+ let h;
24249
+ t[10] !== s || t[11] !== o ? (h = s && /* @__PURE__ */ (0, q.jsx)(OL, {
24250
+ cell: s,
24240
24251
  copySelectedCells: o
24241
- }) }), t[5] = n, t[6] = o, t[7] = u) : u = t[7];
24242
- let d;
24243
- return t[8] !== c || t[9] !== l || t[10] !== u ? (d = /* @__PURE__ */ (0, q.jsxs)(uL, {
24244
- onOpenChange: c,
24245
- children: [l, u]
24246
- }), t[8] = c, t[9] = l, t[10] = u, t[11] = d) : d = t[11], d;
24247
- }, OL = ({ cellRef: e, copySelectedCells: t }) => {
24248
- let n = Bi(NI).size > 1, r = e.current;
24249
- if (!r) {
24250
- i.error("No cell found in context menu");
24251
- return;
24252
- }
24253
- let a = r.getContext().table, o = r.getValue(), s = dO(a, r.row.index, r.column.id) ?? o, c = () => {
24254
- try {
24255
- let { text: e, html: t } = uO(s, o);
24256
- m(e, t);
24257
- } catch (e) {
24258
- i.error("Failed to copy context menu cell", e);
24259
- }
24260
- }, l = r.column, u = l.columnDef.meta?.filterType, d = l.columnDef.meta?.dataType, f = l.columnDef.meta?.dtype, p = !!(u && l.getCanFilter()), g = (e) => p ? EL({
24261
- type: u,
24262
- value: s,
24263
- comparison: e,
24264
- dataType: d,
24265
- dtype: f
24266
- }) : void 0, _ = g("eq"), v = _ !== void 0, y = (e) => {
24267
- if (!u) return;
24268
- let t = e === "eq" ? _ : g("neq");
24269
- t && l.setFilterValue(t);
24270
- };
24271
- return /* @__PURE__ */ (0, q.jsxs)(vL, { children: [
24252
+ }), t[10] = s, t[11] = o, t[12] = h) : h = t[12];
24253
+ let g;
24254
+ t[13] === h ? g = t[14] : (g = /* @__PURE__ */ (0, q.jsx)(fL, { children: h }), t[13] = h, t[14] = g);
24255
+ let _;
24256
+ return t[15] !== f || t[16] !== m || t[17] !== g ? (_ = /* @__PURE__ */ (0, q.jsxs)(uL, {
24257
+ onOpenChange: f,
24258
+ children: [m, g]
24259
+ }), t[15] = f, t[16] = m, t[17] = g, t[18] = _) : _ = t[18], _;
24260
+ }, OL = (e) => {
24261
+ let t = (0, J.c)(27), { cell: n, copySelectedCells: r } = e, a = Bi(NI).size > 1, o, s, c, l, u;
24262
+ if (t[0] !== n) {
24263
+ let e = n.getContext().table, r = n.getValue(), a = dO(e, n.row.index, n.column.id) ?? r;
24264
+ l = () => {
24265
+ try {
24266
+ let { text: e, html: t } = uO(a, r);
24267
+ m(e, t);
24268
+ } catch (e) {
24269
+ let t = e;
24270
+ i.error("Failed to copy context menu cell", t);
24271
+ }
24272
+ }, s = n.column, c = s.columnDef.meta?.filterType;
24273
+ let d = s.columnDef.meta?.dataType, f = s.columnDef.meta?.dtype, p;
24274
+ t[6] !== s || t[7] !== c ? (p = c && s.getCanFilter(), t[6] = s, t[7] = c, t[8] = p) : p = t[8];
24275
+ let h = !!p;
24276
+ o = (e) => h ? EL({
24277
+ type: c,
24278
+ value: a,
24279
+ comparison: e,
24280
+ dataType: d,
24281
+ dtype: f
24282
+ }) : void 0, u = o("eq"), t[0] = n, t[1] = o, t[2] = s, t[3] = c, t[4] = l, t[5] = u;
24283
+ } else o = t[1], s = t[2], c = t[3], l = t[4], u = t[5];
24284
+ let d = u, f = d !== void 0, p;
24285
+ t[9] !== o || t[10] !== s || t[11] !== d || t[12] !== c ? (p = (e) => {
24286
+ if (!c) return;
24287
+ let t = e === "eq" ? d : o("neq");
24288
+ t && s.setFilterValue(t);
24289
+ }, t[9] = o, t[10] = s, t[11] = d, t[12] = c, t[13] = p) : p = t[13];
24290
+ let g = p, _;
24291
+ t[14] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ (0, q.jsx)(h, { className: "mo-dropdown-icon h-3 w-3" }), t[14] = _) : _ = t[14];
24292
+ let v;
24293
+ t[15] === l ? v = t[16] : (v = /* @__PURE__ */ (0, q.jsxs)(yL, {
24294
+ onClick: l,
24295
+ children: [_, "Copy cell"]
24296
+ }), t[15] = l, t[16] = v);
24297
+ let y;
24298
+ t[17] !== r || t[18] !== a ? (y = a && /* @__PURE__ */ (0, q.jsxs)(yL, {
24299
+ onClick: r,
24300
+ children: [/* @__PURE__ */ (0, q.jsx)(fo, { className: "mo-dropdown-icon h-3 w-3" }), "Copy selected cells"]
24301
+ }), t[17] = r, t[18] = a, t[19] = y) : y = t[19];
24302
+ let b;
24303
+ t[20] !== f || t[21] !== g ? (b = f && /* @__PURE__ */ (0, q.jsxs)(q.Fragment, { children: [
24304
+ /* @__PURE__ */ (0, q.jsx)(CL, {}),
24272
24305
  /* @__PURE__ */ (0, q.jsxs)(yL, {
24273
- onClick: c,
24274
- children: [/* @__PURE__ */ (0, q.jsx)(h, { className: "mo-dropdown-icon h-3 w-3" }), "Copy cell"]
24306
+ onClick: () => g("eq"),
24307
+ children: [/* @__PURE__ */ (0, q.jsx)(Ja, { className: "mo-dropdown-icon h-3 w-3" }), "Filter by this value"]
24275
24308
  }),
24276
- n && /* @__PURE__ */ (0, q.jsxs)(yL, {
24277
- onClick: t,
24278
- children: [/* @__PURE__ */ (0, q.jsx)(fo, { className: "mo-dropdown-icon h-3 w-3" }), "Copy selected cells"]
24279
- }),
24280
- v && /* @__PURE__ */ (0, q.jsxs)(q.Fragment, { children: [
24281
- /* @__PURE__ */ (0, q.jsx)(CL, {}),
24282
- /* @__PURE__ */ (0, q.jsxs)(yL, {
24283
- onClick: () => y("eq"),
24284
- children: [/* @__PURE__ */ (0, q.jsx)(Ja, { className: "mo-dropdown-icon h-3 w-3" }), "Filter by this value"]
24285
- }),
24286
- /* @__PURE__ */ (0, q.jsxs)(yL, {
24287
- onClick: () => y("neq"),
24288
- children: [/* @__PURE__ */ (0, q.jsx)(Ja, { className: "mo-dropdown-icon h-3 w-3" }), "Remove rows with this value"]
24289
- })
24290
- ] })
24291
- ] });
24309
+ /* @__PURE__ */ (0, q.jsxs)(yL, {
24310
+ onClick: () => g("neq"),
24311
+ children: [/* @__PURE__ */ (0, q.jsx)(Ja, { className: "mo-dropdown-icon h-3 w-3" }), "Remove rows with this value"]
24312
+ })
24313
+ ] }), t[20] = f, t[21] = g, t[22] = b) : b = t[22];
24314
+ let x;
24315
+ return t[23] !== v || t[24] !== y || t[25] !== b ? (x = /* @__PURE__ */ (0, q.jsxs)(vL, { children: [
24316
+ v,
24317
+ y,
24318
+ b
24319
+ ] }), t[23] = v, t[24] = y, t[25] = b, t[26] = x) : x = t[26], x;
24292
24320
  }, kL = (e) => {
24293
24321
  let t = (0, J.c)(15), { state: n, contentId: r, onClose: i } = e, a = n != null, o;
24294
24322
  t[0] === i ? o = t[1] : (o = (e) => {
@@ -2,7 +2,7 @@ import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
2
  import { t } from "./react-sHtZdjeP.js";
3
3
  import { t as n } from "./react-dom-DUmH0GXv.js";
4
4
  import { c as r, l as i, u as a } from "./data-grid-types-0PJ-9N5n.js";
5
- import { a as o, i as s, n as c, r as l } from "./glide-data-editor-DOh16wcn.js";
5
+ import { a as o, i as s, n as c, r as l } from "./glide-data-editor-BXXphavz.js";
6
6
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.3.0_27cffe7f1bc30287d59ac27db3240c5b/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",
@@ -5,12 +5,12 @@ import { t as i } from "./compiler-runtime-CldRdSsv.js";
5
5
  import { t as a } from "./copy-icon-L-mFk59e.js";
6
6
  import { Dt as o, G as s, It as c, K as l, Rt as u, V as d, dn as f, h as p, i as m, n as h } from "./error-entries-D3ouOLDe.js";
7
7
  import { b as g } from "./select-D2iqeJYk.js";
8
- import { n as ee, t as te } from "./globals-C9VhYRAQ.js";
8
+ import { n as ee, t as te } from "./globals-BcxqBRmX.js";
9
9
  import { t as _ } from "./jsx-runtime-3BD1kT0s.js";
10
10
  import { C as v, _ as ne, i as y } from "./useTheme-BC8Lof0B.js";
11
11
  import { a as re, i as ie, n as ae, r as oe } from "./dialog-CDbPtWUD.js";
12
12
  import { t as se } from "./useAsyncData-BbuzBAUp.js";
13
- import { t as ce } from "./code-visibility-Dnpf43An.js";
13
+ import { t as ce } from "./code-visibility-5llx6KCK.js";
14
14
  //#region src/components/ui/skeleton.tsx
15
15
  var b = /* @__PURE__ */ e(r(), 1), x = i(), S = _(), le = (e) => {
16
16
  let n = (0, x.c)(8), r, i;
@@ -6,7 +6,7 @@ import { i as s, n as c, r as l } from "./copy-icon-L-mFk59e.js";
6
6
  import { C as u, c as d, i as f, n as p, s as m, t as h, x as g } from "./select-D2iqeJYk.js";
7
7
  import { d as _, h as v, i as y, l as b, n as x, o as S, s as C, t as w, u as T } from "./dropdown-menu-ugNoZmKx.js";
8
8
  import { c as E, d as D, l as O, n as k, o as A, s as ee, t as j, u as te } from "./glide-utils-Q2ZsuA3h.js";
9
- import { n as ne, t as re } from "./ErrorBoundary-BWVs0-U9.js";
9
+ import { n as ne, t as re } from "./ErrorBoundary-DHfwqB0K.js";
10
10
  import { t as ie } from "./react-dom-DUmH0GXv.js";
11
11
  import { t as M } from "./jsx-runtime-3BD1kT0s.js";
12
12
  import { t as N } from "./label-CuEjBqYP.js";
@@ -7062,7 +7062,7 @@ function rs(e, t, n, r, i) {
7062
7062
  }
7063
7063
  //#endregion
7064
7064
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.3.0_27cffe7f1bc30287d59ac27db3240c5b/node_modules/@glideapps/glide-data-grid/dist/esm/data-editor/data-editor.js
7065
- var is = /* @__PURE__ */ e(_r(), 1), as = /* @__PURE__ */ e(xr(), 1), os = K.lazy(async () => await import("./data-grid-overlay-editor-CPTzwTJV.js")), ss = 0;
7065
+ var is = /* @__PURE__ */ e(_r(), 1), as = /* @__PURE__ */ e(xr(), 1), os = K.lazy(async () => await import("./data-grid-overlay-editor-D01HzlXg.js")), ss = 0;
7066
7066
  function cs(e) {
7067
7067
  return (0, is.default)((0, as.default)((0, as.default)(e).filter((e) => e.span !== void 0).map((e) => (0, Za.default)((e.span?.[0] ?? 0) + 1, (e.span?.[1] ?? 0) + 1))));
7068
7068
  }
@@ -9293,7 +9293,7 @@ function Vs(e, t, n, r, i) {
9293
9293
  }
9294
9294
  //#endregion
9295
9295
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.3.0_27cffe7f1bc30287d59ac27db3240c5b/node_modules/@glideapps/glide-data-grid/dist/esm/cells/number-cell.js
9296
- var Hs = K.lazy(async () => await import("./number-overlay-editor-DDSvabGl.js")), Us = {
9296
+ var Hs = K.lazy(async () => await import("./number-overlay-editor-CaspWg5p.js")), Us = {
9297
9297
  getAccessibilityString: (e) => e.data?.toString() ?? "",
9298
9298
  kind: W.Number,
9299
9299
  needsHover: (e) => e.hoverEffect === !0,
@@ -1,6 +1,6 @@
1
1
  import { h as e } from "./tooltip-BCntm-jf.js";
2
2
  import { _ as t } from "./useTheme-BC8Lof0B.js";
3
- import { r as n } from "./code-visibility-Dnpf43An.js";
3
+ import { r as n } from "./code-visibility-5llx6KCK.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",