pb-sxp-ui 1.19.1 → 1.19.3

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.
@@ -485,10 +485,19 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
485
485
  useEffect(() => {
486
486
  if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting))
487
487
  return;
488
+ function extractRootDomain(hostname) {
489
+ if (!hostname || hostname.indexOf('.') === -1) {
490
+ return '';
491
+ }
492
+ const parts = hostname.split('.');
493
+ if (parts.length >= 2) {
494
+ return '.' + parts.slice(-2).join('.');
495
+ }
496
+ return '';
497
+ }
488
498
  window.OptanonWrapper = function () {
489
- var _a;
490
- console.log('OptanonWrapper');
491
- if ((window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups) && ((_a = window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups) === null || _a === void 0 ? void 0 : _a.length) > 2) {
499
+ const activeGroups = window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups;
500
+ if (activeGroups && (activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.length) > 2) {
492
501
  setIsShowCookieSetting(true);
493
502
  }
494
503
  };
@@ -502,21 +511,14 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
502
511
  if (!activeGroups)
503
512
  return;
504
513
  if (activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.includes('4')) {
514
+ window === null || window === void 0 ? void 0 : window.loadMetaPixel(false, SXP_CONFIG === null || SXP_CONFIG === void 0 ? void 0 : SXP_CONFIG.meta_conversion_api_pid);
515
+ window === null || window === void 0 ? void 0 : window.fbq('consent', 'grant');
505
516
  if (fbcRef.current && !(beForeactiveGroups === null || beForeactiveGroups === void 0 ? void 0 : beForeactiveGroups.includes('4'))) {
506
517
  }
507
518
  }
508
519
  else {
520
+ window === null || window === void 0 ? void 0 : window.fbq('consent', 'revoke');
509
521
  fbcRef.current = getCookie('_fbp');
510
- function extractRootDomain(hostname) {
511
- if (!hostname || hostname.indexOf('.') === -1) {
512
- return '';
513
- }
514
- const parts = hostname.split('.');
515
- if (parts.length >= 2) {
516
- return '.' + parts.slice(-2).join('.');
517
- }
518
- return '';
519
- }
520
522
  deleteCookie('_fbp', '/', extractRootDomain(window.location.hostname));
521
523
  const item = data[activeIndex];
522
524
  const traceInfo = ((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.traceInfo) || ((_b = item === null || item === void 0 ? void 0 : item.product) === null || _b === void 0 ? void 0 : _b.traceInfo) || '';
@@ -488,10 +488,19 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
488
488
  (0, react_1.useEffect)(() => {
489
489
  if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting))
490
490
  return;
491
+ function extractRootDomain(hostname) {
492
+ if (!hostname || hostname.indexOf('.') === -1) {
493
+ return '';
494
+ }
495
+ const parts = hostname.split('.');
496
+ if (parts.length >= 2) {
497
+ return '.' + parts.slice(-2).join('.');
498
+ }
499
+ return '';
500
+ }
491
501
  window.OptanonWrapper = function () {
492
- var _a;
493
- console.log('OptanonWrapper');
494
- if ((window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups) && ((_a = window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups) === null || _a === void 0 ? void 0 : _a.length) > 2) {
502
+ const activeGroups = window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups;
503
+ if (activeGroups && (activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.length) > 2) {
495
504
  setIsShowCookieSetting(true);
496
505
  }
497
506
  };
@@ -505,21 +514,14 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
505
514
  if (!activeGroups)
506
515
  return;
507
516
  if (activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.includes('4')) {
517
+ window === null || window === void 0 ? void 0 : window.loadMetaPixel(false, SXP_CONFIG === null || SXP_CONFIG === void 0 ? void 0 : SXP_CONFIG.meta_conversion_api_pid);
518
+ window === null || window === void 0 ? void 0 : window.fbq('consent', 'grant');
508
519
  if (fbcRef.current && !(beForeactiveGroups === null || beForeactiveGroups === void 0 ? void 0 : beForeactiveGroups.includes('4'))) {
509
520
  }
510
521
  }
511
522
  else {
523
+ window === null || window === void 0 ? void 0 : window.fbq('consent', 'revoke');
512
524
  fbcRef.current = (0, tool_1.getCookie)('_fbp');
513
- function extractRootDomain(hostname) {
514
- if (!hostname || hostname.indexOf('.') === -1) {
515
- return '';
516
- }
517
- const parts = hostname.split('.');
518
- if (parts.length >= 2) {
519
- return '.' + parts.slice(-2).join('.');
520
- }
521
- return '';
522
- }
523
525
  (0, tool_1.deleteCookie)('_fbp', '/', extractRootDomain(window.location.hostname));
524
526
  const item = data[activeIndex];
525
527
  const traceInfo = ((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.traceInfo) || ((_b = item === null || item === void 0 ? void 0 : item.product) === null || _b === void 0 ? void 0 : _b.traceInfo) || '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.19.1",
3
+ "version": "1.19.3",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",