@react-lgpd-consent/core 0.7.1 → 0.7.2
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/CHANGELOG.md +33 -1
- package/dist/index.cjs +577 -337
- package/dist/index.d.cts +1220 -1073
- package/dist/index.d.ts +1220 -1073
- package/dist/index.js +577 -338
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Nível de severidade para mensagens de orientação ao desenvolvedor.
|
|
6
|
+
* @category Types
|
|
7
|
+
* @since 0.4.0
|
|
8
|
+
*/
|
|
4
9
|
type GuidanceSeverity = 'info' | 'warning' | 'error';
|
|
10
|
+
/**
|
|
11
|
+
* Representa uma mensagem de orientação para o desenvolvedor.
|
|
12
|
+
* @category Types
|
|
13
|
+
* @since 0.4.0
|
|
14
|
+
* @example
|
|
15
|
+
* { severity: 'warning', message: 'Configuração ausente', category: 'configuration', actionable: true }
|
|
16
|
+
*/
|
|
5
17
|
interface GuidanceMessage {
|
|
18
|
+
/** Nível de severidade da mensagem */
|
|
6
19
|
severity: GuidanceSeverity;
|
|
20
|
+
/** Texto da mensagem */
|
|
7
21
|
message: string;
|
|
22
|
+
/** Categoria relacionada à mensagem */
|
|
8
23
|
category?: string;
|
|
24
|
+
/** Indica se há ação recomendada */
|
|
9
25
|
actionable?: boolean;
|
|
10
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Configuração para controle de exibição de mensagens de orientação.
|
|
29
|
+
* @category Types
|
|
30
|
+
* @since 0.4.0
|
|
31
|
+
*/
|
|
11
32
|
interface GuidanceConfig {
|
|
12
33
|
/** Controla se avisos devem ser exibidos */
|
|
13
34
|
showWarnings?: boolean;
|
|
@@ -24,10 +45,19 @@ interface GuidanceConfig {
|
|
|
24
45
|
/** Callback personalizado para processar mensagens */
|
|
25
46
|
messageProcessor?: (messages: GuidanceMessage[]) => void;
|
|
26
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Resultado da análise de configuração LGPD para orientação do desenvolvedor.
|
|
50
|
+
* @category Types
|
|
51
|
+
* @since 0.4.0
|
|
52
|
+
*/
|
|
27
53
|
interface DeveloperGuidance {
|
|
54
|
+
/** Lista de avisos críticos */
|
|
28
55
|
warnings: string[];
|
|
56
|
+
/** Lista de sugestões */
|
|
29
57
|
suggestions: string[];
|
|
58
|
+
/** Mensagens detalhadas de orientação */
|
|
30
59
|
messages: GuidanceMessage[];
|
|
60
|
+
/** Informações das categorias ativas */
|
|
31
61
|
activeCategoriesInfo: {
|
|
32
62
|
id: string;
|
|
33
63
|
name: string;
|
|
@@ -36,21 +66,62 @@ interface DeveloperGuidance {
|
|
|
36
66
|
uiRequired: boolean;
|
|
37
67
|
cookies?: string[];
|
|
38
68
|
}[];
|
|
69
|
+
/** Indica se está usando configuração padrão */
|
|
39
70
|
usingDefaults: boolean;
|
|
71
|
+
/** Score de conformidade LGPD (0-100) com carater orientativo */
|
|
40
72
|
complianceScore?: number;
|
|
41
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Configuração padrão de categorias do projeto.
|
|
76
|
+
* @category Consts
|
|
77
|
+
* @since 0.4.0
|
|
78
|
+
*/
|
|
42
79
|
declare const DEFAULT_PROJECT_CATEGORIES: ProjectCategoriesConfig;
|
|
43
80
|
/**
|
|
44
|
-
* Analisa configuração e integrações implícitas para orientar o
|
|
45
|
-
*
|
|
81
|
+
* Analisa configuração e integrações implícitas para orientar o desenvolvedor.
|
|
82
|
+
* @category Utils
|
|
83
|
+
* @param config Configuração de categorias do projeto
|
|
84
|
+
* @returns Objeto de orientação ao desenvolvedor
|
|
85
|
+
* @remarks
|
|
46
86
|
* Since v0.4.0: inclui customCategories.
|
|
47
87
|
* Since v0.4.1: considera categorias/integrações implícitas e enriquece cookies por categoria.
|
|
88
|
+
* @example
|
|
89
|
+
* const guidance = analyzeDeveloperConfiguration({ enabledCategories: ['analytics', 'marketing'] })
|
|
48
90
|
*/
|
|
49
91
|
declare function analyzeDeveloperConfiguration(config?: ProjectCategoriesConfig): DeveloperGuidance;
|
|
92
|
+
/**
|
|
93
|
+
* Loga orientação ao desenvolvedor no console/browser/servidor.
|
|
94
|
+
* @category Utils
|
|
95
|
+
* @param guidance Objeto de orientação
|
|
96
|
+
* @param disableGuidanceProp Desabilita logs se true
|
|
97
|
+
* @param config Configuração customizada de exibição
|
|
98
|
+
* @remarks
|
|
99
|
+
* Não loga em produção ou se desabilitado.
|
|
100
|
+
* @since 0.4.0
|
|
101
|
+
*/
|
|
50
102
|
declare function logDeveloperGuidance(guidance: DeveloperGuidance, disableGuidanceProp?: boolean, config?: GuidanceConfig): void;
|
|
103
|
+
/**
|
|
104
|
+
* Hook React para análise e logging de orientação LGPD ao desenvolvedor.
|
|
105
|
+
* @category Hooks
|
|
106
|
+
* @param config Configuração de categorias do projeto
|
|
107
|
+
* @param disableGuidanceProp Desabilita logs se true
|
|
108
|
+
* @param guidanceConfig Configuração customizada de exibição
|
|
109
|
+
* @returns Objeto de orientação LGPD
|
|
110
|
+
* @remarks
|
|
111
|
+
* SSR-safe: só loga no client.
|
|
112
|
+
* @since 0.4.0
|
|
113
|
+
* @see analyzeDeveloperConfiguration
|
|
114
|
+
* @see logDeveloperGuidance
|
|
115
|
+
* @example
|
|
116
|
+
* const guidance = useDeveloperGuidance({ enabledCategories: ['analytics'] })
|
|
117
|
+
*/
|
|
51
118
|
declare function useDeveloperGuidance(config?: ProjectCategoriesConfig, disableGuidanceProp?: boolean, guidanceConfig?: GuidanceConfig): DeveloperGuidance;
|
|
52
119
|
/**
|
|
53
|
-
* Presets de configuração para diferentes ambientes
|
|
120
|
+
* Presets de configuração para diferentes ambientes de desenvolvimento/produção.
|
|
121
|
+
* @category Consts
|
|
122
|
+
* @since 0.4.0
|
|
123
|
+
* @example
|
|
124
|
+
* GUIDANCE_PRESETS.development
|
|
54
125
|
*/
|
|
55
126
|
declare const GUIDANCE_PRESETS: {
|
|
56
127
|
/** Configuração completa para desenvolvimento */
|
|
@@ -93,198 +164,469 @@ declare const GUIDANCE_PRESETS: {
|
|
|
93
164
|
|
|
94
165
|
/**
|
|
95
166
|
* @fileoverview
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* Este arquivo contém todas as interfaces, tipos e estruturas de dados utilizadas
|
|
99
|
-
* pela biblioteca react-lgpd-consent, incluindo definições de categorias,
|
|
100
|
-
* estado de consentimento, configurações e textos da interface.
|
|
167
|
+
* Sistema de textos expandido com suporte avançado a internacionalização,
|
|
168
|
+
* contextos específicos e variações de tom.
|
|
101
169
|
*
|
|
102
170
|
* @author Luciano Édipo
|
|
103
|
-
* @since 0.1
|
|
171
|
+
* @since 0.4.1
|
|
104
172
|
*/
|
|
173
|
+
|
|
105
174
|
/**
|
|
106
|
-
*
|
|
107
|
-
* @category Types
|
|
108
|
-
* @since 0.2.0
|
|
109
|
-
*
|
|
110
|
-
* @remarks
|
|
111
|
-
* Use este tipo para identificar as categorias principais de cookies suportadas nativamente pela biblioteca.
|
|
112
|
-
* Cada categoria representa um tipo específico de processamento de dados:
|
|
113
|
-
*
|
|
114
|
-
* - `'necessary'`: Cookies essenciais para funcionamento do site (sempre ativos).
|
|
115
|
-
* - `'analytics'`: Cookies para análise e estatísticas de uso.
|
|
116
|
-
* - `'functional'`: Cookies para funcionalidades extras e preferências do usuário.
|
|
117
|
-
* - `'marketing'`: Cookies para publicidade e marketing direcionado.
|
|
118
|
-
* - `'social'`: Cookies para integração com redes sociais.
|
|
119
|
-
* - `'personalization'`: Cookies para personalização de conteúdo e experiência.
|
|
175
|
+
* Tipo auxiliar para variações de texto.
|
|
120
176
|
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
|
|
124
|
-
* ```
|
|
177
|
+
* Define um subconjunto opcional dos textos principais do banner e modal,
|
|
178
|
+
* permitindo variações de t es: {
|
|
179
|
+
bannerMessage: 'Utilizamos cookies para mejorar su experiencia y mostrar contenido personalizado.', (formal, casual, etc.) sem sobrescrever todos os textos.
|
|
125
180
|
*
|
|
126
|
-
* @
|
|
181
|
+
* @category Types
|
|
182
|
+
* @since 0.4.1
|
|
127
183
|
*/
|
|
128
|
-
type
|
|
184
|
+
type TextVariant = Partial<Pick<ConsentTexts, 'bannerMessage' | 'acceptAll' | 'declineAll' | 'modalTitle'>>;
|
|
129
185
|
/**
|
|
130
|
-
*
|
|
131
|
-
* @category Types
|
|
132
|
-
* @since 0.2.0
|
|
133
|
-
*
|
|
134
|
-
* @remarks
|
|
135
|
-
* Esta interface define a estrutura completa de uma categoria de cookies,
|
|
136
|
-
* incluindo metadados e configurações específicas para processamento
|
|
137
|
-
* e exibição na interface do usuário.
|
|
138
|
-
*
|
|
139
|
-
* @example
|
|
140
|
-
* ```typescript
|
|
141
|
-
* // Categoria padrão da biblioteca
|
|
142
|
-
* const analyticsCategory: CategoryDefinition = {
|
|
143
|
-
* id: 'analytics',
|
|
144
|
-
* name: 'Cookies Analíticos',
|
|
145
|
-
* description: 'Utilizados para análise de uso do site',
|
|
146
|
-
* essential: false,
|
|
147
|
-
* cookies: ['_ga', '_ga_*', '_gid']
|
|
148
|
-
* };
|
|
186
|
+
* Tipo auxiliar para textos de idioma.
|
|
149
187
|
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* id: 'chat',
|
|
153
|
-
* name: 'Chat de Suporte',
|
|
154
|
-
* description: 'Widget de chat para suporte ao cliente',
|
|
155
|
-
* essential: false
|
|
156
|
-
* };
|
|
157
|
-
* ```
|
|
188
|
+
* Define um subconjunto dos textos principais, excluindo propriedades específicas de internacionalização
|
|
189
|
+
* e contextos, para uso em configurações multilíngues.
|
|
158
190
|
*
|
|
159
|
-
* @
|
|
191
|
+
* @category Types
|
|
192
|
+
* @since 0.4.1
|
|
160
193
|
*/
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Identificador único da categoria.
|
|
164
|
-
* @example 'analytics'
|
|
165
|
-
*/
|
|
166
|
-
id: string;
|
|
167
|
-
/**
|
|
168
|
-
* Nome amigável exibido na interface do usuário.
|
|
169
|
-
* @example 'Cookies Analíticos'
|
|
170
|
-
*/
|
|
171
|
-
name: string;
|
|
172
|
-
/**
|
|
173
|
-
* Descrição detalhada da finalidade da categoria.
|
|
174
|
-
* @example 'Utilizados para análise de uso e comportamento no site'
|
|
175
|
-
*/
|
|
176
|
-
description: string;
|
|
177
|
-
/**
|
|
178
|
-
* Indica se é uma categoria essencial que não pode ser desabilitada pelo usuário.
|
|
179
|
-
* @defaultValue false
|
|
180
|
-
*/
|
|
181
|
-
essential?: boolean;
|
|
182
|
-
/**
|
|
183
|
-
* Lista de nomes de cookies ou padrões específicos desta categoria.
|
|
184
|
-
* @example ['_ga', '_ga_*', '_gid']
|
|
185
|
-
*/
|
|
186
|
-
cookies?: string[];
|
|
187
|
-
/**
|
|
188
|
-
* Metadados detalhados sobre cookies típicos desta categoria.
|
|
189
|
-
* Não exaustivo; serve para orientar UI e documentação.
|
|
190
|
-
*/
|
|
191
|
-
cookiesInfo?: CookieDescriptor[];
|
|
192
|
-
}
|
|
194
|
+
type LanguageTexts = Partial<Omit<ConsentTexts, 'i18n' | 'variants' | 'contexts'>>;
|
|
193
195
|
/**
|
|
194
|
-
*
|
|
195
|
-
* @category Types
|
|
196
|
-
* @since 0.2.0
|
|
197
|
-
*
|
|
198
|
-
* @remarks
|
|
199
|
-
* Mantém compatibilidade com abordagens comuns no mercado.
|
|
200
|
-
* Fornece informações detalhadas sobre cookies para exibição em interfaces
|
|
201
|
-
* e documentação de compliance.
|
|
196
|
+
* Sistema de textos avançado com suporte a internacionalização e contextos específicos.
|
|
202
197
|
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
* name: '_ga',
|
|
207
|
-
* purpose: 'analytics',
|
|
208
|
-
* duration: '2 years',
|
|
209
|
-
* domain: '.example.com',
|
|
210
|
-
* provider: 'Google Analytics'
|
|
211
|
-
* };
|
|
212
|
-
* ```
|
|
198
|
+
* Interface expandida que permite personalização granular de todas as mensagens da biblioteca.
|
|
199
|
+
* Suporta múltiplos idiomas, contextos específicos (e-commerce, SaaS, governo), variações
|
|
200
|
+
* de tom, e compliance completo com LGPD.
|
|
213
201
|
*
|
|
214
|
-
* @public
|
|
215
|
-
*/
|
|
216
|
-
interface CookieDescriptor {
|
|
217
|
-
/**
|
|
218
|
-
* Identificador ou padrão do cookie.
|
|
219
|
-
* @example '_ga'
|
|
220
|
-
*/
|
|
221
|
-
name: string;
|
|
222
|
-
/**
|
|
223
|
-
* Finalidade do cookie (opcional).
|
|
224
|
-
* @example 'analytics'
|
|
225
|
-
*/
|
|
226
|
-
purpose?: string;
|
|
227
|
-
/**
|
|
228
|
-
* Tempo de retenção do cookie (opcional).
|
|
229
|
-
* @example '2 years'
|
|
230
|
-
*/
|
|
231
|
-
duration?: string;
|
|
232
|
-
/**
|
|
233
|
-
* Domínio associado ao cookie (opcional).
|
|
234
|
-
* @example '.example.com'
|
|
235
|
-
*/
|
|
236
|
-
domain?: string;
|
|
237
|
-
/**
|
|
238
|
-
* Provedor ou serviço associado ao cookie (opcional).
|
|
239
|
-
* @example 'Google Analytics'
|
|
240
|
-
*/
|
|
241
|
-
provider?: string;
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Configuração de categorias ativas no projeto.
|
|
245
202
|
* @category Types
|
|
246
|
-
* @since 0.
|
|
247
|
-
*
|
|
203
|
+
* @since 0.4.1
|
|
248
204
|
* @remarks
|
|
249
|
-
*
|
|
250
|
-
* e permite extensão com categorias customizadas específicas do projeto.
|
|
251
|
-
*
|
|
252
|
-
* A categoria 'necessary' é sempre incluída automaticamente e não precisa ser
|
|
253
|
-
* especificada em `enabledCategories`.
|
|
205
|
+
* **Histórico**: v0.4.1 - Nova interface com suporte avançado a i18n e contextos
|
|
254
206
|
*
|
|
255
|
-
* @example
|
|
207
|
+
* @example Configuração multilíngue
|
|
256
208
|
* ```typescript
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
209
|
+
* const multiLangTexts: AdvancedConsentTexts = {
|
|
210
|
+
* // Herda de ConsentTexts básico
|
|
211
|
+
* bannerMessage: 'Utilizamos cookies para melhorar sua experiência.',
|
|
212
|
+
* acceptAll: 'Aceitar todos',
|
|
213
|
+
* declineAll: 'Recusar',
|
|
214
|
+
* preferences: 'Preferências',
|
|
215
|
+
* modalTitle: 'Preferências de Cookies',
|
|
216
|
+
* modalIntro: 'Personalize suas preferências de cookies.',
|
|
217
|
+
* save: 'Salvar',
|
|
218
|
+
* necessaryAlwaysOn: 'Cookies necessários (sempre ativos)',
|
|
262
219
|
*
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
* customCategories: [
|
|
269
|
-
* {
|
|
270
|
-
* id: 'chat',
|
|
271
|
-
* name: 'Chat de Suporte',
|
|
272
|
-
* description: 'Widget de chat para suporte ao cliente'
|
|
220
|
+
* // Textos expandidos
|
|
221
|
+
* variants: {
|
|
222
|
+
* formal: {
|
|
223
|
+
* bannerMessage: 'Este sítio utiliza cookies para otimizar a experiência de navegação.',
|
|
224
|
+
* acceptAll: 'Concordar com todos os cookies'
|
|
273
225
|
* },
|
|
274
|
-
* {
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
* description: 'Experimentos de interface e funcionalidades'
|
|
226
|
+
* casual: {
|
|
227
|
+
* bannerMessage: '🍪 Olá! Usamos cookies para tornar tudo mais gostoso aqui.',
|
|
228
|
+
* acceptAll: 'Aceitar tudo'
|
|
278
229
|
* }
|
|
279
|
-
*
|
|
280
|
-
* };
|
|
281
|
-
* ```
|
|
230
|
+
* },
|
|
282
231
|
*
|
|
283
|
-
*
|
|
232
|
+
* // Internacionalização
|
|
233
|
+
* i18n: {
|
|
234
|
+
* en: {
|
|
235
|
+
* bannerMessage: 'We use cookies to enhance your experience.',
|
|
236
|
+
* acceptAll: 'Accept All',
|
|
237
|
+
* declineAll: 'Decline'
|
|
238
|
+
* },
|
|
239
|
+
* es: {
|
|
240
|
+
* bannerMessage: 'Utilizamos cookies para mejorar su experiencia.',
|
|
241
|
+
* acceptAll: 'Aceptar Todo',
|
|
242
|
+
* declineAll: 'Rechazar'
|
|
243
|
+
* }
|
|
244
|
+
* }
|
|
245
|
+
* }
|
|
246
|
+
* ```
|
|
284
247
|
*/
|
|
285
|
-
interface
|
|
286
|
-
/**
|
|
287
|
-
|
|
248
|
+
interface AdvancedConsentTexts extends ConsentTexts {
|
|
249
|
+
/** Texto para confirmar ação */
|
|
250
|
+
confirm?: string;
|
|
251
|
+
/** Texto para cancelar ação */
|
|
252
|
+
cancel?: string;
|
|
253
|
+
/** Texto de carregamento */
|
|
254
|
+
loading?: string;
|
|
255
|
+
/** Textos específicos para cada categoria de cookie */
|
|
256
|
+
categories?: {
|
|
257
|
+
necessary?: {
|
|
258
|
+
name?: string;
|
|
259
|
+
description?: string;
|
|
260
|
+
examples?: string;
|
|
261
|
+
};
|
|
262
|
+
analytics?: {
|
|
263
|
+
name?: string;
|
|
264
|
+
description?: string;
|
|
265
|
+
examples?: string;
|
|
266
|
+
};
|
|
267
|
+
marketing?: {
|
|
268
|
+
name?: string;
|
|
269
|
+
description?: string;
|
|
270
|
+
examples?: string;
|
|
271
|
+
};
|
|
272
|
+
functional?: {
|
|
273
|
+
name?: string;
|
|
274
|
+
description?: string;
|
|
275
|
+
examples?: string;
|
|
276
|
+
};
|
|
277
|
+
performance?: {
|
|
278
|
+
name?: string;
|
|
279
|
+
description?: string;
|
|
280
|
+
examples?: string;
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
/** Mensagens de feedback ao usuário */
|
|
284
|
+
feedback?: {
|
|
285
|
+
/** Preferências salvas com sucesso */
|
|
286
|
+
saveSuccess?: string;
|
|
287
|
+
/** Erro ao salvar preferências */
|
|
288
|
+
saveError?: string;
|
|
289
|
+
/** Consentimento atualizado */
|
|
290
|
+
consentUpdated?: string;
|
|
291
|
+
/** Cookies rejeitados */
|
|
292
|
+
cookiesRejected?: string;
|
|
293
|
+
/** Configurações resetadas */
|
|
294
|
+
settingsReset?: string;
|
|
295
|
+
};
|
|
296
|
+
/** Labels ARIA e textos para leitores de tela */
|
|
297
|
+
accessibility?: {
|
|
298
|
+
/** Label do banner para leitores de tela */
|
|
299
|
+
bannerLabel?: string;
|
|
300
|
+
/** Label do modal para leitores de tela */
|
|
301
|
+
modalLabel?: string;
|
|
302
|
+
/** Instrução de navegação por teclado */
|
|
303
|
+
keyboardNavigation?: string;
|
|
304
|
+
/** Estado do toggle de categoria */
|
|
305
|
+
toggleState?: {
|
|
306
|
+
enabled?: string;
|
|
307
|
+
disabled?: string;
|
|
308
|
+
};
|
|
309
|
+
/** Região live para anúncios dinâmicos */
|
|
310
|
+
liveRegion?: string;
|
|
311
|
+
};
|
|
312
|
+
/** Textos otimizados para diferentes contextos */
|
|
313
|
+
contexts?: {
|
|
314
|
+
/** Contexto e-commerce */
|
|
315
|
+
ecommerce?: {
|
|
316
|
+
cartAbandonment?: string;
|
|
317
|
+
personalizedOffers?: string;
|
|
318
|
+
paymentSecurity?: string;
|
|
319
|
+
productRecommendations?: string;
|
|
320
|
+
};
|
|
321
|
+
/** Contexto SaaS */
|
|
322
|
+
saas?: {
|
|
323
|
+
userAnalytics?: string;
|
|
324
|
+
performanceMonitoring?: string;
|
|
325
|
+
featureUsage?: string;
|
|
326
|
+
customerSupport?: string;
|
|
327
|
+
};
|
|
328
|
+
/** Contexto governamental */
|
|
329
|
+
government?: {
|
|
330
|
+
citizenServices?: string;
|
|
331
|
+
dataProtection?: string;
|
|
332
|
+
transparency?: string;
|
|
333
|
+
accessibility?: string;
|
|
334
|
+
};
|
|
335
|
+
/** Contexto educacional */
|
|
336
|
+
education?: {
|
|
337
|
+
studentProgress?: string;
|
|
338
|
+
learningAnalytics?: string;
|
|
339
|
+
accessibility?: string;
|
|
340
|
+
parentalConsent?: string;
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
/** Diferentes variações de tom para a mesma mensagem */
|
|
344
|
+
variants?: {
|
|
345
|
+
/** Tom formal/profissional */
|
|
346
|
+
formal?: TextVariant;
|
|
347
|
+
/** Tom casual/amigável */
|
|
348
|
+
casual?: TextVariant;
|
|
349
|
+
/** Tom conciso/direto */
|
|
350
|
+
concise?: TextVariant;
|
|
351
|
+
/** Tom detalhado/explicativo */
|
|
352
|
+
detailed?: TextVariant;
|
|
353
|
+
};
|
|
354
|
+
/** Suporte a múltiplos idiomas */
|
|
355
|
+
i18n?: {
|
|
356
|
+
/** Textos em inglês */
|
|
357
|
+
en?: LanguageTexts;
|
|
358
|
+
/** Textos em espanhol */
|
|
359
|
+
es?: LanguageTexts;
|
|
360
|
+
/** Textos em francês */
|
|
361
|
+
fr?: LanguageTexts;
|
|
362
|
+
/** Textos em alemão */
|
|
363
|
+
de?: LanguageTexts;
|
|
364
|
+
/** Textos em italiano */
|
|
365
|
+
it?: LanguageTexts;
|
|
366
|
+
};
|
|
367
|
+
/** Informações técnicas sobre cookies */
|
|
368
|
+
technical?: {
|
|
369
|
+
/** Explicação sobre cookies de sessão */
|
|
370
|
+
sessionCookies?: string;
|
|
371
|
+
/** Explicação sobre cookies persistentes */
|
|
372
|
+
persistentCookies?: string;
|
|
373
|
+
/** Explicação sobre cookies de terceiros */
|
|
374
|
+
thirdPartyCookies?: string;
|
|
375
|
+
/** Como desabilitar cookies no navegador */
|
|
376
|
+
browserSettings?: string;
|
|
377
|
+
/** Impacto de desabilitar cookies */
|
|
378
|
+
disablingImpact?: string;
|
|
379
|
+
};
|
|
380
|
+
/** Cabeçalhos para tabela de detalhes de cookies */
|
|
381
|
+
cookieDetails?: {
|
|
382
|
+
tableHeaders?: {
|
|
383
|
+
name?: string;
|
|
384
|
+
purpose?: string;
|
|
385
|
+
duration?: string;
|
|
386
|
+
provider?: string;
|
|
387
|
+
type?: string;
|
|
388
|
+
};
|
|
389
|
+
/** Texto quando não há cookies para mostrar */
|
|
390
|
+
noCookies?: string;
|
|
391
|
+
/** Botão para expandir/colapsar detalhes */
|
|
392
|
+
toggleDetails?: {
|
|
393
|
+
expand?: string;
|
|
394
|
+
collapse?: string;
|
|
395
|
+
};
|
|
396
|
+
/** Prefixo exibido antes do ID do script */
|
|
397
|
+
scriptLabelPrefix?: string;
|
|
398
|
+
/** Texto de finalidade para scripts ativos detectados */
|
|
399
|
+
scriptPurpose?: string;
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Textos padrão expandidos para diferentes contextos e idiomas.
|
|
404
|
+
*
|
|
405
|
+
* @category Utils
|
|
406
|
+
* @since 0.4.1
|
|
407
|
+
*/
|
|
408
|
+
declare const EXPANDED_DEFAULT_TEXTS: Partial<AdvancedConsentTexts>;
|
|
409
|
+
/**
|
|
410
|
+
* Utilitário para resolver textos baseado em idioma, contexto e variação.
|
|
411
|
+
*
|
|
412
|
+
* @category Utils
|
|
413
|
+
* @since 0.4.1
|
|
414
|
+
*
|
|
415
|
+
* @param texts - Textos avançados configurados
|
|
416
|
+
* @param options - Opções de resolução
|
|
417
|
+
* @returns Textos resolvidos para o contexto
|
|
418
|
+
*/
|
|
419
|
+
declare function resolveTexts(texts: AdvancedConsentTexts, options?: {
|
|
420
|
+
language?: 'pt' | 'en' | 'es' | 'fr' | 'de' | 'it';
|
|
421
|
+
context?: 'ecommerce' | 'saas' | 'government' | 'education';
|
|
422
|
+
variant?: 'formal' | 'casual' | 'concise' | 'detailed';
|
|
423
|
+
}): AdvancedConsentTexts;
|
|
424
|
+
/**
|
|
425
|
+
* Templates pré-configurados para diferentes contextos.
|
|
426
|
+
*
|
|
427
|
+
* @category Utils
|
|
428
|
+
* @since 0.4.1
|
|
429
|
+
*/
|
|
430
|
+
declare const TEXT_TEMPLATES: {
|
|
431
|
+
readonly ecommerce: AdvancedConsentTexts;
|
|
432
|
+
readonly saas: AdvancedConsentTexts;
|
|
433
|
+
readonly government: AdvancedConsentTexts;
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* @fileoverview
|
|
438
|
+
* Definições de tipos TypeScript para o sistema de consentimento LGPD.
|
|
439
|
+
*
|
|
440
|
+
* Este arquivo contém todas as interfaces, tipos e estruturas de dados utilizadas
|
|
441
|
+
* pela biblioteca react-lgpd-consent, incluindo definições de categorias,
|
|
442
|
+
* estado de consentimento, configurações e textos da interface.
|
|
443
|
+
*
|
|
444
|
+
* @author Luciano Édipo
|
|
445
|
+
* @since 0.1.0
|
|
446
|
+
*/
|
|
447
|
+
/**
|
|
448
|
+
* Tipos de categorias padrão de consentimento para cookies, conforme definido pela ANPD.
|
|
449
|
+
* @category Types
|
|
450
|
+
* @since 0.2.0
|
|
451
|
+
*
|
|
452
|
+
* @remarks
|
|
453
|
+
* Use este tipo para identificar as categorias principais de cookies suportadas nativamente pela biblioteca.
|
|
454
|
+
* Cada categoria representa um tipo específico de processamento de dados:
|
|
455
|
+
*
|
|
456
|
+
* - `'necessary'`: Cookies essenciais para funcionamento do site (sempre ativos).
|
|
457
|
+
* - `'analytics'`: Cookies para análise e estatísticas de uso.
|
|
458
|
+
* - `'functional'`: Cookies para funcionalidades extras e preferências do usuário.
|
|
459
|
+
* - `'marketing'`: Cookies para publicidade e marketing direcionado.
|
|
460
|
+
* - `'social'`: Cookies para integração com redes sociais.
|
|
461
|
+
* - `'personalization'`: Cookies para personalização de conteúdo e experiência.
|
|
462
|
+
*
|
|
463
|
+
* @example
|
|
464
|
+
* ```typescript
|
|
465
|
+
* const categories: Category[] = ['analytics', 'marketing'];
|
|
466
|
+
* ```
|
|
467
|
+
*
|
|
468
|
+
* @public
|
|
469
|
+
*/
|
|
470
|
+
type Category = 'necessary' | 'analytics' | 'functional' | 'marketing' | 'social' | 'personalization';
|
|
471
|
+
/**
|
|
472
|
+
* Definição detalhada de uma categoria de cookie para uso interno.
|
|
473
|
+
* @category Types
|
|
474
|
+
* @since 0.2.0
|
|
475
|
+
*
|
|
476
|
+
* @remarks
|
|
477
|
+
* Esta interface define a estrutura completa de uma categoria de cookies,
|
|
478
|
+
* incluindo metadados e configurações específicas para processamento
|
|
479
|
+
* e exibição na interface do usuário.
|
|
480
|
+
*
|
|
481
|
+
* @example
|
|
482
|
+
* ```typescript
|
|
483
|
+
* // Categoria padrão da biblioteca
|
|
484
|
+
* const analyticsCategory: CategoryDefinition = {
|
|
485
|
+
* id: 'analytics',
|
|
486
|
+
* name: 'Cookies Analíticos',
|
|
487
|
+
* description: 'Utilizados para análise de uso do site',
|
|
488
|
+
* essential: false,
|
|
489
|
+
* cookies: ['_ga', '_ga_*', '_gid']
|
|
490
|
+
* };
|
|
491
|
+
*
|
|
492
|
+
* // Categoria customizada específica do projeto
|
|
493
|
+
* const chatCategory: CategoryDefinition = {
|
|
494
|
+
* id: 'chat',
|
|
495
|
+
* name: 'Chat de Suporte',
|
|
496
|
+
* description: 'Widget de chat para suporte ao cliente',
|
|
497
|
+
* essential: false
|
|
498
|
+
* };
|
|
499
|
+
* ```
|
|
500
|
+
*
|
|
501
|
+
* @public
|
|
502
|
+
*/
|
|
503
|
+
interface CategoryDefinition {
|
|
504
|
+
/**
|
|
505
|
+
* Identificador único da categoria.
|
|
506
|
+
* @example 'analytics'
|
|
507
|
+
*/
|
|
508
|
+
id: string;
|
|
509
|
+
/**
|
|
510
|
+
* Nome amigável exibido na interface do usuário.
|
|
511
|
+
* @example 'Cookies Analíticos'
|
|
512
|
+
*/
|
|
513
|
+
name: string;
|
|
514
|
+
/**
|
|
515
|
+
* Descrição detalhada da finalidade da categoria.
|
|
516
|
+
* @example 'Utilizados para análise de uso e comportamento no site'
|
|
517
|
+
*/
|
|
518
|
+
description: string;
|
|
519
|
+
/**
|
|
520
|
+
* Indica se é uma categoria essencial que não pode ser desabilitada pelo usuário.
|
|
521
|
+
* @defaultValue false
|
|
522
|
+
*/
|
|
523
|
+
essential?: boolean;
|
|
524
|
+
/**
|
|
525
|
+
* Lista de nomes de cookies ou padrões específicos desta categoria.
|
|
526
|
+
* @example ['_ga', '_ga_*', '_gid']
|
|
527
|
+
*/
|
|
528
|
+
cookies?: string[];
|
|
529
|
+
/**
|
|
530
|
+
* Metadados detalhados sobre cookies típicos desta categoria.
|
|
531
|
+
* Não exaustivo; serve para orientar UI e documentação.
|
|
532
|
+
*/
|
|
533
|
+
cookiesInfo?: CookieDescriptor[];
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Descritor de cookie com metadados úteis para UI/documentação.
|
|
537
|
+
* @category Types
|
|
538
|
+
* @since 0.2.0
|
|
539
|
+
*
|
|
540
|
+
* @remarks
|
|
541
|
+
* Mantém compatibilidade com abordagens comuns no mercado.
|
|
542
|
+
* Fornece informações detalhadas sobre cookies para exibição em interfaces
|
|
543
|
+
* e documentação de compliance.
|
|
544
|
+
*
|
|
545
|
+
* @example
|
|
546
|
+
* ```typescript
|
|
547
|
+
* const cookieInfo: CookieDescriptor = {
|
|
548
|
+
* name: '_ga',
|
|
549
|
+
* purpose: 'analytics',
|
|
550
|
+
* duration: '2 years',
|
|
551
|
+
* domain: '.example.com',
|
|
552
|
+
* provider: 'Google Analytics'
|
|
553
|
+
* };
|
|
554
|
+
* ```
|
|
555
|
+
*
|
|
556
|
+
* @public
|
|
557
|
+
*/
|
|
558
|
+
interface CookieDescriptor {
|
|
559
|
+
/**
|
|
560
|
+
* Identificador ou padrão do cookie.
|
|
561
|
+
* @example '_ga'
|
|
562
|
+
*/
|
|
563
|
+
name: string;
|
|
564
|
+
/**
|
|
565
|
+
* Finalidade do cookie (opcional).
|
|
566
|
+
* @example 'analytics'
|
|
567
|
+
*/
|
|
568
|
+
purpose?: string;
|
|
569
|
+
/**
|
|
570
|
+
* Tempo de retenção do cookie (opcional).
|
|
571
|
+
* @example '2 years'
|
|
572
|
+
*/
|
|
573
|
+
duration?: string;
|
|
574
|
+
/**
|
|
575
|
+
* Domínio associado ao cookie (opcional).
|
|
576
|
+
* @example '.example.com'
|
|
577
|
+
*/
|
|
578
|
+
domain?: string;
|
|
579
|
+
/**
|
|
580
|
+
* Provedor ou serviço associado ao cookie (opcional).
|
|
581
|
+
* @example 'Google Analytics'
|
|
582
|
+
*/
|
|
583
|
+
provider?: string;
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Configuração de categorias ativas no projeto.
|
|
587
|
+
* @category Types
|
|
588
|
+
* @since 0.2.0
|
|
589
|
+
*
|
|
590
|
+
* @remarks
|
|
591
|
+
* Define quais categorias fixas serão usadas (além de 'necessary' que é sempre incluída)
|
|
592
|
+
* e permite extensão com categorias customizadas específicas do projeto.
|
|
593
|
+
*
|
|
594
|
+
* A categoria 'necessary' é sempre incluída automaticamente e não precisa ser
|
|
595
|
+
* especificada em `enabledCategories`.
|
|
596
|
+
*
|
|
597
|
+
* @example
|
|
598
|
+
* ```typescript
|
|
599
|
+
* // Configuração básica
|
|
600
|
+
* const config: ProjectCategoriesConfig = {
|
|
601
|
+
* enabledCategories: ['analytics', 'marketing']
|
|
602
|
+
* };
|
|
603
|
+
* ```
|
|
604
|
+
*
|
|
605
|
+
* @example
|
|
606
|
+
* ```typescript
|
|
607
|
+
* // Configuração com categorias customizadas
|
|
608
|
+
* const config: ProjectCategoriesConfig = {
|
|
609
|
+
* enabledCategories: ['analytics'],
|
|
610
|
+
* customCategories: [
|
|
611
|
+
* {
|
|
612
|
+
* id: 'chat',
|
|
613
|
+
* name: 'Chat de Suporte',
|
|
614
|
+
* description: 'Widget de chat para suporte ao cliente'
|
|
615
|
+
* },
|
|
616
|
+
* {
|
|
617
|
+
* id: 'abTesting',
|
|
618
|
+
* name: 'A/B Testing',
|
|
619
|
+
* description: 'Experimentos de interface e funcionalidades'
|
|
620
|
+
* }
|
|
621
|
+
* ]
|
|
622
|
+
* };
|
|
623
|
+
* ```
|
|
624
|
+
*
|
|
625
|
+
* @public
|
|
626
|
+
*/
|
|
627
|
+
interface ProjectCategoriesConfig {
|
|
628
|
+
/**
|
|
629
|
+
* Categorias padrão que serão ativadas.
|
|
288
630
|
* A categoria 'necessary' é sempre incluída automaticamente.
|
|
289
631
|
* @example ['analytics', 'marketing']
|
|
290
632
|
*/
|
|
@@ -1278,7 +1620,19 @@ interface ConsentProviderProps {
|
|
|
1278
1620
|
* }}
|
|
1279
1621
|
* ```
|
|
1280
1622
|
*/
|
|
1281
|
-
texts?: Partial<
|
|
1623
|
+
texts?: Partial<AdvancedConsentTexts>;
|
|
1624
|
+
/**
|
|
1625
|
+
* Idioma ativo para resolver textos via i18n (opcional).
|
|
1626
|
+
* Quando definido, aplica `texts.i18n[language]` nos campos principais.
|
|
1627
|
+
*
|
|
1628
|
+
* @defaultValue 'pt'
|
|
1629
|
+
*/
|
|
1630
|
+
language?: 'pt' | 'en' | 'es' | 'fr' | 'de' | 'it';
|
|
1631
|
+
/**
|
|
1632
|
+
* Variação de tom aplicada aos textos (opcional).
|
|
1633
|
+
* Utiliza `texts.variants[variant]` como override dos textos principais.
|
|
1634
|
+
*/
|
|
1635
|
+
textVariant?: 'formal' | 'casual' | 'concise' | 'detailed';
|
|
1282
1636
|
/**
|
|
1283
1637
|
* Tokens de design para customização visual avançada.
|
|
1284
1638
|
* Oferece controle direto sobre cores, fontes, espaçamento e layout.
|
|
@@ -1478,7 +1832,7 @@ interface CustomCookieBannerProps {
|
|
|
1478
1832
|
acceptAll: () => void;
|
|
1479
1833
|
rejectAll: () => void;
|
|
1480
1834
|
openPreferences: () => void;
|
|
1481
|
-
texts:
|
|
1835
|
+
texts: AdvancedConsentTexts;
|
|
1482
1836
|
/** Indica se o branding padrão deve ser ocultado. */
|
|
1483
1837
|
hideBranding?: boolean;
|
|
1484
1838
|
/**
|
|
@@ -1508,7 +1862,7 @@ interface CustomPreferencesModalProps {
|
|
|
1508
1862
|
setPreferences: (preferences: ConsentPreferences) => void;
|
|
1509
1863
|
closePreferences: () => void;
|
|
1510
1864
|
isModalOpen?: boolean;
|
|
1511
|
-
texts:
|
|
1865
|
+
texts: AdvancedConsentTexts;
|
|
1512
1866
|
}
|
|
1513
1867
|
/**
|
|
1514
1868
|
* Props esperadas por um componente customizado de FloatingPreferencesButton.
|
|
@@ -1602,7 +1956,7 @@ type ConsentEventOrigin = 'banner' | 'modal' | 'reset' | 'programmatic';
|
|
|
1602
1956
|
* @example
|
|
1603
1957
|
* ```typescript
|
|
1604
1958
|
* // Exemplo de evento no dataLayer
|
|
1605
|
-
* window
|
|
1959
|
+
* globalThis.window?.dataLayer?.push({
|
|
1606
1960
|
* event: 'consent_initialized',
|
|
1607
1961
|
* consent_version: '0.4.5',
|
|
1608
1962
|
* timestamp: '2025-10-25T13:52:33.729Z',
|
|
@@ -1640,7 +1994,7 @@ interface ConsentInitializedEvent {
|
|
|
1640
1994
|
* @example
|
|
1641
1995
|
* ```typescript
|
|
1642
1996
|
* // Exemplo de evento no dataLayer após aceitar analytics
|
|
1643
|
-
* window
|
|
1997
|
+
* globalThis.window?.dataLayer?.push({
|
|
1644
1998
|
* event: 'consent_updated',
|
|
1645
1999
|
* consent_version: '0.4.5',
|
|
1646
2000
|
* timestamp: '2025-10-25T13:52:33.729Z',
|
|
@@ -1694,7 +2048,7 @@ type ConsentEvent = ConsentInitializedEvent | ConsentUpdatedEvent;
|
|
|
1694
2048
|
*
|
|
1695
2049
|
* @param {Readonly<ConsentProviderProps>} props - As propriedades para configurar o provider.
|
|
1696
2050
|
* @param {ProjectCategoriesConfig} props.categories - **Obrigatório**. Define as categorias de cookies que seu projeto utiliza, em conformidade com o princípio de minimização da LGPD.
|
|
1697
|
-
* @param {Partial<
|
|
2051
|
+
* @param {Partial<AdvancedConsentTexts>} [props.texts] - Objeto para customizar todos os textos exibidos na UI.
|
|
1698
2052
|
* @param {boolean} [props.blocking=false] - Se `true`, exibe um overlay que impede a interação com o site até uma decisão do usuário.
|
|
1699
2053
|
* @param {(state: ConsentState) => void} [props.onConsentGiven] - Callback executado na primeira vez que o usuário dá o consentimento.
|
|
1700
2054
|
* @param {(prefs: ConsentPreferences) => void} [props.onPreferencesSaved] - Callback executado sempre que o usuário salva novas preferências.
|
|
@@ -1729,8 +2083,8 @@ type ConsentEvent = ConsentInitializedEvent | ConsentUpdatedEvent;
|
|
|
1729
2083
|
* </ConsentProvider>
|
|
1730
2084
|
* ```
|
|
1731
2085
|
*/
|
|
1732
|
-
declare function ConsentProvider({ initialState, categories, texts: textsProp, designTokens, PreferencesModalComponent, preferencesModalProps, CookieBannerComponent, cookieBannerProps, FloatingPreferencesButtonComponent, floatingPreferencesButtonProps, disableFloatingPreferencesButton, blocking, blockingStrategy, hideBranding: _hideBranding, onConsentGiven, onPreferencesSaved, cookie: cookieOpts, storage, onConsentVersionChange, disableDeveloperGuidance, guidanceConfig, children, disableDiscoveryLog, onConsentInit, onConsentChange, onAuditLog, }: Readonly<ConsentProviderProps>): react_jsx_runtime.JSX.Element;
|
|
1733
|
-
declare const defaultTexts:
|
|
2086
|
+
declare function ConsentProvider({ initialState, categories, texts: textsProp, language, textVariant, designTokens, PreferencesModalComponent, preferencesModalProps, CookieBannerComponent, cookieBannerProps, FloatingPreferencesButtonComponent, floatingPreferencesButtonProps, disableFloatingPreferencesButton, blocking, blockingStrategy, hideBranding: _hideBranding, onConsentGiven, onPreferencesSaved, cookie: cookieOpts, storage, onConsentVersionChange, disableDeveloperGuidance, guidanceConfig, children, disableDiscoveryLog, onConsentInit, onConsentChange, onAuditLog, }: Readonly<ConsentProviderProps>): react_jsx_runtime.JSX.Element;
|
|
2087
|
+
declare const defaultTexts: AdvancedConsentTexts;
|
|
1734
2088
|
|
|
1735
2089
|
/**
|
|
1736
2090
|
* @fileoverview
|
|
@@ -1873,7 +2227,7 @@ declare const defaultTexts: ConsentTexts;
|
|
|
1873
2227
|
* return (
|
|
1874
2228
|
* <div>
|
|
1875
2229
|
* ❌ Este recurso requer cookies funcionais.
|
|
1876
|
-
* <button onClick={() => window
|
|
2230
|
+
* <button onClick={() => globalThis.window?.openPreferencesModal?.()}>
|
|
1877
2231
|
* Alterar Preferências
|
|
1878
2232
|
* </button>
|
|
1879
2233
|
* </div>
|
|
@@ -2008,13 +2362,13 @@ declare function useConsent(): ConsentContextValue;
|
|
|
2008
2362
|
* }
|
|
2009
2363
|
* ```
|
|
2010
2364
|
*
|
|
2011
|
-
* @see {@link
|
|
2365
|
+
* @see {@link AdvancedConsentTexts} - Interface completa dos textos
|
|
2012
2366
|
* @see {@link ConsentProvider} - Para configurar textos personalizados
|
|
2013
2367
|
*
|
|
2014
2368
|
* @public
|
|
2015
2369
|
* @since 0.1.0
|
|
2016
2370
|
*/
|
|
2017
|
-
declare function useConsentTexts():
|
|
2371
|
+
declare function useConsentTexts(): AdvancedConsentTexts;
|
|
2018
2372
|
/**
|
|
2019
2373
|
* Hook para verificar se a hidratação do estado de consentimento foi concluída.
|
|
2020
2374
|
*
|
|
@@ -2106,7 +2460,7 @@ declare function useConsentTexts(): ConsentTexts;
|
|
|
2106
2460
|
* return (
|
|
2107
2461
|
* <div className="consent-partial">
|
|
2108
2462
|
* <p>Este recurso requer cookies funcionais.</p>
|
|
2109
|
-
* <button onClick={() => window
|
|
2463
|
+
* <button onClick={() => globalThis.window?.openPreferencesModal?.()}>
|
|
2110
2464
|
* Alterar Preferências
|
|
2111
2465
|
* </button>
|
|
2112
2466
|
* </div>
|
|
@@ -2217,7 +2571,7 @@ declare function useOpenPreferencesModal(): () => void;
|
|
|
2217
2571
|
* @example
|
|
2218
2572
|
* ```javascript
|
|
2219
2573
|
* // Em código JavaScript puro
|
|
2220
|
-
* window
|
|
2574
|
+
* globalThis.window?.openPreferencesModal?.();
|
|
2221
2575
|
*
|
|
2222
2576
|
* // Ou importando diretamente
|
|
2223
2577
|
* import { openPreferencesModal } from 'react-lgpd-consent';
|
|
@@ -2509,10 +2863,23 @@ declare function loadScript(id: string, src: string, category?: string | null, a
|
|
|
2509
2863
|
*/
|
|
2510
2864
|
declare function discoverRuntimeCookies(): CookieDescriptor[];
|
|
2511
2865
|
/**
|
|
2512
|
-
* Tenta detectar o nome do cookie de consentimento
|
|
2513
|
-
*
|
|
2866
|
+
* Tenta detectar o nome do cookie de consentimento LGPD presente no navegador.
|
|
2867
|
+
*
|
|
2868
|
+
* - Percorre todos os cookies disponíveis em `document.cookie`.
|
|
2869
|
+
* - Decodifica o valor e verifica se corresponde à estrutura JSON esperada de consentimento.
|
|
2870
|
+
* - Retorna o nome do cookie se encontrado, ou `null` se não houver nenhum compatível.
|
|
2871
|
+
*
|
|
2872
|
+
* @returns Nome do cookie de consentimento ou `null` se não encontrado
|
|
2514
2873
|
* @category Utils
|
|
2515
2874
|
* @since 0.4.1
|
|
2875
|
+
* @example
|
|
2876
|
+
* ```ts
|
|
2877
|
+
* const consentCookie = detectConsentCookieName()
|
|
2878
|
+
* if (consentCookie) {
|
|
2879
|
+
* console.log('Cookie de consentimento encontrado:', consentCookie)
|
|
2880
|
+
* }
|
|
2881
|
+
* ```
|
|
2882
|
+
* @remarks SSR-safe: retorna `null` se executado fora do browser.
|
|
2516
2883
|
*/
|
|
2517
2884
|
declare function detectConsentCookieName(): string | null;
|
|
2518
2885
|
/**
|
|
@@ -2608,1126 +2975,904 @@ interface ScriptIntegration {
|
|
|
2608
2975
|
}>;
|
|
2609
2976
|
}
|
|
2610
2977
|
/**
|
|
2611
|
-
* Configuração para
|
|
2612
|
-
*
|
|
2613
|
-
* @category Utils
|
|
2614
|
-
* @since 0.2.0
|
|
2615
|
-
*
|
|
2616
|
-
* @example
|
|
2617
|
-
* ```typescript
|
|
2618
|
-
* const config: GoogleAnalyticsConfig = {
|
|
2619
|
-
* measurementId: 'G-XXXXXXXXXX',
|
|
2620
|
-
* config: { anonymize_ip: true }
|
|
2621
|
-
* }
|
|
2622
|
-
* ```
|
|
2623
|
-
*/
|
|
2624
|
-
interface GoogleAnalyticsConfig {
|
|
2625
|
-
/** ID de medição do GA4 (formato: G-XXXXXXXXXX) */
|
|
2626
|
-
measurementId: string;
|
|
2627
|
-
/** Configurações adicionais para o gtag */
|
|
2628
|
-
config?: Record<string, unknown>;
|
|
2629
|
-
/** URL do script GA4. Se omitido usa o padrão oficial. */
|
|
2630
|
-
scriptUrl?: string;
|
|
2631
|
-
}
|
|
2632
|
-
/**
|
|
2633
|
-
* Configuração para integração do Google Tag Manager (GTM).
|
|
2634
|
-
*
|
|
2635
|
-
* @category Utils
|
|
2636
|
-
* @since 0.2.0
|
|
2637
|
-
*
|
|
2638
|
-
* @example
|
|
2639
|
-
* ```typescript
|
|
2640
|
-
* const config: GoogleTagManagerConfig = {
|
|
2641
|
-
* containerId: 'GTM-XXXXXXX',
|
|
2642
|
-
* dataLayerName: 'customDataLayer'
|
|
2643
|
-
* }
|
|
2644
|
-
* ```
|
|
2645
|
-
*/
|
|
2646
|
-
interface GoogleTagManagerConfig {
|
|
2647
|
-
/** ID do container GTM (formato: GTM-XXXXXXX) */
|
|
2648
|
-
containerId: string;
|
|
2649
|
-
/** Nome customizado para o dataLayer. Padrão: 'dataLayer' */
|
|
2650
|
-
dataLayerName?: string;
|
|
2651
|
-
/** URL do script GTM. Se omitido usa o padrão oficial. */
|
|
2652
|
-
scriptUrl?: string;
|
|
2653
|
-
}
|
|
2654
|
-
/**
|
|
2655
|
-
* Configuração para integração do UserWay (Acessibilidade).
|
|
2656
|
-
*
|
|
2657
|
-
* @category Utils
|
|
2658
|
-
* @since 0.2.0
|
|
2659
|
-
*
|
|
2660
|
-
* @example
|
|
2661
|
-
* ```typescript
|
|
2662
|
-
* const config: UserWayConfig = {
|
|
2663
|
-
* accountId: 'XXXXXXXXXX'
|
|
2664
|
-
* }
|
|
2665
|
-
* ```
|
|
2666
|
-
*/
|
|
2667
|
-
interface UserWayConfig {
|
|
2668
|
-
/** ID da conta UserWay */
|
|
2669
|
-
accountId: string;
|
|
2670
|
-
/** URL do script UserWay. Se omitido usa o padrão oficial. */
|
|
2671
|
-
scriptUrl?: string;
|
|
2672
|
-
}
|
|
2673
|
-
/**
|
|
2674
|
-
* Cria integração do Google Analytics (GA4).
|
|
2675
|
-
* Configura o gtag e inicializa o tracking com o measurement ID fornecido.
|
|
2676
|
-
*
|
|
2677
|
-
* @category Utils
|
|
2678
|
-
* @param config - Configuração do Google Analytics
|
|
2679
|
-
* @returns Integração configurada para o GA4
|
|
2680
|
-
* @since 0.2.0
|
|
2681
|
-
*
|
|
2682
|
-
* @example
|
|
2683
|
-
* ```typescript
|
|
2684
|
-
* const ga = createGoogleAnalyticsIntegration({
|
|
2685
|
-
* measurementId: 'G-XXXXXXXXXX',
|
|
2686
|
-
* config: { anonymize_ip: true }
|
|
2687
|
-
* })
|
|
2688
|
-
* ```
|
|
2689
|
-
*
|
|
2690
|
-
* @remarks
|
|
2691
|
-
* - Define cookies: _ga, _ga_*, _gid
|
|
2692
|
-
* - Categoria padrão: 'analytics'
|
|
2693
|
-
* - SSR-safe: verifica disponibilidade do window
|
|
2694
|
-
*/
|
|
2695
|
-
declare function createGoogleAnalyticsIntegration(config: GoogleAnalyticsConfig): ScriptIntegration;
|
|
2696
|
-
/**
|
|
2697
|
-
* Cria integração do Google Tag Manager (GTM).
|
|
2698
|
-
* Configura o dataLayer e inicializa o container GTM.
|
|
2699
|
-
*
|
|
2700
|
-
* @category Utils
|
|
2701
|
-
* @param config - Configuração do Google Tag Manager
|
|
2702
|
-
* @returns Integração configurada para o GTM
|
|
2703
|
-
* @since 0.2.0
|
|
2704
|
-
*
|
|
2705
|
-
* @example
|
|
2706
|
-
* ```typescript
|
|
2707
|
-
* const gtm = createGoogleTagManagerIntegration({
|
|
2708
|
-
* containerId: 'GTM-XXXXXXX',
|
|
2709
|
-
* dataLayerName: 'myDataLayer'
|
|
2710
|
-
* })
|
|
2711
|
-
* ```
|
|
2712
|
-
*
|
|
2713
|
-
* @remarks
|
|
2714
|
-
* - Define cookies: _gcl_au
|
|
2715
|
-
* - Categoria padrão: 'analytics'
|
|
2716
|
-
* - SSR-safe: verifica disponibilidade do window
|
|
2717
|
-
*/
|
|
2718
|
-
declare function createGoogleTagManagerIntegration(config: GoogleTagManagerConfig): ScriptIntegration;
|
|
2719
|
-
/**
|
|
2720
|
-
* Cria integração do UserWay (Acessibilidade).
|
|
2721
|
-
* Configura o widget de acessibilidade UserWay.
|
|
2722
|
-
*
|
|
2723
|
-
* @category Utils
|
|
2724
|
-
* @param config - Configuração do UserWay
|
|
2725
|
-
* @returns Integração configurada para o UserWay
|
|
2726
|
-
* @since 0.2.0
|
|
2727
|
-
*
|
|
2728
|
-
* @example
|
|
2729
|
-
* ```typescript
|
|
2730
|
-
* const userway = createUserWayIntegration({
|
|
2731
|
-
* accountId: 'XXXXXXXXXX'
|
|
2732
|
-
* })
|
|
2733
|
-
* ```
|
|
2734
|
-
*
|
|
2735
|
-
* @remarks
|
|
2736
|
-
* - Define cookies: _userway_*
|
|
2737
|
-
* - Categoria padrão: 'functional'
|
|
2738
|
-
* - SSR-safe: verifica disponibilidade do window
|
|
2739
|
-
*/
|
|
2740
|
-
declare function createUserWayIntegration(config: UserWayConfig): ScriptIntegration;
|
|
2741
|
-
/**
|
|
2742
|
-
* Funções fábricas para integrações comuns.
|
|
2743
|
-
* Fornece acesso direto às funções de criação de integrações pré-configuradas.
|
|
2744
|
-
*
|
|
2745
|
-
* @category Utils
|
|
2746
|
-
* @since 0.2.0
|
|
2747
|
-
*
|
|
2748
|
-
* @example
|
|
2749
|
-
* ```typescript
|
|
2750
|
-
* const ga = COMMON_INTEGRATIONS.googleAnalytics({ measurementId: 'G-XXXXXXXXXX' })
|
|
2751
|
-
* ```
|
|
2752
|
-
*/
|
|
2753
|
-
declare const COMMON_INTEGRATIONS: {
|
|
2754
|
-
googleAnalytics: typeof createGoogleAnalyticsIntegration;
|
|
2755
|
-
googleTagManager: typeof createGoogleTagManagerIntegration;
|
|
2756
|
-
userway: typeof createUserWayIntegration;
|
|
2757
|
-
};
|
|
2758
|
-
/**
|
|
2759
|
-
* Configuração para integração do Facebook Pixel.
|
|
2760
|
-
*
|
|
2761
|
-
* @category Utils
|
|
2762
|
-
* @since 0.4.1
|
|
2763
|
-
*
|
|
2764
|
-
* @example
|
|
2765
|
-
* ```typescript
|
|
2766
|
-
* const config: FacebookPixelConfig = {
|
|
2767
|
-
* pixelId: '1234567890123456',
|
|
2768
|
-
* autoTrack: true,
|
|
2769
|
-
* advancedMatching: { email: 'user@example.com' }
|
|
2770
|
-
* }
|
|
2771
|
-
* ```
|
|
2772
|
-
*/
|
|
2773
|
-
interface FacebookPixelConfig {
|
|
2774
|
-
/** ID do pixel do Facebook */
|
|
2775
|
-
pixelId: string;
|
|
2776
|
-
/** Se deve rastrear PageView automaticamente. Padrão: true */
|
|
2777
|
-
autoTrack?: boolean;
|
|
2778
|
-
/** Configuração de correspondência avançada */
|
|
2779
|
-
advancedMatching?: Record<string, unknown>;
|
|
2780
|
-
/** URL do script do Pixel. Se omitido usa o padrão oficial. */
|
|
2781
|
-
scriptUrl?: string;
|
|
2782
|
-
}
|
|
2783
|
-
/**
|
|
2784
|
-
* Configuração para integração do Hotjar.
|
|
2785
|
-
*
|
|
2786
|
-
* @category Utils
|
|
2787
|
-
* @since 0.4.1
|
|
2788
|
-
*
|
|
2789
|
-
* @example
|
|
2790
|
-
* ```typescript
|
|
2791
|
-
* const config: HotjarConfig = {
|
|
2792
|
-
* siteId: '1234567',
|
|
2793
|
-
* version: 6,
|
|
2794
|
-
* debug: false
|
|
2795
|
-
* }
|
|
2796
|
-
* ```
|
|
2797
|
-
*/
|
|
2798
|
-
interface HotjarConfig {
|
|
2799
|
-
/** ID do site no Hotjar */
|
|
2800
|
-
siteId: string;
|
|
2801
|
-
/** Versão do script Hotjar. Padrão: 6 */
|
|
2802
|
-
version?: number;
|
|
2803
|
-
/** Ativar modo debug. Padrão: false */
|
|
2804
|
-
debug?: boolean;
|
|
2805
|
-
/** URL do script Hotjar. Se omitido usa o padrão oficial. */
|
|
2806
|
-
scriptUrl?: string;
|
|
2807
|
-
}
|
|
2808
|
-
/**
|
|
2809
|
-
* Configuração para integração do Mixpanel.
|
|
2810
|
-
*
|
|
2811
|
-
* @category Utils
|
|
2812
|
-
* @since 0.4.1
|
|
2813
|
-
*
|
|
2814
|
-
* @example
|
|
2815
|
-
* ```typescript
|
|
2816
|
-
* const config: MixpanelConfig = {
|
|
2817
|
-
* token: 'your-project-token',
|
|
2818
|
-
* config: { debug: true },
|
|
2819
|
-
* api_host: 'https://api.mixpanel.com'
|
|
2820
|
-
* }
|
|
2821
|
-
* ```
|
|
2822
|
-
*/
|
|
2823
|
-
interface MixpanelConfig {
|
|
2824
|
-
/** Token do projeto Mixpanel */
|
|
2825
|
-
token: string;
|
|
2826
|
-
/** Configurações adicionais do Mixpanel */
|
|
2827
|
-
config?: Record<string, unknown>;
|
|
2828
|
-
/** Host customizado da API Mixpanel */
|
|
2829
|
-
api_host?: string;
|
|
2830
|
-
/** URL do script Mixpanel. Se omitido usa o padrão oficial. */
|
|
2831
|
-
scriptUrl?: string;
|
|
2832
|
-
}
|
|
2833
|
-
/**
|
|
2834
|
-
* Configuração para integração do Microsoft Clarity.
|
|
2835
|
-
*
|
|
2836
|
-
* @category Utils
|
|
2837
|
-
* @since 0.4.1
|
|
2838
|
-
*
|
|
2839
|
-
* @example
|
|
2840
|
-
* ```typescript
|
|
2841
|
-
* const config: ClarityConfig = {
|
|
2842
|
-
* projectId: 'abcdefghij',
|
|
2843
|
-
* upload: true
|
|
2844
|
-
* }
|
|
2845
|
-
* ```
|
|
2846
|
-
*/
|
|
2847
|
-
interface ClarityConfig {
|
|
2848
|
-
/** ID do projeto no Microsoft Clarity */
|
|
2849
|
-
projectId: string;
|
|
2850
|
-
/** Configuração de upload de dados. Padrão: indefinido */
|
|
2851
|
-
upload?: boolean;
|
|
2852
|
-
/** URL do script Clarity. Se omitido usa o padrão oficial. */
|
|
2853
|
-
scriptUrl?: string;
|
|
2854
|
-
}
|
|
2855
|
-
/**
|
|
2856
|
-
* Configuração para integração do Intercom.
|
|
2978
|
+
* Configuração para integrações customizadas com categoria sugerida automaticamente.
|
|
2857
2979
|
*
|
|
2858
2980
|
* @category Utils
|
|
2859
|
-
* @since 0.
|
|
2860
|
-
*
|
|
2861
|
-
* @example
|
|
2862
|
-
* ```typescript
|
|
2863
|
-
* const config: IntercomConfig = {
|
|
2864
|
-
* app_id: 'your-app-id'
|
|
2865
|
-
* }
|
|
2866
|
-
* ```
|
|
2981
|
+
* @since 0.7.2
|
|
2867
2982
|
*/
|
|
2868
|
-
interface
|
|
2869
|
-
/**
|
|
2870
|
-
|
|
2871
|
-
/** URL do script Intercom. Se omitido usa o padrão oficial. */
|
|
2872
|
-
scriptUrl?: string;
|
|
2983
|
+
interface SuggestedIntegrationConfig extends Omit<ScriptIntegration, 'category'> {
|
|
2984
|
+
/** Categoria LGPD customizada (opcional). Se omitida, usa sugestão automática. */
|
|
2985
|
+
category?: string;
|
|
2873
2986
|
}
|
|
2874
2987
|
/**
|
|
2875
|
-
*
|
|
2988
|
+
* Cria integração customizada aplicando categoria sugerida automaticamente.
|
|
2989
|
+
* Permite sobrescrever a categoria quando necessário.
|
|
2876
2990
|
*
|
|
2877
2991
|
* @category Utils
|
|
2878
|
-
* @since 0.
|
|
2992
|
+
* @since 0.7.2
|
|
2879
2993
|
*
|
|
2880
2994
|
* @example
|
|
2881
2995
|
* ```typescript
|
|
2882
|
-
* const
|
|
2883
|
-
*
|
|
2884
|
-
*
|
|
2996
|
+
* const custom = createSuggestedIntegration({
|
|
2997
|
+
* id: 'custom-chat',
|
|
2998
|
+
* src: 'https://example.com/chat.js'
|
|
2999
|
+
* })
|
|
3000
|
+
* // -> category sugerida: 'functional'
|
|
2885
3001
|
* ```
|
|
2886
3002
|
*/
|
|
2887
|
-
|
|
2888
|
-
/** Chave de identificação do Zendesk */
|
|
2889
|
-
key: string;
|
|
2890
|
-
/** URL do script Zendesk. Se omitido usa o padrão oficial. */
|
|
2891
|
-
scriptUrl?: string;
|
|
2892
|
-
}
|
|
3003
|
+
declare function createSuggestedIntegration(config: SuggestedIntegrationConfig): ScriptIntegration;
|
|
2893
3004
|
/**
|
|
2894
|
-
*
|
|
2895
|
-
* Configura o fbq e inicializa o pixel com tracking automático opcional.
|
|
3005
|
+
* Configuração para integração do Google Analytics (GA4).
|
|
2896
3006
|
*
|
|
2897
3007
|
* @category Utils
|
|
2898
|
-
* @
|
|
2899
|
-
* @returns Integração configurada para o Facebook Pixel
|
|
2900
|
-
* @since 0.4.1
|
|
3008
|
+
* @since 0.2.0
|
|
2901
3009
|
*
|
|
2902
3010
|
* @example
|
|
2903
3011
|
* ```typescript
|
|
2904
|
-
* const
|
|
2905
|
-
*
|
|
2906
|
-
*
|
|
2907
|
-
* }
|
|
3012
|
+
* const config: GoogleAnalyticsConfig = {
|
|
3013
|
+
* measurementId: 'G-XXXXXXXXXX',
|
|
3014
|
+
* config: { anonymize_ip: true }
|
|
3015
|
+
* }
|
|
2908
3016
|
* ```
|
|
2909
|
-
*
|
|
2910
|
-
* @remarks
|
|
2911
|
-
* - Define cookies: _fbp, fr
|
|
2912
|
-
* - Categoria padrão: 'marketing'
|
|
2913
|
-
* - SSR-safe: verifica disponibilidade do window
|
|
2914
3017
|
*/
|
|
2915
|
-
|
|
3018
|
+
interface GoogleAnalyticsConfig {
|
|
3019
|
+
/** ID de medição do GA4 (formato: G-XXXXXXXXXX) */
|
|
3020
|
+
measurementId: string;
|
|
3021
|
+
/** Configurações adicionais para o gtag */
|
|
3022
|
+
config?: Record<string, unknown>;
|
|
3023
|
+
/** URL do script GA4. Se omitido usa o padrão oficial. */
|
|
3024
|
+
scriptUrl?: string;
|
|
3025
|
+
/** Categoria LGPD customizada (opcional). */
|
|
3026
|
+
category?: string;
|
|
3027
|
+
}
|
|
2916
3028
|
/**
|
|
2917
|
-
*
|
|
2918
|
-
* Configura as configurações do Hotjar e inicializa o tracking de heatmaps e gravações.
|
|
3029
|
+
* Configuração para integração do Google Tag Manager (GTM).
|
|
2919
3030
|
*
|
|
2920
3031
|
* @category Utils
|
|
2921
|
-
* @
|
|
2922
|
-
* @returns Integração configurada para o Hotjar
|
|
2923
|
-
* @since 0.4.1
|
|
3032
|
+
* @since 0.2.0
|
|
2924
3033
|
*
|
|
2925
3034
|
* @example
|
|
2926
3035
|
* ```typescript
|
|
2927
|
-
* const
|
|
2928
|
-
*
|
|
2929
|
-
*
|
|
2930
|
-
* }
|
|
3036
|
+
* const config: GoogleTagManagerConfig = {
|
|
3037
|
+
* containerId: 'GTM-XXXXXXX',
|
|
3038
|
+
* dataLayerName: 'customDataLayer'
|
|
3039
|
+
* }
|
|
2931
3040
|
* ```
|
|
2932
|
-
*
|
|
2933
|
-
* @remarks
|
|
2934
|
-
* - Define cookies: _hjSession_*, _hjSessionUser_*, _hjFirstSeen, _hjIncludedInSessionSample, _hjAbsoluteSessionInProgress
|
|
2935
|
-
* - Categoria padrão: 'analytics'
|
|
2936
|
-
* - SSR-safe: verifica disponibilidade do window
|
|
2937
3041
|
*/
|
|
2938
|
-
|
|
3042
|
+
interface GoogleTagManagerConfig {
|
|
3043
|
+
/** ID do container GTM (formato: GTM-XXXXXXX) */
|
|
3044
|
+
containerId: string;
|
|
3045
|
+
/** Nome customizado para o dataLayer. Padrão: 'dataLayer' */
|
|
3046
|
+
dataLayerName?: string;
|
|
3047
|
+
/** URL do script GTM. Se omitido usa o padrão oficial. */
|
|
3048
|
+
scriptUrl?: string;
|
|
3049
|
+
/** Categoria LGPD customizada (opcional). */
|
|
3050
|
+
category?: string;
|
|
3051
|
+
}
|
|
2939
3052
|
/**
|
|
2940
|
-
*
|
|
2941
|
-
* Configura e inicializa o Mixpanel para analytics de eventos.
|
|
3053
|
+
* Configuração para integração do UserWay (Acessibilidade).
|
|
2942
3054
|
*
|
|
2943
3055
|
* @category Utils
|
|
2944
|
-
* @
|
|
2945
|
-
* @returns Integração configurada para o Mixpanel
|
|
2946
|
-
* @since 0.4.1
|
|
3056
|
+
* @since 0.2.0
|
|
2947
3057
|
*
|
|
2948
3058
|
* @example
|
|
2949
3059
|
* ```typescript
|
|
2950
|
-
* const
|
|
2951
|
-
*
|
|
2952
|
-
*
|
|
2953
|
-
* })
|
|
3060
|
+
* const config: UserWayConfig = {
|
|
3061
|
+
* accountId: 'XXXXXXXXXX'
|
|
3062
|
+
* }
|
|
2954
3063
|
* ```
|
|
2955
|
-
*
|
|
2956
|
-
* @remarks
|
|
2957
|
-
* - Define cookies: mp_*
|
|
2958
|
-
* - Categoria padrão: 'analytics'
|
|
2959
|
-
* - SSR-safe: verifica disponibilidade do window
|
|
2960
|
-
* - Inclui tratamento de erro na inicialização
|
|
2961
3064
|
*/
|
|
2962
|
-
|
|
3065
|
+
interface UserWayConfig {
|
|
3066
|
+
/** ID da conta UserWay */
|
|
3067
|
+
accountId: string;
|
|
3068
|
+
/** URL do script UserWay. Se omitido usa o padrão oficial. */
|
|
3069
|
+
scriptUrl?: string;
|
|
3070
|
+
/** Categoria LGPD customizada (opcional). */
|
|
3071
|
+
category?: string;
|
|
3072
|
+
}
|
|
2963
3073
|
/**
|
|
2964
|
-
* Cria integração do
|
|
2965
|
-
* Configura o
|
|
3074
|
+
* Cria integração do Google Analytics (GA4).
|
|
3075
|
+
* Configura o gtag e inicializa o tracking com o measurement ID fornecido.
|
|
2966
3076
|
*
|
|
2967
3077
|
* @category Utils
|
|
2968
|
-
* @param config - Configuração do
|
|
2969
|
-
* @returns Integração configurada para o
|
|
2970
|
-
* @since 0.
|
|
3078
|
+
* @param config - Configuração do Google Analytics
|
|
3079
|
+
* @returns Integração configurada para o GA4
|
|
3080
|
+
* @since 0.2.0
|
|
2971
3081
|
*
|
|
2972
3082
|
* @example
|
|
2973
3083
|
* ```typescript
|
|
2974
|
-
* const
|
|
2975
|
-
*
|
|
2976
|
-
*
|
|
3084
|
+
* const ga = createGoogleAnalyticsIntegration({
|
|
3085
|
+
* measurementId: 'G-XXXXXXXXXX',
|
|
3086
|
+
* config: { anonymize_ip: true }
|
|
2977
3087
|
* })
|
|
2978
3088
|
* ```
|
|
2979
3089
|
*
|
|
2980
3090
|
* @remarks
|
|
2981
|
-
* - Define cookies:
|
|
3091
|
+
* - Define cookies: _ga, _ga_*, _gid
|
|
2982
3092
|
* - Categoria padrão: 'analytics'
|
|
2983
3093
|
* - SSR-safe: verifica disponibilidade do window
|
|
2984
|
-
* - Configuração de upload opcional
|
|
2985
3094
|
*/
|
|
2986
|
-
declare function
|
|
3095
|
+
declare function createGoogleAnalyticsIntegration(config: GoogleAnalyticsConfig): ScriptIntegration;
|
|
2987
3096
|
/**
|
|
2988
|
-
* Cria integração do
|
|
2989
|
-
* Configura o
|
|
3097
|
+
* Cria integração do Google Tag Manager (GTM).
|
|
3098
|
+
* Configura o dataLayer e inicializa o container GTM.
|
|
2990
3099
|
*
|
|
2991
3100
|
* @category Utils
|
|
2992
|
-
* @param config - Configuração do
|
|
2993
|
-
* @returns Integração configurada para o
|
|
2994
|
-
* @since 0.
|
|
3101
|
+
* @param config - Configuração do Google Tag Manager
|
|
3102
|
+
* @returns Integração configurada para o GTM
|
|
3103
|
+
* @since 0.2.0
|
|
2995
3104
|
*
|
|
2996
3105
|
* @example
|
|
2997
3106
|
* ```typescript
|
|
2998
|
-
* const
|
|
2999
|
-
*
|
|
3107
|
+
* const gtm = createGoogleTagManagerIntegration({
|
|
3108
|
+
* containerId: 'GTM-XXXXXXX',
|
|
3109
|
+
* dataLayerName: 'myDataLayer'
|
|
3000
3110
|
* })
|
|
3001
3111
|
* ```
|
|
3002
3112
|
*
|
|
3003
3113
|
* @remarks
|
|
3004
|
-
* - Define cookies:
|
|
3005
|
-
* - Categoria padrão: '
|
|
3114
|
+
* - Define cookies: _gcl_au
|
|
3115
|
+
* - Categoria padrão: 'analytics'
|
|
3006
3116
|
* - SSR-safe: verifica disponibilidade do window
|
|
3007
|
-
* - Inclui tratamento de erro na inicialização
|
|
3008
3117
|
*/
|
|
3009
|
-
declare function
|
|
3118
|
+
declare function createGoogleTagManagerIntegration(config: GoogleTagManagerConfig): ScriptIntegration;
|
|
3010
3119
|
/**
|
|
3011
|
-
* Cria integração do
|
|
3012
|
-
* Configura o widget de
|
|
3120
|
+
* Cria integração do UserWay (Acessibilidade).
|
|
3121
|
+
* Configura o widget de acessibilidade UserWay.
|
|
3013
3122
|
*
|
|
3014
3123
|
* @category Utils
|
|
3015
|
-
* @param config - Configuração do
|
|
3016
|
-
* @returns Integração configurada para o
|
|
3017
|
-
* @since 0.
|
|
3124
|
+
* @param config - Configuração do UserWay
|
|
3125
|
+
* @returns Integração configurada para o UserWay
|
|
3126
|
+
* @since 0.2.0
|
|
3018
3127
|
*
|
|
3019
3128
|
* @example
|
|
3020
3129
|
* ```typescript
|
|
3021
|
-
* const
|
|
3022
|
-
*
|
|
3130
|
+
* const userway = createUserWayIntegration({
|
|
3131
|
+
* accountId: 'XXXXXXXXXX'
|
|
3023
3132
|
* })
|
|
3024
3133
|
* ```
|
|
3025
3134
|
*
|
|
3026
3135
|
* @remarks
|
|
3027
|
-
* - Define cookies:
|
|
3136
|
+
* - Define cookies: _userway_*
|
|
3028
3137
|
* - Categoria padrão: 'functional'
|
|
3029
3138
|
* - SSR-safe: verifica disponibilidade do window
|
|
3030
|
-
* - Inclui tratamento de erro na identificação
|
|
3031
3139
|
*/
|
|
3032
|
-
declare function
|
|
3140
|
+
declare function createUserWayIntegration(config: UserWayConfig): ScriptIntegration;
|
|
3033
3141
|
/**
|
|
3034
|
-
*
|
|
3035
|
-
*
|
|
3142
|
+
* Funções fábricas para integrações comuns.
|
|
3143
|
+
* Fornece acesso direto às funções de criação de integrações pré-configuradas.
|
|
3036
3144
|
*
|
|
3037
3145
|
* @category Utils
|
|
3038
|
-
* @since 0.
|
|
3146
|
+
* @since 0.2.0
|
|
3039
3147
|
*
|
|
3040
3148
|
* @example
|
|
3041
3149
|
* ```typescript
|
|
3042
|
-
* const
|
|
3043
|
-
* googleAnalytics: { measurementId: 'G-XXXXXXXXXX' },
|
|
3044
|
-
* facebookPixel: { pixelId: '1234567890123456' }
|
|
3045
|
-
* }
|
|
3150
|
+
* const ga = COMMON_INTEGRATIONS.googleAnalytics({ measurementId: 'G-XXXXXXXXXX' })
|
|
3046
3151
|
* ```
|
|
3047
3152
|
*/
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
/** Configuração do Hotjar */
|
|
3054
|
-
hotjar?: HotjarConfig;
|
|
3055
|
-
/** Configuração do UserWay */
|
|
3056
|
-
userway?: UserWayConfig;
|
|
3057
|
-
}
|
|
3153
|
+
declare const COMMON_INTEGRATIONS: {
|
|
3154
|
+
googleAnalytics: typeof createGoogleAnalyticsIntegration;
|
|
3155
|
+
googleTagManager: typeof createGoogleTagManagerIntegration;
|
|
3156
|
+
userway: typeof createUserWayIntegration;
|
|
3157
|
+
};
|
|
3058
3158
|
/**
|
|
3059
|
-
* Configuração para
|
|
3060
|
-
* Define configurações opcionais para múltiplas integrações otimizadas para SaaS.
|
|
3159
|
+
* Configuração para integração do Facebook Pixel.
|
|
3061
3160
|
*
|
|
3062
3161
|
* @category Utils
|
|
3063
3162
|
* @since 0.4.1
|
|
3064
3163
|
*
|
|
3065
3164
|
* @example
|
|
3066
3165
|
* ```typescript
|
|
3067
|
-
* const config:
|
|
3068
|
-
*
|
|
3069
|
-
*
|
|
3070
|
-
*
|
|
3166
|
+
* const config: FacebookPixelConfig = {
|
|
3167
|
+
* pixelId: '1234567890123456',
|
|
3168
|
+
* autoTrack: true,
|
|
3169
|
+
* advancedMatching: { email: 'user@example.com' }
|
|
3071
3170
|
* }
|
|
3072
3171
|
* ```
|
|
3073
3172
|
*/
|
|
3074
|
-
interface
|
|
3075
|
-
/**
|
|
3076
|
-
|
|
3077
|
-
/**
|
|
3078
|
-
|
|
3079
|
-
/** Configuração
|
|
3080
|
-
|
|
3081
|
-
/**
|
|
3082
|
-
|
|
3173
|
+
interface FacebookPixelConfig {
|
|
3174
|
+
/** ID do pixel do Facebook */
|
|
3175
|
+
pixelId: string;
|
|
3176
|
+
/** Se deve rastrear PageView automaticamente. Padrão: true */
|
|
3177
|
+
autoTrack?: boolean;
|
|
3178
|
+
/** Configuração de correspondência avançada */
|
|
3179
|
+
advancedMatching?: Record<string, unknown>;
|
|
3180
|
+
/** URL do script do Pixel. Se omitido usa o padrão oficial. */
|
|
3181
|
+
scriptUrl?: string;
|
|
3182
|
+
/** Categoria LGPD customizada (opcional). */
|
|
3183
|
+
category?: string;
|
|
3083
3184
|
}
|
|
3084
3185
|
/**
|
|
3085
|
-
* Configuração para
|
|
3086
|
-
* Define configurações opcionais para múltiplas integrações otimizadas para ambientes corporativos.
|
|
3186
|
+
* Configuração para integração do Hotjar.
|
|
3087
3187
|
*
|
|
3088
3188
|
* @category Utils
|
|
3089
3189
|
* @since 0.4.1
|
|
3090
3190
|
*
|
|
3091
3191
|
* @example
|
|
3092
3192
|
* ```typescript
|
|
3093
|
-
* const config:
|
|
3094
|
-
*
|
|
3095
|
-
*
|
|
3096
|
-
*
|
|
3193
|
+
* const config: HotjarConfig = {
|
|
3194
|
+
* siteId: '1234567',
|
|
3195
|
+
* version: 6,
|
|
3196
|
+
* debug: false
|
|
3097
3197
|
* }
|
|
3098
3198
|
* ```
|
|
3099
3199
|
*/
|
|
3100
|
-
interface
|
|
3101
|
-
/**
|
|
3102
|
-
|
|
3103
|
-
/**
|
|
3104
|
-
|
|
3105
|
-
/**
|
|
3106
|
-
|
|
3107
|
-
/**
|
|
3108
|
-
|
|
3200
|
+
interface HotjarConfig {
|
|
3201
|
+
/** ID do site no Hotjar */
|
|
3202
|
+
siteId: string;
|
|
3203
|
+
/** Versão do script Hotjar. Padrão: 6 */
|
|
3204
|
+
version?: number;
|
|
3205
|
+
/** Ativar modo debug. Padrão: false */
|
|
3206
|
+
debug?: boolean;
|
|
3207
|
+
/** URL do script Hotjar. Se omitido usa o padrão oficial. */
|
|
3208
|
+
scriptUrl?: string;
|
|
3209
|
+
/** Categoria LGPD customizada (opcional). */
|
|
3210
|
+
category?: string;
|
|
3109
3211
|
}
|
|
3110
3212
|
/**
|
|
3111
|
-
*
|
|
3112
|
-
* Combina analytics de conversão, remarketing e acessibilidade.
|
|
3213
|
+
* Configuração para integração do Mixpanel.
|
|
3113
3214
|
*
|
|
3114
3215
|
* @category Utils
|
|
3115
|
-
* @param cfg - Configuração das integrações de e-commerce
|
|
3116
|
-
* @returns Array de integrações configuradas
|
|
3117
3216
|
* @since 0.4.1
|
|
3118
3217
|
*
|
|
3119
3218
|
* @example
|
|
3120
3219
|
* ```typescript
|
|
3121
|
-
* const
|
|
3122
|
-
*
|
|
3123
|
-
*
|
|
3124
|
-
*
|
|
3220
|
+
* const config: MixpanelConfig = {
|
|
3221
|
+
* token: 'your-project-token',
|
|
3222
|
+
* config: { debug: true },
|
|
3223
|
+
* api_host: 'https://api.mixpanel.com'
|
|
3224
|
+
* }
|
|
3125
3225
|
* ```
|
|
3126
|
-
*
|
|
3127
|
-
* @remarks
|
|
3128
|
-
* Combina categorias: analytics, marketing, functional
|
|
3129
3226
|
*/
|
|
3130
|
-
|
|
3227
|
+
interface MixpanelConfig {
|
|
3228
|
+
/** Token do projeto Mixpanel */
|
|
3229
|
+
token: string;
|
|
3230
|
+
/** Configurações adicionais do Mixpanel */
|
|
3231
|
+
config?: Record<string, unknown>;
|
|
3232
|
+
/** Host customizado da API Mixpanel */
|
|
3233
|
+
api_host?: string;
|
|
3234
|
+
/** URL do script Mixpanel. Se omitido usa o padrão oficial. */
|
|
3235
|
+
scriptUrl?: string;
|
|
3236
|
+
/** Categoria LGPD customizada (opcional). */
|
|
3237
|
+
category?: string;
|
|
3238
|
+
}
|
|
3131
3239
|
/**
|
|
3132
|
-
*
|
|
3133
|
-
* Combina analytics de produto, suporte ao cliente e comportamento do usuário.
|
|
3240
|
+
* Configuração para integração do Microsoft Clarity.
|
|
3134
3241
|
*
|
|
3135
3242
|
* @category Utils
|
|
3136
|
-
* @param cfg - Configuração das integrações de SaaS
|
|
3137
|
-
* @returns Array de integrações configuradas
|
|
3138
3243
|
* @since 0.4.1
|
|
3139
3244
|
*
|
|
3140
3245
|
* @example
|
|
3141
3246
|
* ```typescript
|
|
3142
|
-
* const
|
|
3143
|
-
*
|
|
3144
|
-
*
|
|
3145
|
-
*
|
|
3146
|
-
* })
|
|
3247
|
+
* const config: ClarityConfig = {
|
|
3248
|
+
* projectId: 'abcdefghij',
|
|
3249
|
+
* upload: true
|
|
3250
|
+
* }
|
|
3147
3251
|
* ```
|
|
3148
|
-
*
|
|
3149
|
-
* @remarks
|
|
3150
|
-
* Combina categorias: analytics, functional
|
|
3151
3252
|
*/
|
|
3152
|
-
|
|
3253
|
+
interface ClarityConfig {
|
|
3254
|
+
/** ID do projeto no Microsoft Clarity */
|
|
3255
|
+
projectId: string;
|
|
3256
|
+
/** Configuração de upload de dados. Padrão: indefinido */
|
|
3257
|
+
upload?: boolean;
|
|
3258
|
+
/** URL do script Clarity. Se omitido usa o padrão oficial. */
|
|
3259
|
+
scriptUrl?: string;
|
|
3260
|
+
/** Categoria LGPD customizada (opcional). */
|
|
3261
|
+
category?: string;
|
|
3262
|
+
}
|
|
3153
3263
|
/**
|
|
3154
|
-
*
|
|
3155
|
-
* Combina analytics empresariais, compliance e suporte corporativo.
|
|
3264
|
+
* Configuração para integração do Intercom.
|
|
3156
3265
|
*
|
|
3157
3266
|
* @category Utils
|
|
3158
|
-
* @param cfg - Configuração das integrações corporativas
|
|
3159
|
-
* @returns Array de integrações configuradas
|
|
3160
3267
|
* @since 0.4.1
|
|
3161
3268
|
*
|
|
3162
3269
|
* @example
|
|
3163
3270
|
* ```typescript
|
|
3164
|
-
* const
|
|
3165
|
-
*
|
|
3166
|
-
*
|
|
3167
|
-
* userway: { accountId: 'XXXXXXXXXX' }
|
|
3168
|
-
* })
|
|
3271
|
+
* const config: IntercomConfig = {
|
|
3272
|
+
* app_id: 'your-app-id'
|
|
3273
|
+
* }
|
|
3169
3274
|
* ```
|
|
3170
|
-
*
|
|
3171
|
-
* @remarks
|
|
3172
|
-
* Combina categorias: analytics, functional
|
|
3173
3275
|
*/
|
|
3174
|
-
|
|
3276
|
+
interface IntercomConfig {
|
|
3277
|
+
/** ID da aplicação Intercom */
|
|
3278
|
+
app_id: string;
|
|
3279
|
+
/** URL do script Intercom. Se omitido usa o padrão oficial. */
|
|
3280
|
+
scriptUrl?: string;
|
|
3281
|
+
/** Categoria LGPD customizada (opcional). */
|
|
3282
|
+
category?: string;
|
|
3283
|
+
}
|
|
3175
3284
|
/**
|
|
3176
|
-
*
|
|
3177
|
-
* Define integrações essenciais e opcionais para cada contexto.
|
|
3285
|
+
* Configuração para integração do Zendesk Chat.
|
|
3178
3286
|
*
|
|
3179
3287
|
* @category Utils
|
|
3180
3288
|
* @since 0.4.1
|
|
3181
3289
|
*
|
|
3182
3290
|
* @example
|
|
3183
3291
|
* ```typescript
|
|
3184
|
-
* const
|
|
3185
|
-
*
|
|
3186
|
-
*
|
|
3292
|
+
* const config: ZendeskConfig = {
|
|
3293
|
+
* key: 'your-zendesk-key'
|
|
3294
|
+
* }
|
|
3187
3295
|
* ```
|
|
3188
|
-
*
|
|
3189
|
-
* @remarks
|
|
3190
|
-
* Cada template define:
|
|
3191
|
-
* - essential: integrações obrigatórias/recomendadas
|
|
3192
|
-
* - optional: integrações complementares
|
|
3193
|
-
* - categories: categorias LGPD utilizadas
|
|
3194
3296
|
*/
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
optional: string[];
|
|
3204
|
-
categories: string[];
|
|
3205
|
-
};
|
|
3206
|
-
corporate: {
|
|
3207
|
-
essential: string[];
|
|
3208
|
-
optional: string[];
|
|
3209
|
-
categories: string[];
|
|
3210
|
-
};
|
|
3211
|
-
};
|
|
3297
|
+
interface ZendeskConfig {
|
|
3298
|
+
/** Chave de identificação do Zendesk */
|
|
3299
|
+
key: string;
|
|
3300
|
+
/** URL do script Zendesk. Se omitido usa o padrão oficial. */
|
|
3301
|
+
scriptUrl?: string;
|
|
3302
|
+
/** Categoria LGPD customizada (opcional). */
|
|
3303
|
+
category?: string;
|
|
3304
|
+
}
|
|
3212
3305
|
/**
|
|
3213
|
-
*
|
|
3214
|
-
*
|
|
3306
|
+
* Cria integração do Facebook Pixel.
|
|
3307
|
+
* Configura o fbq e inicializa o pixel com tracking automático opcional.
|
|
3215
3308
|
*
|
|
3216
3309
|
* @category Utils
|
|
3217
|
-
* @param
|
|
3218
|
-
* @returns
|
|
3310
|
+
* @param config - Configuração do Facebook Pixel
|
|
3311
|
+
* @returns Integração configurada para o Facebook Pixel
|
|
3219
3312
|
* @since 0.4.1
|
|
3220
3313
|
*
|
|
3221
3314
|
* @example
|
|
3222
3315
|
* ```typescript
|
|
3223
|
-
*
|
|
3224
|
-
*
|
|
3225
|
-
*
|
|
3226
|
-
*
|
|
3316
|
+
* const pixel = createFacebookPixelIntegration({
|
|
3317
|
+
* pixelId: '1234567890123456',
|
|
3318
|
+
* autoTrack: true
|
|
3319
|
+
* })
|
|
3227
3320
|
* ```
|
|
3228
3321
|
*
|
|
3229
3322
|
* @remarks
|
|
3230
|
-
*
|
|
3231
|
-
* -
|
|
3232
|
-
* -
|
|
3233
|
-
* - Scripts de chat/suporte → 'functional'
|
|
3234
|
-
* - Padrão para desconhecidos → 'analytics'
|
|
3235
|
-
*/
|
|
3236
|
-
declare function suggestCategoryForScript(name: string): string[];
|
|
3237
|
-
|
|
3238
|
-
/**
|
|
3239
|
-
* Componente que carrega scripts automaticamente baseado no consentimento.
|
|
3240
|
-
* Facilita integração com ferramentas como Google Analytics, Tag Manager, etc.
|
|
3323
|
+
* - Define cookies: _fbp, fr
|
|
3324
|
+
* - Categoria padrão: 'marketing'
|
|
3325
|
+
* - SSR-safe: verifica disponibilidade do window
|
|
3241
3326
|
*/
|
|
3242
|
-
|
|
3243
|
-
interface RegisteredScript {
|
|
3244
|
-
id: string;
|
|
3245
|
-
category: string;
|
|
3246
|
-
execute: () => void | Promise<void>;
|
|
3247
|
-
priority?: number;
|
|
3248
|
-
allowReload?: boolean;
|
|
3249
|
-
onConsentUpdate?: (consent: {
|
|
3250
|
-
consented: boolean;
|
|
3251
|
-
preferences: ConsentPreferences;
|
|
3252
|
-
}) => void;
|
|
3253
|
-
}
|
|
3327
|
+
declare function createFacebookPixelIntegration(config: FacebookPixelConfig): ScriptIntegration;
|
|
3254
3328
|
/**
|
|
3255
|
-
*
|
|
3256
|
-
*
|
|
3257
|
-
* @remarks
|
|
3258
|
-
* - Scripts `necessary` rodam imediatamente; demais aguardam consentimento da categoria.
|
|
3259
|
-
* - Fluxo de estados: `pending` → `running` → `executed` (respeitando `allowReload` e `onConsentUpdate`).
|
|
3260
|
-
* - A fila é ordenada por categoria, `priority` (maior primeiro) e ordem de registro.
|
|
3261
|
-
* - `allowReload` permite reexecutar scripts quando o usuário muda preferências.
|
|
3262
|
-
* - Use `onConsentUpdate` para reenviar sinais (ex.: Consent Mode) após novas decisões.
|
|
3263
|
-
* - Sempre chame o cleanup retornado em efeitos React para evitar múltiplos registros do mesmo `id`.
|
|
3329
|
+
* Cria integração do Hotjar.
|
|
3330
|
+
* Configura as configurações do Hotjar e inicializa o tracking de heatmaps e gravações.
|
|
3264
3331
|
*
|
|
3265
|
-
* @param def Definição do script a ser registrado.
|
|
3266
|
-
* @returns Função de cleanup para remover o script da fila.
|
|
3267
|
-
*/
|
|
3268
|
-
declare function registerScript(def: RegisteredScript): () => void;
|
|
3269
|
-
interface ConsentScriptLoaderProps {
|
|
3270
|
-
/** Lista de integrações de scripts para carregar baseado no consentimento */
|
|
3271
|
-
integrations: ScriptIntegration[];
|
|
3272
|
-
/** Se true, força recarregamento se consentimento mudar */
|
|
3273
|
-
reloadOnChange?: boolean;
|
|
3274
|
-
/** Nonce CSP aplicado às tags <script> geradas automaticamente (sobrescrevível por integração). */
|
|
3275
|
-
nonce?: string;
|
|
3276
|
-
}
|
|
3277
|
-
/**
|
|
3278
|
-
* @component
|
|
3279
3332
|
* @category Utils
|
|
3280
|
-
* @
|
|
3281
|
-
*
|
|
3282
|
-
*
|
|
3283
|
-
*
|
|
3284
|
-
* @param props As propriedades do componente.
|
|
3285
|
-
* @param {ScriptIntegration[]} props.integrations Um array de objetos de integração de script. Use as factory functions (`createGoogleAnalyticsIntegration`, etc.) para criar.
|
|
3286
|
-
* @param {boolean} [props.reloadOnChange=false] Se `true`, recarrega os scripts se as preferências de consentimento mudarem.
|
|
3333
|
+
* @param config - Configuração do Hotjar
|
|
3334
|
+
* @returns Integração configurada para o Hotjar
|
|
3335
|
+
* @since 0.4.1
|
|
3287
3336
|
*
|
|
3288
3337
|
* @example
|
|
3289
|
-
* ```
|
|
3290
|
-
* const
|
|
3291
|
-
*
|
|
3292
|
-
*
|
|
3293
|
-
*
|
|
3294
|
-
*
|
|
3295
|
-
* <ConsentScriptLoader integrations={integrations} />
|
|
3338
|
+
* ```typescript
|
|
3339
|
+
* const hotjar = createHotjarIntegration({
|
|
3340
|
+
* siteId: '1234567',
|
|
3341
|
+
* debug: true
|
|
3342
|
+
* })
|
|
3296
3343
|
* ```
|
|
3297
|
-
*/
|
|
3298
|
-
declare function ConsentScriptLoader({ integrations, reloadOnChange, nonce, }: Readonly<ConsentScriptLoaderProps>): null;
|
|
3299
|
-
/**
|
|
3300
|
-
* @hook
|
|
3301
|
-
* @category Hooks
|
|
3302
|
-
* @since 0.2.0
|
|
3303
|
-
* Hook para carregamento programático de um script baseado no consentimento.
|
|
3304
|
-
*
|
|
3305
|
-
* @returns Uma função assíncrona que recebe um objeto de integração de script e tenta carregá-lo.
|
|
3306
|
-
* Retorna `true` em caso de sucesso e `false` em caso de falha (por falta de consentimento ou erro de rede).
|
|
3307
|
-
*
|
|
3308
|
-
* @example
|
|
3309
|
-
* ```tsx
|
|
3310
|
-
* const loadScript = useConsentScriptLoader();
|
|
3311
|
-
*
|
|
3312
|
-
* useEffect(() => {
|
|
3313
|
-
* const handleUserAction = async () => {
|
|
3314
|
-
* const hotjarIntegration = { id: 'hotjar', category: 'analytics', src: '...' };
|
|
3315
|
-
* const success = await loadScript(hotjarIntegration);
|
|
3316
|
-
* if (success) {
|
|
3317
|
-
* console.log('Hotjar carregado com sucesso!');
|
|
3318
|
-
* }
|
|
3319
|
-
* };
|
|
3320
3344
|
*
|
|
3321
|
-
*
|
|
3322
|
-
*
|
|
3323
|
-
*
|
|
3324
|
-
*
|
|
3325
|
-
*/
|
|
3326
|
-
declare function useConsentScriptLoader(): (integration: ScriptIntegration, nonce?: string) => Promise<boolean>;
|
|
3327
|
-
|
|
3328
|
-
/**
|
|
3329
|
-
* @file autoConfigureCategories.ts
|
|
3330
|
-
* @description Sistema inteligente de auto-habilitação de categorias baseado nas integrações utilizadas
|
|
3331
|
-
* @since 0.4.1
|
|
3332
|
-
*/
|
|
3333
|
-
|
|
3334
|
-
/**
|
|
3335
|
-
* @interface CategoryAutoConfigResult
|
|
3336
|
-
* Resultado da análise e auto-configuração de categorias
|
|
3345
|
+
* @remarks
|
|
3346
|
+
* - Define cookies: _hjSession_*, _hjSessionUser_*, _hjFirstSeen, _hjIncludedInSessionSample, _hjAbsoluteSessionInProgress
|
|
3347
|
+
* - Categoria padrão: 'analytics'
|
|
3348
|
+
* - SSR-safe: verifica disponibilidade do window
|
|
3337
3349
|
*/
|
|
3338
|
-
|
|
3339
|
-
/** Configuração original fornecida pelo desenvolvedor */
|
|
3340
|
-
originalConfig: ProjectCategoriesConfig;
|
|
3341
|
-
/** Configuração ajustada automaticamente pela biblioteca */
|
|
3342
|
-
adjustedConfig: ProjectCategoriesConfig;
|
|
3343
|
-
/** Categorias que foram automaticamente habilitadas */
|
|
3344
|
-
autoEnabledCategories: string[];
|
|
3345
|
-
/** Categorias requeridas pelas integrações mas não habilitadas */
|
|
3346
|
-
missingCategories: string[];
|
|
3347
|
-
/** Se algum ajuste foi necessário */
|
|
3348
|
-
wasAdjusted: boolean;
|
|
3349
|
-
/** Integrações que requerem cada categoria */
|
|
3350
|
-
categoryIntegrations: Record<string, string[]>;
|
|
3351
|
-
}
|
|
3350
|
+
declare function createHotjarIntegration(config: HotjarConfig): ScriptIntegration;
|
|
3352
3351
|
/**
|
|
3353
|
-
*
|
|
3352
|
+
* Cria integração do Mixpanel.
|
|
3353
|
+
* Configura e inicializa o Mixpanel para analytics de eventos.
|
|
3354
|
+
*
|
|
3354
3355
|
* @category Utils
|
|
3356
|
+
* @param config - Configuração do Mixpanel
|
|
3357
|
+
* @returns Integração configurada para o Mixpanel
|
|
3355
3358
|
* @since 0.4.1
|
|
3356
|
-
* Analisa as integrações fornecidas e determina quais categorias são necessárias.
|
|
3357
3359
|
*
|
|
3358
|
-
* @
|
|
3359
|
-
*
|
|
3360
|
+
* @example
|
|
3361
|
+
* ```typescript
|
|
3362
|
+
* const mixpanel = createMixpanelIntegration({
|
|
3363
|
+
* token: 'your-project-token',
|
|
3364
|
+
* config: { debug: true }
|
|
3365
|
+
* })
|
|
3366
|
+
* ```
|
|
3367
|
+
*
|
|
3368
|
+
* @remarks
|
|
3369
|
+
* - Define cookies: mp_*
|
|
3370
|
+
* - Categoria padrão: 'analytics'
|
|
3371
|
+
* - SSR-safe: verifica disponibilidade do window
|
|
3372
|
+
* - Inclui tratamento de erro na inicialização
|
|
3360
3373
|
*/
|
|
3361
|
-
declare function
|
|
3374
|
+
declare function createMixpanelIntegration(config: MixpanelConfig): ScriptIntegration;
|
|
3362
3375
|
/**
|
|
3363
|
-
*
|
|
3376
|
+
* Cria integração do Microsoft Clarity.
|
|
3377
|
+
* Configura o Microsoft Clarity para heatmaps e analytics de comportamento.
|
|
3378
|
+
*
|
|
3364
3379
|
* @category Utils
|
|
3380
|
+
* @param config - Configuração do Microsoft Clarity
|
|
3381
|
+
* @returns Integração configurada para o Clarity
|
|
3365
3382
|
* @since 0.4.1
|
|
3366
|
-
* Configura automaticamente as categorias necessárias baseado nas integrações utilizadas.
|
|
3367
3383
|
*
|
|
3368
|
-
*
|
|
3369
|
-
*
|
|
3370
|
-
*
|
|
3371
|
-
*
|
|
3372
|
-
*
|
|
3384
|
+
* @example
|
|
3385
|
+
* ```typescript
|
|
3386
|
+
* const clarity = createClarityIntegration({
|
|
3387
|
+
* projectId: 'abcdefghij',
|
|
3388
|
+
* upload: false
|
|
3389
|
+
* })
|
|
3390
|
+
* ```
|
|
3373
3391
|
*
|
|
3374
|
-
* @
|
|
3375
|
-
*
|
|
3376
|
-
*
|
|
3377
|
-
*
|
|
3392
|
+
* @remarks
|
|
3393
|
+
* - Define cookies: _clck, _clsk, CLID, ANONCHK, MR, MUID, SM
|
|
3394
|
+
* - Categoria padrão: 'analytics'
|
|
3395
|
+
* - SSR-safe: verifica disponibilidade do window
|
|
3396
|
+
* - Configuração de upload opcional
|
|
3378
3397
|
*/
|
|
3379
|
-
declare function
|
|
3380
|
-
/** Se true, apenas avisa mas não modifica a config (padrão: false - auto-habilita) */
|
|
3381
|
-
warningOnly?: boolean;
|
|
3382
|
-
/** Se true, desabilita logs no console (padrão: false) */
|
|
3383
|
-
silent?: boolean;
|
|
3384
|
-
}): CategoryAutoConfigResult;
|
|
3398
|
+
declare function createClarityIntegration(config: ClarityConfig): ScriptIntegration;
|
|
3385
3399
|
/**
|
|
3386
|
-
*
|
|
3400
|
+
* Cria integração do Intercom.
|
|
3401
|
+
* Configura o widget de chat e suporte do Intercom.
|
|
3402
|
+
*
|
|
3387
3403
|
* @category Utils
|
|
3404
|
+
* @param config - Configuração do Intercom
|
|
3405
|
+
* @returns Integração configurada para o Intercom
|
|
3388
3406
|
* @since 0.4.1
|
|
3389
|
-
* Valida se todas as integrações têm suas categorias habilitadas.
|
|
3390
|
-
* Útil para validação em tempo de execução.
|
|
3391
3407
|
*
|
|
3392
|
-
* @
|
|
3393
|
-
*
|
|
3394
|
-
*
|
|
3408
|
+
* @example
|
|
3409
|
+
* ```typescript
|
|
3410
|
+
* const intercom = createIntercomIntegration({
|
|
3411
|
+
* app_id: 'your-app-id'
|
|
3412
|
+
* })
|
|
3413
|
+
* ```
|
|
3414
|
+
*
|
|
3415
|
+
* @remarks
|
|
3416
|
+
* - Define cookies: intercom-id-*, intercom-session-*
|
|
3417
|
+
* - Categoria padrão: 'functional'
|
|
3418
|
+
* - SSR-safe: verifica disponibilidade do window
|
|
3419
|
+
* - Inclui tratamento de erro na inicialização
|
|
3395
3420
|
*/
|
|
3396
|
-
declare function
|
|
3421
|
+
declare function createIntercomIntegration(config: IntercomConfig): ScriptIntegration;
|
|
3397
3422
|
/**
|
|
3398
|
-
*
|
|
3423
|
+
* Cria integração do Zendesk Chat.
|
|
3424
|
+
* Configura o widget de chat e suporte do Zendesk.
|
|
3425
|
+
*
|
|
3399
3426
|
* @category Utils
|
|
3427
|
+
* @param config - Configuração do Zendesk Chat
|
|
3428
|
+
* @returns Integração configurada para o Zendesk Chat
|
|
3400
3429
|
* @since 0.4.1
|
|
3401
|
-
* Extrai categorias únicas de um array de integrações
|
|
3402
3430
|
*
|
|
3403
|
-
* @
|
|
3404
|
-
*
|
|
3431
|
+
* @example
|
|
3432
|
+
* ```typescript
|
|
3433
|
+
* const zendesk = createZendeskChatIntegration({
|
|
3434
|
+
* key: 'your-zendesk-key'
|
|
3435
|
+
* })
|
|
3436
|
+
* ```
|
|
3437
|
+
*
|
|
3438
|
+
* @remarks
|
|
3439
|
+
* - Define cookies: __zlcmid, _zendesk_shared_session
|
|
3440
|
+
* - Categoria padrão: 'functional'
|
|
3441
|
+
* - SSR-safe: verifica disponibilidade do window
|
|
3442
|
+
* - Inclui tratamento de erro na identificação
|
|
3405
3443
|
*/
|
|
3406
|
-
declare function
|
|
3444
|
+
declare function createZendeskChatIntegration(config: ZendeskConfig): ScriptIntegration;
|
|
3407
3445
|
/**
|
|
3408
|
-
*
|
|
3446
|
+
* Configuração para conjunto de integrações de e-commerce.
|
|
3447
|
+
* Define configurações opcionais para múltiplas integrações otimizadas para e-commerce.
|
|
3448
|
+
*
|
|
3409
3449
|
* @category Utils
|
|
3410
3450
|
* @since 0.4.1
|
|
3411
|
-
* Valida se integrações estão sendo incorretamente classificadas como "necessary".
|
|
3412
3451
|
*
|
|
3413
|
-
*
|
|
3414
|
-
*
|
|
3452
|
+
* @example
|
|
3453
|
+
* ```typescript
|
|
3454
|
+
* const config: ECommerceConfig = {
|
|
3455
|
+
* googleAnalytics: { measurementId: 'G-XXXXXXXXXX' },
|
|
3456
|
+
* facebookPixel: { pixelId: '1234567890123456' }
|
|
3457
|
+
* }
|
|
3458
|
+
* ```
|
|
3459
|
+
*/
|
|
3460
|
+
interface ECommerceConfig {
|
|
3461
|
+
/** Configuração do Google Analytics */
|
|
3462
|
+
googleAnalytics?: GoogleAnalyticsConfig;
|
|
3463
|
+
/** Configuração do Facebook Pixel */
|
|
3464
|
+
facebookPixel?: FacebookPixelConfig;
|
|
3465
|
+
/** Configuração do Hotjar */
|
|
3466
|
+
hotjar?: HotjarConfig;
|
|
3467
|
+
/** Configuração do UserWay */
|
|
3468
|
+
userway?: UserWayConfig;
|
|
3469
|
+
}
|
|
3470
|
+
/**
|
|
3471
|
+
* Configuração para conjunto de integrações de SaaS.
|
|
3472
|
+
* Define configurações opcionais para múltiplas integrações otimizadas para SaaS.
|
|
3415
3473
|
*
|
|
3416
|
-
* @
|
|
3417
|
-
* @
|
|
3418
|
-
* @returns Lista de avisos sobre classificações incorretas
|
|
3474
|
+
* @category Utils
|
|
3475
|
+
* @since 0.4.1
|
|
3419
3476
|
*
|
|
3420
3477
|
* @example
|
|
3421
3478
|
* ```typescript
|
|
3422
|
-
* const
|
|
3423
|
-
*
|
|
3424
|
-
*
|
|
3425
|
-
*
|
|
3426
|
-
*
|
|
3427
|
-
* if (warnings.length > 0) {
|
|
3428
|
-
* console.warn('Scripts incorretamente classificados como necessary:', warnings)
|
|
3479
|
+
* const config: SaaSConfig = {
|
|
3480
|
+
* googleAnalytics: { measurementId: 'G-XXXXXXXXXX' },
|
|
3481
|
+
* mixpanel: { token: 'your-token' },
|
|
3482
|
+
* intercom: { app_id: 'your-app-id' }
|
|
3429
3483
|
* }
|
|
3430
3484
|
* ```
|
|
3431
3485
|
*/
|
|
3432
|
-
|
|
3433
|
-
|
|
3486
|
+
interface SaaSConfig {
|
|
3487
|
+
/** Configuração do Google Analytics */
|
|
3488
|
+
googleAnalytics?: GoogleAnalyticsConfig;
|
|
3489
|
+
/** Configuração do Mixpanel */
|
|
3490
|
+
mixpanel?: MixpanelConfig;
|
|
3491
|
+
/** Configuração do Intercom */
|
|
3492
|
+
intercom?: IntercomConfig;
|
|
3493
|
+
/** Configuração do Hotjar */
|
|
3494
|
+
hotjar?: HotjarConfig;
|
|
3495
|
+
}
|
|
3434
3496
|
/**
|
|
3435
|
-
*
|
|
3497
|
+
* Configuração para conjunto de integrações corporativas.
|
|
3498
|
+
* Define configurações opcionais para múltiplas integrações otimizadas para ambientes corporativos.
|
|
3436
3499
|
*
|
|
3437
3500
|
* @category Utils
|
|
3438
|
-
* @since 0.
|
|
3501
|
+
* @since 0.4.1
|
|
3502
|
+
*
|
|
3503
|
+
* @example
|
|
3504
|
+
* ```typescript
|
|
3505
|
+
* const config: CorporateConfig = {
|
|
3506
|
+
* googleAnalytics: { measurementId: 'G-XXXXXXXXXX' },
|
|
3507
|
+
* clarity: { projectId: 'abcdefghij' },
|
|
3508
|
+
* userway: { accountId: 'XXXXXXXXXX' }
|
|
3509
|
+
* }
|
|
3510
|
+
* ```
|
|
3439
3511
|
*/
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
/**
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
* Overrides de descrições por categoria.
|
|
3450
|
-
*/
|
|
3451
|
-
descriptions?: Partial<Record<AnpdPresetCategory, string>>;
|
|
3452
|
-
/**
|
|
3453
|
-
* Overrides de nomes por categoria.
|
|
3454
|
-
*/
|
|
3455
|
-
names?: Partial<Record<AnpdPresetCategory, string>>;
|
|
3512
|
+
interface CorporateConfig {
|
|
3513
|
+
/** Configuração do Google Analytics */
|
|
3514
|
+
googleAnalytics?: GoogleAnalyticsConfig;
|
|
3515
|
+
/** Configuração do Microsoft Clarity */
|
|
3516
|
+
clarity?: ClarityConfig;
|
|
3517
|
+
/** Configuração do Zendesk Chat */
|
|
3518
|
+
zendesk?: ZendeskConfig;
|
|
3519
|
+
/** Configuração do UserWay */
|
|
3520
|
+
userway?: UserWayConfig;
|
|
3456
3521
|
}
|
|
3457
3522
|
/**
|
|
3458
|
-
*
|
|
3523
|
+
* Cria conjunto de integrações otimizado para e-commerce.
|
|
3524
|
+
* Combina analytics de conversão, remarketing e acessibilidade.
|
|
3459
3525
|
*
|
|
3460
3526
|
* @category Utils
|
|
3461
|
-
* @
|
|
3527
|
+
* @param cfg - Configuração das integrações de e-commerce
|
|
3528
|
+
* @returns Array de integrações configuradas
|
|
3529
|
+
* @since 0.4.1
|
|
3530
|
+
*
|
|
3531
|
+
* @example
|
|
3532
|
+
* ```typescript
|
|
3533
|
+
* const integrations = createECommerceIntegrations({
|
|
3534
|
+
* googleAnalytics: { measurementId: 'G-XXXXXXXXXX' },
|
|
3535
|
+
* facebookPixel: { pixelId: '1234567890123456' }
|
|
3536
|
+
* })
|
|
3537
|
+
* ```
|
|
3538
|
+
*
|
|
3539
|
+
* @remarks
|
|
3540
|
+
* Combina categorias: analytics, marketing, functional
|
|
3462
3541
|
*/
|
|
3463
|
-
declare function
|
|
3464
|
-
|
|
3542
|
+
declare function createECommerceIntegrations(cfg: ECommerceConfig): ScriptIntegration[];
|
|
3465
3543
|
/**
|
|
3466
|
-
*
|
|
3467
|
-
*
|
|
3468
|
-
*
|
|
3544
|
+
* Cria conjunto de integrações otimizado para SaaS.
|
|
3545
|
+
* Combina analytics de produto, suporte ao cliente e comportamento do usuário.
|
|
3546
|
+
*
|
|
3547
|
+
* @category Utils
|
|
3548
|
+
* @param cfg - Configuração das integrações de SaaS
|
|
3549
|
+
* @returns Array de integrações configuradas
|
|
3550
|
+
* @since 0.4.1
|
|
3551
|
+
*
|
|
3552
|
+
* @example
|
|
3553
|
+
* ```typescript
|
|
3554
|
+
* const integrations = createSaaSIntegrations({
|
|
3555
|
+
* googleAnalytics: { measurementId: 'G-XXXXXXXXXX' },
|
|
3556
|
+
* mixpanel: { token: 'your-project-token' },
|
|
3557
|
+
* intercom: { app_id: 'your-app-id' }
|
|
3558
|
+
* })
|
|
3559
|
+
* ```
|
|
3469
3560
|
*
|
|
3470
|
-
* @
|
|
3471
|
-
*
|
|
3561
|
+
* @remarks
|
|
3562
|
+
* Combina categorias: analytics, functional
|
|
3472
3563
|
*/
|
|
3473
|
-
|
|
3564
|
+
declare function createSaaSIntegrations(cfg: SaaSConfig): ScriptIntegration[];
|
|
3474
3565
|
/**
|
|
3475
|
-
*
|
|
3476
|
-
*
|
|
3477
|
-
* Define um subconjunto opcional dos textos principais do banner e modal,
|
|
3478
|
-
* permitindo variações de t es: {
|
|
3479
|
-
bannerMessage: 'Utilizamos cookies para mejorar su experiencia y mostrar contenido personalizado.', (formal, casual, etc.) sem sobrescrever todos os textos.
|
|
3566
|
+
* Cria conjunto de integrações otimizado para ambientes corporativos.
|
|
3567
|
+
* Combina analytics empresariais, compliance e suporte corporativo.
|
|
3480
3568
|
*
|
|
3481
|
-
* @category
|
|
3569
|
+
* @category Utils
|
|
3570
|
+
* @param cfg - Configuração das integrações corporativas
|
|
3571
|
+
* @returns Array de integrações configuradas
|
|
3482
3572
|
* @since 0.4.1
|
|
3483
|
-
*/
|
|
3484
|
-
type TextVariant = Partial<Pick<ConsentTexts, 'bannerMessage' | 'acceptAll' | 'declineAll' | 'modalTitle'>>;
|
|
3485
|
-
/**
|
|
3486
|
-
* Tipo auxiliar para textos de idioma.
|
|
3487
3573
|
*
|
|
3488
|
-
*
|
|
3489
|
-
*
|
|
3574
|
+
* @example
|
|
3575
|
+
* ```typescript
|
|
3576
|
+
* const integrations = createCorporateIntegrations({
|
|
3577
|
+
* googleAnalytics: { measurementId: 'G-XXXXXXXXXX' },
|
|
3578
|
+
* clarity: { projectId: 'abcdefghij' },
|
|
3579
|
+
* userway: { accountId: 'XXXXXXXXXX' }
|
|
3580
|
+
* })
|
|
3581
|
+
* ```
|
|
3490
3582
|
*
|
|
3491
|
-
* @
|
|
3492
|
-
*
|
|
3583
|
+
* @remarks
|
|
3584
|
+
* Combina categorias: analytics, functional
|
|
3493
3585
|
*/
|
|
3494
|
-
|
|
3586
|
+
declare function createCorporateIntegrations(cfg: CorporateConfig): ScriptIntegration[];
|
|
3495
3587
|
/**
|
|
3496
|
-
*
|
|
3497
|
-
*
|
|
3498
|
-
* Interface expandida que permite personalização granular de todas as mensagens da biblioteca.
|
|
3499
|
-
* Suporta múltiplos idiomas, contextos específicos (e-commerce, SaaS, governo), variações
|
|
3500
|
-
* de tom, e compliance completo com LGPD.
|
|
3588
|
+
* Templates pré-configurados de integrações por tipo de negócio.
|
|
3589
|
+
* Define integrações essenciais e opcionais para cada contexto.
|
|
3501
3590
|
*
|
|
3502
|
-
* @category
|
|
3591
|
+
* @category Utils
|
|
3503
3592
|
* @since 0.4.1
|
|
3504
|
-
* @remarks
|
|
3505
|
-
* **Histórico**: v0.4.1 - Nova interface com suporte avançado a i18n e contextos
|
|
3506
3593
|
*
|
|
3507
|
-
* @example
|
|
3594
|
+
* @example
|
|
3508
3595
|
* ```typescript
|
|
3509
|
-
* const
|
|
3510
|
-
*
|
|
3511
|
-
*
|
|
3512
|
-
* acceptAll: 'Aceitar todos',
|
|
3513
|
-
* declineAll: 'Recusar',
|
|
3514
|
-
* preferences: 'Preferências',
|
|
3515
|
-
* modalTitle: 'Preferências de Cookies',
|
|
3516
|
-
* modalIntro: 'Personalize suas preferências de cookies.',
|
|
3517
|
-
* save: 'Salvar',
|
|
3518
|
-
* necessaryAlwaysOn: 'Cookies necessários (sempre ativos)',
|
|
3519
|
-
*
|
|
3520
|
-
* // Textos expandidos
|
|
3521
|
-
* variants: {
|
|
3522
|
-
* formal: {
|
|
3523
|
-
* bannerMessage: 'Este sítio utiliza cookies para otimizar a experiência de navegação.',
|
|
3524
|
-
* acceptAll: 'Concordar com todos os cookies'
|
|
3525
|
-
* },
|
|
3526
|
-
* casual: {
|
|
3527
|
-
* bannerMessage: '🍪 Olá! Usamos cookies para tornar tudo mais gostoso aqui.',
|
|
3528
|
-
* acceptAll: 'Aceitar tudo'
|
|
3529
|
-
* }
|
|
3530
|
-
* },
|
|
3531
|
-
*
|
|
3532
|
-
* // Internacionalização
|
|
3533
|
-
* i18n: {
|
|
3534
|
-
* en: {
|
|
3535
|
-
* bannerMessage: 'We use cookies to enhance your experience.',
|
|
3536
|
-
* acceptAll: 'Accept All',
|
|
3537
|
-
* declineAll: 'Decline'
|
|
3538
|
-
* },
|
|
3539
|
-
* es: {
|
|
3540
|
-
* bannerMessage: 'Utilizamos cookies para mejorar su experiencia.',
|
|
3541
|
-
* acceptAll: 'Aceptar Todo',
|
|
3542
|
-
* declineAll: 'Rechazar'
|
|
3543
|
-
* }
|
|
3544
|
-
* }
|
|
3545
|
-
* }
|
|
3596
|
+
* const template = INTEGRATION_TEMPLATES.ecommerce
|
|
3597
|
+
* console.log(template.essential) // ['google-analytics', 'facebook-pixel']
|
|
3598
|
+
* console.log(template.categories) // ['analytics', 'marketing', 'functional']
|
|
3546
3599
|
* ```
|
|
3600
|
+
*
|
|
3601
|
+
* @remarks
|
|
3602
|
+
* Cada template define:
|
|
3603
|
+
* - essential: integrações obrigatórias/recomendadas
|
|
3604
|
+
* - optional: integrações complementares
|
|
3605
|
+
* - categories: categorias LGPD utilizadas
|
|
3547
3606
|
*/
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
/** Texto de carregamento */
|
|
3554
|
-
loading?: string;
|
|
3555
|
-
/** Textos específicos para cada categoria de cookie */
|
|
3556
|
-
categories?: {
|
|
3557
|
-
necessary?: {
|
|
3558
|
-
name?: string;
|
|
3559
|
-
description?: string;
|
|
3560
|
-
examples?: string;
|
|
3561
|
-
};
|
|
3562
|
-
analytics?: {
|
|
3563
|
-
name?: string;
|
|
3564
|
-
description?: string;
|
|
3565
|
-
examples?: string;
|
|
3566
|
-
};
|
|
3567
|
-
marketing?: {
|
|
3568
|
-
name?: string;
|
|
3569
|
-
description?: string;
|
|
3570
|
-
examples?: string;
|
|
3571
|
-
};
|
|
3572
|
-
functional?: {
|
|
3573
|
-
name?: string;
|
|
3574
|
-
description?: string;
|
|
3575
|
-
examples?: string;
|
|
3576
|
-
};
|
|
3577
|
-
performance?: {
|
|
3578
|
-
name?: string;
|
|
3579
|
-
description?: string;
|
|
3580
|
-
examples?: string;
|
|
3581
|
-
};
|
|
3582
|
-
};
|
|
3583
|
-
/** Mensagens de feedback ao usuário */
|
|
3584
|
-
feedback?: {
|
|
3585
|
-
/** Preferências salvas com sucesso */
|
|
3586
|
-
saveSuccess?: string;
|
|
3587
|
-
/** Erro ao salvar preferências */
|
|
3588
|
-
saveError?: string;
|
|
3589
|
-
/** Consentimento atualizado */
|
|
3590
|
-
consentUpdated?: string;
|
|
3591
|
-
/** Cookies rejeitados */
|
|
3592
|
-
cookiesRejected?: string;
|
|
3593
|
-
/** Configurações resetadas */
|
|
3594
|
-
settingsReset?: string;
|
|
3595
|
-
};
|
|
3596
|
-
/** Labels ARIA e textos para leitores de tela */
|
|
3597
|
-
accessibility?: {
|
|
3598
|
-
/** Label do banner para leitores de tela */
|
|
3599
|
-
bannerLabel?: string;
|
|
3600
|
-
/** Label do modal para leitores de tela */
|
|
3601
|
-
modalLabel?: string;
|
|
3602
|
-
/** Instrução de navegação por teclado */
|
|
3603
|
-
keyboardNavigation?: string;
|
|
3604
|
-
/** Estado do toggle de categoria */
|
|
3605
|
-
toggleState?: {
|
|
3606
|
-
enabled?: string;
|
|
3607
|
-
disabled?: string;
|
|
3608
|
-
};
|
|
3609
|
-
/** Região live para anúncios dinâmicos */
|
|
3610
|
-
liveRegion?: string;
|
|
3611
|
-
};
|
|
3612
|
-
/** Textos otimizados para diferentes contextos */
|
|
3613
|
-
contexts?: {
|
|
3614
|
-
/** Contexto e-commerce */
|
|
3615
|
-
ecommerce?: {
|
|
3616
|
-
cartAbandonment?: string;
|
|
3617
|
-
personalizedOffers?: string;
|
|
3618
|
-
paymentSecurity?: string;
|
|
3619
|
-
productRecommendations?: string;
|
|
3620
|
-
};
|
|
3621
|
-
/** Contexto SaaS */
|
|
3622
|
-
saas?: {
|
|
3623
|
-
userAnalytics?: string;
|
|
3624
|
-
performanceMonitoring?: string;
|
|
3625
|
-
featureUsage?: string;
|
|
3626
|
-
customerSupport?: string;
|
|
3627
|
-
};
|
|
3628
|
-
/** Contexto governamental */
|
|
3629
|
-
government?: {
|
|
3630
|
-
citizenServices?: string;
|
|
3631
|
-
dataProtection?: string;
|
|
3632
|
-
transparency?: string;
|
|
3633
|
-
accessibility?: string;
|
|
3634
|
-
};
|
|
3635
|
-
/** Contexto educacional */
|
|
3636
|
-
education?: {
|
|
3637
|
-
studentProgress?: string;
|
|
3638
|
-
learningAnalytics?: string;
|
|
3639
|
-
accessibility?: string;
|
|
3640
|
-
parentalConsent?: string;
|
|
3641
|
-
};
|
|
3642
|
-
};
|
|
3643
|
-
/** Diferentes variações de tom para a mesma mensagem */
|
|
3644
|
-
variants?: {
|
|
3645
|
-
/** Tom formal/profissional */
|
|
3646
|
-
formal?: TextVariant;
|
|
3647
|
-
/** Tom casual/amigável */
|
|
3648
|
-
casual?: TextVariant;
|
|
3649
|
-
/** Tom conciso/direto */
|
|
3650
|
-
concise?: TextVariant;
|
|
3651
|
-
/** Tom detalhado/explicativo */
|
|
3652
|
-
detailed?: TextVariant;
|
|
3653
|
-
};
|
|
3654
|
-
/** Suporte a múltiplos idiomas */
|
|
3655
|
-
i18n?: {
|
|
3656
|
-
/** Textos em inglês */
|
|
3657
|
-
en?: LanguageTexts;
|
|
3658
|
-
/** Textos em espanhol */
|
|
3659
|
-
es?: LanguageTexts;
|
|
3660
|
-
/** Textos em francês */
|
|
3661
|
-
fr?: LanguageTexts;
|
|
3662
|
-
/** Textos em alemão */
|
|
3663
|
-
de?: LanguageTexts;
|
|
3664
|
-
/** Textos em italiano */
|
|
3665
|
-
it?: LanguageTexts;
|
|
3607
|
+
declare const INTEGRATION_TEMPLATES: {
|
|
3608
|
+
ecommerce: {
|
|
3609
|
+
essential: string[];
|
|
3610
|
+
optional: string[];
|
|
3611
|
+
categories: string[];
|
|
3666
3612
|
};
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
/** Explicação sobre cookies persistentes */
|
|
3672
|
-
persistentCookies?: string;
|
|
3673
|
-
/** Explicação sobre cookies de terceiros */
|
|
3674
|
-
thirdPartyCookies?: string;
|
|
3675
|
-
/** Como desabilitar cookies no navegador */
|
|
3676
|
-
browserSettings?: string;
|
|
3677
|
-
/** Impacto de desabilitar cookies */
|
|
3678
|
-
disablingImpact?: string;
|
|
3613
|
+
saas: {
|
|
3614
|
+
essential: string[];
|
|
3615
|
+
optional: string[];
|
|
3616
|
+
categories: string[];
|
|
3679
3617
|
};
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
purpose?: string;
|
|
3685
|
-
duration?: string;
|
|
3686
|
-
provider?: string;
|
|
3687
|
-
type?: string;
|
|
3688
|
-
};
|
|
3689
|
-
/** Texto quando não há cookies para mostrar */
|
|
3690
|
-
noCookies?: string;
|
|
3691
|
-
/** Botão para expandir/colapsar detalhes */
|
|
3692
|
-
toggleDetails?: {
|
|
3693
|
-
expand?: string;
|
|
3694
|
-
collapse?: string;
|
|
3695
|
-
};
|
|
3618
|
+
corporate: {
|
|
3619
|
+
essential: string[];
|
|
3620
|
+
optional: string[];
|
|
3621
|
+
categories: string[];
|
|
3696
3622
|
};
|
|
3623
|
+
};
|
|
3624
|
+
/**
|
|
3625
|
+
* Sugere categorias LGPD apropriadas para um script baseado no nome/tipo.
|
|
3626
|
+
* Utiliza heurísticas para classificar scripts desconhecidos.
|
|
3627
|
+
*
|
|
3628
|
+
* @category Utils
|
|
3629
|
+
* @param name - Nome ou identificador do script
|
|
3630
|
+
* @returns Array de categorias sugeridas
|
|
3631
|
+
* @since 0.4.1
|
|
3632
|
+
*
|
|
3633
|
+
* @example
|
|
3634
|
+
* ```typescript
|
|
3635
|
+
* suggestCategoryForScript('facebook-pixel') // ['marketing']
|
|
3636
|
+
* suggestCategoryForScript('hotjar') // ['analytics']
|
|
3637
|
+
* suggestCategoryForScript('intercom-chat') // ['functional']
|
|
3638
|
+
* suggestCategoryForScript('unknown-script') // ['analytics']
|
|
3639
|
+
* ```
|
|
3640
|
+
*
|
|
3641
|
+
* @remarks
|
|
3642
|
+
* Heurísticas aplicadas:
|
|
3643
|
+
* - Scripts de ads/marketing → 'marketing'
|
|
3644
|
+
* - Scripts de analytics/tracking → 'analytics'
|
|
3645
|
+
* - Scripts de chat/suporte → 'functional'
|
|
3646
|
+
* - Padrão para desconhecidos → 'analytics'
|
|
3647
|
+
*/
|
|
3648
|
+
declare function suggestCategoryForScript(name: string): string[];
|
|
3649
|
+
|
|
3650
|
+
/**
|
|
3651
|
+
* Componente que carrega scripts automaticamente baseado no consentimento.
|
|
3652
|
+
* Facilita integração com ferramentas como Google Analytics, Tag Manager, etc.
|
|
3653
|
+
*/
|
|
3654
|
+
|
|
3655
|
+
interface RegisteredScript {
|
|
3656
|
+
id: string;
|
|
3657
|
+
category: string;
|
|
3658
|
+
execute: () => void | Promise<void>;
|
|
3659
|
+
priority?: number;
|
|
3660
|
+
allowReload?: boolean;
|
|
3661
|
+
onConsentUpdate?: (consent: {
|
|
3662
|
+
consented: boolean;
|
|
3663
|
+
preferences: ConsentPreferences;
|
|
3664
|
+
}) => void;
|
|
3697
3665
|
}
|
|
3698
3666
|
/**
|
|
3699
|
-
*
|
|
3667
|
+
* Registra um script (inline ou externo) na fila controlada por consentimento.
|
|
3668
|
+
*
|
|
3669
|
+
* @remarks
|
|
3670
|
+
* - Scripts `necessary` rodam imediatamente; demais aguardam consentimento da categoria.
|
|
3671
|
+
* - Fluxo de estados: `pending` → `running` → `executed` (respeitando `allowReload` e `onConsentUpdate`).
|
|
3672
|
+
* - A fila é ordenada por categoria, `priority` (maior primeiro) e ordem de registro.
|
|
3673
|
+
* - `allowReload` permite reexecutar scripts quando o usuário muda preferências.
|
|
3674
|
+
* - Use `onConsentUpdate` para reenviar sinais (ex.: Consent Mode) após novas decisões.
|
|
3675
|
+
* - Sempre chame o cleanup retornado em efeitos React para evitar múltiplos registros do mesmo `id`.
|
|
3700
3676
|
*
|
|
3677
|
+
* @param def Definição do script a ser registrado.
|
|
3678
|
+
* @returns Função de cleanup para remover o script da fila.
|
|
3679
|
+
*/
|
|
3680
|
+
declare function registerScript(def: RegisteredScript): () => void;
|
|
3681
|
+
interface ConsentScriptLoaderProps {
|
|
3682
|
+
/** Lista de integrações de scripts para carregar baseado no consentimento */
|
|
3683
|
+
integrations: ScriptIntegration[];
|
|
3684
|
+
/** Se true, força recarregamento se consentimento mudar */
|
|
3685
|
+
reloadOnChange?: boolean;
|
|
3686
|
+
/** Nonce CSP aplicado às tags <script> geradas automaticamente (sobrescrevível por integração). */
|
|
3687
|
+
nonce?: string;
|
|
3688
|
+
}
|
|
3689
|
+
/**
|
|
3690
|
+
* @component
|
|
3701
3691
|
* @category Utils
|
|
3692
|
+
* @since 0.2.0
|
|
3693
|
+
* Componente que não renderiza UI, mas gerencia o carregamento de scripts de terceiros
|
|
3694
|
+
* (como Google Analytics) com base nas preferências de consentimento do usuário.
|
|
3695
|
+
*
|
|
3696
|
+
* @param props As propriedades do componente.
|
|
3697
|
+
* @param {ScriptIntegration[]} props.integrations Um array de objetos de integração de script. Use as factory functions (`createGoogleAnalyticsIntegration`, etc.) para criar.
|
|
3698
|
+
* @param {boolean} [props.reloadOnChange=false] Se `true`, recarrega os scripts se as preferências de consentimento mudarem.
|
|
3699
|
+
*
|
|
3700
|
+
* @example
|
|
3701
|
+
* ```tsx
|
|
3702
|
+
* const integrations = [
|
|
3703
|
+
* createGoogleAnalyticsIntegration({ measurementId: 'GA_ID' }),
|
|
3704
|
+
* createFacebookPixelIntegration({ pixelId: 'PIXEL_ID' })
|
|
3705
|
+
* ];
|
|
3706
|
+
*
|
|
3707
|
+
* <ConsentScriptLoader integrations={integrations} />
|
|
3708
|
+
* ```
|
|
3709
|
+
*/
|
|
3710
|
+
declare function ConsentScriptLoader({ integrations, reloadOnChange, nonce, }: Readonly<ConsentScriptLoaderProps>): null;
|
|
3711
|
+
/**
|
|
3712
|
+
* @hook
|
|
3713
|
+
* @category Hooks
|
|
3714
|
+
* @since 0.2.0
|
|
3715
|
+
* Hook para carregamento programático de um script baseado no consentimento.
|
|
3716
|
+
*
|
|
3717
|
+
* @returns Uma função assíncrona que recebe um objeto de integração de script e tenta carregá-lo.
|
|
3718
|
+
* Retorna `true` em caso de sucesso e `false` em caso de falha (por falta de consentimento ou erro de rede).
|
|
3719
|
+
*
|
|
3720
|
+
* @example
|
|
3721
|
+
* ```tsx
|
|
3722
|
+
* const loadScript = useConsentScriptLoader();
|
|
3723
|
+
*
|
|
3724
|
+
* useEffect(() => {
|
|
3725
|
+
* const handleUserAction = async () => {
|
|
3726
|
+
* const hotjarIntegration = { id: 'hotjar', category: 'analytics', src: '...' };
|
|
3727
|
+
* const success = await loadScript(hotjarIntegration);
|
|
3728
|
+
* if (success) {
|
|
3729
|
+
* console.log('Hotjar carregado com sucesso!');
|
|
3730
|
+
* }
|
|
3731
|
+
* };
|
|
3732
|
+
*
|
|
3733
|
+
* // Exemplo: carregar script após uma ação específica do usuário
|
|
3734
|
+
* myButton.addEventListener('click', handleUserAction);
|
|
3735
|
+
* }, [loadScript]);
|
|
3736
|
+
* ```
|
|
3737
|
+
*/
|
|
3738
|
+
declare function useConsentScriptLoader(): (integration: ScriptIntegration, nonce?: string) => Promise<boolean>;
|
|
3739
|
+
|
|
3740
|
+
/**
|
|
3741
|
+
* @file autoConfigureCategories.ts
|
|
3742
|
+
* @description Sistema inteligente de auto-habilitação de categorias baseado nas integrações utilizadas
|
|
3702
3743
|
* @since 0.4.1
|
|
3703
3744
|
*/
|
|
3704
|
-
|
|
3745
|
+
|
|
3705
3746
|
/**
|
|
3706
|
-
*
|
|
3747
|
+
* @interface CategoryAutoConfigResult
|
|
3748
|
+
* Resultado da análise e auto-configuração de categorias
|
|
3749
|
+
*/
|
|
3750
|
+
interface CategoryAutoConfigResult {
|
|
3751
|
+
/** Configuração original fornecida pelo desenvolvedor */
|
|
3752
|
+
originalConfig: ProjectCategoriesConfig;
|
|
3753
|
+
/** Configuração ajustada automaticamente pela biblioteca */
|
|
3754
|
+
adjustedConfig: ProjectCategoriesConfig;
|
|
3755
|
+
/** Categorias que foram automaticamente habilitadas */
|
|
3756
|
+
autoEnabledCategories: string[];
|
|
3757
|
+
/** Categorias requeridas pelas integrações mas não habilitadas */
|
|
3758
|
+
missingCategories: string[];
|
|
3759
|
+
/** Se algum ajuste foi necessário */
|
|
3760
|
+
wasAdjusted: boolean;
|
|
3761
|
+
/** Integrações que requerem cada categoria */
|
|
3762
|
+
categoryIntegrations: Record<string, string[]>;
|
|
3763
|
+
}
|
|
3764
|
+
/**
|
|
3765
|
+
* @function
|
|
3766
|
+
* @category Utils
|
|
3767
|
+
* @since 0.4.1
|
|
3768
|
+
* Analisa as integrações fornecidas e determina quais categorias são necessárias.
|
|
3707
3769
|
*
|
|
3770
|
+
* @param integrations Array de integrações de script
|
|
3771
|
+
* @returns Record mapeando categoria para nomes das integrações que a utilizam
|
|
3772
|
+
*/
|
|
3773
|
+
declare function analyzeIntegrationCategories(integrations: ScriptIntegration[]): Record<string, string[]>;
|
|
3774
|
+
/**
|
|
3775
|
+
* @function
|
|
3708
3776
|
* @category Utils
|
|
3709
3777
|
* @since 0.4.1
|
|
3778
|
+
* Configura automaticamente as categorias necessárias baseado nas integrações utilizadas.
|
|
3710
3779
|
*
|
|
3711
|
-
*
|
|
3712
|
-
*
|
|
3713
|
-
*
|
|
3780
|
+
* Esta função implementa o comportamento inteligente da biblioteca:
|
|
3781
|
+
* 1. Detecta categorias requeridas pelas integrações
|
|
3782
|
+
* 2. Auto-habilita categorias em falta (modo padrão)
|
|
3783
|
+
* 3. Ou apenas avisa sobre categorias em falta (modo warning-only)
|
|
3784
|
+
* 4. Loga no console em modo DEV
|
|
3785
|
+
*
|
|
3786
|
+
* @param originalConfig Configuração original do ConsentProvider
|
|
3787
|
+
* @param integrations Array de integrações que serão utilizadas
|
|
3788
|
+
* @param options Opções de comportamento
|
|
3789
|
+
* @returns Resultado da análise e configuração automática
|
|
3714
3790
|
*/
|
|
3715
|
-
declare function
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3791
|
+
declare function autoConfigureCategories(originalConfig: ProjectCategoriesConfig | undefined, integrations: ScriptIntegration[], options?: {
|
|
3792
|
+
/** Se true, apenas avisa mas não modifica a config (padrão: false - auto-habilita) */
|
|
3793
|
+
warningOnly?: boolean;
|
|
3794
|
+
/** Se true, desabilita logs no console (padrão: false) */
|
|
3795
|
+
silent?: boolean;
|
|
3796
|
+
}): CategoryAutoConfigResult;
|
|
3720
3797
|
/**
|
|
3721
|
-
*
|
|
3798
|
+
* @function
|
|
3799
|
+
* @category Utils
|
|
3800
|
+
* @since 0.4.1
|
|
3801
|
+
* Valida se todas as integrações têm suas categorias habilitadas.
|
|
3802
|
+
* Útil para validação em tempo de execução.
|
|
3803
|
+
*
|
|
3804
|
+
* @param integrations Array de integrações
|
|
3805
|
+
* @param enabledCategories Array de categorias habilitadas
|
|
3806
|
+
* @returns true se todas as categorias necessárias estão habilitadas
|
|
3807
|
+
*/
|
|
3808
|
+
declare function validateIntegrationCategories(integrations: ScriptIntegration[], enabledCategories: string[]): boolean;
|
|
3809
|
+
/**
|
|
3810
|
+
* @function
|
|
3811
|
+
* @category Utils
|
|
3812
|
+
* @since 0.4.1
|
|
3813
|
+
* Extrai categorias únicas de um array de integrações
|
|
3722
3814
|
*
|
|
3815
|
+
* @param integrations Array de integrações
|
|
3816
|
+
* @returns Array de categorias únicas
|
|
3817
|
+
*/
|
|
3818
|
+
declare function extractCategoriesFromIntegrations(integrations: ScriptIntegration[]): string[];
|
|
3819
|
+
/**
|
|
3820
|
+
* @function
|
|
3723
3821
|
* @category Utils
|
|
3724
3822
|
* @since 0.4.1
|
|
3823
|
+
* Valida se integrações estão sendo incorretamente classificadas como "necessary".
|
|
3824
|
+
*
|
|
3825
|
+
* Esta função protege contra violações de GDPR/LGPD identificando scripts que
|
|
3826
|
+
* NUNCA devem ser considerados estritamente necessários.
|
|
3827
|
+
*
|
|
3828
|
+
* @param integrations Array de integrações para validar
|
|
3829
|
+
* @param enabledCategories Categorias habilitadas na configuração
|
|
3830
|
+
* @returns Lista de avisos sobre classificações incorretas
|
|
3831
|
+
*
|
|
3832
|
+
* @example
|
|
3833
|
+
* ```typescript
|
|
3834
|
+
* const warnings = validateNecessaryClassification([
|
|
3835
|
+
* createGoogleAnalyticsIntegration({...}), // ❌ NUNCA é necessary
|
|
3836
|
+
* createCustomIntegration({...}) // ✅ Pode ser necessary se apropriado
|
|
3837
|
+
* ], ['necessary', 'analytics'])
|
|
3838
|
+
*
|
|
3839
|
+
* if (warnings.length > 0) {
|
|
3840
|
+
* console.warn('Scripts incorretamente classificados como necessary:', warnings)
|
|
3841
|
+
* }
|
|
3842
|
+
* ```
|
|
3725
3843
|
*/
|
|
3726
|
-
declare
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3844
|
+
declare function validateNecessaryClassification(integrations: ScriptIntegration[], enabledCategories: Category[]): string[];
|
|
3845
|
+
|
|
3846
|
+
/**
|
|
3847
|
+
* Presets de categorias conforme usos típicos da LGPD/ANPD.
|
|
3848
|
+
*
|
|
3849
|
+
* @category Utils
|
|
3850
|
+
* @since 0.6.4
|
|
3851
|
+
*/
|
|
3852
|
+
declare const ANPD_CATEGORY_PRESETS: Record<Category, CategoryDefinition>;
|
|
3853
|
+
type AnpdPresetCategory = keyof typeof ANPD_CATEGORY_PRESETS;
|
|
3854
|
+
interface CreateAnpdCategoriesOptions {
|
|
3855
|
+
/**
|
|
3856
|
+
* Lista de categorias que devem ser habilitadas (além de necessary que é sempre inclusa).
|
|
3857
|
+
* @default ['analytics', 'functional', 'marketing']
|
|
3858
|
+
*/
|
|
3859
|
+
include?: AnpdPresetCategory[];
|
|
3860
|
+
/**
|
|
3861
|
+
* Overrides de descrições por categoria.
|
|
3862
|
+
*/
|
|
3863
|
+
descriptions?: Partial<Record<AnpdPresetCategory, string>>;
|
|
3864
|
+
/**
|
|
3865
|
+
* Overrides de nomes por categoria.
|
|
3866
|
+
*/
|
|
3867
|
+
names?: Partial<Record<AnpdPresetCategory, string>>;
|
|
3868
|
+
}
|
|
3869
|
+
/**
|
|
3870
|
+
* Gera um `ProjectCategoriesConfig` com presets LGPD/ANPD tipados.
|
|
3871
|
+
*
|
|
3872
|
+
* @category Utils
|
|
3873
|
+
* @since 0.6.4
|
|
3874
|
+
*/
|
|
3875
|
+
declare function createAnpdCategoriesConfig(options?: CreateAnpdCategoriesOptions): ProjectCategoriesConfig;
|
|
3731
3876
|
|
|
3732
3877
|
/**
|
|
3733
3878
|
* @enum LogLevel
|
|
@@ -4189,7 +4334,9 @@ declare function getAllProjectCategories(config?: ProjectCategoriesConfig): Cate
|
|
|
4189
4334
|
*/
|
|
4190
4335
|
declare global {
|
|
4191
4336
|
interface Window {
|
|
4192
|
-
dataLayer?: Array<ConsentEvent | Record<string, unknown
|
|
4337
|
+
dataLayer?: Array<ConsentEvent | Record<string, unknown>> | {
|
|
4338
|
+
push?: (...args: unknown[]) => unknown;
|
|
4339
|
+
};
|
|
4193
4340
|
}
|
|
4194
4341
|
}
|
|
4195
4342
|
/**
|
|
@@ -4299,4 +4446,4 @@ declare function useDataLayerEvents(): {
|
|
|
4299
4446
|
pushUpdated: typeof pushConsentUpdatedEvent;
|
|
4300
4447
|
};
|
|
4301
4448
|
|
|
4302
|
-
export { ANPD_CATEGORY_PRESETS, type AdvancedConsentTexts, type AnpdPresetCategory, COMMON_INTEGRATIONS, type CategoriesContextValue, type Category, type CategoryAutoConfigResult, type CategoryDefinition, type ClarityConfig, type ConsentAuditAction, type ConsentAuditEntry, type ConsentContextValue, type ConsentCookieData, type ConsentCookieOptions, type ConsentEvent, type ConsentEventOrigin, ConsentGate, type ConsentInitializedEvent, type ConsentPreferences, ConsentProvider, type ConsentProviderProps, ConsentScriptLoader, type ConsentScriptLoaderProps, type ConsentState, type ConsentStorageConfig, type ConsentTexts, type ConsentUpdatedEvent, type ConsentVersionChangeContext, type CookieDescriptor, type CorporateConfig, type CreateAnpdCategoriesOptions, type CustomCookieBannerProps, type CustomFloatingPreferencesButtonProps, type CustomPreferencesModalProps, DEFAULT_PROJECT_CATEGORIES, DesignProvider, type DesignTokens, type DeveloperGuidance, type ECommerceConfig, EXPANDED_DEFAULT_TEXTS, type FacebookPixelConfig, GUIDANCE_PRESETS, type GoogleAnalyticsConfig, type GoogleTagManagerConfig, type GuidanceConfig, type GuidanceMessage, type GuidanceSeverity, type HotjarConfig, INTEGRATION_TEMPLATES, type IntercomConfig, LogLevel, type MixpanelConfig, type PeerDepsCheckResult, type PeerDepsLocale, type PeerDepsMessages, type ProjectCategoriesConfig, type RegisteredScript, type SaaSConfig, type ScriptIntegration, TEXT_TEMPLATES, type UserWayConfig, type ZendeskConfig, analyzeDeveloperConfiguration, analyzeIntegrationCategories, autoConfigureCategories, buildConsentStorageKey, categorizeDiscoveredCookies, checkPeerDeps, createAnpdCategoriesConfig, createClarityIntegration, createConsentAuditEntry, createCorporateIntegrations, createECommerceIntegrations, createFacebookPixelIntegration, createGoogleAnalyticsIntegration, createGoogleTagManagerIntegration, createHotjarIntegration, createIntercomIntegration, createMixpanelIntegration, createProjectPreferences, createSaaSIntegrations, createUserWayIntegration, createZendeskChatIntegration, defaultTexts, detectConsentCookieName, discoverRuntimeCookies, ensureNecessaryAlwaysOn, extractCategoriesFromIntegrations, getAllProjectCategories, getCookiesInfoForCategory, getPeerDepsLocale, loadScript, logDeveloperGuidance, logger, openPreferencesModal, pushConsentInitializedEvent, pushConsentUpdatedEvent, registerScript, resetPeerDepsMessages, resolveTexts, runPeerDepsCheck, setCookieCatalogOverrides, setCookieCategoryOverrides, setDebugLogging, setPeerDepsLocale, setPeerDepsMessages, suggestCategoryForScript, useCategories, useCategoryStatus, useConsent, useConsentHydration, useConsentScriptLoader, useConsentTexts, useDataLayerEvents, useDesignTokens, useDeveloperGuidance, useOpenPreferencesModal, validateIntegrationCategories, validateNecessaryClassification, validateProjectPreferences };
|
|
4449
|
+
export { ANPD_CATEGORY_PRESETS, type AdvancedConsentTexts, type AnpdPresetCategory, COMMON_INTEGRATIONS, type CategoriesContextValue, type Category, type CategoryAutoConfigResult, type CategoryDefinition, type ClarityConfig, type ConsentAuditAction, type ConsentAuditEntry, type ConsentContextValue, type ConsentCookieData, type ConsentCookieOptions, type ConsentEvent, type ConsentEventOrigin, ConsentGate, type ConsentInitializedEvent, type ConsentPreferences, ConsentProvider, type ConsentProviderProps, ConsentScriptLoader, type ConsentScriptLoaderProps, type ConsentState, type ConsentStorageConfig, type ConsentTexts, type ConsentUpdatedEvent, type ConsentVersionChangeContext, type CookieDescriptor, type CorporateConfig, type CreateAnpdCategoriesOptions, type CustomCookieBannerProps, type CustomFloatingPreferencesButtonProps, type CustomPreferencesModalProps, DEFAULT_PROJECT_CATEGORIES, DesignProvider, type DesignTokens, type DeveloperGuidance, type ECommerceConfig, EXPANDED_DEFAULT_TEXTS, type FacebookPixelConfig, GUIDANCE_PRESETS, type GoogleAnalyticsConfig, type GoogleTagManagerConfig, type GuidanceConfig, type GuidanceMessage, type GuidanceSeverity, type HotjarConfig, INTEGRATION_TEMPLATES, type IntercomConfig, LogLevel, type MixpanelConfig, type PeerDepsCheckResult, type PeerDepsLocale, type PeerDepsMessages, type ProjectCategoriesConfig, type RegisteredScript, type SaaSConfig, type ScriptIntegration, type SuggestedIntegrationConfig, TEXT_TEMPLATES, type UserWayConfig, type ZendeskConfig, analyzeDeveloperConfiguration, analyzeIntegrationCategories, autoConfigureCategories, buildConsentStorageKey, categorizeDiscoveredCookies, checkPeerDeps, createAnpdCategoriesConfig, createClarityIntegration, createConsentAuditEntry, createCorporateIntegrations, createECommerceIntegrations, createFacebookPixelIntegration, createGoogleAnalyticsIntegration, createGoogleTagManagerIntegration, createHotjarIntegration, createIntercomIntegration, createMixpanelIntegration, createProjectPreferences, createSaaSIntegrations, createSuggestedIntegration, createUserWayIntegration, createZendeskChatIntegration, defaultTexts, detectConsentCookieName, discoverRuntimeCookies, ensureNecessaryAlwaysOn, extractCategoriesFromIntegrations, getAllProjectCategories, getCookiesInfoForCategory, getPeerDepsLocale, loadScript, logDeveloperGuidance, logger, openPreferencesModal, pushConsentInitializedEvent, pushConsentUpdatedEvent, registerScript, resetPeerDepsMessages, resolveTexts, runPeerDepsCheck, setCookieCatalogOverrides, setCookieCategoryOverrides, setDebugLogging, setPeerDepsLocale, setPeerDepsMessages, suggestCategoryForScript, useCategories, useCategoryStatus, useConsent, useConsentHydration, useConsentScriptLoader, useConsentTexts, useDataLayerEvents, useDesignTokens, useDeveloperGuidance, useOpenPreferencesModal, validateIntegrationCategories, validateNecessaryClassification, validateProjectPreferences };
|