id
stringlengths
12
53
messages
listlengths
3
3
code_2performant_99ad31f6
[ { "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 2performant/public/metadata/messages/es-AR.json from the 2performant VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n\"name\": \"2Performant Tracking Code\",\n\"headline\": \"Integración de la plataforma de afiliación de marketing 2Performant\",\n\"overview\": \"2Performant es la principal plataforma de marketing de afiliados e influencers de Rumanía y una de las mayores plataformas de este tipo en Europa del Este. Al usar esta plataforma, las empresas pueden conectarse con socios, afiliados y personas influyentes para promocionar sus productos y promociones a un público más amplio. Esta aplicación de píxeles le permite agregar el código de seguimiento 2Performant a su tienda.\",\n\"features\": [\n\"Permite la integración del código de seguimiento 2Performant con su tienda VTEX\",\n\"Facilita el seguimiento de tus campañas de marketing de afiliación\",\n\"Junto con la aplicación Export Feeds, facilita el listado de sus productos en la plataforma 2Performant\"\n],\n\"additionalInformation\": \"Esta aplicación requiere una cuenta www.2performant.com válida.\\\\n\\\\nTenga en cuenta que la aplicación de píxeles de 2Performant no exportará su feed de productos a la plataforma de 2Performant. Para hacer eso, debe usar la aplicación Export Feeds.\",\n\"websiteURL\": \"https://www.2performant.com\",\n\"support\": {\n\"url\": \"https://support.vtex.com/hc/requests\"\n}\n}\n```" } ]
code_2performant_590b3699
[ { "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 2performant/public/metadata/messages/pt-BR.json from the 2performant VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n\"name\": \"2Performant Tracking Code\",\n\"headline\": \"Integração da plataforma de afiliação de marketing 2Performant\",\n\"overview\": \"A 2Performant é a principal plataforma de marketing de afiliados e influenciadores da Romênia e uma das maiores plataformas desse tipo na Europa Oriental. Ao usar esta plataforma, as empresas podem se conectar com parceiros, afiliados e influenciadores para promover seus produtos e promoções para um público mais amplo. Este aplicativo de pixel permite que você adicione o código de rastreamento 2Performant à sua loja.\",\n\"features\": [\n\"Permite a integração do código de rastreamento 2Performant com sua loja VTEX\",\n\"Facilita o rastreamento de suas campanhas de marketing de afiliados\",\n\"Juntamente com o aplicativo Export Feeds, facilita a listagem de seus produtos na plataforma 2Performant\"\n],\n\"additionalInformation\": \"Este aplicativo requer uma conta www.2performant.com válida.\\\\n\\\\nObserve que o aplicativo de pixel 2Performant não exportará seu feed de produtos para a plataforma 2Performant. Para fazer isso, você deve usar o aplicativo Export Feeds.\",\n\"websiteURL\": \"https://www.2performant.com\",\n\"support\": {\n\"url\": \"https://support.vtex.com/hc/requests\"\n}\n}\n```" } ]
code_2performant_9bf4438f
[ { "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 2performant/public/metadata/messages/en-US.json from the 2performant VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n\"name\": \"2Performant Tracking Code\",\n\"headline\": \"2Performant marketing affiliation platform integration\",\n\"overview\": \"2Performant is Romania's foremost affiliate and influencer marketing platform and one of the largest such platforms in Eastern Europe. By using this platform, businesses can connect with partners, affiliates, and influencers in order to promote their products and promotions to a wider audience. This pixel app allows you to add the 2Performant tracking code to your store.\",\n\"features\": [\n\"Allows the integration of the 2Performant tracking code with your VTEX store\",\n\"Facilitates the tracking of your affiliate marketing campaigns\",\n\"Together with the Export Feeds app, facilitates the listing of your products on the 2Performant platform\"\n],\n\"additionalInformation\": \"This application requires a valid www.2performant.com account.\\\\n\\\\nNote that the 2Performant pixel app will not export your product feed into the 2Performant platform. To do that, you must use the Export Feeds app.\",\n\"websiteURL\": \"https://www.2performant.com\",\n\"support\": {\n\"url\": \"https://support.vtex.com/hc/requests\"\n}\n}\n```" } ]
code_2performant_8b8eecd0
[ { "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 2performant/react/typings/events.d.ts from the 2performant VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nexport interface PixelMessage extends MessageEvent {\n data:\n | ProductViewData\n | ProductClickData\n | OrderPlacedData\n | OrderPlacedTrackedData\n | PageViewData\n | ProductImpressionData\n | AddToCartData\n | RemoveToCartData\n}\n\nexport interface EventData {\n event: string\n eventName: string\n currency: string\n}\n\nexport interface PageViewData extends EventData {\n event: 'pageView'\n eventName: 'vtex:pageView'\n pageTitle: string\n pageUrl: string\n referrer: string\n}\n\nexport interface AddToCartData extends EventData {\n event: 'addToCart'\n eventName: 'vtex:addToCart'\n items: CartItem[]\n}\n\nexport interface RemoveToCartData extends EventData {\n event: 'removeFromCart'\n eventName: 'vtex:removeFromCart'\n items: CartItem[]\n}\n\nexport interface OrderPlacedData extends Order, EventData {\n event: 'orderPlaced'\n eventName: 'vtex:orderPlaced'\n}\n\nexport interface OrderPlacedTrackedData extends Order, EventData {\n event: 'orderPlacedTracked'\n eventName: 'vtex:orderPlacedTracked'\n}\n\nexport interface ProductViewData extends EventData {\n event: 'productView'\n eventName: 'vtex:productView'\n product: Product\n}\n\nexport interface ProductClickData extends EventData {\n event: 'productClick'\n eventName: 'vtex:productClick'\n product: Product\n}\n\nexport interface ProductImpressionData extends EventData {\n event: 'productImpression'\n eventName: 'vtex:productImpression'\n impressions: Impression[]\n product?: Product // deprecated, use impressions list!\n position?: number // deprecated, use impressions list!\n list: string\n}\n\ninterface CartItem {\n skuId: string\n variant: string\n price: number\n name: string\n quantity: number\n productRefId: string\n brand: string\n category: string\n}\n\nexport interface Order {\n currency: string\n accountName: string\n orderGroup: string\n salesChannel: string\n coupon: string\n visitorType: string\n visitorContactInfo: string[]\n visitorAddressState: string\n visitorAddressCountry: string\n visitorAddressPostalCode: string\n transactionId: string\n transactionDate: string\n transactionAffiliation: string\n transactionTotal: number\n transactionShipping: number\n transactionSubtotal: number\n transactionDiscounts: number\n transactionTax: number\n transactionCurrency: string\n transactionPaymentType: PaymentType[]\n transactionShippingMethod: ShippingMethod[]\n transactionProducts: ProductOrder[]\n transactionPayment: {\n id: string\n }\n}\n\nexport interface Impression {\n product: Product\n position: number\n}\n\ninterface PaymentType {\n group: string\n paymentSystemName: string\n installments: number\n value: number\n}\n\ninterface ShippingMethod {\n itemId: string\n selectedSla: string\n}\n\ninterface ProductOrder {\n id: string\n name: string\n sku: string\n skuRefId: string\n skuName: string\n productRefId: string\n ean: string\n slug: string\n brand: string\n brandId: string\n seller: string\n sellerId: string\n category: string\n categoryId: string\n categoryTree: string[]\n categoryIdTree: string[]\n priceTags: PriceTag[]\n originalPrice: number\n price: number\n sellingPrice: number\n tax: number\n quantity: number\n components: any[]\n measurementUnit: string\n unitMultiplier: number\n}\n\ninterface PriceTag {\n identifier: string\n isPercentual: boolean\n value: number\n}\n\ninterface Product {\n brand: string\n categoryId?: string // inconsistency\n categories: string[]\n productId: string\n productName: string\n selectedSku?: string // inconsistency\n items: Item[]\n sku: Item\n [key: string]: any\n}\n\ninterface Item {\n itemId: string\n name: string\n seller?: Seller\n [key: string]: any\n}\n\ninterface Seller {\n commertialOffer: CommertialOffer\n [key: string]: any\n}\n\ninterface CommertialOffer {\n Price: number\n [key: string]: any\n}\n\n```" } ]
code_2performant_fb59198e
[ { "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 2performant/react/typings/vtex.render-runtime.d.ts from the 2performant VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module 'vtex.render-runtime' {\n export const canUseDOM: boolean\n}\n\n```" } ]
code_2performant_0ddc00f4
[ { "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 2performant/react/typings/global.d.ts from the 2performant VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ninterface Window extends Window {\n __2performant: {\n confirm: string\n campaignUnique: string\n subtractTVA: boolean\n }\n}\n\n```" } ]
code_delivery-theme_8cdbb7ef
[ { "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 delivery-theme/docs/README.md from the delivery-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n# Delivery Theme\nVTEX delivery store based on store framework\n\n```" } ]
code_delivery-theme_ab6eae33
[ { "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 delivery-theme/store/blocks.json from the delivery-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.address\": {\n \"blocks\": [\n \"address-manager\"\n ]\n },\n \"store.home\": {\n \"blocks\": [\n \"rebuy\",\n \"carousel\",\n \"shelf\"\n ],\n \"parent\": {\n \"challenge\": \"challenge.address\"\n }\n },\n \"store.product\": {\n \"blocks\": [\n \"product-details.customizer\"\n ],\n \"parent\": {\n \"challenge\": \"challenge.address\"\n }\n },\n \"store.search\": {\n \"blocks\": [\n \"search-result\"\n ],\n \"parent\": {\n \"challenge\": \"challenge.address\"\n }\n },\n \"store.search#brand\": {\n \"blocks\": [\n \"search-result\"\n ],\n \"parent\": {\n \"challenge\": \"challenge.address\"\n }\n },\n \"store.search#department\": {\n \"blocks\": [\n \"search-result\"\n ],\n \"parent\": {\n \"challenge\": \"challenge.address\"\n }\n },\n \"store.search#category\": {\n \"blocks\": [\n \"search-result\"\n ],\n \"parent\": {\n \"challenge\": \"challenge.address\"\n }\n },\n \"store.search#subcategory\": {\n \"blocks\": [\n \"search-result\"\n ],\n \"parent\": {\n \"challenge\": \"challenge.address\"\n }\n },\n \"store.account\": {\n \"blocks\": [\n \"my-account\"\n ]\n },\n \"store.login\": {\n \"blocks\": [\n \"login-content\"\n ]\n },\n \"header.full\": {\n \"blocks\": [\n \"telemarketing\",\n \"logo\",\n \"minicart\",\n \"login\",\n \"category-menu\",\n \"search-bar\",\n \"user-address\"\n ],\n \"props\": {\n \"showSearchBar\": true,\n \"showLogin\": true\n }\n },\n \"user-address\": {\n \"blocks\": [\"modal\"]\n },\n \"modal\": {\n \"children\": [\"change-address\"],\n \"props\": {\n \"showTopBar\": false\n }\n }\n}\n```" } ]
code_delivery-theme_aca2e61d
[ { "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 delivery-theme/store/routes.json from the delivery-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.address\": {\n \"path\": \"/address\"\n }\n}\n```" } ]
code_delivery-theme_57aa8955
[ { "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 delivery-theme/styles/configs/style.json from the delivery-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"typeScale\": [3, 2.25, 1.5, 1.25, 1, 0.875, 0.75],\n \"spacing\": [0.125, 0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4, 8, 16],\n \"customMedia\": [\n { \"s\": 20 },\n {\n \"ns\": {\n \"value\": 40,\n \"minWidth\": true\n }\n },\n {\n \"m\": {\n \"value\": 40,\n \"minWidth\": true\n }\n },\n {\n \"l\": {\n \"value\": 64,\n \"minWidth\": true\n }\n },\n {\n \"xl\": {\n \"value\": 80,\n \"minWidth\": true\n }\n }\n ],\n \"colors\": {\n \"black-90\": \"rgba(0,0,0,.9)\",\n \"black-80\": \"rgba(0,0,0,.8)\",\n \"black-70\": \"rgba(0,0,0,.7)\",\n \"black-60\": \"rgba(0,0,0,.6)\",\n \"black-50\": \"rgba(0,0,0,.5)\",\n \"black-40\": \"rgba(0,0,0,.4)\",\n \"black-30\": \"rgba(0,0,0,.3)\",\n \"black-20\": \"rgba(0,0,0,.2)\",\n \"black-10\": \"rgba(0,0,0,.1)\",\n \"black-05\": \"rgba(0,0,0,.05)\",\n \"black-025\": \"rgba(0,0,0,.025)\",\n \"black-0125\": \"rgba(0,0,0,.0125)\",\n\n \"white-90\": \"rgba(255,255,255,.9)\",\n \"white-80\": \"rgba(255,255,255,.8)\",\n \"white-70\": \"rgba(255,255,255,.7)\",\n \"white-60\": \"rgba(255,255,255,.6)\",\n \"white-50\": \"rgba(255,255,255,.5)\",\n \"white-40\": \"rgba(255,255,255,.4)\",\n \"white-30\": \"rgba(255,255,255,.3)\",\n \"white-20\": \"rgba(255,255,255,.2)\",\n \"white-10\": \"rgba(255,255,255,.1)\",\n \"white-05\": \"rgba(255,255,255,.05)\",\n \"white-025\": \"rgba(255,255,255,.025)\",\n \"white-0125\": \"rgba(255,255,255,.0125)\"\n },\n \"semanticColors\": {\n \"background\": {\n \"base\": \"#ffffff\",\n \"base--inverted\": \"#03044e\",\n \"action-primary\": \"#0F3E99\",\n \"action-secondary\": \"#eef3f7\",\n \"emphasis\": \"#f71963\",\n \"disabled\": \"#f2f4f5\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"hover-background\": {\n \"action-primary\": \"#072c75\",\n \"action-secondary\": \"#dbe9fd\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#e13232\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"active-background\": {\n \"action-primary\": \"#0c389f\",\n \"action-secondary\": \"#dbe9fd\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"text\": {\n \"action-primary\": \"#0F3E99\",\n \"action-secondary\": \"#eef3f7\",\n \"link\": \"#0F3E99\",\n \"emphasis\": \"#f71963\",\n \"disabled\": \"#979899\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"visited-text\": {\n \"link\": \"#0c389f\"\n },\n \"hover-text\": {\n \"action-primary\": \"#072c75\",\n \"action-secondary\": \"#dbe9fd\",\n \"link\": \"#0c389f\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#e13232\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\"\n },\n \"active-text\": {\n \"link\": \"#0c389f\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\"\n },\n \"border\": {\n \"action-primary\": \"#0F3E99\",\n \"action-secondary\": \"#eef3f7\",\n \"emphasis\": \"#f71963\",\n \"disabled\": \"#e3e4e6\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"hover-border\": {\n \"action-primary\": \"#072c75\",\n \"action-secondary\": \"#dbe9fd\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#e13232\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"active-border\": {\n \"action-primary\": \"#0c389f\",\n \"action-secondary\": \"#dbe9fd\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"on\": {\n \"base\": \"#3f3f40\",\n \"base--inverted\": \"#ffffff\",\n \"action-primary\": \"#ffffff\",\n \"action-secondary\": \"#0F3E99\",\n \"emphasis\": \"#ffffff\",\n \"disabled\": \"#979899\",\n \"success\": \"#ffffff\",\n \"success--faded\": \"#3f3f40\",\n \"danger\": \"#ffffff\",\n \"danger--faded\": \"#3f3f40\",\n \"warning\": \"#ffffff\",\n \"warning--faded\": \"#1a1a1a\",\n \"muted-1\": \"#ffffff\",\n \"muted-2\": \"#ffffff\",\n \"muted-3\": \"#3f3f40\",\n \"muted-4\": \"#3f3f40\",\n \"muted-5\": \"#3f3f40\"\n },\n \"hover-on\": {\n \"action-primary\": \"#ffffff\",\n \"action-secondary\": \"#0F3E99\",\n \"emphasis\": \"#ffffff\",\n \"success\": \"#ffffff\",\n \"success--faded\": \"#3f3f40\",\n \"danger\": \"#ffffff\",\n \"danger--faded\": \"#3f3f40\",\n \"warning\": \"#ffffff\",\n \"warning--faded\": \"#1a1a1a\"\n },\n \"active-on\": {\n \"action-primary\": \"#ffffff\",\n \"action-secondary\": \"#0F3E99\",\n \"emphasis\": \"#ffffff\",\n \"success\": \"#ffffff\",\n \"success--faded\": \"#3f3f40\",\n \"danger\": \"#ffffff\",\n \"danger--faded\": \"#3f3f40\",\n \"warning\": \"#ffffff\",\n \"warning--faded\": \"#1a1a1a\"\n }\n },\n \"borderWidths\": [0, 0.125, 0.25, 0.5, 1, 2],\n \"borderRadius\": [0, 0.125, 0.25, 0.5, 1],\n \"widths\": [1, 2, 4, 8, 16],\n \"maxWidths\": [1, 2, 4, 8, 16, 32, 48, 64, 96],\n \"heights\": [1, 2, 4, 8, 16],\n \"sizes\": [\n { \"name\": \"small\", \"value\": 2 },\n { \"name\": \"regular\", \"value\": 2.5 },\n { \"name\": \"large\", \"value\": 3 }\n ],\n \"typography\": {\n \"measure\": [30, 34, 20],\n \"styles\": {\n \"heading-1\": {\n \"fontFamily\": \"Fabriga, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"700\",\n \"fontSize\": \"3rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-2\": {\n \"fontFamily\": \"Fabriga, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"700\",\n \"fontSize\": \"2.25rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-3\": {\n \"fontFamily\": \"Fabriga, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"700\",\n \"fontSize\": \"1.75rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-4\": {\n \"fontFamily\": \"Fabriga, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1.5rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-5\": {\n \"fontFamily\": \"Fabriga, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1.25rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-6\": {\n \"fontFamily\": \"Fabriga, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1.25rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"body\": {\n \"fontFamily\": \"Fabriga, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"small\": {\n \"fontFamily\": \"Fabriga, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"0.875rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"mini\": {\n \"fontFamily\": \"Fabriga, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"0.75rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"action\": {\n \"fontFamily\": \"Fabriga, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"1rem\",\n \"textTransform\": \"uppercase\",\n \"letterSpacing\": \"0\"\n },\n \"action--small\": {\n \"fontFamily\": \"Fabriga, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"0.875rem\",\n \"textTransform\": \"uppercase\",\n \"letterSpacing\": \"0\"\n },\n \"action--large\": {\n \"fontFamily\": \"Fabriga, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"1.25rem\",\n \"textTransform\": \"uppercase\",\n \"letterSpacing\": \"0\"\n },\n \"code\": {\n \"fontFamily\": \"Consolas, monaco, monospace\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n }\n }\n },\n \"opacity\": [1, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0.05, 0.025, 0]\n}\n\n```" } ]
code_shelf_f3c59d23
[ { "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 shelf/messages/pt.json from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"admin/editor.shelf.title\": \"Vitrine\",\n \"admin/editor.shelf.description\": \"Uma vitrine com uma coleção de produtos\",\n \"admin/editor.shelf.category.title\": \"Id da Categoria\",\n \"admin/editor.shelf.category.description\": \"Para sub-categorias, use \\\"/\\\" (por exemplo: 1/2/3)\",\n \"admin/editor.shelf.collection.title\": \"Coleção\",\n \"admin/editor.shelf.orderBy.title\": \"Ordenação da Lista\",\n \"admin/editor.shelf.hideUnavailableItems\": \"Esconder itens não disponíveis\",\n \"admin/editor.shelf.hideOutOfStockItems\": \"Esconder itens fora de estoque\",\n \"admin/editor.shelf.skusFilter\": \"Filtro de SKUs\",\n \"admin/editor.shelf.skusFilter.description\": \"Configurando o valor de primeiro disponível faz sua query ser mais rápida!\",\n \"admin/editor.shelf.skusFilter.none\": \"Nenhum\",\n \"admin/editor.shelf.skusFilter.first-available\": \"Primeiro Disponível\",\n \"admin/editor.shelf.skusFilter.all-available\": \"Todos Disponíveis\",\n \"admin/editor.shelf.maxItems.title\": \"Quantidade máxima de itens\",\n \"admin/editor.shelf.itemsPerPage.title\": \"Itens por Página (web)\",\n \"admin/editor.shelf.gap.title\": \"Espaço entre os itens\",\n \"admin/editor.shelf.scrollType.title\": \"Tipo de Rolagem\",\n \"admin/editor.shelf.arrows.title\": \"Setas (web)\",\n \"admin/editor.shelf.titleText.showTitle\": \"Exibir título da vitrine\",\n \"admin/editor.shelf.titleText.title\": \"Texto do Título\",\n \"admin/editor.shelf.specificationFilters.title\": \"Filtros de Especificação\",\n \"admin/editor.shelf.specificationFilters.item.title\": \"Item de Filtro de Especificação\",\n \"admin/editor.shelf.specificationFilters.item.id.title\": \"ID do Filtro de Especificação\",\n \"admin/editor.shelf.specificationFilters.item.value.title\": \"Valor do Filtro de Especificação\",\n \"admin/editor.shelf.gapType.none\": \"Nenhum\",\n \"admin/editor.shelf.gapType.small\": \"Pequeno\",\n \"admin/editor.shelf.gapType.medium\": \"Médio\",\n \"admin/editor.shelf.gapType.large\": \"Grande\",\n \"admin/editor.shelf.orderType.sales\": \"Vendas\",\n \"admin/editor.shelf.orderType.priceDesc\": \"Preço, descrescente\",\n \"admin/editor.shelf.orderType.priceAsc\": \"Preço, crescente\",\n \"admin/editor.shelf.orderType.nameAsc\": \"Nome, crescente\",\n \"admin/editor.shelf.orderType.nameDesc\": \"Nome, decrescente\",\n \"admin/editor.shelf.orderType.releaseDate\": \"Data de lançamento\",\n \"admin/editor.shelf.orderType.discount\": \"Desconto\",\n \"admin/editor.shelf.orderType.relevance\": \"Relevância\",\n \"admin/editor.shelf.scrollType.byPage\": \"Por Página\",\n \"admin/editor.shelf.scrollType.oneByOne\": \"Um por Um\",\n \"admin/editor.shelf.advanced-properties.title\": \"Configurações avançadas\",\n \"admin/editor.shelf.advanced-properties.tracking-id.title\": \"Nome da vitrine no GTM\",\n \"admin/editor.shelf.advanced-properties.tracking-id.description\": \"Nome a ser exibido no Google Analytics. Se nada for adicionado o nome do bloco da vitrine será usado.\",\n \"admin/editor.relatedProducts.title\": \"Produtos Relacionados\",\n \"admin/editor.relatedProducts.description\": \"Uma vitrine de produtos recomendados para ver\",\n \"admin/editor.relatedProducts.recommendation\": \"Recomendações\",\n \"admin/editor.relatedProducts.recommendation.description\": \"Quais recomendações serão mostradas\",\n \"admin/editor.relatedProducts.similars\": \"Produtos similares\",\n \"admin/editor.relatedProducts.view\": \"Quem viu isto, também viu...\",\n \"admin/editor.relatedProducts.buy\": \"Quem comprou isto, também comprou...\",\n \"admin/editor.relatedProducts.accessories\": \"Produtos de acessórios\",\n \"admin/editor.relatedProducts.viewAndBought\": \"Quem viu isto, comprou também...\",\n \"admin/editor.relatedProducts.suggestions\": \"Sugestões\",\n \"admin/editor.relatedProducts.groupBy.title\": \"Agrupar por\",\n \"admin/editor.relatedProducts.groupBy.description\": \"Agrupar listas de recomendações\",\n \"admin/editor.relatedProducts.groupBy.product\": \"Produtos\",\n \"admin/editor.relatedProducts.groupBy.none\": \"Não agrupar\",\n \"store/shelf.title\": \"Melhores Produtos\",\n \"admin/editor.shelf-properties.title.title\": \"Título\",\n \"admin/editor.shelf-properties.title.description\": \"Título da vitrine\",\n \"admin/editor.shelf-properties.show-title.title\": \"Mostrar título\",\n \"admin/editor.shelf-properties.show-title.description\": \"Se deveria mostrar o título da vitrine\",\n \"admin/editor.shelf-properties.min-items-per-page.title\": \"Mínimo de itens por janela de slide\",\n \"admin/editor.shelf-properties.min-items-per-page.description\": \"A quantidade mínima de itens que devem estar na tela ao mesmo tempo (ex. 1/2/3)\",\n \"admin/editor.shelf-properties.items-per-page.title\": \"Itens por janela do slide\",\n \"admin/editor.shelf-properties.items-per-page.description\": \"A quantidade de itens que devem estar na tela ao mesmo tempo (ex. 1/2/3)\",\n \"admin/editor.shelf-properties.arrows.title\": \"Mostrar setas\",\n \"admin/editor.shelf-properties.arrows.description\": \"Se deveria exibir as setas para controlar a vitrine\",\n \"admin/editor.shelf-properties.autoplay.title\": \"Reprodução automática\",\n \"admin/editor.shelf-properties.autoplay.description\": \"Se deveria passar os slides automaticamente\",\n \"admin/editor.shelf-properties.navigation-step.title\": \"Passo de navegação\",\n \"admin/editor.shelf-properties.navigation-step.description\": \"Quantos itens ele deve passar quando as setas são clicadas. Você pode passar um número ou \\\"page\\\" (sem as aspas) para passar todos os itens da janela\"\n}\n\n```" } ]
code_shelf_202ab15d
[ { "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 shelf/messages/en.json from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"admin/editor.shelf.title\": \"Shelf\",\n \"admin/editor.shelf.description\": \"A product shelf featuring a collection\",\n \"admin/editor.shelf.category.title\": \"Category Id\",\n \"admin/editor.shelf.category.description\": \"For sub-categories, use \\\"/\\\" (e.g. 1/2/3)\",\n \"admin/editor.shelf.collection.title\": \"Collection\",\n \"admin/editor.shelf.orderBy.title\": \"List Ordenation\",\n \"admin/editor.shelf.hideUnavailableItems\": \"Hide unavailable items\",\n \"admin/editor.shelf.hideOutOfStockItems\": \"Hide out of stock items\",\n \"admin/editor.shelf.skusFilter\": \"SKUs Filter\",\n \"admin/editor.shelf.skusFilter.description\": \"Setting the first available filter makes your query much faster!\",\n \"admin/editor.shelf.skusFilter.none\": \"None\",\n \"admin/editor.shelf.skusFilter.first-available\": \"First Available\",\n \"admin/editor.shelf.skusFilter.all-available\": \"All Available\",\n \"admin/editor.shelf.maxItems.title\": \"Max Items\",\n \"admin/editor.shelf.itemsPerPage.title\": \"Items Per Page (web)\",\n \"admin/editor.shelf.gap.title\": \"Gap between Items\",\n \"admin/editor.shelf.scrollType.title\": \"Scroll Type\",\n \"admin/editor.shelf.arrows.title\": \"Arrows (web)\",\n \"admin/editor.shelf.titleText.showTitle\": \"Show title of the shelf\",\n \"admin/editor.shelf.titleText.title\": \"Title Text\",\n \"admin/editor.shelf.specificationFilters.title\": \"Specification Filters\",\n \"admin/editor.shelf.specificationFilters.item.title\": \"Specification Filter Item\",\n \"admin/editor.shelf.specificationFilters.item.id.title\": \"Specification Filter ID\",\n \"admin/editor.shelf.specificationFilters.item.value.title\": \"Specification Filter Value\",\n \"admin/editor.shelf.gapType.none\": \"None\",\n \"admin/editor.shelf.gapType.small\": \"Small\",\n \"admin/editor.shelf.gapType.medium\": \"Medium\",\n \"admin/editor.shelf.gapType.large\": \"Large\",\n \"admin/editor.shelf.orderType.sales\": \"Sales\",\n \"admin/editor.shelf.orderType.priceDesc\": \"Price, descending\",\n \"admin/editor.shelf.orderType.priceAsc\": \"Price, ascending\",\n \"admin/editor.shelf.orderType.nameAsc\": \"Name, ascending\",\n \"admin/editor.shelf.orderType.nameDesc\": \"Name, descending\",\n \"admin/editor.shelf.orderType.releaseDate\": \"Release Date\",\n \"admin/editor.shelf.orderType.discount\": \"Discount\",\n \"admin/editor.shelf.orderType.relevance\": \"Relevance\",\n \"admin/editor.shelf.scrollType.byPage\": \"By Page\",\n \"admin/editor.shelf.scrollType.oneByOne\": \"One by One\",\n \"admin/editor.shelf.advanced-properties.title\": \"Advanced Configurations\",\n \"admin/editor.shelf.advanced-properties.tracking-id.title\": \"GTM Shelf name\",\n \"admin/editor.shelf.advanced-properties.tracking-id.description\": \"Name to show in the Google Analytics. If nothing is passed it will use the name of the block instead\",\n \"admin/editor.relatedProducts.title\": \"Related Products\",\n \"admin/editor.relatedProducts.description\": \"A related products shelf to show view recommendations\",\n \"admin/editor.relatedProducts.recommendation\": \"Recommendations\",\n \"admin/editor.relatedProducts.recommendation.description\": \"Which recommendations will be shown\",\n \"admin/editor.relatedProducts.similars\": \"Similar products\",\n \"admin/editor.relatedProducts.view\": \"Who saw this, also saw...\",\n \"admin/editor.relatedProducts.buy\": \"Who bought this, also bought...\",\n \"admin/editor.relatedProducts.accessories\": \"Accessories products\",\n \"admin/editor.relatedProducts.viewAndBought\": \"Who saw this, also bought...\",\n \"admin/editor.relatedProducts.suggestions\": \"Suggestions\",\n \"admin/editor.relatedProducts.groupBy.title\": \"Group by\",\n \"admin/editor.relatedProducts.groupBy.description\": \"Group recommendation list\",\n \"admin/editor.relatedProducts.groupBy.product\": \"Products\",\n \"admin/editor.relatedProducts.groupBy.none\": \"Do not group\",\n \"store/shelf.title\": \"Best Products\",\n \"admin/editor.tabbed-shelf.title\": \"Tabbed Shelf\",\n \"admin/editor.tabbed-shelf.description\": \"Tabbed Shelf featured product module\",\n \"admin/editor.tabbed-shelf.isEnabled.title\": \"Enabled\",\n \"admin/editor.tabbed-shelf.headline\": \"Headline\",\n \"admin/editor.tabbed-shelf.bottomText\": \"Bottom Text\",\n \"admin/editor.tabbed-shelf.buttonText\": \"Button Text\",\n \"admin/editor.tabbed-shelf.buttonUrl\": \"Button URL (absolute)\",\n \"admin/editor.tabbed-shelf.tabs.items\": \"Category Item\",\n \"admin/editor.tabbed-shelf.tabs.items.id\": \"Category Id\",\n \"admin/editor.tabbed-shelf.tabs\": \"Tabs\",\n \"admin/editor.shelf-properties.title.title\": \"Title\",\n \"admin/editor.shelf-properties.title.description\": \"Title of the shelf\",\n \"admin/editor.shelf-properties.show-title.title\": \"Show title\",\n \"admin/editor.shelf-properties.show-title.description\": \"If it should show the title of the shelf\",\n \"admin/editor.shelf-properties.min-items-per-page.title\": \"Minimum items per page\",\n \"admin/editor.shelf-properties.min-items-per-page.description\": \"The minimum amount of items that should be on the screen at the same time (e.g. 1/2/3)\",\n \"admin/editor.shelf-properties.items-per-page.title\": \"Items per slide window\",\n \"admin/editor.shelf-properties.items-per-page.description\": \"The amount of items that should be on the screen at the same time (e.g. 1/2/3)\",\n \"admin/editor.shelf-properties.arrows.title\": \"Show arrows\",\n \"admin/editor.shelf-properties.arrows.description\": \"If it should display the arrows to control the shelf\",\n \"admin/editor.shelf-properties.autoplay.title\": \"Autoplay\",\n \"admin/editor.shelf-properties.autoplay.description\": \"If it should be passing the slides automatically\",\n \"admin/editor.shelf-properties.navigation-step.title\": \"Navigation step\",\n \"admin/editor.shelf-properties.navigation-step.description\": \"How many items it should pass when the arrows are clicked. You can pass a number or you can pass \\\"page\\\" (without the quotes) to pass all the items of the window\"\n}\n\n```" } ]
code_shelf_3ba6284b
[ { "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 shelf/messages/context.json from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"admin/editor.shelf.title\": \"admin/editor.shelf.title\",\n \"admin/editor.shelf.description\": \"admin/editor.shelf.description\",\n \"admin/editor.shelf.category.title\": \"admin/editor.shelf.category.title\",\n \"admin/editor.shelf.category.description\": \"admin/editor.shelf.category.description\",\n \"admin/editor.shelf.collection.title\": \"admin/editor.shelf.collection.title\",\n \"admin/editor.shelf.orderBy.title\": \"admin/editor.shelf.orderBy.title\",\n \"admin/editor.shelf.hideUnavailableItems\": \"admin/editor.shelf.hideUnavailableItems\",\n \"admin/editor.shelf.hideOutOfStockItems\": \"admin/editor.shelf.hideOutOfStockItems\",\n \"admin/editor.shelf.skusFilter\": \"admin/editor.shelf.skusFilter\",\n \"admin/editor.shelf.skusFilter.description\": \"admin/editor.shelf.skusFilter.description\",\n \"admin/editor.shelf.skusFilter.none\": \"admin/editor.shelf.skusFilter.none\",\n \"admin/editor.shelf.skusFilter.first-available\": \"admin/editor.shelf.skusFilter.first-available\",\n \"admin/editor.shelf.skusFilter.all-available\": \"admin/editor.shelf.skusFilter.all-available\",\n \"admin/editor.shelf.maxItems.title\": \"admin/editor.shelf.maxItems.title\",\n \"admin/editor.shelf.itemsPerPage.title\": \"admin/editor.shelf.itemsPerPage.title\",\n \"admin/editor.shelf.gap.title\": \"admin/editor.shelf.gap.title\",\n \"admin/editor.shelf.scrollType.title\": \"admin/editor.shelf.scrollType.title\",\n \"admin/editor.shelf.arrows.title\": \"admin/editor.shelf.arrows.title\",\n \"admin/editor.shelf.titleText.showTitle\": \"admin/editor.shelf.titleText.showTitle\",\n \"admin/editor.shelf.titleText.title\": \"admin/editor.shelf.titleText.title\",\n \"admin/editor.shelf.specificationFilters.title\": \"admin/editor.shelf.specificationFilters.title\",\n \"admin/editor.shelf.specificationFilters.item.title\": \"admin/editor.shelf.specificationFilters.item.title\",\n \"admin/editor.shelf.specificationFilters.item.id.title\": \"admin/editor.shelf.specificationFilters.item.id.title\",\n \"admin/editor.shelf.specificationFilters.item.value.title\": \"admin/editor.shelf.specificationFilters.item.value.title\",\n \"admin/editor.shelf.gapType.none\": \"admin/editor.shelf.gapType.none\",\n \"admin/editor.shelf.gapType.small\": \"admin/editor.shelf.gapType.small\",\n \"admin/editor.shelf.gapType.medium\": \"admin/editor.shelf.gapType.medium\",\n \"admin/editor.shelf.gapType.large\": \"admin/editor.shelf.gapType.large\",\n \"admin/editor.shelf.orderType.sales\": \"admin/editor.shelf.orderType.sales\",\n \"admin/editor.shelf.orderType.priceDesc\": \"admin/editor.shelf.orderType.priceDesc\",\n \"admin/editor.shelf.orderType.priceAsc\": \"admin/editor.shelf.orderType.priceAsc\",\n \"admin/editor.shelf.orderType.nameAsc\": \"admin/editor.shelf.orderType.nameAsc\",\n \"admin/editor.shelf.orderType.nameDesc\": \"admin/editor.shelf.orderType.nameDesc\",\n \"admin/editor.shelf.orderType.releaseDate\": \"admin/editor.shelf.orderType.releaseDate\",\n \"admin/editor.shelf.orderType.discount\": \"admin/editor.shelf.orderType.discount\",\n \"admin/editor.shelf.orderType.relevance\": \"admin/editor.shelf.orderType.relevance\",\n \"admin/editor.shelf.scrollType.byPage\": \"admin/editor.shelf.scrollType.byPage\",\n \"admin/editor.shelf.scrollType.oneByOne\": \"admin/editor.shelf.scrollType.oneByOne\",\n \"admin/editor.shelf.advanced-properties.title\": \"Advanced Configurations\",\n \"admin/editor.shelf.advanced-properties.tracking-id.title\": \"GTM Shelf name\",\n \"admin/editor.shelf.advanced-properties.tracking-id.description\": \"Name to show in the Google Analytics. If you don't pass anything it will show the name of the block instead\",\n \"admin/editor.relatedProducts.title\": \"admin/editor.relatedProducts.title\",\n \"admin/editor.relatedProducts.description\": \"admin/editor.relatedProducts.description\",\n \"admin/editor.relatedProducts.recommendation\": \"admin/editor.relatedProducts.recommendation\",\n \"admin/editor.relatedProducts.recommendation.description\": \"admin/editor.relatedProducts.recommendation.description\",\n \"admin/editor.relatedProducts.similars\": \"admin/editor.relatedProducts.similars\",\n \"admin/editor.relatedProducts.view\": \"admin/editor.relatedProducts.view\",\n \"admin/editor.relatedProducts.buy\": \"admin/editor.relatedProducts.buy\",\n \"admin/editor.relatedProducts.accessories\": \"admin/editor.relatedProducts.accessories\",\n \"admin/editor.relatedProducts.viewAndBought\": \"admin/editor.relatedProducts.viewAndBought\",\n \"admin/editor.relatedProducts.suggestions\": \"admin/editor.relatedProducts.suggestions\",\n \"admin/editor.relatedProducts.groupBy.title\": \"admin/editor.relatedProducts.groupBy.title\",\n \"admin/editor.relatedProducts.groupBy.description\": \"admin/editor.relatedProducts.groupBy.description\",\n \"admin/editor.relatedProducts.groupBy.product\": \"admin/editor.relatedProducts.groupBy.product\",\n \"admin/editor.relatedProducts.groupBy.none\": \"admin/editor.relatedProducts.groupBy.none\",\n \"store/shelf.title\": \"store/shelf.title\",\n \"admin/editor.tabbed-shelf.title\": \"Component title\",\n \"admin/editor.tabbed-shelf.description\": \"Component description\",\n \"admin/editor.tabbed-shelf.isEnabled.title\": \"True if component is enabled\",\n \"admin/editor.tabbed-shelf.headline\": \"Text to be showed as headline\",\n \"admin/editor.tabbed-shelf.bottomText\": \"Bottom Text\",\n \"admin/editor.tabbed-shelf.tabs\": \"Category Tabs\",\n \"admin/editor.tabbed-shelf.buttonText\": \"Text to be displayed inside button\",\n \"admin/editor.tabbed-shelf.buttonUrl\": \"Button URL (absolute)\",\n \"admin/editor.tabbed-shelf.tabs.items\": \"Category Item\",\n \"admin/editor.tabbed-shelf.tabs.items.id\": \"Category Id\",\n \"admin/editor.tabbed-shelf.shelf.title\": \"Shelf properties\",\n \"admin/editor.shelf-properties.title.title\": \"Title\",\n \"admin/editor.shelf-properties.title.description\": \"Title of the shelf\",\n \"admin/editor.shelf-properties.show-title.title\": \"Show title\",\n \"admin/editor.shelf-properties.show-title.description\": \"If it should show the title of the shelf\",\n \"admin/editor.shelf-properties.min-items-per-page.title\": \"Minimum items per page\",\n \"admin/editor.shelf-properties.min-items-per-page.description\": \"The minimum amount of items that should be on the screen at the same time (e.g. 1/2/3)\",\n \"admin/editor.shelf-properties.items-per-page.title\": \"Items per slide window\",\n \"admin/editor.shelf-properties.items-per-page.description\": \"The amount of items that should be on the screen at the same time (e.g. 1/2/3)\",\n \"admin/editor.shelf-properties.arrows.title\": \"Show arrows\",\n \"admin/editor.shelf-properties.arrows.description\": \"If it should display the arrows to control the shelf\",\n \"admin/editor.shelf-properties.autoplay.title\": \"Autoplay\",\n \"admin/editor.shelf-properties.autoplay.description\": \"If it should be passing the slides automatically\",\n \"admin/editor.shelf-properties.navigation-step.title\": \"Navigation step\",\n \"admin/editor.shelf-properties.navigation-step.description\": \"How many items it should pass when the arrows are clicked. You can pass a number or you can pass \\\"page\\\" (without the quotes) to pass all the items of the window\"\n}\n\n```" } ]
code_shelf_b9c5d30b
[ { "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 shelf/messages/es.json from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"admin/editor.shelf.title\": \"Vitrina\",\n \"admin/editor.shelf.description\": \"Una vitrina con una colección de productos\",\n \"admin/editor.shelf.category.title\": \"Id de la Categoría\",\n \"admin/editor.shelf.category.description\": \"Para subcategorías, utilice \\\"/\\\" (por ejemplo: 1/2/3)\",\n \"admin/editor.shelf.collection.title\": \"Colección\",\n \"admin/editor.shelf.orderBy.title\": \"Ordenación de la Lista\",\n \"admin/editor.shelf.hideUnavailableItems\": \"Ocultar artículos no disponibles\",\n \"admin/editor.shelf.hideOutOfStockItems\": \"Ocultar ítems sin stock\",\n \"admin/editor.shelf.skusFilter\": \"Filtro de SKUs\",\n \"admin/editor.shelf.skusFilter.description\": \"¡Establecer el primer iten disponible agiliza su consulta!\",\n \"admin/editor.shelf.skusFilter.none\": \"Ninguno\",\n \"admin/editor.shelf.skusFilter.all-available\": \"Todos disponibles\",\n \"admin/editor.shelf.skusFilter.first-available\": \"Primero disponible\",\n \"admin/editor.shelf.maxItems.title\": \"Cantidad máxima de Elementos\",\n \"admin/editor.shelf.itemsPerPage.title\": \"Productos por Página (web)\",\n \"admin/editor.shelf.gap.title\": \"Brecha entre los elementos\",\n \"admin/editor.shelf.scrollType.title\": \"Tipo de Desplazamiento\",\n \"admin/editor.shelf.arrows.title\": \"Dardos (web)\",\n \"admin/editor.shelf.titleText.title\": \"Texto del Título\",\n \"admin/editor.shelf.titleText.showTitle\": \"Exibir título del vitrina\",\n \"admin/editor.shelf.specificationFilters.title\": \"Filtros de especificación\",\n \"admin/editor.shelf.specificationFilters.item.title\": \"Elemento de filtro de especificación\",\n \"admin/editor.shelf.specificationFilters.item.id.title\": \"ID del filtro de especificación\",\n \"admin/editor.shelf.specificationFilters.item.value.title\": \"Valor del filtro de especificación\",\n \"admin/editor.shelf.gapType.none\": \"Ninguno\",\n \"admin/editor.shelf.gapType.small\": \"Pequeño\",\n \"admin/editor.shelf.gapType.medium\": \"Medio\",\n \"admin/editor.shelf.gapType.large\": \"Grande\",\n \"admin/editor.shelf.orderType.sales\": \"Ventas\",\n \"admin/editor.shelf.orderType.priceDesc\": \"Precio, descendiendo\",\n \"admin/editor.shelf.orderType.priceAsc\": \"Precio, ascendente\",\n \"admin/editor.shelf.orderType.nameAsc\": \"Nombre, ascendente\",\n \"admin/editor.shelf.orderType.nameDesc\": \"Nombre, descendiendo\",\n \"admin/editor.shelf.orderType.releaseDate\": \"Fecha de lanzamiento\",\n \"admin/editor.shelf.orderType.discount\": \"Descuento\",\n \"admin/editor.shelf.orderType.relevance\": \"Relevancia\",\n \"admin/editor.shelf.scrollType.byPage\": \"Por Página\",\n \"admin/editor.shelf.scrollType.oneByOne\": \"Uno a Uno\",\n \"admin/editor.shelf.advanced-properties.title\": \"Configuraciones avanzadas\",\n \"admin/editor.shelf.advanced-properties.tracking-id.title\": \"Nombre del estante en el GTM\",\n \"admin/editor.shelf.advanced-properties.tracking-id.description\": \"Nombre para mostrar en Google Analytics. Se no se agrega nada, se utilizará el nombre del bloque del estante\",\n \"admin/editor.relatedProducts.title\": \"Productos Relacionados\",\n \"admin/editor.relatedProducts.description\": \"Una vitrina de productos relacionados para mostrar recomendaciones de vista\",\n \"admin/editor.relatedProducts.recommendation\": \"Recomendaciones\",\n \"admin/editor.relatedProducts.recommendation.description\": \"Qué recomendaciones se mostrará\",\n \"admin/editor.relatedProducts.similars\": \"Productos similares\",\n \"admin/editor.relatedProducts.view\": \"Quién vio esto, también vio...\",\n \"admin/editor.relatedProducts.buy\": \"Quién compró esto, también compró...\",\n \"admin/editor.relatedProducts.accessories\": \"Productos de accesorios\",\n \"admin/editor.relatedProducts.viewAndBought\": \"Quien vio esto, también compró ...\",\n \"admin/editor.relatedProducts.suggestions\": \"Sugerencias\",\n \"admin/editor.relatedProducts.groupBy.title\": \"Agrupar\",\n \"admin/editor.relatedProducts.groupBy.description\": \"Agrupar lista de recomendaciones\",\n \"admin/editor.relatedProducts.groupBy.product\": \"Productos\",\n \"admin/editor.relatedProducts.groupBy.none\": \"No agrupar\",\n \"store/shelf.title\": \"Mejores Productos\",\n \"admin/editor.shelf-properties.title.title\": \"Título\",\n \"admin/editor.shelf-properties.title.description\": \"Título del estante\",\n \"admin/editor.shelf-properties.show-title.title\": \"Mostrar título\",\n \"admin/editor.shelf-properties.show-title.description\": \"Si debe mostrar el título del vitrina\",\n \"admin/editor.shelf-properties.min-items-per-page.title\": \"Artículos mínimos por página\",\n \"admin/editor.shelf-properties.min-items-per-page.description\": \"La cantidad mínima de elementos que deben estar en la pantalla al mismo tiempo (ejemplo 1/2/3)\",\n \"admin/editor.shelf-properties.items-per-page.title\": \"Artículos por ventana de diapositivas\",\n \"admin/editor.shelf-properties.items-per-page.description\": \"La cantidad de elementos que deberían estar en la pantalla al mismo tiempo (ejemplo 1/2/3)\",\n \"admin/editor.shelf-properties.arrows.title\": \"Mostrar flechas\",\n \"admin/editor.shelf-properties.arrows.description\": \"Si debe mostrar las flechas para controlar el vitrina\",\n \"admin/editor.shelf-properties.autoplay.title\": \"Reproducción automática\",\n \"admin/editor.shelf-properties.autoplay.description\": \"Si pasar diapositivas automáticamente\",\n \"admin/editor.shelf-properties.navigation-step.title\": \"Paso de navegación\",\n \"admin/editor.shelf-properties.navigation-step.description\": \"Cuántos elementos debe pasar cuando se hace clic en las flechas. Puede pasar un número o puede passar \\\"page\\\" 9sin las comillas) para pasar todos los elementos de la ventana\"\n}\n\n```" } ]
code_shelf_18c45bfa
[ { "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 shelf/docs/README.md from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n📢 Use this project, [contribute](https://github.com/vtex-apps/shelf) to it or open issues to help evolve it using [Store Discussion](https://github.com/vtex-apps/store-discussion).\n\n# Shelf\n\n>⚠️ With the goal of displaying a flexible product list, the `shelf` and `shelf.relatedProducts` blocks are deprecated and now configured using the [Product Summary List](https://developers.vtex.com/docs/guides/vtex-product-summary-productsummarylist), the [Product Summary Shelf](https://developers.vtex.com/docs/guides/vtex-product-summary), and the [Slider Layout](https://developers.vtex.com/docs/guides/vtex-slider-layout) blocks. To learn how to configure it, please refer to [Building a Shelf](https://developers.vtex.com/docs/guides/vtex-io-documentation-building-a-shelf).\n\nThe Shelf app displays a list of products on your store pages, helping you build your shop window and work on your visual merchandising.\n\n![shelf](https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-shelf-0.png)\n\n## Configuration\n\n1. Add the `shelf` app to your theme dependencies in the `manifest.json` file:\n\n```json\n \"dependencies\": {\n \"vtex.shelf\": \"1.x\",\n }\n```\n\nNow, you can use all the blocks exported by the `shelf` app. See the full list below:\n\n| Block name | Description |\n| - | - |\n| `shelf` | ![https://img.shields.io/badge/-Deprecated-red](https://img.shields.io/badge/-Deprecated-red) Renders a list of products in the store home page. |\n| `shelf.relatedProducts` | ![https://img.shields.io/badge/-Deprecated-red](https://img.shields.io/badge/-Deprecated-red) Renders a list of related products in the product details page. |\n\n2. Declare the `shelf.relatedProduct` in the product template (`store.product`) using its props. For example:\n\n```json\n{\n \"store.product\": {\n \"children\": [\n \"breadcrumb\",\n \"flex-layout.row#main\",\n \"shelf.relatedProducts\"\n ]\n }\n}\n```\n\n>⚠️ Warning\n>\n> Note that for hiding unavailable/out-of-stock items, there are 2 different props: `hideUnavailableItems` and `hideOutOfStockItems`. They do the same thing, but each is used by a different component: `Shelf` and `RelatedProducts`, respectively.\n\n### Shelf\n\n| Prop name | Type | Description | Default value |\n| ---------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------- |\n| `category` | `String` | The category ID |\n| `collection` | `String` | The collection ID |\n| `orderBy` | `Enum` | `OrderByTopSaleDESC`, `OrderByPriceDESC`, `OrderByPriceASC`, `OrderByNameASC`, `OrderByNameDESC`, `OrderByReleaseDateDESC`, `OrderByBestDiscountDESC` |\n| `hideUnavailableItems` | `Boolean` | Whether out of stock items should be hidden (`true`) or not (`false`) | `false` |\n| `paginationDotsVisibility` | `Enum` | `visible`, `hidden`, `mobileOnly`, `desktopOnly` |\n| `productList` | `ProductListSchema` | Product list schema. See `ProductListSchema` | - |\n| `trackingId` | `String` | Name to show in the Google Analytics. If nothing is passed it will use the name of the block instead |\n| `maxItems` | `Number` | Max items |\n\n### RelatedProducts\n\n| Prop name | Type | Description | Default value |\n| - | - | - | - |\n| `recommendation` | `enum` | Type of recommendations that will be displayed on the shelf. Possible values: `similars`, `suggestions`, and `accessories` (these depend on the product information given in the Admin Catalog); and `view`, `buy`, and `viewandBought` (these are automatically generated according to the activity of the store). | `similars` |\n| `groupBy` | `enum` | Defines if you are ot nog going to group your recommendations by: `PRODUCT` (only display individual products and not SKUs, limited by 12 products) or `NONE` (if you want to display all registered SKUs, limited by 50 products). | `PRODUCT` |\n| `hideOutOfStockItems` | `boolean` | Whether out of stock items should be hidden: (`true`) or (`false`). | `false` |\n| `productList` | `ProductListSchema` | Product list schema. See `ProductListSchema`. | - |\n\n`ProductListSchema`:\n\n| Prop name | Type | Description | Default value |\n| - | - | - | - |\n| `maxItems` | `number` | Maximum number of items to be displayed on the related product shelf. | `10` |\n| `scroll` | `enum` | Slide transition scroll type. Possible values: `BY_PAGE`, and `ONE_BY_ONE`. | `BY_PAGE` |\n| `arrows` | `boolean` | Whether the arrows should be displayed on the shelf (`true`) or not (`false`). | `true` |\n| `showTitle` | `boolean` | Whether a title should be displayed on the product-related shelf (`true`) or not (`false`). | `true` |\n| `titleText` | `string` | Related product shelf title. | `null` |\n| `gap` | `enum` | Space between items being displayed. Possible values are: `ph0`, `ph3`,`ph5`, and `ph7`. | `ph3` |\n| `minItemsPerPage` | `number` | Minimum number of items per shelf slides. This prop defines how many items will be displayed on the related product shelf, even in the smallest screen size. Its value can be a float, which means that you can choose a multiple of `0.5` to indicate that you want to show a *peek* of the next slide on the shelf. | `1` |\n| `itemsPerPage` | `number` | Maximum number of items per shelf slides. This prop defines how many items will be displayed on the related product shelf, even in the largest screen size. Its value can be a float, which means that you can choose a multiple of `0.5` to indicate that you want to show a *peek* of the next slide on the shelf. | `5` |\n| `summary` | `object` | Schema declaring the desired related product shelf items. This prop object must contain the [`product-summary.shelf` block props](https://developers.vtex.com/docs/guides/vtex-product-summary#configuration). | `undefined` |\n' `infinite` | `boolean` | Determines whether the list should be infinite (`true`) or not (`false`). When this prop is set as `false`, the slider will have an explicit end for users. | `true` |\n\n## Customization\n\nTo apply CSS customizations to this and other blocks, follow the instructions in [Using CSS Handles for store customization](https://developers.vtex.com/docs/guides/vtex-io-documentation-using-css-handles-for-store-customization).\n\n| CSS Handles |\n| ----------------- |\n| `relatedProducts` |\n\n>⚠️ The CSS Handles list above refers to the `shelf.relatedProducts` block. Since the `shelf` block is deprecated, your shelf customization must be done using the CSS Handles available for the [Product Summary List](https://developers.vtex.com/docs/guides/vtex-product-summary-productsummarylist), the [Product Summary Shelf](https://developers.vtex.com/docs/guides/vtex-product-summary), and the [Slider Layout](https://developers.vtex.com/docs/guides/vtex-slider-layout) blocks.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n <tr>\n <td align=\"center\"><a href=\"https://github.com/sahanljc\"><img src=\"https://avatars2.githubusercontent.com/u/42151054?v=4\" width=\"100px;\" alt=\"\"/><br /><sub><b>Sahan Jayawardana</b></sub></a><br /><a href=\"https://github.com/vtex-apps/shelf/commits?author=sahanljc\" title=\"Code\">💻</a></td>\n <td align=\"center\"><a href=\"https://github.com/lucaspacheco-acct\"><img src=\"https://avatars0.githubusercontent.com/u/59736416?v=4\" width=\"100px;\" alt=\"\"/><br /><sub><b>Lucas Pacheco</b></sub></a><br /><a href=\"https://github.com/vtex-apps/shelf/commits?author=lucaspacheco-acct\" title=\"Code\">💻</a></td>\n </tr>\n</table>\n\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 welcome!\n\n```" } ]
code_shelf_68ce6294
[ { "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 shelf/react/Shelf.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport PropTypes from 'prop-types'\nimport React, { useMemo } from 'react'\nimport { graphql } from 'react-apollo'\nimport { Loading, useTreePath } from 'vtex.render-runtime'\nimport { useDevice } from 'vtex.device-detector'\nimport { useCssHandles } from 'vtex.css-handles'\nimport { ProductListContext } from 'vtex.product-list-context'\n\nimport OrdenationTypes, { getOrdenationValues } from './utils/OrdenationTypes'\nimport ProductList from './components/ProductList'\nimport {\n productListSchemaPropTypes,\n shelfContentPropTypes,\n} from './utils/propTypes'\nimport productsQuery from './queries/productsQuery.gql'\nimport { normalizeBuyable } from './utils/normalize'\n\nconst CSS_HANDLES = ['container']\n\nconst { ProductListProvider } = ProductListContext\n\n/**\n * Shelf Component. Queries a list of products and shows them.\n */\nconst Shelf = props => {\n const {\n data,\n paginationDotsVisibility = 'visible',\n maxItems,\n productList = ProductList.defaultProps,\n } = props\n let { trackingId } = props\n const treePath = useTreePath()\n const handles = useCssHandles(CSS_HANDLES)\n const { isMobile } = useDevice()\n const { loading, error, products } = data || {}\n if (!trackingId) {\n // Taking the block name to pass to listName if no trackingId is passed\n const treePathList =\n (typeof treePath === 'string' && treePath.split()) || []\n trackingId = treePathList[treePathList.length - 1] || 'List of products'\n }\n\n const filteredProducts = useMemo(() => {\n return products && products.map(normalizeBuyable).filter(Boolean)\n }, [products])\n\n const productListProps = {\n ...productList,\n maxItems,\n isMobile,\n loading,\n paginationDotsVisibility,\n products: filteredProducts,\n trackingId,\n }\n\n if (loading) {\n return <Loading />\n }\n\n if (error) {\n return null\n }\n\n return (\n <div className={`${handles.container} pv4 pb9`}>\n <ProductListProvider listName={trackingId}>\n <ProductList {...productListProps} />\n </ProductListProvider>\n </div>\n )\n}\n\nShelf.propTypes = {\n /** Graphql data response. */\n data: PropTypes.shape({\n products: shelfContentPropTypes.products,\n }),\n /** Category Id. */\n category: PropTypes.string,\n /** Collection Id. */\n collection: PropTypes.string,\n /** Ordenation Type. */\n orderBy: PropTypes.oneOf(getOrdenationValues()),\n /** Hide unavailable items */\n hideUnavailableItems: PropTypes.bool,\n /** Should display navigation dots below the Shelf */\n paginationDotsVisibility: PropTypes.oneOf([\n 'visible',\n 'hidden',\n 'mobileOnly',\n 'desktopOnly',\n ]),\n /** ProductList schema configuration */\n productList: PropTypes.shape(productListSchemaPropTypes),\n trackingId: PropTypes.string,\n maxItems: PropTypes.number,\n}\n\nconst parseFilters = ({ id, value }) => `specificationFilter_${id}:${value}`\n\nconst toBoolean = x => (typeof x === 'boolean' ? x : x === 'true')\n\nconst options = {\n options: ({\n category,\n collection,\n hideUnavailableItems,\n orderBy = OrdenationTypes.ORDER_BY_TOP_SALE_DESC.value,\n specificationFilters = [],\n maxItems = ProductList.defaultProps.maxItems,\n skusFilter,\n }) => ({\n ssr: true,\n variables: {\n ...(category && { category: category.toString() }),\n ...(collection && { collection: collection.toString() }),\n specificationFilters: specificationFilters.map(parseFilters),\n orderBy,\n from: 0,\n to: maxItems - 1,\n hideUnavailableItems: toBoolean(hideUnavailableItems),\n skusFilter,\n },\n }),\n}\n\nconst EnhancedShelf = graphql(productsQuery, options)(Shelf)\n\nEnhancedShelf.schema = {\n title: 'admin/editor.shelf.title',\n}\n\nexport default EnhancedShelf\n\n```" } ]
code_shelf_4bf52fed
[ { "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 shelf/react/TabbedShelf.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport TabbedShelf from './components/TabbedShelf/index'\n\nexport default TabbedShelf\n\n```" } ]
code_shelf_88f13784
[ { "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 shelf/react/RelatedProducts.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport React, { useMemo } from 'react'\nimport PropTypes from 'prop-types'\nimport path from 'ramda/es/path'\nimport last from 'ramda/es/last'\nimport { Query } from 'react-apollo'\nimport { useDevice } from 'vtex.device-detector'\nimport { ProductListContext } from 'vtex.product-list-context'\nimport { useProduct } from 'vtex.product-context'\nimport { useCssHandles } from 'vtex.css-handles'\nimport { useTreePath } from 'vtex.render-runtime'\n\nimport productRecommendationsQuery from './queries/productRecommendations.gql'\nimport ProductList from './components/ProductList'\nimport { productListSchemaPropTypes } from './utils/propTypes'\nimport { filterOutOfStock } from './utils/filterOutOfStock'\n\nconst CSS_HANDLES = ['relatedProducts']\n\nconst { ProductListProvider } = ProductListContext\n\n// Previous values were in a wrong format with the message string in the enum value.\nconst fixRecommendation = recommendation => {\n if (recommendation.includes('editor.relatedProducts.')) {\n return last(recommendation.split('.'))\n }\n return recommendation\n}\n\n/**\n * Related Products Component. Queries and shows the related products\n */\nconst RelatedProducts = ({\n productQuery,\n productList,\n groupBy,\n recommendation: cmsRecommendation,\n trackingId: rawTrackingId,\n hideOutOfStockItems,\n}) => {\n const handles = useCssHandles(CSS_HANDLES)\n const { isMobile } = useDevice()\n const treePath = useTreePath()\n\n const productContext = useProduct()\n\n let trackingId = rawTrackingId\n\n if (!trackingId) {\n // Taking the block name to pass to listName if no trackingId is passed\n const treePathList =\n (typeof treePath === 'string' && treePath.split()) || []\n trackingId = treePathList[treePathList.length - 1] || 'List of products'\n }\n\n const productId =\n path(['product', 'productId'], productQuery) ||\n path(['product', 'productId'], productContext)\n\n const recommendation = productId ? fixRecommendation(cmsRecommendation) : null\n const variables = useMemo(() => {\n if (!productId) {\n return null\n }\n\n return {\n identifier: { field: 'id', value: productId },\n type: recommendation,\n groupBy,\n }\n }, [productId, recommendation, groupBy])\n\n if (!productId) {\n return null\n }\n\n return (\n <Query\n query={productRecommendationsQuery}\n variables={variables}\n partialRefetch\n ssr={false}\n >\n {({ data, loading }) => {\n if (!data) {\n return null\n }\n const { productRecommendations = [] } = data\n\n const productListProps = {\n products: hideOutOfStockItems\n ? filterOutOfStock(productRecommendations)\n : productRecommendations,\n loading,\n ...productList,\n isMobile,\n trackingId,\n }\n return (\n <div className={handles.relatedProducts}>\n <ProductListProvider listName={trackingId}>\n <ProductList {...productListProps} />\n </ProductListProvider>\n </div>\n )\n }}\n </Query>\n )\n}\n\nRelatedProducts.propTypes = {\n /** Main product to have related products queried */\n slug: PropTypes.string,\n /** Graphql productQuery response. */\n productQuery: PropTypes.shape({\n /** Product to have related products queried */\n product: PropTypes.shape({\n productId: PropTypes.string,\n }),\n loading: PropTypes.bool,\n }),\n /** ProductList schema configuration */\n productList: PropTypes.shape(productListSchemaPropTypes),\n trackingId: PropTypes.string,\n hideOutOfStockItems: PropTypes.bool,\n}\n\nRelatedProducts.defaultProps = {\n recommendation: 'similars',\n productList: {\n ...ProductList.defaultProps,\n titleText: 'Related Products',\n },\n groupBy: 'PRODUCT',\n hideOutOfStockItems: false,\n}\n\nRelatedProducts.schema = {\n title: 'admin/editor.relatedProducts.title',\n description: 'admin/editor.relatedProducts.description',\n type: 'object',\n properties: {\n recommendation: {\n title: 'admin/editor.relatedProducts.recommendation',\n description: 'admin/editor.relatedProducts.recommendation.description',\n type: 'string',\n default: RelatedProducts.defaultProps.recommendation,\n enum: [\n 'similars',\n 'view',\n 'buy',\n 'accessories',\n 'viewAndBought',\n 'suggestions',\n ],\n enumNames: [\n 'admin/editor.relatedProducts.similars',\n 'admin/editor.relatedProducts.view',\n 'admin/editor.relatedProducts.buy',\n 'admin/editor.relatedProducts.accessories',\n 'admin/editor.relatedProducts.viewAndBought',\n 'admin/editor.relatedProducts.suggestions',\n ],\n },\n groupBy: {\n title: 'admin/editor.relatedProducts.groupBy.title',\n description: 'admin/editor.relatedProducts.groupBy.description',\n type: 'string',\n default: RelatedProducts.defaultProps.groupBy,\n enum: ['PRODUCT', 'NONE'],\n enumNames: [\n 'admin/editor.relatedProducts.groupBy.product',\n 'admin/editor.relatedProducts.groupBy.none',\n ],\n },\n productList: ProductList.schema,\n hideOutOfStockItems: {\n title: 'admin/editor.shelf.hideOutOfStockItems',\n type: 'boolean',\n default: false,\n },\n },\n}\n\nexport default RelatedProducts\n\n```" } ]
code_shelf_660db990
[ { "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 shelf/react/package.json from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"name\": \"vtex.shelf\",\n \"version\": \"1.49.0\",\n \"description\": \"A Shelf Component.\",\n \"license\": \"ISC\",\n \"author\": \"VTEX\",\n \"private\": true,\n \"scripts\": {\n \"test\": \"vtex-test-tools test\"\n },\n \"dependencies\": {\n \"classnames\": \"^2.2.6\",\n \"debounce\": \"^1.2.0\",\n \"ramda\": \"^0.25.0\",\n \"react-amphtml\": \"^4.0.2\",\n \"react-apollo\": \"^2.5.8\",\n \"react-intersection-observer\": \"^8.23.0\",\n \"react-intl\": \"^2.7.2\",\n \"react-resize-detector\": \"^3.4.0\"\n },\n \"devDependencies\": {\n \"@apollo/react-testing\": \"^3.1.4\",\n \"@types/graphql\": \"^14.5.0\",\n \"@types/react\": \"^16.9.3\",\n \"@vtex/test-tools\": \"^3.1.0\",\n \"@vtex/tsconfig\": \"^0.3.0\",\n \"babel-eslint\": \"^10.1.0\"\n }\n}\n\n```" } ]
code_shelf_af4e5963
[ { "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 shelf/react/ProductList.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport ProductList from './components/ProductList'\n\nexport default ProductList\n\n```" } ]
code_shelf_48758961
[ { "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 shelf/store/contentSchemas.json from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"definitions\": {\n \"Shelf\": {\n \"title\": \"admin/editor.shelf.title\",\n \"type\": \"object\",\n \"dependencies\": {\n \"advancedProperties\": {\n \"oneOf\": [\n {\n \"properties\": {\n \"advancedProperties\": {\n \"enum\": [true]\n },\n \"trackingId\": {\n \"title\": \"admin/editor.shelf.advanced-properties.tracking-id.title\",\n \"description\": \"admin/editor.shelf.advanced-properties.tracking-id.description\",\n \"type\": \"string\"\n }\n }\n }\n ]\n }\n },\n \"properties\": {\n \"category\": {\n \"title\": \"admin/editor.shelf.category.title\",\n \"description\": \"admin/editor.shelf.category.description\",\n \"type\": \"string\",\n \"isLayout\": false\n },\n \"specificationFilters\": {\n \"title\": \"admin/editor.shelf.specificationFilters.title\",\n \"type\": \"array\",\n \"items\": {\n \"title\": \"admin/editor.shelf.specificationFilters.item.title\",\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"admin/editor.shelf.specificationFilters.item.id.title\"\n },\n \"value\": {\n \"type\": \"string\",\n \"title\": \"admin/editor.shelf.specificationFilters.item.value.title\"\n }\n }\n }\n },\n \"collection\": {\n \"title\": \"admin/editor.shelf.collection.title\",\n \"type\": \"string\",\n \"isLayout\": false\n },\n \"orderBy\": {\n \"title\": \"admin/editor.shelf.orderBy.title\",\n \"type\": \"string\",\n \"enum\": [\n \"\",\n \"OrderByTopSaleDESC\",\n \"OrderByPriceDESC\",\n \"OrderByPriceASC\",\n \"OrderByNameASC\",\n \"OrderByNameDESC\",\n \"OrderByReleaseDateDESC\",\n \"OrderByBestDiscountDESC\"\n ],\n \"enumNames\": [\n \"admin/editor.shelf.orderType.relevance\",\n \"admin/editor.shelf.orderType.sales\",\n \"admin/editor.shelf.orderType.priceDesc\",\n \"admin/editor.shelf.orderType.priceAsc\",\n \"admin/editor.shelf.orderType.nameAsc\",\n \"admin/editor.shelf.orderType.nameDesc\",\n \"admin/editor.shelf.orderType.releaseDate\",\n \"admin/editor.shelf.orderType.discount\"\n ],\n \"default\": \"\",\n \"isLayout\": false\n },\n \"productList\": { \"$ref\": \"app:vtex.shelf#/definitions/ProductList\" },\n \"hideUnavailableItems\": {\n \"title\": \"admin/editor.shelf.hideUnavailableItems\",\n \"type\": \"boolean\",\n \"default\": false,\n \"isLayout\": false\n },\n \"skusFilter\": {\n \"title\": \"admin/editor.shelf.skusFilter\",\n \"description\": \"admin/editor.shelf.skusFilter.description\",\n \"type\": \"string\",\n \"default\": \"ALL_AVAILABLE\",\n \"enum\": [\"ALL_AVAILABLE\", \"ALL\", \"FIRST_AVAILABLE\"],\n \"enumNames\": [\n \"admin/editor.shelf.skusFilter.all-available\",\n \"admin/editor.shelf.skusFilter.none\",\n \"admin/editor.shelf.skusFilter.first-available\"\n ]\n },\n \"advancedProperties\": {\n \"title\": \"admin/editor.shelf.advanced-properties.title\",\n \"type\": \"boolean\",\n \"default\": false\n }\n }\n },\n \"ProductList\": {\n \"title\": \"admin/editor.shelf.title\",\n \"properties\": {\n \"maxItems\": {\n \"title\": \"admin/editor.shelf.maxItems.title\",\n \"type\": \"number\",\n \"default\": 10,\n \"isLayout\": true\n },\n \"arrows\": {\n \"title\": \"admin/editor.shelf-properties.arrows.title\",\n \"description\": \"admin/editor.shelf-properties.arrows.description\",\n \"type\": \"boolean\",\n \"isLayout\": false,\n \"default\": true\n },\n \"autoplay\": {\n \"title\": \"admin/editor.shelf-properties.autoplay.title\",\n \"description\": \"admin/editor.shelf-properties.autoplay.description\",\n \"type\": \"boolean\",\n \"isLayout\": false,\n \"default\": false\n },\n \"navigationStep\": {\n \"title\": \"admin/editor.shelf-properties.navigation-step.title\",\n \"description\": \"admin/editor.shelf-properties.navigation-step.description\",\n \"type\": \"string\",\n \"isLayout\": false\n },\n \"titleText\": {\n \"title\": \"admin/editor.shelf-properties.title.title\",\n \"description\": \"admin/editor.shelf-properties.title.description\",\n \"$ref\": \"app:vtex.native-types#/definitions/text\",\n \"isLayout\": false,\n \"default\": \"admin/editor.shelf.title\"\n },\n \"showTitle\": {\n \"title\": \"admin/editor.shelf-properties.show-title.title\",\n \"description\": \"admin/editor.shelf-properties.show-title.description\",\n \"type\": \"boolean\",\n \"default\": true,\n \"isLayout\": false\n },\n \"itemsPerPage\": {\n \"title\": \"admin/editor.shelf-properties.items-per-page.title\",\n \"description\": \"admin/editor.shelf-properties.items-per-page.description\",\n \"type\": \"number\",\n \"default\": 5,\n \"isLayout\": false\n },\n \"minItemsPerPage\": {\n \"title\": \"admin/editor.shelf-properties.min-items-per-page.title\",\n \"description\": \"admin/editor.shelf-properties.min-items-per-page.description\",\n \"type\": \"number\",\n \"isLayout\": false,\n \"default\": 1\n },\n \"gap\": {\n \"title\": \"admin/editor.shelf.gap.title\",\n \"type\": \"string\",\n \"enum\": [\n \"admin/editor.shelf.gapType.none\",\n \"admin/editor.shelf.gapType.small\",\n \"admin/editor.shelf.gapType.medium\",\n \"admin/editor.shelf.gapType.large\"\n ],\n \"enumNames\": [\"ph0\", \"ph3\", \"ph5\", \"ph7\"],\n \"default\": \"ph0\",\n \"isLayout\": true\n },\n \"scroll\": {\n \"title\": \"admin/editor.shelf.scrollType.title\",\n \"type\": \"string\",\n \"enum\": [\n \"admin/editor.shelf.scrollType.byPage\",\n \"admin/editor.shelf.scrollType.oneByOne\"\n ],\n \"enumNames\": [\"BY_PAGE\", \"ONE_BY_ONE\"],\n \"default\": \"BY_PAGE\",\n \"isLayout\": true\n }\n }\n }\n }\n}\n\n```" } ]
code_shelf_4b742139
[ { "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 shelf/store/interfaces.json from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"shelf\": {\n \"required\": [\"product-summary\"],\n \"component\": \"Shelf\",\n \"track\": [\"click\"],\n \"preview\": {\n \"type\": \"grid\",\n \"height\": 550\n },\n \"content\": {\n \"$ref\": \"app:vtex.shelf#/definitions/Shelf\"\n }\n },\n \"shelf.relatedProducts\": {\n \"required\": [\"product-summary\"],\n \"component\": \"RelatedProducts\",\n \"preview\": {\n \"type\": \"grid\",\n \"height\": 550\n }\n },\n \"shelf.tabbed\": {\n \"required\": [\"product-summary\"],\n \"component\": \"TabbedShelf\",\n \"preview\": {\n \"type\": \"grid\",\n \"height\": 550\n }\n }\n}\n\n```" } ]
code_shelf_a579fcca
[ { "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 shelf/react/__test__/Shelf.test.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\n/* eslint-env jest */\nimport React from 'react'\nimport { render } from '@vtex/test-tools/react'\n\nimport ProductList from '../components/ProductList'\n// eslint-disable-next-line jest/no-mocks-import\nimport { productMock } from '../__mocks__/productMock'\nimport Shelf from '../Shelf'\nimport { resolvePaginationDotsVisibility } from '../utils/resolvePaginationDots'\n\ndescribe('Shelf component', () => {\n const renderComponent = customProps => {\n const props = {\n maxItems: 1,\n itemsPerPage: 1,\n arrows: true,\n showTitle: true,\n }\n\n const titleText = 'store/shelf.title'\n const wrapper = render(\n <ProductList titleText={titleText} {...props} {...customProps} />\n )\n return wrapper\n }\n\n it('should be rendered', () => {\n const component = renderComponent()\n expect(component).toBeDefined()\n })\n\n it('should render nothing if there is no products', () => {\n const component = renderComponent({ products: [] })\n\n expect(component.container.querySelector('.title')).toBeFalsy()\n })\n\n it('should match the snapshot', () => {\n const component = renderComponent({ products: productMock })\n expect(component.asFragment()).toMatchSnapshot()\n })\n\n it('should show in Site Editor', () => {\n const { schema } = Shelf\n expect(schema).toBeDefined()\n expect(typeof schema.title).toBe('string')\n })\n})\n\ndescribe('Util functions', () => {\n it('should return the correct value for pagination dots visibility', () => {\n const MOBILE_ONLY = 'mobileOnly'\n const DESKTOP_ONLY = 'desktopOnly'\n const VISIBLE = 'visible'\n const HIDDEN = 'hidden'\n\n /** resolvePaginationDotsVisibility(visibility: string, isMobile: boolean) */\n expect(resolvePaginationDotsVisibility(MOBILE_ONLY, false)).toBeFalsy()\n expect(resolvePaginationDotsVisibility(MOBILE_ONLY, true)).toBeTruthy()\n\n expect(resolvePaginationDotsVisibility(DESKTOP_ONLY, false)).toBeTruthy()\n expect(resolvePaginationDotsVisibility(DESKTOP_ONLY, true)).toBeFalsy()\n\n expect(resolvePaginationDotsVisibility(VISIBLE, false)).toBeTruthy()\n expect(resolvePaginationDotsVisibility(VISIBLE, true)).toBeTruthy()\n\n expect(resolvePaginationDotsVisibility(HIDDEN, false)).toBeFalsy()\n expect(resolvePaginationDotsVisibility(HIDDEN, true)).toBeFalsy()\n })\n})\n\n```" } ]
code_shelf_1e077d5d
[ { "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 shelf/react/typings/vtex.native-types.d.ts from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module 'vtex.native-types' {\n import type { Component } from 'react'\n import type { InjectedIntl, InjectedIntlProps } from 'react-intl'\n\n interface FormatIOMessageParams {\n id: string\n intl: InjectedIntl\n }\n\n export const formatIOMessage: (params: FormatIOMessageParams) => string\n\n interface IOMessageProps extends InjectedIntlProps {\n id: string\n }\n\n export const IOMessage: Component<IOMessageProps>\n}\n\n```" } ]
code_shelf_0ae730b1
[ { "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 shelf/react/queries/productRecommendations.gql from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```graphql\nquery ProductRecommendations(\n $identifier: ProductUniqueIdentifier\n $type: CrossSelingInputEnum\n $groupBy: CrossSelingGroupByEnum\n) {\n productRecommendations(identifier: $identifier, type: $type, groupBy: $groupBy)\n @context(provider: \"vtex.search-graphql\") {\n cacheId\n productId\n productName\n productReference\n description\n link\n linkText\n brand\n brandId\n categories\n priceRange {\n sellingPrice {\n highPrice\n lowPrice\n }\n listPrice {\n highPrice\n lowPrice\n }\n }\n specificationGroups {\n name\n originalName\n specifications {\n name\n originalName\n values\n }\n }\n skuSpecifications {\n field {\n name\n originalName\n }\n values {\n name\n originalName\n }\n }\n items {\n name\n itemId\n measurementUnit\n unitMultiplier\n referenceId {\n Value\n }\n images {\n imageId\n imageLabel\n imageTag\n imageUrl\n imageText\n }\n variations {\n name\n values\n }\n sellers {\n sellerId\n sellerName\n addToCartLink\n sellerDefault\n commertialOffer {\n Installments(criteria: MAX) {\n Value\n InterestRate\n TotalValuePlusInterestRate\n NumberOfInstallments\n Name\n }\n AvailableQuantity\n CacheVersionUsedToCallCheckout\n ListPrice\n Price\n PriceValidUntil\n PriceWithoutDiscount\n RewardValue\n spotPrice\n Tax\n taxPercentage\n teasers {\n name\n }\n discountHighlights {\n name\n }\n }\n }\n }\n clusterHighlights {\n id\n name\n }\n productClusters {\n id\n name\n }\n properties {\n name\n values\n }\n }\n}\n\n```" } ]
code_shelf_6c65fe3a
[ { "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 shelf/react/queries/productsQuery.gql from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```graphql\nquery Products(\n $category: String\n $collection: String\n $specificationFilters: [String]\n $orderBy: String\n $from: Int\n $to: Int\n $hideUnavailableItems: Boolean = false\n $skusFilter: ItemsFilter = ALL_AVAILABLE\n) {\n products(\n category: $category\n collection: $collection\n specificationFilters: $specificationFilters\n orderBy: $orderBy\n from: $from\n to: $to\n hideUnavailableItems: $hideUnavailableItems\n ) @context(provider: \"vtex.search-graphql\") {\n cacheId\n productId\n productName\n productReference\n description\n link\n linkText\n brand\n brandId\n categories\n priceRange {\n sellingPrice {\n highPrice\n lowPrice\n }\n listPrice {\n highPrice\n lowPrice\n }\n }\n specificationGroups {\n name\n originalName\n specifications {\n name\n originalName\n values\n }\n }\n skuSpecifications {\n field {\n name\n originalName\n }\n values {\n name\n originalName\n }\n }\n items(filter: $skusFilter) {\n name\n itemId\n measurementUnit\n unitMultiplier\n referenceId {\n Value\n }\n images {\n imageUrl\n imageTag\n imageLabel\n }\n variations {\n name\n values\n }\n sellers {\n sellerId\n sellerName\n commertialOffer {\n Installments(criteria: MAX) {\n Value\n InterestRate\n TotalValuePlusInterestRate\n NumberOfInstallments\n Name\n }\n AvailableQuantity\n Price\n PriceWithoutDiscount\n ListPrice\n spotPrice\n Tax\n taxPercentage\n teasers {\n name\n }\n discountHighlights {\n name\n }\n }\n }\n }\n productClusters {\n id\n name\n }\n properties {\n name\n values\n }\n }\n}\n\n```" } ]
code_shelf_c9042976
[ { "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 shelf/react/utils/resolveSlidesNumber.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\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 */\nfunction resolveSlidesNumber(minPerPage, perPage, isMobile) {\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\nexport default resolveSlidesNumber\n\n```" } ]
code_shelf_3bfb6705
[ { "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 shelf/react/utils/normalize.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nfunction getBuyableSellers(sellers) {\n return sellers && sellers.length > 0\n ? sellers.filter(seller => seller.sellerId)\n : sellers\n}\n\nexport function normalizeBuyable(product) {\n if (!product || !product.items || product.items.length === 0) {\n return product\n }\n\n const buyableItems = product.items\n .map(item => ({\n ...item,\n sellers: getBuyableSellers(item.sellers),\n }))\n .filter(item => item && item.sellers && item.sellers.length > 0)\n\n return buyableItems ? { ...product, items: buyableItems } : null\n}\n\n```" } ]
code_shelf_073e64ed
[ { "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 shelf/react/utils/paddingEnum.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\n// eslint-disable-next-line no-restricted-imports\nimport { pluck, values } from 'ramda'\n\nconst gapPaddingTypes = {\n NONE: {\n name: 'admin/editor.shelf.gapType.none',\n value: 'ph0',\n },\n SMALL: {\n name: 'admin/editor.shelf.gapType.small',\n value: 'ph3',\n },\n MEDIUM: {\n name: 'admin/editor.shelf.gapType.medium',\n value: 'ph5',\n },\n LARGE: {\n name: 'admin/editor.shelf.gapType.large',\n value: 'ph7',\n },\n}\n\nexport const getGapPaddingNames = () => values(pluck('name', gapPaddingTypes))\n\nexport const getGapPaddingValues = () => values(pluck('value', gapPaddingTypes))\n\nexport default gapPaddingTypes\n\n```" } ]
code_shelf_13f8a954
[ { "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 shelf/react/utils/filterOutOfStock.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nexport function filterOutOfStock(products = []) {\n return products.filter(\n product => product.items[0]?.sellers[0]?.commertialOffer?.AvailableQuantity\n )\n}\n\n```" } ]
code_shelf_7b699863
[ { "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 shelf/react/utils/OrdenationTypes.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nconst ordenationTypes = {\n ORDER_BY_RELEVANCE: {\n name: 'admin/editor.shelf.orderType.relevance',\n value: '',\n },\n ORDER_BY_TOP_SALE_DESC: {\n name: 'admin/editor.shelf.orderType.sales',\n value: 'OrderByTopSaleDESC',\n },\n ORDER_BY_PRICE_DESC: {\n name: 'admin/editor.shelf.orderType.priceDesc',\n value: 'OrderByPriceDESC',\n },\n ORDER_BY_PRICE_ASC: {\n name: 'admin/editor.shelf.orderType.priceAsc',\n value: 'OrderByPriceASC',\n },\n ORDER_BY_NAME_ASC: {\n name: 'admin/editor.shelf.orderType.nameAsc',\n value: 'OrderByNameASC',\n },\n ORDER_BY_NAME_DESC: {\n name: 'admin/editor.shelf.orderType.nameDesc',\n value: 'OrderByNameDESC',\n },\n ORDER_BY_RELEASE_DATE_DESC: {\n name: 'admin/editor.shelf.orderType.releaseDate',\n value: 'OrderByReleaseDateDESC',\n },\n ORDER_BY_BEST_DISCOUNT_DESC: {\n name: 'admin/editor.shelf.orderType.discount',\n value: 'OrderByBestDiscountDESC',\n },\n}\n\nexport function getOrdenationNames() {\n const names = []\n for (const key in ordenationTypes) {\n names.push(ordenationTypes[key].name)\n }\n return names\n}\n\nexport function getOrdenationValues() {\n const values = []\n for (const key in ordenationTypes) {\n values.push(ordenationTypes[key].value)\n }\n return values\n}\n\nexport default ordenationTypes\n\n```" } ]
code_shelf_86ac9ece
[ { "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 shelf/react/utils/propTypes.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport PropTypes from 'prop-types'\n\nimport { getScrollValues } from './ScrollTypes'\nimport { getGapPaddingValues } from './paddingEnum'\n\nexport const shelfItemPropTypes = {\n item: PropTypes.shape({\n productId: PropTypes.string.isRequired,\n productName: PropTypes.string.isRequired,\n description: PropTypes.string.isRequired,\n categories: PropTypes.array,\n link: PropTypes.string.isRequired,\n linkText: PropTypes.string.isRequired,\n brandId: PropTypes.number,\n brand: PropTypes.string.isRequired,\n items: PropTypes.arrayOf(\n PropTypes.shape({\n itemId: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n referenceId: PropTypes.arrayOf(\n PropTypes.shape({\n Value: PropTypes.string.isRequired,\n })\n ),\n images: PropTypes.arrayOf(\n PropTypes.shape({\n imageUrl: PropTypes.string.isRequired,\n imageTag: PropTypes.string.isRequired,\n })\n ).isRequired,\n sellers: PropTypes.arrayOf(\n PropTypes.shape({\n commertialOffer: PropTypes.shape({\n /** SKU installments */\n Installments: PropTypes.arrayOf(\n PropTypes.shape({\n /** Installment value */\n Value: PropTypes.number.isRequired,\n /** Interest rate (zero if interest-free) */\n InterestRate: PropTypes.number.isRequired,\n /** Calculated total value */\n TotalValuePlusInterestRate: PropTypes.number,\n /** Number of installments */\n NumberOfInstallments: PropTypes.number.isRequired,\n /** Installments offer name */\n Name: PropTypes.string,\n })\n ),\n Price: PropTypes.number.isRequired,\n ListPrice: PropTypes.number.isRequired,\n }).isRequired,\n })\n ).isRequired,\n })\n ).isRequired,\n }),\n summary: PropTypes.any,\n position: PropTypes.number,\n}\n\nexport const productListSchemaPropTypes = {\n /** Maximum number of items in the shelf. */\n maxItems: PropTypes.number.isRequired,\n /** Maximum number of items in a page. */\n itemsPerPage: PropTypes.number.isRequired,\n /** Minimum number of items in a page. */\n minItemsPerPage: PropTypes.number,\n /** Scroll options. */\n scroll: PropTypes.oneOf(getScrollValues()),\n /** If the arrows are showable or not. */\n arrows: PropTypes.bool.isRequired,\n /** Show value of the title. */\n showTitle: PropTypes.bool,\n /** Text value of the title. */\n titleText: PropTypes.string,\n /** Product Summary schema props */\n summary: PropTypes.any,\n}\n\nexport const shelfContentPropTypes = {\n /** List of products */\n products: PropTypes.arrayOf(shelfItemPropTypes.item),\n /** Max Items per page */\n itemsPerPage: PropTypes.number,\n /** Minimum Items per page */\n minItemsPerPage: PropTypes.number,\n /** Max items in shelf */\n maxItems: PropTypes.number.isRequired,\n /** Show Arrows */\n arrows: PropTypes.bool.isRequired,\n /** Scroll type */\n scroll: PropTypes.string.isRequired,\n /** Should display navigation dots below the Shelf */\n paginationDotsVisibility: PropTypes.oneOf([\n 'visible',\n 'hidden',\n 'desktopOnly',\n 'mobileOnly',\n ]),\n /** Container width */\n width: PropTypes.number,\n /** Props to ProductsSummary */\n summary: PropTypes.any,\n /** Is mobile */\n isMobile: PropTypes.bool,\n /** Gap between Shelf Items */\n gap: PropTypes.oneOf(getGapPaddingValues()),\n /** Title of the shelf */\n listName: PropTypes.string.isRequired,\n /** Is infinite */\n infinite: PropTypes.bool,\n}\n\n```" } ]
code_shelf_586dc219
[ { "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 shelf/react/utils/ScrollTypes.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nconst scrollTypes = {\n BY_PAGE: {\n name: 'admin/editor.shelf.scrollType.byPage',\n value: 'BY_PAGE',\n },\n ONE_BY_ONE: {\n name: 'admin/editor.shelf.scrollType.oneByOne',\n value: 'ONE_BY_ONE',\n },\n}\n\nexport function getScrollNames() {\n const names = []\n for (const key in scrollTypes) {\n names.push(scrollTypes[key].name)\n }\n return names\n}\n\nexport function getScrollValues() {\n const values = []\n for (const key in scrollTypes) {\n values.push(scrollTypes[key].value)\n }\n return values\n}\n\nexport default scrollTypes\n\n```" } ]
code_shelf_a9c86d32
[ { "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 shelf/react/utils/resolvePaginationDots.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nexport function resolvePaginationDotsVisibility(visibility, isMobile) {\n return !!(\n visibility === 'visible' ||\n (visibility === 'mobileOnly' && isMobile) ||\n (visibility === 'desktopOnly' && !isMobile)\n )\n}\n\n```" } ]
code_shelf_04345522
[ { "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 shelf/react/components/ShelfItem.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport React, { useMemo, useCallback } from 'react'\n// eslint-disable-next-line no-restricted-imports\nimport { assocPath } from 'ramda'\nimport ProductSummary from 'vtex.product-summary/ProductSummaryCustom'\nimport { ExtensionPoint } from 'vtex.render-runtime'\nimport { usePixel } from 'vtex.pixel-manager/PixelContext'\n\n/**\n * ShelfItem Component. Normalizes the item received in the props\n * to adapt to the extension point prop.\n */\nconst ShelfItem = ({ item, summary, position, listName }) => {\n const { push } = usePixel()\n const newSummary = useMemo(() => assocPath(['name', 'tag'], 'h2', summary), [\n summary,\n ])\n const product = useMemo(\n () => ProductSummary.mapCatalogProductToProductSummary(item),\n [item]\n )\n\n const pushPixelProductClick = useCallback(() => {\n push({\n event: 'productClick',\n product,\n list: listName,\n position,\n })\n }, [product, position, listName, push])\n\n return (\n <ExtensionPoint\n id=\"product-summary\"\n product={product}\n listName={listName}\n actionOnClick={pushPixelProductClick}\n position={position}\n {...newSummary}\n />\n )\n}\n\nexport default ShelfItem\n\n```" } ]
code_shelf_2203fd1e
[ { "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 shelf/react/components/shelf.css from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.arrow {\n top: 50%;\n transform: translate(0, -50%);\n}\n\n.dot {\n height: 0.625rem;\n width: 0.625rem;\n}\n\n```" } ]
code_shelf_93dd1f03
[ { "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 shelf/react/components/ProductList.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport PropTypes from 'prop-types'\nimport React, { Fragment } from 'react'\nimport ReactResizeDetector from 'react-resize-detector'\nimport { IOMessage, formatIOMessage } from 'vtex.native-types'\nimport { useCssHandles } from 'vtex.css-handles'\n\nimport {\n productListSchemaPropTypes,\n shelfItemPropTypes,\n} from '../utils/propTypes'\nimport ScrollTypes from '../utils/ScrollTypes'\nimport GapPaddingTypes from '../utils/paddingEnum'\nimport ShelfContent from './ShelfContent'\nimport ProductListEventCaller from './ProductListEventCaller'\n\nconst CSS_HANDLES = ['title']\n\nconst DEFAULT_MAX_ITEMS = 10\nconst DEFAULT_ITEMS_PER_PAGE = 5\nconst DEFAULT_MIN_ITEMS_PER_PAGE = 1\n\n/**\n * Product List Component. Shows a collection of products.\n */\nconst ProductList = ({\n gap,\n arrows,\n scroll,\n summary,\n maxItems,\n products,\n isMobile,\n autoplay,\n showTitle,\n titleText,\n itemsPerPage,\n minItemsPerPage,\n paginationDotsVisibility,\n navigationStep: navigationStepProp,\n trackingId,\n infinite,\n}) => {\n const handles = useCssHandles(CSS_HANDLES)\n const navigationStep = Number.isNaN(parseInt(navigationStepProp, 10))\n ? navigationStepProp\n : parseInt(navigationStepProp, 10)\n\n let listName = trackingId\n\n if (!listName) {\n listName =\n showTitle && titleText ? formatIOMessage(titleText) : 'List of products'\n }\n\n return products && !products.length ? null : (\n <Fragment>\n {showTitle && (\n <div\n className={`${handles.title} t-heading-2 fw3 w-100 flex justify-center pt7 pb6 c-muted-1`}\n >\n <IOMessage id={titleText} />\n </div>\n )}\n <ReactResizeDetector handleWidth>\n {width => (\n <ShelfContent\n gap={gap}\n width={width}\n arrows={arrows}\n scroll={scroll}\n summary={summary}\n products={products}\n maxItems={maxItems}\n isMobile={isMobile}\n autoplay={autoplay}\n itemsPerPage={itemsPerPage}\n navigationStep={navigationStep}\n minItemsPerPage={minItemsPerPage}\n paginationDotsVisibility={paginationDotsVisibility}\n listName={listName}\n infinite={infinite}\n />\n )}\n </ReactResizeDetector>\n <ProductListEventCaller />\n </Fragment>\n )\n}\n\nProductList.defaultProps = {\n maxItems: DEFAULT_MAX_ITEMS,\n minItemsPerPage: DEFAULT_MIN_ITEMS_PER_PAGE,\n itemsPerPage: DEFAULT_ITEMS_PER_PAGE,\n scroll: ScrollTypes.BY_PAGE.value,\n gap: GapPaddingTypes.SMALL.value,\n arrows: true,\n showTitle: true,\n titleText: null,\n isMobile: false,\n infinite: true,\n}\n\nProductList.propTypes = {\n /** Loading status */\n loading: PropTypes.bool,\n /** Graphql data response. */\n products: PropTypes.arrayOf(shelfItemPropTypes.item),\n /** Verifies if is a mobile device. */\n isMobile: PropTypes.bool,\n /** Should display navigation dots below the Shelf */\n paginationDotsVisibility: PropTypes.oneOf([\n 'visible',\n 'hidden',\n 'desktopOnly',\n 'mobileOnly',\n ]),\n trackingId: PropTypes.string,\n infinite: PropTypes.bool,\n ...productListSchemaPropTypes,\n}\n\nProductList.schema = {\n title: 'admin/editor.shelf.title',\n}\n\nexport default ProductList\n\n```" } ]
code_shelf_3ce0c997
[ { "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 shelf/react/components/ProductListEventCaller.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport { useProductImpression } from 'vtex.product-list-context'\n\nconst ProductListEventCaller = () => {\n useProductImpression()\n return null\n}\n\nexport default ProductListEventCaller\n\n```" } ]
code_shelf_0e64a78b
[ { "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 shelf/react/components/ShelfContent.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\n// eslint-disable-next-line no-restricted-imports\nimport { path } from 'ramda'\nimport React, { Component } from 'react'\nimport { IconCaret } from 'vtex.store-icons'\nimport classNames from 'classnames'\nimport { NoSSR } from 'vtex.render-runtime'\nimport { Slider, Slide, Dots, SliderContainer } from 'vtex.slider'\nimport { withCssHandles } from 'vtex.css-handles'\n\nimport { resolvePaginationDotsVisibility } from '../utils/resolvePaginationDots'\nimport resolveSlidesNumber from '../utils/resolveSlidesNumber'\nimport ScrollTypes from '../utils/ScrollTypes'\nimport ShelfItem from './ShelfItem'\nimport { shelfContentPropTypes } from '../utils/propTypes'\nimport shelf from './shelf.css'\n\nconst CSS_HANDLES = [\n 'arrow',\n 'arrowLeft',\n 'arrowRight',\n 'shelfContentContainer',\n 'sliderContainer',\n 'slide',\n 'dot--isActive',\n]\nconst SLIDER_WIDTH_ONE_ELEMENT = 320\nconst SLIDER_WIDTH_TWO_ELEMENTS = 500\nconst SLIDER_WIDTH_THREE_ELEMENTS = 750\nconst SLIDER_WIDTH_FOUR_ELEMENTS = 1000\nconst SLIDER_WIDTH_FIVE_ELEMENTS = 1290\nconst DEFAULT_SHELF_ITEM_WIDTH = 260\n\n/**\n * ShelfContent Component. Executes the interaction with react-slick\n * and render the properly content of the Shelf depending of edit mode state.\n */\nclass ShelfContent extends Component {\n constructor(props) {\n super(props)\n this.perPage = {\n [SLIDER_WIDTH_FIVE_ELEMENTS]: 5,\n [SLIDER_WIDTH_FOUR_ELEMENTS]: 4,\n [SLIDER_WIDTH_THREE_ELEMENTS]: 3,\n [SLIDER_WIDTH_TWO_ELEMENTS]: 2,\n [SLIDER_WIDTH_ONE_ELEMENT]: 1,\n }\n this.calcItemsPerPage()\n this.state = {\n currentSlide: 0,\n firstRender: true,\n }\n }\n\n calcItemsPerPage = () => {\n const { itemsPerPage } = this.props\n for (const key in this.perPage) {\n if (this.perPage[key] > itemsPerPage) delete this.perPage[key]\n }\n }\n\n handleChangeSlide = i => {\n this.setState({ currentSlide: i })\n }\n\n handleNextSlide = () => {\n const { currentSlide } = this.state\n const { itemsPerPage, maxItems, products, isMobile } = this.props\n const productList =\n !products || !products.length ? Array(maxItems).fill(null) : products\n const totalItems = productList.slice(0, maxItems).length\n let customPerPage = (!isMobile && itemsPerPage) || this.perPage\n\n /** Fix for a case where customPerPage would come from this.perPage,\n * which would be an object, and would cause nextSlide to be cast into\n * a string in the sum below. This was a quick fix, feel free to improve\n * this code later on if you judge it necessary.\n */\n if (typeof customPerPage !== 'number') {\n let minPerPage = this.props.minItemsPerPage\n if (typeof minPerPage !== 'number') {\n minPerPage = 1\n }\n customPerPage = resolveSlidesNumber(\n this.roundHalf(minPerPage),\n customPerPage,\n isMobile\n )\n }\n const nextSlide = (currentSlide % totalItems) + customPerPage\n\n this.handleChangeSlide(nextSlide)\n }\n\n componentDidMount() {\n this.setState({\n firstRender: false,\n })\n }\n\n arrowRender = ({ orientation, onClick }) => {\n const { gap, cssHandles } = this.props\n const containerClasses = classNames(\n shelf.arrow,\n 'pointer z-1 flex absolute',\n {\n [`${cssHandles.arrowLeft} left-0 ${gap}`]: orientation === 'left',\n [`${cssHandles.arrowRight} right-0 ${gap}`]: orientation === 'right',\n }\n )\n return (\n <div\n className={containerClasses}\n onClick={e => {\n if (e) {\n e.stopPropagation()\n e.preventDefault()\n }\n onClick(e)\n }}\n role=\"button\"\n tabIndex=\"0\"\n onKeypress={e => e.key === 'Enter' || (e.key === ' ' && onClick(e))}\n >\n <IconCaret orientation={orientation} thin size={20} />\n </div>\n )\n }\n\n roundHalf = num => Math.round(num * 2) / 2\n\n render() {\n const {\n gap,\n scroll,\n arrows,\n summary,\n autoplay,\n isMobile,\n maxItems,\n products,\n cssHandles,\n itemsPerPage,\n navigationStep,\n minItemsPerPage,\n paginationDotsVisibility,\n listName,\n infinite,\n } = this.props\n\n const { currentSlide } = this.state\n const showPaginationDots = resolvePaginationDotsVisibility(\n paginationDotsVisibility,\n isMobile\n )\n\n const isScrollByPage = scroll === ScrollTypes.BY_PAGE.value\n\n const productList =\n !products || !products.length ? Array(maxItems).fill(null) : products\n\n const roundedMinItems = this.roundHalf(minItemsPerPage)\n const customPerPage = !isMobile && itemsPerPage\n\n return (\n <div\n className={`${cssHandles.shelfContentContainer} flex justify-center`}\n >\n <SliderContainer\n autoplay={autoplay}\n onNextSlide={this.handleNextSlide}\n className={`${cssHandles.sliderContainer} w-100 mw9`}\n >\n <Slider\n loop={infinite}\n easing=\"ease\"\n duration={500}\n minPerPage={roundedMinItems}\n scrollByPage={isScrollByPage}\n navigationStep={navigationStep}\n currentSlide={Math.ceil(currentSlide)}\n onChangeSlide={this.handleChangeSlide}\n perPage={customPerPage || this.perPage}\n arrowRender={arrows && this.arrowRender}\n >\n {productList.slice(0, maxItems).map((item, index) => (\n <Slide\n sliderTransitionDuration={500}\n className={classNames(\n 'justify-center h-100',\n gap,\n cssHandles.slide\n )}\n key={path(['productId'], item) || index}\n defaultWidth={DEFAULT_SHELF_ITEM_WIDTH}\n >\n <ShelfItem\n item={item}\n position={index + 1}\n summary={summary}\n listName={listName}\n />\n </Slide>\n ))}\n </Slider>\n {showPaginationDots && (\n <NoSSR>\n <Dots\n loop\n showDotsPerPage={isScrollByPage}\n minPerPage={roundedMinItems}\n perPage={this.perPage}\n currentSlide={Math.ceil(currentSlide)}\n totalSlides={productList.slice(0, maxItems).length}\n onChangeSlide={this.handleChangeSlide}\n classes={{\n root: 'pt4',\n notActiveDot: 'bg-muted-3',\n dot: classNames(shelf.dot, 'mh2 mv0 pointer br-100'),\n activeDot: `${cssHandles['dot--isActive']} bg-emphasis`,\n }}\n />\n </NoSSR>\n )}\n </SliderContainer>\n </div>\n )\n }\n}\n\nShelfContent.defaultProps = {\n itemsPerPage: 5,\n minItemsPerPage: 1,\n paginationDotsVisibility: 'visible',\n}\n\nShelfContent.propTypes = {\n /** List of products */\n products: shelfContentPropTypes.products,\n /** Max Items per page */\n itemsPerPage: shelfContentPropTypes.itemsPerPage,\n /** Minimum Items per page */\n minItemsPerPage: shelfContentPropTypes.minItemsPerPage,\n /** Max items in shelf */\n maxItems: shelfContentPropTypes.maxItems,\n /** Show Arrows */\n arrows: shelfContentPropTypes.arrows,\n /** Scroll type */\n scroll: shelfContentPropTypes.scroll,\n /** Should display navigation dots below the Shelf */\n paginationDotsVisibility: shelfContentPropTypes.paginationDotsVisibility,\n /** Container width */\n width: shelfContentPropTypes.width,\n /** Props to ProductsSummary */\n summary: shelfContentPropTypes.summary,\n /** Is mobile */\n isMobile: shelfContentPropTypes.isMobile,\n /** Gap between Shelf Items */\n gap: shelfContentPropTypes.gap,\n /** Title of the shelf */\n listName: shelfContentPropTypes.listName,\n /** Is infinite */\n infinite: shelfContentPropTypes.infinite,\n}\n\nexport default withCssHandles(CSS_HANDLES)(ShelfContent)\n\n```" } ]
code_shelf_4fbb56c7
[ { "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 shelf/react/components/TabbedShelf/Tabs.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport React, { Component } from 'react'\nimport classNames from 'classnames'\nimport { withCssHandles } from 'vtex.css-handles'\n\nconst CSS_HANDLES = [\n 'itemContainer',\n 'itemContainerSelected',\n 'itemContainerUnselected',\n 'tabsContainer',\n 'tabsNamesContainer',\n 'shelfContainer',\n 'tabButton',\n]\n\nclass Tabs extends Component {\n state = {\n selectedIndex: 0,\n }\n\n handleClick = index => this.setState({ selectedIndex: index })\n\n render() {\n const { panes, cssHandles } = this.props\n const { selectedIndex } = this.state\n if (!panes || panes.length === 0) {\n return null\n }\n\n return (\n <div className=\"flex justify-center items-center\">\n <div\n className={`${cssHandles.tabsContainer} flex-ns pa6-ns justify-between-ns w-100-s`}\n >\n <div\n className={`${cssHandles.tabsNamesContainer} flex flex-column mh6`}\n >\n {panes.map((pane, index) => {\n const isSelected = index === selectedIndex\n const isLast = index === panes.length - 1\n const itemContainer = classNames(\n `t-body pa4 tl bb b--muted-4 ${cssHandles.itemContainer}`,\n {\n [`bg-base--inverted c-on-muted-1 ${cssHandles.itemContainerSelected}`]: isSelected,\n [cssHandles.itemContainerUnselected]: !isSelected,\n bw0: isLast,\n }\n )\n return (\n <button\n key={index}\n type=\"button\"\n onClick={() => this.handleClick(index)}\n className={`${cssHandles.tabButton} bn outline-0 bg-transparent pa0`}\n >\n <div className={itemContainer} key={pane.menuItem}>\n {pane.menuItem}\n </div>\n </button>\n )\n })}\n </div>\n <div\n className={`${cssHandles.shelfContainer} mh6-s mw-100 overflow-hidden`}\n >\n {panes[selectedIndex].render()}\n </div>\n </div>\n </div>\n )\n }\n}\n\nexport default withCssHandles(CSS_HANDLES)(Tabs)\n\n```" } ]
code_shelf_15f29ae0
[ { "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 shelf/react/components/TabbedShelf/index.js from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport PropTypes from 'prop-types'\nimport { injectIntl } from 'react-intl'\nimport React, { Fragment, Component } from 'react'\nimport { Button } from 'vtex.styleguide'\nimport { withRuntimeContext } from 'vtex.render-runtime'\nimport { withCssHandles } from 'vtex.css-handles'\n\nimport Tabs from './Tabs'\nimport Shelf from '../../Shelf'\nimport tabbedShelf from './tabbedShelf.css'\n\nconst MAX_NUMBER_OF_MENUS = 6\nconst CSS_HANDLES = ['headline']\n\n/**\n * Tabbed Shelf Module\n */\nclass TabbedShelf extends Component {\n /**\n * The prop types for this component\n * Used for type checking\n */\n static propTypes = {\n isEnabled: PropTypes.bool,\n headline: PropTypes.string,\n bottomText: PropTypes.string,\n tabs: PropTypes.PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.number,\n __editorItemTitle: PropTypes.string,\n })\n ),\n shelf: PropTypes.object,\n }\n\n /**\n * Default prop types for this component\n */\n static defaultProps = {\n isEnabled: false,\n headline: '',\n bottomText: '',\n tabs: [],\n shelf: {},\n }\n\n /**\n * Handle primary call to action button click\n */\n handleButtonClick(url) {\n if (url !== undefined && url !== '') {\n window.open(url.buttunUrl, '_self')\n }\n }\n\n /**\n * Return the component\n *\n * @returns {*}\n */\n render() {\n const {\n isEnabled,\n headline,\n bottomText,\n buttunUrl,\n buttonText,\n tabs,\n cssHandles,\n } = this.props\n\n const panes =\n tabs.length > 0\n ? tabs.map(tab => ({\n menuItem: tab.__editorItemTitle,\n render: () => (\n <Shelf {...{ ...this.props.shelf }} category={tab.id} />\n ),\n }))\n : ''\n\n return (\n <Fragment>\n {isEnabled ? (\n <div className={`${tabbedShelf.container}`}>\n <h3 className={`${cssHandles.headline}`}>{headline}</h3>\n <Tabs panes={panes} />\n <div className={`${tabbedShelf.blockContainer}`}>\n <p className={`${tabbedShelf.blockText}`}>{bottomText}</p>\n {buttonText ? (\n <div className={`${tabbedShelf.buttonContainer}`}>\n <Button onClick={() => this.handleButtonClick({ buttunUrl })}>\n {buttonText}\n </Button>\n </div>\n ) : (\n ''\n )}\n </div>\n </div>\n ) : null}\n </Fragment>\n )\n }\n}\n\n/**\n * Schema for component to allow configuration of props from admin configuration\n */\nTabbedShelf.getSchema = props => ({\n title: 'admin/editor.tabbed-shelf.title',\n description: 'admin/editor.tabbed-shelf.description',\n type: 'object',\n properties: {\n isEnabled: {\n title: 'admin/editor.tabbed-shelf.isEnabled.title',\n type: 'boolean',\n default: false,\n },\n headline: {\n title: 'admin/editor.tabbed-shelf.headline',\n type: 'string',\n },\n bottomText: {\n title: 'admin/editor.tabbed-shelf.bottomText',\n type: 'string',\n widget: {\n 'ui:widget': 'textarea',\n },\n },\n buttonText: {\n title: 'admin/editor.tabbed-shelf.buttonText',\n type: 'string',\n },\n buttunUrl: {\n title: 'admin/editor.tabbed-shelf.buttonUrl',\n type: 'string',\n },\n tabs: {\n title: 'admin/editor.tabbed-shelf.tabs',\n type: 'array',\n minItems: 0,\n maxItems: MAX_NUMBER_OF_MENUS,\n items: {\n title: 'admin/editor.tabbed-shelf.tabs.items',\n type: 'object',\n properties: {\n id: {\n title: 'admin/editor.tabbed-shelf.tabs.items.id',\n type: 'number',\n },\n },\n },\n },\n shelf: {\n title: 'admin/editor.tabbed-shelf.shelf.title',\n type: 'object',\n properties: Shelf.getSchema(props).properties,\n },\n },\n})\n\nexport default withRuntimeContext(\n injectIntl(withCssHandles(CSS_HANDLES)(TabbedShelf))\n)\n\n```" } ]
code_shelf_f0ea89f9
[ { "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 shelf/react/components/TabbedShelf/tabbedShelf.css from the shelf VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.container {\n display:block;\n}\n\n.container .mh7-ns,\n.container .pv4,\n.container .pb7 {\n margin:0 0 0 25px;\n padding:0;\n}\n\n.blockContainer {\n font-size: .625em;\n width: 15%;\n position: absolute;\n margin-top: -320px;\n color: #45474a;\n line-height: 17px;\n}\n\n.blockContainer:after {\n clear:both;\n}\n\n.blockText {\n margin:0 0 19px;\n}\n\n.buttonContainer {\n margin: 0 !important;\n padding: 8px 20px !important;\n text-transform: inherit;\n font-size: 16px !important;\n}\n\n@media only screen and (max-width: 1047px) {\n .blockContainer {\n margin-top: -300px;\n }\n}\n\n@media only screen and (max-width: 854px) {\n .blockContainer {\n margin-top: -280px;\n }\n}\n\n@media only screen and (max-width: 821px) {\n .blockContainer {\n margin-top: -320px;\n }\n}\n\n@media only screen and (max-width: 639px) {\n .blockContainer {\n margin-top: -220px;\n width:25%;\n }\n}\n\n/* Switch to mobile tabs */\n@media only screen and (max-width: 570px) {\n .blockContainer {\n margin-top: 45px;\n width: 100%;\n position: relative;\n }\n}\n\n```" } ]
code_blueknow_56140813
[ { "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 blueknow/docs/README.md from the blueknow VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n📢 Use this project, [contribute](https://github.com/vtex-apps/CHANGEME) to it or open issues to help evolve it using [Store Discussion](https://github.com/vtex-apps/store-discussion).\n\n# Blueknow app\n\n<!-- DOCS-IGNORE:start -->\n<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors-)\n<!-- ALL-CONTRIBUTORS-BADGE:END -->\n<!-- DOCS-IGNORE:end -->\n\nBlueknow first party app\n\n## Configuration\n\nIt is possible to install in your store either by using App Store or the VTEX IO Toolbelt.\n\n### Using VTEX App Store\n\n1. Access the **Apps** section in your account's admin page and look for the Blueknow box;\n2. Then, click on the **Install** button;\n3. You'll see a warning message about needing to enter the necessary configurations. Scroll down and type in your **Blueknow ID** in the `Blueknow` field.\n4. Click on **Save**.\n\n### Using VTEX IO Toolbelt\n\n1. [Install](https://vtex.io/docs/recipes/development/installing-an-app/) the `vtex.blueknow@1.x` app. You can confirm that the app has now been installed by running `vtex ls` again. \n2. Access the **Apps** section in your account's admin page and look for the Blueknow box. Once you find it, click on the box.\n3. Fill in the `Blueknow` field with your **Blueknow ID**.\n4. Click on **Save**.\n\n<!-- Remember to also **showcase any necessary disclaimer** related to the app in this section, such as the different behavior it may display during its configuration. -->\n\n<!-- DOCS-IGNORE:start -->\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\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<!-- DOCS-IGNORE:end -->\n\n```" } ]
code_blueknow_ca2c0352
[ { "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 blueknow/public/metadata/messages/es-AR.json from the blueknow VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"name\": \"\",\n \"headline\": \"\",\n \"overview\": \"\",\n \"features\": [],\n \"additionalInformation\": \"\",\n \"websiteURL\": \"https://vtex.com/\",\n \"support\": {\n \"url\": \"https://support.vtex.com/hc/requests\"\n }\n}\n\n```" } ]
code_blueknow_2830811d
[ { "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 blueknow/public/metadata/messages/pt-BR.json from the blueknow VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"name\": \"\",\n \"headline\": \"\",\n \"overview\": \"\",\n \"features\": [],\n \"additionalInformation\": \"\",\n \"websiteURL\": \"https://vtex.com/\",\n \"support\": {\n \"url\": \"https://support.vtex.com/hc/requests\"\n }\n}\n\n```" } ]
code_blueknow_94cb1030
[ { "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 blueknow/public/metadata/messages/en-US.json from the blueknow VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"name\": \"\",\n \"headline\": \"\",\n \"overview\": \"\",\n \"features\": [],\n \"additionalInformation\": \"\",\n \"websiteURL\": \"https://vtex.com/\",\n \"support\": {\n \"url\": \"https://support.vtex.com/hc/requests\"\n }\n}\n\n```" } ]
code_assemblers-theme_a3996680
[ { "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 assemblers-theme/sitemap/sitemap.json from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"urlset\": {\n \"url\": [\n {\n \"loc\": \"https://storetheme.vtex.com/about-us\"\n }\n ]\n }\n}\n```" } ]
code_assemblers-theme_c560b4f8
[ { "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 assemblers-theme/docs/README.md from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n# Assemblers Appliance Theme\nA simple example store implemented in Store Framework\n\n## Preview\n![](https://user-images.githubusercontent.com/484167/71480046-e9aa7080-27d5-11ea-9923-e5ad48891cec.png)\n\n```" } ]
code_assemblers-theme_9966d83e
[ { "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 assemblers-theme/store/blocks.jsonc from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n/* Blocks can be defined both on the store/blocks.json file, and in any number of json\n * files inside the store/blocks directory, with any arbitrary directory structure.\n *\n * Additionally, all blocks files can support comments, such as this one, if given the\n * .jsonc file extension.\n *\n * The store/blocks.json file is intended for backwards compatibility, for miscellaneous\n * blocks, or if the app is simple enough that it doesn't warrant splitting the file.\n */\n{\n \"store.orderplaced\": {\n \"blocks\": [\"order-placed\"]\n },\n\n \"store.account\": {\n \"blocks\": [\"my-account\"],\n \"parent\": {\n \"challenge\": \"challenge.profile\"\n }\n },\n\n \"store.login\": {\n \"blocks\": [\"login-content#default\"]\n },\n\n \"login-content#default\": {\n \"props\": {\n \"isInitialScreenOptionOnly\": false,\n \"defaultOption\": 1,\n \"showPasswordVerificationIntoTooltip\": true\n }\n },\n\n \"product-summary.shelf\": {\n \"children\": [\n \"product-summary-add-to-list-button\",\n \"stack-layout#prodsum\",\n \"product-summary-name\",\n \"product-rating-inline\",\n \"product-summary-space\",\n \"product-summary-price\"\n ]\n },\n\n \"stack-layout#prodsum\": {\n \"children\": [\n \"product-summary-image\",\n \"product-summary-specification-badges\"\n ]\n },\n\n \"product-summary-specification-badges\": {\n \"props\": {\n \"specificationGroupName\": \"Group\",\n \"specificationName\": \"On Sale\",\n \"visibleWhen\": \"True\",\n \"displayValue\": \"SPECIFICATION_NAME\"\n }\n },\n\n \"store.product-review-form\": {\n \"blocks\": [\"product-review-form\"]\n }\n}\n\n```" } ]
code_assemblers-theme_e085f555
[ { "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 assemblers-theme/styles/css/vtex.rich-text.css from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.container--xp {\n width: 80%;\n}\n\n.container--newsletter{\n max-height: 350px;\n}\n\n```" } ]
code_assemblers-theme_713f5ed8
[ { "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 assemblers-theme/styles/css/vtex.store-header.css from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.headerRow--menu-link :global(.vtex-menu-2-x-styledLink) {\n color: #ffffff;\n font-size: 14px;\n}\n\n.headerRow--main-header .headerRowBackground {\n background-color: #212222;\n padding: 1.5em 0;\n}\n\n.headerRow--main-header :global(a) {\n margin: 0 auto;\n}\n\n.headerRow--main-topbar :global(.vtex-menu-2-x-styledLink) {\n color: #727273;\n font-size: 14px;\n}\n\n.headerRow--main-header-mobile .headerRowBackground {\n background-color: #212222;\n padding: 1.5em 0;\n}\n\n```" } ]
code_assemblers-theme_aa140d92
[ { "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 assemblers-theme/styles/css/vtex.store-components.css from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n@import url('https://fonts.googleapis.com/css?family=Playfair+Display:700|Roboto&display=swap');\n\n.notificationBarContainer {\n background-color: #E6F1E6;\n color: #03034E;\n font-weight: 700;\n font-size: 12px;\n text-decoration: underline;\n}\n\n.searchBarContainer {\n max-width: 265px;\n}\n\n.infoCardContainer--info-card-home {\n max-width: 1520px;\n margin: 0 auto;\n background-color: #E6F1E6;\n padding: 0px;\n}\n\n.newsletter {\n color: #727273;\n max-width: 1528px;\n padding-top: 1rem;\n}\n\n#newsletter-input {\n background-color: #ffffff;\n}\n\n.newsletter .container {\n padding: 0 0 20px 0;\n}\n\n.label {\n color: #727273;\n font-size: 18px;\n}\n\n.inputGroup {\n padding-bottom: 4px;\n display: flex;\n color: #fff;\n}\n\n.inputGroup input {\n background-color: #ffffff;\n color: #727273;\n border: 2px solid #E3E4E6;\n box-sizing: border-box;\n border-radius: 4px;\n}\n\n.inputGroup input::placeholder {\n color: #fff;\n font-size: 16px;\n}\n\n.imageElement--storePrint {\n max-height: 300px;\n margin-bottom: 20px;\n}\n\n.infoCardTextContainer--depbanner {\n min-height: 400px;\n}\n\n@media only screen and (min-width: 640px) {\n .label {\n font-size: 40px;\n }\n\n .infoCardContainer--info-card-home .infoCardTextContainer {\n width: 30%;\n }\n\n .infoCardContainer--info-card-home .infoCardImageContainer {\n width: 70%;\n }\n\n .imageElement--storePrint {\n margin-bottom: 0px;\n max-height: 600px;\n }\n}\n\n.imageElement {\n\n}\n/*\n.shippingContainer {\n background: red;\n}\n\n\n.shippingContainer .items-start {\n width: 50%;\n} */\n\n```" } ]
code_assemblers-theme_bb334957
[ { "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 assemblers-theme/styles/css/vtex.flex-menu.css from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.container {\n display: block;\n}\n.menuItem {\n width: 100%;\n}\n```" } ]
code_assemblers-theme_c9925ed2
[ { "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 assemblers-theme/styles/css/vtex.flex-layout.css from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.flexRow--deals {\n background-color: #a7afbd;\n padding: 14px 0px;\n}\n\n.flexRow--newsletter {\n background-color: #e8ccc9;\n padding-bottom: 2rem;\n}\n\n.flexRow--pinkRow {\n background-color: #e8ccc9;\n padding-bottom: 3rem;\n margin-top: 15px;\n margin-bottom: 35px;\n}\n\n.flexColChild--newsletter :global(p) {\n margin-bottom: 0;\n}\n\n.flexColChild--newsletter :global(.buttonContainer) {\n padding: 0;\n background: red;\n}\n\n.flexRow--deals .stretchChildrenWidth {\n align-items: center;\n}\n\n.flexRow--deals .flexCol {\n align-items: center;\n}\n\n.flexCol--filterCol {\n max-width: 500px;\n min-width: 230px;\n}\n\n.flexCol--productCountCol {\n align-items: flex-start;\n}\n\n.flexCol--orderByCol {\n align-items: flex-end;\n}\n\n.flexCol--orderByMobileCol {\n width: 42%;\n}\n\n.flexCol--filterMobileCol {\n width: 38%;\n}\n\n.flexCol--switcherMobileCol {\n width: 20%;\n}\n\n@media only screen and (min-width: 640px) {\n .flexColChild--pinkCol {\n width: 50%;\n }\n}\n\n\n/* Footer */\n.flexRow--footer-row {\n padding-top: 10px;\n padding-bottom: 10px;\n background: #3255A6;\n}\n\n.flexRow--footer-row {\n text-align: right;\n}\n\n.flexRow--footer-row :global(a) {\n color: #E3E4E6;\n font-size: 14px;\n}\n\n@media only screen and (max-width: 640px) {\n .flexRow--footer-row :global(li) {\n display: block;\n }\n}\n\n.flexRow--footer-row :global(img) {\n filter: brightness(2);\n}\n\n\n/* Product */\n.flexRow--product-main {\n color: #727273\n}\n\n```" } ]
code_assemblers-theme_61493fff
[ { "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 assemblers-theme/styles/css/vtex.breadcrumb.css from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.container {\n /* background: red; */\n margin-top: 20px;\n}\n\n```" } ]
code_assemblers-theme_973dcafe
[ { "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 assemblers-theme/styles/css/vtex.slider-layout.css from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.slide--styles {\n width: 80% !important\n}\n\n.slideChildrenContainer {\n text-align: center;\n margin-top: 25px;\n}\n\n```" } ]
code_assemblers-theme_d99264a8
[ { "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 assemblers-theme/styles/configs/style.json from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"typeScale\": [\n 3, 2.25, 1.5, 1.25, 1, 0.875, 0.75\n ],\n \"spacing\": [0.125, 0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4, 8, 16],\n \"customMedia\": [\n { \"s\": 20 },\n { \"ns\": {\n \"value\": 40,\n \"minWidth\": true\n }\n },\n { \"m\": {\n \"value\": 40,\n \"minWidth\": true\n }\n },\n { \"l\": {\n \"value\": 64,\n \"minWidth\": true\n }\n },\n { \"xl\": {\n \"value\": 80,\n \"minWidth\": true\n }\n }\n ],\n \"colors\": {\n \"black-90\": \"rgba(0,0,0,.9)\",\n \"black-80\": \"rgba(0,0,0,.8)\",\n \"black-70\": \"rgba(0,0,0,.7)\",\n \"black-60\": \"rgba(0,0,0,.6)\",\n \"black-50\": \"rgba(0,0,0,.5)\",\n \"black-40\": \"rgba(0,0,0,.4)\",\n \"black-30\": \"rgba(0,0,0,.3)\",\n \"black-20\": \"rgba(0,0,0,.2)\",\n \"black-10\": \"rgba(0,0,0,.1)\",\n \"black-05\": \"rgba(0,0,0,.05)\",\n \"black-025\": \"rgba(0,0,0,.025)\",\n \"black-0125\": \"rgba(0,0,0,.0125)\",\n\n \"white-90\": \"rgba(255,255,255,.9)\",\n \"white-80\": \"rgba(255,255,255,.8)\",\n \"white-70\": \"rgba(255,255,255,.7)\",\n \"white-60\": \"rgba(255,255,255,.6)\",\n \"white-50\": \"rgba(255,255,255,.5)\",\n \"white-40\": \"rgba(255,255,255,.4)\",\n \"white-30\": \"rgba(255,255,255,.3)\",\n \"white-20\": \"rgba(255,255,255,.2)\",\n \"white-10\": \"rgba(255,255,255,.1)\",\n \"white-05\": \"rgba(255,255,255,.05)\",\n \"white-025\": \"rgba(255,255,255,.025)\",\n \"white-0125\": \"rgba(255,255,255,.0125)\"\n },\n \"semanticColors\": {\n \"background\": {\n \"base\": \"#ffffff\",\n \"base--inverted\": \"#03044e\",\n \"action-primary\": \"#52BAB7\",\n \"action-secondary\": \"#E8CCC9\",\n \"emphasis\": \"#f71963\",\n \"disabled\": \"#f2f4f5\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"hover-background\": {\n \"action-primary\": \"#45A6A3\",\n \"action-secondary\": \"#DCC0BD\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#e13232\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"active-background\": {\n \"action-primary\": \"#3D9391\",\n \"action-secondary\": \"#CAABA8\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"text\": {\n \"action-primary\": \"#0F3E99\",\n \"action-secondary\": \"#eef3f7\",\n \"link\": \"#0F3E99\",\n \"emphasis\": \"#f71963\",\n \"disabled\": \"#979899\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#52bab7\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"visited-text\": {\n \"link\": \"#0c389f\"\n },\n \"hover-text\": {\n \"action-primary\": \"#072c75\",\n \"action-secondary\": \"#dbe9fd\",\n \"link\": \"#0c389f\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#e13232\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\"\n },\n \"active-text\": {\n \"link\": \"#0c389f\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\"\n },\n \"border\": {\n \"action-primary\": \"#52BAB7\",\n \"action-secondary\": \"#F7EEED\",\n \"emphasis\": \"#f71963\",\n \"disabled\": \"#e3e4e6\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"hover-border\": {\n \"action-primary\": \"#45A6A3\",\n \"action-secondary\": \"#DCC0BD\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#e13232\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"active-border\": {\n \"action-primary\": \"#3D9391\",\n \"action-secondary\": \"#CAABA8\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"on\": {\n \"base\": \"#3f3f40\",\n \"base--inverted\": \"#ffffff\",\n \"action-primary\": \"#ffffff\",\n \"action-secondary\": \"#0F3E99\",\n \"emphasis\": \"#ffffff\",\n \"disabled\": \"#979899\",\n \"success\": \"#ffffff\",\n \"success--faded\": \"#3f3f40\",\n \"danger\": \"#ffffff\",\n \"danger--faded\": \"#3f3f40\",\n \"warning\": \"#ffffff\",\n \"warning--faded\": \"#1a1a1a\",\n \"muted-1\": \"#ffffff\",\n \"muted-2\": \"#ffffff\",\n \"muted-3\": \"#3f3f40\",\n \"muted-4\": \"#3f3f40\",\n \"muted-5\": \"#3f3f40\"\n },\n \"hover-on\": {\n \"action-primary\": \"#ffffff\",\n \"action-secondary\": \"#0F3E99\",\n \"emphasis\": \"#ffffff\",\n \"success\": \"#ffffff\",\n \"success--faded\": \"#3f3f40\",\n \"danger\": \"#ffffff\",\n \"danger--faded\": \"#3f3f40\",\n \"warning\": \"#ffffff\",\n \"warning--faded\": \"#1a1a1a\"\n },\n \"active-on\": {\n \"action-primary\": \"#ffffff\",\n \"action-secondary\": \"#0F3E99\",\n \"emphasis\": \"#ffffff\",\n \"success\": \"#ffffff\",\n \"success--faded\": \"#3f3f40\",\n \"danger\": \"#ffffff\",\n \"danger--faded\": \"#3f3f40\",\n \"warning\": \"#ffffff\",\n \"warning--faded\": \"#1a1a1a\"\n }\n },\n \"borderWidths\": [0, 0.125, 0.25, 0.5, 1, 2],\n \"borderRadius\": [0, 0.125, 0.25, 0.5, 1],\n \"widths\": [1, 2, 4, 8, 16],\n \"maxWidths\": [1, 2, 4, 8, 16, 32, 48, 64, 96],\n \"heights\": [1, 2, 4, 8, 16],\n \"sizes\": [\n {\"name\": \"small\", \"value\": 2},\n {\"name\": \"regular\", \"value\": 2.5},\n {\"name\": \"large\", \"value\": 3}\n ],\n \"typography\":{\n \"measure\": [30, 34, 20],\n \"styles\": {\n \"heading-1\": {\n \"fontFamily\": \"Playfair Display, serif\",\n \"fontWeight\": \"700\",\n \"fontSize\": \"3rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-2\": {\n \"fontFamily\": \"Playfair Display, serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"2.25rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-3\": {\n \"fontFamily\": \"Playfair Display, serif\",\n \"fontWeight\": \"700\",\n \"fontSize\": \"1.75rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-4\": {\n \"fontFamily\": \"Playfair Display, serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1.5rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-5\": {\n \"fontFamily\": \"Playfair Display, serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1.25rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-6\": {\n \"fontFamily\": \"Playfair Display, serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1.25rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"body\": {\n \"fontFamily\": \"Roboto, San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"small\": {\n \"fontFamily\": \"Roboto, San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"0.875rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"mini\": {\n \"fontFamily\": \"Roboto, San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"0.75rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"action\": {\n \"fontFamily\": \"Roboto, San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"1rem\",\n \"textTransform\": \"uppercase\",\n \"letterSpacing\": \"0\"\n },\n \"action--small\": {\n \"fontFamily\": \"Roboto, San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"0.875rem\",\n \"textTransform\": \"uppercase\",\n \"letterSpacing\": \"0\"\n },\n \"action--large\": {\n \"fontFamily\": \"Roboto, San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"1.25rem\",\n \"textTransform\": \"uppercase\",\n \"letterSpacing\": \"0\"\n },\n \"code\": {\n \"fontFamily\": \"Consolas, monaco, monospace\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n }\n }\n },\n \"opacity\": [1, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0.05, 0.025, 0]\n}\n\n```" } ]
code_assemblers-theme_a8e61c2d
[ { "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 assemblers-theme/store/blocks/product.jsonc from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.product\": {\n \"children\": [\n \"flex-layout.row#product-breadcrumb\",\n \"flex-layout.row#product-main\",\n \"shelf#related\"\n ]\n },\n\n \"shelf#related\": {\n \"blocks\": [\"product-summary.shelf\"],\n \"props\": {\n \"recomendation\": \"editor.relatedProducts.similars\",\n \"orderBy\": \"OrderByTopSaleDESC\",\n \"productList\": {\n \"maxItems\": 10,\n \"itemsPerPage\": 5,\n \"minItemsPerPage\": 1.5,\n \"scroll\": \"BY_PAGE\",\n \"arrows\": true,\n \"titleText\": \"More options for this style\"\n }\n }\n },\n\n\n\n \"flex-layout.row#product-breadcrumb\": {\n \"props\": {\n \"marginTop\": 20\n },\n \"children\": [\"breadcrumb\"]\n },\n \"flex-layout.row#product-main\": {\n \"props\": {\n \"colGap\": 9,\n \"rowGap\": 7,\n \"marginTop\": 4,\n \"marginBottom\": 7,\n \"paddingTop\": 7,\n \"paddingBottom\": 7,\n \"blockClass\": \"product-main\"\n },\n \"children\": [\n \"flex-layout.col#stack\",\n \"flex-layout.col#right-col\"\n ]\n },\n\n \"stack-layout\": {\n \"children\": [\n \"flex-layout.row#product-image\",\n \"product-specification-badges\"\n ]\n },\n\n \"product-specification-badges\": {\n \"props\": {\n \"specificationGroupName\": \"Group\",\n \"specificationName\": \"On Sale\",\n \"visibleWhen\": \"True\",\n \"displayValue\": \"SPECIFICATION_NAME\"\n }\n },\n\n \"flex-layout.col#stack\": {\n \"children\": [\"stack-layout\"],\n \"props\": {\n \"width\": \"70%\",\n \"rowGap\": 0\n }\n },\n\n \"flex-layout.row#product-image\": {\n \"children\": [\"product-images\"]\n },\n\n \"product-images\": {\n \"props\": {\n \"displayThumbnailsArrows\": true,\n \"thumbnailsOrientation\": \"vertical\"\n }\n },\n\n \"flex-layout.col#right-col\": {\n \"props\": {\n \"preventVerticalStretch\": true,\n \"rowGap\": 0\n },\n \"children\": [\n \"product-name\",\n \"product-price#product-details\",\n \"sku-selector\",\n \"flex-layout.row#buy-button\",\n \"shipping-simulator\",\n \"share#default\"\n ]\n },\n\n \"product-price#product-details\": {\n \"props\": {\n \"showInstallments\": true,\n \"showSavings\": true\n }\n },\n\n \"flex-layout.row#buy-button\": {\n \"props\": {\n \"marginTop\": 4,\n \"marginBottom\": 7\n },\n \"children\": [\"buy-button\"]\n },\n\n \"share#default\": {\n \"props\": {\n \"social\": {\n \"Facebook\": true,\n \"WhatsApp\": true,\n \"Twitter\": false,\n \"Pinterest\": true\n }\n }\n }\n}\n\n```" } ]
code_assemblers-theme_70136279
[ { "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 assemblers-theme/store/blocks/search.jsonc from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.search\": {\n \"blocks\": [\"search-result-layout#cat\"]\n },\n\n \"store.search#brand\": {\n \"blocks\": [\"search-result-layout\"],\n \"props\": {\n \"context\": {\n \"orderByField\": \"OrderByReleaseDateDESC\",\n \"hideUnavailableItems\": true,\n \"maxItemsPerPage\": 10\n }\n }\n },\n\n \"store.search#department\": {\n \"blocks\": [\"search-result-layout#department\"]\n },\n\n \"store.search#category\": {\n \"blocks\": [\"search-result-layout#cat\"]\n },\n\n \"store.search#subcategory\": {\n \"blocks\": [\"search-result-layout#cat\"]\n },\n\n \"search-result-layout#department\": {\n \"blocks\": [\n \"search-result-layout.desktop#dep\",\n \"search-result-layout.mobile#dep\",\n \"search-not-found-layout\"\n ]\n },\n \"search-result-layout#cat\": {\n \"blocks\": [\n \"search-result-layout.desktop#cat\",\n \"search-result-layout.mobile#cat\",\n \"search-not-found-layout\"\n ]\n },\n\n \"info-card#depbanner\": {\n \"props\": {\n \"imageUrl\": \"https://image.shutterstock.com/z/stock-photo-party-with-best-friends-group-of-cheerful-young-people-enjoying-home-party-with-snacks-and-drinks-492006757.jpg\",\n \"callToActionMode\": \"none\",\n \"isFullModeStyle\": true,\n \"headline\": \" \",\n \"blockClass\": \"depbanner\"\n }\n },\n\n \"search-result-layout.desktop#dep\": {\n \"children\": [\n \"flex-layout.row#depBanner\",\n \"flex-layout.row#searchbread\",\n \"flex-layout.row#searchtitle\",\n \"flex-layout.row#result\"\n ],\n \"props\": {\n \"pagination\": \"show-more\",\n \"mobileLayout\": {\n \"mode1\": \"small\",\n \"mode2\": \"normal\"\n }\n }\n },\n \"search-result-layout.desktop#cat\": {\n \"children\": [\n \"flex-layout.row#searchbread\",\n \"flex-layout.row#searchtitle\",\n \"flex-layout.row#result\"\n ],\n \"props\": {\n \"pagination\": \"show-more\",\n \"mobileLayout\": {\n \"mode1\": \"small\",\n \"mode2\": \"normal\"\n }\n }\n },\n \"flex-layout.row#searchbread\": {\n \"children\": [\"breadcrumb.search\"],\n \"props\": {\n \"preserveLayoutOnMobile\": true,\n \"fullWidth\": true\n }\n },\n \"flex-layout.row#searchtitle\": {\n \"children\": [\"search-title.v2\"]\n },\n \"flex-layout.row#result\": {\n \"children\": [\"flex-layout.col#filter\", \"flex-layout.col#content\"],\n \"props\": {\n \"preventHorizontalStretch\": true,\n \"fullWidth\": true\n }\n },\n \"flex-layout.col#filter\": {\n \"children\": [\"filter-navigator.v3\"],\n \"props\": {\n \"blockClass\": \"filterCol\"\n }\n },\n \"flex-layout.col#content\": {\n \"children\": [\n \"flex-layout.row#searchinfo\",\n \"flex-layout.row#fetchprevious\",\n \"flex-layout.row#products\",\n \"flex-layout.row#fetchmore\"\n ],\n \"props\": {\n \"width\": \"grow\"\n }\n },\n \"flex-layout.row#searchinfo\": {\n \"children\": [\"flex-layout.col#productCount\", \"flex-layout.col#orderby\"]\n },\n \"flex-layout.col#productCount\": {\n \"children\": [\"total-products.v2\"],\n \"props\": {\n \"blockClass\": \"productCountCol\"\n }\n },\n \"flex-layout.col#orderby\": {\n \"children\": [\"order-by.v2\"],\n \"props\": {\n \"blockClass\": \"orderByCol\"\n }\n },\n \"flex-layout.row#fetchprevious\": {\n \"props\": {\n \"marginBottom\": 3\n },\n \"children\": [\"search-fetch-previous\"]\n },\n \"flex-layout.row#fetchmore\": {\n \"props\": {\n \"marginTop\": 3\n },\n \"children\": [\"search-fetch-more\"]\n },\n \"flex-layout.row#products\": {\n \"children\": [\"search-content\"]\n },\n \"search-content\": {\n \"blocks\": [\"gallery\", \"not-found\"]\n },\n\n \"flex-layout.row#depBanner\": {\n \"children\": [\n \"info-card#depbanner\"\n ]\n },\n\n \"search-result-layout.mobile#dep\": {\n \"children\": [\n \"flex-layout.row#depBanner\",\n \"flex-layout.row#searchinfomobile\",\n \"flex-layout.row#searchbread\",\n \"flex-layout.row#productCountMobile\",\n \"flex-layout.row#contentmobile\"\n ],\n \"props\": {\n \"pagination\": \"show-more\",\n \"mobileLayout\": {\n \"mode1\": \"small\",\n \"mode2\": \"normal\"\n }\n }\n },\n \"search-result-layout.mobile#cat\": {\n \"children\": [\n \"flex-layout.row#searchinfomobile\",\n \"flex-layout.row#searchbread\",\n \"flex-layout.row#productCountMobile\",\n \"flex-layout.row#contentmobile\"\n ],\n \"props\": {\n \"pagination\": \"show-more\",\n \"mobileLayout\": {\n \"mode1\": \"small\",\n \"mode2\": \"normal\"\n }\n }\n },\n \"flex-layout.row#contentmobile\": {\n \"children\": [\"search-content\"],\n \"props\": {\n \"preserveLayoutOnMobile\": true\n }\n },\n\n \"flex-layout.row#searchinfomobile\": {\n \"children\": [\n \"flex-layout.col#orderByMobile\",\n \"flex-layout.col#filterMobile\",\n \"flex-layout.col#switcherMobile\"\n ],\n \"props\": {\n \"preserveLayoutOnMobile\": true,\n \"colSizing\": \"auto\",\n \"colJustify\": \"around\"\n }\n },\n\n \"flex-layout.col#orderByMobile\": {\n \"children\": [\"order-by.v2\"],\n \"props\": {\n \"blockClass\": \"orderByMobileCol\"\n }\n },\n\n \"flex-layout.row#productCountMobile\": {\n \"children\": [\"total-products.v2\"],\n \"props\": {\n \"blockClass\": \"productCountMobileRow\"\n }\n },\n\n \"flex-layout.col#filterMobile\": {\n \"children\": [\"filter-navigator.v3\"],\n \"props\": {\n \"blockClass\": \"filterMobileCol\"\n }\n },\n \"flex-layout.col#switcherMobile\": {\n \"children\": [\"search-layout-switcher\"],\n \"props\": {\n \"blockClass\": \"switcherMobileCol\"\n }\n },\n \"search-not-found-layout\": {\n \"children\": [\"flex-layout.row#searchbread\", \"flex-layout.row#notfound\"]\n },\n\n \"flex-layout.row#notfound\": {\n \"children\": [\"not-found\"],\n \"props\": {\n \"fullWidth\": true\n }\n },\n\n \"breadcrumb\": {\n \"props\": {\n \"showOnMobile\": true\n }\n },\n\n \"gallery\": {\n \"blocks\": [\"product-summary.shelf\"]\n }\n}\n\n```" } ]
code_assemblers-theme_8bb21856
[ { "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 assemblers-theme/store/blocks/home/newsletter.jsonc from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"flex-layout.row#newsletter\": {\n \"children\": [\n \"flex-layout.col#newsletter\"\n ],\n \"props\": {\n \"blockClass\": \"newsletter\",\n \"marginTop\": 5\n }\n },\n \"flex-layout.col#newsletter\": {\n \"children\": [\n \"rich-text#newsletter\",\n \"rich-text#style-text\",\n \"flex-layout.row#newsletter-container\"\n ],\n \"props\": {\n \"blockClass\": \"newsletter\"\n }\n },\n \"rich-text#style-text\": {\n \"props\": {\n \"textAlignment\": \"CENTER\",\n \"textPosition\": \"CENTER\",\n \"text\": \"Be first to receive exclusive offers and updates\",\n \"blockClass\": \"newsletter\",\n \"textColor\": \"c-muted-1\"\n }\n },\n\n \"rich-text#newsletter\": {\n \"props\": {\n \"textAlignment\": \"CENTER\",\n \"textPosition\": \"CENTER\",\n \"text\": \"Join our mailing list\",\n \"textColor\": \"c-muted-1\",\n \"font\": \"t-heading-2\"\n }\n },\n\n \"flex-layout.row#newsletter-container\": {\n \"children\": [\n \"newsletter#home\"\n ],\n \"props\": {\n \"blockClass\": \"newsletterContainer\"\n }\n },\n\n \"newsletter#home\": {\n \"props\": {\n \"hideLabel\": true,\n \"placeholder\": \"\"\n }\n }\n}\n\n```" } ]
code_assemblers-theme_5b91c601
[ { "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 assemblers-theme/store/blocks/home/styles-section.jsonc from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n\n{\n \"slider-layout#styles\": {\n \"props\": {\n \"itemsPerPage\": {\n \"desktop\": 1,\n \"tablet\": 1,\n \"mobile\": 1\n },\n \"blockClass\": \"styles\",\n \"showPaginationDots\": \"never\"\n },\n \"children\": [\n \"image#style1\",\n \"image#style2\"\n ]\n },\n \"image#style1\": {\n \"props\": {\n \"src\":\"https://user-images.githubusercontent.com/194400/49531010-48dad180-f8b1-11e8-8d89-1e61320e1d82.png\"\n }\n },\n \"image#style2\": {\n \"props\": {\n \"src\": \"https://user-images.githubusercontent.com/194400/49531010-48dad180-f8b1-11e8-8d89-1e61320e1d82.png\"\n }\n }\n}\n\n```" } ]
code_assemblers-theme_f424310c
[ { "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 assemblers-theme/store/blocks/home/home.jsonc from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.home\": {\n \"blocks\": [\n \"flex-layout.row#slider\",\n \"shelf#new-arrivals\",\n \"shelf#clearence\",\n \"flex-layout.row#newsletter\",\n \"rich-text#brands\",\n \"flex-layout.row#brands\",\n \"rich-text#instagram\",\n \"flex-layout.row#instagram\"\n ]\n },\n\n \"carousel#home\": {\n \"props\": {\n \"autoplay\": true,\n \"autoplaySpeed\": 4,\n \"banners\": [],\n \"height\": 440,\n \"showArrows\": true,\n \"showDots\": true\n }\n },\n\n \"flex-layout.row#slider\": {\n \"children\": [\n // \"slider-layout#styles\",\n \"carousel#home\"\n ]\n },\n\n \"flex-layout.row#brands\": {\n \"children\": [\n \"slider-layout#brands\"\n ],\n \"props\": {\n \"marginTop\": 4,\n \"marginBottom\": 8\n }\n },\n\n \"shelf#new-arrivals\": {\n \"blocks\": [\"product-summary.shelf\"],\n \"props\": {\n \"orderBy\": \"OrderByTopSaleDESC\",\n \"paginationDotsVisibility\": \"never\",\n \"collection\": \"139\",\n \"productList\": {\n \"maxItems\": 9,\n \"itemsPerPage\": 3,\n \"minItemsPerPage\": 1.5,\n \"scroll\": \"BY_PAGE\",\n \"arrows\": true,\n \"titleText\": \"New arrivals\"\n }\n }\n },\n\n \"shelf#clearence\": {\n \"blocks\": [\"product-summary.shelf\"],\n \"props\": {\n \"orderBy\": \"OrderByTopSaleDESC\",\n \"collection\": \"140\",\n \"paginationDotsVisibility\": \"desktopOnly\",\n \"productList\": {\n \"maxItems\": 9,\n \"itemsPerPage\": 3,\n \"minItemsPerPage\": 1.5,\n \"scroll\": \"BY_PAGE\",\n \"arrows\": true,\n \"titleText\": \"Clearence\"\n }\n }\n }\n}\n\n```" } ]
code_assemblers-theme_90ab88a1
[ { "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 assemblers-theme/store/blocks/home/instagram.jsonc from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"rich-text#instagram\": {\n \"props\": {\n \"textAlignment\": \"CENTER\",\n \"textPosition\": \"CENTER\",\n \"text\": \"Visit us on Instagram\",\n \"blockClass\": \"ocasiao\",\n \"textColor\": \"c-muted-1\",\n \"font\": \"t-heading-2\"\n }\n },\n\n \"flex-layout.row#instagram\": {\n \"children\": [\n \"flex-layout.col#instagram-post1\",\n \"flex-layout.col#instagram-post2\",\n \"flex-layout.col#instagram-post3\",\n \"flex-layout.col#instagram-post4\"\n ]\n },\n \"flex-layout.col#instagram-post1\": {\n \"children\": [\n \"sandbox#instagram-post1\"\n ]\n },\n \"flex-layout.col#instagram-post2\": {\n \"children\": [\n \"sandbox#instagram-post2\"\n ]\n },\n \"flex-layout.col#instagram-post3\": {\n \"children\": [\n \"sandbox#instagram-post3\"\n ]\n },\n \"flex-layout.col#instagram-post4\": {\n \"children\": [\n \"sandbox#instagram-post4\"\n ]\n },\n \"sandbox#instagram-post1\": {\n \"props\": {\n \"initialContent\": \"<iframe src=\\\"https://www.instagram.com/p/B33OxNrHlhU/embed\\\" height=460 frameBorder=\\\"0\\\"/>\"\n }\n },\n \"sandbox#instagram-post2\": {\n \"props\": {\n \"initialContent\": \"<iframe src=\\\"https://www.instagram.com/p/ByIy5EVhT6t/embed\\\" height=460 frameBorder=\\\"0\\\"/>\"\n }\n },\n \"sandbox#instagram-post3\": {\n \"props\": {\n \"initialContent\": \"<iframe src=\\\"https://www.instagram.com/p/BxUV2aIhnBr/embed\\\" height=460 frameBorder=\\\"0\\\"/>\"\n }\n },\n \"sandbox#instagram-post4\": {\n \"props\": {\n \"initialContent\": \"<iframe src=\\\"https://www.instagram.com/p/BxZtvPShdRW/embed\\\" height=460 frameBorder=\\\"0\\\"/>\"\n }\n }\n}\n\n```" } ]
code_assemblers-theme_42d43e8e
[ { "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 assemblers-theme/store/blocks/home/brands.jsonc from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"rich-text#brands\": {\n \"props\": {\n \"textAlignment\": \"CENTER\",\n \"textPosition\": \"CENTER\",\n \"text\": \"Our brands\",\n \"blockClass\": \"ocasiao\",\n \"textColor\": \"c-muted-1\",\n \"font\": \"t-heading-2\"\n }\n },\n\n \"slider-layout#brands\": {\n \"children\": [\n \"image#brand-1\",\n \"image#brand-2\",\n \"image#brand-3\",\n \"image#brand-4\",\n \"image#brand-5\",\n \"image#brand-6\",\n \"image#brand-7\",\n \"image#brand-8\"\n ],\n \"props\": {\n \"itemsPerPage\": {\n \"desktop\": 4,\n \"tablet\": 4,\n \"phone\": 2\n },\n \"navigationStep\": 2,\n \"showPaginationDots\": \"never\"\n }\n },\n\n \"image#brand-1\": {\n \"props\": {\n \"src\": \"https://appliancetheme.vteximg.com.br/arquivos/flatflat-brand-logo-square1.png\",\n \"maxWidth\": \"140px\",\n \"maxHeight\": \"100px\",\n \"link\": \"https://alfredo--appliancetheme.myvtex.com/major-appliances\"\n }\n },\n\n \"image#brand-2\": {\n \"props\": {\n \"src\": \"https://appliancetheme.vteximg.com.br/arquivos/flatflat-brand-logo-square2.png\",\n \"maxWidth\": \"140px\",\n \"maxHeight\": \"100px\",\n \"link\": \"https://alfredo--appliancetheme.myvtex.com/major-appliances\"\n }\n },\n\n \"image#brand-3\": {\n \"props\": {\n \"src\": \"https://appliancetheme.vteximg.com.br/arquivos/flatflat-brand-logo-square3.png\",\n \"maxWidth\": \"140px\",\n \"maxHeight\": \"100px\",\n \"link\": \"https://alfredo--appliancetheme.myvtex.com/major-appliances\"\n }\n },\n\n \"image#brand-4\": {\n \"props\": {\n \"src\": \"https://appliancetheme.vteximg.com.br/arquivos/flatflat-brand-logo-square4.png\",\n \"maxWidth\": \"140px\",\n \"maxHeight\": \"100px\",\n \"link\": \"https://alfredo--appliancetheme.myvtex.com/major-appliances\"\n }\n },\n\n \"image#brand-5\": {\n \"props\": {\n \"src\": \"https://appliancetheme.vteximg.com.br/arquivos/flatflat-brand-logo-square5.png\",\n \"maxWidth\": \"140px\",\n \"maxHeight\": \"100px\",\n \"link\": \"https://alfredo--appliancetheme.myvtex.com/major-appliances\"\n }\n },\n\n \"image#brand-6\": {\n \"props\": {\n \"src\": \"https://appliancetheme.vteximg.com.br/arquivos/flatflat-brand-logo-square6.png\",\n \"maxWidth\": \"140px\",\n \"maxHeight\": \"100px\",\n \"link\": \"https://alfredo--appliancetheme.myvtex.com/major-appliances\"\n }\n },\n\n \"image#brand-7\": {\n \"props\": {\n \"src\": \"https://appliancetheme.vteximg.com.br/arquivos/flatflat-brand-logo-square7.png\",\n \"maxWidth\": \"140px\",\n \"maxHeight\": \"100px\",\n \"link\": \"https://alfredo--appliancetheme.myvtex.com/major-appliances\"\n }\n },\n\n \"image#brand-8\": {\n \"props\": {\n \"src\": \"https://appliancetheme.vteximg.com.br/arquivos/flatflat-brand-logo-square8.png\",\n \"maxWidth\": \"140px\",\n \"maxHeight\": \"100px\",\n \"link\": \"https://alfredo--appliancetheme.myvtex.com/major-appliances\"\n }\n }\n}\n\n```" } ]
code_assemblers-theme_016f61f1
[ { "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 assemblers-theme/store/blocks/footer/footer.json from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"footer\": {\n \"blocks\": [\"footer-layout.desktop\", \"footer-layout.mobile\"]\n },\n \"footer-layout.desktop\": {\n \"children\": [\n \"flex-layout.row#footer-1-desktop\"\n ]\n },\n \"flex-layout.row#footer-1-desktop\": {\n \"children\": [\n \"flex-layout.col#footer-left-desktop\",\n \"flex-layout.col#footer-right-desktop\"\n ],\n \"props\": {\n \"blockClass\": \"footer-row\",\n \"paddingTop\": 7,\n \"paddingBottom\": 7\n }\n },\n\n \"flex-layout.col#footer-left-desktop\": {\n \"children\": [\"vtex.menu@2.x:menu#category-menu\"],\n \"props\": {\n \"blockClass\": \"footer-menu\"\n }\n },\n\n \"flex-layout.col#footer-right-desktop\": {\n \"children\": [\"accepted-payment-methods\"],\n \"props\": {\n \"blockClass\": \"footer-payment-methods\"\n }\n },\n\n \"accepted-payment-methods\": {\n \"props\": {\n \"paymentMethods\": [\"MasterCard\", \"Visa\", \"Diners Club\"]\n }\n },\n \"footer-layout.mobile\": {\n\n \"children\": [\n \"flex-layout.row#mid-footer\"\n ]\n },\n \"flex-layout.row#mid-footer\": {\n \"props\": {\n \"blockClass\": \"footer-row\"\n },\n \"children\": [\n \"flex-layout.col#colFoot\"\n ]\n },\n\n \"flex-layout.col#colFoot\": {\n \"children\": [\n \"vtex.menu@2.x:menu#footer\"\n ]\n },\n \"vtex.menu@2.x:menu#footer\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#category-electronics\",\n \"menu-item#category-major-appliances\",\n \"menu-item#category-small-appliances\"\n ]\n }\n}\n\n```" } ]
code_assemblers-theme_cf2c1ebd
[ { "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 assemblers-theme/store/blocks/footer/category-menu.json from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"vtex.menu@2.x:menu#category-menu\": {\n \"children\": [\n \"menu-item#category-electronics\",\n \"menu-item#category-major-appliances\",\n \"menu-item#category-small-appliances\"\n ]\n },\n \"menu-item#category-electronics\": {\n \"props\": {\n \"id\": \"menu-item-category-electronics\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/electronics/\",\n \"noFollow\": true,\n \"tagTitle\": \"Electronics\",\n \"text\": \"Electronics\"\n }\n }\n },\n\n \"menu-item#category-major-appliances\": {\n \"props\": {\n \"id\": \"menu-item-category-major-appliances\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/major-appliances/\",\n \"noFollow\": true,\n \"tagTitle\": \"Major Appliances\",\n \"text\": \"Major Appliances\"\n }\n }\n },\n \"menu-item#category-small-appliances\": {\n \"props\": {\n \"id\": \"menu-item-category-small-appliances\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/sale/d\",\n \"noFollow\": true,\n \"tagTitle\": \"Small appliances\",\n \"text\": \"Small appliances\"\n }\n }\n }\n}\n\n```" } ]
code_assemblers-theme_c74552cd
[ { "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 assemblers-theme/store/blocks/custom/styles-page.json from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.custom#styles\": {\n \"blocks\": [\n \"flex-layout.row#style-slider\",\n \"shelf#styles\",\n \"flex-layout.row#pink\",\n \"search-result#styles\"\n ]\n },\n\n \"flex-layout.row#style-slider\": {\n \"children\": [\n \"info-card#styles\"\n ]\n },\n\n \"info-card#styles\": {\n \"props\": {\n \"imageUrl\": \"https://image.shutterstock.com/z/stock-photo-party-with-best-friends-group-of-cheerful-young-people-enjoying-home-party-with-snacks-and-drinks-492006757.jpg\",\n \"callToActionMode\": \"none\",\n \"isFullModeStyle\": true,\n \"headline\": \" \",\n \"blockClass\": \"depbanner\"\n }\n },\n\n \"shelf#styles\": {\n \"blocks\": [\"product-summary.shelf\"],\n \"props\": {\n \"orderBy\": \"OrderByTopSaleDESC\",\n \"paginationDotsVisibility\": \"never\",\n \"collection\": \"139\",\n \"productList\": {\n \"maxItems\": 10,\n \"itemsPerPage\": 3,\n \"minItemsPerPage\": 1.5,\n \"scroll\": \"BY_PAGE\",\n \"arrows\": true,\n \"titleText\": \"\"\n }\n }\n },\n\n \"flex-layout.row#pink\": {\n \"props\":{\n \"horizontalAlign\": \"center\",\n \"blockClass\": \"pinkRow\"\n },\n \"children\": [\n \"flex-layout.col#pink\"\n ]\n },\n\n \"flex-layout.col#pink\": {\n \"props\":{\n \"blockClass\": \"pinkCol\",\n \"horizontalAlign\": \"center\",\n \"verticalAlign\": \"center\"\n\n },\n \"children\": [\n \"rich-text#concepts-title\",\n \"rich-text#concepts\"\n ]\n },\n\n \"rich-text#concepts-title\": {\n \"props\": {\n \"font\": \"t-heading-2\",\n \"textColor\": \"c-muted-1\",\n \"text\": \"A new concept\",\n \"textAlignment\": \"CENTER\",\n \"textPosition\": \"CENTER\"\n }\n },\n\n \"rich-text#concepts\": {\n \"props\": {\n \"textColor\": \"c-muted-1\",\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque id consectetur erat. Etiam nulla eros, scelerisque laoreet consequat sit amet, pharetra nec nibh. Nulla porta non sapien sed feugiat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ullamcorper justo enim, dictum vehicula mauris volutpat quis.\",\n \"textAlignment\": \"CENTER\",\n \"textPosition\": \"CENTER\"\n }\n },\n\n \"search-result#styles\": {\n \"blocks\": [\n \"gallery\",\n \"not-found\",\n \"order-by\",\n \"total-products\",\n \"search-title\"\n ],\n \"props\": {\n \"context\": {\n \"maxItemsPerPage\": 2,\n \"orderByField\": \"OrderByReleaseDateDESC\"\n },\n \"pagination\": \"show-more\"\n }\n }\n\n}\n\n```" } ]
code_assemblers-theme_49a8b2c8
[ { "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 assemblers-theme/store/blocks/header/category-menu.json from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"vtex.menu@2.x:menu#category-menu\": {\n \"children\": [\n \"menu-item#category-electronics\",\n \"menu-item#category-major-appliances\",\n \"menu-item#category-small-appliances\"\n ]\n },\n \"menu-item#category-electronics\": {\n \"props\": {\n \"id\": \"menu-item-category-electronics\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/electronics/\",\n \"noFollow\": true,\n \"tagTitle\": \"Electronics\",\n \"text\": \"Electronics\"\n }\n }\n },\n\n \"menu-item#category-major-appliances\": {\n \"props\": {\n \"id\": \"menu-item-category-major-appliances\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/major-appliances/\",\n \"noFollow\": true,\n \"tagTitle\": \"Major Appliances\",\n \"text\": \"Major Appliances\"\n }\n }\n },\n \"menu-item#category-small-appliances\": {\n \"props\": {\n \"id\": \"menu-item-category-small-appliances\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/small-appliances\",\n \"noFollow\": true,\n \"tagTitle\": \"Small appliances\",\n \"text\": \"Small appliances\"\n }\n }\n },\n \"menu-item#login\": {\n \"props\": {\n \"id\": \"menu-item-custom-login\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/account\",\n \"noFollow\": true,\n \"tagTitle\": \"My account\",\n \"text\": \"My account\"\n }\n }\n }\n}\n\n```" } ]
code_assemblers-theme_af503a52
[ { "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 assemblers-theme/store/blocks/header/header.jsonc from the assemblers-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"header\": {\n \"blocks\": [\n \"header-layout.desktop\",\n \"header-layout.mobile\"\n ]\n },\n \"header.full\": {\n \"blocks\": [\n \"header-layout.desktop\",\n \"header-layout.mobile\"\n ]\n },\n \"header-layout.desktop\": {\n \"children\": [\n \"header-row#4-desktop\",\n \"header-row#5-desktop\"\n ]\n },\n\n \"header-row#4-desktop\": {\n \"children\": [\n \"logo#desktop\"\n ],\n \"props\": {\n \"sticky\": true,\n \"blockClass\": \"main-header\"\n }\n },\n\n \"header-row#5-desktop\": {\n \"children\": [\n \"vtex.menu@2.x:menu#category-menu\",\n \"header-spacer\",\n \"header-spacer\",\n \"search-bar\",\n \"login\",\n \"minicart\"\n ],\n \"props\": {\n \"blockClass\": \"main-topbar\"\n }\n },\n\n \"logo#desktop\": {\n \"props\": {\n \"title\": \"Logo\",\n \"href\": \"/\",\n \"url\": \"https://appliancetheme.vteximg.com.br/arquivos/flatflat-logo-large.png\",\n \"width\": \"110\"\n }\n },\n\n \"minicart\": {\n \"blocks\": [\n \"product-summary\"\n ],\n \"props\": {\n \"type\": \"popup\",\n \"showRemoveButton\": true,\n \"showDiscount\": true,\n \"showSku\": true,\n \"labelMiniCartEmpty\": \"\",\n \"labelButtonFinishShopping\": \"Go to checkout\",\n \"enableQuantitySelector\": true,\n \"maxQuantity\": 10,\n \"labelClasses\": \"gray\"\n }\n },\n\n \"header-layout.mobile\": {\n \"children\": [\n \"header-row#1-mobile\"\n ]\n },\n\n\n \"header-row#1-mobile\": {\n \"children\": [\n \"drawer\",\n \"logo#mobile\",\n \"header-spacer\",\n \"header-spacer\",\n \"minicart\"\n ],\n \"props\": {\n \"sticky\": true,\n \"blockClass\": \"main-header-mobile\"\n }\n },\n\n \"drawer\": {\n \"children\": [\n \"menu#drawer\"\n ]\n },\n\n \"menu#drawer\": {\n \"children\": [\n \"menu-item#category-electronics\",\n \"menu-item#category-major-appliances\",\n \"menu-item#category-small-appliances\",\n \"menu-item#login\"\n ],\n \"props\": {\n \"orientation\": \"vertical\"\n }\n },\n\n \"logo#mobile\": {\n \"props\": {\n \"title\": \"Logo\",\n \"href\": \"/\",\n \"url\": \"https://storecomponents.vteximg.com.br/arquivos/store-theme-logo-mobile.png\",\n \"width\": \"70\"\n }\n }\n}\n\n```" } ]
code_bubbles_e9becd31
[ { "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 bubbles/pages/pages.json from the bubbles VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"pages\": {\n \"bubbles\": {\n \"path\": \"/bubbles\",\n \"auth\": true\n }\n },\n \"extensions\": {\n \"bubbles\": {\n \"component\": \"Bubbles\",\n \"ssr\": false\n }\n }\n}\n\n```" } ]
code_bubbles_eef5611f
[ { "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 bubbles/react/global.css from the bubbles VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n@import '//io.vtex.com.br/fonts/fabriga/stylesheet.css';\n\nhtml,\nbody,\n#render-container,\n#render-provider,\n.render-container,\n.render-provider,\n\n/* Fixes Safari position:fixed + z-index bug https://www.queness.com/code-snippet/16824/fix-mobile-safari-positionfixed-and-z-index-issue */\n.safari-positioning {\n transform: translate3d(0, 0, 0);\n -webkit-transform: translate3d(0, 0, 0);\n}\n\n.font-display,\n.font-body {\n font-family: 'Fabriga', 'Helvetica Neue', 'Arial', sans-serif;\n}\n\nbody {\n margin: 0;\n padding: 0;\n overflow-y: hidden;\n background: #142032;\n}\n\n.container{\n\twidth: 100vw;\n height: 100vh;\n\tposition: relative;\n}\n\na[href^=\"http://maps.google.com/maps\"]{display:none !important}\na[href^=\"https://maps.google.com/maps\"]{display:none !important}\n\n.gmnoprint a, .gmnoprint span, .gm-style-cc {\n display:none;\n}\n\n.logovtex {\n position: absolute;\n z-index: 9999;\n bottom: 10px;\n left: 15px;\n width: 250px;\n /* opacity: .5; */\n}\n\n#stats {\n z-index: 9999;\n display: none;\n}\n\n.image {\n position: absolute;\n z-index: 1;\n bottom: 20px;\n right: 35px;\n}\n\n.clip-svg {\n background-color: #fff;\n width: 380px;\n min-height: 380px;\n height: auto;\n border-radius: 20px;\n padding: 8px;\n /*border: 7px solid #F71963;*/\n}\n\n.label {\n position: absolute;\n bottom: 0;\n width: 90%;\n left: 5%;\n}\n\n.t { z-index: 9999; position: absolute; width: 200px; }\n\n\n@keyframes pulse {\n 0%{\n transform: scale(0) translate3d(0,0,0);\n }\n 3%{\n transform: scale(0) translate3d(0,0,0);\n }\n 100%{\n transform: scale(1.0) translate3d(0,0,0);\n }\n}\n\n@keyframes fade {\n 0%{\n opacity: 0.7;\n }\n 3%{\n opacity: 0.7;\n }\n 100%{\n opacity: 0;\n }\n}\n\n@keyframes shrink {\n 0%{\n transform: scale(0) translate3d(0,0,0);\n }\n 3%{\n transform: scale(1) translate3d(0,0,0);\n }\n 100%{\n transform: scale(0) translate3d(0,0,0);\n }\n}\n\n.Marker-point,\n.Marker-pulse {\n background:#F71963;\n border-radius:100%;\n position:absolute;\n width:30px;\n height:30px;\n top:-15px;\n left:-15px;\n}\n.Marker-point {\n width:16px;\n height:16px;\n top:-8px;\n left:-8px;\n /* animation: shrink cubic-bezier(0.000, 1.035, 0.220, 1.000) 20s both; */\n animation: shrink ease-out 2.5s both;\n}\n.Marker-pulse {\n width:200px;\n height:200px;\n top:-100px;\n left:-100px;\n animation: pulse cubic-bezier(0.165, 0.840, 0.440, 1.000) 2.5s both, fade cubic-bezier(0.000, 0.875, 0.375, 1.010) 2.5s both;\n}\n\n.x1 .Marker-pulse {\n width:80px;\n height:80px;\n top:-40px;\n left:-40px;\n}\n.x2 .Marker-pulse {\n width:100px;\n height:100px;\n top:-50px;\n left:-50px;\n}\n.x3 .Marker-pulse {\n width:150px;\n height:150px;\n top:-75px;\n left:-75px;\n}\n.x4 .Marker-pulse {\n width:180px;\n height:180px;\n top:-90px;\n left:-90px;\n}\n.x5 .Marker-pulse {\n width:200px;\n height:200px;\n top:-100px;\n left:-100px;\n}\n\n.x1 .Marker-point {\n /* animation-duration: 2s; */\n}\n.x2 .Marker-point {\n /* animation-duration: 5s; */\n}\n.x3 .Marker-point {\n /* animation-duration: 10s; */\n}\n.x4 .Marker-point {\n /* animation-duration: 20s; */\n}\n.x5 .Marker-point {\n /* animation-duration: 20s; */\n}\n\n#overlay,\n#image-gallery,\n#map,\n#map-borders,\n#heatmap {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 999;\n pointer-events:none;\n}\n\n#overlay {\n /* mix-blend-mode: lighten; */\n}\n\n#heatmap{\n opacity: 0.3;\n}\n\n#world-map {\n position: absolute;\n top: 0;\n left: 0;\n transform-origin: 0 0;\n}\n\n.login {\n display: none;\n position: fixed;\n left: 0;\n top: 0;\n z-index: 99999;\n}\n\n.reset {\n display: none;\n position: fixed;\n left: 150px;\n top: 0;\n z-index: 99999;\n}\n\n\n.loading {\n display: none;\n position: fixed;\n left: 20px;\n top: 10px;\n color:#fff;\n pointer-events: none;\n z-index: 99999;\n}\n\n.valid {\n display: none;\n position: fixed;\n top: 60px;\n left: 20px;\n color: #fff;\n pointer-events: none;\n z-index: 99999;\n}\n\n```" } ]
code_bubbles_25de289b
[ { "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 bubbles/react/typings.d.ts from the bubbles VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module '*.graphql' {\n import { DocumentNode } from 'graphql'\n\n const value: DocumentNode\n export default value\n}\n\ndeclare module 'vtex.styleguide' {\n import { ReactElement } from 'react'\n\n const Badge: ReactElement\n const Button: ReactElement\n const Checkbox: ReactElement\n const Dropdown: ReactElement\n const IconCaretRight: ReactElement\n const Input: ReactElement\n const Tab: ReactElement\n const Tabs: ReactElement\n const Textarea: ReactElement\n const Radio: ReactElement\n const Spinner: ReactElement\n const PageHeader: ReactElement\n\n export { Badge, Button, Checkbox, Dropdown, IconCaretRight, Input, Tab, Tabs, Textarea, Radio, Spinner, PageHeader }\n}\n\ndeclare module 'render' {\n import { ReactElement } from 'react'\n import { Helmet } from 'react-helmet'\n\n const NoSSR: ReactElement\n const Link: ReactElement\n const withRuntimeContext: ReactElement\n\n export { NoSSR, Helmet, Link, withRuntimeContext }\n}\n\ninterface Project {\n demoURL?: string\n description?: string\n edition?: string\n id?: string\n name?: string\n owner?: string\n team?: ProfileData[]\n}\n\ninterface ProfileData {\n id: string\n name: string\n email: string\n picture: string\n}\n\ninterface RuntimeProps {\n runtime: any\n}\n\nenum States {\n Registration = 'REGISTRATION',\n Running = 'RUNNING',\n Voting = 'VOTING',\n Results = 'RESULTS'\n}\n\n```" } ]
code_bubbles_47e29937
[ { "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 bubbles/react/package.json from the bubbles VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"name\": \"vtex.bubbles\",\n \"version\": null,\n \"scripts\": {\n \"lint\": \"tsc --noEmit && tslint -c tslint.json './**/*.ts'\"\n },\n \"dependencies\": {\n \"axios\": \"^0.18.0\",\n \"dat.gui\": \"^0.7.7\",\n \"stats.js\": \"^0.17.0\"\n },\n \"devDependencies\": {\n \"@types/graphql\": \"^0.13.3\",\n \"@types/node\": \"^9.4.7\",\n \"@types/prop-types\": \"^15.5.2\",\n \"@types/react\": \"^16.3.16\",\n \"@types/react-dom\": \"^16.0.5\",\n \"@types/react-helmet\": \"^5.0.5\",\n \"@types/react-intl\": \"^2.3.5\",\n \"graphql\": \"^0.13.0\",\n \"react\": \"^16.2.0\",\n \"react-apollo\": \"^2.0.4\",\n \"react-dom\": \"^16.2.0\",\n \"react-intl\": \"^2.4.0\",\n \"tslint\": \"^5.11.0\",\n \"tslint-config-vtex\": \"^2.0.0\",\n \"typescript\": \"3.9.7\"\n }\n}\n\n```" } ]
code_bubbles_e09c1924
[ { "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 bubbles/react/Bubbles.tsx from the bubbles VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React, { Component } from 'react'\nimport { Helmet } from 'render'\n\nimport './js/daynightoverlay.js'\n//@ts-ignore\nimport { IMAGE_ROOT, start } from './js/main.js'\n\nimport './global.css'\n\nexport default class Bubbles extends Component {\n public componentDidMount() {\n start()\n if (window.localStorage.getItem('autCookie')) {\n //@ts-ignore\n document.querySelector('.reset').style.display = 'block'\n setTimeout(() => {\n //@ts-ignore\n document.querySelector('.reset').style.display = 'none'\n }, 5*1000)\n }\n }\n\n private handleReset = () => {\n window.localStorage.removeItem('autCookie')\n window.location.reload()\n }\n\n private handleLogin = () => {\n const token = window.prompt('Paste token here:')\n window.localStorage.setItem('autCookie', String(token))\n try {\n //@ts-ignore\n document!.querySelector('.login')!.style.display = \"none\"\n //@ts-ignore\n document!.querySelector('.loading')!.style.display = \"block\"\n } catch(e){}\n // this.initGoogle(() => {\n // const genericWindow = window as any\n // const GoogleAuth = genericWindow.gapi.auth2.getAuthInstance()\n\n // if (false) {\n // // GoogleAuth.grantOfflineAccess().then((v: OfflineAccessResponse) =>\n // // exchangeCode(v)\n // // )\n // } else {\n // GoogleAuth.signIn().then(\n // () => {\n // this.loginSucceed(GoogleAuth)\n // },\n // (error: any) => {\n // // loginFailed()\n // console.log('erro no login')\n // }\n // )\n // }\n // }\n }\n\n private initGoogle = (callback: () => void) => {\n const genericWindow = window as any\n genericWindow.gapi.load('auth2', () => {\n genericWindow.gapi.auth2\n .init({\n client_id:\n '388920801697-jo8o228hlp7k5ifqhosum7tqml2br3kh.apps.googleusercontent.com',\n })\n .then(callback)\n })\n }\n\n private loginSucceed = (GoogleAuth: any) => {\n const profile = GoogleAuth.currentUser.get().getBasicProfile()\n console.log('login funcionou')\n console.log(profile)\n // if (!profile) {\n // loginFailed()\n // return\n // }\n // const email = profile.getEmail()\n // const image = profile.getImageUrl()\n // if (email.split('@')[1] === 'vtex.com.br') {\n // props.cookies.set(\n // keepLogged ? props.COOKIE_NAME : props.TEMPORARY_COOKIE_NAME,\n // GoogleAuth.currentUser.get().getAuthResponse().id_token,\n // {\n // maxAge: 2147483647,\n // }\n // )\n // props.setEmail(email)\n // props.setImageUrl(image)\n // props.setLogin(true)\n // } else {\n // setInvalidUser(true)\n // props.setLogin(false)\n // }\n }\n\n public render() {\n return (\n <div>\n <Helmet>\n <title>VTEX Order Map</title>\n <link rel=\"shortcut icon\" href=\"https://io.vtex.com.br/favico/1.3.0/favico.ico\"></link>\n <script src=\"https://io.vtex.com.br/front-libs/jquery/2.0.3/jquery-2.0.3.min.js\"></script>\n <script src=\"https://vtexid.vtex.com.br/api/vtexid/pub/authentication/vtexid.min.js\"></script>\n </Helmet>\n <div className=\"container\" id=\"container\" style={{ background: '#142032' }}>\n <canvas id=\"map\"></canvas>\n {/* <canvas id=\"heatmap\"></canvas> */}\n <canvas id=\"overlay\"></canvas>\n <canvas id=\"map-borders\"></canvas>\n <canvas id=\"image-gallery\"></canvas>\n <a href=\"https://en.vtex.com/\" rel=\"noopener noreferrer\" target=\"_blank\">\n <img src={`${IMAGE_ROOT}/vtex-logo.svg`} className=\"logovtex\" alt=\"Logo VTEX\"/>\n </a>\n </div>\n <div id=\"stats\"></div>\n <button onClick={this.handleLogin} className=\"login\">Login</button>\n <button onClick={this.handleReset} className=\"reset\">Reset Token</button>\n <div className=\"loading\">Connecting...</div>\n <div className=\"valid\"></div>\n </div>\n )\n }\n}\n\n```" } ]
code_bubbles_8bcec46d
[ { "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 bubbles/react/js/main.js from the bubbles VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport axios from 'axios'\nimport Stats from 'stats.js'\n\nconst stats = new Stats()\nstats.showPanel(0)\n\nconst isLinked = window && window.location && window.location.hostname.match('myvtex.com')\n\nconst IMAGE_ROOT = isLinked\n? `/_v/private/assets/v1/linked/${process.env.VTEX_APP_ID}/public/img`\n: `https://vtexpages.vteximg.com.br/_v/public/assets/v1/published/${process.env.VTEX_APP_ID}/public/img`\n\nfunction Queue(){var a=[],b=0;this.getLength=function(){return a.length-b};this.isEmpty=function(){return 0==a.length};this.enqueue=function(b){a.push(b)};this.dequeue=function(){if(0!=a.length){var c=a[b];2*++b>=a.length&&(a=a.slice(b),b=0);return c}};this.peek=function(){return 0<a.length?a[b]:void 0}};\n\nconst start = () => {\n var heatmap\n var heatmapData=[]\n var markers = []\n var images = []\n var markerInterval\n var messageInterval\n var timeConnect\n var connection\n var nextTime\n var queueImage = new Queue()\n var queueMarker = new Queue()\n var pendingMarkers = 0\n var pulseCanvas = document.querySelector('#overlay')\n var pulseContext = pulseCanvas.getContext('2d')\n var pulseResolution = 1\n // var heatmapCanvas = document.querySelector('#heatmap')\n // var heatmapContext = heatmapCanvas.getContext('2d')\n var galleryCanvas = document.querySelector('#image-gallery')\n var galleryContext = galleryCanvas.getContext('2d')\n var galleryResolution = 0.8\n var mapCanvas = document.querySelector('#map')\n var mapContext = mapCanvas.getContext('2d')\n var bordersMapCanvas = document.querySelector('#map-borders')\n var bordersMapContext = bordersMapCanvas.getContext('2d')\n var dayMapURL = `${IMAGE_ROOT}/world-map-2.svg`\n var nightMapURL = `${IMAGE_ROOT}/world-map-2-night.svg`\n var bordersMapURL = `${IMAGE_ROOT}/world-map-2-borders.svg`\n var nightBordersMapURL = `${IMAGE_ROOT}/world-map-2-night-borders.svg`\n var fps = 60\n var frame = 1000 / fps\n var errorCount = 0\n const imagesLimit = 200\n\n var dayMapImage\n var nightMapImage\n var bordersMapImage\n var nightBordersMapImage\n\n // size of the map image\n var mapWidth = 1009\n var mapHeight = 665\n\n var mapViewBounds = {\n bottomLeft: {\n x:50,\n y:600,\n },\n topRight: {\n x:900,\n y:280,\n }\n }\n\n var boundsSize = {\n width: mapViewBounds.topRight.x - mapViewBounds.bottomLeft.x,\n height: mapViewBounds.bottomLeft.y - mapViewBounds.topRight.y,\n }\n\n var boundsRatios = {\n width: mapWidth / boundsSize.width,\n height: mapHeight / boundsSize.height,\n }\n var boundsRatio = boundsSize.width/boundsSize.height\n var windowRatio = window.innerWidth/window.innerHeight\n var mapScale\n var mapOffset\n\n if (windowRatio < boundsRatio) {\n mapScale = window.innerWidth / boundsSize.width\n mapOffset = {\n x: -mapViewBounds.bottomLeft.x,\n y: -mapViewBounds.topRight.y + ((window.innerHeight/mapScale) - boundsSize.height)/2,\n }\n } else {\n mapScale = window.innerHeight / boundsSize.height\n mapOffset = {\n y: -mapViewBounds.topRight.y,\n x: -mapViewBounds.bottomLeft.x + ((window.innerWidth/mapScale) - boundsSize.width)/2,\n }\n }\n\n document.querySelector('#stats').appendChild(stats.dom)\n // AQUI\n // document.querySelector(\"#world-map\").style.transform = \"scale(\"+mapScale+\") translate3d(\"+mapOffset.x+\"px, \"+mapOffset.y+\"px, 0)\"\n\n // Hardcoded rates for currency conversion. We don't need the most updated and precise numbers,\n // just a slight idea of proportions.\n var conversionRates = {\n 'ARS': 0.055,\n 'BRL': 1,\n 'CLP': 0.0068,\n 'COP': 0.0014,\n 'MXN': 0.26,\n 'PEN': 1.38,\n 'PYG': 0.00082,\n 'RON': 1.26,\n 'USD': 5.57,\n 'CAD': 4.40,\n 'UYU': 0.13,\n 'EUR': 6.24,\n 'CRC': 0.0087,\n 'BOB': 0.81,\n 'GTQ': 0.72,\n };\n\n function attempt() {\n console.log('attempt')\n connection = connect();\n if (localStorage.getItem('autCookie')) {\n document.querySelector('.loading').style.display='block'\n }\n openSocket();\n }\n\n function openSocket() {\n clearInterval(timeConnect)\n clearInterval(markerInterval)\n clearInterval(messageInterval)\n\n function onClose(event) {\n alert('on close '+String(event))\n setTimeout(attempt, 5000)\n // window.localStorage.removeItem('autCookie')\n // setTimeout(() => {\n // var curAddress = window.location.href\n // localStorage.removeItem('autCookie')\n // // window.location.href = `/_v/auth-server/v1/login?ReturnUrl=${curAddress}`\n // }, 10000)\n\n // console.log('Closed')\n // clearInterval(timeConnect)\n // timeConnect = setInterval(openSocket, 1000)\n\n document.querySelector('.login').style.display = \"block\"\n document.querySelector('.loading').style.display='none'\n }\n\n function parseJwt (token) {\n try {\n var base64Url = token.split('.')[1];\n var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');\n var jsonPayload = decodeURIComponent(atob(base64).split('').map(function(c) {\n return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);\n }).join(''));\n\n return JSON.parse(jsonPayload);\n } catch (e) {\n return null\n }\n };\n\n function onError(event) {\n if (event) {\n // alert('on error '+event.message)\n console.log('error message', event)\n console.log(JSON.stringify(event))\n console.table(event)\n } else {\n // alert('on error, no event')\n }\n errorCount++\n if (errorCount > 2) {\n window.localStorage.removeItem('autCookie')\n }\n setTimeout(attempt, 5000)\n document.querySelector('.login').style.display = \"block\"\n document.querySelector('.loading').style.display='none'\n }\n\n function onOpen() {\n // Connected\n console.log('Connected')\n document.querySelector('.login').style.display='none'\n document.querySelector('.loading').style.display='none'\n updateTokenMessage({ initial: true })\n }\n\n function updateTokenMessage({ initial }) {\n const jwt = parseJwt(localStorage.getItem('autCookie'))\n if (!jwt) {\n return\n }\n const expiry = new Date(jwt.exp*1000)\n const remaining = (jwt.exp-Date.now()/1000)\n const remainingHours = Math.floor(remaining/60/60)\n const remainingMinutes = Math.floor(((remaining/60/60)-remainingHours)*60)\n\n if (remainingHours > 1 && !initial) {\n return\n }\n\n document.querySelector('.valid').style.display='block'\n document.querySelector('.valid').innerHTML = `Token valid until ${expiry}. <br> Please refresh the page and generate a new token before then. <br> ${remainingHours} hour(s) ${remainingMinutes} minute(s) left`\n if (initial) {\n setTimeout(() => {\n document.querySelector('.valid').style.display='none'\n }, 5 * 1000)\n }\n }\n\n if (!connection) {\n console.log('no autCookie, no connection')\n onError()\n return\n }\n\n connection.onopen = onOpen\n connection.onerror = onError\n connection.onclose = onClose\n\n connection.onmessage = function onMessage (msg) {\n // console.log(msg.data)\n queueMarker.enqueue(msg.data)\n nextTime = getNextTime()\n errorCount = 0\n };\n\n markerInterval = setInterval(function handleMarkerQueue() {\n var now = new Date()\n var _nextTime = nextTime || getNextTime()\n var slots = Math.floor( (_nextTime - now.getTime()) / 2000)\n var chunk = 0\n\n if (slots > 0) {\n chunk = Math.ceil( queueMarker.getLength()/slots);\n }\n\n for (var i = chunk; i >= 0; i--) {\n moveQueue(chunk ? i*2000/chunk : 1)\n }\n\n }, 2000)\n\n messageInterval = setInterval(() => {\n updateTokenMessage({})\n }, 1000 * 60)\n\n function moveQueue(time) {\n pendingMarkers++\n var timeVariation=time*0.2\n setTimeout(function moveQueue() {\n if (!queueMarker.isEmpty()) {\n var markerData=queueMarker.dequeue()\n renderMarkers(markerData)\n pendingMarkers--\n }\n }, time + (-timeVariation + (Math.random()*timeVariation*2)))\n }\n\n } // End openSocket\n\n function connect() {\n console.log('connect')\n function getCookie(name) {\n var value = \"; \" + document.cookie;\n var parts = value.split(\"; \" + name + \"=\");\n if (parts.length == 2) return parts.pop().split(\";\").shift();\n }\n // TEMP FIX\n var autCookie = getCookie('VtexIdclientAutCookie') || null\n var url = \"https://storedash-api.vtex.com/api/storedash/orderStream\"\n\n if (!autCookie) {\n autCookie = localStorage.getItem('autCookie')\n }\n\n // if (!autCookie || autCookie === 'null') {\n // autCookie = window.prompt('authToken')\n // localStorage.setItem('autCookie', autCookie)\n // }\n\n if(autCookie) {\n url+='?authToken='+autCookie\n }\n\n if (!autCookie) {\n return\n }\n\n var evtSource = new EventSource(url);\n\n // evtSource.onerror = function (event) {\n // console.log(\"Couldn't connect to Storedash OrderStream evtSource.\");\n // document.querySelector('.login').style.display='block'\n // attempt()\n // };\n\n return evtSource;\n }\n\n function initialize() {\n document.getElementById('container').style.height = window.innerHeight + 'px'\n\n dayMapImage = new Image()\n nightMapImage = new Image()\n bordersMapImage = new Image()\n nightBordersMapImage = new Image()\n Promise.all([\n new Promise(function(resolve) {\n dayMapImage.addEventListener('load', function() {\n resolve(dayMapImage)\n })\n }),\n new Promise(function(resolve) {\n nightMapImage.addEventListener('load', function() {\n resolve(nightMapImage)\n })\n }),\n new Promise(function(resolve) {\n bordersMapImage.addEventListener('load', function() {\n resolve(bordersMapImage)\n })\n }),\n new Promise(function(resolve) {\n nightBordersMapImage.addEventListener('load', function() {\n resolve(nightBordersMapImage)\n })\n }),\n ]).then(function(){\n\n mapCanvas.setAttribute('width', window.innerWidth)\n mapCanvas.setAttribute('height', window.innerHeight)\n\n mapContext.save()\n\n mapContext.scale(mapScale, mapScale)\n mapContext.translate(mapOffset.x, mapOffset.y)\n mapContext.drawImage(dayMapImage, 0, 0)\n\n mapContext.save()\n\n var overlay = new DayNightOverlay()\n overlay.onAdd()\n overlay.draw(mapContext, mapWidth, mapHeight+390)\n mapContext.clip()\n mapContext.drawImage(nightMapImage, 0, 0)\n\n bordersMapCanvas.setAttribute('width', window.innerWidth)\n bordersMapCanvas.setAttribute('height', window.innerHeight)\n\n bordersMapContext.save()\n\n bordersMapContext.scale(mapScale, mapScale)\n bordersMapContext.translate(mapOffset.x, mapOffset.y)\n bordersMapContext.drawImage(bordersMapImage, 0, 0)\n\n bordersMapContext.save()\n\n overlay.draw(bordersMapContext, mapWidth, mapHeight+390)\n bordersMapContext.clip()\n bordersMapContext.drawImage(nightBordersMapImage, 0, 0)\n })\n dayMapImage.src = dayMapURL\n nightMapImage.src = nightMapURL\n bordersMapImage.src = bordersMapURL\n nightBordersMapImage.src = nightBordersMapURL\n\n initCanvas()\n }\n\n function initCanvas() {\n pulseCanvas.setAttribute('width',window.innerWidth*pulseResolution)\n pulseCanvas.setAttribute('height',window.innerHeight*pulseResolution)\n pulseCanvas.style.width = window.innerWidth+'px'\n pulseCanvas.style.height = window.innerHeight+'px'\n // heatmapCanvas.setAttribute('width',window.innerWidth)\n // heatmapCanvas.setAttribute('height',window.innerHeight)\n galleryCanvas.setAttribute('width',window.innerWidth*galleryResolution)\n galleryCanvas.setAttribute('height',window.innerHeight*galleryResolution)\n galleryCanvas.style.width = window.innerWidth+'px'\n galleryCanvas.style.height = window.innerHeight+'px'\n\n\n var markerSpeed = 0.002\n var markerColor = '#F71963'\n var highlightMarkerColor = '#ffc4dd'\n\n var imageSpeed = 0.0025\n\n function easeOutElastic(t, b, c, d) {\n var s=1.10158; var p=0;var a=c;\n if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.35;\n if (a < Math.abs(c)) { a=c; var s=p/4; }\n else var s = p/(2*Math.PI) * Math.asin (c/a);\n return a*Math.pow(2,-15*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;\n }\n\n var start = null\n function update(delta) {\n pulseContext.clearRect(0,0, window.innerWidth*pulseResolution, window.innerHeight*pulseResolution)\n\n pulseContext.strokeStyle = markerColor\n\n for(let i=0; i< markers.length; i++){\n let marker = markers[i]\n var pulseT = Math.max(0, Math.min(1,marker.t*8)-(0.01+Math.min(0.13, marker.value*0.00001)))\n\n if(pulseT < 0.5) {\n // var pulseScale = Math.log10(Math.max(1, marker.value/200))+1\n var pulseScale = Math.log10(Math.max(1, marker.value/200))+1\n\n var initialPulseSize = 55*pulseScale\n // var initialPulseSize = 55*pulseScale\n\n var pulseSize = initialPulseSize*Math.pow(pulseT,1/2)\n // pulseContext.globalAlpha = Math.pow(1-pulseT,1/4)*0.4\n // pulseContext.lineWidth = pulseSize*2*Math.pow(1-pulseT, 8) * pulseResolution\n\n // pulseContext.lineWidth = (pulseSize*1.3)*1*Math.pow(1-pulseT, 8) * pulseResolution\n\n pulseContext.lineWidth = (pulseSize*2)*1*Math.pow(1-pulseT, 8) * pulseResolution\n\n // var lineWidth = pulseSize*2*Math.pow(1-pulseT, 8) * pulseResolution\n // pulseContext.strokeStyle = markerColor\n\n pulseContext.beginPath()\n pulseContext.arc(\n marker.x*pulseResolution, marker.y*pulseResolution,\n pulseSize*pulseResolution,\n 0, 2*Math.PI\n )\n pulseContext.globalAlpha = 1\n pulseContext.stroke()\n }\n marker.t += markerSpeed*delta\n }\n\n pulseContext.globalAlpha = 1\n for(let i=0; i< markers.length; i++){\n let marker = markers[i]\n if(marker.t >= 1) continue\n\n pulseContext.beginPath()\n pulseContext.fillStyle = marker.t < 0.01 ? highlightMarkerColor : markerColor\n pulseContext.moveTo(marker.x*pulseResolution, marker.y*pulseResolution)\n pulseContext.arc(\n marker.x*pulseResolution, marker.y*pulseResolution,\n 10*Math.pow(1-Math.abs(marker.t-(0+Math.min(marker.value*0.00001,0.02))),30)*pulseResolution,\n 0, 2*Math.PI\n )\n pulseContext.fill()\n }\n pulseContext.globalAlpha = 1\n\n galleryContext.clearRect(0, 0, window.innerWidth*galleryResolution, window.innerHeight*galleryResolution)\n for(let i =0; i<images.length; i++){\n let image = images[i]\n if(image.t >= 1) continue\n\n var offset = Math.pow(image.t, 1/3) * 350\n var scale = Math.max(0.1, easeOutElastic(Math.min(1,image.t*2), 0, 1, 1))*(1+image.scale*0.6)\n var imageSize = 100\n var origin = {\n x: window.innerWidth - 100 - (image.origin * 60),\n y: window.innerHeight + 0,\n }\n var gravity = {\n x: 0,\n y: image.t * -(window.innerHeight - 300 + (image.gravityIncrease*300)),\n }\n var targetSize = imageSize * scale\n var oscilation = Math.sin(image.t*image.oscilationFreq*14)*image.oscilationAmp*40*(1+image.t*0.1)\n var targetPos = {\n x: origin.x+(Math.cos(image.direction)*offset)+oscilation+gravity.x,\n y: origin.y+(Math.sin(image.direction)*offset)+gravity.y,\n }\n image.y = targetPos.y\n\n galleryContext.drawImage(\n image.image,\n (targetPos.x - (targetSize/2))*galleryResolution,\n (targetPos.y - (targetSize/2))*galleryResolution,\n targetSize*galleryResolution,\n targetSize*galleryResolution,\n )\n\n // galleryContext.restore()\n\n // var speedIncreaseFactor = 0.2\n // image.t += imageSpeed*delta + (image.speedIncrease * speedIncreaseFactor)*Math.max(0, 1-image.t*4)*delta\n // image.speedIncrease *= 1 - speedIncreaseFactor*delta\n image.t += imageSpeed*delta\n }\n\n requestAnimationFrame(updateAgain)\n }\n let shouldUpdate = true\n function updateAgain(t){\n stats.begin()\n if(!start) start = t\n shouldUpdate = !shouldUpdate\n if(!shouldUpdate){\n requestAnimationFrame(updateAgain)\n return\n }\n var delta = (t - start)/frame\n start = t\n update(delta)\n stats.end()\n }\n updateAgain(performance.now())\n\n setInterval(function(){\n let i\n for(i = markers.length-1; i >= 0; i--){\n let marker = markers[i]\n if(marker.t >= 0.2) {\n markers.splice(i, 1)\n }\n }\n for(i = images.length-1; i >= 0; i--){\n let image = images[i]\n if(image.y < -100) {\n image.image = null\n images.splice(i, 1)\n }\n }\n }, 1000)\n }\n\n function getNextTime() {\n return new Date().getTime() + 15000\n }\n\n function addHeatMapPoint(x,y){\n heatmapContext.fillStyle='#ffc4dd'\n // heatmapContext.fillStyle='#F71963'\n heatmapContext.globalAlpha = 0.15\n heatmapContext.beginPath()\n heatmapContext.arc(x, y, 8, 0, 2*Math.PI)\n heatmapContext.fill()\n\n heatmapContext.globalAlpha = 1\n heatmapContext.beginPath()\n heatmapContext.arc(x, y, 0.5+(Math.random()*1.5), 0, 2*Math.PI)\n heatmapContext.fill()\n }\n\n function latLngToPoint(latitude, longitude, mapWidth, mapHeight) {\n // get x value\n const x = (longitude+180)*(mapWidth/360)\n\n // convert from degrees to radians\n const latRad = latitude*Math.PI/180;\n\n // get y value\n const mercN = Math.log(Math.tan((Math.PI/4)+(latRad/2)));\n const y = (mapHeight/2)-(mapWidth*mercN/(2*Math.PI));\n\n return {x: x, y: y}\n }\n\n function renderMarkers(data) {\n data = JSON.parse(data)\n\n if (data.lat != 0 && data.long != 0 && data.transactionTotal) {\n var pos = latLngToPoint(data.lat, data.long, mapWidth*mapScale, mapHeight*mapScale)\n pos.x += (-30*mapScale)+(mapOffset.x*mapScale)\n pos.y += (130*mapScale)+(mapOffset.y*mapScale)\n\n const st = 1\n for (let i = 0; i<st; i++) {\n setTimeout(() => {\n showImage(data.accountName, data.salesChannel, data.sku, pos.x, pos.y)\n .then(function(){\n let value = 1\n if (conversionRates[data.transactionCurrency]) {\n value = data.transactionTotal * conversionRates[data.transactionCurrency];\n } else {\n console.warn('Missing conversion rate for ' + data.transactionCurrency);\n }\n\n var variation = 3\n pos.x += -variation + (Math.random() * variation * 2)\n pos.y += -variation + (Math.random() * variation * 2)\n\n markers.push({\n x: pos.x+(i>0 ? Math.random()*10 : 0),\n y: pos.y+(i>0 ? Math.random()*10 : 0),\n t: 0,\n value: value,\n })\n\n // addHeatMapPoint(pos.x, pos.y)\n })\n }, (2000/st)*i)\n }\n }\n }\n\n let statsVisible = false\n document.addEventListener('keydown', event => {\n if (event.key === 'f') {\n statsVisible = !statsVisible\n document.querySelector('#stats').style.display = statsVisible ? 'block' : 'none'\n }\n })\n var pending = 0\n\n async function getImageUrl(an, sc, skuId) {\n if (pending.length > 10) return Promise.reject()\n\n pending++\n\n const response = await axios({\n method: 'get',\n url: '/api/catalog_system/pub/products/search',\n params: {\n an: an,\n sc: sc,\n timeout: 500,\n fq: `skuId:${skuId}`,\n }\n })\n\n const {data} = response\n const sku = data[0].items.find(({itemId}) => itemId === skuId)\n const imageUrl = sku.images && sku.images.length > 0 && sku.images[0].imageUrl\n\n pending--\n if (imageUrl) {\n return imageUrl\n }\n\n throw new Error(`Couldn't load image. an=${an} sc=${sc} skuId=${skuId}`)\n }\n\n function resizeImageUrl(url, size){\n if(!url) return\n var idsRegex = /\\/ids\\/(\\d*)\\//\n\n var ids = url.match(idsRegex)\n if(ids && ids[1]){\n ids = ids[1]\n }else{\n return url\n }\n\n return url.replace(idsRegex, '/ids/'+ids+'-'+size+'-'+size+'/')\n }\n\n var loadImageDelay = 350\n var shouldLoadImage = true\n\n const loadImage = url => new Promise((resolve, reject) => {\n if(!shouldLoadImage){\n reject()\n return\n }\n var image=new Image()\n function onImageLoad(){\n image.removeEventListener('load', onImageLoad)\n resolve(image)\n }\n image.addEventListener('load', onImageLoad)\n image.src = url\n setTimeout(()=>{\n image.removeEventListener('load', onImageLoad)\n reject()\n }, 3000)\n\n shouldLoadImage = false\n setTimeout(() => { shouldLoadImage = true }, loadImageDelay)\n })\n\n function maskImage(image, size) {\n var canvas=document.createElement('canvas')\n canvas.setAttribute('width', size)\n canvas.setAttribute('height', size)\n var context = canvas.getContext('2d')\n\n context.fillStyle = 'white'\n context.save()\n context.globalAlpha = 1\n context.beginPath()\n context.arc(\n (size/2)*galleryResolution, (size/2)*galleryResolution,\n (size/2)*galleryResolution-2, 0, 2*Math.PI\n )\n context.fill()\n\n if (image){\n // context.strokeStyle = '#142032'\n // context.lineWidth = 2\n // context.stroke()\n\n context.beginPath()\n context.arc(\n (size/2)*galleryResolution, (size/2)*galleryResolution,\n (size/2)*galleryResolution-2, 0, 2*Math.PI\n )\n context.clip()\n\n context.drawImage(image, 1, 1)\n }\n return canvas\n }\n\n function addDummyImage(sourceX, sourceY){\n if (images.length >= imagesLimit) {\n return\n }\n images.unshift({\n image: maskImage(null, 100),\n t: 0,\n direction: -Math.PI/2, // + (-variation + Math.random()*variation*2),\n // oscilationFreq: Math.random(),\n // oscilationAmp: Math.random(),\n oscilationFreq: Math.random(),\n oscilationAmp: -1+(Math.random()*2),\n sourceX: sourceX,\n sourceY: sourceY,\n scale: -0.85-Math.random()*0.1,\n origin: 1,\n speedIncrease: 0,\n gravityIncrease: 1+Math.random()*2,\n })\n }\n function showImage(an, sc, skuId, sourceX, sourceY) {\n return new Promise(function(resolve) {\n getImageUrl(an, sc, skuId)\n .then(function(response) {\n var resizedUrl = resizeImageUrl(response, 100*galleryResolution)\n loadImage(resizedUrl).then(image=>{\n var variation = Math.PI/18\n // var speedIncrease = 0.05\n // images.forEach(image => {\n // image.speedIncrease += 0.05\n // })\n var maskedImage = maskImage(image, 100)\n setTimeout(() => {\n images.push({\n image: maskedImage,\n t: 0,\n direction: -Math.PI/2, // + (-variation + Math.random()*variation*2),\n // oscilationFreq: Math.random(),\n // oscilationAmp: Math.random(),\n oscilationFreq: Math.random(),\n oscilationAmp: -1+(Math.random()*2),\n sourceX: sourceX,\n sourceY: sourceY,\n scale: Math.random(),\n origin: 1,\n speedIncrease: 0,\n gravityIncrease: Math.random(),\n })\n resolve()\n }, Math.random()*1000)\n }).catch(()=>{\n setTimeout(() => {\n addDummyImage(sourceX, sourceY)\n resolve()\n }, Math.random()*1000)\n })\n })\n .catch(function handleError() {\n setTimeout(() => {\n addDummyImage(sourceX, sourceY)\n resolve()\n }, Math.random()*1000)\n })\n })\n }\n\n initialize()\n\n attempt()\n\n setInterval(function reloadWindow() {\n window.location.reload(false);\n }, 10 * 60 * 1000);\n}\n\nexport {\n IMAGE_ROOT,\n start\n}\n\n```" } ]
code_bubbles_d7a8d38d
[ { "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 bubbles/react/js/daynightoverlay.js from the bubbles VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\n/**\n * Day/Night Overlay\n * Version 1.3\n *\n * @author kaktus621@gmail.com (Martin Matysiak)\n * @fileoverview This class provides a custom overlay which shows an\n * approximation of where the day/night line runs at any given date.\n */\n\n/**\n * @license Copyright 2011-2012 Martin Matysiak.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * DayNightOverlayOptions\n *\n * {string} fillColor A color string that will be used when drawing\n * the night area.\n * {string} id A unique identifiert which will be assigned to the\n * canvas on which we will draw.\n * {Date} date A specific point of time for which the day/night-\n * overview shall be calculated (UTC date is taken).\n * {google.maps.Map} map A handle to the Google Maps map on which the\n * overlay shall be shown.\n */\n\n\n\n/**\n * The Class which represents the Overlay.\n *\n * @constructor\n * @param {DayNightOverlayOptions=} opt_params A set of optional parameters.\n * @extends {google.maps.OverlayView}\n */\nvar DayNightOverlay = function(opt_params) {\n\n /**\n * The canvas on which we will draw later on.\n * @type {?element}\n * @private\n */\n this.canvas_ = null;\n\n /**\n * The color with which the night area shall be filled.\n * @type {!string}\n * @private\n */\n this.fillColor_ = 'rgba(0,0,0,0.5)';\n\n /**\n * If specified, this ID will be assigned to the Canvas element which will be\n * created later on.\n * @type {?string}\n * @private\n */\n this.id_ = null;\n\n /**\n * If specified, this fixed date will be drawn instead of the current time.\n * The date should always be specified in UTC! Please not that not only the\n * time, but also the day counts because of the sun's movement between the\n * Solstices.\n * @type {?Date} A date object that should be displayed\n * @private\n */\n this.date_ = null;\n\n if (typeof opt_params == 'object') {\n // Check which defaults shall be overwritten\n if (typeof opt_params.fillColor != 'undefined') {\n this.fillColor_ = opt_params.fillColor;\n }\n\n if (typeof opt_params.id != 'undefined') {\n this.id_ = opt_params.id;\n }\n\n if (typeof opt_params.date != 'undefined') {\n this.date_ = opt_params.date;\n }\n\n if (typeof opt_params.map != 'undefined') {\n this.setMap(opt_params.map);\n }\n }\n};\n\n// AQUI\n// DayNightOverlay.prototype = new google.maps.OverlayView();\n\n\n/**\n * A fixed reference to a very northern point on the world. Note: latitudes\n * over 85 degrees result in a strange bug where the calculated pixel\n * coordinates are _way_ outside the map. Therefore I use latitudes of +-85\n * degrees which result in being placed very close to the visible borders\n * of the map. I suppose this behaviour has to do with the mecrator projection.\n *\n * @type {google.maps.LatLng}\n * @private\n * @const\n */\n// DayNightOverlay.NORTH_ = new google.maps.LatLng(85, 0);\nDayNightOverlay.NORTH_ = {lat: 85, lng: 0}\n\n\n/**\n * A fixed reference to a very southern point on the world. Note: see\n * DayNightOverlay.NORTH_.\n *\n * @type {google.maps.LatLng}\n * @private\n * @const\n */\n// DayNightOverlay.SOUTH_ = new google.maps.LatLng(-85, 0);\nDayNightOverlay.SOUTH_ = {lat: -85, lng: 0}\n\n\n/** @override */\nDayNightOverlay.prototype.onAdd = function() {\n this.canvas_ = document.createElement('canvas');\n this.canvas_.style.position = 'absolute';\n\n if (this.id_) {\n this.canvas_.id = this.id_;\n }\n\n // this.getPanes().overlayLayer.appendChild(this.canvas_);\n //AQUI\n};\n\n\n/** @override */\nDayNightOverlay.prototype.onRemove = function() {\n this.canvas_.parentNode.removeChild(this.canvas_);\n this.canvas_ = null;\n};\n\n\n/** @override */\nDayNightOverlay.prototype.draw = function(ctx, width, height) {\n\n // Adjust the canvas to the current map's size\n\n // AQUI\n // var projection = this.getProjection();\n var projection = {\n width: width,\n height: height,\n }\n\n console.log(projection)\n\n var worldDim = this.getWorldDimensions_(projection);\n var visibleDim = this.getVisibleDimensions_(projection, 0);\n\n // The viewport dimensions seem to be a bit buggy on small zoom levels.\n // Therefore we adjust the viewport to the world's dimensions, extended by\n // half a world width on the left and right\n // AQUI\n // if (this.getMap().getZoom() < 3) {\n // visibleDim.x = worldDim.x - worldDim.width;\n // visibleDim.y = worldDim.y;\n // visibleDim.width = worldDim.width * 3;\n // visibleDim.height = worldDim.height;\n // }\n\n // Resize canvas to current viewport\n this.canvas_.style.left = visibleDim.x + 'px';\n this.canvas_.style.top = visibleDim.y + 'px';\n this.canvas_.style.width = visibleDim.width + 'px';\n this.canvas_.style.height = visibleDim.height + 'px';\n // Important: resize not only CSS dimensions, but also canvas dimensions\n this.canvas_.width = visibleDim.width;\n this.canvas_.height = visibleDim.height;\n\n // Clear the current canvas\n // var ctx = this.canvas_.getContext('2d');\n // ctx.clearRect(0, 0, visibleDim.width, visibleDim.height);\n\n // Redraw the wave which approximately describes where it's currently night\n var terminator = this.createTerminatorFunc_(visibleDim, worldDim);\n var northernSun = this.isNorthernSun_(this.date_ ? this.date_ : new Date());\n\n ctx.fillStyle = this.fillColor_;\n ctx.beginPath();\n ctx.moveTo(0, northernSun ? visibleDim.height : 0);\n for (var x = 0; x < visibleDim.width; x++) {\n ctx.lineTo(x, terminator(x));\n }\n ctx.lineTo(visibleDim.width, northernSun ? visibleDim.height : 0);\n // ctx.fill();\n};\n\n\n/**\n * Setter for date_.\n *\n * @param {?Date} date A specific point of time for which the day/night-\n * overview shall be calculated (UTC date is taken) or null if the current\n * time shall be taken.\n */\nDayNightOverlay.prototype.setDate = function(date) {\n this.date_ = date;\n\n // Redraw the line if we're added to a maps canvas\n if (this.canvas_ !== null) {\n this.draw();\n }\n};\n\n\n/**\n * Returns the coordinates of the world map, based on the current maps view.\n *\n * @private\n * @param {google.maps.MapCanvasProjection} projection The projection object for\n * the current maps view.\n * @return {Object} The dimensions, containing x and y coordinates of the upper\n * left point as well as width and height of the rectangular world map.\n */\nDayNightOverlay.prototype.getWorldDimensions_ = function(projection) {\n // AQUI\n return {\n x: 0,\n y: 0,\n width: projection.width,\n height: projection.height,\n }\n // var north = projection.fromLatLngToDivPixel(DayNightOverlay.NORTH_);\n // var south = projection.fromLatLngToDivPixel(DayNightOverlay.SOUTH_);\n // var width = projection.getWorldWidth();\n\n // return {\n // x: north.x - width / 2,\n // y: north.y,\n // width: width,\n // height: south.y - north.y\n // };\n};\n\n\n/**\n * Returns the coordinates of the currently visible viewport plus a specifiable\n * margin around it.\n *\n * @private\n * @param {google.maps.MapCanvasProjection} projection The projection object for\n * the current maps view.\n * @param {number} margin The number of pixels by which the dimensions of the\n * current viewport shall be increased.\n * @return {Object} The dimensions, containing x and y coordinates of the upper\n * left point as well as width and height of the rectangular viewport.\n */\nDayNightOverlay.prototype.getVisibleDimensions_ = function(projection, margin) {\n // var ne = projection.fromLatLngToDivPixel(\n // this.getMap().getBounds().getNorthEast()\n // );\n // var sw = projection.fromLatLngToDivPixel(\n // this.getMap().getBounds().getSouthWest()\n // );\n\n // AQUI\n return {\n x: 0,\n y: 0,\n width: projection.width,\n height: projection.height,\n }\n\n\n // return {\n // x: sw.x - margin,\n // y: ne.y - margin,\n // width: ne.x - sw.x + 2 * margin,\n // height: sw.y - ne.y + 2 * margin\n // };\n};\n\n\n/**\n * Generates a function which in turn calculates the day/night terminator curve\n * based on the current viewport. The generated function awaits an x-coordinate\n * in the scope of the current viewport (i.e. from 0 to viewport.width) and\n * returns the corresponding y-coordinate of the curve (limited to the bounds\n * of the current viewport).\n *\n * If you don't like mathematics, feel free to skip this code ;-) It's roughly\n * based on http://www.geoastro.de/map/index.html\n *\n * This version uses a lot of variables to make the calculation a bit more\n * understandable. You might want to inline them in a minified version.\n *\n * @private\n * @param {Object} viewport The dimensions of the currently visible viewport.\n * @param {Object} world The dimensions of the world as it's seen in every\n * atlas (i.e. the rectangular area from (90°N,180°W) to (90°S,180°E)).\n * @return {function(number): number} A function which calculates the day/night\n * terminator curve.\n */\nDayNightOverlay.prototype.createTerminatorFunc_ = function(viewport, world) {\n\n var date = this.date_ ? this.date_ : new Date();\n console.log({ date })\n\n // Precalculate some constants to make the actual terminator function faster\n\n var TWO_PI = 2 * Math.PI;\n\n var WORLD_WIDTH = world.width;\n var WORLD_HEIGHT = world.height;\n var HALF_WORLD_HEIGHT = world.height / 2;\n\n var VISIBLE_WIDTH = viewport.width;\n var VISIBLE_HEIGHT = viewport.height;\n\n var WORLD_OFFSET_X = viewport.x - world.x;\n var WORLD_OFFSET_Y = viewport.y - world.y;\n\n\n // Scaling factors\n\n // Used for scaling the x-coordinate in the scope of the world with\n // onto the range of [0, 2*PI)\n var X_SCALE = TWO_PI / WORLD_WIDTH;\n\n // Used for scaling the output of the crazy function below ([-PI/2, PI/2]) to\n // the range of the world's height ([-world.height/2, world.height/2])\n var Y_SCALE = WORLD_HEIGHT / Math.PI;\n\n\n // Offset calculation\n\n // The current (or specified) UTC time in seconds.\n var TIME_SECS = date.getUTCHours() * 3600 +\n date.getUTCMinutes() * 60 +\n date.getUTCSeconds();\n\n // Since the world's borders are at longitude +-180 degrees but we are\n // are comparing to UTC time (which takes place at longitude 0 degrees),\n // we have to shift the time by exactly 12 hours using NOON_SECS.\n var NOON_SECS = 86400 / 2;\n\n // We calculate the horizontal offset on the basis of seconds. Therefore we\n // divide the maximum offset (2 * PI) by the amount of seconds in a day.\n var PI_STEP = TWO_PI / 86400;\n\n // Now let's add everything together... the offset is now in the\n // range of [0, 2*PI)\n var TIME_OFFSET_X = (TIME_SECS + NOON_SECS) * PI_STEP;\n\n // And now the vertical offset... throughout the year, the sun's position\n // varies between +-23.44 degrees around the equatorial line (it's exactly\n // over the equator on the vernal and autumnal equinox, 23.44° north at the\n // summer solstice and 23.44° south at the winter solstice). Between those\n // dates, the sun moves on a sine wave.\n\n // The first thing we do is calculating the sun's position by using the\n // vernal equinox as a reference point.\n var DAY_OF_YEAR = this.getDayOfYear_(date);\n var VERNAL_EQUINOX = this.getDayOfYear_(\n new Date(Date.UTC(date.getFullYear(), 2, 20))\n );\n\n var MAX_DECLINATION = 23.44 * Math.PI / 90;\n var DECLINATION = Math.sin(TWO_PI * (DAY_OF_YEAR - VERNAL_EQUINOX) / 365) *\n MAX_DECLINATION;\n\n // The returned method first translates the viewport x to world x,\n // calculates the world y and translates it back to the viewport y\n return function(x) {\n // x in range [0, visible_width]\n\n // World x in the range [0, 2PI) (\"longitude\")\n var worldX = (x + WORLD_OFFSET_X) * X_SCALE + TIME_OFFSET_X;\n\n // World y in the range [-PI/2, PI/2] (\"latitude\")\n // This is the main function for calculating the terminator line!!\n var worldY = Math.atan(-Math.cos(worldX) / Math.tan(DECLINATION));\n\n // Translate to range [0, world_height]\n worldY = HALF_WORLD_HEIGHT + worldY * Y_SCALE;\n\n // Crop to visible range\n return Math.min(VISIBLE_HEIGHT, Math.max(0, worldY - WORLD_OFFSET_Y));\n };\n};\n\n\n/**\n * Returns true if sun is currently north of the equatorial line. That's\n * basically always between the vernal and autumnal equinax (i.e. Mar - Sep)\n *\n * @private\n * @param {Date} date The date for which the sun's position shall be determined.\n * @return {boolean} true if the sun is north of the equatorial line, false\n * otherwise.\n */\nDayNightOverlay.prototype.isNorthernSun_ = function(date) {\n var vernalEq = new Date(Date.UTC(date.getFullYear(), 2, 19));\n var autumnalEq = new Date(Date.UTC(date.getFullYear(), 8, 18));\n // var autumnalEq = new Date(Date.UTC(date.getFullYear(), 8, 23));\n\n return (date.getTime() > vernalEq.getTime()) &&\n (date.getTime() <= autumnalEq.getTime());\n};\n\n\n/**\n * Calculates the day of year based on the given date. Method: the timestamp\n * of the given date is substracted by the timestamp of the first day of the\n * respective year. The resulting time difference is then divided by the number\n * of milliseconds per day, which results in the day of the year.\n *\n * @private\n * @param {Date} date A date for which the day of year shall be calculated.\n * @return {number} The date's day of year.\n */\nDayNightOverlay.prototype.getDayOfYear_ = function(date) {\n // Yes, the month has to be zero thanks to JavaScript's great Date class.....\n var firstDay = new Date(Date.UTC(date.getFullYear(), 0, 1));\n\n return Math.ceil((date.getTime() - firstDay.getTime()) / 86400000);\n};\n\nif (window && window.document) {\n window.DayNightOverlay = DayNightOverlay\n}\n\nexport default {}\n\n```" } ]
code_lomadee_a7bf3b16
[ { "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 lomadee/docs/README.md from the lomadee VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n# Lomadee\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors)\n\nVTEX Lomadee first-party app\n\n## How to install\n\nOpen the VTEX App Store and install this app on your store.\n\nNow, open the app settings on your admin and fill in the Lomadee options.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore -->\n<table>\n <tr>\n <td align=\"center\"><a href=\"https://github.com/juliomoreira\"><img src=\"https://avatars2.githubusercontent.com/u/1207017?v=4\" width=\"100px;\" alt=\"Julio Moreira\"/><br /><sub><b>Julio Moreira</b></sub></a><br /><a href=\"https://github.com/vtex-apps/lomadee/commits?author=juliomoreira\" title=\"Code\">💻</a></td>\n </tr>\n</table>\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n```" } ]
code_lomadee_8e8f890c
[ { "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 lomadee/react/index.tsx from the lomadee VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport { getProductPrice, getProductAvable } from \"./helpers/index\";\nimport { PixelMessage } from \"./typings/events\";\nimport { canUseDOM } from \"vtex.render-runtime\";\n\nfunction purchaseInjection(advertiserId: string, lomadeeEventId: string, transactionId: string, transactionTotalWithoutFreight: string) {\n const img = document.createElement(\"img\");\n const url = `https://secure.lomadee.com/at/actionlog?adv=${advertiserId}&country=BR&transaction=${transactionId}&event1=${lomadeeEventId}&value1=${transactionTotalWithoutFreight}`;\n img.setAttribute(\"id\", \"lomadee-pixel\");\n img.setAttribute(\"src\", url);\n document.body.appendChild(img);\n}\n\nfunction handleMessages(e: PixelMessage) {\n let lomadee_datalayer: any;\n\n switch (e.data.eventName) {\n case \"vtex:pageInfo\": {\n lomadee_datalayer = {\n page: \"home\"\n };\n break;\n }\n\n case \"vtex:orderPlaced\": {\n lomadee_datalayer = {\n page: \"conversion\",\n conversion: {\n transactionId: e.data.transactionId,\n amount: e.data.transactionSubtotal,\n currency: \"BRL\",\n paymentType: e.data.transactionPaymentType[0].paymentSystemName,\n items: e.data.transactionProducts\n }\n };\n\n purchaseInjection(window.advertiserId, window.lomadeeEventId, e.data.transactionId, e.data.transactionSubtotal);\n break;\n }\n\n case \"vtex:productView\": {\n const {\n product: { productId, productName }\n } = e.data;\n lomadee_datalayer = {\n page: \"product\",\n product: {\n sku: productId,\n name: productName,\n price: getProductPrice(e.data.product),\n available: getProductAvable(e.data.product)\n }\n };\n break;\n }\n\n case \"vtex:addToCart\": {\n lomadee_datalayer = {\n page: \"cart\",\n cart: {\n skus: e.data.items[0].skuId\n }\n };\n\n break;\n }\n\n case \"vtex:internalSiteSearchView\": {\n const category = e.data.products[0].categories[0].split(\"/\");\n lomadee_datalayer = {\n page: \"search\",\n keyword: category[2]\n };\n break;\n }\n\n case \"vtex:categoryView\": {\n const category = e.data.products[0].categories[0].split(\"/\");\n lomadee_datalayer = {\n page: \"category\",\n category: {\n name: category[2]\n }\n };\n break;\n }\n\n default: {\n lomadee_datalayer = {\n page: \"visit\"\n };\n break;\n }\n }\n}\n\nif (canUseDOM) {\n window.addEventListener(\"message\", handleMessages);\n}\n\n```" } ]
code_lomadee_7f6fdb8a
[ { "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 lomadee/react/package.json from the lomadee VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"name\": \"vtex.lomadee-pixel\",\n \"version\": \"0.0.0\",\n \"scripts\": {\n \"lint\": \"tsc --noEmit --pretty && tslint -c tslint.json './**/*.ts'\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^12.7.1\",\n \"tslint\": \"^5.11.0\",\n \"tslint-config-vtex\": \"^2.0.0\",\n \"tslint-eslint-rules\": \"^5.4.0\",\n \"typescript\": \"3.5.2\"\n }\n}\n\n```" } ]
code_lomadee_ffaa6af5
[ { "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 lomadee/store/interfaces.json from the lomadee VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"pixel.lomadee\": {\n \"component\": \"index\"\n }\n}\n\n```" } ]
code_lomadee_3b46d846
[ { "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 lomadee/react/typings/events.d.ts from the lomadee VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nexport interface PixelMessage extends MessageEvent {\n data:\n | ProductViewData\n | ProductClickData\n | OrderPlacedData\n | PageViewData\n | ProductImpressionData\n | AddToCartData\n | RemoveToCartData\n | CategoryViewData\n | DepartmentViewData\n | PageInfoData\n | internalSiteSearchView;\n}\n\nexport interface EventData {\n event: string;\n eventName: string;\n currency: string;\n}\n\nexport interface PageViewData extends EventData {\n event: \"pageView\";\n eventName: \"vtex:pageView\";\n pageTitle: string;\n pageUrl: string;\n referrer: string;\n}\n\nexport interface PageInfoData extends EventData {\n event: \"pageInfo\";\n eventName: \"vtex:pageInfo\";\n eventType: string;\n accountName: string;\n pageCategory: string;\n pageDepartment: string;\n pageFacets: string[];\n pageTitle: string;\n pageUrl: string;\n}\n\nexport interface CategoryViewData extends EventData {\n event: \"categoryView\";\n eventName: \"vtex:categoryView\";\n products: Product[];\n}\n\nexport interface DepartmentViewData extends EventData {\n event: \"departmentView\";\n eventName: \"vtex:departmentView\";\n products: Product[];\n}\n\nexport interface AddToCartData extends EventData {\n event: \"addToCart\";\n eventName: \"vtex:addToCart\";\n items: AddToCartProduct[];\n}\n\nexport interface RemoveToCartData extends EventData {\n event: \"removeFromCart\";\n eventName: \"vtex:removeFromCart\";\n items: any[];\n}\n\nexport interface OrderPlacedData extends Order, EventData {\n event: \"orderPlaced\";\n eventName: \"vtex:orderPlaced\";\n}\n\nexport interface ProductViewData extends EventData {\n event: \"productView\";\n eventName: \"vtex:productView\";\n product: Product;\n}\n\nexport interface InternalSiteSearchView extends EventData {\n event: \"internalSiteSearchView\";\n eventName: \"vtex:internalSiteSearchView\";\n products: Product[];\n}\n\nexport interface ProductClickData extends EventData {\n event: \"productClick\";\n eventName: \"vtex:productClick\";\n product: Product;\n}\n\nexport interface ProductImpressionData extends EventData {\n event: \"productImpression\";\n eventName: \"vtex:productImpression\";\n product: Product;\n position: number;\n list: string;\n}\n\nexport interface Order {\n currency: string;\n accountName: string;\n orderGroup: string;\n salesChannel: string;\n coupon: string;\n visitorType: string;\n visitorContactInfo: string[];\n transactionId: string;\n transactionDate: string;\n transactionAffiliation: string;\n transactionTotal: number;\n transactionShipping: number;\n transactionTax: number;\n transactionCurrency: string;\n transactionPaymentType: PaymentType[];\n transactionShippingMethod: ShippingMethod[];\n transactionProducts: ProductOrder[];\n transactionPayment: {\n id: string;\n };\n}\n\ninterface PaymentType {\n group: string;\n paymentSystemName: string;\n installments: number;\n value: number;\n}\n\ninterface ShippingMethod {\n itemId: string;\n selectedSla: string;\n}\n\ninterface ProductOrder {\n id: string;\n name: string;\n sku: string;\n skuRefId: string;\n skuName: string;\n brand: string;\n brandId: string;\n seller: string;\n sellerId: string;\n category: string;\n categoryId: string;\n categoryTree: string[];\n categoryIdTree: string[];\n originalPrice: number;\n price: number;\n sellingPrice: number;\n tax: number;\n quantity: number;\n components: any[];\n measurementUnit: string;\n unitMultiplier: number;\n}\n\nexport interface Product {\n brand: string;\n categoryId?: string; // inconsistency\n categories: string[];\n productId: string;\n productName: string;\n selectedSku?: string; // inconsistency\n items: Item[];\n sku: Item;\n [key: string]: any;\n}\n\ninterface Item {\n itemId: string;\n name: string;\n seller?: Seller;\n [key: string]: any;\n}\n\ninterface Seller {\n commertialOffer: CommertialOffer;\n AvailableQuantity: number;\n [key: string]: any;\n}\n\ninterface CommertialOffer {\n Price: number;\n [key: string]: any;\n}\n\ninterface AddToCartProduct {\n brand: string;\n name: string;\n price: number;\n quantity: number;\n skuId: string;\n variant: string;\n}\n\n```" } ]
code_lomadee_19cc4d09
[ { "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 lomadee/react/typings/vtex.render-runtime.d.ts from the lomadee VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module \"vtex.render-runtime\" {\n export const canUseDOM: boolean;\n}\n\n```" } ]
code_lomadee_6d617398
[ { "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 lomadee/react/typings/global.d.ts from the lomadee VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ninterface Window extends Window {\n advertiserId: string;\n lomadeeEventId: string;\n}\n\n```" } ]
code_lomadee_dd5dd271
[ { "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 lomadee/react/helpers/index.ts from the lomadee VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { Product } from \"../typings/events\";\n\nexport function getProductPrice(product: Product) {\n let price;\n try {\n price = product.items[0].sellers[0].commertialOffer.Price;\n } catch {\n price = undefined;\n }\n return price;\n}\n\nexport function getProductAvable(product: Product) {\n let quantity;\n try {\n quantity = product.items[0].sellers[0].commertialOffer.AvailableQuantity;\n } catch {\n quantity = undefined;\n }\n return quantity;\n}\n\n```" } ]
code_black-friday-timer_f5ebe218
[ { "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 black-friday-timer/messages/pt.json from the black-friday-timer VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"editor.base-store-component.title\": \"IO Base App\",\n \"editor.base-store-component.description\": \"Um componente de demonstração para apps do VTEX IO\",\n \"editor.base-store-component.title.title\": \"Título\",\n \"editor.base-store-component.title.description\": \"Especifique um título personalizado\",\n \"base.title\": \"Olá, Mundo!!\",\n \"base.change-value\": \"Troque seu valor: {value}\",\n \"example\": \"Isto é um exemplo\"\n}\n```" } ]
code_black-friday-timer_f2d1fbf9
[ { "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 black-friday-timer/messages/en.json from the black-friday-timer VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"editor.base-store-component.title\": \"IO Base App\",\n \"editor.base-store-component.description\": \"A demo component for IO apps\",\n \"editor.base-store-component.title.title\": \"Title\",\n \"editor.base-store-component.title.description\": \"Specify a custom title\",\n \"base.title\": \"Hello, World!!\",\n \"base.change-value\": \"Change your value: {value}\",\n \"example\": \"This is an example\"\n}\n```" } ]
code_black-friday-timer_c26bddd7
[ { "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 black-friday-timer/messages/context.json from the black-friday-timer VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"editor.base-store-component.title\": \"Title of IO Base App component\",\n \"editor.base-store-component.description\": \"Description of IO Base App component\",\n \"editor.base-store-component.title.title\": \"Title of title property\",\n \"editor.base-store-component.title.description\": \"Description of title property\",\n \"base.title\": \"Base title message to be shown when title is not provided via CMS\",\n \"base.change-value\": \"Text to be shown beside input component typed value\"\n}\n```" } ]
code_black-friday-timer_b5dd020a
[ { "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 black-friday-timer/messages/es.json from the black-friday-timer VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"editor.base-store-component.title\": \"IO Base App\",\n \"editor.base-store-component.description\": \"Un componente de demostración para aplicaciones IO.\",\n \"editor.base-store-component.title.title\": \"Título\",\n \"editor.base-store-component.title.description\": \"Especifique un título personalizado\",\n \"base.title\": \"¡Hola Mundo!\",\n \"base.change-value\": \"Cambia tu valor: {value}\",\n \"example\": \"Esto es un ejemplo\"\n}\n```" } ]
code_black-friday-timer_beea7b85
[ { "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 black-friday-timer/pages/pages.json from the black-friday-timer VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"pages\": {\n \"black-friday-timer\": {\n \"path\": \"/black-friday-timer\",\n \"extensible\": true\n }\n },\n \"extensions\": {\n \"black-friday-timer\": {\n \"component\": \"index\"\n }\n }\n}\n\n```" } ]
code_black-friday-timer_1cfc1995
[ { "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 black-friday-timer/react/index.tsx from the black-friday-timer VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React, { Fragment } from 'react'\nimport Timer from 'react-compound-timer'\nimport styles from './styles.css'\nimport Circles from './components/Circles'\nimport Logos from './components/Logos'\n\nconst BlackFridayTimer: StorefrontFunctionComponent = () => {\n if (typeof document === 'undefined' || typeof document === 'undefined') {\n return null\n }\n\n const blackFridayDate = new Date('11/29/2019')\n\n const today = new Date()\n\n const timeLeft = blackFridayDate.getTime() - today.getTime()\n\n const formatValue = (value: any) => {\n if (value < 10) {\n return `0${value}`\n }\n return `${value}`\n }\n\n return (\n <Fragment>\n <div className={`${styles.container2} flex flex-column pv6 ph4`}>\n <Circles />\n </div>\n <div className={`${styles.container} flex flex-column pv6 ph4`}>\n <Timer\n initialTime={timeLeft}\n direction=\"backward\"\n >\n {() => (\n <React.Fragment>\n <p className={styles.days}>Faltam <Timer.Days /> dias para a Black Friday.</p>\n </React.Fragment>\n )}\n </Timer>\n <Timer\n initialTime={timeLeft}\n direction=\"backward\"\n lastUnit=\"h\"\n >\n {() => (\n <React.Fragment>\n <div className={styles.timer}>\n <Timer.Hours />:<Timer.Minutes formatValue={formatValue} />:<Timer.Seconds formatValue={formatValue} />\n </div>\n </React.Fragment>\n )}\n </Timer>\n <Logos />\n </div>\n </Fragment>\n\n )\n}\n\nexport default BlackFridayTimer\n\n```" } ]
code_black-friday-timer_2d38eb52
[ { "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 black-friday-timer/react/styles.css from the black-friday-timer VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.container,\n.container2 {\n display: flex;\n position: fixed;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n height: 100vh;\n width: 100vw;\n color: white;\n padding: 0;\n margin: 0;\n overflow: hidden;\n}\n\n.container2 {\n background: #142032;\n top: -30vh;\n height: 160vh;\n}\n\n.days {\n z-index: 1;\n font-size: 1.5em;\n}\n\n.timer {\n z-index: 1;\n font-size: 5em;\n font-feature-settings: 'tnum';\n}\n\n.logos {\n margin-top: 6em;\n}\n\n@media (min-width: 992px) {\n .days {\n font-size: 2em;\n }\n\n .timer {\n font-size: 10em;\n }\n}\n\n@media (min-width: 1500px) {\n .days {\n font-size: 3em;\n }\n\n .timer {\n font-size: 16em;\n }\n}\n\n```" } ]
code_black-friday-timer_4bbb6763
[ { "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 black-friday-timer/react/package.json from the black-friday-timer 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-compound-timer\": \"^1.1.15\",\n \"react-dom\": \"^16.8.3\",\n \"react-intl\": \"^2.7.2\"\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 \"apollo-client\": \"^2.5.1\",\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.5.2\"\n }\n}\n\n```" } ]
code_black-friday-timer_f9c8493d
[ { "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 black-friday-timer/react/typings/storefront.d.ts from the black-friday-timer VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { 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_black-friday-timer_b1a07969
[ { "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 black-friday-timer/react/typings/vtex.render-runtime.d.ts from the black-friday-timer VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\n/* Typings for `render-runtime` */\ndeclare module 'vtex.render-runtime' {\n import { Component, ComponentType, ReactElement, ReactType } 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\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_black-friday-timer_1cce221d
[ { "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 black-friday-timer/react/typings/css.d.ts from the black-friday-timer 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_black-friday-timer_05dc295c
[ { "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 black-friday-timer/react/typings/graphql.d.ts from the black-friday-timer VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module '*.graphql' {\n import { DocumentNode } from 'graphql'\n\n const value: DocumentNode\n export default value\n}\n\n```" } ]
code_black-friday-timer_a650680c
[ { "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 black-friday-timer/react/typings/vtex.styleguide.d.ts from the black-friday-timer VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module 'vtex.styleguide' {\n import { ComponentType } from 'react'\n\n export const Input: ComponentType<InputProps>\n\n interface InputProps {\n [key: string]: any\n }\n}\n\n```" } ]
code_black-friday-timer_86f26feb
[ { "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 black-friday-timer/react/components/Circles.tsx from the black-friday-timer VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\n\nimport styles from '../styles.css'\n\nconst Circles: StorefrontFunctionComponent = () => {\n return (\n <svg className={styles.circles} version=\"1.1\" id=\"Camada_1\" xmlns=\"http://www.w3.org/2000/svg\" x=\"0\" y=\"0\" viewBox=\"0 0 1800 1778.6\" >\n <path fill=\"#f42165\" d=\"M899.6 1487.1c-39.5 0-79-4-117.9-11.9-71.5-14.5-139.1-41.9-201-81.3l2.7-4.2c61.4 39.2 128.5 66.3 199.4 80.7 68.4 13.9 138.2 15.5 207.6 4.8 82.3-12.7 159.4-41.8 229.2-86.6 72.2-46.3 132.4-106.8 178.8-179.8 42.8-67.4 71.1-141 84.2-218.9 12.7-75.3 10.6-151.4-6-226.3l4.9-1.1c16.8 75.5 18.9 152.2 6.1 228.2-13.2 78.5-41.8 152.8-84.9 220.7-46.8 73.6-107.5 134.6-180.4 181.3-70.4 45.2-148.2 74.6-231.2 87.4-30.5 4.7-61.1 7-91.5 7zM331.5 1068.9c-52.2-167.8-28-348.8 66.3-496.5 38.2-60.1 86.2-112.3 142.5-155 54.4-41.2 115.1-72.6 180.6-93.3 168-53 349.8-29.1 498.8 65.5l-2.7 4.2c-147.7-93.8-328-117.4-494.6-64.9-64.9 20.5-125.1 51.7-179.1 92.5-55.9 42.3-103.4 94-141.3 153.7-93.5 146.5-117.5 326-65.8 492.4l-4.7 1.4z\" /><path fill=\"#f42165\" d=\"M899.6 1635.7c-41.1 0-82.2-3.4-123.1-10.3-98.1-16.5-190.8-52.2-275.7-106-91.9-58.5-168.1-134.3-226.5-225.3-28-43.6-51.5-90.4-69.8-139.1-18.2-48.3-31.4-98.6-39.3-149.6-13.5-87.3-11.5-175.3 6-261.4 18.1-89.3 52.3-173.8 101.6-251.1l4.2 2.7c-49 76.8-82.9 160.7-100.9 249.4-17.4 85.6-19.4 173-6 259.7 7.8 50.7 20.9 100.7 39 148.6 18.2 48.3 41.5 94.8 69.3 138.1 58 90.4 133.6 165.6 224.9 223.7 84.3 53.5 176.4 88.9 273.8 105.3 94.2 15.8 189.5 13.3 283.1-7.6l1.1 4.9c-53.4 12-107.6 18-161.7 18zM1527.3 1291l-4.2-2.7c117.3-184.8 146.9-410.3 81.2-618.8-25.7-81.2-64.6-156.6-115.8-224-53-69.9-117.6-129.4-192.2-176.8-183.3-117-407.8-147-616-82.3l-1.5-4.8c209.5-65.2 435.6-35 620.2 82.8 75.1 47.8 140.2 107.6 193.5 178 51.5 67.9 90.7 143.8 116.5 225.5 66.2 210 36.4 437.1-81.7 623.1z\" /><path fill=\"#f42165\" d=\"M29.4 1085.4c-25.2-113-28.3-228-9.1-341.8C40 626 82.8 514.7 147.4 413c35.2-55.3 76.4-106.7 122.4-152.7 44.8-44.7 94.5-84.7 147.8-118.9 52.3-33.6 108.4-61.7 166.8-83.7C642.2 35.8 702.6 20 763.8 10.5 868.5-5.6 974-3.2 1077.4 17.8c107.1 21.7 208.4 62.7 301.1 121.8l-2.7 4.2c-92.2-58.8-193-99.6-299.5-121.2C973.6 1.8 868.7-.6 764.6 15.5c-60.8 9.4-120.9 25.2-178.5 46.9-58 21.9-113.8 49.9-165.8 83.3-53 34-102.4 73.8-146.9 118.2-45.7 45.7-86.7 96.8-121.7 151.8C87.4 516.9 44.9 627.5 25.2 744.5c-19 113.1-16 227.5 9.1 339.9l-4.9 1zM899.8 1783.6c-167.5 0-333.5-47.3-478.6-139.5l2.7-4.2c144.3 91.6 309.4 138.7 475.9 138.7 89.5 0 179.5-13.6 267-41.2 97.5-30.9 188-77.6 269-139 83.9-63.6 155.3-141.2 212.3-230.8 35.8-56.2 65.3-116.1 87.6-178.3 21.6-60.4 36.7-123.4 44.6-187.2 7.8-62.6 8.9-126.3 3.2-189.3-5.6-62.6-18-124.7-36.6-184.7l4.8-1.5c18.8 60.3 31.2 122.8 36.8 185.8 5.7 63.4 4.6 127.5-3.2 190.4-8 64.1-23.1 127.5-44.9 188.3-22.4 62.5-52 122.8-88.1 179.3-57.3 90.1-129.1 168.2-213.5 232.1-81.4 61.7-172.4 108.7-270.5 139.8-87.9 27.6-178.4 41.3-268.5 41.3z\" />\n </svg>\n )\n}\n\nexport default Circles\n\n```" } ]
code_black-friday-timer_3d271508
[ { "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 black-friday-timer/react/components/Logos.tsx from the black-friday-timer VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\n\nimport styles from '../styles.css'\n\nconst Logos: StorefrontFunctionComponent = () => {\n return (\n <div className={styles.logos}>\n <svg width=\"370\" height=\"30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><g clipPath=\"url(#clip0)\" fill=\"#F8F7FC\"><path d=\"M32.929.3H6.286C4.341.3 2.994 2.394 3.892 4.19l2.694 4.94h-4.79C.748 9.13 0 9.878 0 10.776c0 .3 0 .598.15.748L8.68 27.241c.45.898 1.497 1.198 2.395.748.3-.15.599-.448.748-.748l2.395-4.19 2.844 5.388a2.695 2.695 0 004.79 0L35.173 4.19C36.223 2.395 34.876.299 32.93.299zM20.955 10.626l-5.688 10.477c-.3.6-1.048.749-1.646.45-.15-.15-.45-.3-.45-.45L7.484 10.777c-.3-.599-.15-1.198.449-1.497.15-.15.3-.15.599-.15h11.525c.598 0 1.197.45 1.197 1.048-.15.15-.15.3-.3.449zM61.218 11.525h-2.844v9.58c0 .149-.15.299-.3.299H55.83c-.15 0-.3-.15-.3-.3v-9.579h-2.993c-.15 0-.299-.15-.299-.3V9.58c0-.15.15-.3.3-.3h8.83c.15 0 .3.15.3.3v1.647c-.15.15-.3.3-.45.3zM70.498 21.553c-.6.15-1.647.15-3.443.15-2.245 0-4.19-.599-4.19-3.592v-5.538c0-2.994 1.945-3.592 4.19-3.592 1.796 0 2.844.15 3.443.15.299 0 .299.149.299.299v1.496c0 .15-.15.3-.3.3h-3.592c-.748 0-1.047.3-1.047 1.197v1.497h4.49c.15 0 .3.15.3.3v1.646c0 .15-.15.3-.3.3h-4.49v1.795c0 .898.299 1.198 1.047 1.198h3.593c.15 0 .299.15.299.299v1.497c.15.449 0 .449-.3.598zM83.52 21.553h-2.695c-.15 0-.3 0-.449-.299l-2.395-3.592-2.095 3.592c-.15.15-.3.3-.45.3h-2.544c-.15 0-.299-.15-.299-.15v-.15l3.742-5.987-3.742-5.688v-.15c0-.15.15-.15.3-.15h2.694c.15 0 .299.15.449.3l2.245 3.293 2.095-3.293c.15-.15.3-.3.45-.3h2.544c.15 0 .3.15.3.15v.15l-3.743 5.688 3.892 5.987v.15c-.15.15-.15.15-.3.15zM48.046 9.28c-.15 0-.3.15-.3.15l-2.544 8.83c0 .15-.15.3-.3.3-.149 0-.149 0-.298-.3l-2.545-8.98c0-.15-.15-.15-.3-.15h-2.394c-.15 0-.3.15-.3.3 0 0 2.994 10.178 3.144 10.327.449 1.198 1.347 1.796 2.694 1.796 1.197 0 2.245-.598 2.694-1.796 0-.15 2.994-10.327 2.994-10.327 0-.15 0-.3-.15-.3l-2.395.15z\" /><path d=\"M32.929.3H6.286C4.341.3 2.994 2.394 3.892 4.19l2.694 4.94h-4.79C.748 9.13 0 9.878 0 10.776c0 .3 0 .598.15.748L8.68 27.241c.45.898 1.497 1.198 2.395.748.3-.15.599-.448.748-.748l2.395-4.19 2.844 5.388a2.695 2.695 0 004.79 0L35.173 4.19C36.223 2.395 34.876.299 32.93.299zM20.955 10.626l-5.688 10.477c-.3.6-1.048.749-1.646.45-.15-.15-.45-.3-.45-.45L7.484 10.777c-.3-.599-.15-1.198.449-1.497.15-.15.3-.15.599-.15h11.525c.598 0 1.197.45 1.197 1.048-.15.15-.15.3-.3.449zM114.652.748h6.137c4.191 0 6.436 2.395 6.436 6.436v.6c0 3.89-1.646 5.388-3.293 5.986 2.096.599 4.191 2.545 4.191 6.586v.599c0 4.939-2.544 7.933-7.484 7.933h-5.987V.747zm5.538 11.974c3.443 0 4.64-1.496 4.64-4.939v-.449c0-2.844-1.347-4.64-4.49-4.64h-3.443v10.178h3.293v-.15zm-3.293 14.37h3.443c3.592 0 5.239-2.096 5.239-5.988v-.748c0-3.742-1.946-5.538-5.539-5.538h-3.143v12.273zM131.715.748h2.395v26.194h9.43l-.449 2.095h-11.376V.748zM149.976 19.159l-2.096 9.729h-2.395l6.287-28.29h3.143l6.586 28.29h-2.545l-2.095-9.73h-6.885zm6.585-2.096c-1.646-7.334-2.694-12.124-2.993-14.369h-.15c-.299 2.245-1.496 8.083-2.844 14.37h5.987zM177.816 21.254v.3c-.15 2.544-.899 7.783-6.886 7.783-6.585 0-7.034-6.586-7.034-12.124v-5.389C163.896 5.09 165.991.3 171.23.3c5.987 0 6.436 5.239 6.436 7.484v.3h-2.395v-.3c0-1.497-.299-5.388-4.041-5.388-4.191 0-4.79 5.089-4.79 9.43v5.388c0 5.238.749 10.028 4.79 10.028 3.592 0 4.191-3.592 4.34-5.688v-.299h2.246zM181.707.748h2.395v14.37c1.946-2.845 6.436-10.029 9.28-14.37h2.694l-7.633 11.526 8.082 16.763h-2.694l-6.885-14.668-2.694 4.041v10.627h-2.395V.748h-.15zM212.091 20.506c-1.347 5.837-2.843 8.83-9.13 8.83-1.646 0-3.293-.15-4.34-.448l1.047-4.94c.749.15 1.347.15 2.096.15 2.095 0 2.544-.748 3.143-3.293l4.49-20.356h7.035l-4.341 20.057zM241.278 13.47c-1.047 8.682-4.939 16.016-14.069 16.016-7.634 0-10.627-4.79-9.58-13.47C218.528 7.782 222.569 0 231.549 0c7.334 0 10.777 4.49 9.729 13.47zm-16.614 2.994c-.748 5.24.15 7.784 2.994 7.784 4.041 0 5.687-5.688 6.436-11.376.748-5.089.15-7.633-2.994-7.633-4.041 0-5.837 5.687-6.436 11.225zM255.498.449l-4.191 19.009c-.599 2.395-.3 4.79 2.843 4.79 2.994 0 3.892-2.246 4.341-4.79L262.682.449h7.035l-4.191 18.86c-1.347 5.986-3.742 10.177-12.124 10.177-8.082 0-10.477-4.19-9.13-10.477l4.191-18.56h7.035zM277.799 17.362l-2.544 11.526h-6.885L274.656.448h10.178c6.436 0 9.13 3.443 8.681 7.933-.449 3.742-2.694 5.837-5.388 6.735 2.096 1.048 2.844 3.293 1.946 7.334-.749 3.293-.898 5.24-1.048 6.586h-6.735c0-1.047.299-3.293 1.047-6.885.749-3.143.3-4.79-2.694-4.79h-2.844zm1.048-4.939h2.844c2.844 0 4.341-1.048 4.64-3.592.299-2.395-1.048-3.443-3.143-3.443h-2.844l-1.497 7.035zM293.366 29.037L299.652.6h8.083c.748 5.687 3.143 18.11 3.293 18.859h.149c.449-3.443 1.497-8.083 2.395-12.573L314.919.6h6.286l-6.286 28.438h-7.933c-.598-5.837-3.143-19.308-3.293-20.056h.15c-.599 3.592-1.497 8.531-2.694 13.47l-1.497 6.586h-6.286zM340.214 16.913h-10.627l-1.496 6.736h12.423l-1.946 5.238h-18.261L326.594.45h17.811l-1.197 5.388h-10.926l-1.198 5.688h10.627l-1.497 5.388zM348.447 29.037l2.245-10.328c0-.299.149-.748 0-1.197L346.501.45h7.184c.599 3.742 1.647 9.58 1.946 12.124 1.946-3.443 4.939-8.382 7.185-12.124h7.483l-12.123 17.512c-.15.3-.3.599-.449 1.048l-2.246 9.878h-7.034v.15z\" /></g><defs><clipPath id=\"clip0\"><path fill=\"#fff\" d=\"M0 0h370v29.786H0z\" /></clipPath></defs></svg>\n </div>\n )\n}\n\nexport default Logos\n\n```" } ]
code_black-friday-timer_dde87b8c
[ { "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 black-friday-timer/react/__tests__/index.test.tsx from the black-friday-timer VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { render } from '@vtex/test-tools/react'\nimport Component from '../components/index'\n\ndescribe('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```" } ]