@shopgate/engage 7.20.0-beta.3 → 7.20.0-beta.4

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.
@@ -1,4 +1,4 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{ADD_CUSTOMER_CONTACT,ADD_CUSTOMER_CONTACT_SUCCESS,ADD_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
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{PipelineRequest}from'@shopgate/engage/core/classes';import{ADD_CUSTOMER_CONTACT,ADD_CUSTOMER_CONTACT_SUCCESS,ADD_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
2
2
  * Starts entering the checkout process for the customer.
3
3
  * @returns {Function}
4
4
  */export var addCustomerContacts=function addCustomerContacts(_ref){var contacts=_ref.contacts;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var response;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:ADD_CUSTOMER_CONTACT,contacts:contacts});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.addContacts').setTrusted().setInput({contacts:contacts}).dispatch();case 4:response=_context.sent;dispatch({type:ADD_CUSTOMER_CONTACT_SUCCESS,contacts:contacts});_context.next=12;break;case 8:_context.prev=8;_context.t0=_context["catch"](1);dispatch({type:ADD_CUSTOMER_CONTACT_ERROR,contacts:contacts,error:_context.t0});throw _context.t0;case 12:return _context.abrupt("return",response);case 13:case"end":return _context.stop();}},_callee,null,[[1,8]]);}));return function(_x){return _ref2.apply(this,arguments);};}());};
@@ -1,4 +1,4 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{DELETE_CUSTOMER_CONTACT,DELETE_CUSTOMER_CONTACT_SUCCESS,DELETE_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
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{PipelineRequest}from'@shopgate/engage/core/classes';import{DELETE_CUSTOMER_CONTACT,DELETE_CUSTOMER_CONTACT_SUCCESS,DELETE_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
2
2
  * Starts entering the checkout process for the customer.
3
3
  * @param {Object} contactId Contact
4
4
  * @returns {Function}
@@ -1,4 +1,4 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{successLogout}from'@shopgate/pwa-common/action-creators/user';import{DELETE_CUSTOMER,DELETE_CUSTOMER_SUCCESS,DELETE_CUSTOMER_ERROR}from"../constants/actions";/**
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{PipelineRequest}from'@shopgate/engage/core/classes';import{successLogout}from'@shopgate/pwa-common/action-creators/user';import{DELETE_CUSTOMER,DELETE_CUSTOMER_SUCCESS,DELETE_CUSTOMER_ERROR}from"../constants/actions";/**
2
2
  * Starts entering the checkout process for the customer.
3
3
  * @returns {Function}
4
4
  */export var deleteCustomer=function deleteCustomer(){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:dispatch({type:DELETE_CUSTOMER});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.deleteCustomer').setTrusted().dispatch();case 4:dispatch({type:DELETE_CUSTOMER_SUCCESS});dispatch(successLogout(false));_context.next=12;break;case 8:_context.prev=8;_context.t0=_context["catch"](1);dispatch({type:DELETE_CUSTOMER_ERROR,error:_context.t0});throw _context.t0;case 12:case"end":return _context.stop();}},_callee,null,[[1,8]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
@@ -1,4 +1,4 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{FETCH_CUSTOMER_CONTACTS,FETCH_CUSTOMER_CONTACTS_SUCCESS,FETCH_CUSTOMER_CONTACTS_ERROR}from"../constants/actions";/**
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{PipelineRequest}from'@shopgate/engage/core/classes';import{FETCH_CUSTOMER_CONTACTS,FETCH_CUSTOMER_CONTACTS_SUCCESS,FETCH_CUSTOMER_CONTACTS_ERROR}from"../constants/actions";/**
2
2
  * Starts entering the checkout process for the customer.
3
3
  * @returns {Function}
4
4
  */export var fetchCustomerContacts=function fetchCustomerContacts(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var _ref3,contacts;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:FETCH_CUSTOMER_CONTACTS});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.getContacts').setTrusted().dispatch();case 4:_ref3=_context.sent;contacts=_ref3.contacts;dispatch({type:FETCH_CUSTOMER_CONTACTS_SUCCESS,contacts:contacts});return _context.abrupt("return",contacts);case 10:_context.prev=10;_context.t0=_context["catch"](1);dispatch({type:FETCH_CUSTOMER_CONTACTS_ERROR,error:_context.t0});throw _context.t0;case 14:case"end":return _context.stop();}},_callee,null,[[1,10]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
@@ -1,4 +1,4 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{FETCH_CUSTOMER,FETCH_CUSTOMER_ERROR,FETCH_CUSTOMER_SUCCESS}from"../constants/actions";/**
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{PipelineRequest}from'@shopgate/engage/core/classes';import{FETCH_CUSTOMER,FETCH_CUSTOMER_ERROR,FETCH_CUSTOMER_SUCCESS}from"../constants/actions";/**
2
2
  * Starts entering the checkout process for the customer.
3
3
  * @returns {Function}
4
4
  */export var fetchCustomerData=function fetchCustomerData(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var _ref3,customer;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:FETCH_CUSTOMER});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.getCustomer').setTrusted().dispatch();case 4:_ref3=_context.sent;customer=_ref3.customer;dispatch({type:FETCH_CUSTOMER_SUCCESS,customer:customer});return _context.abrupt("return",customer);case 10:_context.prev=10;_context.t0=_context["catch"](1);dispatch({type:FETCH_CUSTOMER_ERROR,error:_context.t0});throw _context.t0;case 14:case"end":return _context.stop();}},_callee,null,[[1,10]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
@@ -1,4 +1,4 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{UPDATE_CUSTOMER_CONTACT,UPDATE_CUSTOMER_CONTACT_SUCCESS,UPDATE_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
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{PipelineRequest}from'@shopgate/engage/core/classes';import{UPDATE_CUSTOMER_CONTACT,UPDATE_CUSTOMER_CONTACT_SUCCESS,UPDATE_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
2
2
  * Starts entering the checkout process for the customer.
3
3
  * @returns {Function}
4
4
  */export var updateCustomerContact=function updateCustomerContact(_ref){var contactId=_ref.contactId,contact=_ref.contact;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:UPDATE_CUSTOMER_CONTACT,contactId:contactId,contact:contact});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.updateContact').setTrusted().setInput({contactId:contactId,contact:contact}).dispatch();case 4:dispatch({type:UPDATE_CUSTOMER_CONTACT_SUCCESS,contactId:contactId});_context.next=11;break;case 7:_context.prev=7;_context.t0=_context["catch"](1);dispatch({type:UPDATE_CUSTOMER_CONTACT_ERROR,contactId:contactId,error:_context.t0});throw _context.t0;case 11:case"end":return _context.stop();}},_callee,null,[[1,7]]);}));return function(_x){return _ref2.apply(this,arguments);};}());};
@@ -1,4 +1,4 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{UPDATE_CUSTOMER,UPDATE_CUSTOMER_SUCCESS,UPDATE_CUSTOMER_ERROR}from"../constants/actions";/**
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{PipelineRequest}from'@shopgate/engage/core/classes';import{UPDATE_CUSTOMER,UPDATE_CUSTOMER_SUCCESS,UPDATE_CUSTOMER_ERROR}from"../constants/actions";/**
2
2
  * @param {Object} customer Customer
3
3
  * @returns {Function}
4
4
  */export var updateCustomerData=function updateCustomerData(customer){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:dispatch({type:UPDATE_CUSTOMER,customer:customer});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.updateCustomer').setInput({customer:customer}).setTrusted().dispatch();case 4:dispatch({type:UPDATE_CUSTOMER_SUCCESS,customer:customer});_context.next=11;break;case 7:_context.prev=7;_context.t0=_context["catch"](1);dispatch({type:UPDATE_CUSTOMER_ERROR,customer:customer,error:_context.t0});throw _context.t0;case 11:case"end":return _context.stop();}},_callee,null,[[1,7]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
@@ -1,5 +1,6 @@
1
1
  function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React,{useMemo}from'react';import classNames from'classnames';import{Grid,Link,TextLink,ProductProperties,SurroundPortals,ConditionalWrapper,I18n}from'@shopgate/engage/components';import{CART_ITEM_IMAGE,CART_ITEM_LINK,CART_ITEM_PROPERTIES,CART_ITEM_QUANTITY_PICKER}from'@shopgate/engage/cart';import{showTaxDisclaimer}from'@shopgate/engage/market';import{bin2hex}from'@shopgate/engage/core/helpers';import{useWidgetSettings}from'@shopgate/engage/core/hooks';import{ProductImage,PriceInfo,ITEM_PATH}from'@shopgate/engage/product';import{CartItemProductChangeLocation,CartChangeFulfillmentMethod}from'@shopgate/engage/locations';import{getLineItemActiveStatus}from'@shopgate/engage/orders';import{CartItemQuantityPicker}from"./CartItemQuantityPicker";import{CartItemProductTitle}from"./CartItemProductTitle";import CartItemProductOrderDetails from"./CartItemProductOrderDetails";import CartItemProductPriceList from"./CartItemProductPriceList";import{useCartItem,useCartItemProduct}from"./CartItem.hooks";import styles from"./CartItemProductLayout.style";/**
2
2
  * The Cart Product Layout component.
3
3
  * @returns {JSX}
4
- */export function CartItemProductLayout(){var _useWidgetSettings=useWidgetSettings('@shopgate/engage/components/TaxDisclaimer'),show=_useWidgetSettings.show;// use widget setting if set to true/false, otherwise use market logic
4
+ */export function CartItemProductLayout(){// Added with PWA 6 - CCP-2372
5
+ var _useWidgetSettings=useWidgetSettings('@shopgate/engage/components/TaxDisclaimer'),show=_useWidgetSettings.show;// use widget setting if set to true/false, otherwise use market logic
5
6
  var showDisclaimer=typeof show==='boolean'?show:showTaxDisclaimer;var _useCartItem=useCartItem(),registerFulfillmentAction=_useCartItem.registerFulfillmentAction,isOrderDetails=_useCartItem.isOrderDetails,isCheckoutConfirmation=_useCartItem.isCheckoutConfirmation;var context=useCartItemProduct();var cartItem=context.cartItem,product=context.product,currency=context.currency,editMode=context.editMode,handleUpdate=context.handleUpdate,toggleEditMode=context.toggleEditMode,isEditable=context.isEditable;var portalProps=useMemo(function(){return _extends({},context,{isOrderDetails:isOrderDetails,isCheckoutConfirmation:isCheckoutConfirmation,quantity:cartItem.quantity});},[cartItem.quantity,context,isCheckoutConfirmation,isOrderDetails]);var isActive=!isOrderDetails?true:getLineItemActiveStatus(cartItem===null||cartItem===void 0?void 0:cartItem.status,cartItem===null||cartItem===void 0?void 0:cartItem.subStatus);var showLineItemPromotions=useMemo(function(){if(isOrderDetails||isCheckoutConfirmation){return false;}return((cartItem===null||cartItem===void 0?void 0:cartItem.appliedPromotions)||[]).length>0;},[cartItem,isCheckoutConfirmation,isOrderDetails]);return React.createElement(React.Fragment,null,React.createElement(Grid,{className:classNames(styles.item,_defineProperty({},styles.itemInactive,!isActive))},React.createElement(Grid.Item,{className:styles.content,grow:1},React.createElement(ConditionalWrapper,{condition:isEditable,wrapper:function wrapper(children){return React.createElement(TextLink,{href:"".concat(ITEM_PATH,"/").concat(bin2hex(product.id))},children);}},React.createElement(SurroundPortals,{portalName:CART_ITEM_LINK,portalProps:portalProps},React.createElement(CartItemProductTitle,{value:product.name}))),React.createElement(Grid,{className:styles.info},React.createElement(Grid.Item,{grow:1,className:styles.properties},React.createElement(SurroundPortals,{portalName:CART_ITEM_PROPERTIES,portalProps:portalProps},React.createElement(ProductProperties,{properties:product.properties,lineClamp:2})),isOrderDetails&&React.createElement(CartItemProductOrderDetails,null)),React.createElement(Grid.Item,{grow:1,className:styles.price},isOrderDetails&&React.createElement(I18n.Text,{string:"cart.subtotal",className:styles.orderDetailsSubtotalLabel}),!showLineItemPromotions&&React.createElement(React.Fragment,null,React.createElement(CartItemProductPriceList,{isSubtotal:true}),React.createElement(PriceInfo,{product:product,currency:currency,className:styles.priceInfo}))),showDisclaimer&&React.createElement(Grid.Item,{className:styles.disclaimerSpacer,grow:0,shrink:0})),showLineItemPromotions&&React.createElement(Grid,{className:classNames(styles.info,styles.promotionLine)},React.createElement(Grid.Item,null),React.createElement(Grid.Item,{className:styles.promotionLineItem},React.createElement(CartItemProductPriceList,{isSubtotal:true,showLabels:true}),React.createElement(PriceInfo,{product:product,currency:currency,className:styles.priceInfo})))),React.createElement(Grid.Item,{className:styles.leftColumn},React.createElement("div",{className:styles.image,"aria-hidden":true},React.createElement(ConditionalWrapper,{condition:isEditable,wrapper:function wrapper(children){return React.createElement(Link,{tagName:"a",href:"".concat(ITEM_PATH,"/").concat(bin2hex(product.id))},children);}},React.createElement(SurroundPortals,{portalName:CART_ITEM_IMAGE,portalProps:portalProps},React.createElement(ProductImage,{src:product.featuredImageBaseUrl||product.featuredImageUrl})))),!isOrderDetails&&React.createElement(SurroundPortals,{portalName:CART_ITEM_QUANTITY_PICKER,portalProps:portalProps},React.createElement(CartItemQuantityPicker,{unit:product.unit,hasCatchWeight:product.hasCatchWeight,quantity:cartItem.quantity,editMode:editMode,onChange:handleUpdate,onToggleEditMode:toggleEditMode,disabled:!isEditable})))),React.createElement(CartItemProductChangeLocation,{cartItem:cartItem,registerAction:registerFulfillmentAction}),React.createElement(CartChangeFulfillmentMethod,{cartItem:cartItem,registerAction:registerFulfillmentAction}));}
@@ -5,4 +5,4 @@ import{i18n}from'@shopgate/engage/core';var pickupFieldActions=[{type:'setVisibi
5
5
  * @param {Array} options.countrySortOrder Sort order for supported countries.
6
6
  * @param {Object} options.userLocation User location for better phone picker defaults.
7
7
  * @returns {Object}
8
- */var generateFormConfig=function generateFormConfig(_ref){var supportedCountries=_ref.supportedCountries,countrySortOrder=_ref.countrySortOrder,userLocation=_ref.userLocation;return{fields:{instructions:{type:'text',label:i18n.text('checkout.pickup_contact.form.instructions'),placeholder:i18n.text('checkout.pickup_contact.form.instructionsPlaceholder')},pickupPerson:{type:'radio',label:i18n.text('checkout.pickup_contact.form.who_will_pickup'),options:{me:i18n.text('checkout.pickup_contact.form.me'),someoneElse:i18n.text('checkout.pickup_contact.form.someone_else')}},firstName:{type:'text',actions:pickupFieldActions,label:"".concat(i18n.text('checkout.pickup_contact.form.firstName')," *")},lastName:{type:'text',actions:pickupFieldActions,label:"".concat(i18n.text('checkout.pickup_contact.form.lastName')," *")},emailAddress:{type:'email',actions:pickupFieldActions,label:"".concat(i18n.text('checkout.pickup_contact.form.emailAddress')," *")},mobile:{type:'phone_picker',label:"".concat(i18n.text('checkout.pickup_contact.form.mobile')," *"),actions:pickupFieldActions,config:{supportedCountries:supportedCountries,countrySortOrder:countrySortOrder,userLocation:userLocation}}}};};export default generateFormConfig;
8
+ */var generateFormConfig=function generateFormConfig(_ref){var supportedCountries=_ref.supportedCountries,countrySortOrder=_ref.countrySortOrder,userLocation=_ref.userLocation;return{fields:{instructions:{type:'text',label:i18n.text('checkout.pickup_contact.form.instructions')},pickupPerson:{type:'radio',label:i18n.text('checkout.pickup_contact.form.who_will_pickup'),options:{me:i18n.text('checkout.pickup_contact.form.me'),someoneElse:i18n.text('checkout.pickup_contact.form.someone_else')}},firstName:{type:'text',actions:pickupFieldActions,label:"".concat(i18n.text('checkout.pickup_contact.form.firstName')," *")},lastName:{type:'text',actions:pickupFieldActions,label:"".concat(i18n.text('checkout.pickup_contact.form.lastName')," *")},emailAddress:{type:'email',actions:pickupFieldActions,label:"".concat(i18n.text('checkout.pickup_contact.form.emailAddress')," *")},mobile:{type:'phone_picker',label:"".concat(i18n.text('checkout.pickup_contact.form.mobile')," *"),actions:pickupFieldActions,config:{supportedCountries:supportedCountries,countrySortOrder:countrySortOrder,userLocation:userLocation}}}};};export default generateFormConfig;
@@ -1,4 +1,4 @@
1
1
  import{i18n}from'@shopgate/engage/core';/**
2
2
  * Generates form configuration.
3
3
  * @returns {Object}
4
- */var generateFormConfig=function generateFormConfig(){return{fields:{instructions:{type:'text',label:i18n.text('checkout.pickup_contact.form.instructions'),placeholder:i18n.text('checkout.pickup_contact.form.instructionsPlaceholder')}}};};export default generateFormConfig;
4
+ */var generateFormConfig=function generateFormConfig(){return{fields:{instructions:{type:'text',label:i18n.text('checkout.pickup_contact.form.instructions')}}};};export default generateFormConfig;
@@ -1 +1 @@
1
- export{CheckoutConfirmationPickUpContact,CheckoutConfirmationOrderContact,CheckoutConfirmationBilledTo,CheckoutConfirmationShippedTo,CheckoutConfirmationOrderSummary,CheckoutConfirmationSection}from"./CheckoutConfirmation";export{SupplementalContent}from"./SupplementalContent";
1
+ export{CheckoutConfirmationPickUpContact,CheckoutConfirmationOrderContact,CheckoutConfirmationBilledTo,CheckoutConfirmationShippedTo,CheckoutConfirmationOrderSummary,CheckoutConfirmationSection}from"./CheckoutConfirmation";export{SupplementalContent}from"./SupplementalContent";export{default as Checkout}from"./Checkout/Checkout";export{default as GuestCheckoutPayment}from"./GuestCheckout/GuestCheckout";export{default as CheckoutConfirmation}from"./CheckoutConfirmation/CheckoutConfirmation";export{default as AddressBook}from"./AddressBook";export{default as AddressBookContact}from"./AddressBookContact";
package/checkout/index.js CHANGED
@@ -3,5 +3,4 @@ export{default as fetchCheckoutUrl}from'@shopgate/pwa-common-commerce/checkout/a
3
3
  export*from"./constants";// SELECTORS
4
4
  export*from'@shopgate/pwa-common-commerce/checkout/selectors';export*from"./selectors/guestCheckout";export*from"./selectors/order";export*from"./selectors/route";// STREAMS
5
5
  export*from'@shopgate/pwa-common-commerce/checkout/streams';// HOOKS
6
- export*from"./hooks/common";// Components
7
- export{default as Checkout}from"./components/Checkout/Checkout";export{default as GuestCheckoutPayment}from"./components/GuestCheckout/GuestCheckout";export{default as CheckoutConfirmation}from"./components/CheckoutConfirmation/CheckoutConfirmation";export{default as AddressBook}from"./components/AddressBook";export{default as AddressBookContact}from"./components/AddressBookContact";
6
+ export*from"./hooks/common";
@@ -1,8 +1,9 @@
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{loadStripe}from'@stripe/stripe-js';var resolve;var reject;var stripe;export var promise=new Promise(function(res,rej){resolve=res;reject=rej;});var loaded=false;/**
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{loadStripe}from'@stripe/stripe-js';import{logger}from'@shopgate/engage/core/helpers';// Write a log when sdk module loads - should not happen before entering native checkout
2
+ logger.warn('Stripe SDK loaded');var resolve;var reject;var stripe;export var promise=new Promise(function(res,rej){resolve=res;reject=rej;});var loaded=false;/**
2
3
  * Loads the stripe sdk
3
4
  * @param {string} publishableKey The publishable stripe key.
4
5
  * @returns {Stripe}
5
- */export var loadSdk=function loadSdk(publishableKey){if(loaded){return promise;}loaded=true;/** */var fn=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){var stripeObject;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;_context.next=3;return loadStripe(publishableKey);case 3:stripeObject=_context.sent;stripe=stripeObject;resolve(stripeObject);return _context.abrupt("return",stripeObject);case 9:_context.prev=9;_context.t0=_context["catch"](0);reject(_context.t0);throw _context.t0;case 13:case"end":return _context.stop();}},_callee,null,[[0,9]]);}));return function fn(){return _ref.apply(this,arguments);};}();return fn();};/**
6
+ */export var loadSdk=function loadSdk(publishableKey){if(loaded||!publishableKey){return promise;}loaded=true;/** */var fn=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){var stripeObject;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;_context.next=3;return loadStripe(publishableKey);case 3:stripeObject=_context.sent;stripe=stripeObject;resolve(stripeObject);return _context.abrupt("return",stripeObject);case 9:_context.prev=9;_context.t0=_context["catch"](0);reject(_context.t0);throw _context.t0;case 13:case"end":return _context.stop();}},_callee,null,[[0,9]]);}));return function fn(){return _ref.apply(this,arguments);};}();return fn();};/**
6
7
  * Returns the sdk
7
8
  * @returns {Object}
8
9
  * */export var getSdk=function getSdk(){return stripe;};
@@ -3,12 +3,12 @@ function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimi
3
3
  */var makeMapStateToProps=function makeMapStateToProps(){var isRopeProductOrderable=makeIsRopeProductOrderable(function(state,props){var _getPreferredLocation;return(_getPreferredLocation=getPreferredLocation(state,props))===null||_getPreferredLocation===void 0?void 0:_getPreferredLocation.code;},function(state,props){return props.variantId||props.productId||null;});return function(state,props){return{isBaseProduct:isBaseProductSelector(state,props),hasVariants:hasProductVariants(state,props),isOrderable:isProductOrderable(state,props),isRopeProductOrderable:isRopeProductOrderable(state,props)};};};/**
4
4
  * @param {Function} dispatch Dispatch.
5
5
  * @returns {Object}
6
- */var mapDispatchToProps=function mapDispatchToProps(dispatch){return{showModal:function showModal(){return dispatch(showModalAction.apply(void 0,arguments));},historyPush:function historyPush(){return dispatch(historyPushAction.apply(void 0,arguments));},updateFavoriteItem:function updateFavoriteItem(productId,listId,quantity,notes){dispatch(updateFavorite(productId,listId,quantity,notes));},openCommentDialog:function openCommentDialog(productId,listId){return dispatch(openFavoritesCommentDialog(productId,listId));}};};var styles={root:css({display:'flex',position:'relative','&:not(:last-child)':{marginBottom:16}}).toString(),imageContainer:css(_defineProperty(_defineProperty(_defineProperty({flex:0.4,marginRight:18},responsiveMediaQuery('>=xs',{appAlways:true}),{maxWidth:120,minWidth:80}),responsiveMediaQuery('>=md',{webOnly:true}),{maxWidth:120,minWidth:80}),responsiveMediaQuery('>=md',{webOnly:true}),{width:120,flex:'none'})).toString(),infoContainer:css({flex:1,display:'flex',flexDirection:'column',flexWrap:'wrap',gap:8}).toString(),infoContainerRow:css({flexDirection:'row',display:'flex',justifyContent:'space-between'}).toString(),quantityContainer:css({flexDirection:'row',display:'flex',alignItems:'center',flexWrap:'wrap',gap:16}).toString(),priceContainer:css({minWidth:100}).toString(),priceInfo:css({wordBreak:'break-word',fontSize:'0.875rem',lineHeight:'0.875rem',color:'var(--color-text-low-emphasis)',padding:"".concat(variables.gap.xsmall,"px 0")}).toString(),titleWrapper:css({display:'flex',flexDirection:'column',gap:8}).toString(),titleContainer:css({marginRight:10,flex:1}).toString(),title:css({fontSize:17,fontWeight:600}).toString(),removeContainer:css({display:'flex',flexShrink:0,alignItems:'flex-start'})};/**
6
+ */var mapDispatchToProps=function mapDispatchToProps(dispatch){return{showModal:function showModal(){return dispatch(showModalAction.apply(void 0,arguments));},historyPush:function historyPush(){return dispatch(historyPushAction.apply(void 0,arguments));},updateFavoriteItem:function updateFavoriteItem(productId,listId,quantity,notes){dispatch(updateFavorite(productId,listId,quantity,notes));},openCommentDialog:function openCommentDialog(productId,listId){return dispatch(openFavoritesCommentDialog(productId,listId));}};};var styles={root:css({display:'flex',position:'relative','&:not(:last-child)':{marginBottom:16}}).toString(),imageContainer:css(_defineProperty(_defineProperty(_defineProperty({flex:0.4,marginRight:18},responsiveMediaQuery('>=xs',{appAlways:true}),{maxWidth:120,minWidth:80}),responsiveMediaQuery('>=md',{webOnly:true}),{maxWidth:120,minWidth:80}),responsiveMediaQuery('>=md',{webOnly:true}),{width:120,flex:'none'})).toString(),infoContainer:css({flex:1,display:'flex',flexDirection:'column',flexWrap:'wrap',gap:8}).toString(),infoContainerRow:css({flexDirection:'row',display:'flex',justifyContent:'space-between'}).toString(),quantityContainer:css({flexDirection:'row',display:'flex',alignItems:'center',flexWrap:'wrap',gap:16}).toString(),priceContainer:css({minWidth:100}).toString(),priceContainerInner:css({display:'inline-block',textAlign:'right'}),price:css({justifyContent:'flex-end'}).toString(),priceInfo:css({wordBreak:'break-word',fontSize:'0.875rem',lineHeight:'0.875rem',color:'var(--color-text-low-emphasis)',padding:"".concat(variables.gap.xsmall,"px 0")}).toString(),titleWrapper:css({display:'flex',flexDirection:'column',gap:8}).toString(),titleContainer:css({marginRight:10,flex:1}).toString(),title:css({fontSize:17,fontWeight:600}).toString(),removeContainer:css({display:'flex',flexShrink:0,alignItems:'flex-start'})};/**
7
7
  * Favorite Item component
8
8
  * @return {JSX}
9
- */var FavoriteItem=function FavoriteItem(_ref){var _product$price,_product$price2,_product$price3;var listId=_ref.listId,product=_ref.product,notes=_ref.notes,quantity=_ref.quantity,remove=_ref.remove,addToCart=_ref.addToCart,isBaseProduct=_ref.isBaseProduct,isOrderable=_ref.isOrderable,isRopeProductOrderable=_ref.isRopeProductOrderable,hasVariants=_ref.hasVariants,showModal=_ref.showModal,historyPush=_ref.historyPush,updateFavoriteItem=_ref.updateFavoriteItem,openCommentDialog=_ref.openCommentDialog;var _ref2=getThemeSettings('AppImages')||{},gridResolutions=_ref2.ListImage;var _useState=useState(!isOrderable&&!hasVariants),_useState2=_slicedToArray(_useState,2),isDisabled=_useState2[0],setIsDisabled=_useState2[1];var currency=((_product$price=product.price)===null||_product$price===void 0?void 0:_product$price.currency)||'EUR';var defaultPrice=((_product$price2=product.price)===null||_product$price2===void 0?void 0:_product$price2.unitPrice)||0;var specialPrice=(_product$price3=product.price)===null||_product$price3===void 0?void 0:_product$price3.unitPriceStriked;var hasStrikePrice=typeof specialPrice==='number'&&specialPrice>0&&specialPrice>defaultPrice;var price=hasStrikePrice?specialPrice:defaultPrice;var characteristics=(product===null||product===void 0?void 0:product.characteristics)||[];var productLink="".concat(ITEM_PATH,"/").concat(bin2hex(product.id));var notesButtonRef=useRef();var _useState3=useState(quantity),_useState4=_slicedToArray(_useState3,2),internalQuantity=_useState4[0],setInternalQuantity=_useState4[1];useEffect(function(){setInternalQuantity(quantity);},[quantity]);useLayoutEffect(function(){setIsDisabled(!isOrderable&&!hasVariants);},[hasVariants,isOrderable]);var handleOpenComment=useCallback(function(e){e.preventDefault();e.stopPropagation();openCommentDialog(product.id,listId);},[listId,openCommentDialog,product.id]);var handleAddToCart=useCallback(function(e){e.preventDefault();e.stopPropagation();if(isBaseProduct&&hasVariants){// Called for a parent product. User needs to confirm the navigation to the PDP
9
+ */var FavoriteItem=function FavoriteItem(_ref){var _product$price,_product$price2,_product$price3;var listId=_ref.listId,product=_ref.product,notes=_ref.notes,quantity=_ref.quantity,remove=_ref.remove,addToCart=_ref.addToCart,isBaseProduct=_ref.isBaseProduct,isOrderable=_ref.isOrderable,isRopeProductOrderable=_ref.isRopeProductOrderable,hasVariants=_ref.hasVariants,showModal=_ref.showModal,historyPush=_ref.historyPush,updateFavoriteItem=_ref.updateFavoriteItem,openCommentDialog=_ref.openCommentDialog;var _ref2=getThemeSettings('AppImages')||{},gridResolutions=_ref2.ListImage;var _useState=useState(!isOrderable&&!hasVariants),_useState2=_slicedToArray(_useState,2),isDisabled=_useState2[0],setIsDisabled=_useState2[1];var currency=((_product$price=product.price)===null||_product$price===void 0?void 0:_product$price.currency)||'EUR';var defaultPrice=((_product$price2=product.price)===null||_product$price2===void 0?void 0:_product$price2.unitPrice)||0;var specialPrice=(_product$price3=product.price)===null||_product$price3===void 0?void 0:_product$price3.unitPriceStriked;var hasStrikePrice=typeof specialPrice==='number'&&specialPrice>=defaultPrice;var price=hasStrikePrice?specialPrice:defaultPrice;var characteristics=(product===null||product===void 0?void 0:product.characteristics)||[];var productLink="".concat(ITEM_PATH,"/").concat(bin2hex(product.id));var notesButtonRef=useRef();var _useState3=useState(quantity),_useState4=_slicedToArray(_useState3,2),internalQuantity=_useState4[0],setInternalQuantity=_useState4[1];useEffect(function(){setInternalQuantity(quantity);},[quantity]);useLayoutEffect(function(){setIsDisabled(!isOrderable&&!hasVariants);},[hasVariants,isOrderable]);var handleOpenComment=useCallback(function(e){e.preventDefault();e.stopPropagation();openCommentDialog(product.id,listId);},[listId,openCommentDialog,product.id]);var handleAddToCart=useCallback(function(e){e.preventDefault();e.stopPropagation();if(isBaseProduct&&hasVariants){// Called for a parent product. User needs to confirm the navigation to the PDP
10
10
  showModal({title:null,type:MODAL_VARIANT_SELECT,message:'favorites.modal.message',confirm:'favorites.modal.confirm',dismiss:'common.cancel',params:{productId:product.id}});return false;}if(hasNewServices()&&!isRopeProductOrderable){// Product is not orderable for ROPE. So users need to do some corrections. Just redirect.
11
11
  historyPush({pathname:productLink});return false;}broadcastLiveMessage('product.adding_item',{params:{count:1}});return addToCart(e);},[addToCart,hasVariants,historyPush,isBaseProduct,isRopeProductOrderable,product.id,productLink,showModal]);var commonPortalProps=useMemo(function(){var availability=product.availability,id=product.id,name=product.name;return{availability:availability,characteristics:characteristics,id:id,name:name,price:price,listId:listId};},[characteristics,listId,price,product]);var ctaPortalProps=useMemo(function(){return{isLoading:false,noShadow:false,listId:listId,isBaseProduct:isBaseProduct,isDisabled:isDisabled,productId:product.id,handleRemoveFromCart:remove,handleAddToCart:handleAddToCart};},[handleAddToCart,isBaseProduct,isDisabled,listId,product.id,remove]);var handleChangeQuantity=useCallback(function(newQuantity){// Do nothing when quantity didn't change
12
12
  if(newQuantity===quantity)return;updateFavoriteItem(product.id,listId,newQuantity,notes);},[listId,notes,product.id,quantity,updateFavoriteItem]);var handleDeleteComment=useCallback(function(event){event.preventDefault();event.stopPropagation();updateFavoriteItem(product.id,listId,quantity,'');setTimeout(function(){if(notesButtonRef===null||notesButtonRef===void 0?void 0:notesButtonRef.current){// Focus the add button after item deletion to improve a11y
13
13
  notesButtonRef.current.focus();}broadcastLiveMessage('favorites.comments.removed');},300);},[listId,product.id,quantity,updateFavoriteItem]);return React.createElement(ProductListEntryProvider,{productId:product.id},React.createElement(SurroundPortals,{portalName:FAVORITES_LIST_ITEM,portalProps:product},React.createElement("div",{className:styles.root},React.createElement(Link,{className:styles.imageContainer,component:"div",href:productLink,"aria-hidden":true},React.createElement(ProductImage,{src:product.featuredImageBaseUrl,resolutions:gridResolutions})),React.createElement("div",{className:styles.infoContainer},React.createElement("div",{className:classNames(styles.infoContainerRow)},React.createElement("div",{className:styles.titleWrapper},React.createElement(SurroundPortals,{portalName:FAVORITES_PRODUCT_NAME,portalProps:commonPortalProps},React.createElement(TextLink,{href:productLink,tag:"span",className:styles.titleContainer},React.createElement("span",{className:styles.title// eslint-disable-next-line react/no-danger
14
- ,dangerouslySetInnerHTML:{__html:"".concat(product.name)}})))),React.createElement("div",{className:styles.removeContainer},React.createElement(Remove,{onClick:remove}))),React.createElement(ItemCharacteristics,{characteristics:characteristics}),!hasNewServices()?React.createElement(SurroundPortals,{portalName:FAVORITES_AVAILABILITY_TEXT,portalProps:commonPortalProps},React.createElement(AvailableText,{text:commonPortalProps.availability.text,state:commonPortalProps.availability.state,showWhenAvailable:true,className:styles.availability})):React.createElement(StockInfoLists,{product:product}),React.createElement("div",{className:styles.infoContainerRow},React.createElement("div",{className:styles.quantityContainer},React.createElement(SurroundPortals,{portalName:FAVORITES_QUANTITY,portalProps:commonPortalProps},React.createElement(ItemQuantity,{quantity:internalQuantity,onChange:handleChangeQuantity})),React.createElement(SurroundPortals,{portalName:FAVORITES_PRODUCT_PRICE,portalProps:commonPortalProps},React.createElement("div",{className:styles.priceContainer},hasStrikePrice?React.createElement(PriceStriked,{value:defaultPrice,currency:currency}):null,React.createElement(Price,{currency:currency,discounted:hasStrikePrice,unitPrice:price}),React.createElement(PriceInfo,{product:product,currency:currency,className:styles.priceInfo})))),React.createElement(SurroundPortals,{portalName:FAVORITES_ADD_TO_CART,portalProps:ctaPortalProps},React.createElement(AddToCart,{onClick:handleAddToCart,isLoading:false,isDisabled:isDisabled,"aria-label":i18n.text('product.add_to_cart')}))),React.createElement(SurroundPortals,{portalName:FAVORITES_NOTES,portalProps:commonPortalProps},React.createElement(ItemNotes,{notes:notes,onClickDeleteComment:handleDeleteComment,onClickOpenComment:handleOpenComment,notesButtonRef:notesButtonRef}))))));};FavoriteItem.defaultProps={isBaseProduct:true,isOrderable:true,isRopeProductOrderable:true,hasVariants:false,notes:undefined,quantity:1};export default connect(makeMapStateToProps,mapDispatchToProps)(FavoriteItem);
14
+ ,dangerouslySetInnerHTML:{__html:"".concat(product.name)}})))),React.createElement("div",{className:styles.removeContainer},React.createElement(Remove,{onClick:remove}))),React.createElement(ItemCharacteristics,{characteristics:characteristics}),!hasNewServices()?React.createElement(SurroundPortals,{portalName:FAVORITES_AVAILABILITY_TEXT,portalProps:commonPortalProps},React.createElement(AvailableText,{text:commonPortalProps.availability.text,state:commonPortalProps.availability.state,showWhenAvailable:true,className:styles.availability})):React.createElement(StockInfoLists,{product:product}),React.createElement("div",{className:styles.infoContainerRow},React.createElement("div",{className:styles.quantityContainer},React.createElement(SurroundPortals,{portalName:FAVORITES_QUANTITY,portalProps:commonPortalProps},React.createElement(ItemQuantity,{quantity:internalQuantity,onChange:handleChangeQuantity})),React.createElement(SurroundPortals,{portalName:FAVORITES_PRODUCT_PRICE,portalProps:commonPortalProps},React.createElement("div",{className:styles.priceContainer},React.createElement("div",{className:styles.priceContainerInner},hasStrikePrice?React.createElement(PriceStriked,{value:specialPrice,currency:currency}):null,React.createElement(Price,{currency:currency,discounted:hasStrikePrice,unitPrice:price,className:styles.price})),React.createElement(PriceInfo,{product:product,currency:currency,className:styles.priceInfo})))),React.createElement(SurroundPortals,{portalName:FAVORITES_ADD_TO_CART,portalProps:ctaPortalProps},React.createElement(AddToCart,{onClick:handleAddToCart,isLoading:false,isDisabled:isDisabled,"aria-label":i18n.text('product.add_to_cart')}))),React.createElement(SurroundPortals,{portalName:FAVORITES_NOTES,portalProps:commonPortalProps},React.createElement(ItemNotes,{notes:notes,onClickDeleteComment:handleDeleteComment,onClickOpenComment:handleOpenComment,notesButtonRef:notesButtonRef}))))));};FavoriteItem.defaultProps={isBaseProduct:true,isOrderable:true,isRopeProductOrderable:true,hasVariants:false,notes:undefined,quantity:1};export default connect(makeMapStateToProps,mapDispatchToProps)(FavoriteItem);
package/orders/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /** @module orders */import{CHECKOUT_PATH}from'@shopgate/pwa-common/constants/RoutePaths';// CONSTANTS
2
- export*from'@shopgate/pwa-common-commerce/orders/constants';export{CHECKOUT_PATH};export{ORDER_DETAILS_PATTERN,ORDER_DETAILS_PRIVATE_PATTERN}from"./constants";export{OrderDetails}from"./components";export{makeGetOrderById}from"./selectors";export{getTranslatedOrderStatus,getTranslatedLineItemStatus,getLineItemActiveStatus}from"./helpers";
2
+ export*from'@shopgate/pwa-common-commerce/orders/constants';export{CHECKOUT_PATH};export{makeGetOrderById}from"./selectors";export{getTranslatedOrderStatus,getTranslatedLineItemStatus,getLineItemActiveStatus}from"./helpers";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/engage",
3
- "version": "7.20.0-beta.3",
3
+ "version": "7.20.0-beta.4",
4
4
  "description": "Shopgate's ENGAGE library.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -16,12 +16,12 @@
16
16
  ],
17
17
  "dependencies": {
18
18
  "@shopgate/native-modules": "1.0.0-beta.18",
19
- "@shopgate/pwa-common": "7.20.0-beta.3",
20
- "@shopgate/pwa-common-commerce": "7.20.0-beta.3",
21
- "@shopgate/pwa-core": "7.20.0-beta.3",
22
- "@shopgate/pwa-ui-ios": "7.20.0-beta.3",
23
- "@shopgate/pwa-ui-material": "7.20.0-beta.3",
24
- "@shopgate/pwa-ui-shared": "7.20.0-beta.3",
19
+ "@shopgate/pwa-common": "7.20.0-beta.4",
20
+ "@shopgate/pwa-common-commerce": "7.20.0-beta.4",
21
+ "@shopgate/pwa-core": "7.20.0-beta.4",
22
+ "@shopgate/pwa-ui-ios": "7.20.0-beta.4",
23
+ "@shopgate/pwa-ui-material": "7.20.0-beta.4",
24
+ "@shopgate/pwa-ui-shared": "7.20.0-beta.4",
25
25
  "@stripe/react-stripe-js": "^1.1.2",
26
26
  "@stripe/stripe-js": "^1.3.1",
27
27
  "@virtuous/conductor": "~2.5.0",
@@ -0,0 +1 @@
1
+ export{default as Registration}from"./Registration/Registration";export{default as GuestRegistration}from"./GuestRegistration/GuestRegistration";
@@ -1,2 +1,2 @@
1
1
  // Components
2
- export{default as Registration}from"./components/Registration/Registration";export{default as GuestRegistration}from"./components/GuestRegistration/GuestRegistration";export{MARKETING_OPT_IN_DEFAULT}from"./constants";
2
+ export{MARKETING_OPT_IN_DEFAULT}from"./constants";
@@ -0,0 +1,4 @@
1
+ import{main$}from'@shopgate/pwa-common/streams';import{SUCCESS_REGISTRATION}from"../constants/actionTypes";/**
2
+ * Gets triggered when registration was successful via the shopgate.user.register pipeline
3
+ * @type {Observable}
4
+ */export var registrationSuccess$=main$.filter(function(_ref){var action=_ref.action;return action.type===SUCCESS_REGISTRATION;});
@@ -1,5 +1,5 @@
1
- import{main$,makeGetPrevRoute,getCurrentRoute,historyPop}from'@shopgate/engage/core';import{LOGIN_PATH}from'@shopgate/pwa-common/constants/RoutePaths';import{successLogin}from'@shopgate/pwa-common/action-creators';import{SUCCESS_REGISTRATION}from"../constants";/**
1
+ import{makeGetPrevRoute,getCurrentRoute,historyPop}from'@shopgate/engage/core';import{LOGIN_PATH}from'@shopgate/pwa-common/constants/RoutePaths';import{REGISTRATION_FORM_LOGIN_STRATEGY}from'@shopgate/pwa-common/constants/user';import{successLogin}from'@shopgate/pwa-common/action-creators';import{registrationSuccess$}from"../streams";/**
2
2
  * @param {Function} subscribe Subscribes to an observable.
3
- */export default function registration(subscribe){var registrationSuccess$=main$.filter(function(_ref){var action=_ref.action;return action.type===SUCCESS_REGISTRATION;});subscribe(registrationSuccess$,function(_ref2){var dispatch=_ref2.dispatch,getState=_ref2.getState;var currentRoute=getCurrentRoute(getState());var redirect;if(currentRoute){// Try to get the login page from the router stack to extract the original redirect target
4
- var getPrevRoute=makeGetPrevRoute();var routeId=currentRoute.id;var _ref4=getPrevRoute(getState(),{routeId:routeId})||{},pattern=_ref4.pattern,state=_ref4.state;if(pattern===LOGIN_PATH&&(state===null||state===void 0?void 0:state.redirect)){redirect=state.redirect;}}// TODO improve navigation since the login page will be briefly visible
5
- dispatch(historyPop());dispatch(successLogin(redirect));});}
3
+ */export default function registration(subscribe){subscribe(registrationSuccess$,function(_ref){var _action$response;var dispatch=_ref.dispatch,getState=_ref.getState,action=_ref.action;var currentRoute=getCurrentRoute(getState());var redirect;if(currentRoute){// Try to get the login page from the router stack to extract the original redirect target
4
+ var getPrevRoute=makeGetPrevRoute();var routeId=currentRoute.id;var _ref3=getPrevRoute(getState(),{routeId:routeId})||{},pattern=_ref3.pattern,state=_ref3.state;if(pattern===LOGIN_PATH&&(state===null||state===void 0?void 0:state.redirect)){redirect=state.redirect;}}// TODO improve navigation since the login page will be briefly visible
5
+ dispatch(historyPop());dispatch(successLogin(redirect,REGISTRATION_FORM_LOGIN_STRATEGY,action===null||action===void 0?void 0:(_action$response=action.response)===null||_action$response===void 0?void 0:_action$response.sessionLifetimeInSeconds));});}
@@ -5,6 +5,6 @@ import Color from'color';import{themeConfig}from'@shopgate/pwa-common/helpers/co
5
5
  */var getContrastColor=function getContrastColor(color){var perceivedLuminosity=Color(color).luminosity();return perceivedLuminosity>=0.74?colors.dark:colors.light;};/**
6
6
  * Initializes the CSS custom properties after they where loaded from a CSS file.
7
7
  * When the CSS file doesn't contain contrast colors, they will be calculated automatically.
8
- */export var initCSSCustomProps=function initCSSCustomProps(){var primary=getCSSCustomProp('--color-primary');var primaryContrast=getCSSCustomProp('--color-primary-contrast');var secondary=getCSSCustomProp('--color-secondary');var secondaryContrast=getCSSCustomProp('--color-secondary-contrast');if(primary&&!primaryContrast){setCSSCustomProp('--color-primary-contrast',getContrastColor(primary));}if(secondary&&!secondaryContrast){setCSSCustomProp('--color-secondary-contrast',getContrastColor(secondary));}if(hasWebBridge()){setCSSCustomProp('--page-background-color','#fff');}var sideNavigationBackground=Color(getCSSCustomProp('--color-primary')||colors.primary).alpha(0.08);setCSSCustomProp('--color-side-navigation-active-background',sideNavigationBackground);setCSSCustomProp('--color-button-cta','var(--color-primary)');setCSSCustomProp('--color-button-cta-contrast','var(--color-primary-contrast)');};/**
8
+ */export var initCSSCustomProps=function initCSSCustomProps(){var primary=getCSSCustomProp('--color-primary');var primaryContrast=getCSSCustomProp('--color-primary-contrast');var secondary=getCSSCustomProp('--color-secondary');var secondaryContrast=getCSSCustomProp('--color-secondary-contrast');if(primary&&!primaryContrast){setCSSCustomProp('--color-primary-contrast',getContrastColor(primary));}if(secondary&&!secondaryContrast){setCSSCustomProp('--color-secondary-contrast',getContrastColor(secondary));}if(hasWebBridge()){setCSSCustomProp('--page-background-color','#fff');}var sideNavigationBackground=Color(getCSSCustomProp('--color-primary')||colors.primary).alpha(0.08);setCSSCustomProp('--color-side-navigation-active-background',sideNavigationBackground);setCSSCustomProp('--color-button-cta','var(--color-primary)');setCSSCustomProp('--color-button-cta-contrast','var(--color-primary-contrast)');if(!getCSSCustomProp('--color-button-dialog-ios')){setCSSCustomProp('--color-button-dialog-ios','#1a73e8');}};/**
9
9
  * Initializes fallback CSS custom properties from the theme colors.
10
- */export var initCSSCustomPropsFallback=function initCSSCustomPropsFallback(){setCSSCustomProp('--color-primary',colors.primary);setCSSCustomProp('--color-primary-contrast',getContrastColor(colors.primary));setCSSCustomProp('--color-secondary',colors.accent);setCSSCustomProp('--color-secondary-contrast',getContrastColor(colors.accent));if(!hasNewServices()){setCSSCustomProp('--color-button-cta',colors.cta);setCSSCustomProp('--color-button-cta-contrast',colors.ctaContrast);}else{setCSSCustomProp('--color-button-cta','var(--color-primary)');setCSSCustomProp('--color-button-cta-contrast','var(--color-primary-contrast)');}setCSSCustomProp('--color-text-high-emphasis','#212121');setCSSCustomProp('--color-text-medium-emphasis','#666666');setCSSCustomProp('--color-text-low-emphasis','#9e9e9e');setCSSCustomProp('--color-background-accent','#f7f7f7');setCSSCustomProp('--color-state-alert',colors.error);setCSSCustomProp('--color-state-warning',colors.warning);setCSSCustomProp('--color-state-ok',colors.success);var sideNavigationBackground=Color(getCSSCustomProp('--color-primary')||colors.primary).fade(0.9);setCSSCustomProp('--color-side-navigation-active-background',sideNavigationBackground);if(hasWebBridge()){setCSSCustomProp('--page-background-color','#fff');}};
10
+ */export var initCSSCustomPropsFallback=function initCSSCustomPropsFallback(){setCSSCustomProp('--color-primary',colors.primary);setCSSCustomProp('--color-primary-contrast',getContrastColor(colors.primary));setCSSCustomProp('--color-secondary',colors.accent);setCSSCustomProp('--color-secondary-contrast',getContrastColor(colors.accent));if(!hasNewServices()){setCSSCustomProp('--color-button-cta',colors.cta);setCSSCustomProp('--color-button-cta-contrast',colors.ctaContrast);}else{setCSSCustomProp('--color-button-cta','var(--color-primary)');setCSSCustomProp('--color-button-cta-contrast','var(--color-primary-contrast)');}if(!getCSSCustomProp('--color-button-dialog-ios')){setCSSCustomProp('--color-button-dialog-ios','#1a73e8');}setCSSCustomProp('--color-text-high-emphasis','#212121');setCSSCustomProp('--color-text-medium-emphasis','#666666');setCSSCustomProp('--color-text-low-emphasis','#9e9e9e');setCSSCustomProp('--color-background-accent','#f7f7f7');setCSSCustomProp('--color-state-alert',colors.error);setCSSCustomProp('--color-state-warning',colors.warning);setCSSCustomProp('--color-state-ok',colors.success);var sideNavigationBackground=Color(getCSSCustomProp('--color-primary')||colors.primary).fade(0.9);setCSSCustomProp('--color-side-navigation-active-background',sideNavigationBackground);if(hasWebBridge()){setCSSCustomProp('--page-background-color','#fff');}};
@@ -1,4 +1,5 @@
1
1
  import{themeConfig}from'@shopgate/pwa-common/helpers/config';import{hasWebBridge}from'@shopgate/engage/core';import{setCSSCustomProp}from"./cssCustomProperties";var defaultBackgroundColor=themeConfig.colors.light;/**
2
2
  * Updates the page background color.
3
3
  * @param {string} color The new background color.
4
- */export var setPageBackgroundColor=function setPageBackgroundColor(){var color=arguments.length>0&&arguments[0]!==undefined?arguments[0]:defaultBackgroundColor;if(!hasWebBridge()){setCSSCustomProp('--page-background-color',color);}};
4
+ */export var setPageBackgroundColor=function setPageBackgroundColor(){var color=arguments.length>0&&arguments[0]!==undefined?arguments[0]:defaultBackgroundColor;// Curbside website changes never its background color
5
+ if(!hasWebBridge()){setCSSCustomProp('--page-background-color',color);}};
package/user/index.js CHANGED
@@ -3,4 +3,4 @@ export{disableLogin}from'@shopgate/pwa-common/action-creators/user';// ACTIONS
3
3
  export{default as fetchRegisterUrl}from'@shopgate/pwa-common/actions/user/fetchRegisterUrl';export{default as fetchUser}from'@shopgate/pwa-common/actions/user/fetchUser';export{default as login}from'@shopgate/pwa-common/actions/user/login';export{default as logout}from'@shopgate/pwa-common/actions/user/logout';// CONSTANTS
4
4
  export*from'@shopgate/pwa-common/constants/Registration';export*from'@shopgate/pwa-common/constants/user';export{REGISTER_PATH,LOGIN_PATH};// SELECTORS
5
5
  export*from'@shopgate/pwa-common/selectors/user';export*from"./selectors/login";export*from"./selectors/data";// STREAMS
6
- export*from'@shopgate/pwa-common/streams/user';
6
+ export*from'@shopgate/pwa-common/streams/user';export{registrationSuccess$}from'@shopgate/engage/registration/streams';