@adatechnology/conversations-ui 0.1.0-rc.5 → 0.1.0-rc.7
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/dist/chunk-TGTBMMFC.js +1707 -0
- package/dist/index.d.ts +209 -22
- package/dist/index.js +243 -590
- package/dist/preview/index.d.ts +153 -9
- package/dist/preview/index.js +520 -38
- package/dist/{types-C2Yexi8A.d.ts → types-B5C1DLu1.d.ts} +70 -2
- package/package.json +2 -2
- package/src/Avatar.tsx +13 -2
- package/src/ConversationHeader.tsx +18 -0
- package/src/ConversationListItem.tsx +18 -2
- package/src/DocumentsLibrary.tsx +322 -0
- package/src/EmojiPicker.tsx +69 -55
- package/src/FileIcon.test.ts +46 -1
- package/src/FileIcon.tsx +76 -10
- package/src/InteractiveMessage.tsx +126 -0
- package/src/Lightbox.tsx +18 -3
- package/src/MessageBubble.tsx +31 -4
- package/src/MessageComposer.tsx +36 -5
- package/src/WhatsAppMessageEditor.tsx +28 -4
- package/src/emojiCatalog.test.ts +35 -0
- package/src/emojiCatalog.ts +189 -0
- package/src/index.ts +25 -12
- package/src/lib/createMediaUrlResolver.ts +33 -0
- package/src/preview/AudioRecorderButton.tsx +117 -0
- package/src/preview/ConversationPreview.tsx +184 -15
- package/src/preview/MediaTypesPreview.tsx +87 -0
- package/src/preview/audioRecorderFormat.test.ts +67 -0
- package/src/preview/conversationPreviewFailures.test.ts +64 -0
- package/src/preview/createMockConversationsApi.ts +62 -8
- package/src/preview/createPreviewWebhookClient.ts +28 -1
- package/src/preview/index.ts +16 -2
- package/src/preview/mediaTypeOf.test.ts +15 -0
- package/src/preview/mockDocumentsSearch.test.ts +57 -0
- package/src/preview/previewFileSamples.test.ts +151 -0
- package/src/preview/previewFileSamples.ts +74 -0
- package/src/preview/previewFixtures.ts +140 -8
- package/src/preview/previewMediaSource.test.ts +62 -0
- package/src/preview/previewMediaSource.ts +91 -0
- package/src/providers/types.ts +17 -0
- package/src/settings/WhatsAppCreateTemplateForm.tsx +3 -1
- package/src/types.ts +38 -1
- package/dist/chunk-YWITIIHD.js +0 -728
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { ReactNode, FormEvent } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
export { C as CHANNEL_CAPABILITIES, a as CHANNEL_FILTER_ALL, b as CONVERSATION_CHANNEL, c as ChannelCapabilities, d as ChannelFilter, e as ChannelFilterOption,
|
|
5
|
-
|
|
6
|
-
type ResolveMediaUrl = (message: MessagePayload) => Promise<string | null>;
|
|
7
|
-
interface MediaRendererProps {
|
|
8
|
-
message: MessagePayload;
|
|
9
|
-
onLightbox: (src: string) => void;
|
|
10
|
-
onResolveUrl?: ResolveMediaUrl;
|
|
11
|
-
/** Aplicado no wrapper de cada tipo de mídia — imagem, vídeo, áudio e documento. */
|
|
12
|
-
className?: string;
|
|
13
|
-
}
|
|
14
|
-
declare function MediaRenderer({ message, onLightbox, onResolveUrl, className }: MediaRendererProps): react.JSX.Element | null;
|
|
3
|
+
import { y as MessagePayload, A as ResolveMediaUrl, v as InteractiveSelection, t as InteractivePayload, p as ConversationsFeatures, m as ConversationSummary, h as ConversationChannel, L as ListConversationsParams, o as ConversationsApi, S as SSEProvider, w as ListDocumentsParams, i as ConversationDocument, n as ConversationTemplate } from './types-B5C1DLu1.js';
|
|
4
|
+
export { C as CHANNEL_CAPABILITIES, a as CHANNEL_FILTER_ALL, b as CONVERSATION_CHANNEL, c as ChannelCapabilities, d as ChannelFilter, e as ChannelFilterOption, f as CompanyDocument, g as CompanyDocumentPage, j as ConversationDocumentPage, k as ConversationEventSource, l as ConversationPage, q as ConversationsTheme, r as ConversationsUIConfig, D as DEFAULT_CONVERSATION_CHANNEL, F as FormatContactHandleParams, H as HANDLE_KIND, s as HandleKind, I as InteractiveOption, u as InteractiveSection, M as MediaRenderer, x as MediaRendererProps, R as REOPEN_MECHANISM, z as ReopenMechanism, B as capabilitiesOf, E as channelFiltersFor, G as contactFlag, J as formatContactHandle } from './types-B5C1DLu1.js';
|
|
15
5
|
|
|
16
6
|
interface MessageBubbleProps {
|
|
17
7
|
message: MessagePayload;
|
|
@@ -21,10 +11,32 @@ interface MessageBubbleProps {
|
|
|
21
11
|
isSelecting?: boolean;
|
|
22
12
|
isSelected?: boolean;
|
|
23
13
|
onToggleSelect?: () => void;
|
|
14
|
+
/**
|
|
15
|
+
* Como buscar a mídia da mensagem. Ausente, o balão usa o `ConversationsApi` do
|
|
16
|
+
* `ConversationsProvider` — passe apenas para sobrescrever (cache próprio, CDN, proxy do host).
|
|
17
|
+
*/
|
|
24
18
|
onResolveMediaUrl?: ResolveMediaUrl;
|
|
19
|
+
/**
|
|
20
|
+
* Toque numa opção do menu interativo. Ausente, as opções aparecem desabilitadas — que é o certo
|
|
21
|
+
* no histórico da inbox: o operador vê o que foi oferecido, sem responder no lugar do cliente.
|
|
22
|
+
*/
|
|
23
|
+
onInteractiveSelect?: (selection: InteractiveSelection) => void;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
declare function MessageBubble({ message, isMine, senderName, isFirstInGroup, isSelecting, isSelected, onToggleSelect, onResolveMediaUrl, onInteractiveSelect, className, }: MessageBubbleProps): react.JSX.Element;
|
|
27
|
+
|
|
28
|
+
interface InteractiveMessageLabels {
|
|
29
|
+
/** Fallback do rótulo do botão que abre a lista, quando o payload não traz um. */
|
|
30
|
+
openList: string;
|
|
31
|
+
}
|
|
32
|
+
declare const DEFAULT_INTERACTIVE_MESSAGE_LABELS: InteractiveMessageLabels;
|
|
33
|
+
interface InteractiveMessageProps {
|
|
34
|
+
payload: InteractivePayload;
|
|
35
|
+
onSelect?: (selection: InteractiveSelection) => void;
|
|
36
|
+
labels?: Partial<InteractiveMessageLabels>;
|
|
25
37
|
className?: string;
|
|
26
38
|
}
|
|
27
|
-
declare function
|
|
39
|
+
declare function InteractiveMessage({ payload, onSelect, labels, className }: InteractiveMessageProps): react.JSX.Element;
|
|
28
40
|
|
|
29
41
|
interface ConversationWallpaperProps {
|
|
30
42
|
children?: ReactNode;
|
|
@@ -78,13 +90,50 @@ interface AudioPlayerProps {
|
|
|
78
90
|
}
|
|
79
91
|
declare function AudioPlayer({ src, isMine }: AudioPlayerProps): react.JSX.Element;
|
|
80
92
|
|
|
93
|
+
interface EmojiPickerLabels {
|
|
94
|
+
search: string;
|
|
95
|
+
noResults: string;
|
|
96
|
+
}
|
|
97
|
+
declare const DEFAULT_EMOJI_PICKER_LABELS: EmojiPickerLabels;
|
|
81
98
|
interface EmojiPickerProps {
|
|
82
99
|
onSelect: (emoji: string) => void;
|
|
100
|
+
labels?: Partial<EmojiPickerLabels>;
|
|
83
101
|
className?: string;
|
|
84
102
|
}
|
|
85
|
-
declare const EmojiPicker: ({ onSelect, className }: EmojiPickerProps) => react.JSX.Element;
|
|
103
|
+
declare const EmojiPicker: ({ onSelect, labels, className }: EmojiPickerProps) => react.JSX.Element;
|
|
86
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Catálogo de emojis com palavras-chave em português, usado pela busca do seletor.
|
|
107
|
+
*
|
|
108
|
+
* Fica em módulo próprio (e não dentro do `EmojiPicker`) porque a busca precisa varrer TODAS as
|
|
109
|
+
* categorias, não só a aberta — o índice é montado uma vez, no carregamento, e não a cada tecla.
|
|
110
|
+
*
|
|
111
|
+
* As palavras-chave são de busca, não legendas: incluem sinônimos e formas sem acento, porque quem
|
|
112
|
+
* digita rápido escreve "coracao" e "polegar" com a mesma frequência que a forma correta.
|
|
113
|
+
*/
|
|
114
|
+
type EmojiEntry = {
|
|
115
|
+
readonly emoji: string;
|
|
116
|
+
readonly keywords: readonly string[];
|
|
117
|
+
};
|
|
118
|
+
type EmojiCategory = {
|
|
119
|
+
readonly name: string;
|
|
120
|
+
readonly entries: readonly EmojiEntry[];
|
|
121
|
+
};
|
|
122
|
+
declare const EMOJI_CATEGORIES: readonly EmojiCategory[];
|
|
123
|
+
/**
|
|
124
|
+
* Busca por prefixo de palavra-chave, não por substring: "ca" traz "casa" e "cartão", mas "sa" não
|
|
125
|
+
* traz "casa" — casar no meio da palavra devolvia resultado que ninguém consegue explicar.
|
|
126
|
+
*/
|
|
127
|
+
declare function searchEmojis(query: string): readonly EmojiEntry[];
|
|
128
|
+
|
|
129
|
+
interface MessageComposerLabels {
|
|
130
|
+
emoji: string;
|
|
131
|
+
attach: string;
|
|
132
|
+
send: string;
|
|
133
|
+
}
|
|
134
|
+
declare const DEFAULT_MESSAGE_COMPOSER_LABELS: MessageComposerLabels;
|
|
87
135
|
interface MessageComposerProps {
|
|
136
|
+
labels?: Partial<MessageComposerLabels>;
|
|
88
137
|
onSend: (text: string) => void;
|
|
89
138
|
onAttach?: (file: File) => void;
|
|
90
139
|
value?: string;
|
|
@@ -101,9 +150,28 @@ interface MessageComposerClassNames {
|
|
|
101
150
|
root: string;
|
|
102
151
|
field: string;
|
|
103
152
|
}
|
|
104
|
-
|
|
105
|
-
|
|
153
|
+
/**
|
|
154
|
+
* Exatamente o que a Meta aceita em mensagem de mídia — imagem, sticker, áudio, vídeo e a lista
|
|
155
|
+
* fechada de documentos. Oferecer no seletor um formato que o WhatsApp recusa (`.zip`, `.rtf`)
|
|
156
|
+
* empurra a falha para depois do envio, quando já não dá para explicar ao operador o que houve.
|
|
157
|
+
* Produto com regra própria passa `acceptedFileTypes`.
|
|
158
|
+
*/
|
|
159
|
+
declare const DEFAULT_ACCEPTED_FILE_TYPES: string;
|
|
160
|
+
declare const MessageComposer: ({ onSend, onAttach, value: externalValue, onChange: externalOnChange, features, placeholder, maxLength, disabled, acceptedFileTypes, className, classNames, labels, }: MessageComposerProps) => react.JSX.Element;
|
|
161
|
+
|
|
162
|
+
interface WhatsAppMessageEditorLabels {
|
|
163
|
+
bold: string;
|
|
164
|
+
/** Tooltip da negrito — traz a sintaxe do WhatsApp junto, por isso é separado do `aria-label`. */
|
|
165
|
+
boldHint: string;
|
|
166
|
+
italic: string;
|
|
167
|
+
italicHint: string;
|
|
168
|
+
strikethrough: string;
|
|
169
|
+
strikethroughHint: string;
|
|
170
|
+
insertPlaceholder: (token: string) => string;
|
|
171
|
+
}
|
|
172
|
+
declare const DEFAULT_WHATSAPP_MESSAGE_EDITOR_LABELS: WhatsAppMessageEditorLabels;
|
|
106
173
|
interface WhatsAppMessageEditorProps {
|
|
174
|
+
labels?: Partial<WhatsAppMessageEditorLabels>;
|
|
107
175
|
value: string;
|
|
108
176
|
onChange: (value: string) => void;
|
|
109
177
|
placeholder?: string;
|
|
@@ -112,7 +180,7 @@ interface WhatsAppMessageEditorProps {
|
|
|
112
180
|
previewLabel?: string;
|
|
113
181
|
emptyPreviewText?: string;
|
|
114
182
|
}
|
|
115
|
-
declare function WhatsAppMessageEditor({ value, onChange, placeholder, placeholders, rows, previewLabel, emptyPreviewText, }: WhatsAppMessageEditorProps): react.JSX.Element;
|
|
183
|
+
declare function WhatsAppMessageEditor({ value, onChange, placeholder, placeholders, rows, previewLabel, emptyPreviewText, labels, }: WhatsAppMessageEditorProps): react.JSX.Element;
|
|
116
184
|
|
|
117
185
|
interface SimpleEmojiPickerProps {
|
|
118
186
|
onSelect: (emoji: string) => void;
|
|
@@ -133,16 +201,30 @@ interface DateDividerProps {
|
|
|
133
201
|
}
|
|
134
202
|
declare function DateDivider({ iso, className, classNames }: DateDividerProps): react.JSX.Element;
|
|
135
203
|
|
|
204
|
+
interface AvatarLabels {
|
|
205
|
+
/** Lido por leitor de tela quando não há nome nem imagem — a silhueta genérica. */
|
|
206
|
+
unnamedContact: string;
|
|
207
|
+
}
|
|
136
208
|
interface AvatarProps {
|
|
137
209
|
name?: string | null;
|
|
138
210
|
avatarUrl?: string;
|
|
139
211
|
size?: 'sm' | 'md' | 'lg';
|
|
140
212
|
className?: string;
|
|
213
|
+
labels?: Partial<AvatarLabels>;
|
|
141
214
|
}
|
|
142
|
-
declare
|
|
215
|
+
declare const DEFAULT_AVATAR_LABELS: AvatarLabels;
|
|
216
|
+
declare function Avatar({ name, avatarUrl, size, className, labels }: AvatarProps): react.JSX.Element;
|
|
143
217
|
|
|
218
|
+
interface ConversationListItemLabels {
|
|
219
|
+
/** Tooltip do ponto vermelho: a janela de atendimento de 24h já fechou. */
|
|
220
|
+
expiredWindow: string;
|
|
221
|
+
/** Tooltip do ponto laranja: a janela de atendimento está perto de fechar. */
|
|
222
|
+
warningWindow: string;
|
|
223
|
+
}
|
|
224
|
+
declare const DEFAULT_CONVERSATION_LIST_ITEM_LABELS: ConversationListItemLabels;
|
|
144
225
|
interface ConversationListItemProps {
|
|
145
226
|
conversation: ConversationSummary;
|
|
227
|
+
labels?: Partial<ConversationListItemLabels>;
|
|
146
228
|
active?: boolean;
|
|
147
229
|
selected?: boolean;
|
|
148
230
|
onClick?: () => void;
|
|
@@ -159,7 +241,7 @@ interface ConversationListItemProps {
|
|
|
159
241
|
*/
|
|
160
242
|
highlightActive?: boolean;
|
|
161
243
|
}
|
|
162
|
-
declare const ConversationListItem: ({ conversation, active, selected, onClick, onSelect, showDivider, highlightActive, }: ConversationListItemProps) => react.JSX.Element;
|
|
244
|
+
declare const ConversationListItem: ({ conversation, active, selected, onClick, onSelect, showDivider, highlightActive, labels, }: ConversationListItemProps) => react.JSX.Element;
|
|
163
245
|
|
|
164
246
|
type ToastType = 'success' | 'error' | 'info';
|
|
165
247
|
interface ToastContextValue {
|
|
@@ -179,12 +261,19 @@ interface StatusTicksProps {
|
|
|
179
261
|
}
|
|
180
262
|
declare function StatusTicks({ status, title }: StatusTicksProps): react.JSX.Element;
|
|
181
263
|
|
|
264
|
+
interface LightboxLabels {
|
|
265
|
+
/** Texto alternativo quando a imagem não tem legenda — sem ele o leitor de tela anuncia a URL. */
|
|
266
|
+
imageAlt: string;
|
|
267
|
+
close: string;
|
|
268
|
+
}
|
|
182
269
|
interface LightboxProps {
|
|
183
270
|
imageUrl: string;
|
|
184
271
|
caption?: string;
|
|
185
272
|
onClose: () => void;
|
|
273
|
+
labels?: Partial<LightboxLabels>;
|
|
186
274
|
}
|
|
187
|
-
declare
|
|
275
|
+
declare const DEFAULT_LIGHTBOX_LABELS: LightboxLabels;
|
|
276
|
+
declare function Lightbox({ imageUrl, caption, onClose, labels }: LightboxProps): react.JSX.Element;
|
|
188
277
|
|
|
189
278
|
interface FileIconProps {
|
|
190
279
|
filename?: string;
|
|
@@ -316,6 +405,19 @@ interface ConversationHeaderClassNames {
|
|
|
316
405
|
desktopActions: string;
|
|
317
406
|
mobileMenu: string;
|
|
318
407
|
}
|
|
408
|
+
/**
|
|
409
|
+
* Utilitário extra que o host pendura no cabeçalho — ícone no desktop, item de menu no celular,
|
|
410
|
+
* como os nativos. Entra por aqui, e não por um slot de ReactNode, porque é isso que preserva o
|
|
411
|
+
* comportamento responsivo: um nó solto viraria um quarto ícone em 375px, sem área de toque.
|
|
412
|
+
*/
|
|
413
|
+
interface ConversationHeaderUtility {
|
|
414
|
+
key: string;
|
|
415
|
+
/** Emoji, para casar com os utilitários nativos do cabeçalho. */
|
|
416
|
+
icon: string;
|
|
417
|
+
label: string;
|
|
418
|
+
run: () => void;
|
|
419
|
+
active?: boolean;
|
|
420
|
+
}
|
|
319
421
|
interface ConversationHeaderProps {
|
|
320
422
|
conversation: ConversationSummary;
|
|
321
423
|
busy?: boolean;
|
|
@@ -325,12 +427,14 @@ interface ConversationHeaderProps {
|
|
|
325
427
|
onDownload?: () => void;
|
|
326
428
|
onOpenDocuments?: () => void;
|
|
327
429
|
documentsOpen?: boolean;
|
|
430
|
+
/** Ações do produto que não existem no contrato do pacote (ex.: ferramentas de dev). */
|
|
431
|
+
extraUtilities?: readonly ConversationHeaderUtility[];
|
|
328
432
|
onBack?: () => void;
|
|
329
433
|
labels?: Partial<ConversationHeaderLabels>;
|
|
330
434
|
className?: string;
|
|
331
435
|
classNames?: Partial<ConversationHeaderClassNames>;
|
|
332
436
|
}
|
|
333
|
-
declare function ConversationHeader({ conversation, busy, onTakeover, onReturnToBot, onFinish, onDownload, onOpenDocuments, documentsOpen, onBack, labels: labelsOverride, className, classNames, }: ConversationHeaderProps): react.JSX.Element;
|
|
437
|
+
declare function ConversationHeader({ conversation, busy, onTakeover, onReturnToBot, onFinish, onDownload, onOpenDocuments, documentsOpen, extraUtilities, onBack, labels: labelsOverride, className, classNames, }: ConversationHeaderProps): react.JSX.Element;
|
|
334
438
|
|
|
335
439
|
/**
|
|
336
440
|
* "Suas Seleções": o que o bot já coletou na conversa. Para o atendente que assume no meio, é a
|
|
@@ -382,6 +486,76 @@ declare function WindowExpiredNotice({ onSendTemplate, disabled, labels: labelsO
|
|
|
382
486
|
*/
|
|
383
487
|
declare function isWindowBlocking(window: ConversationWindow): boolean;
|
|
384
488
|
|
|
489
|
+
/**
|
|
490
|
+
* Biblioteca de arquivos de TODAS as conversas — a tela de Documentos do painel, fora do
|
|
491
|
+
* atendimento.
|
|
492
|
+
*
|
|
493
|
+
* Distinta do `ConversationDocumentsPanel`: aquele parte de uma conversa aberta e vive dentro dela;
|
|
494
|
+
* esta varre a empresa e por isso mostra de qual conversa cada arquivo veio, com o número
|
|
495
|
+
* clicável. Sem essa referência, uma lista global de anexos não responde nenhuma pergunta.
|
|
496
|
+
*/
|
|
497
|
+
interface DocumentsLibraryLabels {
|
|
498
|
+
title: string;
|
|
499
|
+
searchPlaceholder: string;
|
|
500
|
+
empty: string;
|
|
501
|
+
noResults: string;
|
|
502
|
+
loading: string;
|
|
503
|
+
failure: string;
|
|
504
|
+
view: string;
|
|
505
|
+
download: string;
|
|
506
|
+
openConversation: string;
|
|
507
|
+
sourceFilterAll: string;
|
|
508
|
+
sourceFilterCustomer: string;
|
|
509
|
+
sourceFilterTeam: string;
|
|
510
|
+
sortMostRecent: string;
|
|
511
|
+
sortOldest: string;
|
|
512
|
+
clearFilters: string;
|
|
513
|
+
total: (count: number) => string;
|
|
514
|
+
page: (current: number, last: number) => string;
|
|
515
|
+
}
|
|
516
|
+
declare const DEFAULT_DOCUMENTS_LIBRARY_LABELS: DocumentsLibraryLabels;
|
|
517
|
+
interface DocumentsLibraryClassNames {
|
|
518
|
+
root: string;
|
|
519
|
+
title: string;
|
|
520
|
+
filters: string;
|
|
521
|
+
search: string;
|
|
522
|
+
sourceSelect: string;
|
|
523
|
+
sortButton: string;
|
|
524
|
+
clearButton: string;
|
|
525
|
+
status: string;
|
|
526
|
+
list: string;
|
|
527
|
+
item: string;
|
|
528
|
+
conversationLink: string;
|
|
529
|
+
filename: string;
|
|
530
|
+
meta: string;
|
|
531
|
+
pagination: string;
|
|
532
|
+
}
|
|
533
|
+
interface DocumentsLibraryProps {
|
|
534
|
+
/** Itens por página. O total vem do servidor. */
|
|
535
|
+
perPage?: number;
|
|
536
|
+
/** Abrir a conversa de origem. Ausente, o número aparece como texto e não como link. */
|
|
537
|
+
onOpenConversation?: (conversationId: string) => void;
|
|
538
|
+
labels?: Partial<DocumentsLibraryLabels>;
|
|
539
|
+
className?: string;
|
|
540
|
+
classNames?: Partial<DocumentsLibraryClassNames>;
|
|
541
|
+
}
|
|
542
|
+
declare function DocumentsLibrary({ perPage, onOpenConversation, labels: labelsOverride, className, classNames, }: DocumentsLibraryProps): react.JSX.Element | null;
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Arquivos trocados na conversa. Sai do transcript e vira lista própria porque anexo é o que o
|
|
546
|
+
* atendente mais precisa reencontrar depois — rolar meses de mensagens para achar um comprovante é
|
|
547
|
+
* o caso que a busca por documento existe para eliminar.
|
|
548
|
+
*
|
|
549
|
+
* Usa `useConversationDocuments`, então funciona com qualquer `ConversationsApi`. Host sem
|
|
550
|
+
* biblioteca de documentos cai no estado vazio, sem quebrar.
|
|
551
|
+
*/
|
|
552
|
+
/** Origens que o filtro oferece. `all` não é origem — é a ausência de filtro. */
|
|
553
|
+
declare const DOCUMENT_SOURCE_FILTER: {
|
|
554
|
+
readonly ALL: "all";
|
|
555
|
+
readonly CUSTOMER: "customer";
|
|
556
|
+
readonly TEAM: "team";
|
|
557
|
+
};
|
|
558
|
+
type DocumentSourceFilter = (typeof DOCUMENT_SOURCE_FILTER)[keyof typeof DOCUMENT_SOURCE_FILTER];
|
|
385
559
|
interface ConversationDocumentsPanelLabels {
|
|
386
560
|
toggle: string;
|
|
387
561
|
title: string;
|
|
@@ -605,6 +779,7 @@ interface WhatsAppCreateTemplateFormLabels {
|
|
|
605
779
|
sectionDescription: string;
|
|
606
780
|
nameLabel: string;
|
|
607
781
|
nameHint: string;
|
|
782
|
+
namePlaceholder: string;
|
|
608
783
|
categoryLabel: string;
|
|
609
784
|
languageLabel: string;
|
|
610
785
|
headerLabel: string;
|
|
@@ -828,4 +1003,16 @@ interface AsyncResourceState<T> {
|
|
|
828
1003
|
refetch: () => Promise<void>;
|
|
829
1004
|
}
|
|
830
1005
|
|
|
831
|
-
|
|
1006
|
+
/**
|
|
1007
|
+
* Resolve a mídia de uma mensagem numa URL exibível, usando só o `ConversationsApi`.
|
|
1008
|
+
*
|
|
1009
|
+
* Mora no pacote, e não em cada host, porque a regra não tem nada de específico de produto: é a
|
|
1010
|
+
* tradução de `uploadId`/`mediaId` pelos dois métodos que o próprio contrato já declara. Deixá-la no
|
|
1011
|
+
* host significava que todo projeto que adotasse o SDK reescreveria as mesmas oito linhas — e, na
|
|
1012
|
+
* prática, ninguém escrevia: o `MediaRenderer` só busca mídia pela porta `onResolveMediaUrl`, então
|
|
1013
|
+
* onde nada era injetado foto, vídeo e áudio ficavam no placeholder para sempre.
|
|
1014
|
+
*/
|
|
1015
|
+
|
|
1016
|
+
declare function createMediaUrlResolver(api: Pick<ConversationsApi, 'getDocumentUrl' | 'getMediaProxyUrl'>): ResolveMediaUrl;
|
|
1017
|
+
|
|
1018
|
+
export { type AsyncResourceState, AudioPlayer, type AudioPlayerProps, Avatar, type AvatarLabels, type AvatarProps, type BuildTranscriptTextParams, CHANNEL_BRAND_COLOR, CONVERSATION_WINDOW, ChannelIcon, type ChannelIconProps, ConversationChannel, type ConversationContextEntry, ConversationContextPanel, type ConversationContextPanelClassNames, type ConversationContextPanelLabels, type ConversationContextPanelProps, ConversationDocument, ConversationDocumentsPanel, type ConversationDocumentsPanelClassNames, type ConversationDocumentsPanelLabels, type ConversationDocumentsPanelProps, ConversationHeader, type ConversationHeaderClassNames, type ConversationHeaderLabels, type ConversationHeaderProps, type ConversationHeaderUtility, ConversationListItem, type ConversationListItemLabels, type ConversationListItemProps, type ConversationLocales, ConversationLocalesProvider, type ConversationLocalesProviderProps, type ConversationRealtimeHandler, ConversationRow, type ConversationRowClassNames, type ConversationRowProps, ConversationSummary, ConversationTemplate, ConversationWallpaper, type ConversationWallpaperProps, type ConversationWindow, ConversationsApi, ConversationsFeatures, ConversationsProvider, DEFAULT_ACCEPTED_FILE_TYPES, DEFAULT_AVATAR_LABELS, DEFAULT_CONVERSATION_CONTEXT_LABELS, DEFAULT_CONVERSATION_DOCUMENTS_LABELS, DEFAULT_CONVERSATION_HEADER_LABELS, DEFAULT_CONVERSATION_LIST_ITEM_LABELS, DEFAULT_DOCUMENTS_LIBRARY_LABELS, DEFAULT_EMOJI_PICKER_LABELS, DEFAULT_INTERACTIVE_MESSAGE_LABELS, DEFAULT_LIGHTBOX_LABELS, DEFAULT_MESSAGE_COMPOSER_LABELS, DEFAULT_TEMPLATES_SETTINGS_LABELS, DEFAULT_WHATSAPP_MESSAGE_EDITOR_LABELS, DEFAULT_WINDOW_EXPIRED_LABELS, DOCUMENT_SOURCE_FILTER, DateDivider, type DateDividerClassNames, type DateDividerProps, type DocumentSourceFilter, DocumentsLibrary, type DocumentsLibraryClassNames, type DocumentsLibraryLabels, type DocumentsLibraryProps, EMOJI_CATEGORIES, type EmojiCategory, type EmojiEntry, EmojiPicker, type EmojiPickerLabels, type EmojiPickerProps, FileIcon, type FileIconProps, InteractiveMessage, type InteractiveMessageLabels, type InteractiveMessageProps, InteractivePayload, InteractiveSelection, Lightbox, type LightboxLabels, type LightboxProps, ListConversationsParams, ListDocumentsParams, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerClassNames, type MessageComposerLabels, type MessageComposerProps, MessagePayload, MessageTail, MessageText, type MessageTextProps, MessageTimestamp, NARROW_MAX_WIDTH_PX, ResolveMediaUrl, SSEProvider, SimpleEmojiPicker, type SimpleEmojiPickerProps, StatusTicks, type StatusTicksProps, TEMPLATE_SETTINGS_TAB, type TemplateSettingsTab, ToastProvider, type TopicItem, TopicsForm, type TopicsFormLabels, type TopicsFormProps, type UseConversationActionsResult, type UseConversationContextResult, type UseConversationDocumentsParams, type UseConversationDocumentsResult, type UseConversationListParams, type UseConversationListResult, type UseConversationMessagesResult, type UseInboxActionsResult, type UseWaitingNotificationsLabels, type UseWaitingNotificationsParams, type UseWaitingNotificationsResult, WINDOW_FILTERS, WelcomeFarewellForm, type WelcomeFarewellFormLabels, type WelcomeFarewellFormProps, WhatsAppCreateTemplateForm, type WhatsAppCreateTemplateFormLabels, type WhatsAppCreateTemplateFormProps, type WhatsAppCreateTemplateResult, type WhatsAppCreateTemplateState, WhatsAppMessageEditor, type WhatsAppMessageEditorLabels, type WhatsAppMessageEditorProps, type WhatsAppTemplateHeaderType, WhatsAppTemplateSettingsForm, type WhatsAppTemplateSettingsFormLabels, type WhatsAppTemplateSettingsFormProps, type WhatsAppTemplateSummary, type WhatsAppTemplateVariableSuggestion, WhatsAppTemplatesSettings, type WhatsAppTemplatesSettingsLabels, type WhatsAppTemplatesSettingsProps, WindowExpiredNotice, type WindowExpiredNoticeLabels, type WindowExpiredNoticeProps, type WindowOfParams, buildTranscriptFilename, buildTranscriptText, createMediaUrlResolver, downloadTextFile, formatDateTime, formatFileSize, formatPhone, formatStalledFor, formatTimestamp, htmlToWA, isSameDay, isWindowBlocking, parseWhatsAppFormatting, phoneInitials, searchEmojis, toast, useConversationActions, useConversationContext, useConversationDocuments, useConversationList, useConversationLocales, useConversationMessages, useConversationRealtime, useConversations, useDarkMode, useGlobalRealtime, useInboxActions, useIsDarkTheme, useIsNarrow, useToast, useWaitingNotifications, waToHTML, waToHTMLInline, windowOf };
|