@viewfly/scoped-css 0.0.17 → 0.0.18

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.
@@ -1,6 +1,6 @@
1
1
  import { JSXElement, JSXComponent } from '@viewfly/core';
2
2
 
3
- function replaceCSSClass(template, cssNamespace) {
3
+ function addOnScopedKeys(template, cssNamespace) {
4
4
  if (template instanceof JSXElement || template instanceof JSXComponent) {
5
5
  const children = template.props.children;
6
6
  const nameSpaces = Array.isArray(cssNamespace) ? cssNamespace : [cssNamespace];
@@ -11,18 +11,18 @@ function replaceCSSClass(template, cssNamespace) {
11
11
  });
12
12
  if (Array.isArray(children)) {
13
13
  children.forEach(child => {
14
- replaceCSSClass(child, cssNamespace);
14
+ addOnScopedKeys(child, cssNamespace);
15
15
  });
16
16
  }
17
17
  else {
18
- replaceCSSClass(children, cssNamespace);
18
+ addOnScopedKeys(children, cssNamespace);
19
19
  }
20
20
  }
21
21
  return template;
22
22
  }
23
23
  function withScopedCSS(cssNamespace, render) {
24
24
  return function scopedCSS() {
25
- return replaceCSSClass(render(), cssNamespace);
25
+ return addOnScopedKeys(render(), cssNamespace);
26
26
  };
27
27
  }
28
28
 
package/bundles/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  var core = require('@viewfly/core');
4
4
 
5
- function replaceCSSClass(template, cssNamespace) {
5
+ function addOnScopedKeys(template, cssNamespace) {
6
6
  if (template instanceof core.JSXElement || template instanceof core.JSXComponent) {
7
7
  const children = template.props.children;
8
8
  const nameSpaces = Array.isArray(cssNamespace) ? cssNamespace : [cssNamespace];
@@ -13,18 +13,18 @@ function replaceCSSClass(template, cssNamespace) {
13
13
  });
14
14
  if (Array.isArray(children)) {
15
15
  children.forEach(child => {
16
- replaceCSSClass(child, cssNamespace);
16
+ addOnScopedKeys(child, cssNamespace);
17
17
  });
18
18
  }
19
19
  else {
20
- replaceCSSClass(children, cssNamespace);
20
+ addOnScopedKeys(children, cssNamespace);
21
21
  }
22
22
  }
23
23
  return template;
24
24
  }
25
25
  function withScopedCSS(cssNamespace, render) {
26
26
  return function scopedCSS() {
27
- return replaceCSSClass(render(), cssNamespace);
27
+ return addOnScopedKeys(render(), cssNamespace);
28
28
  };
29
29
  }
30
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewfly/scoped-css",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "A library for supporting scoped style sheets in the Viewfly framework。",
5
5
  "main": "./bundles/index.js",
6
6
  "module": "./bundles/index.esm.js",
@@ -12,7 +12,7 @@
12
12
  "license": "MIT",
13
13
  "keywords": [],
14
14
  "dependencies": {
15
- "@viewfly/core": "^0.0.17"
15
+ "@viewfly/core": "^0.0.18"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@rollup/plugin-commonjs": "^25.0.3",
@@ -32,5 +32,5 @@
32
32
  "bugs": {
33
33
  "url": "https://github.com/viewfly/viewfly.git/issues"
34
34
  },
35
- "gitHead": "7a61edbca87f411d2ddbb390eb0b2e0416d80551"
35
+ "gitHead": "1cc6ec2decf3173792086553af0b3e171d49deae"
36
36
  }