@pelcro/react-pelcro-js 3.23.0-beta.6 → 3.23.0-beta.8

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
@@ -9693,6 +9693,17 @@ function notifyBugsnag(callback, startOptions) {
9693
9693
  }
9694
9694
  callback();
9695
9695
  }
9696
+
9697
+ //create a safe and strong password string with special characters
9698
+ function generatePassword() {
9699
+ const length = 16;
9700
+ const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+{}|:<>?`~";
9701
+ let retVal = "";
9702
+ for (let i = 0, n = charset.length; i < length; ++i) {
9703
+ retVal += charset.charAt(Math.floor(Math.random() * n));
9704
+ }
9705
+ return retVal;
9706
+ }
9696
9707
  function isStringValid(str) {
9697
9708
  // Define the regular expression to match only letters, numbers and spaces
9698
9709
  var regex = /^[a-zA-Z0-9\s]+$/;
@@ -19446,7 +19457,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19446
19457
  const sendRegisterRequest = (state, callback) => {
19447
19458
  window.Pelcro.user.register({
19448
19459
  email: state.email,
19449
- password: state.password
19460
+ password: generatePassword()
19450
19461
  }, (err, res) => {
19451
19462
  if (err) {
19452
19463
  var _err$response, _err$response$data;
@@ -20256,7 +20267,8 @@ const SubmitPaymentMethod = _ref => {
20256
20267
  const {
20257
20268
  plan,
20258
20269
  selectedDonationAmount,
20259
- customDonationAmount
20270
+ customDonationAmount,
20271
+ selectedPaymentMethodId
20260
20272
  } = usePelcro();
20261
20273
  const {
20262
20274
  t
@@ -20292,7 +20304,7 @@ const SubmitPaymentMethod = _ref => {
20292
20304
  if (supportsTap && isUserFirstName && isUserLastName && isUserPhone) {
20293
20305
  setDisabled(disableSubmit);
20294
20306
  } else {
20295
- setDisabled(disableSubmit || supportsTap && firstNameError || supportsTap && lastNameError || supportsTap && phoneError || supportsTap && !(firstName !== null && firstName !== void 0 && firstName.length) || supportsTap && !(lastName !== null && lastName !== void 0 && lastName.length) || supportsTap && !(phone !== null && phone !== void 0 && phone.length) || emailError || passwordError || supportsCybersource && !(month !== null && month !== void 0 && month.length) || supportsCybersource && !(year !== null && year !== void 0 && year.length));
20307
+ setDisabled(disableSubmit || supportsTap && firstNameError || supportsTap && lastNameError || supportsTap && phoneError || supportsTap && !(firstName !== null && firstName !== void 0 && firstName.length) || supportsTap && !(lastName !== null && lastName !== void 0 && lastName.length) || supportsTap && !(phone !== null && phone !== void 0 && phone.length) || emailError || passwordError || supportsCybersource && !selectedPaymentMethodId && !(month !== null && month !== void 0 && month.length) || supportsCybersource && !selectedPaymentMethodId && !(year !== null && year !== void 0 && year.length));
20296
20308
  }
20297
20309
  }, [disableSubmit, firstNameError, lastNameError, phoneError, firstName, lastName, phone, emailError, passwordError, month, year]);
20298
20310
  return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
@@ -20933,10 +20945,6 @@ const DonationEmail = props => /*#__PURE__*/React__default['default'].createElem
20933
20945
  store: store$k
20934
20946
  }, props));
20935
20947
 
20936
- const DonationPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
20937
- store: store$k
20938
- }, props));
20939
-
20940
20948
  /**
20941
20949
  *
20942
20950
  */
@@ -21023,11 +21031,6 @@ function PaymentMethodView(_ref) {
21023
21031
  label: t("labels.email"),
21024
21032
  required: true,
21025
21033
  autoFocus: true
21026
- }), /*#__PURE__*/React__default['default'].createElement(DonationPassword, {
21027
- id: "pelcro-input-password",
21028
- errorId: "pelcro-input-password-error",
21029
- label: t("labels.password"),
21030
- required: true
21031
21034
  })), /*#__PURE__*/React__default['default'].createElement(CheckoutForm, null), showCoupon && /*#__PURE__*/React__default['default'].createElement("div", {
21032
21035
  className: "plc-mb-2"
21033
21036
  }, /*#__PURE__*/React__default['default'].createElement(CouponCode, null), /*#__PURE__*/React__default['default'].createElement(DiscountedPrice, null)), /*#__PURE__*/React__default['default'].createElement(TaxAmount, null), /*#__PURE__*/React__default['default'].createElement("div", {
package/dist/index.esm.js CHANGED
@@ -9663,6 +9663,17 @@ function notifyBugsnag(callback, startOptions) {
9663
9663
  }
9664
9664
  callback();
9665
9665
  }
9666
+
9667
+ //create a safe and strong password string with special characters
9668
+ function generatePassword() {
9669
+ const length = 16;
9670
+ const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+{}|:<>?`~";
9671
+ let retVal = "";
9672
+ for (let i = 0, n = charset.length; i < length; ++i) {
9673
+ retVal += charset.charAt(Math.floor(Math.random() * n));
9674
+ }
9675
+ return retVal;
9676
+ }
9666
9677
  function isStringValid(str) {
9667
9678
  // Define the regular expression to match only letters, numbers and spaces
9668
9679
  var regex = /^[a-zA-Z0-9\s]+$/;
@@ -19416,7 +19427,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19416
19427
  const sendRegisterRequest = (state, callback) => {
19417
19428
  window.Pelcro.user.register({
19418
19429
  email: state.email,
19419
- password: state.password
19430
+ password: generatePassword()
19420
19431
  }, (err, res) => {
19421
19432
  if (err) {
19422
19433
  var _err$response, _err$response$data;
@@ -20226,7 +20237,8 @@ const SubmitPaymentMethod = _ref => {
20226
20237
  const {
20227
20238
  plan,
20228
20239
  selectedDonationAmount,
20229
- customDonationAmount
20240
+ customDonationAmount,
20241
+ selectedPaymentMethodId
20230
20242
  } = usePelcro();
20231
20243
  const {
20232
20244
  t
@@ -20262,7 +20274,7 @@ const SubmitPaymentMethod = _ref => {
20262
20274
  if (supportsTap && isUserFirstName && isUserLastName && isUserPhone) {
20263
20275
  setDisabled(disableSubmit);
20264
20276
  } else {
20265
- setDisabled(disableSubmit || supportsTap && firstNameError || supportsTap && lastNameError || supportsTap && phoneError || supportsTap && !(firstName !== null && firstName !== void 0 && firstName.length) || supportsTap && !(lastName !== null && lastName !== void 0 && lastName.length) || supportsTap && !(phone !== null && phone !== void 0 && phone.length) || emailError || passwordError || supportsCybersource && !(month !== null && month !== void 0 && month.length) || supportsCybersource && !(year !== null && year !== void 0 && year.length));
20277
+ setDisabled(disableSubmit || supportsTap && firstNameError || supportsTap && lastNameError || supportsTap && phoneError || supportsTap && !(firstName !== null && firstName !== void 0 && firstName.length) || supportsTap && !(lastName !== null && lastName !== void 0 && lastName.length) || supportsTap && !(phone !== null && phone !== void 0 && phone.length) || emailError || passwordError || supportsCybersource && !selectedPaymentMethodId && !(month !== null && month !== void 0 && month.length) || supportsCybersource && !selectedPaymentMethodId && !(year !== null && year !== void 0 && year.length));
20266
20278
  }
20267
20279
  }, [disableSubmit, firstNameError, lastNameError, phoneError, firstName, lastName, phone, emailError, passwordError, month, year]);
20268
20280
  return /*#__PURE__*/React__default.createElement(Button, Object.assign({
@@ -20903,10 +20915,6 @@ const DonationEmail = props => /*#__PURE__*/React__default.createElement(Email,
20903
20915
  store: store$k
20904
20916
  }, props));
20905
20917
 
20906
- const DonationPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
20907
- store: store$k
20908
- }, props));
20909
-
20910
20918
  /**
20911
20919
  *
20912
20920
  */
@@ -20993,11 +21001,6 @@ function PaymentMethodView(_ref) {
20993
21001
  label: t("labels.email"),
20994
21002
  required: true,
20995
21003
  autoFocus: true
20996
- }), /*#__PURE__*/React__default.createElement(DonationPassword, {
20997
- id: "pelcro-input-password",
20998
- errorId: "pelcro-input-password-error",
20999
- label: t("labels.password"),
21000
- required: true
21001
21004
  })), /*#__PURE__*/React__default.createElement(CheckoutForm, null), showCoupon && /*#__PURE__*/React__default.createElement("div", {
21002
21005
  className: "plc-mb-2"
21003
21006
  }, /*#__PURE__*/React__default.createElement(CouponCode, null), /*#__PURE__*/React__default.createElement(DiscountedPrice, null)), /*#__PURE__*/React__default.createElement(TaxAmount, null), /*#__PURE__*/React__default.createElement("div", {
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": "3.23.0-beta.6",
4
+ "version": "3.23.0-beta.8",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",