@mechane-ai/elements 0.36.0 → 0.38.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 +8 -6
- package/dist/ai.js +3 -3
- package/dist/{chart-theme-Bwr9YSP1.js → categorical-values-BECG-J6R.js} +4 -54
- package/dist/{chart-frame-C0UBu4ku.js → chart-frame-CJFnI39T.js} +78 -93
- package/dist/{chart-input-Ccr2NJ6J.js → chart-input-DwAobO8Y.js} +2 -2
- package/dist/chart-navigation-CBIeNtJq.js +67 -0
- package/dist/charts/cartesian.js +631 -618
- package/dist/charts/distribution.js +298 -267
- package/dist/charts/graph.js +113 -122
- package/dist/charts/hierarchy.js +12 -12
- package/dist/charts/matrix.js +208 -200
- package/dist/charts/timeline.js +2 -2
- package/dist/charts.js +3 -3
- package/dist/{code-block-DT1TCkTC.js → code-block-aC0Htt4N.js} +33 -32
- package/dist/collections.js +597 -351
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +1 -1
- package/dist/content/markdown.js +1 -1
- package/dist/content.js +1 -1
- package/dist/elements.css +22 -2
- package/dist/feedback.js +1 -1
- package/dist/navigation/commands.js +4 -3
- package/dist/packages/charts/src/chart-data.d.ts +13 -3
- package/dist/packages/charts/src/chart-frame.d.ts +2 -5
- package/dist/packages/charts/src/chart-navigation.d.ts +19 -0
- package/dist/packages/charts/src/distribution/distribution-plot.d.ts +4 -2
- package/dist/packages/collections/src/collection-filters.d.ts +20 -0
- package/dist/packages/collections/src/data-table.d.ts +4 -6
- package/dist/packages/collections/src/index.d.ts +4 -0
- package/dist/packages/collections/src/use-collection-controls.d.ts +30 -0
- package/dist/packages/feedback/src/index.d.ts +2 -2
- package/dist/packages/feedback/src/notifications.d.ts +35 -0
- package/dist/packages/feedback/src/toast.d.ts +1 -1
- package/dist/packages/navigation/src/commands/command.d.ts +1 -0
- package/dist/plot-width-BQQS-mw9.js +67 -0
- package/dist/{src-D9DktxEq.js → src-DWjAoOyd.js} +1 -1
- package/dist/{src-DXdsMc_Z.js → src-nkgFDl-g.js} +246 -207
- package/package.json +1 -1
- package/dist/plot-width--OgdohB5.js +0 -18
|
@@ -6,9 +6,10 @@ import { t as i } from "./pierre-theme-BpNaWn1x.js";
|
|
|
6
6
|
import * as a from "@stylexjs/stylex";
|
|
7
7
|
import { useEffect as o, useRef as s, useState as c } from "react";
|
|
8
8
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
+
import { getFiletypeFromFileName as d } from "@pierre/diffs";
|
|
9
10
|
// packages/content/src/code/use-highlighted-code.ts
|
|
10
|
-
var
|
|
11
|
-
function
|
|
11
|
+
var f = 2e5, p = 4096;
|
|
12
|
+
function m(e, t) {
|
|
12
13
|
let n = s(null), [r, a] = c();
|
|
13
14
|
return o(() => () => {
|
|
14
15
|
n.current !== null && (n.current.tokenizer.dispose(), n.current = null);
|
|
@@ -17,7 +18,7 @@ function p(e, t) {
|
|
|
17
18
|
async function o() {
|
|
18
19
|
try {
|
|
19
20
|
let o = await import("@pierre/highlights");
|
|
20
|
-
if (!r || e.length >
|
|
21
|
+
if (!r || e.length > f || !o.isSupportedLanguage(t)) return;
|
|
21
22
|
let s = n.current, c = s !== null && s.language === t, l = c ? s : {
|
|
22
23
|
language: t,
|
|
23
24
|
source: e,
|
|
@@ -25,7 +26,7 @@ function p(e, t) {
|
|
|
25
26
|
code: e,
|
|
26
27
|
lang: t,
|
|
27
28
|
theme: i,
|
|
28
|
-
tokenizeMaxLineLength:
|
|
29
|
+
tokenizeMaxLineLength: p
|
|
29
30
|
})
|
|
30
31
|
};
|
|
31
32
|
if (c) {
|
|
@@ -49,11 +50,11 @@ function p(e, t) {
|
|
|
49
50
|
};
|
|
50
51
|
let u = l.tokenizer;
|
|
51
52
|
u.flush();
|
|
52
|
-
let
|
|
53
|
+
let d = Array.from({ length: u.lineCount }, (e, t) => u.getLineTokens(t).tokens);
|
|
53
54
|
a({
|
|
54
55
|
code: e,
|
|
55
56
|
language: t,
|
|
56
|
-
lines:
|
|
57
|
+
lines: d,
|
|
57
58
|
hasFailed: !1
|
|
58
59
|
});
|
|
59
60
|
} catch {
|
|
@@ -71,13 +72,13 @@ function p(e, t) {
|
|
|
71
72
|
}, [e, t]), r !== void 0 && r.code === e && r.language === t ? r : void 0;
|
|
72
73
|
}
|
|
73
74
|
// packages/content/src/code/code-block.tsx
|
|
74
|
-
var
|
|
75
|
+
var h = {
|
|
75
76
|
kVQacm: "xysyzu8",
|
|
76
77
|
k9g6sI: "x12h1iku",
|
|
77
78
|
$$css: !0
|
|
78
|
-
},
|
|
79
|
+
}, g = {
|
|
79
80
|
viewport: (e) => [
|
|
80
|
-
|
|
81
|
+
h,
|
|
81
82
|
{
|
|
82
83
|
kskxy: e == null ? e : "x1jols5v",
|
|
83
84
|
$$css: !0
|
|
@@ -96,62 +97,62 @@ var m = {
|
|
|
96
97
|
k63SB2: "x1b5ytql",
|
|
97
98
|
$$css: !0
|
|
98
99
|
}
|
|
99
|
-
},
|
|
100
|
-
function
|
|
100
|
+
}, _ = 2e5;
|
|
101
|
+
function v({ token: e }) {
|
|
101
102
|
let n = e.fontStyle ?? 0, [r, i] = [!!(n & 1), !!(n & 2)];
|
|
102
103
|
return /* @__PURE__ */ l("span", {
|
|
103
|
-
...a.props(
|
|
104
|
+
...a.props(g.token(e.color ?? t.ink), r && g.italic, i && g.bold),
|
|
104
105
|
children: e.content
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
|
-
function
|
|
108
|
-
let
|
|
108
|
+
function y({ code: t, variant: i = "default", language: o, filename: s, isStreaming: c = !1, shouldWrap: f = !1, showLineNumbers: p = !0, selectedLines: h, annotations: y = [], maxHeight: b = 400, maxLines: x = 2e3 }) {
|
|
109
|
+
let S = o ?? (s === void 0 ? "text" : d(s)), C = m(t, S), w = n(), T = t.slice(0, _).split(/\r\n|\n|\r/u), E = T.slice(0, Math.max(1, x)).map((e, t) => ({
|
|
109
110
|
text: e,
|
|
110
111
|
line: t + 1
|
|
111
|
-
})),
|
|
112
|
+
})), D = s ?? S, O = i === "embedded";
|
|
112
113
|
return /* @__PURE__ */ u("section", {
|
|
113
114
|
"aria-label": s ?? "Code",
|
|
114
|
-
...a.props(r.root,
|
|
115
|
+
...a.props(r.root, O && r.embedded),
|
|
115
116
|
children: [
|
|
116
117
|
/* @__PURE__ */ u("div", {
|
|
117
|
-
...a.props(r.header,
|
|
118
|
+
...a.props(r.header, O && r.embeddedHeader),
|
|
118
119
|
children: [/* @__PURE__ */ u("span", {
|
|
119
120
|
...a.props(r.label),
|
|
120
|
-
children: [
|
|
121
|
+
children: [D, c && !O && " · streaming"]
|
|
121
122
|
}), /* @__PURE__ */ l(e, {
|
|
122
123
|
label: s ?? "code",
|
|
123
124
|
value: t,
|
|
124
|
-
display:
|
|
125
|
+
display: O ? "icon" : "value",
|
|
125
126
|
children: "Copy"
|
|
126
127
|
})]
|
|
127
128
|
}),
|
|
128
129
|
/* @__PURE__ */ l("div", {
|
|
129
|
-
ref:
|
|
130
|
+
ref: w.ref,
|
|
130
131
|
role: "region",
|
|
131
|
-
"aria-label": `${
|
|
132
|
-
tabIndex:
|
|
133
|
-
...a.props(r.scrollRegion,
|
|
132
|
+
"aria-label": `${D} source`,
|
|
133
|
+
tabIndex: w.tabIndex,
|
|
134
|
+
...a.props(r.scrollRegion, g.viewport(b)),
|
|
134
135
|
children: /* @__PURE__ */ l("pre", {
|
|
135
136
|
...{
|
|
136
137
|
0: { className: "x1ghz6dp xn9t2bk xiard35 xy8obcc x1778rvt xeq4nuv xk8lq53" },
|
|
137
138
|
1: { className: "x1ghz6dp xn9t2bk xiard35 xy8obcc x1778rvt xeq4nuv xeuugli x126k92a xj0a0fe" }
|
|
138
|
-
}[!!
|
|
139
|
+
}[!!f | 0],
|
|
139
140
|
children: /* @__PURE__ */ l("code", {
|
|
140
141
|
className: "xjb2p0i",
|
|
141
|
-
children:
|
|
142
|
-
let n =
|
|
142
|
+
children: E.map(({ text: e, line: t }) => {
|
|
143
|
+
let n = C === void 0 ? void 0 : C.lines[t - 1], r = h !== void 0 && t >= h.start && t <= (h.end ?? h.start), i = y.find((e) => e.line === t);
|
|
143
144
|
return /* @__PURE__ */ u("span", { children: [/* @__PURE__ */ u("span", {
|
|
144
145
|
...{
|
|
145
146
|
0: { className: "x78zum5 x16exltd" },
|
|
146
147
|
1: { className: "x78zum5 x16exltd x1r8u7ye" }
|
|
147
148
|
}[!!r | 0],
|
|
148
|
-
children: [
|
|
149
|
+
children: [p && /* @__PURE__ */ l("span", {
|
|
149
150
|
"aria-hidden": !0,
|
|
150
151
|
className: "x1rg5ohu x2lah0s xl3ry0p x5g2kb4 xp4054r x153jb6y x87ps6o",
|
|
151
152
|
children: t
|
|
152
153
|
}), /* @__PURE__ */ u("span", {
|
|
153
154
|
className: "x1lliihq x12lumcd x1doqdfy xeuugli",
|
|
154
|
-
children: [n === void 0 ? e : n.map((e) => /* @__PURE__ */ l(
|
|
155
|
+
children: [n === void 0 ? e : n.map((e) => /* @__PURE__ */ l(v, { token: e }, e.offset)), e.length === 0 && "\n"]
|
|
155
156
|
})]
|
|
156
157
|
}), i !== void 0 && /* @__PURE__ */ l("span", {
|
|
157
158
|
className: "x1lliihq x9f619 x7wzq59 x1o0tod xzfn7dr x1mvvolr x1r7kqkb x1hz01jw xtqrqnz x1778rvt xeaf4i8 xj0a0fe",
|
|
@@ -161,11 +162,11 @@ function v({ code: t, variant: i = "default", language: o = "text", filename: s,
|
|
|
161
162
|
})
|
|
162
163
|
})
|
|
163
164
|
}),
|
|
164
|
-
|
|
165
|
+
T.length > E.length && /* @__PURE__ */ l("div", {
|
|
165
166
|
...a.props(r.note),
|
|
166
167
|
children: "Additional lines omitted. Copy includes the complete source."
|
|
167
168
|
}),
|
|
168
|
-
t.length >
|
|
169
|
+
t.length > _ && /* @__PURE__ */ l("div", {
|
|
169
170
|
...a.props(r.note),
|
|
170
171
|
children: "Preview limited to the first 200,000 characters. Copy includes the complete source."
|
|
171
172
|
}),
|
|
@@ -173,11 +174,11 @@ function v({ code: t, variant: i = "default", language: o = "text", filename: s,
|
|
|
173
174
|
...a.props(r.note),
|
|
174
175
|
children: "No source text."
|
|
175
176
|
}),
|
|
176
|
-
|
|
177
|
+
C !== void 0 && C.hasFailed && /* @__PURE__ */ l("div", {
|
|
177
178
|
...a.props(r.note),
|
|
178
179
|
children: "Syntax highlighting unavailable. The source is shown unchanged."
|
|
179
180
|
})
|
|
180
181
|
]
|
|
181
182
|
});
|
|
182
183
|
}
|
|
183
|
-
export {
|
|
184
|
+
export { y as t };
|