@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.
Files changed (504) hide show
  1. package/a11y/components/Section/index.js +2 -2
  2. package/a11y/components/VisuallyHidden/index.js +8 -0
  3. package/a11y/components/index.js +1 -0
  4. package/a11y/constants/index.js +1 -0
  5. package/a11y/helpers/index.js +1 -0
  6. package/a11y/index.js +1 -4
  7. package/account/actions/addContacts.js +2 -2
  8. package/account/actions/deleteContact.js +2 -2
  9. package/account/actions/deleteCustomer.js +2 -2
  10. package/account/actions/fetchContacts.js +2 -2
  11. package/account/actions/fetchCustomer.js +2 -2
  12. package/account/actions/updateContact.js +2 -2
  13. package/account/actions/updateCustomer.js +2 -2
  14. package/account/components/Account/Account.js +1 -1
  15. package/account/components/Account/Account.style.js +1 -1
  16. package/account/components/Profile/Profile.provider.js +3 -3
  17. package/account/components/ProfileContact/ProfileContact.js +1 -1
  18. package/account/reducers/index.js +1 -1
  19. package/app-rating/action-creators/appStart.js +3 -3
  20. package/app-rating/action-creators/ordersPlaced.js +3 -3
  21. package/app-rating/action-creators/popup.js +4 -4
  22. package/app-rating/action-creators/timer.js +3 -3
  23. package/app-rating/actions/showModal.js +6 -6
  24. package/app-rating/constants/index.js +2 -2
  25. package/app-rating/reducers/index.js +2 -2
  26. package/app-rating/subscriptions/index.js +4 -4
  27. package/back-in-stock/actions/index.js +14 -0
  28. package/back-in-stock/components/BackInStockButton/connector.js +1 -0
  29. package/back-in-stock/components/BackInStockButton/index.js +14 -0
  30. package/back-in-stock/components/BackInStockButton/style.js +1 -0
  31. package/back-in-stock/components/CharacteristicsButton/connector.js +3 -0
  32. package/back-in-stock/components/CharacteristicsButton/index.js +8 -0
  33. package/back-in-stock/components/ProductInfoBackInStockButton/connector.js +3 -0
  34. package/back-in-stock/components/ProductInfoBackInStockButton/index.js +10 -0
  35. package/back-in-stock/components/Subscriptions/components/List/index.js +4 -0
  36. package/back-in-stock/components/Subscriptions/components/Subscription/index.js +7 -0
  37. package/back-in-stock/components/Subscriptions/index.js +4 -0
  38. package/back-in-stock/components/index.js +1 -0
  39. package/back-in-stock/constants/Actions.js +1 -0
  40. package/back-in-stock/constants/Common.js +1 -0
  41. package/back-in-stock/constants/Pipelines.js +1 -0
  42. package/back-in-stock/constants/Portals.js +9 -0
  43. package/back-in-stock/constants/index.js +1 -0
  44. package/back-in-stock/hooks/index.js +4 -0
  45. package/back-in-stock/providers/BackInStockSubscriptionsProvider.connector.js +7 -0
  46. package/back-in-stock/providers/BackInStockSubscriptionsProvider.js +5 -0
  47. package/back-in-stock/providers/index.js +1 -0
  48. package/back-in-stock/reducers/index.js +5 -0
  49. package/back-in-stock/selectors/index.js +43 -0
  50. package/back-in-stock/streams/index.js +1 -0
  51. package/back-in-stock/subscriptions/index.js +11 -0
  52. package/cart/cart.helpers.js +9 -2
  53. package/cart/components/CartItem/CartItemCoupon.js +10 -6
  54. package/cart/components/CartItem/CartItemCouponCode.js +2 -2
  55. package/cart/components/CartItem/CartItemCouponDelete.js +1 -1
  56. package/cart/components/CartItem/CartItemCouponFreeShipping.js +1 -1
  57. package/cart/components/CartItem/CartItemCouponIcon.js +2 -2
  58. package/cart/components/CartItem/CartItemCouponLayout.style.js +5 -1
  59. package/cart/components/CartItem/CartItemCouponTitle.js +2 -2
  60. package/cart/components/CartItem/CartItemProductLayout.js +4 -2
  61. package/cart/components/CartItem/CartItemProductLayoutWide.style.js +1 -1
  62. package/cart/components/CartItem/CartItemProductTitle.js +2 -2
  63. package/cart/components/CartItem/CartItemQuantityPicker.js +26 -14
  64. package/cart/components/CartItem/CartItemSubstitution.js +1 -1
  65. package/cart/components/CartItems/CartItemCardReservation.js +1 -1
  66. package/cart/components/CartItems/CartItemGroupReservation.js +1 -1
  67. package/cart/components/CartSummaryWide/CartSummaryWideCheckoutButton.style.js +1 -1
  68. package/cart/components/PaymentBar/PaymentBar.js +1 -1
  69. package/cart/components/PaymentBar/PaymentBarCheckoutButton.style.js +1 -1
  70. package/cart/components/PaymentBar/PaymentBarPromotionCouponMessages.js +1 -1
  71. package/cart/index.js +3 -2
  72. package/cart/streams/index.js +1 -0
  73. package/category/actions/index.js +1 -0
  74. package/category/components/CategoryList/index.js +7 -0
  75. package/category/components/CategoryList/style.js +1 -0
  76. package/category/components/index.js +1 -1
  77. package/category/constants/index.js +1 -0
  78. package/category/helpers/index.js +1 -0
  79. package/category/index.js +1 -6
  80. package/category/selectors/index.js +2 -0
  81. package/category/streams/index.js +1 -1
  82. package/checkout/actions/errorCheckout.js +1 -1
  83. package/checkout/actions/fetchCheckoutOrder.js +1 -1
  84. package/checkout/actions/fetchPaymentMethods.js +1 -1
  85. package/checkout/actions/initializeCheckout.js +1 -1
  86. package/checkout/actions/prepareCheckout.js +2 -2
  87. package/checkout/actions/submitCheckoutOrder.js +1 -1
  88. package/checkout/actions/updateCheckoutOrder.js +1 -1
  89. package/checkout/components/Checkout/CheckoutPickupContactForm.config.js +1 -1
  90. package/checkout/components/Checkout/CheckoutSectionMessages.js +1 -1
  91. package/checkout/components/CheckoutConfirmation/CheckoutConfirmation.js +1 -1
  92. package/checkout/components/CheckoutConfirmation/CheckoutConfirmationBilledTo.js +1 -1
  93. package/checkout/components/GuestCheckout/GuestCheckoutPickupNotes.config.js +1 -1
  94. package/checkout/components/PaymentMethodButton/PaymentMethodButton.js +1 -1
  95. package/checkout/components/ShippingMethods/ShippingMethods.js +4 -4
  96. package/checkout/components/index.js +1 -1
  97. package/checkout/constants/index.js +1 -1
  98. package/checkout/index.js +3 -4
  99. package/checkout/paymentMethods/index.js +2 -2
  100. package/checkout/paymentMethods/paypal/PaypalButtonApp.js +1 -1
  101. package/checkout/paymentMethods/paypal/PaypalButtonWeb.js +1 -1
  102. package/checkout/paymentMethods/paypal/PaypalPayButton.js +1 -1
  103. package/checkout/paymentMethods/paypal/PaypalProvider.js +1 -1
  104. package/checkout/paymentMethods/stripe/StripeButton.js +2 -2
  105. package/checkout/paymentMethods/stripe/StripeCreditCard.js +3 -3
  106. package/checkout/paymentMethods/stripe/StripeProvider.js +8 -8
  107. package/checkout/paymentMethods/stripe/sdk.js +3 -2
  108. package/checkout/providers/AddressBookProvider.js +1 -1
  109. package/checkout/providers/CheckoutProvider.js +8 -8
  110. package/components/ChipLayout/index.js +38 -0
  111. package/components/ChipLayout/spec.js +5 -0
  112. package/components/ChipLayout/style.js +5 -0
  113. package/components/ConditionalWrapper/ConditionalWrapper.js +7 -2
  114. package/components/Footer/Footer.js +7 -7
  115. package/components/Form/Builder/Builder.js +50 -29
  116. package/components/Form/Builder/ElementCheckbox.js +1 -1
  117. package/components/Form/Builder/ElementMultiSelect.js +1 -1
  118. package/components/Form/Builder/ElementPhoneNumber.js +3 -3
  119. package/components/Form/Builder/ElementRadio.js +1 -1
  120. package/components/Form/Builder/ElementSelect.js +1 -1
  121. package/components/Form/Builder/ElementText.js +3 -3
  122. package/components/Form/Builder/classes/ActionListener.constants.js +2 -2
  123. package/components/Form/Builder/classes/ActionListener.js +73 -16
  124. package/components/Form/Builder/helpers/buildFormElements.js +2 -2
  125. package/components/Form/Form.js +8 -5
  126. package/components/IntersectionVisibility/index.js +14 -7
  127. package/components/Logo/connector.js +4 -0
  128. package/components/Logo/index.js +4 -0
  129. package/components/Logo/spec.js +1 -0
  130. package/components/Logo/style.js +1 -0
  131. package/components/Menu/components/Position/index.js +5 -5
  132. package/components/Menu/index.js +9 -9
  133. package/components/MessageBar/MessageBar.js +1 -1
  134. package/components/MessageBar/index.js +1 -1
  135. package/components/NavigationHandler/index.js +4 -4
  136. package/components/NavigationHandler/spec.js +1 -1
  137. package/components/Picker/components/Button/index.js +1 -1
  138. package/components/Picker/components/List/index.js +2 -2
  139. package/components/Picker/components/Modal/index.js +7 -7
  140. package/components/Picker/index.js +18 -9
  141. package/components/PickerUtilize/components/Button/index.js +5 -0
  142. package/components/PickerUtilize/components/Button/style.js +1 -0
  143. package/components/PickerUtilize/index.js +17 -0
  144. package/components/PickerUtilize/spec.js +1 -0
  145. package/components/PickerUtilize/style.js +1 -0
  146. package/components/QuantityInput/QuantityInput.js +5 -4
  147. package/components/Radio/Radio.js +1 -1
  148. package/components/RadioCard/RadioCard.js +1 -1
  149. package/components/RangeSlider/components/Handle/index.js +1 -1
  150. package/components/RangeSlider/index.js +36 -24
  151. package/components/ResponsiveContainer/ResponsiveContainer.js +2 -6
  152. package/components/ResponsiveContainer/breakpoints.js +2 -1
  153. package/components/ResponsiveContainer/hooks.js +20 -0
  154. package/components/ScrollHeader/index.js +2 -2
  155. package/components/ScrollHeader/style.js +1 -1
  156. package/components/SheetList/components/Item/index.js +5 -5
  157. package/components/SheetList/index.js +4 -4
  158. package/components/SideNavigation/SideNavigationCategories.connector.js +2 -2
  159. package/components/SnackBarContainer/index.js +5 -0
  160. package/components/Switch/index.js +12 -0
  161. package/components/Switch/style.js +1 -0
  162. package/components/Tabs/components/TabIndicator.js +2 -2
  163. package/components/Tabs/components/Tabs.js +1 -1
  164. package/components/TimeBoundary/index.js +8 -6
  165. package/components/VideoPlayer/index.js +9 -6
  166. package/components/View/components/Above/index.js +1 -1
  167. package/components/View/components/Below/index.js +1 -1
  168. package/components/View/components/Content/index.js +18 -11
  169. package/components/View/index.js +1 -1
  170. package/components/View/provider.js +22 -5
  171. package/components/index.js +2 -2
  172. package/core/action-creators/app.js +5 -0
  173. package/core/action-creators/appPermissions.js +9 -0
  174. package/core/action-creators/index.js +1 -1
  175. package/core/actions/getGeolocation.js +2 -2
  176. package/core/actions/grantAppTrackingTransparencyPermission.js +6 -0
  177. package/core/actions/grantCameraPermissions.js +1 -1
  178. package/core/actions/grantGeolocationPermissions.js +1 -1
  179. package/core/actions/grantPermissions.js +13 -6
  180. package/core/actions/grantPushPermissions.js +22 -0
  181. package/core/actions/index.js +7 -0
  182. package/core/actions/requestAppPermission.js +12 -0
  183. package/core/actions/requestAppPermissionStatus.js +12 -0
  184. package/core/classes/GeolocationRequest.js +2 -3
  185. package/core/classes/GeolocationRequestApp.js +6 -6
  186. package/core/classes/GeolocationRequestBrowser.js +2 -2
  187. package/core/classes/index.js +1 -0
  188. package/core/collections/AppInitialization.js +49 -0
  189. package/core/collections/index.js +1 -0
  190. package/core/commands/analyticsSetConsent.js +11 -0
  191. package/core/commands/index.js +1 -0
  192. package/core/config/ThemeConfigResolver.js +2 -2
  193. package/core/config/config.action-creators.js +1 -1
  194. package/core/config/config.actions.js +1 -1
  195. package/core/config/config.reducers.js +1 -1
  196. package/core/config/config.subscriptions.js +2 -2
  197. package/core/config/index.js +1 -1
  198. package/core/constants/actionTypes.js +1 -0
  199. package/core/constants/appFeatures.js +1 -0
  200. package/core/constants/index.js +6 -1
  201. package/core/contexts/index.js +1 -0
  202. package/core/helpers/appFeatures.js +15 -0
  203. package/core/helpers/appPermissions.js +43 -6
  204. package/core/helpers/baseUrl.js +14 -0
  205. package/core/helpers/environment.js +4 -0
  206. package/core/helpers/getFullImageSource.js +1 -1
  207. package/core/helpers/i18n.js +5 -3
  208. package/core/helpers/index.js +7 -0
  209. package/core/hocs/index.js +1 -0
  210. package/core/hocs/withCurrentProduct.js +6 -6
  211. package/core/hocs/withTheme.js +2 -2
  212. package/core/hooks/index.js +1 -0
  213. package/core/hooks/useAsyncMemo.js +1 -1
  214. package/core/hooks/useFormState.js +1 -1
  215. package/core/hooks/useScrollTo.js +1 -1
  216. package/core/hooks/useTheme.js +2 -2
  217. package/core/index.js +5 -52
  218. package/core/initialization/index.js +4 -2
  219. package/core/providers/AppProvider.js +10 -8
  220. package/core/providers/index.js +1 -0
  221. package/core/reducers/app.js +6 -0
  222. package/core/reducers/index.js +1 -1
  223. package/core/reducers/merchantSettings.js +1 -1
  224. package/core/reducers/shopSettings.js +1 -1
  225. package/core/selectors/app.js +9 -0
  226. package/core/selectors/index.js +6 -1
  227. package/core/streams/app.js +8 -0
  228. package/core/streams/appPermissions.js +19 -0
  229. package/core/streams/index.js +4 -0
  230. package/core/subscriptions/app.js +7 -0
  231. package/favorites/components/Item/Item.js +7 -7
  232. package/favorites/components/List/List.js +18 -7
  233. package/favorites/components/List/ListAccordionLabel.js +4 -0
  234. package/favorites/components/List/ListContent.js +8 -0
  235. package/favorites/components/List/ListItemWrapper.js +6 -0
  236. package/favorites/components/List/styles.js +1 -0
  237. package/favorites/components/Lists/Lists.js +5 -5
  238. package/favorites/components/Lists/ListsModal.js +3 -2
  239. package/favorites/constants/index.js +1 -0
  240. package/filter/actions/index.js +1 -0
  241. package/filter/components/PriceSlider/index.js +9 -9
  242. package/filter/components/PriceSlider/style.js +1 -3
  243. package/filter/components/index.js +1 -0
  244. package/filter/constants/index.js +1 -1
  245. package/filter/helpers/buildFilterParamsForFetchFiltersRequest.js +9 -0
  246. package/filter/helpers/buildInitialFilters.js +1 -1
  247. package/filter/helpers/buildUpdatedFilters.js +1 -1
  248. package/filter/helpers/index.js +1 -0
  249. package/filter/helpers/translateFilterLabel.js +6 -0
  250. package/filter/index.js +2 -7
  251. package/filter/providers/SortProvider.helpers.js +1 -1
  252. package/filter/selectors/index.js +1 -1
  253. package/filter/streams/index.js +1 -0
  254. package/i18n/locale/cs-cz/countries.json +255 -0
  255. package/i18n/locale/de-de/countries.json +26 -28
  256. package/i18n/locale/el-gr/countries.json +255 -0
  257. package/i18n/locale/en-us/countries.json +12 -14
  258. package/i18n/locale/es-es/countries.json +65 -67
  259. package/i18n/locale/fi-fi/countries.json +255 -0
  260. package/i18n/locale/fr-fr/countries.json +85 -87
  261. package/i18n/locale/hu-hu/countries.json +255 -0
  262. package/i18n/locale/it-it/countries.json +11 -13
  263. package/i18n/locale/nl-nl/countries.json +42 -44
  264. package/i18n/locale/pl-pl/countries.json +255 -0
  265. package/i18n/locale/pt-pt/countries.json +128 -130
  266. package/i18n/locale/ro-ro/countries.json +255 -0
  267. package/i18n/locale/sv-se/countries.json +255 -0
  268. package/locations/action-creators/receiveInventories.js +3 -5
  269. package/locations/actions/fetchFulfillmentSlots.js +1 -1
  270. package/locations/actions/fetchProductLocations.js +2 -2
  271. package/locations/actions/setUserGeolocation.js +1 -1
  272. package/locations/actions/setUserSearchGeolocation.js +1 -1
  273. package/locations/components/Cart/CartContextMenuChangeFulfillmentContent.js +1 -1
  274. package/locations/components/FulfillmentPath/FulfillmentPath.js +1 -1
  275. package/locations/components/FulfillmentPath/FulfillmentPathItem.js +2 -2
  276. package/locations/components/FulfillmentSelector/FulfillmentSelectorAddToCart.js +2 -2
  277. package/locations/components/FulfillmentSelector/FulfillmentSelectorAlternativeLocation.js +1 -1
  278. package/locations/components/FulfillmentSheet/FulfillmentSheet.js +2 -2
  279. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotDialog.js +1 -1
  280. package/locations/components/ReserveForm/ReserveForm.js +1 -1
  281. package/locations/components/ReserveForm/ReserveFormPhone.js +1 -1
  282. package/locations/components/StockInfo/StockInfo.defaultSettings.js +1 -1
  283. package/locations/components/StoreFinder/StoreFinderMap.style.js +2 -2
  284. package/locations/components/StoreList/StoreListSearch.js +5 -3
  285. package/locations/locations.streams.js +1 -1
  286. package/locations/providers/FulfillmentProvider.js +4 -4
  287. package/locations/providers/StoreFinderProvider.js +1 -1
  288. package/locations/reducers/storage.js +3 -3
  289. package/locations/selectors/index.js +2 -2
  290. package/locations/subscriptions.js +13 -13
  291. package/login/components/ForgotPassword/ForgotPassword.js +1 -1
  292. package/orders/actions/cancelOrder.js +1 -1
  293. package/orders/actions/fetchOrderDetails.js +1 -1
  294. package/orders/constants/status.js +2 -2
  295. package/orders/index.js +1 -1
  296. package/orders/providers/OrderDetailsPrivateProvider.js +1 -1
  297. package/orders/providers/OrderDetailsProvider.js +3 -3
  298. package/package.json +8 -8
  299. package/page/actions/index.js +1 -0
  300. package/page/components/index.js +1 -0
  301. package/page/constants/index.js +1 -0
  302. package/page/index.js +2 -4
  303. package/page/selectors/index.js +7 -0
  304. package/product/collections/index.js +1 -0
  305. package/product/components/Availability/Availability.connector.js +4 -5
  306. package/product/components/Availability/Availability.js +3 -3
  307. package/product/components/Characteristics/Characteristic/components/Sheet/index.js +20 -0
  308. package/product/components/Characteristics/Characteristic/components/SheetItem/index.js +10 -0
  309. package/product/components/Characteristics/Characteristic/components/SheetItem/style.js +1 -0
  310. package/product/components/Characteristics/Characteristic/index.js +18 -0
  311. package/product/components/Characteristics/Characteristic/style.js +1 -0
  312. package/product/components/Characteristics/Swatch/index.js +12 -0
  313. package/product/components/Characteristics/Swatch/style.js +1 -0
  314. package/product/components/Characteristics/index.js +12 -0
  315. package/product/components/Characteristics/transition.js +1 -0
  316. package/product/components/Description/index.js +2 -2
  317. package/product/components/EffectivityDates/helpers.js +3 -3
  318. package/product/components/EffectivityDates/index.js +1 -1
  319. package/product/components/Header/PriceStriked/connector.js +9 -0
  320. package/product/components/Header/PriceStriked/index.js +5 -0
  321. package/product/components/Header/PriceStriked/style.js +1 -0
  322. package/product/components/Header/Shipping/components/Label/index.js +6 -0
  323. package/product/components/Header/Shipping/components/Label/style.js +1 -0
  324. package/product/components/Header/Shipping/connector.js +9 -0
  325. package/product/components/Header/Shipping/index.js +5 -0
  326. package/product/components/Header/Shipping/mock.js +1 -0
  327. package/product/components/Header/Shipping/spec.js +5 -0
  328. package/product/components/Header/Shipping/style.js +1 -0
  329. package/product/components/Header/Tiers/components/Tier/index.js +6 -0
  330. package/product/components/Header/Tiers/components/Tier/spec.js +1 -0
  331. package/product/components/Header/Tiers/connector.js +10 -0
  332. package/product/components/Header/Tiers/index.js +5 -0
  333. package/product/components/Header/Tiers/spec.js +1 -0
  334. package/product/components/Header/Tiers/style.js +1 -0
  335. package/product/components/Header/index.js +1 -0
  336. package/product/components/MapPriceHint/index.js +1 -1
  337. package/product/components/Media/FeaturedMedia.js +1 -1
  338. package/product/components/MediaSlider/index.js +1 -1
  339. package/product/components/Options/components/Content/connector.js +10 -0
  340. package/product/components/Options/components/Content/index.js +16 -0
  341. package/product/components/Options/components/Content/spec.js +2 -0
  342. package/product/components/Options/components/Option/index.js +4 -0
  343. package/product/components/Options/components/TextOption/components/OptionInfo/index.js +9 -0
  344. package/product/components/Options/components/TextOption/components/OptionInfo/spec.js +1 -0
  345. package/product/components/Options/components/TextOption/components/OptionInfo/style.js +1 -0
  346. package/product/components/Options/components/TextOption/index.js +22 -0
  347. package/product/components/Options/components/TextOption/style.js +1 -0
  348. package/product/components/Options/index.js +5 -0
  349. package/product/components/OrderQuantityHint/index.js +3 -2
  350. package/product/components/OrderQuantityHint/style.js +1 -1
  351. package/product/components/PriceDifference/index.js +1 -1
  352. package/product/components/ProductCard/index.js +2 -2
  353. package/product/components/ProductCharacteristics/helpers/index.js +1 -1
  354. package/product/components/ProductCharacteristics/index.js +28 -12
  355. package/product/components/ProductDiscountBadge/spec.js +1 -1
  356. package/product/components/ProductGridPrice/index.js +2 -2
  357. package/product/components/ProductImage/index.js +15 -12
  358. package/product/components/ProductList/components/Item/index.js +5 -0
  359. package/product/components/ProductList/components/Item/style.js +2 -0
  360. package/product/components/ProductList/components/Iterator/index.js +5 -0
  361. package/product/components/ProductList/components/Iterator/style.js +1 -0
  362. package/product/components/ProductList/components/Layout/index.js +5 -0
  363. package/product/components/ProductList/components/Layout/style.js +1 -0
  364. package/product/components/ProductList/index.js +5 -0
  365. package/product/components/ProductProperties/Content.js +1 -1
  366. package/product/components/ProductProperties/GroupedProperties.js +1 -1
  367. package/product/components/ProductProperties/ListsHTML.js +1 -1
  368. package/product/components/ProductProperties/ProductProperties.js +1 -1
  369. package/product/components/ProductProperties/RowHTML.js +1 -1
  370. package/product/components/ProductProperties/Wrapper.js +1 -1
  371. package/product/components/ProductProperties/style.js +1 -1
  372. package/product/components/ProductSlider/index.js +4 -0
  373. package/product/components/ProductSlider/spec.js +1 -0
  374. package/product/components/ProductSlider/style.js +1 -0
  375. package/product/components/QuantityPicker/hooks.js +5 -0
  376. package/product/components/QuantityPicker/index.js +2 -2
  377. package/product/components/Rating/connector.js +9 -0
  378. package/product/components/Rating/index.js +7 -0
  379. package/product/components/Rating/mock.js +5 -0
  380. package/product/components/Rating/spec.js +5 -0
  381. package/product/components/Rating/style.js +1 -0
  382. package/product/components/Swatch/SwatchContent.js +1 -1
  383. package/product/components/UnitQuantityPicker/CartUnitQuantityPicker.js +2 -2
  384. package/product/components/UnitQuantityPicker/ProductUnitQuantityPicker.js +3 -2
  385. package/product/components/UnitQuantityPicker/UnitQuantityPicker.js +6 -3
  386. package/product/components/UnitQuantityPicker/UnitQuantityPickerWithSection.js +7 -0
  387. package/product/components/UnitQuantityPicker/index.js +1 -1
  388. package/product/components/index.js +1 -0
  389. package/product/constants/index.js +1 -1
  390. package/product/contexts/index.js +1 -0
  391. package/product/helpers/index.js +2 -2
  392. package/product/helpers/redirects.js +1 -1
  393. package/product/hocs/index.js +1 -0
  394. package/product/hooks/index.js +1 -0
  395. package/product/index.js +4 -11
  396. package/product/providers/Product/connector.js +5 -0
  397. package/product/providers/Product/index.js +4 -0
  398. package/product/providers/index.js +1 -0
  399. package/product/selectors/product.js +24 -3
  400. package/product/selectors/variants.js +2 -2
  401. package/product/streams/index.js +1 -0
  402. package/push-opt-in/action-creators/index.js +1 -0
  403. package/push-opt-in/action-creators/optInTrigger.js +23 -0
  404. package/push-opt-in/action-creators/pushOptIn.js +7 -0
  405. package/push-opt-in/actions/index.js +1 -0
  406. package/push-opt-in/actions/pushOptInModal.js +8 -0
  407. package/push-opt-in/components/PushOptInModal/connector.js +9 -0
  408. package/push-opt-in/components/PushOptInModal/index.js +9 -0
  409. package/push-opt-in/components/PushOptInModal/push-opt-in.svg +62 -0
  410. package/push-opt-in/components/PushOptInModal/style.js +1 -0
  411. package/push-opt-in/components/index.js +1 -0
  412. package/push-opt-in/constants/index.js +1 -0
  413. package/push-opt-in/constants/optInModal.js +1 -0
  414. package/push-opt-in/constants/optInTrigger.js +1 -0
  415. package/push-opt-in/reducers/index.js +1 -0
  416. package/push-opt-in/reducers/optInModal.js +6 -0
  417. package/push-opt-in/reducers/optInTrigger.js +6 -0
  418. package/push-opt-in/selectors/index.js +1 -0
  419. package/push-opt-in/selectors/optInModal.js +8 -0
  420. package/push-opt-in/selectors/optInTrigger.js +5 -0
  421. package/push-opt-in/subscriptions/index.js +1 -0
  422. package/push-opt-in/subscriptions/optInTrigger.js +12 -0
  423. package/registration/components/index.js +1 -0
  424. package/registration/index.js +1 -1
  425. package/registration/providers/GuestRegistrationProvider.actions.js +2 -2
  426. package/registration/providers/GuestRegistrationProvider.js +3 -3
  427. package/registration/providers/RegistrationProvider.actions.js +3 -3
  428. package/registration/providers/RegistrationProvider.js +2 -2
  429. package/registration/subscriptions/index.js +1 -1
  430. package/reviews/actions/index.js +1 -0
  431. package/reviews/components/Reviews/components/Header/components/ReviewsExcerpt/index.js +1 -1
  432. package/reviews/components/Reviews/components/Header/components/ReviewsExcerpt/style.js +1 -2
  433. package/reviews/components/Reviews/components/List/index.js +3 -3
  434. package/reviews/components/Reviews/components/List/spec.js +1 -1
  435. package/reviews/components/Reviews/components/RatingCount/index.js +1 -1
  436. package/reviews/components/Reviews/components/RatingCount/style.js +1 -2
  437. package/reviews/components/Reviews/components/ReviewsInfo/index.js +1 -2
  438. package/reviews/components/Reviews/spec.js +1 -1
  439. package/reviews/components/index.js +1 -0
  440. package/reviews/constants/index.js +1 -0
  441. package/reviews/index.js +3 -7
  442. package/reviews/selectors/index.js +1 -0
  443. package/reviews/streams/index.js +1 -0
  444. package/scanner/action-creators/index.js +1 -0
  445. package/scanner/actions/index.js +1 -0
  446. package/scanner/classes/index.js +1 -0
  447. package/scanner/constants/index.js +1 -0
  448. package/scanner/helpers/index.js +1 -0
  449. package/scanner/index.js +1 -6
  450. package/scanner/streams/index.js +1 -0
  451. package/search/actions/index.js +1 -0
  452. package/search/constants/index.js +1 -0
  453. package/search/helpers/index.js +1 -0
  454. package/search/index.js +1 -6
  455. package/search/selectors/index.js +1 -0
  456. package/search/streams/index.js +1 -0
  457. package/styles/helpers/index.js +1 -0
  458. package/styles/helpers/initCSSCustomProperties.js +3 -3
  459. package/styles/helpers/loadCustomStyles.js +2 -2
  460. package/styles/helpers/setPageBackgroundColor.js +2 -1
  461. package/styles/helpers/setPageContentWidth.js +2 -1
  462. package/styles/index.js +1 -1
  463. package/tracking/action-creators/cookieConsent.js +24 -0
  464. package/tracking/action-creators/index.js +1 -4
  465. package/tracking/actions/cookieConsent.js +21 -0
  466. package/tracking/actions/index.js +1 -0
  467. package/tracking/components/CookieConsentModal/connector.js +6 -0
  468. package/tracking/components/CookieConsentModal/index.js +9 -0
  469. package/tracking/components/CookieConsentModal/style.js +1 -0
  470. package/tracking/components/CookieConsentModal/tracking-opt-in.svg +18 -0
  471. package/tracking/components/PrivacySettings/connector.js +6 -0
  472. package/tracking/components/PrivacySettings/index.js +4 -0
  473. package/tracking/components/PrivacySettings/style.js +1 -0
  474. package/tracking/components/index.js +1 -1
  475. package/tracking/constants/index.js +1 -1
  476. package/tracking/reducers/cookieConsentModal.js +6 -0
  477. package/tracking/reducers/cookieSettings.js +6 -0
  478. package/tracking/reducers/index.js +1 -0
  479. package/tracking/selectors/cookieConsent.js +35 -0
  480. package/tracking/selectors/index.js +1 -4
  481. package/tracking/streams/cookieConsent.js +46 -0
  482. package/tracking/streams/index.js +1 -1
  483. package/tracking/subscriptions/analytics.js +11 -0
  484. package/tracking/subscriptions/cookieConsent.js +13 -0
  485. package/tracking/subscriptions/index.js +1 -4
  486. package/components/MessageBar/MessageBar.types.js +0 -0
  487. package/components/MessageBar/style.js +0 -1
  488. package/i18n/locale/ru-ru/countries.json +0 -251
  489. package/product/components/Availability/Availability.types.js +0 -1
  490. package/product/components/QuantityPicker/helpers.js +0 -5
  491. package/tracking/components/CookieConsent/CookieConsent.connector.js +0 -4
  492. package/tracking/components/CookieConsent/CookieConsent.js +0 -4
  493. package/tracking/components/CookieConsent/CookieConsentButtons.js +0 -3
  494. package/tracking/components/CookieConsent/CookieConsentCheckboxes.js +0 -3
  495. package/tracking/components/CookieConsent/CookieConsentContent.js +0 -4
  496. package/tracking/components/CookieConsent/CookieConsentMessage.js +0 -4
  497. package/tracking/components/CookieConsent/index.js +0 -1
  498. package/tracking/helpers/index.js +0 -7
  499. package/tracking/hooks/index.js +0 -4
  500. package/tracking/index.js +0 -1
  501. package/tracking/providers/CookieConsentProvider.connector.js +0 -4
  502. package/tracking/providers/CookieConsentProvider.js +0 -8
  503. /package/{tracking/providers/CookieConsentProvider.context.js → back-in-stock/providers/BackInStockSubscriptionsProvider.context.js} +0 -0
  504. /package/page/{NotFound.js → components/NotFound.js} +0 -0
@@ -0,0 +1,5 @@
1
+ import React from'react';import PropTypes from'prop-types';import styles from"./style";/**
2
+ * The Picker Button component.
3
+ * @param {Object} props The component props.
4
+ * @return {JSX}
5
+ */var Button=function Button(_ref){var disabled=_ref.disabled,label=_ref.label,openList=_ref.openList,value=_ref.value;return React.createElement("button",{className:"".concat(disabled?styles.buttonDisabled:styles.button),onClick:openList,type:"button"},React.createElement("span",{className:styles.label},label),value&&React.createElement("span",{className:styles.value},value));};Button.defaultProps={disabled:false,openList:function openList(){}};export default Button;
@@ -0,0 +1 @@
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{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var colors=themeConfig.colors,variables=themeConfig.variables;var buttonDefaults={display:'block',width:'100%',padding:"".concat(variables.gap.small,"px ").concat(variables.gap.big,"px"),fontFamily:'inherit',textAlign:'left',lineHeight:1.2,outline:'none',background:colors.shade8};var button=css(_extends({},buttonDefaults)).toString();var buttonDisabled=css(_extends({},buttonDefaults,{color:colors.shade4})).toString();var label=css({display:'block',fontWeight:500,':not(:only-child)':{fontWeight:400,fontSize:'0.75rem',marginBottom:4}}).toString();var value=css({display:'block',fontWeight:500}).toString();export default{button:button,buttonDisabled:buttonDisabled,label:label,value:value};
@@ -0,0 +1,17 @@
1
+ var _excluded=["hasButton","sheetProps"];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 _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}function _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{SheetList,Picker as BasePicker,Sheet}from'@shopgate/engage/components';import{ViewContext}from'@shopgate/engage/components/View';import Button from"./components/Button";import styles from"./style";/**
2
+ * The template version of the Picker component.
3
+ * @param {Object} props The same component props as in the base Picker component.
4
+ */var PickerUtilize=/*#__PURE__*/function(_Component){/**
5
+ * Constructor
6
+ * @param {Object} props Props of the component
7
+ */function PickerUtilize(props){var _this2;_classCallCheck(this,PickerUtilize);_this2=_callSuper(this,PickerUtilize,[props]);/**
8
+ * Focuses the picker button for screen readers.
9
+ */_defineProperty(_this2,"onDidOpen",function(){_this2.props.setViewAriaHidden(true);if(_this2.firstSelectableItemRef.current){_this2.firstSelectableItemRef.current.focus();}});/**
10
+ * Focuses the first selectable item for screen readers.
11
+ */_defineProperty(_this2,"onClose",function(){_this2.props.setViewAriaHidden(false);if(_this2.pickerRef.current){_this2.pickerRef.current.focus();}});_this2.modalComponent=function(sheetProps){return React.createElement(Sheet,_extends({},_extends({},_this2.props.sheetProps,{},sheetProps),{title:_this2.props.label,onDidOpen:_this2.onDidOpen}));};_this2.pickerRef=React.createRef();_this2.firstSelectableItemRef=React.createRef();_this2.listComponent=function(prps){return React.createElement(SheetList,null,prps.items.map(function(item,index){return React.createElement(SheetList.Item,{key:item.value,title:item.label,onClick:function onClick(){setTimeout(function(){prps.onSelect(item.value);prps.onClose();},_this2.props.clickDelay);},isDisabled:item.disabled,isSelected:index===prps.selectedIndex,rightComponent:item.rightComponent,testId:item.label,ref:index===prps.selectedIndex?_this2.firstSelectableItemRef:null});}));};return _this2;}_inherits(PickerUtilize,_Component);return _createClass(PickerUtilize,[{key:"render",value:/**
12
+ * Render
13
+ * @returns {JSX}
14
+ */function render(){var _this$props=this.props,hasButton=_this$props.hasButton,ignore=_this$props.sheetProps,restProps=_objectWithoutProperties(_this$props,_excluded);return React.createElement(BasePicker,_extends({},restProps,{className:"".concat(hasButton?styles:''," engage__picker-utilize"),modalComponent:this.modalComponent,buttonProps:this.props.buttonProps,buttonComponent:this.props.buttonComponent||Button,listComponent:this.listComponent,onClose:this.onClose,ref:this.pickerRef}));}}]);}(Component);_defineProperty(PickerUtilize,"defaultProps",{buttonComponent:null,buttonProps:{},/**
15
+ * Time in ms that delays picker interaction in order
16
+ * to let animations complete first.
17
+ */clickDelay:150,hasButton:true,sheetProps:{}});export default(function(props){return React.createElement(ViewContext.Consumer,null,function(_ref){var setAriaHidden=_ref.setAriaHidden;return React.createElement(PickerUtilize,_extends({},props,{setViewAriaHidden:setAriaHidden}));});});
@@ -0,0 +1 @@
1
+ import React from'react';import{mount}from'enzyme';import Picker from"./index";jest.mock('@shopgate/engage/components/View');describe('<Picker />',function(){it('should render the picker',function(){var label='Picker label';var wrapper=mount(React.createElement(Picker,{label:label}));expect(wrapper).toMatchSnapshot();});});
@@ -0,0 +1 @@
1
+ import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var variables=themeConfig.variables;export default css({display:'flex',marginBottom:variables.gap.small,minHeight:56}).toString();
@@ -1,8 +1,9 @@
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 _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 _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import React,{useRef,useState,useCallback,useLayoutEffect,useEffect,forwardRef}from'react';import PropTypes from'prop-types';import{isIOs}from'@shopgate/pwa-core';import{parseFloatString,formatFloat}from"./helper";/**
1
+ var _excluded=["className","onChange","onFocus","onBlur","value","maxDecimals","unit","minValue","maxValue","onKeyDown"];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 _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 _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import React,{useRef,useState,useCallback,useLayoutEffect,useEffect,forwardRef}from'react';import PropTypes from'prop-types';import noop from'lodash/noop';import{isIOs}from'@shopgate/pwa-core';import{parseFloatString,formatFloat}from"./helper";/**
2
2
  * A Quantity Input with unit support.
3
3
  * @returns {JSX}
4
- */var QuantityInput=forwardRef(function(_ref,outerInputRef){var className=_ref.className,onChange=_ref.onChange,customOnFocus=_ref.onFocus,customOnBlur=_ref.onBlur,value=_ref.value,maxDecimals=_ref.maxDecimals,unit=_ref.unit,minValue=_ref.minValue,maxValue=_ref.maxValue,inputProps=_objectWithoutProperties(_ref,["className","onChange","onFocus","onBlur","value","maxDecimals","unit","minValue","maxValue"]);var inputRef=outerInputRef||useRef();var _useState=useState(formatFloat(value,maxDecimals)),_useState2=_slicedToArray(_useState,2),inputValue=_useState2[0],setInputValue=_useState2[1];var _useState3=useState(false),_useState4=_slicedToArray(_useState3,2),isFocused=_useState4[0],setIsFocused=_useState4[1];var onFocus=useCallback(function(event){customOnFocus(event);setIsFocused(true);},[customOnFocus]);var onBlur=useCallback(function(event){var newValue=parseFloatString(inputValue,maxDecimals);setIsFocused(false);// If invalid switch to old value.
5
- if(Number.isNaN(parseFloat(inputValue))){setInputValue(formatFloat(value,maxDecimals));return;}if(newValue!==value){onChange(newValue);}customOnBlur(event,newValue);},[customOnBlur,inputValue,maxDecimals,onChange,value]);var handleChange=useCallback(function(event){var newValue=event.target.value;if(newValue!==''){if(minValue&&newValue<minValue){newValue="".concat(minValue);}if(maxValue&&newValue>maxValue){newValue="".concat(maxValue);}}setInputValue(newValue);},[maxValue,minValue]);// Select the current input value after focus.
4
+ */var QuantityInput=forwardRef(function(_ref,outerInputRef){var className=_ref.className,onChange=_ref.onChange,customOnFocus=_ref.onFocus,customOnBlur=_ref.onBlur,value=_ref.value,maxDecimals=_ref.maxDecimals,unit=_ref.unit,minValue=_ref.minValue,maxValue=_ref.maxValue,onKeyDown=_ref.onKeyDown,inputProps=_objectWithoutProperties(_ref,_excluded);var inputRef=outerInputRef||useRef();var _useState=useState(formatFloat(value,maxDecimals)),_useState2=_slicedToArray(_useState,2),inputValue=_useState2[0],setInputValue=_useState2[1];var _useState3=useState(false),_useState4=_slicedToArray(_useState3,2),isFocused=_useState4[0],setIsFocused=_useState4[1];var onFocus=useCallback(function(event){customOnFocus(event);setIsFocused(true);},[customOnFocus]);var onBlur=useCallback(function(event){var newValue=parseFloatString(inputValue,maxDecimals);setIsFocused(false);// If invalid switch to old value.
5
+ if(Number.isNaN(parseFloat(inputValue))){setInputValue(formatFloat(value,maxDecimals));return;}if(minValue&&newValue<minValue){newValue=minValue;}if(maxValue&&newValue>maxValue){newValue=maxValue;}setInputValue("".concat(newValue));if(newValue!==value){onChange(newValue);}customOnBlur(event,newValue);},[customOnBlur,inputValue,maxDecimals,maxValue,minValue,onChange,value]);var handleChange=useCallback(function(event){var newValue=event.target.value;setInputValue(newValue);},[]);var handleKeyDown=useCallback(function(event){if(event.key==='Enter'){// Prevents false positive validation error when enter key is pressed inside input
6
+ event.preventDefault();if(inputRef.current){inputRef.current.blur();}}if(typeof onKeyDown==='function'){onKeyDown(event);}},[inputRef,onKeyDown]);// Select the current input value after focus.
6
7
  useLayoutEffect(function(){if(isFocused&&isIOs){inputRef.current.select();}},[inputRef,isFocused]);// Sync actual float value with displayed content.
7
8
  useEffect(function(){setInputValue(formatFloat(value,maxDecimals));},[maxDecimals,value]);// Stop the context menu from opening.
8
- useLayoutEffect(function(){inputRef.current.addEventListener('contextmenu',function(event){event.preventDefault();event.stopPropagation();return false;});},[inputRef]);var displayedValue=!isFocused&&unit?"".concat(inputValue," ").concat(unit):inputValue;return React.createElement("input",_extends({ref:inputRef},inputProps,{inputMode:maxDecimals>0?'decimal':'numeric'/* Pattern signals some browsers to use specialized keyboard (if inputmode not supported */,pattern:maxDecimals>0?'[0-9.,]*':'[0–9]*',onFocus:onFocus,onBlur:onBlur,className:className,value:displayedValue,onChange:handleChange,onClick:function onClick(event){event.preventDefault();event.stopPropagation();if(inputRef.current){inputRef.current.focus();}}}));});QuantityInput.defaultProps={className:'',maxDecimals:2,unit:null,minValue:null,maxValue:null,onFocus:function onFocus(){},onChange:function onChange(){},onBlur:function onBlur(){}};export default QuantityInput;
9
+ useLayoutEffect(function(){inputRef.current.addEventListener('contextmenu',function(event){event.preventDefault();event.stopPropagation();return false;});},[inputRef]);var displayedValue=!isFocused&&unit?"".concat(inputValue," ").concat(unit):inputValue;return React.createElement("input",_extends({ref:inputRef},inputProps,{inputMode:maxDecimals>0?'decimal':'numeric'/* Pattern signals some browsers to use specialized keyboard (if inputmode not supported */,pattern:maxDecimals>0?'[0-9.,]*':'[0–9]*',onFocus:onFocus,onBlur:onBlur,className:className,value:displayedValue,onChange:handleChange,onKeyDown:handleKeyDown,onClick:function onClick(event){event.preventDefault();event.stopPropagation();if(inputRef.current){inputRef.current.focus();}}}));});QuantityInput.defaultProps={className:'',maxDecimals:2,unit:null,minValue:null,maxValue:null,onFocus:noop,onChange:noop,onBlur:noop,onKeyDown:noop};export default QuantityInput;
@@ -2,4 +2,4 @@ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj
2
2
  * The Radio component
3
3
  * @param {Object} props The component props
4
4
  * @returns {JSX}
5
- */var Radio=function Radio(_ref){var _classNames;var classes=_ref.classes,nameProp=_ref.name,onChangeProp=_ref.onChange,checkedProp=_ref.checked,disabledProp=_ref.disabled,valueProp=_ref.value,attributes=_ref.attributes;var radioGroup=useRadioGroup();var name=nameProp;var checked=checkedProp;var onChange=onChangeProp;if(radioGroup){if(checked===null){checked=radioGroup.value===valueProp;}if(typeof radioGroup.name!=='undefined'){name=radioGroup.name;}if(typeof radioGroup.onChange!=='undefined'){onChange=radioGroup.onChange;}}return React.createElement("span",{className:classNames(styles.root,classes.root)},React.createElement(Ripple,{className:styles.ripple,color:"var(--color-primary)"},React.createElement("input",_extends({className:styles.input,type:"radio",name:name,value:valueProp,checked:checked,onChange:onChange,disabled:disabledProp,id:"".concat(name,"_").concat(valueProp)},attributes)),React.createElement("div",{className:classNames(styles.radioContainer,(_classNames={},_defineProperty(_classNames,styles.radioDisabled,disabledProp),_defineProperty(_classNames,classes.disabled,disabledProp),_classNames))},checked&&React.createElement(CheckedIcon,{className:classNames(styles.radio,styles.radioChecked,classes.radioChecked,'checkedIcon')}),!checked&&React.createElement(UncheckedIcon,{className:classNames(styles.radio,classes.radioUnchecked,'uncheckedIcon')}))));};Radio.defaultProps={classes:{},checked:null,disabled:false,onChange:null,name:null,value:null,attributes:null};export default hot(Radio);
5
+ */var Radio=function Radio(_ref){var classes=_ref.classes,nameProp=_ref.name,onChangeProp=_ref.onChange,checkedProp=_ref.checked,disabledProp=_ref.disabled,valueProp=_ref.value,attributes=_ref.attributes;var radioGroup=useRadioGroup();var name=nameProp;var checked=checkedProp;var onChange=onChangeProp;if(radioGroup){if(checked===null){checked=radioGroup.value===valueProp;}if(typeof radioGroup.name!=='undefined'){name=radioGroup.name;}if(typeof radioGroup.onChange!=='undefined'){onChange=radioGroup.onChange;}}return React.createElement("span",{className:classNames(styles.root,classes.root)},React.createElement(Ripple,{className:styles.ripple,color:"var(--color-primary)"},React.createElement("input",_extends({className:styles.input,type:"radio",name:name,value:valueProp,checked:checked,onChange:onChange,disabled:disabledProp,id:"".concat(name,"_").concat(valueProp)},attributes)),React.createElement("div",{className:classNames(styles.radioContainer,_defineProperty(_defineProperty({},styles.radioDisabled,disabledProp),classes.disabled,disabledProp))},checked&&React.createElement(CheckedIcon,{className:classNames(styles.radio,styles.radioChecked,classes.radioChecked,'checkedIcon')}),!checked&&React.createElement(UncheckedIcon,{className:classNames(styles.radio,classes.radioUnchecked,'uncheckedIcon')}))));};Radio.defaultProps={classes:{},checked:null,disabled:false,onChange:null,name:null,value:null,attributes:null};export default hot(Radio);
@@ -6,4 +6,4 @@ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj
6
6
  * The RadioCard component
7
7
  * @param {Object} props The component props
8
8
  * @returns {JSX}
9
- */var RadioCard=function RadioCard(_ref2){var _classNames;var children=_ref2.children,nameProp=_ref2.name,onChange=_ref2.onChange,checked=_ref2.checked,disabledProp=_ref2.disabled,value=_ref2.value,attributes=_ref2.attributes,classes=_ref2.classes,RenderCard=_ref2.renderCard;var radioGroup=useRadioGroup();var name=nameProp;var disabled=disabledProp;if(radioGroup){if(typeof radioGroup.name!=='undefined'){name=radioGroup.name;}if(typeof radioGroup.disabled!=='undefined'){disabled=radioGroup.disabled;}}return React.createElement(RenderCard,{className:classes.root},React.createElement(Radio,{name:name,value:value,onChange:onChange,disabled:disabled,checked:checked,attributes:attributes,classes:{root:styles.radio}}),React.createElement("label",{htmlFor:"".concat(name,"_").concat(value),className:classNames(styles.content,(_classNames={},_defineProperty(_classNames,styles.contentDisabled,disabled),_defineProperty(_classNames,classes.disabled,disabled),_classNames))},children));};RadioCard.defaultProps={children:null,checked:null,classes:{},disabled:false,onChange:null,name:null,value:null,attributes:null,renderCard:CardComponent};export default hot(RadioCard);
9
+ */var RadioCard=function RadioCard(_ref2){var children=_ref2.children,nameProp=_ref2.name,onChange=_ref2.onChange,checked=_ref2.checked,disabledProp=_ref2.disabled,value=_ref2.value,attributes=_ref2.attributes,classes=_ref2.classes,RenderCard=_ref2.renderCard;var radioGroup=useRadioGroup();var name=nameProp;var disabled=disabledProp;if(radioGroup){if(typeof radioGroup.name!=='undefined'){name=radioGroup.name;}if(typeof radioGroup.disabled!=='undefined'){disabled=radioGroup.disabled;}}return React.createElement(RenderCard,{className:classes.root},React.createElement(Radio,{name:name,value:value,onChange:onChange,disabled:disabled,checked:checked,attributes:attributes,classes:{root:styles.radio}}),React.createElement("label",{htmlFor:"".concat(name,"_").concat(value),className:classNames(styles.content,_defineProperty(_defineProperty({},styles.contentDisabled,disabled),classes.disabled,disabled))},children));};RadioCard.defaultProps={children:null,checked:null,classes:{},disabled:false,onChange:null,name:null,value:null,attributes:null,renderCard:CardComponent};export default hot(RadioCard);
@@ -6,4 +6,4 @@ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<argum
6
6
  * @param {Function} props.onTouchStart The touch start event callback.
7
7
  * @param {Object} props.classNames (Optional) An additional style classes for the handle.
8
8
  * @returns {JSX}
9
- */var RangeSliderHandle=function RangeSliderHandle(props){var active=props.active,index=props.index,onTouchStart=props.onTouchStart,classNames=props.classNames,useMouseEvents=props.useMouseEvents;var style={zIndex:Number(active)||0};var eventHandler=_defineProperty({},useMouseEvents?'onMouseDown':'onTouchStart',function(event){return onTouchStart(event,index);});return React.createElement("div",_extends({className:cxs(classNames.handleOuter,styles),style:style},eventHandler),React.createElement("div",{className:classNames.handleInner}));};RangeSliderHandle.defaultProps={active:false,classNames:{handleOuter:null,handleInner:null}};export default RangeSliderHandle;
9
+ */var RangeSliderHandle=function RangeSliderHandle(props){var active=props.active,index=props.index,onTouchStart=props.onTouchStart,classNames=props.classNames,useMouseEvents=props.useMouseEvents;var style={zIndex:Number(active)||0};var eventHandler=_defineProperty({},useMouseEvents?'onMouseDown':'onTouchStart',function(event){return onTouchStart(event,index);});return React.createElement("div",_extends({className:cxs(classNames.handleOuter,styles,'engage__range-slider__handle'),style:style},eventHandler),React.createElement("div",{className:classNames.handleInner}));};RangeSliderHandle.defaultProps={active:false,classNames:{handleOuter:null,handleInner:null}};export default RangeSliderHandle;
@@ -1,42 +1,54 @@
1
- function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}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,{PureComponent}from'react';import PropTypes from'prop-types';import cxs from'classnames';import styles from"./style";import Handle from"./components/Handle";import{isTouchDevice}from"../../core";import{generateLinearEasingCallback,generateExponentialEasingCallback,getRangeStyle,getTouchPositionX,getAbsoluteValue,getRelativeValue}from"./helper";/**
1
+ function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{PureComponent}from'react';import PropTypes from'prop-types';import cxs from'classnames';import styles from"./style";import Handle from"./components/Handle";import{isTouchDevice}from"../../core";import{generateLinearEasingCallback,generateExponentialEasingCallback,getRangeStyle,getTouchPositionX,getAbsoluteValue,getRelativeValue}from"./helper";/**
2
2
  * The range slider component.
3
- */var RangeSlider=/*#__PURE__*/function(_PureComponent){_inherits(RangeSlider,_PureComponent);/**
3
+ */var RangeSlider=/*#__PURE__*/function(_PureComponent){/**
4
4
  * Constructor
5
5
  * @param {Object} props The component properties
6
- */function RangeSlider(props){var _this;_classCallCheck(this,RangeSlider);_this=_possibleConstructorReturn(this,_getPrototypeOf(RangeSlider).call(this,props));_defineProperty(_assertThisInitialized(_this),"handleTouchStart",function(event,index){_this.addEventListeners();_this.draggedHandle=index;// Calculate the relative offset to the handles center
6
+ */function RangeSlider(props){var _this2;_classCallCheck(this,RangeSlider);_this2=_callSuper(this,RangeSlider,[props]);/**
7
+ * Processes touch start events on handles.
8
+ * @param {Object} event The touch event
9
+ * @param {number} index The index of the touched handle.
10
+ */_defineProperty(_this2,"handleTouchStart",function(event,index){_this2.addEventListeners();_this2.draggedHandle=index;// Calculate the relative offset to the handles center
7
11
  var handleDOMElement=event.target;// Get the handles bounding rectangle ...
8
12
  var handleRect=handleDOMElement.getBoundingClientRect();// ... and calculate its absolute center.
9
13
  var handleCenterX=handleRect.left+handleDOMElement.offsetWidth/2;// Store the signed distanced between the current touch offset and the handle center.
10
- _this.touchOffset=getTouchPositionX(event)-handleCenterX;});_defineProperty(_assertThisInitialized(_this),"handleTouchMove",function(event){if(_this.props.min===_this.props.max){return;}if(_this.draggedHandle===null){return;}var _this$domElement$curr=_this.domElement.current.getBoundingClientRect(),offsetWidth=_this$domElement$curr.width,offsetLeft=_this$domElement$curr.left;// Calculate the absolute offset where the element was touched...
11
- var deltaX=getTouchPositionX(event)-offsetLeft-_this.touchOffset;// ...and convert it into a relative value between [0...1].
12
- deltaX=Math.max(0,Math.min(1,deltaX/offsetWidth));var stateUpdate={};if(_this.draggedHandle===1){// Right handle dragged
13
- if(_this.state.rangeMin<deltaX){stateUpdate.rangeMax=Math.min(1,deltaX);_this.draggedHandlePixelOffset=Math.abs(stateUpdate.rangeMax-_this.state.rangeMax);}else{// Not in valid range, swap handles
14
- _this.draggedHandle=0;stateUpdate.rangeMax=_this.state.rangeMin;stateUpdate.rangeMin=deltaX;_this.draggedHandlePixelOffset=Math.abs(stateUpdate.rangeMin-_this.state.rangeMin);}}else if(_this.draggedHandle===0){// Left handle dragged
15
- if(_this.state.rangeMax>deltaX){stateUpdate.rangeMin=Math.max(0,deltaX);_this.draggedHandlePixelOffset=Math.abs(stateUpdate.rangeMin-_this.state.rangeMin);}else{// Not in valid range, swap handles
16
- _this.draggedHandle=1;stateUpdate.rangeMin=_this.state.rangeMax;stateUpdate.rangeMax=deltaX;_this.draggedHandlePixelOffset=Math.abs(stateUpdate.rangeMax-_this.state.rangeMax);}}_this.draggedHandlePixelOffset*=offsetWidth;_this.setState(stateUpdate,_this.triggerChangeCallback);});_defineProperty(_assertThisInitialized(_this),"handleTouchEnd",function(){_this.removeEventListeners();_this.touchOffset=0;_this.draggedHandle=null;});_defineProperty(_assertThisInitialized(_this),"handleRangeTouch",function(event){var _this$domElement$curr2=_this.domElement.current.getBoundingClientRect(),offsetWidth=_this$domElement$curr2.width,offsetLeft=_this$domElement$curr2.left;var dx=(getTouchPositionX(event)-offsetLeft)/offsetWidth;var d0=Math.abs(_this.state.rangeMin-dx);var d1=Math.abs(_this.state.rangeMax-dx);if(d0<d1){_this.draggedHandle=0;}else{_this.draggedHandle=1;}_this.handleTouchMove(event);});_defineProperty(_assertThisInitialized(_this),"handleInputChange",function(event){var max=_this.props.max;var _event$target=event.target,value=_event$target.value,id=_event$target.id;var delta=Math.max(0,Math.min(1,value/(max/100)));var state=id==='price_from'?{rangeMin:delta}:{rangeMax:delta};_this.setState(state);});_this.draggedHandle=null;// 0 for left handle, 1 for right handle or null
17
- _this.domElement=React.createRef();_this.touchOffset=0;_this.draggedHandlePixelOffset=0;// The absolute pixel delta of the last handle move event.
18
- _this.state=_this.getRange(props);_this.useMouseEvents=!isTouchDevice();return _this;}/**
14
+ _this2.touchOffset=getTouchPositionX(event)-handleCenterX;});/**
15
+ * Processes move events on handles.
16
+ * @param {Object} event The touch event
17
+ */_defineProperty(_this2,"handleTouchMove",function(event){if(_this2.props.min===_this2.props.max){return;}if(_this2.draggedHandle===null){return;}var _this2$domElement$cur=_this2.domElement.current.getBoundingClientRect(),offsetWidth=_this2$domElement$cur.width,offsetLeft=_this2$domElement$cur.left;// Calculate the absolute offset where the element was touched...
18
+ var deltaX=getTouchPositionX(event)-offsetLeft-_this2.touchOffset;// ...and convert it into a relative value between [0...1].
19
+ deltaX=Math.max(0,Math.min(1,deltaX/offsetWidth));var stateUpdate={};if(_this2.draggedHandle===1){// Right handle dragged
20
+ if(_this2.state.rangeMin<deltaX){stateUpdate.rangeMax=Math.min(1,deltaX);_this2.draggedHandlePixelOffset=Math.abs(stateUpdate.rangeMax-_this2.state.rangeMax);}else{// Not in valid range, swap handles
21
+ _this2.draggedHandle=0;stateUpdate.rangeMax=_this2.state.rangeMin;stateUpdate.rangeMin=deltaX;_this2.draggedHandlePixelOffset=Math.abs(stateUpdate.rangeMin-_this2.state.rangeMin);}}else if(_this2.draggedHandle===0){// Left handle dragged
22
+ if(_this2.state.rangeMax>deltaX){stateUpdate.rangeMin=Math.max(0,deltaX);_this2.draggedHandlePixelOffset=Math.abs(stateUpdate.rangeMin-_this2.state.rangeMin);}else{// Not in valid range, swap handles
23
+ _this2.draggedHandle=1;stateUpdate.rangeMin=_this2.state.rangeMax;stateUpdate.rangeMax=deltaX;_this2.draggedHandlePixelOffset=Math.abs(stateUpdate.rangeMax-_this2.state.rangeMax);}}_this2.draggedHandlePixelOffset*=offsetWidth;_this2.setState(stateUpdate,_this2.triggerChangeCallback);});/**
24
+ * Processes global touch end events for handles.
25
+ * @param {Object} e The touch event
26
+ */_defineProperty(_this2,"handleTouchEnd",function(){_this2.removeEventListeners();_this2.touchOffset=0;_this2.draggedHandle=null;});/**
27
+ * Processes outer range touch end events.
28
+ * @param {Object} event The touch event
29
+ */_defineProperty(_this2,"handleRangeTouch",function(event){var _this2$domElement$cur2=_this2.domElement.current.getBoundingClientRect(),offsetWidth=_this2$domElement$cur2.width,offsetLeft=_this2$domElement$cur2.left;var dx=(getTouchPositionX(event)-offsetLeft)/offsetWidth;var d0=Math.abs(_this2.state.rangeMin-dx);var d1=Math.abs(_this2.state.rangeMax-dx);if(d0<d1){_this2.draggedHandle=0;}else{_this2.draggedHandle=1;}_this2.handleTouchMove(event);});/**
30
+ * Processes the input field values.
31
+ * @param {Object} event The change event.
32
+ */_defineProperty(_this2,"handleInputChange",function(event){var max=_this2.props.max;var _event$target=event.target,value=_event$target.value,id=_event$target.id;var delta=Math.max(0,Math.min(1,value/(max/100)));var state=id==='price_from'?{rangeMin:delta}:{rangeMax:delta};_this2.setState(state);});_this2.draggedHandle=null;// 0 for left handle, 1 for right handle or null
33
+ _this2.domElement=React.createRef();_this2.touchOffset=0;_this2.draggedHandlePixelOffset=0;// The absolute pixel delta of the last handle move event.
34
+ _this2.state=_this2.getRange(props);_this2.useMouseEvents=!isTouchDevice();return _this2;}/**
19
35
  * Updates the component properties.
20
36
  * @param {Object} newProps The new component properties.
21
- */_createClass(RangeSlider,[{key:"UNSAFE_componentWillReceiveProps",value:function UNSAFE_componentWillReceiveProps(newProps){this.setState(this.getRange(newProps));}/**
37
+ */_inherits(RangeSlider,_PureComponent);return _createClass(RangeSlider,[{key:"UNSAFE_componentWillReceiveProps",value:function UNSAFE_componentWillReceiveProps(newProps){this.setState(this.getRange(newProps));}/**
22
38
  * Get the easing function.
23
- */},{key:"addEventListeners",/**
39
+ */},{key:"ease",get:function get(){return{linear:generateLinearEasingCallback(this.props.resolution),exponential:generateExponentialEasingCallback(this.props.factor)}[this.props.easing];}/**
40
+ * Get the function to invert an eased value to it's original value.
41
+ */},{key:"invertedEase",get:function get(){return{linear:generateLinearEasingCallback(this.props.resolution),exponential:generateExponentialEasingCallback(1/this.props.factor)}[this.props.easing];}/**
24
42
  * Adds event listeners
25
- */value:function addEventListeners(){if(this.useMouseEvents){document.addEventListener('mouseup',this.handleTouchEnd);document.addEventListener('mousemove',this.handleTouchMove);}else{document.addEventListener('touchend',this.handleTouchEnd);document.addEventListener('touchmove',this.handleTouchMove);}}/**
43
+ */},{key:"addEventListeners",value:function addEventListeners(){if(this.useMouseEvents){document.addEventListener('mouseup',this.handleTouchEnd);document.addEventListener('mousemove',this.handleTouchMove);}else{document.addEventListener('touchend',this.handleTouchEnd);document.addEventListener('touchmove',this.handleTouchMove);}}/**
26
44
  * Removes event listeners
27
45
  */},{key:"removeEventListeners",value:function removeEventListeners(){if(this.useMouseEvents){document.removeEventListener('mouseup',this.handleTouchEnd);document.removeEventListener('mousemove',this.handleTouchMove);}else{document.removeEventListener('touchend',this.handleTouchEnd);document.removeEventListener('touchmove',this.handleTouchMove);}}/**
28
46
  * Get range min and max from props.
29
47
  * @param {Object} props The component props.
30
48
  * @returns {Object} The new state
31
- */},{key:"getRange",value:function getRange(props){var value=props.value,min=props.min,max=props.max;return{rangeMin:this.invertedEase(getRelativeValue(value[0],min,max)),rangeMax:this.invertedEase(getRelativeValue(value[1],min,max))};}/**
32
- * Processes touch start events on handles.
33
- * @param {Object} event The touch event
34
- * @param {number} index The index of the touched handle.
35
- */},{key:"triggerChangeCallback",/**
49
+ */},{key:"getRange",value:function getRange(props){var value=props.value,min=props.min,max=props.max;return{rangeMin:this.invertedEase(getRelativeValue(value[0],min,max)),rangeMax:this.invertedEase(getRelativeValue(value[1],min,max))};}},{key:"triggerChangeCallback",value:/**
36
50
  * Calls the change callback in case of a state update.
37
- */value:function triggerChangeCallback(){var _this$props=this.props,value=_this$props.value,onChange=_this$props.onChange,min=_this$props.min,max=_this$props.max;if(!onChange){return;}var newRange=[getAbsoluteValue(this.ease(this.state.rangeMin),min,max,true),getAbsoluteValue(this.ease(this.state.rangeMax),min,max,true)];if(newRange!==value){onChange(newRange);}}/**
51
+ */function triggerChangeCallback(){var _this$props=this.props,value=_this$props.value,onChange=_this$props.onChange,min=_this$props.min,max=_this$props.max;if(!onChange){return;}var newRange=[getAbsoluteValue(this.ease(this.state.rangeMin),min,max,true),getAbsoluteValue(this.ease(this.state.rangeMax),min,max,true)];if(newRange!==value){onChange(newRange);}}/**
38
52
  * Renders the component.
39
53
  * @returns {JSX}
40
- */},{key:"render",value:function render(){var _this$props2=this.props,classNames=_this$props2.classNames,animationSpeed=_this$props2.animationSpeed;var speed=Math.round(1000/animationSpeed*this.draggedHandlePixelOffset);var rangeStyle=getRangeStyle(this.state.rangeMin,this.state.rangeMax,speed>10?speed:0);return React.createElement("div",{className:cxs(classNames.container),onMouseDown:this.handleRangeTouch,"aria-hidden":true},React.createElement("div",{className:cxs(classNames.outerRange,styles.outerRange),ref:this.domElement},React.createElement("div",{className:cxs(classNames.range,styles.range),style:rangeStyle},React.createElement(Handle,{index:0,onTouchStart:this.handleTouchStart,active:this.draggedHandle===0,classNames:classNames,useMouseEvents:this.useMouseEvents}),React.createElement(Handle,{index:1,onTouchStart:this.handleTouchStart,active:this.draggedHandle===1,classNames:classNames,useMouseEvents:this.useMouseEvents}))));}},{key:"ease",get:function get(){return{linear:generateLinearEasingCallback(this.props.resolution),exponential:generateExponentialEasingCallback(this.props.factor)}[this.props.easing];}/**
41
- * Get the function to invert an eased value to it's original value.
42
- */},{key:"invertedEase",get:function get(){return{linear:generateLinearEasingCallback(this.props.resolution),exponential:generateExponentialEasingCallback(1/this.props.factor)}[this.props.easing];}}]);return RangeSlider;}(PureComponent);_defineProperty(RangeSlider,"defaultProps",{animationSpeed:500,classNames:{},easing:'linear',factor:2,max:100,min:0,resolution:1,value:[0,100],onChange:null});export default RangeSlider;
54
+ */},{key:"render",value:function render(){var _this$props2=this.props,classNames=_this$props2.classNames,animationSpeed=_this$props2.animationSpeed;var speed=Math.round(1000/animationSpeed*this.draggedHandlePixelOffset);var rangeStyle=getRangeStyle(this.state.rangeMin,this.state.rangeMax,speed>10?speed:0);return React.createElement("div",{className:cxs(classNames.container,'engage__range-slider'),onMouseDown:this.handleRangeTouch,"aria-hidden":true},React.createElement("div",{className:cxs(classNames.outerRange,styles.outerRange),ref:this.domElement},React.createElement("div",{className:cxs(classNames.range,styles.range),style:rangeStyle},React.createElement(Handle,{index:0,onTouchStart:this.handleTouchStart,active:this.draggedHandle===0,classNames:classNames,useMouseEvents:this.useMouseEvents}),React.createElement(Handle,{index:1,onTouchStart:this.handleTouchStart,active:this.draggedHandle===1,classNames:classNames,useMouseEvents:this.useMouseEvents}))));}}]);}(PureComponent);_defineProperty(RangeSlider,"defaultProps",{animationSpeed:500,classNames:{},easing:'linear',factor:2,max:100,min:0,resolution:1,value:[0,100],onChange:null});export default RangeSlider;
@@ -1,10 +1,6 @@
1
- function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import{useMemo,useEffect,useState}from'react';import PropTypes from'prop-types';import{addListener}from"./listener";import{parser}from"./breakpoints";var comparators={'>=':function _(from,to,width){return width>=from;},'>':function _(from,to,width){return width>=to;},'<':function _(from,to,width){return width<from;},'<=':function _(from,to,width){return width<to;},'':function _(from,to,width){return width>=from&&width<to;}};/**
1
+ import PropTypes from'prop-types';import{useResponsiveValue}from"./hooks";/**
2
2
  * Renders a responsive container that allows to render based on width.
3
3
  * @param {Object} props Component props.
4
4
  * @returns {React.Node}
5
- */var ResponsiveContainer=function ResponsiveContainer(_ref){var breakpoint=_ref.breakpoint,webOnly=_ref.webOnly,webAlways=_ref.webAlways,appOnly=_ref.appOnly,appAlways=_ref.appAlways,children=_ref.children;// Active breakpoint used for triggering rerenders on resize.
6
- var _useState=useState(null),_useState2=_slicedToArray(_useState,2),activeBreakpoint=_useState2[0],setActiveBreakpoint=_useState2[1];// Calculate if should render due to visibility.
7
- /* eslint-disable react-hooks/exhaustive-deps */var breakpointSafe=useMemo(function(){var parsed=parser(comparators,breakpoint,{breakpoint:breakpoint,webOnly:webOnly,webAlways:webAlways,appOnly:appOnly,appAlways:appAlways});return parsed;},[activeBreakpoint,breakpoint]);/* eslint-enable react-hooks/exhaustive-deps */ // Watch for resize changes.
8
- useEffect(function(){return addListener(function(newBreakpoint){setActiveBreakpoint(newBreakpoint);});},[]);// Ignore rendering if one of given condition applies.
9
- if(!breakpointSafe){return null;}return children;};ResponsiveContainer.propTypes={appAlways:PropTypes.bool,appOnly:PropTypes.bool,breakpoint:PropTypes.string,// eslint-disable-next-line react/forbid-prop-types
5
+ */var ResponsiveContainer=function ResponsiveContainer(_ref){var breakpoint=_ref.breakpoint,webOnly=_ref.webOnly,webAlways=_ref.webAlways,appOnly=_ref.appOnly,appAlways=_ref.appAlways,children=_ref.children;var render=useResponsiveValue(breakpoint,{webOnly:webOnly,webAlways:webAlways,appOnly:appOnly,appAlways:appAlways});if(!render){return null;}return children;};ResponsiveContainer.propTypes={appAlways:PropTypes.bool,appOnly:PropTypes.bool,breakpoint:PropTypes.string,// eslint-disable-next-line react/forbid-prop-types
10
6
  children:PropTypes.any,webAlways:PropTypes.bool,webOnly:PropTypes.bool};ResponsiveContainer.defaultProps={children:null,breakpoint:'>=xs',appAlways:false,webAlways:false,webOnly:false,appOnly:false};export default ResponsiveContainer;
@@ -1,4 +1,5 @@
1
- import{hasWebBridge,isIOSTheme}from'@shopgate/engage/core';var iosThemeActive=isIOSTheme();/* eslint-disable extra-rules/no-single-line-objects */var breakpoints=[{name:'xs',from:0,to:600},{name:'sm',from:600,to:960},{name:'md',from:960,to:1280},{name:'lg',from:1280,to:1920},{name:'xl',from:1920,to:Number.MAX_VALUE}];/* eslint-enable extra-rules/no-single-line-objects */ /**
1
+ // Ugly imports to avoid breaking tests due to circular dependencies
2
+ import{isIOSTheme}from'@shopgate/engage/core/helpers/isIOSTheme';import{hasWebBridge}from'@shopgate/engage/core/helpers/bridge';var iosThemeActive=isIOSTheme();/* eslint-disable extra-rules/no-single-line-objects */var breakpoints=[{name:'xs',from:0,to:600},{name:'sm',from:600,to:960},{name:'md',from:960,to:1280},{name:'lg',from:1280,to:1920},{name:'xl',from:1920,to:Number.MAX_VALUE}];/* eslint-enable extra-rules/no-single-line-objects */ /**
2
3
  * Generates a media query for different breakpoints and platform.
3
4
  * @param {Object} comparators Comparators.
4
5
  * @param {string} breakpoint Breakpoint rule.
@@ -0,0 +1,20 @@
1
+ function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}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{useState,useMemo,useEffect}from'react';import{addListener}from"./listener";import{parser}from"./breakpoints";var comparators={'>=':function _(from,to,width){return width>=from;},'>':function _(from,to,width){return width>=to;},'<':function _(from,to,width){return width<from;},'<=':function _(from,to,width){return width<to;},'':function _(from,to,width){return width>=from&&width<to;}};/**
2
+ * Custom hook to determine the visibility or value based on the current active breakpoint
3
+ * and provided conditions.
4
+ * It listens for changes in the viewport or platform breakpoints and returns a value.
5
+ *
6
+ * @param {string} [breakpoint=">=xs"] - The breakpoint condition to match (e.g., '>=md', '<lg').
7
+ * @param {Object} [options={}] - Additional options for customizing behavior.
8
+ * @param {*} [options.valueMatch=true] - Return value when the provided conditions match.
9
+ * @param {*} [options.valueMiss=false] - Return value when the provided conditions do not match.
10
+ * @param {boolean} [options.webOnly=false] If true, the hook will only match in PWA website mode.
11
+ * @param {boolean} [options.webAlways=false] If true, the hook will always match in PWA website
12
+ * mode regardless of the breakpoint.
13
+ * @param {boolean} [options.appOnly=false] If true, the hook will only match in PWA app mode.
14
+ * @param {boolean} [options.appAlways=false] If true, the hook will always match in PWA app mode,
15
+ * regardless of the breakpoint.
16
+ * @returns {boolean}
17
+ */export var useResponsiveValue=function useResponsiveValue(){var breakpoint=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'>=xs';var options=arguments.length>1?arguments[1]:undefined;var _valueMatch$valueMiss=_extends({valueMatch:true,valueMiss:false,appAlways:false,appOnly:false,webAlways:false,webOnly:false},options),webOnly=_valueMatch$valueMiss.webOnly,webAlways=_valueMatch$valueMiss.webAlways,appOnly=_valueMatch$valueMiss.appOnly,appAlways=_valueMatch$valueMiss.appAlways,valueMiss=_valueMatch$valueMiss.valueMiss,valueMatch=_valueMatch$valueMiss.valueMatch;// Active breakpoint used for triggering rerenders on resize.
18
+ var _useState=useState(null),_useState2=_slicedToArray(_useState,2),activeBreakpoint=_useState2[0],setActiveBreakpoint=_useState2[1];// Calculate if we have a match for the conditions
19
+ /* eslint-disable react-hooks/exhaustive-deps */var isMatch=useMemo(function(){var parsed=parser(comparators,breakpoint,{breakpoint:breakpoint,webOnly:webOnly,webAlways:webAlways,appOnly:appOnly,appAlways:appAlways});return parsed;},[activeBreakpoint,breakpoint]);/* eslint-enable react-hooks/exhaustive-deps */ // Watch for resize changes.
20
+ useEffect(function(){return addListener(function(newBreakpoint){setActiveBreakpoint(newBreakpoint);});},[]);return isMatch?valueMatch:valueMiss;};
@@ -1,5 +1,5 @@
1
- function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{useState,useContext,useRef,useCallback,useEffect}from'react';import PropTypes from'prop-types';import classNames from'classnames';import get from'lodash/get';import{useScroll,hasWebBridge}from'@shopgate/engage/core';import{header,hidden}from"./style";import{ViewContext}from"../View";/**
1
+ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _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;}import React,{useState,useCallback,useEffect}from'react';import PropTypes from'prop-types';import classNames from'classnames';import{viewScroll$}from'@shopgate/engage/core/streams';import{root,scrolledIn,scrolledOut,transition}from"./style";/**
2
2
  * Scroll Header component
3
3
  * @param {Object} props props
4
4
  * @returns {JSX}
5
- */function ScrollHeader(_ref){var className=_ref.className,children=_ref.children;var ref=useRef();var _useState=useState(false),_useState2=_slicedToArray(_useState,2),shouldHideHeader=_useState2[0],setShouldHideHeader=_useState2[1];var _useContext=useContext(ViewContext),contentRef=_useContext.contentRef;var _useState3=useState(0),_useState4=_slicedToArray(_useState3,2),offset=_useState4[0],setOffset=_useState4[1];var _useState5=useState(0),_useState6=_slicedToArray(_useState5,2),offsetTop=_useState6[0],setOffsetTop=_useState6[1];var onScroll=useCallback(function(callbackData){var previousScrollTop=callbackData.previousScrollTop,currentScrollTop=callbackData.currentScrollTop;if(previousScrollTop!==currentScrollTop){var isScrolledDown=previousScrollTop<currentScrollTop;var box=ref.current.getBoundingClientRect();var stickHeader=currentScrollTop>=offset+100;if(!previousScrollTop){setOffset(currentScrollTop+box.top);}setShouldHideHeader(isScrolledDown&&stickHeader);}},[offset]);useScroll(onScroll,contentRef===null||contentRef===void 0?void 0:contentRef.current);useEffect(function(){if(!hasWebBridge()){var currentOffset=get(ref,'current.offsetTop');setOffsetTop(currentOffset);}},[]);return React.createElement("div",{ref:ref,className:classNames(header,shouldHideHeader&&hidden,className),style:offsetTop?{top:offsetTop}:{}},children);}ScrollHeader.defaultProps={className:null};export default ScrollHeader;
5
+ */function ScrollHeader(_ref){var className=_ref.className,children=_ref.children,hideOnScroll=_ref.hideOnScroll,scrollOffset=_ref.scrollOffset;var _useState=useState(false),_useState2=_slicedToArray(_useState,2),shouldHideHeader=_useState2[0],setShouldHideHeader=_useState2[1];var onScroll=useCallback(function(scrollEvent){var scrollTop=scrollEvent.scrollTop,scrolled=scrollEvent.scrolled,scrollOut=scrollEvent.scrollOut,scrollIn=scrollEvent.scrollIn;if(!scrolled){return;}if(!shouldHideHeader&&scrollOut&&scrollTop>=scrollOffset){setShouldHideHeader(true);}if(shouldHideHeader&&scrollIn){setShouldHideHeader(false);}},[scrollOffset,shouldHideHeader]);useEffect(function(){if(hideOnScroll){var subscription=viewScroll$.subscribe(onScroll);return function(){return subscription.unsubscribe();};}return undefined;});return React.createElement("div",{className:classNames(root,transition,className,_defineProperty(_defineProperty({},scrolledIn,!shouldHideHeader),scrolledOut,shouldHideHeader))},children);}ScrollHeader.defaultProps={className:null,hideOnScroll:true,scrollOffset:100};export default ScrollHeader;
@@ -1 +1 @@
1
- function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{css}from'glamor';import{responsiveMediaQuery}from'@shopgate/engage/styles';export var header=css(_defineProperty({position:'sticky',left:0,backgroundColor:'#fff',transform:'translateY(0)',transition:'transform 0.3s ease'},responsiveMediaQuery('<=xs',{appAlways:true}),{boxShadow:'rgba(0, 0, 0, 0.118) 0px 1px 6px, rgba(0, 0, 0, 0.118) 0px 1px 4px'})).toString();export var hidden=css({transform:'translateY(-250%)'}).toString();
1
+ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{css}from'glamor';import{responsiveMediaQuery}from'@shopgate/engage/styles';export var root=css(_defineProperty({position:'sticky',left:0,backgroundColor:'#fff'},responsiveMediaQuery('<=xs',{appAlways:true}),{boxShadow:'rgba(0, 0, 0, 0.118) 0px 1px 6px, rgba(0, 0, 0, 0.118) 0px 1px 4px'}));export var scrolledIn=css({'&&':{transform:'translateY(0%)'}});export var scrolledOut=css({'&&':{transform:'translateY(-250%)'}});export var transition=css({transition:'transform 0.2s ease,transform 0.2s'});
@@ -1,17 +1,17 @@
1
- function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _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 classNames from'classnames';import{withForwardedRef}from'@shopgate/engage/core';import Grid from'@shopgate/pwa-common/components/Grid';import Link from'@shopgate/pwa-common/components/Link';import Glow from'@shopgate/pwa-ui-shared/Glow';import styles from"./style";/**
1
+ function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{Component}from'react';import PropTypes from'prop-types';import classNames from'classnames';import{withForwardedRef}from'@shopgate/engage/core';import Grid from'@shopgate/pwa-common/components/Grid';import Link from'@shopgate/pwa-common/components/Link';import Glow from'@shopgate/pwa-ui-shared/Glow';import styles from"./style";/**
2
2
  * The list item component.
3
- */var Item=/*#__PURE__*/function(_Component){_inherits(Item,_Component);function Item(){_classCallCheck(this,Item);return _possibleConstructorReturn(this,_getPrototypeOf(Item).apply(this,arguments));}_createClass(Item,[{key:"shouldComponentUpdate",/**
3
+ */var Item=/*#__PURE__*/function(_Component){function Item(){_classCallCheck(this,Item);return _callSuper(this,Item,arguments);}_inherits(Item,_Component);return _createClass(Item,[{key:"shouldComponentUpdate",value:/**
4
4
  * Should only update what the `selected` or `disabled` props change.
5
5
  * @param {Object} nextProps The next set of component props.
6
6
  * @returns {JSX}
7
- */value:function shouldComponentUpdate(nextProps){return this.props.isSelected!==nextProps.isSelected||this.props.isDisabled!==nextProps.isDisabled;}/**
7
+ */function shouldComponentUpdate(nextProps){return this.props.isSelected!==nextProps.isSelected||this.props.isDisabled!==nextProps.isDisabled;}/**
8
8
  * Renders the bulk of the content.
9
9
  * @param {boolean} [isNested=true] Tells if the content is rendered nested.
10
10
  * @returns {JSX}
11
- */},{key:"renderContent",value:function renderContent(){var _gridStyles,_titleStyles;var isNested=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;var _this$props=this.props,isDisabled=_this$props.isDisabled,isSelected=_this$props.isSelected,title=_this$props.title,image=_this$props.image,rightComponent=_this$props.rightComponent,forwardedRef=_this$props.forwardedRef,description=_this$props.description;var gridStyles=(_gridStyles={},_defineProperty(_gridStyles,styles.grid,true),_defineProperty(_gridStyles,styles.selected,isSelected),_gridStyles);var titleStyles=(_titleStyles={},_defineProperty(_titleStyles,styles.title,true),_defineProperty(_titleStyles,styles.disabled,isDisabled),_titleStyles);var ref=isNested?null:forwardedRef;return React.createElement("div",{"data-test-id":this.props.testId,ref:ref},React.createElement(Grid,{className:classNames(gridStyles),component:"div"},image!==null&&React.createElement("div",{className:styles.image},image),React.createElement(Grid.Item,{className:classNames(titleStyles),component:"div",grow:1},React.createElement("div",null,title),description&&React.createElement("div",{className:styles.description,dangerouslySetInnerHTML:{__html:description}})),rightComponent!==null&&React.createElement(Grid.Item,{component:"div",grow:1},rightComponent)));}/**
11
+ */},{key:"renderContent",value:function renderContent(){var isNested=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;var _this$props=this.props,isDisabled=_this$props.isDisabled,isSelected=_this$props.isSelected,title=_this$props.title,image=_this$props.image,rightComponent=_this$props.rightComponent,forwardedRef=_this$props.forwardedRef,description=_this$props.description;var gridStyles=_defineProperty(_defineProperty({},styles.grid,true),styles.selected,isSelected);var titleStyles=_defineProperty(_defineProperty({},styles.title,true),styles.disabled,isDisabled);var ref=isNested?null:forwardedRef;return React.createElement("div",{"data-test-id":this.props.testId,ref:ref,className:"engage__sheet-list__item"},React.createElement(Grid,{className:classNames(gridStyles),component:"div"},image!==null&&React.createElement("div",{className:styles.image},image),React.createElement(Grid.Item,{className:classNames(titleStyles),component:"div",grow:1},React.createElement("div",null,title),description&&React.createElement("div",{className:styles.description,dangerouslySetInnerHTML:{__html:description}})),rightComponent!==null&&React.createElement(Grid.Item,{component:"div",grow:1},rightComponent)));}/**
12
12
  * @returns {JSX}
13
13
  */},{key:"render",value:function render(){var _this$props2=this.props,link=_this$props2.link,linkState=_this$props2.linkState,LinkComponent=_this$props2.linkComponent,onClick=_this$props2.onClick,className=_this$props2.className,isDisabled=_this$props2.isDisabled,testId=_this$props2.testId,forwardedRef=_this$props2.forwardedRef,isSelected=_this$props2.isSelected;/**
14
14
  * If this item is disabled, selected or doesn't have a valid
15
15
  * link or click handler then wrap the content with other components.
16
16
  */if(isDisabled||!link&&!onClick){return this.renderContent(false);}// Wrap with a <Link> if the `link` prop is set.
17
- if(link){return React.createElement(Glow,{ref:forwardedRef,className:className,styles:{hover:styles.glowHover}},React.createElement(LinkComponent,{href:link,onClick:onClick,state:linkState,tabIndex:0},this.renderContent()));}return React.createElement("div",{onKeyPress:function onKeyPress(){},onClick:onClick,"data-test-id":testId,ref:forwardedRef,tabIndex:0,role:"option","aria-selected":isSelected},React.createElement(Glow,{className:className,styles:{hover:styles.glowHover}},this.renderContent()));}}]);return Item;}(Component);_defineProperty(Item,"defaultProps",{className:null,description:null,forwardedRef:null,image:null,isDisabled:false,isSelected:false,link:null,linkState:null,onClick:null,rightComponent:null,linkComponent:Link,testId:null});export default withForwardedRef(Item);
17
+ if(link){return React.createElement(Glow,{ref:forwardedRef,className:className,styles:{hover:styles.glowHover}},React.createElement(LinkComponent,{href:link,onClick:onClick,state:linkState,tabIndex:0},this.renderContent()));}return React.createElement("div",{onKeyPress:function onKeyPress(){},onClick:onClick,"data-test-id":testId,ref:forwardedRef,tabIndex:0,role:"option","aria-selected":isSelected},React.createElement(Glow,{className:className,styles:{hover:styles.glowHover}},this.renderContent()));}}]);}(Component);_defineProperty(Item,"defaultProps",{className:null,description:null,forwardedRef:null,image:null,isDisabled:false,isSelected:false,link:null,linkState:null,onClick:null,rightComponent:null,linkComponent:Link,testId:null});export default withForwardedRef(Item);
@@ -1,9 +1,9 @@
1
- function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _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 classNames from'classnames';import List from'@shopgate/pwa-common/components/List';import Item from"./components/Item";import styles from"./style";/**
1
+ function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{Component}from'react';import PropTypes from'prop-types';import classNames from'classnames';import List from'@shopgate/pwa-common/components/List';import Item from"./components/Item";import styles from"./style";/**
2
2
  * The SheetList component.
3
3
  * Styled sheet for List component
4
- */var SheetList=/*#__PURE__*/function(_Component){_inherits(SheetList,_Component);function SheetList(){_classCallCheck(this,SheetList);return _possibleConstructorReturn(this,_getPrototypeOf(SheetList).apply(this,arguments));}_createClass(SheetList,[{key:"render",/**
4
+ */var SheetList=/*#__PURE__*/function(_Component){function SheetList(){_classCallCheck(this,SheetList);return _callSuper(this,SheetList,arguments);}_inherits(SheetList,_Component);return _createClass(SheetList,[{key:"render",value:/**
5
5
  * Renders the component.
6
6
  * @returns {JSX}
7
- */value:function render(){var _itemClasses;var _this$props=this.props,children=_this$props.children,className=_this$props.className,hasImages=_this$props.hasImages,testId=_this$props.testId;if(!React.Children.count(children)){return null;}var itemClasses=(_itemClasses={},_defineProperty(_itemClasses,styles.item,true),_defineProperty(_itemClasses,styles.itemWithImage,hasImages),_itemClasses);return React.createElement(List,{className:className,role:"listbox"},React.Children.map(children,function(child,index){var _childClasses;if(!React.isValidElement(child)){return null;}// The key for each child.
7
+ */function render(){var _this$props=this.props,children=_this$props.children,className=_this$props.className,hasImages=_this$props.hasImages,testId=_this$props.testId;if(!React.Children.count(children)){return null;}var itemClasses=_defineProperty(_defineProperty({},styles.item,true),styles.itemWithImage,hasImages);return React.createElement(List,{className:"".concat(className," engage__sheet-list"),role:"listbox"},React.Children.map(children,function(child,index){if(!React.isValidElement(child)){return null;}// The key for each child.
8
8
  var key="child-".concat(index);// Selected state for the child.
9
- var isSelected=child.props.isSelected;var childClasses=(_childClasses={},_defineProperty(_childClasses,styles.itemSelected,isSelected),_defineProperty(_childClasses,styles.itemNotLast,!isSelected),_childClasses);return React.createElement(List.Item,{className:classNames(itemClasses,childClasses),isSelected:isSelected,key:key,tabIndex:0},React.createElement("div",{className:styles.innerContainer,"data-test-id":testId},child));}));}}]);return SheetList;}(Component);_defineProperty(SheetList,"Item",Item);_defineProperty(SheetList,"defaultProps",{children:null,className:null,hasImages:false,testId:null});export default SheetList;
9
+ var isSelected=child.props.isSelected;var childClasses=_defineProperty(_defineProperty({},styles.itemSelected,isSelected),styles.itemNotLast,!isSelected);return React.createElement(List.Item,{className:classNames(itemClasses,childClasses),isSelected:isSelected,key:key,tabIndex:0},React.createElement("div",{className:styles.innerContainer,"data-test-id":testId},child));}));}}]);}(Component);_defineProperty(SheetList,"Item",Item);_defineProperty(SheetList,"defaultProps",{children:null,className:null,hasImages:false,testId:null});export default SheetList;
@@ -1,8 +1,8 @@
1
- import{connect}from'react-redux';import _fetchCategory from'@shopgate/pwa-common-commerce/category/actions/getCategory';import{makeGetAreRootCategoriesFetching,makeGetSubcategoriesByCategoryId}from"./selectors";/**
1
+ import{connect}from'react-redux';import{fetchCategoryOrRootCategories}from'@shopgate/engage/category';import{makeGetAreRootCategoriesFetching,makeGetSubcategoriesByCategoryId}from"./selectors";/**
2
2
  * Creates the mapStateToProps connector function.
3
3
  * @returns {Function}
4
4
  */var makeMapStateToProps=function makeMapStateToProps(){var getAreRootCategoriesFetching=makeGetAreRootCategoriesFetching();var getSubcategoriesByCategoryId=makeGetSubcategoriesByCategoryId();return function(state,_ref){var categoryId=_ref.categoryId;return{rootCategoriesFetching:getAreRootCategoriesFetching(state),subcategories:getSubcategoriesByCategoryId(state,{categoryId:categoryId})};};};/**
5
5
  * Maps the contents of the state to the component props.
6
6
  * @param {Function} dispatch The redux dispatch function.
7
7
  * @return {Object} The extended component props.
8
- */var mapDispatchToProps=function mapDispatchToProps(dispatch){return{fetchCategory:function fetchCategory(id){return dispatch(_fetchCategory(id));}};};export default connect(makeMapStateToProps,mapDispatchToProps);
8
+ */var mapDispatchToProps=function mapDispatchToProps(dispatch){return{fetchCategory:function fetchCategory(id){return dispatch(fetchCategoryOrRootCategories(id));}};};export default connect(makeMapStateToProps,mapDispatchToProps);
@@ -0,0 +1,5 @@
1
+ import React from'react';import{createPortal}from'react-dom';import{SnackBar}from'@shopgate/pwa-ui-material';/**
2
+ * The SnackBarContainer component.
3
+ * @param {Object} props The component props.
4
+ * @returns {JSX}
5
+ */function SnackBarContainer(props){if(!props.toasts.length){return null;}return createPortal(React.createElement(SnackBar,props),document.getElementById('portals'));}export default SnackBarContainer;
@@ -0,0 +1,12 @@
1
+ import React,{useMemo}from'react';import PropTypes from'prop-types';import{VisuallyHidden}from'@shopgate/engage/a11y/components';import styles from"./style";/**
2
+ * The Switch component.
3
+ * @param {Object} props The component props.
4
+ * @param {React.ReactNode} [children=null] Component children are rendered as the checkbox label
5
+ * @param {boolean} [props.checked=false] Whether the checkbox is checked
6
+ * @param {boolean} [props.disabled=false] Whether the checkbox is disabled
7
+ * @param {Function} [props.onChange] Callback invoked when the checkbox changes
8
+ * @param {string} [props.a11yFallbackText=null] Optional text to be presented to screen readers
9
+ * when issues with the regular label are expected e.g. due to problematic layout.
10
+ * @param {string} [props.id=null] Optional custom id for checkbox input and label
11
+ * @returns {JSX.Element}
12
+ */var Switch=function Switch(_ref){var disabled=_ref.disabled,checked=_ref.checked,onChange=_ref.onChange,id=_ref.id,a11yFallbackText=_ref.a11yFallbackText,children=_ref.children;var switchId=useMemo(function(){return id||Math.random();},[id]);return React.createElement("div",{className:styles.container},React.createElement("input",{type:"checkbox",disabled:disabled,checked:checked,onChange:onChange,className:styles.input,id:switchId}),children&&React.createElement("label",{htmlFor:switchId},React.createElement("span",{"aria-hidden":!!a11yFallbackText},children),a11yFallbackText&&React.createElement(VisuallyHidden,null,a11yFallbackText)));};Switch.defaultProps={children:null,disabled:false,a11yFallbackText:null,checked:false,onChange:null,id:null};export default Switch;
@@ -0,0 +1 @@
1
+ import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var container=css({display:'flex',flex:1,textAlign:'left',justifyContent:'space-between',flexDirection:'row-reverse',gap:'32px'});var input=css({display:'flex',flexShrink:0,appearance:'none',width:'40px',height:'20px',backgroundColor:'#ccc',borderRadius:'10px',position:'relative',cursor:'pointer',':before':{content:'""',position:'absolute',top:'2px',left:'2px',width:'16px',height:'16px',backgroundColor:'white',borderRadius:'50%',transition:'transform 0.3s'},':checked':{backgroundColor:themeConfig.colors.accent},':checked::before':{transform:'translateX(20px)'},':disabled':{backgroundColor:themeConfig.colors.shade7,cursor:'not-allowed'}});export default{container:container,input:input};
@@ -1,5 +1,5 @@
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 _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import*as React from'react';import PropTypes from'prop-types';import classNames from'classnames';import{root}from"./TabIndicator.style";/**
1
+ var _excluded=["className"];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 _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import*as React from'react';import PropTypes from'prop-types';import classNames from'classnames';import{root}from"./TabIndicator.style";/**
2
2
  * Tab indicator component
3
3
  * @param {Object} props props
4
4
  * @returns {JSX}
5
- */var TabIndicator=function TabIndicator(_ref){var className=_ref.className,other=_objectWithoutProperties(_ref,["className"]);return React.createElement("span",_extends({className:classNames(root,className)},other));};TabIndicator.defaultProps={className:null};export default TabIndicator;
5
+ */var TabIndicator=function TabIndicator(_ref){var className=_ref.className,other=_objectWithoutProperties(_ref,_excluded);return React.createElement("span",_extends({className:classNames(root,className)},other));};TabIndicator.defaultProps={className:null};export default TabIndicator;
@@ -6,6 +6,6 @@ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj
6
6
  * Get Tabs Meta
7
7
  * @returns {Object}
8
8
  */var getTabsMeta=function getTabsMeta(){var tabsNode=tabsRef.current;var tabsMeta;if(tabsNode){var rect=tabsNode.getBoundingClientRect();// create a new object with ClientRect class props + scrollLeft
9
- tabsMeta={clientWidth:tabsNode.clientWidth,top:rect.top,bottom:rect.bottom,left:rect.left,right:rect.right};}var tabMeta;if(tabsNode&&value!==false){var _children=tabListRef.current.children;if(_children.length>0){var tab=_children[valueToIndex.get(value)];tabMeta=tab?tab.getBoundingClientRect():null;}}return{tabsMeta:tabsMeta,tabMeta:tabMeta};};var updateIndicatorState=useEventCallback(function(){var _newIndicatorStyle;var _getTabsMeta=getTabsMeta(),tabsMeta=_getTabsMeta.tabsMeta,tabMeta=_getTabsMeta.tabMeta;var startValue=0;if(tabMeta&&tabsMeta){startValue=tabMeta.left-tabsMeta.left;}var newIndicatorStyle=(_newIndicatorStyle={},_defineProperty(_newIndicatorStyle,start,startValue),_defineProperty(_newIndicatorStyle,size,tabMeta?tabMeta[size]:0),_newIndicatorStyle);// IE 11 support, replace with Number.isNaN
9
+ tabsMeta={clientWidth:tabsNode.clientWidth,top:rect.top,bottom:rect.bottom,left:rect.left,right:rect.right};}var tabMeta;if(tabsNode&&value!==false){var _children=tabListRef.current.children;if(_children.length>0){var tab=_children[valueToIndex.get(value)];tabMeta=tab?tab.getBoundingClientRect():null;}}return{tabsMeta:tabsMeta,tabMeta:tabMeta};};var updateIndicatorState=useEventCallback(function(){var _getTabsMeta=getTabsMeta(),tabsMeta=_getTabsMeta.tabsMeta,tabMeta=_getTabsMeta.tabMeta;var startValue=0;if(tabMeta&&tabsMeta){startValue=tabMeta.left-tabsMeta.left;}var newIndicatorStyle=_defineProperty(_defineProperty({},start,startValue),size,tabMeta?tabMeta[size]:0);// IE 11 support, replace with Number.isNaN
10
10
  // eslint-disable-next-line no-restricted-globals
11
11
  if(isNaN(indicatorStyle[start])||isNaN(indicatorStyle[size])){setIndicatorStyle(newIndicatorStyle);}else{var dStart=Math.abs(indicatorStyle[start]-newIndicatorStyle[start]);var dSize=Math.abs(indicatorStyle[size]-newIndicatorStyle[size]);if(dStart>=1||dSize>=1){setIndicatorStyle(newIndicatorStyle);}}});React.useEffect(function(){var handleResize=debounce(function(){updateIndicatorState();});var win=ownerWindow(tabsRef.current);win.addEventListener('resize',handleResize);return function(){handleResize.clear();win.removeEventListener('resize',handleResize);};},[updateIndicatorState]);React.useEffect(function(){setMounted(true);},[]);React.useEffect(function(){updateIndicatorState();});var indicator=React.createElement(TabIndicator,{style:indicatorStyle});var childIndex=0;var children=React.Children.map(childrenProp,function(child){if(!React.isValidElement(child)){return null;}var childValue=child.props.value===undefined?childIndex:child.props.value;valueToIndex.set(childValue,childIndex);var selected=childValue===value;childIndex+=1;return React.cloneElement(child,{indicator:selected&&!mounted&&indicator,selected:selected,onChange:onChange,value:childValue});});return React.createElement("div",{className:classNames(root,className)},React.createElement("div",{className:classNames(fixed),ref:tabsRef},React.createElement("div",{className:classNames(flexContainer),ref:tabListRef,role:"tablist"},children),mounted&&indicator));};Tabs.defaultProps={className:null};export default Tabs;
@@ -1,4 +1,4 @@
1
- import _isEqual from"lodash/isEqual";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 _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}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,Fragment}from'react';import PropTypes from'prop-types';import{isBefore,isAfter,isBetween}from'@shopgate/pwa-common/helpers/date';import{second$}from'@shopgate/pwa-common/streams/interval';/**
1
+ import _isEqual from"lodash/isEqual";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,Fragment}from'react';import PropTypes from'prop-types';import{isBefore,isAfter,isBetween}from'@shopgate/pwa-common/helpers/date';import{second$}from'@shopgate/pwa-common/streams/interval';/**
2
2
  * The TimeBoundary component.
3
3
  * @example
4
4
  * <TimeBoundary
@@ -9,13 +9,15 @@ import _isEqual from"lodash/isEqual";function _typeof(obj){if(typeof Symbol==="f
9
9
  {between && <div>Content is inside time boundary</div>}
10
10
  )}
11
11
  * </TimeBoundary>
12
- */var TimeBoundary=/*#__PURE__*/function(_Component){_inherits(TimeBoundary,_Component);function TimeBoundary(props){var _this;_classCallCheck(this,TimeBoundary);_this=_possibleConstructorReturn(this,_getPrototypeOf(TimeBoundary).call(this,props));_defineProperty(_assertThisInitialized(_this),"clear",function(){if(_this.intervalSubscription){_this.intervalSubscription.unsubscribe();}});_defineProperty(_assertThisInitialized(_this),"checkBoundary",function(){var now=new Date(Date.now());var newState={before:isBefore(now,_this.props.start),between:isBetween(now,_this.props.start,_this.props.end),after:isAfter(now,_this.props.end)};if(_isEqual(newState,_this.state)){return;}_this.setState(newState);if(newState.after){// already after, stop timer
13
- _this.clear();}});_this.state={before:false,between:false,after:false};return _this;}/**
12
+ */var TimeBoundary=/*#__PURE__*/function(_Component){function TimeBoundary(props){var _this2;_classCallCheck(this,TimeBoundary);_this2=_callSuper(this,TimeBoundary,[props]);/** Clear interval if valid */_defineProperty(_this2,"clear",function(){if(_this2.intervalSubscription){_this2.intervalSubscription.unsubscribe();}});/**
13
+ * Check time boundary.
14
+ */_defineProperty(_this2,"checkBoundary",function(){var now=new Date(Date.now());var newState={before:isBefore(now,_this2.props.start),between:isBetween(now,_this2.props.start,_this2.props.end),after:isAfter(now,_this2.props.end)};if(_isEqual(newState,_this2.state)){return;}_this2.setState(newState);if(newState.after){// already after, stop timer
15
+ _this2.clear();}});_this2.state={before:false,between:false,after:false};return _this2;}/**
14
16
  * @inheritDoc
15
- */_createClass(TimeBoundary,[{key:"componentDidMount",value:function componentDidMount(){this.intervalSubscription=second$.subscribe(this.checkBoundary);this.checkBoundary();}/**
17
+ */_inherits(TimeBoundary,_Component);return _createClass(TimeBoundary,[{key:"componentDidMount",value:function componentDidMount(){this.intervalSubscription=second$.subscribe(this.checkBoundary);this.checkBoundary();}/**
16
18
  * @inheritDoc
17
- */},{key:"componentWillUnmount",value:function componentWillUnmount(){this.clear();}/** Clear interval if valid */},{key:"render",/**
19
+ */},{key:"componentWillUnmount",value:function componentWillUnmount(){this.clear();}},{key:"render",value:/**
18
20
  * @returns {JSX}
19
- */value:function render(){return React.createElement(Fragment,null,this.props.children(this.state));}}]);return TimeBoundary;}(Component);_defineProperty(TimeBoundary,"defaultProps",{end:null,start:null/**
21
+ */function render(){return React.createElement(Fragment,null,this.props.children(this.state));}}]);}(Component);_defineProperty(TimeBoundary,"defaultProps",{end:null,start:null/**
20
22
  * @inheritDoc
21
23
  */});export default TimeBoundary;
@@ -1,14 +1,17 @@
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 _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}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,{PureComponent}from'react';import ReactPlayer from'react-player';import{UIEvents}from'@shopgate/pwa-core';import{UI_VISIBILITY_CHANGE}from'@shopgate/pwa-common/constants/ui';/**
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,{PureComponent}from'react';import ReactPlayer from'react-player';import{UIEvents}from'@shopgate/pwa-core';import{UI_VISIBILITY_CHANGE}from'@shopgate/pwa-common/constants/ui';/**
2
2
  * Video player component
3
3
  * @param {Object} props props
4
4
  * @returns {JSX}
5
- */var VideoPlayer=/*#__PURE__*/function(_PureComponent){_inherits(VideoPlayer,_PureComponent);function VideoPlayer(){var _getPrototypeOf2;var _this;_classCallCheck(this,VideoPlayer);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_possibleConstructorReturn(this,(_getPrototypeOf2=_getPrototypeOf(VideoPlayer)).call.apply(_getPrototypeOf2,[this].concat(args)));_defineProperty(_assertThisInitialized(_this),"state",{ready:false,playing:_this.props.playing,userPaused:false/**
5
+ */var VideoPlayer=/*#__PURE__*/function(_PureComponent){function VideoPlayer(){var _this2;_classCallCheck(this,VideoPlayer);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this2=_callSuper(this,VideoPlayer,[].concat(args));_defineProperty(_this2,"state",{ready:false,playing:_this2.props.playing,userPaused:false/**
6
6
  * @inheritDoc
7
- */});_defineProperty(_assertThisInitialized(_this),"getPlayingState",function(){return _this.state.ready&&!_this.state.userPaused&&_this.state.playing;});_defineProperty(_assertThisInitialized(_this),"handleReady",function(){_this.setState({ready:true});});_defineProperty(_assertThisInitialized(_this),"handleError",function(error){if(error&&error.name==='NotAllowedError'){_this.setState({playing:false});}});_defineProperty(_assertThisInitialized(_this),"handlePause",function(){// Check if was not paused programmatically
8
- if(_this.state.playing){_this.setState({userPaused:true,playing:false});}});_defineProperty(_assertThisInitialized(_this),"handlePlay",function(){if(!_this.state.playing){_this.setState({userPaused:false,playing:true});}});_defineProperty(_assertThisInitialized(_this),"handleVisibilityChange",function(){_this.setState({playing:false});});return _this;}_createClass(VideoPlayer,[{key:"componentDidMount",value:function componentDidMount(){UIEvents.addListener(UI_VISIBILITY_CHANGE,this.handleVisibilityChange);}/**
7
+ */});/** @returns {boolean} */_defineProperty(_this2,"getPlayingState",function(){return _this2.state.ready&&!_this2.state.userPaused&&_this2.state.playing;});/** @returns {void} */_defineProperty(_this2,"handleReady",function(){_this2.setState({ready:true});});/**
8
+ * Not allowed autoplay error (User gesture permission)
9
+ * @param {Object} error error
10
+ */_defineProperty(_this2,"handleError",function(error){if(error&&error.name==='NotAllowedError'){_this2.setState({playing:false});}});/** @returns {undefined} */_defineProperty(_this2,"handlePause",function(){// Check if was not paused programmatically
11
+ if(_this2.state.playing){_this2.setState({userPaused:true,playing:false});}});/** @returns {undefined} */_defineProperty(_this2,"handlePlay",function(){if(!_this2.state.playing){_this2.setState({userPaused:false,playing:true});}});/** @returns {undefined} */_defineProperty(_this2,"handleVisibilityChange",function(){_this2.setState({playing:false});});return _this2;}_inherits(VideoPlayer,_PureComponent);return _createClass(VideoPlayer,[{key:"componentDidMount",value:function componentDidMount(){UIEvents.addListener(UI_VISIBILITY_CHANGE,this.handleVisibilityChange);}/**
9
12
  * @inheritDoc
10
13
  */},{key:"UNSAFE_componentWillReceiveProps",value:function UNSAFE_componentWillReceiveProps(nextProps){var nextState={playing:nextProps.playing};if(this.props.url!==nextProps.url){nextState.ready=false;}this.setState(nextState);}/**
11
14
  * @inheritDoc
12
- */},{key:"componentWillUnmount",value:function componentWillUnmount(){UIEvents.removeListener(UI_VISIBILITY_CHANGE,this.handleVisibilityChange);}/** @returns {boolean} */},{key:"render",/**
15
+ */},{key:"componentWillUnmount",value:function componentWillUnmount(){UIEvents.removeListener(UI_VISIBILITY_CHANGE,this.handleVisibilityChange);}},{key:"render",value:/**
13
16
  * @returns {JSX}
14
- */value:function render(){return React.createElement(ReactPlayer,_extends({playsinline:true},this.props,{playing:this.getPlayingState(),onReady:this.handleReady,onPause:this.handlePause,onPlay:this.handlePlay,onError:this.handleError}));}}]);return VideoPlayer;}(PureComponent);_defineProperty(VideoPlayer,"defaultProps",ReactPlayer.defaultProps);export default VideoPlayer;
17
+ */function render(){return React.createElement(ReactPlayer,_extends({playsinline:true},this.props,{playing:this.getPlayingState(),onReady:this.handleReady,onPause:this.handlePause,onPlay:this.handlePlay,onError:this.handleError}));}}]);}(PureComponent);_defineProperty(VideoPlayer,"defaultProps",ReactPlayer.defaultProps);export default VideoPlayer;
@@ -1,3 +1,3 @@
1
1
  import React from'react';import{ViewContext}from"../../context";/**
2
2
  * @returns {JSX}
3
- */function ViewAbove(){return React.createElement(ViewContext.Consumer,null,function(_ref){var top=_ref.top;if(!top){return null;}var styles={flexShrink:0,height:"calc(".concat(top,"px + var(--safe-area-inset-top))")};return React.createElement("div",{"aria-hidden":true,style:styles});});}export default ViewAbove;
3
+ */function ViewAbove(){return React.createElement(ViewContext.Consumer,null,function(_ref){var top=_ref.top;if(!top){return null;}var styles={flexShrink:0,height:"calc(".concat(top,"px + var(--safe-area-inset-top))")};return React.createElement("div",{"aria-hidden":true,style:styles,className:"engage__view__above"});});}export default ViewAbove;