@everymatrix/casino-tournaments-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.
- package/components/CasinoTournamentsController-CQ5C1jDl.cjs +14 -0
- package/components/CasinoTournamentsController-Cr8b4j7l.js +5627 -0
- package/components/CasinoTournamentsFilterController-BtuK-ddv.cjs +1 -0
- package/components/CasinoTournamentsFilterController-Chy_sE0V.js +529 -0
- package/components/CasinoTournamentsListController-BinvLjvx.cjs +13 -0
- package/components/CasinoTournamentsListController-DXHqP9An.js +3103 -0
- package/components/CasinoTournamentsThumbnail-BFS6MlWH.js +865 -0
- package/components/CasinoTournamentsThumbnail-CM3Rfdn3.cjs +4 -0
- package/components/CasinoTournamentsThumbnailController-C71hXcQP.cjs +1 -0
- package/components/CasinoTournamentsThumbnailController-NEf6XMRB.js +1405 -0
- package/components/CasinoTournamentsThumbnailDuration-CrS_PUCZ.cjs +1 -0
- package/components/CasinoTournamentsThumbnailDuration-bu3Mm2Ay.js +495 -0
- package/components/CasinoTournamentsThumbnailGamesSlider-DNrAc-zm.cjs +1 -0
- package/components/CasinoTournamentsThumbnailGamesSlider-_haSuIUI.js +438 -0
- package/components/CasinoTournamentsThumbnailPrizes-BRcfU1P4.js +310 -0
- package/components/CasinoTournamentsThumbnailPrizes-E5pafLaj.cjs +1 -0
- package/es2015/casino-tournaments-controller.cjs +1 -0
- package/es2015/casino-tournaments-controller.js +16 -0
- package/package.json +18 -32
- package/.eslintrc +0 -84
- package/CHANGELOG.md +0 -11
- package/README.md +0 -0
- package/dist/casino-tournaments-controller.js +0 -2
- package/dist/casino-tournaments-controller.js.map +0 -1
- package/documentation.md +0 -170
- package/index.html +0 -29
- package/index.js +0 -1
- package/public/favicon.png +0 -0
- package/public/reset.css +0 -48
- package/rollup.config.js +0 -67
- package/src/CasinoTournamentsController.svelte +0 -527
- package/src/i18n.js +0 -27
- package/src/index.ts +0 -4
- package/src/translations.js +0 -62
- package/src/util.ts +0 -2
- package/stories/CasinoTournamentsController.stories.js +0 -13
- package/svelte.config.js +0 -7
- package/tsconfig.json +0 -6
package/documentation.md
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
# Overview
|
|
2
|
-
|
|
3
|
-
## Meet the Casino Tournaments Widget
|
|
4
|
-
|
|
5
|
-
The `Casino Tournaments Widget` is a collection of web components designed and developed to offer a complete and comprehensive experience. The widget offers customization and ease of instalation.
|
|
6
|
-
|
|
7
|
-
## Why the Casino Tournaments Widget?
|
|
8
|
-
|
|
9
|
-
There are a variety of options available when discussing the development of a `Casino Tournaments` as part of your existing product. These options will take time to architect, plan, schedule, develop and test. However, we believe that adding a `Casino Tournaments` page to your existing or new product should be as easy as copying and pasting from an email; which it is now.
|
|
10
|
-
|
|
11
|
-
## A progressive widget
|
|
12
|
-
We like to call our casino widget a "progressive" one since it grows with you. If you just want a simple implementation our architecture and documentation will be there to help you achieve it in mere minutes.
|
|
13
|
-
|
|
14
|
-
If you are looking for a bigger implementation into a much more mature product the casino widget gives you a set of robust tools for using player sessions, customizing actions, customizing the UI, enabling or disabling widget features on demand and more.
|
|
15
|
-
|
|
16
|
-
## A scalable widget
|
|
17
|
-
The `Casino Tournaments Widget` scales with you. Although the scalability is mainly accomplished by your main product (the one you integrate this widget into) and by your architecture we took all the necessary steps and precautions to ensure the uninterrupted functionality of this product.
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## Pre-requisites needed
|
|
22
|
-
|
|
23
|
-
For the Widget to be able to work, the parent website needs to integrated with the EM platform.
|
|
24
|
-
|
|
25
|
-
Supported integrations:
|
|
26
|
-
- NorWAy Integration
|
|
27
|
-
- UBS Integration
|
|
28
|
-
|
|
29
|
-
For further information on how to proceed with your current integration please contact your assigned Integration Manager.
|
|
30
|
-
|
|
31
|
-
## Setup the widget on your website.
|
|
32
|
-
To install the latest version released for the widget, which will be automatically updated once a new release is made, add the following script tag, in the root page of your application.
|
|
33
|
-
|
|
34
|
-
The script can be added either in the <head> or in the <body>. We recommend adding it in the footer of the page for better performance of the entire website.
|
|
35
|
-
```javascript
|
|
36
|
-
<script src="https://unpkg.com/@everymatrix/casino-tournaments-controller/dist/casino-tournaments-controller.js"></script>
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
For a specific version, the script tag looks like this:
|
|
40
|
-
```javascript
|
|
41
|
-
<script src="https://unpkg.com/@everymatrix/casino-tournaments-controller@1.0.0/dist/casino-tournaments-controller.js"></script>
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Usage
|
|
45
|
-
|
|
46
|
-
> **_PLEASE NOTE:_** The `Casino Tournaments Widget` is made of two components - `casino-tournaments-controller` and `casino-tournaments-page-controller`. In order to have it completly integrated, please check out the documentation for `casino-tournaments-page-controller` here -
|
|
47
|
-
|
|
48
|
-
Inside your page you need to add the webcomponent tag for the `Casino Tournaments Widget`.
|
|
49
|
-
|
|
50
|
-
```html
|
|
51
|
-
<casino-tournaments-controller
|
|
52
|
-
endpoint="https://demo-api.stage.norway.everymatrix.com"
|
|
53
|
-
cmsendpoint="https://wp-one-widgets.everymatrix.com/wp-json/wpone-rest/v1/tournaments"
|
|
54
|
-
numberoftournaments="4"
|
|
55
|
-
showmorestep="3"
|
|
56
|
-
lang="en"
|
|
57
|
-
filters="All,Scheduled,Ongoing,Finished"
|
|
58
|
-
showleaderboard="true"
|
|
59
|
-
/>
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Full example:
|
|
63
|
-
|
|
64
|
-
```html
|
|
65
|
-
<!doctype html>
|
|
66
|
-
<html lang="en">
|
|
67
|
-
<head>
|
|
68
|
-
<meta charset="UTF-8">
|
|
69
|
-
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
|
70
|
-
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
71
|
-
<title>EM Widgets | Casino Tournaments Widget Demo</title>
|
|
72
|
-
|
|
73
|
-
<script src="https://unpkg.com/@everymatrix/casino-tournaments-controller/dist/casino-tournaments-controller.js"></script>
|
|
74
|
-
|
|
75
|
-
</head>
|
|
76
|
-
<body>
|
|
77
|
-
<div class="container">
|
|
78
|
-
<casino-tournaments-controller
|
|
79
|
-
endpoint="https://demo-api.stage.norway.everymatrix.com"
|
|
80
|
-
cmsendpoint="https://wp-one-widgets.everymatrix.com/wp-json/wpone-rest/v1/tournaments"
|
|
81
|
-
numberoftournaments="4"
|
|
82
|
-
showmorestep="3"
|
|
83
|
-
lang="en"
|
|
84
|
-
filters="All,Scheduled,Ongoing,Finished"
|
|
85
|
-
showleaderboard="true"
|
|
86
|
-
/>
|
|
87
|
-
</div>
|
|
88
|
-
</body>
|
|
89
|
-
</html>
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
> **_PLEASE NOTE:_** The given example is a fully working HTML page and demo credentials are used for ```endpoint``` and ```cmsendpoint``` fields. For development and productions purposes you will need to use your own provided credentials.
|
|
93
|
-
|
|
94
|
-
### Widget communication
|
|
95
|
-
|
|
96
|
-
As main channel of communication, the widget has a library inside of it that helps to create reactive stream, exposed on `window` object.
|
|
97
|
-
```javascript
|
|
98
|
-
const myStream = window.emWidgets.topic('${domain:myStream}');
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
The `topic` comes with two methods that helps to change the data inside the stream:
|
|
102
|
-
```javascript
|
|
103
|
-
topic('domain:myStream').subscribe(() => {/* your code here */}); // listen to changes of a stream;
|
|
104
|
-
topic('domain:myStream').next(() => {/* your code here */}); // write changes to a stream;
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
A full example for a stream made for communicate details about player session:
|
|
108
|
-
|
|
109
|
-
```javascript
|
|
110
|
-
// inside your application, where you want to handle changes on player session
|
|
111
|
-
const sessionStream = window.emWidgets.topic('player:session');
|
|
112
|
-
|
|
113
|
-
// once the users logs in
|
|
114
|
-
sessionStream.next({
|
|
115
|
-
isLoggedIn: true,
|
|
116
|
-
sessionID: ${player_session},
|
|
117
|
-
userID: ${player_ID}
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
// once the users logs out
|
|
121
|
-
sessionStream.next({
|
|
122
|
-
isLoggedIn: false
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
// follow the changes of the session stream
|
|
126
|
-
sessionStream.subscribe((data) => {
|
|
127
|
-
if (data.isLoggedIn) {
|
|
128
|
-
// do whatever you want with the player session
|
|
129
|
-
} else {
|
|
130
|
-
// the session is no longer valid
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
All widget streams:
|
|
136
|
-
|Topic name|Description|
|
|
137
|
-
|----------|-----------|
|
|
138
|
-
|player:session|Following all the changes made on the player session|
|
|
139
|
-
|
|
140
|
-
## API Reference
|
|
141
|
-
|Parameter|Mandatory|Comment|
|
|
142
|
-
|---------|---------|-------|
|
|
143
|
-
|endpoint |yes|NorWAy endpoint|
|
|
144
|
-
|cmsendpoint|yes|WordPress CMS Endpoint|
|
|
145
|
-
|lang|yes|Language of the website|
|
|
146
|
-
|numberoftournaments|no|Number of tournaments to be shown in the lobby- Default: 6|
|
|
147
|
-
|showmorestep|no|Number of tournaments loaded when `Show more` button is clicked - Default: 2|
|
|
148
|
-
|filters|no|Default:'All,Scheduled,Ongoing,Finished'|
|
|
149
|
-
|loginurl|no|The URL where the user should be redirected when the `Login` button is clicked|
|
|
150
|
-
|loginevent|no|The `postMessage` event that should be triggered when the `Login` button is clicked|
|
|
151
|
-
|registerurl|no|The URL where the user should be redirected when the `Register` button is clicked|
|
|
152
|
-
|registerevent|no|The `postMessage` event that should be triggered when the `Register` button is clicked|
|
|
153
|
-
|keepbrowsercontext|no|Flag for opening the tournament games category page in the same tab or in a new one|
|
|
154
|
-
|
|
155
|
-
## Widget Events
|
|
156
|
-
|
|
157
|
-
The widget has the ability to send Javascript events to the parent website to extend the functionality.
|
|
158
|
-
|
|
159
|
-
The Widget currently supports the following events:
|
|
160
|
-
|
|
161
|
-
|EventName|Comments|Params|
|
|
162
|
-
|---------|--------|------|
|
|
163
|
-
|TournamentDetailsClicked|This `postMessage` event is triggered when the details button of a tournament is clicked |tournamentId - ID of the selected tournament - this ID must be passed to the `casino-tournaments-page-controller` page|
|
|
164
|
-
|TournamentsPagination|This `postMessage` event is triggered when the `Show more` button is clicked|offset - skipped tournaments, limit - maximum number of the tournaments|
|
|
165
|
-
|
|
166
|
-
## Releases
|
|
167
|
-
|
|
168
|
-
|Release Version|Value |Scope|Status|Completed Date|
|
|
169
|
-
|---------------|----- |-----|------|--------------|
|
|
170
|
-
|`0.0.36` |Initial release| - |*DONE*|`20 Jul 2021` |
|
package/index.html
DELETED
|
@@ -1,29 +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-controller
|
|
9
|
-
</title>
|
|
10
|
-
<link rel="stylesheet" href="public/reset.css">
|
|
11
|
-
<script src='dist/casino-tournaments-controller.js'></script>
|
|
12
|
-
|
|
13
|
-
</head>
|
|
14
|
-
|
|
15
|
-
<body>
|
|
16
|
-
<style>
|
|
17
|
-
html,body { margin: 0; padding: 0; height: 100%; font-family: "Helvetica Neue", "Helvetica", sans-serif; }
|
|
18
|
-
</style>
|
|
19
|
-
|
|
20
|
-
<div class="webcomponent">
|
|
21
|
-
<casino-tournaments-controller session="2e16fc0f-065e-46aa-9ffe-4b436b981c54" userid="3916962" loginevent="OpenRegisterLoginModal" showleaderboard="true" endpoint="https://demo-api.stage.norway.everymatrix.com/v1" cmsendpoint="https://casinouat.pamestoixima.gr/apijson/en/tournaments/906333318049055456" numberoftournaments="4" showmorestep="3" lang="hr" filters="All,Scheduled,Ongoing,Finished"></casino-tournaments-controller>
|
|
22
|
-
<!--<casino-tournaments-controller loginevent="OpenRegisterLoginModal" showleaderboard="true" endpoint="https://demo-api.stage.norway.everymatrix.com/v1" cmsendpoint="https://wp-one-widgets.everymatrix.com/wp-json/wpone-rest/v1/tournaments" numberoftournaments="10" showmorestep="3" lang="en" filters="All,Scheduled,Ongoing,Finished"></casino-tournaments-controller>-->
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
<script>
|
|
26
|
-
</script>
|
|
27
|
-
|
|
28
|
-
</body>
|
|
29
|
-
</html>
|
package/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './dist/casino-tournaments-controller.js';
|
package/public/favicon.png
DELETED
|
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-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
|
-
};
|