@ng-nest/ui 21.0.3 → 21.0.5
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/fesm2022/ng-nest-ui-affix.mjs +12 -12
- package/fesm2022/ng-nest-ui-affix.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-alert.mjs +22 -24
- package/fesm2022/ng-nest-ui-alert.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-anchor.mjs +19 -19
- package/fesm2022/ng-nest-ui-anchor.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-api.mjs +7 -7
- package/fesm2022/ng-nest-ui-attachments.mjs +22 -22
- package/fesm2022/ng-nest-ui-attachments.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-auto-complete.mjs +26 -30
- package/fesm2022/ng-nest-ui-auto-complete.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-avatar.mjs +17 -17
- package/fesm2022/ng-nest-ui-avatar.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-back-top.mjs +13 -13
- package/fesm2022/ng-nest-ui-back-top.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-badge.mjs +16 -16
- package/fesm2022/ng-nest-ui-badge.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-base-form.mjs +15 -14
- package/fesm2022/ng-nest-ui-base-form.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-bubble.mjs +157 -145
- package/fesm2022/ng-nest-ui-bubble.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-button.mjs +31 -31
- package/fesm2022/ng-nest-ui-button.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-calendar.mjs +10 -10
- package/fesm2022/ng-nest-ui-card.mjs +11 -11
- package/fesm2022/ng-nest-ui-card.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-carousel.mjs +24 -24
- package/fesm2022/ng-nest-ui-carousel.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-cascade.mjs +25 -29
- package/fesm2022/ng-nest-ui-cascade.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-checkbox.mjs +22 -22
- package/fesm2022/ng-nest-ui-checkbox.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-collapse.mjs +22 -22
- package/fesm2022/ng-nest-ui-collapse.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-color-picker.mjs +25 -25
- package/fesm2022/ng-nest-ui-color-picker.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-color.mjs +10 -10
- package/fesm2022/ng-nest-ui-comment.mjs +19 -19
- package/fesm2022/ng-nest-ui-comment.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-container.mjs +34 -34
- package/fesm2022/ng-nest-ui-container.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-core.mjs +18 -18
- package/fesm2022/ng-nest-ui-coversations.mjs +11 -11
- package/fesm2022/ng-nest-ui-coversations.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-crumb.mjs +11 -11
- package/fesm2022/ng-nest-ui-crumb.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-date-picker.mjs +87 -87
- package/fesm2022/ng-nest-ui-date-picker.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-description.mjs +20 -20
- package/fesm2022/ng-nest-ui-description.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-dialog.mjs +107 -103
- package/fesm2022/ng-nest-ui-dialog.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-doc.mjs +7 -7
- package/fesm2022/ng-nest-ui-drag.mjs +10 -10
- package/fesm2022/ng-nest-ui-drawer.mjs +34 -34
- package/fesm2022/ng-nest-ui-drawer.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-dropdown.mjs +23 -23
- package/fesm2022/ng-nest-ui-dropdown.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-empty.mjs +10 -10
- package/fesm2022/ng-nest-ui-examples.mjs +7 -7
- package/fesm2022/ng-nest-ui-find.mjs +31 -35
- package/fesm2022/ng-nest-ui-find.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-form.mjs +36 -24
- package/fesm2022/ng-nest-ui-form.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-highlight.mjs +14 -14
- package/fesm2022/ng-nest-ui-highlight.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-i18n.mjs +32 -31
- package/fesm2022/ng-nest-ui-i18n.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-icon.mjs +14 -14
- package/fesm2022/ng-nest-ui-icon.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-image.mjs +55 -43
- package/fesm2022/ng-nest-ui-image.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-inner.mjs +11 -11
- package/fesm2022/ng-nest-ui-inner.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-input-number.mjs +21 -21
- package/fesm2022/ng-nest-ui-input-number.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-input.mjs +48 -42
- package/fesm2022/ng-nest-ui-input.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-keyword.mjs +11 -11
- package/fesm2022/ng-nest-ui-keyword.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-layout.mjs +25 -25
- package/fesm2022/ng-nest-ui-layout.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-link.mjs +13 -13
- package/fesm2022/ng-nest-ui-link.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-list.mjs +44 -41
- package/fesm2022/ng-nest-ui-list.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-loading.mjs +14 -14
- package/fesm2022/ng-nest-ui-loading.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-menu.mjs +37 -25
- package/fesm2022/ng-nest-ui-menu.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-message-box.mjs +10 -10
- package/fesm2022/ng-nest-ui-message-box.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-message.mjs +10 -10
- package/fesm2022/ng-nest-ui-message.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-notification.mjs +10 -10
- package/fesm2022/ng-nest-ui-notification.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-outlet.mjs +7 -7
- package/fesm2022/ng-nest-ui-page-header.mjs +10 -10
- package/fesm2022/ng-nest-ui-pagination.mjs +27 -31
- package/fesm2022/ng-nest-ui-pagination.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-pattern.mjs +7 -7
- package/fesm2022/ng-nest-ui-popconfirm.mjs +14 -14
- package/fesm2022/ng-nest-ui-popconfirm.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-popover.mjs +19 -19
- package/fesm2022/ng-nest-ui-popover.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-portal.mjs +7 -7
- package/fesm2022/ng-nest-ui-progress.mjs +22 -22
- package/fesm2022/ng-nest-ui-progress.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-prompts.mjs +12 -12
- package/fesm2022/ng-nest-ui-prompts.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-radio.mjs +20 -20
- package/fesm2022/ng-nest-ui-radio.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-rate.mjs +15 -15
- package/fesm2022/ng-nest-ui-rate.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-resizable.mjs +14 -14
- package/fesm2022/ng-nest-ui-resizable.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-result.mjs +10 -10
- package/fesm2022/ng-nest-ui-ripple.mjs +12 -12
- package/fesm2022/ng-nest-ui-ripple.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-scrollable.mjs +32 -12
- package/fesm2022/ng-nest-ui-scrollable.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-select.mjs +35 -39
- package/fesm2022/ng-nest-ui-select.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-sender.mjs +19 -19
- package/fesm2022/ng-nest-ui-sender.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-skeleton.mjs +13 -13
- package/fesm2022/ng-nest-ui-skeleton.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-slider-select.mjs +21 -21
- package/fesm2022/ng-nest-ui-slider-select.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-slider.mjs +16 -18
- package/fesm2022/ng-nest-ui-slider.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-statistic.mjs +16 -16
- package/fesm2022/ng-nest-ui-steps.mjs +14 -14
- package/fesm2022/ng-nest-ui-steps.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-suggestion.mjs +17 -17
- package/fesm2022/ng-nest-ui-suggestion.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-switch.mjs +15 -15
- package/fesm2022/ng-nest-ui-switch.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-table-view.mjs +311 -277
- package/fesm2022/ng-nest-ui-table-view.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-table.mjs +107 -117
- package/fesm2022/ng-nest-ui-table.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tabs.mjs +38 -40
- package/fesm2022/ng-nest-ui-tabs.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tag.mjs +16 -16
- package/fesm2022/ng-nest-ui-tag.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-text-retract.mjs +11 -11
- package/fesm2022/ng-nest-ui-text-retract.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-textarea.mjs +19 -19
- package/fesm2022/ng-nest-ui-textarea.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-theme.mjs +12 -12
- package/fesm2022/ng-nest-ui-theme.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-thought-chain.mjs +12 -12
- package/fesm2022/ng-nest-ui-thought-chain.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-time-ago.mjs +7 -7
- package/fesm2022/ng-nest-ui-time-picker.mjs +28 -28
- package/fesm2022/ng-nest-ui-time-picker.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-time-range.mjs +7 -7
- package/fesm2022/ng-nest-ui-timeline.mjs +12 -12
- package/fesm2022/ng-nest-ui-timeline.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tooltip.mjs +17 -17
- package/fesm2022/ng-nest-ui-tooltip.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-transfer.mjs +14 -14
- package/fesm2022/ng-nest-ui-transfer.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tree-file.mjs +17 -17
- package/fesm2022/ng-nest-ui-tree-file.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tree-select.mjs +36 -42
- package/fesm2022/ng-nest-ui-tree-select.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tree.mjs +80 -64
- package/fesm2022/ng-nest-ui-tree.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-typography.mjs +10 -10
- package/fesm2022/ng-nest-ui-upload.mjs +24 -24
- package/fesm2022/ng-nest-ui-upload.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-welcome.mjs +10 -10
- package/package.json +1 -1
- package/types/ng-nest-ui-bubble.d.ts +12 -7
- package/types/ng-nest-ui-dialog.d.ts +170 -102
- package/types/ng-nest-ui-form.d.ts +15 -3
- package/types/ng-nest-ui-i18n.d.ts +29 -28
- package/types/ng-nest-ui-image.d.ts +28 -13
- package/types/ng-nest-ui-input.d.ts +1 -0
- package/types/ng-nest-ui-list.d.ts +31 -20
- package/types/ng-nest-ui-menu.d.ts +15 -3
- package/types/ng-nest-ui-message-box.d.ts +16 -3
- package/types/ng-nest-ui-message.d.ts +15 -3
- package/types/ng-nest-ui-notification.d.ts +15 -3
- package/types/ng-nest-ui-scrollable.d.ts +10 -2
- package/types/ng-nest-ui-table-view.d.ts +99 -65
- package/types/ng-nest-ui-table.d.ts +60 -5
- package/types/ng-nest-ui-tree.d.ts +29 -3
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, Component,
|
|
2
|
+
import { input, output, Component, InjectionToken, inject, Renderer2, ChangeDetectorRef, viewChild, computed, signal, effect, ChangeDetectionStrategy, ViewEncapsulation, ElementRef, contentChildren, NgModule } from '@angular/core';
|
|
3
3
|
import { XPropertyFunction, XToBoolean, XToNumber, XIsEmpty, XIsTemplateRef, XIsString } from '@ng-nest/ui/core';
|
|
4
4
|
import { XOutletDirective } from '@ng-nest/ui/outlet';
|
|
5
5
|
import { NgClass } from '@angular/common';
|
|
6
6
|
import { XAvatarComponent } from '@ng-nest/ui/avatar';
|
|
7
7
|
import { XLoadingComponent } from '@ng-nest/ui/loading';
|
|
8
8
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
9
|
-
import { Subject, fromEvent, takeUntil, isObservable } from 'rxjs';
|
|
10
9
|
import { toObservable } from '@angular/core/rxjs-interop';
|
|
10
|
+
import { isObservable, Subject, fromEvent, takeUntil } from 'rxjs';
|
|
11
11
|
import { XIconComponent } from '@ng-nest/ui/icon';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -72,17 +72,17 @@ class XBubbleProperty extends XPropertyFunction(X_BUBBLE_CONFIG_NAME) {
|
|
|
72
72
|
* @zh_CN 加载中
|
|
73
73
|
* @en_US Loading
|
|
74
74
|
*/
|
|
75
|
-
this.loading = input(false, ...(ngDevMode ?
|
|
75
|
+
this.loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : {}), transform: XToBoolean });
|
|
76
76
|
/**
|
|
77
77
|
* @zh_CN 内容输出打字机效果
|
|
78
78
|
* @en_US Typing effect
|
|
79
79
|
*/
|
|
80
|
-
this.typing = input(false, ...(ngDevMode ?
|
|
80
|
+
this.typing = input(false, { ...(ngDevMode ? { debugName: "typing" } : {}), transform: XToBoolean });
|
|
81
81
|
/**
|
|
82
82
|
* @zh_CN 打字机输出速度
|
|
83
83
|
* @en_US Typing speed
|
|
84
84
|
*/
|
|
85
|
-
this.speed = input(30, ...(ngDevMode ?
|
|
85
|
+
this.speed = input(30, { ...(ngDevMode ? { debugName: "speed" } : {}), transform: XToNumber });
|
|
86
86
|
/**
|
|
87
87
|
* @zh_CN 内容渲染器,可自定义内容的渲染方式,如 HTML、Markdown
|
|
88
88
|
* @en_US Content renderer, can customize content rendering, such as HTML, Markdown
|
|
@@ -92,7 +92,7 @@ class XBubbleProperty extends XPropertyFunction(X_BUBBLE_CONFIG_NAME) {
|
|
|
92
92
|
* @zh_CN 是否显示打字机光标
|
|
93
93
|
* @en_US Whether to show the typing cursor
|
|
94
94
|
*/
|
|
95
|
-
this.showCursor = input(false, ...(ngDevMode ?
|
|
95
|
+
this.showCursor = input(false, { ...(ngDevMode ? { debugName: "showCursor" } : {}), transform: XToBoolean });
|
|
96
96
|
/**
|
|
97
97
|
* @zh_CN 打字开始
|
|
98
98
|
* @en_US Typing start
|
|
@@ -109,10 +109,10 @@ class XBubbleProperty extends XPropertyFunction(X_BUBBLE_CONFIG_NAME) {
|
|
|
109
109
|
*/
|
|
110
110
|
this.typingEnd = output();
|
|
111
111
|
}
|
|
112
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
113
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.
|
|
112
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XBubbleProperty, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
113
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: XBubbleProperty, isStandalone: true, selector: "x-bubble-property", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, reasoningContent: { classPropertyName: "reasoningContent", publicName: "reasoningContent", isSignal: true, isRequired: false, transformFunction: null }, reasoningTitle: { classPropertyName: "reasoningTitle", publicName: "reasoningTitle", isSignal: true, isRequired: false, transformFunction: null }, avatar: { classPropertyName: "avatar", publicName: "avatar", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, footer: { classPropertyName: "footer", publicName: "footer", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, typing: { classPropertyName: "typing", publicName: "typing", isSignal: true, isRequired: false, transformFunction: null }, speed: { classPropertyName: "speed", publicName: "speed", isSignal: true, isRequired: false, transformFunction: null }, renderer: { classPropertyName: "renderer", publicName: "renderer", isSignal: true, isRequired: false, transformFunction: null }, showCursor: { classPropertyName: "showCursor", publicName: "showCursor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { typingStart: "typingStart", typingOuput: "typingOuput", typingEnd: "typingEnd" }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
|
|
114
114
|
}
|
|
115
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XBubbleProperty, decorators: [{
|
|
116
116
|
type: Component,
|
|
117
117
|
args: [{ selector: `${XBubblePrefix}-property`, template: '' }]
|
|
118
118
|
}], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], reasoningContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "reasoningContent", required: false }] }], reasoningTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "reasoningTitle", required: false }] }], avatar: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatar", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], footer: [{ type: i0.Input, args: [{ isSignal: true, alias: "footer", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], typing: [{ type: i0.Input, args: [{ isSignal: true, alias: "typing", required: false }] }], speed: [{ type: i0.Input, args: [{ isSignal: true, alias: "speed", required: false }] }], renderer: [{ type: i0.Input, args: [{ isSignal: true, alias: "renderer", required: false }] }], showCursor: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCursor", required: false }] }], typingStart: [{ type: i0.Output, args: ["typingStart"] }], typingOuput: [{ type: i0.Output, args: ["typingOuput"] }], typingEnd: [{ type: i0.Output, args: ["typingEnd"] }] } });
|
|
@@ -145,136 +145,15 @@ class XBubblesProperty extends XPropertyFunction(X_BUBBLES_CONFIG_NAME) {
|
|
|
145
145
|
*/
|
|
146
146
|
this.scrollChange = output();
|
|
147
147
|
}
|
|
148
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
149
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.
|
|
148
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XBubblesProperty, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
149
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: XBubblesProperty, isStandalone: true, selector: "x-bubbles-property", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { scrollChange: "scrollChange" }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
|
|
150
150
|
}
|
|
151
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XBubblesProperty, decorators: [{
|
|
152
152
|
type: Component,
|
|
153
153
|
args: [{ selector: `${XBubblesPrefix}-property`, template: '' }]
|
|
154
154
|
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], scrollChange: [{ type: i0.Output, args: ["scrollChange"] }] } });
|
|
155
155
|
|
|
156
|
-
|
|
157
|
-
constructor() {
|
|
158
|
-
super(...arguments);
|
|
159
|
-
this.elementRef = inject(ElementRef);
|
|
160
|
-
this.renderer = inject(Renderer2);
|
|
161
|
-
this.parentScrollElement = null;
|
|
162
|
-
this.isFollowing = true;
|
|
163
|
-
this.removeScrollListener = null;
|
|
164
|
-
this.contentMutationObserver = null;
|
|
165
|
-
this.typingObserver = null;
|
|
166
|
-
this.$destroy = new Subject();
|
|
167
|
-
this.bubbles = contentChildren(XBubbleComponent, ...(ngDevMode ? [{ debugName: "bubbles" }] : []));
|
|
168
|
-
}
|
|
169
|
-
ngAfterViewInit() {
|
|
170
|
-
this.stepScroll();
|
|
171
|
-
this.observeContentChanges();
|
|
172
|
-
}
|
|
173
|
-
ngDoCheck() {
|
|
174
|
-
const bubbles = this.bubbles();
|
|
175
|
-
if (bubbles.length <= 0)
|
|
176
|
-
return;
|
|
177
|
-
const lastBubble = bubbles[bubbles.length - 1];
|
|
178
|
-
if (lastBubble &&
|
|
179
|
-
lastBubble.typing() &&
|
|
180
|
-
(lastBubble.pendingContent().length > 0 || lastBubble.reasoningPendingContent().length > 0)) {
|
|
181
|
-
if (!this.typingObserver) {
|
|
182
|
-
this.startTypingObserver(lastBubble);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
if (this.typingObserver) {
|
|
187
|
-
this.stopTypingObserver();
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
ngOnDestroy() {
|
|
192
|
-
this.removeScrollListener?.unsubscribe();
|
|
193
|
-
this.contentMutationObserver?.disconnect();
|
|
194
|
-
this.stopTypingObserver();
|
|
195
|
-
this.$destroy.next();
|
|
196
|
-
this.$destroy.complete();
|
|
197
|
-
}
|
|
198
|
-
stepScroll() {
|
|
199
|
-
const newScroll = this.getParentScrollElement(this.elementRef.nativeElement);
|
|
200
|
-
if (this.parentScrollElement && newScroll === this.parentScrollElement)
|
|
201
|
-
return;
|
|
202
|
-
this.parentScrollElement = newScroll;
|
|
203
|
-
if (this.parentScrollElement) {
|
|
204
|
-
this.removeScrollListener?.unsubscribe();
|
|
205
|
-
this.removeScrollListener = fromEvent(this.parentScrollElement, 'scroll')
|
|
206
|
-
.pipe(takeUntil(this.$destroy))
|
|
207
|
-
.subscribe((event) => {
|
|
208
|
-
const atBottom = this.parentScrollElement.scrollHeight - this.parentScrollElement.scrollTop ===
|
|
209
|
-
this.parentScrollElement.clientHeight;
|
|
210
|
-
if (!atBottom) {
|
|
211
|
-
this.isFollowing = false;
|
|
212
|
-
}
|
|
213
|
-
else {
|
|
214
|
-
this.isFollowing = true;
|
|
215
|
-
}
|
|
216
|
-
this.scrollChange.emit(event);
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
getParentScrollElement(element) {
|
|
221
|
-
let parent = this.renderer.parentNode(element);
|
|
222
|
-
while (parent && parent.nodeType === 1) {
|
|
223
|
-
const overflowY = getComputedStyle(parent).overflowY;
|
|
224
|
-
if (overflowY === 'auto' || overflowY === 'scroll') {
|
|
225
|
-
return parent;
|
|
226
|
-
}
|
|
227
|
-
parent = this.renderer.parentNode(parent);
|
|
228
|
-
}
|
|
229
|
-
return null;
|
|
230
|
-
}
|
|
231
|
-
observeContentChanges() {
|
|
232
|
-
this.contentMutationObserver = new MutationObserver(() => {
|
|
233
|
-
this.isFollowing = true;
|
|
234
|
-
this.scrollToBottom();
|
|
235
|
-
});
|
|
236
|
-
this.contentMutationObserver.observe(this.elementRef.nativeElement, { childList: true });
|
|
237
|
-
}
|
|
238
|
-
startTypingObserver(bubble) {
|
|
239
|
-
const bubbleContent = bubble.wrapperRef()?.nativeElement;
|
|
240
|
-
if (bubbleContent) {
|
|
241
|
-
this.typingObserver = new MutationObserver(() => {
|
|
242
|
-
if (this.isFollowing) {
|
|
243
|
-
this.scrollToBottom();
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
this.typingObserver.observe(bubbleContent, {
|
|
247
|
-
childList: true,
|
|
248
|
-
subtree: true,
|
|
249
|
-
characterData: true
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
stopTypingObserver() {
|
|
254
|
-
if (this.typingObserver) {
|
|
255
|
-
this.typingObserver.disconnect();
|
|
256
|
-
this.typingObserver = null;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
scrollToBottom() {
|
|
260
|
-
this.stepScroll();
|
|
261
|
-
if (this.parentScrollElement) {
|
|
262
|
-
this.parentScrollElement.scrollTop = this.parentScrollElement.scrollHeight;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
scrollToTop() {
|
|
266
|
-
this.stepScroll();
|
|
267
|
-
if (this.parentScrollElement) {
|
|
268
|
-
this.parentScrollElement.scrollTop = 0;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: XBubblesComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
272
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.0", type: XBubblesComponent, isStandalone: true, selector: "x-bubbles", queries: [{ propertyName: "bubbles", predicate: XBubbleComponent, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\r\n", styles: ["x-bubbles{margin:0;padding:0}x-bubbles{display:flex;flex-direction:column;gap:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
273
|
-
}
|
|
274
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: XBubblesComponent, decorators: [{
|
|
275
|
-
type: Component,
|
|
276
|
-
args: [{ selector: 'x-bubbles', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [], template: "<ng-content></ng-content>\r\n", styles: ["x-bubbles{margin:0;padding:0}x-bubbles{display:flex;flex-direction:column;gap:1rem}\n"] }]
|
|
277
|
-
}], propDecorators: { bubbles: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => XBubbleComponent), { isSignal: true }] }] } });
|
|
156
|
+
const X_BUBBLES_CONTEXT = new InjectionToken('X_BUBBLES_CONTEXT');
|
|
278
157
|
|
|
279
158
|
class XBubbleComponent extends XBubbleProperty {
|
|
280
159
|
constructor() {
|
|
@@ -282,7 +161,7 @@ class XBubbleComponent extends XBubbleProperty {
|
|
|
282
161
|
this.sanitizer = inject(DomSanitizer);
|
|
283
162
|
this.renderer2 = inject(Renderer2);
|
|
284
163
|
this.cdr = inject(ChangeDetectorRef);
|
|
285
|
-
this.bubbles = inject(
|
|
164
|
+
this.bubbles = inject(X_BUBBLES_CONTEXT, { optional: true });
|
|
286
165
|
this.wrapperRef = viewChild('wrapperRef', ...(ngDevMode ? [{ debugName: "wrapperRef" }] : []));
|
|
287
166
|
this.classMap = computed(() => ({
|
|
288
167
|
[`${XBubblePrefix}-${this.variantSignal()}`]: !XIsEmpty(this.variantSignal()),
|
|
@@ -303,10 +182,10 @@ class XBubbleComponent extends XBubbleProperty {
|
|
|
303
182
|
this.typingInterval = null;
|
|
304
183
|
this.renderedContent = signal('', ...(ngDevMode ? [{ debugName: "renderedContent" }] : []));
|
|
305
184
|
this.sizeSignal = computed(() => {
|
|
306
|
-
return this.bubbles?.size() || this.size();
|
|
185
|
+
return (this.bubbles?.size() || this.size());
|
|
307
186
|
}, ...(ngDevMode ? [{ debugName: "sizeSignal" }] : []));
|
|
308
187
|
this.variantSignal = computed(() => {
|
|
309
|
-
return this.bubbles?.variant() || this.variant();
|
|
188
|
+
return (this.bubbles?.variant() || this.variant());
|
|
310
189
|
}, ...(ngDevMode ? [{ debugName: "variantSignal" }] : []));
|
|
311
190
|
this.isTemplate = computed(() => {
|
|
312
191
|
return XIsTemplateRef(this.content());
|
|
@@ -458,20 +337,153 @@ class XBubbleComponent extends XBubbleProperty {
|
|
|
458
337
|
ngOnDestroy() {
|
|
459
338
|
this.stopTyping();
|
|
460
339
|
}
|
|
461
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
462
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.
|
|
340
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XBubbleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
341
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: XBubbleComponent, isStandalone: true, selector: "x-bubble", viewQueries: [{ propertyName: "wrapperRef", first: true, predicate: ["wrapperRef"], descendants: true, isSignal: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"x-bubble\" [ngClass]=\"classMap()\">\r\n @if (!!avatar()) {\r\n <div class=\"x-bubble-avatar\" [class.x-bubble-avatar-hidden]=\"avatar()?.hidden\">\r\n <x-avatar\r\n [icon]=\"avatar()?.icon!\"\r\n [label]=\"avatar()?.label!\"\r\n [src]=\"avatar()?.src!\"\r\n [size]=\"avatar()?.size ?? sizeSignal()\"\r\n [gap]=\"avatar()?.gap ?? '0.25rem'\"\r\n [fit]=\"avatar()?.fit ?? 'cover'\"\r\n [backgroundColor]=\"avatar()?.backgroundColor ?? '#999999'\"\r\n [color]=\"avatar()?.color ?? '#FFFFFF'\"\r\n [shape]=\"avatar()?.shape ?? 'circle'\"\r\n ></x-avatar>\r\n </div>\r\n }\r\n <div #wrapperRef class=\"x-bubble-wrapper\">\r\n @if (loading()) {\r\n <div class=\"x-bubble-content\" [x-loading]=\"true\" [size]=\"'small'\" inline></div>\r\n } @else {\r\n @if (header()) {\r\n <div class=\"x-bubble-header\">\r\n <ng-container *xOutlet=\"header()\">{{ header() }}</ng-container>\r\n </div>\r\n }\r\n\r\n @if (isReasoningString()) {\r\n <div class=\"x-bubble-reasoning\">\r\n <ng-container *xOutlet=\"reasoningHeaderTpl\"></ng-container>\r\n @if (reasoningToggle()) {\r\n <div class=\"x-bubble-reasoning-content\" #reasoningContentRef [innerHTML]=\"reasoningRenderedContent()\"></div>\r\n }\r\n </div>\r\n } @else if (isReasoningTemplate()) {\r\n <div class=\"x-bubble-reasoning\">\r\n <ng-container *xOutlet=\"reasoningHeaderTpl\"></ng-container>\r\n @if (reasoningToggle()) {\r\n <div class=\"x-bubble-reasoning-content\" #reasoningContentRef>\r\n <ng-container *xOutlet=\"reasoningContent()\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <ng-template #reasoningHeaderTpl>\r\n <div class=\"x-bubble-reasoning-header\" (click)=\"onReasoningToggle()\">\r\n <x-icon\r\n class=\"x-bubble-reasoning-toggle\"\r\n [type]=\"reasoningToggle() ? 'fto-chevron-down' : 'fto-chevron-right'\"\r\n ></x-icon>\r\n <span>{{ reasoningTitle() }}</span>\r\n </div>\r\n </ng-template>\r\n\r\n @if (isString()) {\r\n <div class=\"x-bubble-content\" #contentRef [innerHTML]=\"renderedContent()\"></div>\r\n } @else if (isTemplate()) {\r\n <div class=\"x-bubble-content\" #contentRef>\r\n <ng-container *xOutlet=\"content()\"></ng-container>\r\n </div>\r\n }\r\n\r\n @if (footer()) {\r\n <div class=\"x-bubble-footer\">\r\n <ng-container *xOutlet=\"footer()\">{{ footer() }}</ng-container>\r\n </div>\r\n }\r\n }\r\n </div>\r\n</div>\r\n", styles: [".x-bubble{margin:0;padding:0}.x-bubble{display:flex}.x-bubble-wrapper{flex:auto;display:flex;flex-direction:column;align-items:flex-start;min-width:0;max-width:100%}.x-bubble-reasoning{background-color:var(--x-background-a100);color:var(--x-text-400);position:relative;box-sizing:border-box;min-width:0;max-width:100%;font-size:var(--x-font-size-small);border-radius:var(--x-border-radius);word-break:break-word;margin-bottom:1rem}.x-bubble-reasoning-header{padding:.5rem 1rem .5rem .45rem;display:flex;align-items:center;gap:.5rem;cursor:pointer}.x-bubble-reasoning-toggle{font-size:var(--x-font-size-large)}.x-bubble-reasoning-content{position:relative;padding:0rem 1rem 0rem 2rem;margin-bottom:1rem}.x-bubble-reasoning-content:before{position:absolute;top:0;left:1rem;content:\" \";height:100%;border-left:var(--x-border-width) var(--x-border-style) var(--x-border)}.x-bubble-content{position:relative;box-sizing:border-box;min-width:0;max-width:100%;color:var(--x-text);font-size:var(--x-font-size);border-radius:var(--x-border-radius);word-break:break-word}.x-bubble-outlined .x-bubble-content{border:var(--x-border-width) var(--x-border-style) var(--x-border)}.x-bubble-filled .x-bubble-content{background-color:var(--x-background-a200)}.x-bubble-shadow .x-bubble-content{box-shadow:var(--x-box-shadow)}.x-bubble-end{flex-direction:row-reverse}.x-bubble-end .x-bubble-wrapper{align-items:flex-end}.x-bubble-header{margin-bottom:.25rem}.x-bubble-footer{margin-top:.5rem}.x-bubble-cursor.x-bubble-typing .x-bubble-content:after{content:\"\";display:inline-block;width:.0625rem;height:1.1em;margin-left:.0625rem;background-color:currentColor;vertical-align:middle;animation:x-bubble-blink 1s infinite}.x-bubble-cursor:not(.x-bubble-typing) .x-bubble-content:after{display:none}.x-bubble-avatar-hidden{visibility:hidden}@keyframes x-bubble-blink{0%{opacity:1}50%{opacity:0}to{opacity:1}}.x-bubble.x-big{column-gap:var(--x-padding-big)}.x-bubble.x-big .x-bubble-content{padding:calc(var(--x-padding-big) - .25rem) var(--x-padding-big);line-height:calc(var(--x-height-big) - 1rem);min-height:calc(var(--x-padding-big) * 2 + var(--x-height-big) - 1.5rem)}.x-bubble.x-large{column-gap:var(--x-padding-large)}.x-bubble.x-large .x-bubble-content{padding:calc(var(--x-padding-large) - .25rem) var(--x-padding-large);line-height:calc(var(--x-height-large) - 1rem);min-height:calc(var(--x-padding-large) * 2 + var(--x-height-large) - 1.5rem)}.x-bubble.x-medium{column-gap:var(--x-padding-medium)}.x-bubble.x-medium .x-bubble-content{padding:calc(var(--x-padding-medium) - .25rem) var(--x-padding-medium);line-height:calc(var(--x-height-medium) - 1rem);min-height:calc(var(--x-padding-medium) * 2 + var(--x-height-medium) - 1.5rem)}.x-bubble.x-small{column-gap:var(--x-padding-small)}.x-bubble.x-small .x-bubble-content{padding:calc(var(--x-padding-small) - .25rem) var(--x-padding-small);line-height:calc(var(--x-height-small) - 1rem);min-height:calc(var(--x-padding-small) * 2 + var(--x-height-small) - 1.5rem)}.x-bubble.x-mini{column-gap:var(--x-padding-mini)}.x-bubble.x-mini .x-bubble-content{padding:calc(var(--x-padding-mini) - .25rem) var(--x-padding-mini);line-height:calc(var(--x-height-mini) - 1rem);min-height:calc(var(--x-padding-mini) * 2 + var(--x-height-mini) - 1.5rem)}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }, { kind: "component", type: XAvatarComponent, selector: "x-avatar" }, { kind: "component", type: XIconComponent, selector: "x-icon" }, { kind: "component", type: XLoadingComponent, selector: "x-loading, [x-loading]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
463
342
|
}
|
|
464
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
343
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XBubbleComponent, decorators: [{
|
|
465
344
|
type: Component,
|
|
466
|
-
args: [{ selector: 'x-bubble', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass, XOutletDirective, XAvatarComponent, XIconComponent, XLoadingComponent], template: "<div class=\"x-bubble\" [ngClass]=\"classMap()\">\r\n @if (!!avatar()) {\r\n <div class=\"x-bubble-avatar\" [class.x-bubble-avatar-hidden]=\"avatar()?.hidden\">\r\n <x-avatar\r\n [icon]=\"avatar()?.icon!\"\r\n [label]=\"avatar()?.label!\"\r\n [src]=\"avatar()?.src!\"\r\n [size]=\"avatar()?.size ??
|
|
345
|
+
args: [{ selector: 'x-bubble', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass, XOutletDirective, XAvatarComponent, XIconComponent, XLoadingComponent], template: "<div class=\"x-bubble\" [ngClass]=\"classMap()\">\r\n @if (!!avatar()) {\r\n <div class=\"x-bubble-avatar\" [class.x-bubble-avatar-hidden]=\"avatar()?.hidden\">\r\n <x-avatar\r\n [icon]=\"avatar()?.icon!\"\r\n [label]=\"avatar()?.label!\"\r\n [src]=\"avatar()?.src!\"\r\n [size]=\"avatar()?.size ?? sizeSignal()\"\r\n [gap]=\"avatar()?.gap ?? '0.25rem'\"\r\n [fit]=\"avatar()?.fit ?? 'cover'\"\r\n [backgroundColor]=\"avatar()?.backgroundColor ?? '#999999'\"\r\n [color]=\"avatar()?.color ?? '#FFFFFF'\"\r\n [shape]=\"avatar()?.shape ?? 'circle'\"\r\n ></x-avatar>\r\n </div>\r\n }\r\n <div #wrapperRef class=\"x-bubble-wrapper\">\r\n @if (loading()) {\r\n <div class=\"x-bubble-content\" [x-loading]=\"true\" [size]=\"'small'\" inline></div>\r\n } @else {\r\n @if (header()) {\r\n <div class=\"x-bubble-header\">\r\n <ng-container *xOutlet=\"header()\">{{ header() }}</ng-container>\r\n </div>\r\n }\r\n\r\n @if (isReasoningString()) {\r\n <div class=\"x-bubble-reasoning\">\r\n <ng-container *xOutlet=\"reasoningHeaderTpl\"></ng-container>\r\n @if (reasoningToggle()) {\r\n <div class=\"x-bubble-reasoning-content\" #reasoningContentRef [innerHTML]=\"reasoningRenderedContent()\"></div>\r\n }\r\n </div>\r\n } @else if (isReasoningTemplate()) {\r\n <div class=\"x-bubble-reasoning\">\r\n <ng-container *xOutlet=\"reasoningHeaderTpl\"></ng-container>\r\n @if (reasoningToggle()) {\r\n <div class=\"x-bubble-reasoning-content\" #reasoningContentRef>\r\n <ng-container *xOutlet=\"reasoningContent()\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <ng-template #reasoningHeaderTpl>\r\n <div class=\"x-bubble-reasoning-header\" (click)=\"onReasoningToggle()\">\r\n <x-icon\r\n class=\"x-bubble-reasoning-toggle\"\r\n [type]=\"reasoningToggle() ? 'fto-chevron-down' : 'fto-chevron-right'\"\r\n ></x-icon>\r\n <span>{{ reasoningTitle() }}</span>\r\n </div>\r\n </ng-template>\r\n\r\n @if (isString()) {\r\n <div class=\"x-bubble-content\" #contentRef [innerHTML]=\"renderedContent()\"></div>\r\n } @else if (isTemplate()) {\r\n <div class=\"x-bubble-content\" #contentRef>\r\n <ng-container *xOutlet=\"content()\"></ng-container>\r\n </div>\r\n }\r\n\r\n @if (footer()) {\r\n <div class=\"x-bubble-footer\">\r\n <ng-container *xOutlet=\"footer()\">{{ footer() }}</ng-container>\r\n </div>\r\n }\r\n }\r\n </div>\r\n</div>\r\n", styles: [".x-bubble{margin:0;padding:0}.x-bubble{display:flex}.x-bubble-wrapper{flex:auto;display:flex;flex-direction:column;align-items:flex-start;min-width:0;max-width:100%}.x-bubble-reasoning{background-color:var(--x-background-a100);color:var(--x-text-400);position:relative;box-sizing:border-box;min-width:0;max-width:100%;font-size:var(--x-font-size-small);border-radius:var(--x-border-radius);word-break:break-word;margin-bottom:1rem}.x-bubble-reasoning-header{padding:.5rem 1rem .5rem .45rem;display:flex;align-items:center;gap:.5rem;cursor:pointer}.x-bubble-reasoning-toggle{font-size:var(--x-font-size-large)}.x-bubble-reasoning-content{position:relative;padding:0rem 1rem 0rem 2rem;margin-bottom:1rem}.x-bubble-reasoning-content:before{position:absolute;top:0;left:1rem;content:\" \";height:100%;border-left:var(--x-border-width) var(--x-border-style) var(--x-border)}.x-bubble-content{position:relative;box-sizing:border-box;min-width:0;max-width:100%;color:var(--x-text);font-size:var(--x-font-size);border-radius:var(--x-border-radius);word-break:break-word}.x-bubble-outlined .x-bubble-content{border:var(--x-border-width) var(--x-border-style) var(--x-border)}.x-bubble-filled .x-bubble-content{background-color:var(--x-background-a200)}.x-bubble-shadow .x-bubble-content{box-shadow:var(--x-box-shadow)}.x-bubble-end{flex-direction:row-reverse}.x-bubble-end .x-bubble-wrapper{align-items:flex-end}.x-bubble-header{margin-bottom:.25rem}.x-bubble-footer{margin-top:.5rem}.x-bubble-cursor.x-bubble-typing .x-bubble-content:after{content:\"\";display:inline-block;width:.0625rem;height:1.1em;margin-left:.0625rem;background-color:currentColor;vertical-align:middle;animation:x-bubble-blink 1s infinite}.x-bubble-cursor:not(.x-bubble-typing) .x-bubble-content:after{display:none}.x-bubble-avatar-hidden{visibility:hidden}@keyframes x-bubble-blink{0%{opacity:1}50%{opacity:0}to{opacity:1}}.x-bubble.x-big{column-gap:var(--x-padding-big)}.x-bubble.x-big .x-bubble-content{padding:calc(var(--x-padding-big) - .25rem) var(--x-padding-big);line-height:calc(var(--x-height-big) - 1rem);min-height:calc(var(--x-padding-big) * 2 + var(--x-height-big) - 1.5rem)}.x-bubble.x-large{column-gap:var(--x-padding-large)}.x-bubble.x-large .x-bubble-content{padding:calc(var(--x-padding-large) - .25rem) var(--x-padding-large);line-height:calc(var(--x-height-large) - 1rem);min-height:calc(var(--x-padding-large) * 2 + var(--x-height-large) - 1.5rem)}.x-bubble.x-medium{column-gap:var(--x-padding-medium)}.x-bubble.x-medium .x-bubble-content{padding:calc(var(--x-padding-medium) - .25rem) var(--x-padding-medium);line-height:calc(var(--x-height-medium) - 1rem);min-height:calc(var(--x-padding-medium) * 2 + var(--x-height-medium) - 1.5rem)}.x-bubble.x-small{column-gap:var(--x-padding-small)}.x-bubble.x-small .x-bubble-content{padding:calc(var(--x-padding-small) - .25rem) var(--x-padding-small);line-height:calc(var(--x-height-small) - 1rem);min-height:calc(var(--x-padding-small) * 2 + var(--x-height-small) - 1.5rem)}.x-bubble.x-mini{column-gap:var(--x-padding-mini)}.x-bubble.x-mini .x-bubble-content{padding:calc(var(--x-padding-mini) - .25rem) var(--x-padding-mini);line-height:calc(var(--x-height-mini) - 1rem);min-height:calc(var(--x-padding-mini) * 2 + var(--x-height-mini) - 1.5rem)}\n"] }]
|
|
467
346
|
}], ctorParameters: () => [], propDecorators: { wrapperRef: [{ type: i0.ViewChild, args: ['wrapperRef', { isSignal: true }] }] } });
|
|
468
347
|
|
|
348
|
+
class XBubblesComponent extends XBubblesProperty {
|
|
349
|
+
constructor() {
|
|
350
|
+
super(...arguments);
|
|
351
|
+
this.elementRef = inject(ElementRef);
|
|
352
|
+
this.renderer = inject(Renderer2);
|
|
353
|
+
this.parentScrollElement = null;
|
|
354
|
+
this.isFollowing = true;
|
|
355
|
+
this.removeScrollListener = null;
|
|
356
|
+
this.contentMutationObserver = null;
|
|
357
|
+
this.typingObserver = null;
|
|
358
|
+
this.$destroy = new Subject();
|
|
359
|
+
this.bubbles = contentChildren(XBubbleComponent, ...(ngDevMode ? [{ debugName: "bubbles" }] : []));
|
|
360
|
+
}
|
|
361
|
+
ngAfterViewInit() {
|
|
362
|
+
this.stepScroll();
|
|
363
|
+
this.observeContentChanges();
|
|
364
|
+
}
|
|
365
|
+
ngDoCheck() {
|
|
366
|
+
const bubbles = this.bubbles();
|
|
367
|
+
if (bubbles.length <= 0)
|
|
368
|
+
return;
|
|
369
|
+
const lastBubble = bubbles[bubbles.length - 1];
|
|
370
|
+
if (lastBubble &&
|
|
371
|
+
lastBubble.typing() &&
|
|
372
|
+
(lastBubble.pendingContent().length > 0 || lastBubble.reasoningPendingContent().length > 0)) {
|
|
373
|
+
if (!this.typingObserver) {
|
|
374
|
+
this.startTypingObserver(lastBubble);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
if (this.typingObserver) {
|
|
379
|
+
this.stopTypingObserver();
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
ngOnDestroy() {
|
|
384
|
+
this.removeScrollListener?.unsubscribe();
|
|
385
|
+
this.contentMutationObserver?.disconnect();
|
|
386
|
+
this.stopTypingObserver();
|
|
387
|
+
this.$destroy.next();
|
|
388
|
+
this.$destroy.complete();
|
|
389
|
+
}
|
|
390
|
+
stepScroll() {
|
|
391
|
+
const newScroll = this.getParentScrollElement(this.elementRef.nativeElement);
|
|
392
|
+
if (this.parentScrollElement && newScroll === this.parentScrollElement)
|
|
393
|
+
return;
|
|
394
|
+
this.parentScrollElement = newScroll;
|
|
395
|
+
if (this.parentScrollElement) {
|
|
396
|
+
this.removeScrollListener?.unsubscribe();
|
|
397
|
+
this.removeScrollListener = fromEvent(this.parentScrollElement, 'scroll')
|
|
398
|
+
.pipe(takeUntil(this.$destroy))
|
|
399
|
+
.subscribe((event) => {
|
|
400
|
+
const atBottom = this.parentScrollElement.scrollHeight - this.parentScrollElement.scrollTop ===
|
|
401
|
+
this.parentScrollElement.clientHeight;
|
|
402
|
+
if (!atBottom) {
|
|
403
|
+
this.isFollowing = false;
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
this.isFollowing = true;
|
|
407
|
+
}
|
|
408
|
+
this.scrollChange.emit(event);
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
getParentScrollElement(element) {
|
|
413
|
+
let parent = this.renderer.parentNode(element);
|
|
414
|
+
while (parent && parent.nodeType === 1) {
|
|
415
|
+
const overflowY = getComputedStyle(parent).overflowY;
|
|
416
|
+
if (overflowY === 'auto' || overflowY === 'scroll') {
|
|
417
|
+
return parent;
|
|
418
|
+
}
|
|
419
|
+
parent = this.renderer.parentNode(parent);
|
|
420
|
+
}
|
|
421
|
+
return null;
|
|
422
|
+
}
|
|
423
|
+
observeContentChanges() {
|
|
424
|
+
this.contentMutationObserver = new MutationObserver(() => {
|
|
425
|
+
this.isFollowing = true;
|
|
426
|
+
this.scrollToBottom();
|
|
427
|
+
});
|
|
428
|
+
this.contentMutationObserver.observe(this.elementRef.nativeElement, { childList: true });
|
|
429
|
+
}
|
|
430
|
+
startTypingObserver(bubble) {
|
|
431
|
+
const bubbleContent = bubble.wrapperRef()?.nativeElement;
|
|
432
|
+
if (bubbleContent) {
|
|
433
|
+
this.typingObserver = new MutationObserver(() => {
|
|
434
|
+
if (this.isFollowing) {
|
|
435
|
+
this.scrollToBottom();
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
this.typingObserver.observe(bubbleContent, {
|
|
439
|
+
childList: true,
|
|
440
|
+
subtree: true,
|
|
441
|
+
characterData: true
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
stopTypingObserver() {
|
|
446
|
+
if (this.typingObserver) {
|
|
447
|
+
this.typingObserver.disconnect();
|
|
448
|
+
this.typingObserver = null;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
scrollToBottom() {
|
|
452
|
+
this.stepScroll();
|
|
453
|
+
if (this.parentScrollElement) {
|
|
454
|
+
this.parentScrollElement.scrollTop = this.parentScrollElement.scrollHeight;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
scrollToTop() {
|
|
458
|
+
this.stepScroll();
|
|
459
|
+
if (this.parentScrollElement) {
|
|
460
|
+
this.parentScrollElement.scrollTop = 0;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XBubblesComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
464
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: XBubblesComponent, isStandalone: true, selector: "x-bubbles", providers: [
|
|
465
|
+
{
|
|
466
|
+
provide: X_BUBBLES_CONTEXT,
|
|
467
|
+
useExisting: XBubblesComponent
|
|
468
|
+
}
|
|
469
|
+
], queries: [{ propertyName: "bubbles", predicate: XBubbleComponent, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\r\n", styles: ["x-bubbles{margin:0;padding:0}x-bubbles{display:flex;flex-direction:column;gap:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
470
|
+
}
|
|
471
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XBubblesComponent, decorators: [{
|
|
472
|
+
type: Component,
|
|
473
|
+
args: [{ selector: 'x-bubbles', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [], providers: [
|
|
474
|
+
{
|
|
475
|
+
provide: X_BUBBLES_CONTEXT,
|
|
476
|
+
useExisting: XBubblesComponent
|
|
477
|
+
}
|
|
478
|
+
], template: "<ng-content></ng-content>\r\n", styles: ["x-bubbles{margin:0;padding:0}x-bubbles{display:flex;flex-direction:column;gap:1rem}\n"] }]
|
|
479
|
+
}], propDecorators: { bubbles: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => XBubbleComponent), { isSignal: true }] }] } });
|
|
480
|
+
|
|
469
481
|
class XBubbleModule {
|
|
470
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
471
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.
|
|
472
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.
|
|
482
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XBubbleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
483
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: XBubbleModule, imports: [XBubbleComponent, XBubblesComponent], exports: [XBubbleComponent, XBubblesComponent] }); }
|
|
484
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XBubbleModule, imports: [XBubbleComponent] }); }
|
|
473
485
|
}
|
|
474
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
486
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XBubbleModule, decorators: [{
|
|
475
487
|
type: NgModule,
|
|
476
488
|
args: [{
|
|
477
489
|
exports: [XBubbleComponent, XBubblesComponent],
|