@betarena/ad-engine 0.0.73 → 0.0.75
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/package.json
CHANGED
|
@@ -352,10 +352,14 @@
|
|
|
352
352
|
mapZoneToTagIds = new Map (dataRes0.success.data.mapZoneIdToTagIds)
|
|
353
353
|
;
|
|
354
354
|
|
|
355
|
+
// ╭──────────────────────────────────────────────────────────────────────────────────╮
|
|
356
|
+
// │ 💠 │ STEP :: ADVERT INJECTION │
|
|
357
|
+
// ╰──────────────────────────────────────────────────────────────────────────────────╯
|
|
358
|
+
|
|
355
359
|
// ╭─────
|
|
356
360
|
// │ NOTE:
|
|
357
|
-
// │
|
|
358
|
-
// │
|
|
361
|
+
// │ |: [1] loop over retrieved/fetched elements identified in 'document',
|
|
362
|
+
// │ |: [2] AND inject target 'ADVERTS' in target specific locations.
|
|
359
363
|
// ┣─────
|
|
360
364
|
// ┃ ZONE-ID :: 1,2,3,4
|
|
361
365
|
// ╰─────
|
|
@@ -476,15 +480,16 @@
|
|
|
476
480
|
}
|
|
477
481
|
|
|
478
482
|
// ╭─────
|
|
479
|
-
// │ CHECK
|
|
483
|
+
// │ CHECK:
|
|
480
484
|
// │ |: for case of injection of 'GLOBAL' placements for adverts,
|
|
481
|
-
// │ |: (a.k.a SLIDER / POPUP ads)
|
|
485
|
+
// │ |: ⦿ (a.k.a SLIDER / POPUP ads)
|
|
486
|
+
// │ |: ⦿ (a.k.a document.body injections)
|
|
482
487
|
// ╰─────
|
|
483
488
|
if (authorId || authorArticleTagIds.length > 0)
|
|
484
489
|
{
|
|
485
490
|
// ╭─────
|
|
486
491
|
// │ NOTE:
|
|
487
|
-
// │ |:
|
|
492
|
+
// │ |: loop over creative data AND inject adverts, based on 'authorId'
|
|
488
493
|
// ╰─────
|
|
489
494
|
for (const [zoneId, authorIds] of mapZoneToAuthorIds)
|
|
490
495
|
{
|
|
@@ -567,7 +572,7 @@
|
|
|
567
572
|
|
|
568
573
|
// ╭─────
|
|
569
574
|
// │ NOTE:
|
|
570
|
-
// │ |:
|
|
575
|
+
// │ |: loop over creative data AND inject adverts, based on 'tagIds'
|
|
571
576
|
// ╰─────
|
|
572
577
|
for (const [zoneId, tagIds] of mapZoneToTagIds)
|
|
573
578
|
{
|
|
@@ -649,10 +654,12 @@
|
|
|
649
654
|
}
|
|
650
655
|
}
|
|
651
656
|
// ╭─────
|
|
652
|
-
// │ CHECK
|
|
653
|
-
// │ |: otherwise, case where NO (1) 'authorId' OR (2) 'tagIds' are present
|
|
654
|
-
// │ |:
|
|
655
|
-
// │ |:
|
|
657
|
+
// │ CHECK:
|
|
658
|
+
// │ |: otherwise, case where NO (1) 'authorId' OR (2) 'tagIds' are present:
|
|
659
|
+
// │ |: ⦿ (a.k.a NO Global Ads Placements)
|
|
660
|
+
// │ |: BUT, data for ADS was still successfully fetched
|
|
661
|
+
// │ |: ⦿ (a.k.a Advert Condition was RETRIEVED/HIT).
|
|
662
|
+
// │ |: Inject STANDARD SLIDER adverts in 'document.body'
|
|
656
663
|
// ╰─────
|
|
657
664
|
else
|
|
658
665
|
{
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
import iconArrow from './assets/icon-external-link.svg';
|
|
44
44
|
|
|
45
|
-
import type { AdsCreativeMain } from '@betarena/scores-lib/types/
|
|
45
|
+
import type { AdsCreativeMain } from '@betarena/scores-lib/types/v8/_HASURA-0.js';
|
|
46
46
|
|
|
47
47
|
// #endregion ➤ 📦 Package Imports
|
|
48
48
|
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
<iframe
|
|
106
106
|
width=250
|
|
107
107
|
height=250
|
|
108
|
-
src={adData.data
|
|
108
|
+
src={adData.data.media}
|
|
109
109
|
/>
|
|
110
110
|
<!--
|
|
111
111
|
<video
|
|
@@ -115,6 +115,32 @@
|
|
|
115
115
|
/>
|
|
116
116
|
-->
|
|
117
117
|
|
|
118
|
+
{:else if adData.type == 3 && adData.data?.code}
|
|
119
|
+
|
|
120
|
+
<!--
|
|
121
|
+
sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation"
|
|
122
|
+
referrerpolicy="no-referrer-when-downgrade"
|
|
123
|
+
-->
|
|
124
|
+
|
|
125
|
+
<iframe
|
|
126
|
+
title="ad"
|
|
127
|
+
width=300
|
|
128
|
+
height=250
|
|
129
|
+
srcdoc='
|
|
130
|
+
<!doctype html>
|
|
131
|
+
<html>
|
|
132
|
+
<head>
|
|
133
|
+
<meta charset="utf-8">
|
|
134
|
+
</head>
|
|
135
|
+
<body
|
|
136
|
+
style="margin:0"
|
|
137
|
+
>
|
|
138
|
+
{adData.data.code}
|
|
139
|
+
</body>
|
|
140
|
+
</html>
|
|
141
|
+
'
|
|
142
|
+
/>
|
|
143
|
+
|
|
118
144
|
{:else if (adData.type == 2)}
|
|
119
145
|
<img
|
|
120
146
|
id='banner'
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
import { betarenaEndpoint } from './constants/instance.js';
|
|
45
45
|
import { storeAdmin } from './store/admin';
|
|
46
46
|
|
|
47
|
-
import type { AdsCreativeMain } from '@betarena/scores-lib/types/v8/_HASURA-0';
|
|
47
|
+
import type { AdsCreativeMain } from '@betarena/scores-lib/types/v8/_HASURA-0.js';
|
|
48
48
|
|
|
49
49
|
// #endregion ➤ 📦 Package Imports
|
|
50
50
|
|
|
@@ -322,6 +322,32 @@
|
|
|
322
322
|
/>
|
|
323
323
|
</a>
|
|
324
324
|
|
|
325
|
+
{:else if adData.type == 3 && adData.data?.code}
|
|
326
|
+
|
|
327
|
+
<!--
|
|
328
|
+
sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation"
|
|
329
|
+
referrerpolicy="no-referrer-when-downgrade"
|
|
330
|
+
-->
|
|
331
|
+
|
|
332
|
+
<iframe
|
|
333
|
+
title="ad"
|
|
334
|
+
width=300
|
|
335
|
+
height=250
|
|
336
|
+
srcdoc='
|
|
337
|
+
<!doctype html>
|
|
338
|
+
<html>
|
|
339
|
+
<head>
|
|
340
|
+
<meta charset="utf-8">
|
|
341
|
+
</head>
|
|
342
|
+
<body
|
|
343
|
+
style="margin:0"
|
|
344
|
+
>
|
|
345
|
+
{adData.data.code}
|
|
346
|
+
</body>
|
|
347
|
+
</html>
|
|
348
|
+
'
|
|
349
|
+
/>
|
|
350
|
+
|
|
325
351
|
{:else if (adData.type == 2)}
|
|
326
352
|
<img
|
|
327
353
|
id='banner'
|