@webstudio-is/react-sdk 0.7.0 → 0.7.2
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/arg-types/utils.d.ts +4 -18
- package/lib/arg-types/utils.d.ts.map +1 -1
- package/lib/arg-types/utils.js +23 -16
- package/lib/component-utils/image.d.ts +107 -0
- package/lib/component-utils/image.d.ts.map +1 -0
- package/lib/component-utils/image.js +198 -0
- package/lib/component-utils/image.test.d.ts +2 -0
- package/lib/component-utils/image.test.d.ts.map +1 -0
- package/lib/component-utils/image.test.js +132 -0
- package/lib/components/body.props.json +104 -1847
- package/lib/components/body.stories.d.ts +2 -2
- package/lib/components/body.stories.d.ts.map +1 -1
- package/lib/components/body.stories.js +0 -5
- package/lib/components/bold.d.ts +2 -2
- package/lib/components/bold.d.ts.map +1 -1
- package/lib/components/bold.props.json +104 -1847
- package/lib/components/bold.stories.d.ts +3 -3
- package/lib/components/bold.stories.d.ts.map +1 -1
- package/lib/components/bold.stories.js +0 -5
- package/lib/components/box.props.json +108 -1899
- package/lib/components/box.stories.d.ts +5 -5
- package/lib/components/box.stories.d.ts.map +1 -1
- package/lib/components/box.stories.js +0 -5
- package/lib/components/button.d.ts +2 -2
- package/lib/components/button.d.ts.map +1 -1
- package/lib/components/button.props.json +117 -2065
- package/lib/components/button.stories.d.ts +3 -3
- package/lib/components/button.stories.d.ts.map +1 -1
- package/lib/components/button.stories.js +0 -5
- package/lib/components/component-type.d.ts +1 -1
- package/lib/components/component-type.d.ts.map +1 -1
- package/lib/components/form.d.ts +2 -2
- package/lib/components/form.d.ts.map +1 -1
- package/lib/components/form.props.json +112 -1991
- package/lib/components/form.stories.d.ts +3 -3
- package/lib/components/form.stories.d.ts.map +1 -1
- package/lib/components/form.stories.js +0 -5
- package/lib/components/heading.props.json +107 -1893
- package/lib/components/heading.stories.d.ts +5 -5
- package/lib/components/heading.stories.d.ts.map +1 -1
- package/lib/components/heading.stories.js +0 -5
- package/lib/components/image-dev.stories.d.ts +36 -0
- package/lib/components/image-dev.stories.d.ts.map +1 -0
- package/lib/components/image-dev.stories.js +102 -0
- package/lib/components/image.d.ts +10 -2
- package/lib/components/image.d.ts.map +1 -1
- package/lib/components/image.js +19 -9
- package/lib/components/image.props.json +140 -2098
- package/lib/components/image.stories.d.ts +11 -3
- package/lib/components/image.stories.d.ts.map +1 -1
- package/lib/components/image.stories.js +0 -5
- package/lib/components/image.ws.d.ts.map +1 -1
- package/lib/components/image.ws.js +15 -0
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +7 -1
- package/lib/components/input.d.ts +2 -2
- package/lib/components/input.d.ts.map +1 -1
- package/lib/components/input.props.json +138 -2474
- package/lib/components/input.stories.d.ts +3 -3
- package/lib/components/input.stories.d.ts.map +1 -1
- package/lib/components/input.stories.js +0 -5
- package/lib/components/italic.d.ts +2 -2
- package/lib/components/italic.d.ts.map +1 -1
- package/lib/components/italic.props.json +104 -1847
- package/lib/components/italic.stories.d.ts +3 -3
- package/lib/components/italic.stories.d.ts.map +1 -1
- package/lib/components/italic.stories.js +0 -5
- package/lib/components/link.d.ts +2 -2
- package/lib/components/link.d.ts.map +1 -1
- package/lib/components/link.props.json +116 -2040
- package/lib/components/link.stories.d.ts +5 -5
- package/lib/components/link.stories.d.ts.map +1 -1
- package/lib/components/link.stories.js +0 -5
- package/lib/components/meta.d.ts +7469 -12
- package/lib/components/meta.d.ts.map +1 -1
- package/lib/components/meta.js +34 -25
- package/lib/components/paragraph.d.ts +2 -2
- package/lib/components/paragraph.d.ts.map +1 -1
- package/lib/components/paragraph.props.json +104 -1847
- package/lib/components/paragraph.stories.d.ts +3 -3
- package/lib/components/paragraph.stories.d.ts.map +1 -1
- package/lib/components/paragraph.stories.js +0 -5
- package/lib/components/span.d.ts +3 -0
- package/lib/components/span.d.ts.map +1 -0
- package/lib/components/span.js +8 -0
- package/lib/components/span.props.json +491 -0
- package/lib/components/span.stories.d.ts +6 -0
- package/lib/components/span.stories.d.ts.map +1 -0
- package/lib/components/span.stories.js +14 -0
- package/lib/components/span.ws.d.ts +5 -0
- package/lib/components/span.ws.d.ts.map +1 -0
- package/lib/components/span.ws.js +14 -0
- package/lib/components/subscript.d.ts +3 -0
- package/lib/components/subscript.d.ts.map +1 -0
- package/lib/components/subscript.js +8 -0
- package/lib/components/subscript.props.json +491 -0
- package/lib/components/subscript.stories.d.ts +6 -0
- package/lib/components/subscript.stories.d.ts.map +1 -0
- package/lib/components/subscript.stories.js +14 -0
- package/lib/components/subscript.ws.d.ts +5 -0
- package/lib/components/subscript.ws.d.ts.map +1 -0
- package/lib/components/subscript.ws.js +14 -0
- package/lib/components/superscript.d.ts +3 -0
- package/lib/components/superscript.d.ts.map +1 -0
- package/lib/components/superscript.js +8 -0
- package/lib/components/superscript.props.json +491 -0
- package/lib/components/superscript.stories.d.ts +6 -0
- package/lib/components/superscript.stories.d.ts.map +1 -0
- package/lib/components/superscript.stories.js +14 -0
- package/lib/components/superscript.ws.d.ts +5 -0
- package/lib/components/superscript.ws.d.ts.map +1 -0
- package/lib/components/superscript.ws.js +14 -0
- package/lib/components/text-block.d.ts +2 -2
- package/lib/components/text-block.d.ts.map +1 -1
- package/lib/components/text-block.props.json +104 -1847
- package/lib/components/text-block.stories.d.ts +3 -3
- package/lib/components/text-block.stories.d.ts.map +1 -1
- package/lib/components/text-block.stories.js +0 -5
- package/lib/css/breakpoints.d.ts +1 -1
- package/lib/css/breakpoints.d.ts.map +1 -1
- package/lib/css/categories.d.ts +2 -2
- package/lib/css/get-browser-style.d.ts +1 -1
- package/lib/css/get-browser-style.d.ts.map +1 -1
- package/lib/css/get-browser-style.js +10 -5
- package/lib/css/index.d.ts +0 -5
- package/lib/css/index.d.ts.map +1 -1
- package/lib/css/index.js +0 -5
- package/lib/db/instance.d.ts +1 -1
- package/lib/db/instance.d.ts.map +1 -1
- package/lib/db/instance.js +2 -2
- package/lib/index.d.ts +1 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -3
- package/lib/pubsub/create.d.ts +1 -0
- package/lib/pubsub/create.d.ts.map +1 -1
- package/lib/pubsub/create.js +8 -0
- package/lib/remix/handle-request.server.d.ts.map +1 -1
- package/lib/remix/handle-request.server.js +1 -2
- package/lib/remix/root.d.ts.map +1 -1
- package/lib/remix/root.js +2 -2
- package/lib/tree/create-elements-tree.d.ts +7 -11
- package/lib/tree/create-elements-tree.d.ts.map +1 -1
- package/lib/tree/create-elements-tree.js +5 -10
- package/lib/tree/root.d.ts +4 -6
- package/lib/tree/root.d.ts.map +1 -1
- package/lib/tree/root.js +1 -23
- package/lib/tree/session-storage-polyfill.d.ts +2 -0
- package/lib/tree/session-storage-polyfill.d.ts.map +1 -0
- package/lib/tree/session-storage-polyfill.js +39 -0
- package/lib/tree/wrapper-component.d.ts +4 -4
- package/lib/tree/wrapper-component.d.ts.map +1 -1
- package/lib/tree/wrapper-component.js +5 -5
- package/package.json +21 -13
- package/lib/css/keyword-values.d.ts +0 -302
- package/lib/css/keyword-values.d.ts.map +0 -1
- package/lib/css/keyword-values.js +0 -6619
- package/lib/css/properties.d.ts +0 -3199
- package/lib/css/properties.d.ts.map +0 -1
- package/lib/css/properties.js +0 -3202
- package/lib/css/schema.d.ts +0 -283
- package/lib/css/schema.d.ts.map +0 -1
- package/lib/css/schema.js +0 -48
- package/lib/css/types.d.ts +0 -6
- package/lib/css/types.d.ts.map +0 -1
- package/lib/css/types.js +0 -2
- package/lib/css/units.d.ts +0 -2
- package/lib/css/units.d.ts.map +0 -1
- package/lib/css/units.js +0 -35
- package/lib/remix/constants.d.ts +0 -2
- package/lib/remix/constants.d.ts.map +0 -1
- package/lib/remix/constants.js +0 -4
- package/lib/remix/insert-critical-css.d.ts +0 -2
- package/lib/remix/insert-critical-css.d.ts.map +0 -1
- package/lib/remix/insert-critical-css.js +0 -9
- package/lib/stitches/index.d.ts +0 -3
- package/lib/stitches/index.d.ts.map +0 -1
- package/lib/stitches/index.js +0 -18
- package/lib/stitches/stitches.d.ts +0 -8
- package/lib/stitches/stitches.d.ts.map +0 -1
- package/lib/stitches/stitches.js +0 -38
- package/lib/stitches/to-css.d.ts +0 -8
- package/lib/stitches/to-css.d.ts.map +0 -1
- package/lib/stitches/to-css.js +0 -52
- package/lib/stitches/to-css.test.d.ts +0 -2
- package/lib/stitches/to-css.test.d.ts.map +0 -1
- package/lib/stitches/to-css.test.js +0 -82
package/lib/css/schema.d.ts
DELETED
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
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<{
|
|
64
|
-
type: z.ZodLiteral<"unit">;
|
|
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">]>;
|
|
66
|
-
value: z.ZodNumber;
|
|
67
|
-
}, "strip", z.ZodTypeAny, {
|
|
68
|
-
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";
|
|
69
|
-
value: number;
|
|
70
|
-
type: "unit";
|
|
71
|
-
}, {
|
|
72
|
-
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";
|
|
73
|
-
value: number;
|
|
74
|
-
type: "unit";
|
|
75
|
-
}>, z.ZodObject<{
|
|
76
|
-
type: z.ZodLiteral<"keyword">;
|
|
77
|
-
value: z.ZodString;
|
|
78
|
-
}, "strip", z.ZodTypeAny, {
|
|
79
|
-
value: string;
|
|
80
|
-
type: "keyword";
|
|
81
|
-
}, {
|
|
82
|
-
value: string;
|
|
83
|
-
type: "keyword";
|
|
84
|
-
}>, z.ZodObject<{
|
|
85
|
-
type: z.ZodLiteral<"invalid">;
|
|
86
|
-
value: z.ZodString;
|
|
87
|
-
}, "strip", z.ZodTypeAny, {
|
|
88
|
-
value: string;
|
|
89
|
-
type: "invalid";
|
|
90
|
-
}, {
|
|
91
|
-
value: string;
|
|
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";
|
|
111
|
-
}>]>;
|
|
112
|
-
export declare type StyleValue = z.infer<typeof StyleValue>;
|
|
113
|
-
export declare const Style: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
114
|
-
type: z.ZodLiteral<"unit">;
|
|
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">]>;
|
|
116
|
-
value: z.ZodNumber;
|
|
117
|
-
}, "strip", z.ZodTypeAny, {
|
|
118
|
-
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";
|
|
119
|
-
value: number;
|
|
120
|
-
type: "unit";
|
|
121
|
-
}, {
|
|
122
|
-
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";
|
|
123
|
-
value: number;
|
|
124
|
-
type: "unit";
|
|
125
|
-
}>, z.ZodObject<{
|
|
126
|
-
type: z.ZodLiteral<"keyword">;
|
|
127
|
-
value: z.ZodString;
|
|
128
|
-
}, "strip", z.ZodTypeAny, {
|
|
129
|
-
value: string;
|
|
130
|
-
type: "keyword";
|
|
131
|
-
}, {
|
|
132
|
-
value: string;
|
|
133
|
-
type: "keyword";
|
|
134
|
-
}>, z.ZodObject<{
|
|
135
|
-
type: z.ZodLiteral<"invalid">;
|
|
136
|
-
value: z.ZodString;
|
|
137
|
-
}, "strip", z.ZodTypeAny, {
|
|
138
|
-
value: string;
|
|
139
|
-
type: "invalid";
|
|
140
|
-
}, {
|
|
141
|
-
value: string;
|
|
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";
|
|
161
|
-
}>]>>;
|
|
162
|
-
export declare type Style = {
|
|
163
|
-
[property in StyleProperty]?: StyleValue;
|
|
164
|
-
};
|
|
165
|
-
export declare const CssRule: z.ZodObject<{
|
|
166
|
-
style: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
167
|
-
type: z.ZodLiteral<"unit">;
|
|
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">]>;
|
|
169
|
-
value: z.ZodNumber;
|
|
170
|
-
}, "strip", z.ZodTypeAny, {
|
|
171
|
-
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";
|
|
172
|
-
value: number;
|
|
173
|
-
type: "unit";
|
|
174
|
-
}, {
|
|
175
|
-
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";
|
|
176
|
-
value: number;
|
|
177
|
-
type: "unit";
|
|
178
|
-
}>, z.ZodObject<{
|
|
179
|
-
type: z.ZodLiteral<"keyword">;
|
|
180
|
-
value: z.ZodString;
|
|
181
|
-
}, "strip", z.ZodTypeAny, {
|
|
182
|
-
value: string;
|
|
183
|
-
type: "keyword";
|
|
184
|
-
}, {
|
|
185
|
-
value: string;
|
|
186
|
-
type: "keyword";
|
|
187
|
-
}>, z.ZodObject<{
|
|
188
|
-
type: z.ZodLiteral<"invalid">;
|
|
189
|
-
value: z.ZodString;
|
|
190
|
-
}, "strip", z.ZodTypeAny, {
|
|
191
|
-
value: string;
|
|
192
|
-
type: "invalid";
|
|
193
|
-
}, {
|
|
194
|
-
value: string;
|
|
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";
|
|
214
|
-
}>]>>;
|
|
215
|
-
breakpoint: z.ZodString;
|
|
216
|
-
}, "strip", z.ZodTypeAny, {
|
|
217
|
-
style: Record<string, {
|
|
218
|
-
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";
|
|
219
|
-
value: number;
|
|
220
|
-
type: "unit";
|
|
221
|
-
} | {
|
|
222
|
-
value: string;
|
|
223
|
-
type: "keyword";
|
|
224
|
-
} | {
|
|
225
|
-
value: string[];
|
|
226
|
-
type: "fontFamily";
|
|
227
|
-
} | {
|
|
228
|
-
value: string;
|
|
229
|
-
type: "invalid";
|
|
230
|
-
} | {
|
|
231
|
-
value: "";
|
|
232
|
-
type: "unset";
|
|
233
|
-
}>;
|
|
234
|
-
breakpoint: string;
|
|
235
|
-
}, {
|
|
236
|
-
style: Record<string, {
|
|
237
|
-
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";
|
|
238
|
-
value: number;
|
|
239
|
-
type: "unit";
|
|
240
|
-
} | {
|
|
241
|
-
value: string;
|
|
242
|
-
type: "keyword";
|
|
243
|
-
} | {
|
|
244
|
-
value: string[];
|
|
245
|
-
type: "fontFamily";
|
|
246
|
-
} | {
|
|
247
|
-
value: string;
|
|
248
|
-
type: "invalid";
|
|
249
|
-
} | {
|
|
250
|
-
value: "";
|
|
251
|
-
type: "unset";
|
|
252
|
-
}>;
|
|
253
|
-
breakpoint: string;
|
|
254
|
-
}>;
|
|
255
|
-
export declare type CssRule = z.infer<typeof CssRule>;
|
|
256
|
-
export declare const Breakpoint: z.ZodObject<{
|
|
257
|
-
id: z.ZodString;
|
|
258
|
-
label: z.ZodString;
|
|
259
|
-
minWidth: z.ZodNumber;
|
|
260
|
-
}, "strip", z.ZodTypeAny, {
|
|
261
|
-
minWidth: number;
|
|
262
|
-
id: string;
|
|
263
|
-
label: string;
|
|
264
|
-
}, {
|
|
265
|
-
minWidth: number;
|
|
266
|
-
id: string;
|
|
267
|
-
label: string;
|
|
268
|
-
}>;
|
|
269
|
-
export declare const Breakpoints: z.ZodArray<z.ZodObject<{
|
|
270
|
-
id: z.ZodString;
|
|
271
|
-
label: z.ZodString;
|
|
272
|
-
minWidth: z.ZodNumber;
|
|
273
|
-
}, "strip", z.ZodTypeAny, {
|
|
274
|
-
minWidth: number;
|
|
275
|
-
id: string;
|
|
276
|
-
label: string;
|
|
277
|
-
}, {
|
|
278
|
-
minWidth: number;
|
|
279
|
-
id: string;
|
|
280
|
-
label: string;
|
|
281
|
-
}>, "many">;
|
|
282
|
-
export declare type Breakpoint = z.infer<typeof Breakpoint>;
|
|
283
|
-
//# sourceMappingURL=schema.d.ts.map
|
package/lib/css/schema.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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
|
-
const zod_1 = require("zod");
|
|
5
|
-
const units_1 = require("./units");
|
|
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
|
-
type: zod_1.z.literal("unit"),
|
|
9
|
-
unit: exports.Unit,
|
|
10
|
-
value: zod_1.z.number(),
|
|
11
|
-
});
|
|
12
|
-
exports.KeywordValue = zod_1.z.object({
|
|
13
|
-
type: zod_1.z.literal("keyword"),
|
|
14
|
-
// @todo use exact type
|
|
15
|
-
value: zod_1.z.string(),
|
|
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
|
-
});
|
|
21
|
-
// We want to be able to render the invalid value
|
|
22
|
-
// and show it is invalid visually, without saving it to the db
|
|
23
|
-
exports.InvalidValue = zod_1.z.object({
|
|
24
|
-
type: zod_1.z.literal("invalid"),
|
|
25
|
-
value: zod_1.z.string(),
|
|
26
|
-
});
|
|
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,
|
|
37
|
-
]);
|
|
38
|
-
exports.Style = zod_1.z.record(zod_1.z.string(), exports.StyleValue);
|
|
39
|
-
exports.CssRule = zod_1.z.object({
|
|
40
|
-
style: exports.Style,
|
|
41
|
-
breakpoint: zod_1.z.string(),
|
|
42
|
-
});
|
|
43
|
-
exports.Breakpoint = zod_1.z.object({
|
|
44
|
-
id: zod_1.z.string(),
|
|
45
|
-
label: zod_1.z.string(),
|
|
46
|
-
minWidth: zod_1.z.number(),
|
|
47
|
-
});
|
|
48
|
-
exports.Breakpoints = zod_1.z.array(exports.Breakpoint);
|
package/lib/css/types.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { properties } from "./properties";
|
|
2
|
-
declare type Properties = typeof properties;
|
|
3
|
-
export declare type StyleProperty = keyof Properties;
|
|
4
|
-
export declare type AppliesTo = Properties[StyleProperty]["appliesTo"];
|
|
5
|
-
export {};
|
|
6
|
-
//# sourceMappingURL=types.d.ts.map
|
package/lib/css/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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/types.js
DELETED
package/lib/css/units.d.ts
DELETED
package/lib/css/units.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src/css/units.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,KAAK,sMA8BR,CAAC"}
|
package/lib/css/units.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.units = void 0;
|
|
4
|
-
// This file was generated by yarn mdn-data
|
|
5
|
-
exports.units = [
|
|
6
|
-
"ch",
|
|
7
|
-
"cm",
|
|
8
|
-
"deg",
|
|
9
|
-
"dpcm",
|
|
10
|
-
"dpi",
|
|
11
|
-
"dppx",
|
|
12
|
-
"em",
|
|
13
|
-
"ex",
|
|
14
|
-
"fr",
|
|
15
|
-
"grad",
|
|
16
|
-
"Hz",
|
|
17
|
-
"in",
|
|
18
|
-
"kHz",
|
|
19
|
-
"mm",
|
|
20
|
-
"ms",
|
|
21
|
-
"pc",
|
|
22
|
-
"pt",
|
|
23
|
-
"px",
|
|
24
|
-
"Q",
|
|
25
|
-
"rad",
|
|
26
|
-
"rem",
|
|
27
|
-
"s",
|
|
28
|
-
"turn",
|
|
29
|
-
"vh",
|
|
30
|
-
"vmax",
|
|
31
|
-
"vmin",
|
|
32
|
-
"vw",
|
|
33
|
-
"x",
|
|
34
|
-
"%",
|
|
35
|
-
];
|
package/lib/remix/constants.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/remix/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,qBAAqB,CAAC"}
|
package/lib/remix/constants.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,9 +0,0 @@
|
|
|
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;
|
package/lib/stitches/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stitches/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
|
package/lib/stitches/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./to-css"), exports);
|
|
18
|
-
__exportStar(require("./stitches"), exports);
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/lib/stitches/stitches.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setBreakpoints = exports.flushCss = exports.globalCss = exports.css = void 0;
|
|
4
|
-
const core_1 = require("@stitches/core");
|
|
5
|
-
let media = {};
|
|
6
|
-
// @todo needs fixing
|
|
7
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
-
let stitches;
|
|
9
|
-
const getCachedConfig = () => {
|
|
10
|
-
if (stitches === undefined) {
|
|
11
|
-
stitches = (0, core_1.createStitches)({ media });
|
|
12
|
-
}
|
|
13
|
-
return stitches;
|
|
14
|
-
};
|
|
15
|
-
const css = (...args) => {
|
|
16
|
-
return getCachedConfig().css(...args);
|
|
17
|
-
};
|
|
18
|
-
exports.css = css;
|
|
19
|
-
const globalCss = (...args) => {
|
|
20
|
-
return getCachedConfig().globalCss(...args);
|
|
21
|
-
};
|
|
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;
|
|
30
|
-
const setBreakpoints = (breakpoints) => {
|
|
31
|
-
const nextMedia = {};
|
|
32
|
-
for (const breakpoint of breakpoints) {
|
|
33
|
-
nextMedia[breakpoint.id] = `(min-width: ${breakpoint.minWidth}px)`;
|
|
34
|
-
}
|
|
35
|
-
media = nextMedia;
|
|
36
|
-
stitches = undefined;
|
|
37
|
-
};
|
|
38
|
-
exports.setBreakpoints = setBreakpoints;
|
package/lib/stitches/to-css.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { CSS } from "./stitches";
|
|
2
|
-
import type { StyleValue, CssRule, Breakpoint } from "../css";
|
|
3
|
-
export declare const toValue: (value: StyleValue) => string;
|
|
4
|
-
/**
|
|
5
|
-
* Convert instance cssRules to a stitches CSS object.
|
|
6
|
-
*/
|
|
7
|
-
export declare const toCss: (cssRules: Array<CssRule>, breakpoints: Array<Breakpoint>) => CSS;
|
|
8
|
-
//# sourceMappingURL=to-css.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/lib/stitches/to-css.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toCss = exports.toValue = void 0;
|
|
4
|
-
const fonts_1 = require("@webstudio-is/fonts");
|
|
5
|
-
const toValue = (value) => {
|
|
6
|
-
if (value.type === "unit") {
|
|
7
|
-
return value.value + (value.unit === "number" ? "" : value.unit);
|
|
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
|
-
}
|
|
17
|
-
return value.value;
|
|
18
|
-
};
|
|
19
|
-
exports.toValue = toValue;
|
|
20
|
-
/**
|
|
21
|
-
* Convert instance cssRules to a stitches CSS object.
|
|
22
|
-
*/
|
|
23
|
-
const toCss = (cssRules, breakpoints) => {
|
|
24
|
-
const css = {};
|
|
25
|
-
const breakpointsMap = {};
|
|
26
|
-
for (const breakpoint of breakpoints) {
|
|
27
|
-
breakpointsMap[breakpoint.id] = breakpoint.minWidth;
|
|
28
|
-
}
|
|
29
|
-
const sortedCssRules = [...cssRules].sort((ruleA, ruleB) => {
|
|
30
|
-
// If a rule references a breakpoint that was not found in breakpoints,
|
|
31
|
-
// we must have removed the breakpoint and now we fall back to 0.
|
|
32
|
-
const maxWidthA = breakpointsMap[ruleA.breakpoint] ?? 0;
|
|
33
|
-
const maxWidthB = breakpointsMap[ruleB.breakpoint] ?? 0;
|
|
34
|
-
return maxWidthA - maxWidthB;
|
|
35
|
-
});
|
|
36
|
-
for (const cssRule of sortedCssRules) {
|
|
37
|
-
const style = {};
|
|
38
|
-
for (const property in cssRule.style) {
|
|
39
|
-
const value = cssRule.style[property];
|
|
40
|
-
if (value === undefined)
|
|
41
|
-
continue;
|
|
42
|
-
style[property] = (0, exports.toValue)(value);
|
|
43
|
-
}
|
|
44
|
-
if (cssRule.breakpoint in breakpointsMap) {
|
|
45
|
-
css["@" + cssRule.breakpoint] = style;
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
Object.assign(css, style);
|
|
49
|
-
}
|
|
50
|
-
return css;
|
|
51
|
-
};
|
|
52
|
-
exports.toCss = toCss;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"to-css.test.d.ts","sourceRoot":"","sources":["../../src/stitches/to-css.test.ts"],"names":[],"mappings":""}
|