@progress/kendo-angular-conversational-ui 19.3.0-develop.4 → 19.3.0-develop.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/ai-prompt/aiprompt.component.d.ts +80 -13
  2. package/ai-prompt/aiprompt.module.d.ts +3 -1
  3. package/ai-prompt/common/aiprompt.service.d.ts +10 -0
  4. package/ai-prompt/common/output-card.component.d.ts +4 -0
  5. package/ai-prompt/localization/messages.d.ts +5 -1
  6. package/ai-prompt/models/ai-prompt-settings.d.ts +60 -0
  7. package/ai-prompt/models/index.d.ts +1 -0
  8. package/ai-prompt/templates/aiprompt-output-body-template.directive.d.ts +24 -0
  9. package/ai-prompt/templates/aiprompt-output-template.directive.d.ts +24 -0
  10. package/ai-prompt/views/output-view.component.d.ts +4 -0
  11. package/ai-prompt/views/prompt-view.component.d.ts +23 -1
  12. package/chat/message-attachments.component.d.ts +1 -1
  13. package/conversational-ui.module.d.ts +12 -7
  14. package/directives.d.ts +25 -2
  15. package/esm2022/ai-prompt/aiprompt.component.mjs +177 -25
  16. package/esm2022/ai-prompt/aiprompt.module.mjs +3 -1
  17. package/esm2022/ai-prompt/common/aiprompt.service.mjs +35 -0
  18. package/esm2022/ai-prompt/common/output-card.component.mjs +23 -5
  19. package/esm2022/ai-prompt/common/toolbar-focusable.directive.mjs +4 -3
  20. package/esm2022/ai-prompt/localization/messages.mjs +7 -1
  21. package/esm2022/ai-prompt/models/ai-prompt-settings.mjs +5 -0
  22. package/esm2022/ai-prompt/templates/aiprompt-output-body-template.directive.mjs +33 -0
  23. package/esm2022/ai-prompt/templates/aiprompt-output-template.directive.mjs +33 -0
  24. package/esm2022/ai-prompt/views/output-view.component.mjs +27 -11
  25. package/esm2022/ai-prompt/views/prompt-view.component.mjs +139 -21
  26. package/esm2022/chat/message-attachments.component.mjs +3 -2
  27. package/esm2022/chat/message-box.component.mjs +3 -3
  28. package/esm2022/chat/message-list.component.mjs +4 -2
  29. package/esm2022/chat/suggested-actions.component.mjs +2 -2
  30. package/esm2022/conversational-ui.module.mjs +13 -8
  31. package/esm2022/directives.mjs +32 -2
  32. package/esm2022/index.mjs +7 -0
  33. package/esm2022/inline-ai-prompt/inlineaiprompt-content.component.mjs +522 -0
  34. package/esm2022/inline-ai-prompt/inlineaiprompt.component.mjs +349 -0
  35. package/esm2022/inline-ai-prompt/inlineaiprompt.service.mjs +85 -0
  36. package/esm2022/inline-ai-prompt/localization/custom-messages.component.mjs +53 -0
  37. package/esm2022/inline-ai-prompt/localization/localized-messages.directive.mjs +39 -0
  38. package/esm2022/inline-ai-prompt/localization/messages.mjs +35 -0
  39. package/esm2022/inline-ai-prompt/models/command.interface.mjs +5 -0
  40. package/esm2022/inline-ai-prompt/models/index.mjs +5 -0
  41. package/esm2022/inline-ai-prompt/models/inlineaiprompt-popupsettings.mjs +5 -0
  42. package/esm2022/inline-ai-prompt/models/inlineaiprompt-settings.mjs +59 -0
  43. package/esm2022/inline-ai-prompt/models/messages.mjs +8 -0
  44. package/esm2022/inline-ai-prompt/models/output-action-click-event.mjs +5 -0
  45. package/esm2022/inline-ai-prompt/models/output-action.interface.mjs +5 -0
  46. package/esm2022/inline-ai-prompt/models/prompt-output.interface.mjs +5 -0
  47. package/esm2022/inline-ai-prompt/models/prompt-request-event.mjs +5 -0
  48. package/esm2022/inline-ai-prompt/output-template.directive.mjs +38 -0
  49. package/esm2022/inline-ai-prompt/utils.mjs +57 -0
  50. package/esm2022/package-metadata.mjs +2 -2
  51. package/fesm2022/progress-kendo-angular-conversational-ui.mjs +1735 -147
  52. package/index.d.ts +7 -0
  53. package/inline-ai-prompt/inlineaiprompt-content.component.d.ts +82 -0
  54. package/inline-ai-prompt/inlineaiprompt.component.d.ts +157 -0
  55. package/inline-ai-prompt/inlineaiprompt.service.d.ts +41 -0
  56. package/inline-ai-prompt/localization/custom-messages.component.d.ts +27 -0
  57. package/inline-ai-prompt/localization/localized-messages.directive.d.ts +16 -0
  58. package/inline-ai-prompt/localization/messages.d.ts +25 -0
  59. package/inline-ai-prompt/models/command.interface.d.ts +38 -0
  60. package/inline-ai-prompt/models/index.d.ts +12 -0
  61. package/inline-ai-prompt/models/inlineaiprompt-popupsettings.d.ts +10 -0
  62. package/inline-ai-prompt/models/inlineaiprompt-settings.d.ts +66 -0
  63. package/inline-ai-prompt/models/messages.d.ts +21 -0
  64. package/inline-ai-prompt/models/output-action-click-event.d.ts +19 -0
  65. package/inline-ai-prompt/models/output-action.interface.d.ts +52 -0
  66. package/inline-ai-prompt/models/prompt-output.interface.d.ts +25 -0
  67. package/inline-ai-prompt/models/prompt-request-event.d.ts +17 -0
  68. package/inline-ai-prompt/output-template.directive.d.ts +27 -0
  69. package/inline-ai-prompt/utils.d.ts +17 -0
  70. package/package.json +13 -12
@@ -0,0 +1,349 @@
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 { Component, ContentChild, ElementRef, EventEmitter, Input, NgZone, Output, ViewChild, ViewContainerRef, } from '@angular/core';
6
+ import { Subscription } from 'rxjs';
7
+ import { validatePackage } from '@progress/kendo-licensing';
8
+ import { packageMetadata } from '../package-metadata';
9
+ import { InlineAIPromptContentComponent } from './inlineaiprompt-content.component';
10
+ import { KENDO_POPUP, PopupComponent } from '@progress/kendo-angular-popup';
11
+ import { take } from 'rxjs/operators';
12
+ import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
13
+ import { defaultPopupSettings, calculateMeasurement, defaultOutputActions } from './utils';
14
+ import { LocalizedMessagesDirective } from './localization/localized-messages.directive';
15
+ import { InlineAIPromptOutputTemplateDirective } from './output-template.directive';
16
+ import * as i0 from "@angular/core";
17
+ import * as i1 from "@progress/kendo-angular-popup";
18
+ /**
19
+ * Represents the Kendo UI InlineAIPrompt component for Angular.
20
+ *
21
+ * @remarks
22
+ * Supported children components are: {@link InlineAIPromptCustomMessagesComponent}
23
+ *
24
+ * @example
25
+ * ```html
26
+ * <kendo-inlineaiprompt
27
+ * placeholder="Enter your prompt..."
28
+ * [promptOutput]="promptOutput"
29
+ * (promptRequest)="onPromptRequest($event)">
30
+ * </kendo-inlineaiprompt>
31
+ * ```
32
+ */
33
+ export class InlineAIPromptComponent {
34
+ ngZone;
35
+ element;
36
+ /**
37
+ * Sets the text of the TextArea.
38
+ */
39
+ promptValue = "";
40
+ /**
41
+ * Sets the placeholder text that appears in the text area when it is empty.
42
+ */
43
+ placeholder;
44
+ /**
45
+ * Sets the output data for the prompt.
46
+ * The output displays as a card above the text area.
47
+ */
48
+ promptOutput;
49
+ /**
50
+ * Controls the visibility and settings of the Speech to Text button.
51
+ *
52
+ * @default true
53
+ */
54
+ enableSpeechToText = true;
55
+ /**
56
+ * Sets the streaming state of the component.
57
+ * When set to `true`, the send button displays a generating state and the component emits a `promptRequestCancel` event when you click it.
58
+ *
59
+ * @default false
60
+ */
61
+ streaming = false;
62
+ /**
63
+ * Sets the width of the component.
64
+ * Accepts a number for pixels or a string for other units.
65
+ *
66
+ * @default 550
67
+ */
68
+ width = 550;
69
+ /**
70
+ * Sets the maximum height of the component.
71
+ * Accepts a number for pixels or a string for other units.
72
+ */
73
+ maxHeight;
74
+ /**
75
+ * Represents the configuration of the default output actions.
76
+ * The default actions are `copy`, `retry`, and `discard`.
77
+ */
78
+ defaultOutputActions = defaultOutputActions;
79
+ /**
80
+ * Sets the output actions that display in the output card.
81
+ * The default actions are `copy`, `retry`, and `discard`.
82
+ * To customize the appearance and order of the default actions, define them with the same `name`.
83
+ *
84
+ * @default [{ name: 'copy', type: 'button', icon: 'copy', svgIcon: copyIcon, text: 'Copy', fillMode: 'flat', themeColor: 'primary', rounded: 'medium'}, { name: 'retry', type: 'button', icon: 'arrow-rotate-cw', svgIcon: arrowRotateCwIcon, text: 'Retry', fillMode: 'flat', themeColor: 'primary', rounded: 'medium'}, { name: 'discard', type: 'button', icon: 'cancel-outline', svgIcon: cancelOutlineIcon, text: 'Discard', fillMode: 'flat', themeColor: 'base', rounded: 'medium'}]
85
+ */
86
+ outputActions = defaultOutputActions;
87
+ /**
88
+ * Sets the available prompt commands.
89
+ */
90
+ promptCommands;
91
+ /**
92
+ * Sets the popup settings for the component.
93
+ */
94
+ set popupSettings(settings) {
95
+ this._popupSettings = { ...defaultPopupSettings, ...settings };
96
+ }
97
+ get popupSettings() {
98
+ return this._popupSettings;
99
+ }
100
+ /**
101
+ * Fires when you click the send button.
102
+ */
103
+ promptRequest = new EventEmitter();
104
+ /**
105
+ * Fires when you click a command.
106
+ */
107
+ commandExecute = new EventEmitter();
108
+ /**
109
+ * Fires when you click an output action button.
110
+ */
111
+ outputActionClick = new EventEmitter();
112
+ /**
113
+ * Fires when you cancel the prompt request by clicking the stop button.
114
+ */
115
+ promptRequestCancel = new EventEmitter();
116
+ /**
117
+ * Fires when the component closes, either by clicking outside the popup, clicking the Discard action, or after pressing the Escape key.
118
+ */
119
+ close = new EventEmitter();
120
+ /**
121
+ * Fires when the value of the TextArea changes.
122
+ */
123
+ promptValueChange = new EventEmitter();
124
+ popupElement;
125
+ popupViewContainer;
126
+ contentComponent;
127
+ outputTemplate;
128
+ /**
129
+ * @hidden
130
+ */
131
+ calculateMeasurement = calculateMeasurement;
132
+ _popupSettings = defaultPopupSettings;
133
+ subs = new Subscription();
134
+ constructor(ngZone, element) {
135
+ this.ngZone = ngZone;
136
+ this.element = element;
137
+ validatePackage(packageMetadata);
138
+ }
139
+ ngAfterViewInit() {
140
+ if (this.contentComponent && this.popupElement) {
141
+ this.contentComponent.popupElement = this.popupElement;
142
+ }
143
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => {
144
+ if (this.contentComponent && this.popupViewContainer) {
145
+ this.contentComponent.appendTo = this.popupViewContainer;
146
+ }
147
+ });
148
+ }
149
+ ngOnDestroy() {
150
+ this.subs.unsubscribe();
151
+ }
152
+ /**
153
+ * Focuses the TextArea of the Inline AI Prompt.
154
+ */
155
+ focus() {
156
+ if (this.contentComponent?.textArea) {
157
+ this.contentComponent.textArea.focus();
158
+ }
159
+ }
160
+ /**
161
+ * @hidden
162
+ */
163
+ onPromptRequest(event) {
164
+ this.promptRequest.emit(event);
165
+ }
166
+ /**
167
+ * @hidden
168
+ */
169
+ onCommandExecute(event) {
170
+ this.commandExecute.emit(event);
171
+ }
172
+ /**
173
+ * @hidden
174
+ */
175
+ onOutputActionClick(event) {
176
+ this.outputActionClick.emit(event);
177
+ }
178
+ /**
179
+ * @hidden
180
+ */
181
+ onPromptRequestCancel() {
182
+ this.promptRequestCancel.emit();
183
+ }
184
+ /**
185
+ * @hidden
186
+ */
187
+ onClose() {
188
+ this.close.emit();
189
+ }
190
+ /**
191
+ * @hidden
192
+ */
193
+ onPromptValueChange(value) {
194
+ this.promptValueChange.emit(value);
195
+ }
196
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InlineAIPromptComponent, deps: [{ token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
197
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: InlineAIPromptComponent, isStandalone: true, selector: "kendo-inlineaiprompt", inputs: { promptValue: "promptValue", placeholder: "placeholder", promptOutput: "promptOutput", enableSpeechToText: "enableSpeechToText", streaming: "streaming", width: "width", maxHeight: "maxHeight", outputActions: "outputActions", promptCommands: "promptCommands", popupSettings: "popupSettings" }, outputs: { promptRequest: "promptRequest", commandExecute: "commandExecute", outputActionClick: "outputActionClick", promptRequestCancel: "promptRequestCancel", close: "close", promptValueChange: "promptValueChange" }, providers: [
198
+ LocalizationService,
199
+ {
200
+ provide: L10N_PREFIX,
201
+ useValue: 'kendo.inlineaiprompt',
202
+ },
203
+ ], queries: [{ propertyName: "outputTemplate", first: true, predicate: InlineAIPromptOutputTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "popupElement", first: true, predicate: PopupComponent, descendants: true, read: ElementRef }, { propertyName: "popupViewContainer", first: true, predicate: PopupComponent, descendants: true, read: ViewContainerRef }, { propertyName: "contentComponent", first: true, predicate: InlineAIPromptContentComponent, descendants: true }], exportAs: ["kendoInlineAIPrompt"], ngImport: i0, template: `
204
+ <ng-container kendoInlineAIPromptLocalizedMessages
205
+ i18n-commandsButtonTitle="kendo.inlineaiprompt.commandsButtonTitle|Sets the Commands button title."
206
+ commandsButtonTitle="Command Menu"
207
+ i18n-generateButtonTitle="kendo.inlineaiprompt.generateButtonTitle|Sets the Generate button title."
208
+ generateButtonTitle="Generate"
209
+ i18n-speechToTextButtonTitle="kendo.inlineaiprompt.speechToTextButtonTitle|Sets the Speech to Text button title."
210
+ speechToTextButtonTitle="Speech to Text"
211
+ >
212
+ </ng-container>
213
+ <kendo-popup
214
+ [style.width]="calculateMeasurement(width)"
215
+ [anchor]="popupSettings?.anchor"
216
+ [anchorAlign]="popupSettings?.anchorAlign"
217
+ [offset]="popupSettings?.offset"
218
+ [popupAlign]="popupSettings?.popupAlign"
219
+ [animate]="popupSettings?.animate"
220
+ [collision]="popupSettings?.collision"
221
+ [positionMode]="popupSettings?.positionMode"
222
+ [margin]="popupSettings?.margin"
223
+ [popupClass]="popupSettings?.popupClass || 'k-prompt-popup'"
224
+ >
225
+ <kendo-inlineaiprompt-content
226
+ [style.width]="width"
227
+ [promptValue]="promptValue"
228
+ [placeholder]="placeholder"
229
+ [promptOutput]="promptOutput"
230
+ [enableSpeechToText]="enableSpeechToText"
231
+ [streaming]="streaming"
232
+ [maxHeight]="maxHeight"
233
+ [outputActions]="outputActions"
234
+ [promptCommands]="promptCommands"
235
+ [outputTemplate]="outputTemplate?.templateRef"
236
+ (promptRequest)="onPromptRequest($event)"
237
+ (commandExecute)="onCommandExecute($event)"
238
+ (outputActionClick)="onOutputActionClick($event)"
239
+ (promptRequestCancel)="onPromptRequestCancel()"
240
+ (close)="onClose()"
241
+ (promptValueChange)="onPromptValueChange($event)"
242
+ >
243
+ </kendo-inlineaiprompt-content>
244
+ </kendo-popup>
245
+ `, isInline: true, dependencies: [{ kind: "component", type: i1.PopupComponent, selector: "kendo-popup", inputs: ["animate", "anchor", "anchorAlign", "collision", "popupAlign", "copyAnchorStyles", "popupClass", "positionMode", "offset", "margin"], outputs: ["anchorViewportLeave", "close", "open", "positionChange"], exportAs: ["kendo-popup"] }, { kind: "component", type: InlineAIPromptContentComponent, selector: "kendo-inlineaiprompt-content", inputs: ["popupElement", "promptValue", "placeholder", "promptOutput", "enableSpeechToText", "streaming", "width", "maxHeight", "appendTo", "outputActions", "promptCommands", "outputTemplate"], outputs: ["promptRequest", "commandExecute", "outputActionClick", "promptRequestCancel", "close", "promptValueChange"], exportAs: ["kendoInlineAIPromptContent"] }, { kind: "directive", type: LocalizedMessagesDirective, selector: "[kendoInlineAIPromptLocalizedMessages]" }] });
246
+ }
247
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InlineAIPromptComponent, decorators: [{
248
+ type: Component,
249
+ args: [{
250
+ exportAs: 'kendoInlineAIPrompt',
251
+ selector: 'kendo-inlineaiprompt',
252
+ providers: [
253
+ LocalizationService,
254
+ {
255
+ provide: L10N_PREFIX,
256
+ useValue: 'kendo.inlineaiprompt',
257
+ },
258
+ ],
259
+ template: `
260
+ <ng-container kendoInlineAIPromptLocalizedMessages
261
+ i18n-commandsButtonTitle="kendo.inlineaiprompt.commandsButtonTitle|Sets the Commands button title."
262
+ commandsButtonTitle="Command Menu"
263
+ i18n-generateButtonTitle="kendo.inlineaiprompt.generateButtonTitle|Sets the Generate button title."
264
+ generateButtonTitle="Generate"
265
+ i18n-speechToTextButtonTitle="kendo.inlineaiprompt.speechToTextButtonTitle|Sets the Speech to Text button title."
266
+ speechToTextButtonTitle="Speech to Text"
267
+ >
268
+ </ng-container>
269
+ <kendo-popup
270
+ [style.width]="calculateMeasurement(width)"
271
+ [anchor]="popupSettings?.anchor"
272
+ [anchorAlign]="popupSettings?.anchorAlign"
273
+ [offset]="popupSettings?.offset"
274
+ [popupAlign]="popupSettings?.popupAlign"
275
+ [animate]="popupSettings?.animate"
276
+ [collision]="popupSettings?.collision"
277
+ [positionMode]="popupSettings?.positionMode"
278
+ [margin]="popupSettings?.margin"
279
+ [popupClass]="popupSettings?.popupClass || 'k-prompt-popup'"
280
+ >
281
+ <kendo-inlineaiprompt-content
282
+ [style.width]="width"
283
+ [promptValue]="promptValue"
284
+ [placeholder]="placeholder"
285
+ [promptOutput]="promptOutput"
286
+ [enableSpeechToText]="enableSpeechToText"
287
+ [streaming]="streaming"
288
+ [maxHeight]="maxHeight"
289
+ [outputActions]="outputActions"
290
+ [promptCommands]="promptCommands"
291
+ [outputTemplate]="outputTemplate?.templateRef"
292
+ (promptRequest)="onPromptRequest($event)"
293
+ (commandExecute)="onCommandExecute($event)"
294
+ (outputActionClick)="onOutputActionClick($event)"
295
+ (promptRequestCancel)="onPromptRequestCancel()"
296
+ (close)="onClose()"
297
+ (promptValueChange)="onPromptValueChange($event)"
298
+ >
299
+ </kendo-inlineaiprompt-content>
300
+ </kendo-popup>
301
+ `,
302
+ standalone: true,
303
+ imports: [KENDO_POPUP, InlineAIPromptContentComponent, LocalizedMessagesDirective],
304
+ }]
305
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ElementRef }]; }, propDecorators: { promptValue: [{
306
+ type: Input
307
+ }], placeholder: [{
308
+ type: Input
309
+ }], promptOutput: [{
310
+ type: Input
311
+ }], enableSpeechToText: [{
312
+ type: Input
313
+ }], streaming: [{
314
+ type: Input
315
+ }], width: [{
316
+ type: Input
317
+ }], maxHeight: [{
318
+ type: Input
319
+ }], outputActions: [{
320
+ type: Input
321
+ }], promptCommands: [{
322
+ type: Input
323
+ }], popupSettings: [{
324
+ type: Input
325
+ }], promptRequest: [{
326
+ type: Output
327
+ }], commandExecute: [{
328
+ type: Output
329
+ }], outputActionClick: [{
330
+ type: Output
331
+ }], promptRequestCancel: [{
332
+ type: Output
333
+ }], close: [{
334
+ type: Output
335
+ }], promptValueChange: [{
336
+ type: Output
337
+ }], popupElement: [{
338
+ type: ViewChild,
339
+ args: [PopupComponent, { read: ElementRef }]
340
+ }], popupViewContainer: [{
341
+ type: ViewChild,
342
+ args: [PopupComponent, { read: ViewContainerRef }]
343
+ }], contentComponent: [{
344
+ type: ViewChild,
345
+ args: [InlineAIPromptContentComponent]
346
+ }], outputTemplate: [{
347
+ type: ContentChild,
348
+ args: [InlineAIPromptOutputTemplateDirective]
349
+ }] } });
@@ -0,0 +1,85 @@
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 { Injectable, ViewContainerRef } from '@angular/core';
6
+ import { PopupService } from '@progress/kendo-angular-popup';
7
+ import { InlineAIPromptContentComponent } from './inlineaiprompt-content.component';
8
+ import { defaultPopupSettings } from './utils';
9
+ import * as i0 from "@angular/core";
10
+ import * as i1 from "@progress/kendo-angular-popup";
11
+ /**
12
+ * Provides a service for opening Inline AI Prompt components dynamically.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * import { InlineAIPromptService } from '@progress/kendo-angular-conversational-ui';
17
+ *
18
+ * constructor(private inlineAIPromptService: InlineAIPromptService) {}
19
+ *
20
+ * openPrompt(anchor: ElementRef) {
21
+ * const promptRef = this.inlineAIPromptService.open({
22
+ * anchor: anchor,
23
+ * placeholder: 'Enter your prompt...'
24
+ * });
25
+ * }
26
+ * ```
27
+ */
28
+ export class InlineAIPromptService {
29
+ popupService;
30
+ constructor(popupService) {
31
+ this.popupService = popupService;
32
+ }
33
+ /**
34
+ * Opens an Inline AI Prompt component in a popup. The popup appears near the specified anchor element or at the provided offset coordinates.
35
+ *
36
+ * @param {InlineAIPromptSettings} options - The options for the InlineAIPromptComponent.
37
+ * @returns {PopupRef} A reference to the popup.
38
+ */
39
+ open(options) {
40
+ const popupSettings = { ...defaultPopupSettings, ...options?.popupSettings };
41
+ const popupRef = this.popupService.open({
42
+ ...(options?.popupSettings?.anchor && { anchor: options.popupSettings.anchor }),
43
+ popupClass: 'k-prompt-popup',
44
+ ...popupSettings,
45
+ content: InlineAIPromptContentComponent,
46
+ });
47
+ const promptInstance = popupRef.content?.instance;
48
+ if (promptInstance) {
49
+ const popupViewContainer = popupRef.popup.injector.get(ViewContainerRef);
50
+ promptInstance.appendTo = popupViewContainer;
51
+ promptInstance.popupElement = popupRef.popupElement;
52
+ this.projectComponentInputs(promptInstance, options);
53
+ if (promptInstance.close) {
54
+ promptInstance.close.subscribe(() => {
55
+ popupRef.close();
56
+ });
57
+ }
58
+ if (popupRef.content.changeDetectorRef) {
59
+ popupRef.content.changeDetectorRef.detectChanges();
60
+ }
61
+ }
62
+ return popupRef;
63
+ }
64
+ /**
65
+ * Projects the input options onto the component instance.
66
+ */
67
+ projectComponentInputs(component, options) {
68
+ if (!options) {
69
+ return component;
70
+ }
71
+ Object.getOwnPropertyNames(options)
72
+ .forEach((prop) => {
73
+ component[prop] = options[prop];
74
+ });
75
+ return component;
76
+ }
77
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InlineAIPromptService, deps: [{ token: i1.PopupService }], target: i0.ɵɵFactoryTarget.Injectable });
78
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InlineAIPromptService, providedIn: 'root' });
79
+ }
80
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InlineAIPromptService, decorators: [{
81
+ type: Injectable,
82
+ args: [{
83
+ providedIn: 'root'
84
+ }]
85
+ }], ctorParameters: function () { return [{ type: i1.PopupService }]; } });
@@ -0,0 +1,53 @@
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 { Component, forwardRef } from '@angular/core';
6
+ import { LocalizationService } from '@progress/kendo-angular-l10n';
7
+ import { Messages } from './messages';
8
+ import * as i0 from "@angular/core";
9
+ import * as i1 from "@progress/kendo-angular-l10n";
10
+ /**
11
+ * Represents the custom messages component of the Inline AI Prompt.
12
+ *
13
+ * Use this component to override default messages for the Inline AI Prompt.
14
+ *
15
+ * @example
16
+ * ```html
17
+ * <kendo-inlineaiprompt-messages
18
+ * commandsButtonTitle="Commands Menu"
19
+ * generateButtonTitle="Generate">
20
+ * </kendo-inlineaiprompt-messages>
21
+ * ```
22
+ */
23
+ export class InlineAIPromptCustomMessagesComponent extends Messages {
24
+ service;
25
+ constructor(service) {
26
+ super();
27
+ this.service = service;
28
+ }
29
+ get override() {
30
+ return true;
31
+ }
32
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InlineAIPromptCustomMessagesComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
33
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: InlineAIPromptCustomMessagesComponent, isStandalone: true, selector: "kendo-inlineaiprompt-messages", providers: [
34
+ {
35
+ provide: Messages,
36
+ useExisting: forwardRef(() => InlineAIPromptCustomMessagesComponent)
37
+ }
38
+ ], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
39
+ }
40
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InlineAIPromptCustomMessagesComponent, decorators: [{
41
+ type: Component,
42
+ args: [{
43
+ providers: [
44
+ {
45
+ provide: Messages,
46
+ useExisting: forwardRef(() => InlineAIPromptCustomMessagesComponent)
47
+ }
48
+ ],
49
+ selector: 'kendo-inlineaiprompt-messages',
50
+ template: ``,
51
+ standalone: true
52
+ }]
53
+ }], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
@@ -0,0 +1,39 @@
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 { Directive, forwardRef } from '@angular/core';
6
+ import { LocalizationService } from '@progress/kendo-angular-l10n';
7
+ import { Messages } from './messages';
8
+ import * as i0 from "@angular/core";
9
+ import * as i1 from "@progress/kendo-angular-l10n";
10
+ /**
11
+ * @hidden
12
+ */
13
+ export class LocalizedMessagesDirective extends Messages {
14
+ service;
15
+ constructor(service) {
16
+ super();
17
+ this.service = service;
18
+ }
19
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LocalizedMessagesDirective, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
20
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: LocalizedMessagesDirective, isStandalone: true, selector: "[kendoInlineAIPromptLocalizedMessages]", providers: [
21
+ {
22
+ provide: Messages,
23
+ useExisting: forwardRef(() => LocalizedMessagesDirective)
24
+ }
25
+ ], usesInheritance: true, ngImport: i0 });
26
+ }
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LocalizedMessagesDirective, decorators: [{
28
+ type: Directive,
29
+ args: [{
30
+ providers: [
31
+ {
32
+ provide: Messages,
33
+ useExisting: forwardRef(() => LocalizedMessagesDirective)
34
+ }
35
+ ],
36
+ selector: '[kendoInlineAIPromptLocalizedMessages]',
37
+ standalone: true
38
+ }]
39
+ }], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
@@ -0,0 +1,35 @@
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 { Directive, Input } from '@angular/core';
6
+ import { ComponentMessages } from '@progress/kendo-angular-l10n';
7
+ import * as i0 from "@angular/core";
8
+ /**
9
+ * @hidden
10
+ */
11
+ export class Messages extends ComponentMessages {
12
+ /**
13
+ * Sets the Commands button title.
14
+ */
15
+ commandsButtonTitle;
16
+ /**
17
+ * Sets the Generate button title.
18
+ */
19
+ generateButtonTitle;
20
+ /**
21
+ * Sets the Speech to Text button title.
22
+ */
23
+ speechToTextButtonTitle;
24
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: Messages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
25
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: Messages, inputs: { commandsButtonTitle: "commandsButtonTitle", generateButtonTitle: "generateButtonTitle", speechToTextButtonTitle: "speechToTextButtonTitle" }, usesInheritance: true, ngImport: i0 });
26
+ }
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: Messages, decorators: [{
28
+ type: Directive
29
+ }], propDecorators: { commandsButtonTitle: [{
30
+ type: Input
31
+ }], generateButtonTitle: [{
32
+ type: Input
33
+ }], speechToTextButtonTitle: [{
34
+ type: Input
35
+ }] } });
@@ -0,0 +1,5 @@
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
+ export {};
@@ -0,0 +1,5 @@
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
+ export { InlineAIPromptSettings } from './inlineaiprompt-settings';
@@ -0,0 +1,5 @@
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
+ export {};
@@ -0,0 +1,59 @@
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
+ /**
6
+ * Defines the settings for opening an Inline AI Prompt through the `InlineAIPromptService`.
7
+ */
8
+ export class InlineAIPromptSettings {
9
+ /**
10
+ * Specifies the settings for the Inline AI Prompt Popup.
11
+ */
12
+ popupSettings;
13
+ /**
14
+ * Sets the width of the component.
15
+ * Accepts a number for pixels or a string for other units, for example, `50%`.
16
+ */
17
+ width;
18
+ /**
19
+ * Sets the maximum height of the component.
20
+ * Accepts a number for pixels or a string for other units, for example, `50%`.
21
+ */
22
+ maxHeight;
23
+ /**
24
+ * Sets the value of the Inline AI Prompt TextArea.
25
+ */
26
+ promptValue;
27
+ /**
28
+ * Sets the placeholder of the Inline AI Prompt TextArea.
29
+ */
30
+ placeholder;
31
+ /**
32
+ * Sets the action buttons for the output card.
33
+ */
34
+ outputActions;
35
+ /**
36
+ * Sets the commands for the Inline AI Prompt TextArea prefix.
37
+ */
38
+ promptCommands;
39
+ /**
40
+ * Sets the prompt output to display.
41
+ */
42
+ promptOutput;
43
+ /**
44
+ * Sets the visibility and configuration of the Speech to Text button.
45
+ */
46
+ enableSpeechToTextButton;
47
+ /**
48
+ * Sets the template for the output content. If not provided, the default output template is used.
49
+ */
50
+ outputTemplate;
51
+ /**
52
+ * Sets whether the send button turns into a stop button.
53
+ */
54
+ streaming;
55
+ /**
56
+ * Sets the titles of the buttons shown in the Inline AI Prompt. Use for localization.
57
+ */
58
+ messages;
59
+ }
@@ -0,0 +1,8 @@
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
+ /**
6
+ * Defines the titles that appear in the Inline AI Prompt. Use for localization.
7
+ */
8
+ export {};
@@ -0,0 +1,5 @@
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
+ export {};
@@ -0,0 +1,5 @@
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
+ export {};