@c15t/dev-tools 2.0.0-rc.6 → 2.0.0-rc.8
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/dist/379.js +279 -11
- package/dist/index.cjs +279 -11
- package/dist/react.cjs +270 -11
- package/dist/tanstack.cjs +269 -10
- package/dist-types/core/debug-bundle.d.ts +1 -1
- package/dist-types/core/override-storage.d.ts +1 -1
- package/dist-types/core/panel-renderer.d.ts +1 -1
- package/dist-types/core/reset-consents.d.ts +1 -1
- package/dist-types/core/state-manager.d.ts +1 -1
- package/dist-types/core/store-connector.d.ts +1 -1
- package/dist-types/core/store-instrumentation.d.ts +1 -1
- package/dist-types/panels/actions.d.ts +1 -1
- package/dist-types/panels/consents.d.ts +1 -1
- package/dist-types/panels/dom-scanner.d.ts +1 -1
- package/dist-types/panels/iab.d.ts +1 -1
- package/dist-types/panels/location.d.ts +1 -1
- package/dist-types/panels/policy.d.ts +1 -1
- package/dist-types/panels/scripts.d.ts +1 -1
- package/dist-types/utils/init-source.d.ts +1 -1
- package/dist-types/version.d.ts +1 -1
- package/package.json +3 -3
package/dist/tanstack.cjs
CHANGED
|
@@ -1966,6 +1966,7 @@ var __webpack_exports__ = {};
|
|
|
1966
1966
|
__webpack_require__.d(__webpack_exports__, {
|
|
1967
1967
|
c15tDevtoolsPlugin: ()=>c15tDevtoolsPlugin
|
|
1968
1968
|
});
|
|
1969
|
+
const external_c15t_namespaceObject = require("c15t");
|
|
1969
1970
|
var injectStylesIntoStyleTag = __webpack_require__("../../node_modules/.bun/@rsbuild+core@2.0.0-beta.11+490411ac90707e06/node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js");
|
|
1970
1971
|
var injectStylesIntoStyleTag_default = /*#__PURE__*/ __webpack_require__.n(injectStylesIntoStyleTag);
|
|
1971
1972
|
var styleDomAPI = __webpack_require__("../../node_modules/.bun/@rsbuild+core@2.0.0-beta.11+490411ac90707e06/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js");
|
|
@@ -3258,7 +3259,8 @@ var __webpack_exports__ = {};
|
|
|
3258
3259
|
'error',
|
|
3259
3260
|
'consent',
|
|
3260
3261
|
'network',
|
|
3261
|
-
'iab'
|
|
3262
|
+
'iab',
|
|
3263
|
+
"script"
|
|
3262
3264
|
];
|
|
3263
3265
|
function createFilterButton(filter, active, onClick) {
|
|
3264
3266
|
return createButton({
|
|
@@ -3273,6 +3275,7 @@ var __webpack_exports__ = {};
|
|
|
3273
3275
|
if ('error' === filter) return 'error' === event.type;
|
|
3274
3276
|
if ('consent' === filter) return 'consent_set' === event.type || 'consent_save' === event.type || 'consent_reset' === event.type;
|
|
3275
3277
|
if ('network' === filter) return 'network' === event.type;
|
|
3278
|
+
if ("script" === filter) return "script" === event.type;
|
|
3276
3279
|
return 'iab' === event.type;
|
|
3277
3280
|
}
|
|
3278
3281
|
function matchesSearch(event, query) {
|
|
@@ -3396,6 +3399,8 @@ var __webpack_exports__ = {};
|
|
|
3396
3399
|
return '◉';
|
|
3397
3400
|
case 'iab':
|
|
3398
3401
|
return '◆';
|
|
3402
|
+
case "script":
|
|
3403
|
+
return '⌘';
|
|
3399
3404
|
default:
|
|
3400
3405
|
return '○';
|
|
3401
3406
|
}
|
|
@@ -3413,6 +3418,8 @@ var __webpack_exports__ = {};
|
|
|
3413
3418
|
return 'var(--c15t-devtools-badge-warning, #f59e0b)';
|
|
3414
3419
|
case 'iab':
|
|
3415
3420
|
return 'var(--c15t-devtools-badge-info, #3b82f6)';
|
|
3421
|
+
case "script":
|
|
3422
|
+
return 'var(--c15t-devtools-badge-info, #14b8a6)';
|
|
3416
3423
|
default:
|
|
3417
3424
|
return 'var(--c15t-text-muted)';
|
|
3418
3425
|
}
|
|
@@ -4734,6 +4741,20 @@ var __webpack_exports__ = {};
|
|
|
4734
4741
|
<polyline points="8 6 2 12 8 18"></polyline>
|
|
4735
4742
|
</svg>`;
|
|
4736
4743
|
const scriptsSearchByContainer = new WeakMap();
|
|
4744
|
+
const expandedScriptsByContainer = new WeakMap();
|
|
4745
|
+
const CHEVRON_DOWN_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">
|
|
4746
|
+
<polyline points="6 9 12 15 18 9"></polyline>
|
|
4747
|
+
</svg>`;
|
|
4748
|
+
const CHEVRON_RIGHT_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">
|
|
4749
|
+
<polyline points="9 18 15 12 9 6"></polyline>
|
|
4750
|
+
</svg>`;
|
|
4751
|
+
function getExpandedScripts(container) {
|
|
4752
|
+
const existing = expandedScriptsByContainer.get(container);
|
|
4753
|
+
if (existing) return existing;
|
|
4754
|
+
const expanded = new Set();
|
|
4755
|
+
expandedScriptsByContainer.set(container, expanded);
|
|
4756
|
+
return expanded;
|
|
4757
|
+
}
|
|
4737
4758
|
function renderScriptsPanel(container, options) {
|
|
4738
4759
|
const { getState, getEvents } = options;
|
|
4739
4760
|
renderer_clearElement(container);
|
|
@@ -4795,6 +4816,10 @@ var __webpack_exports__ = {};
|
|
|
4795
4816
|
for (const script of filteredScripts){
|
|
4796
4817
|
const scriptId = script.id;
|
|
4797
4818
|
const isLoaded = true === loadedScripts[scriptId];
|
|
4819
|
+
const scriptEvents = getScriptActivityEvents(events, scriptId);
|
|
4820
|
+
const latestActivity = scriptEvents[scriptEvents.length - 1];
|
|
4821
|
+
const expandedScripts = getExpandedScripts(container);
|
|
4822
|
+
const isExpanded = expandedScripts.has(scriptId);
|
|
4798
4823
|
const category = script.category;
|
|
4799
4824
|
const categoryDisplay = 'string' == typeof category ? category : JSON.stringify(category);
|
|
4800
4825
|
let status = 'pending';
|
|
@@ -4816,7 +4841,7 @@ var __webpack_exports__ = {};
|
|
|
4816
4841
|
text: status.charAt(0).toUpperCase() + status.slice(1),
|
|
4817
4842
|
variant: statusVariant
|
|
4818
4843
|
});
|
|
4819
|
-
const
|
|
4844
|
+
const header = renderer_div({
|
|
4820
4845
|
style: {
|
|
4821
4846
|
display: 'flex',
|
|
4822
4847
|
alignItems: 'center',
|
|
@@ -4855,19 +4880,57 @@ var __webpack_exports__ = {};
|
|
|
4855
4880
|
whiteSpace: 'nowrap'
|
|
4856
4881
|
},
|
|
4857
4882
|
text: `Category: ${categoryDisplay}`
|
|
4858
|
-
})
|
|
4883
|
+
}),
|
|
4884
|
+
...latestActivity && scriptEvents.length > 0 ? [
|
|
4885
|
+
renderer_div({
|
|
4886
|
+
style: {
|
|
4887
|
+
fontSize: 'var(--c15t-devtools-font-size-xs)',
|
|
4888
|
+
color: 'var(--c15t-text-muted)',
|
|
4889
|
+
overflow: 'hidden',
|
|
4890
|
+
textOverflow: 'ellipsis',
|
|
4891
|
+
whiteSpace: 'nowrap'
|
|
4892
|
+
},
|
|
4893
|
+
text: `Activity: ${latestActivity.message} (${scriptEvents.length} event${1 === scriptEvents.length ? '' : 's'})`
|
|
4894
|
+
})
|
|
4895
|
+
] : []
|
|
4859
4896
|
]
|
|
4860
4897
|
}),
|
|
4861
4898
|
renderer_div({
|
|
4862
4899
|
style: {
|
|
4863
|
-
flexShrink: '0'
|
|
4900
|
+
flexShrink: '0',
|
|
4901
|
+
display: 'flex',
|
|
4902
|
+
alignItems: 'center',
|
|
4903
|
+
gap: '8px'
|
|
4864
4904
|
},
|
|
4865
4905
|
children: [
|
|
4866
|
-
badge
|
|
4906
|
+
badge,
|
|
4907
|
+
...scriptEvents.length > 0 ? [
|
|
4908
|
+
createAccordionToggle({
|
|
4909
|
+
scriptId,
|
|
4910
|
+
isExpanded,
|
|
4911
|
+
onToggle: ()=>{
|
|
4912
|
+
if (isExpanded) expandedScripts.delete(scriptId);
|
|
4913
|
+
else expandedScripts.add(scriptId);
|
|
4914
|
+
renderScriptsPanel(container, options);
|
|
4915
|
+
}
|
|
4916
|
+
})
|
|
4917
|
+
] : []
|
|
4867
4918
|
]
|
|
4868
4919
|
})
|
|
4869
4920
|
]
|
|
4870
4921
|
});
|
|
4922
|
+
const details = isExpanded && scriptEvents.length > 0 ? createScriptActivityDetails(scriptEvents) : null;
|
|
4923
|
+
const row = renderer_div({
|
|
4924
|
+
style: {
|
|
4925
|
+
display: 'flex',
|
|
4926
|
+
flexDirection: 'column',
|
|
4927
|
+
borderBottom: '1px solid var(--c15t-border)'
|
|
4928
|
+
},
|
|
4929
|
+
children: [
|
|
4930
|
+
header,
|
|
4931
|
+
details
|
|
4932
|
+
]
|
|
4933
|
+
});
|
|
4871
4934
|
scriptsList.appendChild(row);
|
|
4872
4935
|
}
|
|
4873
4936
|
const lastRow = scriptsList.lastElementChild;
|
|
@@ -5004,13 +5067,172 @@ var __webpack_exports__ = {};
|
|
|
5004
5067
|
return 'string' == typeof url ? url : event.message;
|
|
5005
5068
|
}
|
|
5006
5069
|
function formatEventTime(timestamp) {
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5070
|
+
const date = new Date(timestamp);
|
|
5071
|
+
const hours = String(date.getHours()).padStart(2, '0');
|
|
5072
|
+
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
5073
|
+
const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
5074
|
+
const milliseconds = String(date.getMilliseconds()).padStart(3, '0');
|
|
5075
|
+
return `${hours}:${minutes}:${seconds}.${milliseconds}`;
|
|
5076
|
+
}
|
|
5077
|
+
function getScriptActivityEvents(events, scriptId) {
|
|
5078
|
+
return events.filter((event)=>{
|
|
5079
|
+
if ("script" !== event.type) return false;
|
|
5080
|
+
const data = event.data;
|
|
5081
|
+
if (data?.scriptId !== scriptId) return false;
|
|
5082
|
+
return data?.scope === 'lifecycle' || data?.scope === 'phase';
|
|
5083
|
+
}).sort((left, right)=>left.timestamp - right.timestamp);
|
|
5084
|
+
}
|
|
5085
|
+
function createAccordionToggle(options) {
|
|
5086
|
+
const { scriptId, isExpanded, onToggle } = options;
|
|
5087
|
+
const toggle = renderer_button({
|
|
5088
|
+
ariaLabel: `${isExpanded ? 'Collapse' : 'Expand'} ${scriptId} activity`,
|
|
5089
|
+
ariaExpanded: isExpanded ? 'true' : 'false',
|
|
5090
|
+
style: {
|
|
5091
|
+
display: 'inline-flex',
|
|
5092
|
+
alignItems: 'center',
|
|
5093
|
+
justifyContent: 'center',
|
|
5094
|
+
width: '24px',
|
|
5095
|
+
height: '24px',
|
|
5096
|
+
padding: '0',
|
|
5097
|
+
border: '1px solid var(--c15t-border)',
|
|
5098
|
+
borderRadius: '6px',
|
|
5099
|
+
background: 'transparent',
|
|
5100
|
+
color: 'var(--c15t-text-muted)',
|
|
5101
|
+
cursor: 'pointer',
|
|
5102
|
+
flexShrink: '0'
|
|
5103
|
+
},
|
|
5104
|
+
onClick: onToggle
|
|
5105
|
+
});
|
|
5106
|
+
toggle.innerHTML = isExpanded ? CHEVRON_DOWN_ICON : CHEVRON_RIGHT_ICON;
|
|
5107
|
+
return toggle;
|
|
5108
|
+
}
|
|
5109
|
+
function createScriptActivityDetails(events) {
|
|
5110
|
+
const groupedEvents = groupScriptActivityEvents(events.slice(-8));
|
|
5111
|
+
return renderer_div({
|
|
5112
|
+
style: {
|
|
5113
|
+
display: 'flex',
|
|
5114
|
+
flexDirection: 'column',
|
|
5115
|
+
gap: '6px',
|
|
5116
|
+
padding: '0 0 10px 0',
|
|
5117
|
+
marginLeft: '0'
|
|
5118
|
+
},
|
|
5119
|
+
children: groupedEvents.map(([groupName, groupEvents])=>createScriptActivityGroup(groupName, groupEvents))
|
|
5120
|
+
});
|
|
5121
|
+
}
|
|
5122
|
+
function createScriptActivityGroup(groupName, events) {
|
|
5123
|
+
return renderer_div({
|
|
5124
|
+
style: {
|
|
5125
|
+
display: 'flex',
|
|
5126
|
+
flexDirection: 'column',
|
|
5127
|
+
gap: '4px'
|
|
5128
|
+
},
|
|
5129
|
+
children: [
|
|
5130
|
+
renderer_span({
|
|
5131
|
+
style: {
|
|
5132
|
+
fontSize: 'var(--c15t-devtools-font-size-xs)',
|
|
5133
|
+
fontWeight: '600',
|
|
5134
|
+
color: 'var(--c15t-text)',
|
|
5135
|
+
textTransform: 'none'
|
|
5136
|
+
},
|
|
5137
|
+
text: groupName
|
|
5138
|
+
}),
|
|
5139
|
+
...events.map((event)=>createScriptActivityRow(event))
|
|
5140
|
+
]
|
|
5012
5141
|
});
|
|
5013
5142
|
}
|
|
5143
|
+
function createScriptActivityRow(event) {
|
|
5144
|
+
const data = event.data ?? {};
|
|
5145
|
+
const scope = 'string' == typeof data.scope ? data.scope : void 0;
|
|
5146
|
+
const phase = 'string' == typeof data.phase ? data.phase : void 0;
|
|
5147
|
+
const stepType = 'string' == typeof data.stepType ? data.stepType : void 0;
|
|
5148
|
+
const metadata = [
|
|
5149
|
+
scope,
|
|
5150
|
+
phase,
|
|
5151
|
+
stepType
|
|
5152
|
+
].filter(Boolean).join(' / ');
|
|
5153
|
+
return renderer_div({
|
|
5154
|
+
style: {
|
|
5155
|
+
display: 'flex',
|
|
5156
|
+
flexDirection: 'column',
|
|
5157
|
+
gap: '2px',
|
|
5158
|
+
padding: '6px 10px',
|
|
5159
|
+
marginLeft: '0',
|
|
5160
|
+
borderLeft: '2px solid var(--c15t-border)',
|
|
5161
|
+
backgroundColor: 'var(--c15t-devtools-surface-secondary, rgba(127,127,127,0.06))',
|
|
5162
|
+
borderRadius: '0 8px 8px 0'
|
|
5163
|
+
},
|
|
5164
|
+
children: [
|
|
5165
|
+
renderer_div({
|
|
5166
|
+
style: {
|
|
5167
|
+
display: 'flex',
|
|
5168
|
+
alignItems: 'center',
|
|
5169
|
+
justifyContent: 'space-between',
|
|
5170
|
+
gap: '8px'
|
|
5171
|
+
},
|
|
5172
|
+
children: [
|
|
5173
|
+
renderer_span({
|
|
5174
|
+
style: {
|
|
5175
|
+
fontSize: 'var(--c15t-devtools-font-size-xs)',
|
|
5176
|
+
fontWeight: '600',
|
|
5177
|
+
color: 'var(--c15t-text)'
|
|
5178
|
+
},
|
|
5179
|
+
text: event.message
|
|
5180
|
+
}),
|
|
5181
|
+
renderer_span({
|
|
5182
|
+
style: {
|
|
5183
|
+
fontSize: 'var(--c15t-devtools-font-size-xs)',
|
|
5184
|
+
color: 'var(--c15t-text-muted)',
|
|
5185
|
+
flexShrink: '0'
|
|
5186
|
+
},
|
|
5187
|
+
text: formatEventTime(event.timestamp)
|
|
5188
|
+
})
|
|
5189
|
+
]
|
|
5190
|
+
}),
|
|
5191
|
+
...metadata ? [
|
|
5192
|
+
renderer_span({
|
|
5193
|
+
style: {
|
|
5194
|
+
fontSize: 'var(--c15t-devtools-font-size-xs)',
|
|
5195
|
+
color: 'var(--c15t-text-muted)'
|
|
5196
|
+
},
|
|
5197
|
+
text: metadata
|
|
5198
|
+
})
|
|
5199
|
+
] : []
|
|
5200
|
+
]
|
|
5201
|
+
});
|
|
5202
|
+
}
|
|
5203
|
+
function groupScriptActivityEvents(events) {
|
|
5204
|
+
const groups = new Map();
|
|
5205
|
+
for (const event of events){
|
|
5206
|
+
const groupName = getScriptActivityGroupName(event);
|
|
5207
|
+
const existing = groups.get(groupName);
|
|
5208
|
+
if (existing) existing.push(event);
|
|
5209
|
+
else groups.set(groupName, [
|
|
5210
|
+
event
|
|
5211
|
+
]);
|
|
5212
|
+
}
|
|
5213
|
+
const orderedGroupNames = [
|
|
5214
|
+
'onBeforeLoad',
|
|
5215
|
+
'onLoad',
|
|
5216
|
+
'onConsentChange',
|
|
5217
|
+
'other'
|
|
5218
|
+
];
|
|
5219
|
+
return orderedGroupNames.map((groupName)=>{
|
|
5220
|
+
const groupEvents = groups.get(groupName);
|
|
5221
|
+
return groupEvents ? [
|
|
5222
|
+
groupName,
|
|
5223
|
+
groupEvents
|
|
5224
|
+
] : null;
|
|
5225
|
+
}).filter((group)=>null !== group);
|
|
5226
|
+
}
|
|
5227
|
+
function getScriptActivityGroupName(event) {
|
|
5228
|
+
const data = event.data ?? {};
|
|
5229
|
+
if ('string' == typeof data.callback) return data.callback;
|
|
5230
|
+
const phase = 'string' == typeof data.phase ? data.phase : '';
|
|
5231
|
+
if ('bootstrap' === phase || 'consent-default' === phase || 'setup' === phase || 'onBeforeLoadGranted' === phase || 'onBeforeLoadDenied' === phase) return 'onBeforeLoad';
|
|
5232
|
+
if ('afterLoad' === phase || 'onLoadGranted' === phase || 'onLoadDenied' === phase) return 'onLoad';
|
|
5233
|
+
if ('consent-update' === phase || 'onConsentChange' === phase || 'onConsentGranted' === phase || 'onConsentDenied' === phase) return 'onConsentChange';
|
|
5234
|
+
return 'other';
|
|
5235
|
+
}
|
|
5014
5236
|
function scripts_truncateText(text, maxLength) {
|
|
5015
5237
|
if (text.length <= maxLength) return text;
|
|
5016
5238
|
return `${text.slice(0, maxLength - 3)}...`;
|
|
@@ -5579,6 +5801,7 @@ var __webpack_exports__ = {};
|
|
|
5579
5801
|
const state = entry.store.getState();
|
|
5580
5802
|
state.setCallback('onBannerFetched', entry.originalCallbacks.onBannerFetched);
|
|
5581
5803
|
state.setCallback('onConsentSet', entry.originalCallbacks.onConsentSet);
|
|
5804
|
+
state.setCallback('onConsentChanged', entry.originalCallbacks.onConsentChanged);
|
|
5582
5805
|
state.setCallback('onError', entry.originalCallbacks.onError);
|
|
5583
5806
|
state.setCallback('onBeforeConsentRevocationReload', entry.originalCallbacks.onBeforeConsentRevocationReload);
|
|
5584
5807
|
const blocker = state.networkBlocker;
|
|
@@ -5616,6 +5839,14 @@ var __webpack_exports__ = {};
|
|
|
5616
5839
|
});
|
|
5617
5840
|
if ('function' == typeof entry.originalCallbacks.onConsentSet) entry.originalCallbacks.onConsentSet(payload);
|
|
5618
5841
|
});
|
|
5842
|
+
store.getState().setCallback('onConsentChanged', (payload)=>{
|
|
5843
|
+
emitEvent(entry, {
|
|
5844
|
+
type: 'consent_save',
|
|
5845
|
+
message: 'Consent preferences changed',
|
|
5846
|
+
data: payload
|
|
5847
|
+
});
|
|
5848
|
+
if ('function' == typeof entry.originalCallbacks.onConsentChanged) entry.originalCallbacks.onConsentChanged(payload);
|
|
5849
|
+
});
|
|
5619
5850
|
store.getState().setCallback('onError', (payload)=>{
|
|
5620
5851
|
const errorMessage = payload.error;
|
|
5621
5852
|
emitEvent(entry, {
|
|
@@ -5693,9 +5924,29 @@ var __webpack_exports__ = {};
|
|
|
5693
5924
|
loadedScripts: state.loadedScripts
|
|
5694
5925
|
};
|
|
5695
5926
|
}
|
|
5927
|
+
function scriptDebugEventToLogEntry(event) {
|
|
5928
|
+
return {
|
|
5929
|
+
type: "script",
|
|
5930
|
+
message: event.message,
|
|
5931
|
+
data: {
|
|
5932
|
+
...event.data ?? {},
|
|
5933
|
+
source: event.source,
|
|
5934
|
+
scope: event.scope,
|
|
5935
|
+
action: event.action,
|
|
5936
|
+
scriptId: event.scriptId,
|
|
5937
|
+
elementId: event.elementId,
|
|
5938
|
+
hasConsent: event.hasConsent,
|
|
5939
|
+
callback: event.callback,
|
|
5940
|
+
phase: event.phase,
|
|
5941
|
+
stepType: event.stepType,
|
|
5942
|
+
stepIndex: event.stepIndex
|
|
5943
|
+
}
|
|
5944
|
+
};
|
|
5945
|
+
}
|
|
5696
5946
|
function createDevToolsPanel(options) {
|
|
5697
5947
|
const { namespace = 'c15tStore' } = options;
|
|
5698
5948
|
let detachInstrumentation = null;
|
|
5949
|
+
let detachScriptDebug = null;
|
|
5699
5950
|
const stateManager = state_manager_createStateManager({
|
|
5700
5951
|
isOpen: true
|
|
5701
5952
|
});
|
|
@@ -5708,6 +5959,10 @@ var __webpack_exports__ = {};
|
|
|
5708
5959
|
store,
|
|
5709
5960
|
onEvent: (event)=>stateManager.addEvent(event)
|
|
5710
5961
|
});
|
|
5962
|
+
detachScriptDebug?.();
|
|
5963
|
+
detachScriptDebug = (0, external_c15t_namespaceObject.subscribeToScriptDebugEvents)((event)=>{
|
|
5964
|
+
stateManager.addEvent(scriptDebugEventToLogEntry(event));
|
|
5965
|
+
});
|
|
5711
5966
|
stateManager.setConnected(true);
|
|
5712
5967
|
const persistedOverrides = override_storage_loadPersistedOverrides();
|
|
5713
5968
|
if (persistedOverrides) {
|
|
@@ -5724,6 +5979,8 @@ var __webpack_exports__ = {};
|
|
|
5724
5979
|
stateManager.setConnected(false);
|
|
5725
5980
|
detachInstrumentation?.();
|
|
5726
5981
|
detachInstrumentation = null;
|
|
5982
|
+
detachScriptDebug?.();
|
|
5983
|
+
detachScriptDebug = null;
|
|
5727
5984
|
}
|
|
5728
5985
|
});
|
|
5729
5986
|
const panelRenderer = panel_renderer_createPanelRenderer({
|
|
@@ -5816,6 +6073,8 @@ var __webpack_exports__ = {};
|
|
|
5816
6073
|
destroy: ()=>{
|
|
5817
6074
|
detachInstrumentation?.();
|
|
5818
6075
|
detachInstrumentation = null;
|
|
6076
|
+
detachScriptDebug?.();
|
|
6077
|
+
detachScriptDebug = null;
|
|
5819
6078
|
unsubscribe();
|
|
5820
6079
|
tabsInstance?.destroy();
|
|
5821
6080
|
storeConnector.destroy();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConsentStoreState } from '
|
|
1
|
+
import type { ConsentStoreState } from 'c15t';
|
|
2
2
|
import type { DevToolsState, EventLogEntry } from './state-manager';
|
|
3
3
|
import type { ConnectionDiagnostics } from './store-connector';
|
|
4
4
|
export interface DebugBundlePayload {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConsentStoreState } from '
|
|
1
|
+
import type { ConsentStoreState } from 'c15t';
|
|
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;
|
|
@@ -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 'c15t';
|
|
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';
|
|
@@ -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 'c15t';
|
|
6
6
|
import type { StoreApi } from 'zustand/vanilla';
|
|
7
7
|
import type { StateManager } from './state-manager';
|
|
8
8
|
/**
|
|
@@ -15,7 +15,7 @@ export type DevToolsTab = 'consents' | 'location' | 'policy' | 'scripts' | 'iab'
|
|
|
15
15
|
*/
|
|
16
16
|
export interface EventLogEntry {
|
|
17
17
|
id: string;
|
|
18
|
-
type: 'consent_set' | 'consent_save' | 'consent_reset' | 'error' | 'info' | 'network' | 'iab';
|
|
18
|
+
type: 'consent_set' | 'consent_save' | 'consent_reset' | 'error' | 'info' | 'network' | 'iab' | 'script';
|
|
19
19
|
message: string;
|
|
20
20
|
timestamp: number;
|
|
21
21
|
data?: Record<string, unknown>;
|
|
@@ -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 'c15t';
|
|
6
6
|
import type { StoreApi } from 'zustand/vanilla';
|
|
7
7
|
/**
|
|
8
8
|
* Options for creating a store connector
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConsentStoreState } from '
|
|
1
|
+
import type { ConsentStoreState } from 'c15t';
|
|
2
2
|
import type { StoreApi } from 'zustand/vanilla';
|
|
3
3
|
import type { EventLogEntry } from './state-manager';
|
|
4
4
|
type InstrumentationEvent = Omit<EventLogEntry, 'id' | 'timestamp'>;
|
|
@@ -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 'c15t';
|
|
6
6
|
export interface ActionsPanelOptions {
|
|
7
7
|
getState: () => ConsentStoreState | null;
|
|
8
8
|
onResetConsents: () => void;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Consents Panel
|
|
3
3
|
* Displays and manages consent state
|
|
4
4
|
*/
|
|
5
|
-
import type { ConsentStoreState } from '
|
|
5
|
+
import type { ConsentStoreState } from 'c15t';
|
|
6
6
|
export interface ConsentsPanelOptions {
|
|
7
7
|
getState: () => ConsentStoreState | null;
|
|
8
8
|
onConsentChange: (name: string, value: boolean) => void;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* DOM Scanner
|
|
3
3
|
* Scans the DOM for external scripts and iframes, cross-referencing with c15t config
|
|
4
4
|
*/
|
|
5
|
-
import type { ConsentStoreState } from '
|
|
5
|
+
import type { ConsentStoreState } from 'c15t';
|
|
6
6
|
/**
|
|
7
7
|
* Represents a scanned external resource
|
|
8
8
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* IAB Panel
|
|
3
3
|
* Displays IAB TCF information including TC String, purposes, and vendors
|
|
4
4
|
*/
|
|
5
|
-
import type { ConsentStoreState } from '
|
|
5
|
+
import type { ConsentStoreState } from 'c15t';
|
|
6
6
|
export interface IabPanelOptions {
|
|
7
7
|
getState: () => ConsentStoreState | null;
|
|
8
8
|
onSetPurposeConsent: (purposeId: number, value: boolean) => void;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Location Panel
|
|
3
3
|
* Displays and manages location/language overrides
|
|
4
4
|
*/
|
|
5
|
-
import type { ConsentStoreState } from '
|
|
5
|
+
import type { ConsentStoreState } from 'c15t';
|
|
6
6
|
interface OverridePayload {
|
|
7
7
|
country?: string;
|
|
8
8
|
region?: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Policy Panel
|
|
3
3
|
* Displays detailed runtime policy-pack diagnostics from /init
|
|
4
4
|
*/
|
|
5
|
-
import type { ConsentStoreState } from '
|
|
5
|
+
import type { ConsentStoreState } from 'c15t';
|
|
6
6
|
export interface PolicyPanelOptions {
|
|
7
7
|
getState: () => ConsentStoreState | null;
|
|
8
8
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Scripts Panel
|
|
3
3
|
* Displays script loading status and configuration
|
|
4
4
|
*/
|
|
5
|
-
import type { ConsentStoreState } from '
|
|
5
|
+
import type { ConsentStoreState } from 'c15t';
|
|
6
6
|
import type { EventLogEntry } from '../core/state-manager';
|
|
7
7
|
export interface ScriptsPanelOptions {
|
|
8
8
|
getState: () => ConsentStoreState | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ConsentStoreState } from '
|
|
1
|
+
import type { ConsentStoreState } from 'c15t';
|
|
2
2
|
export declare function formatInitSource(source: ConsentStoreState['initDataSource'], detail: string | null | undefined): string;
|
package/dist-types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "2.0.0-rc.
|
|
1
|
+
export declare const version = "2.0.0-rc.8";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c15t/dev-tools",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.8",
|
|
4
4
|
"description": "A collection of developer tools and utilities for the c15t ecosystem, currently under active development.",
|
|
5
5
|
"homepage": "https://c15t.com",
|
|
6
6
|
"repository": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
],
|
|
37
37
|
"scripts": {
|
|
38
38
|
"prebuild": "bunx genversion --esm --semi src/version.ts",
|
|
39
|
-
"build": "bun prebuild && rslib build",
|
|
39
|
+
"build": "bun prebuild && rslib build && bun ../../scripts/normalize-dist-types.mjs",
|
|
40
40
|
"check-types": "bun prebuild && tsc --noEmit",
|
|
41
41
|
"dev": "bun prebuild && rslib build --watch",
|
|
42
42
|
"fmt": "bun biome format --write . && bun biome check --formatter-enabled=false --linter-enabled=false --write",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@radix-ui/react-slot": "1.2.4",
|
|
54
54
|
"@radix-ui/react-switch": "1.2.6",
|
|
55
55
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
56
|
-
"c15t": "2.0.0-rc.
|
|
56
|
+
"c15t": "2.0.0-rc.8",
|
|
57
57
|
"class-variance-authority": "^0.7.1",
|
|
58
58
|
"clsx": "2.1.1",
|
|
59
59
|
"lucide-react": "^1.7.0",
|