@webstudio-is/sdk 0.189.0 → 0.191.4

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 (38) hide show
  1. package/package.json +13 -9
  2. package/lib/__generated__/normalize.css.js +0 -505
  3. package/lib/index.js +0 -1377
  4. package/lib/types/__generated__/normalize.css.d.ts +0 -57
  5. package/lib/types/expression.d.ts +0 -53
  6. package/lib/types/expression.test.d.ts +0 -1
  7. package/lib/types/form-fields.d.ts +0 -8
  8. package/lib/types/index.d.ts +0 -22
  9. package/lib/types/instances-utils.d.ts +0 -5
  10. package/lib/types/instances-utils.test.d.ts +0 -1
  11. package/lib/types/jsx.d.ts +0 -151
  12. package/lib/types/jsx.test.d.ts +0 -1
  13. package/lib/types/page-meta-generator.d.ts +0 -24
  14. package/lib/types/page-meta-generator.test.d.ts +0 -1
  15. package/lib/types/page-utils.d.ts +0 -24
  16. package/lib/types/page-utils.test.d.ts +0 -1
  17. package/lib/types/resource-loader.d.ts +0 -25
  18. package/lib/types/resource-loader.test.d.ts +0 -1
  19. package/lib/types/resources-generator.d.ts +0 -22
  20. package/lib/types/resources-generator.test.d.ts +0 -1
  21. package/lib/types/schema/assets.d.ts +0 -527
  22. package/lib/types/schema/breakpoints.d.ts +0 -56
  23. package/lib/types/schema/data-sources.d.ts +0 -303
  24. package/lib/types/schema/deployment.d.ts +0 -41
  25. package/lib/types/schema/instances.d.ts +0 -208
  26. package/lib/types/schema/pages.d.ts +0 -675
  27. package/lib/types/schema/props.d.ts +0 -549
  28. package/lib/types/schema/resources.d.ts +0 -126
  29. package/lib/types/schema/style-source-selections.d.ts +0 -23
  30. package/lib/types/schema/style-sources.d.ts +0 -62
  31. package/lib/types/schema/styles.d.ts +0 -2629
  32. package/lib/types/schema/webstudio.d.ts +0 -2374
  33. package/lib/types/scope.d.ts +0 -16
  34. package/lib/types/scope.test.d.ts +0 -1
  35. package/lib/types/testing.d.ts +0 -1
  36. package/lib/types/to-string.d.ts +0 -2
  37. package/lib/types/url-pattern.d.ts +0 -2
  38. package/lib/types/url-pattern.test.d.ts +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk",
3
- "version": "0.189.0",
3
+ "version": "0.191.4",
4
4
  "description": "Webstudio project data schema",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -12,6 +12,11 @@
12
12
  "types": "./lib/types/index.d.ts",
13
13
  "import": "./lib/index.js"
14
14
  },
15
+ "./runtime": {
16
+ "webstudio": "./src/runtime.ts",
17
+ "types": "./lib/types/runtime.d.ts",
18
+ "import": "./lib/runtime.js"
19
+ },
15
20
  "./normalize.css": {
16
21
  "webstudio": "./src/__generated__/normalize.css.ts",
17
22
  "types": "./lib/types/__generated__/normalize.css.d.ts",
@@ -30,24 +35,23 @@
30
35
  "acorn": "^8.12.1",
31
36
  "acorn-walk": "^8.3.4",
32
37
  "reserved-identifiers": "^1.0.0",
33
- "type-fest": "^4.26.1",
38
+ "type-fest": "^4.28.0",
34
39
  "zod": "^3.22.4",
35
- "@webstudio-is/css-engine": "0.189.0",
36
- "@webstudio-is/fonts": "0.189.0"
40
+ "@webstudio-is/css-engine": "0.191.4",
41
+ "@webstudio-is/fonts": "0.191.4"
37
42
  },
38
43
  "devDependencies": {
39
- "@jest/globals": "^29.7.0",
40
44
  "html-tags": "^4.0.0",
41
45
  "strip-indent": "^4.0.0",
42
- "@webstudio-is/tsconfig": "1.0.7",
46
+ "vitest": "^2.1.8",
43
47
  "@webstudio-is/css-data": "0.0.0",
44
- "@webstudio-is/jest-config": "1.0.7"
48
+ "@webstudio-is/tsconfig": "1.0.7"
45
49
  },
46
50
  "scripts": {
47
51
  "typecheck": "tsc",
48
- "test": "NODE_OPTIONS=--experimental-vm-modules jest",
52
+ "test": "vitest run",
49
53
  "build:normalize.css": "tsx --conditions=webstudio ./scripts/normalize.css.ts && prettier --write src/__generated__/normalize.css.ts",
50
- "build": "rm -rf lib && esbuild src/index.ts src/__generated__/normalize.css.ts --outdir=lib --bundle --format=esm --packages=external",
54
+ "build": "rm -rf lib && esbuild src/index.ts src/runtime.ts src/__generated__/normalize.css.ts --outdir=lib --bundle --format=esm --packages=external",
51
55
  "dts": "tsc --project tsconfig.dts.json"
52
56
  }
53
57
  }
@@ -1,505 +0,0 @@
1
- // src/__generated__/normalize.css.ts
2
- var div = [
3
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
4
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
5
- {
6
- property: "borderRightWidth",
7
- value: { type: "unit", unit: "px", value: 1 }
8
- },
9
- {
10
- property: "borderBottomWidth",
11
- value: { type: "unit", unit: "px", value: 1 }
12
- },
13
- {
14
- property: "borderLeftWidth",
15
- value: { type: "unit", unit: "px", value: 1 }
16
- },
17
- { property: "outlineWidth", value: { type: "unit", unit: "px", value: 1 } }
18
- ];
19
- var address = div;
20
- var article = div;
21
- var aside = div;
22
- var figure = div;
23
- var footer = div;
24
- var header = div;
25
- var main = div;
26
- var nav = div;
27
- var section = div;
28
- var form = div;
29
- var label = div;
30
- var time = div;
31
- var h1 = div;
32
- var h2 = div;
33
- var h3 = div;
34
- var h4 = div;
35
- var h5 = div;
36
- var h6 = div;
37
- var i = div;
38
- var img = div;
39
- var a = div;
40
- var li = div;
41
- var ul = div;
42
- var ol = div;
43
- var p = div;
44
- var span = div;
45
- var html = [
46
- { property: "display", value: { type: "keyword", value: "grid" } },
47
- { property: "minHeight", value: { type: "unit", unit: "%", value: 100 } },
48
- {
49
- property: "fontFamily",
50
- value: { type: "fontFamily", value: ["Arial", "Roboto", "sans-serif"] }
51
- },
52
- { property: "fontSize", value: { type: "unit", unit: "px", value: 16 } },
53
- {
54
- property: "lineHeight",
55
- value: { type: "unit", unit: "number", value: 1.2 }
56
- },
57
- {
58
- property: "whiteSpaceCollapse",
59
- value: { type: "keyword", value: "preserve" }
60
- }
61
- ];
62
- var body = [
63
- { property: "marginTop", value: { type: "unit", unit: "number", value: 0 } },
64
- {
65
- property: "marginRight",
66
- value: { type: "unit", unit: "number", value: 0 }
67
- },
68
- {
69
- property: "marginBottom",
70
- value: { type: "unit", unit: "number", value: 0 }
71
- },
72
- { property: "marginLeft", value: { type: "unit", unit: "number", value: 0 } },
73
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
74
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
75
- {
76
- property: "borderRightWidth",
77
- value: { type: "unit", unit: "px", value: 1 }
78
- },
79
- {
80
- property: "borderBottomWidth",
81
- value: { type: "unit", unit: "px", value: 1 }
82
- },
83
- {
84
- property: "borderLeftWidth",
85
- value: { type: "unit", unit: "px", value: 1 }
86
- }
87
- ];
88
- var hr = [
89
- { property: "height", value: { type: "unit", unit: "number", value: 0 } },
90
- { property: "color", value: { type: "keyword", value: "inherit" } },
91
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
92
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
93
- {
94
- property: "borderRightWidth",
95
- value: { type: "unit", unit: "px", value: 1 }
96
- },
97
- {
98
- property: "borderBottomWidth",
99
- value: { type: "unit", unit: "px", value: 1 }
100
- },
101
- {
102
- property: "borderLeftWidth",
103
- value: { type: "unit", unit: "px", value: 1 }
104
- }
105
- ];
106
- var b = [
107
- {
108
- property: "fontWeight",
109
- value: { type: "unit", unit: "number", value: 700 }
110
- },
111
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
112
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
113
- {
114
- property: "borderRightWidth",
115
- value: { type: "unit", unit: "px", value: 1 }
116
- },
117
- {
118
- property: "borderBottomWidth",
119
- value: { type: "unit", unit: "px", value: 1 }
120
- },
121
- {
122
- property: "borderLeftWidth",
123
- value: { type: "unit", unit: "px", value: 1 }
124
- }
125
- ];
126
- var strong = b;
127
- var code = [
128
- {
129
- property: "fontFamily",
130
- value: {
131
- type: "fontFamily",
132
- value: [
133
- "ui-monospace",
134
- "SFMono-Regular",
135
- "Consolas",
136
- "Liberation Mono",
137
- "Menlo",
138
- "monospace"
139
- ]
140
- }
141
- },
142
- { property: "fontSize", value: { type: "unit", unit: "em", value: 1 } },
143
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
144
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
145
- {
146
- property: "borderRightWidth",
147
- value: { type: "unit", unit: "px", value: 1 }
148
- },
149
- {
150
- property: "borderBottomWidth",
151
- value: { type: "unit", unit: "px", value: 1 }
152
- },
153
- {
154
- property: "borderLeftWidth",
155
- value: { type: "unit", unit: "px", value: 1 }
156
- }
157
- ];
158
- var kbd = code;
159
- var samp = code;
160
- var pre = code;
161
- var small = [
162
- { property: "fontSize", value: { type: "unit", unit: "%", value: 80 } },
163
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
164
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
165
- {
166
- property: "borderRightWidth",
167
- value: { type: "unit", unit: "px", value: 1 }
168
- },
169
- {
170
- property: "borderBottomWidth",
171
- value: { type: "unit", unit: "px", value: 1 }
172
- },
173
- {
174
- property: "borderLeftWidth",
175
- value: { type: "unit", unit: "px", value: 1 }
176
- }
177
- ];
178
- var sub = [
179
- { property: "fontSize", value: { type: "unit", unit: "%", value: 75 } },
180
- { property: "lineHeight", value: { type: "unit", unit: "number", value: 0 } },
181
- { property: "position", value: { type: "keyword", value: "relative" } },
182
- { property: "verticalAlign", value: { type: "keyword", value: "baseline" } },
183
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
184
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
185
- {
186
- property: "borderRightWidth",
187
- value: { type: "unit", unit: "px", value: 1 }
188
- },
189
- {
190
- property: "borderBottomWidth",
191
- value: { type: "unit", unit: "px", value: 1 }
192
- },
193
- {
194
- property: "borderLeftWidth",
195
- value: { type: "unit", unit: "px", value: 1 }
196
- },
197
- { property: "bottom", value: { type: "unit", unit: "em", value: -0.25 } }
198
- ];
199
- var sup = [
200
- { property: "fontSize", value: { type: "unit", unit: "%", value: 75 } },
201
- { property: "lineHeight", value: { type: "unit", unit: "number", value: 0 } },
202
- { property: "position", value: { type: "keyword", value: "relative" } },
203
- { property: "verticalAlign", value: { type: "keyword", value: "baseline" } },
204
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
205
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
206
- {
207
- property: "borderRightWidth",
208
- value: { type: "unit", unit: "px", value: 1 }
209
- },
210
- {
211
- property: "borderBottomWidth",
212
- value: { type: "unit", unit: "px", value: 1 }
213
- },
214
- {
215
- property: "borderLeftWidth",
216
- value: { type: "unit", unit: "px", value: 1 }
217
- },
218
- { property: "top", value: { type: "unit", unit: "em", value: -0.5 } }
219
- ];
220
- var table = [
221
- { property: "textIndent", value: { type: "unit", unit: "number", value: 0 } },
222
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
223
- {
224
- property: "borderRightWidth",
225
- value: { type: "unit", unit: "px", value: 1 }
226
- },
227
- {
228
- property: "borderBottomWidth",
229
- value: { type: "unit", unit: "px", value: 1 }
230
- },
231
- {
232
- property: "borderLeftWidth",
233
- value: { type: "unit", unit: "px", value: 1 }
234
- },
235
- { property: "borderTopColor", value: { type: "keyword", value: "inherit" } },
236
- {
237
- property: "borderRightColor",
238
- value: { type: "keyword", value: "inherit" }
239
- },
240
- {
241
- property: "borderBottomColor",
242
- value: { type: "keyword", value: "inherit" }
243
- },
244
- { property: "borderLeftColor", value: { type: "keyword", value: "inherit" } },
245
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } }
246
- ];
247
- var input = [
248
- { property: "fontFamily", value: { type: "keyword", value: "inherit" } },
249
- { property: "fontSize", value: { type: "unit", unit: "%", value: 100 } },
250
- {
251
- property: "lineHeight",
252
- value: { type: "unit", unit: "number", value: 1.15 }
253
- },
254
- { property: "marginTop", value: { type: "unit", unit: "number", value: 0 } },
255
- {
256
- property: "marginRight",
257
- value: { type: "unit", unit: "number", value: 0 }
258
- },
259
- {
260
- property: "marginBottom",
261
- value: { type: "unit", unit: "number", value: 0 }
262
- },
263
- { property: "marginLeft", value: { type: "unit", unit: "number", value: 0 } },
264
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
265
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
266
- {
267
- property: "borderRightWidth",
268
- value: { type: "unit", unit: "px", value: 1 }
269
- },
270
- {
271
- property: "borderBottomWidth",
272
- value: { type: "unit", unit: "px", value: 1 }
273
- },
274
- {
275
- property: "borderLeftWidth",
276
- value: { type: "unit", unit: "px", value: 1 }
277
- },
278
- { property: "borderTopStyle", value: { type: "keyword", value: "solid" } },
279
- { property: "borderRightStyle", value: { type: "keyword", value: "solid" } },
280
- { property: "borderBottomStyle", value: { type: "keyword", value: "solid" } },
281
- { property: "borderLeftStyle", value: { type: "keyword", value: "solid" } }
282
- ];
283
- var textarea = input;
284
- var optgroup = [
285
- { property: "fontFamily", value: { type: "keyword", value: "inherit" } },
286
- { property: "fontSize", value: { type: "unit", unit: "%", value: 100 } },
287
- {
288
- property: "lineHeight",
289
- value: { type: "unit", unit: "number", value: 1.15 }
290
- },
291
- { property: "marginTop", value: { type: "unit", unit: "number", value: 0 } },
292
- {
293
- property: "marginRight",
294
- value: { type: "unit", unit: "number", value: 0 }
295
- },
296
- {
297
- property: "marginBottom",
298
- value: { type: "unit", unit: "number", value: 0 }
299
- },
300
- { property: "marginLeft", value: { type: "unit", unit: "number", value: 0 } },
301
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
302
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
303
- {
304
- property: "borderRightWidth",
305
- value: { type: "unit", unit: "px", value: 1 }
306
- },
307
- {
308
- property: "borderBottomWidth",
309
- value: { type: "unit", unit: "px", value: 1 }
310
- },
311
- {
312
- property: "borderLeftWidth",
313
- value: { type: "unit", unit: "px", value: 1 }
314
- }
315
- ];
316
- var radio = [
317
- { property: "fontFamily", value: { type: "keyword", value: "inherit" } },
318
- { property: "fontSize", value: { type: "unit", unit: "%", value: 100 } },
319
- {
320
- property: "lineHeight",
321
- value: { type: "unit", unit: "number", value: 1.15 }
322
- },
323
- { property: "marginTop", value: { type: "unit", unit: "number", value: 0 } },
324
- {
325
- property: "marginRight",
326
- value: { type: "unit", unit: "number", value: 0 }
327
- },
328
- {
329
- property: "marginBottom",
330
- value: { type: "unit", unit: "number", value: 0 }
331
- },
332
- { property: "marginLeft", value: { type: "unit", unit: "number", value: 0 } },
333
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
334
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
335
- {
336
- property: "borderRightWidth",
337
- value: { type: "unit", unit: "px", value: 1 }
338
- },
339
- {
340
- property: "borderBottomWidth",
341
- value: { type: "unit", unit: "px", value: 1 }
342
- },
343
- {
344
- property: "borderLeftWidth",
345
- value: { type: "unit", unit: "px", value: 1 }
346
- },
347
- { property: "borderTopStyle", value: { type: "keyword", value: "none" } },
348
- { property: "borderRightStyle", value: { type: "keyword", value: "none" } },
349
- { property: "borderBottomStyle", value: { type: "keyword", value: "none" } },
350
- { property: "borderLeftStyle", value: { type: "keyword", value: "none" } }
351
- ];
352
- var checkbox = radio;
353
- var button = [
354
- { property: "fontFamily", value: { type: "keyword", value: "inherit" } },
355
- { property: "fontSize", value: { type: "unit", unit: "%", value: 100 } },
356
- {
357
- property: "lineHeight",
358
- value: { type: "unit", unit: "number", value: 1.15 }
359
- },
360
- { property: "marginTop", value: { type: "unit", unit: "number", value: 0 } },
361
- {
362
- property: "marginRight",
363
- value: { type: "unit", unit: "number", value: 0 }
364
- },
365
- {
366
- property: "marginBottom",
367
- value: { type: "unit", unit: "number", value: 0 }
368
- },
369
- { property: "marginLeft", value: { type: "unit", unit: "number", value: 0 } },
370
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
371
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
372
- {
373
- property: "borderRightWidth",
374
- value: { type: "unit", unit: "px", value: 1 }
375
- },
376
- {
377
- property: "borderBottomWidth",
378
- value: { type: "unit", unit: "px", value: 1 }
379
- },
380
- {
381
- property: "borderLeftWidth",
382
- value: { type: "unit", unit: "px", value: 1 }
383
- },
384
- { property: "borderTopStyle", value: { type: "keyword", value: "solid" } },
385
- { property: "borderRightStyle", value: { type: "keyword", value: "solid" } },
386
- { property: "borderBottomStyle", value: { type: "keyword", value: "solid" } },
387
- { property: "borderLeftStyle", value: { type: "keyword", value: "solid" } },
388
- { property: "textTransform", value: { type: "keyword", value: "none" } }
389
- ];
390
- var select = button;
391
- var legend = [
392
- { property: "paddingTop", value: { type: "unit", unit: "number", value: 0 } },
393
- {
394
- property: "paddingRight",
395
- value: { type: "unit", unit: "number", value: 0 }
396
- },
397
- {
398
- property: "paddingBottom",
399
- value: { type: "unit", unit: "number", value: 0 }
400
- },
401
- {
402
- property: "paddingLeft",
403
- value: { type: "unit", unit: "number", value: 0 }
404
- },
405
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
406
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
407
- {
408
- property: "borderRightWidth",
409
- value: { type: "unit", unit: "px", value: 1 }
410
- },
411
- {
412
- property: "borderBottomWidth",
413
- value: { type: "unit", unit: "px", value: 1 }
414
- },
415
- {
416
- property: "borderLeftWidth",
417
- value: { type: "unit", unit: "px", value: 1 }
418
- }
419
- ];
420
- var progress = [
421
- { property: "verticalAlign", value: { type: "keyword", value: "baseline" } },
422
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
423
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
424
- {
425
- property: "borderRightWidth",
426
- value: { type: "unit", unit: "px", value: 1 }
427
- },
428
- {
429
- property: "borderBottomWidth",
430
- value: { type: "unit", unit: "px", value: 1 }
431
- },
432
- {
433
- property: "borderLeftWidth",
434
- value: { type: "unit", unit: "px", value: 1 }
435
- }
436
- ];
437
- var summary = [
438
- { property: "display", value: { type: "keyword", value: "list-item" } },
439
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
440
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
441
- {
442
- property: "borderRightWidth",
443
- value: { type: "unit", unit: "px", value: 1 }
444
- },
445
- {
446
- property: "borderBottomWidth",
447
- value: { type: "unit", unit: "px", value: 1 }
448
- },
449
- {
450
- property: "borderLeftWidth",
451
- value: { type: "unit", unit: "px", value: 1 }
452
- }
453
- ];
454
- export {
455
- a,
456
- address,
457
- article,
458
- aside,
459
- b,
460
- body,
461
- button,
462
- checkbox,
463
- code,
464
- div,
465
- figure,
466
- footer,
467
- form,
468
- h1,
469
- h2,
470
- h3,
471
- h4,
472
- h5,
473
- h6,
474
- header,
475
- hr,
476
- html,
477
- i,
478
- img,
479
- input,
480
- kbd,
481
- label,
482
- legend,
483
- li,
484
- main,
485
- nav,
486
- ol,
487
- optgroup,
488
- p,
489
- pre,
490
- progress,
491
- radio,
492
- samp,
493
- section,
494
- select,
495
- small,
496
- span,
497
- strong,
498
- sub,
499
- summary,
500
- sup,
501
- table,
502
- textarea,
503
- time,
504
- ul
505
- };