@marimo-team/islands 0.24.1-dev79 → 0.24.1-dev80
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/{chat-ui-DM12Y9is.js → chat-ui-Dcb8pQhM.js} +8 -8
- package/dist/click-outside-container-D_URcm3D.js +167 -0
- package/dist/{common-DuuFqqGa.js → common-C8LWIius.js} +571 -571
- package/dist/{data-grid-overlay-editor-D-p0q7YM.js → data-grid-overlay-editor-DZM4BAaI.js} +49 -48
- package/dist/{click-outside-container-CVJZE0x6.js → data-grid-types-BnZwWG8z.js} +150 -312
- package/dist/{dropdown-menu-C8N-kZzD.js → dropdown-menu-B39I9ARA.js} +20 -31
- package/dist/{glide-data-editor-64-L_DON.js → glide-data-editor-DEJqXbly.js} +2598 -2780
- package/dist/glide-utils-C0dRuWI_.js +201 -0
- package/dist/{html-to-image-B7RQgQQy.js → html-to-image-CvCnIqTI.js} +4476 -4465
- package/dist/main.js +5971 -5913
- package/dist/{process-output-BCqcNNll.js → process-output-C2joqP7d.js} +1 -1
- package/dist/{reveal-component-BDQwrD89.js → reveal-component-CdEcs6WV.js} +3 -3
- package/package.json +1 -1
- package/src/plugins/impl/DataEditorPlugin.tsx +38 -70
- package/src/plugins/impl/__tests__/DataEditorPlugin.test.ts +152 -1
- package/src/plugins/impl/data-editor/__tests__/data-utils.test.ts +73 -78
- package/src/plugins/impl/data-editor/__tests__/editor-state.test.ts +113 -0
- package/src/plugins/impl/data-editor/__tests__/glide-data-editor.test.tsx +49 -13
- package/src/plugins/impl/data-editor/__tests__/glide-utils.test.ts +44 -64
- package/src/plugins/impl/data-editor/data-utils.ts +76 -53
- package/src/plugins/impl/data-editor/editor-state.ts +108 -0
- package/src/plugins/impl/data-editor/glide-data-editor.tsx +40 -223
- package/src/plugins/impl/data-editor/glide-utils.ts +71 -31
- package/src/plugins/impl/data-editor/types.ts +30 -16
- package/dist/types-eyYyHvz7.js +0 -72
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
|
|
2
2
|
import { t } from "./react-DMWcHin-.js";
|
|
3
3
|
import { t as n } from "./react-dom-C94wmq5w.js";
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
4
|
+
import { c as r, l as i, u as a } from "./data-grid-types-BnZwWG8z.js";
|
|
5
|
+
import { t as o } from "./dist-ABQjhuek.js";
|
|
6
|
+
import { i as s, n as c, t as l } from "./click-outside-container-D_URcm3D.js";
|
|
6
7
|
//#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.2.4_4b66885481293829737255dc19981073/node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/data-grid-overlay-editor-style.js
|
|
7
|
-
var
|
|
8
|
+
var u = /* @__PURE__ */ e(t(), 1), d = /* @__PURE__ */ e(n(), 1), f = /*#__PURE__*/ o("div")({
|
|
8
9
|
name: "DataGridOverlayEditorStyle",
|
|
9
10
|
class: "gdg-d19meir1",
|
|
10
11
|
propsAsIs: !1,
|
|
@@ -19,19 +20,19 @@ var l = /* @__PURE__ */ e(t(), 1), u = /* @__PURE__ */ e(n(), 1), te = /*#__PURE
|
|
|
19
20
|
});
|
|
20
21
|
//#endregion
|
|
21
22
|
//#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.2.4_4b66885481293829737255dc19981073/node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/use-stay-on-screen.js
|
|
22
|
-
function
|
|
23
|
-
let [e, t] =
|
|
23
|
+
function p() {
|
|
24
|
+
let [e, t] = u.useState();
|
|
24
25
|
return [e ?? void 0, t];
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
let [e, t] =
|
|
28
|
-
return
|
|
27
|
+
function ee() {
|
|
28
|
+
let [e, t] = p(), [n, r] = u.useState(0), [i, a] = u.useState(!0);
|
|
29
|
+
return u.useLayoutEffect(() => {
|
|
29
30
|
if (e === void 0 || !("IntersectionObserver" in window)) return;
|
|
30
31
|
let t = new IntersectionObserver((e) => {
|
|
31
32
|
e.length !== 0 && a(e[0].isIntersecting);
|
|
32
33
|
}, { threshold: 1 });
|
|
33
34
|
return t.observe(e), () => t.disconnect();
|
|
34
|
-
}, [e]),
|
|
35
|
+
}, [e]), u.useEffect(() => {
|
|
35
36
|
if (i || e === void 0) return;
|
|
36
37
|
let t, n = () => {
|
|
37
38
|
let { right: i } = e.getBoundingClientRect();
|
|
@@ -42,86 +43,86 @@ function f() {
|
|
|
42
43
|
};
|
|
43
44
|
}, [e, i]), {
|
|
44
45
|
ref: t,
|
|
45
|
-
style:
|
|
46
|
+
style: u.useMemo(() => ({ transform: `translateX(${n}px)` }), [n])
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
49
|
//#endregion
|
|
49
50
|
//#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.2.4_4b66885481293829737255dc19981073/node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/data-grid-overlay-editor.js
|
|
50
|
-
var
|
|
51
|
-
let { target: t, content: n, onFinishEditing:
|
|
51
|
+
var m = (e) => {
|
|
52
|
+
let { target: t, content: n, onFinishEditing: o, forceEditMode: p, initialValue: m, imageEditorOverride: h, markdownDivCreateNode: g, highlight: _, className: v, theme: y, id: b, cell: x, bloom: S, portalElementRef: C, validateCell: w, getCellRenderer: T, provideEditor: E, isOutsideClick: te, customEventTarget: D, activation: O } = e, [k, A] = u.useState(p ? n : void 0), j = u.useRef(k ?? n);
|
|
52
53
|
j.current = k ?? n;
|
|
53
|
-
let [M, N] =
|
|
54
|
-
|
|
55
|
-
}, [M,
|
|
56
|
-
if (
|
|
57
|
-
let t =
|
|
54
|
+
let [M, N] = u.useState(() => w === void 0 || !(r(n) && w?.(x, n, j.current) === !1)), P = u.useCallback((e, t) => {
|
|
55
|
+
o(M ? e : void 0, t);
|
|
56
|
+
}, [M, o]), F = u.useCallback((e) => {
|
|
57
|
+
if (w !== void 0 && e !== void 0 && r(e)) {
|
|
58
|
+
let t = w(x, e, j.current);
|
|
58
59
|
t === !1 ? N(!1) : (typeof t == "object" && (e = t), N(!0));
|
|
59
60
|
}
|
|
60
61
|
A(e);
|
|
61
|
-
}, [
|
|
62
|
+
}, [x, w]), I = u.useRef(!1), L = u.useRef(void 0), R = u.useCallback(() => {
|
|
62
63
|
P(k, [0, 0]), I.current = !0;
|
|
63
|
-
}, [k, P]), z =
|
|
64
|
+
}, [k, P]), z = u.useCallback((e, t) => {
|
|
64
65
|
P(e, t ?? L.current ?? [0, 0]), I.current = !0;
|
|
65
|
-
}, [P]), B =
|
|
66
|
+
}, [P]), B = u.useCallback(async (e) => {
|
|
66
67
|
let t = !1;
|
|
67
68
|
e.key === "Escape" ? (e.stopPropagation(), e.preventDefault(), L.current = [0, 0]) : e.key === "Enter" && !e.shiftKey ? (e.stopPropagation(), e.preventDefault(), L.current = [0, 1], t = !0) : e.key === "Tab" && (e.stopPropagation(), e.preventDefault(), L.current = [e.shiftKey ? -1 : 1, 0], t = !0), window.setTimeout(() => {
|
|
68
69
|
!I.current && L.current !== void 0 && (P(t ? k : void 0, L.current), I.current = !0);
|
|
69
70
|
}, 0);
|
|
70
|
-
}, [P, k]), V = k ?? n, [H, U] =
|
|
71
|
-
if (
|
|
71
|
+
}, [P, k]), V = k ?? n, [H, U] = u.useMemo(() => {
|
|
72
|
+
if (i(n)) return [];
|
|
72
73
|
let e = {
|
|
73
74
|
...n,
|
|
74
|
-
location:
|
|
75
|
+
location: x,
|
|
75
76
|
activation: O
|
|
76
|
-
}, t =
|
|
77
|
-
return t === void 0 ? [
|
|
77
|
+
}, t = E?.(e);
|
|
78
|
+
return t === void 0 ? [T(n)?.provideEditor?.(e), !1] : [t, !1];
|
|
78
79
|
}, [
|
|
79
|
-
|
|
80
|
+
x,
|
|
80
81
|
n,
|
|
81
|
-
w,
|
|
82
82
|
T,
|
|
83
|
+
E,
|
|
83
84
|
O
|
|
84
|
-
]), { ref: W, style: G } =
|
|
85
|
+
]), { ref: W, style: G } = ee(), K = !0, q, J = !0, Y;
|
|
85
86
|
if (H !== void 0) {
|
|
86
87
|
K = H.disablePadding !== !0, J = H.disableStyling !== !0;
|
|
87
|
-
let e =
|
|
88
|
+
let e = a(H);
|
|
88
89
|
e && (Y = H.styleOverride);
|
|
89
90
|
let n = e ? H.editor : H;
|
|
90
|
-
q =
|
|
91
|
-
portalElementRef:
|
|
92
|
-
isHighlighted:
|
|
91
|
+
q = u.createElement(n, {
|
|
92
|
+
portalElementRef: C,
|
|
93
|
+
isHighlighted: _,
|
|
93
94
|
activation: O,
|
|
94
95
|
onChange: F,
|
|
95
96
|
value: V,
|
|
96
|
-
initialValue:
|
|
97
|
+
initialValue: m,
|
|
97
98
|
onFinishedEditing: z,
|
|
98
|
-
validatedSelection:
|
|
99
|
-
forceEditMode:
|
|
99
|
+
validatedSelection: r(V) ? V.selectionRange : void 0,
|
|
100
|
+
forceEditMode: p,
|
|
100
101
|
target: t,
|
|
101
|
-
imageEditorOverride:
|
|
102
|
-
markdownDivCreateNode:
|
|
102
|
+
imageEditorOverride: h,
|
|
103
|
+
markdownDivCreateNode: g,
|
|
103
104
|
isValid: M,
|
|
104
|
-
theme:
|
|
105
|
+
theme: y
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
108
|
Y = {
|
|
108
109
|
...Y,
|
|
109
110
|
...G
|
|
110
111
|
};
|
|
111
|
-
let X =
|
|
112
|
+
let X = C?.current ?? document.getElementById("portal");
|
|
112
113
|
if (X === null) return console.error("Cannot open Data Grid overlay editor, because portal not found. Please, either provide a portalElementRef or add `<div id=\"portal\" />` as the last child of your `<body>`."), null;
|
|
113
114
|
let Z = J ? "gdg-style" : "gdg-unstyle";
|
|
114
115
|
M || (Z += " gdg-invalid"), K && (Z += " gdg-pad");
|
|
115
|
-
let Q =
|
|
116
|
-
return (0,
|
|
117
|
-
style:
|
|
118
|
-
className:
|
|
116
|
+
let Q = S?.[0] ?? 1, $ = S?.[1] ?? 1;
|
|
117
|
+
return (0, d.createPortal)(u.createElement(c.Provider, { value: y }, u.createElement(l, {
|
|
118
|
+
style: s(y),
|
|
119
|
+
className: v,
|
|
119
120
|
onClickOutside: R,
|
|
120
|
-
isOutsideClick:
|
|
121
|
+
isOutsideClick: te,
|
|
121
122
|
customEventTarget: D
|
|
122
|
-
},
|
|
123
|
+
}, u.createElement(f, {
|
|
123
124
|
ref: W,
|
|
124
|
-
id:
|
|
125
|
+
id: b,
|
|
125
126
|
className: Z,
|
|
126
127
|
style: Y,
|
|
127
128
|
as: U === !0 ? "label" : void 0,
|
|
@@ -129,10 +130,10 @@ var p = (e) => {
|
|
|
129
130
|
targetY: t.y - $,
|
|
130
131
|
targetWidth: t.width + Q * 2,
|
|
131
132
|
targetHeight: t.height + $ * 2
|
|
132
|
-
},
|
|
133
|
+
}, u.createElement("div", {
|
|
133
134
|
className: "gdg-clip-region",
|
|
134
135
|
onKeyDown: B
|
|
135
136
|
}, q)))), X);
|
|
136
137
|
};
|
|
137
138
|
//#endregion
|
|
138
|
-
export {
|
|
139
|
+
export { m as default };
|