@shopgate/engage 6.21.0 → 6.22.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 (184) hide show
  1. package/app-rating/action-creators/appStart.js +3 -3
  2. package/app-rating/action-creators/ordersPlaced.js +3 -3
  3. package/app-rating/action-creators/popup.js +4 -4
  4. package/app-rating/action-creators/timer.js +3 -3
  5. package/app-rating/actions/showModal.js +2 -2
  6. package/app-rating/constants/index.js +2 -2
  7. package/app-rating/reducers/index.js +2 -2
  8. package/app-rating/subscriptions/index.js +2 -2
  9. package/back-in-stock/actions/index.js +14 -0
  10. package/back-in-stock/components/BackInStockButton/connector.js +1 -0
  11. package/back-in-stock/components/BackInStockButton/index.js +13 -0
  12. package/back-in-stock/components/BackInStockButton/style.js +1 -0
  13. package/back-in-stock/components/CharacteristicsButton/connector.js +3 -0
  14. package/back-in-stock/components/CharacteristicsButton/index.js +8 -0
  15. package/back-in-stock/components/ProductInfoBackInStockButton/connector.js +3 -0
  16. package/back-in-stock/components/ProductInfoBackInStockButton/index.js +10 -0
  17. package/back-in-stock/components/Subscriptions/components/List/index.js +4 -0
  18. package/back-in-stock/components/Subscriptions/components/Subscription/index.js +7 -0
  19. package/back-in-stock/components/Subscriptions/index.js +4 -0
  20. package/back-in-stock/components/index.js +1 -0
  21. package/back-in-stock/constants/Actions.js +1 -0
  22. package/back-in-stock/constants/Common.js +1 -0
  23. package/back-in-stock/constants/Pipelines.js +1 -0
  24. package/back-in-stock/constants/Portals.js +9 -0
  25. package/back-in-stock/constants/index.js +1 -0
  26. package/back-in-stock/hooks/index.js +4 -0
  27. package/back-in-stock/providers/BackInStockSubscriptionsProvider.connector.js +7 -0
  28. package/back-in-stock/providers/BackInStockSubscriptionsProvider.context.js +1 -0
  29. package/back-in-stock/providers/BackInStockSubscriptionsProvider.js +5 -0
  30. package/back-in-stock/providers/index.js +1 -0
  31. package/back-in-stock/reducers/index.js +5 -0
  32. package/back-in-stock/selectors/index.js +42 -0
  33. package/back-in-stock/streams/index.js +1 -0
  34. package/back-in-stock/subscriptions/index.js +11 -0
  35. package/components/index.js +1 -1
  36. package/core/action-creators/appPermissions.js +9 -0
  37. package/core/action-creators/index.js +1 -0
  38. package/core/actions/getGeolocation.js +1 -1
  39. package/core/actions/grantCameraPermissions.js +1 -1
  40. package/core/actions/grantGeolocationPermissions.js +1 -1
  41. package/core/actions/grantPermissions.js +11 -4
  42. package/core/actions/grantPushPermissions.js +22 -0
  43. package/core/actions/index.js +1 -0
  44. package/core/actions/requestAppPermission.js +7 -0
  45. package/core/actions/requestAppPermissionStatus.js +7 -0
  46. package/core/collections/AppInitialization.js +49 -0
  47. package/core/collections/index.js +1 -0
  48. package/core/constants/actionTypes.js +1 -0
  49. package/core/constants/appFeatures.js +1 -0
  50. package/core/constants/index.js +6 -0
  51. package/core/helpers/appFeatures.js +7 -0
  52. package/core/helpers/index.js +1 -0
  53. package/core/index.js +8 -12
  54. package/core/initialization/index.js +7 -0
  55. package/core/streams/appPermissions.js +19 -0
  56. package/core/streams/index.js +1 -0
  57. package/package.json +7 -7
  58. package/product/components/Characteristics/Characteristic/components/Sheet/index.js +2 -2
  59. package/product/components/Characteristics/Characteristic/components/SheetItem/index.js +3 -3
  60. package/product/components/Characteristics/Characteristic/components/SheetItem/style.js +1 -1
  61. package/product/index.js +1 -1
  62. package/product/selectors/product.js +5 -1
  63. package/product/selectors/variants.js +2 -2
  64. package/push-opt-in/action-creators/index.js +1 -0
  65. package/push-opt-in/action-creators/optInTrigger.js +23 -0
  66. package/push-opt-in/action-creators/pushOptIn.js +7 -0
  67. package/push-opt-in/actions/index.js +1 -0
  68. package/push-opt-in/actions/pushOptInModal.js +8 -0
  69. package/push-opt-in/components/PushOptInModal/connector.js +9 -0
  70. package/push-opt-in/components/PushOptInModal/index.js +10 -0
  71. package/push-opt-in/components/PushOptInModal/push-opt-in.svg +62 -0
  72. package/push-opt-in/components/PushOptInModal/style.js +1 -0
  73. package/push-opt-in/components/index.js +1 -0
  74. package/push-opt-in/constants/index.js +1 -0
  75. package/push-opt-in/constants/optInModal.js +1 -0
  76. package/push-opt-in/constants/optInTrigger.js +1 -0
  77. package/push-opt-in/reducers/index.js +1 -0
  78. package/push-opt-in/reducers/optInModal.js +6 -0
  79. package/push-opt-in/reducers/optInTrigger.js +6 -0
  80. package/push-opt-in/selectors/index.js +1 -0
  81. package/push-opt-in/selectors/optInModal.js +8 -0
  82. package/push-opt-in/selectors/optInTrigger.js +5 -0
  83. package/push-opt-in/subscriptions/index.js +1 -0
  84. package/push-opt-in/subscriptions/optInTrigger.js +12 -0
  85. package/a11y/components/LiveMessage/__tests__/index.spec.js +0 -1
  86. package/a11y/components/LiveMessenger/__tests__/helpers.spec.js +0 -1
  87. package/a11y/components/LiveMessenger/__tests__/index.spec.js +0 -1
  88. package/a11y/components/Navigation/__tests__/index.spec.js +0 -1
  89. package/a11y/components/Section/__tests__/index.spec.js +0 -1
  90. package/a11y/index.spec.js +0 -1
  91. package/cart/index.spec.js +0 -1
  92. package/category/index.spec.js +0 -1
  93. package/checkout/index.spec.js +0 -1
  94. package/components/Footer/__tests__/Footer.spec.js +0 -8
  95. package/components/Form/Builder/Builder.spec.js +0 -19
  96. package/components/Form/Builder/classes/ActionListener.spec.js +0 -21
  97. package/components/Form/Builder/helpers/buildCountryList.spec.js +0 -1
  98. package/components/Form/Builder/helpers/buildFormDefaults.spec.js +0 -1
  99. package/components/Form/Builder/helpers/buildFormElements.spec.js +0 -3
  100. package/components/Form/Builder/helpers/buildProvinceList.spec.js +0 -1
  101. package/components/IntersectionVisibility/__tests__/index.js +0 -1
  102. package/components/View/__mocks__/context.js +0 -1
  103. package/components/View/__mocks__/index.js +0 -5
  104. package/components/View/__tests__/index.spec.js +0 -1
  105. package/components/View/__tests__/provider.spec.js +0 -1
  106. package/components/View/components/Above/__tests__/index.spec.js +0 -1
  107. package/components/View/components/Below/__tests__/index.spec.js +0 -1
  108. package/components/View/components/Content/__tests__/index.spec.js +0 -2
  109. package/components/__mocks__/index.js +0 -4
  110. package/components/index.spec.js +0 -1
  111. package/core/actions/__tests__/getGeolocation.spec.js +0 -2
  112. package/core/actions/__tests__/grantCameraPermissions.spec.js +0 -1
  113. package/core/actions/__tests__/grantGeolocationPermissions.spec.js +0 -1
  114. package/core/actions/__tests__/grantPermissions.spec.js +0 -9
  115. package/core/actions/__tests__/updateStatusBarBackground.spec.js +0 -1
  116. package/core/classes/__tests__/GeolocationRequest.spec.js +0 -5
  117. package/core/config/__tests__/getPageConfig.spec.js +0 -1
  118. package/core/config/__tests__/getPageSettings.spec.js +0 -2
  119. package/core/config/__tests__/getThemeAssets.spec.js +0 -1
  120. package/core/config/__tests__/getThemeColors.spec.js +0 -1
  121. package/core/config/__tests__/getThemeConfig.spec.js +0 -2
  122. package/core/config/__tests__/getThemeSettings.spec.js +0 -1
  123. package/core/config/__tests__/getThemeStyles.spec.js +0 -1
  124. package/core/config/__tests__/getWidgetConfig.spec.js +0 -1
  125. package/core/config/__tests__/getWidgetSettings.spec.js +0 -3
  126. package/core/helpers/__mocks__/i18n.js +0 -1
  127. package/core/helpers/__tests__/i18n.spec.js +0 -1
  128. package/core/helpers/__tests__/updateLegacyNavigationBar.spec.js +0 -1
  129. package/core/hocs/__mocks__/withWidgetSettings.js +0 -5
  130. package/core/hocs/__tests__/withApp.spec.js +0 -2
  131. package/core/hocs/__tests__/withCurrentProduct.spec.js +0 -2
  132. package/core/hocs/__tests__/withForwardedRef.spec.js +0 -1
  133. package/core/hocs/__tests__/withNavigation.spec.js +0 -2
  134. package/core/hocs/__tests__/withRoute.spec.js +0 -2
  135. package/core/hocs/__tests__/withTheme.spec.js +0 -2
  136. package/core/hocs/__tests__/withWidgetSettings.spec.js +0 -2
  137. package/core/hocs/__tests__/withWidgetStyles.spec.js +0 -2
  138. package/core/hooks/__tests__/useApp.spec.js +0 -1
  139. package/core/hooks/__tests__/useNavigation.spec.js +0 -1
  140. package/core/hooks/__tests__/usePageConfig.spec.js +0 -1
  141. package/core/hooks/__tests__/usePageSettings.spec.js +0 -1
  142. package/core/hooks/__tests__/useTheme.spec.js +0 -1
  143. package/core/hooks/__tests__/useWidgetConfig.spec.js +0 -1
  144. package/core/hooks/__tests__/useWidgetSettings.spec.js +0 -1
  145. package/core/hooks/__tests__/useWidgetStyles.spec.js +0 -1
  146. package/core/index.spec.js +0 -1
  147. package/core/providers/__tests__/AppProvider.spec.js +0 -2
  148. package/core/router/__tests__/helpers.spec.js +0 -1
  149. package/favorites/index.spec.js +0 -1
  150. package/filter/helpers/__tests__/buildUpdatedFilters.spec.js +0 -1
  151. package/filter/index.spec.js +0 -1
  152. package/index.spec.js +0 -1
  153. package/market/index.spec.js +0 -1
  154. package/orders/index.spec.js +0 -1
  155. package/page/index.spec.js +0 -1
  156. package/product/components/Description/__tests__/Description.spec.js +0 -1
  157. package/product/components/Media/helpers.spec.js +0 -3
  158. package/product/components/ProductCharacteristics/helpers/index.spec.js +0 -12
  159. package/product/components/ProductGridPrice/index.spec.js +0 -1
  160. package/product/components/ProductProperties/__tests__/Content.spec.js +0 -1
  161. package/product/components/ProductProperties/__tests__/Group.spec.js +0 -1
  162. package/product/components/ProductProperties/__tests__/GroupedProperties.spec.js +0 -1
  163. package/product/components/ProductProperties/__tests__/Lists.spec.js +0 -1
  164. package/product/components/ProductProperties/__tests__/ProductProperties.spec.js +0 -1
  165. package/product/components/ProductProperties/__tests__/Row.spec.js +0 -1
  166. package/product/components/ProductProperties/__tests__/Rows.spec.js +0 -1
  167. package/product/components/ProductProperties/__tests__/helpers/getGroupsFromProperties.spec.js +0 -1
  168. package/product/components/ProductProperties/__tests__/helpers/getSubgroupsFromProperties.spec.js +0 -1
  169. package/product/components/QuantityPicker/helpers.spec.js +0 -1
  170. package/product/components/__mocks__/context.js +0 -1
  171. package/product/hocs/withMapPricing.spec.js +0 -4
  172. package/product/hocs/withPriceCalculation.spec.js +0 -1
  173. package/product/index.spec.js +0 -1
  174. package/product/selectors/__tests__/media.spec.js +0 -1
  175. package/product/selectors/__tests__/price.spec.js +0 -1
  176. package/product/selectors/__tests__/product.spec.js +0 -2
  177. package/product/selectors/__tests__/relations.spec.js +0 -1
  178. package/product/selectors/__tests__/variants.spec.js +0 -1
  179. package/product/selectors/mocks/productProperties.mock.js +0 -1
  180. package/reviews/index.spec.js +0 -1
  181. package/scanner/index.spec.js +0 -1
  182. package/search/index.spec.js +0 -1
  183. package/user/index.spec.js +0 -1
  184. package/user/selectors/__tests__/login.spec.js +0 -1
@@ -0,0 +1,22 @@
1
+ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{PERMISSION_ID_PUSH}from'@shopgate/engage/core/constants';import grantPermissions from"./grantPermissions";/**
2
+ * Determines the current state of the push permissions.
3
+ * If not already happened, the user will be prompted to grant permissions.
4
+ * The action returns a promise which resolves with a boolean value, that indicates the state.
5
+ * @param {Object} options Action options.
6
+ * @param {boolean} [options.useSettingsModal=false] Whether in case of declined permissions a modal
7
+ * shall be presented, which redirects to the app settings.
8
+ * @param {boolean} [options.useRationaleModal=true] Whether a rational modal should be shown
9
+ * @param {Object} [options.rationaleModal={}] Options for the rationale modal.
10
+ * @param {string} options.rationaleModal.title Modal title.
11
+ * @param {string} options.rationaleModal.message Modal message.
12
+ * @param {string} options.rationaleModal.confirm Label for the confirm button.
13
+ * @param {string} options.rationaleModal.dismiss Label for the dismiss button.
14
+ * @param {Object} options.rationaleModal.params Additional parameters for i18n strings.
15
+ * @param {Object} [options.modal={}] Options for the settings modal.
16
+ * @param {string} options.modal.title Modal title.
17
+ * @param {string} options.modal.message Modal message.
18
+ * @param {string} options.modal.confirm Label for the confirm button.
19
+ * @param {string} options.modal.dismiss Label for the dismiss button.
20
+ * @param {Object} options.modal.params Additional parameters for i18n strings.
21
+ * @return { Function } A redux thunk.
22
+ */var grantPushPermissions=function grantPushPermissions(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return function(dispatch){var _options$useSettingsM=options.useSettingsModal,useSettingsModal=_options$useSettingsM===void 0?false:_options$useSettingsM,_options$useRationale=options.useRationaleModal,useRationaleModal=_options$useRationale===void 0?false:_options$useRationale,_options$modal=options.modal,modal=_options$modal===void 0?{}:_options$modal,_options$rationaleMod=options.rationaleModal,rationaleModal=_options$rationaleMod===void 0?{}:_options$rationaleMod;return dispatch(grantPermissions({permissionId:PERMISSION_ID_PUSH,useSettingsModal:useSettingsModal,useRationaleModal:useRationaleModal,modal:_extends({title:null,message:'permissions.access_denied.push_message',confirm:'permissions.access_denied.settings_button'},modal),rationaleModal:rationaleModal}));};};export default grantPushPermissions;
@@ -0,0 +1 @@
1
+ export{default as getGeolocation}from"./getGeolocation";export{default as grantCameraPermissions}from"./grantCameraPermissions";export{default as grantGeolocationPermissions}from"./grantGeolocationPermissions";export{default as grantPushPermissions}from"./grantPushPermissions";export{default as requestAppPermission}from"./requestAppPermission";export{default as requestAppPermissionStatus}from"./requestAppPermissionStatus";export{default as updateStatusBarBackground}from"./updateStatusBarBackground";
@@ -0,0 +1,7 @@
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{requestAppPermissions}from'@shopgate/pwa-core/commands/appPermissions';import{PERMISSION_STATUS_NOT_SUPPORTED}from'@shopgate/engage/core/constants';import{appPermissionStatusReceived}from"../action-creators";/**
2
+ * Requests an additional app permission from the operating system.
3
+ * Additionally it propagates the received status via the APP_PERMISSION_STATUS_RECEIVED action.
4
+ * @param {Object} params The action params
5
+ * @param {string} params.permissionId The desired app permission id
6
+ * @returns {Function} A Redux thunk
7
+ */var requestAppPermission=function requestAppPermission(_ref){var permissionId=_ref.permissionId;return/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var _yield$requestAppPerm;var _ref3,_ref4,_ref4$,status,options;return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.next=2;return requestAppPermissions([{permissionId:permissionId}]);case 2:_context.t1=_yield$requestAppPerm=_context.sent;_context.t0=_context.t1!==null;if(!_context.t0){_context.next=6;break;}_context.t0=_yield$requestAppPerm!==void 0;case 6:if(!_context.t0){_context.next=10;break;}_context.t2=_yield$requestAppPerm;_context.next=11;break;case 10:_context.t2=[];case 11:_ref3=_context.t2;_ref4=_slicedToArray(_ref3,1);_ref4$=_ref4[0];_ref4$=_ref4$===void 0?{status:PERMISSION_STATUS_NOT_SUPPORTED}:_ref4$;status=_ref4$.status,options=_ref4$.options;dispatch(appPermissionStatusReceived({permissionId:permissionId,status:status,options:options}));return _context.abrupt("return",status);case 18:case"end":return _context.stop();}}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}();};export default requestAppPermission;
@@ -0,0 +1,7 @@
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{getAppPermissions}from'@shopgate/pwa-core/commands/appPermissions';import{PERMISSION_STATUS_NOT_SUPPORTED}from'@shopgate/engage/core/constants';import{appPermissionStatusReceived}from"../action-creators";/**
2
+ * Determines the current status of an app permission from the operating system.
3
+ * Additionally it propagates the received status via the APP_PERMISSION_STATUS_RECEIVED action.
4
+ * @param {Object} params The action params
5
+ * @param {string} params.permissionId The desired app permission id
6
+ * @returns {Function} A Redux thunk
7
+ */var requestAppPermissionStatus=function requestAppPermissionStatus(_ref){var permissionId=_ref.permissionId;return/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var _yield$getAppPermissi;var _ref3,_ref4,_ref4$,status,options;return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.next=2;return getAppPermissions([permissionId]);case 2:_context.t1=_yield$getAppPermissi=_context.sent;_context.t0=_context.t1!==null;if(!_context.t0){_context.next=6;break;}_context.t0=_yield$getAppPermissi!==void 0;case 6:if(!_context.t0){_context.next=10;break;}_context.t2=_yield$getAppPermissi;_context.next=11;break;case 10:_context.t2=[];case 11:_ref3=_context.t2;_ref4=_slicedToArray(_ref3,1);_ref4$=_ref4[0];_ref4$=_ref4$===void 0?{status:PERMISSION_STATUS_NOT_SUPPORTED}:_ref4$;status=_ref4$.status,options=_ref4$.options;dispatch(appPermissionStatusReceived({permissionId:permissionId,status:status,options:options}));return _context.abrupt("return",status);case 18:case"end":return _context.stop();}}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}();};export default requestAppPermissionStatus;
@@ -0,0 +1,49 @@
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";function _createForOfIteratorHelper(o,allowArrayLike){var it=typeof Symbol!=="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function F(){};return{s:F,n:function n(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]};},e:function e(_e){throw _e;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion=true,didErr=false,err;return{s:function s(){it=it.call(o);},n:function n(){var step=it.next();normalCompletion=step.done;return step;},e:function e(_e2){didErr=true;err=_e2;},f:function f(){try{if(!normalCompletion&&it["return"]!=null)it["return"]();}finally{if(didErr)throw err;}}};}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}/**
2
+ * @callback AppInitializationHandler
3
+ * @param {Object} params
4
+ * @param {Function} params.dispatch Redux dispatch function
5
+ * @param {Function} params.getState Redux dispatch function
6
+ * @returns {Promise}
7
+ */ /**
8
+ * Class to maintain handler functions that are executed before the React app initializes.
9
+ *
10
+ * Handlers are invoked before the React app initializes. They can
11
+ * interact with Redux via "dispatch" and "getState" and e.g. initialize states based on
12
+ * information which is retrieved via app commands.
13
+ *
14
+ * Since the handler execution is blocking and postpones the React app initialization, this
15
+ * system should be handled with care.
16
+ */var AppInitialization=/*#__PURE__*/function(){/**
17
+ * Constructor
18
+ */function AppInitialization(){_classCallCheck(this,AppInitialization);this.store=new Map();}/**
19
+ * Get an initialization handler
20
+ * @param {*} key Identifier for the handler
21
+ * @returns {Promise}
22
+ */_createClass(AppInitialization,[{key:"get",value:function get(key){return this.store.get(key);}/**
23
+ * Sets an initialization handler.
24
+ *
25
+ * @param {*} key Identifier for the handler
26
+ * @param {AppInitializationHandler} handler The actual handler
27
+ * @returns {AppInitialization}
28
+ *
29
+ * @example
30
+ * const handler = ({ dispatch, getState }) => {
31
+ * return new Promise(async (resolve) => {
32
+ * // Retrieve some data from the app via app command
33
+ * const appCommandResponse = await getAppCommandResponse();
34
+ * // Retrieve some data from Redux (store will be nearly empty at this point)
35
+ * const reduxValue = getValueFromRedux(getState());
36
+ * // Dispatch Redux actions to initialize a Redux state
37
+ * dispatch(reduxAction(reduxValue, appCommandResponse));
38
+ * resolve();
39
+ * });
40
+ *
41
+ * appInitialization.set('handler-key', handler);
42
+ * }
43
+ */},{key:"set",value:function set(key,handler){this.store.set(key,handler);return this;}/**
44
+ * Invokes all registered handlers
45
+ * @returns {Promise<{results: [], errors: []}>}
46
+ */},{key:"initialize",value:function(){var _initialize=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref){var dispatch,getState,promises,results,errors,_iterator,_step,promise;return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:dispatch=_ref.dispatch,getState=_ref.getState;promises=Array.from(this.store.values()).map(function(handler){var res;// Take care that errors inside handlers don't break the app
47
+ try{res=handler({dispatch:dispatch,getState:getState});}catch(e){// Nothing to see here
48
+ }return res;}).filter(Boolean);results=[];errors=[];// eslint-disable-next-line no-restricted-syntax
49
+ _iterator=_createForOfIteratorHelper(promises);_context.prev=5;_iterator.s();case 7:if((_step=_iterator.n()).done){_context.next=22;break;}promise=_step.value;_context.prev=9;_context.t0=results;_context.next=13;return promise;case 13:_context.t1=_context.sent;_context.t0.push.call(_context.t0,_context.t1);_context.next=20;break;case 17:_context.prev=17;_context.t2=_context["catch"](9);errors.push(_context.t2);case 20:_context.next=7;break;case 22:_context.next=27;break;case 24:_context.prev=24;_context.t3=_context["catch"](5);_iterator.e(_context.t3);case 27:_context.prev=27;_iterator.f();return _context.finish(27);case 30:return _context.abrupt("return",{results:results,errors:errors});case 31:case"end":return _context.stop();}}},_callee,this,[[5,24,27,30],[9,17]]);}));function initialize(_x){return _initialize.apply(this,arguments);}return initialize;}()}]);return AppInitialization;}();export default new AppInitialization();
@@ -0,0 +1 @@
1
+ export{default as appInitialization}from"./AppInitialization";export*from'@shopgate/pwa-common/collections';
@@ -0,0 +1 @@
1
+ export var APP_PERMISSION_STATUS_RECEIVED='APP_PERMISSION_STATUS_RECEIVED';
@@ -0,0 +1 @@
1
+ export var APP_FEATURE_PUSH_OPT_IN='optIn';
@@ -0,0 +1,6 @@
1
+ import{INDEX_PATH,INDEX_PATH_DEEPLINK}from'@shopgate/pwa-common/constants/RoutePaths';export*from"./actionTypes";export*from"./appFeatures";export*from"./geolocationRequest";// Core Constants
2
+ export*from'@shopgate/pwa-core/constants/AppEvents';export*from'@shopgate/pwa-core/constants/AppPermissions';export*from'@shopgate/pwa-core/constants/ErrorHandleTypes';export*from'@shopgate/pwa-core/constants/Pipeline';export*from'@shopgate/pwa-core/constants/ProcessTypes';export*from'@shopgate/pwa-core/constants/Scanner';export*from'@shopgate/pwa-core/constants/Trilean';// Common Constants
3
+ export*from'@shopgate/pwa-common/constants/ActionTypes';export*from'@shopgate/pwa-common/constants/Configuration';export*from'@shopgate/pwa-common/constants/Device';export*from'@shopgate/pwa-common/constants/DisplayOptions';export*from'@shopgate/pwa-common/constants/Pipelines';export*from'@shopgate/pwa-common/constants/Portals';// CLIENT CONSTANTS
4
+ export*from'@shopgate/pwa-common/constants/client';// MENU CONSTANTS
5
+ export*from'@shopgate/pwa-common/constants/MenuIDs';// MODAL CONSTANTS
6
+ export*from'@shopgate/pwa-common/constants/ModalTypes';export{INDEX_PATH,INDEX_PATH_DEEPLINK};
@@ -0,0 +1,7 @@
1
+ import{APP_FEATURE_PUSH_OPT_IN}from'@shopgate/engage/core/constants';import{hasSGJavaScriptBridge}from'@shopgate/pwa-core/helpers';/**
2
+ * Determines if the app supports the push opt-in feature
3
+ * @returns {boolean}
4
+ */export var appSupportsPushOptIn=function appSupportsPushOptIn(){var _window,_window$SGAppInfo,_window$SGAppInfo$fea,_window$SGAppInfo$fea2,_window$SGAppInfo$fea3;if(!hasSGJavaScriptBridge()){// Always supported in development
5
+ return true;}if(!Array.isArray((_window=window)===null||_window===void 0?void 0:(_window$SGAppInfo=_window.SGAppInfo)===null||_window$SGAppInfo===void 0?void 0:(_window$SGAppInfo$fea=_window$SGAppInfo.featureFlags)===null||_window$SGAppInfo$fea===void 0?void 0:(_window$SGAppInfo$fea2=_window$SGAppInfo$fea.Push)===null||_window$SGAppInfo$fea2===void 0?void 0:(_window$SGAppInfo$fea3=_window$SGAppInfo$fea2['1'])===null||_window$SGAppInfo$fea3===void 0?void 0:_window$SGAppInfo$fea3.flags)){// Not supported on app versions that don't provide the featureFlags object
6
+ return false;}// Supported when the feature flags contain the push opt-in flag
7
+ return window.SGAppInfo.featureFlags.Push['1'].flags.includes(APP_FEATURE_PUSH_OPT_IN);};
@@ -0,0 +1 @@
1
+ export*from"./appFeatures";export{getFullImageSource}from"./getFullImageSource";export{getImageFormat}from"./getImageFormat";export{i18n}from"./i18n";export{updateLegacyNavigationBar}from"./updateLegacyNavigationBar";
package/core/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @module core */import{getCurrentRoute as getCurrentRouteHelper,router,history,parseQueryStringToObject,parseObjectToQueryString}from'@shopgate/pwa-common/helpers/router';import{INDEX_PATH,INDEX_PATH_DEEPLINK}from'@shopgate/pwa-common/constants/RoutePaths';// --------------- CORE --------------- //
1
+ /** @module core */import{getCurrentRoute as getCurrentRouteHelper,router,history,parseQueryStringToObject,parseObjectToQueryString}from'@shopgate/pwa-common/helpers/router';// --------------- CORE --------------- //
2
2
  // Classes
3
3
  // TODO: Contains circular dependency!
4
4
  // export { default as AppCommand } from '@shopgate/pwa-core/classes/AppCommand';
@@ -6,8 +6,7 @@ export{default as GetAppPermissionsRequest}from'@shopgate/pwa-core/classes/AppPe
6
6
  export{default as analyticsSetCustomValues}from'@shopgate/pwa-core/commands/analyticsSetCustomValues';export*from'@shopgate/pwa-core/commands/appPermissions';export*from'@shopgate/pwa-core/commands/brightness';export{default as broadcastEvent}from'@shopgate/pwa-core/commands/broadcastEvent';export{default as cleanTab,cleanTabCmd}from'@shopgate/pwa-core/commands/cleanTab';export{default as closeInAppBrowser}from'@shopgate/pwa-core/commands/closeInAppBrowser';export{default as flushTab}from'@shopgate/pwa-core/commands/flushTab';export{default as hideMenuBar}from'@shopgate/pwa-core/commands/hideMenuBar';export{default as hideNavigationBar}from'@shopgate/pwa-core/commands/hideNavigationBar';export{default as hideSplashScreen}from'@shopgate/pwa-core/commands/hideSplashScreen';export{default as onload}from'@shopgate/pwa-core/commands/onload';export{default as openAppSettings}from'@shopgate/pwa-core/commands/openAppSettings';export{default as openPage}from'@shopgate/pwa-core/commands/openPage';export{default as openPageExtern}from'@shopgate/pwa-core/commands/openPageExtern';export{default as performCommandsAfterDelay,performCommandsAfterDelayCmd}from'@shopgate/pwa-core/commands/performCommandsAfterDelay';export*from'@shopgate/pwa-core/commands/plotProjects';export{default as popTabToRoot,popTabToRootCmd}from'@shopgate/pwa-core/commands/popTabToRoot';export{default as registerEvents}from'@shopgate/pwa-core/commands/registerEvents';export*from'@shopgate/pwa-core/commands/scanner';export{default as setCookie}from'@shopgate/pwa-core/commands/setCookie';export{default as setDebugLoggingEnabled}from'@shopgate/pwa-core/commands/setDebugLoggingEnabled';export{default as setScrollingEnabled}from'@shopgate/pwa-core/commands/setScrollingEnabled';export{default as showNavigationBar}from'@shopgate/pwa-core/commands/showNavigationBar';export{default as showTab}from'@shopgate/pwa-core/commands/showTab';export*from'@shopgate/pwa-core/commands/unifiedTracking';// TODO: Contains circular dependency!
7
7
  // export * from '@shopgate/pwa-core/commands/webStorage';
8
8
  // Constants
9
- export*from'@shopgate/pwa-core/constants/AppEvents';export*from'@shopgate/pwa-core/constants/AppPermissions';export*from'@shopgate/pwa-core/constants/ErrorHandleTypes';export*from'@shopgate/pwa-core/constants/Pipeline';export*from'@shopgate/pwa-core/constants/ProcessTypes';export*from'@shopgate/pwa-core/constants/Scanner';export*from'@shopgate/pwa-core/constants/Trilean';// Common Constants
10
- export*from'@shopgate/pwa-common/constants/ActionTypes';export*from'@shopgate/pwa-common/constants/Configuration';export*from'@shopgate/pwa-common/constants/Device';export*from'@shopgate/pwa-common/constants/DisplayOptions';export*from'@shopgate/pwa-common/constants/Pipelines';export*from'@shopgate/pwa-common/constants/Portals';export{INDEX_PATH,INDEX_PATH_DEEPLINK};export*from"./constants/geolocationRequest";// Emitters
9
+ export*from"./constants";// Emitters
11
10
  export{default as UIEvents}from'@shopgate/pwa-core/emitters/ui';// Helpers
12
11
  export*from'@shopgate/pwa-core/helpers';export{default as logGroup}from'@shopgate/pwa-core/helpers/logGroup';export*from'@shopgate/pwa-core/helpers/version';export*from'@shopgate/pwa-common/helpers/data';export*from'@shopgate/pwa-common/helpers/date';export*from'@shopgate/pwa-common/helpers/dom';export*from'@shopgate/pwa-common/helpers/environment';export{default as decodeHTML}from'@shopgate/pwa-common/helpers/html/decodeHTML';export*from'@shopgate/pwa-common/helpers/html/handleDOM';export{default as parseHTML}from'@shopgate/pwa-common/helpers/html/parseHTML';export{default as getTranslator}from'@shopgate/pwa-common/helpers/i18n/getTranslator';export{default as getPriceFormatter}from'@shopgate/pwa-common/helpers/i18n/getPriceFormatter';export{default as getDateFormatter}from'@shopgate/pwa-common/helpers/i18n/getDateFormatter';export{default as getTimeFormatter}from'@shopgate/pwa-common/helpers/i18n/getTimeFormatter';export{default as getNumberFormatter}from'@shopgate/pwa-common/helpers/i18n/getNumberFormatter';export*from'@shopgate/pwa-common/helpers/legacy';// TODO: Can only be exported once the theme uses it. causes issues with the custom routes feature.
13
12
  /*
@@ -16,15 +15,14 @@ export { default as routePortals } from '@shopgate/pwa-common/helpers/portals/ro
16
15
  */export*from'@shopgate/pwa-common/helpers/redux';export*from'@shopgate/pwa-common/helpers/style';export*from'@shopgate/pwa-common/helpers/tracking';export*from'@shopgate/pwa-common/helpers/validation';// STREAMS
17
16
  export*from'@shopgate/pwa-common/streams/main';export*from'@shopgate/pwa-common/streams/error';// --------------- APP --------------- //
18
17
  // ACTIONS
19
- export{default as handleDeepLink}from'@shopgate/pwa-common/actions/app/handleDeepLink';export{default as handleUniversalLink}from'@shopgate/pwa-common/actions/app/handleUniversalLink';export{default as handleLink}from'@shopgate/pwa-common/actions/app/handleLink';export{default as handlePushNotification}from'@shopgate/pwa-common/actions/app/handlePushNotification';export{default as registerLinkEvents}from'@shopgate/pwa-common/actions/app/registerLinkEvents';export{default as updateStatusBarBackground}from"./actions/updateStatusBarBackground";export{default as grantPermissions}from"./actions/grantPermissions";export{default as grantCameraPermissions}from"./actions/grantCameraPermissions";export{default as grantGeolocationPermissions}from"./actions/grantGeolocationPermissions";export{default as getGeolocation}from"./actions/getGeolocation";// STREAMS
18
+ export{default as handleDeepLink}from'@shopgate/pwa-common/actions/app/handleDeepLink';export{default as handleUniversalLink}from'@shopgate/pwa-common/actions/app/handleUniversalLink';export{default as handleLink}from'@shopgate/pwa-common/actions/app/handleLink';export{default as handlePushNotification}from'@shopgate/pwa-common/actions/app/handlePushNotification';export{default as registerLinkEvents}from'@shopgate/pwa-common/actions/app/registerLinkEvents';export{default as updateStatusBarBackground}from"./actions/updateStatusBarBackground";export{default as grantPermissions}from"./actions/grantPermissions";export{default as grantPushPermissions}from"./actions/grantPushPermissions";export{default as grantCameraPermissions}from"./actions/grantCameraPermissions";export{default as grantGeolocationPermissions}from"./actions/grantGeolocationPermissions";export{default as requestAppPermission}from"./actions/requestAppPermission";export{default as requestAppPermissionStatus}from"./actions/requestAppPermissionStatus";export{default as getGeolocation}from"./actions/getGeolocation";// STREAMS
20
19
  export*from'@shopgate/pwa-common/streams/app';// --------------- STORE --------------- //
21
20
  export*from'@shopgate/pwa-common/store';// --------------- CLIENT --------------- //
22
21
  // ACTIONS
23
- export{default as fetchClientInformation}from'@shopgate/pwa-common/actions/client/fetchClientInformation';// CONSTANTS
24
- export*from'@shopgate/pwa-common/constants/client';// SELECTORS
22
+ export{default as fetchClientInformation}from'@shopgate/pwa-common/actions/client/fetchClientInformation';// SELECTORS
25
23
  export*from'@shopgate/pwa-common/selectors/client';// STREAMS
26
24
  export*from'@shopgate/pwa-common/streams/client';// --------------- COLLECTIONS --------------- //
27
- export{default as authRoutes}from'@shopgate/pwa-common/collections/AuthRoutes';export{default as redirects}from'@shopgate/pwa-common/collections/Redirects';export{default as configuration}from'@shopgate/pwa-common/collections/Configuration';export{default as embeddedMedia}from'@shopgate/pwa-common/collections/EmbeddedMedia';export{default as persistedReducers}from'@shopgate/pwa-common/collections/PersistedReducers';export{default as Vimeo}from'@shopgate/pwa-common/collections/media-providers/Vimeo';export{default as YouTube}from'@shopgate/pwa-common/collections/media-providers/YouTube';// --------------- CONTEXTS --------------- //
25
+ export{default as appInitialization}from"./collections/AppInitialization";export{default as authRoutes}from'@shopgate/pwa-common/collections/AuthRoutes';export{default as redirects}from'@shopgate/pwa-common/collections/Redirects';export{default as configuration}from'@shopgate/pwa-common/collections/Configuration';export{default as embeddedMedia}from'@shopgate/pwa-common/collections/EmbeddedMedia';export{default as persistedReducers}from'@shopgate/pwa-common/collections/PersistedReducers';export{default as Vimeo}from'@shopgate/pwa-common/collections/media-providers/Vimeo';export{default as YouTube}from'@shopgate/pwa-common/collections/media-providers/YouTube';// --------------- CONTEXTS --------------- //
28
26
  export*from'@shopgate/pwa-common/context';export{default as AppContext}from"./contexts/AppContext";// --------------- PROVIDERS --------------- //
29
27
  export{default as LoadingProvider}from'@shopgate/pwa-common/providers/loading';export{default as LoadingContext}from'@shopgate/pwa-common/providers/loading/context';export{default as ToastProvider}from'@shopgate/pwa-common/providers/toast';export{default as ToastContext}from'@shopgate/pwa-common/providers/toast/context';export{default as AppProvider}from"./providers/AppProvider";// --------------- ROUTER --------------- //
30
28
  // ACTIONS
@@ -36,15 +34,13 @@ export*from'@shopgate/pwa-common/streams/router';// --------------- URL --------
36
34
  export{resetApp}from'@shopgate/pwa-common/action-creators/app';export*from'@shopgate/pwa-common/action-creators/url';// SELECTORS
37
35
  export*from'@shopgate/pwa-common/selectors/url';// --------------- MENU --------------- //
38
36
  // ACTIONS
39
- export{default as fetchMenu}from'@shopgate/pwa-common/actions/menu/fetchMenu';// CONSTANTS
40
- export*from'@shopgate/pwa-common/constants/MenuIDs';// SELECTORS
37
+ export{default as fetchMenu}from'@shopgate/pwa-common/actions/menu/fetchMenu';// SELECTORS
41
38
  export*from'@shopgate/pwa-common/selectors/menu';// --------------- MODAL --------------- //
42
39
  // ACTIONS
43
- export{default as closeModal}from'@shopgate/pwa-common/actions/modal/closeModal';export{default as promiseMap}from'@shopgate/pwa-common/actions/modal/promiseMap';export{default as showModal}from'@shopgate/pwa-common/actions/modal/showModal';// CONSTANTS
44
- export*from'@shopgate/pwa-common/constants/ModalTypes';// HELPERS
40
+ export{default as closeModal}from'@shopgate/pwa-common/actions/modal/closeModal';export{default as promiseMap}from'@shopgate/pwa-common/actions/modal/promiseMap';export{default as showModal}from'@shopgate/pwa-common/actions/modal/showModal';// HELPERS
45
41
  export{default as withShowModal}from'@shopgate/pwa-common/helpers/modal/withShowModal';// SELECTORS
46
42
  export*from'@shopgate/pwa-common/selectors/modal';// --------------- HOOKS --------------- //
47
43
  export{useRoute}from"./hooks/useRoute";export{useTheme}from"./hooks/useTheme";export{useCurrentProduct}from"./hooks/useCurrentProduct";export{useNavigation}from"./hooks/useNavigation";export{usePageConfig}from"./hooks/usePageConfig";export{usePageSettings}from"./hooks/usePageSettings";export{useWidgetConfig}from"./hooks/useWidgetConfig";export{useWidgetSettings}from"./hooks/useWidgetSettings";export{useWidgetStyles}from"./hooks/useWidgetStyles";export*from"./hooks/html";// --------------- HOCs --------------- //
48
44
  export{withTheme}from"./hocs/withTheme";export{withRoute}from"./hocs/withRoute";export{withCurrentProduct}from"./hocs/withCurrentProduct";export{withForwardedRef}from"./hocs/withForwardedRef";export{withNavigation}from"./hocs/withNavigation";export{withWidgetSettings}from"./hocs/withWidgetSettings";export{withWidgetStyles}from"./hocs/withWidgetStyles";export{withApp}from"./hocs/withApp";// --------------- CONFIG --------------- //
49
45
  export{ThemeConfigResolver}from"./config/ThemeConfigResolver";export{isBeta}from"./config/isBeta";export{getThemeConfig}from"./config/getThemeConfig";export{getThemeSettings}from"./config/getThemeSettings";export{getThemeColors}from"./config/getThemeColors";export{getThemeAssets}from"./config/getThemeAssets";export{getPageConfig}from"./config/getPageConfig";export{getPageSettings}from"./config/getPageSettings";export{getWidgetConfig}from"./config/getWidgetConfig";export{getWidgetSettings}from"./config/getWidgetSettings";// -------------- HELPERS -------------- //
50
- export{i18n}from"./helpers/i18n";export{updateLegacyNavigationBar}from"./helpers/updateLegacyNavigationBar";export{getFullImageSource}from"./helpers/getFullImageSource";
46
+ export{i18n}from"./helpers/i18n";export{updateLegacyNavigationBar}from"./helpers/updateLegacyNavigationBar";export{getFullImageSource}from"./helpers/getFullImageSource";export*from"./initialization";
@@ -0,0 +1,7 @@
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{appConfig}from'@shopgate/engage';import{i18n,configureStore,fetchClientInformation}from'@shopgate/engage/core';import{appInitialization}from'@shopgate/engage/core/collections';import{appWillInit,appWillStart}from'@shopgate/pwa-common/action-creators/app';var _appConfig$locales=appConfig.locales;_appConfig$locales=_appConfig$locales===void 0?{}:_appConfig$locales;var _appConfig$locales$cu=_appConfig$locales.currency,currencyLocale=_appConfig$locales$cu===void 0?null:_appConfig$locales$cu;/**
2
+ *
3
+ * @param {Object} locales An object with locales.
4
+ * @param {Function} reducers The reducers from the theme.
5
+ * @param {Array} subscribers The subscribers to the streams middleware.
6
+ */export var initialize=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(locales,reducers,subscribers){var store;return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:i18n.init({locales:locales,lang:process.env.LOCALE,currencyLocale:currencyLocale});store=configureStore(reducers,subscribers);_context.prev=2;_context.next=5;return store.dispatch(fetchClientInformation());case 5:_context.next=9;break;case 7:_context.prev=7;_context.t0=_context["catch"](2);case 9:store.dispatch(appWillInit("".concat(window.location.pathname).concat(window.location.search)));// Execute all registered handlers from the AppInitialization collection
7
+ _context.next=12;return appInitialization.initialize({dispatch:store.dispatch,getState:store.getState});case 12:store.dispatch(appWillStart("".concat(window.location.pathname).concat(window.location.search)));return _context.abrupt("return",{store:store});case 14:case"end":return _context.stop();}}},_callee,null,[[2,7]]);}));return function initialize(_x,_x2,_x3){return _ref.apply(this,arguments);};}();
@@ -0,0 +1,19 @@
1
+ import{main$}from'@shopgate/pwa-common/streams/main';import{PERMISSION_ID_PUSH,PERMISSION_ID_CAMERA,PERMISSION_ID_LOCATION,PERMISSION_ID_PHONE,PERMISSION_ID_BACKGROUND_APP_REFRESH,APP_PERMISSION_STATUS_RECEIVED}from'@shopgate/engage/core/constants';/**
2
+ * Gets triggered when a permission status was received from the app.
3
+ * @type {Observable}
4
+ */export var appPermissionStatusReceived$=main$.filter(function(_ref){var action=_ref.action;return action.type===APP_PERMISSION_STATUS_RECEIVED;});/**
5
+ * Gets triggered when a push permission status was received from the app.
6
+ * @type {Observable}
7
+ */export var appPermissionStatusPushReceived$=appPermissionStatusReceived$.filter(function(_ref2){var action=_ref2.action;return action.permissionId===PERMISSION_ID_PUSH;});/**
8
+ * Gets triggered when a camera permission status was received from the app.
9
+ * @type {Observable}
10
+ */export var appPermissionStatusCameraReceived$=appPermissionStatusReceived$.filter(function(_ref3){var action=_ref3.action;return action.permissionId===PERMISSION_ID_CAMERA;});/**
11
+ * Gets triggered when a location permission status was received from the app.
12
+ * @type {Observable}
13
+ */export var appPermissionStatusLocationReceived$=appPermissionStatusReceived$.filter(function(_ref4){var action=_ref4.action;return action.permissionId===PERMISSION_ID_LOCATION;});/**
14
+ * Gets triggered when a phone permission status was received from the app.
15
+ * @type {Observable}
16
+ */export var appPermissionStatusPhoneReceived$=appPermissionStatusReceived$.filter(function(_ref5){var action=_ref5.action;return action.permissionId===PERMISSION_ID_PHONE;});/**
17
+ * Gets triggered when a backgroundAppRefresh permission status was received from the app.
18
+ * @type {Observable}
19
+ */export var appPermissionStatusBackgroundAppRefreshReceived$=appPermissionStatusReceived$.filter(function(_ref6){var action=_ref6.action;return action.permissionId===PERMISSION_ID_BACKGROUND_APP_REFRESH;});
@@ -0,0 +1 @@
1
+ export*from"./appPermissions";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/engage",
3
- "version": "6.21.0",
3
+ "version": "6.22.0-beta.10",
4
4
  "description": "Shopgate's ENGAGE library.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -15,12 +15,12 @@
15
15
  "connect"
16
16
  ],
17
17
  "dependencies": {
18
- "@shopgate/pwa-common": "6.21.0",
19
- "@shopgate/pwa-common-commerce": "6.21.0",
20
- "@shopgate/pwa-core": "6.21.0",
21
- "@shopgate/pwa-ui-ios": "6.21.0",
22
- "@shopgate/pwa-ui-material": "6.21.0",
23
- "@shopgate/pwa-ui-shared": "6.21.0",
18
+ "@shopgate/pwa-common": "6.22.0-beta.10",
19
+ "@shopgate/pwa-common-commerce": "6.22.0-beta.10",
20
+ "@shopgate/pwa-core": "6.22.0-beta.10",
21
+ "@shopgate/pwa-ui-ios": "6.22.0-beta.10",
22
+ "@shopgate/pwa-ui-material": "6.22.0-beta.10",
23
+ "@shopgate/pwa-ui-shared": "6.22.0-beta.10",
24
24
  "@virtuous/conductor": "~2.4.0",
25
25
  "babel-plugin-transform-es3-member-expression-literals": "^6.8.0",
26
26
  "babel-plugin-transform-es3-property-literals": "^6.8.0",
@@ -1,8 +1,8 @@
1
1
  function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_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);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}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}});Object.defineProperty(subClass,"prototype",{writable:false});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 _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}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 _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}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{SheetDrawer,SheetList}from'@shopgate/engage/components';import{VariantContext,ProductContext}from'@shopgate/engage/product';import{ViewContext}from'@shopgate/engage/components/View';import Item from"../SheetItem";import VariantAvailability from"../VariantAvailability";/**
2
2
  * The CharacteristicSheet component.
3
- */var CharacteristicSheet=/*#__PURE__*/function(_PureComponent){_inherits(CharacteristicSheet,_PureComponent);var _super=_createSuper(CharacteristicSheet);function CharacteristicSheet(){var _this;_classCallCheck(this,CharacteristicSheet);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_defineProperty(_assertThisInitialized(_this),"firstSelectableItemRef",/*#__PURE__*/React.createRef());_defineProperty(_assertThisInitialized(_this),"onDidOpen",function(){if(_this.firstSelectableItemRef.current){_this.firstSelectableItemRef.current.focus();}_this.props.setViewAriaHidden(true);});_defineProperty(_assertThisInitialized(_this),"onClose",function(e){_this.props.onClose(e);_this.props.setViewAriaHidden(false);});_defineProperty(_assertThisInitialized(_this),"handleItemClick",function(event){event.stopPropagation();_this.props.onSelect(event.target.value);});_defineProperty(_assertThisInitialized(_this),"renderAvailability",function(value){var selection=_extends({},_this.props.selection,_defineProperty({},_this.props.charId,value));return/*#__PURE__*/React.createElement(VariantAvailability,{characteristics:selection,productId:_this.props.productId});});return _this;}_createClass(CharacteristicSheet,[{key:"render",value:/**
3
+ */var CharacteristicSheet=/*#__PURE__*/function(_PureComponent){_inherits(CharacteristicSheet,_PureComponent);var _super=_createSuper(CharacteristicSheet);function CharacteristicSheet(){var _this;_classCallCheck(this,CharacteristicSheet);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_defineProperty(_assertThisInitialized(_this),"firstSelectableItemRef",/*#__PURE__*/React.createRef());_defineProperty(_assertThisInitialized(_this),"onDidOpen",function(){if(_this.firstSelectableItemRef.current){_this.firstSelectableItemRef.current.focus();}_this.props.setViewAriaHidden(true);});_defineProperty(_assertThisInitialized(_this),"onClose",function(e){_this.props.onClose(e);_this.props.setViewAriaHidden(false);});_defineProperty(_assertThisInitialized(_this),"handleItemClick",function(event,itemId){event.stopPropagation();_this.props.onSelect(itemId);});_defineProperty(_assertThisInitialized(_this),"renderAvailability",function(value){var selection=_extends({},_this.props.selection,_defineProperty({},_this.props.charId,value));return/*#__PURE__*/React.createElement(VariantAvailability,{characteristics:selection,productId:_this.props.productId});});return _this;}_createClass(CharacteristicSheet,[{key:"render",value:/**
4
4
  * @return {JSX}
5
- */function render(){var _this2=this;var _this$props=this.props,items=_this$props.items,label=_this$props.label,open=_this$props.open,selectedValue=_this$props.selectedValue;var selectedIndex;if(selectedValue){selectedIndex=items.findIndex(function(item){return item.id===selectedValue;});}else{selectedIndex=items.findIndex(function(item){return item.selectable;});}return/*#__PURE__*/React.createElement(SheetDrawer,{title:label,isOpen:open,onClose:this.onClose,onDidOpen:this.onDidOpen},/*#__PURE__*/React.createElement(SheetList,{className:"theme__product__characteristic__sheet"},items.map(function(item,index){return/*#__PURE__*/React.createElement(Item,{item:item,key:item.id,onClick:_this2.handleItemClick,rightComponent:function rightComponent(){return _this2.renderAvailability(item.id);},selected:item.id===selectedValue,ref:index===selectedIndex?_this2.firstSelectableItemRef:null});})));}}]);return CharacteristicSheet;}(PureComponent);/**
5
+ */function render(){var _this2=this;var _this$props=this.props,items=_this$props.items,label=_this$props.label,open=_this$props.open,selectedValue=_this$props.selectedValue;var selectedIndex;if(selectedValue){selectedIndex=items.findIndex(function(item){return item.id===selectedValue;});}else{selectedIndex=items.findIndex(function(item){return item.selectable;});}return/*#__PURE__*/React.createElement(SheetDrawer,{title:label,isOpen:open,onClose:this.onClose,onDidOpen:this.onDidOpen},/*#__PURE__*/React.createElement(SheetList,{className:"theme__product__characteristic__sheet"},items.map(function(item,index){return/*#__PURE__*/React.createElement(Item,{item:item,key:item.id,onClick:_this2.handleItemClick,rightComponent:function rightComponent(){return _this2.renderAvailability(item.id);},selected:item.id===selectedValue,ref:index===selectedIndex?_this2.firstSelectableItemRef:null,characteristics:_extends({},_this2.props.selection,_defineProperty({},_this2.props.charId,item.id))});})));}}]);return CharacteristicSheet;}(PureComponent);/**
6
6
  * @param {Object} props The original component props.
7
7
  * @returns {JSX}
8
8
  */_defineProperty(CharacteristicSheet,"defaultProps",{onClose:function onClose(){},onSelect:function onSelect(){},productId:null,selectedValue:null,selection:null});var SheetComponent=function SheetComponent(props){return/*#__PURE__*/React.createElement(ViewContext.Consumer,null,function(_ref){var setAriaHidden=_ref.setAriaHidden;return/*#__PURE__*/React.createElement(ProductContext.Consumer,null,function(_ref2){var productId=_ref2.productId;return/*#__PURE__*/React.createElement(VariantContext.Consumer,null,function(_ref3){var characteristics=_ref3.characteristics;return/*#__PURE__*/React.createElement(CharacteristicSheet,_extends({productId:productId,selection:characteristics,setViewAriaHidden:setAriaHidden},props));});});});};export default SheetComponent;
@@ -1,5 +1,5 @@
1
- function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_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);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}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}});Object.defineProperty(subClass,"prototype",{writable:false});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 _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}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 _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}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{withForwardedRef}from'@shopgate/engage/core';import styles from"./style";/**
1
+ function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_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);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}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}});Object.defineProperty(subClass,"prototype",{writable:false});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 _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}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 _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}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 classNames from'classnames';import{withForwardedRef}from'@shopgate/engage/core';import{CharacteristicsButton}from'@shopgate/engage/back-in-stock/components';import styles from"./style";/**
2
2
  * The SheetItem component.
3
- */var SheetItem=/*#__PURE__*/function(_PureComponent){_inherits(SheetItem,_PureComponent);var _super=_createSuper(SheetItem);function SheetItem(){var _this;_classCallCheck(this,SheetItem);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_defineProperty(_assertThisInitialized(_this),"getStyle",function(selectable){var selected=_this.props.selected;if(selected){return styles.buttonSelected;}if(!selectable){return styles.buttonDisabled;}return styles.button;});_defineProperty(_assertThisInitialized(_this),"buildProps",function(){var _this$props=_this.props,item=_this$props.item,onClick=_this$props.onClick,forwardedRef=_this$props.forwardedRef;return _extends({className:"".concat(_this.getStyle(item.selectable).toString()," theme__product__characteristic__option"),key:item.id,ref:forwardedRef,value:item.id,'aria-hidden':!item.selectable},item.selectable&&{onClick:onClick});});return _this;}_createClass(SheetItem,[{key:"render",value:/**
3
+ */var SheetItem=/*#__PURE__*/function(_PureComponent){_inherits(SheetItem,_PureComponent);var _super=_createSuper(SheetItem);function SheetItem(){var _this;_classCallCheck(this,SheetItem);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_defineProperty(_assertThisInitialized(_this),"getStyle",function(selectable){if(!selectable){return styles.buttonDisabled;}return styles.button;});_defineProperty(_assertThisInitialized(_this),"buildProps",function(){var _this$props=_this.props,item=_this$props.item,_onClick=_this$props.onClick,forwardedRef=_this$props.forwardedRef;return _extends({className:"".concat(_this.getStyle(item.selectable).toString()," theme__product__characteristic__option"),key:item.id,ref:forwardedRef,value:item.id,'aria-hidden':!item.selectable},item.selectable&&{onClick:function onClick(event){return _onClick(event,item.id);}});});return _this;}_createClass(SheetItem,[{key:"render",value:/**
4
4
  * @returns {JSX}
5
- */function render(){var _this$props2=this.props,item=_this$props2.item,Right=_this$props2.rightComponent,selected=_this$props2.selected;return/*#__PURE__*/React.createElement("button",_extends({},this.buildProps(),{"data-test-id":item.label,"aria-selected":selected,role:"option",type:"button"}),item.label,item.selectable&&/*#__PURE__*/React.createElement(Right,null));}}]);return SheetItem;}(PureComponent);_defineProperty(SheetItem,"defaultProps",{forwardedRef:null,onClick:function onClick(){},rightComponent:null,selected:false});export default withForwardedRef(SheetItem);
5
+ */function render(){var _this$props2=this.props,item=_this$props2.item,Right=_this$props2.rightComponent,selected=_this$props2.selected,characteristics=_this$props2.characteristics;var buildProps=this.buildProps();return/*#__PURE__*/React.createElement("div",{className:classNames(styles.root,_defineProperty({},styles.rootSelected,selected))},/*#__PURE__*/React.createElement("button",_extends({},buildProps,{"data-test-id":item.label,"aria-selected":selected,role:"option",type:"button"}),/*#__PURE__*/React.createElement("div",{className:styles.mainRow},/*#__PURE__*/React.createElement("div",null,item.label),/*#__PURE__*/React.createElement("div",{className:styles.mainRowRight},item.selectable&&/*#__PURE__*/React.createElement(Right,null)))),/*#__PURE__*/React.createElement("div",{className:styles.bottomRow},item.selectable&&/*#__PURE__*/React.createElement(CharacteristicsButton,{characteristics:characteristics})));}}]);return SheetItem;}(PureComponent);_defineProperty(SheetItem,"defaultProps",{forwardedRef:null,onClick:function onClick(){},rightComponent:null,selected:false});export default withForwardedRef(SheetItem);
@@ -1 +1 @@
1
- import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var colors=themeConfig.colors,variables=themeConfig.variables;var button=css({outline:0,padding:'16px 16px 16px 0',textAlign:'left',width:'100%'});var buttonDisabled=css(button,{color:colors.shade4});var bgColor=colors.darkGray;var boxShadowOffset=variables.gap.bigger;var buttonSelected=css(button,{background:bgColor,boxShadow:"-".concat(boxShadowOffset,"px 0 0 ").concat(bgColor,", ").concat(boxShadowOffset,"px 0 0 ").concat(bgColor),margin:'-1px 0',paddingTop:17,paddingBottom:17});export default{button:button,buttonDisabled:buttonDisabled,buttonSelected:buttonSelected};
1
+ import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var colors=themeConfig.colors,variables=themeConfig.variables;var button=css({outline:0,textAlign:'left',paddingLeft:0,paddingRight:0,width:'100%',display:'flex',justifyContent:'space-between',flexWrap:'wrap'});var buttonDisabled=css(button,{color:colors.shade4});var bgColor=colors.darkGray;var boxShadowOffset=variables.gap.bigger;var root=css({padding:'16px 0'});var rootSelected=css(root,{background:bgColor,boxShadow:"-".concat(boxShadowOffset,"px 0 0 ").concat(bgColor,", ").concat(boxShadowOffset,"px 0 0 ").concat(bgColor),paddingTop:17,paddingBottom:17,margin:'-1px 0'}).toString();var mainRow=css({display:'flex',flexWrap:'wrap',gap:'4px 8px',justifyContent:'space-between',width:'100%'}).toString();var mainRowRight=css({marginLeft:'auto'}).toString();var bottomRow=css({'&:not(:empty)':{marginTop:8,textAlign:'right'}}).toString();export default{root:root,rootSelected:rootSelected,button:button,buttonDisabled:buttonDisabled,mainRow:mainRow,mainRowRight:mainRowRight,bottomRow:bottomRow};
package/product/index.js CHANGED
@@ -4,7 +4,7 @@ export{default as changeSortOrder}from'@shopgate/pwa-common-commerce/product/act
4
4
  export{default as productImageFormats}from'@shopgate/pwa-common-commerce/product/collections/ProductImageFormats';// CONSTANTS
5
5
  export*from'@shopgate/pwa-common-commerce/product/constants/index';export*from'@shopgate/pwa-common-commerce/product/constants/Pipelines';export*from'@shopgate/pwa-common-commerce/product/constants/Portals';export*from"./constants";// HELPERS
6
6
  export*from'@shopgate/pwa-common-commerce/product/helpers';export*from"./helpers/index";export*from"./helpers/redirects";export*from"./components/Media/helpers";// SELECTORS
7
- export*from'@shopgate/pwa-common-commerce/product/selectors/options';export*from'@shopgate/pwa-common-commerce/product/selectors/page';export*from'@shopgate/pwa-common-commerce/product/selectors/price';export*from'@shopgate/pwa-common-commerce/product/selectors/product';export*from'@shopgate/pwa-common-commerce/product/selectors/relations';export*from'@shopgate/pwa-common-commerce/product/selectors/variants';export*from"./selectors/media";export{makeGetProductProperties,makeGetProductEffectivityDates,makeGetProductCharacteristics,makeGetProductFeaturedMedia,makeIsProductActive,makeIsBaseProductActive}from"./selectors/product";export*from"./selectors/price";export*from"./selectors/variants";export*from"./selectors/relations";// STREAMS
7
+ export*from'@shopgate/pwa-common-commerce/product/selectors/options';export*from'@shopgate/pwa-common-commerce/product/selectors/page';export*from'@shopgate/pwa-common-commerce/product/selectors/price';export*from'@shopgate/pwa-common-commerce/product/selectors/product';export*from'@shopgate/pwa-common-commerce/product/selectors/relations';export*from'@shopgate/pwa-common-commerce/product/selectors/variants';export*from"./selectors/media";export{makeGetProductProperties,makeGetProductEffectivityDates,makeGetProductCharacteristics,makeGetProductFeaturedMedia,makeIsProductActive,makeIsBaseProductActive,makeGetProductType}from"./selectors/product";export*from"./selectors/price";export*from"./selectors/variants";export*from"./selectors/relations";// STREAMS
8
8
  export*from'@shopgate/pwa-common-commerce/product/streams';// COMPONENTS
9
9
  export{default as ProductProperties}from"./components/ProductProperties/ProductProperties";export{default as MapPriceHint}from"./components/MapPriceHint";export{default as OrderQuantityHint}from"./components/OrderQuantityHint";export{default as ProductImage}from"./components/ProductImage";export{default as MediaSlider}from"./components/MediaSlider";export{default as QuantityPicker}from"./components/QuantityPicker";export{default as EffectivityDates}from"./components/EffectivityDates";export{default as PriceDifference}from"./components/PriceDifference";export{FeaturedMedia,MediaImage}from"./components/Media";export{VariantSwatch}from"./components/Swatch";export{Swatches}from"./components/Swatches";export{RelationsSlider}from"./components/RelationsSlider";export{default as ProductCard}from"./components/ProductCard";export{default as ProductGridPrice}from"./components/ProductGridPrice";export{default as ProductCharacteristics}from"./components/ProductCharacteristics";export{default as Description}from"./components/Description";export{default as ProductList}from"./components/ProductList";export{default as ProductSlider}from"./components/ProductSlider";export{default as Options}from"./components/Options";export{default as Characteristics}from"./components/Characteristics";export{default as Rating}from"./components/Rating";export{default as ProductProvider}from"./components/ProductProvider";export{default as ProductBadges}from"./components/ProductBadges";// HOCs
10
10
  export{default as withPriceCalculation}from"./hocs/withPriceCalculation";export{default as withProductStock}from"./hocs/withProductStock";export{default as withProductListType}from"./hocs/withProductListType";export{default as withProductListEntry}from"./hocs/withProductListEntry";// HOOKs
@@ -19,4 +19,8 @@ import{createSelector}from'reselect';import{getProductPropertiesState,getProduct
19
19
  */export var makeIsBaseProductActive=function makeIsBaseProductActive(){return createSelector(getBaseProduct,function(baseProduct){if(!baseProduct){return false;}return baseProduct.active||false;});};/**
20
20
  * Creates a selector to get the property of a product based on a given label
21
21
  * @returns {Function}
22
- */export var getCurrentProductPropertyByLabel=createSelector(getProductPropertiesUnfiltered,function(state,props){return props.widgetSettings;},function(currentProductProperties,widgetSettings){if(!currentProductProperties||!widgetSettings||!widgetSettings.propertyLabel){return null;}return currentProductProperties.find(function(_ref){var label=_ref.label;return label===widgetSettings.propertyLabel;});});
22
+ */export var getCurrentProductPropertyByLabel=createSelector(getProductPropertiesUnfiltered,function(state,props){return props.widgetSettings;},function(currentProductProperties,widgetSettings){if(!currentProductProperties||!widgetSettings||!widgetSettings.propertyLabel){return null;}return currentProductProperties.find(function(_ref){var label=_ref.label;return label===widgetSettings.propertyLabel;});});/**
23
+ * Create a selector to retrieve the product type.
24
+ * @returns {Function}
25
+ *
26
+ */export var makeGetProductType=function makeGetProductType(){return createSelector(getProduct,function(product){return product===null||product===void 0?void 0:product.type;});};
@@ -1,7 +1,7 @@
1
- import{createSelector}from'reselect';import find from'lodash/find';import{getProductVariants}from'@shopgate/pwa-common-commerce/product';/**
1
+ import{createSelector}from'reselect';import find from'lodash/find';import{getProductVariants}from'@shopgate/pwa-common-commerce/product';import isEqual from'lodash/isEqual';/**
2
2
  * Creates a selector that retrieves a product by a characteristic.
3
3
  * @returns {Function}
4
- */export function makeGetProductByCharacteristics(){return createSelector(function(_,props){return props.characteristics;},getProductVariants,function(characteristics,variants){if(!characteristics||!variants||!variants.products||variants.products.length===0){return null;}var product=find(variants.products,{characteristics:characteristics});if(!product){return null;}return product;});}/**
4
+ */export function makeGetProductByCharacteristics(){var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},strict=_ref.strict;return createSelector(function(_,props){return props.characteristics;},getProductVariants,function(characteristics,variants){if(!characteristics||!variants||!variants.products||variants.products.length===0){return null;}var product;if(strict){product=variants.products.find(function(_product){return isEqual(_product.characteristics,characteristics);});}else{product=find(variants.products,{characteristics:characteristics});}if(!product){return null;}return product;});}/**
5
5
  * Creates a selector that retrieves the featured image URL for a selected characteristic.
6
6
  * @returns {Function}
7
7
  */export function makeGetCharacteristicsFeaturedImage(){var getProductByCharacteristics=makeGetProductByCharacteristics();return createSelector(getProductByCharacteristics,function(product){if(!product||!product.featuredImageBaseUrl){return null;}return product.featuredImageBaseUrl;});}/**
@@ -0,0 +1 @@
1
+ export*from"./optInTrigger";export*from"./pushOptIn";
@@ -0,0 +1,23 @@
1
+ import{PUSH_OPT_IN_INCREASE_APP_START_COUNT,PUSH_OPT_IN_RESET_APP_START_COUNT,PUSH_OPT_IN_INCREASE_ORDERS_PLACED_COUNT,PUSH_OPT_IN_RESET_ORDERS_PLACED_COUNT,PUSH_OPT_IN_INCREASE_REJECTION_COUNT,PUSH_OPT_IN_SET_LAST_POPUP_TIMESTAMP,PUSH_OPT_IN_OPT_IN_POSTPONED}from"../constants";/**
2
+ * Increment the app start count
3
+ * @return {Object} The dispatched action object.
4
+ */export var increaseAppStartCount=function increaseAppStartCount(){return{type:PUSH_OPT_IN_INCREASE_APP_START_COUNT};};/**
5
+ * Reset the app start count, and increment reset counts
6
+ * @return {Object} The dispatched action object.
7
+ */export var resetAppStartCount=function resetAppStartCount(){return{type:PUSH_OPT_IN_RESET_APP_START_COUNT};};/**
8
+ * Increment the orders placed count
9
+ * @return {Object} The dispatched action object.
10
+ */export var increaseOrdersPlacedCount=function increaseOrdersPlacedCount(){return{type:PUSH_OPT_IN_INCREASE_ORDERS_PLACED_COUNT};};/**
11
+ * Reset the orders placed count, and increment reset counts
12
+ * @return {Object} The dispatched action object.
13
+ */export var resetOrdersPlacedCount=function resetOrdersPlacedCount(){return{type:PUSH_OPT_IN_RESET_ORDERS_PLACED_COUNT};};/**
14
+ * Sets the last opt-in timestamp
15
+ * @return {Object} The dispatched action object.
16
+ */export var setLastPopupTimestamp=function setLastPopupTimestamp(){return{type:PUSH_OPT_IN_SET_LAST_POPUP_TIMESTAMP};};/**
17
+ * Increased the opt-in rejection / postponement count
18
+ * @return {Object} The dispatched action object.
19
+ */export var increaseRejectionCount=function increaseRejectionCount(){return{type:PUSH_OPT_IN_INCREASE_REJECTION_COUNT};};/**
20
+ * Action to be dispatched when push opt in was postponed e.g. Opt In Modal was closed without
21
+ * taking a decision about permissions.
22
+ * @return {Object} The dispatched action object.
23
+ */export var optInPostponed=function optInPostponed(){return{type:PUSH_OPT_IN_OPT_IN_POSTPONED};};
@@ -0,0 +1,7 @@
1
+ import{HIDE_PUSH_OPT_IN_MODAL,SHOW_PUSH_OPT_IN_MODAL}from"../constants";/**
2
+ * action to be dispatched when the push opt-in should be shown
3
+ * @returns {Function}
4
+ */export var showPushOptInModal=function showPushOptInModal(){return{type:SHOW_PUSH_OPT_IN_MODAL};};/**
5
+ * action to be dispatched when the push opt-in should be hidden
6
+ * @returns {Function}
7
+ */export var hidePushOptInModal=function hidePushOptInModal(){return{type:HIDE_PUSH_OPT_IN_MODAL};};
@@ -0,0 +1 @@
1
+ export*from"./pushOptInModal";
@@ -0,0 +1,8 @@
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{grantPushPermissions}from"../../core";import{hidePushOptInModal,optInPostponed}from"../action-creators";/**
2
+ * action to be dispatched when the user allowed the push opt-in in the modal
3
+ * and native modal should be triggered for setting the permission
4
+ * @returns {Function}
5
+ */export var allowPushOptIn=function allowPushOptIn(){return/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.next=2;return dispatch(grantPushPermissions({useSettingsModal:true}));case 2:dispatch(hidePushOptInModal());case 3:case"end":return _context.stop();}}},_callee);}));return function(_x){return _ref.apply(this,arguments);};}();};/**
6
+ * action to be dispatched when the user denied the push opt-in in the modal
7
+ * @returns {Function}
8
+ */export var denyPushOptIn=function denyPushOptIn(){return/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(dispatch){return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:_context2.next=2;return dispatch(optInPostponed());case 2:dispatch(hidePushOptInModal());case 3:case"end":return _context2.stop();}}},_callee2);}));return function(_x2){return _ref2.apply(this,arguments);};}();};
@@ -0,0 +1,9 @@
1
+ import{connect}from'react-redux';import{getIsPushOptInModalVisible}from"../../selectors";import{allowPushOptIn,denyPushOptIn}from"../../actions";/**
2
+ * Maps the contents of the state to the component props.
3
+ * @param {Object} state The current application state.
4
+ * @return {Object} The extended component props.
5
+ */var mapStateToProps=function mapStateToProps(state){return{isPushOptInModalVisible:getIsPushOptInModalVisible(state)};};/**
6
+ * Connects the dispatch function to a callable function in the props.
7
+ * @param {Function} dispatch The redux dispatch function.
8
+ * @return {Object} The extended component props.
9
+ */var mapDispatchToProps={allowPushOptIn:allowPushOptIn,denyPushOptIn:denyPushOptIn};export default connect(mapStateToProps,mapDispatchToProps);
@@ -0,0 +1,10 @@
1
+ import React,{useMemo}from'react';import PropTypes from'prop-types';import classNames from'classnames';import{Grid,I18n,Button,Modal}from'@shopgate/engage/components';import{appConfig}from'@shopgate/engage';import pushImage from"./push-opt-in.svg";import styles from"./style";import connect from"./connector";/**
2
+ * The Push opt-in modal component.
3
+ * @param {Object} props The component props.
4
+ * @returns {JSX.Element}
5
+ */var PushOptInModal=function PushOptInModal(_ref){var isPushOptInModalVisible=_ref.isPushOptInModalVisible,allowPushOptIn=_ref.allowPushOptIn,denyPushOptIn=_ref.denyPushOptIn;var _appConfig$pushOptIn=appConfig.pushOptIn;_appConfig$pushOptIn=_appConfig$pushOptIn===void 0?{}:_appConfig$pushOptIn;var modalMessage=_appConfig$pushOptIn.modalMessage,modalTitle=_appConfig$pushOptIn.modalTitle,modalButtonDeny=_appConfig$pushOptIn.modalButtonDeny,modalButtonAllow=_appConfig$pushOptIn.modalButtonAllow,modalImageURL=_appConfig$pushOptIn.modalImageURL,modalImageSVG=_appConfig$pushOptIn.modalImageSVG;var imageSRC=useMemo(function(){// No overwrite configured -> use default image
6
+ if(!modalImageURL&&!modalImageSVG){return pushImage;}// URL overwrite configured -> use it
7
+ if(modalImageURL){return modalImageURL;}// SVG overwrite configured -> create data url
8
+ try{// Remove any characters outside the Latin1 range
9
+ var decoded=decodeURIComponent(encodeURIComponent(modalImageSVG));// Now we can use btoa to convert the svg to base64
10
+ var base64=btoa(decoded);return"data:image/svg+xml;base64,".concat(base64);}catch(e){return pushImage;}},[modalImageSVG,modalImageURL]);if(!isPushOptInModalVisible){return null;}return/*#__PURE__*/React.createElement(Modal,{isOpened:isPushOptInModalVisible,classes:{content:styles.modalContent}},/*#__PURE__*/React.createElement(Grid,{className:classNames(styles.container,'push-opt-in-modal__container')},/*#__PURE__*/React.createElement(Grid.Item,{className:styles.item},/*#__PURE__*/React.createElement("img",{src:imageSRC,className:classNames(styles.image,'push-opt-in-modal__image'),alt:"","aria-hidden":"true"}),/*#__PURE__*/React.createElement(I18n.Text,{className:classNames(styles.title,'push-opt-in-modal__title'),string:modalTitle||'pushOptInModal.title'}),/*#__PURE__*/React.createElement(I18n.Text,{className:classNames('push-opt-in-modal__message'),string:modalMessage||'pushOptInModal.message'}),/*#__PURE__*/React.createElement(Button,{onClick:allowPushOptIn,type:"primary",className:classNames(styles.button,'push-opt-in-modal__button-allow')},/*#__PURE__*/React.createElement(I18n.Text,{string:modalButtonAllow||'pushOptInModal.buttonAllow'})),/*#__PURE__*/React.createElement(Button,{onClick:denyPushOptIn,type:"plain",className:classNames(styles.button,'push-opt-in-modal__button-deny')},/*#__PURE__*/React.createElement(I18n.Text,{string:modalButtonDeny||'pushOptInModal.buttonDeny',className:styles.buttonText})))));};export default connect(PushOptInModal);
@@ -0,0 +1,62 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg width="100%" height="100%" viewBox="0 0 1107 791" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
4
+ <g transform="matrix(1,0,0,1,-88.9596,-502.577)">
5
+ <g transform="matrix(1.28381,0,0,1.28381,-145.009,-328.293)">
6
+ <g>
7
+ <g transform="matrix(0.738616,0,0,0.7166,142.625,351.19)">
8
+ <path d="M1052.9,1091.68C1052.9,1062.46 1029.88,1038.73 1001.53,1038.73L244.024,1038.73C215.667,1038.73 192.646,1062.46 192.646,1091.68L192.646,1219.08C192.646,1248.3 215.667,1272.03 244.024,1272.03L1001.53,1272.03C1029.88,1272.03 1052.9,1248.3 1052.9,1219.08L1052.9,1091.68Z" style="fill:rgb(193,193,193);"/>
9
+ </g>
10
+ <g transform="matrix(0.859568,0,0,0.833947,80.1965,145.713)">
11
+ <path d="M1052.9,1091.68C1052.9,1062.46 1029.88,1038.73 1001.53,1038.73L244.024,1038.73C215.667,1038.73 192.646,1062.46 192.646,1091.68L192.646,1219.08C192.646,1248.3 215.667,1272.03 244.024,1272.03L1001.53,1272.03C1029.88,1272.03 1052.9,1248.3 1052.9,1219.08L1052.9,1091.68Z" style="fill:rgb(216,216,216);"/>
12
+ </g>
13
+ <g transform="matrix(1.00203,0,0,0.972164,-10.791,-90.8989)">
14
+ <path d="M1052.9,1091.68C1052.9,1062.46 1029.88,1038.73 1001.53,1038.73L244.024,1038.73C215.667,1038.73 192.646,1062.46 192.646,1091.68L192.646,1219.08C192.646,1248.3 215.667,1272.03 244.024,1272.03L1001.53,1272.03C1029.88,1272.03 1052.9,1248.3 1052.9,1219.08L1052.9,1091.68Z" style="fill:rgb(235,235,235);"/>
15
+ </g>
16
+ <g transform="matrix(1.00203,0,0,0.972164,-10.791,-362.62)">
17
+ <path d="M1052.9,1091.68C1052.9,1062.46 1029.88,1038.73 1001.53,1038.73L244.024,1038.73C215.667,1038.73 192.646,1062.46 192.646,1091.68L192.646,1219.08C192.646,1248.3 215.667,1272.03 244.024,1272.03L1001.53,1272.03C1029.88,1272.03 1052.9,1248.3 1052.9,1219.08L1052.9,1091.68Z" style="fill:rgb(235,235,235);"/>
18
+ </g>
19
+ </g>
20
+ <g transform="matrix(1.00052,0,0,1,-19.3912,30.3377)">
21
+ <path d="M953.776,1037.91C953.776,1035.43 951.762,1033.42 949.281,1033.42L424.519,1033.42C422.039,1033.42 420.025,1035.43 420.025,1037.91L420.025,1061.27C420.025,1063.75 422.039,1065.77 424.519,1065.77L949.281,1065.77C951.762,1065.77 953.776,1063.75 953.776,1061.27L953.776,1037.91Z" style="fill:rgb(187,196,198);fill-opacity:0.65;"/>
22
+ </g>
23
+ <g transform="matrix(0.823791,0,0,1,54.8392,-16.3916)">
24
+ <path d="M953.776,1037.91C953.776,1035.43 951.33,1033.42 948.317,1033.42L425.484,1033.42C422.471,1033.42 420.025,1035.43 420.025,1037.91L420.025,1061.27C420.025,1063.75 422.471,1065.77 425.484,1065.77L948.317,1065.77C951.33,1065.77 953.776,1063.75 953.776,1061.27L953.776,1037.91Z" style="fill:rgb(187,196,198);fill-opacity:0.65;"/>
25
+ </g>
26
+ <g transform="matrix(0.904048,0,0,1,21.129,-67.1309)">
27
+ <path d="M953.776,1037.91C953.776,1035.43 951.547,1033.42 948.801,1033.42L424.999,1033.42C422.254,1033.42 420.025,1035.43 420.025,1037.91L420.025,1061.27C420.025,1063.75 422.254,1065.77 424.999,1065.77L948.801,1065.77C951.547,1065.77 953.776,1063.75 953.776,1061.27L953.776,1037.91Z" style="fill:rgb(187,196,198);fill-opacity:0.65;"/>
28
+ </g>
29
+ <g transform="matrix(1.02071,0,0,1.04641,-38.8586,-763.331)">
30
+ <path d="M393.702,1679.71C393.702,1660.56 377.767,1645.02 358.141,1645.02L287.019,1645.02C267.393,1645.02 251.458,1660.56 251.458,1679.71L251.458,1749.29C251.458,1768.44 267.393,1783.98 287.019,1783.98L358.141,1783.98C377.767,1783.98 393.702,1768.44 393.702,1749.29L393.702,1679.71Z" style="fill:rgb(255,115,115);"/>
31
+ <clipPath id="_clip1">
32
+ <path d="M393.702,1679.71C393.702,1660.56 377.767,1645.02 358.141,1645.02L287.019,1645.02C267.393,1645.02 251.458,1660.56 251.458,1679.71L251.458,1749.29C251.458,1768.44 267.393,1783.98 287.019,1783.98L358.141,1783.98C377.767,1783.98 393.702,1768.44 393.702,1749.29L393.702,1679.71Z"/>
33
+ </clipPath>
34
+ <g clip-path="url(#_clip1)">
35
+ <g transform="matrix(0.76313,0,0,0.744387,148.731,1102.32)">
36
+ <path d="M226.411,745.537L243.421,797.888L298.467,797.888L253.934,830.243L270.944,882.594L226.411,850.239L181.879,882.594L198.889,830.243L154.356,797.888L209.402,797.888L226.411,745.537Z" style="fill:white;"/>
37
+ </g>
38
+ </g>
39
+ </g>
40
+ <g transform="matrix(0.933678,0,0,1,8.6838,-241.981)">
41
+ <path d="M953.776,1037.91C953.776,1035.43 951.617,1033.42 948.959,1033.42L424.841,1033.42C422.183,1033.42 420.025,1035.43 420.025,1037.91L420.025,1061.27C420.025,1063.75 422.183,1065.77 424.841,1065.77L948.959,1065.77C951.617,1065.77 953.776,1063.75 953.776,1061.27L953.776,1037.91Z" style="fill:rgb(187,196,198);fill-opacity:0.65;"/>
42
+ </g>
43
+ <g transform="matrix(1,0,0,1,-19.173,-288.71)">
44
+ <path d="M953.776,1037.91C953.776,1035.43 951.761,1033.42 949.279,1033.42L424.522,1033.42C422.04,1033.42 420.025,1035.43 420.025,1037.91L420.025,1061.27C420.025,1063.75 422.04,1065.77 424.522,1065.77L949.279,1065.77C951.761,1065.77 953.776,1063.75 953.776,1061.27L953.776,1037.91Z" style="fill:rgb(187,196,198);fill-opacity:0.65;"/>
45
+ </g>
46
+ <g transform="matrix(0.844941,0,0,1,45.9556,-337.889)">
47
+ <path d="M953.776,1037.91C953.776,1035.43 951.391,1033.42 948.453,1033.42L425.347,1033.42C422.409,1033.42 420.025,1035.43 420.025,1037.91L420.025,1061.27C420.025,1063.75 422.409,1065.77 425.347,1065.77L948.453,1065.77C951.391,1065.77 953.776,1063.75 953.776,1061.27L953.776,1037.91Z" style="fill:rgb(187,196,198);fill-opacity:0.65;"/>
48
+ </g>
49
+ <g transform="matrix(1.02071,0,0,1.04641,-38.8586,-1035.65)">
50
+ <path d="M393.702,1679.71C393.702,1660.56 377.767,1645.02 358.141,1645.02L287.019,1645.02C267.393,1645.02 251.458,1660.56 251.458,1679.71L251.458,1749.29C251.458,1768.44 267.393,1783.98 287.019,1783.98L358.141,1783.98C377.767,1783.98 393.702,1768.44 393.702,1749.29L393.702,1679.71Z" style="fill:rgb(255,115,115);"/>
51
+ <clipPath id="_clip2">
52
+ <path d="M393.702,1679.71C393.702,1660.56 377.767,1645.02 358.141,1645.02L287.019,1645.02C267.393,1645.02 251.458,1660.56 251.458,1679.71L251.458,1749.29C251.458,1768.44 267.393,1783.98 287.019,1783.98L358.141,1783.98C377.767,1783.98 393.702,1768.44 393.702,1749.29L393.702,1679.71Z"/>
53
+ </clipPath>
54
+ <g clip-path="url(#_clip2)">
55
+ <g transform="matrix(0.979712,0,0,0.955649,69.3286,762.785)">
56
+ <text x="193.673px" y="1041.62px" style="font-family:'HelveticaNeue-Bold', 'Helvetica Neue';font-weight:700;font-size:128px;fill:white;">%</text>
57
+ </g>
58
+ </g>
59
+ </g>
60
+ </g>
61
+ </g>
62
+ </svg>
@@ -0,0 +1 @@
1
+ import{css}from'glamor';import{themeColors}from'@shopgate/pwa-common/helpers/config';var modalContent=css({width:'100%'}).toString();var container=css({backgroundColor:themeColors.lightOverlay,height:'100vh',textAlign:'center',padding:'30px',justifyContent:'center',display:'flex',flexDirection:'column'}).toString();var title=css({fontWeight:'bold',fontSize:'1.35rem',paddingTop:'30px',paddingBottom:'30px'}).toString();var item=css({display:'flex',flexDirection:'column',alignItems:'center'}).toString();var link=css({paddingTop:'30px',textAlign:'center',color:themeColors.gray}).toString();var image=css({width:'80%',maxWidth:400}).toString();var button=css({marginTop:'30px'}).toString();var buttonText=css({color:themeColors.gray}).toString();export default{modalContent:modalContent,container:container,item:item,title:title,link:link,image:image,button:button,buttonText:buttonText};
@@ -0,0 +1 @@
1
+ export{default as PushOptInModal}from"./PushOptInModal";