@pelcro/react-pelcro-js 3.17.0 → 3.17.2-beta.1
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 +45 -3
- package/dist/index.esm.js +45 -3
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3914,6 +3914,7 @@ var labels$U = {
|
|
|
3914
3914
|
paymentSource: "Payment cards",
|
|
3915
3915
|
actions: "Actions",
|
|
3916
3916
|
expiresOn: "Ends",
|
|
3917
|
+
until: "Until",
|
|
3917
3918
|
startsOn: "Starts",
|
|
3918
3919
|
startDate: "Start date",
|
|
3919
3920
|
renewsOn: "Renews",
|
|
@@ -3952,6 +3953,10 @@ var messages$W = {
|
|
|
3952
3953
|
success: "Subscription is successfully cancelled",
|
|
3953
3954
|
error: "Error while cancelling your subscription"
|
|
3954
3955
|
},
|
|
3956
|
+
subReactivation: {
|
|
3957
|
+
success: "Subscription is successfully reactivated",
|
|
3958
|
+
error: "Error while reactivating your subscription"
|
|
3959
|
+
},
|
|
3955
3960
|
subUnSuspend: {
|
|
3956
3961
|
isSureToUnSuspend: "Are you sure you want to unsuspend your subscription?",
|
|
3957
3962
|
loading: "Unsuspending your subscription",
|
|
@@ -4851,6 +4856,7 @@ var labels$z = {
|
|
|
4851
4856
|
paymentSource: "Sources de paiement",
|
|
4852
4857
|
actions: "Actes",
|
|
4853
4858
|
expiresOn: "Expire le",
|
|
4859
|
+
until: "Jusqu'à ce que",
|
|
4854
4860
|
startsOn: "Débute le",
|
|
4855
4861
|
startDate: "Date de début",
|
|
4856
4862
|
renewsOn: "Renouvelle le",
|
|
@@ -4889,6 +4895,10 @@ var messages$C = {
|
|
|
4889
4895
|
success: "L'abonnement a été annulé avec succès",
|
|
4890
4896
|
error: "Une erreur s'est produite lors de l'annulation de l'abonnement"
|
|
4891
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
|
+
},
|
|
4892
4902
|
subUnSuspend: {
|
|
4893
4903
|
isSureToUnSuspend: "Êtes-vous sûr de vouloir annuler la suspension de votre abonnement ?",
|
|
4894
4904
|
loading: "Annulation de la suspension de votre abonnement",
|
|
@@ -5672,6 +5682,7 @@ var labels$k = {
|
|
|
5672
5682
|
paymentSource: "결제 카드",
|
|
5673
5683
|
actions: "조치",
|
|
5674
5684
|
expiresOn: "종료",
|
|
5685
|
+
until: "까지",
|
|
5675
5686
|
startsOn: "시작",
|
|
5676
5687
|
startDate: "시작일",
|
|
5677
5688
|
renewsOn: "갱신",
|
|
@@ -5770,6 +5781,10 @@ var messages$l = {
|
|
|
5770
5781
|
success: "유료 멤버십이 성공적으로 취소되었습니다.",
|
|
5771
5782
|
error: "유료 멤버십 취소 과정에서 오류가 발생했습니다."
|
|
5772
5783
|
},
|
|
5784
|
+
subReactivation: {
|
|
5785
|
+
success: "구독이 성공적으로 재활성화되었습니다.",
|
|
5786
|
+
error: "구독을 재활성화하는 동안 오류가 발생했습니다."
|
|
5787
|
+
},
|
|
5773
5788
|
subUnSuspend: {
|
|
5774
5789
|
isSureToUnSuspend: "구독 일시 중단을 해제하시겠습니까?",
|
|
5775
5790
|
loading: "구독 일시 중단 해제",
|
|
@@ -6594,6 +6609,7 @@ var labels$5 = {
|
|
|
6594
6609
|
paymentSource: "Datos de pago",
|
|
6595
6610
|
actions: "Acciones",
|
|
6596
6611
|
expiresOn: "Finaliza",
|
|
6612
|
+
until: "Hasta que",
|
|
6597
6613
|
startsOn: "Inicia",
|
|
6598
6614
|
startDate: "Fecha de inicio",
|
|
6599
6615
|
renewsOn: "Renovación",
|
|
@@ -6632,6 +6648,10 @@ var messages$4 = {
|
|
|
6632
6648
|
success: "La suscripción se canceló con éxito",
|
|
6633
6649
|
error: "Error al cancelar tu suscripción"
|
|
6634
6650
|
},
|
|
6651
|
+
subReactivation: {
|
|
6652
|
+
success: "La suscripción se reactivó con éxito",
|
|
6653
|
+
error: "Error al reactivar su suscripción"
|
|
6654
|
+
},
|
|
6635
6655
|
subUnSuspend: {
|
|
6636
6656
|
isSureToUnSuspend: "¿Estás seguro de que quieres reanudar tu suscripción?",
|
|
6637
6657
|
loading: "Reanudando tu suscripción",
|
|
@@ -13194,6 +13214,7 @@ function LoginModal(_ref) {
|
|
|
13194
13214
|
switchView,
|
|
13195
13215
|
resetView,
|
|
13196
13216
|
product,
|
|
13217
|
+
plan,
|
|
13197
13218
|
order,
|
|
13198
13219
|
switchToAddressView,
|
|
13199
13220
|
switchToPaymentView
|
|
@@ -13204,13 +13225,16 @@ function LoginModal(_ref) {
|
|
|
13204
13225
|
if (window.Pelcro.paywall.isArticleRestricted()) {
|
|
13205
13226
|
initPaywalls();
|
|
13206
13227
|
}
|
|
13207
|
-
if (product) {
|
|
13228
|
+
if (product && plan) {
|
|
13208
13229
|
if (product.address_required) {
|
|
13209
13230
|
return switchToAddressView();
|
|
13210
13231
|
} else {
|
|
13211
13232
|
return switchToPaymentView();
|
|
13212
13233
|
}
|
|
13213
13234
|
}
|
|
13235
|
+
if (product && !plan) {
|
|
13236
|
+
return switchView("plan-select");
|
|
13237
|
+
}
|
|
13214
13238
|
if (order) {
|
|
13215
13239
|
return switchToAddressView();
|
|
13216
13240
|
}
|
|
@@ -13757,6 +13781,7 @@ function RegisterModal(props) {
|
|
|
13757
13781
|
switchToAddressView,
|
|
13758
13782
|
switchToPaymentView,
|
|
13759
13783
|
product,
|
|
13784
|
+
plan,
|
|
13760
13785
|
order,
|
|
13761
13786
|
giftCode,
|
|
13762
13787
|
isGift
|
|
@@ -13795,13 +13820,16 @@ function RegisterModal(props) {
|
|
|
13795
13820
|
if (order) {
|
|
13796
13821
|
return switchToAddressView();
|
|
13797
13822
|
}
|
|
13798
|
-
if (product) {
|
|
13823
|
+
if (product && plan) {
|
|
13799
13824
|
if (product.address_required) {
|
|
13800
13825
|
return switchToAddressView();
|
|
13801
13826
|
} else {
|
|
13802
13827
|
return switchToPaymentView();
|
|
13803
13828
|
}
|
|
13804
13829
|
}
|
|
13830
|
+
if (product && !plan) {
|
|
13831
|
+
return switchView("plan-select");
|
|
13832
|
+
}
|
|
13805
13833
|
return resetView();
|
|
13806
13834
|
};
|
|
13807
13835
|
return /*#__PURE__*/React__default['default'].createElement(Modal, {
|
|
@@ -27703,6 +27731,12 @@ class Dashboard extends React.Component {
|
|
|
27703
27731
|
if (subscription.status === "incomplete") {
|
|
27704
27732
|
return `${this.locale("labels.status.incomplete")}`;
|
|
27705
27733
|
}
|
|
27734
|
+
if (subscription.status === "extended") {
|
|
27735
|
+
// DateTime from BE is missing 3 zeros so we add them before instancing a date
|
|
27736
|
+
const expiryDate = new Date(Number(`${subscription.end_date}000`));
|
|
27737
|
+
const formattedExpiryDate = new Intl.DateTimeFormat("en-CA").format(expiryDate);
|
|
27738
|
+
return `${this.locale("labels.until")} ${formattedExpiryDate}`;
|
|
27739
|
+
}
|
|
27706
27740
|
if (subscription.cancel_at_period_end) {
|
|
27707
27741
|
// DateTime from BE is missing 3 zeros so we add them before instancing a date
|
|
27708
27742
|
const expiryDate = new Date(Number(`${subscription.expires_at}000`));
|
|
@@ -27726,6 +27760,10 @@ class Dashboard extends React.Component {
|
|
|
27726
27760
|
disableSubmit: false
|
|
27727
27761
|
});
|
|
27728
27762
|
this.props.onClose();
|
|
27763
|
+
if (err) {
|
|
27764
|
+
return notify$1.error(this.locale("messages.subReactivation.error"));
|
|
27765
|
+
}
|
|
27766
|
+
return notify$1.success(this.locale("messages.subReactivation.success"));
|
|
27729
27767
|
});
|
|
27730
27768
|
});
|
|
27731
27769
|
_defineProperty$3(this, "getSubscriptionStatus", sub => {
|
|
@@ -30121,6 +30159,7 @@ const EmailVerifyModal = _ref => {
|
|
|
30121
30159
|
} = _ref;
|
|
30122
30160
|
const {
|
|
30123
30161
|
product,
|
|
30162
|
+
plan,
|
|
30124
30163
|
switchToAddressView,
|
|
30125
30164
|
switchToPaymentView
|
|
30126
30165
|
} = usePelcro();
|
|
@@ -30128,13 +30167,16 @@ const EmailVerifyModal = _ref => {
|
|
|
30128
30167
|
const onSuccess = res => {
|
|
30129
30168
|
var _otherProps$onSuccess;
|
|
30130
30169
|
(_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps, res);
|
|
30131
|
-
if (product) {
|
|
30170
|
+
if (product && plan) {
|
|
30132
30171
|
if (product.address_required) {
|
|
30133
30172
|
return switchToAddressView();
|
|
30134
30173
|
} else {
|
|
30135
30174
|
return switchToPaymentView();
|
|
30136
30175
|
}
|
|
30137
30176
|
}
|
|
30177
|
+
if (product && !plan) {
|
|
30178
|
+
return switchView("plan-select");
|
|
30179
|
+
}
|
|
30138
30180
|
};
|
|
30139
30181
|
return /*#__PURE__*/React__default['default'].createElement(Modal, {
|
|
30140
30182
|
onDisplay: onDisplay,
|
package/dist/index.esm.js
CHANGED
|
@@ -3884,6 +3884,7 @@ var labels$U = {
|
|
|
3884
3884
|
paymentSource: "Payment cards",
|
|
3885
3885
|
actions: "Actions",
|
|
3886
3886
|
expiresOn: "Ends",
|
|
3887
|
+
until: "Until",
|
|
3887
3888
|
startsOn: "Starts",
|
|
3888
3889
|
startDate: "Start date",
|
|
3889
3890
|
renewsOn: "Renews",
|
|
@@ -3922,6 +3923,10 @@ var messages$W = {
|
|
|
3922
3923
|
success: "Subscription is successfully cancelled",
|
|
3923
3924
|
error: "Error while cancelling your subscription"
|
|
3924
3925
|
},
|
|
3926
|
+
subReactivation: {
|
|
3927
|
+
success: "Subscription is successfully reactivated",
|
|
3928
|
+
error: "Error while reactivating your subscription"
|
|
3929
|
+
},
|
|
3925
3930
|
subUnSuspend: {
|
|
3926
3931
|
isSureToUnSuspend: "Are you sure you want to unsuspend your subscription?",
|
|
3927
3932
|
loading: "Unsuspending your subscription",
|
|
@@ -4821,6 +4826,7 @@ var labels$z = {
|
|
|
4821
4826
|
paymentSource: "Sources de paiement",
|
|
4822
4827
|
actions: "Actes",
|
|
4823
4828
|
expiresOn: "Expire le",
|
|
4829
|
+
until: "Jusqu'à ce que",
|
|
4824
4830
|
startsOn: "Débute le",
|
|
4825
4831
|
startDate: "Date de début",
|
|
4826
4832
|
renewsOn: "Renouvelle le",
|
|
@@ -4859,6 +4865,10 @@ var messages$C = {
|
|
|
4859
4865
|
success: "L'abonnement a été annulé avec succès",
|
|
4860
4866
|
error: "Une erreur s'est produite lors de l'annulation de l'abonnement"
|
|
4861
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
|
+
},
|
|
4862
4872
|
subUnSuspend: {
|
|
4863
4873
|
isSureToUnSuspend: "Êtes-vous sûr de vouloir annuler la suspension de votre abonnement ?",
|
|
4864
4874
|
loading: "Annulation de la suspension de votre abonnement",
|
|
@@ -5642,6 +5652,7 @@ var labels$k = {
|
|
|
5642
5652
|
paymentSource: "결제 카드",
|
|
5643
5653
|
actions: "조치",
|
|
5644
5654
|
expiresOn: "종료",
|
|
5655
|
+
until: "까지",
|
|
5645
5656
|
startsOn: "시작",
|
|
5646
5657
|
startDate: "시작일",
|
|
5647
5658
|
renewsOn: "갱신",
|
|
@@ -5740,6 +5751,10 @@ var messages$l = {
|
|
|
5740
5751
|
success: "유료 멤버십이 성공적으로 취소되었습니다.",
|
|
5741
5752
|
error: "유료 멤버십 취소 과정에서 오류가 발생했습니다."
|
|
5742
5753
|
},
|
|
5754
|
+
subReactivation: {
|
|
5755
|
+
success: "구독이 성공적으로 재활성화되었습니다.",
|
|
5756
|
+
error: "구독을 재활성화하는 동안 오류가 발생했습니다."
|
|
5757
|
+
},
|
|
5743
5758
|
subUnSuspend: {
|
|
5744
5759
|
isSureToUnSuspend: "구독 일시 중단을 해제하시겠습니까?",
|
|
5745
5760
|
loading: "구독 일시 중단 해제",
|
|
@@ -6564,6 +6579,7 @@ var labels$5 = {
|
|
|
6564
6579
|
paymentSource: "Datos de pago",
|
|
6565
6580
|
actions: "Acciones",
|
|
6566
6581
|
expiresOn: "Finaliza",
|
|
6582
|
+
until: "Hasta que",
|
|
6567
6583
|
startsOn: "Inicia",
|
|
6568
6584
|
startDate: "Fecha de inicio",
|
|
6569
6585
|
renewsOn: "Renovación",
|
|
@@ -6602,6 +6618,10 @@ var messages$4 = {
|
|
|
6602
6618
|
success: "La suscripción se canceló con éxito",
|
|
6603
6619
|
error: "Error al cancelar tu suscripción"
|
|
6604
6620
|
},
|
|
6621
|
+
subReactivation: {
|
|
6622
|
+
success: "La suscripción se reactivó con éxito",
|
|
6623
|
+
error: "Error al reactivar su suscripción"
|
|
6624
|
+
},
|
|
6605
6625
|
subUnSuspend: {
|
|
6606
6626
|
isSureToUnSuspend: "¿Estás seguro de que quieres reanudar tu suscripción?",
|
|
6607
6627
|
loading: "Reanudando tu suscripción",
|
|
@@ -13164,6 +13184,7 @@ function LoginModal(_ref) {
|
|
|
13164
13184
|
switchView,
|
|
13165
13185
|
resetView,
|
|
13166
13186
|
product,
|
|
13187
|
+
plan,
|
|
13167
13188
|
order,
|
|
13168
13189
|
switchToAddressView,
|
|
13169
13190
|
switchToPaymentView
|
|
@@ -13174,13 +13195,16 @@ function LoginModal(_ref) {
|
|
|
13174
13195
|
if (window.Pelcro.paywall.isArticleRestricted()) {
|
|
13175
13196
|
initPaywalls();
|
|
13176
13197
|
}
|
|
13177
|
-
if (product) {
|
|
13198
|
+
if (product && plan) {
|
|
13178
13199
|
if (product.address_required) {
|
|
13179
13200
|
return switchToAddressView();
|
|
13180
13201
|
} else {
|
|
13181
13202
|
return switchToPaymentView();
|
|
13182
13203
|
}
|
|
13183
13204
|
}
|
|
13205
|
+
if (product && !plan) {
|
|
13206
|
+
return switchView("plan-select");
|
|
13207
|
+
}
|
|
13184
13208
|
if (order) {
|
|
13185
13209
|
return switchToAddressView();
|
|
13186
13210
|
}
|
|
@@ -13727,6 +13751,7 @@ function RegisterModal(props) {
|
|
|
13727
13751
|
switchToAddressView,
|
|
13728
13752
|
switchToPaymentView,
|
|
13729
13753
|
product,
|
|
13754
|
+
plan,
|
|
13730
13755
|
order,
|
|
13731
13756
|
giftCode,
|
|
13732
13757
|
isGift
|
|
@@ -13765,13 +13790,16 @@ function RegisterModal(props) {
|
|
|
13765
13790
|
if (order) {
|
|
13766
13791
|
return switchToAddressView();
|
|
13767
13792
|
}
|
|
13768
|
-
if (product) {
|
|
13793
|
+
if (product && plan) {
|
|
13769
13794
|
if (product.address_required) {
|
|
13770
13795
|
return switchToAddressView();
|
|
13771
13796
|
} else {
|
|
13772
13797
|
return switchToPaymentView();
|
|
13773
13798
|
}
|
|
13774
13799
|
}
|
|
13800
|
+
if (product && !plan) {
|
|
13801
|
+
return switchView("plan-select");
|
|
13802
|
+
}
|
|
13775
13803
|
return resetView();
|
|
13776
13804
|
};
|
|
13777
13805
|
return /*#__PURE__*/React__default.createElement(Modal, {
|
|
@@ -27673,6 +27701,12 @@ class Dashboard extends Component {
|
|
|
27673
27701
|
if (subscription.status === "incomplete") {
|
|
27674
27702
|
return `${this.locale("labels.status.incomplete")}`;
|
|
27675
27703
|
}
|
|
27704
|
+
if (subscription.status === "extended") {
|
|
27705
|
+
// DateTime from BE is missing 3 zeros so we add them before instancing a date
|
|
27706
|
+
const expiryDate = new Date(Number(`${subscription.end_date}000`));
|
|
27707
|
+
const formattedExpiryDate = new Intl.DateTimeFormat("en-CA").format(expiryDate);
|
|
27708
|
+
return `${this.locale("labels.until")} ${formattedExpiryDate}`;
|
|
27709
|
+
}
|
|
27676
27710
|
if (subscription.cancel_at_period_end) {
|
|
27677
27711
|
// DateTime from BE is missing 3 zeros so we add them before instancing a date
|
|
27678
27712
|
const expiryDate = new Date(Number(`${subscription.expires_at}000`));
|
|
@@ -27696,6 +27730,10 @@ class Dashboard extends Component {
|
|
|
27696
27730
|
disableSubmit: false
|
|
27697
27731
|
});
|
|
27698
27732
|
this.props.onClose();
|
|
27733
|
+
if (err) {
|
|
27734
|
+
return notify$1.error(this.locale("messages.subReactivation.error"));
|
|
27735
|
+
}
|
|
27736
|
+
return notify$1.success(this.locale("messages.subReactivation.success"));
|
|
27699
27737
|
});
|
|
27700
27738
|
});
|
|
27701
27739
|
_defineProperty$3(this, "getSubscriptionStatus", sub => {
|
|
@@ -30091,6 +30129,7 @@ const EmailVerifyModal = _ref => {
|
|
|
30091
30129
|
} = _ref;
|
|
30092
30130
|
const {
|
|
30093
30131
|
product,
|
|
30132
|
+
plan,
|
|
30094
30133
|
switchToAddressView,
|
|
30095
30134
|
switchToPaymentView
|
|
30096
30135
|
} = usePelcro();
|
|
@@ -30098,13 +30137,16 @@ const EmailVerifyModal = _ref => {
|
|
|
30098
30137
|
const onSuccess = res => {
|
|
30099
30138
|
var _otherProps$onSuccess;
|
|
30100
30139
|
(_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps, res);
|
|
30101
|
-
if (product) {
|
|
30140
|
+
if (product && plan) {
|
|
30102
30141
|
if (product.address_required) {
|
|
30103
30142
|
return switchToAddressView();
|
|
30104
30143
|
} else {
|
|
30105
30144
|
return switchToPaymentView();
|
|
30106
30145
|
}
|
|
30107
30146
|
}
|
|
30147
|
+
if (product && !plan) {
|
|
30148
|
+
return switchView("plan-select");
|
|
30149
|
+
}
|
|
30108
30150
|
};
|
|
30109
30151
|
return /*#__PURE__*/React__default.createElement(Modal, {
|
|
30110
30152
|
onDisplay: onDisplay,
|