@siemens/element-ng 48.2.0 → 48.3.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/accordion/index.d.ts +5 -1
- package/application-header/index.d.ts +15 -2
- package/chat-messages/index.d.ts +654 -0
- package/chat-messages/package.json +3 -0
- package/dashboard/index.d.ts +1 -0
- package/fesm2022/siemens-element-ng-accordion.mjs +5 -1
- package/fesm2022/siemens-element-ng-accordion.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-application-header.mjs +62 -1
- package/fesm2022/siemens-element-ng-application-header.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-card.mjs +4 -4
- package/fesm2022/siemens-element-ng-card.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-chat-messages.mjs +863 -0
- package/fesm2022/siemens-element-ng-chat-messages.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-dashboard.mjs +8 -4
- package/fesm2022/siemens-element-ng-dashboard.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-file-uploader.mjs +277 -118
- package/fesm2022/siemens-element-ng-file-uploader.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-filtered-search.mjs +3 -4
- package/fesm2022/siemens-element-ng-filtered-search.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-icon.mjs +3 -1
- package/fesm2022/siemens-element-ng-icon.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-ip-input.mjs +92 -89
- package/fesm2022/siemens-element-ng-ip-input.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-markdown-renderer.mjs +253 -0
- package/fesm2022/siemens-element-ng-markdown-renderer.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-phone-number.mjs +5 -4
- package/fesm2022/siemens-element-ng-phone-number.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-popover.mjs +3 -4
- package/fesm2022/siemens-element-ng-popover.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-resize-observer.mjs +13 -0
- package/fesm2022/siemens-element-ng-resize-observer.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-translate.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tree-view.mjs +41 -2
- package/fesm2022/siemens-element-ng-tree-view.mjs.map +1 -1
- package/file-uploader/index.d.ts +119 -15
- package/icon/index.d.ts +3 -1
- package/ip-input/index.d.ts +13 -0
- package/markdown-renderer/index.d.ts +36 -0
- package/markdown-renderer/package.json +3 -0
- package/package.json +11 -3
- package/resize-observer/index.d.ts +13 -0
- package/schematics/migrations/action-modal-migration/action-modal-migration.js +2 -2
- package/schematics/migrations/data/attribute-selectors.js +6 -0
- package/schematics/migrations/data/component-names.js +78 -0
- package/schematics/migrations/data/element-selectors.js +10 -0
- package/schematics/migrations/data/index.js +17 -0
- package/schematics/migrations/data/output-names.js +8 -0
- package/schematics/migrations/data/symbol-removals.js +58 -0
- package/schematics/migrations/element-migration/element-migration.js +101 -0
- package/schematics/migrations/element-migration/index.js +5 -0
- package/schematics/migrations/index.js +7 -2
- package/schematics/migrations/wizard-migration/index.js +88 -0
- package/schematics/scss-import-to-siemens-migration/index.js +3 -3
- package/schematics/ts-import-to-siemens-migration/index.js +2 -2
- package/schematics/utils/index.js +3 -3
- package/schematics/utils/project-utils.js +24 -35
- package/schematics/utils/template-utils.js +78 -2
- package/schematics/utils/ts-utils.js +5 -5
- package/template-i18n.json +9 -0
- package/translate/index.d.ts +9 -0
- package/tree-view/index.d.ts +40 -1
- package/schematics/migrations/to-legacy-migration/to-legacy-migration.js +0 -55
- package/schematics/migrations/to-legacy-migration/to-legacy-replacement.js +0 -35
|
@@ -0,0 +1,654 @@
|
|
|
1
|
+
import * as _siemens_element_translate_ng_translate_types from '@siemens/element-translate-ng/translate-types';
|
|
2
|
+
import { TranslatableString } from '@siemens/element-translate-ng/translate-types';
|
|
3
|
+
import * as _angular_core from '@angular/core';
|
|
4
|
+
import { ElementRef, TemplateRef, AfterViewInit } from '@angular/core';
|
|
5
|
+
import { MenuItem } from '@siemens/element-ng/menu';
|
|
6
|
+
import { SiModalService } from '@siemens/element-ng/modal';
|
|
7
|
+
import { FileUploadError, UploadFile } from '@siemens/element-ng/file-uploader';
|
|
8
|
+
import { TranslatableString as TranslatableString$1 } from '@siemens/element-translate-ng/translate';
|
|
9
|
+
import * as i1 from '@siemens/element-ng/resize-observer';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
13
|
+
* SPDX-License-Identifier: MIT
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Actions for messages representing an action with icon, label (for accessibility), and handler.
|
|
18
|
+
* Only the icon will be displayed.
|
|
19
|
+
* @experimental
|
|
20
|
+
*/
|
|
21
|
+
interface MessageAction {
|
|
22
|
+
/** Label that is shown to the user. */
|
|
23
|
+
label: TranslatableString;
|
|
24
|
+
/**
|
|
25
|
+
* Icon used to represent the action
|
|
26
|
+
*/
|
|
27
|
+
icon: string;
|
|
28
|
+
/**
|
|
29
|
+
* Action that is called when the item is triggered.
|
|
30
|
+
*/
|
|
31
|
+
action: (actionParam: any, source: this) => void;
|
|
32
|
+
/** Whether the menu item is disabled. */
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* AI message component for displaying AI-generated responses in conversational interfaces.
|
|
38
|
+
*
|
|
39
|
+
* The AI message component renders AI-generated content in chat interfaces,
|
|
40
|
+
* supporting text formatting, markdown, loading states, and contextual actions.
|
|
41
|
+
* It appears as text (no bubble) aligned to the left side without any avatar/icon slot.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* This component is designed for use in:
|
|
45
|
+
* - AI chat interfaces where model responses need to be displayed
|
|
46
|
+
* - Chatbot implementations
|
|
47
|
+
* - Conversational AI applications
|
|
48
|
+
* - AI assistant interfaces
|
|
49
|
+
*
|
|
50
|
+
* The component automatically handles:
|
|
51
|
+
* - Rendering markdown content with syntax highlighting
|
|
52
|
+
* - Showing loading states with skeleton UI during generation
|
|
53
|
+
* - Displaying primary and secondary actions on hover (desktop) or tap (mobile)
|
|
54
|
+
* - Proper alignment and styling for AI messages
|
|
55
|
+
* - Content sanitization for security
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* Basic usage with content only:
|
|
59
|
+
* ```html
|
|
60
|
+
* <si-ai-message [content]="'I can help you with that.'" />
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* With loading state and actions:
|
|
65
|
+
* ```typescript
|
|
66
|
+
* import { Component } from '@angular/core';
|
|
67
|
+
* import { SiAiMessageComponent } from '@siemens/element-ng/chat-messages';
|
|
68
|
+
*
|
|
69
|
+
* @Component({
|
|
70
|
+
* selector: 'app-chat',
|
|
71
|
+
* imports: [SiAiMessageComponent],
|
|
72
|
+
* template: `
|
|
73
|
+
* <si-ai-message
|
|
74
|
+
* [content]="message.text"
|
|
75
|
+
* [loading]="message.isGenerating"
|
|
76
|
+
* [actions]="messageActions"
|
|
77
|
+
* [secondaryActions]="menuActions"
|
|
78
|
+
* [actionParam]="message"
|
|
79
|
+
* />
|
|
80
|
+
* `
|
|
81
|
+
* })
|
|
82
|
+
* export class ChatComponent {
|
|
83
|
+
* messageActions = [
|
|
84
|
+
* { icon: 'thumbs-up', label: 'Good response', action: (id) => this.ratePositive(id) },
|
|
85
|
+
* { icon: 'thumbs-down', label: 'Bad response', action: (id) => this.rateNegative(id) },
|
|
86
|
+
* { icon: 'copy', label: 'Copy', action: (id) => this.copyMessage(id) }
|
|
87
|
+
* ];
|
|
88
|
+
*
|
|
89
|
+
* menuActions = [
|
|
90
|
+
* { label: 'Regenerate', action: (id) => this.regenerate(id) },
|
|
91
|
+
* { label: 'Report', action: (id) => this.reportMessage(id) }
|
|
92
|
+
* ];
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @see {@link SiChatMessageComponent} for the base message wrapper component
|
|
97
|
+
* @see {@link SiUserMessageComponent} for the companion user message component
|
|
98
|
+
* @see {@link getMarkdownRenderer} for markdown formatting support
|
|
99
|
+
*
|
|
100
|
+
* @experimental
|
|
101
|
+
*/
|
|
102
|
+
declare class SiAiMessageComponent {
|
|
103
|
+
protected readonly formattedContent: _angular_core.Signal<ElementRef<HTMLDivElement> | undefined>;
|
|
104
|
+
/**
|
|
105
|
+
* The AI-generated message content
|
|
106
|
+
* @defaultValue ''
|
|
107
|
+
*/
|
|
108
|
+
readonly content: _angular_core.InputSignal<string>;
|
|
109
|
+
/**
|
|
110
|
+
* Optional formatter function to transform content before display.
|
|
111
|
+
* - Returns string: Content will be sanitized using Angular's DomSanitizer
|
|
112
|
+
* - Returns Node: DOM node will be inserted directly without sanitization
|
|
113
|
+
*
|
|
114
|
+
* **Note:** If using a markdown renderer, make sure to apply the `markdown-content` class
|
|
115
|
+
* to the root element to ensure proper styling using the Element theme (e.g., `div.className = 'markdown-content'`).
|
|
116
|
+
* The function returned by {@link getMarkdownRenderer} does this automatically.
|
|
117
|
+
*
|
|
118
|
+
* **Warning:** When returning a Node, ensure the content is safe to prevent XSS attacks
|
|
119
|
+
* @defaultValue undefined
|
|
120
|
+
*/
|
|
121
|
+
readonly contentFormatter: _angular_core.InputSignal<((text: string) => string | Node) | undefined>;
|
|
122
|
+
protected readonly textContent: _angular_core.WritableSignal<string | undefined>;
|
|
123
|
+
constructor();
|
|
124
|
+
/**
|
|
125
|
+
* Whether the message is currently being generated (shows skeleton)
|
|
126
|
+
* @defaultValue false
|
|
127
|
+
*/
|
|
128
|
+
readonly loading: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
129
|
+
/**
|
|
130
|
+
* Primary actions available for this message (thumbs up/down, copy, retry, etc.)
|
|
131
|
+
* All actions displayed inline
|
|
132
|
+
* @defaultValue []
|
|
133
|
+
*/
|
|
134
|
+
readonly actions: _angular_core.InputSignal<MessageAction[]>;
|
|
135
|
+
/**
|
|
136
|
+
* Secondary actions available in dropdown menu, first use primary actions and only add secondary actions additionally
|
|
137
|
+
* @defaultValue []
|
|
138
|
+
*/
|
|
139
|
+
readonly secondaryActions: _angular_core.InputSignal<MenuItem[]>;
|
|
140
|
+
/** Parameter to pass to action handlers */
|
|
141
|
+
readonly actionParam: _angular_core.InputSignal<unknown>;
|
|
142
|
+
/**
|
|
143
|
+
* More actions button aria label
|
|
144
|
+
*
|
|
145
|
+
* @defaultValue
|
|
146
|
+
* ```
|
|
147
|
+
* t(() => $localize`:@@SI_AI_MESSAGE.SECONDARY_ACTIONS:More actions`)
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
readonly secondaryActionsLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate_types.TranslatableString>;
|
|
151
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiAiMessageComponent, never>;
|
|
152
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiAiMessageComponent, "si-ai-message", never, { "content": { "alias": "content"; "required": false; "isSignal": true; }; "contentFormatter": { "alias": "contentFormatter"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "secondaryActions": { "alias": "secondaryActions"; "required": false; "isSignal": true; }; "actionParam": { "alias": "actionParam"; "required": false; "isSignal": true; }; "secondaryActionsLabel": { "alias": "secondaryActionsLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Attachment item interface for file attachments in chat messages.
|
|
157
|
+
*
|
|
158
|
+
* @experimental
|
|
159
|
+
*/
|
|
160
|
+
interface Attachment {
|
|
161
|
+
/** File name */
|
|
162
|
+
name: string;
|
|
163
|
+
/** Optionally show a preview of the attachment by providing a template that is shown in a modal when clicked (optional) */
|
|
164
|
+
previewTemplate?: TemplateRef<any> | (() => TemplateRef<any>);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Attachment list component for displaying file attachments in chat messages.
|
|
168
|
+
*
|
|
169
|
+
* This component renders a list of file attachments with icons, names, and optional
|
|
170
|
+
* preview and remove functionality. It's designed to work with chat message components
|
|
171
|
+
* to show files that have been uploaded or shared in conversations.
|
|
172
|
+
*
|
|
173
|
+
* @remarks
|
|
174
|
+
* This component provides:
|
|
175
|
+
* - Automatic file type detection with appropriate icons
|
|
176
|
+
* - Optional preview modal for attachments
|
|
177
|
+
* - Optional remove functionality for editable messages
|
|
178
|
+
* - Flexible alignment (start/end) to match message alignment
|
|
179
|
+
* - Support for various file types (images, videos, audio, documents, archives)
|
|
180
|
+
*
|
|
181
|
+
* The component is typically used within {@link SiUserMessageComponent} or {@link SiAiMessageComponent}
|
|
182
|
+
* to display uploaded files, but can also be used standalone.
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* Basic usage with attachments:
|
|
186
|
+
* ```html
|
|
187
|
+
* <si-attachment-list [attachments]="files" />
|
|
188
|
+
* ```
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* With remove functionality and custom alignment:
|
|
192
|
+
* ```typescript
|
|
193
|
+
* import { Component } from '@angular/core';
|
|
194
|
+
* import { SiAttachmentListComponent, Attachment } from '@siemens/element-ng/chat-messages';
|
|
195
|
+
*
|
|
196
|
+
* @Component({
|
|
197
|
+
* selector: 'app-chat',
|
|
198
|
+
* imports: [SiAttachmentListComponent],
|
|
199
|
+
* template: `
|
|
200
|
+
* <si-attachment-list
|
|
201
|
+
* [attachments]="attachments"
|
|
202
|
+
* [alignment]="'end'"
|
|
203
|
+
* [removable]="true"
|
|
204
|
+
* (remove)="handleRemove($event)"
|
|
205
|
+
* />
|
|
206
|
+
* `
|
|
207
|
+
* })
|
|
208
|
+
* export class ChatComponent {
|
|
209
|
+
* attachments: Attachment[] = [
|
|
210
|
+
* { id: '1', name: 'report.pdf' },
|
|
211
|
+
* { id: '2', name: 'image.png', previewTemplate: this.imagePreview }
|
|
212
|
+
* ];
|
|
213
|
+
*
|
|
214
|
+
* handleRemove(attachment: Attachment) {
|
|
215
|
+
* this.attachments = this.attachments.filter(a => a !== attachment);
|
|
216
|
+
* }
|
|
217
|
+
* }
|
|
218
|
+
* ```
|
|
219
|
+
*
|
|
220
|
+
* @see {@link SiUserMessageComponent} for user message display
|
|
221
|
+
* @see {@link SiAiMessageComponent} for AI message display
|
|
222
|
+
* @see {@link Attachment} for attachment data structure
|
|
223
|
+
*
|
|
224
|
+
* @experimental
|
|
225
|
+
*/
|
|
226
|
+
declare class SiAttachmentListComponent {
|
|
227
|
+
protected modalService: SiModalService;
|
|
228
|
+
/**
|
|
229
|
+
* List of attachments to display
|
|
230
|
+
* @defaultValue []
|
|
231
|
+
*/
|
|
232
|
+
readonly attachments: _angular_core.InputSignal<Attachment[]>;
|
|
233
|
+
/**
|
|
234
|
+
* Whether to align attachments to the end (right) or start (left)
|
|
235
|
+
* @defaultValue 'start'
|
|
236
|
+
*/
|
|
237
|
+
readonly alignment: _angular_core.InputSignal<"start" | "end">;
|
|
238
|
+
/**
|
|
239
|
+
* Whether to show remove buttons on attachments
|
|
240
|
+
* @defaultValue false
|
|
241
|
+
*/
|
|
242
|
+
readonly removable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
243
|
+
/**
|
|
244
|
+
* Label for remove attachment button
|
|
245
|
+
*
|
|
246
|
+
* @defaultValue
|
|
247
|
+
* ```
|
|
248
|
+
* t(() => $localize`:@@SI_ATTACHMENT_LIST.REMOVE_ATTACHMENT:Remove attachment`)
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
readonly removeLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate_types.TranslatableString>;
|
|
252
|
+
/**
|
|
253
|
+
* Emitted when an attachment should be removed
|
|
254
|
+
*/
|
|
255
|
+
readonly remove: _angular_core.OutputEmitterRef<Attachment>;
|
|
256
|
+
private getPreviewTemplate;
|
|
257
|
+
protected openPreview(event: Event, attachment: Attachment): void;
|
|
258
|
+
protected getFileIcon(name: string): string;
|
|
259
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiAttachmentListComponent, never>;
|
|
260
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiAttachmentListComponent, "si-attachment-list", never, { "attachments": { "alias": "attachments"; "required": false; "isSignal": true; }; "alignment": { "alias": "alignment"; "required": false; "isSignal": true; }; "removable": { "alias": "removable"; "required": false; "isSignal": true; }; "removeLabel": { "alias": "removeLabel"; "required": false; "isSignal": true; }; }, { "remove": "remove"; }, never, never, true, never>;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
interface ChatInputAttachment extends Attachment {
|
|
264
|
+
/** File object */
|
|
265
|
+
file: File;
|
|
266
|
+
/** File size in bytes */
|
|
267
|
+
size: number;
|
|
268
|
+
/** MIME type */
|
|
269
|
+
type: string;
|
|
270
|
+
}
|
|
271
|
+
declare class SiChatInputComponent implements AfterViewInit {
|
|
272
|
+
private static idCounter;
|
|
273
|
+
private readonly textInput;
|
|
274
|
+
private readonly projectedContent;
|
|
275
|
+
/**
|
|
276
|
+
* Current input value
|
|
277
|
+
* @defaultValue ''
|
|
278
|
+
*/
|
|
279
|
+
readonly value: _angular_core.ModelSignal<string>;
|
|
280
|
+
/**
|
|
281
|
+
* Placeholder text for the input
|
|
282
|
+
*
|
|
283
|
+
* @defaultValue
|
|
284
|
+
* ```
|
|
285
|
+
* t(() => $localize`:@@SI_CHAT_INPUT.PLACEHOLDER:Enter a message…`)
|
|
286
|
+
* ```
|
|
287
|
+
*/
|
|
288
|
+
readonly placeholder: _angular_core.InputSignal<TranslatableString$1>;
|
|
289
|
+
/**
|
|
290
|
+
* Whether the input is disabled
|
|
291
|
+
* @defaultValue false
|
|
292
|
+
*/
|
|
293
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
294
|
+
/**
|
|
295
|
+
* Whether a message is currently being sent, also prevent the sending of new ones while still allowing the user to type
|
|
296
|
+
* @defaultValue false
|
|
297
|
+
*/
|
|
298
|
+
readonly sending: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
299
|
+
/**
|
|
300
|
+
* Whether the input supports interrupting ongoing operations. When active,
|
|
301
|
+
* the send button transforms into an interrupt button (with element-stop-filled icon).
|
|
302
|
+
* If sending is true, the interrupt button will be disabled.
|
|
303
|
+
* @defaultValue false
|
|
304
|
+
*/
|
|
305
|
+
readonly interruptible: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
306
|
+
/**
|
|
307
|
+
* Maximum number of characters allowed
|
|
308
|
+
*/
|
|
309
|
+
readonly maxLength: _angular_core.InputSignal<number | undefined>;
|
|
310
|
+
/**
|
|
311
|
+
* A disclaimer to display.
|
|
312
|
+
*
|
|
313
|
+
* If not provided, the component will look for projected content with the `siChatInputDisclaimer` directive.
|
|
314
|
+
* If both are empty, no disclaimer section will be shown (handled via CSS :empty).
|
|
315
|
+
*/
|
|
316
|
+
readonly disclaimer: _angular_core.InputSignal<TranslatableString$1 | undefined>;
|
|
317
|
+
/**
|
|
318
|
+
* Primary actions available in the input (attach files, etc.)
|
|
319
|
+
* All actions displayed inline
|
|
320
|
+
* @defaultValue []
|
|
321
|
+
*/
|
|
322
|
+
readonly actions: _angular_core.InputSignal<MessageAction[]>;
|
|
323
|
+
/**
|
|
324
|
+
* Secondary actions available in dropdown menu
|
|
325
|
+
* @defaultValue []
|
|
326
|
+
*/
|
|
327
|
+
readonly secondaryActions: _angular_core.InputSignal<MenuItem[]>;
|
|
328
|
+
/**
|
|
329
|
+
* Whether file attachments are supported
|
|
330
|
+
* @defaultValue false
|
|
331
|
+
*/
|
|
332
|
+
readonly allowAttachments: _angular_core.InputSignal<boolean>;
|
|
333
|
+
/**
|
|
334
|
+
* Accepted file types for attachments (as accept string)
|
|
335
|
+
* @defaultValue undefined
|
|
336
|
+
*/
|
|
337
|
+
readonly accept: _angular_core.InputSignal<string | undefined>;
|
|
338
|
+
/**
|
|
339
|
+
* Maximum file size in bytes
|
|
340
|
+
* @defaultValue 10485760 (10MB)
|
|
341
|
+
*/
|
|
342
|
+
readonly maxFileSize: _angular_core.InputSignal<number>;
|
|
343
|
+
/**
|
|
344
|
+
* Current attachments
|
|
345
|
+
* @defaultValue []
|
|
346
|
+
*/
|
|
347
|
+
readonly attachments: _angular_core.ModelSignal<ChatInputAttachment[]>;
|
|
348
|
+
/**
|
|
349
|
+
* The label for the input, used for accessibility
|
|
350
|
+
* @defaultValue
|
|
351
|
+
* ```
|
|
352
|
+
* t(() => $localize`:@@SI_CHAT_INPUT.LABEL:Chat message input`)
|
|
353
|
+
* ```
|
|
354
|
+
*/
|
|
355
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
356
|
+
/** Parameter to pass to action handlers */
|
|
357
|
+
readonly actionParam: _angular_core.InputSignal<any>;
|
|
358
|
+
/**
|
|
359
|
+
* Send button label
|
|
360
|
+
*
|
|
361
|
+
* @defaultValue
|
|
362
|
+
* ```
|
|
363
|
+
* t(() => $localize`:@@SI_CHAT_INPUT.SEND:Send`)
|
|
364
|
+
* ```
|
|
365
|
+
*/
|
|
366
|
+
readonly sendButtonLabel: _angular_core.InputSignal<TranslatableString$1>;
|
|
367
|
+
/**
|
|
368
|
+
* Send button icon
|
|
369
|
+
*
|
|
370
|
+
* @defaultValue 'element-send-filled'
|
|
371
|
+
*/
|
|
372
|
+
readonly sendButtonIcon: _angular_core.InputSignal<string>;
|
|
373
|
+
/**
|
|
374
|
+
* Interrupt button label
|
|
375
|
+
*
|
|
376
|
+
* @defaultValue
|
|
377
|
+
* ```
|
|
378
|
+
* t(() => $localize`:@@SI_CHAT_INPUT.INTERRUPT:Interrupt`)
|
|
379
|
+
* ```
|
|
380
|
+
*/
|
|
381
|
+
readonly interruptButtonLabel: _angular_core.InputSignal<TranslatableString$1>;
|
|
382
|
+
/**
|
|
383
|
+
* Auto-focus the input on component initialization
|
|
384
|
+
* @defaultValue false
|
|
385
|
+
*/
|
|
386
|
+
readonly autoFocus: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
387
|
+
/**
|
|
388
|
+
* Attach file button aria label
|
|
389
|
+
*
|
|
390
|
+
* @defaultValue
|
|
391
|
+
* ```
|
|
392
|
+
* t(() => $localize`:@@SI_CHAT_INPUT.ATTACH_FILE:Attach file`)
|
|
393
|
+
* ```
|
|
394
|
+
*/
|
|
395
|
+
readonly attachFileLabel: _angular_core.InputSignal<TranslatableString$1>;
|
|
396
|
+
/**
|
|
397
|
+
* Remove attachment aria label prefix
|
|
398
|
+
*
|
|
399
|
+
* @defaultValue
|
|
400
|
+
* ```
|
|
401
|
+
* t(() => $localize`:@@SI_ATTACHMENT_LIST.REMOVE_ATTACHMENT:Remove attachment`)
|
|
402
|
+
* ```
|
|
403
|
+
*/
|
|
404
|
+
readonly removeAttachmentLabel: _angular_core.InputSignal<TranslatableString$1>;
|
|
405
|
+
/**
|
|
406
|
+
* More actions button aria label
|
|
407
|
+
*
|
|
408
|
+
* @defaultValue
|
|
409
|
+
* ```
|
|
410
|
+
* t(() => $localize`:@@SI_CHAT_INPUT.SECONDARY_ACTIONS:More actions`)
|
|
411
|
+
* ```
|
|
412
|
+
*/
|
|
413
|
+
readonly secondaryActionsLabel: _angular_core.InputSignal<TranslatableString$1>;
|
|
414
|
+
/**
|
|
415
|
+
* Emitted when the user wants to send a message
|
|
416
|
+
*/
|
|
417
|
+
readonly send: _angular_core.OutputEmitterRef<{
|
|
418
|
+
content: string;
|
|
419
|
+
attachments: ChatInputAttachment[];
|
|
420
|
+
}>;
|
|
421
|
+
/**
|
|
422
|
+
* Emitted when the user wants to interrupt the current operation
|
|
423
|
+
*/
|
|
424
|
+
readonly interrupt: _angular_core.OutputEmitterRef<void>;
|
|
425
|
+
/**
|
|
426
|
+
* Emitted when file upload errors occur
|
|
427
|
+
*/
|
|
428
|
+
readonly fileError: _angular_core.OutputEmitterRef<FileUploadError>;
|
|
429
|
+
protected readonly id: string;
|
|
430
|
+
protected readonly hasContent: _angular_core.Signal<boolean>;
|
|
431
|
+
protected readonly hasAttachments: _angular_core.Signal<boolean>;
|
|
432
|
+
protected readonly hasActions: _angular_core.Signal<boolean>;
|
|
433
|
+
protected readonly hasSecondaryActions: _angular_core.Signal<boolean>;
|
|
434
|
+
protected readonly canSend: _angular_core.Signal<boolean>;
|
|
435
|
+
protected readonly showInterruptButton: _angular_core.Signal<boolean>;
|
|
436
|
+
protected readonly buttonDisabled: _angular_core.Signal<boolean>;
|
|
437
|
+
protected readonly buttonIcon: _angular_core.Signal<string>;
|
|
438
|
+
protected readonly buttonLabel: _angular_core.Signal<TranslatableString$1>;
|
|
439
|
+
protected get attachmentList(): Attachment[];
|
|
440
|
+
protected onInputChange(value: string): void;
|
|
441
|
+
protected onSend(): void;
|
|
442
|
+
protected onButtonClick(): void;
|
|
443
|
+
protected onKeyDown(event: KeyboardEvent): void;
|
|
444
|
+
protected onFilesAdded(uploadFiles: UploadFile[]): void;
|
|
445
|
+
protected onFileError(error: FileUploadError): void;
|
|
446
|
+
protected removeAttachment(attachment: Attachment): void;
|
|
447
|
+
protected onContainerClick(event: Event): void;
|
|
448
|
+
ngAfterViewInit(): void;
|
|
449
|
+
protected adjustTextareaHeight(event: Event): void;
|
|
450
|
+
/**
|
|
451
|
+
* Focus the textarea input
|
|
452
|
+
*/
|
|
453
|
+
focus(): void;
|
|
454
|
+
private setTextareaHeight;
|
|
455
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiChatInputComponent, never>;
|
|
456
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiChatInputComponent, "si-chat-input", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "sending": { "alias": "sending"; "required": false; "isSignal": true; }; "interruptible": { "alias": "interruptible"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "disclaimer": { "alias": "disclaimer"; "required": false; "isSignal": true; }; "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "secondaryActions": { "alias": "secondaryActions"; "required": false; "isSignal": true; }; "allowAttachments": { "alias": "allowAttachments"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; "isSignal": true; }; "attachments": { "alias": "attachments"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "actionParam": { "alias": "actionParam"; "required": false; "isSignal": true; }; "sendButtonLabel": { "alias": "sendButtonLabel"; "required": false; "isSignal": true; }; "sendButtonIcon": { "alias": "sendButtonIcon"; "required": false; "isSignal": true; }; "interruptButtonLabel": { "alias": "interruptButtonLabel"; "required": false; "isSignal": true; }; "autoFocus": { "alias": "autoFocus"; "required": false; "isSignal": true; }; "attachFileLabel": { "alias": "attachFileLabel"; "required": false; "isSignal": true; }; "removeAttachmentLabel": { "alias": "removeAttachmentLabel"; "required": false; "isSignal": true; }; "secondaryActionsLabel": { "alias": "secondaryActionsLabel"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "attachments": "attachmentsChange"; "send": "send"; "interrupt": "interrupt"; "fileError": "fileError"; }, never, ["*", "[siChatInputDisclaimer]"], true, never>;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Directive to mark content as chat input disclaimer.
|
|
461
|
+
* Apply this directive to content that should be slotted into the disclaimer area.
|
|
462
|
+
*
|
|
463
|
+
* @example
|
|
464
|
+
* ```html
|
|
465
|
+
* <si-chat-input>
|
|
466
|
+
* <div siChatInputDisclaimer>
|
|
467
|
+
* Custom disclaimer content
|
|
468
|
+
* </div>
|
|
469
|
+
* </si-chat-input>
|
|
470
|
+
* ```
|
|
471
|
+
*/
|
|
472
|
+
declare class SiChatInputDisclaimerDirective {
|
|
473
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiChatInputDisclaimerDirective, never>;
|
|
474
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SiChatInputDisclaimerDirective, "[siChatInputDisclaimer]", never, {}, {}, never, never, true, never>;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Directive to mark content as chat message actions.
|
|
479
|
+
* Apply this directive to e.g. buttons that should be slotted into the message actions area.
|
|
480
|
+
*
|
|
481
|
+
* @experimental
|
|
482
|
+
* @example
|
|
483
|
+
* ```html
|
|
484
|
+
* <si-chat-message>
|
|
485
|
+
* Message content
|
|
486
|
+
* <button siChatMessageAction>Like</button>
|
|
487
|
+
* <button siChatMessageAction>Share</button>
|
|
488
|
+
* </si-chat-message>
|
|
489
|
+
* ```
|
|
490
|
+
*/
|
|
491
|
+
declare class SiChatMessageActionDirective {
|
|
492
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiChatMessageActionDirective, never>;
|
|
493
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SiChatMessageActionDirective, "[siChatMessageAction]", never, {}, {}, never, never, true, never>;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Base chat message component that provides the layout structure for conversational interfaces.
|
|
498
|
+
*
|
|
499
|
+
* This component handles the core message layout including avatar positioning, loading states,
|
|
500
|
+
* and action button placement. It serves as the foundation for more specialized message components
|
|
501
|
+
* like {@link SiUserMessageComponent} and {@link SiAiMessageComponent}.
|
|
502
|
+
*
|
|
503
|
+
* @remarks
|
|
504
|
+
* The component provides:
|
|
505
|
+
* - Flexible alignment (start/end) for different message types
|
|
506
|
+
* - Avatar/icon slot for message attribution
|
|
507
|
+
* - Loading state with skeleton UI
|
|
508
|
+
* - Action buttons positioned on the side or bottom
|
|
509
|
+
* - Responsive behavior that adapts to container size
|
|
510
|
+
* - Attachment display slot
|
|
511
|
+
*
|
|
512
|
+
* This is a low-level component typically not used directly. Instead, use the higher-level
|
|
513
|
+
* message components that wrap this component with specific styling and behavior.
|
|
514
|
+
*
|
|
515
|
+
* @experimental
|
|
516
|
+
*/
|
|
517
|
+
declare class SiChatMessageComponent {
|
|
518
|
+
/**
|
|
519
|
+
* Whether the message is currently loading
|
|
520
|
+
* @defaultValue false
|
|
521
|
+
*/
|
|
522
|
+
readonly loading: _angular_core.InputSignal<boolean>;
|
|
523
|
+
/**
|
|
524
|
+
* Alignment of the message
|
|
525
|
+
* @defaultValue 'start'
|
|
526
|
+
*/
|
|
527
|
+
readonly alignment: _angular_core.InputSignal<"start" | "end">;
|
|
528
|
+
/**
|
|
529
|
+
* Where to display action buttons (if any)
|
|
530
|
+
* @defaultValue 'side'
|
|
531
|
+
*/
|
|
532
|
+
readonly actionsPosition: _angular_core.InputSignal<"bottom" | "side">;
|
|
533
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiChatMessageComponent, never>;
|
|
534
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiChatMessageComponent, "si-chat-message", never, { "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "alignment": { "alias": "alignment"; "required": false; "isSignal": true; }; "actionsPosition": { "alias": "actionsPosition"; "required": false; "isSignal": true; }; }, {}, never, ["si-icon,si-avatar,img", "si-attachment-list,si-badge", "*", "[siChatMessageAction]"], true, [{ directive: typeof i1.SiResponsiveContainerDirective; inputs: {}; outputs: {}; }]>;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* User message component for displaying user input in conversational interfaces.
|
|
539
|
+
*
|
|
540
|
+
* The user message component renders user-submitted content in chat interfaces,
|
|
541
|
+
* supporting text, attachments, and contextual actions. It appears as a text bubble
|
|
542
|
+
* aligned to the right side and supports markdown formatting for rich content.
|
|
543
|
+
*
|
|
544
|
+
* @remarks
|
|
545
|
+
* This component is designed for use in:
|
|
546
|
+
* - AI chat interfaces where user input needs to be displayed
|
|
547
|
+
* - Peer-to-peer conversation interfaces
|
|
548
|
+
* - Conversation histories or chat transcripts
|
|
549
|
+
*
|
|
550
|
+
* The component automatically handles:
|
|
551
|
+
* - Rendering markdown content with syntax highlighting
|
|
552
|
+
* - Displaying attachments above the message bubble
|
|
553
|
+
* - Showing primary and secondary actions on hover (desktop) or tap (mobile)
|
|
554
|
+
* - Proper alignment and styling for user messages
|
|
555
|
+
*
|
|
556
|
+
* @example
|
|
557
|
+
* Basic usage with content only:
|
|
558
|
+
* ```html
|
|
559
|
+
* <si-user-message [content]="'Hello, how can I help you?'" />
|
|
560
|
+
* ```
|
|
561
|
+
*
|
|
562
|
+
* @example
|
|
563
|
+
* With actions and attachments:
|
|
564
|
+
* ```typescript
|
|
565
|
+
* import { Component } from '@angular/core';
|
|
566
|
+
* import { SiUserMessageComponent } from '@siemens/element-ng/chat-messages';
|
|
567
|
+
*
|
|
568
|
+
* @Component({
|
|
569
|
+
* selector: 'app-chat',
|
|
570
|
+
* imports: [SiUserMessageComponent],
|
|
571
|
+
* template: `
|
|
572
|
+
* <si-user-message
|
|
573
|
+
* [content]="message.text"
|
|
574
|
+
* [actions]="messageActions"
|
|
575
|
+
* [secondaryActions]="menuActions"
|
|
576
|
+
* [attachments]="message.attachments"
|
|
577
|
+
* [actionParam]="message"
|
|
578
|
+
* />
|
|
579
|
+
* `
|
|
580
|
+
* })
|
|
581
|
+
* export class ChatComponent {
|
|
582
|
+
* messageActions = [
|
|
583
|
+
* { icon: 'copy', label: 'Copy', action: (id) => this.copyMessage(id) },
|
|
584
|
+
* { icon: 'edit', label: 'Edit', action: (id) => this.editMessage(id) }
|
|
585
|
+
* ];
|
|
586
|
+
*
|
|
587
|
+
* menuActions = [
|
|
588
|
+
* { label: 'Delete', action: (id) => this.deleteMessage(id) }
|
|
589
|
+
* ];
|
|
590
|
+
* }
|
|
591
|
+
* ```
|
|
592
|
+
*
|
|
593
|
+
* @see {@link SiChatMessageComponent} for the base message wrapper component
|
|
594
|
+
* @see {@link SiAttachmentListComponent} for attachment handling
|
|
595
|
+
* @see {@link SiMarkdownRendererComponent} for markdown rendering
|
|
596
|
+
*
|
|
597
|
+
* @experimental
|
|
598
|
+
*/
|
|
599
|
+
declare class SiUserMessageComponent {
|
|
600
|
+
protected readonly formattedContent: _angular_core.Signal<ElementRef<HTMLDivElement> | undefined>;
|
|
601
|
+
/**
|
|
602
|
+
* The user message content
|
|
603
|
+
* @defaultValue ''
|
|
604
|
+
*/
|
|
605
|
+
readonly content: _angular_core.InputSignal<string>;
|
|
606
|
+
/**
|
|
607
|
+
* Optional formatter function to transform content before display.
|
|
608
|
+
* - Returns string: Content will be inserted as text with built-in sanitization
|
|
609
|
+
* - Returns Node: DOM node will be inserted directly without sanitization
|
|
610
|
+
*
|
|
611
|
+
* **Note:** When returning a Node with formatted content, apply the `markdown-content` class
|
|
612
|
+
* to the root element to ensure proper styling (e.g., `div.className = 'markdown-content'`).
|
|
613
|
+
* The function returned by {@link getMarkdownRenderer} does this automatically.
|
|
614
|
+
*
|
|
615
|
+
* **Warning:** When returning a Node, ensure the content is safe to prevent XSS attacks
|
|
616
|
+
* @defaultValue undefined
|
|
617
|
+
*/
|
|
618
|
+
readonly contentFormatter: _angular_core.InputSignal<((text: string) => string | Node) | undefined>;
|
|
619
|
+
/**
|
|
620
|
+
* Primary message actions (edit, delete, copy, etc.).
|
|
621
|
+
* All actions displayed inline
|
|
622
|
+
* @defaultValue []
|
|
623
|
+
*/
|
|
624
|
+
readonly actions: _angular_core.InputSignal<MessageAction[]>;
|
|
625
|
+
/**
|
|
626
|
+
* Secondary actions available in dropdown menu, first use primary actions and only add secondary actions additionally
|
|
627
|
+
* @defaultValue []
|
|
628
|
+
*/
|
|
629
|
+
readonly secondaryActions: _angular_core.InputSignal<MenuItem[]>;
|
|
630
|
+
/**
|
|
631
|
+
* List of attachments included with this message
|
|
632
|
+
* @defaultValue []
|
|
633
|
+
*/
|
|
634
|
+
readonly attachments: _angular_core.InputSignal<Attachment[]>;
|
|
635
|
+
/** Parameter to pass to action handlers */
|
|
636
|
+
readonly actionParam: _angular_core.InputSignal<any>;
|
|
637
|
+
/**
|
|
638
|
+
* More actions button aria label
|
|
639
|
+
*
|
|
640
|
+
* @defaultValue
|
|
641
|
+
* ```
|
|
642
|
+
* t(() => $localize`:@@SI_USER_MESSAGE.SECONDARY_ACTIONS:More actions`)
|
|
643
|
+
* ```
|
|
644
|
+
*/
|
|
645
|
+
readonly secondaryActionsLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate_types.TranslatableString>;
|
|
646
|
+
protected readonly hasAttachments: _angular_core.Signal<boolean>;
|
|
647
|
+
protected readonly textContent: _angular_core.WritableSignal<string | undefined>;
|
|
648
|
+
constructor();
|
|
649
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiUserMessageComponent, never>;
|
|
650
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiUserMessageComponent, "si-user-message", never, { "content": { "alias": "content"; "required": false; "isSignal": true; }; "contentFormatter": { "alias": "contentFormatter"; "required": false; "isSignal": true; }; "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "secondaryActions": { "alias": "secondaryActions"; "required": false; "isSignal": true; }; "attachments": { "alias": "attachments"; "required": false; "isSignal": true; }; "actionParam": { "alias": "actionParam"; "required": false; "isSignal": true; }; "secondaryActionsLabel": { "alias": "secondaryActionsLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
export { SiAiMessageComponent, SiAttachmentListComponent, SiChatInputComponent, SiChatInputDisclaimerDirective, SiChatMessageActionDirective, SiChatMessageComponent, SiUserMessageComponent };
|
|
654
|
+
export type { Attachment, ChatInputAttachment, MessageAction };
|
package/dashboard/index.d.ts
CHANGED
|
@@ -65,6 +65,7 @@ declare class SiDashboardCardComponent extends SiCardComponent implements OnDest
|
|
|
65
65
|
protected readonly actionBarViewTypeComputed: _angular_core.Signal<_siemens_element_ng_content_action_bar.ViewType>;
|
|
66
66
|
protected readonly actionBarTitleComputed: _angular_core.Signal<_siemens_element_translate_ng_translate_types.TranslatableString>;
|
|
67
67
|
protected readonly primaryActionsComputed: _angular_core.Signal<(MenuItem | ContentActionBarMainItem)[]>;
|
|
68
|
+
private readonly icons;
|
|
68
69
|
private readonly expandRestoreIconTooltip;
|
|
69
70
|
private readonly expandActionItem;
|
|
70
71
|
private readonly restoreActionItem;
|
|
@@ -105,7 +105,11 @@ class SiCollapsiblePanelComponent {
|
|
|
105
105
|
* @defaultValue false
|
|
106
106
|
*/
|
|
107
107
|
disabled = input(false, { transform: booleanAttribute });
|
|
108
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* Color variant for component background.
|
|
110
|
+
*
|
|
111
|
+
* @deprecated This input has no effect on the component styling.
|
|
112
|
+
*/
|
|
109
113
|
colorVariant = input();
|
|
110
114
|
/**
|
|
111
115
|
* Defines the content of the optional badge. Should be a number or something like "100+".
|