@progress/kendo-angular-conversational-ui 21.4.1-develop.1 → 22.0.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.
Files changed (116) hide show
  1. package/ai-prompt/localization/messages.d.ts +1 -1
  2. package/ai-prompt/views/base-view.d.ts +1 -1
  3. package/chat/l10n/messages.d.ts +1 -1
  4. package/fesm2022/progress-kendo-angular-conversational-ui.mjs +182 -182
  5. package/inline-ai-prompt/localization/messages.d.ts +1 -1
  6. package/package.json +17 -25
  7. package/esm2022/ai-prompt/aiprompt.component.mjs +0 -556
  8. package/esm2022/ai-prompt/aiprompt.module.mjs +0 -53
  9. package/esm2022/ai-prompt/common/aiprompt.service.mjs +0 -75
  10. package/esm2022/ai-prompt/common/output-card.component.mjs +0 -230
  11. package/esm2022/ai-prompt/common/toolbar-focusable.directive.mjs +0 -72
  12. package/esm2022/ai-prompt/common/toolbar-navigation.service.mjs +0 -56
  13. package/esm2022/ai-prompt/localization/custom-messages.component.mjs +0 -54
  14. package/esm2022/ai-prompt/localization/localized-messages.directive.mjs +0 -39
  15. package/esm2022/ai-prompt/localization/messages.mjs +0 -77
  16. package/esm2022/ai-prompt/models/ai-prompt-settings.mjs +0 -5
  17. package/esm2022/ai-prompt/models/command-execute-event.mjs +0 -5
  18. package/esm2022/ai-prompt/models/command.interface.mjs +0 -5
  19. package/esm2022/ai-prompt/models/index.mjs +0 -5
  20. package/esm2022/ai-prompt/models/output-rating-change-event.mjs +0 -5
  21. package/esm2022/ai-prompt/models/prompt-output.interface.mjs +0 -5
  22. package/esm2022/ai-prompt/models/prompt-request-event.mjs +0 -5
  23. package/esm2022/ai-prompt/models/view-type.mjs +0 -5
  24. package/esm2022/ai-prompt/templates/aiprompt-output-body-template.directive.mjs +0 -33
  25. package/esm2022/ai-prompt/templates/aiprompt-output-template.directive.mjs +0 -33
  26. package/esm2022/ai-prompt/templates/toolbar-actions.template.mjs +0 -39
  27. package/esm2022/ai-prompt/utils.mjs +0 -26
  28. package/esm2022/ai-prompt/views/base-view.mjs +0 -98
  29. package/esm2022/ai-prompt/views/command-view.component.mjs +0 -100
  30. package/esm2022/ai-prompt/views/custom-view.component.mjs +0 -50
  31. package/esm2022/ai-prompt/views/index.mjs +0 -8
  32. package/esm2022/ai-prompt/views/output-view.component.mjs +0 -90
  33. package/esm2022/ai-prompt/views/prompt-view.component.mjs +0 -288
  34. package/esm2022/chat/api/action.interface.mjs +0 -5
  35. package/esm2022/chat/api/attachment.interface.mjs +0 -5
  36. package/esm2022/chat/api/chat-file-interface.mjs +0 -5
  37. package/esm2022/chat/api/chat-suggestion.interface.mjs +0 -5
  38. package/esm2022/chat/api/execute-action-event.mjs +0 -29
  39. package/esm2022/chat/api/file-action.mjs +0 -5
  40. package/esm2022/chat/api/file-download-event.interface.mjs +0 -5
  41. package/esm2022/chat/api/files-layout.mjs +0 -5
  42. package/esm2022/chat/api/index.mjs +0 -21
  43. package/esm2022/chat/api/message-action.mjs +0 -5
  44. package/esm2022/chat/api/message-settings.interface.mjs +0 -5
  45. package/esm2022/chat/api/message-width-mode.mjs +0 -5
  46. package/esm2022/chat/api/message.interface.mjs +0 -5
  47. package/esm2022/chat/api/post-message-event.mjs +0 -21
  48. package/esm2022/chat/api/preventable-event.mjs +0 -28
  49. package/esm2022/chat/api/send-button-settings.mjs +0 -5
  50. package/esm2022/chat/api/suggestions-layout.mjs +0 -5
  51. package/esm2022/chat/api/timestamp-visibility.mjs +0 -5
  52. package/esm2022/chat/api/user.interface.mjs +0 -5
  53. package/esm2022/chat/attachment.component.mjs +0 -105
  54. package/esm2022/chat/builtin-actions.mjs +0 -27
  55. package/esm2022/chat/cards/hero-card.component.mjs +0 -131
  56. package/esm2022/chat/chat-file.component.mjs +0 -144
  57. package/esm2022/chat/chat-item.mjs +0 -10
  58. package/esm2022/chat/chat-view.mjs +0 -80
  59. package/esm2022/chat/chat.component.mjs +0 -1015
  60. package/esm2022/chat/chat.directives.mjs +0 -18
  61. package/esm2022/chat/chat.module.mjs +0 -61
  62. package/esm2022/chat/common/chat.service.mjs +0 -179
  63. package/esm2022/chat/common/models/default-model-fields.mjs +0 -25
  64. package/esm2022/chat/common/models/formatted-text-parts.mjs +0 -5
  65. package/esm2022/chat/common/models/message-box-options.mjs +0 -5
  66. package/esm2022/chat/common/models/model-fields.mjs +0 -5
  67. package/esm2022/chat/common/scroll-anchor.directive.mjs +0 -80
  68. package/esm2022/chat/common/scroll-button.component.mjs +0 -81
  69. package/esm2022/chat/common/scroll.service.mjs +0 -110
  70. package/esm2022/chat/common/utils.mjs +0 -159
  71. package/esm2022/chat/l10n/custom-messages.component.mjs +0 -55
  72. package/esm2022/chat/l10n/localized-messages.directive.mjs +0 -40
  73. package/esm2022/chat/l10n/messages.mjs +0 -130
  74. package/esm2022/chat/message-attachments.component.mjs +0 -258
  75. package/esm2022/chat/message-box.component.mjs +0 -501
  76. package/esm2022/chat/message-list.component.mjs +0 -617
  77. package/esm2022/chat/message-reference-content.component.mjs +0 -86
  78. package/esm2022/chat/message.component.mjs +0 -740
  79. package/esm2022/chat/suggested-actions.component.mjs +0 -443
  80. package/esm2022/chat/templates/attachment-template.directive.mjs +0 -43
  81. package/esm2022/chat/templates/author-message-content-template.directive.mjs +0 -39
  82. package/esm2022/chat/templates/author-message-template.directive.mjs +0 -39
  83. package/esm2022/chat/templates/header-template.directive.mjs +0 -33
  84. package/esm2022/chat/templates/message-box.directive.mjs +0 -36
  85. package/esm2022/chat/templates/message-content-template.directive.mjs +0 -39
  86. package/esm2022/chat/templates/message-template.directive.mjs +0 -39
  87. package/esm2022/chat/templates/no-data-template.directive.mjs +0 -38
  88. package/esm2022/chat/templates/receiver-message-content-template.directive.mjs +0 -39
  89. package/esm2022/chat/templates/receiver-message-template.directive.mjs +0 -39
  90. package/esm2022/chat/templates/status-template.directive.mjs +0 -33
  91. package/esm2022/chat/templates/suggestion-template.directive.mjs +0 -36
  92. package/esm2022/chat/templates/timestamp-template.directive.mjs +0 -42
  93. package/esm2022/chat/templates/user-status-template.directive.mjs +0 -38
  94. package/esm2022/conversational-ui.module.mjs +0 -73
  95. package/esm2022/directives.mjs +0 -145
  96. package/esm2022/index.mjs +0 -40
  97. package/esm2022/inline-ai-prompt/inlineaiprompt-content.component.mjs +0 -548
  98. package/esm2022/inline-ai-prompt/inlineaiprompt.component.mjs +0 -351
  99. package/esm2022/inline-ai-prompt/inlineaiprompt.module.mjs +0 -46
  100. package/esm2022/inline-ai-prompt/inlineaiprompt.service.mjs +0 -92
  101. package/esm2022/inline-ai-prompt/localization/custom-messages.component.mjs +0 -51
  102. package/esm2022/inline-ai-prompt/localization/localized-messages.directive.mjs +0 -39
  103. package/esm2022/inline-ai-prompt/localization/messages.mjs +0 -35
  104. package/esm2022/inline-ai-prompt/models/command.interface.mjs +0 -5
  105. package/esm2022/inline-ai-prompt/models/index.mjs +0 -5
  106. package/esm2022/inline-ai-prompt/models/inlineaiprompt-popupsettings.mjs +0 -5
  107. package/esm2022/inline-ai-prompt/models/inlineaiprompt-settings.mjs +0 -59
  108. package/esm2022/inline-ai-prompt/models/messages.mjs +0 -8
  109. package/esm2022/inline-ai-prompt/models/output-action-click-event.mjs +0 -5
  110. package/esm2022/inline-ai-prompt/models/output-action.interface.mjs +0 -5
  111. package/esm2022/inline-ai-prompt/models/prompt-output.interface.mjs +0 -5
  112. package/esm2022/inline-ai-prompt/models/prompt-request-event.mjs +0 -5
  113. package/esm2022/inline-ai-prompt/output-template.directive.mjs +0 -38
  114. package/esm2022/inline-ai-prompt/utils.mjs +0 -57
  115. package/esm2022/package-metadata.mjs +0 -16
  116. package/esm2022/progress-kendo-angular-conversational-ui.mjs +0 -8
@@ -1,1015 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Component, ContentChild, ElementRef, EventEmitter, HostBinding, Input, isDevMode, Output, ViewChild, NgZone, Renderer2, ViewContainerRef } from '@angular/core';
6
- import { AttachmentTemplateDirective } from './templates/attachment-template.directive';
7
- import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
8
- import { makeHandler } from './builtin-actions';
9
- import { Subscription } from 'rxjs';
10
- import { validatePackage } from '@progress/kendo-licensing';
11
- import { packageMetadata } from '../package-metadata';
12
- import { ChatMessageBoxTemplateDirective } from './templates/message-box.directive';
13
- import { MessageBoxComponent } from './message-box.component';
14
- import { MessageListComponent } from './message-list.component';
15
- import { ScrollAnchorDirective } from './common/scroll-anchor.directive';
16
- import { LocalizedMessagesDirective } from './l10n/localized-messages.directive';
17
- import { isChanged, isPresent, processCssValue } from '@progress/kendo-angular-common';
18
- import { ChatService } from './common/chat.service';
19
- import { AppBarComponent } from "@progress/kendo-angular-navigation";
20
- import { ChatHeaderTemplateDirective } from './templates/header-template.directive';
21
- import { NgTemplateOutlet } from '@angular/common';
22
- import { KENDO_BUTTON } from '@progress/kendo-angular-buttons';
23
- import { pinIcon, xIcon } from '@progress/kendo-svg-icons';
24
- import { IconWrapperComponent } from '@progress/kendo-angular-icons';
25
- import { defaultModelFields } from './common/models/default-model-fields';
26
- import { processMessages, SEND_BTN_DEFAULT_SETTINGS, FILE_ACTIONS, CONTEXT_MENU_ACTIONS, transformActions, MENU_ITEM_SELECTOR } from './common/utils';
27
- import { ChatTimestampTemplateDirective } from './templates/timestamp-template.directive';
28
- import { MessageReferenceComponent } from './message-reference-content.component';
29
- import { ChatStatusTemplateDirective } from './templates/status-template.directive';
30
- import { ChatSuggestionTemplateDirective } from './templates/suggestion-template.directive';
31
- import { ContextMenuComponent } from '@progress/kendo-angular-menu';
32
- import { NoDataTemplateDirective, MessageTemplateDirective, AuthorMessageContentTemplateDirective, ReceiverMessageContentTemplateDirective, ReceiverMessageTemplateDirective, AuthorMessageTemplateDirective, MessageContentTemplateDirective } from './chat.directives';
33
- import { ChatUserStatusTemplateDirective } from './templates/user-status-template.directive';
34
- import { SuggestionsScrollService } from './common/scroll.service';
35
- import * as i0 from "@angular/core";
36
- import * as i1 from "@progress/kendo-angular-l10n";
37
- import * as i2 from "./common/chat.service";
38
- import * as i3 from "@progress/kendo-angular-buttons";
39
- /**
40
- * Represents the [Kendo UI Chat component for Angular](slug:overview_convui).
41
- *
42
- * Provides a conversational UI for chat-based applications.
43
- * Supports message templates, attachments, localization, and user actions.
44
- *
45
- * @example
46
- * ```html
47
- * <kendo-chat
48
- * [messages]="messages"
49
- * [authorId]="authorId"
50
- * (sendMessage)="onSendMessage($event)"
51
- * (executeAction)="onExecuteAction($event)">
52
- * </kendo-chat>
53
- * ```
54
- *
55
- * @remarks
56
- * Supported children components are: {@link CustomMessagesComponent}, {@link HeroCardComponent}, {@link AttachmentTemplateDirective}, {@link ChatHeaderTemplateDirective}, {@link ChatMessageBoxTemplateDirective}, {@link MessageContentTemplateDirective}, {@link MessageTemplateDirective},{@link ChatStatusTemplateDirective}, {@link ChatSuggestionTemplateDirective}, {@link ChatTimestampTemplateDirective}, {@link ChatNoDataTemplateDirective}, {@link ChatUserStatusTemplateDirective}, {@link AuthorMessageContentTemplateDirective}, {@link ReceiverMessageContentTemplateDirective}, {@link ReceiverMessageTemplateDirective}, {@link AuthorMessageTemplateDirective}.
57
- */
58
- export class ChatComponent {
59
- localization;
60
- zone;
61
- renderer;
62
- element;
63
- chatService;
64
- /**
65
- * Sets the Chat messages.
66
- * Accepts an array of `Message` objects, but can also accept custom data types.
67
- * For more information, check [Data Binding](slug:databinding_chat) section in the documentation.
68
- */
69
- messages;
70
- /**
71
- * Sets the ID that represents the local user.
72
- */
73
- authorId;
74
- /**
75
- * Determines the type of input used in the message box.
76
- * ([see example](slug:message_chat)).
77
- * @default 'textarea'
78
- *
79
- * @hidden
80
- */
81
- messageBoxType = 'textarea';
82
- /**
83
- * Sets the height of the Chat component.
84
- * Accepts a string with CSS units (for example, `'400px'`, `'50%'`) or a number (interpreted as pixels).
85
- * The minimum height is `600px`.
86
- */
87
- height;
88
- /**
89
- * Sets the width of the Chat component.
90
- * Accepts a string with CSS units (for example, `'400px'`, `'50%'`) or a number (interpreted as pixels).
91
- * The minimum width is `320px`.
92
- */
93
- width;
94
- /**
95
- * Sets the placeholder text for the message input box.
96
- */
97
- placeholder;
98
- /**
99
- * Controls the width of the message between the predefined options.
100
- *
101
- * @default 'standard'
102
- */
103
- messageWidthMode = 'standard';
104
- /**
105
- * Controls the visibility of timestamps in messages.
106
- *
107
- * @default 'focus'
108
- */
109
- timestampVisibility = 'focus';
110
- /**
111
- * Controls the visibility of usernames in messages.
112
- * When set to `true`, the username displays above each message bubble.
113
- *
114
- * @default true
115
- */
116
- showUsername = true;
117
- /**
118
- * Controls the avatar visibility for the messages.
119
- * When set to `true`, the user avatar displays next to each message bubble.
120
- *
121
- * @default true
122
- */
123
- showAvatar = true;
124
- /**
125
- * Enables the expand or collapse functionality for messages.
126
- *
127
- * @default false
128
- */
129
- allowMessageCollapse = false;
130
- /**
131
- * Sets the Speech to Text button settings.
132
- *
133
- * @default true
134
- */
135
- enableSpeechToText = true;
136
- /**
137
- * Sets the File Select settings.
138
- *
139
- * @default true
140
- */
141
- enableFileSelect = true;
142
- /**
143
- * Sets the actions of the message toolbar.
144
- * These actions display in the message toolbar and let you perform specific operations on the message.
145
- *
146
- * @default []
147
- */
148
- messageToolbarActions = [];
149
- /**
150
- * Sets the value of the Message Box.
151
- *
152
- * @default ''
153
- */
154
- inputValue = '';
155
- /**
156
- * Sets the settings for the author's messages.
157
- */
158
- authorMessageSettings;
159
- /**
160
- * Sets the settings for the receivers' messages.
161
- */
162
- receiverMessageSettings;
163
- /**
164
- * Sets the default actions that display in the message context menu.
165
- *
166
- * @default [{ id: 'copy', label: 'Copy', icon: 'copy', svgIcon: copyIcon, disabled: false }, { id: 'reply', label: 'Reply', icon: 'undo', svgIcon: undoIcon, disabled: false }]
167
- */
168
- defaultContextMenuActions = CONTEXT_MENU_ACTIONS;
169
- /**
170
- * Sets the actions that display in the message as a context menu.
171
- * These actions display as menu items and let you perform specific operations on the message.
172
- * The default actions are `copy` and `reply` and are defined by their `id`.
173
- */
174
- set messageContextMenuActions(actions) {
175
- this._messageContextMenuActions = this.mergeWithDefaultActions(actions, CONTEXT_MENU_ACTIONS);
176
- }
177
- get messageContextMenuActions() {
178
- return this._messageContextMenuActions;
179
- }
180
- /**
181
- * Sets the default actions that display in the file actions DropDownButton.
182
- *
183
- * @default [{ id: 'download', label: 'Download', icon: 'download', svgIcon: downloadIcon, disabled: false }]
184
- */
185
- defaultFileActions = FILE_ACTIONS;
186
- /**
187
- * Sets the actions that display in the file as items of a DropDownButton.
188
- * These actions display when you click the file DropDownButton and let you perform specific operations on the file.
189
- * The default action is `download` and is defined by its `id`.
190
- *
191
- * @default [{ id: 'download', label: 'Download', icon: 'download', svgIcon: downloadIcon, disabled: false }]
192
- */
193
- set fileActions(actions) {
194
- this._fileActions = this.mergeWithDefaultActions(actions, FILE_ACTIONS);
195
- }
196
- get fileActions() {
197
- return this._fileActions;
198
- }
199
- /**
200
- * Sets the layout of the files in the message bubble.
201
- *
202
- * @default 'vertical'
203
- */
204
- set messageFilesLayout(layout) {
205
- this.chatService.messageFilesLayout = layout;
206
- }
207
- /**
208
- * Sets the layout of the suggestions above the message input box.
209
- *
210
- * @default 'scroll'
211
- */
212
- set suggestionsLayout(layoutMode) {
213
- if (layoutMode) {
214
- this.chatService.suggestionsLayout = layoutMode;
215
- }
216
- }
217
- /**
218
- * Sets the layout of the quick actions suggested below the messages.
219
- *
220
- * @default 'scroll'
221
- */
222
- set quickActionsLayout(layoutMode) {
223
- if (layoutMode) {
224
- this.chatService.quickActionsLayout = layoutMode;
225
- }
226
- }
227
- /**
228
- * Sets the suggestions that display in the message input box.
229
- * Suggestions display as a list of clickable items that let you quickly insert predefined text into the message input.
230
- *
231
- * @default []
232
- */
233
- suggestions = [];
234
- /**
235
- * Sets the send button settings for the Chat component.
236
- * Allows customization of the send button appearance, icons and disabled state.
237
- *
238
- * @default { fillMode: 'solid', rounded: 'full', size: 'medium', themeColor: 'primary', icon: 'paper-plane', svgIcon: paperPlaneIcon}
239
- */
240
- sendButtonSettings = SEND_BTN_DEFAULT_SETTINGS;
241
- /**
242
- * Sets the names of the model fields from which the Chat reads its data.
243
- * Lets you map custom data types to the expected `Message` format.
244
- */
245
- set modelFields(value) {
246
- this._modelFields = { ...defaultModelFields, ...value };
247
- }
248
- get modelFields() {
249
- return this._modelFields;
250
- }
251
- /**
252
- * Fires when the user sends a message by clicking the **Send** button or pressing **Enter**.
253
- *
254
- * The message is not automatically added to the `messages` array.
255
- */
256
- sendMessage = new EventEmitter();
257
- /**
258
- * Fires when the user clicks a quick action button in the message toolbar.
259
- */
260
- toolbarActionClick = new EventEmitter();
261
- /**
262
- * Fires when the user clicks an action in the message context menu.
263
- */
264
- contextMenuActionClick = new EventEmitter();
265
- /**
266
- * Fires when the user clicks an action in the file context menu.
267
- */
268
- fileActionClick = new EventEmitter();
269
- /**
270
- * Fires when the user clicks an action in the file context menu.
271
- */
272
- download = new EventEmitter();
273
- /**
274
- * Fires when the user clicks a quick action button.
275
- * The Chat internally handles [known actions](slug:api_conversational-ui_actiontype) such as `reply`, `openUrl`, and `call`.
276
- *
277
- * The event is preventable. Calling [`preventDefault`](https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) suppresses the built-in action.
278
- */
279
- executeAction = new EventEmitter();
280
- /**
281
- * Fires when the user clicks a suggestion in the message input box.
282
- */
283
- suggestionExecute = new EventEmitter();
284
- /**
285
- * Fires when the user selects a file in the message input box.
286
- */
287
- fileSelect = new EventEmitter();
288
- /**
289
- * Fires when the user removes a file from the message input box.
290
- */
291
- fileRemove = new EventEmitter();
292
- /**
293
- * Fires when the user unpins the pinned message.
294
- * This event triggers when the user clicks the delete button on the pinned message.
295
- */
296
- unpin = new EventEmitter();
297
- /**
298
- * Fires when the user types in the message input box.
299
- */
300
- inputValueChange = new EventEmitter();
301
- get className() {
302
- return 'k-chat';
303
- }
304
- get dirAttr() {
305
- return this.direction;
306
- }
307
- set messagesContextMenu(contextMenu) {
308
- this.chatService.messagesContextMenu = contextMenu;
309
- }
310
- attachmentTemplate;
311
- chatHeaderTemplate;
312
- chatNoDataTemplate;
313
- authorMessageContentTemplate;
314
- receiverMessageContentTemplate;
315
- messageContentTemplate;
316
- authorMessageTemplate;
317
- receiverMessageTemplate;
318
- messageTemplate;
319
- timestampTemplate;
320
- suggestionTemplate;
321
- statusTemplate;
322
- messageBoxTemplate;
323
- userStatusTemplate;
324
- messageBox;
325
- /**
326
- * @hidden
327
- */
328
- messageList;
329
- /**
330
- * @hidden
331
- * Returns processed messages when model fields are used, otherwise returns original messages.
332
- */
333
- get processedMessages() {
334
- if (!this.messages || this.messages.length === 0) {
335
- return [];
336
- }
337
- if (this._modelFields && Object.keys(this._modelFields).some(key => this._modelFields[key] !== defaultModelFields[key])) {
338
- if (this.messages !== this._lastMessagesReference || this._modelFields !== this._lastModelFields) {
339
- this._cachedProcessedMessages = processMessages(this.messages, this._modelFields);
340
- this._lastMessagesReference = this.messages;
341
- this._lastModelFields = this._modelFields;
342
- }
343
- return this._cachedProcessedMessages;
344
- }
345
- return this.messages;
346
- }
347
- /**
348
- * Gets the actions available in the message context menu.
349
- *
350
- * @hidden
351
- */
352
- get contextMenuActions() {
353
- const currentActions = this.chatService.calculatedContextMenuActions;
354
- if (currentActions !== this._lastContextMenuActionsReference) {
355
- this._cachedContextMenuActions = transformActions(currentActions);
356
- this._lastContextMenuActionsReference = currentActions;
357
- }
358
- return this._cachedContextMenuActions;
359
- }
360
- /**
361
- * @hidden
362
- */
363
- get localizationText() {
364
- return this.localization;
365
- }
366
- /**
367
- * @hidden
368
- */
369
- autoScroll = true;
370
- /**
371
- * @hidden
372
- */
373
- pinIcon = pinIcon;
374
- /**
375
- * @hidden
376
- */
377
- deleteIcon = xIcon;
378
- /**
379
- * @hidden
380
- */
381
- pinnedMessage;
382
- direction;
383
- subs = new Subscription();
384
- _modelFields = defaultModelFields;
385
- _messageContextMenuActions = CONTEXT_MENU_ACTIONS;
386
- _fileActions = FILE_ACTIONS;
387
- _cachedProcessedMessages = [];
388
- _lastMessagesReference = null;
389
- _lastModelFields = null;
390
- _cachedContextMenuActions = [];
391
- _lastContextMenuActionsReference = null;
392
- constructor(localization, zone, renderer, element, chatService) {
393
- this.localization = localization;
394
- this.zone = zone;
395
- this.renderer = renderer;
396
- this.element = element;
397
- this.chatService = chatService;
398
- validatePackage(packageMetadata);
399
- this.direction = localization.rtl ? 'rtl' : 'ltr';
400
- this.subs.add(localization.changes.subscribe(({ rtl }) => {
401
- this.direction = rtl ? 'rtl' : 'ltr';
402
- }));
403
- }
404
- /**
405
- * @hidden
406
- */
407
- ngOnInit() {
408
- this.chatService.messageWidthMode = this.messageWidthMode;
409
- this.chatService.timestampVisibility = this.timestampVisibility;
410
- this.chatService.showUsername = this.showUsername;
411
- this.chatService.showAvatar = this.showAvatar;
412
- this.chatService.allowMessageCollapse = this.allowMessageCollapse;
413
- this.chatService.enableSpeechToText = this.enableSpeechToText;
414
- this.chatService.sendButtonSettings = this.sendButtonSettings;
415
- this.chatService.enableFileSelect = this.enableFileSelect;
416
- this.chatService.messageToolbarActions = this.messageToolbarActions;
417
- this.chatService.messageContextMenuActions = this.messageContextMenuActions;
418
- this.chatService.fileActions = this.fileActions;
419
- this.chatService.authorMessageSettings = this.authorMessageSettings;
420
- this.chatService.receiverMessageSettings = this.receiverMessageSettings;
421
- this.chatService.messages = this.processedMessages || [];
422
- this.chatService.chatElement = this.messageList;
423
- this.subs.add(this.chatService.toolbarAction$.subscribe((actionEvent) => {
424
- this.toolbarActionClick.emit(actionEvent);
425
- }));
426
- this.subs.add(this.chatService.contextMenuAction$.subscribe((actionEvent) => {
427
- this.contextMenuActionClick.emit(actionEvent);
428
- }));
429
- this.subs.add(this.chatService.fileAction$.subscribe((actionEvent) => {
430
- this.fileActionClick.emit(actionEvent);
431
- }));
432
- this.subs.add(this.chatService.fileDownload$.subscribe((actionEvent) => {
433
- this.download.emit(actionEvent);
434
- }));
435
- this.subs.add(this.chatService.inputValueChange$.subscribe((value) => {
436
- this.inputValueChange.emit(value);
437
- }));
438
- this.pinnedMessage = this.findLastPinnedMessage();
439
- this.chatService.authorId = this.authorId;
440
- }
441
- /**
442
- * @hidden
443
- */
444
- ngOnChanges(changes) {
445
- this.zone.runOutsideAngular(() => setTimeout(() => {
446
- this.messageList.element.nativeElement.style.flex = '1 1 auto';
447
- }));
448
- if (isChanged('messages', changes, false)) {
449
- this.pinnedMessage = this.findLastPinnedMessage();
450
- this.chatService.messages = this.processedMessages;
451
- }
452
- if (isChanged('height', changes, false)) {
453
- this.renderer.setStyle(this.element.nativeElement, 'height', `${processCssValue(this.height)}`);
454
- }
455
- if (isChanged('width', changes, false)) {
456
- this.renderer.setStyle(this.element.nativeElement, 'width', `${processCssValue(this.width)}`);
457
- }
458
- this.updateChatServiceProperties([
459
- 'authorId',
460
- 'messageWidthMode',
461
- 'timestampVisibility',
462
- 'showUsername',
463
- 'showAvatar',
464
- 'allowMessageCollapse',
465
- 'enableSpeechToText',
466
- 'sendButtonSettings',
467
- 'enableFileSelect',
468
- 'messageToolbarActions',
469
- 'messageContextMenuActions',
470
- 'fileActions',
471
- 'authorMessageSettings',
472
- 'receiverMessageSettings'
473
- ], changes);
474
- }
475
- /**
476
- * @hidden
477
- */
478
- ngAfterViewInit() {
479
- if (!isDevMode()) {
480
- return;
481
- }
482
- if (!isPresent(this.authorId)) {
483
- throw new Error('AuthorId must be set.');
484
- }
485
- }
486
- /**
487
- * @hidden
488
- */
489
- ngOnDestroy() {
490
- if (this.subs) {
491
- this.subs.unsubscribe();
492
- }
493
- }
494
- /**
495
- * @hidden
496
- */
497
- dispatchAction(e) {
498
- this.executeAction.emit(e);
499
- if (!e.isDefaultPrevented()) {
500
- const handler = makeHandler(e.action);
501
- handler(e.action, this);
502
- if (!this.messageBoxTemplate) {
503
- this.messageBox.messageBoxInput.focus();
504
- }
505
- }
506
- }
507
- /**
508
- * @hidden
509
- */
510
- textFor(key) {
511
- return this.localization.get(key);
512
- }
513
- /**
514
- * @hidden
515
- */
516
- scrollToPinnedMessage() {
517
- if (this.pinnedMessage) {
518
- this.chatService.scrollToMessage(this.pinnedMessage?.id);
519
- }
520
- }
521
- /**
522
- * @hidden
523
- */
524
- onContextMenuAction(action) {
525
- if (action.id === 'reply') {
526
- this.chatService.reply = this.chatService.activeMessage;
527
- }
528
- if (action.id === 'copy') {
529
- navigator.clipboard.writeText(this.chatService.activeMessage.text);
530
- }
531
- this.chatService.emit('contextMenuAction', { action, message: this.chatService.activeMessage });
532
- }
533
- /**
534
- * @hidden
535
- */
536
- handleMenuClose(event) {
537
- if (event) {
538
- const originalEvent = event.originalEvent;
539
- originalEvent && this.onActionButtonClick(originalEvent);
540
- }
541
- this.chatService.activeMessage = null;
542
- this.chatService.emit('contextMenuVisibilityChange', false);
543
- if (this.chatService.selectOnMenuClose) {
544
- this.chatService.activeMessageElement.selected = true;
545
- this.chatService.focusActiveMessageElement();
546
- }
547
- }
548
- /**
549
- * @hidden
550
- */
551
- onActionButtonClick(event) {
552
- const clickOutsideMessage = event instanceof MouseEvent && !event.target?.closest('.k-chat-bubble');
553
- const menuItemClick = event instanceof MouseEvent && event.target?.closest(MENU_ITEM_SELECTOR);
554
- if (clickOutsideMessage && !menuItemClick) {
555
- this.chatService.selectOnMenuClose = false;
556
- }
557
- }
558
- findLastPinnedMessage() {
559
- return [...this.processedMessages].reverse().find((message) => message.isPinned);
560
- }
561
- updateChatServiceProperties(propNames, changes) {
562
- propNames.forEach(propName => {
563
- if (isChanged(propName, changes, false)) {
564
- this.chatService[propName] = this[propName];
565
- }
566
- });
567
- }
568
- mergeWithDefaultActions(actions, defaultActions) {
569
- if (!actions || actions.length === 0) {
570
- return [];
571
- }
572
- return actions.map(userAction => {
573
- const defaultAction = defaultActions.find(action => action.id === userAction?.id);
574
- if (defaultAction) {
575
- return { ...defaultAction, ...userAction };
576
- }
577
- return userAction;
578
- });
579
- }
580
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ChatComponent, deps: [{ token: i1.LocalizationService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i2.ChatService }], target: i0.ɵɵFactoryTarget.Component });
581
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ChatComponent, isStandalone: true, selector: "kendo-chat", inputs: { messages: "messages", authorId: "authorId", messageBoxType: "messageBoxType", height: "height", width: "width", placeholder: "placeholder", messageWidthMode: "messageWidthMode", timestampVisibility: "timestampVisibility", showUsername: "showUsername", showAvatar: "showAvatar", allowMessageCollapse: "allowMessageCollapse", enableSpeechToText: "enableSpeechToText", enableFileSelect: "enableFileSelect", messageToolbarActions: "messageToolbarActions", inputValue: "inputValue", authorMessageSettings: "authorMessageSettings", receiverMessageSettings: "receiverMessageSettings", messageContextMenuActions: "messageContextMenuActions", fileActions: "fileActions", messageFilesLayout: "messageFilesLayout", suggestionsLayout: "suggestionsLayout", quickActionsLayout: "quickActionsLayout", suggestions: "suggestions", sendButtonSettings: "sendButtonSettings", modelFields: "modelFields" }, outputs: { sendMessage: "sendMessage", toolbarActionClick: "toolbarActionClick", contextMenuActionClick: "contextMenuActionClick", fileActionClick: "fileActionClick", download: "download", executeAction: "executeAction", suggestionExecute: "suggestionExecute", fileSelect: "fileSelect", fileRemove: "fileRemove", unpin: "unpin", inputValueChange: "inputValueChange" }, host: { properties: { "class": "this.className", "attr.dir": "this.dirAttr" } }, providers: [
582
- LocalizationService,
583
- ChatService,
584
- SuggestionsScrollService,
585
- {
586
- provide: L10N_PREFIX,
587
- useValue: 'kendo.chat'
588
- }
589
- ], queries: [{ propertyName: "attachmentTemplate", first: true, predicate: AttachmentTemplateDirective, descendants: true }, { propertyName: "chatHeaderTemplate", first: true, predicate: ChatHeaderTemplateDirective, descendants: true }, { propertyName: "chatNoDataTemplate", first: true, predicate: NoDataTemplateDirective, descendants: true }, { propertyName: "authorMessageContentTemplate", first: true, predicate: AuthorMessageContentTemplateDirective, descendants: true }, { propertyName: "receiverMessageContentTemplate", first: true, predicate: ReceiverMessageContentTemplateDirective, descendants: true }, { propertyName: "messageContentTemplate", first: true, predicate: MessageContentTemplateDirective, descendants: true }, { propertyName: "authorMessageTemplate", first: true, predicate: AuthorMessageTemplateDirective, descendants: true }, { propertyName: "receiverMessageTemplate", first: true, predicate: ReceiverMessageTemplateDirective, descendants: true }, { propertyName: "messageTemplate", first: true, predicate: MessageTemplateDirective, descendants: true }, { propertyName: "timestampTemplate", first: true, predicate: ChatTimestampTemplateDirective, descendants: true }, { propertyName: "suggestionTemplate", first: true, predicate: ChatSuggestionTemplateDirective, descendants: true }, { propertyName: "statusTemplate", first: true, predicate: ChatStatusTemplateDirective, descendants: true }, { propertyName: "messageBoxTemplate", first: true, predicate: ChatMessageBoxTemplateDirective, descendants: true }, { propertyName: "userStatusTemplate", first: true, predicate: ChatUserStatusTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "messagesContextMenu", first: true, predicate: ["messagesContextMenu"], descendants: true }, { propertyName: "messageBox", first: true, predicate: ["messageBox"], descendants: true }, { propertyName: "messageList", first: true, predicate: ["messageList"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: `
590
- <ng-container kendoChatLocalizedMessages
591
- i18n-deletedMessageSenderText="kendo.chat.deletedMessageSenderText|The text that is displayed when the sender deletes a message"
592
- deletedMessageSenderText="You removed this message."
593
-
594
- i18n-deletedMessageReceiverText="kendo.chat.deletedMessageReceiverText|The text that is displayed when the receiver deletes a message"
595
- deletedMessageReceiverText="This message was removed by its sender."
596
-
597
- i18n-messagePlaceholder="kendo.chat.messagePlaceholder|The placholder text of the message text input"
598
- messagePlaceholder="Type a message..."
599
-
600
- i18n-send="kendo.chat.send|The text for the Send button"
601
- send="Send..."
602
-
603
- i18n-messageListLabel="kendo.chat.messageListLabel|The label text for the Message list"
604
- messageListLabel="Message list"
605
-
606
- i18n-messageBoxInputLabel="kendo.chat.messageBoxInputLabel|The label text for the Message input box"
607
- messageBoxInputLabel="Message"
608
-
609
- i18n-messageAttachmentLeftArrow="kendo.chat.messageAttachmentLeftArrow|The text for the left arrow of the message attachments"
610
- messageAttachmentLeftArrow="Previous item"
611
-
612
- i18n-messageAttachmentRightArrow="kendo.chat.messageAttachmentRightArrow|The text for the right arrow of the message attachments"
613
- messageAttachmentRightArrow="Next item"
614
-
615
- i18n-speechToTextButtonTitle="kendo.chat.speechToTextButtonTitle|Sets the Speech to Text button title."
616
- speechToTextButtonTitle="Speech to Text"
617
-
618
- i18n-fileSelectButtonTitle="kendo.chat.fileSelectButtonTitle|Sets the File Select button title."
619
- fileSelectButtonTitle="Select files"
620
-
621
- i18n-removeReplyTitle="kendo.chat.removeReplyTitle|Sets the title of the icon which removes the reply reference in the Message Box."
622
- removeReplyTitle="Remove reply"
623
-
624
- i18n-removeFileTitle="kendo.chat.removeFileTitle|Sets the title of the icon which removes a selected file in the Message Box."
625
- removeFileTitle="Remove file"
626
-
627
- i18n-expandTitle="kendo.chat.expandTitle|Sets the title of the icon which demonstrates that the message can be expanded."
628
- expandTitle="Expand message"
629
-
630
- i18n-collapseTitle="kendo.chat.collapseTitle|Sets the title of the icon which demonstrates that the message can be collapsed."
631
- collapseTitle="Collapse message"
632
-
633
- i18n-fileActionsTitle="kendo.chat.fileActionsTitle|Sets the title of the DropDownButton which opens the File actions."
634
- fileActionsTitle="File actions"
635
-
636
- i18n-downloadAllFilesText="kendo.chat.downloadAllFilesText|Sets the text that is displayed in the download section of the message."
637
- downloadAllFilesText="Download all"
638
-
639
- i18n-previousSuggestionsButtonTitle="kendo.chat.previousSuggestionsButtonTitle|The title of the button that scrolls to the previous suggestions"
640
- previousSuggestionsButtonTitle="Scroll left"
641
-
642
- i18n-nextSuggestionsButtonTitle="kendo.chat.nextSuggestionsButtonTitle|The title of the button that scrolls to the next suggestions"
643
- nextSuggestionsButtonTitle="Scroll right"
644
- >
645
- </ng-container>
646
-
647
- @if (chatHeaderTemplate) {
648
- <kendo-appbar class="k-chat-header" positionMode="sticky" themeColor="inherit">
649
- <ng-container *ngTemplateOutlet="chatHeaderTemplate.templateRef"></ng-container>
650
- </kendo-appbar>
651
- }
652
- @if (pinnedMessage) {
653
- <div class="k-message-reference k-message-reference-receiver k-message-pinned" (click)="scrollToPinnedMessage()">
654
- <kendo-icon-wrapper
655
- size="xlarge"
656
- name="pin"
657
- [svgIcon]="pinIcon"
658
- >
659
- </kendo-icon-wrapper>
660
- <chat-message-reference-content [message]="pinnedMessage"></chat-message-reference-content>
661
- <span class="k-spacer"></span>
662
- <button kendoButton [svgIcon]="deleteIcon" (click)="unpin.emit(pinnedMessage)" fillMode="flat"></button>
663
- </div>
664
- }
665
- <div
666
- #messageList
667
- class="k-message-list"
668
- aria-live="polite"
669
- role="log"
670
- kendoChatScrollAnchor
671
- [attr.aria-label]="textFor('messageListLabel')"
672
- #anchor="scrollAnchor"
673
- [(autoScroll)]="autoScroll"
674
- >
675
- @if (processedMessages && processedMessages.length === 0) {
676
- <div class="k-message-list-content k-message-list-content-empty">
677
- <ng-template
678
- [ngTemplateOutlet]="chatNoDataTemplate?.templateRef">
679
- </ng-template>
680
- </div>
681
- } @else {
682
- <kendo-chat-message-list
683
- [messages]="processedMessages"
684
- [authorMessageContentTemplate]="authorMessageContentTemplate"
685
- [receiverMessageContentTemplate]="receiverMessageContentTemplate"
686
- [messageContentTemplate]="messageContentTemplate"
687
- [authorMessageTemplate]="authorMessageTemplate"
688
- [receiverMessageTemplate]="receiverMessageTemplate"
689
- [messageTemplate]="messageTemplate"
690
- [timestampTemplate]="timestampTemplate"
691
- [statusTemplate]="statusTemplate"
692
- [userStatusTemplate]="userStatusTemplate"
693
- [localization]="localizationText"
694
- [attachmentTemplate]="attachmentTemplate"
695
- [authorId]="authorId"
696
- (executeAction)="dispatchAction($event)"
697
- (resize)="anchor.scrollToBottom()"
698
- (navigate)="this.autoScroll = false"
699
- >
700
- </kendo-chat-message-list>
701
- }
702
- </div>
703
- <kendo-message-box
704
- #messageBox
705
- [messageBoxTemplate]="messageBoxTemplate"
706
- [suggestionTemplate]="suggestionTemplate"
707
- [suggestions]="suggestions"
708
- [placeholder]="placeholder"
709
- [authorId]="authorId"
710
- [autoScroll]="autoScroll"
711
- [inputValue]="inputValue"
712
- [localization]="localizationText"
713
- (sendMessage)="sendMessage.emit($event)"
714
- (executeSuggestion)="suggestionExecute.emit($event)"
715
- (fileSelect)="fileSelect.emit($event)"
716
- (fileRemove)="fileRemove.emit($event)"
717
- >
718
- </kendo-message-box>
719
-
720
- <kendo-contextmenu
721
- #messagesContextMenu
722
- [items]="contextMenuActions"
723
- [popupAlign]="{ horizontal: 'right', vertical: 'top' }"
724
- [collision]="{ horizontal: 'flip', vertical: 'flip'}"
725
- (popupClose)="handleMenuClose($event)"
726
- (select)="onContextMenuAction($event.item.originalAction)"
727
- ></kendo-contextmenu>
728
- `, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "[kendoChatLocalizedMessages]" }, { kind: "directive", type: ScrollAnchorDirective, selector: "[kendoChatScrollAnchor]", inputs: ["autoScroll"], outputs: ["autoScrollChange"], exportAs: ["scrollAnchor"] }, { kind: "component", type: MessageListComponent, selector: "kendo-chat-message-list", inputs: ["messages", "attachmentTemplate", "authorMessageContentTemplate", "receiverMessageContentTemplate", "messageContentTemplate", "authorMessageTemplate", "receiverMessageTemplate", "messageTemplate", "timestampTemplate", "statusTemplate", "userStatusTemplate", "localization", "authorId"], outputs: ["executeAction", "navigate", "resize"] }, { kind: "component", type: MessageBoxComponent, selector: "kendo-message-box", inputs: ["authorId", "autoScroll", "suggestions", "placeholder", "inputValue", "localization", "messageBoxTemplate", "suggestionTemplate"], outputs: ["sendMessage", "executeSuggestion", "fileSelect", "fileRemove"] }, { kind: "component", type: MessageReferenceComponent, selector: "chat-message-reference-content", inputs: ["message"] }, { kind: "component", type: AppBarComponent, selector: "kendo-appbar", inputs: ["position", "positionMode", "themeColor"], exportAs: ["kendoAppBar"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "component", type: i3.ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "component", type: ContextMenuComponent, selector: "kendo-contextmenu", inputs: ["showOn", "target", "filter", "alignToAnchor", "vertical", "popupAnimate", "popupAlign", "anchorAlign", "collision", "appendTo", "ariaLabel"], outputs: ["popupOpen", "popupClose", "select", "open", "close"], exportAs: ["kendoContextMenu"] }] });
729
- }
730
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ChatComponent, decorators: [{
731
- type: Component,
732
- args: [{
733
- providers: [
734
- LocalizationService,
735
- ChatService,
736
- SuggestionsScrollService,
737
- {
738
- provide: L10N_PREFIX,
739
- useValue: 'kendo.chat'
740
- }
741
- ],
742
- selector: 'kendo-chat',
743
- template: `
744
- <ng-container kendoChatLocalizedMessages
745
- i18n-deletedMessageSenderText="kendo.chat.deletedMessageSenderText|The text that is displayed when the sender deletes a message"
746
- deletedMessageSenderText="You removed this message."
747
-
748
- i18n-deletedMessageReceiverText="kendo.chat.deletedMessageReceiverText|The text that is displayed when the receiver deletes a message"
749
- deletedMessageReceiverText="This message was removed by its sender."
750
-
751
- i18n-messagePlaceholder="kendo.chat.messagePlaceholder|The placholder text of the message text input"
752
- messagePlaceholder="Type a message..."
753
-
754
- i18n-send="kendo.chat.send|The text for the Send button"
755
- send="Send..."
756
-
757
- i18n-messageListLabel="kendo.chat.messageListLabel|The label text for the Message list"
758
- messageListLabel="Message list"
759
-
760
- i18n-messageBoxInputLabel="kendo.chat.messageBoxInputLabel|The label text for the Message input box"
761
- messageBoxInputLabel="Message"
762
-
763
- i18n-messageAttachmentLeftArrow="kendo.chat.messageAttachmentLeftArrow|The text for the left arrow of the message attachments"
764
- messageAttachmentLeftArrow="Previous item"
765
-
766
- i18n-messageAttachmentRightArrow="kendo.chat.messageAttachmentRightArrow|The text for the right arrow of the message attachments"
767
- messageAttachmentRightArrow="Next item"
768
-
769
- i18n-speechToTextButtonTitle="kendo.chat.speechToTextButtonTitle|Sets the Speech to Text button title."
770
- speechToTextButtonTitle="Speech to Text"
771
-
772
- i18n-fileSelectButtonTitle="kendo.chat.fileSelectButtonTitle|Sets the File Select button title."
773
- fileSelectButtonTitle="Select files"
774
-
775
- i18n-removeReplyTitle="kendo.chat.removeReplyTitle|Sets the title of the icon which removes the reply reference in the Message Box."
776
- removeReplyTitle="Remove reply"
777
-
778
- i18n-removeFileTitle="kendo.chat.removeFileTitle|Sets the title of the icon which removes a selected file in the Message Box."
779
- removeFileTitle="Remove file"
780
-
781
- i18n-expandTitle="kendo.chat.expandTitle|Sets the title of the icon which demonstrates that the message can be expanded."
782
- expandTitle="Expand message"
783
-
784
- i18n-collapseTitle="kendo.chat.collapseTitle|Sets the title of the icon which demonstrates that the message can be collapsed."
785
- collapseTitle="Collapse message"
786
-
787
- i18n-fileActionsTitle="kendo.chat.fileActionsTitle|Sets the title of the DropDownButton which opens the File actions."
788
- fileActionsTitle="File actions"
789
-
790
- i18n-downloadAllFilesText="kendo.chat.downloadAllFilesText|Sets the text that is displayed in the download section of the message."
791
- downloadAllFilesText="Download all"
792
-
793
- i18n-previousSuggestionsButtonTitle="kendo.chat.previousSuggestionsButtonTitle|The title of the button that scrolls to the previous suggestions"
794
- previousSuggestionsButtonTitle="Scroll left"
795
-
796
- i18n-nextSuggestionsButtonTitle="kendo.chat.nextSuggestionsButtonTitle|The title of the button that scrolls to the next suggestions"
797
- nextSuggestionsButtonTitle="Scroll right"
798
- >
799
- </ng-container>
800
-
801
- @if (chatHeaderTemplate) {
802
- <kendo-appbar class="k-chat-header" positionMode="sticky" themeColor="inherit">
803
- <ng-container *ngTemplateOutlet="chatHeaderTemplate.templateRef"></ng-container>
804
- </kendo-appbar>
805
- }
806
- @if (pinnedMessage) {
807
- <div class="k-message-reference k-message-reference-receiver k-message-pinned" (click)="scrollToPinnedMessage()">
808
- <kendo-icon-wrapper
809
- size="xlarge"
810
- name="pin"
811
- [svgIcon]="pinIcon"
812
- >
813
- </kendo-icon-wrapper>
814
- <chat-message-reference-content [message]="pinnedMessage"></chat-message-reference-content>
815
- <span class="k-spacer"></span>
816
- <button kendoButton [svgIcon]="deleteIcon" (click)="unpin.emit(pinnedMessage)" fillMode="flat"></button>
817
- </div>
818
- }
819
- <div
820
- #messageList
821
- class="k-message-list"
822
- aria-live="polite"
823
- role="log"
824
- kendoChatScrollAnchor
825
- [attr.aria-label]="textFor('messageListLabel')"
826
- #anchor="scrollAnchor"
827
- [(autoScroll)]="autoScroll"
828
- >
829
- @if (processedMessages && processedMessages.length === 0) {
830
- <div class="k-message-list-content k-message-list-content-empty">
831
- <ng-template
832
- [ngTemplateOutlet]="chatNoDataTemplate?.templateRef">
833
- </ng-template>
834
- </div>
835
- } @else {
836
- <kendo-chat-message-list
837
- [messages]="processedMessages"
838
- [authorMessageContentTemplate]="authorMessageContentTemplate"
839
- [receiverMessageContentTemplate]="receiverMessageContentTemplate"
840
- [messageContentTemplate]="messageContentTemplate"
841
- [authorMessageTemplate]="authorMessageTemplate"
842
- [receiverMessageTemplate]="receiverMessageTemplate"
843
- [messageTemplate]="messageTemplate"
844
- [timestampTemplate]="timestampTemplate"
845
- [statusTemplate]="statusTemplate"
846
- [userStatusTemplate]="userStatusTemplate"
847
- [localization]="localizationText"
848
- [attachmentTemplate]="attachmentTemplate"
849
- [authorId]="authorId"
850
- (executeAction)="dispatchAction($event)"
851
- (resize)="anchor.scrollToBottom()"
852
- (navigate)="this.autoScroll = false"
853
- >
854
- </kendo-chat-message-list>
855
- }
856
- </div>
857
- <kendo-message-box
858
- #messageBox
859
- [messageBoxTemplate]="messageBoxTemplate"
860
- [suggestionTemplate]="suggestionTemplate"
861
- [suggestions]="suggestions"
862
- [placeholder]="placeholder"
863
- [authorId]="authorId"
864
- [autoScroll]="autoScroll"
865
- [inputValue]="inputValue"
866
- [localization]="localizationText"
867
- (sendMessage)="sendMessage.emit($event)"
868
- (executeSuggestion)="suggestionExecute.emit($event)"
869
- (fileSelect)="fileSelect.emit($event)"
870
- (fileRemove)="fileRemove.emit($event)"
871
- >
872
- </kendo-message-box>
873
-
874
- <kendo-contextmenu
875
- #messagesContextMenu
876
- [items]="contextMenuActions"
877
- [popupAlign]="{ horizontal: 'right', vertical: 'top' }"
878
- [collision]="{ horizontal: 'flip', vertical: 'flip'}"
879
- (popupClose)="handleMenuClose($event)"
880
- (select)="onContextMenuAction($event.item.originalAction)"
881
- ></kendo-contextmenu>
882
- `,
883
- standalone: true,
884
- imports: [LocalizedMessagesDirective, ScrollAnchorDirective, MessageListComponent, MessageBoxComponent, MessageReferenceComponent, AppBarComponent, NgTemplateOutlet, IconWrapperComponent, KENDO_BUTTON, ContextMenuComponent]
885
- }]
886
- }], ctorParameters: () => [{ type: i1.LocalizationService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i2.ChatService }], propDecorators: { messages: [{
887
- type: Input
888
- }], authorId: [{
889
- type: Input
890
- }], messageBoxType: [{
891
- type: Input
892
- }], height: [{
893
- type: Input
894
- }], width: [{
895
- type: Input
896
- }], placeholder: [{
897
- type: Input
898
- }], messageWidthMode: [{
899
- type: Input
900
- }], timestampVisibility: [{
901
- type: Input
902
- }], showUsername: [{
903
- type: Input
904
- }], showAvatar: [{
905
- type: Input
906
- }], allowMessageCollapse: [{
907
- type: Input
908
- }], enableSpeechToText: [{
909
- type: Input
910
- }], enableFileSelect: [{
911
- type: Input
912
- }], messageToolbarActions: [{
913
- type: Input
914
- }], inputValue: [{
915
- type: Input
916
- }], authorMessageSettings: [{
917
- type: Input
918
- }], receiverMessageSettings: [{
919
- type: Input
920
- }], messageContextMenuActions: [{
921
- type: Input
922
- }], fileActions: [{
923
- type: Input
924
- }], messageFilesLayout: [{
925
- type: Input
926
- }], suggestionsLayout: [{
927
- type: Input
928
- }], quickActionsLayout: [{
929
- type: Input
930
- }], suggestions: [{
931
- type: Input
932
- }], sendButtonSettings: [{
933
- type: Input
934
- }], modelFields: [{
935
- type: Input
936
- }], sendMessage: [{
937
- type: Output
938
- }], toolbarActionClick: [{
939
- type: Output
940
- }], contextMenuActionClick: [{
941
- type: Output
942
- }], fileActionClick: [{
943
- type: Output
944
- }], download: [{
945
- type: Output
946
- }], executeAction: [{
947
- type: Output
948
- }], suggestionExecute: [{
949
- type: Output
950
- }], fileSelect: [{
951
- type: Output
952
- }], fileRemove: [{
953
- type: Output
954
- }], unpin: [{
955
- type: Output
956
- }], inputValueChange: [{
957
- type: Output
958
- }], className: [{
959
- type: HostBinding,
960
- args: ['class']
961
- }], dirAttr: [{
962
- type: HostBinding,
963
- args: ['attr.dir']
964
- }], messagesContextMenu: [{
965
- type: ViewChild,
966
- args: ['messagesContextMenu']
967
- }], attachmentTemplate: [{
968
- type: ContentChild,
969
- args: [AttachmentTemplateDirective]
970
- }], chatHeaderTemplate: [{
971
- type: ContentChild,
972
- args: [ChatHeaderTemplateDirective]
973
- }], chatNoDataTemplate: [{
974
- type: ContentChild,
975
- args: [NoDataTemplateDirective]
976
- }], authorMessageContentTemplate: [{
977
- type: ContentChild,
978
- args: [AuthorMessageContentTemplateDirective]
979
- }], receiverMessageContentTemplate: [{
980
- type: ContentChild,
981
- args: [ReceiverMessageContentTemplateDirective]
982
- }], messageContentTemplate: [{
983
- type: ContentChild,
984
- args: [MessageContentTemplateDirective]
985
- }], authorMessageTemplate: [{
986
- type: ContentChild,
987
- args: [AuthorMessageTemplateDirective]
988
- }], receiverMessageTemplate: [{
989
- type: ContentChild,
990
- args: [ReceiverMessageTemplateDirective]
991
- }], messageTemplate: [{
992
- type: ContentChild,
993
- args: [MessageTemplateDirective]
994
- }], timestampTemplate: [{
995
- type: ContentChild,
996
- args: [ChatTimestampTemplateDirective]
997
- }], suggestionTemplate: [{
998
- type: ContentChild,
999
- args: [ChatSuggestionTemplateDirective]
1000
- }], statusTemplate: [{
1001
- type: ContentChild,
1002
- args: [ChatStatusTemplateDirective]
1003
- }], messageBoxTemplate: [{
1004
- type: ContentChild,
1005
- args: [ChatMessageBoxTemplateDirective]
1006
- }], userStatusTemplate: [{
1007
- type: ContentChild,
1008
- args: [ChatUserStatusTemplateDirective]
1009
- }], messageBox: [{
1010
- type: ViewChild,
1011
- args: ['messageBox']
1012
- }], messageList: [{
1013
- type: ViewChild,
1014
- args: ['messageList', { static: true, read: ViewContainerRef }]
1015
- }] } });