@everymatrix/casino-calendar 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/index.html DELETED
@@ -1,33 +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
- casino-calendar
9
- </title>
10
- <link rel="stylesheet" href="public/reset.css">
11
- <script src='dist/casino-calendar.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
-
24
- <div class="webcomponent">
25
- <casino-calendar
26
- cmsendpoint="https://wt1-stage.everymatrix.com/apijson"
27
- lang="en"
28
- userroles="everyone"
29
- ></casino-calendar>
30
- </div>
31
-
32
- </body>
33
- </html>
package/index.js DELETED
@@ -1 +0,0 @@
1
- import './dist/casino-calendar.js';
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,59 +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
- const production = process.env.NODE_ENV === 'production';
10
- const dev = process.env.NODE_ENV === 'development';
11
-
12
- export default {
13
- input: 'src/index.ts',
14
- output: {
15
- sourcemap: true,
16
- format: 'umd',
17
- name: 'app',
18
- file: 'dist/casino-calendar.js'
19
- },
20
- plugins: [
21
- svelte({
22
- preprocess: sveltePreprocess(),
23
- compilerOptions: {
24
- // enable run-time checks when not in production
25
- customElement: true,
26
- dev: !production
27
- }
28
- }),
29
- commonjs(),
30
- resolve({
31
- browser: true,
32
- dedupe: ['svelte']
33
- }),
34
- dev && serve({
35
- open: true,
36
- verbose: true,
37
- allowCrossOrigin: true,
38
- historyApiFallback: false,
39
- host: 'localhost',
40
- port: 5050,
41
- }),
42
- dev && livereload({ watch: ['', 'dist'] }),
43
- typescript({
44
- sourceMap: !production,
45
- inlineSources: !production,
46
- }),
47
- // If we're building for production (npm run build
48
- // instead of npm run dev), minify
49
- production &&
50
- terser({
51
- output: {
52
- comments: "all"
53
- },
54
- })
55
- ],
56
- watch: {
57
- clearScreen: false
58
- }
59
- };
@@ -1,223 +0,0 @@
1
- <svelte:options tag={null} />
2
- <script lang="ts">
3
- import { onMount } from "svelte";
4
- import { isMobile, getDevice } from 'rvhelper';
5
-
6
- import '@everymatrix/casino-calendar-daily-details';
7
- import '@everymatrix/casino-calendar-daily-item';
8
-
9
- export let cmsendpoint:string = '';
10
- export let env:string = '';
11
- export let userroles: string = '';
12
- export let lang:string = 'en'; // Language
13
- export let clientstyling:string = '';
14
- export let clientstylingurl:string = '';
15
-
16
- let customStylingContainer:HTMLElement;
17
- let displayNone:boolean = false;
18
- let calendarCollections: any;
19
- let selectedIndex:number = 0;
20
-
21
- let isLoading:boolean = true;
22
- let hasErrors:boolean = false;
23
- let mobileView:boolean = false;
24
- let userAgent:string = window.navigator.userAgent;
25
- let calendarModalOpened:boolean = false;
26
-
27
- const getCalendarDailyDetails = ():void => {
28
- isLoading = true;
29
- let url:URL = new URL(`${cmsendpoint}/${lang}/daily-calendar`);
30
-
31
- url.searchParams.append('userRoles', userroles);
32
- url.searchParams.append('env', env);
33
-
34
- let device = getDevice(userAgent)
35
-
36
- if(device){
37
- if(device === 'PC'){
38
- url.searchParams.append('device', 'dk')
39
- } else if(device === 'iPad' || device === 'iPhone') {
40
- url.searchParams.append('device', 'ios'); // replace with ios when we will have a native ios up for this
41
- } else {
42
- url.searchParams.append('device', 'mtWeb')
43
- }
44
- }
45
- fetch(url.href)
46
- .then((res:any):any => {
47
- return res.json();
48
- })
49
- .then((calendarData:any):void => {
50
- calendarCollections = calendarData;
51
- }).catch((err:any):void => {
52
- console.log(err);
53
-
54
- hasErrors = true;
55
- }).finally(():void => {
56
- isLoading = false;
57
- });
58
- }
59
-
60
- const initialLoad = ():void => {
61
- getCalendarDailyDetails();
62
- }
63
-
64
- const messageHandler = (e:any):void => {
65
- if (e.data && e.data.type == 'OpenCalendar') {
66
- selectedIndex = e.data.index;
67
- calendarModalOpened = true;
68
- window.postMessage({ type:'ShowModal', selectedIndex, identifier: 'Calendar' }, window.location.href)
69
- window.postMessage({
70
- type: 'DailyEventsData',
71
- data: calendarCollections[selectedIndex]?.dailyEvents
72
- });
73
- }
74
-
75
- if (e.data && e.data.type == 'ModalClosed') {
76
- calendarModalOpened = false;
77
- }
78
- }
79
-
80
- const setClientStyling = ():void => {
81
- let sheet = document.createElement('style');
82
- sheet.innerHTML = clientstyling;
83
- customStylingContainer.appendChild(sheet);
84
- }
85
-
86
- const setClientStylingURL = ():void => {
87
- displayNone = true;
88
-
89
- let url:URL = new URL(clientstylingurl);
90
- let cssFile:HTMLElement = document.createElement('style');
91
-
92
- fetch(url.href)
93
- .then((res:any) => res.text())
94
- .then((data:any) => {
95
- cssFile.innerHTML = data;
96
-
97
- setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
98
- setTimeout(() => { displayNone = false; }, 500);
99
- });
100
- }
101
-
102
- onMount(() => {
103
- window.addEventListener('message', messageHandler, false);
104
-
105
- if (isMobile(userAgent)) {
106
- mobileView = true;
107
- }
108
-
109
- return () => {
110
- window.removeEventListener('message', messageHandler);
111
- }
112
- });
113
-
114
- $: cmsendpoint && lang && env && userroles && initialLoad();
115
- $: clientstyling && customStylingContainer && setClientStyling();
116
- $: clientstylingurl && customStylingContainer && setClientStylingURL();
117
- </script>
118
- <div bind:this={customStylingContainer}>
119
- {#if hasErrors}
120
- <p class="SearchLoading" part="SearchLoading">500 Error - Internal Server Error</p>
121
- {:else}
122
- {#if isLoading}
123
- <div class="LoadingSpinner" part="LoadingSpinner"></div>
124
- {:else}
125
- {#if calendarCollections?.length}
126
- <div class="CasinoCalendarItem {mobileView ? 'Mobile' : ''}">
127
- {#each calendarCollections as dailyCalendarData, index }
128
- <casino-calendar-daily-item
129
- dailybackground={dailyCalendarData.dailyBackground}
130
- dailyicon={dailyCalendarData.dailyIcon}
131
- dailyday={dailyCalendarData.dailyDay}
132
- dailydescription={dailyCalendarData.dailyDescription}
133
- dailybuttontitle={dailyCalendarData.dailyButtonTitle}
134
- {index}
135
- {lang}
136
- {clientstyling}
137
- {clientstylingurl}
138
- >
139
- </casino-calendar-daily-item>
140
- {/each}
141
- {#if calendarModalOpened == true}
142
- <div class="CalendarDetailsWrapper">
143
- <casino-calendar-daily-details
144
- dailybackground={calendarCollections[selectedIndex].dailyBackground}
145
- dailybuttontitle={calendarCollections[selectedIndex].dailyButtonTitle}
146
- dailyday={calendarCollections[selectedIndex].dailyDay}
147
- dailydescription={calendarCollections[selectedIndex].dailyDescription}
148
- dailyicon={calendarCollections[selectedIndex].dailyIcon}
149
- dailytitle={calendarCollections[selectedIndex].dailyTitle}
150
- {lang}
151
- {clientstyling}
152
- {clientstylingurl}
153
- ></casino-calendar-daily-details>
154
- </div>
155
- {/if}
156
- </div>
157
- {/if}
158
- {/if}
159
- {/if}
160
- </div>
161
-
162
- <style>
163
- .CasinoCalendarItem {
164
- display: flex;
165
- flex-direction: row;
166
- flex-wrap: nowrap;
167
- text-align: left;
168
- gap: 10px;
169
- overflow-x: auto;
170
- overflow-y: hidden;
171
- justify-content: space-evenly;
172
- }
173
-
174
- .Mobile {
175
- padding: 0 10px;
176
- height: 286px;
177
- overflow-y: visible;
178
- overflow-x: scroll;
179
- scroll-snap-type: x mandatory;
180
- -ms-overflow-style: none;
181
- scrollbar-width: none;
182
- }
183
-
184
- .CalendarDetailsWrapper {
185
- display: flex;
186
- position: fixed;
187
- align-items: center;
188
- justify-content: center;
189
- width: 100%;
190
- height: 100%;
191
- z-index: 300;
192
- top: 0;
193
- left: 0;
194
- background-color: var(--emfe-w-color-dark-gray, rgba(0, 0, 0, 0.9));
195
- }
196
-
197
- .LoadingSpinner {
198
- display: block;
199
- width: 80px;
200
- height: 80px;
201
- margin: 0 auto
202
- }
203
- .LoadingSpinner:after {
204
- content: " ";
205
- display: block;
206
- width: 64px;
207
- height: 64px;
208
- margin: 8px;
209
- border-radius: 50%;
210
- border: 6px solid var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));
211
- border-color: var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)) transparent var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)) transparent;
212
- animation: LoadingSpinner 1.2s linear infinite;
213
- }
214
- @keyframes LoadingSpinner {
215
- 0% {
216
- transform: rotate(0deg);
217
- }
218
- 100% {
219
- transform: rotate(360deg);
220
- }
221
- }
222
-
223
- </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
@@ -1,4 +0,0 @@
1
- import CasinoCalendar from './CasinoCalendar.svelte';
2
-
3
- !customElements.get('casino-calendar') && customElements.define('casino-calendar', CasinoCalendar);
4
- export default CasinoCalendar;
@@ -1,32 +0,0 @@
1
- export const TRANSLATIONS = {
2
- "en": {
3
- "topCategories": "Top Categories",
4
- "otherCategories": "Other Categories",
5
- "loading": "Loading, please wait...",
6
- "games": "games"
7
- },
8
- "hr": {
9
- "topCategories": "Najbolje kategorije",
10
- "otherCategories": "Ostale kategorije",
11
- "loading": "Učitavam",
12
- "games": "Igre"
13
- },
14
- "pt-br": {
15
- "topCategories": "Categorias Principais",
16
- "otherCategories": "Outras Categorias",
17
- "Loading": "Carregando, por favor espere...",
18
- "games": "jogos"
19
- },
20
- "es-mx": {
21
- "topCategories": "Categorias Principales",
22
- "otherCategories": "Otras Categorias",
23
- "Loading": "Cargando, por favor espere...",
24
- "games": "juegos"
25
- },
26
- "tr": {
27
- "topCategories": "En İyi Kategoriler",
28
- "otherCategories": "Diğer Kategoriler",
29
- "loading": "Yükleniyor, lütfen bekleyin...",
30
- "games": "oyunlar"
31
- }
32
- }
@@ -1,13 +0,0 @@
1
- import { html } from 'lit-element';
2
-
3
- import CasinoCalendar from '../src/CasinoCalendar';
4
-
5
- // This default export determines where your story goes in the story list
6
- export default {
7
- title: 'CasinoCalendar',
8
- };
9
-
10
- // 👇 We create a “template” of how args map to rendering
11
- const CasinoCalendar = ({ aProperty }) => html`<casino-calendar></casino-calendar>`;
12
-
13
- export const FirstStory = CasinoCalendar.bind({});
package/tsconfig.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "extends": "@tsconfig/svelte/tsconfig.json",
3
-
4
- "include": ["src/**/*"],
5
- "exclude": ["node_modules/*", "__sapper__/*", "public/*"]
6
- }