@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.
Files changed (25) hide show
  1. package/dist/{chat-ui-DM12Y9is.js → chat-ui-Dcb8pQhM.js} +8 -8
  2. package/dist/click-outside-container-D_URcm3D.js +167 -0
  3. package/dist/{common-DuuFqqGa.js → common-C8LWIius.js} +571 -571
  4. package/dist/{data-grid-overlay-editor-D-p0q7YM.js → data-grid-overlay-editor-DZM4BAaI.js} +49 -48
  5. package/dist/{click-outside-container-CVJZE0x6.js → data-grid-types-BnZwWG8z.js} +150 -312
  6. package/dist/{dropdown-menu-C8N-kZzD.js → dropdown-menu-B39I9ARA.js} +20 -31
  7. package/dist/{glide-data-editor-64-L_DON.js → glide-data-editor-DEJqXbly.js} +2598 -2780
  8. package/dist/glide-utils-C0dRuWI_.js +201 -0
  9. package/dist/{html-to-image-B7RQgQQy.js → html-to-image-CvCnIqTI.js} +4476 -4465
  10. package/dist/main.js +5971 -5913
  11. package/dist/{process-output-BCqcNNll.js → process-output-C2joqP7d.js} +1 -1
  12. package/dist/{reveal-component-BDQwrD89.js → reveal-component-CdEcs6WV.js} +3 -3
  13. package/package.json +1 -1
  14. package/src/plugins/impl/DataEditorPlugin.tsx +38 -70
  15. package/src/plugins/impl/__tests__/DataEditorPlugin.test.ts +152 -1
  16. package/src/plugins/impl/data-editor/__tests__/data-utils.test.ts +73 -78
  17. package/src/plugins/impl/data-editor/__tests__/editor-state.test.ts +113 -0
  18. package/src/plugins/impl/data-editor/__tests__/glide-data-editor.test.tsx +49 -13
  19. package/src/plugins/impl/data-editor/__tests__/glide-utils.test.ts +44 -64
  20. package/src/plugins/impl/data-editor/data-utils.ts +76 -53
  21. package/src/plugins/impl/data-editor/editor-state.ts +108 -0
  22. package/src/plugins/impl/data-editor/glide-data-editor.tsx +40 -223
  23. package/src/plugins/impl/data-editor/glide-utils.ts +71 -31
  24. package/src/plugins/impl/data-editor/types.ts +30 -16
  25. 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 { _ as r, g as i, i as a, n as ee, t as o, v as s } from "./click-outside-container-CVJZE0x6.js";
5
- import { t as c } from "./dist-ABQjhuek.js";
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 l = /* @__PURE__ */ e(t(), 1), u = /* @__PURE__ */ e(n(), 1), te = /*#__PURE__*/ c("div")({
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 d() {
23
- let [e, t] = l.useState();
23
+ function p() {
24
+ let [e, t] = u.useState();
24
25
  return [e ?? void 0, t];
25
26
  }
26
- function f() {
27
- let [e, t] = d(), [n, r] = l.useState(0), [i, a] = l.useState(!0);
28
- return l.useLayoutEffect(() => {
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]), l.useEffect(() => {
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: l.useMemo(() => ({ transform: `translateX(${n}px)` }), [n])
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 p = (e) => {
51
- let { target: t, content: n, onFinishEditing: c, forceEditMode: d, initialValue: p, imageEditorOverride: m, markdownDivCreateNode: h, highlight: g, className: _, theme: v, id: y, cell: b, bloom: x, portalElementRef: S, validateCell: C, getCellRenderer: w, provideEditor: T, isOutsideClick: E, customEventTarget: D, activation: O } = e, [k, A] = l.useState(d ? n : void 0), j = l.useRef(k ?? n);
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] = l.useState(() => C === void 0 || !(i(n) && C?.(b, n, j.current) === !1)), P = l.useCallback((e, t) => {
54
- c(M ? e : void 0, t);
55
- }, [M, c]), F = l.useCallback((e) => {
56
- if (C !== void 0 && e !== void 0 && i(e)) {
57
- let t = C(b, e, j.current);
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
- }, [b, C]), I = l.useRef(!1), L = l.useRef(void 0), R = l.useCallback(() => {
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 = l.useCallback((e, t) => {
64
+ }, [k, P]), z = u.useCallback((e, t) => {
64
65
  P(e, t ?? L.current ?? [0, 0]), I.current = !0;
65
- }, [P]), B = l.useCallback(async (e) => {
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] = l.useMemo(() => {
71
- if (r(n)) return [];
71
+ }, [P, k]), V = k ?? n, [H, U] = u.useMemo(() => {
72
+ if (i(n)) return [];
72
73
  let e = {
73
74
  ...n,
74
- location: b,
75
+ location: x,
75
76
  activation: O
76
- }, t = T?.(e);
77
- return t === void 0 ? [w(n)?.provideEditor?.(e), !1] : [t, !1];
77
+ }, t = E?.(e);
78
+ return t === void 0 ? [T(n)?.provideEditor?.(e), !1] : [t, !1];
78
79
  }, [
79
- b,
80
+ x,
80
81
  n,
81
- w,
82
82
  T,
83
+ E,
83
84
  O
84
- ]), { ref: W, style: G } = f(), K = !0, q, J = !0, Y;
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 = s(H);
88
+ let e = a(H);
88
89
  e && (Y = H.styleOverride);
89
90
  let n = e ? H.editor : H;
90
- q = l.createElement(n, {
91
- portalElementRef: S,
92
- isHighlighted: g,
91
+ q = u.createElement(n, {
92
+ portalElementRef: C,
93
+ isHighlighted: _,
93
94
  activation: O,
94
95
  onChange: F,
95
96
  value: V,
96
- initialValue: p,
97
+ initialValue: m,
97
98
  onFinishedEditing: z,
98
- validatedSelection: i(V) ? V.selectionRange : void 0,
99
- forceEditMode: d,
99
+ validatedSelection: r(V) ? V.selectionRange : void 0,
100
+ forceEditMode: p,
100
101
  target: t,
101
- imageEditorOverride: m,
102
- markdownDivCreateNode: h,
102
+ imageEditorOverride: h,
103
+ markdownDivCreateNode: g,
103
104
  isValid: M,
104
- theme: v
105
+ theme: y
105
106
  });
106
107
  }
107
108
  Y = {
108
109
  ...Y,
109
110
  ...G
110
111
  };
111
- let X = S?.current ?? document.getElementById("portal");
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 = x?.[0] ?? 1, $ = x?.[1] ?? 1;
116
- return (0, u.createPortal)(l.createElement(ee.Provider, { value: v }, l.createElement(o, {
117
- style: a(v),
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: E,
121
+ isOutsideClick: te,
121
122
  customEventTarget: D
122
- }, l.createElement(te, {
123
+ }, u.createElement(f, {
123
124
  ref: W,
124
- id: y,
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
- }, l.createElement("div", {
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 { p as default };
139
+ export { m as default };