pb-sxp-ui 1.9.8 → 1.10.1

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 (66) hide show
  1. package/dist/index.cjs +521 -163
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +35 -0
  4. package/dist/index.js +521 -163
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +7 -3
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +7 -3
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +521 -163
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +7 -3
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/Pagebuilder/index.js +3 -4
  15. package/es/core/components/SxpPageCore/index.d.ts +1 -1
  16. package/es/core/components/SxpPageCore/index.js +7 -6
  17. package/es/core/components/SxpPageRender/NavBack.d.ts +9 -0
  18. package/es/core/components/SxpPageRender/NavBack.js +16 -0
  19. package/es/core/components/SxpPageRender/PictureGroup/index.js +3 -1
  20. package/es/core/components/SxpPageRender/index.d.ts +2 -0
  21. package/es/core/components/SxpPageRender/index.js +30 -22
  22. package/es/core/components/SxpPageRender/typing.d.ts +1 -0
  23. package/es/core/context/EditorContext.d.ts +2 -0
  24. package/es/core/context/EditorContext.js +9 -3
  25. package/es/core/context/EditorDataProvider.d.ts +2 -0
  26. package/es/core/context/EditorDataProvider.js +4 -1
  27. package/es/core/context/SxpDataSourceProvider.d.ts +4 -2
  28. package/es/core/context/SxpDataSourceProvider.js +84 -53
  29. package/es/core/utils/materials.d.ts +1 -1
  30. package/es/materials/sxp/MultiPosts/index.d.ts +26 -0
  31. package/es/materials/sxp/MultiPosts/index.js +98 -0
  32. package/es/materials/sxp/MultiPosts/interactionRender.d.ts +9 -0
  33. package/es/materials/sxp/MultiPosts/interactionRender.js +42 -0
  34. package/es/materials/sxp/MultiPosts/material.d.ts +2 -0
  35. package/es/materials/sxp/MultiPosts/material.js +22 -0
  36. package/es/materials/sxp/MultiPosts/settingRender.d.ts +73 -0
  37. package/es/materials/sxp/MultiPosts/settingRender.js +115 -0
  38. package/es/materials/sxp/index.d.ts +1 -0
  39. package/es/materials/sxp/index.js +1 -0
  40. package/lib/core/Pagebuilder/index.js +3 -4
  41. package/lib/core/components/SxpPageCore/index.d.ts +1 -1
  42. package/lib/core/components/SxpPageCore/index.js +6 -5
  43. package/lib/core/components/SxpPageRender/NavBack.d.ts +9 -0
  44. package/lib/core/components/SxpPageRender/NavBack.js +19 -0
  45. package/lib/core/components/SxpPageRender/PictureGroup/index.js +3 -1
  46. package/lib/core/components/SxpPageRender/index.d.ts +2 -0
  47. package/lib/core/components/SxpPageRender/index.js +30 -22
  48. package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
  49. package/lib/core/context/EditorContext.d.ts +2 -0
  50. package/lib/core/context/EditorContext.js +9 -3
  51. package/lib/core/context/EditorDataProvider.d.ts +2 -0
  52. package/lib/core/context/EditorDataProvider.js +4 -1
  53. package/lib/core/context/SxpDataSourceProvider.d.ts +4 -2
  54. package/lib/core/context/SxpDataSourceProvider.js +84 -53
  55. package/lib/core/utils/materials.d.ts +1 -1
  56. package/lib/materials/sxp/MultiPosts/index.d.ts +26 -0
  57. package/lib/materials/sxp/MultiPosts/index.js +100 -0
  58. package/lib/materials/sxp/MultiPosts/interactionRender.d.ts +9 -0
  59. package/lib/materials/sxp/MultiPosts/interactionRender.js +44 -0
  60. package/lib/materials/sxp/MultiPosts/material.d.ts +2 -0
  61. package/lib/materials/sxp/MultiPosts/material.js +26 -0
  62. package/lib/materials/sxp/MultiPosts/settingRender.d.ts +73 -0
  63. package/lib/materials/sxp/MultiPosts/settingRender.js +117 -0
  64. package/lib/materials/sxp/index.d.ts +1 -0
  65. package/lib/materials/sxp/index.js +1 -0
  66. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -414,7 +414,7 @@ const Pagebuilder = {
414
414
  const tenantId = builder.getTenantId();
415
415
  const appId = builder.getAppId();
416
416
  const apiUrl = builder.getApiUrl();
417
- return fetch(`${apiUrl}/storefront/v1/page?id=` + id, {
417
+ return fetch(`${apiUrl}/storefront/v1/page/build?id=` + id, {
418
418
  method: 'get',
419
419
  headers: {
420
420
  'x-tenant-id': tenantId || '',
@@ -426,9 +426,8 @@ const Pagebuilder = {
426
426
  if (!result.success) {
427
427
  return undefined;
428
428
  }
429
- const decodeData = unzip((_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.data);
430
- result.data.data = decodeData;
431
- return result.data;
429
+ const dataList = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.map((item) => (Object.assign(Object.assign({}, item), { data: unzip(item === null || item === void 0 ? void 0 : item.data) })));
430
+ return dataList;
432
431
  }));
433
432
  }),
434
433
  getSxpRecommendVideoData: (dataId) => __awaiter(void 0, void 0, void 0, function* () {
@@ -632,8 +631,9 @@ var DataSourceType;
632
631
  DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
633
632
  })(DataSourceType || (DataSourceType = {}));
634
633
  const DEFAULT_TAG = 'FOR U';
635
- const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false, utmParameter, channelQueryList }) => {
636
- var _a, _b, _c;
634
+ 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, onUpdateSchema }) => {
635
+ var _a, _b, _c, _d, _e;
636
+ const { channel } = useEditor();
637
637
  const [rtcList, setRtcList] = useState([]);
638
638
  const [tagList, setTagList] = useState([]);
639
639
  const [loading, setLoading] = useState(false);
@@ -655,10 +655,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
655
655
  const checkCommodityIndexRef = useRef(-1);
656
656
  const popupCurTimeRef = useRef(null);
657
657
  const [isNoMoreData, setIsNoMoreData] = useState(false);
658
+ const [globalConfig, setGlobalConfig] = useState((_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);
659
+ const [pageData, setPageData] = useState(data);
660
+ const [showConsent, setShowConsent] = useState(false);
661
+ const [layoutVariantId, setLayoutVariantId] = useState();
658
662
  const isShowConsent = useMemo(() => {
659
663
  var _a, _b, _c, _d;
660
- return (((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent;
661
- }, [isAgreePolicy, globalConfig, isOpenConsent, isEditor]);
664
+ return (((((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent) &&
665
+ showConsent);
666
+ }, [isAgreePolicy, globalConfig, isOpenConsent, isEditor, showConsent]);
662
667
  const getFilterRecList = useCallback((data) => {
663
668
  var _a;
664
669
  const recList = data === null || data === void 0 ? void 0 : data.recList;
@@ -720,10 +725,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
720
725
  }, [bffDataSource]);
721
726
  // 获取推荐视频数据
722
727
  const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
723
- var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
728
+ var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
724
729
  query = {
725
- maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize,
726
- defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize,
730
+ maxSize: (_f = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _f !== void 0 ? _f : maxSize,
731
+ defaultSize: (_g = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _g !== void 0 ? _g : defaultSize,
727
732
  hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
728
733
  traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo,
729
734
  themeTag: query === null || query === void 0 ? void 0 : query.themeTag,
@@ -731,13 +736,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
731
736
  contentFilter: query === null || query === void 0 ? void 0 : query.contentFilter,
732
737
  productFilter: query === null || query === void 0 ? void 0 : query.productFilter
733
738
  };
734
- if (utmVal) {
735
- const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
739
+ if (channel) {
740
+ query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
741
+ }
742
+ else if (utmVal) {
743
+ const val = (_k = (_j = (_h = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _h === void 0 ? void 0 : _h.filter((val) => {
736
744
  var _a, _b;
737
745
  const key = val.split('=')[0];
738
746
  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);
739
- })) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
740
- query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
747
+ })) === null || _j === void 0 ? void 0 : _j.join('&')) !== null && _k !== void 0 ? _k : '';
748
+ if (val)
749
+ query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
741
750
  }
742
751
  if (isEditor) {
743
752
  let pageNum = 1;
@@ -749,17 +758,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
749
758
  let list = [];
750
759
  let result = null;
751
760
  const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
752
- var _t, _u, _v, _w, _x, _y;
761
+ var _v, _w, _x, _y, _z, _0;
753
762
  query.pageNum = pageNum;
754
763
  result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'POST', body: query }));
755
764
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
756
765
  return undefined;
757
766
  }
758
767
  setLoading(false);
759
- list = list.concat((_w = (_v = (_u = (_t = result === null || result === void 0 ? void 0 : result.data) === null || _t === void 0 ? void 0 : _t.recList) === null || _u === void 0 ? void 0 : _u.filter) === null || _v === void 0 ? void 0 : _v.call(_u, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _w !== void 0 ? _w : []);
768
+ 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 : []);
760
769
  setRtcList(getFilterRecList(Object.assign(Object.assign({}, result.data), { recList: list })));
761
770
  setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result.data), { recList: list })));
762
- const isNotNullList = (_y = (_x = result === null || result === void 0 ? void 0 : result.data) === null || _x === void 0 ? void 0 : _x.recList) === null || _y === void 0 ? void 0 : _y.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
771
+ 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));
763
772
  if (isNotNullList) {
764
773
  pageNum = pageNum + 1;
765
774
  yield recurveRecList(query);
@@ -767,11 +776,11 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
767
776
  });
768
777
  yield recurveRecList(query);
769
778
  if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
770
- setCurReqInfo({ rtc: (_j = result === null || result === void 0 ? void 0 : result.data) === null || _j === void 0 ? void 0 : _j.rtc, requestId: (_k = result === null || result === void 0 ? void 0 : result.data) === null || _k === void 0 ? void 0 : _k.requestId });
779
+ 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 });
771
780
  return Object.assign(Object.assign({}, result.data), { recList: list });
772
781
  }
773
782
  if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
774
- query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_l = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _l !== void 0 ? _l : 1 });
783
+ 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 });
775
784
  }
776
785
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'POST', body: query }));
777
786
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
@@ -781,27 +790,27 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
781
790
  setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
782
791
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
783
792
  let list = [];
784
- list = list.concat((_q = (_p = (_o = (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.recList) === null || _o === void 0 ? void 0 : _o.filter) === null || _p === void 0 ? void 0 : _p.call(_o, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _q !== void 0 ? _q : []);
785
- const isNotNullList = (_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.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
793
+ list = list.concat((_s = (_r = (_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.filter) === null || _r === void 0 ? void 0 : _r.call(_q, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _s !== void 0 ? _s : []);
794
+ const isNotNullList = (_u = (_t = result === null || result === void 0 ? void 0 : result.data) === null || _t === void 0 ? void 0 : _t.recList) === null || _u === void 0 ? void 0 : _u.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
786
795
  if (!isNotNullList) {
787
796
  setIsNoMoreData(true);
788
797
  }
789
798
  return Object.assign(Object.assign({}, result.data), { recList: list });
790
799
  }
791
800
  return result === null || result === void 0 ? void 0 : result.data;
792
- }), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList]);
801
+ }), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel]);
793
802
  const loadVideos = useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
794
- var _z, _0, _1, _2;
803
+ var _1, _2, _3, _4;
795
804
  if (rtcList.length <= 0) {
796
805
  return;
797
806
  }
798
807
  const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
799
- const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_z = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _z === void 0 ? void 0 : _z.itemId) && { productFilter: [(_0 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _0 === void 0 ? void 0 : _0.itemId] })), (((_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _1 === void 0 ? void 0 : _1.itemId) && { contentFilter: [(_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _2 === void 0 ? void 0 : _2.itemId] })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
808
+ 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 })));
800
809
  setRtcList(rtcList.concat(getFilterRecList(data)));
801
810
  setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
802
811
  return data;
803
812
  }), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
804
- const bffEventReport = useCallback(({ userInfo, eventInfo }) => {
813
+ const bffEventReport = useCallback(({ userInfo, eventInfo, reportLayId = true }) => {
805
814
  // 关闭 BFF 事件上报
806
815
  if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
807
816
  return;
@@ -814,7 +823,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
814
823
  };
815
824
  }
816
825
  const sessionID = storeAndLoadFeSessionId();
817
- const ef = Object.assign(Object.assign(Object.assign(Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, eventInfo), (getDevice$1() && { sxpDevice: getDevice$1() })), (getSystem() && { sxpSystem: getSystem() })), (getBrowserInfo() && { sxpBrowser: getBrowserInfo() }));
826
+ const ef = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, eventInfo), (getDevice$1() && { sxpDevice: getDevice$1() })), (getSystem() && { sxpSystem: getSystem() })), (getBrowserInfo() && { sxpBrowser: getBrowserInfo() })), { playbookType: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.playbook) === 'organic menu' ? 'organicMenu' : 'paidMedia' }), (layoutVariantId && reportLayId && { layoutVariantId }));
818
827
  const realUserInfo = Object.entries(userInfo).map(([k, v]) => ({ name: k, value: v }));
819
828
  const realEventInfo = Object.entries(ef)
820
829
  .map(([k, v]) => v && { name: k, value: v })
@@ -828,7 +837,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
828
837
  body: { userInfo: realUserInfo, eventInfo: realEventInfo },
829
838
  type: 'beacon'
830
839
  });
831
- }, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
840
+ }, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview, layoutVariantId]);
832
841
  const bffFbReport = useCallback(({ eventName, product }) => {
833
842
  var _a, _b, _c, _d, _e;
834
843
  if (!enableReportEvent ||
@@ -913,23 +922,24 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
913
922
  return res === null || res === void 0 ? void 0 : res.success;
914
923
  }), [bffFetch]);
915
924
  // 获取 Tag
916
- const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
917
- var _3, _4, _5, _6, _7;
925
+ const bffGetTagList = useCallback((data) => __awaiter(void 0, void 0, void 0, function* () {
926
+ var _5, _6, _7, _8, _9, _10, _11, _12;
927
+ 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);
918
928
  if (!utmVal || !isShowTag)
919
929
  return;
920
930
  try {
921
- const val = (_5 = (_4 = (_3 = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _3 === void 0 ? void 0 : _3.filter((val) => {
931
+ const val = (_10 = (_9 = (_8 = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _8 === void 0 ? void 0 : _8.filter((val) => {
922
932
  var _a, _b;
923
933
  const key = val.split('=')[0];
924
934
  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);
925
- })) === null || _4 === void 0 ? void 0 : _4.join('&')) !== null && _5 !== void 0 ? _5 : '';
935
+ })) === null || _9 === void 0 ? void 0 : _9.join('&')) !== null && _10 !== void 0 ? _10 : '';
926
936
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
927
- setTagList((_7 = (_6 = result === null || result === void 0 ? void 0 : result.data) === null || _6 === void 0 ? void 0 : _6.tags) !== null && _7 !== void 0 ? _7 : []);
937
+ 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 : []);
928
938
  }
929
939
  catch (e) {
930
940
  console.log('e', e);
931
941
  }
932
- }), [bffFetch, utmVal, isShowTag]);
942
+ }), [bffFetch, utmVal]);
933
943
  const ctaEvent = useCallback((eventInfo, rec, product, position) => {
934
944
  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;
935
945
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
@@ -975,7 +985,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
975
985
  requestId: null,
976
986
  enterUrl: (_b = (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.href) !== null && _b !== void 0 ? _b : '',
977
987
  clSource: getVal('cl_source')
978
- }
988
+ },
989
+ reportLayId: false
979
990
  });
980
991
  }, [bffEventReport]);
981
992
  useEffect(() => {
@@ -983,49 +994,68 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
983
994
  h5EnterLink();
984
995
  }, [isShowConsent]);
985
996
  useEffect(() => {
986
- if (isShowConsent)
997
+ if (isShowConsent || isPreview)
987
998
  return;
988
999
  setLoading(true);
989
- bffGetTagList();
1000
+ let layId;
990
1001
  getRecommendVideos()
991
1002
  .then((data) => {
1003
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
992
1004
  if (data) {
993
- setRtcList(getFilterRecList(data));
994
- setCacheRtcList(getFilterRecList(data));
1005
+ const list = getFilterRecList(data);
1006
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.playbook) === 'organic menu' && !channel) {
1007
+ list.unshift('organic menu');
1008
+ }
1009
+ setRtcList(list);
1010
+ setCacheRtcList(list);
1011
+ let curData;
1012
+ if (data === null || data === void 0 ? void 0 : data.layoutVariantId) {
1013
+ const id = (_b = (_a = data === null || data === void 0 ? void 0 : data.layoutVariantId) === null || _a === void 0 ? void 0 : _a.split('-')) === null || _b === void 0 ? void 0 : _b[1];
1014
+ if (id) {
1015
+ layId = id;
1016
+ setLayoutVariantId(id);
1017
+ curData = dataList === null || dataList === void 0 ? void 0 : dataList.find((item) => (item === null || item === void 0 ? void 0 : item.id) === id);
1018
+ if (curData) {
1019
+ setPageData(curData);
1020
+ document.title = (_c = curData === null || curData === void 0 ? void 0 : curData.name) !== null && _c !== void 0 ? _c : 'home';
1021
+ setGlobalConfig((_d = curData === null || curData === void 0 ? void 0 : curData.data) === null || _d === void 0 ? void 0 : _d.globalConfig);
1022
+ onUpdateSchema === null || onUpdateSchema === void 0 ? void 0 : onUpdateSchema(curData === null || curData === void 0 ? void 0 : curData.data);
1023
+ if ((_k = (_j = (_h = (_g = (_f = (_e = curData === null || curData === void 0 ? void 0 : curData.data) === null || _e === void 0 ? void 0 : _e.globalConfig) === null || _f === void 0 ? void 0 : _f.consent) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.item) === null || _j === void 0 ? void 0 : _j.props) === null || _k === void 0 ? void 0 : _k.privacy_necessity)
1024
+ setShowConsent(true);
1025
+ }
1026
+ }
1027
+ }
1028
+ bffGetTagList(curData !== null && curData !== void 0 ? curData : pageData);
995
1029
  }
996
1030
  })
997
1031
  .finally(() => {
998
1032
  bffEventReport({
999
- eventInfo: {
1000
- eventSubject: 'apiRequest',
1001
- eventDescription: 'api request succeed'
1002
- }
1033
+ eventInfo: Object.assign({ eventSubject: 'apiRequest', eventDescription: 'api request succeed' }, (layId && { layoutVariantId: layId }))
1003
1034
  });
1004
1035
  setLoading(false);
1005
1036
  });
1006
- }, [isShowConsent]);
1037
+ }, [isShowConsent, channel]);
1038
+ // cms预览
1007
1039
  useEffect(() => {
1008
1040
  if (!isPreview)
1009
1041
  return;
1010
1042
  setLoading(true);
1011
- bffGetTagList();
1043
+ bffGetTagList(pageData);
1012
1044
  getRecommendVideos()
1013
1045
  .then((data) => {
1014
1046
  if (data) {
1015
- setRtcList(getFilterRecList(data));
1016
- setCacheRtcList(getFilterRecList(data));
1047
+ const list = getFilterRecList(data);
1048
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.playbook) === 'organic menu' && !channel) {
1049
+ list.unshift('organic menu');
1050
+ }
1051
+ setRtcList(list);
1052
+ setCacheRtcList(list);
1017
1053
  }
1018
1054
  })
1019
1055
  .finally(() => {
1020
- bffEventReport({
1021
- eventInfo: {
1022
- eventSubject: 'apiRequest',
1023
- eventDescription: 'api request succeed'
1024
- }
1025
- });
1026
1056
  setLoading(false);
1027
1057
  });
1028
- }, [getRecommendVideos, bffGetTagList]);
1058
+ }, [getRecommendVideos, bffGetTagList, channel]);
1029
1059
  const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
1030
1060
  return (React.createElement(SxpDataSourceContext.Provider, { value: {
1031
1061
  rtcList,
@@ -1038,7 +1068,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1038
1068
  setPopupDetailData,
1039
1069
  getRecommendVideos,
1040
1070
  bffEventReport,
1041
- utmVal,
1042
1071
  isPreview,
1043
1072
  loading,
1044
1073
  sxpParameter,
@@ -1076,12 +1105,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1076
1105
  checkCommodityIndexRef,
1077
1106
  isEditor,
1078
1107
  isNoMoreData
1079
- } }, isShowConsent ? (React.createElement(Consent$4, Object.assign({}, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props))) : (render({
1108
+ } }, isShowConsent ? (React.createElement(Consent$4, 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({
1080
1109
  rtcList,
1081
1110
  mutateLike: bffMutateLike,
1082
1111
  mutateUnlike: bffMutateUnlike,
1083
1112
  submitForm: bffSubmitForm,
1084
- tagList
1113
+ tagList,
1114
+ pageData
1085
1115
  }))));
1086
1116
  };
1087
1117
  var SxpDataSourceProvider$1 = memo(SxpDataSourceProvider);
@@ -1204,6 +1234,7 @@ const EditorContext = React.createContext({
1204
1234
  });
1205
1235
  const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSource = true, utmVal }, ref) => {
1206
1236
  const [currentNode, setCurrentNode] = useState(null);
1237
+ const [channel, setChannel] = useState();
1207
1238
  const [_schema, setSchema] = useState(schema || {
1208
1239
  pointData: [item],
1209
1240
  dataSource: [],
@@ -1224,6 +1255,9 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
1224
1255
  const [undoStack, setUndoStack] = useState([[item]]);
1225
1256
  const [redoStack, setRedoStack] = useState([]);
1226
1257
  const [popup, setPopup] = useState(popupInit);
1258
+ const channelParams = useMemo(() => {
1259
+ return channel || utmVal;
1260
+ }, [channel, utmVal]);
1227
1261
  typeof window !== 'undefined' &&
1228
1262
  (window.sxpPopup = (type, aniType) => {
1229
1263
  setPopup(Object.assign(Object.assign(Object.assign({}, popupInit), { id: type }), aniType));
@@ -1232,10 +1266,10 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
1232
1266
  (window.getJointUtmLink = (url) => {
1233
1267
  setSlideSkipState();
1234
1268
  if ((url === null || url === void 0 ? void 0 : url.indexOf('?')) !== -1) {
1235
- return url + (utmVal ? '&' + utmVal : '');
1269
+ return url + (channelParams ? '&' + channelParams : '');
1236
1270
  }
1237
1271
  else {
1238
- return url + (utmVal ? '?' + utmVal : '');
1272
+ return url + (channelParams ? '?' + channelParams : '');
1239
1273
  }
1240
1274
  });
1241
1275
  // 切换页面类型,清空操作栈
@@ -1303,7 +1337,9 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
1303
1337
  setUndoStack,
1304
1338
  getCurPageConf,
1305
1339
  popup,
1306
- setPopup
1340
+ setPopup,
1341
+ channel,
1342
+ setChannel
1307
1343
  } },
1308
1344
  React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
1309
1345
  });
@@ -1313,7 +1349,7 @@ var index$2 = /*#__PURE__*/Object.freeze({
1313
1349
  EditorCore: EditorCore
1314
1350
  });
1315
1351
 
1316
- var interactionRender$f = [
1352
+ var interactionRender$g = [
1317
1353
  {
1318
1354
  title: '点击事件',
1319
1355
  child: [
@@ -1333,7 +1369,7 @@ var interactionRender$f = [
1333
1369
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\AppointForm\settingRender.tsx
1334
1370
  *
1335
1371
  */
1336
- var settingRender$c = [
1372
+ var settingRender$d = [
1337
1373
  {
1338
1374
  title: '弹窗背景',
1339
1375
  child: [
@@ -1762,9 +1798,9 @@ const AppointForm = createMaterial(AppointFormComponent, {
1762
1798
  category: 'popup',
1763
1799
  type: 'AppointForm',
1764
1800
  related: {
1765
- settingRender: settingRender$c,
1801
+ settingRender: settingRender$d,
1766
1802
  bindableProps: [],
1767
- interactionRender: interactionRender$f
1803
+ interactionRender: interactionRender$g
1768
1804
  },
1769
1805
  defaulSetting: {
1770
1806
  name: '表单',
@@ -1787,7 +1823,7 @@ const AppointForm = createMaterial(AppointFormComponent, {
1787
1823
  sort: 2
1788
1824
  });
1789
1825
 
1790
- var settingRender$b = [
1826
+ var settingRender$c = [
1791
1827
  {
1792
1828
  title: '弹窗背景',
1793
1829
  child: [
@@ -10054,6 +10090,15 @@ const getMediaValueByMode = (obj) => {
10054
10090
  return file && file.length > 0 ? (_a = file[0]) === null || _a === void 0 ? void 0 : _a.url : null;
10055
10091
  }
10056
10092
  };
10093
+ const getBgStyle = (imgSrc) => {
10094
+ return imgSrc
10095
+ ? {
10096
+ backgroundImage: `url(${imgSrc})`,
10097
+ backgroundRepeat: 'no-repeat',
10098
+ backgroundSize: 'cover'
10099
+ }
10100
+ : '';
10101
+ };
10057
10102
  const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef, style }) => {
10058
10103
  var _a, _b, _c, _d, _e, _f, _g, _h;
10059
10104
  if ((!(product === null || product === void 0 ? void 0 : product.currency) || !(product === null || product === void 0 ? void 0 : product.price)) && isHiddenDef)
@@ -10348,7 +10393,7 @@ var CommodityDetailComponent = memo(CommodityDetail$1);
10348
10393
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\interactionRender.tsx
10349
10394
  *
10350
10395
  */
10351
- var interactionRender$e = [
10396
+ var interactionRender$f = [
10352
10397
  {
10353
10398
  title: '滑动事件',
10354
10399
  child: [
@@ -10375,8 +10420,8 @@ const CommodityDetail = createMaterial(CommodityDetailComponent, {
10375
10420
  category: 'popup',
10376
10421
  type: 'CommodityDetail',
10377
10422
  related: {
10378
- settingRender: settingRender$b,
10379
- interactionRender: interactionRender$e
10423
+ settingRender: settingRender$c,
10424
+ interactionRender: interactionRender$f
10380
10425
  },
10381
10426
  defaulSetting: {
10382
10427
  props: {
@@ -10431,7 +10476,7 @@ const CommodityDetail = createMaterial(CommodityDetailComponent, {
10431
10476
  sort: 1
10432
10477
  });
10433
10478
 
10434
- var interactionRender$d = [
10479
+ var interactionRender$e = [
10435
10480
  {
10436
10481
  title: '点击事件',
10437
10482
  child: [
@@ -10451,7 +10496,7 @@ var interactionRender$d = [
10451
10496
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\Prompt\settingRender.tsx
10452
10497
  *
10453
10498
  */
10454
- var settingRender$a = [
10499
+ var settingRender$b = [
10455
10500
  {
10456
10501
  title: '弹窗背景',
10457
10502
  child: [
@@ -10631,9 +10676,9 @@ const Prompt = createMaterial(PromptComponent, {
10631
10676
  category: 'popup',
10632
10677
  type: 'Prompt',
10633
10678
  related: {
10634
- settingRender: settingRender$a,
10679
+ settingRender: settingRender$b,
10635
10680
  bindableProps: [],
10636
- interactionRender: interactionRender$d
10681
+ interactionRender: interactionRender$e
10637
10682
  },
10638
10683
  defaulSetting: {
10639
10684
  props: {
@@ -10656,7 +10701,7 @@ const Prompt = createMaterial(PromptComponent, {
10656
10701
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiroNew\settingRender.tsx
10657
10702
  *
10658
10703
  */
10659
- var settingRender$9 = [
10704
+ var settingRender$a = [
10660
10705
  {
10661
10706
  title: '弹窗背景',
10662
10707
  child: [
@@ -11308,7 +11353,7 @@ var CommodityDetailDiroNewComponent = memo(CommodityDetailDiroNew$1);
11308
11353
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\interactionRender.tsx
11309
11354
  *
11310
11355
  */
11311
- var interactionRender$c = [
11356
+ var interactionRender$d = [
11312
11357
  {
11313
11358
  title: '滑动事件',
11314
11359
  child: [
@@ -11335,8 +11380,8 @@ const CommodityDetailDiroNew = createMaterial(CommodityDetailDiroNewComponent, {
11335
11380
  category: 'popup',
11336
11381
  type: 'CommodityDetailDiroNew',
11337
11382
  related: {
11338
- settingRender: settingRender$9,
11339
- interactionRender: interactionRender$c
11383
+ settingRender: settingRender$a,
11384
+ interactionRender: interactionRender$d
11340
11385
  },
11341
11386
  defaulSetting: {
11342
11387
  props: {
@@ -11399,7 +11444,7 @@ const CommodityDetailDiroNew = createMaterial(CommodityDetailDiroNewComponent, {
11399
11444
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityList\settingRender.tsx
11400
11445
  *
11401
11446
  */
11402
- var settingRender$8 = [
11447
+ var settingRender$9 = [
11403
11448
  {
11404
11449
  title: '弹窗背景',
11405
11450
  child: [
@@ -11809,7 +11854,7 @@ var CommodityListComponent = memo(CommodityList$1);
11809
11854
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\interactionRender.tsx
11810
11855
  *
11811
11856
  */
11812
- var interactionRender$b = [
11857
+ var interactionRender$c = [
11813
11858
  {
11814
11859
  title: '点击事件',
11815
11860
  child: [
@@ -11836,8 +11881,8 @@ const CommodityList = createMaterial(CommodityListComponent, {
11836
11881
  category: 'popup',
11837
11882
  type: 'CommodityList',
11838
11883
  related: {
11839
- settingRender: settingRender$8,
11840
- interactionRender: interactionRender$b
11884
+ settingRender: settingRender$9,
11885
+ interactionRender: interactionRender$c
11841
11886
  },
11842
11887
  defaulSetting: {
11843
11888
  props: {
@@ -11885,7 +11930,7 @@ const CommodityList = createMaterial(CommodityListComponent, {
11885
11930
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\Iframe\settingRender.tsx
11886
11931
  *
11887
11932
  */
11888
- var settingRender$7 = [
11933
+ var settingRender$8 = [
11889
11934
  {
11890
11935
  title: '背景样式',
11891
11936
  child: [
@@ -11919,7 +11964,7 @@ const Iframe = createMaterial(IframeComponent, {
11919
11964
  category: 'popup',
11920
11965
  type: 'Iframe',
11921
11966
  related: {
11922
- settingRender: settingRender$7,
11967
+ settingRender: settingRender$8,
11923
11968
  bindableProps: []
11924
11969
  },
11925
11970
  defaulSetting: {
@@ -11939,7 +11984,7 @@ const Iframe = createMaterial(IframeComponent, {
11939
11984
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\ConsentDetail\settingRender.tsx
11940
11985
  *
11941
11986
  */
11942
- var settingRender$6 = [
11987
+ var settingRender$7 = [
11943
11988
  {
11944
11989
  title: '弹窗文本',
11945
11990
  child: [
@@ -11967,7 +12012,7 @@ const ConsentDetail = createMaterial(ConsentDetailComponent, {
11967
12012
  category: 'popup',
11968
12013
  type: 'ConsentDetail',
11969
12014
  related: {
11970
- settingRender: settingRender$6,
12015
+ settingRender: settingRender$7,
11971
12016
  bindableProps: []
11972
12017
  },
11973
12018
  defaulSetting: {
@@ -11987,7 +12032,7 @@ const ConsentDetail = createMaterial(ConsentDetailComponent, {
11987
12032
  * @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\settingRender.tsx
11988
12033
  *
11989
12034
  */
11990
- var settingRender$5 = [
12035
+ var settingRender$6 = [
11991
12036
  {
11992
12037
  title: '主题样式',
11993
12038
  child: [
@@ -12244,7 +12289,7 @@ var settingRender$5 = [
12244
12289
  }
12245
12290
  ];
12246
12291
 
12247
- var interactionRender$a = [
12292
+ var interactionRender$b = [
12248
12293
  {
12249
12294
  title: '点击事件',
12250
12295
  child: [
@@ -12339,9 +12384,9 @@ const Commodity = createMaterial(CommodityComponent, {
12339
12384
  category: 'template',
12340
12385
  type: 'Commodity',
12341
12386
  related: {
12342
- interactionRender: interactionRender$a,
12387
+ interactionRender: interactionRender$b,
12343
12388
  bindableProps: [],
12344
- settingRender: settingRender$5
12389
+ settingRender: settingRender$6
12345
12390
  },
12346
12391
  defaulSetting: {
12347
12392
  props: {
@@ -12381,7 +12426,7 @@ const Commodity = createMaterial(CommodityComponent, {
12381
12426
  sort: 1
12382
12427
  });
12383
12428
 
12384
- var interactionRender$9 = [
12429
+ var interactionRender$a = [
12385
12430
  {
12386
12431
  title: '点击事件',
12387
12432
  child: [
@@ -12422,8 +12467,8 @@ const Appoint = createMaterial(AppointComponent, {
12422
12467
  category: 'template',
12423
12468
  type: 'Appoint',
12424
12469
  related: {
12425
- interactionRender: interactionRender$9,
12426
- settingRender: settingRender$5 === null || settingRender$5 === void 0 ? void 0 : settingRender$5.filter((i) => i.type !== 'commodityTitle'),
12470
+ interactionRender: interactionRender$a,
12471
+ settingRender: settingRender$6 === null || settingRender$6 === void 0 ? void 0 : settingRender$6.filter((i) => i.type !== 'commodityTitle'),
12427
12472
  bindableProps: []
12428
12473
  },
12429
12474
  defaulSetting: {
@@ -12610,7 +12655,7 @@ var LinkComponent = memo(Link$1);
12610
12655
  * @FilePath: \pb-sxp-ui\src\materials\sxp\template\Link\interactionRender.tsx
12611
12656
  *
12612
12657
  */
12613
- var interactionRender$8 = [
12658
+ var interactionRender$9 = [
12614
12659
  {
12615
12660
  title: '点击事件',
12616
12661
  child: [
@@ -12630,9 +12675,9 @@ const Link = createMaterial(LinkComponent, {
12630
12675
  category: 'template',
12631
12676
  type: 'Link',
12632
12677
  related: {
12633
- settingRender: (_a = settingRender$5 === null || settingRender$5 === void 0 ? void 0 : settingRender$5.filter((i) => i.type !== 'commodityTitle')) === null || _a === void 0 ? void 0 : _a.concat(linkSettingRender),
12678
+ settingRender: (_a = settingRender$6 === null || settingRender$6 === void 0 ? void 0 : settingRender$6.filter((i) => i.type !== 'commodityTitle')) === null || _a === void 0 ? void 0 : _a.concat(linkSettingRender),
12634
12679
  bindableProps: [],
12635
- interactionRender: interactionRender$8
12680
+ interactionRender: interactionRender$9
12636
12681
  },
12637
12682
  defaulSetting: {
12638
12683
  props: {
@@ -12678,7 +12723,7 @@ const Link = createMaterial(LinkComponent, {
12678
12723
  sort: 5
12679
12724
  });
12680
12725
 
12681
- var interactionRender$7 = [
12726
+ var interactionRender$8 = [
12682
12727
  {
12683
12728
  title: '点击事件',
12684
12729
  child: [
@@ -12732,8 +12777,8 @@ const CommodityDiro = createMaterial(CommodityDiroComponent, {
12732
12777
  category: 'template',
12733
12778
  type: 'CommodityDiro',
12734
12779
  related: {
12735
- interactionRender: interactionRender$7,
12736
- settingRender: settingRender$5,
12780
+ interactionRender: interactionRender$8,
12781
+ settingRender: settingRender$6,
12737
12782
  bindableProps: []
12738
12783
  },
12739
12784
  defaulSetting: {
@@ -12774,7 +12819,7 @@ const CommodityDiro = createMaterial(CommodityDiroComponent, {
12774
12819
  sort: 2
12775
12820
  });
12776
12821
 
12777
- var interactionRender$6 = [
12822
+ var interactionRender$7 = [
12778
12823
  {
12779
12824
  title: '点击事件',
12780
12825
  child: [
@@ -12828,9 +12873,9 @@ const CommodityDiroNew = createMaterial(CommodityDiroNewComponent, {
12828
12873
  category: 'template',
12829
12874
  type: 'CommodityDiroNew',
12830
12875
  related: {
12831
- interactionRender: interactionRender$6,
12876
+ interactionRender: interactionRender$7,
12832
12877
  bindableProps: [],
12833
- settingRender: settingRender$5
12878
+ settingRender: settingRender$6
12834
12879
  },
12835
12880
  defaulSetting: {
12836
12881
  props: {
@@ -12871,7 +12916,7 @@ const CommodityDiroNew = createMaterial(CommodityDiroNewComponent, {
12871
12916
  sort: 2
12872
12917
  });
12873
12918
 
12874
- var interactionRender$5 = [
12919
+ var interactionRender$6 = [
12875
12920
  {
12876
12921
  title: '点击事件',
12877
12922
  child: [
@@ -12928,9 +12973,9 @@ const MultiCommodityDiro = createMaterial(MultiCommodityDiroComponent, {
12928
12973
  category: 'template',
12929
12974
  type: 'MultiCommodityDiro',
12930
12975
  related: {
12931
- interactionRender: interactionRender$5,
12976
+ interactionRender: interactionRender$6,
12932
12977
  bindableProps: [],
12933
- settingRender: settingRender$5
12978
+ settingRender: settingRender$6
12934
12979
  },
12935
12980
  defaulSetting: {
12936
12981
  props: {
@@ -12970,7 +13015,7 @@ const MultiCommodityDiro = createMaterial(MultiCommodityDiroComponent, {
12970
13015
  sort: 4
12971
13016
  });
12972
13017
 
12973
- var interactionRender$4 = [
13018
+ var interactionRender$5 = [
12974
13019
  {
12975
13020
  title: '点击事件',
12976
13021
  child: [
@@ -13027,8 +13072,8 @@ const MultiCommodity = createMaterial(MultiCommodityComponent, {
13027
13072
  category: 'template',
13028
13073
  type: 'MultiCommodity',
13029
13074
  related: {
13030
- interactionRender: interactionRender$4,
13031
- settingRender: settingRender$5,
13075
+ interactionRender: interactionRender$5,
13076
+ settingRender: settingRender$6,
13032
13077
  bindableProps: []
13033
13078
  },
13034
13079
  defaulSetting: {
@@ -13077,7 +13122,7 @@ const MultiCommodity = createMaterial(MultiCommodityComponent, {
13077
13122
  * @FilePath: \pb-sxp-ui\src\materials\sxp\template\MultiCommodityDiroNew\interactionRender.tsx
13078
13123
  *
13079
13124
  */
13080
- var interactionRender$3 = [
13125
+ var interactionRender$4 = [
13081
13126
  {
13082
13127
  title: '点击事件',
13083
13128
  child: [
@@ -13135,9 +13180,9 @@ const MultiCommodityDiroNew = createMaterial(MultiCommodityDiroNewComponent, {
13135
13180
  category: 'template',
13136
13181
  type: 'MultiCommodityDiroNew',
13137
13182
  related: {
13138
- interactionRender: interactionRender$3,
13183
+ interactionRender: interactionRender$4,
13139
13184
  bindableProps: [],
13140
- settingRender: settingRender$5
13185
+ settingRender: settingRender$6
13141
13186
  },
13142
13187
  defaulSetting: {
13143
13188
  props: {
@@ -13186,7 +13231,7 @@ const MultiCommodityDiroNew = createMaterial(MultiCommodityDiroNewComponent, {
13186
13231
  * @FilePath: \pb-sxp-ui\src\materials\sxp\HashTag\settingRender.tsx
13187
13232
  *
13188
13233
  */
13189
- var settingRender$4 = [
13234
+ var settingRender$5 = [
13190
13235
  {
13191
13236
  title: 'Banner',
13192
13237
  child: [
@@ -15421,7 +15466,7 @@ const HashTag = createMaterial(HashTagComponent, {
15421
15466
  category: 'base',
15422
15467
  type: 'HashTag',
15423
15468
  related: {
15424
- settingRender: settingRender$4,
15469
+ settingRender: settingRender$5,
15425
15470
  bindableProps: []
15426
15471
  },
15427
15472
  defaulSetting: {
@@ -15486,7 +15531,7 @@ const HashTag = createMaterial(HashTagComponent, {
15486
15531
  * @FilePath: \pb-sxp-ui\src\materials\sxp\Consent\settingRender.tsx
15487
15532
  *
15488
15533
  */
15489
- var settingRender$3 = [
15534
+ var settingRender$4 = [
15490
15535
  {
15491
15536
  title: '协议详情',
15492
15537
  child: [
@@ -15545,7 +15590,7 @@ const Consent$1 = createMaterial(ConsentComponent, {
15545
15590
  category: 'base',
15546
15591
  type: 'Consent',
15547
15592
  related: {
15548
- settingRender: settingRender$3
15593
+ settingRender: settingRender$4
15549
15594
  },
15550
15595
  defaulSetting: {
15551
15596
  props: {},
@@ -15564,7 +15609,7 @@ const Consent$1 = createMaterial(ConsentComponent, {
15564
15609
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\settingRender.tsx
15565
15610
  *
15566
15611
  */
15567
- var settingRender$2 = [
15612
+ var settingRender$3 = [
15568
15613
  {
15569
15614
  title: '主题样式',
15570
15615
  child: [
@@ -15760,7 +15805,7 @@ var AniLinkComponent = memo(AniLink$1);
15760
15805
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\interactionRender.tsx
15761
15806
  *
15762
15807
  */
15763
- var interactionRender$2 = [
15808
+ var interactionRender$3 = [
15764
15809
  {
15765
15810
  title: '点击事件',
15766
15811
  child: [
@@ -15825,9 +15870,9 @@ const AniLink = createMaterial(AniLinkComponent, {
15825
15870
  category: 'cta',
15826
15871
  type: 'AniLink',
15827
15872
  related: {
15828
- settingRender: settingRender$2,
15873
+ settingRender: settingRender$3,
15829
15874
  bindableProps: [],
15830
- interactionRender: interactionRender$2
15875
+ interactionRender: interactionRender$3
15831
15876
  },
15832
15877
  defaulSetting: {
15833
15878
  props: {
@@ -15869,7 +15914,7 @@ const AniLink = createMaterial(AniLinkComponent, {
15869
15914
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLinkPopup\settingRender.tsx
15870
15915
  *
15871
15916
  */
15872
- var settingRender$1 = [
15917
+ var settingRender$2 = [
15873
15918
  {
15874
15919
  title: '主题样式',
15875
15920
  child: [
@@ -16205,7 +16250,7 @@ var AniLinkPopupComponent = memo(AniLinkPopup$1);
16205
16250
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLinkPopup\interactionRender.tsx
16206
16251
  *
16207
16252
  */
16208
- var interactionRender$1 = [
16253
+ var interactionRender$2 = [
16209
16254
  {
16210
16255
  title: '点击事件',
16211
16256
  child: [
@@ -16273,9 +16318,9 @@ const AniLinkPopup = createMaterial(AniLinkPopupComponent, {
16273
16318
  category: 'cta',
16274
16319
  type: 'AniLinkPopup',
16275
16320
  related: {
16276
- settingRender: settingRender$1,
16321
+ settingRender: settingRender$2,
16277
16322
  bindableProps: [],
16278
- interactionRender: interactionRender$1
16323
+ interactionRender: interactionRender$2
16279
16324
  },
16280
16325
  defaulSetting: {
16281
16326
  props: {
@@ -16331,7 +16376,7 @@ const AniLinkPopup = createMaterial(AniLinkPopupComponent, {
16331
16376
  * @FilePath: \pb-sxp-ui\src\materials\sxp\consentPopup\Display\interactionRender.tsx
16332
16377
  *
16333
16378
  */
16334
- var interactionRender = [
16379
+ var interactionRender$1 = [
16335
16380
  {
16336
16381
  title: '点击详情按钮',
16337
16382
  child: [
@@ -16352,7 +16397,7 @@ var interactionRender = [
16352
16397
  * @FilePath: \pb-sxp-ui\src\materials\sxp\consentPopup\Display\settingRender.tsx
16353
16398
  *
16354
16399
  */
16355
- var settingRender = [
16400
+ var settingRender$1 = [
16356
16401
  {
16357
16402
  title: '全局设置',
16358
16403
  child: [
@@ -16507,6 +16552,7 @@ const EditorDataProvider = ({ children, data }) => {
16507
16552
  const [openHashtag, setOpenHashtag] = useState(false);
16508
16553
  const [openConsent, setOpenConsent] = useState(false);
16509
16554
  const [consentPopupCate, setConsentPopupCate] = useState('');
16555
+ const [openMultiPosts, setOpenMultiPosts] = useState(false);
16510
16556
  return (React.createElement(EditorDataContext.Provider, { value: {
16511
16557
  sxpPrameter: {
16512
16558
  bottomImage: (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.bottom_image,
@@ -16531,7 +16577,9 @@ const EditorDataProvider = ({ children, data }) => {
16531
16577
  sxpFontLinks: data === null || data === void 0 ? void 0 : data.sxpFontLinks,
16532
16578
  utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter,
16533
16579
  consentPopupCate,
16534
- setConsentPopupCate
16580
+ setConsentPopupCate,
16581
+ openMultiPosts,
16582
+ setOpenMultiPosts
16535
16583
  } }, children));
16536
16584
  };
16537
16585
  function useEditorDataProvider() {
@@ -16591,9 +16639,9 @@ const Display = createMaterial(DisplayComponent, {
16591
16639
  category: 'consentPopup',
16592
16640
  type: 'Display',
16593
16641
  related: {
16594
- settingRender,
16642
+ settingRender: settingRender$1,
16595
16643
  bindableProps: [],
16596
- interactionRender
16644
+ interactionRender: interactionRender$1
16597
16645
  },
16598
16646
  defaulSetting: {
16599
16647
  props: {
@@ -16622,6 +16670,299 @@ const Display = createMaterial(DisplayComponent, {
16622
16670
  sort: 1
16623
16671
  });
16624
16672
 
16673
+ /*
16674
+ * @Author: binruan@chatlabs.com
16675
+ * @Date: 2024-06-13 10:08:32
16676
+ * @LastEditors: binruan@chatlabs.com
16677
+ * @LastEditTime: 2024-11-26 11:42:08
16678
+ * @FilePath: \pb-sxp-ui\src\materials\sxp\MultiPosts\settingRender.tsx
16679
+ *
16680
+ */
16681
+ var settingRender = [
16682
+ {
16683
+ title: '背景设置',
16684
+ child: [
16685
+ {
16686
+ label: '背景图',
16687
+ type: 'Upload',
16688
+ name: ['props', 'bgImgUrl']
16689
+ },
16690
+ {
16691
+ type: 'Group',
16692
+ label: '返回按钮',
16693
+ child: [
16694
+ {
16695
+ type: 'Switch',
16696
+ name: ['props', 'backButton', 'enable']
16697
+ },
16698
+ {
16699
+ type: 'Upload',
16700
+ name: ['props', 'backButton', 'icon'],
16701
+ text: '建议尺寸:100 * 76'
16702
+ }
16703
+ ]
16704
+ },
16705
+ {
16706
+ type: 'Group',
16707
+ label: '',
16708
+ child: [
16709
+ {
16710
+ type: 'Select',
16711
+ name: ['props', 'backButton', 'xPosit'],
16712
+ options: [
16713
+ {
16714
+ label: '相对左侧',
16715
+ value: 'left'
16716
+ },
16717
+ {
16718
+ label: '相对右侧',
16719
+ value: 'right'
16720
+ }
16721
+ ],
16722
+ initialValue: 'left'
16723
+ },
16724
+ {
16725
+ type: 'Number',
16726
+ name: ['props', 'backButton', 'x'],
16727
+ addonAfter: 'X'
16728
+ }
16729
+ ]
16730
+ },
16731
+ {
16732
+ type: 'Group',
16733
+ label: '',
16734
+ child: [
16735
+ {
16736
+ type: 'Select',
16737
+ name: ['props', 'backButton', 'yPosit'],
16738
+ options: [
16739
+ {
16740
+ label: '相对底部',
16741
+ value: 'bottom'
16742
+ },
16743
+ {
16744
+ label: '相对顶部',
16745
+ value: 'top'
16746
+ }
16747
+ ],
16748
+ initialValue: 'top'
16749
+ },
16750
+ {
16751
+ type: 'Number',
16752
+ name: ['props', 'backButton', 'y'],
16753
+ addonAfter: 'Y',
16754
+ initialValue: 0
16755
+ }
16756
+ ]
16757
+ }
16758
+ ]
16759
+ },
16760
+ {
16761
+ title: '按钮设置',
16762
+ child: [
16763
+ {
16764
+ type: 'Group',
16765
+ child: [
16766
+ {
16767
+ type: 'Upload',
16768
+ name: ['props', 'button1Url'],
16769
+ text: '按钮1'
16770
+ },
16771
+ {
16772
+ type: 'Upload',
16773
+ name: ['props', 'button2Url'],
16774
+ text: '按钮2'
16775
+ }
16776
+ ]
16777
+ },
16778
+ {
16779
+ type: 'Group',
16780
+ child: [
16781
+ {
16782
+ type: 'Upload',
16783
+ name: ['props', 'button3Url'],
16784
+ text: '按钮3'
16785
+ },
16786
+ {
16787
+ type: 'Upload',
16788
+ name: ['props', 'button4Url'],
16789
+ text: '按钮4'
16790
+ }
16791
+ ]
16792
+ }
16793
+ ]
16794
+ }
16795
+ ];
16796
+
16797
+ const MultiPosts$1 = (_a) => {
16798
+ var _b, _c;
16799
+ var { bgImgUrl, style, recData } = _a, props = __rest(_a, ["bgImgUrl", "style", "recData"]);
16800
+ const { setChannel } = useEditor();
16801
+ const { bffEventReport, curTime } = useSxpDataSource();
16802
+ const { isActive } = useSwiperSlide() || {};
16803
+ const initRef = useRef(false);
16804
+ const viewTime = useRef();
16805
+ const traceinfo = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.traceInfo) !== null && _c !== void 0 ? _c : '';
16806
+ const getPropsVal = useCallback((index, str) => {
16807
+ try {
16808
+ return new Function('props', 'str', `if (str) {
16809
+ return props?.button${index + 1}${str}
16810
+ } else {
16811
+ return props?.button${index + 1}
16812
+ }`)(props, str);
16813
+ }
16814
+ catch (_a) { }
16815
+ }, [props]);
16816
+ const handleClick = useCallback((index) => {
16817
+ const v = getPropsVal(index);
16818
+ const value = v === null || v === void 0 ? void 0 : v.value;
16819
+ if (!value)
16820
+ return;
16821
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
16822
+ eventInfo: {
16823
+ eventSubject: 'multiPostClick',
16824
+ eventDescription: 'multiPostClick',
16825
+ traceinfo,
16826
+ branchfeed: (v === null || v === void 0 ? void 0 : v.linkType) === 'recommendFlow' && value ? value : ''
16827
+ }
16828
+ });
16829
+ if ((v === null || v === void 0 ? void 0 : v.linkType) === 'recommendFlow') {
16830
+ endMultiPost('multipostClick');
16831
+ setChannel === null || setChannel === void 0 ? void 0 : setChannel(value);
16832
+ curTime.current = new Date();
16833
+ }
16834
+ else {
16835
+ new Function(value)();
16836
+ }
16837
+ }, [props]);
16838
+ const startMultiPost = useCallback(() => {
16839
+ viewTime.current = new Date();
16840
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
16841
+ eventInfo: {
16842
+ eventSubject: 'startMultiPost',
16843
+ eventDescription: 'startMultiPost',
16844
+ contentFormat: 'IMAGE',
16845
+ position: '0',
16846
+ traceinfo
16847
+ }
16848
+ });
16849
+ }, []);
16850
+ const endMultiPost = useCallback((nextStep) => {
16851
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
16852
+ eventInfo: {
16853
+ eventSubject: 'endMultiPost',
16854
+ eventDescription: 'endMultiPost',
16855
+ contentFormat: 'IMAGE',
16856
+ position: '0',
16857
+ traceinfo,
16858
+ nextStep: nextStep || 'others',
16859
+ timeOnSite: Math.floor((new Date() - (viewTime === null || viewTime === void 0 ? void 0 : viewTime.current)) / 1000) + ''
16860
+ }
16861
+ });
16862
+ }, []);
16863
+ useEffect(() => {
16864
+ if (isActive) {
16865
+ startMultiPost();
16866
+ initRef.current = true;
16867
+ }
16868
+ else if (initRef.current) {
16869
+ endMultiPost();
16870
+ }
16871
+ }, [isActive]);
16872
+ useEffect(() => {
16873
+ const onShow = () => startMultiPost();
16874
+ const onHide = () => endMultiPost();
16875
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
16876
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
16877
+ return () => {
16878
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
16879
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
16880
+ };
16881
+ }, [isActive]);
16882
+ return (React.createElement("div", { className: 'multiposts', style: Object.assign(Object.assign({}, style), getBgStyle(bgImgUrl)) }, Array.from({ length: 4 }, (_, index) => {
16883
+ return (React.createElement("button", { className: 'multiposts-btn', role: 'button', "aria-label": `multiposts-${index + 1}`, onClick: () => handleClick(index) },
16884
+ React.createElement("img", { className: 'multiposts-btn-img', src: getPropsVal(index, 'Url'), alt: `multiposts-img-${index + 1}` })));
16885
+ })));
16886
+ };
16887
+ var MultiPosts$2 = memo(MultiPosts$1);
16888
+
16889
+ /*
16890
+ * @Author: binruan@chatlabs.com
16891
+ * @Date: 2024-11-22 13:58:29
16892
+ * @LastEditors: binruan@chatlabs.com
16893
+ * @LastEditTime: 2024-11-22 17:21:09
16894
+ * @FilePath: \pb-sxp-ui\src\materials\sxp\MultiPosts\interactionRender.tsx
16895
+ *
16896
+ */
16897
+ var interactionRender = [
16898
+ {
16899
+ title: '按钮1点击事件',
16900
+ child: [
16901
+ {
16902
+ type: 'link',
16903
+ name: 'button1',
16904
+ isMultiPosts: true
16905
+ }
16906
+ ]
16907
+ },
16908
+ {
16909
+ title: '按钮2点击事件',
16910
+ child: [
16911
+ {
16912
+ type: 'link',
16913
+ name: 'button2',
16914
+ isMultiPosts: true
16915
+ }
16916
+ ]
16917
+ },
16918
+ {
16919
+ title: '按钮3点击事件',
16920
+ child: [
16921
+ {
16922
+ type: 'link',
16923
+ name: 'button3',
16924
+ isMultiPosts: true
16925
+ }
16926
+ ]
16927
+ },
16928
+ {
16929
+ title: '按钮4点击事件',
16930
+ child: [
16931
+ {
16932
+ type: 'link',
16933
+ name: 'button4',
16934
+ isMultiPosts: true
16935
+ }
16936
+ ]
16937
+ }
16938
+ ];
16939
+
16940
+ /*
16941
+ * @Author: binruan@chatlabs.com
16942
+ * @Date: 2023-07-28 18:29:57
16943
+ * @LastEditors: binruan@chatlabs.com
16944
+ * @LastEditTime: 2024-11-22 13:58:46
16945
+ * @FilePath: \pb-sxp-ui\src\materials\sxp\MultiPosts\material.tsx
16946
+ *
16947
+ */
16948
+ const MultiPosts = createMaterial(MultiPosts$2, {
16949
+ displayName: 'MultiPosts',
16950
+ icon: '',
16951
+ category: 'base',
16952
+ type: 'MultiPosts',
16953
+ related: {
16954
+ settingRender,
16955
+ interactionRender
16956
+ },
16957
+ defaulSetting: {
16958
+ props: {},
16959
+ style: {}
16960
+ },
16961
+ w: 100,
16962
+ h: 40,
16963
+ sort: 1
16964
+ });
16965
+
16625
16966
  /*
16626
16967
  * @Author: binruan@chatlabs.com
16627
16968
  * @Date: 2023-07-25 14:56:49
@@ -16652,6 +16993,7 @@ var _materials_ = /*#__PURE__*/Object.freeze({
16652
16993
  MultiCommodity: MultiCommodity,
16653
16994
  MultiCommodityDiro: MultiCommodityDiro,
16654
16995
  MultiCommodityDiroNew: MultiCommodityDiroNew,
16996
+ MultiPosts: MultiPosts,
16655
16997
  Prompt: Prompt
16656
16998
  });
16657
16999
 
@@ -17236,6 +17578,8 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
17236
17578
  // return <img src={sxpParameter?.placeholder_image} style={{ width, height, objectFit: 'cover' }} />;
17237
17579
  // }
17238
17580
  useEffect(() => {
17581
+ if (!isActive)
17582
+ return;
17239
17583
  const onShow = () => onViewImageStartEvent(index, imgInfo);
17240
17584
  const onHide = () => onViewImageEndEvent(rec);
17241
17585
  SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
@@ -17244,7 +17588,7 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
17244
17588
  SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
17245
17589
  SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
17246
17590
  };
17247
- }, [imgInfo]);
17591
+ }, [isActive, imgInfo]);
17248
17592
  const handleMouseEnter = useCallback(() => {
17249
17593
  if (swiperRef.current && swiperRef.current.swiper && isAlly) {
17250
17594
  swiperRef.current.swiper.autoplay.stop();
@@ -17551,27 +17895,35 @@ const Consent = ({ resolver, globalConfig }) => {
17551
17895
  };
17552
17896
  var ConsentPopup = memo(Consent);
17553
17897
 
17898
+ const NavBack = ({ data, minusHeight, tagHeight, onClick }) => {
17899
+ var _a, _b, _c, _d, _e;
17900
+ return (React.createElement("button", { style: {
17901
+ position: 'absolute',
17902
+ [(_a = data === null || data === void 0 ? void 0 : data.xPosit) !== null && _a !== void 0 ? _a : 'left']: (_c = (_b = data === null || data === void 0 ? void 0 : data.backButton) === null || _b === void 0 ? void 0 : _b.x) !== null && _c !== void 0 ? _c : 0,
17903
+ [(_d = data === null || data === void 0 ? void 0 : data.yPosit) !== null && _d !== void 0 ? _d : 'top']: ((data === null || data === void 0 ? void 0 : data.yPosit) == 'top' ? minusHeight + tagHeight : 0) + ((_e = data === null || data === void 0 ? void 0 : data.y) !== null && _e !== void 0 ? _e : 0),
17904
+ zIndex: 8,
17905
+ border: 'none',
17906
+ padding: 0,
17907
+ background: 'transparent'
17908
+ }, role: 'button', "aria-label": 'back button', onClick: onClick },
17909
+ React.createElement("img", { src: (data === null || data === void 0 ? void 0 : data.icon) || img, alt: 'back button', width: 100, style: { objectFit: 'cover' } })));
17910
+ };
17911
+ var NavBack$1 = memo(NavBack);
17912
+
17554
17913
  /*
17555
17914
  * @Author: binruan@chatlabs.com
17556
17915
  * @Date: 2024-03-20 10:27:31
17557
17916
  * @LastEditors: binruan@chatlabs.com
17558
- * @LastEditTime: 2024-11-21 11:01:19
17559
- * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
17560
- *
17561
- */
17562
- /*
17563
- * @Author: binruan@chatlabs.com
17564
- * @Date: 2024-01-15 19:03:09
17565
- * @LastEditors: binruan@chatlabs.com
17566
- * @LastEditTime: 2024-11-04 14:55:23
17917
+ * @LastEditTime: 2024-11-27 15:55:34
17567
17918
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
17568
17919
  *
17569
17920
  */
17570
17921
  const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, hashTagRightMargin, tagList = [], licenseUrl }) => {
17571
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
17922
+ 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;
17572
17923
  const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
17573
17924
  const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
17574
- const { schema } = useEditor();
17925
+ const { schema, channel } = useEditor();
17926
+ const { openMultiPosts } = useEditorDataProvider();
17575
17927
  const [activeIndex, setActiveIndex] = useState(0);
17576
17928
  const viewImageStartTime = useRef(0);
17577
17929
  const [isMuted, setIsMuted] = useState(true);
@@ -17756,15 +18108,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
17756
18108
  return null;
17757
18109
  }, [globalConfig, activeIndex, visList]);
17758
18110
  const renderContent = useCallback((rec, index) => {
17759
- var _a, _b, _c, _d;
17760
- if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
18111
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
18112
+ if (rec === 'organic menu') {
18113
+ return (React.createElement(MultiPosts$2, Object.assign({ recData: data === null || data === void 0 ? void 0 : data[1] }, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props, (_f = (_e = (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.item) === null || _f === void 0 ? void 0 : _f.event)));
18114
+ }
18115
+ if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
17761
18116
  return (React.createElement(VideoWidget$3, { key: isReload, rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon }));
17762
18117
  }
17763
- if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
18118
+ if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
17764
18119
  return (React.createElement(PictureGroup$3, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onViewImageEndEvent: handleViewImageStartEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
17765
18120
  }
17766
- if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.length) > 0) {
17767
- return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
18121
+ if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _j === void 0 ? void 0 : _j.length) > 0) {
18122
+ return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
17768
18123
  var _a, _b, _c, _d, _e, _f, _g, _h;
17769
18124
  const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
17770
18125
  const Component = withBindDataSource(t);
@@ -18072,18 +18427,19 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
18072
18427
  React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
18073
18428
  top: minusHeight
18074
18429
  } }),
18075
- ((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && (React.createElement("button", { style: {
18076
- position: 'absolute',
18077
- [(_h = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _g === void 0 ? void 0 : _g.xPosit) !== null && _h !== void 0 ? _h : 'left']: (_k = (_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _j === void 0 ? void 0 : _j.x) !== null && _k !== void 0 ? _k : 0,
18078
- [(_m = (_l = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _l === void 0 ? void 0 : _l.yPosit) !== null && _m !== void 0 ? _m : 'top']: (((_o = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _o === void 0 ? void 0 : _o.yPosit) == 'top' ? minusHeight + tagHeight : 0) +
18079
- ((_q = (_p = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _p === void 0 ? void 0 : _p.y) !== null && _q !== void 0 ? _q : 0),
18080
- zIndex: 8,
18081
- border: 'none',
18082
- padding: 0,
18083
- background: 'transparent'
18084
- }, role: 'button', "aria-label": 'back button', onClick: () => history === null || history === void 0 ? void 0 : history.back() },
18085
- React.createElement("img", { src: ((_r = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _r === void 0 ? void 0 : _r.icon) || img, alt: 'back button', width: 100, style: { objectFit: 'cover' } }))),
18086
- isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _s !== void 0 ? _s : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
18430
+ ((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && !channel && !openMultiPosts && (React.createElement(NavBack$1, { data: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => history === null || history === void 0 ? void 0 : history.back() })),
18431
+ ((((_l = (_k = (_j = (_h = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.item) === null || _j === void 0 ? void 0 : _j.props) === null || _k === void 0 ? void 0 : _k.backButton) === null || _l === void 0 ? void 0 : _l.enable) && channel) || openMultiPosts) && (React.createElement(NavBack$1, { data: (_q = (_p = (_o = (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.item) === null || _p === void 0 ? void 0 : _p.props) === null || _q === void 0 ? void 0 : _q.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => {
18432
+ var _a, _b, _c;
18433
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
18434
+ eventInfo: {
18435
+ eventSubject: 'backMultiPostClick',
18436
+ eventDescription: 'backMultiPostClick',
18437
+ traceinfo: (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.traceInfo) !== null && _c !== void 0 ? _c : ''
18438
+ }
18439
+ });
18440
+ location === null || location === void 0 ? void 0 : location.reload();
18441
+ } })),
18442
+ isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_r = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _r !== void 0 ? _r : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
18087
18443
  React.createElement(Swiper, { style: {
18088
18444
  marginTop: tagHeight
18089
18445
  }, ref: swiperRef, onSlideChange: () => {
@@ -18115,8 +18471,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
18115
18471
  renderView,
18116
18472
  renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
18117
18473
  renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
18118
- React.createElement(WaterFall$1, Object.assign({}, (_v = (_u = (_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _t === void 0 ? void 0 : _t[0]) === null || _u === void 0 ? void 0 : _u.item) === null || _v === void 0 ? void 0 : _v.props)),
18119
- React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig })));
18474
+ React.createElement(WaterFall$1, Object.assign({}, (_u = (_t = (_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.item) === null || _u === void 0 ? void 0 : _u.props)),
18475
+ React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
18476
+ openMultiPosts && (React.createElement(MultiPosts$2, Object.assign({}, (_x = (_w = (_v = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.item) === null || _x === void 0 ? void 0 : _x.props, (_0 = (_z = (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.item) === null || _0 === void 0 ? void 0 : _0.event, { style: { position: 'fixed', top: 0, left: 0, right: 0 } })))));
18120
18477
  };
18121
18478
 
18122
18479
  const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
@@ -18581,7 +18938,7 @@ const Popup = () => {
18581
18938
  * @Author: binruan@chatlabs.com
18582
18939
  * @Date: 2024-01-15 19:03:09
18583
18940
  * @LastEditors: binruan@chatlabs.com
18584
- * @LastEditTime: 2024-07-24 16:35:44
18941
+ * @LastEditTime: 2024-09-30 14:37:13
18585
18942
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
18586
18943
  *
18587
18944
  */
@@ -18597,18 +18954,19 @@ const RESOLVER = {};
18597
18954
  Object.values(_materials_).forEach((v) => {
18598
18955
  RESOLVER[v.extend.type] = v;
18599
18956
  });
18600
- const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl, enabledMetaConversionApi }) => {
18601
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
18957
+ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, enabledMetaConversionApi, dataList }) => {
18958
+ var _a, _b, _c, _d, _e, _f;
18602
18959
  const utmVal = useMemo(() => {
18603
18960
  var _a;
18604
18961
  const searchParams = (location === null || location === void 0 ? void 0 : location.search) ? (_a = location === null || location === void 0 ? void 0 : location.search) === null || _a === void 0 ? void 0 : _a.replace('?', '') : '';
18605
18962
  return searchParams;
18606
18963
  }, []);
18607
- return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
18608
- React.createElement(SxpDataSourceProvider$1, { 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, isShowTag: (_j = (_h = (_g = data === null || data === void 0 ? void 0 : data.data) === null || _g === void 0 ? void 0 : _g.sxpPageConf) === null || _h === void 0 ? void 0 : _h.globalConfig) === null || _j === void 0 ? void 0 : _j.isShowTag, globalConfig: (_l = (_k = data === null || data === void 0 ? void 0 : data.data) === null || _k === void 0 ? void 0 : _k.sxpPageConf) === null || _l === void 0 ? void 0 : _l.globalConfig, utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter, render: ({ rtcList, tagList }) => {
18964
+ const [_schema, setSchema] = useState(data === null || data === void 0 ? void 0 : data.data);
18965
+ return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: _schema, utmVal: utmVal },
18966
+ React.createElement(SxpDataSourceProvider$1, { 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, utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter, data: data, dataList: dataList, onUpdateSchema: (d) => setSchema(d), render: ({ rtcList, tagList, pageData }) => {
18609
18967
  var _a;
18610
18968
  return (React.createElement(React.Fragment, null,
18611
- 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 })),
18969
+ React.createElement(SxpPageRender, Object.assign({}, (_a = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER })),
18612
18970
  React.createElement(Popup, null)));
18613
18971
  } })));
18614
18972
  };