@webstudio-is/react-sdk 0.6.1 → 0.7.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.
Files changed (90) hide show
  1. package/lib/components/component-type.d.ts +1 -1
  2. package/lib/components/component-type.d.ts.map +1 -1
  3. package/lib/components/component-type.js +2 -2
  4. package/lib/components/image.d.ts +3 -0
  5. package/lib/components/image.d.ts.map +1 -0
  6. package/lib/components/image.js +42 -0
  7. package/lib/components/image.props.json +2533 -0
  8. package/lib/components/image.stories.d.ts +6 -0
  9. package/lib/components/image.stories.d.ts.map +1 -0
  10. package/lib/components/image.stories.js +17 -0
  11. package/lib/components/image.ws.d.ts +5 -0
  12. package/lib/components/image.ws.d.ts.map +1 -0
  13. package/lib/components/image.ws.js +14 -0
  14. package/lib/components/index.d.ts +1 -0
  15. package/lib/components/index.d.ts.map +1 -1
  16. package/lib/components/index.js +3 -1
  17. package/lib/components/index.test.js +1 -1
  18. package/lib/components/link.d.ts +1 -1
  19. package/lib/components/link.stories.d.ts +2 -2
  20. package/lib/components/meta.d.ts +1 -0
  21. package/lib/components/meta.d.ts.map +1 -1
  22. package/lib/components/meta.js +3 -1
  23. package/lib/css/breakpoints.d.ts +1 -1
  24. package/lib/css/breakpoints.d.ts.map +1 -1
  25. package/lib/css/categories.d.ts +3 -3
  26. package/lib/css/get-browser-style.d.ts +1 -1
  27. package/lib/css/get-browser-style.d.ts.map +1 -1
  28. package/lib/css/index.d.ts +1 -1
  29. package/lib/css/index.d.ts.map +1 -1
  30. package/lib/css/index.js +1 -1
  31. package/lib/css/keyword-values.d.ts.map +1 -1
  32. package/lib/css/keyword-values.js +396 -1149
  33. package/lib/css/properties.d.ts.map +1 -1
  34. package/lib/css/properties.js +3196 -3196
  35. package/lib/css/schema.d.ts +142 -10
  36. package/lib/css/schema.d.ts.map +1 -1
  37. package/lib/css/schema.js +25 -15
  38. package/lib/css/types.d.ts +0 -9
  39. package/lib/css/types.d.ts.map +1 -1
  40. package/lib/css/units.js +1 -1
  41. package/lib/db/instance.d.ts +2 -2
  42. package/lib/db/instance.d.ts.map +1 -1
  43. package/lib/db/instance.js +4 -4
  44. package/lib/index.d.ts +1 -1
  45. package/lib/index.d.ts.map +1 -1
  46. package/lib/index.js +1 -1
  47. package/lib/remix/constants.d.ts +2 -0
  48. package/lib/remix/constants.d.ts.map +1 -0
  49. package/lib/remix/constants.js +4 -0
  50. package/lib/remix/handle-request.server.d.ts +3 -0
  51. package/lib/remix/handle-request.server.d.ts.map +1 -0
  52. package/lib/remix/handle-request.server.js +16 -0
  53. package/lib/remix/index.d.ts +3 -0
  54. package/lib/remix/index.d.ts.map +1 -0
  55. package/lib/{canvas → remix}/index.js +2 -1
  56. package/lib/remix/insert-critical-css.d.ts +2 -0
  57. package/lib/remix/insert-critical-css.d.ts.map +1 -0
  58. package/lib/remix/insert-critical-css.js +9 -0
  59. package/lib/{canvas/canvas.d.ts → remix/root.d.ts} +1 -1
  60. package/lib/remix/root.d.ts.map +1 -0
  61. package/lib/{canvas/canvas.js → remix/root.js} +2 -2
  62. package/lib/stitches/index.d.ts +1 -2
  63. package/lib/stitches/index.d.ts.map +1 -1
  64. package/lib/stitches/index.js +1 -2
  65. package/lib/stitches/stitches.d.ts +8 -0
  66. package/lib/stitches/stitches.d.ts.map +1 -0
  67. package/lib/stitches/{css.js → stitches.js} +12 -7
  68. package/lib/stitches/to-css.d.ts +1 -1
  69. package/lib/stitches/to-css.d.ts.map +1 -1
  70. package/lib/stitches/to-css.js +9 -0
  71. package/lib/stitches/to-css.test.js +20 -1
  72. package/lib/tree/root.d.ts +5 -1
  73. package/lib/tree/root.d.ts.map +1 -1
  74. package/lib/tree/root.js +20 -7
  75. package/lib/user-props/schema.d.ts +3 -2
  76. package/lib/user-props/schema.d.ts.map +1 -1
  77. package/lib/user-props/schema.js +3 -3
  78. package/lib/user-props/types.d.ts +1 -3
  79. package/lib/user-props/types.d.ts.map +1 -1
  80. package/lib/user-props/use-user-props.d.ts +1 -1
  81. package/lib/user-props/use-user-props.d.ts.map +1 -1
  82. package/package.json +5 -3
  83. package/lib/canvas/canvas.d.ts.map +0 -1
  84. package/lib/canvas/index.d.ts +0 -2
  85. package/lib/canvas/index.d.ts.map +0 -1
  86. package/lib/stitches/critical-css.d.ts +0 -4
  87. package/lib/stitches/critical-css.d.ts.map +0 -1
  88. package/lib/stitches/critical-css.js +0 -12
  89. package/lib/stitches/css.d.ts +0 -9
  90. package/lib/stitches/css.d.ts.map +0 -1
@@ -1,6 +1,66 @@
1
1
  import { z } from "zod";
2
- export declare const UnitSchema: z.ZodUnion<[z.ZodEnum<["ch", "cm", "deg", "dpcm", "dpi", "dppx", "em", "ex", "fr", "grad", "Hz", "in", "kHz", "mm", "ms", "pc", "pt", "px", "Q", "rad", "rem", "s", "turn", "vh", "vmax", "vmin", "vw", "x", "%"]>, z.ZodLiteral<"number">]>;
3
- export declare const StyleValueSchema: z.ZodUnion<[z.ZodObject<{
2
+ import { StyleProperty } from "./types";
3
+ export declare const Unit: z.ZodUnion<[z.ZodEnum<["ch", "cm", "deg", "dpcm", "dpi", "dppx", "em", "ex", "fr", "grad", "Hz", "in", "kHz", "mm", "ms", "pc", "pt", "px", "Q", "rad", "rem", "s", "turn", "vh", "vmax", "vmin", "vw", "x", "%"]>, z.ZodLiteral<"number">]>;
4
+ export declare type Unit = z.infer<typeof Unit>;
5
+ export declare const UnitValue: z.ZodObject<{
6
+ type: z.ZodLiteral<"unit">;
7
+ unit: z.ZodUnion<[z.ZodEnum<["ch", "cm", "deg", "dpcm", "dpi", "dppx", "em", "ex", "fr", "grad", "Hz", "in", "kHz", "mm", "ms", "pc", "pt", "px", "Q", "rad", "rem", "s", "turn", "vh", "vmax", "vmin", "vw", "x", "%"]>, z.ZodLiteral<"number">]>;
8
+ value: z.ZodNumber;
9
+ }, "strip", z.ZodTypeAny, {
10
+ unit: "number" | "px" | "%" | "ch" | "cm" | "deg" | "dpcm" | "dpi" | "dppx" | "em" | "ex" | "fr" | "grad" | "Hz" | "in" | "kHz" | "mm" | "ms" | "pc" | "pt" | "Q" | "rad" | "rem" | "s" | "turn" | "vh" | "vmax" | "vmin" | "vw" | "x";
11
+ value: number;
12
+ type: "unit";
13
+ }, {
14
+ unit: "number" | "px" | "%" | "ch" | "cm" | "deg" | "dpcm" | "dpi" | "dppx" | "em" | "ex" | "fr" | "grad" | "Hz" | "in" | "kHz" | "mm" | "ms" | "pc" | "pt" | "Q" | "rad" | "rem" | "s" | "turn" | "vh" | "vmax" | "vmin" | "vw" | "x";
15
+ value: number;
16
+ type: "unit";
17
+ }>;
18
+ export declare type UnitValue = z.infer<typeof UnitValue>;
19
+ export declare const KeywordValue: z.ZodObject<{
20
+ type: z.ZodLiteral<"keyword">;
21
+ value: z.ZodString;
22
+ }, "strip", z.ZodTypeAny, {
23
+ value: string;
24
+ type: "keyword";
25
+ }, {
26
+ value: string;
27
+ type: "keyword";
28
+ }>;
29
+ export declare type KeywordValue = z.infer<typeof KeywordValue>;
30
+ export declare const FontFamilyValue: z.ZodObject<{
31
+ type: z.ZodLiteral<"fontFamily">;
32
+ value: z.ZodArray<z.ZodString, "many">;
33
+ }, "strip", z.ZodTypeAny, {
34
+ value: string[];
35
+ type: "fontFamily";
36
+ }, {
37
+ value: string[];
38
+ type: "fontFamily";
39
+ }>;
40
+ export declare type FontFamilyValue = z.infer<typeof FontFamilyValue>;
41
+ export declare const InvalidValue: z.ZodObject<{
42
+ type: z.ZodLiteral<"invalid">;
43
+ value: z.ZodString;
44
+ }, "strip", z.ZodTypeAny, {
45
+ value: string;
46
+ type: "invalid";
47
+ }, {
48
+ value: string;
49
+ type: "invalid";
50
+ }>;
51
+ export declare type InvalidValue = z.infer<typeof InvalidValue>;
52
+ export declare const UnsetValue: z.ZodObject<{
53
+ type: z.ZodLiteral<"unset">;
54
+ value: z.ZodLiteral<"">;
55
+ }, "strip", z.ZodTypeAny, {
56
+ value: "";
57
+ type: "unset";
58
+ }, {
59
+ value: "";
60
+ type: "unset";
61
+ }>;
62
+ export declare type UnsetValue = z.infer<typeof UnsetValue>;
63
+ export declare const StyleValue: z.ZodUnion<[z.ZodObject<{
4
64
  type: z.ZodLiteral<"unit">;
5
65
  unit: z.ZodUnion<[z.ZodEnum<["ch", "cm", "deg", "dpcm", "dpi", "dppx", "em", "ex", "fr", "grad", "Hz", "in", "kHz", "mm", "ms", "pc", "pt", "px", "Q", "rad", "rem", "s", "turn", "vh", "vmax", "vmin", "vw", "x", "%"]>, z.ZodLiteral<"number">]>;
6
66
  value: z.ZodNumber;
@@ -30,8 +90,27 @@ export declare const StyleValueSchema: z.ZodUnion<[z.ZodObject<{
30
90
  }, {
31
91
  value: string;
32
92
  type: "invalid";
93
+ }>, z.ZodObject<{
94
+ type: z.ZodLiteral<"unset">;
95
+ value: z.ZodLiteral<"">;
96
+ }, "strip", z.ZodTypeAny, {
97
+ value: "";
98
+ type: "unset";
99
+ }, {
100
+ value: "";
101
+ type: "unset";
102
+ }>, z.ZodObject<{
103
+ type: z.ZodLiteral<"fontFamily">;
104
+ value: z.ZodArray<z.ZodString, "many">;
105
+ }, "strip", z.ZodTypeAny, {
106
+ value: string[];
107
+ type: "fontFamily";
108
+ }, {
109
+ value: string[];
110
+ type: "fontFamily";
33
111
  }>]>;
34
- export declare const StyleSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
112
+ export declare type StyleValue = z.infer<typeof StyleValue>;
113
+ export declare const Style: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
35
114
  type: z.ZodLiteral<"unit">;
36
115
  unit: z.ZodUnion<[z.ZodEnum<["ch", "cm", "deg", "dpcm", "dpi", "dppx", "em", "ex", "fr", "grad", "Hz", "in", "kHz", "mm", "ms", "pc", "pt", "px", "Q", "rad", "rem", "s", "turn", "vh", "vmax", "vmin", "vw", "x", "%"]>, z.ZodLiteral<"number">]>;
37
116
  value: z.ZodNumber;
@@ -61,8 +140,29 @@ export declare const StyleSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObje
61
140
  }, {
62
141
  value: string;
63
142
  type: "invalid";
143
+ }>, z.ZodObject<{
144
+ type: z.ZodLiteral<"unset">;
145
+ value: z.ZodLiteral<"">;
146
+ }, "strip", z.ZodTypeAny, {
147
+ value: "";
148
+ type: "unset";
149
+ }, {
150
+ value: "";
151
+ type: "unset";
152
+ }>, z.ZodObject<{
153
+ type: z.ZodLiteral<"fontFamily">;
154
+ value: z.ZodArray<z.ZodString, "many">;
155
+ }, "strip", z.ZodTypeAny, {
156
+ value: string[];
157
+ type: "fontFamily";
158
+ }, {
159
+ value: string[];
160
+ type: "fontFamily";
64
161
  }>]>>;
65
- export declare const CssRuleSchema: z.ZodObject<{
162
+ export declare type Style = {
163
+ [property in StyleProperty]?: StyleValue;
164
+ };
165
+ export declare const CssRule: z.ZodObject<{
66
166
  style: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
67
167
  type: z.ZodLiteral<"unit">;
68
168
  unit: z.ZodUnion<[z.ZodEnum<["ch", "cm", "deg", "dpcm", "dpi", "dppx", "em", "ex", "fr", "grad", "Hz", "in", "kHz", "mm", "ms", "pc", "pt", "px", "Q", "rad", "rem", "s", "turn", "vh", "vmax", "vmin", "vw", "x", "%"]>, z.ZodLiteral<"number">]>;
@@ -93,6 +193,24 @@ export declare const CssRuleSchema: z.ZodObject<{
93
193
  }, {
94
194
  value: string;
95
195
  type: "invalid";
196
+ }>, z.ZodObject<{
197
+ type: z.ZodLiteral<"unset">;
198
+ value: z.ZodLiteral<"">;
199
+ }, "strip", z.ZodTypeAny, {
200
+ value: "";
201
+ type: "unset";
202
+ }, {
203
+ value: "";
204
+ type: "unset";
205
+ }>, z.ZodObject<{
206
+ type: z.ZodLiteral<"fontFamily">;
207
+ value: z.ZodArray<z.ZodString, "many">;
208
+ }, "strip", z.ZodTypeAny, {
209
+ value: string[];
210
+ type: "fontFamily";
211
+ }, {
212
+ value: string[];
213
+ type: "fontFamily";
96
214
  }>]>>;
97
215
  breakpoint: z.ZodString;
98
216
  }, "strip", z.ZodTypeAny, {
@@ -103,9 +221,15 @@ export declare const CssRuleSchema: z.ZodObject<{
103
221
  } | {
104
222
  value: string;
105
223
  type: "keyword";
224
+ } | {
225
+ value: string[];
226
+ type: "fontFamily";
106
227
  } | {
107
228
  value: string;
108
229
  type: "invalid";
230
+ } | {
231
+ value: "";
232
+ type: "unset";
109
233
  }>;
110
234
  breakpoint: string;
111
235
  }, {
@@ -116,36 +240,44 @@ export declare const CssRuleSchema: z.ZodObject<{
116
240
  } | {
117
241
  value: string;
118
242
  type: "keyword";
243
+ } | {
244
+ value: string[];
245
+ type: "fontFamily";
119
246
  } | {
120
247
  value: string;
121
248
  type: "invalid";
249
+ } | {
250
+ value: "";
251
+ type: "unset";
122
252
  }>;
123
253
  breakpoint: string;
124
254
  }>;
125
- export declare const BreakpointSchema: z.ZodObject<{
255
+ export declare type CssRule = z.infer<typeof CssRule>;
256
+ export declare const Breakpoint: z.ZodObject<{
126
257
  id: z.ZodString;
127
258
  label: z.ZodString;
128
259
  minWidth: z.ZodNumber;
129
260
  }, "strip", z.ZodTypeAny, {
261
+ minWidth: number;
130
262
  id: string;
131
263
  label: string;
132
- minWidth: number;
133
264
  }, {
265
+ minWidth: number;
134
266
  id: string;
135
267
  label: string;
136
- minWidth: number;
137
268
  }>;
138
- export declare const BreakpointsSchema: z.ZodArray<z.ZodObject<{
269
+ export declare const Breakpoints: z.ZodArray<z.ZodObject<{
139
270
  id: z.ZodString;
140
271
  label: z.ZodString;
141
272
  minWidth: z.ZodNumber;
142
273
  }, "strip", z.ZodTypeAny, {
274
+ minWidth: number;
143
275
  id: string;
144
276
  label: string;
145
- minWidth: number;
146
277
  }, {
278
+ minWidth: number;
147
279
  id: string;
148
280
  label: string;
149
- minWidth: number;
150
281
  }>, "many">;
282
+ export declare type Breakpoint = z.infer<typeof Breakpoint>;
151
283
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/css/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,UAAU,8OAAgD,CAAC;AAqBxE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAI3B,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAAyC,CAAC;AAElE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGxB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EAI3B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;WAA4B,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/css/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,eAAO,MAAM,IAAI,8OAAgD,CAAC;AAElE,oBAAY,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,eAAO,MAAM,SAAS;;;;;;;;;;;;EAIpB,CAAC;AAEH,oBAAY,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAElD,eAAO,MAAM,YAAY;;;;;;;;;EAIvB,CAAC;AACH,oBAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,eAAO,MAAM,eAAe;;;;;;;;;EAG1B,CAAC;AACH,oBAAY,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAI9D,eAAO,MAAM,YAAY;;;;;;;;;EAGvB,CAAC;AACH,oBAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,eAAO,MAAM,UAAU;;;;;;;;;EAGrB,CAAC;AACH,oBAAY,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAMrB,CAAC;AAEH,oBAAY,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAAmC,CAAC;AAEtD,oBAAY,KAAK,GAAG;KACjB,QAAQ,IAAI,aAAa,CAAC,CAAC,EAAE,UAAU;CACzC,CAAC;AAEF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGlB,CAAC;AAEH,oBAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;AAE9C,eAAO,MAAM,UAAU;;;;;;;;;;;;EAIrB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;WAAsB,CAAC;AAE/C,oBAAY,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
package/lib/css/schema.js CHANGED
@@ -1,38 +1,48 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BreakpointsSchema = exports.BreakpointSchema = exports.CssRuleSchema = exports.StyleSchema = exports.StyleValueSchema = exports.UnitSchema = void 0;
3
+ exports.Breakpoints = exports.Breakpoint = exports.CssRule = exports.Style = exports.StyleValue = exports.UnsetValue = exports.InvalidValue = exports.FontFamilyValue = exports.KeywordValue = exports.UnitValue = exports.Unit = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const units_1 = require("./units");
6
- exports.UnitSchema = zod_1.z.union([zod_1.z.enum(units_1.units), zod_1.z.literal("number")]);
7
- const UnitValueSchema = zod_1.z.object({
6
+ exports.Unit = zod_1.z.union([zod_1.z.enum(units_1.units), zod_1.z.literal("number")]);
7
+ exports.UnitValue = zod_1.z.object({
8
8
  type: zod_1.z.literal("unit"),
9
- unit: exports.UnitSchema,
9
+ unit: exports.Unit,
10
10
  value: zod_1.z.number(),
11
11
  });
12
- const KeywordValueSchema = zod_1.z.object({
12
+ exports.KeywordValue = zod_1.z.object({
13
13
  type: zod_1.z.literal("keyword"),
14
14
  // @todo use exact type
15
15
  value: zod_1.z.string(),
16
16
  });
17
+ exports.FontFamilyValue = zod_1.z.object({
18
+ type: zod_1.z.literal("fontFamily"),
19
+ value: zod_1.z.array(zod_1.z.string()),
20
+ });
17
21
  // We want to be able to render the invalid value
18
22
  // and show it is invalid visually, without saving it to the db
19
- const InvalidValueSchema = zod_1.z.object({
23
+ exports.InvalidValue = zod_1.z.object({
20
24
  type: zod_1.z.literal("invalid"),
21
25
  value: zod_1.z.string(),
22
26
  });
23
- exports.StyleValueSchema = zod_1.z.union([
24
- UnitValueSchema,
25
- KeywordValueSchema,
26
- InvalidValueSchema,
27
+ exports.UnsetValue = zod_1.z.object({
28
+ type: zod_1.z.literal("unset"),
29
+ value: zod_1.z.literal(""),
30
+ });
31
+ exports.StyleValue = zod_1.z.union([
32
+ exports.UnitValue,
33
+ exports.KeywordValue,
34
+ exports.InvalidValue,
35
+ exports.UnsetValue,
36
+ exports.FontFamilyValue,
27
37
  ]);
28
- exports.StyleSchema = zod_1.z.record(zod_1.z.string(), exports.StyleValueSchema);
29
- exports.CssRuleSchema = zod_1.z.object({
30
- style: exports.StyleSchema,
38
+ exports.Style = zod_1.z.record(zod_1.z.string(), exports.StyleValue);
39
+ exports.CssRule = zod_1.z.object({
40
+ style: exports.Style,
31
41
  breakpoint: zod_1.z.string(),
32
42
  });
33
- exports.BreakpointSchema = zod_1.z.object({
43
+ exports.Breakpoint = zod_1.z.object({
34
44
  id: zod_1.z.string(),
35
45
  label: zod_1.z.string(),
36
46
  minWidth: zod_1.z.number(),
37
47
  });
38
- exports.BreakpointsSchema = zod_1.z.array(exports.BreakpointSchema);
48
+ exports.Breakpoints = zod_1.z.array(exports.Breakpoint);
@@ -1,15 +1,6 @@
1
- import { z } from "zod";
2
1
  import { properties } from "./properties";
3
- import { BreakpointSchema, CssRuleSchema, StyleValueSchema, UnitSchema } from "./schema";
4
2
  declare type Properties = typeof properties;
5
3
  export declare type StyleProperty = keyof Properties;
6
4
  export declare type AppliesTo = Properties[StyleProperty]["appliesTo"];
7
- export declare type Style = {
8
- [property in StyleProperty]?: StyleValue;
9
- };
10
- export declare type CssRule = z.infer<typeof CssRuleSchema>;
11
- export declare type Unit = z.infer<typeof UnitSchema>;
12
- export declare type StyleValue = z.infer<typeof StyleValueSchema>;
13
- export declare type Breakpoint = z.infer<typeof BreakpointSchema>;
14
5
  export {};
15
6
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/css/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,UAAU,EACX,MAAM,UAAU,CAAC;AAElB,aAAK,UAAU,GAAG,OAAO,UAAU,CAAC;AAEpC,oBAAY,aAAa,GAAG,MAAM,UAAU,CAAC;AAE7C,oBAAY,SAAS,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC,CAAC;AAE/D,oBAAY,KAAK,GAAG;KACjB,QAAQ,IAAI,aAAa,CAAC,CAAC,EAAE,UAAU;CACzC,CAAC;AAEF,oBAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD,oBAAY,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAE9C,oBAAY,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,oBAAY,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/css/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,aAAK,UAAU,GAAG,OAAO,UAAU,CAAC;AAEpC,oBAAY,aAAa,GAAG,MAAM,UAAU,CAAC;AAE7C,oBAAY,SAAS,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC,CAAC"}
package/lib/css/units.js CHANGED
@@ -31,5 +31,5 @@ exports.units = [
31
31
  "vmin",
32
32
  "vw",
33
33
  "x",
34
- "%"
34
+ "%",
35
35
  ];
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import * as components from "../components";
3
- import { type CssRule } from "../css";
3
+ import { CssRule } from "../css";
4
4
  export declare type BaseInstance = {
5
5
  id: string;
6
6
  component: keyof typeof components;
@@ -10,5 +10,5 @@ export declare type Instance = BaseInstance & {
10
10
  children: Array<Instance | string>;
11
11
  };
12
12
  export declare const toBaseInstance: (instance: Instance) => BaseInstance;
13
- export declare const InstanceSchema: z.ZodType<Instance, z.ZodTypeDef, Instance>;
13
+ export declare const Instance: z.ZodType<Instance, z.ZodTypeDef, Instance>;
14
14
  //# sourceMappingURL=instance.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../../src/db/instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,QAAQ,CAAC;AAIrD,oBAAY,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,OAAO,UAAU,CAAC;IACnC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;CAC1B,CAAC;AAEF,oBAAY,QAAQ,GAAG,YAAY,GAAG;IACpC,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,cAAc,aAAc,QAAQ,KAAG,YAMnD,CAAC;AAEF,eAAO,MAAM,cAAc,6CASH,CAAC"}
1
+ {"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../../src/db/instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAIjC,oBAAY,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,OAAO,UAAU,CAAC;IACnC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;CAC1B,CAAC;AAEF,oBAAY,QAAQ,GAAG,YAAY,GAAG;IACpC,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,cAAc,aAAc,QAAQ,KAAG,YAMnD,CAAC;AAEF,eAAO,MAAM,QAAQ,6CASG,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InstanceSchema = exports.toBaseInstance = void 0;
3
+ exports.Instance = exports.toBaseInstance = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const css_1 = require("../css");
6
6
  const toBaseInstance = (instance) => {
@@ -11,11 +11,11 @@ const toBaseInstance = (instance) => {
11
11
  };
12
12
  };
13
13
  exports.toBaseInstance = toBaseInstance;
14
- exports.InstanceSchema = zod_1.z.lazy(() => zod_1.z.object({
14
+ exports.Instance = zod_1.z.lazy(() => zod_1.z.object({
15
15
  id: zod_1.z.string(),
16
16
  component: zod_1.z.string(),
17
- children: zod_1.z.array(zod_1.z.union([exports.InstanceSchema, zod_1.z.string()])),
18
- cssRules: zod_1.z.array(css_1.CssRuleSchema),
17
+ children: zod_1.z.array(zod_1.z.union([exports.Instance, zod_1.z.string()])),
18
+ cssRules: zod_1.z.array(css_1.CssRule),
19
19
  })
20
20
  // @todo can't figure out how to make component to be z.enum(Object.keys(components))
21
21
  );
package/lib/index.d.ts CHANGED
@@ -6,5 +6,5 @@ export * as componentsMeta from "./components/meta";
6
6
  export * from "./user-props";
7
7
  export * from "./pubsub";
8
8
  export * from "./db";
9
- export * from "./canvas";
9
+ export * from "./remix";
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAC;AACpD,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC;AACrB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAC;AACpD,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC"}
package/lib/index.js CHANGED
@@ -35,4 +35,4 @@ exports.componentsMeta = __importStar(require("./components/meta"));
35
35
  __exportStar(require("./user-props"), exports);
36
36
  __exportStar(require("./pubsub"), exports);
37
37
  __exportStar(require("./db"), exports);
38
- __exportStar(require("./canvas"), exports);
38
+ __exportStar(require("./remix"), exports);
@@ -0,0 +1,2 @@
1
+ export declare const CRITICAL_CSS_MARKER = "__CRITICAL_CSS__";
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/remix/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,qBAAqB,CAAC"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CRITICAL_CSS_MARKER = void 0;
4
+ exports.CRITICAL_CSS_MARKER = "__CRITICAL_CSS__";
@@ -0,0 +1,3 @@
1
+ import type { EntryContext } from "@remix-run/node";
2
+ export declare const handleRequest: (request: Request, responseStatusCode: number, responseHeaders: Headers, remixContext: EntryContext) => Response;
3
+ //# sourceMappingURL=handle-request.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle-request.server.d.ts","sourceRoot":"","sources":["../../src/remix/handle-request.server.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,eAAO,MAAM,aAAa,YACf,OAAO,sBACI,MAAM,mBACT,OAAO,gBACV,YAAY,aAY3B,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handleRequest = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const server_1 = require("react-dom/server");
6
+ const react_1 = require("@remix-run/react");
7
+ const insert_critical_css_1 = require("./insert-critical-css");
8
+ const handleRequest = (request, responseStatusCode, responseHeaders, remixContext) => {
9
+ const markup = (0, server_1.renderToString)((0, jsx_runtime_1.jsx)(react_1.RemixServer, { context: remixContext, url: request.url }));
10
+ responseHeaders.set("Content-Type", "text/html");
11
+ return new Response("<!DOCTYPE html>" + (0, insert_critical_css_1.insertCriticalCss)(markup), {
12
+ status: responseStatusCode,
13
+ headers: responseHeaders,
14
+ });
15
+ };
16
+ exports.handleRequest = handleRequest;
@@ -0,0 +1,3 @@
1
+ export * from "./root";
2
+ export * from "./handle-request.server";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/remix/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,yBAAyB,CAAC"}
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./canvas"), exports);
17
+ __exportStar(require("./root"), exports);
18
+ __exportStar(require("./handle-request.server"), exports);
@@ -0,0 +1,2 @@
1
+ export declare const insertCriticalCss: (markup: string) => string;
2
+ //# sourceMappingURL=insert-critical-css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insert-critical-css.d.ts","sourceRoot":"","sources":["../../src/remix/insert-critical-css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,WAAY,MAAM,KAAG,MAElD,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.insertCriticalCss = void 0;
4
+ const stitches_1 = require("../stitches");
5
+ const constants_1 = require("./constants");
6
+ const insertCriticalCss = (markup) => {
7
+ return markup.replace(constants_1.CRITICAL_CSS_MARKER, `<style>${(0, stitches_1.flushCss)()}</style>`);
8
+ };
9
+ exports.insertCriticalCss = insertCriticalCss;
@@ -5,4 +5,4 @@ import { Outlet as DefaultOutlet } from "@remix-run/react";
5
5
  export declare const Root: ({ Outlet, }: {
6
6
  Outlet: typeof DefaultOutlet;
7
7
  }) => JSX.Element;
8
- //# sourceMappingURL=canvas.d.ts.map
8
+ //# sourceMappingURL=root.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/remix/root.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGxE;;GAEG;AACH,eAAO,MAAM,IAAI;YAGP,oBAAoB;iBAgB7B,CAAC"}
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Root = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("@remix-run/react");
6
- const __1 = require("..");
6
+ const constants_1 = require("./constants");
7
7
  /**
8
8
  * We are using Outlet prop from index layout when user renders site from a subdomain.
9
9
  */
10
10
  const Root = ({ Outlet = react_1.Outlet, }) => {
11
- return ((0, jsx_runtime_1.jsxs)("html", { lang: "en", children: [(0, jsx_runtime_1.jsxs)("head", { children: [(0, jsx_runtime_1.jsx)("meta", { charSet: "utf-8" }), (0, jsx_runtime_1.jsx)("meta", { name: "viewport", content: "width=device-width,initial-scale=1" }), (0, jsx_runtime_1.jsx)("link", { rel: "icon", href: "/favicon.ico", type: "image/x-icon" }), (0, jsx_runtime_1.jsx)("link", { rel: "shortcut icon", href: "/favicon.ico", type: "image/x-icon" }), (0, jsx_runtime_1.jsx)(react_1.Meta, {}), (0, jsx_runtime_1.jsx)(react_1.Links, {}), (0, jsx_runtime_1.jsx)(__1.CriticalCss, {})] }), (0, jsx_runtime_1.jsx)(Outlet, {})] }));
11
+ return ((0, jsx_runtime_1.jsxs)("html", { lang: "en", children: [(0, jsx_runtime_1.jsxs)("head", { children: [(0, jsx_runtime_1.jsx)("meta", { charSet: "utf-8" }), (0, jsx_runtime_1.jsx)("meta", { name: "viewport", content: "width=device-width,initial-scale=1" }), (0, jsx_runtime_1.jsx)("link", { rel: "icon", href: "/favicon.ico", type: "image/x-icon" }), (0, jsx_runtime_1.jsx)("link", { rel: "shortcut icon", href: "/favicon.ico", type: "image/x-icon" }), (0, jsx_runtime_1.jsx)(react_1.Meta, {}), (0, jsx_runtime_1.jsx)(react_1.Links, {}), typeof document === "undefined" ? constants_1.CRITICAL_CSS_MARKER : null] }), (0, jsx_runtime_1.jsx)(Outlet, {})] }));
12
12
  };
13
13
  exports.Root = Root;
@@ -1,4 +1,3 @@
1
1
  export * from "./to-css";
2
- export * from "./css";
3
- export * from "./critical-css";
2
+ export * from "./stitches";
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stitches/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stitches/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
@@ -15,5 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./to-css"), exports);
18
- __exportStar(require("./css"), exports);
19
- __exportStar(require("./critical-css"), exports);
18
+ __exportStar(require("./stitches"), exports);
@@ -0,0 +1,8 @@
1
+ import { globalCss as globalCssImport, type CSS, css as createCss } from "@stitches/core";
2
+ import type { Breakpoint } from "../css";
3
+ export { type CSS };
4
+ export declare const css: typeof createCss;
5
+ export declare const globalCss: typeof globalCssImport;
6
+ export declare const flushCss: () => any;
7
+ export declare const setBreakpoints: (breakpoints: Array<Breakpoint>) => void;
8
+ //# sourceMappingURL=stitches.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stitches.d.ts","sourceRoot":"","sources":["../../src/stitches/stitches.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,IAAI,eAAe,EAC5B,KAAK,GAAG,EACR,GAAG,IAAI,SAAS,EACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAQzC,OAAO,EAAE,KAAK,GAAG,EAAE,CAAC;AASpB,eAAO,MAAM,GAAG,EAAE,OAAO,SAExB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,OAAO,eAE9B,CAAC;AAEF,eAAO,MAAM,QAAQ,WAKpB,CAAC;AAEF,eAAO,MAAM,cAAc,gBAAiB,MAAM,UAAU,CAAC,SAO5D,CAAC"}
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setBreakpoints = exports.getCssText = exports.globalCss = exports.css = exports.getCachedConfig = void 0;
3
+ exports.setBreakpoints = exports.flushCss = exports.globalCss = exports.css = void 0;
4
4
  const core_1 = require("@stitches/core");
5
- Object.defineProperty(exports, "globalCss", { enumerable: true, get: function () { return core_1.globalCss; } });
6
5
  let media = {};
7
6
  // @todo needs fixing
8
7
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -13,15 +12,21 @@ const getCachedConfig = () => {
13
12
  }
14
13
  return stitches;
15
14
  };
16
- exports.getCachedConfig = getCachedConfig;
17
15
  const css = (...args) => {
18
- return (0, exports.getCachedConfig)().css(...args);
16
+ return getCachedConfig().css(...args);
19
17
  };
20
18
  exports.css = css;
21
- const getCssText = () => {
22
- return (0, exports.getCachedConfig)().getCssText();
19
+ const globalCss = (...args) => {
20
+ return getCachedConfig().globalCss(...args);
23
21
  };
24
- exports.getCssText = getCssText;
22
+ exports.globalCss = globalCss;
23
+ const flushCss = () => {
24
+ const config = getCachedConfig();
25
+ const css = config.getCssText();
26
+ config.reset();
27
+ return css;
28
+ };
29
+ exports.flushCss = flushCss;
25
30
  const setBreakpoints = (breakpoints) => {
26
31
  const nextMedia = {};
27
32
  for (const breakpoint of breakpoints) {
@@ -1,4 +1,4 @@
1
- import type { CSS } from "./css";
1
+ import type { CSS } from "./stitches";
2
2
  import type { StyleValue, CssRule, Breakpoint } from "../css";
3
3
  export declare const toValue: (value: StyleValue) => string;
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"to-css.d.ts","sourceRoot":"","sources":["../../src/stitches/to-css.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAiB,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE7E,eAAO,MAAM,OAAO,UAAW,UAAU,KAAG,MAK3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK,aACN,MAAM,OAAO,CAAC,eACX,MAAM,UAAU,CAAC,KAC7B,GAgCF,CAAC"}
1
+ {"version":3,"file":"to-css.d.ts","sourceRoot":"","sources":["../../src/stitches/to-css.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAiB,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAG7E,eAAO,MAAM,OAAO,UAAW,UAAU,KAAG,MAa3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK,aACN,MAAM,OAAO,CAAC,eACX,MAAM,UAAU,CAAC,KAC7B,GAgCF,CAAC"}
@@ -1,10 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toCss = exports.toValue = void 0;
4
+ const fonts_1 = require("@webstudio-is/fonts");
4
5
  const toValue = (value) => {
5
6
  if (value.type === "unit") {
6
7
  return value.value + (value.unit === "number" ? "" : value.unit);
7
8
  }
9
+ if (value.type === "fontFamily") {
10
+ const family = value.value[0];
11
+ const fallbacks = fonts_1.SYSTEM_FONTS.get(family);
12
+ if (Array.isArray(fallbacks)) {
13
+ return [...value.value, ...fallbacks].join(", ");
14
+ }
15
+ return [...value.value, fonts_1.DEFAULT_FONT_FALLBACK].join(", ");
16
+ }
8
17
  return value.value;
9
18
  };
10
19
  exports.toValue = toValue;
@@ -8,7 +8,7 @@ const breakpoints = css_1.initialBreakpoints.map((breakpoint, index) => ({
8
8
  projectId: "projectId",
9
9
  }));
10
10
  describe("Convert WS CSS rules to stitches", () => {
11
- test("basic", () => {
11
+ test("keyword", () => {
12
12
  const cssRules = [
13
13
  {
14
14
  style: {
@@ -27,6 +27,25 @@ describe("Convert WS CSS rules to stitches", () => {
27
27
  },
28
28
  });
29
29
  });
30
+ test("fontFamily", () => {
31
+ const cssRules = [
32
+ {
33
+ style: {
34
+ fontFamily: {
35
+ type: "fontFamily",
36
+ value: ["Courier New"],
37
+ },
38
+ },
39
+ breakpoint: "0",
40
+ },
41
+ ];
42
+ const stitchesCss = (0, to_css_1.toCss)(cssRules, breakpoints);
43
+ expect(stitchesCss).toEqual({
44
+ "@0": {
45
+ fontFamily: "Courier New, monospace",
46
+ },
47
+ });
48
+ });
30
49
  test("sort order based on maxWidth in breakpoints", () => {
31
50
  const cssRules = [
32
51
  {