@progress/kendo-react-conversational-ui 7.2.4-develop.3 → 7.3.0-develop.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/ViewItem.js +8 -0
- package/ViewItem.mjs +59 -0
- package/ai-prompt/AIPrompt.js +8 -0
- package/ai-prompt/AIPrompt.mjs +35 -0
- package/ai-prompt/AIPromptContent.js +8 -0
- package/ai-prompt/AIPromptContent.mjs +17 -0
- package/ai-prompt/AIPromptContext.js +8 -0
- package/ai-prompt/AIPromptContext.mjs +15 -0
- package/ai-prompt/AIPromptExpander.js +8 -0
- package/ai-prompt/AIPromptExpander.mjs +27 -0
- package/ai-prompt/AIPromptFooter.js +8 -0
- package/ai-prompt/AIPromptFooter.mjs +16 -0
- package/ai-prompt/AIPromptHeader.js +8 -0
- package/ai-prompt/AIPromptHeader.mjs +36 -0
- package/ai-prompt/views/AIPromptCommandsView.js +8 -0
- package/ai-prompt/views/AIPromptCommandsView.mjs +38 -0
- package/ai-prompt/views/AIPromptOutputView.js +8 -0
- package/ai-prompt/views/AIPromptOutputView.mjs +93 -0
- package/ai-prompt/views/AIPromptView.js +8 -0
- package/ai-prompt/views/AIPromptView.mjs +61 -0
- package/ai-prompt/views/AIPromptViewRender.js +8 -0
- package/ai-prompt/views/AIPromptViewRender.mjs +16 -0
- package/components/Action.js +8 -0
- package/components/Action.mjs +44 -0
- package/components/ActionGroup.js +8 -0
- package/components/ActionGroup.mjs +49 -0
- package/components/Attachment.js +8 -0
- package/components/Attachment.mjs +49 -0
- package/components/AttachmentGroup.js +8 -0
- package/components/AttachmentGroup.mjs +74 -0
- package/components/Chat.js +8 -0
- package/components/Chat.mjs +208 -0
- package/components/ChatMessage.js +8 -0
- package/components/ChatMessage.mjs +62 -0
- package/components/DateMarker.js +8 -0
- package/components/DateMarker.mjs +20 -0
- package/components/MessageGroup.js +8 -0
- package/components/MessageGroup.mjs +69 -0
- package/components/NewMessage.js +8 -0
- package/components/NewMessage.mjs +94 -0
- package/components/Toolbar.js +8 -0
- package/components/Toolbar.mjs +17 -0
- package/components/base/FocusableUponSelection.js +8 -0
- package/components/base/FocusableUponSelection.mjs +20 -0
- package/components/base/SelectableItemsContainer.js +8 -0
- package/components/base/SelectableItemsContainer.mjs +42 -0
- package/components/templates/HeroCard.js +8 -0
- package/components/templates/HeroCard.mjs +45 -0
- package/dist/cdn/js/kendo-react-conversational-ui.js +8 -5
- package/index.d.mts +811 -5
- package/index.d.ts +811 -23
- package/index.js +8 -5
- package/index.mjs +32 -876
- package/messages/index.js +8 -0
- package/messages/index.mjs +25 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +6 -6
- package/utils.js +8 -0
- package/utils.mjs +12 -0
- package/ChatPropsAndState.d.ts +0 -95
- package/Events.d.ts +0 -42
- package/ViewItem.d.ts +0 -61
- package/ai-prompt/AIPrompt.d.ts +0 -95
- package/ai-prompt/AIPromptContent.d.ts +0 -19
- package/ai-prompt/AIPromptContext.d.ts +0 -24
- package/ai-prompt/AIPromptExpander.d.ts +0 -10
- package/ai-prompt/AIPromptFooter.d.ts +0 -19
- package/ai-prompt/AIPromptHeader.d.ts +0 -36
- package/ai-prompt/views/AIPromptCommandsView.d.ts +0 -54
- package/ai-prompt/views/AIPromptOutputView.d.ts +0 -66
- package/ai-prompt/views/AIPromptView.d.ts +0 -26
- package/ai-prompt/views/AIPromptViewRender.d.ts +0 -23
- package/api/action.interface.d.ts +0 -35
- package/api/attachment.interface.d.ts +0 -36
- package/api/message.interface.d.ts +0 -60
- package/api/user.interface.d.ts +0 -27
- package/components/Action.d.ts +0 -23
- package/components/ActionGroup.d.ts +0 -27
- package/components/Attachment.d.ts +0 -28
- package/components/AttachmentGroup.d.ts +0 -27
- package/components/Chat.d.ts +0 -76
- package/components/ChatMessage.d.ts +0 -72
- package/components/DateMarker.d.ts +0 -18
- package/components/MessageGroup.d.ts +0 -29
- package/components/NewMessage.d.ts +0 -38
- package/components/Toolbar.d.ts +0 -13
- package/components/base/FocusableUponSelection.d.ts +0 -24
- package/components/base/SelectableItemsContainer.d.ts +0 -37
- package/components/templates/HeroCard.d.ts +0 -45
- package/messages/index.d.ts +0 -39
- package/package-metadata.d.ts +0 -9
- package/utils.d.ts +0 -9
package/index.d.mts
CHANGED
|
@@ -1,5 +1,811 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { BaseEvent } from '@progress/kendo-react-common';
|
|
9
|
+
import { ButtonProps } from '@progress/kendo-react-buttons';
|
|
10
|
+
import { CustomComponent } from '@progress/kendo-react-common';
|
|
11
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
12
|
+
import PropTypes from 'prop-types';
|
|
13
|
+
import * as React_2 from 'react';
|
|
14
|
+
import { default as React_3 } from 'react';
|
|
15
|
+
import { SVGIcon } from '@progress/kendo-svg-icons';
|
|
16
|
+
import { SVGIcon as SVGIcon_2 } from '@progress/kendo-react-common';
|
|
17
|
+
import { TextAreaProps } from '@progress/kendo-react-inputs';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Defines a quick action for a message.
|
|
21
|
+
* The value is interpreted according to the specified action type.
|
|
22
|
+
*/
|
|
23
|
+
export declare interface Action {
|
|
24
|
+
/**
|
|
25
|
+
* A predefined or custom (string) type for the action.
|
|
26
|
+
*/
|
|
27
|
+
type: ActionType;
|
|
28
|
+
/**
|
|
29
|
+
* The value which is associated with the action.
|
|
30
|
+
*/
|
|
31
|
+
value: any;
|
|
32
|
+
/**
|
|
33
|
+
* An optional title for the quick action.
|
|
34
|
+
* If omitted, the Chat displays the value instead.
|
|
35
|
+
*/
|
|
36
|
+
title?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The button type of the quick action
|
|
41
|
+
* ([see examples]({% slug suggested_actions_chat %})).
|
|
42
|
+
*
|
|
43
|
+
* * `openUrl`—Opens a new browser window with the specified URL.
|
|
44
|
+
* * `reply`—Sends the action value as a reply in the Chat.
|
|
45
|
+
* * `call`—Treats a value as a phone number.
|
|
46
|
+
* Similar to clicking a [telephone link](https://css-tricks.com/the-current-state-of-telephone-links/).
|
|
47
|
+
* * other—
|
|
48
|
+
* Handled by user code in the [`ExecuteActionEvent`]({% slug api_conversational-ui_chatactionexecuteevent %}).
|
|
49
|
+
*/
|
|
50
|
+
export declare type ActionType = 'openUrl' | 'reply' | 'call' | any;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Represents the KendoReact AIPrompt component.
|
|
54
|
+
*/
|
|
55
|
+
export declare const AIPrompt: (props: AIPromptProps) => JSX_2.Element;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The fields of the AIPromptOutputView card prop.
|
|
59
|
+
*/
|
|
60
|
+
declare interface AIPromptCardInterface {
|
|
61
|
+
/**
|
|
62
|
+
* Custom template for AIPromptCard header.
|
|
63
|
+
*/
|
|
64
|
+
header?: (props: AIPromptOutputInterface) => React_3.ReactNode;
|
|
65
|
+
/**
|
|
66
|
+
* Custom template for AIPromptCard body.
|
|
67
|
+
*/
|
|
68
|
+
body?: (props: AIPromptOutputInterface) => React_3.ReactNode;
|
|
69
|
+
/**
|
|
70
|
+
* Custom template for AIPromptCard actions.
|
|
71
|
+
*/
|
|
72
|
+
actions?: (props: AIPromptOutputInterface) => React_3.ReactNode;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The props of the AIPromptCommandsView component.
|
|
77
|
+
*/
|
|
78
|
+
export declare const AIPromptCommandsView: (props: AIPromptCommandsViewProps) => JSX_2.Element;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The props of the AIPromptCommandsView component.
|
|
82
|
+
*/
|
|
83
|
+
declare interface AIPromptCommandsViewProps {
|
|
84
|
+
/**
|
|
85
|
+
* The collection of commands that will be rendered in the Command view.
|
|
86
|
+
*/
|
|
87
|
+
commands?: CommandInterface[];
|
|
88
|
+
/**
|
|
89
|
+
* Fires each time the user clicks over a Command view command. Exposes the selected command as event data.
|
|
90
|
+
*/
|
|
91
|
+
onCommandExecute?: (command: CommandItemInterface) => void;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Represents the KendoReact AIPromptContent component.
|
|
96
|
+
*/
|
|
97
|
+
export declare const AIPromptContent: React_3.ForwardRefExoticComponent<AIPromptContentProps & React_3.RefAttributes<HTMLDivElement>>;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The props of the AIPromptContent component.
|
|
101
|
+
*/
|
|
102
|
+
declare interface AIPromptContentProps {
|
|
103
|
+
/**
|
|
104
|
+
* Specifies the AIPromptContent children elements.
|
|
105
|
+
*/
|
|
106
|
+
children?: React_3.ReactNode;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Represents the KendoReact AIPromptFooter component.
|
|
111
|
+
*/
|
|
112
|
+
export declare const AIPromptFooter: (props: AIPromptFooterProps) => JSX_2.Element;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The props of the AIPromptFooter component.
|
|
116
|
+
*/
|
|
117
|
+
declare interface AIPromptFooterProps {
|
|
118
|
+
/**
|
|
119
|
+
* Specifies the AIPromptFooter children elements.
|
|
120
|
+
*/
|
|
121
|
+
children?: React_3.ReactNode;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @hidden
|
|
126
|
+
*/
|
|
127
|
+
declare interface AIPromptHeaderProps {
|
|
128
|
+
activeView: string;
|
|
129
|
+
toolbarItems: (AIPromptToolbarItemInterface | React_3.ReactNode)[];
|
|
130
|
+
activeViewChange?: (viewName: string) => void;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export declare interface AIPromptOutputInterface {
|
|
134
|
+
/**
|
|
135
|
+
* The unique identifier of the command.
|
|
136
|
+
*/
|
|
137
|
+
id: string | number;
|
|
138
|
+
/**
|
|
139
|
+
* An optional custom title for the prompt output.
|
|
140
|
+
*/
|
|
141
|
+
title?: string;
|
|
142
|
+
/**
|
|
143
|
+
* An optional custom sub title for the prompt output.
|
|
144
|
+
*/
|
|
145
|
+
subTitle?: string;
|
|
146
|
+
/**
|
|
147
|
+
* The prompt that initiated the output generation.
|
|
148
|
+
*/
|
|
149
|
+
prompt?: string;
|
|
150
|
+
/**
|
|
151
|
+
* The text content of the prompt output.
|
|
152
|
+
*/
|
|
153
|
+
responseContent: string;
|
|
154
|
+
/**
|
|
155
|
+
* Specifies if the prompt generation was initiated via the retry button.
|
|
156
|
+
*/
|
|
157
|
+
isRetry?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* The prompt output rating.
|
|
160
|
+
*/
|
|
161
|
+
ratingType?: string;
|
|
162
|
+
/**
|
|
163
|
+
* Optionally specifies a command, if the prompt generation was triggered via a command.
|
|
164
|
+
*/
|
|
165
|
+
command?: CommandInterface;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Represents the KendoReact AIPromptOutputView component.
|
|
170
|
+
*/
|
|
171
|
+
export declare const AIPromptOutputView: (props: AIPromptOutputViewProps) => JSX_2.Element;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* The props of the AIPromptOutputView component.
|
|
175
|
+
*/
|
|
176
|
+
declare interface AIPromptOutputViewProps {
|
|
177
|
+
/**
|
|
178
|
+
* The collection of generated prompt outputs that will be rendered in the Output view.
|
|
179
|
+
*/
|
|
180
|
+
outputs?: AIPromptOutputInterface[];
|
|
181
|
+
/**
|
|
182
|
+
* Represents a template that allows you to define custom Card fields for:
|
|
183
|
+
* header
|
|
184
|
+
* body
|
|
185
|
+
* actions
|
|
186
|
+
* The custom fields will override the default one.
|
|
187
|
+
*/
|
|
188
|
+
outputCard?: AIPromptCardInterface;
|
|
189
|
+
/**
|
|
190
|
+
* Specifies if the rating buttons in each card will be rendered.
|
|
191
|
+
* By default, rating buttons are not rendered.
|
|
192
|
+
*
|
|
193
|
+
* @default false
|
|
194
|
+
*/
|
|
195
|
+
showOutputRating?: boolean;
|
|
196
|
+
onRetry?: (value: any) => void;
|
|
197
|
+
/**
|
|
198
|
+
* Fires each time the user clicks Copy button in the card.
|
|
199
|
+
*/
|
|
200
|
+
onCopy?: () => void;
|
|
201
|
+
/**
|
|
202
|
+
* Fires each time the user clicks a rating button in the card.
|
|
203
|
+
*/
|
|
204
|
+
onOutputRating?: () => void;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* The props of the AIPrompt component.
|
|
209
|
+
*/
|
|
210
|
+
export declare interface AIPromptProps {
|
|
211
|
+
/**
|
|
212
|
+
* The styles that are applied to the component.
|
|
213
|
+
*/
|
|
214
|
+
style?: React_3.CSSProperties;
|
|
215
|
+
/**
|
|
216
|
+
* Name of the active view.
|
|
217
|
+
*/
|
|
218
|
+
activeView: typeof promptViewDefaults.name | typeof outputViewDefaults.name | typeof commandsViewDefaults.name | string;
|
|
219
|
+
/**
|
|
220
|
+
* Collection with items that will override the default Toolbar items.
|
|
221
|
+
*/
|
|
222
|
+
toolbarItems?: (AIPromptToolbarItemInterface | React_3.ReactNode)[];
|
|
223
|
+
/**
|
|
224
|
+
* The collection of generated prompt outputs that will be rendered in the Output view.
|
|
225
|
+
*/
|
|
226
|
+
outputs?: AIPromptOutputInterface[];
|
|
227
|
+
/**
|
|
228
|
+
* Specifies the AIPrompt children elements.
|
|
229
|
+
*/
|
|
230
|
+
children?: React_3.ReactNode;
|
|
231
|
+
/**
|
|
232
|
+
* The placeholder text for the Prompt view textarea.
|
|
233
|
+
*/
|
|
234
|
+
promptPlaceholder?: string;
|
|
235
|
+
/**
|
|
236
|
+
* Represents the `dir` HTML attribute.
|
|
237
|
+
*/
|
|
238
|
+
dir?: string;
|
|
239
|
+
/**
|
|
240
|
+
* The onActiveViewChange event handler of the KendoReact AIPrompt component.
|
|
241
|
+
* Fires when active view is changed. Exposes the name of the new active view as event data.
|
|
242
|
+
*/
|
|
243
|
+
onActiveViewChange?: (name: string) => void;
|
|
244
|
+
/**
|
|
245
|
+
* The onCommandExecute event handler of the KendoReact AIPrompt component.
|
|
246
|
+
* Fires each time the user clicks a command in the Command view. Exposes the selected command as event data.
|
|
247
|
+
*/
|
|
248
|
+
onCommandExecute?: (command: CommandInterface) => void;
|
|
249
|
+
/**
|
|
250
|
+
* The onPromptRequest event handler of the KendoReact AIPrompt component.
|
|
251
|
+
* Fires when user clicks the `Generate` button in the Prompt view.
|
|
252
|
+
*/
|
|
253
|
+
onPromptRequest?: (prompt?: string, outputItem?: AIPromptOutputInterface) => void;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* An interface for the AIPromptToolbarItem.
|
|
258
|
+
*/
|
|
259
|
+
export declare interface AIPromptToolbarItemInterface {
|
|
260
|
+
/**
|
|
261
|
+
* Defines the name of the view witch is related to.
|
|
262
|
+
*/
|
|
263
|
+
name: string;
|
|
264
|
+
/**
|
|
265
|
+
* Defines the svgIcon used in the Toolbar button.
|
|
266
|
+
*/
|
|
267
|
+
buttonIcon?: SVGIcon;
|
|
268
|
+
/**
|
|
269
|
+
* Defines the text used in the Toolbar button.
|
|
270
|
+
*/
|
|
271
|
+
buttonText?: string;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* The props of the AIPromptCommandsView component.
|
|
276
|
+
*/
|
|
277
|
+
export declare const AIPromptView: (props: AIPromptViewProps) => JSX_2.Element;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* @hidden
|
|
281
|
+
*/
|
|
282
|
+
declare interface AIPromptViewProps {
|
|
283
|
+
promptInput?: CustomComponent<TextAreaProps>;
|
|
284
|
+
generateButton?: CustomComponent<ButtonProps>;
|
|
285
|
+
promptValue?: string;
|
|
286
|
+
promptSuggestions?: string[];
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Represents the KendoReact AIPromptViewRender component.
|
|
291
|
+
*/
|
|
292
|
+
export declare const AIPromptViewRender: (props: AIPromptViewRenderProps) => React_3.ReactNode;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* The props of the AIPromptViewRender component.
|
|
296
|
+
*/
|
|
297
|
+
declare interface AIPromptViewRenderProps {
|
|
298
|
+
/**
|
|
299
|
+
* Specifies the name of the view.
|
|
300
|
+
*/
|
|
301
|
+
name: string;
|
|
302
|
+
/**
|
|
303
|
+
* Specifies the AIPromptViewRender children elements.
|
|
304
|
+
*/
|
|
305
|
+
children: React_3.ReactNode;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Represents a message attachment
|
|
310
|
+
* ([see examples]({% slug attachments_chat %})).
|
|
311
|
+
*
|
|
312
|
+
*/
|
|
313
|
+
export declare interface Attachment {
|
|
314
|
+
/**
|
|
315
|
+
* The content type identifier for the attachment.
|
|
316
|
+
* Typically a MIME type. Can also be any string.
|
|
317
|
+
*/
|
|
318
|
+
contentType: string;
|
|
319
|
+
/**
|
|
320
|
+
* The content of the attachment.
|
|
321
|
+
*/
|
|
322
|
+
content: any;
|
|
323
|
+
/**
|
|
324
|
+
* (Optional) The title of the attachment.
|
|
325
|
+
*/
|
|
326
|
+
title?: string;
|
|
327
|
+
/**
|
|
328
|
+
* (Optional) The subtitle of the attachment.
|
|
329
|
+
*/
|
|
330
|
+
subtitle?: string;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Specifies the layout for the message attachments.
|
|
335
|
+
*
|
|
336
|
+
* The supported values are:
|
|
337
|
+
* * `"list"`—A vertical list.
|
|
338
|
+
* * `"carousel"`—A horizontal, scrollable list. Also called a card deck.
|
|
339
|
+
*/
|
|
340
|
+
export declare type AttachmentLayout = 'list' | 'carousel';
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Represents the [KendoReact Chat component]({% slug overview_convui %}).
|
|
344
|
+
*/
|
|
345
|
+
export declare class Chat extends React_2.Component<ChatProps, ChatState> {
|
|
346
|
+
/**
|
|
347
|
+
* @hidden
|
|
348
|
+
*/
|
|
349
|
+
static propTypes: {
|
|
350
|
+
messages: PropTypes.Requireable<(object | null | undefined)[]>;
|
|
351
|
+
user: PropTypes.Requireable<object>;
|
|
352
|
+
messageTemplate: PropTypes.Requireable<any>;
|
|
353
|
+
attachmentTemplate: PropTypes.Requireable<any>;
|
|
354
|
+
width: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
355
|
+
onMessageSend: PropTypes.Requireable<(...args: any[]) => any>;
|
|
356
|
+
onActionExecute: PropTypes.Requireable<(...args: any[]) => any>;
|
|
357
|
+
dir: PropTypes.Requireable<string>;
|
|
358
|
+
messageBox: PropTypes.Requireable<any>;
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* @hidden
|
|
362
|
+
*/
|
|
363
|
+
static defaultProps: {
|
|
364
|
+
messages: never[];
|
|
365
|
+
dateFormat: string;
|
|
366
|
+
message: typeof ChatMessage;
|
|
367
|
+
};
|
|
368
|
+
/**
|
|
369
|
+
* @hidden
|
|
370
|
+
*/
|
|
371
|
+
readonly state: ChatState;
|
|
372
|
+
private chatWrapperEl;
|
|
373
|
+
private viewItemsWrapperEl;
|
|
374
|
+
private newMsgComp;
|
|
375
|
+
private timeoutIdForChatLosingFocus;
|
|
376
|
+
private nextTickId;
|
|
377
|
+
private viewItems;
|
|
378
|
+
private isDirectionRightToLeft;
|
|
379
|
+
private scrollToBottomOnLoadingData;
|
|
380
|
+
constructor(props: ChatProps);
|
|
381
|
+
/**
|
|
382
|
+
* @hidden
|
|
383
|
+
*/
|
|
384
|
+
render(): JSX_2.Element;
|
|
385
|
+
/**
|
|
386
|
+
* @hidden
|
|
387
|
+
*/
|
|
388
|
+
componentDidMount(): void;
|
|
389
|
+
/**
|
|
390
|
+
* @hidden
|
|
391
|
+
*/
|
|
392
|
+
componentWillUnmount(): void;
|
|
393
|
+
/**
|
|
394
|
+
* @hidden
|
|
395
|
+
*/
|
|
396
|
+
componentDidUpdate(prevProps: ChatProps): void;
|
|
397
|
+
private getClassNames;
|
|
398
|
+
private checkIsDirectionRightToLeft;
|
|
399
|
+
private onFocus;
|
|
400
|
+
private onBlur;
|
|
401
|
+
private onSelectionRequested;
|
|
402
|
+
private onKeyDown;
|
|
403
|
+
private renderViewItems;
|
|
404
|
+
private onMessageSend;
|
|
405
|
+
private onActionExecute;
|
|
406
|
+
private scrollViewItemsToBottom;
|
|
407
|
+
private getViewItemsFromMsgs;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* The arguments for the `actionexecute` event of the Chat.
|
|
412
|
+
*/
|
|
413
|
+
export declare interface ChatActionExecuteEvent extends BaseEvent<Chat> {
|
|
414
|
+
/**
|
|
415
|
+
* The executed action.
|
|
416
|
+
*/
|
|
417
|
+
action: Action;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Represents the ChatMessage component.
|
|
422
|
+
*/
|
|
423
|
+
export declare class ChatMessage extends FocusableUponSelection<ChatMessageProps, {}> {
|
|
424
|
+
/**
|
|
425
|
+
* @hidden
|
|
426
|
+
*/
|
|
427
|
+
static defaultProps: {
|
|
428
|
+
dateFormat: string;
|
|
429
|
+
tabIndex: number;
|
|
430
|
+
};
|
|
431
|
+
/**
|
|
432
|
+
* @hidden
|
|
433
|
+
*/
|
|
434
|
+
render(): JSX_2.Element;
|
|
435
|
+
private getMainView;
|
|
436
|
+
private getTimestampView;
|
|
437
|
+
private getStatusView;
|
|
438
|
+
private getClassNames;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Represents a Chat message box.
|
|
443
|
+
*/
|
|
444
|
+
export declare interface ChatMessageBoxProps {
|
|
445
|
+
/**
|
|
446
|
+
* Sets the input message of the Chat component.
|
|
447
|
+
*/
|
|
448
|
+
messageInput: JSX.Element;
|
|
449
|
+
/**
|
|
450
|
+
* Sets the toolbar button of the Chat component.
|
|
451
|
+
*/
|
|
452
|
+
toolbarButton: JSX.Element;
|
|
453
|
+
/**
|
|
454
|
+
* Sets the send button of the Chat component.
|
|
455
|
+
*/
|
|
456
|
+
sendButton: JSX.Element;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Represents the properties of [ChatMessage] (% slug api_conversational-ui_chatmessage %) component.
|
|
461
|
+
*/
|
|
462
|
+
export declare interface ChatMessageProps extends FocusableUponSelectionProps {
|
|
463
|
+
/**
|
|
464
|
+
* Represents the data item of the `Message`.
|
|
465
|
+
*/
|
|
466
|
+
item: MessageModel;
|
|
467
|
+
/**
|
|
468
|
+
* Represents the React Component rendered inside the `Message`.
|
|
469
|
+
*/
|
|
470
|
+
template?: React_2.ComponentType<ChatMessageTemplateProps>;
|
|
471
|
+
/**
|
|
472
|
+
* @hidden
|
|
473
|
+
*/
|
|
474
|
+
onRequestSelection: any;
|
|
475
|
+
/**
|
|
476
|
+
* Represents the tab index attribute.
|
|
477
|
+
*/
|
|
478
|
+
tabIndex?: number;
|
|
479
|
+
/**
|
|
480
|
+
* @hidden
|
|
481
|
+
*/
|
|
482
|
+
isFirstItemInGroup: boolean;
|
|
483
|
+
/**
|
|
484
|
+
* @hidden
|
|
485
|
+
*/
|
|
486
|
+
isLastItemInGroup: boolean;
|
|
487
|
+
/**
|
|
488
|
+
* @hidden
|
|
489
|
+
*/
|
|
490
|
+
isOnlyItemInGroup: boolean;
|
|
491
|
+
/**
|
|
492
|
+
* Represents the date format of the message date.
|
|
493
|
+
*/
|
|
494
|
+
dateFormat?: string;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* The arguments for the `messagesend` event of the Chat.
|
|
499
|
+
*/
|
|
500
|
+
export declare interface ChatMessageSendEvent extends BaseEvent<Chat> {
|
|
501
|
+
/**
|
|
502
|
+
* The new message.
|
|
503
|
+
*/
|
|
504
|
+
message: Message;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Represents the properties available to the `messageTemplate` custom component.
|
|
509
|
+
*
|
|
510
|
+
* For more information, refer to the [Message Template]({% slug message_templates_chat %}) article.
|
|
511
|
+
*/
|
|
512
|
+
export declare interface ChatMessageTemplateProps {
|
|
513
|
+
item: MessageModel;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
export declare interface ChatProps {
|
|
517
|
+
/**
|
|
518
|
+
* Sets a class of the Chat DOM element.
|
|
519
|
+
*/
|
|
520
|
+
className?: string;
|
|
521
|
+
/**
|
|
522
|
+
* Sets the messages of the Chat.
|
|
523
|
+
*/
|
|
524
|
+
messages: Message[];
|
|
525
|
+
/**
|
|
526
|
+
* Sets the [`User`]({% slug api_conversational-ui %}) instance for the local user. The User ID identifies messages that are authored by the local user.
|
|
527
|
+
*/
|
|
528
|
+
user: User;
|
|
529
|
+
/**
|
|
530
|
+
* A React functional or class component which is used as a message template. The corresponding [`message`]({% slug api_conversational-ui_message %}) is passed to the component as a property by the name `item`.
|
|
531
|
+
*/
|
|
532
|
+
messageTemplate?: React.ComponentType<ChatMessageTemplateProps>;
|
|
533
|
+
/**
|
|
534
|
+
* A React functional or class component which is used as an attachment template ([see example]({% slug attachments_chat %}#toc-attachment-templates)). The corresponding [`attachment`]({% slug api_conversational-ui_attachment %}) is passed to the component as a property by the name `item`.
|
|
535
|
+
*/
|
|
536
|
+
attachmentTemplate?: any;
|
|
537
|
+
/**
|
|
538
|
+
* Sets the width of the Chat.
|
|
539
|
+
*/
|
|
540
|
+
width?: string | number;
|
|
541
|
+
/**
|
|
542
|
+
* Determines if the toolbar will be rendered.
|
|
543
|
+
*/
|
|
544
|
+
showToolbar?: any;
|
|
545
|
+
/**
|
|
546
|
+
* Renders a toolbar inside the Chat.
|
|
547
|
+
*/
|
|
548
|
+
toolbar?: any;
|
|
549
|
+
/**
|
|
550
|
+
* Fires when the user types a message and clicks the **Send** button or presses **Enter**. Emits the [`MessageSendEvent`]({% slug api_conversational-ui_chatmessagesendevent %}).
|
|
551
|
+
*
|
|
552
|
+
* > The Chat is not automatically updated with the new message.
|
|
553
|
+
*/
|
|
554
|
+
onMessageSend?: (event: ChatMessageSendEvent) => void;
|
|
555
|
+
/**
|
|
556
|
+
* Fires when the user clicks a quick action button. The Chat internally handles the `reply`, `openUrl`, and `call` [known actions]({% slug api_conversational-ui_actiontype %}). Emits the [`ExecuteActionEvent`]({% slug api_conversational-ui_chatactionexecuteevent %}). The event is preventable. If `preventDefault` is called, the built-in action will be suppressed.
|
|
557
|
+
*/
|
|
558
|
+
onActionExecute?: (event: ChatActionExecuteEvent) => void;
|
|
559
|
+
/**
|
|
560
|
+
* Fires when the user clicks the button to show or hide the toolbar.
|
|
561
|
+
*/
|
|
562
|
+
onToolbarActionExecute?: (event: ChatToolbarActionExecuteEvent) => void;
|
|
563
|
+
/**
|
|
564
|
+
* Sets the direction of the Chat component.
|
|
565
|
+
*/
|
|
566
|
+
dir?: string;
|
|
567
|
+
/**
|
|
568
|
+
* The text which is visible inside the new message input when the message input is empty.
|
|
569
|
+
*/
|
|
570
|
+
placeholder?: string;
|
|
571
|
+
/**
|
|
572
|
+
* Enables the customization or the override of the default message box item in the Conversational UI
|
|
573
|
+
* ([see example]({% slug custom-rendering_chat %})).
|
|
574
|
+
*/
|
|
575
|
+
messageBox?: React.ComponentType<ChatMessageBoxProps>;
|
|
576
|
+
/**
|
|
577
|
+
* Represents the ChatMessage component.
|
|
578
|
+
*/
|
|
579
|
+
message?: React.ComponentType<ChatMessageProps>;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* @hidden
|
|
584
|
+
*/
|
|
585
|
+
export declare interface ChatState {
|
|
586
|
+
selectedItemIndex: number | null;
|
|
587
|
+
isFirstRender: boolean;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* The arguments for the `toolbaractionexecute` event of the Chat.
|
|
592
|
+
*/
|
|
593
|
+
export declare interface ChatToolbarActionExecuteEvent extends BaseEvent<Chat> {
|
|
594
|
+
/**
|
|
595
|
+
* The new toolbarShow value.
|
|
596
|
+
*/
|
|
597
|
+
show: boolean;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* An interface for the command in the Command view.
|
|
602
|
+
*/
|
|
603
|
+
export declare interface CommandInterface extends CommandItemInterface {
|
|
604
|
+
/**
|
|
605
|
+
* Collection with nested commands.
|
|
606
|
+
*/
|
|
607
|
+
children?: CommandItemInterface[];
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* An interface for the command item.
|
|
612
|
+
*/
|
|
613
|
+
export declare interface CommandItemInterface {
|
|
614
|
+
/**
|
|
615
|
+
* The unique identifier of the command.
|
|
616
|
+
*/
|
|
617
|
+
id: string;
|
|
618
|
+
/**
|
|
619
|
+
* Specifies the command text.
|
|
620
|
+
*/
|
|
621
|
+
text: string;
|
|
622
|
+
/**
|
|
623
|
+
* Specifies the name of the SVG icon that will be rendered for the command.
|
|
624
|
+
*/
|
|
625
|
+
svgIcon?: SVGIcon_2;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* Specifies the default values for Commands view Toolbar.
|
|
630
|
+
*/
|
|
631
|
+
export declare const commandsViewDefaults: AIPromptToolbarItemInterface;
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* @hidden
|
|
635
|
+
*/
|
|
636
|
+
declare abstract class FocusableUponSelection<P extends FocusableUponSelectionProps, S = {}> extends React_2.Component<P, S> {
|
|
637
|
+
protected elementToFocus: any;
|
|
638
|
+
/**
|
|
639
|
+
* @hidden
|
|
640
|
+
*/
|
|
641
|
+
componentDidUpdate(prevProps: any): void;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* @hidden
|
|
646
|
+
*/
|
|
647
|
+
declare interface FocusableUponSelectionProps {
|
|
648
|
+
/**
|
|
649
|
+
* Sets the `selected` state of the component.
|
|
650
|
+
*/
|
|
651
|
+
selected: boolean;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Represents a Hero Card component. Hero cards host a single large image and action buttons with text content.
|
|
656
|
+
*/
|
|
657
|
+
export declare class HeroCard extends React_2.Component<HeroCardProps, {}> {
|
|
658
|
+
/**
|
|
659
|
+
* @hidden
|
|
660
|
+
*/
|
|
661
|
+
render(): JSX_2.Element;
|
|
662
|
+
private onBtnClick;
|
|
663
|
+
private getActionsView;
|
|
664
|
+
private getTitleView;
|
|
665
|
+
private getSubtitleView;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
/**
|
|
669
|
+
* The arguments for the `actionexecute` event of the hero card.
|
|
670
|
+
*/
|
|
671
|
+
export declare interface HeroCardActionExecuteEvent extends BaseEvent<HeroCard> {
|
|
672
|
+
/**
|
|
673
|
+
* The executed action.
|
|
674
|
+
*/
|
|
675
|
+
action: Action;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
export declare interface HeroCardProps {
|
|
679
|
+
/**
|
|
680
|
+
* The URL of the hero card image.
|
|
681
|
+
*/
|
|
682
|
+
imageUrl: string;
|
|
683
|
+
/**
|
|
684
|
+
* The title of the hero card.
|
|
685
|
+
*/
|
|
686
|
+
title: string;
|
|
687
|
+
/**
|
|
688
|
+
* The subtitle of the hero card.
|
|
689
|
+
*/
|
|
690
|
+
subtitle: string;
|
|
691
|
+
/**
|
|
692
|
+
* An array with the possible quick actions for this hero card.
|
|
693
|
+
*/
|
|
694
|
+
actions: Action[];
|
|
695
|
+
/**
|
|
696
|
+
* Fires when the user clicks a button.
|
|
697
|
+
*/
|
|
698
|
+
onActionExecute?: (event: HeroCardActionExecuteEvent) => void;
|
|
699
|
+
/**
|
|
700
|
+
* Max width of the card image.
|
|
701
|
+
*/
|
|
702
|
+
imageMaxWidth?: string | number;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* Represents a Chat message.
|
|
707
|
+
*
|
|
708
|
+
* > * You are required to provide the `author` field.
|
|
709
|
+
* > * [Local users]({% slug api_conversational-ui_chatprops %}#toc-user) are displayed to the
|
|
710
|
+
* right in left-to-right languages and to the left in right-to-left languages.
|
|
711
|
+
* > * If `typing` is set to `true`, the Chat displays a typing indicator instead of text.
|
|
712
|
+
*/
|
|
713
|
+
export declare interface Message {
|
|
714
|
+
/**
|
|
715
|
+
* The author of the message.
|
|
716
|
+
*/
|
|
717
|
+
author: User;
|
|
718
|
+
/**
|
|
719
|
+
* The layout that will be used for displaying message attachments, if any
|
|
720
|
+
* ([see example]({% slug attachments_chat %}#toc-display-modes)).
|
|
721
|
+
*/
|
|
722
|
+
attachmentLayout?: AttachmentLayout;
|
|
723
|
+
/**
|
|
724
|
+
* (Optional) The message attachments
|
|
725
|
+
* ([see example]({% slug attachments_chat %})).
|
|
726
|
+
*/
|
|
727
|
+
attachments?: Attachment[];
|
|
728
|
+
/**
|
|
729
|
+
* The suggested quick actions that will be displayed below this message
|
|
730
|
+
* ([see example]({% slug suggested_actions_chat %}#toc-defining-quick-actions)).
|
|
731
|
+
*
|
|
732
|
+
* > Suggested actions are displayed only for the last message in the conversation.
|
|
733
|
+
*/
|
|
734
|
+
suggestedActions?: Action[];
|
|
735
|
+
/**
|
|
736
|
+
* An optional status string for the message.
|
|
737
|
+
* The status is displayed when the message is selected—either
|
|
738
|
+
* by clicking on it or by using the keyboard navigation shortcuts.
|
|
739
|
+
*/
|
|
740
|
+
status?: string;
|
|
741
|
+
/**
|
|
742
|
+
* (Optional) The text for the message.
|
|
743
|
+
* For example, certain messages can contain
|
|
744
|
+
* only attachments or quick actions.
|
|
745
|
+
*/
|
|
746
|
+
text?: string;
|
|
747
|
+
/**
|
|
748
|
+
* The time at which the message was composed.
|
|
749
|
+
*
|
|
750
|
+
*/
|
|
751
|
+
timestamp?: Date;
|
|
752
|
+
/**
|
|
753
|
+
* A Boolean value which indicates if the message is still being typed by the user.
|
|
754
|
+
* If set to `true`, the Chat displays a typing indicator instead of the actual message.
|
|
755
|
+
*/
|
|
756
|
+
typing?: boolean;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
/**
|
|
760
|
+
* Represents the data item of a single `Message`.
|
|
761
|
+
*/
|
|
762
|
+
export declare interface MessageModel extends Message, Selectable {
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* Specifies the default values for Output view Toolbar.
|
|
767
|
+
*/
|
|
768
|
+
export declare const outputViewDefaults: AIPromptToolbarItemInterface;
|
|
769
|
+
|
|
770
|
+
/**
|
|
771
|
+
* @hidden
|
|
772
|
+
*/
|
|
773
|
+
export declare const PromptHeader: (props: AIPromptHeaderProps) => JSX_2.Element;
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* Specifies the default values for Prompt view Toolbar.
|
|
777
|
+
*/
|
|
778
|
+
export declare const promptViewDefaults: AIPromptToolbarItemInterface;
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* @hidden
|
|
782
|
+
*/
|
|
783
|
+
declare interface Selectable {
|
|
784
|
+
selectionIndex: number;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* Represents a participant in a Chat conversation.
|
|
789
|
+
*/
|
|
790
|
+
export declare interface User {
|
|
791
|
+
/**
|
|
792
|
+
* A unique ID for this user.
|
|
793
|
+
* Typically, the ID is a number.
|
|
794
|
+
* Can also be a string or an object.
|
|
795
|
+
*/
|
|
796
|
+
id: any;
|
|
797
|
+
/**
|
|
798
|
+
* (Optional) The displayed name for the user.
|
|
799
|
+
*/
|
|
800
|
+
name?: string;
|
|
801
|
+
/**
|
|
802
|
+
* (Optional) An avatar image for the user.
|
|
803
|
+
*/
|
|
804
|
+
avatarUrl?: string;
|
|
805
|
+
/**
|
|
806
|
+
* (Optional) An avatar image alt text for the user.
|
|
807
|
+
*/
|
|
808
|
+
avatarAltText?: string;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
export { }
|