@everymatrix/player-elevate-level 1.31.2 → 1.32.4

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.
Files changed (87) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +5 -4
  3. package/dist/cjs/bonus-elevate-levels_8.cjs.entry.js +0 -919
  4. package/dist/cjs/index-c706b0d2.js +0 -1726
  5. package/dist/cjs/index.cjs.js +0 -2
  6. package/dist/cjs/loader.cjs.js +0 -21
  7. package/dist/cjs/player-elevate-card-items-31eb5d57.js +0 -2477
  8. package/dist/cjs/player-elevate-card.cjs.entry.js +0 -77
  9. package/dist/cjs/player-elevate-level.cjs.js +0 -19
  10. package/dist/cjs/player-elevate-pointcard.cjs.entry.js +0 -84
  11. package/dist/collection/collection-manifest.json +0 -37
  12. package/dist/collection/components/player-elevate-level/player-elevate-level.css +0 -13
  13. package/dist/collection/components/player-elevate-level/player-elevate-level.js +0 -212
  14. package/dist/collection/index.js +0 -1
  15. package/dist/collection/utils/utils.js +0 -0
  16. package/dist/components/bonus-elevate-levels.js +0 -6
  17. package/dist/components/bonus-elevate-levels2.js +0 -133
  18. package/dist/components/elevate-level-list.js +0 -6
  19. package/dist/components/elevate-level-list2.js +0 -177
  20. package/dist/components/elevate-level-presentation.js +0 -6
  21. package/dist/components/elevate-level-presentation2.js +0 -31
  22. package/dist/components/elevate-levels-data.js +0 -6
  23. package/dist/components/elevate-levels-data2.js +0 -102
  24. package/dist/components/general-styling-wrapper.js +0 -6
  25. package/dist/components/general-styling-wrapper2.js +0 -103
  26. package/dist/components/index.d.ts +0 -26
  27. package/dist/components/index.js +0 -1
  28. package/dist/components/player-elevate-card-data.js +0 -6
  29. package/dist/components/player-elevate-card-data2.js +0 -624
  30. package/dist/components/player-elevate-card-items.js +0 -2250
  31. package/dist/components/player-elevate-card.js +0 -118
  32. package/dist/components/player-elevate-level.d.ts +0 -11
  33. package/dist/components/player-elevate-level.js +0 -107
  34. package/dist/components/player-elevate-loyaltycard.js +0 -6
  35. package/dist/components/player-elevate-loyaltycard2.js +0 -121
  36. package/dist/components/player-elevate-pointcard.js +0 -127
  37. package/dist/esm/bonus-elevate-levels_8.entry.js +0 -908
  38. package/dist/esm/index-104132db.js +0 -1696
  39. package/dist/esm/index.js +0 -1
  40. package/dist/esm/loader.js +0 -17
  41. package/dist/esm/player-elevate-card-items-289d91dc.js +0 -2464
  42. package/dist/esm/player-elevate-card.entry.js +0 -73
  43. package/dist/esm/player-elevate-level.js +0 -17
  44. package/dist/esm/player-elevate-pointcard.entry.js +0 -80
  45. package/dist/esm/polyfills/core-js.js +0 -11
  46. package/dist/esm/polyfills/css-shim.js +0 -1
  47. package/dist/esm/polyfills/dom.js +0 -79
  48. package/dist/esm/polyfills/es5-html-element.js +0 -1
  49. package/dist/esm/polyfills/index.js +0 -34
  50. package/dist/esm/polyfills/system.js +0 -6
  51. package/dist/index.cjs.js +0 -1
  52. package/dist/index.js +0 -1
  53. package/dist/player-elevate-level/index.esm.js +0 -0
  54. package/dist/player-elevate-level/p-34b6a7b6.entry.js +0 -1
  55. package/dist/player-elevate-level/p-46fd6f51.js +0 -1
  56. package/dist/player-elevate-level/p-b67b6b93.entry.js +0 -1
  57. package/dist/player-elevate-level/p-c73cc225.entry.js +0 -1
  58. package/dist/player-elevate-level/p-f43f6ed2.js +0 -1
  59. package/dist/player-elevate-level/player-elevate-level.esm.js +0 -1
  60. package/dist/static/button-default.svg +0 -42
  61. package/dist/static/button-disabled.svg +0 -4
  62. package/dist/static/button-hover.svg +0 -4
  63. package/dist/static/button-level.svg +0 -27
  64. package/dist/static/button-pressed.svg +0 -18
  65. package/dist/static/button-redeem.svg +0 -36
  66. package/dist/static/card-ground-over.png +0 -0
  67. package/dist/static/card-ground-over.svg +0 -903
  68. package/dist/static/card-ground.png +0 -0
  69. package/dist/static/card-ground.svg +0 -34
  70. package/dist/static/info.svg +0 -4
  71. package/dist/static/level-badge.png +0 -0
  72. package/dist/static/level-percent.svg +0 -80
  73. package/dist/static/tips-info.svg +0 -21
  74. package/dist/static/user.svg +0 -3
  75. package/dist/stencil.config.js +0 -25
  76. package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/emfe-widgets/widgets-stencil/packages/player-elevate-level/.stencil/packages/player-elevate-level/stencil.config.d.ts +0 -2
  77. package/dist/types/components/player-elevate-level/player-elevate-level.d.ts +0 -43
  78. package/dist/types/components.d.ts +0 -109
  79. package/dist/types/index.d.ts +0 -1
  80. package/dist/types/stencil-public-runtime.d.ts +0 -1565
  81. package/dist/types/utils/utils.d.ts +0 -0
  82. package/loader/cdn.js +0 -3
  83. package/loader/index.cjs.js +0 -3
  84. package/loader/index.d.ts +0 -12
  85. package/loader/index.es2017.js +0 -3
  86. package/loader/index.js +0 -4
  87. package/loader/package.json +0 -10
@@ -1,177 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
-
3
- const DEFAULT_LANGUAGE = 'en';
4
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hu', 'hr'];
5
- const TRANSLATIONS = {
6
- en: {
7
- seeAll: 'See All',
8
- termsAndConditions: 'Terms & Conditions',
9
- loadElevateLevelErrorMessage: 'Error when load elevate levels',
10
- noLevelsSet: 'There is no level set',
11
- },
12
- fr: {
13
- seeAll: 'See All',
14
- termsAndConditions: 'Terms & Conditions',
15
- loadElevateLevelErrorMessage: 'Error when load elevate levels',
16
- noLevelsSet: 'There is no level set',
17
- },
18
- hr: {
19
- level: 'Razina',
20
- seeAll: 'Vidi sve',
21
- privilegesFor: 'Privilegije za',
22
- termsAndConditions: 'Uvjeti i odredbe',
23
- noLevelsSet: 'There is no level set',
24
- }
25
- };
26
- const translate = (key, customLang) => {
27
- const lang = customLang;
28
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
29
- };
30
-
31
- /**
32
- * @name isMobile
33
- * @description A method that returns if the browser used to access the app is from a mobile device or not
34
- * @param {String} userAgent window.navigator.userAgent
35
- * @returns {Boolean} true or false
36
- */
37
- const isMobile = (userAgent) => {
38
- return !!(userAgent.toLowerCase().match(/android/i) ||
39
- userAgent.toLowerCase().match(/blackberry|bb/i) ||
40
- userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
41
- userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
42
- };
43
- var MOVE_TO;
44
- (function (MOVE_TO) {
45
- MOVE_TO[MOVE_TO["slideToRight"] = 1] = "slideToRight";
46
- MOVE_TO[MOVE_TO["slideToLeft"] = -1] = "slideToLeft";
47
- })(MOVE_TO || (MOVE_TO = {}));
48
-
49
- const elevateLevelListCss = "elevate-level-list{display:flex;flex-direction:row}.LevelItemsWrapper{display:flex;flex:1;margin-top:10px;min-height:30px;transition-property:all;position:relative;height:138px;overflow-x:hidden}.Mobile.LevelItems{overflow-x:hidden}.LevelItems{overflow-x:auto;display:flex;flex-direction:row;gap:10px;left:0;position:absolute;transition:left 0.5s ease-in-out}.LevelItems .Item:hover,.LevelItems .Item.Active{background-color:var(--emfe-w-color-gray-50, #f4f4f4);box-shadow:0px 4px 13px 0px rgba(0, 0, 0, 0.25)}.LevelItems .Item{width:86px;height:125px;border-radius:15px;text-align:center;display:flex;flex-direction:column;cursor:pointer}.LevelItems .Item .LevelName{font-size:13px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.LevelItems .Item .LevelPoints{color:var(--emfe-w-color-gray-100, #767171);font-size:10px}.LevelItems .Item .LevelImg{width:65px;height:68px;margin:11px auto}.SliderButton{display:flex;width:29px;align-items:center;cursor:pointer}.SliderButton.Disabled svg{stroke:var(--emfe-w-color-gray-50, #cbc5c5)}.SliderButton.Hidden{display:none}";
50
-
51
- const ElevateLevelList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
52
- constructor() {
53
- super();
54
- this.__registerHost();
55
- this.selectedLevelChanged = createEvent(this, "selectedLevelChanged", 7);
56
- this.isShowSliderButton = false;
57
- this.offset = 0;
58
- this.minOffset = 0;
59
- this.isMobile = isMobile(window.navigator.userAgent);
60
- }
61
- onLevelClicked(elevateLevel) {
62
- this.selectedLevelChanged.emit({ level: elevateLevel });
63
- this.selectedLevelId = elevateLevel.id;
64
- }
65
- levelsChangedHandler() {
66
- this.initOffsetOfLevelItems();
67
- }
68
- initOffsetOfLevelItems() {
69
- if (!this.levels || this.levels.length == 0 || !this.selectedLevelId) {
70
- return;
71
- }
72
- const currentLevelIndex = this.levels.findIndex((item) => {
73
- return this.selectedLevelId == item.id;
74
- });
75
- this.onLevelClicked(this.levels[currentLevelIndex == -1 ? 0 : currentLevelIndex]);
76
- //do not need change the slider offset when level items less than moveCountForOneTouch
77
- if (this.levels.length <= this.moveCountForOneTouch) {
78
- return;
79
- }
80
- //to avoid the slider do not move when currentLevelIndex = moveCountForOneTouch - 1
81
- let newOffset = Math.floor((currentLevelIndex == -1 ? 1 : currentLevelIndex + 1) / this.moveCountForOneTouch)
82
- * this.moveCountForOneTouch * this.childElementWidth * (-1);
83
- this.offset = newOffset <= this.minOffset ? this.minOffset : (newOffset >= 0 ? 0 : newOffset);
84
- }
85
- onTouchStart(e) {
86
- this.touchPosStart = { clientX: e.touches[0].clientX, clientY: e.touches[0].clientY };
87
- }
88
- onTouchMove(e) {
89
- this.touchPosEnd = { clientX: e.touches[0].clientX, clientY: e.touches[0].clientY };
90
- const diffX = this.touchPosEnd.clientX - this.touchPosStart.clientX;
91
- const diffY = this.touchPosEnd.clientY - this.touchPosStart.clientY;
92
- if (Math.abs(diffX) > Math.abs(diffY)) {
93
- this.slideTo(diffX > 0 ? MOVE_TO.slideToRight : MOVE_TO.slideToLeft);
94
- }
95
- }
96
- slideTo(direction) {
97
- let newOffset = this.levelsElement.offsetLeft +
98
- (this.childElementWidth) * this.moveCountForOneTouch * direction;
99
- if (newOffset % this.childElementWidth != 0) {
100
- const leftOfPreNode = (Math.floor(newOffset / this.childElementWidth)) * this.childElementWidth;
101
- const leftOfNextNode = (Math.ceil(newOffset / this.childElementWidth)) * this.childElementWidth;
102
- //touchmove to right, get left of pre-node; touchmove to left, get left of next-node
103
- newOffset = direction == MOVE_TO.slideToRight ? leftOfPreNode : leftOfNextNode;
104
- }
105
- this.offset = newOffset < this.minOffset ? this.minOffset : (newOffset >= 0 ? 0 : newOffset);
106
- }
107
- initLevelSlider() {
108
- var _a;
109
- if (!((_a = this.levelsElement) === null || _a === void 0 ? void 0 : _a.firstElementChild)) {
110
- console.log('Widget[elevate-level-list] DOM is not ready.');
111
- return;
112
- }
113
- this.isShowSliderButton = !this.isMobile && (this.levelsElement.clientWidth > this.levelsElement.parentElement.clientWidth);
114
- this.minOffset = this.levelsElement.parentElement.clientWidth - this.levelsElement.clientWidth;
115
- this.childElementWidth = this.levelsElement.firstElementChild.clientWidth;
116
- this.moveCountForOneTouch = Math.ceil(this.levelsElement.parentElement.clientWidth / this.childElementWidth) - 1;
117
- const childElementCount = this.levelsElement.childElementCount;
118
- this.childElementWidth += (this.levelsElement.clientWidth - this.childElementWidth * childElementCount) / (childElementCount - 1);
119
- }
120
- debounce(callback, delay) {
121
- {
122
- let timer;
123
- return () => {
124
- clearTimeout(timer);
125
- timer = setTimeout(() => {
126
- callback();
127
- }, delay);
128
- };
129
- }
130
- }
131
- ;
132
- handleResize() {
133
- this.debounce(this.initLevelSlider.bind(this), 200)();
134
- }
135
- componentDidRender() {
136
- this.host.componentOnReady().then(() => {
137
- this.initLevelSlider();
138
- });
139
- }
140
- render() {
141
- return (h(Host, null, this.levels && [
142
- h("div", { class: `SliderButton LeftButton ${this.offset == 0 ? 'Disabled' : ''} ${this.isShowSliderButton ? '' : 'Hidden'}`, onClick: () => this.slideTo(MOVE_TO.slideToRight) }, h("svg", { fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M15 19l-7-7 7-7" }))),
143
- h("div", { class: 'LevelItemsWrapper' }, h("div", { style: { 'left': `${this.offset}px` }, class: `LevelItems ${this.isMobile ? 'Mobile' : ''}`, id: 'levelItems', ref: (el) => { this.levelsElement = el; } }, this.levels.map((level, idx) => {
144
- return (h("div", { class: `Item ${this.selectedLevelId == level.id ? 'Active' : ''}`, onClick: this.onLevelClicked.bind(this, level) }, h("img", { alt: `Presentation Icon for ${level.presentation.displayName}`, class: "LevelImg", src: level.presentation.asset }), h("span", { class: "LevelName", title: level.presentation.displayName }, level.presentation.displayName), h("span", { class: "LevelPoints" }, idx == 0 ? '' : '>', level.firstEntryPoints, ' ', translate('points', this.language))));
145
- }))),
146
- h("div", { class: `SliderButton RightButton ${this.offset <= this.minOffset ? 'Disabled' : ''} ${this.isShowSliderButton ? '' : 'Hidden'}`, onClick: () => this.slideTo(MOVE_TO.slideToLeft) }, h("svg", { fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" })))
147
- ]));
148
- }
149
- get host() { return this; }
150
- static get watchers() { return {
151
- "selectedLevelId": ["levelsChangedHandler"]
152
- }; }
153
- static get style() { return elevateLevelListCss; }
154
- }, [0, "elevate-level-list", {
155
- "levels": [16],
156
- "language": [1],
157
- "selectedLevelId": [1537, "selected-level-id"],
158
- "isShowSliderButton": [32],
159
- "touchPosStart": [32],
160
- "touchPosEnd": [32],
161
- "offset": [32]
162
- }, [[1, "touchstart", "onTouchStart"], [1, "touchmove", "onTouchMove"], [9, "resize", "handleResize"]]]);
163
- function defineCustomElement() {
164
- if (typeof customElements === "undefined") {
165
- return;
166
- }
167
- const components = ["elevate-level-list"];
168
- components.forEach(tagName => { switch (tagName) {
169
- case "elevate-level-list":
170
- if (!customElements.get(tagName)) {
171
- customElements.define(tagName, ElevateLevelList);
172
- }
173
- break;
174
- } });
175
- }
176
-
177
- export { ElevateLevelList as E, TRANSLATIONS as T, defineCustomElement as d, translate as t };
@@ -1,6 +0,0 @@
1
- import { E as ElevateLevelPresentation$1, d as defineCustomElement$1 } from './elevate-level-presentation2.js';
2
-
3
- const ElevateLevelPresentation = ElevateLevelPresentation$1;
4
- const defineCustomElement = defineCustomElement$1;
5
-
6
- export { ElevateLevelPresentation, defineCustomElement };
@@ -1,31 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
-
3
- const elevateLevelPresentationCss = ":host{display:block}.PriviliegeList{padding-inline-start:5px}.PriviliegeList li{display:flex}.PriviliegeList li .Img{width:80px}.PriviliegeList li .Img img{width:60px;margin:10px}.PriviliegeList li .Content h4{text-transform:capitalize;margin-block-start:10px}";
4
-
5
- const ElevateLevelPresentation = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
- constructor() {
7
- super();
8
- this.__registerHost();
9
- }
10
- render() {
11
- return h(Host, null, h("div", { class: "Row Desc" }, h("h3", null, this.elevateLevel.presentation.displayName), h("p", null, h("span", { class: "TxtDesc", innerHTML: this.elevateLevel.presentation.description }))));
12
- }
13
- static get style() { return elevateLevelPresentationCss; }
14
- }, [0, "elevate-level-presentation", {
15
- "elevateLevel": [16]
16
- }]);
17
- function defineCustomElement() {
18
- if (typeof customElements === "undefined") {
19
- return;
20
- }
21
- const components = ["elevate-level-presentation"];
22
- components.forEach(tagName => { switch (tagName) {
23
- case "elevate-level-presentation":
24
- if (!customElements.get(tagName)) {
25
- customElements.define(tagName, ElevateLevelPresentation);
26
- }
27
- break;
28
- } });
29
- }
30
-
31
- export { ElevateLevelPresentation as E, defineCustomElement as d };
@@ -1,6 +0,0 @@
1
- import { E as ElevateLevelsData$1, d as defineCustomElement$1 } from './elevate-levels-data2.js';
2
-
3
- const ElevateLevelsData = ElevateLevelsData$1;
4
- const defineCustomElement = defineCustomElement$1;
5
-
6
- export { ElevateLevelsData, defineCustomElement };
@@ -1,102 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, createEvent } from '@stencil/core/internal/client';
2
-
3
- function createCommonjsModule(fn, basedir, module) {
4
- return module = {
5
- path: basedir,
6
- exports: {},
7
- require: function (path, base) {
8
- return commonjsRequire();
9
- }
10
- }, fn(module, module.exports), module.exports;
11
- }
12
-
13
- function commonjsRequire () {
14
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
15
- }
16
-
17
- var browser = createCommonjsModule(function (module, exports) {
18
-
19
- // ref: https://github.com/tc39/proposal-global
20
- var getGlobal = function () {
21
- // the only reliable means to get the global object is
22
- // `Function('return this')()`
23
- // However, this causes CSP violations in Chrome apps.
24
- if (typeof self !== 'undefined') { return self; }
25
- if (typeof window !== 'undefined') { return window; }
26
- if (typeof global !== 'undefined') { return global; }
27
- throw new Error('unable to locate global object');
28
- };
29
-
30
- var global = getGlobal();
31
-
32
- module.exports = exports = global.fetch;
33
-
34
- // Needed for TypeScript and Webpack.
35
- if (global.fetch) {
36
- exports.default = global.fetch.bind(global);
37
- }
38
-
39
- exports.Headers = global.Headers;
40
- exports.Request = global.Request;
41
- exports.Response = global.Response;
42
- });
43
-
44
- const elevateLevelsDataCss = ":host{display:block}";
45
-
46
- const ElevateLevelsData = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
47
- constructor() {
48
- super();
49
- this.__registerHost();
50
- this.elevateLevelsDataChange = createEvent(this, "elevateLevelsDataChange", 7);
51
- }
52
- async componentWillLoad() {
53
- //load data
54
- if (!this.scopeParams.endpoint) {
55
- return;
56
- }
57
- const endpoint = this.scopeParams.endpoint;
58
- let url = new URL(`${endpoint}/v1/elevate/levels?language=${this.scopeParams.language}`);
59
- await browser(url.href)
60
- .then((res) => res.json())
61
- .then((res) => {
62
- const elevateLevels = res.data.sort((a, b) => {
63
- return a.firstEntryPoints < b.firstEntryPoints ? -1 : 1;
64
- });
65
- let selectedLevelId = this.scopeParams.selectedLevelId;
66
- // if selected level is not set, set first(basic) as default
67
- if (!selectedLevelId && this.scopeParams.showDefault && elevateLevels.length > 0) {
68
- selectedLevelId = elevateLevels[0].id;
69
- }
70
- if (selectedLevelId) {
71
- // get current level by name
72
- const currentLevel = elevateLevels.filter((item) => {
73
- return item.id == selectedLevelId;
74
- })[0];
75
- this.elevateLevelsDataChange.emit({ currentLevel: currentLevel });
76
- }
77
- this.elevateLevelsDataChange.emit({ 'clearError': true });
78
- this.elevateLevelsDataChange.emit({ 'elevateLevels': elevateLevels });
79
- }).catch((err) => {
80
- this.elevateLevelsDataChange.emit({ errorMessage: { type: 'errorWhenLoadElevateLevels', err } });
81
- console.error(err);
82
- });
83
- }
84
- static get style() { return elevateLevelsDataCss; }
85
- }, [0, "elevate-levels-data", {
86
- "scopeParams": [1544, "scope-params"]
87
- }]);
88
- function defineCustomElement() {
89
- if (typeof customElements === "undefined") {
90
- return;
91
- }
92
- const components = ["elevate-levels-data"];
93
- components.forEach(tagName => { switch (tagName) {
94
- case "elevate-levels-data":
95
- if (!customElements.get(tagName)) {
96
- customElements.define(tagName, ElevateLevelsData);
97
- }
98
- break;
99
- } });
100
- }
101
-
102
- export { ElevateLevelsData as E, defineCustomElement as d };
@@ -1,6 +0,0 @@
1
- import { G as GeneralStylingWrapper$1, d as defineCustomElement$1 } from './general-styling-wrapper2.js';
2
-
3
- const GeneralStylingWrapper = GeneralStylingWrapper$1;
4
- const defineCustomElement = defineCustomElement$1;
5
-
6
- export { GeneralStylingWrapper, defineCustomElement };
@@ -1,103 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
-
3
- const mergeTranslations = (url, target) => {
4
- return new Promise((resolve) => {
5
- fetch(url)
6
- .then((res) => res.json())
7
- .then((data) => {
8
- Object.keys(data).forEach((item) => {
9
- target[item] = target[item] ? target[item] : {};
10
- for (let key in data[item]) {
11
- target[item][key] = data[item][key];
12
- }
13
- });
14
- resolve(true);
15
- });
16
- });
17
- };
18
-
19
- const generalStylingWrapperCss = ":host{display:block}";
20
-
21
- const GeneralStylingWrapper = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
22
- constructor() {
23
- super();
24
- this.__registerHost();
25
- /**
26
- * Client custom styling via inline styles
27
- */
28
- this.clientStyling = '';
29
- /**
30
- * Client custom styling via url
31
- */
32
- this.clientStylingUrl = '';
33
- /**
34
- * Translation via url
35
- */
36
- this.translationUrl = '';
37
- this.stylingAppends = false;
38
- this.setClientStyling = () => {
39
- let sheet = document.createElement('style');
40
- sheet.innerHTML = this.clientStyling;
41
- this.el.prepend(sheet);
42
- };
43
- this.setClientStylingURL = () => {
44
- let url = new URL(this.clientStylingUrl);
45
- let cssFile = document.createElement('style');
46
- fetch(url.href)
47
- .then((res) => res.text())
48
- .then((data) => {
49
- cssFile.innerHTML = data;
50
- setTimeout(() => {
51
- this.el.prepend(cssFile);
52
- }, 1);
53
- })
54
- .catch((err) => {
55
- console.log('error ', err);
56
- });
57
- };
58
- }
59
- componentDidRender() {
60
- // start custom styling area
61
- if (!this.stylingAppends) {
62
- if (this.clientStyling)
63
- this.setClientStyling();
64
- if (this.clientStylingUrl)
65
- this.setClientStylingURL();
66
- this.stylingAppends = true;
67
- }
68
- // end custom styling area
69
- }
70
- async componentWillLoad() {
71
- const promises = [];
72
- if (this.translationUrl) {
73
- const translationPromise = mergeTranslations(this.translationUrl, this.targetTranslations);
74
- promises.push(translationPromise);
75
- }
76
- return await Promise.all(promises);
77
- }
78
- render() {
79
- return (h("div", { class: "StyleShell" }, h("slot", { name: "mainContent" })));
80
- }
81
- get el() { return this; }
82
- static get style() { return generalStylingWrapperCss; }
83
- }, [4, "general-styling-wrapper", {
84
- "clientStyling": [1, "client-styling"],
85
- "clientStylingUrl": [1, "client-styling-url"],
86
- "translationUrl": [1, "translation-url"],
87
- "targetTranslations": [16]
88
- }]);
89
- function defineCustomElement() {
90
- if (typeof customElements === "undefined") {
91
- return;
92
- }
93
- const components = ["general-styling-wrapper"];
94
- components.forEach(tagName => { switch (tagName) {
95
- case "general-styling-wrapper":
96
- if (!customElements.get(tagName)) {
97
- customElements.define(tagName, GeneralStylingWrapper);
98
- }
99
- break;
100
- } });
101
- }
102
-
103
- export { GeneralStylingWrapper as G, defineCustomElement as d };
@@ -1,26 +0,0 @@
1
- /* PlayerElevateLevel custom elements */
2
-
3
- import type { Components, JSX } from "../types/components";
4
-
5
- /**
6
- * Used to manually set the base path where assets can be found.
7
- * If the script is used as "module", it's recommended to use "import.meta.url",
8
- * such as "setAssetPath(import.meta.url)". Other options include
9
- * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
10
- * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
11
- * But do note that this configuration depends on how your script is bundled, or lack of
12
- * bundling, and where your assets can be loaded from. Additionally custom bundling
13
- * will have to ensure the static assets are copied to its build directory.
14
- */
15
- export declare const setAssetPath: (path: string) => void;
16
-
17
- export interface SetPlatformOptions {
18
- raf?: (c: FrameRequestCallback) => number;
19
- ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
20
- rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
21
- }
22
- export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
23
-
24
- export type { Components, JSX };
25
-
26
- export * from '../types';
@@ -1 +0,0 @@
1
- export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
@@ -1,6 +0,0 @@
1
- import { P as PlayerElevateCardData$1, d as defineCustomElement$1 } from './player-elevate-card-data2.js';
2
-
3
- const PlayerElevateCardData = PlayerElevateCardData$1;
4
- const defineCustomElement = defineCustomElement$1;
5
-
6
- export { PlayerElevateCardData, defineCustomElement };