@highfivve/ad-tag 5.8.30 → 5.8.32
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/lib/console/components/adSlotConfig.js +115 -87
- package/lib/console/components/consentConfig.js +26 -23
- package/lib/console/components/globalConfig.js +359 -358
- package/lib/console/components/labelConfigDebug.js +8 -8
- package/lib/console/components/moduleConfigs.js +359 -0
- package/lib/console/components/sizeConfigDebug.js +14 -14
- package/lib/console/components/tag.js +11 -2
- package/lib/console/components/ui.js +43 -0
- package/lib/console/debug.js +2 -27
- package/lib/console/tailwind.config.js +205 -0
- package/lib/console/util/themingService.js +15 -8
- package/lib/console/validations/sizesConfigValidations.js +1 -1
- package/lib/gen/packageJson.js +1 -1
- package/lib/util/browserStorageKeys.js +1 -0
- package/package.json +4 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Tag } from './tag';
|
|
3
|
-
import {
|
|
2
|
+
import { Tag, TagLabel } from './tag';
|
|
3
|
+
import { TagContainer } from './ui';
|
|
4
4
|
export const LabelConfigDebug = ({ labelSizeConfig }) => {
|
|
5
5
|
return (React.createElement("div", null, labelSizeConfig.map((labelSizeConfigEntry, idx) => {
|
|
6
6
|
const mediaQueryMatches = window.matchMedia(labelSizeConfigEntry.mediaQuery).matches;
|
|
7
|
-
return (React.createElement("div", { key: idx, className: "
|
|
7
|
+
return (React.createElement("div", { key: idx, className: "mb-2" },
|
|
8
8
|
"Entry ",
|
|
9
9
|
React.createElement("strong", null,
|
|
10
10
|
"#",
|
|
11
11
|
idx + 1),
|
|
12
|
-
React.createElement(
|
|
13
|
-
React.createElement(
|
|
14
|
-
React.createElement(
|
|
15
|
-
React.createElement(
|
|
16
|
-
React.createElement(
|
|
12
|
+
React.createElement(TagContainer, null,
|
|
13
|
+
React.createElement(TagLabel, null, "Media query"),
|
|
14
|
+
React.createElement(Tag, { variant: mediaQueryMatches ? 'green' : 'red', title: `Media query ${mediaQueryMatches ? 'matches' : "doesn't match"}` }, labelSizeConfigEntry.mediaQuery)),
|
|
15
|
+
React.createElement(TagContainer, null,
|
|
16
|
+
React.createElement(TagLabel, null, "Supported labels"),
|
|
17
17
|
labelSizeConfigEntry.labelsSupported.map(label => (React.createElement(Tag, { key: label }, label))))));
|
|
18
18
|
})));
|
|
19
19
|
};
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import { Tag, TagLabel } from './tag';
|
|
3
|
+
import { SubHeadline, TagContainer } from './ui';
|
|
4
|
+
const BoolTag = ({ value, trueLabel, falseLabel }) => (React.createElement(Tag, { variant: value ? 'green' : 'grey' }, value ? (trueLabel ?? 'yes') : (falseLabel ?? 'no')));
|
|
5
|
+
const Row = ({ label, subEntry, children }) => (React.createElement(TagContainer, { subEntry: subEntry },
|
|
6
|
+
React.createElement(TagLabel, null, label),
|
|
7
|
+
children));
|
|
8
|
+
const ListTags = ({ values, variant }) => values && values.length > 0 ? (React.createElement(React.Fragment, null, values.map((value, index) => (React.createElement(Tag, { key: index, variant: variant ?? 'blue' }, value))))) : (React.createElement("i", null, "none"));
|
|
9
|
+
const AdexModule = ({ config }) => (React.createElement(React.Fragment, null,
|
|
10
|
+
React.createElement(Row, { label: "Customer / Tag ID" },
|
|
11
|
+
React.createElement(Tag, null, config.adexCustomerId),
|
|
12
|
+
React.createElement(Tag, null, config.adexTagId)),
|
|
13
|
+
React.createElement(Row, { label: "App name" },
|
|
14
|
+
React.createElement(Tag, null, config.appName)),
|
|
15
|
+
React.createElement(Row, { label: "SPA mode" },
|
|
16
|
+
React.createElement(BoolTag, { value: config.spaMode })),
|
|
17
|
+
React.createElement(Row, { label: "Mappings" }, config.mappingDefinitions.length === 0 ? (React.createElement("i", null, "none")) : (config.mappingDefinitions.map((mapping, index) => (React.createElement(Tag, { key: index, variant: "grey" },
|
|
18
|
+
mapping.key,
|
|
19
|
+
" \u2192 ",
|
|
20
|
+
mapping.attribute,
|
|
21
|
+
" (",
|
|
22
|
+
mapping.adexValueType,
|
|
23
|
+
")"))))),
|
|
24
|
+
config.enabledPartners && (React.createElement(Row, { label: "Cookie matching partners" },
|
|
25
|
+
React.createElement(ListTags, { values: config.enabledPartners }))),
|
|
26
|
+
config.appConfig && (React.createElement(Row, { label: "App config keys" },
|
|
27
|
+
React.createElement(Tag, { variant: "grey" },
|
|
28
|
+
"clientType: ",
|
|
29
|
+
config.appConfig.clientTypeKey),
|
|
30
|
+
React.createElement(Tag, { variant: "grey" },
|
|
31
|
+
"advertiserId: ",
|
|
32
|
+
config.appConfig.advertiserIdKey),
|
|
33
|
+
config.appConfig.adexMobileTagId && (React.createElement(Tag, { variant: "grey" },
|
|
34
|
+
"mobileTagId: ",
|
|
35
|
+
config.appConfig.adexMobileTagId))))));
|
|
36
|
+
const AdReloadModule = ({ config }) => (React.createElement(React.Fragment, null,
|
|
37
|
+
React.createElement(Row, { label: "Refresh interval" },
|
|
38
|
+
React.createElement(Tag, null, config.refreshIntervalMs !== undefined ? `${config.refreshIntervalMs}ms` : 'default')),
|
|
39
|
+
React.createElement(Row, { label: "User activity level" },
|
|
40
|
+
React.createElement(Tag, { variant: "grey" }, config.userActivityLevelControl?.level ?? 'default')),
|
|
41
|
+
React.createElement(Row, { label: "Visibility checks" },
|
|
42
|
+
React.createElement(BoolTag, { value: !config.disableAdVisibilityChecks, trueLabel: "enabled", falseLabel: "disabled" })),
|
|
43
|
+
React.createElement(Row, { label: "Excluded slots" },
|
|
44
|
+
React.createElement(ListTags, { values: config.excludeAdSlotDomIds, variant: "grey" })),
|
|
45
|
+
React.createElement(Row, { label: "CLS optimized slots" },
|
|
46
|
+
React.createElement(ListTags, { values: config.optimizeClsScoreDomIds, variant: "grey" })),
|
|
47
|
+
React.createElement(Row, { label: "Advertisers (include)" },
|
|
48
|
+
React.createElement(ListTags, { values: config.includeAdvertiserIds, variant: "green" })),
|
|
49
|
+
React.createElement(Row, { label: "Yield groups (include)" },
|
|
50
|
+
React.createElement(ListTags, { values: config.includeYieldGroupIds, variant: "green" })),
|
|
51
|
+
React.createElement(Row, { label: "Orders (include)" },
|
|
52
|
+
React.createElement(ListTags, { values: config.includeOrderIds, variant: "green" })),
|
|
53
|
+
React.createElement(Row, { label: "Orders (exclude)" },
|
|
54
|
+
React.createElement(ListTags, { values: config.excludeOrderIds, variant: "grey" })),
|
|
55
|
+
config.refreshIntervalMsOverrides &&
|
|
56
|
+
Object.keys(config.refreshIntervalMsOverrides).length > 0 && (React.createElement(React.Fragment, null,
|
|
57
|
+
React.createElement(SubHeadline, null, "Refresh interval overrides"),
|
|
58
|
+
Object.entries(config.refreshIntervalMsOverrides).map(([domId, override]) => (React.createElement(Row, { key: domId, label: domId, subEntry: true }, typeof override === 'number' ? (React.createElement(Tag, null,
|
|
59
|
+
override,
|
|
60
|
+
"ms")) : (React.createElement(React.Fragment, null,
|
|
61
|
+
override.default !== undefined && React.createElement(Tag, null,
|
|
62
|
+
"default ",
|
|
63
|
+
override.default,
|
|
64
|
+
"ms"),
|
|
65
|
+
override.bidders &&
|
|
66
|
+
Object.entries(override.bidders).map(([bidder, interval]) => (React.createElement(Tag, { key: bidder, variant: "grey" },
|
|
67
|
+
bidder,
|
|
68
|
+
": ",
|
|
69
|
+
interval,
|
|
70
|
+
"ms")))))))))),
|
|
71
|
+
config.viewabilityOverrides && Object.keys(config.viewabilityOverrides).length > 0 && (React.createElement(React.Fragment, null,
|
|
72
|
+
React.createElement(SubHeadline, null, "Viewability overrides"),
|
|
73
|
+
Object.entries(config.viewabilityOverrides).map(([domId, override]) => (React.createElement(Row, { key: domId, label: domId, subEntry: true },
|
|
74
|
+
override?.variant === 'css' && React.createElement(Tag, { variant: "grey" },
|
|
75
|
+
"css: ",
|
|
76
|
+
override.cssSelector),
|
|
77
|
+
override?.variant === 'disabled' && React.createElement(Tag, { variant: "yellow" }, "checks disabled"),
|
|
78
|
+
override?.refreshBucket && React.createElement(Tag, { variant: "yellow" }, "refreshes bucket"))))))));
|
|
79
|
+
const BlocklistModule = ({ config }) => (React.createElement(React.Fragment, null,
|
|
80
|
+
React.createElement(Row, { label: "Mode" },
|
|
81
|
+
React.createElement(Tag, { variant: config.mode === 'block' ? 'red' : 'yellow' }, config.mode)),
|
|
82
|
+
React.createElement(Row, { label: "Provider" },
|
|
83
|
+
React.createElement(Tag, { variant: "grey" }, config.blocklist.provider),
|
|
84
|
+
config.blocklist.provider === 'dynamic' && React.createElement(Tag, null, config.blocklist.endpoint)),
|
|
85
|
+
config.blocklist.provider === 'static' && (React.createElement(React.Fragment, null,
|
|
86
|
+
React.createElement(Row, { label: "Blocked URL patterns" },
|
|
87
|
+
React.createElement(ListTags, { values: config.blocklist.blocklist.urls.map(entry => `${entry.matchType}: ${entry.pattern}`), variant: "grey" })),
|
|
88
|
+
config.blocklist.blocklist.labels && config.blocklist.blocklist.labels.length > 0 && (React.createElement(Row, { label: "Dynamic labels" },
|
|
89
|
+
React.createElement(ListTags, { values: config.blocklist.blocklist.labels.map(entry => `${entry.label} (${entry.matchType}${entry.reverseMatch ? ', reversed' : ''})`), variant: "grey" }))))),
|
|
90
|
+
config.mode === 'key-value' && (React.createElement(Row, { label: "Key value" },
|
|
91
|
+
React.createElement(Tag, null,
|
|
92
|
+
config.key,
|
|
93
|
+
" = ",
|
|
94
|
+
config.isBlocklistedValue ?? 'true')))));
|
|
95
|
+
const CleanupModule = ({ config }) => (React.createElement(React.Fragment, null,
|
|
96
|
+
config.configs.length === 0 && React.createElement("i", null, "No cleanup configs"),
|
|
97
|
+
config.configs.map((cleanupConfig, index) => (React.createElement(Row, { key: index, label: cleanupConfig.domId },
|
|
98
|
+
React.createElement(Tag, { variant: "blue" }, cleanupConfig.bidder),
|
|
99
|
+
'cssSelectors' in cleanupConfig.deleteMethod ? (React.createElement(Tag, { variant: "grey" },
|
|
100
|
+
"css: ",
|
|
101
|
+
cleanupConfig.deleteMethod.cssSelectors.join(', '))) : (React.createElement(Tag, { variant: "yellow" },
|
|
102
|
+
"JS snippet (",
|
|
103
|
+
cleanupConfig.deleteMethod.jsAsString.length,
|
|
104
|
+
")")))))));
|
|
105
|
+
const CustomModule = ({ config }) => (React.createElement(React.Fragment, null,
|
|
106
|
+
React.createElement(Row, { label: "Inline JS" }, config.inlineJs ? (React.createElement(Tag, { variant: "yellow" },
|
|
107
|
+
config.inlineJs.code.length,
|
|
108
|
+
" chars")) : (React.createElement("i", null, "none"))),
|
|
109
|
+
(config.scripts ?? []).map((script, index) => (React.createElement(Row, { key: index, label: `Script #${index + 1}` },
|
|
110
|
+
React.createElement(Tag, null, script.src),
|
|
111
|
+
script.consent && React.createElement(Tag, { variant: "green" },
|
|
112
|
+
"GVL vendor ",
|
|
113
|
+
script.consent.vendorId),
|
|
114
|
+
script.labelAll && React.createElement(Tag, { variant: "grey" },
|
|
115
|
+
"labelAll: ",
|
|
116
|
+
script.labelAll.join(', ')),
|
|
117
|
+
script.labelAny && React.createElement(Tag, { variant: "grey" },
|
|
118
|
+
"labelAny: ",
|
|
119
|
+
script.labelAny.join(', ')))))));
|
|
120
|
+
const ConfiantModule = ({ config }) => (React.createElement(React.Fragment, null,
|
|
121
|
+
React.createElement(Row, { label: "Asset URL" },
|
|
122
|
+
React.createElement(Tag, null, config.assetUrl)),
|
|
123
|
+
React.createElement(Row, { label: "GVLID check" },
|
|
124
|
+
React.createElement(BoolTag, { value: config.checkGVLID, trueLabel: "enabled", falseLabel: "disabled" }))));
|
|
125
|
+
const EmetriqModule = ({ config }) => (React.createElement(React.Fragment, null,
|
|
126
|
+
React.createElement(Row, { label: "Platform" },
|
|
127
|
+
React.createElement(Tag, { variant: "blue" }, config.os)),
|
|
128
|
+
config.os === 'web' ? (React.createElement(Row, { label: "SID" },
|
|
129
|
+
React.createElement(Tag, null, config._enqAdpParam.sid))) : (React.createElement(React.Fragment, null,
|
|
130
|
+
React.createElement(Row, { label: "SID / App ID" },
|
|
131
|
+
React.createElement(Tag, null, config.sid),
|
|
132
|
+
React.createElement(Tag, null, config.appId)),
|
|
133
|
+
React.createElement(Row, { label: "Advertiser ID key" },
|
|
134
|
+
React.createElement(Tag, { variant: "grey" }, config.advertiserIdKey)))),
|
|
135
|
+
React.createElement(Row, { label: "Sync delay" },
|
|
136
|
+
React.createElement(Tag, { variant: "grey" }, config.syncDelay === undefined
|
|
137
|
+
? 'none'
|
|
138
|
+
: config.syncDelay === 'pbjs'
|
|
139
|
+
? 'prebid auctionEnd'
|
|
140
|
+
: `${config.syncDelay}ms`)),
|
|
141
|
+
config.customMappingDefinition && config.customMappingDefinition.length > 0 && (React.createElement(Row, { label: "Custom mappings" },
|
|
142
|
+
React.createElement(ListTags, { values: config.customMappingDefinition.map(mapping => `${mapping.key} → ${mapping.param}`), variant: "grey" }))),
|
|
143
|
+
config.login && (React.createElement(Row, { label: "Login events" },
|
|
144
|
+
React.createElement(Tag, { variant: "green" },
|
|
145
|
+
"partner: ",
|
|
146
|
+
config.login.partner),
|
|
147
|
+
config.login.guid && React.createElement(Tag, { variant: "grey" }, "guid set")))));
|
|
148
|
+
const GeoEdgeModule = ({ config }) => (React.createElement(React.Fragment, null,
|
|
149
|
+
React.createElement(Row, { label: "Publisher key" },
|
|
150
|
+
React.createElement(Tag, null, config.key)),
|
|
151
|
+
React.createElement(Row, { label: "GVLID check" },
|
|
152
|
+
React.createElement(BoolTag, { value: config.checkGVLID, trueLabel: "enabled", falseLabel: "disabled" })),
|
|
153
|
+
config.cfg?.advs && (React.createElement(Row, { label: "Advertiser filter" },
|
|
154
|
+
React.createElement(ListTags, { values: Object.keys(config.cfg.advs), variant: "grey" }))),
|
|
155
|
+
config.cfg?.pubIds && (React.createElement(Row, { label: "AdX/AdSense filter" },
|
|
156
|
+
React.createElement(ListTags, { values: Object.keys(config.cfg.pubIds), variant: "grey" })))));
|
|
157
|
+
const IdentityLinkModule = ({ config }) => (React.createElement(React.Fragment, null,
|
|
158
|
+
React.createElement(Row, { label: "LaunchPad ID" },
|
|
159
|
+
React.createElement(Tag, null, config.launchPadId)),
|
|
160
|
+
React.createElement(Row, { label: "Email hashes" },
|
|
161
|
+
React.createElement(Tag, { variant: config.hashedEmailAddresses.length > 0 ? 'green' : 'grey' },
|
|
162
|
+
config.hashedEmailAddresses.length,
|
|
163
|
+
" provided"))));
|
|
164
|
+
const PubstackModule = ({ config }) => (React.createElement(Row, { label: "Tag ID" },
|
|
165
|
+
React.createElement(Tag, null, config.tagId)));
|
|
166
|
+
const SkinModule = ({ config }) => (React.createElement(React.Fragment, null, config.configs.map((skinConfig, index) => (React.createElement(Fragment, { key: index },
|
|
167
|
+
config.configs.length > 1 && React.createElement(SubHeadline, null,
|
|
168
|
+
"Config #",
|
|
169
|
+
index + 1),
|
|
170
|
+
React.createElement(Row, { label: "Skin slot" },
|
|
171
|
+
React.createElement(Tag, null, skinConfig.skinAdSlotDomId),
|
|
172
|
+
skinConfig.hideSkinAdSlot && React.createElement(Tag, { variant: "yellow" }, "hidden"),
|
|
173
|
+
skinConfig.destroySkinSlot && React.createElement(Tag, { variant: "yellow" }, "destroyed")),
|
|
174
|
+
React.createElement(Row, { label: "Blocked slots" },
|
|
175
|
+
React.createElement(ListTags, { values: skinConfig.blockedAdSlotDomIds, variant: "grey" })),
|
|
176
|
+
React.createElement(Row, { label: "Format filters" },
|
|
177
|
+
React.createElement(ListTags, { values: skinConfig.formatFilter.map(filter => 'auid' in filter && filter.auid !== undefined
|
|
178
|
+
? `${filter.bidder} (auid ${filter.auid})`
|
|
179
|
+
: filter.bidder) })),
|
|
180
|
+
React.createElement(Row, { label: "CPM comparison" },
|
|
181
|
+
React.createElement(BoolTag, { value: skinConfig.enableCpmComparison, trueLabel: "enforcing", falseLabel: "logging only" })),
|
|
182
|
+
skinConfig.targeting && (React.createElement(Row, { label: "Targeting" },
|
|
183
|
+
React.createElement(Tag, { variant: "grey" },
|
|
184
|
+
skinConfig.targeting.key,
|
|
185
|
+
" = ",
|
|
186
|
+
skinConfig.targeting.value ?? '1'))))))));
|
|
187
|
+
const StickyHeaderAdModule = ({ config }) => (React.createElement(React.Fragment, null,
|
|
188
|
+
React.createElement(Row, { label: "Header slot" },
|
|
189
|
+
React.createElement(Tag, null, config.headerAdDomId),
|
|
190
|
+
config.destroySlot && React.createElement(Tag, { variant: "yellow" }, "destroys slot")),
|
|
191
|
+
React.createElement(Row, { label: "Fade out" },
|
|
192
|
+
config.fadeOutTrigger === false ? (React.createElement(Tag, { variant: "grey" }, "always visible")) : (React.createElement(Tag, { variant: "grey" },
|
|
193
|
+
"on ",
|
|
194
|
+
config.fadeOutTrigger.selector)),
|
|
195
|
+
React.createElement(Tag, { variant: "grey" },
|
|
196
|
+
"class: ",
|
|
197
|
+
config.fadeOutClassName)),
|
|
198
|
+
config.minVisibleDurationMs !== undefined && (React.createElement(Row, { label: "Min visible duration" },
|
|
199
|
+
React.createElement(Tag, null,
|
|
200
|
+
config.minVisibleDurationMs,
|
|
201
|
+
"ms"))),
|
|
202
|
+
config.navbarConfig && (React.createElement(Row, { label: "Navbar" },
|
|
203
|
+
React.createElement(Tag, { variant: "grey" }, config.navbarConfig.selector))),
|
|
204
|
+
React.createElement(Row, { label: "Disallowed advertisers" },
|
|
205
|
+
React.createElement(ListTags, { values: config.disallowedAdvertiserIds, variant: "grey" }))));
|
|
206
|
+
const StickyFooterAdModule = ({ config }) => (React.createElement(React.Fragment, null,
|
|
207
|
+
React.createElement(Row, { label: "Mobile sticky slot" },
|
|
208
|
+
config.mobileStickyDomId ? React.createElement(Tag, null, config.mobileStickyDomId) : React.createElement("i", null, "none"),
|
|
209
|
+
config.initiallyHidden && React.createElement(Tag, { variant: "grey" }, "initially hidden")),
|
|
210
|
+
React.createElement(Row, { label: "Desktop floor ad slot" }, config.desktopFloorAdDomId ? React.createElement(Tag, null, config.desktopFloorAdDomId) : React.createElement("i", null, "none")),
|
|
211
|
+
React.createElement(Row, { label: "Disallowed advertisers" },
|
|
212
|
+
React.createElement(ListTags, { values: config.disallowedAdvertiserIds, variant: "grey" }))));
|
|
213
|
+
const StickyFooterAdV2Module = ({ config }) => (React.createElement(React.Fragment, null,
|
|
214
|
+
React.createElement(Row, { label: "Footer slots" }, Object.entries(config.stickyFooterDomIds).length === 0 ? (React.createElement("i", null, "none")) : (Object.entries(config.stickyFooterDomIds).map(([device, domId]) => (React.createElement(Tag, { key: device, variant: "blue" },
|
|
215
|
+
device,
|
|
216
|
+
": ",
|
|
217
|
+
domId))))),
|
|
218
|
+
config.closingButtonText && (React.createElement(Row, { label: "Close button text" },
|
|
219
|
+
React.createElement(Tag, { variant: "grey" }, config.closingButtonText))),
|
|
220
|
+
React.createElement(Row, { label: "Disallowed advertisers" },
|
|
221
|
+
React.createElement(ListTags, { values: config.disallowedAdvertiserIds, variant: "grey" }))));
|
|
222
|
+
const UtiqModule = ({ config }) => (React.createElement(React.Fragment, null,
|
|
223
|
+
React.createElement(Row, { label: "Asset URL" }, config.assetUrl ? React.createElement(Tag, null, config.assetUrl) : React.createElement("i", null, "default")),
|
|
224
|
+
React.createElement(Row, { label: "Delay" }, config.delay?.enabled ? (React.createElement(Tag, { variant: "yellow" },
|
|
225
|
+
"after ",
|
|
226
|
+
config.delay.minAdRequests ?? 0,
|
|
227
|
+
" ad requests")) : (React.createElement(Tag, { variant: "grey" }, "none"))),
|
|
228
|
+
config.options?.CMP === 'none' && (React.createElement(Row, { label: "CMP pop-up" },
|
|
229
|
+
React.createElement(Tag, { variant: "yellow" }, "suppressed"))),
|
|
230
|
+
config.userIdConfig?.emetriq && (React.createElement(Row, { label: "Emetriq integration" },
|
|
231
|
+
React.createElement(Tag, null,
|
|
232
|
+
"sid: ",
|
|
233
|
+
config.userIdConfig.emetriq.sid)))));
|
|
234
|
+
const PrebidFirstPartyDataModule = ({ config }) => (React.createElement(React.Fragment, null,
|
|
235
|
+
React.createElement(Row, { label: "IAB data provider" }, config.iabDataProviderName ? React.createElement(Tag, null, config.iabDataProviderName) : React.createElement("i", null, "not set")),
|
|
236
|
+
React.createElement(Row, { label: "Static first party data" },
|
|
237
|
+
React.createElement(BoolTag, { value: !!config.staticPrebidFirstPartyData, trueLabel: "provided", falseLabel: "none" })),
|
|
238
|
+
config.gptTargetingMappings && (React.createElement(Row, { label: "GPT targeting mappings" },
|
|
239
|
+
React.createElement(ListTags, { values: Object.entries(config.gptTargetingMappings).map(([property, key]) => `${key} → ${property}`), variant: "grey" })))));
|
|
240
|
+
const YieldOptimizationModule = ({ config }) => (React.createElement(React.Fragment, null,
|
|
241
|
+
React.createElement(Row, { label: "Provider" },
|
|
242
|
+
React.createElement(Tag, { variant: config.provider === 'none' ? 'grey' : 'blue' }, config.provider)),
|
|
243
|
+
config.provider === 'static' && (React.createElement(Row, { label: "Price rules" },
|
|
244
|
+
React.createElement(Tag, null,
|
|
245
|
+
Object.keys(config.config.rules).length,
|
|
246
|
+
" ad units"))),
|
|
247
|
+
config.provider === 'dynamic' && (React.createElement(React.Fragment, null,
|
|
248
|
+
React.createElement(Row, { label: "Endpoint" },
|
|
249
|
+
React.createElement(Tag, null, config.configEndpoint)),
|
|
250
|
+
React.createElement(Row, { label: "Excluded ad units" },
|
|
251
|
+
React.createElement(ListTags, { values: config.excludedAdUnitPaths, variant: "grey" })),
|
|
252
|
+
config.dynamicFloorPrices && (React.createElement(Row, { label: "Dynamic floors" },
|
|
253
|
+
React.createElement(Tag, { variant: "grey" },
|
|
254
|
+
"strategy: ",
|
|
255
|
+
config.dynamicFloorPrices.strategy),
|
|
256
|
+
React.createElement(Tag, { variant: "grey" },
|
|
257
|
+
"rounding: ",
|
|
258
|
+
config.dynamicFloorPrices.roundingStepsInCents,
|
|
259
|
+
" cent steps")))))));
|
|
260
|
+
const LazyLoadModule = ({ config }) => {
|
|
261
|
+
const optionTags = (options) => (React.createElement(React.Fragment, null,
|
|
262
|
+
options.rootId && React.createElement(Tag, { variant: "grey" },
|
|
263
|
+
"root: ",
|
|
264
|
+
options.rootId),
|
|
265
|
+
options.rootMargin && React.createElement(Tag, { variant: "grey" },
|
|
266
|
+
"margin: ",
|
|
267
|
+
options.rootMargin),
|
|
268
|
+
options.threshold !== undefined && React.createElement(Tag, { variant: "grey" },
|
|
269
|
+
"threshold: ",
|
|
270
|
+
options.threshold)));
|
|
271
|
+
return (React.createElement(React.Fragment, null,
|
|
272
|
+
config.slots.map((slotConfig, index) => (React.createElement(Row, { key: index, label: "Slots" },
|
|
273
|
+
React.createElement(ListTags, { values: slotConfig.domIds }),
|
|
274
|
+
optionTags(slotConfig.options)))),
|
|
275
|
+
config.buckets.map((bucketConfig, index) => (React.createElement(Row, { key: index, label: "Bucket" },
|
|
276
|
+
React.createElement(Tag, { variant: "blue" }, bucketConfig.bucket),
|
|
277
|
+
React.createElement(Tag, { variant: "grey" },
|
|
278
|
+
"observes: ",
|
|
279
|
+
bucketConfig.observedDomId),
|
|
280
|
+
optionTags(bucketConfig.options)))),
|
|
281
|
+
(config.infiniteSlots ?? []).map((infiniteConfig, index) => (React.createElement(Row, { key: index, label: "Infinite slots" },
|
|
282
|
+
React.createElement(Tag, { variant: "blue" }, infiniteConfig.selector),
|
|
283
|
+
optionTags(infiniteConfig.options))))));
|
|
284
|
+
};
|
|
285
|
+
const ZeotapModule = ({ config }) => (React.createElement(React.Fragment, null,
|
|
286
|
+
React.createElement(Row, { label: "Asset URL" },
|
|
287
|
+
React.createElement(Tag, null, config.assetUrl)),
|
|
288
|
+
React.createElement(Row, { label: "Mode" },
|
|
289
|
+
React.createElement(Tag, { variant: "blue" }, config.mode),
|
|
290
|
+
config.countryCode && React.createElement(Tag, { variant: "grey" }, config.countryCode)),
|
|
291
|
+
React.createElement(Row, { label: "ID+ (hashed email)" },
|
|
292
|
+
React.createElement(BoolTag, { value: !!config.hashedEmailAddress, trueLabel: "active", falseLabel: "inactive" })),
|
|
293
|
+
React.createElement(Row, { label: "Data key values" },
|
|
294
|
+
React.createElement(ListTags, { values: config.dataKeyValues.map(pair => `${pair.keyValueKey} → ${pair.parameterKey}`), variant: "grey" })),
|
|
295
|
+
React.createElement(Row, { label: "Exclusions" },
|
|
296
|
+
React.createElement(ListTags, { values: config.exclusionKeyValues.map(pair => `${pair.keyValueKey}=${pair.disableOnValue}`), variant: "grey" }))));
|
|
297
|
+
const InterstitialModule = ({ config }) => (React.createElement(React.Fragment, null,
|
|
298
|
+
React.createElement(Row, { label: "Interstitial slot" },
|
|
299
|
+
React.createElement(Tag, null, config.interstitialDomId)),
|
|
300
|
+
React.createElement(Row, { label: "Auto close" }, config.closeAutomaticallyAfterMs !== undefined ? (React.createElement(Tag, null,
|
|
301
|
+
config.closeAutomaticallyAfterMs,
|
|
302
|
+
"ms")) : (React.createElement("i", null, "never"))),
|
|
303
|
+
React.createElement(Row, { label: "Disallowed advertisers" },
|
|
304
|
+
React.createElement(ListTags, { values: config.disallowedAdvertiserIds, variant: "grey" }))));
|
|
305
|
+
const MoliAnalyticsModule = ({ config }) => (React.createElement(React.Fragment, null,
|
|
306
|
+
React.createElement(Row, { label: "Publisher" },
|
|
307
|
+
React.createElement(Tag, null, config.publisher)),
|
|
308
|
+
React.createElement(Row, { label: "Collection URL" },
|
|
309
|
+
React.createElement(Tag, null, config.url)),
|
|
310
|
+
React.createElement(Row, { label: "Batching" },
|
|
311
|
+
React.createElement(Tag, { variant: "grey" },
|
|
312
|
+
"size: ",
|
|
313
|
+
config.batchSize ?? 1),
|
|
314
|
+
React.createElement(Tag, { variant: "grey" },
|
|
315
|
+
"delay: ",
|
|
316
|
+
config.batchDelay ?? 100,
|
|
317
|
+
"ms"))));
|
|
318
|
+
const GenericModule = ({ config, subEntry }) => (React.createElement(React.Fragment, null, Object.entries(config)
|
|
319
|
+
.filter(([key]) => key !== 'enabled')
|
|
320
|
+
.map(([key, value]) => (React.createElement(TagContainer, { key: key, subEntry: subEntry },
|
|
321
|
+
React.createElement(TagLabel, null, key),
|
|
322
|
+
value === undefined || value === null ? (React.createElement("i", null, "not set")) : Array.isArray(value) ? (value.length === 0 ? (React.createElement("i", null, "none")) : (value.map((entry, index) => typeof entry === 'object' && entry !== null ? (React.createElement(GenericModule, { key: index, config: entry, subEntry: true })) : (React.createElement(Tag, { key: index, variant: "grey" }, String(entry)))))) : typeof value === 'object' ? (React.createElement(GenericModule, { config: value, subEntry: true })) : (React.createElement(Tag, { variant: "grey" }, String(value))))))));
|
|
323
|
+
const moduleComponents = {
|
|
324
|
+
adex: AdexModule,
|
|
325
|
+
adReload: AdReloadModule,
|
|
326
|
+
blocklist: BlocklistModule,
|
|
327
|
+
cleanup: CleanupModule,
|
|
328
|
+
custom: CustomModule,
|
|
329
|
+
confiant: ConfiantModule,
|
|
330
|
+
emetriq: EmetriqModule,
|
|
331
|
+
geoedge: GeoEdgeModule,
|
|
332
|
+
identitylink: IdentityLinkModule,
|
|
333
|
+
pubstack: PubstackModule,
|
|
334
|
+
skin: SkinModule,
|
|
335
|
+
stickyHeaderAd: StickyHeaderAdModule,
|
|
336
|
+
utiq: UtiqModule,
|
|
337
|
+
prebidFirstPartyData: PrebidFirstPartyDataModule,
|
|
338
|
+
yieldOptimization: YieldOptimizationModule,
|
|
339
|
+
stickyFooterAd: StickyFooterAdModule,
|
|
340
|
+
stickyFooterAdV2: StickyFooterAdV2Module,
|
|
341
|
+
lazyload: LazyLoadModule,
|
|
342
|
+
zeotap: ZeotapModule,
|
|
343
|
+
interstitial: InterstitialModule,
|
|
344
|
+
moliAnalytics: MoliAnalyticsModule
|
|
345
|
+
};
|
|
346
|
+
const ModuleConfigCard = ({ name, config }) => {
|
|
347
|
+
const ModuleComponent = moduleComponents[name];
|
|
348
|
+
return (React.createElement("div", { className: "d-collapse d-collapse-arrow mb-2 rounded-md bg-base-200" },
|
|
349
|
+
React.createElement("input", { type: "checkbox", "aria-label": `toggle module ${name}` }),
|
|
350
|
+
React.createElement("div", { className: "d-collapse-title min-h-0 py-2 text-sm font-semibold" },
|
|
351
|
+
name,
|
|
352
|
+
' ',
|
|
353
|
+
React.createElement(Tag, { variant: config.enabled ? 'green' : 'grey' }, config.enabled ? 'enabled' : 'disabled')),
|
|
354
|
+
React.createElement("div", { className: "d-collapse-content text-sm" }, ModuleComponent ? React.createElement(ModuleComponent, { config: config }) : React.createElement(GenericModule, { config: config }))));
|
|
355
|
+
};
|
|
356
|
+
export const ModuleConfigs = ({ modules: modulesConfig }) => {
|
|
357
|
+
const entries = Object.entries(modulesConfig);
|
|
358
|
+
return entries.length === 0 ? (React.createElement("span", null, "No modules configured.")) : (React.createElement(React.Fragment, null, entries.map(([name, config]) => (React.createElement(ModuleConfigCard, { key: name, name: name, config: config })))));
|
|
359
|
+
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Tag } from './tag';
|
|
3
|
-
import {
|
|
2
|
+
import { Tag, TagLabel } from './tag';
|
|
3
|
+
import { TagContainer } from './ui';
|
|
4
4
|
export const SizeConfigDebug = ({ sizeConfig, supportedLabels }) => {
|
|
5
5
|
return (React.createElement("div", null, sizeConfig.map((sizeConfigEntry, idx) => {
|
|
6
6
|
const mediaQueryMatches = window.matchMedia(sizeConfigEntry.mediaQuery).matches;
|
|
7
|
-
return (React.createElement("div", { key: idx, className: "
|
|
7
|
+
return (React.createElement("div", { key: idx, className: "mb-2" },
|
|
8
8
|
"Entry ",
|
|
9
9
|
React.createElement("strong", null,
|
|
10
10
|
"#",
|
|
11
11
|
idx + 1),
|
|
12
|
-
React.createElement(
|
|
13
|
-
React.createElement(
|
|
14
|
-
React.createElement(
|
|
15
|
-
sizeConfigEntry.labelAll && (React.createElement(
|
|
16
|
-
React.createElement(
|
|
12
|
+
React.createElement(TagContainer, null,
|
|
13
|
+
React.createElement(TagLabel, null, "Media query"),
|
|
14
|
+
React.createElement(Tag, { variant: mediaQueryMatches ? 'green' : 'red', title: `Media query ${mediaQueryMatches ? 'matches' : "doesn't match"}` }, sizeConfigEntry.mediaQuery)),
|
|
15
|
+
sizeConfigEntry.labelAll && (React.createElement(TagContainer, null,
|
|
16
|
+
React.createElement(TagLabel, null, "Label All"),
|
|
17
17
|
sizeConfigEntry.labelAll.map(label => {
|
|
18
18
|
const labelMatches = supportedLabels.includes(label);
|
|
19
|
-
return (React.createElement(
|
|
19
|
+
return (React.createElement(Tag, { key: label, variant: labelMatches ? 'green' : 'red', title: `Labels ${labelMatches ? 'match' : "don't match"}` }, label));
|
|
20
20
|
}))),
|
|
21
|
-
sizeConfigEntry.labelNone && (React.createElement(
|
|
22
|
-
React.createElement(
|
|
21
|
+
sizeConfigEntry.labelNone && (React.createElement(TagContainer, null,
|
|
22
|
+
React.createElement(TagLabel, null, "Label None"),
|
|
23
23
|
sizeConfigEntry.labelNone.map(label => {
|
|
24
24
|
const labelMatches = supportedLabels.includes(label);
|
|
25
|
-
return (React.createElement(
|
|
25
|
+
return (React.createElement(Tag, { key: label, variant: labelMatches ? 'red' : 'green', title: `Labels ${labelMatches ? 'match' : "don't match"}` }, label));
|
|
26
26
|
}))),
|
|
27
|
-
React.createElement(
|
|
28
|
-
React.createElement(
|
|
27
|
+
React.createElement(TagContainer, null,
|
|
28
|
+
React.createElement(TagLabel, null, "Supported slot sizes"),
|
|
29
29
|
sizeConfigEntry.sizesSupported.map((slotSize) => {
|
|
30
30
|
const sizeString = slotSize === 'fluid' ? slotSize : `${slotSize[0]}x${slotSize[1]}`;
|
|
31
31
|
return React.createElement(Tag, { key: sizeString }, sizeString);
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { classList } from '../util/stringUtils';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const variantClasses = {
|
|
4
|
+
secondary: 'd-badge-secondary',
|
|
5
|
+
green: 'd-badge-success text-white',
|
|
6
|
+
red: 'd-badge-error text-white',
|
|
7
|
+
yellow: 'd-badge-warning',
|
|
8
|
+
blue: 'd-badge-outline d-badge-primary',
|
|
9
|
+
grey: 'd-badge-neutral',
|
|
10
|
+
transparent: 'd-badge-ghost'
|
|
11
|
+
};
|
|
12
|
+
export const Tag = ({ children, variant, title, spacing }) => (React.createElement("div", { className: classList('d-badge d-badge-sm ml-1 h-auto min-h-5 whitespace-normal break-all text-left', variantClasses[variant ?? 'blue'], [spacing === 'medium', 'mb-1']), title: title }, children));
|
|
13
|
+
export const TagLabel = ({ children }) => (React.createElement("span", { className: "inline-block min-w-36 max-w-96 pr-1 align-middle font-medium" }, children));
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { classList } from '../util/stringUtils';
|
|
3
|
+
const sectionAccent = {
|
|
4
|
+
moli: 'border-l-[#998fc7]',
|
|
5
|
+
slots: 'border-l-[#506684]',
|
|
6
|
+
targeting: 'border-l-[#998fc7]',
|
|
7
|
+
sizeConfig: 'border-l-[#d4c2fc]',
|
|
8
|
+
modules: 'border-l-[#8a7de0]',
|
|
9
|
+
prebid: 'border-l-[#76949f]',
|
|
10
|
+
a9: 'border-l-[#ea9445]',
|
|
11
|
+
consent: 'border-l-[#d9f4c7]',
|
|
12
|
+
supplyChain: 'border-l-[#82dad8]',
|
|
13
|
+
adDensity: 'border-l-[#f176af]',
|
|
14
|
+
validation: 'border-l-[#f4ef88]'
|
|
15
|
+
};
|
|
16
|
+
export const Block = ({ title, color, children }) => (React.createElement("section", { className: classList('mb-4 border-l-4 bg-base-100 pl-3', sectionAccent[color]) },
|
|
17
|
+
React.createElement("h4", { className: "mb-1 text-base font-semibold" }, title),
|
|
18
|
+
React.createElement("div", { className: "pb-1 text-sm" }, children)));
|
|
19
|
+
export const Tabs = ({ tabs, active, onSelect, className }) => (React.createElement("div", { role: "tablist", className: classList('d-tabs d-tabs-bordered w-full', className ?? '') }, tabs.map(tab => (React.createElement("button", { key: tab.id, role: "tab", "aria-selected": tab.id === active, className: classList('d-tab border-x-0 border-t-0 bg-transparent font-semibold', [
|
|
20
|
+
tab.id === active,
|
|
21
|
+
'd-tab-active'
|
|
22
|
+
]), onClick: () => onSelect(tab.id) }, tab.label)))));
|
|
23
|
+
export const Toggle = ({ checked, disabled, title, onChange }) => (React.createElement("input", { type: "checkbox", className: "d-toggle d-toggle-secondary d-toggle-sm border border-solid border-primary", checked: checked, disabled: disabled, title: title, onChange: e => onChange(e.target.checked) }));
|
|
24
|
+
export const TagContainer = ({ subEntry, children }) => (React.createElement("div", { className: classList('mt-2 flex flex-wrap items-center gap-y-1', [
|
|
25
|
+
!!subEntry,
|
|
26
|
+
"ml-2.5 before:mr-1 before:content-['↳']"
|
|
27
|
+
]) }, children));
|
|
28
|
+
const btnVariantClasses = {
|
|
29
|
+
neutral: '',
|
|
30
|
+
green: 'd-btn-primary',
|
|
31
|
+
yellow: 'd-btn-warning',
|
|
32
|
+
blue: 'd-btn-outline d-btn-primary',
|
|
33
|
+
red: 'd-btn-error text-white'
|
|
34
|
+
};
|
|
35
|
+
export const Btn = ({ variant, title, disabled, type, active, onClick, children }) => (React.createElement("button", { className: classList('d-btn d-btn-xs ml-1 font-normal normal-case', btnVariantClasses[variant ?? 'neutral'], [!!active, 'd-btn-active']), title: title, disabled: disabled, type: type ?? 'button', onClick: onClick }, children));
|
|
36
|
+
const panelVariantClasses = {
|
|
37
|
+
grey: 'bg-base-200 text-base-content',
|
|
38
|
+
red: 'bg-[#e9898b] text-black',
|
|
39
|
+
blue: 'bg-[#edf6fc] text-black'
|
|
40
|
+
};
|
|
41
|
+
export const Panel = ({ variant, collapsible, children }) => (React.createElement("div", { className: classList('mb-2 max-w-md rounded-md p-2 text-sm [&_ul]:my-1 [&_ul]:list-disc [&_ul]:pl-5', panelVariantClasses[variant ?? 'grey'], [!!collapsible, 'shadow-md']) }, children));
|
|
42
|
+
export const SubHeadline = ({ children }) => (React.createElement("h5", { className: "mb-1 mt-3 text-sm font-bold" }, children));
|
|
43
|
+
export const TextInput = props => (React.createElement("input", { className: "d-input d-input-bordered d-input-xs mx-1 w-44 bg-base-100", type: props.type ?? 'text', ...props }));
|
package/lib/console/debug.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { createRoot } from 'react-dom/client';
|
|
3
3
|
import { GlobalConfig } from './components/globalConfig';
|
|
4
|
-
import { AdSlotConfig } from './components/adSlotConfig';
|
|
5
|
-
import './debug.pcss';
|
|
6
4
|
import { ThemingService } from './util/themingService';
|
|
7
5
|
import { WindowResizeService } from './util/windowResizeService';
|
|
8
6
|
import { createLabelConfigService } from '../ads/labelConfigService';
|
|
@@ -16,8 +14,6 @@ if (moliConfig) {
|
|
|
16
14
|
container.classList.add('moli-console-container');
|
|
17
15
|
const shadowRoot = container.attachShadow({ mode: 'open' });
|
|
18
16
|
const DebugConsole = () => {
|
|
19
|
-
const [showOverlays, setShowOverlays] = React.useState(false);
|
|
20
|
-
const slotRoots = React.useRef(new Map());
|
|
21
17
|
React.useEffect(() => {
|
|
22
18
|
setTimeout(() => {
|
|
23
19
|
const globalConfigComponentRoot = shadowRoot.getElementById('moli-console-global-config');
|
|
@@ -26,29 +22,8 @@ if (moliConfig) {
|
|
|
26
22
|
themingService.enableSystemThemeListener();
|
|
27
23
|
}, 200);
|
|
28
24
|
}, []);
|
|
29
|
-
React.
|
|
30
|
-
|
|
31
|
-
moliConfig.slots.forEach(slot => {
|
|
32
|
-
const slotDomElement = document.getElementById(slot.domId);
|
|
33
|
-
if (slotDomElement && labelConfigService.filterSlot(slot)) {
|
|
34
|
-
let slotConfigRoot = slotRoots.current.get(slot.domId);
|
|
35
|
-
if (!slotConfigRoot) {
|
|
36
|
-
slotConfigRoot = createRoot(slotDomElement);
|
|
37
|
-
slotRoots.current.set(slot.domId, slotConfigRoot);
|
|
38
|
-
}
|
|
39
|
-
slotConfigRoot.render(React.createElement(AdSlotConfig, { labelConfigService: labelConfigService, slot: slot, parentElement: slotDomElement }));
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
slotRoots.current.forEach(root => {
|
|
45
|
-
root.unmount();
|
|
46
|
-
});
|
|
47
|
-
slotRoots.current.clear();
|
|
48
|
-
}
|
|
49
|
-
}, [showOverlays]);
|
|
50
|
-
return (React.createElement(React.Fragment, null,
|
|
51
|
-
React.createElement(GlobalConfig, { config: moliConfig, runtimeConfig: window.moli.getRuntimeConfig(), modules: window.moli.getConfig()?.modules || {}, labelConfigService: labelConfigService, windowResizeService: new WindowResizeService(), themingService: themingService, showOverlays: showOverlays, onShowOverlaysChange: setShowOverlays })));
|
|
25
|
+
return (React.createElement("div", { className: "font-sans text-base text-foreground antialiased" },
|
|
26
|
+
React.createElement(GlobalConfig, { config: moliConfig, runtimeConfig: window.moli.getRuntimeConfig(), modules: window.moli.getConfig()?.modules || {}, labelConfigService: labelConfigService, windowResizeService: new WindowResizeService(), themingService: themingService })));
|
|
52
27
|
};
|
|
53
28
|
window.document.body.append(container);
|
|
54
29
|
const root = createRoot(shadowRoot);
|