@everymatrix/casino-tournament-slider 1.0.69

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 (44) hide show
  1. package/dist/casino-tournament-slider/casino-tournament-slider.esm.js +1 -0
  2. package/dist/casino-tournament-slider/index.esm.js +0 -0
  3. package/dist/casino-tournament-slider/p-01da553f.entry.js +1 -0
  4. package/dist/casino-tournament-slider/p-c541e3cd.js +2 -0
  5. package/dist/casino-tournament-slider/p-e1255160.js +1 -0
  6. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  7. package/dist/cjs/casino-tournament-slider.cjs.js +25 -0
  8. package/dist/cjs/casino-tournament-slider_2.cjs.entry.js +352 -0
  9. package/dist/cjs/index-e4a7f235.js +1279 -0
  10. package/dist/cjs/index.cjs.js +2 -0
  11. package/dist/cjs/loader.cjs.js +15 -0
  12. package/dist/collection/collection-manifest.json +19 -0
  13. package/dist/collection/components/casino-tournament-slider/casino-tournament-slider.css +62 -0
  14. package/dist/collection/components/casino-tournament-slider/casino-tournament-slider.js +345 -0
  15. package/dist/collection/components/casino-tournament-slider/index.js +1 -0
  16. package/dist/collection/index.js +1 -0
  17. package/dist/collection/utils/locale.utils.js +39 -0
  18. package/dist/collection/utils/utils.js +3 -0
  19. package/dist/esm/app-globals-0f993ce5.js +3 -0
  20. package/dist/esm/casino-tournament-slider.js +20 -0
  21. package/dist/esm/casino-tournament-slider_2.entry.js +347 -0
  22. package/dist/esm/index-e38437e9.js +1252 -0
  23. package/dist/esm/index.js +1 -0
  24. package/dist/esm/loader.js +11 -0
  25. package/dist/index.cjs.js +1 -0
  26. package/dist/index.js +1 -0
  27. package/dist/stencil.config.dev.js +17 -0
  28. package/dist/stencil.config.js +17 -0
  29. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/casino-tournament-slider/.stencil/packages/stencil/casino-tournament-slider/stencil.config.d.ts +2 -0
  30. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/casino-tournament-slider/.stencil/packages/stencil/casino-tournament-slider/stencil.config.dev.d.ts +2 -0
  31. package/dist/types/components/casino-tournament-slider/casino-tournament-slider.d.ts +30 -0
  32. package/dist/types/components/casino-tournament-slider/index.d.ts +1 -0
  33. package/dist/types/components.d.ts +61 -0
  34. package/dist/types/index.d.ts +1 -0
  35. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  36. package/dist/types/utils/locale.utils.d.ts +1 -0
  37. package/dist/types/utils/utils.d.ts +1 -0
  38. package/loader/cdn.js +1 -0
  39. package/loader/index.cjs.js +1 -0
  40. package/loader/index.d.ts +24 -0
  41. package/loader/index.es2017.js +1 -0
  42. package/loader/index.js +2 -0
  43. package/loader/package.json +11 -0
  44. package/package.json +29 -0
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-e4a7f235.js');
6
+ const appGlobals = require('./app-globals-3a1e7e63.js');
7
+
8
+ const defineCustomElements = async (win, options) => {
9
+ if (typeof window === 'undefined') return undefined;
10
+ await appGlobals.globalScripts();
11
+ return index.bootstrapLazy([["casino-tournament-slider_2.cjs",[[1,"casino-tournament-slider",{"useEvent":[1,"use-event"],"endpoint":[1],"tournamentId":[1,"tournament-id"],"session":[1],"language":[1],"gamesLimit":[2,"games-limit"],"offset":[2],"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"showTitle":[4,"show-title"],"limitStylingAppends":[32],"games":[32],"hover":[32],"hoverIndex":[32]},[[8,"getTournamentInfoCompleted","todoCompletedHandler"]]],[1,"general-slider",{"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"showArrow":[4,"show-arrow"],"showButton":[4,"show-button"],"autoSlide":[4,"auto-slide"],"loopTime":[2,"loop-time"],"autoItemHeight":[4,"auto-item-height"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"currentSlideNumber":[32],"slidesCount":[32],"limitStylingAppends":[32]}]]]], options);
12
+ };
13
+
14
+ exports.setNonce = index.setNonce;
15
+ exports.defineCustomElements = defineCustomElements;
@@ -0,0 +1,19 @@
1
+ {
2
+ "entries": [
3
+ "components/casino-tournament-slider/casino-tournament-slider.js"
4
+ ],
5
+ "compiler": {
6
+ "name": "@stencil/core",
7
+ "version": "4.20.0",
8
+ "typescriptVersion": "5.5.3"
9
+ },
10
+ "collections": [
11
+ {
12
+ "name": "@everymatrix/general-slider",
13
+ "tags": [
14
+ "general-slider"
15
+ ]
16
+ }
17
+ ],
18
+ "bundles": []
19
+ }
@@ -0,0 +1,62 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .Item {
6
+ color: white;
7
+ display: flex;
8
+ justify-content: center;
9
+ align-items: center;
10
+ font-weight: bold;
11
+ font-size: 10rem;
12
+ user-select: none;
13
+ overflow: hidden;
14
+ }
15
+ .Item .Img {
16
+ width: 100%;
17
+ height: 100%;
18
+ }
19
+
20
+ .PlayNowButton {
21
+ position: absolute;
22
+ background: var(--emfe-w-color-green, #48952a);
23
+ display: block;
24
+ box-sizing: border-box;
25
+ padding: 0.8rem 0.5rem;
26
+ color: var(--emfe-w-color-white, #FFFFFF);
27
+ text-transform: uppercase;
28
+ text-align: center;
29
+ font-weight: 600;
30
+ font-size: 0.7rem;
31
+ cursor: pointer;
32
+ transition: opacity 0.4s linear;
33
+ opacity: 0;
34
+ text-overflow: ellipsis;
35
+ white-space: nowrap;
36
+ overflow: hidden;
37
+ }
38
+
39
+ .ItemHover {
40
+ opacity: 1;
41
+ }
42
+
43
+ .Items .Item:first-child {
44
+ margin-left: 0;
45
+ }
46
+
47
+ .Items .Item:last-child {
48
+ margin-right: 0;
49
+ }
50
+
51
+ .SliderTitle {
52
+ display: flex;
53
+ align-items: center;
54
+ padding: 6px 0;
55
+ gap: 11px;
56
+ }
57
+
58
+ .Title {
59
+ color: #fff;
60
+ font-size: 14px;
61
+ font-weight: 600;
62
+ }
@@ -0,0 +1,345 @@
1
+ import { h } from "@stencil/core";
2
+ import "../../../../../general-slider/dist/types/index";
3
+ import { translate } from "../../utils/locale.utils";
4
+ export class CasinoTournamentSlider {
5
+ constructor() {
6
+ this.enter = (index) => {
7
+ this.hover = true;
8
+ this.hoverIndex = index;
9
+ };
10
+ this.leave = () => {
11
+ this.hover = false;
12
+ this.hoverIndex = -1;
13
+ };
14
+ this.gameClicked = (item) => {
15
+ window.postMessage({ type: 'TournamentGameAction', gameId: item.id, name: item.name }, window.location.href);
16
+ };
17
+ this.useEvent = undefined;
18
+ this.endpoint = undefined;
19
+ this.tournamentId = undefined;
20
+ this.session = undefined;
21
+ this.language = undefined;
22
+ this.gamesLimit = 30;
23
+ this.offset = 0;
24
+ this.slideNumber = 3;
25
+ this.slideShow = 3;
26
+ this.clientStyling = '';
27
+ this.clientStylingUrl = '';
28
+ this.showTitle = false;
29
+ this.limitStylingAppends = false;
30
+ this.games = undefined;
31
+ this.hover = undefined;
32
+ this.hoverIndex = undefined;
33
+ }
34
+ todoCompletedHandler(event) {
35
+ if (event.detail && this.useEvent) {
36
+ if (!event.detail.games)
37
+ return;
38
+ this.games = event.detail.games.items;
39
+ }
40
+ }
41
+ getTournamentInfo() {
42
+ let url = new URL(this.endpoint + `/v1/tournaments/${this.tournamentId}`);
43
+ let reqHeaders = new Headers();
44
+ url.searchParams.append('expand', 'games');
45
+ url.searchParams.append('language', this.language);
46
+ url.searchParams.append('pagination', `games(limit=${this.gamesLimit},offset=${this.offset})`);
47
+ url.searchParams.append('fields', 'games(id,name,thumbnail)');
48
+ if (this.session) {
49
+ reqHeaders.append('X-SessionId', this.session);
50
+ }
51
+ let requestOptions = {
52
+ method: 'GET',
53
+ headers: reqHeaders,
54
+ };
55
+ fetch(url.href, requestOptions).then((res) => res.json())
56
+ .then((res) => {
57
+ this.games = res.item.games.items;
58
+ });
59
+ }
60
+ componentWillLoad() {
61
+ if (!this.useEvent && this.endpoint && this.tournamentId) {
62
+ this.getTournamentInfo();
63
+ }
64
+ }
65
+ componentDidRender() {
66
+ if (!this.limitStylingAppends && this.host) {
67
+ if (this.clientStyling)
68
+ this.setClientStyling();
69
+ if (this.clientStylingUrl)
70
+ this.setClientStylingURL();
71
+ this.limitStylingAppends = true;
72
+ }
73
+ }
74
+ setClientStyling() {
75
+ const sheet = new CSSStyleSheet();
76
+ // @ts-ignore
77
+ sheet.replace(this.clientStyling);
78
+ // @ts-ignore
79
+ this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
80
+ }
81
+ setClientStylingURL() {
82
+ let url = new URL(this.clientStylingUrl);
83
+ fetch(url.href)
84
+ .then((res) => res.text())
85
+ .then((data) => {
86
+ const sheet = new CSSStyleSheet();
87
+ // @ts-ignore
88
+ sheet.replace(data);
89
+ // @ts-ignore
90
+ this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
91
+ });
92
+ }
93
+ render() {
94
+ return h("div", { key: 'f16db0fd04952457c6e637e34e3295de9f2ab00e', class: "TournamentSliderWrap" }, h("div", { key: '246d6bae2b600ebc97e8cfbdf707ae284f0cef20', class: "TournamentSlider" }, this.showTitle && this.games &&
95
+ h("div", { key: 'd9760b0b053aa103a8bb1d24e860d83225aba17b', class: "SliderTitle" }, h("svg", { key: '47e2a1441fa2eb68510eb9a775ff14e6b5221afd', xmlns: "http://www.w3.org/2000/svg", width: "21", height: "25", viewBox: "0 0 21 25", fill: "none" }, h("path", { key: '566c04c19cbd24b79fba1c87f9872e28689178e3', d: "M6.1774 22.1728C6.36493 22.2725 6.56274 22.0566 6.44793 21.8779C5.82475 20.908 5.23463 19.2759 6.17483 17.174C7.74273 13.6689 8.6968 11.8535 8.6968 11.8535C8.6968 11.8535 9.20426 13.9721 10.5799 15.8558C11.9038 17.6687 12.6285 19.9488 11.4602 21.8482C11.3506 22.0265 11.5439 22.2368 11.7302 22.1415C13.1763 21.4017 14.7983 19.9179 14.9813 16.965C15.0488 16.0627 14.9476 14.7995 14.4416 13.2054C13.791 11.185 12.9911 10.2423 12.5283 9.83741C12.3899 9.71629 12.1746 9.82363 12.1859 10.0072C12.3208 12.1872 11.5007 12.7404 11.0339 11.4937C10.8474 10.9957 10.7387 10.1344 10.7387 9.08558C10.7387 7.3394 10.2321 5.54188 9.1152 4.0812C8.82475 3.70134 8.4849 3.3464 8.09498 3.04372C7.95382 2.93411 7.74919 3.04428 7.76212 3.22252C7.84788 4.40628 7.77018 7.79884 4.79383 11.8519C2.09515 15.6115 3.14088 18.4989 3.51195 19.281C4.2214 20.7791 5.21098 21.6589 6.1774 22.1728Z", fill: "white" })), h("span", { key: '6a6e5fc1e888de1ace0b0c577cc96b98c55a65bd', class: "Title" }, translate('sliderTitle', this.language))), h("div", { key: '0d18223f0d9603ba8e94a87725bfc52592f5a120', class: "Items" }, this.games &&
96
+ h("general-slider", { key: 'd56409e9730aeae803bb2a54951d9ba0912dbf51', "slide-number": this.slideNumber, "slide-show": this.slideShow }, this.games && this.games.map((game, i) => {
97
+ return h("li", { class: "Item", onMouseEnter: () => this.enter(i), onMouseLeave: () => this.leave() }, h("span", { class: `PlayNowButton ${this.hoverIndex == i ? 'ItemHover' : ''}`, onClick: () => { this.gameClicked(game); } }, translate('playNow', this.language)), h("img", { class: "Img", src: game.thumbnail, alt: game.name, title: game.name }));
98
+ })))));
99
+ }
100
+ static get is() { return "casino-tournament-slider"; }
101
+ static get encapsulation() { return "shadow"; }
102
+ static get originalStyleUrls() {
103
+ return {
104
+ "$": ["casino-tournament-slider.scss"]
105
+ };
106
+ }
107
+ static get styleUrls() {
108
+ return {
109
+ "$": ["casino-tournament-slider.css"]
110
+ };
111
+ }
112
+ static get properties() {
113
+ return {
114
+ "useEvent": {
115
+ "type": "string",
116
+ "mutable": false,
117
+ "complexType": {
118
+ "original": "string",
119
+ "resolved": "string",
120
+ "references": {}
121
+ },
122
+ "required": false,
123
+ "optional": false,
124
+ "docs": {
125
+ "tags": [],
126
+ "text": ""
127
+ },
128
+ "attribute": "use-event",
129
+ "reflect": false
130
+ },
131
+ "endpoint": {
132
+ "type": "string",
133
+ "mutable": false,
134
+ "complexType": {
135
+ "original": "string",
136
+ "resolved": "string",
137
+ "references": {}
138
+ },
139
+ "required": false,
140
+ "optional": false,
141
+ "docs": {
142
+ "tags": [],
143
+ "text": ""
144
+ },
145
+ "attribute": "endpoint",
146
+ "reflect": false
147
+ },
148
+ "tournamentId": {
149
+ "type": "string",
150
+ "mutable": false,
151
+ "complexType": {
152
+ "original": "string",
153
+ "resolved": "string",
154
+ "references": {}
155
+ },
156
+ "required": false,
157
+ "optional": false,
158
+ "docs": {
159
+ "tags": [],
160
+ "text": ""
161
+ },
162
+ "attribute": "tournament-id",
163
+ "reflect": false
164
+ },
165
+ "session": {
166
+ "type": "string",
167
+ "mutable": false,
168
+ "complexType": {
169
+ "original": "string",
170
+ "resolved": "string",
171
+ "references": {}
172
+ },
173
+ "required": false,
174
+ "optional": false,
175
+ "docs": {
176
+ "tags": [],
177
+ "text": ""
178
+ },
179
+ "attribute": "session",
180
+ "reflect": false
181
+ },
182
+ "language": {
183
+ "type": "string",
184
+ "mutable": false,
185
+ "complexType": {
186
+ "original": "string",
187
+ "resolved": "string",
188
+ "references": {}
189
+ },
190
+ "required": false,
191
+ "optional": false,
192
+ "docs": {
193
+ "tags": [],
194
+ "text": ""
195
+ },
196
+ "attribute": "language",
197
+ "reflect": false
198
+ },
199
+ "gamesLimit": {
200
+ "type": "number",
201
+ "mutable": false,
202
+ "complexType": {
203
+ "original": "number",
204
+ "resolved": "number",
205
+ "references": {}
206
+ },
207
+ "required": false,
208
+ "optional": false,
209
+ "docs": {
210
+ "tags": [],
211
+ "text": ""
212
+ },
213
+ "attribute": "games-limit",
214
+ "reflect": false,
215
+ "defaultValue": "30"
216
+ },
217
+ "offset": {
218
+ "type": "number",
219
+ "mutable": false,
220
+ "complexType": {
221
+ "original": "number",
222
+ "resolved": "number",
223
+ "references": {}
224
+ },
225
+ "required": false,
226
+ "optional": false,
227
+ "docs": {
228
+ "tags": [],
229
+ "text": ""
230
+ },
231
+ "attribute": "offset",
232
+ "reflect": false,
233
+ "defaultValue": "0"
234
+ },
235
+ "slideNumber": {
236
+ "type": "number",
237
+ "mutable": false,
238
+ "complexType": {
239
+ "original": "number",
240
+ "resolved": "number",
241
+ "references": {}
242
+ },
243
+ "required": false,
244
+ "optional": false,
245
+ "docs": {
246
+ "tags": [],
247
+ "text": ""
248
+ },
249
+ "attribute": "slide-number",
250
+ "reflect": false,
251
+ "defaultValue": "3"
252
+ },
253
+ "slideShow": {
254
+ "type": "number",
255
+ "mutable": false,
256
+ "complexType": {
257
+ "original": "number",
258
+ "resolved": "number",
259
+ "references": {}
260
+ },
261
+ "required": false,
262
+ "optional": false,
263
+ "docs": {
264
+ "tags": [],
265
+ "text": ""
266
+ },
267
+ "attribute": "slide-show",
268
+ "reflect": false,
269
+ "defaultValue": "3"
270
+ },
271
+ "clientStyling": {
272
+ "type": "string",
273
+ "mutable": false,
274
+ "complexType": {
275
+ "original": "string",
276
+ "resolved": "string",
277
+ "references": {}
278
+ },
279
+ "required": false,
280
+ "optional": false,
281
+ "docs": {
282
+ "tags": [],
283
+ "text": ""
284
+ },
285
+ "attribute": "client-styling",
286
+ "reflect": false,
287
+ "defaultValue": "''"
288
+ },
289
+ "clientStylingUrl": {
290
+ "type": "string",
291
+ "mutable": false,
292
+ "complexType": {
293
+ "original": "string",
294
+ "resolved": "string",
295
+ "references": {}
296
+ },
297
+ "required": false,
298
+ "optional": false,
299
+ "docs": {
300
+ "tags": [],
301
+ "text": ""
302
+ },
303
+ "attribute": "client-styling-url",
304
+ "reflect": false,
305
+ "defaultValue": "''"
306
+ },
307
+ "showTitle": {
308
+ "type": "boolean",
309
+ "mutable": false,
310
+ "complexType": {
311
+ "original": "boolean",
312
+ "resolved": "boolean",
313
+ "references": {}
314
+ },
315
+ "required": false,
316
+ "optional": false,
317
+ "docs": {
318
+ "tags": [],
319
+ "text": ""
320
+ },
321
+ "attribute": "show-title",
322
+ "reflect": false,
323
+ "defaultValue": "false"
324
+ }
325
+ };
326
+ }
327
+ static get states() {
328
+ return {
329
+ "limitStylingAppends": {},
330
+ "games": {},
331
+ "hover": {},
332
+ "hoverIndex": {}
333
+ };
334
+ }
335
+ static get elementRef() { return "host"; }
336
+ static get listeners() {
337
+ return [{
338
+ "name": "getTournamentInfoCompleted",
339
+ "method": "todoCompletedHandler",
340
+ "target": "window",
341
+ "capture": false,
342
+ "passive": false
343
+ }];
344
+ }
345
+ }
@@ -0,0 +1 @@
1
+ export { CasinoTournamentSlider } from './casino-tournament-slider';
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1,39 @@
1
+ const DEFAULT_LANGUAGE = 'en';
2
+ const TRANSLATIONS = {
3
+ en: {
4
+ playNow: 'Play now',
5
+ sliderTitle: 'Participanting games'
6
+ },
7
+ 'zh-hk': {
8
+ playNow: '现在播放',
9
+ },
10
+ fr: {
11
+ playNow: 'Joue maintenant',
12
+ },
13
+ ro: {
14
+ playNow: 'Joaca acum',
15
+ },
16
+ hu: {
17
+ playNow: 'Játsszon most',
18
+ },
19
+ tr: {
20
+ playNow: 'Şimdi oyna',
21
+ },
22
+ el: {
23
+ playNow: 'Παίξε τώρα',
24
+ },
25
+ es: {
26
+ playNow: 'Jugar Ya',
27
+ },
28
+ pt: {
29
+ playNow: 'Jogue agora',
30
+ },
31
+ hr: {
32
+ playNow: 'IGRAJ SADA',
33
+ }
34
+ };
35
+ export const translate = (key, customLang) => {
36
+ var _a, _b;
37
+ const lang = customLang;
38
+ return ((_a = TRANSLATIONS[lang]) === null || _a === void 0 ? void 0 : _a[key]) || ((_b = TRANSLATIONS[DEFAULT_LANGUAGE]) === null || _b === void 0 ? void 0 : _b[key]);
39
+ };
@@ -0,0 +1,3 @@
1
+ export function format(first, middle, last) {
2
+ return ((first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : ''));
3
+ }
@@ -0,0 +1,3 @@
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };
@@ -0,0 +1,20 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-e38437e9.js';
2
+ export { s as setNonce } from './index-e38437e9.js';
3
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
4
+
5
+ /*
6
+ Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com
7
+ */
8
+ var patchBrowser = () => {
9
+ const importMeta = import.meta.url;
10
+ const opts = {};
11
+ if (importMeta !== "") {
12
+ opts.resourcesUrl = new URL(".", importMeta).href;
13
+ }
14
+ return promiseResolve(opts);
15
+ };
16
+
17
+ patchBrowser().then(async (options) => {
18
+ await globalScripts();
19
+ return bootstrapLazy([["casino-tournament-slider_2",[[1,"casino-tournament-slider",{"useEvent":[1,"use-event"],"endpoint":[1],"tournamentId":[1,"tournament-id"],"session":[1],"language":[1],"gamesLimit":[2,"games-limit"],"offset":[2],"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"showTitle":[4,"show-title"],"limitStylingAppends":[32],"games":[32],"hover":[32],"hoverIndex":[32]},[[8,"getTournamentInfoCompleted","todoCompletedHandler"]]],[1,"general-slider",{"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"showArrow":[4,"show-arrow"],"showButton":[4,"show-button"],"autoSlide":[4,"auto-slide"],"loopTime":[2,"loop-time"],"autoItemHeight":[4,"auto-item-height"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"currentSlideNumber":[32],"slidesCount":[32],"limitStylingAppends":[32]}]]]], options);
20
+ });