@pelcro/react-pelcro-js 4.0.0-alpha.29 → 4.0.0-alpha.30
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 +14 -15
- package/dist/index.esm.js +14 -15
- package/dist/pelcro.css +2 -6
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -19116,13 +19116,13 @@ class SelectModal extends React.Component {
|
|
|
19116
19116
|
className: "plc-font-medium plc-text-2xl pelcro-select-product-title"
|
|
19117
19117
|
}, product.name), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
19118
19118
|
className: "plc-text-sm plc-mt-1 pelcro-select-product-description"
|
|
19119
|
-
}, product.description)), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19119
|
+
}, product.description))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19120
|
+
className: "plc-mt-auto plc-w-full"
|
|
19121
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19120
19122
|
className: "plc-mt-3 plc-mb-6"
|
|
19121
19123
|
}, product.plans && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
19122
19124
|
className: "plc-mb-2"
|
|
19123
|
-
}, this.locale("labels.startingAt")), this.countStartPrice(product.plans)))
|
|
19124
|
-
className: "plc-mt-auto plc-w-full"
|
|
19125
|
-
}, /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
|
|
19125
|
+
}, this.locale("labels.startingAt")), this.countStartPrice(product.plans))), isPlanMode || /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
|
|
19126
19126
|
onClick: productButtonCallback,
|
|
19127
19127
|
"data-key": product.id,
|
|
19128
19128
|
id: "pelcro-select-product-back-button",
|
|
@@ -19133,6 +19133,12 @@ class SelectModal extends React.Component {
|
|
|
19133
19133
|
});
|
|
19134
19134
|
|
|
19135
19135
|
_defineProperty$3(this, "renderProducts", () => {
|
|
19136
|
+
const isPlanMode = Boolean(this.state.mode === "plan");
|
|
19137
|
+
|
|
19138
|
+
if (isPlanMode) {
|
|
19139
|
+
return this.renderProductTabs();
|
|
19140
|
+
}
|
|
19141
|
+
|
|
19136
19142
|
const userDidSelectProduct = Boolean(this.state.mode === "plan");
|
|
19137
19143
|
const productsToShow = userDidSelectProduct ? [this.state.product] : this.state.productList;
|
|
19138
19144
|
const items = productsToShow.map((product, index) => this.renderOneProduct(product, index));
|
|
@@ -19161,7 +19167,7 @@ class SelectModal extends React.Component {
|
|
|
19161
19167
|
}, /*#__PURE__*/React__default['default'].createElement("button", {
|
|
19162
19168
|
onClick: productButtonCallback,
|
|
19163
19169
|
"data-key": product.id,
|
|
19164
|
-
className: "plc-px-4 plc-py-2 plc-
|
|
19170
|
+
className: "plc-px-4 plc-py-2 plc-rounded plc-text-gray-600 focus:plc-outline-none plc-whitespace-nowrap"
|
|
19165
19171
|
}, product.name));
|
|
19166
19172
|
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19167
19173
|
className: "selectedProduct plc-flex plc-flex-col plc-items-center plc-justify-center"
|
|
@@ -19232,6 +19238,8 @@ class SelectModal extends React.Component {
|
|
|
19232
19238
|
}, plan.nickname), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
19233
19239
|
className: "plc-text-sm plc-mt-1 pelcro-select-plan-description"
|
|
19234
19240
|
}, plan.description)), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19241
|
+
className: "plc-mt-auto plc-px-4 plc-mb-4"
|
|
19242
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19235
19243
|
className: "plc-pt-4 plc-mb-4 plc-font-semibold pelcro-select-plan-price plc-px-4 plc-text-center plc-flex plc-items-end plc-justify-center"
|
|
19236
19244
|
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
19237
19245
|
className: "plc-font-bold plc-text-4xl"
|
|
@@ -19242,8 +19250,6 @@ class SelectModal extends React.Component {
|
|
|
19242
19250
|
}, plan.currency), /*#__PURE__*/React__default['default'].createElement("span", {
|
|
19243
19251
|
className: "plc-capitalize"
|
|
19244
19252
|
}, "/ ", plan.interval))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19245
|
-
className: "plc-mt-auto plc-px-4 plc-mb-4"
|
|
19246
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19247
19253
|
className: `${((_this$state2 = this.state) === null || _this$state2 === void 0 ? void 0 : _this$state2.plan.id) === plan.id ? "plc-bg-primary-800 plc-text-white" : "plc-text-primary-800"} plc-flex plc-items-center plc-justify-center plc-text-center plc-py-2 plc-px-4 plc-w-full plc-border-2 plc-rounded-md plc-border-primary-800`
|
|
19248
19254
|
}, this.locale("buttons.select")))));
|
|
19249
19255
|
});
|
|
@@ -19409,7 +19415,7 @@ class SelectModal extends React.Component {
|
|
|
19409
19415
|
}, (_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.restrictive_paywall_metatags_enabled ? this.renderMatchingProductsFirst() : this.renderProducts()), this.state.mode === "plan" && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19410
19416
|
className: "pelcro-select-plans-wrapper plc-mt-4"
|
|
19411
19417
|
}, this.renderPlans()), !disableGifting && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19412
|
-
className: "plc-flex plc-justify-center plc-mt-
|
|
19418
|
+
className: "plc-flex plc-justify-center plc-mt-4"
|
|
19413
19419
|
}, /*#__PURE__*/React__default['default'].createElement(Checkbox, {
|
|
19414
19420
|
onChange: this.onIsGiftChange,
|
|
19415
19421
|
checked: this.state.isGift,
|
|
@@ -33601,9 +33607,6 @@ const AddressesItems = props => {
|
|
|
33601
33607
|
const {
|
|
33602
33608
|
t
|
|
33603
33609
|
} = useTranslation("dashboard");
|
|
33604
|
-
const {
|
|
33605
|
-
switchView
|
|
33606
|
-
} = usePelcro();
|
|
33607
33610
|
const [selectedAddressId, setSelectedAddressId] = React.useState(null);
|
|
33608
33611
|
const allAddresses = (_window$Pelcro$user$r = window.Pelcro.user.read().addresses) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
|
|
33609
33612
|
|
|
@@ -33617,10 +33620,6 @@ const AddressesItems = props => {
|
|
|
33617
33620
|
return [defaultAddress, ...addressesWithoutDefault];
|
|
33618
33621
|
};
|
|
33619
33622
|
|
|
33620
|
-
if (!getDefaultAddress(allAddresses)) {
|
|
33621
|
-
switchView("address-select");
|
|
33622
|
-
}
|
|
33623
|
-
|
|
33624
33623
|
const addresses = moveDefaultAddressToStart(allAddresses);
|
|
33625
33624
|
if (addresses.length === 0) return null;
|
|
33626
33625
|
React.useEffect(() => {
|
package/dist/index.esm.js
CHANGED
|
@@ -19086,13 +19086,13 @@ class SelectModal extends Component {
|
|
|
19086
19086
|
className: "plc-font-medium plc-text-2xl pelcro-select-product-title"
|
|
19087
19087
|
}, product.name), /*#__PURE__*/React__default.createElement("p", {
|
|
19088
19088
|
className: "plc-text-sm plc-mt-1 pelcro-select-product-description"
|
|
19089
|
-
}, product.description)), /*#__PURE__*/React__default.createElement("div", {
|
|
19089
|
+
}, product.description))), /*#__PURE__*/React__default.createElement("div", {
|
|
19090
|
+
className: "plc-mt-auto plc-w-full"
|
|
19091
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
19090
19092
|
className: "plc-mt-3 plc-mb-6"
|
|
19091
19093
|
}, product.plans && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("p", {
|
|
19092
19094
|
className: "plc-mb-2"
|
|
19093
|
-
}, this.locale("labels.startingAt")), this.countStartPrice(product.plans)))
|
|
19094
|
-
className: "plc-mt-auto plc-w-full"
|
|
19095
|
-
}, /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
19095
|
+
}, this.locale("labels.startingAt")), this.countStartPrice(product.plans))), isPlanMode || /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
19096
19096
|
onClick: productButtonCallback,
|
|
19097
19097
|
"data-key": product.id,
|
|
19098
19098
|
id: "pelcro-select-product-back-button",
|
|
@@ -19103,6 +19103,12 @@ class SelectModal extends Component {
|
|
|
19103
19103
|
});
|
|
19104
19104
|
|
|
19105
19105
|
_defineProperty$3(this, "renderProducts", () => {
|
|
19106
|
+
const isPlanMode = Boolean(this.state.mode === "plan");
|
|
19107
|
+
|
|
19108
|
+
if (isPlanMode) {
|
|
19109
|
+
return this.renderProductTabs();
|
|
19110
|
+
}
|
|
19111
|
+
|
|
19106
19112
|
const userDidSelectProduct = Boolean(this.state.mode === "plan");
|
|
19107
19113
|
const productsToShow = userDidSelectProduct ? [this.state.product] : this.state.productList;
|
|
19108
19114
|
const items = productsToShow.map((product, index) => this.renderOneProduct(product, index));
|
|
@@ -19131,7 +19137,7 @@ class SelectModal extends Component {
|
|
|
19131
19137
|
}, /*#__PURE__*/React__default.createElement("button", {
|
|
19132
19138
|
onClick: productButtonCallback,
|
|
19133
19139
|
"data-key": product.id,
|
|
19134
|
-
className: "plc-px-4 plc-py-2 plc-
|
|
19140
|
+
className: "plc-px-4 plc-py-2 plc-rounded plc-text-gray-600 focus:plc-outline-none plc-whitespace-nowrap"
|
|
19135
19141
|
}, product.name));
|
|
19136
19142
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
19137
19143
|
className: "selectedProduct plc-flex plc-flex-col plc-items-center plc-justify-center"
|
|
@@ -19202,6 +19208,8 @@ class SelectModal extends Component {
|
|
|
19202
19208
|
}, plan.nickname), /*#__PURE__*/React__default.createElement("p", {
|
|
19203
19209
|
className: "plc-text-sm plc-mt-1 pelcro-select-plan-description"
|
|
19204
19210
|
}, plan.description)), /*#__PURE__*/React__default.createElement("div", {
|
|
19211
|
+
className: "plc-mt-auto plc-px-4 plc-mb-4"
|
|
19212
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
19205
19213
|
className: "plc-pt-4 plc-mb-4 plc-font-semibold pelcro-select-plan-price plc-px-4 plc-text-center plc-flex plc-items-end plc-justify-center"
|
|
19206
19214
|
}, /*#__PURE__*/React__default.createElement("p", {
|
|
19207
19215
|
className: "plc-font-bold plc-text-4xl"
|
|
@@ -19212,8 +19220,6 @@ class SelectModal extends Component {
|
|
|
19212
19220
|
}, plan.currency), /*#__PURE__*/React__default.createElement("span", {
|
|
19213
19221
|
className: "plc-capitalize"
|
|
19214
19222
|
}, "/ ", plan.interval))), /*#__PURE__*/React__default.createElement("div", {
|
|
19215
|
-
className: "plc-mt-auto plc-px-4 plc-mb-4"
|
|
19216
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
19217
19223
|
className: `${((_this$state2 = this.state) === null || _this$state2 === void 0 ? void 0 : _this$state2.plan.id) === plan.id ? "plc-bg-primary-800 plc-text-white" : "plc-text-primary-800"} plc-flex plc-items-center plc-justify-center plc-text-center plc-py-2 plc-px-4 plc-w-full plc-border-2 plc-rounded-md plc-border-primary-800`
|
|
19218
19224
|
}, this.locale("buttons.select")))));
|
|
19219
19225
|
});
|
|
@@ -19379,7 +19385,7 @@ class SelectModal extends Component {
|
|
|
19379
19385
|
}, (_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.restrictive_paywall_metatags_enabled ? this.renderMatchingProductsFirst() : this.renderProducts()), this.state.mode === "plan" && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
19380
19386
|
className: "pelcro-select-plans-wrapper plc-mt-4"
|
|
19381
19387
|
}, this.renderPlans()), !disableGifting && /*#__PURE__*/React__default.createElement("div", {
|
|
19382
|
-
className: "plc-flex plc-justify-center plc-mt-
|
|
19388
|
+
className: "plc-flex plc-justify-center plc-mt-4"
|
|
19383
19389
|
}, /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
19384
19390
|
onChange: this.onIsGiftChange,
|
|
19385
19391
|
checked: this.state.isGift,
|
|
@@ -33571,9 +33577,6 @@ const AddressesItems = props => {
|
|
|
33571
33577
|
const {
|
|
33572
33578
|
t
|
|
33573
33579
|
} = useTranslation("dashboard");
|
|
33574
|
-
const {
|
|
33575
|
-
switchView
|
|
33576
|
-
} = usePelcro();
|
|
33577
33580
|
const [selectedAddressId, setSelectedAddressId] = useState(null);
|
|
33578
33581
|
const allAddresses = (_window$Pelcro$user$r = window.Pelcro.user.read().addresses) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
|
|
33579
33582
|
|
|
@@ -33587,10 +33590,6 @@ const AddressesItems = props => {
|
|
|
33587
33590
|
return [defaultAddress, ...addressesWithoutDefault];
|
|
33588
33591
|
};
|
|
33589
33592
|
|
|
33590
|
-
if (!getDefaultAddress(allAddresses)) {
|
|
33591
|
-
switchView("address-select");
|
|
33592
|
-
}
|
|
33593
|
-
|
|
33594
33593
|
const addresses = moveDefaultAddressToStart(allAddresses);
|
|
33595
33594
|
if (addresses.length === 0) return null;
|
|
33596
33595
|
useEffect(() => {
|
package/dist/pelcro.css
CHANGED
|
@@ -1666,7 +1666,7 @@ Add the correct display in Chrome and Safari.
|
|
|
1666
1666
|
left: 0px;
|
|
1667
1667
|
height: 0.25rem;
|
|
1668
1668
|
width: 100%;
|
|
1669
|
-
background-color: hsl(var(--plc-primary-hue), var(--plc-primary-saturation),
|
|
1669
|
+
background-color: hsl(var(--plc-primary-hue), var(--plc-primary-saturation), var(--plc-primary-lightness));
|
|
1670
1670
|
}
|
|
1671
1671
|
|
|
1672
1672
|
/* Firefox */
|
|
@@ -1704,7 +1704,7 @@ Add the correct display in Chrome and Safari.
|
|
|
1704
1704
|
|
|
1705
1705
|
.pelcro-root .productTabs .tabs li#activeTab button {
|
|
1706
1706
|
border-color: hsl(var(--plc-primary-hue), var(--plc-primary-saturation), calc(var(--plc-primary-lightness) - 30%));
|
|
1707
|
-
background-color: hsl(var(--plc-primary-hue), var(--plc-primary-saturation),
|
|
1707
|
+
background-color: hsl(var(--plc-primary-hue), var(--plc-primary-saturation), var(--plc-primary-lightness));
|
|
1708
1708
|
--tw-text-opacity: 1;
|
|
1709
1709
|
color: rgba(255, 255, 255, var(--tw-text-opacity));
|
|
1710
1710
|
}
|
|
@@ -2131,10 +2131,6 @@ in order to scope selectors under pelcro-root
|
|
|
2131
2131
|
margin-top: 1.5rem;
|
|
2132
2132
|
}
|
|
2133
2133
|
|
|
2134
|
-
.pelcro-root .plc-mt-8 {
|
|
2135
|
-
margin-top: 2rem;
|
|
2136
|
-
}
|
|
2137
|
-
|
|
2138
2134
|
.pelcro-root .plc-mt-auto {
|
|
2139
2135
|
margin-top: auto;
|
|
2140
2136
|
}
|