@mechane-ai/elements 0.45.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.
- package/README.md +48 -18
- package/bin/mechane-elements-catalog.mjs +42 -4
- package/dist/ai.js +268 -202
- package/dist/catalog.json +91 -31
- package/dist/categorical-values-BXi-rJuv.js +74 -0
- package/dist/chart-cursor-1mFd48Jc.js +23 -0
- package/dist/chart-data-CIJVWCYt.js +21 -0
- package/dist/{chart-frame-Ztktqs1b.js → chart-frame-BaxKn_MB.js} +22 -41
- package/dist/{chart-input-BO3BqlFO.js → chart-input-Bm82_9Rd.js} +2 -2
- package/dist/chart-theme-4zprJ3rW.js +404 -0
- package/dist/charts/cartesian.js +1598 -1432
- package/dist/charts/distribution.js +476 -404
- package/dist/charts/graph.js +363 -349
- package/dist/charts/hierarchy.js +103 -94
- package/dist/charts/matrix.js +340 -333
- package/dist/charts/timeline.js +167 -134
- package/dist/charts.js +3 -3
- package/dist/{code-block-Cpfr7B6a.js → code-block-DioAM2bZ.js} +67 -52
- package/dist/collections.js +1648 -1188
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +67 -66
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +2 -2
- package/dist/content/tree.js +2 -2
- package/dist/{content-link-CGeFFb9F.js → content-link-NWuHp5rC.js} +1 -1
- package/dist/content.js +1 -1
- package/dist/csp.js +6 -11
- package/dist/feedback.js +1 -1
- package/dist/forms/dates.js +274 -214
- package/dist/{forms-DeU0Tiv3.js → forms-CEbwzlRR.js} +50 -41
- package/dist/forms.js +3 -3
- package/dist/index.js +1 -1
- package/dist/layout.js +207 -207
- package/dist/navigation.js +4 -3
- package/dist/packages/ai/src/conversation.d.ts +2 -0
- package/dist/packages/ai/src/prompt-input.d.ts +7 -2
- package/dist/packages/charts/src/cartesian/composition-bars.d.ts +2 -2
- package/dist/packages/charts/src/cartesian/index.d.ts +3 -2
- package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +8 -2
- package/dist/packages/charts/src/cartesian/time-series.d.ts +11 -1
- package/dist/packages/charts/src/categorical-values.d.ts +14 -9
- package/dist/packages/charts/src/chart-frame.d.ts +7 -9
- package/dist/packages/charts/src/chart-inspection.d.ts +1 -2
- package/dist/packages/charts/src/chart-range.d.ts +33 -0
- package/dist/packages/charts/src/chart-rows.d.ts +20 -0
- package/dist/packages/charts/src/chart-theme.d.ts +17 -0
- package/dist/packages/charts/src/chart.d.ts +81 -0
- package/dist/packages/charts/src/distribution/distribution-plot.d.ts +4 -4
- package/dist/packages/charts/src/index.d.ts +1 -0
- package/dist/packages/charts/src/matrix/matrix-strip.d.ts +3 -3
- package/dist/packages/charts/src/plot-width.d.ts +0 -1
- package/dist/packages/charts/src/timeline/index.d.ts +1 -1
- package/dist/packages/charts/src/timeline/waterfall.d.ts +6 -2
- package/dist/packages/collections/src/collection-controls.d.ts +5 -1
- package/dist/packages/collections/src/collection-filters.d.ts +4 -1
- package/dist/packages/collections/src/control-toolbar.d.ts +13 -0
- package/dist/packages/collections/src/data-table-layout.d.ts +78 -0
- package/dist/packages/collections/src/data-table-rows.d.ts +54 -0
- package/dist/packages/collections/src/data-table-styles.d.ts +340 -0
- package/dist/packages/collections/src/data-table-text.d.ts +13 -0
- package/dist/packages/collections/src/data-table-trigger.d.ts +23 -0
- package/dist/packages/collections/src/data-table.d.ts +3 -85
- package/dist/packages/collections/src/index.d.ts +11 -6
- package/dist/packages/collections/src/query-controls.d.ts +6 -2
- package/dist/packages/collections/src/table-results.d.ts +47 -13
- package/dist/packages/collections/src/timeline.d.ts +1 -0
- package/dist/packages/collections/src/use-collection-controls.d.ts +2 -1
- package/dist/packages/collections/src/use-table-window.d.ts +25 -0
- package/dist/packages/content/src/viewer.d.ts +8 -0
- package/dist/packages/core/src/disclosure.d.ts +9 -1
- package/dist/packages/core/src/index.d.ts +1 -0
- package/dist/packages/core/src/route-link.d.ts +11 -0
- package/dist/packages/forms/src/dates/date-inputs.d.ts +3 -1
- package/dist/packages/forms/src/file-picker.d.ts +15 -0
- package/dist/packages/forms/src/form-controls.d.ts +1 -6
- package/dist/packages/forms/src/forms.d.ts +4 -1
- package/dist/packages/forms/src/index.d.ts +4 -2
- package/dist/packages/forms/src/selection.d.ts +14 -0
- package/dist/packages/foundations/src/csp/index.d.ts +1 -1
- package/dist/packages/foundations/src/csp/provider.d.ts +7 -2
- package/dist/packages/navigation/src/index.d.ts +1 -1
- package/dist/{pierre-diff-B3tD3-6z.js → pierre-diff-DlvjyuJn.js} +1 -1
- package/dist/plot-width-v2c_rA20.js +63 -0
- package/dist/{src-gqEebHEa.js → src-1EHkSFS-.js} +395 -274
- package/dist/{src-DBNncL7_.js → src-BPTDJqt0.js} +48 -68
- package/dist/src-CGc_hjxJ.js +409 -0
- package/dist/{src-DcW_gMX8.js → src-CpdJlDhO.js} +480 -362
- package/dist/{src-Dcs3SZ9V.js → src-DVHlknB6.js} +1 -1
- package/dist/styles2.css +136 -114
- package/package.json +1 -4
- package/skills/extend-elements/SKILL.md +74 -0
- package/skills/review-elements/SKILL.md +76 -0
- package/skills/upgrade-elements/SKILL.md +34 -0
- package/skills/upgrade-elements/references/releases.md +58 -0
- package/skills/use-elements/SKILL.md +64 -13
- package/skills/use-elements/references/agent.md +57 -0
- package/skills/use-elements/references/charts.md +63 -0
- package/skills/use-elements/references/collections.md +89 -0
- package/skills/use-elements/references/conversations.md +47 -0
- package/skills/use-elements/references/forms.md +81 -0
- package/skills/use-elements/references/styling.md +70 -0
- package/skills/use-elements/references/workspace.md +3 -3
- package/dist/categorical-values-DZLGQVW1.js +0 -63
- package/dist/chart-navigation-BAbb5PV9.js +0 -154
- package/dist/header-styles-COxCYFZx.js +0 -90
- package/dist/packages/charts/src/chart-navigation.d.ts +0 -39
- package/dist/packages/charts/src/chart-surface.d.ts +0 -27
- package/dist/packages/navigation/src/route-link.d.ts +0 -2
- package/dist/plot-width-CIqBiHcd.js +0 -105
- package/dist/src-Bk7M67zy.js +0 -396
package/dist/charts/timeline.js
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import { c as e } from "../src-
|
|
2
|
-
import {
|
|
3
|
-
import { n, t as r } from "../chart-input-
|
|
1
|
+
import { c as e } from "../src-CpdJlDhO.js";
|
|
2
|
+
import { t } from "../chart-frame-BaxKn_MB.js";
|
|
3
|
+
import { n, t as r } from "../chart-input-Bm82_9Rd.js";
|
|
4
4
|
import * as i from "@stylexjs/stylex";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { scaleLinear as s } from "@visx/scale";
|
|
7
|
+
import { Bar as c } from "@visx/shape";
|
|
8
|
+
import { Waterfall as l, WaterfallBar as u, WaterfallCell as d, WaterfallColumnHeader as f, WaterfallHeaderRow as p, WaterfallRow as m, WaterfallRowHeader as h } from "@ui-sdk/react/waterfall";
|
|
9
9
|
// packages/charts/src/timeline/waterfall.tsx
|
|
10
|
-
var
|
|
10
|
+
var g = 5, _ = {
|
|
11
|
+
cell: {
|
|
12
|
+
k3XXqK: "x1t137rt",
|
|
13
|
+
kZs9gx: "x19rmrnh",
|
|
14
|
+
k7shQP: "x9v5kkp",
|
|
15
|
+
kPJHz1: "x13qnu6",
|
|
16
|
+
kiEn40: "x7s97pk",
|
|
17
|
+
$$css: !0
|
|
18
|
+
},
|
|
11
19
|
plot: {
|
|
12
20
|
k7Eaqz: "xeuugli",
|
|
13
21
|
kUOVxO: "xl4o6ss",
|
|
@@ -27,142 +35,151 @@ var u = 5, d = {
|
|
|
27
35
|
kMwMTN: "xr5kp14",
|
|
28
36
|
$$css: !0
|
|
29
37
|
}
|
|
30
|
-
},
|
|
31
|
-
neutral:
|
|
32
|
-
positive:
|
|
33
|
-
negative:
|
|
34
|
-
},
|
|
38
|
+
}, v = {
|
|
39
|
+
neutral: _.neutral,
|
|
40
|
+
positive: _.positive,
|
|
41
|
+
negative: _.negative
|
|
42
|
+
}, y = [
|
|
35
43
|
0,
|
|
36
44
|
.5,
|
|
37
45
|
1
|
|
38
|
-
],
|
|
39
|
-
function
|
|
40
|
-
let
|
|
46
|
+
], b = 100;
|
|
47
|
+
function x({ items: n, start: c, end: g, label: x, report: E, rowLabel: D, summaryLabel: O, emptyLabel: k, selectedId: A, selectedRef: j, onSelect: M, formatOffset: N }) {
|
|
48
|
+
let P = S({
|
|
41
49
|
items: n,
|
|
42
|
-
start:
|
|
43
|
-
end:
|
|
50
|
+
start: c,
|
|
51
|
+
end: g
|
|
44
52
|
});
|
|
45
|
-
if (
|
|
46
|
-
title:
|
|
47
|
-
report:
|
|
48
|
-
message:
|
|
53
|
+
if (P !== void 0) return /* @__PURE__ */ a(r, {
|
|
54
|
+
title: x,
|
|
55
|
+
report: E,
|
|
56
|
+
message: P
|
|
49
57
|
});
|
|
50
|
-
let
|
|
51
|
-
domain: [
|
|
52
|
-
range: [0,
|
|
53
|
-
}),
|
|
58
|
+
let F = g - c, I = s({
|
|
59
|
+
domain: [c, g],
|
|
60
|
+
range: [0, F === 0 ? 0 : b]
|
|
61
|
+
}), L = F > 0 ? y : [0], R = n.some((e) => e.geometry.kind !== "unavailable"), z = new Map(n.map((e) => [e.id, T({
|
|
62
|
+
geometry: e.geometry,
|
|
63
|
+
start: c,
|
|
64
|
+
formatOffset: N
|
|
65
|
+
})])), B = n.map((e) => ({
|
|
66
|
+
value: e.id,
|
|
67
|
+
label: `${e.label} · ${e.detail} · ${e.summary} · ${z.get(e.id)}`,
|
|
68
|
+
...w(e.geometry)
|
|
69
|
+
})), V = n.length === 0 ? /* @__PURE__ */ a("div", {
|
|
54
70
|
role: "group",
|
|
55
|
-
"aria-label":
|
|
71
|
+
"aria-label": x,
|
|
56
72
|
className: "xeuugli x1hz01jw x12h1iku",
|
|
57
|
-
children:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
73
|
+
children: /* @__PURE__ */ a("p", {
|
|
74
|
+
className: "x1ghz6dp x1c8xbx5",
|
|
75
|
+
children: /* @__PURE__ */ a(e, {
|
|
76
|
+
tone: "muted",
|
|
77
|
+
children: k
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
}) : /* @__PURE__ */ o(l, {
|
|
81
|
+
items: B,
|
|
82
|
+
range: [c, g],
|
|
83
|
+
value: A ?? null,
|
|
84
|
+
onValueChange: (e, t) => {
|
|
85
|
+
e !== null && M(e, t);
|
|
86
|
+
},
|
|
87
|
+
getBarLabel: (e) => z.get(e.value) ?? "",
|
|
88
|
+
"aria-label": x,
|
|
89
|
+
className: "xeuugli x1hz01jw x12h1iku",
|
|
90
|
+
children: [/* @__PURE__ */ o(p, {
|
|
91
|
+
className: "xrvj5dj x13sfnbj x1prkh4w x6s0dn4 x1gkm1c7 x1y1mm1b xh8yej3 x9f619 x1doqdfy x17tes2r x153jb6y xy8obcc xso031l x1q0q8m5 x1qndepd",
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ a(f, { children: /* @__PURE__ */ a(e, {
|
|
94
|
+
variant: "caption",
|
|
95
|
+
tone: "muted",
|
|
96
|
+
children: D
|
|
97
|
+
}) }),
|
|
98
|
+
/* @__PURE__ */ a(f, {
|
|
99
|
+
"aria-label": "Timing",
|
|
100
|
+
className: "xeuugli xl4o6ss x1npkx4u x1v577k8 x1ms6mhf x1aa6nly x78zum5 x1qughib x6s0dn4 xy8obcc xas2l8k xss6m8b",
|
|
101
|
+
children: R ? L.map((e) => /* @__PURE__ */ a("span", { children: N(F * e) }, e)) : /* @__PURE__ */ a("span", { children: "Timing unavailable" })
|
|
102
|
+
}),
|
|
103
|
+
/* @__PURE__ */ a(f, {
|
|
104
|
+
className: "xrvj5dj xfko13i xeuugli x1k3v4rp x14r0xmm x1ms6mhf xp4054r xj0a0fe xss6m8b",
|
|
105
|
+
children: /* @__PURE__ */ a(e, {
|
|
62
106
|
variant: "caption",
|
|
63
107
|
tone: "muted",
|
|
64
|
-
children:
|
|
65
|
-
}),
|
|
66
|
-
/* @__PURE__ */ o("div", {
|
|
67
|
-
className: "xeuugli xl4o6ss x1npkx4u x1v577k8 x1ms6mhf x1aa6nly x78zum5 x1qughib x6s0dn4 xy8obcc xas2l8k xss6m8b",
|
|
68
|
-
children: j ? A.map((e) => /* @__PURE__ */ o("span", { children: E(O * e) }, e)) : /* @__PURE__ */ o("span", { children: "Timing unavailable" })
|
|
69
|
-
}),
|
|
70
|
-
/* @__PURE__ */ o("span", {
|
|
71
|
-
className: "xrvj5dj xfko13i xeuugli x1k3v4rp x14r0xmm x1ms6mhf xp4054r xj0a0fe xss6m8b",
|
|
72
|
-
children: /* @__PURE__ */ o(e, {
|
|
73
|
-
variant: "caption",
|
|
74
|
-
tone: "muted",
|
|
75
|
-
children: x
|
|
76
|
-
})
|
|
108
|
+
children: O
|
|
77
109
|
})
|
|
78
|
-
]
|
|
79
|
-
}),
|
|
80
|
-
n.length === 0 && /* @__PURE__ */ o("p", {
|
|
81
|
-
className: "x1ghz6dp x1c8xbx5",
|
|
82
|
-
children: /* @__PURE__ */ o(e, {
|
|
83
|
-
tone: "muted",
|
|
84
|
-
children: S
|
|
85
110
|
})
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
children: [/* @__PURE__ */ o(e, { children: t.label }), /* @__PURE__ */ o("span", {
|
|
108
|
-
title: t.detail,
|
|
109
|
-
...{
|
|
110
|
-
0: { className: "xb3r6kr xuxw1ft xlyipyv" },
|
|
111
|
-
1: { className: "xb3r6kr xlyipyv xeaf4i8 xj0a0fe" }
|
|
112
|
-
}[C === t.id | 0],
|
|
113
|
-
children: /* @__PURE__ */ o(e, {
|
|
114
|
-
variant: "caption",
|
|
115
|
-
tone: "muted",
|
|
116
|
-
children: t.detail
|
|
117
|
-
})
|
|
118
|
-
})]
|
|
119
|
-
}),
|
|
120
|
-
/* @__PURE__ */ o("span", {
|
|
121
|
-
title: n,
|
|
122
|
-
...i.props(d.plot, f[t.tone]),
|
|
123
|
-
children: t.geometry.kind === "unavailable" ? /* @__PURE__ */ o(e, {
|
|
111
|
+
]
|
|
112
|
+
}), n.map((t) => {
|
|
113
|
+
let n = z.get(t.id), r = A === t.id;
|
|
114
|
+
return /* @__PURE__ */ o(m, {
|
|
115
|
+
value: t.id,
|
|
116
|
+
ref: r ? j : void 0,
|
|
117
|
+
"aria-controls": t.controls,
|
|
118
|
+
...{
|
|
119
|
+
0: { className: "xrvj5dj x13sfnbj x1prkh4w x6s0dn4 x1gkm1c7 x1y1mm1b xh8yej3 x9f619 x1doqdfy xn9t2bk x1wiwyrm xc342km xso031l x1q0q8m5 x1qndepd xpvm0e4 xbixft x1hz01jw x1yc453h x1ypdohk x1t137rt xif5pkx x1ecmtor x19rmrnh x9v5kkp x13qnu6 x1bqaal x1t1lzn6" },
|
|
120
|
+
1: { className: "xrvj5dj x13sfnbj x1prkh4w x6s0dn4 x1gkm1c7 x1y1mm1b xh8yej3 x9f619 x1doqdfy xn9t2bk x1wiwyrm xc342km xso031l x1q0q8m5 x1qndepd xbixft x1hz01jw x1yc453h x1ypdohk x1t137rt xif5pkx x1ecmtor x19rmrnh x9v5kkp x13qnu6 x1bqaal x1t1lzn6 x1r7kqkb xh3r7i3" }
|
|
121
|
+
}[!!r | 0],
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ o(h, {
|
|
124
|
+
className: "xeuugli xrvj5dj xfko13i x1t137rt x19rmrnh x9v5kkp x13qnu6 x7s97pk",
|
|
125
|
+
children: [/* @__PURE__ */ a(e, { children: t.label }), /* @__PURE__ */ a("span", {
|
|
126
|
+
title: t.detail,
|
|
127
|
+
...{
|
|
128
|
+
0: { className: "xb3r6kr xuxw1ft xlyipyv" },
|
|
129
|
+
1: { className: "xb3r6kr xlyipyv xeaf4i8 xj0a0fe" }
|
|
130
|
+
}[!!r | 0],
|
|
131
|
+
children: /* @__PURE__ */ a(e, {
|
|
124
132
|
variant: "caption",
|
|
125
133
|
tone: "muted",
|
|
126
|
-
children:
|
|
127
|
-
}) : /* @__PURE__ */ s("svg", {
|
|
128
|
-
"aria-hidden": !0,
|
|
129
|
-
className: "x1lliihq xh8yej3 xmix8c7 x1rea2x4",
|
|
130
|
-
children: [A.map((e) => /* @__PURE__ */ o("line", {
|
|
131
|
-
x1: `${e * m}%`,
|
|
132
|
-
x2: `${e * m}%`,
|
|
133
|
-
y1: "0",
|
|
134
|
-
y2: "18",
|
|
135
|
-
className: "x13hfdr1"
|
|
136
|
-
}, e)), /* @__PURE__ */ o(_, {
|
|
137
|
-
geometry: t.geometry,
|
|
138
|
-
scale: k
|
|
139
|
-
})]
|
|
134
|
+
children: t.detail
|
|
140
135
|
})
|
|
141
|
-
})
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
136
|
+
})]
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ a(u, {
|
|
139
|
+
title: n,
|
|
140
|
+
...i.props(_.plot, _.cell, v[t.tone]),
|
|
141
|
+
children: t.geometry.kind === "unavailable" ? /* @__PURE__ */ a(e, {
|
|
142
|
+
variant: "caption",
|
|
143
|
+
tone: "muted",
|
|
144
|
+
children: n
|
|
145
|
+
}) : /* @__PURE__ */ o("svg", {
|
|
146
|
+
"aria-hidden": !0,
|
|
147
|
+
className: "x1lliihq xh8yej3 xmix8c7 x1rea2x4",
|
|
148
|
+
children: [L.map((e) => /* @__PURE__ */ a("line", {
|
|
149
|
+
x1: `${e * b}%`,
|
|
150
|
+
x2: `${e * b}%`,
|
|
151
|
+
y1: "0",
|
|
152
|
+
y2: "18",
|
|
153
|
+
className: "x13hfdr1"
|
|
154
|
+
}, e)), /* @__PURE__ */ a(C, {
|
|
155
|
+
geometry: t.geometry,
|
|
156
|
+
scale: I
|
|
152
157
|
})]
|
|
153
158
|
})
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
159
|
+
}),
|
|
160
|
+
/* @__PURE__ */ o(d, {
|
|
161
|
+
className: "xrvj5dj xfko13i xeuugli x1k3v4rp x14r0xmm x1ms6mhf xp4054r xj0a0fe xss6m8b x1t137rt x19rmrnh x9v5kkp x13qnu6 x7s97pk",
|
|
162
|
+
children: [/* @__PURE__ */ a(e, {
|
|
163
|
+
variant: "caption",
|
|
164
|
+
tone: "muted",
|
|
165
|
+
children: t.summary
|
|
166
|
+
}), r && /* @__PURE__ */ a(e, {
|
|
167
|
+
variant: "caption",
|
|
168
|
+
tone: "muted",
|
|
169
|
+
children: n
|
|
170
|
+
})]
|
|
171
|
+
})
|
|
172
|
+
]
|
|
173
|
+
}, t.id);
|
|
174
|
+
})]
|
|
158
175
|
});
|
|
159
|
-
return
|
|
160
|
-
title:
|
|
161
|
-
report:
|
|
162
|
-
children:
|
|
176
|
+
return E === void 0 ? V : /* @__PURE__ */ a(t, {
|
|
177
|
+
title: x,
|
|
178
|
+
report: E,
|
|
179
|
+
children: V
|
|
163
180
|
});
|
|
164
181
|
}
|
|
165
|
-
function
|
|
182
|
+
function S({ items: e, start: t, end: r }) {
|
|
166
183
|
if (!Number.isFinite(t) || !Number.isFinite(r) || !Number.isFinite(r - t) || r < t) return "The timing domain must have finite, ordered endpoints.";
|
|
167
184
|
if (!n(e)) return "Timing records must have unique identifiers.";
|
|
168
185
|
for (let n of e) {
|
|
@@ -174,17 +191,17 @@ function g({ items: e, start: t, end: r }) {
|
|
|
174
191
|
if (e.kind === "point" && (!Number.isFinite(e.at) || e.at < t || e.at > r)) return "Timing points must be finite and fit inside the supplied domain.";
|
|
175
192
|
}
|
|
176
193
|
}
|
|
177
|
-
function
|
|
194
|
+
function C({ geometry: e, scale: t }) {
|
|
178
195
|
switch (e.kind) {
|
|
179
196
|
case "unavailable": return null;
|
|
180
197
|
case "interval": {
|
|
181
198
|
let n = t(e.start), r = t(e.end) - n;
|
|
182
|
-
return r === 0 ? /* @__PURE__ */
|
|
199
|
+
return r === 0 ? /* @__PURE__ */ a("circle", {
|
|
183
200
|
cx: `${n}%`,
|
|
184
201
|
cy: 9,
|
|
185
202
|
r: 3,
|
|
186
203
|
className: "x117rol3"
|
|
187
|
-
}) : /* @__PURE__ */
|
|
204
|
+
}) : /* @__PURE__ */ a(c, {
|
|
188
205
|
x: `${n}%`,
|
|
189
206
|
y: 6,
|
|
190
207
|
width: `${r}%`,
|
|
@@ -196,26 +213,26 @@ function _({ geometry: e, scale: t }) {
|
|
|
196
213
|
case "point": {
|
|
197
214
|
let n = t(e.at);
|
|
198
215
|
switch (e.marker) {
|
|
199
|
-
case "filled": return /* @__PURE__ */
|
|
216
|
+
case "filled": return /* @__PURE__ */ a("circle", {
|
|
200
217
|
cx: `${n}%`,
|
|
201
218
|
cy: 9,
|
|
202
219
|
r: 3,
|
|
203
220
|
className: "x117rol3"
|
|
204
221
|
});
|
|
205
|
-
case "hollow": return /* @__PURE__ */
|
|
222
|
+
case "hollow": return /* @__PURE__ */ a("circle", {
|
|
206
223
|
cx: `${n}%`,
|
|
207
224
|
cy: 9,
|
|
208
225
|
r: 3.5,
|
|
209
226
|
className: "x1fytgo2 x73je2i xvlca1e"
|
|
210
227
|
});
|
|
211
|
-
case "diamond": return /* @__PURE__ */
|
|
228
|
+
case "diamond": return /* @__PURE__ */ a("svg", {
|
|
212
229
|
x: `${n}%`,
|
|
213
230
|
y: 9,
|
|
214
231
|
width: 1,
|
|
215
232
|
height: 1,
|
|
216
233
|
overflow: "visible",
|
|
217
|
-
children: /* @__PURE__ */
|
|
218
|
-
d: `M0 -${
|
|
234
|
+
children: /* @__PURE__ */ a("path", {
|
|
235
|
+
d: `M0 -${g} ${g} 0 0 ${g} -${g} 0Z`,
|
|
219
236
|
className: "x117rol3"
|
|
220
237
|
})
|
|
221
238
|
});
|
|
@@ -223,11 +240,27 @@ function _({ geometry: e, scale: t }) {
|
|
|
223
240
|
}
|
|
224
241
|
}
|
|
225
242
|
}
|
|
226
|
-
function
|
|
243
|
+
function w(e) {
|
|
244
|
+
switch (e.kind) {
|
|
245
|
+
case "interval": return {
|
|
246
|
+
start: e.start,
|
|
247
|
+
duration: e.end - e.start
|
|
248
|
+
};
|
|
249
|
+
case "point": return {
|
|
250
|
+
start: e.at,
|
|
251
|
+
duration: 0
|
|
252
|
+
};
|
|
253
|
+
case "unavailable": return {
|
|
254
|
+
start: NaN,
|
|
255
|
+
duration: NaN
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
function T({ geometry: e, start: t, formatOffset: n }) {
|
|
227
260
|
switch (e.kind) {
|
|
228
261
|
case "interval": return `Start ${n(e.start - t)}, end ${n(e.end - t)}, duration ${n(e.end - e.start)}`;
|
|
229
262
|
case "point": return `At ${n(e.at - t)}`;
|
|
230
263
|
case "unavailable": return "Timing unavailable";
|
|
231
264
|
}
|
|
232
265
|
}
|
|
233
|
-
export {
|
|
266
|
+
export { x as Waterfall };
|
package/dist/charts.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as r, l as i } from "./src-
|
|
3
|
-
export {
|
|
1
|
+
import { i as e, n as t, t as n } from "./chart-frame-BaxKn_MB.js";
|
|
2
|
+
import { c as r, l as i } from "./src-DVHlknB6.js";
|
|
3
|
+
export { n as ChartFrame, t as ChartLegend, e as ChartSeriesMarker, r as chartToneColors, i as chartToneOutlines };
|
|
@@ -1,13 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { y as e } from "./src-CpdJlDhO.js";
|
|
2
2
|
import { d as t, f as n, i as r, r as i, u as a } from "./tokens.stylex-dF5CACEJ.js";
|
|
3
3
|
import { t as o } from "./use-scroll-tab-index-Dxpdh4W7.js";
|
|
4
4
|
import { t as s } from "./viewer-styles-DsFYri4K.js";
|
|
5
5
|
import * as c from "@stylexjs/stylex";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import { createParts as l } from "@ui-sdk/react/primitive";
|
|
7
|
+
import { useEffect as u, useRef as d, useState as f } from "react";
|
|
8
|
+
import { definePrimitive as p } from "@ui-sdk/core";
|
|
9
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
10
|
+
import { getFiletypeFromFileName as g } from "@pierre/diffs";
|
|
11
|
+
// packages/content/src/viewer.tsx
|
|
12
|
+
function _({ kind: e }) {
|
|
13
|
+
return { kind: e };
|
|
14
|
+
}
|
|
15
|
+
var v = p({
|
|
16
|
+
name: "viewer",
|
|
17
|
+
options: { kind: "string" },
|
|
18
|
+
state: _,
|
|
19
|
+
sync: _,
|
|
20
|
+
controlled: ["kind"],
|
|
21
|
+
api: () => ({}),
|
|
22
|
+
agent: { actions: [] },
|
|
23
|
+
slots: (e) => ({ root: e({}) })
|
|
24
|
+
}), y = l(v, { root: "section" }).Root, b = {
|
|
11
25
|
name: "Elements",
|
|
12
26
|
appearance: "light",
|
|
13
27
|
cssVariables: {
|
|
@@ -40,7 +54,7 @@ var h = {
|
|
|
40
54
|
punctuation: "punctuation"
|
|
41
55
|
}
|
|
42
56
|
}
|
|
43
|
-
},
|
|
57
|
+
}, x = `
|
|
44
58
|
:host {
|
|
45
59
|
color-scheme: inherit;
|
|
46
60
|
--diffs-font-family: ${n.monoFamily};
|
|
@@ -79,25 +93,25 @@ pre { font-family: ${n.monoFamily}; font-size: ${n.captionSize}; line-height: ${
|
|
|
79
93
|
flex-wrap: wrap;
|
|
80
94
|
}
|
|
81
95
|
[data-header-content] { flex: 1 1 12ch; }
|
|
82
|
-
`,
|
|
83
|
-
function
|
|
84
|
-
let n =
|
|
85
|
-
return
|
|
96
|
+
`, S = 2e5, C = 4096;
|
|
97
|
+
function w(e, t) {
|
|
98
|
+
let n = d(null), [r, i] = f();
|
|
99
|
+
return u(() => () => {
|
|
86
100
|
n.current !== null && (n.current.tokenizer.dispose(), n.current = null);
|
|
87
|
-
}, []),
|
|
101
|
+
}, []), u(() => {
|
|
88
102
|
let r = !0;
|
|
89
103
|
async function a() {
|
|
90
104
|
try {
|
|
91
105
|
let a = await import("@pierre/highlights");
|
|
92
|
-
if (!r || e.length >
|
|
106
|
+
if (!r || e.length > S || !a.isSupportedLanguage(t)) return;
|
|
93
107
|
let o = n.current, s = o !== null && o.language === t, c = s ? o : {
|
|
94
108
|
language: t,
|
|
95
109
|
source: e,
|
|
96
110
|
tokenizer: new a.LiveTokenizer({
|
|
97
111
|
code: e,
|
|
98
112
|
lang: t,
|
|
99
|
-
theme:
|
|
100
|
-
tokenizeMaxLineLength:
|
|
113
|
+
theme: b,
|
|
114
|
+
tokenizeMaxLineLength: C
|
|
101
115
|
})
|
|
102
116
|
};
|
|
103
117
|
if (s) {
|
|
@@ -143,13 +157,13 @@ function y(e, t) {
|
|
|
143
157
|
}, [e, t]), r !== void 0 && r.code === e && r.language === t ? r : void 0;
|
|
144
158
|
}
|
|
145
159
|
// packages/content/src/code/code-block.tsx
|
|
146
|
-
var
|
|
160
|
+
var T = {
|
|
147
161
|
kVQacm: "xysyzu8",
|
|
148
162
|
k9g6sI: "x12h1iku",
|
|
149
163
|
$$css: !0
|
|
150
|
-
},
|
|
164
|
+
}, E = {
|
|
151
165
|
viewport: (e) => [
|
|
152
|
-
|
|
166
|
+
T,
|
|
153
167
|
{
|
|
154
168
|
kskxy: e == null ? e : "x1jols5v",
|
|
155
169
|
$$css: !0
|
|
@@ -168,64 +182,65 @@ var b = {
|
|
|
168
182
|
k63SB2: "x1b5ytql",
|
|
169
183
|
$$css: !0
|
|
170
184
|
}
|
|
171
|
-
},
|
|
172
|
-
function
|
|
185
|
+
}, D = 2e5;
|
|
186
|
+
function O({ token: e }) {
|
|
173
187
|
let t = e.fontStyle ?? 0, [n, r] = [!!(t & 1), !!(t & 2)];
|
|
174
|
-
return /* @__PURE__ */
|
|
175
|
-
...c.props(
|
|
188
|
+
return /* @__PURE__ */ m("span", {
|
|
189
|
+
...c.props(E.token(e.color ?? i.ink), n && E.italic, r && E.bold),
|
|
176
190
|
children: e.content
|
|
177
191
|
});
|
|
178
192
|
}
|
|
179
|
-
function
|
|
180
|
-
let v = r ?? (i === void 0 ? "text" :
|
|
193
|
+
function k({ code: t, variant: n = "default", language: r, filename: i, isStreaming: a = !1, shouldWrap: l = !1, showLineNumbers: u = !0, selectedLines: d, annotations: f = [], maxHeight: p = 400, maxLines: _ = 2e3 }) {
|
|
194
|
+
let v = r ?? (i === void 0 ? "text" : g(i)), b = w(t, v), x = o(), S = t.slice(0, D).split(/\r\n|\n|\r/u), C = S.slice(0, Math.max(1, _)).map((e, t) => ({
|
|
181
195
|
text: e,
|
|
182
196
|
line: t + 1
|
|
183
|
-
})),
|
|
184
|
-
return /* @__PURE__ */
|
|
197
|
+
})), T = i ?? v, k = n === "embedded";
|
|
198
|
+
return /* @__PURE__ */ h(y, {
|
|
199
|
+
kind: "code",
|
|
185
200
|
"aria-label": i ?? "Code",
|
|
186
|
-
...c.props(s.root,
|
|
201
|
+
...c.props(s.root, k && s.embedded),
|
|
187
202
|
children: [
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
...c.props(s.header,
|
|
190
|
-
children: [/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ h("div", {
|
|
204
|
+
...c.props(s.header, k && s.embeddedHeader),
|
|
205
|
+
children: [/* @__PURE__ */ h("span", {
|
|
191
206
|
...c.props(s.label),
|
|
192
|
-
children: [
|
|
193
|
-
}), /* @__PURE__ */
|
|
207
|
+
children: [T, a && !k && " · streaming"]
|
|
208
|
+
}), /* @__PURE__ */ m(e, {
|
|
194
209
|
label: i ?? "code",
|
|
195
210
|
value: t,
|
|
196
|
-
display:
|
|
211
|
+
display: k ? "icon" : "value",
|
|
197
212
|
children: "Copy"
|
|
198
213
|
})]
|
|
199
214
|
}),
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
ref:
|
|
215
|
+
/* @__PURE__ */ m("div", {
|
|
216
|
+
ref: x.ref,
|
|
202
217
|
role: "region",
|
|
203
|
-
"aria-label": `${
|
|
204
|
-
tabIndex:
|
|
205
|
-
...c.props(s.scrollRegion,
|
|
206
|
-
children: /* @__PURE__ */
|
|
218
|
+
"aria-label": `${T} source`,
|
|
219
|
+
tabIndex: x.tabIndex,
|
|
220
|
+
...c.props(s.scrollRegion, E.viewport(p)),
|
|
221
|
+
children: /* @__PURE__ */ m("pre", {
|
|
207
222
|
...{
|
|
208
223
|
0: { className: "x1ghz6dp xn9t2bk xiard35 xy8obcc x1778rvt xeq4nuv xk8lq53" },
|
|
209
224
|
1: { className: "x1ghz6dp xn9t2bk xiard35 xy8obcc x1778rvt xeq4nuv xeuugli x126k92a xj0a0fe" }
|
|
210
225
|
}[!!l | 0],
|
|
211
|
-
children: /* @__PURE__ */
|
|
226
|
+
children: /* @__PURE__ */ m("code", {
|
|
212
227
|
className: "xjb2p0i",
|
|
213
|
-
children:
|
|
214
|
-
let n = b === void 0 ? void 0 : b.lines[t - 1], r = d !== void 0 && t >= d.start && t <= (d.end ?? d.start), i =
|
|
215
|
-
return /* @__PURE__ */
|
|
228
|
+
children: C.map(({ text: e, line: t }) => {
|
|
229
|
+
let n = b === void 0 ? void 0 : b.lines[t - 1], r = d !== void 0 && t >= d.start && t <= (d.end ?? d.start), i = f.find((e) => e.line === t);
|
|
230
|
+
return /* @__PURE__ */ h("span", { children: [/* @__PURE__ */ h("span", {
|
|
216
231
|
...{
|
|
217
232
|
0: { className: "x78zum5 x16exltd" },
|
|
218
233
|
1: { className: "x78zum5 x16exltd x1r8u7ye" }
|
|
219
234
|
}[!!r | 0],
|
|
220
|
-
children: [u && /* @__PURE__ */
|
|
235
|
+
children: [u && /* @__PURE__ */ m("span", {
|
|
221
236
|
"aria-hidden": !0,
|
|
222
237
|
className: "x1rg5ohu x2lah0s xl3ry0p x5g2kb4 xp4054r x153jb6y x87ps6o",
|
|
223
238
|
children: t
|
|
224
|
-
}), /* @__PURE__ */
|
|
239
|
+
}), /* @__PURE__ */ h("span", {
|
|
225
240
|
className: "x1lliihq x12lumcd x1doqdfy xeuugli",
|
|
226
|
-
children: [n === void 0 ? e : n.map((e) => /* @__PURE__ */
|
|
241
|
+
children: [n === void 0 ? e : n.map((e) => /* @__PURE__ */ m(O, { token: e }, e.offset)), e.length === 0 && "\n"]
|
|
227
242
|
})]
|
|
228
|
-
}), i !== void 0 && /* @__PURE__ */
|
|
243
|
+
}), i !== void 0 && /* @__PURE__ */ m("span", {
|
|
229
244
|
className: "x1lliihq x9f619 x7wzq59 x1o0tod xzfn7dr x1mvvolr x1r7kqkb x1hz01jw xtqrqnz x1778rvt xeaf4i8 xj0a0fe",
|
|
230
245
|
children: i.content
|
|
231
246
|
})] }, t);
|
|
@@ -233,23 +248,23 @@ function w({ code: t, variant: n = "default", language: r, filename: i, isStream
|
|
|
233
248
|
})
|
|
234
249
|
})
|
|
235
250
|
}),
|
|
236
|
-
|
|
251
|
+
S.length > C.length && /* @__PURE__ */ m("div", {
|
|
237
252
|
...c.props(s.note),
|
|
238
253
|
children: "Additional lines omitted. Copy includes the complete source."
|
|
239
254
|
}),
|
|
240
|
-
t.length >
|
|
255
|
+
t.length > D && /* @__PURE__ */ m("div", {
|
|
241
256
|
...c.props(s.note),
|
|
242
257
|
children: "Preview limited to the first 200,000 characters. Copy includes the complete source."
|
|
243
258
|
}),
|
|
244
|
-
t.length === 0 && /* @__PURE__ */
|
|
259
|
+
t.length === 0 && /* @__PURE__ */ m("div", {
|
|
245
260
|
...c.props(s.note),
|
|
246
261
|
children: "No source text."
|
|
247
262
|
}),
|
|
248
|
-
b !== void 0 && b.hasFailed && /* @__PURE__ */
|
|
263
|
+
b !== void 0 && b.hasFailed && /* @__PURE__ */ m("div", {
|
|
249
264
|
...c.props(s.note),
|
|
250
265
|
children: "Syntax highlighting unavailable. The source is shown unchanged."
|
|
251
266
|
})
|
|
252
267
|
]
|
|
253
268
|
});
|
|
254
269
|
}
|
|
255
|
-
export {
|
|
270
|
+
export { y as i, b as n, x as r, k as t };
|