@riosst100/pwa-marketplace 2.0.9 → 2.1.0
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.
- package/package.json +1 -1
- package/src/componentOverrideMapping.js +51 -1
- package/src/components/AccountLayout/accountlayout.module.css +13 -0
- package/src/components/AccountLayout/index.js +209 -0
- package/src/components/AlphaFilter/alphaFilter.js +103 -0
- package/src/components/AlphaFilter/alphaFilter.module.css +38 -0
- package/src/components/AlphaFilter/alphaFilter.shimmer.js +50 -0
- package/src/components/AlphaFilter/index.js +2 -0
- package/src/components/ArraySearchInput/arraySearchInput.js +100 -0
- package/src/components/ArraySearchInput/arraySearchInput.module.css +48 -0
- package/src/components/ArraySearchInput/index.js +1 -0
- package/src/components/AttributesBlock/attributesBlock.js +54 -0
- package/src/components/AttributesBlock/attributesBlock.module.css +28 -0
- package/src/components/BecomeSeller/becomeSeller.js +304 -178
- package/src/components/BecomeSeller/becomeSeller.module.css +4 -4
- package/src/components/BecomeSellerLink/becomeSellerLink.js +1 -1
- package/src/components/BecomeSellerLink/becomeSellerLink.module.css +0 -4
- package/src/components/BecomeSellerPage/becomeSellerPage.js +2 -1
- package/src/components/BecomeSellerPage/becomeSellerPage.module.css +2 -10
- package/src/components/BrandLandingPage/brandInfo.js +93 -0
- package/src/components/BrandLandingPage/brandLanding.js +255 -0
- package/src/components/BrandLandingPage/index.js +94 -0
- package/src/components/BrandLandingPage/menu.js +20 -0
- package/src/components/BrandListPage/banner_brands.png +0 -0
- package/src/components/BrandListPage/brandList.js +88 -0
- package/src/components/BrandListPage/index.js +57 -0
- package/src/components/BrandSlider/brandSlider.js +91 -0
- package/src/components/BrandSlider/index.js +1 -0
- package/src/components/BrandSlider/item.js +61 -0
- package/src/components/CollectibleGameSets/collectibleGameSets.js +252 -0
- package/src/components/CollectibleGameSets/collectibleGameSets.module.css +69 -0
- package/src/components/CollectibleGameSets/collectibleGameSets.shimmer.js +50 -0
- package/src/components/CollectibleGameSets/index.js +2 -0
- package/src/components/CollectibleGameSetsPage/collectibleGameSetsPage.js +10 -0
- package/src/components/CollectibleGameSetsPage/index.js +1 -0
- package/src/components/CrossSeller/crossSellerBuy.js +19 -0
- package/src/components/CrossSeller/index.js +15 -0
- package/src/components/CrossSeller/item.js +79 -0
- package/src/components/CrossSeller/logo_seller.png +0 -0
- package/src/components/CrossSeller/starIcon.js +11 -0
- package/src/components/CrossSeller/verifyIcon.js +12 -0
- package/src/components/CurrencySwitcher/currencySwitcher.himmer.js +6 -0
- package/src/components/CurrencySwitcher/currencySwitcher.module.css +102 -0
- package/src/components/CurrencySwitcher/index.js +107 -0
- package/src/components/CurrencySwitcher/switcherItem.js +47 -0
- package/src/components/CurrencySwitcher/switcherItem.module.css +20 -0
- package/src/components/CustomSortBy/customSortBy.js +196 -0
- package/src/components/CustomSortBy/customSortBy.module.css +68 -0
- package/src/components/CustomSortBy/customSortItem.js +57 -0
- package/src/components/CustomSortBy/customSortItem.module.css +23 -0
- package/src/components/CustomSortBy/index.js +1 -0
- package/src/components/CustomSortBy/productSort.module.css +65 -0
- package/src/components/CustomSortBy/productSort.shimmer.js +28 -0
- package/src/components/CustomSortBy/productSort.shimmer.module.css +10 -0
- package/src/components/CustomSubCategory/subCategory.js +36 -0
- package/src/components/CustomSubCategory/subCategory.module.css +22 -0
- package/src/components/CustomSubCategoryPage/subCategoryPage.js +136 -0
- package/src/components/CustomSubCategoryPage/subCategoryPage.module.css +46 -0
- package/src/components/Divider/index.js +11 -0
- package/src/components/Dropdown/dropdown.js +80 -0
- package/src/components/Dropdown/index.js +10 -0
- package/src/components/FavoriteSeller/favoriteSeller.js +32 -0
- package/src/components/FavoriteSeller/index.js +14 -0
- package/src/components/FavoriteSeller/item.js +140 -0
- package/src/components/Filter/index.js +2 -2
- package/src/components/FilterOption/FilterOptionModal.module.css +90 -0
- package/src/components/FilterOption/filterOptionModal.js +48 -0
- package/src/components/FilterOptionModal/filterOptionModal.js +66 -0
- package/src/components/FilterTop/CurrentTopFilters/currentTopFilter.js +47 -0
- package/src/components/FilterTop/CurrentTopFilters/currentTopFilter.module.css +22 -0
- package/src/components/FilterTop/CurrentTopFilters/currentTopFilters.js +50 -0
- package/src/components/FilterTop/CurrentTopFilters/currentTopFilters.module.css +21 -0
- package/src/components/FilterTop/CurrentTopFilters/index.js +1 -0
- package/src/components/FilterTop/CustomFilters/customFilter.js +83 -0
- package/src/components/FilterTop/CustomFilters/customFilter.module.css +22 -0
- package/src/components/FilterTop/CustomFilters/customFilters.js +132 -0
- package/src/components/FilterTop/CustomFilters/customFilters.module.css +23 -0
- package/src/components/FilterTop/CustomFilters/index.js +1 -0
- package/src/components/FilterTop/FilterBlockList/filterBlockList.js +56 -0
- package/src/components/FilterTop/FilterBlockList/filterBlockList.module.css +8 -0
- package/src/components/FilterTop/FilterBlockList/filterTopItem.js +79 -0
- package/src/components/FilterTop/FilterBlockList/filterTopItem.module.css +14 -0
- package/src/components/FilterTop/FilterBlockList/filterTopItemGroup.js +95 -0
- package/src/components/FilterTop/FilterBlockList/filterTopItemGroup.module.css +23 -0
- package/src/components/FilterTop/FilterBlockList/index.js +1 -0
- package/src/components/FilterTop/filterTop.js +176 -0
- package/src/components/FilterTop/filterTop.module.css +23 -0
- package/src/components/FilterTop/filterTop.shimmer.js +24 -0
- package/src/components/FilterTop/filterTopBlock.js +60 -0
- package/src/components/FilterTop/index.js +2 -0
- package/src/components/FilterTopBackup/CustomFilters/customFilter.js +83 -0
- package/src/components/FilterTopBackup/CustomFilters/customFilter.module.css +22 -0
- package/src/components/FilterTopBackup/CustomFilters/customFilters.js +133 -0
- package/src/components/FilterTopBackup/CustomFilters/customFilters.module.css +23 -0
- package/src/components/FilterTopBackup/CustomFilters/index.js +1 -0
- package/src/components/FilterTopBackup/filterTop.js +14 -0
- package/src/components/FilterTopBackup/filterTop.module.css +23 -0
- package/src/components/FilterTopBackup/filterTop.shimmer.js +24 -0
- package/src/components/FilterTopBackup/index.js +2 -0
- package/src/components/Header/becomeSellerLink.module.css +0 -4
- package/src/components/Header/websiteSwitcher.js +0 -1
- package/src/components/Header/websiteSwitcher.module.css +107 -111
- package/src/components/Header/websiteSwitcher.shimmer.js +6 -6
- package/src/components/Header/websiteSwitcherItem.js +47 -47
- package/src/components/Header/websiteSwitcherItem.module.css +20 -20
- package/src/components/LegoSets/index.js +2 -0
- package/src/components/LegoSets/legoSets.js +327 -0
- package/src/components/LegoSets/legoSets.module.css +76 -0
- package/src/components/LegoSets/legoSets.shimmer.js +50 -0
- package/src/components/LiveChat/chatContent.js +39 -0
- package/src/components/LiveChat/index.js +52 -0
- package/src/components/LiveChat/liveChat.js +160 -0
- package/src/components/MegaMenu/customMenuItems.js +138 -0
- package/src/components/MegaMenu/customMenuItems.module.css +31 -0
- package/src/components/MiniatureGameSets/index.js +2 -0
- package/src/components/MiniatureGameSets/miniatureGameSets.js +297 -0
- package/src/components/MiniatureGameSets/miniatureGameSets.module.css +76 -0
- package/src/components/MiniatureGameSets/miniatureGameSets.shimmer.js +50 -0
- package/src/components/Modal/index.js +10 -0
- package/src/components/Modal/modal.js +48 -0
- package/src/components/MtgSinglesPage/index.js +62 -0
- package/src/components/MtgSinglesPage/mtgSingles.js +90 -0
- package/src/components/MtgSinglesPage/singles.module.css +15 -0
- package/src/components/NonSportCardsSets/index.js +2 -0
- package/src/components/NonSportCardsSets/nonSportCardsSets.js +270 -0
- package/src/components/NonSportCardsSets/nonSportCardsSets.module.css +76 -0
- package/src/components/NonSportCardsSets/nonSportCardsSets.shimmer.js +50 -0
- package/src/components/OperatingHours/operatingHours.js +7 -9
- package/src/components/OrderDetail/components/itemsOrdered.js +128 -0
- package/src/components/OrderDetail/components/rmaList.js +114 -0
- package/src/components/OrderDetail/orderDetail.js +204 -0
- package/src/components/OrderDetail/orderDetailPage.js +14 -0
- package/src/components/Pagination/index.js +31 -33
- package/src/components/PhoneTextInput/index.js +1 -1
- package/src/components/PhoneTextInput/phoneTextInput.js +62 -62
- package/src/components/ProductItem/index.js +1 -1
- package/src/components/ProductLabel/index.js +47 -0
- package/src/components/ProductLineSlider/index.js +1 -0
- package/src/components/ProductLineSlider/item.js +38 -0
- package/src/components/ProductLineSlider/logo_nendoroid.png +0 -0
- package/src/components/ProductLineSlider/nendroid-image.png +0 -0
- package/src/components/ProductLineSlider/productLineSlider.js +91 -0
- package/src/components/ProductListTab/index.js +4 -0
- package/src/components/ProductListTab/productListTab.js +100 -0
- package/src/components/ProductListTab/productListTab.module.css +64 -0
- package/src/components/ProductListTab/productListTab.shimmer.js +24 -0
- package/src/components/RFQ/index.js +39 -0
- package/src/components/RFQ/modalRfq.js +249 -0
- package/src/components/RFQPage/index.js +14 -0
- package/src/components/RFQPage/orderRow.js +318 -0
- package/src/components/RFQPage/quoteDetail.js +342 -0
- package/src/components/RFQPage/quoteDetailPage.js +14 -0
- package/src/components/RFQPage/quoteList.js +227 -0
- package/src/components/RMAPage/RMACreate.js +238 -0
- package/src/components/RMAPage/RMACreatePage.js +14 -0
- package/src/components/RMAPage/RMADetail.js +318 -0
- package/src/components/RMAPage/RMADetailPage.js +14 -0
- package/src/components/RMAPage/RMAList.js +241 -0
- package/src/components/RMAPage/RMASelect.js +36 -0
- package/src/components/RMAPage/RMASelectPage.js +13 -0
- package/src/components/RMAPage/components/productItem.js +114 -0
- package/src/components/RMAPage/components/rmaList.js +250 -0
- package/src/components/RMAPage/index.js +14 -0
- package/src/components/RMAPage/orderRow.js +318 -0
- package/src/components/RelatedProduct/index.js +16 -0
- package/src/components/RelatedProduct/relatedProduct.js +112 -0
- package/src/components/RelatedProduct/sample.json +154 -0
- package/src/components/SellerCountry/index.js +1 -1
- package/src/components/SellerCountry/sellerCountry.js +71 -71
- package/src/components/SellerCountry/sellerCountry.module.css +3 -3
- package/src/components/SellerDetail/sellerDetail.js +47 -27
- package/src/components/SellerInformation/sellerInformation.js +11 -10
- package/src/components/SellerLocation/sellerLocation.js +2 -2
- package/src/components/SellerLocation/sellerLocationItem.js +3 -3
- package/src/components/SellerProducts/sellerProducts.js +2 -2
- package/src/components/SellerReview/sellerReview.js +34 -26
- package/src/components/SellerReviewItem/sellerReviewItem.js +110 -25
- package/src/components/SellerVerification/sellerVerification.module.css +1 -1
- package/src/components/ShopBy/index.js +2 -0
- package/src/components/ShopBy/shopBy copy.js +172 -0
- package/src/components/ShopBy/shopBy.js +435 -0
- package/src/components/ShopBy/shopBy.module.css +76 -0
- package/src/components/ShopBy/shopBy.shimmer.js +50 -0
- package/src/components/ShopByBrands/index.js +2 -0
- package/src/components/ShopByBrands/legoSets.shimmer.js +50 -0
- package/src/components/ShopByBrands/shopByBrands.js +327 -0
- package/src/components/ShopByBrands/shopByBrands.module.css +76 -0
- package/src/components/ShopByBrands/shopByBrands.shimmer.js +50 -0
- package/src/components/ShopByCard/index.js +2 -0
- package/src/components/ShopByCard/shopByCard.js +277 -0
- package/src/components/ShopByCard/shopByCard.module.css +76 -0
- package/src/components/ShopByCard/shopByCard.shimmer.js +50 -0
- package/src/components/ShopByCategory/index.js +2 -0
- package/src/components/ShopByCategory/shopByCategory.js +69 -0
- package/src/components/ShopByCategory/shopByCategory.module.css +58 -0
- package/src/components/ShopByCategory/shopByCategory.shimmer.js +24 -0
- package/src/components/ShopByFilters/index.js +1 -0
- package/src/components/ShopByFilters/shopByFilters.js +74 -0
- package/src/components/ShopByFilters/shopByFilters.module.css +21 -0
- package/src/components/ShopByPage/index.js +1 -0
- package/src/components/ShopByPage/shopByPage.js +12 -0
- package/src/components/ShopBySets/index.js +2 -0
- package/src/components/ShopBySets/shopBySets.js +288 -0
- package/src/components/ShopBySets/shopBySets.module.css +76 -0
- package/src/components/ShopBySets/shopBySets.shimmer.js +50 -0
- package/src/components/ShopByVehicles/index.js +2 -0
- package/src/components/ShopByVehicles/shopByVehicles.js +327 -0
- package/src/components/ShopByVehicles/shopByVehicles.module.css +76 -0
- package/src/components/ShopByVehicles/shopByVehicles.shimmer.js +50 -0
- package/src/components/SocialLogin/img/facebook.svg +3 -0
- package/src/components/SocialLogin/img/google.svg +6 -0
- package/src/components/SocialLogin/img/instagram.svg +27 -0
- package/src/components/SocialLogin/img/wechat.svg +15 -0
- package/src/components/SocialLogin/img/weibo.svg +7 -0
- package/src/components/SocialLogin/index.js +10 -0
- package/src/components/SocialLogin/socialLogin.js +70 -0
- package/src/components/SocialMediaShare/index.js +51 -0
- package/src/components/SocialMediaShare/share.js +94 -0
- package/src/components/SortBy/index.js +2 -2
- package/src/components/SportCardsSets/index.js +2 -0
- package/src/components/SportCardsSets/sportCardsSets.js +363 -0
- package/src/components/SportCardsSets/sportCardsSets.module.css +76 -0
- package/src/components/SportCardsSets/sportCardsSets.shimmer.js +50 -0
- package/src/components/SubCategory/customSubCategory.js +45 -0
- package/src/components/SubCategory/customSubCategory.module.css +22 -0
- package/src/components/SubCategory/subCategory.js +49 -0
- package/src/components/SubCategory/subCategory.module.css +22 -0
- package/src/components/TrainsSets/index.js +2 -0
- package/src/components/TrainsSets/trainsSets.js +331 -0
- package/src/components/TrainsSets/trainsSets.module.css +76 -0
- package/src/components/TrainsSets/trainsSets.shimmer.js +49 -0
- package/src/components/WebsiteSwitcher/websiteSwitcher.js +18 -6
- package/src/components/WebsiteSwitcher/websiteSwitcher.module.css +107 -111
- package/src/components/WebsiteSwitcher/websiteSwitcher.shimmer.js +6 -6
- package/src/components/WebsiteSwitcher/websiteSwitcherItem.js +47 -47
- package/src/components/WebsiteSwitcher/websiteSwitcherItem.module.css +20 -20
- package/src/components/commons/Checkbox/index.js +57 -0
- package/src/components/commons/Collapsible/index.js +51 -0
- package/src/components/commons/Select/index.js +29 -0
- package/src/components/commons/Tabs/index.js +2 -2
- package/src/components/commons/Textfield/index.js +20 -0
- package/src/hooks/useCustomSort.js +21 -0
- package/src/intercept.js +122 -27
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/__fixtures__/apolloMocks.js +33 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/carousel.gql.ce.js +16 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/carousel.gql.ee.js +17 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/carousel.js +38 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/index.js +1 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/useCarousel.js +25 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/configAggregator.js +26 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/index.js +1 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/products.js +369 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/products.module.css +0 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/banner.module.css +103 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/configAggregator.js +17 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/index.js +2 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.js +221 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.module.css +231 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.shimmer.js +126 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.shimmer.module.css +5 -0
- package/src/overwrites/pagebuilder/lib/utils.js +224 -0
- package/src/overwrites/peregrine/lib/talons/Breadcrumbs/useBreadcrumbs.js +100 -0
- package/src/overwrites/peregrine/lib/talons/FilterModal/useFilterList.js +62 -0
- package/src/overwrites/peregrine/lib/talons/FilterSidebar/useFilterSidebar.js +312 -0
- package/src/overwrites/peregrine/lib/talons/MegaMenu/megaMenu.gql.js +96 -0
- package/src/overwrites/peregrine/lib/talons/MegaMenu/useMegaMenu.js +199 -0
- package/src/overwrites/peregrine/lib/talons/MegaMenu/useMegaMenuItem.js +66 -0
- package/src/overwrites/peregrine/lib/talons/MegaMenu/useSubMenu.js +20 -0
- package/src/overwrites/peregrine/lib/talons/ProductFullDetail/useProductFullDetail.js +642 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/category.gql.js +49 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/categoryContent.gql.js +98 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/categoryFragments.gql.js +90 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/useCategory.js +234 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/useCategoryContent.js +192 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Product/product.gql.js +31 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Product/productDetailFragment.gql.js +235 -0
- package/src/overwrites/venia-ui/lib/RootComponents/CMS/cms.js +73 -0
- package/src/overwrites/venia-ui/lib/RootComponents/CMS/cms.module.css +25 -0
- package/src/overwrites/venia-ui/lib/RootComponents/CMS/cms.shimmer.js +18 -0
- package/src/overwrites/venia-ui/lib/RootComponents/CMS/index.js +7 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/NoProductsFound/index.js +1 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/NoProductsFound/noProductsFound.js +64 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/NoProductsFound/noProductsFound.module.css +39 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/NoProductsFound/noProductsFound.png +0 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/category.gql.js +17 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/category.js +142 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/category.module.css +78 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +383 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.shimmer.js +74 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/images/001.jpg +0 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/images/002.jpg +0 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/images/003.jpg +0 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/images/004.jpg +0 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/images/005.jpg +0 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/images/006.jpg +0 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/images/007.jpg +0 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/images/008.jpg +0 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/images/009.jpg +0 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/images/010.jpg +0 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/images/011.jpg +0 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/images/012.jpg +0 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/images/index.js +12 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/index.js +6 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/accountInformationPage.gql.js +48 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/accountInformationPage.js +147 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/accountInformationPage.module.css +52 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/accountInformationPageFragment.gql.js +10 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/editForm.js +206 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/editForm.module.css +40 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/editModal.js +107 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/editModal.module.css +3 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/index.js +14 -0
- package/src/overwrites/venia-ui/lib/components/AccountMenu/accountMenu.js +108 -0
- package/src/overwrites/venia-ui/lib/components/AccountMenu/accountMenu.module.css +73 -0
- package/src/overwrites/venia-ui/lib/components/AccountMenu/accountMenuItems.js +58 -0
- package/src/overwrites/venia-ui/lib/components/AccountMenu/accountMenuItems.module.css +31 -0
- package/src/overwrites/venia-ui/lib/components/AccountMenu/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Adapter/adapter.js +3 -0
- package/src/overwrites/venia-ui/lib/components/App/app.js +131 -0
- package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.js +189 -0
- package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.module.css +71 -0
- package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.shimmer.js +24 -0
- package/src/overwrites/venia-ui/lib/components/Breadcrumbs/index.js +2 -0
- package/src/overwrites/venia-ui/lib/components/Button/button.js +100 -0
- package/src/overwrites/venia-ui/lib/components/Button/button.module.css +132 -0
- package/src/overwrites/venia-ui/lib/components/Button/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/giftCard.js +50 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/giftCard.module.css +11 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/giftCards.js +238 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/giftCards.module.css +98 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.js +178 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.module.css +52 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/CouponCode/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.js +321 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.module.css +61 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/GiftOptions/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingForm.js +103 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingForm.module.css +36 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingMethods.js +103 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingMethods.module.css +33 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadio.js +37 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadio.module.css +3 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadios.js +106 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadios.module.css +10 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/giftCardSection.ce.js +7 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/giftCardSection.ee.js +28 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/giftOptionsSection.ce.js +7 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/giftOptionsSection.ee.js +38 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/priceAdjustments.js +95 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/priceAdjustments.module.css +2 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/discountSummary.js +123 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/discountSummary.module.css +40 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/giftCardSummary.ce.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/giftCardSummary.ee.js +60 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/giftOptionsSummary.ce.js +5 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/giftOptionsSummary.ee.js +40 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/priceSummary.js +210 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/priceSummary.module.css +51 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/shippingSummary.js +58 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/taxSummary.js +57 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/editModal.js +41 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/productDetail.js +80 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/productDetail.module.css +33 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/productForm.js +153 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/productForm.module.css +52 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/errorMessage.js +31 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/errorMessage.module.css +13 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/product.js +278 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/product.module.css +156 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/productListing.js +94 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/productListing.module.css +11 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/quantity.js +40 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/cartPage.js +126 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/cartPage.module.css +64 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Checkbox/checkbox.js +78 -0
- package/src/overwrites/venia-ui/lib/components/Checkbox/checkbox.module.css +73 -0
- package/src/overwrites/venia-ui/lib/components/Checkbox/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/addressBook.js +190 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/addressBook.module.css +78 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/addressCard.js +125 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/addressCard.module.css +94 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/BillingAddress/billingAddress.js +213 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/BillingAddress/billingAddress.module.css +36 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/BillingAddress/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/GuestSignIn/guestSignIn.js +93 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/GuestSignIn/guestSignIn.module.css +55 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/GuestSignIn/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/__fixtures__/cartItems.js +102 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/item.js +54 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/item.module.css +60 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/itemsReview.js +84 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/itemsReview.module.css +20 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/showAllButton.js +38 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/showAllButton.module.css +28 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.js +213 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.module.css +24 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.js +162 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.module.css +70 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderSummary/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderSummary/orderSummary.js +34 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderSummary/orderSummary.module.css +17 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/brainTreeDropIn.js +196 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/braintreeDropin.module.css +26 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/braintreeSummary.js +160 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/braintreeSummary.module.css +62 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/creditCard.js +348 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/creditCard.module.css +58 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/editCard.js +44 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/editCard.module.css +5 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/editModal.js +88 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/editablePaymentCollection.js +23 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentInformation.js +99 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentInformation.module.css +23 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentMethodCollection.js +23 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentMethods.js +121 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentMethods.module.css +34 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/summary.js +71 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/summary.module.css +23 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/summaryPaymentCollection.js +23 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PriceAdjustments/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PriceAdjustments/priceAdjustments.js +63 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PriceAdjustments/priceAdjustments.module.css +2 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/addressForm.js +18 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.js +401 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.module.css +58 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/guestForm.js +455 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/guestForm.module.css +52 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/index.js +3 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/card.js +66 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/card.module.css +12 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/editModal.js +65 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/editModal.module.css +90 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/shippingInformation.js +149 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/shippingInformation.module.css +88 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/completedView.js +114 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/completedView.module.css +48 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/shippingMethod.js +154 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/shippingMethod.module.css +27 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/shippingRadios.js +80 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/shippingRadios.module.css +22 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/updateModal.js +85 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/updateModal.module.css +3 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/checkoutPage.js +472 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/checkoutPage.module.css +186 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CreateAccount/createAccount.js +323 -0
- package/src/overwrites/venia-ui/lib/components/CreateAccount/createAccount.module.css +52 -0
- package/src/overwrites/venia-ui/lib/components/CreateAccount/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CreateAccountPage/createAccountPage.js +48 -0
- package/src/overwrites/venia-ui/lib/components/CreateAccountPage/createAccountPage.module.css +21 -0
- package/src/overwrites/venia-ui/lib/components/CreateAccountPage/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Dialog/dialog.js +198 -0
- package/src/overwrites/venia-ui/lib/components/Dialog/dialog.module.css +189 -0
- package/src/overwrites/venia-ui/lib/components/Dialog/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilter.js +60 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilter.module.css +22 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilters.js +69 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilters.module.css +21 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterDefault.js +84 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterDefault.module.css +0 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterItem.js +80 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterItemRadio.js +79 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterItemRadio.module.css +0 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterItemRadioGroup.js +87 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterList.js +265 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterList.module.css +28 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/filterBlock.js +135 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/filterBlock.module.css +25 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/filterFooter.js +49 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/filterFooter.module.css +10 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/filterModal.js +166 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/filterModal.module.css +88 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/filterSearch.module.css +3 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/FilterSidebar/__tests__/filterSidebar.spec.js +246 -0
- package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.js +197 -0
- package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.module.css +59 -0
- package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.shimmer.js +24 -0
- package/src/overwrites/venia-ui/lib/components/FilterSidebar/index.js +2 -0
- package/src/overwrites/venia-ui/lib/components/Footer/footer.js +147 -0
- package/src/overwrites/venia-ui/lib/components/Footer/footer.module.css +70 -0
- package/src/overwrites/venia-ui/lib/components/Footer/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Footer/sampleData.js +48 -0
- package/src/overwrites/venia-ui/lib/components/Gallery/addToCartButton.js +116 -0
- package/src/overwrites/venia-ui/lib/components/Gallery/addToCartButton.module.css +38 -0
- package/src/overwrites/venia-ui/lib/components/Gallery/gallery.js +57 -0
- package/src/overwrites/venia-ui/lib/components/Gallery/gallery.module.css +28 -0
- package/src/overwrites/venia-ui/lib/components/Gallery/gallery.shimmer.js +39 -0
- package/src/overwrites/venia-ui/lib/components/Gallery/index.js +3 -0
- package/src/overwrites/venia-ui/lib/components/Gallery/item.js +224 -0
- package/src/overwrites/venia-ui/lib/components/Gallery/item.module.css +109 -0
- package/src/overwrites/venia-ui/lib/components/Gallery/item.shimmer.js +38 -0
- package/src/overwrites/venia-ui/lib/components/Gallery/star.js +12 -0
- package/src/overwrites/venia-ui/lib/components/Header/accountTrigger.js +98 -0
- package/src/overwrites/venia-ui/lib/components/Header/cartTrigger.js +116 -0
- package/src/overwrites/venia-ui/lib/components/Header/cartTrigger.module.css +47 -0
- package/src/overwrites/venia-ui/lib/components/Header/header.js +63 -14
- package/src/overwrites/venia-ui/lib/components/Header/storeSwitcher.js +22 -8
- package/src/overwrites/venia-ui/lib/components/Header/storeSwitcher.module.css +107 -0
- package/src/overwrites/venia-ui/lib/components/Header/wishlistTrigger.js +23 -0
- package/src/overwrites/venia-ui/lib/components/Main/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Main/main.js +39 -0
- package/src/overwrites/venia-ui/lib/components/Main/main.module.css +41 -0
- package/src/overwrites/venia-ui/lib/components/MegaMenu/customSubmenuColumn.js +75 -0
- package/src/overwrites/venia-ui/lib/components/MegaMenu/customSubmenuColumn.module.css +29 -0
- package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenu.js +2 -1
- package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenuItem.js +11 -5
- package/src/overwrites/venia-ui/lib/components/MegaMenu/shopByColumn.js +121 -0
- package/src/overwrites/venia-ui/lib/components/MegaMenu/shopByColumn.module.css +26 -0
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.js +82 -23
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.module.css +17 -11
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenuColumn.js +65 -12
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenuColumn.module.css +11 -6
- package/src/overwrites/venia-ui/lib/components/MyAccount/ResetPassword/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/ResetPassword/resetPassword.gql.js +22 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/ResetPassword/resetPassword.js +143 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/ResetPassword/resetPassword.module.css +53 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/accountLink.js +42 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/accountLink.module.css +33 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/myAccount.js +38 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/myAccount.module.css +5 -0
- package/src/overwrites/venia-ui/lib/components/Newsletter/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Newsletter/newsletter.js +156 -0
- package/src/overwrites/venia-ui/lib/components/Newsletter/newsletter.module.css +90 -0
- package/src/overwrites/venia-ui/lib/components/Newsletter/newsletter.shimmer.js +46 -0
- package/src/overwrites/venia-ui/lib/components/Newsletter/newsletter.shimmer.module.css +21 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/billingInformation.js +71 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/billingInformation.module.css +9 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/item.js +121 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/item.module.css +35 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/items.js +70 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/items.module.css +16 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/orderDetails.js +207 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/orderDetails.module.css +102 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/orderTotal.js +159 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/orderTotal.module.css +50 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/paymentMethod.js +45 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/paymentMethod.module.css +14 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/shippingInformation.js +90 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/shippingInformation.module.css +9 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/shippingMethod.js +86 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/shippingMethod.module.css +19 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/collapsedImageGallery.js +63 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/collapsedImageGallery.module.css +16 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/index.js +15 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderHistoryPage.js +227 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderHistoryPage.module.css +70 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderProgressBar.js +70 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderProgressBar.module.css +14 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderRow.js +332 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderRow.module.css +146 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/resetButton.js +41 -0
- package/src/overwrites/venia-ui/lib/components/Pagination/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Pagination/navButton.js +65 -0
- package/src/overwrites/venia-ui/lib/components/Pagination/pagination.js +107 -0
- package/src/overwrites/venia-ui/lib/components/Pagination/tile.js +41 -0
- package/src/overwrites/venia-ui/lib/components/Password/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Password/password.js +102 -0
- package/src/overwrites/venia-ui/lib/components/Password/password.module.css +26 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/boolean.js +74 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/boolean.module.css +9 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/date.js +82 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/date.module.css +9 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/dateTime.js +85 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/dateTime.module.css +9 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/multiselect.js +104 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/multiselect.module.css +22 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/price.js +74 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/price.module.css +9 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/select.js +99 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/select.module.css +13 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/text.js +88 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/text.module.css +13 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/textarea.js +94 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/textarea.module.css +13 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/attributeType.js +67 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/customAttributes.js +65 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/customAttributes.module.css +8 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/auctionDetail.js +210 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/bidList.js +67 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/modalFormReview.js +164 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/preOrderDetail.js +61 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/productReview.js +63 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/starInput.js +33 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.gql.js +7 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +765 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.module.css +208 -0
- package/src/overwrites/venia-ui/lib/components/ProductImageCarousel/carousel.js +180 -0
- package/src/overwrites/venia-ui/lib/components/ProductImageCarousel/carousel.module.css +102 -0
- package/src/overwrites/venia-ui/lib/components/ProductImageCarousel/carousel.shimmer.js +51 -0
- package/src/overwrites/venia-ui/lib/components/ProductImageCarousel/carousel.shimmer.module.css +7 -0
- package/src/overwrites/venia-ui/lib/components/ProductImageCarousel/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/ProductImageCarousel/thumbnail.js +108 -0
- package/src/overwrites/venia-ui/lib/components/ProductImageCarousel/thumbnail.module.css +47 -0
- package/src/overwrites/venia-ui/lib/components/ProductSort/index.js +2 -0
- package/src/overwrites/venia-ui/lib/components/ProductSort/productSort.js +233 -0
- package/src/overwrites/venia-ui/lib/components/ProductSort/productSort.module.css +65 -0
- package/src/overwrites/venia-ui/lib/components/ProductSort/productSort.shimmer.js +28 -0
- package/src/overwrites/venia-ui/lib/components/ProductSort/productSort.shimmer.module.css +10 -0
- package/src/overwrites/venia-ui/lib/components/ProductSort/sortItem.js +57 -0
- package/src/overwrites/venia-ui/lib/components/ProductSort/sortItem.module.css +23 -0
- package/src/overwrites/venia-ui/lib/components/QuantityStepper/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/QuantityStepper/quantityStepper.js +113 -0
- package/src/overwrites/venia-ui/lib/components/QuantityStepper/quantityStepper.module.css +74 -0
- package/src/overwrites/venia-ui/lib/components/RadioGroup/radio.js +60 -0
- package/src/overwrites/venia-ui/lib/components/RadioGroup/radio.module.css +70 -0
- package/src/overwrites/venia-ui/lib/components/RichContent/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/RichContent/plainHtmlRenderer.js +17 -0
- package/src/overwrites/venia-ui/lib/components/RichContent/richContent.js +59 -0
- package/src/overwrites/venia-ui/lib/components/RichContent/richContent.module.css +146 -0
- package/src/overwrites/venia-ui/lib/components/RichContent/richContentRenderers.js +7 -0
- package/src/overwrites/venia-ui/lib/components/RichText/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/RichText/richText.js +21 -0
- package/src/overwrites/venia-ui/lib/components/RichText/richText.module.css +19 -0
- package/src/overwrites/venia-ui/lib/components/SearchBar/autocomplete.js +5 -1
- package/src/overwrites/venia-ui/lib/components/SearchBar/autocomplete.module.css +6 -7
- package/src/overwrites/venia-ui/lib/components/SearchBar/searchBar.js +26 -1
- package/src/overwrites/venia-ui/lib/components/SearchBar/searchBar.module.css +1 -3
- package/src/overwrites/venia-ui/lib/components/SearchBar/searchField.js +14 -3
- package/src/overwrites/venia-ui/lib/components/SearchBar/suggestions.module.css +1 -1
- package/src/overwrites/venia-ui/lib/components/Select/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Select/option.js +28 -0
- package/src/overwrites/venia-ui/lib/components/Select/select.js +74 -0
- package/src/overwrites/venia-ui/lib/components/Select/select.module.css +25 -0
- package/src/overwrites/venia-ui/lib/components/SignIn/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/SignIn/signIn.gql.js +50 -0
- package/src/overwrites/venia-ui/lib/components/SignIn/signIn.js +224 -0
- package/src/overwrites/venia-ui/lib/components/SignIn/signIn.module.css +65 -0
- package/src/overwrites/venia-ui/lib/components/SignInPage/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/SignInPage/signInPage.js +50 -0
- package/src/overwrites/venia-ui/lib/components/SignInPage/signInPage.module.css +17 -0
- package/src/overwrites/venia-ui/lib/components/TextArea/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/TextArea/textArea.js +44 -0
- package/src/overwrites/venia-ui/lib/components/TextArea/textArea.module.css +27 -0
- package/src/overwrites/venia-ui/lib/components/TextInput/field.module.css +51 -0
- package/src/overwrites/venia-ui/lib/components/TextInput/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/TextInput/textInput.js +64 -0
- package/src/overwrites/venia-ui/lib/components/TextInput/textInput.module.css +21 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/actionMenu.ee.js +54 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/actionMenu.js +7 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/createWishlist.ee.js +129 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/createWishlist.js +3 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/createWishlist.module.css +63 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/index.js +14 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlist.js +193 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlist.module.css +78 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistConfirmRemoveProductDialog.js +84 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistConfirmRemoveProductDialog.module.css +20 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistEditFavoritesListDialog.js +96 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistEditFavoritesListDialog.module.css +22 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistItem.js +138 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistItem.module.css +78 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistItems.js +45 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistItems.module.css +9 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistListActionsDialog.js +61 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistMoreActionsDialog.js +84 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistMoreActionsDialog.module.css +19 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistPage.js +120 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistPage.module.css +31 -0
- package/src/overwrites/venia-ui/lib/index.module.css +137 -0
- package/src/overwrites/venia-ui/lib/tokens.module.css +167 -0
- package/src/overwrites/venia-ui/venia-static/favicon.ico +0 -0
- package/src/overwrites/venia-ui/venia-static/manifest.json +32 -0
- package/src/static-files/favicon.ico +0 -0
- package/src/static-files/icons/apple-touch-icon.png +0 -0
- package/src/static-files/icons/venia_circle_144.png +0 -0
- package/src/static-files/icons/venia_circle_192.png +0 -0
- package/src/static-files/icons/venia_circle_512.png +0 -0
- package/src/static-files/icons/venia_maskable_512.png +0 -0
- package/src/static-files/icons/venia_square_144.png +0 -0
- package/src/static-files/icons/venia_square_192.png +0 -0
- package/src/static-files/icons/venia_square_512.png +0 -0
- package/src/static-files/icons/venia_square_57.png +0 -0
- package/src/static-files/manifest.json +32 -0
- package/src/static-files/robots.txt +2 -0
- package/src/static-files/veniaClosed.png +0 -0
- package/src/talons/ArraySearchInput/useArraySearchInput.js +58 -0
- package/src/talons/AttributesBlock/attributesBlock.gql.js +15 -0
- package/src/talons/AttributesBlock/useAttributesBlock.js +37 -0
- package/src/talons/CollectibleGameSets/collectibleGameSets.gql.js +47 -0
- package/src/talons/CollectibleGameSets/useCollectibleGameSets.js +134 -0
- package/src/talons/CustomFilters/customFilters.gql.js +45 -0
- package/src/talons/CustomFilters/useCustomFilters.js +258 -0
- package/src/talons/FilterOption/useFilterOptionModal.js +11 -0
- package/src/talons/FilterOptionModal/useFilterOptionModal.js +11 -0
- package/src/talons/FilterTop/customFilters.gql.js +45 -0
- package/src/talons/FilterTop/filterTop.gql.js +45 -0
- package/src/talons/FilterTop/index.js +1 -0
- package/src/talons/FilterTop/useFilterTop.js +312 -0
- package/src/talons/Header/logo.gql.js +19 -0
- package/src/talons/Header/useLogo.js +19 -0
- package/src/talons/Header/websiteSwitcher.gql.js +45 -45
- package/src/talons/LegoSets/legoSets.gql.js +59 -0
- package/src/talons/LegoSets/useLegoSets.js +222 -0
- package/src/talons/MegaMenu/megaMenu.gql.js +70 -0
- package/src/talons/MiniatureGameSets/miniatureGameSets.gql.js +59 -0
- package/src/talons/MiniatureGameSets/useMiniatureGameSets.js +220 -0
- package/src/talons/NonSportCardsSets/nonSportCardsSets.gql.js +59 -0
- package/src/talons/NonSportCardsSets/useNonSportCardsSets.js +238 -0
- package/src/talons/Seller/seller.gql.js +0 -36
- package/src/talons/SellerReview/sellerReview.gql.js +53 -0
- package/src/talons/SellerReview/useSellerReview.js +49 -0
- package/src/talons/ShopBy/shopBy.gql.js +61 -0
- package/src/talons/ShopBy/useShopBy.js +264 -0
- package/src/talons/ShopByBrands/shopByBrands.gql.js +59 -0
- package/src/talons/ShopByBrands/shopByBrands.js +59 -0
- package/src/talons/ShopByBrands/useShopByBrands.js +218 -0
- package/src/talons/ShopByCard/shopByCard.gql.js +47 -0
- package/src/talons/ShopByCard/useShopByCard.js +134 -0
- package/src/talons/ShopByCategory/index.js +1 -0
- package/src/talons/ShopByCategory/shopByCategory.gql.js +38 -0
- package/src/talons/ShopByCategory/useShopByCategory.js +69 -0
- package/src/talons/ShopByVehicles/shopByVehicles.gql.js +60 -0
- package/src/talons/ShopByVehicles/useShopByVehicles.js +222 -0
- package/src/talons/SportCardsSets/sportCardsSets.gql.js +61 -0
- package/src/talons/SportCardsSets/useSportCardsSets.js +266 -0
- package/src/talons/SubCategory/subCategory.gql.js +15 -0
- package/src/talons/SubCategory/useCustomSubCategory.js +49 -0
- package/src/talons/SubCategory/useSubCategory.js +52 -0
- package/src/talons/SubCategoryPage/subCategoryPage.gql.js +40 -0
- package/src/talons/SubCategoryPage/useSubCategoryPage.js +108 -0
- package/src/talons/TrainsSets/trainsSets.gql.js +60 -0
- package/src/talons/TrainsSets/useTrainsSets.js +223 -0
- package/src/talons/WebsiteSwitcher/websiteSwitcher.gql.js +45 -45
- package/src/theme/vars.js +16 -0
|
@@ -0,0 +1,642 @@
|
|
|
1
|
+
import { useCallback, useState, useMemo } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { useMutation, useQuery } from '@apollo/client';
|
|
4
|
+
import { useCartContext } from '@magento/peregrine/lib/context/cart';
|
|
5
|
+
import { useUserContext } from '@magento/peregrine/lib/context/user';
|
|
6
|
+
|
|
7
|
+
import { appendOptionsToPayload } from '@magento/peregrine/lib/util/appendOptionsToPayload';
|
|
8
|
+
import { findMatchingVariant } from '@magento/peregrine/lib/util/findMatchingProductVariant';
|
|
9
|
+
import { isProductConfigurable } from '@magento/peregrine/lib/util/isProductConfigurable';
|
|
10
|
+
import { isSupportedProductType as isSupported } from '@magento/peregrine/lib/util/isSupportedProductType';
|
|
11
|
+
import { deriveErrorMessage } from '@magento/peregrine/lib/util/deriveErrorMessage';
|
|
12
|
+
import mergeOperations from '@magento/peregrine/lib/util/shallowMerge';
|
|
13
|
+
import defaultOperations from '@magento/peregrine/lib/talons/ProductFullDetail/productFullDetail.gql';
|
|
14
|
+
import { useEventingContext } from '@magento/peregrine/lib/context/eventing';
|
|
15
|
+
import { getOutOfStockVariants } from '@magento/peregrine/lib/util/getOutOfStockVariants';
|
|
16
|
+
|
|
17
|
+
const INITIAL_OPTION_CODES = new Map();
|
|
18
|
+
const INITIAL_OPTION_SELECTIONS = new Map();
|
|
19
|
+
const OUT_OF_STOCK_CODE = 'OUT_OF_STOCK';
|
|
20
|
+
const IN_STOCK_CODE = 'IN_STOCK';
|
|
21
|
+
|
|
22
|
+
const deriveOptionCodesFromProduct = product => {
|
|
23
|
+
// If this is a simple product it has no option codes.
|
|
24
|
+
if (!isProductConfigurable(product)) {
|
|
25
|
+
return INITIAL_OPTION_CODES;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Initialize optionCodes based on the options of the product.
|
|
29
|
+
const initialOptionCodes = new Map();
|
|
30
|
+
for (const {
|
|
31
|
+
attribute_id,
|
|
32
|
+
attribute_code
|
|
33
|
+
} of product.configurable_options) {
|
|
34
|
+
initialOptionCodes.set(attribute_id, attribute_code);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return initialOptionCodes;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// Similar to deriving the initial codes for each option.
|
|
41
|
+
const deriveOptionSelectionsFromProduct = product => {
|
|
42
|
+
if (!isProductConfigurable(product)) {
|
|
43
|
+
return INITIAL_OPTION_SELECTIONS;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const initialOptionSelections = new Map();
|
|
47
|
+
for (const { attribute_id } of product.configurable_options) {
|
|
48
|
+
initialOptionSelections.set(attribute_id, undefined);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return initialOptionSelections;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const getIsMissingOptions = (product, optionSelections) => {
|
|
55
|
+
// Non-configurable products can't be missing options.
|
|
56
|
+
if (!isProductConfigurable(product)) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Configurable products are missing options if we have fewer
|
|
61
|
+
// option selections than the product has options.
|
|
62
|
+
const { configurable_options } = product;
|
|
63
|
+
const numProductOptions = configurable_options.length;
|
|
64
|
+
const numProductSelections = Array.from(optionSelections.values()).filter(
|
|
65
|
+
value => !!value
|
|
66
|
+
).length;
|
|
67
|
+
|
|
68
|
+
return numProductSelections < numProductOptions;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const getIsOutOfStock = (product, optionCodes, optionSelections) => {
|
|
72
|
+
const { stock_status, variants } = product;
|
|
73
|
+
const isConfigurable = isProductConfigurable(product);
|
|
74
|
+
const optionsSelected =
|
|
75
|
+
Array.from(optionSelections.values()).filter(value => !!value).length >
|
|
76
|
+
0;
|
|
77
|
+
|
|
78
|
+
if (isConfigurable && optionsSelected) {
|
|
79
|
+
const item = findMatchingVariant({
|
|
80
|
+
optionCodes,
|
|
81
|
+
optionSelections,
|
|
82
|
+
variants
|
|
83
|
+
});
|
|
84
|
+
const stockStatus = item?.product?.stock_status;
|
|
85
|
+
|
|
86
|
+
return stockStatus === OUT_OF_STOCK_CODE || !stockStatus;
|
|
87
|
+
}
|
|
88
|
+
return stock_status === OUT_OF_STOCK_CODE;
|
|
89
|
+
};
|
|
90
|
+
const getIsAllOutOfStock = product => {
|
|
91
|
+
const { stock_status, variants } = product;
|
|
92
|
+
const isConfigurable = isProductConfigurable(product);
|
|
93
|
+
|
|
94
|
+
if (isConfigurable) {
|
|
95
|
+
const inStockItem = variants.find(item => {
|
|
96
|
+
return item.product.stock_status === IN_STOCK_CODE;
|
|
97
|
+
});
|
|
98
|
+
return !inStockItem;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return stock_status === OUT_OF_STOCK_CODE;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const getMediaGalleryEntries = (product, optionCodes, optionSelections) => {
|
|
105
|
+
let value = [];
|
|
106
|
+
|
|
107
|
+
const { media_gallery_entries, variants } = product;
|
|
108
|
+
const isConfigurable = isProductConfigurable(product);
|
|
109
|
+
|
|
110
|
+
// Selections are initialized to "code => undefined". Once we select a value, like color, the selections change. This filters out unselected options.
|
|
111
|
+
const optionsSelected =
|
|
112
|
+
Array.from(optionSelections.values()).filter(value => !!value).length >
|
|
113
|
+
0;
|
|
114
|
+
|
|
115
|
+
if (!isConfigurable || !optionsSelected) {
|
|
116
|
+
value = media_gallery_entries;
|
|
117
|
+
} else {
|
|
118
|
+
// If any of the possible variants matches the selection add that
|
|
119
|
+
// variant's image to the media gallery. NOTE: This _can_, and does,
|
|
120
|
+
// include variants such as size. If Magento is configured to display
|
|
121
|
+
// an image for a size attribute, it will render that image.
|
|
122
|
+
const item = findMatchingVariant({
|
|
123
|
+
optionCodes,
|
|
124
|
+
optionSelections,
|
|
125
|
+
variants
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
value = item
|
|
129
|
+
? [...item.product.media_gallery_entries, ...media_gallery_entries]
|
|
130
|
+
: media_gallery_entries;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return value;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
// We only want to display breadcrumbs for one category on a PDP even if a
|
|
137
|
+
// product has multiple related categories. This function filters and selects
|
|
138
|
+
// one category id for that purpose.
|
|
139
|
+
const getBreadcrumbCategoryId = categories => {
|
|
140
|
+
// Exit if there are no categories for this product.
|
|
141
|
+
if (!categories || !categories.length) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const breadcrumbSet = new Set();
|
|
145
|
+
categories.forEach(({ breadcrumbs }) => {
|
|
146
|
+
// breadcrumbs can be `null`...
|
|
147
|
+
(breadcrumbs || []).forEach(({ category_id }) =>
|
|
148
|
+
breadcrumbSet.add(category_id)
|
|
149
|
+
);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
// Until we can get the single canonical breadcrumb path to a product we
|
|
153
|
+
// will just return the first category id of the potential leaf categories.
|
|
154
|
+
const leafCategory = categories.find(
|
|
155
|
+
category => !breadcrumbSet.has(category.uid)
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
// If we couldn't find a leaf category then just use the first category
|
|
159
|
+
// in the list for this product.
|
|
160
|
+
return leafCategory.uid || categories[0].uid;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const getConfigPrice = (product, optionCodes, optionSelections) => {
|
|
164
|
+
let value;
|
|
165
|
+
|
|
166
|
+
const { variants } = product;
|
|
167
|
+
const isConfigurable = isProductConfigurable(product);
|
|
168
|
+
|
|
169
|
+
const optionsSelected =
|
|
170
|
+
Array.from(optionSelections.values()).filter(value => !!value).length >
|
|
171
|
+
0;
|
|
172
|
+
|
|
173
|
+
if (!isConfigurable || !optionsSelected) {
|
|
174
|
+
value = product.price_range?.maximum_price;
|
|
175
|
+
} else {
|
|
176
|
+
const item = findMatchingVariant({
|
|
177
|
+
optionCodes,
|
|
178
|
+
optionSelections,
|
|
179
|
+
variants
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
value = item
|
|
183
|
+
? item.product.price_range?.maximum_price
|
|
184
|
+
: product.price_range?.maximum_price;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return value;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
const attributeLabelCompare = (attribute1, attribute2) => {
|
|
191
|
+
const label1 = attribute1['attribute_metadata']['label'].toLowerCase();
|
|
192
|
+
const label2 = attribute2['attribute_metadata']['label'].toLowerCase();
|
|
193
|
+
if (label1 < label2) return -1;
|
|
194
|
+
else if (label1 > label2) return 1;
|
|
195
|
+
else return 0;
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
const getCustomAttributes = (product, optionCodes, optionSelections) => {
|
|
199
|
+
const { custom_attributes, variants } = product;
|
|
200
|
+
const isConfigurable = isProductConfigurable(product);
|
|
201
|
+
const optionsSelected =
|
|
202
|
+
Array.from(optionSelections.values()).filter(value => !!value).length >
|
|
203
|
+
0;
|
|
204
|
+
|
|
205
|
+
if (isConfigurable && optionsSelected) {
|
|
206
|
+
const item = findMatchingVariant({
|
|
207
|
+
optionCodes,
|
|
208
|
+
optionSelections,
|
|
209
|
+
variants
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
return item && item.product
|
|
213
|
+
? [...item.product.custom_attributes].sort(attributeLabelCompare)
|
|
214
|
+
: [];
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return custom_attributes
|
|
218
|
+
? [...custom_attributes].sort(attributeLabelCompare)
|
|
219
|
+
: [];
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* @param {GraphQLDocument} props.addConfigurableProductToCartMutation - configurable product mutation
|
|
224
|
+
* @param {GraphQLDocument} props.addSimpleProductToCartMutation - configurable product mutation
|
|
225
|
+
* @param {Object.<string, GraphQLDocument>} props.operations - collection of operation overrides merged into defaults
|
|
226
|
+
* @param {Object} props.product - the product, see RootComponents/Product
|
|
227
|
+
*
|
|
228
|
+
* @returns {{
|
|
229
|
+
* breadcrumbCategoryId: string|undefined,
|
|
230
|
+
* errorMessage: string|undefined,
|
|
231
|
+
* handleAddToCart: func,
|
|
232
|
+
* handleSelectionChange: func,
|
|
233
|
+
* handleSetQuantity: func,
|
|
234
|
+
* isAddToCartDisabled: boolean,
|
|
235
|
+
* isSupportedProductType: boolean,
|
|
236
|
+
* mediaGalleryEntries: array,
|
|
237
|
+
* productDetails: object,
|
|
238
|
+
* quantity: number
|
|
239
|
+
* }}
|
|
240
|
+
*/
|
|
241
|
+
export const useProductFullDetail = props => {
|
|
242
|
+
const {
|
|
243
|
+
addConfigurableProductToCartMutation,
|
|
244
|
+
addSimpleProductToCartMutation,
|
|
245
|
+
product
|
|
246
|
+
} = props;
|
|
247
|
+
|
|
248
|
+
const [, { dispatch }] = useEventingContext();
|
|
249
|
+
|
|
250
|
+
const hasDeprecatedOperationProp = !!(
|
|
251
|
+
addConfigurableProductToCartMutation || addSimpleProductToCartMutation
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
const operations = mergeOperations(defaultOperations, props.operations);
|
|
255
|
+
|
|
256
|
+
const productType = product.__typename;
|
|
257
|
+
|
|
258
|
+
const isSupportedProductType = isSupported(productType);
|
|
259
|
+
|
|
260
|
+
const [{ cartId }] = useCartContext();
|
|
261
|
+
const [{ isSignedIn }] = useUserContext();
|
|
262
|
+
const { formatMessage } = useIntl();
|
|
263
|
+
|
|
264
|
+
const { data: storeConfigData } = useQuery(
|
|
265
|
+
operations.getWishlistConfigQuery,
|
|
266
|
+
{
|
|
267
|
+
fetchPolicy: 'cache-and-network'
|
|
268
|
+
}
|
|
269
|
+
);
|
|
270
|
+
|
|
271
|
+
const [
|
|
272
|
+
addConfigurableProductToCart,
|
|
273
|
+
{
|
|
274
|
+
error: errorAddingConfigurableProduct,
|
|
275
|
+
loading: isAddConfigurableLoading
|
|
276
|
+
}
|
|
277
|
+
] = useMutation(
|
|
278
|
+
addConfigurableProductToCartMutation ||
|
|
279
|
+
operations.addConfigurableProductToCartMutation
|
|
280
|
+
);
|
|
281
|
+
|
|
282
|
+
const [
|
|
283
|
+
addSimpleProductToCart,
|
|
284
|
+
{ error: errorAddingSimpleProduct, loading: isAddSimpleLoading }
|
|
285
|
+
] = useMutation(
|
|
286
|
+
addSimpleProductToCartMutation ||
|
|
287
|
+
operations.addSimpleProductToCartMutation
|
|
288
|
+
);
|
|
289
|
+
|
|
290
|
+
const [
|
|
291
|
+
addProductToCart,
|
|
292
|
+
{
|
|
293
|
+
data: addToCartResponseData,
|
|
294
|
+
error: errorAddingProductToCart,
|
|
295
|
+
loading: isAddProductLoading
|
|
296
|
+
}
|
|
297
|
+
] = useMutation(operations.addProductToCartMutation);
|
|
298
|
+
|
|
299
|
+
const breadcrumbCategoryId = useMemo(
|
|
300
|
+
() => getBreadcrumbCategoryId(product.categories),
|
|
301
|
+
[product.categories]
|
|
302
|
+
);
|
|
303
|
+
|
|
304
|
+
const derivedOptionSelections = useMemo(
|
|
305
|
+
() => deriveOptionSelectionsFromProduct(product),
|
|
306
|
+
[product]
|
|
307
|
+
);
|
|
308
|
+
|
|
309
|
+
const [optionSelections, setOptionSelections] = useState(
|
|
310
|
+
derivedOptionSelections
|
|
311
|
+
);
|
|
312
|
+
|
|
313
|
+
const [singleOptionSelection, setSingleOptionSelection] = useState();
|
|
314
|
+
|
|
315
|
+
const derivedOptionCodes = useMemo(
|
|
316
|
+
() => deriveOptionCodesFromProduct(product),
|
|
317
|
+
[product]
|
|
318
|
+
);
|
|
319
|
+
const [optionCodes] = useState(derivedOptionCodes);
|
|
320
|
+
|
|
321
|
+
const isMissingOptions = useMemo(
|
|
322
|
+
() => getIsMissingOptions(product, optionSelections),
|
|
323
|
+
[product, optionSelections]
|
|
324
|
+
);
|
|
325
|
+
|
|
326
|
+
const isOutOfStock = useMemo(
|
|
327
|
+
() => getIsOutOfStock(product, optionCodes, optionSelections),
|
|
328
|
+
[product, optionCodes, optionSelections]
|
|
329
|
+
);
|
|
330
|
+
|
|
331
|
+
// Check if display out of stock products option is selected in the Admin Dashboard
|
|
332
|
+
const isOutOfStockProductDisplayed = useMemo(() => {
|
|
333
|
+
let totalVariants = 1;
|
|
334
|
+
const isConfigurable = isProductConfigurable(product);
|
|
335
|
+
if (product.configurable_options && isConfigurable) {
|
|
336
|
+
for (const option of product.configurable_options) {
|
|
337
|
+
const length = option.values.length;
|
|
338
|
+
totalVariants = totalVariants * length;
|
|
339
|
+
}
|
|
340
|
+
return product.variants.length === totalVariants;
|
|
341
|
+
}
|
|
342
|
+
}, [product]);
|
|
343
|
+
|
|
344
|
+
const isEverythingOutOfStock = useMemo(() => getIsAllOutOfStock(product), [
|
|
345
|
+
product
|
|
346
|
+
]);
|
|
347
|
+
|
|
348
|
+
const outOfStockVariants = useMemo(
|
|
349
|
+
() =>
|
|
350
|
+
getOutOfStockVariants(
|
|
351
|
+
product,
|
|
352
|
+
optionCodes,
|
|
353
|
+
singleOptionSelection,
|
|
354
|
+
optionSelections,
|
|
355
|
+
isOutOfStockProductDisplayed
|
|
356
|
+
),
|
|
357
|
+
[
|
|
358
|
+
product,
|
|
359
|
+
optionCodes,
|
|
360
|
+
singleOptionSelection,
|
|
361
|
+
optionSelections,
|
|
362
|
+
isOutOfStockProductDisplayed
|
|
363
|
+
]
|
|
364
|
+
);
|
|
365
|
+
|
|
366
|
+
const mediaGalleryEntries = useMemo(
|
|
367
|
+
() => getMediaGalleryEntries(product, optionCodes, optionSelections),
|
|
368
|
+
[product, optionCodes, optionSelections]
|
|
369
|
+
);
|
|
370
|
+
|
|
371
|
+
const customAttributes = useMemo(
|
|
372
|
+
() => getCustomAttributes(product, optionCodes, optionSelections),
|
|
373
|
+
[product, optionCodes, optionSelections]
|
|
374
|
+
);
|
|
375
|
+
|
|
376
|
+
const productPrice = useMemo(
|
|
377
|
+
() => getConfigPrice(product, optionCodes, optionSelections),
|
|
378
|
+
[product, optionCodes, optionSelections]
|
|
379
|
+
);
|
|
380
|
+
|
|
381
|
+
// The map of ids to values (and their uids)
|
|
382
|
+
// For example:
|
|
383
|
+
// { "179" => [{ uid: "abc", value_index: 1 }, { uid: "def", value_index: 2 }]}
|
|
384
|
+
const attributeIdToValuesMap = useMemo(() => {
|
|
385
|
+
const map = new Map();
|
|
386
|
+
// For simple items, this will be an empty map.
|
|
387
|
+
const options = product.configurable_options || [];
|
|
388
|
+
for (const { attribute_id, values } of options) {
|
|
389
|
+
map.set(attribute_id, values);
|
|
390
|
+
}
|
|
391
|
+
return map;
|
|
392
|
+
}, [product.configurable_options]);
|
|
393
|
+
|
|
394
|
+
// An array of selected option uids. Useful for passing to mutations.
|
|
395
|
+
// For example:
|
|
396
|
+
// ["abc", "def"]
|
|
397
|
+
const selectedOptionsArray = useMemo(() => {
|
|
398
|
+
const selectedOptions = [];
|
|
399
|
+
|
|
400
|
+
optionSelections.forEach((value, key) => {
|
|
401
|
+
const values = attributeIdToValuesMap.get(key);
|
|
402
|
+
|
|
403
|
+
const selectedValue = values?.find(
|
|
404
|
+
item => item.value_index === value
|
|
405
|
+
);
|
|
406
|
+
|
|
407
|
+
if (selectedValue) {
|
|
408
|
+
selectedOptions.push(selectedValue.uid);
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
return selectedOptions;
|
|
412
|
+
}, [attributeIdToValuesMap, optionSelections]);
|
|
413
|
+
|
|
414
|
+
const handleAddToCart = useCallback(
|
|
415
|
+
async formValues => {
|
|
416
|
+
const { quantity } = formValues;
|
|
417
|
+
|
|
418
|
+
/*
|
|
419
|
+
@deprecated in favor of general addProductsToCart mutation. Will support until the next MAJOR.
|
|
420
|
+
*/
|
|
421
|
+
if (hasDeprecatedOperationProp) {
|
|
422
|
+
const payload = {
|
|
423
|
+
item: product,
|
|
424
|
+
productType,
|
|
425
|
+
quantity
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
if (isProductConfigurable(product)) {
|
|
429
|
+
appendOptionsToPayload(
|
|
430
|
+
payload,
|
|
431
|
+
optionSelections,
|
|
432
|
+
optionCodes
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
if (isSupportedProductType) {
|
|
437
|
+
const variables = {
|
|
438
|
+
cartId,
|
|
439
|
+
parentSku: payload.parentSku,
|
|
440
|
+
product: payload.item,
|
|
441
|
+
quantity: payload.quantity,
|
|
442
|
+
sku: payload.item.sku
|
|
443
|
+
};
|
|
444
|
+
// Use the proper mutation for the type.
|
|
445
|
+
if (productType === 'SimpleProduct') {
|
|
446
|
+
try {
|
|
447
|
+
await addSimpleProductToCart({
|
|
448
|
+
variables
|
|
449
|
+
});
|
|
450
|
+
} catch {
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
} else if (productType === 'ConfigurableProduct') {
|
|
454
|
+
try {
|
|
455
|
+
await addConfigurableProductToCart({
|
|
456
|
+
variables
|
|
457
|
+
});
|
|
458
|
+
} catch {
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
} else {
|
|
463
|
+
console.error(
|
|
464
|
+
'Unsupported product type. Cannot add to cart.'
|
|
465
|
+
);
|
|
466
|
+
}
|
|
467
|
+
} else {
|
|
468
|
+
const variables = {
|
|
469
|
+
cartId,
|
|
470
|
+
product: {
|
|
471
|
+
sku: product.sku,
|
|
472
|
+
quantity
|
|
473
|
+
},
|
|
474
|
+
entered_options: [
|
|
475
|
+
{
|
|
476
|
+
uid: product.uid,
|
|
477
|
+
value: product.name
|
|
478
|
+
}
|
|
479
|
+
]
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
if (selectedOptionsArray.length) {
|
|
483
|
+
variables.product.selected_options = selectedOptionsArray;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
try {
|
|
487
|
+
await addProductToCart({ variables });
|
|
488
|
+
|
|
489
|
+
const selectedOptionsLabels =
|
|
490
|
+
selectedOptionsArray?.map((uid, i) => ({
|
|
491
|
+
attribute: product.configurable_options[i].label,
|
|
492
|
+
value:
|
|
493
|
+
product.configurable_options[i].values.findLast(
|
|
494
|
+
x => x.uid === uid
|
|
495
|
+
)?.label || null
|
|
496
|
+
})) || null;
|
|
497
|
+
|
|
498
|
+
dispatch({
|
|
499
|
+
type: 'CART_ADD_ITEM',
|
|
500
|
+
payload: {
|
|
501
|
+
cartId,
|
|
502
|
+
sku: product.sku,
|
|
503
|
+
name: product.name,
|
|
504
|
+
pricing: product.price,
|
|
505
|
+
priceTotal: productPrice.final_price.value,
|
|
506
|
+
currencyCode: productPrice.final_price.currency,
|
|
507
|
+
discountAmount: productPrice.discount.amount_off,
|
|
508
|
+
selectedOptions: selectedOptionsLabels,
|
|
509
|
+
quantity
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
} catch {
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
[
|
|
518
|
+
addConfigurableProductToCart,
|
|
519
|
+
addProductToCart,
|
|
520
|
+
addSimpleProductToCart,
|
|
521
|
+
cartId,
|
|
522
|
+
dispatch,
|
|
523
|
+
hasDeprecatedOperationProp,
|
|
524
|
+
isSupportedProductType,
|
|
525
|
+
optionCodes,
|
|
526
|
+
optionSelections,
|
|
527
|
+
product,
|
|
528
|
+
productPrice,
|
|
529
|
+
productType,
|
|
530
|
+
selectedOptionsArray
|
|
531
|
+
]
|
|
532
|
+
);
|
|
533
|
+
|
|
534
|
+
const handleSelectionChange = useCallback(
|
|
535
|
+
(optionId, selection) => {
|
|
536
|
+
// We must create a new Map here so that React knows that the value
|
|
537
|
+
// of optionSelections has changed.
|
|
538
|
+
const nextOptionSelections = new Map([...optionSelections]);
|
|
539
|
+
nextOptionSelections.set(optionId, selection);
|
|
540
|
+
setOptionSelections(nextOptionSelections);
|
|
541
|
+
// Create a new Map to keep track of single selections with key as String
|
|
542
|
+
const nextSingleOptionSelection = new Map();
|
|
543
|
+
nextSingleOptionSelection.set(optionId, selection);
|
|
544
|
+
setSingleOptionSelection(nextSingleOptionSelection);
|
|
545
|
+
},
|
|
546
|
+
[optionSelections]
|
|
547
|
+
);
|
|
548
|
+
|
|
549
|
+
// Normalization object for product details we need for rendering.
|
|
550
|
+
const productDetails = {
|
|
551
|
+
description: product.description,
|
|
552
|
+
shortDescription: product.short_description,
|
|
553
|
+
name: product.name,
|
|
554
|
+
price: productPrice?.final_price,
|
|
555
|
+
price_range: product?.price_range,
|
|
556
|
+
sku: product.sku,
|
|
557
|
+
term_and_conditions: product.term_and_conditions,
|
|
558
|
+
shipping_policy: product.shipping_policy,
|
|
559
|
+
return_policy: product.return_policy,
|
|
560
|
+
preorder: product.preorder,
|
|
561
|
+
auction_data: product.auction_data
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
const sellerDetails = {
|
|
565
|
+
name: product.seller?.name,
|
|
566
|
+
url_key: product.seller?.url_key,
|
|
567
|
+
city: product.seller?.city,
|
|
568
|
+
country: product.seller?.country
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
const derivedErrorMessage = useMemo(
|
|
572
|
+
() =>
|
|
573
|
+
deriveErrorMessage([
|
|
574
|
+
errorAddingSimpleProduct,
|
|
575
|
+
errorAddingConfigurableProduct,
|
|
576
|
+
errorAddingProductToCart,
|
|
577
|
+
...(addToCartResponseData?.addProductsToCart?.user_errors || [])
|
|
578
|
+
]),
|
|
579
|
+
[
|
|
580
|
+
errorAddingConfigurableProduct,
|
|
581
|
+
errorAddingProductToCart,
|
|
582
|
+
errorAddingSimpleProduct,
|
|
583
|
+
addToCartResponseData
|
|
584
|
+
]
|
|
585
|
+
);
|
|
586
|
+
|
|
587
|
+
const wishlistItemOptions = useMemo(() => {
|
|
588
|
+
const options = {
|
|
589
|
+
quantity: 1,
|
|
590
|
+
sku: product.sku
|
|
591
|
+
};
|
|
592
|
+
|
|
593
|
+
if (productType === 'ConfigurableProduct') {
|
|
594
|
+
options.selected_options = selectedOptionsArray;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
return options;
|
|
598
|
+
}, [product, productType, selectedOptionsArray]);
|
|
599
|
+
|
|
600
|
+
const wishlistButtonProps = {
|
|
601
|
+
buttonText: isSelected =>
|
|
602
|
+
isSelected
|
|
603
|
+
? formatMessage({
|
|
604
|
+
id: 'wishlistButton.addedText',
|
|
605
|
+
defaultMessage: 'Added to Favorites'
|
|
606
|
+
})
|
|
607
|
+
: formatMessage({
|
|
608
|
+
id: 'wishlistButton.addText',
|
|
609
|
+
defaultMessage: 'Add to Favorites'
|
|
610
|
+
}),
|
|
611
|
+
item: wishlistItemOptions,
|
|
612
|
+
storeConfig: storeConfigData ? storeConfigData.storeConfig : {}
|
|
613
|
+
};
|
|
614
|
+
|
|
615
|
+
return {
|
|
616
|
+
breadcrumbCategoryId,
|
|
617
|
+
errorMessage: derivedErrorMessage,
|
|
618
|
+
handleAddToCart,
|
|
619
|
+
handleSelectionChange,
|
|
620
|
+
isOutOfStock,
|
|
621
|
+
isEverythingOutOfStock,
|
|
622
|
+
outOfStockVariants,
|
|
623
|
+
isAddToCartDisabled:
|
|
624
|
+
isOutOfStock ||
|
|
625
|
+
isEverythingOutOfStock ||
|
|
626
|
+
isMissingOptions ||
|
|
627
|
+
isAddConfigurableLoading ||
|
|
628
|
+
isAddSimpleLoading ||
|
|
629
|
+
isAddProductLoading,
|
|
630
|
+
isSupportedProductType,
|
|
631
|
+
mediaGalleryEntries,
|
|
632
|
+
shouldShowWishlistButton:
|
|
633
|
+
isSignedIn &&
|
|
634
|
+
storeConfigData &&
|
|
635
|
+
!!storeConfigData.storeConfig.magento_wishlist_general_is_enabled,
|
|
636
|
+
productDetails,
|
|
637
|
+
customAttributes,
|
|
638
|
+
wishlistButtonProps,
|
|
639
|
+
wishlistItemOptions,
|
|
640
|
+
sellerDetails
|
|
641
|
+
};
|
|
642
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
|
|
3
|
+
import { CategoryFragment, ProductsFragment } from './categoryFragments.gql';
|
|
4
|
+
|
|
5
|
+
export const GET_CATEGORY = gql`
|
|
6
|
+
query GetCategories(
|
|
7
|
+
$id: String!
|
|
8
|
+
$pageSize: Int!
|
|
9
|
+
$currentPage: Int!
|
|
10
|
+
$filters: ProductAttributeFilterInput!
|
|
11
|
+
$sort: ProductAttributeSortInput
|
|
12
|
+
) {
|
|
13
|
+
categories(filters: { category_uid: { in: [$id] } }) {
|
|
14
|
+
# eslint-disable-next-line @graphql-eslint/require-id-when-available
|
|
15
|
+
items {
|
|
16
|
+
uid
|
|
17
|
+
...CategoryFragment
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
products(
|
|
21
|
+
pageSize: $pageSize
|
|
22
|
+
currentPage: $currentPage
|
|
23
|
+
filter: $filters
|
|
24
|
+
sort: $sort
|
|
25
|
+
) {
|
|
26
|
+
...ProductsFragment
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
${CategoryFragment}
|
|
30
|
+
${ProductsFragment}
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
export const GET_FILTER_INPUTS = gql`
|
|
34
|
+
query GetFilterInputsForCategory {
|
|
35
|
+
__type(name: "ProductAttributeFilterInput") {
|
|
36
|
+
inputFields {
|
|
37
|
+
name
|
|
38
|
+
type {
|
|
39
|
+
name
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
export default {
|
|
47
|
+
getCategoryQuery: GET_CATEGORY,
|
|
48
|
+
getFilterInputsQuery: GET_FILTER_INPUTS
|
|
49
|
+
};
|