@everymatrix/casino-tournaments-list-controller 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.
Files changed (30) hide show
  1. package/components/CasinoTournamentsListController-DQkRGglO.js +6935 -0
  2. package/components/CasinoTournamentsListController-Dxc2MrGE.cjs +15 -0
  3. package/components/CasinoTournamentsThumbnail-F3yd6zuc.cjs +4 -0
  4. package/components/CasinoTournamentsThumbnail-rgNkt8jX.js +865 -0
  5. package/components/CasinoTournamentsThumbnailController-Btof54Ze.js +1881 -0
  6. package/components/CasinoTournamentsThumbnailController-DT2N9cxC.cjs +3 -0
  7. package/components/CasinoTournamentsThumbnailDuration-C36qRcBp.js +495 -0
  8. package/components/CasinoTournamentsThumbnailDuration-CeJ__224.cjs +1 -0
  9. package/components/CasinoTournamentsThumbnailGamesSlider--nbq1N9x.js +439 -0
  10. package/components/CasinoTournamentsThumbnailGamesSlider-a0sQ72y8.cjs +1 -0
  11. package/components/CasinoTournamentsThumbnailPrizes-CyENln5i.cjs +1 -0
  12. package/components/CasinoTournamentsThumbnailPrizes-e1up8aDE.js +310 -0
  13. package/es2015/casino-tournaments-list-controller.cjs +1 -0
  14. package/es2015/casino-tournaments-list-controller.js +16 -0
  15. package/package.json +17 -32
  16. package/.eslintrc +0 -84
  17. package/README.md +0 -30
  18. package/dist/casino-tournaments-list-controller.js +0 -2
  19. package/dist/casino-tournaments-list-controller.js.map +0 -1
  20. package/index.html +0 -37
  21. package/index.js +0 -1
  22. package/public/favicon.png +0 -0
  23. package/public/reset.css +0 -48
  24. package/rollup.config.js +0 -67
  25. package/src/CasinoTournamentsListController.svelte +0 -205
  26. package/src/i18n.js +0 -27
  27. package/src/index.ts +0 -4
  28. package/src/translations.js +0 -32
  29. package/stories/CasinoTournamentsListController.stories.js +0 -13
  30. package/tsconfig.json +0 -6
package/index.html DELETED
@@ -1,37 +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-tournaments-list-controller
9
- </title>
10
- <link rel="stylesheet" href="public/reset.css">
11
- <script src='dist/casino-tournaments-list-controller.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-tournaments-list-controller
29
- </h1>
30
- </header>
31
-
32
- <div class="webcomponent">
33
- <casino-tournaments-list-controller></casino-tournaments-list-controller>
34
- </div>
35
-
36
- </body>
37
- </html>
package/index.js DELETED
@@ -1 +0,0 @@
1
- import './dist/casino-tournaments-list-controller.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,67 +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
- import uglify from 'rollup-plugin-uglify';
10
- import image from '@rollup/plugin-image';
11
-
12
- const production = process.env.NODE_ENV == 'production';
13
- const dev = process.env.NODE_ENV == 'development';
14
-
15
- export default {
16
- input: 'src/index.ts',
17
- output: {
18
- sourcemap: true,
19
- format: 'umd',
20
- name: 'app',
21
- file: 'dist/casino-tournaments-list-controller.js',
22
- },
23
- plugins: [
24
- svelte({
25
- preprocess: sveltePreprocess(),
26
- compilerOptions: {
27
- // @TODO check generate and hydratable
28
- // generate: 'ssr',
29
- // hydratable: true,
30
- // enable run-time checks when not in production
31
- customElement: true,
32
- dev: !production
33
- }
34
- }),
35
- image(),
36
- commonjs(),
37
- resolve({
38
- browser: true,
39
- dedupe: ['svelte']
40
- }),
41
- dev && serve({
42
- open: true,
43
- verbose: true,
44
- allowCrossOrigin: true,
45
- historyApiFallback: false,
46
- host: 'localhost',
47
- port: 5050,
48
- }),
49
- dev && livereload({ watch: ['', 'dist'] }),
50
- typescript({
51
- sourceMap: !production,
52
- inlineSources: !production,
53
- }),
54
- // If we're building for production (npm run build
55
- // instead of npm run dev), minify
56
- production &&
57
- terser({
58
- output: {
59
- comments: "all"
60
- },
61
- }),
62
- production && uglify.uglify()
63
- ],
64
- watch: {
65
- clearScreen: false
66
- }
67
- };
@@ -1,205 +0,0 @@
1
- <svelte:options tag={null} />
2
-
3
- <script lang="ts">
4
- import { onMount } from 'svelte';
5
- import moment from 'moment';
6
- import { _, addNewMessages } from './i18n';
7
- import { TRANSLATIONS } from './translations';
8
-
9
- import '@everymatrix/casino-tournaments-thumbnail-controller';
10
-
11
- export let session:String = '';
12
- export let userid:String = '';
13
- export let endpoint:String = '';
14
- export let loginevent:String = '';
15
- export let registerevent:String = '';
16
- export let loginurl:String = '';
17
- export let registerurl:String = '';
18
- export let currency:String = '';
19
- export let lang:String = 'en';
20
- export let keepbrowsercontext:string = 'false';
21
- export let clientstyling:string = '';
22
- export let clientstylingurl:string = '';
23
- export let translationurl:string = '';
24
-
25
- let customStylingContainer: HTMLElement;
26
- let displayNone:boolean = false;
27
-
28
- let isLoading:Boolean = false;
29
- let currentDate:any = moment(); // current day
30
- // Variables of topics for communication
31
- let isLoggedIn:Boolean = true;
32
- let sessionID:String = '';
33
- let playerID:String = '';
34
- let tournamentList:any = '';
35
-
36
- const setTranslationUrl = ():void => {
37
- let url:string = translationurl;
38
-
39
- fetch(url).then((res:any) => res.json())
40
- .then((res) => {
41
- Object.keys(res).forEach((item:any):void => {
42
- addNewMessages(item, res[item]);
43
- });
44
- }).catch((err:any) => {
45
- console.log(err);
46
- });
47
- }
48
-
49
- Object.keys(TRANSLATIONS).forEach((item) => {
50
- addNewMessages(item, TRANSLATIONS[item]);
51
- });
52
-
53
- const messageHandler = (e:any) => {
54
- if (e.data && e.data.type == 'TournamentList') {
55
- tournamentList = [];
56
- isLoading = true;
57
- // Small hack to refresh the list
58
- let finishedTournamentsCounter:number = 0;
59
-
60
- tournamentList = e.data.tournamentList;
61
-
62
- setTimeout(() => {
63
- isLoading = false;
64
- }, 10)
65
- }
66
-
67
- if (e.data && e.data.type == 'TournamentListShowMore') {
68
- tournamentList = [...tournamentList, ...e.data.tournamentList]
69
- }
70
-
71
- if(e.data.type == 'UpdateTournamentView'){
72
- if(!tournamentList){
73
- return;
74
- }
75
- let isNewTournament:boolean = tournamentList.filter( (item) =>{
76
- return item.id == e.data.tournamentData.id;
77
- }).length == 0;
78
- if( isNewTournament ){
79
- tournamentList.pop();
80
- tournamentList=[e.data.tournamentData, ...tournamentList];
81
- setTimeout(()=>{
82
- tournamentList.forEach((item, idx)=>{
83
- window.postMessage({ type: `UpdateSingleTournament_${idx+1}`, tournamentData: item }, window.location.href);
84
- })
85
- }, 100)
86
- }
87
- }
88
- if (e.data && e.data.type == 'UserSessionID') {
89
- isLoggedIn = true;
90
- sessionID = e.data.session;
91
- }
92
- }
93
-
94
- const setSession = () => {
95
- if (session.length > 0 && session != 'false') {
96
- sessionID = session;
97
- isLoggedIn = true;
98
- } else {
99
- isLoggedIn = false;
100
- }
101
- }
102
-
103
- const setPlayerID = () => {
104
- playerID = userid;
105
- }
106
-
107
- const setClientStyling = ():void => {
108
- let sheet = document.createElement('style');
109
- sheet.innerHTML = clientstyling;
110
- customStylingContainer.appendChild(sheet);
111
- }
112
-
113
- const setClientStylingURL = ():void => {
114
- displayNone = true;
115
-
116
- let url:URL = new URL(clientstylingurl);
117
- let cssFile:HTMLElement = document.createElement('style');
118
-
119
- fetch(url.href)
120
- .then((res:any) => res.text())
121
- .then((data:any) => {
122
- cssFile.innerHTML = data
123
-
124
- setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
125
- setTimeout(() => { displayNone = false; }, 500);
126
- });
127
- }
128
-
129
- onMount(() => {
130
- window.addEventListener('message', messageHandler, true);
131
-
132
- return () => {
133
- window.removeEventListener('message', messageHandler, true);
134
- }
135
- });
136
-
137
- $: customStylingContainer && clientstyling && setClientStyling();
138
- $: customStylingContainer && clientstylingurl && setClientStylingURL();
139
- $: translationurl && setTranslationUrl();
140
- $: session && setSession();
141
- $: userid && setPlayerID();
142
- </script>
143
-
144
-
145
- <div bind:this={customStylingContainer} class="TournamentList" part="TournamentList">
146
- {#if !isLoading}
147
- {#each tournamentList as tournament, i}
148
- <casino-tournaments-thumbnail-controller
149
- touridx={i+1}
150
- userid={userid}
151
- showdetails="true"
152
- showslider="false"
153
- tournamenturl={tournament.href}
154
- maxwidth={tournamentList.length <= 2}
155
- loginurl={loginurl}
156
- loginevent={loginevent}
157
- registerurl={registerurl}
158
- tournamentinfo={tournament}
159
- registerevent={registerevent}
160
- {clientstyling}
161
- {clientstylingurl}
162
- {lang}
163
- {currency}
164
- {keepbrowsercontext}
165
- session={session}
166
- endpoint={endpoint}
167
- exportparts="Thumbnail, Status, Enrolled, CardImg, CardImgFinished, Details, Title, Date, ScoreCriteria, ScoreCriteriaP, ScoreCriteriaSpan, Games, GamesP, GamesAnchor, TournamentPrizes, TournamentPrizesSvg, a, TournamentPrizesSvgA, PrizesTitle, Prizes, Prize, PrizeText, PrizeRank,
168
- TournamentDuration, TournamentDates, StartDate, EndDate, ProgressBar, ProgressBarFillEnd, Finished, ProgressBarFillStarting, Remaining, ProgressBarFill,
169
- TournamentsGamesSlider, SliderNavButton, items, item, PlayNowButton, itemHover, SliderNavButton
170
- TournamentCard, CardMaxWidth, CardFullSize, elementToFadeOut, elementToFadeIn, ph-item, ph-col-12, ph-picture, ph-row, ph-col-6, big, ph-col-4, empty, ph-col-8, TournamentButtons, LoginButton, RegisterButton, DetailsButton, EnrolledButton, JoinButton, JoinButtonSpan, JoinButtonSvg, JoinButtonSvgA, JoinButtonFullSize, spinner, DetailsLargeButton, ErrorText, StatusUnstarted, StatusRunning, StatusClosed, StatusClosing, TournamentPrizesIconSection, TournamentPrizesIconWrapper"
171
- ></casino-tournaments-thumbnail-controller>
172
- {:else}
173
- <p>{$_('nothing')}</p>
174
- {/each}
175
- {/if}
176
- </div>
177
-
178
-
179
- <style lang="scss">
180
-
181
-
182
-
183
- *,
184
- *::before,
185
- *::after {
186
- margin: 0;
187
- padding: 0;
188
- list-style: none;
189
- text-decoration: none;
190
- outline: none;
191
- box-sizing: border-box;
192
- }
193
-
194
- $grid-gap: 32px;
195
- $grid-cell-size: 480px;
196
-
197
- .TournamentList {
198
- width: 100%;
199
- display: grid;
200
- grid-template-columns: repeat(auto-fit, minmax(Min(380px, 100%), 1fr));
201
- grid-auto-flow: dense;
202
- gap: 25px;
203
-
204
- }
205
- </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 CasinoTournamentsListController from './CasinoTournamentsListController.svelte';
2
-
3
- !customElements.get('casino-tournaments-list-controller') && customElements.define('casino-tournaments-list-controller', CasinoTournamentsListController);
4
- export default CasinoTournamentsListController;
@@ -1,32 +0,0 @@
1
- export const TRANSLATIONS = {
2
- "en": {
3
- "nothing": "Nothing to show here."
4
- },
5
- "hr": {
6
- "nothing": "Nema ničega za prikazati ovdje."
7
- },
8
- "zh-hk": {
9
- "nothing": "這裡沒有什麼可顯示的。"
10
- },
11
- "fr": {
12
- "nothing": "Rien à montrer ici."
13
- },
14
- "ro": {
15
- "nothing": "Niciun turneu disponibil aici."
16
- },
17
- "tr": {
18
- "nothing": "Burada gösterilecek bir şey yok."
19
- },
20
- "el": {
21
- "nothing": "Δεν υπάρχει τίποτα εδώ."
22
- },
23
- "es": {
24
- "nothing": "Nada que mostrar aquí."
25
- },
26
- "hu": {
27
- "nothing": "Nincs megjelenítendő adat."
28
- },
29
- "pt": {
30
- "nothing": "Nada para mostrar aqui."
31
- }
32
- }
@@ -1,13 +0,0 @@
1
- import { html } from 'lit-element';
2
-
3
- import CasinoTournamentsListController from '../src/CasinoTournamentsListController';
4
-
5
- // This default export determines where your story goes in the story list
6
- export default {
7
- title: 'CasinoTournamentsListController',
8
- };
9
-
10
- // 👇 We create a “template” of how args map to rendering
11
- const CasinoTournamentsListController = ({ aProperty }) => html`<casino-tournaments-list-controller></casino-tournaments-list-controller>`;
12
-
13
- export const FirstStory = CasinoTournamentsListController.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
- }