@everymatrix/casino-providers 1.44.0 → 1.45.2

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/index.html DELETED
@@ -1,101 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width,initial-scale=1" />
6
-
7
- <title>casino-providers</title>
8
- <link rel="stylesheet" href="public/reset.css" />
9
- <script src="dist/casino-providers.js"></script>
10
- </head>
11
-
12
- <body>
13
- <style>
14
- html,
15
- body {
16
- margin: 0;
17
- padding: 0;
18
- height: 100%;
19
- font-family: "Helvetica Neue", "Helvetica", sans-serif;
20
- }
21
- .header {
22
- display: flex;
23
- justify-content: center;
24
- align-items: center;
25
- padding: 10px 20px;
26
- margin-bottom: 20px;
27
- background: #42a3e2;
28
- box-shadow: 3px 4px 5px 0px rgba(0, 0, 0, 0.2);
29
- }
30
- .header__logo svg {
31
- height: 50px;
32
- width: 50px;
33
- margin-right: 5px;
34
- }
35
- .header__name {
36
- color: #fff;
37
- }
38
- .header__name span {
39
- margin-right: 10px;
40
- font-weight: bold;
41
- }
42
- .webcomponent {
43
- padding: 10px 20px;
44
- }
45
- </style>
46
- <header class="header">
47
- <div class="header__logo">
48
- <svg
49
- xmlns="http://www.w3.org/2000/svg"
50
- width="161"
51
- height="132"
52
- viewBox="0 0 161 132"
53
- >
54
- <defs>
55
- <linearGradient x1="0%" y1="50%" y2="50%" id="a">
56
- <stop stop-color="#2A3B8F" offset="0%" />
57
- <stop stop-color="#29ABE2" offset="100%" />
58
- </linearGradient>
59
- <linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="c">
60
- <stop stop-color="#B4D44E" offset="0%" />
61
- <stop stop-color="#E7F716" offset="100%" />
62
- </linearGradient>
63
- </defs>
64
- <g fill="none" fill-rule="evenodd">
65
- <path
66
- fill="#166DA5"
67
- d="M160.6 65.9l-17.4 29.3-24.4-29.7 24.4-28.9z"
68
- />
69
- <path
70
- fill="#8FDB69"
71
- d="M141.3 100.2l-26.5-31.7-15.9 26.6 24.7 36.1z"
72
- />
73
- <path fill="#166DA5" d="M141 31.4l-26.2 31.8-15.9-26.6L123.6.9z" />
74
- <path
75
- fill="url(#a)"
76
- opacity=".95"
77
- d="M61.1 31.4H141L123.4.7H78.7z M114.8 63.3H159l-15.9-26.8H98.8"
78
- />
79
- <path
80
- fill="url(#c)"
81
- opacity=".95"
82
- d="M141.3 100.3H61l17.6 30.5h45z M114.8 68.4H159l-15.9 26.8H98.8"
83
- />
84
- <path
85
- fill="#010101"
86
- d="M78.6 130.8L41 65.8 79.1.8H37.9L.4 65.8l37.5 65z"
87
- />
88
- </g>
89
- </svg>
90
- </div>
91
- <h1 class="header__name"><span>WEBCOMPONENT:</span> casino-providers</h1>
92
- </header>
93
-
94
- <div class="webcomponent">
95
- <casino-providers
96
- datasource="RNG"
97
- endpoint="https://demo-api.stage.norway.everymatrix.com/v2"
98
- ></casino-providers>
99
- </div>
100
- </body>
101
- </html>
package/index.js DELETED
@@ -1 +0,0 @@
1
- import './dist/casino-providers.js';
Binary file
package/public/reset.css DELETED
@@ -1,48 +0,0 @@
1
- /* http://meyerweb.com/eric/tools/css/reset/
2
- v2.0 | 20110126
3
- License: none (public domain)
4
- */
5
-
6
- html, body, div, span, applet, object, iframe,
7
- h1, h2, h3, h4, h5, h6, p, blockquote, pre,
8
- a, abbr, acronym, address, big, cite, code,
9
- del, dfn, em, img, ins, kbd, q, s, samp,
10
- small, strike, strong, sub, sup, tt, var,
11
- b, u, i, center,
12
- dl, dt, dd, ol, ul, li,
13
- fieldset, form, label, legend,
14
- table, caption, tbody, tfoot, thead, tr, th, td,
15
- article, aside, canvas, details, embed,
16
- figure, figcaption, footer, header, hgroup,
17
- menu, nav, output, ruby, section, summary,
18
- time, mark, audio, video {
19
- margin: 0;
20
- padding: 0;
21
- border: 0;
22
- font-size: 100%;
23
- font: inherit;
24
- vertical-align: baseline;
25
- }
26
- /* HTML5 display-role reset for older browsers */
27
- article, aside, details, figcaption, figure,
28
- footer, header, hgroup, menu, nav, section {
29
- display: block;
30
- }
31
- body {
32
- line-height: 1;
33
- }
34
- ol, ul {
35
- list-style: none;
36
- }
37
- blockquote, q {
38
- quotes: none;
39
- }
40
- blockquote:before, blockquote:after,
41
- q:before, q:after {
42
- content: '';
43
- content: none;
44
- }
45
- table {
46
- border-collapse: collapse;
47
- border-spacing: 0;
48
- }
package/rollup.config.js DELETED
@@ -1,59 +0,0 @@
1
- import svelte from 'rollup-plugin-svelte';
2
- import commonjs from '@rollup/plugin-commonjs';
3
- import resolve from '@rollup/plugin-node-resolve';
4
- import serve from 'rollup-plugin-dev-server';
5
- import livereload from 'rollup-plugin-livereload';
6
- import { terser } from 'rollup-plugin-terser';
7
- import sveltePreprocess from 'svelte-preprocess';
8
- import typescript from '@rollup/plugin-typescript';
9
- const production = process.env.NODE_ENV === 'production';
10
- const dev = process.env.NODE_ENV === 'development';
11
-
12
- export default {
13
- input: 'src/index.ts',
14
- output: {
15
- sourcemap: true,
16
- format: 'umd',
17
- name: 'app',
18
- file: 'dist/casino-providers.js'
19
- },
20
- plugins: [
21
- svelte({
22
- preprocess: sveltePreprocess(),
23
- compilerOptions: {
24
- // enable run-time checks when not in production
25
- customElement: true,
26
- dev: !production
27
- }
28
- }),
29
- commonjs(),
30
- resolve({
31
- browser: true,
32
- dedupe: ['svelte']
33
- }),
34
- dev && serve({
35
- open: true,
36
- verbose: true,
37
- allowCrossOrigin: true,
38
- historyApiFallback: false,
39
- host: 'localhost',
40
- port: 5050,
41
- }),
42
- dev && livereload({ watch: ['', 'dist'] }),
43
- typescript({
44
- sourceMap: !production,
45
- inlineSources: !production,
46
- }),
47
- // If we're building for production (npm run build
48
- // instead of npm run dev), minify
49
- production &&
50
- terser({
51
- output: {
52
- comments: "all"
53
- },
54
- })
55
- ],
56
- watch: {
57
- clearScreen: false
58
- }
59
- };
@@ -1,190 +0,0 @@
1
- <svelte:options tag={null} />
2
- <script lang="ts">
3
- import { TRANSLATIONS } from './translations';
4
- import { _, addNewMessages, setLocale } from './i18n';
5
-
6
- export let endpoint:string = '';
7
- export let datasource:string = '';
8
- export let lang:string = 'en';
9
- export let clientstyling:string = '';
10
- export let clientstylingurl:string = '';
11
- export let translationurl:string = '';
12
-
13
- let providers:Array<any> = [];
14
- let topProviders:Array<any> = [];
15
- let otherProviders:Array<any> = [];
16
- let isLoading:boolean = false;
17
- let customStylingContainer:HTMLElement;
18
-
19
- const setTranslationUrl = ():void => {
20
- let url:string = translationurl;
21
-
22
- fetch(url).then((res:any) => res.json())
23
- .then((res) => {
24
- Object.keys(res).forEach((item:any):void => {
25
- addNewMessages(item, res[item]);
26
- });
27
- }).catch((err:any) => {
28
- console.log(err);
29
- });
30
- }
31
-
32
- Object.keys(TRANSLATIONS).forEach((item:any):void => {
33
- addNewMessages(item, TRANSLATIONS[item]);
34
- });
35
-
36
- const getProviders = ():void => {
37
- isLoading = true;
38
-
39
- const url:URL = new URL(`${endpoint}/v1/casino/vendors`);
40
-
41
- url.searchParams.append("datasource", datasource);
42
- url.searchParams.append("language", lang);
43
- url.searchParams.append("fields" , "id,name,displayName,subVendors,isTopVendor,logo,games");
44
-
45
- fetch(url)
46
- .then(res => res.json())
47
- .then(data => {
48
- isLoading = false;
49
- providers = data.items.map((item => item));
50
-
51
- topProviders = providers.filter(provider => provider.isTopVendor === true);
52
- otherProviders = providers.filter(provider => provider.isTopVendor === false);
53
-
54
- let allSubVendors:Array<any> = [];
55
- allSubVendors = providers.flatMap(item => item.subVendors);
56
-
57
- otherProviders.push(...allSubVendors.filter(subVendor => subVendor.games.count > 0));
58
- });
59
- }
60
-
61
- const openGameProviderPage = (providerId:string, providerName:string, providerLogo:string):void => {
62
- window.postMessage({ type: 'OpenGameProvider', providerId, providerName, providerLogo}, window.location.href);
63
- };
64
-
65
- const setActiveLanguage = ():void => {
66
- setLocale(lang);
67
- }
68
-
69
- const setClientStyling = ():void => {
70
- let sheet = document.createElement('style');
71
- sheet.innerHTML = clientstyling;
72
- customStylingContainer.appendChild(sheet);
73
- }
74
-
75
- const setClientStylingURL = ():void => {
76
-
77
- let url:URL = new URL(clientstylingurl);
78
- let cssFile:HTMLElement = document.createElement('style');
79
-
80
- fetch(url.href)
81
- .then((res:any) => res.text())
82
- .then((data:any) => {
83
- cssFile.innerHTML = data;
84
-
85
- setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
86
- });
87
- }
88
-
89
- $: endpoint && lang && datasource && getProviders();
90
- $: lang && setActiveLanguage();
91
- $: translationurl && setTranslationUrl();
92
- $: clientstyling && customStylingContainer && setClientStyling();
93
- $: clientstylingurl && customStylingContainer && setClientStylingURL();
94
- </script>
95
-
96
- <div class="CasinoProviders" bind:this={customStylingContainer}>
97
- {#if isLoading === true}
98
- <p class="Message"> {$_('loading')} </p>
99
- {:else}
100
- <h4 class="ProviderTitle">{$_('popularProviders')}</h4>
101
- {#each topProviders as provider}
102
- <div class="Provider" on:click={() => openGameProviderPage(provider.id, provider.name, provider.logo)}>
103
- <img src={provider.logo} alt="{provider.name}" class="ProviderImage" />
104
- <div class="ProviderTextContainer">
105
- <p>{provider.name}</p>
106
- <p>{provider.games.count} {$_('games')}</p>
107
- </div>
108
- </div>
109
- {/each}
110
- <h4 class="ProviderTitle">{$_('otherProviders')}</h4>
111
- {#each otherProviders as provider}
112
- <div class="Provider" on:click={() => openGameProviderPage(provider.id, provider.name, provider.logo)}>
113
- <img src={provider.logo} alt="{provider.name}" class="ProviderImage" />
114
- <div class="ProviderTextContainer">
115
- <p>{provider.name}</p>
116
- <p>{provider.games.count} {$_('games')}</p>
117
- </div>
118
- </div>
119
- {/each}
120
- {/if}
121
- </div>
122
-
123
- <style lang="scss">
124
- *,
125
- *::before,
126
- *::after {
127
- margin: 0;
128
- padding: 0;
129
- box-sizing: border-box;
130
- }
131
-
132
- .CasinoProviders {
133
- display: flex;
134
- flex-direction: column;
135
- gap: 1rem;
136
- padding: 10px 60px;
137
- }
138
-
139
- .ProviderTitle {
140
- font-weight: 500;
141
- position: relative;
142
- right: 30px;
143
- margin: 10px 0;
144
- }
145
-
146
- .Provider{
147
- border-radius: 7px;
148
- display: flex;
149
- align-items: center;
150
- gap: 16px;
151
- max-width: 300px;
152
-
153
- &TextContainer {
154
- display: flex;
155
- flex-direction: column;
156
- justify-content: center;
157
- gap: 10px;
158
- font-size: 15px;
159
- color: var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF));
160
- & p:first-child {
161
- font-weight: 600;
162
- color: var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF));
163
- }
164
- & p:last-child {
165
- color: var(--emfe-w-color-gray-150, #828282);
166
- font-weight: 300;
167
- }
168
- }
169
-
170
- &Image {
171
- border-radius: 4px;
172
- object-fit:contain;
173
- height: 64px;
174
- width: 64px;
175
- font-weight: 100;
176
- border: .5px solid var(--emfe-w-color-gray-100, #E6E6E6);
177
- overflow: hidden;
178
- object-fit: contain;
179
- }
180
-
181
- }
182
-
183
- .Message {
184
- font-weight: 600;
185
- position: absolute;
186
- top: 50%;
187
- left: 50%;
188
- transform: translate(-50%, -50%);
189
- }
190
- </style>
package/src/i18n.js DELETED
@@ -1,27 +0,0 @@
1
- import {
2
- dictionary,
3
- locale,
4
- addMessages,
5
- _
6
- } from 'svelte-i18n';
7
-
8
- function setupI18n({ withLocale: _locale, translations }) {
9
- locale.subscribe((data) => {
10
- if (data == null) {
11
- dictionary.set(translations);
12
- locale.set(_locale);
13
- }
14
- }); // maybe we will need this to make sure that the i18n is set up only once
15
- /*dictionary.set(translations);
16
- locale.set(_locale);*/
17
- }
18
-
19
- function addNewMessages(lang, dict) {
20
- addMessages(lang, dict);
21
- }
22
-
23
- function setLocale(_locale) {
24
- locale.set(_locale);
25
- }
26
-
27
- export { _, setupI18n, addNewMessages, setLocale };
package/src/index.ts DELETED
@@ -1,4 +0,0 @@
1
- import CasinoProviders from './CasinoProviders.svelte';
2
-
3
- !customElements.get('casino-providers') && customElements.define('casino-providers', CasinoProviders);
4
- export default CasinoProviders;
@@ -1,104 +0,0 @@
1
- export const TRANSLATIONS = {
2
- "en": {
3
- "popularProviders": "Popular Suppliers",
4
- "otherProviders": "Other Suppliers",
5
- "loading": "Loading, please wait...",
6
- "games": "games"
7
- },
8
- "zh-hk": {
9
- "popularProviders": "热门供应商",
10
- "otherProviders": "其他供应商",
11
- "loading": "加载请稍候...",
12
- "games": "游戏"
13
- },
14
- "de": {
15
- "popularProviders": "Beliebte Anbieter",
16
- "otherProviders": "Andere Anbieter",
17
- "loading": "Es lädt, bitte warten...",
18
- "games": "Spiele"
19
- },
20
- "it": {
21
- "popularProviders": "Popular Suppliers",
22
- "otherProviders": "Other Suppliers",
23
- "loading": "Loading, please wait",
24
- "games": "games"
25
- },
26
- "fr": {
27
- "popularProviders": "Fournisseurs populaires",
28
- "otherProviders": "Autres fournisseurs",
29
- "loading": "Chargement, veuillez patienter...",
30
- "games": "jeux"
31
- },
32
- "es": {
33
- "popularProviders": "Proveedores Populares",
34
- "otherProviders": "Otros Proveedores",
35
- "loading": "Cargando",
36
- "games": "juegos"
37
- },
38
- "tr": {
39
- "popularProviders": "Şimdi Oyna",
40
- "otherProviders": "Rastgele oynanacak oyun yok",
41
- "loading": "Son arama",
42
- "games": "Oyunları Ara"
43
- },
44
- "ru": {
45
- "popularProviders": "Popular Suppliers",
46
- "otherProviders": "Other Suppliers",
47
- "loading": "Loading, please wait",
48
- "games": "games"
49
- },
50
- "ro": {
51
- "popularProviders": "Furnizori de top",
52
- "otherProviders": "Alti furnizori",
53
- "loading": "Se incarca, te rugam asteapta…",
54
- "games": "jocuri"
55
- },
56
- "hr": {
57
- "popularProviders": "Popularni brendovi",
58
- "otherProviders": "Ostali brendovi",
59
- "loading": "Učitavanje",
60
- "games": "Igre"
61
- },
62
- "hu": {
63
- "popularProviders": "Popular Suppliers",
64
- "otherProviders": "Other Suppliers",
65
- "loading": "Loading, please wait",
66
- "games": "games"
67
- },
68
- "pl": {
69
- "popularProviders": "Popular Suppliers",
70
- "otherProviders": "Other Suppliers",
71
- "loading": "Loading, please wait",
72
- "games": "games"
73
- },
74
- "pt": {
75
- "popularProviders": "Popular Suppliers",
76
- "otherProviders": "Other Suppliers",
77
- "loading": "Loading, please wait",
78
- "games": "games"
79
- },
80
- "sl": {
81
- "popularProviders": "Popular Suppliers",
82
- "otherProviders": "Other Suppliers",
83
- "loading": "Loading, please wait",
84
- "games": "games"
85
- },
86
- "sr": {
87
- "popularProviders": "Popular Suppliers",
88
- "otherProviders": "Other Suppliers",
89
- "loading": "Loading, please wait",
90
- "games": "games"
91
- },
92
- "pt-br": {
93
- "popularProviders": "provedores populares",
94
- "otherProviders": "Outros provedores",
95
- "Loading": "Carregando",
96
- "games": "jogos"
97
- },
98
- "es-mx": {
99
- "popularProviders": "Proveedores Populares",
100
- "otherProviders": "Otros proveedores",
101
- "Loading": "Cargando, por favor espere...",
102
- "games": "juegos"
103
- }
104
- }
@@ -1,13 +0,0 @@
1
- import { html } from 'lit-element';
2
-
3
- import CasinoProviders from '../src/CasinoProviders';
4
-
5
- // This default export determines where your story goes in the story list
6
- export default {
7
- title: 'CasinoProviders',
8
- };
9
-
10
- // 👇 We create a “template” of how args map to rendering
11
- const CasinoProviders = ({ aProperty }) => html`<casino-providers></casino-providers>`;
12
-
13
- export const FirstStory = CasinoProviders.bind({});
package/tsconfig.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "extends": "@tsconfig/svelte/tsconfig.json",
3
-
4
- "include": ["src/**/*"],
5
- "exclude": ["node_modules/*", "__sapper__/*", "public/*"]
6
- }