@marimo-team/islands 0.25.3-dev264 → 0.25.3-dev266
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/{ConnectedDataExplorerComponent-DjlwdMQT.js → ConnectedDataExplorerComponent-C_hj7Poi.js} +6 -6
- package/dist/{ErrorBoundary-CkJTXbwo.js → ErrorBoundary-CvxlC3F1.js} +13 -13
- package/dist/{any-language-editor-Be7dA2VK.js → any-language-editor-CFeWfC3o.js} +2 -2
- package/dist/{chat-ui-Bl_I-evE.js → chat-ui-DFxNgzXF.js} +10 -10
- package/dist/{check-CSvxZk5I.js → check-gUSZbRsl.js} +1 -1
- package/dist/{code-visibility-C0pJwuZV.js → code-visibility-SRM1JiD_.js} +3 -3
- package/dist/{common-rfCPrF-Z.js → common-yiRhZ6ZZ.js} +15 -15
- package/dist/{config-mwEjAmvP.js → config-CmeG_Pb6.js} +1 -1
- package/dist/{copy-icon-DD8bdw4L.js → copy-icon-C2I8sw4h.js} +2 -2
- package/dist/{data-grid-overlay-editor-DNf3djiK.js → data-grid-overlay-editor-DLTzcQ4O.js} +1 -1
- package/dist/{dialog-BHYPX87J.js → dialog-BtprQCUw.js} +1 -1
- package/dist/{objectWithoutPropertiesLoose-ai5NUqGa.js → dist-X9CsotJl.js} +1 -23
- package/dist/{dropdown-menu-Blu7V6Mk.js → dropdown-menu-CkJ7ErY6.js} +10 -10
- package/dist/{error-entries-DFhMo601.js → error-entries-CMoaUX9V.js} +5 -5
- package/dist/{esm-CHjVSexr.js → esm-BDqqT86j.js} +123 -122
- package/dist/{feedback-button-C1D8YBQZ.js → feedback-button-DBUrE4OL.js} +6 -6
- package/dist/{glide-data-editor-Dte9bKog.js → glide-data-editor-Cfv4HeOh.js} +6723 -2940
- package/dist/{glide-utils-qbkRZpEy.js → glide-utils-Ba9WD2IN.js} +78 -33
- package/dist/{globals-Df-1D3Gq.js → globals-dIbBIR5-.js} +2 -2
- package/dist/{html-to-image-BPs9Vo-H.js → html-to-image-D_5CMreP.js} +4415 -4415
- package/dist/main.js +5513 -5504
- package/dist/{number-overlay-editor-BZYA5liM.js → number-overlay-editor-CTiJp5Mj.js} +1 -1
- package/dist/objectWithoutPropertiesLoose-BRDcTsfB.js +23 -0
- package/dist/{process-output-c6xaHokq.js → process-output-CGFNVC60.js} +4 -4
- package/dist/{reveal-component-BMQZBAE1.js → reveal-component-DH09ygHo.js} +6 -6
- package/dist/{select-CcidPqlM.js → select-C33FVPPN.js} +9 -9
- package/dist/{spec-ZwfZcgsm.js → spec-DH1lmF7Q.js} +4 -4
- package/dist/{strings-BYJNyKmg.js → strings-BCKpLFNU.js} +1 -1
- package/dist/{toast-CkB5Jq9K.js → toast-CY1_Qv41.js} +2 -2
- package/dist/{tooltip-Bzl4k00l.js → tooltip-BfcDQd2j.js} +1 -1
- package/dist/{useDateFormatter-CYo5fm8s.js → useDateFormatter-Dk_xFci4.js} +2 -2
- package/dist/{useLifecycle-GNgvNwI-.js → useLifecycle-JjxCC7Vu.js} +1 -1
- package/dist/{vega-component-DOtem7Hf.js → vega-component-C-lqjV0q.js} +2 -2
- package/package.json +2 -1
- package/src/plugins/impl/DataEditorPlugin.tsx +33 -8
- package/src/plugins/impl/__tests__/DataEditorPlugin.test.ts +93 -4
- package/src/plugins/impl/data-editor/__tests__/column-types.test.ts +37 -0
- package/src/plugins/impl/data-editor/__tests__/editor-state.test.ts +52 -1
- package/src/plugins/impl/data-editor/__tests__/glide-data-editor.test.tsx +113 -1
- package/src/plugins/impl/data-editor/__tests__/glide-utils.test.ts +116 -0
- package/src/plugins/impl/data-editor/column-types.ts +52 -0
- package/src/plugins/impl/data-editor/editor-state.ts +18 -2
- package/src/plugins/impl/data-editor/glide-data-editor.tsx +66 -8
- package/src/plugins/impl/data-editor/glide-utils.ts +30 -9
- 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 {
|
|
4
|
-
import { i as r } from "./strings-
|
|
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
|
-
},
|
|
66
|
+
}, p = /* @__PURE__ */ e(((e, t) => {
|
|
30
67
|
t.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
31
|
-
})),
|
|
32
|
-
var n =
|
|
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
|
-
})),
|
|
72
|
-
t.exports =
|
|
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
|
|
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
|
|
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
|
|
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
|
|
164
|
+
function y(e) {
|
|
127
165
|
return "rowIdx" in e && "columnId" in e && "value" in e;
|
|
128
166
|
}
|
|
129
|
-
function
|
|
167
|
+
function b(e) {
|
|
130
168
|
return "rowIdx" in e && "type" in e;
|
|
131
169
|
}
|
|
132
|
-
function
|
|
170
|
+
function x(e) {
|
|
133
171
|
return "columnIdx" in e && "type" in e;
|
|
134
172
|
}
|
|
135
|
-
function
|
|
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:
|
|
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 = [],
|
|
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 =
|
|
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 (!(
|
|
158
|
-
let
|
|
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 (!
|
|
163
|
-
|
|
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 (!
|
|
169
|
-
|
|
207
|
+
if (!v(s, e, d)) continue;
|
|
208
|
+
p = e;
|
|
170
209
|
break;
|
|
171
210
|
}
|
|
172
|
-
case "boolean":
|
|
173
|
-
|
|
174
|
-
|
|
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
|
|
232
|
+
let m = o[t].title;
|
|
188
233
|
c.push({
|
|
189
234
|
rowIdx: n,
|
|
190
|
-
columnId:
|
|
191
|
-
value:
|
|
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 {
|
|
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 {
|
|
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-
|
|
3
|
+
import { r as n } from "./code-visibility-SRM1JiD_.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",
|