@everymatrix/user-action-controller 1.44.0 → 1.45.0
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/index-c5061e5a.js +1315 -0
- package/dist/cjs/loader.cjs.js +7 -13
- package/dist/cjs/player-user-consents_2.cjs.entry.js +457 -495
- package/dist/cjs/user-action-controller.cjs.js +17 -11
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/user-action-controller/index.js +1 -0
- package/dist/collection/components/user-action-controller/user-action-controller.js +408 -414
- package/dist/collection/utils/locale.utils.js +70 -70
- package/dist/collection/utils/utils.js +1 -1
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-02b86e76.js +1288 -0
- package/dist/esm/loader.js +7 -13
- package/dist/esm/player-user-consents_2.entry.js +457 -495
- package/dist/esm/user-action-controller.js +14 -11
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +14 -19
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-action-controller/.stencil/packages/stencil/user-action-controller/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-action-controller/.stencil/packages/stencil/user-action-controller/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/user-action-controller/index.d.ts +1 -0
- package/dist/types/components/user-action-controller/user-action-controller.d.ts +68 -68
- package/dist/types/stencil-public-runtime.d.ts +142 -33
- package/dist/user-action-controller/p-b996e8b8.js +2 -0
- package/dist/user-action-controller/p-d7fbd383.entry.js +1 -0
- package/dist/user-action-controller/p-e1255160.js +1 -0
- package/dist/user-action-controller/user-action-controller.esm.js +1 -1
- 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 +9 -2
- package/dist/cjs/index-87049e21.js +0 -1300
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/components/player-user-consents.js +0 -6
- package/dist/components/player-user-consents2.js +0 -257
- package/dist/components/user-action-controller.d.ts +0 -11
- package/dist/components/user-action-controller.js +0 -365
- package/dist/esm/index-71f14530.js +0 -1274
- 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/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/user-action-controller/.stencil/packages/user-action-controller/stencil.config.d.ts +0 -2
- package/dist/user-action-controller/p-2dc9103a.entry.js +0 -1
- package/dist/user-action-controller/p-ba444709.js +0 -1
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
const DEFAULT_LANGUAGE = 'en';
|
|
2
2
|
const TRANSLATIONS = {
|
|
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
|
-
|
|
3
|
+
en: {
|
|
4
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
5
|
+
smsTitle: 'SMS marketing',
|
|
6
|
+
emailMarketingTitle: 'Email marketing',
|
|
7
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
8
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
9
|
+
submitButtonText: 'Submit'
|
|
10
|
+
},
|
|
11
|
+
ro: {
|
|
12
|
+
termsAndConditionsTitle: 'Termeni şi condiţii',
|
|
13
|
+
smsTitle: 'SMS marketing',
|
|
14
|
+
emailMarketingTitle: 'Email marketing',
|
|
15
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
16
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
17
|
+
submitButtonText: 'Submit'
|
|
18
|
+
},
|
|
19
|
+
hr: {
|
|
20
|
+
termsAndConditionsTitle: 'Opći uvjeti i odredbe',
|
|
21
|
+
smsTitle: 'SMS makretinški sadržaj',
|
|
22
|
+
emailMarketingTitle: 'E-mail makretinški sadržaj',
|
|
23
|
+
privacyPolicyTitle: 'Politika Privatnosti',
|
|
24
|
+
userNoticeText: 'Prije nego što možete nastaviti, morate pristati na sljedeće',
|
|
25
|
+
submitButtonText: 'Pošalji'
|
|
26
|
+
},
|
|
27
|
+
fr: {
|
|
28
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
29
|
+
smsTitle: 'SMS marketing',
|
|
30
|
+
emailMarketingTitle: 'Email marketing',
|
|
31
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
32
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
33
|
+
submitButtonText: 'Submit'
|
|
34
|
+
},
|
|
35
|
+
cs: {
|
|
36
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
37
|
+
smsTitle: 'SMS marketing',
|
|
38
|
+
emailMarketingTitle: 'Email marketing',
|
|
39
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
40
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
41
|
+
submitButtonText: 'Submit'
|
|
42
|
+
},
|
|
43
|
+
de: {
|
|
44
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
45
|
+
smsTitle: 'SMS marketing',
|
|
46
|
+
emailMarketingTitle: 'Email marketing',
|
|
47
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
48
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
49
|
+
submitButtonText: 'Submit'
|
|
50
|
+
},
|
|
51
51
|
};
|
|
52
52
|
export const getTranslations = (url) => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
53
|
+
return new Promise((resolve) => {
|
|
54
|
+
fetch(url)
|
|
55
|
+
.then((res) => res.json())
|
|
56
|
+
.then((data) => {
|
|
57
|
+
Object.keys(data).forEach((lang) => {
|
|
58
|
+
if (!TRANSLATIONS[lang]) {
|
|
59
|
+
TRANSLATIONS[lang] = {};
|
|
60
|
+
}
|
|
61
|
+
for (let key in data[lang]) {
|
|
62
|
+
TRANSLATIONS[lang][key] = data[lang][key];
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
resolve(true);
|
|
66
|
+
});
|
|
66
67
|
});
|
|
67
|
-
});
|
|
68
68
|
};
|
|
69
69
|
export const translate = (key, customLang, values) => {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
const lang = customLang;
|
|
71
|
+
let translation = TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
|
|
72
|
+
if (values !== undefined) {
|
|
73
|
+
for (const [key, value] of Object.entries(values.values)) {
|
|
74
|
+
const regex = new RegExp(`{${key}}`, 'g');
|
|
75
|
+
translation = translation.replace(regex, value);
|
|
76
|
+
}
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
-
return translation;
|
|
78
|
+
return translation;
|
|
79
79
|
};
|