@everymatrix/general-styling-wrapper 1.65.1 → 1.65.2
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/general-styling-wrapper.cjs.entry.js +9 -2
- package/dist/collection/utils/locale.utils.js +9 -2
- package/dist/esm/general-styling-wrapper.entry.js +9 -2
- package/dist/general-styling-wrapper/general-styling-wrapper.esm.js +1 -1
- package/dist/general-styling-wrapper/{p-cbc56d10.entry.js → p-14aa5921.entry.js} +1 -1
- package/package.json +1 -1
|
@@ -10,9 +10,16 @@ const mergeTranslations = (url, target) => {
|
|
|
10
10
|
.then((res) => res.json())
|
|
11
11
|
.then((data) => {
|
|
12
12
|
Object.keys(data).forEach((item) => {
|
|
13
|
-
target[item] = target[item] ? target[item] :
|
|
13
|
+
target[item] = target[item] ? target[item] : target['en'];
|
|
14
14
|
for (let key in data[item]) {
|
|
15
|
-
|
|
15
|
+
if (typeof data[item][key] === 'object') {
|
|
16
|
+
Object.keys(data[item][key]).forEach((subKey) => {
|
|
17
|
+
target[item][key][subKey] = data[item][key][subKey];
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
target[item][key] = data[item][key];
|
|
22
|
+
}
|
|
16
23
|
}
|
|
17
24
|
});
|
|
18
25
|
resolve(true);
|
|
@@ -4,9 +4,16 @@ export const mergeTranslations = (url, target) => {
|
|
|
4
4
|
.then((res) => res.json())
|
|
5
5
|
.then((data) => {
|
|
6
6
|
Object.keys(data).forEach((item) => {
|
|
7
|
-
target[item] = target[item] ? target[item] :
|
|
7
|
+
target[item] = target[item] ? target[item] : target['en'];
|
|
8
8
|
for (let key in data[item]) {
|
|
9
|
-
|
|
9
|
+
if (typeof data[item][key] === 'object') {
|
|
10
|
+
Object.keys(data[item][key]).forEach((subKey) => {
|
|
11
|
+
target[item][key][subKey] = data[item][key][subKey];
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
target[item][key] = data[item][key];
|
|
16
|
+
}
|
|
10
17
|
}
|
|
11
18
|
});
|
|
12
19
|
resolve(true);
|
|
@@ -6,9 +6,16 @@ const mergeTranslations = (url, target) => {
|
|
|
6
6
|
.then((res) => res.json())
|
|
7
7
|
.then((data) => {
|
|
8
8
|
Object.keys(data).forEach((item) => {
|
|
9
|
-
target[item] = target[item] ? target[item] :
|
|
9
|
+
target[item] = target[item] ? target[item] : target['en'];
|
|
10
10
|
for (let key in data[item]) {
|
|
11
|
-
|
|
11
|
+
if (typeof data[item][key] === 'object') {
|
|
12
|
+
Object.keys(data[item][key]).forEach((subKey) => {
|
|
13
|
+
target[item][key][subKey] = data[item][key][subKey];
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
target[item][key] = data[item][key];
|
|
18
|
+
}
|
|
12
19
|
}
|
|
13
20
|
});
|
|
14
21
|
resolve(true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,b as n}from"./p-8f5d4d70.js";export{s as setNonce}from"./p-8f5d4d70.js";import{g as r}from"./p-e1255160.js";(()=>{const n=import.meta.url,r={};return""!==n&&(r.resourcesUrl=new URL(".",n).href),t(r)})().then((async t=>(await r(),n([["p-
|
|
1
|
+
import{p as t,b as n}from"./p-8f5d4d70.js";export{s as setNonce}from"./p-8f5d4d70.js";import{g as r}from"./p-e1255160.js";(()=>{const n=import.meta.url,r={};return""!==n&&(r.resourcesUrl=new URL(".",n).href),t(r)})().then((async t=>(await r(),n([["p-14aa5921",[[4,"general-styling-wrapper",{clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],translationUrl:[1,"translation-url"],targetTranslations:[16]}]]]],t))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as s,g as e}from"./p-8f5d4d70.js";const i=class{constructor(s){t(this,s),this.stylingAppends=!1,this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.el.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),s=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{s.innerHTML=t,setTimeout((()=>{this.el.prepend(s)}),1)})).catch((t=>{console.log("error ",t)}))},this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.targetTranslations=void 0}componentDidRender(){this.stylingAppends||(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.stylingAppends=!0)}async componentWillLoad(){const t=[];if(this.translationUrl){const i=(s=this.translationUrl,e=this.targetTranslations,new Promise((t=>{fetch(s).then((t=>t.json())).then((s=>{Object.keys(s).forEach((t=>{e[t]=e[t]?e[t]:
|
|
1
|
+
import{r as t,h as s,g as e}from"./p-8f5d4d70.js";const i=class{constructor(s){t(this,s),this.stylingAppends=!1,this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.el.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),s=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{s.innerHTML=t,setTimeout((()=>{this.el.prepend(s)}),1)})).catch((t=>{console.log("error ",t)}))},this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.targetTranslations=void 0}componentDidRender(){this.stylingAppends||(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.stylingAppends=!0)}async componentWillLoad(){const t=[];if(this.translationUrl){const i=(s=this.translationUrl,e=this.targetTranslations,new Promise((t=>{fetch(s).then((t=>t.json())).then((s=>{Object.keys(s).forEach((t=>{e[t]=e[t]?e[t]:e.en;for(let i in s[t])"object"==typeof s[t][i]?Object.keys(s[t][i]).forEach((o=>{e[t][i][o]=s[t][i][o]})):e[t][i]=s[t][i]})),t(!0)}))})));t.push(i)}var s,e;return await Promise.all(t)}render(){return s("div",{key:"4d3414408c7662f88331dbe655966237f74d6958",class:"StyleShell"},s("slot",{key:"1d004644d84602c4314bdf5dfc26b55b160f57df",name:"mainContent"}))}get el(){return e(this)}};i.style=":host{display:block}";export{i as general_styling_wrapper}
|