@webstudio-is/css-data 0.56.0 → 0.58.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/schema.js +5 -16
- package/lib/schema.js +5 -16
- package/lib/types/src/schema.d.ts +91 -1375
- package/package.json +4 -4
- package/src/schema.ts +22 -23
package/lib/cjs/schema.js
CHANGED
|
@@ -18,7 +18,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var schema_exports = {};
|
|
20
20
|
__export(schema_exports, {
|
|
21
|
-
CssRule: () => CssRule,
|
|
22
21
|
ImageValue: () => ImageValue,
|
|
23
22
|
InvalidValue: () => InvalidValue,
|
|
24
23
|
KeywordValue: () => KeywordValue,
|
|
@@ -28,7 +27,7 @@ __export(schema_exports, {
|
|
|
28
27
|
TupleValueItem: () => TupleValueItem,
|
|
29
28
|
UnitValue: () => UnitValue,
|
|
30
29
|
UnparsedValue: () => UnparsedValue,
|
|
31
|
-
|
|
30
|
+
isValidStaticStyleValue: () => isValidStaticStyleValue
|
|
32
31
|
});
|
|
33
32
|
module.exports = __toCommonJS(schema_exports);
|
|
34
33
|
var import_units = require("./__generated__/units");
|
|
@@ -103,16 +102,6 @@ const LayersValue = import_zod.z.object({
|
|
|
103
102
|
])
|
|
104
103
|
)
|
|
105
104
|
});
|
|
106
|
-
const validStaticValueTypes = [
|
|
107
|
-
"unit",
|
|
108
|
-
"keyword",
|
|
109
|
-
"fontFamily",
|
|
110
|
-
"rgb",
|
|
111
|
-
"image",
|
|
112
|
-
"unparsed",
|
|
113
|
-
"layers",
|
|
114
|
-
"tuple"
|
|
115
|
-
];
|
|
116
105
|
const ValidStaticStyleValue = import_zod.z.union([
|
|
117
106
|
ImageValue,
|
|
118
107
|
LayersValue,
|
|
@@ -123,6 +112,10 @@ const ValidStaticStyleValue = import_zod.z.union([
|
|
|
123
112
|
UnparsedValue,
|
|
124
113
|
TupleValue
|
|
125
114
|
]);
|
|
115
|
+
const isValidStaticStyleValue = (styleValue) => {
|
|
116
|
+
const staticStyleValue = styleValue;
|
|
117
|
+
return staticStyleValue.type === "image" || staticStyleValue.type === "layers" || staticStyleValue.type === "unit" || staticStyleValue.type === "keyword" || staticStyleValue.type === "fontFamily" || staticStyleValue.type === "rgb" || staticStyleValue.type === "unparsed" || staticStyleValue.type === "tuple";
|
|
118
|
+
};
|
|
126
119
|
const VarValue = import_zod.z.object({
|
|
127
120
|
type: import_zod.z.literal("var"),
|
|
128
121
|
value: import_zod.z.string(),
|
|
@@ -135,7 +128,3 @@ const StyleValue = import_zod.z.union([
|
|
|
135
128
|
VarValue
|
|
136
129
|
]);
|
|
137
130
|
const Style = import_zod.z.record(import_zod.z.string(), StyleValue);
|
|
138
|
-
const CssRule = import_zod.z.object({
|
|
139
|
-
style: Style,
|
|
140
|
-
breakpoint: import_zod.z.optional(import_zod.z.string())
|
|
141
|
-
});
|
package/lib/schema.js
CHANGED
|
@@ -70,16 +70,6 @@ const LayersValue = z.object({
|
|
|
70
70
|
])
|
|
71
71
|
)
|
|
72
72
|
});
|
|
73
|
-
const validStaticValueTypes = [
|
|
74
|
-
"unit",
|
|
75
|
-
"keyword",
|
|
76
|
-
"fontFamily",
|
|
77
|
-
"rgb",
|
|
78
|
-
"image",
|
|
79
|
-
"unparsed",
|
|
80
|
-
"layers",
|
|
81
|
-
"tuple"
|
|
82
|
-
];
|
|
83
73
|
const ValidStaticStyleValue = z.union([
|
|
84
74
|
ImageValue,
|
|
85
75
|
LayersValue,
|
|
@@ -90,6 +80,10 @@ const ValidStaticStyleValue = z.union([
|
|
|
90
80
|
UnparsedValue,
|
|
91
81
|
TupleValue
|
|
92
82
|
]);
|
|
83
|
+
const isValidStaticStyleValue = (styleValue) => {
|
|
84
|
+
const staticStyleValue = styleValue;
|
|
85
|
+
return staticStyleValue.type === "image" || staticStyleValue.type === "layers" || staticStyleValue.type === "unit" || staticStyleValue.type === "keyword" || staticStyleValue.type === "fontFamily" || staticStyleValue.type === "rgb" || staticStyleValue.type === "unparsed" || staticStyleValue.type === "tuple";
|
|
86
|
+
};
|
|
93
87
|
const VarValue = z.object({
|
|
94
88
|
type: z.literal("var"),
|
|
95
89
|
value: z.string(),
|
|
@@ -102,12 +96,7 @@ const StyleValue = z.union([
|
|
|
102
96
|
VarValue
|
|
103
97
|
]);
|
|
104
98
|
const Style = z.record(z.string(), StyleValue);
|
|
105
|
-
const CssRule = z.object({
|
|
106
|
-
style: Style,
|
|
107
|
-
breakpoint: z.optional(z.string())
|
|
108
|
-
});
|
|
109
99
|
export {
|
|
110
|
-
CssRule,
|
|
111
100
|
ImageValue,
|
|
112
101
|
InvalidValue,
|
|
113
102
|
KeywordValue,
|
|
@@ -117,5 +106,5 @@ export {
|
|
|
117
106
|
TupleValueItem,
|
|
118
107
|
UnitValue,
|
|
119
108
|
UnparsedValue,
|
|
120
|
-
|
|
109
|
+
isValidStaticStyleValue
|
|
121
110
|
};
|