@everymatrix/general-about-us 1.0.69

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 (47) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/general-about-us.cjs.entry.js +251 -0
  3. package/dist/cjs/general-about-us.cjs.js +25 -0
  4. package/dist/cjs/index-f16005fe.js +1198 -0
  5. package/dist/cjs/index.cjs.js +2 -0
  6. package/dist/cjs/loader.cjs.js +15 -0
  7. package/dist/collection/collection-manifest.json +12 -0
  8. package/dist/collection/components/general-about-us/general-about-us.css +184 -0
  9. package/dist/collection/components/general-about-us/general-about-us.js +290 -0
  10. package/dist/collection/components/general-about-us/general-about-us.types.js +2 -0
  11. package/dist/collection/components/general-about-us/index.js +1 -0
  12. package/dist/collection/index.js +1 -0
  13. package/dist/collection/utils/chevron.svg +7 -0
  14. package/dist/collection/utils/locale.utils.js +32 -0
  15. package/dist/collection/utils/utils.js +56 -0
  16. package/dist/esm/app-globals-0f993ce5.js +3 -0
  17. package/dist/esm/general-about-us.entry.js +247 -0
  18. package/dist/esm/general-about-us.js +20 -0
  19. package/dist/esm/index-8f53f54c.js +1172 -0
  20. package/dist/esm/index.js +1 -0
  21. package/dist/esm/loader.js +11 -0
  22. package/dist/general-about-us/general-about-us.esm.js +1 -0
  23. package/dist/general-about-us/index.esm.js +0 -0
  24. package/dist/general-about-us/p-21732378.js +2 -0
  25. package/dist/general-about-us/p-bfa516ee.entry.js +1 -0
  26. package/dist/general-about-us/p-e1255160.js +1 -0
  27. package/dist/index.cjs.js +1 -0
  28. package/dist/index.js +1 -0
  29. package/dist/stencil.config.dev.js +17 -0
  30. package/dist/stencil.config.js +17 -0
  31. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/general-about-us/.stencil/packages/stencil/general-about-us/stencil.config.d.ts +2 -0
  32. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/general-about-us/.stencil/packages/stencil/general-about-us/stencil.config.dev.d.ts +2 -0
  33. package/dist/types/components/general-about-us/general-about-us.d.ts +44 -0
  34. package/dist/types/components/general-about-us/general-about-us.types.d.ts +17 -0
  35. package/dist/types/components/general-about-us/index.d.ts +1 -0
  36. package/dist/types/components.d.ts +85 -0
  37. package/dist/types/index.d.ts +1 -0
  38. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  39. package/dist/types/utils/locale.utils.d.ts +1 -0
  40. package/dist/types/utils/utils.d.ts +3 -0
  41. package/loader/cdn.js +1 -0
  42. package/loader/index.cjs.js +1 -0
  43. package/loader/index.d.ts +24 -0
  44. package/loader/index.es2017.js +1 -0
  45. package/loader/index.js +2 -0
  46. package/loader/package.json +11 -0
  47. package/package.json +26 -0
@@ -0,0 +1,247 @@
1
+ import { r as registerInstance, h } from './index-8f53f54c.js';
2
+
3
+ const DEFAULT_LANGUAGE = 'en';
4
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hu', 'hr'];
5
+ const TRANSLATIONS = {
6
+ en: {
7
+ error: 'Error',
8
+ noResults: 'Loading, please wait ...',
9
+ },
10
+ hu: {
11
+ error: 'Error',
12
+ noResults: 'Loading, please wait ...',
13
+ },
14
+ ro: {
15
+ error: 'Eroare',
16
+ noResults: 'Loading, please wait ...',
17
+ },
18
+ fr: {
19
+ error: 'Error',
20
+ noResults: 'Loading, please wait ...',
21
+ },
22
+ ar: {
23
+ error: 'خطأ',
24
+ noResults: 'Loading, please wait ...',
25
+ },
26
+ hr: {
27
+ error: 'Greška',
28
+ noResults: 'Učitavanje, molimo pričekajte ...',
29
+ }
30
+ };
31
+ const translate = (key, customLang) => {
32
+ const lang = customLang;
33
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
34
+ };
35
+
36
+ function checkDeviceType() {
37
+ const userAgent = navigator.userAgent.toLowerCase();
38
+ const width = screen.availWidth;
39
+ const height = screen.availHeight;
40
+ if (userAgent.includes('iphone')) {
41
+ return 'mobile';
42
+ }
43
+ if (userAgent.includes('android')) {
44
+ if (height > width && width < 800) {
45
+ return 'mobile';
46
+ }
47
+ if (width > height && height < 800) {
48
+ return 'tablet';
49
+ }
50
+ }
51
+ return 'desktop';
52
+ }
53
+ function checkCustomDeviceWidth() {
54
+ const width = screen.availWidth;
55
+ if (width < 600) {
56
+ return 'mobile';
57
+ }
58
+ else if (width >= 600 && width < 1100) {
59
+ return 'tablet';
60
+ }
61
+ }
62
+ function getDeviceCustom() {
63
+ const userAgent = navigator.userAgent.toLowerCase();
64
+ let source = '';
65
+ source = (userAgent.includes('android') || userAgent.includes('iphone') || userAgent.includes('ipad')) ? checkCustomDeviceWidth() : 'desktop';
66
+ return source;
67
+ }
68
+ const getDevice = () => {
69
+ let userAgent = window.navigator.userAgent.toLocaleLowerCase();
70
+ if (userAgent.includes('android/i'))
71
+ return 'android';
72
+ if (userAgent.includes('iphone/i'))
73
+ return 'iPhone';
74
+ if (userAgent.includes('ipad/i') || userAgent.includes('ipod/i'))
75
+ return 'iPad';
76
+ return 'PC';
77
+ };
78
+ const getDevicePlatform = () => {
79
+ const device = getDevice();
80
+ if (device) {
81
+ if (device === 'PC') {
82
+ return 'dk';
83
+ }
84
+ else if (device === 'iPad' || device === 'iPhone') {
85
+ return 'mtWeb';
86
+ }
87
+ else {
88
+ return 'mtWeb';
89
+ }
90
+ }
91
+ };
92
+
93
+ const chevronSvg = 'data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KDTwhLS0gVXBsb2FkZWQgdG86IFNWRyBSZXBvLCB3d3cuc3ZncmVwby5jb20sIFRyYW5zZm9ybWVkIGJ5OiBTVkcgUmVwbyBNaXhlciBUb29scyAtLT4KPH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inherit;\n}\n\nbutton {\n font-family: inherit;\n}\n\n.AboutUsError .ErrorInfo {\n color: var(--emw--color-error, #ed0909);\n}\n\n.AboutUsWrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n background-color: var(--emw--color-background, #000000);\n width: 100%;\n border-radius: var(--emw--border-radius-large, 15px);\n animation: fadeInAnimation ease 1.5s;\n animation-iteration-count: 1;\n animation-fill-mode: forwards;\n}\n\n@keyframes fadeInAnimation {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n.ItemImage {\n position: relative;\n width: 100%;\n max-width: 100%;\n height: 300px;\n border-radius: var(--emw--border-radius-large, 20px);\n background: var(--emw--color-background, black);\n}\n.ItemImage .ForegroundImage {\n z-index: 3;\n pointer-events: none;\n opacity: 1;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n transition: opacity 0.5s ease, filter 0.5s ease;\n border-radius: var(--emw--border-radius-large, 20px);\n}\n.ItemImage .BackgroundImage {\n position: absolute;\n left: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n transition: opacity 0.5s ease, filter 0.5s ease;\n border-radius: var(--emw--border-radius-large, 20px);\n z-index: 2;\n top: 20px;\n filter: blur(16px);\n opacity: 0.5;\n transform: scale(1.01);\n}\n.ItemImage .ItemDetails > div {\n position: relative;\n height: auto;\n max-width: 70%;\n display: flex;\n border-radius: var(--emw--border-radius-medium, 5px);\n margin: 0 20px;\n padding: 24px 20px;\n z-index: 10;\n overflow: hidden;\n align-items: center;\n}\n.ItemImage .Title {\n font-size: var(--emw--font-size-2x-large, 32px);\n font-weight: var(--emw--font-weight-bold, 700);\n color: var(--emw--color-typography, #D5F3DF);\n}\n.ItemImage .Title .FirstWord {\n font-size: var(--emw--font-size-2x-large, 36px);\n text-transform: uppercase;\n letter-spacing: 1px;\n background: var(--emw--color-primary, #1EC450);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n}\n.ItemImage .Description {\n font-size: var(--emw--font-size-small-plus, 16px);\n font-weight: var(--emw--font-weight-normal, 400);\n color: var(--emw--color-typography, #D5F3DF);\n}\n.ItemImage button {\n position: relative;\n width: 160px;\n padding: 10px 15px;\n color: var(--emw--button-text-color, #D5F3DF);\n font-size: var(--emw--font-size-large, 20px);\n border: var(--emw--button-border, 3px solid) var(--emw--button-border-color, #063B17);\n border-radius: var(--emw--button-border-radius, 50px);\n line-height: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n z-index: 20;\n margin-left: 32px;\n animation: ButtonEffect 4s linear infinite;\n background-image: linear-gradient(to right, var(--emw--color-primary, #22B04E), color-mix(in srgb, var(--emw--color-primary, #22B04E), black 30%), var(--emw--color-primary, #22B04E));\n background-size: 300% 100%;\n}\n.ItemImage button:hover {\n opacity: 0.8;\n}\n.ItemImage button img.Chevron {\n position: relative;\n height: var(--emw--size-standard, 16px);\n margin-left: var(--emw--spacing-small-minus, 10px);\n}\n@keyframes ButtonEffect {\n 0% {\n background-position: 0% 50%;\n }\n 33% {\n background-position: 100% 50%;\n }\n 66% {\n background-position: 200% 50%;\n }\n 100% {\n background-position: 300% 50%;\n }\n}\n\n@container (max-width: 475px) {\n .AboutUsWrapper {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n flex-wrap: wrap;\n gap: var(--emw--spacing-small-minus, 10px);\n max-width: 100%;\n background-color: var(--emw--color-background, #000000);\n animation: fadeInAnimation ease 1.5s;\n animation-iteration-count: 1;\n animation-fill-mode: forwards;\n }\n .AboutUsWrapper .ItemImage {\n flex: auto;\n width: 100%;\n flex-grow: 1;\n margin: 0;\n }\n .AboutUsWrapper .ItemDetails > div {\n flex: 1 1 0;\n display: flex;\n border-radius: var(--emw--border-radius-medium, 5px);\n gap: var(--emw--spacing-2x-small, 4px);\n padding: 20px 10px;\n align-items: center;\n }\n .AboutUsWrapper .Description {\n text-align: left;\n font-size: var(--emw--font-size-small, 14px);\n font-weight: var(--emw--font-weight-normal, 400);\n }\n .AboutUsWrapper button {\n padding-bottom: 10px;\n line-height: 15px;\n padding: 10px;\n }\n}";
96
+ const GeneralAboutUsStyle0 = generalAboutUsCss;
97
+
98
+ const GeneralAboutUs = class {
99
+ constructor(hostRef) {
100
+ registerInstance(this, hostRef);
101
+ this.handleClick = (url, target, location, isExternal) => {
102
+ window.postMessage({ type: 'NavigateTo', path: url, target: target, locations: location, externalLink: isExternal || false }, window.location.href);
103
+ // @ts-ignore Analytics event
104
+ if (typeof gtag == 'function') {
105
+ // @ts-ignore
106
+ gtag('event', 'GeneralAboutUs', {
107
+ 'context': 'AboutUsContent'
108
+ });
109
+ }
110
+ };
111
+ this.setImage = (image) => {
112
+ let source = '';
113
+ this.device = checkDeviceType();
114
+ switch (this.device) {
115
+ case 'mobile':
116
+ source = image.imageMobile;
117
+ break;
118
+ case 'tablet':
119
+ source = image.imageTablet;
120
+ break;
121
+ case 'desktop':
122
+ source = image.imageDesktop;
123
+ break;
124
+ }
125
+ return source;
126
+ };
127
+ this.setClientStyling = () => {
128
+ let sheet = document.createElement('style');
129
+ sheet.innerHTML = this.clientStyling;
130
+ this.stylingContainer.prepend(sheet);
131
+ };
132
+ this.setClientStylingURL = () => {
133
+ let url = new URL(this.clientStylingUrl);
134
+ let cssFile = document.createElement('style');
135
+ fetch(url.href)
136
+ .then((res) => res.text())
137
+ .then((data) => {
138
+ cssFile.innerHTML = data;
139
+ setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
140
+ })
141
+ .catch((err) => {
142
+ console.log('error ', err);
143
+ });
144
+ };
145
+ // end custom styling area
146
+ this.formatTitle = (title, language) => {
147
+ let firstWord, restOfTitle;
148
+ // Check for common languages that do not use space - here: Chinese, Japanese, Thai
149
+ if (['zh', 'ja', 'th'].includes(language)) {
150
+ firstWord = title.substring(0, 1);
151
+ restOfTitle = title.substring(1);
152
+ }
153
+ else {
154
+ const words = title.split(' ');
155
+ firstWord = words.shift();
156
+ restOfTitle = words.join(' ');
157
+ }
158
+ return h("div", { class: "Title" }, h("span", { class: "FirstWord" }, firstWord, " "), h("span", null, restOfTitle));
159
+ };
160
+ this.cmsEndpoint = undefined;
161
+ this.language = 'en';
162
+ this.userRoles = 'everyone';
163
+ this.cmsEnv = 'stage';
164
+ this.clientStyling = '';
165
+ this.clientStylingUrl = '';
166
+ this.hasErrors = false;
167
+ this.isLoading = true;
168
+ this.limitStylingAppends = false;
169
+ this.device = '';
170
+ }
171
+ watchEndpoint(newValue, oldValue) {
172
+ if (newValue && newValue != oldValue && this.cmsEndpoint) {
173
+ this.getAboutUs();
174
+ }
175
+ }
176
+ componentWillLoad() {
177
+ if (this.cmsEndpoint && this.language) {
178
+ return this.getAboutUs();
179
+ }
180
+ }
181
+ componentDidLoad() {
182
+ this.device = getDeviceCustom();
183
+ }
184
+ getAboutUs() {
185
+ let url = new URL(`${this.cmsEndpoint}/${this.language}/homepage`);
186
+ url.searchParams.append('env', this.cmsEnv);
187
+ url.searchParams.append('userRoles', this.userRoles);
188
+ url.searchParams.append('device', getDevicePlatform());
189
+ return new Promise((resolve, reject) => {
190
+ this.isLoading = true;
191
+ fetch(url.href)
192
+ .then((res) => res.json())
193
+ .then((aboutUsContent) => {
194
+ const keysToKeep = ['title', 'description', 'images', 'button', 'externalLink', 'targetType', 'locations'];
195
+ const aboutUsArrContent = Object.entries(aboutUsContent)
196
+ .filter(([key]) => keysToKeep.includes(key))
197
+ .reduce((acc, [key, value]) => {
198
+ acc[key] = value;
199
+ return acc;
200
+ }, {});
201
+ this.aboutUsData = aboutUsArrContent;
202
+ resolve(aboutUsArrContent);
203
+ }).catch((err) => {
204
+ console.error(err);
205
+ this.hasErrors = true;
206
+ reject(err);
207
+ }).finally(() => {
208
+ this.isLoading = false;
209
+ });
210
+ });
211
+ }
212
+ componentDidRender() {
213
+ // start custom styling area
214
+ if (!this.limitStylingAppends && this.stylingContainer) {
215
+ if (this.clientStyling)
216
+ this.setClientStyling();
217
+ if (this.clientStylingUrl)
218
+ this.setClientStylingURL();
219
+ this.limitStylingAppends = true;
220
+ }
221
+ }
222
+ render() {
223
+ var _a, _b, _c, _d, _e;
224
+ if (this.hasErrors) {
225
+ return (h("div", { class: "AboutUsError" }, h("div", { class: "ErrorInfo" }, translate('error', this.language))));
226
+ }
227
+ if (!this.isLoading) {
228
+ return (h("div", { ref: el => this.stylingContainer = el }, h("div", { class: "AboutUsWrapper" }, h("div", { class: "ItemImage" }, h("div", { class: "ForegroundImage", style: { background: `linear-gradient(to left, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.6) 100%),
229
+ linear-gradient(to bottom left, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 1) 100%),
230
+ linear-gradient(to bottom, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.6) 100%),
231
+ url(${this.setImage((_a = this.aboutUsData) === null || _a === void 0 ? void 0 : _a.images)}) no-repeat center center / cover` } }), h("img", { class: "BackgroundImage", src: this.setImage(this.aboutUsData.images), alt: "image" }), h("div", { class: "ItemDetails" }, this.formatTitle((_b = this.aboutUsData) === null || _b === void 0 ? void 0 : _b.title, this.language), h("div", { class: "Description", innerHTML: (_c = this.aboutUsData) === null || _c === void 0 ? void 0 : _c.description }), h("button", { class: "Button", onClick: () => {
232
+ var _a, _b, _c, _d, _e;
233
+ return this.handleClick((_b = (_a = this.aboutUsData) === null || _a === void 0 ? void 0 : _a.button) === null || _b === void 0 ? void 0 : _b.buttonUrl, (_c = this.aboutUsData) === null || _c === void 0 ? void 0 : _c.targetType, (_d = this.aboutUsData) === null || _d === void 0 ? void 0 : _d.locations, (_e = this.aboutUsData) === null || _e === void 0 ? void 0 : _e.externalLink);
234
+ } }, (_e = (_d = this.aboutUsData) === null || _d === void 0 ? void 0 : _d.button) === null || _e === void 0 ? void 0 :
235
+ _e.buttonText, h("img", { src: chevronSvg, alt: "right chevron", class: "Chevron" })))))));
236
+ }
237
+ }
238
+ static get watchers() { return {
239
+ "cmsEndpoint": ["watchEndpoint"],
240
+ "language": ["watchEndpoint"],
241
+ "userRoles": ["watchEndpoint"],
242
+ "device": ["watchEndpoint"]
243
+ }; }
244
+ };
245
+ GeneralAboutUs.style = GeneralAboutUsStyle0;
246
+
247
+ export { GeneralAboutUs as general_about_us };
@@ -0,0 +1,20 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-8f53f54c.js';
2
+ export { s as setNonce } from './index-8f53f54c.js';
3
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
4
+
5
+ /*
6
+ Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com
7
+ */
8
+ var patchBrowser = () => {
9
+ const importMeta = import.meta.url;
10
+ const opts = {};
11
+ if (importMeta !== "") {
12
+ opts.resourcesUrl = new URL(".", importMeta).href;
13
+ }
14
+ return promiseResolve(opts);
15
+ };
16
+
17
+ patchBrowser().then(async (options) => {
18
+ await globalScripts();
19
+ return bootstrapLazy([["general-about-us",[[1,"general-about-us",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"hasErrors":[32],"isLoading":[32],"limitStylingAppends":[32],"device":[32]},null,{"cmsEndpoint":["watchEndpoint"],"language":["watchEndpoint"],"userRoles":["watchEndpoint"],"device":["watchEndpoint"]}]]]], options);
20
+ });