@pelcro/react-pelcro-js 4.0.0-alpha.115 → 4.0.0-alpha.117

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
@@ -11676,6 +11676,7 @@ function getFourDigitYear(lastTwoDigits) {
11676
11676
  * @property {boolean} enableTheme
11677
11677
  * @property {boolean} enablePaywalls
11678
11678
  * @property {boolean} enableGoogleAnalytics
11679
+ * @property {boolean} disablePageViewEvents
11679
11680
  */
11680
11681
 
11681
11682
  /**
@@ -11694,7 +11695,7 @@ const optionsController = options => {
11694
11695
  enableTheme: applyPelcroTheme,
11695
11696
  enablePaywalls: initPaywalls,
11696
11697
  loadSecuritySDK: initSecuritySdk,
11697
- enableGoogleAnalytics: initGATracking
11698
+ enableGoogleAnalytics: initGATracking(options.disablePageViewEvents)
11698
11699
  };
11699
11700
 
11700
11701
  // Only execute enabled options
@@ -11808,17 +11809,15 @@ const initSecuritySdk = () => {
11808
11809
  window.Pelcro.helpers.loadSDK(`https://www.recaptcha.net/recaptcha/enterprise.js?render=${securityKey}`, "pelcro-security-enteprise");
11809
11810
  });
11810
11811
  };
11811
- const initGATracking = () => {
11812
+ const initGATracking = (disablePageViewEvents = false) => {
11812
11813
  var _window, _window$Pelcro, _window$Pelcro$uiSett;
11813
11814
  const enableReactGA4 = (_window = window) === null || _window === void 0 ? void 0 : (_window$Pelcro = _window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.enableReactGA4;
11814
11815
  if (window.Pelcro.site.read().google_analytics_id) {
11815
11816
  if (enableReactGA4) {
11816
- // Initialize ReactGA4 with your tracking ID
11817
- ReactGA4.initialize(window.Pelcro.site.read().google_analytics_id);
11818
11817
  // Enable e-commerce tracking
11819
11818
  ReactGA4.initialize(window.Pelcro.site.read().google_analytics_id, {
11820
11819
  gaOptions: {
11821
- send_page_view: true,
11820
+ send_page_view: !disablePageViewEvents,
11822
11821
  ecommerce: {
11823
11822
  enabled: true
11824
11823
  }
@@ -12280,7 +12279,8 @@ const defaultOptions = {
12280
12279
  enableTheme: true,
12281
12280
  enablePaywalls: true,
12282
12281
  loadSecuritySDK: true,
12283
- enableGoogleAnalytics: false
12282
+ enableGoogleAnalytics: false,
12283
+ disablePageViewEvents: false
12284
12284
  };
12285
12285
  const PelcroModalController = ({
12286
12286
  rootId = "pelcro-app",
@@ -26068,7 +26068,7 @@ function SelectModalWithHook(props) {
26068
26068
  const entitlements = entitlementsProtectedElements.length > 0 ? getEntitlementsFromElem(entitlementsProtectedElements[0]) : null;
26069
26069
  return /*#__PURE__*/React__default['default'].createElement(SelectModalWithTrans, {
26070
26070
  isGift: isGift,
26071
- disableGifting: isRenewingGift,
26071
+ disableGifting: isRenewingGift || props.hideGiftButton,
26072
26072
  plan: plan,
26073
26073
  product: product,
26074
26074
  onClose: () => {
package/dist/index.esm.js CHANGED
@@ -11634,6 +11634,7 @@ function getFourDigitYear(lastTwoDigits) {
11634
11634
  * @property {boolean} enableTheme
11635
11635
  * @property {boolean} enablePaywalls
11636
11636
  * @property {boolean} enableGoogleAnalytics
11637
+ * @property {boolean} disablePageViewEvents
11637
11638
  */
11638
11639
 
11639
11640
  /**
@@ -11652,7 +11653,7 @@ const optionsController = options => {
11652
11653
  enableTheme: applyPelcroTheme,
11653
11654
  enablePaywalls: initPaywalls,
11654
11655
  loadSecuritySDK: initSecuritySdk,
11655
- enableGoogleAnalytics: initGATracking
11656
+ enableGoogleAnalytics: initGATracking(options.disablePageViewEvents)
11656
11657
  };
11657
11658
 
11658
11659
  // Only execute enabled options
@@ -11766,17 +11767,15 @@ const initSecuritySdk = () => {
11766
11767
  window.Pelcro.helpers.loadSDK(`https://www.recaptcha.net/recaptcha/enterprise.js?render=${securityKey}`, "pelcro-security-enteprise");
11767
11768
  });
11768
11769
  };
11769
- const initGATracking = () => {
11770
+ const initGATracking = (disablePageViewEvents = false) => {
11770
11771
  var _window, _window$Pelcro, _window$Pelcro$uiSett;
11771
11772
  const enableReactGA4 = (_window = window) === null || _window === void 0 ? void 0 : (_window$Pelcro = _window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.enableReactGA4;
11772
11773
  if (window.Pelcro.site.read().google_analytics_id) {
11773
11774
  if (enableReactGA4) {
11774
- // Initialize ReactGA4 with your tracking ID
11775
- ReactGA4.initialize(window.Pelcro.site.read().google_analytics_id);
11776
11775
  // Enable e-commerce tracking
11777
11776
  ReactGA4.initialize(window.Pelcro.site.read().google_analytics_id, {
11778
11777
  gaOptions: {
11779
- send_page_view: true,
11778
+ send_page_view: !disablePageViewEvents,
11780
11779
  ecommerce: {
11781
11780
  enabled: true
11782
11781
  }
@@ -12238,7 +12237,8 @@ const defaultOptions = {
12238
12237
  enableTheme: true,
12239
12238
  enablePaywalls: true,
12240
12239
  loadSecuritySDK: true,
12241
- enableGoogleAnalytics: false
12240
+ enableGoogleAnalytics: false,
12241
+ disablePageViewEvents: false
12242
12242
  };
12243
12243
  const PelcroModalController = ({
12244
12244
  rootId = "pelcro-app",
@@ -26026,7 +26026,7 @@ function SelectModalWithHook(props) {
26026
26026
  const entitlements = entitlementsProtectedElements.length > 0 ? getEntitlementsFromElem(entitlementsProtectedElements[0]) : null;
26027
26027
  return /*#__PURE__*/React__default.createElement(SelectModalWithTrans, {
26028
26028
  isGift: isGift,
26029
- disableGifting: isRenewingGift,
26029
+ disableGifting: isRenewingGift || props.hideGiftButton,
26030
26030
  plan: plan,
26031
26031
  product: product,
26032
26032
  onClose: () => {
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": "4.0.0-alpha.115",
4
+ "version": "4.0.0-alpha.117",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",