@adatechnology/conversations-ui 0.1.0-rc.4 → 0.1.0-rc.40
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/ConversationSimulatorPanel--5fIzXWY.d.ts +804 -0
- package/dist/chunk-BJNRLLDO.js +2708 -0
- package/dist/chunk-DKPXKQGC.js +110 -0
- package/dist/{chunk-OGRRHQQW.js → chunk-WCBDXZ3X.js} +68 -4
- package/dist/flows/index.d.ts +422 -5
- package/dist/flows/index.js +2372 -678
- package/dist/index.d.ts +1171 -42
- package/dist/index.js +3755 -843
- package/dist/preview/index.d.ts +157 -42
- package/dist/preview/index.js +772 -191
- package/dist/styles.css +893 -0
- package/package.json +9 -8
- package/src/AudioPlayer.tsx +8 -0
- package/src/AudioRecorderButton.test.tsx +30 -0
- package/src/AudioRecorderButton.tsx +248 -0
- package/src/AudioTranscription.test.tsx +115 -0
- package/src/AudioTranscription.tsx +252 -0
- package/src/Avatar.tsx +14 -3
- package/src/ConversationContextPanel.tsx +218 -44
- package/src/ConversationDocumentsPanel.tsx +347 -24
- package/src/ConversationHeader.test.tsx +66 -0
- package/src/ConversationHeader.tsx +163 -45
- package/src/ConversationListItem.tsx +19 -2
- package/src/ConversationLocalesProvider.tsx +28 -0
- package/src/ConversationRow.tsx +31 -7
- package/src/DarkModeToggle.test.tsx +76 -0
- package/src/DarkModeToggle.tsx +92 -0
- package/src/DocumentsLibrary.tsx +382 -0
- package/src/EmojiPicker.tsx +70 -55
- package/src/FileIcon.test.ts +83 -0
- package/src/FileIcon.tsx +88 -11
- package/src/InteractiveMessage.test.tsx +41 -0
- package/src/InteractiveMessage.tsx +146 -0
- package/src/Lightbox.tsx +18 -3
- package/src/MediaRenderer.tsx +92 -16
- package/src/MessageBubble.test.tsx +41 -0
- package/src/MessageBubble.tsx +75 -6
- package/src/MessageComposer.test.tsx +35 -0
- package/src/MessageComposer.tsx +155 -19
- package/src/RichMessageComposer.test.tsx +113 -0
- package/src/RichMessageComposer.tsx +551 -0
- package/src/SimpleEmojiPicker.tsx +5 -3
- package/src/StatusTicks.tsx +1 -1
- package/src/Toast.tsx +4 -0
- package/src/Tooltip.test.ts +42 -0
- package/src/Tooltip.tsx +167 -0
- package/src/Wallpaper.test.tsx +21 -0
- package/src/Wallpaper.tsx +67 -7
- package/src/WhatsAppMessageEditor.tsx +34 -7
- package/src/WindowExpiredNotice.tsx +12 -4
- package/src/audioRecorderFormat.test.ts +67 -0
- package/src/buildOutput.test.ts +79 -0
- package/src/composer.constant.ts +33 -0
- package/src/conversationTranscript.test.ts +57 -0
- package/src/conversationTranscript.ts +29 -4
- package/src/conversationWindow.ts +7 -5
- package/src/documentTypeLabel.test.ts +57 -0
- package/src/documents/DocumentsWorkspace.tsx +550 -0
- package/src/documents/index.ts +8 -0
- package/src/documents/labels.ts +92 -0
- package/src/emojiCatalog.test.ts +35 -0
- package/src/emojiCatalog.ts +189 -0
- package/src/flows/FlowConnectionEdge.tsx +104 -0
- package/src/flows/FlowGroupHeader.tsx +12 -2
- package/src/flows/FlowLegend.tsx +125 -0
- package/src/flows/FlowMapCanvas.tsx +15 -12
- package/src/flows/FlowMapNode.tsx +4 -1
- package/src/flows/FlowNodeCard.tsx +219 -34
- package/src/flows/FlowNodePanel.tsx +153 -39
- package/src/flows/FlowPalette.tsx +106 -69
- package/src/flows/FlowPortalNode.tsx +1 -1
- package/src/flows/FlowWhatsAppPreview.tsx +14 -3
- package/src/flows/FlowsWorkspace.tsx +1193 -0
- package/src/flows/flowCanvasModel.test.ts +456 -0
- package/src/flows/flowCanvasModel.ts +378 -0
- package/src/flows/flowEditorOps.test.ts +276 -0
- package/src/flows/flowEditorOps.ts +202 -0
- package/src/flows/flowGraph.ts +78 -53
- package/src/flows/index.ts +51 -2
- package/src/flows/labels.ts +180 -0
- package/src/flows/workspaceContract.test.ts +95 -0
- package/src/hooks/useContainerWidth.ts +35 -0
- package/src/hooks/useConversationActions.ts +56 -0
- package/src/hooks/useConversationDocuments.ts +11 -7
- package/src/hooks/useConversationList.ts +15 -9
- package/src/hooks/useConversationMessages.ts +2 -2
- package/src/hooks/useConversationRealtime.ts +10 -8
- package/src/hooks/useScrollToLatestMessage.ts +127 -0
- package/src/hooks/useUrlFilterState.ts +107 -0
- package/src/icon.constant.ts +12 -0
- package/src/index.ts +129 -13
- package/src/lib/cn.test.ts +29 -0
- package/src/lib/composer-formatting.test.ts +78 -0
- package/src/lib/composer-formatting.ts +145 -0
- package/src/lib/createMediaUrlResolver.ts +33 -0
- package/src/lib/paginated.test.ts +33 -0
- package/src/lib/paginated.ts +26 -0
- package/src/lib/whatsapp-formatting.test.tsx +37 -0
- package/src/lib/whatsapp-formatting.tsx +28 -3
- package/src/listing/index.tsx +202 -0
- package/src/pagination.constant.ts +10 -0
- package/src/preview/ConversationPreview.tsx +225 -17
- package/src/preview/ConversationSimulatorClient.ts +143 -0
- package/src/preview/ConversationSimulatorPanel.test.tsx +55 -0
- package/src/preview/ConversationSimulatorPanel.tsx +131 -0
- package/src/preview/MediaTypesPreview.tsx +87 -0
- package/src/preview/conversationPreviewFailures.test.ts +64 -0
- package/src/preview/createMockConversationsApi.ts +175 -15
- package/src/preview/createPreviewBridgeClient.test.ts +92 -0
- package/src/preview/createPreviewBridgeClient.ts +124 -0
- package/src/preview/createPreviewMediaUploader.ts +82 -0
- package/src/preview/createPreviewWebhookClient.test.ts +96 -0
- package/src/preview/createPreviewWebhookClient.ts +127 -4
- package/src/preview/index.ts +51 -3
- package/src/preview/mediaTypeOf.test.ts +15 -0
- package/src/preview/mockDocumentsSearch.test.ts +57 -0
- package/src/preview/preview.test.ts +5 -3
- package/src/preview/previewFileSamples.test.ts +151 -0
- package/src/preview/previewFileSamples.ts +74 -0
- package/src/preview/previewFixtures.ts +288 -1
- package/src/preview/previewMediaSource.test.ts +62 -0
- package/src/preview/previewMediaSource.ts +91 -0
- package/src/preview/previewMediaUploader.test.ts +61 -0
- package/src/providers/ConversationsProvider.tsx +8 -6
- package/src/providers/types.ts +185 -10
- package/src/quickReply.test.ts +58 -0
- package/src/settings/MessagesWorkspace.tsx +571 -0
- package/src/settings/TopicsForm.tsx +2 -0
- package/src/settings/TranscriptionSettingsForm.test.tsx +81 -0
- package/src/settings/TranscriptionSettingsForm.tsx +190 -0
- package/src/settings/WelcomeFarewellForm.tsx +1 -0
- package/src/settings/WhatsAppCreateTemplateForm.tsx +4 -1
- package/src/settings/WhatsAppTemplateSettingsForm.tsx +5 -2
- package/src/settings/WhatsAppTemplatesSettings.test.tsx +61 -0
- package/src/settings/WhatsAppTemplatesSettings.tsx +22 -2
- package/src/styles.css +858 -0
- package/src/types.ts +64 -1
- package/src/useWaitingNotifications.ts +74 -29
- package/src/workspace/BulkTemplateModal.tsx +132 -0
- package/src/workspace/ConversationPane.tsx +432 -0
- package/src/workspace/ConversationsInboxList.tsx +194 -0
- package/src/workspace/ConversationsWorkspace.tsx +423 -0
- package/src/workspace/index.ts +17 -0
- package/src/workspace/labels.test.ts +17 -0
- package/src/workspace/labels.ts +85 -0
- package/src/workspace/useConversationsInbox.ts +332 -0
- package/dist/chunk-4R6Y43DQ.js +0 -726
- package/dist/chunk-NV2RZ5KT.js +0 -56
- package/dist/types-C0PtaO7S.d.ts +0 -207
package/dist/preview/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { U as MessagePayload, u as ConversationSummary, m as ConversationEventSource, w as ConversationsApi, Q as ListConversationsParams, n as ConversationPage, a5 as SSEProvider, k as ConversationDocument, a6 as SendPreviewMediaParams, Z as PreviewUploadedMedia, $ as PreviewWebhookClient, a3 as ResolveMediaUrl } from '../ConversationSimulatorPanel--5fIzXWY.js';
|
|
2
|
+
export { A as AudioRecorderButton, a as AudioRecorderButtonLabels, b as AudioRecorderButtonProps, o as ConversationPreview, p as ConversationPreviewProps, q as ConversationSimulatorClient, r as ConversationSimulatorPanel, s as ConversationSimulatorPanelLabels, t as ConversationSimulatorPanelProps, B as CreatePreviewMediaUploaderParams, D as CreatePreviewWebhookClientParams, E as DEFAULT_AUDIO_RECORDER_BUTTON_LABELS, G as DEFAULT_CONVERSATION_SIMULATOR_PANEL_LABELS, I as DEFAULT_MEDIA_UPLOAD_PATH, W as PreviewInProductionError, X as PreviewMediaUploadRejectedError, Y as PreviewMediaUploadRequest, _ as PreviewUploadedMedia, a0 as PreviewWebhookRejectedError, a4 as SIMULATOR_FILE_MEDIA_KINDS, a7 as SendSimulatorMediaParams, a8 as SimulatorMediaKind, a9 as ToSimulatorClientParams, ac as acceptsMediaKind, ad as assertPreviewEnvironment, ah as createPreviewMediaPoster, ai as createPreviewMediaUploader, aj as createPreviewWebhookClient, al as isConversationSimulatorClient, am as mediaKindOf, an as mediaTypeOf, ao as signPreviewPayload, ap as simulatorPanelLabelsOf, aq as toConversationSimulatorClient } from '../ConversationSimulatorPanel--5fIzXWY.js';
|
|
3
3
|
import { InteractiveReplyOption } from '@adatechnology/meta-whatsapp-contracts/testing';
|
|
4
|
+
import * as react from 'react';
|
|
5
|
+
export { PREVIEW_MEDIA_ID_PREFIX } from '@adatechnology/meta-whatsapp-contracts';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* Estado em memória que alimenta o preview de atendimento humano. Mock de API e mock de SSE
|
|
@@ -81,7 +83,15 @@ type CreateMockConversationsApiParams = {
|
|
|
81
83
|
readonly latencyMs?: number;
|
|
82
84
|
readonly agentName?: string;
|
|
83
85
|
};
|
|
84
|
-
|
|
86
|
+
/**
|
|
87
|
+
* O mock satisfaz `ConversationsApi`, mas com o retorno de `fetchConversations` ESTREITADO para a
|
|
88
|
+
* forma paginada. Sem isto o contrato — que aceita array ou página — obrigaria todo consumidor do
|
|
89
|
+
* preview a desempacotar uma união que aqui nunca varia.
|
|
90
|
+
*/
|
|
91
|
+
type MockConversationsApi = Omit<ConversationsApi, 'fetchConversations'> & {
|
|
92
|
+
fetchConversations(params?: ListConversationsParams): Promise<ConversationPage>;
|
|
93
|
+
};
|
|
94
|
+
declare function createMockConversationsApi(params: CreateMockConversationsApiParams): MockConversationsApi;
|
|
85
95
|
|
|
86
96
|
/**
|
|
87
97
|
* `SSEProvider` servido pelo store em memória. Mesmo mapeamento de canal do servidor
|
|
@@ -101,55 +111,80 @@ declare function createMockSSEProvider(params: CreateMockSSEProviderParams): SSE
|
|
|
101
111
|
|
|
102
112
|
declare const PREVIEW_CONVERSATIONS: readonly ConversationSummary[];
|
|
103
113
|
declare const PREVIEW_MESSAGES: Readonly<Record<string, readonly MessagePayload[]>>;
|
|
114
|
+
declare const PREVIEW_DOCUMENTS: Readonly<Record<string, readonly ConversationDocument[]>>;
|
|
104
115
|
|
|
105
116
|
/**
|
|
106
|
-
* Cliente que
|
|
107
|
-
*
|
|
108
|
-
*
|
|
117
|
+
* Cliente do preview que NÃO carrega segredo: em vez de montar e assinar o payload da Meta no
|
|
118
|
+
* navegador, manda um comando semântico (`{ kind: 'text', text }`) para uma rota do próprio host,
|
|
119
|
+
* autenticada pela sessão que o painel já tem. Quem monta o payload e assina é o servidor, com o
|
|
120
|
+
* app secret que nunca sai de lá.
|
|
109
121
|
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
122
|
+
* Por que esta fábrica existe ao lado de `createPreviewWebhookClient`: assinar no navegador exige o
|
|
123
|
+
* app secret dentro do bundle, e bundle é público por definição — em qualquer ambiente com URL
|
|
124
|
+
* acessível isso é o mesmo que publicar o segredo. Com o segredo vazado, qualquer um forja webhooks
|
|
125
|
+
* válidos daquele app: injeta mensagens de qualquer número e dispara os fluxos. `createPreviewWebhook
|
|
126
|
+
* Client` continua servindo para execução puramente local (docker de dev, onde o bundle não é
|
|
127
|
+
* servido para ninguém); para qualquer ambiente publicado, a ponte é o caminho.
|
|
112
128
|
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
* mas o hábito de embarcar segredo em frontend não é.
|
|
129
|
+
* O pacote não decide autenticação: o host injeta `sendCommand` (ou `headers` + `fetchImplementation`),
|
|
130
|
+
* porque token, cookie e cabeçalho de sessão são do produto, não da biblioteca.
|
|
116
131
|
*/
|
|
117
132
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
readonly webhookUrl: string;
|
|
126
|
-
readonly appSecret: string;
|
|
133
|
+
/**
|
|
134
|
+
* Comando semântico entregue ao host. É deliberadamente o QUE o cliente fez, não o payload da Meta:
|
|
135
|
+
* se o navegador mandasse o payload pronto, a rota viraria um injetor de webhook arbitrário para
|
|
136
|
+
* quem tivesse sessão. Mandando a intenção, o servidor é quem escolhe a forma.
|
|
137
|
+
*/
|
|
138
|
+
type PreviewInboundCommand = {
|
|
139
|
+
readonly kind: 'text';
|
|
127
140
|
readonly from: string;
|
|
128
|
-
readonly
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
141
|
+
readonly text: string;
|
|
142
|
+
} | {
|
|
143
|
+
readonly kind: 'buttonReply';
|
|
144
|
+
readonly from: string;
|
|
145
|
+
readonly reply: InteractiveReplyOption;
|
|
146
|
+
} | {
|
|
147
|
+
readonly kind: 'listReply';
|
|
148
|
+
readonly from: string;
|
|
149
|
+
readonly reply: InteractiveReplyOption;
|
|
150
|
+
} | {
|
|
151
|
+
readonly kind: 'audio';
|
|
152
|
+
readonly from: string;
|
|
153
|
+
readonly mediaId: string;
|
|
154
|
+
} | ({
|
|
155
|
+
readonly kind: 'media';
|
|
156
|
+
readonly from: string;
|
|
157
|
+
} & SendPreviewMediaParams);
|
|
158
|
+
type SendPreviewInboundCommand = (command: PreviewInboundCommand) => Promise<void>;
|
|
159
|
+
declare class PreviewBridgeRejectedError extends Error {
|
|
135
160
|
readonly status: number;
|
|
136
161
|
constructor(status: number);
|
|
137
162
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
163
|
+
type CreatePreviewBridgeClientParams = {
|
|
164
|
+
readonly from: string;
|
|
165
|
+
/**
|
|
166
|
+
* Entrega o comando. Use quando o host já tem um cliente HTTP com sessão, interceptors e refresh
|
|
167
|
+
* de token — reimplementar isso aqui só duplicaria a autenticação do produto.
|
|
168
|
+
*/
|
|
169
|
+
readonly sendCommand?: SendPreviewInboundCommand;
|
|
170
|
+
/** Alternativa a `sendCommand` para hosts sem cliente HTTP próprio. */
|
|
171
|
+
readonly endpointUrl?: string;
|
|
172
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
173
|
+
readonly fetchImplementation?: typeof fetch;
|
|
174
|
+
/**
|
|
175
|
+
* Rota que guarda o áudio gravado. Por padrão, `/v1/preview/media` na origem do `endpointUrl`.
|
|
176
|
+
*
|
|
177
|
+
* Aqui não há assinatura a calcular: a ponte existe justamente para não ter segredo no navegador,
|
|
178
|
+
* e a rota é protegida pela sessão do painel — os mesmos `headers` do comando valem para o upload.
|
|
179
|
+
*/
|
|
180
|
+
readonly mediaUploadUrl?: string;
|
|
181
|
+
/**
|
|
182
|
+
* Substitui o upload embutido. Necessário para host que só passa `sendCommand`: sem `endpointUrl`
|
|
183
|
+
* não há origem a derivar, e sem destino o gravador não é desenhado.
|
|
184
|
+
*/
|
|
185
|
+
readonly uploadMedia?: (file: File) => Promise<PreviewUploadedMedia>;
|
|
151
186
|
};
|
|
152
|
-
declare function
|
|
187
|
+
declare function createPreviewBridgeClient(params: CreatePreviewBridgeClientParams): PreviewWebhookClient;
|
|
153
188
|
|
|
154
189
|
/**
|
|
155
190
|
* Roteiro que mantém o preview vivo: sem tráfego chegando, a inbox é uma tela estática e as
|
|
@@ -169,4 +204,84 @@ type StartPreviewScriptParams = {
|
|
|
169
204
|
};
|
|
170
205
|
declare function startPreviewScript(params: StartPreviewScriptParams): () => void;
|
|
171
206
|
|
|
172
|
-
|
|
207
|
+
/**
|
|
208
|
+
* Bytes de verdade para o preview abrir.
|
|
209
|
+
*
|
|
210
|
+
* O mock antes devolvia a MESMA imagem PNG para qualquer documento, então clicar em "visualizar" num
|
|
211
|
+
* PDF entregava um PNG rotulado `application/pdf` e o leitor dizia que o arquivo era inválido. Cada
|
|
212
|
+
* amostra aqui é um arquivo mínimo porém legítimo do seu tipo: as de mídia foram geradas com ffmpeg
|
|
213
|
+
* e conferidas com ffprobe, o PDF tem xref/startxref/%%EOF, e os pacotes Office são zips com as
|
|
214
|
+
* partes obrigatórias (`[Content_Types].xml`, `_rels/.rels`, o documento).
|
|
215
|
+
*
|
|
216
|
+
* Não há amostra de `audio/amr`, `video/3gp` nem dos formatos binários legados do Office
|
|
217
|
+
* (`application/msword`, `application/vnd.ms-excel`, `application/vnd.ms-powerpoint`): não há
|
|
218
|
+
* encoder para eles nesta máquina e forjar OLE2 à mão daria arquivo corrompido — exatamente o que
|
|
219
|
+
* este módulo existe para evitar. Esses caem no texto explicativo de `resolvePreviewFileSample`,
|
|
220
|
+
* que abre sem erro e diz o que é.
|
|
221
|
+
*
|
|
222
|
+
* GERADO — não editar à mão.
|
|
223
|
+
*/
|
|
224
|
+
declare const PREVIEW_FILE_SAMPLES: Readonly<Record<string, string>>;
|
|
225
|
+
/**
|
|
226
|
+
* A data URL que o preview abre para um documento.
|
|
227
|
+
*
|
|
228
|
+
* Ordem: tipo exato → família (`audio/amr` toca como mp3, `video/3gp` como mp4) → nota em texto.
|
|
229
|
+
* A nota fecha o caso dos tipos sem amostra: abre num leitor de texto e explica, em vez de baixar
|
|
230
|
+
* um binário quebrado com extensão de Word.
|
|
231
|
+
*/
|
|
232
|
+
declare function resolvePreviewFileSample(mimeType: string | undefined, filename?: string): string;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Como o preview entrega mídia para a UI abrir.
|
|
236
|
+
*
|
|
237
|
+
* Separado de `previewFileSamples` (que é gerado) porque aqui está a parte que depende do navegador:
|
|
238
|
+
* **blob URL, não data URL**. O Chrome bloqueia navegação de topo para `data:` desde a v60, então
|
|
239
|
+
* `window.open(dataUrl)` — que é o que os botões "visualizar" e "baixar" fazem — abre aba em branco
|
|
240
|
+
* mesmo com bytes perfeitamente válidos. Em `src` de `<img>`/`<video>` a data URL funcionaria; no
|
|
241
|
+
* `window.open` não, e o mesmo `getDocumentUrl` alimenta os dois.
|
|
242
|
+
*/
|
|
243
|
+
|
|
244
|
+
/** URL que o preview pode abrir em aba nova. Cai na data URL fora do navegador (teste, SSR). */
|
|
245
|
+
declare function previewFileUrl(mimeType: string | undefined, filename?: string): string;
|
|
246
|
+
/**
|
|
247
|
+
* A mesma amostra em base64 cru, como o proxy de mídia do backend a devolveria.
|
|
248
|
+
*
|
|
249
|
+
* Existe porque `getMediaProxyUrl` é o caminho da mídia AINDA NÃO ingerida (só existe o id na Meta),
|
|
250
|
+
* e o contrato pede `{ mimeType, data }` — não URL. Sem isto o mock devolvia o PNG 1x1 para
|
|
251
|
+
* qualquer id, e vídeo e áudio da thread apareciam quebrados apesar de haver amostra válida.
|
|
252
|
+
*/
|
|
253
|
+
declare function previewFileBase64(mimeType: string | undefined, filename?: string): {
|
|
254
|
+
mimeType: string;
|
|
255
|
+
data: string;
|
|
256
|
+
};
|
|
257
|
+
/**
|
|
258
|
+
* O `onResolveMediaUrl` que o `MessageBubble` espera.
|
|
259
|
+
*
|
|
260
|
+
* Sem ele, foto, vídeo e áudio da thread ficam parados no placeholder para sempre — o
|
|
261
|
+
* `MediaRenderer` só resolve `uploadId`/`mediaId` por esta porta, de propósito, para o pacote nunca
|
|
262
|
+
* chamar endpoint fixo. O preview não tinha resolvedor nenhum, então nenhuma mídia carregava.
|
|
263
|
+
*/
|
|
264
|
+
declare function createPreviewMediaResolver(): ResolveMediaUrl;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Bancada de teste manual de mídia — montável em uma linha por qualquer projeto que adote o SDK.
|
|
268
|
+
*
|
|
269
|
+
* Existe porque o defeito que ela pega não é pegável por teste automatizado: "o PDF abre?" depende
|
|
270
|
+
* do leitor do navegador, "o vídeo toca?" do decodificador, e "a aba abre?" da política do Chrome
|
|
271
|
+
* sobre `data:` URL. Teste unitário confere bytes; só o olho confere que o arquivo abre. Sem uma
|
|
272
|
+
* superfície pronta no pacote, cada projeto teria de montar a sua — e, na prática, nenhum montava.
|
|
273
|
+
*
|
|
274
|
+
* Traz o próprio store, o próprio mock e o próprio provider: o host não injeta nada. E não passa
|
|
275
|
+
* `onResolveMediaUrl` em lugar nenhum de propósito — é o `MessageBubble` resolvendo mídia pelo
|
|
276
|
+
* `ConversationsApi` do contexto, então se essa resolução automática quebrar, esta tela mostra.
|
|
277
|
+
*/
|
|
278
|
+
/** A conversa do fixture que carrega uma mensagem de cada tipo aceito. */
|
|
279
|
+
declare const MEDIA_TYPES_CONVERSATION_ID = "5511944443333";
|
|
280
|
+
type MediaTypesPreviewProps = {
|
|
281
|
+
/** Outra conversa do fixture, se o projeto tiver acrescentado a sua. */
|
|
282
|
+
conversationId?: string;
|
|
283
|
+
className?: string;
|
|
284
|
+
};
|
|
285
|
+
declare function MediaTypesPreview({ conversationId, className, }: MediaTypesPreviewProps): react.JSX.Element;
|
|
286
|
+
|
|
287
|
+
export { type AppendMessageParams, type CreateMockConversationsApiParams, type CreateMockSSEProviderParams, type CreatePreviewBridgeClientParams, type CreatePreviewStoreParams, DEFAULT_PREVIEW_SCRIPT, GLOBAL_CHANNEL, type ListConversationsFilters, MEDIA_TYPES_CONVERSATION_ID, MediaTypesPreview, type MediaTypesPreviewProps, type MockEventSource, PREVIEW_CONVERSATIONS, PREVIEW_DOCUMENTS, PREVIEW_FILE_SAMPLES, PREVIEW_MESSAGES, PreviewBridgeRejectedError, type PreviewEmission, type PreviewInboundCommand, type PreviewScriptStep, type PreviewStore, type PreviewStoreListener, PreviewWebhookClient, type SendPreviewInboundCommand, SendPreviewMediaParams, type SetModeParams, type StartPreviewScriptParams, conversationChannel, createMockConversationsApi, createMockEventSource, createMockSSEProvider, createPreviewBridgeClient, createPreviewMediaResolver, createPreviewStore, previewFileBase64, previewFileUrl, resolvePreviewFileSample, startPreviewScript };
|