@everymatrix/lottery-program-wof 1.44.0 → 1.45.3
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/lottery-program-wof.cjs +1 -0
- package/es2015/lottery-program-wof.js +16 -0
- package/package.json +14 -37
- package/CHANGELOG.md +0 -12
- package/README.md +0 -30
- package/babel.config.js +0 -6
- package/dist/lottery-program-wof.js +0 -11886
- package/dist/lottery-program-wof.js.map +0 -1
- package/index.html +0 -42
- 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/LotteryProgramWof.svelte +0 -214
- package/src/api/api.ts +0 -2016
- package/src/api/configuration.ts +0 -65
- package/src/api/custom.d.ts +0 -2
- package/src/api/index.ts +0 -15
- package/src/business.partition.ts +0 -98
- package/src/business.ts +0 -186
- package/src/calc.point.ts +0 -67
- package/src/calc.temp.ts +0 -29
- package/src/calc.ts +0 -28
- package/src/class.process.ts +0 -130
- package/src/class.spinable.ts +0 -60
- package/src/class.spinable.util.ts +0 -10
- package/src/class.spinner.ts +0 -176
- package/src/class.spinner.util.ts +0 -92
- package/src/class.svgcalc.ts +0 -249
- package/src/i18n.ts +0 -38
- package/src/images/Thankyou_1.svg +0 -100
- package/src/images/Thankyou_2.svg +0 -112
- package/src/images/Thankyou_3.svg +0 -87
- package/src/images/Thankyou_4.svg +0 -114
- package/src/images/gift.svg +0 -964
- package/src/images/theme.bg.blackring.svg +0 -10
- package/src/images/theme.bg.halo.svg +0 -27
- package/src/images/theme1Bg3.svg +0 -15
- package/src/images/theme2Arrow.svg +0 -24
- package/src/images/theme2Bg3.svg +0 -11
- package/src/images/theme2Center.svg +0 -36
- package/src/images/theme3Arrow.svg +0 -25
- package/src/images/theme3Bg1.svg +0 -29
- package/src/images/theme3Bg2.svg +0 -19
- package/src/images/theme3Center.svg +0 -77
- package/src/images/theme7Arrow.svg +0 -67
- package/src/images/theme7Bg1.svg +0 -786
- package/src/images/theme7Bg2.svg +0 -40
- package/src/images/theme7Bg3.svg +0 -26
- package/src/images/theme7Center.svg +0 -72
- package/src/images/theme7Light.svg +0 -17
- package/src/images/themeCenter1.svg +0 -76
- package/src/images/themeCenter2.svg +0 -58
- package/src/images/themePartitionLight.svg +0 -19
- package/src/images/themePointerArea.svg +0 -44
- package/src/images/themeShadow.svg +0 -27
- package/src/index.ts +0 -4
- package/src/message.ts +0 -28
- package/src/private.item.svelte +0 -172
- package/src/private.item.svg.scss +0 -302
- package/src/private.item.svg.svelte +0 -356
- package/src/private.loader.svelte +0 -61
- package/src/private.message.svelte +0 -236
- package/src/private.outcomes.svelte +0 -203
- package/src/private.tabs.svelte +0 -106
- package/src/themes.image.center.ts +0 -68
- package/src/themes.ts +0 -52
- package/src/translations.js +0 -218
- package/src/types.business.ts +0 -20
- package/src/types.ts +0 -79
- package/src/util.ts +0 -90
- package/src/widget.ts +0 -27
- package/stories/LotteryProgramWof.stories.js +0 -13
- package/svelte.config.js +0 -7
- package/tsconfig.json +0 -11
package/src/types.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
namespace svelte.JSX {
|
|
3
|
-
interface SVGProps<T> {
|
|
4
|
-
part?: string
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface Point {
|
|
10
|
-
x: number;
|
|
11
|
-
y: number;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export enum PointerMode {
|
|
15
|
-
Arrow = "Arrow",
|
|
16
|
-
Partition = "Partition",
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export enum ArrowMode {
|
|
20
|
-
DownFromTop = "DownFromTop",
|
|
21
|
-
UpFromCenter = "UpFromCenter",
|
|
22
|
-
DownFromCenter = "DownFromCenter",
|
|
23
|
-
UpFromBottom = "UpFromBottom",
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export enum Api {
|
|
27
|
-
lotteries = 'lotteries',
|
|
28
|
-
outcome = 'outcome',
|
|
29
|
-
draw = 'draw',
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface ApiConfigs {
|
|
33
|
-
[Api.lotteries]: {
|
|
34
|
-
session?: string
|
|
35
|
-
},
|
|
36
|
-
[Api.outcome]: {
|
|
37
|
-
session?: string
|
|
38
|
-
id: string
|
|
39
|
-
},
|
|
40
|
-
[Api.draw]: {
|
|
41
|
-
session?: string
|
|
42
|
-
id: string
|
|
43
|
-
guid: string
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export enum Lang {
|
|
49
|
-
en = 'en',
|
|
50
|
-
fr = 'fr',
|
|
51
|
-
de = 'de',
|
|
52
|
-
tr = 'tr'
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
type StringWithLang = {
|
|
56
|
-
[key in Lang]: string
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface Partition {
|
|
60
|
-
name: StringWithLang
|
|
61
|
-
image1: StringWithLang
|
|
62
|
-
image2: StringWithLang
|
|
63
|
-
image3: StringWithLang
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
export enum Tab {
|
|
68
|
-
Program = 'Program',
|
|
69
|
-
History = 'History'
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export enum ContentDirection {
|
|
73
|
-
clockwise = 1,
|
|
74
|
-
anticlockwise = -1,
|
|
75
|
-
outward = 0,
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
package/src/util.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
export const imageLoader = (src: string) => {
|
|
2
|
-
return new Promise((resolve, reject) => {
|
|
3
|
-
let img = new Image()
|
|
4
|
-
img.onload = () => resolve(img)
|
|
5
|
-
img.onerror = reject
|
|
6
|
-
img.src = src
|
|
7
|
-
})
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const clamp = (num: number, min: number, max?: number) => {
|
|
11
|
-
if(max){
|
|
12
|
-
return Math.min(Math.max(num, min), max)
|
|
13
|
-
}else{
|
|
14
|
-
return Math.max(num, min)
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const imageLoaderSvg = (src: string) => {
|
|
19
|
-
return new Promise((resolve, reject) => {
|
|
20
|
-
let img = document.createElementNS("http://www.w3.org/2000/svg", "image")
|
|
21
|
-
img.onload = () => resolve(img)
|
|
22
|
-
img.onerror = () => resolve(img) //reject
|
|
23
|
-
img.href.baseVal = src
|
|
24
|
-
})
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const cvtCaseFromCamelToKebab = (text: string) =>
|
|
28
|
-
text
|
|
29
|
-
.split(/(?=[A-Z])/)
|
|
30
|
-
.map(s => s.toLocaleLowerCase())
|
|
31
|
-
.join('-')
|
|
32
|
-
|
|
33
|
-
export const setProps = <T extends Element>(element: T, props: any) => {
|
|
34
|
-
Object.keys(props).map(_key => {
|
|
35
|
-
element.setAttribute(cvtCaseFromCamelToKebab(_key), props[_key])
|
|
36
|
-
})
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export const setPropsSVG = <T extends SVGElement>(element: T, props: any) => {
|
|
40
|
-
Object.keys(props).map(_key => {
|
|
41
|
-
element.setAttributeNS("http://www.w3.org/2000/svg", cvtCaseFromCamelToKebab(_key), props[_key])
|
|
42
|
-
})
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export const delay = (time: number) => new Promise(res => setTimeout(res, time * 1000));
|
|
46
|
-
|
|
47
|
-
type MapObjectValueToTuple<T extends Object> = T[keyof T][]
|
|
48
|
-
|
|
49
|
-
export const mapObjectValueToTuple =
|
|
50
|
-
<T>(object: T): MapObjectValueToTuple<T> =>
|
|
51
|
-
Object.keys(object).map(key => object[key])
|
|
52
|
-
|
|
53
|
-
interface fetcherArgs {
|
|
54
|
-
path: string,
|
|
55
|
-
params?: Object,
|
|
56
|
-
options?: RequestInit
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export const fetcher = async (config: fetcherArgs) => {
|
|
60
|
-
|
|
61
|
-
const { path, params = {}, options = {} } = config
|
|
62
|
-
|
|
63
|
-
const url = new URL(path)
|
|
64
|
-
|
|
65
|
-
Object.keys(params).map(_key => {
|
|
66
|
-
url.searchParams.append(_key, params[_key])
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
return await fetchBase(url, options)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
export const fetchBase = async (input: RequestInfo | URL, init: RequestInit = {}): Promise<Response> => {
|
|
74
|
-
|
|
75
|
-
let res: any
|
|
76
|
-
try {
|
|
77
|
-
res = await fetch(input, init)
|
|
78
|
-
res = await res.text()
|
|
79
|
-
res = JSON.parse(res)
|
|
80
|
-
} catch (e) {
|
|
81
|
-
throw new Error(e.message)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return res
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export const isSafari = () => {
|
|
88
|
-
var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
89
|
-
return isSafari;
|
|
90
|
-
}
|
package/src/widget.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { addNewMessages } from "./i18n";
|
|
2
|
-
import { fetchBase, fetcher } from "./util";
|
|
3
|
-
|
|
4
|
-
export const setTranslation = (translations) => {
|
|
5
|
-
Object.keys(translations).forEach((item:any):void => {
|
|
6
|
-
addNewMessages(item, translations[item]);
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const setTranslationUrl = async (translationurl) => {
|
|
11
|
-
|
|
12
|
-
const res = await fetchBase(translationurl)
|
|
13
|
-
|
|
14
|
-
setTranslation(res)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const setClientStyling = (container, clientstyling) => {
|
|
18
|
-
let sheet = document.createElement('style');
|
|
19
|
-
sheet.innerHTML = clientstyling;
|
|
20
|
-
container.appendChild(sheet);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const setClientStylingURL = async (clientstylingurl, callback) => {
|
|
24
|
-
const res = await fetch(clientstylingurl)
|
|
25
|
-
const clientstyling = await res.text()
|
|
26
|
-
callback(clientstyling)
|
|
27
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit-element';
|
|
2
|
-
|
|
3
|
-
import LotteryProgramWof from '../src/LotteryProgramWof';
|
|
4
|
-
|
|
5
|
-
// This default export determines where your story goes in the story list
|
|
6
|
-
export default {
|
|
7
|
-
title: 'LotteryProgramWof',
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
// 👇 We create a “template” of how args map to rendering
|
|
11
|
-
const LotteryProgramWof = ({ aProperty }) => html`<lottery-program-wof></lottery-program-wof>`;
|
|
12
|
-
|
|
13
|
-
export const FirstStory = LotteryProgramWof.bind({});
|
package/svelte.config.js
DELETED