@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
@@ -0,0 +1,201 @@
1
+ import { t as e } from "./rolldown-runtime-Cb76FRpK.js";
2
+ import { g as t } from "./button-DlqUC8W-.js";
3
+ import { u as n } from "./dist-wdOJ5T7-.js";
4
+ import { C as r } from "./select-DQ9jU_B_.js";
5
+ import { i, r as a } from "./data-grid-types-BnZwWG8z.js";
6
+ var o = n("pencil", [["path", {
7
+ d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
8
+ key: "1a8usu"
9
+ }], ["path", {
10
+ d: "m15 5 4 4",
11
+ key: "1mk7zo"
12
+ }]]), s = n("trash", [
13
+ ["path", {
14
+ d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",
15
+ key: "miytrc"
16
+ }],
17
+ ["path", {
18
+ d: "M3 6h18",
19
+ key: "d0wm0j"
20
+ }],
21
+ ["path", {
22
+ d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",
23
+ key: "e791ji"
24
+ }]
25
+ ]), c = /* @__PURE__ */ e(((e, t) => {
26
+ t.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
27
+ })), l = /* @__PURE__ */ e(((e, t) => {
28
+ var n = c();
29
+ function r() {}
30
+ function i() {}
31
+ i.resetWarningCache = r, t.exports = function() {
32
+ function e(e, t, r, i, a, o) {
33
+ if (o !== n) {
34
+ var s = /* @__PURE__ */ Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");
35
+ throw s.name = "Invariant Violation", s;
36
+ }
37
+ }
38
+ e.isRequired = e;
39
+ function t() {
40
+ return e;
41
+ }
42
+ var a = {
43
+ array: e,
44
+ bigint: e,
45
+ bool: e,
46
+ func: e,
47
+ number: e,
48
+ object: e,
49
+ string: e,
50
+ symbol: e,
51
+ any: e,
52
+ arrayOf: t,
53
+ element: e,
54
+ elementType: e,
55
+ instanceOf: t,
56
+ node: e,
57
+ objectOf: t,
58
+ oneOf: t,
59
+ oneOfType: t,
60
+ shape: t,
61
+ exact: t,
62
+ checkPropTypes: i,
63
+ resetWarningCache: r
64
+ };
65
+ return a.PropTypes = a, a;
66
+ };
67
+ })), u = /* @__PURE__ */ e(((e, t) => {
68
+ t.exports = l()();
69
+ })), d = {
70
+ Insert: "insert",
71
+ Remove: "remove",
72
+ Rename: "rename"
73
+ };
74
+ //#endregion
75
+ //#region src/plugins/impl/data-editor/glide-utils.ts
76
+ function f(e) {
77
+ switch (e) {
78
+ case "string": return a.Text;
79
+ case "number": return a.Number;
80
+ case "boolean": return a.Boolean;
81
+ case "integer":
82
+ case "date":
83
+ case "datetime":
84
+ case "time":
85
+ case "geometry":
86
+ case "unknown": return a.Text;
87
+ default: return r(e), a.Text;
88
+ }
89
+ }
90
+ function p(e) {
91
+ switch (e) {
92
+ case "string": return i.HeaderString;
93
+ case "number":
94
+ case "integer": return i.HeaderNumber;
95
+ case "boolean": return i.HeaderBoolean;
96
+ case "date":
97
+ case "datetime": return i.HeaderDate;
98
+ case "time": return i.HeaderTime;
99
+ case "geometry":
100
+ case "unknown": return i.HeaderString;
101
+ default: return r(e), i.HeaderString;
102
+ }
103
+ }
104
+ function m(e, t) {
105
+ switch (e) {
106
+ case "number": return Number.isFinite(Number(t));
107
+ case "integer":
108
+ if (typeof t == "bigint") return !0;
109
+ if (typeof t == "number") return Number.isFinite(t) && Number.isInteger(t);
110
+ if (typeof t == "string") {
111
+ let e = t.trim();
112
+ return /^[+-]?[0-9]+(?:\.0+)?$/u.test(e);
113
+ }
114
+ return !1;
115
+ case "boolean": return typeof t == "boolean";
116
+ case void 0:
117
+ case "string":
118
+ case "date":
119
+ case "datetime":
120
+ case "time":
121
+ case "geometry":
122
+ case "unknown": return !0;
123
+ default: return r(e), !1;
124
+ }
125
+ }
126
+ function h(e) {
127
+ return "rowIdx" in e && "columnId" in e && "value" in e;
128
+ }
129
+ function g(e) {
130
+ return "rowIdx" in e && "type" in e;
131
+ }
132
+ function _(e) {
133
+ return "columnIdx" in e && "type" in e;
134
+ }
135
+ function v(e) {
136
+ let { selection: n, data: i, onAddEdits: a, columns: o, editableColumns: s } = e;
137
+ if (!n.current) return;
138
+ let { range: c } = n.current, { x: l, y: u } = c;
139
+ navigator.clipboard.readText().then((e) => {
140
+ if (!e.trim()) return;
141
+ let t = e.split("\n").filter((e) => e.trim()), n = [];
142
+ for (let e of t) {
143
+ let t = e.split(" ");
144
+ n.push(t);
145
+ }
146
+ if (n.length === 0) return;
147
+ let c = [];
148
+ for (let [e, t] of n.entries()) {
149
+ if (!t) continue;
150
+ let n = u + e;
151
+ if (n >= i.length) break;
152
+ for (let [e, i] of t.entries()) {
153
+ if (i === void 0) continue;
154
+ let t = l + e;
155
+ if (t >= o.length) break;
156
+ let a = o[t], u = a.dataType;
157
+ if (!(s === "all" || s.includes(a.title))) continue;
158
+ let d = i;
159
+ switch (u) {
160
+ case "integer": {
161
+ let e = Number(i);
162
+ if (!m(u, i)) continue;
163
+ d = Number.isSafeInteger(e) ? e : i.trim();
164
+ break;
165
+ }
166
+ case "number": {
167
+ let e = Number(i);
168
+ if (!m(u, e)) continue;
169
+ d = e;
170
+ break;
171
+ }
172
+ case "boolean": {
173
+ let e = i.toLowerCase();
174
+ d = e === "true" || e === "1";
175
+ break;
176
+ }
177
+ case "string":
178
+ case "date":
179
+ case "datetime":
180
+ case "time":
181
+ case "geometry":
182
+ case "unknown": break;
183
+ default:
184
+ r(u);
185
+ continue;
186
+ }
187
+ let f = o[t].title;
188
+ c.push({
189
+ rowIdx: n,
190
+ columnId: f,
191
+ value: d
192
+ });
193
+ }
194
+ }
195
+ c.length > 0 && a(c);
196
+ }).catch((e) => {
197
+ t.error("Failed to read clipboard data", e);
198
+ });
199
+ }
200
+ //#endregion
201
+ export { g as a, d as c, o as d, h as i, u as l, f as n, m as o, _ as r, v as s, p as t, s as u };