pb-sxp-ui 1.20.13 → 1.20.15

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 (62) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +111 -111
  3. package/dist/index.cjs +1187 -383
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.css +73 -72
  6. package/dist/index.js +1187 -384
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.min.cjs +7 -7
  9. package/dist/index.min.cjs.map +1 -1
  10. package/dist/index.min.js +7 -7
  11. package/dist/index.min.js.map +1 -1
  12. package/dist/pb-ui.js +1187 -383
  13. package/dist/pb-ui.js.map +1 -1
  14. package/dist/pb-ui.min.js +7 -7
  15. package/dist/pb-ui.min.js.map +1 -1
  16. package/es/core/components/DiyPortalPreview/VideoWidget.js +10 -8
  17. package/es/core/components/DiyStoryPreview/index.js +10 -4
  18. package/es/core/components/StructurePage/index.d.ts +89 -0
  19. package/es/core/components/StructurePage/index.js +700 -0
  20. package/es/core/components/SxpPageRender/LikeButton/index.js +20 -18
  21. package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -0
  22. package/es/core/components/SxpPageRender/PictureGroup/index.js +39 -13
  23. package/es/core/components/SxpPageRender/VideoWidget/index.js +33 -46
  24. package/es/core/components/SxpPageRender/WaterFall/index.js +4 -3
  25. package/es/core/components/SxpPageRender/fakeData.js +1 -1
  26. package/es/core/components/SxpPageRender/index.js +66 -44
  27. package/es/core/context/SxpDataSourceProvider.d.ts +5 -12
  28. package/es/core/context/SxpDataSourceProvider.js +84 -38
  29. package/es/core/hooks/useEventReport.js +6 -5
  30. package/es/core/hooks/useVisibleHeight.js +7 -7
  31. package/es/core/index.d.ts +2 -0
  32. package/es/core/index.js +1 -0
  33. package/es/core/utils/materials.d.ts +1 -1
  34. package/es/index.d.ts +1 -0
  35. package/es/index.js +1 -0
  36. package/es/materials/sxp/MultiPosts/index.js +4 -4
  37. package/es/materials/sxp/popup/CommodityDetail/index.js +4 -4
  38. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
  39. package/lib/core/components/DiyPortalPreview/VideoWidget.js +10 -8
  40. package/lib/core/components/DiyStoryPreview/index.js +10 -4
  41. package/lib/core/components/StructurePage/index.d.ts +89 -0
  42. package/lib/core/components/StructurePage/index.js +702 -0
  43. package/lib/core/components/SxpPageRender/LikeButton/index.js +20 -18
  44. package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -0
  45. package/lib/core/components/SxpPageRender/PictureGroup/index.js +38 -12
  46. package/lib/core/components/SxpPageRender/VideoWidget/index.js +33 -46
  47. package/lib/core/components/SxpPageRender/WaterFall/index.js +4 -3
  48. package/lib/core/components/SxpPageRender/fakeData.js +1 -1
  49. package/lib/core/components/SxpPageRender/index.js +66 -44
  50. package/lib/core/context/SxpDataSourceProvider.d.ts +5 -12
  51. package/lib/core/context/SxpDataSourceProvider.js +84 -38
  52. package/lib/core/hooks/useEventReport.js +6 -5
  53. package/lib/core/hooks/useVisibleHeight.js +7 -7
  54. package/lib/core/index.d.ts +2 -0
  55. package/lib/core/index.js +6 -1
  56. package/lib/core/utils/materials.d.ts +1 -1
  57. package/lib/index.d.ts +1 -0
  58. package/lib/index.js +3 -1
  59. package/lib/materials/sxp/MultiPosts/index.js +4 -4
  60. package/lib/materials/sxp/popup/CommodityDetail/index.js +4 -4
  61. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
  62. package/package.json +111 -111
@@ -23,6 +23,7 @@ exports.DEFAULT_TAG = 'FOR U';
23
23
  const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isOpenConsent = false, isEditor = false, utmParameter, channelQueryList, data, dataList, isDiyH5, onUpdateSchema, onUpdateChannel }) => {
24
24
  var _a, _b, _c, _d, _e;
25
25
  const [rtcList, setRtcList] = (0, react_1.useState)([]);
26
+ const [firstRtcList, setFirstRtcList] = (0, react_1.useState)([]);
26
27
  const [tagList, setTagList] = (0, react_1.useState)([]);
27
28
  const [loading, setLoading] = (0, react_1.useState)(true);
28
29
  const [curReqInfo, setCurReqInfo] = (0, react_1.useState)({ rtc: '', requestId: '' });
@@ -32,6 +33,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
32
33
  const [popupDetailData, setPopupDetailData] = (0, react_1.useState)();
33
34
  const [waterFallData, setWaterFallData] = (0, react_1.useState)();
34
35
  const [openHashtag, setOpenHashtag] = (0, react_1.useState)(isOpenHashTag);
36
+ if (typeof window !== 'undefined') {
37
+ window.setPopupDetailData = setPopupDetailData;
38
+ }
35
39
  const [cacheRtcList, setCacheRtcList] = (0, react_1.useState)([]);
36
40
  const [cacheActiveIndex, setCacheActiveIndex] = (0, react_1.useState)(0);
37
41
  const [isFromHashtag, setIsFromHashtag] = (0, react_1.useState)(false);
@@ -53,6 +57,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
53
57
  const [chatlabsId, setChatlabsId] = (0, react_1.useState)();
54
58
  const finalPageData = (0, react_1.useMemo)(() => pageData !== null && pageData !== void 0 ? pageData : data, [pageData, data]);
55
59
  const pixelPvStatusRef = (0, react_1.useRef)(false);
60
+ const isDiyPage = (0, react_1.useMemo)(() => {
61
+ var _a, _b, _c;
62
+ return isDiyH5 && !((_c = (_b = (_a = finalPageData === null || finalPageData === void 0 ? void 0 : finalPageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf) === null || _b === void 0 ? void 0 : _b.globalConfig) === null || _c === void 0 ? void 0 : _c.enablePreview);
63
+ }, [isDiyH5, finalPageData]);
56
64
  (0, react_1.useEffect)(() => {
57
65
  var _a, _b;
58
66
  setGlobalConfig((_b = (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf) === null || _b === void 0 ? void 0 : _b.globalConfig);
@@ -147,7 +155,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
147
155
  return false;
148
156
  };
149
157
  const bffFetch = (0, react_1.useCallback)((path, options, isBota = true) => {
150
- var _a;
158
+ var _a, _b;
151
159
  if (!bffDataSource)
152
160
  return;
153
161
  const url = bffDataSource.url;
@@ -162,8 +170,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
162
170
  const value = val.split('=')[1];
163
171
  params[key] = value;
164
172
  });
173
+ options.body = Object.assign(Object.assign({}, options.body), { productUserId: fakeUserId });
165
174
  return window
166
- .fetch(`${url}/api/${path}`, Object.assign({ headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId }, bffDataSource.headers), method: options.method, body: options.type === 'beacon' && isBota
175
+ .fetch(`${url}/api/${path}`, Object.assign({ headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId, 'tenant-id': (_b = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _b === void 0 ? void 0 : _b['x-app-id'] }, bffDataSource.headers), method: options.method, body: options.type === 'beacon' && isBota
167
176
  ? JSON.stringify({
168
177
  body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
169
178
  })
@@ -421,8 +430,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
421
430
  .catch((err) => Promise.reject(err));
422
431
  }, [bffDataSource]);
423
432
  const getRecommendVideos = (0, react_1.useCallback)((query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
424
- var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
425
- query = Object.assign(Object.assign({ maxSize: (_f = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _f !== void 0 ? _f : maxSize, defaultSize: (_g = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _g !== void 0 ? _g : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag, pageNum: query === null || query === void 0 ? void 0 : query.pageNum, contentFilter: query === null || query === void 0 ? void 0 : query.contentFilter, productFilter: query === null || query === void 0 ? void 0 : query.productFilter }, (chatlabsId && { chatlabsId })), (isDiyH5 && { type: 'story' }));
433
+ var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
434
+ query = Object.assign(Object.assign({ maxSize: (_f = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _f !== void 0 ? _f : maxSize, defaultSize: (_g = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _g !== void 0 ? _g : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag, pageNum: query === null || query === void 0 ? void 0 : query.pageNum, contentFilter: query === null || query === void 0 ? void 0 : query.contentFilter, productFilter: query === null || query === void 0 ? void 0 : query.productFilter }, (chatlabsId && { chatlabsId })), (isDiyPage && { type: 'story' }));
426
435
  if (channel) {
427
436
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
428
437
  }
@@ -435,9 +444,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
435
444
  if (val)
436
445
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
437
446
  }
447
+ const isDiy = isDiyH5 && ((_o = (_m = (_l = finalPageData === null || finalPageData === void 0 ? void 0 : finalPageData.data) === null || _l === void 0 ? void 0 : _l.sxpPageConf) === null || _m === void 0 ? void 0 : _m.globalConfig) === null || _o === void 0 ? void 0 : _o.enablePreview);
438
448
  if (isEditor) {
439
449
  let pageNum = 1;
440
- query = Object.assign(Object.assign(Object.assign({}, query), { directPage: true, level: 1 }), (!utmVal && channelQueryList && (channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList.length) > 0 && { channel: channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList[0] }));
450
+ query = Object.assign(Object.assign(Object.assign(Object.assign({}, query), { directPage: true, level: 1 }), (!utmVal && channelQueryList && (channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList.length) > 0 && { channel: channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList[0] })), (isDiy && { maxRecs: query === null || query === void 0 ? void 0 : query.maxSize }));
441
451
  if (!(query === null || query === void 0 ? void 0 : query.channel) || isInit.current) {
442
452
  return undefined;
443
453
  }
@@ -445,19 +455,24 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
445
455
  let list = [];
446
456
  let result = null;
447
457
  const recurveRecList = (query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
448
- var _v, _w, _x, _y, _z, _0;
458
+ var _y, _z, _0, _1, _2, _3;
449
459
  query.pageNum = pageNum;
450
- result = yield (bffFetchAdmin === null || bffFetchAdmin === void 0 ? void 0 : bffFetchAdmin('recommend/direct_page', { method: 'POST', body: query }));
460
+ result = isDiyH5
461
+ ? yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v3/recommend/direct/page/view', { method: 'POST', body: query }))
462
+ : yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/direct_page', { method: 'POST', body: query }));
451
463
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
452
464
  return undefined;
453
465
  }
454
466
  setLoading(false);
455
- list = list.concat((_y = (_x = (_w = (_v = result === null || result === void 0 ? void 0 : result.data) === null || _v === void 0 ? void 0 : _v.recList) === null || _w === void 0 ? void 0 : _w.filter) === null || _x === void 0 ? void 0 : _x.call(_w, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _y !== void 0 ? _y : []);
467
+ list = list.concat((_1 = (_0 = (_z = (_y = result === null || result === void 0 ? void 0 : result.data) === null || _y === void 0 ? void 0 : _y.recList) === null || _z === void 0 ? void 0 : _z.filter) === null || _0 === void 0 ? void 0 : _0.call(_z, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _1 !== void 0 ? _1 : []);
456
468
  if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
457
469
  setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
458
470
  setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
471
+ if (isDiyPage) {
472
+ setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
473
+ }
459
474
  }
460
- const isNotNullList = (_0 = (_z = result === null || result === void 0 ? void 0 : result.data) === null || _z === void 0 ? void 0 : _z.recList) === null || _0 === void 0 ? void 0 : _0.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
475
+ const isNotNullList = (_3 = (_2 = result === null || result === void 0 ? void 0 : result.data) === null || _2 === void 0 ? void 0 : _2.recList) === null || _3 === void 0 ? void 0 : _3.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
461
476
  if (isNotNullList) {
462
477
  pageNum = pageNum + 1;
463
478
  yield recurveRecList(query);
@@ -465,42 +480,61 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
465
480
  });
466
481
  yield recurveRecList(query);
467
482
  if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
468
- setCurReqInfo({ rtc: (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.rtc, requestId: (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.requestId });
483
+ setCurReqInfo({ rtc: (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.rtc, requestId: (_q = result === null || result === void 0 ? void 0 : result.data) === null || _q === void 0 ? void 0 : _q.requestId });
469
484
  return Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list });
470
485
  }
471
486
  if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
472
- query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_o = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _o !== void 0 ? _o : 1 });
487
+ query = Object.assign(Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_r = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _r !== void 0 ? _r : 1 }), (isDiy && { maxRecs: query === null || query === void 0 ? void 0 : query.maxSize }));
473
488
  }
474
- const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', {
475
- method: 'POST',
476
- body: query
477
- }));
489
+ const result = isDiy
490
+ ? yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v3/recommend/direct/page/view', { method: 'POST', body: query }))
491
+ : yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', {
492
+ method: 'POST',
493
+ body: query
494
+ }));
478
495
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
479
496
  return undefined;
480
497
  }
481
498
  if (!(query === null || query === void 0 ? void 0 : query.hashTag))
482
499
  setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
483
500
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
484
- const isNotNullList = (_q = (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.recList) === null || _q === void 0 ? void 0 : _q.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
501
+ const isNotNullList = (_t = (_s = result === null || result === void 0 ? void 0 : result.data) === null || _s === void 0 ? void 0 : _s.recList) === null || _t === void 0 ? void 0 : _t.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
485
502
  if (!isNotNullList) {
486
503
  setIsNoMoreData(true);
487
504
  }
488
505
  }
489
506
  let list = [];
490
- list = list.concat((_u = (_t = (_s = (_r = result === null || result === void 0 ? void 0 : result.data) === null || _r === void 0 ? void 0 : _r.recList) === null || _s === void 0 ? void 0 : _s.filter) === null || _t === void 0 ? void 0 : _t.call(_s, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _u !== void 0 ? _u : []);
507
+ list = list.concat((_x = (_w = (_v = (_u = result === null || result === void 0 ? void 0 : result.data) === null || _u === void 0 ? void 0 : _u.recList) === null || _v === void 0 ? void 0 : _v.filter) === null || _w === void 0 ? void 0 : _w.call(_v, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _x !== void 0 ? _x : []);
491
508
  return Object.assign(Object.assign({}, result.data), { recList: list });
492
- }), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin]);
509
+ }), [
510
+ bffFetch,
511
+ utmVal,
512
+ maxSize,
513
+ defaultSize,
514
+ channelQueryList,
515
+ channel,
516
+ chatlabsId,
517
+ bffFetchAdmin,
518
+ isDiyPage,
519
+ finalPageData,
520
+ isDiyH5
521
+ ]);
493
522
  const loadVideos = (0, react_1.useCallback)((pageNum) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
494
- var _1, _2, _3, _4;
523
+ var _4, _5, _6, _7;
495
524
  if (rtcList.length <= 0) {
496
525
  return;
497
526
  }
527
+ if (isDiyPage && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
528
+ setRtcList(rtcList.concat(firstRtcList));
529
+ setCacheRtcList(cacheRtcList.concat(firstRtcList));
530
+ return;
531
+ }
498
532
  const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
499
- const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _1 === void 0 ? void 0 : _1.itemId) && { productFilter: [(_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _2 === void 0 ? void 0 : _2.itemId] })), (((_3 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _3 === void 0 ? void 0 : _3.itemId) && { contentFilter: [(_4 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _4 === void 0 ? void 0 : _4.itemId] })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
533
+ const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_4 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _4 === void 0 ? void 0 : _4.itemId) && { productFilter: [(_5 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _5 === void 0 ? void 0 : _5.itemId] })), (((_6 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _6 === void 0 ? void 0 : _6.itemId) && { contentFilter: [(_7 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _7 === void 0 ? void 0 : _7.itemId] })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
500
534
  setRtcList(rtcList.concat(getFilterRecList(data)));
501
535
  setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
502
536
  return data;
503
- }), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
537
+ }), [getRecommendVideos, rtcList, waterFallData, cacheRtcList, isDiyPage, firstRtcList]);
504
538
  const refreshFeSession = (0, react_1.useCallback)((enableReSid, event) => {
505
539
  var _a, _b, _c, _d, _e;
506
540
  let expire = false;
@@ -528,7 +562,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
528
562
  return;
529
563
  }
530
564
  if (!userInfo) {
531
- userInfo = {};
565
+ userInfo = {
566
+ productUserId: fakeUserId
567
+ };
532
568
  }
533
569
  const sessionID = (0, sessionStore_1.storeAndLoadFeSessionId)();
534
570
  const params = {};
@@ -561,7 +597,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
561
597
  layoutVariantId,
562
598
  globalConfig,
563
599
  playbookType,
564
- bffDataSource
600
+ bffDataSource,
601
+ fakeUserId
565
602
  ]);
566
603
  const getEventParamsByJson = (0, react_1.useCallback)((_a) => {
567
604
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
@@ -742,37 +779,39 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
742
779
  }
743
780
  }, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
744
781
  const bffMutateLike = (0, react_1.useCallback)((body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
782
+ body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
745
783
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
746
784
  return res === null || res === void 0 ? void 0 : res.success;
747
- }), [bffFetch]);
785
+ }), [bffFetch, fakeUserId]);
748
786
  const bffMutateUnlike = (0, react_1.useCallback)((body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
787
+ body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
749
788
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/unlike', { method: 'POST', body }));
750
789
  return res === null || res === void 0 ? void 0 : res.success;
751
- }), [bffFetch]);
790
+ }), [bffFetch, fakeUserId]);
752
791
  const bffSubmitForm = (0, react_1.useCallback)((body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
753
792
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/customform', { method: 'POST', body }));
754
793
  return res === null || res === void 0 ? void 0 : res.success;
755
794
  }), [bffFetch]);
756
795
  const bffGetTagList = (0, react_1.useCallback)((data) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
757
- var _5, _6, _7, _8, _9, _10, _11, _12;
758
- const isShowTag = !!((_7 = (_6 = (_5 = data === null || data === void 0 ? void 0 : data.data) === null || _5 === void 0 ? void 0 : _5.sxpPageConf) === null || _6 === void 0 ? void 0 : _6.globalConfig) === null || _7 === void 0 ? void 0 : _7.isShowTag);
796
+ var _8, _9, _10, _11, _12, _13, _14, _15;
797
+ const isShowTag = !!((_10 = (_9 = (_8 = data === null || data === void 0 ? void 0 : data.data) === null || _8 === void 0 ? void 0 : _8.sxpPageConf) === null || _9 === void 0 ? void 0 : _9.globalConfig) === null || _10 === void 0 ? void 0 : _10.isShowTag);
759
798
  if (!utmVal || !isShowTag)
760
799
  return;
761
800
  try {
762
- const val = (_10 = (_9 = (_8 = (0, tool_1.splitUrlParams)(utmVal)) === null || _8 === void 0 ? void 0 : _8.filter((val) => {
801
+ const val = (_13 = (_12 = (_11 = (0, tool_1.splitUrlParams)(utmVal)) === null || _11 === void 0 ? void 0 : _11.filter((val) => {
763
802
  var _a, _b;
764
803
  const key = val.split('=')[0];
765
804
  return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
766
- })) === null || _9 === void 0 ? void 0 : _9.join('&')) !== null && _10 !== void 0 ? _10 : '';
805
+ })) === null || _12 === void 0 ? void 0 : _12.join('&')) !== null && _13 !== void 0 ? _13 : '';
767
806
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
768
- setTagList((_12 = (_11 = result === null || result === void 0 ? void 0 : result.data) === null || _11 === void 0 ? void 0 : _11.tags) !== null && _12 !== void 0 ? _12 : []);
807
+ setTagList((_15 = (_14 = result === null || result === void 0 ? void 0 : result.data) === null || _14 === void 0 ? void 0 : _14.tags) !== null && _15 !== void 0 ? _15 : []);
769
808
  }
770
809
  catch (e) {
771
810
  console.log('e', e);
772
811
  }
773
812
  }), [bffFetch, utmVal]);
774
813
  const ctaEvent = (0, react_1.useCallback)((eventInfo, rec, product, position, ctaActionType, targetUrl, contentType) => {
775
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
814
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14;
776
815
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
777
816
  const isProd = ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) || (((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProducts) && ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProducts) === null || _d === void 0 ? void 0 : _d.length) > 0);
778
817
  let fromKName = '';
@@ -790,7 +829,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
790
829
  }
791
830
  const contentTags = (_p = (_m = (_h = product === null || product === void 0 ? void 0 : product.tags) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : (_q = rec === null || rec === void 0 ? void 0 : rec.product) === null || _q === void 0 ? void 0 : _q.tags;
792
831
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
793
- eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_10 = (_7 = (_2 = (_y = (_v = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _v !== void 0 ? _v : (_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_1 = (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindProduct) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : (_6 = (_5 = (_4 = (_3 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _3 === void 0 ? void 0 : _3.bindProducts) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.bindCta) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_9 = (_8 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : '', fromKName, fromKPage: (_11 = location === null || location === void 0 ? void 0 : location.href) !== null && _11 !== void 0 ? _11 : '', contentFormat })
832
+ eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '', sceneId: (_x = (_w = (_v = rec === null || rec === void 0 ? void 0 : rec.video) === null || _v === void 0 ? void 0 : _v.scene) === null || _w === void 0 ? void 0 : _w.sceneId) !== null && _x !== void 0 ? _x : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_13 = (_10 = (_5 = (_1 = (_y = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _y !== void 0 ? _y : (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindCta) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : (_4 = (_3 = (_2 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _2 === void 0 ? void 0 : _2.bindProduct) === null || _3 === void 0 ? void 0 : _3.bindCta) === null || _4 === void 0 ? void 0 : _4.traceInfo) !== null && _5 !== void 0 ? _5 : (_9 = (_8 = (_7 = (_6 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _6 === void 0 ? void 0 : _6.bindProducts) === null || _7 === void 0 ? void 0 : _7[0]) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : (_12 = (_11 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _11 === void 0 ? void 0 : _11.bindCta) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : '', fromKName, fromKPage: (_14 = location === null || location === void 0 ? void 0 : location.href) !== null && _14 !== void 0 ? _14 : '', contentFormat })
794
833
  });
795
834
  }, [bffEventReport, isFromHashtag]);
796
835
  const h5EnterLink = (0, react_1.useCallback)(() => {
@@ -814,10 +853,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
814
853
  });
815
854
  }, [bffEventReport]);
816
855
  const getAccount = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
817
- var _13, _14;
856
+ var _16, _17;
818
857
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account', { method: 'GET' }));
819
- setChatlabsId((_13 = res === null || res === void 0 ? void 0 : res.data) === null || _13 === void 0 ? void 0 : _13.chatLabsId);
820
- return ((_14 = res === null || res === void 0 ? void 0 : res.data) === null || _14 === void 0 ? void 0 : _14.consentResult) === 'true';
858
+ setChatlabsId((_16 = res === null || res === void 0 ? void 0 : res.data) === null || _16 === void 0 ? void 0 : _16.chatLabsId);
859
+ return ((_17 = res === null || res === void 0 ? void 0 : res.data) === null || _17 === void 0 ? void 0 : _17.consentResult) === 'true';
821
860
  }), [bffFetch]);
822
861
  const accountSonsent = (0, react_1.useCallback)((consentResult) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
823
862
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account/consent', {
@@ -881,6 +920,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
881
920
  }
882
921
  setRtcList(list);
883
922
  setCacheRtcList(list);
923
+ if (isDiyPage) {
924
+ setFirstRtcList(list);
925
+ }
884
926
  bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
885
927
  if (channel) {
886
928
  const item = list === null || list === void 0 ? void 0 : list[0];
@@ -900,7 +942,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
900
942
  });
901
943
  setLoading(false);
902
944
  });
903
- }, [isShowConsent, channel]);
945
+ }, [isShowConsent, channel, isDiyPage]);
904
946
  (0, react_1.useEffect)(() => {
905
947
  if (!isPreview)
906
948
  return;
@@ -915,12 +957,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
915
957
  }
916
958
  setRtcList(list);
917
959
  setCacheRtcList(list);
960
+ if (isDiyPage) {
961
+ setFirstRtcList(list);
962
+ }
918
963
  }
919
964
  })
920
965
  .finally(() => {
921
966
  setLoading(false);
922
967
  });
923
- }, [getRecommendVideos, bffGetTagList, channel]);
968
+ }, [getRecommendVideos, bffGetTagList, channel, isDiyPage]);
924
969
  const defaultLoadingImage = (0, useIconLink_1.useIconLink)('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
925
970
  return (react_1.default.createElement(exports.SxpDataSourceContext.Provider, { value: {
926
971
  rtcList,
@@ -978,7 +1023,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
978
1023
  refreshFeSession,
979
1024
  getAccount,
980
1025
  accountSonsent,
981
- isDiyH5,
1026
+ isDiyH5: isDiyPage,
1027
+ firstRtcList,
982
1028
  pixelPvStatusRef
983
1029
  } }, isShowConsent ? (react_1.default.createElement(Consent_1.default, Object.assign({}, (_e = (_d = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.props))) : (render({
984
1030
  rtcList,
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useEventReport = void 0;
4
4
  const react_1 = require("react");
5
- const useSxpDataSource_1 = require("./useSxpDataSource");
6
5
  const SxpDataSourceProvider_1 = require("../context/SxpDataSourceProvider");
6
+ const useSxpDataSource_1 = require("./useSxpDataSource");
7
7
  function useEventReport() {
8
8
  const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = (0, useSxpDataSource_1.useSxpDataSource)();
9
9
  const jumpToWeb = (0, react_1.useCallback)((e, data, product, cta, position, traceInfo) => {
10
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13;
10
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16;
11
11
  const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
12
12
  if (i !== -1) {
13
13
  return;
@@ -40,11 +40,11 @@ function useEventReport() {
40
40
  contentFormat = 'image';
41
41
  }
42
42
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
43
- eventInfo: Object.assign({ eventSubject: 'jumpToWeb', eventDescription: 'User jumped to website', productId: (_v = product === null || product === void 0 ? void 0 : product.itemId) !== null && _v !== void 0 ? _v : '', productName: (_w = product === null || product === void 0 ? void 0 : product.title) !== null && _w !== void 0 ? _w : '', price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0', productCollection: (_x = product === null || product === void 0 ? void 0 : product.collection) !== null && _x !== void 0 ? _x : '', fromKName, fromKPage: location === null || location === void 0 ? void 0 : location.href, contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '', ctatId: (_0 = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _0 !== void 0 ? _0 : '', traceInfo: (_13 = (_10 = (_8 = (_4 = (_1 = traceInfo !== null && traceInfo !== void 0 ? traceInfo : product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _1 !== void 0 ? _1 : (_3 = (_2 = data === null || data === void 0 ? void 0 : data.video) === null || _2 === void 0 ? void 0 : _2.bindProduct) === null || _3 === void 0 ? void 0 : _3.traceInfo) !== null && _4 !== void 0 ? _4 : (_7 = (_6 = (_5 = data === null || data === void 0 ? void 0 : data.video) === null || _5 === void 0 ? void 0 : _5.bindProducts) === null || _6 === void 0 ? void 0 : _6[0]) === null || _7 === void 0 ? void 0 : _7.traceInfo) !== null && _8 !== void 0 ? _8 : (_9 = data === null || data === void 0 ? void 0 : data.product) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : (_12 = (_11 = data === null || data === void 0 ? void 0 : data.video) === null || _11 === void 0 ? void 0 : _11.bindCta) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : '' }, (contentFormat && { contentFormat }))
43
+ eventInfo: Object.assign({ eventSubject: 'jumpToWeb', eventDescription: 'User jumped to website', productId: (_v = product === null || product === void 0 ? void 0 : product.itemId) !== null && _v !== void 0 ? _v : '', productName: (_w = product === null || product === void 0 ? void 0 : product.title) !== null && _w !== void 0 ? _w : '', price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0', productCollection: (_x = product === null || product === void 0 ? void 0 : product.collection) !== null && _x !== void 0 ? _x : '', fromKName, fromKPage: location === null || location === void 0 ? void 0 : location.href, contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '', sceneId: (_2 = (_1 = (_0 = data === null || data === void 0 ? void 0 : data.video) === null || _0 === void 0 ? void 0 : _0.scene) === null || _1 === void 0 ? void 0 : _1.sceneId) !== null && _2 !== void 0 ? _2 : '', ctatId: (_3 = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _3 !== void 0 ? _3 : '', traceInfo: (_16 = (_13 = (_11 = (_7 = (_4 = traceInfo !== null && traceInfo !== void 0 ? traceInfo : product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _4 !== void 0 ? _4 : (_6 = (_5 = data === null || data === void 0 ? void 0 : data.video) === null || _5 === void 0 ? void 0 : _5.bindProduct) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_10 = (_9 = (_8 = data === null || data === void 0 ? void 0 : data.video) === null || _8 === void 0 ? void 0 : _8.bindProducts) === null || _9 === void 0 ? void 0 : _9[0]) === null || _10 === void 0 ? void 0 : _10.traceInfo) !== null && _11 !== void 0 ? _11 : (_12 = data === null || data === void 0 ? void 0 : data.product) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : (_15 = (_14 = data === null || data === void 0 ? void 0 : data.video) === null || _14 === void 0 ? void 0 : _14.bindCta) === null || _15 === void 0 ? void 0 : _15.traceInfo) !== null && _16 !== void 0 ? _16 : '' }, (contentFormat && { contentFormat }))
44
44
  });
45
45
  }, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
46
46
  const productView = (0, react_1.useCallback)((data, product, cta, viewTime, position) => {
47
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
47
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
48
48
  let fromKName = '';
49
49
  if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
50
50
  fromKName = 'pdpPage';
@@ -63,8 +63,9 @@ function useEventReport() {
63
63
  contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
64
64
  position: position + '',
65
65
  contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
66
+ sceneId: (_g = (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
66
67
  ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
67
- traceInfo: (_p = (_m = (_h = (_e = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _e !== void 0 ? _e : (_g = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct) === null || _g === void 0 ? void 0 : _g.traceInfo) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.traceInfo) !== null && _m !== void 0 ? _m : (_o = data === null || data === void 0 ? void 0 : data.product) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : '',
68
+ traceInfo: (_s = (_q = (_l = (_h = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _h !== void 0 ? _h : (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProduct) === null || _k === void 0 ? void 0 : _k.traceInfo) !== null && _l !== void 0 ? _l : (_p = (_o = (_m = data === null || data === void 0 ? void 0 : data.video) === null || _m === void 0 ? void 0 : _m.bindProducts) === null || _o === void 0 ? void 0 : _o[0]) === null || _p === void 0 ? void 0 : _p.traceInfo) !== null && _q !== void 0 ? _q : (_r = data === null || data === void 0 ? void 0 : data.product) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : '',
68
69
  timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
69
70
  eventSubject: 'productView',
70
71
  eventDescription: 'User browsed the product'
@@ -46,13 +46,13 @@ function useVisibleHeight() {
46
46
  styleElement.id = 'onetrust-pc-sdk';
47
47
  styleElement.setAttribute('type', 'text/css');
48
48
  document.head.appendChild(styleElement);
49
- const css = `
50
- #onetrust-pc-sdk {
51
- height: ${finalHeight}px !important;
52
- }
53
- #onetrust-pc-sdk #ot-pc-content{
54
- bottom: ${b}px !important;
55
- }
49
+ const css = `
50
+ #onetrust-pc-sdk {
51
+ height: ${finalHeight}px !important;
52
+ }
53
+ #onetrust-pc-sdk #ot-pc-content{
54
+ bottom: ${b}px !important;
55
+ }
56
56
  `;
57
57
  styleElement.textContent = css;
58
58
  }
@@ -1,3 +1,5 @@
1
1
  export { EditorCore } from './context/EditorContext';
2
2
  export type { IEditorCoreRef } from './context/EditorContext';
3
3
  export type { MaterialComponet } from './create';
4
+ export { default as StructurePage } from './components/StructurePage';
5
+ export type { IStructurePageProps, IPostData, IProductData, IMultiCtaData, IApiResponse } from './components/StructurePage';
package/lib/core/index.js CHANGED
@@ -1,5 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EditorCore = void 0;
6
+ exports.StructurePage = exports.EditorCore = void 0;
4
7
  var EditorContext_1 = require("./context/EditorContext");
5
8
  Object.defineProperty(exports, "EditorCore", { enumerable: true, get: function () { return EditorContext_1.EditorCore; } });
9
+ var StructurePage_1 = require("./components/StructurePage");
10
+ Object.defineProperty(exports, "StructurePage", { enumerable: true, get: function () { return __importDefault(StructurePage_1).default; } });
@@ -19,7 +19,7 @@ export declare const getPriceText: ({ product, enableFormattedPrice, globalConfi
19
19
  product: ProductInfoType | undefined | null;
20
20
  enableFormattedPrice: boolean | undefined;
21
21
  globalConfig: ISxpPageRenderProps['globalConfig'];
22
- isHiddenDef?: boolean;
22
+ isHiddenDef?: boolean | undefined;
23
23
  style?: IfontType | any;
24
24
  }) => string | null;
25
25
  export {};
package/lib/index.d.ts CHANGED
@@ -10,4 +10,5 @@ export { default as SxpDataSourceProvider } from './core/context/SxpDataSourcePr
10
10
  export { default as SxpPageCore } from './core/components/SxpPageCore';
11
11
  export { default as EditorDataProvider } from './core/context/EditorDataProvider';
12
12
  export { useEditorDataProvider } from './core/context/EditorDataProvider';
13
+ export { default as StructurePage } from './core/components/StructurePage';
13
14
  export default Pagebuilder;
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useEditorDataProvider = exports.EditorDataProvider = exports.SxpPageCore = exports.SxpDataSourceProvider = exports.Modal = exports.DiyStoryPreview = exports.DiyPortalPreview = exports.SxpPageRender = exports.materials = exports.core = void 0;
3
+ exports.StructurePage = exports.useEditorDataProvider = exports.EditorDataProvider = exports.SxpPageCore = exports.SxpDataSourceProvider = exports.Modal = exports.DiyStoryPreview = exports.DiyPortalPreview = exports.SxpPageRender = exports.materials = exports.core = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const Pagebuilder_1 = require("./core/Pagebuilder");
6
6
  require("./index.css");
@@ -22,4 +22,6 @@ var EditorDataProvider_1 = require("./core/context/EditorDataProvider");
22
22
  Object.defineProperty(exports, "EditorDataProvider", { enumerable: true, get: function () { return tslib_1.__importDefault(EditorDataProvider_1).default; } });
23
23
  var EditorDataProvider_2 = require("./core/context/EditorDataProvider");
24
24
  Object.defineProperty(exports, "useEditorDataProvider", { enumerable: true, get: function () { return EditorDataProvider_2.useEditorDataProvider; } });
25
+ var StructurePage_1 = require("./core/components/StructurePage");
26
+ Object.defineProperty(exports, "StructurePage", { enumerable: true, get: function () { return tslib_1.__importDefault(StructurePage_1).default; } });
25
27
  exports.default = Pagebuilder_1.Pagebuilder;
@@ -16,10 +16,10 @@ const MultiPosts = (_a) => {
16
16
  const traceInfo = ((_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.traceInfo) || ((_c = recData === null || recData === void 0 ? void 0 : recData.product) === null || _c === void 0 ? void 0 : _c.traceInfo) || '';
17
17
  const getPropsVal = (0, react_1.useCallback)((index, str) => {
18
18
  try {
19
- return new Function('props', 'str', `if (str) {
20
- return props?.button${index + 1}${str}
21
- } else {
22
- return props?.button${index + 1}
19
+ return new Function('props', 'str', `if (str) {
20
+ return props?.button${index + 1}${str}
21
+ } else {
22
+ return props?.button${index + 1}
23
23
  }`)(props, str);
24
24
  }
25
25
  catch (_a) { }
@@ -155,10 +155,10 @@ const CommodityDetail = (_a) => {
155
155
  __html: (0, tool_1.setFontForText)((_c = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _c !== void 0 ? _c : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
156
156
  } }),
157
157
  react_1.default.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
158
- react_1.default.createElement(ExpandableText_1.default, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_d = product === null || product === void 0 ? void 0 : product.info) !== null && _d !== void 0 ? _d : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
159
- bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
160
- collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
161
- necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
158
+ react_1.default.createElement(ExpandableText_1.default, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_d = product === null || product === void 0 ? void 0 : product.info) !== null && _d !== void 0 ? _d : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
159
+ bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
160
+ collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
161
+ necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
162
162
  18-karat gold, this necklace is embellished with hand-set diamonds.`, maxStr: 79, className: 'pb-commondity-content-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info }))));
163
163
  };
164
164
  const renderBtn = () => {
@@ -151,7 +151,7 @@ const CommodityDetailDiroNew = (_a) => {
151
151
  const productInfoText = ({ isPost }) => {
152
152
  return (react_1.default.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
153
153
  react_1.default.createElement(ExpandableText_1.default, { isPost: isPost, onClick: () => setShowModal(true), className: 'pb-commondityDiroNew-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (product === null || product === void 0 ? void 0 : product.info) ||
154
- `Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
154
+ `Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
155
155
  Made in Italy` })));
156
156
  };
157
157
  const getStyle = (0, react_1.useCallback)((style) => {