@everymatrix/casino-engagement-suite-modal-container 1.36.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/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.esm.js +1 -0
- package/dist/casino-engagement-suite-modal-container/index.esm.js +0 -0
- package/dist/casino-engagement-suite-modal-container/p-0f126ad9.entry.js +1 -0
- package/dist/casino-engagement-suite-modal-container/p-8aa9bb7a.entry.js +1 -0
- package/dist/casino-engagement-suite-modal-container/p-b944b831.js +1 -0
- package/dist/cjs/casino-engagement-suite-modal-container.cjs.entry.js +127 -0
- package/dist/cjs/casino-engagement-suite-modal-container.cjs.js +19 -0
- package/dist/cjs/casino-engagement-suite-modal.cjs.entry.js +68 -0
- package/dist/cjs/index-2394967b.js +1253 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/collection/collection-manifest.json +19 -0
- package/dist/collection/components/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.css +71 -0
- package/dist/collection/components/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.js +223 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/models/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +26 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/components/casino-engagement-suite-modal-container.d.ts +11 -0
- package/dist/components/casino-engagement-suite-modal-container.js +156 -0
- package/dist/components/casino-engagement-suite-modal.js +6 -0
- package/dist/components/casino-engagement-suite-modal2.js +89 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +1 -0
- package/dist/esm/casino-engagement-suite-modal-container.entry.js +123 -0
- package/dist/esm/casino-engagement-suite-modal-container.js +17 -0
- package/dist/esm/casino-engagement-suite-modal.entry.js +64 -0
- package/dist/esm/index-89c6c4a4.js +1226 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.js +22 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-engagement-suite-modal-container/.stencil/packages/casino-engagement-suite-modal-container/stencil.config.d.ts +2 -0
- package/dist/types/components/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.d.ts +35 -0
- package/dist/types/components.d.ts +64 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/index.d.ts +5 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/utils/locale.utils.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +19 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* CasinoEngagementSuiteModalContainer 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';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-89c6c4a4.js';
|
|
2
|
+
|
|
3
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
4
|
+
const SUPPORTED_LANGUAGES = ['en'];
|
|
5
|
+
const TRANSLATIONS = {
|
|
6
|
+
en: {
|
|
7
|
+
joinHeader: 'Choose another challenge?',
|
|
8
|
+
desc: 'Any progress on the current challenge will be kept and you can rejoin the challenge at any time.',
|
|
9
|
+
joinQuestion: 'Would you still like to join another challenge?',
|
|
10
|
+
joinConfirm: 'Yes, join another challenge',
|
|
11
|
+
joinReject: 'No, stay at the current challenge',
|
|
12
|
+
unJoinHeader: 'Quit Challenge?',
|
|
13
|
+
unJoinQuestion: 'Would you still like to quit the challenge?',
|
|
14
|
+
unJoinConfirm: 'Yes, I want to quit challenge',
|
|
15
|
+
unJoinReject: 'No, stay at challenge',
|
|
16
|
+
join: 'Unjoin',
|
|
17
|
+
unJoin: 'Unjoin',
|
|
18
|
+
continue: 'Continue',
|
|
19
|
+
won: 'You won',
|
|
20
|
+
noChallenges: 'No Challenges yet',
|
|
21
|
+
tryOtherGames: 'Try winning Challenges as rewards or launching other booster games',
|
|
22
|
+
tooltip: 'Competition where your real money bets contribute towards the level progress to achieve the level reward'
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const translate = (key, customLang) => {
|
|
26
|
+
const lang = customLang;
|
|
27
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const casinoEngagementSuiteModalContainerCss = ":host{display:block}.ModalFooterButton,.ModalFooterButtonOutlined{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:140px;height:36px;font-size:14px;font-weight:var(--emw--font-weight-bold, 700);position:relative;font-family:\"Montserrat\", sans-serif;padding:0 16px;box-sizing:border-box;margin:auto;border:none;cursor:pointer}.ModalFooterButtonOutlined{background:linear-gradient(var(--emw--color-background, #1E1638) 0 0) padding-box, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%) border-box;border:2px solid transparent}.GradientText{background-image:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:transparent;background-clip:text}.ManyActions{display:flex;width:100%;flex-direction:column;align-items:stretch}.ManyActions .ModalFooterButton,.ManyActions .ModalFooterButtonOutlined{width:280px}.ManyActions button:first-child{margin-bottom:16px}.ModalReward{font-weight:var(--emw--font-weight-semibold, 600);color:var(--emw--color-typography, #FFFFFF)}.ModalContainer.Mobile .ModalFooterButton{min-width:140px;height:32px}.ModalContainer.Mobile .ManyActions .ModalFooterButton,.ModalContainer.Mobile .ManyActions .ModalFooterButtonOutlined{width:100%;height:32px}.ModalContainer.Mobile .ManyActions button:first-child{margin-bottom:8px}.LeftAlign{text-align:left;line-height:1.2}";
|
|
31
|
+
|
|
32
|
+
const CasinoEngagementSuiteModalContainer = class {
|
|
33
|
+
constructor(hostRef) {
|
|
34
|
+
registerInstance(this, hostRef);
|
|
35
|
+
this.closeModal = createEvent(this, "closeModal", 7);
|
|
36
|
+
/**
|
|
37
|
+
* Client custom styling via string
|
|
38
|
+
*/
|
|
39
|
+
this.clientStyling = '';
|
|
40
|
+
/**
|
|
41
|
+
* Client custom styling via url
|
|
42
|
+
*/
|
|
43
|
+
this.clientStylingUrl = '';
|
|
44
|
+
/**
|
|
45
|
+
* Language of the widget
|
|
46
|
+
*/
|
|
47
|
+
this.language = 'en';
|
|
48
|
+
this.device = 'Mobile';
|
|
49
|
+
this.limitStylingAppends = false;
|
|
50
|
+
this.openModals = [];
|
|
51
|
+
this.rewards = [];
|
|
52
|
+
this.confirmationData = null;
|
|
53
|
+
this.handleCloseClick = (e) => {
|
|
54
|
+
const type = +e.currentTarget.getAttribute('data-type');
|
|
55
|
+
this.closeModal.emit(type);
|
|
56
|
+
};
|
|
57
|
+
this.handleChallengeAttendance = () => {
|
|
58
|
+
window.postMessage({
|
|
59
|
+
type: 'ChallengeAttendance',
|
|
60
|
+
confirmationData: this.confirmationData,
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
this.setClientStyling = () => {
|
|
64
|
+
let sheet = document.createElement('style');
|
|
65
|
+
sheet.innerHTML = this.clientStyling;
|
|
66
|
+
this.host.prepend(sheet);
|
|
67
|
+
};
|
|
68
|
+
this.setClientStylingURL = () => {
|
|
69
|
+
let url = new URL(this.clientStylingUrl);
|
|
70
|
+
let cssFile = document.createElement('style');
|
|
71
|
+
fetch(url.href)
|
|
72
|
+
.then((res) => res.text())
|
|
73
|
+
.then((data) => {
|
|
74
|
+
cssFile.innerHTML = data;
|
|
75
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
76
|
+
})
|
|
77
|
+
.catch((err) => {
|
|
78
|
+
console.log('Error ', err);
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
this.isModalOpen = (type) => {
|
|
82
|
+
return Boolean(this.openModals.find(el => el === type));
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
openModalHandler(event) {
|
|
86
|
+
const { modalType, rewards, confirmationData } = event.detail;
|
|
87
|
+
this.openModals = [...this.openModals, modalType];
|
|
88
|
+
if (rewards === null || rewards === void 0 ? void 0 : rewards.length) {
|
|
89
|
+
this.rewards = [...rewards];
|
|
90
|
+
}
|
|
91
|
+
if (confirmationData) {
|
|
92
|
+
this.confirmationData = confirmationData;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
closeModalHandler(event) {
|
|
96
|
+
this.openModals = this.openModals.filter(el => el !== event.detail);
|
|
97
|
+
}
|
|
98
|
+
componentDidRender() {
|
|
99
|
+
if (!this.limitStylingAppends && this.host) {
|
|
100
|
+
if (this.clientStyling)
|
|
101
|
+
this.setClientStyling();
|
|
102
|
+
if (this.clientStylingUrl)
|
|
103
|
+
this.setClientStylingURL();
|
|
104
|
+
this.limitStylingAppends = true;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
render() {
|
|
108
|
+
const { prevId } = this.confirmationData || {};
|
|
109
|
+
return (h("div", { class: `ModalContainer ${this.device}` }, h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("REWARD_MODAL"), header: "Congratulations!", icon: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", contentIcon: "https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg", modalType: "REWARD_MODAL", device: this.device }, h("div", { slot: "body" }, h("p", null, translate('won', this.language), " ", h("span", { class: 'ModalReward' }, this.rewards))), h("div", { slot: "footer" }, h("button", { class: 'ModalFooterButton', onClick: this.handleCloseClick, "data-type": 'REWARD_MODAL' }, translate('continue', this.language)))), h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("TARGET_MODAL"), header: prevId ?
|
|
110
|
+
translate('joinHeader', this.language) :
|
|
111
|
+
translate('unJoinHeader', this.language), icon: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", modalType: "TARGET_MODAL", device: this.device }, h("div", { slot: "body" }, h("p", { class: 'LeftAlign' }, translate('desc', this.language)), h("p", { class: 'LeftAlign' }, prevId ?
|
|
112
|
+
translate('joinQuestion', this.language) :
|
|
113
|
+
translate('unJoinQuestion', this.language))), h("div", { slot: "footer", class: 'ManyActions' }, h("button", { class: 'ModalFooterButton', onClick: this.handleChallengeAttendance }, prevId ?
|
|
114
|
+
translate('joinConfirm', this.language) :
|
|
115
|
+
translate('unJoinConfirm', this.language)), h("button", { class: 'ModalFooterButtonOutlined', onClick: this.handleCloseClick, "data-type": 'TARGET_MODAL' }, h("div", { class: 'GradientText' }, prevId ?
|
|
116
|
+
translate('joinReject', this.language) :
|
|
117
|
+
translate('unJoinReject', this.language)))))));
|
|
118
|
+
}
|
|
119
|
+
get host() { return getElement(this); }
|
|
120
|
+
};
|
|
121
|
+
CasinoEngagementSuiteModalContainer.style = casinoEngagementSuiteModalContainerCss;
|
|
122
|
+
|
|
123
|
+
export { CasinoEngagementSuiteModalContainer as casino_engagement_suite_modal_container };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-89c6c4a4.js';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
5
|
+
*/
|
|
6
|
+
const patchBrowser = () => {
|
|
7
|
+
const importMeta = import.meta.url;
|
|
8
|
+
const opts = {};
|
|
9
|
+
if (importMeta !== '') {
|
|
10
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
11
|
+
}
|
|
12
|
+
return promiseResolve(opts);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
patchBrowser().then(options => {
|
|
16
|
+
return bootstrapLazy([["casino-engagement-suite-modal",[[1,"casino-engagement-suite-modal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"isOpen":[4,"is-open"],"header":[1],"icon":[1],"contentIcon":[1,"content-icon"],"modalType":[1,"modal-type"],"device":[1],"limitStylingAppends":[32]}]]],["casino-engagement-suite-modal-container",[[1,"casino-engagement-suite-modal-container",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"device":[1],"limitStylingAppends":[32],"openModals":[32],"rewards":[32],"confirmationData":[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]]]]], options);
|
|
17
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-89c6c4a4.js';
|
|
2
|
+
|
|
3
|
+
const MODAL_TYPES = {
|
|
4
|
+
REWARD_MODAL: 'REWARD_MODAL',
|
|
5
|
+
TARGET_MODAL: 'TARGET_MODAL'
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const casinoEngagementSuiteModalCss = ":host{display:block}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);justify-content:center;align-items:center}.ModalOverlay.Open{display:flex}.IconCloseContainer{width:100%;display:flex;justify-content:end}.ModalContent{display:flex;flex-direction:column;align-items:center;font-family:\"Montserrat\", sans-serif;position:relative;color:var(--emw--color-typography, #FFFFFF);background-color:var(--emw--color-background, #1E1638);padding:12px;border-radius:8px;width:450px;max-width:100%;text-align:center}.GradientBorder::before{content:\"\";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:9px;background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #FF9401 82.77%);z-index:-1}.ModalHeader{font-weight:var(--emw--font-weight-semibold, 600);font-size:20px;margin-top:12px;padding:0 16px}.ModalIcon{width:44px;height:44px;border-radius:50%;background-size:cover;background-position:center;background-image:url(\"https://static.everymatrix.com/gic/img/engagement-suite/bar/leaderboard.svg\");margin-top:12px}.ModalBody{margin-top:20px;font-size:16px;font-family:\"Inter\", sans-serif;font-weight:var(--emw--font-weight-normal, 400);color:var(--emw--color-gray-100, #BBB9C3);padding:0 16px}.ModalFooter{margin-top:40px;margin-bottom:28px;padding:0 16px;width:100%}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}";
|
|
9
|
+
|
|
10
|
+
const CasinoEngagementSuiteModal = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
registerInstance(this, hostRef);
|
|
13
|
+
this.closeModal = createEvent(this, "closeModal", 7);
|
|
14
|
+
/**
|
|
15
|
+
* Client custom styling via string
|
|
16
|
+
*/
|
|
17
|
+
this.clientStyling = '';
|
|
18
|
+
/**
|
|
19
|
+
* Client custom styling via url
|
|
20
|
+
*/
|
|
21
|
+
this.clientStylingUrl = '';
|
|
22
|
+
this.device = 'Mobile';
|
|
23
|
+
this.limitStylingAppends = false;
|
|
24
|
+
this.handleCloseClick = () => {
|
|
25
|
+
this.closeModal.emit(this.modalType);
|
|
26
|
+
};
|
|
27
|
+
this.setClientStyling = () => {
|
|
28
|
+
let sheet = document.createElement('style');
|
|
29
|
+
sheet.innerHTML = this.clientStyling;
|
|
30
|
+
this.host.prepend(sheet);
|
|
31
|
+
};
|
|
32
|
+
this.setClientStylingURL = () => {
|
|
33
|
+
let url = new URL(this.clientStylingUrl);
|
|
34
|
+
let cssFile = document.createElement('style');
|
|
35
|
+
fetch(url.href)
|
|
36
|
+
.then((res) => res.text())
|
|
37
|
+
.then((data) => {
|
|
38
|
+
cssFile.innerHTML = data;
|
|
39
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
40
|
+
})
|
|
41
|
+
.catch((err) => {
|
|
42
|
+
console.log('Error ', err);
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
componentDidRender() {
|
|
47
|
+
if (!this.limitStylingAppends && this.host) {
|
|
48
|
+
if (this.clientStyling)
|
|
49
|
+
this.setClientStyling();
|
|
50
|
+
if (this.clientStylingUrl)
|
|
51
|
+
this.setClientStylingURL();
|
|
52
|
+
this.limitStylingAppends = true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
render() {
|
|
56
|
+
return (h("div", { class: `ModalOverlay ${this.isOpen && 'Open'} ${this.device}` }, h("div", { class: "ModalContent GradientBorder" }, h("div", { class: 'IconCloseContainer' }, h("button", { class: "IconCloseButton", onClick: this.handleCloseClick }, h("img", { src: this.icon, alt: "\u0421lose modal" }))), this.contentIcon ? (h("div", { class: "ModalIcon", style: {
|
|
57
|
+
background: `url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`
|
|
58
|
+
} })) : this.modalType === MODAL_TYPES.REWARD_MODAL ? (h("div", { class: "ModalIcon" })) : null, h("div", { class: "ModalHeader" }, h("h1", null, this.header)), h("div", { class: "ModalBody" }, h("slot", { name: "body" })), h("div", { class: "ModalFooter" }, h("slot", { name: "footer" })))));
|
|
59
|
+
}
|
|
60
|
+
get host() { return getElement(this); }
|
|
61
|
+
};
|
|
62
|
+
CasinoEngagementSuiteModal.style = casinoEngagementSuiteModalCss;
|
|
63
|
+
|
|
64
|
+
export { CasinoEngagementSuiteModal as casino_engagement_suite_modal };
|