@marimo-team/islands 0.25.3-dev432 → 0.25.3-dev436
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ErrorBoundary-DAkJ7hwU.js +213 -0
- package/dist/{code-visibility-S6mDxnr2.js → code-visibility-BMMvUEE0.js} +1 -1
- package/dist/{common-CIHg51sQ.js → common-iWYyPuv_.js} +3168 -3180
- package/dist/{data-grid-overlay-editor-BCWPWxh4.js → data-grid-overlay-editor-CkJgQaxE.js} +1 -1
- package/dist/{feedback-button-DI9se_Ct.js → feedback-button-Bo1DzBRc.js} +2 -2
- package/dist/{glide-data-editor-BeLtV7nF.js → glide-data-editor-D537pcyO.js} +3 -3
- package/dist/{globals-DLPrOEeB.js → globals-DyA5IC15.js} +1 -1
- package/dist/main.js +6 -6
- package/dist/{number-overlay-editor-CZLODMHG.js → number-overlay-editor-BN8eCduk.js} +1 -1
- package/dist/{reveal-component-CcavTIL_.js → reveal-component-DEOP4BIj.js} +2 -2
- package/package.json +1 -1
- package/src/components/editor/boundary/ErrorBoundary.tsx +6 -2
- package/src/components/editor/boundary/__tests__/ErrorBoundary.test.tsx +4 -0
- package/src/core/wasm/PyodideLoader.tsx +2 -1
- package/src/core/wasm/__tests__/PyodideLoader.test.tsx +100 -0
- package/src/core/wasm/errors.ts +8 -0
- package/dist/ErrorBoundary-B43oV3b6.js +0 -194
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
|
|
2
|
+
import { g as t, h as n, t as r } from "./button-qQhINE7z.js";
|
|
3
|
+
import { t as i } from "./react-Bgs_wQh3.js";
|
|
4
|
+
import { t as a } from "./compiler-runtime-C5KHtL5D.js";
|
|
5
|
+
import { a as o, i as s, t as c } from "./copy-icon-Bv5SAA0w.js";
|
|
6
|
+
import { i as l } from "./tooltip-DsQZP310.js";
|
|
7
|
+
import { t as u } from "./react-dom-DdqGVp5N.js";
|
|
8
|
+
import { t as d } from "./jsx-runtime-D8btoEHk.js";
|
|
9
|
+
import { Ft as f, l as p, o as m, xt as h } from "./use-restore-focus-CTa7IRP6.js";
|
|
10
|
+
import { a as g, i as _, o as v, r as y, s as b, t as x } from "./toast-DOWc3HtU.js";
|
|
11
|
+
import { o as S, t as C } from "./dialog-B8vU2hHC.js";
|
|
12
|
+
//#region ../node_modules/.pnpm/react-error-boundary@5.0.0_react@19.3.1/node_modules/react-error-boundary/dist/react-error-boundary.esm.js
|
|
13
|
+
var w = a(), T = /* @__PURE__ */ e(i()), E = (0, T.createContext)(null), D = {
|
|
14
|
+
didCatch: !1,
|
|
15
|
+
error: null
|
|
16
|
+
}, O = class extends T.Component {
|
|
17
|
+
constructor(e) {
|
|
18
|
+
super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = D;
|
|
19
|
+
}
|
|
20
|
+
static getDerivedStateFromError(e) {
|
|
21
|
+
return {
|
|
22
|
+
didCatch: !0,
|
|
23
|
+
error: e
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
resetErrorBoundary() {
|
|
27
|
+
let { error: e } = this.state;
|
|
28
|
+
if (e !== null) {
|
|
29
|
+
var t, n, r = [...arguments];
|
|
30
|
+
(t = (n = this.props).onReset) == null || t.call(n, {
|
|
31
|
+
args: r,
|
|
32
|
+
reason: "imperative-api"
|
|
33
|
+
}), this.setState(D);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
componentDidCatch(e, t) {
|
|
37
|
+
var n, r;
|
|
38
|
+
(n = (r = this.props).onError) == null || n.call(r, e, t);
|
|
39
|
+
}
|
|
40
|
+
componentDidUpdate(e, t) {
|
|
41
|
+
let { didCatch: n } = this.state, { resetKeys: r } = this.props;
|
|
42
|
+
if (n && t.error !== null && k(e.resetKeys, r)) {
|
|
43
|
+
var i, a;
|
|
44
|
+
(i = (a = this.props).onReset) == null || i.call(a, {
|
|
45
|
+
next: r,
|
|
46
|
+
prev: e.resetKeys,
|
|
47
|
+
reason: "keys"
|
|
48
|
+
}), this.setState(D);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
render() {
|
|
52
|
+
let { children: e, fallbackRender: t, FallbackComponent: n, fallback: r } = this.props, { didCatch: i, error: a } = this.state, o = e;
|
|
53
|
+
if (i) {
|
|
54
|
+
let e = {
|
|
55
|
+
error: a,
|
|
56
|
+
resetErrorBoundary: this.resetErrorBoundary
|
|
57
|
+
};
|
|
58
|
+
if (typeof t == "function") o = t(e);
|
|
59
|
+
else if (n) o = (0, T.createElement)(n, e);
|
|
60
|
+
else if (r !== void 0) o = r;
|
|
61
|
+
else throw a;
|
|
62
|
+
}
|
|
63
|
+
return (0, T.createElement)(E.Provider, { value: {
|
|
64
|
+
didCatch: i,
|
|
65
|
+
error: a,
|
|
66
|
+
resetErrorBoundary: this.resetErrorBoundary
|
|
67
|
+
} }, o);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
function k() {
|
|
71
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
|
|
72
|
+
return e.length !== t.length || e.some((e, n) => !Object.is(e, t[n]));
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/core/wasm/errors.ts
|
|
76
|
+
var A = class extends Error {
|
|
77
|
+
constructor(e) {
|
|
78
|
+
super(e.message, { cause: e }), this.name = "WasmInitializationError";
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/utils/reload-safe.ts
|
|
83
|
+
function j() {
|
|
84
|
+
try {
|
|
85
|
+
window.location.reload();
|
|
86
|
+
} catch (e) {
|
|
87
|
+
t.error("Failed to reload page", e), s({
|
|
88
|
+
title: "Failed to reload page",
|
|
89
|
+
description: "Please refresh the page manually."
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/components/ui/toaster.tsx
|
|
95
|
+
var M = /* @__PURE__ */ e(u(), 1), N = d(), P = () => {
|
|
96
|
+
let e = (0, w.c)(5), { toasts: t } = o(), n;
|
|
97
|
+
e[0] === t ? n = e[1] : (n = t.map(L), e[0] = t, e[1] = n);
|
|
98
|
+
let r;
|
|
99
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, N.jsx)(F, {}), e[2] = r) : r = e[2];
|
|
100
|
+
let i;
|
|
101
|
+
return e[3] === n ? i = e[4] : (i = /* @__PURE__ */ (0, N.jsxs)(g, { children: [n, r] }), e[3] = n, e[4] = i), i;
|
|
102
|
+
}, F = m(({ container: e }) => (0, M.createPortal)(/* @__PURE__ */ (0, N.jsx)(p, { children: /* @__PURE__ */ (0, N.jsx)(b, {}) }), e ?? document.body)), I = (e) => {
|
|
103
|
+
let t = (0, w.c)(23), r, i, a, o, s;
|
|
104
|
+
t[0] === e ? (r = t[1], i = t[2], a = t[3], o = t[4], s = t[5]) : ({toastTitle: o, toastDescription: a, action: r, variant: s, ...i} = e, t[0] = e, t[1] = r, t[2] = i, t[3] = a, t[4] = o, t[5] = s);
|
|
105
|
+
let l = (0, T.useRef)(null), u = !!a && !r && s === "danger", d;
|
|
106
|
+
t[6] === o ? d = t[7] : (d = o && /* @__PURE__ */ (0, N.jsx)(v, { children: o }), t[6] = o, t[7] = d);
|
|
107
|
+
let f;
|
|
108
|
+
t[8] === a ? f = t[9] : (f = a && /* @__PURE__ */ (0, N.jsx)(_, {
|
|
109
|
+
ref: l,
|
|
110
|
+
children: a
|
|
111
|
+
}), t[8] = a, t[9] = f);
|
|
112
|
+
let p;
|
|
113
|
+
t[10] !== d || t[11] !== f ? (p = /* @__PURE__ */ (0, N.jsxs)("div", {
|
|
114
|
+
className: "grid min-w-0 flex-1 gap-1",
|
|
115
|
+
children: [d, f]
|
|
116
|
+
}), t[10] = d, t[11] = f, t[12] = p) : p = t[12];
|
|
117
|
+
let m;
|
|
118
|
+
t[13] !== u || t[14] !== a ? (m = u && /* @__PURE__ */ (0, N.jsx)(c, {
|
|
119
|
+
tooltip: "Copy error",
|
|
120
|
+
ariaLabel: "Copy error",
|
|
121
|
+
className: "h-4 w-4",
|
|
122
|
+
buttonClassName: n("absolute right-8 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity", "hover:text-foreground focus:opacity-100 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 group-hover:opacity-100", "group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-500 focus-visible:group-[.destructive]:ring-red-400 focus-visible:group-[.destructive]:ring-offset-red-600"),
|
|
123
|
+
value: () => l.current?.innerText ?? (typeof a == "string" ? a : "")
|
|
124
|
+
}), t[13] = u, t[14] = a, t[15] = m) : m = t[15];
|
|
125
|
+
let h;
|
|
126
|
+
t[16] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ (0, N.jsx)(y, {}), t[16] = h) : h = t[16];
|
|
127
|
+
let g;
|
|
128
|
+
return t[17] !== r || t[18] !== i || t[19] !== p || t[20] !== m || t[21] !== s ? (g = /* @__PURE__ */ (0, N.jsxs)(x, {
|
|
129
|
+
variant: s,
|
|
130
|
+
...i,
|
|
131
|
+
children: [
|
|
132
|
+
p,
|
|
133
|
+
r,
|
|
134
|
+
m,
|
|
135
|
+
h
|
|
136
|
+
]
|
|
137
|
+
}), t[17] = r, t[18] = i, t[19] = p, t[20] = m, t[21] = s, t[22] = g) : g = t[22], g;
|
|
138
|
+
};
|
|
139
|
+
function L(e) {
|
|
140
|
+
let { id: t, title: n, description: r, action: i, variant: a, ...o } = e;
|
|
141
|
+
return /* @__PURE__ */ (0, N.jsx)(I, {
|
|
142
|
+
toastTitle: n,
|
|
143
|
+
toastDescription: r,
|
|
144
|
+
action: i,
|
|
145
|
+
variant: a,
|
|
146
|
+
...o
|
|
147
|
+
}, t);
|
|
148
|
+
}
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/components/editor/boundary/ErrorBoundary.tsx
|
|
151
|
+
var R = (0, T.lazy)(() => import("./feedback-button-Bo1DzBRc.js").then((e) => ({ default: e.FeedbackModal }))), z = (e) => {
|
|
152
|
+
let t = (0, w.c)(2), n;
|
|
153
|
+
return t[0] === e.children ? n = t[1] : (n = /* @__PURE__ */ (0, N.jsx)(O, {
|
|
154
|
+
FallbackComponent: B,
|
|
155
|
+
children: e.children
|
|
156
|
+
}), t[0] = e.children, t[1] = n), n;
|
|
157
|
+
}, B = (e) => {
|
|
158
|
+
let t = (0, w.c)(18), [n, i] = (0, T.useState)(!1), a = e.error instanceof A, o;
|
|
159
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ (0, N.jsx)("h1", {
|
|
160
|
+
className: "text-2xl font-bold",
|
|
161
|
+
children: "Something went wrong"
|
|
162
|
+
}), t[0] = o) : o = t[0];
|
|
163
|
+
let s = e.error?.message, c;
|
|
164
|
+
t[1] === s ? c = t[2] : (c = /* @__PURE__ */ (0, N.jsx)("pre", {
|
|
165
|
+
className: "text-xs bg-muted/40 border rounded-md p-4 max-w-[80%] whitespace-normal",
|
|
166
|
+
children: s
|
|
167
|
+
}), t[1] = s, t[2] = c);
|
|
168
|
+
let u;
|
|
169
|
+
t[3] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, N.jsx)(S, {
|
|
170
|
+
asChild: !0,
|
|
171
|
+
children: /* @__PURE__ */ (0, N.jsx)(r, {
|
|
172
|
+
variant: "outline",
|
|
173
|
+
children: "Report an issue"
|
|
174
|
+
})
|
|
175
|
+
}), t[3] = u) : u = t[3];
|
|
176
|
+
let d;
|
|
177
|
+
t[4] === n ? d = t[5] : (d = n && /* @__PURE__ */ (0, N.jsx)(f, {
|
|
178
|
+
store: h,
|
|
179
|
+
children: /* @__PURE__ */ (0, N.jsxs)(l, { children: [/* @__PURE__ */ (0, N.jsx)(T.Suspense, {
|
|
180
|
+
fallback: null,
|
|
181
|
+
children: /* @__PURE__ */ (0, N.jsx)(R, {})
|
|
182
|
+
}), /* @__PURE__ */ (0, N.jsx)(P, {})] })
|
|
183
|
+
}), t[4] = n, t[5] = d);
|
|
184
|
+
let p;
|
|
185
|
+
t[6] !== n || t[7] !== d ? (p = /* @__PURE__ */ (0, N.jsxs)(C, {
|
|
186
|
+
open: n,
|
|
187
|
+
onOpenChange: i,
|
|
188
|
+
children: [u, d]
|
|
189
|
+
}), t[6] = n, t[7] = d, t[8] = p) : p = t[8];
|
|
190
|
+
let m = a ? j : e.resetErrorBoundary, g = a ? "Reload page" : "Try again", _;
|
|
191
|
+
t[9] !== m || t[10] !== g ? (_ = /* @__PURE__ */ (0, N.jsx)(r, {
|
|
192
|
+
"data-testid": "reset-error-boundary-button",
|
|
193
|
+
onClick: m,
|
|
194
|
+
variant: "outline",
|
|
195
|
+
children: g
|
|
196
|
+
}), t[9] = m, t[10] = g, t[11] = _) : _ = t[11];
|
|
197
|
+
let v;
|
|
198
|
+
t[12] !== p || t[13] !== _ ? (v = /* @__PURE__ */ (0, N.jsxs)("div", {
|
|
199
|
+
className: "flex flex-wrap items-center justify-center gap-2",
|
|
200
|
+
children: [p, _]
|
|
201
|
+
}), t[12] = p, t[13] = _, t[14] = v) : v = t[14];
|
|
202
|
+
let y;
|
|
203
|
+
return t[15] !== c || t[16] !== v ? (y = /* @__PURE__ */ (0, N.jsxs)("div", {
|
|
204
|
+
className: "flex-1 flex items-center justify-center flex-col space-y-4 max-w-2xl mx-auto px-6 pb-6",
|
|
205
|
+
children: [
|
|
206
|
+
o,
|
|
207
|
+
c,
|
|
208
|
+
v
|
|
209
|
+
]
|
|
210
|
+
}), t[15] = c, t[16] = v, t[17] = y) : y = t[17], y;
|
|
211
|
+
};
|
|
212
|
+
//#endregion
|
|
213
|
+
export { j as n, z as t };
|
|
@@ -14,7 +14,7 @@ function y() {
|
|
|
14
14
|
return e.warn("Failed to get version from mount config"), null;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
var b = y() || "0.25.3-
|
|
17
|
+
var b = y() || "0.25.3-dev436", x = a(b), S = a(!0);
|
|
18
18
|
a(null);
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/core/wasm/state.ts
|