@highfivve/ad-tag 5.5.4
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/LICENSE +201 -0
- package/README.md +149 -0
- package/lib/ads/a9.js +190 -0
- package/lib/ads/adPipeline.js +159 -0
- package/lib/ads/adService.js +251 -0
- package/lib/ads/adUnitPath.js +37 -0
- package/lib/ads/auctions/adRequestThrottling.js +22 -0
- package/lib/ads/auctions/biddersDisabling.js +90 -0
- package/lib/ads/auctions/frequencyCapping.js +189 -0
- package/lib/ads/auctions/interstitialContext.js +92 -0
- package/lib/ads/auctions/previousBidCpms.js +33 -0
- package/lib/ads/auctions/resume.js +3 -0
- package/lib/ads/bridge/bridge.js +62 -0
- package/lib/ads/consent.js +63 -0
- package/lib/ads/eventService.js +44 -0
- package/lib/ads/globalAuctionContext.js +98 -0
- package/lib/ads/googleAdManager.js +380 -0
- package/lib/ads/keyValues.js +1 -0
- package/lib/ads/labelConfigService.js +42 -0
- package/lib/ads/modules/ad-reload/adVisibilityService.js +158 -0
- package/lib/ads/modules/ad-reload/index.js +163 -0
- package/lib/ads/modules/ad-reload/userActivityService.js +70 -0
- package/lib/ads/modules/adex/adex-mapping.js +77 -0
- package/lib/ads/modules/adex/adexUtiq.js +15 -0
- package/lib/ads/modules/adex/index.js +142 -0
- package/lib/ads/modules/adex/sendAdvertisingId.js +20 -0
- package/lib/ads/modules/blocklist-url/index.js +118 -0
- package/lib/ads/modules/cleanup/index.js +93 -0
- package/lib/ads/modules/confiant/index.js +47 -0
- package/lib/ads/modules/emetriq/index.js +154 -0
- package/lib/ads/modules/emetriq/trackInApp.js +34 -0
- package/lib/ads/modules/emetriq/trackLoginEvent.js +59 -0
- package/lib/ads/modules/generic-skin/index.js +150 -0
- package/lib/ads/modules/identitylink/index.js +58 -0
- package/lib/ads/modules/interstitial/index.js +38 -0
- package/lib/ads/modules/interstitial/interstitialAd.js +111 -0
- package/lib/ads/modules/lazy-load/index.js +191 -0
- package/lib/ads/modules/lazy-load/selectInfiniteSlot.js +11 -0
- package/lib/ads/modules/prebid-first-party-data/index.js +115 -0
- package/lib/ads/modules/pubstack/index.js +59 -0
- package/lib/ads/modules/sticky-footer-ad/desktopFloorAd.js +63 -0
- package/lib/ads/modules/sticky-footer-ad/index.js +43 -0
- package/lib/ads/modules/sticky-footer-ad/mobileSticky.js +93 -0
- package/lib/ads/modules/sticky-footer-ad-v2/footerStickyAd.js +118 -0
- package/lib/ads/modules/sticky-footer-ad-v2/index.js +43 -0
- package/lib/ads/modules/sticky-header-ad/fadeOutCallback.js +25 -0
- package/lib/ads/modules/sticky-header-ad/index.js +103 -0
- package/lib/ads/modules/sticky-header-ad/renderResult.js +24 -0
- package/lib/ads/modules/utiq/index.js +79 -0
- package/lib/ads/modules/yield-optimization/dynamicFloorPrice.js +86 -0
- package/lib/ads/modules/yield-optimization/index.js +57 -0
- package/lib/ads/modules/yield-optimization/isYieldOptimizationConfigDynamic.js +6 -0
- package/lib/ads/modules/yield-optimization/yieldOptimizationService.js +169 -0
- package/lib/ads/modules/zeotap/index.js +111 -0
- package/lib/ads/moli.js +645 -0
- package/lib/ads/moliGlobal.js +11 -0
- package/lib/ads/prebid-outstream.js +13 -0
- package/lib/ads/prebid.js +406 -0
- package/lib/ads/sizeConfigService.js +49 -0
- package/lib/ads/spa.js +32 -0
- package/lib/bundle/adReload.js +2 -0
- package/lib/bundle/adex.js +2 -0
- package/lib/bundle/blocklistUrls.js +2 -0
- package/lib/bundle/cleanup.js +2 -0
- package/lib/bundle/confiant.js +2 -0
- package/lib/bundle/configureFromEndpoint.js +40 -0
- package/lib/bundle/emetriq.js +2 -0
- package/lib/bundle/identityLink.js +2 -0
- package/lib/bundle/init.js +2 -0
- package/lib/bundle/interstitialModule.js +2 -0
- package/lib/bundle/lazyLoad.js +2 -0
- package/lib/bundle/prebidFirstPartyData.js +2 -0
- package/lib/bundle/pubstack.js +2 -0
- package/lib/bundle/skin.js +2 -0
- package/lib/bundle/stickyFooterAd.js +2 -0
- package/lib/bundle/stickyFooterAds2.js +2 -0
- package/lib/bundle/stickyHeaderAd.js +2 -0
- package/lib/bundle/utiq.js +2 -0
- package/lib/bundle/yieldOptimization.js +2 -0
- package/lib/bundle/zeotap.js +2 -0
- package/lib/console/components/adSlotConfig.js +225 -0
- package/lib/console/components/consentConfig.js +138 -0
- package/lib/console/components/globalConfig.js +634 -0
- package/lib/console/components/labelConfigDebug.js +19 -0
- package/lib/console/components/sizeConfigDebug.js +34 -0
- package/lib/console/components/tag.js +4 -0
- package/lib/console/debug.js +38 -0
- package/lib/console/util/array.js +1 -0
- package/lib/console/util/calculateAdDensity.js +36 -0
- package/lib/console/util/debounce.js +12 -0
- package/lib/console/util/debugLogger.js +6 -0
- package/lib/console/util/extractPositionFromPath.js +8 -0
- package/lib/console/util/prebid.js +3 -0
- package/lib/console/util/stringUtils.js +23 -0
- package/lib/console/util/themingService.js +31 -0
- package/lib/console/util/windowResizeService.js +22 -0
- package/lib/console/validations/adReloadValidations.js +47 -0
- package/lib/console/validations/bucketValidations.js +78 -0
- package/lib/console/validations/sizesConfigValidations.js +97 -0
- package/lib/gen/packageJson.js +3 -0
- package/lib/index.js +3 -0
- package/lib/types/apstag.js +1 -0
- package/lib/types/dom.js +1 -0
- package/lib/types/emetriq.js +1 -0
- package/lib/types/googletag.js +1 -0
- package/lib/types/identitylink.js +1 -0
- package/lib/types/module.js +1 -0
- package/lib/types/moliConfig.js +1 -0
- package/lib/types/moliRuntime.js +1 -0
- package/lib/types/prebidjs.js +45 -0
- package/lib/types/supplyChainObject.js +1 -0
- package/lib/types/tcfapi.js +48 -0
- package/lib/util/addNewInfiniteSlotToConfig.js +11 -0
- package/lib/util/arrayUtils.js +9 -0
- package/lib/util/assetLoaderService.js +91 -0
- package/lib/util/browserStorageKeys.js +7 -0
- package/lib/util/debugDelay.js +12 -0
- package/lib/util/domready.js +15 -0
- package/lib/util/environmentOverride.js +16 -0
- package/lib/util/extractAdTagVersion.js +16 -0
- package/lib/util/extractTopPrivateDomainFromHostname.js +17 -0
- package/lib/util/localStorage.js +26 -0
- package/lib/util/logging.js +106 -0
- package/lib/util/objectUtils.js +29 -0
- package/lib/util/query.js +40 -0
- package/lib/util/queryParameters.js +5 -0
- package/lib/util/resolveOverrides.js +21 -0
- package/lib/util/resolveStoredRequestIdInOrtb2Object.js +12 -0
- package/lib/util/sizes.js +3 -0
- package/lib/util/test-slots.js +150 -0
- package/lib/util/uuid.js +10 -0
- package/package.json +127 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import { classList } from '../util/stringUtils';
|
|
3
|
+
import { SizeConfigDebug } from './sizeConfigDebug';
|
|
4
|
+
import { Tag } from './tag';
|
|
5
|
+
import { extractPrebidAdSlotConfigs } from '../util/prebid';
|
|
6
|
+
import { SizeConfigService } from '../../ads/sizeConfigService';
|
|
7
|
+
const defaultPanelState = {
|
|
8
|
+
showA9: false,
|
|
9
|
+
showPrebid: false,
|
|
10
|
+
showGeneral: false,
|
|
11
|
+
showSizeConfig: false
|
|
12
|
+
};
|
|
13
|
+
export class AdSlotConfig extends React.Component {
|
|
14
|
+
constructor(props) {
|
|
15
|
+
super(props);
|
|
16
|
+
this.prebidConfig = (prebid) => {
|
|
17
|
+
const labels = this.props.labelConfigService.getSupportedLabels();
|
|
18
|
+
const prebidAdUnits = extractPrebidAdSlotConfigs(prebid).map(config => config.adUnit);
|
|
19
|
+
const hasMultipleBids = prebidAdUnits.length > 1;
|
|
20
|
+
const elements = prebidAdUnits.map((prebidAdUnit, index) => {
|
|
21
|
+
const slotSizeConfig = this.props.slot.sizeConfig;
|
|
22
|
+
const banner = prebidAdUnit.mediaTypes.banner;
|
|
23
|
+
const video = prebidAdUnit.mediaTypes.video;
|
|
24
|
+
const native = prebidAdUnit.mediaTypes.native;
|
|
25
|
+
return (React.createElement("div", { key: index },
|
|
26
|
+
index > 0 && React.createElement("hr", null),
|
|
27
|
+
hasMultipleBids && React.createElement("h5", null,
|
|
28
|
+
index + 1,
|
|
29
|
+
". config"),
|
|
30
|
+
React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
31
|
+
React.createElement("span", { className: "MoliDebug-tagLabel" }, "Code"),
|
|
32
|
+
React.createElement(Tag, { variant: "green" }, prebidAdUnit.code || this.props.slot.domId)),
|
|
33
|
+
banner && (React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
34
|
+
React.createElement("span", { className: "MoliDebug-tagLabel" }, "Banner sizes"),
|
|
35
|
+
this.validateSlotSizes(banner.sizes).map(validatedSlotSize => this.tagFromValidatedSlotSize(validatedSlotSize, !!slotSizeConfig)))),
|
|
36
|
+
video && (React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
37
|
+
React.createElement("span", { className: "MoliDebug-tagLabel" }, "Video"),
|
|
38
|
+
React.createElement(Tag, { variant: "green" }, video.context),
|
|
39
|
+
!!video.playerSize &&
|
|
40
|
+
this.validateSlotSizes(this.isSingleVideoSize(video.playerSize) ? [video.playerSize] : video.playerSize).map(validatedSlotSize => this.tagFromValidatedSlotSize(validatedSlotSize, !!slotSizeConfig)))),
|
|
41
|
+
native && (React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
42
|
+
React.createElement("span", { className: "MoliDebug-tagLabel" }, "Native"),
|
|
43
|
+
React.createElement(Tag, { variant: "green" }, "true"))),
|
|
44
|
+
prebidAdUnit.bids.map((bid, idx) => (React.createElement(Fragment, { key: idx },
|
|
45
|
+
React.createElement("hr", null),
|
|
46
|
+
React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
47
|
+
React.createElement("span", { className: "MoliDebug-tagLabel" },
|
|
48
|
+
"Bidder #",
|
|
49
|
+
idx + 1),
|
|
50
|
+
React.createElement(Tag, { variant: "blue" }, bid.bidder ?? bid.module)),
|
|
51
|
+
React.createElement("div", { className: "MoliDebug-tagContainer" }, this.labelConfig(bid)),
|
|
52
|
+
React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
53
|
+
React.createElement("span", { className: "MoliDebug-tagLabel" }, "Params"),
|
|
54
|
+
React.createElement(Tag, null, JSON.stringify(bid.params))))))));
|
|
55
|
+
});
|
|
56
|
+
if (elements.length === 1) {
|
|
57
|
+
return elements[0];
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return (React.createElement("div", null,
|
|
61
|
+
React.createElement("h5", null,
|
|
62
|
+
elements.length,
|
|
63
|
+
" bid configurations"),
|
|
64
|
+
elements));
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
this.a9Config = (a9) => {
|
|
68
|
+
const slotSizeConfig = this.props.slot.sizeConfig;
|
|
69
|
+
return (React.createElement("div", null,
|
|
70
|
+
React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
71
|
+
React.createElement("span", { className: "MoliDebug-tagLabel" }, "Sizes"),
|
|
72
|
+
this.validateSlotSizes(this.props.slot.sizes.filter(AdSlotConfig.isFixedSize)).map(validatedSlotSize => this.tagFromValidatedSlotSize(validatedSlotSize, !!slotSizeConfig))),
|
|
73
|
+
React.createElement("div", { className: "MoliDebug-tagContainer" }, this.labelConfig(a9))));
|
|
74
|
+
};
|
|
75
|
+
this.toggleGeneral = () => this.setState({ showGeneral: !this.state.showGeneral });
|
|
76
|
+
this.toggleA9 = () => this.setState({ showA9: !this.state.showA9 });
|
|
77
|
+
this.togglePrebid = () => this.setState({ showPrebid: !this.state.showPrebid });
|
|
78
|
+
this.toggleSizeConfig = () => this.setState({ showSizeConfig: !this.state.showSizeConfig });
|
|
79
|
+
this.isVisiblePrebid = () => {
|
|
80
|
+
const prebid = this.props.slot.prebid;
|
|
81
|
+
if (prebid) {
|
|
82
|
+
const labels = this.props.labelConfigService.getSupportedLabels();
|
|
83
|
+
return extractPrebidAdSlotConfigs(prebid)
|
|
84
|
+
.map(config => config.adUnit)
|
|
85
|
+
.some(prebidAdUnit => {
|
|
86
|
+
const video = prebidAdUnit.mediaTypes.video;
|
|
87
|
+
const banner = prebidAdUnit.mediaTypes.banner;
|
|
88
|
+
const native = prebidAdUnit.mediaTypes.native;
|
|
89
|
+
const videoValid = !!video &&
|
|
90
|
+
(!video.playerSize ||
|
|
91
|
+
this.validateSlotSizes(this.isSingleVideoSize(video.playerSize) ? [video.playerSize] : video.playerSize).some(validatedSlotSize => validatedSlotSize.valid));
|
|
92
|
+
return (!!native ||
|
|
93
|
+
videoValid ||
|
|
94
|
+
(!!banner &&
|
|
95
|
+
this.validateSlotSizes(banner.sizes).some(validatedSlotSize => validatedSlotSize.valid)));
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
};
|
|
100
|
+
this.isVisibleA9 = () => {
|
|
101
|
+
const a9 = this.props.slot.a9;
|
|
102
|
+
if (a9) {
|
|
103
|
+
const supportedLabels = this.props.labelConfigService.getSupportedLabels();
|
|
104
|
+
if (a9.labelAll) {
|
|
105
|
+
return a9.labelAll.every(label => supportedLabels.indexOf(label) > -1);
|
|
106
|
+
}
|
|
107
|
+
if (a9.labelAny) {
|
|
108
|
+
return a9.labelAny.some(label => supportedLabels.indexOf(label) > -1);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return true;
|
|
112
|
+
};
|
|
113
|
+
this.isSingleVideoSize = (playerSize) => {
|
|
114
|
+
return (playerSize.length === 2 &&
|
|
115
|
+
typeof playerSize[0] === 'number' &&
|
|
116
|
+
typeof playerSize[1] === 'number');
|
|
117
|
+
};
|
|
118
|
+
this.validateSlotSizes = (sizes) => {
|
|
119
|
+
const slotSizeConfig = this.props.slot.sizeConfig;
|
|
120
|
+
const sizeConfigService = new SizeConfigService(slotSizeConfig, this.props.labelConfigService.getSupportedLabels(), window);
|
|
121
|
+
return sizes.map(size => ({
|
|
122
|
+
valid: sizeConfigService.filterSupportedSizes([size]).length > 0,
|
|
123
|
+
size
|
|
124
|
+
}));
|
|
125
|
+
};
|
|
126
|
+
this.tagFromValidatedSlotSize = (slotSize, hasSlotSizeConfig) => {
|
|
127
|
+
const sizeString = slotSize.size === 'fluid' ? slotSize.size : `${slotSize.size[0]}x${slotSize.size[1]}`;
|
|
128
|
+
return (React.createElement(Tag, { key: sizeString, variant: slotSize.valid ? 'green' : 'red', title: `${slotSize.valid ? 'Valid' : 'Invalid'} (${hasSlotSizeConfig ? 'slot' : 'global'} sizeConfig)` },
|
|
129
|
+
sizeString,
|
|
130
|
+
" ",
|
|
131
|
+
hasSlotSizeConfig ? 'Ⓢ' : 'Ⓖ'));
|
|
132
|
+
};
|
|
133
|
+
this.labelConfig = (labelledSlot) => {
|
|
134
|
+
const labelAll = labelledSlot.labelAll;
|
|
135
|
+
const labelAny = labelledSlot.labelAny;
|
|
136
|
+
const supportedLabels = this.props.labelConfigService.getSupportedLabels();
|
|
137
|
+
const labelAllMatches = !!labelAll && labelAll.every(label => supportedLabels.indexOf(label) > -1);
|
|
138
|
+
const labelAnyMatches = !!labelAny && labelAny.some(label => supportedLabels.indexOf(label) > -1);
|
|
139
|
+
return (React.createElement("div", null,
|
|
140
|
+
labelAll && labelAll.length > 0 && (React.createElement("div", null,
|
|
141
|
+
React.createElement("span", { className: classList('MoliDebug-tagLabel', [labelAllMatches, 'MoliDebug-tag--greenText'], [!labelAllMatches, 'MoliDebug-tag--redText']) }, "labelAll"),
|
|
142
|
+
labelAll.map(label => (React.createElement(Tag, { key: label, variant: supportedLabels.indexOf(label) > -1 ? 'green' : 'red' }, label))))),
|
|
143
|
+
labelAny && labelAny.length > 0 && (React.createElement("div", null,
|
|
144
|
+
React.createElement("span", { className: classList('MoliDebug-tagLabel', [labelAnyMatches, 'MoliDebug-tag--greenText'], [!labelAnyMatches, 'MoliDebug-tag--redText']) }, "labelAny"),
|
|
145
|
+
labelAll && labelAll.length > 0 && (React.createElement(Tag, { variant: 'yellow' }, "labelAll was already evaluated, labelAny is ignored")),
|
|
146
|
+
labelAny.map(label => {
|
|
147
|
+
const labelFound = supportedLabels.indexOf(label) > -1;
|
|
148
|
+
return (React.createElement(Tag, { key: label, variant: labelFound ? 'green' : 'red' }, label));
|
|
149
|
+
})))));
|
|
150
|
+
};
|
|
151
|
+
if (props.parentElement) {
|
|
152
|
+
props.parentElement.classList.add('MoliDebug-posRelative');
|
|
153
|
+
const { width, height } = props.parentElement.getBoundingClientRect();
|
|
154
|
+
this.state = {
|
|
155
|
+
dimensions: { width, height },
|
|
156
|
+
...defaultPanelState
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
this.state = defaultPanelState;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
render() {
|
|
164
|
+
const { labelConfigService, slot, parentElement } = this.props;
|
|
165
|
+
const { dimensions, showGeneral, showA9, showPrebid, showSizeConfig } = this.state;
|
|
166
|
+
const slotValid = slot.behaviour.loaded === 'infinite' ? true : labelConfigService.filterSlot(slot);
|
|
167
|
+
const slotElementExists = !!document.getElementById(slot.domId);
|
|
168
|
+
const slotVisible = slotValid && slotElementExists;
|
|
169
|
+
const isConfiguredInfiniteSlot = slot.behaviour.loaded === 'infinite' && !slotVisible;
|
|
170
|
+
const prebidValid = this.isVisiblePrebid();
|
|
171
|
+
const a9Valid = slotVisible && this.isVisibleA9();
|
|
172
|
+
function setSlotVisibilityIcon(slotVisible, loadingBehaviour) {
|
|
173
|
+
if (slotVisible) {
|
|
174
|
+
return '✔';
|
|
175
|
+
}
|
|
176
|
+
else if (isConfiguredInfiniteSlot) {
|
|
177
|
+
return '?';
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
return 'x';
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
const getBucketName = (bucket) => {
|
|
184
|
+
if (!bucket) {
|
|
185
|
+
return 'default';
|
|
186
|
+
}
|
|
187
|
+
if (typeof bucket === 'string') {
|
|
188
|
+
return bucket;
|
|
189
|
+
}
|
|
190
|
+
return bucket[labelConfigService.getDeviceLabel()] ?? 'default';
|
|
191
|
+
};
|
|
192
|
+
return (React.createElement("div", { className: classList('MoliDebug-adSlot', [!!parentElement, 'MoliDebug-adSlot--overlay'], [!parentElement && slotVisible, 'is-rendered'], [!parentElement && !slotVisible, 'is-notRendered'], [isConfiguredInfiniteSlot, 'is-configuredInfinite']), style: dimensions },
|
|
193
|
+
React.createElement("div", { className: "MoliDebug-adSlot-buttons" },
|
|
194
|
+
!parentElement && (React.createElement("button", { title: slot.behaviour.loaded === 'infinite'
|
|
195
|
+
? `Configuration only used to copy on slots with infinite selector`
|
|
196
|
+
: `Slot ${slotVisible ? '' : 'not '}rendered`, className: classList('MoliDebug-adSlot-button', [slotVisible, 'is-rendered'], [!slotVisible, 'is-notRendered'], [isConfiguredInfiniteSlot, 'is-configuredInfinite']), onClick: this.toggleGeneral }, setSlotVisibilityIcon(slotVisible, slot.behaviour.loaded))),
|
|
197
|
+
React.createElement("button", { title: "Show general slot info", className: classList('MoliDebug-adSlot-button', [showGeneral, 'is-active']), onClick: this.toggleGeneral }, "\u24D8"),
|
|
198
|
+
slot.a9 && (React.createElement("button", { title: "Show A9 config", className: classList('MoliDebug-adSlot-button', [showA9, 'is-active'], [a9Valid, 'is-rendered'], [!a9Valid, 'is-notRendered']), onClick: this.toggleA9 }, "A9")),
|
|
199
|
+
slot.prebid && (React.createElement("button", { title: "Show Prebid config", className: classList('MoliDebug-adSlot-button', [showPrebid, 'is-active'], [prebidValid, 'is-rendered'], [!prebidValid, 'is-notRendered']), onClick: this.togglePrebid }, "pb")),
|
|
200
|
+
slot.sizeConfig && (React.createElement("button", { title: "Show sizeConfig", className: classList('MoliDebug-adSlot-button MoliDebug-adSlot-button--sizeConfig', [slotValid, 'is-rendered'], [!slotValid, 'is-notRendered'], [showSizeConfig, 'is-active']), onClick: this.toggleSizeConfig })),
|
|
201
|
+
isConfiguredInfiniteSlot && (React.createElement("p", null, "Looking up infinite slots is currently not implemented"))),
|
|
202
|
+
showGeneral && (React.createElement("div", { className: "MoliDebug-panel MoliDebug-panel--blue MoliDebug-panel--collapsible" },
|
|
203
|
+
React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
204
|
+
React.createElement(Tag, { variant: "green" }, slot.position),
|
|
205
|
+
React.createElement(Tag, { variant: "yellow" }, slot.behaviour.loaded),
|
|
206
|
+
slot.behaviour.bucket && (React.createElement(Tag, { variant: "blue" }, getBucketName(slot.behaviour.bucket)))),
|
|
207
|
+
React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
208
|
+
React.createElement("span", { className: classList('MoliDebug-tagLabel', [slotElementExists, 'MoliDebug-tag--greenText'], [!slotElementExists, 'MoliDebug-tag--redText']) }, "DOM ID"),
|
|
209
|
+
React.createElement(Tag, { variant: slotElementExists ? 'green' : 'red', title: `Slot ${slotElementExists ? '' : 'not '}found in DOM` }, slot.domId)),
|
|
210
|
+
React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
211
|
+
React.createElement("span", { className: "MoliDebug-tagLabel" }, "AdUnit path"),
|
|
212
|
+
React.createElement(Tag, null, slot.adUnitPath)),
|
|
213
|
+
slot.sizes.length > 0 && (React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
214
|
+
React.createElement("span", { className: "MoliDebug-tagLabel" }, "Sizes"),
|
|
215
|
+
this.validateSlotSizes(slot.sizes).map(validatedSlotSize => this.tagFromValidatedSlotSize(validatedSlotSize, !!slot.sizeConfig)))),
|
|
216
|
+
React.createElement("div", { className: "MoliDebug-tagContainer" }, this.labelConfig(slot)))),
|
|
217
|
+
showA9 && slot.a9 && (React.createElement("div", { className: "MoliDebug-panel MoliDebug-panel--blue MoliDebug-panel--collapsible" }, this.a9Config(slot.a9))),
|
|
218
|
+
showPrebid && slot.prebid && (React.createElement("div", { className: "MoliDebug-panel MoliDebug-panel--blue MoliDebug-panel--collapsible" }, this.prebidConfig(slot.prebid))),
|
|
219
|
+
showSizeConfig && slot.sizeConfig && (React.createElement("div", { className: "MoliDebug-panel MoliDebug-panel--blue MoliDebug-panel--collapsible" },
|
|
220
|
+
React.createElement(SizeConfigDebug, { sizeConfig: slot.sizeConfig, supportedLabels: labelConfigService.getSupportedLabels() })))));
|
|
221
|
+
}
|
|
222
|
+
static isFixedSize(size) {
|
|
223
|
+
return size !== 'fluid';
|
|
224
|
+
}
|
|
225
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tag } from './tag';
|
|
3
|
+
import { TCString } from '@iabtcf/core';
|
|
4
|
+
import { tcfapi } from '../../types/tcfapi';
|
|
5
|
+
const cmpVendors = {
|
|
6
|
+
'3': {
|
|
7
|
+
name: ' LiveRamp',
|
|
8
|
+
website: 'https://liveramp.com/',
|
|
9
|
+
subDomain: '\tfaktor.mgr.consensu.org'
|
|
10
|
+
},
|
|
11
|
+
'5': {
|
|
12
|
+
name: ' Usercentrics GmbH',
|
|
13
|
+
website: 'https://usercentrics.com/',
|
|
14
|
+
subDomain: 'usercentrics.mgr.consensu.org'
|
|
15
|
+
},
|
|
16
|
+
'6': {
|
|
17
|
+
name: 'Sourcepoint Technologies, Inc.',
|
|
18
|
+
website: 'https://sourcepoint.com',
|
|
19
|
+
subDomain: 'sourcepoint.mgr.consensu.org'
|
|
20
|
+
},
|
|
21
|
+
'10': {
|
|
22
|
+
name: 'Quantcast International Limited',
|
|
23
|
+
website: 'https://quantcast.com',
|
|
24
|
+
subDomain: 'quantcast.mgr.consensu.org'
|
|
25
|
+
},
|
|
26
|
+
'21': {
|
|
27
|
+
name: 'Traffective GmbH',
|
|
28
|
+
website: 'https://traffective.com',
|
|
29
|
+
subDomain: 'traffective.mgr.consensu.org'
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export const ConsentConfig = () => {
|
|
33
|
+
const [consentState, setConsentState] = React.useState({ messages: [] });
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
if (window.__tcfapi) {
|
|
36
|
+
window.__tcfapi('addEventListener', 2, event => {
|
|
37
|
+
const tcModel = event.gdprApplies ? TCString.decode(event.tcString) : undefined;
|
|
38
|
+
setConsentState(prevState => ({
|
|
39
|
+
...prevState,
|
|
40
|
+
cmpStatus: event.cmpStatus,
|
|
41
|
+
tcModel: tcModel,
|
|
42
|
+
tcString: event.gdprApplies ? event.tcString : 'none'
|
|
43
|
+
}));
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
setConsentState(prevState => ({
|
|
48
|
+
...prevState,
|
|
49
|
+
cmpStatus: tcfapi.status.CmpStatus.ERROR
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
if (!isCmpFunctionAvailable()) {
|
|
53
|
+
const errorMessage = {
|
|
54
|
+
kind: 'error',
|
|
55
|
+
text: 'no window.__tcfapi function found. Consent management and ads will not work!'
|
|
56
|
+
};
|
|
57
|
+
setConsentState(prevState => ({
|
|
58
|
+
...prevState,
|
|
59
|
+
messages: [errorMessage, ...prevState.messages]
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
const cmpVendorTag = () => {
|
|
64
|
+
if (consentState.tcModel) {
|
|
65
|
+
const cmpVendor = cmpVendors[consentState.tcModel.cmpId.toString()];
|
|
66
|
+
if (cmpVendor) {
|
|
67
|
+
return (React.createElement(Tag, { variant: "grey" },
|
|
68
|
+
React.createElement("a", { href: cmpVendor.website },
|
|
69
|
+
cmpVendor.name,
|
|
70
|
+
" (id: ",
|
|
71
|
+
consentState.tcModel.cmpId.toString(),
|
|
72
|
+
")")));
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
return React.createElement(Tag, { variant: "yellow" }, consentState.tcModel.cmpId.toString());
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
return React.createElement(Tag, { variant: "red" }, "No defined");
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const consent = () => {
|
|
83
|
+
const { gdprApplies, tcModel } = consentState;
|
|
84
|
+
return (React.createElement("div", null,
|
|
85
|
+
React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
86
|
+
React.createElement("span", { className: "MoliDebug-tagLabel" },
|
|
87
|
+
React.createElement("a", { href: "https://iabeurope.eu/cmp-list/" }, "GDPR")),
|
|
88
|
+
!!gdprApplies),
|
|
89
|
+
React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
90
|
+
React.createElement("span", { className: "MoliDebug-tagLabel" },
|
|
91
|
+
React.createElement("a", { href: "https://iabeurope.eu/cmp-list/" }, "CMP ID")),
|
|
92
|
+
cmpVendorTag()),
|
|
93
|
+
React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
94
|
+
React.createElement("span", { className: "MoliDebug-tagLabel" }, "Last updated"),
|
|
95
|
+
tcModel ? (React.createElement(Tag, null, tcModel.lastUpdated.toLocaleString())) : (React.createElement(Tag, { variant: "red" }, "Unknown"))),
|
|
96
|
+
React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
97
|
+
React.createElement("span", { className: "MoliDebug-tagLabel" }, "TCF Policy Version"),
|
|
98
|
+
tcModel ? (React.createElement(Tag, null, tcModel.policyVersion.toString())) : (React.createElement(Tag, { variant: "red" }, "Unknown")))));
|
|
99
|
+
};
|
|
100
|
+
const isCmpFunctionAvailable = () => window.__tcfapi || typeof window.__tcfapi === 'function';
|
|
101
|
+
const consentData = () => {
|
|
102
|
+
if (isCmpFunctionAvailable()) {
|
|
103
|
+
return (React.createElement("div", null,
|
|
104
|
+
React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
105
|
+
React.createElement("span", { className: "MoliDebug-tagLabel" }, "vendor list version"),
|
|
106
|
+
React.createElement(Tag, null, consentState.tcModel
|
|
107
|
+
? consentState.tcModel.vendorListVersion.toString()
|
|
108
|
+
: 'not found')),
|
|
109
|
+
React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
110
|
+
React.createElement("span", { className: "MoliDebug-tagLabel" }, "num vendors allowed"),
|
|
111
|
+
React.createElement(Tag, null, consentState.tcModel
|
|
112
|
+
? consentState.tcModel.vendorConsents.size.toString()
|
|
113
|
+
: 'not found')),
|
|
114
|
+
React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
115
|
+
React.createElement("span", { className: "MoliDebug-tagLabelBtn", "data-toggle": "collapse", "data-target": "#collapsePurposes", "aria-expanded": "false", "aria-controls": "collapsePurposes" }, "allowed purposes"),
|
|
116
|
+
React.createElement(Tag, null, consentState.tcModel
|
|
117
|
+
? consentState.tcModel.purposeConsents.size.toString()
|
|
118
|
+
: 'not found'),
|
|
119
|
+
React.createElement("div", { className: "collapse", id: "collapsePurposes" },
|
|
120
|
+
React.createElement("a", { href: "https://iabeurope.eu/iab-europe-transparency-consent-framework-policies/#Appendix_A_Purposes_and_Features_Definitions" }, "Purpose and Feature definitions"),
|
|
121
|
+
React.createElement("br", null),
|
|
122
|
+
consentState.tcModel &&
|
|
123
|
+
Array.from(consentState.tcModel.purposeConsents).map(([id, accepted]) => {
|
|
124
|
+
return (React.createElement(Tag, { key: id, variant: accepted ? 'green' : 'red' },
|
|
125
|
+
id.toString(),
|
|
126
|
+
": ",
|
|
127
|
+
accepted ? 'accepted' : 'denied'));
|
|
128
|
+
}))),
|
|
129
|
+
React.createElement("div", { className: "MoliDebug-tagContainer" },
|
|
130
|
+
React.createElement("span", { className: "MoliDebug-tagLabelBtn", "data-toggle": "collapse", "data-target": "#collapseConsentString", "aria-expanded": "false", "aria-controls": "collapseConsentString" }, "consent string"),
|
|
131
|
+
React.createElement("div", { className: "collapse", id: "collapseConsentString" },
|
|
132
|
+
React.createElement(Tag, null, consentState.tcString ? consentState.tcString : 'not found')))));
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
return (React.createElement("div", null,
|
|
136
|
+
consent(),
|
|
137
|
+
consentData()));
|
|
138
|
+
};
|