@c15t/dev-tools 0.0.1-rc.3
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/.turbo/turbo-build.log +56 -0
- package/.turbo/turbo-fmt.log +6 -0
- package/.turbo/turbo-lint.log +73 -0
- package/CHANGELOG.md +23 -0
- package/LICENSE.md +595 -0
- package/README.md +47 -0
- package/dist/components/error-state.cjs +126 -0
- package/dist/components/error-state.d.ts +6 -0
- package/dist/components/error-state.d.ts.map +1 -0
- package/dist/components/error-state.js +110 -0
- package/dist/components/header.cjs +88 -0
- package/dist/components/header.d.ts +8 -0
- package/dist/components/header.d.ts.map +1 -0
- package/dist/components/header.js +56 -0
- package/dist/components/ui/accordion.cjs +119 -0
- package/dist/components/ui/accordion.d.ts +34 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +84 -0
- package/dist/components/ui/alert.cjs +104 -0
- package/dist/components/ui/alert.d.ts +25 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +67 -0
- package/dist/components/ui/button.cjs +95 -0
- package/dist/components/ui/button.d.ts +28 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +55 -0
- package/dist/components/ui/card.cjs +120 -0
- package/dist/components/ui/card.d.ts +30 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +99 -0
- package/dist/components/ui/expandable-tabs.cjs +201 -0
- package/dist/components/ui/expandable-tabs.d.ts +29 -0
- package/dist/components/ui/expandable-tabs.d.ts.map +1 -0
- package/dist/components/ui/expandable-tabs.js +170 -0
- package/dist/components/ui/overlay.cjs +69 -0
- package/dist/components/ui/overlay.d.ts +7 -0
- package/dist/components/ui/overlay.d.ts.map +1 -0
- package/dist/components/ui/overlay.js +28 -0
- package/dist/components/ui/scroll-area.cjs +105 -0
- package/dist/components/ui/scroll-area.d.ts +19 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +74 -0
- package/dist/components/ui/switch.cjs +71 -0
- package/dist/components/ui/switch.d.ts +11 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +33 -0
- package/dist/components/ui/tooltip.cjs +75 -0
- package/dist/components/ui/tooltip.d.ts +16 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +38 -0
- package/dist/components/wrapper.cjs +197 -0
- package/dist/components/wrapper.d.ts +24 -0
- package/dist/components/wrapper.d.ts.map +1 -0
- package/dist/components/wrapper.js +165 -0
- package/dist/dev-tool.cjs +164 -0
- package/dist/dev-tool.d.ts +14 -0
- package/dist/dev-tool.d.ts.map +1 -0
- package/dist/dev-tool.js +110 -0
- package/dist/index.cjs +46 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/libs/utils.cjs +69 -0
- package/dist/libs/utils.d.ts +3 -0
- package/dist/libs/utils.d.ts.map +1 -0
- package/dist/libs/utils.js +8 -0
- package/dist/router/router.cjs +278 -0
- package/dist/router/router.d.ts +8 -0
- package/dist/router/router.d.ts.map +1 -0
- package/dist/router/router.js +261 -0
- package/package.json +48 -0
- package/rslib.config.ts +28 -0
- package/src/components/error-state.tsx +44 -0
- package/src/components/header.tsx +28 -0
- package/src/components/ui/accordion.tsx +64 -0
- package/src/components/ui/alert.tsx +59 -0
- package/src/components/ui/button.tsx +56 -0
- package/src/components/ui/card.tsx +81 -0
- package/src/components/ui/expandable-tabs.tsx +174 -0
- package/src/components/ui/overlay.tsx +21 -0
- package/src/components/ui/scroll-area.tsx +52 -0
- package/src/components/ui/switch.tsx +28 -0
- package/src/components/ui/tooltip.tsx +32 -0
- package/src/components/wrapper.tsx +103 -0
- package/src/dev-tool.tsx +117 -0
- package/src/index.ts +3 -0
- package/src/libs/utils.ts +6 -0
- package/src/router/router.tsx +164 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(() => {
|
|
5
|
+
__webpack_require__.d = function (exports1, definition) {
|
|
6
|
+
for (var key in definition)
|
|
7
|
+
if (
|
|
8
|
+
__webpack_require__.o(definition, key) &&
|
|
9
|
+
!__webpack_require__.o(exports1, key)
|
|
10
|
+
)
|
|
11
|
+
Object.defineProperty(exports1, key, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: definition[key],
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
(() => {
|
|
18
|
+
__webpack_require__.o = function (obj, prop) {
|
|
19
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
20
|
+
};
|
|
21
|
+
})();
|
|
22
|
+
(() => {
|
|
23
|
+
__webpack_require__.r = function (exports1) {
|
|
24
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag)
|
|
25
|
+
Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module',
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true,
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
Router: () => Router,
|
|
37
|
+
});
|
|
38
|
+
const jsx_runtime_namespaceObject = require('react/jsx-runtime');
|
|
39
|
+
const external_lucide_react_namespaceObject = require('lucide-react');
|
|
40
|
+
const react_namespaceObject = require('motion/react');
|
|
41
|
+
const external_react_namespaceObject = require('react');
|
|
42
|
+
const button_cjs_namespaceObject = require('../components/ui/button.cjs');
|
|
43
|
+
const expandable_tabs_cjs_namespaceObject = require('../components/ui/expandable-tabs.cjs');
|
|
44
|
+
const scroll_area_cjs_namespaceObject = require('../components/ui/scroll-area.cjs');
|
|
45
|
+
const external_dev_tool_cjs_namespaceObject = require('../dev-tool.cjs');
|
|
46
|
+
const utils_cjs_namespaceObject = require('../libs/utils.cjs');
|
|
47
|
+
const tabs = [
|
|
48
|
+
{
|
|
49
|
+
title: 'Consents',
|
|
50
|
+
icon: external_lucide_react_namespaceObject.ToggleLeft,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
title: 'Compliance',
|
|
54
|
+
icon: external_lucide_react_namespaceObject.GanttChartSquare,
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
function Router({ onClose }) {
|
|
58
|
+
const privacyConsent = (0, external_dev_tool_cjs_namespaceObject.getStore)();
|
|
59
|
+
const { clearAllData, setIsPrivacyDialogOpen, setShowPopup } = privacyConsent;
|
|
60
|
+
const [activeSection, setActiveSection] = (0,
|
|
61
|
+
external_react_namespaceObject.useState)('Consents');
|
|
62
|
+
const handleTabChange = (0, external_react_namespaceObject.useCallback)(
|
|
63
|
+
(index) => {
|
|
64
|
+
if (null !== index) setActiveSection(tabs[index].title);
|
|
65
|
+
},
|
|
66
|
+
[]
|
|
67
|
+
);
|
|
68
|
+
const renderingState = [
|
|
69
|
+
{
|
|
70
|
+
componentName: 'MarketingContent',
|
|
71
|
+
consentType: 'marketing',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
componentName: 'AnalyticsContent',
|
|
75
|
+
consentType: 'measurement',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
componentName: 'PersonalizationComponent',
|
|
79
|
+
consentType: 'ad_personalization',
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
const contentItems =
|
|
83
|
+
'Consents' === activeSection
|
|
84
|
+
? Object.entries(privacyConsent.consents).map(([name, value]) => ({
|
|
85
|
+
title: name,
|
|
86
|
+
status: value ? 'Enabled' : 'Disabled',
|
|
87
|
+
}))
|
|
88
|
+
: 'Compliance' === activeSection
|
|
89
|
+
? Object.entries(privacyConsent.complianceSettings).map(
|
|
90
|
+
([region, settings]) => ({
|
|
91
|
+
title: region,
|
|
92
|
+
status: settings.enabled ? 'Active' : 'Inactive',
|
|
93
|
+
})
|
|
94
|
+
)
|
|
95
|
+
: 'Conditional' === activeSection
|
|
96
|
+
? renderingState.map((item) => ({
|
|
97
|
+
title: item.componentName,
|
|
98
|
+
status: 'Rendered',
|
|
99
|
+
details: `Requires: ${item.consentType}`,
|
|
100
|
+
}))
|
|
101
|
+
: [];
|
|
102
|
+
const handleResetConsent = (0,
|
|
103
|
+
external_react_namespaceObject.useCallback)(() => {
|
|
104
|
+
clearAllData();
|
|
105
|
+
onClose();
|
|
106
|
+
}, [clearAllData, onClose]);
|
|
107
|
+
const handleOpenPrivacyModal = (0,
|
|
108
|
+
external_react_namespaceObject.useCallback)(() => {
|
|
109
|
+
setIsPrivacyDialogOpen(true);
|
|
110
|
+
}, [setIsPrivacyDialogOpen]);
|
|
111
|
+
const handleOpenCookiePopup = (0,
|
|
112
|
+
external_react_namespaceObject.useCallback)(() => {
|
|
113
|
+
setShowPopup(true);
|
|
114
|
+
}, [setShowPopup]);
|
|
115
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
116
|
+
jsx_runtime_namespaceObject.Fragment,
|
|
117
|
+
{
|
|
118
|
+
children: [
|
|
119
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)('div', {
|
|
120
|
+
className: 'border-b p-4',
|
|
121
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
122
|
+
expandable_tabs_cjs_namespaceObject.ExpandableTabs,
|
|
123
|
+
{
|
|
124
|
+
tabs: Array.from(tabs),
|
|
125
|
+
activeColor: 'text-primary',
|
|
126
|
+
className: 'border-muted',
|
|
127
|
+
onChange: handleTabChange,
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
}),
|
|
131
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
132
|
+
scroll_area_cjs_namespaceObject.ScrollArea,
|
|
133
|
+
{
|
|
134
|
+
className: 'h-[300px]',
|
|
135
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
136
|
+
react_namespaceObject.motion.div,
|
|
137
|
+
{
|
|
138
|
+
className: 'space-y-2 p-4',
|
|
139
|
+
initial: {
|
|
140
|
+
opacity: 0,
|
|
141
|
+
},
|
|
142
|
+
animate: {
|
|
143
|
+
opacity: 1,
|
|
144
|
+
},
|
|
145
|
+
exit: {
|
|
146
|
+
opacity: 0,
|
|
147
|
+
},
|
|
148
|
+
children: contentItems.map((item, index) =>
|
|
149
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
150
|
+
react_namespaceObject.motion.div,
|
|
151
|
+
{
|
|
152
|
+
className:
|
|
153
|
+
'flex items-center justify-between rounded-lg border bg-card p-3',
|
|
154
|
+
initial: {
|
|
155
|
+
opacity: 0,
|
|
156
|
+
y: 20,
|
|
157
|
+
},
|
|
158
|
+
animate: {
|
|
159
|
+
opacity: 1,
|
|
160
|
+
y: 0,
|
|
161
|
+
},
|
|
162
|
+
transition: {
|
|
163
|
+
delay: 0.05 * index,
|
|
164
|
+
},
|
|
165
|
+
children: [
|
|
166
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
167
|
+
'div',
|
|
168
|
+
{
|
|
169
|
+
className: 'flex flex-col',
|
|
170
|
+
children: [
|
|
171
|
+
/*#__PURE__*/ (0,
|
|
172
|
+
jsx_runtime_namespaceObject.jsx)('span', {
|
|
173
|
+
className: 'font-medium text-sm',
|
|
174
|
+
children: item.title,
|
|
175
|
+
}),
|
|
176
|
+
item.details &&
|
|
177
|
+
/*#__PURE__*/ (0,
|
|
178
|
+
jsx_runtime_namespaceObject.jsx)('span', {
|
|
179
|
+
className: 'text-muted-foreground text-xs',
|
|
180
|
+
children: item.details,
|
|
181
|
+
}),
|
|
182
|
+
],
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
186
|
+
'span',
|
|
187
|
+
{
|
|
188
|
+
className: (0, utils_cjs_namespaceObject.cn)(
|
|
189
|
+
'rounded-full px-2 py-1 text-xs',
|
|
190
|
+
'Enabled' === item.status ||
|
|
191
|
+
'Active' === item.status ||
|
|
192
|
+
'active' === item.status ||
|
|
193
|
+
'Rendered' === item.status
|
|
194
|
+
? 'bg-green-100 text-green-800'
|
|
195
|
+
: 'bg-red-100 text-red-800'
|
|
196
|
+
),
|
|
197
|
+
children: item.status,
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
|
+
`${activeSection}-${item.title}`
|
|
203
|
+
)
|
|
204
|
+
),
|
|
205
|
+
}
|
|
206
|
+
),
|
|
207
|
+
}
|
|
208
|
+
),
|
|
209
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)('div', {
|
|
210
|
+
className: 'border-t p-4',
|
|
211
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)('div', {
|
|
212
|
+
className: 'flex flex-col gap-2',
|
|
213
|
+
children: [
|
|
214
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
215
|
+
button_cjs_namespaceObject.Button,
|
|
216
|
+
{
|
|
217
|
+
variant: 'outline',
|
|
218
|
+
size: 'sm',
|
|
219
|
+
onClick: handleResetConsent,
|
|
220
|
+
children: [
|
|
221
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
222
|
+
external_lucide_react_namespaceObject.RefreshCw,
|
|
223
|
+
{
|
|
224
|
+
className: 'mr-2 h-4 w-4',
|
|
225
|
+
}
|
|
226
|
+
),
|
|
227
|
+
'Reset Local Storage Consent',
|
|
228
|
+
],
|
|
229
|
+
}
|
|
230
|
+
),
|
|
231
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
232
|
+
button_cjs_namespaceObject.Button,
|
|
233
|
+
{
|
|
234
|
+
variant: 'outline',
|
|
235
|
+
size: 'sm',
|
|
236
|
+
onClick: handleOpenPrivacyModal,
|
|
237
|
+
children: [
|
|
238
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
239
|
+
external_lucide_react_namespaceObject.FileText,
|
|
240
|
+
{
|
|
241
|
+
className: 'mr-2 h-4 w-4',
|
|
242
|
+
}
|
|
243
|
+
),
|
|
244
|
+
'Open Privacy Settings',
|
|
245
|
+
],
|
|
246
|
+
}
|
|
247
|
+
),
|
|
248
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
249
|
+
button_cjs_namespaceObject.Button,
|
|
250
|
+
{
|
|
251
|
+
variant: 'outline',
|
|
252
|
+
size: 'sm',
|
|
253
|
+
onClick: handleOpenCookiePopup,
|
|
254
|
+
children: [
|
|
255
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
256
|
+
external_lucide_react_namespaceObject.Cookie,
|
|
257
|
+
{
|
|
258
|
+
className: 'mr-2 h-4 w-4',
|
|
259
|
+
}
|
|
260
|
+
),
|
|
261
|
+
'Open Cookie Popup',
|
|
262
|
+
],
|
|
263
|
+
}
|
|
264
|
+
),
|
|
265
|
+
],
|
|
266
|
+
}),
|
|
267
|
+
}),
|
|
268
|
+
],
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
var __webpack_export_target__ = exports;
|
|
273
|
+
for (var __webpack_i__ in __webpack_exports__)
|
|
274
|
+
__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
275
|
+
if (__webpack_exports__.__esModule)
|
|
276
|
+
Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
277
|
+
value: true,
|
|
278
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/router/router.tsx"],"names":[],"mappings":"AAgCA,UAAU,WAAW;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wBAAgB,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,WAAW,2CA+H9C"}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from 'react/jsx-runtime';
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_lucide_react_f128bbbb__ from 'lucide-react';
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_motion_react_9decfa63__ from 'motion/react';
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react__ from 'react';
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__components_ui_button_js_a3aa5b55__ from '../components/ui/button.js';
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__components_ui_expandable_tabs_js_ecd49e25__ from '../components/ui/expandable-tabs.js';
|
|
8
|
+
import * as __WEBPACK_EXTERNAL_MODULE__components_ui_scroll_area_js_68572765__ from '../components/ui/scroll-area.js';
|
|
9
|
+
import * as __WEBPACK_EXTERNAL_MODULE__dev_tool_js_649ec346__ from '../dev-tool.js';
|
|
10
|
+
import * as __WEBPACK_EXTERNAL_MODULE__libs_utils_js_d86a90fb__ from '../libs/utils.js';
|
|
11
|
+
const tabs = [
|
|
12
|
+
{
|
|
13
|
+
title: 'Consents',
|
|
14
|
+
icon: __WEBPACK_EXTERNAL_MODULE_lucide_react_f128bbbb__.ToggleLeft,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
title: 'Compliance',
|
|
18
|
+
icon: __WEBPACK_EXTERNAL_MODULE_lucide_react_f128bbbb__.GanttChartSquare,
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
function Router({ onClose }) {
|
|
22
|
+
const privacyConsent = (0,
|
|
23
|
+
__WEBPACK_EXTERNAL_MODULE__dev_tool_js_649ec346__.getStore)();
|
|
24
|
+
const { clearAllData, setIsPrivacyDialogOpen, setShowPopup } = privacyConsent;
|
|
25
|
+
const [activeSection, setActiveSection] = (0,
|
|
26
|
+
__WEBPACK_EXTERNAL_MODULE_react__.useState)('Consents');
|
|
27
|
+
const handleTabChange = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(
|
|
28
|
+
(index) => {
|
|
29
|
+
if (null !== index) setActiveSection(tabs[index].title);
|
|
30
|
+
},
|
|
31
|
+
[]
|
|
32
|
+
);
|
|
33
|
+
const renderingState = [
|
|
34
|
+
{
|
|
35
|
+
componentName: 'MarketingContent',
|
|
36
|
+
consentType: 'marketing',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
componentName: 'AnalyticsContent',
|
|
40
|
+
consentType: 'measurement',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
componentName: 'PersonalizationComponent',
|
|
44
|
+
consentType: 'ad_personalization',
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
const contentItems =
|
|
48
|
+
'Consents' === activeSection
|
|
49
|
+
? Object.entries(privacyConsent.consents).map(([name, value]) => ({
|
|
50
|
+
title: name,
|
|
51
|
+
status: value ? 'Enabled' : 'Disabled',
|
|
52
|
+
}))
|
|
53
|
+
: 'Compliance' === activeSection
|
|
54
|
+
? Object.entries(privacyConsent.complianceSettings).map(
|
|
55
|
+
([region, settings]) => ({
|
|
56
|
+
title: region,
|
|
57
|
+
status: settings.enabled ? 'Active' : 'Inactive',
|
|
58
|
+
})
|
|
59
|
+
)
|
|
60
|
+
: 'Conditional' === activeSection
|
|
61
|
+
? renderingState.map((item) => ({
|
|
62
|
+
title: item.componentName,
|
|
63
|
+
status: 'Rendered',
|
|
64
|
+
details: `Requires: ${item.consentType}`,
|
|
65
|
+
}))
|
|
66
|
+
: [];
|
|
67
|
+
const handleResetConsent = (0,
|
|
68
|
+
__WEBPACK_EXTERNAL_MODULE_react__.useCallback)(() => {
|
|
69
|
+
clearAllData();
|
|
70
|
+
onClose();
|
|
71
|
+
}, [clearAllData, onClose]);
|
|
72
|
+
const handleOpenPrivacyModal = (0,
|
|
73
|
+
__WEBPACK_EXTERNAL_MODULE_react__.useCallback)(() => {
|
|
74
|
+
setIsPrivacyDialogOpen(true);
|
|
75
|
+
}, [setIsPrivacyDialogOpen]);
|
|
76
|
+
const handleOpenCookiePopup = (0,
|
|
77
|
+
__WEBPACK_EXTERNAL_MODULE_react__.useCallback)(() => {
|
|
78
|
+
setShowPopup(true);
|
|
79
|
+
}, [setShowPopup]);
|
|
80
|
+
return /*#__PURE__*/ (0,
|
|
81
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(
|
|
82
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment,
|
|
83
|
+
{
|
|
84
|
+
children: [
|
|
85
|
+
/*#__PURE__*/ (0,
|
|
86
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)('div', {
|
|
87
|
+
className: 'border-b p-4',
|
|
88
|
+
children: /*#__PURE__*/ (0,
|
|
89
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
90
|
+
__WEBPACK_EXTERNAL_MODULE__components_ui_expandable_tabs_js_ecd49e25__.ExpandableTabs,
|
|
91
|
+
{
|
|
92
|
+
tabs: Array.from(tabs),
|
|
93
|
+
activeColor: 'text-primary',
|
|
94
|
+
className: 'border-muted',
|
|
95
|
+
onChange: handleTabChange,
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
}),
|
|
99
|
+
/*#__PURE__*/ (0,
|
|
100
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
101
|
+
__WEBPACK_EXTERNAL_MODULE__components_ui_scroll_area_js_68572765__.ScrollArea,
|
|
102
|
+
{
|
|
103
|
+
className: 'h-[300px]',
|
|
104
|
+
children: /*#__PURE__*/ (0,
|
|
105
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
106
|
+
__WEBPACK_EXTERNAL_MODULE_motion_react_9decfa63__.motion.div,
|
|
107
|
+
{
|
|
108
|
+
className: 'space-y-2 p-4',
|
|
109
|
+
initial: {
|
|
110
|
+
opacity: 0,
|
|
111
|
+
},
|
|
112
|
+
animate: {
|
|
113
|
+
opacity: 1,
|
|
114
|
+
},
|
|
115
|
+
exit: {
|
|
116
|
+
opacity: 0,
|
|
117
|
+
},
|
|
118
|
+
children: contentItems.map((item, index) =>
|
|
119
|
+
/*#__PURE__*/ (0,
|
|
120
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(
|
|
121
|
+
__WEBPACK_EXTERNAL_MODULE_motion_react_9decfa63__.motion
|
|
122
|
+
.div,
|
|
123
|
+
{
|
|
124
|
+
className:
|
|
125
|
+
'flex items-center justify-between rounded-lg border bg-card p-3',
|
|
126
|
+
initial: {
|
|
127
|
+
opacity: 0,
|
|
128
|
+
y: 20,
|
|
129
|
+
},
|
|
130
|
+
animate: {
|
|
131
|
+
opacity: 1,
|
|
132
|
+
y: 0,
|
|
133
|
+
},
|
|
134
|
+
transition: {
|
|
135
|
+
delay: 0.05 * index,
|
|
136
|
+
},
|
|
137
|
+
children: [
|
|
138
|
+
/*#__PURE__*/ (0,
|
|
139
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(
|
|
140
|
+
'div',
|
|
141
|
+
{
|
|
142
|
+
className: 'flex flex-col',
|
|
143
|
+
children: [
|
|
144
|
+
/*#__PURE__*/ (0,
|
|
145
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
146
|
+
'span',
|
|
147
|
+
{
|
|
148
|
+
className: 'font-medium text-sm',
|
|
149
|
+
children: item.title,
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
item.details &&
|
|
153
|
+
/*#__PURE__*/ (0,
|
|
154
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
155
|
+
'span',
|
|
156
|
+
{
|
|
157
|
+
className: 'text-muted-foreground text-xs',
|
|
158
|
+
children: item.details,
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
],
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
/*#__PURE__*/ (0,
|
|
165
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
166
|
+
'span',
|
|
167
|
+
{
|
|
168
|
+
className: (0,
|
|
169
|
+
__WEBPACK_EXTERNAL_MODULE__libs_utils_js_d86a90fb__.cn)(
|
|
170
|
+
'rounded-full px-2 py-1 text-xs',
|
|
171
|
+
'Enabled' === item.status ||
|
|
172
|
+
'Active' === item.status ||
|
|
173
|
+
'active' === item.status ||
|
|
174
|
+
'Rendered' === item.status
|
|
175
|
+
? 'bg-green-100 text-green-800'
|
|
176
|
+
: 'bg-red-100 text-red-800'
|
|
177
|
+
),
|
|
178
|
+
children: item.status,
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
],
|
|
182
|
+
},
|
|
183
|
+
`${activeSection}-${item.title}`
|
|
184
|
+
)
|
|
185
|
+
),
|
|
186
|
+
}
|
|
187
|
+
),
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
/*#__PURE__*/ (0,
|
|
191
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)('div', {
|
|
192
|
+
className: 'border-t p-4',
|
|
193
|
+
children: /*#__PURE__*/ (0,
|
|
194
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)('div', {
|
|
195
|
+
className: 'flex flex-col gap-2',
|
|
196
|
+
children: [
|
|
197
|
+
/*#__PURE__*/ (0,
|
|
198
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(
|
|
199
|
+
__WEBPACK_EXTERNAL_MODULE__components_ui_button_js_a3aa5b55__.Button,
|
|
200
|
+
{
|
|
201
|
+
variant: 'outline',
|
|
202
|
+
size: 'sm',
|
|
203
|
+
onClick: handleResetConsent,
|
|
204
|
+
children: [
|
|
205
|
+
/*#__PURE__*/ (0,
|
|
206
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
207
|
+
__WEBPACK_EXTERNAL_MODULE_lucide_react_f128bbbb__.RefreshCw,
|
|
208
|
+
{
|
|
209
|
+
className: 'mr-2 h-4 w-4',
|
|
210
|
+
}
|
|
211
|
+
),
|
|
212
|
+
'Reset Local Storage Consent',
|
|
213
|
+
],
|
|
214
|
+
}
|
|
215
|
+
),
|
|
216
|
+
/*#__PURE__*/ (0,
|
|
217
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(
|
|
218
|
+
__WEBPACK_EXTERNAL_MODULE__components_ui_button_js_a3aa5b55__.Button,
|
|
219
|
+
{
|
|
220
|
+
variant: 'outline',
|
|
221
|
+
size: 'sm',
|
|
222
|
+
onClick: handleOpenPrivacyModal,
|
|
223
|
+
children: [
|
|
224
|
+
/*#__PURE__*/ (0,
|
|
225
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
226
|
+
__WEBPACK_EXTERNAL_MODULE_lucide_react_f128bbbb__.FileText,
|
|
227
|
+
{
|
|
228
|
+
className: 'mr-2 h-4 w-4',
|
|
229
|
+
}
|
|
230
|
+
),
|
|
231
|
+
'Open Privacy Settings',
|
|
232
|
+
],
|
|
233
|
+
}
|
|
234
|
+
),
|
|
235
|
+
/*#__PURE__*/ (0,
|
|
236
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(
|
|
237
|
+
__WEBPACK_EXTERNAL_MODULE__components_ui_button_js_a3aa5b55__.Button,
|
|
238
|
+
{
|
|
239
|
+
variant: 'outline',
|
|
240
|
+
size: 'sm',
|
|
241
|
+
onClick: handleOpenCookiePopup,
|
|
242
|
+
children: [
|
|
243
|
+
/*#__PURE__*/ (0,
|
|
244
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
245
|
+
__WEBPACK_EXTERNAL_MODULE_lucide_react_f128bbbb__.Cookie,
|
|
246
|
+
{
|
|
247
|
+
className: 'mr-2 h-4 w-4',
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
'Open Cookie Popup',
|
|
251
|
+
],
|
|
252
|
+
}
|
|
253
|
+
),
|
|
254
|
+
],
|
|
255
|
+
}),
|
|
256
|
+
}),
|
|
257
|
+
],
|
|
258
|
+
}
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
export { Router };
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@c15t/dev-tools",
|
|
3
|
+
"version": "0.0.1-rc.3",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"browserslist": [
|
|
9
|
+
">0.2%",
|
|
10
|
+
"not dead",
|
|
11
|
+
"not op_mini all"
|
|
12
|
+
],
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@radix-ui/react-accordion": "1.2.3",
|
|
15
|
+
"@radix-ui/react-scroll-area": "^1.2.3",
|
|
16
|
+
"@radix-ui/react-slot": "1.1.2",
|
|
17
|
+
"@radix-ui/react-switch": "1.1.3",
|
|
18
|
+
"@radix-ui/react-tooltip": "^1.1.8",
|
|
19
|
+
"class-variance-authority": "^0.7.1",
|
|
20
|
+
"clsx": "2.1.1",
|
|
21
|
+
"lucide-react": "^0.475.0",
|
|
22
|
+
"motion": "^12.4.2",
|
|
23
|
+
"react-draggable": "^4.4.6",
|
|
24
|
+
"tailwind-merge": "3.0.1",
|
|
25
|
+
"tsc-alias": "^1.8.10",
|
|
26
|
+
"usehooks-ts": "^3.1.1",
|
|
27
|
+
"zustand": "^5.0.3",
|
|
28
|
+
"c15t": "0.0.1-rc.3"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"postcss": "^8.5.2",
|
|
32
|
+
"@c15t/typescript-config": "0.0.1-beta.1"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
36
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "rslib build",
|
|
43
|
+
"check-types": "tsc --noEmit",
|
|
44
|
+
"dev": "rslib build --watch",
|
|
45
|
+
"fmt": "pnpm biome format --write .",
|
|
46
|
+
"lint": "pnpm biome lint ./src"
|
|
47
|
+
}
|
|
48
|
+
}
|
package/rslib.config.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { pluginReact } from '@rsbuild/plugin-react';
|
|
2
|
+
import { defineConfig } from '@rslib/core';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
source: {
|
|
6
|
+
entry: {
|
|
7
|
+
index: ['./src/**'],
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
lib: [
|
|
11
|
+
{
|
|
12
|
+
bundle: false,
|
|
13
|
+
dts: true,
|
|
14
|
+
format: 'esm',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
bundle: false,
|
|
18
|
+
dts: true,
|
|
19
|
+
format: 'cjs',
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
output: {
|
|
23
|
+
target: 'web',
|
|
24
|
+
|
|
25
|
+
cleanDistPath: true,
|
|
26
|
+
},
|
|
27
|
+
plugins: [pluginReact()],
|
|
28
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { AlertCircle } from 'lucide-react';
|
|
2
|
+
import { motion } from 'motion/react';
|
|
3
|
+
import { Alert, AlertDescription, AlertTitle } from './ui/alert';
|
|
4
|
+
|
|
5
|
+
export function ErrorState({
|
|
6
|
+
namespace,
|
|
7
|
+
}: {
|
|
8
|
+
namespace: string;
|
|
9
|
+
}) {
|
|
10
|
+
return (
|
|
11
|
+
<motion.div
|
|
12
|
+
className="space-y-4 rounded-lg text-center text-base shadow-lg "
|
|
13
|
+
initial={{ opacity: 0 }}
|
|
14
|
+
animate={{ opacity: 1 }}
|
|
15
|
+
exit={{ opacity: 0 }}
|
|
16
|
+
>
|
|
17
|
+
<Alert variant="destructive" className="max-w-2xl rounded-t-none">
|
|
18
|
+
<AlertCircle className="h-4 w-4" />
|
|
19
|
+
<AlertTitle className="font-semibold text-lg">
|
|
20
|
+
SDK Initialization Failed
|
|
21
|
+
</AlertTitle>
|
|
22
|
+
|
|
23
|
+
<AlertDescription className="-ml-7 mt-2">
|
|
24
|
+
<p className="mb-2">
|
|
25
|
+
The c15t SDK could not be found in the global scope. This usually
|
|
26
|
+
means either:
|
|
27
|
+
</p>
|
|
28
|
+
<ul className="list-disc space-y-1 pl-6">
|
|
29
|
+
<li>The namespace has been changed from its default value</li>
|
|
30
|
+
<li>The SDK initialization failed</li>
|
|
31
|
+
</ul>
|
|
32
|
+
{namespace && (
|
|
33
|
+
<p className="mt-3 text-sm">
|
|
34
|
+
Current namespace:{' '}
|
|
35
|
+
<code className="rounded bg-red-100/10 px-1 py-0.5">
|
|
36
|
+
{namespace}
|
|
37
|
+
</code>
|
|
38
|
+
</p>
|
|
39
|
+
)}
|
|
40
|
+
</AlertDescription>
|
|
41
|
+
</Alert>
|
|
42
|
+
</motion.div>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Shield, X } from 'lucide-react';
|
|
2
|
+
|
|
3
|
+
import { Button } from '../components/ui/button';
|
|
4
|
+
|
|
5
|
+
interface HeaderProps {
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function Header({ onClose }: HeaderProps) {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<div className="flex items-center justify-between border-b p-4">
|
|
13
|
+
<div className="flex items-center gap-2">
|
|
14
|
+
<Shield className="h-4 w-4" />
|
|
15
|
+
<span className="font-medium text-sm">c15t.com Dev Tool</span>
|
|
16
|
+
</div>
|
|
17
|
+
<Button
|
|
18
|
+
variant="ghost"
|
|
19
|
+
size="icon"
|
|
20
|
+
className="h-8 w-8"
|
|
21
|
+
onClick={onClose}
|
|
22
|
+
>
|
|
23
|
+
<X className="h-4 w-4" />
|
|
24
|
+
</Button>
|
|
25
|
+
</div>
|
|
26
|
+
</>
|
|
27
|
+
);
|
|
28
|
+
}
|