@everymatrix/general-styling-wrapper 1.66.2 → 1.67.3

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 (14) hide show
  1. package/dist/cjs/general-styling-wrapper.cjs.entry.js +9 -4
  2. package/dist/collection/utils/locale.utils.js +9 -4
  3. package/dist/esm/general-styling-wrapper.entry.js +9 -4
  4. package/dist/general-styling-wrapper/general-styling-wrapper.entry.js +1 -1
  5. package/package.json +1 -1
  6. /package/dist/types/Users/{adrian.pripon/Documents/Work → sebastian.strulea/Documents/work}/widgets-monorepo/packages/stencil/general-styling-wrapper/.stencil/libs/common/src/storybook/storybook-utils.d.ts +0 -0
  7. /package/dist/types/Users/{adrian.pripon/Documents/Work → sebastian.strulea/Documents/work}/widgets-monorepo/packages/stencil/general-styling-wrapper/.stencil/packages/stencil/general-styling-wrapper/stencil.config.d.ts +0 -0
  8. /package/dist/types/Users/{adrian.pripon/Documents/Work → sebastian.strulea/Documents/work}/widgets-monorepo/packages/stencil/general-styling-wrapper/.stencil/packages/stencil/general-styling-wrapper/stencil.config.dev.d.ts +0 -0
  9. /package/dist/types/Users/{adrian.pripon/Documents/Work → sebastian.strulea/Documents/work}/widgets-monorepo/packages/stencil/general-styling-wrapper/.stencil/packages/stencil/general-styling-wrapper/storybook/main.d.ts +0 -0
  10. /package/dist/types/Users/{adrian.pripon/Documents/Work → sebastian.strulea/Documents/work}/widgets-monorepo/packages/stencil/general-styling-wrapper/.stencil/packages/stencil/general-styling-wrapper/storybook/preview.d.ts +0 -0
  11. /package/dist/types/Users/{adrian.pripon/Documents/Work → sebastian.strulea/Documents/work}/widgets-monorepo/packages/stencil/general-styling-wrapper/.stencil/tools/plugins/index.d.ts +0 -0
  12. /package/dist/types/Users/{adrian.pripon/Documents/Work → sebastian.strulea/Documents/work}/widgets-monorepo/packages/stencil/general-styling-wrapper/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
  13. /package/dist/types/Users/{adrian.pripon/Documents/Work → sebastian.strulea/Documents/work}/widgets-monorepo/packages/stencil/general-styling-wrapper/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
  14. /package/dist/types/Users/{adrian.pripon/Documents/Work → sebastian.strulea/Documents/work}/widgets-monorepo/packages/stencil/general-styling-wrapper/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
@@ -10,10 +10,15 @@ 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] : target['en'];
14
- for (let key in data[item]) {
13
+ target[item] = target[item] || target['en'];
14
+ Object.keys(data[item]).forEach((key) => {
15
+ //if there is not key in target, do nothing
16
+ if (!target['en'][key]) {
17
+ return;
18
+ }
19
+ // if the key is not in target, then take from en
20
+ target[item][key] = target[item][key] || target['en'][key];
15
21
  if (typeof data[item][key] === 'object') {
16
- target[item][key] = target[item][key] || target['en'][key];
17
22
  Object.keys(data[item][key]).forEach((subKey) => {
18
23
  target[item][key][subKey] = data[item][key][subKey];
19
24
  });
@@ -21,7 +26,7 @@ const mergeTranslations = (url, target) => {
21
26
  else {
22
27
  target[item][key] = data[item][key];
23
28
  }
24
- }
29
+ });
25
30
  });
26
31
  resolve(true);
27
32
  });
@@ -4,10 +4,15 @@ 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] : target['en'];
8
- for (let key in data[item]) {
7
+ target[item] = target[item] || target['en'];
8
+ Object.keys(data[item]).forEach((key) => {
9
+ //if there is not key in target, do nothing
10
+ if (!target['en'][key]) {
11
+ return;
12
+ }
13
+ // if the key is not in target, then take from en
14
+ target[item][key] = target[item][key] || target['en'][key];
9
15
  if (typeof data[item][key] === 'object') {
10
- target[item][key] = target[item][key] || target['en'][key];
11
16
  Object.keys(data[item][key]).forEach((subKey) => {
12
17
  target[item][key][subKey] = data[item][key][subKey];
13
18
  });
@@ -15,7 +20,7 @@ export const mergeTranslations = (url, target) => {
15
20
  else {
16
21
  target[item][key] = data[item][key];
17
22
  }
18
- }
23
+ });
19
24
  });
20
25
  resolve(true);
21
26
  });
@@ -6,10 +6,15 @@ 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] : target['en'];
10
- for (let key in data[item]) {
9
+ target[item] = target[item] || target['en'];
10
+ Object.keys(data[item]).forEach((key) => {
11
+ //if there is not key in target, do nothing
12
+ if (!target['en'][key]) {
13
+ return;
14
+ }
15
+ // if the key is not in target, then take from en
16
+ target[item][key] = target[item][key] || target['en'][key];
11
17
  if (typeof data[item][key] === 'object') {
12
- target[item][key] = target[item][key] || target['en'][key];
13
18
  Object.keys(data[item][key]).forEach((subKey) => {
14
19
  target[item][key][subKey] = data[item][key][subKey];
15
20
  });
@@ -17,7 +22,7 @@ const mergeTranslations = (url, target) => {
17
22
  else {
18
23
  target[item][key] = data[item][key];
19
24
  }
20
- }
25
+ });
21
26
  });
22
27
  resolve(true);
23
28
  });
@@ -1 +1 @@
1
- import{r as t,h as s,g as e}from"./index-5d1b44a7.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]?(e[t][i]=e[t][i]||e.en[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}
1
+ import{r as t,h as s,g as e}from"./index-5d1b44a7.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.en,Object.keys(s[t]).forEach((i=>{e.en[i]&&(e[t][i]=e[t][i]||e.en[i],"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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/general-styling-wrapper",
3
- "version": "1.66.2",
3
+ "version": "1.67.3",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",