@everymatrix/general-styling-wrapper 1.15.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.
Files changed (45) hide show
  1. package/dist/cjs/general-styling-wrapper.cjs.entry.js +87 -0
  2. package/dist/cjs/general-styling-wrapper.cjs.js +19 -0
  3. package/dist/cjs/index-38077f5d.js +1407 -0
  4. package/dist/cjs/index.cjs.js +2 -0
  5. package/dist/cjs/loader.cjs.js +21 -0
  6. package/dist/collection/collection-manifest.json +12 -0
  7. package/dist/collection/components/general-styling-wrapper/general-styling-wrapper.css +3 -0
  8. package/dist/collection/components/general-styling-wrapper/general-styling-wrapper.js +145 -0
  9. package/dist/collection/index.js +1 -0
  10. package/dist/collection/utils/locale.utils.js +15 -0
  11. package/dist/components/general-styling-wrapper.d.ts +11 -0
  12. package/dist/components/general-styling-wrapper.js +105 -0
  13. package/dist/components/index.d.ts +26 -0
  14. package/dist/components/index.js +1 -0
  15. package/dist/esm/general-styling-wrapper.entry.js +83 -0
  16. package/dist/esm/general-styling-wrapper.js +17 -0
  17. package/dist/esm/index-10c47fc0.js +1382 -0
  18. package/dist/esm/index.js +1 -0
  19. package/dist/esm/loader.js +17 -0
  20. package/dist/esm/polyfills/core-js.js +11 -0
  21. package/dist/esm/polyfills/css-shim.js +1 -0
  22. package/dist/esm/polyfills/dom.js +79 -0
  23. package/dist/esm/polyfills/es5-html-element.js +1 -0
  24. package/dist/esm/polyfills/index.js +34 -0
  25. package/dist/esm/polyfills/system.js +6 -0
  26. package/dist/general-styling-wrapper/general-styling-wrapper.esm.js +1 -0
  27. package/dist/general-styling-wrapper/index.esm.js +0 -0
  28. package/dist/general-styling-wrapper/p-05de0679.js +1 -0
  29. package/dist/general-styling-wrapper/p-69081248.entry.js +1 -0
  30. package/dist/index.cjs.js +1 -0
  31. package/dist/index.js +1 -0
  32. package/dist/stencil.config.js +22 -0
  33. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/general-styling-wrapper/.stencil/packages/general-styling-wrapper/stencil.config.d.ts +2 -0
  34. package/dist/types/components/general-styling-wrapper/general-styling-wrapper.d.ts +26 -0
  35. package/dist/types/components.d.ts +70 -0
  36. package/dist/types/index.d.ts +1 -0
  37. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  38. package/dist/types/utils/locale.utils.d.ts +8 -0
  39. package/loader/cdn.js +3 -0
  40. package/loader/index.cjs.js +3 -0
  41. package/loader/index.d.ts +12 -0
  42. package/loader/index.es2017.js +3 -0
  43. package/loader/index.js +4 -0
  44. package/loader/package.json +10 -0
  45. package/package.json +19 -0
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-38077f5d.js');
6
+
7
+ /*
8
+ Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
9
+ */
10
+ const patchEsm = () => {
11
+ return index.promiseResolve();
12
+ };
13
+
14
+ const defineCustomElements = (win, options) => {
15
+ if (typeof window === 'undefined') return Promise.resolve();
16
+ return patchEsm().then(() => {
17
+ 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);
18
+ });
19
+ };
20
+
21
+ exports.defineCustomElements = defineCustomElements;
@@ -0,0 +1,12 @@
1
+ {
2
+ "entries": [
3
+ "./components/general-styling-wrapper/general-styling-wrapper.js"
4
+ ],
5
+ "compiler": {
6
+ "name": "@stencil/core",
7
+ "version": "2.15.2",
8
+ "typescriptVersion": "4.5.4"
9
+ },
10
+ "collections": [],
11
+ "bundles": []
12
+ }
@@ -0,0 +1,145 @@
1
+ import { Component, Prop, h } from '@stencil/core';
2
+ import { mergeTranslations } from '../../utils/locale.utils';
3
+ export class GeneralStylingWrapper {
4
+ constructor() {
5
+ /**
6
+ * Client custom styling via inline styles
7
+ */
8
+ this.clientStyling = '';
9
+ /**
10
+ * Client custom styling via url
11
+ */
12
+ this.clientStylingUrl = '';
13
+ /**
14
+ * Translation via url
15
+ */
16
+ this.translationUrl = '';
17
+ this.stylingAppends = false;
18
+ this.setClientStyling = () => {
19
+ let sheet = document.createElement('style');
20
+ sheet.innerHTML = this.clientStyling;
21
+ this.stylingContainer.prepend(sheet);
22
+ };
23
+ this.setClientStylingURL = () => {
24
+ let url = new URL(this.clientStylingUrl);
25
+ let cssFile = document.createElement('style');
26
+ fetch(url.href)
27
+ .then((res) => res.text())
28
+ .then((data) => {
29
+ cssFile.innerHTML = data;
30
+ setTimeout(() => {
31
+ this.stylingContainer.prepend(cssFile);
32
+ }, 1);
33
+ })
34
+ .catch((err) => {
35
+ console.log('error ', err);
36
+ });
37
+ };
38
+ }
39
+ componentDidRender() {
40
+ // start custom styling area
41
+ if (!this.stylingAppends && this.stylingContainer) {
42
+ if (this.clientStyling)
43
+ this.setClientStyling();
44
+ if (this.clientStylingUrl)
45
+ this.setClientStylingURL();
46
+ this.stylingAppends = true;
47
+ }
48
+ // end custom styling area
49
+ }
50
+ async componentWillLoad() {
51
+ const promises = [];
52
+ if (this.translationUrl) {
53
+ const translationPromise = mergeTranslations(this.translationUrl, this.targetTranslations);
54
+ promises.push(translationPromise);
55
+ }
56
+ return await Promise.all(promises);
57
+ }
58
+ render() {
59
+ return (h("div", { ref: (el) => (this.stylingContainer = el), class: "StyleShell" },
60
+ h("slot", { name: "mainContent" })));
61
+ }
62
+ static get is() { return "general-styling-wrapper"; }
63
+ static get originalStyleUrls() { return {
64
+ "$": ["general-styling-wrapper.scss"]
65
+ }; }
66
+ static get styleUrls() { return {
67
+ "$": ["general-styling-wrapper.css"]
68
+ }; }
69
+ static get properties() { return {
70
+ "clientStyling": {
71
+ "type": "string",
72
+ "mutable": false,
73
+ "complexType": {
74
+ "original": "string",
75
+ "resolved": "string",
76
+ "references": {}
77
+ },
78
+ "required": false,
79
+ "optional": false,
80
+ "docs": {
81
+ "tags": [],
82
+ "text": "Client custom styling via inline styles"
83
+ },
84
+ "attribute": "client-styling",
85
+ "reflect": false,
86
+ "defaultValue": "''"
87
+ },
88
+ "clientStylingUrl": {
89
+ "type": "string",
90
+ "mutable": false,
91
+ "complexType": {
92
+ "original": "string",
93
+ "resolved": "string",
94
+ "references": {}
95
+ },
96
+ "required": false,
97
+ "optional": false,
98
+ "docs": {
99
+ "tags": [],
100
+ "text": "Client custom styling via url"
101
+ },
102
+ "attribute": "client-styling-url",
103
+ "reflect": false,
104
+ "defaultValue": "''"
105
+ },
106
+ "translationUrl": {
107
+ "type": "string",
108
+ "mutable": false,
109
+ "complexType": {
110
+ "original": "string",
111
+ "resolved": "string",
112
+ "references": {}
113
+ },
114
+ "required": false,
115
+ "optional": false,
116
+ "docs": {
117
+ "tags": [],
118
+ "text": "Translation via url"
119
+ },
120
+ "attribute": "translation-url",
121
+ "reflect": false,
122
+ "defaultValue": "''"
123
+ },
124
+ "targetTranslations": {
125
+ "type": "unknown",
126
+ "mutable": false,
127
+ "complexType": {
128
+ "original": "Translations",
129
+ "resolved": "Translations",
130
+ "references": {
131
+ "Translations": {
132
+ "location": "import",
133
+ "path": "../../utils/locale.utils"
134
+ }
135
+ }
136
+ },
137
+ "required": false,
138
+ "optional": false,
139
+ "docs": {
140
+ "tags": [],
141
+ "text": "Translation be merged to"
142
+ }
143
+ }
144
+ }; }
145
+ }
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1,15 @@
1
+ export const mergeTranslations = (url, target) => {
2
+ return new Promise((resolve) => {
3
+ fetch(url)
4
+ .then((res) => res.json())
5
+ .then((data) => {
6
+ Object.keys(data).forEach((item) => {
7
+ target[item] = target[item] ? target[item] : {};
8
+ for (let key in data[item]) {
9
+ target[item][key] = data[item][key];
10
+ }
11
+ });
12
+ resolve(true);
13
+ });
14
+ });
15
+ };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface GeneralStylingWrapper extends Components.GeneralStylingWrapper, HTMLElement {}
4
+ export const GeneralStylingWrapper: {
5
+ prototype: GeneralStylingWrapper;
6
+ new (): GeneralStylingWrapper;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,105 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+
3
+ const mergeTranslations = (url, target) => {
4
+ return new Promise((resolve) => {
5
+ fetch(url)
6
+ .then((res) => res.json())
7
+ .then((data) => {
8
+ Object.keys(data).forEach((item) => {
9
+ target[item] = target[item] ? target[item] : {};
10
+ for (let key in data[item]) {
11
+ target[item][key] = data[item][key];
12
+ }
13
+ });
14
+ resolve(true);
15
+ });
16
+ });
17
+ };
18
+
19
+ const generalStylingWrapperCss = ":host{display:block}";
20
+
21
+ const GeneralStylingWrapper$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
22
+ constructor() {
23
+ super();
24
+ this.__registerHost();
25
+ /**
26
+ * Client custom styling via inline styles
27
+ */
28
+ this.clientStyling = '';
29
+ /**
30
+ * Client custom styling via url
31
+ */
32
+ this.clientStylingUrl = '';
33
+ /**
34
+ * Translation via url
35
+ */
36
+ this.translationUrl = '';
37
+ this.stylingAppends = false;
38
+ this.setClientStyling = () => {
39
+ let sheet = document.createElement('style');
40
+ sheet.innerHTML = this.clientStyling;
41
+ this.stylingContainer.prepend(sheet);
42
+ };
43
+ this.setClientStylingURL = () => {
44
+ let url = new URL(this.clientStylingUrl);
45
+ let cssFile = document.createElement('style');
46
+ fetch(url.href)
47
+ .then((res) => res.text())
48
+ .then((data) => {
49
+ cssFile.innerHTML = data;
50
+ setTimeout(() => {
51
+ this.stylingContainer.prepend(cssFile);
52
+ }, 1);
53
+ })
54
+ .catch((err) => {
55
+ console.log('error ', err);
56
+ });
57
+ };
58
+ }
59
+ componentDidRender() {
60
+ // start custom styling area
61
+ if (!this.stylingAppends && this.stylingContainer) {
62
+ if (this.clientStyling)
63
+ this.setClientStyling();
64
+ if (this.clientStylingUrl)
65
+ this.setClientStylingURL();
66
+ this.stylingAppends = true;
67
+ }
68
+ // end custom styling area
69
+ }
70
+ async componentWillLoad() {
71
+ const promises = [];
72
+ if (this.translationUrl) {
73
+ const translationPromise = mergeTranslations(this.translationUrl, this.targetTranslations);
74
+ promises.push(translationPromise);
75
+ }
76
+ return await Promise.all(promises);
77
+ }
78
+ render() {
79
+ return (h("div", { ref: (el) => (this.stylingContainer = el), class: "StyleShell" }, h("slot", { name: "mainContent" })));
80
+ }
81
+ static get style() { return generalStylingWrapperCss; }
82
+ }, [4, "general-styling-wrapper", {
83
+ "clientStyling": [1, "client-styling"],
84
+ "clientStylingUrl": [1, "client-styling-url"],
85
+ "translationUrl": [1, "translation-url"],
86
+ "targetTranslations": [16]
87
+ }]);
88
+ function defineCustomElement$1() {
89
+ if (typeof customElements === "undefined") {
90
+ return;
91
+ }
92
+ const components = ["general-styling-wrapper"];
93
+ components.forEach(tagName => { switch (tagName) {
94
+ case "general-styling-wrapper":
95
+ if (!customElements.get(tagName)) {
96
+ customElements.define(tagName, GeneralStylingWrapper$1);
97
+ }
98
+ break;
99
+ } });
100
+ }
101
+
102
+ const GeneralStylingWrapper = GeneralStylingWrapper$1;
103
+ const defineCustomElement = defineCustomElement$1;
104
+
105
+ export { GeneralStylingWrapper, defineCustomElement };
@@ -0,0 +1,26 @@
1
+ /* GeneralStylingWrapper custom elements */
2
+
3
+ import type { Components, JSX } from "../types/components";
4
+
5
+ /**
6
+ * Used to manually set the base path where assets can be found.
7
+ * If the script is used as "module", it's recommended to use "import.meta.url",
8
+ * such as "setAssetPath(import.meta.url)". Other options include
9
+ * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
10
+ * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
11
+ * But do note that this configuration depends on how your script is bundled, or lack of
12
+ * bundling, and where your assets can be loaded from. Additionally custom bundling
13
+ * will have to ensure the static assets are copied to its build directory.
14
+ */
15
+ export declare const setAssetPath: (path: string) => void;
16
+
17
+ export interface SetPlatformOptions {
18
+ raf?: (c: FrameRequestCallback) => number;
19
+ ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
20
+ rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
21
+ }
22
+ export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
23
+
24
+ export type { Components, JSX };
25
+
26
+ export * from '../types';
@@ -0,0 +1 @@
1
+ export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
@@ -0,0 +1,83 @@
1
+ import { r as registerInstance, h } from './index-10c47fc0.js';
2
+
3
+ const mergeTranslations = (url, target) => {
4
+ return new Promise((resolve) => {
5
+ fetch(url)
6
+ .then((res) => res.json())
7
+ .then((data) => {
8
+ Object.keys(data).forEach((item) => {
9
+ target[item] = target[item] ? target[item] : {};
10
+ for (let key in data[item]) {
11
+ target[item][key] = data[item][key];
12
+ }
13
+ });
14
+ resolve(true);
15
+ });
16
+ });
17
+ };
18
+
19
+ const generalStylingWrapperCss = ":host{display:block}";
20
+
21
+ const GeneralStylingWrapper = class {
22
+ constructor(hostRef) {
23
+ registerInstance(this, hostRef);
24
+ /**
25
+ * Client custom styling via inline styles
26
+ */
27
+ this.clientStyling = '';
28
+ /**
29
+ * Client custom styling via url
30
+ */
31
+ this.clientStylingUrl = '';
32
+ /**
33
+ * Translation via url
34
+ */
35
+ this.translationUrl = '';
36
+ this.stylingAppends = false;
37
+ this.setClientStyling = () => {
38
+ let sheet = document.createElement('style');
39
+ sheet.innerHTML = this.clientStyling;
40
+ this.stylingContainer.prepend(sheet);
41
+ };
42
+ this.setClientStylingURL = () => {
43
+ let url = new URL(this.clientStylingUrl);
44
+ let cssFile = document.createElement('style');
45
+ fetch(url.href)
46
+ .then((res) => res.text())
47
+ .then((data) => {
48
+ cssFile.innerHTML = data;
49
+ setTimeout(() => {
50
+ this.stylingContainer.prepend(cssFile);
51
+ }, 1);
52
+ })
53
+ .catch((err) => {
54
+ console.log('error ', err);
55
+ });
56
+ };
57
+ }
58
+ componentDidRender() {
59
+ // start custom styling area
60
+ if (!this.stylingAppends && this.stylingContainer) {
61
+ if (this.clientStyling)
62
+ this.setClientStyling();
63
+ if (this.clientStylingUrl)
64
+ this.setClientStylingURL();
65
+ this.stylingAppends = true;
66
+ }
67
+ // end custom styling area
68
+ }
69
+ async componentWillLoad() {
70
+ const promises = [];
71
+ if (this.translationUrl) {
72
+ const translationPromise = mergeTranslations(this.translationUrl, this.targetTranslations);
73
+ promises.push(translationPromise);
74
+ }
75
+ return await Promise.all(promises);
76
+ }
77
+ render() {
78
+ return (h("div", { ref: (el) => (this.stylingContainer = el), class: "StyleShell" }, h("slot", { name: "mainContent" })));
79
+ }
80
+ };
81
+ GeneralStylingWrapper.style = generalStylingWrapperCss;
82
+
83
+ export { GeneralStylingWrapper as general_styling_wrapper };
@@ -0,0 +1,17 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-10c47fc0.js';
2
+
3
+ /*
4
+ Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
5
+ */
6
+ const patchBrowser = () => {
7
+ const importMeta = import.meta.url;
8
+ const opts = {};
9
+ if (importMeta !== '') {
10
+ opts.resourcesUrl = new URL('.', importMeta).href;
11
+ }
12
+ return promiseResolve(opts);
13
+ };
14
+
15
+ patchBrowser().then(options => {
16
+ return bootstrapLazy([["general-styling-wrapper",[[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]}]]]], options);
17
+ });