pb-sxp-ui 1.20.4 → 1.20.5

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.
@@ -265,6 +265,25 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
265
265
  navigatorWithBeacon.sendBeacon = originalSendBeacon;
266
266
  };
267
267
  }, [bffCollectEvent]);
268
+ useEffect(() => {
269
+ const originalFormSubmit = HTMLFormElement.prototype.submit;
270
+ HTMLFormElement.prototype.submit = function () {
271
+ const form = this;
272
+ if (form.action.includes('facebook.com/tr')) {
273
+ const formData = new FormData(form);
274
+ const params = {};
275
+ for (const [key, value] of formData.entries()) {
276
+ params[key] = value;
277
+ }
278
+ bffCollectEvent({
279
+ eventName: params === null || params === void 0 ? void 0 : params.ev,
280
+ eventSource: 'Meta Pixel'
281
+ });
282
+ return originalFormSubmit.call(form);
283
+ }
284
+ return originalFormSubmit.call(form);
285
+ };
286
+ }, []);
268
287
  useEffect(() => {
269
288
  const _originalFetch = window.fetch;
270
289
  window.fetch = function (input, init) {
@@ -115,8 +115,8 @@ const CommodityDetail = (_a) => {
115
115
  contentType: 'product',
116
116
  view_time: new Date() - curTimeRef.current
117
117
  });
118
- SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, () => onShow());
119
- SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, () => onHide());
118
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW);
119
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE);
120
120
  };
121
121
  }, [isActive, isPost, bffFbReport, data, product, position, curTimeRef]);
122
122
  useEffect(() => {
@@ -119,8 +119,8 @@ const CommodityDetailDiroNew = (_a) => {
119
119
  contentType: 'product',
120
120
  view_time: new Date() - curTimeRef.current
121
121
  });
122
- SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, () => onShow());
123
- SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, () => onHide());
122
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW);
123
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE);
124
124
  };
125
125
  }, [isActive, isPost, bffFbReport, data, product, position, curTimeRef]);
126
126
  useEffect(() => {
@@ -268,6 +268,25 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
268
268
  navigatorWithBeacon.sendBeacon = originalSendBeacon;
269
269
  };
270
270
  }, [bffCollectEvent]);
271
+ (0, react_1.useEffect)(() => {
272
+ const originalFormSubmit = HTMLFormElement.prototype.submit;
273
+ HTMLFormElement.prototype.submit = function () {
274
+ const form = this;
275
+ if (form.action.includes('facebook.com/tr')) {
276
+ const formData = new FormData(form);
277
+ const params = {};
278
+ for (const [key, value] of formData.entries()) {
279
+ params[key] = value;
280
+ }
281
+ bffCollectEvent({
282
+ eventName: params === null || params === void 0 ? void 0 : params.ev,
283
+ eventSource: 'Meta Pixel'
284
+ });
285
+ return originalFormSubmit.call(form);
286
+ }
287
+ return originalFormSubmit.call(form);
288
+ };
289
+ }, []);
271
290
  (0, react_1.useEffect)(() => {
272
291
  const _originalFetch = window.fetch;
273
292
  window.fetch = function (input, init) {
@@ -117,8 +117,8 @@ const CommodityDetail = (_a) => {
117
117
  contentType: 'product',
118
118
  view_time: new Date() - curTimeRef.current
119
119
  });
120
- event_1.default.off(event_1.SXP_EVENT_TYPE.PAGE_DID_SHOW, () => onShow());
121
- event_1.default.off(event_1.SXP_EVENT_TYPE.PAGE_DID_HIDE, () => onHide());
120
+ event_1.default.off(event_1.SXP_EVENT_TYPE.PAGE_DID_SHOW);
121
+ event_1.default.off(event_1.SXP_EVENT_TYPE.PAGE_DID_HIDE);
122
122
  };
123
123
  }, [isActive, isPost, bffFbReport, data, product, position, curTimeRef]);
124
124
  (0, react_1.useEffect)(() => {
@@ -121,8 +121,8 @@ const CommodityDetailDiroNew = (_a) => {
121
121
  contentType: 'product',
122
122
  view_time: new Date() - curTimeRef.current
123
123
  });
124
- event_1.default.off(event_1.SXP_EVENT_TYPE.PAGE_DID_SHOW, () => onShow());
125
- event_1.default.off(event_1.SXP_EVENT_TYPE.PAGE_DID_HIDE, () => onHide());
124
+ event_1.default.off(event_1.SXP_EVENT_TYPE.PAGE_DID_SHOW);
125
+ event_1.default.off(event_1.SXP_EVENT_TYPE.PAGE_DID_HIDE);
126
126
  };
127
127
  }, [isActive, isPost, bffFbReport, data, product, position, curTimeRef]);
128
128
  (0, react_1.useEffect)(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.20.4",
3
+ "version": "1.20.5",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",