@marimo-team/islands 0.23.1-dev9 → 0.23.1

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 (84) hide show
  1. package/dist/{ConnectedDataExplorerComponent-tho8l5GC.js → ConnectedDataExplorerComponent-P92i6wYx.js} +148 -148
  2. package/dist/{ImageComparisonComponent-DY3J_vIU.js → ImageComparisonComponent-HF4AY8_n.js} +2 -2
  3. package/dist/{Plot-BxlSHo0G.js → Plot-CK0oVgQL.js} +2 -2
  4. package/dist/{any-language-editor-Caoda-MR.js → any-language-editor-BCvLfvzI.js} +7 -7
  5. package/dist/{button-Cn59RsBF.js → button-D1C3g5GI.js} +72 -71
  6. package/dist/{capabilities-Bml77Di-.js → capabilities-BwpUgo4S.js} +1 -1
  7. package/dist/{chat-ui-Bs4egzxg.js → chat-ui-CNHw9Osh.js} +2829 -2829
  8. package/dist/{check-C51PA02v.js → check-BgrdTLuv.js} +1 -1
  9. package/dist/{chunk-5FQGJX7Z-C428iZBW.js → chunk-5FQGJX7Z-VIref9gx.js} +4 -4
  10. package/dist/{click-outside-container-vCXhHl-R.js → click-outside-container-D3t6KDni.js} +1 -1
  11. package/dist/{code-block-37QAKDTI-D9EnJeBI.js → code-block-37QAKDTI-FQEoMOU1.js} +2 -2
  12. package/dist/{compiler-runtime-B_OLMU9S.js → compiler-runtime-CEbnTgxf.js} +1 -1
  13. package/dist/{copy-DzOz_Au7.js → copy-Bp6CK_Fg.js} +9 -9
  14. package/dist/{data-grid-overlay-editor-lKF301ME.js → data-grid-overlay-editor-C_sKPpLu.js} +4 -4
  15. package/dist/{dist-CjLQ79mo.js → dist-CTtLBPLZ.js} +11 -11
  16. package/dist/{dist-BoNJsA65.js → dist-DUFd1bhm.js} +1 -1
  17. package/dist/{error-banner-BQcJXy6k.js → error-banner-B_ioHva3.js} +121 -121
  18. package/dist/{esm-hRljRgfG.js → esm-CDHI9cuO.js} +15 -15
  19. package/dist/{glide-data-editor-D2X4D_xi.js → glide-data-editor-BFqEJGJW.js} +948 -948
  20. package/dist/{input-BRN2Mjzx.js → input-CSVEkmaZ.js} +288 -288
  21. package/dist/{label-J1N4mVcg.js → label-BebYlsDV.js} +257 -257
  22. package/dist/{loader-JmfPBSx5.js → loader-ZFbGsMN1.js} +15 -15
  23. package/dist/main.js +7178 -7046
  24. package/dist/mermaid-4DMBBIKO-BjtqcdX4.js +6 -0
  25. package/dist/{mermaid-UMKVHs_g.js → mermaid-BbhZNQeB.js} +18 -18
  26. package/dist/{number-overlay-editor-DxLoVuuE.js → number-overlay-editor-B02-t7Ar.js} +2 -2
  27. package/dist/{process-output-BK6F4vqt.js → process-output-Bekznt_B.js} +865 -864
  28. package/dist/{react-dom-BSUuJjCR.js → react-dom-D5FDLRUB.js} +1 -1
  29. package/dist/{react-vega-DayQmZjG.js → react-vega-BkjdpVsR.js} +2 -2
  30. package/dist/{react-vega-CzRAIHrv.js → react-vega-DBwal82H.js} +1 -1
  31. package/dist/{slides-component-_3tukGh-.js → slides-component-DLxprlqo.js} +26 -26
  32. package/dist/{spec-rP6otrXw.js → spec-3EPbPQZH.js} +4 -4
  33. package/dist/style.css +1 -1
  34. package/dist/{toDate-CfGr2xZ1.js → toDate-B1AzlBoW.js} +15 -15
  35. package/dist/{tooltip-CygUI9oH.js → tooltip-DwNnFsxZ.js} +132 -133
  36. package/dist/{types-D4CFUmPq.js → types-pwjdK009.js} +15 -15
  37. package/dist/{useAsyncData-BzS3Ai32.js → useAsyncData-BL98MPIy.js} +3 -3
  38. package/dist/{useDeepCompareMemoize-AjORjhpL.js → useDeepCompareMemoize-CsyOnnjc.js} +25 -25
  39. package/dist/{useIframeCapabilities---aRgGdv.js → useIframeCapabilities-CsTUYYj7.js} +3 -3
  40. package/dist/{useLifecycle-B90lJH4p.js → useLifecycle-DrGGIsgp.js} +36 -36
  41. package/dist/{useTheme-ytmywQ5O.js → useTheme-CzwDokKe.js} +4 -4
  42. package/dist/{vega-component-1icm1Ykb.js → vega-component-KBJXEDZz.js} +42 -42
  43. package/dist/{zod-D4UoCYGu.js → zod-W5ZEjzaE.js} +23 -23
  44. package/package.json +4 -4
  45. package/src/core/islands/__tests__/bridge.test.ts +2 -12
  46. package/src/core/islands/__tests__/islands-harness.test.ts +348 -0
  47. package/src/core/islands/__tests__/parse.test.ts +466 -24
  48. package/src/core/islands/__tests__/test-utils.tsx +263 -0
  49. package/src/core/islands/bootstrap.ts +265 -0
  50. package/src/core/islands/bridge.ts +154 -75
  51. package/src/core/islands/components/IslandControls.tsx +103 -0
  52. package/src/core/islands/components/__tests__/IslandControls.test.tsx +185 -0
  53. package/src/core/islands/components/__tests__/useIslandControls.test.ts +208 -0
  54. package/src/core/islands/components/output-wrapper.tsx +76 -93
  55. package/src/core/islands/components/useIslandControls.ts +60 -0
  56. package/src/core/islands/components/web-components.tsx +168 -40
  57. package/src/core/islands/constants.ts +28 -0
  58. package/src/core/islands/main.ts +7 -205
  59. package/src/core/islands/parse.ts +73 -26
  60. package/src/core/islands/worker-factory.ts +86 -0
  61. package/src/plugins/core/RenderHTML.tsx +9 -0
  62. package/src/plugins/core/__test__/RenderHTML.test.ts +27 -0
  63. package/src/plugins/core/__test__/trusted-url.test.ts +48 -0
  64. package/src/plugins/core/registerReactComponent.tsx +11 -8
  65. package/src/plugins/core/trusted-url.ts +20 -0
  66. package/src/plugins/impl/ButtonPlugin.tsx +4 -6
  67. package/src/plugins/impl/CodeEditorPlugin.tsx +15 -18
  68. package/src/plugins/impl/DataEditorPlugin.tsx +8 -14
  69. package/src/plugins/impl/DataTablePlugin.tsx +8 -9
  70. package/src/plugins/impl/FileUploadPlugin.tsx +39 -43
  71. package/src/plugins/impl/FormPlugin.tsx +2 -6
  72. package/src/plugins/impl/anywidget/__tests__/widget-binding.test.ts +27 -1
  73. package/src/plugins/impl/anywidget/widget-binding.ts +13 -0
  74. package/src/plugins/impl/chat/ChatPlugin.tsx +17 -20
  75. package/src/plugins/impl/data-explorer/DataExplorerPlugin.tsx +5 -8
  76. package/src/plugins/impl/mpl-interactive/MplInteractivePlugin.tsx +21 -0
  77. package/src/plugins/impl/mpl-interactive/__tests__/MplInteractivePlugin.test.tsx +119 -0
  78. package/src/plugins/impl/panel/PanelPlugin.tsx +31 -10
  79. package/src/plugins/impl/panel/__tests__/PanelPlugin.test.ts +60 -0
  80. package/src/plugins/impl/vega/VegaPlugin.tsx +5 -8
  81. package/src/plugins/layout/NavigationMenuPlugin.tsx +2 -6
  82. package/dist/mermaid-4DMBBIKO-Cw46o6DN.js +0 -6
  83. /package/dist/{clsx-yW_RAw0K.js → clsx-CwTY0BxM.js} +0 -0
  84. /package/dist/{react-Bs6Z0kvn.js → react-DA-nE2FX.js} +0 -0
@@ -1,16 +1,16 @@
1
1
  import { s as __toESM } from "./chunk-BNovOVIE.js";
2
- import { t as require_react } from "./react-Bs6Z0kvn.js";
3
- import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
4
- import { t as toDate } from "./toDate-CfGr2xZ1.js";
5
- import { r as cva, y as cn } from "./button-Cn59RsBF.js";
2
+ import { g as cn, r as cva } from "./button-D1C3g5GI.js";
3
+ import { t as require_react } from "./react-DA-nE2FX.js";
4
+ import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
5
+ import { t as toDate } from "./toDate-B1AzlBoW.js";
6
6
  import { t as require_jsx_runtime } from "./jsx-runtime-9hcJiI23.js";
7
- import { C as dequal } from "./useTheme-ytmywQ5O.js";
8
- import { i as tableFromIPC } from "./loader-JmfPBSx5.js";
9
- function isDate(t) {
10
- return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
7
+ import { C as dequal } from "./useTheme-CzwDokKe.js";
8
+ import { i as tableFromIPC } from "./loader-ZFbGsMN1.js";
9
+ function isDate(e) {
10
+ return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
11
11
  }
12
- function isValid(t) {
13
- return !(!isDate(t) && typeof t != "number" || isNaN(+toDate(t)));
12
+ function isValid(e) {
13
+ return !(!isDate(e) && typeof e != "number" || isNaN(+toDate(e)));
14
14
  }
15
15
  var import_compiler_runtime = require_compiler_runtime(), import_react = /* @__PURE__ */ __toESM(require_react(), 1), import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime(), 1), alertVariants = cva("relative w-full rounded-lg border p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11", {
16
16
  variants: { variant: {
@@ -20,9 +20,9 @@ var import_compiler_runtime = require_compiler_runtime(), import_react = /* @__P
20
20
  warning: "bg-(--yellow-2) border-(--yellow-7) text-(--yellow-11) [&>svg]:text-(--yellow-11)"
21
21
  } },
22
22
  defaultVariants: { variant: "default" }
23
- }), Alert = import_react.forwardRef((t, m) => {
23
+ }), Alert = import_react.forwardRef((e, m) => {
24
24
  let h = (0, import_compiler_runtime.c)(11), g, _, v;
25
- h[0] === t ? (g = h[1], _ = h[2], v = h[3]) : ({ className: g, variant: v, ..._ } = t, h[0] = t, h[1] = g, h[2] = _, h[3] = v);
25
+ h[0] === e ? (g = h[1], _ = h[2], v = h[3]) : ({ className: g, variant: v, ..._ } = e, h[0] = e, h[1] = g, h[2] = _, h[3] = v);
26
26
  let y;
27
27
  h[4] !== g || h[5] !== v ? (y = cn(alertVariants({ variant: v }), g), h[4] = g, h[5] = v, h[6] = y) : y = h[6];
28
28
  let b;
@@ -34,9 +34,9 @@ var import_compiler_runtime = require_compiler_runtime(), import_react = /* @__P
34
34
  }), h[7] = _, h[8] = m, h[9] = y, h[10] = b) : b = h[10], b;
35
35
  });
36
36
  Alert.displayName = "Alert";
37
- var AlertTitle = import_react.forwardRef((t, m) => {
37
+ var AlertTitle = import_react.forwardRef((e, m) => {
38
38
  let h = (0, import_compiler_runtime.c)(11), g, _, v;
39
- h[0] === t ? (g = h[1], _ = h[2], v = h[3]) : ({ className: _, children: g, ...v } = t, h[0] = t, h[1] = g, h[2] = _, h[3] = v);
39
+ h[0] === e ? (g = h[1], _ = h[2], v = h[3]) : ({ className: _, children: g, ...v } = e, h[0] = e, h[1] = g, h[2] = _, h[3] = v);
40
40
  let y;
41
41
  h[4] === _ ? y = h[5] : (y = cn("mb-1 font-medium leading-none tracking-tight", _), h[4] = _, h[5] = y);
42
42
  let b;
@@ -48,9 +48,9 @@ var AlertTitle = import_react.forwardRef((t, m) => {
48
48
  }), h[6] = g, h[7] = v, h[8] = m, h[9] = y, h[10] = b) : b = h[10], b;
49
49
  });
50
50
  AlertTitle.displayName = "AlertTitle";
51
- var AlertDescription = import_react.forwardRef((t, m) => {
51
+ var AlertDescription = import_react.forwardRef((e, m) => {
52
52
  let h = (0, import_compiler_runtime.c)(9), g, _;
53
- h[0] === t ? (g = h[1], _ = h[2]) : ({ className: g, ..._ } = t, h[0] = t, h[1] = g, h[2] = _);
53
+ h[0] === e ? (g = h[1], _ = h[2]) : ({ className: g, ..._ } = e, h[0] = e, h[1] = g, h[2] = _);
54
54
  let v;
55
55
  h[3] === g ? v = h[4] : (v = cn("text-sm [&_p]:leading-relaxed", g), h[3] = g, h[4] = v);
56
56
  let y;
@@ -61,19 +61,19 @@ var AlertDescription = import_react.forwardRef((t, m) => {
61
61
  }), h[5] = _, h[6] = m, h[7] = v, h[8] = y) : y = h[8], y;
62
62
  });
63
63
  AlertDescription.displayName = "AlertDescription";
64
- function arrow(t) {
65
- function m(t2) {
66
- return !!(t2 == null ? void 0 : t2.schema) && Array.isArray(t2.schema.fields) && typeof t2.toArray == "function";
64
+ function arrow(e) {
65
+ function p(e2) {
66
+ return !!(e2 == null ? void 0 : e2.schema) && Array.isArray(e2.schema.fields) && typeof e2.toArray == "function";
67
67
  }
68
- return (m(t) ? t : decodeIPC(t)).toArray();
68
+ return (p(e) ? e : decodeIPC(e)).toArray();
69
69
  }
70
70
  arrow.responseType = "arrayBuffer";
71
- function decodeIPC(t, m) {
72
- return tableFromIPC(t, m ?? { useProxy: true });
71
+ function decodeIPC(e, p) {
72
+ return tableFromIPC(e, p ?? { useProxy: true });
73
73
  }
74
- function useDeepCompareMemoize(t) {
75
- let m = import_react.useRef(t);
76
- return dequal(t, m.current) || (m.current = t), m.current;
74
+ function useDeepCompareMemoize(e) {
75
+ let p = import_react.useRef(e);
76
+ return dequal(e, p.current) || (p.current = e), p.current;
77
77
  }
78
78
  export {
79
79
  AlertTitle as a,
@@ -1,7 +1,7 @@
1
1
  import { s as __toESM } from "./chunk-BNovOVIE.js";
2
- import { t as require_react } from "./react-Bs6Z0kvn.js";
3
- import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
4
- import { t as getIframeCapabilities } from "./capabilities-Bml77Di-.js";
2
+ import { t as require_react } from "./react-DA-nE2FX.js";
3
+ import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
4
+ import { t as getIframeCapabilities } from "./capabilities-BwpUgo4S.js";
5
5
  var import_compiler_runtime = require_compiler_runtime();
6
6
  require_react();
7
7
  function useIframeCapabilities() {
@@ -1,10 +1,10 @@
1
1
  import { s as __toESM } from "./chunk-BNovOVIE.js";
2
- import { t as require_react } from "./react-Bs6Z0kvn.js";
3
- import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
4
- import { u as createLucideIcon } from "./dist-CjLQ79mo.js";
5
- import { g as Logger, r as cva, y as cn } from "./button-Cn59RsBF.js";
2
+ import { _ as Logger, g as cn, r as cva } from "./button-D1C3g5GI.js";
3
+ import { t as require_react } from "./react-DA-nE2FX.js";
4
+ import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
5
+ import { u as createLucideIcon } from "./dist-CTtLBPLZ.js";
6
6
  import { t as require_jsx_runtime } from "./jsx-runtime-9hcJiI23.js";
7
- import { _ as useSetAtom, y as atom } from "./useTheme-ytmywQ5O.js";
7
+ import { _ as useSetAtom, y as atom } from "./useTheme-CzwDokKe.js";
8
8
  var Calendar = createLucideIcon("calendar", [
9
9
  ["path", {
10
10
  d: "M8 2v4",
@@ -81,50 +81,50 @@ var Calendar = createLucideIcon("calendar", [
81
81
  key: "s66wpe"
82
82
  }]
83
83
  ]), import_compiler_runtime$2 = require_compiler_runtime();
84
- function createReducer(e, m) {
84
+ function createReducer(e, h) {
85
85
  return {
86
- reducer: (h, g) => (h || (h = e()), g.type in m ? m[g.type](h, g.payload) : (Logger.error(`Action type ${g.type} is not defined in reducers.`), h)),
86
+ reducer: (g, _) => (g || (g = e()), _.type in h ? h[_.type](g, _.payload) : (Logger.error(`Action type ${_.type} is not defined in reducers.`), g)),
87
87
  createActions: (e2) => {
88
- let h = {};
89
- for (let g in m) h[g] = (m2) => {
88
+ let m = {};
89
+ for (let g in h) m[g] = (m2) => {
90
90
  e2({
91
91
  type: g,
92
92
  payload: m2
93
93
  });
94
94
  };
95
- return h;
95
+ return m;
96
96
  }
97
97
  };
98
98
  }
99
- function createReducerAndAtoms(e, m, h) {
100
- let g = [...h ?? []], v = (e2) => {
101
- g.push(e2);
102
- }, { reducer: y, createActions: b } = createReducer(e, m), x = (e2, m2) => {
99
+ function createReducerAndAtoms(e, h, g) {
100
+ let _ = [...g ?? []], v = (e2) => {
101
+ _.push(e2);
102
+ }, { reducer: y, createActions: b } = createReducer(e, h), x = (e2, h2) => {
103
103
  try {
104
- let h2 = y(e2, m2);
105
- for (let v2 of g) try {
106
- v2(e2, h2, m2);
104
+ let g2 = y(e2, h2);
105
+ for (let v2 of _) try {
106
+ v2(e2, g2, h2);
107
107
  } catch (e3) {
108
- Logger.error(`Error in middleware for action ${m2.type}:`, e3);
108
+ Logger.error(`Error in middleware for action ${h2.type}:`, e3);
109
109
  }
110
- return h2;
111
- } catch (h2) {
112
- return Logger.error(`Error in reducer for action ${m2.type}:`, h2), e2;
110
+ return g2;
111
+ } catch (g2) {
112
+ return Logger.error(`Error in reducer for action ${h2.type}:`, g2), e2;
113
113
  }
114
114
  }, S = atom(e()), C = /* @__PURE__ */ new WeakMap();
115
115
  function w(e2) {
116
- let m2 = (0, import_compiler_runtime$2.c)(4), h2 = e2 === void 0 ? {} : e2, g2 = useSetAtom(S);
116
+ let m = (0, import_compiler_runtime$2.c)(4), h2 = e2 === void 0 ? {} : e2, g2 = useSetAtom(S);
117
117
  if (h2.skipMiddleware === true) {
118
118
  let e3;
119
- return m2[0] === g2 ? e3 = m2[1] : (e3 = b((e4) => {
120
- g2((m3) => y(m3, e4));
121
- }), m2[0] = g2, m2[1] = e3), e3;
119
+ return m[0] === g2 ? e3 = m[1] : (e3 = b((e4) => {
120
+ g2((m2) => y(m2, e4));
121
+ }), m[0] = g2, m[1] = e3), e3;
122
122
  }
123
123
  C.has(g2) || C.set(g2, b((e3) => {
124
- g2((m3) => x(m3, e3));
124
+ g2((m2) => x(m2, e3));
125
125
  }));
126
- let _;
127
- return m2[2] === g2 ? _ = m2[3] : (_ = C.get(g2), m2[2] = g2, m2[3] = _), _;
126
+ let _2;
127
+ return m[2] === g2 ? _2 = m[3] : (_2 = C.get(g2), m[2] = g2, m[3] = _2), _2;
128
128
  }
129
129
  return {
130
130
  reducer: x,
@@ -145,15 +145,15 @@ var import_compiler_runtime$1 = require_compiler_runtime(), import_react = /* @_
145
145
  } },
146
146
  defaultVariants: { variant: "default" }
147
147
  }), Badge = (e) => {
148
- let m = (0, import_compiler_runtime$1.c)(10), h, g, _;
149
- m[0] === e ? (h = m[1], g = m[2], _ = m[3]) : ({ className: h, variant: _, ...g } = e, m[0] = e, m[1] = h, m[2] = g, m[3] = _);
150
- let v;
151
- m[4] !== h || m[5] !== _ ? (v = cn(badgeVariants({ variant: _ }), h), m[4] = h, m[5] = _, m[6] = v) : v = m[6];
148
+ let m = (0, import_compiler_runtime$1.c)(10), g, _, v;
149
+ m[0] === e ? (g = m[1], _ = m[2], v = m[3]) : ({ className: g, variant: v, ..._ } = e, m[0] = e, m[1] = g, m[2] = _, m[3] = v);
150
+ let y;
151
+ m[4] !== g || m[5] !== v ? (y = cn(badgeVariants({ variant: v }), g), m[4] = g, m[5] = v, m[6] = y) : y = m[6];
152
152
  let b;
153
- return m[7] !== g || m[8] !== v ? (b = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
154
- className: v,
155
- ...g
156
- }), m[7] = g, m[8] = v, m[9] = b) : b = m[9], b;
153
+ return m[7] !== _ || m[8] !== y ? (b = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
154
+ className: y,
155
+ ..._
156
+ }), m[7] = _, m[8] = y, m[9] = b) : b = m[9], b;
157
157
  }, import_compiler_runtime = require_compiler_runtime();
158
158
  function useOnMount(e) {
159
159
  let m = (0, import_compiler_runtime.c)(1), h;
@@ -1,8 +1,8 @@
1
1
  import { s as __toESM } from "./chunk-BNovOVIE.js";
2
- import { t as require_react } from "./react-Bs6Z0kvn.js";
3
- import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
4
- import { a as OverridingHotkeyProvider, g as Logger, s as resolvePlatform } from "./button-Cn59RsBF.js";
5
- import { A as looseObject, B as union, I as record, N as number, P as object, R as string, T as boolean, b as _enum, w as array } from "./zod-D4UoCYGu.js";
2
+ import { _ as Logger, a as OverridingHotkeyProvider, s as resolvePlatform } from "./button-D1C3g5GI.js";
3
+ import { t as require_react } from "./react-DA-nE2FX.js";
4
+ import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
5
+ import { A as looseObject, B as union, I as record, N as number, P as object, R as string, T as boolean, b as _enum, w as array } from "./zod-W5ZEjzaE.js";
6
6
  import { t as merge_default } from "./merge-CVhG7q_o.js";
7
7
  var import_react = /* @__PURE__ */ __toESM(require_react()), useInsertionEffect = typeof window < "u" ? import_react.useInsertionEffect || import_react.useLayoutEffect : () => {
8
8
  };
@@ -1,21 +1,21 @@
1
1
  import { s as __toESM } from "./chunk-BNovOVIE.js";
2
- import { t as require_react } from "./react-Bs6Z0kvn.js";
3
- import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
4
- import { c as asRemoteURL, g as CircleQuestionMark } from "./toDate-CfGr2xZ1.js";
5
- import { c as Objects, g as Logger, h as Events, y as cn } from "./button-Cn59RsBF.js";
6
- import "./react-dom-BSUuJjCR.js";
2
+ import { _ as Logger, c as Objects, g as cn, h as Events } from "./button-D1C3g5GI.js";
3
+ import { t as require_react } from "./react-DA-nE2FX.js";
4
+ import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
5
+ import { c as asRemoteURL, g as CircleQuestionMark } from "./toDate-B1AzlBoW.js";
6
+ import "./react-dom-D5FDLRUB.js";
7
7
  import { t as require_jsx_runtime } from "./jsx-runtime-9hcJiI23.js";
8
- import "./zod-D4UoCYGu.js";
9
- import { n as ErrorBanner } from "./error-banner-BQcJXy6k.js";
10
- import { t as Tooltip } from "./tooltip-CygUI9oH.js";
8
+ import "./zod-W5ZEjzaE.js";
9
+ import { n as ErrorBanner } from "./error-banner-B_ioHva3.js";
10
+ import { t as Tooltip } from "./tooltip-DwNnFsxZ.js";
11
11
  import { i as debounce_default } from "./constants-CvyfaCvs.js";
12
- import { n as useTheme, w as useEvent_default } from "./useTheme-ytmywQ5O.js";
12
+ import { n as useTheme, w as useEvent_default } from "./useTheme-CzwDokKe.js";
13
13
  import { s as uniq } from "./arrays-beUWo8RF.js";
14
- import { a as AlertTitle, n as arrow, o as isValid, r as Alert, t as useDeepCompareMemoize } from "./useDeepCompareMemoize-AjORjhpL.js";
14
+ import { a as AlertTitle, n as arrow, o as isValid, r as Alert, t as useDeepCompareMemoize } from "./useDeepCompareMemoize-CsyOnnjc.js";
15
15
  import { n as formats } from "./vega-loader.browser-DqEcFOPD.js";
16
- import { a as getContainerWidth, n as vegaLoadData, s as tooltipHandler } from "./loader-JmfPBSx5.js";
17
- import { t as useAsyncData } from "./useAsyncData-BzS3Ai32.js";
18
- import { t as j } from "./react-vega-CzRAIHrv.js";
16
+ import { a as getContainerWidth, n as vegaLoadData, s as tooltipHandler } from "./loader-ZFbGsMN1.js";
17
+ import { t as useAsyncData } from "./useAsyncData-BL98MPIy.js";
18
+ import { t as j } from "./react-vega-DBwal82H.js";
19
19
  import "./defaultLocale-qS7DaAmi.js";
20
20
  import "./defaultLocale-Bxoo2-30.js";
21
21
  var import_compiler_runtime = require_compiler_runtime(), import_react = /* @__PURE__ */ __toESM(require_react(), 1);
@@ -483,20 +483,20 @@ async function resolveVegaSpecData(e) {
483
483
  ...e2,
484
484
  spec: await w(e2.spec)
485
485
  }), !e2.data || !("url" in e2.data)) return e2;
486
- let E2;
486
+ let T2;
487
487
  try {
488
- E2 = asRemoteURL(e2.data.url);
488
+ T2 = asRemoteURL(e2.data.url);
489
489
  } catch {
490
490
  return e2;
491
491
  }
492
- let D = await vegaLoadData(E2.href, e2.data.format);
493
- return C[E2.pathname] = D, {
492
+ let E = await vegaLoadData(T2.href, e2.data.format);
493
+ return C[T2.pathname] = E, {
494
494
  ...e2,
495
- data: { name: E2.pathname }
495
+ data: { name: T2.pathname }
496
496
  };
497
- }, E = await w(e);
498
- return Object.keys(C).length === 0 ? E : {
499
- ...E,
497
+ }, T = await w(e);
498
+ return Object.keys(C).length === 0 ? T : {
499
+ ...T,
500
500
  datasets: C
501
501
  };
502
502
  }
@@ -520,29 +520,29 @@ var VegaComponent = (e) => {
520
520
  spec: P,
521
521
  embedOptions: k
522
522
  }), C[5] = E, C[6] = k, C[7] = D, C[8] = P, C[9] = T, C[10] = w, C[11] = I) : I = C[11], I;
523
- }, LoadedVegaComponent = ({ value: e, setValue: C, chartSelection: w, fieldSelection: T, spec: M, embedOptions: N }) => {
523
+ }, LoadedVegaComponent = ({ value: e, setValue: D, chartSelection: O, fieldSelection: k, spec: M, embedOptions: N }) => {
524
524
  let { theme: L } = useTheme(), R = (0, import_react.useRef)(null), z = (0, import_react.useRef)(void 0), [B, V] = (0, import_react.useState)(), H = (0, import_react.useMemo)(() => N && "actions" in N ? N.actions : {
525
525
  source: false,
526
526
  compiled: false
527
527
  }, [N]), U = useDeepCompareMemoize(M), W = (0, import_react.useMemo)(() => makeSelectable(fixRelativeUrl(U), {
528
- chartSelection: w,
529
- fieldSelection: T
528
+ chartSelection: O,
529
+ fieldSelection: k
530
530
  }), [
531
531
  U,
532
- w,
533
- T
534
- ]), G = (0, import_react.useMemo)(() => getSelectionParamNames(W), [W]), K = useEvent_default((w2) => {
535
- C({
532
+ O,
533
+ k
534
+ ]), G = (0, import_react.useMemo)(() => getSelectionParamNames(W), [W]), K = useEvent_default((C) => {
535
+ D({
536
536
  ...e,
537
- ...w2
537
+ ...C
538
538
  });
539
- }), q = (0, import_react.useMemo)(() => debounce_default((e2, C2) => {
540
- Logger.debug("[Vega signal]", e2, C2);
541
- let w2 = Objects.mapValues(C2, convertDatetimeToEpochMilliseconds);
542
- w2 = Objects.mapValues(w2, convertSetToList), K({ [e2]: w2 });
543
- }, 100), [K]), J = useDeepCompareMemoize(G), Y = (0, import_react.useMemo)(() => J.reduce((e2, C2) => (ParamNames.PAN_ZOOM === C2 || ParamNames.isBinColoring(C2) || e2.push({
544
- signalName: C2,
545
- handler: (e3, C3) => q(e3, C3)
539
+ }), q = (0, import_react.useMemo)(() => debounce_default((e2, T) => {
540
+ Logger.debug("[Vega signal]", e2, T);
541
+ let E = Objects.mapValues(T, convertDatetimeToEpochMilliseconds);
542
+ E = Objects.mapValues(E, convertSetToList), K({ [e2]: E });
543
+ }, 100), [K]), J = useDeepCompareMemoize(G), Y = (0, import_react.useMemo)(() => J.reduce((e2, C) => (ParamNames.PAN_ZOOM === C || ParamNames.isBinColoring(C) || e2.push({
544
+ signalName: C,
545
+ handler: (e3, C2) => q(e3, C2)
546
546
  }), e2), []), [J, q]), X = useEvent_default((e2) => {
547
547
  Logger.error(e2), Logger.debug(W), V(e2);
548
548
  }), Z = useEvent_default((e2) => {
@@ -554,14 +554,14 @@ var VegaComponent = (e) => {
554
554
  side: "left",
555
555
  content: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
556
556
  className: "text-xs flex flex-col",
557
- children: e2.map((e3, C2) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
557
+ children: e2.map((e3, C) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
558
558
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
559
559
  className: "font-bold tracking-wide",
560
560
  children: [e3[0], ":"]
561
561
  }),
562
562
  " ",
563
563
  e3[1]
564
- ] }, C2))
564
+ ] }, C))
565
565
  }),
566
566
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CircleQuestionMark, { className: "absolute bottom-1 right-0 m-2 h-4 w-4 cursor-help text-muted-foreground hover:text-foreground" })
567
567
  });
@@ -578,16 +578,16 @@ var VegaComponent = (e) => {
578
578
  onError: X,
579
579
  onEmbed: Z
580
580
  });
581
- return (0, import_react.useEffect)(() => (Y.forEach(({ signalName: e2, handler: C2 }) => {
581
+ return (0, import_react.useEffect)(() => (Y.forEach(({ signalName: e2, handler: w }) => {
582
582
  try {
583
- $ == null ? void 0 : $.view.addSignalListener(e2, C2);
583
+ $ == null ? void 0 : $.view.addSignalListener(e2, w);
584
584
  } catch (e3) {
585
585
  Logger.error(e3);
586
586
  }
587
587
  }), () => {
588
- Y.forEach(({ signalName: e2, handler: C2 }) => {
588
+ Y.forEach(({ signalName: e2, handler: w }) => {
589
589
  try {
590
- $ == null ? void 0 : $.view.removeSignalListener(e2, C2);
590
+ $ == null ? void 0 : $.view.removeSignalListener(e2, w);
591
591
  } catch (e3) {
592
592
  Logger.error(e3);
593
593
  }
@@ -1,8 +1,8 @@
1
1
  import { r as __export, s as __toESM } from "./chunk-BNovOVIE.js";
2
- import { t as require_react } from "./react-Bs6Z0kvn.js";
3
- import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
4
- import { d as createSlot, l as useEventListener, m as useComposedRefs } from "./button-Cn59RsBF.js";
5
- import { t as require_react_dom } from "./react-dom-BSUuJjCR.js";
2
+ import { d as createSlot, l as useEventListener, m as useComposedRefs } from "./button-D1C3g5GI.js";
3
+ import { t as require_react } from "./react-DA-nE2FX.js";
4
+ import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
5
+ import { t as require_react_dom } from "./react-dom-D5FDLRUB.js";
6
6
  import { t as require_jsx_runtime } from "./jsx-runtime-9hcJiI23.js";
7
7
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1), import_react_dom$1 = /* @__PURE__ */ __toESM(require_react_dom(), 1), import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime(), 1), Primitive = [
8
8
  "a",
@@ -23,16 +23,16 @@ var import_react = /* @__PURE__ */ __toESM(require_react(), 1), import_react_dom
23
23
  "svg",
24
24
  "ul"
25
25
  ].reduce((e, E) => {
26
- let D = createSlot(`Primitive.${E}`), O = import_react.forwardRef((e2, O2) => {
27
- let { asChild: k, ...A } = e2, j = k ? D : E;
26
+ let O = createSlot(`Primitive.${E}`), k = import_react.forwardRef((e2, D) => {
27
+ let { asChild: k2, ...A } = e2, j = k2 ? O : E;
28
28
  return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = true), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(j, {
29
29
  ...A,
30
- ref: O2
30
+ ref: D
31
31
  });
32
32
  });
33
- return O.displayName = `Primitive.${E}`, {
33
+ return k.displayName = `Primitive.${E}`, {
34
34
  ...e,
35
- [E]: O
35
+ [E]: k
36
36
  };
37
37
  }, {});
38
38
  function dispatchDiscreteCustomEvent(e, E) {
@@ -169,8 +169,8 @@ function useStateMachine(e, E) {
169
169
  return import_react.useReducer((e2, D) => E[e2][D] ?? e2, e);
170
170
  }
171
171
  var Presence = (e) => {
172
- let { present: E, children: D } = e, O = usePresence(E), k = typeof D == "function" ? D({ present: O.isPresent }) : import_react.Children.only(D), A = useComposedRefs(O.ref, getElementRef(k));
173
- return typeof D == "function" || O.isPresent ? import_react.cloneElement(k, { ref: A }) : null;
172
+ let { present: E, children: D } = e, O = usePresence(E), A = typeof D == "function" ? D({ present: O.isPresent }) : import_react.Children.only(D), j = useComposedRefs(O.ref, getElementRef(A));
173
+ return typeof D == "function" || O.isPresent ? import_react.cloneElement(A, { ref: j }) : null;
174
174
  };
175
175
  Presence.displayName = "Presence";
176
176
  function usePresence(e) {
@@ -256,12 +256,12 @@ var DISMISSABLE_LAYER_NAME = "DismissableLayer", CONTEXT_UPDATE = "dismissableLa
256
256
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
257
257
  branches: /* @__PURE__ */ new Set()
258
258
  }), DismissableLayer = import_react.forwardRef((e, E) => {
259
- let { disableOutsidePointerEvents: D = false, onEscapeKeyDown: O, onPointerDownOutside: k, onFocusOutside: A, onInteractOutside: M, onDismiss: N, ...F } = e, R = import_react.useContext(DismissableLayerContext), [B, V] = import_react.useState(null), H = (B == null ? void 0 : B.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, W] = import_react.useState({}), G = useComposedRefs(E, (e2) => V(e2)), K = Array.from(R.layers), [q] = [...R.layersWithOutsidePointerEventsDisabled].slice(-1), J = K.indexOf(q), Y = B ? K.indexOf(B) : -1, X = R.layersWithOutsidePointerEventsDisabled.size > 0, Z = Y >= J, Q = usePointerDownOutside((e2) => {
259
+ let { disableOutsidePointerEvents: D = false, onEscapeKeyDown: O, onPointerDownOutside: A, onFocusOutside: j, onInteractOutside: M, onDismiss: N, ...F } = e, R = import_react.useContext(DismissableLayerContext), [B, V] = import_react.useState(null), H = (B == null ? void 0 : B.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, W] = import_react.useState({}), G = useComposedRefs(E, (e2) => V(e2)), K = Array.from(R.layers), [q] = [...R.layersWithOutsidePointerEventsDisabled].slice(-1), J = K.indexOf(q), Y = B ? K.indexOf(B) : -1, X = R.layersWithOutsidePointerEventsDisabled.size > 0, Z = Y >= J, Q = usePointerDownOutside((e2) => {
260
260
  let E2 = e2.target, D2 = [...R.branches].some((e3) => e3.contains(E2));
261
- !Z || D2 || (k == null ? void 0 : k(e2), M == null ? void 0 : M(e2), e2.defaultPrevented || (N == null ? void 0 : N()));
261
+ !Z || D2 || (A == null ? void 0 : A(e2), M == null ? void 0 : M(e2), e2.defaultPrevented || (N == null ? void 0 : N()));
262
262
  }, H), $ = useFocusOutside((e2) => {
263
263
  let E2 = e2.target;
264
- [...R.branches].some((e3) => e3.contains(E2)) || (A == null ? void 0 : A(e2), M == null ? void 0 : M(e2), e2.defaultPrevented || (N == null ? void 0 : N()));
264
+ [...R.branches].some((e3) => e3.contains(E2)) || (j == null ? void 0 : j(e2), M == null ? void 0 : M(e2), e2.defaultPrevented || (N == null ? void 0 : N()));
265
265
  }, H);
266
266
  return useEscapeKeydown((e2) => {
267
267
  Y === R.layers.size - 1 && (O == null ? void 0 : O(e2), !e2.defaultPrevented && N && (e2.preventDefault(), N()));
@@ -293,7 +293,7 @@ var DISMISSABLE_LAYER_NAME = "DismissableLayer", CONTEXT_UPDATE = "dismissableLa
293
293
  });
294
294
  DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
295
295
  var BRANCH_NAME = "DismissableLayerBranch", DismissableLayerBranch = import_react.forwardRef((e, E) => {
296
- let D = import_react.useContext(DismissableLayerContext), O = import_react.useRef(null), k = useComposedRefs(E, O);
296
+ let D = import_react.useContext(DismissableLayerContext), O = import_react.useRef(null), A = useComposedRefs(E, O);
297
297
  return import_react.useEffect(() => {
298
298
  let e2 = O.current;
299
299
  if (e2) return D.branches.add(e2), () => {
@@ -301,7 +301,7 @@ var BRANCH_NAME = "DismissableLayerBranch", DismissableLayerBranch = import_reac
301
301
  };
302
302
  }, [D.branches]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
303
303
  ...e,
304
- ref: k
304
+ ref: A
305
305
  });
306
306
  });
307
307
  DismissableLayerBranch.displayName = BRANCH_NAME;
@@ -353,7 +353,7 @@ var Root = DismissableLayer, Branch = DismissableLayerBranch, AUTOFOCUS_ON_MOUNT
353
353
  bubbles: false,
354
354
  cancelable: true
355
355
  }, FOCUS_SCOPE_NAME = "FocusScope", FocusScope = import_react.forwardRef((e, E) => {
356
- let { loop: D = false, trapped: O = false, onMountAutoFocus: k, onUnmountAutoFocus: A, ...M } = e, [N, F] = import_react.useState(null), R = useCallbackRef$1(k), B = useCallbackRef$1(A), V = import_react.useRef(null), H = useComposedRefs(E, (e2) => F(e2)), U = import_react.useRef({
356
+ let { loop: D = false, trapped: O = false, onMountAutoFocus: A, onUnmountAutoFocus: j, ...M } = e, [N, F] = import_react.useState(null), R = useCallbackRef$1(A), B = useCallbackRef$1(j), V = import_react.useRef(null), H = useComposedRefs(E, (e2) => F(e2)), U = import_react.useRef({
357
357
  paused: false,
358
358
  pause() {
359
359
  this.paused = true;
@@ -411,10 +411,10 @@ var Root = DismissableLayer, Branch = DismissableLayerBranch, AUTOFOCUS_ON_MOUNT
411
411
  ]);
412
412
  let W = import_react.useCallback((e2) => {
413
413
  if (!D && !O || U.paused) return;
414
- let E2 = e2.key === "Tab" && !e2.altKey && !e2.ctrlKey && !e2.metaKey, k2 = document.activeElement;
415
- if (E2 && k2) {
414
+ let E2 = e2.key === "Tab" && !e2.altKey && !e2.ctrlKey && !e2.metaKey, k = document.activeElement;
415
+ if (E2 && k) {
416
416
  let E3 = e2.currentTarget, [O2, A2] = getTabbableEdges(E3);
417
- O2 && A2 ? !e2.shiftKey && k2 === A2 ? (e2.preventDefault(), D && focus(O2, { select: true })) : e2.shiftKey && k2 === O2 && (e2.preventDefault(), D && focus(A2, { select: true })) : k2 === E3 && e2.preventDefault();
417
+ O2 && A2 ? !e2.shiftKey && k === A2 ? (e2.preventDefault(), D && focus(O2, { select: true })) : e2.shiftKey && k === O2 && (e2.preventDefault(), D && focus(A2, { select: true })) : k === E3 && e2.preventDefault();
418
418
  }
419
419
  }, [
420
420
  D,
@@ -1069,10 +1069,10 @@ function isInVscodeExtension() {
1069
1069
  var import_compiler_runtime = require_compiler_runtime(), VSCODE_OUTPUT_CONTAINER_SELECTOR = "[data-vscode-output-container]";
1070
1070
  const MAX_HEIGHT_OFFSET = isInVscodeExtension() ? 0 : 30;
1071
1071
  function useFullScreenElement() {
1072
- let e = (0, import_compiler_runtime.c)(1), [E, D] = (0, import_react.useState)(document.fullscreenElement), O;
1073
- return e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = () => {
1072
+ let e = (0, import_compiler_runtime.c)(1), [E, D] = (0, import_react.useState)(document.fullscreenElement), k;
1073
+ return e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = () => {
1074
1074
  D(document.fullscreenElement);
1075
- }, e[0] = O) : O = e[0], useEventListener(document, "fullscreenchange", O), E;
1075
+ }, e[0] = k) : k = e[0], useEventListener(document, "fullscreenchange", k), E;
1076
1076
  }
1077
1077
  function withFullScreenAsRoot(e) {
1078
1078
  let E = (E2) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/islands",
3
- "version": "0.23.1-dev9",
3
+ "version": "0.23.1",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -123,6 +123,7 @@
123
123
  "path-to-regexp": "^8.4.0",
124
124
  "plotly.js": "^3.3.1",
125
125
  "pyodide": "0.27.7",
126
+ "radix-ui": "1.4.3",
126
127
  "react-arborist": "^3.4.3",
127
128
  "react-aria": "3.47.0",
128
129
  "react-aria-components": "1.16.0",
@@ -159,8 +160,7 @@
159
160
  "vscode-jsonrpc": "^8.2.1",
160
161
  "vscode-languageserver-protocol": "^3.17.5",
161
162
  "web-vitals": "^4.2.4",
162
- "zod": "^4.3.6",
163
- "radix-ui": "1.4.3"
163
+ "zod": "^4.3.6"
164
164
  },
165
165
  "scripts": {
166
166
  "preinstall": "npx only-allow pnpm",
@@ -217,7 +217,7 @@
217
217
  "oxfmt": "^0.42.0",
218
218
  "oxlint": "^1.58.0",
219
219
  "postcss": "^8.5.6",
220
- "postcss-plugin-namespace": "^0.0.3",
220
+ "postcss-prefix-selector": "^2.1.1",
221
221
  "react": "^19.2.4",
222
222
  "react-compiler-runtime": "19.1.0-rc.3",
223
223
  "react-dom": "^19.2.4",
@@ -1,7 +1,7 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
 
3
3
  import type { components } from "@marimo-team/marimo-api";
4
- import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
4
+ import { beforeEach, describe, expect, it, vi } from "vitest";
5
5
  import {
6
6
  cellId,
7
7
  requestId,
@@ -83,17 +83,7 @@ describe("IslandsPyodideBridge", () => {
83
83
 
84
84
  beforeEach(() => {
85
85
  vi.clearAllMocks();
86
- // Reset the singleton by clearing the window property
87
- // oxlint-disable-next-line typescript/no-explicit-any
88
- delete (window as any)._marimo_private_IslandsPyodideBridge;
89
- // Access the singleton - creates a fresh instance
90
- bridge = IslandsPyodideBridge.INSTANCE;
91
- });
92
-
93
- afterEach(() => {
94
- // Clean up singleton
95
- // oxlint-disable-next-line typescript/no-explicit-any
96
- delete (window as any)._marimo_private_IslandsPyodideBridge;
86
+ bridge = new IslandsPyodideBridge({ autoStartSessions: false });
97
87
  });
98
88
 
99
89
  describe("sendComponentValues", () => {