pb-sxp-ui 1.19.0 → 1.19.2

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,11 +485,23 @@ 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);
502
+ if (!(activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.includes('4'))) {
503
+ deleteCookie('_fbp', '/', extractRootDomain(window.location.hostname));
504
+ }
493
505
  }
494
506
  };
495
507
  const handleClick = (event) => {
@@ -505,29 +517,21 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
505
517
  if (fbcRef.current && !(beForeactiveGroups === null || beForeactiveGroups === void 0 ? void 0 : beForeactiveGroups.includes('4'))) {
506
518
  }
507
519
  }
508
- else if (beForeactiveGroups === null || beForeactiveGroups === void 0 ? void 0 : beForeactiveGroups.includes('4')) {
520
+ else {
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) || '';
523
- bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
524
- eventInfo: {
525
- eventSubject: 'refuseCookie',
526
- eventDescription: 'refuseCookie',
527
- traceInfo
528
- },
529
- isActiveTargetingCookie: false
530
- });
525
+ if (beForeactiveGroups === null || beForeactiveGroups === void 0 ? void 0 : beForeactiveGroups.includes('4')) {
526
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
527
+ eventInfo: {
528
+ eventSubject: 'refuseCookie',
529
+ eventDescription: 'refuseCookie',
530
+ traceInfo
531
+ },
532
+ isActiveTargetingCookie: false
533
+ });
534
+ }
531
535
  }
532
536
  };
533
537
  }
@@ -488,11 +488,23 @@ 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);
505
+ if (!(activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.includes('4'))) {
506
+ (0, tool_1.deleteCookie)('_fbp', '/', extractRootDomain(window.location.hostname));
507
+ }
496
508
  }
497
509
  };
498
510
  const handleClick = (event) => {
@@ -508,29 +520,21 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
508
520
  if (fbcRef.current && !(beForeactiveGroups === null || beForeactiveGroups === void 0 ? void 0 : beForeactiveGroups.includes('4'))) {
509
521
  }
510
522
  }
511
- else if (beForeactiveGroups === null || beForeactiveGroups === void 0 ? void 0 : beForeactiveGroups.includes('4')) {
523
+ else {
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) || '';
526
- bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
527
- eventInfo: {
528
- eventSubject: 'refuseCookie',
529
- eventDescription: 'refuseCookie',
530
- traceInfo
531
- },
532
- isActiveTargetingCookie: false
533
- });
528
+ if (beForeactiveGroups === null || beForeactiveGroups === void 0 ? void 0 : beForeactiveGroups.includes('4')) {
529
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
530
+ eventInfo: {
531
+ eventSubject: 'refuseCookie',
532
+ eventDescription: 'refuseCookie',
533
+ traceInfo
534
+ },
535
+ isActiveTargetingCookie: false
536
+ });
537
+ }
534
538
  }
535
539
  };
536
540
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.19.0",
3
+ "version": "1.19.2",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",