@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,165 @@
|
|
|
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_react_dom_7136dc57__ from 'react-dom';
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__libs_utils_js_d86a90fb__ from '../libs/utils.js';
|
|
8
|
+
import * as __WEBPACK_EXTERNAL_MODULE__ui_button_js_a32db0cf__ from './ui/button.js';
|
|
9
|
+
import * as __WEBPACK_EXTERNAL_MODULE__ui_card_js_65350278__ from './ui/card.js';
|
|
10
|
+
function DevToolWrapper({
|
|
11
|
+
children,
|
|
12
|
+
isOpen,
|
|
13
|
+
toggleOpen,
|
|
14
|
+
position = 'bottom-right',
|
|
15
|
+
}) {
|
|
16
|
+
const [isMounted, setIsMounted] = (0,
|
|
17
|
+
__WEBPACK_EXTERNAL_MODULE_react__.useState)(false);
|
|
18
|
+
(0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(() => {
|
|
19
|
+
setIsMounted(true);
|
|
20
|
+
return () => setIsMounted(false);
|
|
21
|
+
}, []);
|
|
22
|
+
const DevToolContent = /*#__PURE__*/ (0,
|
|
23
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
24
|
+
__WEBPACK_EXTERNAL_MODULE_motion_react_9decfa63__.AnimatePresence,
|
|
25
|
+
{
|
|
26
|
+
children:
|
|
27
|
+
isOpen &&
|
|
28
|
+
/*#__PURE__*/ (0,
|
|
29
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(
|
|
30
|
+
__WEBPACK_EXTERNAL_MODULE_motion_react_9decfa63__.motion.div,
|
|
31
|
+
{
|
|
32
|
+
className:
|
|
33
|
+
'fixed inset-0 z-50 flex items-end justify-center sm:items-center',
|
|
34
|
+
initial: {
|
|
35
|
+
opacity: 0,
|
|
36
|
+
},
|
|
37
|
+
animate: {
|
|
38
|
+
opacity: 1,
|
|
39
|
+
},
|
|
40
|
+
exit: {
|
|
41
|
+
opacity: 0,
|
|
42
|
+
},
|
|
43
|
+
children: [
|
|
44
|
+
/*#__PURE__*/ (0,
|
|
45
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
46
|
+
__WEBPACK_EXTERNAL_MODULE_motion_react_9decfa63__.motion.div,
|
|
47
|
+
{
|
|
48
|
+
className: 'fixed inset-0 bg-background/10 backdrop-blur-sm',
|
|
49
|
+
initial: {
|
|
50
|
+
opacity: 0,
|
|
51
|
+
},
|
|
52
|
+
animate: {
|
|
53
|
+
opacity: 1,
|
|
54
|
+
},
|
|
55
|
+
exit: {
|
|
56
|
+
opacity: 0,
|
|
57
|
+
},
|
|
58
|
+
onClick: toggleOpen,
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/*#__PURE__*/ (0,
|
|
62
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
63
|
+
__WEBPACK_EXTERNAL_MODULE_motion_react_9decfa63__.motion.div,
|
|
64
|
+
{
|
|
65
|
+
className: (0,
|
|
66
|
+
__WEBPACK_EXTERNAL_MODULE__libs_utils_js_d86a90fb__.cn)(
|
|
67
|
+
'fixed z-[9999]',
|
|
68
|
+
'bottom-right' === position && 'right-4 bottom-4',
|
|
69
|
+
'top-right' === position && 'top-4 right-4',
|
|
70
|
+
'bottom-left' === position && 'bottom-4 left-4',
|
|
71
|
+
'top-left' === position && 'top-4 left-4'
|
|
72
|
+
),
|
|
73
|
+
initial: {
|
|
74
|
+
opacity: 0,
|
|
75
|
+
y: 50,
|
|
76
|
+
},
|
|
77
|
+
animate: {
|
|
78
|
+
opacity: 1,
|
|
79
|
+
y: 0,
|
|
80
|
+
},
|
|
81
|
+
exit: {
|
|
82
|
+
opacity: 0,
|
|
83
|
+
y: 50,
|
|
84
|
+
},
|
|
85
|
+
transition: {
|
|
86
|
+
type: 'spring',
|
|
87
|
+
stiffness: 300,
|
|
88
|
+
damping: 30,
|
|
89
|
+
},
|
|
90
|
+
children: /*#__PURE__*/ (0,
|
|
91
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
92
|
+
__WEBPACK_EXTERNAL_MODULE__ui_card_js_65350278__.Card,
|
|
93
|
+
{
|
|
94
|
+
className: 'w-[350px] shadow-lg',
|
|
95
|
+
children: children,
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
],
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
return /*#__PURE__*/ (0,
|
|
106
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(
|
|
107
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment,
|
|
108
|
+
{
|
|
109
|
+
children: [
|
|
110
|
+
/*#__PURE__*/ (0,
|
|
111
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
112
|
+
__WEBPACK_EXTERNAL_MODULE_motion_react_9decfa63__.AnimatePresence,
|
|
113
|
+
{
|
|
114
|
+
children:
|
|
115
|
+
!isOpen &&
|
|
116
|
+
/*#__PURE__*/ (0,
|
|
117
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
118
|
+
__WEBPACK_EXTERNAL_MODULE_motion_react_9decfa63__.motion.div,
|
|
119
|
+
{
|
|
120
|
+
initial: {
|
|
121
|
+
scale: 0.9,
|
|
122
|
+
opacity: 0,
|
|
123
|
+
},
|
|
124
|
+
animate: {
|
|
125
|
+
scale: 1,
|
|
126
|
+
opacity: 1,
|
|
127
|
+
},
|
|
128
|
+
exit: {
|
|
129
|
+
scale: 0.9,
|
|
130
|
+
opacity: 0,
|
|
131
|
+
},
|
|
132
|
+
className: 'fixed right-4 bottom-4 z-[9999]',
|
|
133
|
+
children: /*#__PURE__*/ (0,
|
|
134
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
135
|
+
__WEBPACK_EXTERNAL_MODULE__ui_button_js_a32db0cf__.Button,
|
|
136
|
+
{
|
|
137
|
+
variant: 'outline',
|
|
138
|
+
size: 'icon',
|
|
139
|
+
className: 'h-10 w-10 rounded-full shadow-lg',
|
|
140
|
+
onClick: toggleOpen,
|
|
141
|
+
children: /*#__PURE__*/ (0,
|
|
142
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
143
|
+
__WEBPACK_EXTERNAL_MODULE_lucide_react_f128bbbb__.Shield,
|
|
144
|
+
{
|
|
145
|
+
className: 'h-4 w-4',
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
isMounted &&
|
|
155
|
+
/*#__PURE__*/ (0,
|
|
156
|
+
__WEBPACK_EXTERNAL_MODULE_react_dom_7136dc57__.createPortal)(
|
|
157
|
+
DevToolContent,
|
|
158
|
+
document.body
|
|
159
|
+
),
|
|
160
|
+
],
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
const wrapper_rslib_entry_ = DevToolWrapper;
|
|
165
|
+
export { DevToolWrapper, wrapper_rslib_entry_ as default };
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(() => {
|
|
5
|
+
__webpack_require__.n = function (module) {
|
|
6
|
+
var getter =
|
|
7
|
+
module && module.__esModule
|
|
8
|
+
? function () {
|
|
9
|
+
return module['default'];
|
|
10
|
+
}
|
|
11
|
+
: function () {
|
|
12
|
+
return module;
|
|
13
|
+
};
|
|
14
|
+
__webpack_require__.d(getter, {
|
|
15
|
+
a: getter,
|
|
16
|
+
});
|
|
17
|
+
return getter;
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(() => {
|
|
21
|
+
__webpack_require__.d = function (exports1, definition) {
|
|
22
|
+
for (var key in definition)
|
|
23
|
+
if (
|
|
24
|
+
__webpack_require__.o(definition, key) &&
|
|
25
|
+
!__webpack_require__.o(exports1, key)
|
|
26
|
+
)
|
|
27
|
+
Object.defineProperty(exports1, key, {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: definition[key],
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
(() => {
|
|
34
|
+
__webpack_require__.o = function (obj, prop) {
|
|
35
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
(() => {
|
|
39
|
+
__webpack_require__.r = function (exports1) {
|
|
40
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag)
|
|
41
|
+
Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
42
|
+
value: 'Module',
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
45
|
+
value: true,
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
})();
|
|
49
|
+
var __webpack_exports__ = {};
|
|
50
|
+
__webpack_require__.r(__webpack_exports__);
|
|
51
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
52
|
+
getStore: () => getStore,
|
|
53
|
+
ConsentManagerDevTool: () => ConsentManagerDevTool,
|
|
54
|
+
default: () => dev_tool_rslib_entry_,
|
|
55
|
+
});
|
|
56
|
+
const jsx_runtime_namespaceObject = require('react/jsx-runtime');
|
|
57
|
+
const external_react_namespaceObject = require('react');
|
|
58
|
+
const error_state_cjs_namespaceObject = require('./components/error-state.cjs');
|
|
59
|
+
const header_cjs_namespaceObject = require('./components/header.cjs');
|
|
60
|
+
const wrapper_cjs_namespaceObject = require('./components/wrapper.cjs');
|
|
61
|
+
var wrapper_cjs_default = /*#__PURE__*/ __webpack_require__.n(
|
|
62
|
+
wrapper_cjs_namespaceObject
|
|
63
|
+
);
|
|
64
|
+
const router_cjs_namespaceObject = require('./router/router.cjs');
|
|
65
|
+
const PrivacyConsentContext = /*#__PURE__*/ (0,
|
|
66
|
+
external_react_namespaceObject.createContext)(null);
|
|
67
|
+
const getStore = () => {
|
|
68
|
+
const context = (0, external_react_namespaceObject.useContext)(
|
|
69
|
+
PrivacyConsentContext
|
|
70
|
+
);
|
|
71
|
+
if (null === context)
|
|
72
|
+
throw new Error(
|
|
73
|
+
'useConsentManagerContext must be used within a ConsentManagerProvider'
|
|
74
|
+
);
|
|
75
|
+
const [localState, setLocalState] = (0,
|
|
76
|
+
external_react_namespaceObject.useState)(context.state);
|
|
77
|
+
(0, external_react_namespaceObject.useEffect)(() => {
|
|
78
|
+
if (!context.store) return;
|
|
79
|
+
setLocalState(context.state);
|
|
80
|
+
const unsubscribe = context.store.subscribe((newState) => {
|
|
81
|
+
setLocalState(newState);
|
|
82
|
+
});
|
|
83
|
+
return () => {
|
|
84
|
+
unsubscribe();
|
|
85
|
+
};
|
|
86
|
+
}, [context.store, context.state]);
|
|
87
|
+
return localState;
|
|
88
|
+
};
|
|
89
|
+
const dev_tool_rslib_entry_ = PrivacyConsentContext;
|
|
90
|
+
const ConsentManagerDevTool = ({
|
|
91
|
+
namespace = 'c15tStore',
|
|
92
|
+
position = 'bottom-right',
|
|
93
|
+
}) => {
|
|
94
|
+
const [state, setState] = (0, external_react_namespaceObject.useState)(null);
|
|
95
|
+
const [store, setStore] = (0, external_react_namespaceObject.useState)(null);
|
|
96
|
+
const [isOpen, setIsOpen] = (0, external_react_namespaceObject.useState)(
|
|
97
|
+
false
|
|
98
|
+
);
|
|
99
|
+
const toggleOpen = (0, external_react_namespaceObject.useCallback)(
|
|
100
|
+
() => setIsOpen((prev) => !prev),
|
|
101
|
+
[]
|
|
102
|
+
);
|
|
103
|
+
(0, external_react_namespaceObject.useEffect)(() => {
|
|
104
|
+
const storeInstance =
|
|
105
|
+
('undefined' != typeof window && window[namespace]) || null;
|
|
106
|
+
if (storeInstance) {
|
|
107
|
+
setStore(storeInstance);
|
|
108
|
+
const currentState = storeInstance.getState();
|
|
109
|
+
setState(currentState);
|
|
110
|
+
const unsubscribe = storeInstance.subscribe((newState) => {
|
|
111
|
+
setState(newState);
|
|
112
|
+
});
|
|
113
|
+
return () => {
|
|
114
|
+
unsubscribe();
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
console.log(`${namespace} is not available on the window object.`);
|
|
118
|
+
}, [namespace]);
|
|
119
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
120
|
+
PrivacyConsentContext.Provider,
|
|
121
|
+
{
|
|
122
|
+
value: {
|
|
123
|
+
state,
|
|
124
|
+
store,
|
|
125
|
+
},
|
|
126
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
127
|
+
wrapper_cjs_default(),
|
|
128
|
+
{
|
|
129
|
+
isOpen: isOpen,
|
|
130
|
+
toggleOpen: toggleOpen,
|
|
131
|
+
position: position,
|
|
132
|
+
children: [
|
|
133
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
134
|
+
header_cjs_namespaceObject.Header,
|
|
135
|
+
{
|
|
136
|
+
onClose: () => setIsOpen(false),
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
state
|
|
140
|
+
? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
141
|
+
router_cjs_namespaceObject.Router,
|
|
142
|
+
{
|
|
143
|
+
onClose: () => setIsOpen(false),
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
147
|
+
error_state_cjs_namespaceObject.ErrorState,
|
|
148
|
+
{
|
|
149
|
+
namespace: namespace,
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
],
|
|
153
|
+
}
|
|
154
|
+
),
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
};
|
|
158
|
+
var __webpack_export_target__ = exports;
|
|
159
|
+
for (var __webpack_i__ in __webpack_exports__)
|
|
160
|
+
__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
161
|
+
if (__webpack_exports__.__esModule)
|
|
162
|
+
Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
163
|
+
value: true,
|
|
164
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { NamespaceProps, PrivacyConsentState } from 'c15t';
|
|
2
|
+
import { type FC } from 'react';
|
|
3
|
+
import type { StoreApi } from 'zustand/vanilla';
|
|
4
|
+
declare const PrivacyConsentContext: import('react').Context<{
|
|
5
|
+
state: PrivacyConsentState | null;
|
|
6
|
+
store: StoreApi<PrivacyConsentState> | null;
|
|
7
|
+
} | null>;
|
|
8
|
+
export declare const getStore: () => PrivacyConsentState | null;
|
|
9
|
+
export default PrivacyConsentContext;
|
|
10
|
+
interface ConsentManagerProviderProps extends NamespaceProps {
|
|
11
|
+
position?: 'bottom-right' | 'top-right' | 'bottom-left' | 'top-left';
|
|
12
|
+
}
|
|
13
|
+
export declare const ConsentManagerDevTool: FC<ConsentManagerProviderProps>;
|
|
14
|
+
//# sourceMappingURL=dev-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-tool.d.ts","sourceRoot":"","sources":["../src/dev-tool.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAEhE,OAAO,EACN,KAAK,EAAE,EAMP,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAMhD,QAAA,MAAM,qBAAqB;WACnB,mBAAmB,GAAG,IAAI;WAC1B,QAAQ,CAAC,mBAAmB,CAAC,GAAG,IAAI;SAC7B,CAAC;AAEhB,eAAO,MAAM,QAAQ,kCAgCpB,CAAC;AAEF,eAAe,qBAAqB,CAAC;AAErC,UAAU,2BAA4B,SAAQ,cAAc;IAC3D,QAAQ,CAAC,EAAE,cAAc,GAAG,WAAW,GAAG,aAAa,GAAG,UAAU,CAAC;CACrE;AAED,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,2BAA2B,CAsDjE,CAAC"}
|
package/dist/dev-tool.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from 'react/jsx-runtime';
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react__ from 'react';
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__components_error_state_js_b2afe07e__ from './components/error-state.js';
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__components_header_js_f6efece6__ from './components/header.js';
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__components_wrapper_js_57ff3aa7__ from './components/wrapper.js';
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__router_router_js_6b417f36__ from './router/router.js';
|
|
8
|
+
const PrivacyConsentContext = /*#__PURE__*/ (0,
|
|
9
|
+
__WEBPACK_EXTERNAL_MODULE_react__.createContext)(null);
|
|
10
|
+
const getStore = () => {
|
|
11
|
+
const context = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(
|
|
12
|
+
PrivacyConsentContext
|
|
13
|
+
);
|
|
14
|
+
if (null === context)
|
|
15
|
+
throw new Error(
|
|
16
|
+
'useConsentManagerContext must be used within a ConsentManagerProvider'
|
|
17
|
+
);
|
|
18
|
+
const [localState, setLocalState] = (0,
|
|
19
|
+
__WEBPACK_EXTERNAL_MODULE_react__.useState)(context.state);
|
|
20
|
+
(0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(() => {
|
|
21
|
+
if (!context.store) return;
|
|
22
|
+
setLocalState(context.state);
|
|
23
|
+
const unsubscribe = context.store.subscribe((newState) => {
|
|
24
|
+
setLocalState(newState);
|
|
25
|
+
});
|
|
26
|
+
return () => {
|
|
27
|
+
unsubscribe();
|
|
28
|
+
};
|
|
29
|
+
}, [context.store, context.state]);
|
|
30
|
+
return localState;
|
|
31
|
+
};
|
|
32
|
+
const dev_tool_rslib_entry_ = PrivacyConsentContext;
|
|
33
|
+
const ConsentManagerDevTool = ({
|
|
34
|
+
namespace = 'c15tStore',
|
|
35
|
+
position = 'bottom-right',
|
|
36
|
+
}) => {
|
|
37
|
+
const [state, setState] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(
|
|
38
|
+
null
|
|
39
|
+
);
|
|
40
|
+
const [store, setStore] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(
|
|
41
|
+
null
|
|
42
|
+
);
|
|
43
|
+
const [isOpen, setIsOpen] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(
|
|
44
|
+
false
|
|
45
|
+
);
|
|
46
|
+
const toggleOpen = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(
|
|
47
|
+
() => setIsOpen((prev) => !prev),
|
|
48
|
+
[]
|
|
49
|
+
);
|
|
50
|
+
(0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(() => {
|
|
51
|
+
const storeInstance =
|
|
52
|
+
('undefined' != typeof window && window[namespace]) || null;
|
|
53
|
+
if (storeInstance) {
|
|
54
|
+
setStore(storeInstance);
|
|
55
|
+
const currentState = storeInstance.getState();
|
|
56
|
+
setState(currentState);
|
|
57
|
+
const unsubscribe = storeInstance.subscribe((newState) => {
|
|
58
|
+
setState(newState);
|
|
59
|
+
});
|
|
60
|
+
return () => {
|
|
61
|
+
unsubscribe();
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
console.log(`${namespace} is not available on the window object.`);
|
|
65
|
+
}, [namespace]);
|
|
66
|
+
return /*#__PURE__*/ (0,
|
|
67
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
68
|
+
PrivacyConsentContext.Provider,
|
|
69
|
+
{
|
|
70
|
+
value: {
|
|
71
|
+
state,
|
|
72
|
+
store,
|
|
73
|
+
},
|
|
74
|
+
children: /*#__PURE__*/ (0,
|
|
75
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(
|
|
76
|
+
__WEBPACK_EXTERNAL_MODULE__components_wrapper_js_57ff3aa7__['default'],
|
|
77
|
+
{
|
|
78
|
+
isOpen: isOpen,
|
|
79
|
+
toggleOpen: toggleOpen,
|
|
80
|
+
position: position,
|
|
81
|
+
children: [
|
|
82
|
+
/*#__PURE__*/ (0,
|
|
83
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
84
|
+
__WEBPACK_EXTERNAL_MODULE__components_header_js_f6efece6__.Header,
|
|
85
|
+
{
|
|
86
|
+
onClose: () => setIsOpen(false),
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
state
|
|
90
|
+
? /*#__PURE__*/ (0,
|
|
91
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
92
|
+
__WEBPACK_EXTERNAL_MODULE__router_router_js_6b417f36__.Router,
|
|
93
|
+
{
|
|
94
|
+
onClose: () => setIsOpen(false),
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
: /*#__PURE__*/ (0,
|
|
98
|
+
__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
99
|
+
__WEBPACK_EXTERNAL_MODULE__components_error_state_js_b2afe07e__.ErrorState,
|
|
100
|
+
{
|
|
101
|
+
namespace: namespace,
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
],
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
export { ConsentManagerDevTool, dev_tool_rslib_entry_ as default, getStore };
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(() => {
|
|
4
|
+
__webpack_require__.d = function (exports1, definition) {
|
|
5
|
+
for (var key in definition)
|
|
6
|
+
if (
|
|
7
|
+
__webpack_require__.o(definition, key) &&
|
|
8
|
+
!__webpack_require__.o(exports1, key)
|
|
9
|
+
)
|
|
10
|
+
Object.defineProperty(exports1, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: definition[key],
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(() => {
|
|
17
|
+
__webpack_require__.o = function (obj, prop) {
|
|
18
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
19
|
+
};
|
|
20
|
+
})();
|
|
21
|
+
(() => {
|
|
22
|
+
__webpack_require__.r = function (exports1) {
|
|
23
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag)
|
|
24
|
+
Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
25
|
+
value: 'Module',
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
28
|
+
value: true,
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
})();
|
|
32
|
+
var __webpack_exports__ = {};
|
|
33
|
+
__webpack_require__.r(__webpack_exports__);
|
|
34
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
35
|
+
default: () => src_rslib_entry_,
|
|
36
|
+
});
|
|
37
|
+
const external_dev_tool_cjs_namespaceObject = require('./dev-tool.cjs');
|
|
38
|
+
const src_rslib_entry_ =
|
|
39
|
+
external_dev_tool_cjs_namespaceObject.ConsentManagerDevTool;
|
|
40
|
+
var __webpack_export_target__ = exports;
|
|
41
|
+
for (var __webpack_i__ in __webpack_exports__)
|
|
42
|
+
__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
43
|
+
if (__webpack_exports__.__esModule)
|
|
44
|
+
Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
45
|
+
value: true,
|
|
46
|
+
});
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD,eAAe,qBAAqB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(() => {
|
|
4
|
+
__webpack_require__.n = function (module) {
|
|
5
|
+
var getter =
|
|
6
|
+
module && module.__esModule
|
|
7
|
+
? function () {
|
|
8
|
+
return module['default'];
|
|
9
|
+
}
|
|
10
|
+
: function () {
|
|
11
|
+
return module;
|
|
12
|
+
};
|
|
13
|
+
__webpack_require__.d(getter, {
|
|
14
|
+
a: getter,
|
|
15
|
+
});
|
|
16
|
+
return getter;
|
|
17
|
+
};
|
|
18
|
+
})();
|
|
19
|
+
(() => {
|
|
20
|
+
__webpack_require__.d = function (exports1, definition) {
|
|
21
|
+
for (var key in definition)
|
|
22
|
+
if (
|
|
23
|
+
__webpack_require__.o(definition, key) &&
|
|
24
|
+
!__webpack_require__.o(exports1, key)
|
|
25
|
+
)
|
|
26
|
+
Object.defineProperty(exports1, key, {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: definition[key],
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
})();
|
|
32
|
+
(() => {
|
|
33
|
+
__webpack_require__.o = function (obj, prop) {
|
|
34
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
(() => {
|
|
38
|
+
__webpack_require__.r = function (exports1) {
|
|
39
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag)
|
|
40
|
+
Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
41
|
+
value: 'Module',
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
44
|
+
value: true,
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
})();
|
|
48
|
+
var __webpack_exports__ = {};
|
|
49
|
+
__webpack_require__.r(__webpack_exports__);
|
|
50
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
51
|
+
cn: () => cn,
|
|
52
|
+
});
|
|
53
|
+
const external_clsx_namespaceObject = require('clsx');
|
|
54
|
+
var external_clsx_default = /*#__PURE__*/ __webpack_require__.n(
|
|
55
|
+
external_clsx_namespaceObject
|
|
56
|
+
);
|
|
57
|
+
const external_tailwind_merge_namespaceObject = require('tailwind-merge');
|
|
58
|
+
function cn(...inputs) {
|
|
59
|
+
return (0, external_tailwind_merge_namespaceObject.twMerge)(
|
|
60
|
+
external_clsx_default()(inputs)
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
var __webpack_export_target__ = exports;
|
|
64
|
+
for (var __webpack_i__ in __webpack_exports__)
|
|
65
|
+
__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
66
|
+
if (__webpack_exports__.__esModule)
|
|
67
|
+
Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
68
|
+
value: true,
|
|
69
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/libs/utils.ts"],"names":[],"mappings":"AAAA,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAG7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_clsx__ from 'clsx';
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__ from 'tailwind-merge';
|
|
3
|
+
function cn(...inputs) {
|
|
4
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)(
|
|
5
|
+
(0, __WEBPACK_EXTERNAL_MODULE_clsx__['default'])(inputs)
|
|
6
|
+
);
|
|
7
|
+
}
|
|
8
|
+
export { cn };
|