@jetshop/core 5.16.1 → 5.17.0-alpha.f7018eb5
Sign up to get free protection for your applications and to get access to all the features.
- package/global.d.ts +26 -2
- package/package.json +2 -2
- package/ChannelHandler/ChannelHandler.d.ts +0 -53
- package/ChannelHandler/ChannelHandler.js +0 -114
- package/ChannelHandler/ChannelHandler.js.map +0 -1
- package/ChannelHandler/channelUtils.d.ts +0 -73
- package/ChannelHandler/channelUtils.js +0 -313
- package/ChannelHandler/channelUtils.js.map +0 -1
- package/ChannelHandler/redirectUtils.d.ts +0 -4
- package/ChannelHandler/redirectUtils.js +0 -50
- package/ChannelHandler/redirectUtils.js.map +0 -1
- package/analytics/Analytics.d.ts +0 -18
- package/analytics/Analytics.js +0 -57
- package/analytics/Analytics.js.map +0 -1
- package/analytics/AnalyticsProvider.d.ts +0 -54
- package/analytics/AnalyticsProvider.js +0 -229
- package/analytics/AnalyticsProvider.js.map +0 -1
- package/analytics/deprecatedTracking.d.ts +0 -17
- package/analytics/deprecatedTracking.js +0 -33
- package/analytics/deprecatedTracking.js.map +0 -1
- package/analytics/integrations/ga4.d.ts +0 -28
- package/analytics/integrations/ga4.js +0 -189
- package/analytics/integrations/ga4.js.map +0 -1
- package/analytics/integrations/gtag/gtag.d.ts +0 -8
- package/analytics/integrations/gtag/gtag.js +0 -209
- package/analytics/integrations/gtag/gtag.js.map +0 -1
- package/analytics/integrations/gtag/index.d.ts +0 -1
- package/analytics/integrations/gtag/index.js +0 -2
- package/analytics/integrations/gtag/index.js.map +0 -1
- package/analytics/integrations/gtm/gtm.d.ts +0 -12
- package/analytics/integrations/gtm/gtm.js +0 -227
- package/analytics/integrations/gtm/gtm.js.map +0 -1
- package/analytics/integrations/gtm/index.d.ts +0 -1
- package/analytics/integrations/gtm/index.js +0 -2
- package/analytics/integrations/gtm/index.js.map +0 -1
- package/analytics/integrations/gtm/referrerModifier.d.ts +0 -1
- package/analytics/integrations/gtm/referrerModifier.js +0 -62
- package/analytics/integrations/gtm/referrerModifier.js.map +0 -1
- package/analytics/integrations/releware/index.d.ts +0 -3
- package/analytics/integrations/releware/index.js +0 -39
- package/analytics/integrations/releware/index.js.map +0 -1
- package/analytics/integrations/unslugify.d.ts +0 -1
- package/analytics/integrations/unslugify.js +0 -16
- package/analytics/integrations/unslugify.js.map +0 -1
- package/analytics/trackerRegistry.d.ts +0 -113
- package/analytics/trackerRegistry.js +0 -222
- package/analytics/trackerRegistry.js.map +0 -1
- package/analytics/tracking.d.ts +0 -14
- package/analytics/tracking.js +0 -72
- package/analytics/tracking.js.map +0 -1
- package/analytics/utils/breadcrumbsWithoutProduct.d.ts +0 -1
- package/analytics/utils/breadcrumbsWithoutProduct.js +0 -9
- package/analytics/utils/breadcrumbsWithoutProduct.js.map +0 -1
- package/analytics/utils/script.d.ts +0 -8
- package/analytics/utils/script.js +0 -40
- package/analytics/utils/script.js.map +0 -1
- package/analytics/webVitals.d.ts +0 -5
- package/analytics/webVitals.js +0 -39
- package/analytics/webVitals.js.map +0 -1
- package/boot/AuthHandler.d.ts +0 -14
- package/boot/AuthHandler.js +0 -39
- package/boot/AuthHandler.js.map +0 -1
- package/boot/PreviewHandler.d.ts +0 -7
- package/boot/PreviewHandler.js +0 -14
- package/boot/PreviewHandler.js.map +0 -1
- package/boot/SharedTree.d.ts +0 -25
- package/boot/SharedTree.js +0 -29
- package/boot/SharedTree.js.map +0 -1
- package/boot/addMissingConfig.d.ts +0 -5
- package/boot/addMissingConfig.js +0 -34
- package/boot/addMissingConfig.js.map +0 -1
- package/boot/apollo.d.ts +0 -21
- package/boot/apollo.js +0 -198
- package/boot/apollo.js.map +0 -1
- package/boot/client/entrypoint.d.ts +0 -1
- package/boot/client/entrypoint.js +0 -5
- package/boot/client/entrypoint.js.map +0 -1
- package/boot/client/index.d.ts +0 -1
- package/boot/client/index.js +0 -2
- package/boot/client/index.js.map +0 -1
- package/boot/client/startClient.d.ts +0 -4
- package/boot/client/startClient.js +0 -144
- package/boot/client/startClient.js.map +0 -1
- package/boot/server/IntervalQuery.d.ts +0 -32
- package/boot/server/IntervalQuery.js +0 -95
- package/boot/server/IntervalQuery.js.map +0 -1
- package/boot/server/PersistedApolloClient.d.ts +0 -20
- package/boot/server/PersistedApolloClient.js +0 -40
- package/boot/server/PersistedApolloClient.js.map +0 -1
- package/boot/server/asyncErrorHandler.d.ts +0 -3
- package/boot/server/asyncErrorHandler.js +0 -5
- package/boot/server/asyncErrorHandler.js.map +0 -1
- package/boot/server/breakpointMiddleware.d.ts +0 -3
- package/boot/server/breakpointMiddleware.js +0 -10
- package/boot/server/breakpointMiddleware.js.map +0 -1
- package/boot/server/createApolloServer.d.ts +0 -28
- package/boot/server/createApolloServer.js +0 -144
- package/boot/server/createApolloServer.js.map +0 -1
- package/boot/server/createDevServer.d.ts +0 -14
- package/boot/server/createDevServer.js +0 -30
- package/boot/server/createDevServer.js.map +0 -1
- package/boot/server/createRenderer.d.ts +0 -28
- package/boot/server/createRenderer.js +0 -237
- package/boot/server/createRenderer.js.map +0 -1
- package/boot/server/createServer.d.ts +0 -14
- package/boot/server/createServer.js +0 -42
- package/boot/server/createServer.js.map +0 -1
- package/boot/server/entrypoint.d.ts +0 -1
- package/boot/server/entrypoint.js +0 -36
- package/boot/server/entrypoint.js.map +0 -1
- package/boot/server/getPrefetchFiles.d.ts +0 -10
- package/boot/server/getPrefetchFiles.js +0 -20
- package/boot/server/getPrefetchFiles.js.map +0 -1
- package/boot/server/getPreloadAssets.d.ts +0 -10
- package/boot/server/getPreloadAssets.js +0 -18
- package/boot/server/getPreloadAssets.js.map +0 -1
- package/boot/server/index.d.ts +0 -9
- package/boot/server/index.js +0 -123
- package/boot/server/index.js.map +0 -1
- package/boot/server/listen.d.ts +0 -13
- package/boot/server/listen.js +0 -17
- package/boot/server/listen.js.map +0 -1
- package/boot/server/persistedQueries/PersistedClient.d.ts +0 -22
- package/boot/server/persistedQueries/PersistedClient.js +0 -58
- package/boot/server/persistedQueries/PersistedClient.js.map +0 -1
- package/boot/server/persistedQueries/getPersistedQueriesForRequest.d.ts +0 -3
- package/boot/server/persistedQueries/getPersistedQueriesForRequest.js +0 -27
- package/boot/server/persistedQueries/getPersistedQueriesForRequest.js.map +0 -1
- package/boot/server/salesSource.d.ts +0 -8
- package/boot/server/salesSource.js +0 -16
- package/boot/server/salesSource.js.map +0 -1
- package/boot/utils/createIntOptions.d.ts +0 -6
- package/boot/utils/createIntOptions.js +0 -19
- package/boot/utils/createIntOptions.js.map +0 -1
- package/boot/utils/queryLoggingMiddleware.d.ts +0 -2
- package/boot/utils/queryLoggingMiddleware.js +0 -15
- package/boot/utils/queryLoggingMiddleware.js.map +0 -1
- package/boot/utils/uid.d.ts +0 -3
- package/boot/utils/uid.js +0 -20
- package/boot/utils/uid.js.map +0 -1
- package/cart/AddToCartFormik.d.ts +0 -42
- package/cart/AddToCartFormik.js +0 -77
- package/cart/AddToCartFormik.js.map +0 -1
- package/cart/useAddToCart.d.ts +0 -88
- package/cart/useAddToCart.js +0 -119
- package/cart/useAddToCart.js.map +0 -1
- package/cart/useCart.d.ts +0 -0
- package/cart/useCart.js +0 -1
- package/cart/useCart.js.map +0 -1
- package/components/Auth/CustomerFormContainer.d.ts +0 -0
- package/components/Auth/CustomerFormContainer.js +0 -1
- package/components/Auth/CustomerFormContainer.js.map +0 -1
- package/components/Auth/CustomerUpdateForm.d.ts +0 -32
- package/components/Auth/CustomerUpdateForm.js +0 -122
- package/components/Auth/CustomerUpdateForm.js.map +0 -1
- package/components/Auth/ForgotPasswordProvider.d.ts +0 -71
- package/components/Auth/ForgotPasswordProvider.js +0 -57
- package/components/Auth/ForgotPasswordProvider.js.map +0 -1
- package/components/Auth/ResetPasswordProvider.d.ts +0 -88
- package/components/Auth/ResetPasswordProvider.js +0 -78
- package/components/Auth/ResetPasswordProvider.js.map +0 -1
- package/components/Auth/SSN.d.ts +0 -12
- package/components/Auth/SSN.js +0 -35
- package/components/Auth/SSN.js.map +0 -1
- package/components/Auth/SSNLookupContainer.d.ts +0 -15
- package/components/Auth/SSNLookupContainer.js +0 -20
- package/components/Auth/SSNLookupContainer.js.map +0 -1
- package/components/Auth/SignupFormContainer.d.ts +0 -19
- package/components/Auth/SignupFormContainer.js +0 -82
- package/components/Auth/SignupFormContainer.js.map +0 -1
- package/components/Auth/UpdatePasswordForm.d.ts +0 -44
- package/components/Auth/UpdatePasswordForm.js +0 -98
- package/components/Auth/UpdatePasswordForm.js.map +0 -1
- package/components/Auth/formFieldsFromSettings.d.ts +0 -65
- package/components/Auth/formFieldsFromSettings.js +0 -77
- package/components/Auth/formFieldsFromSettings.js.map +0 -1
- package/components/Auth/formatSignupInput.d.ts +0 -8
- package/components/Auth/formatSignupInput.js +0 -43
- package/components/Auth/formatSignupInput.js.map +0 -1
- package/components/Auth/signup-context.d.ts +0 -36
- package/components/Auth/signup-context.js +0 -72
- package/components/Auth/signup-context.js.map +0 -1
- package/components/Auth/signup-field-translations.d.ts +0 -3
- package/components/Auth/signup-field-translations.js +0 -44
- package/components/Auth/signup-field-translations.js.map +0 -1
- package/components/Auth/signupSubmit.d.ts +0 -6
- package/components/Auth/signupSubmit.js +0 -57
- package/components/Auth/signupSubmit.js.map +0 -1
- package/components/Auth/useAddressFields.d.ts +0 -22
- package/components/Auth/useAddressFields.js +0 -33
- package/components/Auth/useAddressFields.js.map +0 -1
- package/components/Auth/useCustomer.d.ts +0 -116
- package/components/Auth/useCustomer.js +0 -189
- package/components/Auth/useCustomer.js.map +0 -1
- package/components/Auth/useLoginFields.d.ts +0 -20
- package/components/Auth/useLoginFields.js +0 -21
- package/components/Auth/useLoginFields.js.map +0 -1
- package/components/Auth/useSignupForm.d.ts +0 -7
- package/components/Auth/useSignupForm.js +0 -15
- package/components/Auth/useSignupForm.js.map +0 -1
- package/components/AuthContext/AuthContext.d.ts +0 -8
- package/components/AuthContext/AuthContext.js +0 -9
- package/components/AuthContext/AuthContext.js.map +0 -1
- package/components/AuthContext/AuthProvider.d.ts +0 -6
- package/components/AuthContext/AuthProvider.js +0 -85
- package/components/AuthContext/AuthProvider.js.map +0 -1
- package/components/AuthContext/LogOut.d.ts +0 -5
- package/components/AuthContext/LogOut.js +0 -15
- package/components/AuthContext/LogOut.js.map +0 -1
- package/components/AuthContext/useAuth.d.ts +0 -6
- package/components/AuthContext/useAuth.js +0 -21
- package/components/AuthContext/useAuth.js.map +0 -1
- package/components/BreakpointProvider.d.ts +0 -21
- package/components/BreakpointProvider.js +0 -24
- package/components/BreakpointProvider.js.map +0 -1
- package/components/Cart/CartIdContext.d.ts +0 -11
- package/components/Cart/CartIdContext.js +0 -61
- package/components/Cart/CartIdContext.js.map +0 -1
- package/components/ChannelContext/ChannelContext.d.ts +0 -21
- package/components/ChannelContext/ChannelContext.js +0 -4
- package/components/ChannelContext/ChannelContext.js.map +0 -1
- package/components/ChannelContext/ChannelProvider.d.ts +0 -10
- package/components/ChannelContext/ChannelProvider.js +0 -45
- package/components/ChannelContext/ChannelProvider.js.map +0 -1
- package/components/ChannelContext/index.d.ts +0 -2
- package/components/ChannelContext/index.js +0 -3
- package/components/ChannelContext/index.js.map +0 -1
- package/components/ChannelContext/useCountrySettings.d.ts +0 -8
- package/components/ChannelContext/useCountrySettings.js +0 -24
- package/components/ChannelContext/useCountrySettings.js.map +0 -1
- package/components/ConfigProvider.d.ts +0 -108
- package/components/ConfigProvider.js +0 -20
- package/components/ConfigProvider.js.map +0 -1
- package/components/DynamicRoute/CategoryRoute.d.ts +0 -13
- package/components/DynamicRoute/CategoryRoute.js +0 -56
- package/components/DynamicRoute/CategoryRoute.js.map +0 -1
- package/components/DynamicRoute/ContentRoute.d.ts +0 -14
- package/components/DynamicRoute/ContentRoute.js +0 -28
- package/components/DynamicRoute/ContentRoute.js.map +0 -1
- package/components/DynamicRoute/CustomerRoute.d.ts +0 -0
- package/components/DynamicRoute/CustomerRoute.js +0 -1
- package/components/DynamicRoute/CustomerRoute.js.map +0 -1
- package/components/DynamicRoute/PreviewRoute.d.ts +0 -17
- package/components/DynamicRoute/PreviewRoute.js +0 -58
- package/components/DynamicRoute/PreviewRoute.js.map +0 -1
- package/components/DynamicRoute/ProductByArticlenumber.d.ts +0 -5
- package/components/DynamicRoute/ProductByArticlenumber.js +0 -22
- package/components/DynamicRoute/ProductByArticlenumber.js.map +0 -1
- package/components/DynamicRoute/ProductRoute.d.ts +0 -15
- package/components/DynamicRoute/ProductRoute.js +0 -65
- package/components/DynamicRoute/ProductRoute.js.map +0 -1
- package/components/DynamicRoute/RouteResolver.d.ts +0 -22
- package/components/DynamicRoute/RouteResolver.js +0 -65
- package/components/DynamicRoute/RouteResolver.js.map +0 -1
- package/components/DynamicRoute/Status.d.ts +0 -14
- package/components/DynamicRoute/Status.js +0 -20
- package/components/DynamicRoute/Status.js.map +0 -1
- package/components/DynamicRoute/index.d.ts +0 -17
- package/components/DynamicRoute/index.js +0 -96
- package/components/DynamicRoute/index.js.map +0 -1
- package/components/Filters/index.d.ts +0 -1
- package/components/Filters/index.js +0 -2
- package/components/Filters/index.js.map +0 -1
- package/components/Filters/utils/replaceInSearch.d.ts +0 -14
- package/components/Filters/utils/replaceInSearch.js +0 -23
- package/components/Filters/utils/replaceInSearch.js.map +0 -1
- package/components/Filters/utils/updateHistory.d.ts +0 -25
- package/components/Filters/utils/updateHistory.js +0 -30
- package/components/Filters/utils/updateHistory.js.map +0 -1
- package/components/Fonts/CustomFont.d.ts +0 -14
- package/components/Fonts/CustomFont.js +0 -17
- package/components/Fonts/CustomFont.js.map +0 -1
- package/components/Fonts/GoogleFont.d.ts +0 -10
- package/components/Fonts/GoogleFont.js +0 -35
- package/components/Fonts/GoogleFont.js.map +0 -1
- package/components/Fonts/TypekitFont.d.ts +0 -16
- package/components/Fonts/TypekitFont.js +0 -25
- package/components/Fonts/TypekitFont.js.map +0 -1
- package/components/Fonts/injectFont.d.ts +0 -11
- package/components/Fonts/injectFont.js +0 -30
- package/components/Fonts/injectFont.js.map +0 -1
- package/components/Head.d.ts +0 -11
- package/components/Head.js +0 -84
- package/components/Head.js.map +0 -1
- package/components/Mutation/AddToCart/addToCartUtils.d.ts +0 -18
- package/components/Mutation/AddToCart/addToCartUtils.js +0 -52
- package/components/Mutation/AddToCart/addToCartUtils.js.map +0 -1
- package/components/Mutation/AddToCartFormik.d.ts +0 -53
- package/components/Mutation/AddToCartFormik.js +0 -173
- package/components/Mutation/AddToCartFormik.js.map +0 -1
- package/components/Mutation/DecrementQuantity.d.ts +0 -4
- package/components/Mutation/DecrementQuantity.js +0 -35
- package/components/Mutation/DecrementQuantity.js.map +0 -1
- package/components/Mutation/IncrementQuantity.d.ts +0 -4
- package/components/Mutation/IncrementQuantity.js +0 -35
- package/components/Mutation/IncrementQuantity.js.map +0 -1
- package/components/Mutation/RemoveFromCart.d.ts +0 -5
- package/components/Mutation/RemoveFromCart.js +0 -52
- package/components/Mutation/RemoveFromCart.js.map +0 -1
- package/components/Mutation/SetQuantity.d.ts +0 -4
- package/components/Mutation/SetQuantity.js +0 -37
- package/components/Mutation/SetQuantity.js.map +0 -1
- package/components/Mutation/SubscribeToNewsletter.d.ts +0 -4
- package/components/Mutation/SubscribeToNewsletter.js +0 -30
- package/components/Mutation/SubscribeToNewsletter.js.map +0 -1
- package/components/Mutation/SubscribeToStockNotifications.d.ts +0 -4
- package/components/Mutation/SubscribeToStockNotifications.js +0 -31
- package/components/Mutation/SubscribeToStockNotifications.js.map +0 -1
- package/components/Mutation/cartMutationUtils.d.ts +0 -28
- package/components/Mutation/cartMutationUtils.js +0 -109
- package/components/Mutation/cartMutationUtils.js.map +0 -1
- package/components/Mutation/useDecrementQuantity.d.ts +0 -11
- package/components/Mutation/useDecrementQuantity.js +0 -54
- package/components/Mutation/useDecrementQuantity.js.map +0 -1
- package/components/Mutation/useIncrementQuantity.d.ts +0 -11
- package/components/Mutation/useIncrementQuantity.js +0 -54
- package/components/Mutation/useIncrementQuantity.js.map +0 -1
- package/components/Mutation/useRemoveFromCart.d.ts +0 -13
- package/components/Mutation/useRemoveFromCart.js +0 -50
- package/components/Mutation/useRemoveFromCart.js.map +0 -1
- package/components/Mutation/useSetQuantity.d.ts +0 -12
- package/components/Mutation/useSetQuantity.js +0 -38
- package/components/Mutation/useSetQuantity.js.map +0 -1
- package/components/Notifications/Notifications.d.ts +0 -15
- package/components/Notifications/Notifications.js +0 -27
- package/components/Notifications/Notifications.js.map +0 -1
- package/components/Notifications/index.d.ts +0 -2
- package/components/Notifications/index.js +0 -3
- package/components/Notifications/index.js.map +0 -1
- package/components/Notifications/notificationMachine.d.ts +0 -30
- package/components/Notifications/notificationMachine.js +0 -74
- package/components/Notifications/notificationMachine.js.map +0 -1
- package/components/Notifications/notificationsMachine.d.ts +0 -37
- package/components/Notifications/notificationsMachine.js +0 -66
- package/components/Notifications/notificationsMachine.js.map +0 -1
- package/components/Notifications/useNotification.d.ts +0 -9
- package/components/Notifications/useNotification.js +0 -27
- package/components/Notifications/useNotification.js.map +0 -1
- package/components/OpenGraph/OpenGraphGeneralPageData.d.ts +0 -25
- package/components/OpenGraph/OpenGraphGeneralPageData.js +0 -37
- package/components/OpenGraph/OpenGraphGeneralPageData.js.map +0 -1
- package/components/OpenGraph/OpenGraphProductData.d.ts +0 -25
- package/components/OpenGraph/OpenGraphProductData.js +0 -49
- package/components/OpenGraph/OpenGraphProductData.js.map +0 -1
- package/components/OpenGraph/index.d.ts +0 -2
- package/components/OpenGraph/index.js +0 -3
- package/components/OpenGraph/index.js.map +0 -1
- package/components/Pagination/PaginationContainer.d.ts +0 -2
- package/components/Pagination/PaginationContainer.js +0 -5
- package/components/Pagination/PaginationContainer.js.map +0 -1
- package/components/Pagination/PaginationContext.d.ts +0 -14
- package/components/Pagination/PaginationContext.js +0 -4
- package/components/Pagination/PaginationContext.js.map +0 -1
- package/components/Pagination/PaginationProvider.d.ts +0 -19
- package/components/Pagination/PaginationProvider.js +0 -95
- package/components/Pagination/PaginationProvider.js.map +0 -1
- package/components/PreviewContext.d.ts +0 -10
- package/components/PreviewContext.js +0 -27
- package/components/PreviewContext.js.map +0 -1
- package/components/ProductConfigurationProvider/ProductConfigurationContext.d.ts +0 -13
- package/components/ProductConfigurationProvider/ProductConfigurationContext.js +0 -5
- package/components/ProductConfigurationProvider/ProductConfigurationContext.js.map +0 -1
- package/components/ProductConfigurationProvider/ProductConfigurationProvider.d.ts +0 -6
- package/components/ProductConfigurationProvider/ProductConfigurationProvider.js +0 -50
- package/components/ProductConfigurationProvider/ProductConfigurationProvider.js.map +0 -1
- package/components/Query/CartProvider.d.ts +0 -22
- package/components/Query/CartProvider.js +0 -68
- package/components/Query/CartProvider.js.map +0 -1
- package/components/SortOrder/SortOrderContainer.d.ts +0 -40
- package/components/SortOrder/SortOrderContainer.js +0 -108
- package/components/SortOrder/SortOrderContainer.js.map +0 -1
- package/components/SortOrder/SortOrderContext.d.ts +0 -9
- package/components/SortOrder/SortOrderContext.js +0 -9
- package/components/SortOrder/SortOrderContext.js.map +0 -1
- package/components/StructuredData/SiteLinksSearchStructuredData.d.ts +0 -3
- package/components/StructuredData/SiteLinksSearchStructuredData.js +0 -25
- package/components/StructuredData/SiteLinksSearchStructuredData.js.map +0 -1
- package/components/StructuredData/StructuredBreadcrumbData.d.ts +0 -12
- package/components/StructuredData/StructuredBreadcrumbData.js +0 -55
- package/components/StructuredData/StructuredBreadcrumbData.js.map +0 -1
- package/components/StructuredData/StructuredCategoryData.d.ts +0 -16
- package/components/StructuredData/StructuredCategoryData.js +0 -18
- package/components/StructuredData/StructuredCategoryData.js.map +0 -1
- package/components/StructuredData/StructuredData.d.ts +0 -9
- package/components/StructuredData/StructuredData.js +0 -7
- package/components/StructuredData/StructuredData.js.map +0 -1
- package/components/StructuredData/StructuredPageData.d.ts +0 -16
- package/components/StructuredData/StructuredPageData.js +0 -17
- package/components/StructuredData/StructuredPageData.js.map +0 -1
- package/components/StructuredData/StructuredProductData.d.ts +0 -18
- package/components/StructuredData/StructuredProductData.js +0 -43
- package/components/StructuredData/StructuredProductData.js.map +0 -1
- package/components/StructuredData/index.d.ts +0 -5
- package/components/StructuredData/index.js +0 -6
- package/components/StructuredData/index.js.map +0 -1
- package/data/cache.d.ts +0 -3
- package/data/cache.js +0 -21
- package/data/cache.js.map +0 -1
- package/data/fragmentTypes.d.ts +0 -8
- package/data/fragmentTypes.js +0 -84
- package/data/fragmentTypes.js.map +0 -1
- package/data/fragments/index.d.ts +0 -1
- package/data/fragments/index.js +0 -2
- package/data/fragments/index.js.map +0 -1
- package/errorReporting.browser.d.ts +0 -3
- package/errorReporting.browser.js +0 -12
- package/errorReporting.browser.js.map +0 -1
- package/errorReporting.d.ts +0 -3
- package/errorReporting.js +0 -20
- package/errorReporting.js.map +0 -1
- package/errorReporting.server.d.ts +0 -3
- package/errorReporting.server.js +0 -12
- package/errorReporting.server.js.map +0 -1
- package/errorReporting.shared.d.ts +0 -5
- package/errorReporting.shared.js +0 -17
- package/errorReporting.shared.js.map +0 -1
- package/experiments/ExperimentsProvider.d.ts +0 -4
- package/experiments/ExperimentsProvider.js +0 -29
- package/experiments/ExperimentsProvider.js.map +0 -1
- package/experiments/selectExperimentVariant.d.ts +0 -3
- package/experiments/selectExperimentVariant.js +0 -35
- package/experiments/selectExperimentVariant.js.map +0 -1
- package/experiments/useExperiment.d.ts +0 -2
- package/experiments/useExperiment.js +0 -11
- package/experiments/useExperiment.js.map +0 -1
- package/helpers/decodeUrlQuery.d.ts +0 -9
- package/helpers/decodeUrlQuery.js +0 -27
- package/helpers/decodeUrlQuery.js.map +0 -1
- package/helpers/distance.d.ts +0 -7
- package/helpers/distance.js +0 -13
- package/helpers/distance.js.map +0 -1
- package/helpers/encodeVariant.d.ts +0 -3
- package/helpers/encodeVariant.js +0 -25
- package/helpers/encodeVariant.js.map +0 -1
- package/helpers/getBreakpointsFromValues.d.ts +0 -6
- package/helpers/getBreakpointsFromValues.js +0 -15
- package/helpers/getBreakpointsFromValues.js.map +0 -1
- package/helpers/getCartItemVariant.d.ts +0 -7
- package/helpers/getCartItemVariant.js +0 -9
- package/helpers/getCartItemVariant.js.map +0 -1
- package/helpers/getErrorDetail.d.ts +0 -7
- package/helpers/getErrorDetail.js +0 -12
- package/helpers/getErrorDetail.js.map +0 -1
- package/helpers/getHeaders.d.ts +0 -6
- package/helpers/getHeaders.js +0 -4
- package/helpers/getHeaders.js.map +0 -1
- package/helpers/isRelativeUrl.d.ts +0 -1
- package/helpers/isRelativeUrl.js +0 -4
- package/helpers/isRelativeUrl.js.map +0 -1
- package/helpers/logError.d.ts +0 -1
- package/helpers/logError.js +0 -17
- package/helpers/logError.js.map +0 -1
- package/helpers/logWarningInDev.d.ts +0 -1
- package/helpers/logWarningInDev.js +0 -7
- package/helpers/logWarningInDev.js.map +0 -1
- package/helpers/throwErrorInDev.d.ts +0 -6
- package/helpers/throwErrorInDev.js +0 -15
- package/helpers/throwErrorInDev.js.map +0 -1
- package/helpers/uniqueId.d.ts +0 -5
- package/helpers/uniqueId.js +0 -10
- package/helpers/uniqueId.js.map +0 -1
- package/hooks/Channels/useChannelSettings.d.ts +0 -7
- package/hooks/Channels/useChannelSettings.js +0 -12
- package/hooks/Channels/useChannelSettings.js.map +0 -1
- package/hooks/Filters/useBooleanFilter.d.ts +0 -8
- package/hooks/Filters/useBooleanFilter.js +0 -21
- package/hooks/Filters/useBooleanFilter.js.map +0 -1
- package/hooks/Filters/useFilters.d.ts +0 -3
- package/hooks/Filters/useFilters.js +0 -16
- package/hooks/Filters/useFilters.js.map +0 -1
- package/hooks/Filters/useListFilter.d.ts +0 -10
- package/hooks/Filters/useListFilter.js +0 -38
- package/hooks/Filters/useListFilter.js.map +0 -1
- package/hooks/Filters/useMultiFilter.d.ts +0 -13
- package/hooks/Filters/useMultiFilter.js +0 -50
- package/hooks/Filters/useMultiFilter.js.map +0 -1
- package/hooks/Filters/useRangeFilter.d.ts +0 -10
- package/hooks/Filters/useRangeFilter.js +0 -36
- package/hooks/Filters/useRangeFilter.js.map +0 -1
- package/hooks/Filters/useSortOrder.d.ts +0 -11
- package/hooks/Filters/useSortOrder.js +0 -22
- package/hooks/Filters/useSortOrder.js.map +0 -1
- package/hooks/PackageProducts/index.d.ts +0 -2
- package/hooks/PackageProducts/index.js +0 -3
- package/hooks/PackageProducts/index.js.map +0 -1
- package/hooks/PackageProducts/usePackageProductItem.d.ts +0 -17
- package/hooks/PackageProducts/usePackageProductItem.js +0 -27
- package/hooks/PackageProducts/usePackageProductItem.js.map +0 -1
- package/hooks/PackageProducts/usePackageProducts.d.ts +0 -19
- package/hooks/PackageProducts/usePackageProducts.js +0 -346
- package/hooks/PackageProducts/usePackageProducts.js.map +0 -1
- package/hooks/Product/index.d.ts +0 -1
- package/hooks/Product/index.js +0 -2
- package/hooks/Product/index.js.map +0 -1
- package/hooks/Product/useStockStatus.d.ts +0 -9
- package/hooks/Product/useStockStatus.js +0 -26
- package/hooks/Product/useStockStatus.js.map +0 -1
- package/hooks/Product/useSwitchToVariantImage.d.ts +0 -9
- package/hooks/Product/useSwitchToVariantImage.js +0 -21
- package/hooks/Product/useSwitchToVariantImage.js.map +0 -1
- package/hooks/ProductList/ProductListContext.d.ts +0 -7
- package/hooks/ProductList/ProductListContext.js +0 -111
- package/hooks/ProductList/ProductListContext.js.map +0 -1
- package/hooks/ProductList/action-creators.d.ts +0 -46
- package/hooks/ProductList/action-creators.js +0 -297
- package/hooks/ProductList/action-creators.js.map +0 -1
- package/hooks/ProductList/index.d.ts +0 -118
- package/hooks/ProductList/index.js +0 -22
- package/hooks/ProductList/index.js.map +0 -1
- package/hooks/ProductList/list-transforms.d.ts +0 -75
- package/hooks/ProductList/list-transforms.js +0 -107
- package/hooks/ProductList/list-transforms.js.map +0 -1
- package/hooks/ProductList/product-list-reducer.d.ts +0 -76
- package/hooks/ProductList/product-list-reducer.js +0 -198
- package/hooks/ProductList/product-list-reducer.js.map +0 -1
- package/hooks/ProductList/useProductList.d.ts +0 -13
- package/hooks/ProductList/useProductList.js +0 -94
- package/hooks/ProductList/useProductList.js.map +0 -1
- package/hooks/ProductList/useProductListItems.d.ts +0 -10
- package/hooks/ProductList/useProductListItems.js +0 -49
- package/hooks/ProductList/useProductListItems.js.map +0 -1
- package/hooks/ProductList/validate-product.d.ts +0 -6
- package/hooks/ProductList/validate-product.js +0 -41
- package/hooks/ProductList/validate-product.js.map +0 -1
- package/hooks/Subscriptions/useNewsletterSubscription.d.ts +0 -38
- package/hooks/Subscriptions/useNewsletterSubscription.js +0 -42
- package/hooks/Subscriptions/useNewsletterSubscription.js.map +0 -1
- package/hooks/Subscriptions/useStockNotifications.d.ts +0 -36
- package/hooks/Subscriptions/useStockNotifications.js +0 -38
- package/hooks/Subscriptions/useStockNotifications.js.map +0 -1
- package/hooks/Subscriptions/useStoreSubscriptions.d.ts +0 -48
- package/hooks/Subscriptions/useStoreSubscriptions.js +0 -151
- package/hooks/Subscriptions/useStoreSubscriptions.js.map +0 -1
- package/hooks/useAddMultipleToCart.d.ts +0 -27
- package/hooks/useAddMultipleToCart.js +0 -114
- package/hooks/useAddMultipleToCart.js.map +0 -1
- package/hooks/useChannels.d.ts +0 -1
- package/hooks/useChannels.js +0 -10
- package/hooks/useChannels.js.map +0 -1
- package/hooks/useCustomerOrdersQuery.d.ts +0 -21
- package/hooks/useCustomerOrdersQuery.js +0 -21
- package/hooks/useCustomerOrdersQuery.js.map +0 -1
- package/hooks/useDeleteAccountMutation.d.ts +0 -15
- package/hooks/useDeleteAccountMutation.js +0 -39
- package/hooks/useDeleteAccountMutation.js.map +0 -1
- package/hooks/useDynamicPrice.d.ts +0 -3
- package/hooks/useDynamicPrice.js +0 -25
- package/hooks/useDynamicPrice.js.map +0 -1
- package/hooks/useFreeShippingCheck.d.ts +0 -15
- package/hooks/useFreeShippingCheck.js +0 -31
- package/hooks/useFreeShippingCheck.js.map +0 -1
- package/hooks/useGeolocation.d.ts +0 -11
- package/hooks/useGeolocation.js +0 -34
- package/hooks/useGeolocation.js.map +0 -1
- package/hooks/useInfinitePagination.d.ts +0 -37
- package/hooks/useInfinitePagination.js +0 -139
- package/hooks/useInfinitePagination.js.map +0 -1
- package/hooks/useLogError.d.ts +0 -1
- package/hooks/useLogError.js +0 -8
- package/hooks/useLogError.js.map +0 -1
- package/hooks/useLoginMutation.d.ts +0 -12
- package/hooks/useLoginMutation.js +0 -15
- package/hooks/useLoginMutation.js.map +0 -1
- package/hooks/useLoginRedirect.d.ts +0 -4
- package/hooks/useLoginRedirect.js +0 -37
- package/hooks/useLoginRedirect.js.map +0 -1
- package/hooks/useOrderDetailQuery.d.ts +0 -20
- package/hooks/useOrderDetailQuery.js +0 -29
- package/hooks/useOrderDetailQuery.js.map +0 -1
- package/hooks/usePreconnectLinks.d.ts +0 -10
- package/hooks/usePreconnectLinks.js +0 -30
- package/hooks/usePreconnectLinks.js.map +0 -1
- package/hooks/usePrice.d.ts +0 -41
- package/hooks/usePrice.js +0 -73
- package/hooks/usePrice.js.map +0 -1
- package/hooks/useProductVariants/index.d.ts +0 -1
- package/hooks/useProductVariants/index.js +0 -2
- package/hooks/useProductVariants/index.js.map +0 -1
- package/hooks/useProductVariants/useProductVariants.d.ts +0 -19
- package/hooks/useProductVariants/useProductVariants.js +0 -203
- package/hooks/useProductVariants/useProductVariants.js.map +0 -1
- package/hooks/useProductVariants/useVariantFromUrl.d.ts +0 -5
- package/hooks/useProductVariants/useVariantFromUrl.js +0 -16
- package/hooks/useProductVariants/useVariantFromUrl.js.map +0 -1
- package/hooks/useRoutePreload.d.ts +0 -24
- package/hooks/useRoutePreload.js +0 -40
- package/hooks/useRoutePreload.js.map +0 -1
- package/hooks/useShopConfig.d.ts +0 -1
- package/hooks/useShopConfig.js +0 -11
- package/hooks/useShopConfig.js.map +0 -1
- package/hooks/useThrowErrorInDev.d.ts +0 -1
- package/hooks/useThrowErrorInDev.js +0 -8
- package/hooks/useThrowErrorInDev.js.map +0 -1
- package/hooks/useThunkReducer.d.ts +0 -7
- package/hooks/useThunkReducer.js +0 -24
- package/hooks/useThunkReducer.js.map +0 -1
- package/hooks/useWarningInDev.d.ts +0 -1
- package/hooks/useWarningInDev.js +0 -10
- package/hooks/useWarningInDev.js.map +0 -1
- package/inServer.d.ts +0 -1
- package/inServer.js +0 -3
- package/inServer.js.map +0 -1
- package/index.d.ts +0 -1
- package/index.js +0 -2
- package/index.js.map +0 -1
- package/integrations/addwishSchemaExtension.d.ts +0 -35
- package/integrations/addwishSchemaExtension.js +0 -141
- package/integrations/addwishSchemaExtension.js.map +0 -1
- package/integrations/nostoSchemaExtension.d.ts +0 -5
- package/integrations/nostoSchemaExtension.js +0 -77
- package/integrations/nostoSchemaExtension.js.map +0 -1
- package/integrations/sluggishSchemaExtension.d.ts +0 -2
- package/integrations/sluggishSchemaExtension.js +0 -27
- package/integrations/sluggishSchemaExtension.js.map +0 -1
- package/polyfills.d.ts +0 -1
- package/polyfills.js +0 -38
- package/polyfills.js.map +0 -1
- package/resolvers/filters/boolFilter.d.ts +0 -3
- package/resolvers/filters/boolFilter.js +0 -85
- package/resolvers/filters/boolFilter.js.map +0 -1
- package/resolvers/filters/defaultActiveFilters.d.ts +0 -3
- package/resolvers/filters/defaultActiveFilters.js +0 -9
- package/resolvers/filters/defaultActiveFilters.js.map +0 -1
- package/resolvers/filters/filterParams.d.ts +0 -3
- package/resolvers/filters/filterParams.js +0 -85
- package/resolvers/filters/filterParams.js.map +0 -1
- package/resolvers/filters/filters.d.ts +0 -5
- package/resolvers/filters/filters.js +0 -79
- package/resolvers/filters/filters.js.map +0 -1
- package/resolvers/filters/index.d.ts +0 -27
- package/resolvers/filters/index.js +0 -8
- package/resolvers/filters/index.js.map +0 -1
- package/resolvers/filters/listFilter.d.ts +0 -7
- package/resolvers/filters/listFilter.js +0 -74
- package/resolvers/filters/listFilter.js.map +0 -1
- package/resolvers/filters/listFilterItem.d.ts +0 -3
- package/resolvers/filters/listFilterItem.js +0 -123
- package/resolvers/filters/listFilterItem.js.map +0 -1
- package/resolvers/filters/multiListFilter.d.ts +0 -5
- package/resolvers/filters/multiListFilter.js +0 -196
- package/resolvers/filters/multiListFilter.js.map +0 -1
- package/resolvers/filters/multiListFilterList.d.ts +0 -3
- package/resolvers/filters/multiListFilterList.js +0 -56
- package/resolvers/filters/multiListFilterList.js.map +0 -1
- package/resolvers/filters/rangeFilter.d.ts +0 -5
- package/resolvers/filters/rangeFilter.js +0 -138
- package/resolvers/filters/rangeFilter.js.map +0 -1
- package/resolvers/filters/updateQueryString.d.ts +0 -12
- package/resolvers/filters/updateQueryString.js +0 -117
- package/resolvers/filters/updateQueryString.js.map +0 -1
- package/resolvers/index.d.ts +0 -37
- package/resolvers/index.js +0 -38
- package/resolvers/index.js.map +0 -1
- package/sentry/client.d.ts +0 -1
- package/sentry/client.js +0 -30
- package/sentry/client.js.map +0 -1
- package/sentry/common.d.ts +0 -1
- package/sentry/common.js +0 -5
- package/sentry/common.js.map +0 -1
- package/sentry/server.d.ts +0 -1
- package/sentry/server.js +0 -20
- package/sentry/server.js.map +0 -1
- package/sentry/utils.d.ts +0 -1
- package/sentry/utils.js +0 -2
- package/sentry/utils.js.map +0 -1
- package/server/graphql.d.ts +0 -20
- package/server/graphql.js +0 -119
- package/server/graphql.js.map +0 -1
- package/server/index.d.ts +0 -2
- package/server/index.js +0 -3
- package/server/index.js.map +0 -1
- package/server/tracking/facebook.d.ts +0 -5
- package/server/tracking/facebook.js +0 -148
- package/server/tracking/facebook.js.map +0 -1
- package/server/tracking/middleware.d.ts +0 -8
- package/server/tracking/middleware.js +0 -15
- package/server/tracking/middleware.js.map +0 -1
- package/time.d.ts +0 -1
- package/time.js +0 -6
- package/time.js.map +0 -1
@@ -1,118 +0,0 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import { DocumentNode } from 'graphql';
|
3
|
-
import { MutationTuple, QueryResult } from 'react-apollo';
|
4
|
-
import { CustomerProductListResult, MutationCreateCustomerProductListArgs, MutationAddToCustomerProductListArgs, MutationRemoveFromCustomerProductListArgs, MutationUpdateCustomerProductListItemArgs, Product, ProductVariant, QueryCustomerProductListArgs, QueryProductsArgs } from '../../types';
|
5
|
-
import { ThunkAction } from '../useThunkReducer';
|
6
|
-
import { Action } from './product-list-reducer';
|
7
|
-
export { useProductList } from './useProductList';
|
8
|
-
export { useProductListItems } from './useProductListItems';
|
9
|
-
export interface UpdateListOptions {
|
10
|
-
quantity?: number;
|
11
|
-
description?: string;
|
12
|
-
productName?: string;
|
13
|
-
}
|
14
|
-
export interface ProductListContextOptions {
|
15
|
-
state: ProductListState;
|
16
|
-
dispatch: React.Dispatch<Action | ThunkAction<ProductListState, Action>>;
|
17
|
-
usingLocalList: boolean;
|
18
|
-
queries: ProductListQueries;
|
19
|
-
}
|
20
|
-
/**
|
21
|
-
* A Product list mapping is a mapping between an ID and a product list
|
22
|
-
*
|
23
|
-
* As a convenienve, an ID of null is used for the "default" product list.
|
24
|
-
*/
|
25
|
-
export declare type ProductListId = string | null;
|
26
|
-
export declare type ProductListMap = Map<ProductListId, NormalizedProductList>;
|
27
|
-
export interface NormalizedProductList {
|
28
|
-
name: string | null;
|
29
|
-
items: {
|
30
|
-
[articleNumber: string]: {
|
31
|
-
options: ProductListItemOptions;
|
32
|
-
variants: ProductListItemVariants | null;
|
33
|
-
};
|
34
|
-
};
|
35
|
-
}
|
36
|
-
export declare const PRODUCT_LISTS_KEY = "productLists";
|
37
|
-
export declare function emptyProductLists(): ProductListMap;
|
38
|
-
export declare function productListMapToArray(map: ProductListMap): [string, NormalizedProductList][];
|
39
|
-
export declare function productListArrayToMap(array: [ProductListId, NormalizedProductList][]): Map<string, NormalizedProductList>;
|
40
|
-
export interface ProductListState {
|
41
|
-
loggedIn: boolean;
|
42
|
-
lists: ProductListMap;
|
43
|
-
requestIdRef: React.MutableRefObject<string | null>;
|
44
|
-
}
|
45
|
-
export interface ProductListQueries {
|
46
|
-
/** Products query, used for retrieving products from localList */
|
47
|
-
productsQuery: DocumentNode;
|
48
|
-
/** The customerProductLists query */
|
49
|
-
all: DocumentNode;
|
50
|
-
/** The customerProductList query */
|
51
|
-
query: DocumentNode;
|
52
|
-
/** The createCustomerProductList mutation */
|
53
|
-
createList: DocumentNode;
|
54
|
-
/** The deleteCustomerProductList mutation */
|
55
|
-
deleteList: DocumentNode;
|
56
|
-
/** The addToCustomerProductList mutation */
|
57
|
-
add: DocumentNode;
|
58
|
-
/** An addToCustomerProductList mutation that returns the full list */
|
59
|
-
login: DocumentNode;
|
60
|
-
/** The removeToCustomerProductList mutation */
|
61
|
-
remove: DocumentNode;
|
62
|
-
/** The updateCustomerProductListItem mutation */
|
63
|
-
update: DocumentNode;
|
64
|
-
}
|
65
|
-
export interface UpdateListInput extends UpdateListOptions {
|
66
|
-
variantArticleNumber?: string;
|
67
|
-
}
|
68
|
-
export interface ProductListDetail {
|
69
|
-
/** Whether a query is in flight for the products in the list */
|
70
|
-
loading: boolean;
|
71
|
-
/** An array containing the product data */
|
72
|
-
products: ProductListProduct[];
|
73
|
-
}
|
74
|
-
export interface FlattenedProductListItem {
|
75
|
-
articleNumber: string;
|
76
|
-
parentArticleNumber?: string;
|
77
|
-
options: ProductListItemOptions;
|
78
|
-
}
|
79
|
-
export interface ProductListItemOptions {
|
80
|
-
quantity?: number;
|
81
|
-
description?: string;
|
82
|
-
}
|
83
|
-
export interface ProductListItemVariants {
|
84
|
-
[articleNumber: string]: {
|
85
|
-
options: ProductListItemOptions;
|
86
|
-
/** TODO: change to baseArticleNumber ? */
|
87
|
-
parentArticleNumber: string;
|
88
|
-
};
|
89
|
-
}
|
90
|
-
export interface ProductListProduct extends Product {
|
91
|
-
quantity: number;
|
92
|
-
isVariant: boolean;
|
93
|
-
variant: ProductVariant;
|
94
|
-
validation: ProductListProductValidation;
|
95
|
-
}
|
96
|
-
export declare type ProductListProductValidation = {
|
97
|
-
status: 'valid' | 'outOfStock' | 'configurations' | 'missingVariant' | 'preOrder' | 'package';
|
98
|
-
message: string;
|
99
|
-
};
|
100
|
-
export declare type AddToListMutation = MutationTuple<{
|
101
|
-
addToCustomerProductList: CustomerProductListResult;
|
102
|
-
}, MutationAddToCustomerProductListArgs>;
|
103
|
-
export declare type CreateListMutation = MutationTuple<{
|
104
|
-
createCustomerProductList: CustomerProductListResult;
|
105
|
-
}, MutationCreateCustomerProductListArgs>;
|
106
|
-
export declare type RemoveFromListMutation = MutationTuple<{
|
107
|
-
removeFromCustomerProductList: CustomerProductListResult;
|
108
|
-
}, MutationRemoveFromCustomerProductListArgs>;
|
109
|
-
export declare type UpdateListItemMutation = MutationTuple<{
|
110
|
-
updateCustomerProductListItem: CustomerProductListResult;
|
111
|
-
}, MutationUpdateCustomerProductListItemArgs>;
|
112
|
-
export declare type ListsProductsQuery = QueryResult<{
|
113
|
-
customerProductLists: CustomerProductListResult[];
|
114
|
-
}>;
|
115
|
-
export declare type ListProductsQuery = QueryResult<CustomerProductListResult, QueryCustomerProductListArgs>;
|
116
|
-
export declare type ProductsQuery = QueryResult<{
|
117
|
-
products: Product[];
|
118
|
-
}, QueryProductsArgs>;
|
@@ -1,22 +0,0 @@
|
|
1
|
-
export { useProductList } from './useProductList';
|
2
|
-
export { useProductListItems } from './useProductListItems';
|
3
|
-
export const PRODUCT_LISTS_KEY = 'productLists';
|
4
|
-
export function emptyProductLists() {
|
5
|
-
return new Map([
|
6
|
-
[
|
7
|
-
null,
|
8
|
-
{
|
9
|
-
items: {},
|
10
|
-
name: null
|
11
|
-
}
|
12
|
-
]
|
13
|
-
]);
|
14
|
-
}
|
15
|
-
export function productListMapToArray(map) {
|
16
|
-
const [...array] = map;
|
17
|
-
return array;
|
18
|
-
}
|
19
|
-
export function productListArrayToMap(array) {
|
20
|
-
return new Map(array);
|
21
|
-
}
|
22
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAgC5D,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAEhD,MAAM,UAAU,iBAAiB;IAC/B,OAAO,IAAI,GAAG,CAAC;QACb;YACE,IAAI;YACJ;gBACE,KAAK,EAAE,EAAE;gBACT,IAAI,EAAE,IAAI;aACX;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,GAAmB;IACvD,MAAM,CAAC,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC;IACvB,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,KAA+C;IAE/C,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC"}
|
@@ -1,75 +0,0 @@
|
|
1
|
-
import { FlattenedProductListItem, NormalizedProductList, ProductsQuery } from '.';
|
2
|
-
import { CustomerProductList, Product } from '../../types';
|
3
|
-
/**
|
4
|
-
* Converts a product list returned from the API to our normalized structure
|
5
|
-
* When a base product is selected, it will have a value for `options`.
|
6
|
-
* When it has variants, it will have one or more keys for `variants`
|
7
|
-
* Either variants or options may be null, but not both.
|
8
|
-
*/
|
9
|
-
export declare function normalizeServerList(productList: CustomerProductList): NormalizedProductList;
|
10
|
-
/**
|
11
|
-
* Takes a flattened product list and result of a products query and returns
|
12
|
-
* product details for each item in the flattened list. */
|
13
|
-
export declare function getProductDetailForFlattenedProductList(
|
14
|
-
/** May contain base products, variants, or a combination of both. */
|
15
|
-
flattenedList: FlattenedProductListItem[],
|
16
|
-
/** Contains the results of a products query, which returns only base products */
|
17
|
-
productQueryResult: ProductsQuery): {
|
18
|
-
validation: import(".").ProductListProductValidation;
|
19
|
-
quantity: number;
|
20
|
-
isVariant: boolean;
|
21
|
-
variant: import("../../types").ProductVariant;
|
22
|
-
head?: import("../../types").HtmlHead;
|
23
|
-
primaryRoute?: import("../../types").Route;
|
24
|
-
breadcrumbText?: string;
|
25
|
-
__typename?: "Product";
|
26
|
-
id: number;
|
27
|
-
articleNumber: string;
|
28
|
-
name: string;
|
29
|
-
subName: string;
|
30
|
-
shortDescription: string;
|
31
|
-
description: string;
|
32
|
-
mainHeader: string;
|
33
|
-
publishedDate?: any;
|
34
|
-
canonicalCategory?: import("../../types").Category;
|
35
|
-
categories?: import("../../types").Category[];
|
36
|
-
campaigns?: import("../../types").Category[];
|
37
|
-
hasVariants: boolean;
|
38
|
-
hasVariantsWithDifferingPrices: boolean;
|
39
|
-
variants?: import("../../types").ProductVariants;
|
40
|
-
images?: import("../../types").ProductImage[];
|
41
|
-
relatedProducts?: Product[];
|
42
|
-
badges?: import("../../types").ProductBadge[];
|
43
|
-
price?: import("../../types").Price;
|
44
|
-
hidePrice?: boolean;
|
45
|
-
previousPrice?: import("../../types").Price;
|
46
|
-
defaultPrice?: import("../../types").Price;
|
47
|
-
defaultPreviousPrice?: import("../../types").Price;
|
48
|
-
recommendedPrice?: import("../../types").Price;
|
49
|
-
priceDateSpan?: import("../../types").ProductPriceDateSpan;
|
50
|
-
hasMemberPrice?: boolean;
|
51
|
-
memberPrice?: import("../../types").Price;
|
52
|
-
customerComments?: import("../../types").ProductComment[];
|
53
|
-
stockStatus?: import("../../types").StockStatus;
|
54
|
-
customFields?: import("../../types").CustomField[];
|
55
|
-
warehouseStock?: import("../../types").Warehouse[];
|
56
|
-
recommendedProducts?: import("../../types").RecommendedProducts;
|
57
|
-
distributionPackageSize: number;
|
58
|
-
barcode?: string;
|
59
|
-
configurations?: import("../../types").ProductConfiguration[];
|
60
|
-
hasConfigurations: boolean;
|
61
|
-
hasFamilyMembers: boolean;
|
62
|
-
configurationPrice?: import("../../types").ProductConfigurationPrice;
|
63
|
-
quantitySuffix?: string;
|
64
|
-
isPreOrder?: boolean;
|
65
|
-
preOrder?: import("../../types").ProductPreOrder;
|
66
|
-
isPackage?: boolean;
|
67
|
-
package?: import("../../types").Package;
|
68
|
-
upsell?: import("../../types").Upsell;
|
69
|
-
inPackages?: Product[];
|
70
|
-
hasUpsell?: boolean;
|
71
|
-
familyMembers?: Product[];
|
72
|
-
history?: import("../../types").ProductHistory;
|
73
|
-
}[];
|
74
|
-
export declare function getVariantFromProductDetails(variant: Product['articleNumber'], product: Product): import("../../types").ProductVariant;
|
75
|
-
export declare function flattenList(list: NormalizedProductList): FlattenedProductListItem[];
|
@@ -1,107 +0,0 @@
|
|
1
|
-
import produce from 'immer';
|
2
|
-
import { validateProduct } from './validate-product';
|
3
|
-
/**
|
4
|
-
* Converts a product list returned from the API to our normalized structure
|
5
|
-
* When a base product is selected, it will have a value for `options`.
|
6
|
-
* When it has variants, it will have one or more keys for `variants`
|
7
|
-
* Either variants or options may be null, but not both.
|
8
|
-
*/
|
9
|
-
export function normalizeServerList(productList) {
|
10
|
-
var _a, _b, _c, _d, _e;
|
11
|
-
const items = productList.items;
|
12
|
-
const newList = {
|
13
|
-
name: productList.name,
|
14
|
-
items: {}
|
15
|
-
};
|
16
|
-
for (const item of items) {
|
17
|
-
// skip if product is hidden
|
18
|
-
if (!((_a = item === null || item === void 0 ? void 0 : item.product) === null || _a === void 0 ? void 0 : _a.articleNumber)) {
|
19
|
-
continue;
|
20
|
-
}
|
21
|
-
if (item.variant) {
|
22
|
-
newList.items[item.product.articleNumber] = {
|
23
|
-
options: ((_b = newList.items[item.product.articleNumber]) === null || _b === void 0 ? void 0 : _b.options) || null,
|
24
|
-
variants: produce(((_c = newList.items[item.product.articleNumber]) === null || _c === void 0 ? void 0 : _c.variants) || {}, (draft) => {
|
25
|
-
draft[item.variant.articleNumber] = {
|
26
|
-
options: {
|
27
|
-
quantity: item.quantity || 1,
|
28
|
-
description: item.description
|
29
|
-
},
|
30
|
-
parentArticleNumber: item.product.articleNumber
|
31
|
-
};
|
32
|
-
})
|
33
|
-
};
|
34
|
-
}
|
35
|
-
else {
|
36
|
-
newList.items[item.product.articleNumber] = {
|
37
|
-
variants: ((_d = newList.items[item.product.articleNumber]) === null || _d === void 0 ? void 0 : _d.variants) || null,
|
38
|
-
options: {
|
39
|
-
quantity: (_e = item.quantity) !== null && _e !== void 0 ? _e : 1,
|
40
|
-
description: item.description
|
41
|
-
}
|
42
|
-
};
|
43
|
-
}
|
44
|
-
}
|
45
|
-
return newList;
|
46
|
-
}
|
47
|
-
/**
|
48
|
-
* Takes a flattened product list and result of a products query and returns
|
49
|
-
* product details for each item in the flattened list. */
|
50
|
-
export function getProductDetailForFlattenedProductList(
|
51
|
-
/** May contain base products, variants, or a combination of both. */
|
52
|
-
flattenedList,
|
53
|
-
/** Contains the results of a products query, which returns only base products */
|
54
|
-
productQueryResult) {
|
55
|
-
const { data } = productQueryResult;
|
56
|
-
const productsFromQuery = (data === null || data === void 0 ? void 0 : data.products) || [];
|
57
|
-
return flattenedList
|
58
|
-
.map((listItem) => {
|
59
|
-
const baseProductArticleNumber = listItem.parentArticleNumber || listItem.articleNumber;
|
60
|
-
// Find the base product in the query response
|
61
|
-
const product = productsFromQuery.find((prod) => prod.articleNumber === baseProductArticleNumber);
|
62
|
-
if (!product)
|
63
|
-
return null;
|
64
|
-
// Get the variant detail from the product
|
65
|
-
const selectedVariant = getVariantFromProductDetails(listItem.articleNumber, product);
|
66
|
-
const productListProduct = Object.assign(Object.assign({}, product), { quantity: listItem.options.quantity, isVariant: !!listItem.parentArticleNumber, variant: selectedVariant });
|
67
|
-
return Object.assign(Object.assign({}, productListProduct), { validation: validateProduct(productListProduct) });
|
68
|
-
})
|
69
|
-
.filter(Boolean);
|
70
|
-
}
|
71
|
-
export function getVariantFromProductDetails(variant, product) {
|
72
|
-
if (!variant)
|
73
|
-
return null;
|
74
|
-
const matchedVariant = product.variants.values.find((value) => value.articleNumber === variant);
|
75
|
-
return matchedVariant || null;
|
76
|
-
}
|
77
|
-
export function flattenList(list) {
|
78
|
-
const flattenedList = [];
|
79
|
-
const baseProducts = list ? Object.keys(list.items) : [];
|
80
|
-
for (const baseArticleNumber of baseProducts) {
|
81
|
-
const variants = list.items[baseArticleNumber].variants;
|
82
|
-
if (variants) {
|
83
|
-
const variantArticleNumbers = Object.keys(variants);
|
84
|
-
for (const articleNumber of variantArticleNumbers) {
|
85
|
-
flattenedList.push({
|
86
|
-
articleNumber,
|
87
|
-
parentArticleNumber: baseArticleNumber,
|
88
|
-
options: variants[articleNumber].options
|
89
|
-
});
|
90
|
-
}
|
91
|
-
if (list.items[baseArticleNumber].options) {
|
92
|
-
flattenedList.push({
|
93
|
-
articleNumber: baseArticleNumber,
|
94
|
-
options: list.items[baseArticleNumber].options
|
95
|
-
});
|
96
|
-
}
|
97
|
-
}
|
98
|
-
else {
|
99
|
-
flattenedList.push({
|
100
|
-
articleNumber: baseArticleNumber,
|
101
|
-
options: list.items[baseArticleNumber].options
|
102
|
-
});
|
103
|
-
}
|
104
|
-
}
|
105
|
-
return flattenedList;
|
106
|
-
}
|
107
|
-
//# sourceMappingURL=list-transforms.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"list-transforms.js","sourceRoot":"","sources":["list-transforms.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,OAAO,CAAC;AAW5B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CACjC,WAAgC;;IAEhC,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;IAEhC,MAAM,OAAO,GAA0B;QACrC,IAAI,EAAE,WAAW,CAAC,IAAI;QACtB,KAAK,EAAE,EAAE;KACV,CAAC;IAEF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,4BAA4B;QAC5B,IAAI,CAAC,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,0CAAE,aAAa,CAAA,EAAE;YACjC,SAAS;SACV;QAED,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG;gBAC1C,OAAO,EAAE,CAAA,MAAA,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,0CAAE,OAAO,KAAI,IAAI;gBACnE,QAAQ,EAAE,OAAO,CACf,CAAA,MAAA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AAQ,CAAC,CAAC;YAEpD,KAAK,MAAM,aAAa,IAAI,qBAAqB,EAAE;gBACjD,aAAa,CAAC,IAAI,CAAC;oBACjB,aAAa;oBACb,mBAAmB,EAAE,iBAAiB;oBACtC,OAAO,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC,OAAO;iBACzC,CAAC,CAAC;aACJ;YAED,IAAI,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,OAAO,EAAE;gBACzC,aAAa,CAAC,IAAI,CAAC;oBACjB,aAAa,EAAE,iBAAiB;oBAChC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,OAAO;iBAC/C,CAAC,CAAC;aACJ;SACF;aAAM;YACL,aAAa,CAAC,IAAI,CAAC;gBACjB,aAAa,EAAE,iBAAiB;gBAChC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,OAAO;aAC/C,CAAC,CAAC;SACJ;KACF;IAED,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
@@ -1,76 +0,0 @@
|
|
1
|
-
import { ProductListMap, ProductListState, ProductListItemOptions, ProductListId, UpdateListOptions, NormalizedProductList } from '.';
|
2
|
-
export declare function reducer(state: ProductListState, action: Action): ProductListState;
|
3
|
-
export declare function init(initialState: ProductListState): ProductListState;
|
4
|
-
export declare function addVariantToList(state: ProductListState, listId: ProductListId, articleNumber: string, { variantArticleNumber, options }: {
|
5
|
-
variantArticleNumber?: string;
|
6
|
-
options: ProductListItemOptions;
|
7
|
-
}): ProductListState;
|
8
|
-
export declare function addBaseProductToList(state: ProductListState, listId: ProductListId, articleNumber: string, options: ProductListItemOptions): ProductListState;
|
9
|
-
export declare function removeFromList(state: ProductListState, listId: ProductListId, articleNumber: string, { variantArticleNumber }: {
|
10
|
-
variantArticleNumber?: string;
|
11
|
-
}): ProductListState;
|
12
|
-
export declare function replaceItemInList(state: ProductListState, listId: ProductListId, articleNumber: string, { variantToReplace, variantArticleNumber, options }: {
|
13
|
-
variantToReplace?: string;
|
14
|
-
variantArticleNumber: string;
|
15
|
-
options: ProductListItemOptions;
|
16
|
-
}): ProductListState;
|
17
|
-
export declare type Action = {
|
18
|
-
type: 'UPDATE';
|
19
|
-
payload: {
|
20
|
-
listId: ProductListId;
|
21
|
-
articleNumber: string;
|
22
|
-
variantArticleNumber: string;
|
23
|
-
variantToReplace?: string;
|
24
|
-
options: UpdateListOptions;
|
25
|
-
};
|
26
|
-
} | {
|
27
|
-
type: 'ADD';
|
28
|
-
payload: {
|
29
|
-
listId: ProductListId;
|
30
|
-
articleNumber: string;
|
31
|
-
variantArticleNumber?: string;
|
32
|
-
options: UpdateListOptions;
|
33
|
-
};
|
34
|
-
} | {
|
35
|
-
type: 'REMOVE';
|
36
|
-
payload: {
|
37
|
-
listId: ProductListId;
|
38
|
-
articleNumber: string;
|
39
|
-
variantArticleNumber?: string;
|
40
|
-
};
|
41
|
-
} | {
|
42
|
-
type: 'CLEAR_ITEMS';
|
43
|
-
payload: {
|
44
|
-
listId: ProductListId;
|
45
|
-
};
|
46
|
-
} | {
|
47
|
-
type: 'LOGOUT';
|
48
|
-
} | {
|
49
|
-
type: 'LOGIN';
|
50
|
-
payload: {
|
51
|
-
listId: ProductListId;
|
52
|
-
list: NormalizedProductList;
|
53
|
-
};
|
54
|
-
} | {
|
55
|
-
type: 'REPLACE';
|
56
|
-
payload: {
|
57
|
-
listId: ProductListId;
|
58
|
-
list: NormalizedProductList;
|
59
|
-
};
|
60
|
-
} | {
|
61
|
-
type: 'CREATE_LIST';
|
62
|
-
payload: {
|
63
|
-
listId: ProductListId;
|
64
|
-
list: NormalizedProductList;
|
65
|
-
};
|
66
|
-
} | {
|
67
|
-
type: 'SET_LISTS';
|
68
|
-
payload: {
|
69
|
-
lists: ProductListMap;
|
70
|
-
};
|
71
|
-
} | {
|
72
|
-
type: 'DELETE_LIST';
|
73
|
-
payload: {
|
74
|
-
listId: ProductListId;
|
75
|
-
};
|
76
|
-
};
|
@@ -1,198 +0,0 @@
|
|
1
|
-
import produce, { enableMapSet } from 'immer';
|
2
|
-
// The Product lists are stored as a Map so need to enable Map support for Immer
|
3
|
-
enableMapSet();
|
4
|
-
import { emptyProductLists, PRODUCT_LISTS_KEY, productListArrayToMap } from '.';
|
5
|
-
export function reducer(state, action) {
|
6
|
-
switch (action.type) {
|
7
|
-
case 'LOGIN':
|
8
|
-
return produce(state, (draft) => {
|
9
|
-
draft.loggedIn = true;
|
10
|
-
const { list, listId } = action.payload;
|
11
|
-
draft.lists.set(listId, list);
|
12
|
-
});
|
13
|
-
case 'LOGOUT': {
|
14
|
-
return produce(state, (draft) => {
|
15
|
-
draft.loggedIn = false;
|
16
|
-
draft.lists = emptyProductLists();
|
17
|
-
});
|
18
|
-
}
|
19
|
-
case 'UPDATE': {
|
20
|
-
const { listId, articleNumber, variantArticleNumber, options, variantToReplace } = action.payload;
|
21
|
-
return replaceItemInList(state, listId, articleNumber, {
|
22
|
-
variantArticleNumber,
|
23
|
-
variantToReplace,
|
24
|
-
options
|
25
|
-
});
|
26
|
-
}
|
27
|
-
case 'SET_LISTS': {
|
28
|
-
return produce(state, (draft) => {
|
29
|
-
draft.lists = action.payload.lists;
|
30
|
-
});
|
31
|
-
}
|
32
|
-
// TODO
|
33
|
-
//case 'UPDATE_LIST': {
|
34
|
-
// return produce(state, (draft) => {
|
35
|
-
// const { listId, update } = action.payload
|
36
|
-
// const list = draft.lists.get(listId)
|
37
|
-
// list.name = update.name
|
38
|
-
// //...
|
39
|
-
// })
|
40
|
-
//}
|
41
|
-
case 'ADD': {
|
42
|
-
const { listId, variantArticleNumber, articleNumber, options } = action.payload;
|
43
|
-
if (variantArticleNumber) {
|
44
|
-
return addVariantToList(state, listId, articleNumber, {
|
45
|
-
variantArticleNumber,
|
46
|
-
options
|
47
|
-
});
|
48
|
-
}
|
49
|
-
else {
|
50
|
-
return addBaseProductToList(state, listId, articleNumber, options);
|
51
|
-
}
|
52
|
-
}
|
53
|
-
case 'REMOVE': {
|
54
|
-
const { listId, variantArticleNumber, articleNumber } = action.payload;
|
55
|
-
const list = removeFromList(state, listId, articleNumber, {
|
56
|
-
variantArticleNumber
|
57
|
-
});
|
58
|
-
return list;
|
59
|
-
}
|
60
|
-
case 'REPLACE': {
|
61
|
-
return produce(state, (draft) => {
|
62
|
-
const { list, listId } = action.payload;
|
63
|
-
draft.lists.set(listId, list);
|
64
|
-
});
|
65
|
-
}
|
66
|
-
case 'CLEAR_ITEMS': {
|
67
|
-
return produce(state, (draft) => {
|
68
|
-
const { listId } = action.payload;
|
69
|
-
const list = draft.lists.get(listId);
|
70
|
-
list.items = {};
|
71
|
-
});
|
72
|
-
}
|
73
|
-
case 'CREATE_LIST': {
|
74
|
-
return produce(state, (draft) => {
|
75
|
-
const { list, listId } = action.payload;
|
76
|
-
draft.lists.set(listId, list);
|
77
|
-
});
|
78
|
-
}
|
79
|
-
case 'DELETE_LIST': {
|
80
|
-
return produce(state, (draft) => {
|
81
|
-
const { listId } = action.payload;
|
82
|
-
draft.lists.delete(listId);
|
83
|
-
});
|
84
|
-
}
|
85
|
-
default:
|
86
|
-
throw new Error(`Unsupported action ${action} for product list reducer`);
|
87
|
-
}
|
88
|
-
}
|
89
|
-
export function init(initialState) {
|
90
|
-
if (typeof window === 'undefined')
|
91
|
-
return initialState;
|
92
|
-
/**
|
93
|
-
* Migrate any legacy product list to the new format
|
94
|
-
*
|
95
|
-
* TODO Remove this code in next major release!
|
96
|
-
*/
|
97
|
-
const LEGACY_LIST_KEY = 'productList';
|
98
|
-
const legacyListData = JSON.parse(window.localStorage.getItem(LEGACY_LIST_KEY));
|
99
|
-
if (legacyListData) {
|
100
|
-
const defaultList = initialState.lists.get(null);
|
101
|
-
Object.assign(defaultList.items, legacyListData);
|
102
|
-
window.localStorage.removeItem(LEGACY_LIST_KEY);
|
103
|
-
return {
|
104
|
-
lists: initialState.lists,
|
105
|
-
loggedIn: initialState.loggedIn,
|
106
|
-
requestIdRef: initialState.requestIdRef
|
107
|
-
};
|
108
|
-
}
|
109
|
-
const localStorageProductLists = JSON.parse(window.localStorage.getItem(PRODUCT_LISTS_KEY));
|
110
|
-
const lists = (localStorageProductLists &&
|
111
|
-
productListArrayToMap(localStorageProductLists)) ||
|
112
|
-
initialState.lists;
|
113
|
-
const updatedState = {
|
114
|
-
lists,
|
115
|
-
loggedIn: initialState.loggedIn,
|
116
|
-
requestIdRef: initialState.requestIdRef
|
117
|
-
};
|
118
|
-
return updatedState;
|
119
|
-
}
|
120
|
-
export function addVariantToList(state, listId, articleNumber, { variantArticleNumber, options }) {
|
121
|
-
// If the article number exists, update it
|
122
|
-
// Otherwise create a new entry
|
123
|
-
return produce(state, (draft) => {
|
124
|
-
var _a, _b;
|
125
|
-
const items = draft.lists.get(listId).items;
|
126
|
-
items[articleNumber] = {
|
127
|
-
options: ((_a = items[articleNumber]) === null || _a === void 0 ? void 0 : _a.options) || null,
|
128
|
-
variants: produce(((_b = items[articleNumber]) === null || _b === void 0 ? void 0 : _b.variants) || {}, (draft) => {
|
129
|
-
draft[variantArticleNumber] = {
|
130
|
-
options,
|
131
|
-
parentArticleNumber: articleNumber
|
132
|
-
};
|
133
|
-
})
|
134
|
-
};
|
135
|
-
});
|
136
|
-
}
|
137
|
-
export function addBaseProductToList(state, listId, articleNumber, options) {
|
138
|
-
return produce(state, (draft) => {
|
139
|
-
var _a;
|
140
|
-
const items = draft.lists.get(listId).items;
|
141
|
-
items[articleNumber] = {
|
142
|
-
variants: ((_a = items[articleNumber]) === null || _a === void 0 ? void 0 : _a.variants) || null,
|
143
|
-
options
|
144
|
-
};
|
145
|
-
});
|
146
|
-
}
|
147
|
-
export function removeFromList(state, listId, articleNumber, { variantArticleNumber }) {
|
148
|
-
if (variantArticleNumber) {
|
149
|
-
return produce(state, (draft) => {
|
150
|
-
const items = draft.lists.get(listId).items;
|
151
|
-
delete items[articleNumber].variants[variantArticleNumber];
|
152
|
-
if (Object.keys(items[articleNumber].variants).length === 0 &&
|
153
|
-
items[articleNumber].options === null) {
|
154
|
-
delete items[articleNumber];
|
155
|
-
}
|
156
|
-
});
|
157
|
-
}
|
158
|
-
else {
|
159
|
-
return produce(state, (draft) => {
|
160
|
-
var _a;
|
161
|
-
const items = draft.lists.get(listId).items;
|
162
|
-
if ((_a = items[articleNumber]) === null || _a === void 0 ? void 0 : _a.variants) {
|
163
|
-
items[articleNumber].options = null;
|
164
|
-
}
|
165
|
-
else {
|
166
|
-
delete items[articleNumber];
|
167
|
-
}
|
168
|
-
});
|
169
|
-
}
|
170
|
-
}
|
171
|
-
export function replaceItemInList(state, listId, articleNumber, { variantToReplace, variantArticleNumber, options }) {
|
172
|
-
if (variantToReplace) {
|
173
|
-
return produce(state, (draft) => {
|
174
|
-
// Replacing is a delete + an add
|
175
|
-
const items = draft.lists.get(listId).items;
|
176
|
-
const variants = items[articleNumber].variants;
|
177
|
-
delete variants[variantToReplace];
|
178
|
-
items[articleNumber].variants = Object.assign(Object.assign({}, variants), { [variantArticleNumber]: {
|
179
|
-
options,
|
180
|
-
parentArticleNumber: articleNumber
|
181
|
-
} });
|
182
|
-
});
|
183
|
-
}
|
184
|
-
else {
|
185
|
-
return produce(state, (draft) => {
|
186
|
-
var _a;
|
187
|
-
const items = draft.lists.get(listId).items;
|
188
|
-
items[articleNumber] = {
|
189
|
-
options: null,
|
190
|
-
variants: Object.assign(Object.assign({}, (_a = items[articleNumber]) === null || _a === void 0 ? void 0 : _a.variants), { [variantArticleNumber]: {
|
191
|
-
options,
|
192
|
-
parentArticleNumber: articleNumber
|
193
|
-
} })
|
194
|
-
};
|
195
|
-
});
|
196
|
-
}
|
197
|
-
}
|
198
|
-
//# sourceMappingURL=product-list-reducer.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"product-list-reducer.js","sourceRoot":"","sources":["product-list-reducer.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC9C,gFAAgF;AAChF,YAAY,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C/B,KAAuB,EACvB,MAAqB,EACrB,aAAqB,EACrB,EACE,gBAAgB,EAChB,oBAAoB,EACpB,OAAO,EAKR;IAED,IAAI,gBAAgB,EAAE;QACpB,OAAO,OAAO,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;YAC9B,iCAAiC;YACjC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC;YAC5C,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC;YAE/C,OAAO,QAAQ,CAAC,gBAAgB,CAAC,CAAC;YAElC,KAAK,CAAC,aAAa,CAAC,CAAC,QAAQ,mCACxB,QAAQ,KACX,CAAC,oBAAoB,CAAC,EAAE;oBACtB,OAAO;oBACP,mBAAmB,EAAE,aAAa;iBACnC,GACF,CAAC;QACJ,CAAC,CAAC,CAAC;KACJ;SAAM;QACL,OAAO,OAAO,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;;YAC9B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC;YAC5C,KAAK,CAAC,aAAa,CAAC,GAAG;gBACrB,OAAO,EAAE,IAAI;gBACb,QAAQ,kCACH,MAAA,KAAK,CAAC,aAAa,CAAC,0CAAE,QAAQ,KACjC,CAAC,oBAAoB,CAAC,EAAE;wBACtB,OAAO;wBACP,mBAAmB,EAAE,aAAa;qBACnC,GACF;aACF,CAAC;QACJ,CAAC,CAAC,CAAC;KACJ;AACH,CAAC"}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import { ProductListId, UpdateListInput } from '.';
|
2
|
-
export declare function useProductList(listId?: ProductListId): {
|
3
|
-
toggle: (articleNumber: string, { variantArticleNumber, quantity, description, productName }: UpdateListInput) => void;
|
4
|
-
add: (articleNumber: string, { variantArticleNumber, quantity, description, productName }: UpdateListInput) => void;
|
5
|
-
remove: (articleNumber: string, { variantArticleNumber }: UpdateListInput) => void;
|
6
|
-
update: (articleNumber: string, { variantArticleNumber, quantity, description, variantToReplace }: UpdateListInput & {
|
7
|
-
variantToReplace?: string;
|
8
|
-
}) => void;
|
9
|
-
clear: () => void;
|
10
|
-
inList: (articleNumber: string, { variantArticleNumber }: UpdateListInput) => boolean;
|
11
|
-
list: import(".").NormalizedProductList;
|
12
|
-
count: number;
|
13
|
-
};
|