pb-sxp-ui 1.15.29 → 1.15.30

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.
@@ -68,6 +68,8 @@ export interface ISxpPageRenderProps {
68
68
  };
69
69
  converApi?: any;
70
70
  pixel?: any;
71
+ tiktokPixel?: any;
72
+ snapchatPixel?: any;
71
73
  consentPopup?: any;
72
74
  multiPosts?: any;
73
75
  playbook?: 'paid media' | 'organic menu';
@@ -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;
383
+ var _a, _b, _c, _d, _e, _f;
384
384
  if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
385
385
  return;
386
386
  }
@@ -412,18 +412,26 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
412
412
  else if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.gtag) === 'function') {
413
413
  window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
414
414
  }
415
- const converApiEventParamsJson = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _b === void 0 ? void 0 : _b[eventName];
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);
418
+ }
419
+ const snapchatPixelEventParamsJson = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.tiktokPixel) === null || _c === void 0 ? void 0 : _c[eventName];
420
+ if ((snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.snaptr) === 'function') {
421
+ window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, snapchatPixelEventParamsJson);
422
+ }
423
+ const converApiEventParamsJson = (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _d === void 0 ? void 0 : _d[eventName];
416
424
  if (enabledMetaConversionApi && converApiEventParamsJson) {
417
425
  const body = getEventParamsByJson(converApiEventParamsJson, product);
418
426
  const params = {};
419
427
  const queryString = location.search.slice(1);
420
- (_c = splitUrlParams(queryString)) === null || _c === void 0 ? void 0 : _c.forEach((val) => {
428
+ (_e = splitUrlParams(queryString)) === null || _e === void 0 ? void 0 : _e.forEach((val) => {
421
429
  const key = val.split('=')[0];
422
430
  const value = val.split('=')[1];
423
431
  params[key] = value;
424
432
  });
425
433
  const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
426
- bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_d = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _d === void 0 ? void 0 : _d['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(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)}` : ''}`, {
427
435
  method: 'POST',
428
436
  body,
429
437
  type: 'beacon'
@@ -68,6 +68,8 @@ export interface ISxpPageRenderProps {
68
68
  };
69
69
  converApi?: any;
70
70
  pixel?: any;
71
+ tiktokPixel?: any;
72
+ snapchatPixel?: any;
71
73
  consentPopup?: any;
72
74
  multiPosts?: any;
73
75
  playbook?: 'paid media' | 'organic menu';
@@ -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;
386
+ var _a, _b, _c, _d, _e, _f;
387
387
  if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
388
388
  return;
389
389
  }
@@ -415,18 +415,26 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
415
415
  else if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.gtag) === 'function') {
416
416
  window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
417
417
  }
418
- const converApiEventParamsJson = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _b === void 0 ? void 0 : _b[eventName];
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);
421
+ }
422
+ const snapchatPixelEventParamsJson = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.tiktokPixel) === null || _c === void 0 ? void 0 : _c[eventName];
423
+ if ((snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.snaptr) === 'function') {
424
+ window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, snapchatPixelEventParamsJson);
425
+ }
426
+ const converApiEventParamsJson = (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _d === void 0 ? void 0 : _d[eventName];
419
427
  if (enabledMetaConversionApi && converApiEventParamsJson) {
420
428
  const body = getEventParamsByJson(converApiEventParamsJson, product);
421
429
  const params = {};
422
430
  const queryString = location.search.slice(1);
423
- (_c = (0, tool_1.splitUrlParams)(queryString)) === null || _c === void 0 ? void 0 : _c.forEach((val) => {
431
+ (_e = (0, tool_1.splitUrlParams)(queryString)) === null || _e === void 0 ? void 0 : _e.forEach((val) => {
424
432
  const key = val.split('=')[0];
425
433
  const value = val.split('=')[1];
426
434
  params[key] = value;
427
435
  });
428
436
  const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
429
- bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_d = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _d === void 0 ? void 0 : _d['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(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)}` : ''}`, {
430
438
  method: 'POST',
431
439
  body,
432
440
  type: 'beacon'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.15.29",
3
+ "version": "1.15.30",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",