@betarena/ad-engine 0.0.13 → 0.0.15

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
@@ -1,45 +1,74 @@
1
1
  {
2
- "name": "@betarena/ad-engine",
3
- "version": "0.0.13",
4
- "private": false,
5
- "description": "Betarena Ad-Engine Component",
6
- "main": "dist/index.js",
7
- "keywords": [
8
- "betarena",
9
- "ad-engine",
10
- "adverts",
11
- "bta-token"
12
- ],
13
- "type": "module",
14
- "scripts": {
15
- "build": "vite build",
16
- "start": "vite build",
17
- "vite|:|dev": "vite",
18
- "vite|:|dev|:|1-click": "npm run 'npm|:|link|:|@betarena/scores-lib' && npm ls --link --global & npm run 'vite|:|dev'",
19
- "vite|:|preview": "vite preview",
20
- "svelte-check": "svelte-check --tsconfig ./tsconfig.json",
21
- "npm|:|next|:|@betarena/scores-lib": "npm i @betarena/scores-lib@latest",
22
- "npm|:|link|:|@betarena/scores-lib": "npm link @betarena/scores-lib",
23
- "npm|:|link": "npm link",
24
- "sass|:|watch": "sass --watch static/app.scss static/app.css"
25
- },
26
- "devDependencies": {
27
- "@sveltejs/vite-plugin-svelte": "3.0.2",
28
- "@tsconfig/svelte": "5.0.2",
29
- "@typescript-eslint/eslint-plugin": "5.59.1",
30
- "@typescript-eslint/parser": "5.59.1",
31
- "eslint": "8.51.0",
32
- "eslint-config-prettier": "8.8.0",
33
- "eslint-plugin-svelte": "2.34.0",
34
- "sass": "1.72.0",
35
- "svelte": "4.2.12",
36
- "svelte-check": "3.6.6",
37
- "tslib": "2.6.2",
38
- "typescript": "5.2.2",
39
- "vite": "5.1.6"
40
- },
41
- "dependencies": {
42
- "@betarena/scores-lib": "1.11.0-alpha.15",
43
- "@fontsource/roboto": "5.0.12"
44
- }
2
+ "name": "@betarena/ad-engine",
3
+ "version": "0.0.15",
4
+ "private": false,
5
+ "description": "Betarena ad-engine widget",
6
+ "keywords": [
7
+ "svelte",
8
+ "betarena",
9
+ "ad-engine",
10
+ "adverts",
11
+ "bta-token",
12
+ "widget",
13
+ "script-tag"
14
+ ],
15
+ "files": [
16
+ "src",
17
+ "dist"
18
+ ],
19
+ "author": {
20
+ "name": "migbash",
21
+ "email": "20924663+migbash@users.noreply.github.com",
22
+ "url": "https://github.com/migbash"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/Betarena/ad-engine"
27
+ },
28
+ "bugs": {
29
+ "type": "git",
30
+ "url": "https://github.com/Betarena/ad-engine/issues"
31
+ },
32
+ "scripts": {
33
+ "build": "vite build",
34
+ "start": "vite build",
35
+ "vite|:|dev": "vite",
36
+ "vite|:|dev|:|1-click": "npm run 'npm|:|link|:|@betarena/scores-lib' && npm ls --link --global & npm run 'vite|:|dev'",
37
+ "vite|:|preview": "vite preview",
38
+ "svelte-check": "svelte-check --tsconfig ./tsconfig.json",
39
+ "run|:|script-package": "npx tsx misc/package.ts",
40
+ "npm|:|next|:|@betarena/scores-lib": "npm i @betarena/scores-lib@latest",
41
+ "npm|:|link|:|@betarena/scores-lib": "npm link @betarena/scores-lib",
42
+ "npm|:|link": "npm link",
43
+ "npm|:|bump+publish": "npm version patch && npm publish",
44
+ "sass|:|watch": "sass --watch static/app.scss static/app.css"
45
+ },
46
+ "devDependencies": {
47
+ "@typescript-eslint/eslint-plugin": "5.59.1",
48
+ "@typescript-eslint/parser": "5.59.1",
49
+ "eslint": "8.51.0",
50
+ "eslint-config-prettier": "8.8.0",
51
+ "eslint-plugin-svelte": "2.34.0",
52
+ "@sveltejs/vite-plugin-svelte": "3.0.2",
53
+ "@tsconfig/svelte": "5.0.2",
54
+ "svelte": "4.2.12",
55
+ "typescript": "5.2.2",
56
+ "tslib": "2.6.2",
57
+ "vite": "5.1.6",
58
+ "svelte-check": "3.6.6",
59
+ "json5": "2.2.3",
60
+ "sass": "1.72.0"
61
+ },
62
+ "dependencies": {
63
+ "@betarena/scores-lib": "1.11.0-alpha.15",
64
+ "@fontsource/roboto": "5.0.12"
65
+ },
66
+ "main": "dist/index.js",
67
+ "svelte": "dist/index.js",
68
+ "exports": {
69
+ ".": {
70
+ "svelte": "dist/index.js"
71
+ }
72
+ },
73
+ "type": "module"
45
74
  }
package/src/index.ts ADDED
@@ -0,0 +1,24 @@
1
+ import AdvertEngineWidget from './lib/Advert-Engine-Widget.svelte'
2
+
3
+ let
4
+ /**
5
+ * @description
6
+ */
7
+ app
8
+ ;
9
+
10
+ // ╭─────
11
+ // │ CHECK |:| running on 'browser'
12
+ // ╰─────
13
+ if (typeof document !== 'undefined')
14
+ app
15
+ = new AdvertEngineWidget
16
+ (
17
+ {
18
+ target: document.body
19
+ }
20
+ )
21
+ ;
22
+ ;
23
+
24
+ export default app;
@@ -41,14 +41,16 @@
41
41
  import { onMount } from 'svelte';
42
42
 
43
43
  import { betarenaEndpoint } from './constants/instance.js';
44
- import { betarenaAdEngineStore } from './store.js';
44
+ import { betarenaAdEngineStore } from './_store.js';
45
45
  import { postMod } from './utils/fetch.js';
46
46
  import { detectDeviceType } from './utils/device.js';
47
47
  import { getUserLocation } from './utils/geo.js';
48
48
  import { removeNull } from '@betarena/scores-lib/src/functions/func.common.js';
49
49
 
50
- import WidgetAdvertSlide from './Widget-AdvertSlide.svelte';
51
- import WidgetAdGeneral from './Widget-AdGeneral.svelte';
50
+ import WidgetAdvertSlide from './Advert-Slide-Child.svelte';
51
+ import WidgetAdGeneral from './Advert-General-Child.svelte';
52
+
53
+ import '@fontsource/roboto';
52
54
 
53
55
  import type { IAdsRequestBody, IAdsResponseBody } from '@betarena/scores-lib/types/ad-engine/index.js';
54
56
  import type { GeoJsResponse } from './types/geojs.js';
@@ -43,7 +43,7 @@
43
43
 
44
44
  import iconClose from './assets/icon-close.svg';
45
45
  import iconArrow from './assets/icon-external-link.svg';
46
- import { betarenaAdEngineStore } from './store.js';
46
+ import { betarenaAdEngineStore } from './_store.js';
47
47
 
48
48
  import type { AdsCreativeMain } from '@betarena/scores-lib/types/_AUTO-HASURA_.js';
49
49
 
package/.eslintrc.yaml DELETED
@@ -1,164 +0,0 @@
1
- # ▓ > 🔗 read-more :|: https://github.com/sveltejs/eslint-plugin-svelte
2
-
3
- root: true
4
-
5
- env:
6
- es2017: true
7
- node: true
8
- browser: true
9
-
10
- extends:
11
- - eslint:recommended
12
- - plugin:svelte/recommended
13
- - plugin:@typescript-eslint/strict
14
- # ▓ WARNING:
15
- # ▓ > (👇) below :: does not work with svelte.
16
- # - plugin:import/errors
17
- # - plugin:import/warnings
18
- # - plugin:import/typescript
19
- # ▓ > (👇) :|: https://www.npmjs.com/package/eslint-config-google
20
- # - google
21
- # - prettier
22
- # ▓ NOTE:
23
- # ▓ > (👇) already contained within ../strict.
24
- # - plugin:@typescript-eslint/recommended
25
- # - plugin:@typescript-eslint/stylistic
26
-
27
- parser:
28
- "@typescript-eslint/parser"
29
-
30
- parserOptions:
31
- project:
32
- - tsconfig.json
33
- sourceType: module
34
- ecmaVersion: 2020
35
- extraFileExtensions:
36
- - '.svelte'
37
- - '.ts'
38
-
39
- overrides:
40
- - files:
41
- - '*.svelte'
42
- parser: 'svelte-eslint-parser'
43
- parserOptions:
44
- parser: '@typescript-eslint/parser'
45
-
46
- globals:
47
- # ▓ > 🔗 read-more :|: https://github.com/Chatie/eslint-config/issues/45#issuecomment-885507652
48
- "NodeJS": true
49
-
50
- ignorePatterns:
51
- - .DS_Store
52
- - node_modules
53
- - /build
54
- - /.svelte-kit
55
- - /package
56
- - .env
57
- - .env.*
58
- - '!.env.example'
59
- - pnpm-lock.yaml
60
- - package-lock.json
61
- - yarn.lock
62
- # ▓ NOTE:
63
- # ▓ > gradual eslint introduction in project.
64
- - src/lib/geo-js
65
- - src/lib/graphql
66
- - src/lib/redis
67
- # - src/lib/store
68
- # - src/routes
69
- - src/lib/types
70
- - src/params
71
- - src/service-worker.ts
72
-
73
- plugins:
74
- - "@typescript-eslint"
75
- - svelte
76
- # ▓ WARNING:
77
- # ▓ > (👇) all-below :: does not work with svelte.
78
- # - import
79
-
80
- # ▓ IMPORTANT
81
- # ▓ > Main 'defacto' configuration, do not remove and/or alter heavily.
82
- # ▓ > 🔗 read-more :|: https://eslint.org/docs/latest/rules/
83
- rules:
84
-
85
- # ▓ NOTE:
86
- # ▓ > (👇) for svelte/sveltekit project only!
87
- 'svelte/valid-compile': 0
88
- 'svelte/no-at-html-tags': 0
89
-
90
- # ▓ NOTE:
91
- # ▓ > has been depreceted.
92
- # "valid-jsdoc": [..]
93
- no-unexpected-multiline: 0
94
- import/no-unresolved: 0
95
- # ▓ NOTE:
96
- # ▓ > Ideal, but doesn't work as expected :: [ "error", "always", { "allowNewlines": true } ]
97
- # ▓ > as it requires a space after function declaration, 'always'.
98
- func-call-spacing: 0
99
-
100
- "@typescript-eslint/no-inferrable-types": 0
101
- "@typescript-eslint/prefer-for-of": error
102
- "@typescript-eslint/no-non-null-asserted-nullish-coalescing": error
103
-
104
- no-console:
105
- - error
106
- curly:
107
- - error
108
- - multi
109
- - consistent
110
- max-len:
111
- - error
112
- - code: 250
113
- quotes:
114
- - error
115
- - single
116
- object-curly-spacing:
117
- - error
118
- - always
119
- brace-style:
120
- - error
121
- - allman
122
- - allowSingleLine: true
123
- indent:
124
- - error
125
- - 2
126
- space-before-function-paren:
127
- - error
128
- - anonymous: always
129
- named: always
130
- asyncArrow: always
131
- padded-blocks:
132
- - error
133
- - blocks: never
134
- comma-dangle:
135
- - error
136
- - only-multiline
137
- comma-style:
138
- - error
139
- - last
140
- operator-linebreak:
141
- - error
142
- - before
143
- new-cap:
144
- - error
145
- - capIsNewExceptionPattern: "^express\\.."
146
- camelcase:
147
- - error
148
- - ignoreImports: true
149
- ignoreDestructuring: true
150
- properties: never
151
- allow:
152
- - "^if_M_"
153
- - "^B_H_"
154
- - "^icon_"
155
- eol-last:
156
- - error
157
- - always
158
- arrow-body-style:
159
- - error
160
- - always
161
- one-var:
162
- - error
163
- - initialized: "consecutive"
164
- no-extra-semi: 0
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- v18.19.0
package/dist/index.html DELETED
@@ -1,14 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Vite + Svelte + TS</title>
8
- <script type="module" crossorigin src="/index.js"></script>
9
- <link rel="stylesheet" crossorigin href="/index.css">
10
- </head>
11
- <body>
12
- <div id="app"></div>
13
- </body>
14
- </html>
package/index.html DELETED
@@ -1,13 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Vite + Svelte + TS</title>
8
- </head>
9
- <body>
10
- <div id="app"></div>
11
- <script type="module" src="/src/main.ts"></script>
12
- </body>
13
- </html>
package/public/vite.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
package/src/App.svelte DELETED
@@ -1,8 +0,0 @@
1
- <script lang="ts">
2
- import '@fontsource/roboto'; // Defaults to weight 400
3
- import WidgetAdEngine from './lib/Widget-AdEngine.svelte';
4
- </script>
5
-
6
- <main>
7
- <WidgetAdEngine />
8
- </main>
package/src/main.ts DELETED
@@ -1,17 +0,0 @@
1
- import App from './App.svelte'
2
-
3
- let app
4
-
5
- if (typeof document === 'undefined') {
6
- // during server evaluation
7
- } else {
8
- // during client's browser evaluation
9
- app = new App
10
- (
11
- {
12
- target: document.body
13
- }
14
- )
15
- }
16
-
17
- export default app
package/svelte.config.js DELETED
@@ -1,7 +0,0 @@
1
- import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
2
-
3
- export default {
4
- // Consult https://svelte.dev/docs#compile-time-svelte-preprocess
5
- // for more information about preprocessors
6
- preprocess: vitePreprocess(),
7
- }
@@ -1,10 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true,
4
- "skipLibCheck": true,
5
- "module": "ESNext",
6
- "moduleResolution": "bundler",
7
- "strict": true
8
- },
9
- "include": ["vite.config.ts"]
10
- }
package/vite.config.ts DELETED
@@ -1,34 +0,0 @@
1
- import { defineConfig } from 'vite'
2
- import { svelte } from '@sveltejs/vite-plugin-svelte'
3
-
4
- // https://vitejs.dev/config/
5
- export default defineConfig
6
- (
7
- (
8
- {
9
- command,
10
- mode
11
- }
12
- ) =>
13
- {
14
- return {
15
- build:
16
- {
17
- rollupOptions:
18
- {
19
- output:
20
- {
21
- entryFileNames: '[name].js',
22
- assetFileNames: '[name].[ext]',
23
- },
24
- },
25
- },
26
-
27
- plugins:
28
- [
29
- svelte()
30
- ]
31
-
32
- }
33
- }
34
- );
File without changes