@c15t/dev-tools 1.8.3 → 2.0.0-rc.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 +21 -0
- package/README.md +155 -71
- package/dist/__tests__/components/ui.test.d.ts +2 -0
- package/dist/__tests__/components/ui.test.d.ts.map +1 -0
- package/dist/__tests__/core/renderer.test.d.ts +2 -0
- package/dist/__tests__/core/renderer.test.d.ts.map +1 -0
- package/dist/__tests__/core/reset-consents.test.d.ts +2 -0
- package/dist/__tests__/core/reset-consents.test.d.ts.map +1 -0
- package/dist/__tests__/core/state-manager.test.d.ts +2 -0
- package/dist/__tests__/core/state-manager.test.d.ts.map +1 -0
- package/dist/__tests__/panels/dom-scanner.test.d.ts +2 -0
- package/dist/__tests__/panels/dom-scanner.test.d.ts.map +1 -0
- package/dist/components/dropdown-menu.d.ts +46 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/panel.d.ts +28 -0
- package/dist/components/panel.d.ts.map +1 -0
- package/dist/components/tabs.d.ts +21 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/ui.d.ts +65 -0
- package/dist/components/ui.d.ts.map +1 -0
- package/dist/core/devtools.d.ts +60 -0
- package/dist/core/devtools.d.ts.map +1 -0
- package/dist/core/draggable.d.ts +81 -0
- package/dist/core/draggable.d.ts.map +1 -0
- package/dist/core/index.d.ts +10 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/panel-renderer.d.ts +41 -0
- package/dist/core/panel-renderer.d.ts.map +1 -0
- package/dist/core/renderer.d.ts +126 -0
- package/dist/core/renderer.d.ts.map +1 -0
- package/dist/core/reset-consents.d.ts +24 -0
- package/dist/core/reset-consents.d.ts.map +1 -0
- package/dist/core/state-manager.d.ts +73 -0
- package/dist/core/state-manager.d.ts.map +1 -0
- package/dist/core/store-connector.d.ts +69 -0
- package/dist/core/store-connector.d.ts.map +1 -0
- package/dist/index.cjs +4813 -10
- package/dist/index.d.ts +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4803 -2
- package/dist/panels/actions.d.ts +18 -0
- package/dist/panels/actions.d.ts.map +1 -0
- package/dist/panels/consents.d.ts +18 -0
- package/dist/panels/consents.d.ts.map +1 -0
- package/dist/panels/dom-scanner.d.ts +29 -0
- package/dist/panels/dom-scanner.d.ts.map +1 -0
- package/dist/panels/events.d.ts +14 -0
- package/dist/panels/events.d.ts.map +1 -0
- package/dist/panels/iab.d.ts +14 -0
- package/dist/panels/iab.d.ts.map +1 -0
- package/dist/panels/index.d.ts +11 -0
- package/dist/panels/index.d.ts.map +1 -0
- package/dist/panels/location.d.ts +19 -0
- package/dist/panels/location.d.ts.map +1 -0
- package/dist/panels/scripts.d.ts +13 -0
- package/dist/panels/scripts.d.ts.map +1 -0
- package/dist/react.cjs +4696 -0
- package/dist/react.d.ts +76 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +4672 -0
- package/dist/styles/index.d.ts +7 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/tanstack.cjs +3819 -0
- package/dist/tanstack.d.ts +46 -0
- package/dist/tanstack.d.ts.map +1 -0
- package/dist/tanstack.js +3795 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/preference-trigger.d.ts +27 -0
- package/dist/utils/preference-trigger.d.ts.map +1 -0
- package/package.json +74 -57
- package/tsconfig.json +1 -1
- package/LICENSE.md +0 -595
- package/dist/components/error-state.cjs +0 -98
- package/dist/components/error-state.css +0 -51
- package/dist/components/error-state.d.ts +0 -5
- package/dist/components/error-state.d.ts.map +0 -1
- package/dist/components/error-state.js +0 -64
- package/dist/components/header.cjs +0 -65
- package/dist/components/header.css +0 -29
- package/dist/components/header.d.ts +0 -7
- package/dist/components/header.d.ts.map +0 -1
- package/dist/components/header.js +0 -31
- package/dist/components/ui/accordion.cjs +0 -82
- package/dist/components/ui/accordion.css +0 -72
- package/dist/components/ui/accordion.d.ts +0 -8
- package/dist/components/ui/accordion.d.ts.map +0 -1
- package/dist/components/ui/accordion.js +0 -39
- package/dist/components/ui/alert.cjs +0 -77
- package/dist/components/ui/alert.css +0 -59
- package/dist/components/ui/alert.d.ts +0 -10
- package/dist/components/ui/alert.d.ts.map +0 -1
- package/dist/components/ui/alert.js +0 -37
- package/dist/components/ui/badge.cjs +0 -63
- package/dist/components/ui/badge.css +0 -52
- package/dist/components/ui/badge.d.ts +0 -11
- package/dist/components/ui/badge.d.ts.map +0 -1
- package/dist/components/ui/badge.js +0 -26
- package/dist/components/ui/button.cjs +0 -77
- package/dist/components/ui/button.css +0 -87
- package/dist/components/ui/button.d.ts +0 -13
- package/dist/components/ui/button.d.ts.map +0 -1
- package/dist/components/ui/button.js +0 -40
- package/dist/components/ui/card.cjs +0 -89
- package/dist/components/ui/card.css +0 -41
- package/dist/components/ui/card.d.ts +0 -10
- package/dist/components/ui/card.d.ts.map +0 -1
- package/dist/components/ui/card.js +0 -40
- package/dist/components/ui/error-state.css +0 -34
- package/dist/components/ui/expandable-tabs.cjs +0 -136
- package/dist/components/ui/expandable-tabs.css +0 -57
- package/dist/components/ui/expandable-tabs.d.ts +0 -23
- package/dist/components/ui/expandable-tabs.d.ts.map +0 -1
- package/dist/components/ui/expandable-tabs.js +0 -102
- package/dist/components/ui/logo.cjs +0 -101
- package/dist/components/ui/logo.d.ts +0 -8
- package/dist/components/ui/logo.d.ts.map +0 -1
- package/dist/components/ui/logo.js +0 -67
- package/dist/components/ui/scroll-area.cjs +0 -67
- package/dist/components/ui/scroll-area.css +0 -41
- package/dist/components/ui/scroll-area.d.ts +0 -6
- package/dist/components/ui/scroll-area.d.ts.map +0 -1
- package/dist/components/ui/scroll-area.js +0 -30
- package/dist/components/ui/switch.cjs +0 -49
- package/dist/components/ui/switch.css +0 -49
- package/dist/components/ui/switch.d.ts +0 -5
- package/dist/components/ui/switch.d.ts.map +0 -1
- package/dist/components/ui/switch.js +0 -15
- package/dist/components/ui/tooltip.cjs +0 -61
- package/dist/components/ui/tooltip.css +0 -101
- package/dist/components/ui/tooltip.d.ts +0 -8
- package/dist/components/ui/tooltip.d.ts.map +0 -1
- package/dist/components/ui/tooltip.js +0 -18
- package/dist/components/wrapper.cjs +0 -158
- package/dist/components/wrapper.css +0 -90
- package/dist/components/wrapper.d.ts +0 -20
- package/dist/components/wrapper.d.ts.map +0 -1
- package/dist/components/wrapper.js +0 -121
- package/dist/dev-tool.cjs +0 -124
- package/dist/dev-tool.d.ts +0 -15
- package/dist/dev-tool.d.ts.map +0 -1
- package/dist/dev-tool.js +0 -74
- package/dist/libs/utils.cjs +0 -50
- package/dist/libs/utils.d.ts +0 -3
- package/dist/libs/utils.d.ts.map +0 -1
- package/dist/libs/utils.js +0 -6
- package/dist/router/router.cjs +0 -158
- package/dist/router/router.d.ts +0 -6
- package/dist/router/router.d.ts.map +0 -1
- package/dist/router/router.js +0 -124
- package/dist/styles/theme.css +0 -42
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draggable.d.ts","sourceRoot":"","sources":["../../src/core/draggable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,MAAM,cAAc,GACvB,cAAc,GACd,WAAW,GACX,aAAa,GACb,UAAU,CAAC;AAEd;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CACjB;AA6JD,MAAM,WAAW,gBAAgB;IAChC;;;OAGG;IACH,eAAe,CAAC,EAAE,cAAc,CAAC;IAEjC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;IAEtD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IAEzB;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C;AAED,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,SAAS,EAAE,MAAM,cAAc,CAAC;IAEhC;;OAEG;IACH,SAAS,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAE5C;;OAEG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC;IAE1B;;OAEG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC;IAE1B;;OAEG;IACH,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAEvC;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;IAEnB;;OAEG;IACH,mBAAmB,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAEpD;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC9B,OAAO,GAAE,gBAAqB,GAC5B,iBAAiB,CAgOnB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core exports
|
|
3
|
+
*/
|
|
4
|
+
export * from './devtools';
|
|
5
|
+
export * from './panel-renderer';
|
|
6
|
+
export * from './renderer';
|
|
7
|
+
export * from './reset-consents';
|
|
8
|
+
export * from './state-manager';
|
|
9
|
+
export * from './store-connector';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Panel Renderer
|
|
3
|
+
* Shared logic for rendering DevTools panels
|
|
4
|
+
*/
|
|
5
|
+
import type { ConsentStoreState } from 'c15t';
|
|
6
|
+
import type { DevToolsTab, StateManager } from './state-manager';
|
|
7
|
+
import type { StoreConnector } from './store-connector';
|
|
8
|
+
/**
|
|
9
|
+
* Configuration for the panel renderer
|
|
10
|
+
*/
|
|
11
|
+
export interface PanelRendererConfig {
|
|
12
|
+
storeConnector: StoreConnector;
|
|
13
|
+
stateManager: StateManager;
|
|
14
|
+
/**
|
|
15
|
+
* Enable event logging for actions
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
enableEventLogging?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Panel renderer instance with methods for rendering panels
|
|
22
|
+
*/
|
|
23
|
+
export interface PanelRenderer {
|
|
24
|
+
/**
|
|
25
|
+
* Renders the specified panel into the container
|
|
26
|
+
*/
|
|
27
|
+
renderPanel(container: HTMLElement, tab: DevToolsTab): void;
|
|
28
|
+
/**
|
|
29
|
+
* Gets the current store state
|
|
30
|
+
*/
|
|
31
|
+
getStoreState(): ConsentStoreState | null;
|
|
32
|
+
/**
|
|
33
|
+
* Resets all consents
|
|
34
|
+
*/
|
|
35
|
+
resetConsents(): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Creates a panel renderer with shared logic for rendering DevTools panels
|
|
39
|
+
*/
|
|
40
|
+
export declare function createPanelRenderer(config: PanelRendererConfig): PanelRenderer;
|
|
41
|
+
//# sourceMappingURL=panel-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-renderer.d.ts","sourceRoot":"","sources":["../../src/core/panel-renderer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAQ9C,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,cAAc,EAAE,cAAc,CAAC;IAC/B,YAAY,EAAE,YAAY,CAAC;IAC3B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B;;OAEG;IACH,WAAW,CAAC,SAAS,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CAAC;IAE5D;;OAEG;IACH,aAAa,IAAI,iBAAiB,GAAG,IAAI,CAAC;IAE1C;;OAEG;IACH,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,mBAAmB,GACzB,aAAa,CAyKf"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM Rendering Utilities
|
|
3
|
+
* Provides declarative element creation for vanilla JS components
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Attributes that can be set on an element
|
|
7
|
+
*/
|
|
8
|
+
export type ElementAttributes = {
|
|
9
|
+
className?: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
12
|
+
dataset?: Record<string, string>;
|
|
13
|
+
role?: string;
|
|
14
|
+
tabIndex?: number;
|
|
15
|
+
ariaLabel?: string;
|
|
16
|
+
ariaExpanded?: string;
|
|
17
|
+
ariaHidden?: string;
|
|
18
|
+
ariaSelected?: string;
|
|
19
|
+
ariaControls?: string;
|
|
20
|
+
ariaChecked?: string;
|
|
21
|
+
title?: string;
|
|
22
|
+
type?: string;
|
|
23
|
+
value?: string;
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
checked?: boolean;
|
|
27
|
+
name?: string;
|
|
28
|
+
htmlFor?: string;
|
|
29
|
+
} & Record<string, unknown>;
|
|
30
|
+
/**
|
|
31
|
+
* Event handlers that can be attached to an element
|
|
32
|
+
*/
|
|
33
|
+
export type ElementEvents = {
|
|
34
|
+
onClick?: EventListener;
|
|
35
|
+
onMouseEnter?: EventListener;
|
|
36
|
+
onMouseLeave?: EventListener;
|
|
37
|
+
onKeyDown?: EventListener;
|
|
38
|
+
onKeyUp?: EventListener;
|
|
39
|
+
onFocus?: EventListener;
|
|
40
|
+
onBlur?: EventListener;
|
|
41
|
+
onChange?: EventListener;
|
|
42
|
+
onInput?: EventListener;
|
|
43
|
+
onAnimationEnd?: EventListener;
|
|
44
|
+
onTransitionEnd?: EventListener;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Options for creating an element
|
|
48
|
+
*/
|
|
49
|
+
export interface CreateElementOptions extends ElementAttributes, ElementEvents {
|
|
50
|
+
/** Tag name for the element */
|
|
51
|
+
tag?: keyof HTMLElementTagNameMap;
|
|
52
|
+
/** Text content */
|
|
53
|
+
text?: string;
|
|
54
|
+
/** HTML content (use with caution) */
|
|
55
|
+
html?: string;
|
|
56
|
+
/** Child elements */
|
|
57
|
+
children?: (HTMLElement | string | null | undefined)[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Creates an HTML element with the given options
|
|
61
|
+
*/
|
|
62
|
+
export declare function createElement(options?: CreateElementOptions): HTMLElement;
|
|
63
|
+
/**
|
|
64
|
+
* Shorthand for creating a div element
|
|
65
|
+
*/
|
|
66
|
+
export declare function div(options?: Omit<CreateElementOptions, 'tag'>): HTMLDivElement;
|
|
67
|
+
/**
|
|
68
|
+
* Shorthand for creating a button element
|
|
69
|
+
*/
|
|
70
|
+
export declare function button(options?: Omit<CreateElementOptions, 'tag'>): HTMLButtonElement;
|
|
71
|
+
/**
|
|
72
|
+
* Shorthand for creating a span element
|
|
73
|
+
*/
|
|
74
|
+
export declare function span(options?: Omit<CreateElementOptions, 'tag'>): HTMLSpanElement;
|
|
75
|
+
/**
|
|
76
|
+
* Shorthand for creating a label element
|
|
77
|
+
*/
|
|
78
|
+
export declare function label(options?: Omit<CreateElementOptions, 'tag'>): HTMLLabelElement;
|
|
79
|
+
/**
|
|
80
|
+
* Shorthand for creating an input element
|
|
81
|
+
*/
|
|
82
|
+
export declare function input(options?: Omit<CreateElementOptions, 'tag'>): HTMLInputElement;
|
|
83
|
+
/**
|
|
84
|
+
* Options for creating a select element
|
|
85
|
+
*/
|
|
86
|
+
export interface SelectOption {
|
|
87
|
+
value: string;
|
|
88
|
+
label: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Shorthand for creating a select element with options
|
|
92
|
+
*/
|
|
93
|
+
export declare function select(options?: Omit<CreateElementOptions, 'tag'> & {
|
|
94
|
+
options?: SelectOption[];
|
|
95
|
+
selectedValue?: string;
|
|
96
|
+
}): HTMLSelectElement;
|
|
97
|
+
/**
|
|
98
|
+
* Creates an SVG element
|
|
99
|
+
*/
|
|
100
|
+
export declare function createSvgElement(svgContent: string, options?: {
|
|
101
|
+
className?: string;
|
|
102
|
+
ariaHidden?: boolean;
|
|
103
|
+
width?: number;
|
|
104
|
+
height?: number;
|
|
105
|
+
}): SVGSVGElement;
|
|
106
|
+
/**
|
|
107
|
+
* Removes all children from an element
|
|
108
|
+
*/
|
|
109
|
+
export declare function clearElement(element: HTMLElement): void;
|
|
110
|
+
/**
|
|
111
|
+
* Replaces all children of an element with new children
|
|
112
|
+
*/
|
|
113
|
+
export declare function replaceChildren(element: HTMLElement, children: (HTMLElement | string | null | undefined)[]): void;
|
|
114
|
+
/**
|
|
115
|
+
* Adds or removes a class based on a condition
|
|
116
|
+
*/
|
|
117
|
+
export declare function toggleClass(element: HTMLElement, className: string, condition: boolean): void;
|
|
118
|
+
/**
|
|
119
|
+
* Sets multiple classes at once
|
|
120
|
+
*/
|
|
121
|
+
export declare function setClasses(element: HTMLElement, classes: Record<string, boolean>): void;
|
|
122
|
+
/**
|
|
123
|
+
* Creates a portal - appends element to document.body
|
|
124
|
+
*/
|
|
125
|
+
export declare function createPortal(element: HTMLElement): () => void;
|
|
126
|
+
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/core/renderer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,aAAa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AW,GAAG,MAAM,IAAI,CAQ7D"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reset Consents Utility
|
|
3
|
+
* Centralized logic for resetting all consent data
|
|
4
|
+
*/
|
|
5
|
+
import type { ConsentStoreState } from 'c15t';
|
|
6
|
+
import type { StoreApi } from 'zustand/vanilla';
|
|
7
|
+
import type { StateManager } from './state-manager';
|
|
8
|
+
/**
|
|
9
|
+
* Resets all consent data including:
|
|
10
|
+
* - Store state via resetConsents()
|
|
11
|
+
* - Cookies (c15t, euconsent-v2)
|
|
12
|
+
* - localStorage entries
|
|
13
|
+
* - Re-initializes the consent manager to reset IAB state
|
|
14
|
+
*
|
|
15
|
+
* @param store - The c15t store instance
|
|
16
|
+
* @param stateManager - Optional state manager for event logging
|
|
17
|
+
*/
|
|
18
|
+
export declare function resetAllConsents(store: StoreApi<ConsentStoreState>, stateManager?: StateManager): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Creates a reset handler function bound to a store connector
|
|
21
|
+
* This is a convenience wrapper for use in panel callbacks
|
|
22
|
+
*/
|
|
23
|
+
export declare function createResetHandler(getStore: () => StoreApi<ConsentStoreState> | null, stateManager?: StateManager): () => Promise<void>;
|
|
24
|
+
//# sourceMappingURL=reset-consents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset-consents.d.ts","sourceRoot":"","sources":["../../src/core/reset-consents.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAuDpD;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CACrC,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,EAClC,YAAY,CAAC,EAAE,YAAY,GACzB,OAAO,CAAC,IAAI,CAAC,CAkBf;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CACjC,QAAQ,EAAE,MAAM,QAAQ,CAAC,iBAAiB,CAAC,GAAG,IAAI,EAClD,YAAY,CAAC,EAAE,YAAY,GACzB,MAAM,OAAO,CAAC,IAAI,CAAC,CAOrB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DevTools State Manager
|
|
3
|
+
* Manages internal state for the DevTools UI
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Position options for the DevTools panel
|
|
7
|
+
*/
|
|
8
|
+
export type DevToolsPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
9
|
+
/**
|
|
10
|
+
* Available tabs in the DevTools
|
|
11
|
+
*/
|
|
12
|
+
export type DevToolsTab = 'consents' | 'location' | 'scripts' | 'iab' | 'events' | 'actions';
|
|
13
|
+
/**
|
|
14
|
+
* Event log entry for debugging
|
|
15
|
+
*/
|
|
16
|
+
export interface EventLogEntry {
|
|
17
|
+
id: string;
|
|
18
|
+
type: 'consent_set' | 'consent_save' | 'consent_reset' | 'error' | 'info';
|
|
19
|
+
message: string;
|
|
20
|
+
timestamp: number;
|
|
21
|
+
data?: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Internal state for DevTools
|
|
25
|
+
*/
|
|
26
|
+
export interface DevToolsState {
|
|
27
|
+
/** Whether the panel is open */
|
|
28
|
+
isOpen: boolean;
|
|
29
|
+
/** Current active tab */
|
|
30
|
+
activeTab: DevToolsTab;
|
|
31
|
+
/** Position of the floating button and panel */
|
|
32
|
+
position: DevToolsPosition;
|
|
33
|
+
/** Whether the store is connected */
|
|
34
|
+
isConnected: boolean;
|
|
35
|
+
/** Event log for debugging */
|
|
36
|
+
eventLog: EventLogEntry[];
|
|
37
|
+
/** Maximum number of events to keep */
|
|
38
|
+
maxEventLogSize: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* State change listener
|
|
42
|
+
*/
|
|
43
|
+
export type StateListener = (state: DevToolsState, prevState: DevToolsState) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Creates a state manager for DevTools
|
|
46
|
+
*/
|
|
47
|
+
export declare function createStateManager(initialState?: Partial<DevToolsState>): StateManager;
|
|
48
|
+
/**
|
|
49
|
+
* State manager interface
|
|
50
|
+
*/
|
|
51
|
+
export interface StateManager {
|
|
52
|
+
/** Get current state */
|
|
53
|
+
getState: () => DevToolsState;
|
|
54
|
+
/** Subscribe to state changes */
|
|
55
|
+
subscribe: (listener: StateListener) => () => void;
|
|
56
|
+
/** Set open state */
|
|
57
|
+
setOpen: (isOpen: boolean) => void;
|
|
58
|
+
/** Toggle open state */
|
|
59
|
+
toggle: () => void;
|
|
60
|
+
/** Set active tab */
|
|
61
|
+
setActiveTab: (tab: DevToolsTab) => void;
|
|
62
|
+
/** Set position */
|
|
63
|
+
setPosition: (position: DevToolsPosition) => void;
|
|
64
|
+
/** Set connection state */
|
|
65
|
+
setConnected: (isConnected: boolean) => void;
|
|
66
|
+
/** Add an event to the log */
|
|
67
|
+
addEvent: (entry: Omit<EventLogEntry, 'id' | 'timestamp'>) => void;
|
|
68
|
+
/** Clear the event log */
|
|
69
|
+
clearEventLog: () => void;
|
|
70
|
+
/** Cleanup */
|
|
71
|
+
destroy: () => void;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=state-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-manager.d.ts","sourceRoot":"","sources":["../../src/core/state-manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoCH;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACzB,cAAc,GACd,aAAa,GACb,WAAW,GACX,UAAU,CAAC;AAEd;;GAEG;AACH,MAAM,MAAM,WAAW,GACpB,UAAU,GACV,UAAU,GACV,SAAS,GACT,KAAK,GACL,QAAQ,GACR,SAAS,CAAC;AAEb;;G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AK,IAAI,CAAC;IAClD,2BAA2B;IAC3B,YAAY,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,8BAA8B;IAC9B,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,WAAW,CAAC,KAAK,IAAI,CAAC;IACnE,0BAA0B;IAC1B,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store Connector
|
|
3
|
+
* Connects to the c15tStore exposed on the window object
|
|
4
|
+
*/
|
|
5
|
+
import type { ConsentStoreState } from 'c15t';
|
|
6
|
+
import type { StoreApi } from 'zustand/vanilla';
|
|
7
|
+
/**
|
|
8
|
+
* Options for creating a store connector
|
|
9
|
+
*/
|
|
10
|
+
export interface StoreConnectorOptions {
|
|
11
|
+
/**
|
|
12
|
+
* The namespace used to access the store on the window object
|
|
13
|
+
* @default 'c15tStore'
|
|
14
|
+
*/
|
|
15
|
+
namespace?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Callback when the store becomes available
|
|
18
|
+
*/
|
|
19
|
+
onConnect?: (state: ConsentStoreState, store: StoreApi<ConsentStoreState>) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Callback when store state changes
|
|
22
|
+
*/
|
|
23
|
+
onStateChange?: (state: ConsentStoreState) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Callback when the store connection is lost or not found
|
|
26
|
+
*/
|
|
27
|
+
onDisconnect?: () => void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Store connector instance interface
|
|
31
|
+
*/
|
|
32
|
+
export interface StoreConnector {
|
|
33
|
+
/**
|
|
34
|
+
* Get the current store state
|
|
35
|
+
* Returns null if store is not connected
|
|
36
|
+
*/
|
|
37
|
+
getState: () => ConsentStoreState | null;
|
|
38
|
+
/**
|
|
39
|
+
* Get the raw store API
|
|
40
|
+
* Returns null if store is not connected
|
|
41
|
+
*/
|
|
42
|
+
getStore: () => StoreApi<ConsentStoreState> | null;
|
|
43
|
+
/**
|
|
44
|
+
* Check if the store is connected
|
|
45
|
+
*/
|
|
46
|
+
isConnected: () => boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Subscribe to store state changes
|
|
49
|
+
* Returns unsubscribe function
|
|
50
|
+
*/
|
|
51
|
+
subscribe: (listener: (state: ConsentStoreState) => void) => () => void;
|
|
52
|
+
/**
|
|
53
|
+
* Disconnect from the store and cleanup
|
|
54
|
+
*/
|
|
55
|
+
destroy: () => void;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Creates a connector to the c15tStore
|
|
59
|
+
*/
|
|
60
|
+
export declare function createStoreConnector(options?: StoreConnectorOptions): StoreConnector;
|
|
61
|
+
/**
|
|
62
|
+
* Get the store directly from the window object (one-time access)
|
|
63
|
+
*/
|
|
64
|
+
export declare function getC15tStore(namespace?: string): StoreApi<ConsentStoreState> | null;
|
|
65
|
+
/**
|
|
66
|
+
* Check if the c15t store is available
|
|
67
|
+
*/
|
|
68
|
+
export declare function isC15tStoreAvailable(namespace?: string): boolean;
|
|
69
|
+
//# sourceMappingURL=store-connector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-connector.d.ts","sourceRoot":"","sources":["../../src/core/store-connector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,CACX,KAAK,EAAE,iBAAiB,EACxB,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,K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