ngx-strata 0.6.1 → 0.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/assets/icons/check-double.svg +1 -0
- package/assets/icons/check-single.svg +1 -0
- package/assets/styles/base.scss +6 -0
- package/assets/styles/components/modal.scss +22 -0
- package/dist/strata/strata.css +1 -1
- package/fesm2022/ngx-strata.mjs +141 -6
- package/fesm2022/ngx-strata.mjs.map +1 -1
- package/package.json +1 -1
- package/skills/ngx-strata/SKILL.md +2 -0
- package/skills/ngx-strata/components/chat.md +100 -0
- package/skills/ngx-strata/components/icon.md +1 -1
- package/types/ngx-strata.d.ts +54 -2
package/fesm2022/ngx-strata.mjs
CHANGED
|
@@ -115,6 +115,14 @@ const baseIconConfigs = [
|
|
|
115
115
|
{
|
|
116
116
|
name: 'image',
|
|
117
117
|
url: 'assets/icons/image.svg'
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'check-single',
|
|
121
|
+
url: 'assets/icons/check-single.svg'
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: 'check-double',
|
|
125
|
+
url: 'assets/icons/check-double.svg'
|
|
118
126
|
}
|
|
119
127
|
];
|
|
120
128
|
|
|
@@ -1785,6 +1793,133 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
1785
1793
|
}, template: "<ng-content select=\"[stButton], st-divider\" #buttons></ng-content>\n" }]
|
|
1786
1794
|
}], propDecorators: { justification: [{ type: i0.Input, args: [{ isSignal: true, alias: "justification", required: false }] }] } });
|
|
1787
1795
|
|
|
1796
|
+
class StrataChatComponent {
|
|
1797
|
+
spacing = input('comfortable', /* @ts-ignore */
|
|
1798
|
+
...(ngDevMode ? [{ debugName: "spacing" }] : /* istanbul ignore next */ []));
|
|
1799
|
+
hostClasses = computed(() => `st-chat ${this.spacing()}`, /* @ts-ignore */
|
|
1800
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1801
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: StrataChatComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1802
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.1", type: StrataChatComponent, isStandalone: true, selector: "st-chat", inputs: { spacing: { classPropertyName: "spacing", publicName: "spacing", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0, template: "<ng-content />\n", styles: [":host{--st-chat-bg: transparent;--st-chat-gap: var(--st-space-3);--st-chat-gap-compact: var(--st-space-1);display:flex;flex-direction:column;width:100%;max-width:100%;min-width:0;box-sizing:border-box;background-color:var(--st-chat-bg);gap:var(--st-chat-gap)}:host>*{min-width:0;max-width:100%;box-sizing:border-box}:host.compact{gap:var(--st-chat-gap-compact);--st-chat-message-padding: var(--st-space-1) var(--st-space-2)}:host.comfortable{gap:var(--st-chat-gap)}\n"] });
|
|
1803
|
+
}
|
|
1804
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: StrataChatComponent, decorators: [{
|
|
1805
|
+
type: Component,
|
|
1806
|
+
args: [{ selector: 'st-chat', imports: [], host: {
|
|
1807
|
+
'[class]': 'hostClasses()'
|
|
1808
|
+
}, template: "<ng-content />\n", styles: [":host{--st-chat-bg: transparent;--st-chat-gap: var(--st-space-3);--st-chat-gap-compact: var(--st-space-1);display:flex;flex-direction:column;width:100%;max-width:100%;min-width:0;box-sizing:border-box;background-color:var(--st-chat-bg);gap:var(--st-chat-gap)}:host>*{min-width:0;max-width:100%;box-sizing:border-box}:host.compact{gap:var(--st-chat-gap-compact);--st-chat-message-padding: var(--st-space-1) var(--st-space-2)}:host.comfortable{gap:var(--st-chat-gap)}\n"] }]
|
|
1809
|
+
}], propDecorators: { spacing: [{ type: i0.Input, args: [{ isSignal: true, alias: "spacing", required: false }] }] } });
|
|
1810
|
+
|
|
1811
|
+
class StrataChatMessageComponent {
|
|
1812
|
+
variant = input('incoming', /* @ts-ignore */
|
|
1813
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
1814
|
+
timestamp = input(null, /* @ts-ignore */
|
|
1815
|
+
...(ngDevMode ? [{ debugName: "timestamp" }] : /* istanbul ignore next */ []));
|
|
1816
|
+
status = input(null, /* @ts-ignore */
|
|
1817
|
+
...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
|
|
1818
|
+
showAvatar = input(true, { ...(ngDevMode ? { debugName: "showAvatar" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1819
|
+
position = input('single', /* @ts-ignore */
|
|
1820
|
+
...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
1821
|
+
groupVariant = signal(null, /* @ts-ignore */
|
|
1822
|
+
...(ngDevMode ? [{ debugName: "groupVariant" }] : /* istanbul ignore next */ []));
|
|
1823
|
+
groupPosition = signal(null, /* @ts-ignore */
|
|
1824
|
+
...(ngDevMode ? [{ debugName: "groupPosition" }] : /* istanbul ignore next */ []));
|
|
1825
|
+
groupShowAvatar = signal(null, /* @ts-ignore */
|
|
1826
|
+
...(ngDevMode ? [{ debugName: "groupShowAvatar" }] : /* istanbul ignore next */ []));
|
|
1827
|
+
groupPreserveAvatarSpace = signal(false, /* @ts-ignore */
|
|
1828
|
+
...(ngDevMode ? [{ debugName: "groupPreserveAvatarSpace" }] : /* istanbul ignore next */ []));
|
|
1829
|
+
effectiveVariant = computed(() => this.groupVariant() ?? this.variant(), /* @ts-ignore */
|
|
1830
|
+
...(ngDevMode ? [{ debugName: "effectiveVariant" }] : /* istanbul ignore next */ []));
|
|
1831
|
+
effectivePosition = computed(() => this.groupPosition() ?? this.position(), /* @ts-ignore */
|
|
1832
|
+
...(ngDevMode ? [{ debugName: "effectivePosition" }] : /* istanbul ignore next */ []));
|
|
1833
|
+
effectiveShowAvatar = computed(() => this.groupShowAvatar() ?? this.showAvatar(), /* @ts-ignore */
|
|
1834
|
+
...(ngDevMode ? [{ debugName: "effectiveShowAvatar" }] : /* istanbul ignore next */ []));
|
|
1835
|
+
hostClasses = computed(() => {
|
|
1836
|
+
const classes = [
|
|
1837
|
+
'st-chat-message',
|
|
1838
|
+
this.effectiveVariant(),
|
|
1839
|
+
this.effectivePosition()
|
|
1840
|
+
];
|
|
1841
|
+
return classes.join(' ');
|
|
1842
|
+
}, /* @ts-ignore */
|
|
1843
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1844
|
+
setGroupConfig(variant, position, showAvatar, preserveAvatarSpace) {
|
|
1845
|
+
this.groupVariant.set(variant);
|
|
1846
|
+
this.groupPosition.set(position);
|
|
1847
|
+
this.groupShowAvatar.set(showAvatar);
|
|
1848
|
+
this.groupPreserveAvatarSpace.set(preserveAvatarSpace);
|
|
1849
|
+
}
|
|
1850
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: StrataChatMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1851
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: StrataChatMessageComponent, isStandalone: true, selector: "st-chat-message", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, timestamp: { classPropertyName: "timestamp", publicName: "timestamp", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, showAvatar: { classPropertyName: "showAvatar", publicName: "showAvatar", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0, template: "<div class=\"st-chat-message-container\">\n @if (effectiveVariant() === 'incoming') {\n <div\n class=\"st-chat-message-avatar\"\n [class.hidden]=\"!effectiveShowAvatar()\"\n [class.preserve-space]=\"groupPreserveAvatarSpace()\"\n >\n <ng-content select=\"[slot=avatar]\" />\n </div>\n }\n\n <div class=\"st-chat-message-body\">\n <div class=\"st-chat-message-bubble\">\n <div class=\"st-chat-message-media\">\n <ng-content select=\"[slot=media]\" />\n </div>\n <div class=\"st-chat-message-text\">\n <ng-content />\n </div>\n </div>\n\n <div class=\"st-chat-message-footer\">\n @if (timestamp()) {\n <span class=\"st-chat-message-timestamp\">{{ timestamp() }}</span>\n }\n @if (effectiveVariant() === 'outgoing' && status()) {\n <span class=\"st-chat-message-status\" [class]=\"'status-' + status()\">\n @if (status() === 'sent') {\n <st-icon name=\"check-single\" size=\"xs\"></st-icon>\n } @else if (status() === 'delivered' || status() === 'read') {\n <st-icon name=\"check-double\" size=\"xs\"></st-icon>\n }\n </span>\n }\n <ng-content select=\"[slot=footer]\" />\n </div>\n </div>\n\n @if (effectiveVariant() === 'outgoing') {\n <div\n class=\"st-chat-message-avatar\"\n [class.hidden]=\"!effectiveShowAvatar()\"\n [class.preserve-space]=\"groupPreserveAvatarSpace()\"\n >\n <ng-content select=\"[slot=avatar]\" />\n </div>\n }\n</div>\n", styles: [":host{--st-chat-message-bg-incoming: var(--st-color-bg-raised);--st-chat-message-color-incoming: var(--st-color-text-primary);--st-chat-message-border-incoming: var(--st-color-border-subtle);--st-chat-message-bg-outgoing: var(--st-color-control-primary-bg);--st-chat-message-color-outgoing: var(--st-color-control-primary-text);--st-chat-message-border-outgoing: transparent;--st-chat-message-radius: var(--st-border-radius-xl);--st-chat-message-radius-sm: var(--st-border-radius-sm);--st-chat-message-max-width: 75%;--st-chat-message-padding: var(--st-space-2) var(--st-space-3);--st-chat-avatar-size: 32px;--st-chat-avatar-gap: var(--st-space-2);--st-chat-status-read-color: var(--st-color-accent-default);display:block;width:100%;max-width:100%;min-width:0;box-sizing:border-box}:host .st-chat-message-container{display:flex;align-items:flex-end;gap:var(--st-chat-avatar-gap);width:100%;max-width:100%;min-width:0;box-sizing:border-box}:host .st-chat-message-avatar{flex-shrink:0;display:flex;align-items:flex-end;width:var(--st-chat-avatar-size);min-width:var(--st-chat-avatar-size)}:host .st-chat-message-avatar:empty:not(.preserve-space){display:none}:host .st-chat-message-avatar.hidden{visibility:hidden}:host .st-chat-message-body{display:flex;flex-direction:column;max-width:var(--st-chat-message-max-width);min-width:0}:host .st-chat-message-bubble{padding:var(--st-chat-message-padding);font-size:var(--st-font-sm);line-height:1.45;word-break:break-word;overflow-wrap:anywhere;max-width:100%;min-width:0;box-sizing:border-box;overflow:hidden;transition:background-color var(--st-transition-normal),border-color var(--st-transition-normal)}:host .st-chat-message-media{overflow:hidden;border-radius:calc(var(--st-chat-message-radius) - 2px);margin-bottom:var(--st-space-1);width:100%;max-width:100%}:host .st-chat-message-media:empty{display:none;margin-bottom:0}:host .st-chat-message-media img,:host .st-chat-message-media video{display:block;width:100%;max-width:100%;height:auto;max-height:280px;object-fit:cover;border-radius:inherit}:host .st-chat-message-text:empty{display:none}:host .st-chat-message-footer{display:flex;align-items:center;gap:var(--st-space-1);font-size:var(--st-font-xs);color:var(--st-color-text-tertiary);margin-top:2px;-webkit-user-select:none;user-select:none}:host .st-chat-message-footer:empty{display:none}:host .st-chat-message-footer .st-chat-message-timestamp{font-variant-numeric:tabular-nums}:host .st-chat-message-footer .st-chat-message-status{display:inline-flex;align-items:center;line-height:1}:host .st-chat-message-footer .st-chat-message-status.status-read{color:var(--st-chat-status-read-color)}:host.incoming .st-chat-message-container{justify-content:flex-start}:host.incoming .st-chat-message-body{align-items:flex-start}:host.incoming .st-chat-message-bubble{background-color:var(--st-chat-message-bg-incoming);color:var(--st-chat-message-color-incoming);border:1px solid var(--st-chat-message-border-incoming)}:host.incoming .st-chat-message-footer{justify-content:flex-start}:host.incoming.single .st-chat-message-bubble{border-radius:var(--st-chat-message-radius) var(--st-chat-message-radius) var(--st-chat-message-radius) var(--st-chat-message-radius-sm)}:host.incoming.first .st-chat-message-bubble{border-radius:var(--st-chat-message-radius) var(--st-chat-message-radius) var(--st-chat-message-radius) var(--st-chat-message-radius-sm)}:host.incoming.middle .st-chat-message-bubble{border-radius:var(--st-chat-message-radius-sm) var(--st-chat-message-radius) var(--st-chat-message-radius) var(--st-chat-message-radius-sm)}:host.incoming.last .st-chat-message-bubble{border-radius:var(--st-chat-message-radius-sm) var(--st-chat-message-radius) var(--st-chat-message-radius) var(--st-border-radius-xs)}:host.outgoing .st-chat-message-container{justify-content:flex-end}:host.outgoing .st-chat-message-body{align-items:flex-end}:host.outgoing .st-chat-message-bubble{background-color:var(--st-chat-message-bg-outgoing);color:var(--st-chat-message-color-outgoing);border:1px solid var(--st-chat-message-border-outgoing)}:host.outgoing .st-chat-message-footer{justify-content:flex-end}:host.outgoing.single .st-chat-message-bubble{border-radius:var(--st-chat-message-radius) var(--st-chat-message-radius) var(--st-chat-message-radius-sm) var(--st-chat-message-radius)}:host.outgoing.first .st-chat-message-bubble{border-radius:var(--st-chat-message-radius) var(--st-chat-message-radius) var(--st-chat-message-radius-sm) var(--st-chat-message-radius)}:host.outgoing.middle .st-chat-message-bubble{border-radius:var(--st-chat-message-radius) var(--st-chat-message-radius-sm) var(--st-chat-message-radius-sm) var(--st-chat-message-radius)}:host.outgoing.last .st-chat-message-bubble{border-radius:var(--st-chat-message-radius) var(--st-chat-message-radius-sm) var(--st-border-radius-xs) var(--st-chat-message-radius)}\n"], dependencies: [{ kind: "component", type: StrataIconComponent, selector: "st-icon", inputs: ["name", "size", "ariaLabel"], outputs: ["sizeChange"] }] });
|
|
1852
|
+
}
|
|
1853
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: StrataChatMessageComponent, decorators: [{
|
|
1854
|
+
type: Component,
|
|
1855
|
+
args: [{ selector: 'st-chat-message', imports: [StrataIconComponent], host: {
|
|
1856
|
+
'[class]': 'hostClasses()'
|
|
1857
|
+
}, template: "<div class=\"st-chat-message-container\">\n @if (effectiveVariant() === 'incoming') {\n <div\n class=\"st-chat-message-avatar\"\n [class.hidden]=\"!effectiveShowAvatar()\"\n [class.preserve-space]=\"groupPreserveAvatarSpace()\"\n >\n <ng-content select=\"[slot=avatar]\" />\n </div>\n }\n\n <div class=\"st-chat-message-body\">\n <div class=\"st-chat-message-bubble\">\n <div class=\"st-chat-message-media\">\n <ng-content select=\"[slot=media]\" />\n </div>\n <div class=\"st-chat-message-text\">\n <ng-content />\n </div>\n </div>\n\n <div class=\"st-chat-message-footer\">\n @if (timestamp()) {\n <span class=\"st-chat-message-timestamp\">{{ timestamp() }}</span>\n }\n @if (effectiveVariant() === 'outgoing' && status()) {\n <span class=\"st-chat-message-status\" [class]=\"'status-' + status()\">\n @if (status() === 'sent') {\n <st-icon name=\"check-single\" size=\"xs\"></st-icon>\n } @else if (status() === 'delivered' || status() === 'read') {\n <st-icon name=\"check-double\" size=\"xs\"></st-icon>\n }\n </span>\n }\n <ng-content select=\"[slot=footer]\" />\n </div>\n </div>\n\n @if (effectiveVariant() === 'outgoing') {\n <div\n class=\"st-chat-message-avatar\"\n [class.hidden]=\"!effectiveShowAvatar()\"\n [class.preserve-space]=\"groupPreserveAvatarSpace()\"\n >\n <ng-content select=\"[slot=avatar]\" />\n </div>\n }\n</div>\n", styles: [":host{--st-chat-message-bg-incoming: var(--st-color-bg-raised);--st-chat-message-color-incoming: var(--st-color-text-primary);--st-chat-message-border-incoming: var(--st-color-border-subtle);--st-chat-message-bg-outgoing: var(--st-color-control-primary-bg);--st-chat-message-color-outgoing: var(--st-color-control-primary-text);--st-chat-message-border-outgoing: transparent;--st-chat-message-radius: var(--st-border-radius-xl);--st-chat-message-radius-sm: var(--st-border-radius-sm);--st-chat-message-max-width: 75%;--st-chat-message-padding: var(--st-space-2) var(--st-space-3);--st-chat-avatar-size: 32px;--st-chat-avatar-gap: var(--st-space-2);--st-chat-status-read-color: var(--st-color-accent-default);display:block;width:100%;max-width:100%;min-width:0;box-sizing:border-box}:host .st-chat-message-container{display:flex;align-items:flex-end;gap:var(--st-chat-avatar-gap);width:100%;max-width:100%;min-width:0;box-sizing:border-box}:host .st-chat-message-avatar{flex-shrink:0;display:flex;align-items:flex-end;width:var(--st-chat-avatar-size);min-width:var(--st-chat-avatar-size)}:host .st-chat-message-avatar:empty:not(.preserve-space){display:none}:host .st-chat-message-avatar.hidden{visibility:hidden}:host .st-chat-message-body{display:flex;flex-direction:column;max-width:var(--st-chat-message-max-width);min-width:0}:host .st-chat-message-bubble{padding:var(--st-chat-message-padding);font-size:var(--st-font-sm);line-height:1.45;word-break:break-word;overflow-wrap:anywhere;max-width:100%;min-width:0;box-sizing:border-box;overflow:hidden;transition:background-color var(--st-transition-normal),border-color var(--st-transition-normal)}:host .st-chat-message-media{overflow:hidden;border-radius:calc(var(--st-chat-message-radius) - 2px);margin-bottom:var(--st-space-1);width:100%;max-width:100%}:host .st-chat-message-media:empty{display:none;margin-bottom:0}:host .st-chat-message-media img,:host .st-chat-message-media video{display:block;width:100%;max-width:100%;height:auto;max-height:280px;object-fit:cover;border-radius:inherit}:host .st-chat-message-text:empty{display:none}:host .st-chat-message-footer{display:flex;align-items:center;gap:var(--st-space-1);font-size:var(--st-font-xs);color:var(--st-color-text-tertiary);margin-top:2px;-webkit-user-select:none;user-select:none}:host .st-chat-message-footer:empty{display:none}:host .st-chat-message-footer .st-chat-message-timestamp{font-variant-numeric:tabular-nums}:host .st-chat-message-footer .st-chat-message-status{display:inline-flex;align-items:center;line-height:1}:host .st-chat-message-footer .st-chat-message-status.status-read{color:var(--st-chat-status-read-color)}:host.incoming .st-chat-message-container{justify-content:flex-start}:host.incoming .st-chat-message-body{align-items:flex-start}:host.incoming .st-chat-message-bubble{background-color:var(--st-chat-message-bg-incoming);color:var(--st-chat-message-color-incoming);border:1px solid var(--st-chat-message-border-incoming)}:host.incoming .st-chat-message-footer{justify-content:flex-start}:host.incoming.single .st-chat-message-bubble{border-radius:var(--st-chat-message-radius) var(--st-chat-message-radius) var(--st-chat-message-radius) var(--st-chat-message-radius-sm)}:host.incoming.first .st-chat-message-bubble{border-radius:var(--st-chat-message-radius) var(--st-chat-message-radius) var(--st-chat-message-radius) var(--st-chat-message-radius-sm)}:host.incoming.middle .st-chat-message-bubble{border-radius:var(--st-chat-message-radius-sm) var(--st-chat-message-radius) var(--st-chat-message-radius) var(--st-chat-message-radius-sm)}:host.incoming.last .st-chat-message-bubble{border-radius:var(--st-chat-message-radius-sm) var(--st-chat-message-radius) var(--st-chat-message-radius) var(--st-border-radius-xs)}:host.outgoing .st-chat-message-container{justify-content:flex-end}:host.outgoing .st-chat-message-body{align-items:flex-end}:host.outgoing .st-chat-message-bubble{background-color:var(--st-chat-message-bg-outgoing);color:var(--st-chat-message-color-outgoing);border:1px solid var(--st-chat-message-border-outgoing)}:host.outgoing .st-chat-message-footer{justify-content:flex-end}:host.outgoing.single .st-chat-message-bubble{border-radius:var(--st-chat-message-radius) var(--st-chat-message-radius) var(--st-chat-message-radius-sm) var(--st-chat-message-radius)}:host.outgoing.first .st-chat-message-bubble{border-radius:var(--st-chat-message-radius) var(--st-chat-message-radius) var(--st-chat-message-radius-sm) var(--st-chat-message-radius)}:host.outgoing.middle .st-chat-message-bubble{border-radius:var(--st-chat-message-radius) var(--st-chat-message-radius-sm) var(--st-chat-message-radius-sm) var(--st-chat-message-radius)}:host.outgoing.last .st-chat-message-bubble{border-radius:var(--st-chat-message-radius) var(--st-chat-message-radius-sm) var(--st-border-radius-xs) var(--st-chat-message-radius)}\n"] }]
|
|
1858
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], timestamp: [{ type: i0.Input, args: [{ isSignal: true, alias: "timestamp", required: false }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], showAvatar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAvatar", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }] } });
|
|
1859
|
+
|
|
1860
|
+
class StrataChatGroupComponent {
|
|
1861
|
+
variant = input('incoming', /* @ts-ignore */
|
|
1862
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
1863
|
+
messages = contentChildren(StrataChatMessageComponent, { ...(ngDevMode ? { debugName: "messages" } : /* istanbul ignore next */ {}), descendants: true });
|
|
1864
|
+
hostClasses = computed(() => `st-chat-group ${this.variant()}`, /* @ts-ignore */
|
|
1865
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1866
|
+
constructor() {
|
|
1867
|
+
effect(() => {
|
|
1868
|
+
const items = this.messages();
|
|
1869
|
+
const variant = this.variant();
|
|
1870
|
+
const count = items.length;
|
|
1871
|
+
items.forEach((msg, index) => {
|
|
1872
|
+
if (count === 1) {
|
|
1873
|
+
msg.setGroupConfig(variant, 'single', true, false);
|
|
1874
|
+
return;
|
|
1875
|
+
}
|
|
1876
|
+
const isFirst = index === 0;
|
|
1877
|
+
const isLast = index === count - 1;
|
|
1878
|
+
const position = isFirst ? 'first' : isLast ? 'last' : 'middle';
|
|
1879
|
+
const showAvatar = isLast;
|
|
1880
|
+
const preserveAvatarSpace = variant === 'incoming' && !isLast;
|
|
1881
|
+
msg.setGroupConfig(variant, position, showAvatar, preserveAvatarSpace);
|
|
1882
|
+
});
|
|
1883
|
+
});
|
|
1884
|
+
}
|
|
1885
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: StrataChatGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1886
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.1", type: StrataChatGroupComponent, isStandalone: true, selector: "st-chat-group", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, queries: [{ propertyName: "messages", predicate: StrataChatMessageComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-content />\n", styles: [":host{--st-chat-group-gap: var(--st-space-1);display:flex;flex-direction:column;width:100%;max-width:100%;min-width:0;box-sizing:border-box;gap:var(--st-chat-group-gap)}:host>*{min-width:0;max-width:100%;box-sizing:border-box}\n"] });
|
|
1887
|
+
}
|
|
1888
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: StrataChatGroupComponent, decorators: [{
|
|
1889
|
+
type: Component,
|
|
1890
|
+
args: [{ selector: 'st-chat-group', imports: [], host: {
|
|
1891
|
+
'[class]': 'hostClasses()'
|
|
1892
|
+
}, template: "<ng-content />\n", styles: [":host{--st-chat-group-gap: var(--st-space-1);display:flex;flex-direction:column;width:100%;max-width:100%;min-width:0;box-sizing:border-box;gap:var(--st-chat-group-gap)}:host>*{min-width:0;max-width:100%;box-sizing:border-box}\n"] }]
|
|
1893
|
+
}], ctorParameters: () => [], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], messages: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => StrataChatMessageComponent), { ...{ descendants: true }, isSignal: true }] }] } });
|
|
1894
|
+
|
|
1895
|
+
class StrataChatSeparatorComponent {
|
|
1896
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: StrataChatSeparatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1897
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.1", type: StrataChatSeparatorComponent, isStandalone: true, selector: "st-chat-separator", host: { classAttribute: "st-chat-separator" }, ngImport: i0, template: "<div class=\"st-chat-separator-line\"></div>\n<div class=\"st-chat-separator-content\">\n <ng-content />\n</div>\n<div class=\"st-chat-separator-line\"></div>\n", styles: [":host{--st-chat-separator-color: var(--st-color-text-tertiary);--st-chat-separator-line-color: var(--st-color-border-subtle);--st-chat-separator-font-size: var(--st-font-xs);display:flex;align-items:center;justify-content:center;gap:var(--st-space-3);width:100%;box-sizing:border-box}:host .st-chat-separator-line{flex:1;height:1px;background-color:var(--st-chat-separator-line-color)}:host .st-chat-separator-content{display:inline-flex;align-items:center;font-size:var(--st-chat-separator-font-size);color:var(--st-chat-separator-color);white-space:nowrap;font-weight:var(--st-font-weight-medium)}\n"] });
|
|
1898
|
+
}
|
|
1899
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: StrataChatSeparatorComponent, decorators: [{
|
|
1900
|
+
type: Component,
|
|
1901
|
+
args: [{ selector: 'st-chat-separator', imports: [], host: {
|
|
1902
|
+
class: 'st-chat-separator'
|
|
1903
|
+
}, template: "<div class=\"st-chat-separator-line\"></div>\n<div class=\"st-chat-separator-content\">\n <ng-content />\n</div>\n<div class=\"st-chat-separator-line\"></div>\n", styles: [":host{--st-chat-separator-color: var(--st-color-text-tertiary);--st-chat-separator-line-color: var(--st-color-border-subtle);--st-chat-separator-font-size: var(--st-font-xs);display:flex;align-items:center;justify-content:center;gap:var(--st-space-3);width:100%;box-sizing:border-box}:host .st-chat-separator-line{flex:1;height:1px;background-color:var(--st-chat-separator-line-color)}:host .st-chat-separator-content{display:inline-flex;align-items:center;font-size:var(--st-chat-separator-font-size);color:var(--st-chat-separator-color);white-space:nowrap;font-weight:var(--st-font-weight-medium)}\n"] }]
|
|
1904
|
+
}] });
|
|
1905
|
+
|
|
1906
|
+
class StrataChatTypingComponent {
|
|
1907
|
+
variant = input('incoming', /* @ts-ignore */
|
|
1908
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
1909
|
+
ariaLabel = input('Typing', /* @ts-ignore */
|
|
1910
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1911
|
+
hostClasses = computed(() => `st-chat-typing ${this.variant()}`, /* @ts-ignore */
|
|
1912
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1913
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: StrataChatTypingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1914
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: StrataChatTypingComponent, isStandalone: true, selector: "st-chat-typing", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0, template: "<div class=\"st-chat-typing-container\" role=\"status\" [attr.aria-label]=\"ariaLabel()\">\n @if (variant() === 'incoming') {\n <div class=\"st-chat-typing-avatar\">\n <ng-content select=\"[slot=avatar]\" />\n </div>\n }\n\n <div class=\"st-chat-typing-bubble\">\n <span class=\"st-chat-typing-dot\"></span>\n <span class=\"st-chat-typing-dot\"></span>\n <span class=\"st-chat-typing-dot\"></span>\n </div>\n\n @if (variant() === 'outgoing') {\n <div class=\"st-chat-typing-avatar\">\n <ng-content select=\"[slot=avatar]\" />\n </div>\n }\n</div>\n", styles: [":host{--st-chat-typing-dot-size: 6px;--st-chat-typing-dot-color: var(--st-color-text-tertiary);--st-chat-typing-bubble-bg-incoming: var(--st-color-bg-raised);--st-chat-typing-bubble-bg-outgoing: var(--st-color-control-primary-bg);display:block;width:100%;box-sizing:border-box}:host .st-chat-typing-container{display:flex;align-items:flex-end;gap:var(--st-chat-avatar-gap, var(--st-space-2));width:100%;box-sizing:border-box}:host .st-chat-typing-avatar{flex-shrink:0;display:flex;align-items:flex-end;width:var(--st-chat-avatar-size, 32px);min-width:var(--st-chat-avatar-size, 32px)}:host .st-chat-typing-avatar:empty{display:none}:host .st-chat-typing-bubble{display:inline-flex;align-items:center;gap:var(--st-space-1);padding:var(--st-space-2) var(--st-space-3);min-height:32px;box-sizing:border-box;border-radius:var(--st-border-radius-xl)}:host .st-chat-typing-dot{width:var(--st-chat-typing-dot-size);height:var(--st-chat-typing-dot-size);border-radius:var(--st-border-radius-full);background-color:var(--st-chat-typing-dot-color);animation:st-chat-typing-bounce 1.4s infinite ease-in-out both}:host .st-chat-typing-dot:nth-child(1){animation-delay:-.32s}:host .st-chat-typing-dot:nth-child(2){animation-delay:-.16s}:host .st-chat-typing-dot:nth-child(3){animation-delay:0s}:host.incoming .st-chat-typing-container{justify-content:flex-start}:host.incoming .st-chat-typing-bubble{background-color:var(--st-chat-typing-bubble-bg-incoming);border:1px solid var(--st-color-border-subtle);border-radius:var(--st-border-radius-xl) var(--st-border-radius-xl) var(--st-border-radius-xl) var(--st-border-radius-sm)}:host.outgoing .st-chat-typing-container{justify-content:flex-end}:host.outgoing .st-chat-typing-bubble{background-color:var(--st-chat-typing-bubble-bg-outgoing);border:1px solid transparent;border-radius:var(--st-border-radius-xl) var(--st-border-radius-xl) var(--st-border-radius-sm) var(--st-border-radius-xl)}@keyframes st-chat-typing-bounce{0%,80%,to{transform:translateY(0);opacity:.35}40%{transform:translateY(-4px);opacity:1}}\n"] });
|
|
1915
|
+
}
|
|
1916
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: StrataChatTypingComponent, decorators: [{
|
|
1917
|
+
type: Component,
|
|
1918
|
+
args: [{ selector: 'st-chat-typing', imports: [], host: {
|
|
1919
|
+
'[class]': 'hostClasses()'
|
|
1920
|
+
}, template: "<div class=\"st-chat-typing-container\" role=\"status\" [attr.aria-label]=\"ariaLabel()\">\n @if (variant() === 'incoming') {\n <div class=\"st-chat-typing-avatar\">\n <ng-content select=\"[slot=avatar]\" />\n </div>\n }\n\n <div class=\"st-chat-typing-bubble\">\n <span class=\"st-chat-typing-dot\"></span>\n <span class=\"st-chat-typing-dot\"></span>\n <span class=\"st-chat-typing-dot\"></span>\n </div>\n\n @if (variant() === 'outgoing') {\n <div class=\"st-chat-typing-avatar\">\n <ng-content select=\"[slot=avatar]\" />\n </div>\n }\n</div>\n", styles: [":host{--st-chat-typing-dot-size: 6px;--st-chat-typing-dot-color: var(--st-color-text-tertiary);--st-chat-typing-bubble-bg-incoming: var(--st-color-bg-raised);--st-chat-typing-bubble-bg-outgoing: var(--st-color-control-primary-bg);display:block;width:100%;box-sizing:border-box}:host .st-chat-typing-container{display:flex;align-items:flex-end;gap:var(--st-chat-avatar-gap, var(--st-space-2));width:100%;box-sizing:border-box}:host .st-chat-typing-avatar{flex-shrink:0;display:flex;align-items:flex-end;width:var(--st-chat-avatar-size, 32px);min-width:var(--st-chat-avatar-size, 32px)}:host .st-chat-typing-avatar:empty{display:none}:host .st-chat-typing-bubble{display:inline-flex;align-items:center;gap:var(--st-space-1);padding:var(--st-space-2) var(--st-space-3);min-height:32px;box-sizing:border-box;border-radius:var(--st-border-radius-xl)}:host .st-chat-typing-dot{width:var(--st-chat-typing-dot-size);height:var(--st-chat-typing-dot-size);border-radius:var(--st-border-radius-full);background-color:var(--st-chat-typing-dot-color);animation:st-chat-typing-bounce 1.4s infinite ease-in-out both}:host .st-chat-typing-dot:nth-child(1){animation-delay:-.32s}:host .st-chat-typing-dot:nth-child(2){animation-delay:-.16s}:host .st-chat-typing-dot:nth-child(3){animation-delay:0s}:host.incoming .st-chat-typing-container{justify-content:flex-start}:host.incoming .st-chat-typing-bubble{background-color:var(--st-chat-typing-bubble-bg-incoming);border:1px solid var(--st-color-border-subtle);border-radius:var(--st-border-radius-xl) var(--st-border-radius-xl) var(--st-border-radius-xl) var(--st-border-radius-sm)}:host.outgoing .st-chat-typing-container{justify-content:flex-end}:host.outgoing .st-chat-typing-bubble{background-color:var(--st-chat-typing-bubble-bg-outgoing);border:1px solid transparent;border-radius:var(--st-border-radius-xl) var(--st-border-radius-xl) var(--st-border-radius-sm) var(--st-border-radius-xl)}@keyframes st-chat-typing-bounce{0%,80%,to{transform:translateY(0);opacity:.35}40%{transform:translateY(-4px);opacity:1}}\n"] }]
|
|
1921
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
1922
|
+
|
|
1788
1923
|
class StrataTimeStepperComponent {
|
|
1789
1924
|
format = input('24h', /* @ts-ignore */
|
|
1790
1925
|
...(ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []));
|
|
@@ -4737,7 +4872,7 @@ class StrataModalComponent {
|
|
|
4737
4872
|
}
|
|
4738
4873
|
ngOnDestroy() {
|
|
4739
4874
|
if (this.previousActiveElement && typeof this.previousActiveElement.focus === 'function') {
|
|
4740
|
-
this.previousActiveElement.focus();
|
|
4875
|
+
this.previousActiveElement.focus({ preventScroll: true });
|
|
4741
4876
|
}
|
|
4742
4877
|
}
|
|
4743
4878
|
ngAfterViewInit() {
|
|
@@ -4764,10 +4899,10 @@ class StrataModalComponent {
|
|
|
4764
4899
|
focusInitialElement() {
|
|
4765
4900
|
const autofocus = this.elementRef.nativeElement.querySelector('[autofocus]');
|
|
4766
4901
|
if (autofocus && typeof autofocus.focus === 'function') {
|
|
4767
|
-
autofocus.focus();
|
|
4902
|
+
autofocus.focus({ preventScroll: true });
|
|
4768
4903
|
return;
|
|
4769
4904
|
}
|
|
4770
|
-
this.elementRef.nativeElement.focus();
|
|
4905
|
+
this.elementRef.nativeElement.focus({ preventScroll: true });
|
|
4771
4906
|
}
|
|
4772
4907
|
onCardClick(event) {
|
|
4773
4908
|
event.stopPropagation();
|
|
@@ -4788,7 +4923,7 @@ class StrataModalComponent {
|
|
|
4788
4923
|
document.activeElement === this.elementRef.nativeElement ||
|
|
4789
4924
|
!this.elementRef.nativeElement.contains(document.activeElement)) {
|
|
4790
4925
|
event.preventDefault();
|
|
4791
|
-
last.focus();
|
|
4926
|
+
last.focus({ preventScroll: true });
|
|
4792
4927
|
}
|
|
4793
4928
|
}
|
|
4794
4929
|
else {
|
|
@@ -4796,7 +4931,7 @@ class StrataModalComponent {
|
|
|
4796
4931
|
document.activeElement === this.elementRef.nativeElement ||
|
|
4797
4932
|
!this.elementRef.nativeElement.contains(document.activeElement)) {
|
|
4798
4933
|
event.preventDefault();
|
|
4799
|
-
first.focus();
|
|
4934
|
+
first.focus({ preventScroll: true });
|
|
4800
4935
|
}
|
|
4801
4936
|
}
|
|
4802
4937
|
}
|
|
@@ -7078,5 +7213,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
7078
7213
|
* Generated bundle index. Do not edit.
|
|
7079
7214
|
*/
|
|
7080
7215
|
|
|
7081
|
-
export { BreakpointService, CapitalizePipe, DEFAULT_DATE_RANGE_PRESETS, DEFAULT_DURATION, DEFAULT_THEME, DarkmodeService, DeviceService, HotkeyService, HttpIconLoader, IconLoader, IconRegistry, IconRegistryService, ModalService, NotificationService, STRATA_CONFIG, StrataAccordionGroupComponent, StrataAccordionItemComponent, StrataActionMenuComponent, StrataActionMenuItemComponent, StrataActivatableDirective, StrataAlertComponent, StrataAlertContentComponent, StrataAutoResizeDirective, StrataAvatarComponent, StrataAvatarStackComponent, StrataBadgeComponent, StrataBreadcrumbComponent, StrataBreadcrumbItemComponent, StrataButtonDirective, StrataButtonGroupComponent, StrataCalendarComponent, StrataCardComponent, StrataCheckboxComponent, StrataContextMenuDirective, StrataDatePickerComponent, StrataDateRangePickerComponent, StrataDividerComponent, StrataFileUploadComponent, StrataIconComponent, StrataImageCropperComponent, StrataInputFieldComponent, StrataItemComponent, StrataItemListComponent, StrataKbdComponent, StrataMessageStateComponent, StrataModalBodyComponent, StrataModalComponent, StrataModalContainerComponent, StrataModalFooterComponent, StrataModalHeaderComponent, StrataModalRef, StrataNativeInputRefDirective, StrataNotificationComponent, StrataNotificationContainerComponent, StrataNumberDisplayComponent, StrataNumberStepperComponent, StrataOtpComponent, StrataOverlayDirective, StrataPaginationComponent, StrataProgressLinearComponent, StrataProgressRadialComponent, StrataRadioComponent, StrataRadioGroupComponent, StrataSegmentedControlComponent, StrataSegmentedControlItemComponent, StrataSelectItemComponent, StrataSelectTriggerDirective, StrataShellComponent, StrataSidemenuComponent, StrataSidemenuItemDirective, StrataSidemenuItemGroupComponent, StrataSidemenuSectionComponent, StrataSingleSelectComponent, StrataSkeletonComponent, StrataSliderComponent, StrataSpinnerComponent, StrataStepComponent, StrataStepperComponent, StrataTabItemComponent, StrataTabsComponent, StrataTagComponent, StrataTextStackComponent, StrataThemeDirective, StrataTimeStepperComponent, StrataTimepickerComponent, StrataToggleComponent, StrataTooltipDirective, addDays, addMonths, addYears, createCalendarGrid, disableDateRange, disableDaysOfWeek, disableFutureDates, disablePastDates, disableWeekends, endOfDay, endOfMonth, formatDate, formatMonthTitle, getDayOfWeek, getDaysInMonth, getDefaultShortcutLabels, getLocaleDefaultDateFormat, getMonthNames, getWeekdayNames, isAfterDay, isApplePlatform, isBeforeDay, isSameDay, isSameMonth, isSameYear, isWeekend, isWithinDayRange, parseDate, provideBaseIcons, provideIcons, provideStrata, resolveIsApple, startOfDay, startOfMonth };
|
|
7216
|
+
export { BreakpointService, CapitalizePipe, DEFAULT_DATE_RANGE_PRESETS, DEFAULT_DURATION, DEFAULT_THEME, DarkmodeService, DeviceService, HotkeyService, HttpIconLoader, IconLoader, IconRegistry, IconRegistryService, ModalService, NotificationService, STRATA_CONFIG, StrataAccordionGroupComponent, StrataAccordionItemComponent, StrataActionMenuComponent, StrataActionMenuItemComponent, StrataActivatableDirective, StrataAlertComponent, StrataAlertContentComponent, StrataAutoResizeDirective, StrataAvatarComponent, StrataAvatarStackComponent, StrataBadgeComponent, StrataBreadcrumbComponent, StrataBreadcrumbItemComponent, StrataButtonDirective, StrataButtonGroupComponent, StrataCalendarComponent, StrataCardComponent, StrataChatComponent, StrataChatGroupComponent, StrataChatMessageComponent, StrataChatSeparatorComponent, StrataChatTypingComponent, StrataCheckboxComponent, StrataContextMenuDirective, StrataDatePickerComponent, StrataDateRangePickerComponent, StrataDividerComponent, StrataFileUploadComponent, StrataIconComponent, StrataImageCropperComponent, StrataInputFieldComponent, StrataItemComponent, StrataItemListComponent, StrataKbdComponent, StrataMessageStateComponent, StrataModalBodyComponent, StrataModalComponent, StrataModalContainerComponent, StrataModalFooterComponent, StrataModalHeaderComponent, StrataModalRef, StrataNativeInputRefDirective, StrataNotificationComponent, StrataNotificationContainerComponent, StrataNumberDisplayComponent, StrataNumberStepperComponent, StrataOtpComponent, StrataOverlayDirective, StrataPaginationComponent, StrataProgressLinearComponent, StrataProgressRadialComponent, StrataRadioComponent, StrataRadioGroupComponent, StrataSegmentedControlComponent, StrataSegmentedControlItemComponent, StrataSelectItemComponent, StrataSelectTriggerDirective, StrataShellComponent, StrataSidemenuComponent, StrataSidemenuItemDirective, StrataSidemenuItemGroupComponent, StrataSidemenuSectionComponent, StrataSingleSelectComponent, StrataSkeletonComponent, StrataSliderComponent, StrataSpinnerComponent, StrataStepComponent, StrataStepperComponent, StrataTabItemComponent, StrataTabsComponent, StrataTagComponent, StrataTextStackComponent, StrataThemeDirective, StrataTimeStepperComponent, StrataTimepickerComponent, StrataToggleComponent, StrataTooltipDirective, addDays, addMonths, addYears, createCalendarGrid, disableDateRange, disableDaysOfWeek, disableFutureDates, disablePastDates, disableWeekends, endOfDay, endOfMonth, formatDate, formatMonthTitle, getDayOfWeek, getDaysInMonth, getDefaultShortcutLabels, getLocaleDefaultDateFormat, getMonthNames, getWeekdayNames, isAfterDay, isApplePlatform, isBeforeDay, isSameDay, isSameMonth, isSameYear, isWeekend, isWithinDayRange, parseDate, provideBaseIcons, provideIcons, provideStrata, resolveIsApple, startOfDay, startOfMonth };
|
|
7082
7217
|
//# sourceMappingURL=ngx-strata.mjs.map
|