@progress/kendo-angular-conversational-ui 21.1.1-develop.2 → 21.2.0-develop.10
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/chat.component.d.ts +2 -0
- package/chat/message-list.component.d.ts +2 -2
- package/codemods/utils.js +805 -394
- package/codemods/v20/chat-user.js +9 -12
- package/codemods/v21/chat-messagetoolbarvisibility.js +9 -13
- package/codemods/v21/chat-pinnedbyfield.js +1 -2
- package/esm2022/ai-prompt/aiprompt.component.mjs +155 -139
- package/esm2022/ai-prompt/common/output-card.component.mjs +81 -83
- package/esm2022/ai-prompt/common/toolbar-focusable.directive.mjs +2 -2
- package/esm2022/ai-prompt/views/output-view.component.mjs +27 -29
- package/esm2022/ai-prompt/views/prompt-view.component.mjs +150 -135
- package/esm2022/chat/attachment.component.mjs +53 -37
- package/esm2022/chat/cards/hero-card.component.mjs +48 -35
- package/esm2022/chat/chat-file.component.mjs +32 -29
- package/esm2022/chat/chat-view.mjs +2 -2
- package/esm2022/chat/chat.component.mjs +259 -242
- package/esm2022/chat/message-attachments.component.mjs +60 -55
- package/esm2022/chat/message-box.component.mjs +203 -183
- package/esm2022/chat/message-list.component.mjs +249 -209
- package/esm2022/chat/message-reference-content.component.mjs +30 -19
- package/esm2022/chat/message.component.mjs +301 -281
- package/esm2022/chat/suggested-actions.component.mjs +142 -134
- package/esm2022/inline-ai-prompt/inlineaiprompt-content.component.mjs +205 -179
- package/esm2022/package-metadata.mjs +2 -2
- package/fesm2022/progress-kendo-angular-conversational-ui.mjs +1988 -1777
- package/package.json +14 -14
- package/codemods/template-transformer/index.js +0 -93
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
6
6
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
7
7
|
import { Component, ElementRef, EventEmitter, forwardRef, HostBinding, Input, Output, QueryList, ViewChildren, ViewChild, NgZone, Renderer2 } from '@angular/core';
|
|
8
|
-
import {
|
|
8
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
9
9
|
import { Subscription } from 'rxjs';
|
|
10
10
|
import { take } from 'rxjs/operators';
|
|
11
|
-
import { Keys,
|
|
11
|
+
import { Keys, normalizeKeys } from '@progress/kendo-angular-common';
|
|
12
12
|
import { ChatItem } from './chat-item';
|
|
13
13
|
import { ChatSuggestionTemplateDirective } from './templates/suggestion-template.directive';
|
|
14
14
|
import { ChatService } from './common/chat.service';
|
|
@@ -161,13 +161,13 @@ export class SuggestedActionsComponent extends ChatItem {
|
|
|
161
161
|
this.activeIndex = apply ? index : -1;
|
|
162
162
|
}
|
|
163
163
|
actionKeydown(e, action) {
|
|
164
|
-
const handler = this.actionKeyHandlers[
|
|
164
|
+
const handler = this.actionKeyHandlers[normalizeKeys(e)];
|
|
165
165
|
if (handler) {
|
|
166
166
|
handler(e, action);
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
suggestionKeydown(e, suggestion) {
|
|
170
|
-
const handler = this.suggestionKeyHandlers[
|
|
170
|
+
const handler = this.suggestionKeyHandlers[normalizeKeys(e)];
|
|
171
171
|
if (handler) {
|
|
172
172
|
handler(e, suggestion);
|
|
173
173
|
}
|
|
@@ -206,96 +206,100 @@ export class SuggestedActionsComponent extends ChatItem {
|
|
|
206
206
|
this.selectedIndex = Math.max(0, Math.min(prevIndex + offset, this.items.length - 1));
|
|
207
207
|
}
|
|
208
208
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SuggestedActionsComponent, deps: [{ token: i1.ChatService }, { token: i2.LocalizationService }, { token: i3.SuggestionsScrollService }, { token: i0.NgZone }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
209
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
209
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SuggestedActionsComponent, isStandalone: true, selector: "kendo-chat-suggested-actions", inputs: { actions: "actions", suggestions: "suggestions", tabbable: "tabbable", type: "type", suggestionTemplate: "suggestionTemplate" }, outputs: { dispatchAction: "dispatchAction", dispatchSuggestion: "dispatchSuggestion" }, host: { properties: { "class.k-suggestion-group": "this.defaultClass", "class.k-suggestion-group-scrollable": "this.scrollableClass", "class.k-suggestion-scrollwrap": "this.scrollButtonsClass", "attr.role": "this.role" } }, providers: [{
|
|
210
210
|
provide: ChatItem,
|
|
211
211
|
useExisting: forwardRef(() => SuggestedActionsComponent)
|
|
212
212
|
},
|
|
213
213
|
SuggestionsScrollService
|
|
214
214
|
], viewQueries: [{ propertyName: "suggestionsContainer", first: true, predicate: ["suggestionsContainer"], descendants: true, read: ElementRef }, { propertyName: "prevScrollButton", first: true, predicate: ["prevScrollButton"], descendants: true, read: ElementRef }, { propertyName: "nextScrollButton", first: true, predicate: ["nextScrollButton"], descendants: true, read: ElementRef }, { propertyName: "items", predicate: ["item"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
@if (hasScrollButtons) {
|
|
216
|
+
<span
|
|
217
217
|
#prevScrollButton
|
|
218
218
|
kendoChatScrollableButton
|
|
219
219
|
[prev]="true"
|
|
220
220
|
[title]="getScrollButtonTitle('prev')"
|
|
221
221
|
class="k-button k-button-md k-button-solid k-button-solid-base k-rounded-md k-icon-button"
|
|
222
222
|
(onClick)="scrollSuggestions($event)"
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
223
|
+
>
|
|
224
|
+
</span>
|
|
225
|
+
}
|
|
226
|
+
@if (hasScrollButtons) {
|
|
227
|
+
<div class="k-suggestion-group"
|
|
226
228
|
#suggestionsContainer
|
|
227
229
|
role="group"
|
|
228
230
|
(scroll)="onScroll($event)">
|
|
229
231
|
<ng-container *ngTemplateOutlet="suggestionsContent"></ng-container>
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
232
|
+
</div>
|
|
233
|
+
} @else {
|
|
234
|
+
<ng-container *ngTemplateOutlet="suggestionsContent"></ng-container>
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
|
|
236
238
|
<ng-template #suggestionsContent>
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
239
|
+
@if (actions) {
|
|
240
|
+
@for (action of actions; track action; let index = $index; let first = $first; let last = $last) {
|
|
241
|
+
<span
|
|
242
|
+
#item
|
|
243
|
+
class="k-suggestion k-suggestion-primary"
|
|
244
|
+
role="button"
|
|
245
|
+
[class.k-selected]="isSelected(index)"
|
|
246
|
+
[class.k-focus]="isSelected(index)"
|
|
247
|
+
[class.k-active]="isActive(index)"
|
|
248
|
+
[attr.tabindex]="0"
|
|
249
|
+
(click)="actionClick(action, index)"
|
|
250
|
+
(keydown)="actionKeydown($event, action)"
|
|
251
|
+
(mousedown)="toggleActiveState(true, index)"
|
|
252
|
+
(mouseup)="toggleActiveState(false, index)"
|
|
251
253
|
>
|
|
252
|
-
|
|
254
|
+
{{ action.title || action.value }}
|
|
255
|
+
</span>
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
@if (suggestions) {
|
|
260
|
+
@if (!suggestionTemplate?.templateRef) {
|
|
261
|
+
@for (suggestion of suggestions; track suggestion; let index = $index; let first = $first; let last = $last) {
|
|
262
|
+
<span
|
|
263
|
+
#item
|
|
264
|
+
class="k-suggestion"
|
|
265
|
+
role="button"
|
|
266
|
+
[class.k-selected]="isSelected(index)"
|
|
267
|
+
[class.k-focus]="isSelected(index)"
|
|
268
|
+
[class.k-active]="isActive(index)"
|
|
269
|
+
[attr.tabindex]="0"
|
|
270
|
+
(click)="suggestionClick(suggestion, index)"
|
|
271
|
+
(keydown)="suggestionKeydown($event, suggestion)"
|
|
272
|
+
(mousedown)="toggleActiveState(true, index)"
|
|
273
|
+
(mouseup)="toggleActiveState(false, index)"
|
|
274
|
+
>
|
|
275
|
+
{{ suggestion.text }}
|
|
253
276
|
</span>
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
[attr.tabindex]="0"
|
|
267
|
-
(click)="suggestionClick(suggestion, index)"
|
|
268
|
-
(keydown)="suggestionKeydown($event, suggestion)"
|
|
269
|
-
(mousedown)="toggleActiveState(true, index)"
|
|
270
|
-
(mouseup)="toggleActiveState(false, index)"
|
|
271
|
-
>
|
|
272
|
-
{{ suggestion.text }}
|
|
273
|
-
</span>
|
|
274
|
-
</ng-container>
|
|
275
|
-
|
|
276
|
-
<ng-container *ngIf="suggestionTemplate?.templateRef">
|
|
277
|
-
<ng-container *ngFor="let suggestion of suggestions">
|
|
278
|
-
<ng-template
|
|
279
|
-
[ngTemplateOutlet]="suggestionTemplate.templateRef"
|
|
280
|
-
[ngTemplateOutletContext]="{ $implicit: suggestion }"
|
|
281
|
-
>
|
|
282
|
-
</ng-template>
|
|
283
|
-
</ng-container>
|
|
284
|
-
</ng-container>
|
|
285
|
-
</ng-container>
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
@if (suggestionTemplate?.templateRef) {
|
|
280
|
+
@for (suggestion of suggestions; track suggestion) {
|
|
281
|
+
<ng-template
|
|
282
|
+
[ngTemplateOutlet]="suggestionTemplate.templateRef"
|
|
283
|
+
[ngTemplateOutletContext]="{ $implicit: suggestion }"
|
|
284
|
+
>
|
|
285
|
+
</ng-template>
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
286
289
|
</ng-template>
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
+
|
|
291
|
+
@if (hasScrollButtons) {
|
|
292
|
+
<span
|
|
290
293
|
#nextScrollButton
|
|
291
294
|
kendoChatScrollableButton
|
|
292
295
|
[prev]="false"
|
|
293
296
|
[title]="getScrollButtonTitle('next')"
|
|
294
297
|
class="k-button k-button-md k-button-solid k-button-solid-base k-rounded-md k-icon-button"
|
|
295
298
|
(onClick)="scrollSuggestions($event)"
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
+
>
|
|
300
|
+
</span>
|
|
301
|
+
}
|
|
302
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ChatScrollableButtonComponent, selector: "[kendoChatScrollableButton]", inputs: ["prev"], outputs: ["onClick"] }] });
|
|
299
303
|
}
|
|
300
304
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SuggestedActionsComponent, decorators: [{
|
|
301
305
|
type: Component,
|
|
@@ -307,92 +311,96 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
307
311
|
},
|
|
308
312
|
SuggestionsScrollService],
|
|
309
313
|
template: `
|
|
310
|
-
|
|
311
|
-
|
|
314
|
+
@if (hasScrollButtons) {
|
|
315
|
+
<span
|
|
312
316
|
#prevScrollButton
|
|
313
317
|
kendoChatScrollableButton
|
|
314
318
|
[prev]="true"
|
|
315
319
|
[title]="getScrollButtonTitle('prev')"
|
|
316
320
|
class="k-button k-button-md k-button-solid k-button-solid-base k-rounded-md k-icon-button"
|
|
317
321
|
(onClick)="scrollSuggestions($event)"
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
322
|
+
>
|
|
323
|
+
</span>
|
|
324
|
+
}
|
|
325
|
+
@if (hasScrollButtons) {
|
|
326
|
+
<div class="k-suggestion-group"
|
|
321
327
|
#suggestionsContainer
|
|
322
328
|
role="group"
|
|
323
329
|
(scroll)="onScroll($event)">
|
|
324
330
|
<ng-container *ngTemplateOutlet="suggestionsContent"></ng-container>
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
+
</div>
|
|
332
|
+
} @else {
|
|
333
|
+
<ng-container *ngTemplateOutlet="suggestionsContent"></ng-container>
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
|
|
331
337
|
<ng-template #suggestionsContent>
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
338
|
+
@if (actions) {
|
|
339
|
+
@for (action of actions; track action; let index = $index; let first = $first; let last = $last) {
|
|
340
|
+
<span
|
|
341
|
+
#item
|
|
342
|
+
class="k-suggestion k-suggestion-primary"
|
|
343
|
+
role="button"
|
|
344
|
+
[class.k-selected]="isSelected(index)"
|
|
345
|
+
[class.k-focus]="isSelected(index)"
|
|
346
|
+
[class.k-active]="isActive(index)"
|
|
347
|
+
[attr.tabindex]="0"
|
|
348
|
+
(click)="actionClick(action, index)"
|
|
349
|
+
(keydown)="actionKeydown($event, action)"
|
|
350
|
+
(mousedown)="toggleActiveState(true, index)"
|
|
351
|
+
(mouseup)="toggleActiveState(false, index)"
|
|
346
352
|
>
|
|
347
|
-
|
|
353
|
+
{{ action.title || action.value }}
|
|
354
|
+
</span>
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
@if (suggestions) {
|
|
359
|
+
@if (!suggestionTemplate?.templateRef) {
|
|
360
|
+
@for (suggestion of suggestions; track suggestion; let index = $index; let first = $first; let last = $last) {
|
|
361
|
+
<span
|
|
362
|
+
#item
|
|
363
|
+
class="k-suggestion"
|
|
364
|
+
role="button"
|
|
365
|
+
[class.k-selected]="isSelected(index)"
|
|
366
|
+
[class.k-focus]="isSelected(index)"
|
|
367
|
+
[class.k-active]="isActive(index)"
|
|
368
|
+
[attr.tabindex]="0"
|
|
369
|
+
(click)="suggestionClick(suggestion, index)"
|
|
370
|
+
(keydown)="suggestionKeydown($event, suggestion)"
|
|
371
|
+
(mousedown)="toggleActiveState(true, index)"
|
|
372
|
+
(mouseup)="toggleActiveState(false, index)"
|
|
373
|
+
>
|
|
374
|
+
{{ suggestion.text }}
|
|
348
375
|
</span>
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
[attr.tabindex]="0"
|
|
362
|
-
(click)="suggestionClick(suggestion, index)"
|
|
363
|
-
(keydown)="suggestionKeydown($event, suggestion)"
|
|
364
|
-
(mousedown)="toggleActiveState(true, index)"
|
|
365
|
-
(mouseup)="toggleActiveState(false, index)"
|
|
366
|
-
>
|
|
367
|
-
{{ suggestion.text }}
|
|
368
|
-
</span>
|
|
369
|
-
</ng-container>
|
|
370
|
-
|
|
371
|
-
<ng-container *ngIf="suggestionTemplate?.templateRef">
|
|
372
|
-
<ng-container *ngFor="let suggestion of suggestions">
|
|
373
|
-
<ng-template
|
|
374
|
-
[ngTemplateOutlet]="suggestionTemplate.templateRef"
|
|
375
|
-
[ngTemplateOutletContext]="{ $implicit: suggestion }"
|
|
376
|
-
>
|
|
377
|
-
</ng-template>
|
|
378
|
-
</ng-container>
|
|
379
|
-
</ng-container>
|
|
380
|
-
</ng-container>
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
@if (suggestionTemplate?.templateRef) {
|
|
379
|
+
@for (suggestion of suggestions; track suggestion) {
|
|
380
|
+
<ng-template
|
|
381
|
+
[ngTemplateOutlet]="suggestionTemplate.templateRef"
|
|
382
|
+
[ngTemplateOutletContext]="{ $implicit: suggestion }"
|
|
383
|
+
>
|
|
384
|
+
</ng-template>
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
381
388
|
</ng-template>
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
389
|
+
|
|
390
|
+
@if (hasScrollButtons) {
|
|
391
|
+
<span
|
|
385
392
|
#nextScrollButton
|
|
386
393
|
kendoChatScrollableButton
|
|
387
394
|
[prev]="false"
|
|
388
395
|
[title]="getScrollButtonTitle('next')"
|
|
389
396
|
class="k-button k-button-md k-button-solid k-button-solid-base k-rounded-md k-icon-button"
|
|
390
397
|
(onClick)="scrollSuggestions($event)"
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
398
|
+
>
|
|
399
|
+
</span>
|
|
400
|
+
}
|
|
401
|
+
`,
|
|
394
402
|
standalone: true,
|
|
395
|
-
imports: [
|
|
403
|
+
imports: [NgTemplateOutlet, ChatScrollableButtonComponent]
|
|
396
404
|
}]
|
|
397
405
|
}], ctorParameters: () => [{ type: i1.ChatService }, { type: i2.LocalizationService }, { type: i3.SuggestionsScrollService }, { type: i0.NgZone }, { type: i0.Renderer2 }], propDecorators: { defaultClass: [{
|
|
398
406
|
type: HostBinding,
|