@progress/kendo-angular-conversational-ui 20.0.0-develop.3 → 20.0.0-develop.5
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/chat/api/action.interface.d.ts +1 -1
- package/chat/api/attachment.interface.d.ts +1 -1
- package/chat/api/chat-file-interface.d.ts +41 -0
- package/chat/api/chat-suggestion.interface.d.ts +25 -0
- package/chat/api/file-action.d.ts +42 -0
- package/chat/api/file-download-event.interface.d.ts +21 -0
- package/chat/api/index.d.ts +8 -0
- package/chat/api/message-action.d.ts +42 -0
- package/{esm2022/chat/chat.directives.mjs → chat/api/message-toolbar-visibility.d.ts} +4 -4
- package/chat/api/message-width-mode.d.ts +10 -0
- package/chat/api/message.interface.d.ts +30 -12
- package/chat/api/send-button-settings.d.ts +15 -0
- package/chat/api/user.interface.d.ts +4 -0
- package/chat/attachment.component.d.ts +1 -1
- package/chat/cards/hero-card.component.d.ts +1 -1
- package/chat/chat-file.component.d.ts +34 -0
- package/chat/chat-item.d.ts +1 -0
- package/chat/chat-view.d.ts +1 -1
- package/chat/chat.component.d.ts +218 -19
- package/chat/chat.module.d.ts +8 -4
- package/chat/common/chat.service.d.ts +51 -0
- package/chat/{chat.directives.d.ts → common/models/default-model-fields.d.ts} +5 -4
- package/chat/common/models/message-box-options.d.ts +1 -1
- package/chat/common/models/model-fields.d.ts +111 -0
- package/chat/common/utils.d.ts +50 -0
- package/chat/l10n/messages.d.ts +40 -3
- package/chat/message-attachments.component.d.ts +1 -4
- package/chat/message-box.component.d.ts +54 -25
- package/chat/message-list.component.d.ts +18 -11
- package/chat/message-reference-content.component.d.ts +24 -0
- package/chat/message.component.d.ts +54 -6
- package/chat/suggested-actions.component.d.ts +17 -4
- package/chat/templates/header-template.directive.d.ts +24 -0
- package/chat/{message-box.directive.d.ts → templates/message-box.directive.d.ts} +1 -1
- package/chat/templates/status-template.directive.d.ts +24 -0
- package/chat/templates/suggestion-template.directive.d.ts +24 -0
- package/chat/templates/timestamp-template.directive.d.ts +28 -0
- package/codemods/template-transformer/index.js +94 -0
- package/codemods/utils.js +609 -0
- package/codemods/v20/chat-user.js +50 -0
- package/conversational-ui.module.d.ts +11 -7
- package/directives.d.ts +9 -5
- package/esm2022/chat/api/chat-file-interface.mjs +5 -0
- package/esm2022/chat/api/chat-suggestion.interface.mjs +5 -0
- package/esm2022/chat/api/file-action.mjs +5 -0
- package/esm2022/chat/api/file-download-event.interface.mjs +5 -0
- package/esm2022/chat/api/index.mjs +8 -0
- package/esm2022/chat/api/message-action.mjs +5 -0
- package/esm2022/chat/api/message-toolbar-visibility.mjs +5 -0
- package/esm2022/chat/api/message-width-mode.mjs +5 -0
- package/esm2022/chat/api/send-button-settings.mjs +5 -0
- package/esm2022/chat/attachment.component.mjs +1 -1
- package/esm2022/chat/builtin-actions.mjs +1 -1
- package/esm2022/chat/cards/hero-card.component.mjs +1 -1
- package/esm2022/chat/chat-file.component.mjs +141 -0
- package/esm2022/chat/chat-item.mjs +1 -0
- package/esm2022/chat/chat-view.mjs +2 -2
- package/esm2022/chat/chat.component.mjs +518 -57
- package/esm2022/chat/chat.module.mjs +8 -4
- package/esm2022/chat/common/chat.service.mjs +97 -0
- package/esm2022/chat/common/models/default-model-fields.mjs +26 -0
- package/esm2022/chat/common/models/model-fields.mjs +5 -0
- package/esm2022/chat/common/utils.mjs +127 -0
- package/esm2022/chat/l10n/messages.mjs +60 -5
- package/esm2022/chat/message-attachments.component.mjs +1 -4
- package/esm2022/chat/message-box.component.mjs +360 -111
- package/esm2022/chat/message-list.component.mjs +166 -96
- package/esm2022/chat/message-reference-content.component.mjs +75 -0
- package/esm2022/chat/message.component.mjs +448 -35
- package/esm2022/chat/suggested-actions.component.mjs +151 -41
- package/esm2022/chat/templates/header-template.directive.mjs +33 -0
- package/esm2022/chat/{message-box.directive.mjs → templates/message-box.directive.mjs} +1 -1
- package/esm2022/chat/templates/status-template.directive.mjs +33 -0
- package/esm2022/chat/templates/suggestion-template.directive.mjs +33 -0
- package/esm2022/chat/templates/timestamp-template.directive.mjs +39 -0
- package/esm2022/conversational-ui.module.mjs +12 -8
- package/esm2022/directives.mjs +12 -4
- package/esm2022/index.mjs +9 -3
- package/esm2022/package-metadata.mjs +2 -2
- package/fesm2022/progress-kendo-angular-conversational-ui.mjs +4986 -3125
- package/index.d.ts +10 -3
- package/package.json +29 -12
- /package/chat/{attachment-template.directive.d.ts → templates/attachment-template.directive.d.ts} +0 -0
- /package/chat/{message-template.directive.d.ts → templates/message-template.directive.d.ts} +0 -0
- /package/esm2022/chat/{attachment-template.directive.mjs → templates/attachment-template.directive.mjs} +0 -0
- /package/esm2022/chat/{message-template.directive.mjs → templates/message-template.directive.mjs} +0 -0
@@ -2,46 +2,75 @@
|
|
2
2
|
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
5
|
-
import { EventEmitter } from '@angular/core';
|
5
|
+
import { ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, Renderer2 } from '@angular/core';
|
6
6
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
7
7
|
import { SVGIcon } from '@progress/kendo-svg-icons';
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
8
|
+
import { SpeechToTextButtonSettings } from '@progress/kendo-angular-buttons';
|
9
|
+
import { ChatMessageBoxTemplateDirective } from './templates/message-box.directive';
|
10
|
+
import { TextAreaComponent } from '@progress/kendo-angular-inputs';
|
11
|
+
import { FileSelectComponent, SelectEvent, FileSelectSettings } from '@progress/kendo-angular-upload';
|
12
|
+
import { ChatFile } from './api/chat-file-interface';
|
13
|
+
import { ChatService } from './common/chat.service';
|
14
|
+
import { SuggestedActionsComponent } from "./suggested-actions.component";
|
15
|
+
import { ChatSuggestion, Message, SendButtonSettings } from './api';
|
16
|
+
import { ChatItem } from './chat-item';
|
17
|
+
import { ChatSuggestionTemplateDirective } from './templates/suggestion-template.directive';
|
12
18
|
import * as i0 from "@angular/core";
|
13
19
|
/**
|
14
20
|
* @hidden
|
15
21
|
*/
|
16
|
-
export declare class MessageBoxComponent {
|
22
|
+
export declare class MessageBoxComponent implements OnInit, OnDestroy {
|
23
|
+
private chatService;
|
24
|
+
private cdr;
|
25
|
+
private element;
|
26
|
+
private renderer;
|
17
27
|
borderColor: string;
|
18
|
-
|
19
|
-
|
28
|
+
messageBoxWrapperClass: boolean;
|
29
|
+
messageBoxInput: TextAreaComponent;
|
30
|
+
fileSelectComponent: FileSelectComponent;
|
31
|
+
suggestedActionsComponent: SuggestedActionsComponent;
|
32
|
+
authorId: string | number;
|
20
33
|
autoScroll: boolean;
|
21
|
-
|
34
|
+
suggestions: ChatSuggestion[];
|
35
|
+
placeholder: any;
|
36
|
+
inputValue: string;
|
22
37
|
localization: LocalizationService;
|
23
38
|
messageBoxTemplate: ChatMessageBoxTemplateDirective;
|
39
|
+
suggestionTemplate: ChatSuggestionTemplateDirective;
|
24
40
|
sendMessage: EventEmitter<any>;
|
25
|
-
|
26
|
-
|
27
|
-
|
41
|
+
executeSuggestion: EventEmitter<ChatSuggestion>;
|
42
|
+
fileSelect: EventEmitter<SelectEvent>;
|
43
|
+
fileRemove: EventEmitter<ChatFile>;
|
44
|
+
files: ChatFile[];
|
28
45
|
sendIcon: SVGIcon;
|
29
|
-
|
30
|
-
|
31
|
-
|
46
|
+
attachmentIcon: SVGIcon;
|
47
|
+
deleteIcon: SVGIcon;
|
48
|
+
fileIcon: SVGIcon;
|
49
|
+
isListening: boolean;
|
50
|
+
get reply(): Message;
|
51
|
+
private selectedItem;
|
52
|
+
private subs;
|
53
|
+
constructor(chatService: ChatService, cdr: ChangeDetectorRef, element: ElementRef, renderer: Renderer2);
|
54
|
+
ngOnInit(): void;
|
55
|
+
ngOnDestroy(): void;
|
32
56
|
sendClick(): void;
|
33
|
-
/**
|
34
|
-
* @hidden
|
35
|
-
*/
|
36
57
|
inputKeydown(e: any): void;
|
37
|
-
/**
|
38
|
-
* @hidden
|
39
|
-
*/
|
40
58
|
textAreaKeydown(e: any): void;
|
41
|
-
|
42
|
-
* @hidden
|
43
|
-
*/
|
59
|
+
handleSpeechResult(event: any): void;
|
44
60
|
textFor(key: string): string;
|
61
|
+
removeReply(): void;
|
62
|
+
onReplyReferenceClick(event: Event): void;
|
63
|
+
handleFileSelect(event: SelectEvent): void;
|
64
|
+
selectFiles(): void;
|
65
|
+
removeFile(index: number): void;
|
66
|
+
get speechToTextButtonSettings(): SpeechToTextButtonSettings;
|
67
|
+
get sendButtonSettings(): SendButtonSettings;
|
68
|
+
get enableFileSelect(): boolean | FileSelectSettings;
|
69
|
+
get isDisabledSendButton(): boolean;
|
70
|
+
select(item: ChatItem, event?: Event): void;
|
71
|
+
onBlur(args: any): void;
|
72
|
+
onInputValueChange(value: string): void;
|
73
|
+
dispatchSuggestion(suggestion: ChatSuggestion): void;
|
45
74
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessageBoxComponent, never>;
|
46
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MessageBoxComponent, "kendo-message-box", never, { "
|
75
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MessageBoxComponent, "kendo-message-box", never, { "authorId": { "alias": "authorId"; "required": false; }; "autoScroll": { "alias": "autoScroll"; "required": false; }; "suggestions": { "alias": "suggestions"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "inputValue": { "alias": "inputValue"; "required": false; }; "localization": { "alias": "localization"; "required": false; }; "messageBoxTemplate": { "alias": "messageBoxTemplate"; "required": false; }; "suggestionTemplate": { "alias": "suggestionTemplate"; "required": false; }; }, { "sendMessage": "sendMessage"; "executeSuggestion": "executeSuggestion"; "fileSelect": "fileSelect"; "fileRemove": "fileRemove"; }, never, never, true, never>;
|
47
76
|
}
|
@@ -2,14 +2,17 @@
|
|
2
2
|
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
5
|
-
import { AfterViewInit, ElementRef, EventEmitter, OnDestroy, OnInit, QueryList, Renderer2 } from '@angular/core';
|
6
|
-
import { Action, ExecuteActionEvent, Message
|
5
|
+
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, QueryList, Renderer2 } from '@angular/core';
|
6
|
+
import { Action, ExecuteActionEvent, Message } from './api';
|
7
7
|
import { IntlService } from '@progress/kendo-angular-intl';
|
8
8
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
9
9
|
import { ChatItem } from './chat-item';
|
10
10
|
import { ViewItem } from './chat-view';
|
11
|
-
import { AttachmentTemplateDirective } from './attachment-template.directive';
|
12
|
-
import { MessageTemplateDirective } from './message-template.directive';
|
11
|
+
import { AttachmentTemplateDirective } from './templates/attachment-template.directive';
|
12
|
+
import { MessageTemplateDirective } from './templates/message-template.directive';
|
13
|
+
import { ChatTimestampTemplateDirective } from './templates/timestamp-template.directive';
|
14
|
+
import { ChatService } from './common/chat.service';
|
15
|
+
import { ChatStatusTemplateDirective } from './templates/status-template.directive';
|
13
16
|
import * as i0 from "@angular/core";
|
14
17
|
/**
|
15
18
|
* @hidden
|
@@ -18,12 +21,16 @@ export declare class MessageListComponent implements OnInit, AfterViewInit, OnDe
|
|
18
21
|
private element;
|
19
22
|
private intl;
|
20
23
|
private renderer;
|
24
|
+
chatService: ChatService;
|
25
|
+
private cdr;
|
21
26
|
set messages(value: Message[]);
|
22
27
|
get messages(): Message[];
|
23
28
|
attachmentTemplate: AttachmentTemplateDirective;
|
24
29
|
messageTemplate: MessageTemplateDirective;
|
30
|
+
timestampTemplate: ChatTimestampTemplateDirective;
|
31
|
+
statusTemplate: ChatStatusTemplateDirective;
|
25
32
|
localization: LocalizationService;
|
26
|
-
|
33
|
+
authorId: string | number;
|
27
34
|
executeAction: EventEmitter<ExecuteActionEvent>;
|
28
35
|
navigate: EventEmitter<any>;
|
29
36
|
resize: EventEmitter<any>;
|
@@ -34,26 +41,26 @@ export declare class MessageListComponent implements OnInit, AfterViewInit, OnDe
|
|
34
41
|
private subs;
|
35
42
|
private selectedItem;
|
36
43
|
private keyActions;
|
37
|
-
constructor(element: ElementRef, intl: IntlService, renderer: Renderer2);
|
44
|
+
constructor(element: ElementRef, intl: IntlService, renderer: Renderer2, chatService: ChatService, cdr: ChangeDetectorRef);
|
38
45
|
ngOnInit(): void;
|
39
46
|
ngAfterViewInit(): void;
|
40
47
|
ngOnDestroy(): void;
|
41
48
|
onResize(): void;
|
49
|
+
onClick(message: any, event: any): void;
|
42
50
|
formatTimeStamp(date: any): string;
|
43
51
|
onKeydown(e: any): void;
|
44
52
|
onBlur(args: any): void;
|
45
53
|
isOwnMessage(msg: Message): boolean;
|
46
54
|
dispatchAction(action: Action, message: Message): void;
|
47
55
|
trackGroup(_index: number, item: ViewItem): any;
|
48
|
-
select(item: ChatItem): void;
|
56
|
+
select(item: ChatItem, event?: Event): void;
|
49
57
|
last(items: any): any;
|
58
|
+
handleMenuClose(state: boolean): void;
|
50
59
|
private onHomeOrEndKeyDown;
|
51
60
|
private onTabKeyDown;
|
52
61
|
private navigateTo;
|
53
|
-
|
54
|
-
* @hidden
|
55
|
-
*/
|
62
|
+
private scrollToAndSelectMessage;
|
56
63
|
textFor(key: string): string;
|
57
64
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessageListComponent, never>;
|
58
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MessageListComponent, "kendo-chat-message-list", never, { "messages": { "alias": "messages"; "required": false; }; "attachmentTemplate": { "alias": "attachmentTemplate"; "required": false; }; "messageTemplate": { "alias": "messageTemplate"; "required": false; }; "localization": { "alias": "localization"; "required": false; }; "
|
65
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MessageListComponent, "kendo-chat-message-list", never, { "messages": { "alias": "messages"; "required": false; }; "attachmentTemplate": { "alias": "attachmentTemplate"; "required": false; }; "messageTemplate": { "alias": "messageTemplate"; "required": false; }; "timestampTemplate": { "alias": "timestampTemplate"; "required": false; }; "statusTemplate": { "alias": "statusTemplate"; "required": false; }; "localization": { "alias": "localization"; "required": false; }; "authorId": { "alias": "authorId"; "required": false; }; }, { "executeAction": "executeAction"; "navigate": "navigate"; "resize": "resize"; }, never, never, true, never>;
|
59
66
|
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
5
|
+
import { ChatItem } from './chat-item';
|
6
|
+
import { Message } from './api';
|
7
|
+
import { ChatService } from './common/chat.service';
|
8
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
9
|
+
import * as i0 from "@angular/core";
|
10
|
+
/**
|
11
|
+
* @hidden
|
12
|
+
*/
|
13
|
+
export declare class MessageReferenceComponent extends ChatItem {
|
14
|
+
private localization;
|
15
|
+
private chatService;
|
16
|
+
hostClass: boolean;
|
17
|
+
message: Message;
|
18
|
+
constructor(localization: LocalizationService, chatService: ChatService);
|
19
|
+
isOwnMessage(msg: Message): boolean;
|
20
|
+
textFor(key: string): string;
|
21
|
+
focus(): void;
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MessageReferenceComponent, never>;
|
23
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MessageReferenceComponent, "chat-message-reference-content", never, { "message": { "alias": "message"; "required": false; }; }, {}, never, never, true, never>;
|
24
|
+
}
|
@@ -2,27 +2,75 @@
|
|
2
2
|
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
5
|
-
import { ElementRef } from '@angular/core';
|
5
|
+
import { ElementRef, EventEmitter, OnDestroy } from '@angular/core';
|
6
6
|
import { Message } from './api/message.interface';
|
7
7
|
import { ChatItem } from './chat-item';
|
8
|
-
import { MessageTemplateDirective } from './message-template.directive';
|
8
|
+
import { MessageTemplateDirective } from './templates/message-template.directive';
|
9
9
|
import { IntlService } from '@progress/kendo-angular-intl';
|
10
|
+
import { ChatFile } from './api/chat-file-interface';
|
11
|
+
import { ContextMenuPopupEvent } from '@progress/kendo-angular-menu';
|
12
|
+
import { SVGIcon } from '@progress/kendo-svg-icons';
|
13
|
+
import { ChatService } from './common/chat.service';
|
14
|
+
import { MessageAction } from './api';
|
15
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
16
|
+
import { ChatStatusTemplateDirective } from './templates/status-template.directive';
|
10
17
|
import * as i0 from "@angular/core";
|
11
18
|
/**
|
12
19
|
* @hidden
|
13
20
|
*/
|
14
|
-
export declare class MessageComponent extends ChatItem {
|
15
|
-
|
21
|
+
export declare class MessageComponent extends ChatItem implements OnDestroy {
|
22
|
+
element: ElementRef;
|
16
23
|
private intl;
|
24
|
+
chatService: ChatService;
|
25
|
+
private localization;
|
17
26
|
message: Message;
|
18
27
|
tabbable: boolean;
|
19
28
|
template: MessageTemplateDirective;
|
29
|
+
statusTemplate: ChatStatusTemplateDirective;
|
30
|
+
showMessageTime: boolean;
|
31
|
+
authorId: string | number;
|
32
|
+
contextMenuVisibilityChange: EventEmitter<boolean>;
|
20
33
|
cssClass: boolean;
|
34
|
+
get removedClass(): boolean;
|
35
|
+
onKeyDown(event: KeyboardEvent): void;
|
21
36
|
selected: boolean;
|
37
|
+
hovered: boolean;
|
38
|
+
active: boolean;
|
39
|
+
selectOnMenuClose: boolean;
|
22
40
|
get tabIndex(): string;
|
23
|
-
|
41
|
+
onContextMenu(event: MouseEvent): void;
|
42
|
+
expandIcon: SVGIcon;
|
43
|
+
collapseIcon: SVGIcon;
|
44
|
+
downloadIcon: SVGIcon;
|
45
|
+
isMessageExpanded: boolean;
|
46
|
+
contextMenuActions: any;
|
47
|
+
fileActions: any;
|
48
|
+
constructor(element: ElementRef, intl: IntlService, chatService: ChatService, localization: LocalizationService);
|
49
|
+
ngOnInit(): void;
|
50
|
+
ngOnDestroy(): void;
|
51
|
+
textFor(key: string): string;
|
24
52
|
formatTimeStamp(date: any): string;
|
25
53
|
focus(): void;
|
54
|
+
onDownloadAll(): void;
|
55
|
+
toggleMessageState(event: Event): void;
|
56
|
+
onExpandableKeydown(event: KeyboardEvent): void;
|
57
|
+
isToolbarVisible(): boolean;
|
58
|
+
onToolbarAction(event: Event, action: MessageAction, message: Message): void;
|
59
|
+
onContextMenuAction(action: MessageAction): void;
|
60
|
+
onFileAction(action: any, file: ChatFile): void;
|
61
|
+
private transformActions;
|
62
|
+
getMessageById(id: string | number): Message | undefined;
|
63
|
+
getFormattedTextParts(text: string): Array<{
|
64
|
+
type: 'text' | 'link';
|
65
|
+
content: string;
|
66
|
+
href?: string;
|
67
|
+
}>;
|
68
|
+
onReplyReferenceClick(event: Event, replyToId: string | number): void;
|
69
|
+
handleMenuClose(event?: ContextMenuPopupEvent): void;
|
70
|
+
onActionButtonClick(event: MouseEvent): void;
|
71
|
+
handleMenuOpen(): void;
|
72
|
+
onActionPopupChange(expanded: boolean): void;
|
73
|
+
isOwnMessage(msg: Message): boolean;
|
26
74
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessageComponent, never>;
|
27
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MessageComponent, "kendo-chat-message", never, { "message": { "alias": "message"; "required": false; }; "tabbable": { "alias": "tabbable"; "required": false; }; "template": { "alias": "template"; "required": false; }; }, {}, never, never, true, never>;
|
75
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MessageComponent, "kendo-chat-message", never, { "message": { "alias": "message"; "required": false; }; "tabbable": { "alias": "tabbable"; "required": false; }; "template": { "alias": "template"; "required": false; }; "statusTemplate": { "alias": "statusTemplate"; "required": false; }; "showMessageTime": { "alias": "showMessageTime"; "required": false; }; "authorId": { "alias": "authorId"; "required": false; }; }, { "contextMenuVisibilityChange": "contextMenuVisibilityChange"; }, never, never, true, never>;
|
28
76
|
}
|
@@ -5,23 +5,36 @@
|
|
5
5
|
import { ElementRef, EventEmitter, QueryList } from '@angular/core';
|
6
6
|
import { Action } from './api/action.interface';
|
7
7
|
import { ChatItem } from './chat-item';
|
8
|
+
import { ChatSuggestion } from './api/chat-suggestion.interface';
|
9
|
+
import { ChatSuggestionTemplateDirective } from './templates/suggestion-template.directive';
|
8
10
|
import * as i0 from "@angular/core";
|
9
11
|
/**
|
10
12
|
* @hidden
|
11
13
|
*/
|
12
14
|
export declare class SuggestedActionsComponent extends ChatItem {
|
13
15
|
actions: Action[];
|
16
|
+
suggestions: ChatSuggestion[];
|
14
17
|
tabbable: boolean;
|
15
|
-
|
18
|
+
suggestionTemplate: ChatSuggestionTemplateDirective;
|
19
|
+
dispatchAction: EventEmitter<Action>;
|
20
|
+
dispatchSuggestion: EventEmitter<ChatSuggestion>;
|
16
21
|
defaultClass: boolean;
|
22
|
+
role: string;
|
17
23
|
items: QueryList<ElementRef>;
|
18
24
|
selectedIndex: number;
|
19
|
-
|
25
|
+
activeIndex: number;
|
26
|
+
active: boolean;
|
27
|
+
private actionKeyHandlers;
|
28
|
+
private suggestionKeyHandlers;
|
20
29
|
isSelected(index: number): boolean;
|
21
|
-
|
30
|
+
isActive(index: number): boolean;
|
31
|
+
actionClick(action: Action, index?: number): void;
|
32
|
+
suggestionClick(suggestion: ChatSuggestion, index?: number): void;
|
33
|
+
toggleActiveState(apply: boolean, index: number): void;
|
22
34
|
actionKeydown(e: any, action: Action): void;
|
35
|
+
suggestionKeydown(e: any, suggestion: ChatSuggestion): void;
|
23
36
|
focus(): void;
|
24
37
|
private changeSelectedIndex;
|
25
38
|
static ɵfac: i0.ɵɵFactoryDeclaration<SuggestedActionsComponent, never>;
|
26
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SuggestedActionsComponent, "kendo-chat-suggested-actions", never, { "actions": { "alias": "actions"; "required": false; }; "tabbable": { "alias": "tabbable"; "required": false; }; }, { "
|
39
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SuggestedActionsComponent, "kendo-chat-suggested-actions", never, { "actions": { "alias": "actions"; "required": false; }; "suggestions": { "alias": "suggestions"; "required": false; }; "tabbable": { "alias": "tabbable"; "required": false; }; "suggestionTemplate": { "alias": "suggestionTemplate"; "required": false; }; }, { "dispatchAction": "dispatchAction"; "dispatchSuggestion": "dispatchSuggestion"; }, never, never, true, never>;
|
27
40
|
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
5
|
+
import { TemplateRef } from '@angular/core';
|
6
|
+
import * as i0 from "@angular/core";
|
7
|
+
/**
|
8
|
+
* Represents the template for the header of the Chat component.
|
9
|
+
*
|
10
|
+
* @example
|
11
|
+
* ```html
|
12
|
+
* <kendo-chat>
|
13
|
+
* <ng-template kendoChatHeaderTemplate>
|
14
|
+
* Chat Title
|
15
|
+
* </ng-template>
|
16
|
+
* </kendo-chat>
|
17
|
+
* ```
|
18
|
+
*/
|
19
|
+
export declare class ChatHeaderTemplateDirective {
|
20
|
+
templateRef: TemplateRef<any>;
|
21
|
+
constructor(templateRef: TemplateRef<any>);
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatHeaderTemplateDirective, never>;
|
23
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ChatHeaderTemplateDirective, "[kendoChatHeaderTemplate]", never, {}, {}, never, never, true, never>;
|
24
|
+
}
|
@@ -8,7 +8,7 @@ import * as i0 from "@angular/core";
|
|
8
8
|
* Creates a message box area that overrides the default message box of the Chat component.
|
9
9
|
*
|
10
10
|
* To define a message box template, nest an `<ng-template>` tag with the `kendoChatMessageBoxTemplate` directive inside the `<kendo-chat>` tag.
|
11
|
-
* For more information, see [Message Box Template](slug:
|
11
|
+
* For more information, see [Message Box Template](slug:message_templates_chat#toc-message-box-template).
|
12
12
|
*
|
13
13
|
* @example
|
14
14
|
* ```html
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
5
|
+
import { TemplateRef } from '@angular/core';
|
6
|
+
import * as i0 from "@angular/core";
|
7
|
+
/**
|
8
|
+
* Represents the template for the status of a message.
|
9
|
+
*
|
10
|
+
* @example
|
11
|
+
* ```html
|
12
|
+
* <kendo-chat>
|
13
|
+
* <ng-template kendoChatStatusTemplate let-status>
|
14
|
+
* Current status: {{ status }}
|
15
|
+
* </ng-template>
|
16
|
+
* </kendo-chat>
|
17
|
+
* ```
|
18
|
+
*/
|
19
|
+
export declare class ChatStatusTemplateDirective {
|
20
|
+
templateRef: TemplateRef<any>;
|
21
|
+
constructor(templateRef: TemplateRef<any>);
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatStatusTemplateDirective, never>;
|
23
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ChatStatusTemplateDirective, "[kendoChatStatusTemplate]", never, {}, {}, never, never, true, never>;
|
24
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
5
|
+
import { TemplateRef } from '@angular/core';
|
6
|
+
import * as i0 from "@angular/core";
|
7
|
+
/**
|
8
|
+
* Represents the template for a suggestion in the Chat component.
|
9
|
+
*
|
10
|
+
* @example
|
11
|
+
* ```html
|
12
|
+
* <kendo-chat>
|
13
|
+
* <ng-template kendoChatSuggestionTemplate>
|
14
|
+
* Suggestion Text
|
15
|
+
* </ng-template>
|
16
|
+
* </kendo-chat>
|
17
|
+
* ```
|
18
|
+
*/
|
19
|
+
export declare class ChatSuggestionTemplateDirective {
|
20
|
+
templateRef: TemplateRef<any>;
|
21
|
+
constructor(templateRef: TemplateRef<any>);
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatSuggestionTemplateDirective, never>;
|
23
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ChatSuggestionTemplateDirective, "[kendoChatSuggestionTemplate]", never, {}, {}, never, never, true, never>;
|
24
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
5
|
+
import { TemplateRef } from "@angular/core";
|
6
|
+
import * as i0 from "@angular/core";
|
7
|
+
/**
|
8
|
+
* Defines a template for displaying the timestamp of the messages.
|
9
|
+
*
|
10
|
+
* To define a timestamp template, nest an `<ng-template>` tag with the `kendoChatTimestampTemplate` directive inside the `<kendo-chat>` component.
|
11
|
+
* The template context is set to the current timestamp.
|
12
|
+
* For more information, refer to the article on [message templates](slug:message_templates_chat).
|
13
|
+
*
|
14
|
+
* @example
|
15
|
+
* ```html
|
16
|
+
* <kendo-chat>
|
17
|
+
* <ng-template kendoChatTimestampTemplate let-timestamp>
|
18
|
+
* <div>Message time: {{ timestamp }}</div>
|
19
|
+
* </ng-template>
|
20
|
+
* </kendo-chat>
|
21
|
+
* ```
|
22
|
+
*/
|
23
|
+
export declare class ChatTimestampTemplateDirective {
|
24
|
+
templateRef: TemplateRef<any>;
|
25
|
+
constructor(templateRef: TemplateRef<any>);
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatTimestampTemplateDirective, [{ optional: true; }]>;
|
27
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ChatTimestampTemplateDirective, "[kendoChatTimestampTemplate]", never, {}, {}, never, never, true, never>;
|
28
|
+
}
|
@@ -0,0 +1,94 @@
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
5
|
+
"use strict";
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
7
|
+
exports.templateTransformer = void 0;
|
8
|
+
const node_html_parser_1 = require("node-html-parser");
|
9
|
+
function templateTransformer(root, j, ...processFns) {
|
10
|
+
root
|
11
|
+
.find(j.ClassDeclaration)
|
12
|
+
.forEach(classPath => {
|
13
|
+
// Skip if no decorators
|
14
|
+
const classNode = classPath.node;
|
15
|
+
if (!classNode.decorators || !classNode.decorators.length)
|
16
|
+
return;
|
17
|
+
// Find Component decorator
|
18
|
+
const componentDecorator = classNode.decorators.find((decorator) => {
|
19
|
+
if (decorator.expression && decorator.expression.type === 'CallExpression') {
|
20
|
+
const callee = decorator.expression.callee;
|
21
|
+
// Handle direct Component identifier
|
22
|
+
if (callee.type === 'Identifier' && callee.name === 'Component') {
|
23
|
+
return true;
|
24
|
+
}
|
25
|
+
// Handle angular.core.Component or similar
|
26
|
+
if (callee.type === 'MemberExpression' &&
|
27
|
+
callee.property &&
|
28
|
+
callee.property.type === 'Identifier' &&
|
29
|
+
callee.property.name === 'Component') {
|
30
|
+
return true;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
return false;
|
34
|
+
});
|
35
|
+
if (!componentDecorator || !componentDecorator.expression)
|
36
|
+
return;
|
37
|
+
const expression = componentDecorator.expression;
|
38
|
+
if (expression.type !== 'CallExpression' || !expression.arguments.length)
|
39
|
+
return;
|
40
|
+
const componentOptions = expression.arguments[0];
|
41
|
+
if (componentOptions.type !== 'ObjectExpression')
|
42
|
+
return;
|
43
|
+
// Find template and templateUrl properties
|
44
|
+
const props = componentOptions.properties || [];
|
45
|
+
const templateProp = props.find((prop) => (prop.key.type === 'Identifier' && prop.key.name === 'template') ||
|
46
|
+
(prop.key.type === 'StringLiteral' && prop.key.value === 'template'));
|
47
|
+
// const templateUrlProp = props.find((prop: any) =>
|
48
|
+
// (prop.key.type === 'Identifier' && prop.key.name === 'templateUrl') ||
|
49
|
+
// (prop.key.type === 'StringLiteral' && prop.key.value === 'templateUrl')
|
50
|
+
// );
|
51
|
+
// Process inline template
|
52
|
+
if (templateProp) {
|
53
|
+
// Extract template based on node type
|
54
|
+
let originalTemplate;
|
55
|
+
if (templateProp.value.type === 'StringLiteral' || templateProp.value.type === 'Literal') {
|
56
|
+
originalTemplate = templateProp.value.value;
|
57
|
+
}
|
58
|
+
else if (templateProp.value.type === 'TemplateLiteral') {
|
59
|
+
// For template literals, join quasis
|
60
|
+
if (templateProp.value.quasis && templateProp.value.quasis.length) {
|
61
|
+
originalTemplate = templateProp.value.quasis
|
62
|
+
.map((q) => q.value.cooked || q.value.raw)
|
63
|
+
.join('');
|
64
|
+
}
|
65
|
+
else {
|
66
|
+
console.warn('Could not process TemplateLiteral properly');
|
67
|
+
return;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
else {
|
71
|
+
console.warn(`Unsupported template type: ${templateProp.value.type}`);
|
72
|
+
return;
|
73
|
+
}
|
74
|
+
const root = (0, node_html_parser_1.parse)(originalTemplate);
|
75
|
+
processFns.forEach(fn => {
|
76
|
+
fn(root);
|
77
|
+
});
|
78
|
+
// Transform template using Angular compiler
|
79
|
+
const transformedTemplate = root.toString();
|
80
|
+
if (transformedTemplate !== originalTemplate) {
|
81
|
+
// Update template property
|
82
|
+
if (templateProp.value.type === 'TemplateLiteral') {
|
83
|
+
// For template literals, create a new template literal
|
84
|
+
templateProp.value = j.templateLiteral([j.templateElement({ cooked: transformedTemplate, raw: transformedTemplate }, true)], []);
|
85
|
+
}
|
86
|
+
else {
|
87
|
+
// For string literals, update the value
|
88
|
+
templateProp.value.value = transformedTemplate;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
});
|
93
|
+
}
|
94
|
+
exports.templateTransformer = templateTransformer;
|