refactor(product.jsonc): organizando código do jsonc

This commit is contained in:
Ana Carolina Duarte Cavalcante 2023-02-02 14:15:56 -03:00
parent f45182dd4f
commit 48659e392d

View File

@ -12,70 +12,9 @@
"product-questions-and-answers" "product-questions-and-answers"
] ]
}, },
//
"html#slider-block-container": { //Breadcrumb
"children": [
"rich-text#slider-block-title",
"html#list-context.product-list#slider-block"
]
},
"rich-text#slider-block-title": {
"props": {
"text": "### Você também pode gostar:",
"blockClass": "slider-title"
}
},
"product-summary.shelf#slider-block": {
"children": ["html#product-summary.shelf#product-content"]
},
"html#product-summary.shelf#product-content": {
"props": {
"testId": "vtex-product-summary"
},
"children": [
"product-summary-image#slider-images",
"product-summary-name",
// "product-summary-space",
"product-summary-price"
]
},
"product-summary-image#slider-images": {
"props": {
"blockClass": "product-summary-image",
"showBadge": false,
"aspectRatio": "1:1"
// "maxHeight": 300
}
},
"list-context.product-list#slider-block": {
"blocks": ["product-summary.shelf#slider-block"],
"children": ["html#slider-layout#products-carousel"]
},
"html#list-context.product-list#slider-block": {
"props": {
"testId": "product-summary-list"
},
"children": ["list-context.product-list#slider-block"]
},
"html#slider-layout#products-carousel": {
"props": {
"testId": "product-summary-list"
},
"children": ["slider-layout#products-carousel"]
},
"slider-layout#products-carousel": {
"props": {
"itemsPerPage": {
"desktop": 4,
"tablet": 3,
"phone": 2
},
"infinite": true,
"showNavigationArrows": "always",
"blockClass": "carousel"
}
},
"html#breadcrumb": { "html#breadcrumb": {
"props": { "props": {
"tag": "section", "tag": "section",
@ -85,6 +24,8 @@
"children": ["breadcrumb"] "children": ["breadcrumb"]
}, },
//Availability
"condition-layout.product#availability": { "condition-layout.product#availability": {
"props": { "props": {
"conditions": [ "conditions": [
@ -103,6 +44,14 @@
"children": ["html#flex-layout.col#stack", "html#right-col"] "children": ["html#flex-layout.col#stack", "html#right-col"]
}, },
"html#flex-layout.col#stack": {
"children": ["stack-layout"],
"props": {
"blockClass": "stack-layout-content",
"rowGap": 0
}
},
"stack-layout": { "stack-layout": {
"props": { "props": {
"blockClass": "product" "blockClass": "product"
@ -123,124 +72,40 @@
} }
}, },
"html#flex-layout.col#stack": { "html#product-availability": {
"children": ["stack-layout"],
"props": { "props": {
"blockClass": "stack-layout-content", "blockClass": "product-availability-block"
"rowGap": 0
}
},
"html#flex-layout.row#product-image": {
"props": {
"testId": "product-images"
}, },
"children": ["product-images"] "children": ["html#flex-layout.col#stack", "html#right-col-availability"]
}, },
"product-images": {
"html#right-col-availability": {
"props": { "props": {
"aspectRatio": { "preventVerticalStretch": true,
"desktop": "auto", "rowGap": 0,
"phone": "16:9" "blockClass": "info-availability"
}, },
"displayThumbnailsArrows": false,
"showPaginationDots": false,
"thumbnailsOrientation": "horizontal"
}
},
"product-images#description-content": {
"props": {
"displayMode": "first-image",
"zoomMode": "disable",
"blockClass": "image-description"
}
},
"tab-layout#description": {
"children": ["tab-list#description", "tab-content#description"],
"props": {
"blockClass": "description-block",
"defaultActiveTabId": "firstTab"
}
},
"tab-list#description": {
"children": [ "children": [
"tab-list.item#firstTab", "html#identification-product-availability",
"tab-list.item#secondTab", "flex-layout.row#availability",
"tab-list.item#thirdTab", "html#sku-selector"
"tab-list.item#fourthTab",
"tab-list.item#fifthTab"
] ]
}, },
"tab-list.item#firstTab": {
"html#identification-product-availability": {
"props": { "props": {
"tabId": "firstTab", "blockClass": "identification-product-availability"
"label": "Descrição", },
"defaultActiveTab": true "children": ["html#product-name", "product-identifier.product"]
}
}, },
"tab-list.item#secondTab": {
"flex-layout.row#availability": {
"props": { "props": {
"tabId": "secondTab", "blockClass": "message-availability"
"label": "Descrição" },
} "children": ["availability-subscriber"]
}, },
"tab-list.item#thirdTab": {
"props": {
"tabId": "thirdTab",
"label": "Descrição"
}
},
"tab-list.item#fourthTab": {
"props": {
"tabId": "fourthTab",
"label": "Descrição"
}
},
"tab-list.item#fifthTab": {
"props": {
"tabId": "fifthTab",
"label": "Descrição"
}
},
"tab-content#description": {
"children": [
"tab-content.item#firstTab",
"tab-content.item#secondTab",
"tab-content.item#thirdTab",
"tab-content.item#fourthTab",
"tab-content.item#fifthTab"
]
},
"tab-content.item#firstTab": {
"children": ["product-images#description-content", "product-description"],
"props": {
"tabId": "firstTab"
}
},
"tab-content.item#secondTab": {
"children": ["product-images#description-content", "product-description"],
"props": {
"tabId": "secondTab"
}
},
"tab-content.item#thirdTab": {
"children": ["product-images#description-content", "product-description"],
"props": {
"tabId": "thirdTab"
}
},
"tab-content.item#fourthTab": {
"children": ["product-images#description-content", "product-description"],
"props": {
"tabId": "fourthTab"
}
},
"tab-content.item#fifthTab": {
"children": ["product-images#description-content", "product-description"],
"props": {
"tabId": "fifthTab"
}
},
//
"html#right-col": { "html#right-col": {
"props": { "props": {
"preventVerticalStretch": true, "preventVerticalStretch": true,
@ -258,43 +123,21 @@
"html#cart-content", "html#cart-content",
// "product-assembly-options", // "product-assembly-options",
"product-gifts", "product-gifts",
// "flex-layout.row#buy-button", // "flex-layout.row#add-to-cart-button",
"availability-subscriber", "availability-subscriber",
"shipping-simulator", "shipping-simulator",
"placeholder-component" "placeholder-component"
// "share#default" // "share#default"
] ]
}, },
"html#identification-product": { "html#identification-product": {
"props": { "props": {
"blockClass": "identification-product-content" "blockClass": "identification-product-content"
}, },
"children": ["html#product-name", "product-identifier.product"] "children": ["html#product-name", "product-identifier.product"]
}, },
"html#cart-content": {
"props": {
"blockClass": "cart-content"
},
"children": ["html#product-quantity", "html#flex-layout.row#buy-button"]
},
"html#product-quantity": {
"props": {
"testId": "product-quantity"
},
"children": ["product-quantity"]
},
"html#flex-layout.row#buy-button": {
"props": {
"testId": "add-to-cart-button"
},
"children": ["flex-layout.row#buy-button"]
},
"html#pix-component": {
"props": {
"testId": "pix-price"
},
"children": ["pix-component"]
},
"html#product-name": { "html#product-name": {
"props": { "props": {
"marginBottom": 3 "marginBottom": 3
@ -302,12 +145,20 @@
"children": ["vtex.store-components:product-name"] "children": ["vtex.store-components:product-name"]
}, },
"html#pix-component": {
"props": {
"testId": "pix-price"
},
"children": ["pix-component"]
},
"html#sku-selector": { "html#sku-selector": {
"props": { "props": {
"testId": "sku-selector" "testId": "sku-selector"
}, },
"children": ["sku-selector"] "children": ["sku-selector"]
}, },
"sku-selector": { "sku-selector": {
"props": { "props": {
"variationsSpacing": 3, "variationsSpacing": 3,
@ -316,7 +167,27 @@
} }
}, },
"flex-layout.row#buy-button": { "html#cart-content": {
"props": {
"blockClass": "cart-content"
},
"children": ["html#product-quantity", "html#add-to-cart-button"]
},
"html#product-quantity": {
"props": {
"testId": "product-quantity"
},
"children": ["product-quantity"]
},
"html#add-to-cart-button": {
"props": {
"testId": "add-to-cart-button"
},
"children": ["flex-layout.row#add-to-cart-button"]
},
"flex-layout.row#add-to-cart-button": {
"props": { "props": {
"marginTop": 4, "marginTop": 4,
"marginBottom": 7 "marginBottom": 7
@ -324,45 +195,217 @@
"children": ["add-to-cart-button"] "children": ["add-to-cart-button"]
}, },
"html#product-availability": { //Slider
"props": {
"blockClass": "product-availability-block" "html#slider-block-container": {
},
"children": ["html#flex-layout.col#stack", "html#right-col-availability"]
},
"html#right-col-availability": {
"props": {
"preventVerticalStretch": true,
"rowGap": 0,
"blockClass": "info-availability"
},
"children": [ "children": [
"html#identification-product-availability", "rich-text#slider-block-title",
"flex-layout.row#availability", "html#list-context.product-list#slider-block"
"html#sku-selector"
] ]
}, },
"html#identification-product-availability": {
"rich-text#slider-block-title": {
"props": { "props": {
"blockClass": "identification-product-availability" "text": "### Você também pode gostar:",
}, "blockClass": "slider-title"
"children": ["html#product-name", "product-identifier.product"] }
},
"flex-layout.row#availability": {
"props": {
"blockClass": "message-availability"
},
"children": ["availability-subscriber"]
}, },
"share#default": { "product-summary.shelf#slider-block": {
"children": ["html#product-summary.shelf#product-content"]
},
"html#product-summary.shelf#product-content": {
"props": { "props": {
"social": { "testId": "vtex-product-summary"
"Facebook": true, },
"WhatsApp": true, "children": [
"Twitter": false, "product-summary-image#slider-images",
"Pinterest": true "product-summary-name",
} // "product-summary-space",
"product-summary-price"
]
},
"product-summary-image#slider-images": {
"props": {
"blockClass": "product-summary-image",
"showBadge": false,
"aspectRatio": "1:1"
// "maxHeight": 300
}
},
"list-context.product-list#slider-block": {
"blocks": ["product-summary.shelf#slider-block"],
"children": ["html#slider-layout#products-carousel"]
},
"html#list-context.product-list#slider-block": {
"props": {
"testId": "product-summary-list"
},
"children": ["list-context.product-list#slider-block"]
},
"html#slider-layout#products-carousel": {
"props": {
"testId": "product-summary-list"
},
"children": ["slider-layout#products-carousel"]
},
"slider-layout#products-carousel": {
"props": {
"itemsPerPage": {
"desktop": 4,
"tablet": 3,
"phone": 2
},
"infinite": true,
"showNavigationArrows": "always",
"blockClass": "carousel"
}
},
//Product Images
"html#flex-layout.row#product-image": {
"props": {
"testId": "product-images"
},
"children": ["product-images"]
},
"product-images": {
"props": {
"aspectRatio": {
"desktop": "auto",
"phone": "16:9"
},
"displayThumbnailsArrows": false,
"showPaginationDots": false,
"thumbnailsOrientation": "horizontal"
}
},
// Tab-Layout
"product-images#description-content": {
"props": {
"displayMode": "first-image",
"zoomMode": "disabled",
"blockClass": "image-description"
}
},
"tab-layout#description": {
"children": ["tab-list#description", "tab-content#description"],
"props": {
"blockClass": "description-block",
"defaultActiveTabId": "firstTab"
}
},
"tab-list#description": {
"children": [
"tab-list.item#firstTab",
"tab-list.item#secondTab",
"tab-list.item#thirdTab",
"tab-list.item#fourthTab",
"tab-list.item#fifthTab"
]
},
"tab-list.item#firstTab": {
"props": {
"tabId": "firstTab",
"label": "Descrição",
"defaultActiveTab": true
}
},
"tab-list.item#secondTab": {
"props": {
"tabId": "secondTab",
"label": "Descrição"
}
},
"tab-list.item#thirdTab": {
"props": {
"tabId": "thirdTab",
"label": "Descrição"
}
},
"tab-list.item#fourthTab": {
"props": {
"tabId": "fourthTab",
"label": "Descrição"
}
},
"tab-list.item#fifthTab": {
"props": {
"tabId": "fifthTab",
"label": "Descrição"
}
},
"tab-content#description": {
"children": [
"tab-content.item#firstTab",
"tab-content.item#secondTab",
"tab-content.item#thirdTab",
"tab-content.item#fourthTab",
"tab-content.item#fifthTab"
]
},
"tab-content.item#firstTab": {
"children": ["product-images#description-content", "product-description"],
"props": {
"tabId": "firstTab"
}
},
"tab-content.item#secondTab": {
"children": ["product-images#description-content", "product-description"],
"props": {
"tabId": "secondTab"
}
},
"tab-content.item#thirdTab": {
"children": ["product-images#description-content", "product-description"],
"props": {
"tabId": "thirdTab"
}
},
"tab-content.item#fourthTab": {
"children": ["product-images#description-content", "product-description"],
"props": {
"tabId": "fourthTab"
}
},
"tab-content.item#fifthTab": {
"children": ["product-images#description-content", "product-description"],
"props": {
"tabId": "fifthTab"
} }
} }
// "share#default": {
// "props": {
// "social": {
// "Facebook": true,
// "WhatsApp": true,
// "Twitter": false,
// "Pinterest": true
// }
// }
// }
} }