@pelcro/react-pelcro-js 3.13.0-beta.17 → 3.13.0-beta.19
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 +143 -65
- package/dist/index.esm.js +143 -65
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3635,6 +3635,7 @@ var labels$Y = {
|
|
|
3635
3635
|
firstName: "First name",
|
|
3636
3636
|
lastName: "Last name",
|
|
3637
3637
|
username: "Username",
|
|
3638
|
+
displayname: "Display name",
|
|
3638
3639
|
phone: "Phone",
|
|
3639
3640
|
submit: "Submit",
|
|
3640
3641
|
required: "Required",
|
|
@@ -4569,6 +4570,7 @@ var labels$D = {
|
|
|
4569
4570
|
firstName: "Prénom",
|
|
4570
4571
|
lastName: "Nom de famille",
|
|
4571
4572
|
username: "Nom d'utilisateur",
|
|
4573
|
+
displayname: "Afficher un nom",
|
|
4572
4574
|
phone: "Numéro de téléphone",
|
|
4573
4575
|
submit: "Soumettre",
|
|
4574
4576
|
required: "Champs obligatoires",
|
|
@@ -5387,6 +5389,7 @@ var labels$o = {
|
|
|
5387
5389
|
firstName: "이름",
|
|
5388
5390
|
lastName: "성",
|
|
5389
5391
|
username: "사용자 이름",
|
|
5392
|
+
displayname: "이름 표시하기",
|
|
5390
5393
|
phone: "전화번호",
|
|
5391
5394
|
submit: "제출",
|
|
5392
5395
|
required: "필수 항목",
|
|
@@ -6307,6 +6310,7 @@ var labels$9 = {
|
|
|
6307
6310
|
firstName: "Nombre",
|
|
6308
6311
|
lastName: "Apellido",
|
|
6309
6312
|
username: "Nombre de usuario",
|
|
6313
|
+
displayname: "Nombre para mostrar",
|
|
6310
6314
|
phone: "Teléfono",
|
|
6311
6315
|
submit: "Enviar",
|
|
6312
6316
|
required: "Obligatorio",
|
|
@@ -10337,7 +10341,7 @@ toast.confirm = (onConfirm, {
|
|
|
10337
10341
|
...options
|
|
10338
10342
|
});
|
|
10339
10343
|
setTimeout(() => {
|
|
10340
|
-
notify.dismiss(id);
|
|
10344
|
+
notify$1.dismiss(id);
|
|
10341
10345
|
}, 3000);
|
|
10342
10346
|
};
|
|
10343
10347
|
|
|
@@ -10347,12 +10351,12 @@ toast.confirm = (onConfirm, {
|
|
|
10347
10351
|
...options
|
|
10348
10352
|
});
|
|
10349
10353
|
setTimeout(() => {
|
|
10350
|
-
notify.dismiss(id);
|
|
10354
|
+
notify$1.dismiss(id);
|
|
10351
10355
|
}, 3000);
|
|
10352
10356
|
};
|
|
10353
10357
|
};
|
|
10354
10358
|
|
|
10355
|
-
const notify = toast;
|
|
10359
|
+
const notify$1 = toast;
|
|
10356
10360
|
|
|
10357
10361
|
const translations = i18next.t("common:buttons", {
|
|
10358
10362
|
returnObjects: true
|
|
@@ -10423,7 +10427,7 @@ const init$1 = () => {
|
|
|
10423
10427
|
const errorMessage = i18next.t("messages:invalidSubscription", {
|
|
10424
10428
|
returnObjects: true
|
|
10425
10429
|
});
|
|
10426
|
-
return notify.error(errorMessage);
|
|
10430
|
+
return notify$1.error(errorMessage);
|
|
10427
10431
|
}
|
|
10428
10432
|
|
|
10429
10433
|
switchView("manage-members");
|
|
@@ -10432,7 +10436,7 @@ const init$1 = () => {
|
|
|
10432
10436
|
const errorMessage = i18next.t("messages:invalidSubscription", {
|
|
10433
10437
|
returnObjects: true
|
|
10434
10438
|
});
|
|
10435
|
-
return notify.error(errorMessage);
|
|
10439
|
+
return notify$1.error(errorMessage);
|
|
10436
10440
|
}
|
|
10437
10441
|
}
|
|
10438
10442
|
}
|
|
@@ -10602,7 +10606,7 @@ const init$1 = () => {
|
|
|
10602
10606
|
const errorMsg = i18next.t("shop:messages.currencyMismatch", {
|
|
10603
10607
|
currency: userCurrency
|
|
10604
10608
|
});
|
|
10605
|
-
notify.error(errorMsg);
|
|
10609
|
+
notify$1.error(errorMsg);
|
|
10606
10610
|
}
|
|
10607
10611
|
});
|
|
10608
10612
|
}
|
|
@@ -10704,7 +10708,7 @@ const init = () => {
|
|
|
10704
10708
|
elemDeepClone.setAttribute("style", "filter:blur(3px) !important; pointer-events:none !important; user-select:none !important");
|
|
10705
10709
|
unblurElemWhenUserSubscribes(elemDeepClone, entitlements);
|
|
10706
10710
|
const NOTIFICATION_ID = "entitlement";
|
|
10707
|
-
notify( /*#__PURE__*/React__default['default'].createElement("p", null, /*#__PURE__*/React__default['default'].createElement(Trans, {
|
|
10711
|
+
notify$1( /*#__PURE__*/React__default['default'].createElement("p", null, /*#__PURE__*/React__default['default'].createElement(Trans, {
|
|
10708
10712
|
i18nKey: "messages:entitlement"
|
|
10709
10713
|
}, "Some of the content on this page is available with one or more of our plans.", /*#__PURE__*/React__default['default'].createElement(Link, {
|
|
10710
10714
|
onClick: () => {
|
|
@@ -10721,7 +10725,7 @@ const init = () => {
|
|
|
10721
10725
|
});
|
|
10722
10726
|
}
|
|
10723
10727
|
|
|
10724
|
-
notify.dismiss(NOTIFICATION_ID);
|
|
10728
|
+
notify$1.dismiss(NOTIFICATION_ID);
|
|
10725
10729
|
switchView("_plan-select-entitlements");
|
|
10726
10730
|
}
|
|
10727
10731
|
}, "Subscribe"), "now to get full page access.")), {
|
|
@@ -11481,10 +11485,10 @@ const verifyEmailTokenFromUrl = () => {
|
|
|
11481
11485
|
token: emailToken
|
|
11482
11486
|
}, (err, res) => {
|
|
11483
11487
|
if (err) {
|
|
11484
|
-
return notify.error(getErrorMessages(err));
|
|
11488
|
+
return notify$1.error(getErrorMessages(err));
|
|
11485
11489
|
}
|
|
11486
11490
|
|
|
11487
|
-
return notify.success(translations.success);
|
|
11491
|
+
return notify$1.success(translations.success);
|
|
11488
11492
|
});
|
|
11489
11493
|
}, {
|
|
11490
11494
|
once: true
|
|
@@ -11510,7 +11514,7 @@ const verifyLinkTokenFromUrl = () => {
|
|
|
11510
11514
|
token: loginToken
|
|
11511
11515
|
}, (err, res) => {
|
|
11512
11516
|
if (err) {
|
|
11513
|
-
return notify.error(getErrorMessages(err));
|
|
11517
|
+
return notify$1.error(getErrorMessages(err));
|
|
11514
11518
|
}
|
|
11515
11519
|
|
|
11516
11520
|
const {
|
|
@@ -11520,11 +11524,11 @@ const verifyLinkTokenFromUrl = () => {
|
|
|
11520
11524
|
auth_token
|
|
11521
11525
|
}, (err, res) => {
|
|
11522
11526
|
if (err) {
|
|
11523
|
-
return notify.error(getErrorMessages(err));
|
|
11527
|
+
return notify$1.error(getErrorMessages(err));
|
|
11524
11528
|
}
|
|
11525
11529
|
|
|
11526
11530
|
resetView();
|
|
11527
|
-
return notify.success(translations.success);
|
|
11531
|
+
return notify$1.success(translations.success);
|
|
11528
11532
|
});
|
|
11529
11533
|
});
|
|
11530
11534
|
}, {
|
|
@@ -11567,7 +11571,7 @@ const showInvoiceDetailsFromUrl = () => {
|
|
|
11567
11571
|
const errorMessage = i18next.t("messages:invalidInvoice", {
|
|
11568
11572
|
returnObjects: true
|
|
11569
11573
|
});
|
|
11570
|
-
return notify.error(errorMessage);
|
|
11574
|
+
return notify$1.error(errorMessage);
|
|
11571
11575
|
}
|
|
11572
11576
|
|
|
11573
11577
|
const {
|
|
@@ -11578,7 +11582,7 @@ const showInvoiceDetailsFromUrl = () => {
|
|
|
11578
11582
|
const errorMessage = i18next.t("messages:zeroTotalInvoice", {
|
|
11579
11583
|
returnObjects: true
|
|
11580
11584
|
});
|
|
11581
|
-
return notify.error(errorMessage);
|
|
11585
|
+
return notify$1.error(errorMessage);
|
|
11582
11586
|
}
|
|
11583
11587
|
|
|
11584
11588
|
return switchView("invoice-details");
|
|
@@ -11607,7 +11611,7 @@ const showSubscriptionManageMembersFromUrl = () => {
|
|
|
11607
11611
|
const errorMessage = i18next.t("messages:invalidSubscription", {
|
|
11608
11612
|
returnObjects: true
|
|
11609
11613
|
});
|
|
11610
|
-
return notify.error(errorMessage);
|
|
11614
|
+
return notify$1.error(errorMessage);
|
|
11611
11615
|
}
|
|
11612
11616
|
|
|
11613
11617
|
return switchView("manage-members");
|
|
@@ -13468,7 +13472,7 @@ function LoginModal({
|
|
|
13468
13472
|
switchView,
|
|
13469
13473
|
resetView,
|
|
13470
13474
|
product,
|
|
13471
|
-
|
|
13475
|
+
order,
|
|
13472
13476
|
switchToAddressView,
|
|
13473
13477
|
switchToPaymentView
|
|
13474
13478
|
} = usePelcro$1();
|
|
@@ -13482,7 +13486,7 @@ function LoginModal({
|
|
|
13482
13486
|
initPaywalls();
|
|
13483
13487
|
}
|
|
13484
13488
|
|
|
13485
|
-
if (product
|
|
13489
|
+
if (product) {
|
|
13486
13490
|
if (product.address_required) {
|
|
13487
13491
|
return switchToAddressView();
|
|
13488
13492
|
} else {
|
|
@@ -13490,6 +13494,10 @@ function LoginModal({
|
|
|
13490
13494
|
}
|
|
13491
13495
|
}
|
|
13492
13496
|
|
|
13497
|
+
if (order) {
|
|
13498
|
+
return switchToAddressView();
|
|
13499
|
+
}
|
|
13500
|
+
|
|
13493
13501
|
resetView();
|
|
13494
13502
|
const viewFromURL = getStableViewID(window.Pelcro.helpers.getURLParameter("view"));
|
|
13495
13503
|
const viewsURLs = ["invoice-details", "gift-redeem", "plan-select"];
|
|
@@ -19594,7 +19602,7 @@ const SubscriptionCancelNowButton = ({
|
|
|
19594
19602
|
|
|
19595
19603
|
switchView(null); //Show confirmation alert after closing the modal
|
|
19596
19604
|
|
|
19597
|
-
notify.confirm((onSuccess, onFailure) => {
|
|
19605
|
+
notify$1.confirm((onSuccess, onFailure) => {
|
|
19598
19606
|
cancelSubscription(payload, onSuccess, onFailure);
|
|
19599
19607
|
}, {
|
|
19600
19608
|
confirmMessage: t("messages.subCancellation.isSureToCancelNow"),
|
|
@@ -19666,7 +19674,7 @@ const SubscriptionCancelLaterButton = ({
|
|
|
19666
19674
|
|
|
19667
19675
|
switchView(null); //Show confirmation alert after closing the modal
|
|
19668
19676
|
|
|
19669
|
-
notify.confirm((onSuccess, onFailure) => {
|
|
19677
|
+
notify$1.confirm((onSuccess, onFailure) => {
|
|
19670
19678
|
cancelSubscription(payload, onSuccess, onFailure);
|
|
19671
19679
|
}, {
|
|
19672
19680
|
confirmMessage: t("messages.subCancellation.isSureToCancel"),
|
|
@@ -19903,7 +19911,7 @@ const SubscriptionSuspendButton = ({
|
|
|
19903
19911
|
|
|
19904
19912
|
switchView(null); //Show confirmation alert after closing the modal
|
|
19905
19913
|
|
|
19906
|
-
notify.confirm((onSuccess, onFailure) => {
|
|
19914
|
+
notify$1.confirm((onSuccess, onFailure) => {
|
|
19907
19915
|
suspendSubscription(payload, onSuccess, onFailure);
|
|
19908
19916
|
}, {
|
|
19909
19917
|
confirmMessage: t("messages.subCancellation.isSureToSuspendNow"),
|
|
@@ -21750,6 +21758,37 @@ const UserUpdateTin = props => /*#__PURE__*/React__default['default'].createElem
|
|
|
21750
21758
|
store: store$f
|
|
21751
21759
|
}, props));
|
|
21752
21760
|
|
|
21761
|
+
function DisplayName({
|
|
21762
|
+
store,
|
|
21763
|
+
...otherProps
|
|
21764
|
+
}) {
|
|
21765
|
+
const {
|
|
21766
|
+
dispatch,
|
|
21767
|
+
state
|
|
21768
|
+
} = React.useContext(store);
|
|
21769
|
+
|
|
21770
|
+
const handleInputChange = value => {
|
|
21771
|
+
dispatch({
|
|
21772
|
+
type: SET_DISPLAY_NAME,
|
|
21773
|
+
payload: value
|
|
21774
|
+
});
|
|
21775
|
+
};
|
|
21776
|
+
|
|
21777
|
+
if (state.loading) {
|
|
21778
|
+
return /*#__PURE__*/React__default['default'].createElement(Loader, null);
|
|
21779
|
+
}
|
|
21780
|
+
|
|
21781
|
+
return /*#__PURE__*/React__default['default'].createElement(Input, Object.assign({
|
|
21782
|
+
type: "text",
|
|
21783
|
+
value: state.displayName || null,
|
|
21784
|
+
onChange: e => handleInputChange(e.target.value)
|
|
21785
|
+
}, otherProps));
|
|
21786
|
+
}
|
|
21787
|
+
|
|
21788
|
+
const UserUpdateDisplayName = props => /*#__PURE__*/React__default['default'].createElement(DisplayName, Object.assign({
|
|
21789
|
+
store: store$f
|
|
21790
|
+
}, props));
|
|
21791
|
+
|
|
21753
21792
|
const UserUpdateView = props => {
|
|
21754
21793
|
var _window$Pelcro$site$r, _window$Pelcro, _window$Pelcro$uiSett;
|
|
21755
21794
|
|
|
@@ -21785,7 +21824,12 @@ const UserUpdateView = props => {
|
|
|
21785
21824
|
errorId: "pelcro-input-last-name-error",
|
|
21786
21825
|
label: t("labels.lastName"),
|
|
21787
21826
|
required: supportsTap ? true : false
|
|
21788
|
-
})),
|
|
21827
|
+
})), /*#__PURE__*/React__default['default'].createElement(UserUpdateDisplayName, {
|
|
21828
|
+
id: "pelcro-input-display-name",
|
|
21829
|
+
autoComplete: "display-name",
|
|
21830
|
+
errorId: "pelcro-input-display-name-error",
|
|
21831
|
+
label: t("labels.displayname")
|
|
21832
|
+
}), showUsernameInput && /*#__PURE__*/React__default['default'].createElement(UserUpdateUsername, {
|
|
21789
21833
|
id: "pelcro-input-user-name",
|
|
21790
21834
|
autoComplete: "user-name",
|
|
21791
21835
|
errorId: "pelcro-input-user-name-error",
|
|
@@ -21837,37 +21881,6 @@ function UserUpdateModal({
|
|
|
21837
21881
|
}
|
|
21838
21882
|
UserUpdateModal.viewId = "user-edit";
|
|
21839
21883
|
|
|
21840
|
-
function DisplayName({
|
|
21841
|
-
store,
|
|
21842
|
-
...otherProps
|
|
21843
|
-
}) {
|
|
21844
|
-
const {
|
|
21845
|
-
dispatch,
|
|
21846
|
-
state
|
|
21847
|
-
} = React.useContext(store);
|
|
21848
|
-
|
|
21849
|
-
const handleInputChange = value => {
|
|
21850
|
-
dispatch({
|
|
21851
|
-
type: SET_DISPLAY_NAME,
|
|
21852
|
-
payload: value
|
|
21853
|
-
});
|
|
21854
|
-
};
|
|
21855
|
-
|
|
21856
|
-
if (state.loading) {
|
|
21857
|
-
return /*#__PURE__*/React__default['default'].createElement(Loader, null);
|
|
21858
|
-
}
|
|
21859
|
-
|
|
21860
|
-
return /*#__PURE__*/React__default['default'].createElement(Input, Object.assign({
|
|
21861
|
-
type: "text",
|
|
21862
|
-
value: state.displayName || null,
|
|
21863
|
-
onChange: e => handleInputChange(e.target.value)
|
|
21864
|
-
}, otherProps));
|
|
21865
|
-
}
|
|
21866
|
-
|
|
21867
|
-
const UserUpdateDisplayName = props => /*#__PURE__*/React__default['default'].createElement(DisplayName, Object.assign({
|
|
21868
|
-
store: store$f
|
|
21869
|
-
}, props));
|
|
21870
|
-
|
|
21871
21884
|
const UserUpdateTextInput = props => {
|
|
21872
21885
|
return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
|
|
21873
21886
|
store: store$f
|
|
@@ -22035,7 +22048,7 @@ const AddressCreateContainer = ({
|
|
|
22035
22048
|
return onFailure(err);
|
|
22036
22049
|
}
|
|
22037
22050
|
|
|
22038
|
-
notify.success(t("messages.addressUpdated"));
|
|
22051
|
+
notify$1.success(t("messages.addressUpdated"));
|
|
22039
22052
|
return onMembershipAdressUpdateSuccess(res);
|
|
22040
22053
|
});
|
|
22041
22054
|
}
|
|
@@ -24805,7 +24818,7 @@ const ShopView = () => {
|
|
|
24805
24818
|
className: "plc-mt-2"
|
|
24806
24819
|
}), /*#__PURE__*/React__default['default'].createElement(ShopPurchaseButton, {
|
|
24807
24820
|
itemId: item.id,
|
|
24808
|
-
className: "plc-mt-2"
|
|
24821
|
+
className: "plc-mt-2 pelcro-purchase-button"
|
|
24809
24822
|
})));
|
|
24810
24823
|
})));
|
|
24811
24824
|
};
|
|
@@ -25639,7 +25652,7 @@ const AddressSelectContainer = ({
|
|
|
25639
25652
|
return onFailure(err);
|
|
25640
25653
|
}
|
|
25641
25654
|
|
|
25642
|
-
notify.success(t("messages.addressUpdated"));
|
|
25655
|
+
notify$1.success(t("messages.addressUpdated"));
|
|
25643
25656
|
return onMembershipAdressUpdateSuccess(res);
|
|
25644
25657
|
});
|
|
25645
25658
|
}
|
|
@@ -27633,7 +27646,7 @@ const SubscriptionsItems = ({
|
|
|
27633
27646
|
}
|
|
27634
27647
|
|
|
27635
27648
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
27636
|
-
notify.confirm((onSuccess, onFailure) => {
|
|
27649
|
+
notify$1.confirm((onSuccess, onFailure) => {
|
|
27637
27650
|
cancelSubscription(sub.id, onSuccess, onFailure);
|
|
27638
27651
|
}, {
|
|
27639
27652
|
confirmMessage: t("messages.subCancellation.isSureToCancel"),
|
|
@@ -27691,7 +27704,7 @@ const SubscriptionsItems = ({
|
|
|
27691
27704
|
}
|
|
27692
27705
|
|
|
27693
27706
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
27694
|
-
notify.confirm((onSuccess, onFailure) => {
|
|
27707
|
+
notify$1.confirm((onSuccess, onFailure) => {
|
|
27695
27708
|
unSuspendSubscription(sub.id, onSuccess, onFailure);
|
|
27696
27709
|
}, {
|
|
27697
27710
|
confirmMessage: t("messages.subUnSuspend.isSureToUnSuspend"),
|
|
@@ -28137,11 +28150,56 @@ function SvgQrcode(props) {
|
|
|
28137
28150
|
})));
|
|
28138
28151
|
}
|
|
28139
28152
|
|
|
28140
|
-
const DonationsMenu = (
|
|
28153
|
+
const DonationsMenu = ({
|
|
28154
|
+
reactivateSubscription,
|
|
28155
|
+
disableSubmit,
|
|
28156
|
+
cancelSubscription
|
|
28157
|
+
}) => {
|
|
28141
28158
|
const {
|
|
28142
28159
|
t
|
|
28143
28160
|
} = useTranslation("dashboard");
|
|
28161
|
+
const {
|
|
28162
|
+
switchView,
|
|
28163
|
+
setSubscriptionToCancel
|
|
28164
|
+
} = usePelcro$1();
|
|
28144
28165
|
const subscriptions = getDonationSubs().sort((a, b) => a.expires_at - b.expires_at).sort((a, b) => a.renews_at - b.renews_at).map(sub => {
|
|
28166
|
+
// Cancel button click handlers
|
|
28167
|
+
const onCancelClick = () => {
|
|
28168
|
+
var _onClose;
|
|
28169
|
+
|
|
28170
|
+
const isImmediateCancelationEnabled = window.Pelcro.site.read().cancel_settings.status;
|
|
28171
|
+
|
|
28172
|
+
if (isImmediateCancelationEnabled) {
|
|
28173
|
+
setSubscriptionToCancel(sub.id);
|
|
28174
|
+
return switchView("subscription-cancel");
|
|
28175
|
+
}
|
|
28176
|
+
|
|
28177
|
+
if (userMustVerifyEmail()) {
|
|
28178
|
+
return switchView("email-verify");
|
|
28179
|
+
}
|
|
28180
|
+
|
|
28181
|
+
(_onClose = onClose) === null || _onClose === void 0 ? void 0 : _onClose();
|
|
28182
|
+
notify.confirm((onSuccess, onFailure) => {
|
|
28183
|
+
cancelSubscription(sub.id, onSuccess, onFailure);
|
|
28184
|
+
}, {
|
|
28185
|
+
confirmMessage: t("messages.subCancellation.isSureToCancel"),
|
|
28186
|
+
loadingMessage: t("messages.subCancellation.loading"),
|
|
28187
|
+
successMessage: t("messages.subCancellation.success"),
|
|
28188
|
+
errorMessage: t("messages.subCancellation.error")
|
|
28189
|
+
}, {
|
|
28190
|
+
closeButtonLabel: t("labels.subCancellation.goBack")
|
|
28191
|
+
});
|
|
28192
|
+
}; // Reactivate button click handlers
|
|
28193
|
+
|
|
28194
|
+
|
|
28195
|
+
const onReactivateClick = () => {
|
|
28196
|
+
if (userMustVerifyEmail()) {
|
|
28197
|
+
return switchView("email-verify");
|
|
28198
|
+
}
|
|
28199
|
+
|
|
28200
|
+
reactivateSubscription(sub.id);
|
|
28201
|
+
};
|
|
28202
|
+
|
|
28145
28203
|
return /*#__PURE__*/React__default['default'].createElement("tr", {
|
|
28146
28204
|
key: sub.id,
|
|
28147
28205
|
className: "plc-w-full plc-align-top pelcro-donation-row"
|
|
@@ -28153,7 +28211,21 @@ const DonationsMenu = () => {
|
|
|
28153
28211
|
className: "plc-text-xs plc-text-gray-400 pelcro-donation-price"
|
|
28154
28212
|
}, getFormattedPriceByLocal(sub.plan.amount * sub.quantity, sub.plan.currency, getPageOrDefaultLanguage())))), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28155
28213
|
className: "plc-mb-4 plc-text-gray-500 pelcro-donation-date"
|
|
28156
|
-
}, sub.status && /*#__PURE__*/React__default['default'].createElement("span", null, formatStartDate(sub.start))))
|
|
28214
|
+
}, sub.status && /*#__PURE__*/React__default['default'].createElement("span", null, formatStartDate(sub.start)))), /*#__PURE__*/React__default['default'].createElement("td", null, sub.cancel_at_period_end === 1 && sub.plan.auto_renew && !sub.is_gift_recipient && /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
28215
|
+
variant: "ghost",
|
|
28216
|
+
className: "plc-text-green-400 focus:plc-ring-green-300 pelcro-dashboard-sub-reactivate-button",
|
|
28217
|
+
icon: /*#__PURE__*/React__default['default'].createElement(SvgRefresh, null),
|
|
28218
|
+
onClick: onReactivateClick,
|
|
28219
|
+
disabled: disableSubmit,
|
|
28220
|
+
"data-key": sub.id
|
|
28221
|
+
}, t("labels.reactivate")), !sub.plan.auto_renew || sub.plan.auto_renew && sub.cancel_at_period_end === 0 ? /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
28222
|
+
variant: "ghost",
|
|
28223
|
+
className: "plc-text-red-500 focus:plc-ring-red-500 pelcro-dashboard-sub-cancel-button",
|
|
28224
|
+
icon: /*#__PURE__*/React__default['default'].createElement(SvgXIconSolid, null),
|
|
28225
|
+
onClick: onCancelClick,
|
|
28226
|
+
disabled: disableSubmit,
|
|
28227
|
+
"data-key": sub.id
|
|
28228
|
+
}, t("labels.unsubscribe")) : ""));
|
|
28157
28229
|
});
|
|
28158
28230
|
return /*#__PURE__*/React__default['default'].createElement("table", {
|
|
28159
28231
|
className: "plc-w-full plc-table-fixed pelcro-donations-table"
|
|
@@ -28163,7 +28235,9 @@ const DonationsMenu = () => {
|
|
|
28163
28235
|
className: "plc-w-6/12 "
|
|
28164
28236
|
}, t("labels.plan")), /*#__PURE__*/React__default['default'].createElement("th", {
|
|
28165
28237
|
className: "plc-w-6/12 "
|
|
28166
|
-
}, t("labels.startDate"))
|
|
28238
|
+
}, t("labels.startDate")), /*#__PURE__*/React__default['default'].createElement("th", {
|
|
28239
|
+
className: "plc-w-3/12 "
|
|
28240
|
+
}, t("labels.actions")))), /*#__PURE__*/React__default['default'].createElement("tbody", null, /*#__PURE__*/React__default['default'].createElement("tr", {
|
|
28167
28241
|
className: "plc-h-4"
|
|
28168
28242
|
}), subscriptions));
|
|
28169
28243
|
};
|
|
@@ -28996,7 +29070,11 @@ class Dashboard extends React.Component {
|
|
|
28996
29070
|
className: "plc-transform plc-scale-120 plc-w-7 plc-h-8 plc-mr-1 plc-pt-1"
|
|
28997
29071
|
}),
|
|
28998
29072
|
title: this.locale("labels.donations"),
|
|
28999
|
-
content: /*#__PURE__*/React__default['default'].createElement(DonationsMenu,
|
|
29073
|
+
content: /*#__PURE__*/React__default['default'].createElement(DonationsMenu, {
|
|
29074
|
+
reactivateSubscription: this.reactivateSubscription,
|
|
29075
|
+
disableSubmit: this.state.disableSubmit,
|
|
29076
|
+
cancelSubscription: this.cancelSubscription
|
|
29077
|
+
})
|
|
29000
29078
|
}), /*#__PURE__*/React__default['default'].createElement(Accordion.item, {
|
|
29001
29079
|
name: SUB_MENUS.GIFTS,
|
|
29002
29080
|
icon: /*#__PURE__*/React__default['default'].createElement(SvgGift, null),
|
|
@@ -31057,7 +31135,7 @@ const EmailVerifyModal = ({
|
|
|
31057
31135
|
|
|
31058
31136
|
(_props$onSuccess = (_props = props).onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(_props, res);
|
|
31059
31137
|
|
|
31060
|
-
if (product
|
|
31138
|
+
if (product) {
|
|
31061
31139
|
if (product.address_required) {
|
|
31062
31140
|
return switchToAddressView();
|
|
31063
31141
|
} else {
|
|
@@ -31227,7 +31305,7 @@ function VerifyLinkTokenModal({
|
|
|
31227
31305
|
|
|
31228
31306
|
(_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
|
|
31229
31307
|
resetView();
|
|
31230
|
-
notify.success(t("messages.success"));
|
|
31308
|
+
notify$1.success(t("messages.success"));
|
|
31231
31309
|
};
|
|
31232
31310
|
|
|
31233
31311
|
return /*#__PURE__*/React__default['default'].createElement(Modal, {
|
|
@@ -33121,6 +33199,6 @@ exports.i18n = i18next;
|
|
|
33121
33199
|
exports.initButtons = init$1;
|
|
33122
33200
|
exports.initContentEntitlement = init;
|
|
33123
33201
|
exports.invoicePaymentSubmitButton = invoicePaymentSubmitButton;
|
|
33124
|
-
exports.notify = notify;
|
|
33202
|
+
exports.notify = notify$1;
|
|
33125
33203
|
exports.unauthenticatedButtons = unauthenticatedButtons;
|
|
33126
33204
|
exports.usePelcro = usePelcro$1;
|
package/dist/index.esm.js
CHANGED
|
@@ -3605,6 +3605,7 @@ var labels$Y = {
|
|
|
3605
3605
|
firstName: "First name",
|
|
3606
3606
|
lastName: "Last name",
|
|
3607
3607
|
username: "Username",
|
|
3608
|
+
displayname: "Display name",
|
|
3608
3609
|
phone: "Phone",
|
|
3609
3610
|
submit: "Submit",
|
|
3610
3611
|
required: "Required",
|
|
@@ -4539,6 +4540,7 @@ var labels$D = {
|
|
|
4539
4540
|
firstName: "Prénom",
|
|
4540
4541
|
lastName: "Nom de famille",
|
|
4541
4542
|
username: "Nom d'utilisateur",
|
|
4543
|
+
displayname: "Afficher un nom",
|
|
4542
4544
|
phone: "Numéro de téléphone",
|
|
4543
4545
|
submit: "Soumettre",
|
|
4544
4546
|
required: "Champs obligatoires",
|
|
@@ -5357,6 +5359,7 @@ var labels$o = {
|
|
|
5357
5359
|
firstName: "이름",
|
|
5358
5360
|
lastName: "성",
|
|
5359
5361
|
username: "사용자 이름",
|
|
5362
|
+
displayname: "이름 표시하기",
|
|
5360
5363
|
phone: "전화번호",
|
|
5361
5364
|
submit: "제출",
|
|
5362
5365
|
required: "필수 항목",
|
|
@@ -6277,6 +6280,7 @@ var labels$9 = {
|
|
|
6277
6280
|
firstName: "Nombre",
|
|
6278
6281
|
lastName: "Apellido",
|
|
6279
6282
|
username: "Nombre de usuario",
|
|
6283
|
+
displayname: "Nombre para mostrar",
|
|
6280
6284
|
phone: "Teléfono",
|
|
6281
6285
|
submit: "Enviar",
|
|
6282
6286
|
required: "Obligatorio",
|
|
@@ -10307,7 +10311,7 @@ toast.confirm = (onConfirm, {
|
|
|
10307
10311
|
...options
|
|
10308
10312
|
});
|
|
10309
10313
|
setTimeout(() => {
|
|
10310
|
-
notify.dismiss(id);
|
|
10314
|
+
notify$1.dismiss(id);
|
|
10311
10315
|
}, 3000);
|
|
10312
10316
|
};
|
|
10313
10317
|
|
|
@@ -10317,12 +10321,12 @@ toast.confirm = (onConfirm, {
|
|
|
10317
10321
|
...options
|
|
10318
10322
|
});
|
|
10319
10323
|
setTimeout(() => {
|
|
10320
|
-
notify.dismiss(id);
|
|
10324
|
+
notify$1.dismiss(id);
|
|
10321
10325
|
}, 3000);
|
|
10322
10326
|
};
|
|
10323
10327
|
};
|
|
10324
10328
|
|
|
10325
|
-
const notify = toast;
|
|
10329
|
+
const notify$1 = toast;
|
|
10326
10330
|
|
|
10327
10331
|
const translations = i18next.t("common:buttons", {
|
|
10328
10332
|
returnObjects: true
|
|
@@ -10393,7 +10397,7 @@ const init$1 = () => {
|
|
|
10393
10397
|
const errorMessage = i18next.t("messages:invalidSubscription", {
|
|
10394
10398
|
returnObjects: true
|
|
10395
10399
|
});
|
|
10396
|
-
return notify.error(errorMessage);
|
|
10400
|
+
return notify$1.error(errorMessage);
|
|
10397
10401
|
}
|
|
10398
10402
|
|
|
10399
10403
|
switchView("manage-members");
|
|
@@ -10402,7 +10406,7 @@ const init$1 = () => {
|
|
|
10402
10406
|
const errorMessage = i18next.t("messages:invalidSubscription", {
|
|
10403
10407
|
returnObjects: true
|
|
10404
10408
|
});
|
|
10405
|
-
return notify.error(errorMessage);
|
|
10409
|
+
return notify$1.error(errorMessage);
|
|
10406
10410
|
}
|
|
10407
10411
|
}
|
|
10408
10412
|
}
|
|
@@ -10572,7 +10576,7 @@ const init$1 = () => {
|
|
|
10572
10576
|
const errorMsg = i18next.t("shop:messages.currencyMismatch", {
|
|
10573
10577
|
currency: userCurrency
|
|
10574
10578
|
});
|
|
10575
|
-
notify.error(errorMsg);
|
|
10579
|
+
notify$1.error(errorMsg);
|
|
10576
10580
|
}
|
|
10577
10581
|
});
|
|
10578
10582
|
}
|
|
@@ -10674,7 +10678,7 @@ const init = () => {
|
|
|
10674
10678
|
elemDeepClone.setAttribute("style", "filter:blur(3px) !important; pointer-events:none !important; user-select:none !important");
|
|
10675
10679
|
unblurElemWhenUserSubscribes(elemDeepClone, entitlements);
|
|
10676
10680
|
const NOTIFICATION_ID = "entitlement";
|
|
10677
|
-
notify( /*#__PURE__*/React__default.createElement("p", null, /*#__PURE__*/React__default.createElement(Trans, {
|
|
10681
|
+
notify$1( /*#__PURE__*/React__default.createElement("p", null, /*#__PURE__*/React__default.createElement(Trans, {
|
|
10678
10682
|
i18nKey: "messages:entitlement"
|
|
10679
10683
|
}, "Some of the content on this page is available with one or more of our plans.", /*#__PURE__*/React__default.createElement(Link, {
|
|
10680
10684
|
onClick: () => {
|
|
@@ -10691,7 +10695,7 @@ const init = () => {
|
|
|
10691
10695
|
});
|
|
10692
10696
|
}
|
|
10693
10697
|
|
|
10694
|
-
notify.dismiss(NOTIFICATION_ID);
|
|
10698
|
+
notify$1.dismiss(NOTIFICATION_ID);
|
|
10695
10699
|
switchView("_plan-select-entitlements");
|
|
10696
10700
|
}
|
|
10697
10701
|
}, "Subscribe"), "now to get full page access.")), {
|
|
@@ -11451,10 +11455,10 @@ const verifyEmailTokenFromUrl = () => {
|
|
|
11451
11455
|
token: emailToken
|
|
11452
11456
|
}, (err, res) => {
|
|
11453
11457
|
if (err) {
|
|
11454
|
-
return notify.error(getErrorMessages(err));
|
|
11458
|
+
return notify$1.error(getErrorMessages(err));
|
|
11455
11459
|
}
|
|
11456
11460
|
|
|
11457
|
-
return notify.success(translations.success);
|
|
11461
|
+
return notify$1.success(translations.success);
|
|
11458
11462
|
});
|
|
11459
11463
|
}, {
|
|
11460
11464
|
once: true
|
|
@@ -11480,7 +11484,7 @@ const verifyLinkTokenFromUrl = () => {
|
|
|
11480
11484
|
token: loginToken
|
|
11481
11485
|
}, (err, res) => {
|
|
11482
11486
|
if (err) {
|
|
11483
|
-
return notify.error(getErrorMessages(err));
|
|
11487
|
+
return notify$1.error(getErrorMessages(err));
|
|
11484
11488
|
}
|
|
11485
11489
|
|
|
11486
11490
|
const {
|
|
@@ -11490,11 +11494,11 @@ const verifyLinkTokenFromUrl = () => {
|
|
|
11490
11494
|
auth_token
|
|
11491
11495
|
}, (err, res) => {
|
|
11492
11496
|
if (err) {
|
|
11493
|
-
return notify.error(getErrorMessages(err));
|
|
11497
|
+
return notify$1.error(getErrorMessages(err));
|
|
11494
11498
|
}
|
|
11495
11499
|
|
|
11496
11500
|
resetView();
|
|
11497
|
-
return notify.success(translations.success);
|
|
11501
|
+
return notify$1.success(translations.success);
|
|
11498
11502
|
});
|
|
11499
11503
|
});
|
|
11500
11504
|
}, {
|
|
@@ -11537,7 +11541,7 @@ const showInvoiceDetailsFromUrl = () => {
|
|
|
11537
11541
|
const errorMessage = i18next.t("messages:invalidInvoice", {
|
|
11538
11542
|
returnObjects: true
|
|
11539
11543
|
});
|
|
11540
|
-
return notify.error(errorMessage);
|
|
11544
|
+
return notify$1.error(errorMessage);
|
|
11541
11545
|
}
|
|
11542
11546
|
|
|
11543
11547
|
const {
|
|
@@ -11548,7 +11552,7 @@ const showInvoiceDetailsFromUrl = () => {
|
|
|
11548
11552
|
const errorMessage = i18next.t("messages:zeroTotalInvoice", {
|
|
11549
11553
|
returnObjects: true
|
|
11550
11554
|
});
|
|
11551
|
-
return notify.error(errorMessage);
|
|
11555
|
+
return notify$1.error(errorMessage);
|
|
11552
11556
|
}
|
|
11553
11557
|
|
|
11554
11558
|
return switchView("invoice-details");
|
|
@@ -11577,7 +11581,7 @@ const showSubscriptionManageMembersFromUrl = () => {
|
|
|
11577
11581
|
const errorMessage = i18next.t("messages:invalidSubscription", {
|
|
11578
11582
|
returnObjects: true
|
|
11579
11583
|
});
|
|
11580
|
-
return notify.error(errorMessage);
|
|
11584
|
+
return notify$1.error(errorMessage);
|
|
11581
11585
|
}
|
|
11582
11586
|
|
|
11583
11587
|
return switchView("manage-members");
|
|
@@ -13438,7 +13442,7 @@ function LoginModal({
|
|
|
13438
13442
|
switchView,
|
|
13439
13443
|
resetView,
|
|
13440
13444
|
product,
|
|
13441
|
-
|
|
13445
|
+
order,
|
|
13442
13446
|
switchToAddressView,
|
|
13443
13447
|
switchToPaymentView
|
|
13444
13448
|
} = usePelcro$1();
|
|
@@ -13452,7 +13456,7 @@ function LoginModal({
|
|
|
13452
13456
|
initPaywalls();
|
|
13453
13457
|
}
|
|
13454
13458
|
|
|
13455
|
-
if (product
|
|
13459
|
+
if (product) {
|
|
13456
13460
|
if (product.address_required) {
|
|
13457
13461
|
return switchToAddressView();
|
|
13458
13462
|
} else {
|
|
@@ -13460,6 +13464,10 @@ function LoginModal({
|
|
|
13460
13464
|
}
|
|
13461
13465
|
}
|
|
13462
13466
|
|
|
13467
|
+
if (order) {
|
|
13468
|
+
return switchToAddressView();
|
|
13469
|
+
}
|
|
13470
|
+
|
|
13463
13471
|
resetView();
|
|
13464
13472
|
const viewFromURL = getStableViewID(window.Pelcro.helpers.getURLParameter("view"));
|
|
13465
13473
|
const viewsURLs = ["invoice-details", "gift-redeem", "plan-select"];
|
|
@@ -19564,7 +19572,7 @@ const SubscriptionCancelNowButton = ({
|
|
|
19564
19572
|
|
|
19565
19573
|
switchView(null); //Show confirmation alert after closing the modal
|
|
19566
19574
|
|
|
19567
|
-
notify.confirm((onSuccess, onFailure) => {
|
|
19575
|
+
notify$1.confirm((onSuccess, onFailure) => {
|
|
19568
19576
|
cancelSubscription(payload, onSuccess, onFailure);
|
|
19569
19577
|
}, {
|
|
19570
19578
|
confirmMessage: t("messages.subCancellation.isSureToCancelNow"),
|
|
@@ -19636,7 +19644,7 @@ const SubscriptionCancelLaterButton = ({
|
|
|
19636
19644
|
|
|
19637
19645
|
switchView(null); //Show confirmation alert after closing the modal
|
|
19638
19646
|
|
|
19639
|
-
notify.confirm((onSuccess, onFailure) => {
|
|
19647
|
+
notify$1.confirm((onSuccess, onFailure) => {
|
|
19640
19648
|
cancelSubscription(payload, onSuccess, onFailure);
|
|
19641
19649
|
}, {
|
|
19642
19650
|
confirmMessage: t("messages.subCancellation.isSureToCancel"),
|
|
@@ -19873,7 +19881,7 @@ const SubscriptionSuspendButton = ({
|
|
|
19873
19881
|
|
|
19874
19882
|
switchView(null); //Show confirmation alert after closing the modal
|
|
19875
19883
|
|
|
19876
|
-
notify.confirm((onSuccess, onFailure) => {
|
|
19884
|
+
notify$1.confirm((onSuccess, onFailure) => {
|
|
19877
19885
|
suspendSubscription(payload, onSuccess, onFailure);
|
|
19878
19886
|
}, {
|
|
19879
19887
|
confirmMessage: t("messages.subCancellation.isSureToSuspendNow"),
|
|
@@ -21720,6 +21728,37 @@ const UserUpdateTin = props => /*#__PURE__*/React__default.createElement(Tin, Ob
|
|
|
21720
21728
|
store: store$f
|
|
21721
21729
|
}, props));
|
|
21722
21730
|
|
|
21731
|
+
function DisplayName({
|
|
21732
|
+
store,
|
|
21733
|
+
...otherProps
|
|
21734
|
+
}) {
|
|
21735
|
+
const {
|
|
21736
|
+
dispatch,
|
|
21737
|
+
state
|
|
21738
|
+
} = useContext(store);
|
|
21739
|
+
|
|
21740
|
+
const handleInputChange = value => {
|
|
21741
|
+
dispatch({
|
|
21742
|
+
type: SET_DISPLAY_NAME,
|
|
21743
|
+
payload: value
|
|
21744
|
+
});
|
|
21745
|
+
};
|
|
21746
|
+
|
|
21747
|
+
if (state.loading) {
|
|
21748
|
+
return /*#__PURE__*/React__default.createElement(Loader, null);
|
|
21749
|
+
}
|
|
21750
|
+
|
|
21751
|
+
return /*#__PURE__*/React__default.createElement(Input, Object.assign({
|
|
21752
|
+
type: "text",
|
|
21753
|
+
value: state.displayName || null,
|
|
21754
|
+
onChange: e => handleInputChange(e.target.value)
|
|
21755
|
+
}, otherProps));
|
|
21756
|
+
}
|
|
21757
|
+
|
|
21758
|
+
const UserUpdateDisplayName = props => /*#__PURE__*/React__default.createElement(DisplayName, Object.assign({
|
|
21759
|
+
store: store$f
|
|
21760
|
+
}, props));
|
|
21761
|
+
|
|
21723
21762
|
const UserUpdateView = props => {
|
|
21724
21763
|
var _window$Pelcro$site$r, _window$Pelcro, _window$Pelcro$uiSett;
|
|
21725
21764
|
|
|
@@ -21755,7 +21794,12 @@ const UserUpdateView = props => {
|
|
|
21755
21794
|
errorId: "pelcro-input-last-name-error",
|
|
21756
21795
|
label: t("labels.lastName"),
|
|
21757
21796
|
required: supportsTap ? true : false
|
|
21758
|
-
})),
|
|
21797
|
+
})), /*#__PURE__*/React__default.createElement(UserUpdateDisplayName, {
|
|
21798
|
+
id: "pelcro-input-display-name",
|
|
21799
|
+
autoComplete: "display-name",
|
|
21800
|
+
errorId: "pelcro-input-display-name-error",
|
|
21801
|
+
label: t("labels.displayname")
|
|
21802
|
+
}), showUsernameInput && /*#__PURE__*/React__default.createElement(UserUpdateUsername, {
|
|
21759
21803
|
id: "pelcro-input-user-name",
|
|
21760
21804
|
autoComplete: "user-name",
|
|
21761
21805
|
errorId: "pelcro-input-user-name-error",
|
|
@@ -21807,37 +21851,6 @@ function UserUpdateModal({
|
|
|
21807
21851
|
}
|
|
21808
21852
|
UserUpdateModal.viewId = "user-edit";
|
|
21809
21853
|
|
|
21810
|
-
function DisplayName({
|
|
21811
|
-
store,
|
|
21812
|
-
...otherProps
|
|
21813
|
-
}) {
|
|
21814
|
-
const {
|
|
21815
|
-
dispatch,
|
|
21816
|
-
state
|
|
21817
|
-
} = useContext(store);
|
|
21818
|
-
|
|
21819
|
-
const handleInputChange = value => {
|
|
21820
|
-
dispatch({
|
|
21821
|
-
type: SET_DISPLAY_NAME,
|
|
21822
|
-
payload: value
|
|
21823
|
-
});
|
|
21824
|
-
};
|
|
21825
|
-
|
|
21826
|
-
if (state.loading) {
|
|
21827
|
-
return /*#__PURE__*/React__default.createElement(Loader, null);
|
|
21828
|
-
}
|
|
21829
|
-
|
|
21830
|
-
return /*#__PURE__*/React__default.createElement(Input, Object.assign({
|
|
21831
|
-
type: "text",
|
|
21832
|
-
value: state.displayName || null,
|
|
21833
|
-
onChange: e => handleInputChange(e.target.value)
|
|
21834
|
-
}, otherProps));
|
|
21835
|
-
}
|
|
21836
|
-
|
|
21837
|
-
const UserUpdateDisplayName = props => /*#__PURE__*/React__default.createElement(DisplayName, Object.assign({
|
|
21838
|
-
store: store$f
|
|
21839
|
-
}, props));
|
|
21840
|
-
|
|
21841
21854
|
const UserUpdateTextInput = props => {
|
|
21842
21855
|
return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
|
|
21843
21856
|
store: store$f
|
|
@@ -22005,7 +22018,7 @@ const AddressCreateContainer = ({
|
|
|
22005
22018
|
return onFailure(err);
|
|
22006
22019
|
}
|
|
22007
22020
|
|
|
22008
|
-
notify.success(t("messages.addressUpdated"));
|
|
22021
|
+
notify$1.success(t("messages.addressUpdated"));
|
|
22009
22022
|
return onMembershipAdressUpdateSuccess(res);
|
|
22010
22023
|
});
|
|
22011
22024
|
}
|
|
@@ -24775,7 +24788,7 @@ const ShopView = () => {
|
|
|
24775
24788
|
className: "plc-mt-2"
|
|
24776
24789
|
}), /*#__PURE__*/React__default.createElement(ShopPurchaseButton, {
|
|
24777
24790
|
itemId: item.id,
|
|
24778
|
-
className: "plc-mt-2"
|
|
24791
|
+
className: "plc-mt-2 pelcro-purchase-button"
|
|
24779
24792
|
})));
|
|
24780
24793
|
})));
|
|
24781
24794
|
};
|
|
@@ -25609,7 +25622,7 @@ const AddressSelectContainer = ({
|
|
|
25609
25622
|
return onFailure(err);
|
|
25610
25623
|
}
|
|
25611
25624
|
|
|
25612
|
-
notify.success(t("messages.addressUpdated"));
|
|
25625
|
+
notify$1.success(t("messages.addressUpdated"));
|
|
25613
25626
|
return onMembershipAdressUpdateSuccess(res);
|
|
25614
25627
|
});
|
|
25615
25628
|
}
|
|
@@ -27603,7 +27616,7 @@ const SubscriptionsItems = ({
|
|
|
27603
27616
|
}
|
|
27604
27617
|
|
|
27605
27618
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
27606
|
-
notify.confirm((onSuccess, onFailure) => {
|
|
27619
|
+
notify$1.confirm((onSuccess, onFailure) => {
|
|
27607
27620
|
cancelSubscription(sub.id, onSuccess, onFailure);
|
|
27608
27621
|
}, {
|
|
27609
27622
|
confirmMessage: t("messages.subCancellation.isSureToCancel"),
|
|
@@ -27661,7 +27674,7 @@ const SubscriptionsItems = ({
|
|
|
27661
27674
|
}
|
|
27662
27675
|
|
|
27663
27676
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
27664
|
-
notify.confirm((onSuccess, onFailure) => {
|
|
27677
|
+
notify$1.confirm((onSuccess, onFailure) => {
|
|
27665
27678
|
unSuspendSubscription(sub.id, onSuccess, onFailure);
|
|
27666
27679
|
}, {
|
|
27667
27680
|
confirmMessage: t("messages.subUnSuspend.isSureToUnSuspend"),
|
|
@@ -28107,11 +28120,56 @@ function SvgQrcode(props) {
|
|
|
28107
28120
|
})));
|
|
28108
28121
|
}
|
|
28109
28122
|
|
|
28110
|
-
const DonationsMenu = (
|
|
28123
|
+
const DonationsMenu = ({
|
|
28124
|
+
reactivateSubscription,
|
|
28125
|
+
disableSubmit,
|
|
28126
|
+
cancelSubscription
|
|
28127
|
+
}) => {
|
|
28111
28128
|
const {
|
|
28112
28129
|
t
|
|
28113
28130
|
} = useTranslation("dashboard");
|
|
28131
|
+
const {
|
|
28132
|
+
switchView,
|
|
28133
|
+
setSubscriptionToCancel
|
|
28134
|
+
} = usePelcro$1();
|
|
28114
28135
|
const subscriptions = getDonationSubs().sort((a, b) => a.expires_at - b.expires_at).sort((a, b) => a.renews_at - b.renews_at).map(sub => {
|
|
28136
|
+
// Cancel button click handlers
|
|
28137
|
+
const onCancelClick = () => {
|
|
28138
|
+
var _onClose;
|
|
28139
|
+
|
|
28140
|
+
const isImmediateCancelationEnabled = window.Pelcro.site.read().cancel_settings.status;
|
|
28141
|
+
|
|
28142
|
+
if (isImmediateCancelationEnabled) {
|
|
28143
|
+
setSubscriptionToCancel(sub.id);
|
|
28144
|
+
return switchView("subscription-cancel");
|
|
28145
|
+
}
|
|
28146
|
+
|
|
28147
|
+
if (userMustVerifyEmail()) {
|
|
28148
|
+
return switchView("email-verify");
|
|
28149
|
+
}
|
|
28150
|
+
|
|
28151
|
+
(_onClose = onClose) === null || _onClose === void 0 ? void 0 : _onClose();
|
|
28152
|
+
notify.confirm((onSuccess, onFailure) => {
|
|
28153
|
+
cancelSubscription(sub.id, onSuccess, onFailure);
|
|
28154
|
+
}, {
|
|
28155
|
+
confirmMessage: t("messages.subCancellation.isSureToCancel"),
|
|
28156
|
+
loadingMessage: t("messages.subCancellation.loading"),
|
|
28157
|
+
successMessage: t("messages.subCancellation.success"),
|
|
28158
|
+
errorMessage: t("messages.subCancellation.error")
|
|
28159
|
+
}, {
|
|
28160
|
+
closeButtonLabel: t("labels.subCancellation.goBack")
|
|
28161
|
+
});
|
|
28162
|
+
}; // Reactivate button click handlers
|
|
28163
|
+
|
|
28164
|
+
|
|
28165
|
+
const onReactivateClick = () => {
|
|
28166
|
+
if (userMustVerifyEmail()) {
|
|
28167
|
+
return switchView("email-verify");
|
|
28168
|
+
}
|
|
28169
|
+
|
|
28170
|
+
reactivateSubscription(sub.id);
|
|
28171
|
+
};
|
|
28172
|
+
|
|
28115
28173
|
return /*#__PURE__*/React__default.createElement("tr", {
|
|
28116
28174
|
key: sub.id,
|
|
28117
28175
|
className: "plc-w-full plc-align-top pelcro-donation-row"
|
|
@@ -28123,7 +28181,21 @@ const DonationsMenu = () => {
|
|
|
28123
28181
|
className: "plc-text-xs plc-text-gray-400 pelcro-donation-price"
|
|
28124
28182
|
}, getFormattedPriceByLocal(sub.plan.amount * sub.quantity, sub.plan.currency, getPageOrDefaultLanguage())))), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement("div", {
|
|
28125
28183
|
className: "plc-mb-4 plc-text-gray-500 pelcro-donation-date"
|
|
28126
|
-
}, sub.status && /*#__PURE__*/React__default.createElement("span", null, formatStartDate(sub.start))))
|
|
28184
|
+
}, sub.status && /*#__PURE__*/React__default.createElement("span", null, formatStartDate(sub.start)))), /*#__PURE__*/React__default.createElement("td", null, sub.cancel_at_period_end === 1 && sub.plan.auto_renew && !sub.is_gift_recipient && /*#__PURE__*/React__default.createElement(Button, {
|
|
28185
|
+
variant: "ghost",
|
|
28186
|
+
className: "plc-text-green-400 focus:plc-ring-green-300 pelcro-dashboard-sub-reactivate-button",
|
|
28187
|
+
icon: /*#__PURE__*/React__default.createElement(SvgRefresh, null),
|
|
28188
|
+
onClick: onReactivateClick,
|
|
28189
|
+
disabled: disableSubmit,
|
|
28190
|
+
"data-key": sub.id
|
|
28191
|
+
}, t("labels.reactivate")), !sub.plan.auto_renew || sub.plan.auto_renew && sub.cancel_at_period_end === 0 ? /*#__PURE__*/React__default.createElement(Button, {
|
|
28192
|
+
variant: "ghost",
|
|
28193
|
+
className: "plc-text-red-500 focus:plc-ring-red-500 pelcro-dashboard-sub-cancel-button",
|
|
28194
|
+
icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
|
|
28195
|
+
onClick: onCancelClick,
|
|
28196
|
+
disabled: disableSubmit,
|
|
28197
|
+
"data-key": sub.id
|
|
28198
|
+
}, t("labels.unsubscribe")) : ""));
|
|
28127
28199
|
});
|
|
28128
28200
|
return /*#__PURE__*/React__default.createElement("table", {
|
|
28129
28201
|
className: "plc-w-full plc-table-fixed pelcro-donations-table"
|
|
@@ -28133,7 +28205,9 @@ const DonationsMenu = () => {
|
|
|
28133
28205
|
className: "plc-w-6/12 "
|
|
28134
28206
|
}, t("labels.plan")), /*#__PURE__*/React__default.createElement("th", {
|
|
28135
28207
|
className: "plc-w-6/12 "
|
|
28136
|
-
}, t("labels.startDate"))
|
|
28208
|
+
}, t("labels.startDate")), /*#__PURE__*/React__default.createElement("th", {
|
|
28209
|
+
className: "plc-w-3/12 "
|
|
28210
|
+
}, t("labels.actions")))), /*#__PURE__*/React__default.createElement("tbody", null, /*#__PURE__*/React__default.createElement("tr", {
|
|
28137
28211
|
className: "plc-h-4"
|
|
28138
28212
|
}), subscriptions));
|
|
28139
28213
|
};
|
|
@@ -28966,7 +29040,11 @@ class Dashboard extends Component {
|
|
|
28966
29040
|
className: "plc-transform plc-scale-120 plc-w-7 plc-h-8 plc-mr-1 plc-pt-1"
|
|
28967
29041
|
}),
|
|
28968
29042
|
title: this.locale("labels.donations"),
|
|
28969
|
-
content: /*#__PURE__*/React__default.createElement(DonationsMenu,
|
|
29043
|
+
content: /*#__PURE__*/React__default.createElement(DonationsMenu, {
|
|
29044
|
+
reactivateSubscription: this.reactivateSubscription,
|
|
29045
|
+
disableSubmit: this.state.disableSubmit,
|
|
29046
|
+
cancelSubscription: this.cancelSubscription
|
|
29047
|
+
})
|
|
28970
29048
|
}), /*#__PURE__*/React__default.createElement(Accordion.item, {
|
|
28971
29049
|
name: SUB_MENUS.GIFTS,
|
|
28972
29050
|
icon: /*#__PURE__*/React__default.createElement(SvgGift, null),
|
|
@@ -31027,7 +31105,7 @@ const EmailVerifyModal = ({
|
|
|
31027
31105
|
|
|
31028
31106
|
(_props$onSuccess = (_props = props).onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(_props, res);
|
|
31029
31107
|
|
|
31030
|
-
if (product
|
|
31108
|
+
if (product) {
|
|
31031
31109
|
if (product.address_required) {
|
|
31032
31110
|
return switchToAddressView();
|
|
31033
31111
|
} else {
|
|
@@ -31197,7 +31275,7 @@ function VerifyLinkTokenModal({
|
|
|
31197
31275
|
|
|
31198
31276
|
(_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
|
|
31199
31277
|
resetView();
|
|
31200
|
-
notify.success(t("messages.success"));
|
|
31278
|
+
notify$1.success(t("messages.success"));
|
|
31201
31279
|
};
|
|
31202
31280
|
|
|
31203
31281
|
return /*#__PURE__*/React__default.createElement(Modal, {
|
|
@@ -32859,4 +32937,4 @@ const QrCodeModal = ({
|
|
|
32859
32937
|
};
|
|
32860
32938
|
QrCodeModal.viewId = "qrcode";
|
|
32861
32939
|
|
|
32862
|
-
export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateSetDefault, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateSetDefault, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Auth0LoginButton, Badge, BankAuthenticationSuccess, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, IncludeFirstName, IncludeLastName, IncludePhone, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginRequestLoginToken, LoginUsername, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PasswordlessRequestContainer, PasswordlessRequestEmail, PasswordlessRequestModal, PasswordlessRequestView, PasswordlessRequestViewButton, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, QrCodeModal, QrCodeView, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCancelModal, SubscriptionCreateContainer, SubscriptionCreateFreePlanButton, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionManageMembersButton, SubscriptionManageMembersContainer, SubscriptionManageMembersEmails, SubscriptionManageMembersList, SubscriptionManageMembersModal, SubscriptionManageMembersView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, SubscriptionSuspendContainer, SubscriptionSuspendModal, SubscriptionSuspendView, TaxAmount, TextArea, Tooltip, UserNameInput, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateTin, UserUpdateUsername, UserUpdateView, VerifyLinkTokenContainer, VerifyLinkTokenLoader, VerifyLinkTokenModal, VerifyLinkTokenView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify, unauthenticatedButtons, usePelcro$1 as usePelcro };
|
|
32940
|
+
export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateSetDefault, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateSetDefault, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Auth0LoginButton, Badge, BankAuthenticationSuccess, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, IncludeFirstName, IncludeLastName, IncludePhone, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginRequestLoginToken, LoginUsername, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PasswordlessRequestContainer, PasswordlessRequestEmail, PasswordlessRequestModal, PasswordlessRequestView, PasswordlessRequestViewButton, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, QrCodeModal, QrCodeView, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCancelModal, SubscriptionCreateContainer, SubscriptionCreateFreePlanButton, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionManageMembersButton, SubscriptionManageMembersContainer, SubscriptionManageMembersEmails, SubscriptionManageMembersList, SubscriptionManageMembersModal, SubscriptionManageMembersView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, SubscriptionSuspendContainer, SubscriptionSuspendModal, SubscriptionSuspendView, TaxAmount, TextArea, Tooltip, UserNameInput, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateTin, UserUpdateUsername, UserUpdateView, VerifyLinkTokenContainer, VerifyLinkTokenLoader, VerifyLinkTokenModal, VerifyLinkTokenView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify$1 as notify, unauthenticatedButtons, usePelcro$1 as usePelcro };
|