@webstudio-is/sdk 0.0.0-588fe22 → 0.0.0-a5970cb

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.
@@ -1,9 +1,16 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
1
7
  // src/core-templates.tsx
2
8
  import {
3
9
  $,
4
10
  css,
5
11
  expression,
6
12
  Parameter,
13
+ PlaceholderValue,
7
14
  ws
8
15
  } from "@webstudio-is/template";
9
16
 
@@ -17,66 +24,762 @@ import {
17
24
  } from "@webstudio-is/icons/svg";
18
25
 
19
26
  // src/__generated__/normalize.css.ts
27
+ var normalize_css_exports = {};
28
+ __export(normalize_css_exports, {
29
+ a: () => a,
30
+ address: () => address,
31
+ article: () => article,
32
+ aside: () => aside,
33
+ b: () => b,
34
+ body: () => body,
35
+ button: () => button,
36
+ checkbox: () => checkbox,
37
+ code: () => code,
38
+ div: () => div,
39
+ figure: () => figure,
40
+ footer: () => footer,
41
+ form: () => form,
42
+ h1: () => h1,
43
+ h2: () => h2,
44
+ h3: () => h3,
45
+ h4: () => h4,
46
+ h5: () => h5,
47
+ h6: () => h6,
48
+ header: () => header,
49
+ hr: () => hr,
50
+ html: () => html,
51
+ i: () => i,
52
+ img: () => img,
53
+ input: () => input,
54
+ kbd: () => kbd,
55
+ label: () => label,
56
+ legend: () => legend,
57
+ li: () => li,
58
+ main: () => main,
59
+ nav: () => nav,
60
+ ol: () => ol,
61
+ optgroup: () => optgroup,
62
+ p: () => p,
63
+ pre: () => pre,
64
+ progress: () => progress,
65
+ radio: () => radio,
66
+ samp: () => samp,
67
+ section: () => section,
68
+ select: () => select,
69
+ small: () => small,
70
+ span: () => span,
71
+ strong: () => strong,
72
+ sub: () => sub,
73
+ summary: () => summary,
74
+ sup: () => sup,
75
+ table: () => table,
76
+ textarea: () => textarea,
77
+ time: () => time,
78
+ ul: () => ul
79
+ });
80
+ var div = [
81
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
82
+ {
83
+ property: "border-top-width",
84
+ value: { type: "unit", unit: "px", value: 1 }
85
+ },
86
+ {
87
+ property: "border-right-width",
88
+ value: { type: "unit", unit: "px", value: 1 }
89
+ },
90
+ {
91
+ property: "border-bottom-width",
92
+ value: { type: "unit", unit: "px", value: 1 }
93
+ },
94
+ {
95
+ property: "border-left-width",
96
+ value: { type: "unit", unit: "px", value: 1 }
97
+ },
98
+ { property: "outline-width", value: { type: "unit", unit: "px", value: 1 } }
99
+ ];
100
+ var address = div;
101
+ var article = div;
102
+ var aside = div;
103
+ var figure = div;
104
+ var footer = div;
105
+ var header = div;
106
+ var main = div;
107
+ var nav = div;
108
+ var section = div;
109
+ var form = div;
110
+ var label = div;
111
+ var time = div;
112
+ var h1 = div;
113
+ var h2 = div;
114
+ var h3 = div;
115
+ var h4 = div;
116
+ var h5 = div;
117
+ var h6 = div;
118
+ var i = div;
119
+ var img = div;
120
+ var a = div;
121
+ var li = div;
122
+ var ul = div;
123
+ var ol = div;
124
+ var p = div;
125
+ var span = div;
20
126
  var html = [
21
127
  { property: "display", value: { type: "keyword", value: "grid" } },
22
- { property: "minHeight", value: { type: "unit", unit: "%", value: 100 } },
128
+ { property: "min-height", value: { type: "unit", unit: "%", value: 100 } },
23
129
  {
24
- property: "fontFamily",
130
+ property: "font-family",
25
131
  value: { type: "fontFamily", value: ["Arial", "Roboto", "sans-serif"] }
26
132
  },
27
- { property: "fontSize", value: { type: "unit", unit: "px", value: 16 } },
133
+ { property: "font-size", value: { type: "unit", unit: "px", value: 16 } },
28
134
  {
29
- property: "lineHeight",
135
+ property: "line-height",
30
136
  value: { type: "unit", unit: "number", value: 1.2 }
31
137
  },
32
138
  {
33
- property: "whiteSpaceCollapse",
139
+ property: "white-space-collapse",
34
140
  value: { type: "keyword", value: "preserve" }
35
141
  }
36
142
  ];
143
+ var body = [
144
+ { property: "margin-top", value: { type: "unit", unit: "number", value: 0 } },
145
+ {
146
+ property: "margin-right",
147
+ value: { type: "unit", unit: "number", value: 0 }
148
+ },
149
+ {
150
+ property: "margin-bottom",
151
+ value: { type: "unit", unit: "number", value: 0 }
152
+ },
153
+ {
154
+ property: "margin-left",
155
+ value: { type: "unit", unit: "number", value: 0 }
156
+ },
157
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
158
+ {
159
+ property: "border-top-width",
160
+ value: { type: "unit", unit: "px", value: 1 }
161
+ },
162
+ {
163
+ property: "border-right-width",
164
+ value: { type: "unit", unit: "px", value: 1 }
165
+ },
166
+ {
167
+ property: "border-bottom-width",
168
+ value: { type: "unit", unit: "px", value: 1 }
169
+ },
170
+ {
171
+ property: "border-left-width",
172
+ value: { type: "unit", unit: "px", value: 1 }
173
+ },
174
+ {
175
+ property: "-webkit-font-smoothing",
176
+ value: { type: "keyword", value: "antialiased" }
177
+ },
178
+ {
179
+ property: "-moz-osx-font-smoothing",
180
+ value: { type: "keyword", value: "grayscale" }
181
+ }
182
+ ];
183
+ var hr = [
184
+ { property: "height", value: { type: "unit", unit: "number", value: 0 } },
185
+ { property: "color", value: { type: "keyword", value: "inherit" } }
186
+ ];
187
+ var b = [
188
+ {
189
+ property: "font-weight",
190
+ value: { type: "unit", unit: "number", value: 700 }
191
+ },
192
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
193
+ {
194
+ property: "border-top-width",
195
+ value: { type: "unit", unit: "px", value: 1 }
196
+ },
197
+ {
198
+ property: "border-right-width",
199
+ value: { type: "unit", unit: "px", value: 1 }
200
+ },
201
+ {
202
+ property: "border-bottom-width",
203
+ value: { type: "unit", unit: "px", value: 1 }
204
+ },
205
+ {
206
+ property: "border-left-width",
207
+ value: { type: "unit", unit: "px", value: 1 }
208
+ }
209
+ ];
210
+ var strong = b;
211
+ var code = [
212
+ {
213
+ property: "font-family",
214
+ value: {
215
+ type: "fontFamily",
216
+ value: [
217
+ "ui-monospace",
218
+ "SFMono-Regular",
219
+ "Consolas",
220
+ "Liberation Mono",
221
+ "Menlo",
222
+ "monospace"
223
+ ]
224
+ }
225
+ },
226
+ { property: "font-size", value: { type: "unit", unit: "em", value: 1 } },
227
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
228
+ {
229
+ property: "border-top-width",
230
+ value: { type: "unit", unit: "px", value: 1 }
231
+ },
232
+ {
233
+ property: "border-right-width",
234
+ value: { type: "unit", unit: "px", value: 1 }
235
+ },
236
+ {
237
+ property: "border-bottom-width",
238
+ value: { type: "unit", unit: "px", value: 1 }
239
+ },
240
+ {
241
+ property: "border-left-width",
242
+ value: { type: "unit", unit: "px", value: 1 }
243
+ }
244
+ ];
245
+ var kbd = code;
246
+ var samp = code;
247
+ var pre = code;
248
+ var small = [
249
+ { property: "font-size", value: { type: "unit", unit: "%", value: 80 } },
250
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
251
+ {
252
+ property: "border-top-width",
253
+ value: { type: "unit", unit: "px", value: 1 }
254
+ },
255
+ {
256
+ property: "border-right-width",
257
+ value: { type: "unit", unit: "px", value: 1 }
258
+ },
259
+ {
260
+ property: "border-bottom-width",
261
+ value: { type: "unit", unit: "px", value: 1 }
262
+ },
263
+ {
264
+ property: "border-left-width",
265
+ value: { type: "unit", unit: "px", value: 1 }
266
+ }
267
+ ];
268
+ var sub = [
269
+ { property: "font-size", value: { type: "unit", unit: "%", value: 75 } },
270
+ {
271
+ property: "line-height",
272
+ value: { type: "unit", unit: "number", value: 0 }
273
+ },
274
+ { property: "position", value: { type: "keyword", value: "relative" } },
275
+ { property: "vertical-align", value: { type: "keyword", value: "baseline" } },
276
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
277
+ {
278
+ property: "border-top-width",
279
+ value: { type: "unit", unit: "px", value: 1 }
280
+ },
281
+ {
282
+ property: "border-right-width",
283
+ value: { type: "unit", unit: "px", value: 1 }
284
+ },
285
+ {
286
+ property: "border-bottom-width",
287
+ value: { type: "unit", unit: "px", value: 1 }
288
+ },
289
+ {
290
+ property: "border-left-width",
291
+ value: { type: "unit", unit: "px", value: 1 }
292
+ },
293
+ { property: "bottom", value: { type: "unit", unit: "em", value: -0.25 } }
294
+ ];
295
+ var sup = [
296
+ { property: "font-size", value: { type: "unit", unit: "%", value: 75 } },
297
+ {
298
+ property: "line-height",
299
+ value: { type: "unit", unit: "number", value: 0 }
300
+ },
301
+ { property: "position", value: { type: "keyword", value: "relative" } },
302
+ { property: "vertical-align", value: { type: "keyword", value: "baseline" } },
303
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
304
+ {
305
+ property: "border-top-width",
306
+ value: { type: "unit", unit: "px", value: 1 }
307
+ },
308
+ {
309
+ property: "border-right-width",
310
+ value: { type: "unit", unit: "px", value: 1 }
311
+ },
312
+ {
313
+ property: "border-bottom-width",
314
+ value: { type: "unit", unit: "px", value: 1 }
315
+ },
316
+ {
317
+ property: "border-left-width",
318
+ value: { type: "unit", unit: "px", value: 1 }
319
+ },
320
+ { property: "top", value: { type: "unit", unit: "em", value: -0.5 } }
321
+ ];
322
+ var table = [
323
+ {
324
+ property: "text-indent",
325
+ value: { type: "unit", unit: "number", value: 0 }
326
+ },
327
+ {
328
+ property: "border-top-width",
329
+ value: { type: "unit", unit: "px", value: 1 }
330
+ },
331
+ {
332
+ property: "border-right-width",
333
+ value: { type: "unit", unit: "px", value: 1 }
334
+ },
335
+ {
336
+ property: "border-bottom-width",
337
+ value: { type: "unit", unit: "px", value: 1 }
338
+ },
339
+ {
340
+ property: "border-left-width",
341
+ value: { type: "unit", unit: "px", value: 1 }
342
+ },
343
+ {
344
+ property: "border-top-color",
345
+ value: { type: "keyword", value: "inherit" }
346
+ },
347
+ {
348
+ property: "border-right-color",
349
+ value: { type: "keyword", value: "inherit" }
350
+ },
351
+ {
352
+ property: "border-bottom-color",
353
+ value: { type: "keyword", value: "inherit" }
354
+ },
355
+ {
356
+ property: "border-left-color",
357
+ value: { type: "keyword", value: "inherit" }
358
+ },
359
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } }
360
+ ];
361
+ var input = [
362
+ { property: "font-family", value: { type: "keyword", value: "inherit" } },
363
+ { property: "font-size", value: { type: "unit", unit: "%", value: 100 } },
364
+ {
365
+ property: "line-height",
366
+ value: { type: "unit", unit: "number", value: 1.15 }
367
+ },
368
+ { property: "margin-top", value: { type: "unit", unit: "number", value: 0 } },
369
+ {
370
+ property: "margin-right",
371
+ value: { type: "unit", unit: "number", value: 0 }
372
+ },
373
+ {
374
+ property: "margin-bottom",
375
+ value: { type: "unit", unit: "number", value: 0 }
376
+ },
377
+ {
378
+ property: "margin-left",
379
+ value: { type: "unit", unit: "number", value: 0 }
380
+ },
381
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
382
+ {
383
+ property: "border-top-width",
384
+ value: { type: "unit", unit: "px", value: 1 }
385
+ },
386
+ {
387
+ property: "border-right-width",
388
+ value: { type: "unit", unit: "px", value: 1 }
389
+ },
390
+ {
391
+ property: "border-bottom-width",
392
+ value: { type: "unit", unit: "px", value: 1 }
393
+ },
394
+ {
395
+ property: "border-left-width",
396
+ value: { type: "unit", unit: "px", value: 1 }
397
+ },
398
+ { property: "border-top-style", value: { type: "keyword", value: "solid" } },
399
+ {
400
+ property: "border-right-style",
401
+ value: { type: "keyword", value: "solid" }
402
+ },
403
+ {
404
+ property: "border-bottom-style",
405
+ value: { type: "keyword", value: "solid" }
406
+ },
407
+ { property: "border-left-style", value: { type: "keyword", value: "solid" } }
408
+ ];
409
+ var textarea = input;
410
+ var optgroup = [
411
+ { property: "font-family", value: { type: "keyword", value: "inherit" } },
412
+ { property: "font-size", value: { type: "unit", unit: "%", value: 100 } },
413
+ {
414
+ property: "line-height",
415
+ value: { type: "unit", unit: "number", value: 1.15 }
416
+ },
417
+ { property: "margin-top", value: { type: "unit", unit: "number", value: 0 } },
418
+ {
419
+ property: "margin-right",
420
+ value: { type: "unit", unit: "number", value: 0 }
421
+ },
422
+ {
423
+ property: "margin-bottom",
424
+ value: { type: "unit", unit: "number", value: 0 }
425
+ },
426
+ {
427
+ property: "margin-left",
428
+ value: { type: "unit", unit: "number", value: 0 }
429
+ },
430
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
431
+ {
432
+ property: "border-top-width",
433
+ value: { type: "unit", unit: "px", value: 1 }
434
+ },
435
+ {
436
+ property: "border-right-width",
437
+ value: { type: "unit", unit: "px", value: 1 }
438
+ },
439
+ {
440
+ property: "border-bottom-width",
441
+ value: { type: "unit", unit: "px", value: 1 }
442
+ },
443
+ {
444
+ property: "border-left-width",
445
+ value: { type: "unit", unit: "px", value: 1 }
446
+ }
447
+ ];
448
+ var radio = [
449
+ { property: "font-family", value: { type: "keyword", value: "inherit" } },
450
+ { property: "font-size", value: { type: "unit", unit: "%", value: 100 } },
451
+ {
452
+ property: "line-height",
453
+ value: { type: "unit", unit: "number", value: 1.15 }
454
+ },
455
+ { property: "margin-top", value: { type: "unit", unit: "number", value: 0 } },
456
+ {
457
+ property: "margin-right",
458
+ value: { type: "unit", unit: "number", value: 0 }
459
+ },
460
+ {
461
+ property: "margin-bottom",
462
+ value: { type: "unit", unit: "number", value: 0 }
463
+ },
464
+ {
465
+ property: "margin-left",
466
+ value: { type: "unit", unit: "number", value: 0 }
467
+ },
468
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
469
+ {
470
+ property: "border-top-width",
471
+ value: { type: "unit", unit: "px", value: 1 }
472
+ },
473
+ {
474
+ property: "border-right-width",
475
+ value: { type: "unit", unit: "px", value: 1 }
476
+ },
477
+ {
478
+ property: "border-bottom-width",
479
+ value: { type: "unit", unit: "px", value: 1 }
480
+ },
481
+ {
482
+ property: "border-left-width",
483
+ value: { type: "unit", unit: "px", value: 1 }
484
+ },
485
+ { property: "border-top-style", value: { type: "keyword", value: "none" } },
486
+ { property: "border-right-style", value: { type: "keyword", value: "none" } },
487
+ {
488
+ property: "border-bottom-style",
489
+ value: { type: "keyword", value: "none" }
490
+ },
491
+ { property: "border-left-style", value: { type: "keyword", value: "none" } }
492
+ ];
493
+ var checkbox = radio;
494
+ var button = [
495
+ { property: "font-family", value: { type: "keyword", value: "inherit" } },
496
+ { property: "font-size", value: { type: "unit", unit: "%", value: 100 } },
497
+ {
498
+ property: "line-height",
499
+ value: { type: "unit", unit: "number", value: 1.15 }
500
+ },
501
+ { property: "margin-top", value: { type: "unit", unit: "number", value: 0 } },
502
+ {
503
+ property: "margin-right",
504
+ value: { type: "unit", unit: "number", value: 0 }
505
+ },
506
+ {
507
+ property: "margin-bottom",
508
+ value: { type: "unit", unit: "number", value: 0 }
509
+ },
510
+ {
511
+ property: "margin-left",
512
+ value: { type: "unit", unit: "number", value: 0 }
513
+ },
514
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
515
+ {
516
+ property: "border-top-width",
517
+ value: { type: "unit", unit: "px", value: 1 }
518
+ },
519
+ {
520
+ property: "border-right-width",
521
+ value: { type: "unit", unit: "px", value: 1 }
522
+ },
523
+ {
524
+ property: "border-bottom-width",
525
+ value: { type: "unit", unit: "px", value: 1 }
526
+ },
527
+ {
528
+ property: "border-left-width",
529
+ value: { type: "unit", unit: "px", value: 1 }
530
+ },
531
+ { property: "border-top-style", value: { type: "keyword", value: "solid" } },
532
+ {
533
+ property: "border-right-style",
534
+ value: { type: "keyword", value: "solid" }
535
+ },
536
+ {
537
+ property: "border-bottom-style",
538
+ value: { type: "keyword", value: "solid" }
539
+ },
540
+ { property: "border-left-style", value: { type: "keyword", value: "solid" } },
541
+ { property: "text-transform", value: { type: "keyword", value: "none" } }
542
+ ];
543
+ var select = button;
544
+ var legend = [
545
+ {
546
+ property: "padding-top",
547
+ value: { type: "unit", unit: "number", value: 0 }
548
+ },
549
+ {
550
+ property: "padding-right",
551
+ value: { type: "unit", unit: "number", value: 0 }
552
+ },
553
+ {
554
+ property: "padding-bottom",
555
+ value: { type: "unit", unit: "number", value: 0 }
556
+ },
557
+ {
558
+ property: "padding-left",
559
+ value: { type: "unit", unit: "number", value: 0 }
560
+ },
561
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
562
+ {
563
+ property: "border-top-width",
564
+ value: { type: "unit", unit: "px", value: 1 }
565
+ },
566
+ {
567
+ property: "border-right-width",
568
+ value: { type: "unit", unit: "px", value: 1 }
569
+ },
570
+ {
571
+ property: "border-bottom-width",
572
+ value: { type: "unit", unit: "px", value: 1 }
573
+ },
574
+ {
575
+ property: "border-left-width",
576
+ value: { type: "unit", unit: "px", value: 1 }
577
+ }
578
+ ];
579
+ var progress = [
580
+ { property: "vertical-align", value: { type: "keyword", value: "baseline" } },
581
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
582
+ {
583
+ property: "border-top-width",
584
+ value: { type: "unit", unit: "px", value: 1 }
585
+ },
586
+ {
587
+ property: "border-right-width",
588
+ value: { type: "unit", unit: "px", value: 1 }
589
+ },
590
+ {
591
+ property: "border-bottom-width",
592
+ value: { type: "unit", unit: "px", value: 1 }
593
+ },
594
+ {
595
+ property: "border-left-width",
596
+ value: { type: "unit", unit: "px", value: 1 }
597
+ }
598
+ ];
599
+ var summary = [
600
+ { property: "display", value: { type: "keyword", value: "list-item" } },
601
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
602
+ {
603
+ property: "border-top-width",
604
+ value: { type: "unit", unit: "px", value: 1 }
605
+ },
606
+ {
607
+ property: "border-right-width",
608
+ value: { type: "unit", unit: "px", value: 1 }
609
+ },
610
+ {
611
+ property: "border-bottom-width",
612
+ value: { type: "unit", unit: "px", value: 1 }
613
+ },
614
+ {
615
+ property: "border-left-width",
616
+ value: { type: "unit", unit: "px", value: 1 }
617
+ }
618
+ ];
619
+
620
+ // src/runtime.ts
621
+ var tagProperty = "data-ws-tag";
622
+
623
+ // src/__generated__/tags.ts
624
+ var tags = [
625
+ "div",
626
+ "span",
627
+ "a",
628
+ "abbr",
629
+ "address",
630
+ "area",
631
+ "article",
632
+ "aside",
633
+ "audio",
634
+ "b",
635
+ "bdi",
636
+ "bdo",
637
+ "blockquote",
638
+ "body",
639
+ "br",
640
+ "button",
641
+ "canvas",
642
+ "caption",
643
+ "cite",
644
+ "code",
645
+ "col",
646
+ "colgroup",
647
+ "data",
648
+ "datalist",
649
+ "dd",
650
+ "del",
651
+ "details",
652
+ "dfn",
653
+ "dialog",
654
+ "dl",
655
+ "dt",
656
+ "em",
657
+ "embed",
658
+ "fieldset",
659
+ "figcaption",
660
+ "figure",
661
+ "footer",
662
+ "form",
663
+ "h1",
664
+ "h2",
665
+ "h3",
666
+ "h4",
667
+ "h5",
668
+ "h6",
669
+ "head",
670
+ "header",
671
+ "hgroup",
672
+ "hr",
673
+ "html",
674
+ "i",
675
+ "iframe",
676
+ "img",
677
+ "input",
678
+ "ins",
679
+ "kbd",
680
+ "label",
681
+ "legend",
682
+ "li",
683
+ "main",
684
+ "map",
685
+ "mark",
686
+ "menu",
687
+ "meter",
688
+ "nav",
689
+ "object",
690
+ "ol",
691
+ "optgroup",
692
+ "option",
693
+ "output",
694
+ "p",
695
+ "picture",
696
+ "pre",
697
+ "progress",
698
+ "q",
699
+ "rp",
700
+ "rt",
701
+ "ruby",
702
+ "s",
703
+ "samp",
704
+ "search",
705
+ "section",
706
+ "select",
707
+ "slot",
708
+ "small",
709
+ "source",
710
+ "strong",
711
+ "sub",
712
+ "summary",
713
+ "sup",
714
+ "table",
715
+ "tbody",
716
+ "td",
717
+ "textarea",
718
+ "tfoot",
719
+ "th",
720
+ "thead",
721
+ "time",
722
+ "tr",
723
+ "track",
724
+ "u",
725
+ "ul",
726
+ "var",
727
+ "video",
728
+ "wbr"
729
+ ];
37
730
 
38
731
  // src/core-metas.ts
39
732
  var rootComponent = "ws:root";
40
733
  var rootMeta = {
41
- type: "container",
42
734
  label: "Global Root",
43
735
  icon: SettingsIcon,
44
736
  presetStyle: {
45
737
  html
46
738
  }
47
739
  };
48
- var rootPropsMeta = {
49
- props: {}
740
+ var elementComponent = "ws:element";
741
+ var elementMeta = {
742
+ label: "Element",
743
+ // convert [object Module] to [object Object] to enable structured cloning
744
+ presetStyle: { ...normalize_css_exports },
745
+ initialProps: [tagProperty, "id", "class"],
746
+ props: {
747
+ [tagProperty]: {
748
+ type: "string",
749
+ control: "tag",
750
+ required: true,
751
+ options: tags
752
+ }
753
+ }
50
754
  };
51
755
  var collectionComponent = "ws:collection";
52
756
  var collectionMeta = {
53
- type: "container",
54
757
  label: "Collection",
55
- icon: ListViewIcon
56
- };
57
- var collectionPropsMeta = {
758
+ icon: ListViewIcon,
759
+ contentModel: {
760
+ category: "instance",
761
+ children: ["instance"]
762
+ },
763
+ initialProps: ["data"],
58
764
  props: {
59
765
  data: {
60
766
  required: true,
61
767
  control: "json",
62
768
  type: "json"
63
769
  }
64
- },
65
- initialProps: ["data"]
770
+ }
66
771
  };
67
772
  var descendantComponent = "ws:descendant";
68
773
  var descendantMeta = {
69
- type: "control",
70
774
  label: "Descendant",
71
775
  icon: PaintBrushIcon,
776
+ contentModel: {
777
+ category: "none",
778
+ children: []
779
+ },
72
780
  // @todo infer possible presets
73
781
  presetStyle: {},
74
- constraints: {
75
- relation: "parent",
76
- component: { $in: ["HtmlEmbed", "MarkdownEmbed"] }
77
- }
78
- };
79
- var descendantPropsMeta = {
782
+ initialProps: ["selector"],
80
783
  props: {
81
784
  selector: {
82
785
  required: true,
@@ -101,57 +804,43 @@ var descendantPropsMeta = {
101
804
  " hr"
102
805
  ]
103
806
  }
104
- },
105
- initialProps: ["selector"]
807
+ }
106
808
  };
107
809
  var blockComponent = "ws:block";
108
810
  var blockTemplateComponent = "ws:block-template";
109
811
  var blockTemplateMeta = {
110
- type: "container",
111
812
  icon: AddTemplateInstanceIcon,
112
- constraints: {
113
- relation: "parent",
114
- component: { $eq: blockComponent }
813
+ contentModel: {
814
+ category: "none",
815
+ children: ["instance"]
115
816
  }
116
817
  };
117
- var blockTemplatePropsMeta = {
118
- props: {}
119
- };
120
818
  var blockMeta = {
121
- type: "container",
122
819
  label: "Content Block",
123
820
  icon: ContentBlockIcon,
124
- constraints: [
125
- {
126
- relation: "ancestor",
127
- component: { $nin: [collectionComponent, blockComponent] }
128
- },
129
- {
130
- relation: "child",
131
- component: { $eq: blockTemplateComponent }
132
- }
133
- ]
134
- };
135
- var blockPropsMeta = {
136
- props: {}
821
+ contentModel: {
822
+ category: "instance",
823
+ children: [blockTemplateComponent, "instance"]
824
+ }
137
825
  };
138
826
  var coreMetas = {
139
827
  [rootComponent]: rootMeta,
828
+ [elementComponent]: elementMeta,
140
829
  [collectionComponent]: collectionMeta,
141
830
  [descendantComponent]: descendantMeta,
142
831
  [blockComponent]: blockMeta,
143
832
  [blockTemplateComponent]: blockTemplateMeta
144
833
  };
145
- var corePropsMetas = {
146
- [rootComponent]: rootPropsMeta,
147
- [collectionComponent]: collectionPropsMeta,
148
- [descendantComponent]: descendantPropsMeta,
149
- [blockComponent]: blockPropsMeta,
150
- [blockTemplateComponent]: blockTemplatePropsMeta
151
- };
152
834
 
153
835
  // src/core-templates.tsx
836
+ import { CheckboxCheckedIcon, RadioCheckedIcon } from "@webstudio-is/icons/svg";
154
837
  import { jsx, jsxs } from "react/jsx-runtime";
838
+ var elementMeta2 = {
839
+ category: "general",
840
+ order: 0,
841
+ description: "An HTML element is a core building block for web pages, structuring and displaying content like text, images, and links.",
842
+ template: /* @__PURE__ */ jsx(ws.element, {})
843
+ };
155
844
  var collectionItem = new Parameter("collectionItem");
156
845
  var collectionMeta2 = {
157
846
  category: "data",
@@ -171,16 +860,16 @@ var descendantMeta2 = {
171
860
  };
172
861
  var BlockTemplate = ws["block-template"];
173
862
  var blockMeta2 = {
174
- category: "typography",
863
+ category: "general",
175
864
  template: /* @__PURE__ */ jsxs(ws.block, { children: [
176
865
  /* @__PURE__ */ jsxs(BlockTemplate, { "ws:label": "Templates", children: [
177
866
  /* @__PURE__ */ jsx($.Paragraph, {}),
178
- /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 1", tag: "h1" }),
179
- /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 2", tag: "h2" }),
180
- /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 3", tag: "h3" }),
181
- /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 4", tag: "h4" }),
182
- /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 5", tag: "h5" }),
183
- /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 6", tag: "h6" }),
867
+ /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 1", "ws:tag": "h1" }),
868
+ /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 2", "ws:tag": "h2" }),
869
+ /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 3", "ws:tag": "h3" }),
870
+ /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 4", "ws:tag": "h4" }),
871
+ /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 5", "ws:tag": "h5" }),
872
+ /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 6", "ws:tag": "h6" }),
184
873
  /* @__PURE__ */ jsx($.List, { "ws:label": "List (Unordered)", children: /* @__PURE__ */ jsx($.ListItem, {}) }),
185
874
  /* @__PURE__ */ jsx($.List, { "ws:label": "List (Ordered)", ordered: true, children: /* @__PURE__ */ jsx($.ListItem, {}) }),
186
875
  /* @__PURE__ */ jsx($.Link, {}),
@@ -213,10 +902,225 @@ var blockMeta2 = {
213
902
  ] })
214
903
  ] })
215
904
  };
905
+ var typography = {
906
+ heading: {
907
+ category: "typography",
908
+ description: "Use HTML headings to structure and organize content. Use the Tag property in settings to change the heading level (h1-h6).",
909
+ template: /* @__PURE__ */ jsx(ws.element, { "ws:tag": "h1" })
910
+ },
911
+ paragraph: {
912
+ category: "typography",
913
+ description: "A container for multi-line text.",
914
+ template: /* @__PURE__ */ jsx(ws.element, { "ws:tag": "p" })
915
+ },
916
+ blockquote: {
917
+ category: "typography",
918
+ description: "Use to style a quote from an external source like an article or book.",
919
+ template: /* @__PURE__ */ jsx(
920
+ ws.element,
921
+ {
922
+ "ws:tag": "blockquote",
923
+ "ws:style": css`
924
+ margin-left: 0;
925
+ margin-right: 0;
926
+ padding: 10px 20px;
927
+ border-left: 5px solid rgb(226 226 226 / 1);
928
+ `
929
+ }
930
+ )
931
+ },
932
+ list: {
933
+ category: "typography",
934
+ description: "Groups content, like links in a menu or steps in a recipe.",
935
+ template: /* @__PURE__ */ jsxs(ws.element, { "ws:tag": "ul", children: [
936
+ /* @__PURE__ */ jsx(ws.element, { "ws:tag": "li" }),
937
+ /* @__PURE__ */ jsx(ws.element, { "ws:tag": "li" }),
938
+ /* @__PURE__ */ jsx(ws.element, { "ws:tag": "li" })
939
+ ] })
940
+ },
941
+ list_item: {
942
+ category: "typography",
943
+ description: "Adds a new item to an existing list.",
944
+ template: /* @__PURE__ */ jsx(ws.element, { "ws:tag": "li" })
945
+ },
946
+ code_text: {
947
+ category: "typography",
948
+ template: /* @__PURE__ */ jsx(
949
+ ws.element,
950
+ {
951
+ "ws:tag": "code",
952
+ "ws:style": css`
953
+ display: block;
954
+ white-space-collapse: preserve;
955
+ text-wrap-mode: wrap;
956
+ padding-left: 0.2em;
957
+ padding-right: 0.2em;
958
+ background-color: rgb(238 238 238);
959
+ `
960
+ }
961
+ )
962
+ },
963
+ thematic_break: {
964
+ category: "typography",
965
+ description: "Used to visually divide sections of content, helping to improve readability and organization within a webpage.",
966
+ template: /* @__PURE__ */ jsx(
967
+ ws.element,
968
+ {
969
+ "ws:tag": "hr",
970
+ "ws:style": css`
971
+ color: gray;
972
+ border-style: none none solid;
973
+ `
974
+ }
975
+ )
976
+ }
977
+ };
978
+ var forms = {
979
+ form: {
980
+ category: "forms",
981
+ description: "Create filters, surveys, searches and more.",
982
+ template: /* @__PURE__ */ jsxs(ws.element, { "ws:tag": "form", children: [
983
+ /* @__PURE__ */ jsx(
984
+ ws.element,
985
+ {
986
+ "ws:tag": "input",
987
+ "ws:style": css`
988
+ display: block;
989
+ `
990
+ }
991
+ ),
992
+ /* @__PURE__ */ jsx(ws.element, { "ws:tag": "button", children: new PlaceholderValue("Submit") })
993
+ ] })
994
+ },
995
+ button: {
996
+ category: "forms",
997
+ description: "Use a button to submit forms or trigger actions within a page. Do not use a button to navigate users to another resource or another page - that\u2019s what a link is used for.",
998
+ template: /* @__PURE__ */ jsx(ws.element, { "ws:tag": "button", children: new PlaceholderValue("Button") })
999
+ },
1000
+ input_label: {
1001
+ category: "forms",
1002
+ template: /* @__PURE__ */ jsx(
1003
+ ws.element,
1004
+ {
1005
+ "ws:tag": "label",
1006
+ "ws:style": css`
1007
+ display: block;
1008
+ `,
1009
+ children: new PlaceholderValue("Label")
1010
+ }
1011
+ )
1012
+ },
1013
+ text_input: {
1014
+ category: "forms",
1015
+ description: "A single-line text input for collecting string data from your users.",
1016
+ template: /* @__PURE__ */ jsx(
1017
+ ws.element,
1018
+ {
1019
+ "ws:tag": "input",
1020
+ "ws:style": css`
1021
+ display: block;
1022
+ `
1023
+ }
1024
+ )
1025
+ },
1026
+ text_area: {
1027
+ category: "forms",
1028
+ description: "A multi-line text input for collecting longer string data from your users.",
1029
+ template: /* @__PURE__ */ jsx(
1030
+ ws.element,
1031
+ {
1032
+ "ws:tag": "textarea",
1033
+ "ws:style": css`
1034
+ display: block;
1035
+ `
1036
+ }
1037
+ )
1038
+ },
1039
+ select: {
1040
+ category: "forms",
1041
+ description: "A drop-down menu for users to select a single option from a predefined list.",
1042
+ template: /* @__PURE__ */ jsxs(
1043
+ ws.element,
1044
+ {
1045
+ "ws:tag": "select",
1046
+ "ws:style": css`
1047
+ display: block;
1048
+ `,
1049
+ children: [
1050
+ /* @__PURE__ */ jsx(ws.element, { "ws:tag": "option", label: "Please choose an option", value: "" }),
1051
+ /* @__PURE__ */ jsx(ws.element, { "ws:tag": "option", label: "Option A", value: "a" }),
1052
+ /* @__PURE__ */ jsx(ws.element, { "ws:tag": "option", label: "Option B", value: "b" }),
1053
+ /* @__PURE__ */ jsx(ws.element, { "ws:tag": "option", label: "Option C", value: "c" })
1054
+ ]
1055
+ }
1056
+ )
1057
+ },
1058
+ radio: {
1059
+ category: "forms",
1060
+ description: "Use within a form to allow your users to select a single option from a set of mutually exclusive choices. Group multiple radios by matching their \u201CName\u201D properties.",
1061
+ icon: RadioCheckedIcon,
1062
+ template: /* @__PURE__ */ jsxs(
1063
+ ws.element,
1064
+ {
1065
+ "ws:tag": "label",
1066
+ "ws:label": "Radio Field",
1067
+ "ws:style": css`
1068
+ display: block;
1069
+ `,
1070
+ children: [
1071
+ /* @__PURE__ */ jsx(
1072
+ ws.element,
1073
+ {
1074
+ "ws:tag": "input",
1075
+ "ws:style": css`
1076
+ border-style: none;
1077
+ margin-right: 0.5em;
1078
+ `,
1079
+ type: "radio"
1080
+ }
1081
+ ),
1082
+ /* @__PURE__ */ jsx(ws.element, { "ws:tag": "span", "ws:label": "Radio Label", children: new PlaceholderValue("Radio") })
1083
+ ]
1084
+ }
1085
+ )
1086
+ },
1087
+ checkbox: {
1088
+ category: "forms",
1089
+ description: "Use within a form to allow your users to toggle between checked and not checked. Group checkboxes by matching their \u201CName\u201D properties. Unlike radios, any number of checkboxes in a group can be checked.",
1090
+ icon: CheckboxCheckedIcon,
1091
+ template: /* @__PURE__ */ jsxs(
1092
+ ws.element,
1093
+ {
1094
+ "ws:tag": "label",
1095
+ "ws:label": "Checkbox Field",
1096
+ "ws:style": css`
1097
+ display: block;
1098
+ `,
1099
+ children: [
1100
+ /* @__PURE__ */ jsx(
1101
+ ws.element,
1102
+ {
1103
+ "ws:tag": "input",
1104
+ "ws:style": css`
1105
+ border-style: none;
1106
+ margin-right: 0.5em;
1107
+ `,
1108
+ type: "checkbox"
1109
+ }
1110
+ ),
1111
+ /* @__PURE__ */ jsx(ws.element, { "ws:tag": "span", "ws:label": "Checkbox Label", children: new PlaceholderValue("Checkbox") })
1112
+ ]
1113
+ }
1114
+ )
1115
+ }
1116
+ };
216
1117
  var coreTemplates = {
1118
+ [elementComponent]: elementMeta2,
217
1119
  [collectionComponent]: collectionMeta2,
218
1120
  [descendantComponent]: descendantMeta2,
219
- [blockComponent]: blockMeta2
1121
+ [blockComponent]: blockMeta2,
1122
+ ...typography,
1123
+ ...forms
220
1124
  };
221
1125
  export {
222
1126
  coreTemplates