id
stringlengths 12
53
| messages
listlengths 3
3
|
|---|---|
code_product-comparison_d48d2f46
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/messages/hu.json from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"editor.countdown.title\": \"Visszaszámlálás\",\n \"editor.countdown.description\": \"Visszaszámlálás komponens\",\n \"admin/editor.comparison-grid.title\": \"Összehasonlító Rács\",\n \"admin/editor.comparison-grid.description\": \"Termék összehasonlító rács sorának információinak gyűjtése\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.title\": \"Termékspecifikációk elrejtése\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.description\": \"Azoknak a termékspecifikációknak a neve, amelyeket el kell rejteni az összehasonlító oldalon (vesszővel válassza el őket ,)\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.title\": \"SKU specifikációk elrejtése\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.description\": \"Azoknak az SKU specifikációknak a neve, amelyeket el kell rejteni az összehasonlító oldalon (vesszővel válassza el őket ,)\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.title\": \"Termékmezők elrejtése\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.description\": \"Azok a termékmezők, amelyeket el kell rejteni az összehasonlító oldalon (vesszővel válassza el őket ,)\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.title\": \"SKU mezők elrejtése\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.description\": \"Azok az SKU mezők, amelyeket el kell rejteni az összehasonlító oldalon (vesszővel válassza el őket ,)\",\n \"admin/editor.comparison-grid-row.title\": \"Összehasonlító Rács Sor\",\n \"admin/editor.comparison-grid-row.description\": \"Sor meta adatok a rács számára\",\n \"admin/editor.comparison-grid-row.field.title\": \"Mező\",\n \"admin/editor.comparison-grid-row.field.description\": \"Ez a mező, amelyet hozzá kell adni az összehasonlító részletes oldalhoz\",\n \"admin/editor.comparison-grid-row.field.fieldType.title\": \"Mező típusa\",\n \"admin/editor.comparison-grid-row.field.fieldType.description\": \"A sor mezőjének típusa\",\n \"admin/editor.comparison-grid-row.field.name.title\": \"Mező neve\",\n \"admin/editor.comparison-grid-row.field.name.description\": \"Az összehasonlítási mező neve (termékmező neve, termék specifikáció neve vagy SKU specifikáció neve)\",\n \"admin/editor.comparison-grid-row.field.display-value.title\": \"Megjelenítési név\",\n \"admin/editor.comparison-grid-row.field.display-value.description\": \"A mező megjelenített neve az összehasonlító oldalon\",\n \"admin/editor.comparison-grid-row.styles.title\": \"Cella stílusok\",\n \"admin/editor.comparison-grid-row.styles.width.title\": \"Szélesség\",\n \"admin/editor.comparison-grid-row.styles.width.description\": \"A cella szélessége százalékban\",\n \"admin/editor.comparison-grid.titleText.title\": \"Cím\",\n \"store/product-comparison.product-selector.product\": \"Termék:\",\n \"store/product-comparison.product-selector.product-added\": \"hasonlításhoz hozzáadva\",\n \"store/product-comparison.product-selector.product-removed\": \"hasonlításból eltávolítva\",\n \"store/product-comparison.product-selector.compare\": \"Hasonlítás\",\n \"store/product-comparison.drawer.products\": \"{productsLength, plural, one {termék} other {termékek}}\",\n \"store/product-comparison.drawer.compare\": \"Hasonlítás\",\n \"store/product-comparison.drawer.remove-all-message\": \"Az összes termék eltávolítva az összehasonlításból\",\n \"store/product-comparison.drawer.remove-all\": \"Minden eltávolítása\",\n \"store/product-comparison.drawer.hide\": \"elrejt\",\n \"store/product-comparison.drawer.show\": \"megjelenít\",\n \"store/product-comparison.drawer.min-items-message\": \"Legalább két terméket hozzá kell adnia az összehasonlításhoz\",\n \"store/product-comparison.drawer.max-items-message-1\": \"Egyszerre legfeljebb\",\n \"store/product-comparison.drawer.max-items-message-2\": \"terméket lehet összehasonlítani\",\n \"store/product-comparison.main-page.back-to-products\": \"Vissza a termékek listájához\",\n \"store/product-comparison.main-page.sort-by\": \"Rendezés szerint\",\n \"store/product-comparison.main-page.order-added\": \"Hozzáadási sorrend\",\n \"store/product-comparison.main-page.title\": \"{productsLength, number} termék összehasonlítása\",\n \"store/product-comparison.product-summary-row.show-differences\": \"Csak különbségek mutatása\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.title\": \"Termék Specifikáció Csoport elrejtése\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.description\": \"Azoknak a termék specifikáció csoportoknak a neve, amelyeket el kell rejteni az összehasonlító oldalon (vesszővel válassza el őket ,)\",\n \"store/product-comparison.product-selector.upper-limit-exceeded\": \"Ezt az elemet nem lehet hozzáadni az összehasonlításhoz, a kosár mérete túllépve\"\n}\n\n```"
}
] |
code_product-comparison_5be390a6
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/messages/de.json from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"editor.countdown.title\": \"Countdown\",\n \"editor.countdown.description\": \"Countdown-Komponente\",\n \"admin/editor.comparison-grid.title\": \"Vergleichstabelle\",\n \"admin/editor.comparison-grid.description\": \"Spalteninformationen der Vergleichstabelle\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.title\": \"Versteckte Spezifikationen\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.description\": \"Komma-separierte Liste der zu versteckenden Spezifikationsnamen\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.title\": \"Versteckte SKU-Spezifikationen\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.description\": \"Kommagetrennte Liste der auszublendenden SKU-Spezifikationsnamen\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.title\": \"Versteckte Produktfelder\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.description\": \"Komma-separierte Liste der zu versteckenden Produktfelder\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.title\": \"Versteckte SKU-Felder\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.description\": \"Komma-separierte Liste der zu versteckenden SKU-Felder\",\n \"admin/editor.comparison-grid-row.title\": \"Zeile der Vergleichstabelle\",\n \"admin/editor.comparison-grid-row.description\": \"Zeilen-Metainformationen der Vergleichstabelle\",\n \"admin/editor.comparison-grid-row.field.title\": \"Feld\",\n \"admin/editor.comparison-grid-row.field.description\": \"Dieses Feld wird für die Vergleichsdetailseite benötigt\",\n \"admin/editor.comparison-grid-row.field.fieldType.title\": \"Feldtyp\",\n \"admin/editor.comparison-grid-row.field.fieldType.description\": \"Feldtyp der Zeile\",\n \"admin/editor.comparison-grid-row.field.name.title\": \"Feldname\",\n \"admin/editor.comparison-grid-row.field.name.description\": \"Name des Vergleichsfeldes (Produktfeldname, Spezifikationsname oder SKU-Spezifikationsname)\",\n \"admin/editor.comparison-grid-row.field.display-value.title\": \"Angezeigter Name\",\n \"admin/editor.comparison-grid-row.field.display-value.description\": \"Der anzuzeigende Name des Feldes auf der Vergleichsseite\",\n \"admin/editor.comparison-grid-row.styles.title\": \"Zellen-Stil\",\n \"admin/editor.comparison-grid-row.styles.width.title\": \"Breite\",\n \"admin/editor.comparison-grid-row.styles.width.description\": \"Zellenbreite in Prozent\",\n \"admin/editor.comparison-grid.titleText.title\": \"Titel\",\n \"store/product-comparison.product-selector.product\": \"Produkt:\",\n \"store/product-comparison.product-selector.product-added\": \"Zum Vergleich hinzugefügt\",\n \"store/product-comparison.product-selector.product-removed\": \"Vom Vergleich entfernt\",\n \"store/product-comparison.product-selector.compare\": \"Vergleichen\",\n \"store/product-comparison.drawer.products\": \"{productsLength, plural, one {Produkt} other {Produkte}}\",\n \"store/product-comparison.drawer.compare\": \"Vergleichen\",\n \"store/product-comparison.drawer.remove-all-message\": \"Alle Produkte entfernt\",\n \"store/product-comparison.drawer.remove-all\": \"Alle entfernen\",\n \"store/product-comparison.drawer.hide\": \"Verstecken\",\n \"store/product-comparison.drawer.show\": \"Anzeigen\",\n \"store/product-comparison.drawer.min-items-message\": \"Mindestens 2 Produkte zum Vergleichen hinzufügen\",\n \"store/product-comparison.drawer.max-items-message-1\": \"Es können bis zu\",\n \"store/product-comparison.drawer.max-items-message-2\": \"Produkte auf einmal miteinander verglichen werden\",\n \"store/product-comparison.main-page.back-to-products\": \"Zurück zur Ergebnisseite\",\n \"store/product-comparison.main-page.sort-by\": \"Sortieren nach\",\n \"store/product-comparison.main-page.order-added\": \"Sortierung hinzugefügt\",\n \"store/product-comparison.main-page.title\": \"{productsLength, number} {productsLength, plural, one {Produkt} other {Produkte}} vergleichen\",\n \"store/product-comparison.product-summary-row.show-differences\": \"Nur Unterschiede anzeigen\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.title\": \"Versteckte Spezifikationsgruppen\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.description\": \"Komma-separierte Liste der zu versteckenden Spezifikationsgruppennamen\",\n \"store/product-comparison.product-selector.upper-limit-exceeded\": \"Produkt kann nicht verglichen werden. Maximale Anzahl erreicht\"\n}\n\n```"
}
] |
code_product-comparison_04c914b1
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/messages/ru.json from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"editor.countdown.title\": \"Обратный отсчет\",\n \"editor.countdown.description\": \"Компонент обратного отсчета\",\n \"admin/editor.comparison-grid.title\": \"Сравнительная таблица\",\n \"admin/editor.comparison-grid.description\": \"Информация со строк сравнительной таблицы продукта\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.title\": \"Скрыть спецификации продукта\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.description\": \"Названия спецификаций продукта, которые должны быть скрыты на сравнительной странице (отделяются запятой «,»)\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.title\": \"Скрыть спецификации артикула\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.description\": \"Названия спецификаций артикула, которые должны быть скрыты на сравнительной странице (отделяются запятой «,»)\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.title\": \"Скрыть поля продукта\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.description\": \"Поля продукта, которые должны быть скрыты на сравнительной странице (отделяются запятой «,»)\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.title\": \"Скрыть поля артикула\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.description\": \"Поля артикула, которые должны быть скрыты на сравнительной странице (отделяются запятой «,»)\",\n \"admin/editor.comparison-grid-row.title\": \"Строка сравнительной таблицы\",\n \"admin/editor.comparison-grid-row.description\": \"Метаданные строки для таблицы\",\n \"admin/editor.comparison-grid-row.field.title\": \"Поле\",\n \"admin/editor.comparison-grid-row.field.description\": \"Это поле, которое нам нужно добавить на страницу сравнения\",\n \"admin/editor.comparison-grid-row.field.fieldType.title\": \"Тип поля\",\n \"admin/editor.comparison-grid-row.field.fieldType.description\": \"Тип поля строки\",\n \"admin/editor.comparison-grid-row.field.name.title\": \"Название поля\",\n \"admin/editor.comparison-grid-row.field.name.description\": \"Название поля сравнения (название поля продукта, название спецификаций продукта или артикула)\",\n \"admin/editor.comparison-grid-row.field.display-value.title\": \"Отображаемое имя\",\n \"admin/editor.comparison-grid-row.field.display-value.description\": \"Отображаемое имя поля на сравнительной странице\",\n \"admin/editor.comparison-grid-row.styles.title\": \"Стили ячеек\",\n \"admin/editor.comparison-grid-row.styles.width.title\": \"Ширина\",\n \"admin/editor.comparison-grid-row.styles.width.description\": \"Ширина ячейки в процентах\",\n \"admin/editor.comparison-grid.titleText.title\": \"Название\",\n \"store/product-comparison.product-selector.product\": \"Товар:\",\n \"store/product-comparison.product-selector.product-added\": \"добавлено к сравнению\",\n \"store/product-comparison.product-selector.product-removed\": \"удалено из сравнения\",\n \"store/product-comparison.product-selector.compare\": \"Сравнить\",\n \"store/product-comparison.drawer.products\": \"{productsLength, plural, one {товар} few {товара} many {товаров} other {товаров}}\",\n \"store/product-comparison.drawer.compare\": \"Сравнить\",\n \"store/product-comparison.drawer.remove-all-message\": \"Все товары удалены из сравнения\",\n \"store/product-comparison.drawer.remove-all\": \"Удалить все\",\n \"store/product-comparison.drawer.hide\": \"скрыть\",\n \"store/product-comparison.drawer.show\": \"показать\",\n \"store/product-comparison.drawer.min-items-message\": \"Необходимо добавить хотя бы два товара для сравнения\",\n \"store/product-comparison.drawer.max-items-message-1\": \"Можно сравнивать до\",\n \"store/product-comparison.drawer.max-items-message-2\": \"товаров одновременно\",\n \"store/product-comparison.main-page.back-to-products\": \"Вернуться к списку товаров\",\n \"store/product-comparison.main-page.sort-by\": \"Сортировать по\",\n \"store/product-comparison.main-page.order-added\": \"По порядку добавления\",\n \"store/product-comparison.main-page.title\": \"Сравнить {productsLength, number} {productsLength, plural, one {товар} few {товара} many {товаров} other {товаров}}\",\n \"store/product-comparison.product-summary-row.show-differences\": \"Показывать только различия\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.title\": \"Скрыть группу спецификаций товара\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.description\": \"Названия групп спецификаций товара, которые должны быть скрыты на сравнительной странице (отделяются запятой «,»)\",\n \"store/product-comparison.product-selector.upper-limit-exceeded\": \"Невозможно добавить этот товар в сравнение из-за превышения размера корзины\"\n}\n\n```"
}
] |
code_product-comparison_c01e5d3a
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/messages/pt.json from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"editor.countdown.title\": \"Contagem regressiva\",\n \"editor.countdown.description\": \"Componente de contagem regressiva\",\n \"admin/editor.comparison-grid.title\": \"Grade de comparação\",\n \"admin/editor.comparison-grid.description\": \"Informações sobre a compilação de linhas da grade de comparação de produtos\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.title\": \"Ocultar especificações do produto\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.description\": \"Nomes das especificações de produto que precisam ser ocultadas na página de comparação (separe-as por vírgula `,`)\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.title\": \"Ocultar especificações de SKU\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.description\": \"Nomes das especificações de SKU que precisam ser ocultadas na página de comparação (separe-as por vírgula `,`)\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.title\": \"Ocultar campos do produto\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.description\": \"Campos do produto que precisam ser ocultados na página de comparação (separe-os por vírgula `,`)\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.title\": \"Ocultar campos do SKU\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.description\": \"Campos do SKU que precisam ser ocultados na página de comparação (separe-os por vírgula `,`)\",\n \"admin/editor.comparison-grid-row.title\": \"Linha da grade de comparação\",\n \"admin/editor.comparison-grid-row.description\": \"Metadados de fila para grade\",\n \"admin/editor.comparison-grid-row.field.title\": \"Campo\",\n \"admin/editor.comparison-grid-row.field.description\": \"Este é o campo que precisamos adicionar à página de detalhes de comparação\",\n \"admin/editor.comparison-grid-row.field.fieldType.title\": \"Tipo de campo\",\n \"admin/editor.comparison-grid-row.field.fieldType.description\": \"Tipo de campo da linha\",\n \"admin/editor.comparison-grid-row.field.name.title\": \"Nome do campo\",\n \"admin/editor.comparison-grid-row.field.name.description\": \"Nome do campo de comparação (nome do campo do produto, nome da especificação do produto ou especificação do SKU)\",\n \"admin/editor.comparison-grid-row.field.display-value.title\": \"Nome de exibição\",\n \"admin/editor.comparison-grid-row.field.display-value.description\": \"Nome de exibição do campo na página de comparação\",\n \"admin/editor.comparison-grid-row.styles.title\": \"Estilos das células\",\n \"admin/editor.comparison-grid-row.styles.width.title\": \"Largura\",\n \"admin/editor.comparison-grid-row.styles.width.description\": \"Largura da célula em porcentagem\",\n \"admin/editor.comparison-grid.titleText.title\": \"Título\",\n \"store/product-comparison.product-selector.product\": \"Produto:\",\n \"store/product-comparison.product-selector.product-added\": \"adicionado à comparação\",\n \"store/product-comparison.product-selector.product-removed\": \"removido da comparação\",\n \"store/product-comparison.product-selector.compare\": \"Comparar\",\n \"store/product-comparison.drawer.products\": \"{productsLength, plural, one {produto} other {produtos}}\",\n \"store/product-comparison.drawer.compare\": \"Comparar\",\n \"store/product-comparison.drawer.remove-all-message\": \"Todos os produtos foram removidos da comparação\",\n \"store/product-comparison.drawer.remove-all\": \"Remover todos\",\n \"store/product-comparison.drawer.hide\": \"ocultar\",\n \"store/product-comparison.drawer.show\": \"exibir\",\n \"store/product-comparison.drawer.min-items-message\": \"Você precisa adicionar pelo menos dois produtos fazer uma comparação\",\n \"store/product-comparison.drawer.max-items-message-1\": \"Você pode comparar até\",\n \"store/product-comparison.drawer.max-items-message-2\": \"produtos por vez\",\n \"store/product-comparison.main-page.back-to-products\": \"Voltar para a lista de produtos\",\n \"store/product-comparison.main-page.sort-by\": \"Ordenar por\",\n \"store/product-comparison.main-page.order-added\": \"Pedido adicionado\",\n \"store/product-comparison.main-page.title\": \"Сomparar {productsLength, number} {productsLength, plural, one {produto} other {produtos}}\",\n \"store/product-comparison.product-summary-row.show-differences\": \"Exibir somente diferenças\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.title\": \"Ocultar grupo de especificações do produto\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.description\": \"Nomes dos grupos de especificação do produto que serão ocultados na página de comparação (separe-os por vírgula `,`)\",\n \"store/product-comparison.product-selector.upper-limit-exceeded\": \"Não é possível adicionar este item à comparação. Tamanho de bucket excedido.\"\n}\n```"
}
] |
code_product-comparison_fa70bea8
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/messages/en.json from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"editor.countdown.title\": \"Countdown\",\n \"editor.countdown.description\": \"Countdown component\",\n \"admin/editor.comparison-grid.title\": \"Comparison Grid\",\n \"admin/editor.comparison-grid.description\": \"Product Comparison Grid Row Collect information\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.title\": \"Hide Product Specifications\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.description\": \"Names of product specifications which needs to be hidden in comparison page (separate them by comma `,`)\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.title\": \"Hide SKU Specifications\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.description\": \"Names of sku specifications which needs to be hidden in comparison page (separate them by comma `,`)\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.title\": \"Hide product fields\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.description\": \"Product fields which needs to be hidden in comparison page (separate them by comma `,`)\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.title\": \"Hide sku fields\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.description\": \"Sku fields which needs to be hidden in comparison page (separate them by comma `,`)\",\n \"admin/editor.comparison-grid-row.title\": \"Comparison Grid Row\",\n \"admin/editor.comparison-grid-row.description\": \"Row meta data for grid\",\n \"admin/editor.comparison-grid-row.field.title\": \"Field\",\n \"admin/editor.comparison-grid-row.field.description\": \"This is the field we need to add to comparison detail page\",\n \"admin/editor.comparison-grid-row.field.fieldType.title\": \"Field type\",\n \"admin/editor.comparison-grid-row.field.fieldType.description\": \"Field type of the row\",\n \"admin/editor.comparison-grid-row.field.name.title\": \"Field Name\",\n \"admin/editor.comparison-grid-row.field.name.description\": \"Comparison field name (name of the product field, name of product specification or sku specification)\",\n \"admin/editor.comparison-grid-row.field.display-value.title\": \"Display Name\",\n \"admin/editor.comparison-grid-row.field.display-value.description\": \"Display name of the field in comparison page\",\n \"admin/editor.comparison-grid-row.styles.title\": \"Cell styles\",\n \"admin/editor.comparison-grid-row.styles.width.title\": \"Width\",\n \"admin/editor.comparison-grid-row.styles.width.description\": \"Width of the cell as a percentage\",\n \"admin/editor.comparison-grid.titleText.title\": \"Title\",\n \"store/product-comparison.product-selector.product\": \"Product:\",\n \"store/product-comparison.product-selector.product-added\": \"added to compare\",\n \"store/product-comparison.product-selector.product-removed\": \"removed from compare\",\n \"store/product-comparison.product-selector.compare\": \"Compare\",\n \"store/product-comparison.drawer.products\": \"{productsLength, plural, one {product} other {products}}\",\n \"store/product-comparison.drawer.compare\": \"Compare\",\n \"store/product-comparison.drawer.remove-all-message\": \"All products removed from comparison\",\n \"store/product-comparison.drawer.remove-all\": \"Remove All\",\n \"store/product-comparison.drawer.hide\": \"hide\",\n \"store/product-comparison.drawer.show\": \"show\",\n \"store/product-comparison.drawer.min-items-message\": \"You need to add at least two products to compare\",\n \"store/product-comparison.drawer.max-items-message-1\": \"You can compare up to\",\n \"store/product-comparison.drawer.max-items-message-2\": \"products at a time\",\n \"store/product-comparison.main-page.back-to-products\": \"Back to products list\",\n \"store/product-comparison.main-page.sort-by\": \"Sort by\",\n \"store/product-comparison.main-page.order-added\": \"Order added\",\n \"store/product-comparison.main-page.title\": \"Сompare {productsLength, number} {productsLength, plural, one {product} other {products}}\",\n \"store/product-comparison.product-summary-row.show-differences\": \"Show only differences\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.title\": \"Hide Product Specification Group\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.description\": \"Names of product specification groups which needs to be hidden in comparison page (separate them by comma `,`)\",\n \"store/product-comparison.product-selector.upper-limit-exceeded\": \"Can't add this item to compare, bucket size exceeded\"\n}\n\n```"
}
] |
code_product-comparison_e724fab8
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/messages/it.json from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"editor.countdown.title\": \"Conto alla rovescia\",\n \"editor.countdown.description\": \"Componente del conto alla rovescia\",\n \"admin/editor.comparison-grid.title\": \"Griglia di confronto\",\n \"admin/editor.comparison-grid.description\": \"Riga della griglia di confronto per raccogliere informazioni\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.title\": \"Nascondi specifiche del prodotto\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.description\": \"Nomi delle specifiche del prodotto che verranno nascosti nella pagina di confronto (vanno separati con una virgola ',')\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.title\": \"Nascondi specifiche dello SKU\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.description\": \"Nomi delle specifiche dello SKU che verranno nascosti nella pagina di confronto (vanno separati con una virgola ',')\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.title\": \"Nascondi campi del prodotto\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.description\": \"Campi del prodotto che verranno nascosti nella pagina di confronto (vanno separati con una virgola ',')\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.title\": \"Nascondi campi dello SKU\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.description\": \"Campi dello SKU che verranno nascosti nella pagina di confronto (vanno separati con una virgola ',')\",\n \"admin/editor.comparison-grid-row.title\": \"Riga della griglia di confronto\",\n \"admin/editor.comparison-grid-row.description\": \"Riga della griglia di confronto per i metadati\",\n \"admin/editor.comparison-grid-row.field.title\": \"Campo\",\n \"admin/editor.comparison-grid-row.field.description\": \"Questo è il campo che è necessario aggiungere alla pagina dei dettagli di confronto\",\n \"admin/editor.comparison-grid-row.field.fieldType.title\": \"Tipo di campo\",\n \"admin/editor.comparison-grid-row.field.fieldType.description\": \"Tipo di campo della riga\",\n \"admin/editor.comparison-grid-row.field.name.title\": \"Nome del campo\",\n \"admin/editor.comparison-grid-row.field.name.description\": \"Nome del campo di confronto (nome del campo del prodotto, nome della specifica del prodotto o della specifica dello SKU)\",\n \"admin/editor.comparison-grid-row.field.display-value.title\": \"Mostra nome\",\n \"admin/editor.comparison-grid-row.field.display-value.description\": \"Mostra il nome del campo nella pagina di confronto\",\n \"admin/editor.comparison-grid-row.styles.title\": \"Stili delle celle\",\n \"admin/editor.comparison-grid-row.styles.width.title\": \"Larghezza\",\n \"admin/editor.comparison-grid-row.styles.width.description\": \"Larghezza della cella in percentuale\",\n \"admin/editor.comparison-grid.titleText.title\": \"Titolo\",\n \"store/product-comparison.product-selector.product\": \"Prodotto:\",\n \"store/product-comparison.product-selector.product-added\": \"aggiunto al confronto\",\n \"store/product-comparison.product-selector.product-removed\": \"rimosso dal confronto\",\n \"store/product-comparison.product-selector.compare\": \"Confronta\",\n \"store/product-comparison.drawer.products\": \"Prodotti\",\n \"store/product-comparison.drawer.compare\": \"Confronta\",\n \"store/product-comparison.drawer.remove-all-message\": \"Tutti i prodotti sono stati rimossi dal confronto\",\n \"store/product-comparison.drawer.remove-all\": \"Rimuovi tutti\",\n \"store/product-comparison.drawer.hide\": \"nascondi\",\n \"store/product-comparison.drawer.show\": \"mostra\",\n \"store/product-comparison.drawer.min-items-message\": \"Devi aggiungere almeno due prodotti per fare un confronto\",\n \"store/product-comparison.drawer.max-items-message-1\": \"Puoi confrontare fino a\",\n \"store/product-comparison.drawer.max-items-message-2\": \"prodotti alla volta\",\n \"store/product-comparison.main-page.back-to-products\": \"Torna all'elenco dei prodotti\",\n \"store/product-comparison.main-page.sort-by\": \"Ordina per\",\n \"store/product-comparison.main-page.order-added\": \"Ordine aggiunto\",\n \"store/product-comparison.main-page.title\": \"Confronta {productsLength} prodotti\",\n \"store/product-comparison.product-summary-row.show-differences\": \"Mostra solo le differenze\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.title\": \"Nascondi gruppo di specifiche del prodotto\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.description\": \"Nomi dei gruppi di specifiche del prodotto che verranno nascosti nella pagina di confronto (vanno separati con una virgola ',')\",\n \"store/product-comparison.product-selector.upper-limit-exceeded\": \"Impossibile aggiungere questo elemento al confronto, dimensione del bucket superata\"\n}\n```"
}
] |
code_product-comparison_50687987
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/messages/fr.json from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"editor.countdown.title\": \"Compte à rebours\",\n \"editor.countdown.description\": \"Composant Compte à Rebours\",\n \"admin/editor.comparison-grid.title\": \"Grille de comparaison\",\n \"admin/editor.comparison-grid.description\": \"Informations sur la collecte des lignes de la grille de comparaison de produits\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.title\": \"Cacher les caractéristiques du produit\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.description\": \"Noms des spécifications du produit qui doivent être cachés dans la page de comparaison (séparez-les par virgule `,`)\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.title\": \"Masquer les caractéristiques SKU\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.description\": \"Noms des spécifications SKU qui doivent être cachées dans la page de comparaison (séparez-les par des virgules `,`)\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.title\": \"Masquer les champs de produit\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.description\": \"Champs de produit qui doivent être cachés dans la page de comparaison (séparez-les par une virgule `,`)\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.title\": \"Masquer les champs SKU\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.description\": \"Champs SKU qui doivent être cachés dans la page de comparaison (séparez-les par une virgule `,`)\",\n \"admin/editor.comparison-grid-row.title\": \"Ligne de grille de comparaison\",\n \"admin/editor.comparison-grid-row.description\": \"Méta données de la ligne pour la grille\",\n \"admin/editor.comparison-grid-row.field.title\": \"Champ\",\n \"admin/editor.comparison-grid-row.field.description\": \"Champ que nous devons ajouter à la page de détail de la comparaison\",\n \"admin/editor.comparison-grid-row.field.fieldType.title\": \"Type de champ\",\n \"admin/editor.comparison-grid-row.field.fieldType.description\": \"Type de champ de la ligne\",\n \"admin/editor.comparison-grid-row.field.name.title\": \"Nom du champ\",\n \"admin/editor.comparison-grid-row.field.name.description\": \"Nom du champ de comparaison (nom du champ produit, nom de la spécification du produit ou spécification SKU)\",\n \"admin/editor.comparison-grid-row.field.display-value.title\": \"Afficher le nom\",\n \"admin/editor.comparison-grid-row.field.display-value.description\": \"Afficher le nom du champ dans la page de comparaison\",\n \"admin/editor.comparison-grid-row.styles.title\": \"Les styles de cellule\",\n \"admin/editor.comparison-grid-row.styles.width.title\": \"Largeur\",\n \"admin/editor.comparison-grid-row.styles.width.description\": \"Largeur de la cellule en pourcentage\",\n \"admin/editor.comparison-grid.titleText.title\": \"Titre\",\n \"store/product-comparison.product-selector.product\": \"Produit :\",\n \"store/product-comparison.product-selector.product-added\": \"ajouté à la comparaison\",\n \"store/product-comparison.product-selector.product-removed\": \"supprimé de la comparaison\",\n \"store/product-comparison.product-selector.compare\": \"Comparer\",\n \"store/product-comparison.drawer.products\": \"{productsLength, plural, one {product} other {products}}\",\n \"store/product-comparison.drawer.compare\": \"Comparer\",\n \"store/product-comparison.drawer.remove-all-message\": \"Tous les produits retirés de la comparaison\",\n \"store/product-comparison.drawer.remove-all\": \"Tout supprimer\",\n \"store/product-comparison.drawer.hide\": \"masquer\",\n \"store/product-comparison.drawer.show\": \"afficher\",\n \"store/product-comparison.drawer.min-items-message\": \"Vous devez ajouter au moins deux produits à comparer\",\n \"store/product-comparison.drawer.max-items-message-1\": \"Vous pouvez comparer jusqu’à\",\n \"store/product-comparison.drawer.max-items-message-2\": \"produits à la fois\",\n \"store/product-comparison.main-page.back-to-products\": \"Retour à la liste des produits\",\n \"store/product-comparison.main-page.sort-by\": \"Trier par\",\n \"store/product-comparison.main-page.order-added\": \"Commande ajoutée\",\n \"store/product-comparison.main-page.title\": \"Сomparer {productsLength, number} {productsLength, plural, one {product} other {products}}\",\n \"store/product-comparison.product-summary-row.show-differences\": \"Afficher uniquement les différences\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.title\": \"Cacher le groupe de caractéristiques de produits\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.description\": \"Noms des groupes de caractéristiques de produits qui doivent être cachés dans la page de comparaison (séparez-les par virgule `,`)\",\n \"store/product-comparison.product-selector.upper-limit-exceeded\": \"Impossible d’ajouter cet élément à la comparaison, la taille du segment est trop élevée\"\n}\n\n```"
}
] |
code_product-comparison_85218f10
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/messages/context.json from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"admin/editor.product-summary-row.title\": \"Comparison row\",\n \"admin/editor.product-summary-row.description\": \"\",\n \"editor.countdown.title\": \"Countdown\",\n \"editor.countdown.description\": \"Countdown component\",\n \"admin/editor.comparison-grid.title\": \"Comparison Grid\",\n \"admin/editor.comparison-grid.description\": \"Product Comparison Grid Row Collect information\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.title\": \"Hide Product Specifications\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.description\": \"Names of product specifications which needs to be hidden in comparison page (separate them by comma `,`)\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.title\": \"Hide SKU Specifications\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.description\": \"Names of sku specifications which needs to be hidden in comparison page (separate them by comma `,`)\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.title\": \"Hide product fields\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.description\": \"Product fields which needs to be hidden in comparison page (separate them by comma `,`)\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.title\": \"Hide sku fields\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.description\": \"Sku fields which needs to be hidden in comparison page (separate them by comma `,`)\",\n \"admin/editor.comparison-grid-row.title\": \"Comparison Grid Row\",\n \"admin/editor.comparison-grid-row.description\": \"Row meta data for grid\",\n \"admin/editor.comparison-grid-row.field.title\": \"Field\",\n \"admin/editor.comparison-grid-row.field.description\": \"This is the field we need to add to comparison detail page\",\n \"admin/editor.comparison-grid-row.field.fieldType.title\": \"Field type\",\n \"admin/editor.comparison-grid-row.field.fieldType.description\": \"Field type of the row\",\n \"admin/editor.comparison-grid-row.field.name.title\": \"Field Name\",\n \"admin/editor.comparison-grid-row.field.name.description\": \"Comparison field name (name of the product field, name of product specification or sku specification)\",\n \"admin/editor.comparison-grid-row.field.display-value.title\": \"Display Name\",\n \"admin/editor.comparison-grid-row.field.display-value.description\": \"Display name of the field in comparison page\",\n \"admin/editor.comparison-grid-row.styles.title\": \"Cell styles\",\n \"admin/editor.comparison-grid-row.styles.width.title\": \"Width\",\n \"admin/editor.comparison-grid-row.styles.width.description\": \"Width of the cell as a percentage\",\n \"admin/editor.comparison-grid.titleText.title\": \"Title\",\n \"store/product-comparison.product-selector.product\": \"Product:\",\n \"store/product-comparison.product-selector.product-added\": \"added to compare\",\n \"store/product-comparison.product-selector.product-removed\": \"removed from compare\",\n \"store/product-comparison.product-selector.compare\": \"Compare\",\n \"store/product-comparison.drawer.products\": \"Products\",\n \"store/product-comparison.drawer.compare\": \"Compare\",\n \"store/product-comparison.drawer.remove-all-message\": \"All products removed from comparison\",\n \"store/product-comparison.drawer.remove-all\": \"Remove All\",\n \"store/product-comparison.drawer.hide\": \"hide\",\n \"store/product-comparison.drawer.show\": \"show\",\n \"store/product-comparison.drawer.min-items-message\": \"You need to add at least two products to compare\",\n \"store/product-comparison.drawer.max-items-message-1\": \"You can compare up to\",\n \"store/product-comparison.drawer.max-items-message-2\": \"products at a time\",\n \"store/product-comparison.main-page.back-to-products\": \"Back to products list\",\n \"store/product-comparison.main-page.sort-by\": \"Sort by\",\n \"store/product-comparison.main-page.order-added\": \"Order added\",\n \"store/product-comparison.main-page.title\": \"Compare {productsLength} products\",\n \"store/product-comparison.product-summary-row.show-differences\": \"Show only differences\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.title\": \"Hide Product Specification Group\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.description\": \"Names of product specification groups which needs to be hidden in comparison page (separate them by comma `,`)\",\n \"store/product-comparison.product-selector.upper-limit-exceeded\": \"Can't add this item to compare, bucket size exceeded\"\n}\n\n```"
}
] |
code_product-comparison_db988ada
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/messages/es.json from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"editor.countdown.title\": \"Cuenta regresiva\",\n \"editor.countdown.description\": \"Componente de cuenta regresiva\",\n \"admin/editor.comparison-grid.title\": \"Matriz de comparación\",\n \"admin/editor.comparison-grid.description\": \"Información de recopilación de filas de la matriz de comparación de productos\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.title\": \"Ocultar especificaciones del producto\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.description\": \"Nombres de especificaciones de producto que deben ocultarse en la página de comparación (se deben separar con comas `,`)\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.title\": \"Ocultar especificaciones de SKU\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.description\": \"Nombres de SKU de producto que deben ocultarse en la página de comparación (se deben separar con comas `,`)\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.title\": \"Ocultar campos del producto\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.description\": \"Campos de producto que deben ocultarse en la página de comparación (se deben separar con comas `,`)\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.title\": \"Ocultar campos de SKU\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.description\": \"Campos de SKU que deben ocultarse en la página de comparación (se deben separar con comas `,`)\",\n \"admin/editor.comparison-grid-row.title\": \"Fila de la matriz de comparación\",\n \"admin/editor.comparison-grid-row.description\": \"Metadatos de la fila en la matriz\",\n \"admin/editor.comparison-grid-row.field.title\": \"Campo\",\n \"admin/editor.comparison-grid-row.field.description\": \"Este es el campo que debemos agregar a la página de detalles de comparación\",\n \"admin/editor.comparison-grid-row.field.fieldType.title\": \"Tipo de campo\",\n \"admin/editor.comparison-grid-row.field.fieldType.description\": \"Tipo de campo de la fila\",\n \"admin/editor.comparison-grid-row.field.name.title\": \"Nombre del campo\",\n \"admin/editor.comparison-grid-row.field.name.description\": \"Nombre del campo de comparación (nombre del campo de producto, nombre de la especificación de producto o especificación de SKU)\",\n \"admin/editor.comparison-grid-row.field.display-value.title\": \"Nombre para mostrar\",\n \"admin/editor.comparison-grid-row.field.display-value.description\": \"Nombre para mostrar del campo en la página de comparación\",\n \"admin/editor.comparison-grid-row.styles.title\": \"Estilos de celda\",\n \"admin/editor.comparison-grid-row.styles.width.title\": \"Anchura\",\n \"admin/editor.comparison-grid-row.styles.width.description\": \"Anchura de la celda en porcentaje\",\n \"admin/editor.comparison-grid.titleText.title\": \"Título\",\n \"store/product-comparison.product-selector.product\": \"Producto:\",\n \"store/product-comparison.product-selector.product-added\": \"agregado a la comparación\",\n \"store/product-comparison.product-selector.product-removed\": \"removido de la comparación\",\n \"store/product-comparison.product-selector.compare\": \"Comparar\",\n \"store/product-comparison.drawer.products\": \"{productsLength, plural, one {producto} other {productos}}\",\n \"store/product-comparison.drawer.compare\": \"Comparar\",\n \"store/product-comparison.drawer.remove-all-message\": \"Se removieron todos los productos de la comparación\",\n \"store/product-comparison.drawer.remove-all\": \"Remover todos\",\n \"store/product-comparison.drawer.hide\": \"ocultar\",\n \"store/product-comparison.drawer.show\": \"mostrar\",\n \"store/product-comparison.drawer.min-items-message\": \"Debes agregar por lo menos dos productos a la comparación\",\n \"store/product-comparison.drawer.max-items-message-1\": \"Puedes comparar hasta\",\n \"store/product-comparison.drawer.max-items-message-2\": \"productos a la vez\",\n \"store/product-comparison.main-page.back-to-products\": \"Volver a la lista de productos\",\n \"store/product-comparison.main-page.sort-by\": \"Ordenar por\",\n \"store/product-comparison.main-page.order-added\": \"Orden agregado\",\n \"store/product-comparison.main-page.title\": \"Сomparar {productsLength, number} {productsLength, plural, one {producto} other {productos}}\",\n \"store/product-comparison.product-summary-row.show-differences\": \"Solo mostrar diferencias\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.title\": \"Ocultar grupo de especificaciones de producto\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.description\": \"Nombres de los grupos de especificaciones de producto que deben ocultarse en la página de comparación (se deben separar con comas `,`)\",\n \"store/product-comparison.product-selector.upper-limit-exceeded\": \"No se puede agregar este ítem a la comparación. Se excedió el tamaño del contenedor.\"\n}\n```"
}
] |
code_product-comparison_afbf8858
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/messages/ar.json from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"editor.countdown.title\": \"العد التنازلي\",\n \"editor.countdown.description\": \"عنصر العد التنازلي\",\n \"admin/editor.comparison-grid.title\": \"شبكة المقارنة\",\n \"admin/editor.comparison-grid.description\": \"معلومات مجموعة صف شبكة مقارنة المنتج\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.title\": \"إخفاء مواصفات المنتج\",\n \"admin/editor.comparison-grid.product-specifications-to-be-removed.description\": \"أسماء مواصفات المنتج التي تحتاج إلى إخفاء في صفحة المقارنة (افصلها بفاصلة '،')\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.title\": \"إخفاء مواصفات الـ SKU\",\n \"admin/editor.comparison-grid.sku-specifications-to-be-removed.description\": \"أسماء مواصفات الـ sku التي تحتاج إلى أن تكون مخفية في صفحة المقارنة (فصلها بفاصلة '،')\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.title\": \"إخفاء حقول المنتج\",\n \"admin/editor.comparison-grid.product-fields-to-be-removed.description\": \"حقول المنتج التي تحتاج إلى أن تكون مخفية في صفحة المقارنة (افصلها بفاصلة '،')\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.title\": \"إخفاء حقول الـ sku\",\n \"admin/editor.comparison-grid.sku-fields-to-be-removed.description\": \"حقول الـ Sku التي تحتاج إلى أن تكون مخفية في صفحة المقارنة (افصلها بفاصلة '،')\",\n \"admin/editor.comparison-grid-row.title\": \"صف شبكة المقارنة\",\n \"admin/editor.comparison-grid-row.description\": \"بيانات التعريف الخاصة بالشبكة\",\n \"admin/editor.comparison-grid-row.field.title\": \"الحقل\",\n \"admin/editor.comparison-grid-row.field.description\": \"هذا هو المجال الذي نحتاج إلى إضافته إلى صفحة تفاصيل المقارنة\",\n \"admin/editor.comparison-grid-row.field.fieldType.title\": \"نوع الحقل\",\n \"admin/editor.comparison-grid-row.field.fieldType.description\": \"نوع الحقل من الصف\",\n \"admin/editor.comparison-grid-row.field.name.title\": \"اسم الحقل\",\n \"admin/editor.comparison-grid-row.field.name.description\": \"اسم حقل المقارنة (اسم حقل المنتج، اسم مواصفات المنتج أو مواصفات الـ sku)\",\n \"admin/editor.comparison-grid-row.field.display-value.title\": \"عرض الاسم\",\n \"admin/editor.comparison-grid-row.field.display-value.description\": \"عرض اسم الحقل في صفحة المقارنة\",\n \"admin/editor.comparison-grid-row.styles.title\": \"أنماط الخانة\",\n \"admin/editor.comparison-grid-row.styles.width.title\": \"العرض\",\n \"admin/editor.comparison-grid-row.styles.width.description\": \"عرض الخانة كنسبة مئوية\",\n \"admin/editor.comparison-grid.titleText.title\": \"العنوان\",\n \"store/product-comparison.product-selector.product\": \"المُنتج:\",\n \"store/product-comparison.product-selector.product-added\": \"إضافة للمقارنة\",\n \"store/product-comparison.product-selector.product-removed\": \"إزالة من المقارنة\",\n \"store/product-comparison.product-selector.compare\": \"مقارنة\",\n \"store/product-comparison.drawer.products\": \"المُنتجات\",\n \"store/product-comparison.drawer.compare\": \"مقارنة\",\n \"store/product-comparison.drawer.remove-all-message\": \"تم حذف جميع المنتجات من المقارنة\",\n \"store/product-comparison.drawer.remove-all\": \"حذف الكل\",\n \"store/product-comparison.drawer.hide\": \"إخفاء\",\n \"store/product-comparison.drawer.show\": \"عرض\",\n \"store/product-comparison.drawer.min-items-message\": \"تحتاج إلى إضافة منتجين على الأقل للمقارنة\",\n \"store/product-comparison.drawer.max-items-message-1\": \"يمكنك مقارنة ما يقارب\",\n \"store/product-comparison.drawer.max-items-message-2\": \"منتجات في وقت واحد\",\n \"store/product-comparison.main-page.back-to-products\": \"عودة إلى قائمة المنتجات\",\n \"store/product-comparison.main-page.sort-by\": \"ترتيب حسب\",\n \"store/product-comparison.main-page.order-added\": \"تم إضافة الطلب\",\n \"store/product-comparison.main-page.title\": \"قارن {productsLength} منتجات\",\n \"store/product-comparison.product-summary-row.show-differences\": \"إظهار الاختلافات فقط\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.title\": \"إخفاء مجموعة مواصفات المنتج\",\n \"admin/editor.comparison-grid.product-specification-groups-to-be-removed.description\": \"أسماء مجموعات مواصفات المنتجات التي تحتاج إلى إخفاء في صفحة المقارنة (افصلها بفاصلة '،')\",\n \"store/product-comparison.product-selector.upper-limit-exceeded\": \"لا يمكن إضافة هذا العنصر للمقارنة، تم تجاوز حجم الدلو\"\n}\n\n```"
}
] |
code_product-comparison_2a22b097
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/docs/README.md from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```markdown\n📢 Use this project, [contribute](https://github.com/vtex-apps/product-comparison) to it or open issues to help evolve it using [Store Discussion](https://github.com/vtex-apps/store-discussion).\n\n# Product Comparison\n\n<!-- DOCS-IGNORE:start -->\n<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n[](#contributors-)\n<!-- ALL-CONTRIBUTORS-BADGE:END -->\n<!-- DOCS-IGNORE:end -->\n\nThe Product Comparison app compares specifications of pre-selected SKUs, allowing customers to better understand their needs when shopping.\n\nThe app exports several blocks, which you can leverage to display a Product Comparison drawer on your store's search results page and a new Product Comparison page.\n\n\n\n*Product Comparison drawer on the store's search results page*\n\n\n\n*Product Comparison page*\n\n## Configuration\n\n### Step 1 - Adding the Product Comparison app to your theme's dependencies\n\nIn your theme's `manifest.json` file, add the `Product Comparison` app as a dependency:\n\n```diff\n \"dependencies\": {\n+ \"vtex.product-comparison\": \"0.x\"\n }\n```\n\nNow, you can use all the blocks exported by the Product Comparison app. Check out the full list below:\n\n| Block name | Description |\n| :--------: | :------------------------: |\n| `product-comparison-drawer` |  Main block that renders the drawer from the Product Comparison component in which the items will be compared. |\n| `list-context.comparison-product-summary-slider` | Extends the `list-context` block to build the Product Comparison component using the [Slider Layout](https://vtex.io/docs/components/layout-blocks/vtex.slider-layout/.) |\n| `product-summary.shelf.product-comparison` | Extends the default `product-summary.shelf` block (from the [Product Summary app](https://vtex.io/docs/components/all/vtex.product-summary/)) for the Product Comparison component's features. |\n| `product-comparison-block` | Logical block that, once extended (see blocks listed below), renders the Product Comparison component's features. |\n| `product-comparison-block.selector` | Renders the selector checkbox on the Product Comparison component. |\n| `product-comparison-block.close-button` | Renders the close button on the Product Comparison component. |\n| `product-comparison-block.product-summary-row` | Renders the first row to list and compare products on the Product Comparison component. |\n| `list-context.comparison-row` | Extends the `list-context` block to build a row in the Product Comparison page using the [Slider Layout](https://vtex.io/docs/components/layout-blocks/vtex.slider-layout/.) |\n| `product-comparison-block.grouped-product-specifications` | Renders the section for product specification groups. |\n| `product-comparison-block.product-specifications` | Renders the section for product specifications. |\n| `product-comparison-block.sku-specifications` | Renders the section for SKU specifications. |\n\n### Step 2 - Adding extended interfaces\n\nIn the theme's `interfaces.json` file, add the following extended interfaces:\n\n```diff\n+{\n+ \"store.search.product-comparison\": {\n+ \"around\": [\"comparison-context-wrapper\"]\n+ },\n+ \"search-result-layout.desktop.product-comparison\": {\n+ \"allowed\": [\"product-comparison-drawer\"]\n+ },\n \"store.product.product-comparison\": {\n \"around\": [\"comparison-context-wrapper\"],\n \"allowed\": [\"product-comparison-drawer\"]\n }\n+}\n```\n\n### Step 3 - Wrapping the search blocks with Product Comparison context\n\n1. In the theme's `search.jsonc` file, replace the default `store.search` blocks with the `store.search.product-comparison` blocks, as shown in the example below:\n\n```diff\n{\n ...\n- \"store.search\": {\n+ \"store.search.product-comparison\": {\n ...\n },\n- \"store.search#brand\": {\n+ \"store.search.product-comparison#brand\": {\n ...\n },\n- \"store.search#department\": {\n+ \"store.search.product-comparison#department\": {\n ...\n }\n- \"store.search#category\": {\n+ \"store.search.product-comparison#category\": {\n ...\n }\n- \"store.search#subcategory\": {\n+ \"store.search.product-comparison#subcategory\": {\n ...\n }\n ...\n```\n\n> ℹ️ The `store.search.product-comparison` blocks wrap the `store.search` block with comparison context. The replacement is needed to synchronously display the selected products in the Product Comparison drawer.\n\n2. Replace the `search-result-layout.desktop` blocks with the `search-result-layout.desktop.product-comparison` blocks, as shown below:\n\n```diff\n{\n ...\n\"search-result-layout\": {\n \"blocks\": [\n- \"search-result-layout.desktop#search\"\n+ \"search-result-layout.desktop.product-comparison#search\",\n \"search-result-layout.mobile\",\n \"search-not-found-layout\"\n ]\n},\n```\n\n3. Replace the `product-summary.shelf`, child of the `gallery` block, with the `product-summary.shelf.product-comparison`:\n\n```diff\n\"gallery\": {\n- \"blocks\": [\"product-summary.shelf\"]\n+ \"blocks\": [\"product-summary.shelf.product-comparison#search\"]\n}\n...\n```\n\n### Step 4 - Adding the Product Comparison to the product detail Page\n\n1. In the theme's `product.json` file, replace the default `store.product` blocks with the `store.product.product-comparison` blocks, as shown in the example below:\n\n```diff\n\n- \"store.product\": {\n+ \"store.product.product-comparison\": {\n ...\n }\n```\n\n2. Add `product-comparison-drawer` to the `store.product.product-comparison` children, as shown in the example below:\n\n```diff\n\"store.product.product-comparison\": {\n children:[\n ...\n+ \"product-comparison-drawer\"\n ]\n ...\n}\n```\n\n3. Add `product-comparison-block.selector#pdp` to the `store.product.product-comparison` block, as shown in the example below:\n\n```diff\n \"store.product.product-comparison\": {\n ...\n children:[\n ...\n+ \"product-comparison-block.selector#pdp\"\n ]\n ...\n }\n ```\n### Step 5 - Building the Product Comparison component\n\nIn any desired template, such as `store.search`, add the `product-comparison-drawer` block, as shown below:\n\n```json\n- \"search-result-layout.desktop#search\": {\n+ \"search-result-layout.desktop.product-comparison#search\": {\n \"children\": [\n \"flex-layout.row#did-you-mean\",\n \"flex-layout.row#suggestion\",\n \"flex-layout.row#banner-one\",\n \"flex-layout.row#searchbread\",\n \"flex-layout.row#searchtitle\",\n \"flex-layout.row#result\",\n+ \"product-comparison-drawer\"\n ],\n \"props\": {\n \"pagination\": \"show-more\",\n \"preventRouteChange\": false,\n \"mobileLayout\": {\n \"mode1\": \"small\",\n \"mode2\": \"normal\"\n }\n }\n}\n...\n```\n\nBy adding the `product-comparison-drawer` block as shown above, you will declare the following structure behind the scenes:\n\n```json\n\"product-comparison-drawer\": {\n \"blocks\": [\"list-context.comparison-product-summary-slider#drawer\"]\n},\n\"list-context.comparison-product-summary-slider#drawer\": {\n \"blocks\": [\"product-summary.shelf.product-comparison#drawer\"],\n \"children\": [\"slider-layout#comparison-drawer\"]\n},\n\"slider-layout#comparison-drawer\": {\n \"props\": {\n \"blockClass\": \"comparison-drawer\",\n \"itemsPerPage\": {\n \"desktop\": 4,\n \"tablet\": 3,\n \"phone\": 1\n },\n \"showPaginationDots\": \"never\",\n \"infinite\": true,\n \"fullWidth\": true\n }\n},\n\"product-summary.shelf.product-comparison#drawer\": {\n \"children\": [\n \"product-summary-column#drawer-col2\",\n \"product-comparison-block.close-button\"\n ],\n \"props\": {\n \"blockClass\": \"drawer-summary\"\n }\n},\n\"product-summary-column#drawer-col2\": {\n \"children\": [\"product-summary-name\", \"product-summary-price#comparison\"],\n \"props\": {\n \"blockClass\": \"drawer-summary-col2\"\n }\n},\n\"product-summary-price#comparison\": {\n \"props\": {\n \"showListPrice\": false,\n \"showSellingPriceRange\": false,\n \"showLabels\": false,\n \"showInstallments\": false,\n \"showDiscountValue\": false\n }\n}\n```\n\n> ℹ️ *The code above is a default implementation of the Product Comparison component. To make any changes, declare the code above in your theme and perform the needed updates according to the available blocks.*\n\n### Step 6 - Building the Product Comparison page\n\n1. In the `/store/blocks` folder, create a new file called `product-comparison.json` and include the following JSON:\n\n```json\n\"store.custom#product-comparison-list\": {\n \"blocks\": [\"comparison-page\"]\n},\n\n\"comparison-page\": {\n \"children\": [\"slider-layout-group#comparison-page\"]\n},\n\n\"slider-layout-group#comparison-page\": {\n \"children\": [\n \"product-comparison-block.product-summary-row\",\n \"product-comparison-block.grouped-product-specifications\"\n ]\n},\n\"product-comparison-block.product-summary-row\": {\n \"blocks\": [\"list-context.comparison-product-summary-slider#comparison-page\"]\n},\n\"list-context.comparison-product-summary-slider#comparison-page\": {\n \"blocks\": [\"product-summary.shelf.product-comparison#comparison-page\"],\n \"children\": [\"slider-layout#comparison-page-product-summary\"]\n},\n\"product-summary.shelf.product-comparison#comparison-page\": {\n \"children\": [\n \"flex-layout.row\",\n \"product-summary-image#comparison-page\",\n \"product-summary-name\",\n \"product-summary-space\",\n \"product-summary-price#comparison\",\n \"product-summary-buy-button\"\n ],\n \"props\": {\n \"blockClass\": \"comparison-page-summary\"\n }\n},\n\"flex-layout.row\": {\n \"children\": [\"product-comparison-block.close-button\"],\n \"props\": {\n \"blockClass\": \"close\",\n \"horizontalAlign\": \"right\"\n }\n},\n\"product-summary-image#comparison-page\": {\n \"props\": {\n \"width\": 200,\n \"heightProp\": 200\n }\n},\n\"product-comparison-block.grouped-product-specifications\": {\n \"blocks\": [\"list-context.comparison-row#comparison-page-row\"]\n},\n\"list-context.comparison-row#comparison-page-row\": {\n \"children\": [\"slider-layout#comparison-no-arrows\"]\n},\n\"slider-layout#comparison-page-product-summary\": {\n \"props\": {\n \"blockClass\": \"comparison-page\",\n \"itemsPerPage\": {\n \"desktop\": 4,\n \"tablet\": 3,\n \"phone\": 1\n },\n \"showPaginationDots\": \"never\",\n \"infinite\": true,\n \"fullWidth\": true\n }\n},\n\"slider-layout#comparison-no-arrows\": {\n \"props\": {\n \"itemsPerPage\": {\n \"desktop\": 4,\n \"tablet\": 3,\n \"phone\": 1\n },\n \"showPaginationDots\": \"never\",\n \"infinite\": true,\n \"fullWidth\": true,\n \"blockClass\": \"comparison-page\",\n \"showNavigationArrows\": \"never\"\n }\n}\n```\n\n2. In the theme's `routes.json` file, add a new route for the Product Comparison page:\n\n```diff\n+{\n+ \"store.custom#product-comparison-list\": {\n+ \"path\": \"/product-comparison\"\n+ }\n+}\n```\n\n#### `product-comparison-block.grouped-product-specifications` props\n\n| Prop name | Type | Description | Default value |\n| :------------: | :-----------: | :----------------------------: | :-----------: |\n| `productSpecificationsToHide` | `[string]` | List of product fields that should be hidden in the Product Comparison page. The desired product fields must be separated by a comma. | `undefined` |\n| `productSpecificationGroupsToHide` | `[string]` | List of product specification groups that should be hidden on the Product Comparison page. The desired product specification groups must be separated by a comma. | `undefined` |\n\n#### `product-comparison-block.product-specifications` props\n\n| Prop name | Type | Description | Default value |\n| :------------: | :-----------: | :----------------------------: | :--------: |\n| `productSpecificationsToHide` | `[string]` | List of product fields that should be hidden in the Product Comparison page. The desired product fields must be separated by a comma. | `undefined` |\n\n#### `product-comparison-block.sku-specifications` props\n\n| Prop name | Type | Description | Default value |\n| :------------: | :-----------: | :----------------------------: | :--------: |\n| `skuSpecificationsToHide` | `[string]` | List of SKU specification fields that should be hidden on the Product Comparison page. The desired SKU specification fields must be separated by a comma. | `undefined` |\n\n#### `product-comparison-block.product-summary-row` props\n\n| Prop name | Type | Description | Default value |\n| :------------: | :-----------: | :----------------------------: | :--------: |\n| `isShowDifferenceDefault` | `boolean` | Set the \"show only differences\" checkbox to true as the default value on the comparison page. | `false` |\n=======\n\n### Step 7 - Change the comparison bucket size\n\nThis is an optional configuration, so you can set a fixed number in the app configuration to change the maximum number of items in the comparison bucket.\nThe default value is 10 items; if you exceed the maximum limit, you will receive a notification.\n\n#### Instructions\n\n1. Go to `/admin/apps`, then find the `Product Comparison` app under `Installed` apps.\n2. Click Settings. \n3. Enter the maximum comparison bucket size for your application.\n\n## Customization\n\nTo apply CSS customizations in this and other blocks, follow the instructions in [Using CSS Handles for store customization](https://vtex.io/docs/recipes/style/using-css-handles-for-store-customization).\n\n| CSS Handles |\n| :--------------------------: |\n| `closeButton` |\n| `closeButtonContainer` |\n| `compareProductsButton` |\n| `comparisonButtons` |\n| `comparisonCol` |\n| `drawer` |\n| `drawerContainer` |\n| `expandCollapseButton` |\n| `fieldNameCol` |\n| `fieldNameCol` |\n| `productFieldValue` |\n| `productSelectorContainer` |\n| `productSpecificationValue` |\n| `productSpecificationValues` |\n| `productSummaryRowContainer` |\n| `rowContainer` |\n| `showDifferencesContainer` |\n| `skuFieldValue` |\n| `skuSpecificationValue` |\n| `skuSpecificationValues` |\n| `title` |\n| `removeAllItemsButtonWrapper`|\n| `compareProductButtonWrapper`|\n| `removeAllWrapper` |\n| `drawerTitleOuterContainer` |\n| `drawerTitleInnerContainer` |\n| `drawerOpened` |\n| `drawerClosed` |\n\n<!-- DOCS-IGNORE:start -->\n\n## Contributors ✨\n\nThanks goes to these wonderful people:\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<!-- markdownlint-enable -->\n<!-- prettier-ignore-end -->\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind are welcome!\n\n<!-- DOCS-IGNORE:end -->\n\n```"
}
] |
code_product-comparison_2bcb63e0
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/ProductSpecifications.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport ProductSpecifications from './components/comparisonFields/ProductSpecifications'\n\nexport default ProductSpecifications\n\n```"
}
] |
code_product-comparison_c70fba40
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/ComparisonProductWrapper.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport type { ReactChildren, ReactChild } from 'react'\nimport React, { useEffect, useState } from 'react'\nimport { pathOr } from 'ramda'\n// import { pathOr, propEq, find } from 'ramda'\nimport productsQuery from 'vtex.store-resources/QueryProduct'\nimport { useApolloClient } from 'react-apollo'\n\nimport ComparisonContext from './ProductComparisonContext'\nimport ComparisonProductContext from './ComparisonProductContext'\n// import { mapCatalogProductToProductSummary } from './components/utils/normalize'\n\ninterface Props {\n children: ReactChildren | ReactChild\n}\nconst ComparisonProductWrapper = ({ children }: Props) => {\n const [products, setProducts] = useState([] as Product[])\n const client = useApolloClient()\n\n const { ComparisonProductProvider } = ComparisonProductContext\n const { useProductComparisonState } = ComparisonContext\n\n const comparisonData = useProductComparisonState()\n const comparisonProducts = pathOr(\n [] as ProductToCompare[],\n ['products'],\n comparisonData\n )\n\n useEffect(() => {\n Promise.all(\n comparisonProducts.map((productToCompare: ProductToCompare) => {\n return client.query({\n query: productsQuery,\n variables: {\n identifier: {\n field: 'id',\n value: productToCompare.productId,\n },\n },\n })\n })\n ).then((productsList: Array<{ data: { product: Product } }>) => {\n const responseProducts: Product[] = productsList.map(\n (productResponse: { data: { product: Product } }) =>\n // eslint-disable-next-line @typescript-eslint/no-object-literal-type-assertion\n pathOr({} as Product, ['data', 'product'], productResponse)\n )\n\n // const productSummaryProducts = comparisonProducts.map(productInfo => {\n // const selectedProduct = find(\n // propEq('productId', productInfo.productId)\n // )(responseProducts)\n\n // return mapCatalogProductToProductSummary(\n // selectedProduct,\n // productInfo.skuId\n // )\n // })\n\n // setProducts(productSummaryProducts)\n\n setProducts(responseProducts)\n })\n }, [client, comparisonProducts])\n\n return (\n <ComparisonProductProvider\n products={comparisonProducts.length > 0 ? products : []}\n >\n {children}\n </ComparisonProductProvider>\n )\n}\n\nexport default ComparisonProductWrapper\n\n```"
}
] |
code_product-comparison_53e7b1fb
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/ProductComparisonContext.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport type { ReactChildren, ReactChild } from 'react'\nimport React, { useReducer, useContext, createContext, useEffect } from 'react'\nimport { pathOr, reject, propEq, allPass } from 'ramda'\nimport { useQuery } from 'react-apollo'\n\nimport AppSettings from './queries/AppSettings.graphql'\n\nexport interface State {\n isDrawerCollapsed: boolean\n showDifferences: boolean\n products: ProductToCompare[]\n maxNumberOfItemsToCompare: number\n}\n\ninterface SetShowDifferences {\n type: 'SET_SHOW_DIFFERENCES'\n args: { showDifferences: boolean }\n}\n\ninterface AddAll {\n type: 'ADD_ALL'\n args: { products: ProductToCompare[] }\n}\n\ninterface AddMultiple {\n type: 'ADD_MULTIPLE'\n args: { products: ProductToCompare[] }\n}\n\ninterface RemoveAll {\n type: 'REMOVE_ALL'\n}\n\ninterface Add {\n type: 'ADD'\n args: { product: ProductToCompare }\n}\n\ninterface Remove {\n type: 'REMOVE'\n args: { product: ProductToCompare }\n}\n\ninterface IsDrawerCollapsed {\n type: 'IS_DRAWER_COLLAPSED'\n args: { isDrawerCollapsed: boolean }\n}\n\ninterface SetMaxLimit {\n type: 'SET_MAX_LIMIT'\n args: { maxLimit: number }\n}\n\ntype ReducerActions =\n | AddAll\n | AddMultiple\n | Add\n | RemoveAll\n | Remove\n | SetShowDifferences\n | IsDrawerCollapsed\n | SetMaxLimit\n\nexport type Dispatch = (action: ReducerActions) => void\n\nconst listReducer = (state: State, action: ReducerActions): State => {\n switch (action.type) {\n case 'ADD_ALL': {\n const products = pathOr([], ['args', 'products'], action)\n const productsToCompare = [...state.products, ...products].slice(\n 0,\n state.maxNumberOfItemsToCompare\n )\n\n return {\n ...state,\n products: productsToCompare,\n }\n }\n\n case 'ADD_MULTIPLE': {\n const products = pathOr([], ['args', 'products'], action)\n\n const productsToAdd = products.filter(\n (product: ProductToCompare) =>\n state.products.filter(\n (existing: ProductToCompare) =>\n existing.productId === product.productId &&\n existing.skuId === product.skuId\n ).length === 0\n )\n\n const newProductList = [...state.products, ...productsToAdd].slice(\n 0,\n state.maxNumberOfItemsToCompare\n )\n\n localStorage.setItem(\n 'PRODUCTS_TO_COMPARE',\n JSON.stringify(newProductList)\n )\n\n return {\n ...state,\n products: newProductList,\n }\n }\n\n case 'ADD': {\n const { product } = action.args\n const newProductList = [...state.products, product].slice(\n 0,\n state.maxNumberOfItemsToCompare\n )\n\n localStorage.setItem(\n 'PRODUCTS_TO_COMPARE',\n JSON.stringify(newProductList)\n )\n\n return {\n ...state,\n products: newProductList,\n }\n }\n\n case 'REMOVE_ALL': {\n localStorage.setItem('PRODUCTS_TO_COMPARE', JSON.stringify([]))\n\n return {\n ...state,\n products: [],\n }\n }\n\n case 'REMOVE': {\n const { product } = action.args\n const remaining = reject(\n allPass([\n propEq('productId', product.productId),\n propEq('skuId', product.skuId),\n ])\n )(state.products)\n\n localStorage.setItem('PRODUCTS_TO_COMPARE', JSON.stringify(remaining))\n\n return { ...state, products: remaining }\n }\n\n case 'SET_SHOW_DIFFERENCES': {\n return {\n ...state,\n ...{ showDifferences: action.args.showDifferences },\n }\n }\n\n case 'IS_DRAWER_COLLAPSED': {\n return {\n ...state,\n isDrawerCollapsed: action.args.isDrawerCollapsed,\n }\n }\n\n case 'SET_MAX_LIMIT': {\n return {\n ...state,\n maxNumberOfItemsToCompare: action.args.maxLimit,\n }\n }\n\n default: {\n throw new Error(`Unhandled action type on product-list-context`)\n }\n }\n}\n\nconst MAX_ITEMS_TO_COMPARE = 10\n\nconst DEFAULT_STATE: State = {\n isDrawerCollapsed: false,\n showDifferences: false,\n products: [] as ProductToCompare[],\n maxNumberOfItemsToCompare: MAX_ITEMS_TO_COMPARE,\n}\n\nconst ComparisonContext = createContext<State>(DEFAULT_STATE)\nconst ComparisonDispatchContext = createContext<Dispatch>((action) => {\n console.error('error in dispatch ', action)\n})\n\nconst initialState: State = {\n showDifferences: false,\n isDrawerCollapsed: false,\n products: [] as ProductToCompare[],\n maxNumberOfItemsToCompare: MAX_ITEMS_TO_COMPARE,\n}\n\ninterface Props {\n children: ReactChildren | ReactChild\n}\n\nconst ProductComparisonProvider = ({ children }: Props) => {\n const [state, dispatch] = useReducer(listReducer, initialState)\n\n const { data: appSettingsData } = useQuery(AppSettings, {\n variables: {\n // eslint-disable-next-line no-undef\n version: process.env.VTEX_APP_VERSION,\n },\n ssr: false,\n })\n\n useEffect(() => {\n const appSettings = JSON.parse(\n pathOr(`{}`, ['publicSettingsForApp', 'message'], appSettingsData)\n )\n\n dispatch({\n type: 'SET_MAX_LIMIT',\n args: {\n maxLimit: pathOr(\n MAX_ITEMS_TO_COMPARE,\n ['maxNumberOfItemsToCompare'],\n appSettings\n ),\n },\n })\n }, [appSettingsData])\n\n useEffect(() => {\n const initialProducts = localStorage.getItem('PRODUCTS_TO_COMPARE')\n const productsToCompare = (initialProducts\n ? JSON.parse(initialProducts)\n : []) as ProductToCompare[]\n\n dispatch({ type: 'ADD_ALL', args: { products: productsToCompare } })\n }, [])\n\n return (\n <ComparisonContext.Provider value={state}>\n <ComparisonDispatchContext.Provider value={dispatch}>\n {children}\n </ComparisonDispatchContext.Provider>\n </ComparisonContext.Provider>\n )\n}\n\nconst useProductComparisonState = () => useContext(ComparisonContext)\n\nconst useProductComparisonDispatch = () => useContext(ComparisonDispatchContext)\n\nexport default {\n ProductComparisonProvider,\n useProductComparisonState,\n useProductComparisonDispatch,\n}\n\n```"
}
] |
code_product-comparison_91adb342
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/global.css from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.pageContainer {\n}\n\n.styleguide__layout {\n background-color: unset;\n}\n\n.styleguide__box {\n padding: unset;\n border: unset;\n}\n\n@-webkit-keyframes spin {\n 0% { -webkit-transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); }\n}\n\n@keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n.productLoader {\n border: 16px solid #f3f3f3;\n border-radius: 50%;\n border-top: 16px solid #3498db;\n width: 120px;\n height: 120px;\n -webkit-animation: spin 2s linear infinite; /* Safari */\n animation: spin 2s linear infinite;\n}\n\n```"
}
] |
code_product-comparison_bc066892
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/ComparisonProductContext.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport type { ReactChildren, ReactChild } from 'react'\nimport React, { useReducer, useContext, createContext, useEffect } from 'react'\nimport { pathOr, reject, propEq, allPass } from 'ramda'\n\nexport interface State {\n products: Product[]\n}\n\ninterface AddAll {\n type: 'ADD_ALL_PRODUCTS'\n args: { products: Product[] }\n}\n\ninterface RemoveAll {\n type: 'REMOVE_ALL_PRODUCTS'\n}\n\ninterface Add {\n type: 'ADD_PRODUCT'\n args: { product: Product }\n}\n\ninterface Remove {\n type: 'REMOVE_PRODUCT'\n args: { product: Product }\n}\n\ntype ReducerActions = AddAll | Add | RemoveAll | Remove\n\nexport type Dispatch = (action: ReducerActions) => void\n\nconst listReducer = (state: State, action: ReducerActions): State => {\n switch (action.type) {\n case 'ADD_ALL_PRODUCTS': {\n const products = pathOr([], ['args', 'products'], action)\n\n return {\n ...state,\n products: [...products],\n }\n }\n\n case 'ADD_PRODUCT': {\n const { product } = action.args\n const newProductList = [...state.products, product]\n\n return {\n ...state,\n products: newProductList,\n }\n }\n\n case 'REMOVE_ALL_PRODUCTS': {\n return {\n ...state,\n products: [],\n }\n }\n\n case 'REMOVE_PRODUCT': {\n const { product } = action.args\n const remaining = reject(\n allPass([\n propEq('productId', product.productId),\n propEq('skuId', product.skuId),\n ])\n )(state.products)\n\n localStorage.setItem('PRODUCTS_TO_COMPARE', JSON.stringify(remaining))\n\n return { ...state, products: remaining }\n }\n\n default: {\n throw new Error(`Unhandled action type on product-list-context`)\n }\n }\n}\n\nconst DEFAULT_STATE: State = {\n products: [] as Product[],\n}\n\nconst ComparisonProductContext = createContext<State>(DEFAULT_STATE)\nconst ComparisonProductDispatchContext = createContext<Dispatch>((action) => {\n console.error('error in dispatch ', action)\n})\n\nconst initialState: State = {\n products: [] as ProductToCompare[],\n}\n\ninterface Props {\n products: Product[]\n children: ReactChildren | ReactChild\n}\n\nconst ComparisonProductProvider = ({ products, children }: Props) => {\n const [state, dispatch] = useReducer(listReducer, initialState)\n\n useEffect(() => {\n if (products && products.length > 0) {\n dispatch({ type: 'ADD_ALL_PRODUCTS', args: { products } })\n }\n }, [products])\n\n return (\n <ComparisonProductContext.Provider value={state}>\n <ComparisonProductDispatchContext.Provider value={dispatch}>\n {children}\n </ComparisonProductDispatchContext.Provider>\n </ComparisonProductContext.Provider>\n )\n}\n\nconst useComparisonProductState = () => useContext(ComparisonProductContext)\n\nconst useComparisonProductDispatch = () =>\n useContext(ComparisonProductDispatchContext)\n\nexport default {\n ComparisonProductProvider,\n useComparisonProductState,\n useComparisonProductDispatch,\n}\n\n```"
}
] |
code_product-comparison_64902330
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/ProductComparisonWrapper.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport type { ReactChildren, ReactChild } from 'react'\nimport React from 'react'\nimport { ToastProvider } from 'vtex.styleguide'\n\nimport ComparisonContext from './ProductComparisonContext'\nimport ComparisonProductWrapper from './ComparisonProductWrapper'\n\ninterface Props {\n children: ReactChildren | ReactChild\n maxNumberOfItemsToCompare: number | undefined\n}\nconst ProductComparisonWrapper = ({ children }: Props) => {\n const { ProductComparisonProvider } = ComparisonContext\n\n return (\n <ProductComparisonProvider>\n <ComparisonProductWrapper>\n <ToastProvider positioning=\"window\">{children}</ToastProvider>\n </ComparisonProductWrapper>\n </ProductComparisonProvider>\n )\n}\n\nexport default ProductComparisonWrapper\n\n```"
}
] |
code_product-comparison_cdbf86f5
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/ProductSummaryRow.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport ProductSummaryRow from './components/comparisonPageRow/ProductSummaryRow'\n\nexport default ProductSummaryRow\n\n```"
}
] |
code_product-comparison_84168a7c
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/ProductSummaryList.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport ProductSummaryList from './components/productSummaryList/ProductSummaryList'\n\nexport default ProductSummaryList\n\n```"
}
] |
code_product-comparison_407f1482
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/RemoveButton.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport RemoveButton from './components/productRemover/RemoveButton'\n\nexport default RemoveButton\n\n```"
}
] |
code_product-comparison_28f0a23c
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/package.json from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"scripts\": {\n \"test\": \"vtex-test-tools test\",\n \"lint\": \"tsc --noEmit && eslint --ext ts,tsx .\"\n },\n \"dependencies\": {\n \"@vtex/css-handles\": \"^1.0.0\",\n \"classnames\": \"^2.2.6\",\n \"ramda\": \"^0.26.1\",\n \"react\": \"^16.8.3\",\n \"react-dom\": \"^16.8.3\",\n \"react-intl\": \"^2.7.2\",\n \"react-apollo\": \"^3.1.3\"\n },\n \"devDependencies\": {\n \"@types/classnames\": \"^2.2.7\",\n \"@types/jest\": \"^24.0.18\",\n \"@types/node\": \"^12.7.5\",\n \"@types/prop-types\": \"^15.7.0\",\n \"@types/ramda\": \"^0.26.5\",\n \"@types/react\": \"^16.9.2\",\n \"@vtex/test-tools\": \"^1.1.0\",\n \"eslint\": \"^5.16.0\",\n \"eslint-config-vtex-react\": \"^4.1.0\",\n \"prettier\": \"^1.18.2\",\n \"tslint-eslint-rules\": \"^5.4.0\",\n \"typescript\": \"3.9.7\",\n \"vtex.apps-graphql\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.apps-graphql@2.8.0/public/@types/vtex.apps-graphql\",\n \"vtex.css-handles\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.css-handles@0.4.4/public/@types/vtex.css-handles\",\n \"vtex.flex-layout\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.flex-layout@0.16.0/public/@types/vtex.flex-layout\",\n \"vtex.list-context\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.list-context@0.2.0/public/@types/vtex.list-context\",\n \"vtex.pixel-manager\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.pixel-manager@1.8.0/public/@types/vtex.pixel-manager\",\n \"vtex.product-list-context\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.product-list-context@0.3.1/public/@types/vtex.product-list-context\",\n \"vtex.product-summary\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.product-summary@2.71.2/public/@types/vtex.product-summary\",\n \"vtex.product-summary-context\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.product-summary-context@0.7.0/public/@types/vtex.product-summary-context\",\n \"vtex.render-runtime\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.render-runtime@8.128.3/public/@types/vtex.render-runtime\",\n \"vtex.slider-layout\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.slider-layout@0.18.0/public/@types/vtex.slider-layout\",\n \"vtex.store-graphql\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.store-graphql@2.140.0/public/@types/vtex.store-graphql\",\n \"vtex.store-icons\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.store-icons@0.18.0/public/@types/vtex.store-icons\",\n \"vtex.store-resources\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.store-resources@0.79.0/public/@types/vtex.store-resources\",\n \"vtex.styleguide\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@9.138.2/public/@types/vtex.styleguide\"\n },\n \"version\": \"0.20.0\"\n}\n\n```"
}
] |
code_product-comparison_75c90700
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/GroupedProductSpecifications.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport GroupedProductSpecifications from './components/comparisonFields/GroupedProductSpecifications'\n\nexport default GroupedProductSpecifications\n\n```"
}
] |
code_product-comparison_2eb421f7
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/ComparisonGridRowContent.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport ComparisonGridRowContent from './components/comparisonPageRow/ComparisonGridRowContent'\n\nexport default ComparisonGridRowContent\n\n```"
}
] |
code_product-comparison_f2aa3e50
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/ComparisonPage.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport type { ReactChild, ReactChildren } from 'react'\nimport React from 'react'\nimport { isEmpty, pathOr } from 'ramda'\nimport { useCssHandles } from 'vtex.css-handles'\nimport {\n Button,\n Layout,\n PageBlock,\n PageHeader,\n Spinner,\n withToast,\n} from 'vtex.styleguide'\nimport type { InjectedIntlProps } from 'react-intl'\nimport { defineMessages, injectIntl } from 'react-intl'\n\nimport ComparisonContext from './ProductComparisonContext'\nimport './global.css'\n\nconst CSS_HANDLES = ['pageContainer', 'sortBy', 'removeAllItemsButtonWrapper']\n\ninterface Props extends InjectedIntlProps {\n children: ReactChildren | ReactChild\n showToast?: (input: ToastInput) => void\n}\n\nconst messages = defineMessages({\n removeAll: {\n defaultMessage: '',\n id: 'store/product-comparison.drawer.remove-all',\n },\n removeAllMessage: {\n defaultMessage: '',\n id: 'store/product-comparison.drawer.remove-all-message',\n },\n backToProducts: {\n defaultMessage: '',\n id: 'store/product-comparison.main-page.back-to-products',\n },\n sortBy: {\n defaultMessage: '',\n id: 'store/product-comparison.main-page.sort-by',\n },\n orderAdded: {\n defaultMessage: '',\n id: 'store/product-comparison.main-page.order-added',\n },\n title: {\n defaultMessage: '',\n id: 'store/product-comparison.main-page.title',\n },\n})\n\nconst ComparisonPage = ({ children, intl, showToast }: Props) => {\n const cssHandles = useCssHandles(CSS_HANDLES)\n const {\n useProductComparisonState,\n useProductComparisonDispatch,\n } = ComparisonContext\n\n const comparisonData = useProductComparisonState()\n const dispatchComparison = useProductComparisonDispatch()\n\n const comparisonProducts = pathOr(\n [] as ProductToCompare[],\n ['products'],\n comparisonData\n )\n\n const showMessage = (message: string) => {\n if (showToast) {\n showToast({\n message,\n })\n }\n }\n\n const removeAllItems = () => {\n dispatchComparison({\n type: 'REMOVE_ALL',\n })\n showMessage(intl.formatMessage(messages.removeAllMessage))\n window.history.back()\n }\n\n const onBackButtonClick = () => {\n window.history.back()\n }\n\n return isEmpty(comparisonProducts) ? (\n <div className=\"mw3 center\">\n <Spinner />\n </div>\n ) : (\n <div className={`${cssHandles.pageContainer} mw9 center`}>\n <Layout\n fullWidth\n pageHeader={\n <PageHeader\n title={intl.formatMessage(messages.title, {\n productsLength: ` ${comparisonProducts.length}`,\n })}\n linkLabel={intl.formatMessage(messages.backToProducts)}\n onLinkClick={onBackButtonClick}\n >\n <div className=\"flex\">\n <div className={`${cssHandles.sortBy} flex items-center`}>\n {/* <span className=\"mr2\">\n {intl.formatMessage(messages.sortBy)}\n </span>\n <Dropdown\n variation=\"inline\"\n size=\"default\"\n options={[\n { value: 'productName', label: 'Product Name' },\n { value: 'price', label: 'Price' },\n ]}\n value={`productName`}\n /> */}\n </div>\n <div className={cssHandles.removeAllItemsButtonWrapper}>\n <Button\n variation=\"tertiary\"\n size=\"regular\"\n onClick={removeAllItems}\n >\n {intl.formatMessage(messages.removeAll)}\n </Button>\n </div>\n </div>\n </PageHeader>\n }\n >\n <PageBlock>{children}</PageBlock>\n </Layout>\n </div>\n )\n}\n\nexport default withToast(injectIntl(ComparisonPage))\n\n```"
}
] |
code_product-comparison_bb468dd9
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/SkuSpecifications.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport SkuSpecifications from './components/comparisonFields/SkuSpecifications'\n\nexport default SkuSpecifications\n\n```"
}
] |
code_product-comparison_a313b02e
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/ComparisonDrawer.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport ComparisonDrawer from './components/drawer/ComparisonDrawer'\n\nexport default ComparisonDrawer\n\n```"
}
] |
code_product-comparison_d42e7ca0
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/ProductSelector.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport ProductSelector from './components/productSelector/ProductSelector'\n\nexport default ProductSelector\n\n```"
}
] |
code_product-comparison_e0d489a7
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/graphQLTypes.ts from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\n/* tslint:disable */\n/* eslint-disable */\n// @generated\n// This file was automatically generated and should not be edited.\n\n//==============================================================\n// START Enums and Input Objects\n//==============================================================\n\nexport enum ProductUniqueIdentifierField {\n ean = 'ean',\n id = 'id',\n reference = 'reference',\n sku = 'sku',\n slug = 'slug',\n}\n\nexport interface ProductUniqueIdentifier {\n field: ProductUniqueIdentifierField\n value: string\n}\n\n//==============================================================\n// END Enums and Input Objects\n//==============================================================\n\n```"
}
] |
code_product-comparison_f5b9de60
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/store/blocks.jsonc from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n // START: Product comparison drawer\n \"product-comparison-drawer\": {\n \"blocks\": [\"list-context.comparison-product-summary-slider#drawer\"]\n },\n \"list-context.comparison-product-summary-slider#drawer\": {\n \"blocks\": [\"product-summary.shelf.product-comparison#drawer\"],\n \"children\": [\"slider-layout#comparison-drawer\"]\n },\n \"slider-layout#comparison-drawer\": {\n \"props\": {\n \"blockClass\": \"comparison-drawer\",\n \"itemsPerPage\": {\n \"desktop\": 4,\n \"tablet\": 3,\n \"phone\": 1\n },\n \"showPaginationDots\": \"never\",\n \"infinite\": true,\n \"fullWidth\": true\n }\n },\n \"product-summary.shelf.product-comparison#drawer\": {\n \"children\": [\n \"product-summary-column#drawer-col1\",\n \"product-summary-column#drawer-col2\",\n \"product-comparison-block.close-button\"\n ],\n \"props\": {\n \"blockClass\": \"drawer-summary\"\n }\n },\n \"product-summary-column#drawer-col1\": {\n \"children\": [\"product-summary-image#drawer\"],\n \"props\": {\n \"blockClass\": \"drawer-summary-col1\"\n }\n },\n \"product-summary-image#drawer\": {\n \"props\": {\n \"showBadge\": false,\n \"width\": 75,\n \"heightProp\": 75\n }\n },\n \"product-summary-column#drawer-col2\": {\n \"children\": [\"product-summary-name\", \"product-summary-price#comparison\"],\n \"props\": {\n \"blockClass\": \"drawer-summary-col2\"\n }\n },\n \"product-summary-price#comparison\": {\n \"props\": {\n \"showListPrice\": false,\n \"showSellingPriceRange\": false,\n \"showLabels\": false,\n \"showInstallments\": false,\n \"showDiscountValue\": false\n }\n },\n // START: Product comparison drawer\n\n // START: Product comparison page\n \"comparison-page\": {\n \"children\": [\"slider-layout-group#comparison-page\"]\n },\n\n \"slider-layout-group#comparison-page\": {\n \"children\": [\n \"product-comparison-block.product-summary-row\",\n \"product-comparison-block.grouped-product-specifications\"\n ]\n },\n \"product-comparison-block.product-summary-row\": {\n \"blocks\": [\"list-context.comparison-product-summary-slider#comparison-page\"]\n },\n \"list-context.comparison-product-summary-slider#comparison-page\": {\n \"blocks\": [\"product-summary.shelf.product-comparison#comparison-page\"],\n \"children\": [\"slider-layout#comparison-page-product-summary\"]\n },\n \"product-summary.shelf.product-comparison#comparison-page\": {\n \"children\": [\n \"flex-layout.row\",\n \"product-summary-image#comparison-page\",\n \"product-summary-name\",\n \"product-summary-space\",\n \"product-summary-price#comparison\",\n \"product-summary-buy-button\"\n ],\n \"props\": {\n \"blockClass\": \"comparison-page-summary\"\n }\n },\n \"flex-layout.row\": {\n \"children\": [\"product-comparison-block.close-button\"],\n \"props\": {\n \"blockClass\": \"close\",\n \"horizontalAlign\": \"right\"\n }\n },\n\n \"product-summary-image#comparison-page\": {\n \"props\": {\n \"width\": 200,\n \"heightProp\": 200\n }\n },\n \"product-comparison-block.grouped-product-specifications\": {\n \"blocks\": [\"list-context.comparison-row#comparison-page-row\"]\n },\n // \"product-comparison-block.product-specifications\": {\n // \"blocks\": [\"list-context.comparison-row#comparison-page-row\"],\n // \"props\": {\n // \"titleText\": \"Product Specifications\"\n // }\n // },\n // \"product-comparison-block.sku-specifications\": {\n // \"blocks\": [\"list-context.comparison-row#comparison-page-row\"],\n // \"props\": {\n // \"titleText\": \"Sku Specifications\"\n // }\n // },\n \"list-context.comparison-row#comparison-page-row\": {\n \"children\": [\"slider-layout#comparison-no-arrows\"]\n },\n \"slider-layout#comparison-page-product-summary\": {\n \"props\": {\n \"blockClass\": \"comparison-page\",\n \"itemsPerPage\": {\n \"desktop\": 4,\n \"tablet\": 3,\n \"phone\": 1\n },\n \"showPaginationDots\": \"never\",\n \"infinite\": true,\n \"fullWidth\": true\n }\n },\n \"slider-layout#comparison-no-arrows\": {\n \"props\": {\n \"itemsPerPage\": {\n \"desktop\": 4,\n \"tablet\": 3,\n \"phone\": 1\n },\n \"showPaginationDots\": \"never\",\n \"infinite\": true,\n \"fullWidth\": true,\n \"blockClass\": \"comparison-page\",\n \"showNavigationArrows\": \"never\"\n }\n }\n // END: Product comparison page\n}\n\n```"
}
] |
code_product-comparison_18a25190
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/store/interfaces.json from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"comparison-context-wrapper\": {\n \"component\": \"ProductComparisonWrapper\"\n },\n\n \"product-comparison-block\": {},\n\n \"product-comparison-block.selector\": {\n \"component\": \"ProductSelector\"\n },\n\n \"product-comparison-drawer\": {\n \"allowed\": [\"list-context.comparison-product-summary-slider\"],\n \"component\": \"ComparisonDrawer\"\n },\n\n \"list-context.comparison-product-summary-slider\": {\n \"allowed\": [\"product-summary\"],\n \"composition\": \"children\",\n \"component\": \"ProductSummaryList\"\n },\n\n \"comparison-page\": {\n \"around\": [\"comparison-context-wrapper\"],\n \"component\": \"ComparisonPage\",\n \"composition\": \"children\"\n },\n\n \"product-comparison-block.product-summary-row\": {\n \"component\": \"ProductSummaryRow\",\n \"allowed\": [\"list-context.comparison-product-summary-slider\"]\n },\n\n \"product-comparison-block.product-specifications\": {\n \"allowed\": [\"list-context.comparison-row\"],\n \"component\": \"ProductSpecifications\"\n },\n\n \"product-comparison-block.grouped-product-specifications\": {\n \"allowed\": [\"list-context.comparison-row\"],\n \"component\": \"GroupedProductSpecifications\"\n },\n\n \"product-comparison-block.sku-specifications\": {\n \"allowed\": [\"list-context.comparison-row\"],\n \"component\": \"SkuSpecifications\"\n },\n\n \"product-comparison-block.close-button\": {\n \"component\": \"RemoveButton\"\n },\n\n \"list-context.comparison-row\": {\n \"composition\": \"children\",\n \"component\": \"ComparisonGridRowContent\"\n },\n\n \"product-summary.shelf.product-comparison\": {\n \"allowed\": [\"product-comparison-block\"]\n }\n}\n\n```"
}
] |
code_product-comparison_caf9c634
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/typings/vtex.list-context.d.ts from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\ndeclare module 'vtex.list-context*' {\n import type { Context, Provider } from 'react'\n\n export const useListContext: Context\n export const ListContextProvider: Provider\n}\n\n```"
}
] |
code_product-comparison_5decbb7e
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/typings/productSummaryContext.d.ts from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\ndeclare module 'vtex.product-summary-context*' {\n import type { Context } from 'react'\n\n export const useProductSummary: Context\n}\n\n```"
}
] |
code_product-comparison_95b6f0a8
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/typings/storefront.d.ts from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport type { FunctionComponent } from 'react'\n\ndeclare global {\n interface StorefrontFunctionComponent<P = {}> extends FunctionComponent<P> {\n getSchema?(props: P): object\n schema?: object\n }\n\n interface StorefrontComponent<P = {}, S = {}> extends Component<P, S> {\n getSchema?(props: P): object\n schema: object\n }\n}\n\n```"
}
] |
code_product-comparison_dd2d52cc
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/typings/vtex.product-list-context.d.ts from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\ndeclare module 'vtex.product-list-context*' {\n import type { Context, Provider } from 'react'\n\n export const ProductListContext: Context\n export const useProductImpression: Provider\n}\n\n```"
}
] |
code_product-comparison_bc4a9484
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/typings/vtex.render-runtime.d.ts from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* Typings for `render-runtime` */\ndeclare module 'vtex.render-runtime' {\n import type { ComponentType, ReactElement, ReactType } from 'react'\n import { Component } from 'react'\n\n export interface NavigationOptions {\n page: string\n params?: any\n }\n\n export interface RenderContextProps {\n runtime: {\n navigate: (options: NavigationOptions) => void\n }\n }\n\n interface ExtensionPointProps {\n id: string\n [key: string]: any\n }\n\n export const ExtensionPoint: ComponentType<ExtensionPointProps>\n export const useTreePath: any\n\n interface ChildBlockProps {\n id: string\n }\n\n export const ChildBlock: ComponentType<ChildBlockProps>\n export const useChildBlock = function ({ id: string }): object {}\n\n export const Helmet: ReactElement\n export const Link: ReactType\n export const NoSSR: ReactElement\n export const RenderContextConsumer: ReactElement\n export const canUseDOM: boolean\n export const withRuntimeContext: <TOriginalProps extends {}>(\n Component: ComponentType<TOriginalProps & RenderContextProps>\n ) => ComponentType<TOriginalProps>\n}\n\n```"
}
] |
code_product-comparison_ce78bb71
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/typings/vtex.store-icons.d.ts from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\ndeclare module 'vtex.store-icons' {\n import type { ComponentType } from 'react'\n\n interface Props {\n size: number\n viewBox?: string\n orientation?: string\n type?: string\n }\n\n export const IconClose: ComponentType<Props>\n}\n\n```"
}
] |
code_product-comparison_02217a67
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/typings/global.d.ts from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\n/* eslint-disable @typescript-eslint/no-explicit-any */\ninterface ToastInput {\n message: string\n action?: {\n label: string\n onClick: () => void\n }\n}\n\ninterface ProductToCompare {\n productId: string\n skuId: string\n}\ninterface Sku {\n itemId: string\n [key: string]: any | unknown\n}\n\ninterface Product {\n productId: string\n [key: string]: any | unknown\n}\n\ninterface ComparisonItem {\n imageUrl: string\n product: Product\n selectedSku: Sku\n}\n\ninterface ComparisonThumbnail {\n productId: string\n skuId: string\n productName: string\n skuName: string\n imageUrl: string\n}\n\ninterface CommercialOffer {\n [key: string]: any | unknown\n}\n\ninterface SkuImage {\n imageUrl: string\n imageTag: string\n}\n\ninterface Styles {\n [key: string]: any | unknown\n}\n\ninterface GroupedComparisonFields {\n [key: string]: ComparisonField[]\n}\n\ninterface ComparisonField {\n fieldType: string\n groupName?: string\n name: string\n displayValue: string\n showOnSite: boolean\n}\n\ninterface ProductSpecificationGroup {\n name: string\n originalName: string\n specifications: ProductSpecification[]\n}\n\ninterface ProductSpecification {\n name: string\n values: string[]\n groupName?: string\n}\n\ninterface Variation {\n name: string\n values: string[]\n}\n\ninterface SpecificationGroupValues {\n [key: string]: ProductSpecification[]\n}\n\n```"
}
] |
code_product-comparison_9d43f2bf
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/typings/css.d.ts from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\ndeclare module '*.css' {\n const css: any\n export default css\n}\n\n```"
}
] |
code_product-comparison_f4d60c11
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/typings/graphql.d.ts from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\ndeclare module '*.graphql' {\n import type { DocumentNode } from 'graphql'\n\n const value: DocumentNode\n export default value\n}\n\n```"
}
] |
code_product-comparison_83d5ab82
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/typings/vtex.store-resources.d.ts from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\ndeclare module 'vtex.store-resources/Queries' {\n import type { DocumentNode } from 'graphql'\n\n export const orderForm: DocumentNode\n}\n\ndeclare module 'vtex.store-resources/QueryProduct' {\n import type { DocumentNode } from 'graphql'\n\n const document: DocumentNode\n export = document\n}\n\n```"
}
] |
code_product-comparison_3f1fbc8b
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/typings/vtex.styleguide.d.ts from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\n/* eslint-disable @typescript-eslint/no-explicit-any */\ndeclare module 'vtex.styleguide' {\n import type { ComponentType } from 'react'\n\n export const Input: ComponentType<InputProps>\n export const Checkbox: ComponentType<InputProps>\n export const Button: ComponentType<InputProps>\n export const Collapsible: ComponentType<InputProps>\n export const Layout: ComponentType<InputProps>\n export const PageHeader: ComponentType<InputProps>\n export const PageBlock: ComponentType<InputProps>\n export const ToastProvider: ComponentType<InputProps>\n export const Spinner: ComponentType<InputProps>\n export const ToastConsumer: ComponentType<InputProps>\n export const Dropdown: ComponentType<InputProps>\n export const withToast\n\n interface InputProps {\n [key: string]: any\n }\n}\n\n```"
}
] |
code_product-comparison_5017c7b8
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/queries/productsByIdentifier.graphql from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```graphql\nquery productsByIdentifier($ids: [ID!]) {\n productsByIdentifier(field: id, values: $ids)\n @context(provider: \"vtex.search-graphql\") {\n cacheId\n productId\n productName\n description\n categories\n categoryTree {\n name\n href\n }\n link\n linkText\n brand\n items {\n name\n itemId\n referenceId {\n Value\n }\n images {\n imageUrl\n imageTag\n }\n sellers {\n sellerId\n commertialOffer {\n Installments {\n Value\n InterestRate\n TotalValuePlusInterestRate\n NumberOfInstallments\n Name\n }\n AvailableQuantity\n Price\n ListPrice\n }\n }\n }\n productClusters {\n id\n name\n }\n }\n}\n```"
}
] |
code_product-comparison_40f0e1f4
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/queries/productThumbnails.graphql from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```graphql\nquery Product(\n $slug: String\n $identifier: ProductUniqueIdentifier\n $skipCategoryTree: Boolean = false\n) {\n product(slug: $slug, identifier: $identifier)\n @context(provider: \"vtex.search-graphql\") {\n cacheId\n productName\n productId\n categoryTree @skip(if: $skipCategoryTree) {\n id\n name\n href\n }\n items {\n itemId\n name\n nameComplete\n images {\n imageId\n imageLabel\n imageUrl\n imageText\n }\n }\n }\n}\n```"
}
] |
code_product-comparison_d8bd7120
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/queries/AppSettings.graphql from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```graphql\nquery AppSettings($version: String) {\n publicSettingsForApp(app: \"vtex.product-comparison\", version: $version)\n @context(provider: \"vtex.apps-graphql\") {\n message\n }\n}\n\n```"
}
] |
code_product-comparison_54ececdc
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/__tests__/index.test.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\n// import React from 'react'\n// import { render } from '@vtex/test-tools/react'\n// import Component from '../components/index'\n\n// describe('HelloWorld Component', () => {\n// const { getByText } = render(<Component />)\n\n// it('should render the example in TypeScript', () => {\n// expect(getByText(/This is an example/)).toBeDefined()\n// })\n// })\n\n```"
}
] |
code_product-comparison_c7e2014f
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/components/drawer/drawer.css from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.drawer {\n}\n\n.compareProductsButton {\n}\n\n.drawerContainer {\n position: fixed;\n max-height: 500px;\n bottom: 0;\n left: 0;\n z-index: 2;\n}\n\n.drawerContainer :global(.vtex__icon-caret-up) {\n display: none;\n}\n\n.drawerContainer :global(.vtex__icon-caret-down) {\n display: none;\n}\n\n.drawerContainer :global(.vtex-product-summary-2-x-element--drawer-summary) {\n flex-direction: row;\n}\n\n.drawerContainer\n :global(.vtex-product-summary-2-x-column--drawer-summary-col2) {\n flex-direction: column;\n padding-left: 1rem;\n}\n\n.drawerContainer\n :global(.vtex-product-summary-2-x-container--drawer-summary)\n :global(.vtex-product-summary-2-x-nameContainer),\n.drawerContainer\n :global(.vtex-product-summary-2-x-container--drawer-summary)\n :global(.vtex-product-summary-2-x-priceContainer) {\n padding-top: 5px;\n padding-bottom: 5px;\n}\n\n/* .drawerContainer\n :global(.vtex-product-summary-2-x-container--drawer-summary)\n :global(.vtex-product-summary-2-x-nameContainer) {\n text-overflow: ellipsis;\n overflow: hidden;\n width: 175px;\n white-space: nowrap;\n} */\n\n.drawerContainer :global(.vtex-product-summary-2-x-container--drawer-summary) {\n max-width: 275px;\n}\n\n.expandCollapseButton {\n}\n\n.comparisonButtons {\n}\n\n```"
}
] |
code_product-comparison_e5cb3480
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/components/drawer/ComparisonDrawer.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\n/* eslint-disable jsx-a11y/click-events-have-key-events */\n/* eslint-disable jsx-a11y/no-static-element-interactions */\nimport React from 'react'\nimport { pathOr, isEmpty } from 'ramda'\nimport { Button, Collapsible, withToast } from 'vtex.styleguide'\nimport { ExtensionPoint, useRuntime } from 'vtex.render-runtime'\nimport { useCssHandles } from 'vtex.css-handles'\nimport type { InjectedIntlProps } from 'react-intl'\nimport { injectIntl, defineMessages } from 'react-intl'\n\nimport ComparisonContext from '../../ProductComparisonContext'\nimport './drawer.css'\n\nconst CSS_HANDLES = [\n 'drawerContainer',\n 'expandCollapseButton',\n 'comparisonButtons',\n 'compareProductsButton',\n 'drawer',\n 'compareProductButtonWrapper',\n 'removeAllWrapper',\n 'hideOrShowText',\n 'drawerTitleOuterContainer',\n 'drawerTitleInnerContainer',\n 'drawerOpened',\n 'drawerClosed'\n]\n\nconst messages = defineMessages({\n removeAll: {\n defaultMessage: '',\n id: 'store/product-comparison.drawer.remove-all',\n },\n products: {\n defaultMessage: '',\n id: 'store/product-comparison.drawer.products',\n },\n compare: {\n defaultMessage: '',\n id: 'store/product-comparison.drawer.compare',\n },\n removeAllMessage: {\n defaultMessage: '',\n id: 'store/product-comparison.drawer.remove-all-message',\n },\n show: {\n defaultMessage: '',\n id: 'store/product-comparison.drawer.show',\n },\n hide: {\n defaultMessage: '',\n id: 'store/product-comparison.drawer.hide',\n },\n minItemsMessage: {\n defaultMessage: '',\n id: 'store/product-comparison.drawer.min-items-message',\n },\n maxItemsMessage1: {\n defaultMessage: '',\n id: 'store/product-comparison.drawer.max-items-message-1',\n },\n maxItemsMessage2: {\n defaultMessage: '',\n id: 'store/product-comparison.drawer.max-items-message-2',\n },\n})\n\ninterface Props extends InjectedIntlProps {\n showToast?: (input: ToastInput) => void\n comparisonPageUrl?: string\n}\n\nconst ComparisonDrawer = ({ showToast, intl, comparisonPageUrl }: Props) => {\n const cssHandles = useCssHandles(CSS_HANDLES)\n const { navigate } = useRuntime()\n // const [isCollapsed, setCollapsed] = useState(false)\n const {\n useProductComparisonState,\n useProductComparisonDispatch,\n } = ComparisonContext\n\n const comparisonData = useProductComparisonState()\n const dispatchComparison = useProductComparisonDispatch()\n\n const comparisonProducts = pathOr(\n [] as ProductToCompare[],\n ['products'],\n comparisonData\n )\n\n const isCollapsed = pathOr(false, ['isDrawerCollapsed'], comparisonData)\n\n const showMessage = (message: string) => {\n if (showToast) {\n showToast({\n message,\n })\n }\n }\n\n const removeAllItems = () => {\n dispatchComparison({\n type: 'REMOVE_ALL',\n })\n showMessage(intl.formatMessage(messages.removeAllMessage))\n }\n\n const onExpandCollapse = () => {\n dispatchComparison({\n args: {\n isDrawerCollapsed: !isCollapsed,\n },\n type: 'IS_DRAWER_COLLAPSED',\n })\n }\n\n const onClickCompare = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n if (!comparisonProducts || comparisonProducts.length < 2) {\n showMessage(intl.formatMessage(messages.minItemsMessage))\n e.preventDefault()\n e.stopPropagation()\n } else if (comparisonProducts.length > 10) {\n showMessage(\n `${intl.formatMessage(\n messages.maxItemsMessage1\n )} ${10} ${intl.formatMessage(messages.maxItemsMessage2)}`\n )\n e.preventDefault()\n e.stopPropagation()\n }\n }\n\n const navigateToComparisonPage = () => {\n const url =\n comparisonProducts.length < 2\n ? '#'\n : comparisonPageUrl || '/product-comparison'\n\n navigate({ to: url })\n }\n\n return isEmpty(comparisonProducts) ? (\n <div />\n ) : (\n <div\n className={`${cssHandles.drawerContainer} ${isCollapsed ? cssHandles.drawerClosed : cssHandles.drawerOpened} bg-white w-100 bt-ns b--light-gray flex justify-center`}\n >\n <div className=\"mw9 w-100 \">\n <Collapsible\n header={\n <div\n className={`${cssHandles.comparisonButtons} flex flex-row ma3`}\n >\n <div className={`flex items-center-ns mr2 ml2 ${cssHandles.drawerTitleOuterContainer}`}>\n <span className={`fw5 black ${cssHandles.drawerTitleInnerContainer}`}>\n <span>{intl.formatMessage(messages.compare)} </span>{' '}\n <span>{comparisonProducts.length}</span>{' '}\n <span>{intl.formatMessage(messages.products, { productsLength: comparisonProducts.length })}</span>\n </span>\n </div>\n <div className=\"flex-grow-1\" />\n <div className=\"flex mr2 ml2\">\n <button\n onClick={onExpandCollapse}\n className={`${cssHandles.expandCollapseButton} bg-transparent bn-ns t-small c-action-primary hover-c-action-primary pointer`}\n >\n <span className={cssHandles.hideOrShowText}>\n {!isCollapsed\n ? intl.formatMessage(messages.hide)\n : intl.formatMessage(messages.show)}\n </span>\n </button>\n </div>\n <div className={`flex mr2 ml2 ${cssHandles.removeAllWrapper}`}>\n <Button\n block\n variation=\"danger-tertiary\"\n size=\"small\"\n onClick={removeAllItems}\n >\n {intl.formatMessage(messages.removeAll)}\n </Button>\n </div>\n <div\n className={`flex mr2 ml2 ${cssHandles.compareProductButtonWrapper}`}\n onClick={onClickCompare}\n >\n <Button\n block\n size=\"small\"\n className={`${cssHandles.compareProductsButton} ma3`}\n onClick={navigateToComparisonPage}\n >\n {intl.formatMessage(messages.compare)}\n </Button>\n </div>\n </div>\n }\n isOpen={!isCollapsed}\n >\n <div\n className={`${cssHandles.drawer} flex flex-row justify-center pl3 pr3`}\n >\n <ExtensionPoint id=\"list-context.comparison-product-summary-slider\" />\n </div>\n </Collapsible>\n </div>\n </div>\n )\n}\n\nComparisonDrawer.schema = {\n title: 'admin/editor.comparison-drawer.title',\n description: 'admin/editor.comparison-drawer.description',\n type: 'object',\n properties: {\n comparisonPageUrl: {\n title: 'admin/editor.comparison-grid.drawer.title',\n type: 'string',\n },\n },\n}\n\nexport default withToast(injectIntl(ComparisonDrawer))\n\n```"
}
] |
code_product-comparison_b55d05b8
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/components/productSelector/ProductSelector.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\n/* eslint-disable jsx-a11y/no-static-element-interactions */\nimport type { MouseEvent } from 'react'\nimport React, { useState, useEffect } from 'react'\nimport { pathOr, find, propEq, allPass, isEmpty } from 'ramda'\nimport { Checkbox, withToast } from 'vtex.styleguide'\nimport { useCssHandles } from 'vtex.css-handles'\nimport { useProductSummary } from 'vtex.product-summary-context/ProductSummaryContext'\nimport type { InjectedIntlProps } from 'react-intl'\nimport { injectIntl, defineMessages } from 'react-intl'\nimport { useProduct } from 'vtex.product-context'\n\nimport ComparisonContext from '../../ProductComparisonContext'\n\nconst CSS_HANDLES = ['productSelectorContainer']\n\nconst messages = defineMessages({\n product: {\n defaultMessage: '',\n id: 'store/product-comparison.product-selector.product',\n },\n added: {\n defaultMessage: '',\n id: 'store/product-comparison.product-selector.product-added',\n },\n removed: {\n defaultMessage: '',\n id: 'store/product-comparison.product-selector.product-removed',\n },\n compare: {\n defaultMessage: '',\n id: 'store/product-comparison.product-selector.compare',\n },\n comparisonUpperLimit: {\n defaultMessage: '',\n id: 'store/product-comparison.product-selector.upper-limit-exceeded',\n },\n})\n\ninterface Props extends InjectedIntlProps {\n showToast?: (input: ToastInput) => void\n}\nconst getContextValue = (\n productContext: unknown,\n productSummaryContext: unknown\n) => {\n let contextValue = productSummaryContext !== undefined? productSummaryContext : productContext\n let productId = pathOr('', ['product', 'productId'], contextValue)\n let productName = pathOr('', ['product', 'productName'], contextValue)\n let itemId = pathOr('', ['selectedItem', 'itemId'], contextValue)\n return { productName, productId, itemId }\n}\nconst ProductSelector = ({ showToast, intl }: Props) => {\n const cssHandles = useCssHandles(CSS_HANDLES)\n const [isChecked, setIsChecked] = useState(false)\n const valuesFromContext = useProductSummary()\n const valuesFromProductContext = useProduct()\n const {productId, productName, itemId} = getContextValue(\n valuesFromProductContext,\n valuesFromContext\n )\n const {\n useProductComparisonState,\n useProductComparisonDispatch,\n } = ComparisonContext\n\n const comparisonData = useProductComparisonState()\n const dispatchComparison = useProductComparisonDispatch()\n\n\n const isDrawerCollapsed = pathOr(false, ['isDrawerCollapsed'], comparisonData)\n const productsSelected = pathOr([], ['products'], comparisonData)\n const maxItemsToCompare = pathOr(\n 0,\n ['maxNumberOfItemsToCompare'],\n comparisonData\n )\n\n useEffect(() => {\n const selectedProducts =\n productId && itemId\n ? find(\n allPass([propEq('productId', productId), propEq('skuId', itemId)])\n )(productsSelected)\n : []\n\n setIsChecked(selectedProducts && !isEmpty(selectedProducts))\n }, [productsSelected, itemId, productId])\n\n const showMessage = (message: string, show = true) => {\n if (showToast && show) {\n showToast({\n message,\n })\n }\n }\n\n const productSelectorChanged = (e: { target: { checked: boolean } }) => {\n if (e.target.checked && productsSelected.length === maxItemsToCompare) {\n setIsChecked(false)\n showMessage(`${intl.formatMessage(messages.comparisonUpperLimit)}`, true)\n } else if (e.target.checked) {\n dispatchComparison({\n args: {\n product: { productId, skuId: itemId },\n },\n type: 'ADD',\n })\n showMessage(\n `${intl.formatMessage(\n messages.product\n )} \"${productName}\" ${intl.formatMessage(messages.added)}`,\n isDrawerCollapsed\n )\n } else {\n dispatchComparison({\n args: {\n product: { productId, skuId: itemId },\n },\n type: 'REMOVE',\n })\n showMessage(\n `${intl.formatMessage(\n messages.product\n )} \"${productName}\" ${intl.formatMessage(messages.removed)}`,\n isDrawerCollapsed\n )\n }\n }\n\n const productSelectionOnClicked = (e: MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n }\n\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\n <div\n onClick={productSelectionOnClicked}\n className={`${cssHandles.productSelectorContainer} mb3`}\n >\n <Checkbox\n checked={isChecked}\n id={`${productId}-${itemId}-product-comparison`}\n label={intl.formatMessage(messages.compare)}\n name={`${productId}-${itemId}-product-comparison`}\n onChange={productSelectorChanged}\n value={isChecked}\n />\n </div>\n )\n}\n\nexport default withToast(injectIntl(ProductSelector))\n\n```"
}
] |
code_product-comparison_8c1be33d
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/components/utils/fieldUtils.ts from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport { split, trim, without } from 'ramda'\n\nexport const splitString = (text?: string) => {\n if (!(text && text.length > 0)) {\n return []\n }\n\n return split(',', text)\n .filter((str) => str !== null && str !== '')\n .map((str) => trim(str))\n}\n\nexport const getProductSpecificationFields = (\n existing: string[],\n fieldsToHide?: string\n) => {\n const removeList = splitString(fieldsToHide)\n\n return without(removeList, existing)\n}\n\nexport const getSkuSpecificationFields = (\n existing: string[],\n fieldsToHide?: string\n) => {\n const removeList = splitString(fieldsToHide)\n\n return without(removeList, existing)\n}\n\nexport const getProductFields = (fieldsToHide?: string) => {\n const fieldNames = ['productName', 'brand', 'description', 'productReference']\n const removeList = splitString(fieldsToHide)\n const fieldsSelected = without(removeList, fieldNames)\n\n const fields = fieldsSelected.map((fieldName) => {\n let value = {}\n\n switch (fieldName) {\n case 'productName':\n value = {\n fieldType: 'ProductField',\n name: 'productName',\n displayValue: 'Product Name',\n showOnSite: true,\n }\n break\n\n case 'brand':\n value = {\n fieldType: 'ProductField',\n name: 'brand',\n displayValue: 'Brand',\n showOnSite: true,\n }\n break\n\n case 'description':\n value = {\n fieldType: 'ProductField',\n name: 'description',\n displayValue: 'Product Description',\n showOnSite: true,\n }\n break\n\n case 'productReference':\n value = {\n fieldType: 'ProductField',\n name: 'productReference',\n displayValue: 'Product Reference',\n showOnSite: true,\n }\n break\n\n default:\n value = {\n fieldType: '',\n name: '',\n displayValue: '',\n showOnSite: false,\n }\n break\n }\n\n return value as ComparisonField\n })\n\n return fields\n}\n\nexport const getSkuFields = (fieldsToHide?: string) => {\n const fieldNames = ['name', 'ean']\n const removeList = splitString(fieldsToHide)\n const fieldsSelected = without(removeList, fieldNames)\n\n const fields = fieldsSelected.map((fieldName) => {\n let value = {}\n\n switch (fieldName) {\n case 'name':\n value = {\n fieldType: 'SkuField',\n name: 'name',\n displayValue: 'Sku Name',\n showOnSite: true,\n }\n break\n\n case 'ean':\n value = {\n fieldType: 'SkuField',\n name: 'ean',\n displayValue: 'Ean',\n showOnSite: true,\n }\n break\n\n default:\n value = {\n fieldType: '',\n name: '',\n displayValue: '',\n showOnSite: false,\n }\n break\n }\n\n return value as ComparisonField\n })\n\n return fields\n}\n\n```"
}
] |
code_product-comparison_0253f348
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/components/utils/resolveSlidesNumber.ts from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\n// /**\n// * This function returns the number of slides to show depending on the size of the window.\n// * If you pass a number it just returns that number.\n// * If you pass an object it will return the number of slides of the closest breakpoint to the size of the window.\n// * If you pass for example\n// * perPage = {\n// * 400: 2,\n// * 1000: 3\n// * }\n// *\n// * If the size of the window is something between 400px and 999px if will return 2,\n// * if it is 1000px or bigger, it will return 3, and if it is smaller than 400px it\n// * will return the default value; that is, 1.\n// * @param {number|object} perPage\n// * @param {number|undefined} minPerPage\n// */\n// const resolveSlidesNumber = (\n// minPerPage: number,\n// perPage: number | object,\n// isMobile: boolean\n// ) => {\n// let result = minPerPage || 1\n// if (typeof perPage === 'number') {\n// result = perPage\n// } else if (typeof perPage === 'object') {\n// const innerWidth = window && window.innerWidth\n\n// /** If it's on SSR, use placeholder screen sizes to get an approximate\n// * guess of how many items are displayed per page */\n// const windowSize = innerWidth || (isMobile ? 320 : 1024)\n\n// // for (const viewport in perPage) {\n// // if (windowSize >= viewport) {\n// // result = perPage[viewport]\n// // }\n// // }\n// }\n// return result < minPerPage ? minPerPage : result\n// }\n\n// export default resolveSlidesNumber\n\n```"
}
] |
code_product-comparison_a66736d4
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/components/utils/normalize.ts from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport { pathOr, find, propEq } from 'ramda'\n\nexport const DEFAULT_WIDTH = 'auto'\nexport const DEFAULT_HEIGHT = 'auto'\nexport const MAX_WIDTH = 3000\nexport const MAX_HEIGHT = 4000\n\n/**\n * Having the url below as base for the LEGACY file manager,\n * https://storecomponents.vteximg.com.br/arquivos/ids/155472/Frame-3.jpg?v=636793763985400000\n * the following regex will match https://storecomponents.vteximg.com.br/arquivos/ids/155472\n *\n * Also matches urls with defined sizes like:\n * https://storecomponents.vteximg.com.br/arquivos/ids/155473-160-auto\n * @type {RegExp}\n *\n * On the new vtex.file-manager isn't necessary replace the URL, just add the param on the querystring, like:\n * \"?width=WIDTH&height=HEIGHT&aspect=true\"\n *\n */\nconst baseUrlRegex = new RegExp(/.+ids\\/(\\d+)/)\n\nconst httpRegex = new RegExp(/http:\\/\\//)\n\nconst toHttps = (url: string) => {\n return url.replace(httpRegex, 'https://')\n}\n\nconst cleanImageUrl = (imageUrl: string) => {\n const result = baseUrlRegex.exec(imageUrl)\n\n return result && result.length > 0 ? result[0] : ''\n}\n\nconst replaceLegacyFileManagerUrl = (\n imageUrl: string,\n width: number | string,\n height: number | string\n) => {\n const legacyUrlPattern = '/arquivos/ids/'\n const isLegacyUrl = imageUrl.includes(legacyUrlPattern)\n\n if (!isLegacyUrl) return imageUrl\n\n return `${cleanImageUrl(imageUrl)}-${width}-${height}`\n}\n\nexport function changeImageUrlSize(\n imageUrl: string,\n width: number | string = DEFAULT_WIDTH,\n height: number | string = DEFAULT_HEIGHT\n) {\n if (!imageUrl) return\n typeof width === 'number' && (width = Math.min(width, MAX_WIDTH))\n typeof height === 'number' && (height = Math.min(height, MAX_HEIGHT))\n\n const normalizedImageUrl = replaceLegacyFileManagerUrl(\n imageUrl,\n width,\n height\n )\n\n const queryStringSeparator = normalizedImageUrl.includes('?') ? '&' : '?'\n\n return `${normalizedImageUrl}${queryStringSeparator}width=${width}&height=${height}&aspect=true`\n}\n\nconst defaultImage = { imageUrl: '', imageLabel: '' }\nconst defaultReference = { Value: '' }\nconst defaultSeller = { commertialOffer: { Price: 0, ListPrice: 0 } }\n\nconst resizeImage = (url: string, imageSize: number) =>\n changeImageUrlSize(toHttps(url), imageSize)\n\nexport const mapCatalogProductToProductSummary = (\n product: Product,\n skuId: string,\n imageSize = 500\n) => {\n // eslint-disable-next-line @typescript-eslint/no-object-literal-type-assertion\n if (!product) return {} as Product\n const normalizedProduct = { ...product }\n const items = normalizedProduct.items || []\n const sku = find(propEq('itemId', skuId))(items)\n\n if (sku) {\n const [seller = defaultSeller] = pathOr([], ['sellers'], sku)\n const [referenceId = defaultReference] = pathOr([], ['referenceId'], sku)\n const catalogImages: SkuImage[] = pathOr([], ['images'], sku)\n const normalizedImages = catalogImages.map((image) => ({\n ...image,\n imageUrl: resizeImage(image.imageUrl, imageSize),\n }))\n\n const [image = defaultImage] = normalizedImages\n\n normalizedProduct.sku = {\n ...sku,\n seller,\n referenceId,\n image,\n images: normalizedImages,\n }\n }\n\n return normalizedProduct\n}\n\n```"
}
] |
code_product-comparison_c6d2f727
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/components/comparisonPageRow/ProductSummaryRow.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React, { useState, useEffect } from 'react'\nimport { pathOr, isEmpty } from 'ramda'\nimport { ExtensionPoint } from 'vtex.render-runtime'\nimport { useCssHandles } from 'vtex.css-handles'\nimport { Checkbox } from 'vtex.styleguide'\n\nimport ComparisonProductContext from '../../ComparisonProductContext'\n\nimport './row.css'\nimport { usePixel } from 'vtex.pixel-manager'\nimport type { InjectedIntlProps } from 'react-intl'\nimport { injectIntl, defineMessages } from 'react-intl'\n\nimport ComparisonContext from '../../ProductComparisonContext'\nimport type { Dispatch } from '../../ProductComparisonContext'\n\ninterface ProductSummaryRowProps extends InjectedIntlProps {\n isShowDifferenceDefault: boolean\n}\n\nconst CSS_HANDLES = [\n 'productSummaryRowContainer',\n 'fieldNameCol',\n 'showDifferencesContainer',\n]\n\nconst setShowDifferenceFirstTime = (\n isShowDifferenceDefault: boolean,\n dispatchComparison: Dispatch\n) => {\n dispatchComparison({\n args: {\n showDifferences: isShowDifferenceDefault,\n },\n type: 'SET_SHOW_DIFFERENCES',\n })\n}\n\nconst messages = defineMessages({\n showDifferences: {\n defaultMessage: '',\n id: 'store/product-comparison.product-summary-row.show-differences',\n },\n})\n\nconst ProductSummaryRow = ({\n isShowDifferenceDefault,\n intl,\n}: ProductSummaryRowProps) => {\n const cssHandles = useCssHandles(CSS_HANDLES)\n\n const [isShowDifferenceByDefault, changesChecked] = useState(\n isShowDifferenceDefault\n )\n\n const [showDifferences, setShowDifferences] = useState(false)\n const {\n useProductComparisonState,\n useProductComparisonDispatch,\n } = ComparisonContext\n\n const { useComparisonProductState } = ComparisonProductContext\n\n const productData = useComparisonProductState()\n const comparisonData = useProductComparisonState()\n const dispatchComparison = useProductComparisonDispatch()\n\n const comparisonProducts = pathOr(\n [] as ProductToCompare[],\n ['products'],\n comparisonData\n )\n\n const products = pathOr([] as ProductToCompare[], ['products'], productData)\n\n useEffect(() => {\n setShowDifferenceFirstTime(isShowDifferenceByDefault, dispatchComparison)\n }, [])\n\n const { push } = usePixel()\n\n const pixelEvent = (products: object, length: number) => {\n if (!!length && length >= 2) {\n push({\n event: 'productComparison',\n products,\n compareProductN: length,\n })\n }\n }\n\n useEffect(() => {\n pixelEvent(comparisonData.products, comparisonData.products.length)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n useEffect(() => {\n const showDifferences =\n comparisonData.products &&\n comparisonData.products.length > 1 &&\n comparisonData.showDifferences\n\n setShowDifferences(showDifferences)\n }, [comparisonData])\n\n const onSelectorChanged = (e: { target: { checked: boolean } }) => {\n changesChecked(!isShowDifferenceByDefault)\n dispatchComparison({\n args: {\n showDifferences: e.target.checked,\n },\n type: 'SET_SHOW_DIFFERENCES',\n })\n }\n\n return isEmpty(comparisonProducts) ? (\n <div />\n ) : (\n <div\n className={`mw9 ${cssHandles.productSummaryRowContainer} flex flex-row mt6 pa3`}\n >\n <div className={`${cssHandles.fieldNameCol} w-20 flex items-end ma1 pa3`}>\n {comparisonProducts.length > 1 && products ? (\n <div className={`${cssHandles.showDifferencesContainer} mb3`}>\n <Checkbox\n checked={showDifferences}\n id=\"id-differences\"\n label={intl.formatMessage(messages.showDifferences)}\n name=\"name-differences\"\n onChange={onSelectorChanged}\n value={showDifferences}\n />\n </div>\n ) : (\n <div />\n )}\n </div>\n <ExtensionPoint id=\"list-context.comparison-product-summary-slider\" />\n </div>\n )\n}\n\nProductSummaryRow.schema = {\n title: 'editor.product-summary-row.title',\n description: 'editor.product-summary-row.description',\n type: 'object',\n properties: {\n isShowDifferenceDefault: {\n title: 'Show difference',\n description: '',\n default: false,\n type: 'boolean',\n },\n },\n}\nexport default injectIntl(ProductSummaryRow)\n\n```"
}
] |
code_product-comparison_8451dbb1
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/components/comparisonPageRow/ComparisonFieldValue.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { pathOr, find, propEq, findLast } from 'ramda'\nimport { useCssHandles } from 'vtex.css-handles'\n\nimport ComparisonProductContext from '../../ComparisonProductContext'\nimport './row.css'\n\nconst CSS_HANDLES = [\n 'productFieldValue',\n 'skuFieldValue',\n 'productSpecificationValues',\n 'productSpecificationValue',\n 'skuSpecificationValues',\n 'skuSpecificationValue',\n]\n\ninterface Props {\n productToCompare: ProductToCompare\n field: ComparisonField\n}\nconst ComparisonFieldValue = ({ field, productToCompare }: Props) => {\n const cssHandles = useCssHandles(CSS_HANDLES)\n const { useComparisonProductState } = ComparisonProductContext\n const productData = useComparisonProductState()\n\n const products = pathOr([] as ProductToCompare[], ['products'], productData)\n const selectedProduct = find(propEq('productId', productToCompare.productId))(\n products\n )\n\n const selectedSku = find(propEq('itemId', productToCompare.skuId))(\n pathOr([], ['items'], selectedProduct)\n )\n\n if (field.fieldType === 'ProductField') {\n return (\n <span className={cssHandles.productFieldValue}>\n {pathOr('', [field.name], selectedProduct)}\n </span>\n )\n }\n\n if (field.fieldType === 'SkuField') {\n return (\n <span className={cssHandles.skuFieldValue}>\n {pathOr('', [field.name], selectedSku)}\n </span>\n )\n }\n\n if (field.fieldType === 'ProductSpecificationField') {\n const groups = pathOr([], ['specificationGroups'], selectedProduct)\n const allSpecifications = findLast(propEq('name', 'allSpecifications'))(\n groups\n )\n\n const specifications = pathOr([], ['specifications'], allSpecifications)\n\n const values = pathOr(\n [],\n ['values'],\n find(propEq('name', field.name))(specifications)\n )\n\n return (\n <div\n className={`${cssHandles.productSpecificationValues} flex flex-column`}\n >\n {values.map((value) => {\n return (\n <span\n className={`${cssHandles.productSpecificationValue}`}\n key={`${field.fieldType}-${field.name}-${value}`}\n >\n {value}\n </span>\n )\n })}\n </div>\n )\n }\n\n if (field.fieldType === 'SkuSpecificationField') {\n const skuSpecifications = pathOr([], ['variations'], selectedSku)\n const values = pathOr(\n [],\n ['values'],\n find(propEq('name', field.name))(skuSpecifications)\n )\n\n return (\n <div className={`${cssHandles.skuSpecificationValues} flex flex-column`}>\n {values.map((value) => {\n return (\n <span\n className={`${cssHandles.skuSpecificationValue}`}\n key={`${field.fieldType}-${field.name}-${value}`}\n >\n {value}\n </span>\n )\n })}\n </div>\n )\n }\n\n if (field.fieldType === 'GroupedSpecification') {\n const groups = pathOr([], ['specificationGroups'], selectedProduct)\n const groupedSpecification = findLast(propEq('name', field.groupName))(\n groups\n )\n\n const specifications = pathOr([], ['specifications'], groupedSpecification)\n\n const values = pathOr(\n [],\n ['values'],\n find(propEq('name', field.name))(specifications)\n )\n\n return (\n <div\n className={`${cssHandles.productSpecificationValues} flex flex-column`}\n >\n {values.map((value) => {\n return (\n <span\n className={`${cssHandles.productSpecificationValue}`}\n key={`${field.fieldType}-${field.name}-${value}`}\n >\n {value}\n </span>\n )\n })}\n </div>\n )\n }\n\n return <div />\n}\n\nexport default ComparisonFieldValue\n\n```"
}
] |
code_product-comparison_9c3258d0
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/components/comparisonPageRow/ComparisonFieldRow.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { ExtensionPoint } from 'vtex.render-runtime'\nimport { useCssHandles } from 'vtex.css-handles'\nimport './row.css'\n\nconst CSS_HANDLES = ['rowContainer', 'fieldNameCol']\n\ninterface Props {\n field: ComparisonField\n}\n\nconst ComparisonFieldRow: StorefrontFunctionComponent<Props> = ({\n field,\n}: Props) => {\n const cssHandles = useCssHandles(CSS_HANDLES)\n\n return field && field.name && field.fieldType && field.showOnSite ? (\n <div\n className={`${cssHandles.rowContainer} flex flex-row`}\n key={`field-${field.name}`}\n >\n <div className={`${cssHandles.fieldNameCol} w-100 ma1 pa3`}>\n <span>{field.displayValue}</span>\n </div>\n <ExtensionPoint id=\"list-context.comparison-row\" field={field} />\n </div>\n ) : null\n}\n\nexport default ComparisonFieldRow\n\n```"
}
] |
code_product-comparison_75f7d442
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/components/comparisonPageRow/ComparisonGridRowContent.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport type { ReactChildren, ReactChild } from 'react'\nimport React, { useMemo } from 'react'\nimport { pathOr } from 'ramda'\nimport { useListContext, ListContextProvider } from 'vtex.list-context'\nimport { ProductListContext } from 'vtex.product-list-context'\nimport { useCssHandles } from 'vtex.css-handles'\n\nimport ProductSummeryListEventCaller from '../productSummaryList/ProductSummeryListEventCaller'\nimport ComparisonContext from '../../ProductComparisonContext'\nimport ComparisonProductContext from '../../ComparisonProductContext'\nimport ComparisonFieldValue from './ComparisonFieldValue'\nimport './row.css'\n\nconst CSS_HANDLES = ['comparisonCol']\n\ninterface Props {\n field: ComparisonField\n children: ReactChildren | ReactChild\n products: Product[]\n comparisonProducts: ProductToCompare[]\n}\n\nconst List = ({ children, comparisonProducts, field }: Props) => {\n const cssHandles = useCssHandles(CSS_HANDLES)\n const { list } = useListContext()\n\n const newListContextValue = useMemo(() => {\n const componentList =\n comparisonProducts &&\n comparisonProducts.map((comparisonProduct) => {\n return (\n <div\n key={`${comparisonProduct.productId}-col`}\n className={`${cssHandles.comparisonCol} w-100 ma1 pa3`}\n >\n <ComparisonFieldValue\n field={field}\n productToCompare={comparisonProduct}\n />\n </div>\n )\n })\n\n return list.concat(componentList)\n }, [comparisonProducts, cssHandles, field, list])\n\n return (\n <ListContextProvider list={newListContextValue}>\n {children}\n </ListContextProvider>\n )\n}\n\nconst ComparisonGridRowContent = ({ children, field }: Props) => {\n const { ProductListProvider } = ProductListContext\n const { useProductComparisonState } = ComparisonContext\n const { useComparisonProductState } = ComparisonProductContext\n\n const comparisonData = useProductComparisonState()\n const productData = useComparisonProductState()\n\n const comparisonProducts = pathOr(\n [] as ProductToCompare[],\n ['products'],\n comparisonData\n )\n\n const products = pathOr([] as ProductToCompare[], ['products'], productData)\n\n return (\n <ProductListProvider listName=\"row-content\">\n <List\n products={products}\n comparisonProducts={comparisonProducts}\n field={field}\n >\n {children}\n </List>\n <ProductSummeryListEventCaller />\n </ProductListProvider>\n )\n}\n\nexport default ComparisonGridRowContent\n\n```"
}
] |
code_product-comparison_53da6833
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/components/comparisonPageRow/row.css from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.productSummaryRowContainer\n :global(.vtex-product-summary-2-x-nameContainer) {\n display: flex;\n justify-content: center;\n}\n\n.rowContainer:nth-child(even) {\n background-color: #F2F4F5;\n}\n\n.rowContainer :global(.vtex-slider-layout-0-x-slide){\n margin-bottom: unset;\n}\n\n.productSummaryRowContainer :global(.vtex-slider-layout-0-x-slideChildrenContainer){\n width: 220px;\n}\n\n.productSummaryRowContainer :global(.vtex-product-summary-2-x-imageContainer){\n border-radius: 0 0 6px 6px;\n padding-bottom: 0.1rem;\n}\n\n.productSummaryRowContainer :global(.vtex-product-summary-2-x-nameContainer),\n.productSummaryRowContainer :global(.vtex-product-summary-2-x-priceContainer){\n padding-top: 0.6rem;\n padding-bottom: 0.6rem;\n}\n\n.productSummaryRowContainer :global(.vtex-product-summary-2-x-buyButtonContainer){\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n\n.productSummaryRowContainer :global(.vtex-slider-layout-0-x-slide),\n.rowContainer :global(.vtex-slider-layout-0-x-slide){\n width:220px !important;\n}\n\n.productSummaryRowContainer :global(.vtex-slider-layout-0-x-sliderTrackContainer),\n.rowContainer :global(.vtex-slider-layout-0-x-sliderTrackContainer){\n max-width: 1255px;\n}\n\n.fieldNameCol {\n min-width: 198px;\n width: 15%;\n margin-right: 5px;\n}\n\n.comparisonProductCol {\n}\n\n.productComparisonGrid {\n}\n\n.productSpecifications {\n}\n\n.skuSpecifications {\n}\n\n.productSummaryRowContainer :global(.vtex-slider-layout-0-x-sliderLayoutContainer--comparison-page),\n.rowContainer :global(.vtex-slider-layout-0-x-sliderLayoutContainer){\n width: 85%;\n}\n```"
}
] |
code_product-comparison_655fcb06
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/components/comparisonFields/ProductSpecifications.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React, { useMemo } from 'react'\nimport { pathOr, findLast, propEq, sort, uniq } from 'ramda'\nimport { useCssHandles } from 'vtex.css-handles'\n\nimport ComparisonFieldRow from '../comparisonPageRow/ComparisonFieldRow'\nimport ComparisonProductContext from '../../ComparisonProductContext'\nimport ComparisonContext from '../../ProductComparisonContext'\nimport { getProductSpecificationFields } from '../utils/fieldUtils'\nimport './fieldGroup.css'\n\nconst CSS_HANDLES = ['title']\n\ninterface Props {\n titleText: string\n productSpecificationsToHide?: string\n}\n\nconst ProductSpecifications = ({\n productSpecificationsToHide,\n titleText,\n}: Props) => {\n const cssHandles = useCssHandles(CSS_HANDLES)\n const { useComparisonProductState } = ComparisonProductContext\n const { useProductComparisonState } = ComparisonContext\n\n const comparisonData = useProductComparisonState()\n const productData = useComparisonProductState()\n const products = pathOr([] as ProductToCompare[], ['products'], productData)\n\n const allProductSpecificationsList: ComparisonField[] = useMemo(() => {\n const allProductSpecificationsList: ProductSpecification[][] = products.map(\n (product) => {\n const groups = pathOr([], ['specificationGroups'], product)\n const allSpecifications = findLast(propEq('name', 'allSpecifications'))(\n groups\n )\n\n return pathOr([], ['specifications'], allSpecifications)\n }\n )\n\n let specificationsList: string[] = allProductSpecificationsList.reduce(\n (accumulator: string[], currentValue: ProductSpecification[]) => {\n const current = currentValue.map((specification) =>\n pathOr('', ['name'], specification)\n )\n\n return [...new Set([...accumulator, ...current])]\n },\n [] as string[]\n )\n\n specificationsList = getProductSpecificationFields(\n specificationsList,\n productSpecificationsToHide\n )\n\n const productSpecificationFields = specificationsList.map(\n (specificationName) => ({\n fieldType: 'ProductSpecificationField',\n name: specificationName,\n displayValue: specificationName,\n showOnSite: true,\n })\n )\n\n if (comparisonData.showDifferences) {\n return productSpecificationFields.map((field) => {\n const specifications = allProductSpecificationsList.map(\n (specifications) => {\n return findLast(propEq('name', field.name))(specifications)\n }\n )\n\n const specificationValues = specifications.map(\n (specification: ProductSpecification) => {\n const specs = pathOr([], ['values'], specification)\n\n return sort(\n (a: string, b: string) => a.localeCompare(b),\n specs\n ).join(',')\n }\n )\n\n const uniqueSpecifications = uniq(specificationValues)\n\n return {\n ...field,\n ...{ showOnSite: uniqueSpecifications.length !== 1 },\n }\n })\n }\n\n return productSpecificationFields\n }, [productSpecificationsToHide, products, comparisonData])\n\n return allProductSpecificationsList &&\n allProductSpecificationsList.length > 0 ? (\n <div className=\"mt3\">\n <div className={`${cssHandles.title} pa5 b`}>\n <span>{titleText}</span>\n </div>\n <div>\n {allProductSpecificationsList.map((field: ComparisonField) => (\n <ComparisonFieldRow key={`field-${field.name}`} field={field} />\n ))}\n </div>\n </div>\n ) : (\n <div />\n )\n}\n\nProductSpecifications.schema = {\n title: 'admin/editor.comparison-grid.title',\n description: 'admin/editor.comparison-grid.description',\n type: 'object',\n properties: {\n titleText: {\n title: 'admin/editor.comparison-grid.titleText.title',\n type: 'string',\n },\n productSpecificationsToHide: {\n title:\n 'admin/editor.comparison-grid.product-specifications-to-be-removed.title',\n description:\n 'admin/editor.comparison-grid.product-specifications-to-be-removed.description',\n type: 'string',\n widget: {\n 'ui:widget': 'textarea',\n },\n },\n },\n}\n\nexport default ProductSpecifications\n\n```"
}
] |
code_product-comparison_343e9b8b
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/components/comparisonFields/GroupedProductSpecifications.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React, { useMemo } from 'react'\nimport { contains, pathOr, keys, findLast, propEq, sort, uniq } from 'ramda' // , findLast, propEq, sort, uniq,\nimport { useCssHandles } from 'vtex.css-handles'\n\nimport ComparisonFieldRow from '../comparisonPageRow/ComparisonFieldRow'\nimport ComparisonProductContext from '../../ComparisonProductContext'\nimport ComparisonContext from '../../ProductComparisonContext'\nimport { splitString } from '../utils/fieldUtils'\nimport './fieldGroup.css'\n\nconst CSS_HANDLES = ['title']\n\ninterface Props {\n showGroupName: boolean\n productSpecificationsToHide?: string\n productSpecificationGroupsToHide?: string\n}\n\nconst GroupedProductSpecifications = ({\n productSpecificationsToHide,\n productSpecificationGroupsToHide,\n}: Props) => {\n const cssHandles = useCssHandles(CSS_HANDLES)\n const { useComparisonProductState } = ComparisonProductContext\n const { useProductComparisonState } = ComparisonContext\n\n const comparisonData = useProductComparisonState()\n const productData = useComparisonProductState()\n const products = pathOr([] as ProductToCompare[], ['products'], productData)\n\n const specificationsToHide = splitString(productSpecificationsToHide)\n const specificationGroupsToHide = splitString(\n productSpecificationGroupsToHide\n )\n\n const allProductSpecificationsList: GroupedComparisonFields = useMemo(() => {\n const allProductSpecificationGroups: ProductSpecificationGroup[][] = products.map(\n (product) => {\n return pathOr([], ['specificationGroups'], product)\n }\n )\n\n const groupedSpecifications = allProductSpecificationGroups.reduce(\n (\n accumulator: SpecificationGroupValues,\n productSpecificationGroups: ProductSpecificationGroup[]\n ) => {\n productSpecificationGroups.forEach(\n (specificationGroup: ProductSpecificationGroup) => {\n const groupName = pathOr('', ['name'], specificationGroup)\n const specifications = pathOr(\n [],\n ['specifications'],\n specificationGroup\n )\n\n if (\n groupName !== '' &&\n !contains(groupName, specificationGroupsToHide) &&\n specifications.length > 0\n ) {\n const groupedSpecifications = pathOr(\n [] as ProductSpecification[],\n [groupName],\n accumulator\n )\n\n specifications.forEach((specification: ProductSpecification) => {\n const isExists = groupedSpecifications.find(\n (s: ProductSpecification) => s.name == specification.name\n )\n\n if (\n !isExists &&\n !contains(specification.name, specificationsToHide)\n ) {\n const gSpec: ProductSpecification = {\n ...specification,\n ...{ groupName },\n }\n\n groupedSpecifications.push(gSpec)\n }\n })\n\n accumulator = {\n ...accumulator,\n ...{ [groupName]: groupedSpecifications },\n }\n }\n }\n )\n\n return accumulator\n },\n {}\n )\n\n const selectedGroups = keys(groupedSpecifications)\n\n const groupedComparisonFields = selectedGroups.reduce(\n (accumulator: GroupedComparisonFields, currentValue: string | number) => {\n const specifications = pathOr([], [currentValue], groupedSpecifications)\n const fields: ComparisonField[] = specifications.map(\n (specification: ProductSpecification) => ({\n fieldType: 'GroupedSpecification',\n groupName: currentValue.toString(),\n name: specification.name,\n displayValue: specification.name,\n showOnSite: true,\n })\n )\n\n return {\n ...accumulator,\n ...{ [currentValue]: fields },\n }\n },\n {}\n )\n\n if (comparisonData.showDifferences) {\n const differentComparisonFields = selectedGroups.reduce(\n (\n accumulator: GroupedComparisonFields,\n currentValue: string | number\n ) => {\n const specificationFields = pathOr(\n [],\n [currentValue],\n groupedComparisonFields\n )\n\n const differentFields = [] as ComparisonField[]\n\n specificationFields.forEach((field: ComparisonField) => {\n const specificationFieldValues = products.map(\n (product: Product) => {\n const groupedSpecification = findLast(\n propEq('name', field.groupName)\n )(pathOr([], ['specificationGroups'], product))\n\n const specifications = pathOr(\n [],\n ['specifications'],\n groupedSpecification\n )\n\n const selectedSpecification = findLast(\n propEq('name', field.name)\n )(specifications)\n\n const specs = pathOr([], ['values'], selectedSpecification)\n\n return sort(\n (a: string, b: string) => a.localeCompare(b),\n specs\n ).join(',')\n }\n )\n\n const uniqueSpecifications = uniq(specificationFieldValues)\n\n if (uniqueSpecifications.length !== 1) {\n differentFields.push(field)\n }\n })\n\n return {\n ...accumulator,\n ...{ [currentValue]: differentFields },\n }\n },\n {}\n )\n\n return differentComparisonFields\n }\n\n return groupedComparisonFields\n }, [\n comparisonData.showDifferences,\n products,\n specificationGroupsToHide,\n specificationsToHide,\n ])\n\n const selectedGroups = keys(allProductSpecificationsList)\n\n return selectedGroups && selectedGroups.length > 0 ? (\n selectedGroups.map((groupName: string | number) => {\n const specifications: ComparisonField[] = pathOr(\n [],\n [groupName],\n allProductSpecificationsList\n )\n\n return (\n specifications.length > 0 && (\n <div key={groupName} className=\"mt3\">\n <div className={`${cssHandles.title} pa5 b`}>\n <span>{groupName}</span>\n </div>\n <div>\n {specifications.map((field: ComparisonField) => (\n <ComparisonFieldRow key={`field-${field.name}`} field={field} />\n ))}\n </div>\n </div>\n )\n )\n })\n ) : (\n <div />\n )\n}\n\nGroupedProductSpecifications.schema = {\n title: 'admin/editor.comparison-grid.title',\n description: 'admin/editor.comparison-grid.description',\n type: 'object',\n properties: {\n showGroupName: {\n title: 'admin/editor.comparison-grid.titleText.title',\n type: 'boolean',\n },\n productSpecificationsToHide: {\n title:\n 'admin/editor.comparison-grid.product-specifications-to-be-removed.title',\n description:\n 'admin/editor.comparison-grid.product-specifications-to-be-removed.description',\n type: 'string',\n widget: {\n 'ui:widget': 'textarea',\n },\n },\n productSpecificationGroupsToHide: {\n title:\n 'admin/editor.comparison-grid.product-specification-groups-to-be-removed.title',\n description:\n 'admin/editor.comparison-grid.product-specification-groups-to-be-removed.description',\n type: 'string',\n widget: {\n 'ui:widget': 'textarea',\n },\n },\n },\n}\n\nexport default GroupedProductSpecifications\n\n```"
}
] |
code_product-comparison_e9e9b1b1
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/components/comparisonFields/SkuSpecifications.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React, { useMemo } from 'react'\nimport { pathOr, find, findLast, propEq, sort, uniq } from 'ramda'\nimport { useCssHandles } from 'vtex.css-handles'\n\nimport ComparisonFieldRow from '../comparisonPageRow/ComparisonFieldRow'\nimport ComparisonProductContext from '../../ComparisonProductContext'\nimport ComparisonContext from '../../ProductComparisonContext'\nimport { getSkuSpecificationFields } from '../utils/fieldUtils'\nimport './fieldGroup.css'\n\nconst CSS_HANDLES = ['title']\n\ninterface Props {\n titleText: string\n skuSpecificationsToHide?: string\n}\n\nconst SkuSpecifications = ({ skuSpecificationsToHide, titleText }: Props) => {\n const cssHandles = useCssHandles(CSS_HANDLES)\n const { useComparisonProductState } = ComparisonProductContext\n const { useProductComparisonState } = ComparisonContext\n\n const comparisonData = useProductComparisonState()\n const productData = useComparisonProductState()\n const products = pathOr([] as ProductToCompare[], ['products'], productData)\n\n const skuSpecificationFields: ComparisonField[] = useMemo(() => {\n const allSkuSpecificationsList: string[][] = products.map((product) => {\n const skuSpecificationsList = pathOr([], ['skuSpecifications'], product)\n const skuSpecificationNamesList: string[] = skuSpecificationsList.reduce(\n (accumulator: string[], currentValue) => {\n return [\n ...new Set([\n ...accumulator,\n pathOr('', ['field', 'name'], currentValue),\n ]),\n ]\n },\n [] as string[]\n )\n\n return skuSpecificationNamesList.filter((name) => name !== '')\n })\n\n let specificationsList: string[] = allSkuSpecificationsList.reduce(\n (accumulator: string[], currentValue: string[]) => {\n return [...new Set([...accumulator, ...currentValue])]\n },\n [] as string[]\n )\n\n specificationsList = getSkuSpecificationFields(\n specificationsList,\n skuSpecificationsToHide\n )\n\n const skuSpecificationFieldsList = specificationsList.map(\n (specificationName) => ({\n fieldType: 'SkuSpecificationField',\n name: specificationName,\n displayValue: specificationName,\n showOnSite: true,\n })\n )\n\n if (comparisonData.products && comparisonData.showDifferences) {\n const allVariations: Variation[][] = comparisonData.products.map(\n (comparisonItem) => {\n const selectedProduct = find(\n propEq('productId', comparisonItem.productId)\n )(products)\n\n const selectedSku = find(propEq('itemId', comparisonItem.skuId))(\n pathOr([], ['items'], selectedProduct)\n )\n\n return pathOr([], ['variations'], selectedSku)\n }\n )\n\n return skuSpecificationFieldsList.map((field) => {\n const specifications = allVariations.map((variations) => {\n return findLast(propEq('name', field.name))(variations)\n })\n\n const specificationValues = specifications.map(\n (specification: ProductSpecification) => {\n const specs = pathOr([], ['values'], specification)\n\n return sort(\n (a: string, b: string) => a.localeCompare(b),\n specs\n ).join(',')\n }\n )\n\n const uniqueSpecifications = uniq(specificationValues)\n\n return {\n ...field,\n ...{ showOnSite: uniqueSpecifications.length !== 1 },\n }\n })\n }\n\n return skuSpecificationFieldsList\n }, [comparisonData, products, skuSpecificationsToHide])\n\n return skuSpecificationFields && skuSpecificationFields.length > 0 ? (\n <div className=\"mt3\">\n <div className={`${cssHandles.title} pa5 b`}>\n <span>{titleText}</span>\n </div>\n <div>\n {skuSpecificationFields.map((field: ComparisonField) => (\n <ComparisonFieldRow key={`field-${field.name}`} field={field} />\n ))}\n </div>\n </div>\n ) : (\n <div />\n )\n}\n\nSkuSpecifications.schema = {\n title: 'admin/editor.comparison-grid.title',\n description: 'admin/editor.comparison-grid.description',\n type: 'object',\n properties: {\n titleText: {\n title: 'admin/editor.comparison-grid.titleText.title',\n type: 'string',\n },\n skuSpecificationsToHide: {\n title:\n 'admin/editor.comparison-grid.sku-specifications-to-be-removed.title',\n description:\n 'admin/editor.comparison-grid.sku-specifications-to-be-removed.description',\n type: 'string',\n widget: {\n 'ui:widget': 'textarea',\n },\n },\n },\n}\n\nexport default SkuSpecifications\n\n```"
}
] |
code_product-comparison_f873251d
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/components/productRemover/RemoveButton.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport type { MouseEvent } from 'react'\nimport React from 'react'\nimport { pathOr } from 'ramda'\nimport { useProductSummary } from 'vtex.product-summary-context/ProductSummaryContext'\nimport { useCssHandles } from 'vtex.css-handles'\nimport { withToast } from 'vtex.styleguide'\nimport { IconClose } from 'vtex.store-icons'\nimport type { InjectedIntlProps } from 'react-intl'\nimport { injectIntl, defineMessages } from 'react-intl'\n\nimport ComparisonContext from '../../ProductComparisonContext'\nimport './remove.css'\n\nconst CSS_HANDLES = ['closeButton', 'closeButtonContainer']\n\nconst messages = defineMessages({\n product: {\n defaultMessage: '',\n id: 'store/product-comparison.product-selector.product',\n },\n removed: {\n defaultMessage: '',\n id: 'store/product-comparison.product-selector.product-removed',\n },\n})\n\ninterface Props extends InjectedIntlProps {\n showToast?: (input: ToastInput) => void\n}\n\nconst RemoveButton = ({ showToast, intl }: Props) => {\n const cssHandles = useCssHandles(CSS_HANDLES)\n\n const {\n useProductComparisonState,\n useProductComparisonDispatch,\n } = ComparisonContext\n\n const dispatchComparison = useProductComparisonDispatch()\n const valuesFromContext = useProductSummary()\n const productId = pathOr('', ['product', 'productId'], valuesFromContext)\n const productName = pathOr('', ['product', 'productName'], valuesFromContext)\n const itemId = pathOr('', ['selectedItem', 'itemId'], valuesFromContext)\n\n const comparisonData = useProductComparisonState()\n const isDrawerCollapsed = pathOr(false, ['isDrawerCollapsed'], comparisonData)\n\n const showMessage = (message: string, show = true) => {\n if (showToast && show) {\n showToast({\n message,\n })\n }\n }\n\n const removeProductFromCompare = (e: MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n\n dispatchComparison({\n args: {\n product: {\n productId,\n skuId: itemId,\n },\n },\n type: 'REMOVE',\n })\n showMessage(\n `${intl.formatMessage(\n messages.product\n )} \"${productName}\" ${intl.formatMessage(messages.removed)}`,\n isDrawerCollapsed\n )\n }\n\n return (\n <div\n className={`${cssHandles.closeButtonContainer} flex justify-end items-start flex-grow-1`}\n >\n <button\n className={`${cssHandles.closeButton} bg-transparent button-reset t-small pointer b--none-ns outline-0`}\n onClick={removeProductFromCompare}\n >\n <IconClose orientation=\"right\" size={12} type=\"line\" />\n </button>\n </div>\n )\n}\n\nexport default withToast(injectIntl(RemoveButton))\n\n```"
}
] |
code_product-comparison_22ff9dca
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/components/productRemover/remove.css from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.closeButton {\n font-weight: 300;\n padding: unset;\n}\n\n.closeButtonContainer {\n border-radius: 6px 6px 0 0;\n}\n\n```"
}
] |
code_product-comparison_d133e968
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/components/productSummaryList/ProductSummeryListEventCaller.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport { useProductImpression } from 'vtex.product-list-context'\n\nconst ProductSummeryListEventCaller = () => {\n useProductImpression()\n\n return null\n}\n\nexport default ProductSummeryListEventCaller\n\n```"
}
] |
code_product-comparison_65178fd2
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of product-comparison/react/components/productSummaryList/ProductSummaryList.tsx from the product-comparison VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\n// eslint-disable-next-line prettier/prettier\nimport type { ReactChildren, ReactChild } from 'react'\nimport React, { useMemo } from 'react'\nimport { pathOr, propEq, find } from 'ramda'\nimport { ExtensionPoint, useTreePath } from 'vtex.render-runtime'\nimport { useListContext, ListContextProvider } from 'vtex.list-context'\nimport { ProductListContext } from 'vtex.product-list-context'\n\nimport { mapCatalogProductToProductSummary } from '../utils/normalize'\nimport ProductSummeryListEventCaller from './ProductSummeryListEventCaller'\nimport ComparisonContext from '../../ProductComparisonContext'\nimport ComparisonProductContext from '../../ComparisonProductContext'\n\ninterface Props {\n children: ReactChildren | ReactChild\n products: Product[]\n comparisonProducts: ProductToCompare[]\n}\n\nconst List = ({ children, products, comparisonProducts }: Props) => {\n const { list } = useListContext()\n const { treePath } = useTreePath()\n\n const newListContextValue = useMemo(() => {\n const componentList =\n comparisonProducts &&\n products &&\n comparisonProducts\n .map((comparisonProduct) => {\n const selectedProduct = find(\n propEq('productId', comparisonProduct.productId)\n )(products)\n\n return mapCatalogProductToProductSummary(\n selectedProduct,\n comparisonProduct.skuId\n )\n })\n .filter((product) => pathOr('', ['productId'], product) !== '')\n .map((normalizedProduct) => {\n return (\n <ExtensionPoint\n id=\"product-summary\"\n key={`${pathOr('', ['productId'], normalizedProduct)}`}\n treePath={treePath}\n product={normalizedProduct}\n />\n )\n })\n\n return list.concat(componentList)\n }, [comparisonProducts, list, products, treePath])\n\n return (\n <ListContextProvider list={newListContextValue}>\n {children}\n </ListContextProvider>\n )\n}\n\nconst ProductSummaryList = ({ children }: Props) => {\n const { ProductListProvider } = ProductListContext\n const { useProductComparisonState } = ComparisonContext\n const { useComparisonProductState } = ComparisonProductContext\n\n const comparisonData = useProductComparisonState()\n const productData = useComparisonProductState()\n\n const comparisonProducts = pathOr(\n [] as ProductToCompare[],\n ['products'],\n comparisonData\n )\n\n const products = pathOr([] as ProductToCompare[], ['products'], productData)\n\n return (\n <ProductListProvider listName=\"product-list\">\n <List products={products} comparisonProducts={comparisonProducts}>\n {children}\n </List>\n <ProductSummeryListEventCaller />\n </ProductListProvider>\n )\n}\n\nexport default ProductSummaryList\n\n```"
}
] |
code_ffm-segment-prices-node-template_89883394
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/docs/README.md from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```markdown\n# External Price App\n\nA reference IO app to fetch segmented prices from main account.\n\n## Using VTEX Pricing as price provider\n\nIf you wish to use the VTEX Pricing as the source of your prices the app already handle that based on the priceTables configured in the user profile. You will also need to ask our support team to enable and configure the pricing hub feature.\n\nFor more information visit: [Pricing Hub documentation](https://developers.vtex.com/vtex-rest-api/docs/pricing-hub) and [Configuring price tables for specific users](https://help.vtex.com/tutorial/setting-up-price-tables-for-specific-users--5S9oDOMHNmY4K0kAewAiWY)\n\n## Implementation using external price provider\n\n1. Fork this app.\n2. In the `manifest.json` file:\n * Change the `vendor` field to the name of the account you are using.\n * Change the `name` field to one of your choosing.\n * Add your service host (e.g. `myhost.com`) in an `outbound-access` policy.\n3. In the `node/env.ts` file, add your service endpoint as follows:\n\n ```\n const ENV = {\n SERVICE_ENDPOINT: 'http://myservice.com',\n }\n \n export default ENV\n ```\n \n4. Change the ` node/clients/externalPrice.ts` file to parse data received by the external pricing app and return it in a way that Pricing Hub can understand. See more details on the specification of this format in the [Pricing Hub documentation](https://developers.vtex.com/vtex-rest-api/docs/pricing-hub).\n\n\n> ⛔ Do not change the `\"routes\"` in `node/service.json` nor the files in `node/typings/`, since they were created to reflect Pricing Hub behavior.\n\n\n```"
}
] |
code_ffm-segment-prices-node-template_bcaa97fb
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/service.json from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"memory\": 256,\n \"ttl\": 10,\n \"timeout\": 2,\n \"minReplicas\": 2,\n \"maxReplicas\": 4,\n \"workers\": 1,\n \"routes\": {\n \"price\": {\n \"path\": \"/_v/external-prices/price\",\n \"public\": false,\n \"access\": \"authorized\",\n \"policies\": [\n {\n \"effect\": \"allow\",\n \"actions\": [\"post\"],\n \"principals\": [\"vrn:vtex.vtex-id:*:*:*:user/vtexappkey-appvtex\"]\n }\n ]\n },\n \"keep-alive\": {\n \"path\": \"/_v/external-prices/keep-alive\",\n \"public\": true,\n \"policies\": [\n {\n \"effect\": \"allow\",\n \"actions\": [\"get\"]\n }\n ]\n }\n }\n}\n\n```"
}
] |
code_ffm-segment-prices-node-template_4b599ea8
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/package.json from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"dependencies\": {\n \"co-body\": \"^6.0.0\",\n \"ramda\": \"^0.25.0\"\n },\n \"devDependencies\": {\n \"@types/co-body\": \"^0.0.3\",\n \"@types/jest\": \"^24.0.18\",\n \"@types/node\": \"^12.0.0\",\n \"@types/node-fetch\": \"^2.5.8\",\n \"@types/ramda\": \"types/npm-ramda#dist\",\n \"@vtex/api\": \"6.45.12\",\n \"@vtex/test-tools\": \"^1.0.0\",\n \"@vtex/tsconfig\": \"^0.6.0\",\n \"typescript\": \"3.9.7\"\n },\n \"scripts\": {\n \"lint\": \"tsc --noEmit --pretty\"\n },\n \"version\": \"0.3.1\"\n}\n\n```"
}
] |
code_ffm-segment-prices-node-template_6d44b955
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/index.ts from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport type { ClientsConfig } from '@vtex/api'\nimport { LRUCache, method, Service } from '@vtex/api'\n\nimport { Clients } from './clients'\nimport { validate } from './handlers/validate'\nimport { fetchPrice } from './handlers/fetchPrice'\nimport { formatResponse } from './handlers/formatResponse'\n\nconst TIMEOUT_MS = 800\nconst memoryCache = new LRUCache<string, never>({ max: 5000 })\n\nconst clients: ClientsConfig<Clients> = {\n implementation: Clients,\n options: {\n default: {\n retries: 2,\n timeout: TIMEOUT_MS,\n },\n status: {\n memoryCache,\n },\n },\n}\n\nasync function keepAlive(ctx: Context) {\n ctx.set('Cache-Control', 'no-cache')\n ctx.status = 200\n}\n\nexport default new Service({\n clients,\n routes: {\n price: method({\n POST: [validate, fetchPrice, formatResponse],\n }),\n 'keep-alive': method({\n GET: keepAlive,\n }),\n },\n})\n\n```"
}
] |
code_ffm-segment-prices-node-template_a6149a07
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/env.ts from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\n// App Settings\nconst ENV = {\n SERVICE_ENDPOINT: 'YOUR_SERVICE_ENDPOINT',\n}\n\nexport default ENV\n\n```"
}
] |
code_ffm-segment-prices-node-template_e74658ef
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/clients/externalPrice.ts from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport type { InstanceOptions, IOContext } from '@vtex/api'\nimport { ExternalClient } from '@vtex/api'\n\nimport type { InputItem } from '../typings/externalPrice'\nimport ENV from '../env'\n\nexport interface ExternalPriceClient {\n getPrice: (item: InputItem) => Promise<number | undefined>\n}\n\nexport default class ExternalPrice\n extends ExternalClient\n implements ExternalPriceClient {\n constructor(context: IOContext, options?: InstanceOptions) {\n super(ENV.SERVICE_ENDPOINT, context, options)\n }\n\n public async getPrice(item: InputItem): Promise<number | undefined> {\n const result = await this.http.get(item.skuId, {\n metric: 'get-price',\n })\n\n // parse payload and return price as number\n\n return result\n }\n}\n\n```"
}
] |
code_ffm-segment-prices-node-template_66d42a65
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/clients/profileSystemClient.ts from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport type { InstanceOptions, IOContext, RequestConfig } from '@vtex/api'\nimport { JanusClient } from '@vtex/api'\nimport type { AxiosError } from 'axios'\n\nimport { statusToError } from '../utils/statusCodeUtils'\nimport type { CurrentProfile, Profile } from '../typings/profileSystem'\n\nconst FIVE_SECONDS_MS = 5 * 1000\n\nexport class ProfileSystemClient extends JanusClient {\n private baseUrl = '/api/profile-system/pvt/profiles'\n\n constructor(context: IOContext, options?: InstanceOptions) {\n super(context, {\n ...options,\n headers: {\n ...options?.headers,\n VtexIdClientAutCookie: context.authToken,\n },\n timeout: FIVE_SECONDS_MS,\n })\n }\n\n public getProfileInfo = (user: CurrentProfile, customFields?: string) =>\n this.get<Profile>(\n `${this.baseUrl}/${this.getUserIdentification(user)}/personalData`,\n {\n metric: 'profile-system-getProfileInfo',\n params: {\n extraFields: customFields,\n },\n }\n )\n\n protected get = <T>(url: string, config?: RequestConfig) =>\n this.http.get<T>(url, config).catch<AxiosError>(statusToError)\n\n private getUserIdentification = (user: CurrentProfile) =>\n user.userId ?? encodeURIComponent(user.email)\n}\n\n```"
}
] |
code_ffm-segment-prices-node-template_2d11040c
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/clients/externalPriceMock.ts from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport { IOClient } from '@vtex/api'\n\nimport type { ExternalPriceClient, } from './externalPrice'\nimport type { InputItem } from '../typings/externalPrice'\n\nexport default class ExternalPrice extends IOClient implements ExternalPriceClient {\n public async getPrice(item: InputItem): Promise<number | undefined> {\n return Number(item.skuId) * 10\n }\n}\n\n```"
}
] |
code_ffm-segment-prices-node-template_147ada9f
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/clients/index.ts from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport { IOClients } from '@vtex/api'\n\nimport ExternalPrice from './externalPriceMock'\nimport PricingClient from './pricingClient'\nimport { ProfileSystemClient } from './profileSystemClient'\n\n// Extend the default IOClients implementation with our own custom clients.\nexport class Clients extends IOClients {\n public get externalPrice() {\n return this.getOrSet('externalPrice', ExternalPrice)\n }\n\n public get pricing() {\n return this.getOrSet('pricing', PricingClient)\n }\n\n public get profileSystem() {\n return this.getOrSet('profileSystem', ProfileSystemClient)\n }\n}\n\n```"
}
] |
code_ffm-segment-prices-node-template_2ff8f589
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/clients/pricingClient.ts from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport type { InstanceOptions, IOContext } from '@vtex/api'\nimport { ExternalClient } from '@vtex/api'\n\nimport type { Quote } from '../typings/externalPrice'\n\nexport default class PricingClient extends ExternalClient {\n constructor(context: IOContext, options?: InstanceOptions) {\n super(`http://${context.account}.myvtex.com/api/pricing`, context, {\n ...options,\n headers: {\n ...options?.headers,\n Accept: 'application/vnd.vtex.pricing.v3+json',\n 'Cache-Control': 'no-cache',\n 'Content-Type': 'application/json',\n 'X-Vtex-Use-Https': 'true',\n VtexIdclientAutcookie: context.authToken ?? '',\n },\n })\n }\n\n public getPrice(skuId: string | number, priceTable: string | undefined) {\n return this.http.get<Quote>(`/prices/${skuId}/computed/${priceTable}`)\n }\n}\n\nexport interface Context {\n categories: Record<string, never>\n brands: Record<string, never>\n markupRange: null\n dateRange: null\n}\n\n```"
}
] |
code_ffm-segment-prices-node-template_2335f92f
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/typings/profileSystem.d.ts from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\ninterface Address {\n id?: string\n userId?: string\n receiverName?: string\n complement?: string\n neighborhood?: string\n country?: string\n state?: string\n number?: string\n street?: string\n postalCode?: string\n city?: string\n reference?: string\n addressName?: string\n addressType?: string\n geoCoordinates?: string\n}\n\nexport interface Profile {\n firstName?: string\n lastName?: string\n profilePicture?: string\n email: string\n document?: string\n userId?: string\n birthDate?: string\n gender?: string\n homePhone?: string\n businessPhone?: string\n isCorporate?: boolean\n corporateName?: string\n corporateDocument?: string\n stateRegistration?: string\n approved?: boolean\n addresses?: Address[]\n tradeName?: string\n payments?: PaymentProfile[]\n customFields?: ProfileCustomField[]\n priceTables: string\n}\n\ninterface CurrentProfile {\n email: string\n userId?: string\n}\n\n```"
}
] |
code_ffm-segment-prices-node-template_65cbec1b
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/typings/staleFromVBaseWhileRevalidate.ts from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nexport interface StaleRevalidateData<T> {\n ttl: Date\n data: T\n}\n\n```"
}
] |
code_ffm-segment-prices-node-template_79b1d4fb
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/typings/externalPrice.d.ts from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport type { Maybe } from '@vtex/api'\n\nexport type Quote = {\n skuId: string\n listPrice: number\n costPrice: number\n sellingPrice: number\n priceValidUntil: string\n tradePolicyId?: string\n}\n\nexport type InputItem = {\n skuId: string\n quantity: number\n index: number\n}\n\nexport type ExternalPriceInput = {\n context: {\n email: string\n }\n item: InputItem\n}\n\nexport type ExternalPriceResponse = {\n message: string\n item: {\n index: number\n skuId: string\n price: number\n costPrice: Maybe<number>\n listPrice: Maybe<number>\n priceValidUntil: string\n priceTables: string\n sellingPrice: Maybe<number>\n tradePolicyId: Maybe<string>\n }\n}\n\n```"
}
] |
code_ffm-segment-prices-node-template_d5262296
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/typings/global.d.ts from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport type { RecorderState, ServiceContext } from '@vtex/api'\nimport type { Clients } from '../clients'\nimport type { Quote, ExternalPriceInput } from './externalPrice'\n\ndeclare global {\n type Context<TState extends State = State> = ServiceContext<Clients, TState>\n\n interface State extends RecorderState {\n quote?: Quote\n body: ExternalPriceInput\n pricingAccount: string\n }\n\n type Next = () => Promise<void>\n}\n\n```"
}
] |
code_ffm-segment-prices-node-template_a22fefc3
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/utils/staleFromVBaseWhileRevalidate.ts from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\n/* eslint-disable max-params */\nimport { createHash } from 'crypto'\n\nimport type { VBase } from '@vtex/api'\n\nimport type { StaleRevalidateData } from '../typings/staleFromVBaseWhileRevalidate'\n\nconst getTTL = (expirationInMinutes?: number) => {\n const ttl = new Date()\n\n ttl.setMinutes(ttl.getMinutes() + (expirationInMinutes ?? 30))\n\n return ttl\n}\n\nconst revalidate = async <T>(\n vbase: VBase,\n bucket: string,\n filePath: string,\n endDate: Date,\n validateFunction: (params?: unknown) => Promise<T>,\n params?: unknown\n) => {\n const data = await validateFunction(params)\n const revalidatedData = { data, ttl: endDate }\n\n vbase\n .saveJSON<StaleRevalidateData<T>>(bucket, filePath, revalidatedData)\n .catch()\n\n return data\n}\n\nconst normalizedJSONFile = (filePath: string) =>\n `${createHash('md5').update(filePath).digest('hex')}.json`\n\nexport const staleFromVBaseWhileRevalidate = async <T>(\n vbase: VBase,\n bucket: string,\n filePath: string,\n validateFunction: (params?: any) => Promise<T>,\n params?: unknown,\n options?: { expirationInMinutes?: number }\n): Promise<T> => {\n const normalizedFilePath = normalizedJSONFile(filePath)\n const cachedData = (await vbase\n .getJSON<StaleRevalidateData<T>>(bucket, normalizedFilePath, true)\n .catch()) as StaleRevalidateData<T>\n\n if (!cachedData) {\n const endDate = getTTL(options?.expirationInMinutes)\n\n // eslint-disable-next-line no-return-await\n return await revalidate<T>(\n vbase,\n bucket,\n normalizedFilePath,\n endDate,\n validateFunction,\n params\n )\n }\n\n const { data, ttl } = cachedData as StaleRevalidateData<T>\n\n const today = new Date()\n const ttlDate = new Date(ttl)\n\n if (today < ttlDate) {\n return data\n }\n\n const endDate = getTTL(options?.expirationInMinutes)\n\n revalidate<T>(\n vbase,\n bucket,\n normalizedFilePath,\n endDate,\n validateFunction,\n params\n )\n\n return data\n}\n\n```"
}
] |
code_ffm-segment-prices-node-template_82d93137
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/utils/statusCodeUtils.ts from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport type { AxiosError } from 'axios'\nimport { AuthenticationError, ForbiddenError, UserInputError } from '@vtex/api'\n\nexport function isNotSuccessCode(statusCode: number) {\n return statusCode < 200 || statusCode > 299\n}\n\nexport const statusToError = (e: AxiosError) => {\n if (!e.response) throw e\n\n const { response } = e as AxiosError\n\n if (!response?.status) throw e\n\n const { status } = response\n\n if (status === 401) throw new AuthenticationError(e)\n\n if (status === 403) throw new ForbiddenError(e)\n\n if (status === 400) throw new UserInputError(e)\n\n throw e\n}\n\n```"
}
] |
code_ffm-segment-prices-node-template_0907aeea
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/__tests__/simple.test.ts from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\n// You can import your files here for testing them\n//\n// More info: https://github.com/sapegin/jest-cheat-sheet\n\ndescribe('simpleTest', () => {\n it('one test case', async () => {\n expect(0.2 + 0.1).not.toBe(0.3)\n })\n})\n\n```"
}
] |
code_ffm-segment-prices-node-template_321a775a
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/handlers/formatResponse.ts from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport type { ExternalPriceResponse, Quote } from '../typings/externalPrice'\n\nexport async function formatResponse(ctx: Context) {\n const { state, body } = ctx\n const quote = state.quote as Quote\n\n // Checkout service expect prices coming from Pricing Service to be multiplied by 100\n const response: ExternalPriceResponse = {\n message: 'Price quoted successfully.',\n item: {\n price: quote.sellingPrice * 100,\n priceTables: quote.tradePolicyId ?? '',\n index: body.item.index,\n skuId: quote.skuId,\n listPrice: quote.listPrice * 100,\n costPrice: quote.costPrice * 100,\n sellingPrice: quote.sellingPrice * 100,\n priceValidUntil: quote.priceValidUntil,\n tradePolicyId: quote.tradePolicyId,\n },\n }\n\n ctx.body = response\n ctx.status = 200\n}\n\n```"
}
] |
code_ffm-segment-prices-node-template_9a7d4397
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/handlers/validate.ts from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport { json } from 'co-body'\nimport { UserInputError } from '@vtex/api'\n\nexport async function validate(ctx: Context, next: Next) {\n ctx.body = await json(ctx.req)\n\n const { item } = ctx.body\n\n if (!item?.skuId) {\n const error = new UserInputError('Item.SkuId is required')\n\n ctx.vtex.logger.error({\n message: 'ExternalPriceApp_Validate',\n error,\n })\n\n throw error\n }\n\n await next()\n}\n\n```"
}
] |
code_ffm-segment-prices-node-template_0cfae581
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/handlers/fetchPriceTable.ts from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport type { Profile } from '../typings/profileSystem'\nimport { staleFromVBaseWhileRevalidate } from '../utils/staleFromVBaseWhileRevalidate'\n\nexport async function fetchPriceTables(ctx: Context) {\n const { clients, body } = ctx\n\n const { profileSystem } = clients\n\n let currentProfile: Profile | null = null\n\n const getPriceTable = async (params: { email: string }) => {\n const { email } = params\n\n return (await profileSystem.getProfileInfo(\n {\n email,\n userId: email,\n },\n 'priceTables'\n )) as Profile\n }\n\n if (body.context.email) {\n try {\n currentProfile = await staleFromVBaseWhileRevalidate<Profile>(\n clients.vbase,\n 'user-price-tables',\n body.context.email,\n getPriceTable,\n { email: body.context.email as string },\n { expirationInMinutes: 60 }\n )\n } catch (e) {\n ctx.vtex.logger.warn({\n message: 'ExternalPriceApp_FetchPriceTables_NoProfile',\n e,\n })\n\n throw e\n }\n }\n\n return currentProfile\n}\n\n```"
}
] |
code_ffm-segment-prices-node-template_0a8df3b2
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of ffm-segment-prices-node-template/node/handlers/fetchPrice.ts from the ffm-segment-prices-node-template VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport { NotFoundError } from '@vtex/api'\n\nimport type { Profile } from '../typings/profileSystem'\nimport { fetchPriceTables } from './fetchPriceTable'\n\nexport async function fetchPrice(ctx: Context, next: Next) {\n const { clients, body } = ctx\n\n const { pricing } = clients\n\n const currentProfile: Profile | null = await fetchPriceTables(ctx)\n\n const price = await pricing.getPrice(\n body.item.skuId,\n currentProfile?.priceTables ?? '1'\n )\n\n if (!price) {\n const error = new NotFoundError('Price not found')\n\n ctx.vtex.logger.error({\n message: 'ExternalPriceApp_FetchPrice_Noprice',\n error,\n })\n\n throw error\n }\n\n ctx.state.quote = {\n ...price,\n skuId: body.item.skuId,\n }\n\n await next()\n}\n\n```"
}
] |
code_my-account-commons_2744492a
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of my-account-commons/messages/sl.json from the my-account-commons VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"alert.connectionError\": \"Pojavila se je napaka pri povezavi s sistmeom, poskusite ponovno naložiti stran.\",\n \"alert.unauthenticated\": \"Mora biti preverjeni, da lahko nadaljujete s tem dejanjem.\",\n \"alert.reload\": \"Ponovno nalaganje\",\n \"alert.unknownError\": \"Pojavila se je napaka, poskusite znova.\",\n \"commons.back\": \"Vrnitev\",\n \"progressBar.package.progress\": \"Stanje paketa\",\n \"progressBar.order.status\": \"Stanje naročila\"\n}\n\n```"
}
] |
code_my-account-commons_41f3678c
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of my-account-commons/messages/nl.json from the my-account-commons VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"alert.connectionError\": \"Er was een fout in de verbinding met het systeem, probeer de pagina opnieuw te laden.\",\n \"alert.unauthenticated\": \"U moet worden geverifieerd om door te gaan met deze actie.\",\n \"alert.reload\": \"Herladen\",\n \"alert.unknownError\": \"Er is een fout opgetreden. Probeer het nog eens.\",\n \"commons.back\": \"Keer terug\",\n \"progressBar.package.progress\": \"Pakketstatus\",\n \"progressBar.order.status\": \"Bestelstatus\"\n}\n\n```"
}
] |
code_my-account-commons_51bac935
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of my-account-commons/messages/de.json from the my-account-commons VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"alert.connectionError\": \"Es gab einen Fehler beim Verbindungsaufbau mit dem System, versuchen Sie, die Seite neu zu laden.\",\n \"alert.unauthenticated\": \"Sie müssen authentifiziert werden, um mit dieser Aktion fortzufahren.\",\n \"alert.reload\": \"Neu laden\",\n \"alert.unknownError\": \"Es ist ein Fehler aufgetreten, versuchen Sie es erneut.\",\n \"commons.back\": \"Return\",\n \"progressBar.package.progress\": \"Status des Pakets\",\n \"progressBar.order.status\": \"Bestellstatus\"\n}\n\n```"
}
] |
code_my-account-commons_16517c31
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of my-account-commons/messages/ru.json from the my-account-commons VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"alert.connectionError\": \"Возникала ошибка соединения с системой, попробуйте перезагрузить страницу.\",\n \"alert.unauthenticated\": \"Вы должны авторизоваться, чтобы продолжить это действие.\",\n \"alert.reload\": \"Перезагрузить\",\n \"alert.unknownError\": \"Возникла ошибка, попробуйте снова.\",\n \"commons.back\": \"Вернуться\",\n \"progressBar.package.progress\": \"Статус отправления\",\n \"progressBar.order.status\": \"Статус заказа\"\n}\n\n```"
}
] |
code_my-account-commons_8526accb
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of my-account-commons/messages/pl.json from the my-account-commons VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"alert.connectionError\": \"Wystąpił błąd podczas łączenia z systemem, spróbuj przeładować stronę.\",\n \"alert.unauthenticated\": \"Musisz być uwierzytelniony, aby kontynuować to działanie.\",\n \"alert.reload\": \"Przeładuj\",\n \"alert.unknownError\": \"Wystąpił błąd, spróbuj ponownie.\",\n \"commons.back\": \"Powrót\",\n \"progressBar.package.progress\": \"Status paczki\",\n \"progressBar.order.status\": \"Status zamówienia\"\n}\n\n```"
}
] |
code_my-account-commons_fa87f399
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of my-account-commons/messages/uk.json from the my-account-commons VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"alert.connectionError\": \"Помилка підключення до системи, спробуйте перезавантажити сторінку.\",\n \"alert.unauthenticated\": \"Щоб виконати цю дію, вам потрібно пройти автентифікацію.\",\n \"alert.reload\": \"Перезавантаження\",\n \"alert.unknownError\": \"Сталася помилка, спробуйте знову.\",\n \"commons.back\": \"Повернутися\",\n \"progressBar.package.progress\": \"Статус посилки\",\n \"progressBar.order.status\": \"Статус замовлення\"\n}\n\n```"
}
] |
code_my-account-commons_fccd9762
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of my-account-commons/messages/fi.json from the my-account-commons VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"alert.connectionError\": \"Virhe muodostettaessa yhteyttä järjestelmään. Kokeile ladata sivu uudelleen.\",\n \"alert.unauthenticated\": \"Sinut täytyy todentaa, jotta voit suorittaa tämän toiminnon.\",\n \"alert.reload\": \"Lataa uudelleen\",\n \"alert.unknownError\": \"Tapahtui virhe, yritä uudelleen.\",\n \"commons.back\": \"Palaa\",\n \"progressBar.package.progress\": \"Paketin tila\",\n \"progressBar.order.status\": \"Tilauksen tila\"\n}\n\n```"
}
] |
code_my-account-commons_c11454a7
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of my-account-commons/messages/sk.json from the my-account-commons VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"alert.connectionError\": \"Pri pripájaní k systému sa vyskytla chyba, skúste stránku načítať znova.\",\n \"alert.unauthenticated\": \"Aby ste mohli pokračovať v tejto akcii, musíte byť overení.\",\n \"alert.reload\": \"Znova načítať\",\n \"alert.unknownError\": \"Vyskytla sa chyba, skúste to znova.\",\n \"commons.back\": \"Vrátiť sa\",\n \"progressBar.package.progress\": \"Stav balíka\",\n \"progressBar.order.status\": \"Stav objednávky\"\n}\n\n```"
}
] |
code_my-account-commons_c84ae2c7
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of my-account-commons/messages/pt.json from the my-account-commons VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"alert.connectionError\": \"Houve um erro de comunicação com o sistema, tente recarregar a página.\",\n \"alert.unauthenticated\": \"Você precisa se identificar para realizar esta ação.\",\n \"alert.reload\": \"Recarregar\",\n \"alert.unknownError\": \"Ocorreu um erro, tente novamente.\",\n \"commons.back\": \"Voltar\",\n \"progressBar.package.progress\": \"Status do pacote\",\n \"progressBar.order.status\": \"Status do pedido\"\n}\n```"
}
] |
code_my-account-commons_d7b91ef1
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of my-account-commons/messages/en.json from the my-account-commons VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"alert.connectionError\": \"There was an error connecting with the system, try reloading the page.\",\n \"alert.unauthenticated\": \"You need to be authenticated to proceed with this action.\",\n \"alert.reload\": \"Reload\",\n \"alert.unknownError\": \"An error occurred, try again.\",\n \"commons.back\": \"Return\",\n \"progressBar.package.progress\": \"Package status\",\n \"progressBar.order.status\": \"Order status\"\n}\n\n```"
}
] |
code_my-account-commons_d3628b1c
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of my-account-commons/messages/it.json from the my-account-commons VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"alert.connectionError\": \"Si è verificato un errore nel collegamento con il sistema, prova a ricaricare la pagina.\",\n \"alert.unauthenticated\": \"Devi essere autenticato per procedere con quest'azione.\",\n \"alert.reload\": \"Ricarica\",\n \"alert.unknownError\": \"Si è verificato un errore, si prega di riprovare.\",\n \"commons.back\": \"Indietro\",\n \"progressBar.package.progress\": \"Stato del pacco\",\n \"progressBar.order.status\": \"Stato dell'ordine\"\n}\n```"
}
] |
code_my-account-commons_870aa31f
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of my-account-commons/messages/fr.json from the my-account-commons VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"alert.connectionError\": \"Une erreur de connexion au système s'est produite. Veuillez essayer de recharger la page.\",\n \"alert.unauthenticated\": \"Vous devez être authentifié pour poursuivre cette action.\",\n \"alert.reload\": \"Recharger\",\n \"alert.unknownError\": \"Une erreur est survenue, veuillez réessayer.\",\n \"commons.back\": \"Retour\",\n \"progressBar.package.progress\": \"Statut du colis\",\n \"progressBar.order.status\": \"Statut de la commande\"\n}\n\n```"
}
] |
code_my-account-commons_b95b3c0a
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of my-account-commons/messages/el.json from the my-account-commons VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"alert.connectionError\": \"Προέκυψε σφάλμα στη σύνδεση με το σύστημα, δοκιμάστε να ξαναφορτώσετε τη σελίδα.\",\n \"alert.unauthenticated\": \"Πρέπει να επαληθευτεί η ταυτότητά σας για να προχωρήσετε σε αυτή την ενέργεια.\",\n \"alert.reload\": \"Επαναφόρτωση\",\n \"alert.unknownError\": \"Προέκυψε σφάλμα, δοκιμάστε ξανά.\",\n \"commons.back\": \"Επιστροφή\",\n \"progressBar.package.progress\": \"Κατάσταση συσκευασίας\",\n \"progressBar.order.status\": \"Κατάσταση παραγγελίας\"\n}\n\n```"
}
] |
code_my-account-commons_e736ae0b
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of my-account-commons/messages/bg.json from the my-account-commons VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"alert.connectionError\": \"Възникна грешка при свързване със системата, опитайте да презаредите страницата.\",\n \"alert.unauthenticated\": \"Трябва да се удостоверите, за да продължите с това действие.\",\n \"alert.reload\": \"Презареждане\",\n \"alert.unknownError\": \"Възникна грешка, опитайте отново.\",\n \"commons.back\": \"Връщане\",\n \"progressBar.package.progress\": \"Статус на пакета\",\n \"progressBar.order.status\": \"Статус на поръчката\"\n}\n\n```"
}
] |
code_my-account-commons_304d40f0
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of my-account-commons/messages/ro.json from the my-account-commons VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"alert.connectionError\": \"A apărut o eroare la conectarea cu sistemul, încearcă să reîncarci pagina.\",\n \"alert.unauthenticated\": \"Trebuie să fii autentificat pentru a realiza această acțiune.\",\n \"alert.reload\": \"Reîncarcă\",\n \"alert.unknownError\": \"A apărut o eroare, încearcă din nou.\",\n \"commons.back\": \"Întoarce-te\",\n \"progressBar.package.progress\": \"Statusul pachetului\",\n \"progressBar.order.status\": \"Status comandă\"\n}\n\n```"
}
] |
code_my-account-commons_ec73a65b
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of my-account-commons/messages/ca.json from the my-account-commons VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"alert.connectionError\": \"S'ha produït un error en connectar amb el sistema. Proveu de recarregar la pàgina.\",\n \"alert.unauthenticated\": \"Se us ha d'autenticar per poder continuar amb aquesta acció.\",\n \"alert.reload\": \"Recarrega\",\n \"alert.unknownError\": \"S'ha produït un error. Torneu-ho a provar.\",\n \"commons.back\": \"Torna\",\n \"progressBar.package.progress\": \"Estat del paquet\",\n \"progressBar.order.status\": \"Estat de la comanda\"\n}\n\n```"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.