@webstudio-is/css-data 0.26.0 → 0.28.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.
@@ -42,6 +42,10 @@ const KeywordValue = import_zod.z.object({
42
42
  type: import_zod.z.literal("keyword"),
43
43
  value: import_zod.z.string()
44
44
  });
45
+ const UnparsedValue = import_zod.z.object({
46
+ type: import_zod.z.literal("unparsed"),
47
+ value: import_zod.z.string()
48
+ });
45
49
  const FontFamilyValue = import_zod.z.object({
46
50
  type: import_zod.z.literal("fontFamily"),
47
51
  value: import_zod.z.array(import_zod.z.string())
@@ -70,13 +74,15 @@ const validStaticValueTypes = [
70
74
  "keyword",
71
75
  "fontFamily",
72
76
  "rgb",
73
- "image"
77
+ "image",
78
+ "unparsed"
74
79
  ];
75
80
  const SharedStaticStyleValue = import_zod.z.union([
76
81
  UnitValue,
77
82
  KeywordValue,
78
83
  FontFamilyValue,
79
- RgbValue
84
+ RgbValue,
85
+ UnparsedValue
80
86
  ]);
81
87
  const ValidStaticStyleValue = import_zod.z.union([ImageValue, SharedStaticStyleValue]);
82
88
  const VarValue = import_zod.z.object({
package/lib/schema.js CHANGED
@@ -14,6 +14,10 @@ const KeywordValue = z.object({
14
14
  type: z.literal("keyword"),
15
15
  value: z.string()
16
16
  });
17
+ const UnparsedValue = z.object({
18
+ type: z.literal("unparsed"),
19
+ value: z.string()
20
+ });
17
21
  const FontFamilyValue = z.object({
18
22
  type: z.literal("fontFamily"),
19
23
  value: z.array(z.string())
@@ -42,13 +46,15 @@ const validStaticValueTypes = [
42
46
  "keyword",
43
47
  "fontFamily",
44
48
  "rgb",
45
- "image"
49
+ "image",
50
+ "unparsed"
46
51
  ];
47
52
  const SharedStaticStyleValue = z.union([
48
53
  UnitValue,
49
54
  KeywordValue,
50
55
  FontFamilyValue,
51
- RgbValue
56
+ RgbValue,
57
+ UnparsedValue
52
58
  ]);
53
59
  const ValidStaticStyleValue = z.union([ImageValue, SharedStaticStyleValue]);
54
60
  const VarValue = z.object({
package/package.json CHANGED
@@ -1,21 +1,20 @@
1
1
  {
2
2
  "name": "@webstudio-is/css-data",
3
- "version": "0.26.0",
3
+ "version": "0.28.0",
4
4
  "description": "CSS Data",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
7
7
  "type": "module",
8
- "dependencies": {},
9
8
  "devDependencies": {
10
9
  "@types/css-tree": "^2.0.0",
11
10
  "camelcase": "^6.3.0",
12
- "css-tree": "^2.3.0",
11
+ "css-tree": "^2.3.1",
13
12
  "mdn-data": "2.0.30",
14
13
  "typescript": "4.7.4",
15
14
  "zod": "^3.19.1",
15
+ "@webstudio-is/asset-uploader": "^0.28.0",
16
16
  "@webstudio-is/scripts": "^0.0.0",
17
- "@webstudio-is/tsconfig": "^1.0.1",
18
- "@webstudio-is/asset-uploader": "^0.25.0"
17
+ "@webstudio-is/tsconfig": "^1.0.1"
19
18
  },
20
19
  "peerDependencies": {
21
20
  "zod": "^3.19.1"
package/src/schema.ts CHANGED
@@ -45,6 +45,14 @@ const KeywordValue = z.object({
45
45
  });
46
46
  export type KeywordValue = z.infer<typeof KeywordValue>;
47
47
 
48
+ /**
49
+ * Valid unparsed css value
50
+ **/
51
+ const UnparsedValue = z.object({
52
+ type: z.literal("unparsed"),
53
+ value: z.string(),
54
+ });
55
+
48
56
  const FontFamilyValue = z.object({
49
57
  type: z.literal("fontFamily"),
50
58
  value: z.array(z.string()),
@@ -87,6 +95,7 @@ export const validStaticValueTypes = [
87
95
  "fontFamily",
88
96
  "rgb",
89
97
  "image",
98
+ "unparsed",
90
99
  ] as const;
91
100
 
92
101
  /**
@@ -98,6 +107,7 @@ const SharedStaticStyleValue = z.union([
98
107
  KeywordValue,
99
108
  FontFamilyValue,
100
109
  RgbValue,
110
+ UnparsedValue,
101
111
  ]);
102
112
 
103
113
  const ValidStaticStyleValue = z.union([ImageValue, SharedStaticStyleValue]);