@everymatrix/mini-games-lobby 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.
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/index-85e4b23a.js +1211 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/mini-games-lobby.cjs.entry.js +118 -0
- package/dist/cjs/mini-games-lobby.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/mini-games-lobby/index.js +1 -0
- package/dist/collection/components/mini-games-lobby/mini-games-lobby.css +94 -0
- package/dist/collection/components/mini-games-lobby/mini-games-lobby.js +202 -0
- package/dist/collection/decorators/base.decorator.js +12 -0
- package/dist/collection/decorators/locale.decorator.js +40 -0
- package/dist/collection/decorators/style.decorator.js +28 -0
- package/dist/collection/decorators/style.util.js +36 -0
- package/dist/collection/images/CrossIcon.svg +9 -0
- package/dist/collection/images/FullScreenIcon.svg +10 -0
- package/dist/collection/images/HeaderIcon.svg +6 -0
- package/dist/collection/images/LaunchHeaderIcon.svg +13 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/renders/GameLauncher.js +8 -0
- package/dist/collection/renders/Games.js +9 -0
- package/dist/collection/renders/index.js +2 -0
- package/dist/collection/utils/fetch.js +28 -0
- package/dist/collection/utils/translation.js +11 -0
- 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/index.js +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/mini-games-lobby.entry.js +114 -0
- package/dist/esm/mini-games-lobby.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/mini-games-lobby/index.esm.js +0 -0
- package/dist/mini-games-lobby/mini-games-lobby.esm.js +1 -0
- 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 +17 -0
- package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/mini-games-lobby/.stencil/packages/stencil/mini-games-lobby/stencil.config.d.ts +2 -0
- package/dist/types/Users/raul.vasile/workspace/everymatrix/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 +50 -0
- package/dist/types/components.d.ts +93 -0
- package/dist/types/decorators/base.decorator.d.ts +2 -0
- package/dist/types/decorators/locale.decorator.d.ts +2 -0
- package/dist/types/decorators/style.decorator.d.ts +2 -0
- package/dist/types/decorators/style.util.d.ts +3 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/renders/GameLauncher.d.ts +4 -0
- package/dist/types/renders/Games.d.ts +5 -0
- package/dist/types/renders/index.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/fetch.d.ts +4 -0
- package/dist/types/utils/translation.d.ts +12 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +26 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Fragment, h } from "@stencil/core";
|
|
2
|
+
import CrossIcon from "../images/CrossIcon.svg";
|
|
3
|
+
import FullScreenIcon from "../images/FullScreenIcon.svg";
|
|
4
|
+
import LaunchHeaderIcon from "../images/LaunchHeaderIcon.svg";
|
|
5
|
+
const renderTopbar = () => (h("div", { id: "GameLaunchHeader" }, h("img", { src: LaunchHeaderIcon }), h("button", { type: "button", class: "GameIcon GameIcon--full-screen" }, h("img", { src: FullScreenIcon })), h("button", { type: "button", class: "GameIcon GameIcon--close" }, h("img", { src: CrossIcon }))));
|
|
6
|
+
export const GameLauncher = ({ src, host }) => {
|
|
7
|
+
return src && (h(Fragment, null, renderTopbar(), h("iframe", { src: src, width: '100%', height: host.clientWidth / 16 * 9, frameborder: "0" })));
|
|
8
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import HeaderIcon from "../images/HeaderIcon.svg";
|
|
3
|
+
const getProps = (game, onClickGame) => ({
|
|
4
|
+
style: {
|
|
5
|
+
"background-image": `url(${game.icons['88']})`
|
|
6
|
+
},
|
|
7
|
+
onClick: () => onClickGame(game.launchUrl),
|
|
8
|
+
});
|
|
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))))))));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const fetcher = async (url) => {
|
|
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
|
+
};
|
|
12
|
+
export const getUrl = (path, params = {}) => {
|
|
13
|
+
return path + '?' + Object.keys(params).map(key => `${key}=${params[key]}`).join('&');
|
|
14
|
+
};
|
|
15
|
+
export async function fetchGames() {
|
|
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
|
+
}
|
|
23
|
+
export const fetchLaunchUrl = async (link, params) => {
|
|
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
|
+
};
|