@pelcro/react-pelcro-js 4.0.0-alpha.25 → 4.0.0-alpha.26

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
@@ -3450,7 +3450,10 @@ var labels$10 = {
3450
3450
  interval: "{{count}} {{interval}}",
3451
3451
  interval_plural: "{{count}} {{interval}}s",
3452
3452
  tax: "+ Tax",
3453
- removeCoupon: "REMOVE"
3453
+ removeCoupon: "REMOVE",
3454
+ firstName: "First name",
3455
+ lastName: "Last name",
3456
+ phone: "Phone"
3454
3457
  };
3455
3458
  var checkoutForm_en = {
3456
3459
  messages: messages$14,
@@ -3950,6 +3953,10 @@ var messages$W = {
3950
3953
  success: "Subscription is successfully cancelled",
3951
3954
  error: "Error while cancelling your subscription"
3952
3955
  },
3956
+ subReactivation: {
3957
+ success: "Subscription is successfully reactivated",
3958
+ error: "Error while reactivating your subscription"
3959
+ },
3953
3960
  subUnSuspend: {
3954
3961
  isSureToUnSuspend: "Are you sure you want to unsuspend your subscription?",
3955
3962
  loading: "Unsuspending your subscription",
@@ -4384,7 +4391,10 @@ var labels$H = {
4384
4391
  interval: "{{count}} {{interval}}",
4385
4392
  interval_plural: "{{count}} {{interval}}s",
4386
4393
  tax: "+ Taxe",
4387
- removeCoupon: "RETIRER"
4394
+ removeCoupon: "RETIRER",
4395
+ firstName: "Prénom",
4396
+ lastName: "Nom de famille",
4397
+ phone: "Téléphoner"
4388
4398
  };
4389
4399
  var checkoutForm_fr = {
4390
4400
  messages: messages$M,
@@ -4885,6 +4895,10 @@ var messages$C = {
4885
4895
  success: "L'abonnement a été annulé avec succès",
4886
4896
  error: "Une erreur s'est produite lors de l'annulation de l'abonnement"
4887
4897
  },
4898
+ subReactivation: {
4899
+ success: "L'abonnement a été réactivé avec succès",
4900
+ error: "Erreur lors de la réactivation de votre abonnement"
4901
+ },
4888
4902
  subUnSuspend: {
4889
4903
  isSureToUnSuspend: "Êtes-vous sûr de vouloir annuler la suspension de votre abonnement ?",
4890
4904
  loading: "Annulation de la suspension de votre abonnement",
@@ -5265,7 +5279,10 @@ var labels$s = {
5265
5279
  interval: "{{count}} {{interval}}",
5266
5280
  interval_plural: "{{count}} {{interval}}",
5267
5281
  tax: "+ 세금",
5268
- removeCoupon: "제거"
5282
+ removeCoupon: "제거",
5283
+ firstName: "이름",
5284
+ lastName: "성",
5285
+ phone: "핸드폰"
5269
5286
  };
5270
5287
  var checkoutForm_ko = {
5271
5288
  messages: messages$v,
@@ -5826,6 +5843,10 @@ var messages$l = {
5826
5843
  success: "유료 멤버십이 성공적으로 취소되었습니다.",
5827
5844
  error: "유료 멤버십 취소 과정에서 오류가 발생했습니다."
5828
5845
  },
5846
+ subReactivation: {
5847
+ success: "구독이 성공적으로 재활성화되었습니다.",
5848
+ error: "구독을 재활성화하는 동안 오류가 발생했습니다."
5849
+ },
5829
5850
  subUnSuspend: {
5830
5851
  isSureToUnSuspend: "구독 일시 중단을 해제하시겠습니까?",
5831
5852
  loading: "구독 일시 중단 해제",
@@ -6689,6 +6710,10 @@ var messages$4 = {
6689
6710
  success: "La suscripción se canceló con éxito",
6690
6711
  error: "Error al cancelar tu suscripción"
6691
6712
  },
6713
+ subReactivation: {
6714
+ success: "La suscripción se reactivó con éxito",
6715
+ error: "Error al reactivar su suscripción"
6716
+ },
6692
6717
  subUnSuspend: {
6693
6718
  isSureToUnSuspend: "¿Estás seguro de que quieres reanudar tu suscripción?",
6694
6719
  loading: "Reanudando tu suscripción",
@@ -11266,7 +11291,7 @@ const initSecuritySdk = () => {
11266
11291
 
11267
11292
  const securityKey = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.security_key;
11268
11293
  if (!securityKey) return;
11269
- window.Pelcro.helpers.loadSDK(`https://www.google.com/recaptcha/enterprise.js?render=${securityKey}`, "pelcro-security-enteprise");
11294
+ window.Pelcro.helpers.loadSDK(`https://www.recaptcha.net/recaptcha/enterprise.js?render=${securityKey}`, "pelcro-security-enteprise");
11270
11295
  });
11271
11296
  };
11272
11297
  const initGATracking = () => {
@@ -13582,6 +13607,7 @@ function LoginModal({
13582
13607
  switchView,
13583
13608
  resetView,
13584
13609
  product,
13610
+ plan,
13585
13611
  order,
13586
13612
  switchToAddressView,
13587
13613
  switchToPaymentView
@@ -13591,13 +13617,12 @@ function LoginModal({
13591
13617
  var _props$onSuccess;
13592
13618
 
13593
13619
  (_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
13594
- resetView();
13595
13620
 
13596
13621
  if (window.Pelcro.paywall.isArticleRestricted()) {
13597
13622
  initPaywalls();
13598
13623
  }
13599
13624
 
13600
- if (product) {
13625
+ if (product && plan) {
13601
13626
  if (product.address_required) {
13602
13627
  return switchToAddressView();
13603
13628
  } else {
@@ -13605,6 +13630,10 @@ function LoginModal({
13605
13630
  }
13606
13631
  }
13607
13632
 
13633
+ if (product && !plan) {
13634
+ return switchView("plan-select");
13635
+ }
13636
+
13608
13637
  if (order) {
13609
13638
  return switchToAddressView();
13610
13639
  }
@@ -14006,6 +14035,7 @@ function RegisterModal(props) {
14006
14035
  switchToAddressView,
14007
14036
  switchToPaymentView,
14008
14037
  product,
14038
+ plan,
14009
14039
  order,
14010
14040
  giftCode,
14011
14041
  isGift
@@ -14051,7 +14081,7 @@ function RegisterModal(props) {
14051
14081
  return switchToAddressView();
14052
14082
  }
14053
14083
 
14054
- if (product) {
14084
+ if (product && plan) {
14055
14085
  if (product.address_required) {
14056
14086
  return switchToAddressView();
14057
14087
  } else {
@@ -14059,6 +14089,10 @@ function RegisterModal(props) {
14059
14089
  }
14060
14090
  }
14061
14091
 
14092
+ if (product && !plan) {
14093
+ return switchView("plan-select");
14094
+ }
14095
+
14062
14096
  return resetView();
14063
14097
  };
14064
14098
 
@@ -35403,6 +35437,12 @@ class Dashboard extends React.Component {
35403
35437
  disableSubmit: false
35404
35438
  });
35405
35439
  this.props.onClose();
35440
+
35441
+ if (err) {
35442
+ return notify.error(this.locale("messages.subReactivation.error"));
35443
+ }
35444
+
35445
+ return notify.success(this.locale("messages.subReactivation.success"));
35406
35446
  });
35407
35447
  });
35408
35448
 
@@ -37752,19 +37792,24 @@ const EmailVerifyModal = ({
37752
37792
  switchToAddressView,
37753
37793
  switchToPaymentView
37754
37794
  } = usePelcro();
37795
+ console.log("verify email");
37755
37796
 
37756
37797
  const onSuccess = res => {
37757
37798
  var _otherProps$onSuccess;
37758
37799
 
37759
- otherProps === null || otherProps === void 0 ? void 0 : (_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps, res);
37800
+ (_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps, res);
37760
37801
 
37761
- if (product) {
37802
+ if (product && plan) {
37762
37803
  if (product.address_required) {
37763
37804
  return switchToAddressView();
37764
37805
  } else {
37765
37806
  return switchToPaymentView();
37766
37807
  }
37767
37808
  }
37809
+
37810
+ if (product && !plan) {
37811
+ return switchView("plan-select");
37812
+ }
37768
37813
  };
37769
37814
 
37770
37815
  const {
package/dist/index.esm.js CHANGED
@@ -3420,7 +3420,10 @@ var labels$10 = {
3420
3420
  interval: "{{count}} {{interval}}",
3421
3421
  interval_plural: "{{count}} {{interval}}s",
3422
3422
  tax: "+ Tax",
3423
- removeCoupon: "REMOVE"
3423
+ removeCoupon: "REMOVE",
3424
+ firstName: "First name",
3425
+ lastName: "Last name",
3426
+ phone: "Phone"
3424
3427
  };
3425
3428
  var checkoutForm_en = {
3426
3429
  messages: messages$14,
@@ -3920,6 +3923,10 @@ var messages$W = {
3920
3923
  success: "Subscription is successfully cancelled",
3921
3924
  error: "Error while cancelling your subscription"
3922
3925
  },
3926
+ subReactivation: {
3927
+ success: "Subscription is successfully reactivated",
3928
+ error: "Error while reactivating your subscription"
3929
+ },
3923
3930
  subUnSuspend: {
3924
3931
  isSureToUnSuspend: "Are you sure you want to unsuspend your subscription?",
3925
3932
  loading: "Unsuspending your subscription",
@@ -4354,7 +4361,10 @@ var labels$H = {
4354
4361
  interval: "{{count}} {{interval}}",
4355
4362
  interval_plural: "{{count}} {{interval}}s",
4356
4363
  tax: "+ Taxe",
4357
- removeCoupon: "RETIRER"
4364
+ removeCoupon: "RETIRER",
4365
+ firstName: "Prénom",
4366
+ lastName: "Nom de famille",
4367
+ phone: "Téléphoner"
4358
4368
  };
4359
4369
  var checkoutForm_fr = {
4360
4370
  messages: messages$M,
@@ -4855,6 +4865,10 @@ var messages$C = {
4855
4865
  success: "L'abonnement a été annulé avec succès",
4856
4866
  error: "Une erreur s'est produite lors de l'annulation de l'abonnement"
4857
4867
  },
4868
+ subReactivation: {
4869
+ success: "L'abonnement a été réactivé avec succès",
4870
+ error: "Erreur lors de la réactivation de votre abonnement"
4871
+ },
4858
4872
  subUnSuspend: {
4859
4873
  isSureToUnSuspend: "Êtes-vous sûr de vouloir annuler la suspension de votre abonnement ?",
4860
4874
  loading: "Annulation de la suspension de votre abonnement",
@@ -5235,7 +5249,10 @@ var labels$s = {
5235
5249
  interval: "{{count}} {{interval}}",
5236
5250
  interval_plural: "{{count}} {{interval}}",
5237
5251
  tax: "+ 세금",
5238
- removeCoupon: "제거"
5252
+ removeCoupon: "제거",
5253
+ firstName: "이름",
5254
+ lastName: "성",
5255
+ phone: "핸드폰"
5239
5256
  };
5240
5257
  var checkoutForm_ko = {
5241
5258
  messages: messages$v,
@@ -5796,6 +5813,10 @@ var messages$l = {
5796
5813
  success: "유료 멤버십이 성공적으로 취소되었습니다.",
5797
5814
  error: "유료 멤버십 취소 과정에서 오류가 발생했습니다."
5798
5815
  },
5816
+ subReactivation: {
5817
+ success: "구독이 성공적으로 재활성화되었습니다.",
5818
+ error: "구독을 재활성화하는 동안 오류가 발생했습니다."
5819
+ },
5799
5820
  subUnSuspend: {
5800
5821
  isSureToUnSuspend: "구독 일시 중단을 해제하시겠습니까?",
5801
5822
  loading: "구독 일시 중단 해제",
@@ -6659,6 +6680,10 @@ var messages$4 = {
6659
6680
  success: "La suscripción se canceló con éxito",
6660
6681
  error: "Error al cancelar tu suscripción"
6661
6682
  },
6683
+ subReactivation: {
6684
+ success: "La suscripción se reactivó con éxito",
6685
+ error: "Error al reactivar su suscripción"
6686
+ },
6662
6687
  subUnSuspend: {
6663
6688
  isSureToUnSuspend: "¿Estás seguro de que quieres reanudar tu suscripción?",
6664
6689
  loading: "Reanudando tu suscripción",
@@ -11236,7 +11261,7 @@ const initSecuritySdk = () => {
11236
11261
 
11237
11262
  const securityKey = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.security_key;
11238
11263
  if (!securityKey) return;
11239
- window.Pelcro.helpers.loadSDK(`https://www.google.com/recaptcha/enterprise.js?render=${securityKey}`, "pelcro-security-enteprise");
11264
+ window.Pelcro.helpers.loadSDK(`https://www.recaptcha.net/recaptcha/enterprise.js?render=${securityKey}`, "pelcro-security-enteprise");
11240
11265
  });
11241
11266
  };
11242
11267
  const initGATracking = () => {
@@ -13552,6 +13577,7 @@ function LoginModal({
13552
13577
  switchView,
13553
13578
  resetView,
13554
13579
  product,
13580
+ plan,
13555
13581
  order,
13556
13582
  switchToAddressView,
13557
13583
  switchToPaymentView
@@ -13561,13 +13587,12 @@ function LoginModal({
13561
13587
  var _props$onSuccess;
13562
13588
 
13563
13589
  (_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
13564
- resetView();
13565
13590
 
13566
13591
  if (window.Pelcro.paywall.isArticleRestricted()) {
13567
13592
  initPaywalls();
13568
13593
  }
13569
13594
 
13570
- if (product) {
13595
+ if (product && plan) {
13571
13596
  if (product.address_required) {
13572
13597
  return switchToAddressView();
13573
13598
  } else {
@@ -13575,6 +13600,10 @@ function LoginModal({
13575
13600
  }
13576
13601
  }
13577
13602
 
13603
+ if (product && !plan) {
13604
+ return switchView("plan-select");
13605
+ }
13606
+
13578
13607
  if (order) {
13579
13608
  return switchToAddressView();
13580
13609
  }
@@ -13976,6 +14005,7 @@ function RegisterModal(props) {
13976
14005
  switchToAddressView,
13977
14006
  switchToPaymentView,
13978
14007
  product,
14008
+ plan,
13979
14009
  order,
13980
14010
  giftCode,
13981
14011
  isGift
@@ -14021,7 +14051,7 @@ function RegisterModal(props) {
14021
14051
  return switchToAddressView();
14022
14052
  }
14023
14053
 
14024
- if (product) {
14054
+ if (product && plan) {
14025
14055
  if (product.address_required) {
14026
14056
  return switchToAddressView();
14027
14057
  } else {
@@ -14029,6 +14059,10 @@ function RegisterModal(props) {
14029
14059
  }
14030
14060
  }
14031
14061
 
14062
+ if (product && !plan) {
14063
+ return switchView("plan-select");
14064
+ }
14065
+
14032
14066
  return resetView();
14033
14067
  };
14034
14068
 
@@ -35373,6 +35407,12 @@ class Dashboard extends Component {
35373
35407
  disableSubmit: false
35374
35408
  });
35375
35409
  this.props.onClose();
35410
+
35411
+ if (err) {
35412
+ return notify.error(this.locale("messages.subReactivation.error"));
35413
+ }
35414
+
35415
+ return notify.success(this.locale("messages.subReactivation.success"));
35376
35416
  });
35377
35417
  });
35378
35418
 
@@ -37722,19 +37762,24 @@ const EmailVerifyModal = ({
37722
37762
  switchToAddressView,
37723
37763
  switchToPaymentView
37724
37764
  } = usePelcro();
37765
+ console.log("verify email");
37725
37766
 
37726
37767
  const onSuccess = res => {
37727
37768
  var _otherProps$onSuccess;
37728
37769
 
37729
- otherProps === null || otherProps === void 0 ? void 0 : (_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps, res);
37770
+ (_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps, res);
37730
37771
 
37731
- if (product) {
37772
+ if (product && plan) {
37732
37773
  if (product.address_required) {
37733
37774
  return switchToAddressView();
37734
37775
  } else {
37735
37776
  return switchToPaymentView();
37736
37777
  }
37737
37778
  }
37779
+
37780
+ if (product && !plan) {
37781
+ return switchView("plan-select");
37782
+ }
37738
37783
  };
37739
37784
 
37740
37785
  const {
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.25",
4
+ "version": "4.0.0-alpha.26",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",
@@ -120,6 +120,9 @@
120
120
  "react": "^16.6.1",
121
121
  "react-dom": "^16.6.1"
122
122
  },
123
+ "optionalDependencies": {
124
+ "fsevents": "2.1.2"
125
+ },
123
126
  "babel": {
124
127
  "presets": [
125
128
  "@babel/preset-env",