feat: configura o json html prop

This commit is contained in:
marlon passos 2023-01-20 11:59:33 -03:00
parent 236775c03b
commit b5c8c26aa1
6 changed files with 203 additions and 12 deletions

0
.vscode/schemas/html.json vendored Normal file
View File

168
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,168 @@
{
"json.schemas": [
{
"fileMatch": ["/store/**/*.json", "/store/**/*.jsonc"],
"schema": {
"type": "object",
"title": "html",
"properties": {
"html": {
"type": "object",
"description": "The name of the entry",
"properties": {
"props": {
"properties": {
"tag": {
"enum": [
"section",
"div",
"span",
"p",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"artigle",
"aside",
"details",
"figcaption",
"figure",
"footer",
"header",
"main",
"mark",
"nav",
"summary",
"time",
"wbr",
"address",
"blockquote",
"dd",
"dl",
"dt",
"fieldset",
"hr",
"li",
"ol",
"pre",
"ul"
],
"type": "string",
"description": "Tag HTML que sera usada para renderizar o componente.",
"default": "div"
},
"testId": {
"type": "string",
"description": "Id para ser usado nos testes automatizados"
},
"blockClass": {
"type": ["string", "array"],
"items": {
"type": "string"
},
"description": "classes que serao usadas para estilizar o componente."
},
"text": {
"type": "string",
"description": "Texto para coisas mais simples"
},
"tachyonsClasses": {
"type": "string",
"description": "Classes CSS extras que deseja adicionar.\nFeito para uso de classes do tachyons.\n Nao vai ser possivel usar essas classes para estilizar o componente.\nPara isso, use o props \"blockClass\""
}
}
},
"children": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"patternProperties": {
"^html#": {
"type": "object",
"description": "The name of the entry",
"properties": {
"props": {
"properties": {
"tag": {
"enum": [
"section",
"div",
"span",
"p",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"artigle",
"aside",
"details",
"figcaption",
"figure",
"footer",
"header",
"main",
"mark",
"nav",
"summary",
"time",
"wbr",
"address",
"blockquote",
"dd",
"dl",
"dt",
"fieldset",
"hr",
"li",
"ol",
"pre",
"ul"
],
"type": "string",
"description": "Tag HTML que sera usada para renderizar o componente.",
"default": "div"
},
"testId": {
"type": "string",
"description": "Id para ser usado nos testes automatizados"
},
"blockClass": {
"type": ["string", "array"],
"items": {
"type": "string"
},
"description": "classes que serao usadas para estilizar o componente."
},
"text": {
"type": "string",
"description": "Texto para coisas mais simples"
},
"tachyonsClasses": {
"type": "string",
"description": "Classes CSS extras que deseja adicionar.\nFeito para uso de classes do tachyons.\n Nao vai ser possivel usar essas classes para estilizar o componente.\nPara isso, use o props \"blockClass\""
}
}
},
"children": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
]
}

View File

@ -1,6 +1,9 @@
{
"footer": {
"blocks": ["footer-layout.desktop", "footer-layout.mobile"]
"blocks": [
"footer-layout.desktop",
"footer-layout.mobile"
]
},
"footer-layout.desktop": {
"children": [
@ -24,7 +27,6 @@
"paddingBottom": 3
}
},
"social-networks": {
"props": {
"socialNetworks": [
@ -47,21 +49,27 @@
]
}
},
"flex-layout.row#footer-2-desktop": {
"children": ["accepted-payment-methods"],
"children": [
"accepted-payment-methods"
],
"props": {
"blockClass": "payment-methods"
}
},
"accepted-payment-methods": {
"props": {
"paymentMethods": ["MasterCard", "Visa", "Diners Club"]
"paymentMethods": [
"MasterCard",
"Visa",
"Diners Club"
]
}
},
"flex-layout.row#footer-3-desktop": {
"children": ["rich-text#footer"],
"children": [
"rich-text#footer"
],
"props": {
"blockClass": "credits"
}
@ -72,7 +80,6 @@
"blockClass": "footer"
}
},
"footer-layout.mobile": {
"children": [
"flex-layout.row#1-footer-mobile",
@ -80,7 +87,9 @@
]
},
"flex-layout.row#2-footer-mobile": {
"children": ["flex-layout.col#footer-1-mobile"],
"children": [
"flex-layout.col#footer-1-mobile"
],
"props": {
"blockClass": "payment-methods",
"paddingTop": 4,
@ -105,7 +114,9 @@
"paddingTop": 4,
"paddingBottom": 4
},
"children": ["vtex.menu@2.x:menu#footer-mobile"]
"children": [
"vtex.menu@2.x:menu#footer-mobile"
]
},
"rich-text#footer-mobile": {
"props": {

View File

@ -8,6 +8,9 @@
},
"children": ["flex-layout.row#product-gifts-text", "product-gift-list"]
},
"html": {
"children": []
},
"flex-layout.row#product-gifts-text": {
"props": {

View File

@ -1,7 +1,7 @@
{
"store.product": {
"children": [
"flex-layout.row#product-breadcrumb",
"html#breadcrumb",
"image#example",
"condition-layout.product#availability",
"flex-layout.row#description",
@ -36,6 +36,14 @@
},
"children": ["breadcrumb"]
},
"html#breadcrumb": {
"props": {
"tag": "section",
"testId": "a1"
},
"children": ["breadcrumb"]
},
"flex-layout.row#description": {
"props": {
"marginBottom": 7

View File

@ -3,6 +3,7 @@
"component": "Example"
},
"html": {
"component": "html"
"component": "html",
"composition": "children"
}
}