@webstudio-is/css-engine 0.47.0 → 0.49.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.
@@ -67,9 +67,15 @@ const toValue = (value, options = defaultOptions) => {
67
67
  return `rgba(${value.r}, ${value.g}, ${value.b}, ${value.alpha})`;
68
68
  }
69
69
  if (value.type === "image") {
70
+ if (value.hidden) {
71
+ return "none";
72
+ }
70
73
  return `url(${value.value.value.path}) /* id=${value.value.value.id} */`;
71
74
  }
72
75
  if (value.type === "unparsed") {
76
+ if (value.hidden) {
77
+ return "none";
78
+ }
73
79
  return value.value;
74
80
  }
75
81
  if (value.type === "layers") {
@@ -44,9 +44,15 @@ const toValue = (value, options = defaultOptions) => {
44
44
  return `rgba(${value.r}, ${value.g}, ${value.b}, ${value.alpha})`;
45
45
  }
46
46
  if (value.type === "image") {
47
+ if (value.hidden) {
48
+ return "none";
49
+ }
47
50
  return `url(${value.value.value.path}) /* id=${value.value.value.id} */`;
48
51
  }
49
52
  if (value.type === "unparsed") {
53
+ if (value.hidden) {
54
+ return "none";
55
+ }
50
56
  return value.value;
51
57
  }
52
58
  if (value.type === "layers") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/css-engine",
3
- "version": "0.47.0",
3
+ "version": "0.49.0",
4
4
  "description": "CSS Renderer for Webstudio",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -9,23 +9,26 @@
9
9
  "hyphenate-style-name": "^1.0.4",
10
10
  "react": "^17.0.2",
11
11
  "react-dom": "^17.0.2",
12
- "@webstudio-is/fonts": "^0.47.0"
12
+ "@webstudio-is/fonts": "^0.49.0"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@jest/globals": "^29.3.1",
16
- "@storybook/react": "^6.5.14",
16
+ "@storybook/react": "^6.5.16",
17
17
  "@types/hyphenate-style-name": "^1.0.0",
18
18
  "@types/react": "^17.0.24",
19
19
  "@types/react-dom": "^17.0.9",
20
20
  "jest": "^29.3.1",
21
21
  "typescript": "4.9.5",
22
- "@webstudio-is/css-data": "^0.47.0",
22
+ "@webstudio-is/css-data": "^0.49.0",
23
23
  "@webstudio-is/jest-config": "^1.0.2",
24
24
  "@webstudio-is/scripts": "^0.0.0",
25
25
  "@webstudio-is/storybook-config": "^0.0.0",
26
26
  "@webstudio-is/tsconfig": "^1.0.1"
27
27
  },
28
- "exports": "./lib/index.js",
28
+ "exports": {
29
+ "source": "./src/index.ts",
30
+ "import": "./lib/index.js"
31
+ },
29
32
  "types": "src/index.ts",
30
33
  "files": [
31
34
  "lib/*",
@@ -62,11 +62,25 @@ export const toValue = (
62
62
  }
63
63
 
64
64
  if (value.type === "image") {
65
+ if (value.hidden) {
66
+ // We assume that property is background-image and use this to hide background layers
67
+ // In the future we might want to have a more generic way to hide values
68
+ // i.e. have knowledge about property-name, as none is property specific
69
+ return "none";
70
+ }
71
+
65
72
  // @todo image-set
66
73
  return `url(${value.value.value.path}) /* id=${value.value.value.id} */`;
67
74
  }
68
75
 
69
76
  if (value.type === "unparsed") {
77
+ if (value.hidden) {
78
+ // We assume that property is background-image and use this to hide background layers
79
+ // In the future we might want to have a more generic way to hide values
80
+ // i.e. have knowledge about property-name, as none is property specific
81
+ return "none";
82
+ }
83
+
70
84
  return value.value;
71
85
  }
72
86