@c15t/react 0.0.1-rc.12 → 0.0.1-rc.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/consent-manager-dialog/__tests__/styles.spec.cjs +7 -7
- package/dist/components/consent-manager-dialog/__tests__/styles.spec.js +6 -6
- package/dist/components/consent-manager-dialog/consent-manager-dialog_module.css +3 -3
- package/dist/components/consent-manager-widget/__tests__/styles.spec.cjs +7 -7
- package/dist/components/consent-manager-widget/__tests__/styles.spec.js +6 -6
- package/dist/components/cookie-banner/__tests__/styles.spec.cjs +24 -7
- package/dist/components/cookie-banner/__tests__/styles.spec.js +23 -6
- package/dist/components/cookie-banner/error-boundary.cjs +0 -1
- package/dist/components/cookie-banner/error-boundary.js +0 -1
- package/dist/components/shared/libs/polymorphic.d.ts +1 -7
- package/dist/components/shared/libs/polymorphic.d.ts.map +1 -1
- package/dist/components/shared/primitives/button.cjs +2 -52
- package/dist/components/shared/primitives/button.d.ts.map +1 -1
- package/dist/components/shared/primitives/button.js +2 -52
- package/dist/components/shared/primitives/button.types.d.ts +1 -8
- package/dist/components/shared/primitives/button.types.d.ts.map +1 -1
- package/dist/components/shared/ui/accordion/accordion.types.d.ts +0 -10
- package/dist/components/shared/ui/accordion/accordion.types.d.ts.map +1 -1
- package/dist/components/shared/ui/logo.cjs +4 -5
- package/dist/components/shared/ui/logo.d.ts.map +1 -1
- package/dist/components/shared/ui/logo.js +4 -5
- package/dist/context/consent-manager-context.d.ts +2 -2
- package/dist/context/consent-manager-context.d.ts.map +1 -1
- package/dist/hooks/use-consent-manager.cjs +2 -2
- package/dist/hooks/use-consent-manager.d.ts +2 -7
- package/dist/hooks/use-consent-manager.d.ts.map +1 -1
- package/dist/hooks/use-consent-manager.js +2 -2
- package/dist/hooks/use-focus-trap.cjs +1 -1
- package/dist/hooks/use-focus-trap.js +1 -1
- package/dist/hooks/use-theme.d.ts.map +1 -1
- package/dist/index.cjs +6 -12
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/providers/consent-manager-provider.cjs +26 -18
- package/dist/providers/consent-manager-provider.d.ts +16 -2
- package/dist/providers/consent-manager-provider.d.ts.map +1 -1
- package/dist/providers/consent-manager-provider.js +26 -18
- package/dist/types/consent-manager.d.ts +26 -55
- package/dist/types/consent-manager.d.ts.map +1 -1
- package/dist/utils/cn.cjs +0 -2
- package/dist/utils/cn.d.ts +1 -5
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/cn.js +1 -2
- package/dist/{components/consent-manager-dialog/__tests__/utils.cjs → utils/test-helpers.cjs} +26 -28
- package/dist/utils/test-helpers.d.ts +30 -0
- package/dist/utils/test-helpers.d.ts.map +1 -0
- package/dist/utils/test-helpers.js +36 -0
- package/package.json +2 -2
- package/dist/components/consent-manager-dialog/__tests__/utils.d.ts +0 -13
- package/dist/components/consent-manager-dialog/__tests__/utils.d.ts.map +0 -1
- package/dist/components/consent-manager-dialog/__tests__/utils.js +0 -39
- package/dist/components/consent-manager-widget/__tests__/utils.cjs +0 -71
- package/dist/components/consent-manager-widget/__tests__/utils.d.ts +0 -13
- package/dist/components/consent-manager-widget/__tests__/utils.d.ts.map +0 -1
- package/dist/components/consent-manager-widget/__tests__/utils.js +0 -39
- package/dist/components/consent-manager-widget/atoms/logo.cjs +0 -99
- package/dist/components/consent-manager-widget/atoms/logo.d.ts +0 -8
- package/dist/components/consent-manager-widget/atoms/logo.d.ts.map +0 -1
- package/dist/components/consent-manager-widget/atoms/logo.js +0 -67
- package/dist/components/cookie-banner/__tests__/utils.cjs +0 -70
- package/dist/components/cookie-banner/__tests__/utils.d.ts +0 -13
- package/dist/components/cookie-banner/__tests__/utils.d.ts.map +0 -1
- package/dist/components/cookie-banner/__tests__/utils.js +0 -38
- package/dist/hooks/use-consent-client.cjs +0 -41
- package/dist/hooks/use-consent-client.d.ts +0 -26
- package/dist/hooks/use-consent-client.d.ts.map +0 -1
- package/dist/hooks/use-consent-client.js +0 -9
|
@@ -38,11 +38,10 @@ const ConsentManagementIcon = ({ title = 'c15t', titleId = 'c15t', ...props })=>
|
|
|
38
38
|
children: title
|
|
39
39
|
}),
|
|
40
40
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
d: "M74.133 40.987c9.301 0 16.84-7.54 16.84-16.84 0-9.302-7.539-16.842-16.84-16.842s-16.841 7.54-16.841 16.841c0 9.301 7.54 16.841 16.84 16.841ZM62.008 36.272 35.736 62.544M61.078 114.226 34.806 87.954M23.61 91.51c9.301 0 16.841-7.54 16.841-16.84 0-9.302-7.54-16.842-16.84-16.842-9.302 0-16.841 7.54-16.841 16.841 0 9.301 7.54 16.841 16.84 16.841ZM40.452 74.67h67.363M124.656 91.51c9.301 0 16.841-7.54 16.841-16.84 0-9.302-7.54-16.842-16.841-16.842-9.301 0-16.841 7.54-16.841 16.841 0 9.301 7.54 16.841 16.841 16.841ZM74.133 142.033c9.301 0 16.84-7.54 16.84-16.841 0-9.301-7.539-16.841-16.84-16.841s-16.841 7.54-16.841 16.841c0 9.301 7.54 16.841 16.84 16.841Z"
|
|
41
|
+
fill: "currentColor",
|
|
42
|
+
fillRule: "evenodd",
|
|
43
|
+
d: "M74.133 14.042c-5.58 0-10.105 4.524-10.105 10.104 0 5.581 4.524 10.105 10.105 10.105 5.58 0 10.105-4.524 10.105-10.105 0-5.58-4.524-10.104-10.105-10.104ZM50.556 24.146C50.556 11.125 61.112.57 74.133.57 87.154.57 97.71 11.125 97.71 24.146c0 13.022-10.556 23.578-23.577 23.578-4.06 0-7.88-1.027-11.216-2.834L44.354 63.453a23.424 23.424 0 0 1 1.858 4.48h55.843c2.899-9.74 11.921-16.841 22.601-16.841 13.022 0 23.578 10.556 23.578 23.577 0 13.022-10.556 23.578-23.578 23.578-10.68 0-19.702-7.102-22.601-16.841H46.211a23.455 23.455 0 0 1-2.628 5.798l18.015 18.015a23.473 23.473 0 0 1 12.535-3.604c13.021 0 23.577 10.556 23.577 23.577 0 13.022-10.556 23.577-23.577 23.577-13.021 0-23.577-10.555-23.577-23.577 0-3.506.765-6.833 2.138-9.824l-19.26-19.26a23.49 23.49 0 0 1-9.823 2.139C10.588 98.247.032 87.69.032 74.669c0-13.021 10.556-23.577 23.577-23.577 4.061 0 7.882 1.026 11.217 2.834L53.39 35.364a23.473 23.473 0 0 1-2.834-11.218Zm63.996 50.523v.023c.012 5.57 4.531 10.082 10.104 10.082 5.581 0 10.105-4.524 10.105-10.105 0-5.58-4.524-10.104-10.105-10.104-5.573 0-10.092 4.511-10.104 10.082v.022ZM23.61 64.565c-5.58 0-10.104 4.524-10.104 10.104 0 5.58 4.524 10.105 10.104 10.105 5.581 0 10.105-4.524 10.105-10.105 0-5.58-4.524-10.104-10.105-10.104Zm40.418 60.627c0-5.581 4.524-10.104 10.105-10.104 5.58 0 10.105 4.523 10.105 10.104 0 5.581-4.524 10.105-10.105 10.105-5.58 0-10.105-4.524-10.105-10.105Z",
|
|
44
|
+
clipRule: "evenodd"
|
|
46
45
|
}),
|
|
47
46
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
|
|
48
47
|
fill: "currentColor",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logo.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/ui/logo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,UAAU,0BAA0B;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,qBAAqB,GAAI,8BAInC,QAAQ,CAAC,aAAa,CAAC,GAAG,0BAA0B,
|
|
1
|
+
{"version":3,"file":"logo.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/ui/logo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,UAAU,0BAA0B;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,qBAAqB,GAAI,8BAInC,QAAQ,CAAC,aAAa,CAAC,GAAG,0BAA0B,4CAmBtD,CAAC"}
|
|
@@ -10,11 +10,10 @@ const ConsentManagementIcon = ({ title = 'c15t', titleId = 'c15t', ...props })=>
|
|
|
10
10
|
children: title
|
|
11
11
|
}),
|
|
12
12
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("path", {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
d: "M74.133 40.987c9.301 0 16.84-7.54 16.84-16.84 0-9.302-7.539-16.842-16.84-16.842s-16.841 7.54-16.841 16.841c0 9.301 7.54 16.841 16.84 16.841ZM62.008 36.272 35.736 62.544M61.078 114.226 34.806 87.954M23.61 91.51c9.301 0 16.841-7.54 16.841-16.84 0-9.302-7.54-16.842-16.84-16.842-9.302 0-16.841 7.54-16.841 16.841 0 9.301 7.54 16.841 16.84 16.841ZM40.452 74.67h67.363M124.656 91.51c9.301 0 16.841-7.54 16.841-16.84 0-9.302-7.54-16.842-16.841-16.842-9.301 0-16.841 7.54-16.841 16.841 0 9.301 7.54 16.841 16.841 16.841ZM74.133 142.033c9.301 0 16.84-7.54 16.84-16.841 0-9.301-7.539-16.841-16.84-16.841s-16.841 7.54-16.841 16.841c0 9.301 7.54 16.841 16.84 16.841Z"
|
|
13
|
+
fill: "currentColor",
|
|
14
|
+
fillRule: "evenodd",
|
|
15
|
+
d: "M74.133 14.042c-5.58 0-10.105 4.524-10.105 10.104 0 5.581 4.524 10.105 10.105 10.105 5.58 0 10.105-4.524 10.105-10.105 0-5.58-4.524-10.104-10.105-10.104ZM50.556 24.146C50.556 11.125 61.112.57 74.133.57 87.154.57 97.71 11.125 97.71 24.146c0 13.022-10.556 23.578-23.577 23.578-4.06 0-7.88-1.027-11.216-2.834L44.354 63.453a23.424 23.424 0 0 1 1.858 4.48h55.843c2.899-9.74 11.921-16.841 22.601-16.841 13.022 0 23.578 10.556 23.578 23.577 0 13.022-10.556 23.578-23.578 23.578-10.68 0-19.702-7.102-22.601-16.841H46.211a23.455 23.455 0 0 1-2.628 5.798l18.015 18.015a23.473 23.473 0 0 1 12.535-3.604c13.021 0 23.577 10.556 23.577 23.577 0 13.022-10.556 23.577-23.577 23.577-13.021 0-23.577-10.555-23.577-23.577 0-3.506.765-6.833 2.138-9.824l-19.26-19.26a23.49 23.49 0 0 1-9.823 2.139C10.588 98.247.032 87.69.032 74.669c0-13.021 10.556-23.577 23.577-23.577 4.061 0 7.882 1.026 11.217 2.834L53.39 35.364a23.473 23.473 0 0 1-2.834-11.218Zm63.996 50.523v.023c.012 5.57 4.531 10.082 10.104 10.082 5.581 0 10.105-4.524 10.105-10.105 0-5.58-4.524-10.104-10.105-10.104-5.573 0-10.092 4.511-10.104 10.082v.022ZM23.61 64.565c-5.58 0-10.104 4.524-10.104 10.104 0 5.58 4.524 10.105 10.104 10.105 5.581 0 10.105-4.524 10.105-10.105 0-5.58-4.524-10.104-10.105-10.104Zm40.418 60.627c0-5.581 4.524-10.104 10.105-10.104 5.58 0 10.105 4.523 10.105 10.104 0 5.581-4.524 10.105-10.105 10.105-5.58 0-10.105-4.524-10.105-10.105Z",
|
|
16
|
+
clipRule: "evenodd"
|
|
18
17
|
}),
|
|
19
18
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("path", {
|
|
20
19
|
fill: "currentColor",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @packageDocumentation
|
|
3
3
|
* Provides the context for sharing consent management state across components.
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
5
|
+
import type { ConsentManagerInterface, PrivacyConsentState } from 'c15t';
|
|
6
6
|
/**
|
|
7
7
|
* The context value provided by ConsentManagerProvider.
|
|
8
8
|
*/
|
|
@@ -23,7 +23,7 @@ export interface ConsentStateContextValue {
|
|
|
23
23
|
/**
|
|
24
24
|
* Optional API client instance
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
manager: ConsentManagerInterface | null;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Context for sharing consent management state across components.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-manager-context.d.ts","sourceRoot":"","sources":["../../src/context/consent-manager-context.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"consent-manager-context.d.ts","sourceRoot":"","sources":["../../src/context/consent-manager-context.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAGzE;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,KAAK,EAAE,mBAAmB,CAAC;IAE3B;;;OAGG;IACH,KAAK,EAAE;QACN,QAAQ,EAAE,MAAM,mBAAmB,CAAC;QACpC,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;QAC1E,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;KACxD,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,uBAAuB,GAAG,IAAI,CAAC;CACxC;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,+DAEpB,CAAC"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* - Methods to update consents
|
|
12
12
|
* - Compliance settings and region detection
|
|
13
13
|
* - State persistence and retrieval
|
|
14
|
-
* - The
|
|
14
|
+
* - The consent manager (if configured)
|
|
15
15
|
*
|
|
16
16
|
* The hook must be used within a ConsentManagerProvider component.
|
|
17
17
|
*
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @public
|
|
23
23
|
*/
|
|
24
24
|
export declare function useConsentManager(): {
|
|
25
|
-
|
|
25
|
+
manager?: import("c15t").ConsentManagerInterface | undefined;
|
|
26
26
|
consents: import("c15t").ConsentState;
|
|
27
27
|
consentInfo: {
|
|
28
28
|
time: number;
|
|
@@ -53,15 +53,10 @@ export declare function useConsentManager(): {
|
|
|
53
53
|
setCallback: (name: keyof import("c15t").Callbacks, callback: import("c15t").CallbackFunction | undefined) => void;
|
|
54
54
|
setDetectedCountry: (country: string) => void;
|
|
55
55
|
setLocationInfo: (location: import("c15t").LocationInfo | null) => void;
|
|
56
|
-
setJurisdictionInfo: (jurisdiction: import("c15t").JurisdictionInfo | null) => void;
|
|
57
56
|
fetchConsentBannerInfo: () => Promise<import("c15t").ConsentBannerResponse | undefined>;
|
|
58
57
|
getDisplayedConsents: () => typeof import("c15t").consentTypes;
|
|
59
58
|
hasConsented: () => boolean;
|
|
60
|
-
clearAllData: () => void;
|
|
61
|
-
updateConsentMode: () => void;
|
|
62
|
-
setPrivacySettings: (settings: Partial<import("c15t").PrivacySettings>) => void;
|
|
63
59
|
getEffectiveConsents: () => import("c15t").ConsentState;
|
|
64
60
|
hasConsentFor: (consentType: import("c15t").AllConsentNames) => boolean;
|
|
65
|
-
setIncludeNonDisplayedConsents: (include: boolean) => void;
|
|
66
61
|
};
|
|
67
62
|
//# sourceMappingURL=use-consent-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-consent-manager.d.ts","sourceRoot":"","sources":["../../src/hooks/use-consent-manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"use-consent-manager.d.ts","sourceRoot":"","sources":["../../src/hooks/use-consent-manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;uCAmB4hE,CAAC;;;;;;;;;;;;;;;EAD7jE"}
|
|
@@ -38,7 +38,7 @@ function useFocusTrap(shouldTrap, containerRef) {
|
|
|
38
38
|
}, 0);
|
|
39
39
|
else if (-1 !== containerRef.current.tabIndex) try {
|
|
40
40
|
containerRef.current.focus();
|
|
41
|
-
} catch
|
|
41
|
+
} catch {}
|
|
42
42
|
const handleKeyDown = (e)=>{
|
|
43
43
|
if ('Tab' !== e.key || !containerRef.current) return;
|
|
44
44
|
const focusableElements = getFocusableElements(containerRef.current);
|
|
@@ -10,7 +10,7 @@ function useFocusTrap(shouldTrap, containerRef) {
|
|
|
10
10
|
}, 0);
|
|
11
11
|
else if (-1 !== containerRef.current.tabIndex) try {
|
|
12
12
|
containerRef.current.focus();
|
|
13
|
-
} catch
|
|
13
|
+
} catch {}
|
|
14
14
|
const handleKeyDown = (e)=>{
|
|
15
15
|
if ('Tab' !== e.key || !containerRef.current) return;
|
|
16
16
|
const focusableElements = getFocusableElements(containerRef.current);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-theme.d.ts","sourceRoot":"","sources":["../../src/hooks/use-theme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-theme.d.ts","sourceRoot":"","sources":["../../src/hooks/use-theme.ts"],"names":[],"mappings":"AAmEA,eAAO,MAAM,QAAQ,oEAYpB,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -12,9 +12,6 @@ var __webpack_modules__ = {
|
|
|
12
12
|
"./hooks/use-color-scheme": function(module) {
|
|
13
13
|
module.exports = require("./hooks/use-color-scheme.cjs");
|
|
14
14
|
},
|
|
15
|
-
"./hooks/use-consent-client": function(module) {
|
|
16
|
-
module.exports = require("./hooks/use-consent-client.cjs");
|
|
17
|
-
},
|
|
18
15
|
"./hooks/use-consent-manager": function(module) {
|
|
19
16
|
module.exports = require("./hooks/use-consent-manager.cjs");
|
|
20
17
|
},
|
|
@@ -79,9 +76,8 @@ var __webpack_exports__ = {};
|
|
|
79
76
|
ConsentManagerProvider: ()=>_providers_consent_manager_provider__WEBPACK_IMPORTED_MODULE_3__.ConsentManagerProvider,
|
|
80
77
|
ConsentManagerWidget: ()=>_components_consent_manager_widget_consent_manager_widget__WEBPACK_IMPORTED_MODULE_1__.ConsentManagerWidget,
|
|
81
78
|
CookieBanner: ()=>_components_cookie_banner_cookie_banner__WEBPACK_IMPORTED_MODULE_0__.CookieBanner,
|
|
82
|
-
|
|
79
|
+
configureConsentManager: ()=>c15t__WEBPACK_IMPORTED_MODULE_7__.configureConsentManager,
|
|
83
80
|
useColorScheme: ()=>_hooks_use_color_scheme__WEBPACK_IMPORTED_MODULE_6__.useColorScheme,
|
|
84
|
-
useConsentClient: ()=>_hooks_use_consent_client__WEBPACK_IMPORTED_MODULE_7__.useConsentClient,
|
|
85
81
|
useConsentManager: ()=>_hooks_use_consent_manager__WEBPACK_IMPORTED_MODULE_4__.useConsentManager,
|
|
86
82
|
useTranslations: ()=>_hooks_use_translations__WEBPACK_IMPORTED_MODULE_5__.useTranslations
|
|
87
83
|
});
|
|
@@ -92,23 +88,21 @@ var __webpack_exports__ = {};
|
|
|
92
88
|
var _hooks_use_consent_manager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./hooks/use-consent-manager");
|
|
93
89
|
var _hooks_use_translations__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./hooks/use-translations");
|
|
94
90
|
var _hooks_use_color_scheme__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./hooks/use-color-scheme");
|
|
95
|
-
var
|
|
96
|
-
var
|
|
97
|
-
var _utils_translations__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("./utils/translations");
|
|
91
|
+
var c15t__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("c15t");
|
|
92
|
+
var _utils_translations__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./utils/translations");
|
|
98
93
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
99
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
94
|
+
for(var __WEBPACK_IMPORT_KEY__ in _utils_translations__WEBPACK_IMPORTED_MODULE_8__)if ([
|
|
100
95
|
"useColorScheme",
|
|
101
96
|
"useTranslations",
|
|
102
97
|
"ConsentManagerWidget",
|
|
103
|
-
"
|
|
98
|
+
"configureConsentManager",
|
|
104
99
|
"CookieBanner",
|
|
105
100
|
"useConsentManager",
|
|
106
101
|
"default",
|
|
107
102
|
"ConsentManagerProvider",
|
|
108
|
-
"useConsentClient",
|
|
109
103
|
"ConsentManagerDialog"
|
|
110
104
|
].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
111
|
-
return
|
|
105
|
+
return _utils_translations__WEBPACK_IMPORTED_MODULE_8__[key];
|
|
112
106
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
113
107
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
114
108
|
})();
|
package/dist/index.d.ts
CHANGED
|
@@ -8,8 +8,7 @@ export { ConsentManagerProvider } from './providers/consent-manager-provider';
|
|
|
8
8
|
export { useConsentManager } from './hooks/use-consent-manager';
|
|
9
9
|
export { useTranslations } from './hooks/use-translations';
|
|
10
10
|
export { useColorScheme } from './hooks/use-color-scheme';
|
|
11
|
-
export {
|
|
12
|
-
export { createConsentClient, type c15tClient, type c15tClientOptions, } from 'c15t';
|
|
11
|
+
export { configureConsentManager, type ConsentManagerInterface, type ConsentManagerOptions, } from 'c15t';
|
|
13
12
|
export type { ConsentManagerProviderProps } from './types/consent-manager';
|
|
14
13
|
export * from './utils/translations';
|
|
15
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAClG,YAAY,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAClG,YAAY,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AAC5G,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAG9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAClG,YAAY,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAClG,YAAY,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AAC5G,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAG9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,EACN,uBAAuB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,GAC1B,MAAM,MAAM,CAAC;AAGd,YAAY,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAG3E,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,16 +5,14 @@ import * as __WEBPACK_EXTERNAL_MODULE__providers_consent_manager_provider_js_745
|
|
|
5
5
|
import * as __WEBPACK_EXTERNAL_MODULE__hooks_use_consent_manager_js_2b895421__ from "./hooks/use-consent-manager.js";
|
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE__hooks_use_translations_js_78932b91__ from "./hooks/use-translations.js";
|
|
7
7
|
import * as __WEBPACK_EXTERNAL_MODULE__hooks_use_color_scheme_js_41dc75de__ from "./hooks/use-color-scheme.js";
|
|
8
|
-
import * as __WEBPACK_EXTERNAL_MODULE__hooks_use_consent_client_js_2afe8c6b__ from "./hooks/use-consent-client.js";
|
|
9
8
|
import * as __WEBPACK_EXTERNAL_MODULE_c15t__ from "c15t";
|
|
10
9
|
export * from "./utils/translations.js";
|
|
11
10
|
var __webpack_exports__ConsentManagerDialog = __WEBPACK_EXTERNAL_MODULE__components_consent_manager_dialog_consent_manager_dialog_js_d74113dd__.ConsentManagerDialog;
|
|
12
11
|
var __webpack_exports__ConsentManagerProvider = __WEBPACK_EXTERNAL_MODULE__providers_consent_manager_provider_js_7459f585__.ConsentManagerProvider;
|
|
13
12
|
var __webpack_exports__ConsentManagerWidget = __WEBPACK_EXTERNAL_MODULE__components_consent_manager_widget_consent_manager_widget_js_080fb908__.ConsentManagerWidget;
|
|
14
13
|
var __webpack_exports__CookieBanner = __WEBPACK_EXTERNAL_MODULE__components_cookie_banner_cookie_banner_js_aba0c776__.CookieBanner;
|
|
15
|
-
var
|
|
14
|
+
var __webpack_exports__configureConsentManager = __WEBPACK_EXTERNAL_MODULE_c15t__.configureConsentManager;
|
|
16
15
|
var __webpack_exports__useColorScheme = __WEBPACK_EXTERNAL_MODULE__hooks_use_color_scheme_js_41dc75de__.useColorScheme;
|
|
17
|
-
var __webpack_exports__useConsentClient = __WEBPACK_EXTERNAL_MODULE__hooks_use_consent_client_js_2afe8c6b__.useConsentClient;
|
|
18
16
|
var __webpack_exports__useConsentManager = __WEBPACK_EXTERNAL_MODULE__hooks_use_consent_manager_js_2b895421__.useConsentManager;
|
|
19
17
|
var __webpack_exports__useTranslations = __WEBPACK_EXTERNAL_MODULE__hooks_use_translations_js_78932b91__.useTranslations;
|
|
20
|
-
export { __webpack_exports__ConsentManagerDialog as ConsentManagerDialog, __webpack_exports__ConsentManagerProvider as ConsentManagerProvider, __webpack_exports__ConsentManagerWidget as ConsentManagerWidget, __webpack_exports__CookieBanner as CookieBanner,
|
|
18
|
+
export { __webpack_exports__ConsentManagerDialog as ConsentManagerDialog, __webpack_exports__ConsentManagerProvider as ConsentManagerProvider, __webpack_exports__ConsentManagerWidget as ConsentManagerWidget, __webpack_exports__CookieBanner as CookieBanner, __webpack_exports__configureConsentManager as configureConsentManager, __webpack_exports__useColorScheme as useColorScheme, __webpack_exports__useConsentManager as useConsentManager, __webpack_exports__useTranslations as useTranslations };
|
|
@@ -34,7 +34,10 @@ const consent_manager_context_cjs_namespaceObject = require("../context/consent-
|
|
|
34
34
|
const translations_cjs_namespaceObject = require("../utils/translations.cjs");
|
|
35
35
|
const theme_context_cjs_namespaceObject = require("../context/theme-context.cjs");
|
|
36
36
|
const use_color_scheme_cjs_namespaceObject = require("../hooks/use-color-scheme.cjs");
|
|
37
|
-
function ConsentManagerProvider({ children,
|
|
37
|
+
function ConsentManagerProvider({ children, options }) {
|
|
38
|
+
const { store = {}, translations: translationConfig, react = {} } = options;
|
|
39
|
+
const { initialGdprTypes, initialComplianceSettings } = store;
|
|
40
|
+
const { theme, disableAnimation = false, scrollLock = false, trapFocus = true, colorScheme = 'system', noStyle = false } = react;
|
|
38
41
|
const preparedTranslationConfig = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
39
42
|
const mergedConfig = (0, translations_cjs_namespaceObject.mergeTranslationConfigs)(external_c15t_namespaceObject.defaultTranslationConfig, translationConfig);
|
|
40
43
|
const defaultLanguage = (0, translations_cjs_namespaceObject.detectBrowserLanguage)(mergedConfig.translations, mergedConfig.defaultLanguage, mergedConfig.disableAutoLanguageSwitch);
|
|
@@ -45,45 +48,50 @@ function ConsentManagerProvider({ children, initialGdprTypes, initialComplianceS
|
|
|
45
48
|
}, [
|
|
46
49
|
translationConfig
|
|
47
50
|
]);
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
const consentManager = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
52
|
+
if (!options) throw new Error('ConsentManagerProvider requires options to be provided');
|
|
53
|
+
const { store, translations, react, ...coreOpts } = options;
|
|
54
|
+
return (0, external_c15t_namespaceObject.configureConsentManager)(coreOpts);
|
|
55
|
+
}, [
|
|
56
|
+
options
|
|
57
|
+
]);
|
|
58
|
+
const consentStore = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
59
|
+
const storeWithTranslations = {
|
|
60
|
+
...store,
|
|
61
|
+
translationConfig: preparedTranslationConfig
|
|
51
62
|
};
|
|
52
|
-
|
|
53
|
-
store.getState().setTranslationConfig(preparedTranslationConfig);
|
|
54
|
-
return store;
|
|
63
|
+
return (0, external_c15t_namespaceObject.createConsentManagerStore)(consentManager, storeWithTranslations);
|
|
55
64
|
}, [
|
|
56
|
-
|
|
65
|
+
store,
|
|
57
66
|
preparedTranslationConfig,
|
|
58
|
-
|
|
59
|
-
client
|
|
67
|
+
consentManager
|
|
60
68
|
]);
|
|
61
|
-
const [state, setState] = (0, external_react_namespaceObject.useState)(
|
|
69
|
+
const [state, setState] = (0, external_react_namespaceObject.useState)(consentStore.getState());
|
|
62
70
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
63
|
-
const { setGdprTypes, setComplianceSetting, setDetectedCountry } =
|
|
71
|
+
const { setGdprTypes, setComplianceSetting, setDetectedCountry } = consentStore.getState();
|
|
64
72
|
if (initialGdprTypes) setGdprTypes(initialGdprTypes);
|
|
65
73
|
if (initialComplianceSettings) for (const [region, settings] of Object.entries(initialComplianceSettings))setComplianceSetting(region, settings);
|
|
66
74
|
const country = document.querySelector('meta[name="user-country"]')?.getAttribute('content') || 'US';
|
|
67
75
|
setDetectedCountry(country);
|
|
68
|
-
const unsubscribe =
|
|
76
|
+
const unsubscribe = consentStore.subscribe((newState)=>{
|
|
69
77
|
setState(newState);
|
|
70
78
|
});
|
|
71
79
|
return ()=>{
|
|
72
80
|
unsubscribe();
|
|
73
81
|
};
|
|
74
82
|
}, [
|
|
75
|
-
|
|
83
|
+
consentStore,
|
|
76
84
|
initialGdprTypes,
|
|
77
85
|
initialComplianceSettings
|
|
78
86
|
]);
|
|
79
87
|
const contextValue = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
80
88
|
state,
|
|
81
|
-
store,
|
|
82
|
-
|
|
89
|
+
store: consentStore,
|
|
90
|
+
manager: consentManager
|
|
83
91
|
}), [
|
|
84
92
|
state,
|
|
85
|
-
|
|
86
|
-
|
|
93
|
+
consentStore,
|
|
94
|
+
consentManager
|
|
87
95
|
]);
|
|
88
96
|
const themeContextValue = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
89
97
|
theme,
|
|
@@ -9,12 +9,26 @@ import type { ConsentManagerProviderProps } from '../types/consent-manager';
|
|
|
9
9
|
* @remarks
|
|
10
10
|
* This component initializes and manages the consent management system, including:
|
|
11
11
|
* - Setting up the consent store with initial configuration
|
|
12
|
-
* -
|
|
12
|
+
* - Creating a consent manager from the provided options
|
|
13
13
|
* - Detecting user's region for compliance
|
|
14
14
|
* - Managing consent state updates
|
|
15
15
|
* - Providing access to consent management throughout the app
|
|
16
16
|
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <ConsentManagerProvider
|
|
20
|
+
* options={{
|
|
21
|
+
* mode: 'offline',
|
|
22
|
+
* callbacks: {
|
|
23
|
+
* onConsentSet: (response) => console.log('Consent updated')
|
|
24
|
+
* }
|
|
25
|
+
* }}
|
|
26
|
+
* >
|
|
27
|
+
* {children}
|
|
28
|
+
* </ConsentManagerProvider>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
17
31
|
* @public
|
|
18
32
|
*/
|
|
19
|
-
export declare function ConsentManagerProvider({ children,
|
|
33
|
+
export declare function ConsentManagerProvider({ children, options, }: ConsentManagerProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
20
34
|
//# sourceMappingURL=consent-manager-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-manager-provider.d.ts","sourceRoot":"","sources":["../../src/providers/consent-manager-provider.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAQ5E;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"consent-manager-provider.d.ts","sourceRoot":"","sources":["../../src/providers/consent-manager-provider.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAQ5E;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,sBAAsB,CAAC,EACtC,QAAQ,EACR,OAAO,GACP,EAAE,2BAA2B,2CAkI7B"}
|
|
@@ -6,7 +6,10 @@ import * as __WEBPACK_EXTERNAL_MODULE__context_consent_manager_context_js_ee8f06
|
|
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE__utils_translations_js_c2629c1f__ from "../utils/translations.js";
|
|
7
7
|
import * as __WEBPACK_EXTERNAL_MODULE__context_theme_context_js_fbb05439__ from "../context/theme-context.js";
|
|
8
8
|
import * as __WEBPACK_EXTERNAL_MODULE__hooks_use_color_scheme_js_939e374b__ from "../hooks/use-color-scheme.js";
|
|
9
|
-
function ConsentManagerProvider({ children,
|
|
9
|
+
function ConsentManagerProvider({ children, options }) {
|
|
10
|
+
const { store = {}, translations: translationConfig, react = {} } = options;
|
|
11
|
+
const { initialGdprTypes, initialComplianceSettings } = store;
|
|
12
|
+
const { theme, disableAnimation = false, scrollLock = false, trapFocus = true, colorScheme = 'system', noStyle = false } = react;
|
|
10
13
|
const preparedTranslationConfig = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
|
|
11
14
|
const mergedConfig = (0, __WEBPACK_EXTERNAL_MODULE__utils_translations_js_c2629c1f__.mergeTranslationConfigs)(__WEBPACK_EXTERNAL_MODULE_c15t__.defaultTranslationConfig, translationConfig);
|
|
12
15
|
const defaultLanguage = (0, __WEBPACK_EXTERNAL_MODULE__utils_translations_js_c2629c1f__.detectBrowserLanguage)(mergedConfig.translations, mergedConfig.defaultLanguage, mergedConfig.disableAutoLanguageSwitch);
|
|
@@ -17,45 +20,50 @@ function ConsentManagerProvider({ children, initialGdprTypes, initialComplianceS
|
|
|
17
20
|
}, [
|
|
18
21
|
translationConfig
|
|
19
22
|
]);
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
const consentManager = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
|
|
24
|
+
if (!options) throw new Error('ConsentManagerProvider requires options to be provided');
|
|
25
|
+
const { store, translations, react, ...coreOpts } = options;
|
|
26
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_c15t__.configureConsentManager)(coreOpts);
|
|
27
|
+
}, [
|
|
28
|
+
options
|
|
29
|
+
]);
|
|
30
|
+
const consentStore = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
|
|
31
|
+
const storeWithTranslations = {
|
|
32
|
+
...store,
|
|
33
|
+
translationConfig: preparedTranslationConfig
|
|
23
34
|
};
|
|
24
|
-
|
|
25
|
-
store.getState().setTranslationConfig(preparedTranslationConfig);
|
|
26
|
-
return store;
|
|
35
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_c15t__.createConsentManagerStore)(consentManager, storeWithTranslations);
|
|
27
36
|
}, [
|
|
28
|
-
|
|
37
|
+
store,
|
|
29
38
|
preparedTranslationConfig,
|
|
30
|
-
|
|
31
|
-
client
|
|
39
|
+
consentManager
|
|
32
40
|
]);
|
|
33
|
-
const [state, setState] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(
|
|
41
|
+
const [state, setState] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(consentStore.getState());
|
|
34
42
|
(0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
|
|
35
|
-
const { setGdprTypes, setComplianceSetting, setDetectedCountry } =
|
|
43
|
+
const { setGdprTypes, setComplianceSetting, setDetectedCountry } = consentStore.getState();
|
|
36
44
|
if (initialGdprTypes) setGdprTypes(initialGdprTypes);
|
|
37
45
|
if (initialComplianceSettings) for (const [region, settings] of Object.entries(initialComplianceSettings))setComplianceSetting(region, settings);
|
|
38
46
|
const country = document.querySelector('meta[name="user-country"]')?.getAttribute('content') || 'US';
|
|
39
47
|
setDetectedCountry(country);
|
|
40
|
-
const unsubscribe =
|
|
48
|
+
const unsubscribe = consentStore.subscribe((newState)=>{
|
|
41
49
|
setState(newState);
|
|
42
50
|
});
|
|
43
51
|
return ()=>{
|
|
44
52
|
unsubscribe();
|
|
45
53
|
};
|
|
46
54
|
}, [
|
|
47
|
-
|
|
55
|
+
consentStore,
|
|
48
56
|
initialGdprTypes,
|
|
49
57
|
initialComplianceSettings
|
|
50
58
|
]);
|
|
51
59
|
const contextValue = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>({
|
|
52
60
|
state,
|
|
53
|
-
store,
|
|
54
|
-
|
|
61
|
+
store: consentStore,
|
|
62
|
+
manager: consentManager
|
|
55
63
|
}), [
|
|
56
64
|
state,
|
|
57
|
-
|
|
58
|
-
|
|
65
|
+
consentStore,
|
|
66
|
+
consentManager
|
|
59
67
|
]);
|
|
60
68
|
const themeContextValue = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>({
|
|
61
69
|
theme,
|
|
@@ -2,49 +2,12 @@
|
|
|
2
2
|
* @packageDocumentation
|
|
3
3
|
* Type definitions for the consent manager components.
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
5
|
+
import type { ConsentManagerOptions as CoreOptions, TranslationConfig } from 'c15t';
|
|
6
6
|
import type { ReactNode } from 'react';
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @public
|
|
8
|
+
* React-specific configuration options
|
|
11
9
|
*/
|
|
12
|
-
export interface
|
|
13
|
-
/**
|
|
14
|
-
* React children to render within the provider.
|
|
15
|
-
*/
|
|
16
|
-
children: ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* Initial GDPR consent types to activate.
|
|
19
|
-
*/
|
|
20
|
-
initialGdprTypes?: AllConsentNames[];
|
|
21
|
-
/**
|
|
22
|
-
* Initial compliance settings for different regions.
|
|
23
|
-
*/
|
|
24
|
-
initialComplianceSettings?: Record<string, Partial<ComplianceSettings>>;
|
|
25
|
-
/**
|
|
26
|
-
* Custom namespace for the store instance.
|
|
27
|
-
* @default 'c15tStore'
|
|
28
|
-
*/
|
|
29
|
-
namespace?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Whether to disable default styles.
|
|
32
|
-
* @default false
|
|
33
|
-
*/
|
|
34
|
-
noStyle?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Custom translation configuration.
|
|
37
|
-
*/
|
|
38
|
-
translationConfig?: Partial<TranslationConfig>;
|
|
39
|
-
/**
|
|
40
|
-
* Configuration for the tracking blocker.
|
|
41
|
-
*/
|
|
42
|
-
trackingBlockerConfig?: TrackingBlockerConfig;
|
|
43
|
-
/**
|
|
44
|
-
* An existing c15tClient instance to use.
|
|
45
|
-
* This is required for the provider to work properly.
|
|
46
|
-
*/
|
|
47
|
-
client: c15tClient;
|
|
10
|
+
export interface ReactUIOptions {
|
|
48
11
|
/**
|
|
49
12
|
* Visual theme to apply.
|
|
50
13
|
*/
|
|
@@ -69,31 +32,39 @@ export interface ConsentManagerProviderProps {
|
|
|
69
32
|
* @default 'system'
|
|
70
33
|
*/
|
|
71
34
|
colorScheme?: 'light' | 'dark' | 'system';
|
|
35
|
+
/**
|
|
36
|
+
* Whether to disable default styles.
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
noStyle?: boolean;
|
|
72
40
|
}
|
|
73
41
|
/**
|
|
74
|
-
*
|
|
42
|
+
* Extended configuration options for the React consent manager
|
|
75
43
|
*/
|
|
76
|
-
export
|
|
44
|
+
export type ConsentManagerOptions = CoreOptions & {
|
|
77
45
|
/**
|
|
78
|
-
*
|
|
46
|
+
* React-specific UI configuration options
|
|
79
47
|
*/
|
|
80
|
-
|
|
48
|
+
react?: ReactUIOptions;
|
|
81
49
|
/**
|
|
82
|
-
*
|
|
50
|
+
* Translation configuration
|
|
83
51
|
*/
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
* Optional content to render when consent is not granted.
|
|
87
|
-
*/
|
|
88
|
-
fallback?: ReactNode;
|
|
89
|
-
}
|
|
52
|
+
translations?: Partial<TranslationConfig>;
|
|
53
|
+
};
|
|
90
54
|
/**
|
|
91
|
-
*
|
|
55
|
+
* Configuration options for the ConsentManagerProvider.
|
|
56
|
+
*
|
|
57
|
+
* @public
|
|
92
58
|
*/
|
|
93
|
-
export interface
|
|
59
|
+
export interface ConsentManagerProviderProps {
|
|
60
|
+
/**
|
|
61
|
+
* React children to render within the provider.
|
|
62
|
+
*/
|
|
63
|
+
children: ReactNode;
|
|
94
64
|
/**
|
|
95
|
-
*
|
|
65
|
+
* Configuration options for the consent manager.
|
|
66
|
+
* This includes core, React, store, and translation settings.
|
|
96
67
|
*/
|
|
97
|
-
|
|
68
|
+
options: ConsentManagerOptions;
|
|
98
69
|
}
|
|
99
70
|
//# sourceMappingURL=consent-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-manager.d.ts","sourceRoot":"","sources":["../../src/types/consent-manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,
|
|
1
|
+
{"version":3,"file":"consent-manager.d.ts","sourceRoot":"","sources":["../../src/types/consent-manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,qBAAqB,IAAI,WAAW,EACpC,iBAAiB,EACjB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;IAE1C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG;IACjD;;OAEG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;IAEvB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC3C;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;OAGG;IACH,OAAO,EAAE,qBAAqB,CAAC;CAC/B"}
|
package/dist/utils/cn.cjs
CHANGED
|
@@ -33,7 +33,6 @@ var __webpack_require__ = {};
|
|
|
33
33
|
var __webpack_exports__ = {};
|
|
34
34
|
__webpack_require__.r(__webpack_exports__);
|
|
35
35
|
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
-
cn: ()=>cn,
|
|
37
36
|
cnExt: ()=>cnExt
|
|
38
37
|
});
|
|
39
38
|
const external_clsx_namespaceObject = require("clsx");
|
|
@@ -41,7 +40,6 @@ var external_clsx_default = /*#__PURE__*/ __webpack_require__.n(external_clsx_na
|
|
|
41
40
|
function cnExt(...classes) {
|
|
42
41
|
return external_clsx_default()(...classes);
|
|
43
42
|
}
|
|
44
|
-
const cn = external_clsx_default();
|
|
45
43
|
var __webpack_export_target__ = exports;
|
|
46
44
|
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
47
45
|
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
package/dist/utils/cn.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ClassValue } from 'clsx';
|
|
2
2
|
export type { ClassValue } from 'clsx';
|
|
3
3
|
/**
|
|
4
4
|
* Utilizes `clsx` with `tailwind-merge`, use in cases of possible class conflicts.
|
|
5
5
|
*/
|
|
6
6
|
export declare function cnExt(...classes: ClassValue[]): string;
|
|
7
|
-
/**
|
|
8
|
-
* A direct export of `clsx` without `tailwind-merge`.
|
|
9
|
-
*/
|
|
10
|
-
export declare const cn: typeof clsx;
|
|
11
7
|
//# sourceMappingURL=cn.d.ts.map
|
package/dist/utils/cn.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAE7C,YAAY,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEvC;;GAEG;AACH,wBAAgB,KAAK,CAAC,GAAG,OAAO,EAAE,UAAU,EAAE,UAE7C"}
|
package/dist/utils/cn.js
CHANGED