@shopgate/engage 7.12.7-beta.1 → 7.20.0-beta.10
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/a11y/components/Section/index.js +2 -2
- package/a11y/components/VisuallyHidden/index.js +8 -0
- package/a11y/components/index.js +1 -0
- package/a11y/constants/index.js +1 -0
- package/a11y/helpers/index.js +1 -0
- package/a11y/index.js +1 -4
- package/account/actions/addContacts.js +2 -2
- package/account/actions/deleteContact.js +2 -2
- package/account/actions/deleteCustomer.js +2 -2
- package/account/actions/fetchContacts.js +2 -2
- package/account/actions/fetchCustomer.js +2 -2
- package/account/actions/updateContact.js +2 -2
- package/account/actions/updateCustomer.js +2 -2
- package/account/components/Account/Account.js +1 -1
- package/account/components/Account/Account.style.js +1 -1
- package/account/components/Profile/Profile.provider.js +3 -3
- package/account/components/ProfileContact/ProfileContact.js +1 -1
- package/account/reducers/index.js +1 -1
- package/app-rating/action-creators/appStart.js +3 -3
- package/app-rating/action-creators/ordersPlaced.js +3 -3
- package/app-rating/action-creators/popup.js +4 -4
- package/app-rating/action-creators/timer.js +3 -3
- package/app-rating/actions/showModal.js +6 -6
- package/app-rating/constants/index.js +2 -2
- package/app-rating/reducers/index.js +2 -2
- package/app-rating/subscriptions/index.js +4 -4
- package/back-in-stock/actions/index.js +14 -0
- package/back-in-stock/components/BackInStockButton/connector.js +1 -0
- package/back-in-stock/components/BackInStockButton/index.js +14 -0
- package/back-in-stock/components/BackInStockButton/style.js +1 -0
- package/back-in-stock/components/CharacteristicsButton/connector.js +3 -0
- package/back-in-stock/components/CharacteristicsButton/index.js +8 -0
- package/back-in-stock/components/ProductInfoBackInStockButton/connector.js +3 -0
- package/back-in-stock/components/ProductInfoBackInStockButton/index.js +10 -0
- package/back-in-stock/components/Subscriptions/components/List/index.js +4 -0
- package/back-in-stock/components/Subscriptions/components/Subscription/index.js +7 -0
- package/back-in-stock/components/Subscriptions/index.js +4 -0
- package/back-in-stock/components/index.js +1 -0
- package/back-in-stock/constants/Actions.js +1 -0
- package/back-in-stock/constants/Common.js +1 -0
- package/back-in-stock/constants/Pipelines.js +1 -0
- package/back-in-stock/constants/Portals.js +9 -0
- package/back-in-stock/constants/index.js +1 -0
- package/back-in-stock/hooks/index.js +4 -0
- package/back-in-stock/providers/BackInStockSubscriptionsProvider.connector.js +7 -0
- package/back-in-stock/providers/BackInStockSubscriptionsProvider.js +5 -0
- package/back-in-stock/providers/index.js +1 -0
- package/back-in-stock/reducers/index.js +5 -0
- package/back-in-stock/selectors/index.js +43 -0
- package/back-in-stock/streams/index.js +1 -0
- package/back-in-stock/subscriptions/index.js +11 -0
- package/cart/cart.helpers.js +9 -2
- package/cart/components/CartItem/CartItemCoupon.js +10 -6
- package/cart/components/CartItem/CartItemCouponCode.js +2 -2
- package/cart/components/CartItem/CartItemCouponDelete.js +1 -1
- package/cart/components/CartItem/CartItemCouponFreeShipping.js +1 -1
- package/cart/components/CartItem/CartItemCouponIcon.js +2 -2
- package/cart/components/CartItem/CartItemCouponLayout.style.js +5 -1
- package/cart/components/CartItem/CartItemCouponTitle.js +2 -2
- package/cart/components/CartItem/CartItemProductLayout.js +4 -2
- package/cart/components/CartItem/CartItemProductLayoutWide.style.js +1 -1
- package/cart/components/CartItem/CartItemProductTitle.js +2 -2
- package/cart/components/CartItem/CartItemQuantityPicker.js +26 -14
- package/cart/components/CartItem/CartItemSubstitution.js +1 -1
- package/cart/components/CartItems/CartItemCardReservation.js +1 -1
- package/cart/components/CartItems/CartItemGroupReservation.js +1 -1
- package/cart/components/CartSummaryWide/CartSummaryWideCheckoutButton.style.js +1 -1
- package/cart/components/PaymentBar/PaymentBar.js +1 -1
- package/cart/components/PaymentBar/PaymentBarCheckoutButton.style.js +1 -1
- package/cart/components/PaymentBar/PaymentBarPromotionCouponMessages.js +1 -1
- package/cart/index.js +3 -2
- package/cart/streams/index.js +1 -0
- package/category/actions/index.js +1 -0
- package/category/components/CategoryList/index.js +7 -0
- package/category/components/CategoryList/style.js +1 -0
- package/category/components/index.js +1 -1
- package/category/constants/index.js +1 -0
- package/category/helpers/index.js +1 -0
- package/category/index.js +1 -6
- package/category/selectors/index.js +2 -0
- package/category/streams/index.js +1 -1
- package/checkout/actions/errorCheckout.js +1 -1
- package/checkout/actions/fetchCheckoutOrder.js +1 -1
- package/checkout/actions/fetchPaymentMethods.js +1 -1
- package/checkout/actions/initializeCheckout.js +1 -1
- package/checkout/actions/prepareCheckout.js +2 -2
- package/checkout/actions/submitCheckoutOrder.js +1 -1
- package/checkout/actions/updateCheckoutOrder.js +1 -1
- package/checkout/components/Checkout/CheckoutPickupContactForm.config.js +1 -1
- package/checkout/components/Checkout/CheckoutSectionMessages.js +1 -1
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmation.js +1 -1
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmationBilledTo.js +1 -1
- package/checkout/components/GuestCheckout/GuestCheckoutPickupNotes.config.js +1 -1
- package/checkout/components/PaymentMethodButton/PaymentMethodButton.js +1 -1
- package/checkout/components/ShippingMethods/ShippingMethods.js +4 -4
- package/checkout/components/index.js +1 -1
- package/checkout/constants/index.js +1 -1
- package/checkout/index.js +3 -4
- package/checkout/paymentMethods/index.js +2 -2
- package/checkout/paymentMethods/paypal/PaypalButtonApp.js +1 -1
- package/checkout/paymentMethods/paypal/PaypalButtonWeb.js +1 -1
- package/checkout/paymentMethods/paypal/PaypalPayButton.js +1 -1
- package/checkout/paymentMethods/paypal/PaypalProvider.js +1 -1
- package/checkout/paymentMethods/stripe/StripeButton.js +2 -2
- package/checkout/paymentMethods/stripe/StripeCreditCard.js +3 -3
- package/checkout/paymentMethods/stripe/StripeProvider.js +8 -8
- package/checkout/paymentMethods/stripe/sdk.js +3 -2
- package/checkout/providers/AddressBookProvider.js +1 -1
- package/checkout/providers/CheckoutProvider.js +8 -8
- package/components/ChipLayout/index.js +38 -0
- package/components/ChipLayout/spec.js +5 -0
- package/components/ChipLayout/style.js +5 -0
- package/components/ConditionalWrapper/ConditionalWrapper.js +7 -2
- package/components/Footer/Footer.js +7 -7
- package/components/Form/Builder/Builder.js +50 -29
- package/components/Form/Builder/ElementCheckbox.js +1 -1
- package/components/Form/Builder/ElementMultiSelect.js +1 -1
- package/components/Form/Builder/ElementPhoneNumber.js +3 -3
- package/components/Form/Builder/ElementRadio.js +1 -1
- package/components/Form/Builder/ElementSelect.js +1 -1
- package/components/Form/Builder/ElementText.js +3 -3
- package/components/Form/Builder/classes/ActionListener.constants.js +2 -2
- package/components/Form/Builder/classes/ActionListener.js +73 -16
- package/components/Form/Builder/helpers/buildFormElements.js +2 -2
- package/components/Form/Form.js +8 -5
- package/components/IntersectionVisibility/index.js +14 -7
- package/components/Logo/connector.js +4 -0
- package/components/Logo/index.js +4 -0
- package/components/Logo/spec.js +1 -0
- package/components/Logo/style.js +1 -0
- package/components/Menu/components/Position/index.js +5 -5
- package/components/Menu/index.js +9 -9
- package/components/MessageBar/MessageBar.js +1 -1
- package/components/MessageBar/index.js +1 -1
- package/components/NavigationHandler/index.js +4 -4
- package/components/NavigationHandler/spec.js +1 -1
- package/components/Picker/components/Button/index.js +1 -1
- package/components/Picker/components/List/index.js +2 -2
- package/components/Picker/components/Modal/index.js +7 -7
- package/components/Picker/index.js +18 -9
- package/components/PickerUtilize/components/Button/index.js +5 -0
- package/components/PickerUtilize/components/Button/style.js +1 -0
- package/components/PickerUtilize/index.js +17 -0
- package/components/PickerUtilize/spec.js +1 -0
- package/components/PickerUtilize/style.js +1 -0
- package/components/QuantityInput/QuantityInput.js +5 -4
- package/components/Radio/Radio.js +1 -1
- package/components/RadioCard/RadioCard.js +1 -1
- package/components/RangeSlider/components/Handle/index.js +1 -1
- package/components/RangeSlider/index.js +36 -24
- package/components/ResponsiveContainer/ResponsiveContainer.js +2 -6
- package/components/ResponsiveContainer/breakpoints.js +2 -1
- package/components/ResponsiveContainer/hooks.js +20 -0
- package/components/ScrollHeader/index.js +2 -2
- package/components/ScrollHeader/style.js +1 -1
- package/components/SheetList/components/Item/index.js +5 -5
- package/components/SheetList/index.js +4 -4
- package/components/SideNavigation/SideNavigationCategories.connector.js +2 -2
- package/components/SnackBarContainer/index.js +5 -0
- package/components/Switch/index.js +12 -0
- package/components/Switch/style.js +1 -0
- package/components/Tabs/components/TabIndicator.js +2 -2
- package/components/Tabs/components/Tabs.js +1 -1
- package/components/TimeBoundary/index.js +8 -6
- package/components/VideoPlayer/index.js +9 -6
- package/components/View/components/Above/index.js +1 -1
- package/components/View/components/Below/index.js +1 -1
- package/components/View/components/Content/index.js +18 -11
- package/components/View/index.js +1 -1
- package/components/View/provider.js +22 -5
- package/components/index.js +2 -2
- package/core/action-creators/app.js +5 -0
- package/core/action-creators/appPermissions.js +9 -0
- package/core/action-creators/index.js +1 -1
- package/core/actions/getGeolocation.js +2 -2
- package/core/actions/grantAppTrackingTransparencyPermission.js +6 -0
- package/core/actions/grantCameraPermissions.js +1 -1
- package/core/actions/grantGeolocationPermissions.js +1 -1
- package/core/actions/grantPermissions.js +13 -6
- package/core/actions/grantPushPermissions.js +22 -0
- package/core/actions/index.js +7 -0
- package/core/actions/requestAppPermission.js +12 -0
- package/core/actions/requestAppPermissionStatus.js +12 -0
- package/core/classes/GeolocationRequest.js +2 -3
- package/core/classes/GeolocationRequestApp.js +6 -6
- package/core/classes/GeolocationRequestBrowser.js +2 -2
- package/core/classes/index.js +1 -0
- package/core/collections/AppInitialization.js +49 -0
- package/core/collections/index.js +1 -0
- package/core/commands/analyticsSetConsent.js +11 -0
- package/core/commands/index.js +1 -0
- package/core/config/ThemeConfigResolver.js +2 -2
- package/core/config/config.action-creators.js +1 -1
- package/core/config/config.actions.js +1 -1
- package/core/config/config.reducers.js +1 -1
- package/core/config/config.subscriptions.js +2 -2
- package/core/config/index.js +1 -1
- package/core/constants/actionTypes.js +1 -0
- package/core/constants/appFeatures.js +1 -0
- package/core/constants/index.js +6 -1
- package/core/contexts/index.js +1 -0
- package/core/helpers/appFeatures.js +15 -0
- package/core/helpers/appPermissions.js +43 -6
- package/core/helpers/baseUrl.js +14 -0
- package/core/helpers/environment.js +4 -0
- package/core/helpers/getFullImageSource.js +1 -1
- package/core/helpers/i18n.js +5 -3
- package/core/helpers/index.js +7 -0
- package/core/hocs/index.js +1 -0
- package/core/hocs/withCurrentProduct.js +6 -6
- package/core/hocs/withTheme.js +2 -2
- package/core/hooks/index.js +1 -0
- package/core/hooks/useAsyncMemo.js +1 -1
- package/core/hooks/useFormState.js +1 -1
- package/core/hooks/useScrollTo.js +1 -1
- package/core/hooks/useTheme.js +2 -2
- package/core/index.js +5 -52
- package/core/initialization/index.js +4 -2
- package/core/providers/AppProvider.js +10 -8
- package/core/providers/index.js +1 -0
- package/core/reducers/app.js +6 -0
- package/core/reducers/index.js +1 -1
- package/core/reducers/merchantSettings.js +1 -1
- package/core/reducers/shopSettings.js +1 -1
- package/core/selectors/app.js +9 -0
- package/core/selectors/index.js +6 -1
- package/core/streams/app.js +8 -0
- package/core/streams/appPermissions.js +19 -0
- package/core/streams/index.js +4 -0
- package/core/subscriptions/app.js +7 -0
- package/favorites/components/Item/Item.js +7 -7
- package/favorites/components/List/List.js +18 -7
- package/favorites/components/List/ListAccordionLabel.js +4 -0
- package/favorites/components/List/ListContent.js +8 -0
- package/favorites/components/List/ListItemWrapper.js +6 -0
- package/favorites/components/List/styles.js +1 -0
- package/favorites/components/Lists/Lists.js +5 -5
- package/favorites/components/Lists/ListsModal.js +3 -2
- package/favorites/constants/index.js +1 -0
- package/filter/actions/index.js +1 -0
- package/filter/components/PriceSlider/index.js +9 -9
- package/filter/components/PriceSlider/style.js +1 -3
- package/filter/components/index.js +1 -0
- package/filter/constants/index.js +1 -1
- package/filter/helpers/buildFilterParamsForFetchFiltersRequest.js +9 -0
- package/filter/helpers/buildInitialFilters.js +1 -1
- package/filter/helpers/buildUpdatedFilters.js +1 -1
- package/filter/helpers/index.js +1 -0
- package/filter/helpers/translateFilterLabel.js +6 -0
- package/filter/index.js +2 -7
- package/filter/providers/SortProvider.helpers.js +1 -1
- package/filter/selectors/index.js +1 -1
- package/filter/streams/index.js +1 -0
- package/i18n/locale/cs-cz/countries.json +255 -0
- package/i18n/locale/de-de/countries.json +26 -28
- package/i18n/locale/el-gr/countries.json +255 -0
- package/i18n/locale/en-us/countries.json +12 -14
- package/i18n/locale/es-es/countries.json +65 -67
- package/i18n/locale/fi-fi/countries.json +255 -0
- package/i18n/locale/fr-fr/countries.json +85 -87
- package/i18n/locale/hu-hu/countries.json +255 -0
- package/i18n/locale/it-it/countries.json +11 -13
- package/i18n/locale/nl-nl/countries.json +42 -44
- package/i18n/locale/pl-pl/countries.json +255 -0
- package/i18n/locale/pt-pt/countries.json +128 -130
- package/i18n/locale/ro-ro/countries.json +255 -0
- package/i18n/locale/sv-se/countries.json +255 -0
- package/locations/action-creators/receiveInventories.js +3 -5
- package/locations/actions/fetchFulfillmentSlots.js +1 -1
- package/locations/actions/fetchProductLocations.js +2 -2
- package/locations/actions/setUserGeolocation.js +1 -1
- package/locations/actions/setUserSearchGeolocation.js +1 -1
- package/locations/components/Cart/CartContextMenuChangeFulfillmentContent.js +1 -1
- package/locations/components/FulfillmentPath/FulfillmentPath.js +1 -1
- package/locations/components/FulfillmentPath/FulfillmentPathItem.js +2 -2
- package/locations/components/FulfillmentSelector/FulfillmentSelectorAddToCart.js +2 -2
- package/locations/components/FulfillmentSelector/FulfillmentSelectorAlternativeLocation.js +1 -1
- package/locations/components/FulfillmentSheet/FulfillmentSheet.js +2 -2
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotDialog.js +1 -1
- package/locations/components/ReserveForm/ReserveForm.js +1 -1
- package/locations/components/ReserveForm/ReserveFormPhone.js +1 -1
- package/locations/components/StockInfo/StockInfo.defaultSettings.js +1 -1
- package/locations/components/StoreFinder/StoreFinderMap.style.js +2 -2
- package/locations/components/StoreList/StoreListSearch.js +5 -3
- package/locations/locations.streams.js +1 -1
- package/locations/providers/FulfillmentProvider.js +4 -4
- package/locations/providers/StoreFinderProvider.js +1 -1
- package/locations/reducers/storage.js +3 -3
- package/locations/selectors/index.js +2 -2
- package/locations/subscriptions.js +13 -13
- package/login/components/ForgotPassword/ForgotPassword.js +1 -1
- package/orders/actions/cancelOrder.js +1 -1
- package/orders/actions/fetchOrderDetails.js +1 -1
- package/orders/constants/status.js +2 -2
- package/orders/index.js +1 -1
- package/orders/providers/OrderDetailsPrivateProvider.js +1 -1
- package/orders/providers/OrderDetailsProvider.js +3 -3
- package/package.json +8 -8
- package/page/actions/index.js +1 -0
- package/page/components/index.js +1 -0
- package/page/constants/index.js +1 -0
- package/page/index.js +2 -4
- package/page/selectors/index.js +7 -0
- package/product/collections/index.js +1 -0
- package/product/components/Availability/Availability.connector.js +4 -5
- package/product/components/Availability/Availability.js +3 -3
- package/product/components/Characteristics/Characteristic/components/Sheet/index.js +20 -0
- package/product/components/Characteristics/Characteristic/components/SheetItem/index.js +10 -0
- package/product/components/Characteristics/Characteristic/components/SheetItem/style.js +1 -0
- package/product/components/Characteristics/Characteristic/index.js +18 -0
- package/product/components/Characteristics/Characteristic/style.js +1 -0
- package/product/components/Characteristics/Swatch/index.js +12 -0
- package/product/components/Characteristics/Swatch/style.js +1 -0
- package/product/components/Characteristics/index.js +12 -0
- package/product/components/Characteristics/transition.js +1 -0
- package/product/components/Description/index.js +2 -2
- package/product/components/EffectivityDates/helpers.js +3 -3
- package/product/components/EffectivityDates/index.js +1 -1
- package/product/components/Header/PriceStriked/connector.js +9 -0
- package/product/components/Header/PriceStriked/index.js +5 -0
- package/product/components/Header/PriceStriked/style.js +1 -0
- package/product/components/Header/Shipping/components/Label/index.js +6 -0
- package/product/components/Header/Shipping/components/Label/style.js +1 -0
- package/product/components/Header/Shipping/connector.js +9 -0
- package/product/components/Header/Shipping/index.js +5 -0
- package/product/components/Header/Shipping/mock.js +1 -0
- package/product/components/Header/Shipping/spec.js +5 -0
- package/product/components/Header/Shipping/style.js +1 -0
- package/product/components/Header/Tiers/components/Tier/index.js +6 -0
- package/product/components/Header/Tiers/components/Tier/spec.js +1 -0
- package/product/components/Header/Tiers/connector.js +10 -0
- package/product/components/Header/Tiers/index.js +5 -0
- package/product/components/Header/Tiers/spec.js +1 -0
- package/product/components/Header/Tiers/style.js +1 -0
- package/product/components/Header/index.js +1 -0
- package/product/components/MapPriceHint/index.js +1 -1
- package/product/components/Media/FeaturedMedia.js +1 -1
- package/product/components/MediaSlider/index.js +1 -1
- package/product/components/Options/components/Content/connector.js +10 -0
- package/product/components/Options/components/Content/index.js +16 -0
- package/product/components/Options/components/Content/spec.js +2 -0
- package/product/components/Options/components/Option/index.js +4 -0
- package/product/components/Options/components/TextOption/components/OptionInfo/index.js +9 -0
- package/product/components/Options/components/TextOption/components/OptionInfo/spec.js +1 -0
- package/product/components/Options/components/TextOption/components/OptionInfo/style.js +1 -0
- package/product/components/Options/components/TextOption/index.js +22 -0
- package/product/components/Options/components/TextOption/style.js +1 -0
- package/product/components/Options/index.js +5 -0
- package/product/components/OrderQuantityHint/index.js +3 -2
- package/product/components/OrderQuantityHint/style.js +1 -1
- package/product/components/PriceDifference/index.js +1 -1
- package/product/components/ProductCard/index.js +2 -2
- package/product/components/ProductCharacteristics/helpers/index.js +1 -1
- package/product/components/ProductCharacteristics/index.js +28 -12
- package/product/components/ProductDiscountBadge/spec.js +1 -1
- package/product/components/ProductGridPrice/index.js +2 -2
- package/product/components/ProductImage/index.js +15 -12
- package/product/components/ProductList/components/Item/index.js +5 -0
- package/product/components/ProductList/components/Item/style.js +2 -0
- package/product/components/ProductList/components/Iterator/index.js +5 -0
- package/product/components/ProductList/components/Iterator/style.js +1 -0
- package/product/components/ProductList/components/Layout/index.js +5 -0
- package/product/components/ProductList/components/Layout/style.js +1 -0
- package/product/components/ProductList/index.js +5 -0
- package/product/components/ProductProperties/Content.js +1 -1
- package/product/components/ProductProperties/GroupedProperties.js +1 -1
- package/product/components/ProductProperties/ListsHTML.js +1 -1
- package/product/components/ProductProperties/ProductProperties.js +1 -1
- package/product/components/ProductProperties/RowHTML.js +1 -1
- package/product/components/ProductProperties/Wrapper.js +1 -1
- package/product/components/ProductProperties/style.js +1 -1
- package/product/components/ProductSlider/index.js +4 -0
- package/product/components/ProductSlider/spec.js +1 -0
- package/product/components/ProductSlider/style.js +1 -0
- package/product/components/QuantityPicker/hooks.js +5 -0
- package/product/components/QuantityPicker/index.js +2 -2
- package/product/components/Rating/connector.js +9 -0
- package/product/components/Rating/index.js +7 -0
- package/product/components/Rating/mock.js +5 -0
- package/product/components/Rating/spec.js +5 -0
- package/product/components/Rating/style.js +1 -0
- package/product/components/Swatch/SwatchContent.js +1 -1
- package/product/components/UnitQuantityPicker/CartUnitQuantityPicker.js +2 -2
- package/product/components/UnitQuantityPicker/ProductUnitQuantityPicker.js +3 -2
- package/product/components/UnitQuantityPicker/UnitQuantityPicker.js +6 -3
- package/product/components/UnitQuantityPicker/UnitQuantityPickerWithSection.js +7 -0
- package/product/components/UnitQuantityPicker/index.js +1 -1
- package/product/components/index.js +1 -0
- package/product/constants/index.js +1 -1
- package/product/contexts/index.js +1 -0
- package/product/helpers/index.js +2 -2
- package/product/helpers/redirects.js +1 -1
- package/product/hocs/index.js +1 -0
- package/product/hooks/index.js +1 -0
- package/product/index.js +4 -11
- package/product/providers/Product/connector.js +5 -0
- package/product/providers/Product/index.js +4 -0
- package/product/providers/index.js +1 -0
- package/product/selectors/product.js +24 -3
- package/product/selectors/variants.js +2 -2
- package/product/streams/index.js +1 -0
- package/push-opt-in/action-creators/index.js +1 -0
- package/push-opt-in/action-creators/optInTrigger.js +23 -0
- package/push-opt-in/action-creators/pushOptIn.js +7 -0
- package/push-opt-in/actions/index.js +1 -0
- package/push-opt-in/actions/pushOptInModal.js +8 -0
- package/push-opt-in/components/PushOptInModal/connector.js +9 -0
- package/push-opt-in/components/PushOptInModal/index.js +9 -0
- package/push-opt-in/components/PushOptInModal/push-opt-in.svg +62 -0
- package/push-opt-in/components/PushOptInModal/style.js +1 -0
- package/push-opt-in/components/index.js +1 -0
- package/push-opt-in/constants/index.js +1 -0
- package/push-opt-in/constants/optInModal.js +1 -0
- package/push-opt-in/constants/optInTrigger.js +1 -0
- package/push-opt-in/reducers/index.js +1 -0
- package/push-opt-in/reducers/optInModal.js +6 -0
- package/push-opt-in/reducers/optInTrigger.js +6 -0
- package/push-opt-in/selectors/index.js +1 -0
- package/push-opt-in/selectors/optInModal.js +8 -0
- package/push-opt-in/selectors/optInTrigger.js +5 -0
- package/push-opt-in/subscriptions/index.js +1 -0
- package/push-opt-in/subscriptions/optInTrigger.js +12 -0
- package/registration/components/index.js +1 -0
- package/registration/index.js +1 -1
- package/registration/providers/GuestRegistrationProvider.actions.js +2 -2
- package/registration/providers/GuestRegistrationProvider.js +3 -3
- package/registration/providers/RegistrationProvider.actions.js +3 -3
- package/registration/providers/RegistrationProvider.js +2 -2
- package/registration/subscriptions/index.js +1 -1
- package/reviews/actions/index.js +1 -0
- package/reviews/components/Reviews/components/Header/components/ReviewsExcerpt/index.js +1 -1
- package/reviews/components/Reviews/components/Header/components/ReviewsExcerpt/style.js +1 -2
- package/reviews/components/Reviews/components/List/index.js +3 -3
- package/reviews/components/Reviews/components/List/spec.js +1 -1
- package/reviews/components/Reviews/components/RatingCount/index.js +1 -1
- package/reviews/components/Reviews/components/RatingCount/style.js +1 -2
- package/reviews/components/Reviews/components/ReviewsInfo/index.js +1 -2
- package/reviews/components/Reviews/spec.js +1 -1
- package/reviews/components/index.js +1 -0
- package/reviews/constants/index.js +1 -0
- package/reviews/index.js +3 -7
- package/reviews/selectors/index.js +1 -0
- package/reviews/streams/index.js +1 -0
- package/scanner/action-creators/index.js +1 -0
- package/scanner/actions/index.js +1 -0
- package/scanner/classes/index.js +1 -0
- package/scanner/constants/index.js +1 -0
- package/scanner/helpers/index.js +1 -0
- package/scanner/index.js +1 -6
- package/scanner/streams/index.js +1 -0
- package/search/actions/index.js +1 -0
- package/search/constants/index.js +1 -0
- package/search/helpers/index.js +1 -0
- package/search/index.js +1 -6
- package/search/selectors/index.js +1 -0
- package/search/streams/index.js +1 -0
- package/styles/helpers/index.js +1 -0
- package/styles/helpers/initCSSCustomProperties.js +3 -3
- package/styles/helpers/loadCustomStyles.js +2 -2
- package/styles/helpers/setPageBackgroundColor.js +2 -1
- package/styles/helpers/setPageContentWidth.js +2 -1
- package/styles/index.js +1 -1
- package/tracking/action-creators/cookieConsent.js +24 -0
- package/tracking/action-creators/index.js +1 -4
- package/tracking/actions/cookieConsent.js +21 -0
- package/tracking/actions/index.js +1 -0
- package/tracking/components/CookieConsentModal/connector.js +6 -0
- package/tracking/components/CookieConsentModal/index.js +9 -0
- package/tracking/components/CookieConsentModal/style.js +1 -0
- package/tracking/components/CookieConsentModal/tracking-opt-in.svg +18 -0
- package/tracking/components/PrivacySettings/connector.js +6 -0
- package/tracking/components/PrivacySettings/index.js +4 -0
- package/tracking/components/PrivacySettings/style.js +1 -0
- package/tracking/components/index.js +1 -1
- package/tracking/constants/index.js +1 -1
- package/tracking/reducers/cookieConsentModal.js +6 -0
- package/tracking/reducers/cookieSettings.js +6 -0
- package/tracking/reducers/index.js +1 -0
- package/tracking/selectors/cookieConsent.js +35 -0
- package/tracking/selectors/index.js +1 -4
- package/tracking/streams/cookieConsent.js +46 -0
- package/tracking/streams/index.js +1 -1
- package/tracking/subscriptions/analytics.js +11 -0
- package/tracking/subscriptions/cookieConsent.js +13 -0
- package/tracking/subscriptions/index.js +1 -4
- package/components/MessageBar/MessageBar.types.js +0 -0
- package/components/MessageBar/style.js +0 -1
- package/i18n/locale/ru-ru/countries.json +0 -251
- package/product/components/Availability/Availability.types.js +0 -1
- package/product/components/QuantityPicker/helpers.js +0 -5
- package/tracking/components/CookieConsent/CookieConsent.connector.js +0 -4
- package/tracking/components/CookieConsent/CookieConsent.js +0 -4
- package/tracking/components/CookieConsent/CookieConsentButtons.js +0 -3
- package/tracking/components/CookieConsent/CookieConsentCheckboxes.js +0 -3
- package/tracking/components/CookieConsent/CookieConsentContent.js +0 -4
- package/tracking/components/CookieConsent/CookieConsentMessage.js +0 -4
- package/tracking/components/CookieConsent/index.js +0 -1
- package/tracking/helpers/index.js +0 -7
- package/tracking/hooks/index.js +0 -4
- package/tracking/index.js +0 -1
- package/tracking/providers/CookieConsentProvider.connector.js +0 -4
- package/tracking/providers/CookieConsentProvider.js +0 -8
- /package/{tracking/providers/CookieConsentProvider.context.js → back-in-stock/providers/BackInStockSubscriptionsProvider.context.js} +0 -0
- /package/page/{NotFound.js → components/NotFound.js} +0 -0
|
@@ -9,7 +9,7 @@ function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="s
|
|
|
9
9
|
this.endDelimiter=endDelimiter;}/**
|
|
10
10
|
* Resolves the JSON configuration.
|
|
11
11
|
* @returns {Object}
|
|
12
|
-
*/_createClass(ThemeConfigResolver,[{key:"resolve",value:function resolve(){if(!this.configIsFilled()){return this.config;}return this.processObject(this.config);}/**
|
|
12
|
+
*/return _createClass(ThemeConfigResolver,[{key:"resolve",value:function resolve(){if(!this.configIsFilled()){return this.config;}return this.processObject(this.config);}/**
|
|
13
13
|
* Takes the current theme config and resolves all page- and widget-setting refs
|
|
14
14
|
*/},{key:"resolveAll",value:function resolveAll(){this.config=appConfig.theme;writeToConfig({theme:this.resolve()},equalStructureComparator);}/**
|
|
15
15
|
* Checks whether the config has any keys.
|
|
@@ -37,4 +37,4 @@ if(replacementValue!==undefined&&replacementValue.toString()===value){return rep
|
|
|
37
37
|
* Whether the prop is an object.
|
|
38
38
|
* @param {*} prop The prop to test.
|
|
39
39
|
* @returns {boolean}
|
|
40
|
-
*/},{key:"isObject",value:function isObject(prop){return _typeof(prop)==='object'&&prop!==null&&prop.constructor===Object;}}]);
|
|
40
|
+
*/},{key:"isObject",value:function isObject(prop){return _typeof(prop)==='object'&&prop!==null&&prop.constructor===Object;}}]);}();/* eslint-enable class-methods-use-this */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{REQUEST_CORE_CONFIG,RECEIVE_CORE_CONFIG,ERROR_CORE_CONFIG}from"./config.constants";/**
|
|
2
2
|
* Dispatches the REQUEST_CORE_CONFIG action.
|
|
3
3
|
* @return {Object} The REQUEST_CORE_CONFIG action.
|
|
4
4
|
*/export var requestConfig=function requestConfig(){return{type:REQUEST_CORE_CONFIG};};/**
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import PipelineRequest from'@shopgate/pwa-core/classes/PipelineRequest';import{shouldFetchData}from'@shopgate/pwa-common/helpers/redux';import{requestConfig,receiveConfig,errorConfig}from"./config.action-creators";import{makeGetConfig}from"./config.selectors";import{PIPELINE_CORE_GET_CONFIG}from"./config.constants";/**
|
|
2
2
|
* @returns {Function} A redux thunk.
|
|
3
3
|
*/export var fetchConfig=function fetchConfig(){return function(dispatch,getState){var getConfig=makeGetConfig();var config=getConfig(getState());if(!shouldFetchData(config)){return Promise.resolve(config);}dispatch(requestConfig());var request=new PipelineRequest(PIPELINE_CORE_GET_CONFIG).dispatch();request.then(function(result){dispatch(receiveConfig(result));})["catch"](function(error){dispatch(errorConfig(error));});return request;};};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import
|
|
1
|
+
function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{REQUEST_CORE_CONFIG,RECEIVE_CORE_CONFIG,ERROR_CORE_CONFIG,CONFIG_LIFETIME}from"./config.constants";/**
|
|
2
2
|
* Stores the product locations by the ID of the product.
|
|
3
3
|
* @param {Object} [state={}] The current state.
|
|
4
4
|
* @param {Object} action The action object.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{appWillStart$}from'@shopgate/pwa-common/streams';import{fetchConfig}from"./config.actions";/**
|
|
1
|
+
import{appWillStart$}from'@shopgate/pwa-common/streams';import{hasNewServices}from'@shopgate/engage/core/helpers';import{fetchConfig}from"./config.actions";/**
|
|
2
2
|
* Config subscriptions.
|
|
3
3
|
* @param {Function} subscribe The subscribe function.
|
|
4
|
-
*/function config(subscribe){subscribe(appWillStart$,function(_ref){var dispatch=_ref.dispatch;dispatch(fetchConfig());});}export default config;
|
|
4
|
+
*/function config(subscribe){subscribe(appWillStart$,function(_ref){var dispatch=_ref.dispatch;if(hasNewServices()){dispatch(fetchConfig());}});}export default config;
|
package/core/config/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default as subscriptions}from"./config.subscriptions";export{default as reducers}from"./config.reducers";export{fetchConfig}from"./config.actions";export{makeGetConfig,makeGetMerchantSettings,makeGetFulfillmentPaths,makeGetEnabledFulfillmentMethods,makeGetEnabledFulfillmentMethodsCount,makeUseLocationFulfillmentMethods,getShopSettings,getConfigFetching}from"./config.selectors";export{requestCoreConfig$,receiveCoreConfig$,errorCoreConfig$}from"./config.streams";export{getPageConfig}from"./getPageConfig";export{getPageSettings}from"./getPageSettings";export{getThemeAssets}from"./getThemeAssets";export{getThemeColors}from"./getThemeColors";export{getThemeConfig}from"./getThemeConfig";export{getThemeSettings}from"./getThemeSettings";export{getThemeStyles}from"./getThemeStyles";export{getWidgetConfig}from"./getWidgetConfig";export{getWidgetSettings}from"./getWidgetSettings";
|
|
1
|
+
export{default as subscriptions}from"./config.subscriptions";export{default as reducers}from"./config.reducers";export{fetchConfig}from"./config.actions";export{makeGetConfig,makeGetMerchantSettings,makeGetFulfillmentPaths,makeGetEnabledFulfillmentMethods,makeGetEnabledFulfillmentMethodsCount,makeUseLocationFulfillmentMethods,getShopSettings,getConfigFetching}from"./config.selectors";export{requestCoreConfig$,receiveCoreConfig$,errorCoreConfig$}from"./config.streams";export{ThemeConfigResolver}from"./ThemeConfigResolver";export{isBeta}from"./isBeta";export{getPageConfig}from"./getPageConfig";export{getPageSettings}from"./getPageSettings";export{getThemeAssets}from"./getThemeAssets";export{getThemeColors}from"./getThemeColors";export{getThemeConfig}from"./getThemeConfig";export{getThemeSettings}from"./getThemeSettings";export{getThemeStyles}from"./getThemeStyles";export{getWidgetConfig}from"./getWidgetConfig";export{getWidgetSettings}from"./getWidgetSettings";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var APP_PERMISSION_STATUS_RECEIVED='APP_PERMISSION_STATUS_RECEIVED';export var RELOAD_APP='RELOAD_APP';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var APP_FEATURE_PUSH_OPT_IN='optIn';export var APP_FEATURE_COOKIE_CONSENT='cookieConsent';
|
package/core/constants/index.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export{RECEIVE_SHOP_SETTINGS,ERROR_SHOP_SETTINGS,CACHE_LEASE_SHOP_SETTINGS,SHOP_SETTING_GOOGLE_SITE_VERIFICATION_CODE,SHOP_SETTING_CART_SUPPLEMENTAL_CONTENT,SHOP_SETTING_ORDER_SUPPLEMENTAL_CONTENT,SHOP_SETTING_SHOW_SHOP_LOGO_IN_APP,SHOP_SETTING_SHOW_SHOP_LOGO_IN_WEB,SHOP_SETTING_PRODUCTS_SORT_ORDER,SHOP_SETTING_COOKIE_CONSENT_MODE,SHOP_SETTING_DISPLAY_PRICE_PER_MEASURE_UNIT,SHOP_SETTING_IMAGES,SHOP_SETTING_IMAGES_PRODUCT_PLACEHOLDER,SHOP_SETTING_IMAGES_CATEGORY_PLACEHOLDER,SHOP_SETTING_IMAGES_FAVICON,SHOP_SETTING_NUMBER_OF_ADDRESS_LINES,SHOP_SETTING_REGISTRATION_MODE_SIMPLE,SHOP_SETTING_REGISTRATION_MODE_EXTENDED,SHOP_SETTING_WISHLIST_ITEM_QUANTITY_ENABLED,SHOP_SETTING_WISHLIST_ITEM_NOTES_ENABLED,SHOP_SETTING_LOAD_WISHLIST_ON_APP_START_ENABLED,SHOP_SETTING_SHOW_WISHLIST_ITEMS_COUNT_BADGE}from"./shopSettings";export{RECEIVE_MERCHANT_SETTINGS,MERCHANT_SETTINGS_LOCATION_BASED_SHOPPING_ENABLED,MERCHANT_SETTINGS_SUBSTITUTION_PREFERENCES_ENABLED,MERCHANT_SETTINGS_CUSTOMER_ATTRIBUTES,MERCHANT_SETTINGS_FULFILLMENT_SCHEDULED_ENABLED,MERCHANT_SETTINGS_RESTRICT_MULTI_LOCATION_ORDERS,MERCHANT_SETTINGS_DEFAULT_CURRENCY,MERCHANT_SETTINGS_ENABLE_WEB_INDEXING,MERCHANT_SETTINGS_PRODUCT_SHOW_ALTERNATIVE_LOCATION,MERCHANT_SETTINGS_PRODUCTLIST_SHOW_INVENTORY}from"./merchantSettings";export{SHOPGATE_CORE_GET_SHOP_SETTINGS,EUNAUTHORIZED,EAUTHENTICATION}from"./pipelines";
|
|
1
|
+
import{INDEX_PATH,INDEX_PATH_DEEPLINK,LOGIN_PATH}from'@shopgate/pwa-common/constants/RoutePaths';export{RECEIVE_SHOP_SETTINGS,ERROR_SHOP_SETTINGS,CACHE_LEASE_SHOP_SETTINGS,SHOP_SETTING_GOOGLE_SITE_VERIFICATION_CODE,SHOP_SETTING_CART_SUPPLEMENTAL_CONTENT,SHOP_SETTING_ORDER_SUPPLEMENTAL_CONTENT,SHOP_SETTING_SHOW_SHOP_LOGO_IN_APP,SHOP_SETTING_SHOW_SHOP_LOGO_IN_WEB,SHOP_SETTING_PRODUCTS_SORT_ORDER,SHOP_SETTING_COOKIE_CONSENT_MODE,SHOP_SETTING_DISPLAY_PRICE_PER_MEASURE_UNIT,SHOP_SETTING_IMAGES,SHOP_SETTING_IMAGES_PRODUCT_PLACEHOLDER,SHOP_SETTING_IMAGES_CATEGORY_PLACEHOLDER,SHOP_SETTING_IMAGES_FAVICON,SHOP_SETTING_NUMBER_OF_ADDRESS_LINES,SHOP_SETTING_REGISTRATION_MODE_SIMPLE,SHOP_SETTING_REGISTRATION_MODE_EXTENDED,SHOP_SETTING_WISHLIST_ITEM_QUANTITY_ENABLED,SHOP_SETTING_WISHLIST_ITEM_NOTES_ENABLED,SHOP_SETTING_LOAD_WISHLIST_ON_APP_START_ENABLED,SHOP_SETTING_SHOW_WISHLIST_ITEMS_COUNT_BADGE}from"./shopSettings";export{RECEIVE_MERCHANT_SETTINGS,MERCHANT_SETTINGS_LOCATION_BASED_SHOPPING_ENABLED,MERCHANT_SETTINGS_SUBSTITUTION_PREFERENCES_ENABLED,MERCHANT_SETTINGS_CUSTOMER_ATTRIBUTES,MERCHANT_SETTINGS_FULFILLMENT_SCHEDULED_ENABLED,MERCHANT_SETTINGS_RESTRICT_MULTI_LOCATION_ORDERS,MERCHANT_SETTINGS_DEFAULT_CURRENCY,MERCHANT_SETTINGS_ENABLE_WEB_INDEXING,MERCHANT_SETTINGS_PRODUCT_SHOW_ALTERNATIVE_LOCATION,MERCHANT_SETTINGS_PRODUCTLIST_SHOW_INVENTORY}from"./merchantSettings";export{SHOPGATE_CORE_GET_SHOP_SETTINGS,EUNAUTHORIZED,EAUTHENTICATION}from"./pipelines";export*from"./actionTypes";export*from"./appFeatures";export*from"./deviceTypes";export*from"./geolocationRequest";// Core Constants
|
|
2
|
+
export*from'@shopgate/pwa-core/constants/ErrorManager';export*from'@shopgate/pwa-core/constants/AppEvents';export*from'@shopgate/pwa-core/constants/AppPermissions';export*from'@shopgate/pwa-core/constants/ErrorHandleTypes';export*from'@shopgate/pwa-core/constants/Pipeline';export*from'@shopgate/pwa-core/constants/ProcessTypes';export*from'@shopgate/pwa-core/constants/Scanner';export*from'@shopgate/pwa-core/constants/Trilean';// Common Constants
|
|
3
|
+
export*from'@shopgate/pwa-common/constants/ActionTypes';export*from'@shopgate/pwa-common/constants/Configuration';export*from'@shopgate/pwa-common/constants/Device';export*from'@shopgate/pwa-common/constants/DisplayOptions';export*from'@shopgate/pwa-common/constants/Pipelines';export*from'@shopgate/pwa-common/constants/Portals';// CLIENT CONSTANTS
|
|
4
|
+
export*from'@shopgate/pwa-common/constants/client';// MENU CONSTANTS
|
|
5
|
+
export*from'@shopgate/pwa-common/constants/MenuIDs';// MODAL CONSTANTS
|
|
6
|
+
export*from'@shopgate/pwa-common/constants/ModalTypes';export{INDEX_PATH,INDEX_PATH_DEEPLINK,LOGIN_PATH};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from'@shopgate/pwa-common/context';export{default as AppContext}from"./AppContext";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{APP_FEATURE_PUSH_OPT_IN,APP_FEATURE_COOKIE_CONSENT}from'@shopgate/engage/core/constants';import{hasSGJavaScriptBridge,hasWebBridge,hasNewServices}from'@shopgate/engage/core/helpers';/**
|
|
2
|
+
* Determines if the app supports the push opt-in feature
|
|
3
|
+
* @returns {boolean}
|
|
4
|
+
*/export var appSupportsPushOptIn=function appSupportsPushOptIn(){var _window,_window$SGAppInfo,_window$SGAppInfo$fea,_window$SGAppInfo$fea2,_window$SGAppInfo$fea3;if(hasWebBridge()||hasNewServices()){// Not push notifications in browser mode. Deactivated for new system for now
|
|
5
|
+
return false;}if(!hasSGJavaScriptBridge()){// Always supported in development
|
|
6
|
+
return true;}if(!Array.isArray((_window=window)===null||_window===void 0?void 0:(_window$SGAppInfo=_window.SGAppInfo)===null||_window$SGAppInfo===void 0?void 0:(_window$SGAppInfo$fea=_window$SGAppInfo.featureFlags)===null||_window$SGAppInfo$fea===void 0?void 0:(_window$SGAppInfo$fea2=_window$SGAppInfo$fea.Push)===null||_window$SGAppInfo$fea2===void 0?void 0:(_window$SGAppInfo$fea3=_window$SGAppInfo$fea2['1'])===null||_window$SGAppInfo$fea3===void 0?void 0:_window$SGAppInfo$fea3.flags)){// Not supported on app versions that don't provide the featureFlags object
|
|
7
|
+
return false;}// Supported when the feature flags contain the push opt-in flag
|
|
8
|
+
return window.SGAppInfo.featureFlags.Push['1'].flags.includes(APP_FEATURE_PUSH_OPT_IN);};/**
|
|
9
|
+
* Determines if the app supports the cookie consent feature
|
|
10
|
+
* @returns {boolean}
|
|
11
|
+
*/export var appSupportsCookieConsent=function appSupportsCookieConsent(){var _window2,_window2$SGAppInfo,_window2$SGAppInfo$fe,_window2$SGAppInfo$fe2,_window2$SGAppInfo$fe3;if(hasWebBridge()){// Deactivated in browser mode for now
|
|
12
|
+
return false;}if(!hasSGJavaScriptBridge()){// Always supported in development
|
|
13
|
+
return true;}if(!Array.isArray((_window2=window)===null||_window2===void 0?void 0:(_window2$SGAppInfo=_window2.SGAppInfo)===null||_window2$SGAppInfo===void 0?void 0:(_window2$SGAppInfo$fe=_window2$SGAppInfo.featureFlags)===null||_window2$SGAppInfo$fe===void 0?void 0:(_window2$SGAppInfo$fe2=_window2$SGAppInfo$fe.Analytics)===null||_window2$SGAppInfo$fe2===void 0?void 0:(_window2$SGAppInfo$fe3=_window2$SGAppInfo$fe2['1'])===null||_window2$SGAppInfo$fe3===void 0?void 0:_window2$SGAppInfo$fe3.flags)){// Not supported on app versions that don't provide the featureFlags object
|
|
14
|
+
return false;}// Supported when the feature flags contain the cookie consent flag
|
|
15
|
+
return window.SGAppInfo.featureFlags.Analytics['1'].flags.includes(APP_FEATURE_COOKIE_CONSENT);};
|
|
@@ -1,21 +1,58 @@
|
|
|
1
|
-
import _regeneratorRuntime from"@babel/runtime/regenerator";function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{COMMAND_GET_APP_PERMISSIONS,COMMAND_REQUEST_APP_PERMISSIONS}from'@shopgate/pwa-core/constants/AppCommands';import{
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{COMMAND_GET_APP_PERMISSIONS,COMMAND_REQUEST_APP_PERMISSIONS}from'@shopgate/pwa-core/constants/AppCommands';import{PERMISSION_STATUS_NOT_DETERMINED,PERMISSION_STATUS_NOT_SUPPORTED,PERMISSION_STATUS_GRANTED,PERMISSION_STATUS_DENIED,PERMISSION_ID_LOCATION,PERMISSION_ID_PUSH,PERMISSION_ID_CAMERA}from'@shopgate/pwa-core/constants/AppPermissions';import geolocationRequestBrowser from"../classes/GeolocationRequestBrowser";var MOCK_PERMISSIONS_KEY='sg-mocked-app-permissions';var getMockedAppPermissions;/**
|
|
2
|
+
* In development within the browser, app permissions can be mocked by calling a global functions
|
|
3
|
+
* on the MockedPermissions object. The values are persisted in local storage, so that they survive
|
|
4
|
+
* reload of the PWA.
|
|
5
|
+
*
|
|
6
|
+
* Permissions are stored "globally" and will affect every shop.
|
|
7
|
+
*
|
|
8
|
+
* Example:
|
|
9
|
+
* MockedAppPermissions.setGetAppPermissionsResponse('push', 'notDetermined')
|
|
10
|
+
* MockedAppPermissions.setRequestAppPermissionsResponse('push', 'denied')
|
|
11
|
+
*
|
|
12
|
+
* The object also provides access to the relevant constants.
|
|
13
|
+
*
|
|
14
|
+
* Example:
|
|
15
|
+
* MockedAppPermissions.ID_PUSH
|
|
16
|
+
* MockedAppPermissions.STATUS_DENIED
|
|
17
|
+
*
|
|
18
|
+
* Complete Example:
|
|
19
|
+
* MockedAppPermissions.setRequestAppPermissionsResponse(
|
|
20
|
+
* MockedAppPermissions.ID_PUSH,
|
|
21
|
+
* MockedAppPermissions.STATUS_DENIED
|
|
22
|
+
* )
|
|
23
|
+
*/if(process.env.NODE_ENV==='development'){/**
|
|
24
|
+
* Retrieves mocked app permissions from the local storage
|
|
25
|
+
* @returns {Object|null}
|
|
26
|
+
*/getMockedAppPermissions=function getMockedAppPermissions(){return JSON.parse(localStorage.getItem(MOCK_PERMISSIONS_KEY));};/**
|
|
27
|
+
* Sets a single mocked app permission status from the local storage
|
|
28
|
+
* @param {string} commandType Command type for which the status is set (get / request)
|
|
29
|
+
* @param {string} permissionId The permissionId for which the status is set
|
|
30
|
+
* @param {string} status The mocked permission status
|
|
31
|
+
*/var setMockedAppPermission=function setMockedAppPermission(commandType,permissionId,status){var _current;var current=getMockedAppPermissions();if(current===null){current={};}if(!((_current=current)===null||_current===void 0?void 0:_current[permissionId])){// Add defaults for the permissionId when not set yet
|
|
32
|
+
current[permissionId]={get:PERMISSION_STATUS_GRANTED,request:PERMISSION_STATUS_GRANTED};}// Add the status to the mocked app permissions
|
|
33
|
+
current[permissionId][commandType]=status;// Update local storage
|
|
34
|
+
localStorage.setItem(MOCK_PERMISSIONS_KEY,JSON.stringify(current));};/**
|
|
35
|
+
* Prepare global object in DEV environment to mock app permissions
|
|
36
|
+
*/var obj={setGetAppPermissionsResponse:function setGetAppPermissionsResponse(permissionId){var status=arguments.length>1&&arguments[1]!==undefined?arguments[1]:PERMISSION_STATUS_GRANTED;setMockedAppPermission('get',permissionId,status);},setRequestAppPermissionsResponse:function setRequestAppPermissionsResponse(permissionId){var status=arguments.length>1&&arguments[1]!==undefined?arguments[1]:PERMISSION_STATUS_GRANTED;setMockedAppPermission('request',permissionId,status);}};// Populate useful constants
|
|
37
|
+
obj.STATUS_GRANTED=PERMISSION_STATUS_GRANTED;obj.STATUS_DENIED=PERMISSION_STATUS_DENIED;obj.STATUS_NOT_DETERMINED=PERMISSION_STATUS_NOT_DETERMINED;obj.STATUS_NOT_SUPPORTED=PERMISSION_STATUS_NOT_SUPPORTED;obj.ID_PUSH=PERMISSION_ID_PUSH;obj.ID_CAMERA=PERMISSION_ID_CAMERA;obj.ID_LOCATION=PERMISSION_ID_LOCATION;window.MockedAppPermissions=obj;}/**
|
|
2
38
|
* Mapping of states from the browser permissions API to app permissions.
|
|
3
|
-
*/var permissionsApiStateMapping={prompt:
|
|
39
|
+
*/var permissionsApiStateMapping={prompt:PERMISSION_STATUS_NOT_DETERMINED,granted:PERMISSION_STATUS_GRANTED,denied:PERMISSION_STATUS_DENIED};/**
|
|
4
40
|
* Determines geolocation permissions from the browser permissions API.
|
|
5
41
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API
|
|
6
42
|
* @returns {string|null}
|
|
7
|
-
*/var getGeolocationPermissionsFromPermissionsApi=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){var state,_ref2;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
43
|
+
*/var getGeolocationPermissionsFromPermissionsApi=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){var state,_ref2;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;_context.next=3;return navigator.permissions.query({name:'geolocation'});case 3:_ref2=_context.sent;state=_ref2.state;_context.next=9;break;case 7:_context.prev=7;_context.t0=_context["catch"](0);case 9:return _context.abrupt("return",{state:permissionsApiStateMapping[state]||null});case 10:case"end":return _context.stop();}},_callee,null,[[0,7]]);}));return function getGeolocationPermissionsFromPermissionsApi(){return _ref.apply(this,arguments);};}();/**
|
|
8
44
|
* Determines geolocation permissions from the browser geolocation API.
|
|
9
45
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API
|
|
10
46
|
* @returns {string}
|
|
11
|
-
*/var getGeolocationPermissionsFromGeolocationApi=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(){var state,geolocation,_ref4$code,code;return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1)
|
|
47
|
+
*/var getGeolocationPermissionsFromGeolocationApi=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(){var state,geolocation,_ref4$code,code;return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:state=PERMISSION_STATUS_GRANTED;_context2.prev=1;_context2.next=4;return geolocationRequestBrowser.dispatch();case 4:geolocation=_context2.sent;_context2.next=12;break;case 7:_context2.prev=7;_context2.t0=_context2["catch"](1);_ref4$code=_context2.t0.code;code=_ref4$code===void 0?null:_ref4$code;if(code!==null){state=PERMISSION_STATUS_DENIED;}case 12:return _context2.abrupt("return",{state:state,geolocation:geolocation});case 13:case"end":return _context2.stop();}},_callee2,null,[[1,7]]);}));return function getGeolocationPermissionsFromGeolocationApi(){return _ref3.apply(this,arguments);};}();/**
|
|
12
48
|
* Creates mocked app permissions to support development within browser environments.
|
|
13
49
|
* @param {string} commandName The name of the command for which the permissions are created
|
|
14
50
|
* @param {Object} [commandParams={}] The command params.
|
|
15
51
|
* @param {string} [fallbackStatus] The status that's returned when no status could be determined.
|
|
16
52
|
* @returns {Array}
|
|
17
|
-
*/var mockedPermissions=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(commandName){var commandParams,fallbackStatus,permissionIds,permissions,geolocationState,result,_args3=arguments;return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1)
|
|
53
|
+
*/var mockedPermissions=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(commandName){var commandParams,fallbackStatus,permissionIds,permissions,geolocationState,result,_args3=arguments;return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:commandParams=_args3.length>1&&_args3[1]!==undefined?_args3[1]:{};fallbackStatus=_args3.length>2&&_args3[2]!==undefined?_args3[2]:PERMISSION_STATUS_GRANTED;permissionIds=commandParams.permissionIds;permissions=commandParams.permissions;if(permissions){permissionIds=permissions.map(function(permission){return permission.permissionId;});}if(!permissionIds.includes(PERMISSION_ID_LOCATION)){_context3.next=14;break;}if(!(commandName===COMMAND_GET_APP_PERMISSIONS)){_context3.next=10;break;}_context3.next=9;return getGeolocationPermissionsFromPermissionsApi();case 9:geolocationState=_context3.sent;case 10:if(!(commandName===COMMAND_REQUEST_APP_PERMISSIONS)){_context3.next=14;break;}_context3.next=13;return getGeolocationPermissionsFromGeolocationApi();case 13:geolocationState=_context3.sent;case 14:result=permissionIds.map(function(permissionId){var _geolocationState;var state=fallbackStatus;var geolocation;var useLocalStorageMock=false;// Use mocked permissions from local storage if available
|
|
54
|
+
if(typeof getMockedAppPermissions==='function'){var _permissionMock$permi;var permissionMock=getMockedAppPermissions();var type=commandName===COMMAND_GET_APP_PERMISSIONS?'get':'request';var mockValue=permissionMock===null||permissionMock===void 0?void 0:(_permissionMock$permi=permissionMock[permissionId])===null||_permissionMock$permi===void 0?void 0:_permissionMock$permi[type];if(mockValue){useLocalStorageMock=true;state=mockValue||PERMISSION_STATUS_GRANTED;}}if(!useLocalStorageMock&&permissionId===PERMISSION_ID_LOCATION&&((_geolocationState=geolocationState)===null||_geolocationState===void 0?void 0:_geolocationState.state)){var _geolocationState2=geolocationState;state=_geolocationState2.state;geolocation=_geolocationState2.geolocation;}return _extends({permissionId:permissionId,status:state},geolocation?{data:geolocation}:{});});return _context3.abrupt("return",result);case 16:case"end":return _context3.stop();}},_callee3);}));return function mockedPermissions(_x){return _ref5.apply(this,arguments);};}();/**
|
|
18
55
|
* Creates a function to mock app permissions.
|
|
19
56
|
* @param {string} [fallbackStatus] The status that's returned when no status could be determined.
|
|
20
57
|
* @returns {Function}
|
|
21
|
-
*/export var createMockedPermissions=function createMockedPermissions(){var fallbackStatus=arguments.length>0&&arguments[0]!==undefined?arguments[0]:
|
|
58
|
+
*/export var createMockedPermissions=function createMockedPermissions(){var fallbackStatus=arguments.length>0&&arguments[0]!==undefined?arguments[0]:PERMISSION_STATUS_GRANTED;return function(commandName,commandParams){return mockedPermissions(commandName,commandParams,fallbackStatus);};};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}/**
|
|
2
|
+
* Regular expression to decode all possible types of base url from an url
|
|
3
|
+
*
|
|
4
|
+
* URLs of deployed apps
|
|
5
|
+
* https://sandbox.cdn.connect.shopgate.com/shop_30186/@shopgate/theme-ios11/6.22.4/11953/index.html
|
|
6
|
+
*
|
|
7
|
+
* URLs while local development
|
|
8
|
+
* http://192.168.0.1:8080
|
|
9
|
+
*/var baseUrlRegex=/https?:\/\/(?:(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3}(?::[0-9]+)?)|(?:.+index.html))/gm;/**
|
|
10
|
+
* Decodes the base url from a passed url. When url parameter left empty, window.location.href will
|
|
11
|
+
* be used as source
|
|
12
|
+
* @param {string} [sourceUrl=''] An optional url to be used for decode process
|
|
13
|
+
* @return {string} The decoded base url
|
|
14
|
+
*/export var getAppBaseUrl=function getAppBaseUrl(){var sourceUrl=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';var _ref=(sourceUrl||window.location.href).match(baseUrlRegex)||[],_ref2=_slicedToArray(_ref,1),_ref2$=_ref2[0],basedUrl=_ref2$===void 0?'':_ref2$;return basedUrl;};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{configuration}from'@shopgate/pwa-common/collections';import{IS_CONNECT_EXTENSION_ATTACHED}from'@shopgate/pwa-common/constants/Configuration';/**
|
|
2
|
+
* Determines if the PWA uses the new backend services
|
|
3
|
+
* @returns {boolean}
|
|
4
|
+
*/export var hasNewServices=function hasNewServices(){return!!configuration.get(IS_CONNECT_EXTENSION_ATTACHED);};
|
|
@@ -22,4 +22,4 @@ import{getProductImageSettings}from"../../product/helpers";import{getImageFormat
|
|
|
22
22
|
* @param {number} dimension.width Width in pixels.
|
|
23
23
|
* @param {number} dimension.height Height in pixels.
|
|
24
24
|
* @returns {string}
|
|
25
|
-
*/export var getFullImageSource=function getFullImageSource(src){var _ref=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},width=_ref.width,height=_ref.height;if(src&&src.includes('images.shopgate.services/v2/images')){var
|
|
25
|
+
*/export var getFullImageSource=function getFullImageSource(src){var _ref=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},width=_ref.width,height=_ref.height;if(src&&src.includes('images.shopgate.services/v2/images')){var _getProductImageSetti2=getProductImageSettings(),fillColor=_getProductImageSetti2.fillColor,quality=_getProductImageSetti2.quality;var format=getImageFormat();return buildUrl(src,{format:format,width:width,height:height,quality:quality,fill:fillColor.replace('#','')});}if(src&&src.startsWith('https://img-cdn.shopgate.com')&&!src.includes('?')){return buildUrl(src,{w:width,h:height,q:70,zd:'resize',fillc:'FFFFFF'});}return src;};
|
package/core/helpers/i18n.js
CHANGED
|
@@ -2,9 +2,11 @@ import get from'lodash/get';import{getTranslator,getPriceFormatter,getDateFormat
|
|
|
2
2
|
* @typedef {Object} I18nHelpers
|
|
3
3
|
* @property {Function} init - Inits locales.
|
|
4
4
|
* @property {Function} text - Text translator.
|
|
5
|
+
* @property {Function} textWithDefault - Text translator with default supplier.
|
|
5
6
|
* @property {Function} price - Price translator.
|
|
6
7
|
* @property {Function} date - Date translator.
|
|
7
8
|
* @property {Function} time - Time translator.
|
|
9
|
+
* @property {Function} number - Number translator
|
|
8
10
|
* @property {Function} getSupplementalData - Get Supplemental Data
|
|
9
11
|
* @property {Function} getPath - Get locale data by path
|
|
10
12
|
* @property {Function} getLang - Get locale lang code, eg de-DE
|
|
@@ -14,10 +16,10 @@ import get from'lodash/get';import{getTranslator,getPriceFormatter,getDateFormat
|
|
|
14
16
|
*/var I18n=function I18n(){var didInit=false;/**
|
|
15
17
|
* Function that throws when called. Used in a default instance of i18n to notify developer
|
|
16
18
|
* when the module is used without initialization.
|
|
17
|
-
*/var notReadyCb=function notReadyCb(){logger.error('i18n is not yet ready. Please postpone translations until App is bootstrapped.');};return{init:function init(_ref){var locales=_ref.locales,lang=_ref.lang,_ref$currencyLocale=_ref.currencyLocale,currencyLocale=_ref$currencyLocale===void 0?null:_ref$currencyLocale;if(didInit){logger.warn('Looks like i18n locales are already
|
|
18
|
-
this.ready=true;},text:notReadyCb,price:notReadyCb,date:notReadyCb,time:notReadyCb,number:notReadyCb,getSupplementalData:notReadyCb,getPath:notReadyCb,getLang:notReadyCb,ready:false};};/**
|
|
19
|
+
*/var notReadyCb=function notReadyCb(){logger.error('i18n is not yet ready. Please postpone translations until App is bootstrapped.');};return{init:function init(_ref){var _this=this;var locales=_ref.locales,lang=_ref.lang,_ref$currencyLocale=_ref.currencyLocale,currencyLocale=_ref$currencyLocale===void 0?null:_ref$currencyLocale;if(didInit){logger.warn('Looks like i18n locales are already initialized. Changing locales now may lead to inconsistent translations.');}didInit=true;this.text=getTranslator(locales,lang);this.textWithDefault=function(key,defaultText){var text=_this.text(key);return text===key?defaultText:text;};this.price=getPriceFormatter(currencyLocale||lang);this.date=getDateFormatter(lang);this.time=getTimeFormatter(lang);this.number=getNumberFormatter(lang);this.getSupplementalData=function(){return locales.supplementalData||{};};this.getPath=function(path){return get(locales,path);};this.getLang=function(){return lang;};// If component decides to act accordingly this information should be exposed.
|
|
20
|
+
this.ready=true;},text:notReadyCb,textWithDefault:notReadyCb,price:notReadyCb,date:notReadyCb,time:notReadyCb,number:notReadyCb,getSupplementalData:notReadyCb,getPath:notReadyCb,getLang:notReadyCb,ready:false};};/**
|
|
19
21
|
* @type {I18nHelpers}
|
|
20
22
|
*/export var i18n=I18n();/**
|
|
21
23
|
* Return order of week days, based on firstDay of week locale settings
|
|
22
24
|
* @returns {string[]}
|
|
23
|
-
*/export var getWeekDaysOrder=function getWeekDaysOrder(){var _i18n$getSupplemental=i18n.getSupplementalData(),_i18n$getSupplemental2=_i18n$getSupplemental.weekData
|
|
25
|
+
*/export var getWeekDaysOrder=function getWeekDaysOrder(){var _i18n$getSupplemental=i18n.getSupplementalData(),_i18n$getSupplemental2=_i18n$getSupplemental.weekData,_i18n$getSupplemental3=_i18n$getSupplemental2===void 0?{}:_i18n$getSupplemental2,_i18n$getSupplemental4=_i18n$getSupplemental3.firstDay,firstDay=_i18n$getSupplemental4===void 0?'sun':_i18n$getSupplemental4;var days=['sun','mon','tue','wed','thu','fri','sat'];var dayIndex=days.findIndex(function(d){return d===firstDay;});return days.slice(dayIndex).concat(days.slice(0,dayIndex));};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @module core */import{getCurrentRoute as getCurrentRouteHelper,router,history,parseQueryStringToObject,parseObjectToQueryString}from'@shopgate/pwa-common/helpers/router';export*from"./environment";export*from"./appFeatures";export*from"./appPermissions";export*from"./baseUrl";export*from"./bridge";export{isBeta}from"../config/isBeta";export{getFullImageSource}from"./getFullImageSource";export{getImageFormat}from"./getImageFormat";export{i18n,getWeekDaysOrder}from"./i18n";export{updateLegacyNavigationBar}from"./updateLegacyNavigationBar";export{default as nl2br}from"./nl2br";export*from"./string";export{isIOSTheme}from"./isIOSTheme";export{isTouchDevice}from"./isTouchDevice";export{generateGoogleMapsDirectionsUrl}from"./googleMaps";export{useScrollContainer}from"./scrollContainer";export{getDeviceTypeForCms}from"./deviceType";export*from"./featureFlag";// --------------- CORE --------------- //
|
|
2
|
+
export{logger,ajaxUrl,hasSGJavaScriptBridge,useBrowserConnector,hasWebBridgeCore,logDeprecationMessage}from'@shopgate/pwa-core/helpers';export{default as logGroup}from'@shopgate/pwa-core/helpers/logGroup';export*from'@shopgate/pwa-core/helpers/version';export*from'@shopgate/pwa-common/helpers/data';export*from'@shopgate/pwa-common/helpers/date';export*from'@shopgate/pwa-common/helpers/dom';export{env,isDev,isProd,isRemote,isStaging}from'@shopgate/pwa-common/helpers/environment';export{default as decodeHTML}from'@shopgate/pwa-common/helpers/html/decodeHTML';export*from'@shopgate/pwa-common/helpers/html/handleDOM';export{default as parseHTML}from'@shopgate/pwa-common/helpers/html/parseHTML';export{default as getTranslator}from'@shopgate/pwa-common/helpers/i18n/getTranslator';export{default as getPriceFormatter}from'@shopgate/pwa-common/helpers/i18n/getPriceFormatter';export{default as getDateFormatter}from'@shopgate/pwa-common/helpers/i18n/getDateFormatter';export{default as getTimeFormatter}from'@shopgate/pwa-common/helpers/i18n/getTimeFormatter';export{default as getNumberFormatter}from'@shopgate/pwa-common/helpers/i18n/getNumberFormatter';export*from'@shopgate/pwa-common/helpers/legacy';// TODO: Can only be exported once the theme uses it. causes issues with the custom routes feature.
|
|
3
|
+
/*
|
|
4
|
+
export { default as portalCollection } from '@shopgate/pwa-common/helpers/portals/portalCollection';
|
|
5
|
+
export { default as routePortals } from '@shopgate/pwa-common/helpers/portals/routePortals';
|
|
6
|
+
*/export*from'@shopgate/pwa-common/helpers/redux';export*from'@shopgate/pwa-common/helpers/style';export*from'@shopgate/pwa-common/helpers/tracking';export*from'@shopgate/pwa-common/helpers/validation';export{default as errorBehavior}from"./errorBehavior";// --------------- ROUTER --------------- //
|
|
7
|
+
export{getCurrentRouteHelper,router,history,parseQueryStringToObject,parseObjectToQueryString};export{push,pop,replace,reset}from"../router/helpers";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default as withShowModal}from'@shopgate/pwa-common/helpers/modal/withShowModal';export{withTheme}from"./withTheme";export{withRoute}from"./withRoute";export{withCurrentProduct}from"./withCurrentProduct";export{withForwardedRef}from"./withForwardedRef";export{withNavigation}from"./withNavigation";export{withWidgetSettings}from"./withWidgetSettings";export{withWidgetStyles}from"./withWidgetStyles";export{withApp}from"./withApp";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import
|
|
1
|
+
function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React,{useContext}from'react';import{ThemeContext}from'@shopgate/pwa-common/context';/**
|
|
2
2
|
* Gets the context props for the wrapped component.
|
|
3
3
|
* @param {Object} context The context.
|
|
4
4
|
* @param {string|null} prop The optional prop name.
|
|
@@ -7,10 +7,10 @@ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj
|
|
|
7
7
|
* Injects the current Product Context information into the desired component.
|
|
8
8
|
* @param {Function} WrappedComponent The react component to wrap.
|
|
9
9
|
* @param {Object} [options] A optional prop name to inject the current product properties.
|
|
10
|
-
* @
|
|
10
|
+
* @param {string} [options.prop] An optional prop name to inject the current product properties.
|
|
11
11
|
* @returns {JSX}
|
|
12
12
|
*/export function withCurrentProduct(WrappedComponent){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
* The actual HOC.
|
|
14
|
+
* @param {Object} props The component props.
|
|
15
|
+
* @returns {JSX}
|
|
16
|
+
*/function WithCurrentProduct(props){var _useContext=useContext(ThemeContext),ProductContext=_useContext.contexts.ProductContext;var productProps=useContext(ProductContext);return React.createElement(WrappedComponent,_extends({},getInjectedProps(productProps,options.prop),props));}var displayName=WrappedComponent.displayName||WrappedComponent.name||'Component';WithCurrentProduct.displayName="WithCurrentProduct(".concat(displayName,")");return WithCurrentProduct;}
|
package/core/hocs/withTheme.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import{ThemeContext}from'@shopgate/pwa-common/context';/**
|
|
1
|
+
var _excluded=["contexts"];function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import{ThemeContext}from'@shopgate/pwa-common/context';/**
|
|
2
2
|
* Gets the context props for the wrapped component.
|
|
3
3
|
* @param {Object} context The context.
|
|
4
4
|
* @param {string|null} prop The optional prop name.
|
|
@@ -13,5 +13,5 @@ function _objectWithoutProperties(source,excluded){if(source==null)return{};var
|
|
|
13
13
|
* The actual HOC.
|
|
14
14
|
* @param {Object} props The component props.
|
|
15
15
|
* @returns {JSX}
|
|
16
|
-
*/var WithTheme=function WithTheme(props){return React.createElement(ThemeContext.Consumer,null,function(_ref2){var contexts=_ref2.contexts,themeContext=_objectWithoutProperties(_ref2,
|
|
16
|
+
*/var WithTheme=function WithTheme(props){return React.createElement(ThemeContext.Consumer,null,function(_ref2){var contexts=_ref2.contexts,themeContext=_objectWithoutProperties(_ref2,_excluded);return(// The contexts are left out in favor of other HOCs.
|
|
17
17
|
React.createElement(WrappedComponent,_extends({},getInjectedProps(themeContext,options.prop),props)));});};var displayName=WrappedComponent.displayName||WrappedComponent.name||'Component';WithTheme.displayName="WithTheme(".concat(displayName,")");return WithTheme;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{useAsyncMemo}from"./useAsyncMemo";export{useRoute}from"./useRoute";export{useTheme}from"./useTheme";export{useApp}from"./useApp";export{useCurrentProduct}from"./useCurrentProduct";export{useNavigation}from"./useNavigation";export{usePageConfig}from"./usePageConfig";export{usePageSettings}from"./usePageSettings";export{useWidgetConfig}from"./useWidgetConfig";export{useWidgetSettings}from"./useWidgetSettings";export{useWidgetStyles}from"./useWidgetStyles";export*from"./html";export{useScroll}from"./useScroll";export{usePrevious}from"./usePrevious";export{useResponsiveValue}from'@shopgate/engage/components/ResponsiveContainer/hooks';
|
|
@@ -9,4 +9,4 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGenera
|
|
|
9
9
|
* @returns {Array}
|
|
10
10
|
*/export function useAsyncMemo(asyncFunction){var asyncFunctionDependencies=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var initialValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var _React$useState=React.useState(initialValue),_React$useState2=_slicedToArray(_React$useState,2),value=_React$useState2[0],setValue=_React$useState2[1];var _React$useState3=React.useState(false),_React$useState4=_slicedToArray(_React$useState3,2),error=_React$useState4[0],setError=_React$useState4[1];/* eslint-disable react-hooks/exhaustive-deps */React.useEffect(function(){/**
|
|
11
11
|
* Wraps the async function as React doesn't allow direct async usage.
|
|
12
|
-
*/var fn=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){var output;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
12
|
+
*/var fn=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){var output;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;_context.next=3;return asyncFunction();case 3:output=_context.sent;setValue(output);_context.next=10;break;case 7:_context.prev=7;_context.t0=_context["catch"](0);setError(_context.t0);case 10:case"end":return _context.stop();}},_callee,null,[[0,7]]);}));return function fn(){return _ref.apply(this,arguments);};}();fn();},asyncFunctionDependencies);/* eslint-enable react-hooks/exhaustive-deps */return[value,error];}
|
|
@@ -15,7 +15,7 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";import _debounce fro
|
|
|
15
15
|
*/export function useFormState(initialState,complete){var validationConstraints=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var formContainerRef=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var validationErrorScrollOffset=arguments.length>4&&arguments[4]!==undefined?arguments[4]:10;var _useScrollTo=useScrollTo(formContainerRef,validationErrorScrollOffset),scrollTo=_useScrollTo.scrollTo;// Submit lock prevents the form from being submitted multiple times
|
|
16
16
|
var submitLock=useRef(false);var _useState=useState(initialState),_useState2=_slicedToArray(_useState,2),values=_useState2[0],setValues=_useState2[1];var _useState3=useState(false),_useState4=_slicedToArray(_useState3,2),isSubmitting=_useState4[0],setSubmitting=_useState4[1];var _useState5=useState(false),_useState6=_slicedToArray(_useState5,2),changed=_useState6[0],setChanged=_useState6[1];var _useState7=useState(false),_useState8=_slicedToArray(_useState7,2),ignoreErrors=_useState8[0],setIgnoreErrors=_useState8[1];var _useValidation=useValidation(validationConstraints),valid=_useValidation.valid,validationErrors=_useValidation.validationErrors,validate=_useValidation.validate,reset=_useValidation.reset;var scrollToError=useCallback(function(){scrollTo('.validationError');},[scrollTo]);// -- CHANGED ---------------
|
|
17
17
|
useEffect(function(){var isEqual=JSON.stringify(values)===JSON.stringify(initialState);if(!isEqual&&!changed){setChanged(true);}else if(isEqual&&changed){setChanged(false);}},[changed,initialState,values]);// -- IS_SUBMITTING ---------
|
|
18
|
-
/* eslint-disable react-hooks/exhaustive-deps */useEffect(function(){if(!isSubmitting){return;}var mounted=true;if((valid===true||ignoreErrors)&&!submitLock.current){submitLock.current=true;_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
18
|
+
/* eslint-disable react-hooks/exhaustive-deps */useEffect(function(){if(!isSubmitting){return;}var mounted=true;if((valid===true||ignoreErrors)&&!submitLock.current){submitLock.current=true;_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return complete(values);case 2:if(mounted){setSubmitting(false);setChanged(false);submitLock.current=false;}case 3:case"end":return _context.stop();}},_callee);}))();}// eslint-disable-next-line consistent-return
|
|
19
19
|
return function(){mounted=false;};},[isSubmitting,valid,ignoreErrors]);/* eslint-enable react-hooks/exhaustive-deps */useEffect(function(){scrollToError();},[isSubmitting,scrollToError]);useEffect(function(){return function(){submitLock.current=false;};},[]);// -- VALIDATION ON SUBMIT ---------
|
|
20
20
|
useEffect(function(){if(ignoreErrors){return;}// Yest no validation on submit
|
|
21
21
|
if(changed&&valid!==null){validate(values);}if(isSubmitting&&valid===null){validate(values);}if(isSubmitting&&valid===false){setSubmitting(false);}},[changed,validate,values,isSubmitting,valid,ignoreErrors]);var handleSetIgnoreErrors=useCallback(function(value){setIgnoreErrors(value);if(ignoreErrors===true){reset();}},[ignoreErrors,reset]);/**
|
|
@@ -2,4 +2,4 @@ import{useCallback}from'react';import{getCSSCustomProp}from'@shopgate/engage/sty
|
|
|
2
2
|
* @param {Object} ref A ref to the scroll container
|
|
3
3
|
* @param {number} [offset=10] Optional offset for the scroll operation
|
|
4
4
|
* @returns {Object}
|
|
5
|
-
*/export var useScrollTo=function useScrollTo(ref){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;var scrollTo=useCallback(function(selector){if(!(ref===null||ref===void 0?void 0:ref.current)){return;}var firstElement=ref.current.querySelector(selector);if(firstElement){if(hasWebBridge()){var scrollOffset=offset;var appBarHeight=getCSSCustomProp('--app-bar-height')||0;var _firstElement$
|
|
5
|
+
*/export var useScrollTo=function useScrollTo(ref){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;var scrollTo=useCallback(function(selector){if(!(ref===null||ref===void 0?void 0:ref.current)){return;}var firstElement=ref.current.querySelector(selector);if(firstElement){if(hasWebBridge()){var scrollOffset=offset;var appBarHeight=getCSSCustomProp('--app-bar-height')||0;var _firstElement$getBoun2=firstElement.getBoundingClientRect(),top=_firstElement$getBoun2.top;var scrollTop=top+window.pageYOffset-parseInt(appBarHeight,10)-scrollOffset;window.scroll({top:scrollTop,behavior:'smooth'});}else{firstElement.scrollIntoView({behavior:'smooth'});}}},[offset,ref]);return{scrollTo:scrollTo};};
|
package/core/hooks/useTheme.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import{useContext}from'react';import{ThemeContext}from'@shopgate/pwa-common/context';/**
|
|
1
|
+
var _excluded=["contexts"];function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import{useContext}from'react';import{ThemeContext}from'@shopgate/pwa-common/context';/**
|
|
2
2
|
* Provides the theme API. This does not include the contexts.
|
|
3
3
|
* @returns {Object}
|
|
4
4
|
*/export function useTheme(){// The contexts are left out in favor of other hooks.
|
|
5
|
-
var _useContext=useContext(ThemeContext),contexts=_useContext.contexts,themeContext=_objectWithoutProperties(_useContext,
|
|
5
|
+
var _useContext=useContext(ThemeContext),contexts=_useContext.contexts,themeContext=_objectWithoutProperties(_useContext,_excluded);return themeContext;}
|
package/core/index.js
CHANGED
|
@@ -1,52 +1,5 @@
|
|
|
1
|
-
/** @module core */
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export{
|
|
6
|
-
export{default as analyticsSetCustomValues}from'@shopgate/pwa-core/commands/analyticsSetCustomValues';export*from'@shopgate/pwa-core/commands/appPermissions';export*from'@shopgate/pwa-core/commands/brightness';export{default as broadcastEvent}from'@shopgate/pwa-core/commands/broadcastEvent';export{default as cleanTab,cleanTabCmd}from'@shopgate/pwa-core/commands/cleanTab';export{default as closeInAppBrowser}from'@shopgate/pwa-core/commands/closeInAppBrowser';export{default as flushTab}from'@shopgate/pwa-core/commands/flushTab';export{default as hideMenuBar}from'@shopgate/pwa-core/commands/hideMenuBar';export{default as hideNavigationBar}from'@shopgate/pwa-core/commands/hideNavigationBar';export{default as hideSplashScreen}from'@shopgate/pwa-core/commands/hideSplashScreen';export{default as onload}from'@shopgate/pwa-core/commands/onload';export{default as openAppSettings}from'@shopgate/pwa-core/commands/openAppSettings';export{default as openPage}from'@shopgate/pwa-core/commands/openPage';export{default as openPageExtern}from'@shopgate/pwa-core/commands/openPageExtern';export{default as performCommandsAfterDelay,performCommandsAfterDelayCmd}from'@shopgate/pwa-core/commands/performCommandsAfterDelay';export*from'@shopgate/pwa-core/commands/plotProjects';export{default as popTabToRoot,popTabToRootCmd}from'@shopgate/pwa-core/commands/popTabToRoot';export{default as registerEvents}from'@shopgate/pwa-core/commands/registerEvents';export*from'@shopgate/pwa-core/commands/scanner';export{default as setCookie}from'@shopgate/pwa-core/commands/setCookie';export{default as setDebugLoggingEnabled}from'@shopgate/pwa-core/commands/setDebugLoggingEnabled';export{default as setScrollingEnabled}from'@shopgate/pwa-core/commands/setScrollingEnabled';export{default as showNavigationBar}from'@shopgate/pwa-core/commands/showNavigationBar';export{default as showTab}from'@shopgate/pwa-core/commands/showTab';export*from'@shopgate/pwa-core/commands/unifiedTracking';// TODO: Contains circular dependency!
|
|
7
|
-
// export * from '@shopgate/pwa-core/commands/webStorage';
|
|
8
|
-
// Core Constants
|
|
9
|
-
export*from'@shopgate/pwa-core/constants/AppEvents';export*from'@shopgate/pwa-core/constants/AppPermissions';export*from'@shopgate/pwa-core/constants/ErrorHandleTypes';export*from'@shopgate/pwa-core/constants/Pipeline';export*from'@shopgate/pwa-core/constants/ProcessTypes';export*from'@shopgate/pwa-core/constants/Scanner';// Common Constants
|
|
10
|
-
export*from'@shopgate/pwa-common/constants/ActionTypes';export*from'@shopgate/pwa-common/constants/Configuration';export*from'@shopgate/pwa-common/constants/Device';export*from'@shopgate/pwa-common/constants/DisplayOptions';export*from'@shopgate/pwa-common/constants/Pipelines';export*from'@shopgate/pwa-common/constants/Portals';export{INDEX_PATH,INDEX_PATH_DEEPLINK,LOGIN_PATH};export*from"./constants/geolocationRequest";// Emitters
|
|
11
|
-
export{default as UIEvents}from'@shopgate/pwa-core/emitters/ui';// Helpers
|
|
12
|
-
export{logger,ajaxUrl,hasSGJavaScriptBridge,useBrowserConnector,logDeprecationMessage}from'@shopgate/pwa-core/helpers';export{default as logGroup}from'@shopgate/pwa-core/helpers/logGroup';export*from'@shopgate/pwa-core/helpers/version';export*from'@shopgate/pwa-common/helpers/data';export*from'@shopgate/pwa-common/helpers/date';export*from'@shopgate/pwa-common/helpers/dom';export*from'@shopgate/pwa-common/helpers/environment';export{default as decodeHTML}from'@shopgate/pwa-common/helpers/html/decodeHTML';export*from'@shopgate/pwa-common/helpers/html/handleDOM';export{default as parseHTML}from'@shopgate/pwa-common/helpers/html/parseHTML';export{default as getTranslator}from'@shopgate/pwa-common/helpers/i18n/getTranslator';export{default as getPriceFormatter}from'@shopgate/pwa-common/helpers/i18n/getPriceFormatter';export{default as getDateFormatter}from'@shopgate/pwa-common/helpers/i18n/getDateFormatter';export{default as getTimeFormatter}from'@shopgate/pwa-common/helpers/i18n/getTimeFormatter';export{default as getNumberFormatter}from'@shopgate/pwa-common/helpers/i18n/getNumberFormatter';export*from'@shopgate/pwa-common/helpers/legacy';// TODO: Can only be exported once the theme uses it. causes issues with the custom routes feature.
|
|
13
|
-
/*
|
|
14
|
-
export { default as portalCollection } from '@shopgate/pwa-common/helpers/portals/portalCollection';
|
|
15
|
-
export { default as routePortals } from '@shopgate/pwa-common/helpers/portals/routePortals';
|
|
16
|
-
*/export*from'@shopgate/pwa-common/helpers/redux';export*from'@shopgate/pwa-common/helpers/style';export*from'@shopgate/pwa-common/helpers/tracking';export*from'@shopgate/pwa-common/helpers/validation';// STREAMS
|
|
17
|
-
export*from'@shopgate/pwa-common/streams/main';export*from'@shopgate/pwa-common/streams/error';// --------------- APP --------------- //
|
|
18
|
-
// ACTIONS
|
|
19
|
-
export{default as handleDeepLink}from'@shopgate/pwa-common/actions/app/handleDeepLink';export{default as handleUniversalLink}from'@shopgate/pwa-common/actions/app/handleUniversalLink';export{default as handleLink}from'@shopgate/pwa-common/actions/app/handleLink';export{default as handlePushNotification}from'@shopgate/pwa-common/actions/app/handlePushNotification';export{default as registerLinkEvents}from'@shopgate/pwa-common/actions/app/registerLinkEvents';export{default as updateStatusBarBackground}from"./actions/updateStatusBarBackground";export{default as grantPermissions}from"./actions/grantPermissions";export{default as grantCameraPermissions}from"./actions/grantCameraPermissions";export{default as grantGeolocationPermissions}from"./actions/grantGeolocationPermissions";export{default as getGeolocation}from"./actions/getGeolocation";// STREAMS
|
|
20
|
-
export*from'@shopgate/pwa-common/streams/app';// --------------- STORE --------------- //
|
|
21
|
-
export*from'@shopgate/pwa-common/store';// --------------- CLIENT --------------- //
|
|
22
|
-
// ACTIONS
|
|
23
|
-
export{default as fetchClientInformation}from'@shopgate/pwa-common/actions/client/fetchClientInformation';// CONSTANTS
|
|
24
|
-
export*from'@shopgate/pwa-common/constants/client';// SELECTORS
|
|
25
|
-
export*from'@shopgate/pwa-common/selectors/client';// STREAMS
|
|
26
|
-
export*from'@shopgate/pwa-common/streams/client';// --------------- COLLECTIONS --------------- //
|
|
27
|
-
export{default as authRoutes}from'@shopgate/pwa-common/collections/AuthRoutes';export{default as redirects}from'@shopgate/pwa-common/collections/Redirects';export{default as configuration}from'@shopgate/pwa-common/collections/Configuration';export{default as embeddedMedia}from'@shopgate/pwa-common/collections/EmbeddedMedia';export{default as persistedReducers}from'@shopgate/pwa-common/collections/PersistedReducers';export{default as Vimeo}from'@shopgate/pwa-common/collections/media-providers/Vimeo';export{default as YouTube}from'@shopgate/pwa-common/collections/media-providers/YouTube';// --------------- CONTEXTS --------------- //
|
|
28
|
-
export*from'@shopgate/pwa-common/context';export{default as AppContext}from"./contexts/AppContext";// --------------- PROVIDERS --------------- //
|
|
29
|
-
export{default as LoadingProvider}from'@shopgate/pwa-common/providers/loading';export{default as LoadingContext}from'@shopgate/pwa-common/providers/loading/context';export{default as ToastProvider}from'@shopgate/pwa-common/providers/toast';export{default as ToastContext}from'@shopgate/pwa-common/providers/toast/context';export{default as AppProvider}from"./providers/AppProvider";// --------------- ROUTER --------------- //
|
|
30
|
-
// ACTIONS
|
|
31
|
-
export{historyPop}from'@shopgate/pwa-common/actions/router/historyPop';export{historyPopToRoute}from'@shopgate/pwa-common/actions/router/historyPopToRoute';export{historyPush}from'@shopgate/pwa-common/actions/router/historyPush';export{historyRedirect}from'@shopgate/pwa-common/actions/router/historyRedirect';export{historyReplace}from'@shopgate/pwa-common/actions/router/historyReplace';export{historyReset}from'@shopgate/pwa-common/actions/router/historyReset';export{historyResetTo}from'@shopgate/pwa-common/actions/router/historyResetTo';// HELPERS
|
|
32
|
-
export{getCurrentRouteHelper,router,history,parseQueryStringToObject,parseObjectToQueryString};export{push,pop,replace,reset}from"./router/helpers";// SELECTORS
|
|
33
|
-
export*from'@shopgate/pwa-common/selectors/router';export*from'@shopgate/pwa-common/selectors/history';// STREAMS
|
|
34
|
-
export*from'@shopgate/pwa-common/streams/router';// --------------- URL --------------- //
|
|
35
|
-
// ACTIONS
|
|
36
|
-
export{resetApp}from'@shopgate/pwa-common/action-creators/app';export*from'@shopgate/pwa-common/action-creators/url';// SELECTORS
|
|
37
|
-
export*from'@shopgate/pwa-common/selectors/url';// --------------- MENU --------------- //
|
|
38
|
-
// ACTIONS
|
|
39
|
-
export{default as fetchMenu}from'@shopgate/pwa-common/actions/menu/fetchMenu';// CONSTANTS
|
|
40
|
-
export*from'@shopgate/pwa-common/constants/MenuIDs';// SELECTORS
|
|
41
|
-
export*from'@shopgate/pwa-common/selectors/menu';// --------------- MODAL --------------- //
|
|
42
|
-
// ACTIONS
|
|
43
|
-
export{default as closeModal}from'@shopgate/pwa-common/actions/modal/closeModal';export{default as promiseMap}from'@shopgate/pwa-common/actions/modal/promiseMap';export{default as showModal}from'@shopgate/pwa-common/actions/modal/showModal';// CONSTANTS
|
|
44
|
-
export*from'@shopgate/pwa-common/constants/ModalTypes';// HELPERS
|
|
45
|
-
export{default as withShowModal}from'@shopgate/pwa-common/helpers/modal/withShowModal';// SELECTORS
|
|
46
|
-
export*from'@shopgate/pwa-common/selectors/modal';// --------------- HOOKS --------------- //
|
|
47
|
-
export{useAsyncMemo}from"./hooks/useAsyncMemo";export{useRoute}from"./hooks/useRoute";export{useTheme}from"./hooks/useTheme";export{useApp}from"./hooks/useApp";export{useCurrentProduct}from"./hooks/useCurrentProduct";export{useNavigation}from"./hooks/useNavigation";export{usePageConfig}from"./hooks/usePageConfig";export{usePageSettings}from"./hooks/usePageSettings";export{useWidgetConfig}from"./hooks/useWidgetConfig";export{useWidgetSettings}from"./hooks/useWidgetSettings";export{useWidgetStyles}from"./hooks/useWidgetStyles";export*from"./hooks/html";export{useScroll}from"./hooks/useScroll";export{usePrevious}from"./hooks/usePrevious";// --------------- HOCs --------------- //
|
|
48
|
-
export{withTheme}from"./hocs/withTheme";export{withRoute}from"./hocs/withRoute";export{withCurrentProduct}from"./hocs/withCurrentProduct";export{withForwardedRef}from"./hocs/withForwardedRef";export{withNavigation}from"./hocs/withNavigation";export{withWidgetSettings}from"./hocs/withWidgetSettings";export{withWidgetStyles}from"./hocs/withWidgetStyles";export{withApp}from"./hocs/withApp";// --------------- CONFIG --------------- //
|
|
49
|
-
export{ThemeConfigResolver}from"./config/ThemeConfigResolver";export{isBeta}from"./config/isBeta";export{getThemeConfig}from"./config/getThemeConfig";export{getThemeSettings}from"./config/getThemeSettings";export{getThemeColors}from"./config/getThemeColors";export{getThemeAssets}from"./config/getThemeAssets";export{getPageConfig}from"./config/getPageConfig";export{getPageSettings}from"./config/getPageSettings";export{getWidgetConfig}from"./config/getWidgetConfig";export{getWidgetSettings}from"./config/getWidgetSettings";// -------------- HELPERS -------------- //
|
|
50
|
-
export{i18n,getWeekDaysOrder}from"./helpers/i18n";export{default as nl2br}from"./helpers/nl2br";export*from"./helpers/string";export{updateLegacyNavigationBar}from"./helpers/updateLegacyNavigationBar";export{getFullImageSource}from"./helpers/getFullImageSource";export{isIOSTheme}from"./helpers/isIOSTheme";export{isTouchDevice}from"./helpers/isTouchDevice";export{generateGoogleMapsDirectionsUrl}from"./helpers/googleMaps";export{hasWebBridge}from"./helpers/bridge";export{useScrollContainer}from"./helpers/scrollContainer";export{getDeviceTypeForCms}from"./helpers/deviceType";export*from"./helpers/featureFlag";// -------------- CONFIG -------------- //
|
|
51
|
-
export*from"./config/config.actions";export*from"./config/config.selectors";export*from"./config/config.streams";export*from"./initialization";// -------------- VALIDATION -------------- //
|
|
52
|
-
export*from"./validation";export{default as errorBehavior}from"./helpers/errorBehavior";export{makeGetShopSettingByKey,makeGetShopSettings,getIsLocationBasedShopping,getRestrictMultiLocationOrders,getFulfillmentSchedulingEnabled,getProductImagePlaceholder,getCategoryImagePlaceholder,getFavicon,getDefaultCurrency,getEnableWebIndexing,getNumberOfAddressLines,getGoogleSiteVerificationCode,getRegistrationMode,getWishlistItemQuantityEnabled,getWishlistItemNotesEnabled,getShowWishlistItemsCountBadge,getLoadWishlistOnAppStartEnabled}from"./selectors";export{SHOP_SETTING_CART_SUPPLEMENTAL_CONTENT,SHOP_SETTING_ORDER_SUPPLEMENTAL_CONTENT,SHOP_SETTING_SHOW_SHOP_LOGO_IN_APP,SHOP_SETTING_SHOW_SHOP_LOGO_IN_WEB,SHOP_SETTING_PRODUCTS_SORT_ORDER,SHOP_SETTING_COOKIE_CONSENT_MODE,SHOP_SETTING_DISPLAY_PRICE_PER_MEASURE_UNIT,SHOP_SETTING_REGISTRATION_MODE_SIMPLE,SHOP_SETTING_REGISTRATION_MODE_EXTENDED,EUNAUTHORIZED,EAUTHENTICATION}from"./constants";
|
|
1
|
+
/** @module core */ // --------------- CORE --------------- //
|
|
2
|
+
// Emitters
|
|
3
|
+
export{default as UIEvents}from'@shopgate/pwa-core/emitters/ui';// --------------- STORE --------------- //
|
|
4
|
+
export*from'@shopgate/pwa-common/store';// --------------- CONFIG --------------- //
|
|
5
|
+
export{ThemeConfigResolver}from"./config/ThemeConfigResolver";export{getThemeConfig}from"./config/getThemeConfig";export{getThemeSettings}from"./config/getThemeSettings";export{getThemeColors}from"./config/getThemeColors";export{getThemeAssets}from"./config/getThemeAssets";export{getPageConfig}from"./config/getPageConfig";export{getPageSettings}from"./config/getPageSettings";export{getWidgetConfig}from"./config/getWidgetConfig";export{getWidgetSettings}from"./config/getWidgetSettings";export*from"./actions";export*from"./action-creators";export*from"./classes";export*from"./collections";export*from"./commands";export*from"./constants";export*from"./contexts";export*from"./helpers";export*from"./hocs";export*from"./hooks";export*from"./initialization";export*from"./providers";export*from"./selectors";export*from"./streams";export*from"./validation";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{withScope,captureMessage,Severity as SentrySeverity}from'@sentry/browser';import moment from'moment';import{configureStore}from'@shopgate/pwa-common/store';import{appWillInit,appWillStart}from'@shopgate/pwa-common/action-creators/app';import{i18n}from'@shopgate/engage/core';import fetchClientInformation from'@shopgate/pwa-common/actions/client/fetchClientInformation';import appConfig from'@shopgate/pwa-common/helpers/config';import{receiveShopSettings,receiveMerchantSettings,errorShopSettings}from"../action-creators";var _appConfig$locales=appConfig.locales
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{withScope,captureMessage,Severity as SentrySeverity}from'@sentry/browser';import moment from'moment';import{configureStore}from'@shopgate/pwa-common/store';import{appWillInit,appWillStart}from'@shopgate/pwa-common/action-creators/app';import{i18n}from'@shopgate/engage/core';import fetchClientInformation from'@shopgate/pwa-common/actions/client/fetchClientInformation';import appConfig from'@shopgate/pwa-common/helpers/config';import{appInitialization,configuration}from'@shopgate/engage/core/collections';import{CONFIGURATION_COLLECTION_KEY_BASE_URL}from'@shopgate/engage/core/constants';import{getAppBaseUrl}from'@shopgate/engage/core/helpers';import{receiveShopSettings,receiveMerchantSettings,errorShopSettings}from"../action-creators";var _appConfig$locales=appConfig.locales,_appConfig$locales2=_appConfig$locales===void 0?{}:_appConfig$locales,_appConfig$locales2$c=_appConfig$locales2.currency,currencyLocale=_appConfig$locales2$c===void 0?null:_appConfig$locales2$c,settingsUrl=appConfig.settingsUrl,merchantSettingsUrl=appConfig.merchantSettingsUrl;var REQUEST_TIMEOUT=3000;/**
|
|
2
2
|
* Injects a script tag to fetch the shop settings JSONP.
|
|
3
3
|
* @param {string} id The script id
|
|
4
4
|
* @param {string} src The script url
|
|
@@ -16,4 +16,6 @@ injectScript('shop-settings-jsonp',settingsUrl,function(error){withScope(functio
|
|
|
16
16
|
* @param {Object} locales An object with locales.
|
|
17
17
|
* @param {Function} reducers The reducers from the theme.
|
|
18
18
|
* @param {Array} subscribers The subscribers to the streams middleware.
|
|
19
|
-
*/export var initialize=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(locales,reducers,subscribers){var store;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
19
|
+
*/export var initialize=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(locales,reducers,subscribers){var store;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:moment.locale(process.env.LOCALE);i18n.init({locales:locales,lang:process.env.LOCALE,currencyLocale:currencyLocale});store=configureStore(reducers,subscribers);_context.prev=3;_context.next=6;return store.dispatch(fetchClientInformation());case 6:_context.next=10;break;case 8:_context.prev=8;_context.t0=_context["catch"](3);case 10:// Save the base url inside the configuration collection before any other code can apply
|
|
20
|
+
// url manipulations.
|
|
21
|
+
configuration.set(CONFIGURATION_COLLECTION_KEY_BASE_URL,getAppBaseUrl());store.dispatch(appWillInit("".concat(window.location.pathname).concat(window.location.search)));_context.prev=12;_context.next=15;return fetchSettings(store);case 15:_context.next=19;break;case 17:_context.prev=17;_context.t1=_context["catch"](12);case 19:_context.next=21;return appInitialization.initialize({dispatch:store.dispatch,getState:store.getState});case 21:store.dispatch(appWillStart("".concat(window.location.pathname).concat(window.location.search)));return _context.abrupt("return",{store:store});case 23:case"end":return _context.stop();}},_callee,null,[[3,8],[12,17]]);}));return function initialize(_x,_x2,_x3){return _ref.apply(this,arguments);};}();
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function
|
|
1
|
+
function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{Component}from'react';import PropTypes from'prop-types';import appConfig from'@shopgate/pwa-common/helpers/config';import{APP_EVENT_VIEW_WILL_APPEAR,APP_EVENT_VIEW_WILL_DISAPPEAR}from'@shopgate/pwa-core/constants/AppEvents';import event from'@shopgate/pwa-core/classes/Event';import AppContext from"../contexts/AppContext";/**
|
|
2
2
|
* The AppProvider component.
|
|
3
|
-
*/var AppProvider=/*#__PURE__*/function(_Component){
|
|
3
|
+
*/var AppProvider=/*#__PURE__*/function(_Component){function AppProvider(props){var _this2;_classCallCheck(this,AppProvider);_this2=_callSuper(this,AppProvider,[props]);/**
|
|
4
|
+
* Sets the isVisible state to TRUE.
|
|
5
|
+
*/_defineProperty(_this2,"setVisible",function(){_this2.setIsVisible(true);});/**
|
|
6
|
+
* Sets the isVisible state to TRUE.
|
|
7
|
+
*/_defineProperty(_this2,"setHidden",function(){_this2.setIsVisible(false);});_this2.state={isVisible:true};event.addCallback(APP_EVENT_VIEW_WILL_APPEAR,_this2.setVisible);event.addCallback(APP_EVENT_VIEW_WILL_DISAPPEAR,_this2.setHidden);return _this2;}/**
|
|
4
8
|
* Removes the event listeners when the component unmounts.
|
|
5
|
-
*/_createClass(AppProvider,[{key:"componentWillUnmount",value:function componentWillUnmount(){event.removeCallback(APP_EVENT_VIEW_WILL_APPEAR,this.setVisible);event.removeCallback(APP_EVENT_VIEW_WILL_DISAPPEAR,this.setHidden);}/**
|
|
9
|
+
*/_inherits(AppProvider,_Component);return _createClass(AppProvider,[{key:"componentWillUnmount",value:function componentWillUnmount(){event.removeCallback(APP_EVENT_VIEW_WILL_APPEAR,this.setVisible);event.removeCallback(APP_EVENT_VIEW_WILL_DISAPPEAR,this.setHidden);}/**
|
|
6
10
|
* Returns the context value to be passed to consumers.
|
|
7
11
|
* @returns {Object}
|
|
8
|
-
*/},{key:"setIsVisible"
|
|
12
|
+
*/},{key:"provided",get:function get(){return{appConfig:appConfig,isVisible:this.state.isVisible,setIsVisible:this.setIsVisible};}},{key:"setIsVisible",value:/**
|
|
9
13
|
* Sets the isVisible state. It indicates if Engage is visible,
|
|
10
14
|
* or another WebView is presented to the user.
|
|
11
15
|
* @param {boolean} value The new value
|
|
12
|
-
*/
|
|
16
|
+
*/function setIsVisible(value){this.setState({isVisible:value});}/**
|
|
13
17
|
* @returns {JSX}
|
|
14
|
-
*/},{key:"render",value:function render(){return React.createElement(AppContext.Provider,{value:this.provided},this.props.children);}}
|
|
15
|
-
* Sets the isVisible state to TRUE.
|
|
16
|
-
*/}]);return AppProvider;}(Component);export default AppProvider;
|
|
18
|
+
*/},{key:"render",value:function render(){return React.createElement(AppContext.Provider,{value:this.provided},this.props.children);}}]);}(Component);export default AppProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default as LoadingProvider}from'@shopgate/pwa-common/providers/loading';export{default as LoadingContext}from'@shopgate/pwa-common/providers/loading/context';export{default as ToastProvider}from'@shopgate/pwa-common/providers/toast';export{default as ToastContext}from'@shopgate/pwa-common/providers/toast/context';export{default as AppProvider}from"./AppProvider";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{produce}from'immer';import{PWA_DID_APPEAR,PWA_DID_DISAPPEAR}from'@shopgate/pwa-common/constants/ActionTypes';var defaultState={webViewVisible:true};/**
|
|
2
|
+
* Stores app state
|
|
3
|
+
* @param {Object} [state={}] The current state.
|
|
4
|
+
* @param {Object} action The action object.
|
|
5
|
+
* @returns {Object} The new state.
|
|
6
|
+
*/export default function app(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:defaultState;var action=arguments.length>1?arguments[1]:undefined;/* eslint-disable no-param-reassign */var producer=produce(function(draft){switch(action.type){case PWA_DID_APPEAR:{draft.webViewVisible=true;break;}case PWA_DID_DISAPPEAR:{draft.webViewVisible=false;break;}default:break;}});/* eslint-enable no-param-reassign */return producer(state);}
|
package/core/reducers/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{combineReducers}from'redux';import config from"../config/config.reducers";import shopSettings from"./shopSettings";import merchantSettings from"./merchantSettings";export var settings=combineReducers({config:config,shopSettings:shopSettings,merchantSettings:merchantSettings});
|
|
1
|
+
import{combineReducers}from'redux';import config from"../config/config.reducers";import shopSettings from"./shopSettings";import merchantSettings from"./merchantSettings";export{default as app}from"./app";export var settings=combineReducers({config:config,shopSettings:shopSettings,merchantSettings:merchantSettings});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{produce}from'immer';import appConfig from'@shopgate/pwa-common/helpers/config';import{RECEIVE_MERCHANT_SETTINGS,MERCHANT_SETTINGS_LOCATION_BASED_SHOPPING_ENABLED,MERCHANT_SETTINGS_SUBSTITUTION_PREFERENCES_ENABLED,MERCHANT_SETTINGS_RESTRICT_MULTI_LOCATION_ORDERS,MERCHANT_SETTINGS_DEFAULT_CURRENCY,MERCHANT_SETTINGS_ENABLE_WEB_INDEXING}from"../constants";var _appConfig$locales=appConfig.locales,_appConfig$locales2=_appConfig$locales===void 0?{}:_appConfig$locales,_appConfig$locales2$c=_appConfig$locales2.currency,currency=_appConfig$locales2$c===void 0?null:_appConfig$locales2$c;var defaultState=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},MERCHANT_SETTINGS_LOCATION_BASED_SHOPPING_ENABLED,false),MERCHANT_SETTINGS_SUBSTITUTION_PREFERENCES_ENABLED,false),MERCHANT_SETTINGS_RESTRICT_MULTI_LOCATION_ORDERS,false),MERCHANT_SETTINGS_DEFAULT_CURRENCY,currency),MERCHANT_SETTINGS_ENABLE_WEB_INDEXING,false);/**
|
|
2
2
|
* Stores the merchant settings.
|
|
3
3
|
* @param {Object} [state={}] The current state.
|
|
4
4
|
* @param {Object} action The action object.
|