@devalok/shilp-sutra 0.44.1 → 0.45.1
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/AGENTS.md +13 -11
- package/BREAKING.json +209 -27
- package/MIGRATION.md +34 -0
- package/README.md +12 -0
- package/dist/_chunks/badge-group.js +1 -0
- package/dist/_chunks/badge-group.js.map +1 -1
- package/dist/_chunks/block-shell.js +25 -0
- package/dist/_chunks/block-shell.js.map +1 -0
- package/dist/_chunks/chat.js +153 -150
- package/dist/_chunks/chat.js.map +1 -1
- package/dist/_chunks/document-preview.js +1 -1
- package/dist/_chunks/image-preview.js +4 -4
- package/dist/_chunks/mention.js +5 -0
- package/dist/_chunks/mention.js.map +1 -0
- package/dist/_chunks/shared.js +65 -78
- package/dist/_chunks/shared.js.map +1 -1
- package/dist/_chunks/success.js +108 -106
- package/dist/_chunks/success.js.map +1 -1
- package/dist/ai/blocks/block-shell.d.ts +19 -0
- package/dist/ai/blocks/block-shell.d.ts.map +1 -0
- package/dist/ai/blocks/block-table.d.ts.map +1 -1
- package/dist/ai/blocks/confirm.d.ts.map +1 -1
- package/dist/ai/blocks/error.d.ts.map +1 -1
- package/dist/ai/blocks/error.js +5 -5
- package/dist/ai/blocks/error.js.map +1 -1
- package/dist/ai/blocks/success.d.ts.map +1 -1
- package/dist/ai/blocks/text.d.ts.map +1 -1
- package/dist/ai/blocks/text.js +4 -3
- package/dist/ai/blocks/text.js.map +1 -1
- package/dist/composed/activity-feed.d.ts.map +1 -1
- package/dist/composed/activity-feed.js +14 -12
- package/dist/composed/activity-feed.js.map +1 -1
- package/dist/composed/file-preview/audio-preview.d.ts.map +1 -1
- package/dist/composed/file-preview/shared.d.ts +10 -0
- package/dist/composed/file-preview/shared.d.ts.map +1 -1
- package/dist/composed/file-preview/video-preview.d.ts.map +1 -1
- package/dist/composed/file-preview.js +151 -188
- package/dist/composed/file-preview.js.map +1 -1
- package/dist/composed/master-detail.d.ts.map +1 -1
- package/dist/composed/master-detail.js +13 -4
- package/dist/composed/master-detail.js.map +1 -1
- package/dist/composed/rich-chat-input.d.ts.map +1 -1
- package/dist/composed/rich-chat-input.js +514 -503
- package/dist/composed/rich-chat-input.js.map +1 -1
- package/dist/composed/rich-text-editor.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.js +144 -143
- package/dist/composed/rich-text-editor.js.map +1 -1
- package/dist/composed/schedule-view.d.ts.map +1 -1
- package/dist/composed/schedule-view.js +52 -39
- package/dist/composed/schedule-view.js.map +1 -1
- package/dist/shell/notification-preferences.d.ts.map +1 -1
- package/dist/shell/notification-preferences.js +115 -114
- package/dist/shell/notification-preferences.js.map +1 -1
- package/dist/ui/badge-group.d.ts.map +1 -1
- package/dist/ui/card.d.ts +66 -16
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +85 -60
- package/dist/ui/card.js.map +1 -1
- package/dist/ui/chat/message.d.ts.map +1 -1
- package/dist/ui/color-input.d.ts.map +1 -1
- package/dist/ui/color-input.js +18 -18
- package/dist/ui/color-input.js.map +1 -1
- package/dist/ui/data-table-body.d.ts.map +1 -1
- package/dist/ui/data-table-body.js +94 -64
- package/dist/ui/data-table-body.js.map +1 -1
- package/dist/ui/data-table-card.d.ts.map +1 -1
- package/dist/ui/data-table-card.js +50 -43
- package/dist/ui/data-table-card.js.map +1 -1
- package/dist/ui/data-table-context.d.ts +0 -4
- package/dist/ui/data-table-context.d.ts.map +1 -1
- package/dist/ui/data-table-context.js +8 -12
- package/dist/ui/data-table-context.js.map +1 -1
- package/dist/ui/data-table-header.d.ts.map +1 -1
- package/dist/ui/data-table-header.js +2 -2
- package/dist/ui/data-table-header.js.map +1 -1
- package/dist/ui/data-table.d.ts.map +1 -1
- package/dist/ui/data-table.js +185 -182
- package/dist/ui/data-table.js.map +1 -1
- package/dist/ui/index.d.ts +3 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +59 -58
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/lib/mention.d.ts +11 -0
- package/dist/ui/lib/mention.d.ts.map +1 -0
- package/dist/ui/segmented-control.js +4 -4
- package/dist/ui/segmented-control.js.map +1 -1
- package/dist/ui/separator.d.ts +6 -5
- package/dist/ui/separator.d.ts.map +1 -1
- package/dist/ui/separator.js +7 -10
- package/dist/ui/separator.js.map +1 -1
- package/dist/ui/split-button.d.ts.map +1 -1
- package/dist/ui/split-button.js +62 -129
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/stat-card.d.ts +7 -0
- package/dist/ui/stat-card.d.ts.map +1 -1
- package/dist/ui/stat-card.js +144 -126
- package/dist/ui/stat-card.js.map +1 -1
- package/dist/ui/table-row-link.d.ts +45 -0
- package/dist/ui/table-row-link.d.ts.map +1 -0
- package/dist/ui/table-row-link.js +16 -0
- package/dist/ui/table-row-link.js.map +1 -0
- package/dist/ui/table.d.ts +49 -5
- package/dist/ui/table.d.ts.map +1 -1
- package/dist/ui/table.js +39 -29
- package/dist/ui/table.js.map +1 -1
- package/dist/ui/toast-types.d.ts +10 -0
- package/dist/ui/toast-types.d.ts.map +1 -1
- package/dist/ui/toast.d.ts +6 -2
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +56 -54
- package/dist/ui/toast.js.map +1 -1
- package/docs/components/composed/content-card.md +2 -0
- package/docs/components/ui/button.md +3 -3
- package/docs/components/ui/card.md +27 -10
- package/docs/components/ui/chat.md +1 -1
- package/docs/components/ui/color-input.md +2 -2
- package/docs/components/ui/data-table.md +8 -1
- package/docs/components/ui/segmented-control.md +2 -2
- package/docs/components/ui/separator.md +3 -1
- package/docs/components/ui/split-button.md +3 -0
- package/docs/components/ui/stat-card.md +10 -2
- package/docs/components/ui/table-row-link.md +41 -0
- package/docs/components/ui/table.md +69 -0
- package/docs/components/ui/toast.md +10 -6
- package/docs/recipes/install-next-app-router.md +1 -1
- package/docs/recipes/troubleshoot.md +1 -1
- package/llms.txt +159 -781
- package/make-kit/components/card.md +54 -16
- package/make-kit/components/table.md +45 -7
- package/make-kit/foundations/spacing.md +3 -1
- package/make-kit/foundations/surfaces.md +1 -1
- package/mcp-manifest.json +12349 -0
- package/mcp-manifest.schema.json +232 -0
- package/package.json +8 -3
- package/skill/README.md +0 -1
- package/skill/SKILL.md +9 -8
- package/skill/references/components.md +159 -781
- package/skill/references/setup-next-app-router.md +1 -1
- package/skill/references/troubleshoot.md +1 -1
- package/llms-full.txt +0 -7198
- package/llms-quick.txt +0 -251
- package/skill/references/components-full.md +0 -7200
package/dist/_chunks/chat.js
CHANGED
|
@@ -9,45 +9,46 @@ import { t as u } from "./normalize-icon.js";
|
|
|
9
9
|
import { Button as d } from "../ui/button.js";
|
|
10
10
|
import { Textarea as f } from "../ui/textarea.js";
|
|
11
11
|
import { Tooltip as p, TooltipContent as m, TooltipTrigger as h } from "../ui/tooltip.js";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
12
|
+
import { t as g } from "./mention.js";
|
|
13
|
+
import * as _ from "react";
|
|
14
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
15
|
+
import { IconAlertCircle as b, IconSend as x, IconSquare as S, IconTrash as C } from "@tabler/icons-react";
|
|
16
|
+
import { AnimatePresence as w, motion as T } from "framer-motion";
|
|
16
17
|
//#region src/ui/chat/date-separator.tsx
|
|
17
|
-
function
|
|
18
|
+
function E(e) {
|
|
18
19
|
let t = /* @__PURE__ */ new Date(), n = new Date(t.getFullYear(), t.getMonth(), t.getDate()), r = new Date(e.getFullYear(), e.getMonth(), e.getDate()), i = n.getTime() - r.getTime(), a = Math.round(i / (1e3 * 60 * 60 * 24));
|
|
19
20
|
if (a === 0) return "Today";
|
|
20
21
|
if (a === 1) return "Yesterday";
|
|
21
22
|
let o = e.toLocaleString("en-US", { month: "short" }), s = e.getDate();
|
|
22
23
|
return e.getFullYear() === t.getFullYear() ? `${o} ${s}` : `${o} ${s}, ${e.getFullYear()}`;
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
let r = typeof e == "string" ? new Date(e) : e, a = t ? t(r) :
|
|
26
|
-
return /* @__PURE__ */
|
|
25
|
+
function D({ date: e, format: t, className: n }) {
|
|
26
|
+
let r = typeof e == "string" ? new Date(e) : e, a = t ? t(r) : E(r);
|
|
27
|
+
return /* @__PURE__ */ y("div", {
|
|
27
28
|
className: i("flex items-center gap-ds-03 py-ds-03", n),
|
|
28
29
|
children: [
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ v("div", { className: "flex-1 border-t border-surface-border-subtle" }),
|
|
31
|
+
/* @__PURE__ */ v("span", {
|
|
31
32
|
className: "text-ds-xs font-medium text-surface-fg-subtle/50 uppercase tracking-wider",
|
|
32
33
|
children: a
|
|
33
34
|
}),
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ v("div", { className: "flex-1 border-t border-surface-border-subtle" })
|
|
35
36
|
]
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
+
D.displayName = "DateSeparator";
|
|
39
40
|
//#endregion
|
|
40
41
|
//#region src/ui/chat/message.tsx
|
|
41
|
-
var
|
|
42
|
+
var O = _.createContext({
|
|
42
43
|
variant: "flat",
|
|
43
44
|
placement: "start",
|
|
44
45
|
grouped: !1
|
|
45
46
|
});
|
|
46
|
-
function
|
|
47
|
-
return
|
|
47
|
+
function k() {
|
|
48
|
+
return _.useContext(O);
|
|
48
49
|
}
|
|
49
|
-
var
|
|
50
|
-
let m =
|
|
50
|
+
var A = _.forwardRef(({ children: e, variant: r = "flat", placement: a = "start", highlight: s, grouped: c = !1, deleted: l = !1, deletedText: u = "This message was deleted", className: d, ...f }, p) => {
|
|
51
|
+
let m = _.useMemo(() => ({
|
|
51
52
|
variant: r,
|
|
52
53
|
placement: a,
|
|
53
54
|
grouped: c,
|
|
@@ -58,7 +59,7 @@ var k = g.forwardRef(({ children: e, variant: r = "flat", placement: a = "start"
|
|
|
58
59
|
c,
|
|
59
60
|
s
|
|
60
61
|
]);
|
|
61
|
-
return l ? /* @__PURE__ */
|
|
62
|
+
return l ? /* @__PURE__ */ y(T.div, {
|
|
62
63
|
ref: p,
|
|
63
64
|
initial: {
|
|
64
65
|
opacity: 0,
|
|
@@ -71,14 +72,15 @@ var k = g.forwardRef(({ children: e, variant: r = "flat", placement: a = "start"
|
|
|
71
72
|
transition: n.snappy,
|
|
72
73
|
className: i("flex items-center gap-ds-02 py-ds-02 text-ds-xs text-surface-fg-subtle/50 italic", d),
|
|
73
74
|
...t(f),
|
|
74
|
-
children: [/* @__PURE__ */
|
|
75
|
-
icon:
|
|
75
|
+
children: [/* @__PURE__ */ v(o, {
|
|
76
|
+
icon: C,
|
|
76
77
|
size: "xs"
|
|
77
78
|
}), u]
|
|
78
|
-
}) : r === "bubble" ? /* @__PURE__ */
|
|
79
|
+
}) : r === "bubble" ? /* @__PURE__ */ v(O.Provider, {
|
|
79
80
|
value: m,
|
|
80
|
-
children: /* @__PURE__ */
|
|
81
|
+
children: /* @__PURE__ */ v(T.div, {
|
|
81
82
|
ref: p,
|
|
83
|
+
"data-highlight": s,
|
|
82
84
|
initial: {
|
|
83
85
|
opacity: 0,
|
|
84
86
|
y: 8
|
|
@@ -88,17 +90,18 @@ var k = g.forwardRef(({ children: e, variant: r = "flat", placement: a = "start"
|
|
|
88
90
|
y: 0
|
|
89
91
|
},
|
|
90
92
|
transition: n.snappy,
|
|
91
|
-
className: i("group/message relative flex", a === "end" ? "justify-end" : "justify-start",
|
|
93
|
+
className: i("group/message relative flex", a === "end" ? "justify-end" : "justify-start", g, s === "internal" && "bg-warning-2/50 rounded-control-inner", d),
|
|
92
94
|
...t(f),
|
|
93
|
-
children: /* @__PURE__ */
|
|
95
|
+
children: /* @__PURE__ */ v("div", {
|
|
94
96
|
className: i("max-w-[85%] rounded-bubble px-ds-04 py-ds-03", a === "end" ? "bg-accent-3 text-surface-fg" : "bg-surface-raised text-surface-fg"),
|
|
95
97
|
children: e
|
|
96
98
|
})
|
|
97
99
|
})
|
|
98
|
-
}) : /* @__PURE__ */
|
|
100
|
+
}) : /* @__PURE__ */ v(O.Provider, {
|
|
99
101
|
value: m,
|
|
100
|
-
children: /* @__PURE__ */
|
|
102
|
+
children: /* @__PURE__ */ v(T.div, {
|
|
101
103
|
ref: p,
|
|
104
|
+
"data-highlight": s,
|
|
102
105
|
initial: {
|
|
103
106
|
opacity: 0,
|
|
104
107
|
y: 8
|
|
@@ -108,100 +111,100 @@ var k = g.forwardRef(({ children: e, variant: r = "flat", placement: a = "start"
|
|
|
108
111
|
y: 0
|
|
109
112
|
},
|
|
110
113
|
transition: n.snappy,
|
|
111
|
-
className: i("group/message relative flex gap-ds-04", c && "-mt-ds-01",
|
|
114
|
+
className: i("group/message relative flex gap-ds-04", c && "-mt-ds-01", g, s === "internal" && "bg-warning-2/50 rounded-control-inner", d),
|
|
112
115
|
...t(f),
|
|
113
116
|
children: e
|
|
114
117
|
})
|
|
115
118
|
});
|
|
116
119
|
});
|
|
117
|
-
|
|
118
|
-
function
|
|
119
|
-
let { grouped: d } =
|
|
120
|
-
return d ? /* @__PURE__ */
|
|
120
|
+
A.displayName = "Message";
|
|
121
|
+
function j({ src: t, fallback: n, icon: r, size: a = "md", children: o }) {
|
|
122
|
+
let { grouped: d } = k(), f = a === "sm" ? "w-5" : "w-6";
|
|
123
|
+
return d ? /* @__PURE__ */ v("div", { className: i(f, a === "sm" ? "h-5" : "h-6", "shrink-0") }) : o ? /* @__PURE__ */ v("div", {
|
|
121
124
|
className: i(f, "shrink-0 flex items-start"),
|
|
122
125
|
children: o
|
|
123
|
-
}) : r ? /* @__PURE__ */
|
|
126
|
+
}) : r ? /* @__PURE__ */ v("div", {
|
|
124
127
|
className: i(f, a === "sm" ? "h-5" : "h-6", "shrink-0 flex items-center justify-center rounded-pill bg-surface-raised-hover"),
|
|
125
|
-
children: /* @__PURE__ */
|
|
128
|
+
children: /* @__PURE__ */ v(e, {
|
|
126
129
|
size: a === "sm" ? "xs" : "sm",
|
|
127
130
|
children: u(r)
|
|
128
131
|
})
|
|
129
|
-
}) : /* @__PURE__ */
|
|
132
|
+
}) : /* @__PURE__ */ v("div", {
|
|
130
133
|
className: i(f, "shrink-0"),
|
|
131
|
-
children: /* @__PURE__ */
|
|
134
|
+
children: /* @__PURE__ */ y(s, {
|
|
132
135
|
size: a === "sm" ? "xs" : "sm",
|
|
133
|
-
children: [t && /* @__PURE__ */
|
|
136
|
+
children: [t && /* @__PURE__ */ v(l, {
|
|
134
137
|
src: t,
|
|
135
138
|
alt: n ?? ""
|
|
136
|
-
}), /* @__PURE__ */
|
|
139
|
+
}), /* @__PURE__ */ v(c, { children: n ?? "" })]
|
|
137
140
|
})
|
|
138
141
|
});
|
|
139
142
|
}
|
|
140
|
-
|
|
141
|
-
function
|
|
142
|
-
return /* @__PURE__ */
|
|
143
|
+
j.displayName = "Message.Avatar";
|
|
144
|
+
function M({ children: e, className: t, ...n }) {
|
|
145
|
+
return /* @__PURE__ */ v("div", {
|
|
143
146
|
className: i("min-w-0 flex-1 flex flex-col gap-ds-02", t),
|
|
144
147
|
...n,
|
|
145
148
|
children: e
|
|
146
149
|
});
|
|
147
150
|
}
|
|
148
|
-
|
|
149
|
-
function
|
|
151
|
+
M.displayName = "Message.Content";
|
|
152
|
+
function N(e) {
|
|
150
153
|
return e.toLocaleTimeString("en-US", {
|
|
151
154
|
hour: "numeric",
|
|
152
155
|
minute: "2-digit"
|
|
153
156
|
});
|
|
154
157
|
}
|
|
155
|
-
function
|
|
156
|
-
let { grouped: a } =
|
|
158
|
+
function P({ name: e, badge: t, timestamp: n, formattedTimestamp: r, timestampFormat: i = N }) {
|
|
159
|
+
let { grouped: a } = k();
|
|
157
160
|
if (a) return null;
|
|
158
161
|
let o = r ?? (n ? i(n) : void 0);
|
|
159
|
-
return /* @__PURE__ */
|
|
162
|
+
return /* @__PURE__ */ y("div", {
|
|
160
163
|
className: "flex items-baseline gap-ds-02",
|
|
161
164
|
children: [
|
|
162
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ v("span", {
|
|
163
166
|
className: "font-semibold text-[13px] text-surface-fg",
|
|
164
167
|
children: e
|
|
165
168
|
}),
|
|
166
169
|
t,
|
|
167
|
-
o && /* @__PURE__ */
|
|
170
|
+
o && /* @__PURE__ */ v("span", {
|
|
168
171
|
className: "text-[11px] text-surface-fg-subtle/50",
|
|
169
172
|
children: o
|
|
170
173
|
})
|
|
171
174
|
]
|
|
172
175
|
});
|
|
173
176
|
}
|
|
174
|
-
|
|
175
|
-
function
|
|
176
|
-
return /* @__PURE__ */
|
|
177
|
+
P.displayName = "Message.Author";
|
|
178
|
+
function F({ children: e, className: t, ...n }) {
|
|
179
|
+
return /* @__PURE__ */ v("div", {
|
|
177
180
|
className: i("text-[13px] leading-relaxed text-surface-fg whitespace-pre-wrap", t),
|
|
178
181
|
...n,
|
|
179
182
|
children: e
|
|
180
183
|
});
|
|
181
184
|
}
|
|
182
|
-
|
|
183
|
-
function
|
|
184
|
-
let [o, s] =
|
|
185
|
-
|
|
185
|
+
F.displayName = "Message.Body";
|
|
186
|
+
function I({ content: e, onSave: t, onCancel: n, canEdit: r = !1, renderContent: a }) {
|
|
187
|
+
let [o, s] = _.useState(!1), [c, l] = _.useState(e), u = _.useRef(null);
|
|
188
|
+
_.useEffect(() => {
|
|
186
189
|
o && u.current && (u.current.focus(), u.current.select());
|
|
187
190
|
}, [o]);
|
|
188
|
-
let d =
|
|
191
|
+
let d = _.useCallback(() => {
|
|
189
192
|
r && (l(e), s(!0));
|
|
190
|
-
}, [r, e]), p =
|
|
193
|
+
}, [r, e]), p = _.useCallback(() => {
|
|
191
194
|
let n = c.trim();
|
|
192
195
|
n && n !== e && t(n), s(!1);
|
|
193
196
|
}, [
|
|
194
197
|
c,
|
|
195
198
|
e,
|
|
196
199
|
t
|
|
197
|
-
]), m =
|
|
200
|
+
]), m = _.useCallback(() => {
|
|
198
201
|
s(!1), l(e), n?.();
|
|
199
|
-
}, [e, n]), h =
|
|
202
|
+
}, [e, n]), h = _.useCallback((e) => {
|
|
200
203
|
e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), p()) : e.key === "Escape" && (e.preventDefault(), m());
|
|
201
204
|
}, [p, m]);
|
|
202
|
-
return o ? /* @__PURE__ */
|
|
205
|
+
return o ? /* @__PURE__ */ y("div", {
|
|
203
206
|
className: "text-[13px] leading-relaxed",
|
|
204
|
-
children: [/* @__PURE__ */
|
|
207
|
+
children: [/* @__PURE__ */ v(f, {
|
|
205
208
|
ref: u,
|
|
206
209
|
value: c,
|
|
207
210
|
onChange: (e) => l(e.target.value),
|
|
@@ -209,11 +212,11 @@ function F({ content: e, onSave: t, onCancel: n, canEdit: r = !1, renderContent:
|
|
|
209
212
|
onBlur: p,
|
|
210
213
|
className: "resize-none rounded-control-inner bg-surface-raised-hover px-ds-02 py-ds-01 text-[13px] leading-relaxed",
|
|
211
214
|
rows: 2
|
|
212
|
-
}), /* @__PURE__ */
|
|
215
|
+
}), /* @__PURE__ */ v("div", {
|
|
213
216
|
className: "mt-ds-01 text-ds-xs text-surface-fg-subtle/50",
|
|
214
217
|
children: "Enter to save · Escape to cancel"
|
|
215
218
|
})]
|
|
216
|
-
}) : /* @__PURE__ */
|
|
219
|
+
}) : /* @__PURE__ */ v("div", {
|
|
217
220
|
className: i("text-[13px] leading-relaxed text-surface-fg whitespace-pre-wrap", r && "cursor-pointer hover:bg-surface-raised-hover rounded-control-inner transition-colors"),
|
|
218
221
|
onClick: d,
|
|
219
222
|
role: r ? "button" : void 0,
|
|
@@ -224,79 +227,79 @@ function F({ content: e, onSave: t, onCancel: n, canEdit: r = !1, renderContent:
|
|
|
224
227
|
children: a ? a(e) : e
|
|
225
228
|
});
|
|
226
229
|
}
|
|
227
|
-
|
|
228
|
-
function
|
|
229
|
-
return e.length === 0 ? null : /* @__PURE__ */
|
|
230
|
+
I.displayName = "Message.EditableBody";
|
|
231
|
+
function L({ reactions: e, onReact: t }) {
|
|
232
|
+
return e.length === 0 ? null : /* @__PURE__ */ v("div", {
|
|
230
233
|
className: "flex flex-wrap gap-ds-02 mt-ds-03",
|
|
231
|
-
children: e.map((e) => /* @__PURE__ */
|
|
234
|
+
children: e.map((e) => /* @__PURE__ */ y("button", {
|
|
232
235
|
type: "button",
|
|
233
236
|
onClick: () => t(e.emoji),
|
|
234
237
|
"aria-label": `${e.emoji} ${e.count} reaction${e.count === 1 ? "" : "s"}${e.reacted ? ", you reacted" : ""}`,
|
|
235
238
|
className: i("inline-flex items-center gap-ds-01 rounded-pill px-ds-02 py-ds-01 text-ds-xs transition-colors", e.reacted ? "bg-accent-3 ring-1 ring-accent-6" : "bg-surface-raised-hover hover:bg-surface-raised-active"),
|
|
236
|
-
children: [/* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ v("span", { children: e.emoji }), /* @__PURE__ */ v("span", { children: e.count })]
|
|
237
240
|
}, e.emoji))
|
|
238
241
|
});
|
|
239
242
|
}
|
|
240
|
-
|
|
241
|
-
function
|
|
242
|
-
return /* @__PURE__ */
|
|
243
|
+
L.displayName = "Message.Reactions";
|
|
244
|
+
function R({ children: e, delay: t = 100 }) {
|
|
245
|
+
return /* @__PURE__ */ v("div", {
|
|
243
246
|
className: i("absolute -top-2 right-0 z-10", "flex items-center gap-ds-01 rounded-control bg-surface-raised px-ds-01 py-ds-01 shadow-raised", "opacity-0 group-hover/message:opacity-100 group-focus-within/message:opacity-100 transition-opacity duration-150"),
|
|
244
247
|
style: { transitionDelay: `${t}ms` },
|
|
245
248
|
children: e
|
|
246
249
|
});
|
|
247
250
|
}
|
|
248
|
-
|
|
249
|
-
function
|
|
250
|
-
return /* @__PURE__ */
|
|
251
|
+
R.displayName = "Message.Actions";
|
|
252
|
+
function z({ icon: t, label: n, onClick: r, variant: a = "default" }) {
|
|
253
|
+
return /* @__PURE__ */ y(p, { children: [/* @__PURE__ */ v(h, {
|
|
251
254
|
asChild: !0,
|
|
252
|
-
children: /* @__PURE__ */
|
|
255
|
+
children: /* @__PURE__ */ v("button", {
|
|
253
256
|
type: "button",
|
|
254
257
|
onClick: r,
|
|
255
258
|
"aria-label": n,
|
|
256
259
|
className: i("p-ds-02 rounded-control-inner transition-colors", a === "default" && "text-surface-fg-subtle hover:text-surface-fg hover:bg-surface-raised-hover", a === "danger" && "text-surface-fg-subtle hover:text-error-11 hover:bg-surface-raised-hover"),
|
|
257
|
-
children: /* @__PURE__ */
|
|
260
|
+
children: /* @__PURE__ */ v(e, {
|
|
258
261
|
size: "xs",
|
|
259
262
|
children: u(t)
|
|
260
263
|
})
|
|
261
264
|
})
|
|
262
|
-
}), /* @__PURE__ */
|
|
265
|
+
}), /* @__PURE__ */ v(m, { children: n })] });
|
|
263
266
|
}
|
|
264
|
-
|
|
265
|
-
var
|
|
266
|
-
Avatar:
|
|
267
|
-
Content:
|
|
268
|
-
Author:
|
|
269
|
-
Body:
|
|
270
|
-
EditableBody:
|
|
271
|
-
Reactions:
|
|
272
|
-
Actions:
|
|
273
|
-
Action:
|
|
274
|
-
}),
|
|
275
|
-
let [h,
|
|
276
|
-
let e =
|
|
267
|
+
z.displayName = "Message.Action";
|
|
268
|
+
var B = Object.assign(A, {
|
|
269
|
+
Avatar: j,
|
|
270
|
+
Content: M,
|
|
271
|
+
Author: P,
|
|
272
|
+
Body: F,
|
|
273
|
+
EditableBody: I,
|
|
274
|
+
Reactions: L,
|
|
275
|
+
Actions: R,
|
|
276
|
+
Action: z
|
|
277
|
+
}), V = _.forwardRef(({ onSubmit: e, placeholder: t = "Type a message...", disabled: n = !1, isStreaming: r = !1, onCancel: a, leadingSlot: s, trailingSlot: c, disclaimer: l, sendIcon: u, className: f, ...p }, m) => {
|
|
278
|
+
let [h, g] = _.useState(""), b = _.useRef(null), C = _.useCallback(() => {
|
|
279
|
+
let e = b.current;
|
|
277
280
|
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 160)}px`);
|
|
278
|
-
}, []), w =
|
|
279
|
-
|
|
280
|
-
}, [C]), T =
|
|
281
|
+
}, []), w = _.useCallback((e) => {
|
|
282
|
+
g(e.target.value), C();
|
|
283
|
+
}, [C]), T = _.useCallback(() => {
|
|
281
284
|
let t = h.trim();
|
|
282
|
-
!t || r || (e(t),
|
|
285
|
+
!t || r || (e(t), g(""), b.current && (b.current.style.height = "auto"));
|
|
283
286
|
}, [
|
|
284
287
|
h,
|
|
285
288
|
r,
|
|
286
289
|
e
|
|
287
|
-
]), E =
|
|
290
|
+
]), E = _.useCallback((e) => {
|
|
288
291
|
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), r || T());
|
|
289
292
|
}, [r, T]), D = h.trim().length === 0;
|
|
290
|
-
return /* @__PURE__ */
|
|
293
|
+
return /* @__PURE__ */ y("div", {
|
|
291
294
|
ref: m,
|
|
292
295
|
className: i("border-t border-surface-border-subtle px-ds-05 py-ds-04", f),
|
|
293
296
|
...p,
|
|
294
|
-
children: [/* @__PURE__ */
|
|
297
|
+
children: [/* @__PURE__ */ y("div", {
|
|
295
298
|
className: "flex items-end gap-ds-02 rounded-overlay-lg border border-surface-border bg-surface-base p-ds-03",
|
|
296
299
|
children: [
|
|
297
300
|
s,
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
ref:
|
|
301
|
+
/* @__PURE__ */ v("textarea", {
|
|
302
|
+
ref: b,
|
|
300
303
|
value: h,
|
|
301
304
|
onChange: w,
|
|
302
305
|
onKeyDown: E,
|
|
@@ -307,74 +310,74 @@ var z = Object.assign(k, {
|
|
|
307
310
|
className: "flex-1 resize-none bg-transparent px-ds-02 py-ds-01 text-ds-sm text-surface-fg placeholder:text-surface-fg-subtle/50 focus:outline-hidden disabled:opacity-50",
|
|
308
311
|
style: { maxHeight: 160 }
|
|
309
312
|
}),
|
|
310
|
-
r ? /* @__PURE__ */
|
|
313
|
+
r ? /* @__PURE__ */ v(d, {
|
|
311
314
|
variant: "ghost",
|
|
312
315
|
size: "icon-sm",
|
|
313
316
|
color: "error",
|
|
314
317
|
onClick: a,
|
|
315
318
|
"aria-label": "Stop",
|
|
316
|
-
children: /* @__PURE__ */
|
|
317
|
-
icon:
|
|
319
|
+
children: /* @__PURE__ */ v(o, {
|
|
320
|
+
icon: S,
|
|
318
321
|
size: "sm"
|
|
319
322
|
})
|
|
320
|
-
}) : /* @__PURE__ */
|
|
323
|
+
}) : /* @__PURE__ */ v(d, {
|
|
321
324
|
variant: "ghost",
|
|
322
325
|
size: "icon-sm",
|
|
323
326
|
onClick: T,
|
|
324
327
|
disabled: D || n,
|
|
325
328
|
"aria-label": "Send",
|
|
326
|
-
children: u ?? /* @__PURE__ */
|
|
327
|
-
icon:
|
|
329
|
+
children: u ?? /* @__PURE__ */ v(o, {
|
|
330
|
+
icon: x,
|
|
328
331
|
size: "sm"
|
|
329
332
|
})
|
|
330
333
|
}),
|
|
331
334
|
c
|
|
332
335
|
]
|
|
333
|
-
}), l && /* @__PURE__ */
|
|
336
|
+
}), l && /* @__PURE__ */ v("p", {
|
|
334
337
|
className: "mt-ds-02 text-center text-ds-xs text-surface-fg-subtle/50",
|
|
335
338
|
children: l
|
|
336
339
|
})]
|
|
337
340
|
});
|
|
338
341
|
});
|
|
339
|
-
|
|
342
|
+
V.displayName = "MessageInput";
|
|
340
343
|
//#endregion
|
|
341
344
|
//#region src/ui/chat/message-list.tsx
|
|
342
|
-
var
|
|
343
|
-
let h =
|
|
345
|
+
var H = _.forwardRef(({ children: e, autoScroll: t = !0, newMessageCount: n = 0, onScrollToBottom: o, onLoadMore: s, loadingMore: c = !1, emptySlot: l, scrollToBottomSlot: u, headerSlot: d, className: f, ...p }, m) => {
|
|
346
|
+
let h = _.useRef(null), g = _.useRef(!0), [b, x] = _.useState(!0), S = _.useRef(!1), C = _.useRef(0), E = _.Children.count(e) === 0 && !c, D = _.useCallback(() => {
|
|
344
347
|
let e = h.current;
|
|
345
348
|
if (!e) return;
|
|
346
349
|
let t = e.scrollHeight - e.scrollTop - e.clientHeight < 40;
|
|
347
|
-
|
|
350
|
+
g.current = t, x(t), e.scrollTop < 100 && s && !S.current && (S.current = !0, C.current = e.scrollHeight, s());
|
|
348
351
|
}, [s]);
|
|
349
|
-
|
|
352
|
+
_.useLayoutEffect(() => {
|
|
350
353
|
let e = h.current;
|
|
351
354
|
if (e) {
|
|
352
355
|
if (S.current) {
|
|
353
|
-
e.scrollTop = e.scrollHeight -
|
|
356
|
+
e.scrollTop = e.scrollHeight - C.current, S.current = !1;
|
|
354
357
|
return;
|
|
355
358
|
}
|
|
356
|
-
t &&
|
|
359
|
+
t && g.current && e.scrollTo({
|
|
357
360
|
top: e.scrollHeight,
|
|
358
361
|
behavior: "smooth"
|
|
359
362
|
});
|
|
360
363
|
}
|
|
361
|
-
}, [e, t]),
|
|
364
|
+
}, [e, t]), _.useEffect(() => {
|
|
362
365
|
c || (S.current = !1);
|
|
363
366
|
}, [c]);
|
|
364
|
-
let O = n > 0 && !b, k =
|
|
367
|
+
let O = n > 0 && !b, k = _.useCallback(() => {
|
|
365
368
|
let e = h.current;
|
|
366
369
|
e && e.scrollTo({
|
|
367
370
|
top: e.scrollHeight,
|
|
368
371
|
behavior: "smooth"
|
|
369
372
|
}), o?.();
|
|
370
373
|
}, [o]);
|
|
371
|
-
return /* @__PURE__ */
|
|
374
|
+
return /* @__PURE__ */ y("div", {
|
|
372
375
|
ref: m,
|
|
373
376
|
className: i("relative flex flex-1 flex-col overflow-hidden", f),
|
|
374
377
|
...p,
|
|
375
378
|
children: [
|
|
376
379
|
d,
|
|
377
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ y("div", {
|
|
378
381
|
ref: h,
|
|
379
382
|
role: "log",
|
|
380
383
|
"aria-live": "polite",
|
|
@@ -385,18 +388,18 @@ var V = g.forwardRef(({ children: e, autoScroll: t = !0, newMessageCount: n = 0,
|
|
|
385
388
|
scrollbarColor: "var(--color-surface-border) transparent"
|
|
386
389
|
},
|
|
387
390
|
onScroll: D,
|
|
388
|
-
children: [c && /* @__PURE__ */
|
|
391
|
+
children: [c && /* @__PURE__ */ v("div", {
|
|
389
392
|
className: "flex justify-center py-ds-03",
|
|
390
|
-
children: /* @__PURE__ */
|
|
391
|
-
}), E ? l : /* @__PURE__ */
|
|
393
|
+
children: /* @__PURE__ */ v(a, { size: "sm" })
|
|
394
|
+
}), E ? l : /* @__PURE__ */ v("div", {
|
|
392
395
|
className: "flex flex-col gap-ds-04",
|
|
393
|
-
children: /* @__PURE__ */
|
|
396
|
+
children: /* @__PURE__ */ v(w, {
|
|
394
397
|
initial: !1,
|
|
395
398
|
children: e
|
|
396
399
|
})
|
|
397
400
|
})]
|
|
398
401
|
}),
|
|
399
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ v(w, { children: O && /* @__PURE__ */ y(T.button, {
|
|
400
403
|
initial: {
|
|
401
404
|
opacity: 0,
|
|
402
405
|
y: 10
|
|
@@ -417,76 +420,76 @@ var V = g.forwardRef(({ children: e, autoScroll: t = !0, newMessageCount: n = 0,
|
|
|
417
420
|
]
|
|
418
421
|
});
|
|
419
422
|
});
|
|
420
|
-
|
|
423
|
+
H.displayName = "MessageList";
|
|
421
424
|
//#endregion
|
|
422
425
|
//#region src/ui/chat/system-message.tsx
|
|
423
|
-
function
|
|
426
|
+
function U(e) {
|
|
424
427
|
return new Date(e).toLocaleTimeString("en-US", {
|
|
425
428
|
hour: "numeric",
|
|
426
429
|
minute: "2-digit"
|
|
427
430
|
});
|
|
428
431
|
}
|
|
429
|
-
var
|
|
432
|
+
var W = _.forwardRef(({ icon: t, timestamp: n, variant: r = "event", children: a, className: s, ...c }, l) => r === "alert" ? /* @__PURE__ */ v("div", {
|
|
430
433
|
ref: l,
|
|
431
434
|
role: "alert",
|
|
432
435
|
className: i("flex justify-center", s),
|
|
433
436
|
...c,
|
|
434
|
-
children: /* @__PURE__ */
|
|
437
|
+
children: /* @__PURE__ */ y("div", {
|
|
435
438
|
className: "flex items-center gap-ds-03 rounded-surface bg-error-3 px-ds-04 py-ds-03",
|
|
436
439
|
children: [
|
|
437
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ v(e, {
|
|
438
441
|
size: "sm",
|
|
439
|
-
children: u(t) ?? /* @__PURE__ */
|
|
442
|
+
children: u(t) ?? /* @__PURE__ */ v(o, { icon: b })
|
|
440
443
|
}),
|
|
441
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ v("span", {
|
|
442
445
|
className: "text-ds-sm text-error-11",
|
|
443
446
|
children: a
|
|
444
447
|
}),
|
|
445
|
-
n && /* @__PURE__ */
|
|
448
|
+
n && /* @__PURE__ */ v("span", {
|
|
446
449
|
className: "text-ds-sm text-error-11/60",
|
|
447
|
-
children:
|
|
450
|
+
children: U(n)
|
|
448
451
|
})
|
|
449
452
|
]
|
|
450
453
|
})
|
|
451
|
-
}) : /* @__PURE__ */
|
|
454
|
+
}) : /* @__PURE__ */ y("div", {
|
|
452
455
|
ref: l,
|
|
453
456
|
className: i("flex items-center gap-ds-02 rounded-control-inner bg-surface-raised-hover/30 px-ds-02 py-ds-01 -mx-ds-02 text-ds-sm text-surface-fg-subtle/60", s),
|
|
454
457
|
...c,
|
|
455
458
|
children: [
|
|
456
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ v(e, {
|
|
457
460
|
size: "xs",
|
|
458
461
|
children: u(t)
|
|
459
462
|
}),
|
|
460
|
-
/* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ v("span", {
|
|
461
464
|
className: "flex-1",
|
|
462
465
|
children: a
|
|
463
466
|
}),
|
|
464
|
-
n && /* @__PURE__ */
|
|
467
|
+
n && /* @__PURE__ */ v("span", { children: U(n) })
|
|
465
468
|
]
|
|
466
469
|
}));
|
|
467
|
-
|
|
470
|
+
W.displayName = "SystemMessage";
|
|
468
471
|
//#endregion
|
|
469
472
|
//#region src/ui/chat/typing-indicator.tsx
|
|
470
|
-
function
|
|
473
|
+
function G(e) {
|
|
471
474
|
return e.length === 1 ? `${e[0].name} is typing...` : e.length === 2 ? `${e[0].name} and ${e[1].name} are typing...` : "Several people are typing...";
|
|
472
475
|
}
|
|
473
|
-
function
|
|
474
|
-
return /* @__PURE__ */
|
|
476
|
+
function K({ users: e, className: t }) {
|
|
477
|
+
return /* @__PURE__ */ v("div", {
|
|
475
478
|
className: i("min-h-[24px] px-ds-05", t),
|
|
476
479
|
role: "status",
|
|
477
480
|
"aria-live": "polite",
|
|
478
|
-
children: /* @__PURE__ */
|
|
481
|
+
children: /* @__PURE__ */ v(w, { children: e.length > 0 && /* @__PURE__ */ y(T.div, {
|
|
479
482
|
initial: { opacity: 0 },
|
|
480
483
|
animate: { opacity: 1 },
|
|
481
484
|
exit: { opacity: 0 },
|
|
482
485
|
className: "flex items-center gap-ds-02 text-ds-xs text-surface-fg-subtle",
|
|
483
|
-
children: [/* @__PURE__ */
|
|
486
|
+
children: [/* @__PURE__ */ v("span", {
|
|
484
487
|
className: "flex items-center gap-ds-01",
|
|
485
488
|
children: [
|
|
486
489
|
0,
|
|
487
490
|
1,
|
|
488
491
|
2
|
|
489
|
-
].map((e) => /* @__PURE__ */
|
|
492
|
+
].map((e) => /* @__PURE__ */ v(T.span, {
|
|
490
493
|
className: "h-1 w-1 rounded-pill bg-surface-fg-subtle",
|
|
491
494
|
animate: { y: [
|
|
492
495
|
0,
|
|
@@ -499,26 +502,26 @@ function G({ users: e, className: t }) {
|
|
|
499
502
|
delay: e * .15
|
|
500
503
|
}
|
|
501
504
|
}, e))
|
|
502
|
-
}), /* @__PURE__ */
|
|
505
|
+
}), /* @__PURE__ */ v("span", { children: G(e) })]
|
|
503
506
|
}) })
|
|
504
507
|
});
|
|
505
508
|
}
|
|
506
|
-
|
|
509
|
+
K.displayName = "TypingIndicator";
|
|
507
510
|
//#endregion
|
|
508
511
|
//#region src/ui/chat/unread-separator.tsx
|
|
509
|
-
function
|
|
510
|
-
return /* @__PURE__ */
|
|
512
|
+
function q({ label: e = "NEW", count: t, className: n }) {
|
|
513
|
+
return /* @__PURE__ */ y("div", {
|
|
511
514
|
className: i("relative flex items-center py-ds-02", n),
|
|
512
515
|
children: [
|
|
513
|
-
/* @__PURE__ */
|
|
514
|
-
/* @__PURE__ */
|
|
516
|
+
/* @__PURE__ */ v("div", { className: "flex-1 border-t-2 border-accent-7" }),
|
|
517
|
+
/* @__PURE__ */ v("span", {
|
|
515
518
|
className: "px-ds-03 text-ds-xs font-semibold text-accent-11",
|
|
516
519
|
children: t ? `${t} ${e}` : e
|
|
517
520
|
}),
|
|
518
|
-
/* @__PURE__ */
|
|
521
|
+
/* @__PURE__ */ v("div", { className: "flex-1 border-t-2 border-accent-7" })
|
|
519
522
|
]
|
|
520
523
|
});
|
|
521
524
|
}
|
|
522
|
-
|
|
525
|
+
q.displayName = "UnreadSeparator";
|
|
523
526
|
//#endregion
|
|
524
|
-
export {
|
|
527
|
+
export { V as a, D as c, H as i, K as n, B as o, W as r, k as s, q as t };
|