@sentecacommerce-theme/lib 0.13.5-alpha.5 → 0.13.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.
- package/LICENSE.md +11 -0
- package/dist/cjs/GDPR/api/index.js +3 -6
- package/dist/cjs/GDPR/api/queries/index.js +3 -6
- package/dist/cjs/GDPR/api/queries/useConfirmConsentQuery.js +1 -2
- package/dist/cjs/GDPR/api/ssr/index.js +2 -4
- package/dist/cjs/GDPR/components/CookiesTable.js +2 -4
- package/dist/cjs/GDPR/components/index.js +2 -4
- package/dist/cjs/GDPR/hooks/index.js +3 -6
- package/dist/cjs/GDPR/hooks/useCookies.js +37 -37
- package/dist/cjs/GDPR/index.js +3 -6
- package/dist/cjs/analytics/Pixel/hooks/index.js +39 -6
- package/dist/cjs/analytics/Pixel/hooks/usePixelFinishOrder.js +27 -0
- package/dist/cjs/analytics/Pixel/hooks/usePixelProductClick.js +3 -8
- package/dist/cjs/analytics/Pixel/hooks/usePixelProductDetails.js +20 -5
- package/dist/cjs/analytics/Pixel/hooks/usePixelProductsImpression.js +61 -35
- package/dist/cjs/analytics/Pixel/hooks/usePixelViewBasket.js +24 -0
- package/dist/cjs/analytics/Pixel/hooks/usePixelViewCategory.js +29 -0
- package/dist/cjs/analytics/Pixel/index.js +3 -6
- package/dist/cjs/analytics/Pixel/mainScript.js +258 -99
- package/dist/cjs/analytics/Pixel/minifiedPixel.js +1 -1
- package/dist/cjs/analytics/Pixel/usePixel.js +7 -2
- package/dist/cjs/analytics/Pixel/utils.js +17 -0
- package/dist/cjs/analytics/Releva/api/index.js +2 -4
- package/dist/cjs/analytics/Releva/api/query/index.js +2 -4
- package/dist/cjs/analytics/Releva/api/query/useRelevaQuery.js +1 -0
- package/dist/cjs/analytics/Releva/hooks/index.js +3 -6
- package/dist/cjs/analytics/Releva/hooks/useRelevaData.js +20 -6
- package/dist/cjs/analytics/Releva/index.js +3 -6
- package/dist/cjs/analytics/Releva/types.js +23 -25
- package/dist/cjs/analytics/Releva/useReleva.js +21 -7
- package/dist/cjs/analytics/Releva/utils.js +2 -4
- package/dist/cjs/analytics/addToCart.js +0 -1
- package/dist/cjs/analytics/initiateCheckout.js +0 -1
- package/dist/cjs/analytics/viewContent.js +2 -2
- package/dist/cjs/api/addressesApi/index.js +10 -11
- package/dist/cjs/api/brandsApi/index.js +38 -33
- package/dist/cjs/api/catalogApi/index.js +157 -160
- package/dist/cjs/api/categoriesApi/index.js +38 -33
- package/dist/cjs/api/citiesApi/index.js +24 -19
- package/dist/cjs/api/companiesApi/index.js +12 -15
- package/dist/cjs/api/consentsApi/index.js +3 -6
- package/dist/cjs/api/getSDKConfig.js +14 -23
- package/dist/cjs/api/myCartApi/index.js +179 -137
- package/dist/cjs/api/myOrdersApi/index.js +56 -15
- package/dist/cjs/api/myPaymentsBoricaApi/index.js +23 -18
- package/dist/cjs/api/myShippingsEcontApi/index.js +150 -125
- package/dist/cjs/api/myShippingsEvropatApi/index.js +60 -50
- package/dist/cjs/api/myShippingsPickupFromStoreAPI/index.js +7 -7
- package/dist/cjs/api/myShippingsSpeedyApi/index.js +150 -125
- package/dist/cjs/api/notificationsApi/index.js +5 -5
- package/dist/cjs/api/pagesApi/index.js +4 -4
- package/dist/cjs/api/productsApi/index.js +49 -46
- package/dist/cjs/api/searchHistoryApi/index.js +36 -26
- package/dist/cjs/api/usersApi/index.js +2 -3
- package/dist/cjs/api/viewsApi/index.js +37 -32
- package/dist/cjs/api/vouchersApi/index.js +4 -4
- package/dist/cjs/api/walletApi/index.js +3 -6
- package/dist/cjs/api/wishlistApi/index.js +17 -13
- package/dist/cjs/api/wishlistApi/utils/index.js +2 -4
- package/dist/cjs/api.v2/core/checkout/index.js +3 -6
- package/dist/cjs/api.v2/core/checkout/payments/index.js +3 -6
- package/dist/cjs/api.v2/core/checkout/payments/useSetMerchantPaymentMethod.js +1 -1
- package/dist/cjs/api.v2/core/checkout/payments/useSetPaymentMethod.js +19 -4
- package/dist/cjs/api.v2/core/checkout/shippings/index.js +3 -6
- package/dist/cjs/api.v2/core/checkout/shippings/mutations/index.js +2 -4
- package/dist/cjs/api.v2/core/checkout/shippings/mutations/useMutateNomenclature.js +19 -14
- package/dist/cjs/api.v2/core/checkout/shippings/queries/index.js +3 -6
- package/dist/cjs/api.v2/core/checkout/shippings/queries/useFindNomenclatureElement.js +67 -56
- package/dist/cjs/api.v2/core/checkout/types.js +6 -8
- package/dist/cjs/api.v2/core/index.js +3 -6
- package/dist/cjs/api.v2/core/misc/index.js +3 -6
- package/dist/cjs/api.v2/core/misc/promo-code/index.js +3 -6
- package/dist/cjs/api.v2/core/misc/promo-code/mutations/usePromoCodeMutation.js +22 -17
- package/dist/cjs/api.v2/core/product/index.js +2 -4
- package/dist/cjs/api.v2/core/product/useSubscribeForSkuMutation.js +19 -4
- package/dist/cjs/api.v2/index.js +2 -4
- package/dist/cjs/basket/api/index.js +35 -0
- package/dist/cjs/basket/api/mutations/index.js +49 -0
- package/dist/cjs/basket/api/mutations/useChangeGiftVariant.js +116 -0
- package/dist/cjs/basket/api/mutations/useReplaceBasketMutation.js +62 -0
- package/dist/cjs/basket/hooks/index.js +61 -0
- package/dist/cjs/basket/hooks/useBasketCrossSaleItems.js +97 -0
- package/dist/cjs/basket/hooks/useChangeGiftVariant.js +16 -0
- package/dist/cjs/basket/hooks/useReplaceBasket.js +10 -0
- package/dist/cjs/basket/index.js +35 -0
- package/dist/cjs/brands/api/index.js +3 -6
- package/dist/cjs/brands/api/queries/index.js +3 -6
- package/dist/cjs/brands/api/queries/keys.js +3 -4
- package/dist/cjs/brands/api/queries/useAllBrandsQuery.js +91 -76
- package/dist/cjs/brands/api/ssr/index.js +3 -6
- package/dist/cjs/brands/hooks/index.js +2 -4
- package/dist/cjs/brands/index.js +3 -6
- package/dist/cjs/build/api/index.js +2 -4
- package/dist/cjs/build/api/query/fetchStore.js +25 -20
- package/dist/cjs/build/api/query/index.js +2 -4
- package/dist/cjs/build/index.js +2 -4
- package/dist/cjs/checkout/api/index.js +3 -6
- package/dist/cjs/checkout/api/keys.js +16 -4
- package/dist/cjs/checkout/api/queries/index.js +28 -4
- package/dist/cjs/checkout/api/queries/useBnpCalculateForCartQuery.js +60 -0
- package/dist/cjs/checkout/api/queries/useUniCreditCalculateForCartQuery.js +60 -0
- package/dist/cjs/checkout/contexts/BoricaResponseContext.js +3 -6
- package/dist/cjs/checkout/contexts/PaypalResponseContext.js +3 -6
- package/dist/cjs/checkout/contexts/UniCreditResponseContext.js +40 -0
- package/dist/cjs/checkout/contexts/index.js +15 -6
- package/dist/cjs/checkout/hooks/index.js +28 -4
- package/dist/cjs/checkout/hooks/useBnpCalculateForCart.js +114 -0
- package/dist/cjs/checkout/hooks/useUniCreditCalculateForCart.js +93 -0
- package/dist/cjs/checkout/index.js +3 -6
- package/dist/cjs/checkout/ssr/capturePaypalOrder.js +16 -11
- package/dist/cjs/checkout/ssr/captureUniCreditOrder.js +57 -0
- package/dist/cjs/checkout/ssr/index.js +15 -6
- package/dist/cjs/checkout/ssr/verifyBoricaResponse.js +24 -19
- package/dist/cjs/cms/api/index.js +3 -6
- package/dist/cjs/cms/api/mutations/index.js +3 -6
- package/dist/cjs/cms/api/mutations/useCMSFoldersCreateMutation.js +31 -29
- package/dist/cjs/cms/api/mutations/useCMSMediaDeleteAssetsMutation.js +19 -14
- package/dist/cjs/cms/api/mutations/useCMSMediaUploadAssetsMutation.js +21 -35
- package/dist/cjs/cms/api/queries/index.js +3 -6
- package/dist/cjs/cms/api/queries/keys.js +21 -14
- package/dist/cjs/cms/api/queries/useCMSContentListQuery.js +4 -7
- package/dist/cjs/cms/api/queries/useCMSMediaQuery.js +1 -2
- package/dist/cjs/cms/api/queries/useInjectedContentQuery.js +5 -7
- package/dist/cjs/cms/api/utils/index.js +2 -4
- package/dist/cjs/cms/components/RenderInjectedContent.js +5 -11
- package/dist/cjs/cms/components/index.js +2 -4
- package/dist/cjs/cms/hooks/index.js +3 -6
- package/dist/cjs/cms/hooks/useCmsContent.js +4 -8
- package/dist/cjs/cms/hooks/useCmsContentList.js +7 -12
- package/dist/cjs/cms/hooks/useCmsFolders.js +0 -6
- package/dist/cjs/cms/hooks/useCmsMedia.js +0 -6
- package/dist/cjs/cms/hooks/useCmsMediaDeleteAssets.js +0 -6
- package/dist/cjs/cms/hooks/useCmsMediaUploadAssets.js +0 -6
- package/dist/cjs/cms/hooks/useContentCategoriesMap.js +6 -13
- package/dist/cjs/cms/hooks/useCreateCmsFolders.js +0 -6
- package/dist/cjs/cms/hooks/useInjectedContentContext.js +6 -12
- package/dist/cjs/cms/hooks/useListingInjectedContent.js +1 -2
- package/dist/cjs/cms/index.js +3 -6
- package/dist/cjs/cms/ssr/fetchPagePaths.js +3 -3
- package/dist/cjs/cms/ssr/index.js +3 -6
- package/dist/cjs/cms/ssr/prefetchCMSPage.js +34 -29
- package/dist/cjs/cms/ssr/prefetchCmsContent.js +48 -43
- package/dist/cjs/cms/ssr/prefetchCmsContentList.js +52 -50
- package/dist/cjs/cms/utils/index.js +3 -6
- package/dist/cjs/components/AnalyticsScripts/index.js +24 -10
- package/dist/cjs/components/ClickOutside/index.js +2 -4
- package/dist/cjs/components/Drawer/index.js +6 -9
- package/dist/cjs/components/FadeIn/index.js +26 -15
- package/dist/cjs/components/FocusTrap/index.js +2 -4
- package/dist/cjs/components/GoogleOneTap/index.js +40 -22
- package/dist/cjs/components/Html/index.js +3 -5
- package/dist/cjs/components/LazyResponsiveImage/index.js +25 -16
- package/dist/cjs/components/Link/index.js +5 -10
- package/dist/cjs/components/Modal/index.js +2 -4
- package/dist/cjs/components/OverflowEllipsis/index.js +2 -4
- package/dist/cjs/components/Portal/index.js +1 -1
- package/dist/cjs/components/ProgressBar/index.js +21 -8
- package/dist/cjs/components/index.js +3 -6
- package/dist/cjs/config/SentecaProvider.js +7 -12
- package/dist/cjs/config/index.js +2 -4
- package/dist/cjs/contexts/CheckoutForm/Components/BoricaRedirect/index.js +21 -8
- package/dist/cjs/contexts/CheckoutForm/Components/CheckoutCustomState/index.js +24 -14
- package/dist/cjs/contexts/CheckoutForm/Components/UniCreditRedirect/index.js +87 -0
- package/dist/cjs/contexts/CheckoutForm/Components/index.js +15 -6
- package/dist/cjs/contexts/CheckoutForm/hooks/index.js +3 -6
- package/dist/cjs/contexts/CheckoutForm/hooks/useBilling/index.js +52 -31
- package/dist/cjs/contexts/CheckoutForm/hooks/usePayment/index.js +25 -6
- package/dist/cjs/contexts/CheckoutForm/hooks/useSavedBillingList/index.js +2 -4
- package/dist/cjs/contexts/CheckoutForm/hooks/useSavedShippingList/index.js +20 -15
- package/dist/cjs/contexts/CheckoutForm/hooks/useShipping/index.js +102 -90
- package/dist/cjs/contexts/CheckoutForm/hooks/useShippingInitialData/index.js +3 -7
- package/dist/cjs/contexts/CheckoutForm/index.js +109 -65
- package/dist/cjs/contexts/CheckoutForm/utils/index.js +3 -6
- package/dist/cjs/contexts/CheckoutForm/utils/updatedNestedObjectProps.js +16 -3
- package/dist/cjs/contexts/CheckoutForm/utils/validateBillingAddress.js +6 -14
- package/dist/cjs/contexts/CheckoutForm/utils/validateShipping.js +12 -23
- package/dist/cjs/contexts/CustomProductProvider/index.js +24 -14
- package/dist/cjs/contexts/Strings.js +34 -37
- package/dist/cjs/hooks/addresses-hooks/index.js +3 -6
- package/dist/cjs/hooks/addresses-hooks/useAddressForm/index.js +40 -52
- package/dist/cjs/hooks/basket-hooks/index.js +3 -6
- package/dist/cjs/hooks/basket-hooks/useBasket/index.js +19 -4
- package/dist/cjs/hooks/basket-hooks/useBasketCustom/index.js +19 -4
- package/dist/cjs/hooks/basket-hooks/useBasketItemList/index.js +5 -10
- package/dist/cjs/hooks/basket-hooks/useBasketItemWithErrorList/index.js +4 -8
- package/dist/cjs/hooks/basket-hooks/useBasketLineItem/index.js +19 -4
- package/dist/cjs/hooks/basket-hooks/useBasketLineItem/utils/index.js +4 -9
- package/dist/cjs/hooks/checkout-hooks/index.js +3 -6
- package/dist/cjs/hooks/checkout-hooks/useAllStockLocations.js +5 -10
- package/dist/cjs/hooks/checkout-hooks/useShippingCourierMethods.js +41 -36
- package/dist/cjs/hooks/cities-hooks/index.js +2 -4
- package/dist/cjs/hooks/cities-hooks/useCities/index.js +19 -4
- package/dist/cjs/hooks/companies-hooks/index.js +3 -6
- package/dist/cjs/hooks/error-handling/index.js +2 -4
- package/dist/cjs/hooks/error-handling/useErrors/index.js +4 -9
- package/dist/cjs/hooks/labels/index.js +3 -6
- package/dist/cjs/hooks/labels/useGlobalLabels/index.js +1 -2
- package/dist/cjs/hooks/order-hooks/api/hooks/index.js +2 -4
- package/dist/cjs/hooks/order-hooks/api/index.js +3 -6
- package/dist/cjs/hooks/order-hooks/api/mutations/index.js +2 -4
- package/dist/cjs/hooks/order-hooks/api/queries/index.js +2 -4
- package/dist/cjs/hooks/order-hooks/api/queries/useOrderGetPaymentMethodQuery.js +2 -4
- package/dist/cjs/hooks/order-hooks/index.js +3 -6
- package/dist/cjs/hooks/order-hooks/useGenericCourierAddress/index.js +103 -68
- package/dist/cjs/hooks/order-hooks/useOrder/index.js +3 -16
- package/dist/cjs/hooks/order-hooks/useOrderGetPaymentMethod/index.js +0 -6
- package/dist/cjs/hooks/order-hooks/useOrderPaymentMethods/index.js +2 -4
- package/dist/cjs/hooks/order-hooks/useOrdersList/index.js +2 -4
- package/dist/cjs/hooks/order-hooks/usePayOrder/index.js +66 -58
- package/dist/cjs/hooks/order-hooks/useUpdateOrderPaymentMethod/index.js +20 -7
- package/dist/cjs/hooks/profile-hooks/index.js +3 -6
- package/dist/cjs/hooks/subscriptions-hooks/index.js +3 -6
- package/dist/cjs/hooks/subscriptions-hooks/useAcceptOnRegister/index.js +21 -8
- package/dist/cjs/hooks/subscriptions-hooks/useAllSubscriptions/index.js +32 -33
- package/dist/cjs/hooks/subscriptions-hooks/useSubscribeForProduct/index.js +20 -6
- package/dist/cjs/hooks/ui-hooks/index.js +3 -6
- package/dist/cjs/hooks/ui-hooks/useAccordion/index.js +19 -5
- package/dist/cjs/hooks/ui-hooks/useBoolean/index.js +21 -6
- package/dist/cjs/hooks/ui-hooks/useCallbackRef/index.js +21 -15
- package/dist/cjs/hooks/ui-hooks/useClickOutside/index.js +2 -2
- package/dist/cjs/hooks/ui-hooks/useIsDesktop/index.js +2 -2
- package/dist/cjs/hooks/ui-hooks/useIsIos/index.js +19 -4
- package/dist/cjs/hooks/ui-hooks/useMenuAim/index.js +19 -4
- package/dist/cjs/hooks/ui-hooks/useMergeRefs/index.js +2 -4
- package/dist/cjs/hooks/ui-hooks/usePagination/index.js +19 -14
- package/dist/cjs/hooks/ui-hooks/useScrollDirection/index.js +21 -7
- package/dist/cjs/hooks/ui-hooks/useScrollTo/index.js +23 -9
- package/dist/cjs/hooks/ui-hooks/useSlideshow/index.js +21 -6
- package/dist/cjs/hooks/ui-hooks/useToggleNavbarOnScroll/index.js +3 -3
- package/dist/cjs/hooks/ui-hooks/useUI/index.js +34 -35
- package/dist/cjs/hooks/ui-hooks/useWindowDimensions/index.js +19 -4
- package/dist/cjs/hooks/useAddressList/index.js +2 -3
- package/dist/cjs/hooks/useAggregateResult/index.js +7 -5
- package/dist/cjs/hooks/useAllSelectedFilters/index.js +3 -3
- package/dist/cjs/hooks/useAvailability/index.js +28 -14
- package/dist/cjs/hooks/useCarousel/component/index.js +12 -17
- package/dist/cjs/hooks/useCarousel/helpers/eventStore.js +2 -2
- package/dist/cjs/hooks/useCarousel/index.js +20 -6
- package/dist/cjs/hooks/useCatalogResult/index.js +2 -2
- package/dist/cjs/hooks/useCategoryTree/index.js +1 -2
- package/dist/cjs/hooks/useCheckoutBillingAddress/index.js +96 -7
- package/dist/cjs/hooks/useCheckoutDelivery/index.js +71 -58
- package/dist/cjs/hooks/useCheckoutDiscountCode/index.js +19 -4
- package/dist/cjs/hooks/useCheckoutPickupFromStore/index.js +21 -8
- package/dist/cjs/hooks/useCheckoutShippingAddress/index.js +19 -4
- package/dist/cjs/hooks/useCheckoutShippingModule/index.js +4 -6
- package/dist/cjs/hooks/useCheckoutSubmit/index.js +97 -58
- package/dist/cjs/hooks/useClearAllFilters/index.js +4 -4
- package/dist/cjs/hooks/useContactForm/index.js +8 -4
- package/dist/cjs/hooks/useCopyToClipboard/index.js +20 -4
- package/dist/cjs/hooks/useForceUpdate/index.js +19 -4
- package/dist/cjs/hooks/useLineItem/LineItemContext.js +86 -0
- package/dist/cjs/hooks/useLineItem/index.js +39 -23
- package/dist/cjs/hooks/useLocalRating/index.js +23 -10
- package/dist/cjs/hooks/usePrefetchProduct/index.js +19 -4
- package/dist/cjs/hooks/usePrice/index.js +1 -1
- package/dist/cjs/hooks/useProduct/index.js +21 -252
- package/dist/cjs/hooks/useProduct/utils/index.js +87 -56
- package/dist/cjs/hooks/useProductVariants/index.js +334 -0
- package/dist/cjs/hooks/useProductVariants/types.js +3 -0
- package/dist/cjs/hooks/useProgressBar/helpers/index.js +3 -6
- package/dist/cjs/hooks/useProgressBar/hooks/index.js +3 -6
- package/dist/cjs/hooks/useProgressBar/hooks/useGetSetState.js +5 -31
- package/dist/cjs/hooks/useProgressBar/hooks/useUpdate.js +21 -8
- package/dist/cjs/hooks/useProgressBar/index.js +23 -11
- package/dist/cjs/hooks/usePromoCode/index.js +20 -6
- package/dist/cjs/hooks/useSearchbar/index.js +109 -74
- package/dist/cjs/hooks/useSelectedFilters/index.js +3 -3
- package/dist/cjs/hooks/useShippingAddress/index.js +2 -4
- package/dist/cjs/hooks/useSizesReducer/index.js +24 -12
- package/dist/cjs/hooks/useVouchers/index.js +2 -3
- package/dist/cjs/hooks/useWallet/index.js +2 -4
- package/dist/cjs/hooks/useZoom/index.js +23 -10
- package/dist/cjs/hooks/user-hooks/index.js +3 -6
- package/dist/cjs/hooks/user-hooks/useSubscribeToNewsletter/index.js +49 -7
- package/dist/cjs/hooks/wishlist-hooks/index.js +3 -6
- package/dist/cjs/hooks/wishlist-hooks/useWishlist/index.js +19 -4
- package/dist/cjs/hooks/wishlist-hooks/useWishlistItem/index.js +59 -21
- package/dist/cjs/index.js +31 -22
- package/dist/cjs/listing/api/index.js +3 -6
- package/dist/cjs/listing/api/keys.js +4 -5
- package/dist/cjs/listing/api/queries/useAggregateQuery.js +50 -18
- package/dist/cjs/listing/api/queries/useInfiniteListing.js +6 -8
- package/dist/cjs/listing/api/queries/useLabelsQuery.js +19 -10
- package/dist/cjs/listing/api/queries/useListingQuery.js +43 -29
- package/dist/cjs/listing/api/queries/usePredicate.js +38 -26
- package/dist/cjs/listing/components/BasicListingSEO.js +24 -8
- package/dist/cjs/listing/components/index.js +2 -4
- package/dist/cjs/listing/hooks/index.js +3 -6
- package/dist/cjs/listing/hooks/useListingAlias.js +2 -4
- package/dist/cjs/listing/hooks/useListingBreadcrumbs.js +40 -21
- package/dist/cjs/listing/hooks/useListingCategories.js +27 -21
- package/dist/cjs/listing/hooks/useListingConfig.js +6 -9
- package/dist/cjs/listing/hooks/useListingFilters.js +52 -35
- package/dist/cjs/listing/hooks/useListingItems.js +2 -2
- package/dist/cjs/listing/hooks/useListingMeta.js +72 -52
- package/dist/cjs/listing/hooks/useListingPagination.js +6 -10
- package/dist/cjs/listing/hooks/useListingSlug.js +3 -1
- package/dist/cjs/listing/hooks/useSlideFilter.js +50 -11
- package/dist/cjs/listing/hooks/useSort.js +47 -19
- package/dist/cjs/listing/hooks/utils.js +2 -1
- package/dist/cjs/listing/index.js +3 -6
- package/dist/cjs/listing/ssr/index.js +3 -6
- package/dist/cjs/listing/ssr/prefetchCategories.js +6 -7
- package/dist/cjs/listing/ssr/prefetchListing.js +9 -9
- package/dist/cjs/listing/ssr/prefetchPredicate.js +4 -4
- package/dist/cjs/listing/types.js +19 -17
- package/dist/cjs/listing/utils/buildCategoryQuery.js +46 -23
- package/dist/cjs/listing/utils/buildFilterQuery.js +30 -27
- package/dist/cjs/listing/utils/calculateOffset.js +1 -1
- package/dist/cjs/listing/utils/extendFilter.js +19 -4
- package/dist/cjs/listing/utils/getListingAlias.js +24 -12
- package/dist/cjs/listing/utils/getListingPageType.js +4 -5
- package/dist/cjs/listing/utils/index.js +3 -6
- package/dist/cjs/navigation/components/SearchBox/Components/Container/index.js +1 -1
- package/dist/cjs/navigation/components/SearchBox/Components/EmptyBox/index.js +21 -20
- package/dist/cjs/navigation/components/SearchBox/Components/IconArrowRight/index.js +2 -4
- package/dist/cjs/navigation/components/SearchBox/Components/PopularSearches/index.js +1 -1
- package/dist/cjs/navigation/components/SearchBox/Components/Products/Components/ProductCard/index.js +2 -3
- package/dist/cjs/navigation/components/SearchBox/Components/Products/Components/index.js +2 -4
- package/dist/cjs/navigation/components/SearchBox/Components/Products/index.js +2 -2
- package/dist/cjs/navigation/components/SearchBox/Components/RecentSearches/index.js +1 -1
- package/dist/cjs/navigation/components/SearchBox/Components/Spinner/index.js +2 -4
- package/dist/cjs/navigation/components/SearchBox/Components/Suggestions/Components/index.js +2 -4
- package/dist/cjs/navigation/components/SearchBox/Components/Suggestions/Utils/ScrollView.js +4 -8
- package/dist/cjs/navigation/components/SearchBox/Components/Suggestions/Utils/index.js +3 -6
- package/dist/cjs/navigation/components/SearchBox/Components/index.js +3 -6
- package/dist/cjs/navigation/components/SearchBox/index.js +18 -21
- package/dist/cjs/navigation/components/index.js +2 -4
- package/dist/cjs/navigation/hooks/index.js +3 -6
- package/dist/cjs/navigation/hooks/search-history/index.js +3 -6
- package/dist/cjs/navigation/index.js +3 -6
- package/dist/cjs/navigation/keys.js +3 -4
- package/dist/cjs/navigation/mutations/index.js +2 -4
- package/dist/cjs/navigation/mutations/useSearchHistoryMutation.js +20 -16
- package/dist/cjs/navigation/queries/index.js +3 -6
- package/dist/cjs/navigation/ssr/index.js +2 -4
- package/dist/cjs/navigation/types.js +3 -4
- package/dist/cjs/order/api/index.js +15 -6
- package/dist/cjs/order/api/mutations/index.js +16 -4
- package/dist/cjs/order/api/mutations/useUpdateOrderCustomFieldMutation.js +15 -0
- package/dist/cjs/order/api/queries/index.js +2 -4
- package/dist/cjs/order/api/queries/prefetchOrder.js +24 -19
- package/dist/cjs/{user/types/index.js → order/api/utils/getOrderById.js} +2 -2
- package/dist/cjs/order/api/utils/index.js +35 -0
- package/dist/cjs/order/hooks/index.js +16 -4
- package/dist/cjs/order/hooks/useUpdateOrderCustomField.js +9 -0
- package/dist/cjs/order/index.js +3 -6
- package/dist/cjs/postcss/index.js +3 -6
- package/dist/cjs/postcss/tailwind/buttons-plugin.js +20 -16
- package/dist/cjs/postcss/tailwind/default-plugin.js +2 -4
- package/dist/cjs/postcss/tailwind/fonts-plugin.js +21 -18
- package/dist/cjs/postcss/tailwind/forms-plugin.js +6 -9
- package/dist/cjs/postcss/tailwind/index.js +3 -6
- package/dist/cjs/postcss/tailwind/utils.js +4 -6
- package/dist/cjs/postcss/types.js +6 -8
- package/dist/cjs/product/api/index.js +2 -4
- package/dist/cjs/product/api/keys.js +18 -0
- package/dist/cjs/product/api/queries/index.js +49 -0
- package/dist/cjs/product/api/queries/useBnpOffersQuery.js +64 -0
- package/dist/cjs/product/api/queries/useUniCreditOffersQuery.js +63 -0
- package/dist/cjs/product/api/ssr/index.js +44 -40
- package/dist/cjs/product/hooks/index.js +49 -0
- package/dist/cjs/product/hooks/useBnpOffers.js +86 -0
- package/dist/cjs/product/hooks/useUniCreditOffers.js +107 -0
- package/dist/cjs/product/index.js +16 -4
- package/dist/cjs/seo/api/index.js +2 -4
- package/dist/cjs/seo/api/ssr/fetchRedirectByFrom.js +19 -14
- package/dist/cjs/seo/api/ssr/fetchSitemaps.js +22 -17
- package/dist/cjs/seo/api/ssr/getCanonicalUrl.js +19 -4
- package/dist/cjs/seo/api/ssr/index.js +3 -6
- package/dist/cjs/seo/components/GlobalSEO/index.js +3 -3
- package/dist/cjs/seo/components/HiddenBreadcrumb/index.js +1 -2
- package/dist/cjs/seo/components/ProductSEO/index.js +3 -5
- package/dist/cjs/seo/components/TranslationsMeta/index.js +59 -0
- package/dist/cjs/seo/components/index.js +15 -6
- package/dist/cjs/seo/hooks/index.js +16 -4
- package/dist/cjs/seo/hooks/useSEOBreadcrumb.js +19 -13
- package/dist/cjs/seo/hooks/useSeoTranslations.js +90 -0
- package/dist/cjs/seo/index.js +3 -6
- package/dist/cjs/seo/utils/handleRobots.js +4 -4
- package/dist/cjs/seo/utils/index.js +3 -6
- package/dist/cjs/ssr/emptyBasketGuard.js +2 -2
- package/dist/cjs/ssr/index.js +3 -6
- package/dist/cjs/ui/components/GridStyles.js +36 -0
- package/dist/cjs/ui/components/LazyImage.js +6 -12
- package/dist/cjs/ui/components/RangeSliderInput.js +38 -15
- package/dist/cjs/ui/components/index.js +15 -6
- package/dist/cjs/ui/hooks/index.js +35 -0
- package/dist/cjs/ui/hooks/useToasts.js +165 -0
- package/dist/cjs/ui/index.js +16 -4
- package/dist/cjs/ui/toastUtils/ErrorIcon.js +25 -0
- package/dist/cjs/ui/toastUtils/InfoIcon.js +25 -0
- package/dist/cjs/ui/toastUtils/SuccessIcon.js +25 -0
- package/dist/cjs/ui/toastUtils/WarningIcon.js +25 -0
- package/dist/cjs/ui/toastUtils/index.js +85 -0
- package/dist/cjs/ui/toastUtils/utils.js +81 -0
- package/dist/cjs/user/api/index.js +3 -6
- package/dist/cjs/user/api/mutations/index.js +3 -6
- package/dist/cjs/user/api/mutations/useLoginMutation.js +2 -5
- package/dist/cjs/user/api/mutations/useLogoutMutation.js +3 -6
- package/dist/cjs/user/api/mutations/useRegisterMutation.js +24 -24
- package/dist/cjs/user/api/mutations/useRequestResetPasswordTokenMutation.js +1 -2
- package/dist/cjs/user/api/mutations/useResetPasswordMutation.js +1 -2
- package/dist/cjs/user/api/queries/index.js +16 -4
- package/dist/cjs/user/api/queries/useGetMyLoyaltyCardQuery.js +67 -0
- package/dist/cjs/user/api/queries/useIsAuthenticatedQuery.js +2 -4
- package/dist/cjs/user/api/utils/generateAnonymousToken.js +25 -21
- package/dist/cjs/user/api/utils/getUserToken.js +16 -0
- package/dist/cjs/user/api/utils/index.js +15 -6
- package/dist/cjs/user/api/utils/processLoginPayload.js +2 -2
- package/dist/cjs/user/hooks/index.js +27 -6
- package/dist/cjs/user/hooks/useConfirmEmail.js +20 -6
- package/dist/cjs/user/hooks/useGetMyLoyaltyCard.js +9 -0
- package/dist/cjs/user/hooks/useGetUserToken.js +15 -0
- package/dist/cjs/user/hooks/useLoginApple.js +2 -4
- package/dist/cjs/user/hooks/useLoginFacebook.js +2 -4
- package/dist/cjs/user/hooks/useLoginGoogle.js +2 -4
- package/dist/cjs/user/hooks/useRequestEmailConfirmation.js +20 -6
- package/dist/cjs/user/index.js +3 -18
- package/dist/cjs/utils/assetsToMap.js +3 -7
- package/dist/cjs/utils/createAggregateQuery.js +4 -6
- package/dist/cjs/utils/customFieldsToMap.js +3 -8
- package/dist/cjs/utils/generateQueryFromRouter.js +5 -12
- package/dist/cjs/utils/getLocaleFromPath.js +13 -0
- package/dist/cjs/utils/getPagination.js +5 -11
- package/dist/cjs/utils/getSelectedFilters.js +25 -11
- package/dist/cjs/utils/index.js +15 -6
- package/dist/cjs/utils/isColorBright.js +2 -2
- package/dist/cjs/utils/isTouchDevice.js +2 -1
- package/dist/cjs/utils/localStorage.js +7 -2
- package/dist/cjs/utils/queryObjToString.js +3 -7
- package/dist/cjs/utils/sortAncestors.js +18 -11
- package/dist/cjs/utils/tokens.js +19 -4
- package/dist/cjs/utils/validations.js +2 -2
- package/dist/cjs/webview/hooks/index.js +2 -4
- package/dist/cjs/webview/hooks/useIsInWebview.js +21 -6
- package/dist/cjs/webview/index.js +3 -6
- package/dist/cjs/webview/utils/index.js +3 -6
- package/dist/cjs/webview/utils/sendMessage.js +3 -4
- package/dist/cjs/wishlist/api/index.js +2 -4
- package/dist/cjs/wishlist/api/queries/index.js +3 -6
- package/dist/cjs/wishlist/api/queries/keys.js +3 -4
- package/dist/cjs/wishlist/api/queries/useWishlistItemsQuery.js +4 -7
- package/dist/cjs/wishlist/hooks/index.js +2 -4
- package/dist/cjs/wishlist/hooks/useWishlistItems.js +2 -3
- package/dist/cjs/wishlist/index.js +3 -6
- package/dist/esm/GDPR/api/queries/useConfirmConsentQuery.js +1 -2
- package/dist/esm/GDPR/components/CookiesTable.js +2 -4
- package/dist/esm/GDPR/hooks/useCookies.js +34 -33
- package/dist/esm/analytics/Pixel/hooks/index.js +3 -0
- package/dist/esm/analytics/Pixel/hooks/usePixelFinishOrder.js +22 -0
- package/dist/esm/analytics/Pixel/hooks/usePixelProductClick.js +4 -9
- package/dist/esm/analytics/Pixel/hooks/usePixelProductDetails.js +20 -5
- package/dist/esm/analytics/Pixel/hooks/usePixelProductsImpression.js +61 -35
- package/dist/esm/analytics/Pixel/hooks/usePixelViewBasket.js +19 -0
- package/dist/esm/analytics/Pixel/hooks/usePixelViewCategory.js +24 -0
- package/dist/esm/analytics/Pixel/mainScript.js +259 -99
- package/dist/esm/analytics/Pixel/minifiedPixel.js +1 -1
- package/dist/esm/analytics/Pixel/usePixel.js +7 -2
- package/dist/esm/analytics/Pixel/utils.js +12 -0
- package/dist/esm/analytics/Releva/api/query/useRelevaQuery.js +1 -0
- package/dist/esm/analytics/Releva/hooks/useRelevaData.js +20 -6
- package/dist/esm/analytics/Releva/types.js +21 -25
- package/dist/esm/analytics/Releva/useReleva.js +21 -7
- package/dist/esm/analytics/Releva/utils.js +2 -4
- package/dist/esm/analytics/addToCart.js +0 -1
- package/dist/esm/analytics/initiateCheckout.js +0 -1
- package/dist/esm/analytics/pageView.js +1 -1
- package/dist/esm/analytics/viewContent.js +2 -2
- package/dist/esm/api/addressesApi/index.js +10 -12
- package/dist/esm/api/brandsApi/index.js +37 -33
- package/dist/esm/api/catalogApi/index.js +156 -160
- package/dist/esm/api/categoriesApi/index.js +37 -33
- package/dist/esm/api/citiesApi/index.js +23 -19
- package/dist/esm/api/companiesApi/index.js +11 -15
- package/dist/esm/api/consentsApi/index.js +3 -6
- package/dist/esm/api/getSDKConfig.js +15 -24
- package/dist/esm/api/myCartApi/index.js +178 -137
- package/dist/esm/api/myOrdersApi/index.js +55 -15
- package/dist/esm/api/myPaymentsBoricaApi/index.js +22 -18
- package/dist/esm/api/myShippingsEcontApi/index.js +150 -125
- package/dist/esm/api/myShippingsEvropatApi/index.js +60 -50
- package/dist/esm/api/myShippingsPickupFromStoreAPI/index.js +6 -7
- package/dist/esm/api/myShippingsSpeedyApi/index.js +150 -125
- package/dist/esm/api/notificationsApi/index.js +4 -5
- package/dist/esm/api/pagesApi/index.js +3 -4
- package/dist/esm/api/productsApi/index.js +48 -46
- package/dist/esm/api/searchHistoryApi/index.js +35 -26
- package/dist/esm/api/usersApi/index.js +2 -3
- package/dist/esm/api/viewsApi/index.js +36 -32
- package/dist/esm/api/vouchersApi/index.js +3 -4
- package/dist/esm/api/walletApi/index.js +3 -6
- package/dist/esm/api/wishlistApi/index.js +17 -13
- package/dist/esm/api/wishlistApi/utils/index.js +2 -4
- package/dist/esm/api.v2/core/checkout/payments/useSetMerchantPaymentMethod.js +1 -1
- package/dist/esm/api.v2/core/checkout/payments/useSetPaymentMethod.js +19 -4
- package/dist/esm/api.v2/core/checkout/shippings/mutations/useMutateNomenclature.js +19 -14
- package/dist/esm/api.v2/core/checkout/shippings/queries/useFindNomenclatureElement.js +67 -56
- package/dist/esm/api.v2/core/checkout/types.js +4 -8
- package/dist/esm/api.v2/core/misc/promo-code/mutations/usePromoCodeMutation.js +22 -17
- package/dist/esm/api.v2/core/product/useSubscribeForSkuMutation.js +19 -4
- package/dist/esm/basket/api/index.js +1 -0
- package/dist/esm/basket/api/mutations/index.js +2 -0
- package/dist/esm/basket/api/mutations/useChangeGiftVariant.js +106 -0
- package/dist/esm/basket/api/mutations/useReplaceBasketMutation.js +52 -0
- package/dist/esm/basket/hooks/index.js +3 -0
- package/dist/esm/basket/hooks/useBasketCrossSaleItems.js +67 -0
- package/dist/esm/basket/hooks/useChangeGiftVariant.js +3 -0
- package/dist/esm/basket/hooks/useReplaceBasket.js +2 -0
- package/dist/esm/basket/index.js +1 -0
- package/dist/esm/brands/api/queries/keys.js +2 -4
- package/dist/esm/brands/api/queries/useAllBrandsQuery.js +91 -76
- package/dist/esm/build/api/query/fetchStore.js +25 -20
- package/dist/esm/checkout/api/keys.js +13 -3
- package/dist/esm/checkout/api/queries/index.js +2 -0
- package/dist/esm/checkout/api/queries/useBnpCalculateForCartQuery.js +50 -0
- package/dist/esm/checkout/api/queries/useUniCreditCalculateForCartQuery.js +50 -0
- package/dist/esm/checkout/contexts/BoricaResponseContext.js +1 -2
- package/dist/esm/checkout/contexts/PaypalResponseContext.js +1 -2
- package/dist/esm/checkout/contexts/UniCreditResponseContext.js +13 -0
- package/dist/esm/checkout/contexts/index.js +1 -0
- package/dist/esm/checkout/hooks/index.js +2 -0
- package/dist/esm/checkout/hooks/useBnpCalculateForCart.js +88 -0
- package/dist/esm/checkout/hooks/useUniCreditCalculateForCart.js +88 -0
- package/dist/esm/checkout/ssr/capturePaypalOrder.js +16 -11
- package/dist/esm/checkout/ssr/captureUniCreditOrder.js +47 -0
- package/dist/esm/checkout/ssr/index.js +1 -0
- package/dist/esm/checkout/ssr/verifyBoricaResponse.js +24 -19
- package/dist/esm/cms/api/mutations/useCMSFoldersCreateMutation.js +31 -29
- package/dist/esm/cms/api/mutations/useCMSMediaDeleteAssetsMutation.js +19 -14
- package/dist/esm/cms/api/mutations/useCMSMediaUploadAssetsMutation.js +22 -19
- package/dist/esm/cms/api/queries/keys.js +20 -14
- package/dist/esm/cms/api/queries/useCMSContentListQuery.js +4 -7
- package/dist/esm/cms/api/queries/useCMSMediaQuery.js +1 -2
- package/dist/esm/cms/api/queries/useInjectedContentQuery.js +4 -7
- package/dist/esm/cms/components/RenderInjectedContent.js +3 -7
- package/dist/esm/cms/hooks/useCmsContent.js +4 -8
- package/dist/esm/cms/hooks/useCmsContentList.js +7 -12
- package/dist/esm/cms/hooks/useCmsFolders.js +0 -1
- package/dist/esm/cms/hooks/useCmsMedia.js +0 -1
- package/dist/esm/cms/hooks/useCmsMediaDeleteAssets.js +0 -1
- package/dist/esm/cms/hooks/useCmsMediaUploadAssets.js +0 -1
- package/dist/esm/cms/hooks/useContentCategoriesMap.js +6 -13
- package/dist/esm/cms/hooks/useCreateCmsFolders.js +0 -1
- package/dist/esm/cms/hooks/useInjectedContentContext.js +4 -8
- package/dist/esm/cms/hooks/useListingInjectedContent.js +1 -2
- package/dist/esm/cms/ssr/fetchPagePaths.js +3 -3
- package/dist/esm/cms/ssr/prefetchCMSPage.js +34 -29
- package/dist/esm/cms/ssr/prefetchCmsContent.js +48 -43
- package/dist/esm/cms/ssr/prefetchCmsContentList.js +52 -50
- package/dist/esm/components/AnalyticsScripts/index.js +22 -6
- package/dist/esm/components/Drawer/index.js +3 -5
- package/dist/esm/components/FadeIn/index.js +27 -15
- package/dist/esm/components/GoogleOneTap/index.js +39 -19
- package/dist/esm/components/Html/index.js +1 -1
- package/dist/esm/components/LazyResponsiveImage/index.js +23 -12
- package/dist/esm/components/Link/index.js +3 -6
- package/dist/esm/components/Portal/index.js +2 -3
- package/dist/esm/components/ProgressBar/index.js +19 -4
- package/dist/esm/config/SentecaProvider.js +7 -12
- package/dist/esm/contexts/CheckoutForm/Components/BoricaRedirect/index.js +19 -4
- package/dist/esm/contexts/CheckoutForm/Components/CheckoutCustomState/index.js +22 -10
- package/dist/esm/contexts/CheckoutForm/Components/UniCreditRedirect/index.js +61 -0
- package/dist/esm/contexts/CheckoutForm/Components/index.js +1 -0
- package/dist/esm/contexts/CheckoutForm/hooks/useBilling/index.js +52 -31
- package/dist/esm/contexts/CheckoutForm/hooks/usePayment/index.js +25 -6
- package/dist/esm/contexts/CheckoutForm/hooks/useSavedBillingList/index.js +2 -4
- package/dist/esm/contexts/CheckoutForm/hooks/useSavedShippingList/index.js +20 -15
- package/dist/esm/contexts/CheckoutForm/hooks/useShipping/index.js +102 -90
- package/dist/esm/contexts/CheckoutForm/hooks/useShippingInitialData/index.js +3 -7
- package/dist/esm/contexts/CheckoutForm/index.js +107 -62
- package/dist/esm/contexts/CheckoutForm/utils/updatedNestedObjectProps.js +16 -3
- package/dist/esm/contexts/CheckoutForm/utils/validateBillingAddress.js +6 -14
- package/dist/esm/contexts/CheckoutForm/utils/validateShipping.js +12 -23
- package/dist/esm/contexts/CustomProductProvider/index.js +22 -10
- package/dist/esm/contexts/Strings.js +32 -33
- package/dist/esm/hooks/addresses-hooks/useAddressForm/index.js +37 -48
- package/dist/esm/hooks/basket-hooks/useBasket/index.js +19 -4
- package/dist/esm/hooks/basket-hooks/useBasketCustom/index.js +19 -4
- package/dist/esm/hooks/basket-hooks/useBasketItemList/index.js +5 -10
- package/dist/esm/hooks/basket-hooks/useBasketItemWithErrorList/index.js +4 -8
- package/dist/esm/hooks/basket-hooks/useBasketLineItem/index.js +19 -4
- package/dist/esm/hooks/basket-hooks/useBasketLineItem/utils/index.js +4 -9
- package/dist/esm/hooks/checkout-hooks/useAllStockLocations.js +5 -10
- package/dist/esm/hooks/checkout-hooks/useShippingCourierMethods.js +41 -36
- package/dist/esm/hooks/cities-hooks/useCities/index.js +19 -4
- package/dist/esm/hooks/error-handling/useErrors/index.js +4 -9
- package/dist/esm/hooks/labels/useGlobalLabels/index.js +1 -2
- package/dist/esm/hooks/order-hooks/api/queries/useOrderGetPaymentMethodQuery.js +2 -4
- package/dist/esm/hooks/order-hooks/useGenericCourierAddress/index.js +103 -68
- package/dist/esm/hooks/order-hooks/useOrder/index.js +3 -11
- package/dist/esm/hooks/order-hooks/useOrderGetPaymentMethod/index.js +0 -1
- package/dist/esm/hooks/order-hooks/useOrderPaymentMethods/index.js +2 -4
- package/dist/esm/hooks/order-hooks/useOrdersList/index.js +2 -4
- package/dist/esm/hooks/order-hooks/usePayOrder/index.js +66 -58
- package/dist/esm/hooks/order-hooks/useUpdateOrderPaymentMethod/index.js +20 -7
- package/dist/esm/hooks/subscriptions-hooks/useAcceptOnRegister/index.js +21 -8
- package/dist/esm/hooks/subscriptions-hooks/useAllSubscriptions/index.js +32 -33
- package/dist/esm/hooks/subscriptions-hooks/useSubscribeForProduct/index.js +20 -6
- package/dist/esm/hooks/ui-hooks/useAccordion/index.js +19 -5
- package/dist/esm/hooks/ui-hooks/useBoolean/index.js +21 -6
- package/dist/esm/hooks/ui-hooks/useCallbackRef/index.js +19 -11
- package/dist/esm/hooks/ui-hooks/useClickOutside/index.js +2 -2
- package/dist/esm/hooks/ui-hooks/useIsDesktop/index.js +2 -2
- package/dist/esm/hooks/ui-hooks/useIsIos/index.js +19 -4
- package/dist/esm/hooks/ui-hooks/useMenuAim/index.js +19 -4
- package/dist/esm/hooks/ui-hooks/usePagination/index.js +19 -14
- package/dist/esm/hooks/ui-hooks/useScrollDirection/index.js +21 -7
- package/dist/esm/hooks/ui-hooks/useScrollTo/index.js +26 -12
- package/dist/esm/hooks/ui-hooks/useSlideshow/index.js +21 -6
- package/dist/esm/hooks/ui-hooks/useToggleNavbarOnScroll/index.js +3 -3
- package/dist/esm/hooks/ui-hooks/useUI/index.js +34 -35
- package/dist/esm/hooks/ui-hooks/useWindowDimensions/index.js +19 -4
- package/dist/esm/hooks/useAddressList/index.js +2 -3
- package/dist/esm/hooks/useAggregateResult/index.js +7 -5
- package/dist/esm/hooks/useAllSelectedFilters/index.js +4 -4
- package/dist/esm/hooks/useAvailability/index.js +27 -14
- package/dist/esm/hooks/useCarousel/component/index.js +12 -17
- package/dist/esm/hooks/useCarousel/helpers/eventStore.js +2 -2
- package/dist/esm/hooks/useCarousel/index.js +20 -6
- package/dist/esm/hooks/useCatalogResult/index.js +2 -2
- package/dist/esm/hooks/useCategoryTree/index.js +1 -2
- package/dist/esm/hooks/useCheckoutBillingAddress/index.js +75 -7
- package/dist/esm/hooks/useCheckoutDelivery/index.js +71 -58
- package/dist/esm/hooks/useCheckoutDiscountCode/index.js +19 -4
- package/dist/esm/hooks/useCheckoutPickupFromStore/index.js +21 -8
- package/dist/esm/hooks/useCheckoutShippingAddress/index.js +19 -4
- package/dist/esm/hooks/useCheckoutShippingModule/index.js +4 -6
- package/dist/esm/hooks/useCheckoutSubmit/index.js +98 -59
- package/dist/esm/hooks/useClearAllFilters/index.js +4 -4
- package/dist/esm/hooks/useContactForm/index.js +8 -4
- package/dist/esm/hooks/useCopyToClipboard/index.js +20 -4
- package/dist/esm/hooks/useForceUpdate/index.js +19 -4
- package/dist/esm/hooks/useLineItem/LineItemContext.js +75 -0
- package/dist/esm/hooks/useLineItem/index.js +21 -23
- package/dist/esm/hooks/useLocalRating/index.js +23 -10
- package/dist/esm/hooks/usePrefetchProduct/index.js +19 -4
- package/dist/esm/hooks/usePrice/index.js +1 -1
- package/dist/esm/hooks/useProduct/index.js +22 -248
- package/dist/esm/hooks/useProduct/utils/index.js +86 -55
- package/dist/esm/hooks/useProductVariants/index.js +293 -0
- package/dist/esm/hooks/useProductVariants/types.js +1 -0
- package/dist/esm/hooks/useProgressBar/hooks/useGetSetState.js +5 -8
- package/dist/esm/hooks/useProgressBar/hooks/useUpdate.js +19 -4
- package/dist/esm/hooks/useProgressBar/index.js +23 -11
- package/dist/esm/hooks/usePromoCode/index.js +20 -6
- package/dist/esm/hooks/useSearchbar/index.js +88 -74
- package/dist/esm/hooks/useSelectedFilters/index.js +4 -4
- package/dist/esm/hooks/useShippingAddress/index.js +2 -4
- package/dist/esm/hooks/useSizesReducer/index.js +24 -12
- package/dist/esm/hooks/useVouchers/index.js +2 -4
- package/dist/esm/hooks/useWallet/index.js +2 -4
- package/dist/esm/hooks/useZoom/index.js +20 -6
- package/dist/esm/hooks/user-hooks/useSubscribeToNewsletter/index.js +28 -7
- package/dist/esm/hooks/wishlist-hooks/useWishlist/index.js +20 -6
- package/dist/esm/hooks/wishlist-hooks/useWishlistItem/index.js +41 -19
- package/dist/esm/index.js +3 -1
- package/dist/esm/listing/api/keys.js +3 -5
- package/dist/esm/listing/api/queries/useAggregateQuery.js +49 -18
- package/dist/esm/listing/api/queries/useInfiniteListing.js +6 -8
- package/dist/esm/listing/api/queries/useLabelsQuery.js +19 -10
- package/dist/esm/listing/api/queries/useListingQuery.js +43 -29
- package/dist/esm/listing/api/queries/usePredicate.js +38 -26
- package/dist/esm/listing/components/BasicListingSEO.js +25 -9
- package/dist/esm/listing/hooks/useListingAlias.js +2 -4
- package/dist/esm/listing/hooks/useListingBreadcrumbs.js +37 -18
- package/dist/esm/listing/hooks/useListingCategories.js +28 -22
- package/dist/esm/listing/hooks/useListingConfig.js +7 -10
- package/dist/esm/listing/hooks/useListingFilters.js +52 -35
- package/dist/esm/listing/hooks/useListingItems.js +2 -2
- package/dist/esm/listing/hooks/useListingMeta.js +73 -55
- package/dist/esm/listing/hooks/useListingPagination.js +6 -10
- package/dist/esm/listing/hooks/useListingSlug.js +3 -1
- package/dist/esm/listing/hooks/useSlideFilter.js +51 -12
- package/dist/esm/listing/hooks/useSort.js +47 -19
- package/dist/esm/listing/hooks/utils.js +2 -1
- package/dist/esm/listing/ssr/prefetchCategories.js +7 -8
- package/dist/esm/listing/ssr/prefetchListing.js +9 -9
- package/dist/esm/listing/ssr/prefetchPredicate.js +4 -4
- package/dist/esm/listing/types.js +13 -16
- package/dist/esm/listing/utils/buildCategoryQuery.js +46 -23
- package/dist/esm/listing/utils/buildFilterQuery.js +30 -27
- package/dist/esm/listing/utils/calculateOffset.js +1 -1
- package/dist/esm/listing/utils/extendFilter.js +19 -4
- package/dist/esm/listing/utils/getListingAlias.js +24 -12
- package/dist/esm/listing/utils/getListingPageType.js +4 -5
- package/dist/esm/navigation/components/SearchBox/Components/Container/index.js +1 -1
- package/dist/esm/navigation/components/SearchBox/Components/EmptyBox/index.js +21 -20
- package/dist/esm/navigation/components/SearchBox/Components/PopularSearches/index.js +1 -1
- package/dist/esm/navigation/components/SearchBox/Components/Products/Components/ProductCard/index.js +2 -3
- package/dist/esm/navigation/components/SearchBox/Components/Products/index.js +2 -2
- package/dist/esm/navigation/components/SearchBox/Components/RecentSearches/index.js +1 -1
- package/dist/esm/navigation/components/SearchBox/Components/Suggestions/Utils/ScrollView.js +4 -8
- package/dist/esm/navigation/components/SearchBox/index.js +16 -17
- package/dist/esm/navigation/keys.js +2 -4
- package/dist/esm/navigation/mutations/useSearchHistoryMutation.js +20 -16
- package/dist/esm/navigation/types.js +2 -4
- package/dist/esm/order/api/index.js +1 -0
- package/dist/esm/order/api/mutations/index.js +1 -0
- package/dist/esm/order/api/mutations/useUpdateOrderCustomFieldMutation.js +10 -0
- package/dist/esm/order/api/queries/prefetchOrder.js +24 -19
- package/dist/esm/order/api/utils/getOrderById.js +2 -0
- package/dist/esm/order/api/utils/index.js +1 -0
- package/dist/esm/order/hooks/index.js +1 -0
- package/dist/esm/order/hooks/useUpdateOrderCustomField.js +4 -0
- package/dist/esm/postcss/tailwind/buttons-plugin.js +20 -16
- package/dist/esm/postcss/tailwind/default-plugin.js +2 -4
- package/dist/esm/postcss/tailwind/fonts-plugin.js +21 -18
- package/dist/esm/postcss/tailwind/forms-plugin.js +6 -9
- package/dist/esm/postcss/tailwind/utils.js +4 -6
- package/dist/esm/postcss/types.js +4 -8
- package/dist/esm/product/api/keys.js +12 -0
- package/dist/esm/product/api/queries/index.js +2 -0
- package/dist/esm/product/api/queries/useBnpOffersQuery.js +54 -0
- package/dist/esm/product/api/queries/useUniCreditOffersQuery.js +53 -0
- package/dist/esm/product/api/ssr/index.js +44 -40
- package/dist/esm/product/hooks/index.js +2 -0
- package/dist/esm/product/hooks/useBnpOffers.js +81 -0
- package/dist/esm/product/hooks/useUniCreditOffers.js +81 -0
- package/dist/esm/product/index.js +1 -0
- package/dist/esm/seo/api/ssr/fetchRedirectByFrom.js +19 -14
- package/dist/esm/seo/api/ssr/fetchSitemaps.js +22 -17
- package/dist/esm/seo/api/ssr/getCanonicalUrl.js +19 -4
- package/dist/esm/seo/components/GlobalSEO/index.js +3 -3
- package/dist/esm/seo/components/HiddenBreadcrumb/index.js +1 -2
- package/dist/esm/seo/components/ProductSEO/index.js +3 -5
- package/dist/esm/seo/components/TranslationsMeta/index.js +49 -0
- package/dist/esm/seo/components/index.js +1 -0
- package/dist/esm/seo/hooks/index.js +1 -0
- package/dist/esm/seo/hooks/useSEOBreadcrumb.js +17 -9
- package/dist/esm/seo/hooks/useSeoTranslations.js +79 -0
- package/dist/esm/seo/utils/handleRobots.js +4 -4
- package/dist/esm/ssr/emptyBasketGuard.js +2 -2
- package/dist/esm/ui/components/GridStyles.js +26 -0
- package/dist/esm/ui/components/LazyImage.js +6 -12
- package/dist/esm/ui/components/RangeSliderInput.js +36 -11
- package/dist/esm/ui/components/index.js +1 -0
- package/dist/esm/ui/hooks/index.js +1 -0
- package/dist/esm/ui/hooks/useToasts.js +154 -0
- package/dist/esm/ui/index.js +1 -0
- package/dist/esm/ui/toastUtils/ErrorIcon.js +15 -0
- package/dist/esm/ui/toastUtils/InfoIcon.js +15 -0
- package/dist/esm/ui/toastUtils/SuccessIcon.js +15 -0
- package/dist/esm/ui/toastUtils/WarningIcon.js +15 -0
- package/dist/esm/ui/toastUtils/index.js +5 -0
- package/dist/esm/ui/toastUtils/utils.js +67 -0
- package/dist/esm/user/api/mutations/useLoginMutation.js +2 -5
- package/dist/esm/user/api/mutations/useLogoutMutation.js +3 -6
- package/dist/esm/user/api/mutations/useRegisterMutation.js +24 -24
- package/dist/esm/user/api/mutations/useRequestResetPasswordTokenMutation.js +1 -2
- package/dist/esm/user/api/mutations/useResetPasswordMutation.js +1 -2
- package/dist/esm/user/api/queries/index.js +1 -0
- package/dist/esm/user/api/queries/useGetMyLoyaltyCardQuery.js +57 -0
- package/dist/esm/user/api/queries/useIsAuthenticatedQuery.js +2 -4
- package/dist/esm/user/api/utils/generateAnonymousToken.js +25 -21
- package/dist/esm/user/api/utils/getUserToken.js +6 -0
- package/dist/esm/user/api/utils/index.js +1 -0
- package/dist/esm/user/api/utils/processLoginPayload.js +2 -2
- package/dist/esm/user/hooks/index.js +2 -0
- package/dist/esm/user/hooks/useConfirmEmail.js +20 -6
- package/dist/esm/user/hooks/useGetMyLoyaltyCard.js +4 -0
- package/dist/esm/user/hooks/useGetUserToken.js +5 -0
- package/dist/esm/user/hooks/useLoginApple.js +2 -4
- package/dist/esm/user/hooks/useLoginFacebook.js +2 -4
- package/dist/esm/user/hooks/useLoginGoogle.js +2 -4
- package/dist/esm/user/hooks/useRequestEmailConfirmation.js +20 -6
- package/dist/esm/user/index.js +0 -1
- package/dist/esm/utils/assetsToMap.js +3 -7
- package/dist/esm/utils/createAggregateQuery.js +4 -6
- package/dist/esm/utils/customFieldsToMap.js +3 -8
- package/dist/esm/utils/generateQueryFromRouter.js +5 -12
- package/dist/esm/utils/getLocaleFromPath.js +8 -0
- package/dist/esm/utils/getPagination.js +5 -11
- package/dist/esm/utils/getSelectedFilters.js +25 -11
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/isColorBright.js +2 -2
- package/dist/esm/utils/isTouchDevice.js +2 -1
- package/dist/esm/utils/localStorage.js +7 -2
- package/dist/esm/utils/queryObjToString.js +3 -7
- package/dist/esm/utils/sortAncestors.js +18 -11
- package/dist/esm/utils/tokens.js +19 -4
- package/dist/esm/utils/validations.js +2 -2
- package/dist/esm/webview/hooks/useIsInWebview.js +21 -6
- package/dist/esm/webview/utils/sendMessage.js +2 -4
- package/dist/esm/wishlist/api/queries/keys.js +2 -4
- package/dist/esm/wishlist/api/queries/useWishlistItemsQuery.js +4 -7
- package/dist/esm/wishlist/hooks/useWishlistItems.js +2 -3
- package/dist/types/analytics/Pixel/hooks/index.d.ts +3 -0
- package/dist/types/analytics/Pixel/hooks/usePixelFinishOrder.d.ts +4 -0
- package/dist/types/analytics/Pixel/hooks/usePixelViewBasket.d.ts +4 -0
- package/dist/types/analytics/Pixel/hooks/usePixelViewCategory.d.ts +7 -0
- package/dist/types/analytics/Pixel/types.d.ts +10 -1
- package/dist/types/analytics/Pixel/utils.d.ts +3 -0
- package/dist/types/analytics/Releva/hooks/useRelevaOnListingPage.d.ts +1 -1
- package/dist/types/analytics/Releva/types.d.ts +1 -1
- package/dist/types/analytics/Releva/utils.d.ts +1 -1
- package/dist/types/analytics/addToCart.d.ts +1 -1
- package/dist/types/analytics/initiateCheckout.d.ts +1 -1
- package/dist/types/analytics/purchase.d.ts +1 -1
- package/dist/types/api/addressesApi/index.d.ts +1 -1
- package/dist/types/api/brandsApi/index.d.ts +1 -1
- package/dist/types/api/catalogApi/index.d.ts +1 -1
- package/dist/types/api/categoriesApi/index.d.ts +1 -1
- package/dist/types/api/citiesApi/index.d.ts +1 -1
- package/dist/types/api/companiesApi/index.d.ts +1 -1
- package/dist/types/api/myCartApi/index.d.ts +1 -0
- package/dist/types/basket/api/index.d.ts +1 -0
- package/dist/types/basket/api/mutations/index.d.ts +2 -0
- package/dist/types/basket/api/mutations/useChangeGiftVariant.d.ts +2 -0
- package/dist/types/basket/api/mutations/useReplaceBasketMutation.d.ts +2 -0
- package/dist/types/basket/hooks/index.d.ts +3 -0
- package/dist/types/basket/hooks/useBasketCrossSaleItems.d.ts +9 -0
- package/dist/types/basket/hooks/useChangeGiftVariant.d.ts +2 -0
- package/dist/types/basket/hooks/useReplaceBasket.d.ts +2 -0
- package/dist/types/basket/index.d.ts +1 -0
- package/dist/types/checkout/api/keys.d.ts +2 -0
- package/dist/types/checkout/api/queries/index.d.ts +2 -0
- package/dist/types/checkout/api/queries/useBnpCalculateForCartQuery.d.ts +4 -0
- package/dist/types/checkout/api/queries/useUniCreditCalculateForCartQuery.d.ts +3 -0
- package/dist/types/checkout/contexts/UniCreditResponseContext.d.ts +6 -0
- package/dist/types/checkout/contexts/index.d.ts +1 -0
- package/dist/types/checkout/hooks/index.d.ts +2 -0
- package/dist/types/checkout/hooks/useBnpCalculateForCart.d.ts +40 -0
- package/dist/types/checkout/hooks/useUniCreditCalculateForCart.d.ts +41 -0
- package/dist/types/checkout/ssr/captureUniCreditOrder.d.ts +2 -0
- package/dist/types/checkout/ssr/index.d.ts +1 -0
- package/dist/types/cms/api/mutations/useCMSMediaUploadAssetsMutation.d.ts +1 -3
- package/dist/types/components/Portal/index.d.ts +2 -2
- package/dist/types/contexts/CheckoutForm/Components/UniCreditRedirect/index.d.ts +5 -0
- package/dist/types/contexts/CheckoutForm/Components/index.d.ts +1 -0
- package/dist/types/contexts/CheckoutForm/hooks/useBilling/index.d.ts +3 -1
- package/dist/types/contexts/CheckoutForm/hooks/usePayment/index.d.ts +3 -1
- package/dist/types/contexts/CheckoutForm/hooks/useShipping/index.d.ts +1 -1
- package/dist/types/contexts/CheckoutForm/index.d.ts +4 -2
- package/dist/types/hooks/basket-hooks/useBasketItemList/index.d.ts +1 -0
- package/dist/types/hooks/basket-hooks/useBasketLineItem/index.d.ts +1 -2
- package/dist/types/hooks/order-hooks/api/queries/useOrderGetPaymentMethodQuery.d.ts +1 -16
- package/dist/types/hooks/order-hooks/useOrder/index.d.ts +3 -2
- package/dist/types/hooks/order-hooks/useOrderPaymentMethods/index.d.ts +4 -4
- package/dist/types/hooks/order-hooks/useReferralOrders/index.d.ts +1 -0
- package/dist/types/hooks/useCarousel/index.d.ts +2 -2
- package/dist/types/hooks/useCheckoutBillingAddress/index.d.ts +2 -0
- package/dist/types/hooks/useCheckoutSubmit/index.d.ts +3 -2
- package/dist/types/hooks/useContactForm/index.d.ts +2 -1
- package/dist/types/hooks/useLineItem/LineItemContext.d.ts +22 -0
- package/dist/types/hooks/useLineItem/index.d.ts +3 -3
- package/dist/types/hooks/useProduct/index.d.ts +6 -78
- package/dist/types/hooks/useProduct/utils/index.d.ts +7 -4
- package/dist/types/hooks/useProductVariants/index.d.ts +34 -0
- package/dist/types/hooks/useProductVariants/types.d.ts +79 -0
- package/dist/types/hooks/useVouchers/index.d.ts +2 -2
- package/dist/types/hooks/useZoom/index.d.ts +2 -2
- package/dist/types/hooks/wishlist-hooks/useWishlist/index.d.ts +1 -2
- package/dist/types/index.d.ts +2 -1
- package/dist/types/listing/api/queries/useAggregateQuery.d.ts +6 -4
- package/dist/types/listing/api/queries/useListingQuery.d.ts +6 -3
- package/dist/types/listing/api/queries/usePredicate.d.ts +2 -1
- package/dist/types/listing/components/BasicListingSEO.d.ts +3 -1
- package/dist/types/listing/hooks/useListingAlias.d.ts +2 -1
- package/dist/types/listing/hooks/useListingFilters.d.ts +0 -1
- package/dist/types/listing/hooks/useListingItems.d.ts +3 -2
- package/dist/types/listing/hooks/useListingMeta.d.ts +4 -0
- package/dist/types/listing/hooks/useListingSEOCategories.d.ts +6 -4
- package/dist/types/listing/hooks/useSlideFilter.d.ts +4 -0
- package/dist/types/listing/hooks/useSort.d.ts +6 -5
- package/dist/types/listing/hooks/utils.d.ts +3 -2
- package/dist/types/listing/ssr/prefetchCategories.d.ts +2 -2
- package/dist/types/listing/ssr/prefetchListing.d.ts +4 -5
- package/dist/types/listing/ssr/prefetchPredicate.d.ts +2 -1
- package/dist/types/listing/types.d.ts +44 -16
- package/dist/types/listing/utils/buildCategoryQuery.d.ts +2 -1
- package/dist/types/listing/utils/buildFilterQuery.d.ts +2 -1
- package/dist/types/listing/utils/extendFilter.d.ts +3 -2
- package/dist/types/listing/utils/getListingAlias.d.ts +2 -1
- package/dist/types/listing/utils/getListingPageType.d.ts +2 -2
- package/dist/types/navigation/components/SearchBox/Components/Container/index.d.ts +10 -9
- package/dist/types/navigation/components/SearchBox/Components/EmptyBox/index.d.ts +23 -21
- package/dist/types/navigation/components/SearchBox/Components/Products/Components/ProductCard/index.d.ts +8 -7
- package/dist/types/navigation/components/SearchBox/Components/Products/index.d.ts +9 -8
- package/dist/types/navigation/components/SearchBox/index.d.ts +32 -30
- package/dist/types/order/api/index.d.ts +1 -0
- package/dist/types/order/api/mutations/index.d.ts +1 -0
- package/dist/types/order/api/mutations/useUpdateCustomLineItemMutation.d.ts +2 -5
- package/dist/types/order/api/mutations/useUpdateOrderCustomFieldMutation.d.ts +9 -0
- package/dist/types/order/api/utils/getOrderById.d.ts +2 -0
- package/dist/types/order/api/utils/index.d.ts +1 -0
- package/dist/types/order/hooks/index.d.ts +1 -0
- package/dist/types/order/hooks/useUpdateCustomLineItem.d.ts +2 -2
- package/dist/types/order/hooks/useUpdateOrderCustomField.d.ts +2 -0
- package/dist/types/product/api/keys.d.ts +2 -0
- package/dist/types/product/api/queries/index.d.ts +2 -0
- package/dist/types/product/api/queries/useBnpOffersQuery.d.ts +5 -0
- package/dist/types/product/api/queries/useUniCreditOffersQuery.d.ts +4 -0
- package/dist/types/product/hooks/index.d.ts +2 -0
- package/dist/types/product/hooks/useBnpOffers.d.ts +37 -0
- package/dist/types/product/hooks/useUniCreditOffers.d.ts +36 -0
- package/dist/types/product/index.d.ts +1 -0
- package/dist/types/seo/components/TranslationsMeta/index.d.ts +1 -0
- package/dist/types/seo/components/index.d.ts +1 -0
- package/dist/types/seo/hooks/index.d.ts +1 -0
- package/dist/types/seo/hooks/useSeoTranslations.d.ts +24 -0
- package/dist/types/types/index.d.ts +38 -40
- package/dist/types/ui/components/GridStyles.d.ts +11 -0
- package/dist/types/ui/components/RangeSliderInput.d.ts +2 -1
- package/dist/types/ui/components/index.d.ts +1 -0
- package/dist/types/ui/hooks/index.d.ts +1 -0
- package/dist/types/ui/hooks/useToasts.d.ts +20 -0
- package/dist/types/ui/index.d.ts +1 -0
- package/dist/types/ui/toastUtils/ErrorIcon.d.ts +1 -0
- package/dist/types/ui/toastUtils/InfoIcon.d.ts +1 -0
- package/dist/types/ui/toastUtils/SuccessIcon.d.ts +1 -0
- package/dist/types/ui/toastUtils/WarningIcon.d.ts +1 -0
- package/dist/types/ui/toastUtils/index.d.ts +5 -0
- package/dist/types/ui/toastUtils/utils.d.ts +11 -0
- package/dist/types/user/api/queries/index.d.ts +1 -0
- package/dist/types/user/api/queries/useGetMyLoyaltyCardQuery.d.ts +5 -0
- package/dist/types/user/api/utils/getUserToken.d.ts +1 -0
- package/dist/types/user/api/utils/index.d.ts +1 -0
- package/dist/types/user/hooks/index.d.ts +2 -0
- package/dist/types/user/hooks/useGetMyLoyaltyCard.d.ts +2 -0
- package/dist/types/user/hooks/useGetUserToken.d.ts +1 -0
- package/dist/types/user/index.d.ts +0 -1
- package/dist/types/utils/getLocaleFromPath.d.ts +1 -0
- package/dist/types/utils/getSelectedFilters.d.ts +2 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +14 -9
- package/dist/cjs/dto/index.js +0 -34
- package/dist/esm/dto/index.js +0 -1
- package/dist/esm/user/types/index.js +0 -1
- package/dist/types/dto/index.d.ts +0 -2
- package/dist/types/user/types/index.d.ts +0 -1
@@ -1,15 +1,22 @@
|
|
1
1
|
/* eslint-disable react-hooks/exhaustive-deps */ import { useState, useEffect, useCallback } from 'react';
|
2
2
|
import { getElementOffset } from '../../../utils/getElementOffset';
|
3
|
+
function _arrayLikeToArray(arr, len) {
|
4
|
+
if (len == null || len > arr.length) len = arr.length;
|
5
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
6
|
+
return arr2;
|
7
|
+
}
|
3
8
|
function _arrayWithHoles(arr) {
|
4
9
|
if (Array.isArray(arr)) return arr;
|
5
10
|
}
|
6
11
|
function _iterableToArrayLimit(arr, i) {
|
12
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
13
|
+
if (_i == null) return;
|
7
14
|
var _arr = [];
|
8
15
|
var _n = true;
|
9
16
|
var _d = false;
|
10
|
-
var _e
|
17
|
+
var _s, _e;
|
11
18
|
try {
|
12
|
-
for(
|
19
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
13
20
|
_arr.push(_s.value);
|
14
21
|
if (i && _arr.length === i) break;
|
15
22
|
}
|
@@ -26,10 +33,18 @@ function _iterableToArrayLimit(arr, i) {
|
|
26
33
|
return _arr;
|
27
34
|
}
|
28
35
|
function _nonIterableRest() {
|
29
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
36
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
30
37
|
}
|
31
38
|
function _slicedToArray(arr, i) {
|
32
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
|
39
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
40
|
+
}
|
41
|
+
function _unsupportedIterableToArray(o, minLen) {
|
42
|
+
if (!o) return;
|
43
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
44
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
45
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
46
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
47
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
33
48
|
}
|
34
49
|
var win = typeof window !== 'undefined' ? window : undefined;
|
35
50
|
/**
|
@@ -39,8 +54,8 @@ var win = typeof window !== 'undefined' ? window : undefined;
|
|
39
54
|
* @param {number} speed Scroll speed, bigger numbers makes the animation slower
|
40
55
|
* @param {string} easing Animation easing, has to be defined in the easing object
|
41
56
|
*
|
42
|
-
*/ export var useScrollTo = function(
|
43
|
-
var to =
|
57
|
+
*/ export var useScrollTo = function() {
|
58
|
+
var to = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, speed = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0.8, easing = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 'easeInOutCubic';
|
44
59
|
var ref = _slicedToArray(useState(false), 2), isScrolling = ref[0], setIsScrolling = ref[1];
|
45
60
|
// Stop scroll when the user starts scrolling
|
46
61
|
var stopScroll = useCallback(function() {
|
@@ -86,9 +101,8 @@ var win = typeof window !== 'undefined' ? window : undefined;
|
|
86
101
|
};
|
87
102
|
};
|
88
103
|
// copied from https://pawelgrzybek.com/page-scroll-in-vanilla-javascript/
|
89
|
-
export function scrollIt(destination
|
90
|
-
var duration =
|
91
|
-
} : param4;
|
104
|
+
export function scrollIt(destination) {
|
105
|
+
var duration = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 200, easing = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 'linear', callback = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : function() {};
|
92
106
|
var getScrollOffset = function getScrollOffset() {
|
93
107
|
var destinationOffset = typeof destination == 'number' ? destination : getElementOffset(destination).top;
|
94
108
|
var documentHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
|
@@ -100,13 +114,13 @@ export function scrollIt(destination, param, param3, param4) {
|
|
100
114
|
*
|
101
115
|
* you can copy easings from https://easings.net/
|
102
116
|
*/ var easingList = {
|
103
|
-
linear: function(t) {
|
117
|
+
linear: function linear(t) {
|
104
118
|
return t;
|
105
119
|
},
|
106
|
-
easeInOutCubic: function(x) {
|
120
|
+
easeInOutCubic: function easeInOutCubic(x) {
|
107
121
|
return x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2;
|
108
122
|
},
|
109
|
-
easeInOutSine: function(t) {
|
123
|
+
easeInOutSine: function easeInOutSine(t) {
|
110
124
|
return -(Math.cos(Math.PI * t) - 1) / 2;
|
111
125
|
}
|
112
126
|
};
|
@@ -1,14 +1,21 @@
|
|
1
1
|
import { useEffect, useState } from "react";
|
2
|
+
function _arrayLikeToArray(arr, len) {
|
3
|
+
if (len == null || len > arr.length) len = arr.length;
|
4
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
5
|
+
return arr2;
|
6
|
+
}
|
2
7
|
function _arrayWithHoles(arr) {
|
3
8
|
if (Array.isArray(arr)) return arr;
|
4
9
|
}
|
5
10
|
function _iterableToArrayLimit(arr, i) {
|
11
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
12
|
+
if (_i == null) return;
|
6
13
|
var _arr = [];
|
7
14
|
var _n = true;
|
8
15
|
var _d = false;
|
9
|
-
var _e
|
16
|
+
var _s, _e;
|
10
17
|
try {
|
11
|
-
for(
|
18
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
12
19
|
_arr.push(_s.value);
|
13
20
|
if (i && _arr.length === i) break;
|
14
21
|
}
|
@@ -25,13 +32,21 @@ function _iterableToArrayLimit(arr, i) {
|
|
25
32
|
return _arr;
|
26
33
|
}
|
27
34
|
function _nonIterableRest() {
|
28
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
35
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
29
36
|
}
|
30
37
|
function _slicedToArray(arr, i) {
|
31
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
|
38
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
39
|
+
}
|
40
|
+
function _unsupportedIterableToArray(o, minLen) {
|
41
|
+
if (!o) return;
|
42
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
43
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
44
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
45
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
46
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
32
47
|
}
|
33
|
-
export function useSlideshow(data
|
34
|
-
var interval =
|
48
|
+
export function useSlideshow(data) {
|
49
|
+
var interval = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1000;
|
35
50
|
var ref = _slicedToArray(useState(0), 2), selectedIndex = ref[0], setSelectedIndex = ref[1];
|
36
51
|
var dataLength = (data === null || data === void 0 ? void 0 : data.length) || 0;
|
37
52
|
useEffect(function() {
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { useEffect } from 'react';
|
2
2
|
import { useScrollDirection } from '../useScrollDirection';
|
3
3
|
import { useUIFunctions, useUIState } from '../useUI';
|
4
|
-
export var useToggleNavbarOnScroll = function(
|
5
|
-
var data =
|
4
|
+
export var useToggleNavbarOnScroll = function() {
|
5
|
+
var data = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
6
6
|
disabled: false,
|
7
7
|
downThreshold: 50,
|
8
8
|
upThreshold: 10,
|
9
9
|
defaultValue: 'up'
|
10
|
-
}
|
10
|
+
};
|
11
11
|
var disabled = data.disabled, upThreshold = data.upThreshold, downThreshold = data.downThreshold, defaultValue = data.defaultValue;
|
12
12
|
var displayNavbar = useUIState().displayNavbar;
|
13
13
|
var direction = useScrollDirection({
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
function _arrayLikeToArray(arr, len) {
|
3
|
+
if (len == null || len > arr.length) len = arr.length;
|
4
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
5
|
+
return arr2;
|
6
|
+
}
|
2
7
|
function _arrayWithHoles(arr) {
|
3
8
|
if (Array.isArray(arr)) return arr;
|
4
9
|
}
|
5
10
|
function _arrayWithoutHoles(arr) {
|
6
|
-
if (Array.isArray(arr))
|
7
|
-
for(var i = 0, arr2 = new Array(arr.length); i < arr.length; i++){
|
8
|
-
arr2[i] = arr[i];
|
9
|
-
}
|
10
|
-
return arr2;
|
11
|
-
}
|
11
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
12
12
|
}
|
13
13
|
function _defineProperty(obj, key, value) {
|
14
14
|
if (key in obj) {
|
@@ -24,15 +24,17 @@ function _defineProperty(obj, key, value) {
|
|
24
24
|
return obj;
|
25
25
|
}
|
26
26
|
function _iterableToArray(iter) {
|
27
|
-
if (Symbol.iterator
|
27
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
28
28
|
}
|
29
29
|
function _iterableToArrayLimit(arr, i) {
|
30
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
31
|
+
if (_i == null) return;
|
30
32
|
var _arr = [];
|
31
33
|
var _n = true;
|
32
34
|
var _d = false;
|
33
|
-
var _e
|
35
|
+
var _s, _e;
|
34
36
|
try {
|
35
|
-
for(
|
37
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
36
38
|
_arr.push(_s.value);
|
37
39
|
if (i && _arr.length === i) break;
|
38
40
|
}
|
@@ -49,15 +51,14 @@ function _iterableToArrayLimit(arr, i) {
|
|
49
51
|
return _arr;
|
50
52
|
}
|
51
53
|
function _nonIterableRest() {
|
52
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
54
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
53
55
|
}
|
54
56
|
function _nonIterableSpread() {
|
55
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance");
|
57
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
56
58
|
}
|
57
59
|
function _objectSpread(target) {
|
58
60
|
for(var i = 1; i < arguments.length; i++){
|
59
|
-
var source = arguments[i] != null ? arguments[i] : {
|
60
|
-
};
|
61
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
61
62
|
var ownKeys = Object.keys(source);
|
62
63
|
if (typeof Object.getOwnPropertySymbols === "function") {
|
63
64
|
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
@@ -71,17 +72,24 @@ function _objectSpread(target) {
|
|
71
72
|
return target;
|
72
73
|
}
|
73
74
|
function _slicedToArray(arr, i) {
|
74
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
|
75
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
75
76
|
}
|
76
77
|
function _toConsumableArray(arr) {
|
77
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
|
78
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
79
|
+
}
|
80
|
+
function _unsupportedIterableToArray(o, minLen) {
|
81
|
+
if (!o) return;
|
82
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
83
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
84
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
85
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
86
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
78
87
|
}
|
79
88
|
function uiReducer(state, action) {
|
80
89
|
switch(action.type){
|
81
90
|
case 'ENQUEUE_VIEW':
|
82
91
|
{
|
83
|
-
return _objectSpread({
|
84
|
-
}, state, {
|
92
|
+
return _objectSpread({}, state, {
|
85
93
|
displaySidebar: false,
|
86
94
|
views: _toConsumableArray(state.views).concat([
|
87
95
|
{
|
@@ -93,15 +101,13 @@ function uiReducer(state, action) {
|
|
93
101
|
}
|
94
102
|
case 'DEQUEUE_VIEW':
|
95
103
|
{
|
96
|
-
return _objectSpread({
|
97
|
-
}, state, {
|
104
|
+
return _objectSpread({}, state, {
|
98
105
|
views: state.views.slice(1)
|
99
106
|
});
|
100
107
|
}
|
101
108
|
case 'CLOSE_VIEW_BY_ID':
|
102
109
|
{
|
103
|
-
return _objectSpread({
|
104
|
-
}, state, {
|
110
|
+
return _objectSpread({}, state, {
|
105
111
|
views: state.views.filter(function(x) {
|
106
112
|
return x.id !== action.id;
|
107
113
|
})
|
@@ -109,43 +115,37 @@ function uiReducer(state, action) {
|
|
109
115
|
}
|
110
116
|
case 'RESET_VIEWS':
|
111
117
|
{
|
112
|
-
return _objectSpread({
|
113
|
-
}, state, {
|
118
|
+
return _objectSpread({}, state, {
|
114
119
|
views: []
|
115
120
|
});
|
116
121
|
}
|
117
122
|
case 'OPEN_SIDEBAR':
|
118
123
|
{
|
119
|
-
return _objectSpread({
|
120
|
-
}, state, {
|
124
|
+
return _objectSpread({}, state, {
|
121
125
|
displaySidebar: true
|
122
126
|
});
|
123
127
|
}
|
124
128
|
case 'CLOSE_SIDEBAR':
|
125
129
|
{
|
126
|
-
return _objectSpread({
|
127
|
-
}, state, {
|
130
|
+
return _objectSpread({}, state, {
|
128
131
|
displaySidebar: false
|
129
132
|
});
|
130
133
|
}
|
131
134
|
case 'OPEN_NAVBAR':
|
132
135
|
{
|
133
|
-
return _objectSpread({
|
134
|
-
}, state, {
|
136
|
+
return _objectSpread({}, state, {
|
135
137
|
displayNavbar: true
|
136
138
|
});
|
137
139
|
}
|
138
140
|
case 'CLOSE_NAVBAR':
|
139
141
|
{
|
140
|
-
return _objectSpread({
|
141
|
-
}, state, {
|
142
|
+
return _objectSpread({}, state, {
|
142
143
|
displayNavbar: false
|
143
144
|
});
|
144
145
|
}
|
145
146
|
case 'CUSTOM':
|
146
147
|
{
|
147
|
-
return _objectSpread({
|
148
|
-
}, state, {
|
148
|
+
return _objectSpread({}, state, {
|
149
149
|
custom: action.payload
|
150
150
|
});
|
151
151
|
}
|
@@ -158,8 +158,7 @@ function uiReducer(state, action) {
|
|
158
158
|
var UIStateContext = /*#__PURE__*/ React.createContext(undefined);
|
159
159
|
var UIDispatchContext = /*#__PURE__*/ React.createContext(undefined);
|
160
160
|
export function UIProvider(param) {
|
161
|
-
var children = param.children, displayNavbar = param.displayNavbar, displaySidebar = param.displaySidebar, _customData = param.customData, customData = _customData === void 0 ? {
|
162
|
-
} : _customData;
|
161
|
+
var children = param.children, displayNavbar = param.displayNavbar, displaySidebar = param.displaySidebar, _customData = param.customData, customData = _customData === void 0 ? {} : _customData;
|
163
162
|
var ref = _slicedToArray(React.useReducer(uiReducer, {
|
164
163
|
displaySidebar: displaySidebar,
|
165
164
|
displayNavbar: displayNavbar,
|
@@ -1,14 +1,21 @@
|
|
1
1
|
import { useState, useEffect } from 'react';
|
2
|
+
function _arrayLikeToArray(arr, len) {
|
3
|
+
if (len == null || len > arr.length) len = arr.length;
|
4
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
5
|
+
return arr2;
|
6
|
+
}
|
2
7
|
function _arrayWithHoles(arr) {
|
3
8
|
if (Array.isArray(arr)) return arr;
|
4
9
|
}
|
5
10
|
function _iterableToArrayLimit(arr, i) {
|
11
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
12
|
+
if (_i == null) return;
|
6
13
|
var _arr = [];
|
7
14
|
var _n = true;
|
8
15
|
var _d = false;
|
9
|
-
var _e
|
16
|
+
var _s, _e;
|
10
17
|
try {
|
11
|
-
for(
|
18
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
12
19
|
_arr.push(_s.value);
|
13
20
|
if (i && _arr.length === i) break;
|
14
21
|
}
|
@@ -25,10 +32,18 @@ function _iterableToArrayLimit(arr, i) {
|
|
25
32
|
return _arr;
|
26
33
|
}
|
27
34
|
function _nonIterableRest() {
|
28
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
35
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
29
36
|
}
|
30
37
|
function _slicedToArray(arr, i) {
|
31
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
|
38
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
39
|
+
}
|
40
|
+
function _unsupportedIterableToArray(o, minLen) {
|
41
|
+
if (!o) return;
|
42
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
43
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
44
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
45
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
46
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
32
47
|
}
|
33
48
|
var getWindowDimensions = function() {
|
34
49
|
if (typeof window !== 'undefined') {
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { addressesApi } from '../../api/addressesApi';
|
2
|
-
export var useAddressList = function(
|
3
|
-
var enabled = (
|
4
|
-
} : param).enabled;
|
2
|
+
export var useAddressList = function() {
|
3
|
+
var enabled = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}).enabled;
|
5
4
|
return addressesApi.useGet({
|
6
5
|
enabled: enabled
|
7
6
|
});
|
@@ -17,8 +17,7 @@ function _defineProperty(obj, key, value) {
|
|
17
17
|
}
|
18
18
|
function _objectSpread(target) {
|
19
19
|
for(var i = 1; i < arguments.length; i++){
|
20
|
-
var source = arguments[i] != null ? arguments[i] : {
|
21
|
-
};
|
20
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
22
21
|
var ownKeys = Object.keys(source);
|
23
22
|
if (typeof Object.getOwnPropertySymbols === "function") {
|
24
23
|
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
@@ -88,7 +87,9 @@ export var useAggregateResult = function(type, aggregates, slug, predicate, quer
|
|
88
87
|
aggType: a.filterDefinition,
|
89
88
|
aggKey: filterKey,
|
90
89
|
aggOperator: operatorMap[a.aggregationType]
|
91
|
-
}, selected, router)
|
90
|
+
}, selected, router), undefined, {
|
91
|
+
shallow: true
|
92
|
+
});
|
92
93
|
}
|
93
94
|
},
|
94
95
|
]);
|
@@ -102,10 +103,11 @@ export var useAggregateResult = function(type, aggregates, slug, predicate, quer
|
|
102
103
|
clearAll: function() {
|
103
104
|
return router.push({
|
104
105
|
pathname: router.pathname,
|
105
|
-
query: _objectSpread({
|
106
|
-
}, router.query, {
|
106
|
+
query: _objectSpread({}, router.query, {
|
107
107
|
filter: filterByType(router.query.filter, a.filterDefinition)
|
108
108
|
})
|
109
|
+
}, undefined, {
|
110
|
+
shallow: true
|
109
111
|
});
|
110
112
|
},
|
111
113
|
type: a.aggregationType
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { useMemo } from 'react';
|
2
2
|
import { useRouter } from 'next/router';
|
3
3
|
import { getSelectedFilters } from '../../utils';
|
4
|
-
import { useListingAlias,
|
4
|
+
import { useListingAlias, useListingConfig } from '../../index';
|
5
5
|
export var useAllSelectedFilters = function(aggregations) {
|
6
6
|
var router = useRouter();
|
7
|
-
var
|
8
|
-
var slug = useListingAlias().slug;
|
7
|
+
var meta = useListingConfig().meta;
|
8
|
+
var slug = useListingAlias(meta).slug;
|
9
9
|
return useMemo(function() {
|
10
10
|
return (aggregations === null || aggregations === void 0 ? void 0 : aggregations.reduce(function(items, filter) {
|
11
|
-
return items.concat(getSelectedFilters(router, slug, filter,
|
11
|
+
return items.concat(getSelectedFilters(router, slug, filter, meta));
|
12
12
|
}, [])) || [];
|
13
13
|
}, [
|
14
14
|
aggregations,
|
@@ -1,14 +1,21 @@
|
|
1
1
|
import { useEffect, useState } from 'react';
|
2
|
+
function _arrayLikeToArray(arr, len) {
|
3
|
+
if (len == null || len > arr.length) len = arr.length;
|
4
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
5
|
+
return arr2;
|
6
|
+
}
|
2
7
|
function _arrayWithHoles(arr) {
|
3
8
|
if (Array.isArray(arr)) return arr;
|
4
9
|
}
|
5
10
|
function _iterableToArrayLimit(arr, i) {
|
11
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
12
|
+
if (_i == null) return;
|
6
13
|
var _arr = [];
|
7
14
|
var _n = true;
|
8
15
|
var _d = false;
|
9
|
-
var _e
|
16
|
+
var _s, _e;
|
10
17
|
try {
|
11
|
-
for(
|
18
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
12
19
|
_arr.push(_s.value);
|
13
20
|
if (i && _arr.length === i) break;
|
14
21
|
}
|
@@ -25,38 +32,44 @@ function _iterableToArrayLimit(arr, i) {
|
|
25
32
|
return _arr;
|
26
33
|
}
|
27
34
|
function _nonIterableRest() {
|
28
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
35
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
29
36
|
}
|
30
37
|
function _slicedToArray(arr, i) {
|
31
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
|
38
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
39
|
+
}
|
40
|
+
function _unsupportedIterableToArray(o, minLen) {
|
41
|
+
if (!o) return;
|
42
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
43
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
44
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
45
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
46
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
32
47
|
}
|
33
|
-
var
|
34
|
-
export { ProductQuantityStatusEnum1 as ProductQuantityStatusEnum, };
|
48
|
+
export var ProductQuantityStatusEnum;
|
35
49
|
(function(ProductQuantityStatusEnum) {
|
36
50
|
ProductQuantityStatusEnum["OutOfStock"] = "OutOfStock";
|
37
51
|
ProductQuantityStatusEnum["MaxQuantityReached"] = "MaxQuantityReached";
|
38
52
|
ProductQuantityStatusEnum["Available"] = "Available";
|
39
53
|
ProductQuantityStatusEnum["Loading"] = "Loading";
|
40
54
|
ProductQuantityStatusEnum["Unknown"] = "Unknown";
|
41
|
-
})(
|
42
|
-
}));
|
55
|
+
})(ProductQuantityStatusEnum || (ProductQuantityStatusEnum = {}));
|
43
56
|
export var useAvailability = function(param) {
|
44
57
|
var quantity = param.quantity, quantityInBasket = param.quantityInBasket;
|
45
|
-
var ref = _slicedToArray(useState(
|
58
|
+
var ref = _slicedToArray(useState(ProductQuantityStatusEnum.Loading), 2), status = ref[0], setStatus = ref[1];
|
46
59
|
useEffect(function() {
|
47
60
|
if (typeof quantity === 'undefined') {
|
48
|
-
setStatus(
|
61
|
+
setStatus(ProductQuantityStatusEnum.Unknown);
|
49
62
|
return;
|
50
63
|
}
|
51
64
|
if (!quantity) {
|
52
|
-
setStatus(
|
65
|
+
setStatus(ProductQuantityStatusEnum.OutOfStock);
|
53
66
|
return;
|
54
67
|
}
|
55
|
-
if (
|
56
|
-
setStatus(
|
68
|
+
if (quantity - (quantityInBasket || 0) < 1) {
|
69
|
+
setStatus(ProductQuantityStatusEnum.MaxQuantityReached);
|
57
70
|
return;
|
58
71
|
}
|
59
|
-
setStatus(
|
72
|
+
setStatus(ProductQuantityStatusEnum.Available);
|
60
73
|
}, [
|
61
74
|
quantityInBasket,
|
62
75
|
quantity
|
@@ -3,9 +3,8 @@ import { EventEmitter } from '../helpers/eventEmitter';
|
|
3
3
|
import { EventStore } from '../helpers/eventStore';
|
4
4
|
import { defaultOptions } from '../helpers/options';
|
5
5
|
import { addClass, arrayFromCollection, debounce, removeClass } from '../helpers/utils';
|
6
|
-
function Carousel(sliderRoot
|
7
|
-
var userOptions =
|
8
|
-
} : param1;
|
6
|
+
function Carousel(sliderRoot) {
|
7
|
+
var userOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
9
8
|
var storeElements = function storeElements() {
|
10
9
|
if (!sliderRoot) throw new Error('Missing root node 😢');
|
11
10
|
var selector = options.containerSelector;
|
@@ -14,9 +13,8 @@ function Carousel(sliderRoot, param1) {
|
|
14
13
|
container = sliderContainer;
|
15
14
|
slides = arrayFromCollection(container.children);
|
16
15
|
};
|
17
|
-
var activate = function activate(
|
18
|
-
var partialOptions =
|
19
|
-
} : param;
|
16
|
+
var activate = function activate() {
|
17
|
+
var partialOptions = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
20
18
|
storeElements();
|
21
19
|
options = Object.assign(options, partialOptions);
|
22
20
|
engine = Engine(sliderRoot, container, slides, options, events);
|
@@ -81,9 +79,8 @@ function Carousel(sliderRoot, param1) {
|
|
81
79
|
};
|
82
80
|
eventStore.add(slide, 'focus', focus, true);
|
83
81
|
};
|
84
|
-
var reActivate = function reActivate(
|
85
|
-
var partialOptions =
|
86
|
-
} : param;
|
82
|
+
var reActivate = function reActivate() {
|
83
|
+
var partialOptions = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
87
84
|
var startIndex = selectedScrollSnap();
|
88
85
|
var newOptions = Object.assign({
|
89
86
|
startIndex: startIndex
|
@@ -112,8 +109,7 @@ function Carousel(sliderRoot, param1) {
|
|
112
109
|
if (!activated) return;
|
113
110
|
deActivate();
|
114
111
|
activated = false;
|
115
|
-
engine = {
|
116
|
-
};
|
112
|
+
engine = {};
|
117
113
|
events.emit('destroy');
|
118
114
|
};
|
119
115
|
var resize = function resize() {
|
@@ -121,14 +117,14 @@ function Carousel(sliderRoot, param1) {
|
|
121
117
|
if (rootElementSize !== newRootElementSize) reActivate();
|
122
118
|
events.emit('resize');
|
123
119
|
};
|
124
|
-
var slidesInView = function slidesInView(
|
125
|
-
var target =
|
120
|
+
var slidesInView = function slidesInView() {
|
121
|
+
var target = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
126
122
|
var location = engine[target ? 'target' : 'location'].get();
|
127
123
|
var type = options.loop ? 'removeOffset' : 'constrain';
|
128
124
|
return engine.slidesInView.check(engine.limit[type](location));
|
129
125
|
};
|
130
|
-
var slidesNotInView = function slidesNotInView(
|
131
|
-
var target =
|
126
|
+
var slidesNotInView = function slidesNotInView() {
|
127
|
+
var target = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
132
128
|
var inView = slidesInView(target);
|
133
129
|
return engine.snapIndexes.filter(function(i) {
|
134
130
|
return inView.indexOf(i) === -1;
|
@@ -163,8 +159,7 @@ function Carousel(sliderRoot, param1) {
|
|
163
159
|
var on = events.on, off = events.off;
|
164
160
|
var engine;
|
165
161
|
var activated = false;
|
166
|
-
var options = Object.assign({
|
167
|
-
}, defaultOptions);
|
162
|
+
var options = Object.assign({}, defaultOptions);
|
168
163
|
var rootElementSize = 0;
|
169
164
|
var container;
|
170
165
|
var slides;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export function EventStore() {
|
2
|
-
var add = function add(node, type, handler
|
3
|
-
var options =
|
2
|
+
var add = function add(node, type, handler) {
|
3
|
+
var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
4
4
|
node.addEventListener(type, handler, options);
|
5
5
|
listeners.push(function() {
|
6
6
|
return node.removeEventListener(type, handler, options);
|
@@ -1,15 +1,22 @@
|
|
1
1
|
import CarouselComponent from './component';
|
2
2
|
import { createElement, createRef, useCallback, useEffect, useState } from 'react';
|
3
|
+
function _arrayLikeToArray(arr, len) {
|
4
|
+
if (len == null || len > arr.length) len = arr.length;
|
5
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
6
|
+
return arr2;
|
7
|
+
}
|
3
8
|
function _arrayWithHoles(arr) {
|
4
9
|
if (Array.isArray(arr)) return arr;
|
5
10
|
}
|
6
11
|
function _iterableToArrayLimit(arr, i) {
|
12
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
13
|
+
if (_i == null) return;
|
7
14
|
var _arr = [];
|
8
15
|
var _n = true;
|
9
16
|
var _d = false;
|
10
|
-
var _e
|
17
|
+
var _s, _e;
|
11
18
|
try {
|
12
|
-
for(
|
19
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
13
20
|
_arr.push(_s.value);
|
14
21
|
if (i && _arr.length === i) break;
|
15
22
|
}
|
@@ -26,13 +33,21 @@ function _iterableToArrayLimit(arr, i) {
|
|
26
33
|
return _arr;
|
27
34
|
}
|
28
35
|
function _nonIterableRest() {
|
29
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
36
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
30
37
|
}
|
31
38
|
function _slicedToArray(arr, i) {
|
32
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
|
39
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
40
|
+
}
|
41
|
+
function _unsupportedIterableToArray(o, minLen) {
|
42
|
+
if (!o) return;
|
43
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
44
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
45
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
46
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
47
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
33
48
|
}
|
34
49
|
var canUseDOM = !!(typeof window !== 'undefined' && window.document);
|
35
|
-
function useCarousel(options) {
|
50
|
+
export function useCarousel(options) {
|
36
51
|
var ref = _slicedToArray(useState(), 2), carousel = ref[0], setCarousel = ref[1];
|
37
52
|
var container = createRef();
|
38
53
|
useEffect(function() {
|
@@ -65,4 +80,3 @@ function useCarousel(options) {
|
|
65
80
|
carousel
|
66
81
|
];
|
67
82
|
}
|
68
|
-
export { useCarousel };
|