@webstudio-is/react-sdk 0.94.0 → 0.96.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 (40) hide show
  1. package/lib/css/normalize.js +127 -53
  2. package/lib/index.js +1843 -32
  3. package/lib/types/index.d.ts +0 -1
  4. package/package.json +10 -9
  5. package/lib/app/index.js +0 -2
  6. package/lib/app/root.js +0 -18
  7. package/lib/component-renderer.js +0 -130
  8. package/lib/components/component-meta.js +0 -62
  9. package/lib/components/components-utils.js +0 -2
  10. package/lib/context.js +0 -21
  11. package/lib/css/css.js +0 -59
  12. package/lib/css/global-rules.js +0 -15
  13. package/lib/css/index.js +0 -4
  14. package/lib/css/normalize-type-check.js +0 -4
  15. package/lib/css/presets.js +0 -25
  16. package/lib/css/style-rules.js +0 -63
  17. package/lib/css/style-rules.test.js +0 -149
  18. package/lib/embed-template.js +0 -341
  19. package/lib/embed-template.test.js +0 -648
  20. package/lib/expression.js +0 -330
  21. package/lib/expression.test.js +0 -281
  22. package/lib/generator.js +0 -112
  23. package/lib/generator.test.js +0 -166
  24. package/lib/hook.js +0 -12
  25. package/lib/hook.test.js +0 -15
  26. package/lib/instance-utils.js +0 -43
  27. package/lib/instance-utils.test.js +0 -65
  28. package/lib/prop-meta.js +0 -150
  29. package/lib/props.js +0 -176
  30. package/lib/props.test.js +0 -159
  31. package/lib/pubsub/create.js +0 -56
  32. package/lib/pubsub/index.js +0 -2
  33. package/lib/pubsub/raf-queue.js +0 -20
  34. package/lib/tree/create-elements-tree.js +0 -134
  35. package/lib/tree/index.js +0 -4
  36. package/lib/tree/root.js +0 -85
  37. package/lib/tree/webstudio-component.js +0 -61
  38. package/lib/types/pubsub/create.d.ts +0 -28
  39. package/lib/types/pubsub/index.d.ts +0 -1
  40. package/lib/types/pubsub/raf-queue.d.ts +0 -1
@@ -1,37 +1,62 @@
1
- "use strict";
2
- import { borders, outline } from "./presets";
3
- const boxSizing = {
1
+ // src/css/presets.ts
2
+ var borders = [
3
+ {
4
+ property: "borderTopWidth",
5
+ value: { type: "unit", value: 1, unit: "px" }
6
+ },
7
+ {
8
+ property: "borderRightWidth",
9
+ value: { type: "unit", value: 1, unit: "px" }
10
+ },
11
+ {
12
+ property: "borderBottomWidth",
13
+ value: { type: "unit", value: 1, unit: "px" }
14
+ },
15
+ {
16
+ property: "borderLeftWidth",
17
+ value: { type: "unit", value: 1, unit: "px" }
18
+ }
19
+ ];
20
+ var outline = [
21
+ {
22
+ property: "outlineWidth",
23
+ value: { type: "unit", value: 1, unit: "px" }
24
+ }
25
+ ];
26
+
27
+ // src/css/normalize.ts
28
+ var boxSizing = {
4
29
  property: "boxSizing",
5
30
  value: { type: "keyword", value: "border-box" }
6
31
  };
7
- const baseStyle = [boxSizing, ...borders, ...outline];
8
- export const div = baseStyle;
9
- export const address = baseStyle;
10
- export const article = baseStyle;
11
- export const aside = baseStyle;
12
- export const figure = baseStyle;
13
- export const footer = baseStyle;
14
- export const header = baseStyle;
15
- export const main = baseStyle;
16
- export const nav = baseStyle;
17
- export const section = baseStyle;
18
- export const form = baseStyle;
19
- export const label = baseStyle;
20
- export const h1 = baseStyle;
21
- export const h2 = baseStyle;
22
- export const h3 = baseStyle;
23
- export const h4 = baseStyle;
24
- export const h5 = baseStyle;
25
- export const h6 = baseStyle;
26
- export const i = baseStyle;
27
- export const img = baseStyle;
28
- export const a = baseStyle;
29
- export const li = baseStyle;
30
- export const ul = baseStyle;
31
- export const ol = baseStyle;
32
- export const p = baseStyle;
33
- export const span = baseStyle;
34
- export const html = [
32
+ var baseStyle = [boxSizing, ...borders, ...outline];
33
+ var div = baseStyle;
34
+ var address = baseStyle;
35
+ var article = baseStyle;
36
+ var aside = baseStyle;
37
+ var figure = baseStyle;
38
+ var footer = baseStyle;
39
+ var header = baseStyle;
40
+ var main = baseStyle;
41
+ var nav = baseStyle;
42
+ var section = baseStyle;
43
+ var form = baseStyle;
44
+ var label = baseStyle;
45
+ var h1 = baseStyle;
46
+ var h2 = baseStyle;
47
+ var h3 = baseStyle;
48
+ var h4 = baseStyle;
49
+ var h5 = baseStyle;
50
+ var h6 = baseStyle;
51
+ var i = baseStyle;
52
+ var img = baseStyle;
53
+ var a = baseStyle;
54
+ var li = baseStyle;
55
+ var ul = baseStyle;
56
+ var ol = baseStyle;
57
+ var p = baseStyle;
58
+ var span = baseStyle;
59
+ var html = [
35
60
  /* 1 */
36
61
  {
37
62
  property: "lineHeight",
@@ -50,7 +75,7 @@ export const html = [
50
75
  boxSizing,
51
76
  ...borders
52
77
  ];
53
- export const body = [
78
+ var body = [
54
79
  /* 1 */
55
80
  {
56
81
  property: "marginTop",
@@ -87,7 +112,7 @@ export const body = [
87
112
  boxSizing,
88
113
  ...borders
89
114
  ];
90
- export const hr = [
115
+ var hr = [
91
116
  /* 1 */
92
117
  {
93
118
  property: "height",
@@ -101,7 +126,7 @@ export const hr = [
101
126
  boxSizing,
102
127
  ...borders
103
128
  ];
104
- export const b = [
129
+ var b = [
105
130
  {
106
131
  property: "fontWeight",
107
132
  value: { type: "keyword", value: "700" }
@@ -109,8 +134,8 @@ export const b = [
109
134
  boxSizing,
110
135
  ...borders
111
136
  ];
112
- export const strong = b;
113
- export const code = [
137
+ var strong = b;
138
+ var code = [
114
139
  /* 1 */
115
140
  {
116
141
  property: "fontFamily",
@@ -127,10 +152,10 @@ export const code = [
127
152
  boxSizing,
128
153
  ...borders
129
154
  ];
130
- export const kbd = code;
131
- export const samp = code;
132
- export const pre = code;
133
- export const small = [
155
+ var kbd = code;
156
+ var samp = code;
157
+ var pre = code;
158
+ var small = [
134
159
  {
135
160
  property: "fontSize",
136
161
  value: { type: "unit", value: 80, unit: "%" }
@@ -138,7 +163,7 @@ export const small = [
138
163
  boxSizing,
139
164
  ...borders
140
165
  ];
141
- const subSupBase = [
166
+ var subSupBase = [
142
167
  {
143
168
  property: "fontSize",
144
169
  value: { type: "unit", value: 75, unit: "%" }
@@ -158,21 +183,21 @@ const subSupBase = [
158
183
  boxSizing,
159
184
  ...borders
160
185
  ];
161
- export const sub = [
186
+ var sub = [
162
187
  ...subSupBase,
163
188
  {
164
189
  property: "bottom",
165
190
  value: { type: "unit", value: -0.25, unit: "em" }
166
191
  }
167
192
  ];
168
- export const sup = [
193
+ var sup = [
169
194
  ...subSupBase,
170
195
  {
171
196
  property: "top",
172
197
  value: { type: "unit", value: -0.5, unit: "em" }
173
198
  }
174
199
  ];
175
- export const table = [
200
+ var table = [
176
201
  /* 1 */
177
202
  {
178
203
  property: "textIndent",
@@ -198,7 +223,7 @@ export const table = [
198
223
  },
199
224
  boxSizing
200
225
  ];
201
- const buttonBase = [
226
+ var buttonBase = [
202
227
  /* 1 */
203
228
  {
204
229
  property: "fontFamily",
@@ -232,18 +257,18 @@ const buttonBase = [
232
257
  boxSizing,
233
258
  ...borders
234
259
  ];
235
- export const input = buttonBase;
236
- export const optgroup = buttonBase;
237
- export const textarea = buttonBase;
238
- export const button = [
260
+ var input = buttonBase;
261
+ var optgroup = buttonBase;
262
+ var textarea = buttonBase;
263
+ var button = [
239
264
  ...buttonBase,
240
265
  {
241
266
  property: "textTransform",
242
267
  value: { type: "keyword", value: "none" }
243
268
  }
244
269
  ];
245
- export const select = button;
246
- export const legend = [
270
+ var select = button;
271
+ var legend = [
247
272
  {
248
273
  property: "paddingTop",
249
274
  value: { type: "unit", value: 0, unit: "number" }
@@ -263,7 +288,7 @@ export const legend = [
263
288
  boxSizing,
264
289
  ...borders
265
290
  ];
266
- export const progress = [
291
+ var progress = [
267
292
  {
268
293
  property: "verticalAlign",
269
294
  value: { type: "keyword", value: "baseline" }
@@ -271,7 +296,7 @@ export const progress = [
271
296
  boxSizing,
272
297
  ...borders
273
298
  ];
274
- export const summary = [
299
+ var summary = [
275
300
  {
276
301
  property: "display",
277
302
  value: { type: "keyword", value: "list-item" }
@@ -279,3 +304,52 @@ export const summary = [
279
304
  boxSizing,
280
305
  ...borders
281
306
  ];
307
+ export {
308
+ a,
309
+ address,
310
+ article,
311
+ aside,
312
+ b,
313
+ body,
314
+ button,
315
+ code,
316
+ div,
317
+ figure,
318
+ footer,
319
+ form,
320
+ h1,
321
+ h2,
322
+ h3,
323
+ h4,
324
+ h5,
325
+ h6,
326
+ header,
327
+ hr,
328
+ html,
329
+ i,
330
+ img,
331
+ input,
332
+ kbd,
333
+ label,
334
+ legend,
335
+ li,
336
+ main,
337
+ nav,
338
+ ol,
339
+ optgroup,
340
+ p,
341
+ pre,
342
+ progress,
343
+ samp,
344
+ section,
345
+ select,
346
+ small,
347
+ span,
348
+ strong,
349
+ sub,
350
+ summary,
351
+ sup,
352
+ table,
353
+ textarea,
354
+ ul
355
+ };