@everymatrix/casino-tournament-prizes 1.44.0 → 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.
Files changed (48) hide show
  1. package/dist/casino-tournament-prizes/casino-tournament-prizes.esm.js +1 -1
  2. package/dist/casino-tournament-prizes/p-52494b9c.js +2 -0
  3. package/dist/casino-tournament-prizes/p-9274e610.entry.js +1 -0
  4. package/dist/casino-tournament-prizes/p-e1255160.js +1 -0
  5. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  6. package/dist/cjs/casino-tournament-prizes.cjs.entry.js +159 -153
  7. package/dist/cjs/casino-tournament-prizes.cjs.js +16 -10
  8. package/dist/cjs/index-c53c7832.js +1234 -0
  9. package/dist/cjs/loader.cjs.js +6 -12
  10. package/dist/collection/collection-manifest.json +3 -3
  11. package/dist/collection/components/casino-tournament-prizes/casino-tournament-prizes.js +295 -309
  12. package/dist/collection/components/casino-tournament-prizes/index.js +1 -0
  13. package/dist/collection/utils/locale.utils.js +53 -53
  14. package/dist/collection/utils/utils.js +1 -1
  15. package/dist/esm/app-globals-0f993ce5.js +3 -0
  16. package/dist/esm/casino-tournament-prizes.entry.js +159 -153
  17. package/dist/esm/casino-tournament-prizes.js +13 -10
  18. package/dist/esm/index-7e63d638.js +1207 -0
  19. package/dist/esm/loader.js +6 -12
  20. package/dist/stencil.config.dev.js +17 -0
  21. package/dist/stencil.config.js +14 -19
  22. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-tournament-prizes/.stencil/packages/stencil/casino-tournament-prizes/stencil.config.d.ts +2 -0
  23. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-tournament-prizes/.stencil/packages/stencil/casino-tournament-prizes/stencil.config.dev.d.ts +2 -0
  24. package/dist/types/components/casino-tournament-prizes/casino-tournament-prizes.d.ts +22 -22
  25. package/dist/types/components/casino-tournament-prizes/index.d.ts +1 -0
  26. package/dist/types/stencil-public-runtime.d.ts +142 -33
  27. package/loader/cdn.js +1 -3
  28. package/loader/index.cjs.js +1 -3
  29. package/loader/index.d.ts +13 -1
  30. package/loader/index.es2017.js +1 -3
  31. package/loader/index.js +1 -3
  32. package/loader/package.json +1 -0
  33. package/package.json +8 -1
  34. package/dist/casino-tournament-prizes/p-0c9dcd23.entry.js +0 -1
  35. package/dist/casino-tournament-prizes/p-44cdb103.js +0 -1
  36. package/dist/cjs/index-edbd2afe.js +0 -1195
  37. package/dist/components/casino-tournament-prizes.d.ts +0 -11
  38. package/dist/components/casino-tournament-prizes.js +0 -205
  39. package/dist/components/index.d.ts +0 -26
  40. package/dist/components/index.js +0 -1
  41. package/dist/esm/index-fd6b56d4.js +0 -1169
  42. package/dist/esm/polyfills/core-js.js +0 -11
  43. package/dist/esm/polyfills/css-shim.js +0 -1
  44. package/dist/esm/polyfills/dom.js +0 -79
  45. package/dist/esm/polyfills/es5-html-element.js +0 -1
  46. package/dist/esm/polyfills/index.js +0 -34
  47. package/dist/esm/polyfills/system.js +0 -6
  48. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-tournament-prizes/.stencil/packages/casino-tournament-prizes/stencil.config.d.ts +0 -2
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../types/components";
2
-
3
- interface CasinoTournamentPrizes extends Components.CasinoTournamentPrizes, HTMLElement {}
4
- export const CasinoTournamentPrizes: {
5
- prototype: CasinoTournamentPrizes;
6
- new (): CasinoTournamentPrizes;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;
@@ -1,205 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
-
3
- const DEFAULT_LANGUAGE = 'en';
4
- const TRANSLATIONS = {
5
- en: {
6
- prizes: 'Prizes',
7
- noprizes: 'No available prizes',
8
- place: 'place',
9
- },
10
- 'zh-hk': {
11
- prizes: '獎品',
12
- noprizes: '沒有可用的獎品',
13
- place: 'place', // need translation
14
- },
15
- fr: {
16
- prizes: 'Prix',
17
- noprizes: 'Aucun prix disponible',
18
- place: 'place', // need translation
19
- },
20
- ro: {
21
- prizes: 'Premii',
22
- noprizes: 'Nu sunt disponibile premii',
23
- place: 'poziție',
24
- },
25
- tr: {
26
- prizes: 'Ödüller',
27
- noprizes: 'Geçerli ödül yok',
28
- place: 'Sıra',
29
- },
30
- el: {
31
- prizes: 'Έπαθλα',
32
- noprizes: 'Μη διαθέσιμα έπαθλα',
33
- place: 'θέση',
34
- },
35
- es: {
36
- prizes: 'Premios',
37
- noprizes: 'No hay premios disponibles',
38
- place: 'posición',
39
- },
40
- hu: {
41
- prizes: 'Nyeremények',
42
- noprizes: 'Nincs elérhető nyeremény',
43
- place: 'helyezés',
44
- },
45
- pt: {
46
- prizes: 'Prêmios',
47
- noprizes: 'Não há prêmios disponíveis',
48
- place: 'place', // need translation
49
- },
50
- hr: {
51
- prizes: 'Nagrade',
52
- noprizes: 'Nema dostupnih nagrada',
53
- place: 'mjesto',
54
- }
55
- };
56
- const translate = (key, customLang) => {
57
- var _a, _b;
58
- const lang = customLang;
59
- return ((_a = TRANSLATIONS[lang]) === null || _a === void 0 ? void 0 : _a[key]) || ((_b = TRANSLATIONS[DEFAULT_LANGUAGE]) === null || _b === void 0 ? void 0 : _b[key]);
60
- };
61
-
62
- const casinoTournamentPrizesCss = ":host{display:block}.PrizeGroups{color:var(--emfe-w-color-white, #FFFFFF);display:flex;gap:20px;font-size:14px}.PrizeGroup{flex:1;background:var(--emfe-w-tournament-color-bg, #153a5c)}.PrizeTitle{text-align:center;width:100%}.GroupPrizeTitle{width:100%;display:flex;padding:8px 6px;gap:8px;justify-content:center}.PrizeView{display:flex;gap:10px;font-size:12px}.PrizeView .PrizeTitle{display:inline-block;width:auto}.PrizeView .PrizeGroups{display:inline-flex}.Title{text-align:center;color:var(--emfe-w-color-white, #FFFFFF)}.PrizeIcon path{fill:var(--emfe-w-color-white, #FFFFFF)}.PrizeRow{padding:8px;border-bottom:1px solid rgba(206, 210, 214, 0.15)}.PrizeItem{display:flex;justify-content:space-between;padding:6px;font-size:12px;border-radius:2px}.Group1 .Rank1{background:#7e6c22}.Group1 .Rank2{background:#666}.Group1 .Rank3{background:#6a5446}.Prizes{padding-left:20px;flex-wrap:wrap;display:flex;gap:20px;width:100%;min-height:50px;padding-top:8px}.Prize{flex-grow:1;color:var(--emfe-w-color-gray-300, #58586B)}.Prize.Prize0 span{color:#FECF00}.Prize.Prize1 span{color:#D9B206}.Prize.Prize2 span{color:#9B8007}.Prize p{color:var(--emfe-w-color-white, #FFFFFF)}";
63
-
64
- const CasinoTournamentPrizes$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
65
- constructor() {
66
- super();
67
- this.__registerHost();
68
- this.__attachShadow();
69
- this.useGroup = false;
70
- this.useEvent = false;
71
- this.clientStyling = '';
72
- this.clientStylingUrl = '';
73
- this.limitStylingAppends = false;
74
- this.prizes = [];
75
- this.prizeGroups = [];
76
- this.initialLoad = false;
77
- }
78
- infoCompletedHandler(event) {
79
- if (event.detail) {
80
- this.prizes = event.detail.prizes;
81
- this.formatGroup();
82
- this.initialLoad = true;
83
- }
84
- }
85
- formatGroup() {
86
- const prizes = this.prizes;
87
- prizes.forEach((prize) => {
88
- let array = [];
89
- if (prize.count > 0) {
90
- for (let index = 0; index < prize.count; index++) {
91
- const element = { name: prize.name, rank: prize.rank + index };
92
- array.push(element);
93
- }
94
- }
95
- this.prizeGroups.push(array);
96
- });
97
- }
98
- getTournamentInfo() {
99
- let url = new URL(this.endpoint + `/v1/tournaments/${this.tournamentId}`);
100
- let reqHeaders = new Headers();
101
- url.searchParams.append('expand', 'games');
102
- url.searchParams.append('language', this.language);
103
- url.searchParams.append('fields', 'playerEnrolled,games(id,name,thumbnail)');
104
- if (this.session) {
105
- reqHeaders.append('X-SessionId', this.session);
106
- }
107
- let requestOptions = {
108
- method: 'GET',
109
- headers: reqHeaders,
110
- };
111
- fetch(url.href, requestOptions).then((res) => res.json())
112
- .then((res) => {
113
- this.prizes = res.item.prizes;
114
- if (this.useGroup) {
115
- this.formatGroup();
116
- }
117
- this.initialLoad = true;
118
- });
119
- }
120
- componentWillLoad() {
121
- if (!this.useEvent && this.rawPrizes) {
122
- this.prizes = JSON.parse(this.rawPrizes);
123
- if (this.useGroup) {
124
- this.formatGroup();
125
- }
126
- this.initialLoad = true;
127
- }
128
- if (!this.useEvent && this.endpoint && this.tournamentId) {
129
- this.getTournamentInfo();
130
- }
131
- }
132
- componentDidRender() {
133
- if (!this.limitStylingAppends && this.host) {
134
- if (this.clientStyling)
135
- this.setClientStyling();
136
- if (this.clientStylingUrl)
137
- this.setClientStylingURL();
138
- this.limitStylingAppends = true;
139
- }
140
- }
141
- setClientStyling() {
142
- const sheet = new CSSStyleSheet();
143
- // @ts-ignore
144
- sheet.replace(this.clientStyling);
145
- // @ts-ignore
146
- this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
147
- }
148
- setClientStylingURL() {
149
- let url = new URL(this.clientStylingUrl);
150
- fetch(url.href)
151
- .then((res) => res.text())
152
- .then((data) => {
153
- const sheet = new CSSStyleSheet();
154
- // @ts-ignore
155
- sheet.replace(data);
156
- // @ts-ignore
157
- this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
158
- });
159
- }
160
- render() {
161
- {
162
- return h("div", { class: `TournamentPrizes ${this.useGroup ? '' : 'PrizeView'}` }, this.initialLoad && !this.useGroup && h("div", { class: "PrizeTitle" }, h("svg", { class: "PrizeIcon", xmlns: "http://www.w3.org/2000/svg", width: "30", height: "27.454", viewBox: "0 0 30 27.454" }, h("path", { d: "M35.84,12.887a1.023,1.023,0,0,0-.853-.481h-5.2l.242-1.456a1.023,1.023,0,0,0-1.023-1.19H12.977a1.023,1.023,0,0,0-1.023,1.19l.242,1.456H7.022a1.023,1.023,0,0,0-.921,1.47l2.967,6.077a6.48,6.48,0,0,0,5.163,3.581,7.227,7.227,0,0,0,3.7,3.963v2.667h-.426a3.525,3.525,0,1,0,0,7.049H24.5a3.525,3.525,0,1,0,0-7.049h-.426V27.5a7.227,7.227,0,0,0,3.7-3.963,6.48,6.48,0,0,0,5.167-3.581L35.9,13.876a1.023,1.023,0,0,0-.058-.989ZM10.914,19.05l-2.241-4.6h3.891l1.153,6.916A4.406,4.406,0,0,1,10.914,19.05ZM25.977,33.687A1.477,1.477,0,0,1,24.5,35.164H17.509a1.478,1.478,0,0,1,0-2.957H24.5A1.48,1.48,0,0,1,25.977,33.687Zm-3.949-3.526H19.982V28.094a6.729,6.729,0,0,0,2.046,0Zm4.123-8.383a5.218,5.218,0,0,1-10.293,0L14.184,11.8H27.826ZM31.1,19.05a4.406,4.406,0,0,1-2.8,2.309l1.153-6.916h3.891Z", transform: "translate(-5.999 -9.76)" })), h("div", { class: "Title" }, translate('prizes', this.language))), this.initialLoad && this.useGroup && h("div", { class: "GroupPrizeTitle" }, h("svg", { class: "PrizeIcon", xmlns: "http://www.w3.org/2000/svg", width: "19", height: "16", viewBox: "0 0 19 16", fill: "none" }, h("g", { "clip-path": "url(#clip0_2459_42455)" }, h("path", { d: "M14.7476 2.84132V0.664551H4.03327V2.84132H0.818359V5.01946C0.818359 6.8229 2.2568 8.28496 4.0326 8.28496C4.36862 8.28496 4.69326 8.23192 4.99647 8.13399C5.76958 9.25604 6.94898 10.07 8.31782 10.3516V13.7266H7.24685C6.06276 13.7266 5.1029 14.701 5.1029 15.9026H13.6753C13.6753 14.7004 12.7168 13.7266 11.5327 13.7266H10.4611V10.3516C11.8293 10.07 13.0087 9.25672 13.7818 8.13399C14.0863 8.23124 14.4116 8.28496 14.7463 8.28496C16.5214 8.28496 17.9612 6.8229 17.9612 5.01946V2.84132H14.7476ZM4.03327 6.99222C2.9623 6.99222 2.0908 6.10751 2.0908 5.01946V3.93005H4.03327V5.01946C4.03327 5.70221 4.15844 6.3564 4.38401 6.9589C4.27089 6.9793 4.15175 6.99086 4.03327 6.99086V6.99222ZM11.0207 5.88989L12.0414 9.06223L9.38945 7.09355L6.7368 9.06223L7.75757 5.88989L5.09688 3.93481L8.3814 3.94229L9.38945 0.767235L10.3968 3.94229L13.6814 3.93481L11.0207 5.88989ZM16.6901 5.01946C16.6901 6.10683 15.8193 6.99222 14.7483 6.99222C14.6285 6.99222 14.512 6.9793 14.3982 6.95958C14.6245 6.3564 14.7483 5.70357 14.7483 5.02014V3.93073H16.6901V5.02014V5.01946Z", fill: "white" })), h("defs", null, h("clipPath", { id: "clip0_2459_42455" }, h("rect", { width: "18.2857", height: "16", fill: "white", transform: "translate(0.5)" })))), h("div", { class: "Title" }, translate('prizes', this.language))), h("div", { class: "PrizeGroups" }, this.useGroup == true && this.prizeGroups && this.prizeGroups.map((group, groupIndex) => {
163
- return h("div", { class: `PrizeGroup Group${groupIndex + 1}` }, group && group.map((prize, prizeIndex) => {
164
- return h("div", { class: "PrizeRow" }, h("div", { class: `PrizeItem Rank${prizeIndex + 1}` }, h("span", { class: "PrizeRank" }, prize.rank, " ", translate('place', this.language), " "), h("span", { class: "PrizeName" }, prize.name)));
165
- }));
166
- }), this.useGroup == false && this.prizes && this.prizes.map((prize, prizeIndex) => {
167
- return h("div", { class: `Prize Prize${prizeIndex}` }, h("p", { class: "PrizeText" }, h("span", { class: "PrizeRank" }, prize.count > 1 ? (`${prize.rank}~${prize.rank + prize.count - 1}`) : (prize.rank)), " ", translate('place', this.language), ": ", prize.name));
168
- }), !this.prizes && h("p", null, translate('noprizes', this.language))));
169
- }
170
- }
171
- get host() { return this; }
172
- static get style() { return casinoTournamentPrizesCss; }
173
- }, [1, "casino-tournament-prizes", {
174
- "language": [1],
175
- "useGroup": [4, "use-group"],
176
- "useEvent": [4, "use-event"],
177
- "endpoint": [1],
178
- "session": [1],
179
- "rawPrizes": [1, "raw-prizes"],
180
- "tournamentId": [1, "tournament-id"],
181
- "clientStyling": [1, "client-styling"],
182
- "clientStylingUrl": [1, "client-styling-url"],
183
- "limitStylingAppends": [32],
184
- "prizes": [32],
185
- "prizeGroups": [32],
186
- "initialLoad": [32]
187
- }, [[10, "getTournamentInfoCompleted", "infoCompletedHandler"]]]);
188
- function defineCustomElement$1() {
189
- if (typeof customElements === "undefined") {
190
- return;
191
- }
192
- const components = ["casino-tournament-prizes"];
193
- components.forEach(tagName => { switch (tagName) {
194
- case "casino-tournament-prizes":
195
- if (!customElements.get(tagName)) {
196
- customElements.define(tagName, CasinoTournamentPrizes$1);
197
- }
198
- break;
199
- } });
200
- }
201
-
202
- const CasinoTournamentPrizes = CasinoTournamentPrizes$1;
203
- const defineCustomElement = defineCustomElement$1;
204
-
205
- export { CasinoTournamentPrizes, defineCustomElement };
@@ -1,26 +0,0 @@
1
- /* CasinoTournamentPrizes custom elements */
2
-
3
- import type { Components, JSX } from "../types/components";
4
-
5
- /**
6
- * Used to manually set the base path where assets can be found.
7
- * If the script is used as "module", it's recommended to use "import.meta.url",
8
- * such as "setAssetPath(import.meta.url)". Other options include
9
- * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
10
- * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
11
- * But do note that this configuration depends on how your script is bundled, or lack of
12
- * bundling, and where your assets can be loaded from. Additionally custom bundling
13
- * will have to ensure the static assets are copied to its build directory.
14
- */
15
- export declare const setAssetPath: (path: string) => void;
16
-
17
- export interface SetPlatformOptions {
18
- raf?: (c: FrameRequestCallback) => number;
19
- ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
20
- rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
21
- }
22
- export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
23
-
24
- export type { Components, JSX };
25
-
26
- export * from '../types';
@@ -1 +0,0 @@
1
- export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';