@everymatrix/casino-last-played-section 1.43.4 → 1.45.0

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,39 +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>
8
- casino-last-played-section
9
- </title>
10
- <link rel="stylesheet" href="public/reset.css">
11
- <script src='dist/casino-last-played-section.js'></script>
12
- </head>
13
-
14
- <body>
15
- <style>
16
- html,body { margin: 0; padding: 0; height: 100%; font-family: "Helvetica Neue", "Helvetica", sans-serif; }
17
- .header { display: flex; justify-content: center; align-items: center; padding: 10px 20px; margin-bottom: 20px; background: #42a3e2; box-shadow: 3px 4px 5px 0px rgba(0,0,0, .2); }
18
- .header__logo svg { height: 50px; width: 50px; margin-right: 5px; }
19
- .header__name { color: #fff; }
20
- .header__name span { margin-right: 10px; font-weight: bold; }
21
- .webcomponent { padding: 10px 20px; }
22
- </style>
23
- <header class="header">
24
- <div class="header__logo">
25
- <svg xmlns="http://www.w3.org/2000/svg" width="161" height="132" viewBox="0 0 161 132"><defs><linearGradient x1="0%" y1="50%" y2="50%" id="a"><stop stop-color="#2A3B8F" offset="0%"/><stop stop-color="#29ABE2" offset="100%"/></linearGradient><linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="c"><stop stop-color="#B4D44E" offset="0%"/><stop stop-color="#E7F716" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path fill="#166DA5" d="M160.6 65.9l-17.4 29.3-24.4-29.7 24.4-28.9z"/><path fill="#8FDB69" d="M141.3 100.2l-26.5-31.7-15.9 26.6 24.7 36.1z"/><path fill="#166DA5" d="M141 31.4l-26.2 31.8-15.9-26.6L123.6.9z"/><path fill="url(#a)" opacity=".95" d="M61.1 31.4H141L123.4.7H78.7z M114.8 63.3H159l-15.9-26.8H98.8"/><path fill="url(#c)" opacity=".95" d="M141.3 100.3H61l17.6 30.5h45z M114.8 68.4H159l-15.9 26.8H98.8"/><path fill="#010101" d="M78.6 130.8L41 65.8 79.1.8H37.9L.4 65.8l37.5 65z"/></g></svg>
26
- </div>
27
- <h1 class="header__name">
28
- <span>WEBCOMPONENT:</span> casino-last-played-section
29
- </h1>
30
- </header>
31
-
32
- <div class="webcomponent">
33
- <casino-last-played-section endpoint="https://demo-api.stage.norway.everymatrix.com/v1" unique="true" datasource="RNG"
34
- userid="4506648" session="ce624de8-dd73-49c9-b56a-b81cb84db4b5" lang="en">
35
- </casino-last-played-section>
36
- </div>
37
-
38
- </body>
39
- </html>
package/index.js DELETED
@@ -1 +0,0 @@
1
- import './dist/casino-last-played-section.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-last-played-section.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,217 +0,0 @@
1
- <svelte:options tag={null} />
2
- <script lang="ts">
3
-
4
- import { getDevice } from 'rvhelper';
5
- import { _, addNewMessages, setLocale } from './i18n';
6
- import { TRANSLATIONS } from './translations.js';
7
- import '@everymatrix/casino-games-category-section'
8
-
9
- export let endpoint:string = '';
10
- export let datasource:string = '';
11
- export let currency:string = '';
12
- export let lang:string = ''; // Language
13
- export let session:string = ''; // Value for sessionID
14
- export let userid:string = ''; // Value for UserID;
15
- export let clientstyling:string = '';
16
- export let clientstylingurl:string = '';
17
- export let translationurl:string = '';
18
-
19
- export let livecasino:string = 'false';
20
- export let integratedgameframemobile:string = 'false';
21
- export let integratedgameframedesktop:string = 'false';
22
- export let gamepagemodalurl:string = 'false';
23
- export let showgamename:string = '';
24
- export let visiblegames:string = '';
25
- export let favorites:string = '';
26
- export let lastplayedperiod:string = 'Last30Days';
27
- export let lastplayedorder:string = '';
28
- export let lastplayedlimit:string = '';
29
- export let casinomygames:string = 'false';
30
- export let lastplayedunique: string = 'true';
31
- export let fetchviaevent:string = 'true';
32
-
33
-
34
- let userAgent:any = window.navigator.userAgent;
35
-
36
- let lastPlayedEmpty:boolean = false;
37
- let lastPlayedGames:Array<any> = [];
38
- let urlCasino:any;
39
- let isLoading:boolean = false;
40
- let lobbyView:boolean = false;
41
-
42
- let customStylingContainer:HTMLElement;
43
-
44
- const setTranslationUrl = ():void => {
45
- let url:string = translationurl;
46
-
47
- fetch(url).then((res:any) => res.json())
48
- .then((res) => {
49
- Object.keys(res).forEach((item:any):void => {
50
- addNewMessages(item, res[item]);
51
- });
52
- }).catch((err:any) => {
53
- console.log(err);
54
- });
55
- }
56
-
57
- Object.keys(TRANSLATIONS).forEach((item:any):void => {
58
- addNewMessages(item, TRANSLATIONS[item]);
59
- });
60
-
61
- const getLastPlayedCategory = ():Promise<any> => {
62
- return new Promise((resolve, reject) => {
63
- let url = new URL(`${endpoint}/v1/player/${userid}/games/last-played`);
64
-
65
- url.searchParams.append('unique', lastplayedunique);
66
- url.searchParams.append('limit', lastplayedlimit);
67
- url.searchParams.append('order', lastplayedorder);
68
- url.searchParams.append('period', lastplayedperiod);
69
-
70
- let device = getDevice(userAgent);
71
- if (device === 'PC') {
72
- url.searchParams.append('device', 'Desktop');
73
- } else {
74
- url.searchParams.append('device', 'Mobile');
75
- }
76
-
77
- urlCasino = livecasino ? url : url.href;
78
- fetch(urlCasino)
79
- .then((res:any) => res.json())
80
- .then((data:any) => {
81
-
82
- data.items = data.items.filter((item):boolean => {
83
- let dataGameCode: boolean = true;
84
- if (item.gameCode == 'OddsMatrix2') {
85
- data.count--;
86
- dataGameCode = false;
87
- } return dataGameCode;
88
- });
89
-
90
- resolve(data);
91
-
92
- window.postMessage({ type: 'AddNewCategory', category: { name: 'Last Played', id: 'LASTPLAYED' }}, window.location.href);
93
- window.postMessage({ type: 'LastPlayedGames', data }, window.location.href);
94
- }).catch((err:any) => {
95
- console.error(err);
96
-
97
- reject(err);
98
- });
99
- });
100
- }
101
-
102
- isLoading = true;
103
-
104
- const initialLoad = ():void => {
105
- getLastPlayedCategory()
106
- .then((res:any) => {
107
- isLoading = false;
108
- if (res.count > 0) {
109
- let promises:any = [];
110
-
111
- res.items.forEach((item:any) => {
112
- let url:URL = new URL(`${endpoint}/v1/casino/games/${item.gameId}`);
113
-
114
- url.searchParams.append('datasource', datasource);
115
- if (livecasino) {
116
- promises.push(fetch(url.href).then((res:any) => res.json()));
117
- } else {
118
- promises.push(fetch(url.href).then((res:any) => res.json()));
119
- }
120
- });
121
-
122
- Promise.all(promises).then((values) => {
123
- lastPlayedGames = values.filter((item) => !('error' in item)).map((item) => item[0]);
124
-
125
- if (casinomygames === "true") {
126
- lastPlayedGames = lastPlayedGames.slice(0, JSON.parse(visiblegames));
127
- }
128
-
129
- window.postMessage({ type: 'LastPlayedData', lastPlayedGames }, window.location.href);
130
- });
131
-
132
- } else {
133
- lastPlayedEmpty = true;
134
- }
135
- });
136
- }
137
-
138
- const setActiveLanguage = ():void => {
139
- setLocale(lang);
140
- }
141
-
142
- const setClientStyling = () => {
143
- let sheet = document.createElement('style');
144
- sheet.innerHTML = clientstyling;
145
- customStylingContainer.appendChild(sheet);
146
- }
147
-
148
- const setClientStylingURL = () => {
149
- let cssFile:HTMLElement = document.createElement('style');
150
-
151
- fetch(new URL(clientstylingurl))
152
- .then((res:any) => res.text())
153
- .then((data:any) => {
154
- cssFile.innerHTML = data
155
-
156
- setTimeout(() => { customStylingContainer.appendChild(cssFile); }, 1);
157
- });
158
- }
159
-
160
- $: endpoint && userid && lang && initialLoad();
161
- $: translationurl && setTranslationUrl();
162
- $: clientstyling && customStylingContainer && setClientStyling();
163
- $: clientstylingurl && customStylingContainer && setClientStylingURL();
164
- $: lang && setActiveLanguage();
165
- </script>
166
-
167
- <div class="CasinoGamesCategorySectionContainer" bind:this={customStylingContainer}>
168
- <div class="CasinoLastPlayedSection">
169
- {#if lastPlayedEmpty}
170
- <p class="SearchLoading"> {$_('noRecentGames')}</p>
171
- {:else}
172
- <casino-games-category-section
173
- session={session}
174
- userid={userid}
175
- endpoint={endpoint}
176
- datasource={datasource}
177
- lang={lang}
178
- currency={currency}
179
- favorites={favorites}
180
- fetchviaevent={fetchviaevent}
181
- categoryid="LASTPLAYED"
182
- categoryindex="1"
183
- categorygames="9"
184
- class="CategoryContainer"
185
- {showgamename}
186
- {clientstyling}
187
- {clientstylingurl}
188
- {livecasino}
189
- {visiblegames}
190
- {gamepagemodalurl}
191
- {integratedgameframedesktop}
192
- {integratedgameframemobile}
193
- {casinomygames}
194
- />
195
- {/if}
196
- </div>
197
- </div>
198
-
199
- <style lang="scss">
200
-
201
-
202
- *,
203
- *::before,
204
- *::after {
205
- margin: 0;
206
- padding: 0;
207
- list-style: none;
208
- text-decoration: none;
209
- outline: none;
210
- box-sizing: border-box;
211
- }
212
-
213
- .CasinoLastPlayedSection {
214
- background: var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A));
215
- color: var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF));
216
- }
217
- </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 CasinoLastPlayedSection from './CasinoLastPlayedSection.svelte';
2
-
3
- !customElements.get('casino-last-played-section') && customElements.define('casino-last-played-section', CasinoLastPlayedSection);
4
- export default CasinoLastPlayedSection;
@@ -1,23 +0,0 @@
1
- export const TRANSLATIONS = {
2
- "en": {
3
- "noRecentGames": "You haven't played yet but here you will find in the future a list of your games."
4
- },
5
- "de": {
6
- "noRecentGames": "Du hast bisher noch nicht gespielt, aber hier findest du in Zukunft eine Liste deiner Spiele."
7
- },
8
- "es": {
9
- "noRecentGames": "No has jugado aún pero aquí encontrarás en el futuro una lista de tus juegos."
10
- },
11
- "hr": {
12
- "noRecentGames": "Još niste igrali, ali ovdje ćete u budućnosti pronaći popis svojih igara."
13
- },
14
- "pt-br": {
15
- "noRecentGames": "Você ainda não jogou, mas aqui você encontrará a lista futura de jogos jogados."
16
- },
17
- "es-mx": {
18
- "noRecentGames": "Aún no has jugado pero aquí encontrarás la futura lista de juegos jugados."
19
- },
20
- "tr": {
21
- "noRecentGames": "Henüz oynamadınız ama burada gelecekte oyun listenizi bulacaksınız."
22
- }
23
- }
@@ -1,13 +0,0 @@
1
- import { html } from 'lit-element';
2
-
3
- import CasinoLastPlayedSection from '../src/CasinoLastPlayedSection';
4
-
5
- // This default export determines where your story goes in the story list
6
- export default {
7
- title: 'CasinoLastPlayedSection',
8
- };
9
-
10
- // 👇 We create a “template” of how args map to rendering
11
- const CasinoLastPlayedSection = ({ aProperty }) => html`<casino-last-played-section></casino-last-played-section>`;
12
-
13
- export const FirstStory = CasinoLastPlayedSection.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
- }