@marimo-team/islands 0.25.3-dev262 → 0.25.3-dev265

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 (45) hide show
  1. package/dist/{ConnectedDataExplorerComponent-DjlwdMQT.js → ConnectedDataExplorerComponent-C_hj7Poi.js} +6 -6
  2. package/dist/{ErrorBoundary-Bmn7yFxG.js → ErrorBoundary-DzYPyiOs.js} +13 -13
  3. package/dist/{any-language-editor-Be7dA2VK.js → any-language-editor-CFeWfC3o.js} +2 -2
  4. package/dist/{chat-ui-Bl_I-evE.js → chat-ui-DFxNgzXF.js} +10 -10
  5. package/dist/{check-CSvxZk5I.js → check-gUSZbRsl.js} +1 -1
  6. package/dist/{code-visibility-CIz56feH.js → code-visibility-CJExrSFe.js} +3 -3
  7. package/dist/{common-B736tDHW.js → common-5mM7a8cm.js} +15 -15
  8. package/dist/{config-mwEjAmvP.js → config-CmeG_Pb6.js} +1 -1
  9. package/dist/{copy-icon-DD8bdw4L.js → copy-icon-C2I8sw4h.js} +2 -2
  10. package/dist/{data-grid-overlay-editor-Dit5MC8K.js → data-grid-overlay-editor--Un2Lk6m.js} +1 -1
  11. package/dist/{dialog-BHYPX87J.js → dialog-BtprQCUw.js} +1 -1
  12. package/dist/{objectWithoutPropertiesLoose-ai5NUqGa.js → dist-X9CsotJl.js} +1 -23
  13. package/dist/{dropdown-menu-Blu7V6Mk.js → dropdown-menu-CkJ7ErY6.js} +10 -10
  14. package/dist/{error-entries-DFhMo601.js → error-entries-CMoaUX9V.js} +5 -5
  15. package/dist/{esm-CHjVSexr.js → esm-BDqqT86j.js} +123 -122
  16. package/dist/{feedback-button-BiQv1ZDP.js → feedback-button-C2NUXbzh.js} +6 -6
  17. package/dist/{glide-data-editor-DMDC25_Z.js → glide-data-editor-Dj9U-NK9.js} +6723 -2940
  18. package/dist/{glide-utils-qbkRZpEy.js → glide-utils-Ba9WD2IN.js} +78 -33
  19. package/dist/{globals-C6o26_z-.js → globals-CkbsxIrq.js} +2 -2
  20. package/dist/{html-to-image-BPs9Vo-H.js → html-to-image-D_5CMreP.js} +4415 -4415
  21. package/dist/main.js +5513 -5504
  22. package/dist/{number-overlay-editor-CMiX0eIR.js → number-overlay-editor-H8QAAmdr.js} +1 -1
  23. package/dist/objectWithoutPropertiesLoose-BRDcTsfB.js +23 -0
  24. package/dist/{process-output-c6xaHokq.js → process-output-CGFNVC60.js} +4 -4
  25. package/dist/{reveal-component-D9SrIaYo.js → reveal-component-BperrCFw.js} +6 -6
  26. package/dist/{select-CcidPqlM.js → select-C33FVPPN.js} +9 -9
  27. package/dist/{spec-ZwfZcgsm.js → spec-DH1lmF7Q.js} +4 -4
  28. package/dist/{strings-BYJNyKmg.js → strings-BCKpLFNU.js} +1 -1
  29. package/dist/{toast-CkB5Jq9K.js → toast-CY1_Qv41.js} +2 -2
  30. package/dist/{tooltip-Bzl4k00l.js → tooltip-BfcDQd2j.js} +1 -1
  31. package/dist/{useDateFormatter-CYo5fm8s.js → useDateFormatter-Dk_xFci4.js} +2 -2
  32. package/dist/{useLifecycle-GNgvNwI-.js → useLifecycle-JjxCC7Vu.js} +1 -1
  33. package/dist/{vega-component-DOtem7Hf.js → vega-component-C-lqjV0q.js} +2 -2
  34. package/package.json +2 -1
  35. package/src/plugins/impl/DataEditorPlugin.tsx +33 -8
  36. package/src/plugins/impl/__tests__/DataEditorPlugin.test.ts +93 -4
  37. package/src/plugins/impl/data-editor/__tests__/column-types.test.ts +37 -0
  38. package/src/plugins/impl/data-editor/__tests__/editor-state.test.ts +52 -1
  39. package/src/plugins/impl/data-editor/__tests__/glide-data-editor.test.tsx +113 -1
  40. package/src/plugins/impl/data-editor/__tests__/glide-utils.test.ts +116 -0
  41. package/src/plugins/impl/data-editor/column-types.ts +52 -0
  42. package/src/plugins/impl/data-editor/editor-state.ts +18 -2
  43. package/src/plugins/impl/data-editor/glide-data-editor.tsx +66 -8
  44. package/src/plugins/impl/data-editor/glide-utils.ts +30 -9
  45. package/src/plugins/impl/data-editor/types.ts +7 -0
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./rolldown-runtime-Cb76FRpK.js";
2
2
  import { g as t } from "./button-0-RqY1DW.js";
3
- import { m as n } from "./tooltip-Bzl4k00l.js";
4
- import { i as r } from "./strings-BYJNyKmg.js";
3
+ import { h as n } from "./tooltip-BfcDQd2j.js";
4
+ import { i as r } from "./strings-BCKpLFNU.js";
5
5
  import { i, r as a } from "./data-grid-types-0PJ-9N5n.js";
6
6
  var o = n("pencil", [["path", {
7
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",
@@ -22,14 +22,51 @@ var o = n("pencil", [["path", {
22
22
  d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",
23
23
  key: "e791ji"
24
24
  }]
25
- ]), c = {
25
+ ]), c = /* @__PURE__ */ new Set([
26
+ "true",
27
+ "t",
28
+ "yes",
29
+ "y",
30
+ "1"
31
+ ]), l = /* @__PURE__ */ new Set([
32
+ "false",
33
+ "f",
34
+ "no",
35
+ "n",
36
+ "0",
37
+ ""
38
+ ]);
39
+ function u(e, t) {
40
+ if (typeof e == "boolean") return e;
41
+ if (typeof e == "bigint" || typeof e == "number" && Number.isFinite(e)) return !!e;
42
+ if (typeof e == "string") {
43
+ let t = e.trim().toLowerCase();
44
+ if (c.has(t)) return !0;
45
+ if (l.has(t)) return !1;
46
+ }
47
+ throw Error(`Invalid boolean value for column '${t}': ${String(e)}`);
48
+ }
49
+ function d(e, t) {
50
+ return e.map((e) => {
51
+ let n = { ...e };
52
+ for (let [e, r] of t) {
53
+ if (!(e in n)) continue;
54
+ let t = n[e];
55
+ r === "boolean" ? n[e] = u(t, e) : (typeof t == "number" || typeof t == "bigint") && (n[e] = String(t));
56
+ }
57
+ return n;
58
+ });
59
+ }
60
+ //#endregion
61
+ //#region src/plugins/impl/data-editor/types.ts
62
+ var f = {
26
63
  Insert: "insert",
27
64
  Remove: "remove",
28
65
  Rename: "rename"
29
- }, l = /* @__PURE__ */ e(((e, t) => {
66
+ }, p = /* @__PURE__ */ e(((e, t) => {
30
67
  t.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
31
- })), u = /* @__PURE__ */ e(((e, t) => {
32
- var n = l();
68
+ })), m = /* @__PURE__ */ e(((e, t) => {
69
+ var n = p();
33
70
  function r() {}
34
71
  function i() {}
35
72
  i.resetWarningCache = r, t.exports = function() {
@@ -68,12 +105,12 @@ var o = n("pencil", [["path", {
68
105
  };
69
106
  return a.PropTypes = a, a;
70
107
  };
71
- })), d = /* @__PURE__ */ e(((e, t) => {
72
- t.exports = u()();
108
+ })), h = /* @__PURE__ */ e(((e, t) => {
109
+ t.exports = m()();
73
110
  }));
74
111
  //#endregion
75
112
  //#region src/plugins/impl/data-editor/glide-utils.ts
76
- function f(e) {
113
+ function g(e) {
77
114
  switch (e) {
78
115
  case "string": return a.Text;
79
116
  case "number": return a.Number;
@@ -87,7 +124,7 @@ function f(e) {
87
124
  default: return r(e), a.Text;
88
125
  }
89
126
  }
90
- function p(e) {
127
+ function _(e) {
91
128
  switch (e) {
92
129
  case "string": return i.HeaderString;
93
130
  case "number":
@@ -101,7 +138,8 @@ function p(e) {
101
138
  default: return r(e), i.HeaderString;
102
139
  }
103
140
  }
104
- function m(e, t) {
141
+ function v(e, t, n) {
142
+ if (Array.isArray(n)) return typeof t == "string" && n.includes(t);
105
143
  switch (e) {
106
144
  case "number": return Number.isFinite(Number(t));
107
145
  case "integer":
@@ -123,19 +161,19 @@ function m(e, t) {
123
161
  default: return r(e), !1;
124
162
  }
125
163
  }
126
- function h(e) {
164
+ function y(e) {
127
165
  return "rowIdx" in e && "columnId" in e && "value" in e;
128
166
  }
129
- function g(e) {
167
+ function b(e) {
130
168
  return "rowIdx" in e && "type" in e;
131
169
  }
132
- function _(e) {
170
+ function x(e) {
133
171
  return "columnIdx" in e && "type" in e;
134
172
  }
135
- function v(e) {
173
+ function S(e) {
136
174
  let { selection: n, data: i, onAddEdits: a, columns: o, editableColumns: s } = e;
137
175
  if (!n.current) return;
138
- let { range: c } = n.current, { x: l, y: u } = c;
176
+ let { range: c } = n.current, { x: l, y: d } = c;
139
177
  navigator.clipboard.readText().then((e) => {
140
178
  if (!e.trim()) return;
141
179
  let t = e.split("\n").filter((e) => e.trim()), n = [];
@@ -144,36 +182,43 @@ function v(e) {
144
182
  n.push(t);
145
183
  }
146
184
  if (n.length === 0) return;
147
- let c = [], d = s === "all" ? null : new Set(s);
185
+ let c = [], f = s === "all" ? null : new Set(s);
148
186
  for (let [e, t] of n.entries()) {
149
187
  if (!t) continue;
150
- let n = u + e;
188
+ let n = d + e;
151
189
  if (n >= i.length) break;
152
190
  for (let [e, i] of t.entries()) {
153
191
  if (i === void 0) continue;
154
192
  let t = l + e;
155
193
  if (t >= o.length) break;
156
- let a = o[t], s = a.dataType;
157
- if (!(d === null || d.has(a.title))) continue;
158
- let u = i;
194
+ let a = o[t], s = a.dataType, d = a.configuredType;
195
+ if (!(f === null || f.has(a.title))) continue;
196
+ let p = i;
197
+ if (Array.isArray(d) && !v(s, i, d)) continue;
159
198
  switch (s) {
160
199
  case "integer": {
161
200
  let e = Number(i);
162
- if (!m(s, i)) continue;
163
- u = Number.isSafeInteger(e) ? e : i.trim();
201
+ if (!v(s, i, d)) continue;
202
+ p = Number.isSafeInteger(e) ? e : i.trim();
164
203
  break;
165
204
  }
166
205
  case "number": {
167
206
  let e = Number(i);
168
- if (!m(s, e)) continue;
169
- u = e;
207
+ if (!v(s, e, d)) continue;
208
+ p = e;
170
209
  break;
171
210
  }
172
- case "boolean": {
173
- let e = i.toLowerCase();
174
- u = e === "true" || e === "1";
211
+ case "boolean":
212
+ if (a.configuredType !== "boolean") {
213
+ p = i.toLowerCase() === "true" || i === "1";
214
+ break;
215
+ }
216
+ try {
217
+ p = u(i, a.title);
218
+ } catch {
219
+ continue;
220
+ }
175
221
  break;
176
- }
177
222
  case "string":
178
223
  case "date":
179
224
  case "datetime":
@@ -184,11 +229,11 @@ function v(e) {
184
229
  r(s);
185
230
  continue;
186
231
  }
187
- let f = o[t].title;
232
+ let m = o[t].title;
188
233
  c.push({
189
234
  rowIdx: n,
190
- columnId: f,
191
- value: u
235
+ columnId: m,
236
+ value: p
192
237
  });
193
238
  }
194
239
  }
@@ -198,4 +243,4 @@ function v(e) {
198
243
  });
199
244
  }
200
245
  //#endregion
201
- export { g as a, d as c, o as d, h as i, c as l, f as n, m as o, _ as r, v as s, p as t, s as u };
246
+ export { b as a, h as c, d, s as f, y as i, f as l, g as n, v as o, o as p, x as r, S as s, _ as t, u };
@@ -1,6 +1,6 @@
1
- import { m as e } from "./tooltip-Bzl4k00l.js";
1
+ import { h as e } from "./tooltip-BfcDQd2j.js";
2
2
  import { l as t } from "./utils-DXkj82sK.js";
3
- import { r as n } from "./code-visibility-CIz56feH.js";
3
+ import { r as n } from "./code-visibility-CJExrSFe.js";
4
4
  var r = e("triangle-alert", [
5
5
  ["path", {
6
6
  d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",