@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
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from'react';import{ViewContext}from"../../context";/**
|
|
2
2
|
* @returns {JSX}
|
|
3
|
-
*/function ViewBelow(){return React.createElement(ViewContext.Consumer,null,function(_ref){var bottom=_ref.bottom;if(!bottom){return null;}var styles={flexShrink:0,height:"calc(".concat(bottom,"px + var(--safe-area-inset-bottom))")};return React.createElement("div",{"aria-hidden":true,style:styles});});}export default ViewBelow;
|
|
3
|
+
*/function ViewBelow(){return React.createElement(ViewContext.Consumer,null,function(_ref){var bottom=_ref.bottom;if(!bottom){return null;}var styles={flexShrink:0,height:"calc(".concat(bottom,"px + var(--safe-area-inset-bottom))")};return React.createElement("div",{"aria-hidden":true,style:styles,className:"engage__view__below"});});}export default ViewBelow;
|
|
@@ -1,21 +1,28 @@
|
|
|
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);}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 _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 _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 Swipeable from'react-swipeable';import Helmet from'react-helmet';import ResponsiveContainer from'@shopgate/engage/components/ResponsiveContainer';import appConfig from'@shopgate/pwa-common/helpers/config';import event from'@shopgate/pwa-core/classes/Event';import{router}from'@virtuous/conductor';import{RouteContext}from'@shopgate/pwa-common/context';import{EVENT_KEYBOARD_WILL_CHANGE}from'@shopgate/pwa-core/constants/AppEvents';import SurroundPortals from'@shopgate/pwa-common/components/SurroundPortals';import{VIEW_CONTENT}from'@shopgate/pwa-common/constants/Portals';import{useScrollContainer}from'@shopgate/engage/core';import{ConditionalWrapper}from"../../../ConditionalWrapper";import Above from"../Above";import Below from"../Below";import styles from"./style";/**
|
|
2
2
|
* The ViewContent component.
|
|
3
|
-
*/var ViewContent=/*#__PURE__*/function(_Component){
|
|
3
|
+
*/var ViewContent=/*#__PURE__*/function(_Component){/**
|
|
4
4
|
* @param {Object} props The component props.
|
|
5
|
-
*/function ViewContent(props){var
|
|
5
|
+
*/function ViewContent(props){var _this2;_classCallCheck(this,ViewContent);_this2=_callSuper(this,ViewContent,[props]);/**
|
|
6
|
+
* Handles a keyboard change event.
|
|
7
|
+
* @param {boolean} open If the keyboard is now open.
|
|
8
|
+
* @param {boolean} overlap The height of the keyboard.
|
|
9
|
+
*/_defineProperty(_this2,"handleKeyboardChange",function(_ref){var open=_ref.open,overlap=_ref.overlap;if(_this2.props.noKeyboardListener){return;}var height=open?overlap:0;if(_this2.props.visible&&height!==_this2.state.keyboardHeight){_this2.setState({keyboardHeight:height});}});/**
|
|
10
|
+
* Handles the swipe down gesture.
|
|
11
|
+
* @param {Object} e The event object.
|
|
12
|
+
* @param {number} x The change on the x axis.
|
|
13
|
+
* @param {number} y The change on the y axis.
|
|
14
|
+
* @param {boolean} isFlick Whether this is a flick or swipe.
|
|
15
|
+
* @param {number} velocity The velocity of the gesture.
|
|
16
|
+
*/_defineProperty(_this2,"handleSwipe",function(e,x,y,isFlick,velocity){var swipeEvent=new CustomEvent('swipe',{detail:{event:e,x:x,y:y,isFlick:isFlick,velocity:velocity}});_this2.ref.current.dispatchEvent(swipeEvent);});_this2.ref=React.createRef();_this2.state={keyboardHeight:0};_this2.scrollContainer=useScrollContainer();if(!_this2.scrollContainer){_this2.ref.current=window;}_this2.props.setContentRef(_this2.ref);event.addCallback(EVENT_KEYBOARD_WILL_CHANGE,_this2.handleKeyboardChange);return _this2;}/**
|
|
6
17
|
* @param {Object} props The component props.
|
|
7
18
|
* @param {Object} state The component state.
|
|
8
19
|
* @returns {Object}
|
|
9
|
-
*/_createClass(ViewContent,[{key:"componentDidMount"
|
|
20
|
+
*/_inherits(ViewContent,_Component);return _createClass(ViewContent,[{key:"componentDidMount",value:/**
|
|
10
21
|
* Restore the scroll position of the page.
|
|
11
|
-
*/
|
|
22
|
+
*/function componentDidMount(){var scrollTop=this.context.state.scrollTop;if(this.ref.current===window){window.scrollTo(0,scrollTop||0);}else{this.ref.current.scrollTop=scrollTop;}}/**
|
|
12
23
|
* Removes the keyboardWillChange listener.
|
|
13
24
|
*/},{key:"componentWillUnmount",value:function componentWillUnmount(){var scrollTop;if(this.ref.current===window){scrollTop=window.scrollY;}else{scrollTop=this.ref.current.scrollTop;}router.update(this.context.id,{scrollTop:scrollTop},false);event.removeCallback(EVENT_KEYBOARD_WILL_CHANGE,this.handleKeyboardChange);}/**
|
|
14
25
|
* @returns {Object}
|
|
15
|
-
*/},{key:"render"
|
|
26
|
+
*/},{key:"style",get:function get(){var noScrollOnKeyboard=this.props.noScrollOnKeyboard;var keyboardHeight=this.state.keyboardHeight;var overflow='inherit';if(this.scrollContainer){overflow=noScrollOnKeyboard&&keyboardHeight>0?'hidden':'auto';}return{overflow:overflow,paddingBottom:"calc(var(--tabbar-height) + ".concat(keyboardHeight,"px)")};}},{key:"render",value:/**
|
|
16
27
|
* @return {JSX}
|
|
17
|
-
*/
|
|
18
|
-
* Handles a keyboard change event.
|
|
19
|
-
* @param {boolean} open If the keyboard is now open.
|
|
20
|
-
* @param {boolean} overlap The height of the keyboard.
|
|
21
|
-
*/}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(props,state){if(props.visible||state.keyboardHeight===0){return null;}return{keyboardHeight:0};}}]);return ViewContent;}(Component);_defineProperty(ViewContent,"contextType",RouteContext);_defineProperty(ViewContent,"defaultProps",{children:null,noScrollOnKeyboard:false,noContentPortal:false,noKeyboardListener:false});export default(function(props){return React.createElement(RouteContext.Consumer,null,function(_ref2){var visible=_ref2.visible;return React.createElement(ViewContent,_extends({},props,{visible:visible}));});});
|
|
28
|
+
*/function render(){return React.createElement(Swipeable,{onSwiped:this.handleSwipe,flickThreshold:0.6,delta:10},React.createElement("article",{className:"".concat(styles," engage__view__content ").concat(this.props.className),ref:this.scrollContainer?this.ref:null,style:this.style},React.createElement(Helmet,{title:appConfig.shopName}),React.createElement(Above,null),React.createElement(ResponsiveContainer,{breakpoint:">xs",webOnly:true},this.props.visible?React.createElement("div",{id:"PageHeaderBelow"}):null),React.createElement(ConditionalWrapper,{condition:!this.props.noContentPortal,wrapper:function wrapper(children){return React.createElement(SurroundPortals,{portalName:VIEW_CONTENT},children);}},this.props.children),React.createElement(Below,null)));}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(props,state){if(props.visible||state.keyboardHeight===0){return null;}return{keyboardHeight:0};}}]);}(Component);_defineProperty(ViewContent,"contextType",RouteContext);_defineProperty(ViewContent,"defaultProps",{className:'',children:null,noScrollOnKeyboard:false,noContentPortal:false,noKeyboardListener:false});export default(function(props){return React.createElement(RouteContext.Consumer,null,function(_ref2){var visible=_ref2.visible,_ref2$pattern=_ref2.pattern,pattern=_ref2$pattern===void 0?'':_ref2$pattern,_ref2$is=_ref2.is404,is404=_ref2$is===void 0?false:_ref2$is;return React.createElement(ViewContent,_extends({},props,{visible:visible,className:"route_".concat(is404?'404':pattern.replace(/[:/]/g,'_'))}));});});
|
package/components/View/index.js
CHANGED
|
@@ -3,7 +3,7 @@ export{ViewContext};/**
|
|
|
3
3
|
* The View container component.
|
|
4
4
|
* @param {Object} props The component props.
|
|
5
5
|
* @return {JSX}
|
|
6
|
-
*/function ViewContainer(_ref){var background=_ref.background,children=_ref.children,noScrollOnKeyboard=_ref.noScrollOnKeyboard,visible=_ref.visible,ariaHidden=_ref['aria-hidden'],noContentPortal=_ref.noContentPortal,noKeyboardListener=_ref.noKeyboardListener;if(visible){setPageBackgroundColor(background);}var style={display:visible?'flex':'none'};return React.createElement(ViewProvider,null,React.createElement(ViewContext.Consumer,null,function(_ref2){var setContentRef=_ref2.setContentRef,ariaHiddenContext=_ref2.ariaHidden;return React.createElement("section",{className:styles,style:style,"aria-hidden":ariaHidden||ariaHiddenContext},React.createElement(Content,{noScrollOnKeyboard:noScrollOnKeyboard,noKeyboardListener:noKeyboardListener,setContentRef:setContentRef,noContentPortal:noContentPortal},children));}));}ViewContainer.defaultProps={'aria-hidden':false,background:colors.light,children:null,noScrollOnKeyboard:false,noContentPortal:false,noKeyboardListener:false};/**
|
|
6
|
+
*/function ViewContainer(_ref){var background=_ref.background,children=_ref.children,noScrollOnKeyboard=_ref.noScrollOnKeyboard,visible=_ref.visible,ariaHidden=_ref['aria-hidden'],noContentPortal=_ref.noContentPortal,noKeyboardListener=_ref.noKeyboardListener;if(visible){setPageBackgroundColor(background);}var style={display:visible?'flex':'none'};return React.createElement(ViewProvider,null,React.createElement(ViewContext.Consumer,null,function(_ref2){var setContentRef=_ref2.setContentRef,ariaHiddenContext=_ref2.ariaHidden;return React.createElement("section",{className:"".concat(styles," engage__view"),style:style,"aria-hidden":ariaHidden||ariaHiddenContext},React.createElement(Content,{noScrollOnKeyboard:noScrollOnKeyboard,noKeyboardListener:noKeyboardListener,setContentRef:setContentRef,noContentPortal:noContentPortal},children));}));}ViewContainer.defaultProps={'aria-hidden':false,background:colors.light,children:null,noScrollOnKeyboard:false,noContentPortal:false,noKeyboardListener:false};/**
|
|
7
7
|
* @param {Object} props The component props.
|
|
8
8
|
* @returns {JSX}
|
|
9
9
|
*/export default function View(props){return React.createElement(RouteContext.Consumer,null,function(_ref3){var visible=_ref3.visible;return React.createElement(ViewContainer,_extends({},props,{visible:visible}));});}
|
|
@@ -1,8 +1,25 @@
|
|
|
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 _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 _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 _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 _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 delay from'lodash/delay';import UIEvents from'@shopgate/pwa-core/emitters/ui';import{emitScrollEvents}from'@shopgate/pwa-common/streams/view';import{MODAL_EVENTS}from'@shopgate/pwa-common/components/ModalContainer';import{ViewContext}from"./context";/**
|
|
2
2
|
* The ViewProvider component.
|
|
3
|
-
*/var ViewProvider=/*#__PURE__*/function(_Component){
|
|
4
|
-
|
|
3
|
+
*/var ViewProvider=/*#__PURE__*/function(_Component){function ViewProvider(props){var _this2;_classCallCheck(this,ViewProvider);_this2=_callSuper(this,ViewProvider,[props]);_defineProperty(_this2,"handleModalShow",function(){_this2.activeElement=document.activeElement;_this2.setAriaHidden(true);});_defineProperty(_this2,"handleModalHide",function(){if(_this2.activeElement&&_this2.activeElement.focus){_this2.activeElement.focus();}_this2.setAriaHidden(false);});/**
|
|
4
|
+
* @param {number} value The new top value;
|
|
5
|
+
*/_defineProperty(_this2,"setTop",function(value){_this2.set('top',value);});/**
|
|
6
|
+
* @param {number} value The new bottom value;
|
|
7
|
+
*/_defineProperty(_this2,"setBottom",function(value){_this2.set('bottom',value);});/**
|
|
8
|
+
* @param {boolean} value The new aria hidden value;
|
|
9
|
+
*/_defineProperty(_this2,"setAriaHidden",function(value){_this2.set('ariaHidden',value);});/**
|
|
10
|
+
* @param {Object} ref A React reference to the page content wrapper.
|
|
11
|
+
*/_defineProperty(_this2,"setContentRef",function(ref){_this2.set('contentRef',ref);// Delay to dispatch actual DOM node - implemented with CCP-2358
|
|
12
|
+
delay(function(){return emitScrollEvents(ref.current);},250);});/**
|
|
13
|
+
* @return {Object}
|
|
14
|
+
*/_defineProperty(_this2,"getContentRef",function(){return _this2.state.contentRef;});/**
|
|
15
|
+
* Scrolls the content ref to the top.
|
|
16
|
+
* @param {number} [value=0] A number indicating the new scroll position of the content ref.
|
|
17
|
+
*/_defineProperty(_this2,"scrollTop",function(){var value=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var current=_this2.state.contentRef.current;if(current){current.scrollTop=value;}});/**
|
|
18
|
+
* @param {string} property The state property to set.
|
|
19
|
+
* @param {*} value The value to set.
|
|
20
|
+
*/_defineProperty(_this2,"set",function(property,value){if(_this2.state[property]!==value){_this2.setState(_defineProperty({},property,value));}});_this2.state={top:0,bottom:0,contentRef:{current:null},ariaHidden:false};// Last view active element
|
|
21
|
+
_this2.activeElement=null;return _this2;}/** @inheritDoc */_inherits(ViewProvider,_Component);return _createClass(ViewProvider,[{key:"componentDidMount",value:function componentDidMount(){UIEvents.addListener(MODAL_EVENTS.SHOW,this.handleModalShow);UIEvents.addListener(MODAL_EVENTS.HIDE,this.handleModalHide);}/** @inheritDoc */},{key:"componentWillUnmount",value:function componentWillUnmount(){UIEvents.removeListener(MODAL_EVENTS.SHOW,this.handleModalShow);UIEvents.removeListener(MODAL_EVENTS.HIDE,this.handleModalHide);}/**
|
|
5
22
|
* @returns {Object}
|
|
6
|
-
*/},{key:"render"
|
|
23
|
+
*/},{key:"providerContext",get:function get(){return _extends({},this.state,{set:this.set,setTop:this.setTop,setBottom:this.setBottom,setAriaHidden:this.setAriaHidden,setContentRef:this.setContentRef,getContentRef:this.getContentRef,scrollTop:this.scrollTop});}},{key:"render",value:/**
|
|
7
24
|
* @returns {JSX}
|
|
8
|
-
*/
|
|
25
|
+
*/function render(){return React.createElement(ViewContext.Provider,{value:this.providerContext},this.props.children);}}]);}(Component);export default ViewProvider;
|
package/components/index.js
CHANGED
|
@@ -8,5 +8,5 @@ export{default as Accordion}from'@shopgate/pwa-ui-material/Accordion';export{def
|
|
|
8
8
|
export{default as AccordionContainer}from'@shopgate/pwa-ui-shared/AccordionContainer';export{default as ActionButton}from'@shopgate/pwa-ui-shared/ActionButton';export{default as AddToCartButton}from'@shopgate/pwa-ui-shared/AddToCartButton';export{default as Availability}from'@shopgate/pwa-ui-shared/Availability';export{default as Button}from'@shopgate/pwa-ui-shared/Button';export{default as ButtonLink}from'@shopgate/pwa-ui-shared/ButtonLink';export{default as Card}from'@shopgate/pwa-ui-shared/Card';export{default as CardList}from'@shopgate/pwa-ui-shared/CardList';export{default as CartTotalLine}from'@shopgate/pwa-ui-shared/CartTotalLine';export{default as Chip}from'@shopgate/pwa-ui-shared/Chip';export{default as ClientInformation}from'@shopgate/pwa-ui-shared/ClientInformation';export{default as ContextMenu}from'@shopgate/pwa-ui-shared/ContextMenu';export{default as Dialog}from'@shopgate/pwa-ui-shared/Dialog';export{default as DiscountBadge}from'@shopgate/pwa-ui-shared/DiscountBadge';export{default as FavoritesButton}from'@shopgate/pwa-ui-shared/FavoritesButton';export{default as Checkbox}from'@shopgate/pwa-ui-shared/Form/Checkbox';export{default as Password}from'@shopgate/pwa-ui-shared/Form/Password';export{default as RadioGroup}from'@shopgate/pwa-ui-shared/Form/RadioGroup';export{default as RadioGroupItem}from'@shopgate/pwa-ui-shared/Form/RadioGroup/components/Item';export{default as Select}from'@shopgate/pwa-ui-shared/Form/Select';export{default as TextField}from'@shopgate/pwa-ui-shared/Form/TextField';export{default as FormElement}from'@shopgate/pwa-ui-shared/FormElement';export{default as Glow}from'@shopgate/pwa-ui-shared/Glow';export{default as IndicatorCircle}from'@shopgate/pwa-ui-shared/IndicatorCircle';export{default as LoadingIndicator}from'@shopgate/pwa-ui-shared/LoadingIndicator';export{default as Manufacturer}from'@shopgate/pwa-ui-shared/Manufacturer';export{default as NoResults}from'@shopgate/pwa-ui-shared/NoResults';export{default as Placeholder}from'@shopgate/pwa-ui-shared/Placeholder';export{default as PlaceholderLabel}from'@shopgate/pwa-ui-shared/PlaceholderLabel';export{default as PlaceholderParagraph}from'@shopgate/pwa-ui-shared/PlaceholderParagraph';export{default as Price}from'@shopgate/pwa-ui-shared/Price';export{default as PriceInfo}from'@shopgate/pwa-ui-shared/PriceInfo';export{default as PriceStriked}from'@shopgate/pwa-ui-shared/PriceStriked';export{default as ProductProperties}from'@shopgate/pwa-ui-shared/ProductProperties';export{default as ProgressBar}from'@shopgate/pwa-ui-shared/ProgressBar';export{default as RadioButton}from'@shopgate/pwa-ui-shared/RadioButton';export{default as RatingNumber}from'@shopgate/pwa-ui-shared/RatingNumber';export{default as RatingStars}from'@shopgate/pwa-ui-shared/RatingStars';export{default as Ripple}from'@shopgate/pwa-ui-shared/Ripple';export{default as RippleButton}from'@shopgate/pwa-ui-shared/RippleButton';export{default as ScannerOverlay}from'@shopgate/pwa-ui-shared/ScannerOverlay';export{default as Sheet,SHEET_EVENTS}from'@shopgate/pwa-ui-shared/Sheet';export{default as TaxDisclaimer}from'@shopgate/pwa-ui-shared/TaxDisclaimer';export{default as ToggleIcon}from'@shopgate/pwa-ui-shared/ToggleIcon';// ICONS IOS
|
|
9
9
|
export{default as CartIconIOS}from'@shopgate/pwa-ui-ios/icons/CartIcon';export{default as FilterIconIOS}from'@shopgate/pwa-ui-ios/icons/FilterIcon';export{default as HomeIconIOS}from'@shopgate/pwa-ui-ios/icons/HomeIcon';export{default as ShareIconIOS}from'@shopgate/pwa-ui-ios/icons/ShareIcon';// ICONS ANDROID
|
|
10
10
|
export{default as ShareIconAndroid}from'@shopgate/pwa-ui-material/icons/ShareIcon';// ICONS SHARED
|
|
11
|
-
export{default as AccountBoxIcon}from'@shopgate/pwa-ui-shared/icons/AccountBoxIcon';export{default as AddMoreIcon}from'@shopgate/pwa-ui-shared/icons/AddMoreIcon';export{default as ArrowDropIcon}from'@shopgate/pwa-ui-shared/icons/ArrowDropIcon';export{default as ArrowIcon}from'@shopgate/pwa-ui-shared/icons/ArrowIcon';export{default as BarcodeScannerIcon}from'@shopgate/pwa-ui-shared/icons/BarcodeScannerIcon';export{default as BoxIcon}from'@shopgate/pwa-ui-shared/icons/BoxIcon';export{default as BrowseIcon}from'@shopgate/pwa-ui-shared/icons/BrowseIcon';export{default as BurgerIcon}from'@shopgate/pwa-ui-shared/icons/BurgerIcon';export{default as CartIcon}from'@shopgate/pwa-ui-shared/icons/CartIcon';export{default as CartPlusIcon}from'@shopgate/pwa-ui-shared/icons/CartPlusIcon';export{default as CheckedIcon}from'@shopgate/pwa-ui-shared/icons/CheckedIcon';export{default as CheckIcon}from'@shopgate/pwa-ui-shared/icons/CheckIcon';export{default as ChevronIcon}from'@shopgate/pwa-ui-shared/icons/ChevronIcon';export{default as CreditCardIcon}from'@shopgate/pwa-ui-shared/icons/CreditCardIcon';export{default as CrossIcon}from'@shopgate/pwa-ui-shared/icons/CrossIcon';export{default as DescriptionIcon}from'@shopgate/pwa-ui-shared/icons/DescriptionIcon';export{default as FilterIcon}from'@shopgate/pwa-ui-shared/icons/FilterIcon';export{default as FlashEnabledIcon}from'@shopgate/pwa-ui-shared/icons/FlashEnabledIcon';export{default as FlashDisabledIcon}from'@shopgate/pwa-ui-shared/icons/FlashDisabledIcon';export{default as GridIcon}from'@shopgate/pwa-ui-shared/icons/GridIcon';export{default as HeartIcon}from'@shopgate/pwa-ui-shared/icons/HeartIcon';export{default as HeartOutlineIcon}from'@shopgate/pwa-ui-shared/icons/HeartOutlineIcon';export{default as HeartPlusIcon}from'@shopgate/pwa-ui-shared/icons/HeartPlusIcon';export{default as HeartPlusOutlineIcon}from'@shopgate/pwa-ui-shared/icons/HeartPlusOutlineIcon';export{default as HomeIcon}from'@shopgate/pwa-ui-shared/icons/HomeIcon';export{default as InfoIcon}from'@shopgate/pwa-ui-shared/icons/InfoIcon';export{default as InfoOutlineIcon}from'@shopgate/pwa-ui-shared/icons/InfoOutlineIcon';export{default as ListIcon}from'@shopgate/pwa-ui-shared/icons/ListIcon';export{default as LocatorIcon}from'@shopgate/pwa-ui-shared/icons/LocatorIcon';export{default as LocalShippingIcon}from'@shopgate/pwa-ui-shared/icons/LocalShippingIcon';export{default as LocationIcon}from'@shopgate/pwa-ui-shared/icons/LocationIcon';export{default as LockIcon}from'@shopgate/pwa-ui-shared/icons/LockIcon';export{default as LogoutIcon}from'@shopgate/pwa-ui-shared/icons/LogoutIcon';export{default as MagnifierIcon}from'@shopgate/pwa-ui-shared/icons/MagnifierIcon';export{default as MoreIcon}from'@shopgate/pwa-ui-shared/icons/MoreIcon';export{default as MoreVertIcon}from'@shopgate/pwa-ui-shared/icons/MoreVertIcon';export{default as PhoneIcon}from'@shopgate/pwa-ui-shared/icons/PhoneIcon';export{default as PlaceholderIcon}from'@shopgate/pwa-ui-shared/icons/PlaceholderIcon';export{default as RadioCheckedIcon}from'@shopgate/pwa-ui-shared/icons/RadioCheckedIcon';export{default as RadioUncheckedIcon}from'@shopgate/pwa-ui-shared/icons/RadioUncheckedIcon';export{default as SecurityIcon}from'@shopgate/pwa-ui-shared/icons/SecurityIcon';export{default as ShoppingCartIcon}from'@shopgate/pwa-ui-shared/icons/ShoppingCartIcon';export{default as SortIcon}from'@shopgate/pwa-ui-shared/icons/SortIcon';export{default as StarHalfIcon}from'@shopgate/pwa-ui-shared/icons/StarHalfIcon';export{default as StarIcon}from'@shopgate/pwa-ui-shared/icons/StarIcon';export{default as StarOutlineIcon}from'@shopgate/pwa-ui-shared/icons/StarOutlineIcon';export{default as TickIcon}from'@shopgate/pwa-ui-shared/icons/TickIcon';export{default as TrashIcon}from'@shopgate/pwa-ui-shared/icons/TrashIcon';export{default as TrashOutlineIcon}from'@shopgate/pwa-ui-shared/icons/TrashOutlineIcon';export{default as UncheckedIcon}from'@shopgate/pwa-ui-shared/icons/UncheckedIcon';export{default as ViewListIcon}from'@shopgate/pwa-ui-shared/icons/ViewListIcon';export{default as VisibilityIcon}from'@shopgate/pwa-ui-shared/icons/VisibilityIcon';export{default as VisibilityOffIcon}from'@shopgate/pwa-ui-shared/icons/VisibilityOffIcon';export{default as TimeIcon}from'@shopgate/pwa-ui-shared/icons/TimeIcon';// LOCAL
|
|
12
|
-
export{MessageBar}from"./MessageBar";export{default as NavigationHandler}from"./NavigationHandler";export{default as TimeBoundary}from"./TimeBoundary";export{default as IntersectionVisibility}from"./IntersectionVisibility";export{default as VideoPlayer}from"./VideoPlayer";export{default as SheetDrawer}from"./SheetDrawer";export{default as SheetList}from"./SheetList";export{default as NullComponent}from"./NullComponent";export{default as View,ViewContext}from"./View";export{default as QuantityInput}from"./QuantityInput";export{default as QuantityLabel}from"./QuantityLabel";export{default as ResponsiveContainer}from"./ResponsiveContainer";export{default as BrandingColorBanner}from"./BrandingColorBanner";export{default as ScrollHeader}from"./ScrollHeader";export{default as Menu}from"./Menu";export{default as Toggle}from"./Toggle";export{Form}from"./Form";export{FormBuilder}from"./Form";export{Footer}from"./Footer";export{SideNavigation}from"./SideNavigation";export{default as TextLink}from"./TextLink/TextLink";export{ConditionalWrapper}from"./ConditionalWrapper";export{default as RadioGroupV2,useRadioGroup}from"./RadioGroup";export{default as RadioV2}from"./Radio";export{default as RadioCard}from"./RadioCard";
|
|
11
|
+
export{default as AccountBoxIcon}from'@shopgate/pwa-ui-shared/icons/AccountBoxIcon';export{default as AddMoreIcon}from'@shopgate/pwa-ui-shared/icons/AddMoreIcon';export{default as ArrowDropIcon}from'@shopgate/pwa-ui-shared/icons/ArrowDropIcon';export{default as ArrowIcon}from'@shopgate/pwa-ui-shared/icons/ArrowIcon';export{default as BarcodeScannerIcon}from'@shopgate/pwa-ui-shared/icons/BarcodeScannerIcon';export{default as BoxIcon}from'@shopgate/pwa-ui-shared/icons/BoxIcon';export{default as BrowseIcon}from'@shopgate/pwa-ui-shared/icons/BrowseIcon';export{default as BurgerIcon}from'@shopgate/pwa-ui-shared/icons/BurgerIcon';export{default as CartIcon}from'@shopgate/pwa-ui-shared/icons/CartIcon';export{default as CartPlusIcon}from'@shopgate/pwa-ui-shared/icons/CartPlusIcon';export{default as CartCouponIcon}from'@shopgate/pwa-ui-shared/icons/CartCouponIcon';export{default as CheckedIcon}from'@shopgate/pwa-ui-shared/icons/CheckedIcon';export{default as CheckIcon}from'@shopgate/pwa-ui-shared/icons/CheckIcon';export{default as ChevronIcon}from'@shopgate/pwa-ui-shared/icons/ChevronIcon';export{default as CreditCardIcon}from'@shopgate/pwa-ui-shared/icons/CreditCardIcon';export{default as CrossIcon}from'@shopgate/pwa-ui-shared/icons/CrossIcon';export{default as DescriptionIcon}from'@shopgate/pwa-ui-shared/icons/DescriptionIcon';export{default as FilterIcon}from'@shopgate/pwa-ui-shared/icons/FilterIcon';export{default as FlashEnabledIcon}from'@shopgate/pwa-ui-shared/icons/FlashEnabledIcon';export{default as FlashDisabledIcon}from'@shopgate/pwa-ui-shared/icons/FlashDisabledIcon';export{default as GridIcon}from'@shopgate/pwa-ui-shared/icons/GridIcon';export{default as HeartIcon}from'@shopgate/pwa-ui-shared/icons/HeartIcon';export{default as HeartOutlineIcon}from'@shopgate/pwa-ui-shared/icons/HeartOutlineIcon';export{default as HeartPlusIcon}from'@shopgate/pwa-ui-shared/icons/HeartPlusIcon';export{default as HeartPlusOutlineIcon}from'@shopgate/pwa-ui-shared/icons/HeartPlusOutlineIcon';export{default as HomeIcon}from'@shopgate/pwa-ui-shared/icons/HomeIcon';export{default as InfoIcon}from'@shopgate/pwa-ui-shared/icons/InfoIcon';export{default as InfoOutlineIcon}from'@shopgate/pwa-ui-shared/icons/InfoOutlineIcon';export{default as ListIcon}from'@shopgate/pwa-ui-shared/icons/ListIcon';export{default as LocatorIcon}from'@shopgate/pwa-ui-shared/icons/LocatorIcon';export{default as LocalShippingIcon}from'@shopgate/pwa-ui-shared/icons/LocalShippingIcon';export{default as LocationIcon}from'@shopgate/pwa-ui-shared/icons/LocationIcon';export{default as LockIcon}from'@shopgate/pwa-ui-shared/icons/LockIcon';export{default as LogoutIcon}from'@shopgate/pwa-ui-shared/icons/LogoutIcon';export{default as MagnifierIcon}from'@shopgate/pwa-ui-shared/icons/MagnifierIcon';export{default as MoreIcon}from'@shopgate/pwa-ui-shared/icons/MoreIcon';export{default as MoreVertIcon}from'@shopgate/pwa-ui-shared/icons/MoreVertIcon';export{default as PhoneIcon}from'@shopgate/pwa-ui-shared/icons/PhoneIcon';export{default as PlaceholderIcon}from'@shopgate/pwa-ui-shared/icons/PlaceholderIcon';export{default as RadioCheckedIcon}from'@shopgate/pwa-ui-shared/icons/RadioCheckedIcon';export{default as RadioUncheckedIcon}from'@shopgate/pwa-ui-shared/icons/RadioUncheckedIcon';export{default as SecurityIcon}from'@shopgate/pwa-ui-shared/icons/SecurityIcon';export{default as ShoppingCartIcon}from'@shopgate/pwa-ui-shared/icons/ShoppingCartIcon';export{default as SortIcon}from'@shopgate/pwa-ui-shared/icons/SortIcon';export{default as StarHalfIcon}from'@shopgate/pwa-ui-shared/icons/StarHalfIcon';export{default as StarIcon}from'@shopgate/pwa-ui-shared/icons/StarIcon';export{default as StarOutlineIcon}from'@shopgate/pwa-ui-shared/icons/StarOutlineIcon';export{default as TickIcon}from'@shopgate/pwa-ui-shared/icons/TickIcon';export{default as TrashIcon}from'@shopgate/pwa-ui-shared/icons/TrashIcon';export{default as TrashOutlineIcon}from'@shopgate/pwa-ui-shared/icons/TrashOutlineIcon';export{default as UncheckedIcon}from'@shopgate/pwa-ui-shared/icons/UncheckedIcon';export{default as ViewListIcon}from'@shopgate/pwa-ui-shared/icons/ViewListIcon';export{default as VisibilityIcon}from'@shopgate/pwa-ui-shared/icons/VisibilityIcon';export{default as VisibilityOffIcon}from'@shopgate/pwa-ui-shared/icons/VisibilityOffIcon';export{default as TimeIcon}from'@shopgate/pwa-ui-shared/icons/TimeIcon';export{default as NotificationIcon}from'@shopgate/pwa-ui-shared/icons/NotificationIcon';// LOCAL
|
|
12
|
+
export{MessageBar}from"./MessageBar";export{default as NavigationHandler}from"./NavigationHandler";export{default as TimeBoundary}from"./TimeBoundary";export{default as IntersectionVisibility}from"./IntersectionVisibility";export{default as VideoPlayer}from"./VideoPlayer";export{default as SheetDrawer}from"./SheetDrawer";export{default as SheetList}from"./SheetList";export{default as NullComponent}from"./NullComponent";export{default as View,ViewContext}from"./View";export{default as QuantityInput}from"./QuantityInput";export{default as QuantityLabel}from"./QuantityLabel";export{default as ResponsiveContainer}from"./ResponsiveContainer";export{default as BrandingColorBanner}from"./BrandingColorBanner";export{default as ScrollHeader}from"./ScrollHeader";export{default as Menu}from"./Menu";export{default as Toggle}from"./Toggle";export{Form}from"./Form";export{FormBuilder}from"./Form";export{Footer}from"./Footer";export{SideNavigation}from"./SideNavigation";export{default as TextLink}from"./TextLink/TextLink";export{ConditionalWrapper}from"./ConditionalWrapper";export{default as RadioGroupV2,useRadioGroup}from"./RadioGroup";export{default as RadioV2}from"./Radio";export{default as RadioCard}from"./RadioCard";export{default as ChipLayout}from"./ChipLayout";export{default as Logo}from"./Logo";export{default as PickerUtilize}from"./PickerUtilize";export{default as Switch}from"./Switch";export{default as SnackBarContainer}from"./SnackBarContainer";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{RELOAD_APP}from"../constants";/**
|
|
2
|
+
* Creates the RELOAD_APP Redux action object that's supposed to be dispatched
|
|
3
|
+
* when the app is supposed to be reloaded.
|
|
4
|
+
* @returns {Object} The Redux action object
|
|
5
|
+
*/export var reloadApp=function reloadApp(){return{type:RELOAD_APP};};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{APP_PERMISSION_STATUS_RECEIVED}from"../constants/actionTypes";/**
|
|
2
|
+
* Creates the APP_PERMISSION_STATUS_RECEIVED Redux action object that's supposed to be dispatched
|
|
3
|
+
* when a permission status was requested from the app.
|
|
4
|
+
* @param {Object} params Action params
|
|
5
|
+
* @param {string} params.permissionId The updated permission id
|
|
6
|
+
* @param {string} params.status The new status
|
|
7
|
+
* @param {Object} [params.options={}] Extended options for the permission
|
|
8
|
+
* @returns {Object} The Redux action object
|
|
9
|
+
*/export var appPermissionStatusReceived=function appPermissionStatusReceived(_ref){var permissionId=_ref.permissionId,status=_ref.status,_ref$options=_ref.options,options=_ref$options===void 0?{}:_ref$options;return{type:APP_PERMISSION_STATUS_RECEIVED,permissionId:permissionId,status:status,options:options};};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{receiveShopSettings,errorShopSettings}from"./shopSettings";export{receiveMerchantSettings}from"./merchantSettings";
|
|
1
|
+
export{receiveShopSettings,errorShopSettings}from"./shopSettings";export{receiveMerchantSettings}from"./merchantSettings";export*from"./app";export*from"./appPermissions";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _regeneratorRuntime from"@babel/runtime/regenerator";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 _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{hasSGJavaScriptBridge}from'@shopgate/
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";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 _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{hasWebBridge,hasSGJavaScriptBridge}from'@shopgate/engage/core/helpers';import{GEOLOCATION_ERROR_DENIED}from'@shopgate/engage/core/constants';import grantGeolocationPermissions from"./grantGeolocationPermissions";import GeolocationRequest from"../classes/GeolocationRequest";/**
|
|
2
2
|
* Determines the geolocation of the user. When not geolocation permissions are granted yet,
|
|
3
3
|
* the user will be prompted to grant access.
|
|
4
4
|
* @param {Object} options Action options.
|
|
@@ -11,4 +11,4 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function _typeof(obj
|
|
|
11
11
|
* @param {string} options.modal.dismiss Label for the dismiss button.
|
|
12
12
|
* @param {Object} options.modal.params Additional parameters for i18n strings.
|
|
13
13
|
* @return { Function } A redux thunk.
|
|
14
|
-
*/var getGeolocation=function getGeolocation(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var granted,error;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
14
|
+
*/var getGeolocation=function getGeolocation(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var granted,error;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return dispatch(grantGeolocationPermissions(_extends({resolveWithData:true},options)));case 2:granted=_context.sent;if(!(_typeof(granted)==='object')){_context.next=5;break;}return _context.abrupt("return",Promise.resolve(granted));case 5:if(granted){_context.next=9;break;}error=new Error('Geolocation permissions not granted.');error.code=GEOLOCATION_ERROR_DENIED;throw error;case 9:return _context.abrupt("return",new GeolocationRequest(!hasSGJavaScriptBridge()||hasWebBridge()).dispatch());case 10:case"end":return _context.stop();}},_callee);}));return function(_x){return _ref.apply(this,arguments);};}());};export default getGeolocation;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{PERMISSION_ID_APP_TRACKING_TRANSPARENCY}from'@shopgate/engage/core/constants';import grantPermissions from"./grantPermissions";/**
|
|
2
|
+
* Determines the current state of the app tracking transparency permission.
|
|
3
|
+
* If not already happened, the user will be prompted to grant permissions.
|
|
4
|
+
* The action returns a promise which resolves with a boolean value, that indicates the state.
|
|
5
|
+
* @return { Function } A redux thunk.
|
|
6
|
+
*/var grantAppTrackingTransparencyPermission=function grantAppTrackingTransparencyPermission(){return function(dispatch){return dispatch(grantPermissions({permissionId:PERMISSION_ID_APP_TRACKING_TRANSPARENCY}));};};export default grantAppTrackingTransparencyPermission;
|
|
@@ -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{PERMISSION_ID_CAMERA}from'@shopgate/
|
|
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{PERMISSION_ID_CAMERA}from'@shopgate/engage/core/constants';import grantPermissions from"./grantPermissions";/**
|
|
2
2
|
* Determines the current state of the camera permissions.
|
|
3
3
|
* If not already happened, the user will be prompted to grant permissions.
|
|
4
4
|
* The action returns a promise which resolves with a boolean value, that indicates the state.
|
|
@@ -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{PERMISSION_ID_LOCATION}from'@shopgate/
|
|
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{PERMISSION_ID_LOCATION}from'@shopgate/engage/core/constants';import{hasWebBridge}from'@shopgate/engage/core';import grantPermissions from"./grantPermissions";/**
|
|
2
2
|
* Determines the current state of the geolocation permissions.
|
|
3
3
|
* If not already happened, the user will be prompted to grant permissions.
|
|
4
4
|
* The action returns a promise which resolves with a boolean value, that indicates the state.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _regeneratorRuntime from"@babel/runtime/regenerator";function
|
|
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 event from'@shopgate/pwa-core/classes/Event';import{openAppSettings}from'@shopgate/engage/core/commands';import{showModal}from'@shopgate/engage/core/actions';import{PERMISSION_STATUS_DENIED,PERMISSION_STATUS_GRANTED,PERMISSION_STATUS_NOT_DETERMINED,PERMISSION_STATUS_NOT_SUPPORTED,APP_EVENT_APPLICATION_WILL_ENTER_FOREGROUND,availablePermissionsIds}from'@shopgate/engage/core/constants';import{logger,hasSGJavaScriptBridge,hasWebBridge}from'@shopgate/engage/core/helpers';import requestAppPermission from"./requestAppPermission";import requestAppPermissionStatus from"./requestAppPermissionStatus";import{createMockedPermissions}from"../helpers/appPermissions";/**
|
|
2
2
|
* Determines the current state of a specific permission for an app feature. If not already
|
|
3
3
|
* happened, the user will be prompted to grant permissions.
|
|
4
4
|
* The action returns a promise which resolves with a boolean value, that indicates the state.
|
|
@@ -6,6 +6,13 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function _slicedToAr
|
|
|
6
6
|
* @param {string} options.permissionId The id of the permission to request.
|
|
7
7
|
* @param {boolean} [options.useSettingsModal=false] Whether in case of declined permissions a modal
|
|
8
8
|
* shall be presented, which redirects to the app settings.
|
|
9
|
+
* @param {boolean} [options.useRationaleModal=false] Whether a rational modal should be shown
|
|
10
|
+
* @param {Object} [options.rationaleModal={}] Options for the rationale modal.
|
|
11
|
+
* @param {string} options.rationaleModal.title Modal title.
|
|
12
|
+
* @param {string} options.rationaleModal.message Modal message.
|
|
13
|
+
* @param {string} options.rationaleModal.confirm Label for the confirm button.
|
|
14
|
+
* @param {string} options.rationaleModal.dismiss Label for the dismiss button.
|
|
15
|
+
* @param {Object} options.rationaleModal.params Additional parameters for i18n strings.
|
|
9
16
|
* @param {Object} [options.modal={}] Options for the settings modal.
|
|
10
17
|
* @param {string} options.modal.title Modal title.
|
|
11
18
|
* @param {string} options.modal.message Modal message.
|
|
@@ -14,18 +21,18 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function _slicedToAr
|
|
|
14
21
|
* @param {Object} options.modal.params Additional parameters for i18n strings.
|
|
15
22
|
* @param {boolean} [options.requestPermissions=true] If set to TRUE no permissions will be
|
|
16
23
|
* requested if not already granted,
|
|
17
|
-
* @param {boolean} [
|
|
24
|
+
* @param {boolean} [options.resolveWithData=false] If set to TRUE the Promise will resolve with
|
|
18
25
|
* data if available (e.g. geolocation).
|
|
19
26
|
* @return { Function } A redux thunk.
|
|
20
|
-
*/var grantPermissions=function grantPermissions(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return function(dispatch){return new Promise(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(resolve){var permissionId,_options$useSettingsM,useSettingsModal,_options$modal,modalOptions,_options$requestPermi,requestPermissions,_options$resolveWithD,resolveWithData,dispatchMock,fallbackStatus,status,data,_ref2,_ref3,
|
|
27
|
+
*/var grantPermissions=function grantPermissions(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return function(dispatch){return new Promise(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(resolve){var permissionId,_options$useSettingsM,useSettingsModal,_options$useRationale,useRationaleModal,_options$rationaleMod,rationaleModalOptions,_options$modal,modalOptions,_options$requestPermi,requestPermissions,_options$resolveWithD,resolveWithData,dispatchMock,fallbackStatus,status,data,_ref2,requestAllowed,_ref3,openSettings,handler;return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:permissionId=options.permissionId,_options$useSettingsM=options.useSettingsModal,useSettingsModal=_options$useSettingsM===void 0?false:_options$useSettingsM,_options$useRationale=options.useRationaleModal,useRationaleModal=_options$useRationale===void 0?false:_options$useRationale,_options$rationaleMod=options.rationaleModal,rationaleModalOptions=_options$rationaleMod===void 0?{}:_options$rationaleMod,_options$modal=options.modal,modalOptions=_options$modal===void 0?{}:_options$modal,_options$requestPermi=options.requestPermissions,requestPermissions=_options$requestPermi===void 0?true:_options$requestPermi,_options$resolveWithD=options.resolveWithData,resolveWithData=_options$resolveWithD===void 0?false:_options$resolveWithD;if(!hasSGJavaScriptBridge()||hasWebBridge()){/**
|
|
21
28
|
* The fallbackStatus will be used at browsers that don't support the permissions API. By
|
|
22
29
|
* default it will always resolve with GRANTED, so that further steps still might trigger a
|
|
23
30
|
* permissions dialog. When permissions are not supposed to be requested, it will resolve with
|
|
24
31
|
* the NOT_DETERMINED status, to keep logic between browsers / apps in sync as much as possible.
|
|
25
|
-
*/fallbackStatus=requestPermissions?
|
|
32
|
+
*/fallbackStatus=requestPermissions?PERMISSION_STATUS_GRANTED:PERMISSION_STATUS_NOT_DETERMINED;dispatchMock=createMockedPermissions(fallbackStatus);}if(availablePermissionsIds.includes(permissionId)){_context2.next=6;break;}logger.error('grandPermissions: %s is no valid permission id',permissionId);resolve(false);return _context2.abrupt("return");case 6:_context2.next=8;return dispatch(requestAppPermissionStatus({permissionId:permissionId,dispatchMock:dispatchMock}));case 8:_ref2=_context2.sent;status=_ref2.status;if(!(status===PERMISSION_STATUS_NOT_SUPPORTED)){_context2.next=13;break;}resolve(false);return _context2.abrupt("return");case 13:if(!(status===PERMISSION_STATUS_NOT_DETERMINED)){_context2.next=32;break;}if(requestPermissions){_context2.next=17;break;}resolve(false);return _context2.abrupt("return");case 17:if(!useRationaleModal){_context2.next=24;break;}_context2.next=20;return dispatch(showModal({message:rationaleModalOptions.message||'',confirm:rationaleModalOptions.confirm||'',dismiss:rationaleModalOptions.dismiss||'',params:rationaleModalOptions.params}));case 20:requestAllowed=_context2.sent;if(!(requestAllowed===false)){_context2.next=24;break;}resolve(false);return _context2.abrupt("return");case 24:_context2.next=26;return dispatch(requestAppPermission({permissionId:permissionId,dispatchMock:dispatchMock}));case 26:_ref3=_context2.sent;status=_ref3.status;data=_ref3.data;if(![PERMISSION_STATUS_DENIED,PERMISSION_STATUS_NOT_DETERMINED].includes(status)){_context2.next=32;break;}resolve(false);return _context2.abrupt("return");case 32:if(!(status===PERMISSION_STATUS_GRANTED)){_context2.next=35;break;}resolve(resolveWithData&&data?data:true);return _context2.abrupt("return");case 35:if(!(status===PERMISSION_STATUS_DENIED)){_context2.next=48;break;}if(useSettingsModal){_context2.next=39;break;}resolve(false);return _context2.abrupt("return");case 39:_context2.next=41;return dispatch(showModal({title:modalOptions.title||null,message:modalOptions.message,confirm:modalOptions.confirm,dismiss:modalOptions.dismiss,params:modalOptions.params}));case 41:openSettings=_context2.sent;if(openSettings){_context2.next=45;break;}resolve(false);return _context2.abrupt("return");case 45:/**
|
|
26
33
|
* Handler for the app event.
|
|
27
|
-
*/handler=/*#__PURE__*/function(){var
|
|
34
|
+
*/handler=/*#__PURE__*/function(){var _ref4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){var _ref5;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:event.removeCallback(APP_EVENT_APPLICATION_WILL_ENTER_FOREGROUND,handler);_context.next=3;return dispatch(requestAppPermissionStatus({permissionId:permissionId}));case 3:_ref5=_context.sent;status=_ref5.status;resolve(status===PERMISSION_STATUS_GRANTED);case 6:case"end":return _context.stop();}},_callee);}));return function handler(){return _ref4.apply(this,arguments);};}();/**
|
|
28
35
|
* Register an event handler, so that we can perform the permissions check again,
|
|
29
36
|
* when the user comes back from the settings.
|
|
30
37
|
*/event.addCallback(APP_EVENT_APPLICATION_WILL_ENTER_FOREGROUND,handler);// Open the settings (protected by a timeout, so that the modal closes before the app is left).
|
|
31
|
-
setTimeout(function(){openAppSettings();},0);case
|
|
38
|
+
setTimeout(function(){openAppSettings();},0);case 48:case"end":return _context2.stop();}},_callee2);}));return function(_x){return _ref.apply(this,arguments);};}());};};export default grantPermissions;
|
|
@@ -0,0 +1,22 @@
|
|
|
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{PERMISSION_ID_PUSH}from'@shopgate/engage/core/constants';import grantPermissions from"./grantPermissions";/**
|
|
2
|
+
* Determines the current state of the push permissions.
|
|
3
|
+
* If not already happened, the user will be prompted to grant permissions.
|
|
4
|
+
* The action returns a promise which resolves with a boolean value, that indicates the state.
|
|
5
|
+
* @param {Object} options Action options.
|
|
6
|
+
* @param {boolean} [options.useSettingsModal=true] Whether in case of declined permissions a modal
|
|
7
|
+
* shall be presented, which redirects to the app settings.
|
|
8
|
+
* @param {boolean} [options.useRationaleModal=false] Whether a rational modal should be shown
|
|
9
|
+
* @param {Object} [options.rationaleModal={}] Options for the rationale modal.
|
|
10
|
+
* @param {string} options.rationaleModal.title Modal title.
|
|
11
|
+
* @param {string} options.rationaleModal.message Modal message.
|
|
12
|
+
* @param {string} options.rationaleModal.confirm Label for the confirm button.
|
|
13
|
+
* @param {string} options.rationaleModal.dismiss Label for the dismiss button.
|
|
14
|
+
* @param {Object} options.rationaleModal.params Additional parameters for i18n strings.
|
|
15
|
+
* @param {Object} [options.modal={}] Options for the settings modal.
|
|
16
|
+
* @param {string} options.modal.title Modal title.
|
|
17
|
+
* @param {string} options.modal.message Modal message.
|
|
18
|
+
* @param {string} options.modal.confirm Label for the confirm button.
|
|
19
|
+
* @param {string} options.modal.dismiss Label for the dismiss button.
|
|
20
|
+
* @param {Object} options.modal.params Additional parameters for i18n strings.
|
|
21
|
+
* @return { Function } A redux thunk.
|
|
22
|
+
*/var grantPushPermissions=function grantPushPermissions(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return function(dispatch){var _options$useSettingsM=options.useSettingsModal,useSettingsModal=_options$useSettingsM===void 0?true:_options$useSettingsM,_options$useRationale=options.useRationaleModal,useRationaleModal=_options$useRationale===void 0?false:_options$useRationale,_options$modal=options.modal,modal=_options$modal===void 0?{}:_options$modal,_options$rationaleMod=options.rationaleModal,rationaleModal=_options$rationaleMod===void 0?{}:_options$rationaleMod;return dispatch(grantPermissions({permissionId:PERMISSION_ID_PUSH,useSettingsModal:useSettingsModal,useRationaleModal:useRationaleModal,modal:_extends({title:null,message:'permissions.access_denied.push_message',confirm:'permissions.access_denied.settings_button'},modal),rationaleModal:rationaleModal}));};};export default grantPushPermissions;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export{default as getGeolocation}from"./getGeolocation";export{default as grantAppTrackingTransparencyPermission}from"./grantAppTrackingTransparencyPermission";export{default as grantCameraPermissions}from"./grantCameraPermissions";export{default as grantGeolocationPermissions}from"./grantGeolocationPermissions";export{default as grantPermissions}from"./grantPermissions";export{default as grantPushPermissions}from"./grantPushPermissions";export{default as requestAppPermission}from"./requestAppPermission";export{default as requestAppPermissionStatus}from"./requestAppPermissionStatus";export{default as updateStatusBarBackground}from"./updateStatusBarBackground";// --------------- APP --------------- //
|
|
2
|
+
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';// --------------- CLIENT --------------- //
|
|
3
|
+
export{default as fetchClientInformation}from'@shopgate/pwa-common/actions/client/fetchClientInformation';// --------------- ROUTER --------------- //
|
|
4
|
+
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';// --------------- URL --------------- //
|
|
5
|
+
export{resetApp}from'@shopgate/pwa-common/action-creators/app';export*from'@shopgate/pwa-common/action-creators/url';// --------------- MENU --------------- //
|
|
6
|
+
export{default as fetchMenu}from'@shopgate/pwa-common/actions/menu/fetchMenu';// --------------- MODAL --------------- //
|
|
7
|
+
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';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";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;}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{hasSGJavaScriptBridge,hasWebBridge,createMockedPermissions}from'@shopgate/engage/core/helpers';import{requestAppPermissions}from'@shopgate/pwa-core/commands/appPermissions';import{PERMISSION_STATUS_NOT_SUPPORTED,PERMISSION_STATUS_GRANTED}from'@shopgate/engage/core/constants';import{appPermissionStatusReceived}from"../action-creators";/**
|
|
2
|
+
* Requests an additional app permission from the operating system.
|
|
3
|
+
* Additionally it propagates the received status via the APP_PERMISSION_STATUS_RECEIVED action.
|
|
4
|
+
* @param {Object} params The action params
|
|
5
|
+
* @param {string} params.permissionId The desired app permission id
|
|
6
|
+
* @param {Function} [params.dispatchMock=null] An optional mock for the request dispatch logic.
|
|
7
|
+
* Usually used when PWA is running inside a browser and app command logic can be simulated via
|
|
8
|
+
* browser APIs like for geolocation access.
|
|
9
|
+
* @returns {Function} A Redux thunk
|
|
10
|
+
*/var requestAppPermission=function requestAppPermission(_ref){var permissionId=_ref.permissionId,dispatchMockParam=_ref.dispatchMock;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var _ref5;var dispatchMock,_ref3,_ref4,_ref4$,_ref4$2,status,options,data;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatchMock=dispatchMockParam;// In development a mock needs to be injected to enable command testing. Command responses
|
|
11
|
+
// can be mocked via the global MockedAppPermissions object see appPermissions.js
|
|
12
|
+
if(!dispatchMockParam&&(!hasSGJavaScriptBridge()||hasWebBridge())){dispatchMock=createMockedPermissions(PERMISSION_STATUS_GRANTED);}_context.next=4;return requestAppPermissions([{permissionId:permissionId}],dispatchMock);case 4:_context.t1=_ref5=_context.sent;_context.t0=_context.t1!==null;if(!_context.t0){_context.next=8;break;}_context.t0=_ref5!==void 0;case 8:if(!_context.t0){_context.next=12;break;}_context.t2=_ref5;_context.next=13;break;case 12:_context.t2=[];case 13:_ref3=_context.t2;_ref4=_slicedToArray(_ref3,1);_ref4$=_ref4[0];_ref4$2=_ref4$===void 0?{status:PERMISSION_STATUS_NOT_SUPPORTED}:_ref4$;status=_ref4$2.status;options=_ref4$2.options;data=_ref4$2.data;dispatch(appPermissionStatusReceived({permissionId:permissionId,status:status,options:options}));return _context.abrupt("return",{status:status,data:data});case 22:case"end":return _context.stop();}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}());};export default requestAppPermission;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";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;}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{hasSGJavaScriptBridge,hasWebBridge,createMockedPermissions}from'@shopgate/engage/core/helpers';import{getAppPermissions}from'@shopgate/pwa-core/commands/appPermissions';import{PERMISSION_STATUS_NOT_SUPPORTED,PERMISSION_STATUS_GRANTED}from'@shopgate/engage/core/constants';import{appPermissionStatusReceived}from"../action-creators";/**
|
|
2
|
+
* Determines the current status of an app permission from the operating system.
|
|
3
|
+
* Additionally it propagates the received status via the APP_PERMISSION_STATUS_RECEIVED action.
|
|
4
|
+
* @param {Object} params The action params
|
|
5
|
+
* @param {string} params.permissionId The desired app permission id
|
|
6
|
+
* @param {Function} [params.dispatchMock=null] An optional mock for the request dispatch logic.
|
|
7
|
+
* Usually used when PWA is running inside a browser and app command logic can be simulated via
|
|
8
|
+
* browser APIs like for geolocation access.
|
|
9
|
+
* @returns {Function} A Redux thunk
|
|
10
|
+
*/var requestAppPermissionStatus=function requestAppPermissionStatus(_ref){var permissionId=_ref.permissionId,dispatchMockParam=_ref.dispatchMock;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var _ref5;var dispatchMock,_ref3,_ref4,_ref4$,_ref4$2,status,options;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatchMock=dispatchMockParam;// In development a mock needs to be injected to enable command testing. Command responses
|
|
11
|
+
// can be mocked via the global MockedAppPermissions object see appPermissions.js
|
|
12
|
+
if(!dispatchMockParam&&(!hasSGJavaScriptBridge()||hasWebBridge())){dispatchMock=createMockedPermissions(PERMISSION_STATUS_GRANTED);}_context.next=4;return getAppPermissions([permissionId],dispatchMock);case 4:_context.t1=_ref5=_context.sent;_context.t0=_context.t1!==null;if(!_context.t0){_context.next=8;break;}_context.t0=_ref5!==void 0;case 8:if(!_context.t0){_context.next=12;break;}_context.t2=_ref5;_context.next=13;break;case 12:_context.t2=[];case 13:_ref3=_context.t2;_ref4=_slicedToArray(_ref3,1);_ref4$=_ref4[0];_ref4$2=_ref4$===void 0?{status:PERMISSION_STATUS_NOT_SUPPORTED}:_ref4$;status=_ref4$2.status;options=_ref4$2.options;dispatch(appPermissionStatusReceived({permissionId:permissionId,status:status,options:options}));return _context.abrupt("return",{status:status});case 21:case"end":return _context.stop();}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}());};export default requestAppPermissionStatus;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
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;}import geolocationRequestBrowser from"./GeolocationRequestBrowser";import geolocationRequestApp from"./GeolocationRequestApp";import{GEOLOCATION_DEFAULT_TIMEOUT}from"../constants/geolocationRequest";/**
|
|
2
2
|
* The GeolocationRequest class enables to retrieve the current geolocation of the device.
|
|
3
|
-
* @deprecated
|
|
4
3
|
*/var GeolocationRequest=/*#__PURE__*/function(){/**
|
|
5
4
|
* Constructor
|
|
6
5
|
* @param {boolean} [useBrowserAPI=true] Wether the browser API or app commands a supposed to
|
|
@@ -9,8 +8,8 @@ function _classCallCheck(instance,Constructor){if(!(instance instanceof Construc
|
|
|
9
8
|
* Sets a timeout for the location request.
|
|
10
9
|
* @param {number} [value=10000] The timeout in ms.
|
|
11
10
|
* @returns {GeolocationRequest}
|
|
12
|
-
*/_createClass(GeolocationRequest,[{key:"setTimeout",value:function setTimeout(){var value=arguments.length>0&&arguments[0]!==undefined?arguments[0]:GEOLOCATION_DEFAULT_TIMEOUT;this.options.timeout=value;return this;}/**
|
|
11
|
+
*/return _createClass(GeolocationRequest,[{key:"setTimeout",value:function setTimeout(){var value=arguments.length>0&&arguments[0]!==undefined?arguments[0]:GEOLOCATION_DEFAULT_TIMEOUT;this.options.timeout=value;return this;}/**
|
|
13
12
|
* Dispatches the request. If no further provisions are made, it will trigger the geolocation
|
|
14
13
|
* permission dialog if permissions are not already granted.
|
|
15
14
|
* @returns {Promise}
|
|
16
|
-
*/},{key:"dispatch",value:function dispatch(){var instance=this.useBrowserAPI?geolocationRequestBrowser:geolocationRequestApp;return instance.dispatch(this.options.timeout);}}]);
|
|
15
|
+
*/},{key:"dispatch",value:function dispatch(){var instance=this.useBrowserAPI?geolocationRequestBrowser:geolocationRequestApp;return instance.dispatch(this.options.timeout);}}]);}();export default GeolocationRequest;
|
|
@@ -3,14 +3,14 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGenera
|
|
|
3
3
|
* Therefore it utilizes app commands and events.
|
|
4
4
|
*/var GeolocationRequestApp=/*#__PURE__*/function(){/**
|
|
5
5
|
* Constructor.
|
|
6
|
-
*/function GeolocationRequestApp(){var _this=this;_classCallCheck(this,GeolocationRequestApp)
|
|
7
|
-
* The getLocation command provide a serial parameter to identify related events. So this class
|
|
8
|
-
* maintains a request queue that guarantees one event handler per dispatched command.
|
|
9
|
-
*/this.responseQueue=[];event.addCallback(EVENT_NAME,this.handleResponse);}/**
|
|
6
|
+
*/function GeolocationRequestApp(){var _this=this;_classCallCheck(this,GeolocationRequestApp);/**
|
|
10
7
|
* Handles responses
|
|
11
8
|
* @param {Object} response Response.
|
|
12
|
-
*/
|
|
9
|
+
*/_defineProperty(this,"handleResponse",function(response){var queueEntry=_this.responseQueue.shift();if(typeof queueEntry==='undefined'){logger.error("".concat(EVENT_NAME," received but the response handler queue is empty."));return;}logGroup('GetLocationResponse ',response,'#9a9800');var resolve=queueEntry.resolve,reject=queueEntry.reject,timestamp=queueEntry.timestamp,timeout=queueEntry.timeout;if(typeof response!=='undefined'){resolve({accuracy:response.accuracy,latitude:response.latitude,longitude:response.longitude});return;}var error;var isTimeout=new Date().getTime()-timestamp>timeout;if(isTimeout){error=new Error('Timeout expired');error.code=GEOLOCATION_ERROR_TIMEOUT;}else{error=new Error('User denied Geolocation');error.code=GEOLOCATION_ERROR_DENIED;}reject(error);});/**
|
|
10
|
+
* The getLocation command provide a serial parameter to identify related events. So this class
|
|
11
|
+
* maintains a request queue that guarantees one event handler per dispatched command.
|
|
12
|
+
*/this.responseQueue=[];event.addCallback(EVENT_NAME,this.handleResponse);}return _createClass(GeolocationRequestApp,[{key:"dispatch",value:/**
|
|
13
13
|
* Dispatches the request.
|
|
14
14
|
* @param {number} [timeout=GEOLOCATION_DEFAULT_TIMEOUT] Timeout in ms for the request.
|
|
15
15
|
* @returns {Promise}
|
|
16
|
-
*/
|
|
16
|
+
*/function dispatch(){var _this2=this;var timeout=arguments.length>0&&arguments[0]!==undefined?arguments[0]:GEOLOCATION_DEFAULT_TIMEOUT;return new Promise(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(resolve,reject){var commandParams;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_this2.responseQueue.push({resolve:resolve,reject:reject,timeout:timeout,timestamp:new Date().getTime()});commandParams={timeout:timeout/1000};logGroup('GetLocationRequest',commandParams,'#9a9800');_context.next=5;return new AppCommand().setCommandName(COMMAND_NAME).setLibVersion(LIB_VERSION).setCommandParams(commandParams).dispatch();case 5:case"end":return _context.stop();}},_callee);}));return function(_x,_x2){return _ref.apply(this,arguments);};}());}}]);}();export{GeolocationRequestApp};export default new GeolocationRequestApp();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
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;}import{GEOLOCATION_ERROR_UNKNOWN,GEOLOCATION_ERROR_DENIED,GEOLOCATION_ERROR_UNAVAILABLE,GEOLOCATION_ERROR_TIMEOUT,GEOLOCATION_DEFAULT_TIMEOUT}from"../constants/geolocationRequest";var errorMapping=[GEOLOCATION_ERROR_UNKNOWN,GEOLOCATION_ERROR_DENIED,GEOLOCATION_ERROR_UNAVAILABLE,GEOLOCATION_ERROR_TIMEOUT];/* eslint-disable class-methods-use-this */ /**
|
|
2
2
|
* The GeolocationRequestBrowser class enables to retrieve the current geolocation of the device.
|
|
3
|
-
*/var GeolocationRequestBrowser=/*#__PURE__*/function(){function GeolocationRequestBrowser(){_classCallCheck(this,GeolocationRequestBrowser);}_createClass(GeolocationRequestBrowser,[{key:"dispatch"
|
|
3
|
+
*/var GeolocationRequestBrowser=/*#__PURE__*/function(){function GeolocationRequestBrowser(){_classCallCheck(this,GeolocationRequestBrowser);}return _createClass(GeolocationRequestBrowser,[{key:"dispatch",value:/**
|
|
4
4
|
* Dispatches the request. If no further provisions are made, it will trigger the geolocation
|
|
5
5
|
* permission dialog if permissions are not already granted.
|
|
6
6
|
* @param {number} [timeout=GEOLOCATION_DEFAULT_TIMEOUT] Timeout in ms for the request.
|
|
7
7
|
* @returns {Promise}
|
|
8
|
-
*/
|
|
8
|
+
*/function dispatch(){var timeout=arguments.length>0&&arguments[0]!==undefined?arguments[0]:GEOLOCATION_DEFAULT_TIMEOUT;return new Promise(function(resolve,reject){navigator.geolocation.getCurrentPosition(function(position){var coords=position.coords;resolve({accuracy:coords.accuracy,latitude:coords.latitude,longitude:coords.longitude});},function(_ref){var code=_ref.code,message=_ref.message;var error=new Error(message);error.code=errorMapping[code];reject(error);},{timeout:timeout});});}}]);}();export{GeolocationRequestBrowser};/* eslint-enable class-methods-use-this */export default new GeolocationRequestBrowser();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default as GeolocationRequest}from"./GeolocationRequest";export{default as AppCommand}from'@shopgate/pwa-core/classes/AppCommand';export{default as AppCommandRequest}from'@shopgate/pwa-core/classes/AppCommandRequest';export{default as GetAppPermissionsRequest}from'@shopgate/pwa-core/classes/AppPermissionsRequest/GetAppPermissionsRequest';export{default as RequestAppPermissionsRequest}from'@shopgate/pwa-core/classes/AppPermissionsRequest/RequestAppPermissionsRequest';export{default as BrightnessRequest}from'@shopgate/pwa-core/classes/BrightnessRequest';export{default as Conditioner}from'@shopgate/pwa-core/classes/Conditioner';export{default as DataRequest}from'@shopgate/pwa-core/classes/DataRequest';export{default as DevServerBridge}from'@shopgate/pwa-core/classes/DevServerBridge';export{default as errorManager,emitter}from'@shopgate/pwa-core/classes/ErrorManager';export{default as event}from'@shopgate/pwa-core/classes/Event';export{default as HttpRequest}from'@shopgate/pwa-core/classes/HttpRequest';export{default as PipelineRequest}from'@shopgate/pwa-core/classes/PipelineRequest';export{default as ScannerManager}from'@shopgate/pwa-core/classes/ScannerManager';export{default as WebStorageRequest}from'@shopgate/pwa-core/classes/WebStorageRequest';
|
|
@@ -0,0 +1,49 @@
|
|
|
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);});};}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;}/**
|
|
2
|
+
* @callback AppInitializationHandler
|
|
3
|
+
* @param {Object} params
|
|
4
|
+
* @param {Function} params.dispatch Redux dispatch function
|
|
5
|
+
* @param {Function} params.getState Redux dispatch function
|
|
6
|
+
* @returns {Promise}
|
|
7
|
+
*/ /**
|
|
8
|
+
* Class to maintain handler functions that are executed before the React app initializes.
|
|
9
|
+
*
|
|
10
|
+
* Handlers are invoked before the React app initializes. They can
|
|
11
|
+
* interact with Redux via "dispatch" and "getState" and e.g. initialize states based on
|
|
12
|
+
* information which is retrieved via app commands.
|
|
13
|
+
*
|
|
14
|
+
* Since the handler execution is blocking and postpones the React app initialization, this
|
|
15
|
+
* system should be handled with care.
|
|
16
|
+
*/var AppInitialization=/*#__PURE__*/function(){/**
|
|
17
|
+
* Constructor
|
|
18
|
+
*/function AppInitialization(){_classCallCheck(this,AppInitialization);this.store=new Map();}/**
|
|
19
|
+
* Get an initialization handler
|
|
20
|
+
* @param {*} key Identifier for the handler
|
|
21
|
+
* @returns {Promise}
|
|
22
|
+
*/return _createClass(AppInitialization,[{key:"get",value:function get(key){return this.store.get(key);}/**
|
|
23
|
+
* Sets an initialization handler.
|
|
24
|
+
*
|
|
25
|
+
* @param {*} key Identifier for the handler
|
|
26
|
+
* @param {AppInitializationHandler} handler The actual handler
|
|
27
|
+
* @returns {AppInitialization}
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* const handler = ({ dispatch, getState }) => {
|
|
31
|
+
* return new Promise(async (resolve) => {
|
|
32
|
+
* // Retrieve some data from the app via app command
|
|
33
|
+
* const appCommandResponse = await getAppCommandResponse();
|
|
34
|
+
* // Retrieve some data from Redux (store will be nearly empty at this point)
|
|
35
|
+
* const reduxValue = getValueFromRedux(getState());
|
|
36
|
+
* // Dispatch Redux actions to initialize a Redux state
|
|
37
|
+
* dispatch(reduxAction(reduxValue, appCommandResponse));
|
|
38
|
+
* resolve();
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* appInitialization.set('handler-key', handler);
|
|
42
|
+
* }
|
|
43
|
+
*/},{key:"set",value:function set(key,handler){this.store.set(key,handler);return this;}/**
|
|
44
|
+
* Invokes all registered handlers
|
|
45
|
+
* @returns {Promise<{results: [], errors: []}>}
|
|
46
|
+
*/},{key:"initialize",value:function(){var _initialize=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref){var dispatch,getState,promises,results,errors,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,promise;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch=_ref.dispatch,getState=_ref.getState;promises=Array.from(this.store.values()).map(function(handler){var res;// Take care that errors inside handlers don't break the app
|
|
47
|
+
try{res=handler({dispatch:dispatch,getState:getState});}catch(e){// Nothing to see here
|
|
48
|
+
}return res;}).filter(Boolean);results=[];errors=[];// eslint-disable-next-line no-restricted-syntax
|
|
49
|
+
_iteratorNormalCompletion=true;_didIteratorError=false;_iteratorError=undefined;_context.prev=7;_iterator=promises[Symbol.iterator]();case 9:if(_iteratorNormalCompletion=(_step=_iterator.next()).done){_context.next=25;break;}promise=_step.value;_context.prev=11;_context.t0=results;_context.next=15;return promise;case 15:_context.t1=_context.sent;_context.t0.push.call(_context.t0,_context.t1);_context.next=22;break;case 19:_context.prev=19;_context.t2=_context["catch"](11);errors.push(_context.t2);case 22:_iteratorNormalCompletion=true;_context.next=9;break;case 25:_context.next=31;break;case 27:_context.prev=27;_context.t3=_context["catch"](7);_didIteratorError=true;_iteratorError=_context.t3;case 31:_context.prev=31;_context.prev=32;if(!_iteratorNormalCompletion&&_iterator["return"]!=null){_iterator["return"]();}case 34:_context.prev=34;if(!_didIteratorError){_context.next=37;break;}throw _iteratorError;case 37:return _context.finish(34);case 38:return _context.finish(31);case 39:return _context.abrupt("return",{results:results,errors:errors});case 40:case"end":return _context.stop();}},_callee,this,[[7,27,31,39],[11,19],[32,,34,38]]);}));function initialize(_x){return _initialize.apply(this,arguments);}return initialize;}()}]);}();export default new AppInitialization();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default as appInitialization}from"./AppInitialization";export*from'@shopgate/pwa-common/collections';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';
|
|
@@ -0,0 +1,11 @@
|
|
|
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{AppCommandRequest}from'@shopgate/engage/core/classes';/**
|
|
2
|
+
* @typedef {Object} AnalyticsSetConsentResponse
|
|
3
|
+
* @property {string} status Update status
|
|
4
|
+
* @property {string} error Update error message
|
|
5
|
+
*/ /**
|
|
6
|
+
* Sends cookie consent settings to the app
|
|
7
|
+
* @param {Object} params Command params
|
|
8
|
+
* @param {boolean} [params.statistics=false] Setting for statistics consent
|
|
9
|
+
* @param {boolean} [params.comfort=false] Setting for comfort consent
|
|
10
|
+
* @returns {Promise<AnalyticsSetConsentResponse>}
|
|
11
|
+
*/var analyticsSetConsent=function analyticsSetConsent(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new AppCommandRequest('analyticsSetConsent').setCommandParams(_extends({statistics:false,comfort:false},params)).dispatch();};export default analyticsSetConsent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default as analyticsSetConsent}from"./analyticsSetConsent";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';export{default as getWebStorageEntry}from'@shopgate/pwa-core/commands/getWebStorageEntry';export{default as setWebStorageEntry}from'@shopgate/pwa-core/commands/setWebStorageEntry';
|