@mechane-ai/elements 0.44.0 → 0.46.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 (117) hide show
  1. package/README.md +48 -18
  2. package/bin/mechane-elements-catalog.mjs +42 -4
  3. package/dist/ai.js +268 -202
  4. package/dist/catalog.json +95 -31
  5. package/dist/categorical-values-BXi-rJuv.js +74 -0
  6. package/dist/chart-cursor-1mFd48Jc.js +23 -0
  7. package/dist/chart-data-CIJVWCYt.js +21 -0
  8. package/dist/chart-frame-BaxKn_MB.js +236 -0
  9. package/dist/{chart-input-B6_HXFDP.js → chart-input-Bm82_9Rd.js} +2 -2
  10. package/dist/chart-theme-4zprJ3rW.js +404 -0
  11. package/dist/charts/cartesian.js +1624 -1442
  12. package/dist/charts/distribution.js +486 -409
  13. package/dist/charts/graph.js +383 -358
  14. package/dist/charts/hierarchy.js +103 -94
  15. package/dist/charts/matrix.js +340 -333
  16. package/dist/charts/timeline.js +167 -134
  17. package/dist/charts.js +3 -3
  18. package/dist/{code-block-Cpfr7B6a.js → code-block-DioAM2bZ.js} +67 -52
  19. package/dist/collections.js +1648 -1188
  20. package/dist/{constants.stylex-CaVa9yGN.js → constants.stylex-CqhVl0uU.js} +9 -9
  21. package/dist/content/code.js +1 -1
  22. package/dist/content/diff.js +67 -66
  23. package/dist/content/link.js +1 -1
  24. package/dist/content/markdown.js +2 -2
  25. package/dist/content/tree.js +3 -3
  26. package/dist/{content-link-CGeFFb9F.js → content-link-NWuHp5rC.js} +1 -1
  27. package/dist/content.js +1 -1
  28. package/dist/csp.js +6 -11
  29. package/dist/feedback.js +1 -1
  30. package/dist/forms/dates.js +274 -214
  31. package/dist/{forms-DeU0Tiv3.js → forms-CEbwzlRR.js} +50 -41
  32. package/dist/forms.js +3 -3
  33. package/dist/index.js +1 -1
  34. package/dist/layout.js +207 -207
  35. package/dist/navigation.js +4 -3
  36. package/dist/packages/ai/src/conversation.d.ts +2 -0
  37. package/dist/packages/ai/src/prompt-input.d.ts +7 -2
  38. package/dist/packages/charts/src/cartesian/composition-bars.d.ts +2 -2
  39. package/dist/packages/charts/src/cartesian/index.d.ts +3 -2
  40. package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +8 -2
  41. package/dist/packages/charts/src/cartesian/time-series.d.ts +11 -1
  42. package/dist/packages/charts/src/categorical-values.d.ts +14 -9
  43. package/dist/packages/charts/src/chart-frame.d.ts +7 -9
  44. package/dist/packages/charts/src/chart-inspection.d.ts +1 -2
  45. package/dist/packages/charts/src/chart-range.d.ts +33 -0
  46. package/dist/packages/charts/src/chart-rows.d.ts +20 -0
  47. package/dist/packages/charts/src/chart-theme.d.ts +25 -1
  48. package/dist/packages/charts/src/chart.d.ts +81 -0
  49. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +6 -4
  50. package/dist/packages/charts/src/index.d.ts +2 -1
  51. package/dist/packages/charts/src/matrix/matrix-strip.d.ts +3 -3
  52. package/dist/packages/charts/src/plot-width.d.ts +0 -1
  53. package/dist/packages/charts/src/timeline/index.d.ts +1 -1
  54. package/dist/packages/charts/src/timeline/waterfall.d.ts +6 -2
  55. package/dist/packages/collections/src/collection-controls.d.ts +5 -1
  56. package/dist/packages/collections/src/collection-filters.d.ts +4 -1
  57. package/dist/packages/collections/src/control-toolbar.d.ts +13 -0
  58. package/dist/packages/collections/src/data-table-layout.d.ts +78 -0
  59. package/dist/packages/collections/src/data-table-rows.d.ts +54 -0
  60. package/dist/packages/collections/src/data-table-styles.d.ts +340 -0
  61. package/dist/packages/collections/src/data-table-text.d.ts +13 -0
  62. package/dist/packages/collections/src/data-table-trigger.d.ts +23 -0
  63. package/dist/packages/collections/src/data-table.d.ts +3 -85
  64. package/dist/packages/collections/src/index.d.ts +11 -6
  65. package/dist/packages/collections/src/query-controls.d.ts +6 -2
  66. package/dist/packages/collections/src/table-results.d.ts +47 -13
  67. package/dist/packages/collections/src/timeline.d.ts +1 -0
  68. package/dist/packages/collections/src/use-collection-controls.d.ts +2 -1
  69. package/dist/packages/collections/src/use-table-window.d.ts +25 -0
  70. package/dist/packages/content/src/viewer.d.ts +8 -0
  71. package/dist/packages/core/src/disclosure.d.ts +9 -1
  72. package/dist/packages/core/src/index.d.ts +1 -0
  73. package/dist/packages/core/src/route-link.d.ts +11 -0
  74. package/dist/packages/forms/src/dates/date-inputs.d.ts +3 -1
  75. package/dist/packages/forms/src/file-picker.d.ts +15 -0
  76. package/dist/packages/forms/src/form-controls.d.ts +1 -6
  77. package/dist/packages/forms/src/forms.d.ts +4 -1
  78. package/dist/packages/forms/src/index.d.ts +4 -2
  79. package/dist/packages/forms/src/selection.d.ts +14 -0
  80. package/dist/packages/foundations/src/chart-tones.d.ts +5 -0
  81. package/dist/packages/foundations/src/csp/index.d.ts +1 -1
  82. package/dist/packages/foundations/src/csp/provider.d.ts +7 -2
  83. package/dist/packages/navigation/src/index.d.ts +1 -1
  84. package/dist/{pierre-diff-B3tD3-6z.js → pierre-diff-DlvjyuJn.js} +1 -1
  85. package/dist/plot-width-v2c_rA20.js +63 -0
  86. package/dist/{src-gqEebHEa.js → src-1EHkSFS-.js} +395 -274
  87. package/dist/{src-DBNncL7_.js → src-BPTDJqt0.js} +48 -68
  88. package/dist/src-CGc_hjxJ.js +409 -0
  89. package/dist/{src-DcW_gMX8.js → src-CpdJlDhO.js} +480 -362
  90. package/dist/{src-CDp1JtwC.js → src-DVHlknB6.js} +135 -120
  91. package/dist/styles2.css +167 -132
  92. package/dist/tokens.js +1 -1
  93. package/package.json +1 -4
  94. package/packages/foundations/src/constants.stylex.ts +9 -9
  95. package/packages/foundations/src/tokens.stylex.ts +9 -9
  96. package/skills/extend-elements/SKILL.md +74 -0
  97. package/skills/review-elements/SKILL.md +76 -0
  98. package/skills/upgrade-elements/SKILL.md +34 -0
  99. package/skills/upgrade-elements/references/releases.md +58 -0
  100. package/skills/use-elements/SKILL.md +64 -13
  101. package/skills/use-elements/references/agent.md +57 -0
  102. package/skills/use-elements/references/charts.md +63 -0
  103. package/skills/use-elements/references/collections.md +89 -0
  104. package/skills/use-elements/references/conversations.md +47 -0
  105. package/skills/use-elements/references/forms.md +81 -0
  106. package/skills/use-elements/references/reports.md +6 -4
  107. package/skills/use-elements/references/styling.md +70 -0
  108. package/skills/use-elements/references/workspace.md +3 -3
  109. package/dist/categorical-values-ByvFLaNE.js +0 -59
  110. package/dist/chart-frame-Bcd9Tpt5.js +0 -251
  111. package/dist/chart-navigation-BAbb5PV9.js +0 -154
  112. package/dist/header-styles-COxCYFZx.js +0 -90
  113. package/dist/packages/charts/src/chart-navigation.d.ts +0 -39
  114. package/dist/packages/charts/src/chart-surface.d.ts +0 -27
  115. package/dist/packages/navigation/src/route-link.d.ts +0 -2
  116. package/dist/plot-width-8cXdAjoD.js +0 -96
  117. package/dist/src-Bk7M67zy.js +0 -396
@@ -1,90 +0,0 @@
1
- import "@stylexjs/stylex";
2
- // packages/foundations/src/header-styles.ts
3
- var e = {
4
- row: {
5
- kB7OPa: "x9f619",
6
- kVAEAm: "x1n2onr6",
7
- k1xSpc: "x78zum5",
8
- kGNEyG: "x6s0dn4",
9
- kwnvtZ: "x1a02dak",
10
- k7Eaqz: "xeuugli",
11
- kAzted: "x1oec0jp",
12
- kg3NbH: "x1dc62k6",
13
- k8WAf4: "x1yrrsrt x1c526fk",
14
- $$css: !0
15
- },
16
- reportRow: {
17
- kAzted: "xca473s xmhh96",
18
- k8WAf4: "x18fcflc x1c526fk",
19
- $$css: !0
20
- },
21
- title: {
22
- kUk6DE: "x12lumcd",
23
- k7Eaqz: "xeuugli",
24
- kogj98: "x1ghz6dp",
25
- kHjlTd: "xj0a0fe",
26
- kGuDYH: "x12myhf4",
27
- k63SB2: "xk4h15q",
28
- kLWn49: "x1778rvt",
29
- $$css: !0
30
- },
31
- trailing: {
32
- k1xSpc: "x78zum5",
33
- kwnvtZ: "x1a02dak",
34
- kGNEyG: "x6s0dn4",
35
- kOIVth: "x1n8ia3y",
36
- keTefX: "xvc5jky",
37
- k7Eaqz: "xeuugli",
38
- ks0D6T: "x193iq5w",
39
- $$css: !0
40
- },
41
- meta: {
42
- k7Eaqz: "xeuugli",
43
- keTefX: "xvc5jky",
44
- kHjlTd: "xj0a0fe",
45
- kMwMTN: "x153jb6y",
46
- kGuDYH: "xy8obcc",
47
- kLWn49: "xas2l8k",
48
- $$css: !0
49
- },
50
- actions: {
51
- k1xSpc: "x78zum5",
52
- kGNEyG: "x6s0dn4",
53
- kwnvtZ: "x1a02dak",
54
- kOIVth: "x1hnptsi",
55
- k7Eaqz: "xeuugli",
56
- ks0D6T: "x193iq5w",
57
- $$css: !0
58
- },
59
- blockEnd: {
60
- k5JduY: "x1s928wv",
61
- kwXMNM: "x1j6awrg",
62
- kcktkL: "xb7ltuz",
63
- k8Iv0R: "x1xrz1ek",
64
- k4zj60: "xcock1l",
65
- ks3ayO: "xtccgxd",
66
- kloYau: "x2q1x1w",
67
- $$css: !0
68
- },
69
- blockStart: {
70
- k5JduY: "x1s928wv",
71
- kwXMNM: "x1j6awrg",
72
- kcktkL: "xb7ltuz",
73
- k3foIR: "x1m1drc7",
74
- k4zj60: "xcock1l",
75
- ks3ayO: "xtccgxd",
76
- kloYau: "x2q1x1w",
77
- $$css: !0
78
- },
79
- inlineEnd: {
80
- k5JduY: "x1s928wv",
81
- kwXMNM: "x1j6awrg",
82
- kSy8m5: "xd54j2p",
83
- kH8aOt: "x1unh1gc",
84
- kkgrvl: "xv6d0c5",
85
- ks3ayO: "xtccgxd",
86
- kloYau: "x2q1x1w",
87
- $$css: !0
88
- }
89
- };
90
- export { e as t };
@@ -1,39 +0,0 @@
1
- import type { ChartSelection } from './chart-frame.tsx';
2
- type ChartNavigationItem = {
3
- readonly id: string;
4
- readonly label: string;
5
- };
6
- type ChartNavigationInput = {
7
- readonly title: string;
8
- readonly items: ReadonlyArray<ChartNavigationItem>;
9
- readonly selection: ChartSelection | undefined;
10
- readonly columnCount?: number | undefined;
11
- };
12
- export declare function useChartNavigation({ title, items, selection, columnCount }: ChartNavigationInput): {
13
- id: string;
14
- props: {
15
- controls: {
16
- items: readonly ChartNavigationItem[];
17
- cursor: string | undefined;
18
- inspected: string | undefined;
19
- readout: string | undefined;
20
- selected: string | undefined;
21
- allowVerticalNavigation: true;
22
- columnCount: number | undefined;
23
- onInspect: (itemId: string) => void;
24
- onDismiss: () => void;
25
- onSelect: ((id: string) => void) | undefined;
26
- };
27
- role: "group";
28
- tabIndex: number | undefined;
29
- 'aria-label': string;
30
- 'aria-describedby': string;
31
- onFocus: () => void;
32
- onBlur: (event: import("react").FocusEvent<HTMLElement, Element>) => void;
33
- onPointerLeave: (event: import("react").PointerEvent<HTMLElement>) => void;
34
- };
35
- activeId: string | undefined;
36
- label: string | undefined;
37
- inspect: (itemId: string) => void;
38
- };
39
- export {};
@@ -1,27 +0,0 @@
1
- import type { PartProps } from '@ui-sdk/react/primitive';
2
- import type { ReactNode } from 'react';
3
- type ChartItem = {
4
- readonly id: string;
5
- readonly label: string;
6
- };
7
- export type ChartControls = {
8
- readonly items: ReadonlyArray<ChartItem>;
9
- readonly cursor: string | undefined;
10
- readonly inspected: string | undefined;
11
- readonly readout: string | undefined;
12
- readonly selected?: string | undefined;
13
- readonly allowVerticalNavigation?: boolean;
14
- /** Arranges the items row by row in a grid of this width. Up and Down change rows; Home and End stay in the row. */
15
- readonly columnCount?: number | undefined;
16
- readonly onInspect: (id: string) => void;
17
- readonly onDismiss: () => void;
18
- readonly onSelect?: ((id: string) => void) | undefined;
19
- };
20
- type ChartRoot<Tag extends 'div' | 'p' | 'svg'> = (props: Omit<PartProps<Tag>, 'id' | 'controls'> & {
21
- id?: string;
22
- controls: ChartControls;
23
- }) => ReactNode;
24
- export declare const ChartSurface: ChartRoot<'div'>;
25
- export declare const ChartTextSurface: ChartRoot<'p'>;
26
- export declare const ChartSvgSurface: ChartRoot<'svg'>;
27
- export {};
@@ -1,2 +0,0 @@
1
- import type { ComponentProps, ReactNode } from 'react';
2
- export declare function RouteLink(props: ComponentProps<'a'>): ReactNode;
@@ -1,96 +0,0 @@
1
- import "@stylexjs/stylex";
2
- import { useEffect as e, useState as t } from "react";
3
- // packages/charts/src/chart-theme.ts
4
- var n = {
5
- plot: {
6
- k7Eaqz: "xeuugli",
7
- kVQacm: "xb3r6kr",
8
- $$css: !0
9
- },
10
- svg: {
11
- k1xSpc: "x1lliihq",
12
- kzqmXN: "xh8yej3",
13
- kVQacm: "x1rea2x4",
14
- $$css: !0
15
- },
16
- axis: {
17
- kjVXCG: "x13hfdr1",
18
- kfJifR: "xnpr05h",
19
- kREpy8: "x13efnbd",
20
- $$css: !0
21
- },
22
- grid: {
23
- kjVXCG: "x13hfdr1",
24
- kfJifR: "xnpr05h",
25
- kREpy8: "x13efnbd",
26
- $$css: !0
27
- },
28
- baseline: {
29
- kjVXCG: "x1crw9hw",
30
- kfJifR: "xnpr05h",
31
- kREpy8: "x13efnbd",
32
- $$css: !0
33
- },
34
- label: {
35
- kDwRjp: "x1q7gtio",
36
- kMv6JI: "x1hz01jw",
37
- kGuDYH: "xy8obcc",
38
- k63SB2: "xj57cvi",
39
- kcqcaj: "xss6m8b",
40
- $$css: !0
41
- },
42
- strongLabel: {
43
- kDwRjp: "xlrhuyr",
44
- k63SB2: "xk4h15q",
45
- $$css: !0
46
- },
47
- haloLabel: {
48
- kCrYw0: "x1x0jnz8",
49
- kjVXCG: "xaep1og",
50
- kfJifR: "xqjr0vm",
51
- kJdQPc: "x1f6yumg",
52
- $$css: !0
53
- },
54
- mark: {
55
- kfJifR: "xvlca1e",
56
- kU5bRw: "x1owpc8m",
57
- kJdQPc: "x1f6yumg",
58
- kREpy8: "x13efnbd",
59
- $$css: !0
60
- },
61
- selected: {
62
- kjVXCG: "x17y187c",
63
- kfJifR: "xvlca1e",
64
- kREpy8: "x13efnbd",
65
- $$css: !0
66
- },
67
- inspectable: {
68
- k3XXqK: "x1t137rt",
69
- $$css: !0
70
- },
71
- emphasis: {
72
- k1ekBW: "x19991ni",
73
- kIyJzY: "xtitasy x12w9bfk",
74
- kAMwcw: "x1faw7qm",
75
- $$css: !0
76
- },
77
- receded: {
78
- kSiTet: "xk8c4ds",
79
- $$css: !0
80
- }
81
- }, r = 640;
82
- function i() {
83
- let [n, i] = t(null), [a, o] = t(r);
84
- return e(() => {
85
- if (n === null) return;
86
- let e = new ResizeObserver(([e]) => {
87
- e !== void 0 && e.contentRect.width > 0 && o(e.contentRect.width);
88
- });
89
- return e.observe(n), () => e.disconnect();
90
- }, [n]), {
91
- ref: i,
92
- width: a,
93
- element: n
94
- };
95
- }
96
- export { n, i as t };
@@ -1,396 +0,0 @@
1
- import { O as e, _ as t, v as n, w as r } from "./src-DcW_gMX8.js";
2
- import { t as i } from "./use-scroll-tab-index-Dxpdh4W7.js";
3
- import { t as a } from "./viewer-styles-DsFYri4K.js";
4
- import { t as o } from "./code-block-Cpfr7B6a.js";
5
- import { t as s } from "./content-link-CGeFFb9F.js";
6
- import * as c from "@stylexjs/stylex";
7
- import { useCallback as l, useEffect as u, useLayoutEffect as d, useRef as f, useState as p } from "react";
8
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
9
- import { Check as g, Circle as _, CircleDashed as v, CircleHelp as y, Clock as b, X as x } from "lucide-react";
10
- import S from "strip-ansi";
11
- // packages/content/src/json-viewer.tsx
12
- var C = { body: {
13
- kmVPX3: "x1mvvolr",
14
- kVQacm: "xysyzu8",
15
- kskxy: "x1phlbz0",
16
- kMv6JI: "xiard35",
17
- kGuDYH: "xy8obcc",
18
- $$css: !0
19
- } }, w = 500;
20
- function T({ value: e, name: n, path: r, depth: i, maxDepth: a, maxEntries: o }) {
21
- if (typeof e != "object" || !e) {
22
- let t = JSON.stringify(e), r = t.length > w;
23
- return /* @__PURE__ */ h("div", {
24
- className: "xeuugli x126k92a xj0a0fe",
25
- children: [
26
- /* @__PURE__ */ h("span", {
27
- className: "x153jb6y",
28
- children: [n, ": "]
29
- }),
30
- /* @__PURE__ */ m("span", {
31
- ...{
32
- 0: { className: "xbixft" },
33
- 1: { className: "x7ixh4y" }
34
- }[typeof e == "string" | 0],
35
- children: t.slice(0, w)
36
- }),
37
- r && /* @__PURE__ */ m("span", {
38
- className: "x153jb6y x1hz01jw",
39
- children: "… (value truncated)"
40
- })
41
- ]
42
- });
43
- }
44
- let s = Object.entries(e), c = Array.isArray(e) ? `${s.length} items` : `${s.length} fields`;
45
- return i >= a ? /* @__PURE__ */ h("div", {
46
- className: "xeuugli x126k92a xj0a0fe",
47
- children: [/* @__PURE__ */ h("span", {
48
- className: "x153jb6y",
49
- children: [n, ": "]
50
- }), /* @__PURE__ */ h("span", {
51
- className: "x153jb6y x1hz01jw",
52
- children: [c, " · depth limit"]
53
- })]
54
- }) : /* @__PURE__ */ h(t.Root, {
55
- defaultOpen: i === 0,
56
- className: "xeuugli x126k92a xj0a0fe",
57
- children: [/* @__PURE__ */ m(t.Trigger, {
58
- variant: "inline",
59
- children: /* @__PURE__ */ h("span", {
60
- className: "xiard35 xy8obcc",
61
- children: [
62
- /* @__PURE__ */ h("span", {
63
- className: "x153jb6y",
64
- children: [n, ": "]
65
- }),
66
- Array.isArray(e) ? "[]" : "{}",
67
- " ",
68
- /* @__PURE__ */ m("span", {
69
- className: "x153jb6y x1hz01jw",
70
- children: c
71
- })
72
- ]
73
- })
74
- }), /* @__PURE__ */ m(t.Panel, { children: /* @__PURE__ */ h("div", {
75
- className: "xo02m6d xpilrb4 x1t7ytsu x97x49r xa1dmyi xiard35 xy8obcc",
76
- children: [s.slice(0, o).map(([e, t]) => {
77
- let n = `${r}/${e.replaceAll("~", "~0").replaceAll("/", "~1")}`;
78
- return /* @__PURE__ */ m(T, {
79
- name: JSON.stringify(e),
80
- path: n,
81
- value: t,
82
- depth: i + 1,
83
- maxDepth: a,
84
- maxEntries: o
85
- }, n);
86
- }), s.length > o && /* @__PURE__ */ h("div", {
87
- className: "x153jb6y x1hz01jw",
88
- children: [s.length - o, " more entries · copy to inspect the complete value"]
89
- })]
90
- }) })]
91
- });
92
- }
93
- function E({ value: e, label: t, maxDepth: r = 6, maxEntries: o = 50 }) {
94
- let s = i(), u = l(() => JSON.stringify(e, null, 2), [e]);
95
- return /* @__PURE__ */ h("section", {
96
- "aria-label": t,
97
- ...c.props(a.root),
98
- children: [/* @__PURE__ */ h("div", {
99
- ...c.props(a.header),
100
- children: [/* @__PURE__ */ m("span", {
101
- ...c.props(a.label),
102
- children: t
103
- }), /* @__PURE__ */ m(n, {
104
- label: t,
105
- value: u,
106
- children: "Copy JSON"
107
- })]
108
- }), /* @__PURE__ */ m("div", {
109
- ref: s.ref,
110
- role: "region",
111
- "aria-label": `${t} fields`,
112
- tabIndex: s.tabIndex,
113
- ...c.props(a.scrollRegion, C.body),
114
- children: /* @__PURE__ */ m(T, {
115
- name: "root",
116
- path: "",
117
- value: e,
118
- depth: 0,
119
- maxDepth: Math.max(1, r),
120
- maxEntries: Math.max(1, o)
121
- })
122
- })]
123
- });
124
- }
125
- // packages/content/src/log-viewer.tsx
126
- var D = {
127
- kVQacm: "xysyzu8",
128
- kmVPX3: "x1mvvolr",
129
- kogj98: "x1ghz6dp",
130
- kMv6JI: "xiard35",
131
- kGuDYH: "xy8obcc",
132
- kLWn49: "x1778rvt",
133
- khDVqt: "x126k92a",
134
- kHjlTd: "xj0a0fe",
135
- kKi2Bq: "xeq4nuv",
136
- $$css: !0
137
- }, O = {
138
- output: (e) => [
139
- D,
140
- {
141
- kskxy: e == null ? e : "x1jols5v",
142
- $$css: !0
143
- },
144
- { "--x-maxHeight": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e) }
145
- ],
146
- notice: {
147
- kt9PQ7: "xso031l",
148
- kfdmCh: "x1q0q8m5",
149
- kL6WhQ: "x1qndepd",
150
- $$css: !0
151
- }
152
- }, k = 2e5;
153
- function A({ output: e, label: t, variant: o = "default", maxLines: s = 500, maxHeight: l = 320, isRunning: g = !1 }) {
154
- let _ = i(), v = _.viewport, y = f(!1), [b, x] = p(!0), C = S(e), w = C.slice(-2e5).split("\n"), T = w.slice(-Math.max(1, s)), E = w.length - T.length, D = o === "embedded", A = g && (!D || !b);
155
- return u(() => {
156
- b && v.current !== null && (v.current.scrollTop = v.current.scrollHeight);
157
- }, [e, b]), d(() => {
158
- !g && y.current && (y.current = !1, v.current?.focus({ preventScroll: !0 }));
159
- }, [g]), /* @__PURE__ */ h("section", {
160
- "aria-label": t,
161
- ...c.props(a.root, D && a.embedded),
162
- children: [
163
- /* @__PURE__ */ h("div", {
164
- ...c.props(a.header, D && a.embeddedHeader),
165
- children: [/* @__PURE__ */ h("span", {
166
- ...c.props(a.label),
167
- children: [t, g && !D && " · running"]
168
- }), /* @__PURE__ */ h("div", {
169
- ...c.props(a.actions),
170
- children: [A && /* @__PURE__ */ m(r, {
171
- variant: "ghost",
172
- onClick: () => x(!b),
173
- onFocus: () => {
174
- y.current = !0;
175
- },
176
- onBlur: () => {
177
- y.current = !1;
178
- },
179
- children: b ? "Pause following" : "Follow output"
180
- }), /* @__PURE__ */ m(n, {
181
- value: e,
182
- label: t,
183
- display: D ? "icon" : "value",
184
- children: "Copy"
185
- })]
186
- })]
187
- }),
188
- E > 0 && /* @__PURE__ */ h("div", {
189
- ...c.props(a.note, O.notice),
190
- children: [E, " earlier lines omitted from this view. Copy includes the supplied output."]
191
- }),
192
- C.length > k && /* @__PURE__ */ m("div", {
193
- ...c.props(a.note, O.notice),
194
- children: "Preview limited to the last 200,000 characters. Copy includes the supplied output."
195
- }),
196
- /* @__PURE__ */ m("pre", {
197
- ref: _.ref,
198
- role: "region",
199
- "aria-label": `${t} output`,
200
- tabIndex: _.tabIndex,
201
- onScroll: (e) => {
202
- let t = e.currentTarget;
203
- x(t.scrollHeight - t.scrollTop - t.clientHeight < 8);
204
- },
205
- ...c.props(a.scrollRegion, O.output(l)),
206
- children: C.length === 0 ? "No output recorded." : T.join("\n")
207
- })
208
- ]
209
- });
210
- }
211
- // packages/content/src/media-viewer.tsx
212
- var j = {
213
- viewport: {
214
- k1xSpc: "xrvj5dj",
215
- kgQiWS: "x1ku5rj1",
216
- kzqmXN: "xh8yej3",
217
- kOBAk4: "x186iv6y",
218
- kskxy: "xcwfpss",
219
- k7Eaqz: "xeuugli",
220
- kVQacm: "xb3r6kr",
221
- kWkggS: "x1r7kqkb",
222
- $$css: !0
223
- },
224
- placeholder: {
225
- kWkggS: "x1fa40ue",
226
- $$css: !0
227
- }
228
- };
229
- function M() {
230
- return /* @__PURE__ */ m("div", {
231
- "aria-hidden": !0,
232
- ...c.props(a.root, j.viewport, j.placeholder)
233
- });
234
- }
235
- function N({ kind: e, src: t, label: n, widthPixels: r, heightPixels: i, onError: o }) {
236
- return /* @__PURE__ */ m("div", {
237
- ...c.props(a.root, j.viewport),
238
- children: e === "image" ? /* @__PURE__ */ m("img", {
239
- src: t,
240
- alt: n,
241
- width: r,
242
- height: i,
243
- onError: o,
244
- className: "x1lliihq xh8yej3 x5yr21d x2lwn1j x19kjcj4"
245
- }) : /* @__PURE__ */ m("video", {
246
- src: t,
247
- "aria-label": n,
248
- width: r,
249
- height: i,
250
- controls: !0,
251
- muted: !0,
252
- playsInline: !0,
253
- preload: "metadata",
254
- onError: o,
255
- className: "x1lliihq xh8yej3 x5yr21d x2lwn1j x19kjcj4"
256
- })
257
- });
258
- }
259
- // packages/content/src/stack-trace.tsx
260
- function P({ message: e, frames: t }) {
261
- return /* @__PURE__ */ h("section", {
262
- "aria-label": "Stack trace",
263
- ...c.props(a.root),
264
- children: [/* @__PURE__ */ m("p", {
265
- className: "x1ghz6dp x1mvvolr xso031l x1q0q8m5 x1qndepd xr5kp14 xk4h15q xj0a0fe",
266
- children: e
267
- }), t.length === 0 ? /* @__PURE__ */ m("p", {
268
- className: "x1ghz6dp x1mvvolr x153jb6y",
269
- children: "No frames recorded."
270
- }) : /* @__PURE__ */ m("ol", {
271
- className: "x1ghz6dp x1717udv x3ct3a4",
272
- children: t.map((e) => {
273
- let t = [
274
- e.file,
275
- e.line,
276
- e.column
277
- ].filter((e) => e !== void 0).join(":");
278
- return /* @__PURE__ */ h("li", {
279
- className: "x78zum5 xdt5ytf x1hnptsi xeuugli xj0a0fe x1mvvolr xso031l x1t1lzn6 x1q0q8m5 x1qndepd",
280
- children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m(s, {
281
- href: e.href,
282
- children: e.name
283
- }), t.length > 0 && /* @__PURE__ */ m("span", {
284
- className: "x1lliihq x153jb6y xiard35 xy8obcc xj0a0fe",
285
- children: t
286
- })] }), e.code !== void 0 && /* @__PURE__ */ m(o, {
287
- code: e.code,
288
- language: e.language,
289
- filename: e.file
290
- })]
291
- }, e.id);
292
- })
293
- })]
294
- });
295
- }
296
- // packages/content/src/trace.tsx
297
- var F = {
298
- pending: {
299
- kMwMTN: "x153jb6y",
300
- $$css: !0
301
- },
302
- running: {
303
- kMwMTN: "xbixft",
304
- $$css: !0
305
- },
306
- complete: {
307
- kMwMTN: "x7ixh4y",
308
- $$css: !0
309
- },
310
- failed: {
311
- kMwMTN: "xr5kp14",
312
- $$css: !0
313
- },
314
- skipped: {
315
- kMwMTN: "x153jb6y",
316
- $$css: !0
317
- },
318
- unknown: {
319
- kMwMTN: "x153jb6y",
320
- $$css: !0
321
- }
322
- }, I = {
323
- pending: F.pending,
324
- running: F.running,
325
- complete: F.complete,
326
- failed: F.failed,
327
- skipped: F.skipped,
328
- unknown: F.unknown
329
- }, L = {
330
- pending: b,
331
- running: _,
332
- complete: g,
333
- failed: x,
334
- skipped: v,
335
- unknown: y
336
- };
337
- function R({ label: e, children: t }) {
338
- return /* @__PURE__ */ m("ol", {
339
- "aria-label": e,
340
- className: "x1ghz6dp x1717udv x3ct3a4 xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft",
341
- children: t
342
- });
343
- }
344
- function z({ label: e, children: t }) {
345
- return /* @__PURE__ */ m("ol", {
346
- "aria-label": e,
347
- className: "x1ghz6dp x1717udv x3ct3a4 xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft x3bg4vu",
348
- children: t
349
- });
350
- }
351
- function B({ id: n, label: r, status: i, statusLabel: a, description: o, detail: s, isSelected: l, onSelect: u, children: d }) {
352
- let f = L[i];
353
- return /* @__PURE__ */ h("li", {
354
- "data-item-id": n,
355
- className: "x1n2onr6 xrvj5dj x1qpdrs7 x8zbtdt x1wv5www xup0pd7",
356
- children: [/* @__PURE__ */ h("div", {
357
- "aria-hidden": !0,
358
- className: "x78zum5 xdt5ytf x6s0dn4 xunmzkg x1lk341d",
359
- children: [/* @__PURE__ */ m(f, {
360
- size: 14,
361
- ...c.props(I[i])
362
- }), /* @__PURE__ */ m("span", { className: "x1i1rx1s x1f6qilh x98rzlu x1fa40ue" })]
363
- }), /* @__PURE__ */ h("div", {
364
- className: "x78zum5 xdt5ytf xunmzkg xeuugli",
365
- children: [
366
- /* @__PURE__ */ m("div", {
367
- ...{
368
- 0: { className: "xk4h15q xj0a0fe" },
369
- 1: { className: "xk4h15q xj0a0fe xujl8zx xda060z" }
370
- }[l === !0 | 0],
371
- children: u === void 0 ? r : /* @__PURE__ */ m(e, {
372
- "aria-pressed": l,
373
- onClick: () => u(n),
374
- children: r
375
- })
376
- }),
377
- /* @__PURE__ */ m("span", {
378
- className: "xy8obcc xas2l8k x153jb6y xj0a0fe",
379
- children: a
380
- }),
381
- o !== void 0 && /* @__PURE__ */ m("p", {
382
- className: "x1ghz6dp x153jb6y xj0a0fe",
383
- children: o
384
- }),
385
- s !== void 0 && /* @__PURE__ */ h(t.Root, { children: [/* @__PURE__ */ m(t.Trigger, { children: "Details" }), /* @__PURE__ */ m(t.Panel, { children: s })] }),
386
- d
387
- ]
388
- })]
389
- });
390
- }
391
- var V = {
392
- Root: R,
393
- Item: B,
394
- Group: z
395
- };
396
- export { A as a, M as i, P as n, E as o, N as r, V as t };