valtech-components 4.0.231 → 4.0.233
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 +276 -104
- package/esm2022/lib/components/molecules/message-bubble/message-bubble.component.mjs +19 -4
- package/esm2022/lib/components/organisms/chat-window/chat-window.component.mjs +2 -2
- package/esm2022/lib/services/chat/conversation.service.mjs +15 -4
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +308 -110
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/molecules/chat-composer/chat-composer.component.d.ts +36 -13
- package/lib/components/molecules/message-bubble/message-bubble.component.d.ts +1 -0
- package/lib/services/chat/conversation.service.d.ts +5 -3
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,28 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
1
2
|
import { MessageReplyTo } from '../../../services/chat/types';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
interface PendingAttachment {
|
|
5
|
+
id: number;
|
|
6
|
+
file: File;
|
|
7
|
+
url?: string;
|
|
8
|
+
isImage: boolean;
|
|
9
|
+
}
|
|
3
10
|
/**
|
|
4
11
|
* val-chat-composer — barra de redacción de chat moderna (signal inputs).
|
|
5
12
|
*
|
|
6
|
-
* Pill con: adjuntar (+), textarea auto-grow,
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
13
|
+
* Pill con: adjuntar (+), textarea auto-grow, y mic/enviar (mic cuando está vacío,
|
|
14
|
+
* enviar cuando hay texto o adjuntos). Los adjuntos (botón + / pegar imagen) se
|
|
15
|
+
* acumulan como PREVIEW (miniaturas) y se emiten por `(attach)` recién al ENVIAR
|
|
16
|
+
* — no se van solos al chat. Audio grabado se emite directo al parar.
|
|
17
|
+
* No incluye picker de emoji: el teclado del sistema ya lo trae.
|
|
10
18
|
*/
|
|
11
|
-
export declare class ChatComposerComponent {
|
|
19
|
+
export declare class ChatComposerComponent implements OnDestroy {
|
|
12
20
|
private i18n;
|
|
13
21
|
readonly placeholder: import("@angular/core").InputSignal<string>;
|
|
14
22
|
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
15
23
|
readonly maxLength: import("@angular/core").InputSignal<number>;
|
|
16
24
|
readonly replyingTo: import("@angular/core").InputSignal<MessageReplyTo>;
|
|
17
25
|
readonly showAttach: import("@angular/core").InputSignal<boolean>;
|
|
18
|
-
readonly showEmoji: import("@angular/core").InputSignal<boolean>;
|
|
19
26
|
readonly showMic: import("@angular/core").InputSignal<boolean>;
|
|
20
27
|
readonly send: import("@angular/core").OutputEmitterRef<string>;
|
|
21
28
|
readonly typing: import("@angular/core").OutputEmitterRef<void>;
|
|
@@ -23,8 +30,15 @@ export declare class ChatComposerComponent {
|
|
|
23
30
|
readonly voice: import("@angular/core").OutputEmitterRef<void>;
|
|
24
31
|
readonly cancelReply: import("@angular/core").OutputEmitterRef<void>;
|
|
25
32
|
protected readonly body: import("@angular/core").WritableSignal<string>;
|
|
26
|
-
protected readonly
|
|
27
|
-
|
|
33
|
+
protected readonly pending: import("@angular/core").WritableSignal<PendingAttachment[]>;
|
|
34
|
+
private pendingId;
|
|
35
|
+
protected readonly recording: import("@angular/core").WritableSignal<boolean>;
|
|
36
|
+
private readonly recSeconds;
|
|
37
|
+
private recorder?;
|
|
38
|
+
private recStream?;
|
|
39
|
+
private recChunks;
|
|
40
|
+
private recTimer?;
|
|
41
|
+
protected readonly recTimeLabel: import("@angular/core").Signal<string>;
|
|
28
42
|
private lastTypingEmit;
|
|
29
43
|
constructor();
|
|
30
44
|
protected readonly canSend: import("@angular/core").Signal<boolean>;
|
|
@@ -32,15 +46,24 @@ export declare class ChatComposerComponent {
|
|
|
32
46
|
protected onInput(event: Event): void;
|
|
33
47
|
protected onKeydown(event: KeyboardEvent): void;
|
|
34
48
|
protected onSend(): void;
|
|
35
|
-
protected toggleEmoji(): void;
|
|
36
|
-
protected insertEmoji(emoji: string): void;
|
|
37
49
|
protected onFile(event: Event): void;
|
|
50
|
+
/** Pegar imagen desde el portapapeles (captura de pantalla, copiar imagen). */
|
|
51
|
+
protected onPaste(event: ClipboardEvent): void;
|
|
52
|
+
private addPending;
|
|
53
|
+
protected removePending(id: number): void;
|
|
38
54
|
/**
|
|
39
|
-
* Emite typing como máximo 1 vez cada 2s.
|
|
40
|
-
* de workflow; aquí estamos en runtime de navegador, performance.now es seguro.
|
|
55
|
+
* Emite typing como máximo 1 vez cada 2s. performance.now es seguro en runtime.
|
|
41
56
|
*/
|
|
42
57
|
private emitTypingDebounced;
|
|
58
|
+
/** Selecciona un mimeType de audio soportado por el navegador. */
|
|
59
|
+
private pickAudioMime;
|
|
60
|
+
protected startRecording(): Promise<void>;
|
|
61
|
+
protected stopAndSend(): void;
|
|
62
|
+
protected cancelRecording(): void;
|
|
63
|
+
private cleanupRecording;
|
|
64
|
+
ngOnDestroy(): void;
|
|
43
65
|
t(key: string): string;
|
|
44
66
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatComposerComponent, never>;
|
|
45
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ChatComposerComponent, "val-chat-composer", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "replyingTo": { "alias": "replyingTo"; "required": false; "isSignal": true; }; "showAttach": { "alias": "showAttach"; "required": false; "isSignal": true; }; "
|
|
67
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ChatComposerComponent, "val-chat-composer", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "replyingTo": { "alias": "replyingTo"; "required": false; "isSignal": true; }; "showAttach": { "alias": "showAttach"; "required": false; "isSignal": true; }; "showMic": { "alias": "showMic"; "required": false; "isSignal": true; }; }, { "send": "send"; "typing": "typing"; "attach": "attach"; "voice": "voice"; "cancelReply": "cancelReply"; }, never, never, true, never>;
|
|
46
68
|
}
|
|
69
|
+
export {};
|
|
@@ -31,6 +31,7 @@ export declare class MessageBubbleComponent {
|
|
|
31
31
|
protected readonly time: import("@angular/core").Signal<string>;
|
|
32
32
|
protected readonly initials: import("@angular/core").Signal<string>;
|
|
33
33
|
protected readonly imageAttachments: import("@angular/core").Signal<import("valtech-components").MessageAttachment[]>;
|
|
34
|
+
protected readonly audioAttachments: import("@angular/core").Signal<import("valtech-components").MessageAttachment[]>;
|
|
34
35
|
protected readonly fileAttachments: import("@angular/core").Signal<import("valtech-components").MessageAttachment[]>;
|
|
35
36
|
protected readonly statusIcon: import("@angular/core").Signal<"time-outline" | "alert-circle" | "checkmark-done" | "checkmark">;
|
|
36
37
|
protected toggleActions(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { Conversation, ConversationType, CreateConversationRequest, ListConversationsResponse, Message, UpdateConversationRequest } from './types';
|
|
2
|
+
import { Conversation, ConversationType, CreateConversationRequest, ListConversationsResponse, Message, MessageAttachment, UpdateConversationRequest } from './types';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
/**
|
|
5
5
|
* ConversationService
|
|
@@ -75,9 +75,11 @@ export declare class ConversationService {
|
|
|
75
75
|
*/
|
|
76
76
|
removeParticipant(convId: string, userId: string): Observable<void>;
|
|
77
77
|
/**
|
|
78
|
-
* Envia un mensaje a una conversacion.
|
|
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.
|
|
79
81
|
*/
|
|
80
|
-
sendMessage(convId: string, body: string): Observable<Message>;
|
|
82
|
+
sendMessage(convId: string, body: string, attachments?: MessageAttachment[]): Observable<Message>;
|
|
81
83
|
/**
|
|
82
84
|
* Elimina (marca como eliminado) un mensaje.
|
|
83
85
|
*/
|
package/lib/version.d.ts
CHANGED