@webstudio-is/sdk 0.0.0-017f1bd

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 (47) hide show
  1. package/LICENSE +661 -0
  2. package/lib/__generated__/normalize.css.js +593 -0
  3. package/lib/core-templates.js +1267 -0
  4. package/lib/index.js +2918 -0
  5. package/lib/runtime.js +117 -0
  6. package/lib/types/__generated__/normalize.css.d.ts +57 -0
  7. package/lib/types/__generated__/tags.d.ts +1 -0
  8. package/lib/types/core-metas.d.ts +20 -0
  9. package/lib/types/core-templates.d.ts +9 -0
  10. package/lib/types/css.d.ts +31 -0
  11. package/lib/types/css.test.d.ts +1 -0
  12. package/lib/types/expression.d.ts +60 -0
  13. package/lib/types/expression.test.d.ts +1 -0
  14. package/lib/types/form-fields.d.ts +8 -0
  15. package/lib/types/index.d.ts +26 -0
  16. package/lib/types/instances-utils.d.ts +8 -0
  17. package/lib/types/instances-utils.test.d.ts +1 -0
  18. package/lib/types/page-meta-generator.d.ts +24 -0
  19. package/lib/types/page-meta-generator.test.d.ts +1 -0
  20. package/lib/types/page-utils.d.ts +24 -0
  21. package/lib/types/page-utils.test.d.ts +1 -0
  22. package/lib/types/resource-loader.d.ts +30 -0
  23. package/lib/types/resource-loader.test.d.ts +1 -0
  24. package/lib/types/resources-generator.d.ts +22 -0
  25. package/lib/types/resources-generator.test.d.ts +1 -0
  26. package/lib/types/runtime.d.ts +8 -0
  27. package/lib/types/schema/animation-schema.d.ts +53844 -0
  28. package/lib/types/schema/assets.d.ts +455 -0
  29. package/lib/types/schema/breakpoints.d.ts +56 -0
  30. package/lib/types/schema/component-meta.d.ts +12262 -0
  31. package/lib/types/schema/data-sources.d.ts +303 -0
  32. package/lib/types/schema/deployment.d.ts +41 -0
  33. package/lib/types/schema/instances.d.ts +214 -0
  34. package/lib/types/schema/pages.d.ts +676 -0
  35. package/lib/types/schema/prop-meta.d.ts +500 -0
  36. package/lib/types/schema/props.d.ts +37387 -0
  37. package/lib/types/schema/resources.d.ts +121 -0
  38. package/lib/types/schema/style-source-selections.d.ts +23 -0
  39. package/lib/types/schema/style-sources.d.ts +62 -0
  40. package/lib/types/schema/styles.d.ts +6293 -0
  41. package/lib/types/schema/webstudio.d.ts +24734 -0
  42. package/lib/types/scope.d.ts +16 -0
  43. package/lib/types/scope.test.d.ts +1 -0
  44. package/lib/types/to-string.d.ts +2 -0
  45. package/lib/types/url-pattern.d.ts +2 -0
  46. package/lib/types/url-pattern.test.d.ts +1 -0
  47. package/package.json +61 -0
@@ -0,0 +1,455 @@
1
+ import { z } from "zod";
2
+ export declare const FontAsset: z.ZodObject<{
3
+ format: z.ZodUnion<[z.ZodLiteral<"ttf">, z.ZodLiteral<"woff">, z.ZodLiteral<"woff2">]>;
4
+ meta: z.ZodUnion<[z.ZodObject<{
5
+ family: z.ZodString;
6
+ style: z.ZodEnum<["normal", "italic", "oblique"]>;
7
+ weight: z.ZodNumber;
8
+ }, "strip", z.ZodTypeAny, {
9
+ family: string;
10
+ style: "normal" | "italic" | "oblique";
11
+ weight: number;
12
+ }, {
13
+ family: string;
14
+ style: "normal" | "italic" | "oblique";
15
+ weight: number;
16
+ }>, z.ZodObject<{
17
+ family: z.ZodString;
18
+ variationAxes: z.ZodRecord<z.ZodEnum<["wght", "wdth", "slnt", "opsz", "ital", "GRAD", "XTRA", "XOPQ", "YOPQ", "YTLC", "YTUC", "YTAS", "YTDE", "YTFI"]>, z.ZodObject<{
19
+ name: z.ZodString;
20
+ min: z.ZodNumber;
21
+ default: z.ZodNumber;
22
+ max: z.ZodNumber;
23
+ }, "strip", z.ZodTypeAny, {
24
+ name: string;
25
+ min: number;
26
+ default: number;
27
+ max: number;
28
+ }, {
29
+ name: string;
30
+ min: number;
31
+ default: number;
32
+ max: number;
33
+ }>>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ family: string;
36
+ variationAxes: Partial<Record<"wght" | "wdth" | "slnt" | "opsz" | "ital" | "GRAD" | "XTRA" | "XOPQ" | "YOPQ" | "YTLC" | "YTUC" | "YTAS" | "YTDE" | "YTFI", {
37
+ name: string;
38
+ min: number;
39
+ default: number;
40
+ max: number;
41
+ }>>;
42
+ }, {
43
+ family: string;
44
+ variationAxes: Partial<Record<"wght" | "wdth" | "slnt" | "opsz" | "ital" | "GRAD" | "XTRA" | "XOPQ" | "YOPQ" | "YTLC" | "YTUC" | "YTAS" | "YTDE" | "YTFI", {
45
+ name: string;
46
+ min: number;
47
+ default: number;
48
+ max: number;
49
+ }>>;
50
+ }>]>;
51
+ type: z.ZodLiteral<"font">;
52
+ id: z.ZodString;
53
+ projectId: z.ZodString;
54
+ size: z.ZodNumber;
55
+ name: z.ZodString;
56
+ description: z.ZodUnion<[z.ZodString, z.ZodNull]>;
57
+ createdAt: z.ZodString;
58
+ }, "strip", z.ZodTypeAny, {
59
+ type: "font";
60
+ name: string;
61
+ meta: {
62
+ family: string;
63
+ style: "normal" | "italic" | "oblique";
64
+ weight: number;
65
+ } | {
66
+ family: string;
67
+ variationAxes: Partial<Record<"wght" | "wdth" | "slnt" | "opsz" | "ital" | "GRAD" | "XTRA" | "XOPQ" | "YOPQ" | "YTLC" | "YTUC" | "YTAS" | "YTDE" | "YTFI", {
68
+ name: string;
69
+ min: number;
70
+ default: number;
71
+ max: number;
72
+ }>>;
73
+ };
74
+ description: string | null;
75
+ id: string;
76
+ format: "ttf" | "woff" | "woff2";
77
+ projectId: string;
78
+ size: number;
79
+ createdAt: string;
80
+ }, {
81
+ type: "font";
82
+ name: string;
83
+ meta: {
84
+ family: string;
85
+ style: "normal" | "italic" | "oblique";
86
+ weight: number;
87
+ } | {
88
+ family: string;
89
+ variationAxes: Partial<Record<"wght" | "wdth" | "slnt" | "opsz" | "ital" | "GRAD" | "XTRA" | "XOPQ" | "YOPQ" | "YTLC" | "YTUC" | "YTAS" | "YTDE" | "YTFI", {
90
+ name: string;
91
+ min: number;
92
+ default: number;
93
+ max: number;
94
+ }>>;
95
+ };
96
+ description: string | null;
97
+ id: string;
98
+ format: "ttf" | "woff" | "woff2";
99
+ projectId: string;
100
+ size: number;
101
+ createdAt: string;
102
+ }>;
103
+ export type FontAsset = z.infer<typeof FontAsset>;
104
+ export declare const ImageMeta: z.ZodObject<{
105
+ width: z.ZodNumber;
106
+ height: z.ZodNumber;
107
+ }, "strip", z.ZodTypeAny, {
108
+ height: number;
109
+ width: number;
110
+ }, {
111
+ height: number;
112
+ width: number;
113
+ }>;
114
+ export type ImageMeta = z.infer<typeof ImageMeta>;
115
+ export declare const ImageAsset: z.ZodObject<{
116
+ format: z.ZodString;
117
+ meta: z.ZodObject<{
118
+ width: z.ZodNumber;
119
+ height: z.ZodNumber;
120
+ }, "strip", z.ZodTypeAny, {
121
+ height: number;
122
+ width: number;
123
+ }, {
124
+ height: number;
125
+ width: number;
126
+ }>;
127
+ type: z.ZodLiteral<"image">;
128
+ id: z.ZodString;
129
+ projectId: z.ZodString;
130
+ size: z.ZodNumber;
131
+ name: z.ZodString;
132
+ description: z.ZodUnion<[z.ZodString, z.ZodNull]>;
133
+ createdAt: z.ZodString;
134
+ }, "strip", z.ZodTypeAny, {
135
+ type: "image";
136
+ name: string;
137
+ meta: {
138
+ height: number;
139
+ width: number;
140
+ };
141
+ description: string | null;
142
+ id: string;
143
+ format: string;
144
+ projectId: string;
145
+ size: number;
146
+ createdAt: string;
147
+ }, {
148
+ type: "image";
149
+ name: string;
150
+ meta: {
151
+ height: number;
152
+ width: number;
153
+ };
154
+ description: string | null;
155
+ id: string;
156
+ format: string;
157
+ projectId: string;
158
+ size: number;
159
+ createdAt: string;
160
+ }>;
161
+ export type ImageAsset = z.infer<typeof ImageAsset>;
162
+ export declare const Asset: z.ZodUnion<[z.ZodObject<{
163
+ format: z.ZodUnion<[z.ZodLiteral<"ttf">, z.ZodLiteral<"woff">, z.ZodLiteral<"woff2">]>;
164
+ meta: z.ZodUnion<[z.ZodObject<{
165
+ family: z.ZodString;
166
+ style: z.ZodEnum<["normal", "italic", "oblique"]>;
167
+ weight: z.ZodNumber;
168
+ }, "strip", z.ZodTypeAny, {
169
+ family: string;
170
+ style: "normal" | "italic" | "oblique";
171
+ weight: number;
172
+ }, {
173
+ family: string;
174
+ style: "normal" | "italic" | "oblique";
175
+ weight: number;
176
+ }>, z.ZodObject<{
177
+ family: z.ZodString;
178
+ variationAxes: z.ZodRecord<z.ZodEnum<["wght", "wdth", "slnt", "opsz", "ital", "GRAD", "XTRA", "XOPQ", "YOPQ", "YTLC", "YTUC", "YTAS", "YTDE", "YTFI"]>, z.ZodObject<{
179
+ name: z.ZodString;
180
+ min: z.ZodNumber;
181
+ default: z.ZodNumber;
182
+ max: z.ZodNumber;
183
+ }, "strip", z.ZodTypeAny, {
184
+ name: string;
185
+ min: number;
186
+ default: number;
187
+ max: number;
188
+ }, {
189
+ name: string;
190
+ min: number;
191
+ default: number;
192
+ max: number;
193
+ }>>;
194
+ }, "strip", z.ZodTypeAny, {
195
+ family: string;
196
+ variationAxes: Partial<Record<"wght" | "wdth" | "slnt" | "opsz" | "ital" | "GRAD" | "XTRA" | "XOPQ" | "YOPQ" | "YTLC" | "YTUC" | "YTAS" | "YTDE" | "YTFI", {
197
+ name: string;
198
+ min: number;
199
+ default: number;
200
+ max: number;
201
+ }>>;
202
+ }, {
203
+ family: string;
204
+ variationAxes: Partial<Record<"wght" | "wdth" | "slnt" | "opsz" | "ital" | "GRAD" | "XTRA" | "XOPQ" | "YOPQ" | "YTLC" | "YTUC" | "YTAS" | "YTDE" | "YTFI", {
205
+ name: string;
206
+ min: number;
207
+ default: number;
208
+ max: number;
209
+ }>>;
210
+ }>]>;
211
+ type: z.ZodLiteral<"font">;
212
+ id: z.ZodString;
213
+ projectId: z.ZodString;
214
+ size: z.ZodNumber;
215
+ name: z.ZodString;
216
+ description: z.ZodUnion<[z.ZodString, z.ZodNull]>;
217
+ createdAt: z.ZodString;
218
+ }, "strip", z.ZodTypeAny, {
219
+ type: "font";
220
+ name: string;
221
+ meta: {
222
+ family: string;
223
+ style: "normal" | "italic" | "oblique";
224
+ weight: number;
225
+ } | {
226
+ family: string;
227
+ variationAxes: Partial<Record<"wght" | "wdth" | "slnt" | "opsz" | "ital" | "GRAD" | "XTRA" | "XOPQ" | "YOPQ" | "YTLC" | "YTUC" | "YTAS" | "YTDE" | "YTFI", {
228
+ name: string;
229
+ min: number;
230
+ default: number;
231
+ max: number;
232
+ }>>;
233
+ };
234
+ description: string | null;
235
+ id: string;
236
+ format: "ttf" | "woff" | "woff2";
237
+ projectId: string;
238
+ size: number;
239
+ createdAt: string;
240
+ }, {
241
+ type: "font";
242
+ name: string;
243
+ meta: {
244
+ family: string;
245
+ style: "normal" | "italic" | "oblique";
246
+ weight: number;
247
+ } | {
248
+ family: string;
249
+ variationAxes: Partial<Record<"wght" | "wdth" | "slnt" | "opsz" | "ital" | "GRAD" | "XTRA" | "XOPQ" | "YOPQ" | "YTLC" | "YTUC" | "YTAS" | "YTDE" | "YTFI", {
250
+ name: string;
251
+ min: number;
252
+ default: number;
253
+ max: number;
254
+ }>>;
255
+ };
256
+ description: string | null;
257
+ id: string;
258
+ format: "ttf" | "woff" | "woff2";
259
+ projectId: string;
260
+ size: number;
261
+ createdAt: string;
262
+ }>, z.ZodObject<{
263
+ format: z.ZodString;
264
+ meta: z.ZodObject<{
265
+ width: z.ZodNumber;
266
+ height: z.ZodNumber;
267
+ }, "strip", z.ZodTypeAny, {
268
+ height: number;
269
+ width: number;
270
+ }, {
271
+ height: number;
272
+ width: number;
273
+ }>;
274
+ type: z.ZodLiteral<"image">;
275
+ id: z.ZodString;
276
+ projectId: z.ZodString;
277
+ size: z.ZodNumber;
278
+ name: z.ZodString;
279
+ description: z.ZodUnion<[z.ZodString, z.ZodNull]>;
280
+ createdAt: z.ZodString;
281
+ }, "strip", z.ZodTypeAny, {
282
+ type: "image";
283
+ name: string;
284
+ meta: {
285
+ height: number;
286
+ width: number;
287
+ };
288
+ description: string | null;
289
+ id: string;
290
+ format: string;
291
+ projectId: string;
292
+ size: number;
293
+ createdAt: string;
294
+ }, {
295
+ type: "image";
296
+ name: string;
297
+ meta: {
298
+ height: number;
299
+ width: number;
300
+ };
301
+ description: string | null;
302
+ id: string;
303
+ format: string;
304
+ projectId: string;
305
+ size: number;
306
+ createdAt: string;
307
+ }>]>;
308
+ export type Asset = z.infer<typeof Asset>;
309
+ export declare const Assets: z.ZodMap<z.ZodString, z.ZodUnion<[z.ZodObject<{
310
+ format: z.ZodUnion<[z.ZodLiteral<"ttf">, z.ZodLiteral<"woff">, z.ZodLiteral<"woff2">]>;
311
+ meta: z.ZodUnion<[z.ZodObject<{
312
+ family: z.ZodString;
313
+ style: z.ZodEnum<["normal", "italic", "oblique"]>;
314
+ weight: z.ZodNumber;
315
+ }, "strip", z.ZodTypeAny, {
316
+ family: string;
317
+ style: "normal" | "italic" | "oblique";
318
+ weight: number;
319
+ }, {
320
+ family: string;
321
+ style: "normal" | "italic" | "oblique";
322
+ weight: number;
323
+ }>, z.ZodObject<{
324
+ family: z.ZodString;
325
+ variationAxes: z.ZodRecord<z.ZodEnum<["wght", "wdth", "slnt", "opsz", "ital", "GRAD", "XTRA", "XOPQ", "YOPQ", "YTLC", "YTUC", "YTAS", "YTDE", "YTFI"]>, z.ZodObject<{
326
+ name: z.ZodString;
327
+ min: z.ZodNumber;
328
+ default: z.ZodNumber;
329
+ max: z.ZodNumber;
330
+ }, "strip", z.ZodTypeAny, {
331
+ name: string;
332
+ min: number;
333
+ default: number;
334
+ max: number;
335
+ }, {
336
+ name: string;
337
+ min: number;
338
+ default: number;
339
+ max: number;
340
+ }>>;
341
+ }, "strip", z.ZodTypeAny, {
342
+ family: string;
343
+ variationAxes: Partial<Record<"wght" | "wdth" | "slnt" | "opsz" | "ital" | "GRAD" | "XTRA" | "XOPQ" | "YOPQ" | "YTLC" | "YTUC" | "YTAS" | "YTDE" | "YTFI", {
344
+ name: string;
345
+ min: number;
346
+ default: number;
347
+ max: number;
348
+ }>>;
349
+ }, {
350
+ family: string;
351
+ variationAxes: Partial<Record<"wght" | "wdth" | "slnt" | "opsz" | "ital" | "GRAD" | "XTRA" | "XOPQ" | "YOPQ" | "YTLC" | "YTUC" | "YTAS" | "YTDE" | "YTFI", {
352
+ name: string;
353
+ min: number;
354
+ default: number;
355
+ max: number;
356
+ }>>;
357
+ }>]>;
358
+ type: z.ZodLiteral<"font">;
359
+ id: z.ZodString;
360
+ projectId: z.ZodString;
361
+ size: z.ZodNumber;
362
+ name: z.ZodString;
363
+ description: z.ZodUnion<[z.ZodString, z.ZodNull]>;
364
+ createdAt: z.ZodString;
365
+ }, "strip", z.ZodTypeAny, {
366
+ type: "font";
367
+ name: string;
368
+ meta: {
369
+ family: string;
370
+ style: "normal" | "italic" | "oblique";
371
+ weight: number;
372
+ } | {
373
+ family: string;
374
+ variationAxes: Partial<Record<"wght" | "wdth" | "slnt" | "opsz" | "ital" | "GRAD" | "XTRA" | "XOPQ" | "YOPQ" | "YTLC" | "YTUC" | "YTAS" | "YTDE" | "YTFI", {
375
+ name: string;
376
+ min: number;
377
+ default: number;
378
+ max: number;
379
+ }>>;
380
+ };
381
+ description: string | null;
382
+ id: string;
383
+ format: "ttf" | "woff" | "woff2";
384
+ projectId: string;
385
+ size: number;
386
+ createdAt: string;
387
+ }, {
388
+ type: "font";
389
+ name: string;
390
+ meta: {
391
+ family: string;
392
+ style: "normal" | "italic" | "oblique";
393
+ weight: number;
394
+ } | {
395
+ family: string;
396
+ variationAxes: Partial<Record<"wght" | "wdth" | "slnt" | "opsz" | "ital" | "GRAD" | "XTRA" | "XOPQ" | "YOPQ" | "YTLC" | "YTUC" | "YTAS" | "YTDE" | "YTFI", {
397
+ name: string;
398
+ min: number;
399
+ default: number;
400
+ max: number;
401
+ }>>;
402
+ };
403
+ description: string | null;
404
+ id: string;
405
+ format: "ttf" | "woff" | "woff2";
406
+ projectId: string;
407
+ size: number;
408
+ createdAt: string;
409
+ }>, z.ZodObject<{
410
+ format: z.ZodString;
411
+ meta: z.ZodObject<{
412
+ width: z.ZodNumber;
413
+ height: z.ZodNumber;
414
+ }, "strip", z.ZodTypeAny, {
415
+ height: number;
416
+ width: number;
417
+ }, {
418
+ height: number;
419
+ width: number;
420
+ }>;
421
+ type: z.ZodLiteral<"image">;
422
+ id: z.ZodString;
423
+ projectId: z.ZodString;
424
+ size: z.ZodNumber;
425
+ name: z.ZodString;
426
+ description: z.ZodUnion<[z.ZodString, z.ZodNull]>;
427
+ createdAt: z.ZodString;
428
+ }, "strip", z.ZodTypeAny, {
429
+ type: "image";
430
+ name: string;
431
+ meta: {
432
+ height: number;
433
+ width: number;
434
+ };
435
+ description: string | null;
436
+ id: string;
437
+ format: string;
438
+ projectId: string;
439
+ size: number;
440
+ createdAt: string;
441
+ }, {
442
+ type: "image";
443
+ name: string;
444
+ meta: {
445
+ height: number;
446
+ width: number;
447
+ };
448
+ description: string | null;
449
+ id: string;
450
+ format: string;
451
+ projectId: string;
452
+ size: number;
453
+ createdAt: string;
454
+ }>]>>;
455
+ export type Assets = z.infer<typeof Assets>;
@@ -0,0 +1,56 @@
1
+ import { z } from "zod";
2
+ export declare const Breakpoint: z.ZodEffects<z.ZodObject<{
3
+ id: z.ZodString;
4
+ label: z.ZodString;
5
+ minWidth: z.ZodOptional<z.ZodNumber>;
6
+ maxWidth: z.ZodOptional<z.ZodNumber>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ label: string;
9
+ id: string;
10
+ maxWidth?: number | undefined;
11
+ minWidth?: number | undefined;
12
+ }, {
13
+ label: string;
14
+ id: string;
15
+ maxWidth?: number | undefined;
16
+ minWidth?: number | undefined;
17
+ }>, {
18
+ label: string;
19
+ id: string;
20
+ maxWidth?: number | undefined;
21
+ minWidth?: number | undefined;
22
+ }, {
23
+ label: string;
24
+ id: string;
25
+ maxWidth?: number | undefined;
26
+ minWidth?: number | undefined;
27
+ }>;
28
+ export type Breakpoint = z.infer<typeof Breakpoint>;
29
+ export declare const Breakpoints: z.ZodMap<z.ZodString, z.ZodEffects<z.ZodObject<{
30
+ id: z.ZodString;
31
+ label: z.ZodString;
32
+ minWidth: z.ZodOptional<z.ZodNumber>;
33
+ maxWidth: z.ZodOptional<z.ZodNumber>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ label: string;
36
+ id: string;
37
+ maxWidth?: number | undefined;
38
+ minWidth?: number | undefined;
39
+ }, {
40
+ label: string;
41
+ id: string;
42
+ maxWidth?: number | undefined;
43
+ minWidth?: number | undefined;
44
+ }>, {
45
+ label: string;
46
+ id: string;
47
+ maxWidth?: number | undefined;
48
+ minWidth?: number | undefined;
49
+ }, {
50
+ label: string;
51
+ id: string;
52
+ maxWidth?: number | undefined;
53
+ minWidth?: number | undefined;
54
+ }>>;
55
+ export type Breakpoints = z.infer<typeof Breakpoints>;
56
+ export declare const initialBreakpoints: Array<Breakpoint>;