react-lgpd-consent 0.3.0 → 0.3.1
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 +481 -0
- package/README.md +646 -79
- package/dist/{PreferencesModal-XCTM6WJN.js → PreferencesModal-J27W5XAJ.js} +1 -1
- package/dist/{chunk-R3IKVZBC.js → chunk-VFAOBR3X.js} +392 -82
- package/dist/index.cjs +437 -105
- package/dist/index.d.cts +53 -1
- package/dist/index.d.ts +53 -1
- package/dist/index.js +11 -3
- package/package.json +5 -4
package/dist/index.d.cts
CHANGED
|
@@ -196,6 +196,13 @@ interface ConsentTexts {
|
|
|
196
196
|
modalIntro: string;
|
|
197
197
|
save: string;
|
|
198
198
|
necessaryAlwaysOn: string;
|
|
199
|
+
preferencesButton?: string;
|
|
200
|
+
preferencesTitle?: string;
|
|
201
|
+
preferencesDescription?: string;
|
|
202
|
+
close?: string;
|
|
203
|
+
accept?: string;
|
|
204
|
+
reject?: string;
|
|
205
|
+
brandingPoweredBy?: string;
|
|
199
206
|
controllerInfo?: string;
|
|
200
207
|
dataTypes?: string;
|
|
201
208
|
thirdPartySharing?: string;
|
|
@@ -582,6 +589,27 @@ declare function useConsentTexts(): ConsentTexts;
|
|
|
582
589
|
* Útil para evitar flash do banner antes de verificar cookies existentes.
|
|
583
590
|
*/
|
|
584
591
|
declare function useConsentHydration(): boolean;
|
|
592
|
+
/**
|
|
593
|
+
* Hook para abrir o modal de preferências programaticamente.
|
|
594
|
+
* Útil quando você tem controle customizado sobre como o modal é aberto.
|
|
595
|
+
*
|
|
596
|
+
* @returns Função para abrir o modal de preferências.
|
|
597
|
+
*
|
|
598
|
+
* @example
|
|
599
|
+
* ```tsx
|
|
600
|
+
* function CustomAccessibilityDock() {
|
|
601
|
+
* const openPreferencesModal = useOpenPreferencesModal()
|
|
602
|
+
*
|
|
603
|
+
* return (
|
|
604
|
+
* <button onClick={openPreferencesModal}>
|
|
605
|
+
* ⚙️ Configurar Cookies
|
|
606
|
+
* </button>
|
|
607
|
+
* )
|
|
608
|
+
* }
|
|
609
|
+
* ```
|
|
610
|
+
*/
|
|
611
|
+
declare function useOpenPreferencesModal(): () => void;
|
|
612
|
+
declare function openPreferencesModal(): void;
|
|
585
613
|
|
|
586
614
|
/**
|
|
587
615
|
* Sistema de orientações para developers sobre configuração de categorias.
|
|
@@ -718,4 +746,28 @@ declare function ConsentScriptLoader({ integrations, reloadOnChange, }: Readonly
|
|
|
718
746
|
*/
|
|
719
747
|
declare function useConsentScriptLoader(): (integration: ScriptIntegration) => Promise<boolean>;
|
|
720
748
|
|
|
721
|
-
|
|
749
|
+
/**
|
|
750
|
+
* Sistema de logging interno da biblioteca para facilitar debug e troubleshooting.
|
|
751
|
+
* Os logs são desabilitados automaticamente em production builds.
|
|
752
|
+
*/
|
|
753
|
+
declare enum LogLevel {
|
|
754
|
+
ERROR = 0,
|
|
755
|
+
WARN = 1,
|
|
756
|
+
INFO = 2,
|
|
757
|
+
DEBUG = 3
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* Função para habilitar/desabilitar logs de debug externamente.
|
|
761
|
+
* Útil para troubleshooting em produção quando necessário.
|
|
762
|
+
*
|
|
763
|
+
* @example
|
|
764
|
+
* ```typescript
|
|
765
|
+
* import { setDebugLogging } from 'react-lgpd-consent'
|
|
766
|
+
*
|
|
767
|
+
* // Habilitar logs detalhados
|
|
768
|
+
* setDebugLogging(true, LogLevel.DEBUG)
|
|
769
|
+
* ```
|
|
770
|
+
*/
|
|
771
|
+
declare function setDebugLogging(enabled: boolean, level?: LogLevel): void;
|
|
772
|
+
|
|
773
|
+
export { COMMON_INTEGRATIONS, type Category, type CategoryDefinition, type ConsentCookieOptions, ConsentGate, type ConsentPreferences, ConsentProvider, type ConsentProviderProps, ConsentScriptLoader, type ConsentState, type ConsentTexts, type CustomCookieBannerProps, type CustomFloatingPreferencesButtonProps, type CustomPreferencesModalProps, DEFAULT_PROJECT_CATEGORIES, type DeveloperGuidance, type GoogleAnalyticsConfig, type GoogleTagManagerConfig, LogLevel, PreferencesModal, type ProjectCategoriesConfig, type ScriptIntegration, type UserWayConfig, analyzeDeveloperConfiguration, createGoogleAnalyticsIntegration, createGoogleTagManagerIntegration, createUserWayIntegration, defaultConsentTheme, loadScript, openPreferencesModal, setDebugLogging, useCategories, useCategoryStatus, useConsent, useConsentHydration, useConsentScriptLoader, useConsentTexts, useOpenPreferencesModal };
|
package/dist/index.d.ts
CHANGED
|
@@ -196,6 +196,13 @@ interface ConsentTexts {
|
|
|
196
196
|
modalIntro: string;
|
|
197
197
|
save: string;
|
|
198
198
|
necessaryAlwaysOn: string;
|
|
199
|
+
preferencesButton?: string;
|
|
200
|
+
preferencesTitle?: string;
|
|
201
|
+
preferencesDescription?: string;
|
|
202
|
+
close?: string;
|
|
203
|
+
accept?: string;
|
|
204
|
+
reject?: string;
|
|
205
|
+
brandingPoweredBy?: string;
|
|
199
206
|
controllerInfo?: string;
|
|
200
207
|
dataTypes?: string;
|
|
201
208
|
thirdPartySharing?: string;
|
|
@@ -582,6 +589,27 @@ declare function useConsentTexts(): ConsentTexts;
|
|
|
582
589
|
* Útil para evitar flash do banner antes de verificar cookies existentes.
|
|
583
590
|
*/
|
|
584
591
|
declare function useConsentHydration(): boolean;
|
|
592
|
+
/**
|
|
593
|
+
* Hook para abrir o modal de preferências programaticamente.
|
|
594
|
+
* Útil quando você tem controle customizado sobre como o modal é aberto.
|
|
595
|
+
*
|
|
596
|
+
* @returns Função para abrir o modal de preferências.
|
|
597
|
+
*
|
|
598
|
+
* @example
|
|
599
|
+
* ```tsx
|
|
600
|
+
* function CustomAccessibilityDock() {
|
|
601
|
+
* const openPreferencesModal = useOpenPreferencesModal()
|
|
602
|
+
*
|
|
603
|
+
* return (
|
|
604
|
+
* <button onClick={openPreferencesModal}>
|
|
605
|
+
* ⚙️ Configurar Cookies
|
|
606
|
+
* </button>
|
|
607
|
+
* )
|
|
608
|
+
* }
|
|
609
|
+
* ```
|
|
610
|
+
*/
|
|
611
|
+
declare function useOpenPreferencesModal(): () => void;
|
|
612
|
+
declare function openPreferencesModal(): void;
|
|
585
613
|
|
|
586
614
|
/**
|
|
587
615
|
* Sistema de orientações para developers sobre configuração de categorias.
|
|
@@ -718,4 +746,28 @@ declare function ConsentScriptLoader({ integrations, reloadOnChange, }: Readonly
|
|
|
718
746
|
*/
|
|
719
747
|
declare function useConsentScriptLoader(): (integration: ScriptIntegration) => Promise<boolean>;
|
|
720
748
|
|
|
721
|
-
|
|
749
|
+
/**
|
|
750
|
+
* Sistema de logging interno da biblioteca para facilitar debug e troubleshooting.
|
|
751
|
+
* Os logs são desabilitados automaticamente em production builds.
|
|
752
|
+
*/
|
|
753
|
+
declare enum LogLevel {
|
|
754
|
+
ERROR = 0,
|
|
755
|
+
WARN = 1,
|
|
756
|
+
INFO = 2,
|
|
757
|
+
DEBUG = 3
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* Função para habilitar/desabilitar logs de debug externamente.
|
|
761
|
+
* Útil para troubleshooting em produção quando necessário.
|
|
762
|
+
*
|
|
763
|
+
* @example
|
|
764
|
+
* ```typescript
|
|
765
|
+
* import { setDebugLogging } from 'react-lgpd-consent'
|
|
766
|
+
*
|
|
767
|
+
* // Habilitar logs detalhados
|
|
768
|
+
* setDebugLogging(true, LogLevel.DEBUG)
|
|
769
|
+
* ```
|
|
770
|
+
*/
|
|
771
|
+
declare function setDebugLogging(enabled: boolean, level?: LogLevel): void;
|
|
772
|
+
|
|
773
|
+
export { COMMON_INTEGRATIONS, type Category, type CategoryDefinition, type ConsentCookieOptions, ConsentGate, type ConsentPreferences, ConsentProvider, type ConsentProviderProps, ConsentScriptLoader, type ConsentState, type ConsentTexts, type CustomCookieBannerProps, type CustomFloatingPreferencesButtonProps, type CustomPreferencesModalProps, DEFAULT_PROJECT_CATEGORIES, type DeveloperGuidance, type GoogleAnalyticsConfig, type GoogleTagManagerConfig, LogLevel, PreferencesModal, type ProjectCategoriesConfig, type ScriptIntegration, type UserWayConfig, analyzeDeveloperConfiguration, createGoogleAnalyticsIntegration, createGoogleTagManagerIntegration, createUserWayIntegration, defaultConsentTheme, loadScript, openPreferencesModal, setDebugLogging, useCategories, useCategoryStatus, useConsent, useConsentHydration, useConsentScriptLoader, useConsentTexts, useOpenPreferencesModal };
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ConsentProvider,
|
|
3
3
|
DEFAULT_PROJECT_CATEGORIES,
|
|
4
|
+
LogLevel,
|
|
4
5
|
PreferencesModal,
|
|
5
6
|
analyzeDeveloperConfiguration,
|
|
6
7
|
defaultConsentTheme,
|
|
8
|
+
openPreferencesModal,
|
|
9
|
+
setDebugLogging,
|
|
7
10
|
useCategories,
|
|
8
11
|
useCategoryStatus,
|
|
9
12
|
useConsent,
|
|
10
13
|
useConsentHydration,
|
|
11
|
-
useConsentTexts
|
|
12
|
-
|
|
14
|
+
useConsentTexts,
|
|
15
|
+
useOpenPreferencesModal
|
|
16
|
+
} from "./chunk-VFAOBR3X.js";
|
|
13
17
|
|
|
14
18
|
// src/utils/ConsentGate.tsx
|
|
15
19
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
@@ -192,6 +196,7 @@ export {
|
|
|
192
196
|
ConsentProvider,
|
|
193
197
|
ConsentScriptLoader,
|
|
194
198
|
DEFAULT_PROJECT_CATEGORIES,
|
|
199
|
+
LogLevel,
|
|
195
200
|
PreferencesModal,
|
|
196
201
|
analyzeDeveloperConfiguration,
|
|
197
202
|
createGoogleAnalyticsIntegration,
|
|
@@ -199,10 +204,13 @@ export {
|
|
|
199
204
|
createUserWayIntegration,
|
|
200
205
|
defaultConsentTheme,
|
|
201
206
|
loadScript,
|
|
207
|
+
openPreferencesModal,
|
|
208
|
+
setDebugLogging,
|
|
202
209
|
useCategories,
|
|
203
210
|
useCategoryStatus,
|
|
204
211
|
useConsent,
|
|
205
212
|
useConsentHydration,
|
|
206
213
|
useConsentScriptLoader,
|
|
207
|
-
useConsentTexts
|
|
214
|
+
useConsentTexts,
|
|
215
|
+
useOpenPreferencesModal
|
|
208
216
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-lgpd-consent",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Biblioteca completa de consentimento LGPD com 6 categorias ANPD, integrações nativas e sistema extensível para React.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lgpd",
|
|
@@ -48,12 +48,13 @@
|
|
|
48
48
|
"dist",
|
|
49
49
|
"README.md",
|
|
50
50
|
"LICENSE",
|
|
51
|
-
"COMPLIANCE.md"
|
|
51
|
+
"COMPLIANCE.md",
|
|
52
|
+
"CHANGELOG.md"
|
|
52
53
|
],
|
|
53
54
|
"engines": {
|
|
54
55
|
"node": ">=18.18"
|
|
55
56
|
},
|
|
56
|
-
"packageManager": "pnpm@9.
|
|
57
|
+
"packageManager": "pnpm@9.15.9",
|
|
57
58
|
"scripts": {
|
|
58
59
|
"clean": "rimraf dist",
|
|
59
60
|
"build": "cross-env NODE_ENV=production tsup src/index.ts --format esm,cjs --dts --clean",
|
|
@@ -97,7 +98,7 @@
|
|
|
97
98
|
"@testing-library/user-event": "^14.6.1",
|
|
98
99
|
"@types/jest": "^30.0.0",
|
|
99
100
|
"@types/js-cookie": "^3.0.6",
|
|
100
|
-
"@types/react": "^19.1.
|
|
101
|
+
"@types/react": "^19.1.10",
|
|
101
102
|
"@types/react-dom": "^19.1.7",
|
|
102
103
|
"@typescript-eslint/eslint-plugin": "^8.39.1",
|
|
103
104
|
"@typescript-eslint/parser": "^8.39.1",
|