@dbx-tools/ui-teams 0.6.88 → 0.6.89
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/package.json +4 -4
- package/src/react/teams-chat.tsx +3 -3
package/package.json
CHANGED
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"typescript": "^5.9.3"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@dbx-tools/shared-core": "0.6.
|
|
28
|
-
"@dbx-tools/shared-teams": "0.6.
|
|
29
|
-
"@dbx-tools/ui-appkit": "0.6.
|
|
27
|
+
"@dbx-tools/shared-core": "0.6.89",
|
|
28
|
+
"@dbx-tools/shared-teams": "0.6.89",
|
|
29
|
+
"@dbx-tools/ui-appkit": "0.6.89",
|
|
30
30
|
"adaptivecards": "^3.0.5",
|
|
31
31
|
"marked": "^18.0.5",
|
|
32
32
|
"react": "^19.2.4",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"version": "0.6.
|
|
39
|
+
"version": "0.6.89",
|
|
40
40
|
"type": "module",
|
|
41
41
|
"exports": {
|
|
42
42
|
"./react": "./src/react/index.ts",
|
package/src/react/teams-chat.tsx
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// looks like a Teams channel where the agent always answers in cards.
|
|
6
6
|
|
|
7
7
|
import { hash, json, string } from "@dbx-tools/shared-core";
|
|
8
|
-
import { activity as
|
|
8
|
+
import { activity as sharedActivity, type Activity } from "@dbx-tools/shared-teams";
|
|
9
9
|
import { Avatar, AvatarFallback, Button, Input, Spinner, cn } from "@dbx-tools/ui-appkit/react";
|
|
10
10
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
11
11
|
import { AdaptiveCardView } from "./adaptive-card.tsx";
|
|
@@ -122,7 +122,7 @@ export const TeamsChat = ({
|
|
|
122
122
|
string.trimToNull(String(body?.error ?? "")) ?? `Request failed (${response.status})`,
|
|
123
123
|
);
|
|
124
124
|
}
|
|
125
|
-
const parsed =
|
|
125
|
+
const parsed = sharedActivity.activityResponseSchema.safeParse(body);
|
|
126
126
|
if (!parsed.success) throw new Error("The server returned an unexpected reply.");
|
|
127
127
|
setTranscript((current) => [...current, ...parsed.data.activities]);
|
|
128
128
|
} catch (err) {
|
|
@@ -212,7 +212,7 @@ export const TeamsChat = ({
|
|
|
212
212
|
*/
|
|
213
213
|
const ActivityBubble = ({ activity, userName }: { activity: Activity; userName: string }) => {
|
|
214
214
|
const fromUser = isFromUser(activity);
|
|
215
|
-
const cards =
|
|
215
|
+
const cards = sharedActivity.cardsOf(activity);
|
|
216
216
|
const label = fromUser ? userName : (activity.from?.name ?? "Agent");
|
|
217
217
|
|
|
218
218
|
return (
|