@usethrottle/builder-schema 0.1.0 → 0.1.2

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 (24) hide show
  1. package/__tests__/fixtures/parity/01-hero-boxed.json +68 -0
  2. package/__tests__/fixtures/parity/02-full-bleed-image-hero.json +61 -0
  3. package/__tests__/fixtures/parity/03-two-columns-50-50.json +66 -0
  4. package/__tests__/fixtures/parity/04-three-columns-phone-widths.json +87 -0
  5. package/__tests__/fixtures/parity/05-four-columns-tablet-two-by-two.json +108 -0
  6. package/__tests__/fixtures/parity/06-inner-section-in-column.json +101 -0
  7. package/__tests__/fixtures/parity/07-hidden-on-phone.json +47 -0
  8. package/__tests__/fixtures/parity/08-device-specific-text-and-size.json +46 -0
  9. package/__tests__/fixtures/parity/09-every-basic-widget.json +100 -0
  10. package/__tests__/fixtures/parity/10-header-part.json +87 -0
  11. package/__tests__/fixtures/parity/11-footer-part.json +105 -0
  12. package/__tests__/fixtures/parity/12-announcement-bar.json +34 -0
  13. package/__tests__/fixtures/parity/13-product-slot-context.json +69 -0
  14. package/__tests__/fixtures/parity/14-published-snapshot-with-assets-and-custom-widget.json +84 -0
  15. package/__tests__/fixtures/parity/15-empty-document.json +4 -0
  16. package/__tests__/fixtures/parity/16-product-grid-and-featured.json +140 -0
  17. package/__tests__/fixtures/parity/17-collection-shelf-and-categories.json +153 -0
  18. package/__tests__/fixtures/parity/18-search-switches-and-greeting.json +80 -0
  19. package/__tests__/fixtures/parity/19-shop-slot-context.json +42 -0
  20. package/dist/index.cjs +240 -225
  21. package/dist/index.d.cts +9 -1
  22. package/dist/index.d.ts +9 -1
  23. package/dist/index.js +240 -225
  24. package/package.json +8 -3
@@ -0,0 +1,87 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "sections": [
4
+ {
5
+ "id": "s0000074",
6
+ "type": "section",
7
+ "props": {
8
+ "paddingY": "s",
9
+ "width": "full"
10
+ },
11
+ "columns": [
12
+ {
13
+ "id": "c0000068",
14
+ "type": "column",
15
+ "props": {
16
+ "width": 20
17
+ },
18
+ "children": [
19
+ {
20
+ "id": "w0000067",
21
+ "type": "basic.logo",
22
+ "v": 1,
23
+ "props": {
24
+ "height": 36
25
+ }
26
+ }
27
+ ],
28
+ "responsive": {
29
+ "phone": {
30
+ "width": 50
31
+ }
32
+ }
33
+ },
34
+ {
35
+ "id": "c0000070",
36
+ "type": "column",
37
+ "props": {
38
+ "width": 60
39
+ },
40
+ "children": [
41
+ {
42
+ "id": "w0000069",
43
+ "type": "basic.menu",
44
+ "v": 1,
45
+ "props": {
46
+ "menu": "header",
47
+ "layout": "drawer-on-phone",
48
+ "align": "center"
49
+ }
50
+ }
51
+ ],
52
+ "responsive": {
53
+ "phone": {
54
+ "width": 25
55
+ }
56
+ }
57
+ },
58
+ {
59
+ "id": "c0000073",
60
+ "type": "column",
61
+ "props": {
62
+ "width": 20
63
+ },
64
+ "children": [
65
+ {
66
+ "id": "w0000071",
67
+ "type": "commerce.account-button",
68
+ "v": 1,
69
+ "props": {}
70
+ },
71
+ {
72
+ "id": "w0000072",
73
+ "type": "catalog.cart-button",
74
+ "v": 1,
75
+ "props": {}
76
+ }
77
+ ],
78
+ "responsive": {
79
+ "phone": {
80
+ "width": 25
81
+ }
82
+ }
83
+ }
84
+ ]
85
+ }
86
+ ]
87
+ }
@@ -0,0 +1,105 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "sections": [
4
+ {
5
+ "id": "s0000082",
6
+ "type": "section",
7
+ "props": {
8
+ "paddingY": "xl",
9
+ "background": {
10
+ "color": "token:surface"
11
+ }
12
+ },
13
+ "columns": [
14
+ {
15
+ "id": "c0000077",
16
+ "type": "column",
17
+ "props": {
18
+ "width": 50
19
+ },
20
+ "children": [
21
+ {
22
+ "id": "w0000075",
23
+ "type": "basic.logo",
24
+ "v": 1,
25
+ "props": {}
26
+ },
27
+ {
28
+ "id": "w0000076",
29
+ "type": "basic.text",
30
+ "v": 1,
31
+ "props": {
32
+ "html": {
33
+ "en": "<p>Hello from the footer.</p>"
34
+ }
35
+ }
36
+ }
37
+ ]
38
+ },
39
+ {
40
+ "id": "c0000079",
41
+ "type": "column",
42
+ "props": {
43
+ "width": 25
44
+ },
45
+ "children": [
46
+ {
47
+ "id": "w0000078",
48
+ "type": "basic.menu",
49
+ "v": 1,
50
+ "props": {
51
+ "menu": "footer",
52
+ "layout": "vertical"
53
+ }
54
+ }
55
+ ]
56
+ },
57
+ {
58
+ "id": "c0000081",
59
+ "type": "column",
60
+ "props": {
61
+ "width": 25
62
+ },
63
+ "children": [
64
+ {
65
+ "id": "w0000080",
66
+ "type": "basic.menu",
67
+ "v": 1,
68
+ "props": {
69
+ "menu": "help",
70
+ "layout": "vertical"
71
+ }
72
+ }
73
+ ]
74
+ }
75
+ ]
76
+ },
77
+ {
78
+ "id": "s0000085",
79
+ "type": "section",
80
+ "props": {
81
+ "paddingY": "s"
82
+ },
83
+ "columns": [
84
+ {
85
+ "id": "c0000084",
86
+ "type": "column",
87
+ "props": {
88
+ "width": 100
89
+ },
90
+ "children": [
91
+ {
92
+ "id": "w0000083",
93
+ "type": "basic.copyright",
94
+ "v": 1,
95
+ "props": {
96
+ "align": "center",
97
+ "size": "s"
98
+ }
99
+ }
100
+ ]
101
+ }
102
+ ]
103
+ }
104
+ ]
105
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "sections": [
4
+ {
5
+ "id": "s0000088",
6
+ "type": "section",
7
+ "props": {
8
+ "width": "full",
9
+ "paddingY": "xs"
10
+ },
11
+ "columns": [
12
+ {
13
+ "id": "c0000087",
14
+ "type": "column",
15
+ "props": {
16
+ "width": 100
17
+ },
18
+ "children": [
19
+ {
20
+ "id": "w0000086",
21
+ "type": "basic.announcement",
22
+ "v": 1,
23
+ "props": {
24
+ "dismissible": true,
25
+ "background": "token:primary",
26
+ "color": "token:primary-foreground"
27
+ }
28
+ }
29
+ ]
30
+ }
31
+ ]
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,69 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "sections": [
4
+ {
5
+ "id": "s0000092",
6
+ "type": "section",
7
+ "props": {
8
+ "paddingY": "l"
9
+ },
10
+ "columns": [
11
+ {
12
+ "id": "c0000091",
13
+ "type": "column",
14
+ "props": {
15
+ "width": 100
16
+ },
17
+ "children": [
18
+ {
19
+ "id": "w0000089",
20
+ "type": "catalog.product-carousel",
21
+ "v": 1,
22
+ "props": {
23
+ "title": {
24
+ "en": "You may also like"
25
+ }
26
+ },
27
+ "data": {
28
+ "products": {
29
+ "source": "catalog.products",
30
+ "params": {
31
+ "source": "newest",
32
+ "limit": 6
33
+ }
34
+ }
35
+ }
36
+ },
37
+ {
38
+ "id": "w0000090",
39
+ "type": "catalog.reviews-list",
40
+ "v": 1,
41
+ "props": {},
42
+ "data": {
43
+ "reviews": {
44
+ "source": "catalog.reviews",
45
+ "params": {
46
+ "limit": 3
47
+ }
48
+ }
49
+ }
50
+ },
51
+ {
52
+ "id": "w0000097",
53
+ "type": "catalog.featured-product",
54
+ "v": 1,
55
+ "props": {
56
+ "layout": "image-right"
57
+ },
58
+ "data": {
59
+ "product": {
60
+ "source": "context.product"
61
+ }
62
+ }
63
+ }
64
+ ]
65
+ }
66
+ ]
67
+ }
68
+ ]
69
+ }
@@ -0,0 +1,84 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "sections": [
4
+ {
5
+ "id": "s0000096",
6
+ "type": "section",
7
+ "props": {},
8
+ "columns": [
9
+ {
10
+ "id": "c0000095",
11
+ "type": "column",
12
+ "props": {
13
+ "width": 100
14
+ },
15
+ "children": [
16
+ {
17
+ "id": "w0000093",
18
+ "type": "basic.image",
19
+ "v": 1,
20
+ "props": {
21
+ "image": "asset04",
22
+ "alt": {
23
+ "en": "Logo wall"
24
+ }
25
+ }
26
+ },
27
+ {
28
+ "id": "w0000094",
29
+ "type": "custom.badge-row",
30
+ "v": 1,
31
+ "props": {
32
+ "label": {
33
+ "en": "Free shipping"
34
+ }
35
+ }
36
+ }
37
+ ]
38
+ }
39
+ ]
40
+ }
41
+ ],
42
+ "assets": {
43
+ "asset04": {
44
+ "url": "https://media.example.com/a/asset04.jpg",
45
+ "width": 1600,
46
+ "height": 900,
47
+ "variants": [
48
+ {
49
+ "width": 640,
50
+ "url": "https://media.example.com/a/asset04-640.jpg"
51
+ },
52
+ {
53
+ "width": 1280,
54
+ "url": "https://media.example.com/a/asset04-1280.jpg"
55
+ }
56
+ ]
57
+ }
58
+ },
59
+ "customWidgets": {
60
+ "custom.badge-row@1": {
61
+ "kind": "template",
62
+ "type": "custom.badge-row",
63
+ "v": 1,
64
+ "title": "Badge row",
65
+ "description": "A row of badges.",
66
+ "icon": "tag",
67
+ "group": "custom",
68
+ "settings": [
69
+ {
70
+ "key": "label",
71
+ "label": "Label",
72
+ "tab": "content",
73
+ "output": "markup",
74
+ "control": "text",
75
+ "translatable": true,
76
+ "default": {
77
+ "en": "Badge"
78
+ }
79
+ }
80
+ ],
81
+ "template": "<div class=\"badge\">{{ settings.label }}</div>"
82
+ }
83
+ }
84
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "sections": []
4
+ }
@@ -0,0 +1,140 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "sections": [
4
+ {
5
+ "id": "s0000103",
6
+ "type": "section",
7
+ "props": {
8
+ "paddingY": "l"
9
+ },
10
+ "columns": [
11
+ {
12
+ "id": "c0000102",
13
+ "type": "column",
14
+ "props": {
15
+ "width": 100
16
+ },
17
+ "children": [
18
+ {
19
+ "id": "w0000100",
20
+ "type": "basic.heading",
21
+ "v": 1,
22
+ "props": {
23
+ "text": {
24
+ "en": "Product grid"
25
+ },
26
+ "level": "h2"
27
+ }
28
+ },
29
+ {
30
+ "id": "w0000101",
31
+ "type": "catalog.product-grid",
32
+ "v": 1,
33
+ "props": {
34
+ "columnsDesktop": 4,
35
+ "columnsMobile": 2,
36
+ "cardVariant": "standard",
37
+ "cardMeta": "brand"
38
+ },
39
+ "data": {
40
+ "products": {
41
+ "source": "catalog.products",
42
+ "params": {
43
+ "source": "newest",
44
+ "limit": 8
45
+ }
46
+ }
47
+ }
48
+ }
49
+ ]
50
+ }
51
+ ]
52
+ },
53
+ {
54
+ "id": "s0000106",
55
+ "type": "section",
56
+ "props": {
57
+ "paddingY": "m"
58
+ },
59
+ "columns": [
60
+ {
61
+ "id": "c0000105",
62
+ "type": "column",
63
+ "props": {
64
+ "width": 100
65
+ },
66
+ "children": [
67
+ {
68
+ "id": "w0000104",
69
+ "type": "catalog.product-grid",
70
+ "v": 1,
71
+ "props": {
72
+ "columnsDesktop": 3,
73
+ "columnsMobile": 1,
74
+ "cardVariant": "minimal",
75
+ "cardMeta": "category"
76
+ },
77
+ "data": {
78
+ "products": {
79
+ "source": "catalog.products",
80
+ "params": {
81
+ "source": "best_rated",
82
+ "limit": 6
83
+ }
84
+ }
85
+ }
86
+ }
87
+ ]
88
+ }
89
+ ]
90
+ },
91
+ {
92
+ "id": "s0000110",
93
+ "type": "section",
94
+ "props": {
95
+ "paddingY": "l"
96
+ },
97
+ "columns": [
98
+ {
99
+ "id": "c0000109",
100
+ "type": "column",
101
+ "props": {
102
+ "width": 100
103
+ },
104
+ "children": [
105
+ {
106
+ "id": "w0000107",
107
+ "type": "catalog.featured-product",
108
+ "v": 1,
109
+ "props": {
110
+ "layout": "image-left",
111
+ "showDescription": true
112
+ },
113
+ "data": {
114
+ "product": {
115
+ "source": "catalog.product",
116
+ "params": {}
117
+ }
118
+ }
119
+ },
120
+ {
121
+ "id": "w0000108",
122
+ "type": "catalog.featured-product",
123
+ "v": 1,
124
+ "props": {
125
+ "layout": "stacked",
126
+ "showDescription": false
127
+ },
128
+ "data": {
129
+ "product": {
130
+ "source": "catalog.product",
131
+ "params": {}
132
+ }
133
+ }
134
+ }
135
+ ]
136
+ }
137
+ ]
138
+ }
139
+ ]
140
+ }
@@ -0,0 +1,153 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "sections": [
4
+ {
5
+ "id": "s0000113",
6
+ "type": "section",
7
+ "props": {
8
+ "paddingY": "l"
9
+ },
10
+ "columns": [
11
+ {
12
+ "id": "c0000112",
13
+ "type": "column",
14
+ "props": {
15
+ "width": 100
16
+ },
17
+ "children": [
18
+ {
19
+ "id": "w0000111",
20
+ "type": "catalog.collection-shelf",
21
+ "v": 1,
22
+ "props": {
23
+ "eyebrow": {
24
+ "en": "Shop"
25
+ },
26
+ "title": {
27
+ "en": "Featured collection"
28
+ },
29
+ "layout": "grid",
30
+ "columnsDesktop": 4,
31
+ "columnsMobile": 2,
32
+ "showViewAll": true,
33
+ "cardVariant": "overlay",
34
+ "cardMeta": "brand"
35
+ },
36
+ "data": {
37
+ "collection": {
38
+ "source": "catalog.collection",
39
+ "params": {
40
+ "limit": 4
41
+ }
42
+ }
43
+ }
44
+ }
45
+ ]
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "id": "s0000116",
51
+ "type": "section",
52
+ "props": {
53
+ "paddingY": "m"
54
+ },
55
+ "columns": [
56
+ {
57
+ "id": "c0000115",
58
+ "type": "column",
59
+ "props": {
60
+ "width": 100
61
+ },
62
+ "children": [
63
+ {
64
+ "id": "w0000114",
65
+ "type": "catalog.collection-shelf",
66
+ "v": 1,
67
+ "props": {
68
+ "title": {
69
+ "en": "Slide through"
70
+ },
71
+ "layout": "carousel",
72
+ "showViewAll": false,
73
+ "cardVariant": "row",
74
+ "cardMeta": "category"
75
+ },
76
+ "data": {
77
+ "collection": {
78
+ "source": "catalog.collection",
79
+ "params": {
80
+ "limit": 8
81
+ }
82
+ }
83
+ }
84
+ }
85
+ ]
86
+ }
87
+ ]
88
+ },
89
+ {
90
+ "id": "s0000121",
91
+ "type": "section",
92
+ "props": {
93
+ "paddingY": "l"
94
+ },
95
+ "columns": [
96
+ {
97
+ "id": "c0000118",
98
+ "type": "column",
99
+ "props": {
100
+ "width": 50
101
+ },
102
+ "children": [
103
+ {
104
+ "id": "w0000117",
105
+ "type": "catalog.category-list",
106
+ "v": 1,
107
+ "props": {
108
+ "layout": "grid",
109
+ "showCounts": true,
110
+ "showImages": true
111
+ },
112
+ "data": {
113
+ "categories": {
114
+ "source": "catalog.categories",
115
+ "params": {
116
+ "depth": 1
117
+ }
118
+ }
119
+ }
120
+ }
121
+ ]
122
+ },
123
+ {
124
+ "id": "c0000120",
125
+ "type": "column",
126
+ "props": {
127
+ "width": 50
128
+ },
129
+ "children": [
130
+ {
131
+ "id": "w0000119",
132
+ "type": "catalog.category-list",
133
+ "v": 1,
134
+ "props": {
135
+ "layout": "list",
136
+ "showCounts": false,
137
+ "showImages": false
138
+ },
139
+ "data": {
140
+ "categories": {
141
+ "source": "catalog.categories",
142
+ "params": {
143
+ "depth": 2
144
+ }
145
+ }
146
+ }
147
+ }
148
+ ]
149
+ }
150
+ ]
151
+ }
152
+ ]
153
+ }