valtech-components 4.0.227 → 4.0.228

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.
Files changed (27) hide show
  1. package/esm2022/lib/components/molecules/chat-input/chat-input.component.mjs +9 -1
  2. package/esm2022/lib/components/molecules/message-bubble/message-bubble.component.mjs +191 -274
  3. package/esm2022/lib/components/molecules/typing-indicator/typing-indicator.component.mjs +12 -11
  4. package/esm2022/lib/components/organisms/chat-window/chat-window.component.mjs +203 -216
  5. package/esm2022/lib/components/organisms/thread-panel/thread-panel.component.mjs +10 -10
  6. package/esm2022/lib/services/chat/conversation.service.mjs +14 -37
  7. package/esm2022/lib/services/chat/types.mjs +1 -1
  8. package/esm2022/lib/services/i18n/default-content.mjs +1 -5
  9. package/esm2022/lib/shared/utils/datetime.mjs +1 -54
  10. package/esm2022/lib/version.mjs +2 -2
  11. package/esm2022/public-api.mjs +2 -4
  12. package/fesm2022/valtech-components.mjs +428 -1080
  13. package/fesm2022/valtech-components.mjs.map +1 -1
  14. package/lib/components/molecules/message-bubble/message-bubble.component.d.ts +32 -34
  15. package/lib/components/molecules/typing-indicator/typing-indicator.component.d.ts +4 -5
  16. package/lib/components/organisms/chat-window/chat-window.component.d.ts +56 -52
  17. package/lib/services/chat/conversation.service.d.ts +5 -12
  18. package/lib/services/chat/types.d.ts +52 -86
  19. package/lib/shared/utils/datetime.d.ts +0 -19
  20. package/lib/version.d.ts +1 -1
  21. package/package.json +1 -1
  22. package/public-api.d.ts +1 -3
  23. package/src/lib/services/firebase/firebase-messaging-sw.js +125 -70
  24. package/esm2022/lib/components/molecules/chat-composer/chat-composer.component.mjs +0 -391
  25. package/esm2022/lib/components/molecules/conversation-list-item/conversation-list-item.component.mjs +0 -108
  26. package/lib/components/molecules/chat-composer/chat-composer.component.d.ts +0 -63
  27. package/lib/components/molecules/conversation-list-item/conversation-list-item.component.d.ts +0 -30
@@ -1,42 +1,40 @@
1
- import { MessageBubbleMetadata } from './types';
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { I18nService } from '../../../services/i18n';
3
+ import { MessageBubbleMetadata, MessageReactionClickEvent, MessageReplyClickEvent, MessageDeleteClickEvent, MessageEditClickEvent } from './types';
4
+ import { MessageReaction } from '../../../services/chat/types';
2
5
  import * as i0 from "@angular/core";
3
- /** Acción disparada desde una burbuja. Un solo output tipado en vez de 4. */
4
- export interface MessageBubbleAction {
5
- type: 'reply' | 'edit' | 'delete' | 'react';
6
- msgId: string;
7
- /** Token del emoji, solo para type 'react'. */
8
- token?: string;
9
- }
10
6
  /**
11
- * val-message-bubble — burbuja de mensaje presentacional (signal inputs).
7
+ * val-message-bubble
12
8
  *
13
- * Sin lógica de negocio: el contenedor (`val-chat-window`) decide agrupación y
14
- * pasa flags (showAvatar/showName/tail). Las acciones (responder/editar/borrar/
15
- * reaccionar) NO están siempre visibles: se revelan en hover (desktop) o al tocar
16
- * la burbuja (móvil), y se emiten por un único `(action)` tipado.
9
+ * Burbuja de mensaje para el chat. Alineada a la derecha si isMine, a la izquierda si no.
10
+ * Muestra nombre del emisor, cuerpo, timestamp, estado de envio, reacciones y acciones.
11
+ * Si el mensaje fue eliminado muestra un texto en gris sin acciones.
17
12
  *
18
- * Read receipts estilo WhatsApp: sending → reloj, sent → ✓, delivered/read → ✓✓
19
- * (read en color), failed → alerta.
13
+ * @example
14
+ * <val-message-bubble
15
+ * [props]="msg"
16
+ * (reactionClick)="onReaction($event)"
17
+ * (replyClick)="onReply($event)"
18
+ * (deleteClick)="onDelete($event)"
19
+ * />
20
20
  */
21
- export declare class MessageBubbleComponent {
22
- private i18n;
23
- readonly msg: import("@angular/core").InputSignal<MessageBubbleMetadata>;
24
- readonly showAvatar: import("@angular/core").InputSignal<boolean>;
25
- readonly showName: import("@angular/core").InputSignal<boolean>;
26
- readonly tail: import("@angular/core").InputSignal<boolean>;
27
- readonly locale: import("@angular/core").InputSignal<string>;
28
- readonly action: import("@angular/core").OutputEmitterRef<MessageBubbleAction>;
29
- protected readonly actionsOpen: import("@angular/core").WritableSignal<boolean>;
21
+ export declare class MessageBubbleComponent implements OnInit {
22
+ protected i18n: I18nService;
23
+ props: MessageBubbleMetadata;
24
+ reactionClick: EventEmitter<MessageReactionClickEvent>;
25
+ replyClick: EventEmitter<MessageReplyClickEvent>;
26
+ deleteClick: EventEmitter<MessageDeleteClickEvent>;
27
+ editClick: EventEmitter<MessageEditClickEvent>;
30
28
  constructor();
31
- protected readonly time: import("@angular/core").Signal<string>;
32
- protected readonly initials: import("@angular/core").Signal<string>;
33
- protected readonly imageAttachments: import("@angular/core").Signal<import("valtech-components").MessageAttachment[]>;
34
- protected readonly audioAttachments: import("@angular/core").Signal<import("valtech-components").MessageAttachment[]>;
35
- protected readonly fileAttachments: import("@angular/core").Signal<import("valtech-components").MessageAttachment[]>;
36
- protected readonly statusIcon: import("@angular/core").Signal<"time-outline" | "alert-circle" | "checkmark-done" | "checkmark">;
37
- protected toggleActions(): void;
38
- protected emit(type: MessageBubbleAction['type'], token?: string): void;
39
- t(key: string): string;
29
+ ngOnInit(): void;
30
+ deletedText(): string;
31
+ editedLabel(): string;
32
+ formatTime(date: Date): string;
33
+ statusIcon(): string;
34
+ onReactionClick(reaction: MessageReaction): void;
35
+ onReplyClick(): void;
36
+ onDeleteClick(): void;
37
+ onEditClick(): void;
40
38
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageBubbleComponent, never>;
41
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageBubbleComponent, "val-message-bubble", never, { "msg": { "alias": "msg"; "required": true; "isSignal": true; }; "showAvatar": { "alias": "showAvatar"; "required": false; "isSignal": true; }; "showName": { "alias": "showName"; "required": false; "isSignal": true; }; "tail": { "alias": "tail"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; }, { "action": "action"; }, never, never, true, never>;
39
+ static ɵcmp: i0.ɵɵComponentDeclaration<MessageBubbleComponent, "val-message-bubble", never, { "props": { "alias": "props"; "required": false; }; }, { "reactionClick": "reactionClick"; "replyClick": "replyClick"; "deleteClick": "deleteClick"; "editClick": "editClick"; }, never, never, true, never>;
42
40
  }
@@ -3,18 +3,17 @@ import * as i0 from "@angular/core";
3
3
  /**
4
4
  * val-typing-indicator
5
5
  *
6
- * Muestra quienes estan escribiendo con animacion de tres puntos. Se oculta
7
- * si `typingUsers` esta vacio. Usa signal input para que `typingText` (computed)
8
- * recompute al cambiar la lista.
6
+ * Muestra quienes estan escribiendo en el chat con animacion de tres puntos.
7
+ * Se oculta automaticamente si typingUsers esta vacio.
9
8
  *
10
9
  * @example
11
10
  * <val-typing-indicator [typingUsers]="['Maria', 'Carlos']" />
12
11
  */
13
12
  export declare class TypingIndicatorComponent {
14
13
  protected i18n: I18nService;
15
- readonly typingUsers: import("@angular/core").InputSignal<string[]>;
14
+ typingUsers: string[];
16
15
  constructor();
17
16
  protected typingText: import("@angular/core").Signal<string>;
18
17
  static ɵfac: i0.ɵɵFactoryDeclaration<TypingIndicatorComponent, never>;
19
- static ɵcmp: i0.ɵɵComponentDeclaration<TypingIndicatorComponent, "val-typing-indicator", never, { "typingUsers": { "alias": "typingUsers"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
18
+ static ɵcmp: i0.ɵɵComponentDeclaration<TypingIndicatorComponent, "val-typing-indicator", never, { "typingUsers": { "alias": "typingUsers"; "required": false; }; }, {}, never, never, true, never>;
20
19
  }
@@ -1,64 +1,68 @@
1
- import { MessageReplyTo } from '../../../services/chat/types';
2
- import { MessageBubbleAction } from '../../molecules/message-bubble/message-bubble.component';
3
- import { MessageBubbleMetadata } from '../../molecules/message-bubble/types';
1
+ import { EventEmitter, OnChanges, OnDestroy, SimpleChanges, AfterViewChecked, AfterViewInit } from '@angular/core';
2
+ import { I18nService } from '../../../services/i18n';
3
+ import { MessageBubbleMetadata, MessageReactionClickEvent } from '../../molecules/message-bubble/types';
4
4
  import * as i0 from "@angular/core";
5
- type ChatRow = {
6
- kind: 'date';
7
- id: string;
8
- label: string;
9
- } | {
10
- kind: 'msg';
11
- id: string;
12
- msg: MessageBubbleMetadata;
13
- showName: boolean;
14
- showAvatar: boolean;
15
- tail: boolean;
16
- };
5
+ /** Estructura interna para agrupar mensajes por fecha. */
6
+ interface MessageGroup {
7
+ dateLabel: string;
8
+ messages: MessageBubbleMetadata[];
9
+ }
17
10
  /**
18
- * val-chat-window — ventana de chat completa (signal inputs).
11
+ * val-chat-window
19
12
  *
20
- * Agrupa mensajes consecutivos del mismo emisor y por día (separadores sticky),
21
- * muestra avatar/nombre solo en los bordes del grupo, scroll-to-bottom inteligente
22
- * (auto-scroll si estás abajo, pill "mensajes nuevos" si estás leyendo arriba),
23
- * composer moderno con contexto de respuesta, y typing indicator.
13
+ * Ventana de chat completa. Muestra la lista de mensajes agrupados por fecha,
14
+ * el indicador de escritura, el input de mensaje (solo si isOpen) y un banner
15
+ * cuando la conversacion esta cerrada. Auto-scroll al ultimo mensaje cuando
16
+ * llegan mensajes nuevos.
24
17
  *
25
- * API pública estable (consumida por thread-panel y showcase): inputs convId,
26
- * messages, currentUserId, isOpen, typingUsers, isLoading; outputs sendMessage,
27
- * loadMore, reactionClick, deleteMessage, replyTo (+ editMessage/attach/voice nuevos).
18
+ * @example
19
+ * <val-chat-window
20
+ * [convId]="conv.id"
21
+ * [messages]="messages()"
22
+ * [currentUserId]="userId"
23
+ * [isOpen]="conv.status === 'open'"
24
+ * [typingUsers]="typingUsers()"
25
+ * (sendMessage)="onSend($event)"
26
+ * (reactionClick)="onReaction($event)"
27
+ * />
28
28
  */
29
- export declare class ChatWindowComponent {
30
- private i18n;
31
- readonly convId: import("@angular/core").InputSignal<string>;
32
- readonly messages: import("@angular/core").InputSignal<MessageBubbleMetadata[]>;
33
- readonly currentUserId: import("@angular/core").InputSignal<string>;
34
- readonly isOpen: import("@angular/core").InputSignal<boolean>;
35
- readonly typingUsers: import("@angular/core").InputSignal<string[]>;
36
- readonly isLoading: import("@angular/core").InputSignal<boolean>;
37
- readonly sendMessage: import("@angular/core").OutputEmitterRef<string>;
38
- readonly loadMore: import("@angular/core").OutputEmitterRef<void>;
39
- readonly reactionClick: import("@angular/core").OutputEmitterRef<{
29
+ export declare class ChatWindowComponent implements OnChanges, AfterViewInit, AfterViewChecked, OnDestroy {
30
+ protected i18n: I18nService;
31
+ convId: string;
32
+ messages: MessageBubbleMetadata[];
33
+ participants: string[];
34
+ currentUserId: string;
35
+ isOpen: boolean;
36
+ typingUsers: string[];
37
+ isLoading: boolean;
38
+ sendMessage: EventEmitter<string>;
39
+ loadMore: EventEmitter<void>;
40
+ reactionClick: EventEmitter<{
40
41
  msgId: string;
41
42
  token: string;
42
43
  }>;
43
- readonly deleteMessage: import("@angular/core").OutputEmitterRef<string>;
44
- readonly replyTo: import("@angular/core").OutputEmitterRef<string>;
45
- readonly editMessage: import("@angular/core").OutputEmitterRef<string>;
46
- readonly typing: import("@angular/core").OutputEmitterRef<void>;
47
- readonly attach: import("@angular/core").OutputEmitterRef<File>;
48
- readonly voice: import("@angular/core").OutputEmitterRef<void>;
49
- private readonly msgsEl;
50
- protected readonly replyingTo: import("@angular/core").WritableSignal<MessageReplyTo>;
51
- protected readonly atBottom: import("@angular/core").WritableSignal<boolean>;
52
- protected readonly hasNew: import("@angular/core").WritableSignal<boolean>;
53
- protected readonly locale: import("@angular/core").Signal<"es-CL" | "en-US">;
44
+ deleteMessage: EventEmitter<string>;
45
+ replyTo: EventEmitter<string>;
46
+ private messagesListRef?;
47
+ private chatWindowElRef?;
48
+ private prevMessageCount;
49
+ private shouldScrollToBottom;
50
+ private vvListener?;
54
51
  constructor();
55
- protected readonly rows: import("@angular/core").Signal<ChatRow[]>;
56
- protected onScroll(): void;
57
- protected scrollToBottom(smooth: boolean): void;
58
- protected onSend(body: string): void;
59
- protected onAction(event: MessageBubbleAction): void;
60
- t(key: string): string;
52
+ ngAfterViewInit(): void;
53
+ ngOnDestroy(): void;
54
+ ngOnChanges(changes: SimpleChanges): void;
55
+ ngAfterViewChecked(): void;
56
+ private adjustToKeyboard;
57
+ protected messageGroups: import("@angular/core").Signal<MessageGroup[]>;
58
+ protected closedText: import("@angular/core").Signal<string>;
59
+ protected loadingText: import("@angular/core").Signal<string>;
60
+ protected onReactionClick(event: MessageReactionClickEvent): void;
61
+ protected onEditClick(_msgId: string): void;
62
+ protected onTyping(): void;
63
+ private scrollToBottom;
64
+ private formatDateLabel;
61
65
  static ɵfac: i0.ɵɵFactoryDeclaration<ChatWindowComponent, never>;
62
- static ɵcmp: i0.ɵɵComponentDeclaration<ChatWindowComponent, "val-chat-window", never, { "convId": { "alias": "convId"; "required": false; "isSignal": true; }; "messages": { "alias": "messages"; "required": false; "isSignal": true; }; "currentUserId": { "alias": "currentUserId"; "required": false; "isSignal": true; }; "isOpen": { "alias": "isOpen"; "required": false; "isSignal": true; }; "typingUsers": { "alias": "typingUsers"; "required": false; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; }, { "sendMessage": "sendMessage"; "loadMore": "loadMore"; "reactionClick": "reactionClick"; "deleteMessage": "deleteMessage"; "replyTo": "replyTo"; "editMessage": "editMessage"; "typing": "typing"; "attach": "attach"; "voice": "voice"; }, never, never, true, never>;
66
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChatWindowComponent, "val-chat-window", never, { "convId": { "alias": "convId"; "required": false; }; "messages": { "alias": "messages"; "required": false; }; "participants": { "alias": "participants"; "required": false; }; "currentUserId": { "alias": "currentUserId"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; "typingUsers": { "alias": "typingUsers"; "required": false; }; "isLoading": { "alias": "isLoading"; "required": false; }; }, { "sendMessage": "sendMessage"; "loadMore": "loadMore"; "reactionClick": "reactionClick"; "deleteMessage": "deleteMessage"; "replyTo": "replyTo"; }, never, never, true, never>;
63
67
  }
64
68
  export {};
@@ -1,5 +1,5 @@
1
1
  import { Observable } from 'rxjs';
2
- import { Conversation, ConversationType, CreateConversationRequest, ListConversationsResponse, Message, MessageAttachment, UpdateConversationRequest } from './types';
2
+ import { Conversation, ConversationType, CreateConversationRequest, ListConversationsResponse, Message, UpdateConversationRequest } from './types';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
5
  * ConversationService
@@ -33,17 +33,12 @@ export declare class ConversationService {
33
33
  private get baseUrl();
34
34
  /**
35
35
  * Crea una nueva conversacion.
36
- * El backend responde con un envelope { operationId, conversation } — lo
37
- * desenvolvemos para devolver la Conversation directa.
38
36
  */
39
37
  createConversation(req: CreateConversationRequest): Observable<Conversation>;
40
38
  /**
41
- * Obtiene o crea una conversacion asociada a una entidad (post, request, org, etc.).
39
+ * Obtiene o crea una conversacion asociada a una entidad (post, request, etc.).
42
40
  * Usa el patron upsert del backend: si ya existe una conversacion para esa entidad,
43
41
  * la devuelve; si no, la crea.
44
- *
45
- * El backend espera { entityRef: { type, id }, type } y responde con un envelope
46
- * { operationId, conversation, created }.
47
42
  */
48
43
  getOrCreateForEntity(entityType: string, entityId: string, type?: ConversationType): Observable<Conversation>;
49
44
  /**
@@ -55,7 +50,7 @@ export declare class ConversationService {
55
50
  */
56
51
  getConversation(convId: string): Observable<Conversation>;
57
52
  /**
58
- * Actualiza el nombre o settings de una conversacion.
53
+ * Actualiza el titulo o estado de una conversacion.
59
54
  */
60
55
  updateConversation(convId: string, req: UpdateConversationRequest): Observable<Conversation>;
61
56
  /**
@@ -75,11 +70,9 @@ export declare class ConversationService {
75
70
  */
76
71
  removeParticipant(convId: string, userId: string): Observable<void>;
77
72
  /**
78
- * Envia un mensaje a una conversacion, opcionalmente con adjuntos.
79
- * El backend espera `attachments: { url, type, name, size }[]` (key `type` = MIME),
80
- * mientras que el front usa `mimeType` — se mapea aqui.
73
+ * Envia un mensaje a una conversacion.
81
74
  */
82
- sendMessage(convId: string, body: string, attachments?: MessageAttachment[]): Observable<Message>;
75
+ sendMessage(convId: string, body: string): Observable<Message>;
83
76
  /**
84
77
  * Elimina (marca como eliminado) un mensaje.
85
78
  */
@@ -7,75 +7,50 @@
7
7
  * /apps/{appId}/orgs/{orgId}/conversations/{convId}/typing/{userId}
8
8
  */
9
9
  import { FirestoreDocument } from '../firebase/types';
10
- /**
11
- * Tipo de conversacion. Debe coincidir con el backend (services/conversation):
12
- * thread = comentarios en entidad · group = canal grupal · dm = 1:1 directo.
13
- */
14
- export type ConversationType = 'thread' | 'group' | 'dm';
15
- /** Visibilidad de una conversacion (quien puede unirse). */
16
- export type ConvVisibility = 'org' | 'private' | 'public' | '';
17
- /** Vinculo de la conversacion con una entidad del dominio. */
18
- export interface EntityRef {
19
- /** Tipo de entidad ('post' | 'request' | 'org' | 'custom', etc.). */
20
- type: string;
21
- /** ID de la entidad. */
22
- id: string;
23
- }
24
- /** Configuracion de la conversacion. */
25
- export interface ConvSettings {
26
- /** Si la conversacion esta abierta para enviar mensajes. */
27
- isOpen: boolean;
28
- /** Quien puede unirse. */
29
- visibility: ConvVisibility;
30
- /** Si admite participantes anonimos. */
31
- allowAnonymous: boolean;
32
- /** Si requiere membresia de la org. */
33
- requireMembership: boolean;
34
- /** Maximo de participantes (0 = sin limite). */
35
- maxParticipants: number;
10
+ /** Tipo de conversacion. */
11
+ export type ConversationType = 'direct' | 'group' | 'entity';
12
+ /** Estado de una conversacion. */
13
+ export type ConversationStatus = 'open' | 'closed';
14
+ /** Participante de una conversacion. */
15
+ export interface ConversationParticipant {
16
+ /** ID del usuario. */
17
+ userId: string;
18
+ /** Nombre visible del usuario. */
19
+ displayName: string;
20
+ /** URL del avatar del usuario (opcional). */
21
+ avatarUrl?: string;
22
+ /** Fecha en que se unio a la conversacion. */
23
+ joinedAt: Date;
24
+ /** Ultimo mensaje leido por este participante. */
25
+ lastReadMsgId?: string;
36
26
  }
37
- /**
38
- * Documento de conversacion. Refleja el contrato del backend
39
- * (services/conversation/types.go) — la fuente de verdad es DynamoDB y el doc se
40
- * proyecta a Firestore para las reglas de membresia. Por eso los campos son
41
- * `convId`/`name`/`participants: string[]` y NO el shape antiguo.
42
- */
43
- export interface Conversation {
44
- /** ID de la conversacion. */
45
- convId: string;
27
+ /** Documento de conversacion en Firestore. */
28
+ export interface Conversation extends FirestoreDocument {
46
29
  /** Tipo de conversacion. */
47
30
  type: ConversationType;
48
- /** ID de la app. */
49
- appId: string;
50
- /** ID de la org. */
51
- orgId: string;
52
- /** Nombre de la conversacion (para grupos). */
53
- name?: string;
54
- /** Entidad asociada (para tipo thread). */
55
- entityRef?: EntityRef;
56
- /** IDs de los participantes. */
57
- participants: string[];
58
- /** Configuracion. */
59
- settings: ConvSettings;
60
- /** ID del usuario que la creo. */
61
- createdBy: string;
62
- /** Fecha de creacion (ISO string). */
63
- createdAt: string;
64
- /** Fecha de ultima actualizacion (ISO string). */
65
- updatedAt: string;
66
- /** Fecha del ultimo mensaje (ISO string). */
67
- lastMsgAt?: string;
68
- /** Preview del ultimo mensaje. */
69
- lastMsgPreview?: string;
31
+ /** Estado de la conversacion. */
32
+ status: ConversationStatus;
33
+ /** Participantes. */
34
+ participants: ConversationParticipant[];
35
+ /** Tipo de entidad asociada (para tipo entity). */
36
+ entityType?: string;
37
+ /** ID de la entidad asociada. */
38
+ entityId?: string;
39
+ /** Titulo de la conversacion (para grupos). */
40
+ title?: string;
41
+ /** ID del ultimo mensaje. */
42
+ lastMsgId?: string;
43
+ /** Texto del ultimo mensaje (preview). */
44
+ lastMsgBody?: string;
45
+ /** Fecha del ultimo mensaje. */
46
+ lastMsgAt?: Date;
47
+ /** Conteo de mensajes no leidos por userId. */
48
+ unreadCount?: Record<string, number>;
70
49
  }
71
50
  /** Tipo de mensaje. */
72
51
  export type MessageType = 'text' | 'image' | 'file' | 'system';
73
- /**
74
- * Estado de envio/entrega de un mensaje (para read receipts estilo WhatsApp):
75
- * sending → reloj · sent → ✓ · delivered → ✓✓ gris · read → ✓✓ primary · failed → alerta.
76
- * El backend hoy solo emite hasta `sent`; los demas estan soportados para el futuro.
77
- */
78
- export type MessageStatus = 'sending' | 'sent' | 'delivered' | 'read' | 'failed';
52
+ /** Estado de envio del mensaje. */
53
+ export type MessageStatus = 'sending' | 'sent' | 'failed';
79
54
  /** Archivo adjunto en un mensaje. */
80
55
  export interface MessageAttachment {
81
56
  /** Nombre del archivo. */
@@ -143,37 +118,28 @@ export interface TypingDocument extends FirestoreDocument {
143
118
  export interface CreateConversationRequest {
144
119
  /** Tipo de conversacion. */
145
120
  type: ConversationType;
146
- /** Nombre (para grupos). */
147
- name?: string;
148
- /** Entidad asociada (para tipo thread). */
149
- entityRef?: EntityRef;
150
- /** IDs de los participantes iniciales (ademas del creador). */
151
- participants?: string[];
152
- /** Configuracion inicial. */
153
- settings?: Partial<ConvSettings>;
121
+ /** IDs de los participantes iniciales. */
122
+ participantIds?: string[];
123
+ /** Para tipo entity: tipo de la entidad. */
124
+ entityType?: string;
125
+ /** Para tipo entity: ID de la entidad. */
126
+ entityId?: string;
127
+ /** Titulo (para grupos). */
128
+ title?: string;
154
129
  }
155
130
  /** Request para actualizar una conversacion. */
156
131
  export interface UpdateConversationRequest {
157
- /** Nuevo nombre (opcional). */
158
- name?: string;
159
- /** Nueva configuracion (opcional). */
160
- settings?: Partial<ConvSettings>;
161
- }
162
- /** Response que envuelve una sola conversacion (create / get / update / get-or-create). */
163
- export interface ConversationResponse {
164
- /** ID de operacion para tracing. */
165
- operationId: string;
166
- /** La conversacion. */
167
- conversation: Conversation;
168
- /** Si fue creada en esta llamada (solo get-or-create). */
169
- created?: boolean;
132
+ /** Nuevo titulo (opcional). */
133
+ title?: string;
134
+ /** Nuevo estado (opcional). */
135
+ status?: ConversationStatus;
170
136
  }
171
137
  /** Response de listado de conversaciones. */
172
138
  export interface ListConversationsResponse {
173
- /** ID de operacion para tracing. */
174
- operationId: string;
175
139
  /** Lista de conversaciones. */
176
140
  conversations: Conversation[];
177
141
  /** Cursor para paginacion. */
178
142
  nextCursor?: string;
143
+ /** Si hay mas paginas. */
144
+ hasMore: boolean;
179
145
  }
@@ -19,22 +19,3 @@ export type TimeOfDayKey = 'goodMorning' | 'goodAfternoon' | 'goodEvening';
19
19
  * const text = i18n.t(key); // 'Buenos días' | 'Buenas tardes' | 'Buenas noches'
20
20
  */
21
21
  export declare function getTimeOfDayKey(date?: Date): TimeOfDayKey;
22
- /** Hora corta local, ej. "14:05". */
23
- export declare function formatClockTime(value: Date | string | undefined | null, locale?: string): string;
24
- /**
25
- * Etiqueta corta para listas de conversaciones (estilo Telegram/WhatsApp):
26
- * hoy → hora ("14:05"), ayer → label `yesterday`, esta semana → día de semana,
27
- * más viejo → fecha corta. `labels.today/yesterday` se inyectan ya traducidos.
28
- */
29
- export declare function formatRelativeTime(value: Date | string | undefined | null, locale?: string, labels?: {
30
- today?: string;
31
- yesterday?: string;
32
- }): string;
33
- /**
34
- * Etiqueta para separadores de fecha dentro de un chat: "Hoy" / "Ayer" /
35
- * fecha larga ("12 de junio de 2026"). `labels.today/yesterday` ya traducidos.
36
- */
37
- export declare function formatDateSeparator(value: Date | string | undefined | null, locale?: string, labels?: {
38
- today?: string;
39
- yesterday?: string;
40
- }): string;
package/lib/version.d.ts CHANGED
@@ -2,4 +2,4 @@
2
2
  * Current version of valtech-components.
3
3
  * This is automatically updated during the publish process.
4
4
  */
5
- export declare const VERSION = "4.0.227";
5
+ export declare const VERSION = "4.0.228";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "4.0.227",
3
+ "version": "4.0.228",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"
package/public-api.d.ts CHANGED
@@ -474,12 +474,10 @@ export { ConversationService } from './lib/services/chat/conversation.service';
474
474
  export { provideValtechChat, VALTECH_CHAT_CONFIG } from './lib/services/chat/config';
475
475
  export type { ValtechChatConfig } from './lib/services/chat/config';
476
476
  export * from './lib/services/chat/types';
477
- export { MessageBubbleComponent, type MessageBubbleAction, } from './lib/components/molecules/message-bubble/message-bubble.component';
477
+ export { MessageBubbleComponent } from './lib/components/molecules/message-bubble/message-bubble.component';
478
478
  export * from './lib/components/molecules/message-bubble/types';
479
479
  export { ChatInputComponent } from './lib/components/molecules/chat-input/chat-input.component';
480
480
  export * from './lib/components/molecules/chat-input/types';
481
- export { ChatComposerComponent } from './lib/components/molecules/chat-composer/chat-composer.component';
482
- export { ConversationListItemComponent } from './lib/components/molecules/conversation-list-item/conversation-list-item.component';
483
481
  export { TypingIndicatorComponent } from './lib/components/molecules/typing-indicator/typing-indicator.component';
484
482
  export { ChatWindowComponent } from './lib/components/organisms/chat-window/chat-window.component';
485
483
  export * from './lib/components/organisms/chat-window/types';