@pelcro/react-pelcro-js 3.21.0-beta.4 → 3.21.0-beta.6
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 +15 -15
- package/dist/index.esm.js +15 -15
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -13984,10 +13984,17 @@ function SelectModalWithHook(props) {
|
|
|
13984
13984
|
matchingEntitlements: view === "_plan-select-entitlements" ? entitlements : null
|
|
13985
13985
|
});
|
|
13986
13986
|
}
|
|
13987
|
+
function productsWithMatchedTaggedFirst() {
|
|
13988
|
+
var _window$Pelcro$produc;
|
|
13989
|
+
const allProducts = (_window$Pelcro$produc = window.Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [];
|
|
13990
|
+
const productsThatMatchArticleTag = window.Pelcro.product.getByMatchingPageTags();
|
|
13991
|
+
const allProductsMinusMatched = allProducts.filter(product => !productsThatMatchArticleTag.some(matchedProduct => matchedProduct.id === product.id));
|
|
13992
|
+
return [productsThatMatchArticleTag, allProductsMinusMatched];
|
|
13993
|
+
}
|
|
13987
13994
|
SelectModalWithHook.viewId = "plan-select";
|
|
13988
13995
|
class SelectModal extends React.Component {
|
|
13989
|
-
constructor(
|
|
13990
|
-
super(
|
|
13996
|
+
constructor(props) {
|
|
13997
|
+
super(props);
|
|
13991
13998
|
_defineProperty$3(this, "componentDidMount", () => {
|
|
13992
13999
|
if (this.props.product) {
|
|
13993
14000
|
const {
|
|
@@ -14020,7 +14027,7 @@ class SelectModal extends React.Component {
|
|
|
14020
14027
|
this.props.setView("register");
|
|
14021
14028
|
}
|
|
14022
14029
|
document.addEventListener("keydown", this.handleSubmit);
|
|
14023
|
-
|
|
14030
|
+
{
|
|
14024
14031
|
var _window$Pelcro, _window$Pelcro$user, _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$user, _window$Pelcro4, _window$Pelcro4$site;
|
|
14025
14032
|
const userCurrency = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$user = _window$Pelcro.user) === null || _window$Pelcro$user === void 0 ? void 0 : _window$Pelcro$user.read().currency;
|
|
14026
14033
|
const userCountry = (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : _window$Pelcro2$user.location.countryCode;
|
|
@@ -14040,18 +14047,18 @@ class SelectModal extends React.Component {
|
|
|
14040
14047
|
}).length === 0 : false;
|
|
14041
14048
|
notifyBugsnag(() => {
|
|
14042
14049
|
Bugsnag.notify("SelectModal - No data viewed", event => {
|
|
14043
|
-
var _window$Pelcro5, _window$Pelcro5$site, _window$Pelcro6, _window$Pelcro6$user, _window$Pelcro7, _window$Pelcro7$uiSet, _window$Pelcro8, _window$Pelcro9, _window$Pelcro9$helpe, _window$Pelcro10, _window$Pelcro10$site, _window$Pelcro11, _window$Pelcro11$site;
|
|
14050
|
+
var _window$Pelcro5, _window$Pelcro5$site, _window$Pelcro6, _window$Pelcro6$user, _window$Pelcro7, _window$Pelcro7$uiSet, _window$Pelcro8, _this$props, _window$Pelcro9, _window$Pelcro9$helpe, _window$Pelcro10, _window$Pelcro10$site, _window$Pelcro11, _window$Pelcro11$site;
|
|
14044
14051
|
event.addMetadata("MetaData", {
|
|
14045
14052
|
site: (_window$Pelcro5 = window.Pelcro) === null || _window$Pelcro5 === void 0 ? void 0 : (_window$Pelcro5$site = _window$Pelcro5.site) === null || _window$Pelcro5$site === void 0 ? void 0 : _window$Pelcro5$site.read(),
|
|
14046
14053
|
user: (_window$Pelcro6 = window.Pelcro) === null || _window$Pelcro6 === void 0 ? void 0 : (_window$Pelcro6$user = _window$Pelcro6.user) === null || _window$Pelcro6$user === void 0 ? void 0 : _window$Pelcro6$user.read(),
|
|
14047
14054
|
uiVersion: (_window$Pelcro7 = window.Pelcro) === null || _window$Pelcro7 === void 0 ? void 0 : (_window$Pelcro7$uiSet = _window$Pelcro7.uiSettings) === null || _window$Pelcro7$uiSet === void 0 ? void 0 : _window$Pelcro7$uiSet.uiVersion,
|
|
14048
14055
|
environment: (_window$Pelcro8 = window.Pelcro) === null || _window$Pelcro8 === void 0 ? void 0 : _window$Pelcro8.environment,
|
|
14049
|
-
matchingEntitlementsProps: props.matchingEntitlements,
|
|
14056
|
+
matchingEntitlementsProps: (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.matchingEntitlements,
|
|
14050
14057
|
productListState: this.state.productList,
|
|
14051
14058
|
methods: {
|
|
14052
14059
|
productsWithMatchedTaggedFirst: productsWithMatchedTaggedFirst(),
|
|
14053
14060
|
pelcroSDKProductsListMethod: window.Pelcro.product.list(),
|
|
14054
|
-
pelcroSDKGetByEntitlements: props.matchingEntitlements ? window.Pelcro.product.getByEntitlements(props.matchingEntitlements) : null
|
|
14061
|
+
pelcroSDKGetByEntitlements: this.props.matchingEntitlements ? window.Pelcro.product.getByEntitlements(this.props.matchingEntitlements) : null
|
|
14055
14062
|
},
|
|
14056
14063
|
userCurrency: userCurrency,
|
|
14057
14064
|
userCountry: userCountry,
|
|
@@ -14160,13 +14167,6 @@ class SelectModal extends React.Component {
|
|
|
14160
14167
|
}), /*#__PURE__*/React__default['default'].createElement("h3", {
|
|
14161
14168
|
className: "plc-text-sm plc-font-semibold"
|
|
14162
14169
|
}, this.locale("labels.restrictiveArticles.or")), allProductsMinusMatched.map((product, index) => this.renderOneProduct(product, index))));
|
|
14163
|
-
function productsWithMatchedTaggedFirst() {
|
|
14164
|
-
var _window$Pelcro$produc;
|
|
14165
|
-
const allProducts = (_window$Pelcro$produc = window.Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [];
|
|
14166
|
-
const productsThatMatchArticleTag = window.Pelcro.product.getByMatchingPageTags();
|
|
14167
|
-
const allProductsMinusMatched = allProducts.filter(product => !productsThatMatchArticleTag.some(matchedProduct => matchedProduct.id === product.id));
|
|
14168
|
-
return [productsThatMatchArticleTag, allProductsMinusMatched];
|
|
14169
|
-
}
|
|
14170
14170
|
});
|
|
14171
14171
|
_defineProperty$3(this, "renderPlans", () => {
|
|
14172
14172
|
return this.state.planList.map(plan => {
|
|
@@ -14269,10 +14269,10 @@ class SelectModal extends React.Component {
|
|
|
14269
14269
|
this.state = {
|
|
14270
14270
|
product: {},
|
|
14271
14271
|
plan: {},
|
|
14272
|
-
isGift:
|
|
14272
|
+
isGift: props.isGift,
|
|
14273
14273
|
disabled: true,
|
|
14274
14274
|
mode: "product",
|
|
14275
|
-
productList:
|
|
14275
|
+
productList: props.matchingEntitlements ? window.Pelcro.product.getByEntitlements(props.matchingEntitlements) : window.Pelcro.product.list()
|
|
14276
14276
|
};
|
|
14277
14277
|
this.product = this.props.product || window.Pelcro.paywall.getProduct();
|
|
14278
14278
|
this.locale = this.props.t;
|
package/dist/index.esm.js
CHANGED
|
@@ -13954,10 +13954,17 @@ function SelectModalWithHook(props) {
|
|
|
13954
13954
|
matchingEntitlements: view === "_plan-select-entitlements" ? entitlements : null
|
|
13955
13955
|
});
|
|
13956
13956
|
}
|
|
13957
|
+
function productsWithMatchedTaggedFirst() {
|
|
13958
|
+
var _window$Pelcro$produc;
|
|
13959
|
+
const allProducts = (_window$Pelcro$produc = window.Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [];
|
|
13960
|
+
const productsThatMatchArticleTag = window.Pelcro.product.getByMatchingPageTags();
|
|
13961
|
+
const allProductsMinusMatched = allProducts.filter(product => !productsThatMatchArticleTag.some(matchedProduct => matchedProduct.id === product.id));
|
|
13962
|
+
return [productsThatMatchArticleTag, allProductsMinusMatched];
|
|
13963
|
+
}
|
|
13957
13964
|
SelectModalWithHook.viewId = "plan-select";
|
|
13958
13965
|
class SelectModal extends Component {
|
|
13959
|
-
constructor(
|
|
13960
|
-
super(
|
|
13966
|
+
constructor(props) {
|
|
13967
|
+
super(props);
|
|
13961
13968
|
_defineProperty$3(this, "componentDidMount", () => {
|
|
13962
13969
|
if (this.props.product) {
|
|
13963
13970
|
const {
|
|
@@ -13990,7 +13997,7 @@ class SelectModal extends Component {
|
|
|
13990
13997
|
this.props.setView("register");
|
|
13991
13998
|
}
|
|
13992
13999
|
document.addEventListener("keydown", this.handleSubmit);
|
|
13993
|
-
|
|
14000
|
+
{
|
|
13994
14001
|
var _window$Pelcro, _window$Pelcro$user, _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$user, _window$Pelcro4, _window$Pelcro4$site;
|
|
13995
14002
|
const userCurrency = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$user = _window$Pelcro.user) === null || _window$Pelcro$user === void 0 ? void 0 : _window$Pelcro$user.read().currency;
|
|
13996
14003
|
const userCountry = (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : _window$Pelcro2$user.location.countryCode;
|
|
@@ -14010,18 +14017,18 @@ class SelectModal extends Component {
|
|
|
14010
14017
|
}).length === 0 : false;
|
|
14011
14018
|
notifyBugsnag(() => {
|
|
14012
14019
|
Bugsnag.notify("SelectModal - No data viewed", event => {
|
|
14013
|
-
var _window$Pelcro5, _window$Pelcro5$site, _window$Pelcro6, _window$Pelcro6$user, _window$Pelcro7, _window$Pelcro7$uiSet, _window$Pelcro8, _window$Pelcro9, _window$Pelcro9$helpe, _window$Pelcro10, _window$Pelcro10$site, _window$Pelcro11, _window$Pelcro11$site;
|
|
14020
|
+
var _window$Pelcro5, _window$Pelcro5$site, _window$Pelcro6, _window$Pelcro6$user, _window$Pelcro7, _window$Pelcro7$uiSet, _window$Pelcro8, _this$props, _window$Pelcro9, _window$Pelcro9$helpe, _window$Pelcro10, _window$Pelcro10$site, _window$Pelcro11, _window$Pelcro11$site;
|
|
14014
14021
|
event.addMetadata("MetaData", {
|
|
14015
14022
|
site: (_window$Pelcro5 = window.Pelcro) === null || _window$Pelcro5 === void 0 ? void 0 : (_window$Pelcro5$site = _window$Pelcro5.site) === null || _window$Pelcro5$site === void 0 ? void 0 : _window$Pelcro5$site.read(),
|
|
14016
14023
|
user: (_window$Pelcro6 = window.Pelcro) === null || _window$Pelcro6 === void 0 ? void 0 : (_window$Pelcro6$user = _window$Pelcro6.user) === null || _window$Pelcro6$user === void 0 ? void 0 : _window$Pelcro6$user.read(),
|
|
14017
14024
|
uiVersion: (_window$Pelcro7 = window.Pelcro) === null || _window$Pelcro7 === void 0 ? void 0 : (_window$Pelcro7$uiSet = _window$Pelcro7.uiSettings) === null || _window$Pelcro7$uiSet === void 0 ? void 0 : _window$Pelcro7$uiSet.uiVersion,
|
|
14018
14025
|
environment: (_window$Pelcro8 = window.Pelcro) === null || _window$Pelcro8 === void 0 ? void 0 : _window$Pelcro8.environment,
|
|
14019
|
-
matchingEntitlementsProps: props.matchingEntitlements,
|
|
14026
|
+
matchingEntitlementsProps: (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.matchingEntitlements,
|
|
14020
14027
|
productListState: this.state.productList,
|
|
14021
14028
|
methods: {
|
|
14022
14029
|
productsWithMatchedTaggedFirst: productsWithMatchedTaggedFirst(),
|
|
14023
14030
|
pelcroSDKProductsListMethod: window.Pelcro.product.list(),
|
|
14024
|
-
pelcroSDKGetByEntitlements: props.matchingEntitlements ? window.Pelcro.product.getByEntitlements(props.matchingEntitlements) : null
|
|
14031
|
+
pelcroSDKGetByEntitlements: this.props.matchingEntitlements ? window.Pelcro.product.getByEntitlements(this.props.matchingEntitlements) : null
|
|
14025
14032
|
},
|
|
14026
14033
|
userCurrency: userCurrency,
|
|
14027
14034
|
userCountry: userCountry,
|
|
@@ -14130,13 +14137,6 @@ class SelectModal extends Component {
|
|
|
14130
14137
|
}), /*#__PURE__*/React__default.createElement("h3", {
|
|
14131
14138
|
className: "plc-text-sm plc-font-semibold"
|
|
14132
14139
|
}, this.locale("labels.restrictiveArticles.or")), allProductsMinusMatched.map((product, index) => this.renderOneProduct(product, index))));
|
|
14133
|
-
function productsWithMatchedTaggedFirst() {
|
|
14134
|
-
var _window$Pelcro$produc;
|
|
14135
|
-
const allProducts = (_window$Pelcro$produc = window.Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [];
|
|
14136
|
-
const productsThatMatchArticleTag = window.Pelcro.product.getByMatchingPageTags();
|
|
14137
|
-
const allProductsMinusMatched = allProducts.filter(product => !productsThatMatchArticleTag.some(matchedProduct => matchedProduct.id === product.id));
|
|
14138
|
-
return [productsThatMatchArticleTag, allProductsMinusMatched];
|
|
14139
|
-
}
|
|
14140
14140
|
});
|
|
14141
14141
|
_defineProperty$3(this, "renderPlans", () => {
|
|
14142
14142
|
return this.state.planList.map(plan => {
|
|
@@ -14239,10 +14239,10 @@ class SelectModal extends Component {
|
|
|
14239
14239
|
this.state = {
|
|
14240
14240
|
product: {},
|
|
14241
14241
|
plan: {},
|
|
14242
|
-
isGift:
|
|
14242
|
+
isGift: props.isGift,
|
|
14243
14243
|
disabled: true,
|
|
14244
14244
|
mode: "product",
|
|
14245
|
-
productList:
|
|
14245
|
+
productList: props.matchingEntitlements ? window.Pelcro.product.getByEntitlements(props.matchingEntitlements) : window.Pelcro.product.list()
|
|
14246
14246
|
};
|
|
14247
14247
|
this.product = this.props.product || window.Pelcro.paywall.getProduct();
|
|
14248
14248
|
this.locale = this.props.t;
|