@memberjunction/ng-conversations 2.114.0 → 2.116.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +12 -0
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.js +149 -11
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-list.component.d.ts +9 -3
- package/dist/lib/components/conversation/conversation-list.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-list.component.js +398 -197
- package/dist/lib/components/conversation/conversation-list.component.js.map +1 -1
- package/dist/lib/components/mention/mention-dropdown.component.js +31 -23
- package/dist/lib/components/mention/mention-dropdown.component.js.map +1 -1
- package/dist/lib/components/mention/mention-editor.component.d.ts +117 -0
- package/dist/lib/components/mention/mention-editor.component.d.ts.map +1 -0
- package/dist/lib/components/mention/mention-editor.component.js +550 -0
- package/dist/lib/components/mention/mention-editor.component.js.map +1 -0
- package/dist/lib/components/message/message-input-box.component.d.ts +22 -33
- package/dist/lib/components/message/message-input-box.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input-box.component.js +71 -172
- package/dist/lib/components/message/message-input-box.component.js.map +1 -1
- package/dist/lib/components/message/message-input.component.d.ts +18 -15
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input.component.js +108 -93
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/message/message-item.component.d.ts +1 -0
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-item.component.js +49 -7
- package/dist/lib/components/message/message-item.component.js.map +1 -1
- package/dist/lib/components/navigation/conversation-navigation.component.js +2 -2
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts +6 -1
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.js +115 -73
- package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
- package/dist/lib/conversations.module.d.ts +55 -54
- package/dist/lib/conversations.module.d.ts.map +1 -1
- package/dist/lib/conversations.module.js +4 -0
- package/dist/lib/conversations.module.js.map +1 -1
- package/dist/lib/services/conversation-state.service.d.ts +14 -0
- package/dist/lib/services/conversation-state.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-state.service.js +32 -0
- package/dist/lib/services/conversation-state.service.js.map +1 -1
- package/dist/lib/services/conversation-streaming.service.d.ts +101 -0
- package/dist/lib/services/conversation-streaming.service.d.ts.map +1 -0
- package/dist/lib/services/conversation-streaming.service.js +319 -0
- package/dist/lib/services/conversation-streaming.service.js.map +1 -0
- package/dist/lib/services/mention-autocomplete.service.d.ts +8 -0
- package/dist/lib/services/mention-autocomplete.service.d.ts.map +1 -1
- package/dist/lib/services/mention-autocomplete.service.js +34 -3
- package/dist/lib/services/mention-autocomplete.service.js.map +1 -1
- package/dist/public-api.d.ts +2 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +2 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +14 -14
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { EventEmitter
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
2
|
import { UserInfo } from '@memberjunction/core';
|
|
3
|
-
import {
|
|
3
|
+
import { MentionSuggestion } from '../../services/mention-autocomplete.service';
|
|
4
|
+
import { MentionEditorComponent } from '../mention/mention-editor.component';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
/**
|
|
6
7
|
* Reusable message input box component (presentational)
|
|
8
|
+
* Now uses MentionEditorComponent for rich @mention functionality with chips
|
|
9
|
+
*
|
|
7
10
|
* Handles:
|
|
8
|
-
* - Text input with keyboard shortcuts
|
|
9
|
-
* - @mention autocomplete (
|
|
11
|
+
* - Text input with keyboard shortcuts via MentionEditorComponent
|
|
12
|
+
* - @mention autocomplete with visual chips (contentEditable)
|
|
10
13
|
* - Send button
|
|
11
|
-
* - Character count (optional)
|
|
12
14
|
*
|
|
13
15
|
* Does NOT handle:
|
|
14
16
|
* - Saving messages to database
|
|
@@ -16,8 +18,8 @@ import * as i0 from "@angular/core";
|
|
|
16
18
|
* - Artifact creation
|
|
17
19
|
* - Conversation management
|
|
18
20
|
*/
|
|
19
|
-
export declare class MessageInputBoxComponent
|
|
20
|
-
|
|
21
|
+
export declare class MessageInputBoxComponent {
|
|
22
|
+
mentionEditor?: MentionEditorComponent;
|
|
21
23
|
placeholder: string;
|
|
22
24
|
disabled: boolean;
|
|
23
25
|
value: string;
|
|
@@ -27,43 +29,30 @@ export declare class MessageInputBoxComponent implements OnInit, AfterViewInit,
|
|
|
27
29
|
rows: number;
|
|
28
30
|
textSubmitted: EventEmitter<string>;
|
|
29
31
|
valueChange: EventEmitter<string>;
|
|
30
|
-
messageTextarea?: ElementRef;
|
|
31
|
-
showMentionDropdown: boolean;
|
|
32
|
-
mentionSuggestions: MentionSuggestion[];
|
|
33
|
-
mentionDropdownPosition: {
|
|
34
|
-
top: number;
|
|
35
|
-
left: number;
|
|
36
|
-
};
|
|
37
|
-
mentionDropdownShowAbove: boolean;
|
|
38
|
-
private mentionStartIndex;
|
|
39
|
-
private mentionQuery;
|
|
40
|
-
constructor(mentionAutocomplete: MentionAutocompleteService);
|
|
41
|
-
ngOnInit(): Promise<void>;
|
|
42
|
-
ngAfterViewInit(): void;
|
|
43
|
-
ngOnDestroy(): void;
|
|
44
32
|
get canSend(): boolean;
|
|
45
|
-
onKeyDown(event: KeyboardEvent): void;
|
|
46
|
-
onInput(event: Event): void;
|
|
47
|
-
onSendClick(): void;
|
|
48
33
|
/**
|
|
49
|
-
* Handle
|
|
34
|
+
* Handle value changes from MentionEditorComponent
|
|
50
35
|
*/
|
|
51
|
-
|
|
36
|
+
onValueChange(newValue: string): void;
|
|
52
37
|
/**
|
|
53
|
-
*
|
|
54
|
-
* Uses viewport-relative positioning (fixed) to avoid clipping by parent containers
|
|
38
|
+
* Handle Enter key from MentionEditorComponent
|
|
55
39
|
*/
|
|
56
|
-
|
|
40
|
+
onEnterPressed(_text: string): void;
|
|
57
41
|
/**
|
|
58
|
-
*
|
|
42
|
+
* Handle mention selection from MentionEditorComponent
|
|
59
43
|
*/
|
|
60
44
|
onMentionSelected(suggestion: MentionSuggestion): void;
|
|
61
45
|
/**
|
|
62
|
-
*
|
|
46
|
+
* Send the message
|
|
47
|
+
*/
|
|
48
|
+
onSendClick(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Handle clicks on the container - focus the mention editor
|
|
51
|
+
* Only moves cursor to end if clicking outside the contentEditable area
|
|
63
52
|
*/
|
|
64
|
-
|
|
53
|
+
onContainerClick(event: MouseEvent): void;
|
|
65
54
|
/**
|
|
66
|
-
*
|
|
55
|
+
* Public method to focus the input programmatically
|
|
67
56
|
*/
|
|
68
57
|
focus(): void;
|
|
69
58
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessageInputBoxComponent, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-input-box.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/message/message-input-box.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAa,
|
|
1
|
+
{"version":3,"file":"message-input-box.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/message/message-input-box.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAa,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;;AAE7E;;;;;;;;;;;;;;GAcG;AACH,qBAKa,wBAAwB;IACP,aAAa,CAAC,EAAE,sBAAsB,CAAC;IAE1D,WAAW,EAAE,MAAM,CAAsD;IACzE,QAAQ,EAAE,OAAO,CAAS;IAC1B,KAAK,EAAE,MAAM,CAAM;IACnB,kBAAkB,EAAE,OAAO,CAAS;IACpC,cAAc,EAAE,OAAO,CAAQ;IAC/B,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,IAAI,EAAE,MAAM,CAAK;IAEhB,aAAa,uBAA8B;IAC3C,WAAW,uBAA8B;IAEnD,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;OAEG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKrC;;OAEG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAInC;;OAEG;IACH,iBAAiB,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAMtD;;OAEG;IACH,WAAW,IAAI,IAAI;IASnB;;;OAGG;IACH,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IA6BzC;;OAEG;IACH,KAAK,IAAI,IAAI;yCA1FF,wBAAwB;2CAAxB,wBAAwB;CAgGpC"}
|
|
@@ -1,26 +1,16 @@
|
|
|
1
1
|
import { Component, Input, Output, EventEmitter, ViewChild } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
import * as i1 from "
|
|
4
|
-
import * as i2 from "
|
|
5
|
-
|
|
6
|
-
import * as i4 from "../mention/mention-dropdown.component";
|
|
7
|
-
const _c0 = ["messageTextarea"];
|
|
8
|
-
function MessageInputBoxComponent_mj_mention_dropdown_6_Template(rf, ctx) { if (rf & 1) {
|
|
9
|
-
const _r2 = i0.ɵɵgetCurrentView();
|
|
10
|
-
i0.ɵɵelementStart(0, "mj-mention-dropdown", 7);
|
|
11
|
-
i0.ɵɵlistener("suggestionSelected", function MessageInputBoxComponent_mj_mention_dropdown_6_Template_mj_mention_dropdown_suggestionSelected_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onMentionSelected($event)); })("closed", function MessageInputBoxComponent_mj_mention_dropdown_6_Template_mj_mention_dropdown_closed_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.closeMentionDropdown()); });
|
|
12
|
-
i0.ɵɵelementEnd();
|
|
13
|
-
} if (rf & 2) {
|
|
14
|
-
const ctx_r2 = i0.ɵɵnextContext();
|
|
15
|
-
i0.ɵɵproperty("suggestions", ctx_r2.mentionSuggestions)("position", ctx_r2.mentionDropdownPosition)("showAbove", ctx_r2.mentionDropdownShowAbove)("useFixedPositioning", true)("visible", true);
|
|
16
|
-
} }
|
|
3
|
+
import * as i1 from "@angular/forms";
|
|
4
|
+
import * as i2 from "../mention/mention-editor.component";
|
|
5
|
+
const _c0 = ["mentionEditor"];
|
|
17
6
|
/**
|
|
18
7
|
* Reusable message input box component (presentational)
|
|
8
|
+
* Now uses MentionEditorComponent for rich @mention functionality with chips
|
|
9
|
+
*
|
|
19
10
|
* Handles:
|
|
20
|
-
* - Text input with keyboard shortcuts
|
|
21
|
-
* - @mention autocomplete (
|
|
11
|
+
* - Text input with keyboard shortcuts via MentionEditorComponent
|
|
12
|
+
* - @mention autocomplete with visual chips (contentEditable)
|
|
22
13
|
* - Send button
|
|
23
|
-
* - Character count (optional)
|
|
24
14
|
*
|
|
25
15
|
* Does NOT handle:
|
|
26
16
|
* - Saving messages to database
|
|
@@ -29,7 +19,7 @@ function MessageInputBoxComponent_mj_mention_dropdown_6_Template(rf, ctx) { if (
|
|
|
29
19
|
* - Conversation management
|
|
30
20
|
*/
|
|
31
21
|
export class MessageInputBoxComponent {
|
|
32
|
-
|
|
22
|
+
mentionEditor;
|
|
33
23
|
placeholder = 'Type your message to start a new conversation...';
|
|
34
24
|
disabled = false;
|
|
35
25
|
value = '';
|
|
@@ -39,199 +29,111 @@ export class MessageInputBoxComponent {
|
|
|
39
29
|
rows = 3;
|
|
40
30
|
textSubmitted = new EventEmitter();
|
|
41
31
|
valueChange = new EventEmitter();
|
|
42
|
-
messageTextarea;
|
|
43
|
-
// Mention autocomplete state
|
|
44
|
-
showMentionDropdown = false;
|
|
45
|
-
mentionSuggestions = [];
|
|
46
|
-
mentionDropdownPosition = { top: 0, left: 0 };
|
|
47
|
-
mentionDropdownShowAbove = false;
|
|
48
|
-
mentionStartIndex = -1;
|
|
49
|
-
mentionQuery = '';
|
|
50
|
-
constructor(mentionAutocomplete) {
|
|
51
|
-
this.mentionAutocomplete = mentionAutocomplete;
|
|
52
|
-
}
|
|
53
|
-
async ngOnInit() {
|
|
54
|
-
// Initialize mention autocomplete if enabled and currentUser is available
|
|
55
|
-
if (this.enableMentions && this.currentUser) {
|
|
56
|
-
await this.mentionAutocomplete.initialize(this.currentUser);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
ngAfterViewInit() {
|
|
60
|
-
// Auto-focus the textarea
|
|
61
|
-
setTimeout(() => {
|
|
62
|
-
this.messageTextarea?.nativeElement?.focus();
|
|
63
|
-
}, 100);
|
|
64
|
-
}
|
|
65
|
-
ngOnDestroy() {
|
|
66
|
-
// Cleanup if needed
|
|
67
|
-
}
|
|
68
32
|
get canSend() {
|
|
69
33
|
return !this.disabled && this.value.trim().length > 0;
|
|
70
34
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
// Enter alone: Send message
|
|
78
|
-
if (event.key === 'Enter' && !event.shiftKey && !this.showMentionDropdown) {
|
|
79
|
-
event.preventDefault();
|
|
80
|
-
this.onSendClick();
|
|
81
|
-
}
|
|
82
|
-
// Shift+Enter: Allow default behavior (add newline)
|
|
83
|
-
}
|
|
84
|
-
onInput(event) {
|
|
85
|
-
const textarea = event.target;
|
|
86
|
-
this.value = textarea.value;
|
|
35
|
+
/**
|
|
36
|
+
* Handle value changes from MentionEditorComponent
|
|
37
|
+
*/
|
|
38
|
+
onValueChange(newValue) {
|
|
39
|
+
this.value = newValue;
|
|
87
40
|
this.valueChange.emit(this.value);
|
|
88
|
-
// Handle @mention autocomplete
|
|
89
|
-
if (this.enableMentions && this.currentUser) {
|
|
90
|
-
this.handleMentionInput();
|
|
91
|
-
}
|
|
92
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Handle Enter key from MentionEditorComponent
|
|
44
|
+
*/
|
|
45
|
+
onEnterPressed(_text) {
|
|
46
|
+
this.onSendClick();
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Handle mention selection from MentionEditorComponent
|
|
50
|
+
*/
|
|
51
|
+
onMentionSelected(suggestion) {
|
|
52
|
+
// MentionEditorComponent already inserts the mention chip
|
|
53
|
+
// This is just for additional tracking/analytics if needed
|
|
54
|
+
console.log('[MessageInputBox] Mention selected:', suggestion);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Send the message
|
|
58
|
+
*/
|
|
93
59
|
onSendClick() {
|
|
94
60
|
if (this.canSend) {
|
|
95
61
|
const textToSend = this.value.trim();
|
|
96
62
|
this.textSubmitted.emit(textToSend);
|
|
97
63
|
this.value = ''; // Clear input after sending
|
|
98
64
|
this.valueChange.emit(this.value);
|
|
99
|
-
this.closeMentionDropdown();
|
|
100
65
|
}
|
|
101
66
|
}
|
|
102
67
|
/**
|
|
103
|
-
* Handle
|
|
68
|
+
* Handle clicks on the container - focus the mention editor
|
|
69
|
+
* Only moves cursor to end if clicking outside the contentEditable area
|
|
104
70
|
*/
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
|
|
71
|
+
onContainerClick(event) {
|
|
72
|
+
const target = event.target;
|
|
73
|
+
// Don't handle clicks on the send button
|
|
74
|
+
if (target.closest('.send-button-icon')) {
|
|
108
75
|
return;
|
|
109
76
|
}
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
// Find the last @ before cursor
|
|
113
|
-
const lastAtIndex = textBeforeCursor.lastIndexOf('@');
|
|
114
|
-
if (lastAtIndex === -1) {
|
|
115
|
-
this.closeMentionDropdown();
|
|
77
|
+
const editor = this.mentionEditor?.editorRef?.nativeElement;
|
|
78
|
+
if (!editor)
|
|
116
79
|
return;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const textAfterAt = textBeforeCursor.substring(lastAtIndex + 1);
|
|
120
|
-
if (textAfterAt.includes(' ')) {
|
|
121
|
-
this.closeMentionDropdown();
|
|
80
|
+
// If clicking directly on the editor or its children, let the browser handle cursor placement
|
|
81
|
+
if (target === editor || editor.contains(target)) {
|
|
122
82
|
return;
|
|
123
83
|
}
|
|
124
|
-
//
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
else {
|
|
134
|
-
this.closeMentionDropdown();
|
|
84
|
+
// Only if clicking on the container (empty space), focus and move cursor to end
|
|
85
|
+
editor.focus();
|
|
86
|
+
const selection = window.getSelection();
|
|
87
|
+
const range = document.createRange();
|
|
88
|
+
if (selection) {
|
|
89
|
+
range.selectNodeContents(editor);
|
|
90
|
+
range.collapse(false); // Collapse to end
|
|
91
|
+
selection.removeAllRanges();
|
|
92
|
+
selection.addRange(range);
|
|
135
93
|
}
|
|
136
94
|
}
|
|
137
95
|
/**
|
|
138
|
-
*
|
|
139
|
-
* Uses viewport-relative positioning (fixed) to avoid clipping by parent containers
|
|
140
|
-
*/
|
|
141
|
-
positionMentionDropdown() {
|
|
142
|
-
const textarea = this.messageTextarea?.nativeElement;
|
|
143
|
-
if (!textarea)
|
|
144
|
-
return;
|
|
145
|
-
const textareaRect = textarea.getBoundingClientRect();
|
|
146
|
-
// Check if there's enough space below the textarea
|
|
147
|
-
const spaceBelow = window.innerHeight - textareaRect.bottom;
|
|
148
|
-
const spaceAbove = textareaRect.top;
|
|
149
|
-
const dropdownHeight = Math.min(this.mentionSuggestions.length * 48, 240);
|
|
150
|
-
this.mentionDropdownShowAbove = spaceBelow < dropdownHeight && spaceAbove > spaceBelow;
|
|
151
|
-
// Use viewport-relative coordinates (dropdown will be positioned fixed to viewport)
|
|
152
|
-
if (this.mentionDropdownShowAbove) {
|
|
153
|
-
// Show above the textarea - anchor to top of textarea
|
|
154
|
-
this.mentionDropdownPosition = {
|
|
155
|
-
top: textareaRect.top + window.scrollY - 4,
|
|
156
|
-
left: textareaRect.left + window.scrollX
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
// Show below the textarea (default) - anchor to bottom of textarea
|
|
161
|
-
this.mentionDropdownPosition = {
|
|
162
|
-
top: textareaRect.bottom + window.scrollY + 4,
|
|
163
|
-
left: textareaRect.left + window.scrollX
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Insert selected mention into text
|
|
169
|
-
*/
|
|
170
|
-
onMentionSelected(suggestion) {
|
|
171
|
-
const textarea = this.messageTextarea?.nativeElement;
|
|
172
|
-
if (!textarea)
|
|
173
|
-
return;
|
|
174
|
-
const beforeMention = this.value.substring(0, this.mentionStartIndex);
|
|
175
|
-
const afterCursor = this.value.substring(textarea.selectionStart);
|
|
176
|
-
// Insert mention with @ prefix and space after
|
|
177
|
-
this.value = `${beforeMention}@${suggestion.name} ${afterCursor}`;
|
|
178
|
-
this.valueChange.emit(this.value);
|
|
179
|
-
// Close dropdown
|
|
180
|
-
this.closeMentionDropdown();
|
|
181
|
-
// Restore focus and set cursor position
|
|
182
|
-
setTimeout(() => {
|
|
183
|
-
const newCursorPos = this.mentionStartIndex + suggestion.name.length + 2; // +2 for @ and space
|
|
184
|
-
textarea.focus();
|
|
185
|
-
textarea.setSelectionRange(newCursorPos, newCursorPos);
|
|
186
|
-
}, 0);
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Close mention dropdown
|
|
190
|
-
*/
|
|
191
|
-
closeMentionDropdown() {
|
|
192
|
-
this.showMentionDropdown = false;
|
|
193
|
-
this.mentionSuggestions = [];
|
|
194
|
-
this.mentionStartIndex = -1;
|
|
195
|
-
this.mentionQuery = '';
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Focus the input
|
|
96
|
+
* Public method to focus the input programmatically
|
|
199
97
|
*/
|
|
200
98
|
focus() {
|
|
201
|
-
this.
|
|
99
|
+
const editor = this.mentionEditor?.editorRef?.nativeElement;
|
|
100
|
+
if (editor) {
|
|
101
|
+
editor.focus();
|
|
102
|
+
}
|
|
202
103
|
}
|
|
203
|
-
static ɵfac = function MessageInputBoxComponent_Factory(t) { return new (t || MessageInputBoxComponent)(
|
|
104
|
+
static ɵfac = function MessageInputBoxComponent_Factory(t) { return new (t || MessageInputBoxComponent)(); };
|
|
204
105
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MessageInputBoxComponent, selectors: [["mj-message-input-box"]], viewQuery: function MessageInputBoxComponent_Query(rf, ctx) { if (rf & 1) {
|
|
205
106
|
i0.ɵɵviewQuery(_c0, 5);
|
|
206
107
|
} if (rf & 2) {
|
|
207
108
|
let _t;
|
|
208
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.
|
|
209
|
-
} }, inputs: { placeholder: "placeholder", disabled: "disabled", value: "value", showCharacterCount: "showCharacterCount", enableMentions: "enableMentions", currentUser: "currentUser", rows: "rows" }, outputs: { textSubmitted: "textSubmitted", valueChange: "valueChange" }, decls:
|
|
109
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.mentionEditor = _t.first);
|
|
110
|
+
} }, inputs: { placeholder: "placeholder", disabled: "disabled", value: "value", showCharacterCount: "showCharacterCount", enableMentions: "enableMentions", currentUser: "currentUser", rows: "rows" }, outputs: { textSubmitted: "textSubmitted", valueChange: "valueChange" }, decls: 6, vars: 6, consts: [["mentionEditor", ""], [1, "message-input-box-container", 3, "click"], [1, "input-wrapper"], [3, "ngModelChange", "valueChange", "enterPressed", "mentionSelected", "placeholder", "disabled", "currentUser", "enableMentions", "ngModel"], ["title", "Send message (Enter)", 1, "send-button-icon", 3, "click", "disabled"], [1, "fa-solid", "fa-paper-plane"]], template: function MessageInputBoxComponent_Template(rf, ctx) { if (rf & 1) {
|
|
210
111
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
211
|
-
i0.ɵɵelementStart(0, "div", 1)
|
|
212
|
-
i0.ɵɵ
|
|
213
|
-
i0.ɵɵ
|
|
112
|
+
i0.ɵɵelementStart(0, "div", 1);
|
|
113
|
+
i0.ɵɵlistener("click", function MessageInputBoxComponent_Template_div_click_0_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onContainerClick($event)); });
|
|
114
|
+
i0.ɵɵelementStart(1, "div", 2)(2, "mj-mention-editor", 3, 0);
|
|
115
|
+
i0.ɵɵtwoWayListener("ngModelChange", function MessageInputBoxComponent_Template_mj_mention_editor_ngModelChange_2_listener($event) { i0.ɵɵrestoreView(_r1); i0.ɵɵtwoWayBindingSet(ctx.value, $event) || (ctx.value = $event); return i0.ɵɵresetView($event); });
|
|
116
|
+
i0.ɵɵlistener("valueChange", function MessageInputBoxComponent_Template_mj_mention_editor_valueChange_2_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onValueChange($event)); })("enterPressed", function MessageInputBoxComponent_Template_mj_mention_editor_enterPressed_2_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onEnterPressed($event)); })("mentionSelected", function MessageInputBoxComponent_Template_mj_mention_editor_mentionSelected_2_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onMentionSelected($event)); });
|
|
214
117
|
i0.ɵɵelementEnd();
|
|
215
118
|
i0.ɵɵelementStart(4, "button", 4);
|
|
216
119
|
i0.ɵɵlistener("click", function MessageInputBoxComponent_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onSendClick()); });
|
|
217
120
|
i0.ɵɵelement(5, "i", 5);
|
|
218
|
-
i0.ɵɵelementEnd()();
|
|
219
|
-
i0.ɵɵtemplate(6, MessageInputBoxComponent_mj_mention_dropdown_6_Template, 1, 5, "mj-mention-dropdown", 6);
|
|
220
|
-
i0.ɵɵelementEnd();
|
|
121
|
+
i0.ɵɵelementEnd()()();
|
|
221
122
|
} if (rf & 2) {
|
|
222
123
|
i0.ɵɵadvance(2);
|
|
124
|
+
i0.ɵɵproperty("placeholder", ctx.placeholder)("disabled", ctx.disabled)("currentUser", ctx.currentUser)("enableMentions", ctx.enableMentions);
|
|
223
125
|
i0.ɵɵtwoWayProperty("ngModel", ctx.value);
|
|
224
|
-
i0.ɵɵproperty("disabled", ctx.disabled)("placeholder", ctx.placeholder)("rows", ctx.rows);
|
|
225
126
|
i0.ɵɵadvance(2);
|
|
226
127
|
i0.ɵɵproperty("disabled", !ctx.canSend);
|
|
227
|
-
|
|
228
|
-
i0.ɵɵproperty("ngIf", ctx.showMentionDropdown && ctx.enableMentions);
|
|
229
|
-
} }, dependencies: [i2.NgIf, i3.DefaultValueAccessor, i3.NgControlStatus, i3.NgModel, i4.MentionDropdownComponent], styles: [".message-input-box-container[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n background: white;\n border: 2px solid var(--border-color, #e0e0e0);\n border-radius: 12px;\n box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);\n transition: all 0.2s ease;\n overflow: visible; // Allow mention dropdown to escape container\n position: relative;\n\n &:focus-within {\n border-color: var(--primary-color, #007bff);\n box-shadow: 0 4px 16px rgba(0, 123, 255, 0.15);\n }\n}\n\n.input-wrapper[_ngcontent-%COMP%] {\n position: relative;\n display: flex;\n align-items: flex-end; // Align send button to bottom\n}\n\n.message-input-box-textarea[_ngcontent-%COMP%] {\n flex: 1;\n min-height: 100px;\n padding: 1rem;\n padding-right: 3.5rem; // Space for send button\n border: 0 !important;\n outline: 0 !important;\n box-shadow: none !important;\n -webkit-appearance: none !important;\n -moz-appearance: none !important;\n appearance: none !important;\n font-family: inherit;\n font-size: 1rem;\n line-height: 1.5;\n resize: vertical;\n background: transparent;\n border: 0 !important;\n\n &::placeholder {\n color: var(--text-tertiary, #999);\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n background: var(--background-disabled, #f5f5f5);\n }\n\n &:focus,\n &:active,\n &:focus-visible {\n outline: 0 !important;\n box-shadow: none !important;\n }\n}\n\n.send-button-icon[_ngcontent-%COMP%] {\n position: absolute;\n bottom: 0.75rem;\n right: 0.75rem;\n width: 36px;\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--primary-color, #007bff);\n color: white;\n border: none;\n border-radius: 8px;\n cursor: pointer;\n transition: all 0.2s ease;\n flex-shrink: 0;\n\n i {\n font-size: 1rem;\n }\n\n &:hover:not(:disabled) {\n background: var(--primary-color-dark, #0056b3);\n transform: scale(1.05);\n }\n\n &:active:not(:disabled) {\n transform: scale(0.95);\n }\n\n &:disabled {\n background: var(--background-disabled, #d0d0d0);\n color: var(--text-disabled, #999);\n cursor: not-allowed;\n opacity: 0.5;\n }\n}\n\n\n\n@media (max-width: 768px) {\n .message-input-box-container[_ngcontent-%COMP%] {\n border-radius: 10px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);\n }\n\n .message-input-box-textarea[_ngcontent-%COMP%] {\n min-height: 80px;\n padding: 0.75rem;\n padding-right: 3rem;\n font-size: 16px; // Prevent iOS zoom on focus\n line-height: 1.4;\n }\n\n .send-button-icon[_ngcontent-%COMP%] {\n width: 32px;\n height: 32px;\n bottom: 0.625rem;\n right: 0.625rem;\n border-radius: 6px;\n\n i {\n font-size: 0.875rem;\n }\n }\n}\n\n\n\n@media (max-width: 480px) {\n .message-input-box-container[_ngcontent-%COMP%] {\n border-radius: 8px;\n border-width: 1.5px;\n }\n\n .message-input-box-textarea[_ngcontent-%COMP%] {\n min-height: 60px;\n padding: 0.625rem;\n padding-right: 2.75rem;\n font-size: 16px; // Prevent iOS zoom on focus\n line-height: 1.3;\n }\n\n .send-button-icon[_ngcontent-%COMP%] {\n width: 36px;\n height: 36px;\n bottom: 0.5rem;\n right: 0.5rem;\n border-radius: 6px;\n\n i {\n font-size: 0.875rem;\n }\n }\n}"] });
|
|
128
|
+
} }, dependencies: [i1.NgControlStatus, i1.NgModel, i2.MentionEditorComponent], styles: [".message-input-box-container[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n background: white;\n border: 2px solid var(--border-color, #e0e0e0);\n border-radius: 12px;\n box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);\n transition: all 0.2s ease;\n overflow: visible; // Allow mention dropdown to escape container\n position: relative;\n cursor: text; // Show text cursor for better UX\n\n &:focus-within {\n border-color: var(--primary-color, #007bff);\n box-shadow: 0 4px 16px rgba(0, 123, 255, 0.15);\n }\n}\n\n.input-wrapper[_ngcontent-%COMP%] {\n position: relative;\n display: flex;\n align-items: flex-end; // Align send button to bottom\n padding: 5px; // Add padding around the editor\n\n // Ensure mention editor takes full width\n mj-mention-editor {\n flex: 1;\n display: block;\n }\n}\n\n.message-input-box-textarea[_ngcontent-%COMP%] {\n flex: 1;\n min-height: 100px;\n padding: 1rem;\n padding-right: 3.5rem; // Space for send button\n border: 0 !important;\n outline: 0 !important;\n box-shadow: none !important;\n -webkit-appearance: none !important;\n -moz-appearance: none !important;\n appearance: none !important;\n font-family: inherit;\n font-size: 1rem;\n line-height: 1.5;\n resize: vertical;\n background: transparent;\n border: 0 !important;\n\n &::placeholder {\n color: var(--text-tertiary, #999);\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n background: var(--background-disabled, #f5f5f5);\n }\n\n &:focus,\n &:active,\n &:focus-visible {\n outline: 0 !important;\n box-shadow: none !important;\n }\n}\n\n.send-button-icon[_ngcontent-%COMP%] {\n position: absolute;\n bottom: 0.75rem;\n right: 0.75rem;\n width: 36px;\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--primary-color, #007bff);\n color: white;\n border: none;\n border-radius: 8px;\n cursor: pointer;\n transition: all 0.2s ease;\n flex-shrink: 0;\n\n i {\n font-size: 1rem;\n }\n\n &:hover:not(:disabled) {\n background: var(--primary-color-dark, #0056b3);\n transform: scale(1.05);\n }\n\n &:active:not(:disabled) {\n transform: scale(0.95);\n }\n\n &:disabled {\n background: var(--background-disabled, #d0d0d0);\n color: var(--text-disabled, #999);\n cursor: not-allowed;\n opacity: 0.5;\n }\n}\n\n\n\n@media (max-width: 768px) {\n .message-input-box-container[_ngcontent-%COMP%] {\n border-radius: 10px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);\n }\n\n .message-input-box-textarea[_ngcontent-%COMP%] {\n min-height: 80px;\n padding: 0.75rem;\n padding-right: 3rem;\n font-size: 16px; // Prevent iOS zoom on focus\n line-height: 1.4;\n }\n\n .send-button-icon[_ngcontent-%COMP%] {\n width: 32px;\n height: 32px;\n bottom: 0.625rem;\n right: 0.625rem;\n border-radius: 6px;\n\n i {\n font-size: 0.875rem;\n }\n }\n}\n\n\n\n@media (max-width: 480px) {\n .message-input-box-container[_ngcontent-%COMP%] {\n border-radius: 8px;\n border-width: 1.5px;\n }\n\n .message-input-box-textarea[_ngcontent-%COMP%] {\n min-height: 60px;\n padding: 0.625rem;\n padding-right: 2.75rem;\n font-size: 16px; // Prevent iOS zoom on focus\n line-height: 1.3;\n }\n\n .send-button-icon[_ngcontent-%COMP%] {\n width: 36px;\n height: 36px;\n bottom: 0.5rem;\n right: 0.5rem;\n border-radius: 6px;\n\n i {\n font-size: 0.875rem;\n }\n }\n}"] });
|
|
230
129
|
}
|
|
231
130
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MessageInputBoxComponent, [{
|
|
232
131
|
type: Component,
|
|
233
|
-
args: [{ selector: 'mj-message-input-box', template: "<div class=\"message-input-box-container\">\n <div class=\"input-wrapper\">\n <
|
|
234
|
-
}],
|
|
132
|
+
args: [{ selector: 'mj-message-input-box', template: "<div class=\"message-input-box-container\" (click)=\"onContainerClick($event)\">\n <div class=\"input-wrapper\">\n <mj-mention-editor\n #mentionEditor\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [currentUser]=\"currentUser\"\n [enableMentions]=\"enableMentions\"\n [(ngModel)]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (enterPressed)=\"onEnterPressed($event)\"\n (mentionSelected)=\"onMentionSelected($event)\">\n </mj-mention-editor>\n\n <!-- Send Button (Icon Only) - Positioned over editor -->\n <button\n class=\"send-button-icon\"\n [disabled]=\"!canSend\"\n (click)=\"onSendClick()\"\n title=\"Send message (Enter)\"\n >\n <i class=\"fa-solid fa-paper-plane\"></i>\n </button>\n </div>\n</div>\n", styles: [".message-input-box-container {\n display: flex;\n flex-direction: column;\n background: white;\n border: 2px solid var(--border-color, #e0e0e0);\n border-radius: 12px;\n box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);\n transition: all 0.2s ease;\n overflow: visible; // Allow mention dropdown to escape container\n position: relative;\n cursor: text; // Show text cursor for better UX\n\n &:focus-within {\n border-color: var(--primary-color, #007bff);\n box-shadow: 0 4px 16px rgba(0, 123, 255, 0.15);\n }\n}\n\n.input-wrapper {\n position: relative;\n display: flex;\n align-items: flex-end; // Align send button to bottom\n padding: 5px; // Add padding around the editor\n\n // Ensure mention editor takes full width\n mj-mention-editor {\n flex: 1;\n display: block;\n }\n}\n\n.message-input-box-textarea {\n flex: 1;\n min-height: 100px;\n padding: 1rem;\n padding-right: 3.5rem; // Space for send button\n border: 0 !important;\n outline: 0 !important;\n box-shadow: none !important;\n -webkit-appearance: none !important;\n -moz-appearance: none !important;\n appearance: none !important;\n font-family: inherit;\n font-size: 1rem;\n line-height: 1.5;\n resize: vertical;\n background: transparent;\n border: 0 !important;\n\n &::placeholder {\n color: var(--text-tertiary, #999);\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n background: var(--background-disabled, #f5f5f5);\n }\n\n &:focus,\n &:active,\n &:focus-visible {\n outline: 0 !important;\n box-shadow: none !important;\n }\n}\n\n.send-button-icon {\n position: absolute;\n bottom: 0.75rem;\n right: 0.75rem;\n width: 36px;\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--primary-color, #007bff);\n color: white;\n border: none;\n border-radius: 8px;\n cursor: pointer;\n transition: all 0.2s ease;\n flex-shrink: 0;\n\n i {\n font-size: 1rem;\n }\n\n &:hover:not(:disabled) {\n background: var(--primary-color-dark, #0056b3);\n transform: scale(1.05);\n }\n\n &:active:not(:disabled) {\n transform: scale(0.95);\n }\n\n &:disabled {\n background: var(--background-disabled, #d0d0d0);\n color: var(--text-disabled, #999);\n cursor: not-allowed;\n opacity: 0.5;\n }\n}\n\n/* Mobile adjustments: 481px - 768px */\n@media (max-width: 768px) {\n .message-input-box-container {\n border-radius: 10px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);\n }\n\n .message-input-box-textarea {\n min-height: 80px;\n padding: 0.75rem;\n padding-right: 3rem;\n font-size: 16px; // Prevent iOS zoom on focus\n line-height: 1.4;\n }\n\n .send-button-icon {\n width: 32px;\n height: 32px;\n bottom: 0.625rem;\n right: 0.625rem;\n border-radius: 6px;\n\n i {\n font-size: 0.875rem;\n }\n }\n}\n\n/* Small Phone adjustments: <= 480px */\n@media (max-width: 480px) {\n .message-input-box-container {\n border-radius: 8px;\n border-width: 1.5px;\n }\n\n .message-input-box-textarea {\n min-height: 60px;\n padding: 0.625rem;\n padding-right: 2.75rem;\n font-size: 16px; // Prevent iOS zoom on focus\n line-height: 1.3;\n }\n\n .send-button-icon {\n width: 36px;\n height: 36px;\n bottom: 0.5rem;\n right: 0.5rem;\n border-radius: 6px;\n\n i {\n font-size: 0.875rem;\n }\n }\n}\n"] }]
|
|
133
|
+
}], null, { mentionEditor: [{
|
|
134
|
+
type: ViewChild,
|
|
135
|
+
args: ['mentionEditor']
|
|
136
|
+
}], placeholder: [{
|
|
235
137
|
type: Input
|
|
236
138
|
}], disabled: [{
|
|
237
139
|
type: Input
|
|
@@ -249,9 +151,6 @@ export class MessageInputBoxComponent {
|
|
|
249
151
|
type: Output
|
|
250
152
|
}], valueChange: [{
|
|
251
153
|
type: Output
|
|
252
|
-
}], messageTextarea: [{
|
|
253
|
-
type: ViewChild,
|
|
254
|
-
args: ['messageTextarea']
|
|
255
154
|
}] }); })();
|
|
256
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MessageInputBoxComponent, { className: "MessageInputBoxComponent", filePath: "src/lib/components/message/message-input-box.component.ts", lineNumber:
|
|
155
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MessageInputBoxComponent, { className: "MessageInputBoxComponent", filePath: "src/lib/components/message/message-input-box.component.ts", lineNumber: 26 }); })();
|
|
257
156
|
//# sourceMappingURL=message-input-box.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-input-box.component.js","sourceRoot":"","sources":["../../../../src/lib/components/message/message-input-box.component.ts","../../../../src/lib/components/message/message-input-box.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"message-input-box.component.js","sourceRoot":"","sources":["../../../../src/lib/components/message/message-input-box.component.ts","../../../../src/lib/components/message/message-input-box.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;;;;;AAKlF;;;;;;;;;;;;;;GAcG;AAMH,MAAM,OAAO,wBAAwB;IACP,aAAa,CAA0B;IAE1D,WAAW,GAAW,kDAAkD,CAAC;IACzE,QAAQ,GAAY,KAAK,CAAC;IAC1B,KAAK,GAAW,EAAE,CAAC;IACnB,kBAAkB,GAAY,KAAK,CAAC;IACpC,cAAc,GAAY,IAAI,CAAC;IAC/B,WAAW,CAAY;IACvB,IAAI,GAAW,CAAC,CAAC;IAEhB,aAAa,GAAG,IAAI,YAAY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EjB,WAAW;kBAAnB,KAAK;YACG,QAAQ;kBAAhB,KAAK;YACG,KAAK;kBAAb,KAAK;YACG,kBAAkB;kBAA1B,KAAK;YACG,cAAc;kBAAtB,KAAK;YACG,WAAW;kBAAnB,KAAK;YACG,IAAI;kBAAZ,KAAK;YAEI,aAAa;kBAAtB,MAAM;YACG,WAAW;kBAApB,MAAM;;kFAZI,wBAAwB"}
|
|
@@ -7,10 +7,12 @@ import { ConversationAgentService } from '../../services/conversation-agent.serv
|
|
|
7
7
|
import { ConversationStateService } from '../../services/conversation-state.service';
|
|
8
8
|
import { DataCacheService } from '../../services/data-cache.service';
|
|
9
9
|
import { ActiveTasksService } from '../../services/active-tasks.service';
|
|
10
|
+
import { ConversationStreamingService } from '../../services/conversation-streaming.service';
|
|
10
11
|
import { BaseAgentSuggestedResponse } from '@memberjunction/ai-core-plus';
|
|
11
12
|
import { MentionAutocompleteService } from '../../services/mention-autocomplete.service';
|
|
12
13
|
import { MentionParserService } from '../../services/mention-parser.service';
|
|
13
14
|
import { LazyArtifactInfo } from '../../models/lazy-artifact-info';
|
|
15
|
+
import { MessageInputBoxComponent } from './message-input-box.component';
|
|
14
16
|
import * as i0 from "@angular/core";
|
|
15
17
|
export declare class MessageInputComponent implements OnInit, OnDestroy, OnChanges, AfterViewInit {
|
|
16
18
|
private dialogService;
|
|
@@ -19,6 +21,7 @@ export declare class MessageInputComponent implements OnInit, OnDestroy, OnChang
|
|
|
19
21
|
private conversationState;
|
|
20
22
|
private dataCache;
|
|
21
23
|
private activeTasks;
|
|
24
|
+
private streamingService;
|
|
22
25
|
private mentionParser;
|
|
23
26
|
private mentionAutocomplete;
|
|
24
27
|
private readonly JSON_ARTIFACT_TYPE_ID;
|
|
@@ -33,7 +36,9 @@ export declare class MessageInputComponent implements OnInit, OnDestroy, OnChang
|
|
|
33
36
|
artifactsByDetailId?: Map<string, LazyArtifactInfo[]>;
|
|
34
37
|
systemArtifactsByDetailId?: Map<string, LazyArtifactInfo[]>;
|
|
35
38
|
agentRunsByDetailId?: Map<string, AIAgentRunEntityExtended>;
|
|
36
|
-
|
|
39
|
+
private _inProgressMessageIds?;
|
|
40
|
+
set inProgressMessageIds(value: string[] | undefined);
|
|
41
|
+
get inProgressMessageIds(): string[] | undefined;
|
|
37
42
|
messageSent: EventEmitter<ConversationDetailEntity>;
|
|
38
43
|
agentResponse: EventEmitter<{
|
|
39
44
|
message: ConversationDetailEntity;
|
|
@@ -66,16 +71,15 @@ export declare class MessageInputComponent implements OnInit, OnDestroy, OnChang
|
|
|
66
71
|
}>;
|
|
67
72
|
intentCheckStarted: EventEmitter<void>;
|
|
68
73
|
intentCheckCompleted: EventEmitter<void>;
|
|
69
|
-
inputBox:
|
|
74
|
+
inputBox: MessageInputBoxComponent;
|
|
70
75
|
messageText: string;
|
|
71
76
|
isSending: boolean;
|
|
72
77
|
isProcessing: boolean;
|
|
73
78
|
processingMessage: string;
|
|
74
79
|
converationManagerAgent: AIAgentEntityExtended | null;
|
|
75
|
-
private pushStatusSubscription?;
|
|
76
|
-
private activeTaskExecutionMessageIds;
|
|
77
80
|
private completionTimestamps;
|
|
78
|
-
|
|
81
|
+
private registeredCallbacks;
|
|
82
|
+
constructor(dialogService: DialogService, toastService: ToastService, agentService: ConversationAgentService, conversationState: ConversationStateService, dataCache: DataCacheService, activeTasks: ActiveTasksService, streamingService: ConversationStreamingService, mentionParser: MentionParserService, mentionAutocomplete: MentionAutocompleteService);
|
|
79
83
|
ngOnInit(): Promise<void>;
|
|
80
84
|
ngOnChanges(changes: SimpleChanges): void;
|
|
81
85
|
ngAfterViewInit(): void;
|
|
@@ -85,25 +89,24 @@ export declare class MessageInputComponent implements OnInit, OnDestroy, OnChang
|
|
|
85
89
|
*/
|
|
86
90
|
private focusInput;
|
|
87
91
|
/**
|
|
88
|
-
* Reconnect to in-progress messages for streaming updates
|
|
92
|
+
* Reconnect to in-progress messages for streaming updates via global streaming service.
|
|
89
93
|
* This is called when:
|
|
90
94
|
* 1. Component initializes (ngOnInit)
|
|
91
95
|
* 2. Conversation changes (ngOnChanges)
|
|
92
96
|
* 3. User returns to a conversation with in-progress messages
|
|
97
|
+
* 4. Parent component explicitly triggers reconnection
|
|
93
98
|
*/
|
|
94
|
-
|
|
99
|
+
reconnectInProgressMessages(): void;
|
|
95
100
|
/**
|
|
96
|
-
*
|
|
101
|
+
* Create a progress callback for a specific message ID.
|
|
102
|
+
* This callback will be invoked by the streaming service when progress updates arrive.
|
|
97
103
|
*/
|
|
98
|
-
private
|
|
104
|
+
private createMessageProgressCallback;
|
|
99
105
|
/**
|
|
100
|
-
*
|
|
106
|
+
* Unregister all callbacks registered by this component.
|
|
107
|
+
* Called during cleanup and when switching conversations.
|
|
101
108
|
*/
|
|
102
|
-
private
|
|
103
|
-
/**
|
|
104
|
-
* Update task execution messages in real-time based on progress updates
|
|
105
|
-
*/
|
|
106
|
-
private updateTaskExecutionMessages;
|
|
109
|
+
private unregisterAllCallbacks;
|
|
107
110
|
get canSend(): boolean;
|
|
108
111
|
/**
|
|
109
112
|
* Handle text submitted from the input box
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-input.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/message/message-input.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,
|
|
1
|
+
{"version":3,"file":"message-input.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/message/message-input.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAa,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9I,OAAO,EAAE,QAAQ,EAAY,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAkC,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC1J,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,8BA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