@everymatrix/general-styling-wrapper 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 (46) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/general-styling-wrapper.cjs.entry.js +81 -0
  3. package/dist/cjs/general-styling-wrapper.cjs.js +25 -0
  4. package/dist/cjs/index-a5dafaa1.js +1383 -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-styling-wrapper/general-styling-wrapper.css +3 -0
  9. package/dist/collection/components/general-styling-wrapper/general-styling-wrapper.js +144 -0
  10. package/dist/collection/components/general-styling-wrapper/index.js +1 -0
  11. package/dist/collection/index.js +1 -0
  12. package/dist/collection/utils/device.utils.js +0 -0
  13. package/dist/collection/utils/locale.utils.js +15 -0
  14. package/dist/collection/utils/utils.js +3 -0
  15. package/dist/esm/app-globals-0f993ce5.js +3 -0
  16. package/dist/esm/general-styling-wrapper.entry.js +77 -0
  17. package/dist/esm/general-styling-wrapper.js +20 -0
  18. package/dist/esm/index-17391e29.js +1356 -0
  19. package/dist/esm/index.js +1 -0
  20. package/dist/esm/loader.js +11 -0
  21. package/dist/general-styling-wrapper/general-styling-wrapper.esm.js +1 -0
  22. package/dist/general-styling-wrapper/index.esm.js +0 -0
  23. package/dist/general-styling-wrapper/p-6458f4e1.js +2 -0
  24. package/dist/general-styling-wrapper/p-a40e8b20.entry.js +1 -0
  25. package/dist/general-styling-wrapper/p-e1255160.js +1 -0
  26. package/dist/index.cjs.js +1 -0
  27. package/dist/index.js +1 -0
  28. package/dist/stencil.config.dev.js +17 -0
  29. package/dist/stencil.config.js +17 -0
  30. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/general-styling-wrapper/.stencil/packages/stencil/general-styling-wrapper/stencil.config.d.ts +2 -0
  31. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/general-styling-wrapper/.stencil/packages/stencil/general-styling-wrapper/stencil.config.dev.d.ts +2 -0
  32. package/dist/types/components/general-styling-wrapper/general-styling-wrapper.d.ts +26 -0
  33. package/dist/types/components/general-styling-wrapper/index.d.ts +1 -0
  34. package/dist/types/components.d.ts +71 -0
  35. package/dist/types/index.d.ts +1 -0
  36. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  37. package/dist/types/utils/device.utils.d.ts +0 -0
  38. package/dist/types/utils/locale.utils.d.ts +8 -0
  39. package/dist/types/utils/utils.d.ts +1 -0
  40. package/loader/cdn.js +1 -0
  41. package/loader/index.cjs.js +1 -0
  42. package/loader/index.d.ts +24 -0
  43. package/loader/index.es2017.js +1 -0
  44. package/loader/index.js +2 -0
  45. package/loader/package.json +11 -0
  46. package/package.json +26 -0
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const globalScripts = () => {};
4
+
5
+ exports.globalScripts = globalScripts;
@@ -0,0 +1,81 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-a5dafaa1.js');
6
+
7
+ const mergeTranslations = (url, target) => {
8
+ return new Promise((resolve) => {
9
+ fetch(url)
10
+ .then((res) => res.json())
11
+ .then((data) => {
12
+ Object.keys(data).forEach((item) => {
13
+ target[item] = target[item] ? target[item] : {};
14
+ for (let key in data[item]) {
15
+ target[item][key] = data[item][key];
16
+ }
17
+ });
18
+ resolve(true);
19
+ });
20
+ });
21
+ };
22
+
23
+ const generalStylingWrapperCss = ":host{display:block}";
24
+ const GeneralStylingWrapperStyle0 = generalStylingWrapperCss;
25
+
26
+ const GeneralStylingWrapper = class {
27
+ constructor(hostRef) {
28
+ index.registerInstance(this, hostRef);
29
+ this.stylingAppends = false;
30
+ this.setClientStyling = () => {
31
+ let sheet = document.createElement('style');
32
+ sheet.innerHTML = this.clientStyling;
33
+ this.el.prepend(sheet);
34
+ };
35
+ this.setClientStylingURL = () => {
36
+ let url = new URL(this.clientStylingUrl);
37
+ let cssFile = document.createElement('style');
38
+ fetch(url.href)
39
+ .then((res) => res.text())
40
+ .then((data) => {
41
+ cssFile.innerHTML = data;
42
+ setTimeout(() => {
43
+ this.el.prepend(cssFile);
44
+ }, 1);
45
+ })
46
+ .catch((err) => {
47
+ console.log('error ', err);
48
+ });
49
+ };
50
+ this.clientStyling = '';
51
+ this.clientStylingUrl = '';
52
+ this.translationUrl = '';
53
+ this.targetTranslations = undefined;
54
+ }
55
+ componentDidRender() {
56
+ // start custom styling area
57
+ if (!this.stylingAppends) {
58
+ if (this.clientStyling)
59
+ this.setClientStyling();
60
+ if (this.clientStylingUrl)
61
+ this.setClientStylingURL();
62
+ this.stylingAppends = true;
63
+ }
64
+ // end custom styling area
65
+ }
66
+ async componentWillLoad() {
67
+ const promises = [];
68
+ if (this.translationUrl) {
69
+ const translationPromise = mergeTranslations(this.translationUrl, this.targetTranslations);
70
+ promises.push(translationPromise);
71
+ }
72
+ return await Promise.all(promises);
73
+ }
74
+ render() {
75
+ return (index.h("div", { key: '4d3414408c7662f88331dbe655966237f74d6958', class: "StyleShell" }, index.h("slot", { key: '1d004644d84602c4314bdf5dfc26b55b160f57df', name: "mainContent" })));
76
+ }
77
+ get el() { return index.getElement(this); }
78
+ };
79
+ GeneralStylingWrapper.style = GeneralStylingWrapperStyle0;
80
+
81
+ exports.general_styling_wrapper = GeneralStylingWrapper;
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-a5dafaa1.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-styling-wrapper.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-styling-wrapper.cjs",[[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]}]]]], options);
23
+ });
24
+
25
+ exports.setNonce = index.setNonce;