@everymatrix/player-elevate-card 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/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/general-styling-wrapper_5.cjs.entry.js +649 -785
- package/dist/cjs/index-b1cf5517.js +1634 -0
- package/dist/cjs/loader.cjs.js +7 -13
- package/dist/cjs/player-elevate-card.cjs.js +17 -11
- package/dist/collection/collection-manifest.json +6 -6
- package/dist/collection/components/player-elevate-card/index.js +1 -0
- package/dist/collection/components/player-elevate-card/player-elevate-card-items.js +17 -38
- package/dist/collection/components/player-elevate-card/player-elevate-card.css +0 -1
- package/dist/collection/components/player-elevate-card/player-elevate-card.js +271 -287
- package/dist/collection/components/player-elevate-card-data/player-elevate-card-data.css +1 -1
- package/dist/collection/components/player-elevate-card-data/player-elevate-card-data.js +224 -215
- package/dist/collection/components/player-elevate-loyaltycard/player-elevate-loyaltycard.css +0 -7
- package/dist/collection/components/player-elevate-loyaltycard/player-elevate-loyaltycard.js +277 -297
- package/dist/collection/components/player-elevate-pointcard/player-elevate-pointcard.js +309 -329
- package/dist/collection/utils/locale.utils.js +133 -133
- package/dist/collection/utils/utils.js +49 -49
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/general-styling-wrapper_5.entry.js +649 -785
- package/dist/esm/index-cd7a4beb.js +1604 -0
- package/dist/esm/loader.js +7 -13
- package/dist/esm/player-elevate-card.js +14 -11
- package/dist/player-elevate-card/p-37a424ba.entry.js +1 -0
- package/dist/player-elevate-card/p-ba534fa2.js +2 -0
- package/dist/player-elevate-card/p-e1255160.js +1 -0
- package/dist/player-elevate-card/player-elevate-card.esm.js +1 -1
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +12 -27
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/player-elevate-card/.stencil/packages/stencil/player-elevate-card/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/player-elevate-card/.stencil/packages/stencil/player-elevate-card/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/player-elevate-card/index.d.ts +1 -0
- package/dist/types/components/player-elevate-card/player-elevate-card-items.d.ts +6 -6
- package/dist/types/components/player-elevate-card/player-elevate-card.d.ts +51 -51
- package/dist/types/components/player-elevate-card-data/player-elevate-card-data.d.ts +19 -20
- package/dist/types/components/player-elevate-loyaltycard/player-elevate-loyaltycard.d.ts +51 -51
- package/dist/types/components/player-elevate-pointcard/player-elevate-pointcard.d.ts +64 -64
- package/dist/types/components.d.ts +16 -1
- package/dist/types/models/player-elevate.d.ts +26 -26
- package/dist/types/stencil-public-runtime.d.ts +142 -33
- package/dist/types/utils/locale.utils.d.ts +6 -6
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +13 -1
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/loader/package.json +1 -0
- package/package.json +8 -6
- package/dist/cjs/index-b6d0684c.js +0 -1674
- package/dist/components/general-styling-wrapper.js +0 -6
- package/dist/components/general-styling-wrapper2.js +0 -103
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/components/player-elevate-card-data.d.ts +0 -11
- package/dist/components/player-elevate-card-data.js +0 -6
- package/dist/components/player-elevate-card-data2.js +0 -635
- package/dist/components/player-elevate-card-items.js +0 -2250
- package/dist/components/player-elevate-card.d.ts +0 -11
- package/dist/components/player-elevate-card.js +0 -126
- package/dist/components/player-elevate-loyaltycard.d.ts +0 -11
- package/dist/components/player-elevate-loyaltycard.js +0 -132
- package/dist/components/player-elevate-pointcard.d.ts +0 -11
- package/dist/components/player-elevate-pointcard.js +0 -135
- package/dist/components/static/button-default.svg +0 -42
- package/dist/components/static/button-disabled.svg +0 -4
- package/dist/components/static/button-hover.svg +0 -4
- package/dist/components/static/button-level.svg +0 -27
- package/dist/components/static/button-pressed.svg +0 -18
- package/dist/components/static/button-redeem.svg +0 -36
- package/dist/components/static/card-ground-over.png +0 -0
- package/dist/components/static/card-ground-over.svg +0 -903
- package/dist/components/static/card-ground.png +0 -0
- package/dist/components/static/card-ground.svg +0 -34
- package/dist/components/static/info.svg +0 -4
- package/dist/components/static/level-badge.png +0 -0
- package/dist/components/static/level-percent.svg +0 -80
- package/dist/components/static/tips-info.svg +0 -21
- package/dist/components/static/user.svg +0 -3
- package/dist/esm/index-6beb1563.js +0 -1645
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/player-elevate-card/p-10bf1b0e.entry.js +0 -1
- package/dist/player-elevate-card/p-523c2803.js +0 -1
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/player-elevate-card/.stencil/packages/player-elevate-card/stencil.config.d.ts +0 -2
|
@@ -1,144 +1,144 @@
|
|
|
1
1
|
const DEFAULT_LANGUAGE = 'en';
|
|
2
2
|
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
3
3
|
export const TRANSLATIONS = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
4
|
+
en: {
|
|
5
|
+
redeem: 'Redeem',
|
|
6
|
+
expireOn: 'Expire on ',
|
|
7
|
+
pointsToBeExpired: '${expirationPoints} points to expire in ${expireDay} days',
|
|
8
|
+
pointsToBeExpiredDay: '${expirationPoints} points to expire in ${expireDay} day',
|
|
9
|
+
pointsToBeExpiredHours: '${expirationPoints} points to expire in ${expireDay} hours',
|
|
10
|
+
pointsToBeExpiredHour: '${expirationPoints} points to expire in ${expireDay} hour',
|
|
11
|
+
tipsForNextLevel: 'Need ${pointsToReach} to reach ${levelName}',
|
|
12
|
+
spendablePoints: 'Spendable Points:',
|
|
13
|
+
details: 'Details',
|
|
14
|
+
earningRules: 'Earning Rules',
|
|
15
|
+
xp: 'XP',
|
|
16
|
+
sp: 'Coins',
|
|
17
|
+
termAndConditions: 'Term & Conditions',
|
|
18
|
+
},
|
|
19
|
+
'zh-hk': {
|
|
20
|
+
redeem: '兑奖',
|
|
21
|
+
expireOn: 'Expire on ',
|
|
22
|
+
pointsToBeExpired: '${expirationPoints} points to expire in ${expireDay} days',
|
|
23
|
+
pointsToBeExpiredDay: '${expirationPoints} points to expire in ${expireDay} day',
|
|
24
|
+
pointsToBeExpiredHours: '${expirationPoints} points to expire in ${expireDay} hours',
|
|
25
|
+
pointsToBeExpiredHour: '${expirationPoints} points to expire in ${expireDay} hour',
|
|
26
|
+
tipsForNextLevel: 'Need ${pointsToReach} to reach ${levelName}',
|
|
27
|
+
spendablePoints: 'Spendable Points:',
|
|
28
|
+
details: '明细',
|
|
29
|
+
earningRules: 'Earning Rules',
|
|
30
|
+
xp: 'XP',
|
|
31
|
+
sp: 'Coins',
|
|
32
|
+
termAndConditions: 'Term & Conditions',
|
|
33
|
+
},
|
|
34
|
+
de: {
|
|
35
|
+
redeem: 'Redeem',
|
|
36
|
+
expireOn: 'Expire on ',
|
|
37
|
+
pointsToBeExpired: '${expirationPoints} points to expire in ${expireDay} days',
|
|
38
|
+
pointsToBeExpiredDay: '${expirationPoints} points to expire in ${expireDay} day',
|
|
39
|
+
pointsToBeExpiredHours: '${expirationPoints} points to expire in ${expireDay} hours',
|
|
40
|
+
pointsToBeExpiredHour: '${expirationPoints} points to expire in ${expireDay} hour',
|
|
41
|
+
tipsForNextLevel: 'Need ${pointsToReach} to reach ${levelName}',
|
|
42
|
+
spendablePoints: 'Spendable Points:',
|
|
43
|
+
details: 'Details',
|
|
44
|
+
earningRules: 'Earning Rules',
|
|
45
|
+
xp: 'XP',
|
|
46
|
+
sp: 'Coins',
|
|
47
|
+
termAndConditions: 'Term & Conditions',
|
|
48
|
+
},
|
|
49
|
+
it: {
|
|
50
|
+
redeem: 'Redeem',
|
|
51
|
+
expireOn: 'Expire on ',
|
|
52
|
+
pointsToBeExpired: '${expirationPoints} points to expire in ${expireDay} days',
|
|
53
|
+
pointsToBeExpiredDay: '${expirationPoints} points to expire in ${expireDay} day',
|
|
54
|
+
pointsToBeExpiredHours: '${expirationPoints} points to expire in ${expireDay} hours',
|
|
55
|
+
pointsToBeExpiredHour: '${expirationPoints} points to expire in ${expireDay} hour',
|
|
56
|
+
tipsForNextLevel: 'Need ${pointsToReach} to reach ${levelName}',
|
|
57
|
+
spendablePoints: 'Spendable Points:',
|
|
58
|
+
details: 'Details',
|
|
59
|
+
earningRules: 'Earning Rules',
|
|
60
|
+
xp: 'XP',
|
|
61
|
+
sp: 'Coins',
|
|
62
|
+
termAndConditions: 'Term & Conditions',
|
|
63
|
+
},
|
|
64
|
+
fr: {
|
|
65
|
+
redeem: 'Redeem',
|
|
66
|
+
expireOn: 'Expire on ',
|
|
67
|
+
pointsToBeExpired: '${expirationPoints} points to expire in ${expireDay} days',
|
|
68
|
+
pointsToBeExpiredDay: '${expirationPoints} points to expire in ${expireDay} day',
|
|
69
|
+
pointsToBeExpiredHours: '${expirationPoints} points to expire in ${expireDay} hours',
|
|
70
|
+
pointsToBeExpiredHour: '${expirationPoints} points to expire in ${expireDay} hour',
|
|
71
|
+
tipsForNextLevel: 'Need ${pointsToReach} to reach ${levelName}',
|
|
72
|
+
spendablePoints: 'Spendable Points:',
|
|
73
|
+
details: 'Details',
|
|
74
|
+
earningRules: 'Earning Rules',
|
|
75
|
+
xp: 'XP',
|
|
76
|
+
sp: 'Coins',
|
|
77
|
+
termAndConditions: 'Term & Conditions',
|
|
78
|
+
},
|
|
79
|
+
es: {
|
|
80
|
+
redeem: 'Redeem'
|
|
81
|
+
},
|
|
82
|
+
tr: {
|
|
83
|
+
redeem: 'Redeem'
|
|
84
|
+
},
|
|
85
|
+
ru: {
|
|
86
|
+
redeem: 'Redeem'
|
|
87
|
+
},
|
|
88
|
+
ro: {
|
|
89
|
+
redeem: 'Redeem'
|
|
90
|
+
},
|
|
91
|
+
hr: {
|
|
92
|
+
redeem: 'Otkupiti',
|
|
93
|
+
expireOn: 'Istječe',
|
|
94
|
+
pointsToBeExpired: '${expirationPoints} bodova ističe za ${expireDay} dana',
|
|
95
|
+
tipsForNextLevel: 'Trebate ${pointsToReach} da dosegnete razinu ${levelName}',
|
|
96
|
+
spendablePoints: 'Bodovi za potrošit:',
|
|
97
|
+
details: 'Detalji',
|
|
98
|
+
xp: 'XP',
|
|
99
|
+
},
|
|
100
|
+
hu: {
|
|
101
|
+
redeem: 'Redeem'
|
|
102
|
+
},
|
|
103
|
+
pl: {
|
|
104
|
+
redeem: 'Redeem'
|
|
105
|
+
},
|
|
106
|
+
pt: {
|
|
107
|
+
redeem: 'Redeem'
|
|
108
|
+
},
|
|
109
|
+
sl: {
|
|
110
|
+
redeem: 'Redeem'
|
|
111
|
+
},
|
|
112
|
+
sr: {
|
|
113
|
+
redeem: 'Redeem'
|
|
114
|
+
}
|
|
115
115
|
};
|
|
116
116
|
export const translate = (key, customLang) => {
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
const lang = customLang;
|
|
118
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
119
119
|
};
|
|
120
120
|
export const translateWithParams = (key, params) => {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
121
|
+
const lang = params['lang'];
|
|
122
|
+
let templateString = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
123
|
+
if (!params) {
|
|
124
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
125
|
+
}
|
|
126
|
+
Object.keys(params).forEach((paramName) => {
|
|
127
|
+
templateString = templateString.replace(new RegExp('\\$\{' + paramName + '\}', 'gm'), params[paramName]);
|
|
128
|
+
});
|
|
129
|
+
return templateString;
|
|
130
130
|
};
|
|
131
131
|
export const getTranslations = (url) => {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
132
|
+
return new Promise((resolve) => {
|
|
133
|
+
fetch(url)
|
|
134
|
+
.then((res) => res.json())
|
|
135
|
+
.then((data) => {
|
|
136
|
+
Object.keys(data).forEach((item) => {
|
|
137
|
+
for (let key in data[item]) {
|
|
138
|
+
TRANSLATIONS[item][key] = data[item][key];
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
resolve(true);
|
|
142
|
+
});
|
|
142
143
|
});
|
|
143
|
-
});
|
|
144
144
|
};
|
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
export function updateProgressSvg(progressElementRef, percent) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
2
|
+
const svgElement = progressElementRef.querySelector('#total_level');
|
|
3
|
+
const endLockWidth = 17, pointR = 6.5;
|
|
4
|
+
//Total Widget of the progress
|
|
5
|
+
const barWidth = svgElement.getBBox().width;
|
|
6
|
+
//The filled width according to current progress
|
|
7
|
+
const levelPercent = percent > 1 ? 1 : percent;
|
|
8
|
+
const widthOnBar = (levelPercent * barWidth - endLockWidth) < 0 ? 0 : levelPercent * barWidth - endLockWidth;
|
|
9
|
+
//update bar's width, widthOnBar
|
|
10
|
+
const levelBar = progressElementRef.querySelector('#current_level');
|
|
11
|
+
//update filters, x = widthOnBar
|
|
12
|
+
const levelFilter = progressElementRef.querySelector('#filter_current_level');
|
|
13
|
+
//update circle, widthOnBar+10
|
|
14
|
+
const levelCircle = progressElementRef.querySelector('#circle_current_level');
|
|
15
|
+
svgElement.setAttribute('viewbox', `0 0 ${widthOnBar} 28`);
|
|
16
|
+
levelBar.setAttribute('width', `${widthOnBar}`);
|
|
17
|
+
levelCircle.setAttribute('cx', `${(widthOnBar < pointR ? pointR : widthOnBar)}`);
|
|
18
|
+
levelFilter.setAttribute('x', `${widthOnBar - 8}`);
|
|
19
|
+
//update lock location
|
|
20
|
+
const endLockElement = progressElementRef.querySelector('#lock');
|
|
21
|
+
// wrapper of endLock, include ball and heatfilter1_d_305_23
|
|
22
|
+
const filter1 = progressElementRef.querySelector('#filter_heart_ball');
|
|
23
|
+
// ball in endlockfilter2_i_305_23
|
|
24
|
+
const filter2 = progressElementRef.querySelector('#filter_ball');
|
|
25
|
+
// heart in endlockfilter3_d_305_23
|
|
26
|
+
const filter3 = progressElementRef.querySelector('#filter_heart');
|
|
27
|
+
//wrapper of lockfilter4_d_305_23
|
|
28
|
+
const filterLock = progressElementRef.querySelector('#filter_lock');
|
|
29
|
+
// shadow of ball paint0_linear_305_23
|
|
30
|
+
const paint0 = progressElementRef.querySelector('#paint0_linear_ball');
|
|
31
|
+
//paint in lockpaint1_linear_305_23
|
|
32
|
+
const paint1 = progressElementRef.querySelector('#paint1_linear_lock');
|
|
33
|
+
// box of lock and heart, for move position dynamically
|
|
34
|
+
const lockBox = progressElementRef.querySelector('#lock_box');
|
|
35
|
+
const heartBox = progressElementRef.querySelector('#heart_box');
|
|
36
|
+
const rightPaddingOfLockWidth = 10, cxOfEndLockEle = barWidth - rightPaddingOfLockWidth;
|
|
37
|
+
//set cx of lockElement
|
|
38
|
+
endLockElement.setAttribute('cx', `${cxOfEndLockEle}`);
|
|
39
|
+
//set cx of sub Elements
|
|
40
|
+
paint1.setAttribute('x1', `${cxOfEndLockEle}`);
|
|
41
|
+
paint1.setAttribute('x2', `${cxOfEndLockEle}`);
|
|
42
|
+
paint0.setAttribute('x1', `${cxOfEndLockEle - 6}`);
|
|
43
|
+
paint0.setAttribute('x2', `${cxOfEndLockEle - 6 + 11.2}`);
|
|
44
|
+
filterLock.setAttribute('x', `${cxOfEndLockEle - 6}`);
|
|
45
|
+
filter3.setAttribute('x', `${cxOfEndLockEle - 6 - 2}`);
|
|
46
|
+
filter2.setAttribute('x', `${cxOfEndLockEle - 6 - 2 - 2}`);
|
|
47
|
+
filter1.setAttribute('x', `${cxOfEndLockEle - 6 - 2 - 2 - 4}`);
|
|
48
|
+
lockBox.setAttribute('x', `${cxOfEndLockEle - 6}`);
|
|
49
|
+
heartBox.setAttribute('x', `${cxOfEndLockEle - 6}`);
|
|
50
|
+
svgElement.parentElement.style.opacity = '1';
|
|
51
51
|
}
|