@muchbetteradventures/consent-manager 5.7.1-beta.1 → 5.7.1-beta.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/package.json +1 -1
- package/types/src/__tests__/consent-manager-builder/analytics.test.d.ts +1 -0
- package/types/src/__tests__/consent-manager-builder/fetch-destinations.test.d.ts +1 -0
- package/types/src/__tests__/consent-manager-builder/preferences.test.d.ts +1 -0
- package/types/src/__tests__/index.test.d.ts +1 -0
- package/types/src/consent-manager/banner.d.ts +20 -0
- package/types/src/consent-manager/buttons.d.ts +15 -0
- package/types/src/consent-manager/categories.d.ts +3 -0
- package/types/src/consent-manager/container.d.ts +36 -0
- package/types/src/consent-manager/dialog.d.ts +29 -0
- package/types/src/consent-manager/font-styles.d.ts +2 -0
- package/types/src/consent-manager/index.d.ts +26 -0
- package/types/src/consent-manager/preference-dialog.d.ts +33 -0
- package/types/src/consent-manager-builder/analytics.d.ts +12 -0
- package/types/src/consent-manager-builder/fetch-destinations.d.ts +2 -0
- package/types/src/consent-manager-builder/index.d.ts +101 -0
- package/types/src/consent-manager-builder/preferences.d.ts +30 -0
- package/types/src/hooks.d.ts +1 -0
- package/types/src/index.d.ts +7 -0
- package/types/src/standalone.d.ts +5 -0
- package/types/src/types.d.ts +87 -0
- package/types/stories/0-consent-manager.stories.d.ts +1 -0
- package/types/stories/0.1-consent-manager-close-interaction.stories.d.ts +1 -0
- package/types/stories/1-standalone.stories.d.ts +1 -0
- package/types/stories/1.1-standalone-custom.stories.d.ts +1 -0
- package/types/stories/2-category-based.stories.d.ts +1 -0
- package/types/stories/3-tool-based.stories.d.ts +1 -0
- package/types/stories/4-custom-consent.stories.d.ts +1 -0
- package/types/stories/5-custom-categories.stories.d.ts +1 -0
- package/types/stories/6-ccpa-gdpr-example.stories.d.ts +1 -0
- package/types/stories/7-default-destination-behavior.stories.d.ts +1 -0
- package/types/stories/8-floating-banner.stories.d.ts +1 -0
- package/types/stories/ImplyConsentOnInteraction.d.ts +2 -0
- package/types/stories/components/CookieView.d.ts +3 -0
- package/types/stories/components/common-react.d.ts +5 -0
- package/types/stories/components/destination-tile.d.ts +15 -0
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import { CloseBehavior, CloseBehaviorFunction } from './container';
|
|
3
|
+
import { BannerMode } from '../types';
|
|
4
|
+
interface Props {
|
|
5
|
+
innerRef: (node: HTMLElement | null) => void;
|
|
6
|
+
onClose: (forceCloseBehaviour?: CloseBehavior | CloseBehaviorFunction) => void;
|
|
7
|
+
onChangePreferences: () => void;
|
|
8
|
+
content: React.ReactNode;
|
|
9
|
+
subContent: React.ReactNode;
|
|
10
|
+
backgroundColor: string;
|
|
11
|
+
textColor: string;
|
|
12
|
+
showRejectAll: boolean;
|
|
13
|
+
bannerMode: BannerMode;
|
|
14
|
+
}
|
|
15
|
+
export default class Banner extends PureComponent<Props> {
|
|
16
|
+
static displayName: string;
|
|
17
|
+
componentDidMount(): void;
|
|
18
|
+
render(): JSX.Element;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference types="emotion" />
|
|
3
|
+
/// <reference types="@emotion/core" />
|
|
4
|
+
export declare const DefaultButton: import("react-emotion").StyledComponent<unknown, any, import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
5
|
+
innerRef?: string | ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const TextButton: import("react-emotion").StyledComponent<unknown, any, import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
8
|
+
innerRef?: string | ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const GreenButton: import("react-emotion").StyledComponent<unknown, any, import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
11
|
+
innerRef?: string | ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const RedButton: import("react-emotion").StyledComponent<unknown, any, import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
14
|
+
innerRef?: string | ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Destination, CategoryPreferences, CustomCategories, DefaultDestinationBehavior, BannerMode } from '../types';
|
|
3
|
+
export declare function openDialog(): void;
|
|
4
|
+
export declare const enum CloseBehavior {
|
|
5
|
+
ACCEPT = "accept",
|
|
6
|
+
DENY = "deny",
|
|
7
|
+
DISMISS = "dismiss"
|
|
8
|
+
}
|
|
9
|
+
export interface CloseBehaviorFunction {
|
|
10
|
+
(categories: CategoryPreferences): CategoryPreferences;
|
|
11
|
+
}
|
|
12
|
+
interface ContainerProps {
|
|
13
|
+
setPreferences: (prefs: CategoryPreferences) => void;
|
|
14
|
+
saveConsent: (newPreferences?: CategoryPreferences, shouldReload?: boolean) => void;
|
|
15
|
+
resetPreferences: () => void;
|
|
16
|
+
closeBehavior?: CloseBehavior | CloseBehaviorFunction;
|
|
17
|
+
destinations: Destination[];
|
|
18
|
+
customCategories?: CustomCategories | undefined;
|
|
19
|
+
newDestinations: Destination[];
|
|
20
|
+
preferences: CategoryPreferences;
|
|
21
|
+
havePreferencesChanged: boolean;
|
|
22
|
+
isConsentRequired: boolean;
|
|
23
|
+
implyConsentOnInteraction: boolean;
|
|
24
|
+
bannerContent: React.ReactNode;
|
|
25
|
+
bannerSubContent: React.ReactNode;
|
|
26
|
+
bannerTextColor: string;
|
|
27
|
+
bannerBackgroundColor: string;
|
|
28
|
+
preferencesDialogTitle: React.ReactNode;
|
|
29
|
+
preferencesDialogContent: React.ReactNode;
|
|
30
|
+
workspaceAddedNewDestinations?: boolean;
|
|
31
|
+
defaultDestinationBehavior?: DefaultDestinationBehavior;
|
|
32
|
+
showRejectAll: boolean;
|
|
33
|
+
bannerMode: BannerMode;
|
|
34
|
+
}
|
|
35
|
+
declare const Container: React.FC<ContainerProps>;
|
|
36
|
+
export default Container;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
interface DialogProps {
|
|
3
|
+
innerRef: (element: HTMLElement | null) => void;
|
|
4
|
+
onCancel?: () => void;
|
|
5
|
+
onSubmit: (e: React.FormEvent<HTMLFormElement>) => void;
|
|
6
|
+
title: React.ReactNode;
|
|
7
|
+
buttons: React.ReactNode;
|
|
8
|
+
width?: string;
|
|
9
|
+
}
|
|
10
|
+
export default class Dialog extends PureComponent<DialogProps, {}> {
|
|
11
|
+
static displayName: string;
|
|
12
|
+
private titleId;
|
|
13
|
+
private container;
|
|
14
|
+
private root;
|
|
15
|
+
private form;
|
|
16
|
+
static defaultProps: {
|
|
17
|
+
onCancel: undefined;
|
|
18
|
+
width: string;
|
|
19
|
+
};
|
|
20
|
+
constructor(props: DialogProps);
|
|
21
|
+
render(): React.ReactPortal;
|
|
22
|
+
componentDidMount(): void;
|
|
23
|
+
componentWillUnmount(): void;
|
|
24
|
+
handleRootRef: (node: HTMLElement) => void;
|
|
25
|
+
handleFormRef: (node: HTMLFormElement) => void;
|
|
26
|
+
handleOverlayClick: (e: any) => void;
|
|
27
|
+
handleEsc: (e: KeyboardEvent) => void;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PureComponent } from 'react';
|
|
2
|
+
import { CategoryPreferences, Destination, ConsentManagerProps } from '../types';
|
|
3
|
+
export default class ConsentManager extends PureComponent<ConsentManagerProps, {}> {
|
|
4
|
+
static displayName: string;
|
|
5
|
+
static defaultProps: {
|
|
6
|
+
otherWriteKeys: never[];
|
|
7
|
+
shouldRequireConsent: () => boolean;
|
|
8
|
+
implyConsentOnInteraction: boolean;
|
|
9
|
+
onError: undefined;
|
|
10
|
+
cookieDomain: undefined;
|
|
11
|
+
customCategories: undefined;
|
|
12
|
+
bannerTextColor: string;
|
|
13
|
+
bannerSubContent: string;
|
|
14
|
+
bannerBackgroundColor: string;
|
|
15
|
+
preferencesDialogTitle: string;
|
|
16
|
+
defaultDestinationBehavior: string;
|
|
17
|
+
showRejectAll: boolean;
|
|
18
|
+
bannerMode: "blocking";
|
|
19
|
+
};
|
|
20
|
+
render(): JSX.Element;
|
|
21
|
+
getInitialPreferences: () => {};
|
|
22
|
+
handleMapCustomPreferences: (destinations: Destination[], preferences: CategoryPreferences) => {
|
|
23
|
+
destinationPreferences: {};
|
|
24
|
+
customPreferences: {};
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import { Destination, CustomCategories, CategoryPreferences } from '../types';
|
|
3
|
+
import { CloseBehavior, CloseBehaviorFunction } from './container';
|
|
4
|
+
interface PreferenceDialogProps {
|
|
5
|
+
innerRef: (element: HTMLElement | null) => void;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
onSave: () => void;
|
|
8
|
+
onChange: (name: string, value: boolean) => void;
|
|
9
|
+
onClose: (forceCloseBehaviour?: CloseBehavior | CloseBehaviorFunction) => void;
|
|
10
|
+
marketingDestinations: Destination[];
|
|
11
|
+
advertisingDestinations: Destination[];
|
|
12
|
+
functionalDestinations: Destination[];
|
|
13
|
+
marketingAndAnalytics?: boolean | null;
|
|
14
|
+
advertising?: boolean | null;
|
|
15
|
+
functional?: boolean | null;
|
|
16
|
+
customCategories?: CustomCategories;
|
|
17
|
+
destinations: Destination[];
|
|
18
|
+
preferences: CategoryPreferences;
|
|
19
|
+
title: React.ReactNode;
|
|
20
|
+
content: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export default class PreferenceDialog extends PureComponent<PreferenceDialogProps, {}> {
|
|
23
|
+
static displayName: string;
|
|
24
|
+
static defaultProps: {
|
|
25
|
+
marketingAndAnalytics: null;
|
|
26
|
+
advertising: null;
|
|
27
|
+
functional: null;
|
|
28
|
+
};
|
|
29
|
+
render(): JSX.Element;
|
|
30
|
+
handleChange: (e: any) => void;
|
|
31
|
+
handleSubmit: (e: React.FormEvent<HTMLFormElement>) => void;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CategoryPreferences, DefaultDestinationBehavior, Destination } from '../types';
|
|
2
|
+
interface AnalyticsParams {
|
|
3
|
+
writeKey: string;
|
|
4
|
+
destinations: Destination[];
|
|
5
|
+
destinationPreferences: CategoryPreferences | null | undefined;
|
|
6
|
+
isConsentRequired: boolean;
|
|
7
|
+
shouldReload?: boolean;
|
|
8
|
+
defaultDestinationBehavior?: DefaultDestinationBehavior;
|
|
9
|
+
categoryPreferences: CategoryPreferences | null | undefined;
|
|
10
|
+
}
|
|
11
|
+
export default function conditionallyLoadAnalytics({ writeKey, destinations, destinationPreferences, isConsentRequired, shouldReload, defaultDestinationBehavior, categoryPreferences }: AnalyticsParams): void;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/// <reference types="emotion" />
|
|
2
|
+
/// <reference types="@emotion/core" />
|
|
3
|
+
import { Component } from 'react';
|
|
4
|
+
import { Destination, CategoryPreferences, CustomCategories, DefaultDestinationBehavior } from '../types';
|
|
5
|
+
interface Props {
|
|
6
|
+
/** Your Segment Write key for your website */
|
|
7
|
+
writeKey: string;
|
|
8
|
+
/** A list of other write keys you may want to provide */
|
|
9
|
+
otherWriteKeys?: string[];
|
|
10
|
+
cookieDomain?: string;
|
|
11
|
+
/**
|
|
12
|
+
* An initial selection of Preferences
|
|
13
|
+
*/
|
|
14
|
+
initialPreferences?: CategoryPreferences;
|
|
15
|
+
/**
|
|
16
|
+
* Provide a function to define whether or not consent should be required
|
|
17
|
+
*/
|
|
18
|
+
shouldRequireConsent?: () => Promise<boolean> | boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Render props for the Consent Manager builder
|
|
21
|
+
*/
|
|
22
|
+
children: (props: RenderProps) => React.ReactElement;
|
|
23
|
+
/**
|
|
24
|
+
* Allows for customizing how to show different categories of consent.
|
|
25
|
+
*/
|
|
26
|
+
mapCustomPreferences?: (destinations: Destination[], preferences: CategoryPreferences) => {
|
|
27
|
+
destinationPreferences: CategoryPreferences;
|
|
28
|
+
customPreferences: CategoryPreferences;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Allows for adding custom consent categories by mapping a custom category to Segment integrations
|
|
32
|
+
*/
|
|
33
|
+
customCategories?: CustomCategories;
|
|
34
|
+
/**
|
|
35
|
+
* Specified default behavior for when new destinations are detected on the source(s) of this consent manager.
|
|
36
|
+
*/
|
|
37
|
+
defaultDestinationBehavior?: DefaultDestinationBehavior;
|
|
38
|
+
/**
|
|
39
|
+
* A callback for dealing with errors in the Consent Manager
|
|
40
|
+
*/
|
|
41
|
+
onError?: (err: Error) => void | Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* CDN to fetch list of integrations from
|
|
44
|
+
*/
|
|
45
|
+
cdnHost?: string;
|
|
46
|
+
}
|
|
47
|
+
interface RenderProps {
|
|
48
|
+
destinations: Destination[];
|
|
49
|
+
newDestinations: Destination[];
|
|
50
|
+
preferences: CategoryPreferences;
|
|
51
|
+
destinationPreferences: CategoryPreferences;
|
|
52
|
+
isConsentRequired: boolean;
|
|
53
|
+
customCategories?: CustomCategories;
|
|
54
|
+
havePreferencesChanged: boolean;
|
|
55
|
+
workspaceAddedNewDestinations: boolean;
|
|
56
|
+
setPreferences: (newPreferences: CategoryPreferences) => void;
|
|
57
|
+
resetPreferences: () => void;
|
|
58
|
+
saveConsent: (newPreferences?: CategoryPreferences | boolean, shouldReload?: boolean) => void;
|
|
59
|
+
}
|
|
60
|
+
interface State {
|
|
61
|
+
isLoading: boolean;
|
|
62
|
+
destinations: Destination[];
|
|
63
|
+
newDestinations: Destination[];
|
|
64
|
+
preferences?: CategoryPreferences;
|
|
65
|
+
destinationPreferences?: CategoryPreferences;
|
|
66
|
+
isConsentRequired: boolean;
|
|
67
|
+
havePreferencesChanged: boolean;
|
|
68
|
+
workspaceAddedNewDestinations: boolean;
|
|
69
|
+
}
|
|
70
|
+
export default class ConsentManagerBuilder extends Component<Props, State> {
|
|
71
|
+
static displayName: string;
|
|
72
|
+
static defaultProps: {
|
|
73
|
+
otherWriteKeys: never[];
|
|
74
|
+
onError: undefined;
|
|
75
|
+
shouldRequireConsent: () => boolean;
|
|
76
|
+
initialPreferences: {};
|
|
77
|
+
cdnHost: string;
|
|
78
|
+
};
|
|
79
|
+
state: {
|
|
80
|
+
isLoading: boolean;
|
|
81
|
+
destinations: never[];
|
|
82
|
+
newDestinations: never[];
|
|
83
|
+
preferences: {};
|
|
84
|
+
destinationPreferences: {};
|
|
85
|
+
isConsentRequired: boolean;
|
|
86
|
+
havePreferencesChanged: boolean;
|
|
87
|
+
workspaceAddedNewDestinations: boolean;
|
|
88
|
+
};
|
|
89
|
+
render(): import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, string | any | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)> | null;
|
|
90
|
+
componentDidMount(): Promise<void>;
|
|
91
|
+
initialise: () => Promise<void>;
|
|
92
|
+
handleSetPreferences: (newPreferences: CategoryPreferences) => void;
|
|
93
|
+
handleResetPreferences: () => void;
|
|
94
|
+
handleSaveConsent: (newPreferences: CategoryPreferences | undefined, shouldReload: boolean) => void;
|
|
95
|
+
mergePreferences: (args: {
|
|
96
|
+
destinations: Destination[];
|
|
97
|
+
existingPreferences?: CategoryPreferences | undefined;
|
|
98
|
+
newPreferences?: CategoryPreferences | undefined;
|
|
99
|
+
}) => CategoryPreferences;
|
|
100
|
+
}
|
|
101
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Preferences } from '../types';
|
|
3
|
+
import { EventEmitter } from 'events';
|
|
4
|
+
export interface PreferencesManager {
|
|
5
|
+
loadPreferences(): Preferences;
|
|
6
|
+
onPreferencesSaved(listener: (prefs: Preferences) => void): void;
|
|
7
|
+
onWillShowBanner(listener: (prefs: Preferences) => void): void;
|
|
8
|
+
savePreferences(prefs: SavePreferences): void;
|
|
9
|
+
}
|
|
10
|
+
export declare function loadPreferences(): Preferences;
|
|
11
|
+
declare type SavePreferences = Preferences & {
|
|
12
|
+
cookieDomain?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const emitter: EventEmitter;
|
|
15
|
+
/**
|
|
16
|
+
* Subscribes to consent preferences changing over time and returns
|
|
17
|
+
* a cleanup function that can be invoked to remove the instantiated listener.
|
|
18
|
+
*
|
|
19
|
+
* @param listener a function to be invoked when ConsentPreferences are saved
|
|
20
|
+
*/
|
|
21
|
+
export declare function onPreferencesSaved(listener: (prefs: Preferences) => void): () => EventEmitter;
|
|
22
|
+
/**
|
|
23
|
+
* Subscribes to consent preferences changing over time and returns
|
|
24
|
+
* a cleanup function that can be invoked to remove the instantiated listener.
|
|
25
|
+
*
|
|
26
|
+
* @param listener a function to be invoked when ConsentPreferences are saved
|
|
27
|
+
*/
|
|
28
|
+
export declare function onWillShowBanner(listener: (prefs: Preferences) => void): () => EventEmitter;
|
|
29
|
+
export declare function savePreferences({ destinationPreferences, customPreferences, cookieDomain }: SavePreferences): void;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const applyIntegrationHooks: (integrations: any) => any;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import CMB from './consent-manager-builder';
|
|
2
|
+
import CM from './consent-manager';
|
|
3
|
+
export { openDialog as openConsentManager } from './consent-manager/container';
|
|
4
|
+
export { loadPreferences, savePreferences, onPreferencesSaved } from './consent-manager-builder/preferences';
|
|
5
|
+
export declare const ConsentManagerBuilder: typeof CMB;
|
|
6
|
+
export declare const ConsentManager: typeof CM;
|
|
7
|
+
export declare function doNotTrack(): boolean | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import inEU from '@segment/in-eu';
|
|
2
|
+
import { openConsentManager, doNotTrack } from '.';
|
|
3
|
+
import * as preferences from './consent-manager-builder/preferences';
|
|
4
|
+
export declare const version: string | undefined;
|
|
5
|
+
export { openConsentManager, doNotTrack, inEU, preferences };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference types="segment-analytics" />
|
|
3
|
+
import { CloseBehavior, CloseBehaviorFunction } from './consent-manager/container';
|
|
4
|
+
import { PreferencesManager } from './consent-manager-builder/preferences';
|
|
5
|
+
declare type AJS = SegmentAnalytics.AnalyticsJS & {
|
|
6
|
+
initialized: boolean;
|
|
7
|
+
track: (event: string, properties: {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}) => void;
|
|
10
|
+
addSourceMiddleware: (middleware: Middleware) => void;
|
|
11
|
+
};
|
|
12
|
+
export declare type Middleware = (input: MiddlewareInput) => void;
|
|
13
|
+
interface MiddlewareInput {
|
|
14
|
+
payload: {
|
|
15
|
+
obj: Record<string, any>;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
integrations?: Record<string, boolean>;
|
|
19
|
+
next: (payload: MiddlewareInput['payload']) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare type WindowWithAJS = Window & typeof globalThis & {
|
|
22
|
+
analytics?: AJS;
|
|
23
|
+
};
|
|
24
|
+
export declare type WindowWithConsentManagerConfig = Window & typeof globalThis & {
|
|
25
|
+
consentManagerConfig?: (args: StandaloneConsentManagerParams) => ConsentManagerInput | ConsentManagerInput;
|
|
26
|
+
};
|
|
27
|
+
export declare type ConsentManagerInput = ConsentManagerProps & {
|
|
28
|
+
container: string;
|
|
29
|
+
};
|
|
30
|
+
export declare type DefaultDestinationBehavior = 'enable' | 'disable' | 'imply' | 'ask';
|
|
31
|
+
export declare type BannerMode = 'blocking' | 'floating';
|
|
32
|
+
interface StandaloneConsentManagerParams {
|
|
33
|
+
React: unknown;
|
|
34
|
+
version?: string;
|
|
35
|
+
openConsentManager: () => void;
|
|
36
|
+
doNotTrack: () => boolean | null;
|
|
37
|
+
inEU: () => boolean;
|
|
38
|
+
preferences: PreferencesManager;
|
|
39
|
+
inRegions: (regions: string[]) => () => boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface Preferences {
|
|
42
|
+
destinationPreferences?: CategoryPreferences;
|
|
43
|
+
customPreferences?: CategoryPreferences;
|
|
44
|
+
}
|
|
45
|
+
export interface Destination {
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
creationName: string;
|
|
49
|
+
description: string;
|
|
50
|
+
website: string;
|
|
51
|
+
category: string;
|
|
52
|
+
}
|
|
53
|
+
export interface CategoryPreferences {
|
|
54
|
+
functional?: boolean | null | undefined;
|
|
55
|
+
marketingAndAnalytics?: boolean | null | undefined;
|
|
56
|
+
advertising?: boolean | null | undefined;
|
|
57
|
+
[category: string]: boolean | null | undefined;
|
|
58
|
+
}
|
|
59
|
+
export interface CustomCategories {
|
|
60
|
+
[key: string]: CustomCategory;
|
|
61
|
+
}
|
|
62
|
+
interface CustomCategory {
|
|
63
|
+
integrations: string[];
|
|
64
|
+
purpose: string;
|
|
65
|
+
}
|
|
66
|
+
export interface ConsentManagerProps {
|
|
67
|
+
writeKey: string;
|
|
68
|
+
otherWriteKeys?: string[];
|
|
69
|
+
shouldRequireConsent?: () => Promise<boolean> | boolean;
|
|
70
|
+
implyConsentOnInteraction?: boolean;
|
|
71
|
+
cookieDomain?: string;
|
|
72
|
+
bannerContent: React.ReactNode;
|
|
73
|
+
bannerSubContent?: string;
|
|
74
|
+
bannerTextColor?: string;
|
|
75
|
+
bannerBackgroundColor?: string;
|
|
76
|
+
preferencesDialogTitle?: React.ReactNode;
|
|
77
|
+
preferencesDialogContent: React.ReactNode;
|
|
78
|
+
onError?: (error: Error | undefined) => void;
|
|
79
|
+
closeBehavior?: CloseBehavior | CloseBehaviorFunction;
|
|
80
|
+
initialPreferences?: CategoryPreferences;
|
|
81
|
+
customCategories?: CustomCategories;
|
|
82
|
+
defaultDestinationBehavior?: DefaultDestinationBehavior;
|
|
83
|
+
cdnHost?: string;
|
|
84
|
+
showRejectAll: boolean;
|
|
85
|
+
bannerMode?: BannerMode;
|
|
86
|
+
}
|
|
87
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const bannerContent: JSX.Element;
|
|
3
|
+
export declare const bannerSubContent = "You can manage your preferences here!";
|
|
4
|
+
export declare const preferencesDialogTitle = "Website Data Collection Preferences";
|
|
5
|
+
export declare const preferencesDialogContent: JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
declare function Destination({ destination, preferences, setPreferences }: {
|
|
4
|
+
destination: any;
|
|
5
|
+
preferences: any;
|
|
6
|
+
setPreferences: any;
|
|
7
|
+
}): JSX.Element;
|
|
8
|
+
declare namespace Destination {
|
|
9
|
+
var propTypes: {
|
|
10
|
+
destination: PropTypes.Validator<object>;
|
|
11
|
+
preferences: PropTypes.Validator<object>;
|
|
12
|
+
setPreferences: PropTypes.Validator<(...args: any[]) => any>;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export default Destination;
|