@pelcro/react-pelcro-js 3.26.0-beta.58 → 3.26.0-beta.59

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 CHANGED
@@ -12664,6 +12664,9 @@ const defaultOptions = {
12664
12664
  enableTheme: true,
12665
12665
  enablePaywalls: true,
12666
12666
  loadSecuritySDK: true,
12667
+ enableNativeButtons: true,
12668
+ enableAuthenticatedButtons: true,
12669
+ enableUnAuthenticatedButtons: true,
12667
12670
  enableGoogleAnalytics: false
12668
12671
  };
12669
12672
  const PelcroModalController = _ref => {
@@ -12687,8 +12690,16 @@ const PelcroModalController = _ref => {
12687
12690
  }
12688
12691
  }
12689
12692
  }, [isDonation]);
12693
+
12694
+ // default options are overridable by consumer's options
12695
+ const mergedOptions = {
12696
+ ...defaultOptions,
12697
+ ...options
12698
+ };
12690
12699
  React__default['default'].useEffect(() => {
12691
- init$1();
12700
+ if (mergedOptions.enableNativeButtons) {
12701
+ init$1();
12702
+ }
12692
12703
  renderShopView(React__default['default'].Children.map(children, child => child).find(_ref2 => {
12693
12704
  let {
12694
12705
  type
@@ -12696,12 +12707,6 @@ const PelcroModalController = _ref => {
12696
12707
  return (type === null || type === void 0 ? void 0 : type.viewId) === "shop";
12697
12708
  }));
12698
12709
  }, []);
12699
-
12700
- // default options are overridable by consumer's options
12701
- const mergedOptions = {
12702
- ...defaultOptions,
12703
- ...options
12704
- };
12705
12710
  React__default['default'].useEffect(() => {
12706
12711
  whenSiteReady(() => {
12707
12712
  optionsController(mergedOptions);
@@ -12709,9 +12714,13 @@ const PelcroModalController = _ref => {
12709
12714
  }, [options]);
12710
12715
  React__default['default'].useEffect(() => {
12711
12716
  if (window.Pelcro.user.isAuthenticated()) {
12712
- authenticatedButtons();
12717
+ if (mergedOptions.enableAuthenticatedButtons) {
12718
+ authenticatedButtons();
12719
+ }
12713
12720
  } else {
12714
- unauthenticatedButtons();
12721
+ if (mergedOptions.enableUnAuthenticatedButtons) {
12722
+ unauthenticatedButtons();
12723
+ }
12715
12724
  }
12716
12725
  }, [window.Pelcro.user.isAuthenticated()]);
12717
12726
  React__default['default'].useEffect(() => {
package/dist/index.esm.js CHANGED
@@ -12634,6 +12634,9 @@ const defaultOptions = {
12634
12634
  enableTheme: true,
12635
12635
  enablePaywalls: true,
12636
12636
  loadSecuritySDK: true,
12637
+ enableNativeButtons: true,
12638
+ enableAuthenticatedButtons: true,
12639
+ enableUnAuthenticatedButtons: true,
12637
12640
  enableGoogleAnalytics: false
12638
12641
  };
12639
12642
  const PelcroModalController = _ref => {
@@ -12657,8 +12660,16 @@ const PelcroModalController = _ref => {
12657
12660
  }
12658
12661
  }
12659
12662
  }, [isDonation]);
12663
+
12664
+ // default options are overridable by consumer's options
12665
+ const mergedOptions = {
12666
+ ...defaultOptions,
12667
+ ...options
12668
+ };
12660
12669
  React__default.useEffect(() => {
12661
- init$1();
12670
+ if (mergedOptions.enableNativeButtons) {
12671
+ init$1();
12672
+ }
12662
12673
  renderShopView(React__default.Children.map(children, child => child).find(_ref2 => {
12663
12674
  let {
12664
12675
  type
@@ -12666,12 +12677,6 @@ const PelcroModalController = _ref => {
12666
12677
  return (type === null || type === void 0 ? void 0 : type.viewId) === "shop";
12667
12678
  }));
12668
12679
  }, []);
12669
-
12670
- // default options are overridable by consumer's options
12671
- const mergedOptions = {
12672
- ...defaultOptions,
12673
- ...options
12674
- };
12675
12680
  React__default.useEffect(() => {
12676
12681
  whenSiteReady(() => {
12677
12682
  optionsController(mergedOptions);
@@ -12679,9 +12684,13 @@ const PelcroModalController = _ref => {
12679
12684
  }, [options]);
12680
12685
  React__default.useEffect(() => {
12681
12686
  if (window.Pelcro.user.isAuthenticated()) {
12682
- authenticatedButtons();
12687
+ if (mergedOptions.enableAuthenticatedButtons) {
12688
+ authenticatedButtons();
12689
+ }
12683
12690
  } else {
12684
- unauthenticatedButtons();
12691
+ if (mergedOptions.enableUnAuthenticatedButtons) {
12692
+ unauthenticatedButtons();
12693
+ }
12685
12694
  }
12686
12695
  }, [window.Pelcro.user.isAuthenticated()]);
12687
12696
  React__default.useEffect(() => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "3.26.0-beta.58",
4
+ "version": "3.26.0-beta.59",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",