@mechane-ai/elements 0.29.0 → 0.31.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 (45) hide show
  1. package/README.md +6 -0
  2. package/dist/ai.js +250 -172
  3. package/dist/{categorical-values-Dfe3nkBV.js → categorical-values-Cfn6nwHi.js} +2 -2
  4. package/dist/{chart-frame-rL7_RAIc.js → chart-frame-C8JU2tlM.js} +9 -9
  5. package/dist/{chart-input-JIyGPusK.js → chart-input-D0hBpH1r.js} +2 -2
  6. package/dist/charts/cartesian.js +6 -6
  7. package/dist/charts/distribution.js +2 -2
  8. package/dist/charts/graph.js +2 -2
  9. package/dist/charts/hierarchy.js +3 -3
  10. package/dist/charts/matrix.js +2 -2
  11. package/dist/charts/timeline.js +3 -3
  12. package/dist/charts.js +1 -1
  13. package/dist/{code-block-DPeyW4sm.js → code-block-DlzYynjv.js} +21 -20
  14. package/dist/collections.js +224 -211
  15. package/dist/content/code.js +1 -1
  16. package/dist/content/diff.js +4 -4
  17. package/dist/content/link.js +1 -1
  18. package/dist/content/markdown.js +3 -3
  19. package/dist/content/tree.js +3 -3
  20. package/dist/{content-link-5oRGjDHa.js → content-link-Dh1hon1m.js} +1 -1
  21. package/dist/content.js +1 -394
  22. package/dist/elements.css +41 -23
  23. package/dist/feedback.js +1 -1
  24. package/dist/forms/dates.js +1 -1
  25. package/dist/forms.js +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/layout.js +392 -318
  28. package/dist/navigation/commands.js +1 -1
  29. package/dist/packages/ai/src/command-activity.d.ts +7 -0
  30. package/dist/packages/ai/src/command-details.d.ts +10 -0
  31. package/dist/packages/ai/src/index.d.ts +4 -0
  32. package/dist/packages/content/src/code/code-block.d.ts +2 -1
  33. package/dist/packages/content/src/log-viewer.d.ts +2 -1
  34. package/dist/packages/content/src/viewer-styles.d.ts +8 -0
  35. package/dist/packages/foundations/src/control-styles.d.ts +3 -0
  36. package/dist/packages/foundations/src/header-styles.d.ts +47 -0
  37. package/dist/packages/layout/src/frame.stylex.d.ts +0 -2
  38. package/dist/{pierre-diff-C3U_qae6.js → pierre-diff-DOkqEUqx.js} +1 -1
  39. package/dist/{pierre-tree-D2kRr4h4.js → pierre-tree-tdFSl55t.js} +2 -2
  40. package/dist/{src-BfPaaDxg.js → src-Bb2fDOeE.js} +105 -105
  41. package/dist/src-CVleZrPa.js +395 -0
  42. package/dist/{src-eWcNz_oB.js → src-DvLYUTID.js} +14 -14
  43. package/dist/{src-E3Or8tkO.js → src-SE6QORrJ.js} +347 -290
  44. package/dist/{viewer-styles-CpHqp5Qv.js → viewer-styles-DsFYri4K.js} +10 -0
  45. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { n as e, s as t } from "./chart-frame-rL7_RAIc.js";
2
- import { n } from "./chart-input-JIyGPusK.js";
1
+ import { n as e, s as t } from "./chart-frame-C8JU2tlM.js";
2
+ import { n } from "./chart-input-D0hBpH1r.js";
3
3
  import * as r from "@stylexjs/stylex";
4
4
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  // packages/charts/src/categorical-values.tsx
@@ -1,6 +1,6 @@
1
- import { _ as e, l as t } from "./src-E3Or8tkO.js";
1
+ import { l as e, v as t } from "./src-SE6QORrJ.js";
2
2
  import { t as n } from "./use-scroll-tab-index-Dxpdh4W7.js";
3
- import { d as r, m as i } from "./src-eWcNz_oB.js";
3
+ import { d as r, m as i } from "./src-DvLYUTID.js";
4
4
  import { n as a, r as o } from "./tokens.stylex-BoRZ3D8s.js";
5
5
  import * as s from "@stylexjs/stylex";
6
6
  import { useId as c } from "react";
@@ -116,7 +116,7 @@ var g = {
116
116
  },
117
117
  { "--x-backgroundColor": e ?? void 0 }
118
118
  ] };
119
- function v({ title: e, description: n, children: r, actions: i, footer: a, report: o, series: s = [] }) {
119
+ function v({ title: t, description: n, children: r, actions: i, footer: a, report: o, series: s = [] }) {
120
120
  let d = c();
121
121
  if (o !== void 0) {
122
122
  let c = o.seriesValues === void 0 ? o.summary : /* @__PURE__ */ l(h, {
@@ -126,9 +126,9 @@ function v({ title: e, description: n, children: r, actions: i, footer: a, repor
126
126
  return /* @__PURE__ */ u("figure", {
127
127
  "aria-labelledby": d,
128
128
  className: "xeuugli x1ghz6dp xbixft xpvm0e4 x1hz01jw xtqrqnz xj57cvi x1778rvt xmkeg23 x1y0btm7 x1ey3b81",
129
- children: [/* @__PURE__ */ l("figcaption", { children: /* @__PURE__ */ l(t, {
129
+ children: [/* @__PURE__ */ l("figcaption", { children: /* @__PURE__ */ l(e, {
130
130
  id: d,
131
- title: e,
131
+ title: t,
132
132
  meta: o.meta,
133
133
  actions: i
134
134
  }) }), /* @__PURE__ */ u("div", {
@@ -162,7 +162,7 @@ function v({ title: e, description: n, children: r, actions: i, footer: a, repor
162
162
  children: [/* @__PURE__ */ l("p", {
163
163
  id: d,
164
164
  className: "x1ghz6dp x12myhf4 x1778rvt xk4h15q",
165
- children: e
165
+ children: t
166
166
  }), n !== void 0 && /* @__PURE__ */ l("p", {
167
167
  className: "x1ghz6dp x1c87qhr x153jb6y xy8obcc xas2l8k",
168
168
  children: n
@@ -222,17 +222,17 @@ function x({ children: e }) {
222
222
  children: e
223
223
  });
224
224
  }
225
- function S({ children: t, label: r = "View data" }) {
225
+ function S({ children: e, label: r = "View data" }) {
226
226
  let i = n();
227
227
  return /* @__PURE__ */ l("div", {
228
228
  className: "x1xxf3xd x178xt8z x13fuv20 xhjagg4",
229
- children: /* @__PURE__ */ u(e.Root, { children: [/* @__PURE__ */ l(e.Trigger, { children: r }), /* @__PURE__ */ l(e.Panel, { children: /* @__PURE__ */ l("div", {
229
+ children: /* @__PURE__ */ u(t.Root, { children: [/* @__PURE__ */ l(t.Trigger, { children: r }), /* @__PURE__ */ l(t.Panel, { children: /* @__PURE__ */ l("div", {
230
230
  ref: i.ref,
231
231
  role: "region",
232
232
  "aria-label": r,
233
233
  tabIndex: i.tabIndex,
234
234
  className: "xeuugli x1sslpiy xysyzu8 x1t137rt x19rmrnh x9v5kkp x13qnu6 x1bqaal",
235
- children: t
235
+ children: e
236
236
  }) })] })
237
237
  });
238
238
  }
@@ -1,5 +1,5 @@
1
- import { m as e } from "./src-eWcNz_oB.js";
2
- import { r as t } from "./chart-frame-rL7_RAIc.js";
1
+ import { m as e } from "./src-DvLYUTID.js";
2
+ import { r as t } from "./chart-frame-C8JU2tlM.js";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
4
  // packages/charts/src/chart-input.tsx
5
5
  function r(e) {
@@ -1,13 +1,13 @@
1
- import { d as e, u as t } from "../src-eWcNz_oB.js";
2
- import { i as n, n as r, r as i, t as a } from "../categorical-values-Dfe3nkBV.js";
3
- import { D as o } from "../src-E3Or8tkO.js";
1
+ import { d as e, u as t } from "../src-DvLYUTID.js";
2
+ import { i as n, n as r, r as i, t as a } from "../categorical-values-Cfn6nwHi.js";
3
+ import { O as o } from "../src-SE6QORrJ.js";
4
4
  import { t as s } from "../use-scroll-tab-index-Dxpdh4W7.js";
5
5
  import { s as c } from "../src-d7EAi61b.js";
6
- import { a as l, n as u, o as d, r as f, s as p, t as m } from "../chart-frame-rL7_RAIc.js";
7
- import { n as h, r as g, t as _ } from "../chart-input-JIyGPusK.js";
6
+ import { a as l, n as u, o as d, r as f, s as p, t as m } from "../chart-frame-C8JU2tlM.js";
7
+ import { n as h, r as g, t as _ } from "../chart-input-D0hBpH1r.js";
8
8
  import { r as v } from "../tokens.stylex-BoRZ3D8s.js";
9
9
  import { t as y } from "../plot-width--OgdohB5.js";
10
- import { g as b } from "../src-BfPaaDxg.js";
10
+ import { g as b } from "../src-Bb2fDOeE.js";
11
11
  import * as x from "@stylexjs/stylex";
12
12
  import { useEffect as ee, useId as S, useMemo as te, useRef as ne, useState as C } from "react";
13
13
  import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
@@ -1,5 +1,5 @@
1
- import { a as e, n as t, r as n, s as r, t as i } from "../chart-frame-rL7_RAIc.js";
2
- import { n as a, r as o, t as s } from "../chart-input-JIyGPusK.js";
1
+ import { a as e, n as t, r as n, s as r, t as i } from "../chart-frame-C8JU2tlM.js";
2
+ import { n as a, r as o, t as s } from "../chart-input-D0hBpH1r.js";
3
3
  import { t as c } from "../plot-width--OgdohB5.js";
4
4
  import * as l from "@stylexjs/stylex";
5
5
  import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "../use-scroll-tab-index-Dxpdh4W7.js";
2
- import { a as t, n, r, s as i, t as a } from "../chart-frame-rL7_RAIc.js";
3
- import { n as o, t as s } from "../chart-input-JIyGPusK.js";
2
+ import { a as t, n, r, s as i, t as a } from "../chart-frame-C8JU2tlM.js";
3
+ import { n as o, t as s } from "../chart-input-D0hBpH1r.js";
4
4
  import * as c from "@stylexjs/stylex";
5
5
  import { useId as l } from "react";
6
6
  import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
- import { i as e, r as t, t as n } from "../categorical-values-Dfe3nkBV.js";
2
- import { o as r, r as i, s as a } from "../chart-frame-rL7_RAIc.js";
3
- import { t as o } from "../chart-input-JIyGPusK.js";
1
+ import { i as e, r as t, t as n } from "../categorical-values-Cfn6nwHi.js";
2
+ import { o as r, r as i, s as a } from "../chart-frame-C8JU2tlM.js";
3
+ import { t as o } from "../chart-input-D0hBpH1r.js";
4
4
  import { t as s } from "../plot-width--OgdohB5.js";
5
5
  import * as c from "@stylexjs/stylex";
6
6
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
1
  import { r as e } from "../tokens.stylex-BoRZ3D8s.js";
2
- import { n as t, r as n, t as r } from "../chart-input-JIyGPusK.js";
3
- import { a as i, n as a, r as o, s, t as c } from "../chart-frame-rL7_RAIc.js";
2
+ import { n as t, r as n, t as r } from "../chart-input-D0hBpH1r.js";
3
+ import { a as i, n as a, r as o, s, t as c } from "../chart-frame-C8JU2tlM.js";
4
4
  import { t as l } from "../use-scroll-tab-index-Dxpdh4W7.js";
5
5
  import * as u from "@stylexjs/stylex";
6
6
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
- import { c as e } from "../src-E3Or8tkO.js";
2
- import { r as t } from "../chart-frame-rL7_RAIc.js";
3
- import { n, t as r } from "../chart-input-JIyGPusK.js";
1
+ import { c as e } from "../src-SE6QORrJ.js";
2
+ import { r as t } from "../chart-frame-C8JU2tlM.js";
3
+ import { n, t as r } from "../chart-input-D0hBpH1r.js";
4
4
  import * as i from "@stylexjs/stylex";
5
5
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
6
  import { scaleLinear as s } from "@visx/scale";
package/dist/charts.js CHANGED
@@ -1 +1 @@
1
- export { r as ChartFrame, i as ChartLegend, s as chartToneColors } from "./chart-frame-rL7_RAIc.js";
1
+ export { r as ChartFrame, i as ChartLegend, s as chartToneColors } from "./chart-frame-C8JU2tlM.js";
@@ -1,7 +1,7 @@
1
- import { v as e } from "./src-E3Or8tkO.js";
1
+ import { y as e } from "./src-SE6QORrJ.js";
2
2
  import { r as t } from "./tokens.stylex-BoRZ3D8s.js";
3
3
  import { t as n } from "./use-scroll-tab-index-Dxpdh4W7.js";
4
- import { t as r } from "./viewer-styles-CpHqp5Qv.js";
4
+ import { t as r } from "./viewer-styles-DsFYri4K.js";
5
5
  import { t as i } from "./pierre-theme-DsrSwl5m.js";
6
6
  import * as a from "@stylexjs/stylex";
7
7
  import { useEffect as o, useRef as s, useState as c } from "react";
@@ -104,47 +104,48 @@ function _({ token: e }) {
104
104
  children: e.content
105
105
  });
106
106
  }
107
- function v({ code: t, language: i = "text", filename: o, isStreaming: s = !1, shouldWrap: c = !1, showLineNumbers: d = !0, selectedLines: f, annotations: m = [], maxHeight: v = 400, maxLines: y = 2e3 }) {
108
- let b = p(t, i), x = n(), S = t.slice(0, g).split(/\r\n|\n|\r/u), C = S.slice(0, Math.max(1, y)).map((e, t) => ({
107
+ function v({ code: t, variant: i = "default", language: o = "text", filename: s, isStreaming: c = !1, shouldWrap: d = !1, showLineNumbers: f = !0, selectedLines: m, annotations: v = [], maxHeight: y = 400, maxLines: b = 2e3 }) {
108
+ let x = p(t, o), S = n(), C = t.slice(0, g).split(/\r\n|\n|\r/u), w = C.slice(0, Math.max(1, b)).map((e, t) => ({
109
109
  text: e,
110
110
  line: t + 1
111
- })), w = o ?? i;
111
+ })), T = s ?? o, E = i === "embedded";
112
112
  return /* @__PURE__ */ u("section", {
113
- "aria-label": o ?? "Code",
114
- ...a.props(r.root),
113
+ "aria-label": s ?? "Code",
114
+ ...a.props(r.root, E && r.embedded),
115
115
  children: [
116
116
  /* @__PURE__ */ u("div", {
117
- ...a.props(r.header),
117
+ ...a.props(r.header, E && r.embeddedHeader),
118
118
  children: [/* @__PURE__ */ u("span", {
119
119
  ...a.props(r.label),
120
- children: [w, s && " · streaming"]
120
+ children: [T, c && !E && " · streaming"]
121
121
  }), /* @__PURE__ */ l(e, {
122
- label: o ?? "code",
122
+ label: s ?? "code",
123
123
  value: t,
124
+ display: E ? "icon" : "value",
124
125
  children: "Copy"
125
126
  })]
126
127
  }),
127
128
  /* @__PURE__ */ l("div", {
128
- ref: x.ref,
129
+ ref: S.ref,
129
130
  role: "region",
130
- "aria-label": `${w} source`,
131
- tabIndex: x.tabIndex,
132
- ...a.props(r.scrollRegion, h.viewport(v)),
131
+ "aria-label": `${T} source`,
132
+ tabIndex: S.tabIndex,
133
+ ...a.props(r.scrollRegion, h.viewport(y)),
133
134
  children: /* @__PURE__ */ l("pre", {
134
135
  ...{
135
136
  0: { className: "x1ghz6dp xn9t2bk xiard35 xy8obcc x1778rvt xeq4nuv xk8lq53" },
136
137
  1: { className: "x1ghz6dp xn9t2bk xiard35 xy8obcc x1778rvt xeq4nuv xeuugli x126k92a xj0a0fe" }
137
- }[!!c | 0],
138
+ }[!!d | 0],
138
139
  children: /* @__PURE__ */ l("code", {
139
140
  className: "xjb2p0i",
140
- children: C.map(({ text: e, line: t }) => {
141
- let n = b === void 0 ? void 0 : b.lines[t - 1], r = f !== void 0 && t >= f.start && t <= (f.end ?? f.start), i = m.find((e) => e.line === t);
141
+ children: w.map(({ text: e, line: t }) => {
142
+ let n = x === void 0 ? void 0 : x.lines[t - 1], r = m !== void 0 && t >= m.start && t <= (m.end ?? m.start), i = v.find((e) => e.line === t);
142
143
  return /* @__PURE__ */ u("span", { children: [/* @__PURE__ */ u("span", {
143
144
  ...{
144
145
  0: { className: "x78zum5 x16exltd" },
145
146
  1: { className: "x78zum5 x16exltd x1r8u7ye" }
146
147
  }[!!r | 0],
147
- children: [d && /* @__PURE__ */ l("span", {
148
+ children: [f && /* @__PURE__ */ l("span", {
148
149
  "aria-hidden": !0,
149
150
  className: "x1rg5ohu x2lah0s xl3ry0p x5g2kb4 xp4054r x153jb6y x87ps6o",
150
151
  children: t
@@ -160,7 +161,7 @@ function v({ code: t, language: i = "text", filename: o, isStreaming: s = !1, sh
160
161
  })
161
162
  })
162
163
  }),
163
- S.length > C.length && /* @__PURE__ */ l("div", {
164
+ C.length > w.length && /* @__PURE__ */ l("div", {
164
165
  ...a.props(r.note),
165
166
  children: "Additional lines omitted. Copy includes the complete source."
166
167
  }),
@@ -172,7 +173,7 @@ function v({ code: t, language: i = "text", filename: o, isStreaming: s = !1, sh
172
173
  ...a.props(r.note),
173
174
  children: "No source text."
174
175
  }),
175
- b !== void 0 && b.hasFailed && /* @__PURE__ */ l("div", {
176
+ x !== void 0 && x.hasFailed && /* @__PURE__ */ l("div", {
176
177
  ...a.props(r.note),
177
178
  children: "Syntax highlighting unavailable. The source is shown unchanged."
178
179
  })