@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
package/dist/router/router.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { GanttChartSquare, ToggleLeft } from "lucide-react";
|
|
4
|
-
import { motion } from "motion/react";
|
|
5
|
-
import { useCallback, useState } from "react";
|
|
6
|
-
import { Badge } from "../components/ui/badge.js";
|
|
7
|
-
import { ExpandableTabs } from "../components/ui/expandable-tabs.js";
|
|
8
|
-
import { ScrollArea } from "../components/ui/scroll-area.js";
|
|
9
|
-
import { getStore } from "../dev-tool.js";
|
|
10
|
-
const tabs = [
|
|
11
|
-
{
|
|
12
|
-
title: 'Consents',
|
|
13
|
-
icon: ToggleLeft
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
title: 'Compliance',
|
|
17
|
-
icon: GanttChartSquare
|
|
18
|
-
}
|
|
19
|
-
];
|
|
20
|
-
function Router({ onClose: _onClose }) {
|
|
21
|
-
const privacyConsent = getStore();
|
|
22
|
-
const [activeSection, setActiveSection] = useState('Consents');
|
|
23
|
-
const handleTabChange = useCallback((index)=>{
|
|
24
|
-
if (null !== index) setActiveSection(tabs[index].title);
|
|
25
|
-
}, []);
|
|
26
|
-
const renderingState = [
|
|
27
|
-
{
|
|
28
|
-
componentName: 'MarketingContent',
|
|
29
|
-
consentType: 'marketing'
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
componentName: 'AnalyticsContent',
|
|
33
|
-
consentType: 'measurement'
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
componentName: 'PersonalizationComponent',
|
|
37
|
-
consentType: 'ad_personalization'
|
|
38
|
-
}
|
|
39
|
-
];
|
|
40
|
-
const contentItems = (()=>{
|
|
41
|
-
switch(activeSection){
|
|
42
|
-
case 'Consents':
|
|
43
|
-
return Object.entries(privacyConsent.consents).map(([name, value])=>({
|
|
44
|
-
title: name,
|
|
45
|
-
status: value ? 'Enabled' : 'Disabled'
|
|
46
|
-
}));
|
|
47
|
-
case 'Compliance':
|
|
48
|
-
return Object.entries(privacyConsent.complianceSettings).map(([region, settings])=>({
|
|
49
|
-
title: region,
|
|
50
|
-
status: settings.enabled ? 'Active' : 'Inactive'
|
|
51
|
-
}));
|
|
52
|
-
case 'Conditional':
|
|
53
|
-
return renderingState.map((item)=>({
|
|
54
|
-
title: item.componentName,
|
|
55
|
-
status: 'Rendered',
|
|
56
|
-
details: `Requires: ${item.consentType}`
|
|
57
|
-
}));
|
|
58
|
-
default:
|
|
59
|
-
return [];
|
|
60
|
-
}
|
|
61
|
-
})();
|
|
62
|
-
return /*#__PURE__*/ jsxs(Fragment, {
|
|
63
|
-
children: [
|
|
64
|
-
/*#__PURE__*/ jsx("div", {
|
|
65
|
-
className: "border-b p-4",
|
|
66
|
-
children: /*#__PURE__*/ jsx(ExpandableTabs, {
|
|
67
|
-
tabs: Array.from(tabs),
|
|
68
|
-
activeColor: "text-primary",
|
|
69
|
-
className: "border-muted",
|
|
70
|
-
onChange: handleTabChange
|
|
71
|
-
})
|
|
72
|
-
}),
|
|
73
|
-
/*#__PURE__*/ jsx(ScrollArea, {
|
|
74
|
-
className: "h-[300px]",
|
|
75
|
-
children: /*#__PURE__*/ jsx(motion.div, {
|
|
76
|
-
className: "space-y-2 p-4",
|
|
77
|
-
initial: {
|
|
78
|
-
opacity: 0
|
|
79
|
-
},
|
|
80
|
-
animate: {
|
|
81
|
-
opacity: 1
|
|
82
|
-
},
|
|
83
|
-
exit: {
|
|
84
|
-
opacity: 0
|
|
85
|
-
},
|
|
86
|
-
children: contentItems.map((item, index)=>/*#__PURE__*/ jsxs(motion.div, {
|
|
87
|
-
className: "flex items-center justify-between rounded-lg border bg-card p-3",
|
|
88
|
-
initial: {
|
|
89
|
-
opacity: 0,
|
|
90
|
-
y: 20
|
|
91
|
-
},
|
|
92
|
-
animate: {
|
|
93
|
-
opacity: 1,
|
|
94
|
-
y: 0
|
|
95
|
-
},
|
|
96
|
-
transition: {
|
|
97
|
-
delay: 0.05 * index
|
|
98
|
-
},
|
|
99
|
-
children: [
|
|
100
|
-
/*#__PURE__*/ jsxs("div", {
|
|
101
|
-
className: "flex flex-col",
|
|
102
|
-
children: [
|
|
103
|
-
/*#__PURE__*/ jsx("span", {
|
|
104
|
-
className: "font-medium text-sm",
|
|
105
|
-
children: item.title
|
|
106
|
-
}),
|
|
107
|
-
item.details && /*#__PURE__*/ jsx("span", {
|
|
108
|
-
className: "text-muted-foreground text-xs",
|
|
109
|
-
children: item.details
|
|
110
|
-
})
|
|
111
|
-
]
|
|
112
|
-
}),
|
|
113
|
-
/*#__PURE__*/ jsx(Badge, {
|
|
114
|
-
variant: 'Enabled' === item.status || 'Active' === item.status || 'active' === item.status || 'Rendered' === item.status ? 'default' : 'destructive',
|
|
115
|
-
children: item.status
|
|
116
|
-
})
|
|
117
|
-
]
|
|
118
|
-
}, `${activeSection}-${item.title}`))
|
|
119
|
-
})
|
|
120
|
-
})
|
|
121
|
-
]
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
export { Router };
|
package/dist/styles/theme.css
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
.c15t-devtool-wrapper-overlay {
|
|
2
|
-
--c15t-dev-tools-background: #fff;
|
|
3
|
-
--c15t-dev-tools-foreground: #171717;
|
|
4
|
-
--c15t-dev-tools-primary: #171717;
|
|
5
|
-
--c15t-dev-tools-primary-foreground: #fff;
|
|
6
|
-
--c15t-dev-tools-secondary: #f5f5f5;
|
|
7
|
-
--c15t-dev-tools-secondary-foreground: #171717;
|
|
8
|
-
--c15t-dev-tools-accent: #f5f5f5;
|
|
9
|
-
--c15t-dev-tools-accent-foreground: #171717;
|
|
10
|
-
--c15t-dev-tools-muted: #f5f5f5;
|
|
11
|
-
--c15t-dev-tools-muted-foreground: #5c5c5c;
|
|
12
|
-
--c15t-dev-tools-card: #fff;
|
|
13
|
-
--c15t-dev-tools-card-foreground: #171717;
|
|
14
|
-
--c15t-dev-tools-border: #ebebeb;
|
|
15
|
-
--c15t-dev-tools-input: #ebebeb;
|
|
16
|
-
--c15t-dev-tools-ring: #5c5c5c;
|
|
17
|
-
--c15t-dev-tools-destructive: #ef4343;
|
|
18
|
-
--c15t-dev-tools-destructive-foreground: #fff;
|
|
19
|
-
--c15t-dev-tools-overlay: #0003;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.dark .c15t-devtool-wrapper-overlay {
|
|
23
|
-
--c15t-dev-tools-background: #1a1a1a;
|
|
24
|
-
--c15t-dev-tools-foreground: #e6e6e6;
|
|
25
|
-
--c15t-dev-tools-primary: #e6e6e6;
|
|
26
|
-
--c15t-dev-tools-primary-foreground: #1a1a1a;
|
|
27
|
-
--c15t-dev-tools-secondary: #333;
|
|
28
|
-
--c15t-dev-tools-secondary-foreground: #e6e6e6;
|
|
29
|
-
--c15t-dev-tools-accent: #333;
|
|
30
|
-
--c15t-dev-tools-accent-foreground: #e6e6e6;
|
|
31
|
-
--c15t-dev-tools-muted: #333;
|
|
32
|
-
--c15t-dev-tools-muted-foreground: #999;
|
|
33
|
-
--c15t-dev-tools-card: #1a1a1a;
|
|
34
|
-
--c15t-dev-tools-card-foreground: #e6e6e6;
|
|
35
|
-
--c15t-dev-tools-border: #333;
|
|
36
|
-
--c15t-dev-tools-input: #333;
|
|
37
|
-
--c15t-dev-tools-ring: #999;
|
|
38
|
-
--c15t-dev-tools-destructive: #8d0c0c;
|
|
39
|
-
--c15t-dev-tools-destructive-foreground: #e6e6e6;
|
|
40
|
-
--c15t-dev-tools-overlay: #00000080;
|
|
41
|
-
}
|
|
42
|
-
|