@webstudio-is/react-sdk 0.75.0 → 0.77.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/context.js +5 -1
- package/lib/cjs/css/normalize.js +51 -23
- package/lib/cjs/css/presets.js +111 -1
- package/lib/cjs/embed-template.js +68 -3
- package/lib/cjs/expression.js +213 -0
- package/lib/cjs/index.js +8 -1
- package/lib/cjs/props.js +28 -10
- package/lib/cjs/tree/create-elements-tree.js +14 -1
- package/lib/cjs/tree/root.js +38 -0
- package/lib/cjs/tree/webstudio-component.js +9 -2
- package/lib/context.js +5 -1
- package/lib/css/normalize.js +41 -23
- package/lib/css/presets.js +111 -1
- package/lib/embed-template.js +68 -3
- package/lib/expression.js +183 -0
- package/lib/index.js +15 -1
- package/lib/props.js +28 -10
- package/lib/tree/create-elements-tree.js +14 -1
- package/lib/tree/root.js +42 -1
- package/lib/tree/webstudio-component.js +9 -2
- package/lib/types/components/component-meta.d.ts +112 -0
- package/lib/types/context.d.ts +3 -0
- package/lib/types/css/normalize.d.ts +1836 -0
- package/lib/types/css/presets.d.ts +282 -0
- package/lib/types/embed-template.d.ts +512 -0
- package/lib/types/expression.d.ts +11 -0
- package/lib/types/expression.test.d.ts +1 -0
- package/lib/types/index.d.ts +2 -1
- package/lib/types/props.d.ts +8 -7
- package/lib/types/tree/create-elements-tree.d.ts +4 -2
- package/lib/types/tree/root.d.ts +6 -4
- package/lib/types/tree/webstudio-component.d.ts +1 -0
- package/package.json +10 -10
- package/src/context.tsx +11 -0
- package/src/css/normalize.ts +40 -23
- package/src/css/presets.ts +110 -0
- package/src/embed-template.test.ts +177 -1
- package/src/embed-template.ts +73 -2
- package/src/expression.test.ts +147 -0
- package/src/expression.ts +217 -0
- package/src/index.ts +8 -0
- package/src/props.ts +29 -10
- package/src/tree/create-elements-tree.tsx +20 -1
- package/src/tree/root.ts +61 -4
- package/src/tree/webstudio-component.tsx +7 -1
|
@@ -1,3 +1,285 @@
|
|
|
1
1
|
import type { Styles } from "./normalize";
|
|
2
2
|
export declare const borders: Styles;
|
|
3
3
|
export declare const outline: Styles;
|
|
4
|
+
export declare const margins: ({
|
|
5
|
+
property: "marginTop";
|
|
6
|
+
value: {
|
|
7
|
+
type: "unit";
|
|
8
|
+
value: number;
|
|
9
|
+
unit: "px";
|
|
10
|
+
};
|
|
11
|
+
} | {
|
|
12
|
+
property: "marginRight";
|
|
13
|
+
value: {
|
|
14
|
+
type: "unit";
|
|
15
|
+
value: number;
|
|
16
|
+
unit: "px";
|
|
17
|
+
};
|
|
18
|
+
} | {
|
|
19
|
+
property: "marginBottom";
|
|
20
|
+
value: {
|
|
21
|
+
type: "unit";
|
|
22
|
+
value: number;
|
|
23
|
+
unit: "px";
|
|
24
|
+
};
|
|
25
|
+
} | {
|
|
26
|
+
property: "marginLeft";
|
|
27
|
+
value: {
|
|
28
|
+
type: "unit";
|
|
29
|
+
value: number;
|
|
30
|
+
unit: "px";
|
|
31
|
+
};
|
|
32
|
+
})[];
|
|
33
|
+
export declare const verticalMargins: ({
|
|
34
|
+
property: "marginTop";
|
|
35
|
+
value: {
|
|
36
|
+
type: "unit";
|
|
37
|
+
value: number;
|
|
38
|
+
unit: "px";
|
|
39
|
+
};
|
|
40
|
+
} | {
|
|
41
|
+
property: "marginBottom";
|
|
42
|
+
value: {
|
|
43
|
+
type: "unit";
|
|
44
|
+
value: number;
|
|
45
|
+
unit: "px";
|
|
46
|
+
};
|
|
47
|
+
})[];
|
|
48
|
+
export declare const blockquote: ({
|
|
49
|
+
property: "marginTop";
|
|
50
|
+
value: {
|
|
51
|
+
type: "unit";
|
|
52
|
+
value: number;
|
|
53
|
+
unit: "px";
|
|
54
|
+
};
|
|
55
|
+
} | {
|
|
56
|
+
property: "marginRight";
|
|
57
|
+
value: {
|
|
58
|
+
type: "unit";
|
|
59
|
+
value: number;
|
|
60
|
+
unit: "px";
|
|
61
|
+
};
|
|
62
|
+
} | {
|
|
63
|
+
property: "marginBottom";
|
|
64
|
+
value: {
|
|
65
|
+
type: "unit";
|
|
66
|
+
value: number;
|
|
67
|
+
unit: "px";
|
|
68
|
+
};
|
|
69
|
+
} | {
|
|
70
|
+
property: "marginLeft";
|
|
71
|
+
value: {
|
|
72
|
+
type: "unit";
|
|
73
|
+
value: number;
|
|
74
|
+
unit: "px";
|
|
75
|
+
};
|
|
76
|
+
} | {
|
|
77
|
+
property: "paddingTop";
|
|
78
|
+
value: {
|
|
79
|
+
type: "unit";
|
|
80
|
+
value: number;
|
|
81
|
+
unit: "px";
|
|
82
|
+
r?: undefined;
|
|
83
|
+
g?: undefined;
|
|
84
|
+
b?: undefined;
|
|
85
|
+
alpha?: undefined;
|
|
86
|
+
};
|
|
87
|
+
} | {
|
|
88
|
+
property: "paddingBottom";
|
|
89
|
+
value: {
|
|
90
|
+
type: "unit";
|
|
91
|
+
value: number;
|
|
92
|
+
unit: "px";
|
|
93
|
+
r?: undefined;
|
|
94
|
+
g?: undefined;
|
|
95
|
+
b?: undefined;
|
|
96
|
+
alpha?: undefined;
|
|
97
|
+
};
|
|
98
|
+
} | {
|
|
99
|
+
property: "paddingLeft";
|
|
100
|
+
value: {
|
|
101
|
+
type: "unit";
|
|
102
|
+
value: number;
|
|
103
|
+
unit: "px";
|
|
104
|
+
r?: undefined;
|
|
105
|
+
g?: undefined;
|
|
106
|
+
b?: undefined;
|
|
107
|
+
alpha?: undefined;
|
|
108
|
+
};
|
|
109
|
+
} | {
|
|
110
|
+
property: "paddingRight";
|
|
111
|
+
value: {
|
|
112
|
+
type: "unit";
|
|
113
|
+
value: number;
|
|
114
|
+
unit: "px";
|
|
115
|
+
r?: undefined;
|
|
116
|
+
g?: undefined;
|
|
117
|
+
b?: undefined;
|
|
118
|
+
alpha?: undefined;
|
|
119
|
+
};
|
|
120
|
+
} | {
|
|
121
|
+
property: "borderLeftWidth";
|
|
122
|
+
value: {
|
|
123
|
+
type: "unit";
|
|
124
|
+
value: number;
|
|
125
|
+
unit: "px";
|
|
126
|
+
r?: undefined;
|
|
127
|
+
g?: undefined;
|
|
128
|
+
b?: undefined;
|
|
129
|
+
alpha?: undefined;
|
|
130
|
+
};
|
|
131
|
+
} | {
|
|
132
|
+
property: "borderLeftStyle";
|
|
133
|
+
value: {
|
|
134
|
+
type: "keyword";
|
|
135
|
+
value: string;
|
|
136
|
+
unit?: undefined;
|
|
137
|
+
r?: undefined;
|
|
138
|
+
g?: undefined;
|
|
139
|
+
b?: undefined;
|
|
140
|
+
alpha?: undefined;
|
|
141
|
+
};
|
|
142
|
+
} | {
|
|
143
|
+
property: "borderLeftColor";
|
|
144
|
+
value: {
|
|
145
|
+
type: "rgb";
|
|
146
|
+
r: number;
|
|
147
|
+
g: number;
|
|
148
|
+
b: number;
|
|
149
|
+
alpha: number;
|
|
150
|
+
value?: undefined;
|
|
151
|
+
unit?: undefined;
|
|
152
|
+
};
|
|
153
|
+
})[];
|
|
154
|
+
export declare const h1: ({
|
|
155
|
+
property: "marginTop";
|
|
156
|
+
value: {
|
|
157
|
+
type: "unit";
|
|
158
|
+
value: number;
|
|
159
|
+
unit: "px";
|
|
160
|
+
};
|
|
161
|
+
} | {
|
|
162
|
+
property: "marginBottom";
|
|
163
|
+
value: {
|
|
164
|
+
type: "unit";
|
|
165
|
+
value: number;
|
|
166
|
+
unit: "px";
|
|
167
|
+
};
|
|
168
|
+
} | {
|
|
169
|
+
property: "fontSize";
|
|
170
|
+
value: {
|
|
171
|
+
type: "unit";
|
|
172
|
+
value: number;
|
|
173
|
+
unit: "px";
|
|
174
|
+
};
|
|
175
|
+
})[];
|
|
176
|
+
export declare const h2: ({
|
|
177
|
+
property: "marginTop";
|
|
178
|
+
value: {
|
|
179
|
+
type: "unit";
|
|
180
|
+
value: number;
|
|
181
|
+
unit: "px";
|
|
182
|
+
};
|
|
183
|
+
} | {
|
|
184
|
+
property: "marginBottom";
|
|
185
|
+
value: {
|
|
186
|
+
type: "unit";
|
|
187
|
+
value: number;
|
|
188
|
+
unit: "px";
|
|
189
|
+
};
|
|
190
|
+
} | {
|
|
191
|
+
property: "fontSize";
|
|
192
|
+
value: {
|
|
193
|
+
type: "unit";
|
|
194
|
+
value: number;
|
|
195
|
+
unit: "px";
|
|
196
|
+
};
|
|
197
|
+
})[];
|
|
198
|
+
export declare const h3: ({
|
|
199
|
+
property: "marginTop";
|
|
200
|
+
value: {
|
|
201
|
+
type: "unit";
|
|
202
|
+
value: number;
|
|
203
|
+
unit: "px";
|
|
204
|
+
};
|
|
205
|
+
} | {
|
|
206
|
+
property: "marginBottom";
|
|
207
|
+
value: {
|
|
208
|
+
type: "unit";
|
|
209
|
+
value: number;
|
|
210
|
+
unit: "px";
|
|
211
|
+
};
|
|
212
|
+
} | {
|
|
213
|
+
property: "fontSize";
|
|
214
|
+
value: {
|
|
215
|
+
type: "unit";
|
|
216
|
+
value: number;
|
|
217
|
+
unit: "px";
|
|
218
|
+
};
|
|
219
|
+
})[];
|
|
220
|
+
export declare const h4: ({
|
|
221
|
+
property: "marginTop";
|
|
222
|
+
value: {
|
|
223
|
+
type: "unit";
|
|
224
|
+
value: number;
|
|
225
|
+
unit: "px";
|
|
226
|
+
};
|
|
227
|
+
} | {
|
|
228
|
+
property: "marginBottom";
|
|
229
|
+
value: {
|
|
230
|
+
type: "unit";
|
|
231
|
+
value: number;
|
|
232
|
+
unit: "px";
|
|
233
|
+
};
|
|
234
|
+
} | {
|
|
235
|
+
property: "fontSize";
|
|
236
|
+
value: {
|
|
237
|
+
type: "unit";
|
|
238
|
+
value: number;
|
|
239
|
+
unit: "px";
|
|
240
|
+
};
|
|
241
|
+
})[];
|
|
242
|
+
export declare const h5: ({
|
|
243
|
+
property: "marginTop";
|
|
244
|
+
value: {
|
|
245
|
+
type: "unit";
|
|
246
|
+
value: number;
|
|
247
|
+
unit: "px";
|
|
248
|
+
};
|
|
249
|
+
} | {
|
|
250
|
+
property: "marginBottom";
|
|
251
|
+
value: {
|
|
252
|
+
type: "unit";
|
|
253
|
+
value: number;
|
|
254
|
+
unit: "px";
|
|
255
|
+
};
|
|
256
|
+
} | {
|
|
257
|
+
property: "fontSize";
|
|
258
|
+
value: {
|
|
259
|
+
type: "unit";
|
|
260
|
+
value: number;
|
|
261
|
+
unit: "px";
|
|
262
|
+
};
|
|
263
|
+
})[];
|
|
264
|
+
export declare const h6: ({
|
|
265
|
+
property: "marginTop";
|
|
266
|
+
value: {
|
|
267
|
+
type: "unit";
|
|
268
|
+
value: number;
|
|
269
|
+
unit: "px";
|
|
270
|
+
};
|
|
271
|
+
} | {
|
|
272
|
+
property: "marginBottom";
|
|
273
|
+
value: {
|
|
274
|
+
type: "unit";
|
|
275
|
+
value: number;
|
|
276
|
+
unit: "px";
|
|
277
|
+
};
|
|
278
|
+
} | {
|
|
279
|
+
property: "fontSize";
|
|
280
|
+
value: {
|
|
281
|
+
type: "unit";
|
|
282
|
+
value: number;
|
|
283
|
+
unit: "px";
|
|
284
|
+
};
|
|
285
|
+
})[];
|