@mechane-ai/elements 0.67.0 → 0.68.0

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 (77) hide show
  1. package/dist/ai.js +225 -224
  2. package/dist/{article-anMy8fA5.js → article-Ni152e-v.js} +104 -89
  3. package/dist/article.js +1 -1
  4. package/dist/catalog.json +71 -1
  5. package/dist/{categorical-values-Bh7ZkEQn.js → categorical-values-6Iz03F1i.js} +1 -1
  6. package/dist/{cells-X8SVrZBc.js → cells-BRI8LpMU.js} +1 -1
  7. package/dist/charts/cartesian.js +1 -1
  8. package/dist/charts/cells.js +1 -1
  9. package/dist/charts/comparison.js +1 -1
  10. package/dist/charts/distribution.js +1 -1
  11. package/dist/charts/figure.js +12 -12
  12. package/dist/charts/graph.js +1 -1
  13. package/dist/charts/hierarchy.js +1 -1
  14. package/dist/charts/image.js +1 -1
  15. package/dist/charts/matrix.js +2 -2
  16. package/dist/charts/plot.js +16 -15
  17. package/dist/charts/relationship.js +1 -1
  18. package/dist/charts/text.js +1 -1
  19. package/dist/charts/timeline.js +2 -2
  20. package/dist/charts/trend.js +1 -1
  21. package/dist/charts.js +3 -3
  22. package/dist/{color-legend-CIo7DhXB.js → color-legend-4As8881l.js} +1 -1
  23. package/dist/content/markdown.js +1 -1
  24. package/dist/{dumbbell-plot-BQDGe0sQ.js → dumbbell-plot-jaQvOctJ.js} +4 -4
  25. package/dist/{embedding-map-DmmknG7A.js → embedding-map-DnZL1kvY.js} +5 -5
  26. package/dist/figure-format-BVb7yFCA.js +46 -0
  27. package/dist/{figure-frame-DlyNTDzh.js → figure-frame-96zFqsWz.js} +1 -1
  28. package/dist/{image-grid-CxEAQvTf.js → image-grid-B6fdmE9c.js} +3 -3
  29. package/dist/kits/evaluation.js +5 -5
  30. package/dist/kits/interpretability.js +8 -8
  31. package/dist/kits/operations.js +4 -4
  32. package/dist/kits/research.js +641 -229
  33. package/dist/kits/training.js +4 -4
  34. package/dist/lesson.js +3 -3
  35. package/dist/markdown-JeuBeMDZ.js +293 -0
  36. package/dist/mdx.js +4 -4
  37. package/dist/packages/charts/src/plot/index.d.ts +2 -0
  38. package/dist/packages/charts/src/plot/plot-layout.d.ts +2 -2
  39. package/dist/packages/charts/src/plot/spatial-layer.d.ts +32 -0
  40. package/dist/packages/charts/src/plot/ticks.d.ts +2 -2
  41. package/dist/packages/foundations/src/visible-motion.d.ts +1 -1
  42. package/dist/packages/kits/src/research/index.d.ts +7 -0
  43. package/dist/packages/kits/src/research/motion-clip.d.ts +41 -0
  44. package/dist/packages/kits/src/research/motion-error.d.ts +8 -0
  45. package/dist/packages/kits/src/research/motion-figure.d.ts +9 -0
  46. package/dist/packages/kits/src/research/motion-frame.d.ts +22 -0
  47. package/dist/packages/kits/src/research/motion-scene.d.ts +22 -0
  48. package/dist/packages/teaching/src/article/uncover.d.ts +2 -0
  49. package/dist/{param-CKr8EYxF.js → param-Dk92C-K1.js} +1 -1
  50. package/dist/plot-CpTwLIYN.js +101 -0
  51. package/dist/{plot-layout-CVzSbcU7.js → plot-layout-1MG72ZWn.js} +151 -101
  52. package/dist/{plot-surface-CBhI1alw.js → plot-surface-8-FZI94y.js} +1 -1
  53. package/dist/{reference-lines-C970JwWZ.js → reference-lines-C18o1yEY.js} +1 -1
  54. package/dist/{scene-C3dCxckI.js → scene-B8dppj5V.js} +7 -7
  55. package/dist/scene.js +1 -1
  56. package/dist/{slope-chart-DekEJxsy.js → slope-chart-CELflRJd.js} +5 -5
  57. package/dist/styles2.css +12 -0
  58. package/dist/{time-series-BSNnijxf.js → time-series-DtAtGoT_.js} +6 -6
  59. package/dist/{timeline-CnxfYSIg.js → timeline-CzianQir.js} +4 -4
  60. package/dist/{token-heatmap-CJaXo56P.js → token-heatmap-m6oaMwkK.js} +273 -288
  61. package/dist/{token-predictions-Bi7aKPnh.js → token-predictions-CpGVjOIs.js} +4 -4
  62. package/dist/{transport-CXj0DV6o.js → transport-DQ1yzsQl.js} +2 -2
  63. package/dist/{tree-diagram-BxOZsjr1.js → tree-diagram-D9ekymCQ.js} +4 -4
  64. package/dist/{treemap-B2yOAetT.js → treemap-DT8q65LQ.js} +5 -5
  65. package/dist/{use-tween-C1TWJwce.js → use-tween-DbXVZBR8.js} +1 -1
  66. package/dist/{violin-plot-W2L_2JRo.js → violin-plot-83HSjnQM.js} +4 -4
  67. package/dist/visible-motion-D6NwjGNz.js +24 -0
  68. package/dist/{waterfall-Bt73N2Ng.js → waterfall-DmApvdrY.js} +4 -4
  69. package/package.json +1 -1
  70. package/recipes/recorded-motion.tsx +14 -0
  71. package/skills/review-elements/SKILL.md +4 -0
  72. package/skills/review-explainer/SKILL.md +4 -0
  73. package/skills/use-elements/SKILL.md +2 -0
  74. package/skills/use-elements/references/kits.md +23 -0
  75. package/skills/write-explainer/SKILL.md +5 -0
  76. package/dist/figure-format-B8kRZMlo.js +0 -36
  77. package/dist/markdown-Diffqqm7.js +0 -313
@@ -1,7 +1,7 @@
1
1
  import { o as e, u as t } from "./src-Bkov5TTa.js";
2
2
  import { d as n } from "./src-CIyuaSCi.js";
3
3
  import { n as r, t as i } from "./chart-tones-ei3BC2AL.js";
4
- import { a, i as o, n as s, r as c } from "./figure-format-B8kRZMlo.js";
4
+ import { a, i as o, n as s, r as c } from "./figure-format-BVb7yFCA.js";
5
5
  import { r as l, t as u } from "./scale-C2xgZyZN.js";
6
6
  import * as d from "@stylexjs/stylex";
7
7
  import { createParts as f, mergeProps as p } from "@ui-sdk/react/primitive";
@@ -14,24 +14,24 @@ function re(e) {
14
14
  return new Set(e.map((e) => e.id)).size === e.length;
15
15
  }
16
16
  // packages/charts/src/chart.tsx
17
- var ie = 10, O = "[data-slot=\"chart-mark\"]", ae = /* @__PURE__ */ new Set(["Enter", " "]), oe = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp"]), se = {
17
+ var ie = 10, ae = "[data-slot=\"chart-mark\"]", oe = /* @__PURE__ */ new Set(["Enter", " "]), se = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp"]), ce = {
18
18
  ArrowLeft: [-1, 0],
19
19
  ArrowRight: [1, 0],
20
20
  ArrowUp: [0, -1],
21
21
  ArrowDown: [0, 1]
22
22
  };
23
- function k(e, t) {
23
+ function O(e, t) {
24
24
  return t !== null && e.some((e) => e.id === t);
25
25
  }
26
- function A(e) {
27
- let t = [e.cursor, e.selected].find((t) => k(e.items, t)) ?? e.items[0]?.id ?? null;
26
+ function k(e) {
27
+ let t = [e.cursor, e.selected].find((t) => O(e.items, t)) ?? e.items[0]?.id ?? null;
28
28
  return {
29
- inspected: k(e.items, e.inspected) ? e.inspected : null,
30
- selected: k(e.items, e.selected) ? e.selected : null,
29
+ inspected: O(e.items, e.inspected) ? e.inspected : null,
30
+ selected: O(e.items, e.selected) ? e.selected : null,
31
31
  cursor: t
32
32
  };
33
33
  }
34
- function ce({ key: e, index: t, last: n, columns: r, isReversed: i }) {
34
+ function le({ key: e, index: t, last: n, columns: r, isReversed: i }) {
35
35
  let a = t - t % r, o = Math.min(n, a + r - 1), s = Math.max(a, t - 1), c = Math.min(o, t + 1);
36
36
  return {
37
37
  Home: a,
@@ -42,15 +42,15 @@ function ce({ key: e, index: t, last: n, columns: r, isReversed: i }) {
42
42
  ArrowDown: t + r > n ? t : t + r
43
43
  }[e];
44
44
  }
45
- function le({ event: e, index: t, last: n, arrows: r, isReversed: i }) {
46
- if (r === "both" && oe.has(e.key)) return Math.max(0, Math.min(n, t + (e.key === "ArrowDown" ? 1 : -1)));
45
+ function ue({ event: e, index: t, last: n, arrows: r, isReversed: i }) {
46
+ if (r === "both" && se.has(e.key)) return Math.max(0, Math.min(n, t + (e.key === "ArrowDown" ? 1 : -1)));
47
47
  let a = ne(e, {
48
48
  arrows: "horizontal",
49
49
  dir: i ? "rtl" : "ltr"
50
50
  });
51
51
  if (a !== null) return a.bound === void 0 ? Math.max(0, Math.min(n, t + a.direction * (a.size === "large" ? ie : 1))) : a.bound === "min" ? 0 : n;
52
52
  }
53
- var j = b({
53
+ var A = b({
54
54
  name: "chart",
55
55
  options: {
56
56
  items: "value",
@@ -83,7 +83,7 @@ var j = b({
83
83
  api: (e) => {
84
84
  let { store: t } = e, n = ee(e), r = !1, i = e.options().revision;
85
85
  e.onOptions((e) => {
86
- let { inspected: n } = t.get(), r = e.revision !== i || n !== null && !k(e.items, n);
86
+ let { inspected: n } = t.get(), r = e.revision !== i || n !== null && !O(e.items, n);
87
87
  i = e.revision, r && n !== null && e.inspected === void 0 && t.set({ inspected: null });
88
88
  });
89
89
  function a(t) {
@@ -91,7 +91,7 @@ var j = b({
91
91
  return r?.(t) ?? n.find((e) => e.id === t)?.label ?? t;
92
92
  }
93
93
  function o(i, o) {
94
- if (i !== null && !k(e.options().items, i) || (r = !1, i !== null && o.reason !== "item-hover" && t.set({ cursor: i }), t.get().inspected === i)) return !1;
94
+ if (i !== null && !O(e.options().items, i) || (r = !1, i !== null && o.reason !== "item-hover" && t.set({ cursor: i }), t.get().inspected === i)) return !1;
95
95
  let { reason: s, event: c } = o, l = n("inspected", i, c === void 0 ? { reason: s } : {
96
96
  reason: s,
97
97
  event: c
@@ -99,13 +99,13 @@ var j = b({
99
99
  return l && i !== null && o.reason === "list-navigation" && v(i === t.get().selected ? `${a(i)}. Selected.` : a(i)), l;
100
100
  }
101
101
  function s(t, n) {
102
- return k(e.options().items, t) ? !x(e, "onSelect", t, n === void 0 ? { reason: "item-press" } : {
102
+ return O(e.options().items, t) ? !x(e, "onSelect", t, n === void 0 ? { reason: "item-press" } : {
103
103
  reason: "item-press",
104
104
  event: n
105
105
  }) : !1;
106
106
  }
107
107
  function c(n, r) {
108
- let { items: i, columns: a, arrows: o = "horizontal", place: s } = e.options(), { cursor: c } = A(t.get()), l = Math.max(0, i.findIndex((e) => e.id === c)), u = i.length - 1, d = se[n.key];
108
+ let { items: i, columns: a, arrows: o = "horizontal", place: s } = e.options(), { cursor: c } = k(t.get()), l = Math.max(0, i.findIndex((e) => e.id === c)), u = i.length - 1, d = ce[n.key];
109
109
  if (s !== void 0 && d !== void 0) {
110
110
  let e = c === null ? void 0 : s(c);
111
111
  if (c === null || e === void 0) return i[l]?.id;
@@ -118,13 +118,13 @@ var j = b({
118
118
  });
119
119
  return w(e, t, d) ?? c;
120
120
  }
121
- let f = C(r), p = a === void 0 || a < 1 ? le({
121
+ let f = C(r), p = a === void 0 || a < 1 ? ue({
122
122
  event: n,
123
123
  index: l,
124
124
  last: u,
125
125
  arrows: o,
126
126
  isReversed: f
127
- }) : ce({
127
+ }) : le({
128
128
  key: n.key,
129
129
  index: l,
130
130
  last: u,
@@ -150,8 +150,8 @@ var j = b({
150
150
  keydown(n, r) {
151
151
  let i = n.altKey || n.ctrlKey || n.metaKey;
152
152
  if (n.defaultPrevented || i || e.options().items.length === 0) return;
153
- if (ae.has(n.key)) {
154
- let { cursor: r } = A(t.get());
153
+ if (oe.has(n.key)) {
154
+ let { cursor: r } = k(t.get());
155
155
  !(n.target instanceof Element && n.target.closest("button, a, input, select, textarea") !== null) && r !== null && e.options().onSelect !== void 0 && (n.preventDefault(), s(r, n));
156
156
  return;
157
157
  }
@@ -162,7 +162,7 @@ var j = b({
162
162
  }));
163
163
  },
164
164
  focus(e, n) {
165
- e.target === n && S() && o(A(t.get()).cursor, {
165
+ e.target === n && S() && o(k(t.get()).cursor, {
166
166
  reason: "focus-in",
167
167
  event: e
168
168
  });
@@ -202,18 +202,18 @@ var j = b({
202
202
  });
203
203
  },
204
204
  press(n) {
205
- let { inspected: r } = A(t.get());
206
- n?.target instanceof Element && n.target.closest(O) !== null || e.options().locate !== void 0 && r !== null && e.options().onSelect !== void 0 && s(r, n);
205
+ let { inspected: r } = k(t.get());
206
+ n?.target instanceof Element && n.target.closest(ae) !== null || e.options().locate !== void 0 && r !== null && e.options().onSelect !== void 0 && s(r, n);
207
207
  }
208
208
  };
209
209
  },
210
210
  slots: (e) => ({
211
- root: e({ state: A }),
211
+ root: e({ state: k }),
212
212
  plot: e({
213
- state: A,
213
+ state: k,
214
214
  attrs: (e) => ({
215
215
  tabindex: e.items.length > 0 ? "0" : void 0,
216
- "data-inspecting": A(e).inspected === null ? void 0 : ""
216
+ "data-inspecting": k(e).inspected === null ? void 0 : ""
217
217
  }),
218
218
  press: ({ api: e }, t) => e.press(t),
219
219
  on: {
@@ -236,7 +236,7 @@ var j = b({
236
236
  e.pointerType === "mouse" && t.leave(e);
237
237
  },
238
238
  mousedown: (e, { el: t }) => {
239
- t !== void 0 && e.target instanceof Element && e.target.closest(O) !== null && (e.preventDefault(), t.focus({ preventScroll: !0 }));
239
+ t !== void 0 && e.target instanceof Element && e.target.closest(ae) !== null && (e.preventDefault(), t.focus({ preventScroll: !0 }));
240
240
  }
241
241
  },
242
242
  bind: (e, t) => {
@@ -285,14 +285,14 @@ var j = b({
285
285
  items: (e) => e.items(),
286
286
  closed: !0
287
287
  }
288
- }), ue = f(j, { root: "figure" }).Root, de = f(j, {
288
+ }), de = f(A, { root: "figure" }).Root, j = f(A, {
289
289
  root: "figure",
290
290
  plot: "div",
291
291
  mark: "span"
292
- }), fe = de.Plot, pe = f(j, {
292
+ }), fe = j.Plot, pe = f(A, {
293
293
  root: "figure",
294
294
  plot: "p"
295
- }).Plot, me = de.Mark;
295
+ }).Plot, me = j.Mark;
296
296
  function he(e, t) {
297
297
  return e.find((e) => e.id === t)?.label ?? "\xA0";
298
298
  }
@@ -608,24 +608,45 @@ var B = 1e3, V = {
608
608
  function Be({ domain: e, count: t, zoneOffset: n }) {
609
609
  let [r, i] = e;
610
610
  if (!(t > 0) || !(i > r)) return [];
611
- let a = (i - r) / t, o = Object.values(V).map((e) => e * B).find((e) => e >= a) ?? V.year * B, s = o > ze ? Math.ceil((r + n) / Re) * Re : 0, c = s + Math.ceil((r + n - s) / o) * o, l = Math.max(0, Math.min(ke, Math.floor((i + n - c) / o) + 1));
612
- return Array.from({ length: l }, (e, t) => c + t * o - n);
611
+ let a = (i - r) / t, o = Object.values(V).map((e) => e * B).find((e) => e >= a) ?? V.year * B, s = typeof n == "number" ? () => n : n, c = o > ze ? Math.ceil((r + s(r)) / Re) * Re : 0;
612
+ function* l() {
613
+ let e = Math.ceil(r);
614
+ for (; e <= i;) {
615
+ let t = s(e), n = e + t - c, r = c + Math.ceil(n / o) * o - t;
616
+ r === e && (yield e);
617
+ let a = r === e ? e + o : r, l = Math.min(a, Math.floor(i));
618
+ e = s(l) === t ? a : Ve(e, l, s);
619
+ }
620
+ }
621
+ let u = l();
622
+ return Array.from({ length: ke }, () => {
623
+ let e = u.next();
624
+ return e.done === !0 ? void 0 : e.value;
625
+ }).filter((e) => e !== void 0);
626
+ }
627
+ function Ve(e, t, n) {
628
+ let r = n(e), i = e, a = t;
629
+ for (; a - i > 1;) {
630
+ let e = i + Math.floor((a - i) / L);
631
+ n(e) === r ? i = e : a = e;
632
+ }
633
+ return a;
613
634
  }
614
635
  // packages/charts/src/plot/plot-layout.ts
615
- var Ve = {
636
+ var He = {
616
637
  compact: 160,
617
638
  regular: 260,
618
639
  tall: 380
619
- }, H = 7, He = 12, Ue = 44, We = 20, Ge = 28, Ke = 24, qe = 12, Je = 20, U = .4, Ye = .5, Xe = 2, Ze = 3, Qe = 120, $e = 6, et = .4, tt = Array.from({ length: 4 }, (e, t) => t + 1), W = 10, G = 96, K = 56, nt = 3, rt = .2, it = 16, at = 14, ot = "\n", st = {
640
+ }, H = 7, Ue = 12, We = 44, Ge = 20, Ke = 28, qe = 24, Je = 12, Ye = 20, U = .4, Xe = .5, Ze = 2, Qe = 3, $e = 120, et = 6, tt = .4, nt = Array.from({ length: 4 }, (e, t) => t + 1), W = 10, G = 96, K = 56, rt = 3, it = .2, at = 16, ot = 14, st = "\n", ct = {
620
641
  linear: void 0,
621
642
  log: "log scale",
622
643
  symlog: "symmetric log scale"
623
644
  };
624
- function ct(e) {
625
- let t = st[e.scale ?? "linear"];
645
+ function lt(e) {
646
+ let t = ct[e.scale ?? "linear"];
626
647
  return t === void 0 ? e.label : `${e.label} (${t})`;
627
648
  }
628
- function lt({ values: e, isZeroBased: t = !1, scale: n = "linear" }) {
649
+ function ut({ values: e, isZeroBased: t = !1, scale: n = "linear" }) {
629
650
  let r = e.flatMap((e) => e !== null && Number.isFinite(e) ? [e] : []), i = t && n !== "log" ? [...r, 0] : r;
630
651
  if (i.length === 0) return n === "log" ? [1, W] : [0, 1];
631
652
  let a = Math.min(...i), o = Math.max(...i);
@@ -635,16 +656,16 @@ function lt({ values: e, isZeroBased: t = !1, scale: n = "linear" }) {
635
656
  }
636
657
  if (a === o) return [a - 1, o + 1];
637
658
  if (n === "symlog") return [a, o];
638
- let [s, c] = R([a, o], nt), l = s === void 0 || c === void 0 ? o - a : c - s;
659
+ let [s, c] = R([a, o], rt), l = s === void 0 || c === void 0 ? o - a : c - s;
639
660
  return [Math.floor(a / l) * l, Math.ceil(o / l) * l];
640
661
  }
641
662
  function q({ width: e, valueLabels: t, hasXTitle: n, hasYTitle: r, leftShare: i = U }) {
642
- let a = Math.max(0, ...t.map((e) => e.length)) * H + He + (r ? Ge : 0);
663
+ let a = Math.max(0, ...t.map((e) => e.length)) * H + Ue + (r ? Ke : 0);
643
664
  return {
644
- top: qe,
645
- right: Je,
646
- bottom: Ke + (n ? We : 0),
647
- left: Math.min(Math.max(Ue, a), e * i)
665
+ top: Je,
666
+ right: Ye,
667
+ bottom: qe + (n ? Ge : 0),
668
+ left: Math.min(Math.max(We, a), e * i)
648
669
  };
649
670
  }
650
671
  function J({ width: e, height: t, margins: n }) {
@@ -660,10 +681,10 @@ function J({ width: e, height: t, margins: n }) {
660
681
  innerHeight: i - n.top
661
682
  };
662
683
  }
663
- function ut(e) {
684
+ function dt(e) {
664
685
  return new Set(e).size === e.length;
665
686
  }
666
- function Y(e, t) {
687
+ function ft(e, t) {
667
688
  return {
668
689
  ...e,
669
690
  minimumSignificantDigits: void 0,
@@ -672,7 +693,7 @@ function Y(e, t) {
672
693
  maximumFractionDigits: Math.max(e.maximumFractionDigits ?? 0, t)
673
694
  };
674
695
  }
675
- function dt(e, t) {
696
+ function pt(e, t) {
676
697
  return !t || typeof e == "function" || e.style !== "unit" ? e : {
677
698
  ...e,
678
699
  style: "decimal",
@@ -680,36 +701,36 @@ function dt(e, t) {
680
701
  unitDisplay: void 0
681
702
  };
682
703
  }
683
- function X({ values: e, axis: t, locale: n, hasTitle: r }) {
684
- let i = dt(t.tickFormat ?? o(t.format), r), a = dt(t.format, r), s = (typeof i == "function" ? [i] : [
704
+ function Y({ values: e, axis: t, locale: n, hasTitle: r }) {
705
+ let i = pt(t.tickFormat ?? o(t.format), r), a = pt(t.format, r), s = (typeof i == "function" ? [i] : [
685
706
  i,
686
- ...tt.map((e) => Y(i, e)),
687
- ...typeof a == "function" ? [] : tt.map((e) => Y(a, e))
707
+ ...nt.map((e) => ft(i, e)),
708
+ ...typeof a == "function" ? [] : nt.map((e) => ft(a, e))
688
709
  ]).map((t) => e.map((e) => c({
689
710
  value: e,
690
711
  locale: n,
691
712
  format: t
692
713
  })));
693
- return s.find(ut) ?? s.at(-1) ?? [];
714
+ return s.find(dt) ?? s.at(-1) ?? [];
694
715
  }
695
- function Z(e) {
696
- return e > Qe ? Ze : Xe;
716
+ function X(e) {
717
+ return e > $e ? Qe : Ze;
697
718
  }
698
- function ft(e) {
719
+ function mt(e) {
699
720
  let t = e.tickFormat ?? e.format;
700
721
  return typeof t == "function" || e.scale === "log" ? !1 : t.maximumFractionDigits === 0 && t.style !== "percent";
701
722
  }
702
- function Q({ axis: e, domain: t, length: n, spacing: r, locale: i, hasTitle: a }) {
703
- let o = Z(n), s = Math.max(o, Math.round(n / r)), c = Array.from({ length: $e }, (n, r) => Le({
723
+ function Z({ axis: e, domain: t, length: n, spacing: r, locale: i, hasTitle: a }) {
724
+ let o = X(n), s = Math.max(o, Math.round(n / r)), c = Array.from({ length: et }, (n, r) => Le({
704
725
  domain: t,
705
726
  type: e.scale,
706
727
  count: s + r
707
- })).filter((e, t) => t === 0 || e.length * r * et <= n), l = c.filter((e) => e.length >= o), u = l.find((e) => e[0] === t[0] && e.at(-1) === t[1]), d = l[0] ?? c[0] ?? [], f = u ?? d;
708
- if (ft(e)) {
709
- let t = f.filter((e) => Number.isInteger(e)), n = t.length >= Xe ? t : f;
728
+ })).filter((e, t) => t === 0 || e.length * r * tt <= n), l = c.filter((e) => e.length >= o), u = l.find((e) => e[0] === t[0] && e.at(-1) === t[1]), d = l[0] ?? c[0] ?? [], f = u ?? d;
729
+ if (mt(e)) {
730
+ let t = f.filter((e) => Number.isInteger(e)), n = t.length >= Ze ? t : f;
710
731
  return {
711
732
  values: n,
712
- labels: X({
733
+ labels: Y({
713
734
  values: n,
714
735
  axis: e,
715
736
  locale: i,
@@ -719,7 +740,7 @@ function Q({ axis: e, domain: t, length: n, spacing: r, locale: i, hasTitle: a }
719
740
  }
720
741
  return {
721
742
  values: f,
722
- labels: X({
743
+ labels: Y({
723
744
  values: f,
724
745
  axis: e,
725
746
  locale: i,
@@ -727,24 +748,24 @@ function Q({ axis: e, domain: t, length: n, spacing: r, locale: i, hasTitle: a }
727
748
  })
728
749
  };
729
750
  }
730
- function $(e, t) {
751
+ function Q(e, t) {
731
752
  return t.values.map((n, r) => ({
732
753
  key: String(n),
733
754
  position: e.position(n),
734
755
  label: t.labels[r] ?? ""
735
756
  }));
736
757
  }
737
- function pt(e) {
758
+ function ht(e) {
738
759
  let t = e.split(" ");
739
760
  return t.slice(1).map((e, n) => {
740
761
  let r = t.slice(0, n + 1).join(" "), i = t.slice(n + 1).join(" ");
741
762
  return {
742
- text: `${r}${ot}${i}`,
763
+ text: `${r}${st}${i}`,
743
764
  longest: Math.max(r.length, i.length)
744
765
  };
745
766
  }).toSorted((e, t) => e.longest - t.longest)[0]?.text ?? e;
746
767
  }
747
- function mt(e, t) {
768
+ function gt(e, t) {
748
769
  return t.flatMap((t) => {
749
770
  let n = e.center(t.id);
750
771
  return n === void 0 ? [] : [{
@@ -754,8 +775,8 @@ function mt(e, t) {
754
775
  }];
755
776
  });
756
777
  }
757
- function ht({ width: e, height: t, x: n, y: r, xDomain: i, yDomain: a, locale: o, rightGutter: s = 0 }) {
758
- let c = Q({
778
+ function _t({ width: e, height: t, x: n, y: r, xDomain: i, yDomain: a, locale: o, rightGutter: s = 0 }) {
779
+ let c = Z({
759
780
  axis: r,
760
781
  domain: a,
761
782
  length: t,
@@ -774,7 +795,7 @@ function ht({ width: e, height: t, x: n, y: r, xDomain: i, yDomain: a, locale: o
774
795
  ...u,
775
796
  right: u.right + s
776
797
  }
777
- }), f = Q({
798
+ }), f = Z({
778
799
  axis: n,
779
800
  domain: i,
780
801
  length: d.innerWidth,
@@ -794,12 +815,12 @@ function ht({ width: e, height: t, x: n, y: r, xDomain: i, yDomain: a, locale: o
794
815
  box: d,
795
816
  x: p,
796
817
  y: m,
797
- xTicks: $(p, f),
798
- yTicks: $(m, c)
818
+ xTicks: Q(p, f),
819
+ yTicks: Q(m, c)
799
820
  };
800
821
  }
801
- function gt({ width: e, height: t, direction: n, categories: r, value: i, valueDomain: a, locale: o, padding: s = rt, topInset: c = 0, rightGutter: d = 0, hasValueTitle: f = !0 }) {
802
- let p = r.map((e) => e.id), m = n === "columns", h = Q({
822
+ function vt({ width: e, height: t, direction: n, categories: r, value: i, valueDomain: a, locale: o, padding: s = it, topInset: c = 0, rightGutter: d = 0, hasValueTitle: f = !0 }) {
823
+ let p = r.map((e) => e.id), m = n === "columns", h = Z({
803
824
  axis: i,
804
825
  domain: a,
805
826
  length: m ? t : e,
@@ -811,7 +832,7 @@ function gt({ width: e, height: t, direction: n, categories: r, value: i, valueD
811
832
  valueLabels: m ? h.labels : r.map((e) => e.label),
812
833
  hasXTitle: !m && f,
813
834
  hasYTitle: m && f,
814
- leftShare: m ? U : Ye
835
+ leftShare: m ? U : Xe
815
836
  }), _ = {
816
837
  ...g,
817
838
  top: g.top + c,
@@ -824,15 +845,15 @@ function gt({ width: e, height: t, direction: n, categories: r, value: i, valueD
824
845
  ids: p,
825
846
  range: [v.left, v.right],
826
847
  padding: s
827
- }).step - it, ee = r.some((e) => e.label.length * H > y), b = r.map((e) => ({
848
+ }).step - at, ee = r.some((e) => e.label.length * H > y), b = r.map((e) => ({
828
849
  ...e,
829
- label: pt(e.label)
830
- })), x = m && ee && b.every((e) => e.label.split(ot).every((e) => e.length * H <= y)), S = x ? J({
850
+ label: ht(e.label)
851
+ })), x = m && ee && b.every((e) => e.label.split(st).every((e) => e.length * H <= y)), S = x ? J({
831
852
  width: e,
832
853
  height: t,
833
854
  margins: {
834
855
  ..._,
835
- bottom: _.bottom + at
856
+ bottom: _.bottom + ot
836
857
  }
837
858
  }) : v, C = u({
838
859
  ids: p,
@@ -847,14 +868,14 @@ function gt({ width: e, height: t, direction: n, categories: r, value: i, valueD
847
868
  box: S,
848
869
  band: C,
849
870
  value: w,
850
- bandTicks: mt(C, x ? b : r),
851
- valueTicks: $(w, h)
871
+ bandTicks: gt(C, x ? b : r),
872
+ valueTicks: Q(w, h)
852
873
  };
853
874
  }
854
- function _t({ height: e, axes: t, locale: n, hasValueTitle: r = !1 }) {
875
+ function yt({ height: e, axes: t, locale: n, hasValueTitle: r = !1 }) {
855
876
  return q({
856
877
  width: Infinity,
857
- valueLabels: t.flatMap(({ axis: t, domain: i }) => Q({
878
+ valueLabels: t.flatMap(({ axis: t, domain: i }) => Z({
858
879
  axis: t,
859
880
  domain: i,
860
881
  length: e,
@@ -866,8 +887,8 @@ function _t({ height: e, axes: t, locale: n, hasValueTitle: r = !1 }) {
866
887
  hasYTitle: r
867
888
  }).left;
868
889
  }
869
- function vt({ width: e, height: t, value: n, valueDomain: r, timeDomain: i, timeFormat: a, locale: o, topInset: s = 0, gutter: c = 0, hasValueTitle: u = !1 }) {
870
- let d = Q({
890
+ function bt({ width: e, height: t, value: n, valueDomain: r, timeDomain: i, timeFormat: a, locale: o, topInset: s = 0, gutter: c = 0, hasValueTitle: u = !1 }) {
891
+ let d = Z({
871
892
  axis: n,
872
893
  domain: r,
873
894
  length: t,
@@ -899,16 +920,16 @@ function vt({ width: e, height: t, value: n, valueDomain: r, timeDomain: i, time
899
920
  box: m,
900
921
  x: h,
901
922
  y: g,
902
- xTicks: $(h, bt({
923
+ xTicks: Q(h, $({
903
924
  domain: i,
904
925
  length: m.innerWidth,
905
926
  timeFormat: a,
906
927
  locale: o
907
928
  })),
908
- yTicks: $(g, d)
929
+ yTicks: Q(g, d)
909
930
  };
910
931
  }
911
- var yt = [
932
+ var xt = [
912
933
  {
913
934
  month: "short",
914
935
  day: "numeric"
@@ -923,24 +944,53 @@ var yt = [
923
944
  month: "short",
924
945
  day: "numeric",
925
946
  second: "2-digit"
947
+ },
948
+ {
949
+ year: "numeric",
950
+ month: "short",
951
+ day: "numeric",
952
+ second: "2-digit",
953
+ timeZoneName: "shortOffset"
926
954
  }
927
955
  ];
928
- function bt({ domain: e, length: t, timeFormat: n, locale: r, timeZone: i }) {
929
- let o = typeof n == "function" ? i : n.timeZone, c = o === void 0 ? 0 : a(e[0], o), l = Z(t), u = Math.max(l, Math.round(t / G)), d = Array.from({ length: $e }, (t, n) => Be({
930
- domain: e,
931
- count: u + n,
932
- zoneOffset: c
933
- })), f = d.find((e) => e.length >= l) ?? d[0] ?? [], p = (typeof n == "function" ? [n] : [n, ...yt.map((e) => ({
934
- ...e,
935
- ...n
936
- }))]).map((e) => f.map((t) => s({
937
- timestamp: t,
938
- locale: r,
939
- format: e
940
- })));
956
+ function $({ domain: e, length: t, timeFormat: n, locale: r, timeZone: i }) {
957
+ let o = typeof n == "function" ? i : n.timeZone, c = o === void 0 ? 0 : (e) => a(e, o), l = X(t), u = Math.max(l, Math.round(t / G));
958
+ function d(t) {
959
+ return Be({
960
+ domain: e,
961
+ count: t,
962
+ zoneOffset: c
963
+ });
964
+ }
965
+ function f() {
966
+ let e = d(u);
967
+ if (e.length >= l) return e;
968
+ let t = Array.from({ length: 5 }, (e, t) => u + t + 1);
969
+ for (let e of t) {
970
+ let t = d(e);
971
+ if (t.length >= l) return t;
972
+ }
973
+ return e;
974
+ }
975
+ let p = f();
976
+ function m(e) {
977
+ return p.map((t) => s({
978
+ timestamp: t,
979
+ locale: r,
980
+ format: e
981
+ }));
982
+ }
983
+ let h = m(n);
984
+ if (typeof n != "function" && n.dateStyle === void 0 && n.timeStyle === void 0) for (let e of xt) {
985
+ if (dt(h)) break;
986
+ h = m({
987
+ ...e,
988
+ ...n
989
+ });
990
+ }
941
991
  return {
942
- values: f,
943
- labels: p.find(ut) ?? p.at(-1) ?? []
992
+ values: p,
993
+ labels: h
944
994
  };
945
995
  }
946
- export { he as A, Ce as C, me as D, ue as E, re as M, fe as O, De as S, P as T, Le as _, lt as a, Te as b, Ve as c, Z as d, bt as f, z as g, R as h, gt as i, ge as j, pe as k, q as l, _t as m, ct as n, ht as o, vt as p, mt as r, J as s, Q as t, X as u, Ie as v, we as w, Ee as x, Be as y };
996
+ export { he as A, Ce as C, me as D, de as E, re as M, fe as O, De as S, P as T, Le as _, ut as a, Te as b, He as c, X as d, $ as f, z as g, R as h, vt as i, ge as j, pe as k, q as l, yt as m, lt as n, _t as o, bt as p, gt as r, J as s, Z as t, Y as u, Ie as v, we as w, Ee as x, Be as y };
@@ -1,5 +1,5 @@
1
1
  import { n as e, t } from "./plot-width-D3hTycYX.js";
2
- import { O as n, c as r } from "./plot-layout-CVzSbcU7.js";
2
+ import { O as n, c as r } from "./plot-layout-1MG72ZWn.js";
3
3
  import * as i from "@stylexjs/stylex";
4
4
  import { useId as a } from "react";
5
5
  import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { M as e } from "./plot-layout-CVzSbcU7.js";
1
+ import { M as e } from "./plot-layout-1MG72ZWn.js";
2
2
  import { t } from "./label-spacing-BncjePGb.js";
3
3
  import { n, t as r } from "./label-place-Z0fryBZb.js";
4
4
  import { c as i, f as a } from "./plot-marks-DgCtcd3L.js";
@@ -1,22 +1,22 @@
1
1
  import { i as e } from "./chart-link-AE_xuxiP.js";
2
- import { A as t, D as n, E as r, O as i, S as a, c as o, j as s, l as c, s as l, t as u, u as d } from "./plot-layout-CVzSbcU7.js";
3
- import { i as f, l as p, n as m, r as h, t as g } from "./figure-frame-DlyNTDzh.js";
4
- import { r as _, t as v } from "./plot-surface-CBhI1alw.js";
2
+ import { A as t, D as n, E as r, O as i, S as a, c as o, j as s, l as c, s as l, t as u, u as d } from "./plot-layout-1MG72ZWn.js";
3
+ import { i as f, l as p, n as m, r as h, t as g } from "./figure-frame-96zFqsWz.js";
4
+ import { r as _, t as v } from "./plot-surface-8-FZI94y.js";
5
5
  import { a as y, i as b, r as x } from "./tone-scope-DKiSw-JR.js";
6
- import { _ as S, a as C, g as w, o as T, t as E, u as D } from "./param-CKr8EYxF.js";
6
+ import { _ as S, a as C, g as w, o as T, t as E, u as D } from "./param-Dk92C-K1.js";
7
7
  import { n as O, t as k } from "./clock-DSm5lkNE.js";
8
8
  import { o as A, r as j } from "./scale-C2xgZyZN.js";
9
- import { t as M } from "./use-tween-C1TWJwce.js";
9
+ import { t as M } from "./use-tween-DbXVZBR8.js";
10
10
  import { t as N } from "./chart-tones-ei3BC2AL.js";
11
11
  import { r as P } from "./tokens.stylex-dF5CACEJ.js";
12
- import { r as F } from "./figure-format-B8kRZMlo.js";
12
+ import { r as F } from "./figure-format-BVb7yFCA.js";
13
13
  import { n as I } from "./plot-width-D3hTycYX.js";
14
14
  import { n as L, t as R } from "./label-place-Z0fryBZb.js";
15
15
  import { a as z, c as ee, f as te, n as B, t as V, u as ne } from "./plot-marks-DgCtcd3L.js";
16
16
  import { i as re, r as ie, t as ae } from "./path-BglsXpnO.js";
17
17
  import { t as oe } from "./plot-axes-D5S9BnBa.js";
18
18
  import { t as se } from "./heatmap-scale-Zte6Ya-g.js";
19
- import { d as ce, f as le } from "./token-predictions-Bi7aKPnh.js";
19
+ import { d as ce, f as le } from "./token-predictions-CpGVjOIs.js";
20
20
  import * as H from "@stylexjs/stylex";
21
21
  import { Children as ue, createContext as de, memo as fe, use as pe, useEffect as me, useId as he, useLayoutEffect as U, useMemo as ge, useRef as _e, useState as W, useSyncExternalStore as ve } from "react";
22
22
  import { bindDrag as ye, dragThreshold as be } from "@ui-sdk/core";
package/dist/scene.js CHANGED
@@ -1 +1 @@
1
- export { r as LessonFlow, t as MorphScope, tt as Scene, H as SceneAxes, q as SceneBracket, G as SceneCallout, C as SceneCard, g as SceneCells, L as SceneCurve, U as SceneCustom, i as SceneFlow, J as SceneGroup, W as SceneHighlight, $ as SceneLayer, X as SceneNode, et as SceneOutside, I as ScenePoint, F as SceneProjection, P as SceneRegion, N as SceneRule, b as SceneSlot, x as SceneStack, u as SceneToken, l as SceneTokens, M as SceneVector, Y as SceneWire, w as cardRanks, T as cardSuits, v as cellGap, R as curveResolutions, nt as edgePoint, mt as fillLabel, a as flowNodeSize, s as flowPlan, c as flowPositions, n as morphLabels, rt as nodeBox, it as padRect, V as planeLabels, z as planeLimits, B as planeThicknesses, at as rectCenter, ot as rectsOverlap, E as sceneCardLabels, O as sceneCardSizes, y as sceneCellSizes, _ as sceneCellsLabels, st as sceneCircleSizes, Z as sceneContextColor, o as sceneFlowLabels, ht as sceneLabels, gt as sceneLimits, ct as sceneNodeSizes, Q as sceneOutlines, S as sceneStackLabels, _t as sceneStaggers, vt as sceneStore, d as sceneTokenLabels, lt as sidePoint, k as stackBounds, A as stackGaps, j as stackPlace, D as suitTones, p as tokenBox, m as tokenFlow, h as tokenGaps, f as tokenPercent, ut as unionRect, K as useObstacle, dt as useSceneContext, ft as useSceneFrames, pt as useSceneObject } from "./scene-C3dCxckI.js";
1
+ export { r as LessonFlow, t as MorphScope, tt as Scene, H as SceneAxes, q as SceneBracket, G as SceneCallout, C as SceneCard, g as SceneCells, L as SceneCurve, U as SceneCustom, i as SceneFlow, J as SceneGroup, W as SceneHighlight, $ as SceneLayer, X as SceneNode, et as SceneOutside, I as ScenePoint, F as SceneProjection, P as SceneRegion, N as SceneRule, b as SceneSlot, x as SceneStack, u as SceneToken, l as SceneTokens, M as SceneVector, Y as SceneWire, w as cardRanks, T as cardSuits, v as cellGap, R as curveResolutions, nt as edgePoint, mt as fillLabel, a as flowNodeSize, s as flowPlan, c as flowPositions, n as morphLabels, rt as nodeBox, it as padRect, V as planeLabels, z as planeLimits, B as planeThicknesses, at as rectCenter, ot as rectsOverlap, E as sceneCardLabels, O as sceneCardSizes, y as sceneCellSizes, _ as sceneCellsLabels, st as sceneCircleSizes, Z as sceneContextColor, o as sceneFlowLabels, ht as sceneLabels, gt as sceneLimits, ct as sceneNodeSizes, Q as sceneOutlines, S as sceneStackLabels, _t as sceneStaggers, vt as sceneStore, d as sceneTokenLabels, lt as sidePoint, k as stackBounds, A as stackGaps, j as stackPlace, D as suitTones, p as tokenBox, m as tokenFlow, h as tokenGaps, f as tokenPercent, ut as unionRect, K as useObstacle, dt as useSceneContext, ft as useSceneFrames, pt as useSceneObject } from "./scene-B8dppj5V.js";
@@ -1,18 +1,18 @@
1
1
  import { t as e } from "./accessibility-P89UG9-r.js";
2
- import { A as t, E as n, M as r, S as i, a, j as o, l as s, n as c, o as l, s as u, t as d } from "./plot-layout-CVzSbcU7.js";
2
+ import { A as t, E as n, M as r, S as i, a, j as o, l as s, n as c, o as l, s as u, t as d } from "./plot-layout-1MG72ZWn.js";
3
3
  import { i as f, r as p } from "./chart-link-AE_xuxiP.js";
4
4
  import { a as m } from "./tone-scope-DKiSw-JR.js";
5
- import { r as h, t as g } from "./figure-format-B8kRZMlo.js";
5
+ import { r as h, t as g } from "./figure-format-BVb7yFCA.js";
6
6
  import { a as _, o as v, r as y } from "./scale-C2xgZyZN.js";
7
7
  import { t as b } from "./chart-cursor-1mFd48Jc.js";
8
- import { c as x, i as ee, l as S, n as C, o as w, r as te, t as T } from "./figure-frame-DlyNTDzh.js";
8
+ import { c as x, i as ee, l as S, n as C, o as w, r as te, t as T } from "./figure-frame-96zFqsWz.js";
9
9
  import { n as E } from "./plot-width-D3hTycYX.js";
10
10
  import { t as D } from "./plot-axes-D5S9BnBa.js";
11
11
  import { a as O, c as k, l as A, n as ne, o as re } from "./plot-marks-DgCtcd3L.js";
12
- import { n as ie, r as ae, t as oe } from "./plot-surface-CBhI1alw.js";
12
+ import { n as ie, r as ae, t as oe } from "./plot-surface-8-FZI94y.js";
13
13
  import { t as j } from "./label-spacing-BncjePGb.js";
14
14
  import { n as se, t as ce } from "./label-place-Z0fryBZb.js";
15
- import { t as le } from "./reference-lines-C970JwWZ.js";
15
+ import { t as le } from "./reference-lines-C18o1yEY.js";
16
16
  import { n as ue, r as M, t as de } from "./path-BglsXpnO.js";
17
17
  import { t as fe } from "./locate-Bcg3QcP4.js";
18
18
  import { t as N } from "./heatmap-scale-Zte6Ya-g.js";
package/dist/styles2.css CHANGED
@@ -1904,6 +1904,10 @@
1904
1904
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
1905
1905
  }
1906
1906
 
1907
+ .x1yqo59v {
1908
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
1909
+ }
1910
+
1907
1911
  .xhuszhj {
1908
1912
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
1909
1913
  }
@@ -3667,6 +3671,10 @@
3667
3671
  max-height: 560px;
3668
3672
  }
3669
3673
 
3674
+ .x1jkf3pl {
3675
+ max-height: 60svh;
3676
+ }
3677
+
3670
3678
  .x159tps6 {
3671
3679
  max-height: 640px;
3672
3680
  }
@@ -4408,6 +4416,10 @@
4408
4416
  }
4409
4417
 
4410
4418
  @container scrolly (width >= 640px) {
4419
+ .x1xm96vb.x1xm96vb {
4420
+ max-height: calc(100svh - var(--xz7cmyu));
4421
+ }
4422
+
4411
4423
  .xyvmra8.xyvmra8 {
4412
4424
  min-height: 50vh;
4413
4425
  }