@everymatrix/player-transaction-history 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/components/PlayerTransactionHistory-CExKmjS_.js +4505 -0
- package/components/PlayerTransactionHistory-_k7YIUPq.cjs +5 -0
- package/es2015/player-transaction-history.cjs +1 -0
- package/es2015/player-transaction-history.js +16 -0
- package/package.json +15 -33
- package/CHANGELOG.md +0 -7
- package/README.md +0 -30
- package/dist/player-transaction-history.js +0 -2
- package/dist/player-transaction-history.js.map +0 -1
- package/index.html +0 -21
- package/index.js +0 -1
- package/public/favicon.png +0 -0
- package/public/reset.css +0 -48
- package/rollup.config.js +0 -67
- package/src/PlayerTransactionHistory.svelte +0 -171
- package/src/i18n.js +0 -27
- package/src/index.ts +0 -4
- package/src/translations.js +0 -38
- package/stories/PlayerTransactionHistory.stories.js +0 -13
- package/tsconfig.json +0 -6
package/index.html
DELETED
|
@@ -1,21 +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
|
-
player-transaction-history
|
|
9
|
-
</title>
|
|
10
|
-
<link rel="stylesheet" href="public/reset.css">
|
|
11
|
-
<script src='dist/player-transaction-history.js'></script>
|
|
12
|
-
</head>
|
|
13
|
-
|
|
14
|
-
<body>
|
|
15
|
-
|
|
16
|
-
<div class="webcomponent">
|
|
17
|
-
<player-transaction-history></player-transaction-history>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
</body>
|
|
21
|
-
</html>
|
package/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './dist/player-transaction-history.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,67 +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 typescript from '@rollup/plugin-typescript';
|
|
9
|
-
import uglify from 'rollup-plugin-uglify';
|
|
10
|
-
import image from '@rollup/plugin-image';
|
|
11
|
-
|
|
12
|
-
const production = process.env.NODE_ENV == 'production';
|
|
13
|
-
const dev = process.env.NODE_ENV == 'development';
|
|
14
|
-
|
|
15
|
-
export default {
|
|
16
|
-
input: 'src/index.ts',
|
|
17
|
-
output: {
|
|
18
|
-
sourcemap: true,
|
|
19
|
-
format: 'umd',
|
|
20
|
-
name: 'app',
|
|
21
|
-
file: 'dist/player-transaction-history.js',
|
|
22
|
-
},
|
|
23
|
-
plugins: [
|
|
24
|
-
svelte({
|
|
25
|
-
preprocess: sveltePreprocess(),
|
|
26
|
-
compilerOptions: {
|
|
27
|
-
// @TODO check generate and hydratable
|
|
28
|
-
// generate: 'ssr',
|
|
29
|
-
// hydratable: true,
|
|
30
|
-
// enable run-time checks when not in production
|
|
31
|
-
customElement: true,
|
|
32
|
-
dev: !production
|
|
33
|
-
}
|
|
34
|
-
}),
|
|
35
|
-
image(),
|
|
36
|
-
commonjs(),
|
|
37
|
-
resolve({
|
|
38
|
-
browser: true,
|
|
39
|
-
dedupe: ['svelte']
|
|
40
|
-
}),
|
|
41
|
-
dev && serve({
|
|
42
|
-
open: true,
|
|
43
|
-
verbose: true,
|
|
44
|
-
allowCrossOrigin: true,
|
|
45
|
-
historyApiFallback: false,
|
|
46
|
-
host: 'localhost',
|
|
47
|
-
port: 5050,
|
|
48
|
-
}),
|
|
49
|
-
dev && livereload({ watch: ['', 'dist'] }),
|
|
50
|
-
typescript({
|
|
51
|
-
sourceMap: !production,
|
|
52
|
-
inlineSources: !production,
|
|
53
|
-
}),
|
|
54
|
-
// If we're building for production (npm run build
|
|
55
|
-
// instead of npm run dev), minify
|
|
56
|
-
production &&
|
|
57
|
-
terser({
|
|
58
|
-
output: {
|
|
59
|
-
comments: "all"
|
|
60
|
-
},
|
|
61
|
-
}),
|
|
62
|
-
production && uglify.uglify()
|
|
63
|
-
],
|
|
64
|
-
watch: {
|
|
65
|
-
clearScreen: false
|
|
66
|
-
}
|
|
67
|
-
};
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
<svelte:options tag={null} />
|
|
2
|
-
<script lang="ts">
|
|
3
|
-
import { getDevice } from 'rvhelper';
|
|
4
|
-
import { _, addNewMessages, setLocale } from './i18n';
|
|
5
|
-
import { TRANSLATIONS } from './translations';
|
|
6
|
-
|
|
7
|
-
export let endpoint:string = '';
|
|
8
|
-
export let session:string = '';
|
|
9
|
-
export let playerid:string = '';
|
|
10
|
-
export let lang:string = 'en';
|
|
11
|
-
export let clientstyling:string = '';
|
|
12
|
-
export let clientstylingurl:string = '';
|
|
13
|
-
export let translationurl:string = '';
|
|
14
|
-
|
|
15
|
-
let customStylingContainer:HTMLElement;
|
|
16
|
-
let userAgent:string = window.navigator.userAgent;
|
|
17
|
-
let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;
|
|
18
|
-
let isLoading:boolean = true;
|
|
19
|
-
|
|
20
|
-
let iframeUrl:string = '';
|
|
21
|
-
|
|
22
|
-
const setTranslationUrl = ():void => {
|
|
23
|
-
let url:string = translationurl;
|
|
24
|
-
|
|
25
|
-
fetch(url).then((res:any) => res.json())
|
|
26
|
-
.then((res) => {
|
|
27
|
-
Object.keys(res).forEach((item:any):void => {
|
|
28
|
-
addNewMessages(item, res[item]);
|
|
29
|
-
});
|
|
30
|
-
}).catch((err:any) => {
|
|
31
|
-
console.log(err);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
Object.keys(TRANSLATIONS).forEach((item:any) => {
|
|
36
|
-
addNewMessages(item, TRANSLATIONS[item]);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const toggleScreen = ():void => {
|
|
40
|
-
window.postMessage({type: 'PlayerAccountMenuActive', isMobile}, window.location.href);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const getTransactionHistoryIframe = ():void => {
|
|
45
|
-
let url:URL = new URL(`${endpoint}/v1/player/${playerid}/hostedcashier/customertransactionhistoryurl`);
|
|
46
|
-
url.searchParams.append('language', lang);
|
|
47
|
-
|
|
48
|
-
let options = {
|
|
49
|
-
method: "GET",
|
|
50
|
-
headers: {
|
|
51
|
-
'X-SessionId': session,
|
|
52
|
-
accept: 'application/json'
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
fetch(url.href, options)
|
|
57
|
-
.then((res:any) => res.json())
|
|
58
|
-
.then((data:any) => {
|
|
59
|
-
|
|
60
|
-
isLoading = false;
|
|
61
|
-
|
|
62
|
-
iframeUrl = data.CashierUrl;
|
|
63
|
-
|
|
64
|
-
}, (err:any) => {
|
|
65
|
-
console.error(err);
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const setActiveLanguage = ():void => {
|
|
70
|
-
setLocale(lang);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const setClientStyling = ():void => {
|
|
74
|
-
let sheet:HTMLElement = document.createElement('style');
|
|
75
|
-
sheet.innerHTML = clientstyling;
|
|
76
|
-
customStylingContainer.appendChild(sheet);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const setClientStylingURL = ():void => {
|
|
80
|
-
let url:URL = new URL(clientstylingurl);
|
|
81
|
-
let cssFile:HTMLElement = document.createElement('style');
|
|
82
|
-
|
|
83
|
-
fetch(url.href)
|
|
84
|
-
.then((res:any) => res.text())
|
|
85
|
-
.then((data:any) => {
|
|
86
|
-
cssFile.innerHTML = data
|
|
87
|
-
|
|
88
|
-
setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
$: lang && setActiveLanguage();
|
|
93
|
-
$: session && playerid && endpoint && lang && getTransactionHistoryIframe();
|
|
94
|
-
$: clientstylingurl && customStylingContainer && setClientStylingURL();
|
|
95
|
-
$: clientstyling && customStylingContainer && setClientStyling();
|
|
96
|
-
$: translationurl && setTranslationUrl();
|
|
97
|
-
</script>
|
|
98
|
-
|
|
99
|
-
<div class="TransactionHistoryWrapper {isMobile ? 'TransactionHistoryWrapperMobile' : ''}" bind:this={customStylingContainer}>
|
|
100
|
-
{#if isMobile}
|
|
101
|
-
<div class="MenuReturnButton" on:click={() => toggleScreen()}>
|
|
102
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><defs><style>.aaa{fill:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));}</style></defs><g transform="translate(-20 -158)">
|
|
103
|
-
<g transform="translate(20 158)">
|
|
104
|
-
<path class="aaa" d="M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z" transform="translate(15 15) rotate(180)"/>
|
|
105
|
-
</g></g>
|
|
106
|
-
</svg>
|
|
107
|
-
<h2 class="TransactionHistoryTitleMobile">{$_('titleTransactionHistory')}</h2>
|
|
108
|
-
</div>
|
|
109
|
-
{/if}
|
|
110
|
-
<h2 class="TransactionHistoryTitle {isMobile ? 'TransactionHistoryTitleNone' : ''}">{$_('titleTransactionHistory')}</h2>
|
|
111
|
-
{#if isLoading}
|
|
112
|
-
<p>{$_('loading')}</p>
|
|
113
|
-
{:else}
|
|
114
|
-
<div class="TransactionHistoryIframeWrapper">
|
|
115
|
-
<iframe src={iframeUrl} title="Transaction History Iframe"></iframe>
|
|
116
|
-
</div>
|
|
117
|
-
{/if}
|
|
118
|
-
</div>
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
<style lang="scss">
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
.TransactionHistoryWrapper {
|
|
126
|
-
background-color: var(--emw-color-pale, var(--emw--color-gray-50, #F1F1F1));
|
|
127
|
-
border-radius: var(--emw--border-radius-large, 20px);
|
|
128
|
-
color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));
|
|
129
|
-
padding: 50px 50px 30px 50px;
|
|
130
|
-
max-width: 100%;
|
|
131
|
-
|
|
132
|
-
&.TransactionHistoryWrapperMobile {
|
|
133
|
-
padding: 20px 15px;
|
|
134
|
-
max-width: unset;
|
|
135
|
-
border-radius: 0;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.MenuReturnButton{
|
|
140
|
-
color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));
|
|
141
|
-
display: inline-flex;
|
|
142
|
-
align-items: center;
|
|
143
|
-
column-gap: 10px;
|
|
144
|
-
margin-bottom: 10px;
|
|
145
|
-
& svg {
|
|
146
|
-
fill: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.TransactionHistoryTitle {
|
|
151
|
-
font-size: var(--emw--font-size-x-large, 26px);
|
|
152
|
-
color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));
|
|
153
|
-
font-weight: var(--emw--font-weigh-normal, 400);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.TransactionHistoryTitleMobile {
|
|
157
|
-
font-size: var(--emw--size-standard, 16px);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.TransactionHistoryTitleNone {
|
|
161
|
-
display: none;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.TransactionHistoryIframeWrapper {
|
|
165
|
-
iframe {
|
|
166
|
-
border: none;
|
|
167
|
-
width: 100%;
|
|
168
|
-
height: 85vh;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
</style>
|
package/src/i18n.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
dictionary,
|
|
3
|
-
locale,
|
|
4
|
-
addMessages,
|
|
5
|
-
_
|
|
6
|
-
} from 'svelte-i18n';
|
|
7
|
-
|
|
8
|
-
function setupI18n({ withLocale: _locale, translations }) {
|
|
9
|
-
locale.subscribe((data) => {
|
|
10
|
-
if (data == null) {
|
|
11
|
-
dictionary.set(translations);
|
|
12
|
-
locale.set(_locale);
|
|
13
|
-
}
|
|
14
|
-
}); // maybe we will need this to make sure that the i18n is set up only once
|
|
15
|
-
/*dictionary.set(translations);
|
|
16
|
-
locale.set(_locale);*/
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function addNewMessages(lang, dict) {
|
|
20
|
-
addMessages(lang, dict);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function setLocale(_locale) {
|
|
24
|
-
locale.set(_locale);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export { _, setupI18n, addNewMessages, setLocale };
|
package/src/index.ts
DELETED
package/src/translations.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export const TRANSLATIONS = {
|
|
2
|
-
"en": {
|
|
3
|
-
"titleTransactionHistory": "Transaction History",
|
|
4
|
-
"loading": "Loading, please wait ..."
|
|
5
|
-
},
|
|
6
|
-
"zh-hk": {
|
|
7
|
-
"titleTransactionHistory": "交易記錄",
|
|
8
|
-
"loading": "加載請稍候…"
|
|
9
|
-
},
|
|
10
|
-
"fr": {
|
|
11
|
-
"titleTransactionHistory": "Historique des transactions",
|
|
12
|
-
"loading": "Chargement, veuillez patienter ..."
|
|
13
|
-
},
|
|
14
|
-
"ro": {
|
|
15
|
-
"titleTransactionHistory": "Istoric tranzacții",
|
|
16
|
-
"loading": "Se încarcă..."
|
|
17
|
-
},
|
|
18
|
-
"es": {
|
|
19
|
-
"titleTransactionHistory": "Historial de transacciones",
|
|
20
|
-
"loading": "Cargando ... Por favor espere ..."
|
|
21
|
-
},
|
|
22
|
-
"pt": {
|
|
23
|
-
"titleTransactionHistory": "Histórico de transações",
|
|
24
|
-
"loading": "Carregando, por favor espere ..."
|
|
25
|
-
},
|
|
26
|
-
"hr": {
|
|
27
|
-
"titleTransactionHistory": "Povijest transakcija",
|
|
28
|
-
"loading": "Učitavanje"
|
|
29
|
-
},
|
|
30
|
-
"pt-br": {
|
|
31
|
-
"titleTransactionHistory": "Histórico de transações",
|
|
32
|
-
"Loading": "Carregando, por favor espere..."
|
|
33
|
-
},
|
|
34
|
-
"es-mx": {
|
|
35
|
-
"titleTransactionHistory": "Historial de transacciones",
|
|
36
|
-
"Loading": "Cargando, por favor espere..."
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit-element';
|
|
2
|
-
|
|
3
|
-
import PlayerTransactionHistory from '../src/PlayerTransactionHistory';
|
|
4
|
-
|
|
5
|
-
// This default export determines where your story goes in the story list
|
|
6
|
-
export default {
|
|
7
|
-
title: 'PlayerTransactionHistory',
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
// 👇 We create a “template” of how args map to rendering
|
|
11
|
-
const PlayerTransactionHistory = ({ aProperty }) => html`<player-transaction-history></player-transaction-history>`;
|
|
12
|
-
|
|
13
|
-
export const FirstStory = PlayerTransactionHistory.bind({});
|