@pelcro/react-pelcro-js 4.0.0-alpha.26 → 4.0.0-alpha.27
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 +38 -8
- package/dist/index.esm.js +38 -8
- package/dist/pelcro.css +5 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -24851,8 +24851,15 @@ const PaymentSuccessView = ({
|
|
|
24851
24851
|
|
|
24852
24852
|
if (successTitle && successContent) {
|
|
24853
24853
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
24854
|
-
className: "plc-flex plc-flex-col plc-items-center"
|
|
24855
|
-
},
|
|
24854
|
+
className: "plc-flex plc-flex-col plc-items-center plc-relative"
|
|
24855
|
+
}, /*#__PURE__*/React__default['default'].createElement("button", {
|
|
24856
|
+
type: "button",
|
|
24857
|
+
className: "pelcro-modal-close plc-absolute plc-top-6 plc-right-0",
|
|
24858
|
+
"aria-label": "close modal",
|
|
24859
|
+
onClick: onClose
|
|
24860
|
+
}, /*#__PURE__*/React__default['default'].createElement(SvgXIcon, {
|
|
24861
|
+
className: "plc-fill-current"
|
|
24862
|
+
})), successIcon, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
24856
24863
|
className: "plc-text-center plc-text-gray-900"
|
|
24857
24864
|
}, /*#__PURE__*/React__default['default'].createElement("h4", {
|
|
24858
24865
|
className: "plc-mb-4 plc-text-3xl"
|
|
@@ -33475,7 +33482,9 @@ const AddressesMenu = props => {
|
|
|
33475
33482
|
const AddressesItems = props => {
|
|
33476
33483
|
var _window$Pelcro$user$r;
|
|
33477
33484
|
|
|
33478
|
-
|
|
33485
|
+
const {
|
|
33486
|
+
t
|
|
33487
|
+
} = useTranslation("dashboard");
|
|
33479
33488
|
const {
|
|
33480
33489
|
switchView
|
|
33481
33490
|
} = usePelcro();
|
|
@@ -33506,7 +33515,9 @@ const AddressesItems = props => {
|
|
|
33506
33515
|
return addresses.map((address, index) => address.type === "shipping" && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
33507
33516
|
key: address.id,
|
|
33508
33517
|
className: `plc-py-2 plc-px-4 plc-mt-5 plc-flex plc-items-center plc-justify-between last:plc-mb-0 plc-rounded plc-text-gray-900 pelcro-address-wrapper plc-bg-white plc-shadow-md_dark ${selectedAddressId === String(address.id) && `plc-border-primary-400 plc-border-2`}`
|
|
33509
|
-
}, /*#__PURE__*/React__default['default'].createElement("div",
|
|
33518
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
33519
|
+
className: "plc-flex-1 plc-relative"
|
|
33520
|
+
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
33510
33521
|
className: "pelcro-address-name plc-font-semibold"
|
|
33511
33522
|
}, address.first_name, " ", address.last_name), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
33512
33523
|
className: "pelcro-address-company"
|
|
@@ -33514,7 +33525,9 @@ const AddressesItems = props => {
|
|
|
33514
33525
|
className: "pelcro-address-line1 plc-text-sm plc-mt-2"
|
|
33515
33526
|
}, address.line1), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
33516
33527
|
className: "pelcro-address-country plc-text-sm"
|
|
33517
|
-
}, address.city, ", ", address.state_name, " ", address.postal_code, ", ", address.country_name)
|
|
33528
|
+
}, address.city, ", ", address.state_name, " ", address.postal_code, ", ", address.country_name), address.is_default && /*#__PURE__*/React__default['default'].createElement("span", {
|
|
33529
|
+
className: "plc-rounded-full plc-bg-gray-800 plc-text-white plc-inline-flex plc-items-start plc-py-1 plc-px-4 plc-text-sm plc-mt-4"
|
|
33530
|
+
}, t("labels.default"))), /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
33518
33531
|
variant: "icon",
|
|
33519
33532
|
className: "plc-text-gray-500",
|
|
33520
33533
|
icon: /*#__PURE__*/React__default['default'].createElement(SvgEdit, null),
|
|
@@ -35600,7 +35613,7 @@ class Dashboard extends React.Component {
|
|
|
35600
35613
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
35601
35614
|
className: "plc-flex plc-items-center"
|
|
35602
35615
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
35603
|
-
className: "plc-flex plc-justify-center plc-ml-3 sm:plc-ml-6 "
|
|
35616
|
+
className: "plc-flex plc-justify-center plc-ml-3 sm:plc-ml-6 plc-flex-shrink-0"
|
|
35604
35617
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
35605
35618
|
className: "plc-relative plc-flex-shrink-0"
|
|
35606
35619
|
}, /*#__PURE__*/React__default['default'].createElement("img", {
|
|
@@ -35611,9 +35624,9 @@ class Dashboard extends React.Component {
|
|
|
35611
35624
|
}))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
35612
35625
|
className: "plc-flex plc-flex-col plc-justify-between plc-flex-grow plc-w-56 plc-ml-4 plc-break-words sm:plc-w-auto"
|
|
35613
35626
|
}, userHasName && /*#__PURE__*/React__default['default'].createElement("p", {
|
|
35614
|
-
className: "plc-font-bold"
|
|
35627
|
+
className: "plc-font-bold plc-break-all"
|
|
35615
35628
|
}, this.user.first_name, " ", this.user.last_name), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
35616
|
-
className: `plc-m-0 plc-text-sm ${userHasName ? "plc-text-sm" : "plc-text-lg plc-font-bold plc-mt-auto"}`
|
|
35629
|
+
className: `plc-m-0 plc-text-sm plc-break-all ${userHasName ? "plc-text-sm" : "plc-text-lg plc-font-bold plc-mt-auto"}`
|
|
35617
35630
|
}, this.user.email)), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
35618
35631
|
className: "lg:plc-hidden"
|
|
35619
35632
|
}, /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
@@ -35697,6 +35710,7 @@ class Dashboard extends React.Component {
|
|
|
35697
35710
|
setActiveDashboardLink: this.setActiveDashboardLink,
|
|
35698
35711
|
activeDashboardLink: this.state.activeDashboardLink
|
|
35699
35712
|
}), /*#__PURE__*/React__default['default'].createElement(DashboardLink, {
|
|
35713
|
+
show: hasActiveMemberships(),
|
|
35700
35714
|
name: SUB_MENUS.MEMBERSHIPS,
|
|
35701
35715
|
icon: /*#__PURE__*/React__default['default'].createElement(SvgMemberships, {
|
|
35702
35716
|
className: "plc-transform plc-scale-120 plc-w-7 plc-h-8 plc-mr-1 plc-pt-1"
|
|
@@ -35705,6 +35719,7 @@ class Dashboard extends React.Component {
|
|
|
35705
35719
|
setActiveDashboardLink: this.setActiveDashboardLink,
|
|
35706
35720
|
activeDashboardLink: this.state.activeDashboardLink
|
|
35707
35721
|
}), /*#__PURE__*/React__default['default'].createElement(DashboardLink, {
|
|
35722
|
+
show: hasDonationSubs(),
|
|
35708
35723
|
name: SUB_MENUS.DONATIONS,
|
|
35709
35724
|
icon: /*#__PURE__*/React__default['default'].createElement(SvgDonate, {
|
|
35710
35725
|
className: "plc-transform plc-scale-120 plc-w-7 plc-h-8 plc-mr-1 plc-pt-1"
|
|
@@ -35719,6 +35734,7 @@ class Dashboard extends React.Component {
|
|
|
35719
35734
|
setActiveDashboardLink: this.setActiveDashboardLink,
|
|
35720
35735
|
activeDashboardLink: this.state.activeDashboardLink
|
|
35721
35736
|
}), /*#__PURE__*/React__default['default'].createElement(DashboardLink, {
|
|
35737
|
+
show: window.Pelcro.site.read().ecommerce_enabled,
|
|
35722
35738
|
name: SUB_MENUS.ORDERS,
|
|
35723
35739
|
icon: /*#__PURE__*/React__default['default'].createElement(SvgShopping, null),
|
|
35724
35740
|
title: this.locale("labels.orders.label"),
|
|
@@ -35795,6 +35811,20 @@ function showNewsletters() {
|
|
|
35795
35811
|
return showNewslettersUiSettings;
|
|
35796
35812
|
}
|
|
35797
35813
|
|
|
35814
|
+
function hasDonationSubs() {
|
|
35815
|
+
var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
|
|
35816
|
+
|
|
35817
|
+
const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
|
|
35818
|
+
const canceledDonations = (_window$Pelcro$user$r4 = (_window$Pelcro$user$r5 = window.Pelcro.user.read().expired_subscriptions) === null || _window$Pelcro$user$r5 === void 0 ? void 0 : _window$Pelcro$user$r5.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$user$r4 !== void 0 ? _window$Pelcro$user$r4 : [];
|
|
35819
|
+
return donations.length > 0 || canceledDonations.length > 0;
|
|
35820
|
+
}
|
|
35821
|
+
|
|
35822
|
+
function hasActiveMemberships() {
|
|
35823
|
+
var _window$Pelcro$user$r6, _window$Pelcro$user$r7;
|
|
35824
|
+
|
|
35825
|
+
return (_window$Pelcro$user$r6 = (_window$Pelcro$user$r7 = window.Pelcro.user.read().memberships) === null || _window$Pelcro$user$r7 === void 0 ? void 0 : _window$Pelcro$user$r7.some(membership => membership.status === "active" && membership.subscription.ended_at === null)) !== null && _window$Pelcro$user$r6 !== void 0 ? _window$Pelcro$user$r6 : false;
|
|
35826
|
+
}
|
|
35827
|
+
|
|
35798
35828
|
const DashboardWithTrans = withTranslation("dashboard")(Dashboard);
|
|
35799
35829
|
|
|
35800
35830
|
// The button in the lower left that shows the dashboard.
|
package/dist/index.esm.js
CHANGED
|
@@ -24821,8 +24821,15 @@ const PaymentSuccessView = ({
|
|
|
24821
24821
|
|
|
24822
24822
|
if (successTitle && successContent) {
|
|
24823
24823
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
24824
|
-
className: "plc-flex plc-flex-col plc-items-center"
|
|
24825
|
-
},
|
|
24824
|
+
className: "plc-flex plc-flex-col plc-items-center plc-relative"
|
|
24825
|
+
}, /*#__PURE__*/React__default.createElement("button", {
|
|
24826
|
+
type: "button",
|
|
24827
|
+
className: "pelcro-modal-close plc-absolute plc-top-6 plc-right-0",
|
|
24828
|
+
"aria-label": "close modal",
|
|
24829
|
+
onClick: onClose
|
|
24830
|
+
}, /*#__PURE__*/React__default.createElement(SvgXIcon, {
|
|
24831
|
+
className: "plc-fill-current"
|
|
24832
|
+
})), successIcon, /*#__PURE__*/React__default.createElement("div", {
|
|
24826
24833
|
className: "plc-text-center plc-text-gray-900"
|
|
24827
24834
|
}, /*#__PURE__*/React__default.createElement("h4", {
|
|
24828
24835
|
className: "plc-mb-4 plc-text-3xl"
|
|
@@ -33445,7 +33452,9 @@ const AddressesMenu = props => {
|
|
|
33445
33452
|
const AddressesItems = props => {
|
|
33446
33453
|
var _window$Pelcro$user$r;
|
|
33447
33454
|
|
|
33448
|
-
|
|
33455
|
+
const {
|
|
33456
|
+
t
|
|
33457
|
+
} = useTranslation("dashboard");
|
|
33449
33458
|
const {
|
|
33450
33459
|
switchView
|
|
33451
33460
|
} = usePelcro();
|
|
@@ -33476,7 +33485,9 @@ const AddressesItems = props => {
|
|
|
33476
33485
|
return addresses.map((address, index) => address.type === "shipping" && /*#__PURE__*/React__default.createElement("div", {
|
|
33477
33486
|
key: address.id,
|
|
33478
33487
|
className: `plc-py-2 plc-px-4 plc-mt-5 plc-flex plc-items-center plc-justify-between last:plc-mb-0 plc-rounded plc-text-gray-900 pelcro-address-wrapper plc-bg-white plc-shadow-md_dark ${selectedAddressId === String(address.id) && `plc-border-primary-400 plc-border-2`}`
|
|
33479
|
-
}, /*#__PURE__*/React__default.createElement("div",
|
|
33488
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
33489
|
+
className: "plc-flex-1 plc-relative"
|
|
33490
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
33480
33491
|
className: "pelcro-address-name plc-font-semibold"
|
|
33481
33492
|
}, address.first_name, " ", address.last_name), /*#__PURE__*/React__default.createElement("p", {
|
|
33482
33493
|
className: "pelcro-address-company"
|
|
@@ -33484,7 +33495,9 @@ const AddressesItems = props => {
|
|
|
33484
33495
|
className: "pelcro-address-line1 plc-text-sm plc-mt-2"
|
|
33485
33496
|
}, address.line1), /*#__PURE__*/React__default.createElement("p", {
|
|
33486
33497
|
className: "pelcro-address-country plc-text-sm"
|
|
33487
|
-
}, address.city, ", ", address.state_name, " ", address.postal_code, ", ", address.country_name)
|
|
33498
|
+
}, address.city, ", ", address.state_name, " ", address.postal_code, ", ", address.country_name), address.is_default && /*#__PURE__*/React__default.createElement("span", {
|
|
33499
|
+
className: "plc-rounded-full plc-bg-gray-800 plc-text-white plc-inline-flex plc-items-start plc-py-1 plc-px-4 plc-text-sm plc-mt-4"
|
|
33500
|
+
}, t("labels.default"))), /*#__PURE__*/React__default.createElement(Button, {
|
|
33488
33501
|
variant: "icon",
|
|
33489
33502
|
className: "plc-text-gray-500",
|
|
33490
33503
|
icon: /*#__PURE__*/React__default.createElement(SvgEdit, null),
|
|
@@ -35570,7 +35583,7 @@ class Dashboard extends Component {
|
|
|
35570
35583
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
35571
35584
|
className: "plc-flex plc-items-center"
|
|
35572
35585
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
35573
|
-
className: "plc-flex plc-justify-center plc-ml-3 sm:plc-ml-6 "
|
|
35586
|
+
className: "plc-flex plc-justify-center plc-ml-3 sm:plc-ml-6 plc-flex-shrink-0"
|
|
35574
35587
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
35575
35588
|
className: "plc-relative plc-flex-shrink-0"
|
|
35576
35589
|
}, /*#__PURE__*/React__default.createElement("img", {
|
|
@@ -35581,9 +35594,9 @@ class Dashboard extends Component {
|
|
|
35581
35594
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
35582
35595
|
className: "plc-flex plc-flex-col plc-justify-between plc-flex-grow plc-w-56 plc-ml-4 plc-break-words sm:plc-w-auto"
|
|
35583
35596
|
}, userHasName && /*#__PURE__*/React__default.createElement("p", {
|
|
35584
|
-
className: "plc-font-bold"
|
|
35597
|
+
className: "plc-font-bold plc-break-all"
|
|
35585
35598
|
}, this.user.first_name, " ", this.user.last_name), /*#__PURE__*/React__default.createElement("p", {
|
|
35586
|
-
className: `plc-m-0 plc-text-sm ${userHasName ? "plc-text-sm" : "plc-text-lg plc-font-bold plc-mt-auto"}`
|
|
35599
|
+
className: `plc-m-0 plc-text-sm plc-break-all ${userHasName ? "plc-text-sm" : "plc-text-lg plc-font-bold plc-mt-auto"}`
|
|
35587
35600
|
}, this.user.email)), /*#__PURE__*/React__default.createElement("div", {
|
|
35588
35601
|
className: "lg:plc-hidden"
|
|
35589
35602
|
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
@@ -35667,6 +35680,7 @@ class Dashboard extends Component {
|
|
|
35667
35680
|
setActiveDashboardLink: this.setActiveDashboardLink,
|
|
35668
35681
|
activeDashboardLink: this.state.activeDashboardLink
|
|
35669
35682
|
}), /*#__PURE__*/React__default.createElement(DashboardLink, {
|
|
35683
|
+
show: hasActiveMemberships(),
|
|
35670
35684
|
name: SUB_MENUS.MEMBERSHIPS,
|
|
35671
35685
|
icon: /*#__PURE__*/React__default.createElement(SvgMemberships, {
|
|
35672
35686
|
className: "plc-transform plc-scale-120 plc-w-7 plc-h-8 plc-mr-1 plc-pt-1"
|
|
@@ -35675,6 +35689,7 @@ class Dashboard extends Component {
|
|
|
35675
35689
|
setActiveDashboardLink: this.setActiveDashboardLink,
|
|
35676
35690
|
activeDashboardLink: this.state.activeDashboardLink
|
|
35677
35691
|
}), /*#__PURE__*/React__default.createElement(DashboardLink, {
|
|
35692
|
+
show: hasDonationSubs(),
|
|
35678
35693
|
name: SUB_MENUS.DONATIONS,
|
|
35679
35694
|
icon: /*#__PURE__*/React__default.createElement(SvgDonate, {
|
|
35680
35695
|
className: "plc-transform plc-scale-120 plc-w-7 plc-h-8 plc-mr-1 plc-pt-1"
|
|
@@ -35689,6 +35704,7 @@ class Dashboard extends Component {
|
|
|
35689
35704
|
setActiveDashboardLink: this.setActiveDashboardLink,
|
|
35690
35705
|
activeDashboardLink: this.state.activeDashboardLink
|
|
35691
35706
|
}), /*#__PURE__*/React__default.createElement(DashboardLink, {
|
|
35707
|
+
show: window.Pelcro.site.read().ecommerce_enabled,
|
|
35692
35708
|
name: SUB_MENUS.ORDERS,
|
|
35693
35709
|
icon: /*#__PURE__*/React__default.createElement(SvgShopping, null),
|
|
35694
35710
|
title: this.locale("labels.orders.label"),
|
|
@@ -35765,6 +35781,20 @@ function showNewsletters() {
|
|
|
35765
35781
|
return showNewslettersUiSettings;
|
|
35766
35782
|
}
|
|
35767
35783
|
|
|
35784
|
+
function hasDonationSubs() {
|
|
35785
|
+
var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
|
|
35786
|
+
|
|
35787
|
+
const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
|
|
35788
|
+
const canceledDonations = (_window$Pelcro$user$r4 = (_window$Pelcro$user$r5 = window.Pelcro.user.read().expired_subscriptions) === null || _window$Pelcro$user$r5 === void 0 ? void 0 : _window$Pelcro$user$r5.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$user$r4 !== void 0 ? _window$Pelcro$user$r4 : [];
|
|
35789
|
+
return donations.length > 0 || canceledDonations.length > 0;
|
|
35790
|
+
}
|
|
35791
|
+
|
|
35792
|
+
function hasActiveMemberships() {
|
|
35793
|
+
var _window$Pelcro$user$r6, _window$Pelcro$user$r7;
|
|
35794
|
+
|
|
35795
|
+
return (_window$Pelcro$user$r6 = (_window$Pelcro$user$r7 = window.Pelcro.user.read().memberships) === null || _window$Pelcro$user$r7 === void 0 ? void 0 : _window$Pelcro$user$r7.some(membership => membership.status === "active" && membership.subscription.ended_at === null)) !== null && _window$Pelcro$user$r6 !== void 0 ? _window$Pelcro$user$r6 : false;
|
|
35796
|
+
}
|
|
35797
|
+
|
|
35768
35798
|
const DashboardWithTrans = withTranslation("dashboard")(Dashboard);
|
|
35769
35799
|
|
|
35770
35800
|
// The button in the lower left that shows the dashboard.
|
package/dist/pelcro.css
CHANGED
|
@@ -1833,6 +1833,7 @@ Add the correct display in Chrome and Safari.
|
|
|
1833
1833
|
display: flex !important;
|
|
1834
1834
|
align-items: center;
|
|
1835
1835
|
justify-content: center;
|
|
1836
|
+
flex-wrap: wrap;
|
|
1836
1837
|
}
|
|
1837
1838
|
|
|
1838
1839
|
.pelcro-root .slick-dots li {
|
|
@@ -1975,6 +1976,10 @@ in order to scope selectors under pelcro-root
|
|
|
1975
1976
|
top: 1.25rem;
|
|
1976
1977
|
}
|
|
1977
1978
|
|
|
1979
|
+
.pelcro-root .plc-top-6 {
|
|
1980
|
+
top: 1.5rem;
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1978
1983
|
.pelcro-root .plc-top-7 {
|
|
1979
1984
|
top: 1.75rem;
|
|
1980
1985
|
}
|