@mechane-ai/elements 0.29.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/ai.js +250 -172
- package/dist/{categorical-values-Dfe3nkBV.js → categorical-values-Cfn6nwHi.js} +2 -2
- package/dist/{chart-frame-rL7_RAIc.js → chart-frame-C8JU2tlM.js} +9 -9
- package/dist/{chart-input-JIyGPusK.js → chart-input-D0hBpH1r.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 +3 -3
- package/dist/charts.js +1 -1
- package/dist/{code-block-DPeyW4sm.js → code-block-DlzYynjv.js} +21 -20
- package/dist/collections.js +224 -211
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +4 -4
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +3 -3
- package/dist/content/tree.js +3 -3
- package/dist/{content-link-5oRGjDHa.js → content-link-Dh1hon1m.js} +1 -1
- package/dist/content.js +1 -394
- package/dist/elements.css +41 -23
- 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 +392 -318
- package/dist/navigation/commands.js +1 -1
- package/dist/packages/ai/src/command-activity.d.ts +7 -0
- package/dist/packages/ai/src/command-details.d.ts +10 -0
- package/dist/packages/ai/src/index.d.ts +4 -0
- package/dist/packages/content/src/code/code-block.d.ts +2 -1
- package/dist/packages/content/src/log-viewer.d.ts +2 -1
- package/dist/packages/content/src/viewer-styles.d.ts +8 -0
- package/dist/packages/foundations/src/control-styles.d.ts +3 -0
- package/dist/packages/foundations/src/header-styles.d.ts +47 -0
- package/dist/packages/layout/src/frame.stylex.d.ts +0 -2
- package/dist/{pierre-diff-C3U_qae6.js → pierre-diff-DOkqEUqx.js} +1 -1
- package/dist/{pierre-tree-D2kRr4h4.js → pierre-tree-tdFSl55t.js} +2 -2
- package/dist/{src-BfPaaDxg.js → src-Bb2fDOeE.js} +105 -105
- package/dist/src-CVleZrPa.js +395 -0
- package/dist/{src-eWcNz_oB.js → src-DvLYUTID.js} +14 -14
- package/dist/{src-E3Or8tkO.js → src-SE6QORrJ.js} +347 -290
- package/dist/{viewer-styles-CpHqp5Qv.js → viewer-styles-DsFYri4K.js} +10 -0
- package/package.json +1 -1
package/dist/ai.js
CHANGED
|
@@ -1,73 +1,148 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
1
|
+
import { A as e, D as t, E as n, O as r, T as i, h as a, i as o, m as s, t as c, v as l } from "./src-SE6QORrJ.js";
|
|
2
|
+
import { t as u } from "./code-block-DlzYynjv.js";
|
|
3
|
+
import { a as d } from "./src-CVleZrPa.js";
|
|
4
|
+
import { t as f } from "./content-link-Dh1hon1m.js";
|
|
5
|
+
import { r as p, t as m } from "./src-d7EAi61b.js";
|
|
6
|
+
import { c as h, d as g } from "./src-DvLYUTID.js";
|
|
7
|
+
import { c as _, u as ee } from "./src-Bb2fDOeE.js";
|
|
8
|
+
import { t as v } from "./accessibility-C-aIZ1Yx.js";
|
|
9
|
+
import { t as y } from "./visible-motion-1GcUaEi4.js";
|
|
10
|
+
import * as b from "@stylexjs/stylex";
|
|
11
|
+
import { createContext as x, useContext as S, useEffect as C, useId as w, useLayoutEffect as T, useRef as E, useState as D } from "react";
|
|
12
|
+
import { jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
13
|
+
import { ArrowDown as A, ArrowUp as j, File as M, GitBranch as N, Square as te, Terminal as P } from "lucide-react";
|
|
14
|
+
import { MessageScroller as F, useMessageScroller as I, useMessageScrollerScrollable as L } from "@shadcn/react/message-scroller";
|
|
13
15
|
// packages/ai/src/approval.tsx
|
|
14
|
-
function
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
+
function R(e) {
|
|
17
|
+
return /* @__PURE__ */ k("section", {
|
|
16
18
|
"aria-label": e.title,
|
|
17
19
|
"data-request-id": e.requestId,
|
|
18
20
|
className: "x78zum5 xdt5ytf x1n8ia3y xeuugli x1c8xbx5 xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
19
21
|
children: [
|
|
20
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ O("h3", {
|
|
21
23
|
className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
|
|
22
24
|
children: e.title
|
|
23
25
|
}),
|
|
24
|
-
e.description !== void 0 && /* @__PURE__ */
|
|
26
|
+
e.description !== void 0 && /* @__PURE__ */ O("p", {
|
|
25
27
|
className: "x1ghz6dp x153jb6y xj0a0fe",
|
|
26
28
|
children: e.description
|
|
27
29
|
}),
|
|
28
30
|
e.children,
|
|
29
|
-
e.status === "pending" ? /* @__PURE__ */
|
|
31
|
+
e.status === "pending" ? /* @__PURE__ */ k(s, { children: [/* @__PURE__ */ O(i, {
|
|
30
32
|
variant: "solid",
|
|
31
33
|
onClick: e.onApprove,
|
|
32
34
|
disabled: e.isDisabled === !0 || e.busy !== void 0,
|
|
33
35
|
isPending: e.busy === "approve",
|
|
34
36
|
pendingLabel: "Approving…",
|
|
35
37
|
children: e.approveLabel ?? "Approve"
|
|
36
|
-
}), /* @__PURE__ */
|
|
38
|
+
}), /* @__PURE__ */ O(i, {
|
|
37
39
|
onClick: e.onDeny,
|
|
38
40
|
disabled: e.isDisabled === !0 || e.busy !== void 0,
|
|
39
41
|
isPending: e.busy === "deny",
|
|
40
42
|
pendingLabel: "Denying…",
|
|
41
43
|
children: e.denyLabel ?? "Deny"
|
|
42
|
-
})] }) : /* @__PURE__ */
|
|
44
|
+
})] }) : /* @__PURE__ */ O(c, { children: e.statusLabel })
|
|
43
45
|
]
|
|
44
46
|
});
|
|
45
47
|
}
|
|
48
|
+
// packages/ai/src/command-details.tsx
|
|
49
|
+
function z({ command: e, output: t, commandNotice: n, outputNotice: r, outputLanguage: i, isRunning: s = !1 }) {
|
|
50
|
+
return /* @__PURE__ */ k(a, {
|
|
51
|
+
isCompact: !0,
|
|
52
|
+
children: [
|
|
53
|
+
e === "" && n !== void 0 ? /* @__PURE__ */ O(o, { children: "Command omitted from this preview." }) : e === void 0 ? /* @__PURE__ */ O(o, { children: s ? "Preparing command…" : "Command unavailable." }) : /* @__PURE__ */ O(u, {
|
|
54
|
+
code: e,
|
|
55
|
+
language: "bash",
|
|
56
|
+
filename: "Command",
|
|
57
|
+
variant: "embedded",
|
|
58
|
+
showLineNumbers: !1,
|
|
59
|
+
shouldWrap: !0,
|
|
60
|
+
maxHeight: 240
|
|
61
|
+
}),
|
|
62
|
+
n !== void 0 && /* @__PURE__ */ O(o, { children: n }),
|
|
63
|
+
t === void 0 || t.length === 0 ? /* @__PURE__ */ O(o, { children: s ? "Waiting for output…" : t === void 0 ? "Output unavailable." : r === void 0 ? "No output." : "Output omitted from this preview." }) : i === void 0 ? /* @__PURE__ */ O(d, {
|
|
64
|
+
output: t,
|
|
65
|
+
label: "Output",
|
|
66
|
+
variant: "embedded",
|
|
67
|
+
isRunning: s
|
|
68
|
+
}) : /* @__PURE__ */ O(u, {
|
|
69
|
+
code: t,
|
|
70
|
+
language: i,
|
|
71
|
+
filename: "Output",
|
|
72
|
+
variant: "embedded",
|
|
73
|
+
showLineNumbers: !1,
|
|
74
|
+
shouldWrap: !0,
|
|
75
|
+
isStreaming: s,
|
|
76
|
+
maxHeight: 320
|
|
77
|
+
}),
|
|
78
|
+
r !== void 0 && /* @__PURE__ */ O(o, { children: r })
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
// packages/ai/src/command-activity.tsx
|
|
83
|
+
var B = {
|
|
84
|
+
pending: "Preparing",
|
|
85
|
+
running: "Running",
|
|
86
|
+
complete: "",
|
|
87
|
+
failed: "Failed",
|
|
88
|
+
stopped: "Stopped",
|
|
89
|
+
unknown: "Outcome unknown"
|
|
90
|
+
}, V = /* @__PURE__ */ new Set(["pending", "running"]);
|
|
91
|
+
function H({ status: e, ...t }) {
|
|
92
|
+
let n = t.command?.trim().split(/\r\n|\n|\r/u)[0], r = n === void 0 || n.length === 0 ? "Command" : n;
|
|
93
|
+
return /* @__PURE__ */ k(l.Root, {
|
|
94
|
+
defaultOpen: !1,
|
|
95
|
+
children: [/* @__PURE__ */ O(l.Trigger, {
|
|
96
|
+
variant: "inline",
|
|
97
|
+
children: /* @__PURE__ */ k("span", {
|
|
98
|
+
className: "x3nfvp2 x6s0dn4 x1hnptsi xeuugli",
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ O(P, {
|
|
101
|
+
size: 14,
|
|
102
|
+
"aria-hidden": !0,
|
|
103
|
+
className: "x2lah0s"
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ O("span", {
|
|
106
|
+
className: "xiard35 xy8obcc xeuugli xb3r6kr xlyipyv x1sdyfia",
|
|
107
|
+
children: r
|
|
108
|
+
}),
|
|
109
|
+
B[e].length > 0 && /* @__PURE__ */ O("span", {
|
|
110
|
+
className: "x2lah0s xy8obcc x153jb6y",
|
|
111
|
+
children: B[e]
|
|
112
|
+
})
|
|
113
|
+
]
|
|
114
|
+
})
|
|
115
|
+
}), /* @__PURE__ */ O(l.Panel, { children: /* @__PURE__ */ O(z, {
|
|
116
|
+
...t,
|
|
117
|
+
isRunning: V.has(e)
|
|
118
|
+
}) })]
|
|
119
|
+
});
|
|
120
|
+
}
|
|
46
121
|
// packages/ai/src/conversation.tsx
|
|
47
|
-
var
|
|
48
|
-
function
|
|
49
|
-
let i =
|
|
50
|
-
return
|
|
122
|
+
var U = x(void 0);
|
|
123
|
+
function W({ children: e, initialPosition: t = "end", shouldFollow: n = !0, viewportRef: r }) {
|
|
124
|
+
let i = E(null), a = r ?? i, [o] = D(t);
|
|
125
|
+
return T(() => {
|
|
51
126
|
typeof o == "object" && a.current?.scrollTo({
|
|
52
127
|
top: o.top,
|
|
53
128
|
left: o.left ?? 0,
|
|
54
129
|
behavior: "instant"
|
|
55
130
|
});
|
|
56
|
-
}, [o, a]), /* @__PURE__ */
|
|
131
|
+
}, [o, a]), /* @__PURE__ */ O(U.Provider, {
|
|
57
132
|
value: a,
|
|
58
|
-
children: /* @__PURE__ */
|
|
133
|
+
children: /* @__PURE__ */ O(F.Provider, {
|
|
59
134
|
autoScroll: n,
|
|
60
135
|
defaultScrollPosition: typeof o == "object" ? "start" : o,
|
|
61
|
-
children: /* @__PURE__ */
|
|
136
|
+
children: /* @__PURE__ */ O(F.Root, {
|
|
62
137
|
className: "x1n2onr6 x78zum5 xdt5ytf x5yr21d x2lwn1j xeuugli xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
63
138
|
children: e
|
|
64
139
|
})
|
|
65
140
|
})
|
|
66
141
|
});
|
|
67
142
|
}
|
|
68
|
-
function
|
|
69
|
-
let r =
|
|
70
|
-
return /* @__PURE__ */
|
|
143
|
+
function G({ label: e, children: t, scrollRestorationId: n }) {
|
|
144
|
+
let r = S(U);
|
|
145
|
+
return /* @__PURE__ */ O(F.Viewport, {
|
|
71
146
|
ref: r,
|
|
72
147
|
"aria-label": e,
|
|
73
148
|
"data-scroll-restoration-id": n,
|
|
@@ -75,8 +150,8 @@ function R({ label: e, children: t, scrollRestorationId: n }) {
|
|
|
75
150
|
children: t
|
|
76
151
|
});
|
|
77
152
|
}
|
|
78
|
-
function
|
|
79
|
-
return /* @__PURE__ */
|
|
153
|
+
function K({ children: e, isStreaming: t = !1 }) {
|
|
154
|
+
return /* @__PURE__ */ O(F.Content, {
|
|
80
155
|
"aria-live": "polite",
|
|
81
156
|
"aria-relevant": "additions",
|
|
82
157
|
"aria-busy": t,
|
|
@@ -84,57 +159,57 @@ function z({ children: e, isStreaming: t = !1 }) {
|
|
|
84
159
|
children: e
|
|
85
160
|
});
|
|
86
161
|
}
|
|
87
|
-
function
|
|
88
|
-
let { scrollToEnd: r } =
|
|
89
|
-
return
|
|
162
|
+
function q({ messageId: e, shouldRevealOnAppend: t = !1, children: n }) {
|
|
163
|
+
let { scrollToEnd: r } = I();
|
|
164
|
+
return T(() => {
|
|
90
165
|
t && r({ behavior: "instant" });
|
|
91
166
|
}, [
|
|
92
167
|
e,
|
|
93
168
|
t,
|
|
94
169
|
r
|
|
95
|
-
]), /* @__PURE__ */
|
|
170
|
+
]), /* @__PURE__ */ O(F.Item, {
|
|
96
171
|
messageId: e,
|
|
97
172
|
className: "xeuugli xj0a0fe",
|
|
98
173
|
children: n
|
|
99
174
|
});
|
|
100
175
|
}
|
|
101
|
-
function
|
|
102
|
-
return /* @__PURE__ */
|
|
176
|
+
function J({ children: e }) {
|
|
177
|
+
return /* @__PURE__ */ O("div", {
|
|
103
178
|
className: "x9f619 x2lah0s xeuugli xh8yej3 xe10afn xvueqy4 xn9t2bk x1m92p3w",
|
|
104
179
|
children: e
|
|
105
180
|
});
|
|
106
181
|
}
|
|
107
|
-
function
|
|
108
|
-
let { end: t } =
|
|
109
|
-
return t ? /* @__PURE__ */
|
|
182
|
+
function Y({ label: e = "Jump to latest" }) {
|
|
183
|
+
let { end: t } = L();
|
|
184
|
+
return t ? /* @__PURE__ */ O("div", {
|
|
110
185
|
className: "x10l6tqk xwthv0x x1nrll8i xuuh30 x1tv4vx4 xeuugli",
|
|
111
|
-
children: /* @__PURE__ */
|
|
186
|
+
children: /* @__PURE__ */ O(X, { label: e })
|
|
112
187
|
}) : null;
|
|
113
188
|
}
|
|
114
|
-
function
|
|
115
|
-
let { scrollToEnd: n } =
|
|
116
|
-
return /* @__PURE__ */
|
|
189
|
+
function X({ label: e, onActivate: t }) {
|
|
190
|
+
let { scrollToEnd: n } = I(), r = S(U);
|
|
191
|
+
return /* @__PURE__ */ k(i, {
|
|
117
192
|
onClick: () => {
|
|
118
193
|
t?.(), requestAnimationFrame(() => {
|
|
119
194
|
let e = r?.current;
|
|
120
195
|
e != null && (n({ behavior: "instant" }), e.focus({ preventScroll: !0 }));
|
|
121
196
|
});
|
|
122
197
|
},
|
|
123
|
-
children: [/* @__PURE__ */
|
|
198
|
+
children: [/* @__PURE__ */ O(A, {
|
|
124
199
|
size: 14,
|
|
125
200
|
"aria-hidden": !0
|
|
126
201
|
}), e]
|
|
127
202
|
});
|
|
128
203
|
}
|
|
129
|
-
var
|
|
130
|
-
Root:
|
|
131
|
-
Viewport:
|
|
132
|
-
Content:
|
|
133
|
-
Item:
|
|
134
|
-
Controls:
|
|
135
|
-
LatestButton:
|
|
136
|
-
JumpToLatest:
|
|
137
|
-
},
|
|
204
|
+
var Z = {
|
|
205
|
+
Root: W,
|
|
206
|
+
Viewport: G,
|
|
207
|
+
Content: K,
|
|
208
|
+
Item: q,
|
|
209
|
+
Controls: J,
|
|
210
|
+
LatestButton: X,
|
|
211
|
+
JumpToLatest: Y
|
|
212
|
+
}, Q = {
|
|
138
213
|
root: {
|
|
139
214
|
k1xSpc: "x78zum5",
|
|
140
215
|
kXwgrk: "xdt5ytf",
|
|
@@ -171,77 +246,80 @@ var W = {
|
|
|
171
246
|
k8WAf4: "xn9t2bk",
|
|
172
247
|
$$css: !0
|
|
173
248
|
}
|
|
174
|
-
},
|
|
175
|
-
user:
|
|
176
|
-
assistant:
|
|
177
|
-
system:
|
|
178
|
-
},
|
|
179
|
-
user:
|
|
180
|
-
assistant:
|
|
249
|
+
}, ne = {
|
|
250
|
+
user: Q.user,
|
|
251
|
+
assistant: Q.assistant,
|
|
252
|
+
system: Q.system
|
|
253
|
+
}, re = {
|
|
254
|
+
user: Q.bubble,
|
|
255
|
+
assistant: Q.chatReply,
|
|
181
256
|
system: null
|
|
182
|
-
},
|
|
257
|
+
}, ie = {
|
|
183
258
|
"x-default-marker": "x-default-marker",
|
|
184
259
|
$$css: !0
|
|
185
260
|
};
|
|
186
|
-
function
|
|
187
|
-
let l = c === "chat", u = !l || a !== void 0 || i !== void 0 ? /* @__PURE__ */
|
|
261
|
+
function ae({ author: e, children: t, id: n, kind: r = "assistant", meta: i, avatar: a, actions: o, attachments: s, variant: c = "default" }) {
|
|
262
|
+
let l = c === "chat", u = !l || a !== void 0 || i !== void 0, d = l && r === "assistant", f = u ? /* @__PURE__ */ k("header", {
|
|
188
263
|
className: "x78zum5 x6s0dn4 x1hnptsi x1a02dak xeuugli",
|
|
189
264
|
children: [
|
|
190
|
-
a !== void 0 && /* @__PURE__ */
|
|
265
|
+
a !== void 0 && /* @__PURE__ */ O("span", {
|
|
191
266
|
className: "x3nfvp2 x2lah0s",
|
|
192
267
|
children: a
|
|
193
268
|
}),
|
|
194
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ O("span", {
|
|
195
270
|
className: "xk4h15q xeuugli xj0a0fe",
|
|
196
271
|
children: e
|
|
197
272
|
}),
|
|
198
|
-
i !== void 0 && /* @__PURE__ */
|
|
273
|
+
i !== void 0 && /* @__PURE__ */ O("div", {
|
|
199
274
|
className: "x153jb6y xy8obcc xas2l8k xeuugli xj0a0fe",
|
|
200
275
|
children: i
|
|
201
276
|
})
|
|
202
277
|
]
|
|
203
278
|
}) : null;
|
|
204
|
-
return /* @__PURE__ */
|
|
279
|
+
return /* @__PURE__ */ k("article", {
|
|
205
280
|
id: n,
|
|
206
281
|
"aria-label": e,
|
|
207
|
-
...
|
|
282
|
+
...b.props(Q.root, ne[r], l && re[r], ie),
|
|
208
283
|
children: [
|
|
209
|
-
|
|
210
|
-
/* @__PURE__ */
|
|
284
|
+
f,
|
|
285
|
+
/* @__PURE__ */ O("div", {
|
|
211
286
|
className: "xeuugli xj0a0fe x1ytb0s6",
|
|
212
287
|
children: t
|
|
213
288
|
}),
|
|
214
|
-
s !== void 0 && /* @__PURE__ */
|
|
289
|
+
s !== void 0 && /* @__PURE__ */ O("div", {
|
|
215
290
|
className: "x78zum5 x1a02dak x1qjc9v5 x1hnptsi xeuugli",
|
|
216
291
|
children: s
|
|
217
292
|
}),
|
|
218
|
-
o !== void 0 && /* @__PURE__ */
|
|
219
|
-
|
|
293
|
+
(o !== void 0 || d) && /* @__PURE__ */ O("footer", {
|
|
294
|
+
...{
|
|
295
|
+
0: { className: "x78zum5 x1a02dak x6s0dn4 xeuugli xunmzkg x1hc1fzr x12vu8c0 xtf8l8m x1thm12b" },
|
|
296
|
+
1: { className: "x78zum5 x1a02dak x6s0dn4 xeuugli xunmzkg x1hc1fzr x12vu8c0 xtf8l8m x1thm12b x17tes2r x17oiadl" }
|
|
297
|
+
}[!!d | 0],
|
|
220
298
|
children: o
|
|
221
299
|
})
|
|
222
300
|
]
|
|
223
301
|
});
|
|
224
302
|
}
|
|
225
|
-
function
|
|
226
|
-
return /* @__PURE__ */
|
|
303
|
+
function oe({ name: e, description: t, href: n, actions: r }) {
|
|
304
|
+
return /* @__PURE__ */ k("div", {
|
|
227
305
|
className: "x78zum5 x1a02dak x6s0dn4 x1n8ia3y xeuugli x193iq5w x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
228
306
|
children: [
|
|
229
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ O(M, {
|
|
230
308
|
size: 16,
|
|
231
309
|
"aria-hidden": !0,
|
|
232
310
|
className: "x153jb6y x2lah0s"
|
|
233
311
|
}),
|
|
234
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ k("div", {
|
|
235
313
|
className: "x78zum5 xdt5ytf xfko13i x1slnebi xeuugli xj0a0fe",
|
|
236
|
-
children: [n === void 0 ? /* @__PURE__ */
|
|
314
|
+
children: [n === void 0 ? /* @__PURE__ */ O("span", { children: e }) : /* @__PURE__ */ O(f, {
|
|
237
315
|
href: n,
|
|
238
316
|
children: e
|
|
239
|
-
}), t !== void 0 && /* @__PURE__ */
|
|
317
|
+
}), t !== void 0 && /* @__PURE__ */ O("span", {
|
|
240
318
|
className: "x153jb6y xy8obcc xas2l8k xeuugli xj0a0fe",
|
|
241
319
|
children: t
|
|
242
320
|
})]
|
|
243
321
|
}),
|
|
244
|
-
r !== void 0 && /* @__PURE__ */
|
|
322
|
+
r !== void 0 && /* @__PURE__ */ O("div", {
|
|
245
323
|
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli",
|
|
246
324
|
children: r
|
|
247
325
|
})
|
|
@@ -249,39 +327,39 @@ function X({ name: e, description: t, href: n, actions: r }) {
|
|
|
249
327
|
});
|
|
250
328
|
}
|
|
251
329
|
// packages/ai/src/message-action.tsx
|
|
252
|
-
function
|
|
330
|
+
function se(e) {
|
|
253
331
|
if (e.kind === "link") {
|
|
254
332
|
let { kind: n, label: r, ...i } = e;
|
|
255
|
-
return /* @__PURE__ */
|
|
333
|
+
return /* @__PURE__ */ O(t, {
|
|
256
334
|
...i,
|
|
257
335
|
"aria-label": r
|
|
258
336
|
});
|
|
259
337
|
}
|
|
260
338
|
let { kind: r, label: i, ...a } = e;
|
|
261
|
-
return /* @__PURE__ */
|
|
339
|
+
return /* @__PURE__ */ O(n, {
|
|
262
340
|
...a,
|
|
263
341
|
variant: "ghost",
|
|
264
342
|
"aria-label": i
|
|
265
343
|
});
|
|
266
344
|
}
|
|
267
|
-
function
|
|
268
|
-
return /* @__PURE__ */
|
|
345
|
+
function ce(e) {
|
|
346
|
+
return /* @__PURE__ */ k(m.Root, { children: [/* @__PURE__ */ O(m.Trigger, { render: se(e) }), /* @__PURE__ */ O(m.Portal, { children: /* @__PURE__ */ O(m.Positioner, { children: /* @__PURE__ */ O(m.Popup, { children: e.label }) }) })] });
|
|
269
347
|
}
|
|
270
348
|
// packages/ai/src/message-boundary.tsx
|
|
271
|
-
function
|
|
272
|
-
return /* @__PURE__ */
|
|
349
|
+
function le({ label: e, children: t }) {
|
|
350
|
+
return /* @__PURE__ */ k(l.Root, {
|
|
273
351
|
className: "xeuugli x1kbiq1m xykt701 xpu655y",
|
|
274
|
-
children: [/* @__PURE__ */
|
|
352
|
+
children: [/* @__PURE__ */ k(l.Trigger, {
|
|
275
353
|
className: "xlqzeqv x1hnptsi x153jb6y xy8obcc xas2l8k xj57cvi",
|
|
276
|
-
children: [/* @__PURE__ */
|
|
354
|
+
children: [/* @__PURE__ */ O(N, {
|
|
277
355
|
size: 14,
|
|
278
356
|
"aria-hidden": !0,
|
|
279
357
|
className: "x2lah0s"
|
|
280
|
-
}), /* @__PURE__ */
|
|
358
|
+
}), /* @__PURE__ */ O("span", {
|
|
281
359
|
className: "xeuugli xj0a0fe",
|
|
282
360
|
children: e
|
|
283
361
|
})]
|
|
284
|
-
}), /* @__PURE__ */
|
|
362
|
+
}), /* @__PURE__ */ O(l.Panel, {
|
|
285
363
|
className: "x153jb6y xy8obcc xas2l8k",
|
|
286
364
|
children: t
|
|
287
365
|
})]
|
|
@@ -299,25 +377,25 @@ var $ = {
|
|
|
299
377
|
$$css: !0
|
|
300
378
|
}
|
|
301
379
|
};
|
|
302
|
-
function
|
|
303
|
-
return /* @__PURE__ */
|
|
380
|
+
function ue({ isCompact: t = !1 }) {
|
|
381
|
+
return /* @__PURE__ */ O("div", {
|
|
304
382
|
"aria-hidden": !0,
|
|
305
383
|
inert: !0,
|
|
306
384
|
className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
307
|
-
children: /* @__PURE__ */
|
|
385
|
+
children: /* @__PURE__ */ k("div", {
|
|
308
386
|
className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep",
|
|
309
|
-
children: [/* @__PURE__ */
|
|
310
|
-
...
|
|
311
|
-
children: /* @__PURE__ */
|
|
312
|
-
lines:
|
|
387
|
+
children: [/* @__PURE__ */ O("div", {
|
|
388
|
+
...b.props(e.base, e.field, e.textarea, e.plainTextarea),
|
|
389
|
+
children: /* @__PURE__ */ O(g, {
|
|
390
|
+
lines: t ? 1 : 2,
|
|
313
391
|
width: "22ch"
|
|
314
392
|
})
|
|
315
|
-
}), /* @__PURE__ */
|
|
393
|
+
}), /* @__PURE__ */ k("div", {
|
|
316
394
|
className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi",
|
|
317
|
-
children: [/* @__PURE__ */
|
|
395
|
+
children: [/* @__PURE__ */ O("div", {
|
|
318
396
|
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd xy8obcc xas2l8k",
|
|
319
|
-
children: /* @__PURE__ */
|
|
320
|
-
}), /* @__PURE__ */
|
|
397
|
+
children: /* @__PURE__ */ O(g, { width: "8ch" })
|
|
398
|
+
}), /* @__PURE__ */ O(h, {
|
|
321
399
|
isIconOnly: !0,
|
|
322
400
|
xstyle: $.action
|
|
323
401
|
})]
|
|
@@ -325,109 +403,109 @@ function ne({ isCompact: e = !1 }) {
|
|
|
325
403
|
})
|
|
326
404
|
});
|
|
327
405
|
}
|
|
328
|
-
function
|
|
329
|
-
let
|
|
330
|
-
|
|
331
|
-
function
|
|
332
|
-
if (
|
|
406
|
+
function de({ label: e, value: t, onValueChange: r, onSubmit: i, name: a = "prompt", placeholder: o, maxLength: s, required: c = !0, isPending: l = !1, disabled: u = !1, isSubmitDisabled: d = !1, submitLabel: f = "Send message", pendingLabel: p = "Sending…", enterBehavior: h = "newline", isCompact: g = !1, description: y, error: x, controls: S, attachments: C, onStop: T, isStopPending: E = !1, stopLabel: D = "Stop response" }) {
|
|
407
|
+
let A = w(), M = u, N = g && C === void 0 && S === void 0, P = !M && !l && !d, F = f;
|
|
408
|
+
T === void 0 ? l ? F = p : h === "submit" && (F = `${f} · Enter`) : F = E ? "Stopping…" : D;
|
|
409
|
+
function I(e) {
|
|
410
|
+
if (h !== "submit" || e.key !== "Enter" || e.repeat) return;
|
|
333
411
|
let t = e.altKey || e.ctrlKey || e.metaKey;
|
|
334
|
-
e.shiftKey || t || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 || (e.preventDefault(),
|
|
412
|
+
e.shiftKey || t || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 || (e.preventDefault(), P && T === void 0 && e.currentTarget.form?.requestSubmit());
|
|
335
413
|
}
|
|
336
|
-
function
|
|
337
|
-
e.preventDefault(),
|
|
414
|
+
function L(e) {
|
|
415
|
+
e.preventDefault(), P && T === void 0 && i(e);
|
|
338
416
|
}
|
|
339
|
-
return /* @__PURE__ */
|
|
340
|
-
onSubmit:
|
|
417
|
+
return /* @__PURE__ */ O("form", {
|
|
418
|
+
onSubmit: L,
|
|
341
419
|
className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
342
|
-
children: /* @__PURE__ */
|
|
343
|
-
invalid:
|
|
420
|
+
children: /* @__PURE__ */ k(_.Root, {
|
|
421
|
+
invalid: x !== void 0,
|
|
344
422
|
children: [
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
-
...
|
|
423
|
+
/* @__PURE__ */ O(_.Label, {
|
|
424
|
+
...b.props(v.hidden),
|
|
347
425
|
children: e
|
|
348
426
|
}),
|
|
349
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ k("div", {
|
|
350
428
|
...{
|
|
351
429
|
0: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep" },
|
|
352
430
|
2: { className: "x78zum5 x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1q0g3np xuk3077 xn9t2bk" },
|
|
353
431
|
1: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1oddvo6" },
|
|
354
432
|
3: { className: "x78zum5 x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1q0g3np xuk3077 xn9t2bk x1oddvo6" }
|
|
355
|
-
}[!!
|
|
433
|
+
}[!!N << 1 | x !== void 0],
|
|
356
434
|
children: [
|
|
357
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ O(ee, {
|
|
358
436
|
appearance: "plain",
|
|
359
|
-
rows:
|
|
360
|
-
isCompact:
|
|
361
|
-
shouldGrow:
|
|
362
|
-
xstyle:
|
|
437
|
+
rows: g ? 1 : 2,
|
|
438
|
+
isCompact: g,
|
|
439
|
+
shouldGrow: N,
|
|
440
|
+
xstyle: N ? $.inlineInput : void 0,
|
|
363
441
|
name: a,
|
|
364
442
|
value: t,
|
|
365
443
|
onChange: (e) => r(e.currentTarget.value),
|
|
366
|
-
onKeyDown:
|
|
444
|
+
onKeyDown: I,
|
|
367
445
|
placeholder: o ?? e,
|
|
368
446
|
maxLength: s,
|
|
369
447
|
required: c,
|
|
370
448
|
disabled: u,
|
|
371
|
-
"aria-errormessage":
|
|
449
|
+
"aria-errormessage": x === void 0 ? void 0 : A
|
|
372
450
|
}),
|
|
373
|
-
|
|
374
|
-
/* @__PURE__ */
|
|
451
|
+
C,
|
|
452
|
+
/* @__PURE__ */ k("div", {
|
|
375
453
|
...{
|
|
376
454
|
0: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi" },
|
|
377
455
|
1: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi x2lah0s" }
|
|
378
|
-
}[!!
|
|
379
|
-
children: [
|
|
456
|
+
}[!!N | 0],
|
|
457
|
+
children: [S !== void 0 && /* @__PURE__ */ O("div", {
|
|
380
458
|
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd",
|
|
381
|
-
children:
|
|
382
|
-
}), /* @__PURE__ */
|
|
459
|
+
children: S
|
|
460
|
+
}), /* @__PURE__ */ k(m.Root, { children: [/* @__PURE__ */ O(m.Trigger, { render: T === void 0 ? /* @__PURE__ */ O(n, {
|
|
383
461
|
xstyle: $.action,
|
|
384
462
|
type: "submit",
|
|
385
463
|
variant: "solid",
|
|
386
|
-
"aria-label": l ?
|
|
387
|
-
disabled: u ||
|
|
464
|
+
"aria-label": l ? p : f,
|
|
465
|
+
disabled: u || d,
|
|
388
466
|
isPending: l,
|
|
389
|
-
children: /* @__PURE__ */
|
|
467
|
+
children: /* @__PURE__ */ O(j, {
|
|
390
468
|
size: 16,
|
|
391
469
|
"aria-hidden": !0
|
|
392
470
|
})
|
|
393
|
-
}) : /* @__PURE__ */
|
|
471
|
+
}) : /* @__PURE__ */ O(n, {
|
|
394
472
|
xstyle: $.action,
|
|
395
473
|
type: "button",
|
|
396
|
-
"aria-label":
|
|
474
|
+
"aria-label": E ? "Stopping…" : D,
|
|
397
475
|
onClick: (e) => {
|
|
398
|
-
e.preventDefault(),
|
|
476
|
+
e.preventDefault(), T();
|
|
399
477
|
},
|
|
400
478
|
disabled: u,
|
|
401
|
-
isPending:
|
|
402
|
-
children: /* @__PURE__ */
|
|
479
|
+
isPending: E,
|
|
480
|
+
children: /* @__PURE__ */ O(te, {
|
|
403
481
|
size: 14,
|
|
404
482
|
"aria-hidden": !0
|
|
405
483
|
})
|
|
406
|
-
}) }), /* @__PURE__ */
|
|
484
|
+
}) }), /* @__PURE__ */ O(m.Portal, { children: /* @__PURE__ */ O(m.Positioner, { children: /* @__PURE__ */ O(m.Popup, { children: F }) }) })] })]
|
|
407
485
|
})
|
|
408
486
|
]
|
|
409
487
|
}),
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
id:
|
|
488
|
+
y !== void 0 && /* @__PURE__ */ O(_.Description, { children: y }),
|
|
489
|
+
x !== void 0 && /* @__PURE__ */ O(_.Error, {
|
|
490
|
+
id: A,
|
|
413
491
|
match: !0,
|
|
414
492
|
role: "alert",
|
|
415
|
-
children:
|
|
493
|
+
children: x
|
|
416
494
|
})
|
|
417
495
|
]
|
|
418
496
|
})
|
|
419
497
|
});
|
|
420
498
|
}
|
|
421
499
|
// packages/ai/src/reply-indicator.tsx
|
|
422
|
-
function
|
|
423
|
-
let [r, i] =
|
|
424
|
-
return
|
|
500
|
+
function fe({ label: e, delayMs: t = 200, isAnimated: n = !0 }) {
|
|
501
|
+
let [r, i] = D(t === 0), { ref: a, isActive: o } = y(n && r);
|
|
502
|
+
return C(() => {
|
|
425
503
|
let e = setTimeout(() => i(!0), t);
|
|
426
504
|
return () => clearTimeout(e);
|
|
427
|
-
}, [t]), /* @__PURE__ */
|
|
505
|
+
}, [t]), /* @__PURE__ */ O("div", {
|
|
428
506
|
ref: a,
|
|
429
|
-
className: "
|
|
430
|
-
children: r && /* @__PURE__ */
|
|
507
|
+
className: "x1tn5z8q x153jb6y x1hz01jw xtqrqnz x1ytb0s6",
|
|
508
|
+
children: r && /* @__PURE__ */ O("span", {
|
|
431
509
|
role: "status",
|
|
432
510
|
...{
|
|
433
511
|
0: {},
|
|
@@ -440,27 +518,27 @@ function ie({ label: e, delayMs: t = 200, isAnimated: n = !0 }) {
|
|
|
440
518
|
});
|
|
441
519
|
}
|
|
442
520
|
// packages/ai/src/sources.tsx
|
|
443
|
-
function
|
|
444
|
-
return /* @__PURE__ */
|
|
521
|
+
function pe({ sources: e, label: t = "Sources" }) {
|
|
522
|
+
return /* @__PURE__ */ k("section", {
|
|
445
523
|
"aria-label": t,
|
|
446
524
|
className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft",
|
|
447
525
|
children: [
|
|
448
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ O("h3", {
|
|
449
527
|
className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
|
|
450
528
|
children: t
|
|
451
529
|
}),
|
|
452
|
-
e.length === 0 && /* @__PURE__ */
|
|
530
|
+
e.length === 0 && /* @__PURE__ */ O("p", {
|
|
453
531
|
className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
454
532
|
children: "No sources supplied."
|
|
455
533
|
}),
|
|
456
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ O("ol", {
|
|
457
535
|
className: "x78zum5 xdt5ytf x1n8ia3y x1ghz6dp x1717udv x3ct3a4",
|
|
458
|
-
children: e.map((e) => /* @__PURE__ */
|
|
536
|
+
children: e.map((e) => /* @__PURE__ */ k("li", {
|
|
459
537
|
className: "x78zum5 xdt5ytf xfko13i xeuugli xj0a0fe",
|
|
460
|
-
children: [/* @__PURE__ */
|
|
538
|
+
children: [/* @__PURE__ */ O("span", { children: /* @__PURE__ */ O(f, {
|
|
461
539
|
href: e.href,
|
|
462
540
|
children: e.title
|
|
463
|
-
}) }), e.description !== void 0 && /* @__PURE__ */
|
|
541
|
+
}) }), e.description !== void 0 && /* @__PURE__ */ O("p", {
|
|
464
542
|
className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
465
543
|
children: e.description
|
|
466
544
|
})]
|
|
@@ -469,22 +547,22 @@ function ae({ sources: e, label: t = "Sources" }) {
|
|
|
469
547
|
]
|
|
470
548
|
});
|
|
471
549
|
}
|
|
472
|
-
function
|
|
473
|
-
return /* @__PURE__ */
|
|
550
|
+
function me({ source: e, label: t }) {
|
|
551
|
+
return /* @__PURE__ */ O("span", {
|
|
474
552
|
className: "xt0psk2 x11njtxf xss6m8b",
|
|
475
|
-
children: /* @__PURE__ */
|
|
476
|
-
render: /* @__PURE__ */
|
|
477
|
-
"aria-label": `Source ${
|
|
478
|
-
children:
|
|
479
|
-
}), /* @__PURE__ */
|
|
553
|
+
children: /* @__PURE__ */ k(p.Root, { children: [/* @__PURE__ */ O(p.Trigger, {
|
|
554
|
+
render: /* @__PURE__ */ O(r, {}),
|
|
555
|
+
"aria-label": `Source ${t}: ${e.title}`,
|
|
556
|
+
children: t
|
|
557
|
+
}), /* @__PURE__ */ O(p.Portal, { children: /* @__PURE__ */ O(p.Positioner, {
|
|
480
558
|
side: "top",
|
|
481
|
-
children: /* @__PURE__ */
|
|
559
|
+
children: /* @__PURE__ */ O(p.Popup, { children: /* @__PURE__ */ k(a, {
|
|
482
560
|
isCompact: !0,
|
|
483
561
|
children: [
|
|
484
|
-
/* @__PURE__ */
|
|
485
|
-
|
|
486
|
-
/* @__PURE__ */
|
|
487
|
-
href:
|
|
562
|
+
/* @__PURE__ */ O(p.Title, { children: e.title }),
|
|
563
|
+
e.description !== void 0 && /* @__PURE__ */ O(p.Description, { children: e.description }),
|
|
564
|
+
/* @__PURE__ */ O(f, {
|
|
565
|
+
href: e.href,
|
|
488
566
|
children: "Open source"
|
|
489
567
|
})
|
|
490
568
|
]
|
|
@@ -492,4 +570,4 @@ function oe({ source: t, label: n }) {
|
|
|
492
570
|
}) })] })
|
|
493
571
|
});
|
|
494
572
|
}
|
|
495
|
-
export {
|
|
573
|
+
export { R as Approval, H as CommandActivity, z as CommandDetails, Z as Conversation, me as InlineCitation, ae as Message, ce as MessageAction, oe as MessageAttachment, le as MessageBoundary, de as PromptInput, ue as PromptInputPlaceholder, fe as ReplyIndicator, pe as Sources };
|