@meeovi/layer-commerce 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. package/app/components/catalog/product/ProductAccordion/types.ts +3 -3
  2. package/app/components/catalog/product/ProductProperties/types.ts +3 -3
  3. package/app/components/catalog/product/ProductSlider/types.ts +5 -5
  4. package/app/components/catalog/product/RecommendedProducts/types.ts +3 -3
  5. package/app/components/catalog/product/bestsellers.vue +8 -20
  6. package/app/components/catalog/product/deals.vue +7 -22
  7. package/app/components/catalog/product/exclusives.vue +8 -10
  8. package/app/components/catalog/product/featuredproducts.vue +8 -20
  9. package/app/components/catalog/product/latestproducts.vue +8 -20
  10. package/app/components/catalog/product/productCard.vue +55 -21
  11. package/app/components/catalog/product/productDetails.vue +20 -14
  12. package/app/components/catalog/product/relatedproducts.vue +5 -20
  13. package/app/components/catalog/product/sizeOptions.vue +3 -8
  14. package/app/components/catalog/shops/relatedstores.vue +6 -21
  15. package/app/components/categories/chart/[id].vue +200 -0
  16. package/app/components/categories/chart/add-chart.vue +142 -0
  17. package/app/components/categories/chart/chart.vue +82 -0
  18. package/app/components/categories/chart/monthlyChart.vue +46 -0
  19. package/app/components/categories/chart/weeklyChart.vue +46 -0
  20. package/app/components/categories/chart/yearlyChart.vue +46 -0
  21. package/app/components/categories/charts.vue +118 -0
  22. package/app/components/categories/deals.vue +101 -0
  23. package/app/components/categories/eats.vue +49 -0
  24. package/app/components/categories/restaurants.vue +26 -0
  25. package/app/components/categories/station/[id].vue +72 -0
  26. package/app/components/categories/stations.vue +124 -0
  27. package/app/components/categories/time/time.vue +63 -0
  28. package/app/components/categories/travel.vue +75 -0
  29. package/app/components/categories/weather/weather.vue +44 -0
  30. package/app/components/content/pages/showcases.vue +1 -1
  31. package/app/components/marketing/promotions/giftcards.vue +20 -45
  32. package/app/components/marketing/promotions/subscriptions.vue +8 -21
  33. package/app/components/placeholders/Comments.vue +15 -0
  34. package/app/components/placeholders/CreateListBtn.vue +7 -0
  35. package/app/components/placeholders/Event.vue +9 -0
  36. package/app/components/placeholders/ListShowcases.vue +9 -0
  37. package/app/components/placeholders/Short.vue +9 -0
  38. package/app/components/placeholders/Space.vue +9 -0
  39. package/app/components/placeholders/Tag.vue +7 -0
  40. package/app/components/sales/CheckoutAddress/types.ts +12 -11
  41. package/app/components/sales/OrderSummary/types.ts +3 -3
  42. package/app/components/sales/incentives.vue +13 -37
  43. package/app/composables/_types.ts +6 -5
  44. package/app/composables/cart/registry.ts +7 -0
  45. package/app/composables/index.ts +1 -0
  46. package/app/composables/products/registry.ts +7 -0
  47. package/app/composables/registry.ts +21 -0
  48. package/app/composables/stores/cart.ts +2 -2
  49. package/app/composables/useCatalog.ts +64 -0
  50. package/app/composables/useContent.ts +57 -0
  51. package/app/composables/useProductReviews/useProductReviews.ts +1 -1
  52. package/app/composables/useProducts/types.ts +15 -10
  53. package/app/modules/vue-head/composables/useHead.ts +3 -0
  54. package/app/pages/brand/[...slug].vue +1 -1
  55. package/app/pages/departments/[...slug].vue +385 -0
  56. package/app/pages/departments/category/[...slug].vue +135 -0
  57. package/app/pages/product/[...id].vue +3 -3
  58. package/app/pages/shop/[...slug].vue +12 -18
  59. package/app/pages/shops.vue +18 -25
  60. package/dist/components/catalog/product/ProductAccordion/types.d.ts +4 -0
  61. package/dist/components/catalog/product/ProductAccordion/types.js +1 -0
  62. package/dist/components/catalog/product/ProductProperties/types.d.ts +4 -0
  63. package/dist/components/catalog/product/ProductProperties/types.js +1 -0
  64. package/dist/components/catalog/product/ProductSlider/types.d.ts +6 -0
  65. package/dist/components/catalog/product/ProductSlider/types.js +1 -0
  66. package/dist/components/catalog/product/RecommendedProducts/types.d.ts +4 -0
  67. package/dist/components/catalog/product/RecommendedProducts/types.js +1 -0
  68. package/dist/components/sales/CheckoutAddress/types.d.ts +14 -0
  69. package/dist/components/sales/CheckoutAddress/types.js +1 -0
  70. package/dist/components/sales/CheckoutPayment/types.d.ts +10 -0
  71. package/dist/components/sales/CheckoutPayment/types.js +7 -0
  72. package/dist/components/sales/OrderSummary/types.d.ts +4 -0
  73. package/dist/components/sales/OrderSummary/types.js +1 -0
  74. package/dist/composables/_types.d.ts +11 -0
  75. package/dist/composables/_types.js +1 -0
  76. package/dist/composables/adapters/abstract/cartAdapter.d.ts +0 -0
  77. package/dist/composables/adapters/abstract/cartAdapter.js +0 -0
  78. package/dist/composables/adapters/abstract/categoryAdapter.d.ts +0 -0
  79. package/dist/composables/adapters/abstract/categoryAdapter.js +0 -0
  80. package/dist/composables/adapters/abstract/customerAdapter.d.ts +0 -0
  81. package/dist/composables/adapters/abstract/customerAdapter.js +0 -0
  82. package/dist/composables/adapters/abstract/inventoryAdapter.d.ts +0 -0
  83. package/dist/composables/adapters/abstract/inventoryAdapter.js +0 -0
  84. package/dist/composables/adapters/abstract/orderAdapter.d.ts +0 -0
  85. package/dist/composables/adapters/abstract/orderAdapter.js +0 -0
  86. package/dist/composables/adapters/abstract/productAdapter.d.ts +6 -0
  87. package/dist/composables/adapters/abstract/productAdapter.js +1 -0
  88. package/dist/composables/cart/registry.d.ts +4 -0
  89. package/dist/composables/cart/registry.js +16 -0
  90. package/dist/composables/cart/types.d.ts +16 -0
  91. package/dist/composables/cart/types.js +1 -0
  92. package/dist/composables/cart/useCart.d.ts +6 -0
  93. package/dist/composables/cart/useCart.js +13 -0
  94. package/dist/composables/config.d.ts +7 -0
  95. package/dist/composables/config.js +11 -0
  96. package/dist/composables/defs/apiDefinitions.d.ts +7 -0
  97. package/dist/composables/defs/apiDefinitions.js +39 -0
  98. package/dist/composables/defs/extension.d.ts +91 -0
  99. package/dist/composables/defs/extension.js +154 -0
  100. package/dist/composables/defs/extension.mocks.d.ts +30 -0
  101. package/dist/composables/defs/extension.mocks.js +23 -0
  102. package/dist/composables/defs/extension.test.d.ts +1 -0
  103. package/dist/composables/defs/extension.test.js +233 -0
  104. package/dist/composables/defs/index.d.ts +3 -0
  105. package/dist/composables/defs/index.js +3 -0
  106. package/dist/composables/defs/types.d.ts +81 -0
  107. package/dist/composables/defs/types.js +1 -0
  108. package/dist/composables/domain/cart.d.ts +0 -0
  109. package/dist/composables/domain/cart.js +0 -0
  110. package/dist/composables/domain/category.d.ts +0 -0
  111. package/dist/composables/domain/category.js +0 -0
  112. package/dist/composables/domain/order.d.ts +0 -0
  113. package/dist/composables/domain/order.js +0 -0
  114. package/dist/composables/domain/price.d.ts +0 -0
  115. package/dist/composables/domain/price.js +0 -0
  116. package/dist/composables/domain/product.d.ts +8 -0
  117. package/dist/composables/domain/product.js +1 -0
  118. package/dist/composables/domain/reward.d.ts +0 -0
  119. package/dist/composables/domain/reward.js +0 -0
  120. package/dist/composables/domain/transactions.d.ts +0 -0
  121. package/dist/composables/domain/transactions.js +0 -0
  122. package/dist/composables/helpers/contextualizedNormalizers.d.ts +5 -0
  123. package/dist/composables/helpers/contextualizedNormalizers.js +6 -0
  124. package/dist/composables/helpers/contextualizedNormalizers.test.d.ts +1 -0
  125. package/dist/composables/helpers/contextualizedNormalizers.test.js +62 -0
  126. package/dist/composables/helpers/index.d.ts +1 -0
  127. package/dist/composables/helpers/index.js +1 -0
  128. package/dist/composables/index.d.ts +6 -0
  129. package/dist/composables/index.js +6 -0
  130. package/dist/composables/methods/auth.d.ts +62 -0
  131. package/dist/composables/methods/auth.js +1 -0
  132. package/dist/composables/methods/cart.d.ts +101 -0
  133. package/dist/composables/methods/cart.js +1 -0
  134. package/dist/composables/methods/category.d.ts +22 -0
  135. package/dist/composables/methods/category.js +1 -0
  136. package/dist/composables/methods/checkout.d.ts +42 -0
  137. package/dist/composables/methods/checkout.js +1 -0
  138. package/dist/composables/methods/customer.d.ts +39 -0
  139. package/dist/composables/methods/customer.js +1 -0
  140. package/dist/composables/methods/helpers.d.ts +2 -0
  141. package/dist/composables/methods/helpers.js +3 -0
  142. package/dist/composables/methods/index.d.ts +49 -0
  143. package/dist/composables/methods/index.js +9 -0
  144. package/dist/composables/methods/order.d.ts +29 -0
  145. package/dist/composables/methods/order.js +1 -0
  146. package/dist/composables/methods/product.d.ts +71 -0
  147. package/dist/composables/methods/product.js +1 -0
  148. package/dist/composables/methods/settings.d.ts +12 -0
  149. package/dist/composables/methods/settings.js +1 -0
  150. package/dist/composables/models/cart.d.ts +84 -0
  151. package/dist/composables/models/cart.js +1 -0
  152. package/dist/composables/models/category.d.ts +12 -0
  153. package/dist/composables/models/category.js +1 -0
  154. package/dist/composables/models/checkout.d.ts +15 -0
  155. package/dist/composables/models/checkout.js +1 -0
  156. package/dist/composables/models/customer.d.ts +14 -0
  157. package/dist/composables/models/customer.js +1 -0
  158. package/dist/composables/models/facets.d.ts +21 -0
  159. package/dist/composables/models/facets.js +5 -0
  160. package/dist/composables/models/index.d.ts +62 -0
  161. package/dist/composables/models/index.js +8 -0
  162. package/dist/composables/models/order.d.ts +39 -0
  163. package/dist/composables/models/order.js +1 -0
  164. package/dist/composables/models/product.d.ts +55 -0
  165. package/dist/composables/models/product.js +1 -0
  166. package/dist/composables/models/shared.d.ts +66 -0
  167. package/dist/composables/models/shared.js +1 -0
  168. package/dist/composables/products/registry.d.ts +4 -0
  169. package/dist/composables/products/registry.js +16 -0
  170. package/dist/composables/products/types.d.ts +12 -0
  171. package/dist/composables/products/types.js +1 -0
  172. package/dist/composables/products/useEvents.d.ts +0 -0
  173. package/dist/composables/products/useEvents.js +0 -0
  174. package/dist/composables/products/useGiftCards.d.ts +0 -0
  175. package/dist/composables/products/useGiftCards.js +0 -0
  176. package/dist/composables/products/useProducts.d.ts +4 -0
  177. package/dist/composables/products/useProducts.js +10 -0
  178. package/dist/composables/products/useSubscriptions.d.ts +0 -0
  179. package/dist/composables/products/useSubscriptions.js +0 -0
  180. package/dist/composables/registry.d.ts +9 -0
  181. package/dist/composables/registry.js +13 -0
  182. package/dist/composables/stores/cart.d.ts +1 -0
  183. package/dist/composables/stores/cart.js +203 -0
  184. package/dist/composables/stores/cartStore.d.ts +1 -0
  185. package/dist/composables/stores/cartStore.js +246 -0
  186. package/dist/composables/stores/checkout.d.ts +1 -0
  187. package/dist/composables/stores/checkout.js +17 -0
  188. package/dist/composables/stores/compare.d.ts +1 -0
  189. package/dist/composables/stores/compare.js +50 -0
  190. package/dist/composables/stores/orders.d.ts +1 -0
  191. package/dist/composables/stores/orders.js +156 -0
  192. package/dist/composables/stores/product.d.ts +1 -0
  193. package/dist/composables/stores/product.js +26 -0
  194. package/dist/composables/stores/productList.d.ts +0 -0
  195. package/dist/composables/stores/productList.js +0 -0
  196. package/dist/composables/stores/productListInfo.d.ts +0 -0
  197. package/dist/composables/stores/productListInfo.js +0 -0
  198. package/dist/composables/stores/products.d.ts +1 -0
  199. package/dist/composables/stores/products.js +106 -0
  200. package/dist/composables/stores/recentlyViewedProducts.d.ts +0 -0
  201. package/dist/composables/stores/recentlyViewedProducts.js +0 -0
  202. package/dist/composables/stores/review.d.ts +1 -0
  203. package/dist/composables/stores/review.js +25 -0
  204. package/dist/composables/stores/storeInPickUp.d.ts +1 -0
  205. package/dist/composables/stores/storeInPickUp.js +21 -0
  206. package/dist/composables/stores/user.d.ts +1 -0
  207. package/dist/composables/stores/user.js +16 -0
  208. package/dist/composables/stores/wishlist.d.ts +1 -0
  209. package/dist/composables/stores/wishlist.js +17 -0
  210. package/dist/composables/types/Order.type.d.ts +141 -0
  211. package/dist/composables/types/Order.type.js +1 -0
  212. package/dist/composables/types/index.d.ts +265 -0
  213. package/dist/composables/types/index.js +3 -0
  214. package/dist/composables/types/product.d.ts +13 -0
  215. package/dist/composables/types/product.js +1 -0
  216. package/dist/composables/useBreakpoints/index.d.ts +1 -0
  217. package/dist/composables/useBreakpoints/index.js +1 -0
  218. package/dist/composables/useBreakpoints/useBreakpoints.d.ts +10 -0
  219. package/dist/composables/useBreakpoints/useBreakpoints.js +24 -0
  220. package/dist/composables/useCart/index.d.ts +1 -0
  221. package/dist/composables/useCart/index.js +1 -0
  222. package/dist/composables/useCart/types.d.ts +13 -0
  223. package/dist/composables/useCart/types.js +1 -0
  224. package/dist/composables/useCart/useCart.d.ts +8 -0
  225. package/dist/composables/useCart/useCart.js +43 -0
  226. package/dist/composables/useCartShippingMethods/index.d.ts +1 -0
  227. package/dist/composables/useCartShippingMethods/index.js +1 -0
  228. package/dist/composables/useCartShippingMethods/types.d.ts +13 -0
  229. package/dist/composables/useCartShippingMethods/types.js +1 -0
  230. package/dist/composables/useCartShippingMethods/useCartShippingMethods.d.ts +7 -0
  231. package/dist/composables/useCartShippingMethods/useCartShippingMethods.js +35 -0
  232. package/dist/composables/useCatalog.d.ts +13 -0
  233. package/dist/composables/useCatalog.js +61 -0
  234. package/dist/composables/useContent/index.d.ts +1 -0
  235. package/dist/composables/useContent/index.js +1 -0
  236. package/dist/composables/useContent/types.d.ts +32 -0
  237. package/dist/composables/useContent/types.js +1 -0
  238. package/dist/composables/useContent/useContent.d.ts +9 -0
  239. package/dist/composables/useContent/useContent.js +43 -0
  240. package/dist/composables/useContent.d.ts +14 -0
  241. package/dist/composables/useContent.js +55 -0
  242. package/dist/composables/useCustomer/index.d.ts +2 -0
  243. package/dist/composables/useCustomer/index.js +2 -0
  244. package/dist/composables/useCustomer/types.d.ts +13 -0
  245. package/dist/composables/useCustomer/types.js +1 -0
  246. package/dist/composables/useCustomer/useCustomer.d.ts +8 -0
  247. package/dist/composables/useCustomer/useCustomer.js +34 -0
  248. package/dist/composables/useCustomerAddress/index.d.ts +2 -0
  249. package/dist/composables/useCustomerAddress/index.js +2 -0
  250. package/dist/composables/useCustomerAddress/types.d.ts +13 -0
  251. package/dist/composables/useCustomerAddress/types.js +1 -0
  252. package/dist/composables/useCustomerAddress/useCustomerAddress.d.ts +8 -0
  253. package/dist/composables/useCustomerAddress/useCustomerAddress.js +43 -0
  254. package/dist/composables/useCustomerOrder/adress.d.ts +11 -0
  255. package/dist/composables/useCustomerOrder/adress.js +10 -0
  256. package/dist/composables/useCustomerOrder/index.d.ts +2 -0
  257. package/dist/composables/useCustomerOrder/index.js +2 -0
  258. package/dist/composables/useCustomerOrder/product.d.ts +28 -0
  259. package/dist/composables/useCustomerOrder/product.js +37 -0
  260. package/dist/composables/useCustomerOrder/types.d.ts +32 -0
  261. package/dist/composables/useCustomerOrder/types.js +1 -0
  262. package/dist/composables/useCustomerOrder/useCustomerOrder.d.ts +8 -0
  263. package/dist/composables/useCustomerOrder/useCustomerOrder.js +52 -0
  264. package/dist/composables/useCustomerOrders/index.d.ts +2 -0
  265. package/dist/composables/useCustomerOrders/index.js +2 -0
  266. package/dist/composables/useCustomerOrders/types.d.ts +15 -0
  267. package/dist/composables/useCustomerOrders/types.js +1 -0
  268. package/dist/composables/useCustomerOrders/useCustomerOrders.d.ts +8 -0
  269. package/dist/composables/useCustomerOrders/useCustomerOrders.js +42 -0
  270. package/dist/composables/useCustomerReturns/index.d.ts +2 -0
  271. package/dist/composables/useCustomerReturns/index.js +2 -0
  272. package/dist/composables/useCustomerReturns/types.d.ts +13 -0
  273. package/dist/composables/useCustomerReturns/types.js +1 -0
  274. package/dist/composables/useCustomerReturns/useCustomerReturns.d.ts +8 -0
  275. package/dist/composables/useCustomerReturns/useCustomerReturns.js +32 -0
  276. package/dist/composables/useHandleError/index.d.ts +1 -0
  277. package/dist/composables/useHandleError/index.js +1 -0
  278. package/dist/composables/useHandleError/types.d.ts +7 -0
  279. package/dist/composables/useHandleError/types.js +1 -0
  280. package/dist/composables/useHandleError/useHandleError.d.ts +10 -0
  281. package/dist/composables/useHandleError/useHandleError.js +24 -0
  282. package/dist/composables/usePageTitle.d.ts +5 -0
  283. package/dist/composables/usePageTitle.js +14 -0
  284. package/dist/composables/useProduct/index.d.ts +2 -0
  285. package/dist/composables/useProduct/index.js +2 -0
  286. package/dist/composables/useProduct/types.d.ts +13 -0
  287. package/dist/composables/useProduct/types.js +1 -0
  288. package/dist/composables/useProduct/useProduct.d.ts +9 -0
  289. package/dist/composables/useProduct/useProduct.js +36 -0
  290. package/dist/composables/useProductAttribute/index.d.ts +1 -0
  291. package/dist/composables/useProductAttribute/index.js +1 -0
  292. package/dist/composables/useProductAttribute/useProductAttribute.d.ts +11 -0
  293. package/dist/composables/useProductAttribute/useProductAttribute.js +25 -0
  294. package/dist/composables/useProductRecommended/index.d.ts +1 -0
  295. package/dist/composables/useProductRecommended/index.js +1 -0
  296. package/dist/composables/useProductRecommended/types.d.ts +13 -0
  297. package/dist/composables/useProductRecommended/types.js +1 -0
  298. package/dist/composables/useProductRecommended/useProductRecommended.d.ts +6 -0
  299. package/dist/composables/useProductRecommended/useProductRecommended.js +33 -0
  300. package/dist/composables/useProductReviews/index.d.ts +2 -0
  301. package/dist/composables/useProductReviews/index.js +2 -0
  302. package/dist/composables/useProductReviews/types.d.ts +13 -0
  303. package/dist/composables/useProductReviews/types.js +1 -0
  304. package/dist/composables/useProductReviews/useProductReviews.d.ts +9 -0
  305. package/dist/composables/useProductReviews/useProductReviews.js +36 -0
  306. package/dist/composables/useProducts/types.d.ts +18 -0
  307. package/dist/composables/useProducts/types.js +1 -0
  308. package/dist/composables/useProducts/useProducts.d.ts +8 -0
  309. package/dist/composables/useProducts/useProducts.js +35 -0
  310. package/dist/composables/utils/countryList.d.ts +5 -0
  311. package/dist/composables/utils/countryList.js +14 -0
  312. package/dist/composables/utils/glossary.d.ts +0 -0
  313. package/dist/composables/utils/glossary.js +0 -0
  314. package/dist/composables/utils/importExport.d.ts +0 -0
  315. package/dist/composables/utils/importExport.js +0 -0
  316. package/dist/composables/utils/print.d.ts +0 -0
  317. package/dist/composables/utils/print.js +0 -0
  318. package/dist/composables/utils/shopThemes.d.ts +0 -0
  319. package/dist/composables/utils/shopThemes.js +0 -0
  320. package/dist/composables/utils/statistics.d.ts +0 -0
  321. package/dist/composables/utils/statistics.js +0 -0
  322. package/dist/composables/utils/stock.d.ts +0 -0
  323. package/dist/composables/utils/stock.js +0 -0
  324. package/dist/composables/utils/stripe.d.ts +7 -0
  325. package/dist/composables/utils/stripe.js +14 -0
  326. package/dist/composables/utils/taxation.d.ts +0 -0
  327. package/dist/composables/utils/taxation.js +0 -0
  328. package/dist/composables/utils/tellFriends.d.ts +0 -0
  329. package/dist/composables/utils/tellFriends.js +0 -0
  330. package/dist/composables/validationRules/index.d.ts +1 -0
  331. package/dist/composables/validationRules/index.js +1 -0
  332. package/dist/composables/validationRules/password.d.ts +1 -0
  333. package/dist/composables/validationRules/password.js +20 -0
  334. package/dist/composables/validationRules/password.test.d.ts +1 -0
  335. package/dist/composables/validationRules/password.test.js +68 -0
  336. package/dist/composables/vendors/index.d.ts +0 -0
  337. package/dist/composables/vendors/index.js +0 -0
  338. package/dist/composables/vendors/registry.d.ts +0 -0
  339. package/dist/composables/vendors/registry.js +0 -0
  340. package/dist/composables/vendors/useAffiliates.d.ts +0 -0
  341. package/dist/composables/vendors/useAffiliates.js +0 -0
  342. package/dist/composables/vendors/useCommission.d.ts +0 -0
  343. package/dist/composables/vendors/useCommission.js +0 -0
  344. package/dist/modules/vue-head/composables/useHead.d.ts +1 -0
  345. package/dist/modules/vue-head/composables/useHead.js +3 -0
  346. package/dist/utils/client.d.ts +6 -0
  347. package/dist/utils/client.js +23 -0
  348. package/dist/utils/index.d.ts +15 -0
  349. package/dist/utils/index.js +38 -0
  350. package/dist/utils/normalizer.d.ts +12 -0
  351. package/dist/utils/normalizer.js +13 -0
  352. package/dist/utils/normalizers/magento.d.ts +3 -0
  353. package/dist/utils/normalizers/magento.js +23 -0
  354. package/dist/utils/normalizers/shopify.d.ts +3 -0
  355. package/dist/utils/normalizers/shopify.js +24 -0
  356. package/global.d.ts +149 -0
  357. package/package.json +2 -1
  358. package/tsconfig.json +19 -3
@@ -1,5 +1,5 @@
1
- import type { SfProduct } from '@vue-storefront/unified-data-model';
1
+ import type { Product } from '../../../../composables/_types'
2
2
 
3
3
  export type ProductAccordionPropsType = {
4
- product: SfProduct;
5
- };
4
+ product: Product
5
+ }
@@ -1,5 +1,5 @@
1
- import type { SfProduct } from '@vue-storefront/unified-data-model';
1
+ import type { Product } from '../../../../composables/_types'
2
2
 
3
3
  export type ProductPropertiesProps = {
4
- product: SfProduct;
5
- };
4
+ product: Product
5
+ }
@@ -1,7 +1,7 @@
1
- import type { HTMLAttributes } from 'vue';
2
- import type { SfProduct } from '@vue-storefront/unified-data-model';
1
+ import type { HTMLAttributes } from 'vue'
2
+ import type { Product } from '../../../../composables/_types'
3
3
 
4
4
  export type ProductSliderProps = {
5
- items?: SfProduct[];
6
- wrapperClass?: HTMLAttributes['class'];
7
- };
5
+ items?: Product[]
6
+ wrapperClass?: HTMLAttributes['class']
7
+ }
@@ -1,5 +1,5 @@
1
- import { SfProduct } from '@vue-storefront/unified-data-model';
1
+ import type { Product } from '../../../../composables/_types'
2
2
 
3
3
  export type RecommendedProductsProps = {
4
- products: SfProduct[];
5
- };
4
+ products: Product[]
5
+ }
@@ -31,39 +31,27 @@
31
31
  import productCard from './productCard.vue'
32
32
 
33
33
  const model = ref(null);
34
- const {
35
- $directus,
36
- $readItems
37
- } = useNuxtApp()
34
+ import { useCatalogFallback } from '../../../composables/useCatalog'
35
+ const catalog = useCatalogFallback()
38
36
 
39
37
  const {
40
38
  data: bestsellers
41
- } = await useAsyncData('bestsellers', () => {
42
- return $directus.request($readItems('products', {
43
- fields: ['*',
44
- 'products.products_id.*',
45
- 'products.products_id.image.*',
46
- 'currency.currency_id.*',
47
- 'brands.brands_id.*',
48
- 'image.*',
49
- ],
39
+ } = await useAsyncData('bestsellers', async () => {
40
+ return await catalog.listProducts({
41
+ fields: ['*', 'products.products_id.*', 'products.products_id.image.*', 'currency.currency_id.*', 'brands.brands_id.*', 'image.*'],
50
42
  limit: 10,
51
43
  filter: {
52
44
  lists: {
53
45
  lists_id: {
54
46
  lists_types: {
55
47
  lists_types_id: {
56
- name: {
57
- _eq: "Best Sellers"
58
- }
48
+ name: { _eq: 'Best Sellers' }
59
49
  }
60
50
  }
61
51
  }
62
52
  },
63
- status: {
64
- _eq: "published"
65
- }
53
+ status: { _eq: 'published' }
66
54
  }
67
- }))
55
+ })
68
56
  })
69
57
  </script>
@@ -29,33 +29,18 @@
29
29
 
30
30
  <script setup>
31
31
  import productCard from './productCard.vue'
32
+ import { useCatalogFallback } from '../../../composables/useCatalog'
32
33
 
33
34
  const model = ref(null)
34
- const {
35
- $directus,
36
- $readItems
37
- } = useNuxtApp()
35
+ const catalog = useCatalogFallback()
38
36
 
39
37
  const {
40
38
  data: deals
41
- } = await useAsyncData('deals', () => {
42
- return $directus.request($readItems('products', {
43
- fields: ['*',
44
- 'products.products_id.*',
45
- 'products.products_id.image.*',
46
- 'currency.currency_id.*',
47
- 'brands.brands_id.*',
48
- 'image.*',
49
- ],
39
+ } = await useAsyncData('deals', async () => {
40
+ return await catalog.listProducts({
41
+ fields: ['*', 'products.products_id.*', 'products.products_id.image.*', 'currency.currency_id.*', 'brands.brands_id.*', 'image.*'],
50
42
  limit: 10,
51
- filter: {
52
- price: {
53
- _lte: "20.00"
54
- },
55
- status: {
56
- _eq: "published"
57
- }
58
- }
59
- }))
43
+ filter: { price: { _lte: '20.00' }, status: { _eq: 'published' } }
44
+ })
60
45
  })
61
46
  </script>
@@ -31,21 +31,19 @@
31
31
  import productCard from './productCard.vue'
32
32
 
33
33
  const model = ref(null);
34
- const { $directus, $readItems, $commerce } = useNuxtApp()
34
+ const { $commerce } = useNuxtApp()
35
+ import { useCatalogFallback } from '../../../composables/useCatalog'
36
+ const catalog = useCatalogFallback()
35
37
 
36
38
  const { data: exclusives } = await useAsyncData('exclusives', async () => {
37
- const refs = await $directus.request($readItems('products', {
39
+ // ask the adapter for products first; composable will fallback to Directus
40
+ const refs = await catalog.listProducts({
38
41
  fields: ['id', 'sku'],
39
42
  limit: 10,
40
- filter: {
41
- status: { _eq: 'published' },
42
- departments: {
43
- departments_id: { name: { _eq: 'Exclusives' } }
44
- }
45
- }
46
- }))
43
+ filter: { status: { _eq: 'published' }, departments: { departments_id: { name: { _eq: 'Exclusives' } } } }
44
+ })
47
45
 
48
- const products = await Promise.all(refs.map(async (r) => {
46
+ const products = await Promise.all(refs.map(async (r: any) => {
49
47
  try {
50
48
  return await $commerce.getProduct(String(r.sku || r.id))
51
49
  } catch (e) {
@@ -31,39 +31,27 @@
31
31
  import productCard from './productCard.vue'
32
32
 
33
33
  const model = ref(null);
34
- const {
35
- $directus,
36
- $readItems
37
- } = useNuxtApp()
34
+ import { useCatalogFallback } from '../../../composables/useCatalog'
35
+ const catalog = useCatalogFallback()
38
36
 
39
37
  const {
40
38
  data: featured
41
- } = await useAsyncData('featured', () => {
42
- return $directus.request($readItems('products', {
43
- fields: ['*',
44
- 'products.products_id.*',
45
- 'products.products_id.image.*',
46
- 'currency.currency_id.*',
47
- 'brands.brands_id.*',
48
- 'image.*',
49
- ],
39
+ } = await useAsyncData('featured', async () => {
40
+ return await catalog.listProducts({
41
+ fields: ['*', 'products.products_id.*', 'products.products_id.image.*', 'currency.currency_id.*', 'brands.brands_id.*', 'image.*'],
50
42
  limit: 10,
51
43
  filter: {
52
44
  lists: {
53
45
  lists_id: {
54
46
  lists_types: {
55
47
  lists_types_id: {
56
- name: {
57
- _eq: "Featured"
58
- }
48
+ name: { _eq: 'Featured' }
59
49
  }
60
50
  }
61
51
  }
62
52
  },
63
- status: {
64
- _eq: "published"
65
- }
53
+ status: { _eq: 'published' }
66
54
  }
67
- }))
55
+ })
68
56
  })
69
57
  </script>
@@ -30,29 +30,17 @@
30
30
  import productCard from './productCard.vue'
31
31
 
32
32
  const model = ref(null);
33
- const {
34
- $directus,
35
- $readItems
36
- } = useNuxtApp()
33
+ import { useCatalogFallback } from '../../../composables/useCatalog'
34
+ const catalog = useCatalogFallback()
37
35
 
38
36
  const {
39
37
  data: latest
40
- } = await useAsyncData('latest', () => {
41
- return $directus.request($readItems('products', {
42
- fields: ['*',
43
- 'products.products_id.*',
44
- 'products.products_id.image.*',
45
- 'currency.currency_id.*',
46
- 'brands.brands_id.*',
47
- 'image.*',
48
- ],
49
- filter: {
50
- status: {
51
- _eq: 'published'
52
- }
53
- },
38
+ } = await useAsyncData('latest', async () => {
39
+ return await catalog.listProducts({
40
+ fields: ['*', 'products.products_id.*', 'products.products_id.image.*', 'currency.currency_id.*', 'brands.brands_id.*', 'image.*'],
41
+ filter: { status: { _eq: 'published' } },
54
42
  sort: '-products_id.date_created',
55
- limit: 10,
56
- }))
43
+ limit: 10
44
+ })
57
45
  })
58
46
  </script>
@@ -1,9 +1,12 @@
1
1
  <template>
2
2
  <div>
3
3
  <div class="border border-neutral-200 rounded-md hover:shadow-lg max-w-[300px]">
4
- <div class="relative" v-if="product?.image?.length > 0">
5
- <NuxtLink :to="`/product/${product?.id}`" class="block">
6
- <img :src="`${$directus.url}assets/${product?.image?.filename_disk}`" :alt="product?.name"
4
+ <div class="relative" v-if="displayProduct?.image?.length > 0">
5
+ <NuxtLink :to="`/product/${displayProduct?.id}`" class="block">
6
+ <img v-if="$directus && displayProduct?.image?.filename_disk"
7
+ :src="`${$directus.url}assets/${displayProduct?.image?.filename_disk}`" :alt="displayProduct?.name"
8
+ class="block object-cover h-auto rounded-md aspect-square" width="300" height="300" />
9
+ <img v-else-if="displayProduct?.imageUrl" :src="displayProduct?.imageUrl" :alt="displayProduct?.name"
7
10
  class="block object-cover h-auto rounded-md aspect-square" width="300" height="300" />
8
11
  </NuxtLink>
9
12
  <v-btn variant="flat" size="sm" square
@@ -14,8 +17,8 @@
14
17
  </div>
15
18
 
16
19
  <div class="relative" v-else>
17
- <NuxtLink :to="`/product/${product?.id}`" class="block">
18
- <img src="~/assets/images/mbr-1920x1893.png" :alt="product?.name"
20
+ <NuxtLink :to="`/product/${displayProduct?.id}`" class="block">
21
+ <img src="~/assets/images/mbr-1920x1893.png" :alt="displayProduct?.name"
19
22
  class="block object-cover h-auto rounded-md aspect-square" width="300" height="300" />
20
23
  </NuxtLink>
21
24
  <v-btn variant="flat" size="sm" square
@@ -25,26 +28,26 @@
25
28
  </v-btn>
26
29
  </div>
27
30
  <div class="p-4 border-t border-neutral-200" style="background-color: white !important;">
28
- <NuxtLink :to="`/product/${product?.id}`" variant="secondary" class="no-underline"> {{ product?.name }}
31
+ <NuxtLink :to="`/product/${displayProduct?.id}`" variant="secondary" class="no-underline"> {{ displayProduct?.name }}
29
32
  </NuxtLink>
30
33
  <div class="flex items-center pt-1">
31
- <v-rating size="xs" active-color="warning" :model-value="product?.rating" :max="5" />
34
+ <v-rating size="xs" active-color="warning" :model-value="displayProduct?.rating" :max="5" />
32
35
 
33
- <NuxtLink :to="`/product/${product?.id}`" variant="secondary" class="pl-1 no-underline">
34
- <v-chip size="xs">{{ product?.rating }}</v-chip>
36
+ <NuxtLink :to="`/product/${displayProduct?.id}`" variant="secondary" class="pl-1 no-underline">
37
+ <v-chip size="xs">{{ displayProduct?.rating }}</v-chip>
35
38
  </NuxtLink>
36
39
  </div>
37
40
  <p class="block py-2 font-normal leading-5 typography-text-sm text-neutral-700"
38
- v-if="product?.brands.length > 0">
41
+ v-if="displayProduct?.brands && displayProduct?.brands.length > 0">
39
42
  By:
40
43
  <div style="display: inline-block;" v-for="brands in product?.brands" :key="brands">
41
44
  <NuxtLink :to="`/brand/${brands?.brands_id?.slug}`">{{ brands?.brands_id?.name }}</NuxtLink></div>
42
45
  </p>
43
46
  <span class="block pb-2 font-bold typography-text-lg">
44
- <div style="display: inline-block;" v-for="currency in product?.currency" :key="currency">
47
+ <div style="display: inline-block;" v-for="currency in displayProduct?.currency || []" :key="currency">
45
48
  {{ currency?.currency_id?.symbol }}
46
49
  </div>
47
- {{ product?.price }}
50
+ {{ displayProduct?.price }}
48
51
  </span>
49
52
  <!--<v-btn size="sm">
50
53
  <template #prefix>
@@ -58,14 +61,45 @@
58
61
  </template>
59
62
 
60
63
  <script setup>
61
- const {
62
- $directus
63
- } = useNuxtApp()
64
+ import { ref, onMounted, watch, computed } from 'vue'
65
+ import { useCatalogFallback } from '../../../composables/useCatalog'
66
+
67
+ const props = defineProps({
68
+ product: {
69
+ type: [Object, String],
70
+ required: true,
71
+ },
72
+ });
73
+
74
+ const productData = ref<any>(null)
75
+ const catalog = useCatalogFallback()
76
+
77
+ const displayProduct = computed(() => productData.value || props.product)
78
+
79
+ const resolveId = (p: any) => {
80
+ if (!p) return null
81
+ if (typeof p === 'string') return p
82
+ // directus nested shape product?.products_id or products_id?.id
83
+ return p.id || p.products_id?.id || p.products_id || null
84
+ }
85
+
86
+ async function load() {
87
+ const id = resolveId(props.product)
88
+ if (!id) return
89
+ // prefer adapter if available
90
+ if (catalog.adapter) {
91
+ // adapter may expose getProductById or getProductBySlug
92
+ try {
93
+ const p = await catalog.getProductById(id)
94
+ productData.value = p || (await catalog.getProductBySlug(id))
95
+ } catch (e) {
96
+ productData.value = await catalog.getProductBySlug(id)
97
+ }
98
+ } else {
99
+ productData.value = await catalog.getProductById(id)
100
+ }
101
+ }
64
102
 
65
- const props = defineProps({
66
- product: {
67
- type: Object,
68
- required: true,
69
- },
70
- });
103
+ onMounted(load)
104
+ watch(() => props.product, load)
71
105
  </script>
@@ -3,24 +3,27 @@
3
3
  <div class="container-fluid">
4
4
  <div class="row">
5
5
  <div class="col-12 col-md-6">
6
- <div v-if="product?.image?.filename_disk">
7
- <img :src="`${$directus.url}assets/${product.image.filename_disk}`" :alt="product.name"
6
+ <div v-if="displayProduct?.image?.filename_disk || displayProduct?.imageUrl">
7
+ <img v-if="$directus && displayProduct?.image?.filename_disk"
8
+ :src="`${$directus.url}assets/${displayProduct.image.filename_disk}`" :alt="displayProduct.name"
9
+ class="w-full rounded-md" />
10
+ <img v-else-if="displayProduct?.imageUrl" :src="displayProduct?.imageUrl" :alt="displayProduct?.name"
8
11
  class="w-full rounded-md" />
9
12
  </div>
10
13
  </div>
11
14
  <div class="col-12 col-md-6">
12
15
  <div class="right">
13
- <h1 class="mb-1 font-bold typography-headline-4"><strong>{{ product?.name }}</strong></h1>
16
+ <h1 class="mb-1 font-bold typography-headline-4"><strong>{{ displayProduct?.name }}</strong></h1>
14
17
  <div class="price-line">
15
- <span class="block pb-2 font-bold typography-text-lg">
16
- {{ product?.price }}
18
+ <span class="block pb-2 font-bold typography-text-lg">
19
+ {{ displayProduct?.price }}
17
20
  </span>
18
21
  </div>
19
22
  <p class="productRatings">
20
- <v-rating size="lg" :half-increment="true" :value="product?.ratings?.length || 0"
23
+ <v-rating size="lg" :half-increment="true" :value="displayProduct?.ratings?.length || 0"
21
24
  :max="5" />
22
25
  <NuxtLink to="#" variant="secondary" class="ratingReviews ml-2 text-xs text-neutral-500">
23
- {{ product?.comments?.comments_id?.length || 0 }} reviews
26
+ {{ displayProduct?.comments?.comments_id?.length || 0 }} reviews
24
27
  </NuxtLink>
25
28
  </p>
26
29
  <div class="py-4 mb-4 border-gray-200 border-y">
@@ -39,8 +42,8 @@
39
42
  <SfIconAdd />
40
43
  </v-btn>
41
44
  </div>
42
- <p class="self-center mt-1 mb-4 text-xs text-neutral-500 xs:mb-0">
43
- <strong class="text-neutral-900">{{ product?.stock }}</strong> in stock
45
+ <p class="self-center mt-1 mb-4 text-xs text-neutral-500 xs:mb-0">
46
+ <strong class="text-neutral-900">{{ displayProduct?.stock }}</strong> in stock
44
47
  </p>
45
48
  </div>
46
49
  <div class="col col-6">
@@ -50,10 +53,10 @@
50
53
  </div>
51
54
  <div class="mbr-section-btn row align-items-stretch justify-content-center">
52
55
  <div class="col col-6">
53
- <createListBtn :lists="product?.id" />
56
+ <createListBtn :lists="displayProduct?.id" />
54
57
  </div>
55
58
  </div>
56
- <div class="price-line1" v-for="tag in product?.tags" :key="tag.id">
59
+ <div class="price-line1" v-for="tag in displayProduct?.tags || []" :key="tag.id">
57
60
  <p class="desc mbr-fonts-style display-7"><strong>Tags:</strong> <tagCard :tag="tag?.tag_id" />&nbsp;</p>
58
61
  </div>
59
62
  </div>
@@ -65,7 +68,8 @@
65
68
 
66
69
  <script setup lang="ts">
67
70
  import {
68
- ref
71
+ ref,
72
+ computed
69
73
  } from 'vue';
70
74
  import {
71
75
  SfIconAdd,
@@ -77,9 +81,9 @@
77
81
  import {
78
82
  useCounter
79
83
  } from '@vueuse/core';
80
- import tagCard from '#social/app/components/related/tag.vue';
84
+ import tagCard from '@/components/placeholders/Tag.vue';
81
85
  import addToCartBtn from '../../partials/addToCartBtn.vue';
82
- import createListBtn from '#lists/app/components/partials/createListBtn.vue';
86
+ import createListBtn from '@/components/placeholders/CreateListBtn.vue';
83
87
 
84
88
  const {
85
89
  $directus,
@@ -110,6 +114,8 @@
110
114
  },
111
115
  });
112
116
 
117
+ const displayProduct = computed(() => props.product)
118
+
113
119
  const formatPrice = (amount: number) => {
114
120
  if (!amount) return '$0.00';
115
121
  return new Intl.NumberFormat('en-US', {
@@ -29,30 +29,15 @@
29
29
 
30
30
  <script setup>
31
31
  import productCard from './productCard.vue'
32
+ import { useCatalogFallback } from '../../../composables/useCatalog'
32
33
 
33
34
  const model = ref(null)
34
- const {
35
- $directus,
36
- $readItems
37
- } = useNuxtApp()
35
+ const catalog = useCatalogFallback()
38
36
 
39
37
  const {
40
38
  data: related
41
- } = await useAsyncData('related', () => {
42
- return $directus.request($readItems('products', {
43
- fields: ['*',
44
- 'products.products_id.*',
45
- 'products.products_id.image.*',
46
- 'currency.currency_id.*',
47
- 'brands.brands_id.*',
48
- 'image.*',
49
- ],
50
- limit: 10,
51
- filter: {
52
- status: {
53
- _eq: "published"
54
- }
55
- }
56
- }))
39
+ } = await useAsyncData('related', async () => {
40
+ // delegate to adapter when available, otherwise fallback to Directus via composable
41
+ return await catalog.listProducts({ limit: 10, filter: { status: { _eq: 'published' } } })
57
42
  })
58
43
  </script>
@@ -17,17 +17,12 @@ const sizes = ref([])
17
17
  const selectedSize = ref(null)
18
18
 
19
19
 
20
- const nuxtApp = useNuxtApp()
21
- const { $directus, $readItems } = nuxtApp
20
+ const catalog = useCatalogFallback()
22
21
 
23
22
  const loadSizes = async () => {
24
23
  try {
25
- const res = await $directus.request($readItems('attributes', {
26
- filter: {
27
- attribute_code: { _eq: 'size' }
28
- },
29
- sort: ['id']
30
- }))
24
+ // adapter may expose attributes; composable falls back to Directus
25
+ const res = await catalog.listAttributes({ filter: { attribute_code: { _eq: 'size' } }, sort: ['id'] })
31
26
 
32
27
  const attr = (res && res[0]) || null
33
28
  const opts = attr?.options || []
@@ -24,29 +24,14 @@
24
24
  </template>
25
25
 
26
26
  <script setup>
27
- import {
28
- ref,
29
- onMounted
30
- } from 'vue'
31
- import store from '~/components/catalog/product/stores.vue'
27
+ import { ref } from 'vue'
28
+ import store from './stores.vue'
29
+ import { useContentFallback } from '../../../composables/useContent'
32
30
 
33
31
  const model = ref(null)
34
- const {
35
- $directus,
36
- $readItems,
37
- } = useNuxtApp()
32
+ const content = useContentFallback()
38
33
 
39
- const {
40
- user
41
- } = useSupabaseAuth()
42
-
43
- const {
44
- data: shops
45
- } = await useAsyncData('shops', () => {
46
- return $directus.request($readItems('shops', {
47
- fields: ['*', {
48
- '*': ['*']
49
- }]
50
- }))
34
+ const { data: shops } = await useAsyncData('shops', () => {
35
+ return content.listShops({ fields: ['*', { '*': ['*'] }] })
51
36
  })
52
37
  </script>