@xsmusices/ui 2.0.20 → 2.0.22
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.
|
@@ -4332,9 +4332,16 @@ class XSImageComponent {
|
|
|
4332
4332
|
return this.getImageApiUrl(config.item, config.typeItem, config.imageType || 'normal');
|
|
4333
4333
|
}
|
|
4334
4334
|
const name = this.getItemName(config.item, config.typeItem);
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4335
|
+
const fallbackName = name ||
|
|
4336
|
+
(typeof config.item === 'object' && config.item !== null
|
|
4337
|
+
? config.item.name ||
|
|
4338
|
+
config.item.title
|
|
4339
|
+
: null) ||
|
|
4340
|
+
(config.typeItem === 'user'
|
|
4341
|
+
? 'Usuario'
|
|
4342
|
+
: config.typeItem) ||
|
|
4343
|
+
'Usuario';
|
|
4344
|
+
return this.avatarService.generateAvatar(fallbackName);
|
|
4338
4345
|
}
|
|
4339
4346
|
return config.fallbackSrc || this.defaultImagePath;
|
|
4340
4347
|
}
|
|
@@ -4469,9 +4476,10 @@ class XSImageComponent {
|
|
|
4469
4476
|
if (!name && t) {
|
|
4470
4477
|
name = t;
|
|
4471
4478
|
}
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4479
|
+
if (!name) {
|
|
4480
|
+
name = 'Usuario';
|
|
4481
|
+
}
|
|
4482
|
+
this.processedSrc.set(this.avatarService.generateAvatar(name));
|
|
4475
4483
|
}
|
|
4476
4484
|
this.onError.emit({
|
|
4477
4485
|
event,
|
|
@@ -14351,7 +14359,7 @@ class XSChatListComponent {
|
|
|
14351
14359
|
if (uid &&
|
|
14352
14360
|
(chat.sender._id === uid || chat.receiver._id === uid))
|
|
14353
14361
|
return 'user';
|
|
14354
|
-
return chat.type;
|
|
14362
|
+
return chat.type || 'user';
|
|
14355
14363
|
}
|
|
14356
14364
|
userId = input('', ...(ngDevMode ? [{ debugName: "userId" }] : []));
|
|
14357
14365
|
searchPlaceholder = input('', ...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : []));
|
|
@@ -14854,11 +14862,11 @@ class XSChatTextareaComponent {
|
|
|
14854
14862
|
return BLOCKED_WORDS.some((word) => text.toLowerCase().includes(word));
|
|
14855
14863
|
}
|
|
14856
14864
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: XSChatTextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14857
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.33", type: XSChatTextareaComponent, isStandalone: true, selector: "xs-chat-textarea", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, attachEnabled: { classPropertyName: "attachEnabled", publicName: "attachEnabled", isSignal: true, isRequired: false, transformFunction: null }, uploading: { classPropertyName: "uploading", publicName: "uploading", isSignal: true, isRequired: false, transformFunction: null }, uploadProgress: { classPropertyName: "uploadProgress", publicName: "uploadProgress", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sendMessage: "sendMessage", sendWithAttachments: "sendWithAttachments", sendError: "sendError", typing: "typing" }, host: { attributes: { "xs-chat-textarea-host": "" } }, viewQueries: [{ propertyName: "textareaEl", first: true, predicate: ["textareaEl"], descendants: true, isSignal: true }, { propertyName: "fileInputEl", first: true, predicate: ["fileInputEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex flex-col\">\n @if (showEmojiPicker()) {\n <div\n class=\"flex flex-wrap gap-1 p-2 border-t border-zinc-800 max-h-32 overflow-y-auto\"\n >\n @for (emoji of emojis; track emoji) {\n <button\n (click)=\"insertEmoji(emoji)\"\n class=\"w-8 h-8 flex items-center justify-center hover:bg-zinc-800 rounded-lg text-lg transition-colors\"\n >\n {{ emoji }}\n </button>\n }\n </div>\n }\n @if (attachEnabled() && drafts().length > 0) {\n <div class=\"flex flex-wrap gap-2 px-4 pt-2\">\n @for (draft of drafts(); track draft.name; let i = $index) {\n <div\n class=\"relative flex items-center gap-2 max-w-40 rounded-xl bg-zinc-900/70 border border-zinc-800 p-1.5\"\n >\n @if (isImageDraft(draft) && draft.previewUrl) {\n <img\n [src]=\"draft.previewUrl\"\n [alt]=\"draft.name\"\n class=\"w-10 h-10 rounded-lg object-cover shrink-0\"\n />\n }\n <div class=\"flex flex-col min-w-0\">\n <span class=\"text-xs font-medium text-white truncate\">\n {{ draft.name }}\n </span>\n <span class=\"text-[10px] text-zinc-500\">\n {{ (draft.size / 1024).toFixed(0) }} KB\n </span>\n </div>\n <button\n (click)=\"removeDraft(i)\"\n class=\"absolute -top-2 -right-2 w-5 h-5 flex items-center justify-center rounded-full bg-zinc-700 text-white text-[10px] leading-none hover:bg-zinc-600\"\n >\n \u2715\n </button>\n </div>\n }\n </div>\n }\n @if (uploading()) {\n <div class=\"px-4 pt-2\">\n <div class=\"h-1 rounded-full bg-zinc-800 overflow-hidden\">\n <div\n class=\"h-full rounded-full bg-white transition-all\"\n [style.width.%]=\"uploadProgress()\"\n ></div>\n </div>\n </div>\n }\n <div\n class=\"flex items-end gap-
|
|
14865
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.33", type: XSChatTextareaComponent, isStandalone: true, selector: "xs-chat-textarea", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, attachEnabled: { classPropertyName: "attachEnabled", publicName: "attachEnabled", isSignal: true, isRequired: false, transformFunction: null }, uploading: { classPropertyName: "uploading", publicName: "uploading", isSignal: true, isRequired: false, transformFunction: null }, uploadProgress: { classPropertyName: "uploadProgress", publicName: "uploadProgress", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sendMessage: "sendMessage", sendWithAttachments: "sendWithAttachments", sendError: "sendError", typing: "typing" }, host: { attributes: { "xs-chat-textarea-host": "" } }, viewQueries: [{ propertyName: "textareaEl", first: true, predicate: ["textareaEl"], descendants: true, isSignal: true }, { propertyName: "fileInputEl", first: true, predicate: ["fileInputEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex flex-col\">\n @if (showEmojiPicker()) {\n <div\n class=\"flex flex-wrap gap-1 p-2 border-t border-zinc-800 max-h-32 overflow-y-auto\"\n >\n @for (emoji of emojis; track emoji) {\n <button\n (click)=\"insertEmoji(emoji)\"\n class=\"w-8 h-8 flex items-center justify-center hover:bg-zinc-800 rounded-lg text-lg transition-colors\"\n >\n {{ emoji }}\n </button>\n }\n </div>\n }\n @if (attachEnabled() && drafts().length > 0) {\n <div class=\"flex flex-wrap gap-2 px-4 pt-2\">\n @for (draft of drafts(); track draft.name; let i = $index) {\n <div\n class=\"relative flex items-center gap-2 max-w-40 rounded-xl bg-zinc-900/70 border border-zinc-800 p-1.5\"\n >\n @if (isImageDraft(draft) && draft.previewUrl) {\n <img\n [src]=\"draft.previewUrl\"\n [alt]=\"draft.name\"\n class=\"w-10 h-10 rounded-lg object-cover shrink-0\"\n />\n }\n <div class=\"flex flex-col min-w-0\">\n <span class=\"text-xs font-medium text-white truncate\">\n {{ draft.name }}\n </span>\n <span class=\"text-[10px] text-zinc-500\">\n {{ (draft.size / 1024).toFixed(0) }} KB\n </span>\n </div>\n <button\n (click)=\"removeDraft(i)\"\n class=\"absolute -top-2 -right-2 w-5 h-5 flex items-center justify-center rounded-full bg-zinc-700 text-white text-[10px] leading-none hover:bg-zinc-600\"\n >\n \u2715\n </button>\n </div>\n }\n </div>\n }\n @if (uploading()) {\n <div class=\"px-4 pt-2\">\n <div class=\"h-1 rounded-full bg-zinc-800 overflow-hidden\">\n <div\n class=\"h-full rounded-full bg-white transition-all\"\n [style.width.%]=\"uploadProgress()\"\n ></div>\n </div>\n </div>\n }\n <div\n class=\"flex items-end gap-1 px-3 py-2 border-t border-zinc-800\"\n >\n @if (attachEnabled()) {\n <xs-button\n layout=\"iconOnly\"\n variant=\"primary\"\n icon=\"paperclip\"\n [disabled]=\"disabled() || uploading()\"\n (click)=\"openFilePicker()\"\n ></xs-button>\n <input\n #fileInputEl\n type=\"file\"\n class=\"hidden\"\n [accept]=\"attachmentAccept\"\n multiple\n (change)=\"onFilesSelected($event)\"\n />\n }\n <xs-button\n layout=\"iconOnly\"\n variant=\"primary\"\n icon=\"face-smile\"\n (click)=\"toggleEmojiPicker()\"\n ></xs-button>\n <div class=\"flex-1 relative min-w-0\">\n <textarea\n #textareaEl\n [(ngModel)]=\"messageText\"\n (ngModelChange)=\"onTextChange()\"\n (keydown)=\"onKeyDown($event)\"\n (input)=\"autoResize()\"\n [placeholder]=\"placeholderText\"\n [maxLength]=\"maxLength\"\n class=\"block w-full px-3 py-2.5 pr-12 text-sm font-medium text-white bg-zinc-900/50 border-0 focus:ring-0 focus:outline-none placeholder:text-zinc-500 resize-none overflow-hidden rounded-xl\"\n rows=\"1\"\n [disabled]=\"disabled()\"\n ></textarea>\n <span\n class=\"absolute bottom-2 right-2 text-[10px] text-zinc-500 pointer-events-none select-none leading-none\"\n >\n {{ messageText().length }}/{{ maxLength }}\n </span>\n </div>\n <xs-button\n layout=\"iconOnly\"\n variant=\"primary\"\n icon=\"paper-plane\"\n [disabled]=\"!canSend() || disabled()\"\n (click)=\"send()\"\n ></xs-button>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: XSButtonComponent, selector: "xs-button", inputs: ["id", "label", "type", "icon", "action", "customClass", "variant", "layout", "badgeCount", "isFull", "disabled", "loading", "title", "ariaLabel", "borderRadius", "isGrouped", "groupPosition"], outputs: ["isGroupedChange", "groupPositionChange", "click", "onClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
14858
14866
|
}
|
|
14859
14867
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: XSChatTextareaComponent, decorators: [{
|
|
14860
14868
|
type: Component,
|
|
14861
|
-
args: [{ selector: 'xs-chat-textarea', standalone: true, imports: [CommonModule, FormsModule, XSButtonComponent], host: { 'xs-chat-textarea-host': '' }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col\">\n @if (showEmojiPicker()) {\n <div\n class=\"flex flex-wrap gap-1 p-2 border-t border-zinc-800 max-h-32 overflow-y-auto\"\n >\n @for (emoji of emojis; track emoji) {\n <button\n (click)=\"insertEmoji(emoji)\"\n class=\"w-8 h-8 flex items-center justify-center hover:bg-zinc-800 rounded-lg text-lg transition-colors\"\n >\n {{ emoji }}\n </button>\n }\n </div>\n }\n @if (attachEnabled() && drafts().length > 0) {\n <div class=\"flex flex-wrap gap-2 px-4 pt-2\">\n @for (draft of drafts(); track draft.name; let i = $index) {\n <div\n class=\"relative flex items-center gap-2 max-w-40 rounded-xl bg-zinc-900/70 border border-zinc-800 p-1.5\"\n >\n @if (isImageDraft(draft) && draft.previewUrl) {\n <img\n [src]=\"draft.previewUrl\"\n [alt]=\"draft.name\"\n class=\"w-10 h-10 rounded-lg object-cover shrink-0\"\n />\n }\n <div class=\"flex flex-col min-w-0\">\n <span class=\"text-xs font-medium text-white truncate\">\n {{ draft.name }}\n </span>\n <span class=\"text-[10px] text-zinc-500\">\n {{ (draft.size / 1024).toFixed(0) }} KB\n </span>\n </div>\n <button\n (click)=\"removeDraft(i)\"\n class=\"absolute -top-2 -right-2 w-5 h-5 flex items-center justify-center rounded-full bg-zinc-700 text-white text-[10px] leading-none hover:bg-zinc-600\"\n >\n \u2715\n </button>\n </div>\n }\n </div>\n }\n @if (uploading()) {\n <div class=\"px-4 pt-2\">\n <div class=\"h-1 rounded-full bg-zinc-800 overflow-hidden\">\n <div\n class=\"h-full rounded-full bg-white transition-all\"\n [style.width.%]=\"uploadProgress()\"\n ></div>\n </div>\n </div>\n }\n <div\n class=\"flex items-end gap-
|
|
14869
|
+
args: [{ selector: 'xs-chat-textarea', standalone: true, imports: [CommonModule, FormsModule, XSButtonComponent], host: { 'xs-chat-textarea-host': '' }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col\">\n @if (showEmojiPicker()) {\n <div\n class=\"flex flex-wrap gap-1 p-2 border-t border-zinc-800 max-h-32 overflow-y-auto\"\n >\n @for (emoji of emojis; track emoji) {\n <button\n (click)=\"insertEmoji(emoji)\"\n class=\"w-8 h-8 flex items-center justify-center hover:bg-zinc-800 rounded-lg text-lg transition-colors\"\n >\n {{ emoji }}\n </button>\n }\n </div>\n }\n @if (attachEnabled() && drafts().length > 0) {\n <div class=\"flex flex-wrap gap-2 px-4 pt-2\">\n @for (draft of drafts(); track draft.name; let i = $index) {\n <div\n class=\"relative flex items-center gap-2 max-w-40 rounded-xl bg-zinc-900/70 border border-zinc-800 p-1.5\"\n >\n @if (isImageDraft(draft) && draft.previewUrl) {\n <img\n [src]=\"draft.previewUrl\"\n [alt]=\"draft.name\"\n class=\"w-10 h-10 rounded-lg object-cover shrink-0\"\n />\n }\n <div class=\"flex flex-col min-w-0\">\n <span class=\"text-xs font-medium text-white truncate\">\n {{ draft.name }}\n </span>\n <span class=\"text-[10px] text-zinc-500\">\n {{ (draft.size / 1024).toFixed(0) }} KB\n </span>\n </div>\n <button\n (click)=\"removeDraft(i)\"\n class=\"absolute -top-2 -right-2 w-5 h-5 flex items-center justify-center rounded-full bg-zinc-700 text-white text-[10px] leading-none hover:bg-zinc-600\"\n >\n \u2715\n </button>\n </div>\n }\n </div>\n }\n @if (uploading()) {\n <div class=\"px-4 pt-2\">\n <div class=\"h-1 rounded-full bg-zinc-800 overflow-hidden\">\n <div\n class=\"h-full rounded-full bg-white transition-all\"\n [style.width.%]=\"uploadProgress()\"\n ></div>\n </div>\n </div>\n }\n <div\n class=\"flex items-end gap-1 px-3 py-2 border-t border-zinc-800\"\n >\n @if (attachEnabled()) {\n <xs-button\n layout=\"iconOnly\"\n variant=\"primary\"\n icon=\"paperclip\"\n [disabled]=\"disabled() || uploading()\"\n (click)=\"openFilePicker()\"\n ></xs-button>\n <input\n #fileInputEl\n type=\"file\"\n class=\"hidden\"\n [accept]=\"attachmentAccept\"\n multiple\n (change)=\"onFilesSelected($event)\"\n />\n }\n <xs-button\n layout=\"iconOnly\"\n variant=\"primary\"\n icon=\"face-smile\"\n (click)=\"toggleEmojiPicker()\"\n ></xs-button>\n <div class=\"flex-1 relative min-w-0\">\n <textarea\n #textareaEl\n [(ngModel)]=\"messageText\"\n (ngModelChange)=\"onTextChange()\"\n (keydown)=\"onKeyDown($event)\"\n (input)=\"autoResize()\"\n [placeholder]=\"placeholderText\"\n [maxLength]=\"maxLength\"\n class=\"block w-full px-3 py-2.5 pr-12 text-sm font-medium text-white bg-zinc-900/50 border-0 focus:ring-0 focus:outline-none placeholder:text-zinc-500 resize-none overflow-hidden rounded-xl\"\n rows=\"1\"\n [disabled]=\"disabled()\"\n ></textarea>\n <span\n class=\"absolute bottom-2 right-2 text-[10px] text-zinc-500 pointer-events-none select-none leading-none\"\n >\n {{ messageText().length }}/{{ maxLength }}\n </span>\n </div>\n <xs-button\n layout=\"iconOnly\"\n variant=\"primary\"\n icon=\"paper-plane\"\n [disabled]=\"!canSend() || disabled()\"\n (click)=\"send()\"\n ></xs-button>\n </div>\n</div>\n" }]
|
|
14862
14870
|
}], ctorParameters: () => [], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], attachEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachEnabled", required: false }] }], uploading: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploading", required: false }] }], uploadProgress: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadProgress", required: false }] }], sendMessage: [{ type: i0.Output, args: ["sendMessage"] }], sendWithAttachments: [{ type: i0.Output, args: ["sendWithAttachments"] }], sendError: [{ type: i0.Output, args: ["sendError"] }], typing: [{ type: i0.Output, args: ["typing"] }], textareaEl: [{ type: i0.ViewChild, args: ['textareaEl', { isSignal: true }] }], fileInputEl: [{ type: i0.ViewChild, args: ['fileInputEl', { isSignal: true }] }] } });
|
|
14863
14871
|
|
|
14864
14872
|
class XSChatConversationInfoComponent {
|