@webstudio-is/css-engine 0.74.0 → 0.76.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/lib/cjs/core/index.js +1 -0
- package/lib/cjs/core/to-value.js +6 -1
- package/lib/core/index.js +1 -0
- package/lib/core/to-value.js +6 -1
- package/lib/types/core/index.d.ts +1 -0
- package/package.json +9 -11
- package/src/core/index.ts +1 -0
- package/src/core/to-value.ts +10 -2
package/lib/cjs/core/index.js
CHANGED
|
@@ -25,6 +25,7 @@ module.exports = __toCommonJS(core_exports);
|
|
|
25
25
|
var import_css_engine = require("./css-engine");
|
|
26
26
|
__reExport(core_exports, require("./create-css-engine"), module.exports);
|
|
27
27
|
__reExport(core_exports, require("./to-value"), module.exports);
|
|
28
|
+
__reExport(core_exports, require("./to-property"), module.exports);
|
|
28
29
|
__reExport(core_exports, require("./match-media"), module.exports);
|
|
29
30
|
__reExport(core_exports, require("./equal-media"), module.exports);
|
|
30
31
|
__reExport(core_exports, require("./compare-media"), module.exports);
|
package/lib/cjs/core/to-value.js
CHANGED
|
@@ -86,7 +86,12 @@ const toValue = (styleValue, transformValue) => {
|
|
|
86
86
|
return value.value;
|
|
87
87
|
}
|
|
88
88
|
if (value.type === "layers") {
|
|
89
|
-
|
|
89
|
+
const valueString = value.value.filter(
|
|
90
|
+
(layer) => "hidden" in layer === false || "hidden" in layer && layer.hidden === false
|
|
91
|
+
).map((layer) => {
|
|
92
|
+
return toValue(layer, transformValue);
|
|
93
|
+
}).join(", ");
|
|
94
|
+
return valueString === "" ? "none" : valueString;
|
|
90
95
|
}
|
|
91
96
|
if (value.type === "tuple") {
|
|
92
97
|
return value.value.map((value2) => toValue(value2, transformValue)).join(" ");
|
package/lib/core/index.js
CHANGED
package/lib/core/to-value.js
CHANGED
|
@@ -63,7 +63,12 @@ const toValue = (styleValue, transformValue) => {
|
|
|
63
63
|
return value.value;
|
|
64
64
|
}
|
|
65
65
|
if (value.type === "layers") {
|
|
66
|
-
|
|
66
|
+
const valueString = value.value.filter(
|
|
67
|
+
(layer) => "hidden" in layer === false || "hidden" in layer && layer.hidden === false
|
|
68
|
+
).map((layer) => {
|
|
69
|
+
return toValue(layer, transformValue);
|
|
70
|
+
}).join(", ");
|
|
71
|
+
return valueString === "" ? "none" : valueString;
|
|
67
72
|
}
|
|
68
73
|
if (value.type === "tuple") {
|
|
69
74
|
return value.value.map((value2) => toValue(value2, transformValue)).join(" ");
|
|
@@ -2,6 +2,7 @@ export { CssEngine } from "./css-engine";
|
|
|
2
2
|
export type { AnyRule, StyleRule, MediaRule, PlaintextRule, FontFaceRule, } from "./rules";
|
|
3
3
|
export * from "./create-css-engine";
|
|
4
4
|
export * from "./to-value";
|
|
5
|
+
export * from "./to-property";
|
|
5
6
|
export * from "./match-media";
|
|
6
7
|
export * from "./equal-media";
|
|
7
8
|
export * from "./compare-media";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/css-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.76.0",
|
|
4
4
|
"description": "CSS Renderer for Webstudio",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -9,12 +9,11 @@
|
|
|
9
9
|
"hyphenate-style-name": "^1.0.4",
|
|
10
10
|
"react": "^18.2.0",
|
|
11
11
|
"react-dom": "^18.2.0",
|
|
12
|
-
"@webstudio-is/css-data": "^0.
|
|
13
|
-
"@webstudio-is/fonts": "^0.
|
|
12
|
+
"@webstudio-is/css-data": "^0.76.0",
|
|
13
|
+
"@webstudio-is/fonts": "^0.76.0"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@jest/globals": "^29.3.1",
|
|
17
|
-
"@storybook/react": "^6.5.16",
|
|
18
17
|
"@types/hyphenate-style-name": "^1.0.0",
|
|
19
18
|
"@types/react": "^18.0.35",
|
|
20
19
|
"@types/react-dom": "^18.0.11",
|
|
@@ -27,8 +26,8 @@
|
|
|
27
26
|
},
|
|
28
27
|
"exports": {
|
|
29
28
|
"source": "./src/index.ts",
|
|
30
|
-
"
|
|
31
|
-
"
|
|
29
|
+
"types": "./lib/types/index.d.ts",
|
|
30
|
+
"import": "./lib/index.js"
|
|
32
31
|
},
|
|
33
32
|
"files": [
|
|
34
33
|
"lib/*",
|
|
@@ -40,13 +39,12 @@
|
|
|
40
39
|
"sideEffects": false,
|
|
41
40
|
"scripts": {
|
|
42
41
|
"typecheck": "tsc --noEmit --emitDeclarationOnly false",
|
|
43
|
-
"checks": "pnpm typecheck && pnpm
|
|
42
|
+
"checks": "pnpm typecheck && pnpm test",
|
|
44
43
|
"dev": "build-package --watch",
|
|
45
44
|
"build": "build-package",
|
|
46
|
-
"dts": "tsc --
|
|
45
|
+
"dts": "tsc --project tsconfig.dts.json",
|
|
47
46
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
48
|
-
"
|
|
49
|
-
"storybook:
|
|
50
|
-
"storybook:build": "build-storybook"
|
|
47
|
+
"storybook:dev": "storybook dev -p 6006",
|
|
48
|
+
"storybook:build": "storybook build"
|
|
51
49
|
}
|
|
52
50
|
}
|
package/src/core/index.ts
CHANGED
package/src/core/to-value.ts
CHANGED
|
@@ -91,9 +91,17 @@ export const toValue = (
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
if (value.type === "layers") {
|
|
94
|
-
|
|
95
|
-
.
|
|
94
|
+
const valueString = value.value
|
|
95
|
+
.filter(
|
|
96
|
+
(layer) =>
|
|
97
|
+
"hidden" in layer === false ||
|
|
98
|
+
("hidden" in layer && layer.hidden === false)
|
|
99
|
+
)
|
|
100
|
+
.map((layer) => {
|
|
101
|
+
return toValue(layer, transformValue);
|
|
102
|
+
})
|
|
96
103
|
.join(", ");
|
|
104
|
+
return valueString === "" ? "none" : valueString;
|
|
97
105
|
}
|
|
98
106
|
|
|
99
107
|
if (value.type === "tuple") {
|