@everymatrix/cashier-session-expiration-modal 1.44.0 → 1.45.2
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/es2015/cashier-session-expiration-modal.cjs +1 -0
- package/es2015/cashier-session-expiration-modal.js +16 -0
- package/package.json +14 -33
- package/CHANGELOG.md +0 -9
- package/README.md +0 -30
- package/dist/cashier-session-expiration-modal.js +0 -1019
- package/dist/cashier-session-expiration-modal.js.map +0 -1
- package/index.html +0 -37
- package/index.js +0 -1
- package/public/favicon.png +0 -0
- package/public/reset.css +0 -48
- package/rollup.config.js +0 -61
- package/src/CashierSessionExpirationModal.svelte +0 -328
- package/src/assets/set-timeout-icon.png +0 -0
- package/src/i18n.js +0 -33
- package/src/index.ts +0 -4
- package/src/translations.js +0 -14
- package/stories/CashierSessionExpirationModal.stories.js +0 -13
- package/tsconfig.json +0 -6
package/index.html
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset='utf-8'>
|
|
5
|
-
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
|
6
|
-
|
|
7
|
-
<title>
|
|
8
|
-
cashier-session-expiration-modal
|
|
9
|
-
</title>
|
|
10
|
-
<link rel="stylesheet" href="public/reset.css">
|
|
11
|
-
<script src='dist/cashier-session-expiration-modal.js'></script>
|
|
12
|
-
</head>
|
|
13
|
-
|
|
14
|
-
<body>
|
|
15
|
-
<style>
|
|
16
|
-
html,body { margin: 0; padding: 0; height: 100%; font-family: "Helvetica Neue", "Helvetica", sans-serif; }
|
|
17
|
-
.header { display: flex; justify-content: center; align-items: center; padding: 10px 20px; margin-bottom: 20px; background: #42a3e2; box-shadow: 3px 4px 5px 0px rgba(0,0,0, .2); }
|
|
18
|
-
.header__logo svg { height: 50px; width: 50px; margin-right: 5px; }
|
|
19
|
-
.header__name { color: #fff; }
|
|
20
|
-
.header__name span { margin-right: 10px; font-weight: bold; }
|
|
21
|
-
.webcomponent { padding: 10px 20px; }
|
|
22
|
-
</style>
|
|
23
|
-
<header class="header">
|
|
24
|
-
<div class="header__logo">
|
|
25
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="161" height="132" viewBox="0 0 161 132"><defs><linearGradient x1="0%" y1="50%" y2="50%" id="a"><stop stop-color="#2A3B8F" offset="0%"/><stop stop-color="#29ABE2" offset="100%"/></linearGradient><linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="c"><stop stop-color="#B4D44E" offset="0%"/><stop stop-color="#E7F716" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path fill="#166DA5" d="M160.6 65.9l-17.4 29.3-24.4-29.7 24.4-28.9z"/><path fill="#8FDB69" d="M141.3 100.2l-26.5-31.7-15.9 26.6 24.7 36.1z"/><path fill="#166DA5" d="M141 31.4l-26.2 31.8-15.9-26.6L123.6.9z"/><path fill="url(#a)" opacity=".95" d="M61.1 31.4H141L123.4.7H78.7z M114.8 63.3H159l-15.9-26.8H98.8"/><path fill="url(#c)" opacity=".95" d="M141.3 100.3H61l17.6 30.5h45z M114.8 68.4H159l-15.9 26.8H98.8"/><path fill="#010101" d="M78.6 130.8L41 65.8 79.1.8H37.9L.4 65.8l37.5 65z"/></g></svg>
|
|
26
|
-
</div>
|
|
27
|
-
<h1 class="header__name">
|
|
28
|
-
<span>WEBCOMPONENT:</span> cashier-session-expiration-modal
|
|
29
|
-
</h1>
|
|
30
|
-
</header>
|
|
31
|
-
|
|
32
|
-
<div class="webcomponent">
|
|
33
|
-
<cashier-session-expiration-modal></cashier-session-expiration-modal>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
</body>
|
|
37
|
-
</html>
|
package/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './dist/cashier-session-expiration-modal.js';
|
package/public/favicon.png
DELETED
|
Binary file
|
package/public/reset.css
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/* http://meyerweb.com/eric/tools/css/reset/
|
|
2
|
-
v2.0 | 20110126
|
|
3
|
-
License: none (public domain)
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
html, body, div, span, applet, object, iframe,
|
|
7
|
-
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
|
8
|
-
a, abbr, acronym, address, big, cite, code,
|
|
9
|
-
del, dfn, em, img, ins, kbd, q, s, samp,
|
|
10
|
-
small, strike, strong, sub, sup, tt, var,
|
|
11
|
-
b, u, i, center,
|
|
12
|
-
dl, dt, dd, ol, ul, li,
|
|
13
|
-
fieldset, form, label, legend,
|
|
14
|
-
table, caption, tbody, tfoot, thead, tr, th, td,
|
|
15
|
-
article, aside, canvas, details, embed,
|
|
16
|
-
figure, figcaption, footer, header, hgroup,
|
|
17
|
-
menu, nav, output, ruby, section, summary,
|
|
18
|
-
time, mark, audio, video {
|
|
19
|
-
margin: 0;
|
|
20
|
-
padding: 0;
|
|
21
|
-
border: 0;
|
|
22
|
-
font-size: 100%;
|
|
23
|
-
font: inherit;
|
|
24
|
-
vertical-align: baseline;
|
|
25
|
-
}
|
|
26
|
-
/* HTML5 display-role reset for older browsers */
|
|
27
|
-
article, aside, details, figcaption, figure,
|
|
28
|
-
footer, header, hgroup, menu, nav, section {
|
|
29
|
-
display: block;
|
|
30
|
-
}
|
|
31
|
-
body {
|
|
32
|
-
line-height: 1;
|
|
33
|
-
}
|
|
34
|
-
ol, ul {
|
|
35
|
-
list-style: none;
|
|
36
|
-
}
|
|
37
|
-
blockquote, q {
|
|
38
|
-
quotes: none;
|
|
39
|
-
}
|
|
40
|
-
blockquote:before, blockquote:after,
|
|
41
|
-
q:before, q:after {
|
|
42
|
-
content: '';
|
|
43
|
-
content: none;
|
|
44
|
-
}
|
|
45
|
-
table {
|
|
46
|
-
border-collapse: collapse;
|
|
47
|
-
border-spacing: 0;
|
|
48
|
-
}
|
package/rollup.config.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import svelte from 'rollup-plugin-svelte';
|
|
2
|
-
import commonjs from '@rollup/plugin-commonjs';
|
|
3
|
-
import resolve from '@rollup/plugin-node-resolve';
|
|
4
|
-
import serve from 'rollup-plugin-dev-server';
|
|
5
|
-
import livereload from 'rollup-plugin-livereload';
|
|
6
|
-
import { terser } from 'rollup-plugin-terser';
|
|
7
|
-
import sveltePreprocess from 'svelte-preprocess';
|
|
8
|
-
import image from '@rollup/plugin-image';
|
|
9
|
-
import typescript from '@rollup/plugin-typescript';
|
|
10
|
-
const production = process.env.NODE_ENV === 'production';
|
|
11
|
-
const dev = process.env.NODE_ENV === 'development';
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
input: 'src/index.ts',
|
|
15
|
-
output: {
|
|
16
|
-
sourcemap: true,
|
|
17
|
-
format: 'umd',
|
|
18
|
-
name: 'app',
|
|
19
|
-
file: 'dist/cashier-session-expiration-modal.js'
|
|
20
|
-
},
|
|
21
|
-
plugins: [
|
|
22
|
-
svelte({
|
|
23
|
-
preprocess: sveltePreprocess(),
|
|
24
|
-
compilerOptions: {
|
|
25
|
-
// enable run-time checks when not in production
|
|
26
|
-
customElement: true,
|
|
27
|
-
dev: !production
|
|
28
|
-
}
|
|
29
|
-
}),
|
|
30
|
-
commonjs(),
|
|
31
|
-
resolve({
|
|
32
|
-
browser: true,
|
|
33
|
-
dedupe: ['svelte']
|
|
34
|
-
}),
|
|
35
|
-
dev && serve({
|
|
36
|
-
open: true,
|
|
37
|
-
verbose: true,
|
|
38
|
-
allowCrossOrigin: true,
|
|
39
|
-
historyApiFallback: false,
|
|
40
|
-
host: 'localhost',
|
|
41
|
-
port: 5050,
|
|
42
|
-
}),
|
|
43
|
-
dev && livereload({ watch: ['', 'dist'] }),
|
|
44
|
-
image(),
|
|
45
|
-
typescript({
|
|
46
|
-
sourceMap: !production,
|
|
47
|
-
inlineSources: !production,
|
|
48
|
-
}),
|
|
49
|
-
// If we're building for production (npm run build
|
|
50
|
-
// instead of npm run dev), minify
|
|
51
|
-
production &&
|
|
52
|
-
terser({
|
|
53
|
-
output: {
|
|
54
|
-
comments: "all"
|
|
55
|
-
},
|
|
56
|
-
})
|
|
57
|
-
],
|
|
58
|
-
watch: {
|
|
59
|
-
clearScreen: false
|
|
60
|
-
}
|
|
61
|
-
};
|
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
<svelte:options tag={null} />
|
|
2
|
-
|
|
3
|
-
<script lang="ts">
|
|
4
|
-
import { fade } from 'svelte/transition';
|
|
5
|
-
import { _, addNewMessages, setLocale } from './i18n';
|
|
6
|
-
import { TRANSLATIONS } from './translations';
|
|
7
|
-
import { onMount, onDestroy } from 'svelte';
|
|
8
|
-
import DOMPurify from 'dompurify';
|
|
9
|
-
import sessionImage from './assets/set-timeout-icon.png';
|
|
10
|
-
import dayjs from 'dayjs';
|
|
11
|
-
import utc from 'dayjs/plugin/utc';
|
|
12
|
-
dayjs.extend(utc);
|
|
13
|
-
|
|
14
|
-
export let clientstyling: string = '';
|
|
15
|
-
export let clientstylingurl: string = '';
|
|
16
|
-
export let width: number;
|
|
17
|
-
export let height: number;
|
|
18
|
-
export let duration: number = 200;
|
|
19
|
-
export let assetsurl: string = '';
|
|
20
|
-
export let lang: string = 'en';
|
|
21
|
-
export let translationurl: string = '';
|
|
22
|
-
export let endpoint: string;
|
|
23
|
-
export let currency: string;
|
|
24
|
-
export let customerid: string;
|
|
25
|
-
export let selectedpaymentmethodname: string;
|
|
26
|
-
|
|
27
|
-
let customStylingContainer: HTMLElement;
|
|
28
|
-
let show: boolean = false;
|
|
29
|
-
const lastNinetySeconds = 90;
|
|
30
|
-
let timeLeft;
|
|
31
|
-
let sessionEndTime;
|
|
32
|
-
let interval;
|
|
33
|
-
let selectedPaymentMethodName: string;
|
|
34
|
-
let xPaymentSessionToken: string;
|
|
35
|
-
|
|
36
|
-
const messageHandler = (e:any) => {
|
|
37
|
-
if (e.data.type === 'StartSessionCountdown') {
|
|
38
|
-
xPaymentSessionToken = e.data.xPaymentSessionToken;
|
|
39
|
-
selectedPaymentMethodName = e.data.paymentMethodName;
|
|
40
|
-
startCountdown();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const parseJwt = (token: string) => {
|
|
45
|
-
try {
|
|
46
|
-
return JSON.parse(atob(token.split('.')[1]));
|
|
47
|
-
} catch (e) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const startCountdown = () => {
|
|
53
|
-
show = false;
|
|
54
|
-
const tokenPayload = parseJwt(xPaymentSessionToken);
|
|
55
|
-
if (!tokenPayload) return;
|
|
56
|
-
sessionEndTime = tokenPayload?.exp;
|
|
57
|
-
timeLeft = sessionEndTime;
|
|
58
|
-
|
|
59
|
-
if (interval) clearInterval(interval);
|
|
60
|
-
interval = setInterval(() => {
|
|
61
|
-
const currentTime = Math.floor(new Date().getTime() / 1000);
|
|
62
|
-
timeLeft = sessionEndTime - currentTime;
|
|
63
|
-
if (timeLeft <= lastNinetySeconds) {
|
|
64
|
-
show = true;
|
|
65
|
-
}
|
|
66
|
-
if (currentTime >= sessionEndTime) {
|
|
67
|
-
timeLeft = 0;
|
|
68
|
-
show = false;
|
|
69
|
-
clearInterval(interval);
|
|
70
|
-
window.postMessage({type: 'SessionExpired'}, window.location.href);
|
|
71
|
-
}
|
|
72
|
-
}, 1000);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const renewSession = () => {
|
|
76
|
-
const url:URL = new URL(`${endpoint}/v1/player/${customerid}/payment/GetPaymentMethod`);
|
|
77
|
-
const headers = new Headers();
|
|
78
|
-
headers.append("accept", "application/json");
|
|
79
|
-
headers.append("Content-Type", "application/json");
|
|
80
|
-
headers.append("X-Client-Request-Timestamp", dayjs.utc().format("YYYY-MM-DD HH:mm:ss.SSS"));
|
|
81
|
-
const requestParams:RequestInit = {
|
|
82
|
-
method: "POST",
|
|
83
|
-
mode: "cors",
|
|
84
|
-
headers: headers,
|
|
85
|
-
body: JSON.stringify({
|
|
86
|
-
"PaymentMethodName": selectedPaymentMethodName || selectedpaymentmethodname,
|
|
87
|
-
"Currency": currency,
|
|
88
|
-
"XPaymentSessionToken": xPaymentSessionToken
|
|
89
|
-
})
|
|
90
|
-
}
|
|
91
|
-
fetch(url, requestParams).then(res => res.json()).then((data) => {
|
|
92
|
-
xPaymentSessionToken = data.XPaymentSessionToken;
|
|
93
|
-
startCountdown();
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const outOfModalClick = (event: Event) => {
|
|
98
|
-
const outerContainer = event.currentTarget;
|
|
99
|
-
if (event.target === outerContainer) {
|
|
100
|
-
renewSession();
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
const setTranslationUrl = ():void => {
|
|
105
|
-
let url:string = translationurl;
|
|
106
|
-
|
|
107
|
-
fetch(url).then((res:any) => res.json())
|
|
108
|
-
.then((res) => {
|
|
109
|
-
Object.keys(res).forEach((item:any):void => {
|
|
110
|
-
addNewMessages(item, res[item]);
|
|
111
|
-
});
|
|
112
|
-
}).catch((err:any) => {
|
|
113
|
-
console.log(err);
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
Object.keys(TRANSLATIONS).forEach((item:any):void => {
|
|
118
|
-
addNewMessages(item, TRANSLATIONS[item]);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
const setActiveLanguage = ():void => {
|
|
122
|
-
setLocale(lang);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const setClientStyling = ():void => {
|
|
126
|
-
let sheet = document.createElement('style');
|
|
127
|
-
sheet.innerHTML = clientstyling;
|
|
128
|
-
customStylingContainer.appendChild(sheet);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
const setClientStylingURL = ():void => {
|
|
132
|
-
let url:URL = new URL(clientstylingurl);
|
|
133
|
-
let cssFile:HTMLElement = document.createElement('style');
|
|
134
|
-
fetch(url.href)
|
|
135
|
-
.then((res:any) => res.text())
|
|
136
|
-
.then((data:any) => {
|
|
137
|
-
cssFile.innerHTML = data
|
|
138
|
-
setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
onMount(() => {
|
|
143
|
-
window.addEventListener('message', messageHandler, false);
|
|
144
|
-
return () => {
|
|
145
|
-
window.removeEventListener('message', messageHandler);
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
onDestroy(() => {
|
|
150
|
-
clearInterval(interval);
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
$: lang && setActiveLanguage();
|
|
154
|
-
$: clientstyling && customStylingContainer && setClientStyling();
|
|
155
|
-
$: clientstylingurl && customStylingContainer && setClientStylingURL();
|
|
156
|
-
$: translationurl && setTranslationUrl();
|
|
157
|
-
</script>
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
{#if show}
|
|
161
|
-
<div bind:this={customStylingContainer} part="CustomStylingContainer">
|
|
162
|
-
<div
|
|
163
|
-
class="CashierSessionExpirationModalWindow"
|
|
164
|
-
part="CashierSessionExpirationModalWindow"
|
|
165
|
-
id="CashierSessionExpirationModal"
|
|
166
|
-
transition:fade="{{duration }}"
|
|
167
|
-
on:click={outOfModalClick}
|
|
168
|
-
bind:clientWidth={width}
|
|
169
|
-
bind:clientHeight={height}>
|
|
170
|
-
<div class="CashierSessionExpirationModalWrapper" part="CashierSessionExpirationModalWrapper">
|
|
171
|
-
<div class="CashierSessionExpirationModalHeader">
|
|
172
|
-
<div class="CashierSessionExpirationModalHeaderTitle">{$_('sessionExpirationHeader')}</div>
|
|
173
|
-
</div>
|
|
174
|
-
<div class="CashierSessionExpirationModalContainer" part="CashierSessionExpirationModalContainer">
|
|
175
|
-
<div class="CashierSessionExpiration" bind:this={customStylingContainer}>
|
|
176
|
-
<slot name="icon" class="CashierSessionExpirationIcon">
|
|
177
|
-
{#if assetsurl}
|
|
178
|
-
<img src="{`${assetsurl}/set-timeout-icon.png`}" width="300px" alt="error">
|
|
179
|
-
{:else}
|
|
180
|
-
<img src="{sessionImage}" width="300px" alt="error">
|
|
181
|
-
{/if}
|
|
182
|
-
</slot>
|
|
183
|
-
<slot name="title" class="CashierSessionExpirationTitle">
|
|
184
|
-
<span>{$_('sessionExpirationTitle')}</span>
|
|
185
|
-
</slot>
|
|
186
|
-
<slot name="text" class="CashierSessionExpirationText">
|
|
187
|
-
<span>{@html DOMPurify.sanitize($_('sessionExpirationGeneralText',{values:{second: timeLeft}}))}</span>
|
|
188
|
-
</slot>
|
|
189
|
-
<div on:click={renewSession} class="CashierSessionExpirationButton">
|
|
190
|
-
<slot name="button">
|
|
191
|
-
<span>{$_('sessionExpirationGeneralButton')}</span>
|
|
192
|
-
</slot>
|
|
193
|
-
</div>
|
|
194
|
-
</div>
|
|
195
|
-
</div>
|
|
196
|
-
</div>
|
|
197
|
-
</div>
|
|
198
|
-
</div>
|
|
199
|
-
{/if}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
<style lang="scss">
|
|
203
|
-
|
|
204
|
-
*, *::before, *::after {
|
|
205
|
-
margin: 0;
|
|
206
|
-
padding: 0;
|
|
207
|
-
box-sizing: border-box;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
.CashierSessionExpirationModalWindow {
|
|
211
|
-
display: flex;
|
|
212
|
-
position: absolute;
|
|
213
|
-
align-items: center;
|
|
214
|
-
justify-content: center;
|
|
215
|
-
width: 100%;
|
|
216
|
-
height: 100%;
|
|
217
|
-
z-index: 5;
|
|
218
|
-
top: 0;
|
|
219
|
-
left: 0;
|
|
220
|
-
background-color: var(--mmw--color-black-transparency-4, rgba(0, 0, 0, .04));
|
|
221
|
-
container-type: inline-size;
|
|
222
|
-
container-name: session-expiration-modal-window;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
.CashierSessionExpirationModalWrapper {
|
|
226
|
-
background: var(--emw--color-white, #fff);
|
|
227
|
-
border-radius: var(--emw--border-radius-medium, 4px);
|
|
228
|
-
width: 400px;
|
|
229
|
-
}
|
|
230
|
-
.CashierSessionExpirationModalHeader {
|
|
231
|
-
display: flex;
|
|
232
|
-
align-items: center;
|
|
233
|
-
position: relative;
|
|
234
|
-
height: var(--mmw--header-height, 32px);
|
|
235
|
-
background-color: var(--mmw--color-grey-105, #E8E9EB);
|
|
236
|
-
width: 100%;
|
|
237
|
-
border-radius: var(--emw--border-radius-medium, 4px) var(--emw--border-radius-medium, 4px) 0 0;
|
|
238
|
-
}
|
|
239
|
-
.CashierSessionExpirationModalHeaderTitle {
|
|
240
|
-
display: flex;
|
|
241
|
-
text-align: center;
|
|
242
|
-
color: var(--mmw--color-grey-10, #111);
|
|
243
|
-
font-size: var(--emw--font-size-small, 14px);
|
|
244
|
-
font-weight: var(--emw--font-weight-semibold, 500);
|
|
245
|
-
margin: auto;
|
|
246
|
-
max-width: calc(100% - 150px);
|
|
247
|
-
overflow: hidden;
|
|
248
|
-
text-overflow: ellipsis;
|
|
249
|
-
line-height: calc(var(--emw--font-size-small, 14px) + 2px);
|
|
250
|
-
}
|
|
251
|
-
.CashierSessionExpirationModalContainer {
|
|
252
|
-
padding: var(--emw--spacing-large, 20px);
|
|
253
|
-
}
|
|
254
|
-
.CashierSessionExpirationModalCloseBtn {
|
|
255
|
-
position: absolute;
|
|
256
|
-
display: flex;
|
|
257
|
-
align-items: center;
|
|
258
|
-
justify-content: center;
|
|
259
|
-
top: 10px;
|
|
260
|
-
right: 10px;
|
|
261
|
-
padding: var(--emw--spacing-small-minus, 10px);
|
|
262
|
-
border-radius: 50%;
|
|
263
|
-
color: var(--emw--color-white, #fff);
|
|
264
|
-
background: var(--mmw--color-gray-transparency-85, rgba(255, 255, 255, .85));
|
|
265
|
-
cursor: pointer;
|
|
266
|
-
transition: all 150ms ease-in-out;
|
|
267
|
-
svg {
|
|
268
|
-
width: 32px;
|
|
269
|
-
height: 32px;
|
|
270
|
-
}
|
|
271
|
-
&:hover {
|
|
272
|
-
background: var(--emw--color-gray-transparency-20, rgba(255, 255, 255, .2));
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
.CashierSessionExpiration {
|
|
277
|
-
width: 100%;
|
|
278
|
-
display: flex;
|
|
279
|
-
flex-direction: column;
|
|
280
|
-
align-items: center;
|
|
281
|
-
gap: var(--emw--spacing-large, 20px);
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
.CashierSessionExpirationTitle {
|
|
285
|
-
color: var(--emw--color-black, #000);
|
|
286
|
-
font-weight: var(--emw--font-weight-semibold, 500);
|
|
287
|
-
font-size: var(--emw--font-size-x-small, 12px);
|
|
288
|
-
line-height: 120%;
|
|
289
|
-
text-align: center;
|
|
290
|
-
}
|
|
291
|
-
.CashierSessionExpirationText {
|
|
292
|
-
color: var(--mmw--color-grey-290, #666);
|
|
293
|
-
font-weight: var(--emw--font-weight-normal, 400);
|
|
294
|
-
font-size: var(--emw--font-size-x-small, 12px);
|
|
295
|
-
line-height: 120%;
|
|
296
|
-
text-align: center;
|
|
297
|
-
}
|
|
298
|
-
.CashierSessionExpirationButton {
|
|
299
|
-
display: flex;
|
|
300
|
-
width: 100%;
|
|
301
|
-
height: 36px;
|
|
302
|
-
flex-direction: column;
|
|
303
|
-
justify-content: center;
|
|
304
|
-
flex-shrink: 0;
|
|
305
|
-
color: var(--emw--color-white, #FFF);
|
|
306
|
-
cursor: pointer;
|
|
307
|
-
text-align: center;
|
|
308
|
-
font-size: var(--emw--font-size-x-small, 12px);
|
|
309
|
-
font-style: normal;
|
|
310
|
-
font-weight: var(--emw--font-weight-semibold, 500);
|
|
311
|
-
font-family: inherit;
|
|
312
|
-
line-height: 36px;
|
|
313
|
-
border-radius: var(--emw--border-radius-medium, 4px);
|
|
314
|
-
background: var(--emw--color-primary, #7EC51E);
|
|
315
|
-
&:hover {
|
|
316
|
-
background: var(--mmw--color-main-button-hover, #71B11B);
|
|
317
|
-
}
|
|
318
|
-
&:active {
|
|
319
|
-
background: var(--mmw--color-main-button-active, #5C950F);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
@container session-expiration-modal-window (max-width:750px) {
|
|
323
|
-
.CashierSessionExpirationModalWindow .CashierSessionExpirationModalWrapper {
|
|
324
|
-
width: 90%;
|
|
325
|
-
max-width: 400px;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
</style>
|
|
Binary file
|
package/src/i18n.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
dictionary,
|
|
3
|
-
locale,
|
|
4
|
-
init,
|
|
5
|
-
addMessages,
|
|
6
|
-
_
|
|
7
|
-
} from 'svelte-i18n';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
init({
|
|
11
|
-
fallbackLocale: 'en'
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
function setupI18n({ withLocale: _locale, translations }) {
|
|
15
|
-
locale.subscribe((data) => {
|
|
16
|
-
if (data == null) {
|
|
17
|
-
dictionary.set(translations);
|
|
18
|
-
locale.set(_locale);
|
|
19
|
-
}
|
|
20
|
-
}); // maybe we will need this to make sure that the i18n is set up only once
|
|
21
|
-
/*dictionary.set(translations);
|
|
22
|
-
locale.set(_locale);*/
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function addNewMessages(lang, dict) {
|
|
26
|
-
addMessages(lang, dict);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function setLocale(_locale) {
|
|
30
|
-
locale.set(_locale);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export { _, setupI18n, addNewMessages, setLocale };
|
package/src/index.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import CashierSessionExpirationModal from './CashierSessionExpirationModal.svelte';
|
|
2
|
-
|
|
3
|
-
!customElements.get('cashier-session-expiration-modal') && customElements.define('cashier-session-expiration-modal', CashierSessionExpirationModal);
|
|
4
|
-
export default CashierSessionExpirationModal;
|
package/src/translations.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export const TRANSLATIONS = {
|
|
2
|
-
"en": {
|
|
3
|
-
"sessionExpirationHeader": "Session Warning",
|
|
4
|
-
"sessionExpirationTitle": "Your session is about to expire!",
|
|
5
|
-
"sessionExpirationGeneralText": "Your session will automatically terminate in <b>{second} seconds</b>.",
|
|
6
|
-
"sessionExpirationGeneralButton": "CONTINUE"
|
|
7
|
-
},
|
|
8
|
-
"tr": {
|
|
9
|
-
"sessionExpirationHeader": "Session Warning",
|
|
10
|
-
"sessionExpirationTitle": "You session is about to expire!",
|
|
11
|
-
"sessionExpirationGeneralText": "Oyun seansınız <b>{second} saniye</b> içinde otomatik olarak sonuçlandırılacaktır",
|
|
12
|
-
"sessionExpirationGeneralButton": "Devam et",
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit-element';
|
|
2
|
-
|
|
3
|
-
import CashierSessionExpirationModal from '../src/CashierSessionExpirationModal';
|
|
4
|
-
|
|
5
|
-
// This default export determines where your story goes in the story list
|
|
6
|
-
export default {
|
|
7
|
-
title: 'CashierSessionExpirationModal',
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
// 👇 We create a “template” of how args map to rendering
|
|
11
|
-
const CashierSessionExpirationModal = ({ aProperty }) => html`<cashier-session-expiration-modal></cashier-session-expiration-modal>`;
|
|
12
|
-
|
|
13
|
-
export const FirstStory = CashierSessionExpirationModal.bind({});
|