@siemens/element-ng 51.5.0 → 51.7.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/README.md +3 -4
- package/element-ng.scss +3 -1
- package/fesm2022/siemens-element-ng-accordion.mjs +2 -2
- package/fesm2022/siemens-element-ng-accordion.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-ag-grid.mjs +9 -9
- package/fesm2022/siemens-element-ng-ag-grid.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-application-header.mjs +47 -14
- package/fesm2022/siemens-element-ng-application-header.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-avatar.mjs +3 -3
- package/fesm2022/siemens-element-ng-avatar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-card.mjs +6 -5
- package/fesm2022/siemens-element-ng-card.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-carousel.mjs +6 -4
- package/fesm2022/siemens-element-ng-carousel.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-chat-messages.mjs +605 -32
- package/fesm2022/siemens-element-ng-chat-messages.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-color-picker.mjs +55 -39
- package/fesm2022/siemens-element-ng-color-picker.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-content-action-bar.mjs +2 -2
- package/fesm2022/siemens-element-ng-content-action-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-dashboard.mjs +18 -17
- package/fesm2022/siemens-element-ng-dashboard.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-date-range-filter.mjs +3 -3
- package/fesm2022/siemens-element-ng-date-range-filter.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-datepicker.mjs +22 -9
- package/fesm2022/siemens-element-ng-datepicker.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-empty-state.mjs +13 -6
- package/fesm2022/siemens-element-ng-empty-state.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-file-uploader.mjs +2 -2
- package/fesm2022/siemens-element-ng-file-uploader.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-filter-bar.mjs +4 -4
- package/fesm2022/siemens-element-ng-filter-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-filtered-search.mjs +19 -5
- package/fesm2022/siemens-element-ng-filtered-search.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-footer.mjs +2 -2
- package/fesm2022/siemens-element-ng-form.mjs +4 -4
- package/fesm2022/siemens-element-ng-formly.mjs +1 -1
- package/fesm2022/siemens-element-ng-formly.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-icon.mjs +2 -1
- package/fesm2022/siemens-element-ng-icon.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-info-page.mjs +20 -7
- package/fesm2022/siemens-element-ng-info-page.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-inline-notification.mjs +2 -2
- package/fesm2022/siemens-element-ng-inline-notification.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-landing-page.mjs +2 -2
- package/fesm2022/siemens-element-ng-landing-page.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-list-details.mjs +2 -2
- package/fesm2022/siemens-element-ng-list-details.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-loading-spinner.mjs +2 -2
- package/fesm2022/siemens-element-ng-loading-spinner.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-maplibre.mjs +133 -10
- package/fesm2022/siemens-element-ng-maplibre.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-menu.mjs +6 -6
- package/fesm2022/siemens-element-ng-menu.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-modal.mjs +71 -84
- package/fesm2022/siemens-element-ng-modal.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-navbar-vertical-next.mjs +64 -14
- package/fesm2022/siemens-element-ng-navbar-vertical-next.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-navbar-vertical.mjs +4 -4
- package/fesm2022/siemens-element-ng-navbar-vertical.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-navbar.mjs +8 -3
- package/fesm2022/siemens-element-ng-navbar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-notification-item.mjs +2 -2
- package/fesm2022/siemens-element-ng-notification-item.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-number-input.mjs +2 -2
- package/fesm2022/siemens-element-ng-number-input.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-password-strength.mjs +2 -2
- package/fesm2022/siemens-element-ng-password-strength.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-phone-number.mjs +32 -23
- package/fesm2022/siemens-element-ng-phone-number.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-photo-upload.mjs +7 -2
- package/fesm2022/siemens-element-ng-photo-upload.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-pills-input.mjs +2 -2
- package/fesm2022/siemens-element-ng-pills-input.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-result-details-list.mjs +11 -6
- package/fesm2022/siemens-element-ng-result-details-list.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-search-bar.mjs +188 -15
- package/fesm2022/siemens-element-ng-search-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-select.mjs +631 -764
- package/fesm2022/siemens-element-ng-select.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-side-panel.mjs +19 -10
- package/fesm2022/siemens-element-ng-side-panel.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-slider.mjs +2 -2
- package/fesm2022/siemens-element-ng-slider.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-source-chip.mjs +2 -2
- package/fesm2022/siemens-element-ng-source-chip.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-split.mjs +2 -2
- package/fesm2022/siemens-element-ng-split.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-status-bar.mjs +12 -12
- package/fesm2022/siemens-element-ng-status-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-status-counter.mjs +2 -2
- package/fesm2022/siemens-element-ng-status-counter.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-status-toggle.mjs +2 -2
- package/fesm2022/siemens-element-ng-status-toggle.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-summary-chip.mjs +2 -2
- package/fesm2022/siemens-element-ng-summary-chip.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-summary-widget.mjs +2 -2
- package/fesm2022/siemens-element-ng-summary-widget.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tabs-legacy.mjs +2 -1
- package/fesm2022/siemens-element-ng-tabs-legacy.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tabs.mjs +3 -6
- package/fesm2022/siemens-element-ng-tabs.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-theme.mjs +9 -5
- package/fesm2022/siemens-element-ng-theme.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-threshold.mjs +2 -2
- package/fesm2022/siemens-element-ng-threshold.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-toast-notification.mjs +2 -2
- package/fesm2022/siemens-element-ng-toast-notification.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tour.mjs +2 -2
- package/fesm2022/siemens-element-ng-tour.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-translate.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tree-view.mjs +8 -25
- package/fesm2022/siemens-element-ng-tree-view.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-typeahead.mjs +42 -30
- package/fesm2022/siemens-element-ng-typeahead.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-wizard.mjs +2 -2
- package/fesm2022/siemens-element-ng-wizard.mjs.map +1 -1
- package/maplibre/styles/maplibre-gl.scss +2 -2
- package/package.json +8 -8
- package/schematics/collection.json +5 -0
- package/schematics/migrate-search-bar/index.js +5 -0
- package/schematics/migrate-search-bar/migrate-search-bar-rule.js +733 -0
- package/schematics/migrate-search-bar/schema.json +14 -0
- package/schematics/migrate-search-bar/search-bar-template.js +742 -0
- package/schematics/migrate-search-bar/text-edits.js +23 -0
- package/schematics/migrations/data/css-custom-properties.js +11 -11
- package/schematics/utils/project-utils.js +2 -1
- package/template-i18n.json +9 -0
- package/types/siemens-element-ng-application-header.d.ts +12 -2
- package/types/siemens-element-ng-avatar.d.ts +1 -1
- package/types/siemens-element-ng-card.d.ts +2 -2
- package/types/siemens-element-ng-chat-messages.d.ts +517 -124
- package/types/siemens-element-ng-color-picker.d.ts +18 -9
- package/types/siemens-element-ng-dashboard.d.ts +6 -2
- package/types/siemens-element-ng-empty-state.d.ts +9 -2
- package/types/siemens-element-ng-info-page.d.ts +17 -5
- package/types/siemens-element-ng-maplibre.d.ts +39 -2
- package/types/siemens-element-ng-modal.d.ts +6 -4
- package/types/siemens-element-ng-navbar-vertical-next.d.ts +31 -2
- package/types/siemens-element-ng-navbar.d.ts +1 -0
- package/types/siemens-element-ng-phone-number.d.ts +5 -6
- package/types/siemens-element-ng-photo-upload.d.ts +1 -0
- package/types/siemens-element-ng-result-details-list.d.ts +7 -2
- package/types/siemens-element-ng-search-bar.d.ts +110 -5
- package/types/siemens-element-ng-select.d.ts +257 -286
- package/types/siemens-element-ng-side-panel.d.ts +5 -1
- package/types/siemens-element-ng-status-bar.d.ts +2 -2
- package/types/siemens-element-ng-tabs-legacy.d.ts +2 -1
- package/types/siemens-element-ng-theme.d.ts +1 -0
- package/types/siemens-element-ng-tour.d.ts +11 -0
- package/types/siemens-element-ng-translate.d.ts +9 -0
- package/types/siemens-element-ng-tree-view.d.ts +0 -8
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { CdkMenuTrigger } from '@angular/cdk/menu';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Directive, input, Component, booleanAttribute, output, model,
|
|
4
|
-
import { elementOptionsVertical, elementRight2, elementIssue, elementCircleFilled, elementDocument, elementStateClose, elementStopFilled, elementSendFilled, elementPlus, elementAttachment } from '@siemens/element-icons';
|
|
5
|
-
import { addIcons, SiIconComponent } from '@siemens/element-ng/icon';
|
|
6
|
-
import { SiMenuFactoryComponent } from '@siemens/element-ng/menu';
|
|
2
|
+
import { Directive, inject, input, Component, booleanAttribute, output, model, viewChild, PLATFORM_ID, effect, InjectionToken, computed, signal, Injector, afterNextRender, contentChild, isSignal } from '@angular/core';
|
|
7
3
|
import { SiSourceChipComponent } from '@siemens/element-ng/source-chip';
|
|
8
4
|
import { t, SiTranslatePipe } from '@siemens/element-translate-ng/translate';
|
|
5
|
+
import { CdkMenuTrigger } from '@angular/cdk/menu';
|
|
6
|
+
import { elementOptionsVertical, elementRight2, elementIssue, elementCircleFilled, elementDocument, elementStateClose, elementStopFilled, elementSendFilled, elementPlus, elementAttachment } from '@siemens/element-icons';
|
|
7
|
+
import { addIcons, SiIconComponent } from '@siemens/element-ng/icon';
|
|
8
|
+
import { SiMenuActionService, SiMenuFactoryComponent } from '@siemens/element-ng/menu';
|
|
9
9
|
import * as i1 from '@siemens/element-ng/resize-observer';
|
|
10
10
|
import { SiResponsiveContainerDirective } from '@siemens/element-ng/resize-observer';
|
|
11
11
|
import { SiLoadingSpinnerComponent } from '@siemens/element-ng/loading-spinner';
|
|
12
12
|
import { SiModalService } from '@siemens/element-ng/modal';
|
|
13
|
-
import { isPlatformBrowser } from '@angular/common';
|
|
13
|
+
import { isPlatformBrowser, NgTemplateOutlet } from '@angular/common';
|
|
14
14
|
import * as i1$1 from '@angular/forms';
|
|
15
15
|
import { FormsModule } from '@angular/forms';
|
|
16
16
|
import { SiFileUploadDirective } from '@siemens/element-ng/file-uploader';
|
|
17
17
|
import { SiTooltipDirective } from '@siemens/element-ng/tooltip';
|
|
18
18
|
import { SiActionCardComponent } from '@siemens/element-ng/card';
|
|
19
19
|
import { SiSummaryChipComponent } from '@siemens/element-ng/summary-chip';
|
|
20
|
+
import { SiInlineNotificationComponent } from '@siemens/element-ng/inline-notification';
|
|
21
|
+
import { makeSiMarkdownOptions, SiMarkdownComponent } from '@siemens/element-ng/markdown';
|
|
20
22
|
|
|
21
23
|
/**
|
|
22
24
|
* Copyright (c) Siemens 2016 - 2026
|
|
@@ -50,6 +52,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
50
52
|
}]
|
|
51
53
|
}] });
|
|
52
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Copyright (c) Siemens 2016 - 2026
|
|
57
|
+
* SPDX-License-Identifier: MIT
|
|
58
|
+
*/
|
|
59
|
+
/**
|
|
60
|
+
* Shared action controls for user and AI messages.
|
|
61
|
+
*
|
|
62
|
+
* Pass the pre-split primary and secondary actions to this component.
|
|
63
|
+
*
|
|
64
|
+
* @experimental
|
|
65
|
+
*/
|
|
66
|
+
class SiChatMessageActionsComponent {
|
|
67
|
+
menuActionService = inject(SiMenuActionService, { optional: true });
|
|
68
|
+
icons = addIcons({ elementOptionsVertical });
|
|
69
|
+
/** Primary message actions displayed inline.
|
|
70
|
+
* @defaultValue []
|
|
71
|
+
*/
|
|
72
|
+
actions = input([], /* @ts-ignore */
|
|
73
|
+
...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
|
|
74
|
+
/** Secondary actions displayed in the menu.
|
|
75
|
+
* @defaultValue []
|
|
76
|
+
*/
|
|
77
|
+
secondaryActions = input([], /* @ts-ignore */
|
|
78
|
+
...(ngDevMode ? [{ debugName: "secondaryActions" }] : /* istanbul ignore next */ []));
|
|
79
|
+
/** Parameter passed to action handlers. */
|
|
80
|
+
actionParam = input(/* @ts-ignore */
|
|
81
|
+
...(ngDevMode ? [undefined, { debugName: "actionParam" }] : /* istanbul ignore next */ []));
|
|
82
|
+
/** More actions button aria label.
|
|
83
|
+
* @defaultValue
|
|
84
|
+
* ```
|
|
85
|
+
* t(() => $localize`:@@SI_CHAT_MESSAGE_ACTIONS.SECONDARY_ACTIONS:Additional actions`)
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
secondaryActionsLabel = input(t(() => $localize `:@@SI_CHAT_MESSAGE_ACTIONS.SECONDARY_ACTIONS:Additional actions`), /* @ts-ignore */
|
|
89
|
+
...(ngDevMode ? [{ debugName: "secondaryActionsLabel" }] : /* istanbul ignore next */ []));
|
|
90
|
+
runAction(action) {
|
|
91
|
+
if (typeof action.action === 'function') {
|
|
92
|
+
action.action(this.actionParam(), action);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
this.menuActionService?.actionTriggered(action, this.actionParam());
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiChatMessageActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
99
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiChatMessageActionsComponent, isStandalone: true, selector: "si-chat-message-actions", inputs: { actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, secondaryActions: { classPropertyName: "secondaryActions", publicName: "secondaryActions", isSignal: true, isRequired: false, transformFunction: null }, actionParam: { classPropertyName: "actionParam", publicName: "actionParam", isSignal: true, isRequired: false, transformFunction: null }, secondaryActionsLabel: { classPropertyName: "secondaryActionsLabel", publicName: "secondaryActionsLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "d-block" }, ngImport: i0, template: "<div class=\"btn-group message-actions align-items-center\" role=\"group\" siChatMessageAction>\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost\"\n [class.btn-icon]=\"!!action.icon\"\n [disabled]=\"action.disabled\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"runAction(action)\"\n >\n @if (action.icon) {\n <si-icon [icon]=\"action.icon\" />\n } @else {\n {{ action.label | translate }}\n }\n </button>\n }\n\n @if (secondaryActions().length > 0) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"secondaryActionsMenu\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n [attr.title]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon [icon]=\"icons.elementOptionsVertical\" />\n </button>\n\n <ng-template #secondaryActionsMenu>\n <si-menu-factory [items]=\"secondaryActions()\" [actionParam]=\"actionParam()\" />\n </ng-template>\n }\n\n <ng-content />\n</div>\n", dependencies: [{ kind: "directive", type: CdkMenuTrigger, selector: "[cdkMenuTriggerFor]", inputs: ["cdkMenuTriggerFor", "cdkMenuPosition", "cdkMenuTriggerData", "cdkMenuTriggerTransformOriginOn"], outputs: ["cdkMenuOpened", "cdkMenuClosed"], exportAs: ["cdkMenuTriggerFor"] }, { kind: "directive", type: SiChatMessageActionDirective, selector: "[siChatMessageAction]" }, { kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "component", type: SiMenuFactoryComponent, selector: "si-menu-factory", inputs: ["items", "actionParam"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
100
|
+
}
|
|
101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiChatMessageActionsComponent, decorators: [{
|
|
102
|
+
type: Component,
|
|
103
|
+
args: [{ selector: 'si-chat-message-actions', imports: [
|
|
104
|
+
CdkMenuTrigger,
|
|
105
|
+
SiChatMessageActionDirective,
|
|
106
|
+
SiIconComponent,
|
|
107
|
+
SiMenuFactoryComponent,
|
|
108
|
+
SiTranslatePipe
|
|
109
|
+
], host: {
|
|
110
|
+
class: 'd-block'
|
|
111
|
+
}, template: "<div class=\"btn-group message-actions align-items-center\" role=\"group\" siChatMessageAction>\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost\"\n [class.btn-icon]=\"!!action.icon\"\n [disabled]=\"action.disabled\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"runAction(action)\"\n >\n @if (action.icon) {\n <si-icon [icon]=\"action.icon\" />\n } @else {\n {{ action.label | translate }}\n }\n </button>\n }\n\n @if (secondaryActions().length > 0) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"secondaryActionsMenu\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n [attr.title]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon [icon]=\"icons.elementOptionsVertical\" />\n </button>\n\n <ng-template #secondaryActionsMenu>\n <si-menu-factory [items]=\"secondaryActions()\" [actionParam]=\"actionParam()\" />\n </ng-template>\n }\n\n <ng-content />\n</div>\n" }]
|
|
112
|
+
}], propDecorators: { actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], secondaryActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryActions", required: false }] }], actionParam: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionParam", required: false }] }], secondaryActionsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryActionsLabel", required: false }] }] } });
|
|
113
|
+
|
|
53
114
|
/**
|
|
54
115
|
* Copyright (c) Siemens 2016 - 2026
|
|
55
116
|
* SPDX-License-Identifier: MIT
|
|
@@ -137,7 +198,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
137
198
|
* @experimental
|
|
138
199
|
*/
|
|
139
200
|
class SiAiMessageComponent {
|
|
140
|
-
icons = addIcons({ elementOptionsVertical });
|
|
141
201
|
/**
|
|
142
202
|
* The AI-generated message content
|
|
143
203
|
* @defaultValue ''
|
|
@@ -181,19 +241,16 @@ class SiAiMessageComponent {
|
|
|
181
241
|
/** Emitted when a source has been clicked. */
|
|
182
242
|
sourceClicked = output();
|
|
183
243
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiAiMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
184
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiAiMessageComponent, isStandalone: true, selector: "si-ai-message", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, secondaryActions: { classPropertyName: "secondaryActions", publicName: "secondaryActions", isSignal: true, isRequired: false, transformFunction: null }, actionParam: { classPropertyName: "actionParam", publicName: "actionParam", isSignal: true, isRequired: false, transformFunction: null }, sources: { classPropertyName: "sources", publicName: "sources", isSignal: true, isRequired: false, transformFunction: null }, secondaryActionsLabel: { classPropertyName: "secondaryActionsLabel", publicName: "secondaryActionsLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sourceClicked: "sourceClicked" }, ngImport: i0, template: "<si-chat-message alignment=\"start\" actionsPosition=\"bottom\" [loading]=\"loading()\">\n @if (content()) {\n <span class=\"text-pre-wrap\">{{ content() }}</span>\n } @else {\n <ng-content />\n }\n\n @let src = sources();\n @if (actions().length > 0 || secondaryActions().length > 0 || src?.length) {\n <
|
|
244
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiAiMessageComponent, isStandalone: true, selector: "si-ai-message", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, secondaryActions: { classPropertyName: "secondaryActions", publicName: "secondaryActions", isSignal: true, isRequired: false, transformFunction: null }, actionParam: { classPropertyName: "actionParam", publicName: "actionParam", isSignal: true, isRequired: false, transformFunction: null }, sources: { classPropertyName: "sources", publicName: "sources", isSignal: true, isRequired: false, transformFunction: null }, secondaryActionsLabel: { classPropertyName: "secondaryActionsLabel", publicName: "secondaryActionsLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sourceClicked: "sourceClicked" }, ngImport: i0, template: "<si-chat-message alignment=\"start\" actionsPosition=\"bottom\" [loading]=\"loading()\">\n @if (content()) {\n <span class=\"text-pre-wrap\">{{ content() }}</span>\n } @else {\n <ng-content />\n }\n\n @let src = sources();\n @if (actions().length > 0 || secondaryActions().length > 0 || src?.length) {\n <si-chat-message-actions\n class=\"ai-message-actions\"\n siChatMessageAction\n [actions]=\"actions()\"\n [secondaryActions]=\"secondaryActions()\"\n [actionParam]=\"actionParam()\"\n [secondaryActionsLabel]=\"secondaryActionsLabel()\"\n >\n @if (src?.length) {\n <si-source-chip\n showIcon\n showLabel\n [sources]=\"src\"\n (sourceClicked)=\"sourceClicked.emit($event)\"\n />\n }\n </si-chat-message-actions>\n }\n</si-chat-message>\n", styles: [":host{display:block}si-chat-message{--chat-message-bubble-bg: transparent;--chat-message-bubble-padding: 0;margin-block-end:calc(var(--si-sys-sizing-spacing-y-20) * -1)}.ai-message-actions{margin-block-start:calc(var(--si-sys-sizing-spacing-y-50) - var(--si-sys-sizing-spacing-y-20))}\n"], dependencies: [{ kind: "component", type: SiChatMessageComponent, selector: "si-chat-message", inputs: ["loading", "alignment", "actionsPosition"] }, { kind: "directive", type: SiChatMessageActionDirective, selector: "[siChatMessageAction]" }, { kind: "component", type: SiChatMessageActionsComponent, selector: "si-chat-message-actions", inputs: ["actions", "secondaryActions", "actionParam", "secondaryActionsLabel"] }, { kind: "component", type: SiSourceChipComponent, selector: "si-source-chip", inputs: ["showIcon", "showLabel", "sources", "compact", "disabled"], outputs: ["sourceClicked"] }] });
|
|
185
245
|
}
|
|
186
246
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiAiMessageComponent, decorators: [{
|
|
187
247
|
type: Component,
|
|
188
248
|
args: [{ selector: 'si-ai-message', imports: [
|
|
189
|
-
CdkMenuTrigger,
|
|
190
249
|
SiChatMessageComponent,
|
|
191
|
-
SiIconComponent,
|
|
192
|
-
SiMenuFactoryComponent,
|
|
193
250
|
SiChatMessageActionDirective,
|
|
194
|
-
|
|
251
|
+
SiChatMessageActionsComponent,
|
|
195
252
|
SiSourceChipComponent
|
|
196
|
-
], template: "<si-chat-message alignment=\"start\" actionsPosition=\"bottom\" [loading]=\"loading()\">\n @if (content()) {\n <span class=\"text-pre-wrap\">{{ content() }}</span>\n } @else {\n <ng-content />\n }\n\n @let src = sources();\n @if (actions().length > 0 || secondaryActions().length > 0 || src?.length) {\n <
|
|
253
|
+
], template: "<si-chat-message alignment=\"start\" actionsPosition=\"bottom\" [loading]=\"loading()\">\n @if (content()) {\n <span class=\"text-pre-wrap\">{{ content() }}</span>\n } @else {\n <ng-content />\n }\n\n @let src = sources();\n @if (actions().length > 0 || secondaryActions().length > 0 || src?.length) {\n <si-chat-message-actions\n class=\"ai-message-actions\"\n siChatMessageAction\n [actions]=\"actions()\"\n [secondaryActions]=\"secondaryActions()\"\n [actionParam]=\"actionParam()\"\n [secondaryActionsLabel]=\"secondaryActionsLabel()\"\n >\n @if (src?.length) {\n <si-source-chip\n showIcon\n showLabel\n [sources]=\"src\"\n (sourceClicked)=\"sourceClicked.emit($event)\"\n />\n }\n </si-chat-message-actions>\n }\n</si-chat-message>\n", styles: [":host{display:block}si-chat-message{--chat-message-bubble-bg: transparent;--chat-message-bubble-padding: 0;margin-block-end:calc(var(--si-sys-sizing-spacing-y-20) * -1)}.ai-message-actions{margin-block-start:calc(var(--si-sys-sizing-spacing-y-50) - var(--si-sys-sizing-spacing-y-20))}\n"] }]
|
|
197
254
|
}], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], secondaryActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryActions", required: false }] }], actionParam: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionParam", required: false }] }], sources: [{ type: i0.Input, args: [{ isSignal: true, alias: "sources", required: false }] }], secondaryActionsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryActionsLabel", required: false }] }], sourceClicked: [{ type: i0.Output, args: ["sourceClicked"] }] } });
|
|
198
255
|
|
|
199
256
|
/**
|
|
@@ -385,11 +442,11 @@ class SiAttachmentListComponent {
|
|
|
385
442
|
return this.icons.elementDocument;
|
|
386
443
|
}
|
|
387
444
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiAttachmentListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
388
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiAttachmentListComponent, isStandalone: true, selector: "si-attachment-list", inputs: { attachments: { classPropertyName: "attachments", publicName: "attachments", isSignal: true, isRequired: false, transformFunction: null }, alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, removeLabel: { classPropertyName: "removeLabel", publicName: "removeLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { remove: "remove" }, ngImport: i0, template: "<div class=\"d-flex flex-wrap gap-4\" [class.justify-content-end]=\"alignment() === 'end'\">\n @for (attachment of attachments(); track $index) {\n <div class=\"attachment-item d-flex align-items-stretch\" role=\"group\">\n @if (attachment.previewTemplate) {\n <button\n type=\"button\"\n class=\"attachment-main focus-inside d-flex align-items-center flex-grow-1 min-width-0\"\n [attr.title]=\"attachment.name\"\n [attr.aria-label]=\"attachment.name\"\n (click)=\"openPreview($event, attachment)\"\n (keydown.enter)=\"openPreview($event, attachment)\"\n (keydown.space)=\"openPreview($event, attachment)\"\n >\n <si-icon\n class=\"attachment-icon icon flex-shrink-0 m-2\"\n [icon]=\"getFileIcon(attachment.name)\"\n />\n <div class=\"attachment-info flex-grow-1 min-width-0\">\n <span\n class=\"attachment-name me-4 text-truncate si-body d-block\"\n [title]=\"attachment.name\"\n >\n {{ attachment.name }}\n </span>\n </div>\n </button>\n } @else {\n <div class=\"attachment-main--static d-flex align-items-center flex-grow-1 min-width-0\">\n <si-icon\n class=\"attachment-icon icon flex-shrink-0 m-2\"\n [icon]=\"getFileIcon(attachment.name)\"\n />\n <div class=\"attachment-info flex-grow-1 min-width-0\">\n <span\n class=\"attachment-name me-4 text-truncate si-body d-block\"\n [title]=\"attachment.name\"\n >\n {{ attachment.name }}\n </span>\n </div>\n </div>\n }\n\n @if (removable()) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-sm btn-icon expand-button flex-shrink-0 ms-auto align-self-center focus-inside m-2\"\n [attr.aria-label]=\"removeLabel() | translate: { attachment: attachment.name }\"\n (click)=\"remove.emit(attachment); $event.stopPropagation()\"\n >\n <si-icon class=\"icon\" [icon]=\"icons.elementStateClose\" />\n </button>\n }\n </div>\n }\n</div>\n", styles: [".attachment-item{border-radius:var(--
|
|
445
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiAttachmentListComponent, isStandalone: true, selector: "si-attachment-list", inputs: { attachments: { classPropertyName: "attachments", publicName: "attachments", isSignal: true, isRequired: false, transformFunction: null }, alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, removeLabel: { classPropertyName: "removeLabel", publicName: "removeLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { remove: "remove" }, ngImport: i0, template: "<div class=\"d-flex flex-wrap gap-4\" [class.justify-content-end]=\"alignment() === 'end'\">\n @for (attachment of attachments(); track $index) {\n <div class=\"attachment-item d-flex align-items-stretch\" role=\"group\">\n @if (attachment.previewTemplate) {\n <button\n type=\"button\"\n class=\"attachment-main focus-inside d-flex align-items-center flex-grow-1 min-width-0\"\n [attr.title]=\"attachment.name\"\n [attr.aria-label]=\"attachment.name\"\n (click)=\"openPreview($event, attachment)\"\n (keydown.enter)=\"openPreview($event, attachment)\"\n (keydown.space)=\"openPreview($event, attachment)\"\n >\n <si-icon\n class=\"attachment-icon icon flex-shrink-0 m-2\"\n [icon]=\"getFileIcon(attachment.name)\"\n />\n <div class=\"attachment-info flex-grow-1 min-width-0\">\n <span\n class=\"attachment-name me-4 text-truncate si-body d-block\"\n [title]=\"attachment.name\"\n >\n {{ attachment.name }}\n </span>\n </div>\n </button>\n } @else {\n <div class=\"attachment-main--static d-flex align-items-center flex-grow-1 min-width-0\">\n <si-icon\n class=\"attachment-icon icon flex-shrink-0 m-2\"\n [icon]=\"getFileIcon(attachment.name)\"\n />\n <div class=\"attachment-info flex-grow-1 min-width-0\">\n <span\n class=\"attachment-name me-4 text-truncate si-body d-block\"\n [title]=\"attachment.name\"\n >\n {{ attachment.name }}\n </span>\n </div>\n </div>\n }\n\n @if (removable()) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-sm btn-icon expand-button flex-shrink-0 ms-auto align-self-center focus-inside m-2\"\n [attr.aria-label]=\"removeLabel() | translate: { attachment: attachment.name }\"\n (click)=\"remove.emit(attachment); $event.stopPropagation()\"\n >\n <si-icon class=\"icon\" [icon]=\"icons.elementStateClose\" />\n </button>\n }\n </div>\n }\n</div>\n", styles: [".attachment-item{border-radius:var(--si-sys-sizing-border-radius-sm);overflow:hidden;background-color:var(--attachment-list-bg, transparent);color:var(--attachment-name-color, var(--si-sys-color-text-secondary));border:1px solid var(--si-sys-color-border-4)}.attachment-main{appearance:none;border:0;background:none;padding:0;margin:0;inline-size:100%;text-align:inherit;color:inherit;cursor:pointer}.attachment-icon{display:flex;align-items:center;justify-content:center;color:var(--si-sys-color-text-primary)}.attachment-info{display:flex;flex-direction:column;gap:2px;min-inline-size:0}.attachment-info .attachment-name{line-height:1.2}.attachment-info .attachment-size{line-height:1}.expand-button{border-radius:var(--si-sys-sizing-border-radius-sm)}\n"], dependencies: [{ kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
389
446
|
}
|
|
390
447
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiAttachmentListComponent, decorators: [{
|
|
391
448
|
type: Component,
|
|
392
|
-
args: [{ selector: 'si-attachment-list', imports: [SiIconComponent, SiTranslatePipe], template: "<div class=\"d-flex flex-wrap gap-4\" [class.justify-content-end]=\"alignment() === 'end'\">\n @for (attachment of attachments(); track $index) {\n <div class=\"attachment-item d-flex align-items-stretch\" role=\"group\">\n @if (attachment.previewTemplate) {\n <button\n type=\"button\"\n class=\"attachment-main focus-inside d-flex align-items-center flex-grow-1 min-width-0\"\n [attr.title]=\"attachment.name\"\n [attr.aria-label]=\"attachment.name\"\n (click)=\"openPreview($event, attachment)\"\n (keydown.enter)=\"openPreview($event, attachment)\"\n (keydown.space)=\"openPreview($event, attachment)\"\n >\n <si-icon\n class=\"attachment-icon icon flex-shrink-0 m-2\"\n [icon]=\"getFileIcon(attachment.name)\"\n />\n <div class=\"attachment-info flex-grow-1 min-width-0\">\n <span\n class=\"attachment-name me-4 text-truncate si-body d-block\"\n [title]=\"attachment.name\"\n >\n {{ attachment.name }}\n </span>\n </div>\n </button>\n } @else {\n <div class=\"attachment-main--static d-flex align-items-center flex-grow-1 min-width-0\">\n <si-icon\n class=\"attachment-icon icon flex-shrink-0 m-2\"\n [icon]=\"getFileIcon(attachment.name)\"\n />\n <div class=\"attachment-info flex-grow-1 min-width-0\">\n <span\n class=\"attachment-name me-4 text-truncate si-body d-block\"\n [title]=\"attachment.name\"\n >\n {{ attachment.name }}\n </span>\n </div>\n </div>\n }\n\n @if (removable()) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-sm btn-icon expand-button flex-shrink-0 ms-auto align-self-center focus-inside m-2\"\n [attr.aria-label]=\"removeLabel() | translate: { attachment: attachment.name }\"\n (click)=\"remove.emit(attachment); $event.stopPropagation()\"\n >\n <si-icon class=\"icon\" [icon]=\"icons.elementStateClose\" />\n </button>\n }\n </div>\n }\n</div>\n", styles: [".attachment-item{border-radius:var(--
|
|
449
|
+
args: [{ selector: 'si-attachment-list', imports: [SiIconComponent, SiTranslatePipe], template: "<div class=\"d-flex flex-wrap gap-4\" [class.justify-content-end]=\"alignment() === 'end'\">\n @for (attachment of attachments(); track $index) {\n <div class=\"attachment-item d-flex align-items-stretch\" role=\"group\">\n @if (attachment.previewTemplate) {\n <button\n type=\"button\"\n class=\"attachment-main focus-inside d-flex align-items-center flex-grow-1 min-width-0\"\n [attr.title]=\"attachment.name\"\n [attr.aria-label]=\"attachment.name\"\n (click)=\"openPreview($event, attachment)\"\n (keydown.enter)=\"openPreview($event, attachment)\"\n (keydown.space)=\"openPreview($event, attachment)\"\n >\n <si-icon\n class=\"attachment-icon icon flex-shrink-0 m-2\"\n [icon]=\"getFileIcon(attachment.name)\"\n />\n <div class=\"attachment-info flex-grow-1 min-width-0\">\n <span\n class=\"attachment-name me-4 text-truncate si-body d-block\"\n [title]=\"attachment.name\"\n >\n {{ attachment.name }}\n </span>\n </div>\n </button>\n } @else {\n <div class=\"attachment-main--static d-flex align-items-center flex-grow-1 min-width-0\">\n <si-icon\n class=\"attachment-icon icon flex-shrink-0 m-2\"\n [icon]=\"getFileIcon(attachment.name)\"\n />\n <div class=\"attachment-info flex-grow-1 min-width-0\">\n <span\n class=\"attachment-name me-4 text-truncate si-body d-block\"\n [title]=\"attachment.name\"\n >\n {{ attachment.name }}\n </span>\n </div>\n </div>\n }\n\n @if (removable()) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-sm btn-icon expand-button flex-shrink-0 ms-auto align-self-center focus-inside m-2\"\n [attr.aria-label]=\"removeLabel() | translate: { attachment: attachment.name }\"\n (click)=\"remove.emit(attachment); $event.stopPropagation()\"\n >\n <si-icon class=\"icon\" [icon]=\"icons.elementStateClose\" />\n </button>\n }\n </div>\n }\n</div>\n", styles: [".attachment-item{border-radius:var(--si-sys-sizing-border-radius-sm);overflow:hidden;background-color:var(--attachment-list-bg, transparent);color:var(--attachment-name-color, var(--si-sys-color-text-secondary));border:1px solid var(--si-sys-color-border-4)}.attachment-main{appearance:none;border:0;background:none;padding:0;margin:0;inline-size:100%;text-align:inherit;color:inherit;cursor:pointer}.attachment-icon{display:flex;align-items:center;justify-content:center;color:var(--si-sys-color-text-primary)}.attachment-info{display:flex;flex-direction:column;gap:2px;min-inline-size:0}.attachment-info .attachment-name{line-height:1.2}.attachment-info .attachment-size{line-height:1}.expand-button{border-radius:var(--si-sys-sizing-border-radius-sm)}\n"] }]
|
|
393
450
|
}], propDecorators: { attachments: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachments", required: false }] }], alignment: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignment", required: false }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], removeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeLabel", required: false }] }], remove: [{ type: i0.Output, args: ["remove"] }] } });
|
|
394
451
|
|
|
395
452
|
/**
|
|
@@ -564,14 +621,14 @@ class SiChatContainerComponent {
|
|
|
564
621
|
container?.nativeElement.focus();
|
|
565
622
|
}
|
|
566
623
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiChatContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
567
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", type: SiChatContainerComponent, isStandalone: true, selector: "si-chat-container", inputs: { colorVariant: { classPropertyName: "colorVariant", publicName: "colorVariant", isSignal: true, isRequired: false, transformFunction: null }, noAutoScroll: { classPropertyName: "noAutoScroll", publicName: "noAutoScroll", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "colorVariant()" }, classAttribute: "d-flex si-layout-inner flex-grow-1 flex-column h-100 w-100" }, viewQueries: [{ propertyName: "messagesContainer", first: true, predicate: ["messagesContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"chat-container d-flex flex-column flex-grow-1 px-6 py-6 w-100\">\n <div\n #messagesContainer\n class=\"messages-container d-flex flex-column flex-grow-1 w-100 align-self-center\"\n tabindex=\"0\"\n (scroll)=\"onScroll()\"\n >\n <ng-content />\n </div>\n\n <div class=\"chat-input-area py-3 pt-0 mt-6 d-flex flex-column align-items-center\">\n <ng-content select=\"si-inline-notification\" />\n <ng-content select=\"si-chat-input,[siChatContainerInput]\" />\n </div>\n</div>\n", styles: [":host{overflow-y:hidden;overflow-x:visible}:host.base-0{background-color:var(--si-sys-color-background-0)}:host.base-1{background-color:var(--si-sys-color-background-1)}.chat-container.initialized{scroll-behavior:smooth}::ng-deep .chat-container:has(si-ai-welcome-screen){inline-size:100%;padding-inline-start:0!important;padding-inline-end:0!important}::ng-deep .chat-container:has(si-ai-welcome-screen) :is(.chat-input-area,si-ai-welcome-screen){padding-inline-start:var(--si-sys-sizing-spacing-x-60);padding-inline-end:var(--si-sys-sizing-spacing-x-60)}.chat-container{min-block-size:0;overflow-y:auto;overflow-x:visible}.messages-container{overflow-y:auto;overflow-x:visible;min-block-size:5rem;gap:calc(var(--si-sys-sizing-spacing-y-90) + var(--si-sys-sizing-spacing-y-40)) calc(var(--si-sys-sizing-spacing-x-90) + var(--si-sys-sizing-spacing-x-40))}.messages-container ::ng-deep si-user-message:not(.last),.messages-container>::ng-deep si-activity-message:has(+si-activity-message){margin-block-end:calc(-1 * (var(--si-sys-sizing-spacing-y-90) + var(--si-sys-sizing-spacing-y-40)))}.messages-container>::ng-deep :is(si-activity-message,si-activity-trace):has(+si-ai-message),.messages-container>::ng-deep si-ai-message:has(+:is(si-activity-message,si-activity-trace)){margin-block-end:calc(-1 * (var(--si-sys-sizing-spacing-y-90) + var(--si-sys-sizing-spacing-y-40)) + var(--si-sys-sizing-spacing-y-60))}::ng-deep .messages-container:not(:has(si-ai-welcome-screen)){max-inline-size:720px}::ng-deep .messages-container:has(si-ai-welcome-screen){inline-size:100%}.chat-input-area{justify-self:flex-end;align-self:center;overflow:visible;inline-size:100%}.chat-input-area>::ng-deep *{max-inline-size:720px}::ng-deep .chat-input-area:empty:not(:has(si-inline-notification)),::ng-deep .chat-input-area:has([sichatcontainerinput]:empty):not(:has(si-inline-notification)){display:none!important}.chat-input-area:empty ::ng-deep>si-inline-notification,.chat-input-area:empty ::ng-deep *>si-inline-notification,.chat-input-area:has([sichatcontainerinput]:empty) ::ng-deep>si-inline-notification,.chat-input-area:has([sichatcontainerinput]:empty) ::ng-deep *>si-inline-notification{margin-block-end:0!important}.chat-container:has(.messages-container:not(:empty)) .messages-empty-state{display:none!important}:host-context(.si-container-xs,.si-container-sm) ::ng-deep si-inline-notification :is(.alert,.alert-link){font-size:var(--si-sys-typography-font-size
|
|
624
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", type: SiChatContainerComponent, isStandalone: true, selector: "si-chat-container", inputs: { colorVariant: { classPropertyName: "colorVariant", publicName: "colorVariant", isSignal: true, isRequired: false, transformFunction: null }, noAutoScroll: { classPropertyName: "noAutoScroll", publicName: "noAutoScroll", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "colorVariant()" }, classAttribute: "d-flex si-layout-inner flex-grow-1 flex-column h-100 w-100" }, viewQueries: [{ propertyName: "messagesContainer", first: true, predicate: ["messagesContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"chat-container d-flex flex-column flex-grow-1 px-6 py-6 w-100\">\n <div\n #messagesContainer\n class=\"messages-container d-flex flex-column flex-grow-1 w-100 align-self-center\"\n tabindex=\"0\"\n (scroll)=\"onScroll()\"\n >\n <ng-content />\n </div>\n\n <div class=\"chat-input-area py-3 pt-0 mt-6 d-flex flex-column align-items-center\">\n <ng-content select=\"si-inline-notification\" />\n <ng-content select=\"si-chat-input,[siChatContainerInput]\" />\n </div>\n</div>\n", styles: [":host{overflow-y:hidden;overflow-x:visible}:host.base-0{background-color:var(--si-sys-color-background-0)}:host.base-1{background-color:var(--si-sys-color-background-1)}.chat-container.initialized{scroll-behavior:smooth}::ng-deep .chat-container:has(si-ai-welcome-screen){inline-size:100%;padding-inline-start:0!important;padding-inline-end:0!important}::ng-deep .chat-container:has(si-ai-welcome-screen) :is(.chat-input-area,si-ai-welcome-screen){padding-inline-start:var(--si-sys-sizing-spacing-x-60);padding-inline-end:var(--si-sys-sizing-spacing-x-60)}.chat-container{min-block-size:0;overflow-y:auto;overflow-x:visible}.messages-container{overflow-y:auto;overflow-x:visible;min-block-size:5rem;gap:calc(var(--si-sys-sizing-spacing-y-90) + var(--si-sys-sizing-spacing-y-40)) calc(var(--si-sys-sizing-spacing-x-90) + var(--si-sys-sizing-spacing-x-40))}.messages-container ::ng-deep si-user-message:not(.last),.messages-container>::ng-deep si-activity-message:has(+si-activity-message){margin-block-end:calc(-1 * (var(--si-sys-sizing-spacing-y-90) + var(--si-sys-sizing-spacing-y-40)))}.messages-container>::ng-deep :is(si-activity-message,si-activity-trace):has(+si-ai-message),.messages-container>::ng-deep si-ai-message:has(+:is(si-activity-message,si-activity-trace)){margin-block-end:calc(-1 * (var(--si-sys-sizing-spacing-y-90) + var(--si-sys-sizing-spacing-y-40)) + var(--si-sys-sizing-spacing-y-60))}::ng-deep .messages-container:not(:has(si-ai-welcome-screen)){max-inline-size:720px}::ng-deep .messages-container:has(si-ai-welcome-screen){inline-size:100%}.chat-input-area{justify-self:flex-end;align-self:center;overflow:visible;inline-size:100%}.chat-input-area>::ng-deep *{max-inline-size:720px}::ng-deep .chat-input-area:empty:not(:has(si-inline-notification)),::ng-deep .chat-input-area:has([sichatcontainerinput]:empty):not(:has(si-inline-notification)){display:none!important}.chat-input-area:empty ::ng-deep>si-inline-notification,.chat-input-area:empty ::ng-deep *>si-inline-notification,.chat-input-area:has([sichatcontainerinput]:empty) ::ng-deep>si-inline-notification,.chat-input-area:has([sichatcontainerinput]:empty) ::ng-deep *>si-inline-notification{margin-block-end:0!important}.chat-container:has(.messages-container:not(:empty)) .messages-empty-state{display:none!important}:host-context(.si-container-xs,.si-container-sm) ::ng-deep si-inline-notification :is(.alert,.alert-link){font-size:var(--si-sys-typography-body-font-size)}\n"] });
|
|
568
625
|
}
|
|
569
626
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiChatContainerComponent, decorators: [{
|
|
570
627
|
type: Component,
|
|
571
628
|
args: [{ selector: 'si-chat-container', host: {
|
|
572
629
|
class: 'd-flex si-layout-inner flex-grow-1 flex-column h-100 w-100',
|
|
573
630
|
'[class]': 'colorVariant()'
|
|
574
|
-
}, template: "<div class=\"chat-container d-flex flex-column flex-grow-1 px-6 py-6 w-100\">\n <div\n #messagesContainer\n class=\"messages-container d-flex flex-column flex-grow-1 w-100 align-self-center\"\n tabindex=\"0\"\n (scroll)=\"onScroll()\"\n >\n <ng-content />\n </div>\n\n <div class=\"chat-input-area py-3 pt-0 mt-6 d-flex flex-column align-items-center\">\n <ng-content select=\"si-inline-notification\" />\n <ng-content select=\"si-chat-input,[siChatContainerInput]\" />\n </div>\n</div>\n", styles: [":host{overflow-y:hidden;overflow-x:visible}:host.base-0{background-color:var(--si-sys-color-background-0)}:host.base-1{background-color:var(--si-sys-color-background-1)}.chat-container.initialized{scroll-behavior:smooth}::ng-deep .chat-container:has(si-ai-welcome-screen){inline-size:100%;padding-inline-start:0!important;padding-inline-end:0!important}::ng-deep .chat-container:has(si-ai-welcome-screen) :is(.chat-input-area,si-ai-welcome-screen){padding-inline-start:var(--si-sys-sizing-spacing-x-60);padding-inline-end:var(--si-sys-sizing-spacing-x-60)}.chat-container{min-block-size:0;overflow-y:auto;overflow-x:visible}.messages-container{overflow-y:auto;overflow-x:visible;min-block-size:5rem;gap:calc(var(--si-sys-sizing-spacing-y-90) + var(--si-sys-sizing-spacing-y-40)) calc(var(--si-sys-sizing-spacing-x-90) + var(--si-sys-sizing-spacing-x-40))}.messages-container ::ng-deep si-user-message:not(.last),.messages-container>::ng-deep si-activity-message:has(+si-activity-message){margin-block-end:calc(-1 * (var(--si-sys-sizing-spacing-y-90) + var(--si-sys-sizing-spacing-y-40)))}.messages-container>::ng-deep :is(si-activity-message,si-activity-trace):has(+si-ai-message),.messages-container>::ng-deep si-ai-message:has(+:is(si-activity-message,si-activity-trace)){margin-block-end:calc(-1 * (var(--si-sys-sizing-spacing-y-90) + var(--si-sys-sizing-spacing-y-40)) + var(--si-sys-sizing-spacing-y-60))}::ng-deep .messages-container:not(:has(si-ai-welcome-screen)){max-inline-size:720px}::ng-deep .messages-container:has(si-ai-welcome-screen){inline-size:100%}.chat-input-area{justify-self:flex-end;align-self:center;overflow:visible;inline-size:100%}.chat-input-area>::ng-deep *{max-inline-size:720px}::ng-deep .chat-input-area:empty:not(:has(si-inline-notification)),::ng-deep .chat-input-area:has([sichatcontainerinput]:empty):not(:has(si-inline-notification)){display:none!important}.chat-input-area:empty ::ng-deep>si-inline-notification,.chat-input-area:empty ::ng-deep *>si-inline-notification,.chat-input-area:has([sichatcontainerinput]:empty) ::ng-deep>si-inline-notification,.chat-input-area:has([sichatcontainerinput]:empty) ::ng-deep *>si-inline-notification{margin-block-end:0!important}.chat-container:has(.messages-container:not(:empty)) .messages-empty-state{display:none!important}:host-context(.si-container-xs,.si-container-sm) ::ng-deep si-inline-notification :is(.alert,.alert-link){font-size:var(--si-sys-typography-font-size
|
|
631
|
+
}, template: "<div class=\"chat-container d-flex flex-column flex-grow-1 px-6 py-6 w-100\">\n <div\n #messagesContainer\n class=\"messages-container d-flex flex-column flex-grow-1 w-100 align-self-center\"\n tabindex=\"0\"\n (scroll)=\"onScroll()\"\n >\n <ng-content />\n </div>\n\n <div class=\"chat-input-area py-3 pt-0 mt-6 d-flex flex-column align-items-center\">\n <ng-content select=\"si-inline-notification\" />\n <ng-content select=\"si-chat-input,[siChatContainerInput]\" />\n </div>\n</div>\n", styles: [":host{overflow-y:hidden;overflow-x:visible}:host.base-0{background-color:var(--si-sys-color-background-0)}:host.base-1{background-color:var(--si-sys-color-background-1)}.chat-container.initialized{scroll-behavior:smooth}::ng-deep .chat-container:has(si-ai-welcome-screen){inline-size:100%;padding-inline-start:0!important;padding-inline-end:0!important}::ng-deep .chat-container:has(si-ai-welcome-screen) :is(.chat-input-area,si-ai-welcome-screen){padding-inline-start:var(--si-sys-sizing-spacing-x-60);padding-inline-end:var(--si-sys-sizing-spacing-x-60)}.chat-container{min-block-size:0;overflow-y:auto;overflow-x:visible}.messages-container{overflow-y:auto;overflow-x:visible;min-block-size:5rem;gap:calc(var(--si-sys-sizing-spacing-y-90) + var(--si-sys-sizing-spacing-y-40)) calc(var(--si-sys-sizing-spacing-x-90) + var(--si-sys-sizing-spacing-x-40))}.messages-container ::ng-deep si-user-message:not(.last),.messages-container>::ng-deep si-activity-message:has(+si-activity-message){margin-block-end:calc(-1 * (var(--si-sys-sizing-spacing-y-90) + var(--si-sys-sizing-spacing-y-40)))}.messages-container>::ng-deep :is(si-activity-message,si-activity-trace):has(+si-ai-message),.messages-container>::ng-deep si-ai-message:has(+:is(si-activity-message,si-activity-trace)){margin-block-end:calc(-1 * (var(--si-sys-sizing-spacing-y-90) + var(--si-sys-sizing-spacing-y-40)) + var(--si-sys-sizing-spacing-y-60))}::ng-deep .messages-container:not(:has(si-ai-welcome-screen)){max-inline-size:720px}::ng-deep .messages-container:has(si-ai-welcome-screen){inline-size:100%}.chat-input-area{justify-self:flex-end;align-self:center;overflow:visible;inline-size:100%}.chat-input-area>::ng-deep *{max-inline-size:720px}::ng-deep .chat-input-area:empty:not(:has(si-inline-notification)),::ng-deep .chat-input-area:has([sichatcontainerinput]:empty):not(:has(si-inline-notification)){display:none!important}.chat-input-area:empty ::ng-deep>si-inline-notification,.chat-input-area:empty ::ng-deep *>si-inline-notification,.chat-input-area:has([sichatcontainerinput]:empty) ::ng-deep>si-inline-notification,.chat-input-area:has([sichatcontainerinput]:empty) ::ng-deep *>si-inline-notification{margin-block-end:0!important}.chat-container:has(.messages-container:not(:empty)) .messages-empty-state{display:none!important}:host-context(.si-container-xs,.si-container-sm) ::ng-deep si-inline-notification :is(.alert,.alert-link){font-size:var(--si-sys-typography-body-font-size)}\n"] }]
|
|
575
632
|
}], ctorParameters: () => [], propDecorators: { messagesContainer: [{ type: i0.ViewChild, args: ['messagesContainer', { isSignal: true }] }], colorVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "colorVariant", required: false }] }], noAutoScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "noAutoScroll", required: false }] }] } });
|
|
576
633
|
|
|
577
634
|
/**
|
|
@@ -610,6 +667,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
610
667
|
}]
|
|
611
668
|
}] });
|
|
612
669
|
|
|
670
|
+
/**
|
|
671
|
+
* Copyright (c) Siemens 2016 - 2026
|
|
672
|
+
* SPDX-License-Identifier: MIT
|
|
673
|
+
*/
|
|
674
|
+
/**
|
|
675
|
+
* Optional parent contract for {@link SiChatInputComponent}.
|
|
676
|
+
*/
|
|
677
|
+
const SI_CHAT_INPUT_PARENT = new InjectionToken('si.chat-input.parent');
|
|
678
|
+
|
|
613
679
|
/**
|
|
614
680
|
* Copyright (c) Siemens 2016 - 2026
|
|
615
681
|
* SPDX-License-Identifier: MIT
|
|
@@ -628,6 +694,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
628
694
|
* - Displaying primary and secondary actions.
|
|
629
695
|
*
|
|
630
696
|
* Additionally to the inputs and outputs documented here, the component supports content projection via the following slots:
|
|
697
|
+
*
|
|
631
698
|
* - Default content: Custom action buttons to display inline, prefer using the `actions` input for buttons, can be used in addition.
|
|
632
699
|
* - `siChatInputDisclaimer` selector: Custom disclaimer content to display below the input area, prefer using the `disclaimer` input for simple text disclaimers.
|
|
633
700
|
*
|
|
@@ -650,6 +717,16 @@ class SiChatInputComponent {
|
|
|
650
717
|
elementSendFilled,
|
|
651
718
|
elementStopFilled
|
|
652
719
|
});
|
|
720
|
+
parent = inject(SI_CHAT_INPUT_PARENT, { optional: true });
|
|
721
|
+
constructor() {
|
|
722
|
+
effect(() => {
|
|
723
|
+
const parent = this.parent;
|
|
724
|
+
if (parent) {
|
|
725
|
+
this.sending.set(parent.inputSending());
|
|
726
|
+
this.interruptible.set(parent.inputInterruptible());
|
|
727
|
+
}
|
|
728
|
+
});
|
|
729
|
+
}
|
|
653
730
|
/**
|
|
654
731
|
* Current input value
|
|
655
732
|
* @defaultValue ''
|
|
@@ -675,14 +752,16 @@ class SiChatInputComponent {
|
|
|
675
752
|
* Whether a message is currently being sent, also prevent the sending of new ones while still allowing the user to type
|
|
676
753
|
* @defaultValue false
|
|
677
754
|
*/
|
|
678
|
-
sending =
|
|
755
|
+
sending = model(false, /* @ts-ignore */
|
|
756
|
+
...(ngDevMode ? [{ debugName: "sending" }] : /* istanbul ignore next */ []));
|
|
679
757
|
/**
|
|
680
758
|
* Whether the input supports interrupting ongoing operations. When active,
|
|
681
759
|
* the send button transforms into an interrupt button (with element-stop-filled icon).
|
|
682
760
|
* If sending is true, the interrupt button will be disabled.
|
|
683
761
|
* @defaultValue false
|
|
684
762
|
*/
|
|
685
|
-
interruptible =
|
|
763
|
+
interruptible = model(false, /* @ts-ignore */
|
|
764
|
+
...(ngDevMode ? [{ debugName: "interruptible" }] : /* istanbul ignore next */ []));
|
|
686
765
|
/**
|
|
687
766
|
* Maximum number of characters allowed
|
|
688
767
|
*/
|
|
@@ -879,6 +958,15 @@ class SiChatInputComponent {
|
|
|
879
958
|
dragOver = signal(false, /* @ts-ignore */
|
|
880
959
|
...(ngDevMode ? [{ debugName: "dragOver" }] : /* istanbul ignore next */ []));
|
|
881
960
|
injector = inject(Injector);
|
|
961
|
+
menuActionService = inject(SiMenuActionService, { optional: true });
|
|
962
|
+
runAction(action) {
|
|
963
|
+
if (typeof action.action === 'function') {
|
|
964
|
+
action.action(this.actionParam(), action);
|
|
965
|
+
}
|
|
966
|
+
else {
|
|
967
|
+
this.menuActionService?.actionTriggered(action, this.actionParam());
|
|
968
|
+
}
|
|
969
|
+
}
|
|
882
970
|
onInputChange(value) {
|
|
883
971
|
this.value.set(value);
|
|
884
972
|
}
|
|
@@ -898,6 +986,7 @@ class SiChatInputComponent {
|
|
|
898
986
|
content: this.value(),
|
|
899
987
|
attachments: this.attachments()
|
|
900
988
|
});
|
|
989
|
+
this.parent?.onInputSend();
|
|
901
990
|
this.value.set('');
|
|
902
991
|
this.attachments.set([]);
|
|
903
992
|
}
|
|
@@ -1017,7 +1106,7 @@ class SiChatInputComponent {
|
|
|
1017
1106
|
textarea.style.height = finalHeight + 'px';
|
|
1018
1107
|
}
|
|
1019
1108
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiChatInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1020
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiChatInputComponent, isStandalone: true, selector: "si-chat-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, sending: { classPropertyName: "sending", publicName: "sending", isSignal: true, isRequired: false, transformFunction: null }, interruptible: { classPropertyName: "interruptible", publicName: "interruptible", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, disclaimer: { classPropertyName: "disclaimer", publicName: "disclaimer", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, secondaryActions: { classPropertyName: "secondaryActions", publicName: "secondaryActions", isSignal: true, isRequired: false, transformFunction: null }, allowAttachments: { classPropertyName: "allowAttachments", publicName: "allowAttachments", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, attachments: { classPropertyName: "attachments", publicName: "attachments", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, actionParam: { classPropertyName: "actionParam", publicName: "actionParam", isSignal: true, isRequired: false, transformFunction: null }, sendButtonLabel: { classPropertyName: "sendButtonLabel", publicName: "sendButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, sendButtonIcon: { classPropertyName: "sendButtonIcon", publicName: "sendButtonIcon", isSignal: true, isRequired: false, transformFunction: null }, interruptButtonLabel: { classPropertyName: "interruptButtonLabel", publicName: "interruptButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, attachFileLabel: { classPropertyName: "attachFileLabel", publicName: "attachFileLabel", isSignal: true, isRequired: false, transformFunction: null }, removeAttachmentLabel: { classPropertyName: "removeAttachmentLabel", publicName: "removeAttachmentLabel", isSignal: true, isRequired: false, transformFunction: null }, secondaryActionsLabel: { classPropertyName: "secondaryActionsLabel", publicName: "secondaryActionsLabel", isSignal: true, isRequired: false, transformFunction: null }, followUpPrompts: { classPropertyName: "followUpPrompts", publicName: "followUpPrompts", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", attachments: "attachmentsChange", followUpPromptSelected: "followUpPromptSelected", send: "send", interrupt: "interrupt", fileError: "fileError" }, viewQueries: [{ propertyName: "textInput", first: true, predicate: ["textInput"], descendants: true, isSignal: true }, { propertyName: "fileUploadDirective", first: true, predicate: SiFileUploadDirective, descendants: true, isSignal: true }, { propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (followUpPrompts().length) {\n <div class=\"follow-up-prompts d-flex flex-wrap gap-4 mb-4\">\n @for (prompt of followUpPrompts(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-secondary-ghost fw-normal\"\n [disabled]=\"disabled() || sending()\"\n (click)=\"selectFollowUpPrompt(prompt)\"\n >{{ prompt }}</button\n >\n }\n </div>\n}\n\n<div\n class=\"input-wrapper border rounded-3\"\n [class.drag-over]=\"dragOver()\"\n (click)=\"onContainerClick($event)\"\n (drop)=\"dropHandler($event)\"\n (dragover)=\"dragOverHandler($event)\"\n (dragleave)=\"dragOver.set(false)\"\n>\n @if (hasAttachments()) {\n <si-attachment-list\n [attachments]=\"attachments()\"\n [removeLabel]=\"removeAttachmentLabel()\"\n [removable]=\"true\"\n (remove)=\"removeAttachment($event)\"\n />\n }\n\n <div class=\"si-body-paragraph\">\n <label class=\"form-label d-none\" [for]=\"id\">{{ label() | translate }}</label>\n <textarea\n #textInput\n class=\"chat-textarea w-100 border-0\"\n rows=\"1\"\n [id]=\"id\"\n [placeholder]=\"placeholder() | translate\"\n [disabled]=\"disabled()\"\n [maxlength]=\"maxLength() || null\"\n [(ngModel)]=\"value\"\n (keydown)=\"onKeyDown($event)\"\n (input)=\"adjustTextareaHeight($event)\"\n ></textarea>\n </div>\n\n <div class=\"d-flex align-items-center justify-content-between\">\n <div class=\"d-flex align-items-center gap-0\">\n <div class=\"btn-group\" role=\"group\">\n @if (allowAttachments()) {\n <input\n #fileInput\n type=\"file\"\n class=\"d-none\"\n siFileUpload\n [accept]=\"accept()\"\n [maxFileSize]=\"maxFileSize()\"\n [multiple]=\"true\"\n (validFiles)=\"onFilesAdded($event)\"\n (fileError)=\"onFileError($event)\"\n />\n }\n\n @if (allowAttachments() && !hasSecondaryActions()) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-icon\"\n [disabled]=\"disabled()\"\n [siTooltip]=\"attachFileLabel() | translate\"\n [attr.aria-label]=\"attachFileLabel() | translate\"\n (click)=\"triggerFileInput()\"\n >\n <si-icon [icon]=\"icons.elementAttachment\" />\n </button>\n }\n\n @if (hasMenuActions()) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"allActionsMenu\"\n [siTooltip]=\"secondaryActionsLabel() | translate\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon [icon]=\"icons.elementPlus\" />\n </button>\n\n <ng-template #allActionsMenu>\n <si-menu-factory [items]=\"combinedMenuActions()\" [actionParam]=\"actionParam()\" />\n </ng-template>\n }\n @if (hasActions()) {\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-icon\"\n [disabled]=\"action.disabled\"\n [siTooltip]=\"action.label | translate\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"action.action(actionParam(), action)\"\n >\n <si-icon [icon]=\"action.icon\" />\n </button>\n }\n }\n </div>\n <div class=\"d-flex align-items-center gap-0\">\n <ng-content />\n </div>\n </div>\n\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-icon\"\n [disabled]=\"buttonDisabled()\"\n [attr.aria-label]=\"buttonLabel() | translate\"\n (click)=\"onButtonClick()\"\n >\n <si-icon class=\"text-accent\" [icon]=\"buttonIcon()\" />\n </button>\n </div>\n</div>\n\n<div class=\"disclaimer-wrapper text-center mt-4 px-3\">\n @if (disclaimer()) {\n <span class=\"si-body-sm text-secondary d-block\">{{ disclaimer() | translate }}</span>\n }\n <ng-content select=\"[siChatInputDisclaimer]\" />\n</div>\n", styles: [":host{max-inline-size:720px}.input-wrapper{border-color:var(--si-sys-color-border-4);background-color:var(--si-sys-color-background-1);padding-block:var(--si-sys-sizing-spacing-y-50) var(--si-sys-sizing-spacing-y-40);padding-inline:var(--si-sys-sizing-spacing-x-50);display:flex;flex-direction:column;gap:var(--si-sys-sizing-spacing-y-50) var(--si-sys-sizing-spacing-x-50)}.input-wrapper:hover,.input-wrapper:active,.input-wrapper:focus-within{background-color:var(--si-sys-color-background-4);border-color:var(--si-sys-color-border-1)}.input-wrapper.drag-over{border:1px solid var(--si-sys-color-effects-focus);box-shadow:0 0 0 1px var(--si-sys-color-effects-focus)}.chat-textarea{min-block-size:1lh;font-family:inherit;padding-block:0;display:block;outline:none;resize:none;background-color:transparent}.chat-textarea::placeholder{color:var(--si-sys-color-text-secondary)}.chat-textarea:disabled{background-color:transparent;color:var(--si-sys-color-text-disabled);cursor:not-allowed}.chat-textarea:disabled::placeholder{color:var(--si-sys-color-text-disabled)}.input-wrapper:has(.chat-textarea:focus-visible){outline:var(--element-button-focus-width) solid var(--si-sys-color-effects-focus);outline-offset:var(--element-button-focus-overlay-width)}.disclaimer-wrapper:empty{display:none}\n"], dependencies: [{ kind: "directive", type: CdkMenuTrigger, selector: "[cdkMenuTriggerFor]", inputs: ["cdkMenuTriggerFor", "cdkMenuPosition", "cdkMenuTriggerData", "cdkMenuTriggerTransformOriginOn"], outputs: ["cdkMenuOpened", "cdkMenuClosed"], exportAs: ["cdkMenuTriggerFor"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "component", type: SiAttachmentListComponent, selector: "si-attachment-list", inputs: ["attachments", "alignment", "removable", "removeLabel"], outputs: ["remove"] }, { kind: "component", type: SiMenuFactoryComponent, selector: "si-menu-factory", inputs: ["items", "actionParam"] }, { kind: "directive", type: SiFileUploadDirective, selector: "input[type=\"file\"][siFileUpload]", inputs: ["errorTextFileType", "errorTextFileMaxSize", "accept", "maxFileSize", "multiple", "directoryUpload"], outputs: ["validFiles", "filesAdded", "fileError"] }, { kind: "directive", type: SiTooltipDirective, selector: "[siTooltip]", inputs: ["siTooltip", "placement", "isDisabled", "tooltipScrollStrategy", "tooltipContext"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
1109
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiChatInputComponent, isStandalone: true, selector: "si-chat-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, sending: { classPropertyName: "sending", publicName: "sending", isSignal: true, isRequired: false, transformFunction: null }, interruptible: { classPropertyName: "interruptible", publicName: "interruptible", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, disclaimer: { classPropertyName: "disclaimer", publicName: "disclaimer", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, secondaryActions: { classPropertyName: "secondaryActions", publicName: "secondaryActions", isSignal: true, isRequired: false, transformFunction: null }, allowAttachments: { classPropertyName: "allowAttachments", publicName: "allowAttachments", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, attachments: { classPropertyName: "attachments", publicName: "attachments", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, actionParam: { classPropertyName: "actionParam", publicName: "actionParam", isSignal: true, isRequired: false, transformFunction: null }, sendButtonLabel: { classPropertyName: "sendButtonLabel", publicName: "sendButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, sendButtonIcon: { classPropertyName: "sendButtonIcon", publicName: "sendButtonIcon", isSignal: true, isRequired: false, transformFunction: null }, interruptButtonLabel: { classPropertyName: "interruptButtonLabel", publicName: "interruptButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, attachFileLabel: { classPropertyName: "attachFileLabel", publicName: "attachFileLabel", isSignal: true, isRequired: false, transformFunction: null }, removeAttachmentLabel: { classPropertyName: "removeAttachmentLabel", publicName: "removeAttachmentLabel", isSignal: true, isRequired: false, transformFunction: null }, secondaryActionsLabel: { classPropertyName: "secondaryActionsLabel", publicName: "secondaryActionsLabel", isSignal: true, isRequired: false, transformFunction: null }, followUpPrompts: { classPropertyName: "followUpPrompts", publicName: "followUpPrompts", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", sending: "sendingChange", interruptible: "interruptibleChange", attachments: "attachmentsChange", followUpPromptSelected: "followUpPromptSelected", send: "send", interrupt: "interrupt", fileError: "fileError" }, viewQueries: [{ propertyName: "textInput", first: true, predicate: ["textInput"], descendants: true, isSignal: true }, { propertyName: "fileUploadDirective", first: true, predicate: SiFileUploadDirective, descendants: true, isSignal: true }, { propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (followUpPrompts().length) {\n <div class=\"follow-up-prompts d-flex flex-wrap gap-4 mb-4\">\n @for (prompt of followUpPrompts(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-secondary-ghost fw-normal\"\n [disabled]=\"disabled() || sending()\"\n (click)=\"selectFollowUpPrompt(prompt)\"\n >{{ prompt }}</button\n >\n }\n </div>\n}\n\n<div\n class=\"input-wrapper border rounded-3\"\n [class.drag-over]=\"dragOver()\"\n (click)=\"onContainerClick($event)\"\n (drop)=\"dropHandler($event)\"\n (dragover)=\"dragOverHandler($event)\"\n (dragleave)=\"dragOver.set(false)\"\n>\n @if (hasAttachments()) {\n <si-attachment-list\n [attachments]=\"attachments()\"\n [removeLabel]=\"removeAttachmentLabel()\"\n [removable]=\"true\"\n (remove)=\"removeAttachment($event)\"\n />\n }\n\n <div class=\"si-body-paragraph\">\n <label class=\"form-label d-none\" [for]=\"id\">{{ label() | translate }}</label>\n <textarea\n #textInput\n class=\"chat-textarea w-100 border-0\"\n rows=\"1\"\n [id]=\"id\"\n [placeholder]=\"placeholder() | translate\"\n [disabled]=\"disabled()\"\n [maxlength]=\"maxLength() || null\"\n [(ngModel)]=\"value\"\n (keydown)=\"onKeyDown($event)\"\n (input)=\"adjustTextareaHeight($event)\"\n ></textarea>\n </div>\n\n <div class=\"d-flex align-items-center justify-content-between\">\n <div class=\"d-flex align-items-center gap-0\">\n <div class=\"btn-group\" role=\"group\">\n @if (allowAttachments()) {\n <input\n #fileInput\n type=\"file\"\n class=\"d-none\"\n siFileUpload\n [accept]=\"accept()\"\n [maxFileSize]=\"maxFileSize()\"\n [multiple]=\"true\"\n (validFiles)=\"onFilesAdded($event)\"\n (fileError)=\"onFileError($event)\"\n />\n }\n\n @if (allowAttachments() && !hasSecondaryActions()) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-icon\"\n [disabled]=\"disabled()\"\n [siTooltip]=\"attachFileLabel() | translate\"\n [attr.aria-label]=\"attachFileLabel() | translate\"\n (click)=\"triggerFileInput()\"\n >\n <si-icon [icon]=\"icons.elementAttachment\" />\n </button>\n }\n\n @if (hasMenuActions()) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"allActionsMenu\"\n [siTooltip]=\"secondaryActionsLabel() | translate\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon [icon]=\"icons.elementPlus\" />\n </button>\n\n <ng-template #allActionsMenu>\n <si-menu-factory [items]=\"combinedMenuActions()\" [actionParam]=\"actionParam()\" />\n </ng-template>\n }\n @if (hasActions()) {\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost\"\n [class.btn-icon]=\"!!action.icon\"\n [disabled]=\"action.disabled\"\n [siTooltip]=\"action.label | translate\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"runAction(action)\"\n >\n @if (action.icon) {\n <si-icon [icon]=\"action.icon\" />\n } @else {\n {{ action.label | translate }}\n }\n </button>\n }\n }\n </div>\n <div class=\"d-flex align-items-center gap-0\">\n <ng-content />\n </div>\n </div>\n\n <button\n type=\"button\"\n class=\"btn btn-tertiary btn-icon\"\n [disabled]=\"buttonDisabled()\"\n [attr.aria-label]=\"buttonLabel() | translate\"\n (click)=\"onButtonClick()\"\n >\n <si-icon class=\"text-accent\" [icon]=\"buttonIcon()\" />\n </button>\n </div>\n</div>\n\n<div class=\"disclaimer-wrapper text-center mt-4 px-3\">\n @if (disclaimer()) {\n <span class=\"si-body-sm text-secondary d-block\">{{ disclaimer() | translate }}</span>\n }\n <ng-content select=\"[siChatInputDisclaimer]\" />\n</div>\n", styles: [":host{max-inline-size:720px}.input-wrapper{border-color:var(--si-sys-color-border-4);background-color:var(--si-sys-color-background-1);padding-block:var(--si-sys-sizing-spacing-y-50) var(--si-sys-sizing-spacing-y-40);padding-inline:var(--si-sys-sizing-spacing-x-50);display:flex;flex-direction:column;gap:var(--si-sys-sizing-spacing-y-50) var(--si-sys-sizing-spacing-x-50)}.input-wrapper:hover,.input-wrapper:active,.input-wrapper:focus-within{background-color:var(--si-sys-color-background-4);border-color:var(--si-sys-color-border-1)}.input-wrapper.drag-over{border:1px solid var(--si-sys-color-effects-focus);box-shadow:0 0 0 1px var(--si-sys-color-effects-focus)}.chat-textarea{min-block-size:1lh;font-family:inherit;padding-block:0;display:block;outline:none;resize:none;background-color:transparent}.chat-textarea::placeholder{color:var(--si-sys-color-text-secondary)}.chat-textarea:disabled{background-color:transparent;color:var(--si-sys-color-text-disabled);cursor:not-allowed}.chat-textarea:disabled::placeholder{color:var(--si-sys-color-text-disabled)}.input-wrapper:has(.chat-textarea:focus-visible){outline:var(--si-sys-sizing-focus-ring-width) solid var(--si-sys-color-effects-focus);outline-offset:var(--si-sys-sizing-focus-ring-offset)}.disclaimer-wrapper:empty{display:none}\n"], dependencies: [{ kind: "directive", type: CdkMenuTrigger, selector: "[cdkMenuTriggerFor]", inputs: ["cdkMenuTriggerFor", "cdkMenuPosition", "cdkMenuTriggerData", "cdkMenuTriggerTransformOriginOn"], outputs: ["cdkMenuOpened", "cdkMenuClosed"], exportAs: ["cdkMenuTriggerFor"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "component", type: SiAttachmentListComponent, selector: "si-attachment-list", inputs: ["attachments", "alignment", "removable", "removeLabel"], outputs: ["remove"] }, { kind: "component", type: SiMenuFactoryComponent, selector: "si-menu-factory", inputs: ["items", "actionParam"] }, { kind: "directive", type: SiFileUploadDirective, selector: "input[type=\"file\"][siFileUpload]", inputs: ["errorTextFileType", "errorTextFileMaxSize", "accept", "maxFileSize", "multiple", "directoryUpload"], outputs: ["validFiles", "filesAdded", "fileError"] }, { kind: "directive", type: SiTooltipDirective, selector: "[siTooltip]", inputs: ["siTooltip", "placement", "isDisabled", "tooltipScrollStrategy", "tooltipContext"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
1021
1110
|
}
|
|
1022
1111
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiChatInputComponent, decorators: [{
|
|
1023
1112
|
type: Component,
|
|
@@ -1030,8 +1119,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
1030
1119
|
SiMenuFactoryComponent,
|
|
1031
1120
|
SiFileUploadDirective,
|
|
1032
1121
|
SiTooltipDirective
|
|
1033
|
-
], template: "@if (followUpPrompts().length) {\n <div class=\"follow-up-prompts d-flex flex-wrap gap-4 mb-4\">\n @for (prompt of followUpPrompts(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-secondary-ghost fw-normal\"\n [disabled]=\"disabled() || sending()\"\n (click)=\"selectFollowUpPrompt(prompt)\"\n >{{ prompt }}</button\n >\n }\n </div>\n}\n\n<div\n class=\"input-wrapper border rounded-3\"\n [class.drag-over]=\"dragOver()\"\n (click)=\"onContainerClick($event)\"\n (drop)=\"dropHandler($event)\"\n (dragover)=\"dragOverHandler($event)\"\n (dragleave)=\"dragOver.set(false)\"\n>\n @if (hasAttachments()) {\n <si-attachment-list\n [attachments]=\"attachments()\"\n [removeLabel]=\"removeAttachmentLabel()\"\n [removable]=\"true\"\n (remove)=\"removeAttachment($event)\"\n />\n }\n\n <div class=\"si-body-paragraph\">\n <label class=\"form-label d-none\" [for]=\"id\">{{ label() | translate }}</label>\n <textarea\n #textInput\n class=\"chat-textarea w-100 border-0\"\n rows=\"1\"\n [id]=\"id\"\n [placeholder]=\"placeholder() | translate\"\n [disabled]=\"disabled()\"\n [maxlength]=\"maxLength() || null\"\n [(ngModel)]=\"value\"\n (keydown)=\"onKeyDown($event)\"\n (input)=\"adjustTextareaHeight($event)\"\n ></textarea>\n </div>\n\n <div class=\"d-flex align-items-center justify-content-between\">\n <div class=\"d-flex align-items-center gap-0\">\n <div class=\"btn-group\" role=\"group\">\n @if (allowAttachments()) {\n <input\n #fileInput\n type=\"file\"\n class=\"d-none\"\n siFileUpload\n [accept]=\"accept()\"\n [maxFileSize]=\"maxFileSize()\"\n [multiple]=\"true\"\n (validFiles)=\"onFilesAdded($event)\"\n (fileError)=\"onFileError($event)\"\n />\n }\n\n @if (allowAttachments() && !hasSecondaryActions()) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-icon\"\n [disabled]=\"disabled()\"\n [siTooltip]=\"attachFileLabel() | translate\"\n [attr.aria-label]=\"attachFileLabel() | translate\"\n (click)=\"triggerFileInput()\"\n >\n <si-icon [icon]=\"icons.elementAttachment\" />\n </button>\n }\n\n @if (hasMenuActions()) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"allActionsMenu\"\n [siTooltip]=\"secondaryActionsLabel() | translate\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon [icon]=\"icons.elementPlus\" />\n </button>\n\n <ng-template #allActionsMenu>\n <si-menu-factory [items]=\"combinedMenuActions()\" [actionParam]=\"actionParam()\" />\n </ng-template>\n }\n @if (hasActions()) {\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost
|
|
1034
|
-
}], propDecorators: { textInput: [{ type: i0.ViewChild, args: ['textInput', { isSignal: true }] }], fileUploadDirective: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SiFileUploadDirective), { isSignal: true }] }], fileInput: [{ type: i0.ViewChild, args: ['fileInput', { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], sending: [{ type: i0.Input, args: [{ isSignal: true, alias: "sending", required: false }] }], interruptible: [{ type: i0.Input, args: [{ isSignal: true, alias: "interruptible", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], disclaimer: [{ type: i0.Input, args: [{ isSignal: true, alias: "disclaimer", required: false }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], secondaryActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryActions", required: false }] }], allowAttachments: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowAttachments", required: false }] }], accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], maxFileSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFileSize", required: false }] }], attachments: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachments", required: false }] }, { type: i0.Output, args: ["attachmentsChange"] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], actionParam: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionParam", required: false }] }], sendButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "sendButtonLabel", required: false }] }], sendButtonIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "sendButtonIcon", required: false }] }], interruptButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "interruptButtonLabel", required: false }] }], autoFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoFocus", required: false }] }], attachFileLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachFileLabel", required: false }] }], removeAttachmentLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeAttachmentLabel", required: false }] }], secondaryActionsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryActionsLabel", required: false }] }], followUpPrompts: [{ type: i0.Input, args: [{ isSignal: true, alias: "followUpPrompts", required: false }] }], followUpPromptSelected: [{ type: i0.Output, args: ["followUpPromptSelected"] }], send: [{ type: i0.Output, args: ["send"] }], interrupt: [{ type: i0.Output, args: ["interrupt"] }], fileError: [{ type: i0.Output, args: ["fileError"] }] } });
|
|
1122
|
+
], template: "@if (followUpPrompts().length) {\n <div class=\"follow-up-prompts d-flex flex-wrap gap-4 mb-4\">\n @for (prompt of followUpPrompts(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-secondary-ghost fw-normal\"\n [disabled]=\"disabled() || sending()\"\n (click)=\"selectFollowUpPrompt(prompt)\"\n >{{ prompt }}</button\n >\n }\n </div>\n}\n\n<div\n class=\"input-wrapper border rounded-3\"\n [class.drag-over]=\"dragOver()\"\n (click)=\"onContainerClick($event)\"\n (drop)=\"dropHandler($event)\"\n (dragover)=\"dragOverHandler($event)\"\n (dragleave)=\"dragOver.set(false)\"\n>\n @if (hasAttachments()) {\n <si-attachment-list\n [attachments]=\"attachments()\"\n [removeLabel]=\"removeAttachmentLabel()\"\n [removable]=\"true\"\n (remove)=\"removeAttachment($event)\"\n />\n }\n\n <div class=\"si-body-paragraph\">\n <label class=\"form-label d-none\" [for]=\"id\">{{ label() | translate }}</label>\n <textarea\n #textInput\n class=\"chat-textarea w-100 border-0\"\n rows=\"1\"\n [id]=\"id\"\n [placeholder]=\"placeholder() | translate\"\n [disabled]=\"disabled()\"\n [maxlength]=\"maxLength() || null\"\n [(ngModel)]=\"value\"\n (keydown)=\"onKeyDown($event)\"\n (input)=\"adjustTextareaHeight($event)\"\n ></textarea>\n </div>\n\n <div class=\"d-flex align-items-center justify-content-between\">\n <div class=\"d-flex align-items-center gap-0\">\n <div class=\"btn-group\" role=\"group\">\n @if (allowAttachments()) {\n <input\n #fileInput\n type=\"file\"\n class=\"d-none\"\n siFileUpload\n [accept]=\"accept()\"\n [maxFileSize]=\"maxFileSize()\"\n [multiple]=\"true\"\n (validFiles)=\"onFilesAdded($event)\"\n (fileError)=\"onFileError($event)\"\n />\n }\n\n @if (allowAttachments() && !hasSecondaryActions()) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-icon\"\n [disabled]=\"disabled()\"\n [siTooltip]=\"attachFileLabel() | translate\"\n [attr.aria-label]=\"attachFileLabel() | translate\"\n (click)=\"triggerFileInput()\"\n >\n <si-icon [icon]=\"icons.elementAttachment\" />\n </button>\n }\n\n @if (hasMenuActions()) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"allActionsMenu\"\n [siTooltip]=\"secondaryActionsLabel() | translate\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon [icon]=\"icons.elementPlus\" />\n </button>\n\n <ng-template #allActionsMenu>\n <si-menu-factory [items]=\"combinedMenuActions()\" [actionParam]=\"actionParam()\" />\n </ng-template>\n }\n @if (hasActions()) {\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost\"\n [class.btn-icon]=\"!!action.icon\"\n [disabled]=\"action.disabled\"\n [siTooltip]=\"action.label | translate\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"runAction(action)\"\n >\n @if (action.icon) {\n <si-icon [icon]=\"action.icon\" />\n } @else {\n {{ action.label | translate }}\n }\n </button>\n }\n }\n </div>\n <div class=\"d-flex align-items-center gap-0\">\n <ng-content />\n </div>\n </div>\n\n <button\n type=\"button\"\n class=\"btn btn-tertiary btn-icon\"\n [disabled]=\"buttonDisabled()\"\n [attr.aria-label]=\"buttonLabel() | translate\"\n (click)=\"onButtonClick()\"\n >\n <si-icon class=\"text-accent\" [icon]=\"buttonIcon()\" />\n </button>\n </div>\n</div>\n\n<div class=\"disclaimer-wrapper text-center mt-4 px-3\">\n @if (disclaimer()) {\n <span class=\"si-body-sm text-secondary d-block\">{{ disclaimer() | translate }}</span>\n }\n <ng-content select=\"[siChatInputDisclaimer]\" />\n</div>\n", styles: [":host{max-inline-size:720px}.input-wrapper{border-color:var(--si-sys-color-border-4);background-color:var(--si-sys-color-background-1);padding-block:var(--si-sys-sizing-spacing-y-50) var(--si-sys-sizing-spacing-y-40);padding-inline:var(--si-sys-sizing-spacing-x-50);display:flex;flex-direction:column;gap:var(--si-sys-sizing-spacing-y-50) var(--si-sys-sizing-spacing-x-50)}.input-wrapper:hover,.input-wrapper:active,.input-wrapper:focus-within{background-color:var(--si-sys-color-background-4);border-color:var(--si-sys-color-border-1)}.input-wrapper.drag-over{border:1px solid var(--si-sys-color-effects-focus);box-shadow:0 0 0 1px var(--si-sys-color-effects-focus)}.chat-textarea{min-block-size:1lh;font-family:inherit;padding-block:0;display:block;outline:none;resize:none;background-color:transparent}.chat-textarea::placeholder{color:var(--si-sys-color-text-secondary)}.chat-textarea:disabled{background-color:transparent;color:var(--si-sys-color-text-disabled);cursor:not-allowed}.chat-textarea:disabled::placeholder{color:var(--si-sys-color-text-disabled)}.input-wrapper:has(.chat-textarea:focus-visible){outline:var(--si-sys-sizing-focus-ring-width) solid var(--si-sys-color-effects-focus);outline-offset:var(--si-sys-sizing-focus-ring-offset)}.disclaimer-wrapper:empty{display:none}\n"] }]
|
|
1123
|
+
}], ctorParameters: () => [], propDecorators: { textInput: [{ type: i0.ViewChild, args: ['textInput', { isSignal: true }] }], fileUploadDirective: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SiFileUploadDirective), { isSignal: true }] }], fileInput: [{ type: i0.ViewChild, args: ['fileInput', { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], sending: [{ type: i0.Input, args: [{ isSignal: true, alias: "sending", required: false }] }, { type: i0.Output, args: ["sendingChange"] }], interruptible: [{ type: i0.Input, args: [{ isSignal: true, alias: "interruptible", required: false }] }, { type: i0.Output, args: ["interruptibleChange"] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], disclaimer: [{ type: i0.Input, args: [{ isSignal: true, alias: "disclaimer", required: false }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], secondaryActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryActions", required: false }] }], allowAttachments: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowAttachments", required: false }] }], accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], maxFileSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFileSize", required: false }] }], attachments: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachments", required: false }] }, { type: i0.Output, args: ["attachmentsChange"] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], actionParam: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionParam", required: false }] }], sendButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "sendButtonLabel", required: false }] }], sendButtonIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "sendButtonIcon", required: false }] }], interruptButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "interruptButtonLabel", required: false }] }], autoFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoFocus", required: false }] }], attachFileLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachFileLabel", required: false }] }], removeAttachmentLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeAttachmentLabel", required: false }] }], secondaryActionsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryActionsLabel", required: false }] }], followUpPrompts: [{ type: i0.Input, args: [{ isSignal: true, alias: "followUpPrompts", required: false }] }], followUpPromptSelected: [{ type: i0.Output, args: ["followUpPromptSelected"] }], send: [{ type: i0.Output, args: ["send"] }], interrupt: [{ type: i0.Output, args: ["interrupt"] }], fileError: [{ type: i0.Output, args: ["fileError"] }] } });
|
|
1035
1124
|
|
|
1036
1125
|
/**
|
|
1037
1126
|
* Copyright (c) Siemens 2016 - 2026
|
|
@@ -1090,7 +1179,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
1090
1179
|
* @experimental
|
|
1091
1180
|
*/
|
|
1092
1181
|
class SiUserMessageComponent {
|
|
1093
|
-
icons = addIcons({ elementOptionsVertical });
|
|
1094
1182
|
/**
|
|
1095
1183
|
* The user message content
|
|
1096
1184
|
* @defaultValue ''
|
|
@@ -1132,19 +1220,16 @@ class SiUserMessageComponent {
|
|
|
1132
1220
|
hasAttachments = computed(() => this.attachments()?.length > 0, /* @ts-ignore */
|
|
1133
1221
|
...(ngDevMode ? [{ debugName: "hasAttachments" }] : /* istanbul ignore next */ []));
|
|
1134
1222
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiUserMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1135
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiUserMessageComponent, isStandalone: true, selector: "si-user-message", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, secondaryActions: { classPropertyName: "secondaryActions", publicName: "secondaryActions", isSignal: true, isRequired: false, transformFunction: null }, attachments: { classPropertyName: "attachments", publicName: "attachments", isSignal: true, isRequired: false, transformFunction: null }, actionParam: { classPropertyName: "actionParam", publicName: "actionParam", isSignal: true, isRequired: false, transformFunction: null }, secondaryActionsLabel: { classPropertyName: "secondaryActionsLabel", publicName: "secondaryActionsLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<si-chat-message alignment=\"end\" actionsPosition=\"bottom\" [loading]=\"false\">\n @if (hasAttachments()) {\n <si-attachment-list alignment=\"end\" [attachments]=\"attachments()\" [removable]=\"false\" />\n }\n\n @if (content()) {\n <span class=\"text-pre-wrap\">{{ content() }}</span>\n } @else {\n <ng-content />\n }\n @if (actions().length > 0 || secondaryActions().length > 0) {\n <
|
|
1223
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiUserMessageComponent, isStandalone: true, selector: "si-user-message", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, secondaryActions: { classPropertyName: "secondaryActions", publicName: "secondaryActions", isSignal: true, isRequired: false, transformFunction: null }, attachments: { classPropertyName: "attachments", publicName: "attachments", isSignal: true, isRequired: false, transformFunction: null }, actionParam: { classPropertyName: "actionParam", publicName: "actionParam", isSignal: true, isRequired: false, transformFunction: null }, secondaryActionsLabel: { classPropertyName: "secondaryActionsLabel", publicName: "secondaryActionsLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<si-chat-message alignment=\"end\" actionsPosition=\"bottom\" [loading]=\"false\">\n @if (hasAttachments()) {\n <si-attachment-list alignment=\"end\" [attachments]=\"attachments()\" [removable]=\"false\" />\n }\n\n @if (content()) {\n <span class=\"text-pre-wrap\">{{ content() }}</span>\n } @else {\n <ng-content />\n }\n @if (actions().length > 0 || secondaryActions().length > 0) {\n <si-chat-message-actions\n class=\"user-message-actions\"\n siChatMessageAction\n [actions]=\"actions()\"\n [secondaryActions]=\"secondaryActions()\"\n [actionParam]=\"actionParam()\"\n [secondaryActionsLabel]=\"secondaryActionsLabel()\"\n />\n }\n</si-chat-message>\n", styles: [":host{display:block}:host:not(:has([siChatMessageAction])) si-chat-message{padding-block-end:calc(32px + var(--si-sys-sizing-spacing-y-20))!important}.user-message-actions{opacity:0;transition:opacity .2s ease}si-chat-message{--chat-message-bubble-bg: var(--si-sys-color-background-2);max-inline-size:600px;margin-inline-start:auto}:host:hover .user-message-actions,.user-message-actions:hover,.user-message-actions:has(::ng-deep [aria-expanded=true]),:host-context(.si-container-xs,.si-container-sm) .user-message-actions:active{opacity:1}\n"], dependencies: [{ kind: "component", type: SiAttachmentListComponent, selector: "si-attachment-list", inputs: ["attachments", "alignment", "removable", "removeLabel"], outputs: ["remove"] }, { kind: "component", type: SiChatMessageComponent, selector: "si-chat-message", inputs: ["loading", "alignment", "actionsPosition"] }, { kind: "directive", type: SiChatMessageActionDirective, selector: "[siChatMessageAction]" }, { kind: "component", type: SiChatMessageActionsComponent, selector: "si-chat-message-actions", inputs: ["actions", "secondaryActions", "actionParam", "secondaryActionsLabel"] }] });
|
|
1136
1224
|
}
|
|
1137
1225
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiUserMessageComponent, decorators: [{
|
|
1138
1226
|
type: Component,
|
|
1139
1227
|
args: [{ selector: 'si-user-message', imports: [
|
|
1140
|
-
CdkMenuTrigger,
|
|
1141
1228
|
SiAttachmentListComponent,
|
|
1142
1229
|
SiChatMessageComponent,
|
|
1143
|
-
SiIconComponent,
|
|
1144
|
-
SiMenuFactoryComponent,
|
|
1145
1230
|
SiChatMessageActionDirective,
|
|
1146
|
-
|
|
1147
|
-
], template: "<si-chat-message alignment=\"end\" actionsPosition=\"bottom\" [loading]=\"false\">\n @if (hasAttachments()) {\n <si-attachment-list alignment=\"end\" [attachments]=\"attachments()\" [removable]=\"false\" />\n }\n\n @if (content()) {\n <span class=\"text-pre-wrap\">{{ content() }}</span>\n } @else {\n <ng-content />\n }\n @if (actions().length > 0 || secondaryActions().length > 0) {\n <
|
|
1231
|
+
SiChatMessageActionsComponent
|
|
1232
|
+
], template: "<si-chat-message alignment=\"end\" actionsPosition=\"bottom\" [loading]=\"false\">\n @if (hasAttachments()) {\n <si-attachment-list alignment=\"end\" [attachments]=\"attachments()\" [removable]=\"false\" />\n }\n\n @if (content()) {\n <span class=\"text-pre-wrap\">{{ content() }}</span>\n } @else {\n <ng-content />\n }\n @if (actions().length > 0 || secondaryActions().length > 0) {\n <si-chat-message-actions\n class=\"user-message-actions\"\n siChatMessageAction\n [actions]=\"actions()\"\n [secondaryActions]=\"secondaryActions()\"\n [actionParam]=\"actionParam()\"\n [secondaryActionsLabel]=\"secondaryActionsLabel()\"\n />\n }\n</si-chat-message>\n", styles: [":host{display:block}:host:not(:has([siChatMessageAction])) si-chat-message{padding-block-end:calc(32px + var(--si-sys-sizing-spacing-y-20))!important}.user-message-actions{opacity:0;transition:opacity .2s ease}si-chat-message{--chat-message-bubble-bg: var(--si-sys-color-background-2);max-inline-size:600px;margin-inline-start:auto}:host:hover .user-message-actions,.user-message-actions:hover,.user-message-actions:has(::ng-deep [aria-expanded=true]),:host-context(.si-container-xs,.si-container-sm) .user-message-actions:active{opacity:1}\n"] }]
|
|
1148
1233
|
}], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], secondaryActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryActions", required: false }] }], attachments: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachments", required: false }] }], actionParam: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionParam", required: false }] }], secondaryActionsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryActionsLabel", required: false }] }] } });
|
|
1149
1234
|
|
|
1150
1235
|
/**
|
|
@@ -1164,6 +1249,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
1164
1249
|
* - Clickable prompt suggestion cards
|
|
1165
1250
|
* - Optional refresh button to regenerate suggestions
|
|
1166
1251
|
*
|
|
1252
|
+
* @see {@link SiAiChatComponent} for the AI chat container which uses this component
|
|
1167
1253
|
* @see {@link SiChatContainerComponent} for the base chat container
|
|
1168
1254
|
*
|
|
1169
1255
|
* @experimental
|
|
@@ -1198,15 +1284,502 @@ class SiAiWelcomeScreenComponent {
|
|
|
1198
1284
|
this.promptSelected.emit(suggestion);
|
|
1199
1285
|
}
|
|
1200
1286
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiAiWelcomeScreenComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1201
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiAiWelcomeScreenComponent, isStandalone: true, selector: "si-ai-welcome-screen", inputs: { categories: { classPropertyName: "categories", publicName: "categories", isSignal: true, isRequired: false, transformFunction: null }, selectedCategory: { classPropertyName: "selectedCategory", publicName: "selectedCategory", isSignal: true, isRequired: false, transformFunction: null }, promptSuggestions: { classPropertyName: "promptSuggestions", publicName: "promptSuggestions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedCategory: "selectedCategoryChange", promptSelected: "promptSelected" }, host: { classAttribute: "d-block" }, ngImport: i0, template: "<div class=\"d-flex flex-column gap-13 align-items-center w-100\">\n <!-- Welcome Header -->\n <div class=\"welcome-header d-flex flex-column gap-4 w-100 pt-13 pb-8\">\n <ng-content />\n </div>\n\n <!-- Prompt Categories and Suggestions -->\n <div class=\"prompt-suggestions d-flex flex-column gap-6 align-items-center w-100\">\n @if (categories().length > 0) {\n <div class=\"d-flex gap-4 align-items-center w-100\">\n @for (category of categories(); track $index) {\n <si-summary-chip\n class=\"user-select-none\"\n [label]=\"category.label\"\n [selected]=\"selectedCategory() === category.label\"\n (selectedChange)=\"onCategoryClick(category.label)\"\n />\n }\n </div>\n }\n\n @if (promptSuggestions().length > 0) {\n <div class=\"d-flex flex-column gap-4 w-100\">\n @for (suggestion of promptSuggestions(); track $index) {\n <button si-action-card type=\"button\" class=\"w-100\" (click)=\"onPromptClick(suggestion)\">\n <div body class=\"card-body card-text\">\n {{ suggestion.text }}\n </div>\n </button>\n }\n </div>\n }\n </div>\n</div>\n", styles: [".welcome-header{max-inline-size:720px;overflow-x:visible;position:relative}.welcome-header:before{position:absolute;content:\"\";inset-inline-start:-104px;inset-block-start:50%;transform:translateY(-50%);inline-size:168px;block-size:168px;background-image:var(--element-brand-ai-key-visual);background-size:contain;background-repeat:no-repeat;background-position:center}:host{container-type:inline-size}@container (max-width: 767.98px){:host .welcome-header:before{display:none}}.prompt-suggestions{max-inline-size:720px}.prompt-suggestions>div:first-child{flex-wrap:wrap}:host{inline-size:100%}::ng-deep button[si-action-card]{background-color:transparent;border-radius:var(--
|
|
1287
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiAiWelcomeScreenComponent, isStandalone: true, selector: "si-ai-welcome-screen", inputs: { categories: { classPropertyName: "categories", publicName: "categories", isSignal: true, isRequired: false, transformFunction: null }, selectedCategory: { classPropertyName: "selectedCategory", publicName: "selectedCategory", isSignal: true, isRequired: false, transformFunction: null }, promptSuggestions: { classPropertyName: "promptSuggestions", publicName: "promptSuggestions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedCategory: "selectedCategoryChange", promptSelected: "promptSelected" }, host: { classAttribute: "d-block" }, ngImport: i0, template: "<div class=\"d-flex flex-column gap-13 align-items-center w-100\">\n <!-- Welcome Header -->\n <div class=\"welcome-header d-flex flex-column gap-4 w-100 pt-13 pb-8\">\n <ng-content />\n </div>\n\n <!-- Prompt Categories and Suggestions -->\n <div class=\"prompt-suggestions d-flex flex-column gap-6 align-items-center w-100\">\n @if (categories().length > 0) {\n <div class=\"d-flex gap-4 align-items-center w-100\">\n @for (category of categories(); track $index) {\n <si-summary-chip\n class=\"user-select-none\"\n [label]=\"category.label\"\n [selected]=\"selectedCategory() === category.label\"\n (selectedChange)=\"onCategoryClick(category.label)\"\n />\n }\n </div>\n }\n\n @if (promptSuggestions().length > 0) {\n <div class=\"d-flex flex-column gap-4 w-100\">\n @for (suggestion of promptSuggestions(); track $index) {\n <button si-action-card type=\"button\" class=\"w-100\" (click)=\"onPromptClick(suggestion)\">\n <div body class=\"card-body card-text\">\n {{ suggestion.text }}\n </div>\n </button>\n }\n </div>\n }\n </div>\n</div>\n", styles: [".welcome-header{max-inline-size:720px;overflow-x:visible;position:relative}.welcome-header:before{position:absolute;content:\"\";inset-inline-start:-104px;inset-block-start:50%;transform:translateY(-50%);inline-size:168px;block-size:168px;background-image:var(--element-brand-ai-key-visual);background-size:contain;background-repeat:no-repeat;background-position:center}:host{container-type:inline-size}@container (max-width: 767.98px){:host .welcome-header:before{display:none}}.prompt-suggestions{max-inline-size:720px}.prompt-suggestions>div:first-child{flex-wrap:wrap}:host{inline-size:100%}::ng-deep button[si-action-card]{background-color:transparent;border-radius:var(--si-sys-sizing-border-radius-sm);border:1px solid var(--si-sys-color-border-4)}\n"], dependencies: [{ kind: "component", type: SiActionCardComponent, selector: "button[si-action-card]", inputs: ["selectable", "selected"], outputs: ["selectedChange"] }, { kind: "component", type: SiSummaryChipComponent, selector: "si-summary-chip", inputs: ["status", "icon", "color", "stackedIcon", "stackedColor", "label", "value", "selected", "disabled", "hideLabel"], outputs: ["selectedChange"] }] });
|
|
1202
1288
|
}
|
|
1203
1289
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiAiWelcomeScreenComponent, decorators: [{
|
|
1204
1290
|
type: Component,
|
|
1205
1291
|
args: [{ selector: 'si-ai-welcome-screen', imports: [SiActionCardComponent, SiSummaryChipComponent], host: {
|
|
1206
1292
|
class: 'd-block'
|
|
1207
|
-
}, template: "<div class=\"d-flex flex-column gap-13 align-items-center w-100\">\n <!-- Welcome Header -->\n <div class=\"welcome-header d-flex flex-column gap-4 w-100 pt-13 pb-8\">\n <ng-content />\n </div>\n\n <!-- Prompt Categories and Suggestions -->\n <div class=\"prompt-suggestions d-flex flex-column gap-6 align-items-center w-100\">\n @if (categories().length > 0) {\n <div class=\"d-flex gap-4 align-items-center w-100\">\n @for (category of categories(); track $index) {\n <si-summary-chip\n class=\"user-select-none\"\n [label]=\"category.label\"\n [selected]=\"selectedCategory() === category.label\"\n (selectedChange)=\"onCategoryClick(category.label)\"\n />\n }\n </div>\n }\n\n @if (promptSuggestions().length > 0) {\n <div class=\"d-flex flex-column gap-4 w-100\">\n @for (suggestion of promptSuggestions(); track $index) {\n <button si-action-card type=\"button\" class=\"w-100\" (click)=\"onPromptClick(suggestion)\">\n <div body class=\"card-body card-text\">\n {{ suggestion.text }}\n </div>\n </button>\n }\n </div>\n }\n </div>\n</div>\n", styles: [".welcome-header{max-inline-size:720px;overflow-x:visible;position:relative}.welcome-header:before{position:absolute;content:\"\";inset-inline-start:-104px;inset-block-start:50%;transform:translateY(-50%);inline-size:168px;block-size:168px;background-image:var(--element-brand-ai-key-visual);background-size:contain;background-repeat:no-repeat;background-position:center}:host{container-type:inline-size}@container (max-width: 767.98px){:host .welcome-header:before{display:none}}.prompt-suggestions{max-inline-size:720px}.prompt-suggestions>div:first-child{flex-wrap:wrap}:host{inline-size:100%}::ng-deep button[si-action-card]{background-color:transparent;border-radius:var(--
|
|
1293
|
+
}, template: "<div class=\"d-flex flex-column gap-13 align-items-center w-100\">\n <!-- Welcome Header -->\n <div class=\"welcome-header d-flex flex-column gap-4 w-100 pt-13 pb-8\">\n <ng-content />\n </div>\n\n <!-- Prompt Categories and Suggestions -->\n <div class=\"prompt-suggestions d-flex flex-column gap-6 align-items-center w-100\">\n @if (categories().length > 0) {\n <div class=\"d-flex gap-4 align-items-center w-100\">\n @for (category of categories(); track $index) {\n <si-summary-chip\n class=\"user-select-none\"\n [label]=\"category.label\"\n [selected]=\"selectedCategory() === category.label\"\n (selectedChange)=\"onCategoryClick(category.label)\"\n />\n }\n </div>\n }\n\n @if (promptSuggestions().length > 0) {\n <div class=\"d-flex flex-column gap-4 w-100\">\n @for (suggestion of promptSuggestions(); track $index) {\n <button si-action-card type=\"button\" class=\"w-100\" (click)=\"onPromptClick(suggestion)\">\n <div body class=\"card-body card-text\">\n {{ suggestion.text }}\n </div>\n </button>\n }\n </div>\n }\n </div>\n</div>\n", styles: [".welcome-header{max-inline-size:720px;overflow-x:visible;position:relative}.welcome-header:before{position:absolute;content:\"\";inset-inline-start:-104px;inset-block-start:50%;transform:translateY(-50%);inline-size:168px;block-size:168px;background-image:var(--element-brand-ai-key-visual);background-size:contain;background-repeat:no-repeat;background-position:center}:host{container-type:inline-size}@container (max-width: 767.98px){:host .welcome-header:before{display:none}}.prompt-suggestions{max-inline-size:720px}.prompt-suggestions>div:first-child{flex-wrap:wrap}:host{inline-size:100%}::ng-deep button[si-action-card]{background-color:transparent;border-radius:var(--si-sys-sizing-border-radius-sm);border:1px solid var(--si-sys-color-border-4)}\n"] }]
|
|
1208
1294
|
}], propDecorators: { categories: [{ type: i0.Input, args: [{ isSignal: true, alias: "categories", required: false }] }], selectedCategory: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedCategory", required: false }] }, { type: i0.Output, args: ["selectedCategoryChange"] }], promptSuggestions: [{ type: i0.Input, args: [{ isSignal: true, alias: "promptSuggestions", required: false }] }], promptSelected: [{ type: i0.Output, args: ["promptSelected"] }] } });
|
|
1209
1295
|
|
|
1296
|
+
/**
|
|
1297
|
+
* Copyright (c) Siemens 2016 - 2026
|
|
1298
|
+
* SPDX-License-Identifier: MIT
|
|
1299
|
+
*/
|
|
1300
|
+
/**
|
|
1301
|
+
* A model-driven chat container component for displaying an AI chat interface with automatic scroll-to-bottom behavior.
|
|
1302
|
+
*
|
|
1303
|
+
* This component provides an AI chat interface, managing scrolling behavior
|
|
1304
|
+
* to keep the newest messages visible while respecting user scrolling actions. It automatically
|
|
1305
|
+
* scrolls to the bottom when new content is added, unless the user has scrolled up to view older messages.
|
|
1306
|
+
*
|
|
1307
|
+
* Required content projection:
|
|
1308
|
+
* - `si-chat-input`: Input controls for composing messages
|
|
1309
|
+
*
|
|
1310
|
+
* @see {@link ChatMessage} for the chat message model
|
|
1311
|
+
* @see {@link AiChatMessage} for the AI chat message model
|
|
1312
|
+
* @see {@link UserChatMessage} for the user chat message model
|
|
1313
|
+
* @see {@link TemplateChatMessage} for the template chat message model
|
|
1314
|
+
* @see {@link SiChatInputComponent} for the chat input component
|
|
1315
|
+
* @see {@link SiChatContainerComponent} for the base chat container component
|
|
1316
|
+
* @see {@link SiAiMessageComponent} for the used AI message component
|
|
1317
|
+
* @see {@link SiUserMessageComponent} for the used user message component
|
|
1318
|
+
* @see {@link SiChatMessageComponent} for the base wrapper chat message component used by AI and user message components
|
|
1319
|
+
*
|
|
1320
|
+
* @experimental
|
|
1321
|
+
*/
|
|
1322
|
+
class SiAiChatComponent {
|
|
1323
|
+
chatInput = contentChild(SiChatInputComponent, /* @ts-ignore */
|
|
1324
|
+
...(ngDevMode ? [{ debugName: "chatInput" }] : /* istanbul ignore next */ []));
|
|
1325
|
+
chatContainer = viewChild(SiChatContainerComponent, /* @ts-ignore */
|
|
1326
|
+
...(ngDevMode ? [{ debugName: "chatContainer" }] : /* istanbul ignore next */ []));
|
|
1327
|
+
constructor() {
|
|
1328
|
+
effect(() => {
|
|
1329
|
+
if (this.isEmpty()) {
|
|
1330
|
+
this.chatContainer()?.scrollToTop();
|
|
1331
|
+
}
|
|
1332
|
+
});
|
|
1333
|
+
}
|
|
1334
|
+
/**
|
|
1335
|
+
* List of chat messages to display. Messages can contain either content (string)
|
|
1336
|
+
* or a template (TemplateRef) for custom rendering. When both content and template
|
|
1337
|
+
* are provided, the template takes precedence.
|
|
1338
|
+
*/
|
|
1339
|
+
messages = input(/* @ts-ignore */
|
|
1340
|
+
...(ngDevMode ? [undefined, { debugName: "messages" }] : /* istanbul ignore next */ []));
|
|
1341
|
+
/**
|
|
1342
|
+
* Whether the latest activity details are expanded automatically.
|
|
1343
|
+
* @defaultValue true
|
|
1344
|
+
*/
|
|
1345
|
+
autoExpand = input(true, { ...(ngDevMode ? { debugName: "autoExpand" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1346
|
+
/**
|
|
1347
|
+
* Which activity input and output parts are shown.
|
|
1348
|
+
* @defaultValue 'auto'
|
|
1349
|
+
*/
|
|
1350
|
+
show = input('auto', /* @ts-ignore */
|
|
1351
|
+
...(ngDevMode ? [{ debugName: "show" }] : /* istanbul ignore next */ []));
|
|
1352
|
+
/**
|
|
1353
|
+
* Whether a message is currently being sent, disables input and shows a loading state in the input area.
|
|
1354
|
+
* If you want to show a loading state for the latest AI message, set {@link loading} to true instead.
|
|
1355
|
+
* @defaultValue false
|
|
1356
|
+
*/
|
|
1357
|
+
sending = input(false, { ...(ngDevMode ? { debugName: "sending" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1358
|
+
/**
|
|
1359
|
+
* Whether a pending loading AI message should be shown (e.g. while waiting for response).
|
|
1360
|
+
* If you also want to prevent the user from sending new messages, set {@link sending} to true as well.
|
|
1361
|
+
* @defaultValue false
|
|
1362
|
+
*/
|
|
1363
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1364
|
+
/**
|
|
1365
|
+
* Whether to disable the interrupt functionality
|
|
1366
|
+
* @defaultValue false
|
|
1367
|
+
*/
|
|
1368
|
+
disableInterrupt = input(false, { ...(ngDevMode ? { debugName: "disableInterrupt" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1369
|
+
/**
|
|
1370
|
+
* Whether the system is currently interrupting an operation. When true,
|
|
1371
|
+
* forces interruptible mode and shows sending state on the input.
|
|
1372
|
+
* @defaultValue false
|
|
1373
|
+
*/
|
|
1374
|
+
interrupting = input(false, { ...(ngDevMode ? { debugName: "interrupting" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1375
|
+
/**
|
|
1376
|
+
* Disable auto-scroll to bottom when new messages are added
|
|
1377
|
+
* @defaultValue false
|
|
1378
|
+
*/
|
|
1379
|
+
noAutoScroll = input(false, { ...(ngDevMode ? { debugName: "noAutoScroll" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1380
|
+
/**
|
|
1381
|
+
* Custom AI icon name, used for empty state
|
|
1382
|
+
* @defaultValue 'element-ai'
|
|
1383
|
+
*/
|
|
1384
|
+
aiIcon = input('element-ai', /* @ts-ignore */
|
|
1385
|
+
...(ngDevMode ? [{ debugName: "aiIcon" }] : /* istanbul ignore next */ []));
|
|
1386
|
+
/**
|
|
1387
|
+
* Color to use for component background.
|
|
1388
|
+
* @defaultValue 'base-0'
|
|
1389
|
+
*/
|
|
1390
|
+
colorVariant = input('base-0', /* @ts-ignore */
|
|
1391
|
+
...(ngDevMode ? [{ debugName: "colorVariant" }] : /* istanbul ignore next */ []));
|
|
1392
|
+
/**
|
|
1393
|
+
* Options used to render chat message markdown.
|
|
1394
|
+
* @defaultValue
|
|
1395
|
+
* ```
|
|
1396
|
+
* makeSiMarkdownOptions()
|
|
1397
|
+
* ```
|
|
1398
|
+
*/
|
|
1399
|
+
markdownOptions = input(makeSiMarkdownOptions(), /* @ts-ignore */
|
|
1400
|
+
...(ngDevMode ? [{ debugName: "markdownOptions" }] : /* istanbul ignore next */ []));
|
|
1401
|
+
/**
|
|
1402
|
+
* The greeting text for the welcome screen
|
|
1403
|
+
* @defaultValue
|
|
1404
|
+
* ```
|
|
1405
|
+
* t(() => $localize`:@@SI_AI_CHAT_CONTAINER.WELCOME_GREETING:Hello,`)
|
|
1406
|
+
* ```
|
|
1407
|
+
*/
|
|
1408
|
+
greeting = input(t(() => $localize `:@@SI_AI_CHAT_CONTAINER.WELCOME_GREETING:Hello,`), /* @ts-ignore */
|
|
1409
|
+
...(ngDevMode ? [{ debugName: "greeting" }] : /* istanbul ignore next */ []));
|
|
1410
|
+
/**
|
|
1411
|
+
* The welcome message text for the welcome screen
|
|
1412
|
+
* @defaultValue
|
|
1413
|
+
* ```
|
|
1414
|
+
* t(() => $localize`:@@SI_AI_CHAT_CONTAINER.WELCOME_MESSAGE:how can I help you today?`)
|
|
1415
|
+
* ```
|
|
1416
|
+
*/
|
|
1417
|
+
welcomeMessage = input(t(() => $localize `:@@SI_AI_CHAT_CONTAINER.WELCOME_MESSAGE:how can I help you today?`), /* @ts-ignore */
|
|
1418
|
+
...(ngDevMode ? [{ debugName: "welcomeMessage" }] : /* istanbul ignore next */ []));
|
|
1419
|
+
/**
|
|
1420
|
+
* The list of prompt suggestions for the welcome screen, either as an array or a record mapping category labels to suggestion arrays
|
|
1421
|
+
* @defaultValue []
|
|
1422
|
+
*/
|
|
1423
|
+
promptSuggestions = input([], /* @ts-ignore */
|
|
1424
|
+
...(ngDevMode ? [{ debugName: "promptSuggestions" }] : /* istanbul ignore next */ []));
|
|
1425
|
+
/**
|
|
1426
|
+
* More actions button aria label
|
|
1427
|
+
*
|
|
1428
|
+
* @defaultValue
|
|
1429
|
+
* ```
|
|
1430
|
+
* t(() => $localize`:@@SI_AI_CHAT_CONTAINER.SECONDARY_ACTIONS:More actions`)
|
|
1431
|
+
* ```
|
|
1432
|
+
*/
|
|
1433
|
+
secondaryActionsLabel = input(t(() => $localize `:@@SI_AI_CHAT_CONTAINER.SECONDARY_ACTIONS:More actions`), /* @ts-ignore */
|
|
1434
|
+
...(ngDevMode ? [{ debugName: "secondaryActionsLabel" }] : /* istanbul ignore next */ []));
|
|
1435
|
+
/**
|
|
1436
|
+
* Status notification severity
|
|
1437
|
+
*/
|
|
1438
|
+
statusSeverity = input(/* @ts-ignore */
|
|
1439
|
+
...(ngDevMode ? [undefined, { debugName: "statusSeverity" }] : /* istanbul ignore next */ []));
|
|
1440
|
+
/**
|
|
1441
|
+
* Status notification heading
|
|
1442
|
+
*/
|
|
1443
|
+
statusHeading = input(/* @ts-ignore */
|
|
1444
|
+
...(ngDevMode ? [undefined, { debugName: "statusHeading" }] : /* istanbul ignore next */ []));
|
|
1445
|
+
/**
|
|
1446
|
+
* Status notification message
|
|
1447
|
+
*/
|
|
1448
|
+
statusMessage = input(/* @ts-ignore */
|
|
1449
|
+
...(ngDevMode ? [undefined, { debugName: "statusMessage" }] : /* istanbul ignore next */ []));
|
|
1450
|
+
/**
|
|
1451
|
+
* Status notification action link
|
|
1452
|
+
*/
|
|
1453
|
+
statusAction = input(/* @ts-ignore */
|
|
1454
|
+
...(ngDevMode ? [undefined, { debugName: "statusAction" }] : /* istanbul ignore next */ []));
|
|
1455
|
+
/**
|
|
1456
|
+
* Label for activity input arguments.
|
|
1457
|
+
* @defaultValue
|
|
1458
|
+
* ```
|
|
1459
|
+
* t(() => $localize`:@@SI_AI_CHAT_CONTAINER.INPUT_ARGUMENTS:Input arguments`)
|
|
1460
|
+
* ```
|
|
1461
|
+
*/
|
|
1462
|
+
activityInputArgumentsLabel = input(t(() => $localize `:@@SI_AI_CHAT_CONTAINER.INPUT_ARGUMENTS:Input arguments`), /* @ts-ignore */
|
|
1463
|
+
...(ngDevMode ? [{ debugName: "activityInputArgumentsLabel" }] : /* istanbul ignore next */ []));
|
|
1464
|
+
/**
|
|
1465
|
+
* Label for activity output.
|
|
1466
|
+
* @defaultValue
|
|
1467
|
+
* ```
|
|
1468
|
+
* t(() => $localize`:@@SI_AI_CHAT_CONTAINER.OUTPUT:Output`)
|
|
1469
|
+
* ```
|
|
1470
|
+
*/
|
|
1471
|
+
activityOutputLabel = input(t(() => $localize `:@@SI_AI_CHAT_CONTAINER.OUTPUT:Output`), /* @ts-ignore */
|
|
1472
|
+
...(ngDevMode ? [{ debugName: "activityOutputLabel" }] : /* istanbul ignore next */ []));
|
|
1473
|
+
/**
|
|
1474
|
+
* Default name for reasoning activities.
|
|
1475
|
+
* @defaultValue
|
|
1476
|
+
* ```
|
|
1477
|
+
* t(() => $localize`:@@SI_AI_CHAT_CONTAINER.REASONING:Reasoning`)
|
|
1478
|
+
* ```
|
|
1479
|
+
*/
|
|
1480
|
+
activityReasoningLabel = input(t(() => $localize `:@@SI_AI_CHAT_CONTAINER.REASONING:Reasoning`), /* @ts-ignore */
|
|
1481
|
+
...(ngDevMode ? [{ debugName: "activityReasoningLabel" }] : /* istanbul ignore next */ []));
|
|
1482
|
+
/**
|
|
1483
|
+
* Emitted when a new message is sent
|
|
1484
|
+
*/
|
|
1485
|
+
messageSent = output();
|
|
1486
|
+
/**
|
|
1487
|
+
* Internal selected category state
|
|
1488
|
+
*/
|
|
1489
|
+
selectedCategory = signal(undefined, /* @ts-ignore */
|
|
1490
|
+
...(ngDevMode ? [{ debugName: "selectedCategory" }] : /* istanbul ignore next */ []));
|
|
1491
|
+
/**
|
|
1492
|
+
* Computed list of categories derived from promptSuggestions
|
|
1493
|
+
*/
|
|
1494
|
+
promptCategories = computed(() => {
|
|
1495
|
+
const suggestions = this.promptSuggestions();
|
|
1496
|
+
if (Array.isArray(suggestions)) {
|
|
1497
|
+
return [];
|
|
1498
|
+
}
|
|
1499
|
+
return Object.keys(suggestions).map(label => ({ label }));
|
|
1500
|
+
}, /* @ts-ignore */
|
|
1501
|
+
...(ngDevMode ? [{ debugName: "promptCategories" }] : /* istanbul ignore next */ []));
|
|
1502
|
+
/**
|
|
1503
|
+
* Resolved prompt suggestions based on selected category.
|
|
1504
|
+
*/
|
|
1505
|
+
resolvedPromptSuggestions = computed(() => {
|
|
1506
|
+
const suggestions = this.promptSuggestions();
|
|
1507
|
+
if (Array.isArray(suggestions)) {
|
|
1508
|
+
return suggestions;
|
|
1509
|
+
}
|
|
1510
|
+
const category = this.selectedCategory();
|
|
1511
|
+
if (category && suggestions[category]) {
|
|
1512
|
+
return suggestions[category];
|
|
1513
|
+
}
|
|
1514
|
+
const keys = Object.keys(suggestions);
|
|
1515
|
+
return keys.length > 0 ? suggestions[keys[0]] : [];
|
|
1516
|
+
}, /* @ts-ignore */
|
|
1517
|
+
...(ngDevMode ? [{ debugName: "resolvedPromptSuggestions" }] : /* istanbul ignore next */ []));
|
|
1518
|
+
isEmpty = computed(() => this.messages()?.length === 0 && !this.loading(), /* @ts-ignore */
|
|
1519
|
+
...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
|
|
1520
|
+
inputInterruptible = computed(() => {
|
|
1521
|
+
return this.interrupting() || (this.loading() && !this.disableInterrupt() && !this.sending());
|
|
1522
|
+
}, /* @ts-ignore */
|
|
1523
|
+
...(ngDevMode ? [{ debugName: "inputInterruptible" }] : /* istanbul ignore next */ []));
|
|
1524
|
+
inputSending = computed(() => {
|
|
1525
|
+
return this.sending() || this.interrupting();
|
|
1526
|
+
}, /* @ts-ignore */
|
|
1527
|
+
...(ngDevMode ? [{ debugName: "inputSending" }] : /* istanbul ignore next */ []));
|
|
1528
|
+
displayMessages = computed(() => {
|
|
1529
|
+
const messages = this.messages();
|
|
1530
|
+
if (!messages?.length) {
|
|
1531
|
+
if (this.loading()) {
|
|
1532
|
+
const loadingMessage = {
|
|
1533
|
+
type: 'ai',
|
|
1534
|
+
content: '',
|
|
1535
|
+
loading: true
|
|
1536
|
+
};
|
|
1537
|
+
return [loadingMessage];
|
|
1538
|
+
}
|
|
1539
|
+
return [];
|
|
1540
|
+
}
|
|
1541
|
+
const latestMessage = messages.at(-1);
|
|
1542
|
+
if (this.loading() && latestMessage) {
|
|
1543
|
+
const shouldAddAiMessage = this.isTemplateMessage(latestMessage) ||
|
|
1544
|
+
(latestMessage.type === 'ai' &&
|
|
1545
|
+
this.getContentValue(latestMessage.content) &&
|
|
1546
|
+
!this.getLoadingState(latestMessage.loading, latestMessage.content, false) &&
|
|
1547
|
+
!this.isStreamingContent(latestMessage.content)) ||
|
|
1548
|
+
latestMessage.type === 'user' ||
|
|
1549
|
+
latestMessage.type === 'activity' ||
|
|
1550
|
+
latestMessage.type === 'activity-trace';
|
|
1551
|
+
if (shouldAddAiMessage) {
|
|
1552
|
+
const newMessages = [...messages];
|
|
1553
|
+
const loadingMessage = {
|
|
1554
|
+
type: 'ai',
|
|
1555
|
+
content: '',
|
|
1556
|
+
loading: true
|
|
1557
|
+
};
|
|
1558
|
+
newMessages.push(loadingMessage);
|
|
1559
|
+
return newMessages;
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
return messages;
|
|
1563
|
+
}, /* @ts-ignore */
|
|
1564
|
+
...(ngDevMode ? [{ debugName: "displayMessages" }] : /* istanbul ignore next */ []));
|
|
1565
|
+
renderedMessages = computed(() => this.displayMessages().map(message => {
|
|
1566
|
+
const actions = 'actions' in message ? (message.actions ?? []) : [];
|
|
1567
|
+
return {
|
|
1568
|
+
message,
|
|
1569
|
+
primaryActions: actions.slice(0, 3),
|
|
1570
|
+
secondaryActions: actions.slice(3)
|
|
1571
|
+
};
|
|
1572
|
+
}), /* @ts-ignore */
|
|
1573
|
+
...(ngDevMode ? [{ debugName: "renderedMessages" }] : /* istanbul ignore next */ []));
|
|
1574
|
+
isTemplateMessage(message) {
|
|
1575
|
+
return 'template' in message && message.template !== undefined;
|
|
1576
|
+
}
|
|
1577
|
+
/**
|
|
1578
|
+
* Scrolls to the bottom of the messages container immediately.
|
|
1579
|
+
* This method forces a scroll even if the user has scrolled up.
|
|
1580
|
+
*/
|
|
1581
|
+
scrollToBottom() {
|
|
1582
|
+
this.chatContainer()?.scrollToBottom();
|
|
1583
|
+
}
|
|
1584
|
+
onInputSend() {
|
|
1585
|
+
this.scrollToBottom();
|
|
1586
|
+
}
|
|
1587
|
+
/**
|
|
1588
|
+
* Focuses the chat input component if it exists.
|
|
1589
|
+
*/
|
|
1590
|
+
focus() {
|
|
1591
|
+
const inputComponent = this.chatInput();
|
|
1592
|
+
if (inputComponent) {
|
|
1593
|
+
inputComponent.focus();
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
getContentValue(content) {
|
|
1597
|
+
if (isSignal(content)) {
|
|
1598
|
+
return content();
|
|
1599
|
+
}
|
|
1600
|
+
return content ?? '';
|
|
1601
|
+
}
|
|
1602
|
+
getMarkdownContent(content) {
|
|
1603
|
+
const value = isSignal(content) ? content() : content;
|
|
1604
|
+
if (typeof value === 'string') {
|
|
1605
|
+
return value;
|
|
1606
|
+
}
|
|
1607
|
+
return value ? `\`\`\`json\n${JSON.stringify(value, undefined, 2)}\n\`\`\`` : '';
|
|
1608
|
+
}
|
|
1609
|
+
isEmptyContent(content) {
|
|
1610
|
+
const contentValue = this.getContentValue(content);
|
|
1611
|
+
return !contentValue || contentValue.trim().length === 0;
|
|
1612
|
+
}
|
|
1613
|
+
getLoadingValue(loading) {
|
|
1614
|
+
if (isSignal(loading)) {
|
|
1615
|
+
return loading();
|
|
1616
|
+
}
|
|
1617
|
+
return loading ?? false;
|
|
1618
|
+
}
|
|
1619
|
+
isStreamingContent(content) {
|
|
1620
|
+
return isSignal(content) && this.getContentValue(content).trim().length > 0;
|
|
1621
|
+
}
|
|
1622
|
+
getLoadingState(messageLoading, content, isLatest, globalLoading = false) {
|
|
1623
|
+
const messageLoadingValue = this.getLoadingValue(messageLoading);
|
|
1624
|
+
const isEmptyContent = this.isEmptyContent(content);
|
|
1625
|
+
return messageLoadingValue || (isLatest && globalLoading && isEmptyContent);
|
|
1626
|
+
}
|
|
1627
|
+
isLatestMessage(message) {
|
|
1628
|
+
const messages = this.displayMessages();
|
|
1629
|
+
return messages[messages.length - 1] === message;
|
|
1630
|
+
}
|
|
1631
|
+
isLatestActivityMessage(message) {
|
|
1632
|
+
const messages = this.displayMessages();
|
|
1633
|
+
const messageIndex = messages.indexOf(message);
|
|
1634
|
+
if (messageIndex === -1) {
|
|
1635
|
+
return false;
|
|
1636
|
+
}
|
|
1637
|
+
return !messages.slice(messageIndex + 1).some(next => {
|
|
1638
|
+
return (!this.isTemplateMessage(next) &&
|
|
1639
|
+
(next.type === 'activity' || next.type === 'activity-trace' || next.type === 'user'));
|
|
1640
|
+
});
|
|
1641
|
+
}
|
|
1642
|
+
shouldAutoExpandTrace(message) {
|
|
1643
|
+
return (this.isLatestActivityMessage(message) &&
|
|
1644
|
+
((message.autoExpand ?? this.autoExpand()) ||
|
|
1645
|
+
message.messages.some(activity => this.hasExplicitAutoExpand(activity))));
|
|
1646
|
+
}
|
|
1647
|
+
shouldAutoExpandActivity(message, active, inheritedAutoExpand) {
|
|
1648
|
+
const directDetail = this.getDirectActivityDetailType(message);
|
|
1649
|
+
const directAutoExpand = directDetail === 'input' && typeof message.autoExpandInputs === 'boolean'
|
|
1650
|
+
? message.autoExpandInputs
|
|
1651
|
+
: directDetail === 'output'
|
|
1652
|
+
? message.autoExpandOutputs
|
|
1653
|
+
: undefined;
|
|
1654
|
+
return (active &&
|
|
1655
|
+
(directAutoExpand ??
|
|
1656
|
+
((message.autoExpand ?? inheritedAutoExpand) || this.hasExplicitAutoExpand(message))));
|
|
1657
|
+
}
|
|
1658
|
+
hasExplicitAutoExpand(message) {
|
|
1659
|
+
return (message.autoExpandInputs === true ||
|
|
1660
|
+
(Array.isArray(message.autoExpandInputs) && message.autoExpandInputs.length > 0) ||
|
|
1661
|
+
message.autoExpandOutputs === true ||
|
|
1662
|
+
!!message.messages?.some(activity => activity.autoExpand === true ? true : this.hasExplicitAutoExpand(activity)));
|
|
1663
|
+
}
|
|
1664
|
+
hasActivityDetails(message) {
|
|
1665
|
+
return (!!this.getContentValue(message.content).trim() ||
|
|
1666
|
+
this.shouldShowActivityInputs(message) ||
|
|
1667
|
+
this.shouldShowActivityOutput(message) ||
|
|
1668
|
+
!!message.messages?.length);
|
|
1669
|
+
}
|
|
1670
|
+
getActivityInputs(message) {
|
|
1671
|
+
if (typeof message.input === 'string') {
|
|
1672
|
+
return [
|
|
1673
|
+
{
|
|
1674
|
+
heading: message.inputArgumentsLabel ?? this.activityInputArgumentsLabel(),
|
|
1675
|
+
content: message.input
|
|
1676
|
+
}
|
|
1677
|
+
];
|
|
1678
|
+
}
|
|
1679
|
+
if (Array.isArray(message.input)) {
|
|
1680
|
+
return message.input.map((heading, index) => ({ heading, key: `${index}` }));
|
|
1681
|
+
}
|
|
1682
|
+
if (message.input) {
|
|
1683
|
+
return Object.entries(message.input).map(([key, content]) => ({
|
|
1684
|
+
heading: key,
|
|
1685
|
+
content,
|
|
1686
|
+
key
|
|
1687
|
+
}));
|
|
1688
|
+
}
|
|
1689
|
+
return [];
|
|
1690
|
+
}
|
|
1691
|
+
hasActivityOutput(message) {
|
|
1692
|
+
return !!message.output?.trim();
|
|
1693
|
+
}
|
|
1694
|
+
getDirectActivityDetail(message) {
|
|
1695
|
+
const detail = this.getDirectActivityDetailType(message);
|
|
1696
|
+
return detail === 'input'
|
|
1697
|
+
? message.input
|
|
1698
|
+
: detail === 'output'
|
|
1699
|
+
? message.output
|
|
1700
|
+
: undefined;
|
|
1701
|
+
}
|
|
1702
|
+
getDirectActivityDetailType(message) {
|
|
1703
|
+
if (message.content || message.messages?.length) {
|
|
1704
|
+
return undefined;
|
|
1705
|
+
}
|
|
1706
|
+
const showInputs = this.shouldShowActivityInputs(message);
|
|
1707
|
+
const showOutput = this.shouldShowActivityOutput(message);
|
|
1708
|
+
if (showInputs && !showOutput && typeof message.input === 'string') {
|
|
1709
|
+
return 'input';
|
|
1710
|
+
}
|
|
1711
|
+
if (showOutput && !showInputs) {
|
|
1712
|
+
return 'output';
|
|
1713
|
+
}
|
|
1714
|
+
return undefined;
|
|
1715
|
+
}
|
|
1716
|
+
shouldShowActivityInputs(message) {
|
|
1717
|
+
const show = this.show();
|
|
1718
|
+
return (this.getActivityInputs(message).length > 0 &&
|
|
1719
|
+
(show === 'inputs' ||
|
|
1720
|
+
show === 'both' ||
|
|
1721
|
+
(show === 'auto' && !this.hasActivityOutput(message))));
|
|
1722
|
+
}
|
|
1723
|
+
shouldShowActivityOutput(message) {
|
|
1724
|
+
const show = this.show();
|
|
1725
|
+
return (this.hasActivityOutput(message) && (show === 'outputs' || show === 'both' || show === 'auto'));
|
|
1726
|
+
}
|
|
1727
|
+
shouldAutoExpandInput(message, inputPart, active, inheritedAutoExpand) {
|
|
1728
|
+
if (!active || inputPart.content === undefined) {
|
|
1729
|
+
return false;
|
|
1730
|
+
}
|
|
1731
|
+
if (Array.isArray(message.autoExpandInputs)) {
|
|
1732
|
+
return inputPart.key !== undefined && message.autoExpandInputs.includes(inputPart.key);
|
|
1733
|
+
}
|
|
1734
|
+
if (message.autoExpandInputs !== undefined) {
|
|
1735
|
+
return message.autoExpandInputs;
|
|
1736
|
+
}
|
|
1737
|
+
if (this.shouldShowActivityOutput(message)) {
|
|
1738
|
+
return false;
|
|
1739
|
+
}
|
|
1740
|
+
return message.autoExpand ?? inheritedAutoExpand;
|
|
1741
|
+
}
|
|
1742
|
+
shouldAutoExpandOutput(message, active, inheritedAutoExpand) {
|
|
1743
|
+
return active && (message.autoExpandOutputs ?? message.autoExpand ?? inheritedAutoExpand);
|
|
1744
|
+
}
|
|
1745
|
+
isSignal = isSignal;
|
|
1746
|
+
onPromptSelected(suggestion) {
|
|
1747
|
+
// Set the input value and emit the send event
|
|
1748
|
+
const inputComponent = this.chatInput();
|
|
1749
|
+
if (inputComponent) {
|
|
1750
|
+
inputComponent.value.set(suggestion.text);
|
|
1751
|
+
// Programmatically trigger the send output
|
|
1752
|
+
inputComponent.send.emit({
|
|
1753
|
+
content: suggestion.text,
|
|
1754
|
+
attachments: []
|
|
1755
|
+
});
|
|
1756
|
+
this.onInputSend();
|
|
1757
|
+
inputComponent.value.set('');
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiAiChatComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1761
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiAiChatComponent, isStandalone: true, selector: "si-ai-chat", inputs: { messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: false, transformFunction: null }, autoExpand: { classPropertyName: "autoExpand", publicName: "autoExpand", isSignal: true, isRequired: false, transformFunction: null }, show: { classPropertyName: "show", publicName: "show", isSignal: true, isRequired: false, transformFunction: null }, sending: { classPropertyName: "sending", publicName: "sending", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, disableInterrupt: { classPropertyName: "disableInterrupt", publicName: "disableInterrupt", isSignal: true, isRequired: false, transformFunction: null }, interrupting: { classPropertyName: "interrupting", publicName: "interrupting", isSignal: true, isRequired: false, transformFunction: null }, noAutoScroll: { classPropertyName: "noAutoScroll", publicName: "noAutoScroll", isSignal: true, isRequired: false, transformFunction: null }, aiIcon: { classPropertyName: "aiIcon", publicName: "aiIcon", isSignal: true, isRequired: false, transformFunction: null }, colorVariant: { classPropertyName: "colorVariant", publicName: "colorVariant", isSignal: true, isRequired: false, transformFunction: null }, markdownOptions: { classPropertyName: "markdownOptions", publicName: "markdownOptions", isSignal: true, isRequired: false, transformFunction: null }, greeting: { classPropertyName: "greeting", publicName: "greeting", isSignal: true, isRequired: false, transformFunction: null }, welcomeMessage: { classPropertyName: "welcomeMessage", publicName: "welcomeMessage", isSignal: true, isRequired: false, transformFunction: null }, promptSuggestions: { classPropertyName: "promptSuggestions", publicName: "promptSuggestions", isSignal: true, isRequired: false, transformFunction: null }, secondaryActionsLabel: { classPropertyName: "secondaryActionsLabel", publicName: "secondaryActionsLabel", isSignal: true, isRequired: false, transformFunction: null }, statusSeverity: { classPropertyName: "statusSeverity", publicName: "statusSeverity", isSignal: true, isRequired: false, transformFunction: null }, statusHeading: { classPropertyName: "statusHeading", publicName: "statusHeading", isSignal: true, isRequired: false, transformFunction: null }, statusMessage: { classPropertyName: "statusMessage", publicName: "statusMessage", isSignal: true, isRequired: false, transformFunction: null }, statusAction: { classPropertyName: "statusAction", publicName: "statusAction", isSignal: true, isRequired: false, transformFunction: null }, activityInputArgumentsLabel: { classPropertyName: "activityInputArgumentsLabel", publicName: "activityInputArgumentsLabel", isSignal: true, isRequired: false, transformFunction: null }, activityOutputLabel: { classPropertyName: "activityOutputLabel", publicName: "activityOutputLabel", isSignal: true, isRequired: false, transformFunction: null }, activityReasoningLabel: { classPropertyName: "activityReasoningLabel", publicName: "activityReasoningLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { messageSent: "messageSent" }, host: { classAttribute: "d-flex si-layout-inner flex-grow-1 flex-column h-100 w-100" }, providers: [{ provide: SI_CHAT_INPUT_PARENT, useExisting: SiAiChatComponent }], queries: [{ propertyName: "chatInput", first: true, predicate: SiChatInputComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "chatContainer", first: true, predicate: SiChatContainerComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<si-chat-container [colorVariant]=\"colorVariant()\" [noAutoScroll]=\"noAutoScroll() || isEmpty()\">\n @if (isEmpty()) {\n <si-ai-welcome-screen\n [categories]=\"promptCategories()\"\n [selectedCategory]=\"selectedCategory()\"\n [promptSuggestions]=\"resolvedPromptSuggestions()\"\n (selectedCategoryChange)=\"selectedCategory.set($event)\"\n (promptSelected)=\"onPromptSelected($event)\"\n >\n <p class=\"h1 mb-0 text-white\">\n <strong>{{ greeting() | translate }}</strong>\n </p>\n <p class=\"h1 mb-0 text-white\">{{ welcomeMessage() | translate }}</p>\n <ng-content select=\"[welcomeScreen]\" />\n </si-ai-welcome-screen>\n }\n\n @for (entry of renderedMessages(); track $index) {\n @let message = entry.message;\n @if (isTemplateMessage(message)) {\n <ng-container\n [ngTemplateOutlet]=\"message.template\"\n [ngTemplateOutletContext]=\"message.templateContext ?? message\"\n />\n } @else {\n @if (message.type === 'user') {\n <si-user-message\n [class.last]=\"$last\"\n [attachments]=\"message.attachments || []\"\n [actions]=\"entry.primaryActions\"\n [secondaryActions]=\"entry.secondaryActions\"\n [actionParam]=\"message\"\n [secondaryActionsLabel]=\"secondaryActionsLabel()\"\n >\n <si-markdown\n [markdown]=\"getContentValue(message.content)\"\n [options]=\"markdownOptions()\"\n />\n </si-user-message>\n }\n\n @if (message.type === 'ai') {\n <si-ai-message\n [loading]=\"\n getLoadingState(message.loading, message.content, isLatestMessage(message), false)\n \"\n [actions]=\"entry.primaryActions\"\n [secondaryActions]=\"entry.secondaryActions\"\n [actionParam]=\"message\"\n [secondaryActionsLabel]=\"secondaryActionsLabel()\"\n >\n <si-markdown\n [markdown]=\"getContentValue(message.content)\"\n [options]=\"markdownOptions()\"\n />\n </si-ai-message>\n }\n\n @if (message.type === 'activity') {\n <ng-container\n [ngTemplateOutlet]=\"activityMessageTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: message,\n active: isLatestActivityMessage(message),\n inheritedAutoExpand: autoExpand()\n }\"\n />\n }\n\n @if (message.type === 'activity-trace') {\n <si-activity-trace [heading]=\"message.name\" [expanded]=\"shouldAutoExpandTrace(message)\">\n @for (activity of message.messages; track activity; let last = $last) {\n <ng-container\n [ngTemplateOutlet]=\"activityMessageTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: activity,\n active: isLatestActivityMessage(message) && last,\n inheritedAutoExpand: message.autoExpand ?? autoExpand()\n }\"\n />\n }\n </si-activity-trace>\n }\n }\n }\n\n <ng-template\n #activityMessageTemplate\n let-message\n let-active=\"active\"\n let-inheritedAutoExpand=\"inheritedAutoExpand\"\n >\n <si-activity-message\n [heading]=\"message.name ?? activityReasoningLabel()\"\n [icon]=\"message.icon === false ? undefined : message.icon\"\n [state]=\"getLoadingValue(message.loading) ? 'running' : undefined\"\n [expanded]=\"shouldAutoExpandActivity(message, active, inheritedAutoExpand)\"\n >\n @if (message.content) {\n <si-markdown\n [markdown]=\"getMarkdownContent(message.content)\"\n [options]=\"markdownOptions()\"\n />\n }\n @if (getDirectActivityDetail(message); as directDetail) {\n <si-markdown [markdown]=\"directDetail\" [options]=\"markdownOptions()\" />\n } @else {\n @if (shouldShowActivityInputs(message)) {\n @for (input of getActivityInputs(message); track input.key ?? $index) {\n <si-activity-message-part\n [heading]=\"input.heading\"\n [collapsible]=\"input.content !== undefined\"\n [expanded]=\"\n shouldAutoExpandInput(\n message,\n input,\n active && !message.messages?.length,\n inheritedAutoExpand\n )\n \"\n >\n @if (input.content !== undefined) {\n <si-markdown [markdown]=\"input.content\" [options]=\"markdownOptions()\" />\n }\n </si-activity-message-part>\n }\n }\n @if (shouldShowActivityOutput(message)) {\n <si-activity-message-part\n [heading]=\"message.outputLabel ?? activityOutputLabel()\"\n [collapsible]=\"true\"\n [expanded]=\"\n shouldAutoExpandOutput(\n message,\n active && !message.messages?.length,\n inheritedAutoExpand\n )\n \"\n >\n <si-markdown [markdown]=\"message.output!\" [options]=\"markdownOptions()\" />\n </si-activity-message-part>\n }\n }\n @for (activity of message.messages ?? []; track activity) {\n <ng-container\n [ngTemplateOutlet]=\"activityMessageTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: activity,\n active: active && $last,\n inheritedAutoExpand: message.autoExpand ?? inheritedAutoExpand\n }\"\n />\n }\n </si-activity-message>\n </ng-template>\n\n @if (statusSeverity() && statusMessage()) {\n <si-inline-notification\n class=\"mb-6 w-100 overflow-hidden\"\n [severity]=\"statusSeverity()!\"\n [heading]=\"statusHeading()\"\n [message]=\"statusMessage()!\"\n [action]=\"statusAction()\"\n />\n }\n\n <div siChatContainerInput class=\"w-100\">\n <ng-content select=\"si-chat-input\" />\n </div>\n</si-chat-container>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SiInlineNotificationComponent, selector: "si-inline-notification", inputs: ["severity", "heading", "message", "action", "translationParams", "embedded"] }, { kind: "component", type: SiAiMessageComponent, selector: "si-ai-message", inputs: ["content", "loading", "actions", "secondaryActions", "actionParam", "sources", "secondaryActionsLabel"], outputs: ["sourceClicked"] }, { kind: "component", type: SiActivityMessageComponent, selector: "si-activity-message", inputs: ["heading", "icon", "state", "expanded"], outputs: ["expandedChange"] }, { kind: "component", type: SiActivityMessagePartComponent, selector: "si-activity-message-part", inputs: ["heading", "collapsible", "expanded"], outputs: ["expandedChange"] }, { kind: "component", type: SiActivityTraceComponent, selector: "si-activity-trace", inputs: ["heading", "expanded"], outputs: ["expandedChange"] }, { kind: "component", type: SiUserMessageComponent, selector: "si-user-message", inputs: ["content", "actions", "secondaryActions", "attachments", "actionParam", "secondaryActionsLabel"] }, { kind: "component", type: SiMarkdownComponent, selector: "si-markdown", inputs: ["markdown", "options", "citations", "debug"], outputs: ["extensionEvent"] }, { kind: "component", type: SiChatContainerComponent, selector: "si-chat-container", inputs: ["colorVariant", "noAutoScroll"] }, { kind: "directive", type: SiChatContainerInputDirective, selector: "[siChatContainerInput]" }, { kind: "component", type: SiAiWelcomeScreenComponent, selector: "si-ai-welcome-screen", inputs: ["categories", "selectedCategory", "promptSuggestions"], outputs: ["selectedCategoryChange", "promptSelected"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
1762
|
+
}
|
|
1763
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiAiChatComponent, decorators: [{
|
|
1764
|
+
type: Component,
|
|
1765
|
+
args: [{ selector: 'si-ai-chat', imports: [
|
|
1766
|
+
NgTemplateOutlet,
|
|
1767
|
+
SiInlineNotificationComponent,
|
|
1768
|
+
SiAiMessageComponent,
|
|
1769
|
+
SiActivityMessageComponent,
|
|
1770
|
+
SiActivityMessagePartComponent,
|
|
1771
|
+
SiActivityTraceComponent,
|
|
1772
|
+
SiUserMessageComponent,
|
|
1773
|
+
SiMarkdownComponent,
|
|
1774
|
+
SiChatContainerComponent,
|
|
1775
|
+
SiChatContainerInputDirective,
|
|
1776
|
+
SiTranslatePipe,
|
|
1777
|
+
SiAiWelcomeScreenComponent
|
|
1778
|
+
], providers: [{ provide: SI_CHAT_INPUT_PARENT, useExisting: SiAiChatComponent }], host: {
|
|
1779
|
+
class: 'd-flex si-layout-inner flex-grow-1 flex-column h-100 w-100'
|
|
1780
|
+
}, template: "<si-chat-container [colorVariant]=\"colorVariant()\" [noAutoScroll]=\"noAutoScroll() || isEmpty()\">\n @if (isEmpty()) {\n <si-ai-welcome-screen\n [categories]=\"promptCategories()\"\n [selectedCategory]=\"selectedCategory()\"\n [promptSuggestions]=\"resolvedPromptSuggestions()\"\n (selectedCategoryChange)=\"selectedCategory.set($event)\"\n (promptSelected)=\"onPromptSelected($event)\"\n >\n <p class=\"h1 mb-0 text-white\">\n <strong>{{ greeting() | translate }}</strong>\n </p>\n <p class=\"h1 mb-0 text-white\">{{ welcomeMessage() | translate }}</p>\n <ng-content select=\"[welcomeScreen]\" />\n </si-ai-welcome-screen>\n }\n\n @for (entry of renderedMessages(); track $index) {\n @let message = entry.message;\n @if (isTemplateMessage(message)) {\n <ng-container\n [ngTemplateOutlet]=\"message.template\"\n [ngTemplateOutletContext]=\"message.templateContext ?? message\"\n />\n } @else {\n @if (message.type === 'user') {\n <si-user-message\n [class.last]=\"$last\"\n [attachments]=\"message.attachments || []\"\n [actions]=\"entry.primaryActions\"\n [secondaryActions]=\"entry.secondaryActions\"\n [actionParam]=\"message\"\n [secondaryActionsLabel]=\"secondaryActionsLabel()\"\n >\n <si-markdown\n [markdown]=\"getContentValue(message.content)\"\n [options]=\"markdownOptions()\"\n />\n </si-user-message>\n }\n\n @if (message.type === 'ai') {\n <si-ai-message\n [loading]=\"\n getLoadingState(message.loading, message.content, isLatestMessage(message), false)\n \"\n [actions]=\"entry.primaryActions\"\n [secondaryActions]=\"entry.secondaryActions\"\n [actionParam]=\"message\"\n [secondaryActionsLabel]=\"secondaryActionsLabel()\"\n >\n <si-markdown\n [markdown]=\"getContentValue(message.content)\"\n [options]=\"markdownOptions()\"\n />\n </si-ai-message>\n }\n\n @if (message.type === 'activity') {\n <ng-container\n [ngTemplateOutlet]=\"activityMessageTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: message,\n active: isLatestActivityMessage(message),\n inheritedAutoExpand: autoExpand()\n }\"\n />\n }\n\n @if (message.type === 'activity-trace') {\n <si-activity-trace [heading]=\"message.name\" [expanded]=\"shouldAutoExpandTrace(message)\">\n @for (activity of message.messages; track activity; let last = $last) {\n <ng-container\n [ngTemplateOutlet]=\"activityMessageTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: activity,\n active: isLatestActivityMessage(message) && last,\n inheritedAutoExpand: message.autoExpand ?? autoExpand()\n }\"\n />\n }\n </si-activity-trace>\n }\n }\n }\n\n <ng-template\n #activityMessageTemplate\n let-message\n let-active=\"active\"\n let-inheritedAutoExpand=\"inheritedAutoExpand\"\n >\n <si-activity-message\n [heading]=\"message.name ?? activityReasoningLabel()\"\n [icon]=\"message.icon === false ? undefined : message.icon\"\n [state]=\"getLoadingValue(message.loading) ? 'running' : undefined\"\n [expanded]=\"shouldAutoExpandActivity(message, active, inheritedAutoExpand)\"\n >\n @if (message.content) {\n <si-markdown\n [markdown]=\"getMarkdownContent(message.content)\"\n [options]=\"markdownOptions()\"\n />\n }\n @if (getDirectActivityDetail(message); as directDetail) {\n <si-markdown [markdown]=\"directDetail\" [options]=\"markdownOptions()\" />\n } @else {\n @if (shouldShowActivityInputs(message)) {\n @for (input of getActivityInputs(message); track input.key ?? $index) {\n <si-activity-message-part\n [heading]=\"input.heading\"\n [collapsible]=\"input.content !== undefined\"\n [expanded]=\"\n shouldAutoExpandInput(\n message,\n input,\n active && !message.messages?.length,\n inheritedAutoExpand\n )\n \"\n >\n @if (input.content !== undefined) {\n <si-markdown [markdown]=\"input.content\" [options]=\"markdownOptions()\" />\n }\n </si-activity-message-part>\n }\n }\n @if (shouldShowActivityOutput(message)) {\n <si-activity-message-part\n [heading]=\"message.outputLabel ?? activityOutputLabel()\"\n [collapsible]=\"true\"\n [expanded]=\"\n shouldAutoExpandOutput(\n message,\n active && !message.messages?.length,\n inheritedAutoExpand\n )\n \"\n >\n <si-markdown [markdown]=\"message.output!\" [options]=\"markdownOptions()\" />\n </si-activity-message-part>\n }\n }\n @for (activity of message.messages ?? []; track activity) {\n <ng-container\n [ngTemplateOutlet]=\"activityMessageTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: activity,\n active: active && $last,\n inheritedAutoExpand: message.autoExpand ?? inheritedAutoExpand\n }\"\n />\n }\n </si-activity-message>\n </ng-template>\n\n @if (statusSeverity() && statusMessage()) {\n <si-inline-notification\n class=\"mb-6 w-100 overflow-hidden\"\n [severity]=\"statusSeverity()!\"\n [heading]=\"statusHeading()\"\n [message]=\"statusMessage()!\"\n [action]=\"statusAction()\"\n />\n }\n\n <div siChatContainerInput class=\"w-100\">\n <ng-content select=\"si-chat-input\" />\n </div>\n</si-chat-container>\n" }]
|
|
1781
|
+
}], ctorParameters: () => [], propDecorators: { chatInput: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SiChatInputComponent), { isSignal: true }] }], chatContainer: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SiChatContainerComponent), { isSignal: true }] }], messages: [{ type: i0.Input, args: [{ isSignal: true, alias: "messages", required: false }] }], autoExpand: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoExpand", required: false }] }], show: [{ type: i0.Input, args: [{ isSignal: true, alias: "show", required: false }] }], sending: [{ type: i0.Input, args: [{ isSignal: true, alias: "sending", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], disableInterrupt: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableInterrupt", required: false }] }], interrupting: [{ type: i0.Input, args: [{ isSignal: true, alias: "interrupting", required: false }] }], noAutoScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "noAutoScroll", required: false }] }], aiIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "aiIcon", required: false }] }], colorVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "colorVariant", required: false }] }], markdownOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "markdownOptions", required: false }] }], greeting: [{ type: i0.Input, args: [{ isSignal: true, alias: "greeting", required: false }] }], welcomeMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "welcomeMessage", required: false }] }], promptSuggestions: [{ type: i0.Input, args: [{ isSignal: true, alias: "promptSuggestions", required: false }] }], secondaryActionsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryActionsLabel", required: false }] }], statusSeverity: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusSeverity", required: false }] }], statusHeading: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusHeading", required: false }] }], statusMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusMessage", required: false }] }], statusAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusAction", required: false }] }], activityInputArgumentsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "activityInputArgumentsLabel", required: false }] }], activityOutputLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "activityOutputLabel", required: false }] }], activityReasoningLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "activityReasoningLabel", required: false }] }], messageSent: [{ type: i0.Output, args: ["messageSent"] }] } });
|
|
1782
|
+
|
|
1210
1783
|
/**
|
|
1211
1784
|
* Copyright (c) Siemens 2016 - 2026
|
|
1212
1785
|
* SPDX-License-Identifier: MIT
|
|
@@ -1216,5 +1789,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
1216
1789
|
* Generated bundle index. Do not edit.
|
|
1217
1790
|
*/
|
|
1218
1791
|
|
|
1219
|
-
export { SiActivityMessageComponent, SiActivityMessagePartComponent, SiActivityTraceComponent, SiAiMessageComponent, SiAiWelcomeScreenComponent, SiAttachmentListComponent, SiChatContainerComponent, SiChatContainerInputDirective, SiChatInputComponent, SiChatInputDisclaimerDirective, SiChatMessageActionDirective, SiChatMessageComponent, SiUserMessageComponent };
|
|
1792
|
+
export { SI_CHAT_INPUT_PARENT, SiActivityMessageComponent, SiActivityMessagePartComponent, SiActivityTraceComponent, SiAiChatComponent, SiAiMessageComponent, SiAiWelcomeScreenComponent, SiAttachmentListComponent, SiChatContainerComponent, SiChatContainerInputDirective, SiChatInputComponent, SiChatInputDisclaimerDirective, SiChatMessageActionDirective, SiChatMessageActionsComponent, SiChatMessageComponent, SiUserMessageComponent };
|
|
1220
1793
|
//# sourceMappingURL=siemens-element-ng-chat-messages.mjs.map
|