@webority/chat-react 0.128.0 → 0.134.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.
Files changed (90) hide show
  1. package/dist/chat-react.js +14 -11
  2. package/dist/types/ChatAgentTyping.d.ts +4 -0
  3. package/dist/types/ChatAuthorBadge.d.ts +4 -0
  4. package/dist/types/ChatComposer.d.ts +10 -0
  5. package/dist/types/ChatConversationActions.d.ts +7 -0
  6. package/dist/types/ChatEmbed.d.ts +5 -0
  7. package/dist/types/ChatExplain.d.ts +16 -0
  8. package/dist/types/ChatFooter.d.ts +8 -0
  9. package/dist/types/ChatFrame.d.ts +26 -0
  10. package/dist/types/ChatHistory.d.ts +9 -0
  11. package/dist/types/ChatLauncher.d.ts +5 -0
  12. package/dist/types/ChatLiveStatus.d.ts +4 -0
  13. package/dist/types/ChatMessageActions.d.ts +10 -0
  14. package/dist/types/ChatNudge.d.ts +10 -0
  15. package/dist/types/ChatOpenTickets.d.ts +9 -0
  16. package/dist/types/ChatPage.d.ts +49 -0
  17. package/dist/types/ChatPanel.d.ts +9 -0
  18. package/dist/types/ChatPastChats.d.ts +9 -0
  19. package/dist/types/ChatReadAloudButton.d.ts +8 -0
  20. package/dist/types/ChatShell.d.ts +32 -0
  21. package/dist/types/ChatStarters.d.ts +8 -0
  22. package/dist/types/ChatThread.d.ts +15 -0
  23. package/dist/types/chatLive.d.ts +5 -0
  24. package/dist/types/chatPrint.d.ts +6 -0
  25. package/dist/types/chatShared.d.ts +10 -0
  26. package/dist/types/dictationText.d.ts +31 -0
  27. package/dist/types/index.d.ts +20 -14
  28. package/dist/types/loaders/ChatLoader.d.ts +21 -0
  29. package/dist/types/loaders/OrbLoader.d.ts +11 -0
  30. package/dist/types/loaders/PhrasesLoader.d.ts +14 -0
  31. package/dist/types/loaders/SkeletonLoader.d.ts +11 -0
  32. package/dist/types/loaders/StepsLoader.d.ts +12 -0
  33. package/dist/types/loaders/TypingPill.d.ts +12 -0
  34. package/dist/types/recaptcha.d.ts +2 -0
  35. package/dist/types/renderers/ActionPart.d.ts +4 -0
  36. package/dist/types/renderers/ChartPart.d.ts +4 -0
  37. package/dist/types/renderers/ChatLinkContext.d.ts +8 -0
  38. package/dist/types/renderers/FigureText.d.ts +5 -0
  39. package/dist/types/renderers/FiguresPart.d.ts +4 -0
  40. package/dist/types/renderers/FilePart.d.ts +4 -0
  41. package/dist/types/renderers/HandoffPart.d.ts +4 -0
  42. package/dist/types/renderers/ImagePart.d.ts +4 -0
  43. package/dist/types/renderers/InputRequestPart.d.ts +5 -0
  44. package/dist/types/renderers/NoticePart.d.ts +3 -0
  45. package/dist/types/renderers/QuickRepliesPart.d.ts +4 -0
  46. package/dist/types/renderers/RecordCardPart.d.ts +4 -0
  47. package/dist/types/renderers/SourcesPart.d.ts +4 -0
  48. package/dist/types/renderers/TablePart.d.ts +4 -0
  49. package/dist/types/renderers/TextPart.d.ts +5 -0
  50. package/dist/types/renderers/TicketPart.d.ts +4 -0
  51. package/dist/types/renderers/VoiceClipPart.d.ts +7 -0
  52. package/dist/types/renderers/index.d.ts +32 -0
  53. package/dist/types/useAutoOpen.d.ts +11 -0
  54. package/dist/types/useChat.d.ts +34 -76
  55. package/dist/types/useChatDictation.d.ts +24 -0
  56. package/dist/types/useChatExplain.d.ts +57 -0
  57. package/dist/types/useChatHandoff.d.ts +19 -0
  58. package/dist/types/useChatReadAloud.d.ts +16 -0
  59. package/dist/types/useChatSound.d.ts +7 -0
  60. package/dist/types/useChatSpeech.d.ts +7 -0
  61. package/dist/types/useLauncherAvoid.d.ts +1 -0
  62. package/dist/types/useReducedMotion.d.ts +1 -0
  63. package/dist/types/useTranscriptActions.d.ts +12 -0
  64. package/package.json +18 -20
  65. package/README.md +0 -320
  66. package/dist/guidance.json +0 -216
  67. package/dist/types/ChatMarkdown.meta.d.ts +0 -31
  68. package/dist/types/components/ActionCard.d.ts +0 -27
  69. package/dist/types/components/ActionCard.meta.d.ts +0 -89
  70. package/dist/types/components/ChatComposer.d.ts +0 -38
  71. package/dist/types/components/ChatComposer.meta.d.ts +0 -56
  72. package/dist/types/components/ChatConversationList.d.ts +0 -20
  73. package/dist/types/components/ChatConversationList.meta.d.ts +0 -37
  74. package/dist/types/components/ChatLauncher.d.ts +0 -31
  75. package/dist/types/components/ChatLauncher.meta.d.ts +0 -50
  76. package/dist/types/components/ChatMessage.d.ts +0 -61
  77. package/dist/types/components/ChatMessage.meta.d.ts +0 -173
  78. package/dist/types/components/ChatPanel.d.ts +0 -74
  79. package/dist/types/components/ChatPanel.meta.d.ts +0 -228
  80. package/dist/types/components/ChatThread.d.ts +0 -54
  81. package/dist/types/components/ChatThread.meta.d.ts +0 -151
  82. package/dist/types/components/CitationChip.d.ts +0 -15
  83. package/dist/types/components/CitationChip.meta.d.ts +0 -48
  84. package/dist/types/components/ComposerAttachments.d.ts +0 -14
  85. package/dist/types/components/ConfirmCard.d.ts +0 -24
  86. package/dist/types/components/ConfirmCard.meta.d.ts +0 -43
  87. package/dist/types/components/ReplyRating.d.ts +0 -16
  88. package/dist/types/components/ReplyRating.meta.d.ts +0 -34
  89. package/dist/types/markdown.d.ts +0 -22
  90. /package/{LICENSE → LICENSE.txt} +0 -0
@@ -1,173 +0,0 @@
1
- export declare const meta: {
2
- readonly name: "ChatMessage";
3
- readonly marker: "ChatMessage";
4
- readonly platforms: readonly ["web"];
5
- readonly acceptsChildren: false;
6
- readonly props: {
7
- readonly turn: {
8
- readonly type: "object";
9
- readonly required: true;
10
- readonly description: "The turn to show: the person's question and the assistant's answer.";
11
- readonly fields: {
12
- readonly id: {
13
- readonly type: "string";
14
- readonly required: true;
15
- readonly description: "Local key for the turn; for a reopened conversation, the stored message's id.";
16
- };
17
- readonly question: {
18
- readonly type: "string";
19
- readonly required: true;
20
- readonly description: "What the person asked. Left empty, no question bubble shows.";
21
- };
22
- readonly answer: {
23
- readonly type: "string";
24
- readonly required: true;
25
- readonly description: "The answer shown: the streamed text so far, then the reply of record.";
26
- };
27
- readonly streaming: {
28
- readonly type: "boolean";
29
- readonly required: true;
30
- readonly description: "True while the answer is still arriving.";
31
- };
32
- readonly step: {
33
- readonly type: "string";
34
- readonly required: false;
35
- readonly description: "The name of the tool the assistant is running. Unset when none is.";
36
- };
37
- readonly error: {
38
- readonly type: "object";
39
- readonly required: false;
40
- readonly description: "Set when the turn failed; its message shows in an alert.";
41
- readonly fields: {
42
- readonly code: {
43
- readonly type: "string";
44
- readonly required: true;
45
- readonly description: "A short code for the failure.";
46
- };
47
- readonly message: {
48
- readonly type: "string";
49
- readonly required: true;
50
- readonly description: "Written for the person.";
51
- };
52
- readonly resetsAtUtc: {
53
- readonly type: "string";
54
- readonly required: false;
55
- readonly description: "When a limit resets, as an ISO time.";
56
- };
57
- };
58
- };
59
- readonly actions: {
60
- readonly type: "array";
61
- readonly required: true;
62
- readonly description: "Support actions the assistant prepared for this turn.";
63
- };
64
- readonly messageId: {
65
- readonly type: "string";
66
- readonly required: false;
67
- readonly description: "The stored reply's id. The rating needs it.";
68
- };
69
- readonly rating: {
70
- readonly type: "enum";
71
- readonly values: readonly ["Up", "Down"];
72
- readonly required: false;
73
- readonly description: "The rating already given to the reply.";
74
- };
75
- readonly ratingNote: {
76
- readonly type: "string";
77
- readonly required: false;
78
- readonly description: "The note saved with the rating.";
79
- };
80
- readonly questionId: {
81
- readonly type: "string";
82
- readonly required: false;
83
- readonly description: "The stored question's id. Edit needs it; unset until the server answers.";
84
- };
85
- readonly attachments: {
86
- readonly type: "array";
87
- readonly required: false;
88
- readonly description: "Files attached to the question, shown as chips under it.";
89
- };
90
- readonly stopped: {
91
- readonly type: "boolean";
92
- readonly required: false;
93
- readonly description: "True when the person stopped the turn. Shows the stopped notice where the answer goes.";
94
- };
95
- };
96
- };
97
- readonly canRegenerate: {
98
- readonly type: "boolean";
99
- readonly required: false;
100
- readonly description: "Set on the last turn only, so an older answer has no New answer button.";
101
- };
102
- readonly labels: {
103
- readonly type: "object";
104
- readonly required: false;
105
- readonly description: "Replacements for the built-in wording, such as the labels for You, Assistant and Thinking.";
106
- };
107
- };
108
- readonly examples: readonly [{
109
- readonly id: "ChatMessage";
110
- readonly title: "Default";
111
- readonly props: {
112
- readonly turn: {
113
- readonly id: "t1";
114
- readonly question: "Where is my order?";
115
- readonly answer: "Your order ships today.";
116
- readonly streaming: false;
117
- readonly actions: readonly [];
118
- };
119
- };
120
- readonly wrap: {
121
- readonly component: "ul";
122
- readonly props: {
123
- readonly className: "list-unstyled mb-0";
124
- };
125
- };
126
- }, {
127
- readonly id: "ChatMessage.user";
128
- readonly title: "Question only";
129
- readonly props: {
130
- readonly turn: {
131
- readonly id: "message-user";
132
- readonly question: "How do I turn on two-step sign-in?";
133
- readonly answer: "";
134
- readonly streaming: false;
135
- readonly actions: readonly [];
136
- };
137
- };
138
- readonly wrap: {
139
- readonly component: "ul";
140
- readonly props: {
141
- readonly className: "list-unstyled mb-0";
142
- };
143
- };
144
- }, {
145
- readonly id: "ChatMessage.assistant";
146
- readonly title: "Answer only";
147
- readonly props: {
148
- readonly turn: {
149
- readonly id: "message-assistant";
150
- readonly question: "";
151
- readonly answer: "Open the security settings and choose two-step sign-in.";
152
- readonly streaming: false;
153
- readonly actions: readonly [];
154
- };
155
- };
156
- readonly wrap: {
157
- readonly component: "ul";
158
- readonly props: {
159
- readonly className: "list-unstyled mb-0";
160
- };
161
- };
162
- }];
163
- readonly usage: {
164
- readonly when: readonly ["Show one question and its answer inside a chat thread.", "Draw a single stored or streaming turn on its own, such as in a history view."];
165
- readonly whenNot: readonly [{
166
- readonly text: "Showing the whole conversation, oldest turn first, with the newest text kept in view.";
167
- readonly instead: "ChatThread";
168
- }];
169
- readonly do: readonly [];
170
- readonly dont: readonly [];
171
- readonly a11y: readonly ["The answer sits in a polite live region, so a screen reader reads it once it settles; it is marked busy while it streams.", "Visually hidden labels name who is speaking, taken from the You and Assistant labels.", "While the first text is awaited, a spinner carries the Thinking label."];
172
- };
173
- };
@@ -1,74 +0,0 @@
1
- /**
2
- * The assistant's drawer: about 440px from the right, the full screen on a phone. The header
3
- * carries the title, New chat and Close; the body the conversation; the footer the question box,
4
- * the questions left today (once 10 or fewer remain) and the AI footnote. Focus stays inside
5
- * while it is open, Escape closes it, and the question box takes focus when it opens.
6
- *
7
- * With `conversations`, a history icon shows the person's past chats in place of the body and
8
- * the footer; a back icon returns to the chat. Closing the drawer returns to the chat.
9
- *
10
- * @param {object} props
11
- * @param {ReturnType<typeof import('../useChat.js').useChat>} props.chat
12
- * @param {boolean} props.open
13
- * @param {() => void} props.onClose
14
- * @param {import('react').ReactNode} [props.title]
15
- * @param {string} [props.titleIcon="sparkles"]
16
- * @param {import('react').ReactNode} [props.headerActions]
17
- * @param {import('react').ReactNode} [props.empty]
18
- * @param {import('react').ReactNode} [props.disclaimer]
19
- * @param {number} [props.maxLength=4000]
20
- * @param {number} [props.allowanceThreshold=10]
21
- * @param {string} [props.width="440px"]
22
- * @param {(href: string) => string|null|undefined} [props.resolveLink] See `ChatMarkdown`.
23
- * @param {import('react').ElementType} [props.linkComponent] A router link (it receives `to`).
24
- * @param {(token: string) => Promise<{ id: string, number: string }>} [props.confirmAction] Shows
25
- * support action cards, e.g. `supportClient.confirmAction`.
26
- * @param {(ticket: { id: string, number: string }) => void} [props.onViewTicket]
27
- * @param {boolean} [props.rating=true]
28
- * @param {(turn: import('../useChat.js').ChatTurn, state: { streaming: boolean }) => import('react').ReactNode} [props.renderReply]
29
- * Draws each assistant answer instead of `ChatMarkdown`; see `ChatMessage`.
30
- * @param {(attachment: { publicId: string, fileName: string, contentType: string, length: number }) => void} [props.openAttachment]
31
- * Opens a file on a question; the session has no open action, so the app supplies one (for example
32
- * with `client.getAttachment` and a blob URL).
33
- * @param {boolean} [props.conversations=false] Offers the person's past chats from a header icon.
34
- * @param {(inner: string) => boolean} [props.isCitation] Passed to `ChatThread`; see `ChatMarkdown`.
35
- * @param {(citation: string) => void} [props.onOpenCitation] Passed to `ChatThread`; see `ChatMarkdown`.
36
- * @param {Partial<typeof import('@webority/markdown-core/chat').DEFAULT_CHAT_LABELS>} [props.labels]
37
- */
38
- export default function ChatPanel({ chat, open, onClose, title, titleIcon, headerActions, empty, disclaimer, maxLength, allowanceThreshold, width, resolveLink, linkComponent, confirmAction, onViewTicket, rating, renderReply, openAttachment, conversations, isCitation, onOpenCitation, labels: labelOverrides, }: {
39
- chat: ReturnType<typeof import('../useChat.js').useChat>;
40
- open: boolean;
41
- onClose: () => void;
42
- title?: import('react').ReactNode;
43
- titleIcon?: string;
44
- headerActions?: import('react').ReactNode;
45
- empty?: import('react').ReactNode;
46
- disclaimer?: import('react').ReactNode;
47
- maxLength?: number;
48
- allowanceThreshold?: number;
49
- width?: string;
50
- resolveLink?: (href: string) => string | null | undefined;
51
- linkComponent?: import('react').ElementType;
52
- confirmAction?: (token: string) => Promise<{
53
- id: string;
54
- number: string;
55
- }>;
56
- onViewTicket?: (ticket: {
57
- id: string;
58
- number: string;
59
- }) => void;
60
- rating?: boolean;
61
- renderReply?: (turn: import('../useChat.js').ChatTurn, state: {
62
- streaming: boolean;
63
- }) => import('react').ReactNode;
64
- openAttachment?: (attachment: {
65
- publicId: string;
66
- fileName: string;
67
- contentType: string;
68
- length: number;
69
- }) => void;
70
- conversations?: boolean;
71
- isCitation?: (inner: string) => boolean;
72
- onOpenCitation?: (citation: string) => void;
73
- labels?: Partial<typeof import('@webority/markdown-core/chat').DEFAULT_CHAT_LABELS>;
74
- }): import("react").JSX.Element;
@@ -1,228 +0,0 @@
1
- export declare const meta: {
2
- readonly name: "ChatPanel";
3
- readonly marker: "ChatPanel";
4
- readonly platforms: readonly ["web"];
5
- readonly acceptsChildren: false;
6
- readonly props: {
7
- readonly chat: {
8
- readonly type: "object";
9
- readonly required: true;
10
- readonly description: "The chat state the panel shows; the app takes it from useChat. The kit draws a stand-in with these fields.";
11
- readonly fields: {
12
- readonly turns: {
13
- readonly type: "array";
14
- readonly required: true;
15
- readonly description: "The conversation, oldest turn first.";
16
- readonly itemFields: {
17
- readonly id: {
18
- readonly type: "string";
19
- readonly required: true;
20
- readonly description: "Local key for the turn.";
21
- };
22
- readonly question: {
23
- readonly type: "string";
24
- readonly required: true;
25
- readonly description: "What the person asked.";
26
- };
27
- readonly answer: {
28
- readonly type: "string";
29
- readonly required: true;
30
- readonly description: "The answer shown.";
31
- };
32
- readonly streaming: {
33
- readonly type: "boolean";
34
- readonly required: true;
35
- readonly description: "True while the answer is still arriving.";
36
- };
37
- readonly step: {
38
- readonly type: "string";
39
- readonly required: false;
40
- readonly description: "The tool the assistant is running.";
41
- };
42
- readonly error: {
43
- readonly type: "object";
44
- readonly required: false;
45
- readonly description: "Set when the turn failed.";
46
- readonly fields: {
47
- readonly code: {
48
- readonly type: "string";
49
- readonly required: true;
50
- readonly description: "A short code for the failure.";
51
- };
52
- readonly message: {
53
- readonly type: "string";
54
- readonly required: true;
55
- readonly description: "Written for the person.";
56
- };
57
- readonly resetsAtUtc: {
58
- readonly type: "string";
59
- readonly required: false;
60
- readonly description: "When a limit resets, as an ISO time.";
61
- };
62
- };
63
- };
64
- readonly actions: {
65
- readonly type: "array";
66
- readonly required: true;
67
- readonly description: "Support actions prepared for the turn.";
68
- };
69
- readonly messageId: {
70
- readonly type: "string";
71
- readonly required: false;
72
- readonly description: "The stored reply's id.";
73
- };
74
- readonly questionId: {
75
- readonly type: "string";
76
- readonly required: false;
77
- readonly description: "The stored question's id.";
78
- };
79
- readonly stopped: {
80
- readonly type: "boolean";
81
- readonly required: false;
82
- readonly description: "True when the person stopped the answer.";
83
- };
84
- readonly attachments: {
85
- readonly type: "array";
86
- readonly required: false;
87
- readonly description: "The files sent with the question.";
88
- };
89
- readonly rating: {
90
- readonly type: "enum";
91
- readonly values: readonly ["Up", "Down"];
92
- readonly required: false;
93
- readonly description: "The rating given.";
94
- };
95
- readonly ratingNote: {
96
- readonly type: "string";
97
- readonly required: false;
98
- readonly description: "The note saved with the rating.";
99
- };
100
- };
101
- };
102
- readonly messagesLeftToday: {
103
- readonly type: "number";
104
- readonly required: false;
105
- readonly description: "Questions left today. Unset when not known.";
106
- };
107
- readonly loading: {
108
- readonly type: "boolean";
109
- readonly required: true;
110
- readonly description: "True while a saved conversation loads.";
111
- };
112
- readonly streaming: {
113
- readonly type: "boolean";
114
- readonly required: true;
115
- readonly description: "True while an answer is arriving.";
116
- };
117
- readonly loadError: {
118
- readonly type: "object";
119
- readonly required: false;
120
- readonly description: "Set when a saved conversation failed to load.";
121
- readonly fields: {
122
- readonly message: {
123
- readonly type: "string";
124
- readonly required: true;
125
- readonly description: "Written for the person.";
126
- };
127
- };
128
- };
129
- };
130
- };
131
- readonly open: {
132
- readonly type: "boolean";
133
- readonly required: true;
134
- readonly description: "Whether the drawer is shown.";
135
- };
136
- readonly title: {
137
- readonly type: "node";
138
- readonly description: "The drawer title. Defaults to the panel title label.";
139
- };
140
- readonly titleIcon: {
141
- readonly type: "string";
142
- readonly default: "sparkles";
143
- readonly description: "A library icon name shown before the title.";
144
- };
145
- readonly headerActions: {
146
- readonly type: "node";
147
- readonly description: "Extra header controls placed before New chat.";
148
- };
149
- readonly empty: {
150
- readonly type: "node";
151
- readonly description: "Shown before the first question.";
152
- };
153
- readonly disclaimer: {
154
- readonly type: "node";
155
- readonly description: "The footnote under the question box. Defaults to the disclaimer label.";
156
- };
157
- readonly maxLength: {
158
- readonly type: "number";
159
- readonly default: 4000;
160
- readonly description: "The most characters a question may have.";
161
- };
162
- readonly allowanceThreshold: {
163
- readonly type: "number";
164
- readonly default: 10;
165
- readonly description: "The questions left note shows once this many or fewer remain.";
166
- };
167
- readonly width: {
168
- readonly type: "string";
169
- readonly default: "440px";
170
- readonly description: "The drawer width on wide screens.";
171
- };
172
- readonly rating: {
173
- readonly type: "boolean";
174
- readonly default: true;
175
- readonly description: "Offer thumbs under stored replies.";
176
- };
177
- readonly conversations: {
178
- readonly type: "boolean";
179
- readonly default: false;
180
- readonly description: "Offers the person's past chats from a header icon; the list replaces the conversation until a chat is opened.";
181
- };
182
- readonly labels: {
183
- readonly type: "object";
184
- readonly description: "Replacements for the built-in wording.";
185
- };
186
- };
187
- readonly examples: readonly [{
188
- readonly id: "ChatPanel";
189
- readonly title: "Default";
190
- readonly props: {
191
- readonly chat: {
192
- readonly turns: readonly [];
193
- readonly messagesLeftToday: 8;
194
- readonly loading: false;
195
- readonly streaming: false;
196
- };
197
- readonly open: false;
198
- };
199
- }, {
200
- readonly id: "ChatPanel.conversation";
201
- readonly title: "With a conversation";
202
- readonly props: {
203
- readonly chat: {
204
- readonly turns: readonly [{
205
- readonly id: "demo-question";
206
- readonly question: "How do I turn on two-step sign-in?";
207
- readonly answer: "Open the security settings and choose two-step sign-in.";
208
- readonly streaming: false;
209
- readonly actions: readonly [];
210
- }];
211
- readonly messagesLeftToday: 8;
212
- readonly loading: false;
213
- readonly streaming: false;
214
- };
215
- readonly open: false;
216
- };
217
- }];
218
- readonly usage: {
219
- readonly when: readonly ["Offer the assistant as a drawer that opens from a launcher.", "Show the conversation, the question box, the questions left today and the footnote in one place."];
220
- readonly whenNot: readonly [{
221
- readonly text: "Showing only the conversation inside a page.";
222
- readonly instead: "ChatThread";
223
- }];
224
- readonly do: readonly [];
225
- readonly dont: readonly [];
226
- readonly a11y: readonly ["Focus stays inside the drawer while it is open, Escape closes it, and the question box takes focus when it opens.", "The drawer is named by its title.", "The questions left note is a status region."];
227
- };
228
- };
@@ -1,54 +0,0 @@
1
- /**
2
- * The conversation, oldest turn first. It keeps the newest text in view as an answer streams.
3
- * With no turns it shows `empty`, or a default "How can I help?" state.
4
- *
5
- * @param {object} props
6
- * @param {import('../useChat.js').ChatTurn[]} props.turns
7
- * @param {import('react').ReactNode} [props.empty]
8
- * @param {(turnId: string, rating: "Up"|"Down", note?: string) => Promise<unknown>} [props.onRate]
9
- * @param {(href: string) => string|null|undefined} [props.resolveLink]
10
- * @param {import('react').ElementType} [props.linkComponent]
11
- * @param {(token: string) => Promise<{ id: string, number: string }>} [props.confirmAction]
12
- * @param {(ticket: { id: string, number: string }) => void} [props.onViewTicket]
13
- * @param {(turn: import('../useChat.js').ChatTurn, state: { streaming: boolean }) => import('react').ReactNode} [props.renderReply]
14
- * Draws each assistant answer instead of `ChatMarkdown`; see `ChatMessage`.
15
- * @param {(turnId: string) => void} [props.onRetry]
16
- * @param {(turnId: string) => void} [props.onRegenerate] Offered on the last turn only.
17
- * @param {(text: string) => void} [props.onAskSuggestion] Sends a suggested follow-up; offered on the last turn only.
18
- * @param {(inner: string) => boolean} [props.isCitation] Passed to `ChatMessage`; see `ChatMarkdown`.
19
- * @param {(citation: string) => void} [props.onOpenCitation] Passed to `ChatMessage`; see `ChatMarkdown`.
20
- * @param {(turnId: string) => void} [props.onEdit]
21
- * @param {(attachment: { publicId: string, fileName: string, contentType: string, length: number }) => void} [props.onOpenAttachment]
22
- * @param {Partial<typeof import('@webority/markdown-core/chat').DEFAULT_CHAT_LABELS>} [props.labels]
23
- */
24
- export default function ChatThread({ turns, empty, onRate, resolveLink, linkComponent, confirmAction, onViewTicket, renderReply, onRetry, onRegenerate, onAskSuggestion, isCitation, onOpenCitation, onEdit, onOpenAttachment, labels: labelOverrides, }: {
25
- turns: import('../useChat.js').ChatTurn[];
26
- empty?: import('react').ReactNode;
27
- onRate?: (turnId: string, rating: "Up" | "Down", note?: string) => Promise<unknown>;
28
- resolveLink?: (href: string) => string | null | undefined;
29
- linkComponent?: import('react').ElementType;
30
- confirmAction?: (token: string) => Promise<{
31
- id: string;
32
- number: string;
33
- }>;
34
- onViewTicket?: (ticket: {
35
- id: string;
36
- number: string;
37
- }) => void;
38
- renderReply?: (turn: import('../useChat.js').ChatTurn, state: {
39
- streaming: boolean;
40
- }) => import('react').ReactNode;
41
- onRetry?: (turnId: string) => void;
42
- onRegenerate?: (turnId: string) => void;
43
- onAskSuggestion?: (text: string) => void;
44
- isCitation?: (inner: string) => boolean;
45
- onOpenCitation?: (citation: string) => void;
46
- onEdit?: (turnId: string) => void;
47
- onOpenAttachment?: (attachment: {
48
- publicId: string;
49
- fileName: string;
50
- contentType: string;
51
- length: number;
52
- }) => void;
53
- labels?: Partial<typeof import('@webority/markdown-core/chat').DEFAULT_CHAT_LABELS>;
54
- }): string | number | bigint | boolean | import("react").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | Iterable<import("react").ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined>;