@betarena/ad-engine 0.0.69 → 0.0.71

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/vite.svg CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betarena/ad-engine",
3
- "version": "0.0.69",
3
+ "version": "0.0.71",
4
4
  "private": false,
5
5
  "description": "Betarena ad-engine widget",
6
6
  "keywords": [
@@ -12,10 +12,6 @@
12
12
  "widget",
13
13
  "script-tag"
14
14
  ],
15
- "files": [
16
- "src",
17
- "dist"
18
- ],
19
15
  "author": {
20
16
  "name": "migbash",
21
17
  "email": "20924663+migbash@users.noreply.github.com",
@@ -29,21 +25,48 @@
29
25
  "type": "git",
30
26
  "url": "https://github.com/Betarena/ad-engine/issues"
31
27
  },
28
+ "files": [
29
+ "dist",
30
+ "src"
31
+ ],
32
+ "type": "module",
33
+ "main": "./dist/index.js",
34
+ "svelte": "./src/index.js",
35
+ "exports": {
36
+ ".": {
37
+ "svelte": "./src/index.js",
38
+ "require": "./dist/index.cjs",
39
+ "import": "./dist/index.mjs",
40
+ "default": "./dist/index.js",
41
+ "types": "./dist/index.d.ts"
42
+ },
43
+ "./dist": "./dist/index.js"
44
+ },
32
45
  "scripts": {
33
- "build": "vite build",
46
+ "____________________________________NPM-LIFECYCLE____________________________________": "",
34
47
  "start": "node dist/index.js",
35
- "vite/dev": "vite --host",
36
- "vite/dev/1-click/npm": "npm run 'sass/watch' & npm run 'vite/dev'",
37
- "vite/dev/1-click/pnpm": "pnpm run 'sass/watch' & pnpm run 'vite/dev'",
48
+ "____________________________________VITE____________________________________": "",
49
+ "vite/dev": "vite dev",
50
+ "vite/dev/1-click/npm": "npm run sass/watch & npm run vite/dev",
51
+ "vite/dev/1-click/pnpm": "pnpm run sass/watch & pnpm run vite/dev",
52
+ "vite/1-click/pnpm/+local/scores-lib": "pnpm run pnpm/link/@betarena/scores-lib && pnpm run vite/dev/1-click/pnpm",
53
+ "vite/build": "vite build",
38
54
  "vite/preview": "vite preview",
39
- "svelte-check": "svelte-check --tsconfig ./tsconfig.json",
55
+ "____________________________________DEPENDENCY____________________________________": "",
40
56
  "npm/next/@betarena/scores-lib": "npm i @betarena/scores-lib@latest",
41
57
  "npm/link/@betarena/scores-lib": "npm link @betarena/scores-lib && npm ls --link --global",
42
58
  "npm/link": "npm link",
43
- "npm/bump+publish": "npm version patch && npm publish",
44
- "sass/watch": "sass --watch src/style/app.scss src/style/app.css",
59
+ "npm/publish": "npm publish",
60
+ "pnpm/init": "pnpm run clean/node_modules && pnpm import && pnpm install",
45
61
  "pnpm/link": "pnpm link --dir . --global",
46
- "pnpm/link/@betarena/scores-lib": "pnpm link --global @betarena/scores-lib"
62
+ "pnpm/link/@betarena/scores-lib": "pnpm link --global @betarena/scores-lib",
63
+ "____________________________________HELPER____________________________________": "",
64
+ "clean/node_modules": "rm -rf ./node_modules",
65
+ "clean/dist": "rm -rf ./dist",
66
+ "____________________________________PLUGIN____________________________________": "",
67
+ "svelte-check": "svelte-check --tsconfig ./tsconfig.json",
68
+ "____________________________________MISCELLENOUS____________________________________": "",
69
+ "sass/watch": "sass --watch src/style/app.scss src/style/app.css"
47
70
  },
48
71
  "devDependencies": {
49
72
  "@sveltejs/vite-plugin-svelte": "3.0.2",
@@ -63,23 +86,12 @@
63
86
  "dependencies": {
64
87
  "@betarena/scores-lib": "4.1.0",
65
88
  "@fontsource/roboto": "5.0.12",
89
+ "dedent": "1.6.0",
90
+ "table": "6.9.0",
66
91
  "chalk": "5.3.0",
67
92
  "colorthief": "2.6.0",
68
93
  "device-detector-js": "3.0.3",
69
94
  "svelte-preprocess": "5.1.3",
70
95
  "ua-parser-js": "2.0.0"
71
- },
72
- "main": "./dist/index.js",
73
- "svelte": "./src/index.js",
74
- "exports": {
75
- ".": {
76
- "svelte": "./src/index.js",
77
- "require": "./dist/index.cjs",
78
- "import": "./dist/index.mjs",
79
- "default": "./dist/index.js",
80
- "types": "./dist/index.d.ts"
81
- },
82
- "./dist": "./dist/index.js"
83
- },
84
- "type": "module"
96
+ }
85
97
  }
@@ -38,7 +38,7 @@
38
38
  // │ 5. type(s) imports(s) │
39
39
  // ╰────────────────────────────────────────────────────────────────────────╯
40
40
 
41
- import { onMount } from 'svelte';
41
+ import { onDestroy, onMount, SvelteComponent } from 'svelte';
42
42
  // import '@fontsource/roboto';
43
43
 
44
44
  import { ServiceAdEngine } from '@betarena/scores-lib/dist/classes/_service.adengine.js';
@@ -141,6 +141,14 @@
141
141
  mapCreative = new Map < number, AdsCreativeMain > ()
142
142
  ;
143
143
 
144
+ const
145
+ /**
146
+ * @description
147
+ * 📝 `List` of dynamically created advert components (to be destroyed on cleanup)
148
+ */
149
+ listAdWidgetElements: SvelteComponent[] = []
150
+ ;
151
+
144
152
  // #endregion ➤ 📌 VARIABLES
145
153
 
146
154
  // #region ➤ 🛠️ METHODS
@@ -536,15 +544,18 @@
536
544
  {
537
545
  if (zoneId != 1) continue;
538
546
 
539
- new WidgetAdvertSlide
547
+ listAdWidgetElements.push
540
548
  (
541
- {
542
- target: document.body,
543
- props:
549
+ new WidgetAdvertSlide
550
+ (
544
551
  {
545
- adData
552
+ target: document.body,
553
+ props:
554
+ {
555
+ adData
556
+ }
546
557
  }
547
- }
558
+ )
548
559
  );
549
560
  }
550
561
  }
@@ -616,15 +627,18 @@
616
627
  {
617
628
  if (zoneId != 1) continue;
618
629
 
619
- new WidgetAdvertSlide
630
+ listAdWidgetElements.push
620
631
  (
621
- {
622
- target: document.body,
623
- props:
632
+ new WidgetAdvertSlide
633
+ (
624
634
  {
625
- adData
635
+ target: document.body,
636
+ props:
637
+ {
638
+ adData
639
+ }
626
640
  }
627
- }
641
+ )
628
642
  );
629
643
  }
630
644
  }
@@ -654,15 +668,18 @@
654
668
  {
655
669
  if (adData.type != 1) continue;
656
670
 
657
- new WidgetAdvertSlide
671
+ listAdWidgetElements.push
658
672
  (
659
- {
660
- target: document.body,
661
- props:
673
+ new WidgetAdvertSlide
674
+ (
662
675
  {
663
- adData
676
+ target: document.body,
677
+ props:
678
+ {
679
+ adData
680
+ }
664
681
  }
665
- }
682
+ )
666
683
  );
667
684
  }
668
685
  }
@@ -736,6 +753,31 @@
736
753
  }
737
754
  );
738
755
 
756
+ onDestroy
757
+ (
758
+ () =>
759
+ {
760
+ // [🐞]
761
+ logger
762
+ (
763
+ [
764
+ 'Betarena Ad-Engine ⏰ onMount ⏰ cleanup',
765
+ `🔹 [var] ➤ listAdWidgetElements.length ${listAdWidgetElements.length}`
766
+ ],
767
+ );
768
+
769
+ // ╭─────
770
+ // │ NOTE:
771
+ // │ |: Destroy all dynamically created advert components
772
+ // ╰─────
773
+ for (const item of listAdWidgetElements)
774
+ item.$destroy();
775
+ ;
776
+
777
+ return;
778
+ }
779
+ );
780
+
739
781
  // #endregion ➤ 🔄 LIFECYCLE [SVELTE]
740
782
 
741
783
  </script>
File without changes
@@ -40,11 +40,11 @@
40
40
 
41
41
  import { onMount } from 'svelte';
42
42
 
43
+ import { ServiceAdEngine } from '@betarena/scores-lib/dist/classes/_service.adengine.js';
44
+ import { betarenaEndpoint } from './constants/instance.js';
43
45
  import { storeAdmin } from './store/admin';
44
46
 
45
47
  import type { AdsCreativeMain } from '@betarena/scores-lib/types/v8/_HASURA-0';
46
- import { ServiceAdEngine } from '@betarena/scores-lib/dist/classes/_service.adengine.js';
47
- import { betarenaEndpoint } from './constants/instance.js';
48
48
 
49
49
  // #endregion ➤ 📦 Package Imports
50
50
 
@@ -158,7 +158,8 @@
158
158
  {
159
159
  position: fixed;
160
160
  right: 0 !important;
161
- max-height: 100% !important;
161
+ height: 100%;
162
+ max-height: 850px;
162
163
  top: 0 !important;
163
164
  width: initial !important;
164
165
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/style/app.css CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes