@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.
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/general-styling-wrapper.cjs.entry.js +81 -0
- package/dist/cjs/general-styling-wrapper.cjs.js +25 -0
- package/dist/cjs/index-a5dafaa1.js +1383 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/general-styling-wrapper/general-styling-wrapper.css +3 -0
- package/dist/collection/components/general-styling-wrapper/general-styling-wrapper.js +144 -0
- package/dist/collection/components/general-styling-wrapper/index.js +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/device.utils.js +0 -0
- package/dist/collection/utils/locale.utils.js +15 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/general-styling-wrapper.entry.js +77 -0
- package/dist/esm/general-styling-wrapper.js +20 -0
- package/dist/esm/index-17391e29.js +1356 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/general-styling-wrapper/general-styling-wrapper.esm.js +1 -0
- package/dist/general-styling-wrapper/index.esm.js +0 -0
- package/dist/general-styling-wrapper/p-6458f4e1.js +2 -0
- package/dist/general-styling-wrapper/p-a40e8b20.entry.js +1 -0
- package/dist/general-styling-wrapper/p-e1255160.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +17 -0
- 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
- 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
- package/dist/types/components/general-styling-wrapper/general-styling-wrapper.d.ts +26 -0
- package/dist/types/components/general-styling-wrapper/index.d.ts +1 -0
- package/dist/types/components.d.ts +71 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/device.utils.d.ts +0 -0
- package/dist/types/utils/locale.utils.d.ts +8 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +26 -0
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
const defineCustomElements = async (win, options) => {
|
|
9
|
+
if (typeof window === 'undefined') return undefined;
|
|
10
|
+
await appGlobals.globalScripts();
|
|
11
|
+
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);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.setNonce = index.setNonce;
|
|
15
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { mergeTranslations } from "../../utils/locale.utils";
|
|
3
|
+
export class GeneralStylingWrapper {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.stylingAppends = false;
|
|
6
|
+
this.setClientStyling = () => {
|
|
7
|
+
let sheet = document.createElement('style');
|
|
8
|
+
sheet.innerHTML = this.clientStyling;
|
|
9
|
+
this.el.prepend(sheet);
|
|
10
|
+
};
|
|
11
|
+
this.setClientStylingURL = () => {
|
|
12
|
+
let url = new URL(this.clientStylingUrl);
|
|
13
|
+
let cssFile = document.createElement('style');
|
|
14
|
+
fetch(url.href)
|
|
15
|
+
.then((res) => res.text())
|
|
16
|
+
.then((data) => {
|
|
17
|
+
cssFile.innerHTML = data;
|
|
18
|
+
setTimeout(() => {
|
|
19
|
+
this.el.prepend(cssFile);
|
|
20
|
+
}, 1);
|
|
21
|
+
})
|
|
22
|
+
.catch((err) => {
|
|
23
|
+
console.log('error ', err);
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
this.clientStyling = '';
|
|
27
|
+
this.clientStylingUrl = '';
|
|
28
|
+
this.translationUrl = '';
|
|
29
|
+
this.targetTranslations = undefined;
|
|
30
|
+
}
|
|
31
|
+
componentDidRender() {
|
|
32
|
+
// start custom styling area
|
|
33
|
+
if (!this.stylingAppends) {
|
|
34
|
+
if (this.clientStyling)
|
|
35
|
+
this.setClientStyling();
|
|
36
|
+
if (this.clientStylingUrl)
|
|
37
|
+
this.setClientStylingURL();
|
|
38
|
+
this.stylingAppends = true;
|
|
39
|
+
}
|
|
40
|
+
// end custom styling area
|
|
41
|
+
}
|
|
42
|
+
async componentWillLoad() {
|
|
43
|
+
const promises = [];
|
|
44
|
+
if (this.translationUrl) {
|
|
45
|
+
const translationPromise = mergeTranslations(this.translationUrl, this.targetTranslations);
|
|
46
|
+
promises.push(translationPromise);
|
|
47
|
+
}
|
|
48
|
+
return await Promise.all(promises);
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
return (h("div", { key: '4d3414408c7662f88331dbe655966237f74d6958', class: "StyleShell" }, h("slot", { key: '1d004644d84602c4314bdf5dfc26b55b160f57df', name: "mainContent" })));
|
|
52
|
+
}
|
|
53
|
+
static get is() { return "general-styling-wrapper"; }
|
|
54
|
+
static get originalStyleUrls() {
|
|
55
|
+
return {
|
|
56
|
+
"$": ["general-styling-wrapper.scss"]
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
static get styleUrls() {
|
|
60
|
+
return {
|
|
61
|
+
"$": ["general-styling-wrapper.css"]
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
static get properties() {
|
|
65
|
+
return {
|
|
66
|
+
"clientStyling": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"mutable": false,
|
|
69
|
+
"complexType": {
|
|
70
|
+
"original": "string",
|
|
71
|
+
"resolved": "string",
|
|
72
|
+
"references": {}
|
|
73
|
+
},
|
|
74
|
+
"required": false,
|
|
75
|
+
"optional": false,
|
|
76
|
+
"docs": {
|
|
77
|
+
"tags": [],
|
|
78
|
+
"text": "Client custom styling via inline styles"
|
|
79
|
+
},
|
|
80
|
+
"attribute": "client-styling",
|
|
81
|
+
"reflect": false,
|
|
82
|
+
"defaultValue": "''"
|
|
83
|
+
},
|
|
84
|
+
"clientStylingUrl": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"mutable": false,
|
|
87
|
+
"complexType": {
|
|
88
|
+
"original": "string",
|
|
89
|
+
"resolved": "string",
|
|
90
|
+
"references": {}
|
|
91
|
+
},
|
|
92
|
+
"required": false,
|
|
93
|
+
"optional": false,
|
|
94
|
+
"docs": {
|
|
95
|
+
"tags": [],
|
|
96
|
+
"text": "Client custom styling via url"
|
|
97
|
+
},
|
|
98
|
+
"attribute": "client-styling-url",
|
|
99
|
+
"reflect": false,
|
|
100
|
+
"defaultValue": "''"
|
|
101
|
+
},
|
|
102
|
+
"translationUrl": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"mutable": false,
|
|
105
|
+
"complexType": {
|
|
106
|
+
"original": "string",
|
|
107
|
+
"resolved": "string",
|
|
108
|
+
"references": {}
|
|
109
|
+
},
|
|
110
|
+
"required": false,
|
|
111
|
+
"optional": false,
|
|
112
|
+
"docs": {
|
|
113
|
+
"tags": [],
|
|
114
|
+
"text": "Translation via url"
|
|
115
|
+
},
|
|
116
|
+
"attribute": "translation-url",
|
|
117
|
+
"reflect": false,
|
|
118
|
+
"defaultValue": "''"
|
|
119
|
+
},
|
|
120
|
+
"targetTranslations": {
|
|
121
|
+
"type": "unknown",
|
|
122
|
+
"mutable": false,
|
|
123
|
+
"complexType": {
|
|
124
|
+
"original": "Translations",
|
|
125
|
+
"resolved": "Translations",
|
|
126
|
+
"references": {
|
|
127
|
+
"Translations": {
|
|
128
|
+
"location": "import",
|
|
129
|
+
"path": "../../utils/locale.utils",
|
|
130
|
+
"id": "../../../../packages/stencil/general-styling-wrapper/src/utils/locale.utils.ts::Translations"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"required": false,
|
|
135
|
+
"optional": false,
|
|
136
|
+
"docs": {
|
|
137
|
+
"tags": [],
|
|
138
|
+
"text": "Translation be merged to"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
static get elementRef() { return "el"; }
|
|
144
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GeneralStylingWrapper } from './general-styling-wrapper';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
File without changes
|
|
@@ -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,77 @@
|
|
|
1
|
+
import { r as registerInstance, h, g as getElement } from './index-17391e29.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
|
+
const GeneralStylingWrapperStyle0 = generalStylingWrapperCss;
|
|
21
|
+
|
|
22
|
+
const GeneralStylingWrapper = class {
|
|
23
|
+
constructor(hostRef) {
|
|
24
|
+
registerInstance(this, hostRef);
|
|
25
|
+
this.stylingAppends = false;
|
|
26
|
+
this.setClientStyling = () => {
|
|
27
|
+
let sheet = document.createElement('style');
|
|
28
|
+
sheet.innerHTML = this.clientStyling;
|
|
29
|
+
this.el.prepend(sheet);
|
|
30
|
+
};
|
|
31
|
+
this.setClientStylingURL = () => {
|
|
32
|
+
let url = new URL(this.clientStylingUrl);
|
|
33
|
+
let cssFile = document.createElement('style');
|
|
34
|
+
fetch(url.href)
|
|
35
|
+
.then((res) => res.text())
|
|
36
|
+
.then((data) => {
|
|
37
|
+
cssFile.innerHTML = data;
|
|
38
|
+
setTimeout(() => {
|
|
39
|
+
this.el.prepend(cssFile);
|
|
40
|
+
}, 1);
|
|
41
|
+
})
|
|
42
|
+
.catch((err) => {
|
|
43
|
+
console.log('error ', err);
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
this.clientStyling = '';
|
|
47
|
+
this.clientStylingUrl = '';
|
|
48
|
+
this.translationUrl = '';
|
|
49
|
+
this.targetTranslations = undefined;
|
|
50
|
+
}
|
|
51
|
+
componentDidRender() {
|
|
52
|
+
// start custom styling area
|
|
53
|
+
if (!this.stylingAppends) {
|
|
54
|
+
if (this.clientStyling)
|
|
55
|
+
this.setClientStyling();
|
|
56
|
+
if (this.clientStylingUrl)
|
|
57
|
+
this.setClientStylingURL();
|
|
58
|
+
this.stylingAppends = true;
|
|
59
|
+
}
|
|
60
|
+
// end custom styling area
|
|
61
|
+
}
|
|
62
|
+
async componentWillLoad() {
|
|
63
|
+
const promises = [];
|
|
64
|
+
if (this.translationUrl) {
|
|
65
|
+
const translationPromise = mergeTranslations(this.translationUrl, this.targetTranslations);
|
|
66
|
+
promises.push(translationPromise);
|
|
67
|
+
}
|
|
68
|
+
return await Promise.all(promises);
|
|
69
|
+
}
|
|
70
|
+
render() {
|
|
71
|
+
return (h("div", { key: '4d3414408c7662f88331dbe655966237f74d6958', class: "StyleShell" }, h("slot", { key: '1d004644d84602c4314bdf5dfc26b55b160f57df', name: "mainContent" })));
|
|
72
|
+
}
|
|
73
|
+
get el() { return getElement(this); }
|
|
74
|
+
};
|
|
75
|
+
GeneralStylingWrapper.style = GeneralStylingWrapperStyle0;
|
|
76
|
+
|
|
77
|
+
export { GeneralStylingWrapper as general_styling_wrapper };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-17391e29.js';
|
|
2
|
+
export { s as setNonce } from './index-17391e29.js';
|
|
3
|
+
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com
|
|
7
|
+
*/
|
|
8
|
+
var patchBrowser = () => {
|
|
9
|
+
const importMeta = import.meta.url;
|
|
10
|
+
const opts = {};
|
|
11
|
+
if (importMeta !== "") {
|
|
12
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
13
|
+
}
|
|
14
|
+
return promiseResolve(opts);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
patchBrowser().then(async (options) => {
|
|
18
|
+
await globalScripts();
|
|
19
|
+
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);
|
|
20
|
+
});
|