@marimo-team/islands 0.25.3-dev273 → 0.25.3-dev275

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 (98) hide show
  1. package/dist/{ConnectedDataExplorerComponent-eLHPh6uu.js → ConnectedDataExplorerComponent-CErm132k.js} +25 -26
  2. package/dist/{ErrorBoundary-DBh-wUT9.js → ErrorBoundary-BuIXiuc5.js} +43 -44
  3. package/dist/{abnfDiagram-VCTEODGH-hqd0IBtX.js → abnfDiagram-VCTEODGH-d-Qn2fwb.js} +2 -2
  4. package/dist/{any-language-editor-DnG26QXh.js → any-language-editor-6k6F12Z3.js} +3 -3
  5. package/dist/{architectureDiagram-5GKGNRK7-BzLAFcc0.js → architectureDiagram-5GKGNRK7-DxragHYv.js} +1 -1
  6. package/dist/{assertNever-DIU3JJbt.js → assertNever-B-YzWzbL.js} +14 -14
  7. package/dist/{button-0-RqY1DW.js → button-DZuNnIZO.js} +220 -223
  8. package/dist/{capabilities-B6yy_CBN.js → capabilities-D9FskwsK.js} +1 -1
  9. package/dist/{chat-ui-BWIkve2R.js → chat-ui-SZ6lSH52.js} +144 -145
  10. package/dist/{check-gUSZbRsl.js → check-XFzZeH-y.js} +1 -1
  11. package/dist/{chunk-IMKFNOWR-DOeVvuyE.js → chunk-IMKFNOWR-C0x0feFg.js} +1 -1
  12. package/dist/{chunk-SHT3W25Y-DZoFI8wR.js → chunk-SHT3W25Y-D0ZdASqB.js} +1 -1
  13. package/dist/{chunk-SVP7TREG-CWu86PSW.js → chunk-SVP7TREG-BHjL96zx.js} +1 -1
  14. package/dist/{chunk-TICWLB2K-BrM0GoP3.js → chunk-TICWLB2K-CzcrwGfp.js} +1 -1
  15. package/dist/{classDiagram-ZZMXUADV-DYi4V2bB.js → classDiagram-ZZMXUADV-BTqFAZTP.js} +2 -2
  16. package/dist/{classDiagram-v2-VYDZK3BY-tN7FIk-m.js → classDiagram-v2-VYDZK3BY-EPXb0Elt.js} +2 -2
  17. package/dist/{code-visibility-M_dXDGp6.js → code-visibility-BEAPMrC-.js} +20 -20
  18. package/dist/{common-DV0fvw_I.js → common-CEmzaoJ8.js} +799 -801
  19. package/dist/{config-BsPruWMR.js → config-C8MFHQ2E.js} +23 -22
  20. package/dist/{copy-icon-C2I8sw4h.js → copy-icon-CtllOdmg.js} +3 -3
  21. package/dist/{createReducer-DdtT_7ji.js → createReducer-DRqwmaTc.js} +2 -2
  22. package/dist/{cynefinDiagram-5FMLGOSQ-D5nCnDc-.js → cynefinDiagram-5FMLGOSQ-CBSD344q.js} +1 -1
  23. package/dist/{dagre-GXQ25YYZ-BHkd7f_i.js → dagre-GXQ25YYZ-JItjh3Ge.js} +1 -1
  24. package/dist/{data-grid-overlay-editor-Cd1zGKBt.js → data-grid-overlay-editor-CUo25_W8.js} +1 -1
  25. package/dist/{diagram-S7CK7UJ4-D1ALppT2.js → diagram-S7CK7UJ4-CTD9xTVb.js} +1 -1
  26. package/dist/{diagram-UQ7AKVKN-DLv0b83L.js → diagram-UQ7AKVKN-DTfnFai8.js} +1 -1
  27. package/dist/{diagram-VX7I27RA-7XJ7J6qg.js → diagram-VX7I27RA-BcSnucV-.js} +1 -1
  28. package/dist/{diagram-Z3DM3KII-7M7zbHp_.js → diagram-Z3DM3KII-C2ATIE8A.js} +1 -1
  29. package/dist/{dialog-DzCj1qQv.js → dialog-CaYm5imE.js} +33 -33
  30. package/dist/{dropdown-menu-CdXE15an.js → dropdown-menu-Bb0bFOIk.js} +149 -149
  31. package/dist/{ebnfDiagram-PWID7BFC-DHH1qlmV.js → ebnfDiagram-PWID7BFC-B7B9JPxc.js} +2 -2
  32. package/dist/{erDiagram-RLTQ6QDP-fI_0dGef.js → erDiagram-RLTQ6QDP-v6hDno1O.js} +1 -1
  33. package/dist/{error-banner-DPc9eIw5.js → error-banner-CHCdHVFB.js} +44 -45
  34. package/dist/{error-entries-CxN-Nq3V.js → error-entries-B-1yUdcH.js} +406 -407
  35. package/dist/{feedback-button-CE2gPi4-.js → feedback-button-BqiR7zMO.js} +11 -11
  36. package/dist/{flowDiagram-HODETNUW-Brg9MA6i.js → flowDiagram-HODETNUW-aIFlAtOy.js} +2 -2
  37. package/dist/{formats-DbSvAPY-.js → formats-PzBQMUnr.js} +3 -3
  38. package/dist/{glide-data-editor-BycATbgF.js → glide-data-editor-B7dguvqk.js} +14 -16
  39. package/dist/{glide-utils-BSw3SSHF.js → glide-utils-BSQr4d90.js} +51 -59
  40. package/dist/{globals-CW6OvnI5.js → globals-CYykXfGI.js} +3 -3
  41. package/dist/{html-to-image-Bc2AvXHG.js → html-to-image-DC_pmZLs.js} +546 -548
  42. package/dist/{infoDiagram-27XIBGKW-E9e403YT.js → infoDiagram-27XIBGKW-D6YHLeCP.js} +1 -1
  43. package/dist/{ishikawaDiagram-5VMMS53U-C-RlYDRo.js → ishikawaDiagram-5VMMS53U-D1ZvprOX.js} +1 -1
  44. package/dist/{kanban-definition-UXKFOSKX-CLFl_uqK.js → kanban-definition-UXKFOSKX-Bna_3BMr.js} +1 -1
  45. package/dist/{loader-BVEtQ4F3.js → loader-DZvtzQoD.js} +1 -1
  46. package/dist/main.js +6772 -6771
  47. package/dist/{mermaid-rd09e1JL.js → mermaid-A36unKXJ.js} +50 -50
  48. package/dist/{mindmap-definition-YA3MSWOX-BQ8TWtyB.js → mindmap-definition-YA3MSWOX-CyVCs__G.js} +1 -1
  49. package/dist/{number-overlay-editor-B_rR-LdM.js → number-overlay-editor-C4u7SJAJ.js} +1 -1
  50. package/dist/{pegDiagram-XKGWAZYB-CN8UHFPi.js → pegDiagram-XKGWAZYB-9hNBD2wZ.js} +2 -2
  51. package/dist/{pencil-DcT8AE0h.js → pencil-DYUlSKxZ.js} +1 -1
  52. package/dist/{pieDiagram-E7YTZNPT-DGuJ0EBd.js → pieDiagram-E7YTZNPT-8tr-NYo7.js} +1 -1
  53. package/dist/{process-output-qecD7Dk8.js → process-output-DYu84VfZ.js} +4 -4
  54. package/dist/{railroadDiagram-O6MQD6OU-BPDA8wy8.js → railroadDiagram-O6MQD6OU-Dzg1dyyp.js} +2 -2
  55. package/dist/{requirementDiagram-BXWQKSXE-ChzLGbGW.js → requirementDiagram-BXWQKSXE-B7sNqwGG.js} +1 -1
  56. package/dist/{reveal-component-CngVwOSy.js → reveal-component-DGi-irHV.js} +589 -589
  57. package/dist/{select-OxgozOC8.js → select-DsoP1qe8.js} +290 -290
  58. package/dist/{sequenceDiagram-WJ2MYXX4-DFX-bE6O.js → sequenceDiagram-WJ2MYXX4-oP9shbaG.js} +1 -1
  59. package/dist/{spec-oJn0RhpQ.js → spec-BZMDxAu7.js} +4 -4
  60. package/dist/{stateDiagram-D77RDMKH-BR7cI3wK.js → stateDiagram-D77RDMKH-CjCv4ogv.js} +2 -2
  61. package/dist/{stateDiagram-v2-MP3YSRHH-oGqB5UDI.js → stateDiagram-v2-MP3YSRHH-BW9X162a.js} +2 -2
  62. package/dist/{static-state-CuV6Pc3a.js → static-state-D-Q-Ajaa.js} +8 -8
  63. package/dist/style.css +1 -1
  64. package/dist/{swimlanes-42K2YHIH-DwSZl1yC.js → swimlanes-42K2YHIH-Ckfs9Wrn.js} +1 -1
  65. package/dist/{swimlanesDiagram-VR7AAH4N-BHlcd-Ri.js → swimlanesDiagram-VR7AAH4N-DpTNG9YP.js} +2 -2
  66. package/dist/{swiper-component-Dvj-goaD.js → swiper-component-DQbK_ZWm.js} +7 -7
  67. package/dist/{timeline-definition-24CTP7MA-DMmP-G2O.js → timeline-definition-24CTP7MA-BXaBlV6U.js} +1 -1
  68. package/dist/{toast-DbBHmxmB.js → toast-BhjIy3Tq.js} +158 -158
  69. package/dist/{tooltip-BfcDQd2j.js → tooltip-DMMiOn2f.js} +64 -64
  70. package/dist/use-restore-focus-CosX7-gx.js +7568 -0
  71. package/dist/{useAsyncData-BYIAoMqn.js → useAsyncData-Ci4AvJff.js} +4 -4
  72. package/dist/{useDateFormatter-ButWkdcK.js → useDateFormatter-CPlava52.js} +2 -2
  73. package/dist/{useDeepCompareMemoize-Bz0c5GN6.js → useDeepCompareMemoize-NaaWoFlX.js} +1 -1
  74. package/dist/useEvent-BRH-aCqi.js +19 -0
  75. package/dist/{useIframeCapabilities-BIolGsF1.js → useIframeCapabilities-BXhDDoCG.js} +1 -1
  76. package/dist/{useLifecycle-JjxCC7Vu.js → useLifecycle-SniivYmC.js} +2 -2
  77. package/dist/{vega-component-rxIxAAh9.js → vega-component-DIxaDQNs.js} +40 -40
  78. package/dist/{vennDiagram-4TSXK5OY-Db8GtH1G.js → vennDiagram-4TSXK5OY-C-hQ4iNJ.js} +1 -1
  79. package/dist/{wardleyDiagram-VM6X3IG4-DmIiC3FU.js → wardleyDiagram-VM6X3IG4-C2MQ_Umv.js} +1 -1
  80. package/dist/{xychartDiagram-S5SC5T6Z-DS9OPrNq.js → xychartDiagram-S5SC5T6Z-BtTTBn7Q.js} +1 -1
  81. package/package.json +1 -1
  82. package/src/core/islands/components/__tests__/web-components.test.tsx +63 -0
  83. package/src/core/islands/components/web-components.tsx +11 -0
  84. package/src/css/globals.css +6 -2
  85. package/src/plugins/impl/DataEditorPlugin.tsx +0 -4
  86. package/src/plugins/impl/data-editor/__tests__/column-types.test.ts +5 -0
  87. package/src/plugins/impl/data-editor/__tests__/glide-data-editor.test.tsx +9 -5
  88. package/src/plugins/impl/data-editor/column-types.ts +3 -0
  89. package/src/plugins/impl/data-editor/glide-data-editor.tsx +6 -5
  90. package/src/plugins/impl/data-editor/glide-utils.ts +10 -32
  91. package/src/plugins/impl/data-editor/types.ts +0 -2
  92. package/src/theme/__tests__/islands-theme.test.tsx +276 -0
  93. package/src/theme/namespace.tsx +4 -3
  94. package/src/theme/useTheme.ts +71 -41
  95. package/dist/schemas-CdscWNy_.js +0 -4747
  96. package/dist/use-restore-focus-CmflVLWJ.js +0 -1672
  97. package/dist/useTheme-DPLobSFs.js +0 -339
  98. package/dist/utils-EBklsC5R.js +0 -813
@@ -1,8 +1,8 @@
1
1
  import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
2
  import { t } from "./react-sHtZdjeP.js";
3
3
  import { t as n } from "./compiler-runtime-CldRdSsv.js";
4
- import { D as r } from "./utils-EBklsC5R.js";
5
- import { t as i } from "./invariant-DLmrl-hA.js";
4
+ import { t as r } from "./invariant-DLmrl-hA.js";
5
+ import { t as i } from "./useEvent-BRH-aCqi.js";
6
6
  //#region src/hooks/useAsyncData.ts
7
7
  var a = n(), o = /* @__PURE__ */ e(t(), 1), s = {
8
8
  error(e, t) {
@@ -45,7 +45,7 @@ var a = n(), o = /* @__PURE__ */ e(t(), 1), s = {
45
45
  function c(e, t) {
46
46
  let n = (0, a.c)(16), [c, d] = (0, o.useState)(0), [f, p] = (0, o.useState)(u), m;
47
47
  n[0] === e ? m = n[1] : (m = typeof e == "function" ? { fetch: e } : e, n[0] = e, n[1] = m);
48
- let h = r(m.fetch), g;
48
+ let h = i(m.fetch), g;
49
49
  n[2] === h ? g = n[3] : (g = () => {
50
50
  let e = new AbortController(), t = !1;
51
51
  return p(l), h({ previous: () => {
@@ -67,7 +67,7 @@ function c(e, t) {
67
67
  let v;
68
68
  n[8] === f ? v = n[9] : (v = (e) => {
69
69
  let t;
70
- typeof e == "function" ? (i(f.status === "success" || f.status === "loading", "No previous state value."), t = e(f.data)) : t = e, p(s.success(t));
70
+ typeof e == "function" ? (r(f.status === "success" || f.status === "loading", "No previous state value."), t = e(f.data)) : t = e, p(s.success(t));
71
71
  }, n[8] = f, n[9] = v);
72
72
  let y;
73
73
  n[10] === c ? y = n[11] : (y = () => d(c + 1), n[10] = c, n[11] = y);
@@ -1,7 +1,7 @@
1
1
  import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
2
  import { t } from "./react-sHtZdjeP.js";
3
- import { h as n } from "./tooltip-BfcDQd2j.js";
4
- import { C as r } from "./select-OxgozOC8.js";
3
+ import { h as n } from "./tooltip-DMMiOn2f.js";
4
+ import { C as r } from "./select-DsoP1qe8.js";
5
5
  var i = n("chart-pie", [["path", {
6
6
  d: "M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",
7
7
  key: "pzmjnu"
@@ -1,6 +1,6 @@
1
1
  import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
2
  import { t } from "./react-sHtZdjeP.js";
3
- import { l as n } from "./utils-EBklsC5R.js";
3
+ import { Mt as n } from "./use-restore-focus-CosX7-gx.js";
4
4
  //#region src/hooks/useDeepCompareMemoize.ts
5
5
  var r = /* @__PURE__ */ e(t(), 1);
6
6
  function i(e) {
@@ -0,0 +1,19 @@
1
+ import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
+ import { t } from "./react-sHtZdjeP.js";
3
+ //#region ../node_modules/.pnpm/react-use-event-hook@0.9.6_react@19.3.0/node_modules/react-use-event-hook/dist/esm/useEvent.js
4
+ var n = /* @__PURE__ */ e(t()), r = typeof window < "u" ? n.useInsertionEffect || n.useLayoutEffect : () => {};
5
+ function i(e) {
6
+ let t = n.useRef(a);
7
+ r(() => {
8
+ t.current = e;
9
+ }, [e]);
10
+ let i = n.useRef(null);
11
+ return i.current ||= function() {
12
+ return t.current.apply(this, arguments);
13
+ }, i.current;
14
+ }
15
+ function a() {
16
+ throw Error("INVALID_USEEVENT_INVOCATION: the callback from useEvent cannot be invoked before the component has mounted.");
17
+ }
18
+ //#endregion
19
+ export { i as t };
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./compiler-runtime-CldRdSsv.js";
2
- import { t } from "./capabilities-B6yy_CBN.js";
2
+ import { t } from "./capabilities-D9FskwsK.js";
3
3
  //#region src/hooks/useIframeCapabilities.ts
4
4
  var n = e();
5
5
  function r() {
@@ -1,8 +1,8 @@
1
1
  import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
- import { h as t, s as n } from "./button-0-RqY1DW.js";
2
+ import { h as t, r as n } from "./button-DZuNnIZO.js";
3
3
  import { t as r } from "./react-sHtZdjeP.js";
4
4
  import { t as i } from "./compiler-runtime-CldRdSsv.js";
5
- import { h as a } from "./tooltip-BfcDQd2j.js";
5
+ import { h as a } from "./tooltip-DMMiOn2f.js";
6
6
  import { t as o } from "./jsx-runtime-3BD1kT0s.js";
7
7
  var s = a("calendar", [
8
8
  ["path", {
@@ -1,23 +1,23 @@
1
1
  import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
- import { a as t, g as n, h as r, m as i } from "./button-0-RqY1DW.js";
2
+ import { g as t, h as n, m as r, s as i } from "./button-DZuNnIZO.js";
3
3
  import { t as a } from "./react-sHtZdjeP.js";
4
4
  import { t as o } from "./compiler-runtime-CldRdSsv.js";
5
- import { t as s } from "./tooltip-BfcDQd2j.js";
6
- import { l as c, t as l } from "./config-BsPruWMR.js";
5
+ import { t as s } from "./tooltip-DMMiOn2f.js";
6
+ import { l as c, t as l } from "./config-C8MFHQ2E.js";
7
7
  import { t as u } from "./jsx-runtime-3BD1kT0s.js";
8
- import { n as d } from "./error-banner-DPc9eIw5.js";
9
- import { t as f } from "./debounce-DrhhziJv.js";
10
- import { n as p } from "./useTheme-DPLobSFs.js";
11
- import { D as ee } from "./utils-EBklsC5R.js";
12
- import { t as te } from "./objects-DCmMvZtn.js";
13
- import { a as ne, i as re, n as ie, t as m } from "./formats-DbSvAPY-.js";
8
+ import { u as d } from "./use-restore-focus-CosX7-gx.js";
9
+ import { n as f } from "./error-banner-CHCdHVFB.js";
10
+ import { t as p } from "./debounce-DrhhziJv.js";
11
+ import { t as ee } from "./objects-DCmMvZtn.js";
12
+ import { t as te } from "./useEvent-BRH-aCqi.js";
13
+ import { a as ne, i as re, n as ie, t as m } from "./formats-PzBQMUnr.js";
14
14
  import { a as h, t as g } from "./arrays-DoQ-AILx.js";
15
- import { t as ae } from "./useAsyncData-BYIAoMqn.js";
15
+ import { t as ae } from "./useAsyncData-Ci4AvJff.js";
16
16
  import { t as _ } from "./semaphore-89jsoHtS.js";
17
17
  import { D as oe, n as se } from "./vega-loader.browser-B9Pz0EGP.js";
18
18
  import { t as ce } from "./react-vega-C4T9Rb_w.js";
19
- import { a as le, n as v } from "./loader-BVEtQ4F3.js";
20
- import { t as ue } from "./useDeepCompareMemoize-Bz0c5GN6.js";
19
+ import { a as le, n as v } from "./loader-DZvtzQoD.js";
20
+ import { t as ue } from "./useDeepCompareMemoize-NaaWoFlX.js";
21
21
  import { t as de } from "./use-vega-container-remeasure-Bz4PZMtt.js";
22
22
  //#region src/plugins/impl/vega/fix-relative-url.ts
23
23
  var fe = /* @__PURE__ */ e(a(), 1), pe = o();
@@ -103,7 +103,7 @@ var y = {
103
103
  }
104
104
  };
105
105
  function C() {
106
- return t() ? "metaKey" : "ctrlKey";
106
+ return i() ? "metaKey" : "ctrlKey";
107
107
  }
108
108
  var w = {
109
109
  highlight() {
@@ -515,10 +515,10 @@ se("arrow", m);
515
515
  var K = (e) => {
516
516
  let t = (0, pe.c)(12), { value: n, setValue: r, chartSelection: i, fieldSelection: a, spec: o, embedOptions: s } = e, c, l;
517
517
  t[0] === o ? (c = t[1], l = t[2]) : (c = async () => W(o), l = [o], t[0] = o, t[1] = c, t[2] = l);
518
- let { data: u, error: f } = ae(c, l);
519
- if (f) {
518
+ let { data: u, error: d } = ae(c, l);
519
+ if (d) {
520
520
  let e;
521
- return t[3] === f ? e = t[4] : (e = /* @__PURE__ */ (0, G.jsx)(d, { error: f }), t[3] = f, t[4] = e), e;
521
+ return t[3] === d ? e = t[4] : (e = /* @__PURE__ */ (0, G.jsx)(f, { error: d }), t[3] = d, t[4] = e), e;
522
522
  }
523
523
  if (!u) return null;
524
524
  let p;
@@ -531,7 +531,7 @@ var K = (e) => {
531
531
  embedOptions: s
532
532
  }), t[5] = i, t[6] = s, t[7] = a, t[8] = u, t[9] = r, t[10] = n, t[11] = p) : p = t[11], p;
533
533
  }, q = (e) => {
534
- let a = (0, pe.c)(50), { value: o, setValue: l, chartSelection: u, fieldSelection: d, spec: ne, embedOptions: m } = e, { theme: h } = p(), g = (0, fe.useRef)(null), ae = (0, fe.useRef)(void 0), [_, se] = (0, fe.useState)(), v;
534
+ let a = (0, pe.c)(50), { value: o, setValue: l, chartSelection: u, fieldSelection: f, spec: ne, embedOptions: m } = e, { theme: h } = d(), g = (0, fe.useRef)(null), ae = (0, fe.useRef)(void 0), [_, se] = (0, fe.useState)(), v;
535
535
  bb0: {
536
536
  if (m && "actions" in m) {
537
537
  v = m.actions;
@@ -544,10 +544,10 @@ var K = (e) => {
544
544
  }, a[0] = e) : e = a[0], v = e;
545
545
  }
546
546
  let y = v, b = ue(ne), x;
547
- a[1] !== u || a[2] !== d || a[3] !== b ? (x = he(me(b), {
547
+ a[1] !== u || a[2] !== f || a[3] !== b ? (x = he(me(b), {
548
548
  chartSelection: u,
549
- fieldSelection: d
550
- }), a[1] = u, a[2] = d, a[3] = b, a[4] = x) : x = a[4];
549
+ fieldSelection: f
550
+ }), a[1] = u, a[2] = f, a[3] = b, a[4] = x) : x = a[4];
551
551
  let C = x, w;
552
552
  a[5] === C ? w = a[6] : (w = E(C), a[5] = C, a[6] = w);
553
553
  let T = w, D;
@@ -557,11 +557,11 @@ var K = (e) => {
557
557
  ...e
558
558
  });
559
559
  }, a[7] = l, a[8] = o, a[9] = D) : D = a[9];
560
- let O = ee(D), k;
561
- a[10] === O ? k = a[11] : (k = f((e, t) => {
562
- n.debug("[Vega signal]", e, t);
563
- let r = te.mapValues(t, _e);
564
- r = te.mapValues(r, ge), O({ [e]: r });
560
+ let O = te(D), k;
561
+ a[10] === O ? k = a[11] : (k = p((e, n) => {
562
+ t.debug("[Vega signal]", e, n);
563
+ let r = ee.mapValues(n, _e);
564
+ r = ee.mapValues(r, ge), O({ [e]: r });
565
565
  }, 100), a[10] = O, a[11] = k);
566
566
  let A = k, j = ue(T), M;
567
567
  if (a[12] !== A || a[13] !== j) {
@@ -573,18 +573,18 @@ var K = (e) => {
573
573
  } else M = a[14];
574
574
  let N = M, P;
575
575
  a[17] === C ? P = a[18] : (P = (e) => {
576
- n.error(e), n.debug(C), se(e);
576
+ t.error(e), t.debug(C), se(e);
577
577
  }, a[17] = C, a[18] = P);
578
- let F = ee(P), I;
578
+ let F = te(P), I;
579
579
  a[19] === Symbol.for("react.memo_cache_sentinel") ? (I = (e) => {
580
- n.debug("[Vega view] created", e), ae.current = e, se(void 0);
580
+ t.debug("[Vega view] created", e), ae.current = e, se(void 0);
581
581
  }, a[19] = I) : I = a[19];
582
- let L = ee(I), R;
582
+ let L = te(I), R;
583
583
  a[20] === T ? R = a[21] : (R = () => {
584
584
  let e = [];
585
585
  if (S.hasPoint(T) && e.push(["Point selection", "click to select a point; hold shift for multi-select"]), S.hasInterval(T) && e.push(["Interval selection", "click and drag to select an interval"]), S.hasLegend(T) && e.push(["Legend selection", "click to select a legend item; hold shift for multi-select"]), S.hasPanZoom(T)) {
586
- let n = t() ? "⌘" : "ctrl";
587
- e.push(["Pan", `hold the ${n} key and drag`], ["Zoom", `hold the ${n} key and scroll`]);
586
+ let t = i() ? "⌘" : "ctrl";
587
+ e.push(["Pan", `hold the ${t} key and drag`], ["Zoom", `hold the ${t} key and scroll`]);
588
588
  }
589
589
  return e.length === 0 ? null : /* @__PURE__ */ (0, G.jsx)(s, {
590
590
  delayDuration: 300,
@@ -618,21 +618,21 @@ var K = (e) => {
618
618
  de(g, K === "container");
619
619
  let q, J;
620
620
  a[32] !== U || a[33] !== N ? (q = () => (N.forEach((e) => {
621
- let { signalName: t, handler: r } = e;
621
+ let { signalName: n, handler: r } = e;
622
622
  try {
623
- U?.view.addSignalListener(t, r);
623
+ U?.view.addSignalListener(n, r);
624
624
  } catch (e) {
625
- let t = e;
626
- n.error(t);
625
+ let n = e;
626
+ t.error(n);
627
627
  }
628
628
  }), () => {
629
629
  N.forEach((e) => {
630
- let { signalName: t, handler: r } = e;
630
+ let { signalName: n, handler: r } = e;
631
631
  try {
632
- U?.view.removeSignalListener(t, r);
632
+ U?.view.removeSignalListener(n, r);
633
633
  } catch (e) {
634
- let t = e;
635
- n.error(t);
634
+ let n = e;
635
+ t.error(n);
636
636
  }
637
637
  });
638
638
  }), J = [U, N], a[32] = U, a[33] = N, a[34] = q, a[35] = J) : (q = a[34], J = a[35]), (0, fe.useEffect)(q, J);
@@ -645,7 +645,7 @@ var K = (e) => {
645
645
  })]
646
646
  }), a[36] = _, a[37] = Y);
647
647
  let X, ye;
648
- a[38] === Symbol.for("react.memo_cache_sentinel") ? (X = r("relative"), ye = i.stopPropagation(), a[38] = X, a[39] = ye) : (X = a[38], ye = a[39]);
648
+ a[38] === Symbol.for("react.memo_cache_sentinel") ? (X = n("relative"), ye = r.stopPropagation(), a[38] = X, a[39] = ye) : (X = a[38], ye = a[39]);
649
649
  let Z;
650
650
  a[40] === K ? Z = a[41] : (Z = /* @__PURE__ */ (0, G.jsx)("div", {
651
651
  ref: g,
@@ -3,7 +3,7 @@ import { t } from "./src-CA_m4ONl.js";
3
3
  import { n } from "./chunk-Y2CYZVJY-DKKS1VyV.js";
4
4
  import { $ as r, H as i, K as a, U as o, a as s, b as c, c as l, et as u, f as d, nt as f, tt as p, v as m, w as h, y as g } from "./chunk-DU6HZSFF-BwiyaNpg.js";
5
5
  import { t as _ } from "./rough.esm-CtV9AnV1.js";
6
- import { p as v } from "./mermaid-rd09e1JL.js";
6
+ import { p as v } from "./mermaid-A36unKXJ.js";
7
7
  //#region ../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/transparentize.js
8
8
  var y = (e, t) => p(e, "a", -t), b = 1e-10;
9
9
  function x(e, t) {
@@ -2,7 +2,7 @@ import { i as e } from "./chunk-75Z2AOVW-D7gxIs2Q.js";
2
2
  import { n as t } from "./src-CA_m4ONl.js";
3
3
  import { n } from "./chunk-Y2CYZVJY-DKKS1VyV.js";
4
4
  import { D as r, H as i, K as a, U as o, a as s, b as c, c as l, v as u, w as d, x as f, y as p } from "./chunk-DU6HZSFF-BwiyaNpg.js";
5
- import { p as m } from "./mermaid-rd09e1JL.js";
5
+ import { p as m } from "./mermaid-A36unKXJ.js";
6
6
  import { n as h } from "./mermaid-parser.core-DxuSfYwJ.js";
7
7
  import { t as g } from "./chunk-JWPE2WC7-DJvv1t8U.js";
8
8
  //#region ../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-VM6X3IG4.mjs
@@ -9,7 +9,7 @@ import { n as s } from "./chunk-Y2CYZVJY-DKKS1VyV.js";
9
9
  import { D as c, H as l, K as u, U as d, a as f, b as p, c as m, f as h, v as g, w as _, y as v, z as y } from "./chunk-DU6HZSFF-BwiyaNpg.js";
10
10
  import "./chunk-PWAF6VOD-CQw5qATZ.js";
11
11
  import { t as b } from "./chunk-GMAD6QVW-BhaJx0X3.js";
12
- import { p as x } from "./mermaid-rd09e1JL.js";
12
+ import { p as x } from "./mermaid-A36unKXJ.js";
13
13
  //#region ../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/band.js
14
14
  function S() {
15
15
  var e = t().unknown(void 0), r = e.domain, i = e.range, o = 0, s = 1, c, l, u = !1, d = 0, f = 0, p = .5;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/islands",
3
- "version": "0.25.3-dev273",
3
+ "version": "0.25.3-dev275",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -9,6 +9,7 @@ import {
9
9
  describe,
10
10
  expect,
11
11
  it,
12
+ vi,
12
13
  } from "vitest";
13
14
  import { cellId } from "@/__tests__/branded";
14
15
  import { MockNotebook } from "@/__mocks__/notebook";
@@ -22,6 +23,7 @@ import {
22
23
  import { islandsPendingInitialRunsAtom } from "@/core/islands/state";
23
24
  import { requestClientAtom } from "@/core/network/requests";
24
25
  import { store } from "@/core/state/jotai";
26
+ import { buildIslandHTML } from "../../__tests__/test-utils";
25
27
  import { parseMarimoIslandApps } from "../../parse";
26
28
  import { MarimoIslandElement } from "../web-components";
27
29
 
@@ -45,9 +47,55 @@ beforeEach(() => {
45
47
  afterEach(async () => {
46
48
  await actAndFlush(() => document.body.replaceChildren());
47
49
  store.set(requestClientAtom, null);
50
+ document.body.removeAttribute("style");
51
+ vi.unstubAllEnvs();
48
52
  });
49
53
 
50
54
  describe("MarimoIslandElement lifecycle", () => {
55
+ it.each([true, false])(
56
+ "synchronizes the theme of a reactive=%s island across reconnects",
57
+ async (reactive) => {
58
+ vi.stubEnv("VITE_MARIMO_ISLANDS", "true");
59
+ if (reactive) {
60
+ setNotebook("runtime-cell", "runtime output");
61
+ }
62
+ const { container, island } = createThemeIsland(reactive);
63
+ document.body.style.colorScheme = "dark";
64
+ await actAndFlush(() => document.body.append(container));
65
+ expect(island).toHaveClass("marimo", "dark");
66
+ await actAndFlush(() => {
67
+ document.body.style.colorScheme = "light";
68
+ });
69
+ expect(island).toHaveClass("marimo", "light");
70
+ expect(island).not.toHaveClass("dark");
71
+ await actAndFlush(() => island.remove());
72
+ await actAndFlush(() => {
73
+ document.body.style.colorScheme = "dark";
74
+ });
75
+ expect(island).toHaveClass("light");
76
+ await actAndFlush(() => container.append(island));
77
+ expect(island).toHaveClass("dark");
78
+ },
79
+ );
80
+
81
+ it("can disconnect before its scheduled render and reconnect with the current theme", async () => {
82
+ vi.stubEnv("VITE_MARIMO_ISLANDS", "true");
83
+ const { container, island } = createThemeIsland(false);
84
+ document.body.style.colorScheme = "dark";
85
+ await actAndFlush(() => {
86
+ document.body.append(container);
87
+ island.remove();
88
+ });
89
+ expect(island.querySelector("marimo-cell-output")).not.toBeNull();
90
+ await actAndFlush(() => {
91
+ document.body.style.colorScheme = "light";
92
+ });
93
+ expect(island).toHaveClass("dark");
94
+ await actAndFlush(() => container.append(island));
95
+ expect(island).toHaveClass("light");
96
+ expect(island.textContent).toContain("static output");
97
+ });
98
+
51
99
  it("keeps static output until the initial run completes", async () => {
52
100
  store.set(islandsPendingInitialRunsAtom, new Set([1]));
53
101
  setNotebook("runtime-cell", "runtime output");
@@ -182,6 +230,21 @@ describe("MarimoIslandElement lifecycle", () => {
182
230
  });
183
231
  });
184
232
 
233
+ function createThemeIsland(reactive: boolean) {
234
+ const container = document.createElement("div");
235
+ container.innerHTML = buildIslandHTML([
236
+ {
237
+ appId: "app-1",
238
+ cellId: "runtime-cell",
239
+ reactive,
240
+ code: "x = 1",
241
+ output: "<pre>static output</pre>",
242
+ },
243
+ ]);
244
+ const island = container.querySelector<HTMLElement>(ISLAND_TAG_NAMES.ISLAND)!;
245
+ return { container, island };
246
+ }
247
+
185
248
  function setNotebook(id: string, output?: string): void {
186
249
  const runtimeCellId = cellId(id);
187
250
  store.set(
@@ -10,6 +10,7 @@ import { OBJECT_ID_ATTR } from "@/core/dom/ui-element-constants";
10
10
  import { UI_ELEMENT_REGISTRY } from "@/core/dom/uiregistry";
11
11
  import { LocaleProvider } from "@/core/i18n/locale-provider";
12
12
  import { renderHTML } from "@/plugins/core/RenderHTML";
13
+ import { resolvedThemeAtom } from "@/theme/useTheme";
13
14
  import { invariant } from "@/utils/invariant";
14
15
  import type { CellId, UIElementId } from "../../cells/ids";
15
16
  import { store } from "../../state/jotai";
@@ -44,6 +45,7 @@ export class MarimoIslandElement extends HTMLElement {
44
45
  private runtimeAppId?: string;
45
46
  private runtimeCellId?: CellId;
46
47
  private unsubscribeCellIds?: () => void;
48
+ private unsubscribeTheme?: () => void;
47
49
 
48
50
  public static readonly tagName = ISLAND_TAG_NAMES.ISLAND;
49
51
  public static readonly outputTagName = ISLAND_TAG_NAMES.CELL_OUTPUT;
@@ -132,6 +134,13 @@ export class MarimoIslandElement extends HTMLElement {
132
134
  ? this.cellId
133
135
  : undefined;
134
136
  this.syncCellIdsSubscription();
137
+ const syncTheme = () => {
138
+ const theme = store.get(resolvedThemeAtom);
139
+ this.classList.toggle("dark", theme === "dark");
140
+ this.classList.toggle("light", theme === "light");
141
+ };
142
+ this.unsubscribeTheme = store.sub(resolvedThemeAtom, syncTheme);
143
+ syncTheme();
135
144
  queueMicrotask(() => {
136
145
  // Guard against disconnect between connectedCallback and microtask
137
146
  if (
@@ -297,6 +306,8 @@ export class MarimoIslandElement extends HTMLElement {
297
306
  * Cleanup when element is removed from DOM
298
307
  */
299
308
  public disconnectedCallback(): void {
309
+ this.unsubscribeTheme?.();
310
+ this.unsubscribeTheme = undefined;
300
311
  this.removeEventListener(
301
312
  ISLAND_SOURCE_CHANGED_EVENT,
302
313
  this.handleSourceChanged,
@@ -128,14 +128,18 @@
128
128
  --cm-search-match-selected-background-dark: #6199ff88;
129
129
  }
130
130
 
131
+ .marimo.light {
132
+ color-scheme: light;
133
+ }
134
+
131
135
  :root:has(body.dark),
132
136
  .dark,
133
- .marimo:is(.dark *) {
137
+ .marimo:not(.light):is(.dark *) {
134
138
  color-scheme: dark;
135
139
  }
136
140
 
137
141
  .dark,
138
- .marimo:is(.dark *) {
142
+ .marimo:not(.light):is(.dark *) {
139
143
  --ring: var(--blue-8, #2870bd);
140
144
  --destructive: var(--red-6, #72232d);
141
145
  --destructive-hover: var(--red-7, #8c333a);
@@ -92,13 +92,9 @@ interface Props {
92
92
  const LoadingDataEditor = (props: Props) => {
93
93
  const [editorState, setEditorState] = useState<EditorState | null>(null);
94
94
 
95
- // Load the data
96
95
  const { data: loadedState, error } = useAsyncData(async () => {
97
96
  const withoutExternalTypes = toFieldTypes(props.fieldTypes ?? []);
98
97
 
99
- // If we already have the data, return it
100
- // Otherwise, load the data from the URL. Vega's CSV parser takes a
101
- // plain `Record`; column order doesn't matter for parsing.
102
98
  const localData = Array.isArray(props.data)
103
99
  ? props.data
104
100
  : await vegaLoadData<EditorRow>(
@@ -10,6 +10,11 @@ describe("normalizeConfiguredColumns", () => {
10
10
  vi.restoreAllMocks();
11
11
  });
12
12
 
13
+ it("preserves the data reference when no columns are configured", () => {
14
+ const data = [{ label: "01", done: "yes" }];
15
+ expect(normalizeConfiguredColumns(data, new Map())).toBe(data);
16
+ });
17
+
13
18
  it("normalizes large integer boolean values from the CSV loader", async () => {
14
19
  vi.spyOn(vegaLoader, "load").mockResolvedValueOnce(
15
20
  "done,label\n9007199254740992,01\n-9007199254740992,02\n0,03\n",
@@ -65,7 +65,11 @@ vi.mock("@glideapps/glide-data-grid", async () => {
65
65
  });
66
66
 
67
67
  vi.mock("@glideapps/glide-data-grid-cells", () => ({
68
- DropdownCell: { kind: "dropdown-renderer" },
68
+ DropdownCell: {
69
+ kind: "dropdown-renderer",
70
+ isMatch: (cell: { data: { kind: string } }) =>
71
+ cell.data.kind === "dropdown-cell",
72
+ },
69
73
  }));
70
74
 
71
75
  vi.mock("@/theme/useTheme", () => ({
@@ -74,11 +78,11 @@ vi.mock("@/theme/useTheme", () => ({
74
78
 
75
79
  const editorProps = {
76
80
  data: [{ name: "alice" }],
77
- columnFields: new Map([["name", "string"]]) as Map<string, "string">,
78
- editableColumns: "all" as const,
81
+ columnFields: new Map([["name", "string"]]),
82
+ editableColumns: "all",
79
83
  columnTypes: new Map(),
80
84
  onAddEdits: vi.fn(),
81
- };
85
+ } satisfies React.ComponentProps<typeof GlideDataEditor>;
82
86
 
83
87
  describe("GlideDataEditor portal", () => {
84
88
  let fullscreenElement: Element | null;
@@ -148,7 +152,7 @@ describe("GlideDataEditor portal", () => {
148
152
  },
149
153
  });
150
154
  expect(capturedDataEditor.customRenderers).toEqual([
151
- { kind: "dropdown-renderer" },
155
+ { kind: "dropdown-renderer", isMatch: expect.any(Function) },
152
156
  ]);
153
157
  });
154
158
 
@@ -33,6 +33,9 @@ export function normalizeConfiguredColumns(
33
33
  data: EditorRow[],
34
34
  columnTypes: ColumnTypes,
35
35
  ): EditorRow[] {
36
+ if (columnTypes.size === 0) {
37
+ return data;
38
+ }
36
39
  return data.map((row) => {
37
40
  const normalizedRow = { ...row };
38
41
  for (const [columnName, columnType] of columnTypes) {
@@ -55,11 +55,13 @@ import {
55
55
  } from "./types";
56
56
 
57
57
  function getEditedValue(newValue: EditableGridCell): unknown {
58
- if (newValue.kind !== GridCellKind.Custom) {
59
- return newValue.data;
58
+ if (
59
+ newValue.kind === GridCellKind.Custom &&
60
+ DropdownCellRenderer.isMatch(newValue)
61
+ ) {
62
+ return newValue.data.value;
60
63
  }
61
- const data = newValue.data as { kind?: unknown; value?: unknown };
62
- return data.kind === "dropdown-cell" ? data.value : newValue.data;
64
+ return newValue.data;
63
65
  }
64
66
 
65
67
  interface GlideDataEditorProps {
@@ -190,7 +192,6 @@ export const GlideDataEditor = ({
190
192
  const key = column.title;
191
193
 
192
194
  // Deletes are not handled by validateCell, so we need to handle them here.
193
- // Custom dropdown cells carry their selected value inside their data.
194
195
  let newData = getEditedValue(newValue);
195
196
  if (Array.isArray(column.configuredType)) {
196
197
  if (
@@ -132,7 +132,6 @@ export function pasteCells(options: {
132
132
  const { range } = selection.current;
133
133
  const { x: startCol, y: startRow } = range;
134
134
 
135
- // Read clipboard data
136
135
  navigator.clipboard
137
136
  .readText()
138
137
  .then((clipboardText) => {
@@ -140,43 +139,25 @@ export function pasteCells(options: {
140
139
  return;
141
140
  }
142
141
 
143
- // Parse tab-separated values
144
- const rows = clipboardText.split("\n").filter((row) => row.trim());
145
- const parsedData: string[][] = [];
146
-
147
- for (const row of rows) {
148
- const cells = row.split("\t");
149
- parsedData.push(cells);
150
- }
151
-
152
- if (parsedData.length === 0) {
153
- return;
154
- }
142
+ const parsedData = clipboardText
143
+ .split("\n")
144
+ .filter((row) => row.trim())
145
+ .map((row) => row.split("\t"));
155
146
 
156
147
  const edits: Edits["edits"] = [];
157
148
  const editableColumnSet =
158
149
  editableColumns === "all" ? null : new Set(editableColumns);
159
150
 
160
151
  for (const [rowIndex, dataRow] of parsedData.entries()) {
161
- if (!dataRow) {
162
- continue;
163
- }
164
-
165
152
  const targetRowIdx = startRow + rowIndex;
166
153
 
167
- // Check if we've exceeded the data bounds
168
154
  if (targetRowIdx >= data.length) {
169
155
  break;
170
156
  }
171
157
 
172
158
  for (const [colIndex, cellValue] of dataRow.entries()) {
173
- if (cellValue === undefined) {
174
- continue;
175
- }
176
-
177
159
  const targetColIdx = startCol + colIndex;
178
160
 
179
- // Check if we've exceeded the column bounds
180
161
  if (targetColIdx >= columns.length) {
181
162
  break;
182
163
  }
@@ -191,13 +172,13 @@ export function pasteCells(options: {
191
172
  continue;
192
173
  }
193
174
 
194
- // Convert the value based on the cell type
195
175
  let convertedValue: unknown = cellValue;
196
176
 
197
- if (Array.isArray(columnType)) {
198
- if (!isValidCellValue(dataType, cellValue, columnType)) {
199
- continue;
200
- }
177
+ if (
178
+ Array.isArray(columnType) &&
179
+ !isValidCellValue(dataType, cellValue, columnType)
180
+ ) {
181
+ continue;
201
182
  }
202
183
 
203
184
  switch (dataType) {
@@ -243,12 +224,9 @@ export function pasteCells(options: {
243
224
  continue;
244
225
  }
245
226
 
246
- // Get the column ID from the columns array using the title
247
- const columnId = columns[targetColIdx].title;
248
-
249
227
  edits.push({
250
228
  rowIdx: targetRowIdx,
251
- columnId,
229
+ columnId: column.title,
252
230
  value: convertedValue,
253
231
  });
254
232
  }
@@ -6,8 +6,6 @@ import type { DataType } from "@/core/kernel/messages";
6
6
 
7
7
  export type EditorRow = Record<string, unknown>;
8
8
 
9
- // Shared transport for specialized column editors: dropdown columns use a
10
- // string array, while checkbox columns use the boolean discriminator.
11
9
  export type ColumnType = "boolean" | string[];
12
10
  export type ColumnTypes = Map<string, ColumnType>;
13
11