Skip to content

Commit d07cbe5

Browse files
using correct way to generate component-*.json files for UE
1 parent 9f9a8ca commit d07cbe5

File tree

7 files changed

+80
-19
lines changed

7 files changed

+80
-19
lines changed

component-definition.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
"da": {
128128
"name": "columns-row",
129129
"behaviour": "columns-row"
130-
}
130+
}
131131
}
132132
},
133133
{

component-models.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
},
5858
{
5959
"component": "select",
60-
"name": "background-color",
60+
"name": "data-background-color",
6161
"value": "",
6262
"label": "Background Color",
6363
"valueType": "string",
@@ -177,7 +177,7 @@
177177
"component": "text",
178178
"name": "root[data-text-color-t]",
179179
"value": "",
180-
"label": "Try direct data attribute 2",
180+
"label": "Try direct data attribute 3",
181181
"valueType": "string"
182182
}
183183
]
@@ -319,4 +319,4 @@
319319
}
320320
]
321321
}
322-
]
322+
]

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
"eslint": "8.57.0",
2929
"eslint-config-airbnb-base": "15.0.0",
3030
"eslint-plugin-import": "2.29.1",
31-
"stylelint": "16.7.0",
32-
"stylelint-config-standard": "36.0.1",
3331
"husky": "^9.1.7",
3432
"merge-json-cli": "^1.0.4",
35-
"npm-run-all": "^4.1.5"
33+
"npm-run-all": "^4.1.5",
34+
"stylelint": "16.7.0",
35+
"stylelint-config-standard": "36.0.1"
3636
}
3737
}

ue/models/blocks/columns.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"id": "columns-cell",
2828
"plugins": {
2929
"da": {
30-
"unsafeHTML": "<div></div>",
30+
"unsafeHTML": "<div data-background-color=\"placeholder\"></div>",
3131
"behaviour": "columns-cell"
3232
}
3333
}
@@ -47,6 +47,27 @@
4747
"numberMin": 1,
4848
"numberMax": 6
4949
}
50+
},
51+
{
52+
"component": "text",
53+
"name": "div:nth-child(1)[data-background-color]",
54+
"value": "",
55+
"label": "Background Color",
56+
"valueType": "string"
57+
},
58+
{
59+
"component": "text",
60+
"name": "div:nth-child(1)[data-text-color]",
61+
"value": "",
62+
"label": "Text Color",
63+
"valueType": "string"
64+
},
65+
{
66+
"component": "text",
67+
"name": "root[data-text-color-t]",
68+
"value": "",
69+
"label": "Try direct data attribute 3",
70+
"valueType": "string"
5071
}
5172
]
5273
}

ue/models/blocks/hero.json

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"id": "hero",
66
"plugins": {
77
"da": {
8-
"unsafeHTML": "<div class=\"hero\"><div><div><picture><source type=\"image/webp\" srcset=\"\"><source type=\"image/jpeg\" srcset=\"\"><img loading=\"lazy\"></picture><h1></h1></div></div></div>"
8+
"unsafeHTML": "<div class=\"hero\"><div><div><picture><source type=\"image/webp\" srcset=\"\"><source type=\"image/jpeg\" srcset=\"\"><img loading=\"lazy\"></picture><div></div></div></div></div>"
99
}
1010
}
1111
}
@@ -29,17 +29,10 @@
2929
"value": ""
3030
},
3131
{
32-
"component": "text",
33-
"name": "div:nth-child(1)>div:nth-child(1)>h1:nth-child(2)",
34-
"value": "",
35-
"label": "Text",
36-
"valueType": "string"
37-
},
38-
{
39-
"component": "text",
40-
"name": "div:nth-child(1)>div:nth-child(1)>p:nth-child(3)",
32+
"component": "richtext",
33+
"name": "div:nth-child(1)>div:nth-child(1)>div:nth-child(2)",
4134
"value": "",
42-
"label": "CTA Text",
35+
"label": "Text and CTA",
4336
"valueType": "string"
4437
}
4538
]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"definitions": [
3+
{
4+
"title": "Product Carousel",
5+
"id": "product-carousel",
6+
"plugins": {
7+
"da": {
8+
"unsafeHTML": "<div class=\"product-carousel\"></div>"
9+
}
10+
}
11+
}
12+
],
13+
"models": [
14+
{
15+
"id": "product-carousel",
16+
"fields": [
17+
{
18+
"component": "text",
19+
"name": "div:nth-child(1)>div:nth-child(1)>p:nth-child(1)>a:nth-child(1)[href]",
20+
"value": "",
21+
"label": "JSON Spreadsheet URL",
22+
"valueType": "string"
23+
}
24+
]
25+
}
26+
],
27+
"filters": []
28+
}
29+

ue/models/section.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,23 @@
2626
"value": "highlight"
2727
}
2828
]
29+
},
30+
{
31+
"component": "select",
32+
"name": "data-background-color",
33+
"value": "",
34+
"label": "Background Color",
35+
"valueType": "string",
36+
"options": [
37+
{
38+
"name": "Black",
39+
"value": "black"
40+
},
41+
{
42+
"name": "White",
43+
"value": "white"
44+
}
45+
]
2946
}
3047
]
3148
}
@@ -43,6 +60,7 @@
4360
"form",
4461
"hero",
4562
"image",
63+
"product-carousel",
4664
"quote",
4765
"search",
4866
"tabs",

0 commit comments

Comments
 (0)