@mechane-ai/elements 0.18.0 → 0.20.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 +11 -3
- package/dist/ai.js +211 -169
- package/dist/{categorical-values-D-sSI9JB.js → categorical-values-Cf-zlA1u.js} +2 -2
- package/dist/{chart-frame-vwS7YVgv.js → chart-frame-Cf6LBA8M.js} +1 -1
- package/dist/{chart-input-D6Fw2UGV.js → chart-input-BTDzeBQU.js} +2 -2
- package/dist/charts/cartesian.js +6 -6
- package/dist/charts/distribution.js +2 -2
- package/dist/charts/graph.js +2 -2
- package/dist/charts/hierarchy.js +3 -3
- package/dist/charts/matrix.js +2 -2
- package/dist/charts/timeline.js +2 -2
- package/dist/charts.js +1 -1
- package/dist/{code-block-DB42-a0M.js → code-block-D1_kzPrs.js} +2 -2
- package/dist/collections.js +4 -4
- package/dist/{constants.stylex-bbdiv1fD.js → constants.stylex-BILvnwUk.js} +1 -0
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +3 -3
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +134 -132
- package/dist/content/tree.js +2 -2
- package/dist/{content-link-rdxJ94P8.js → content-link-BIMrgXbz.js} +1 -1
- package/dist/content.js +3 -3
- package/dist/elements.css +105 -0
- package/dist/feedback.js +1 -1
- package/dist/forms/dates.js +1 -1
- package/dist/forms.js +1 -1
- package/dist/index.js +1 -1
- package/dist/layout.js +342 -207
- package/dist/navigation/commands.js +1 -1
- package/dist/packages/ai/src/index.d.ts +2 -0
- package/dist/packages/ai/src/message.d.ts +2 -1
- package/dist/packages/ai/src/reply-indicator.d.ts +6 -0
- package/dist/packages/content/src/markdown/markdown.d.ts +1 -1
- package/dist/packages/feedback/src/async-region.d.ts +3 -1
- package/dist/packages/forms/src/field-styles.d.ts +6 -0
- package/dist/packages/forms/src/forms.d.ts +2 -1
- package/dist/packages/foundations/src/constants.stylex.d.ts +1 -0
- package/dist/packages/foundations/src/visible-motion.d.ts +4 -0
- package/dist/packages/layout/src/app-shell.d.ts +2 -1
- package/dist/packages/layout/src/index.d.ts +2 -0
- package/dist/packages/layout/src/navigation-rail.d.ts +18 -0
- package/dist/packages/layout/src/sidebar.d.ts +2 -1
- package/dist/{pierre-diff-C_j0nxwS.js → pierre-diff-hAwARDse.js} +1 -1
- package/dist/{pierre-theme-BUeJim8s.js → pierre-theme-CLgk9v3e.js} +1 -1
- package/dist/{pierre-tree-BaIVTNmG.js → pierre-tree-D3XsgEH6.js} +4 -4
- package/dist/{src-BVsyKLQ8.js → src-0mocxTaR.js} +64 -43
- package/dist/{src-R0kgHFPZ.js → src-D4zPPr32.js} +20 -13
- package/dist/{src-BXh4g2VY.js → src-qU5Z5LRH.js} +1 -0
- package/dist/tokens.js +1 -1
- package/dist/visible-motion-1GcUaEi4.js +23 -0
- package/package.json +1 -1
- package/packages/foundations/src/constants.stylex.ts +1 -1
package/dist/ai.js
CHANGED
|
@@ -1,72 +1,73 @@
|
|
|
1
|
-
import { C as e, E as t, O as n, T as r, f as i, g as a, p as o, t as s, w as c } from "./src-
|
|
2
|
-
import { t as l } from "./content-link-
|
|
1
|
+
import { C as e, E as t, O as n, T as r, f as i, g as a, p as o, t as s, w as c } from "./src-qU5Z5LRH.js";
|
|
2
|
+
import { t as l } from "./content-link-BIMrgXbz.js";
|
|
3
3
|
import { r as u, t as d } from "./src-d7EAi61b.js";
|
|
4
|
-
import { c as f, d as p } from "./src-
|
|
5
|
-
import { c as m, u as h } from "./src-
|
|
4
|
+
import { c as f, d as p } from "./src-0mocxTaR.js";
|
|
5
|
+
import { c as m, u as h } from "./src-D4zPPr32.js";
|
|
6
6
|
import { t as g } from "./accessibility-C-aIZ1Yx.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { t as _ } from "./visible-motion-1GcUaEi4.js";
|
|
8
|
+
import * as v from "@stylexjs/stylex";
|
|
9
|
+
import { createContext as y, useContext as b, useEffect as x, useId as ee, useLayoutEffect as S, useRef as C, useState as w } from "react";
|
|
10
|
+
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
11
|
+
import { ArrowDown as D, ArrowUp as O, File as k, GitBranch as A, Square as j } from "lucide-react";
|
|
12
|
+
import { MessageScroller as M, useMessageScroller as N, useMessageScrollerScrollable as P } from "@shadcn/react/message-scroller";
|
|
12
13
|
// packages/ai/src/approval.tsx
|
|
13
|
-
function
|
|
14
|
-
return /* @__PURE__ */
|
|
14
|
+
function F(t) {
|
|
15
|
+
return /* @__PURE__ */ E("section", {
|
|
15
16
|
"aria-label": t.title,
|
|
16
17
|
"data-request-id": t.requestId,
|
|
17
18
|
className: "x78zum5 xdt5ytf x1n8ia3y xeuugli x1c8xbx5 xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
18
19
|
children: [
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ T("h3", {
|
|
20
21
|
className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
|
|
21
22
|
children: t.title
|
|
22
23
|
}),
|
|
23
|
-
t.description !== void 0 && /* @__PURE__ */
|
|
24
|
+
t.description !== void 0 && /* @__PURE__ */ T("p", {
|
|
24
25
|
className: "x1ghz6dp x153jb6y xj0a0fe",
|
|
25
26
|
children: t.description
|
|
26
27
|
}),
|
|
27
28
|
t.children,
|
|
28
|
-
t.status === "pending" ? /* @__PURE__ */
|
|
29
|
+
t.status === "pending" ? /* @__PURE__ */ E(i, { children: [/* @__PURE__ */ T(e, {
|
|
29
30
|
variant: "solid",
|
|
30
31
|
onClick: t.onApprove,
|
|
31
32
|
disabled: t.isDisabled === !0 || t.busy !== void 0,
|
|
32
33
|
isPending: t.busy === "approve",
|
|
33
34
|
pendingLabel: "Approving…",
|
|
34
35
|
children: t.approveLabel ?? "Approve"
|
|
35
|
-
}), /* @__PURE__ */
|
|
36
|
+
}), /* @__PURE__ */ T(e, {
|
|
36
37
|
onClick: t.onDeny,
|
|
37
38
|
disabled: t.isDisabled === !0 || t.busy !== void 0,
|
|
38
39
|
isPending: t.busy === "deny",
|
|
39
40
|
pendingLabel: "Denying…",
|
|
40
41
|
children: t.denyLabel ?? "Deny"
|
|
41
|
-
})] }) : /* @__PURE__ */
|
|
42
|
+
})] }) : /* @__PURE__ */ T(s, { children: t.statusLabel })
|
|
42
43
|
]
|
|
43
44
|
});
|
|
44
45
|
}
|
|
45
46
|
// packages/ai/src/conversation.tsx
|
|
46
|
-
var
|
|
47
|
-
function
|
|
48
|
-
let i =
|
|
49
|
-
return
|
|
47
|
+
var I = y(void 0);
|
|
48
|
+
function L({ children: e, initialPosition: t = "end", shouldFollow: n = !0, viewportRef: r }) {
|
|
49
|
+
let i = C(null), a = r ?? i, [o] = w(t);
|
|
50
|
+
return S(() => {
|
|
50
51
|
typeof o == "object" && a.current?.scrollTo({
|
|
51
52
|
top: o.top,
|
|
52
53
|
left: o.left ?? 0,
|
|
53
54
|
behavior: "instant"
|
|
54
55
|
});
|
|
55
|
-
}, [o, a]), /* @__PURE__ */
|
|
56
|
+
}, [o, a]), /* @__PURE__ */ T(I.Provider, {
|
|
56
57
|
value: a,
|
|
57
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ T(M.Provider, {
|
|
58
59
|
autoScroll: n,
|
|
59
60
|
defaultScrollPosition: typeof o == "object" ? "start" : o,
|
|
60
|
-
children: /* @__PURE__ */
|
|
61
|
+
children: /* @__PURE__ */ T(M.Root, {
|
|
61
62
|
className: "x1n2onr6 x78zum5 xdt5ytf x5yr21d x2lwn1j xeuugli xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
62
63
|
children: e
|
|
63
64
|
})
|
|
64
65
|
})
|
|
65
66
|
});
|
|
66
67
|
}
|
|
67
|
-
function
|
|
68
|
-
let r =
|
|
69
|
-
return /* @__PURE__ */
|
|
68
|
+
function R({ label: e, children: t, scrollRestorationId: n }) {
|
|
69
|
+
let r = b(I);
|
|
70
|
+
return /* @__PURE__ */ T(M.Viewport, {
|
|
70
71
|
ref: r,
|
|
71
72
|
"aria-label": e,
|
|
72
73
|
"data-scroll-restoration-id": n,
|
|
@@ -74,8 +75,8 @@ function L({ label: e, children: t, scrollRestorationId: n }) {
|
|
|
74
75
|
children: t
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
-
return /* @__PURE__ */
|
|
78
|
+
function z({ children: e, isStreaming: t = !1 }) {
|
|
79
|
+
return /* @__PURE__ */ T(M.Content, {
|
|
79
80
|
"aria-live": "polite",
|
|
80
81
|
"aria-relevant": "additions",
|
|
81
82
|
"aria-busy": t,
|
|
@@ -83,50 +84,50 @@ function R({ children: e, isStreaming: t = !1 }) {
|
|
|
83
84
|
children: e
|
|
84
85
|
});
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
-
return /* @__PURE__ */
|
|
87
|
+
function B({ messageId: e, children: t }) {
|
|
88
|
+
return /* @__PURE__ */ T(M.Item, {
|
|
88
89
|
messageId: e,
|
|
89
90
|
className: "xeuugli xj0a0fe",
|
|
90
91
|
children: t
|
|
91
92
|
});
|
|
92
93
|
}
|
|
93
|
-
function
|
|
94
|
-
return /* @__PURE__ */
|
|
94
|
+
function V({ children: e }) {
|
|
95
|
+
return /* @__PURE__ */ T("div", {
|
|
95
96
|
className: "x9f619 x2lah0s xeuugli xh8yej3 xe10afn xvueqy4 xn9t2bk x1m92p3w",
|
|
96
97
|
children: e
|
|
97
98
|
});
|
|
98
99
|
}
|
|
99
|
-
function
|
|
100
|
-
let { end: t } =
|
|
101
|
-
return t ? /* @__PURE__ */
|
|
100
|
+
function H({ label: e = "Jump to latest" }) {
|
|
101
|
+
let { end: t } = P();
|
|
102
|
+
return t ? /* @__PURE__ */ T("div", {
|
|
102
103
|
className: "x10l6tqk xwthv0x x1nrll8i xuuh30 x1tv4vx4 xeuugli",
|
|
103
|
-
children: /* @__PURE__ */
|
|
104
|
+
children: /* @__PURE__ */ T(U, { label: e })
|
|
104
105
|
}) : null;
|
|
105
106
|
}
|
|
106
|
-
function
|
|
107
|
-
let { scrollToEnd: r } =
|
|
108
|
-
return /* @__PURE__ */
|
|
107
|
+
function U({ label: t, onActivate: n }) {
|
|
108
|
+
let { scrollToEnd: r } = N(), i = b(I);
|
|
109
|
+
return /* @__PURE__ */ E(e, {
|
|
109
110
|
onClick: () => {
|
|
110
111
|
n?.(), requestAnimationFrame(() => {
|
|
111
112
|
let e = i?.current;
|
|
112
113
|
e != null && (r({ behavior: "instant" }), e.focus({ preventScroll: !0 }));
|
|
113
114
|
});
|
|
114
115
|
},
|
|
115
|
-
children: [/* @__PURE__ */
|
|
116
|
+
children: [/* @__PURE__ */ T(D, {
|
|
116
117
|
size: 14,
|
|
117
118
|
"aria-hidden": !0
|
|
118
119
|
}), t]
|
|
119
120
|
});
|
|
120
121
|
}
|
|
121
|
-
var
|
|
122
|
-
Root:
|
|
123
|
-
Viewport:
|
|
124
|
-
Content:
|
|
125
|
-
Item:
|
|
126
|
-
Controls:
|
|
127
|
-
LatestButton:
|
|
128
|
-
JumpToLatest:
|
|
129
|
-
},
|
|
122
|
+
var W = {
|
|
123
|
+
Root: L,
|
|
124
|
+
Viewport: R,
|
|
125
|
+
Content: z,
|
|
126
|
+
Item: B,
|
|
127
|
+
Controls: V,
|
|
128
|
+
LatestButton: U,
|
|
129
|
+
JumpToLatest: H
|
|
130
|
+
}, G = {
|
|
130
131
|
root: {
|
|
131
132
|
k1xSpc: "x78zum5",
|
|
132
133
|
kXwgrk: "xdt5ytf",
|
|
@@ -146,78 +147,86 @@ var U = {
|
|
|
146
147
|
kWkggS: "x1r7kqkb",
|
|
147
148
|
$$css: !0
|
|
148
149
|
},
|
|
150
|
+
bubble: {
|
|
151
|
+
kzqmXN: "xeq5yr9",
|
|
152
|
+
ks0D6T: "x17na0u1",
|
|
153
|
+
keTefX: "xvc5jky",
|
|
154
|
+
kaIpWk: "xy32g2j",
|
|
155
|
+
$$css: !0
|
|
156
|
+
},
|
|
149
157
|
assistant: { $$css: !0 },
|
|
150
158
|
system: {
|
|
151
159
|
kMwMTN: "x153jb6y",
|
|
152
160
|
k8WAf4: "xn9t2bk",
|
|
153
161
|
$$css: !0
|
|
154
162
|
}
|
|
155
|
-
}, G = {
|
|
156
|
-
user: W.user,
|
|
157
|
-
assistant: W.assistant,
|
|
158
|
-
system: W.system
|
|
159
163
|
}, K = {
|
|
164
|
+
user: G.user,
|
|
165
|
+
assistant: G.assistant,
|
|
166
|
+
system: G.system
|
|
167
|
+
}, q = {
|
|
160
168
|
"x-default-marker": "x-default-marker",
|
|
161
169
|
$$css: !0
|
|
162
170
|
};
|
|
163
|
-
function
|
|
164
|
-
|
|
171
|
+
function J({ author: e, children: t, id: n, kind: r = "assistant", meta: i, avatar: a, actions: o, attachments: s, variant: c = "default" }) {
|
|
172
|
+
let l = c === "chat" && r === "user", u = c === "default" || a !== void 0 || i !== void 0 ? /* @__PURE__ */ E("header", {
|
|
173
|
+
className: "x78zum5 x6s0dn4 x1hnptsi x1a02dak xeuugli",
|
|
174
|
+
children: [
|
|
175
|
+
a !== void 0 && /* @__PURE__ */ T("span", {
|
|
176
|
+
className: "x3nfvp2 x2lah0s",
|
|
177
|
+
children: a
|
|
178
|
+
}),
|
|
179
|
+
/* @__PURE__ */ T("span", {
|
|
180
|
+
className: "xk4h15q xeuugli xj0a0fe",
|
|
181
|
+
children: e
|
|
182
|
+
}),
|
|
183
|
+
i !== void 0 && /* @__PURE__ */ T("div", {
|
|
184
|
+
className: "x153jb6y xy8obcc xas2l8k xeuugli xj0a0fe",
|
|
185
|
+
children: i
|
|
186
|
+
})
|
|
187
|
+
]
|
|
188
|
+
}) : null;
|
|
189
|
+
return /* @__PURE__ */ E("article", {
|
|
165
190
|
id: n,
|
|
166
191
|
"aria-label": e,
|
|
167
|
-
...
|
|
192
|
+
...v.props(G.root, K[r], l && G.bubble, q),
|
|
168
193
|
children: [
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
children: [
|
|
172
|
-
a !== void 0 && /* @__PURE__ */ w("span", {
|
|
173
|
-
className: "x3nfvp2 x2lah0s",
|
|
174
|
-
children: a
|
|
175
|
-
}),
|
|
176
|
-
/* @__PURE__ */ w("span", {
|
|
177
|
-
className: "xk4h15q xeuugli xj0a0fe",
|
|
178
|
-
children: e
|
|
179
|
-
}),
|
|
180
|
-
i !== void 0 && /* @__PURE__ */ w("div", {
|
|
181
|
-
className: "x153jb6y xy8obcc xas2l8k xeuugli xj0a0fe",
|
|
182
|
-
children: i
|
|
183
|
-
})
|
|
184
|
-
]
|
|
185
|
-
}),
|
|
186
|
-
/* @__PURE__ */ w("div", {
|
|
194
|
+
u,
|
|
195
|
+
/* @__PURE__ */ T("div", {
|
|
187
196
|
className: "xeuugli xj0a0fe x1ytb0s6",
|
|
188
197
|
children: t
|
|
189
198
|
}),
|
|
190
|
-
s !== void 0 && /* @__PURE__ */
|
|
199
|
+
s !== void 0 && /* @__PURE__ */ T("div", {
|
|
191
200
|
className: "x78zum5 x1a02dak x1qjc9v5 x1hnptsi xeuugli",
|
|
192
201
|
children: s
|
|
193
202
|
}),
|
|
194
|
-
o !== void 0 && /* @__PURE__ */
|
|
203
|
+
o !== void 0 && /* @__PURE__ */ T("footer", {
|
|
195
204
|
className: "x78zum5 x1a02dak x6s0dn4 xeuugli xunmzkg x1hc1fzr x12vu8c0 xtf8l8m x1thm12b",
|
|
196
205
|
children: o
|
|
197
206
|
})
|
|
198
207
|
]
|
|
199
208
|
});
|
|
200
209
|
}
|
|
201
|
-
function
|
|
202
|
-
return /* @__PURE__ */
|
|
210
|
+
function Y({ name: e, description: t, href: n, actions: r }) {
|
|
211
|
+
return /* @__PURE__ */ E("div", {
|
|
203
212
|
className: "x78zum5 x1a02dak x6s0dn4 x1n8ia3y xeuugli x193iq5w x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
204
213
|
children: [
|
|
205
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ T(k, {
|
|
206
215
|
size: 16,
|
|
207
216
|
"aria-hidden": !0,
|
|
208
217
|
className: "x153jb6y x2lah0s"
|
|
209
218
|
}),
|
|
210
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ E("div", {
|
|
211
220
|
className: "x78zum5 xdt5ytf xfko13i x1slnebi xeuugli xj0a0fe",
|
|
212
|
-
children: [n === void 0 ? /* @__PURE__ */
|
|
221
|
+
children: [n === void 0 ? /* @__PURE__ */ T("span", { children: e }) : /* @__PURE__ */ T(l, {
|
|
213
222
|
href: n,
|
|
214
223
|
children: e
|
|
215
|
-
}), t !== void 0 && /* @__PURE__ */
|
|
224
|
+
}), t !== void 0 && /* @__PURE__ */ T("span", {
|
|
216
225
|
className: "x153jb6y xy8obcc xas2l8k xeuugli xj0a0fe",
|
|
217
226
|
children: t
|
|
218
227
|
})]
|
|
219
228
|
}),
|
|
220
|
-
r !== void 0 && /* @__PURE__ */
|
|
229
|
+
r !== void 0 && /* @__PURE__ */ T("div", {
|
|
221
230
|
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli",
|
|
222
231
|
children: r
|
|
223
232
|
})
|
|
@@ -225,184 +234,217 @@ function J({ name: e, description: t, href: n, actions: r }) {
|
|
|
225
234
|
});
|
|
226
235
|
}
|
|
227
236
|
// packages/ai/src/message-action.tsx
|
|
228
|
-
function
|
|
237
|
+
function X(e) {
|
|
229
238
|
if (e.kind === "link") {
|
|
230
239
|
let { kind: t, label: n, ...i } = e;
|
|
231
|
-
return /* @__PURE__ */
|
|
240
|
+
return /* @__PURE__ */ T(r, {
|
|
232
241
|
...i,
|
|
233
242
|
"aria-label": n
|
|
234
243
|
});
|
|
235
244
|
}
|
|
236
245
|
let { kind: t, label: n, ...i } = e;
|
|
237
|
-
return /* @__PURE__ */
|
|
246
|
+
return /* @__PURE__ */ T(c, {
|
|
238
247
|
...i,
|
|
239
248
|
variant: "ghost",
|
|
240
249
|
"aria-label": n
|
|
241
250
|
});
|
|
242
251
|
}
|
|
243
|
-
function
|
|
244
|
-
return /* @__PURE__ */
|
|
252
|
+
function Z(e) {
|
|
253
|
+
return /* @__PURE__ */ E(d.Root, { children: [/* @__PURE__ */ T(d.Trigger, { render: X(e) }), /* @__PURE__ */ T(d.Portal, { children: /* @__PURE__ */ T(d.Positioner, { children: /* @__PURE__ */ T(d.Popup, { children: e.label }) }) })] });
|
|
245
254
|
}
|
|
246
255
|
// packages/ai/src/message-boundary.tsx
|
|
247
|
-
function
|
|
248
|
-
return /* @__PURE__ */
|
|
256
|
+
function Q({ label: e, children: t }) {
|
|
257
|
+
return /* @__PURE__ */ E(a.Root, {
|
|
249
258
|
className: "xeuugli x1kbiq1m xykt701 xpu655y",
|
|
250
|
-
children: [/* @__PURE__ */
|
|
259
|
+
children: [/* @__PURE__ */ E(a.Trigger, {
|
|
251
260
|
className: "xlqzeqv x1hnptsi x153jb6y xy8obcc xas2l8k xj57cvi",
|
|
252
|
-
children: [/* @__PURE__ */
|
|
261
|
+
children: [/* @__PURE__ */ T(A, {
|
|
253
262
|
size: 14,
|
|
254
263
|
"aria-hidden": !0,
|
|
255
264
|
className: "x2lah0s"
|
|
256
|
-
}), /* @__PURE__ */
|
|
265
|
+
}), /* @__PURE__ */ T("span", {
|
|
257
266
|
className: "xeuugli xj0a0fe",
|
|
258
267
|
children: e
|
|
259
268
|
})]
|
|
260
|
-
}), /* @__PURE__ */
|
|
269
|
+
}), /* @__PURE__ */ T(a.Panel, {
|
|
261
270
|
className: "x153jb6y xy8obcc xas2l8k",
|
|
262
271
|
children: t
|
|
263
272
|
})]
|
|
264
273
|
});
|
|
265
274
|
}
|
|
266
275
|
// packages/ai/src/prompt-input.tsx
|
|
267
|
-
var
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
276
|
+
var $ = {
|
|
277
|
+
inlineInput: {
|
|
278
|
+
kUk6DE: "x12lumcd",
|
|
279
|
+
$$css: !0
|
|
280
|
+
},
|
|
281
|
+
action: {
|
|
282
|
+
keTefX: "xvc5jky",
|
|
283
|
+
$$css: !0
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
function te({ isCompact: e = !1 }) {
|
|
287
|
+
return /* @__PURE__ */ T("div", {
|
|
273
288
|
"aria-hidden": !0,
|
|
274
289
|
inert: !0,
|
|
275
290
|
className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
276
|
-
children: /* @__PURE__ */
|
|
291
|
+
children: /* @__PURE__ */ E("div", {
|
|
277
292
|
className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep",
|
|
278
|
-
children: [/* @__PURE__ */
|
|
279
|
-
...
|
|
280
|
-
children: /* @__PURE__ */
|
|
293
|
+
children: [/* @__PURE__ */ T("div", {
|
|
294
|
+
...v.props(n.base, n.field, n.textarea, n.plainTextarea),
|
|
295
|
+
children: /* @__PURE__ */ T(p, {
|
|
281
296
|
lines: e ? 1 : 2,
|
|
282
297
|
width: "22ch"
|
|
283
298
|
})
|
|
284
|
-
}), /* @__PURE__ */
|
|
299
|
+
}), /* @__PURE__ */ E("div", {
|
|
285
300
|
className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
301
|
+
children: [/* @__PURE__ */ T("div", {
|
|
287
302
|
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd xy8obcc xas2l8k",
|
|
288
|
-
children: /* @__PURE__ */
|
|
289
|
-
}), /* @__PURE__ */
|
|
303
|
+
children: /* @__PURE__ */ T(p, { width: "8ch" })
|
|
304
|
+
}), /* @__PURE__ */ T(f, {
|
|
290
305
|
isIconOnly: !0,
|
|
291
|
-
xstyle:
|
|
306
|
+
xstyle: $.action
|
|
292
307
|
})]
|
|
293
308
|
})]
|
|
294
309
|
})
|
|
295
310
|
});
|
|
296
311
|
}
|
|
297
|
-
function
|
|
298
|
-
let
|
|
299
|
-
|
|
300
|
-
function
|
|
312
|
+
function ne({ label: e, value: t, onValueChange: n, onSubmit: r, name: i = "prompt", placeholder: a, maxLength: o, required: s = !0, isPending: l = !1, disabled: u = !1, isSubmitDisabled: f = !1, submitLabel: p = "Send message", pendingLabel: _ = "Sending…", enterBehavior: y = "newline", isCompact: b = !1, description: x, error: S, controls: C, attachments: w, onStop: D, isStopPending: k = !1, stopLabel: A = "Stop response" }) {
|
|
313
|
+
let M = ee(), N = u, P = b && w === void 0 && C === void 0, F = !N && !l && !f, I = p;
|
|
314
|
+
D === void 0 ? l ? I = _ : y === "submit" && (I = `${p} · Enter`) : I = k ? "Stopping…" : A;
|
|
315
|
+
function L(e) {
|
|
301
316
|
if (y !== "submit" || e.key !== "Enter" || e.repeat) return;
|
|
302
317
|
let t = e.altKey || e.ctrlKey || e.metaKey;
|
|
303
|
-
e.shiftKey || t || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 || (e.preventDefault(),
|
|
318
|
+
e.shiftKey || t || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 || (e.preventDefault(), F && D === void 0 && e.currentTarget.form?.requestSubmit());
|
|
304
319
|
}
|
|
305
|
-
function
|
|
306
|
-
e.preventDefault(),
|
|
320
|
+
function R(e) {
|
|
321
|
+
e.preventDefault(), F && D === void 0 && r(e);
|
|
307
322
|
}
|
|
308
|
-
return /* @__PURE__ */
|
|
309
|
-
onSubmit:
|
|
323
|
+
return /* @__PURE__ */ T("form", {
|
|
324
|
+
onSubmit: R,
|
|
310
325
|
className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
311
|
-
children: /* @__PURE__ */
|
|
312
|
-
invalid:
|
|
326
|
+
children: /* @__PURE__ */ E(m.Root, {
|
|
327
|
+
invalid: S !== void 0,
|
|
313
328
|
children: [
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
-
...
|
|
329
|
+
/* @__PURE__ */ T(m.Label, {
|
|
330
|
+
...v.props(g.hidden),
|
|
316
331
|
children: e
|
|
317
332
|
}),
|
|
318
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ E("div", {
|
|
319
334
|
...{
|
|
320
335
|
0: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep" },
|
|
321
|
-
|
|
322
|
-
|
|
336
|
+
2: { className: "x78zum5 x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1q0g3np xuk3077 xn9t2bk" },
|
|
337
|
+
1: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1oddvo6" },
|
|
338
|
+
3: { className: "x78zum5 x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1q0g3np xuk3077 xn9t2bk x1oddvo6" }
|
|
339
|
+
}[!!P << 1 | S !== void 0],
|
|
323
340
|
children: [
|
|
324
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ T(h, {
|
|
325
342
|
appearance: "plain",
|
|
326
|
-
rows:
|
|
327
|
-
isCompact:
|
|
343
|
+
rows: b ? 1 : 2,
|
|
344
|
+
isCompact: b,
|
|
345
|
+
shouldGrow: P,
|
|
346
|
+
xstyle: P ? $.inlineInput : void 0,
|
|
328
347
|
name: i,
|
|
329
348
|
value: t,
|
|
330
349
|
onChange: (e) => n(e.currentTarget.value),
|
|
331
|
-
onKeyDown:
|
|
350
|
+
onKeyDown: L,
|
|
332
351
|
placeholder: a ?? e,
|
|
333
352
|
maxLength: o,
|
|
334
353
|
required: s,
|
|
335
354
|
disabled: u,
|
|
336
|
-
|
|
337
|
-
"aria-errormessage": C === void 0 ? void 0 : N
|
|
355
|
+
"aria-errormessage": S === void 0 ? void 0 : M
|
|
338
356
|
}),
|
|
339
|
-
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
|
|
342
|
-
|
|
357
|
+
w,
|
|
358
|
+
/* @__PURE__ */ E("div", {
|
|
359
|
+
...{
|
|
360
|
+
0: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi" },
|
|
361
|
+
1: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi x2lah0s" }
|
|
362
|
+
}[!!P | 0],
|
|
363
|
+
children: [C !== void 0 && /* @__PURE__ */ T("div", {
|
|
343
364
|
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd",
|
|
344
|
-
children:
|
|
345
|
-
}), /* @__PURE__ */
|
|
346
|
-
xstyle:
|
|
365
|
+
children: C
|
|
366
|
+
}), /* @__PURE__ */ E(d.Root, { children: [/* @__PURE__ */ T(d.Trigger, { render: D === void 0 ? /* @__PURE__ */ T(c, {
|
|
367
|
+
xstyle: $.action,
|
|
347
368
|
type: "submit",
|
|
348
369
|
variant: "solid",
|
|
349
|
-
"aria-label": l ?
|
|
370
|
+
"aria-label": l ? _ : p,
|
|
350
371
|
disabled: u || f,
|
|
351
372
|
isPending: l,
|
|
352
|
-
children: /* @__PURE__ */
|
|
373
|
+
children: /* @__PURE__ */ T(O, {
|
|
353
374
|
size: 16,
|
|
354
375
|
"aria-hidden": !0
|
|
355
376
|
})
|
|
356
|
-
}) : /* @__PURE__ */
|
|
357
|
-
xstyle:
|
|
377
|
+
}) : /* @__PURE__ */ T(c, {
|
|
378
|
+
xstyle: $.action,
|
|
358
379
|
type: "button",
|
|
359
|
-
"aria-label":
|
|
380
|
+
"aria-label": k ? "Stopping…" : A,
|
|
360
381
|
onClick: (e) => {
|
|
361
|
-
e.preventDefault(),
|
|
382
|
+
e.preventDefault(), D();
|
|
362
383
|
},
|
|
363
384
|
disabled: u,
|
|
364
|
-
isPending:
|
|
365
|
-
children: /* @__PURE__ */
|
|
385
|
+
isPending: k,
|
|
386
|
+
children: /* @__PURE__ */ T(j, {
|
|
366
387
|
size: 14,
|
|
367
388
|
"aria-hidden": !0
|
|
368
389
|
})
|
|
369
|
-
}) }), /* @__PURE__ */
|
|
390
|
+
}) }), /* @__PURE__ */ T(d.Portal, { children: /* @__PURE__ */ T(d.Positioner, { children: /* @__PURE__ */ T(d.Popup, { children: I }) }) })] })]
|
|
370
391
|
})
|
|
371
392
|
]
|
|
372
393
|
}),
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
id:
|
|
394
|
+
x !== void 0 && /* @__PURE__ */ T(m.Description, { children: x }),
|
|
395
|
+
S !== void 0 && /* @__PURE__ */ T(m.Error, {
|
|
396
|
+
id: M,
|
|
376
397
|
match: !0,
|
|
377
398
|
role: "alert",
|
|
378
|
-
children:
|
|
399
|
+
children: S
|
|
379
400
|
})
|
|
380
401
|
]
|
|
381
402
|
})
|
|
382
403
|
});
|
|
383
404
|
}
|
|
405
|
+
// packages/ai/src/reply-indicator.tsx
|
|
406
|
+
function re({ label: e, delayMs: t = 200, isAnimated: n = !0 }) {
|
|
407
|
+
let [r, i] = w(t === 0), { ref: a, isActive: o } = _(n && r);
|
|
408
|
+
return x(() => {
|
|
409
|
+
let e = setTimeout(() => i(!0), t);
|
|
410
|
+
return () => clearTimeout(e);
|
|
411
|
+
}, [t]), /* @__PURE__ */ T("div", {
|
|
412
|
+
ref: a,
|
|
413
|
+
className: "x153jb6y x1hz01jw xy8obcc xas2l8k",
|
|
414
|
+
children: r && /* @__PURE__ */ T("span", {
|
|
415
|
+
role: "status",
|
|
416
|
+
...{
|
|
417
|
+
0: {},
|
|
418
|
+
2: { className: "xslotfi x19hqrfe x1ta4xzc x19co3pv xe80r02 xil9x82 xegkacw xuij49y x4hg4is xoj058f x1wel5d5" },
|
|
419
|
+
1: { className: "xorstpt" },
|
|
420
|
+
3: { className: "xslotfi x19hqrfe x1ta4xzc x19co3pv xe80r02 xil9x82 xegkacw xuij49y x4hg4is xorstpt" }
|
|
421
|
+
}[!!n << 1 | !o],
|
|
422
|
+
children: e
|
|
423
|
+
})
|
|
424
|
+
});
|
|
425
|
+
}
|
|
384
426
|
// packages/ai/src/sources.tsx
|
|
385
|
-
function
|
|
386
|
-
return /* @__PURE__ */
|
|
427
|
+
function ie({ sources: e, label: t = "Sources" }) {
|
|
428
|
+
return /* @__PURE__ */ E("section", {
|
|
387
429
|
"aria-label": t,
|
|
388
430
|
className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft",
|
|
389
431
|
children: [
|
|
390
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ T("h3", {
|
|
391
433
|
className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
|
|
392
434
|
children: t
|
|
393
435
|
}),
|
|
394
|
-
e.length === 0 && /* @__PURE__ */
|
|
436
|
+
e.length === 0 && /* @__PURE__ */ T("p", {
|
|
395
437
|
className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
396
438
|
children: "No sources supplied."
|
|
397
439
|
}),
|
|
398
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ T("ol", {
|
|
399
441
|
className: "x78zum5 xdt5ytf x1n8ia3y x1ghz6dp x1717udv x3ct3a4",
|
|
400
|
-
children: e.map((e) => /* @__PURE__ */
|
|
442
|
+
children: e.map((e) => /* @__PURE__ */ E("li", {
|
|
401
443
|
className: "x78zum5 xdt5ytf xfko13i xeuugli xj0a0fe",
|
|
402
|
-
children: [/* @__PURE__ */
|
|
444
|
+
children: [/* @__PURE__ */ T("span", { children: /* @__PURE__ */ T(l, {
|
|
403
445
|
href: e.href,
|
|
404
446
|
children: e.title
|
|
405
|
-
}) }), e.description !== void 0 && /* @__PURE__ */
|
|
447
|
+
}) }), e.description !== void 0 && /* @__PURE__ */ T("p", {
|
|
406
448
|
className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
407
449
|
children: e.description
|
|
408
450
|
})]
|
|
@@ -411,21 +453,21 @@ function te({ sources: e, label: t = "Sources" }) {
|
|
|
411
453
|
]
|
|
412
454
|
});
|
|
413
455
|
}
|
|
414
|
-
function
|
|
415
|
-
return /* @__PURE__ */
|
|
456
|
+
function ae({ source: e, label: n }) {
|
|
457
|
+
return /* @__PURE__ */ T("span", {
|
|
416
458
|
className: "xt0psk2 x11njtxf xss6m8b",
|
|
417
|
-
children: /* @__PURE__ */
|
|
418
|
-
render: /* @__PURE__ */
|
|
459
|
+
children: /* @__PURE__ */ E(u.Root, { children: [/* @__PURE__ */ T(u.Trigger, {
|
|
460
|
+
render: /* @__PURE__ */ T(t, {}),
|
|
419
461
|
"aria-label": `Source ${n}: ${e.title}`,
|
|
420
462
|
children: n
|
|
421
|
-
}), /* @__PURE__ */
|
|
463
|
+
}), /* @__PURE__ */ T(u.Portal, { children: /* @__PURE__ */ T(u.Positioner, {
|
|
422
464
|
side: "top",
|
|
423
|
-
children: /* @__PURE__ */
|
|
465
|
+
children: /* @__PURE__ */ T(u.Popup, { children: /* @__PURE__ */ E(o, {
|
|
424
466
|
isCompact: !0,
|
|
425
467
|
children: [
|
|
426
|
-
/* @__PURE__ */
|
|
427
|
-
e.description !== void 0 && /* @__PURE__ */
|
|
428
|
-
/* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ T(u.Title, { children: e.title }),
|
|
469
|
+
e.description !== void 0 && /* @__PURE__ */ T(u.Description, { children: e.description }),
|
|
470
|
+
/* @__PURE__ */ T(l, {
|
|
429
471
|
href: e.href,
|
|
430
472
|
children: "Open source"
|
|
431
473
|
})
|
|
@@ -434,4 +476,4 @@ function ne({ source: e, label: n }) {
|
|
|
434
476
|
}) })] })
|
|
435
477
|
});
|
|
436
478
|
}
|
|
437
|
-
export {
|
|
479
|
+
export { F as Approval, W as Conversation, ae as InlineCitation, J as Message, Z as MessageAction, Y as MessageAttachment, Q as MessageBoundary, ne as PromptInput, te as PromptInputPlaceholder, re as ReplyIndicator, ie as Sources };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e, s as t } from "./chart-frame-
|
|
2
|
-
import { n } from "./chart-input-
|
|
1
|
+
import { n as e, s as t } from "./chart-frame-Cf6LBA8M.js";
|
|
2
|
+
import { n } from "./chart-input-BTDzeBQU.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
|