@semcore/core 1.13.18 → 1.14.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.
package/CHANGELOG.md CHANGED
@@ -2,11 +2,17 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
- ## [1.13.18] - 2023-03-13
5
+ ## [1.14.0] - 2023-03-16
6
6
 
7
7
  ### Changed
8
8
 
9
- - Version patch update due to children dependencies update (`@semcore/utils` [3.47.1 ~> 3.47.2]).
9
+ - Changed logic of merging component styles and context styles due to losing context styles before.
10
+
11
+ ## [1.13.19] - 2023-03-16
12
+
13
+ ### Changed
14
+
15
+ - Version patch update due to children dependencies update (`@semcore/utils` [3.47.2 ~> 3.47.3]).
10
16
 
11
17
  ## [1.13.15] - 2023-02-09
12
18
 
@@ -31,6 +31,10 @@ function Enhancement(childComponents, Context) {
31
31
  return Boolean(Component.style || Component[_staticChildren.STATIC_COMPONENT]);
32
32
  },
33
33
  init: function init(props, WrapperComponent) {
34
+ if (props.styles) {
35
+ this[STYLES_SELF] = props.styles;
36
+ }
37
+
34
38
  if (WrapperComponent.style) {
35
39
  this[STYLES_SELF] = _styled.sstyled.merge(WrapperComponent.style, props._styles);
36
40
  }
@@ -49,7 +53,7 @@ function Enhancement(childComponents, Context) {
49
53
  styles = _ref.styles,
50
54
  props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
51
55
  return (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, props), {}, {
52
- styles: styles || this[STYLES_SELF]
56
+ styles: this[STYLES_SELF]
53
57
  });
54
58
  },
55
59
  wrapperProps: function wrapperProps(_ref2) {
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","names":["STYLES_CONTEXT","Symbol","STYLES_SELF","Enhancement","childComponents","Context","condition","Component","Boolean","style","STATIC_COMPONENT","init","props","WrapperComponent","sstyled","merge","_styles","context","Object","keys","length","asProps","styles","wrapperProps","useContext"],"sources":["../../../src/enhancement/style.tsx"],"sourcesContent":["import { useContext } from 'react';\n// @ts-ignore\nimport { sstyled } from '../styled';\nimport { STATIC_COMPONENT } from './staticChildren';\n\nexport const STYLES_CONTEXT = Symbol('STYLES_CONTEXT');\nconst STYLES_SELF = Symbol('STYLES_SELF');\n\nfunction Enhancement(childComponents, Context) {\n return {\n condition: function (Component) {\n return Boolean(Component.style || Component[STATIC_COMPONENT]);\n },\n init: function (props, WrapperComponent) {\n if (WrapperComponent.style) {\n this[STYLES_SELF] = sstyled.merge(WrapperComponent.style, props._styles);\n }\n },\n context: function (context) {\n // Optimization: if has no children there is no need to create new context (by lsroman)\n if (!this[STYLES_SELF] || !Object.keys(childComponents).length) {\n return context;\n }\n return {\n ...context,\n [STYLES_CONTEXT]: this[STYLES_SELF],\n };\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n asProps: function ({ _styles, styles, ...props }) {\n return {\n ...props,\n styles: styles || this[STYLES_SELF],\n };\n },\n wrapperProps: function ({ styles, ...props }) {\n const context = useContext(Context);\n return {\n ...props,\n _styles: styles,\n styles: context[STYLES_CONTEXT],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;;;AAEO,IAAMA,cAAc,GAAGC,MAAM,CAAC,gBAAD,CAA7B;;AACP,IAAMC,WAAW,GAAGD,MAAM,CAAC,aAAD,CAA1B;;AAEA,SAASE,WAAT,CAAqBC,eAArB,EAAsCC,OAAtC,EAA+C;EAC7C,OAAO;IACLC,SAAS,EAAE,mBAAUC,SAAV,EAAqB;MAC9B,OAAOC,OAAO,CAACD,SAAS,CAACE,KAAV,IAAmBF,SAAS,CAACG,gCAAD,CAA7B,CAAd;IACD,CAHI;IAILC,IAAI,EAAE,cAAUC,KAAV,EAAiBC,gBAAjB,EAAmC;MACvC,IAAIA,gBAAgB,CAACJ,KAArB,EAA4B;QAC1B,KAAKP,WAAL,IAAoBY,eAAA,CAAQC,KAAR,CAAcF,gBAAgB,CAACJ,KAA/B,EAAsCG,KAAK,CAACI,OAA5C,CAApB;MACD;IACF,CARI;IASLC,OAAO,EAAE,iBAAUA,QAAV,EAAmB;MAC1B;MACA,IAAI,CAAC,KAAKf,WAAL,CAAD,IAAsB,CAACgB,MAAM,CAACC,IAAP,CAAYf,eAAZ,EAA6BgB,MAAxD,EAAgE;QAC9D,OAAOH,QAAP;MACD;;MACD,yEACKA,QADL,4CAEGjB,cAFH,EAEoB,KAAKE,WAAL,CAFpB;IAID,CAlBI;IAmBL;IACAmB,OAAO,EAAE,uBAAyC;MAAA,IAA7BL,OAA6B,QAA7BA,OAA6B;MAAA,IAApBM,MAAoB,QAApBA,MAAoB;MAAA,IAATV,KAAS;MAChD,yEACKA,KADL;QAEEU,MAAM,EAAEA,MAAM,IAAI,KAAKpB,WAAL;MAFpB;IAID,CAzBI;IA0BLqB,YAAY,EAAE,6BAAgC;MAAA,IAApBD,MAAoB,SAApBA,MAAoB;MAAA,IAATV,KAAS;MAC5C,IAAMK,OAAO,GAAG,IAAAO,iBAAA,EAAWnB,OAAX,CAAhB;MACA,yEACKO,KADL;QAEEI,OAAO,EAAEM,MAFX;QAGEA,MAAM,EAAEL,OAAO,CAACjB,cAAD;MAHjB;IAKD;EAjCI,CAAP;AAmCD;;eAEcG,W"}
1
+ {"version":3,"file":"style.js","names":["STYLES_CONTEXT","Symbol","STYLES_SELF","Enhancement","childComponents","Context","condition","Component","Boolean","style","STATIC_COMPONENT","init","props","WrapperComponent","styles","sstyled","merge","_styles","context","Object","keys","length","asProps","wrapperProps","useContext"],"sources":["../../../src/enhancement/style.tsx"],"sourcesContent":["import { useContext } from 'react';\n// @ts-ignore\nimport { sstyled } from '../styled';\nimport { STATIC_COMPONENT } from './staticChildren';\n\nexport const STYLES_CONTEXT = Symbol('STYLES_CONTEXT');\nconst STYLES_SELF = Symbol('STYLES_SELF');\n\nfunction Enhancement(childComponents, Context) {\n return {\n condition: function (Component) {\n return Boolean(Component.style || Component[STATIC_COMPONENT]);\n },\n init: function (props, WrapperComponent) {\n if (props.styles) {\n this[STYLES_SELF] = props.styles;\n }\n if (WrapperComponent.style) {\n this[STYLES_SELF] = sstyled.merge(WrapperComponent.style, props._styles);\n }\n },\n context: function (context) {\n // Optimization: if has no children there is no need to create new context (by lsroman)\n if (!this[STYLES_SELF] || !Object.keys(childComponents).length) {\n return context;\n }\n return {\n ...context,\n [STYLES_CONTEXT]: this[STYLES_SELF],\n };\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n asProps: function ({ _styles, styles, ...props }) {\n return {\n ...props,\n styles: this[STYLES_SELF],\n };\n },\n wrapperProps: function ({ styles, ...props }) {\n const context = useContext(Context);\n return {\n ...props,\n _styles: styles,\n styles: context[STYLES_CONTEXT],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;;;AAEO,IAAMA,cAAc,GAAGC,MAAM,CAAC,gBAAD,CAA7B;;AACP,IAAMC,WAAW,GAAGD,MAAM,CAAC,aAAD,CAA1B;;AAEA,SAASE,WAAT,CAAqBC,eAArB,EAAsCC,OAAtC,EAA+C;EAC7C,OAAO;IACLC,SAAS,EAAE,mBAAUC,SAAV,EAAqB;MAC9B,OAAOC,OAAO,CAACD,SAAS,CAACE,KAAV,IAAmBF,SAAS,CAACG,gCAAD,CAA7B,CAAd;IACD,CAHI;IAILC,IAAI,EAAE,cAAUC,KAAV,EAAiBC,gBAAjB,EAAmC;MACvC,IAAID,KAAK,CAACE,MAAV,EAAkB;QAChB,KAAKZ,WAAL,IAAoBU,KAAK,CAACE,MAA1B;MACD;;MACD,IAAID,gBAAgB,CAACJ,KAArB,EAA4B;QAC1B,KAAKP,WAAL,IAAoBa,eAAA,CAAQC,KAAR,CAAcH,gBAAgB,CAACJ,KAA/B,EAAsCG,KAAK,CAACK,OAA5C,CAApB;MACD;IACF,CAXI;IAYLC,OAAO,EAAE,iBAAUA,QAAV,EAAmB;MAC1B;MACA,IAAI,CAAC,KAAKhB,WAAL,CAAD,IAAsB,CAACiB,MAAM,CAACC,IAAP,CAAYhB,eAAZ,EAA6BiB,MAAxD,EAAgE;QAC9D,OAAOH,QAAP;MACD;;MACD,yEACKA,QADL,4CAEGlB,cAFH,EAEoB,KAAKE,WAAL,CAFpB;IAID,CArBI;IAsBL;IACAoB,OAAO,EAAE,uBAAyC;MAAA,IAA7BL,OAA6B,QAA7BA,OAA6B;MAAA,IAApBH,MAAoB,QAApBA,MAAoB;MAAA,IAATF,KAAS;MAChD,yEACKA,KADL;QAEEE,MAAM,EAAE,KAAKZ,WAAL;MAFV;IAID,CA5BI;IA6BLqB,YAAY,EAAE,6BAAgC;MAAA,IAApBT,MAAoB,SAApBA,MAAoB;MAAA,IAATF,KAAS;MAC5C,IAAMM,OAAO,GAAG,IAAAM,iBAAA,EAAWnB,OAAX,CAAhB;MACA,yEACKO,KADL;QAEEK,OAAO,EAAEH,MAFX;QAGEA,MAAM,EAAEI,OAAO,CAAClB,cAAD;MAHjB;IAKD;EApCI,CAAP;AAsCD;;eAEcG,W"}
@@ -16,6 +16,10 @@ function Enhancement(childComponents, Context) {
16
16
  return Boolean(Component.style || Component[STATIC_COMPONENT]);
17
17
  },
18
18
  init: function init(props, WrapperComponent) {
19
+ if (props.styles) {
20
+ this[STYLES_SELF] = props.styles;
21
+ }
22
+
19
23
  if (WrapperComponent.style) {
20
24
  this[STYLES_SELF] = sstyled.merge(WrapperComponent.style, props._styles);
21
25
  }
@@ -35,7 +39,7 @@ function Enhancement(childComponents, Context) {
35
39
  props = _objectWithoutProperties(_ref, _excluded);
36
40
 
37
41
  return _objectSpread(_objectSpread({}, props), {}, {
38
- styles: styles || this[STYLES_SELF]
42
+ styles: this[STYLES_SELF]
39
43
  });
40
44
  },
41
45
  wrapperProps: function wrapperProps(_ref2) {
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","names":["useContext","sstyled","STATIC_COMPONENT","STYLES_CONTEXT","Symbol","STYLES_SELF","Enhancement","childComponents","Context","condition","Component","Boolean","style","init","props","WrapperComponent","merge","_styles","context","Object","keys","length","asProps","styles","wrapperProps"],"sources":["../../../src/enhancement/style.tsx"],"sourcesContent":["import { useContext } from 'react';\n// @ts-ignore\nimport { sstyled } from '../styled';\nimport { STATIC_COMPONENT } from './staticChildren';\n\nexport const STYLES_CONTEXT = Symbol('STYLES_CONTEXT');\nconst STYLES_SELF = Symbol('STYLES_SELF');\n\nfunction Enhancement(childComponents, Context) {\n return {\n condition: function (Component) {\n return Boolean(Component.style || Component[STATIC_COMPONENT]);\n },\n init: function (props, WrapperComponent) {\n if (WrapperComponent.style) {\n this[STYLES_SELF] = sstyled.merge(WrapperComponent.style, props._styles);\n }\n },\n context: function (context) {\n // Optimization: if has no children there is no need to create new context (by lsroman)\n if (!this[STYLES_SELF] || !Object.keys(childComponents).length) {\n return context;\n }\n return {\n ...context,\n [STYLES_CONTEXT]: this[STYLES_SELF],\n };\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n asProps: function ({ _styles, styles, ...props }) {\n return {\n ...props,\n styles: styles || this[STYLES_SELF],\n };\n },\n wrapperProps: function ({ styles, ...props }) {\n const context = useContext(Context);\n return {\n ...props,\n _styles: styles,\n styles: context[STYLES_CONTEXT],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;AAAA,SAASA,UAAT,QAA2B,OAA3B,C,CACA;;AACA,SAASC,OAAT,QAAwB,WAAxB;AACA,SAASC,gBAAT,QAAiC,kBAAjC;AAEA,OAAO,IAAMC,cAAc,GAAGC,MAAM,CAAC,gBAAD,CAA7B;AACP,IAAMC,WAAW,GAAGD,MAAM,CAAC,aAAD,CAA1B;;AAEA,SAASE,WAAT,CAAqBC,eAArB,EAAsCC,OAAtC,EAA+C;EAC7C,OAAO;IACLC,SAAS,EAAE,mBAAUC,SAAV,EAAqB;MAC9B,OAAOC,OAAO,CAACD,SAAS,CAACE,KAAV,IAAmBF,SAAS,CAACR,gBAAD,CAA7B,CAAd;IACD,CAHI;IAILW,IAAI,EAAE,cAAUC,KAAV,EAAiBC,gBAAjB,EAAmC;MACvC,IAAIA,gBAAgB,CAACH,KAArB,EAA4B;QAC1B,KAAKP,WAAL,IAAoBJ,OAAO,CAACe,KAAR,CAAcD,gBAAgB,CAACH,KAA/B,EAAsCE,KAAK,CAACG,OAA5C,CAApB;MACD;IACF,CARI;IASLC,OAAO,EAAE,iBAAUA,QAAV,EAAmB;MAC1B;MACA,IAAI,CAAC,KAAKb,WAAL,CAAD,IAAsB,CAACc,MAAM,CAACC,IAAP,CAAYb,eAAZ,EAA6Bc,MAAxD,EAAgE;QAC9D,OAAOH,QAAP;MACD;;MACD,uCACKA,QADL,2BAEGf,cAFH,EAEoB,KAAKE,WAAL,CAFpB;IAID,CAlBI;IAmBL;IACAiB,OAAO,EAAE,uBAAyC;MAAA,IAA7BL,OAA6B,QAA7BA,OAA6B;MAAA,IAApBM,MAAoB,QAApBA,MAAoB;MAAA,IAATT,KAAS;;MAChD,uCACKA,KADL;QAEES,MAAM,EAAEA,MAAM,IAAI,KAAKlB,WAAL;MAFpB;IAID,CAzBI;IA0BLmB,YAAY,EAAE,6BAAgC;MAAA,IAApBD,MAAoB,SAApBA,MAAoB;MAAA,IAATT,KAAS;;MAC5C,IAAMI,OAAO,GAAGlB,UAAU,CAACQ,OAAD,CAA1B;MACA,uCACKM,KADL;QAEEG,OAAO,EAAEM,MAFX;QAGEA,MAAM,EAAEL,OAAO,CAACf,cAAD;MAHjB;IAKD;EAjCI,CAAP;AAmCD;;AAED,eAAeG,WAAf"}
1
+ {"version":3,"file":"style.js","names":["useContext","sstyled","STATIC_COMPONENT","STYLES_CONTEXT","Symbol","STYLES_SELF","Enhancement","childComponents","Context","condition","Component","Boolean","style","init","props","WrapperComponent","styles","merge","_styles","context","Object","keys","length","asProps","wrapperProps"],"sources":["../../../src/enhancement/style.tsx"],"sourcesContent":["import { useContext } from 'react';\n// @ts-ignore\nimport { sstyled } from '../styled';\nimport { STATIC_COMPONENT } from './staticChildren';\n\nexport const STYLES_CONTEXT = Symbol('STYLES_CONTEXT');\nconst STYLES_SELF = Symbol('STYLES_SELF');\n\nfunction Enhancement(childComponents, Context) {\n return {\n condition: function (Component) {\n return Boolean(Component.style || Component[STATIC_COMPONENT]);\n },\n init: function (props, WrapperComponent) {\n if (props.styles) {\n this[STYLES_SELF] = props.styles;\n }\n if (WrapperComponent.style) {\n this[STYLES_SELF] = sstyled.merge(WrapperComponent.style, props._styles);\n }\n },\n context: function (context) {\n // Optimization: if has no children there is no need to create new context (by lsroman)\n if (!this[STYLES_SELF] || !Object.keys(childComponents).length) {\n return context;\n }\n return {\n ...context,\n [STYLES_CONTEXT]: this[STYLES_SELF],\n };\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n asProps: function ({ _styles, styles, ...props }) {\n return {\n ...props,\n styles: this[STYLES_SELF],\n };\n },\n wrapperProps: function ({ styles, ...props }) {\n const context = useContext(Context);\n return {\n ...props,\n _styles: styles,\n styles: context[STYLES_CONTEXT],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;AAAA,SAASA,UAAT,QAA2B,OAA3B,C,CACA;;AACA,SAASC,OAAT,QAAwB,WAAxB;AACA,SAASC,gBAAT,QAAiC,kBAAjC;AAEA,OAAO,IAAMC,cAAc,GAAGC,MAAM,CAAC,gBAAD,CAA7B;AACP,IAAMC,WAAW,GAAGD,MAAM,CAAC,aAAD,CAA1B;;AAEA,SAASE,WAAT,CAAqBC,eAArB,EAAsCC,OAAtC,EAA+C;EAC7C,OAAO;IACLC,SAAS,EAAE,mBAAUC,SAAV,EAAqB;MAC9B,OAAOC,OAAO,CAACD,SAAS,CAACE,KAAV,IAAmBF,SAAS,CAACR,gBAAD,CAA7B,CAAd;IACD,CAHI;IAILW,IAAI,EAAE,cAAUC,KAAV,EAAiBC,gBAAjB,EAAmC;MACvC,IAAID,KAAK,CAACE,MAAV,EAAkB;QAChB,KAAKX,WAAL,IAAoBS,KAAK,CAACE,MAA1B;MACD;;MACD,IAAID,gBAAgB,CAACH,KAArB,EAA4B;QAC1B,KAAKP,WAAL,IAAoBJ,OAAO,CAACgB,KAAR,CAAcF,gBAAgB,CAACH,KAA/B,EAAsCE,KAAK,CAACI,OAA5C,CAApB;MACD;IACF,CAXI;IAYLC,OAAO,EAAE,iBAAUA,QAAV,EAAmB;MAC1B;MACA,IAAI,CAAC,KAAKd,WAAL,CAAD,IAAsB,CAACe,MAAM,CAACC,IAAP,CAAYd,eAAZ,EAA6Be,MAAxD,EAAgE;QAC9D,OAAOH,QAAP;MACD;;MACD,uCACKA,QADL,2BAEGhB,cAFH,EAEoB,KAAKE,WAAL,CAFpB;IAID,CArBI;IAsBL;IACAkB,OAAO,EAAE,uBAAyC;MAAA,IAA7BL,OAA6B,QAA7BA,OAA6B;MAAA,IAApBF,MAAoB,QAApBA,MAAoB;MAAA,IAATF,KAAS;;MAChD,uCACKA,KADL;QAEEE,MAAM,EAAE,KAAKX,WAAL;MAFV;IAID,CA5BI;IA6BLmB,YAAY,EAAE,6BAAgC;MAAA,IAApBR,MAAoB,SAApBA,MAAoB;MAAA,IAATF,KAAS;;MAC5C,IAAMK,OAAO,GAAGnB,UAAU,CAACQ,OAAD,CAA1B;MACA,uCACKM,KADL;QAEEI,OAAO,EAAEF,MAFX;QAGEA,MAAM,EAAEG,OAAO,CAAChB,cAAD;MAHjB;IAKD;EApCI,CAAP;AAsCD;;AAED,eAAeG,WAAf"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/core",
3
3
  "description": "Semrush Core Component",
4
- "version": "1.13.18",
4
+ "version": "1.14.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",