@mechane-ai/elements 0.8.0 → 0.10.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/NOTICE +24 -0
- package/README.md +67 -40
- package/dist/ai.js +274 -209
- package/dist/{categorical-values-dGbaZ0tp.js → categorical-values-DLRE4EEW.js} +4 -4
- package/dist/{chart-frame-DgPdIguO.js → chart-frame-et6f6Vhg.js} +22 -14
- package/dist/{chart-input-Sac4StHN.js → chart-input-CdLkFomi.js} +2 -2
- package/dist/charts/cartesian.js +529 -450
- package/dist/charts/distribution.js +302 -261
- package/dist/charts/graph.js +137 -103
- package/dist/charts/hierarchy.js +7 -7
- package/dist/charts/matrix.js +187 -174
- package/dist/charts/timeline.js +118 -92
- package/dist/charts.js +1 -1
- package/dist/code-block-D77maJBB.js +180 -0
- package/dist/collections.js +388 -300
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +81 -63
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +115 -96
- package/dist/content/tree.js +43 -38
- package/dist/{content-link-Dd8gapwc.js → content-link-BpSZeTNK.js} +6 -2
- package/dist/content.js +169 -150
- package/dist/{assets/stylex.css → elements.css} +862 -338
- package/dist/feedback.js +1 -1
- package/dist/forms/dates.js +31 -31
- package/dist/forms.js +1 -1
- package/dist/index.js +1 -1
- package/dist/layout.js +286 -187
- package/dist/navigation/commands.js +45 -42
- package/dist/{navigation-yxK3iQXo.js → navigation-D2_sGy3C.js} +2 -2
- package/dist/navigation.js +10 -10
- package/dist/overlays.js +1 -1
- package/dist/packages/ai/src/conversation.d.ts +2 -1
- package/dist/packages/ai/src/index.d.ts +4 -0
- package/dist/packages/ai/src/message-action.d.ts +10 -0
- package/dist/packages/ai/src/message-boundary.d.ts +6 -0
- package/dist/packages/ai/src/message.d.ts +2 -1
- package/dist/packages/charts/src/cartesian/bar-chart.d.ts +5 -0
- package/dist/packages/charts/src/cartesian/index.d.ts +2 -2
- package/dist/packages/charts/src/chart-frame.d.ts +3 -0
- package/dist/packages/charts/src/chart-theme.d.ts +2 -1
- package/dist/packages/charts/src/distribution/distribution-plot.d.ts +22 -2
- package/dist/packages/collections/src/collection-scroll.d.ts +2 -1
- package/dist/packages/collections/src/data-table.d.ts +6 -0
- package/dist/packages/collections/src/index.d.ts +2 -2
- package/dist/packages/collections/src/timeline.d.ts +10 -3
- package/dist/packages/content/src/diff/pierre-diff.d.ts +2 -1
- package/dist/packages/content/src/viewer-styles.d.ts +64 -0
- package/dist/packages/core/src/actions.d.ts +7 -0
- package/dist/packages/core/src/agent-avatar-glyphs.d.ts +5 -0
- package/dist/packages/core/src/agent-avatar.d.ts +17 -0
- package/dist/packages/core/src/copy-value.d.ts +2 -1
- package/dist/packages/core/src/index.d.ts +6 -2
- package/dist/packages/core/src/surfaces.d.ts +5 -0
- package/dist/packages/feedback/src/index.d.ts +4 -1
- package/dist/packages/feedback/src/toast.d.ts +5 -27
- package/dist/packages/forms/src/agent-avatar-picker.d.ts +8 -0
- package/dist/packages/forms/src/field-styles.d.ts +28 -0
- package/dist/packages/forms/src/forms.d.ts +2 -1
- package/dist/packages/forms/src/index.d.ts +2 -0
- package/dist/packages/forms/src/selection-styles.d.ts +18 -2
- package/dist/packages/foundations/src/overlay-styles.d.ts +3 -1
- package/dist/packages/foundations/src/popup-styles.d.ts +7 -0
- package/dist/packages/foundations/src/tokens.stylex.d.ts +61 -0
- package/dist/packages/layout/src/app-shell.d.ts +2 -1
- package/dist/packages/layout/src/frame.stylex.d.ts +1 -0
- package/dist/packages/layout/src/index.d.ts +2 -1
- package/dist/packages/layout/src/page-toolbar.d.ts +3 -1
- package/dist/packages/layout/src/sidebar.d.ts +7 -1
- package/dist/packages/layout/src/view-stack.d.ts +13 -0
- package/dist/packages/layout/src/workbench.d.ts +5 -2
- package/dist/packages/overlays/src/alert-dialog.d.ts +5 -2
- package/dist/packages/overlays/src/dialog.d.ts +7 -3
- package/dist/pierre-diff--zsiHCCB.js +71 -0
- package/dist/pierre-theme-D9hnHv3Z.js +126 -0
- package/dist/{pierre-tree-DdE1boiT.js → pierre-tree-BFxEuxwb.js} +3 -3
- package/dist/src-Be7NLG8c.js +1242 -0
- package/dist/src-CBspCKfO.js +969 -0
- package/dist/src-Cs0dRc4X.js +617 -0
- package/dist/src-sU9b0oZW.js +1168 -0
- package/dist/theme.js +1 -1
- package/dist/tokens.js +69 -10
- package/dist/viewer-styles-CpHqp5Qv.js +70 -0
- package/package.json +2 -1
- package/packages/foundations/src/tokens.stylex.ts +61 -0
- package/styles.css +1 -1
- package/dist/code-block-BRNdtTaP.js +0 -175
- package/dist/pierre-diff-CZdzgiYm.js +0 -66
- package/dist/pierre-theme-BpESNIsV.js +0 -96
- package/dist/popup-styles-CvtZDE2t.js +0 -135
- package/dist/src-Bc5sEhdO.js +0 -680
- package/dist/src-CfDf8TY8.js +0 -466
- package/dist/src-DV0BNk1M.js +0 -360
- package/dist/src-Eg_ytPjv.js +0 -1107
package/dist/ai.js
CHANGED
|
@@ -1,124 +1,125 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { C as e, E as t, T as n, f as r, g as i, p as a, t as o, w as s } from "./src-sU9b0oZW.js";
|
|
2
|
+
import { t as c } from "./content-link-BpSZeTNK.js";
|
|
3
|
+
import { r as l, t as u } from "./src-Cs0dRc4X.js";
|
|
4
|
+
import { c as d, u as f } from "./src-Be7NLG8c.js";
|
|
5
|
+
import { t as p } from "./accessibility-C-aIZ1Yx.js";
|
|
6
|
+
import * as m from "@stylexjs/stylex";
|
|
7
|
+
import { createContext as h, useContext as g, useId as _, useRef as v } from "react";
|
|
8
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
9
|
+
import { ArrowDown as x, ArrowUp as S, File as C, GitBranch as w, Square as T } from "lucide-react";
|
|
10
|
+
import { MessageScroller as E, useMessageScroller as D, useMessageScrollerScrollable as O } from "@shadcn/react/message-scroller";
|
|
10
11
|
// packages/ai/src/approval.tsx
|
|
11
|
-
function
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
"aria-label":
|
|
14
|
-
"data-request-id":
|
|
15
|
-
className: "x78zum5 xdt5ytf x1n8ia3y xeuugli x1c8xbx5 xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt",
|
|
12
|
+
function k(t) {
|
|
13
|
+
return /* @__PURE__ */ b("section", {
|
|
14
|
+
"aria-label": t.title,
|
|
15
|
+
"data-request-id": t.requestId,
|
|
16
|
+
className: "x78zum5 xdt5ytf x1n8ia3y xeuugli x1c8xbx5 xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
16
17
|
children: [
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
className: "x1ghz6dp xtqrqnz x1778rvt
|
|
19
|
-
children:
|
|
18
|
+
/* @__PURE__ */ y("h3", {
|
|
19
|
+
className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
|
|
20
|
+
children: t.title
|
|
20
21
|
}),
|
|
21
|
-
|
|
22
|
+
t.description !== void 0 && /* @__PURE__ */ y("p", {
|
|
22
23
|
className: "x1ghz6dp x153jb6y xj0a0fe",
|
|
23
|
-
children:
|
|
24
|
+
children: t.description
|
|
24
25
|
}),
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
t.children,
|
|
27
|
+
t.status === "pending" ? /* @__PURE__ */ b(r, { children: [/* @__PURE__ */ y(e, {
|
|
27
28
|
variant: "solid",
|
|
28
|
-
onClick:
|
|
29
|
-
disabled:
|
|
30
|
-
pending:
|
|
29
|
+
onClick: t.onApprove,
|
|
30
|
+
disabled: t.disabled === !0 || t.busy !== void 0,
|
|
31
|
+
pending: t.busy === "approve",
|
|
31
32
|
pendingLabel: "Approving…",
|
|
32
|
-
children:
|
|
33
|
-
}), /* @__PURE__ */
|
|
34
|
-
onClick:
|
|
35
|
-
disabled:
|
|
36
|
-
pending:
|
|
33
|
+
children: t.approveLabel ?? "Approve"
|
|
34
|
+
}), /* @__PURE__ */ y(e, {
|
|
35
|
+
onClick: t.onDeny,
|
|
36
|
+
disabled: t.disabled === !0 || t.busy !== void 0,
|
|
37
|
+
pending: t.busy === "deny",
|
|
37
38
|
pendingLabel: "Denying…",
|
|
38
|
-
children:
|
|
39
|
-
})] }) : /* @__PURE__ */
|
|
39
|
+
children: t.denyLabel ?? "Deny"
|
|
40
|
+
})] }) : /* @__PURE__ */ y(o, { children: t.statusLabel })
|
|
40
41
|
]
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
44
|
// packages/ai/src/conversation.tsx
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
let r =
|
|
47
|
-
return /* @__PURE__ */
|
|
45
|
+
var A = h(void 0);
|
|
46
|
+
function j({ children: e, initialPosition: t = "end", follow: n = !0 }) {
|
|
47
|
+
let r = v(null);
|
|
48
|
+
return /* @__PURE__ */ y(A.Provider, {
|
|
48
49
|
value: r,
|
|
49
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ y(E.Provider, {
|
|
50
51
|
autoScroll: n,
|
|
51
52
|
defaultScrollPosition: t,
|
|
52
|
-
children: /* @__PURE__ */
|
|
53
|
-
className: "x1n2onr6 x78zum5 xdt5ytf x5yr21d x2lwn1j xeuugli xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt",
|
|
53
|
+
children: /* @__PURE__ */ y(E.Root, {
|
|
54
|
+
className: "x1n2onr6 x78zum5 xdt5ytf x5yr21d x2lwn1j xeuugli xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
54
55
|
children: e
|
|
55
56
|
})
|
|
56
57
|
})
|
|
57
58
|
});
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
-
let
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
-
ref:
|
|
60
|
+
function M({ label: e, children: t, scrollRestorationId: n }) {
|
|
61
|
+
let r = g(A);
|
|
62
|
+
return /* @__PURE__ */ y(E.Viewport, {
|
|
63
|
+
ref: r,
|
|
63
64
|
"aria-label": e,
|
|
64
|
-
|
|
65
|
+
"data-scroll-restoration-id": n,
|
|
66
|
+
className: "x98rzlu x2lwn1j xeuugli x1odjw0f x1046ku7 x185mbhu x1ok0vyi x1t137rt x13qnu6 x9v5kkp x19rmrnh x1bqaal",
|
|
65
67
|
children: t
|
|
66
68
|
});
|
|
67
69
|
}
|
|
68
|
-
function
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
+
function N({ children: e, streaming: t = !1 }) {
|
|
71
|
+
return /* @__PURE__ */ y(E.Content, {
|
|
70
72
|
"aria-live": "polite",
|
|
71
73
|
"aria-relevant": "additions",
|
|
72
74
|
"aria-busy": t,
|
|
73
|
-
className: "x78zum5 xdt5ytf x1j825kq
|
|
75
|
+
className: "x9f619 x78zum5 xdt5ytf x1j825kq xi2fr2z x1m92p3w xvueqy4 xh8yej3 xe10afn xeuugli",
|
|
74
76
|
children: e
|
|
75
77
|
});
|
|
76
78
|
}
|
|
77
|
-
function
|
|
78
|
-
return /* @__PURE__ */
|
|
79
|
+
function P({ messageId: e, children: t }) {
|
|
80
|
+
return /* @__PURE__ */ y(E.Item, {
|
|
79
81
|
messageId: e,
|
|
80
82
|
className: "xeuugli xj0a0fe",
|
|
81
83
|
children: t
|
|
82
84
|
});
|
|
83
85
|
}
|
|
84
|
-
function
|
|
85
|
-
let { scrollToEnd:
|
|
86
|
-
return
|
|
87
|
-
className: "x10l6tqk xwthv0x x1nrll8i xuuh30",
|
|
88
|
-
children: /* @__PURE__ */
|
|
86
|
+
function F({ label: t = "Jump to latest" }) {
|
|
87
|
+
let { scrollToEnd: n } = D(), { end: r } = O(), i = g(A);
|
|
88
|
+
return r ? /* @__PURE__ */ y("div", {
|
|
89
|
+
className: "x10l6tqk xwthv0x x1nrll8i xuuh30 x1tv4vx4 xeuugli",
|
|
90
|
+
children: /* @__PURE__ */ b(e, {
|
|
89
91
|
onClick: () => {
|
|
90
|
-
|
|
92
|
+
n({ behavior: "instant" }), i?.current?.focus({ preventScroll: !0 });
|
|
91
93
|
},
|
|
92
|
-
children: [/* @__PURE__ */
|
|
94
|
+
children: [/* @__PURE__ */ y(x, {
|
|
93
95
|
size: 16,
|
|
94
96
|
"aria-hidden": !0
|
|
95
|
-
}),
|
|
97
|
+
}), t]
|
|
96
98
|
})
|
|
97
99
|
}) : null;
|
|
98
100
|
}
|
|
99
|
-
var
|
|
100
|
-
Root:
|
|
101
|
-
Viewport:
|
|
102
|
-
Content:
|
|
103
|
-
Item:
|
|
104
|
-
JumpToLatest:
|
|
105
|
-
},
|
|
101
|
+
var I = {
|
|
102
|
+
Root: j,
|
|
103
|
+
Viewport: M,
|
|
104
|
+
Content: N,
|
|
105
|
+
Item: P,
|
|
106
|
+
JumpToLatest: F
|
|
107
|
+
}, L = {
|
|
106
108
|
root: {
|
|
107
109
|
k1xSpc: "x78zum5",
|
|
108
110
|
kXwgrk: "xdt5ytf",
|
|
109
|
-
kOIVth: "
|
|
111
|
+
kOIVth: "x1hnptsi",
|
|
110
112
|
k7Eaqz: "xeuugli",
|
|
111
113
|
kMwMTN: "xbixft",
|
|
112
114
|
kMv6JI: "x1hz01jw",
|
|
113
115
|
kGuDYH: "xtqrqnz",
|
|
114
116
|
kLWn49: "x1778rvt",
|
|
117
|
+
k63SB2: "xj57cvi",
|
|
115
118
|
$$css: !0
|
|
116
119
|
},
|
|
117
120
|
user: {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
ksu8eU: "x1y0btm7",
|
|
121
|
-
kVAM5u: "x1ey3b81",
|
|
121
|
+
k8WAf4: "x1qokhjc",
|
|
122
|
+
kg3NbH: "x1m92p3w",
|
|
122
123
|
kaIpWk: "x1ok0vyi",
|
|
123
124
|
kWkggS: "x1r7kqkb",
|
|
124
125
|
$$css: !0
|
|
@@ -129,191 +130,255 @@ var j = {
|
|
|
129
130
|
k8WAf4: "xn9t2bk",
|
|
130
131
|
$$css: !0
|
|
131
132
|
}
|
|
132
|
-
},
|
|
133
|
-
user:
|
|
134
|
-
assistant:
|
|
135
|
-
system:
|
|
133
|
+
}, R = {
|
|
134
|
+
user: L.user,
|
|
135
|
+
assistant: L.assistant,
|
|
136
|
+
system: L.system
|
|
137
|
+
}, z = {
|
|
138
|
+
"x-default-marker": "x-default-marker",
|
|
139
|
+
$$css: !0
|
|
136
140
|
};
|
|
137
|
-
function
|
|
138
|
-
return /* @__PURE__ */
|
|
141
|
+
function B({ author: e, children: t, id: n, kind: r = "assistant", meta: i, avatar: a, actions: o, attachments: s }) {
|
|
142
|
+
return /* @__PURE__ */ b("article", {
|
|
139
143
|
id: n,
|
|
140
144
|
"aria-label": e,
|
|
141
|
-
...
|
|
145
|
+
...m.props(L.root, R[r], z),
|
|
142
146
|
children: [
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
-
className: "x78zum5
|
|
145
|
-
children: [
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
147
|
+
/* @__PURE__ */ b("header", {
|
|
148
|
+
className: "x78zum5 x6s0dn4 x1hnptsi x1a02dak xeuugli",
|
|
149
|
+
children: [
|
|
150
|
+
a !== void 0 && /* @__PURE__ */ y("span", {
|
|
151
|
+
className: "x3nfvp2 x2lah0s",
|
|
152
|
+
children: a
|
|
153
|
+
}),
|
|
154
|
+
/* @__PURE__ */ y("span", {
|
|
155
|
+
className: "xk4h15q xeuugli xj0a0fe",
|
|
156
|
+
children: e
|
|
157
|
+
}),
|
|
158
|
+
i !== void 0 && /* @__PURE__ */ y("div", {
|
|
159
|
+
className: "x153jb6y xy8obcc xas2l8k xeuugli xj0a0fe",
|
|
160
|
+
children: i
|
|
161
|
+
})
|
|
162
|
+
]
|
|
152
163
|
}),
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
className: "xeuugli xj0a0fe",
|
|
164
|
+
/* @__PURE__ */ y("div", {
|
|
165
|
+
className: "xeuugli xj0a0fe x1ytb0s6",
|
|
155
166
|
children: t
|
|
156
167
|
}),
|
|
157
|
-
|
|
158
|
-
className: "x78zum5 x1a02dak x1qjc9v5 x1hnptsi",
|
|
159
|
-
children:
|
|
168
|
+
s !== void 0 && /* @__PURE__ */ y("div", {
|
|
169
|
+
className: "x78zum5 x1a02dak x1qjc9v5 x1hnptsi xeuugli",
|
|
170
|
+
children: s
|
|
160
171
|
}),
|
|
161
|
-
|
|
162
|
-
className: "x78zum5 x1a02dak x6s0dn4
|
|
163
|
-
children:
|
|
172
|
+
o !== void 0 && /* @__PURE__ */ y("footer", {
|
|
173
|
+
className: "x78zum5 x1a02dak x6s0dn4 xeuugli xunmzkg x1hc1fzr x1ac4sdd xea5s0o xbfgl4k",
|
|
174
|
+
children: o
|
|
164
175
|
})
|
|
165
176
|
]
|
|
166
177
|
});
|
|
167
178
|
}
|
|
168
|
-
function
|
|
169
|
-
return /* @__PURE__ */
|
|
170
|
-
className: "x78zum5 x6s0dn4 x1n8ia3y xeuugli x193iq5w x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 x1hz01jw xtqrqnz x1778rvt",
|
|
179
|
+
function V({ name: e, description: t, href: n, actions: r }) {
|
|
180
|
+
return /* @__PURE__ */ b("div", {
|
|
181
|
+
className: "x78zum5 x1a02dak x6s0dn4 x1n8ia3y xeuugli x193iq5w x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
171
182
|
children: [
|
|
172
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ y(C, {
|
|
173
184
|
size: 16,
|
|
174
185
|
"aria-hidden": !0,
|
|
175
186
|
className: "x153jb6y x2lah0s"
|
|
176
187
|
}),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
className: "x78zum5 xdt5ytf xfko13i xeuugli xj0a0fe",
|
|
179
|
-
children: [n === void 0 ? /* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ b("div", {
|
|
189
|
+
className: "x78zum5 xdt5ytf xfko13i x1slnebi xeuugli xj0a0fe",
|
|
190
|
+
children: [n === void 0 ? /* @__PURE__ */ y("span", { children: e }) : /* @__PURE__ */ y(c, {
|
|
180
191
|
href: n,
|
|
181
192
|
children: e
|
|
182
|
-
}), t !== void 0 && /* @__PURE__ */
|
|
183
|
-
className: "x153jb6y xy8obcc xas2l8k",
|
|
193
|
+
}), t !== void 0 && /* @__PURE__ */ y("span", {
|
|
194
|
+
className: "x153jb6y xy8obcc xas2l8k xeuugli xj0a0fe",
|
|
184
195
|
children: t
|
|
185
196
|
})]
|
|
186
197
|
}),
|
|
187
|
-
r
|
|
198
|
+
r !== void 0 && /* @__PURE__ */ y("div", {
|
|
199
|
+
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli",
|
|
200
|
+
children: r
|
|
201
|
+
})
|
|
188
202
|
]
|
|
189
203
|
});
|
|
190
204
|
}
|
|
205
|
+
// packages/ai/src/message-action.tsx
|
|
206
|
+
function H(e) {
|
|
207
|
+
if (e.kind === "link") {
|
|
208
|
+
let { kind: t, label: r, ...i } = e;
|
|
209
|
+
return /* @__PURE__ */ y(n, {
|
|
210
|
+
...i,
|
|
211
|
+
"aria-label": r
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
let { kind: t, label: r, ...i } = e;
|
|
215
|
+
return /* @__PURE__ */ y(s, {
|
|
216
|
+
...i,
|
|
217
|
+
variant: "ghost",
|
|
218
|
+
"aria-label": r
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function U(e) {
|
|
222
|
+
return /* @__PURE__ */ b(u.Root, { children: [/* @__PURE__ */ y(u.Trigger, { render: H(e) }), /* @__PURE__ */ y(u.Portal, { children: /* @__PURE__ */ y(u.Positioner, { children: /* @__PURE__ */ y(u.Popup, { children: e.label }) }) })] });
|
|
223
|
+
}
|
|
224
|
+
// packages/ai/src/message-boundary.tsx
|
|
225
|
+
function W({ label: e, children: t }) {
|
|
226
|
+
return /* @__PURE__ */ b(i.Root, {
|
|
227
|
+
className: "xeuugli x1kbiq1m xykt701 xpu655y",
|
|
228
|
+
children: [/* @__PURE__ */ b(i.Trigger, {
|
|
229
|
+
className: "xlqzeqv x1hnptsi x153jb6y xy8obcc xas2l8k xj57cvi",
|
|
230
|
+
children: [/* @__PURE__ */ y(w, {
|
|
231
|
+
size: 14,
|
|
232
|
+
"aria-hidden": !0,
|
|
233
|
+
className: "x2lah0s"
|
|
234
|
+
}), /* @__PURE__ */ y("span", {
|
|
235
|
+
className: "xeuugli xj0a0fe",
|
|
236
|
+
children: e
|
|
237
|
+
})]
|
|
238
|
+
}), /* @__PURE__ */ y(i.Panel, {
|
|
239
|
+
className: "x153jb6y xy8obcc xas2l8k",
|
|
240
|
+
children: t
|
|
241
|
+
})]
|
|
242
|
+
});
|
|
243
|
+
}
|
|
191
244
|
// packages/ai/src/prompt-input.tsx
|
|
192
|
-
var
|
|
245
|
+
var G = { action: {
|
|
193
246
|
keTefX: "xvc5jky",
|
|
194
247
|
$$css: !0
|
|
195
248
|
} };
|
|
196
|
-
function
|
|
197
|
-
let
|
|
198
|
-
|
|
199
|
-
|
|
249
|
+
function K({ label: e, value: t, onValueChange: n, onSubmit: r, name: i = "prompt", placeholder: a, maxLength: o, required: c = !0, pending: l = !1, disabled: h = !1, submitDisabled: g = !1, submitLabel: v = "Send message", pendingLabel: x = "Sending…", enterBehavior: C = "newline", compact: w = !1, description: E, error: D, controls: O, attachments: k, onStop: A, stopPending: j = !1, stopLabel: M = "Stop response" }) {
|
|
250
|
+
let N = _(), P = h || l, F = v;
|
|
251
|
+
A === void 0 ? l ? F = x : C === "submit" && (F = `${v} · Enter`) : F = j ? "Stopping…" : M;
|
|
252
|
+
function I(e) {
|
|
253
|
+
if (C !== "submit" || e.key !== "Enter" || e.repeat) return;
|
|
200
254
|
let t = e.altKey || e.ctrlKey || e.metaKey;
|
|
201
|
-
e.shiftKey || t || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 || (e.preventDefault(), !
|
|
255
|
+
e.shiftKey || t || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 || (e.preventDefault(), !P && !g && A === void 0 && e.currentTarget.form?.requestSubmit());
|
|
202
256
|
}
|
|
203
|
-
function
|
|
204
|
-
e.preventDefault(), !
|
|
257
|
+
function L(e) {
|
|
258
|
+
e.preventDefault(), !P && !g && A === void 0 && r(e);
|
|
205
259
|
}
|
|
206
|
-
return /* @__PURE__ */
|
|
207
|
-
onSubmit:
|
|
208
|
-
className: "x78zum5 xdt5ytf
|
|
209
|
-
children:
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
260
|
+
return /* @__PURE__ */ y("form", {
|
|
261
|
+
onSubmit: L,
|
|
262
|
+
className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
263
|
+
children: /* @__PURE__ */ b(d.Root, {
|
|
264
|
+
invalid: D !== void 0,
|
|
265
|
+
children: [
|
|
266
|
+
/* @__PURE__ */ y(d.Label, {
|
|
267
|
+
...m.props(p.hidden),
|
|
268
|
+
children: e
|
|
269
|
+
}),
|
|
270
|
+
/* @__PURE__ */ b("div", {
|
|
271
|
+
...{
|
|
272
|
+
0: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep" },
|
|
273
|
+
1: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1oddvo6" }
|
|
274
|
+
}[D !== void 0 | 0],
|
|
275
|
+
children: [
|
|
276
|
+
/* @__PURE__ */ y(f, {
|
|
277
|
+
appearance: "plain",
|
|
278
|
+
rows: w ? 1 : 2,
|
|
279
|
+
compact: w,
|
|
280
|
+
name: i,
|
|
281
|
+
value: t,
|
|
282
|
+
onChange: (e) => n(e.currentTarget.value),
|
|
283
|
+
onKeyDown: I,
|
|
284
|
+
placeholder: a ?? e,
|
|
285
|
+
maxLength: o,
|
|
286
|
+
required: c,
|
|
287
|
+
disabled: h,
|
|
288
|
+
readOnly: l,
|
|
289
|
+
"aria-errormessage": D === void 0 ? void 0 : N
|
|
290
|
+
}),
|
|
291
|
+
k,
|
|
292
|
+
/* @__PURE__ */ b("div", {
|
|
293
|
+
className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi",
|
|
294
|
+
children: [O !== void 0 && /* @__PURE__ */ y("div", {
|
|
295
|
+
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd",
|
|
296
|
+
children: O
|
|
297
|
+
}), /* @__PURE__ */ b(u.Root, { children: [/* @__PURE__ */ y(u.Trigger, { render: A === void 0 ? /* @__PURE__ */ y(s, {
|
|
298
|
+
xstyle: G.action,
|
|
299
|
+
type: "submit",
|
|
300
|
+
variant: "solid",
|
|
301
|
+
"aria-label": l ? x : v,
|
|
302
|
+
disabled: h || g,
|
|
303
|
+
pending: l,
|
|
304
|
+
children: /* @__PURE__ */ y(S, {
|
|
305
|
+
size: 16,
|
|
306
|
+
"aria-hidden": !0
|
|
307
|
+
})
|
|
308
|
+
}) : /* @__PURE__ */ y(s, {
|
|
309
|
+
xstyle: G.action,
|
|
310
|
+
type: "button",
|
|
311
|
+
"aria-label": j ? "Stopping…" : M,
|
|
312
|
+
onClick: (e) => {
|
|
313
|
+
e.preventDefault(), A();
|
|
314
|
+
},
|
|
315
|
+
disabled: h,
|
|
316
|
+
pending: j,
|
|
317
|
+
children: /* @__PURE__ */ y(T, {
|
|
318
|
+
size: 14,
|
|
319
|
+
"aria-hidden": !0
|
|
320
|
+
})
|
|
321
|
+
}) }), /* @__PURE__ */ y(u.Portal, { children: /* @__PURE__ */ y(u.Positioner, { children: /* @__PURE__ */ y(u.Popup, { children: F }) }) })] })]
|
|
322
|
+
})
|
|
323
|
+
]
|
|
324
|
+
}),
|
|
325
|
+
E !== void 0 && /* @__PURE__ */ y(d.Description, { children: E }),
|
|
326
|
+
D !== void 0 && /* @__PURE__ */ y(d.Error, {
|
|
327
|
+
id: N,
|
|
328
|
+
match: !0,
|
|
329
|
+
role: "alert",
|
|
330
|
+
children: D
|
|
331
|
+
})
|
|
332
|
+
]
|
|
333
|
+
})
|
|
269
334
|
});
|
|
270
335
|
}
|
|
271
336
|
// packages/ai/src/sources.tsx
|
|
272
|
-
function
|
|
273
|
-
return /* @__PURE__ */
|
|
337
|
+
function q({ sources: e, label: t = "Sources" }) {
|
|
338
|
+
return /* @__PURE__ */ b("section", {
|
|
274
339
|
"aria-label": t,
|
|
275
|
-
className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1hz01jw xtqrqnz x1778rvt xbixft",
|
|
276
|
-
children: [
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
className: "
|
|
283
|
-
children:
|
|
284
|
-
|
|
285
|
-
|
|
340
|
+
className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft",
|
|
341
|
+
children: [
|
|
342
|
+
/* @__PURE__ */ y("h3", {
|
|
343
|
+
className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
|
|
344
|
+
children: t
|
|
345
|
+
}),
|
|
346
|
+
e.length === 0 && /* @__PURE__ */ y("p", {
|
|
347
|
+
className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
348
|
+
children: "No sources supplied."
|
|
349
|
+
}),
|
|
350
|
+
/* @__PURE__ */ y("ol", {
|
|
351
|
+
className: "x78zum5 xdt5ytf x1n8ia3y x1ghz6dp x1717udv x3ct3a4",
|
|
352
|
+
children: e.map((e) => /* @__PURE__ */ b("li", {
|
|
353
|
+
className: "x78zum5 xdt5ytf xfko13i xeuugli xj0a0fe",
|
|
354
|
+
children: [/* @__PURE__ */ y("span", { children: /* @__PURE__ */ y(c, {
|
|
286
355
|
href: e.href,
|
|
287
356
|
children: e.title
|
|
288
|
-
}), /* @__PURE__ */
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
className: "x2lah0s x153jb6y"
|
|
357
|
+
}) }), e.description !== void 0 && /* @__PURE__ */ y("p", {
|
|
358
|
+
className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
359
|
+
children: e.description
|
|
292
360
|
})]
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
})]
|
|
297
|
-
}, e.id))
|
|
298
|
-
})]
|
|
361
|
+
}, e.id))
|
|
362
|
+
})
|
|
363
|
+
]
|
|
299
364
|
});
|
|
300
365
|
}
|
|
301
|
-
function
|
|
302
|
-
return /* @__PURE__ */
|
|
366
|
+
function J({ source: e, label: n }) {
|
|
367
|
+
return /* @__PURE__ */ y("span", {
|
|
303
368
|
className: "xt0psk2 x11njtxf xss6m8b",
|
|
304
|
-
children: /* @__PURE__ */
|
|
305
|
-
render: /* @__PURE__ */
|
|
306
|
-
"aria-label": `Source ${
|
|
307
|
-
children:
|
|
308
|
-
}), /* @__PURE__ */
|
|
369
|
+
children: /* @__PURE__ */ b(l.Root, { children: [/* @__PURE__ */ y(l.Trigger, {
|
|
370
|
+
render: /* @__PURE__ */ y(t, {}),
|
|
371
|
+
"aria-label": `Source ${n}: ${e.title}`,
|
|
372
|
+
children: n
|
|
373
|
+
}), /* @__PURE__ */ y(l.Portal, { children: /* @__PURE__ */ y(l.Positioner, {
|
|
309
374
|
side: "top",
|
|
310
|
-
children: /* @__PURE__ */
|
|
375
|
+
children: /* @__PURE__ */ y(l.Popup, { children: /* @__PURE__ */ b(a, {
|
|
311
376
|
compact: !0,
|
|
312
377
|
children: [
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
-
href:
|
|
378
|
+
/* @__PURE__ */ y(l.Title, { children: e.title }),
|
|
379
|
+
e.description !== void 0 && /* @__PURE__ */ y(l.Description, { children: e.description }),
|
|
380
|
+
/* @__PURE__ */ y(c, {
|
|
381
|
+
href: e.href,
|
|
317
382
|
children: "Open source"
|
|
318
383
|
})
|
|
319
384
|
]
|
|
@@ -321,4 +386,4 @@ function z({ source: t, label: r }) {
|
|
|
321
386
|
}) })] })
|
|
322
387
|
});
|
|
323
388
|
}
|
|
324
|
-
export {
|
|
389
|
+
export { k as Approval, I as Conversation, J as InlineCitation, B as Message, U as MessageAction, V as MessageAttachment, W as MessageBoundary, K as PromptInput, q as Sources };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e,
|
|
2
|
-
import { n } from "./chart-input-
|
|
1
|
+
import { n as e, s as t } from "./chart-frame-et6f6Vhg.js";
|
|
2
|
+
import { n } from "./chart-input-CdLkFomi.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
|
|
@@ -43,13 +43,13 @@ function f({ items: n, selection: o }) {
|
|
|
43
43
|
selected: o?.selectedId === n.id,
|
|
44
44
|
onSelect: o === void 0 ? void 0 : () => o.onSelect(n.id),
|
|
45
45
|
children: [/* @__PURE__ */ a("span", {
|
|
46
|
-
className: "x78zum5 x6s0dn4 x1hnptsi xeuugli",
|
|
46
|
+
className: "x78zum5 x6s0dn4 x1hnptsi x1slnebi xeuugli",
|
|
47
47
|
children: [/* @__PURE__ */ i("span", {
|
|
48
48
|
"aria-hidden": !0,
|
|
49
49
|
...r.props(s.swatch(t[n.tone]))
|
|
50
50
|
}), n.label]
|
|
51
51
|
}), /* @__PURE__ */ i("span", {
|
|
52
|
-
className: "x153jb6y xp4054r",
|
|
52
|
+
className: "x153jb6y xp4054r xeuugli x193iq5w",
|
|
53
53
|
children: n.valueLabel
|
|
54
54
|
})]
|
|
55
55
|
}) }, n.id))
|