pb-sxp-ui 1.0.52 → 1.0.54

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.
Files changed (38) hide show
  1. package/dist/index.cjs +72 -23
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +1 -1
  4. package/dist/index.js +72 -23
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +3 -3
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +3 -3
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +72 -23
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +3 -3
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/SxpPageCore/index.d.ts +1 -0
  15. package/es/core/components/SxpPageCore/index.js +2 -2
  16. package/es/core/components/SxpPageRender/Popup/index.js +1 -1
  17. package/es/core/components/SxpPageRender/VideoWidget/index.js +10 -2
  18. package/es/core/components/SxpPageRender/index.js +11 -2
  19. package/es/core/context/SxpDataSourceProvider.d.ts +7 -0
  20. package/es/core/context/SxpDataSourceProvider.js +15 -2
  21. package/es/materials/sxp/popup/AppointForm/index.d.ts +1 -0
  22. package/es/materials/sxp/popup/AppointForm/index.js +14 -9
  23. package/es/materials/sxp/popup/CommodityDetail/index.js +8 -1
  24. package/es/materials/sxp/popup/CommodityDetailDiro/index.js +8 -1
  25. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +8 -1
  26. package/lib/core/components/SxpPageCore/index.d.ts +1 -0
  27. package/lib/core/components/SxpPageCore/index.js +2 -2
  28. package/lib/core/components/SxpPageRender/Popup/index.js +1 -1
  29. package/lib/core/components/SxpPageRender/VideoWidget/index.js +10 -2
  30. package/lib/core/components/SxpPageRender/index.js +11 -2
  31. package/lib/core/context/SxpDataSourceProvider.d.ts +7 -0
  32. package/lib/core/context/SxpDataSourceProvider.js +15 -2
  33. package/lib/materials/sxp/popup/AppointForm/index.d.ts +1 -0
  34. package/lib/materials/sxp/popup/AppointForm/index.js +14 -9
  35. package/lib/materials/sxp/popup/CommodityDetail/index.js +8 -1
  36. package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +8 -1
  37. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +8 -1
  38. package/package.json +1 -1
@@ -8,6 +8,7 @@ export interface ISxpPageCoreProps {
8
8
  loadingImage?: string;
9
9
  appDomain?: string;
10
10
  licenseUrl?: String;
11
+ enabledMetaConversionApi?: boolean;
11
12
  }
12
13
  declare const _default: React.NamedExoticComponent<ISxpPageCoreProps>;
13
14
  export default _default;
@@ -8,7 +8,7 @@ const RESOLVER = {};
8
8
  Object.values(_materials_).forEach((v) => {
9
9
  RESOLVER[v.extend.type] = v;
10
10
  });
11
- const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl }) => {
11
+ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl, enabledMetaConversionApi }) => {
12
12
  var _a, _b, _c, _d, _e, _f;
13
13
  const utmVal = useMemo(() => {
14
14
  var _a;
@@ -16,7 +16,7 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
16
16
  return searchParams;
17
17
  }, []);
18
18
  return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
19
- React.createElement(SxpDataSourceProvider, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, render: ({ rtcList, tagList }) => {
19
+ React.createElement(SxpDataSourceProvider, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, render: ({ rtcList, tagList }) => {
20
20
  var _a;
21
21
  return (React.createElement(React.Fragment, null,
22
22
  React.createElement(SxpPageRender, Object.assign({}, (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER, licenseUrl: licenseUrl })),
@@ -50,7 +50,7 @@ const Popup = () => {
50
50
  const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
51
51
  const Component = withBindDataSource(t);
52
52
  const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
53
- return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.style), { width: '100%', height: '80vh', overflow: 'auto' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.textStyle), bindDatas: (_f = (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.bindDatas) !== null && _f !== void 0 ? _f : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.props, { event: ((_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id })));
53
+ return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.style), { width: '100%', height: '80vh', overflow: 'auto' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.textStyle), bindDatas: (_f = (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.bindDatas) !== null && _f !== void 0 ? _f : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.props, { event: ((_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, onClose: handleClose })));
54
54
  }
55
55
  else {
56
56
  return React.createElement(React.Fragment, null);
@@ -6,7 +6,7 @@ import { useSxpDataSource } from '../../../../core/hooks';
6
6
  import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../../core/utils/event';
7
7
  const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef }) => {
8
8
  const [isPauseVideo, setIsPauseVideo] = useState(false);
9
- const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
9
+ const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport } = useSxpDataSource();
10
10
  const videoStartTime = useRef(0);
11
11
  const [isLoadFinish, setIsLoadFinish] = useState(false);
12
12
  const [isFirstPlay, setIsFirstPlay] = useState(true);
@@ -207,6 +207,9 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
207
207
  if (!videoRef || !isLoadFinish)
208
208
  return;
209
209
  if (isActive) {
210
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
211
+ eventName: 'ViewContent'
212
+ });
210
213
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
211
214
  }
212
215
  else {
@@ -227,7 +230,12 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
227
230
  useEffect(() => {
228
231
  if (!isActive)
229
232
  return;
230
- const onShow = handleClickVideo('start');
233
+ const onShow = () => {
234
+ handleClickVideo('start')();
235
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
236
+ eventName: 'ViewContent'
237
+ });
238
+ };
231
239
  const onHide = handleClickVideo('pause');
232
240
  SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
233
241
  SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
@@ -32,7 +32,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
32
32
  const viewTime = useRef();
33
33
  const [isLoadMore, setIsLoadMore] = useState(false);
34
34
  const [isShowMore, setIsShowMore] = useState(false);
35
- const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData } = useSxpDataSource();
35
+ const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport } = useSxpDataSource();
36
36
  const [videoRef, setVideoRef] = useState(null);
37
37
  const playerRef = useRef();
38
38
  const { productView } = useEventReport();
@@ -63,8 +63,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
63
63
  requestId: null
64
64
  }
65
65
  });
66
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
67
+ eventName: 'PageView'
68
+ });
66
69
  setIsInit(true);
67
- }, [bffEventReport, data.length]);
70
+ }, [bffEventReport, data.length, bffFbReport]);
68
71
  const initTime = () => {
69
72
  curTime.current = new Date();
70
73
  viewTime.current = new Date();
@@ -320,6 +323,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
320
323
  var _a, _b, _c;
321
324
  if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && !((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls) && (item === null || item === void 0 ? void 0 : item.product)) {
322
325
  productView(item, item.product, (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.bindCta, viewTime.current, activeIndex);
326
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
327
+ eventName: 'ProductView'
328
+ });
323
329
  }
324
330
  };
325
331
  useEffect(() => {
@@ -346,6 +352,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
346
352
  traceInfo: item.video.traceInfo
347
353
  }
348
354
  });
355
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
356
+ eventName: 'ViewContent'
357
+ });
349
358
  }
350
359
  };
351
360
  const visList = useMemo(() => {
@@ -64,6 +64,12 @@ export interface ISxpDataSourceContext {
64
64
  setLoading?: React.Dispatch<React.SetStateAction<boolean>>;
65
65
  videoRef?: any;
66
66
  setVideoRef?: React.Dispatch<React.SetStateAction<any>>;
67
+ bffFbReport?: (body: {
68
+ eventName: string;
69
+ actionSource?: string;
70
+ eventSourceUrl?: string;
71
+ externalId?: string;
72
+ }) => Promise<any> | undefined | boolean;
67
73
  }
68
74
  export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
69
75
  export interface SxpDataSourceProviderProps {
@@ -94,6 +100,7 @@ export interface SxpDataSourceProviderProps {
94
100
  appDomain?: string;
95
101
  loadingImage?: string;
96
102
  isOpenHashTag?: boolean;
103
+ enabledMetaConversionApi?: boolean;
97
104
  }
98
105
  declare const _default: React.NamedExoticComponent<SxpDataSourceProviderProps>;
99
106
  export default _default;
@@ -13,7 +13,7 @@ var DataSourceType;
13
13
  DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
14
14
  })(DataSourceType || (DataSourceType = {}));
15
15
  const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
16
- const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false }) => {
16
+ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false }) => {
17
17
  const [rtcList, setRtcList] = useState([]);
18
18
  const [tagList, setTagList] = useState([]);
19
19
  const [loading, setLoading] = useState(false);
@@ -117,6 +117,18 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
117
117
  type: 'beacon'
118
118
  });
119
119
  }, [bffFetch, curReqInfo, enableReportEvent]);
120
+ const bffFbReport = useCallback((_a) => {
121
+ var _b;
122
+ var { eventName, actionSource = 'website', eventSourceUrl = (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href, externalId } = _a;
123
+ if (!enableReportEvent || !enabledMetaConversionApi) {
124
+ return;
125
+ }
126
+ return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/fb/events', {
127
+ method: 'POST',
128
+ body: { eventName, actionSource, eventSourceUrl, 'userData.externalId': externalId },
129
+ type: 'beacon'
130
+ });
131
+ }, [bffFetch, enableReportEvent, enabledMetaConversionApi]);
120
132
  const bffMutateLike = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
121
133
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/like', { method: 'POST', body }));
122
134
  return res === null || res === void 0 ? void 0 : res.success;
@@ -223,7 +235,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
223
235
  tagList,
224
236
  setLoading,
225
237
  videoRef,
226
- setVideoRef
238
+ setVideoRef,
239
+ bffFbReport
227
240
  } }, render({
228
241
  rtcList,
229
242
  mutateLike: bffMutateLike,
@@ -13,6 +13,7 @@ export interface IAppointFormProps {
13
13
  submitEmail?: string;
14
14
  layoutType?: 'horizontal' | 'vertical' | 'inline';
15
15
  onClick?: () => void;
16
+ onClose?: () => void;
16
17
  }
17
18
  declare const _default: React.NamedExoticComponent<IAppointFormProps>;
18
19
  export default _default;
@@ -6,7 +6,7 @@ import { cloneDeep, debounce } from 'lodash';
6
6
  import { useSxpDataSource } from '../../../../core/hooks';
7
7
  import './index.less';
8
8
  const AppointForm = (_a) => {
9
- var { columns, style, title, textStyle, submitBgColor, submitColor, submitText, layoutType, onClick } = _a, props = __rest(_a, ["columns", "style", "title", "textStyle", "submitBgColor", "submitColor", "submitText", "layoutType", "onClick"]);
9
+ var { columns, style, title, textStyle, submitBgColor, submitColor, submitText, layoutType, onClick, onClose } = _a, props = __rest(_a, ["columns", "style", "title", "textStyle", "submitBgColor", "submitColor", "submitText", "layoutType", "onClick", "onClose"]);
10
10
  const { submitForm } = useSxpDataSource();
11
11
  const formRef = useRef();
12
12
  const [loading, setLoading] = useState(false);
@@ -47,19 +47,24 @@ const AppointForm = (_a) => {
47
47
  }, [layoutType, columns, defaultColumns]);
48
48
  const handleSubmit = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
49
49
  var _b, _c, _d;
50
- setLoading(true);
51
50
  const vals = yield ((_b = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _b === void 0 ? void 0 : _b.getFieldsValue());
52
- const arr = (_d = (_c = Object.keys(vals)) === null || _c === void 0 ? void 0 : _c.map((key) => ({
53
- name: key,
54
- value: vals[key]
55
- }))) === null || _d === void 0 ? void 0 : _d.filter((item) => item === null || item === void 0 ? void 0 : item.value);
51
+ if (!vals)
52
+ return;
53
+ const arr = (_d = (_c = Object.keys(vals)) === null || _c === void 0 ? void 0 : _c.map((key) => {
54
+ var _a;
55
+ return ({
56
+ name: key,
57
+ value: (_a = vals[key]) !== null && _a !== void 0 ? _a : ''
58
+ });
59
+ })) === null || _d === void 0 ? void 0 : _d.filter((item) => item === null || item === void 0 ? void 0 : item.value);
56
60
  if (!arr || !(arr === null || arr === void 0 ? void 0 : arr.length))
57
61
  return;
58
- const res = yield (submitForm === null || submitForm === void 0 ? void 0 : submitForm({ attributes: arr }));
62
+ setLoading(true);
63
+ const res = (yield (submitForm === null || submitForm === void 0 ? void 0 : submitForm({ attributes: arr })));
59
64
  setLoading(false);
60
65
  if (res) {
61
- window === null || window === void 0 ? void 0 : window.sxpPopup('');
62
- res && (onClick === null || onClick === void 0 ? void 0 : onClick());
66
+ onClose === null || onClose === void 0 ? void 0 : onClose();
67
+ onClick === null || onClick === void 0 ? void 0 : onClick();
63
68
  }
64
69
  }), 1000);
65
70
  return (React.createElement("div", { className: 'pb-appoint-form' },
@@ -13,7 +13,7 @@ const CommodityDetail = (_a) => {
13
13
  var _b, _c, _d, _e, _f, _g, _h, _j, _k;
14
14
  var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index"]);
15
15
  const { sxpParameter } = useSxpDataSource();
16
- const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
16
+ const { popupDetailData, bffEventReport, isPreview, bffFbReport } = useSxpDataSource();
17
17
  const { jumpToWeb, productView } = useEventReport();
18
18
  const curTimeRef = useRef(null);
19
19
  const [showModal, setShowModal] = useState(false);
@@ -30,6 +30,13 @@ const CommodityDetail = (_a) => {
30
30
  window.location.href = window.getJointUtmLink(product.link);
31
31
  }
32
32
  };
33
+ useEffect(() => {
34
+ if (!isPost) {
35
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
36
+ eventName: 'ProductView'
37
+ });
38
+ }
39
+ }, [isPost, bffFbReport]);
33
40
  useEffect(() => {
34
41
  const initTime = () => {
35
42
  curTimeRef.current = new Date();
@@ -13,7 +13,7 @@ const CommodityDetailDiro = (_a) => {
13
13
  var { style, isDefault, rec, viewTime, isPost, bottom_image, index } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "index"]);
14
14
  const [spread, setSpread] = useState(true);
15
15
  const { sxpParameter } = useSxpDataSource();
16
- const { popupDetailData, bffEventReport, isPreview, swiperRef, waterFallData } = useSxpDataSource();
16
+ const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
17
17
  const { jumpToWeb, productView } = useEventReport();
18
18
  const scrollRef = useRef(null);
19
19
  const touchRef = useRef(null);
@@ -35,6 +35,13 @@ const CommodityDetailDiro = (_a) => {
35
35
  window.location.href = window.getJointUtmLink(product.link);
36
36
  }
37
37
  };
38
+ useEffect(() => {
39
+ if (!isPost) {
40
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
41
+ eventName: 'ProductView'
42
+ });
43
+ }
44
+ }, [isPost, bffFbReport]);
38
45
  useEffect(() => {
39
46
  const initTime = () => {
40
47
  curTimeRef.current = new Date();
@@ -14,7 +14,7 @@ const CommodityDetailDiroNew = (_a) => {
14
14
  var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index"]);
15
15
  const [spread, setSpread] = useState(true);
16
16
  const { sxpParameter } = useSxpDataSource();
17
- const { popupDetailData, bffEventReport, isPreview, swiperRef, waterFallData } = useSxpDataSource();
17
+ const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
18
18
  const { jumpToWeb, productView } = useEventReport();
19
19
  const scrollRef = useRef(null);
20
20
  const touchRef = useRef(null);
@@ -37,6 +37,13 @@ const CommodityDetailDiroNew = (_a) => {
37
37
  window.location.href = window.getJointUtmLink(product.link);
38
38
  }
39
39
  };
40
+ useEffect(() => {
41
+ if (!isPost) {
42
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
43
+ eventName: 'ProductView'
44
+ });
45
+ }
46
+ }, [isPost, bffFbReport]);
40
47
  useEffect(() => {
41
48
  const initTime = () => {
42
49
  curTimeRef.current = new Date();
@@ -8,6 +8,7 @@ export interface ISxpPageCoreProps {
8
8
  loadingImage?: string;
9
9
  appDomain?: string;
10
10
  licenseUrl?: String;
11
+ enabledMetaConversionApi?: boolean;
11
12
  }
12
13
  declare const _default: React.NamedExoticComponent<ISxpPageCoreProps>;
13
14
  export default _default;
@@ -11,7 +11,7 @@ const RESOLVER = {};
11
11
  Object.values(_materials_).forEach((v) => {
12
12
  RESOLVER[v.extend.type] = v;
13
13
  });
14
- const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl }) => {
14
+ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl, enabledMetaConversionApi }) => {
15
15
  var _a, _b, _c, _d, _e, _f;
16
16
  const utmVal = (0, react_1.useMemo)(() => {
17
17
  var _a;
@@ -19,7 +19,7 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
19
19
  return searchParams;
20
20
  }, []);
21
21
  return (react_1.default.createElement(core_1.EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
22
- react_1.default.createElement(SxpDataSourceProvider_1.default, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, render: ({ rtcList, tagList }) => {
22
+ react_1.default.createElement(SxpDataSourceProvider_1.default, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, render: ({ rtcList, tagList }) => {
23
23
  var _a;
24
24
  return (react_1.default.createElement(react_1.default.Fragment, null,
25
25
  react_1.default.createElement(SxpPageRender_1.default, Object.assign({}, (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER, licenseUrl: licenseUrl })),
@@ -53,7 +53,7 @@ const Popup = () => {
53
53
  const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
54
54
  const Component = (0, withBindDataSource_1.default)(t);
55
55
  const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
56
- return (react_1.default.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.style), { width: '100%', height: '80vh', overflow: 'auto' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.textStyle), bindDatas: (_f = (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.bindDatas) !== null && _f !== void 0 ? _f : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.props, { event: ((_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id })));
56
+ return (react_1.default.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.style), { width: '100%', height: '80vh', overflow: 'auto' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.textStyle), bindDatas: (_f = (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.bindDatas) !== null && _f !== void 0 ? _f : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.props, { event: ((_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, onClose: handleClose })));
57
57
  }
58
58
  else {
59
59
  return react_1.default.createElement(react_1.default.Fragment, null);
@@ -9,7 +9,7 @@ const hooks_1 = require("../../../../core/hooks");
9
9
  const event_1 = tslib_1.__importStar(require("../../../../core/utils/event"));
10
10
  const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef }) => {
11
11
  const [isPauseVideo, setIsPauseVideo] = (0, react_1.useState)(false);
12
- const { bffEventReport, sxpParameter, waterFallData, openHashtag } = (0, hooks_1.useSxpDataSource)();
12
+ const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport } = (0, hooks_1.useSxpDataSource)();
13
13
  const videoStartTime = (0, react_1.useRef)(0);
14
14
  const [isLoadFinish, setIsLoadFinish] = (0, react_1.useState)(false);
15
15
  const [isFirstPlay, setIsFirstPlay] = (0, react_1.useState)(true);
@@ -210,6 +210,9 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
210
210
  if (!videoRef || !isLoadFinish)
211
211
  return;
212
212
  if (isActive) {
213
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
214
+ eventName: 'ViewContent'
215
+ });
213
216
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
214
217
  }
215
218
  else {
@@ -230,7 +233,12 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
230
233
  (0, react_1.useEffect)(() => {
231
234
  if (!isActive)
232
235
  return;
233
- const onShow = handleClickVideo('start');
236
+ const onShow = () => {
237
+ handleClickVideo('start')();
238
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
239
+ eventName: 'ViewContent'
240
+ });
241
+ };
234
242
  const onHide = handleClickVideo('pause');
235
243
  event_1.default.on(event_1.SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
236
244
  event_1.default.on(event_1.SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
@@ -35,7 +35,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
35
35
  const viewTime = (0, react_1.useRef)();
36
36
  const [isLoadMore, setIsLoadMore] = (0, react_1.useState)(false);
37
37
  const [isShowMore, setIsShowMore] = (0, react_1.useState)(false);
38
- const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData } = (0, hooks_1.useSxpDataSource)();
38
+ const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport } = (0, hooks_1.useSxpDataSource)();
39
39
  const [videoRef, setVideoRef] = (0, react_1.useState)(null);
40
40
  const playerRef = (0, react_1.useRef)();
41
41
  const { productView } = (0, useEventReport_1.useEventReport)();
@@ -66,8 +66,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
66
66
  requestId: null
67
67
  }
68
68
  });
69
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
70
+ eventName: 'PageView'
71
+ });
69
72
  setIsInit(true);
70
- }, [bffEventReport, data.length]);
73
+ }, [bffEventReport, data.length, bffFbReport]);
71
74
  const initTime = () => {
72
75
  curTime.current = new Date();
73
76
  viewTime.current = new Date();
@@ -323,6 +326,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
323
326
  var _a, _b, _c;
324
327
  if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && !((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls) && (item === null || item === void 0 ? void 0 : item.product)) {
325
328
  productView(item, item.product, (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.bindCta, viewTime.current, activeIndex);
329
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
330
+ eventName: 'ProductView'
331
+ });
326
332
  }
327
333
  };
328
334
  (0, react_1.useEffect)(() => {
@@ -349,6 +355,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
349
355
  traceInfo: item.video.traceInfo
350
356
  }
351
357
  });
358
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
359
+ eventName: 'ViewContent'
360
+ });
352
361
  }
353
362
  };
354
363
  const visList = (0, react_1.useMemo)(() => {
@@ -64,6 +64,12 @@ export interface ISxpDataSourceContext {
64
64
  setLoading?: React.Dispatch<React.SetStateAction<boolean>>;
65
65
  videoRef?: any;
66
66
  setVideoRef?: React.Dispatch<React.SetStateAction<any>>;
67
+ bffFbReport?: (body: {
68
+ eventName: string;
69
+ actionSource?: string;
70
+ eventSourceUrl?: string;
71
+ externalId?: string;
72
+ }) => Promise<any> | undefined | boolean;
67
73
  }
68
74
  export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
69
75
  export interface SxpDataSourceProviderProps {
@@ -94,6 +100,7 @@ export interface SxpDataSourceProviderProps {
94
100
  appDomain?: string;
95
101
  loadingImage?: string;
96
102
  isOpenHashTag?: boolean;
103
+ enabledMetaConversionApi?: boolean;
97
104
  }
98
105
  declare const _default: React.NamedExoticComponent<SxpDataSourceProviderProps>;
99
106
  export default _default;
@@ -16,7 +16,7 @@ var DataSourceType;
16
16
  DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
17
17
  })(DataSourceType || (DataSourceType = {}));
18
18
  const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
19
- const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false }) => {
19
+ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false }) => {
20
20
  const [rtcList, setRtcList] = (0, react_1.useState)([]);
21
21
  const [tagList, setTagList] = (0, react_1.useState)([]);
22
22
  const [loading, setLoading] = (0, react_1.useState)(false);
@@ -120,6 +120,18 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
120
120
  type: 'beacon'
121
121
  });
122
122
  }, [bffFetch, curReqInfo, enableReportEvent]);
123
+ const bffFbReport = (0, react_1.useCallback)((_a) => {
124
+ var _b;
125
+ var { eventName, actionSource = 'website', eventSourceUrl = (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href, externalId } = _a;
126
+ if (!enableReportEvent || !enabledMetaConversionApi) {
127
+ return;
128
+ }
129
+ return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/fb/events', {
130
+ method: 'POST',
131
+ body: { eventName, actionSource, eventSourceUrl, 'userData.externalId': externalId },
132
+ type: 'beacon'
133
+ });
134
+ }, [bffFetch, enableReportEvent, enabledMetaConversionApi]);
123
135
  const bffMutateLike = (0, react_1.useCallback)((body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
124
136
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/like', { method: 'POST', body }));
125
137
  return res === null || res === void 0 ? void 0 : res.success;
@@ -226,7 +238,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
226
238
  tagList,
227
239
  setLoading,
228
240
  videoRef,
229
- setVideoRef
241
+ setVideoRef,
242
+ bffFbReport
230
243
  } }, render({
231
244
  rtcList,
232
245
  mutateLike: bffMutateLike,
@@ -13,6 +13,7 @@ export interface IAppointFormProps {
13
13
  submitEmail?: string;
14
14
  layoutType?: 'horizontal' | 'vertical' | 'inline';
15
15
  onClick?: () => void;
16
+ onClose?: () => void;
16
17
  }
17
18
  declare const _default: React.NamedExoticComponent<IAppointFormProps>;
18
19
  export default _default;
@@ -8,7 +8,7 @@ const lodash_1 = require("lodash");
8
8
  const hooks_1 = require("../../../../core/hooks");
9
9
  require("./index.less");
10
10
  const AppointForm = (_a) => {
11
- var { columns, style, title, textStyle, submitBgColor, submitColor, submitText, layoutType, onClick } = _a, props = tslib_1.__rest(_a, ["columns", "style", "title", "textStyle", "submitBgColor", "submitColor", "submitText", "layoutType", "onClick"]);
11
+ var { columns, style, title, textStyle, submitBgColor, submitColor, submitText, layoutType, onClick, onClose } = _a, props = tslib_1.__rest(_a, ["columns", "style", "title", "textStyle", "submitBgColor", "submitColor", "submitText", "layoutType", "onClick", "onClose"]);
12
12
  const { submitForm } = (0, hooks_1.useSxpDataSource)();
13
13
  const formRef = (0, react_1.useRef)();
14
14
  const [loading, setLoading] = (0, react_1.useState)(false);
@@ -49,19 +49,24 @@ const AppointForm = (_a) => {
49
49
  }, [layoutType, columns, defaultColumns]);
50
50
  const handleSubmit = (0, lodash_1.debounce)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
51
51
  var _b, _c, _d;
52
- setLoading(true);
53
52
  const vals = yield ((_b = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _b === void 0 ? void 0 : _b.getFieldsValue());
54
- const arr = (_d = (_c = Object.keys(vals)) === null || _c === void 0 ? void 0 : _c.map((key) => ({
55
- name: key,
56
- value: vals[key]
57
- }))) === null || _d === void 0 ? void 0 : _d.filter((item) => item === null || item === void 0 ? void 0 : item.value);
53
+ if (!vals)
54
+ return;
55
+ const arr = (_d = (_c = Object.keys(vals)) === null || _c === void 0 ? void 0 : _c.map((key) => {
56
+ var _a;
57
+ return ({
58
+ name: key,
59
+ value: (_a = vals[key]) !== null && _a !== void 0 ? _a : ''
60
+ });
61
+ })) === null || _d === void 0 ? void 0 : _d.filter((item) => item === null || item === void 0 ? void 0 : item.value);
58
62
  if (!arr || !(arr === null || arr === void 0 ? void 0 : arr.length))
59
63
  return;
60
- const res = yield (submitForm === null || submitForm === void 0 ? void 0 : submitForm({ attributes: arr }));
64
+ setLoading(true);
65
+ const res = (yield (submitForm === null || submitForm === void 0 ? void 0 : submitForm({ attributes: arr })));
61
66
  setLoading(false);
62
67
  if (res) {
63
- window === null || window === void 0 ? void 0 : window.sxpPopup('');
64
- res && (onClick === null || onClick === void 0 ? void 0 : onClick());
68
+ onClose === null || onClose === void 0 ? void 0 : onClose();
69
+ onClick === null || onClick === void 0 ? void 0 : onClick();
65
70
  }
66
71
  }), 1000);
67
72
  return (react_1.default.createElement("div", { className: 'pb-appoint-form' },
@@ -15,7 +15,7 @@ const CommodityDetail = (_a) => {
15
15
  var _b, _c, _d, _e, _f, _g, _h, _j, _k;
16
16
  var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index"]);
17
17
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
18
- const { popupDetailData, bffEventReport, isPreview, waterFallData } = (0, hooks_1.useSxpDataSource)();
18
+ const { popupDetailData, bffEventReport, isPreview, bffFbReport } = (0, hooks_1.useSxpDataSource)();
19
19
  const { jumpToWeb, productView } = (0, useEventReport_1.useEventReport)();
20
20
  const curTimeRef = (0, react_1.useRef)(null);
21
21
  const [showModal, setShowModal] = (0, react_1.useState)(false);
@@ -32,6 +32,13 @@ const CommodityDetail = (_a) => {
32
32
  window.location.href = window.getJointUtmLink(product.link);
33
33
  }
34
34
  };
35
+ (0, react_1.useEffect)(() => {
36
+ if (!isPost) {
37
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
38
+ eventName: 'ProductView'
39
+ });
40
+ }
41
+ }, [isPost, bffFbReport]);
35
42
  (0, react_1.useEffect)(() => {
36
43
  const initTime = () => {
37
44
  curTimeRef.current = new Date();
@@ -15,7 +15,7 @@ const CommodityDetailDiro = (_a) => {
15
15
  var { style, isDefault, rec, viewTime, isPost, bottom_image, index } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "index"]);
16
16
  const [spread, setSpread] = (0, react_1.useState)(true);
17
17
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
18
- const { popupDetailData, bffEventReport, isPreview, swiperRef, waterFallData } = (0, hooks_1.useSxpDataSource)();
18
+ const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = (0, hooks_1.useSxpDataSource)();
19
19
  const { jumpToWeb, productView } = (0, useEventReport_1.useEventReport)();
20
20
  const scrollRef = (0, react_1.useRef)(null);
21
21
  const touchRef = (0, react_1.useRef)(null);
@@ -37,6 +37,13 @@ const CommodityDetailDiro = (_a) => {
37
37
  window.location.href = window.getJointUtmLink(product.link);
38
38
  }
39
39
  };
40
+ (0, react_1.useEffect)(() => {
41
+ if (!isPost) {
42
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
43
+ eventName: 'ProductView'
44
+ });
45
+ }
46
+ }, [isPost, bffFbReport]);
40
47
  (0, react_1.useEffect)(() => {
41
48
  const initTime = () => {
42
49
  curTimeRef.current = new Date();
@@ -16,7 +16,7 @@ const CommodityDetailDiroNew = (_a) => {
16
16
  var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index"]);
17
17
  const [spread, setSpread] = (0, react_1.useState)(true);
18
18
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
19
- const { popupDetailData, bffEventReport, isPreview, swiperRef, waterFallData } = (0, hooks_1.useSxpDataSource)();
19
+ const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = (0, hooks_1.useSxpDataSource)();
20
20
  const { jumpToWeb, productView } = (0, useEventReport_1.useEventReport)();
21
21
  const scrollRef = (0, react_1.useRef)(null);
22
22
  const touchRef = (0, react_1.useRef)(null);
@@ -39,6 +39,13 @@ const CommodityDetailDiroNew = (_a) => {
39
39
  window.location.href = window.getJointUtmLink(product.link);
40
40
  }
41
41
  };
42
+ (0, react_1.useEffect)(() => {
43
+ if (!isPost) {
44
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
45
+ eventName: 'ProductView'
46
+ });
47
+ }
48
+ }, [isPost, bffFbReport]);
42
49
  (0, react_1.useEffect)(() => {
43
50
  const initTime = () => {
44
51
  curTimeRef.current = new Date();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.0.52",
3
+ "version": "1.0.54",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",