@marimo-team/islands 0.23.1-dev9 → 0.23.2-dev1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ConnectedDataExplorerComponent-tho8l5GC.js → ConnectedDataExplorerComponent-P92i6wYx.js} +148 -148
- package/dist/{ImageComparisonComponent-DY3J_vIU.js → ImageComparisonComponent-HF4AY8_n.js} +2 -2
- package/dist/{Plot-BxlSHo0G.js → Plot-CK0oVgQL.js} +2 -2
- package/dist/{any-language-editor-Caoda-MR.js → any-language-editor-BCvLfvzI.js} +7 -7
- package/dist/{button-Cn59RsBF.js → button-D1C3g5GI.js} +72 -71
- package/dist/{capabilities-Bml77Di-.js → capabilities-BwpUgo4S.js} +1 -1
- package/dist/{chat-ui-Bs4egzxg.js → chat-ui-CNHw9Osh.js} +2829 -2829
- package/dist/{check-C51PA02v.js → check-BgrdTLuv.js} +1 -1
- package/dist/{chunk-5FQGJX7Z-C428iZBW.js → chunk-5FQGJX7Z-VIref9gx.js} +4 -4
- package/dist/{click-outside-container-vCXhHl-R.js → click-outside-container-D3t6KDni.js} +1 -1
- package/dist/{code-block-37QAKDTI-D9EnJeBI.js → code-block-37QAKDTI-FQEoMOU1.js} +2 -2
- package/dist/{compiler-runtime-B_OLMU9S.js → compiler-runtime-CEbnTgxf.js} +1 -1
- package/dist/{copy-DzOz_Au7.js → copy-Bp6CK_Fg.js} +9 -9
- package/dist/{data-grid-overlay-editor-lKF301ME.js → data-grid-overlay-editor-C_sKPpLu.js} +4 -4
- package/dist/{dist-CjLQ79mo.js → dist-CTtLBPLZ.js} +11 -11
- package/dist/{dist-BoNJsA65.js → dist-DUFd1bhm.js} +1 -1
- package/dist/{error-banner-BQcJXy6k.js → error-banner-B_ioHva3.js} +121 -121
- package/dist/{esm-hRljRgfG.js → esm-CDHI9cuO.js} +15 -15
- package/dist/{glide-data-editor-D2X4D_xi.js → glide-data-editor-BFqEJGJW.js} +948 -948
- package/dist/{input-BRN2Mjzx.js → input-CSVEkmaZ.js} +288 -288
- package/dist/{label-J1N4mVcg.js → label-BebYlsDV.js} +257 -257
- package/dist/{loader-JmfPBSx5.js → loader-ZFbGsMN1.js} +15 -15
- package/dist/main.js +7216 -7050
- package/dist/mermaid-4DMBBIKO-BjtqcdX4.js +6 -0
- package/dist/{mermaid-UMKVHs_g.js → mermaid-BbhZNQeB.js} +18 -18
- package/dist/{number-overlay-editor-DxLoVuuE.js → number-overlay-editor-B02-t7Ar.js} +2 -2
- package/dist/{process-output-BK6F4vqt.js → process-output-Bekznt_B.js} +865 -864
- package/dist/{react-dom-BSUuJjCR.js → react-dom-D5FDLRUB.js} +1 -1
- package/dist/{react-vega-DayQmZjG.js → react-vega-BkjdpVsR.js} +2 -2
- package/dist/{react-vega-CzRAIHrv.js → react-vega-DBwal82H.js} +1 -1
- package/dist/{slides-component-_3tukGh-.js → slides-component-DLxprlqo.js} +26 -26
- package/dist/{spec-rP6otrXw.js → spec-3EPbPQZH.js} +4 -4
- package/dist/style.css +1 -1
- package/dist/{toDate-CfGr2xZ1.js → toDate-B1AzlBoW.js} +15 -15
- package/dist/{tooltip-CygUI9oH.js → tooltip-DwNnFsxZ.js} +132 -133
- package/dist/{types-D4CFUmPq.js → types-pwjdK009.js} +15 -15
- package/dist/{useAsyncData-BzS3Ai32.js → useAsyncData-BL98MPIy.js} +3 -3
- package/dist/{useDeepCompareMemoize-AjORjhpL.js → useDeepCompareMemoize-CsyOnnjc.js} +25 -25
- package/dist/{useIframeCapabilities---aRgGdv.js → useIframeCapabilities-CsTUYYj7.js} +3 -3
- package/dist/{useLifecycle-B90lJH4p.js → useLifecycle-DrGGIsgp.js} +36 -36
- package/dist/{useTheme-ytmywQ5O.js → useTheme-CzwDokKe.js} +4 -4
- package/dist/{vega-component-1icm1Ykb.js → vega-component-KBJXEDZz.js} +42 -42
- package/dist/{zod-D4UoCYGu.js → zod-W5ZEjzaE.js} +23 -23
- package/package.json +4 -4
- package/src/core/islands/__tests__/bridge.test.ts +2 -12
- package/src/core/islands/__tests__/islands-harness.test.ts +348 -0
- package/src/core/islands/__tests__/parse.test.ts +466 -24
- package/src/core/islands/__tests__/test-utils.tsx +263 -0
- package/src/core/islands/bootstrap.ts +265 -0
- package/src/core/islands/bridge.ts +154 -75
- package/src/core/islands/components/IslandControls.tsx +103 -0
- package/src/core/islands/components/__tests__/IslandControls.test.tsx +185 -0
- package/src/core/islands/components/__tests__/useIslandControls.test.ts +208 -0
- package/src/core/islands/components/output-wrapper.tsx +76 -93
- package/src/core/islands/components/useIslandControls.ts +60 -0
- package/src/core/islands/components/web-components.tsx +168 -40
- package/src/core/islands/constants.ts +28 -0
- package/src/core/islands/main.ts +7 -205
- package/src/core/islands/parse.ts +73 -26
- package/src/core/islands/worker-factory.ts +86 -0
- package/src/plugins/core/RenderHTML.tsx +9 -0
- package/src/plugins/core/__test__/RenderHTML.test.ts +27 -0
- package/src/plugins/core/__test__/trusted-url.test.ts +48 -0
- package/src/plugins/core/registerReactComponent.tsx +11 -8
- package/src/plugins/core/trusted-url.ts +20 -0
- package/src/plugins/impl/ButtonPlugin.tsx +4 -6
- package/src/plugins/impl/CodeEditorPlugin.tsx +15 -18
- package/src/plugins/impl/DataEditorPlugin.tsx +8 -14
- package/src/plugins/impl/DataTablePlugin.tsx +8 -9
- package/src/plugins/impl/FileUploadPlugin.tsx +39 -43
- package/src/plugins/impl/FormPlugin.tsx +2 -6
- package/src/plugins/impl/anywidget/__tests__/widget-binding.test.ts +27 -1
- package/src/plugins/impl/anywidget/widget-binding.ts +13 -0
- package/src/plugins/impl/chat/ChatPlugin.tsx +17 -20
- package/src/plugins/impl/data-explorer/DataExplorerPlugin.tsx +5 -8
- package/src/plugins/impl/mpl-interactive/MplInteractivePlugin.tsx +21 -0
- package/src/plugins/impl/mpl-interactive/__tests__/MplInteractivePlugin.test.tsx +119 -0
- package/src/plugins/impl/panel/PanelPlugin.tsx +31 -10
- package/src/plugins/impl/panel/__tests__/PanelPlugin.test.ts +60 -0
- package/src/plugins/impl/plotly/__tests__/PlotlyPlugin.test.tsx +50 -0
- package/src/plugins/impl/plotly/__tests__/selection.test.ts +82 -0
- package/src/plugins/impl/plotly/selection.ts +62 -3
- package/src/plugins/impl/vega/VegaPlugin.tsx +5 -8
- package/src/plugins/layout/NavigationMenuPlugin.tsx +2 -6
- package/dist/mermaid-4DMBBIKO-Cw46o6DN.js +0 -6
- /package/dist/{clsx-yW_RAw0K.js → clsx-CwTY0BxM.js} +0 -0
- /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 {
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
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-
|
|
8
|
-
import { i as tableFromIPC } from "./loader-
|
|
9
|
-
function isDate(
|
|
10
|
-
return
|
|
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(
|
|
13
|
-
return !(!isDate(
|
|
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((
|
|
23
|
+
}), Alert = import_react.forwardRef((e, m) => {
|
|
24
24
|
let h = (0, import_compiler_runtime.c)(11), g, _, v;
|
|
25
|
-
h[0] ===
|
|
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((
|
|
37
|
+
var AlertTitle = import_react.forwardRef((e, m) => {
|
|
38
38
|
let h = (0, import_compiler_runtime.c)(11), g, _, v;
|
|
39
|
-
h[0] ===
|
|
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((
|
|
51
|
+
var AlertDescription = import_react.forwardRef((e, m) => {
|
|
52
52
|
let h = (0, import_compiler_runtime.c)(9), g, _;
|
|
53
|
-
h[0] ===
|
|
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(
|
|
65
|
-
function
|
|
66
|
-
return !!(
|
|
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 (
|
|
68
|
+
return (p(e) ? e : decodeIPC(e)).toArray();
|
|
69
69
|
}
|
|
70
70
|
arrow.responseType = "arrayBuffer";
|
|
71
|
-
function decodeIPC(
|
|
72
|
-
return tableFromIPC(
|
|
71
|
+
function decodeIPC(e, p) {
|
|
72
|
+
return tableFromIPC(e, p ?? { useProxy: true });
|
|
73
73
|
}
|
|
74
|
-
function useDeepCompareMemoize(
|
|
75
|
-
let
|
|
76
|
-
return dequal(
|
|
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-
|
|
3
|
-
import { t as require_compiler_runtime } from "./compiler-runtime-
|
|
4
|
-
import { t as getIframeCapabilities } from "./capabilities-
|
|
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 {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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-
|
|
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,
|
|
84
|
+
function createReducer(e, h) {
|
|
85
85
|
return {
|
|
86
|
-
reducer: (
|
|
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
|
|
89
|
-
for (let g in
|
|
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
|
|
95
|
+
return m;
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
-
function createReducerAndAtoms(e,
|
|
100
|
-
let
|
|
101
|
-
|
|
102
|
-
}, { reducer: y, createActions: b } = createReducer(e,
|
|
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
|
|
105
|
-
for (let v2 of
|
|
106
|
-
v2(e2,
|
|
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 ${
|
|
108
|
+
Logger.error(`Error in middleware for action ${h2.type}:`, e3);
|
|
109
109
|
}
|
|
110
|
-
return
|
|
111
|
-
} catch (
|
|
112
|
-
return Logger.error(`Error in reducer for action ${
|
|
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
|
|
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
|
|
120
|
-
g2((
|
|
121
|
-
}),
|
|
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((
|
|
124
|
+
g2((m2) => x(m2, e3));
|
|
125
125
|
}));
|
|
126
|
-
let
|
|
127
|
-
return
|
|
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),
|
|
149
|
-
m[0] === e ? (
|
|
150
|
-
let
|
|
151
|
-
m[4] !==
|
|
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] !==
|
|
154
|
-
className:
|
|
155
|
-
...
|
|
156
|
-
}), m[7] =
|
|
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 {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
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-
|
|
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 {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import { c as
|
|
6
|
-
import "./react-dom-
|
|
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-
|
|
9
|
-
import { n as ErrorBanner } from "./error-banner-
|
|
10
|
-
import { t as Tooltip } from "./tooltip-
|
|
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-
|
|
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-
|
|
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-
|
|
17
|
-
import { t as useAsyncData } from "./useAsyncData-
|
|
18
|
-
import { t as j } from "./react-vega-
|
|
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
|
|
486
|
+
let T2;
|
|
487
487
|
try {
|
|
488
|
-
|
|
488
|
+
T2 = asRemoteURL(e2.data.url);
|
|
489
489
|
} catch {
|
|
490
490
|
return e2;
|
|
491
491
|
}
|
|
492
|
-
let
|
|
493
|
-
return C[
|
|
492
|
+
let E = await vegaLoadData(T2.href, e2.data.format);
|
|
493
|
+
return C[T2.pathname] = E, {
|
|
494
494
|
...e2,
|
|
495
|
-
data: { name:
|
|
495
|
+
data: { name: T2.pathname }
|
|
496
496
|
};
|
|
497
|
-
},
|
|
498
|
-
return Object.keys(C).length === 0 ?
|
|
499
|
-
...
|
|
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:
|
|
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:
|
|
529
|
-
fieldSelection:
|
|
528
|
+
chartSelection: O,
|
|
529
|
+
fieldSelection: k
|
|
530
530
|
}), [
|
|
531
531
|
U,
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
]), G = (0, import_react.useMemo)(() => getSelectionParamNames(W), [W]), K = useEvent_default((
|
|
535
|
-
|
|
532
|
+
O,
|
|
533
|
+
k
|
|
534
|
+
]), G = (0, import_react.useMemo)(() => getSelectionParamNames(W), [W]), K = useEvent_default((C) => {
|
|
535
|
+
D({
|
|
536
536
|
...e,
|
|
537
|
-
...
|
|
537
|
+
...C
|
|
538
538
|
});
|
|
539
|
-
}), q = (0, import_react.useMemo)(() => debounce_default((e2,
|
|
540
|
-
Logger.debug("[Vega signal]", e2,
|
|
541
|
-
let
|
|
542
|
-
|
|
543
|
-
}, 100), [K]), J = useDeepCompareMemoize(G), Y = (0, import_react.useMemo)(() => J.reduce((e2,
|
|
544
|
-
signalName:
|
|
545
|
-
handler: (e3,
|
|
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,
|
|
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
|
-
] },
|
|
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:
|
|
581
|
+
return (0, import_react.useEffect)(() => (Y.forEach(({ signalName: e2, handler: w }) => {
|
|
582
582
|
try {
|
|
583
|
-
$ == null ? void 0 : $.view.addSignalListener(e2,
|
|
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:
|
|
588
|
+
Y.forEach(({ signalName: e2, handler: w }) => {
|
|
589
589
|
try {
|
|
590
|
-
$ == null ? void 0 : $.view.removeSignalListener(e2,
|
|
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 {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import { t as require_react_dom } from "./react-dom-
|
|
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
|
|
27
|
-
let { asChild:
|
|
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:
|
|
30
|
+
ref: D
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
|
-
return
|
|
33
|
+
return k.displayName = `Primitive.${E}`, {
|
|
34
34
|
...e,
|
|
35
|
-
[E]:
|
|
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),
|
|
173
|
-
return typeof D == "function" || O.isPresent ? import_react.cloneElement(
|
|
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:
|
|
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 || (
|
|
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)) || (
|
|
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),
|
|
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:
|
|
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:
|
|
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,
|
|
415
|
-
if (E2 &&
|
|
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 &&
|
|
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),
|
|
1073
|
-
return e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
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] =
|
|
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.
|
|
3
|
+
"version": "0.23.2-dev1",
|
|
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-
|
|
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 {
|
|
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
|
-
|
|
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", () => {
|