valtech-components 4.0.1035 → 4.0.1036
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/esm2022/lib/components/molecules/chat-composer/chat-composer.component.mjs +8 -2
- package/esm2022/lib/components/organisms/chat-window/chat-window.component.mjs +13 -10
- package/esm2022/lib/components/organisms/thread-panel/thread-panel.component.mjs +1 -1
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +21 -12
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/chat-window/chat-window.component.d.ts +3 -1
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -70,7 +70,7 @@ import fixWebmDuration from 'fix-webm-duration';
|
|
|
70
70
|
* Current version of valtech-components.
|
|
71
71
|
* This is automatically updated during the publish process.
|
|
72
72
|
*/
|
|
73
|
-
const VERSION = '4.0.
|
|
73
|
+
const VERSION = '4.0.1036';
|
|
74
74
|
|
|
75
75
|
function evaluateValtechAccess(rule, context, features = {}, visitedFeatures = new Set()) {
|
|
76
76
|
if (rule == null)
|
|
@@ -93570,6 +93570,7 @@ const CHAT_COMPOSER_I18N = {
|
|
|
93570
93570
|
replyingTo: 'Respondiendo a',
|
|
93571
93571
|
cancel: 'Cancelar',
|
|
93572
93572
|
remove: 'Quitar',
|
|
93573
|
+
pastedSnippet: 'texto-pegado',
|
|
93573
93574
|
},
|
|
93574
93575
|
en: {
|
|
93575
93576
|
placeholder: 'Write a message',
|
|
@@ -93582,6 +93583,7 @@ const CHAT_COMPOSER_I18N = {
|
|
|
93582
93583
|
replyingTo: 'Replying to',
|
|
93583
93584
|
cancel: 'Cancel',
|
|
93584
93585
|
remove: 'Remove',
|
|
93586
|
+
pastedSnippet: 'pasted-text',
|
|
93585
93587
|
},
|
|
93586
93588
|
};
|
|
93587
93589
|
/**
|
|
@@ -93675,7 +93677,11 @@ class ChatComposerComponent {
|
|
|
93675
93677
|
}
|
|
93676
93678
|
// Texto plano insertado en el caret (evita pegar HTML con estilos).
|
|
93677
93679
|
const text = data.getData('text/plain');
|
|
93678
|
-
if (text) {
|
|
93680
|
+
if (text && text.length > this.maxLength()) {
|
|
93681
|
+
const name = `${this.i18n.t('pastedSnippet', 'ChatComposer')}-${new Date().toISOString().replace(/[:.]/g, '-')}.txt`;
|
|
93682
|
+
this.addPending(new File([text], name, { type: 'text/plain' }));
|
|
93683
|
+
}
|
|
93684
|
+
else if (text) {
|
|
93679
93685
|
document.execCommand('insertText', false, text);
|
|
93680
93686
|
}
|
|
93681
93687
|
this.syncBody();
|
|
@@ -94421,6 +94427,8 @@ class ChatWindowComponent {
|
|
|
94421
94427
|
this.showDictation = input(true);
|
|
94422
94428
|
/** Botón de mensaje de voz (grabar clip de audio). */
|
|
94423
94429
|
this.showVoiceMessage = input(false);
|
|
94430
|
+
/** Muestra avatares en mensajes ajenos. Desactivable para chats 1:1 o agentes. */
|
|
94431
|
+
this.showAvatars = input(true);
|
|
94424
94432
|
this.sendMessage = output();
|
|
94425
94433
|
this.loadMore = output();
|
|
94426
94434
|
this.reactionClick = output();
|
|
@@ -94465,7 +94473,7 @@ class ChatWindowComponent {
|
|
|
94465
94473
|
id: m.msgId,
|
|
94466
94474
|
msg: m,
|
|
94467
94475
|
showName: firstInGroup && !m.isMine,
|
|
94468
|
-
showAvatar: lastInGroup && !m.isMine,
|
|
94476
|
+
showAvatar: this.showAvatars() && lastInGroup && !m.isMine,
|
|
94469
94477
|
tail: lastInGroup,
|
|
94470
94478
|
});
|
|
94471
94479
|
}
|
|
@@ -94474,15 +94482,16 @@ class ChatWindowComponent {
|
|
|
94474
94482
|
this.i18n.registerDefaults('ChatWindow', CHAT_WINDOW_I18N);
|
|
94475
94483
|
// Auto-scroll al fondo cuando llegan mensajes y el usuario ya estaba abajo
|
|
94476
94484
|
// (o el último mensaje es propio). Si está leyendo arriba, marca "nuevos".
|
|
94477
|
-
let
|
|
94485
|
+
let prevSignature = '';
|
|
94478
94486
|
effect(() => {
|
|
94479
|
-
const
|
|
94480
|
-
const
|
|
94481
|
-
|
|
94487
|
+
const messages = this.messages();
|
|
94488
|
+
const last = messages[messages.length - 1];
|
|
94489
|
+
const signature = `${messages.length}:${last?.msgId ?? ''}:${last?.body?.length ?? 0}`;
|
|
94490
|
+
if (signature === prevSignature)
|
|
94482
94491
|
return;
|
|
94483
|
-
const
|
|
94484
|
-
|
|
94485
|
-
|
|
94492
|
+
const previousCount = Number(prevSignature.split(':')[0] || 0);
|
|
94493
|
+
const grew = messages.length > previousCount;
|
|
94494
|
+
prevSignature = signature;
|
|
94486
94495
|
const mine = last?.isMine ?? false;
|
|
94487
94496
|
if (this.atBottom() || mine) {
|
|
94488
94497
|
setTimeout(() => this.scrollToBottom(false), 0);
|
|
@@ -94540,7 +94549,7 @@ class ChatWindowComponent {
|
|
|
94540
94549
|
return this.i18n.t(key, 'ChatWindow');
|
|
94541
94550
|
}
|
|
94542
94551
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ChatWindowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
94543
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ChatWindowComponent, isStandalone: true, selector: "val-chat-window", inputs: { convId: { classPropertyName: "convId", publicName: "convId", isSignal: true, isRequired: false, transformFunction: null }, messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: false, transformFunction: null }, currentUserId: { classPropertyName: "currentUserId", publicName: "currentUserId", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, typingUsers: { classPropertyName: "typingUsers", publicName: "typingUsers", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, canModerate: { classPropertyName: "canModerate", publicName: "canModerate", isSignal: true, isRequired: false, transformFunction: null }, showAttach: { classPropertyName: "showAttach", publicName: "showAttach", isSignal: true, isRequired: false, transformFunction: null }, showDictation: { classPropertyName: "showDictation", publicName: "showDictation", isSignal: true, isRequired: false, transformFunction: null }, showVoiceMessage: { classPropertyName: "showVoiceMessage", publicName: "showVoiceMessage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sendMessage: "sendMessage", loadMore: "loadMore", reactionClick: "reactionClick", deleteMessage: "deleteMessage", replyTo: "replyTo", editMessage: "editMessage", typing: "typing", voice: "voice" }, viewQueries: [{ propertyName: "msgsEl", first: true, predicate: ["msgs"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
94552
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ChatWindowComponent, isStandalone: true, selector: "val-chat-window", inputs: { convId: { classPropertyName: "convId", publicName: "convId", isSignal: true, isRequired: false, transformFunction: null }, messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: false, transformFunction: null }, currentUserId: { classPropertyName: "currentUserId", publicName: "currentUserId", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, typingUsers: { classPropertyName: "typingUsers", publicName: "typingUsers", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, canModerate: { classPropertyName: "canModerate", publicName: "canModerate", isSignal: true, isRequired: false, transformFunction: null }, showAttach: { classPropertyName: "showAttach", publicName: "showAttach", isSignal: true, isRequired: false, transformFunction: null }, showDictation: { classPropertyName: "showDictation", publicName: "showDictation", isSignal: true, isRequired: false, transformFunction: null }, showVoiceMessage: { classPropertyName: "showVoiceMessage", publicName: "showVoiceMessage", isSignal: true, isRequired: false, transformFunction: null }, showAvatars: { classPropertyName: "showAvatars", publicName: "showAvatars", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sendMessage: "sendMessage", loadMore: "loadMore", reactionClick: "reactionClick", deleteMessage: "deleteMessage", replyTo: "replyTo", editMessage: "editMessage", typing: "typing", voice: "voice" }, viewQueries: [{ propertyName: "msgsEl", first: true, predicate: ["msgs"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
94544
94553
|
<div class="chat">
|
|
94545
94554
|
<div #msgs class="messages" (scroll)="onScroll()">
|
|
94546
94555
|
@if (isLoading()) {
|
|
@@ -94822,7 +94831,7 @@ class ThreadPanelComponent {
|
|
|
94822
94831
|
</div>
|
|
94823
94832
|
}
|
|
94824
94833
|
</div>
|
|
94825
|
-
`, isInline: true, styles: [".thread-panel{display:flex;flex-direction:column;height:100%;background:var(--ion-background-color, #f4f5f8)}.thread-header{padding:12px 16px;border-bottom:1px solid var(--ion-border-color, rgba(0, 0, 0, .1));background:var(--ion-card-background, var(--ion-background-color, #fff))}.thread-header .thread-title{font-size:1rem;font-weight:600;color:var(--ion-text-color, #000);margin:0}.thread-loading{display:flex;align-items:center;justify-content:center;flex:1;gap:10px;color:var(--ion-color-dark, #92949c);font-size:.875rem}.thread-chat{flex:1;overflow:hidden;display:flex;flex-direction:column}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }, { kind: "component", type: ChatWindowComponent, selector: "val-chat-window", inputs: ["convId", "messages", "currentUserId", "isOpen", "typingUsers", "isLoading", "canModerate", "showAttach", "showDictation", "showVoiceMessage"], outputs: ["sendMessage", "loadMore", "reactionClick", "deleteMessage", "replyTo", "editMessage", "typing", "voice"] }] }); }
|
|
94834
|
+
`, isInline: true, styles: [".thread-panel{display:flex;flex-direction:column;height:100%;background:var(--ion-background-color, #f4f5f8)}.thread-header{padding:12px 16px;border-bottom:1px solid var(--ion-border-color, rgba(0, 0, 0, .1));background:var(--ion-card-background, var(--ion-background-color, #fff))}.thread-header .thread-title{font-size:1rem;font-weight:600;color:var(--ion-text-color, #000);margin:0}.thread-loading{display:flex;align-items:center;justify-content:center;flex:1;gap:10px;color:var(--ion-color-dark, #92949c);font-size:.875rem}.thread-chat{flex:1;overflow:hidden;display:flex;flex-direction:column}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }, { kind: "component", type: ChatWindowComponent, selector: "val-chat-window", inputs: ["convId", "messages", "currentUserId", "isOpen", "typingUsers", "isLoading", "canModerate", "showAttach", "showDictation", "showVoiceMessage", "showAvatars"], outputs: ["sendMessage", "loadMore", "reactionClick", "deleteMessage", "replyTo", "editMessage", "typing", "voice"] }] }); }
|
|
94826
94835
|
}
|
|
94827
94836
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ThreadPanelComponent, decorators: [{
|
|
94828
94837
|
type: Component,
|