@marimo-team/islands 0.25.3-dev402 → 0.25.3-dev408

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 (31) hide show
  1. package/dist/{ConnectedDataExplorerComponent-1DGGwl88.js → ConnectedDataExplorerComponent-DCW4bXq-.js} +1 -1
  2. package/dist/{ErrorBoundary-DfbzIKA3.js → ErrorBoundary-W6a-7ong.js} +1 -1
  3. package/dist/{chat-ui-r3PPIMn0.js → chat-ui-BGEXB6V4.js} +1354 -1320
  4. package/dist/{code-visibility-CXijswY7.js → code-visibility-0v5rL9iu.js} +1 -1
  5. package/dist/{common-Cm5ENbUw.js → common-B7sS0asw.js} +1 -1
  6. package/dist/{data-grid-overlay-editor-Dv0TkGKt.js → data-grid-overlay-editor-DtWpYC-j.js} +1 -1
  7. package/dist/{feedback-button-Xk-mOev4.js → feedback-button-KVSGwnVr.js} +2 -2
  8. package/dist/{glide-data-editor-DdxBDWAj.js → glide-data-editor-D0dykzDr.js} +3 -3
  9. package/dist/{globals-DR3VVkF6.js → globals-DOi11Nup.js} +1 -1
  10. package/dist/main.js +6160 -6141
  11. package/dist/{number-overlay-editor-Cc5gJryh.js → number-overlay-editor-DoR-BTMn.js} +1 -1
  12. package/dist/{process-output-39KkAXSF.js → process-output-BvCDoG-m.js} +14 -25
  13. package/dist/{reveal-component-Dm5K9KPi.js → reveal-component-Vu8VncD4.js} +2 -2
  14. package/dist/{spec-Ww0JjShW.js → spec-DV8oNpRR.js} +46 -49
  15. package/dist/{semaphore-8KhQouXt.js → useDeepCompareMemoize-C90a6_io.js} +15 -5
  16. package/dist/{vega-component-DQZhTzVQ.js → vega-component-ArEoBGzQ.js} +197 -198
  17. package/package.json +1 -1
  18. package/src/components/chat/__tests__/chat-utils.test.ts +48 -0
  19. package/src/components/chat/__tests__/message-queue.test.tsx +94 -1
  20. package/src/components/chat/__tests__/pending-chat-prompt.test.tsx +568 -0
  21. package/src/components/chat/__tests__/useFileState.test.tsx +176 -15
  22. package/src/components/chat/chat-components.tsx +3 -2
  23. package/src/components/chat/chat-panel.tsx +199 -74
  24. package/src/components/chat/chat-utils.ts +148 -34
  25. package/src/components/chat/user-message.tsx +15 -6
  26. package/src/components/data-table/charts/__tests__/altair-generator.test.ts +42 -27
  27. package/src/components/data-table/charts/chart-spec/altair-generator.ts +2 -6
  28. package/src/core/ai/__tests__/attachments.test.ts +153 -0
  29. package/src/core/ai/attachments.ts +80 -0
  30. package/src/utils/python-poet/poet.ts +12 -2
  31. package/dist/useDeepCompareMemoize-Bvrue1iy.js +0 -11
@@ -1,6 +1,6 @@
1
1
  import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
2
2
  import { t } from "./react-Bgs_wQh3.js";
3
- import { a as n } from "./glide-data-editor-DdxBDWAj.js";
3
+ import { a as n } from "./glide-data-editor-D0dykzDr.js";
4
4
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.3.1_57c124ac5a994dbbf13fd11838cf9ba9/node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/private/number-overlay-editor-style.js
5
5
  var r = /* @__PURE__ */ e(t()), i = /*#__PURE__*/ n("div")({
6
6
  name: "NumberOverlayEditorStyle",
@@ -2,14 +2,13 @@ import { T as e } from "./html-to-image-Bor20n8N.js";
2
2
  import { h as t } from "./tooltip-Bg-SDCwa.js";
3
3
  import { $ as n, Q as r } from "./error-entries-5kRrE4vX.js";
4
4
  import { r as i } from "./assertNever-DXGfUmPW.js";
5
- import { n as a } from "./semaphore-8KhQouXt.js";
6
- var o = t("file", [["path", {
5
+ var a = t("file", [["path", {
7
6
  d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
8
7
  key: "1oefj6"
9
8
  }], ["path", {
10
9
  d: "M14 2v5a1 1 0 0 0 1 1h5",
11
10
  key: "wfsgrz"
12
- }]]), s = t("square", [["rect", {
11
+ }]]), o = t("square", [["rect", {
13
12
  width: "18",
14
13
  height: "18",
15
14
  x: "3",
@@ -19,6 +18,16 @@ var o = t("file", [["path", {
19
18
  }]]);
20
19
  //#endregion
21
20
  //#region src/utils/blob.ts
21
+ function s(e) {
22
+ return new Promise((t, n) => {
23
+ let r = new FileReader();
24
+ r.onload = (e) => {
25
+ t(e.target?.result);
26
+ }, r.onerror = (e) => {
27
+ n(/* @__PURE__ */ Error(`Failed to read blob: ${e.type}`));
28
+ }, r.readAsDataURL(e);
29
+ });
30
+ }
22
31
  function c(e) {
23
32
  let [t, n] = e.split(",", 2), r = /^data:(.+);base64$/.exec(t)?.[1], i = atob(n), a = i.length, o = new Uint8Array(a);
24
33
  for (let e = 0; e < a; e++) o[e] = i.charCodeAt(e);
@@ -52,29 +61,9 @@ function h(e, t) {
52
61
  });
53
62
  }
54
63
  //#endregion
55
- //#region src/utils/fileToBase64.ts
56
- var g = 5;
57
- function _(e, t) {
58
- return new Promise((n) => {
59
- let r = new FileReader();
60
- r.readAsDataURL(e), r.onload = (e) => {
61
- if (e.target?.result) {
62
- let r = e.target.result;
63
- n(t === "base64" ? r.slice(r.indexOf(",") + 1) : r);
64
- }
65
- };
66
- });
67
- }
68
- function v(e) {
69
- return a(e, g, async (e) => {
70
- let t = await _(e, "base64");
71
- return [e.name, t];
72
- });
73
- }
74
- //#endregion
75
64
  //#region src/components/editor/output/console/process-output.ts
76
- function y(e) {
65
+ function g(e) {
77
66
  return e.mimetype.startsWith("application/vnd.marimo") || e.mimetype === "text/html" ? n(i.asString(e.data)) : r(i.asString(e.data));
78
67
  }
79
68
  //#endregion
80
- export { d as a, h as c, s as d, o as f, m as i, c as l, _ as n, p as o, v as r, f as s, y as t, l as u };
69
+ export { f as a, l as c, a as d, p as i, s as l, m as n, h as o, d as r, c as s, g as t, o as u };
@@ -3,7 +3,7 @@ import { g as t, h as n, i as r, m as i, t as a } from "./button-qQhINE7z.js";
3
3
  import { t as o } from "./react-Bgs_wQh3.js";
4
4
  import { t as s } from "./compiler-runtime-C5KHtL5D.js";
5
5
  import { h as c, t as l } from "./tooltip-Bg-SDCwa.js";
6
- import { $ as u, Q as d, Sn as f, an as p, et as m, i as h, l as g, n as _, on as v, r as y, t as b, u as x, vn as S, yn as C } from "./common-Cm5ENbUw.js";
6
+ import { $ as u, Q as d, Sn as f, an as p, et as m, i as h, l as g, n as _, on as v, r as y, t as b, u as x, vn as S, yn as C } from "./common-B7sS0asw.js";
7
7
  import { M as w } from "./select-DW32QOzC.js";
8
8
  import { X as T } from "./dropdown-menu-CmgUseHo.js";
9
9
  import { Nt as E } from "./error-entries-5kRrE4vX.js";
@@ -11,7 +11,7 @@ import { t as D } from "./jsx-runtime-D8btoEHk.js";
11
11
  import { Lt as O, Pt as k, f as A, i as ee } from "./use-restore-focus-CE9Sflmg.js";
12
12
  import { t as j } from "./useEvent-BoN7U38T.js";
13
13
  import { o as te } from "./static-state-CnQdTBTW.js";
14
- import { n as ne, t as re } from "./code-visibility-CXijswY7.js";
14
+ import { n as ne, t as re } from "./code-visibility-0v5rL9iu.js";
15
15
  /* empty css */
16
16
  var M = c("sticky-note", [["path", {
17
17
  d: "M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",
@@ -215,22 +215,14 @@ var a = e("align-center-vertical", [
215
215
  d: "M9 11.2h5.7",
216
216
  key: "3zgcl2"
217
217
  }]
218
- ]);
219
- //#endregion
220
- //#region src/components/data-table/charts/chart-spec/utils.ts
221
- function v(e) {
222
- return e && e.replaceAll(".", "\\.").replaceAll("[", "\\[").replaceAll("]", "\\]").replaceAll(":", "\\:");
223
- }
224
- //#endregion
225
- //#region src/components/data-table/charts/constants.ts
226
- var y = "__count__", b = "default", x = "yearmonthdate", ee = {
218
+ ]), v = "__count__", y = "default", b = "yearmonthdate", ee = {
227
219
  line: d,
228
220
  bar: f,
229
221
  pie: r,
230
222
  scatter: m,
231
223
  heatmap: n,
232
224
  area: l
233
- }, S = "mean", C = {
225
+ }, x = "mean", S = {
234
226
  none: _,
235
227
  count: t,
236
228
  sum: g,
@@ -245,7 +237,7 @@ var y = "__count__", b = "default", x = "yearmonthdate", ee = {
245
237
  variance: u,
246
238
  variancep: u,
247
239
  bin: h
248
- }, te = {
240
+ }, C = {
249
241
  none: "No aggregation",
250
242
  count: "Count of records",
251
243
  sum: "Sum of values",
@@ -260,8 +252,8 @@ var y = "__count__", b = "default", x = "yearmonthdate", ee = {
260
252
  variance: "Variance",
261
253
  variancep: "Variance of population",
262
254
  bin: "Group values into bins"
263
- }, ne = [
264
- b,
255
+ }, te = [
256
+ y,
265
257
  "accent",
266
258
  "category10",
267
259
  "category20",
@@ -306,11 +298,11 @@ var y = "__count__", b = "default", x = "yearmonthdate", ee = {
306
298
  "spectral",
307
299
  "rainbow",
308
300
  "sinebow"
309
- ], re = {
301
+ ], ne = {
310
302
  number: "Continuous numerical scale",
311
303
  string: "Discrete categorical scale (inputs treated as strings)",
312
304
  temporal: "Continuous temporal scale"
313
- }, ie = {
305
+ }, re = {
314
306
  year: ["Year", "2025"],
315
307
  quarter: ["Quarter of year", "Q1"],
316
308
  month: ["Month of year", "Jan"],
@@ -326,11 +318,11 @@ var y = "__count__", b = "default", x = "yearmonthdate", ee = {
326
318
  yearmonthdate: ["Year Month Date", "Jan 01, 2025"],
327
319
  yearmonthdatehours: ["Year Month Date Hours", "Jan 01, 2025 12:00"],
328
320
  monthdate: ["Month Date", "Jan 01"]
329
- }, w = [
321
+ }, ie = [
330
322
  "number",
331
323
  "string",
332
324
  "temporal"
333
- ], T = [
325
+ ], w = [
334
326
  "year",
335
327
  "quarter",
336
328
  "month",
@@ -342,15 +334,15 @@ var y = "__count__", b = "default", x = "yearmonthdate", ee = {
342
334
  "minutes",
343
335
  "seconds",
344
336
  "milliseconds"
345
- ], E = [
337
+ ], T = [
346
338
  "yearmonth",
347
339
  "yearmonthdate",
348
340
  "yearmonthdatehours",
349
341
  "monthdate"
350
- ], D = [...T, ...E];
351
- [...D];
352
- var O = ["ascending", "descending"], k = "none", A = [
353
- k,
342
+ ], E = [...w, ...T];
343
+ [...E];
344
+ var D = ["ascending", "descending"], O = "none", k = [
345
+ O,
354
346
  "bin",
355
347
  "count",
356
348
  "sum",
@@ -364,23 +356,23 @@ var O = ["ascending", "descending"], k = "none", A = [
364
356
  "stdevp",
365
357
  "variance",
366
358
  "variancep"
367
- ], j = [
368
- k,
359
+ ], A = [
360
+ O,
369
361
  "count",
370
362
  "distinct",
371
363
  "valid"
372
- ], M = {
364
+ ], j = {
373
365
  LINE: "line",
374
366
  BAR: "bar",
375
367
  PIE: "pie",
376
368
  SCATTER: "scatter",
377
369
  HEATMAP: "heatmap",
378
370
  AREA: "area"
379
- }, N = Object.values(M), ae = [
371
+ }, M = Object.values(j), N = [
380
372
  "X",
381
373
  "Y",
382
374
  "Color",
383
- k
375
+ O
384
376
  ];
385
377
  //#endregion
386
378
  //#region src/components/data-table/charts/chart-spec/types.ts
@@ -399,7 +391,7 @@ function P(e) {
399
391
  default: return i(e), "nominal";
400
392
  }
401
393
  }
402
- function F(e) {
394
+ function ae(e) {
403
395
  switch (e) {
404
396
  case "number":
405
397
  case "integer": return "number";
@@ -413,18 +405,23 @@ function F(e) {
413
405
  default: return i(e), "string";
414
406
  }
415
407
  }
416
- function I(e) {
408
+ function F(e) {
417
409
  switch (e) {
418
- case M.PIE: return "arc";
419
- case M.SCATTER: return "point";
420
- case M.HEATMAP: return "rect";
410
+ case j.PIE: return "arc";
411
+ case j.SCATTER: return "point";
412
+ case j.HEATMAP: return "rect";
421
413
  default: return e;
422
414
  }
423
415
  }
424
416
  //#endregion
417
+ //#region src/components/data-table/charts/chart-spec/utils.ts
418
+ function I(e) {
419
+ return e && e.replaceAll(".", "\\.").replaceAll("[", "\\[").replaceAll("]", "\\]").replaceAll(":", "\\:");
420
+ }
421
+ //#endregion
425
422
  //#region src/components/data-table/charts/chart-spec/encodings.ts
426
423
  function L(e, t, n, r) {
427
- if (e === M.HEATMAP) return n?.maxbins ? { maxbins: n?.maxbins } : void 0;
424
+ if (e === j.HEATMAP) return n?.maxbins ? { maxbins: n?.maxbins } : void 0;
428
425
  if (t !== "number") return;
429
426
  if (!n?.binned) return r;
430
427
  let i = {};
@@ -437,7 +434,7 @@ function R(e) {
437
434
  if (n && n !== "default") return { scheme: n };
438
435
  }
439
436
  function z(e, t) {
440
- if (e === M.PIE) return;
437
+ if (e === j.PIE) return;
441
438
  let n;
442
439
  if (Q(t.general?.colorByColumn?.field)) n = t.general?.colorByColumn;
443
440
  else if (Q(t.color?.field)) switch (t.color?.field) {
@@ -460,7 +457,7 @@ function z(e, t) {
460
457
  };
461
458
  let r = t.color?.bin, i = n.selectedDataType || "string", a = n?.aggregate;
462
459
  return {
463
- field: v(n.field),
460
+ field: I(n.field),
464
461
  type: P(i),
465
462
  scale: R(t),
466
463
  aggregate: V(a, i),
@@ -468,10 +465,10 @@ function z(e, t) {
468
465
  };
469
466
  }
470
467
  function B(e, t) {
471
- if (!t.general?.stacking && Q(t.general?.colorByColumn?.field) && e === M.BAR) return { field: v(t.general?.colorByColumn?.field) };
468
+ if (!t.general?.stacking && Q(t.general?.colorByColumn?.field) && e === j.BAR) return { field: I(t.general?.colorByColumn?.field) };
472
469
  }
473
470
  function V(e, t, n) {
474
- if (t !== "temporal" && e !== "none" && e !== "bin") return e ? t === "string" ? j.includes(e) ? e : void 0 : e : n || void 0;
471
+ if (t !== "temporal" && e !== "none" && e !== "bin") return e ? t === "string" ? A.includes(e) ? e : void 0 : e : n || void 0;
475
472
  }
476
473
  //#endregion
477
474
  //#region src/components/data-table/charts/chart-spec/tooltips.ts
@@ -521,7 +518,7 @@ function U(e) {
521
518
  e && s.push(e);
522
519
  continue;
523
520
  }
524
- let o = { field: v(e.field) };
521
+ let o = { field: I(e.field) };
525
522
  s.push(o);
526
523
  }
527
524
  return s;
@@ -531,7 +528,7 @@ function U(e) {
531
528
  var W = "X-axis column is required", G = "Y-axis column is required";
532
529
  function K({ chartType: e, formValues: t, theme: n, width: r, height: i }) {
533
530
  let { xColumn: a, yColumn: o, colorByColumn: s, horizontal: c, stacking: l, title: u, facet: d } = t.general ?? {};
534
- if (e === M.PIE) return X(t, n, r, i);
531
+ if (e === j.PIE) return X(t, n, r, i);
535
532
  if (!Q(a?.field)) return W;
536
533
  if (!Q(o?.field)) return G;
537
534
  let f = J(a, {
@@ -539,7 +536,7 @@ function K({ chartType: e, formValues: t, theme: n, width: r, height: i }) {
539
536
  label: $(t.xAxis?.label),
540
537
  stack: s?.field && c ? l : void 0,
541
538
  chartType: e
542
- }), p = S;
539
+ }), p = x;
543
540
  o?.selectedDataType === "string" && (p = "count");
544
541
  let m = J(o, {
545
542
  binValues: t.yAxis?.bin,
@@ -570,7 +567,7 @@ function K({ chartType: e, formValues: t, theme: n, width: r, height: i }) {
570
567
  }, b = ce(d?.column, d?.row);
571
568
  return {
572
569
  ...v,
573
- mark: { type: I(e) },
570
+ mark: { type: F(e) },
574
571
  encoding: y,
575
572
  ...b
576
573
  };
@@ -590,7 +587,7 @@ function J(e, { binValues: t, label: n, stack: r, chartType: i, defaultAggregate
590
587
  title: n === "__count__" ? void 0 : n,
591
588
  stack: r
592
589
  } : {
593
- field: v(e.field),
590
+ field: I(e.field),
594
591
  type: P(e.selectedDataType || "unknown"),
595
592
  bin: L(i, o, t),
596
593
  title: n,
@@ -606,7 +603,7 @@ function Y(e, t) {
606
603
  binned: e.binned
607
604
  }, { maxbins: 6 });
608
605
  return {
609
- field: v(e.field),
606
+ field: I(e.field),
610
607
  sort: e.sort,
611
608
  timeUnit: se(e),
612
609
  type: P(e.selectedDataType || "unknown"),
@@ -621,16 +618,16 @@ function X(e, t, n, r) {
621
618
  binValues: e.xAxis?.bin,
622
619
  label: $(e.xAxis?.label),
623
620
  stack: void 0,
624
- chartType: M.PIE
621
+ chartType: j.PIE
625
622
  }), c = {
626
- field: v(a.field),
623
+ field: I(a.field),
627
624
  type: P(a.selectedDataType || "unknown"),
628
625
  scale: R(e),
629
626
  title: $(e.yAxis?.label)
630
627
  };
631
628
  return {
632
629
  ...Z({
633
- chartType: M.PIE,
630
+ chartType: j.PIE,
634
631
  formValues: e,
635
632
  theme: t,
636
633
  width: n,
@@ -638,7 +635,7 @@ function X(e, t, n, r) {
638
635
  title: o
639
636
  }),
640
637
  mark: {
641
- type: I(M.PIE),
638
+ type: F(j.PIE),
642
639
  innerRadius: e.style?.innerRadius
643
640
  },
644
641
  encoding: {
@@ -655,7 +652,7 @@ function X(e, t, n, r) {
655
652
  }
656
653
  function Z({ chartType: e, formValues: t, theme: n, width: r, height: i, title: a }) {
657
654
  let o = t.style?.gridLines ?? !1;
658
- return e === M.SCATTER && (o = !0), {
655
+ return e === j.SCATTER && (o = !0), {
659
656
  $schema: "https://vega.github.io/schema/vega-lite/v6.json",
660
657
  background: n === "dark" ? "dark" : "white",
661
658
  title: a,
@@ -683,4 +680,4 @@ function ce(e, t) {
683
680
  return e?.linkXAxis === !1 && (n.x = "independent"), t?.linkYAxis === !1 && (n.y = "independent"), Object.keys(n).length > 0 ? { resolve: { axis: n } } : void 0;
684
681
  }
685
682
  //#endregion
686
- export { x as C, _ as D, v as E, u as O, b as S, ie as T, C as _, A as a, y as b, E as c, w as d, T as f, te as g, D as h, F as i, M as l, j as m, K as n, N as o, O as p, Q as r, ae as s, q as t, k as u, ee as v, re as w, S as x, ne as y };
683
+ export { b as C, u as D, _ as E, y as S, re as T, S as _, k as a, v as b, T as c, ie as d, w as f, C as g, E as h, ae as i, j as l, A as m, K as n, M as o, D as p, Q as r, N as s, q as t, O as u, ee as v, ne as w, x, te as y };
@@ -1,5 +1,8 @@
1
+ import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
2
+ import { t } from "./react-Bgs_wQh3.js";
3
+ import { jt as n } from "./use-restore-focus-CE9Sflmg.js";
1
4
  //#region src/utils/semaphore.ts
2
- var e = class {
5
+ var r = class {
3
6
  maxPermits;
4
7
  permits;
5
8
  waiters = [];
@@ -35,9 +38,16 @@ var e = class {
35
38
  }
36
39
  }
37
40
  };
38
- function t(t, n, r) {
39
- let i = new e(n);
40
- return t.length === 0 ? Promise.resolve([]) : Promise.all(t.map((e, t) => i.run(() => r(e, t))));
41
+ function i(e, t, n) {
42
+ let i = new r(t);
43
+ return e.length === 0 ? Promise.resolve([]) : Promise.all(e.map((e, t) => i.run(() => n(e, t))));
41
44
  }
42
45
  //#endregion
43
- export { t as n, e as t };
46
+ //#region src/hooks/useDeepCompareMemoize.ts
47
+ var a = /* @__PURE__ */ e(t(), 1);
48
+ function o(e) {
49
+ let t = a.useRef(e);
50
+ return n(e, t.current) || (t.current = e), t.current;
51
+ }
52
+ //#endregion
53
+ export { r as n, i as r, o as t };