pb-sxp-ui 1.15.31 → 1.15.32

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.
@@ -380,7 +380,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
380
380
  return jsonParams;
381
381
  }, [fakeUserId]);
382
382
  const bffFbReport = useCallback(({ eventName, product }) => {
383
- var _a, _b, _c, _d, _e, _f;
383
+ var _a, _b, _c, _d, _e, _f, _g, _h;
384
384
  if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
385
385
  return;
386
386
  }
@@ -413,25 +413,27 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
413
413
  window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
414
414
  }
415
415
  const tiktokPixelEventParamsJson = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.tiktokPixel) === null || _b === void 0 ? void 0 : _b[eventName];
416
- if ((tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.ttq) === 'function') {
417
- window === null || window === void 0 ? void 0 : window.ttq.track(tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name, tiktokPixelEventParamsJson);
416
+ if ((tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name) &&
417
+ typeof (window === null || window === void 0 ? void 0 : window.ttq) === 'object' &&
418
+ typeof ((_c = window === null || window === void 0 ? void 0 : window.ttq) === null || _c === void 0 ? void 0 : _c.track) === 'function') {
419
+ (_d = window === null || window === void 0 ? void 0 : window.ttq) === null || _d === void 0 ? void 0 : _d.track(tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name, tiktokPixelEventParamsJson);
418
420
  }
419
- const snapchatPixelEventParamsJson = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.snapchatPixel) === null || _c === void 0 ? void 0 : _c[eventName];
421
+ const snapchatPixelEventParamsJson = (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.snapchatPixel) === null || _e === void 0 ? void 0 : _e[eventName];
420
422
  if ((snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.snaptr) === 'function') {
421
423
  window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, snapchatPixelEventParamsJson);
422
424
  }
423
- const converApiEventParamsJson = (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _d === void 0 ? void 0 : _d[eventName];
425
+ const converApiEventParamsJson = (_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _f === void 0 ? void 0 : _f[eventName];
424
426
  if (enabledMetaConversionApi && converApiEventParamsJson) {
425
427
  const body = getEventParamsByJson(converApiEventParamsJson, product);
426
428
  const params = {};
427
429
  const queryString = location.search.slice(1);
428
- (_e = splitUrlParams(queryString)) === null || _e === void 0 ? void 0 : _e.forEach((val) => {
430
+ (_g = splitUrlParams(queryString)) === null || _g === void 0 ? void 0 : _g.forEach((val) => {
429
431
  const key = val.split('=')[0];
430
432
  const value = val.split('=')[1];
431
433
  params[key] = value;
432
434
  });
433
435
  const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
434
- bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_f = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _f === void 0 ? void 0 : _f['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
436
+ bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_h = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _h === void 0 ? void 0 : _h['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
435
437
  method: 'POST',
436
438
  body,
437
439
  type: 'beacon'
@@ -383,7 +383,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
383
383
  return jsonParams;
384
384
  }, [fakeUserId]);
385
385
  const bffFbReport = (0, react_1.useCallback)(({ eventName, product }) => {
386
- var _a, _b, _c, _d, _e, _f;
386
+ var _a, _b, _c, _d, _e, _f, _g, _h;
387
387
  if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
388
388
  return;
389
389
  }
@@ -416,25 +416,27 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
416
416
  window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
417
417
  }
418
418
  const tiktokPixelEventParamsJson = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.tiktokPixel) === null || _b === void 0 ? void 0 : _b[eventName];
419
- if ((tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.ttq) === 'function') {
420
- window === null || window === void 0 ? void 0 : window.ttq.track(tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name, tiktokPixelEventParamsJson);
419
+ if ((tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name) &&
420
+ typeof (window === null || window === void 0 ? void 0 : window.ttq) === 'object' &&
421
+ typeof ((_c = window === null || window === void 0 ? void 0 : window.ttq) === null || _c === void 0 ? void 0 : _c.track) === 'function') {
422
+ (_d = window === null || window === void 0 ? void 0 : window.ttq) === null || _d === void 0 ? void 0 : _d.track(tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name, tiktokPixelEventParamsJson);
421
423
  }
422
- const snapchatPixelEventParamsJson = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.snapchatPixel) === null || _c === void 0 ? void 0 : _c[eventName];
424
+ const snapchatPixelEventParamsJson = (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.snapchatPixel) === null || _e === void 0 ? void 0 : _e[eventName];
423
425
  if ((snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.snaptr) === 'function') {
424
426
  window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, snapchatPixelEventParamsJson);
425
427
  }
426
- const converApiEventParamsJson = (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _d === void 0 ? void 0 : _d[eventName];
428
+ const converApiEventParamsJson = (_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _f === void 0 ? void 0 : _f[eventName];
427
429
  if (enabledMetaConversionApi && converApiEventParamsJson) {
428
430
  const body = getEventParamsByJson(converApiEventParamsJson, product);
429
431
  const params = {};
430
432
  const queryString = location.search.slice(1);
431
- (_e = (0, tool_1.splitUrlParams)(queryString)) === null || _e === void 0 ? void 0 : _e.forEach((val) => {
433
+ (_g = (0, tool_1.splitUrlParams)(queryString)) === null || _g === void 0 ? void 0 : _g.forEach((val) => {
432
434
  const key = val.split('=')[0];
433
435
  const value = val.split('=')[1];
434
436
  params[key] = value;
435
437
  });
436
438
  const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
437
- bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_f = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _f === void 0 ? void 0 : _f['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
439
+ bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_h = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _h === void 0 ? void 0 : _h['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
438
440
  method: 'POST',
439
441
  body,
440
442
  type: 'beacon'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.15.31",
3
+ "version": "1.15.32",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",