@copilotkitnext/angular 0.0.2 → 0.0.4
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/README.md +3 -3
- package/dist/README.md +3 -3
- package/dist/components/chat/copilot-chat-assistant-message.component.d.ts +10 -10
- package/dist/components/chat/copilot-chat-message-view.component.d.ts +42 -42
- package/dist/components/chat/copilot-chat-view.component.d.ts +14 -14
- package/dist/esm2022/components/chat/copilot-chat-assistant-message-buttons.component.mjs +384 -0
- package/dist/esm2022/components/chat/copilot-chat-assistant-message-renderer.component.mjs +286 -0
- package/dist/esm2022/components/chat/copilot-chat-assistant-message-toolbar.component.mjs +27 -0
- package/dist/esm2022/components/chat/copilot-chat-assistant-message.component.mjs +433 -0
- package/dist/esm2022/components/chat/copilot-chat-assistant-message.types.mjs +2 -0
- package/dist/esm2022/components/chat/copilot-chat-audio-recorder.component.mjs +202 -0
- package/dist/esm2022/components/chat/copilot-chat-buttons.component.mjs +321 -0
- package/dist/esm2022/components/chat/copilot-chat-input-defaults.mjs +38 -0
- package/dist/esm2022/components/chat/copilot-chat-input.component.mjs +666 -0
- package/dist/esm2022/components/chat/copilot-chat-input.types.mjs +10 -0
- package/dist/esm2022/components/chat/copilot-chat-message-view-cursor.component.mjs +45 -0
- package/dist/esm2022/components/chat/copilot-chat-message-view.component.mjs +296 -0
- package/dist/esm2022/components/chat/copilot-chat-message-view.types.mjs +2 -0
- package/dist/esm2022/components/chat/copilot-chat-textarea.component.mjs +188 -0
- package/dist/esm2022/components/chat/copilot-chat-tool-calls-view.component.mjs +216 -0
- package/dist/esm2022/components/chat/copilot-chat-toolbar.component.mjs +25 -0
- package/dist/esm2022/components/chat/copilot-chat-tools-menu.component.mjs +199 -0
- package/dist/esm2022/components/chat/copilot-chat-user-message-branch-navigation.component.mjs +137 -0
- package/dist/esm2022/components/chat/copilot-chat-user-message-buttons.component.mjs +207 -0
- package/dist/esm2022/components/chat/copilot-chat-user-message-renderer.component.mjs +35 -0
- package/dist/esm2022/components/chat/copilot-chat-user-message-toolbar.component.mjs +34 -0
- package/dist/esm2022/components/chat/copilot-chat-user-message.component.mjs +341 -0
- package/dist/esm2022/components/chat/copilot-chat-user-message.types.mjs +2 -0
- package/dist/esm2022/components/chat/copilot-chat-view-disclaimer.component.mjs +52 -0
- package/dist/esm2022/components/chat/copilot-chat-view-feather.component.mjs +55 -0
- package/dist/esm2022/components/chat/copilot-chat-view-handlers.service.mjs +19 -0
- package/dist/esm2022/components/chat/copilot-chat-view-input-container.component.mjs +110 -0
- package/dist/esm2022/components/chat/copilot-chat-view-scroll-to-bottom-button.component.mjs +93 -0
- package/dist/esm2022/components/chat/copilot-chat-view-scroll-view.component.mjs +443 -0
- package/dist/esm2022/components/chat/copilot-chat-view.component.mjs +479 -0
- package/dist/esm2022/components/chat/copilot-chat-view.types.mjs +2 -0
- package/dist/esm2022/components/chat/copilot-chat.component.mjs +214 -0
- package/dist/esm2022/components/copilotkit-tool-render.component.mjs +153 -0
- package/dist/esm2022/copilotkitnext-angular.mjs +5 -0
- package/dist/esm2022/core/chat-configuration/chat-configuration.providers.mjs +65 -0
- package/dist/esm2022/core/chat-configuration/chat-configuration.service.mjs +145 -0
- package/dist/esm2022/core/chat-configuration/chat-configuration.types.mjs +26 -0
- package/dist/esm2022/core/copilotkit.providers.mjs +34 -0
- package/dist/esm2022/core/copilotkit.service.mjs +430 -0
- package/dist/esm2022/core/copilotkit.types.mjs +12 -0
- package/dist/esm2022/directives/copilotkit-agent-context.directive.mjs +130 -0
- package/dist/esm2022/directives/copilotkit-agent.directive.mjs +217 -0
- package/dist/esm2022/directives/copilotkit-chat-config.directive.mjs +218 -0
- package/dist/esm2022/directives/copilotkit-config.directive.mjs +94 -0
- package/dist/esm2022/directives/copilotkit-frontend-tool.directive.mjs +130 -0
- package/dist/esm2022/directives/copilotkit-human-in-the-loop.directive.mjs +266 -0
- package/dist/esm2022/directives/stick-to-bottom.directive.mjs +181 -0
- package/dist/esm2022/index.mjs +70 -0
- package/dist/esm2022/lib/directives/tooltip.directive.mjs +211 -0
- package/dist/esm2022/lib/slots/copilot-slot.component.mjs +144 -0
- package/dist/esm2022/lib/slots/slot.types.mjs +6 -0
- package/dist/esm2022/lib/slots/slot.utils.mjs +222 -0
- package/dist/esm2022/lib/utils.mjs +10 -0
- package/dist/esm2022/services/resize-observer.service.mjs +152 -0
- package/dist/esm2022/services/scroll-position.service.mjs +124 -0
- package/dist/esm2022/types/frontend-tool.mjs +2 -0
- package/dist/esm2022/types/human-in-the-loop.mjs +2 -0
- package/dist/esm2022/utils/agent-context.utils.mjs +114 -0
- package/dist/esm2022/utils/agent.utils.mjs +204 -0
- package/dist/esm2022/utils/chat-config.utils.mjs +186 -0
- package/dist/esm2022/utils/copilotkit.utils.mjs +20 -0
- package/dist/esm2022/utils/frontend-tool.utils.mjs +228 -0
- package/dist/esm2022/utils/human-in-the-loop.utils.mjs +296 -0
- package/dist/fesm2022/copilotkitnext-angular.mjs +163 -164
- package/dist/fesm2022/copilotkitnext-angular.mjs.map +1 -1
- package/package.json +21 -18
- package/vitest.config.mts +32 -21
- package/.turbo/turbo-build.log +0 -38
- package/.turbo/turbo-check-types.log +0 -0
- package/.turbo/turbo-test.log +0 -71
- package/ng-package.json +0 -19
- package/src/components/chat/__tests__/copilot-chat-assistant-message.component.spec.ts +0 -282
- package/src/components/chat/__tests__/copilot-chat-input.component.spec.ts +0 -419
- package/src/components/chat/__tests__/copilot-chat-message-view.component.spec.ts +0 -372
- package/src/components/chat/__tests__/copilot-chat-user-message.component.spec.ts +0 -249
- package/src/components/chat/copilot-chat-assistant-message-buttons.component.ts +0 -292
- package/src/components/chat/copilot-chat-assistant-message-renderer.component.ts +0 -472
- package/src/components/chat/copilot-chat-assistant-message-toolbar.component.ts +0 -29
- package/src/components/chat/copilot-chat-assistant-message.component.ts +0 -463
- package/src/components/chat/copilot-chat-assistant-message.types.ts +0 -50
- package/src/components/chat/copilot-chat-audio-recorder.component.ts +0 -241
- package/src/components/chat/copilot-chat-buttons.component.ts +0 -308
- package/src/components/chat/copilot-chat-buttons.component.ts.bak +0 -471
- package/src/components/chat/copilot-chat-input-defaults.ts +0 -47
- package/src/components/chat/copilot-chat-input.component.ts +0 -512
- package/src/components/chat/copilot-chat-input.types.ts +0 -148
- package/src/components/chat/copilot-chat-message-view-cursor.component.ts +0 -51
- package/src/components/chat/copilot-chat-message-view.component.ts +0 -233
- package/src/components/chat/copilot-chat-message-view.types.ts +0 -39
- package/src/components/chat/copilot-chat-textarea.component.ts +0 -220
- package/src/components/chat/copilot-chat-tool-calls-view.component.ts +0 -261
- package/src/components/chat/copilot-chat-toolbar.component.ts +0 -35
- package/src/components/chat/copilot-chat-tools-menu.component.ts +0 -185
- package/src/components/chat/copilot-chat-user-message-branch-navigation.component.ts +0 -121
- package/src/components/chat/copilot-chat-user-message-buttons.component.ts +0 -170
- package/src/components/chat/copilot-chat-user-message-renderer.component.ts +0 -37
- package/src/components/chat/copilot-chat-user-message-toolbar.component.ts +0 -37
- package/src/components/chat/copilot-chat-user-message.component.ts +0 -247
- package/src/components/chat/copilot-chat-user-message.types.ts +0 -42
- package/src/components/chat/copilot-chat-view-disclaimer.component.ts +0 -51
- package/src/components/chat/copilot-chat-view-feather.component.ts +0 -47
- package/src/components/chat/copilot-chat-view-handlers.service.ts +0 -14
- package/src/components/chat/copilot-chat-view-input-container.component.ts +0 -87
- package/src/components/chat/copilot-chat-view-scroll-to-bottom-button.component.ts +0 -79
- package/src/components/chat/copilot-chat-view-scroll-view.component.ts +0 -322
- package/src/components/chat/copilot-chat-view.component.ts +0 -420
- package/src/components/chat/copilot-chat-view.types.ts +0 -52
- package/src/components/chat/copilot-chat.component.ts +0 -232
- package/src/components/copilotkit-tool-render.component.ts +0 -169
- package/src/core/__tests__/copilotkit.service.spec.ts +0 -1051
- package/src/core/__tests__/copilotkit.service.wildcard.spec.ts +0 -316
- package/src/core/chat-configuration/__tests__/chat-configuration.service.spec.ts +0 -287
- package/src/core/chat-configuration/chat-configuration.providers.ts +0 -71
- package/src/core/chat-configuration/chat-configuration.service.ts +0 -162
- package/src/core/chat-configuration/chat-configuration.types.ts +0 -57
- package/src/core/copilotkit.providers.ts +0 -59
- package/src/core/copilotkit.service.ts +0 -542
- package/src/core/copilotkit.types.ts +0 -132
- package/src/directives/__tests__/copilotkit-agent-context.directive.spec.ts +0 -384
- package/src/directives/__tests__/copilotkit-agent.directive.spec.ts +0 -253
- package/src/directives/__tests__/copilotkit-chat-config.directive.spec.ts +0 -385
- package/src/directives/__tests__/copilotkit-config.directive.spec.ts +0 -69
- package/src/directives/__tests__/copilotkit-frontend-tool-simple.directive.spec.ts +0 -60
- package/src/directives/__tests__/copilotkit-frontend-tool.directive.spec.ts +0 -108
- package/src/directives/__tests__/copilotkit-human-in-the-loop.directive.spec.ts +0 -452
- package/src/directives/copilotkit-agent-context.directive.ts +0 -138
- package/src/directives/copilotkit-agent.directive.ts +0 -225
- package/src/directives/copilotkit-chat-config.directive.ts +0 -241
- package/src/directives/copilotkit-config.directive.ts +0 -81
- package/src/directives/copilotkit-frontend-tool.directive.ts +0 -145
- package/src/directives/copilotkit-human-in-the-loop.directive.ts +0 -281
- package/src/directives/stick-to-bottom.directive.ts +0 -204
- package/src/index.ts +0 -105
- package/src/lib/directives/tooltip.directive.ts +0 -292
- package/src/lib/slots/__tests__/slot.utils.spec.ts +0 -377
- package/src/lib/slots/copilot-slot.component.ts +0 -135
- package/src/lib/slots/index.ts +0 -3
- package/src/lib/slots/slot.types.ts +0 -64
- package/src/lib/slots/slot.utils.ts +0 -289
- package/src/lib/utils.ts +0 -10
- package/src/public-api.ts +0 -1
- package/src/services/resize-observer.service.ts +0 -181
- package/src/services/scroll-position.service.ts +0 -169
- package/src/styles/globals.css +0 -266
- package/src/styles/index.css +0 -3
- package/src/test-setup.ts +0 -15
- package/src/testing/index.ts +0 -3
- package/src/testing/testing.utils.ts +0 -248
- package/src/types/frontend-tool.ts +0 -44
- package/src/types/human-in-the-loop.ts +0 -52
- package/src/utils/__tests__/agent.utils.spec.ts +0 -234
- package/src/utils/__tests__/chat-config.utils.spec.ts +0 -306
- package/src/utils/__tests__/frontend-tool-inject.spec.ts +0 -350
- package/src/utils/__tests__/frontend-tool-integration.spec.ts +0 -199
- package/src/utils/__tests__/frontend-tool.utils.spec.ts +0 -272
- package/src/utils/__tests__/human-in-the-loop.utils.spec.ts +0 -365
- package/src/utils/agent-context.utils.ts +0 -133
- package/src/utils/agent.utils.ts +0 -239
- package/src/utils/chat-config.utils.ts +0 -221
- package/src/utils/copilotkit.utils.ts +0 -20
- package/src/utils/frontend-tool.utils.ts +0 -266
- package/src/utils/human-in-the-loop.utils.ts +0 -359
- package/tsconfig.spec.json +0 -12
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Component,
|
|
3
|
-
Input,
|
|
4
|
-
Output,
|
|
5
|
-
EventEmitter,
|
|
6
|
-
signal,
|
|
7
|
-
computed,
|
|
8
|
-
ChangeDetectionStrategy,
|
|
9
|
-
ViewEncapsulation,
|
|
10
|
-
inject
|
|
11
|
-
} from '@angular/core';
|
|
12
|
-
import { CommonModule } from '@angular/common';
|
|
13
|
-
import { LucideAngularModule, Copy, Check, ThumbsUp, ThumbsDown, Volume2, RefreshCw } from 'lucide-angular';
|
|
14
|
-
import { CopilotTooltipDirective } from '../../lib/directives/tooltip.directive';
|
|
15
|
-
import { CopilotChatConfigurationService } from '../../core/chat-configuration/chat-configuration.service';
|
|
16
|
-
import { cn } from '../../lib/utils';
|
|
17
|
-
|
|
18
|
-
// Base toolbar button component
|
|
19
|
-
@Component({
|
|
20
|
-
selector: 'button[copilotChatAssistantMessageToolbarButton]',
|
|
21
|
-
standalone: true,
|
|
22
|
-
imports: [CommonModule],
|
|
23
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
24
|
-
encapsulation: ViewEncapsulation.None,
|
|
25
|
-
template: `
|
|
26
|
-
<ng-content></ng-content>
|
|
27
|
-
`,
|
|
28
|
-
host: {
|
|
29
|
-
'[class]': 'computedClass()',
|
|
30
|
-
'[attr.disabled]': 'disabled ? true : null',
|
|
31
|
-
'type': 'button',
|
|
32
|
-
'[attr.aria-label]': 'title'
|
|
33
|
-
},
|
|
34
|
-
hostDirectives: [
|
|
35
|
-
{
|
|
36
|
-
directive: CopilotTooltipDirective,
|
|
37
|
-
inputs: ['copilotTooltip: title', 'tooltipPosition', 'tooltipDelay']
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
})
|
|
41
|
-
export class CopilotChatAssistantMessageToolbarButtonComponent {
|
|
42
|
-
@Input() title = '';
|
|
43
|
-
@Input() disabled = false;
|
|
44
|
-
@Input() set inputClass(value: string | undefined) {
|
|
45
|
-
this.customClass.set(value);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
private customClass = signal<string | undefined>(undefined);
|
|
49
|
-
|
|
50
|
-
computedClass = computed(() => {
|
|
51
|
-
return cn(
|
|
52
|
-
// Flex centering with gap (from React button base styles)
|
|
53
|
-
'inline-flex items-center justify-center gap-2',
|
|
54
|
-
// Cursor
|
|
55
|
-
'cursor-pointer',
|
|
56
|
-
// Background and text
|
|
57
|
-
'p-0 text-[rgb(93,93,93)] hover:bg-[#E8E8E8]',
|
|
58
|
-
// Dark mode
|
|
59
|
-
'dark:text-[rgb(243,243,243)] dark:hover:bg-[#303030]',
|
|
60
|
-
// Shape and sizing
|
|
61
|
-
'h-8 w-8 rounded-md',
|
|
62
|
-
// Interactions
|
|
63
|
-
'transition-colors',
|
|
64
|
-
// Hover states
|
|
65
|
-
'hover:text-[rgb(93,93,93)]',
|
|
66
|
-
'dark:hover:text-[rgb(243,243,243)]',
|
|
67
|
-
// Focus states
|
|
68
|
-
'focus:outline-none focus:ring-2 focus:ring-offset-2',
|
|
69
|
-
// Disabled state
|
|
70
|
-
'disabled:opacity-50 disabled:cursor-not-allowed',
|
|
71
|
-
// SVG styling from React Button component
|
|
72
|
-
'[&_svg]:pointer-events-none [&_svg]:shrink-0',
|
|
73
|
-
// Ensure proper sizing
|
|
74
|
-
'shrink-0',
|
|
75
|
-
this.customClass()
|
|
76
|
-
);
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Copy button component
|
|
81
|
-
@Component({
|
|
82
|
-
selector: 'copilot-chat-assistant-message-copy-button',
|
|
83
|
-
standalone: true,
|
|
84
|
-
imports: [CommonModule, LucideAngularModule, CopilotChatAssistantMessageToolbarButtonComponent],
|
|
85
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
86
|
-
encapsulation: ViewEncapsulation.None,
|
|
87
|
-
template: `
|
|
88
|
-
<button
|
|
89
|
-
copilotChatAssistantMessageToolbarButton
|
|
90
|
-
[title]="title || labels.assistantMessageToolbarCopyMessageLabel"
|
|
91
|
-
[disabled]="disabled"
|
|
92
|
-
[inputClass]="inputClass"
|
|
93
|
-
(click)="handleCopy($event)">
|
|
94
|
-
@if (copied()) {
|
|
95
|
-
<lucide-angular [img]="CheckIcon" [size]="18"></lucide-angular>
|
|
96
|
-
} @else {
|
|
97
|
-
<lucide-angular [img]="CopyIcon" [size]="18"></lucide-angular>
|
|
98
|
-
}
|
|
99
|
-
</button>
|
|
100
|
-
`
|
|
101
|
-
})
|
|
102
|
-
export class CopilotChatAssistantMessageCopyButtonComponent {
|
|
103
|
-
@Input() title?: string;
|
|
104
|
-
@Input() disabled = false;
|
|
105
|
-
@Input() inputClass?: string;
|
|
106
|
-
@Input() content?: string;
|
|
107
|
-
@Output() clicked = new EventEmitter<void>();
|
|
108
|
-
|
|
109
|
-
readonly CopyIcon = Copy;
|
|
110
|
-
readonly CheckIcon = Check;
|
|
111
|
-
|
|
112
|
-
copied = signal(false);
|
|
113
|
-
private chatConfig = inject(CopilotChatConfigurationService);
|
|
114
|
-
|
|
115
|
-
get labels() {
|
|
116
|
-
return this.chatConfig.labels();
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
handleCopy(event?: Event): void {
|
|
120
|
-
event?.stopPropagation();
|
|
121
|
-
if (!this.content) return;
|
|
122
|
-
|
|
123
|
-
// Set copied immediately for instant feedback
|
|
124
|
-
this.copied.set(true);
|
|
125
|
-
setTimeout(() => this.copied.set(false), 2000);
|
|
126
|
-
|
|
127
|
-
// Copy to clipboard (fire and forget)
|
|
128
|
-
navigator.clipboard.writeText(this.content).then(
|
|
129
|
-
() => this.clicked.emit(),
|
|
130
|
-
(err) => {
|
|
131
|
-
console.error('Failed to copy message:', err);
|
|
132
|
-
this.copied.set(false);
|
|
133
|
-
}
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// Thumbs up button component
|
|
139
|
-
@Component({
|
|
140
|
-
selector: 'copilot-chat-assistant-message-thumbs-up-button',
|
|
141
|
-
standalone: true,
|
|
142
|
-
imports: [CommonModule, LucideAngularModule, CopilotChatAssistantMessageToolbarButtonComponent],
|
|
143
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
144
|
-
encapsulation: ViewEncapsulation.None,
|
|
145
|
-
template: `
|
|
146
|
-
<button
|
|
147
|
-
copilotChatAssistantMessageToolbarButton
|
|
148
|
-
[title]="title || labels.assistantMessageToolbarThumbsUpLabel"
|
|
149
|
-
[disabled]="disabled"
|
|
150
|
-
[inputClass]="inputClass"
|
|
151
|
-
(click)="handleClick($event)">
|
|
152
|
-
<lucide-angular [img]="ThumbsUpIcon" [size]="18"></lucide-angular>
|
|
153
|
-
</button>
|
|
154
|
-
`
|
|
155
|
-
})
|
|
156
|
-
export class CopilotChatAssistantMessageThumbsUpButtonComponent {
|
|
157
|
-
@Input() title?: string;
|
|
158
|
-
@Input() disabled = false;
|
|
159
|
-
@Input() inputClass?: string;
|
|
160
|
-
@Output() clicked = new EventEmitter<void>();
|
|
161
|
-
|
|
162
|
-
readonly ThumbsUpIcon = ThumbsUp;
|
|
163
|
-
private chatConfig = inject(CopilotChatConfigurationService);
|
|
164
|
-
|
|
165
|
-
get labels() {
|
|
166
|
-
return this.chatConfig.labels();
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
handleClick(event?: Event): void {
|
|
170
|
-
event?.stopPropagation();
|
|
171
|
-
if (!this.disabled) {
|
|
172
|
-
this.clicked.emit();
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// Thumbs down button component
|
|
178
|
-
@Component({
|
|
179
|
-
selector: 'copilot-chat-assistant-message-thumbs-down-button',
|
|
180
|
-
standalone: true,
|
|
181
|
-
imports: [CommonModule, LucideAngularModule, CopilotChatAssistantMessageToolbarButtonComponent],
|
|
182
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
183
|
-
encapsulation: ViewEncapsulation.None,
|
|
184
|
-
template: `
|
|
185
|
-
<button
|
|
186
|
-
copilotChatAssistantMessageToolbarButton
|
|
187
|
-
[title]="title || labels.assistantMessageToolbarThumbsDownLabel"
|
|
188
|
-
[disabled]="disabled"
|
|
189
|
-
[inputClass]="inputClass"
|
|
190
|
-
(click)="handleClick($event)">
|
|
191
|
-
<lucide-angular [img]="ThumbsDownIcon" [size]="18"></lucide-angular>
|
|
192
|
-
</button>
|
|
193
|
-
`
|
|
194
|
-
})
|
|
195
|
-
export class CopilotChatAssistantMessageThumbsDownButtonComponent {
|
|
196
|
-
@Input() title?: string;
|
|
197
|
-
@Input() disabled = false;
|
|
198
|
-
@Input() inputClass?: string;
|
|
199
|
-
@Output() clicked = new EventEmitter<void>();
|
|
200
|
-
|
|
201
|
-
readonly ThumbsDownIcon = ThumbsDown;
|
|
202
|
-
private chatConfig = inject(CopilotChatConfigurationService);
|
|
203
|
-
|
|
204
|
-
get labels() {
|
|
205
|
-
return this.chatConfig.labels();
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
handleClick(event?: Event): void {
|
|
209
|
-
event?.stopPropagation();
|
|
210
|
-
if (!this.disabled) {
|
|
211
|
-
this.clicked.emit();
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
// Read aloud button component
|
|
217
|
-
@Component({
|
|
218
|
-
selector: 'copilot-chat-assistant-message-read-aloud-button',
|
|
219
|
-
standalone: true,
|
|
220
|
-
imports: [CommonModule, LucideAngularModule, CopilotChatAssistantMessageToolbarButtonComponent],
|
|
221
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
222
|
-
encapsulation: ViewEncapsulation.None,
|
|
223
|
-
template: `
|
|
224
|
-
<button
|
|
225
|
-
copilotChatAssistantMessageToolbarButton
|
|
226
|
-
[title]="title || labels.assistantMessageToolbarReadAloudLabel"
|
|
227
|
-
[disabled]="disabled"
|
|
228
|
-
[inputClass]="inputClass"
|
|
229
|
-
(click)="handleClick($event)">
|
|
230
|
-
<lucide-angular [img]="Volume2Icon" [size]="20"></lucide-angular>
|
|
231
|
-
</button>
|
|
232
|
-
`
|
|
233
|
-
})
|
|
234
|
-
export class CopilotChatAssistantMessageReadAloudButtonComponent {
|
|
235
|
-
@Input() title?: string;
|
|
236
|
-
@Input() disabled = false;
|
|
237
|
-
@Input() inputClass?: string;
|
|
238
|
-
@Output() clicked = new EventEmitter<void>();
|
|
239
|
-
|
|
240
|
-
readonly Volume2Icon = Volume2;
|
|
241
|
-
private chatConfig = inject(CopilotChatConfigurationService);
|
|
242
|
-
|
|
243
|
-
get labels() {
|
|
244
|
-
return this.chatConfig.labels();
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
handleClick(event?: Event): void {
|
|
248
|
-
event?.stopPropagation();
|
|
249
|
-
if (!this.disabled) {
|
|
250
|
-
this.clicked.emit();
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// Regenerate button component
|
|
256
|
-
@Component({
|
|
257
|
-
selector: 'copilot-chat-assistant-message-regenerate-button',
|
|
258
|
-
standalone: true,
|
|
259
|
-
imports: [CommonModule, LucideAngularModule, CopilotChatAssistantMessageToolbarButtonComponent],
|
|
260
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
261
|
-
encapsulation: ViewEncapsulation.None,
|
|
262
|
-
template: `
|
|
263
|
-
<button
|
|
264
|
-
copilotChatAssistantMessageToolbarButton
|
|
265
|
-
[title]="title || labels.assistantMessageToolbarRegenerateLabel"
|
|
266
|
-
[disabled]="disabled"
|
|
267
|
-
[inputClass]="inputClass"
|
|
268
|
-
(click)="handleClick($event)">
|
|
269
|
-
<lucide-angular [img]="RefreshCwIcon" [size]="18"></lucide-angular>
|
|
270
|
-
</button>
|
|
271
|
-
`
|
|
272
|
-
})
|
|
273
|
-
export class CopilotChatAssistantMessageRegenerateButtonComponent {
|
|
274
|
-
@Input() title?: string;
|
|
275
|
-
@Input() disabled = false;
|
|
276
|
-
@Input() inputClass?: string;
|
|
277
|
-
@Output() clicked = new EventEmitter<void>();
|
|
278
|
-
|
|
279
|
-
readonly RefreshCwIcon = RefreshCw;
|
|
280
|
-
private chatConfig = inject(CopilotChatConfigurationService);
|
|
281
|
-
|
|
282
|
-
get labels() {
|
|
283
|
-
return this.chatConfig.labels();
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
handleClick(event?: Event): void {
|
|
287
|
-
event?.stopPropagation();
|
|
288
|
-
if (!this.disabled) {
|
|
289
|
-
this.clicked.emit();
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|