@everymatrix/user-action-controller 0.0.1 → 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 (57) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/index-c5061e5a.js +1315 -0
  3. package/dist/cjs/loader.cjs.js +7 -13
  4. package/dist/cjs/player-user-consents_2.cjs.entry.js +504 -0
  5. package/dist/cjs/user-action-controller.cjs.js +17 -11
  6. package/dist/collection/collection-manifest.json +5 -11
  7. package/dist/collection/components/user-action-controller/index.js +1 -0
  8. package/dist/collection/components/user-action-controller/user-action-controller.css +43 -0
  9. package/dist/collection/components/user-action-controller/user-action-controller.js +423 -235
  10. package/dist/collection/utils/locale.utils.js +66 -0
  11. package/dist/collection/utils/utils.js +1 -1
  12. package/dist/esm/app-globals-0f993ce5.js +3 -0
  13. package/dist/esm/index-02b86e76.js +1288 -0
  14. package/dist/esm/loader.js +7 -13
  15. package/dist/esm/player-user-consents_2.entry.js +499 -0
  16. package/dist/esm/user-action-controller.js +14 -11
  17. package/dist/stencil.config.dev.js +17 -0
  18. package/dist/stencil.config.js +14 -19
  19. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/user-action-controller/.stencil/packages/stencil/user-action-controller/stencil.config.d.ts +2 -0
  20. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/user-action-controller/.stencil/packages/stencil/user-action-controller/stencil.config.dev.d.ts +2 -0
  21. package/dist/types/components/user-action-controller/index.d.ts +1 -0
  22. package/dist/types/components/user-action-controller/user-action-controller.d.ts +68 -50
  23. package/dist/types/components.d.ts +34 -18
  24. package/dist/types/stencil-public-runtime.d.ts +142 -33
  25. package/dist/types/utils/locale.utils.d.ts +2 -0
  26. package/dist/user-action-controller/p-4bd71dba.entry.js +1 -0
  27. package/dist/user-action-controller/p-b996e8b8.js +2 -0
  28. package/dist/user-action-controller/p-e1255160.js +1 -0
  29. package/dist/user-action-controller/user-action-controller.esm.js +1 -1
  30. package/loader/cdn.js +1 -3
  31. package/loader/index.cjs.js +1 -3
  32. package/loader/index.d.ts +13 -1
  33. package/loader/index.es2017.js +1 -3
  34. package/loader/index.js +1 -3
  35. package/loader/package.json +1 -0
  36. package/package.json +12 -2
  37. package/dist/cjs/generic-user-consent_3.cjs.entry.js +0 -182
  38. package/dist/cjs/index-4a3038bd.js +0 -1255
  39. package/dist/components/generic-user-consent.js +0 -6
  40. package/dist/components/generic-user-consent2.js +0 -93
  41. package/dist/components/index.d.ts +0 -26
  42. package/dist/components/index.js +0 -1
  43. package/dist/components/legislation-wrapper.js +0 -6
  44. package/dist/components/legislation-wrapper2.js +0 -33
  45. package/dist/components/user-action-controller.d.ts +0 -11
  46. package/dist/components/user-action-controller.js +0 -137
  47. package/dist/esm/generic-user-consent_3.entry.js +0 -176
  48. package/dist/esm/index-9eef5ef8.js +0 -1229
  49. package/dist/esm/polyfills/core-js.js +0 -11
  50. package/dist/esm/polyfills/css-shim.js +0 -1
  51. package/dist/esm/polyfills/dom.js +0 -79
  52. package/dist/esm/polyfills/es5-html-element.js +0 -1
  53. package/dist/esm/polyfills/index.js +0 -34
  54. package/dist/esm/polyfills/system.js +0 -6
  55. package/dist/types/Users/user/workspace/everymatrix/widgets-stencil/packages/user-action-controller/.stencil/packages/user-action-controller/stencil.config.d.ts +0 -2
  56. package/dist/user-action-controller/p-013051ff.entry.js +0 -1
  57. package/dist/user-action-controller/p-54386d36.js +0 -1
@@ -0,0 +1,66 @@
1
+ const DEFAULT_LANGUAGE = 'en';
2
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
3
+ const TRANSLATIONS = {
4
+ en: {
5
+ termsandconditions: 'Terms and Conditions',
6
+ sms: 'SMS marketing',
7
+ emailmarketing: 'Email marketing',
8
+ privacypolicy: 'Privacy Policy'
9
+ },
10
+ ro: {
11
+ termsandconditions: 'Termeni şi condiţii',
12
+ sms: 'SMS marketing',
13
+ emailmarketing: 'Email marketing',
14
+ privacypolicy: 'Privacy Policy'
15
+ },
16
+ hr: {
17
+ termsandconditions: 'Terms and Conditions',
18
+ sms: 'SMS marketing',
19
+ emailmarketing: 'Email marketing',
20
+ privacypolicy: 'Privacy Policy'
21
+ },
22
+ fr: {
23
+ termsandconditions: 'Terms and Conditions',
24
+ sms: 'SMS marketing',
25
+ emailmarketing: 'Email marketing',
26
+ privacypolicy: 'Privacy Policy'
27
+ },
28
+ cs: {
29
+ termsandconditions: 'Terms and Conditions',
30
+ sms: 'SMS marketing',
31
+ emailmarketing: 'Email marketing',
32
+ privacypolicy: 'Privacy Policy'
33
+ },
34
+ de: {
35
+ termsandconditions: 'Terms and Conditions',
36
+ sms: 'SMS marketing',
37
+ emailmarketing: 'Email marketing',
38
+ privacypolicy: 'Privacy Policy'
39
+ },
40
+ };
41
+ export const getTranslations = (url) => {
42
+ // fetch url, get the data, replace the TRANSLATIONS content
43
+ return new Promise((resolve) => {
44
+ fetch(url)
45
+ .then((res) => res.json())
46
+ .then((data) => {
47
+ Object.keys(data).forEach((item) => {
48
+ for (let key in data[item]) {
49
+ TRANSLATIONS[item][key] = data[item][key];
50
+ }
51
+ });
52
+ resolve(true);
53
+ });
54
+ });
55
+ };
56
+ export const translate = (key, customLang, values) => {
57
+ const lang = customLang;
58
+ let translation = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
59
+ if (values !== undefined) {
60
+ for (const [key, value] of Object.entries(values.values)) {
61
+ const regex = new RegExp(`{${key}}`, 'g');
62
+ translation = translation.replace(regex, value);
63
+ }
64
+ }
65
+ return translation;
66
+ };
@@ -1,3 +1,3 @@
1
1
  export function format(first, middle, last) {
2
- return ((first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : ''));
2
+ return ((first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : ''));
3
3
  }
@@ -0,0 +1,3 @@
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };