@c15t/dev-tools 2.0.0-rc.4 → 2.0.0-rc.5
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/README.md +12 -1
- package/dist/index.cjs +346 -36
- package/dist/index.js +346 -36
- package/dist/react.cjs +346 -36
- package/dist/react.js +346 -36
- package/dist/tanstack.cjs +340 -35
- package/dist/tanstack.js +340 -35
- package/{dist → dist-types}/components/dropdown-menu.d.ts +0 -1
- package/{dist → dist-types}/components/index.d.ts +0 -1
- package/{dist → dist-types}/components/panel.d.ts +0 -1
- package/{dist → dist-types}/components/tabs.d.ts +0 -1
- package/{dist → dist-types}/components/ui.d.ts +0 -1
- package/{dist → dist-types}/core/debug-bundle.d.ts +1 -2
- package/{dist → dist-types}/core/devtools.d.ts +0 -1
- package/{dist → dist-types}/core/draggable.d.ts +0 -1
- package/{dist → dist-types}/core/index.d.ts +0 -1
- package/{dist → dist-types}/core/override-storage.d.ts +1 -2
- package/{dist → dist-types}/core/panel-renderer.d.ts +1 -2
- package/{dist → dist-types}/core/renderer.d.ts +0 -1
- package/{dist → dist-types}/core/reset-consents.d.ts +1 -2
- package/{dist → dist-types}/core/state-manager.d.ts +1 -2
- package/{dist → dist-types}/core/store-connector.d.ts +1 -2
- package/{dist → dist-types}/core/store-instrumentation.d.ts +1 -2
- package/{dist → dist-types}/index.d.ts +0 -1
- package/{dist → dist-types}/panels/actions.d.ts +1 -2
- package/{dist → dist-types}/panels/consents.d.ts +1 -2
- package/{dist → dist-types}/panels/dom-scanner.d.ts +1 -2
- package/{dist → dist-types}/panels/events.d.ts +0 -1
- package/{dist → dist-types}/panels/iab.d.ts +1 -2
- package/{dist → dist-types}/panels/index.d.ts +1 -1
- package/{dist → dist-types}/panels/location.d.ts +1 -2
- package/dist-types/panels/policy.d.ts +12 -0
- package/{dist → dist-types}/panels/scripts.d.ts +1 -2
- package/{dist → dist-types}/react.d.ts +0 -1
- package/{dist → dist-types}/styles/index.d.ts +0 -1
- package/{dist → dist-types}/tanstack.d.ts +0 -1
- package/{dist → dist-types}/utils/index.d.ts +1 -1
- package/dist-types/utils/init-source.d.ts +2 -0
- package/{dist → dist-types}/utils/preference-trigger.d.ts +0 -1
- package/dist-types/version.d.ts +1 -0
- package/package.json +32 -29
- package/CHANGELOG.md +0 -163
- package/dist/components/dropdown-menu.d.ts.map +0 -1
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/panel.d.ts.map +0 -1
- package/dist/components/tabs.d.ts.map +0 -1
- package/dist/components/ui.d.ts.map +0 -1
- package/dist/core/debug-bundle.d.ts.map +0 -1
- package/dist/core/devtools.d.ts.map +0 -1
- package/dist/core/draggable.d.ts.map +0 -1
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/override-storage.d.ts.map +0 -1
- package/dist/core/panel-renderer.d.ts.map +0 -1
- package/dist/core/renderer.d.ts.map +0 -1
- package/dist/core/reset-consents.d.ts.map +0 -1
- package/dist/core/state-manager.d.ts.map +0 -1
- package/dist/core/store-connector.d.ts.map +0 -1
- package/dist/core/store-instrumentation.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/panels/actions.d.ts.map +0 -1
- package/dist/panels/consents.d.ts.map +0 -1
- package/dist/panels/dom-scanner.d.ts.map +0 -1
- package/dist/panels/events.d.ts.map +0 -1
- package/dist/panels/iab.d.ts.map +0 -1
- package/dist/panels/index.d.ts.map +0 -1
- package/dist/panels/location.d.ts.map +0 -1
- package/dist/panels/scripts.d.ts.map +0 -1
- package/dist/react.d.ts.map +0 -1
- package/dist/styles/index.d.ts.map +0 -1
- package/dist/tanstack.d.ts.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/preference-trigger.d.ts.map +0 -1
- package/dist/version.d.ts +0 -2
- package/dist/version.d.ts.map +0 -1
- package/tsconfig.json +0 -20
package/dist/tanstack.js
CHANGED
|
@@ -1988,6 +1988,27 @@ panel_module_options.domAPI = styleDomAPI_default();
|
|
|
1988
1988
|
panel_module_options.insertStyleElement = insertStyleElement_default();
|
|
1989
1989
|
injectStylesIntoStyleTag_default()(panel_module.A, panel_module_options);
|
|
1990
1990
|
panel_module.A && panel_module.A.locals && panel_module.A.locals;
|
|
1991
|
+
function init_source_formatInitSource(source, detail) {
|
|
1992
|
+
const label = (()=>{
|
|
1993
|
+
switch(source){
|
|
1994
|
+
case 'ssr':
|
|
1995
|
+
return 'SSR Prefetch';
|
|
1996
|
+
case 'backend':
|
|
1997
|
+
return 'Backend';
|
|
1998
|
+
case 'backend-cache-hit':
|
|
1999
|
+
return 'Backend (Cache Hit)';
|
|
2000
|
+
case 'offline-fallback':
|
|
2001
|
+
return 'Offline Fallback';
|
|
2002
|
+
case 'offline-mode':
|
|
2003
|
+
return 'Offline Mode';
|
|
2004
|
+
case 'custom':
|
|
2005
|
+
return 'Custom Client';
|
|
2006
|
+
default:
|
|
2007
|
+
return '—';
|
|
2008
|
+
}
|
|
2009
|
+
})();
|
|
2010
|
+
return detail ? `${label} [${detail}]` : label;
|
|
2011
|
+
}
|
|
1991
2012
|
'[data-c15t-trigger], [aria-label*="privacy settings" i], [aria-label*="preference" i]';
|
|
1992
2013
|
var tabs_module = __webpack_require__("../../node_modules/.bun/@rsbuild+core@1.6.12/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[1].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[1].use[2]!./src/styles/tabs.module.css");
|
|
1993
2014
|
var tabs_module_options = {};
|
|
@@ -2007,6 +2028,11 @@ const LOCATION_ICON = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 2
|
|
|
2007
2028
|
<line x1="2" y1="12" x2="22" y2="12"></line>
|
|
2008
2029
|
<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path>
|
|
2009
2030
|
</svg>`;
|
|
2031
|
+
const POLICY_ICON = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
2032
|
+
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>
|
|
2033
|
+
<path d="M9 12h6"></path>
|
|
2034
|
+
<path d="M12 9v6"></path>
|
|
2035
|
+
</svg>`;
|
|
2010
2036
|
const SCRIPTS_ICON = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
2011
2037
|
<polyline points="16 18 22 12 16 6"></polyline>
|
|
2012
2038
|
<polyline points="8 6 2 12 8 18"></polyline>
|
|
@@ -2034,6 +2060,11 @@ const TABS = [
|
|
|
2034
2060
|
label: 'Location',
|
|
2035
2061
|
icon: LOCATION_ICON
|
|
2036
2062
|
},
|
|
2063
|
+
{
|
|
2064
|
+
id: 'policy',
|
|
2065
|
+
label: 'Policy',
|
|
2066
|
+
icon: POLICY_ICON
|
|
2067
|
+
},
|
|
2037
2068
|
{
|
|
2038
2069
|
id: 'consents',
|
|
2039
2070
|
label: 'Consents',
|
|
@@ -2194,6 +2225,7 @@ function tabs_createTabs(options) {
|
|
|
2194
2225
|
const forcedOverflowTab = showOverflowSecondTabInStrip ? preferredSecondTab : overflowSecondTab;
|
|
2195
2226
|
const layoutTabIds = [
|
|
2196
2227
|
'location',
|
|
2228
|
+
'policy',
|
|
2197
2229
|
stripSecondTab,
|
|
2198
2230
|
"scripts",
|
|
2199
2231
|
'actions',
|
|
@@ -2858,7 +2890,6 @@ function createIconWrapper(icon, size) {
|
|
|
2858
2890
|
function getNamespace(state) {
|
|
2859
2891
|
return state.config?.meta?.namespace || 'c15tStore';
|
|
2860
2892
|
}
|
|
2861
|
-
const consentSearchByContainer = new WeakMap();
|
|
2862
2893
|
function renderConsentsPanel(container, options) {
|
|
2863
2894
|
const { getState, onConsentChange, onSave, onAcceptAll, onRejectAll, onReset } = options;
|
|
2864
2895
|
renderer_clearElement(container);
|
|
@@ -2877,40 +2908,15 @@ function renderConsentsPanel(container, options) {
|
|
|
2877
2908
|
ct.name,
|
|
2878
2909
|
ct
|
|
2879
2910
|
]));
|
|
2880
|
-
const searchQuery = consentSearchByContainer.get(container) ?? '';
|
|
2881
2911
|
const consentEntries = Object.entries(displayConsents);
|
|
2882
|
-
|
|
2883
|
-
if (!searchQuery) return true;
|
|
2884
|
-
const consentType = consentTypeMap.get(name);
|
|
2885
|
-
const displayName = consentType?.name || name;
|
|
2886
|
-
return `${name} ${displayName}`.toLowerCase().includes(searchQuery);
|
|
2887
|
-
});
|
|
2888
|
-
const showSearchInput = consentEntries.length > 4;
|
|
2889
|
-
if (showSearchInput) container.appendChild(renderer_div({
|
|
2890
|
-
style: {
|
|
2891
|
-
padding: '8px 0 10px'
|
|
2892
|
-
},
|
|
2893
|
-
children: [
|
|
2894
|
-
createInput({
|
|
2895
|
-
value: searchQuery,
|
|
2896
|
-
placeholder: 'Filter consents…',
|
|
2897
|
-
ariaLabel: 'Filter consents',
|
|
2898
|
-
small: true,
|
|
2899
|
-
onInput: (value)=>{
|
|
2900
|
-
consentSearchByContainer.set(container, value.trim().toLowerCase());
|
|
2901
|
-
renderConsentsPanel(container, options);
|
|
2902
|
-
}
|
|
2903
|
-
})
|
|
2904
|
-
]
|
|
2905
|
-
}));
|
|
2906
|
-
if (0 === filteredConsentEntries.length) container.appendChild(renderer_div({
|
|
2912
|
+
if (0 === consentEntries.length) container.appendChild(renderer_div({
|
|
2907
2913
|
style: {
|
|
2908
2914
|
padding: '24px',
|
|
2909
2915
|
textAlign: 'center',
|
|
2910
2916
|
color: 'var(--c15t-devtools-text-muted)',
|
|
2911
2917
|
fontSize: 'var(--c15t-devtools-font-size-sm)'
|
|
2912
2918
|
},
|
|
2913
|
-
text:
|
|
2919
|
+
text: 'No consents configured'
|
|
2914
2920
|
}));
|
|
2915
2921
|
else {
|
|
2916
2922
|
if (isIabMode) {
|
|
@@ -2928,7 +2934,7 @@ function renderConsentsPanel(container, options) {
|
|
|
2928
2934
|
container.appendChild(iabNotice);
|
|
2929
2935
|
}
|
|
2930
2936
|
const gridCards = [];
|
|
2931
|
-
for (const [name, value] of
|
|
2937
|
+
for (const [name, value] of consentEntries){
|
|
2932
2938
|
const consentType = consentTypeMap.get(name);
|
|
2933
2939
|
const isNecessary = 'necessary' === name;
|
|
2934
2940
|
const displayName = consentType?.name || name;
|
|
@@ -3687,11 +3693,15 @@ function renderLocationPanel(container, options) {
|
|
|
3687
3693
|
const locationInfo = state.locationInfo;
|
|
3688
3694
|
const overrides = state.overrides;
|
|
3689
3695
|
const translationConfig = state.translationConfig;
|
|
3696
|
+
const initData = state.lastBannerFetchData;
|
|
3697
|
+
const activePolicy = initData?.policy;
|
|
3698
|
+
const policyDecision = initData?.policyDecision;
|
|
3699
|
+
const initSource = init_source_formatInitSource(state.initDataSource, state.initDataSourceDetail);
|
|
3690
3700
|
const gridItems = [
|
|
3691
3701
|
createCompactInfoCard('Country', locationInfo?.countryCode || '—'),
|
|
3692
3702
|
createCompactInfoCard('Region', locationInfo?.regionCode || '—'),
|
|
3693
|
-
createCompactInfoCard('
|
|
3694
|
-
createCompactInfoCard('
|
|
3703
|
+
createCompactInfoCard('Language', translationConfig?.defaultLanguage || '—'),
|
|
3704
|
+
createCompactInfoCard('Init Source', initSource)
|
|
3695
3705
|
];
|
|
3696
3706
|
gridItems.push(createCompactInfoCard('GPC', getEffectiveGpcLabel(overrides?.gpc)));
|
|
3697
3707
|
if (state.model) gridItems.push(createCompactInfoCard('Model', getModelLabel(state.model)));
|
|
@@ -3699,7 +3709,6 @@ function renderLocationPanel(container, options) {
|
|
|
3699
3709
|
columns: 3,
|
|
3700
3710
|
children: gridItems
|
|
3701
3711
|
});
|
|
3702
|
-
container.appendChild(locationGrid);
|
|
3703
3712
|
const initialDraft = getDraftFromOverrides(overrides);
|
|
3704
3713
|
let appliedOverrides = normalizeOverrideDraft(initialDraft);
|
|
3705
3714
|
let isSubmitting = false;
|
|
@@ -3790,6 +3799,12 @@ function renderLocationPanel(container, options) {
|
|
|
3790
3799
|
]
|
|
3791
3800
|
});
|
|
3792
3801
|
container.appendChild(overrideSection);
|
|
3802
|
+
container.appendChild(locationGrid);
|
|
3803
|
+
container.appendChild(createActivePolicySummarySection({
|
|
3804
|
+
policy: activePolicy,
|
|
3805
|
+
policyDecision,
|
|
3806
|
+
policySnapshotToken: initData?.policySnapshotToken
|
|
3807
|
+
}));
|
|
3793
3808
|
countryField.control.addEventListener('change', updateFormState);
|
|
3794
3809
|
regionField.control.addEventListener('input', updateFormState);
|
|
3795
3810
|
languageField.control.addEventListener('input', updateFormState);
|
|
@@ -4078,15 +4093,53 @@ function getModelLabel(model) {
|
|
|
4078
4093
|
return 'None';
|
|
4079
4094
|
}
|
|
4080
4095
|
}
|
|
4096
|
+
function createActivePolicySummarySection(options) {
|
|
4097
|
+
const { policy, policyDecision, policySnapshotToken } = options;
|
|
4098
|
+
if (!policy && !policyDecision) return createSection({
|
|
4099
|
+
title: 'Active Policy',
|
|
4100
|
+
children: [
|
|
4101
|
+
renderer_div({
|
|
4102
|
+
style: {
|
|
4103
|
+
padding: '10px 12px',
|
|
4104
|
+
fontSize: 'var(--c15t-devtools-font-size-sm)',
|
|
4105
|
+
color: 'var(--c15t-text-muted)'
|
|
4106
|
+
},
|
|
4107
|
+
text: 'No active policy matched.'
|
|
4108
|
+
})
|
|
4109
|
+
]
|
|
4110
|
+
});
|
|
4111
|
+
const cards = [
|
|
4112
|
+
createCompactInfoCard('Policy ID', policy?.id ?? policyDecision?.policyId ?? '—'),
|
|
4113
|
+
createCompactInfoCard('Matched By', policyDecision?.matchedBy ?? '—'),
|
|
4114
|
+
createCompactInfoCard('Snapshot Token', policySnapshotToken ? 'present' : 'missing')
|
|
4115
|
+
];
|
|
4116
|
+
return createSection({
|
|
4117
|
+
title: 'Active Policy',
|
|
4118
|
+
children: [
|
|
4119
|
+
renderer_div({
|
|
4120
|
+
style: {
|
|
4121
|
+
display: 'grid',
|
|
4122
|
+
gridTemplateColumns: 'repeat(3, minmax(0, 1fr))',
|
|
4123
|
+
gap: 'var(--c15t-space-sm, 0.5rem)'
|
|
4124
|
+
},
|
|
4125
|
+
children: cards
|
|
4126
|
+
}),
|
|
4127
|
+
renderer_span({
|
|
4128
|
+
className: styles_components_module.overrideHint,
|
|
4129
|
+
text: 'Open the Policy tab for full policy-pack diagnostics.'
|
|
4130
|
+
})
|
|
4131
|
+
]
|
|
4132
|
+
});
|
|
4133
|
+
}
|
|
4081
4134
|
function createCompactInfoCard(label, value) {
|
|
4082
4135
|
return renderer_div({
|
|
4083
4136
|
className: styles_components_module.gridCard ?? '',
|
|
4084
4137
|
style: {
|
|
4085
|
-
padding: '
|
|
4138
|
+
padding: '8px 10px',
|
|
4086
4139
|
minHeight: 'auto',
|
|
4087
4140
|
flexDirection: 'column',
|
|
4088
4141
|
alignItems: 'flex-start',
|
|
4089
|
-
gap: '
|
|
4142
|
+
gap: '2px'
|
|
4090
4143
|
},
|
|
4091
4144
|
children: [
|
|
4092
4145
|
renderer_span({
|
|
@@ -4107,6 +4160,253 @@ function createCompactInfoCard(label, value) {
|
|
|
4107
4160
|
]
|
|
4108
4161
|
});
|
|
4109
4162
|
}
|
|
4163
|
+
function renderPolicyPanel(container, options) {
|
|
4164
|
+
const { getState } = options;
|
|
4165
|
+
renderer_clearElement(container);
|
|
4166
|
+
const state = getState();
|
|
4167
|
+
if (!state) return void container.appendChild(createDisconnectedState());
|
|
4168
|
+
const initData = state.lastBannerFetchData;
|
|
4169
|
+
const activePolicy = initData?.policy;
|
|
4170
|
+
const policyDecision = initData?.policyDecision;
|
|
4171
|
+
const initSource = init_source_formatInitSource(state.initDataSource, state.initDataSourceDetail);
|
|
4172
|
+
container.appendChild(createMatchTraceSection({
|
|
4173
|
+
policyDecision,
|
|
4174
|
+
policyId: activePolicy?.id ?? policyDecision?.policyId
|
|
4175
|
+
}));
|
|
4176
|
+
if (!activePolicy && !policyDecision) return void container.appendChild(createSection({
|
|
4177
|
+
title: 'Policy',
|
|
4178
|
+
children: [
|
|
4179
|
+
renderer_div({
|
|
4180
|
+
style: {
|
|
4181
|
+
padding: '10px 12px',
|
|
4182
|
+
fontSize: 'var(--c15t-devtools-font-size-sm)',
|
|
4183
|
+
color: 'var(--c15t-text-muted)'
|
|
4184
|
+
},
|
|
4185
|
+
text: 'No active policy matched for this request.'
|
|
4186
|
+
}),
|
|
4187
|
+
createHint(`Init Source: ${initSource}`)
|
|
4188
|
+
]
|
|
4189
|
+
}));
|
|
4190
|
+
container.appendChild(createSection({
|
|
4191
|
+
title: 'Policy',
|
|
4192
|
+
children: [
|
|
4193
|
+
policy_createGrid(3, [
|
|
4194
|
+
createCard('ID', activePolicy?.id ?? policyDecision?.policyId ?? '—'),
|
|
4195
|
+
createCard('Model', policy_getModelLabel(activePolicy?.model)),
|
|
4196
|
+
createCard('Scope', getScopeModeLabel(activePolicy?.consent?.scopeMode ?? state.policyScopeMode)),
|
|
4197
|
+
createCard('Categories', formatList(state.policyCategories ?? activePolicy?.consent?.categories)),
|
|
4198
|
+
createCard('Preselected', formatList(activePolicy?.consent?.preselectedCategories)),
|
|
4199
|
+
createCard('Expiry', 'number' == typeof activePolicy?.consent?.expiryDays ? `${activePolicy.consent.expiryDays}d` : '—')
|
|
4200
|
+
]),
|
|
4201
|
+
createHint(`${initSource} · ${formatFingerprint(policyDecision?.fingerprint)}`)
|
|
4202
|
+
]
|
|
4203
|
+
}));
|
|
4204
|
+
const uiMode = activePolicy?.ui?.mode;
|
|
4205
|
+
if (uiMode && 'none' !== uiMode) {
|
|
4206
|
+
const bannerCards = buildSurfaceCards('Banner', activePolicy?.ui?.banner, state.policyBanner);
|
|
4207
|
+
const dialogCards = buildSurfaceCards('Dialog', activePolicy?.ui?.dialog, state.policyDialog);
|
|
4208
|
+
if (bannerCards.length > 0 || dialogCards.length > 0) container.appendChild(createSection({
|
|
4209
|
+
title: `UI · ${uiMode}`,
|
|
4210
|
+
children: [
|
|
4211
|
+
policy_createGrid(3, [
|
|
4212
|
+
...bannerCards,
|
|
4213
|
+
...dialogCards
|
|
4214
|
+
])
|
|
4215
|
+
]
|
|
4216
|
+
}));
|
|
4217
|
+
}
|
|
4218
|
+
const proofLabel = formatProofSummary(activePolicy?.proof);
|
|
4219
|
+
const snapshotLabel = initData?.policySnapshotToken ? 'present' : 'missing';
|
|
4220
|
+
container.appendChild(createSection({
|
|
4221
|
+
title: 'Proof & Snapshot',
|
|
4222
|
+
children: [
|
|
4223
|
+
policy_createGrid(3, [
|
|
4224
|
+
createCard('Proof', proofLabel),
|
|
4225
|
+
createCard('Snapshot', snapshotLabel),
|
|
4226
|
+
createCard('I18n', activePolicy?.i18n?.messageProfile ?? activePolicy?.i18n?.language ?? '—')
|
|
4227
|
+
])
|
|
4228
|
+
]
|
|
4229
|
+
}));
|
|
4230
|
+
}
|
|
4231
|
+
function buildSurfaceCards(prefix, policySurface, storeSurface) {
|
|
4232
|
+
const policyLayout = Array.isArray(policySurface?.layout) && 0 === policySurface.layout.length ? null : policySurface?.layout ?? null;
|
|
4233
|
+
const storeLayout = Array.isArray(storeSurface.layout) && 0 === storeSurface.layout.length ? null : storeSurface.layout ?? null;
|
|
4234
|
+
const actions = formatList(policySurface?.allowedActions ?? storeSurface.allowedActions);
|
|
4235
|
+
const primary = policySurface?.primaryAction ?? storeSurface.primaryAction ?? null;
|
|
4236
|
+
const layout = policyLayout ?? storeLayout;
|
|
4237
|
+
const direction = policySurface?.direction ?? storeSurface.direction ?? null;
|
|
4238
|
+
const profile = policySurface?.uiProfile ?? storeSurface.uiProfile ?? null;
|
|
4239
|
+
const scrollLock = policySurface?.scrollLock ?? storeSurface.scrollLock ?? null;
|
|
4240
|
+
if ('—' === actions && !primary && !layout && !direction && !profile && null === scrollLock) return [];
|
|
4241
|
+
const cards = [
|
|
4242
|
+
createCard(`${prefix} Actions`, actions)
|
|
4243
|
+
];
|
|
4244
|
+
if (primary) cards.push(createCard(`${prefix} Primary`, primary));
|
|
4245
|
+
if (layout) cards.push(createCard(`${prefix} Layout`, Array.isArray(layout) ? layout.map((group)=>Array.isArray(group) ? `[${group.join(', ')}]` : group).join(' / ') : layout));
|
|
4246
|
+
if (direction) cards.push(createCard(`${prefix} Direction`, direction));
|
|
4247
|
+
if (profile) cards.push(createCard(`${prefix} Profile`, profile));
|
|
4248
|
+
if (null !== scrollLock) cards.push(createCard(`${prefix} Scroll Lock`, scrollLock ? 'on' : 'off'));
|
|
4249
|
+
return cards;
|
|
4250
|
+
}
|
|
4251
|
+
function createMatchTraceSection(options) {
|
|
4252
|
+
const { policyDecision, policyId } = options;
|
|
4253
|
+
const entries = buildTraceEntries(policyDecision, policyId);
|
|
4254
|
+
return createSection({
|
|
4255
|
+
title: 'Match Trace',
|
|
4256
|
+
children: [
|
|
4257
|
+
renderer_div({
|
|
4258
|
+
style: {
|
|
4259
|
+
display: 'grid',
|
|
4260
|
+
gridTemplateColumns: '1fr',
|
|
4261
|
+
gap: '4px'
|
|
4262
|
+
},
|
|
4263
|
+
children: entries.map((entry)=>renderer_div({
|
|
4264
|
+
className: styles_components_module.gridCard ?? '',
|
|
4265
|
+
style: {
|
|
4266
|
+
padding: '6px 10px',
|
|
4267
|
+
display: 'flex',
|
|
4268
|
+
alignItems: 'center',
|
|
4269
|
+
justifyContent: 'space-between',
|
|
4270
|
+
gap: '10px'
|
|
4271
|
+
},
|
|
4272
|
+
children: [
|
|
4273
|
+
renderer_span({
|
|
4274
|
+
style: {
|
|
4275
|
+
fontSize: 'var(--c15t-devtools-font-size-xs)',
|
|
4276
|
+
color: 'var(--c15t-text-muted)',
|
|
4277
|
+
fontFamily: 'ui-monospace, monospace'
|
|
4278
|
+
},
|
|
4279
|
+
text: entry.step
|
|
4280
|
+
}),
|
|
4281
|
+
renderer_span({
|
|
4282
|
+
style: {
|
|
4283
|
+
fontSize: 'var(--c15t-devtools-font-size-xs)',
|
|
4284
|
+
fontFamily: 'ui-monospace, monospace'
|
|
4285
|
+
},
|
|
4286
|
+
text: entry.result
|
|
4287
|
+
})
|
|
4288
|
+
]
|
|
4289
|
+
}))
|
|
4290
|
+
}),
|
|
4291
|
+
createHint('region → country → default · fallback on geo failure · Simulate via Location tab')
|
|
4292
|
+
]
|
|
4293
|
+
});
|
|
4294
|
+
}
|
|
4295
|
+
function buildTraceEntries(decision, policyId) {
|
|
4296
|
+
if (!decision) return [
|
|
4297
|
+
{
|
|
4298
|
+
step: 'decision metadata',
|
|
4299
|
+
result: 'UNAVAILABLE'
|
|
4300
|
+
}
|
|
4301
|
+
];
|
|
4302
|
+
const country = decision.country ?? 'n/a';
|
|
4303
|
+
const regionKey = decision.country && decision.region ? `${decision.country}-${decision.region}` : 'n/a';
|
|
4304
|
+
const resolved = policyId ?? decision.policyId ?? 'unknown';
|
|
4305
|
+
const matched = decision.matchedBy;
|
|
4306
|
+
return [
|
|
4307
|
+
{
|
|
4308
|
+
step: `region(${regionKey})`,
|
|
4309
|
+
result: 'region' === matched ? `MATCH → ${resolved}` : 'MISS'
|
|
4310
|
+
},
|
|
4311
|
+
{
|
|
4312
|
+
step: `country(${country})`,
|
|
4313
|
+
result: 'country' === matched ? `MATCH → ${resolved}` : 'region' === matched ? 'SKIPPED' : 'MISS'
|
|
4314
|
+
},
|
|
4315
|
+
{
|
|
4316
|
+
step: 'fallback(geo-fail)',
|
|
4317
|
+
result: 'fallback' === matched ? `MATCH → ${resolved}` : 'SKIPPED'
|
|
4318
|
+
},
|
|
4319
|
+
{
|
|
4320
|
+
step: 'default(catch-all)',
|
|
4321
|
+
result: 'default' === matched ? `MATCH → ${resolved}` : 'SKIPPED'
|
|
4322
|
+
}
|
|
4323
|
+
];
|
|
4324
|
+
}
|
|
4325
|
+
function policy_getModelLabel(model) {
|
|
4326
|
+
switch(model){
|
|
4327
|
+
case 'opt-in':
|
|
4328
|
+
return 'Opt-In';
|
|
4329
|
+
case 'opt-out':
|
|
4330
|
+
return 'Opt-Out';
|
|
4331
|
+
case 'iab':
|
|
4332
|
+
return 'IAB TCF';
|
|
4333
|
+
default:
|
|
4334
|
+
return 'None';
|
|
4335
|
+
}
|
|
4336
|
+
}
|
|
4337
|
+
function getScopeModeLabel(mode) {
|
|
4338
|
+
switch(mode){
|
|
4339
|
+
case 'strict':
|
|
4340
|
+
return 'Strict';
|
|
4341
|
+
case 'permissive':
|
|
4342
|
+
return 'Permissive';
|
|
4343
|
+
default:
|
|
4344
|
+
return '—';
|
|
4345
|
+
}
|
|
4346
|
+
}
|
|
4347
|
+
function formatList(items) {
|
|
4348
|
+
if (!items || 0 === items.length) return '—';
|
|
4349
|
+
if (items.includes('*')) return '* (all)';
|
|
4350
|
+
return items.join(', ');
|
|
4351
|
+
}
|
|
4352
|
+
function formatProofSummary(proof) {
|
|
4353
|
+
if (!proof) return '—';
|
|
4354
|
+
const parts = [];
|
|
4355
|
+
if (proof.storeIp) parts.push('IP');
|
|
4356
|
+
if (proof.storeUserAgent) parts.push('UA');
|
|
4357
|
+
if (proof.storeLanguage) parts.push('Lang');
|
|
4358
|
+
return parts.length > 0 ? parts.join(', ') : 'none';
|
|
4359
|
+
}
|
|
4360
|
+
function formatFingerprint(fingerprint) {
|
|
4361
|
+
if (!fingerprint) return 'no fingerprint';
|
|
4362
|
+
if (fingerprint.length <= 12) return fingerprint;
|
|
4363
|
+
return `${fingerprint.slice(0, 8)}…${fingerprint.slice(-4)}`;
|
|
4364
|
+
}
|
|
4365
|
+
function createCard(label, value) {
|
|
4366
|
+
return renderer_div({
|
|
4367
|
+
className: styles_components_module.gridCard ?? '',
|
|
4368
|
+
style: {
|
|
4369
|
+
padding: '8px 10px',
|
|
4370
|
+
minHeight: 'auto',
|
|
4371
|
+
flexDirection: 'column',
|
|
4372
|
+
alignItems: 'flex-start',
|
|
4373
|
+
gap: '2px'
|
|
4374
|
+
},
|
|
4375
|
+
children: [
|
|
4376
|
+
renderer_span({
|
|
4377
|
+
style: {
|
|
4378
|
+
fontSize: 'var(--c15t-devtools-font-size-xs)',
|
|
4379
|
+
color: 'var(--c15t-text-muted)'
|
|
4380
|
+
},
|
|
4381
|
+
text: label
|
|
4382
|
+
}),
|
|
4383
|
+
renderer_span({
|
|
4384
|
+
style: {
|
|
4385
|
+
fontSize: 'var(--c15t-font-size-sm)',
|
|
4386
|
+
fontWeight: '500',
|
|
4387
|
+
fontFamily: 'ui-monospace, monospace'
|
|
4388
|
+
},
|
|
4389
|
+
text: value
|
|
4390
|
+
})
|
|
4391
|
+
]
|
|
4392
|
+
});
|
|
4393
|
+
}
|
|
4394
|
+
function policy_createGrid(columns, children) {
|
|
4395
|
+
return renderer_div({
|
|
4396
|
+
style: {
|
|
4397
|
+
display: 'grid',
|
|
4398
|
+
gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,
|
|
4399
|
+
gap: 'var(--c15t-space-sm, 0.5rem)'
|
|
4400
|
+
},
|
|
4401
|
+
children
|
|
4402
|
+
});
|
|
4403
|
+
}
|
|
4404
|
+
function createHint(text) {
|
|
4405
|
+
return renderer_span({
|
|
4406
|
+
className: styles_components_module.overrideHint,
|
|
4407
|
+
text
|
|
4408
|
+
});
|
|
4409
|
+
}
|
|
4110
4410
|
const dismissedResources = new Set();
|
|
4111
4411
|
function scanDOM(state) {
|
|
4112
4412
|
const results = [];
|
|
@@ -4745,6 +5045,11 @@ function panel_renderer_createPanelRenderer(config) {
|
|
|
4745
5045
|
}
|
|
4746
5046
|
});
|
|
4747
5047
|
break;
|
|
5048
|
+
case 'policy':
|
|
5049
|
+
renderPolicyPanel(container, {
|
|
5050
|
+
getState: getStoreState
|
|
5051
|
+
});
|
|
5052
|
+
break;
|
|
4748
5053
|
case "scripts":
|
|
4749
5054
|
renderScriptsPanel(container, {
|
|
4750
5055
|
getState: getStoreState,
|
|
@@ -4881,7 +5186,7 @@ function persistEvents(events) {
|
|
|
4881
5186
|
} catch {}
|
|
4882
5187
|
}
|
|
4883
5188
|
function isDevToolsTab(value) {
|
|
4884
|
-
return 'consents' === value || 'location' === value || "scripts" === value || 'iab' === value || 'events' === value || 'actions' === value;
|
|
5189
|
+
return 'consents' === value || 'location' === value || 'policy' === value || "scripts" === value || 'iab' === value || 'events' === value || 'actions' === value;
|
|
4885
5190
|
}
|
|
4886
5191
|
function loadPersistedActiveTab() {
|
|
4887
5192
|
if ('undefined' == typeof window) return null;
|
|
@@ -43,4 +43,3 @@ export interface DropdownMenuInstance {
|
|
|
43
43
|
export declare function createDropdownMenu(options: DropdownMenuOptions): DropdownMenuInstance;
|
|
44
44
|
export { detectPreferenceTrigger as detectPreferenceCenterTrigger, getPreferenceCenterOpener, } from '../utils/preference-trigger';
|
|
45
45
|
export { DEVTOOLS_ICON, PREFERENCES_ICON, EYE_ICON };
|
|
46
|
-
//# sourceMappingURL=dropdown-menu.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConsentStoreState } from '
|
|
1
|
+
import type { ConsentStoreState } from '../../../core/dist-types/index.d.ts';
|
|
2
2
|
import type { DevToolsState, EventLogEntry } from './state-manager';
|
|
3
3
|
import type { ConnectionDiagnostics } from './store-connector';
|
|
4
4
|
export interface DebugBundlePayload {
|
|
@@ -11,4 +11,3 @@ export interface DebugBundlePayload {
|
|
|
11
11
|
export declare function createDebugBundle(payload: DebugBundlePayload): string;
|
|
12
12
|
export declare function sanitizeStoreState(state: ConsentStoreState | null): Record<string, unknown> | null;
|
|
13
13
|
export declare function downloadDebugBundle(content: string): void;
|
|
14
|
-
//# sourceMappingURL=debug-bundle.d.ts.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { ConsentStoreState } from '
|
|
1
|
+
import type { ConsentStoreState } from '../../../core/dist-types/index.d.ts';
|
|
2
2
|
export type PersistedDevToolsOverrides = Pick<NonNullable<ConsentStoreState['overrides']>, 'country' | 'region' | 'language' | 'gpc'>;
|
|
3
3
|
export declare function hasPersistedOverrides(overrides: PersistedDevToolsOverrides): boolean;
|
|
4
4
|
export declare function loadPersistedOverrides(storageKey?: string): PersistedDevToolsOverrides | null;
|
|
5
5
|
export declare function persistOverrides(overrides: PersistedDevToolsOverrides, storageKey?: string): void;
|
|
6
6
|
export declare function clearPersistedOverrides(storageKey?: string): void;
|
|
7
|
-
//# sourceMappingURL=override-storage.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Panel Renderer
|
|
3
3
|
* Shared logic for rendering DevTools panels
|
|
4
4
|
*/
|
|
5
|
-
import type { ConsentStoreState } from '
|
|
5
|
+
import type { ConsentStoreState } from '../../../core/dist-types/index.d.ts';
|
|
6
6
|
import type { PersistedDevToolsOverrides } from './override-storage';
|
|
7
7
|
import type { DevToolsTab, StateManager } from './state-manager';
|
|
8
8
|
import type { StoreConnector } from './store-connector';
|
|
@@ -43,4 +43,3 @@ export interface PanelRenderer {
|
|
|
43
43
|
* Creates a panel renderer with shared logic for rendering DevTools panels
|
|
44
44
|
*/
|
|
45
45
|
export declare function createPanelRenderer(config: PanelRendererConfig): PanelRenderer;
|
|
46
|
-
//# sourceMappingURL=panel-renderer.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Reset Consents Utility
|
|
3
3
|
* Centralized logic for resetting all consent data
|
|
4
4
|
*/
|
|
5
|
-
import type { ConsentStoreState } from '
|
|
5
|
+
import type { ConsentStoreState } from '../../../core/dist-types/index.d.ts';
|
|
6
6
|
import type { StoreApi } from 'zustand/vanilla';
|
|
7
7
|
import type { StateManager } from './state-manager';
|
|
8
8
|
/**
|
|
@@ -21,4 +21,3 @@ export declare function resetAllConsents(store: StoreApi<ConsentStoreState>, sta
|
|
|
21
21
|
* This is a convenience wrapper for use in panel callbacks
|
|
22
22
|
*/
|
|
23
23
|
export declare function createResetHandler(getStore: () => StoreApi<ConsentStoreState> | null, stateManager?: StateManager): () => Promise<void>;
|
|
24
|
-
//# sourceMappingURL=reset-consents.d.ts.map
|
|
@@ -9,7 +9,7 @@ export type DevToolsPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 't
|
|
|
9
9
|
/**
|
|
10
10
|
* Available tabs in the DevTools
|
|
11
11
|
*/
|
|
12
|
-
export type DevToolsTab = 'consents' | 'location' | 'scripts' | 'iab' | 'events' | 'actions';
|
|
12
|
+
export type DevToolsTab = 'consents' | 'location' | 'policy' | 'scripts' | 'iab' | 'events' | 'actions';
|
|
13
13
|
/**
|
|
14
14
|
* Event log entry for debugging
|
|
15
15
|
*/
|
|
@@ -70,4 +70,3 @@ export interface StateManager {
|
|
|
70
70
|
/** Cleanup */
|
|
71
71
|
destroy: () => void;
|
|
72
72
|
}
|
|
73
|
-
//# sourceMappingURL=state-manager.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Store Connector
|
|
3
3
|
* Connects to the c15tStore exposed on the window object
|
|
4
4
|
*/
|
|
5
|
-
import type { ConsentStoreState } from '
|
|
5
|
+
import type { ConsentStoreState } from '../../../core/dist-types/index.d.ts';
|
|
6
6
|
import type { StoreApi } from 'zustand/vanilla';
|
|
7
7
|
/**
|
|
8
8
|
* Options for creating a store connector
|
|
@@ -86,4 +86,3 @@ export declare function getC15tStore(namespace?: string): StoreApi<ConsentStoreS
|
|
|
86
86
|
* Check if the c15t store is available
|
|
87
87
|
*/
|
|
88
88
|
export declare function isC15tStoreAvailable(namespace?: string): boolean;
|
|
89
|
-
//# sourceMappingURL=store-connector.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConsentStoreState } from '
|
|
1
|
+
import type { ConsentStoreState } from '../../../core/dist-types/index.d.ts';
|
|
2
2
|
import type { StoreApi } from 'zustand/vanilla';
|
|
3
3
|
import type { EventLogEntry } from './state-manager';
|
|
4
4
|
type InstrumentationEvent = Omit<EventLogEntry, 'id' | 'timestamp'>;
|
|
@@ -10,4 +10,3 @@ interface InstrumentationOptions {
|
|
|
10
10
|
}
|
|
11
11
|
export declare function registerStoreInstrumentation(options: InstrumentationOptions): () => void;
|
|
12
12
|
export {};
|
|
13
|
-
//# sourceMappingURL=store-instrumentation.d.ts.map
|
|
@@ -8,4 +8,3 @@
|
|
|
8
8
|
export { createDevTools, createDevToolsPanel, type DevToolsInstance, type DevToolsOptions, } from './core/devtools';
|
|
9
9
|
export type { DevToolsPosition, DevToolsState, DevToolsTab, } from './core/state-manager';
|
|
10
10
|
export { createStoreConnector, getC15tStore, isC15tStoreAvailable, type StoreConnector, type StoreConnectorOptions, } from './core/store-connector';
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Actions Panel
|
|
3
3
|
* Quick actions for developers
|
|
4
4
|
*/
|
|
5
|
-
import type { ConsentStoreState } from '
|
|
5
|
+
import type { ConsentStoreState } from '../../../core/dist-types/index.d.ts';
|
|
6
6
|
export interface ActionsPanelOptions {
|
|
7
7
|
getState: () => ConsentStoreState | null;
|
|
8
8
|
onResetConsents: () => void;
|
|
@@ -16,4 +16,3 @@ export interface ActionsPanelOptions {
|
|
|
16
16
|
* Renders the actions panel content
|
|
17
17
|
*/
|
|
18
18
|
export declare function renderActionsPanel(container: HTMLElement, options: ActionsPanelOptions): void;
|
|
19
|
-
//# sourceMappingURL=actions.d.ts.map
|