@pelcro/react-pelcro-js 4.0.0-alpha.61 → 4.0.0-alpha.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -3863,7 +3863,8 @@ var messages$X = {
3863
3863
  sourceUpdated: "Your payment information has been updated",
3864
3864
  cardAuthFailed: "We are unable to authenticate your payment method. Please choose a different payment method and try again.",
3865
3865
  cardAuthNotSupported: "Updating your payment method to one that requires authentication is currently not possible. Please use a different payment method or contact customer service.",
3866
- tryAgainFromInvoice: "We were unable to authenticate your payment, however your subscription was created. Please attempt to pay for the invoice using another payment method from the dashboard."
3866
+ tryAgainFromInvoice: "We were unable to authenticate your payment, however your subscription was created. Please attempt to pay for the invoice using another payment method from the dashboard.",
3867
+ paymentProcessing: "Invoice payment is currently being processed."
3867
3868
  };
3868
3869
  var errors$f = {
3869
3870
  "": ""
@@ -23696,6 +23697,25 @@ const PaymentMethodContainerWithoutStripe = ({
23696
23697
  content: isSubCreate ? t("messages.tryAgainFromInvoice") : t("messages.cardAuthFailed")
23697
23698
  }
23698
23699
  });
23700
+ } else if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === "processing" && paymentIntent !== null && paymentIntent !== void 0 && paymentIntent.client_secret) {
23701
+ if (!isSubCreate) {
23702
+ dispatch({
23703
+ type: DISABLE_SUBMIT,
23704
+ payload: false
23705
+ });
23706
+ }
23707
+
23708
+ dispatch({
23709
+ type: LOADING,
23710
+ payload: false
23711
+ });
23712
+ return dispatch({
23713
+ type: SHOW_ALERT,
23714
+ payload: {
23715
+ type: "success",
23716
+ content: t("messages.paymentProcessing")
23717
+ }
23718
+ });
23699
23719
  } else {
23700
23720
  onSuccess(response);
23701
23721
  }
@@ -23865,7 +23885,9 @@ const PaymentMethodContainerWithoutStripe = ({
23865
23885
  gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
23866
23886
  address_id: product.address_required ? selectedAddressId : null
23867
23887
  }, (err, res) => {
23868
- if (res.data.setup_intent) {
23888
+ var _res$data;
23889
+
23890
+ if (res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && _res$data.setup_intent) {
23869
23891
  return confirmStripeIntentSetup(res, "subCreate");
23870
23892
  }
23871
23893
 
@@ -24066,7 +24088,7 @@ const PaymentMethodContainerWithoutStripe = ({
24066
24088
  auth_token: window.Pelcro.user.read().auth_token,
24067
24089
  token: result.paymentMethod.id
24068
24090
  }, (err, res) => {
24069
- var _res$data, _res$data$setup_inten, _res$data2, _res$data2$setup_inte;
24091
+ var _res$data2, _res$data2$setup_inte, _res$data3, _res$data3$setup_inte;
24070
24092
 
24071
24093
  if (err) {
24072
24094
  dispatch({
@@ -24087,7 +24109,7 @@ const PaymentMethodContainerWithoutStripe = ({
24087
24109
  });
24088
24110
  }
24089
24111
 
24090
- if (((_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$setup_inten = _res$data.setup_intent) === null || _res$data$setup_inten === void 0 ? void 0 : _res$data$setup_inten.status) === "requires_action" || ((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : (_res$data2$setup_inte = _res$data2.setup_intent) === null || _res$data2$setup_inte === void 0 ? void 0 : _res$data2$setup_inte.status) === "requires_confirmation") {
24112
+ if (((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : (_res$data2$setup_inte = _res$data2.setup_intent) === null || _res$data2$setup_inte === void 0 ? void 0 : _res$data2$setup_inte.status) === "requires_action" || ((_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : (_res$data3$setup_inte = _res$data3.setup_intent) === null || _res$data3$setup_inte === void 0 ? void 0 : _res$data3$setup_inte.status) === "requires_confirmation") {
24091
24113
  confirmStripeIntentSetup(res, "create");
24092
24114
  } else {
24093
24115
  dispatch({
@@ -24125,7 +24147,7 @@ const PaymentMethodContainerWithoutStripe = ({
24125
24147
  exp_year: year,
24126
24148
  is_default: isDefault
24127
24149
  }, (err, res) => {
24128
- var _res$data3, _res$data3$setup_inte, _res$data4, _res$data4$setup_inte;
24150
+ var _res$data4, _res$data4$setup_inte, _res$data5, _res$data5$setup_inte;
24129
24151
 
24130
24152
  dispatch({
24131
24153
  type: DISABLE_SUBMIT,
@@ -24147,7 +24169,7 @@ const PaymentMethodContainerWithoutStripe = ({
24147
24169
  });
24148
24170
  }
24149
24171
 
24150
- if (((_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : (_res$data3$setup_inte = _res$data3.setup_intent) === null || _res$data3$setup_inte === void 0 ? void 0 : _res$data3$setup_inte.status) === "requires_action" || ((_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : (_res$data4$setup_inte = _res$data4.setup_intent) === null || _res$data4$setup_inte === void 0 ? void 0 : _res$data4$setup_inte.status) === "requires_confirmation") {
24172
+ if (((_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : (_res$data4$setup_inte = _res$data4.setup_intent) === null || _res$data4$setup_inte === void 0 ? void 0 : _res$data4$setup_inte.status) === "requires_action" || ((_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : (_res$data5$setup_inte = _res$data5.setup_intent) === null || _res$data5$setup_inte === void 0 ? void 0 : _res$data5$setup_inte.status) === "requires_confirmation") {
24151
24173
  confirmStripeIntentSetup(res, "update");
24152
24174
  } else {
24153
24175
  dispatch({
@@ -24191,7 +24213,7 @@ const PaymentMethodContainerWithoutStripe = ({
24191
24213
  auth_token: window.Pelcro.user.read().auth_token,
24192
24214
  token: result.paymentMethod.id
24193
24215
  }, (err, res) => {
24194
- var _res$data5, _res$data5$setup_inte, _res$data6, _res$data6$setup_inte;
24216
+ var _res$data6, _res$data6$setup_inte, _res$data7, _res$data7$setup_inte;
24195
24217
 
24196
24218
  if (err) {
24197
24219
  onFailure(err);
@@ -24204,7 +24226,7 @@ const PaymentMethodContainerWithoutStripe = ({
24204
24226
  });
24205
24227
  }
24206
24228
 
24207
- if (((_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : (_res$data5$setup_inte = _res$data5.setup_intent) === null || _res$data5$setup_inte === void 0 ? void 0 : _res$data5$setup_inte.status) === "requires_action" || ((_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : (_res$data6$setup_inte = _res$data6.setup_intent) === null || _res$data6$setup_inte === void 0 ? void 0 : _res$data6$setup_inte.status) === "requires_confirmation") {
24229
+ if (((_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : (_res$data6$setup_inte = _res$data6.setup_intent) === null || _res$data6$setup_inte === void 0 ? void 0 : _res$data6$setup_inte.status) === "requires_action" || ((_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : (_res$data7$setup_inte = _res$data7.setup_intent) === null || _res$data7$setup_inte === void 0 ? void 0 : _res$data7$setup_inte.status) === "requires_confirmation") {
24208
24230
  confirmStripeIntentSetup(res, "replace", paymentMethodId);
24209
24231
  } else {
24210
24232
  setTimeout(() => {
@@ -24816,14 +24838,14 @@ const PaymentMethodContainerWithoutStripe = ({
24816
24838
  coupon_code: state === null || state === void 0 ? void 0 : state.couponCode,
24817
24839
  address_id: selectedAddressId
24818
24840
  }, (error, res) => {
24819
- var _res$data7, _res$data8;
24841
+ var _res$data8, _res$data9;
24820
24842
 
24821
24843
  if (error) {
24822
24844
  return reject(error);
24823
24845
  }
24824
24846
 
24825
- const taxAmount = (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.taxes;
24826
- const totalAmountWithTax = (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.total;
24847
+ const taxAmount = (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.taxes;
24848
+ const totalAmountWithTax = (_res$data9 = res.data) === null || _res$data9 === void 0 ? void 0 : _res$data9.total;
24827
24849
  resolve({
24828
24850
  totalAmountWithTax,
24829
24851
  taxAmount
@@ -38942,6 +38964,9 @@ const DashboardContent = props => {
38942
38964
  const {
38943
38965
  t
38944
38966
  } = useTranslation("dashboard");
38967
+ const {
38968
+ dashboardLayout
38969
+ } = props;
38945
38970
  const menuRef = React.useRef(null);
38946
38971
  const user = window.Pelcro.user.read();
38947
38972
  const userHasName = user.first_name || user.last_name;
@@ -39107,15 +39132,15 @@ const DashboardContent = props => {
39107
39132
  };
39108
39133
  }, []);
39109
39134
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Transition, {
39110
- className: "plc-fixed plc-inset-y-0 plc-left-0 plc-h-full lg:plc-w-3/12 plc-w-full plc-overflow-y-auto plc-text-left plc-bg-white plc-shadow-xl plc-z-max",
39135
+ className: `plc-fixed plc-inset-y-0 plc-h-full lg:plc-w-3/12 plc-w-full plc-overflow-y-auto plc-text-left plc-bg-white plc-shadow-xl plc-z-max ${dashboardLayout == "left" ? "plc-left-0" : "plc-right-0"}`,
39111
39136
  show: isOpen,
39112
39137
  enter: "plc-transform plc-transition plc-duration-500",
39113
- enterFrom: "plc--translate-x-full",
39138
+ enterFrom: `${dashboardLayout == "left" ? "plc--translate-x-full" : "plc-translate-x-full"}`,
39114
39139
  enterTo: "plc-translate-x-0",
39115
39140
  afterEnter: initializeHideMenuHandler,
39116
39141
  leave: "plc-transform plc-transition plc-duration-500",
39117
39142
  leaveFrom: "plc-translate-x-0",
39118
- leaveTo: "plc--translate-x-full",
39143
+ leaveTo: `${dashboardLayout == "left" ? "plc--translate-x-full" : "plc-translate-x-full"}`,
39119
39144
  afterLeave: props === null || props === void 0 ? void 0 : props.onClose
39120
39145
  }, /*#__PURE__*/React__default['default'].createElement("div", {
39121
39146
  id: "pelcro-view-dashboard",
@@ -39163,7 +39188,7 @@ const DashboardContent = props => {
39163
39188
  activeDashboardLink: activeDashboardLink
39164
39189
  }))), activeDashboardLink && isOpen && /*#__PURE__*/React__default['default'].createElement("div", {
39165
39190
  id: "pelcro-view-dashboard-submenus",
39166
- className: "plc-fixed plc-inset-y-0 plc-right-0 plc-h-full lg:plc-w-9/12 plc-w-full plc-bg-gray-100 plc-z-max plc-overflow-auto"
39191
+ className: `plc-fixed plc-inset-y-0 plc-h-full lg:plc-w-9/12 plc-w-full plc-bg-gray-100 plc-z-max plc-overflow-auto ${dashboardLayout == "left" ? "plc-right-0" : "plc-left-0"}`
39167
39192
  }, activeDashboardLink === SUB_MENUS.PROFILE && /*#__PURE__*/React__default['default'].createElement(ProfileMenu, null), activeDashboardLink === SUB_MENUS.QRCODE && /*#__PURE__*/React__default['default'].createElement(QRCodeMenu, null), activeDashboardLink === SUB_MENUS.PASSWORDCHANGE && /*#__PURE__*/React__default['default'].createElement(PasswordChangeMenu, null), activeDashboardLink === SUB_MENUS.SAVED_ITEMS && /*#__PURE__*/React__default['default'].createElement(SavedItemsMenu, null), activeDashboardLink === SUB_MENUS.PAYMENT_CARDS && /*#__PURE__*/React__default['default'].createElement(PaymentCardsMenu, null), activeDashboardLink === SUB_MENUS.ADDRESSES && /*#__PURE__*/React__default['default'].createElement(AddressesMenu, null), activeDashboardLink === SUB_MENUS.SUBSCRIPTIONS && /*#__PURE__*/React__default['default'].createElement(SubscriptionsMenu, {
39168
39193
  displayProductSelect: displayProductSelect,
39169
39194
  setProductAndPlan: setProductAndPlan,
@@ -39806,7 +39831,10 @@ const DashboardInvoices = ({
39806
39831
  *
39807
39832
  */
39808
39833
 
39809
- function Dashboard(props) {
39834
+ function Dashboard({
39835
+ dashboardLayout = "left",
39836
+ ...props
39837
+ }) {
39810
39838
  React__default['default'].useEffect(() => {
39811
39839
  var _props$onDisplay;
39812
39840
 
@@ -39824,7 +39852,8 @@ function Dashboard(props) {
39824
39852
 
39825
39853
  (_props$onClose = props.onClose) === null || _props$onClose === void 0 ? void 0 : _props$onClose.call(props);
39826
39854
  resetView();
39827
- }
39855
+ },
39856
+ dashboardLayout: dashboardLayout
39828
39857
  }, props), /*#__PURE__*/React__default['default'].createElement(DashboardHeading, {
39829
39858
  title: t("labels.mySettings")
39830
39859
  }), /*#__PURE__*/React__default['default'].createElement(DashboardProfile, null), /*#__PURE__*/React__default['default'].createElement(DashboardQRCode, null), /*#__PURE__*/React__default['default'].createElement(DashboardPasswordChange, null), /*#__PURE__*/React__default['default'].createElement(DashboardSavedItems, null), /*#__PURE__*/React__default['default'].createElement(DashboardHeading, {
@@ -39836,12 +39865,14 @@ function Dashboard(props) {
39836
39865
  Dashboard.viewId = "dashboard";
39837
39866
 
39838
39867
  // The button in the lower left that shows the dashboard.
39839
- const DashboardOpenButton = () => {
39868
+ const DashboardOpenButton = ({
39869
+ layout = "left"
39870
+ }) => {
39840
39871
  const {
39841
39872
  switchView
39842
39873
  } = usePelcro();
39843
39874
  return /*#__PURE__*/React__default['default'].createElement("div", {
39844
- className: "plc-fixed plc-left-4 plc-bottom-4 pelcro-open-dashboard-btn"
39875
+ className: `plc-fixed plc-bottom-4 pelcro-open-dashboard-btn ${layout == "left" ? "plc-left-4" : "plc-right-4"}`
39845
39876
  }, /*#__PURE__*/React__default['default'].createElement("button", {
39846
39877
  className: "plc-bg-white plc-border-2 plc-rounded-full focus:plc-outline-none plc-border-primary-300 hover:plc-bg-white",
39847
39878
  name: "menu",
package/dist/index.esm.js CHANGED
@@ -3833,7 +3833,8 @@ var messages$X = {
3833
3833
  sourceUpdated: "Your payment information has been updated",
3834
3834
  cardAuthFailed: "We are unable to authenticate your payment method. Please choose a different payment method and try again.",
3835
3835
  cardAuthNotSupported: "Updating your payment method to one that requires authentication is currently not possible. Please use a different payment method or contact customer service.",
3836
- tryAgainFromInvoice: "We were unable to authenticate your payment, however your subscription was created. Please attempt to pay for the invoice using another payment method from the dashboard."
3836
+ tryAgainFromInvoice: "We were unable to authenticate your payment, however your subscription was created. Please attempt to pay for the invoice using another payment method from the dashboard.",
3837
+ paymentProcessing: "Invoice payment is currently being processed."
3837
3838
  };
3838
3839
  var errors$f = {
3839
3840
  "": ""
@@ -23666,6 +23667,25 @@ const PaymentMethodContainerWithoutStripe = ({
23666
23667
  content: isSubCreate ? t("messages.tryAgainFromInvoice") : t("messages.cardAuthFailed")
23667
23668
  }
23668
23669
  });
23670
+ } else if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === "processing" && paymentIntent !== null && paymentIntent !== void 0 && paymentIntent.client_secret) {
23671
+ if (!isSubCreate) {
23672
+ dispatch({
23673
+ type: DISABLE_SUBMIT,
23674
+ payload: false
23675
+ });
23676
+ }
23677
+
23678
+ dispatch({
23679
+ type: LOADING,
23680
+ payload: false
23681
+ });
23682
+ return dispatch({
23683
+ type: SHOW_ALERT,
23684
+ payload: {
23685
+ type: "success",
23686
+ content: t("messages.paymentProcessing")
23687
+ }
23688
+ });
23669
23689
  } else {
23670
23690
  onSuccess(response);
23671
23691
  }
@@ -23835,7 +23855,9 @@ const PaymentMethodContainerWithoutStripe = ({
23835
23855
  gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
23836
23856
  address_id: product.address_required ? selectedAddressId : null
23837
23857
  }, (err, res) => {
23838
- if (res.data.setup_intent) {
23858
+ var _res$data;
23859
+
23860
+ if (res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && _res$data.setup_intent) {
23839
23861
  return confirmStripeIntentSetup(res, "subCreate");
23840
23862
  }
23841
23863
 
@@ -24036,7 +24058,7 @@ const PaymentMethodContainerWithoutStripe = ({
24036
24058
  auth_token: window.Pelcro.user.read().auth_token,
24037
24059
  token: result.paymentMethod.id
24038
24060
  }, (err, res) => {
24039
- var _res$data, _res$data$setup_inten, _res$data2, _res$data2$setup_inte;
24061
+ var _res$data2, _res$data2$setup_inte, _res$data3, _res$data3$setup_inte;
24040
24062
 
24041
24063
  if (err) {
24042
24064
  dispatch({
@@ -24057,7 +24079,7 @@ const PaymentMethodContainerWithoutStripe = ({
24057
24079
  });
24058
24080
  }
24059
24081
 
24060
- if (((_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$setup_inten = _res$data.setup_intent) === null || _res$data$setup_inten === void 0 ? void 0 : _res$data$setup_inten.status) === "requires_action" || ((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : (_res$data2$setup_inte = _res$data2.setup_intent) === null || _res$data2$setup_inte === void 0 ? void 0 : _res$data2$setup_inte.status) === "requires_confirmation") {
24082
+ if (((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : (_res$data2$setup_inte = _res$data2.setup_intent) === null || _res$data2$setup_inte === void 0 ? void 0 : _res$data2$setup_inte.status) === "requires_action" || ((_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : (_res$data3$setup_inte = _res$data3.setup_intent) === null || _res$data3$setup_inte === void 0 ? void 0 : _res$data3$setup_inte.status) === "requires_confirmation") {
24061
24083
  confirmStripeIntentSetup(res, "create");
24062
24084
  } else {
24063
24085
  dispatch({
@@ -24095,7 +24117,7 @@ const PaymentMethodContainerWithoutStripe = ({
24095
24117
  exp_year: year,
24096
24118
  is_default: isDefault
24097
24119
  }, (err, res) => {
24098
- var _res$data3, _res$data3$setup_inte, _res$data4, _res$data4$setup_inte;
24120
+ var _res$data4, _res$data4$setup_inte, _res$data5, _res$data5$setup_inte;
24099
24121
 
24100
24122
  dispatch({
24101
24123
  type: DISABLE_SUBMIT,
@@ -24117,7 +24139,7 @@ const PaymentMethodContainerWithoutStripe = ({
24117
24139
  });
24118
24140
  }
24119
24141
 
24120
- if (((_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : (_res$data3$setup_inte = _res$data3.setup_intent) === null || _res$data3$setup_inte === void 0 ? void 0 : _res$data3$setup_inte.status) === "requires_action" || ((_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : (_res$data4$setup_inte = _res$data4.setup_intent) === null || _res$data4$setup_inte === void 0 ? void 0 : _res$data4$setup_inte.status) === "requires_confirmation") {
24142
+ if (((_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : (_res$data4$setup_inte = _res$data4.setup_intent) === null || _res$data4$setup_inte === void 0 ? void 0 : _res$data4$setup_inte.status) === "requires_action" || ((_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : (_res$data5$setup_inte = _res$data5.setup_intent) === null || _res$data5$setup_inte === void 0 ? void 0 : _res$data5$setup_inte.status) === "requires_confirmation") {
24121
24143
  confirmStripeIntentSetup(res, "update");
24122
24144
  } else {
24123
24145
  dispatch({
@@ -24161,7 +24183,7 @@ const PaymentMethodContainerWithoutStripe = ({
24161
24183
  auth_token: window.Pelcro.user.read().auth_token,
24162
24184
  token: result.paymentMethod.id
24163
24185
  }, (err, res) => {
24164
- var _res$data5, _res$data5$setup_inte, _res$data6, _res$data6$setup_inte;
24186
+ var _res$data6, _res$data6$setup_inte, _res$data7, _res$data7$setup_inte;
24165
24187
 
24166
24188
  if (err) {
24167
24189
  onFailure(err);
@@ -24174,7 +24196,7 @@ const PaymentMethodContainerWithoutStripe = ({
24174
24196
  });
24175
24197
  }
24176
24198
 
24177
- if (((_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : (_res$data5$setup_inte = _res$data5.setup_intent) === null || _res$data5$setup_inte === void 0 ? void 0 : _res$data5$setup_inte.status) === "requires_action" || ((_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : (_res$data6$setup_inte = _res$data6.setup_intent) === null || _res$data6$setup_inte === void 0 ? void 0 : _res$data6$setup_inte.status) === "requires_confirmation") {
24199
+ if (((_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : (_res$data6$setup_inte = _res$data6.setup_intent) === null || _res$data6$setup_inte === void 0 ? void 0 : _res$data6$setup_inte.status) === "requires_action" || ((_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : (_res$data7$setup_inte = _res$data7.setup_intent) === null || _res$data7$setup_inte === void 0 ? void 0 : _res$data7$setup_inte.status) === "requires_confirmation") {
24178
24200
  confirmStripeIntentSetup(res, "replace", paymentMethodId);
24179
24201
  } else {
24180
24202
  setTimeout(() => {
@@ -24786,14 +24808,14 @@ const PaymentMethodContainerWithoutStripe = ({
24786
24808
  coupon_code: state === null || state === void 0 ? void 0 : state.couponCode,
24787
24809
  address_id: selectedAddressId
24788
24810
  }, (error, res) => {
24789
- var _res$data7, _res$data8;
24811
+ var _res$data8, _res$data9;
24790
24812
 
24791
24813
  if (error) {
24792
24814
  return reject(error);
24793
24815
  }
24794
24816
 
24795
- const taxAmount = (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.taxes;
24796
- const totalAmountWithTax = (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.total;
24817
+ const taxAmount = (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.taxes;
24818
+ const totalAmountWithTax = (_res$data9 = res.data) === null || _res$data9 === void 0 ? void 0 : _res$data9.total;
24797
24819
  resolve({
24798
24820
  totalAmountWithTax,
24799
24821
  taxAmount
@@ -38912,6 +38934,9 @@ const DashboardContent = props => {
38912
38934
  const {
38913
38935
  t
38914
38936
  } = useTranslation("dashboard");
38937
+ const {
38938
+ dashboardLayout
38939
+ } = props;
38915
38940
  const menuRef = useRef(null);
38916
38941
  const user = window.Pelcro.user.read();
38917
38942
  const userHasName = user.first_name || user.last_name;
@@ -39077,15 +39102,15 @@ const DashboardContent = props => {
39077
39102
  };
39078
39103
  }, []);
39079
39104
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Transition, {
39080
- className: "plc-fixed plc-inset-y-0 plc-left-0 plc-h-full lg:plc-w-3/12 plc-w-full plc-overflow-y-auto plc-text-left plc-bg-white plc-shadow-xl plc-z-max",
39105
+ className: `plc-fixed plc-inset-y-0 plc-h-full lg:plc-w-3/12 plc-w-full plc-overflow-y-auto plc-text-left plc-bg-white plc-shadow-xl plc-z-max ${dashboardLayout == "left" ? "plc-left-0" : "plc-right-0"}`,
39081
39106
  show: isOpen,
39082
39107
  enter: "plc-transform plc-transition plc-duration-500",
39083
- enterFrom: "plc--translate-x-full",
39108
+ enterFrom: `${dashboardLayout == "left" ? "plc--translate-x-full" : "plc-translate-x-full"}`,
39084
39109
  enterTo: "plc-translate-x-0",
39085
39110
  afterEnter: initializeHideMenuHandler,
39086
39111
  leave: "plc-transform plc-transition plc-duration-500",
39087
39112
  leaveFrom: "plc-translate-x-0",
39088
- leaveTo: "plc--translate-x-full",
39113
+ leaveTo: `${dashboardLayout == "left" ? "plc--translate-x-full" : "plc-translate-x-full"}`,
39089
39114
  afterLeave: props === null || props === void 0 ? void 0 : props.onClose
39090
39115
  }, /*#__PURE__*/React__default.createElement("div", {
39091
39116
  id: "pelcro-view-dashboard",
@@ -39133,7 +39158,7 @@ const DashboardContent = props => {
39133
39158
  activeDashboardLink: activeDashboardLink
39134
39159
  }))), activeDashboardLink && isOpen && /*#__PURE__*/React__default.createElement("div", {
39135
39160
  id: "pelcro-view-dashboard-submenus",
39136
- className: "plc-fixed plc-inset-y-0 plc-right-0 plc-h-full lg:plc-w-9/12 plc-w-full plc-bg-gray-100 plc-z-max plc-overflow-auto"
39161
+ className: `plc-fixed plc-inset-y-0 plc-h-full lg:plc-w-9/12 plc-w-full plc-bg-gray-100 plc-z-max plc-overflow-auto ${dashboardLayout == "left" ? "plc-right-0" : "plc-left-0"}`
39137
39162
  }, activeDashboardLink === SUB_MENUS.PROFILE && /*#__PURE__*/React__default.createElement(ProfileMenu, null), activeDashboardLink === SUB_MENUS.QRCODE && /*#__PURE__*/React__default.createElement(QRCodeMenu, null), activeDashboardLink === SUB_MENUS.PASSWORDCHANGE && /*#__PURE__*/React__default.createElement(PasswordChangeMenu, null), activeDashboardLink === SUB_MENUS.SAVED_ITEMS && /*#__PURE__*/React__default.createElement(SavedItemsMenu, null), activeDashboardLink === SUB_MENUS.PAYMENT_CARDS && /*#__PURE__*/React__default.createElement(PaymentCardsMenu, null), activeDashboardLink === SUB_MENUS.ADDRESSES && /*#__PURE__*/React__default.createElement(AddressesMenu, null), activeDashboardLink === SUB_MENUS.SUBSCRIPTIONS && /*#__PURE__*/React__default.createElement(SubscriptionsMenu, {
39138
39163
  displayProductSelect: displayProductSelect,
39139
39164
  setProductAndPlan: setProductAndPlan,
@@ -39776,7 +39801,10 @@ const DashboardInvoices = ({
39776
39801
  *
39777
39802
  */
39778
39803
 
39779
- function Dashboard(props) {
39804
+ function Dashboard({
39805
+ dashboardLayout = "left",
39806
+ ...props
39807
+ }) {
39780
39808
  React__default.useEffect(() => {
39781
39809
  var _props$onDisplay;
39782
39810
 
@@ -39794,7 +39822,8 @@ function Dashboard(props) {
39794
39822
 
39795
39823
  (_props$onClose = props.onClose) === null || _props$onClose === void 0 ? void 0 : _props$onClose.call(props);
39796
39824
  resetView();
39797
- }
39825
+ },
39826
+ dashboardLayout: dashboardLayout
39798
39827
  }, props), /*#__PURE__*/React__default.createElement(DashboardHeading, {
39799
39828
  title: t("labels.mySettings")
39800
39829
  }), /*#__PURE__*/React__default.createElement(DashboardProfile, null), /*#__PURE__*/React__default.createElement(DashboardQRCode, null), /*#__PURE__*/React__default.createElement(DashboardPasswordChange, null), /*#__PURE__*/React__default.createElement(DashboardSavedItems, null), /*#__PURE__*/React__default.createElement(DashboardHeading, {
@@ -39806,12 +39835,14 @@ function Dashboard(props) {
39806
39835
  Dashboard.viewId = "dashboard";
39807
39836
 
39808
39837
  // The button in the lower left that shows the dashboard.
39809
- const DashboardOpenButton = () => {
39838
+ const DashboardOpenButton = ({
39839
+ layout = "left"
39840
+ }) => {
39810
39841
  const {
39811
39842
  switchView
39812
39843
  } = usePelcro();
39813
39844
  return /*#__PURE__*/React__default.createElement("div", {
39814
- className: "plc-fixed plc-left-4 plc-bottom-4 pelcro-open-dashboard-btn"
39845
+ className: `plc-fixed plc-bottom-4 pelcro-open-dashboard-btn ${layout == "left" ? "plc-left-4" : "plc-right-4"}`
39815
39846
  }, /*#__PURE__*/React__default.createElement("button", {
39816
39847
  className: "plc-bg-white plc-border-2 plc-rounded-full focus:plc-outline-none plc-border-primary-300 hover:plc-bg-white",
39817
39848
  name: "menu",
package/dist/pelcro.css CHANGED
@@ -2096,6 +2096,10 @@ apple-pay-button {
2096
2096
  right: 0.75rem;
2097
2097
  }
2098
2098
 
2099
+ .pelcro-root .plc-right-4{
2100
+ right: 1rem;
2101
+ }
2102
+
2099
2103
  .pelcro-root .plc-right-5{
2100
2104
  right: 1.25rem;
2101
2105
  }
@@ -2621,6 +2625,10 @@ apple-pay-button {
2621
2625
  --tw-translate-x: -0.25rem;
2622
2626
  }
2623
2627
 
2628
+ .pelcro-root .plc-translate-x-full{
2629
+ --tw-translate-x: 100%;
2630
+ }
2631
+
2624
2632
  .pelcro-root .plc--translate-x-full{
2625
2633
  --tw-translate-x: -100%;
2626
2634
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "4.0.0-alpha.61",
4
+ "version": "4.0.0-alpha.63",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",