@everymatrix/mini-games-lobby 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.
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/index-85e4b23a.js +1211 -0
- package/dist/cjs/loader.cjs.js +7 -13
- package/dist/cjs/mini-games-lobby.cjs.entry.js +79 -259
- package/dist/cjs/mini-games-lobby.cjs.js +17 -11
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/mini-games-lobby/index.js +1 -0
- package/dist/collection/components/mini-games-lobby/mini-games-lobby.js +193 -212
- package/dist/collection/decorators/base.decorator.js +9 -9
- package/dist/collection/decorators/locale.decorator.js +27 -27
- package/dist/collection/decorators/style.decorator.js +21 -21
- package/dist/collection/decorators/style.util.js +26 -26
- package/dist/collection/renders/GameLauncher.js +5 -12
- package/dist/collection/renders/Games.js +6 -12
- package/dist/collection/utils/fetch.js +20 -20
- package/dist/collection/utils/translation.js +9 -9
- package/dist/collection/utils/utils.js +3 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-394aa256.js +1183 -0
- package/dist/esm/loader.js +7 -13
- package/dist/esm/mini-games-lobby.entry.js +79 -259
- package/dist/esm/mini-games-lobby.js +14 -11
- package/dist/mini-games-lobby/mini-games-lobby.esm.js +1 -1
- package/dist/mini-games-lobby/p-77bf5852.js +2 -0
- package/dist/mini-games-lobby/p-e1255160.js +1 -0
- package/dist/mini-games-lobby/p-e9908e53.entry.js +1 -0
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +14 -19
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/mini-games-lobby/.stencil/packages/stencil/mini-games-lobby/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/mini-games-lobby/.stencil/packages/stencil/mini-games-lobby/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/mini-games-lobby/index.d.ts +1 -0
- package/dist/types/components/mini-games-lobby/mini-games-lobby.d.ts +47 -47
- package/dist/types/renders/GameLauncher.d.ts +2 -2
- package/dist/types/renders/Games.d.ts +3 -3
- package/dist/types/stencil-public-runtime.d.ts +142 -33
- package/dist/types/utils/translation.d.ts +10 -10
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +13 -1
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/loader/package.json +1 -0
- package/package.json +8 -5
- package/dist/cjs/index-90b83e7e.js +0 -1298
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/components/mini-games-lobby.d.ts +0 -11
- package/dist/components/mini-games-lobby.js +0 -323
- package/dist/esm/index-ced8f413.js +0 -1271
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/mini-games-lobby/p-49a0f62e.entry.js +0 -1
- package/dist/mini-games-lobby/p-e3451601.js +0 -1
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/mini-games-lobby/.stencil/packages/mini-games-lobby/stencil.config.d.ts +0 -2
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
import HeaderIcon from
|
|
2
|
+
import HeaderIcon from "../images/HeaderIcon.svg";
|
|
3
3
|
const getProps = (game, onClickGame) => ({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
style: {
|
|
5
|
+
"background-image": `url(${game.icons['88']})`
|
|
6
|
+
},
|
|
7
|
+
onClick: () => onClickGame(game.launchUrl),
|
|
8
8
|
});
|
|
9
|
-
export const Games = ({ text, games, onClickGame }) => (h("div", { class: "GamesContainer" },
|
|
10
|
-
h("div", { id: "GamesHeader" },
|
|
11
|
-
h("div", null,
|
|
12
|
-
h("img", { src: HeaderIcon }),
|
|
13
|
-
h("p", { innerHTML: text }))),
|
|
14
|
-
h("div", { id: "Games" }, games.map((game) => h("div", { class: "Game" },
|
|
15
|
-
h("div", Object.assign({ class: "GameImg" }, getProps(game, onClickGame))))))));
|
|
9
|
+
export const Games = ({ text, games, onClickGame }) => (h("div", { class: "GamesContainer" }, h("div", { id: "GamesHeader" }, h("div", null, h("img", { src: HeaderIcon }), h("p", { innerHTML: text }))), h("div", { id: "Games" }, games.map((game) => h("div", { class: "Game" }, h("div", Object.assign({ class: "GameImg" }, getProps(game, onClickGame))))))));
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
export const fetcher = async (url) => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
let res;
|
|
3
|
+
try {
|
|
4
|
+
res = await fetch(url);
|
|
5
|
+
res = await res.json();
|
|
6
|
+
}
|
|
7
|
+
catch (e) {
|
|
8
|
+
console.error(e);
|
|
9
|
+
}
|
|
10
|
+
return res;
|
|
11
11
|
};
|
|
12
12
|
export const getUrl = (path, params = {}) => {
|
|
13
|
-
|
|
13
|
+
return path + '?' + Object.keys(params).map(key => `${key}=${params[key]}`).join('&');
|
|
14
14
|
};
|
|
15
15
|
export async function fetchGames() {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
const url = getUrl(`${this.endpoint}/v1/casino/games`, {
|
|
17
|
+
language: this.language,
|
|
18
|
+
filter: this.filter || `categories(id=MINIGAMES),vendor(name=PragmaticPlay)`,
|
|
19
|
+
});
|
|
20
|
+
const res = await fetcher(url);
|
|
21
|
+
return res.items;
|
|
22
22
|
}
|
|
23
23
|
export const fetchLaunchUrl = async (link, params) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const linkProcessed = getUrl(link.replace('Start', 'StartInfo'), params);
|
|
25
|
+
const res = await fetcher(linkProcessed);
|
|
26
|
+
const { LaunchParams } = res;
|
|
27
|
+
return LaunchParams === null || LaunchParams === void 0 ? void 0 : LaunchParams.launchUrl;
|
|
28
28
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export const translation = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
en: {
|
|
3
|
+
MiniGames: 'Mini Games',
|
|
4
|
+
},
|
|
5
|
+
'zh-hk': {
|
|
6
|
+
MiniGames: '小游戲',
|
|
7
|
+
},
|
|
8
|
+
hr: {
|
|
9
|
+
MiniGames: 'Mini igre'
|
|
10
|
+
}
|
|
11
11
|
};
|