@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,740 +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 { ChangeDetectorRef, Component, ElementRef, forwardRef, HostBinding, HostListener, Input } from '@angular/core';
6
- import { ChatItem } from './chat-item';
7
- import { MessageContentTemplateDirective } from './templates/message-content-template.directive';
8
- import { IntlService } from '@progress/kendo-angular-intl';
9
- import { KENDO_BUTTONS } from '@progress/kendo-angular-buttons';
10
- import { NgClass, NgTemplateOutlet } from '@angular/common';
11
- import { IconWrapperComponent } from '@progress/kendo-angular-icons';
12
- import { ToolBarButtonComponent, ToolBarComponent } from '@progress/kendo-angular-toolbar';
13
- import { chevronDownIcon, chevronUpIcon, downloadIcon } from '@progress/kendo-svg-icons';
14
- import { ChatService } from './common/chat.service';
15
- import { LocalizationService } from '@progress/kendo-angular-l10n';
16
- import { URL_REGEX, FILE_ACTION_BTN_SELECTOR, DOWNLOAD_ALL_SELECTOR, MENU_ITEM_SELECTOR, transformActions } from './common/utils';
17
- import { isAuthor } from './chat-view';
18
- import { ChatFileComponent } from './chat-file.component';
19
- import { MessageReferenceComponent } from './message-reference-content.component';
20
- import { ChatStatusTemplateDirective } from './templates/status-template.directive';
21
- import { isPresent, Keys, normalizeKeys } from '@progress/kendo-angular-common';
22
- import { MessageTemplateDirective } from './templates/message-template.directive';
23
- import { AuthorMessageContentTemplateDirective } from './templates/author-message-content-template.directive';
24
- import { ReceiverMessageContentTemplateDirective } from './templates/receiver-message-content-template.directive';
25
- import { ReceiverMessageTemplateDirective } from './templates/receiver-message-template.directive';
26
- import { AuthorMessageTemplateDirective } from './templates/author-message-template.directive';
27
- import { Subscription } from 'rxjs';
28
- import * as i0 from "@angular/core";
29
- import * as i1 from "@progress/kendo-angular-intl";
30
- import * as i2 from "./common/chat.service";
31
- import * as i3 from "@progress/kendo-angular-l10n";
32
- import * as i4 from "@progress/kendo-angular-buttons";
33
- // eslint-disable no-forward-ref
34
- /**
35
- * @hidden
36
- */
37
- export class MessageComponent extends ChatItem {
38
- element;
39
- intl;
40
- chatService;
41
- localization;
42
- cdr;
43
- set message(value) {
44
- this._message = value;
45
- }
46
- get message() {
47
- return this._message;
48
- }
49
- tabbable;
50
- authorMessageContentTemplate;
51
- receiverMessageContentTemplate;
52
- messageContentTemplate;
53
- authorMessageTemplate;
54
- receiverMessageTemplate;
55
- messageTemplate;
56
- statusTemplate;
57
- showMessageTime = true;
58
- authorId;
59
- cssClass = true;
60
- get removedClass() {
61
- return this.message.isDeleted;
62
- }
63
- onKeyDown(event) {
64
- if (this.message.isDeleted) {
65
- return;
66
- }
67
- if (!this.chatService.allowMessageCollapse) {
68
- return;
69
- }
70
- this.onExpandableKeydown(event);
71
- }
72
- selected;
73
- get tabIndex() {
74
- return this.tabbable ? '0' : '-1';
75
- }
76
- expandIcon = chevronDownIcon;
77
- collapseIcon = chevronUpIcon;
78
- downloadIcon = downloadIcon;
79
- isMessageExpanded = false;
80
- showExpandCollapseIcon = false;
81
- fileActions = [];
82
- toolbarActions = [];
83
- parts = [];
84
- get useCustomBubbleTemplate() {
85
- return !!(this.getActiveBubbleTemplate());
86
- }
87
- get useCustomContentTemplate() {
88
- return !!(this.getActiveContentTemplate());
89
- }
90
- get hasMessageContent() {
91
- return !!(this.message?.text || this.message?.files?.length > 0);
92
- }
93
- get hasFiles() {
94
- return this.message?.files?.length > 0;
95
- }
96
- get hasMultipleFiles() {
97
- return this.message?.files?.length > 1;
98
- }
99
- get isActiveMessage() {
100
- return this.chatService.active && this.message?.id === this.chatService.activeMessage?.id;
101
- }
102
- get isMessageExpandable() {
103
- const isOwn = this.isOwnMessage(this.message);
104
- const messageSettings = isOwn
105
- ? this.chatService.authorMessageSettings
106
- : this.chatService.receiverMessageSettings;
107
- if (isPresent(messageSettings?.allowMessageCollapse)) {
108
- return messageSettings.allowMessageCollapse;
109
- }
110
- return this.chatService.allowMessageCollapse || false;
111
- }
112
- get showToolbar() {
113
- if (this.message?.isDeleted) {
114
- return false;
115
- }
116
- const hasComponentActions = this.chatService.messageToolbarActions?.length > 0;
117
- const hasMessageActions = this.toolbarActions?.length > 0;
118
- return hasComponentActions || hasMessageActions;
119
- }
120
- subs = new Subscription();
121
- _message;
122
- constructor(element, intl, chatService, localization, cdr) {
123
- super();
124
- this.element = element;
125
- this.intl = intl;
126
- this.chatService = chatService;
127
- this.localization = localization;
128
- this.cdr = cdr;
129
- }
130
- ngOnInit() {
131
- this.fileActions = this.getFileActions();
132
- this.toolbarActions = this.getToolbarActions();
133
- const settingsChange$ = this.isOwnMessage(this.message)
134
- ? this.chatService.authorMessageSettingsChange$
135
- : this.chatService.receiverMessageSettingsChange$;
136
- this.subs.add(settingsChange$.subscribe(() => {
137
- this.fileActions = this.getFileActions();
138
- this.toolbarActions = this.getToolbarActions();
139
- setTimeout(() => {
140
- this.showExpandCollapseIcon = this.calculateExpandCollapseIconVisibility();
141
- });
142
- }));
143
- this.subs.add(this.chatService.allowMessageCollapseChange$.subscribe(() => {
144
- setTimeout(() => {
145
- this.showExpandCollapseIcon = this.calculateExpandCollapseIconVisibility();
146
- });
147
- }));
148
- if (this.message.id) {
149
- this.chatService.registerMessageElement(this.message.id, this.element);
150
- }
151
- this.parts = this.getFormattedTextParts(this.message.text);
152
- }
153
- ngAfterViewInit() {
154
- this.showExpandCollapseIcon = this.calculateExpandCollapseIconVisibility();
155
- this.cdr.detectChanges();
156
- }
157
- ngOnDestroy() {
158
- if (this.message.id) {
159
- this.chatService.unregisterMessageElement(this.message.id);
160
- }
161
- this.subs.unsubscribe();
162
- }
163
- calculateExpandCollapseIconVisibility() {
164
- if (this.isMessageExpanded) {
165
- return true;
166
- }
167
- const bubbleContent = this.element.nativeElement.querySelector('.k-bubble-content');
168
- if (!bubbleContent) {
169
- return false;
170
- }
171
- const hasVerticalOverflow = bubbleContent.scrollHeight > bubbleContent.clientHeight;
172
- const hasHorizontalOverflow = bubbleContent.scrollWidth > bubbleContent.clientWidth;
173
- if (this.useCustomContentTemplate) {
174
- return hasVerticalOverflow || hasHorizontalOverflow;
175
- }
176
- const messageText = this.element.nativeElement.querySelector('.k-chat-bubble-text');
177
- const hasTextOverflow = messageText?.scrollWidth > messageText?.clientWidth;
178
- return hasTextOverflow || hasVerticalOverflow || hasHorizontalOverflow;
179
- }
180
- getActiveBubbleTemplate() {
181
- const isOwn = this.isOwnMessage(this.message);
182
- if (isOwn && this.authorMessageTemplate) {
183
- return this.authorMessageTemplate;
184
- }
185
- if (!isOwn && this.receiverMessageTemplate) {
186
- return this.receiverMessageTemplate;
187
- }
188
- if (this.messageTemplate) {
189
- return this.messageTemplate;
190
- }
191
- return null;
192
- }
193
- getActiveContentTemplate() {
194
- const isOwn = this.isOwnMessage(this.message);
195
- if (isOwn && this.authorMessageContentTemplate) {
196
- return this.authorMessageContentTemplate;
197
- }
198
- if (!isOwn && this.receiverMessageContentTemplate) {
199
- return this.receiverMessageContentTemplate;
200
- }
201
- if (this.messageContentTemplate) {
202
- return this.messageContentTemplate;
203
- }
204
- return null;
205
- }
206
- getDeletedMessageText() {
207
- const isOwn = this.isOwnMessage(this.message);
208
- return isOwn ? this.textFor('deletedMessageSenderText') : this.textFor('deletedMessageReceiverText');
209
- }
210
- textFor(key) {
211
- return this.localization.get(key);
212
- }
213
- formatTimeStamp(date) {
214
- return this.intl.formatDate(date, { datetime: 'short' });
215
- }
216
- focus() {
217
- this.element.nativeElement.focus();
218
- }
219
- onDownloadAll() {
220
- this.chatService.emit('fileDownload', { files: this.message.files, message: this.message });
221
- }
222
- toggleMessageState(event) {
223
- event.stopImmediatePropagation();
224
- this.isMessageExpanded = !this.isMessageExpanded;
225
- this.chatService.toggleMessageState = false;
226
- }
227
- onExpandableKeydown(event) {
228
- const key = normalizeKeys(event);
229
- const isFileActionButton = event.target.closest(FILE_ACTION_BTN_SELECTOR) || event.target.closest(DOWNLOAD_ALL_SELECTOR);
230
- if (!isFileActionButton && (key === Keys.Enter || key === Keys.Space)) {
231
- event.preventDefault();
232
- this.chatService.toggleMessageState = true;
233
- this.toggleMessageState(event);
234
- }
235
- }
236
- onToolbarAction(event, action, message) {
237
- event.stopImmediatePropagation();
238
- this.chatService.emit('toolbarAction', { action, message });
239
- }
240
- onFileAction(action, file) {
241
- if (action.originalAction.id === 'download') {
242
- this.chatService.emit('fileDownload', { files: [file], message: this.message });
243
- }
244
- this.chatService.emit('fileAction', { action: action.originalAction, file });
245
- }
246
- getMessageById(id) {
247
- return this.chatService.getMessageById(id);
248
- }
249
- onReplyReferenceClick(event, replyToId) {
250
- event.stopPropagation();
251
- this.chatService.emit('replyReferenceClick', replyToId);
252
- }
253
- handleMenuClose(event) {
254
- if (event) {
255
- const originalEvent = event.originalEvent;
256
- if (originalEvent) {
257
- this.onActionButtonClick(originalEvent);
258
- }
259
- }
260
- this.chatService.active = false;
261
- this.chatService.emit('contextMenuVisibilityChange', false);
262
- if (this.chatService.selectOnMenuClose) {
263
- this.selected = true;
264
- this.focus();
265
- }
266
- }
267
- onActionButtonClick(event) {
268
- const clickOutsideMessage = event instanceof MouseEvent && !event.target?.closest('.k-chat-bubble');
269
- const menuItemClick = event instanceof MouseEvent && event.target?.closest(MENU_ITEM_SELECTOR);
270
- if (clickOutsideMessage && !menuItemClick) {
271
- this.chatService.selectOnMenuClose = false;
272
- }
273
- }
274
- handleMenuOpen() {
275
- this.chatService.selectOnMenuClose = this.selected;
276
- this.chatService.emit('contextMenuVisibilityChange', true);
277
- }
278
- onActionPopupChange(expanded) {
279
- if (expanded) {
280
- this.chatService.active = true;
281
- this.handleMenuOpen();
282
- }
283
- else {
284
- this.handleMenuClose();
285
- }
286
- }
287
- isOwnMessage(msg) {
288
- return isAuthor(this.authorId, msg);
289
- }
290
- getFormattedTextParts(text) {
291
- if (!text) {
292
- return [];
293
- }
294
- const parts = [];
295
- const urlMatches = Array.from(text.matchAll(URL_REGEX));
296
- let lastIndex = 0;
297
- for (const match of urlMatches) {
298
- const url = match[1];
299
- const matchStart = match.index;
300
- if (!isPresent(matchStart)) {
301
- continue;
302
- }
303
- if (matchStart > lastIndex) {
304
- parts.push({ type: 'text', content: text.substring(lastIndex, matchStart) });
305
- }
306
- parts.push({ type: 'link', content: url, href: url });
307
- lastIndex = matchStart + match[0].length;
308
- }
309
- if (lastIndex < text.length) {
310
- parts.push({ type: 'text', content: text.substring(lastIndex) });
311
- }
312
- return parts;
313
- }
314
- getMessageSettings() {
315
- return this.isOwnMessage(this.message)
316
- ? this.chatService.authorMessageSettings
317
- : this.chatService.receiverMessageSettings;
318
- }
319
- getToolbarActions() {
320
- const messageSettings = this.getMessageSettings();
321
- return messageSettings?.messageToolbarActions?.length
322
- ? messageSettings.messageToolbarActions
323
- : this.chatService.messageToolbarActions || [];
324
- }
325
- getFileActions() {
326
- const messageSettings = this.getMessageSettings();
327
- const actions = messageSettings?.fileActions?.length
328
- ? messageSettings.fileActions
329
- : this.chatService.fileActions || [];
330
- return transformActions(actions);
331
- }
332
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MessageComponent, deps: [{ token: i0.ElementRef }, { token: i1.IntlService }, { token: i2.ChatService }, { token: i3.LocalizationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
333
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: MessageComponent, isStandalone: true, selector: "kendo-chat-message", inputs: { message: "message", tabbable: "tabbable", authorMessageContentTemplate: "authorMessageContentTemplate", receiverMessageContentTemplate: "receiverMessageContentTemplate", messageContentTemplate: "messageContentTemplate", authorMessageTemplate: "authorMessageTemplate", receiverMessageTemplate: "receiverMessageTemplate", messageTemplate: "messageTemplate", statusTemplate: "statusTemplate", showMessageTime: "showMessageTime", authorId: "authorId" }, host: { listeners: { "keydown": "onKeyDown($event)" }, properties: { "class.k-message": "this.cssClass", "class.k-message-removed": "this.removedClass", "attr.tabIndex": "this.tabIndex" } }, providers: [
334
- {
335
- provide: ChatItem,
336
- useExisting: forwardRef(() => MessageComponent)
337
- }
338
- ], usesInheritance: true, ngImport: i0, template: `
339
- @if (useCustomBubbleTemplate) {
340
- <ng-container *ngTemplateOutlet="getActiveBubbleTemplate()?.templateRef; context: { $implicit: message };"></ng-container>
341
- }
342
-
343
- @if (!useCustomBubbleTemplate) {
344
- @if (chatService.timestampVisibility === 'focus' && message.timestamp) {
345
- <time
346
- [attr.aria-hidden]="!selected"
347
- class="k-message-time"
348
- >
349
- {{ formatTimeStamp(message.timestamp) }}
350
- </time>
351
- }
352
- @if (message.typing) {
353
- <div class="k-chat-bubble k-bubble">
354
- <div class="k-typing-indicator" [attr.tabindex]="'-1'">
355
- <span></span>
356
- <span></span>
357
- <span></span>
358
- </div>
359
- </div>
360
- }
361
- @if (!message.typing) {
362
- @if (useCustomContentTemplate) {
363
- <div
364
- class="k-chat-bubble k-bubble"
365
- [attr.tabindex]="0"
366
- [ngClass]="{
367
- 'k-bubble-expandable': isMessageExpandable,
368
- 'k-expanded': isMessageExpanded,
369
- 'k-selected': selected,
370
- 'k-focus': selected,
371
- 'k-active': isActiveMessage
372
- }"
373
- >
374
- <div class="k-bubble-content">
375
- <ng-container *ngTemplateOutlet="getActiveContentTemplate()?.templateRef; context: { $implicit: message };"></ng-container>
376
- </div>
377
- @if (isMessageExpandable && showExpandCollapseIcon) {
378
- <span
379
- class="k-bubble-expandable-indicator"
380
- [attr.tabindex]="'0'"
381
- [attr.role]="'button'"
382
- [attr.title]="isMessageExpanded ? textFor('collapseTitle') : textFor('expandTitle')"
383
- (mousedown)="chatService.toggleMessageState = true"
384
- (click)="toggleMessageState($event)"
385
- >
386
- <kendo-icon-wrapper
387
- [name]="isMessageExpanded ? 'chevron-up' : 'chevron-down'"
388
- [svgIcon]="isMessageExpanded ? collapseIcon : expandIcon"
389
- >
390
- </kendo-icon-wrapper>
391
- </span>
392
- }
393
- </div>
394
- }
395
- @if (!useCustomContentTemplate && hasMessageContent) {
396
- <div
397
- class="k-chat-bubble k-bubble"
398
- [attr.tabindex]="0"
399
- [ngClass]="{
400
- 'k-bubble-expandable': isMessageExpandable,
401
- 'k-expanded': isMessageExpanded,
402
- 'k-selected': selected,
403
- 'k-focus': selected,
404
- 'k-active': isActiveMessage
405
- }"
406
- >
407
- <div class="k-bubble-content">
408
- @if (message.text || message.isDeleted) {
409
- @if (message.replyToId && !message.isDeleted) {
410
- <div
411
- class="k-message-reference k-message-reference-receiver"
412
- (click)="onReplyReferenceClick($event, message.replyToId)"
413
- >
414
- <chat-message-reference-content [message]="getMessageById(message.replyToId)"></chat-message-reference-content>
415
- </div>
416
- }
417
- @if (message.isDeleted) {
418
- <span class="k-chat-bubble-text">
419
- {{ getDeletedMessageText() }}
420
- </span>
421
- }
422
- @if (!message.isDeleted && parts.length > 0) {
423
- <span class="k-chat-bubble-text">
424
- @for (part of parts; track part) {
425
- @if (part.type === 'text') {{{part.content}}}
426
- @if (part.type === 'link') {<a [href]="part.href" target="_blank">{{part.content}}</a>}
427
- }
428
- </span>
429
- }
430
- }
431
- @if (hasFiles && !message.isDeleted) {
432
- <ul
433
- class="k-chat-file-wrapper"
434
- [ngClass]="{
435
- 'k-chat-files-wrap': chatService.messageFilesLayout === 'wrap',
436
- 'k-chat-files-horizontal': chatService.messageFilesLayout === 'horizontal'
437
- }"
438
- >
439
- @for (file of message.files; track file) {
440
- <li
441
- class="k-chat-file"
442
- [chatFile]="file"
443
- [fileActions]="fileActions"
444
- (actionClick)="onFileAction($event, file)"
445
- (actionsToggle)="onActionPopupChange($event)"
446
- (actionButtonClick)="onActionButtonClick($event)"
447
- ></li>
448
- }
449
- </ul>
450
- }
451
- @if (hasMultipleFiles && !message.isDeleted) {
452
- <div class="k-chat-download-button-wrapper">
453
- <button
454
- kendoButton
455
- class="k-chat-download-button"
456
- fillMode="flat"
457
- icon="download"
458
- [svgIcon]="downloadIcon"
459
- [attr.title]="textFor('downloadAllFilesText')"
460
- (click)="onDownloadAll()"
461
- >{{ textFor('downloadAllFilesText') }}</button>
462
- </div>
463
- }
464
- </div>
465
- @if (isMessageExpandable && showExpandCollapseIcon) {
466
- <span
467
- class="k-bubble-expandable-indicator"
468
- [attr.tabindex]="'0'"
469
- [attr.role]="'button'"
470
- [attr.title]="isMessageExpanded ? textFor('collapseTitle') : textFor('expandTitle')"
471
- (mousedown)="chatService.toggleMessageState = true"
472
- (click)="toggleMessageState($event)"
473
- >
474
- <kendo-icon-wrapper
475
- [name]="isMessageExpanded ? 'chevron-up' : 'chevron-down'"
476
- [svgIcon]="isMessageExpanded ? collapseIcon : expandIcon"
477
- >
478
- </kendo-icon-wrapper>
479
- </span>
480
- }
481
- </div>
482
- }
483
- }
484
- @if (message.status) {
485
- <span class="k-message-status">
486
- @if (statusTemplate?.templateRef) {
487
- <ng-template
488
- [ngTemplateOutlet]="statusTemplate.templateRef"
489
- [ngTemplateOutletContext]="{ $implicit: message.status, message }"
490
- >
491
- </ng-template>
492
- }
493
- @if (!statusTemplate?.templateRef) {
494
- {{ message.status }}
495
- }
496
- </span>
497
- }
498
- }
499
- @if (showToolbar) {
500
- <kendo-toolbar class="k-chat-message-toolbar" fillMode="flat">
501
- @for (action of toolbarActions; track action) {
502
- <kendo-toolbar-button
503
- fillMode="flat"
504
- [icon]="action.icon"
505
- [svgIcon]="action.svgIcon"
506
- [disabled]="action.disabled"
507
- [title]="action.label"
508
- (click)="onToolbarAction($event, action, message)"
509
- >
510
- </kendo-toolbar-button>
511
- }
512
- </kendo-toolbar>
513
- }
514
- `, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { 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: i4.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: ChatFileComponent, selector: "li[chatFile]", inputs: ["chatFile", "removable", "fileActions"], outputs: ["remove", "actionClick", "actionsToggle", "actionButtonClick"] }, { kind: "component", type: ToolBarComponent, selector: "kendo-toolbar", inputs: ["overflow", "resizable", "popupSettings", "fillMode", "tabindex", "size", "tabIndex", "showIcon", "showText"], outputs: ["open", "close"], exportAs: ["kendoToolBar"] }, { kind: "component", type: ToolBarButtonComponent, selector: "kendo-toolbar-button", inputs: ["showText", "showIcon", "text", "style", "className", "title", "disabled", "toggleable", "look", "togglable", "selected", "fillMode", "rounded", "themeColor", "icon", "iconClass", "svgIcon", "imageUrl"], outputs: ["click", "pointerdown", "selectedChange"], exportAs: ["kendoToolBarButton"] }, { kind: "component", type: MessageReferenceComponent, selector: "chat-message-reference-content", inputs: ["message"] }] });
515
- }
516
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MessageComponent, decorators: [{
517
- type: Component,
518
- args: [{
519
- selector: 'kendo-chat-message',
520
- providers: [
521
- {
522
- provide: ChatItem,
523
- useExisting: forwardRef(() => MessageComponent)
524
- }
525
- ],
526
- template: `
527
- @if (useCustomBubbleTemplate) {
528
- <ng-container *ngTemplateOutlet="getActiveBubbleTemplate()?.templateRef; context: { $implicit: message };"></ng-container>
529
- }
530
-
531
- @if (!useCustomBubbleTemplate) {
532
- @if (chatService.timestampVisibility === 'focus' && message.timestamp) {
533
- <time
534
- [attr.aria-hidden]="!selected"
535
- class="k-message-time"
536
- >
537
- {{ formatTimeStamp(message.timestamp) }}
538
- </time>
539
- }
540
- @if (message.typing) {
541
- <div class="k-chat-bubble k-bubble">
542
- <div class="k-typing-indicator" [attr.tabindex]="'-1'">
543
- <span></span>
544
- <span></span>
545
- <span></span>
546
- </div>
547
- </div>
548
- }
549
- @if (!message.typing) {
550
- @if (useCustomContentTemplate) {
551
- <div
552
- class="k-chat-bubble k-bubble"
553
- [attr.tabindex]="0"
554
- [ngClass]="{
555
- 'k-bubble-expandable': isMessageExpandable,
556
- 'k-expanded': isMessageExpanded,
557
- 'k-selected': selected,
558
- 'k-focus': selected,
559
- 'k-active': isActiveMessage
560
- }"
561
- >
562
- <div class="k-bubble-content">
563
- <ng-container *ngTemplateOutlet="getActiveContentTemplate()?.templateRef; context: { $implicit: message };"></ng-container>
564
- </div>
565
- @if (isMessageExpandable && showExpandCollapseIcon) {
566
- <span
567
- class="k-bubble-expandable-indicator"
568
- [attr.tabindex]="'0'"
569
- [attr.role]="'button'"
570
- [attr.title]="isMessageExpanded ? textFor('collapseTitle') : textFor('expandTitle')"
571
- (mousedown)="chatService.toggleMessageState = true"
572
- (click)="toggleMessageState($event)"
573
- >
574
- <kendo-icon-wrapper
575
- [name]="isMessageExpanded ? 'chevron-up' : 'chevron-down'"
576
- [svgIcon]="isMessageExpanded ? collapseIcon : expandIcon"
577
- >
578
- </kendo-icon-wrapper>
579
- </span>
580
- }
581
- </div>
582
- }
583
- @if (!useCustomContentTemplate && hasMessageContent) {
584
- <div
585
- class="k-chat-bubble k-bubble"
586
- [attr.tabindex]="0"
587
- [ngClass]="{
588
- 'k-bubble-expandable': isMessageExpandable,
589
- 'k-expanded': isMessageExpanded,
590
- 'k-selected': selected,
591
- 'k-focus': selected,
592
- 'k-active': isActiveMessage
593
- }"
594
- >
595
- <div class="k-bubble-content">
596
- @if (message.text || message.isDeleted) {
597
- @if (message.replyToId && !message.isDeleted) {
598
- <div
599
- class="k-message-reference k-message-reference-receiver"
600
- (click)="onReplyReferenceClick($event, message.replyToId)"
601
- >
602
- <chat-message-reference-content [message]="getMessageById(message.replyToId)"></chat-message-reference-content>
603
- </div>
604
- }
605
- @if (message.isDeleted) {
606
- <span class="k-chat-bubble-text">
607
- {{ getDeletedMessageText() }}
608
- </span>
609
- }
610
- @if (!message.isDeleted && parts.length > 0) {
611
- <span class="k-chat-bubble-text">
612
- @for (part of parts; track part) {
613
- @if (part.type === 'text') {{{part.content}}}
614
- @if (part.type === 'link') {<a [href]="part.href" target="_blank">{{part.content}}</a>}
615
- }
616
- </span>
617
- }
618
- }
619
- @if (hasFiles && !message.isDeleted) {
620
- <ul
621
- class="k-chat-file-wrapper"
622
- [ngClass]="{
623
- 'k-chat-files-wrap': chatService.messageFilesLayout === 'wrap',
624
- 'k-chat-files-horizontal': chatService.messageFilesLayout === 'horizontal'
625
- }"
626
- >
627
- @for (file of message.files; track file) {
628
- <li
629
- class="k-chat-file"
630
- [chatFile]="file"
631
- [fileActions]="fileActions"
632
- (actionClick)="onFileAction($event, file)"
633
- (actionsToggle)="onActionPopupChange($event)"
634
- (actionButtonClick)="onActionButtonClick($event)"
635
- ></li>
636
- }
637
- </ul>
638
- }
639
- @if (hasMultipleFiles && !message.isDeleted) {
640
- <div class="k-chat-download-button-wrapper">
641
- <button
642
- kendoButton
643
- class="k-chat-download-button"
644
- fillMode="flat"
645
- icon="download"
646
- [svgIcon]="downloadIcon"
647
- [attr.title]="textFor('downloadAllFilesText')"
648
- (click)="onDownloadAll()"
649
- >{{ textFor('downloadAllFilesText') }}</button>
650
- </div>
651
- }
652
- </div>
653
- @if (isMessageExpandable && showExpandCollapseIcon) {
654
- <span
655
- class="k-bubble-expandable-indicator"
656
- [attr.tabindex]="'0'"
657
- [attr.role]="'button'"
658
- [attr.title]="isMessageExpanded ? textFor('collapseTitle') : textFor('expandTitle')"
659
- (mousedown)="chatService.toggleMessageState = true"
660
- (click)="toggleMessageState($event)"
661
- >
662
- <kendo-icon-wrapper
663
- [name]="isMessageExpanded ? 'chevron-up' : 'chevron-down'"
664
- [svgIcon]="isMessageExpanded ? collapseIcon : expandIcon"
665
- >
666
- </kendo-icon-wrapper>
667
- </span>
668
- }
669
- </div>
670
- }
671
- }
672
- @if (message.status) {
673
- <span class="k-message-status">
674
- @if (statusTemplate?.templateRef) {
675
- <ng-template
676
- [ngTemplateOutlet]="statusTemplate.templateRef"
677
- [ngTemplateOutletContext]="{ $implicit: message.status, message }"
678
- >
679
- </ng-template>
680
- }
681
- @if (!statusTemplate?.templateRef) {
682
- {{ message.status }}
683
- }
684
- </span>
685
- }
686
- }
687
- @if (showToolbar) {
688
- <kendo-toolbar class="k-chat-message-toolbar" fillMode="flat">
689
- @for (action of toolbarActions; track action) {
690
- <kendo-toolbar-button
691
- fillMode="flat"
692
- [icon]="action.icon"
693
- [svgIcon]="action.svgIcon"
694
- [disabled]="action.disabled"
695
- [title]="action.label"
696
- (click)="onToolbarAction($event, action, message)"
697
- >
698
- </kendo-toolbar-button>
699
- }
700
- </kendo-toolbar>
701
- }
702
- `,
703
- standalone: true,
704
- imports: [NgClass, NgTemplateOutlet, IconWrapperComponent, KENDO_BUTTONS, ChatFileComponent, ToolBarComponent, ToolBarButtonComponent, MessageReferenceComponent],
705
- }]
706
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.IntlService }, { type: i2.ChatService }, { type: i3.LocalizationService }, { type: i0.ChangeDetectorRef }], propDecorators: { message: [{
707
- type: Input
708
- }], tabbable: [{
709
- type: Input
710
- }], authorMessageContentTemplate: [{
711
- type: Input
712
- }], receiverMessageContentTemplate: [{
713
- type: Input
714
- }], messageContentTemplate: [{
715
- type: Input
716
- }], authorMessageTemplate: [{
717
- type: Input
718
- }], receiverMessageTemplate: [{
719
- type: Input
720
- }], messageTemplate: [{
721
- type: Input
722
- }], statusTemplate: [{
723
- type: Input
724
- }], showMessageTime: [{
725
- type: Input
726
- }], authorId: [{
727
- type: Input
728
- }], cssClass: [{
729
- type: HostBinding,
730
- args: ['class.k-message']
731
- }], removedClass: [{
732
- type: HostBinding,
733
- args: ['class.k-message-removed']
734
- }], onKeyDown: [{
735
- type: HostListener,
736
- args: ['keydown', ['$event']]
737
- }], tabIndex: [{
738
- type: HostBinding,
739
- args: ['attr.tabIndex']
740
- }] } });