@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,5 @@
1
+ 'use strict';
2
+
3
+ const globalScripts = () => {};
4
+
5
+ exports.globalScripts = globalScripts;
@@ -0,0 +1,251 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-f16005fe.js');
6
+
7
+ const DEFAULT_LANGUAGE = 'en';
8
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hu', 'hr'];
9
+ const TRANSLATIONS = {
10
+ en: {
11
+ error: 'Error',
12
+ noResults: 'Loading, please wait ...',
13
+ },
14
+ hu: {
15
+ error: 'Error',
16
+ noResults: 'Loading, please wait ...',
17
+ },
18
+ ro: {
19
+ error: 'Eroare',
20
+ noResults: 'Loading, please wait ...',
21
+ },
22
+ fr: {
23
+ error: 'Error',
24
+ noResults: 'Loading, please wait ...',
25
+ },
26
+ ar: {
27
+ error: 'خطأ',
28
+ noResults: 'Loading, please wait ...',
29
+ },
30
+ hr: {
31
+ error: 'Greška',
32
+ noResults: 'Učitavanje, molimo pričekajte ...',
33
+ }
34
+ };
35
+ const translate = (key, customLang) => {
36
+ const lang = customLang;
37
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
38
+ };
39
+
40
+ function checkDeviceType() {
41
+ const userAgent = navigator.userAgent.toLowerCase();
42
+ const width = screen.availWidth;
43
+ const height = screen.availHeight;
44
+ if (userAgent.includes('iphone')) {
45
+ return 'mobile';
46
+ }
47
+ if (userAgent.includes('android')) {
48
+ if (height > width && width < 800) {
49
+ return 'mobile';
50
+ }
51
+ if (width > height && height < 800) {
52
+ return 'tablet';
53
+ }
54
+ }
55
+ return 'desktop';
56
+ }
57
+ function checkCustomDeviceWidth() {
58
+ const width = screen.availWidth;
59
+ if (width < 600) {
60
+ return 'mobile';
61
+ }
62
+ else if (width >= 600 && width < 1100) {
63
+ return 'tablet';
64
+ }
65
+ }
66
+ function getDeviceCustom() {
67
+ const userAgent = navigator.userAgent.toLowerCase();
68
+ let source = '';
69
+ source = (userAgent.includes('android') || userAgent.includes('iphone') || userAgent.includes('ipad')) ? checkCustomDeviceWidth() : 'desktop';
70
+ return source;
71
+ }
72
+ const getDevice = () => {
73
+ let userAgent = window.navigator.userAgent.toLocaleLowerCase();
74
+ if (userAgent.includes('android/i'))
75
+ return 'android';
76
+ if (userAgent.includes('iphone/i'))
77
+ return 'iPhone';
78
+ if (userAgent.includes('ipad/i') || userAgent.includes('ipod/i'))
79
+ return 'iPad';
80
+ return 'PC';
81
+ };
82
+ const getDevicePlatform = () => {
83
+ const device = getDevice();
84
+ if (device) {
85
+ if (device === 'PC') {
86
+ return 'dk';
87
+ }
88
+ else if (device === 'iPad' || device === 'iPhone') {
89
+ return 'mtWeb';
90
+ }
91
+ else {
92
+ return 'mtWeb';
93
+ }
94
+ }
95
+ };
96
+
97
+ const chevronSvg = 'data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KDTwh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oiLz4gPC9nPiA8L2c+IDwvZz4KDTwvc3ZnPg==';
98
+
99
+ const generalAboutUsCss = ":host {\n display: block;\n font-family: inherit;\n}\n\np {\n margin: 0;\n padding: 0;\n font-family: 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}";
100
+ const GeneralAboutUsStyle0 = generalAboutUsCss;
101
+
102
+ const GeneralAboutUs = class {
103
+ constructor(hostRef) {
104
+ index.registerInstance(this, hostRef);
105
+ this.handleClick = (url, target, location, isExternal) => {
106
+ window.postMessage({ type: 'NavigateTo', path: url, target: target, locations: location, externalLink: isExternal || false }, window.location.href);
107
+ // @ts-ignore Analytics event
108
+ if (typeof gtag == 'function') {
109
+ // @ts-ignore
110
+ gtag('event', 'GeneralAboutUs', {
111
+ 'context': 'AboutUsContent'
112
+ });
113
+ }
114
+ };
115
+ this.setImage = (image) => {
116
+ let source = '';
117
+ this.device = checkDeviceType();
118
+ switch (this.device) {
119
+ case 'mobile':
120
+ source = image.imageMobile;
121
+ break;
122
+ case 'tablet':
123
+ source = image.imageTablet;
124
+ break;
125
+ case 'desktop':
126
+ source = image.imageDesktop;
127
+ break;
128
+ }
129
+ return source;
130
+ };
131
+ this.setClientStyling = () => {
132
+ let sheet = document.createElement('style');
133
+ sheet.innerHTML = this.clientStyling;
134
+ this.stylingContainer.prepend(sheet);
135
+ };
136
+ this.setClientStylingURL = () => {
137
+ let url = new URL(this.clientStylingUrl);
138
+ let cssFile = document.createElement('style');
139
+ fetch(url.href)
140
+ .then((res) => res.text())
141
+ .then((data) => {
142
+ cssFile.innerHTML = data;
143
+ setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
144
+ })
145
+ .catch((err) => {
146
+ console.log('error ', err);
147
+ });
148
+ };
149
+ // end custom styling area
150
+ this.formatTitle = (title, language) => {
151
+ let firstWord, restOfTitle;
152
+ // Check for common languages that do not use space - here: Chinese, Japanese, Thai
153
+ if (['zh', 'ja', 'th'].includes(language)) {
154
+ firstWord = title.substring(0, 1);
155
+ restOfTitle = title.substring(1);
156
+ }
157
+ else {
158
+ const words = title.split(' ');
159
+ firstWord = words.shift();
160
+ restOfTitle = words.join(' ');
161
+ }
162
+ return index.h("div", { class: "Title" }, index.h("span", { class: "FirstWord" }, firstWord, " "), index.h("span", null, restOfTitle));
163
+ };
164
+ this.cmsEndpoint = undefined;
165
+ this.language = 'en';
166
+ this.userRoles = 'everyone';
167
+ this.cmsEnv = 'stage';
168
+ this.clientStyling = '';
169
+ this.clientStylingUrl = '';
170
+ this.hasErrors = false;
171
+ this.isLoading = true;
172
+ this.limitStylingAppends = false;
173
+ this.device = '';
174
+ }
175
+ watchEndpoint(newValue, oldValue) {
176
+ if (newValue && newValue != oldValue && this.cmsEndpoint) {
177
+ this.getAboutUs();
178
+ }
179
+ }
180
+ componentWillLoad() {
181
+ if (this.cmsEndpoint && this.language) {
182
+ return this.getAboutUs();
183
+ }
184
+ }
185
+ componentDidLoad() {
186
+ this.device = getDeviceCustom();
187
+ }
188
+ getAboutUs() {
189
+ let url = new URL(`${this.cmsEndpoint}/${this.language}/homepage`);
190
+ url.searchParams.append('env', this.cmsEnv);
191
+ url.searchParams.append('userRoles', this.userRoles);
192
+ url.searchParams.append('device', getDevicePlatform());
193
+ return new Promise((resolve, reject) => {
194
+ this.isLoading = true;
195
+ fetch(url.href)
196
+ .then((res) => res.json())
197
+ .then((aboutUsContent) => {
198
+ const keysToKeep = ['title', 'description', 'images', 'button', 'externalLink', 'targetType', 'locations'];
199
+ const aboutUsArrContent = Object.entries(aboutUsContent)
200
+ .filter(([key]) => keysToKeep.includes(key))
201
+ .reduce((acc, [key, value]) => {
202
+ acc[key] = value;
203
+ return acc;
204
+ }, {});
205
+ this.aboutUsData = aboutUsArrContent;
206
+ resolve(aboutUsArrContent);
207
+ }).catch((err) => {
208
+ console.error(err);
209
+ this.hasErrors = true;
210
+ reject(err);
211
+ }).finally(() => {
212
+ this.isLoading = false;
213
+ });
214
+ });
215
+ }
216
+ componentDidRender() {
217
+ // start custom styling area
218
+ if (!this.limitStylingAppends && this.stylingContainer) {
219
+ if (this.clientStyling)
220
+ this.setClientStyling();
221
+ if (this.clientStylingUrl)
222
+ this.setClientStylingURL();
223
+ this.limitStylingAppends = true;
224
+ }
225
+ }
226
+ render() {
227
+ var _a, _b, _c, _d, _e;
228
+ if (this.hasErrors) {
229
+ return (index.h("div", { class: "AboutUsError" }, index.h("div", { class: "ErrorInfo" }, translate('error', this.language))));
230
+ }
231
+ if (!this.isLoading) {
232
+ return (index.h("div", { ref: el => this.stylingContainer = el }, index.h("div", { class: "AboutUsWrapper" }, index.h("div", { class: "ItemImage" }, index.h("div", { class: "ForegroundImage", style: { background: `linear-gradient(to left, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.6) 100%),
233
+ linear-gradient(to bottom left, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 1) 100%),
234
+ linear-gradient(to bottom, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.6) 100%),
235
+ url(${this.setImage((_a = this.aboutUsData) === null || _a === void 0 ? void 0 : _a.images)}) no-repeat center center / cover` } }), index.h("img", { class: "BackgroundImage", src: this.setImage(this.aboutUsData.images), alt: "image" }), index.h("div", { class: "ItemDetails" }, this.formatTitle((_b = this.aboutUsData) === null || _b === void 0 ? void 0 : _b.title, this.language), index.h("div", { class: "Description", innerHTML: (_c = this.aboutUsData) === null || _c === void 0 ? void 0 : _c.description }), index.h("button", { class: "Button", onClick: () => {
236
+ var _a, _b, _c, _d, _e;
237
+ 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);
238
+ } }, (_e = (_d = this.aboutUsData) === null || _d === void 0 ? void 0 : _d.button) === null || _e === void 0 ? void 0 :
239
+ _e.buttonText, index.h("img", { src: chevronSvg, alt: "right chevron", class: "Chevron" })))))));
240
+ }
241
+ }
242
+ static get watchers() { return {
243
+ "cmsEndpoint": ["watchEndpoint"],
244
+ "language": ["watchEndpoint"],
245
+ "userRoles": ["watchEndpoint"],
246
+ "device": ["watchEndpoint"]
247
+ }; }
248
+ };
249
+ GeneralAboutUs.style = GeneralAboutUsStyle0;
250
+
251
+ exports.general_about_us = GeneralAboutUs;
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-f16005fe.js');
6
+ const appGlobals = require('./app-globals-3a1e7e63.js');
7
+
8
+ /*
9
+ Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com
10
+ */
11
+ var patchBrowser = () => {
12
+ const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('general-about-us.cjs.js', document.baseURI).href));
13
+ const opts = {};
14
+ if (importMeta !== "") {
15
+ opts.resourcesUrl = new URL(".", importMeta).href;
16
+ }
17
+ return index.promiseResolve(opts);
18
+ };
19
+
20
+ patchBrowser().then(async (options) => {
21
+ await appGlobals.globalScripts();
22
+ return index.bootstrapLazy([["general-about-us.cjs",[[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);
23
+ });
24
+
25
+ exports.setNonce = index.setNonce;