pb-sxp-ui 1.15.13-alpha.2 → 1.15.13-alpha.4

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 (31) hide show
  1. package/dist/index.cjs +146 -111
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +144 -109
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.cjs +6 -6
  6. package/dist/index.min.cjs.map +1 -1
  7. package/dist/index.min.js +6 -6
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/pb-ui.js +146 -111
  10. package/dist/pb-ui.js.map +1 -1
  11. package/dist/pb-ui.min.js +6 -6
  12. package/dist/pb-ui.min.js.map +1 -1
  13. package/es/core/components/DiyStoryPreview/VideoWidget.d.ts +2 -0
  14. package/es/core/components/DiyStoryPreview/VideoWidget.js +6 -4
  15. package/es/core/components/DiyStoryPreview/index.d.ts +3 -0
  16. package/es/core/components/DiyStoryPreview/index.js +36 -24
  17. package/es/core/components/SxpPageCore/index.d.ts +1 -0
  18. package/es/core/components/SxpPageCore/index.js +7 -7
  19. package/es/core/context/EditorContext.js +1 -1
  20. package/es/core/context/SxpDataSourceProvider.d.ts +1 -1
  21. package/es/core/context/SxpDataSourceProvider.js +23 -24
  22. package/lib/core/components/DiyStoryPreview/VideoWidget.d.ts +2 -0
  23. package/lib/core/components/DiyStoryPreview/VideoWidget.js +6 -4
  24. package/lib/core/components/DiyStoryPreview/index.d.ts +3 -0
  25. package/lib/core/components/DiyStoryPreview/index.js +34 -22
  26. package/lib/core/components/SxpPageCore/index.d.ts +1 -0
  27. package/lib/core/components/SxpPageCore/index.js +7 -7
  28. package/lib/core/context/EditorContext.js +1 -1
  29. package/lib/core/context/SxpDataSourceProvider.d.ts +1 -1
  30. package/lib/core/context/SxpDataSourceProvider.js +23 -24
  31. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -451,39 +451,6 @@ const Pagebuilder = {
451
451
  })
452
452
  };
453
453
 
454
- function useEditor() {
455
- return React.useContext(EditorContext);
456
- }
457
-
458
- function useDataSource() {
459
- return React.useContext(DataSourceContext);
460
- }
461
-
462
- const feRealSessionIdKey = 'feRealSessionIdKey';
463
- const generateFeSessionId = () => {
464
- const uid = getUid(); // 32位长度
465
- const timestamp = Date.now(); // 13位长度
466
- const result = `${timestamp}${uid}`; // 总共45位长度的唯一ID
467
- return result;
468
- };
469
- // 生成或者获取sessionID
470
- const storeAndLoadFeSessionId = () => {
471
- let result = getFeSessionId();
472
- if (!result) {
473
- result = generateFeSessionId();
474
- window.localStorage.setItem(feRealSessionIdKey, result);
475
- }
476
- return result;
477
- };
478
- const refreshFeSessionId = () => {
479
- const result = generateFeSessionId();
480
- window.localStorage.setItem(feRealSessionIdKey, result);
481
- };
482
- // 获取 sessionID
483
- const getFeSessionId = () => {
484
- return window.localStorage.getItem(feRealSessionIdKey);
485
- };
486
-
487
454
  /*
488
455
  * @Author: binruan@chatlabs.com
489
456
  * @Date: 2024-03-20 10:27:31
@@ -535,6 +502,39 @@ const setUserConsentResult = () => {
535
502
  window.localStorage.setItem(USER_CONSENT_RESULT_KEY, 'true');
536
503
  };
537
504
 
505
+ function useEditor() {
506
+ return React.useContext(EditorContext);
507
+ }
508
+
509
+ function useDataSource() {
510
+ return React.useContext(DataSourceContext);
511
+ }
512
+
513
+ const feRealSessionIdKey = 'feRealSessionIdKey';
514
+ const generateFeSessionId = () => {
515
+ const uid = getUid(); // 32位长度
516
+ const timestamp = Date.now(); // 13位长度
517
+ const result = `${timestamp}${uid}`; // 总共45位长度的唯一ID
518
+ return result;
519
+ };
520
+ // 生成或者获取sessionID
521
+ const storeAndLoadFeSessionId = () => {
522
+ let result = getFeSessionId();
523
+ if (!result) {
524
+ result = generateFeSessionId();
525
+ window.localStorage.setItem(feRealSessionIdKey, result);
526
+ }
527
+ return result;
528
+ };
529
+ const refreshFeSessionId = () => {
530
+ const result = generateFeSessionId();
531
+ window.localStorage.setItem(feRealSessionIdKey, result);
532
+ };
533
+ // 获取 sessionID
534
+ const getFeSessionId = () => {
535
+ return window.localStorage.getItem(feRealSessionIdKey);
536
+ };
537
+
538
538
  /*
539
539
  * @Author: binruan@chatlabs.com
540
540
  * @Date: 2024-03-20 10:27:31
@@ -779,17 +779,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
779
779
  }, [bffDataSource]);
780
780
  // 获取推荐视频数据
781
781
  const getRecommendVideos = React.useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
782
- var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
783
- query = 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 }));
782
+ var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
783
+ query = Object.assign({ maxSize: 50, defaultSize: 50, 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 }));
784
784
  if (channel) {
785
785
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
786
786
  }
787
787
  else if (utmVal) {
788
- const val = (_k = (_j = (_h = splitUrlParams(utmVal)) === null || _h === void 0 ? void 0 : _h.filter((val) => {
789
- var _a, _b;
788
+ const val = (_h = (_g = (_f = splitUrlParams(utmVal)) === null || _f === void 0 ? void 0 : _f.filter((val) => {
790
789
  const key = val.split('=')[0];
791
- 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);
792
- })) === null || _j === void 0 ? void 0 : _j.join('&')) !== null && _k !== void 0 ? _k : '';
790
+ return key;
791
+ })) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
793
792
  if (val)
794
793
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
795
794
  }
@@ -803,19 +802,19 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
803
802
  let list = [];
804
803
  let result = null;
805
804
  const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
806
- var _v, _w, _x, _y, _z, _0;
805
+ var _t, _u, _v, _w, _x, _y;
807
806
  query.pageNum = pageNum;
808
807
  result = yield (bffFetchAdmin === null || bffFetchAdmin === void 0 ? void 0 : bffFetchAdmin('recommend/direct_page', { method: 'POST', body: query }));
809
808
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
810
809
  return undefined;
811
810
  }
812
811
  setLoading(false);
813
- 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 : []);
812
+ 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 : []);
814
813
  if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
815
814
  setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
816
815
  setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
817
816
  }
818
- 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));
817
+ 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));
819
818
  if (isNotNullList) {
820
819
  pageNum = pageNum + 1;
821
820
  yield recurveRecList(query);
@@ -823,13 +822,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
823
822
  });
824
823
  yield recurveRecList(query);
825
824
  if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
826
- 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 });
825
+ 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 });
827
826
  return Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list });
828
827
  }
829
828
  if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
830
- 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 });
829
+ 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 });
831
830
  }
832
- const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', { method: 'POST', body: query }));
831
+ const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v3/recommend/direct', { method: 'POST', body: query }));
833
832
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
834
833
  return undefined;
835
834
  }
@@ -837,8 +836,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
837
836
  setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
838
837
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
839
838
  let list = [];
840
- 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 : []);
841
- 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));
839
+ 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 : []);
840
+ 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));
842
841
  if (!isNotNullList) {
843
842
  setIsNoMoreData(true);
844
843
  }
@@ -847,12 +846,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
847
846
  return result === null || result === void 0 ? void 0 : result.data;
848
847
  }), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin]);
849
848
  const loadVideos = React.useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
850
- var _1, _2, _3, _4;
849
+ var _z, _0, _1, _2;
851
850
  if (rtcList.length <= 0) {
852
851
  return;
853
852
  }
854
853
  const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
855
- 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 })));
854
+ 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 })));
856
855
  setRtcList(rtcList.concat(getFilterRecList(data)));
857
856
  setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
858
857
  return data;
@@ -1017,18 +1016,18 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1017
1016
  }), [bffFetch]);
1018
1017
  // 获取 Tag
1019
1018
  const bffGetTagList = React.useCallback((data) => __awaiter(void 0, void 0, void 0, function* () {
1020
- var _5, _6, _7, _8, _9, _10, _11, _12;
1021
- 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);
1019
+ var _3, _4, _5, _6, _7, _8, _9, _10;
1020
+ const isShowTag = !!((_5 = (_4 = (_3 = data === null || data === void 0 ? void 0 : data.data) === null || _3 === void 0 ? void 0 : _3.sxpPageConf) === null || _4 === void 0 ? void 0 : _4.globalConfig) === null || _5 === void 0 ? void 0 : _5.isShowTag);
1022
1021
  if (!utmVal || !isShowTag)
1023
1022
  return;
1024
1023
  try {
1025
- const val = (_10 = (_9 = (_8 = splitUrlParams(utmVal)) === null || _8 === void 0 ? void 0 : _8.filter((val) => {
1024
+ const val = (_8 = (_7 = (_6 = splitUrlParams(utmVal)) === null || _6 === void 0 ? void 0 : _6.filter((val) => {
1026
1025
  var _a, _b;
1027
1026
  const key = val.split('=')[0];
1028
1027
  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);
1029
- })) === null || _9 === void 0 ? void 0 : _9.join('&')) !== null && _10 !== void 0 ? _10 : '';
1028
+ })) === null || _7 === void 0 ? void 0 : _7.join('&')) !== null && _8 !== void 0 ? _8 : '';
1030
1029
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
1031
- 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 : []);
1030
+ setTagList((_10 = (_9 = result === null || result === void 0 ? void 0 : result.data) === null || _9 === void 0 ? void 0 : _9.tags) !== null && _10 !== void 0 ? _10 : []);
1032
1031
  }
1033
1032
  catch (e) {
1034
1033
  console.log('e', e);
@@ -1088,10 +1087,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1088
1087
  });
1089
1088
  }, [bffEventReport]);
1090
1089
  const getAccount = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
1091
- var _13, _14;
1090
+ var _11, _12;
1092
1091
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account', { method: 'GET' }));
1093
- setChatlabsId((_13 = res === null || res === void 0 ? void 0 : res.data) === null || _13 === void 0 ? void 0 : _13.chatLabsId);
1094
- return ((_14 = res === null || res === void 0 ? void 0 : res.data) === null || _14 === void 0 ? void 0 : _14.consentResult) === 'true';
1092
+ setChatlabsId((_11 = res === null || res === void 0 ? void 0 : res.data) === null || _11 === void 0 ? void 0 : _11.chatLabsId);
1093
+ return ((_12 = res === null || res === void 0 ? void 0 : res.data) === null || _12 === void 0 ? void 0 : _12.consentResult) === 'true';
1095
1094
  }), [bffFetch]);
1096
1095
  const accountSonsent = React.useCallback((consentResult) => __awaiter(void 0, void 0, void 0, function* () {
1097
1096
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account/consent', {
@@ -18321,7 +18320,7 @@ function withBindDataSource(Component) {
18321
18320
  * @Author: binruan@chatlabs.com
18322
18321
  * @Date: 2023-12-26 16:11:34
18323
18322
  * @LastEditors: binruan@chatlabs.com
18324
- * @LastEditTime: 2025-03-26 19:32:00
18323
+ * @LastEditTime: 2025-03-28 14:46:08
18325
18324
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
18326
18325
  *
18327
18326
  */
@@ -19086,7 +19085,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
19086
19085
  React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
19087
19086
  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 } })))))));
19088
19087
  };
19089
- var SxpPageRender$1 = React.memo(SxpPageRender);
19088
+ var index$2 = React.memo(SxpPageRender);
19090
19089
 
19091
19090
  const PictureGroup$2 = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
19092
19091
  return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
@@ -19450,7 +19449,7 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
19450
19449
  return renderView(rec, index);
19451
19450
  })));
19452
19451
  };
19453
- var index$2 = React.memo(DiyPortalPreview);
19452
+ var index$1 = React.memo(DiyPortalPreview);
19454
19453
 
19455
19454
  const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index, swiperRef, data = [], loopPlay }) => {
19456
19455
  const { isActive } = useSwiperSlide();
@@ -19483,7 +19482,7 @@ const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index, s
19483
19482
  };
19484
19483
  var PictureGroup$1 = React.memo(PictureGroup);
19485
19484
 
19486
- const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width, swiperRef, loopPlay }) => {
19485
+ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width, swiperRef, loopPlay, videoPlayIcon, isPlay }) => {
19487
19486
  const { isActive } = useSwiperSlide();
19488
19487
  const [isPauseVideo, setIsPauseVideo] = React.useState(false);
19489
19488
  const videoRef = React.useRef(null);
@@ -19504,7 +19503,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
19504
19503
  var _a;
19505
19504
  (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
19506
19505
  }, []);
19507
- useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
19506
+ const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
19508
19507
  const handlePlaying = React.useCallback(() => {
19509
19508
  var _a, _b, _c, _d, _e, _f;
19510
19509
  setIsPauseVideo(false);
@@ -19542,6 +19541,9 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
19542
19541
  break;
19543
19542
  default:
19544
19543
  if (isPause) {
19544
+ // if (videoRef?.current?.currentTime >= rec?.endTime) {
19545
+ // videoRef.current.currentTime = rec?.startTime;
19546
+ // }
19545
19547
  (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
19546
19548
  }
19547
19549
  else {
@@ -19590,6 +19592,14 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
19590
19592
  (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
19591
19593
  }
19592
19594
  }, []);
19595
+ // useEffect(() => {
19596
+ // if (!videoRef.current || !isActive) return;
19597
+ // if (isPlay) {
19598
+ // videoRef.current?.play();
19599
+ // } else {
19600
+ // videoRef.current?.pause();
19601
+ // }
19602
+ // }, [isPlay, isActive]);
19593
19603
  const handlePause = () => {
19594
19604
  var _a, _b, _c, _d, _e, _f;
19595
19605
  if (!videoRef.current || !isActive)
@@ -19604,15 +19614,6 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
19604
19614
  (_f = (_e = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _e === void 0 ? void 0 : _e.swiper) === null || _f === void 0 ? void 0 : _f.slideTo(i + 1);
19605
19615
  }
19606
19616
  };
19607
- // useEffect(() => {
19608
- // if (!videoRef.current) return;
19609
- // if (!isActive) return;
19610
- // if (!loopPlay) {
19611
- // videoRef?.current?.pause();
19612
- // } else {
19613
- // videoRef?.current?.play();
19614
- // }
19615
- // }, [loopPlay, isActive]);
19616
19617
  React.useEffect(() => {
19617
19618
  var _a, _b, _c;
19618
19619
  if (!isActive)
@@ -19659,7 +19660,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
19659
19660
  (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('timeupdate', handleTimeUpload);
19660
19661
  };
19661
19662
  }, [handleLoadedMetadata, handlePlaying, rec, handLoadeddata, isActive, loopPlay]);
19662
- React.useMemo(() => {
19663
+ const renderPoster = React.useMemo(() => {
19663
19664
  if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
19664
19665
  return null;
19665
19666
  }
@@ -19676,14 +19677,35 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
19676
19677
  if (!(rec === null || rec === void 0 ? void 0 : rec.mediaUrl)) {
19677
19678
  return null;
19678
19679
  }
19680
+ // const renderLoading = useMemo(() => {
19681
+ // if (!waiting || !isLoadFinish) return;
19682
+ // return (
19683
+ // <img
19684
+ // style={{
19685
+ // position: 'absolute',
19686
+ // top: '50%',
19687
+ // left: 0,
19688
+ // right: 0,
19689
+ // transform: 'translateY(-100%)',
19690
+ // margin: 'auto',
19691
+ // width: '50px',
19692
+ // height: '50px',
19693
+ // objectFit: 'contain'
19694
+ // }}
19695
+ // src={loading_gif}
19696
+ // alt='placeholder image'
19697
+ // />
19698
+ // );
19699
+ // }, [waiting, isLoadFinish]);
19679
19700
  return (React.createElement("div", { className: 'video-container', key: rec.itemId, style: {
19680
19701
  position: 'relative',
19681
19702
  width: '100%',
19682
19703
  height,
19683
- overflow: 'hidden',
19684
- pointerEvents: 'none'
19704
+ overflow: 'hidden'
19685
19705
  } },
19686
- React.createElement("div", { className: 'n-full-screen', id: videoId, style: { width: '100%', height: '100%' } })));
19706
+ React.createElement("div", { className: 'n-full-screen', id: videoId, style: { width: '100%', height: '100%' } }),
19707
+ renderPoster,
19708
+ isPauseVideo && React.createElement(FormatImage$1, { className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' })));
19687
19709
  };
19688
19710
  var VideoWidget$1 = React.memo(VideoWidget);
19689
19711
 
@@ -19691,16 +19713,10 @@ var VideoWidget$1 = React.memo(VideoWidget);
19691
19713
  * @Author: binruan@chatlabs.com
19692
19714
  * @Date: 2025-03-25 13:54:27
19693
19715
  * @LastEditors: binruan@chatlabs.com
19694
- * @LastEditTime: 2025-03-26 22:40:52
19716
+ * @LastEditTime: 2025-03-28 18:08:02
19695
19717
  * @FilePath: \pb-sxp-ui\src\core\components\DiyStoryPreview\index.tsx
19696
19718
  *
19697
19719
  */
19698
- const RESOLVER$1 = {};
19699
- Object.values(_materials_).forEach((v) => {
19700
- RESOLVER$1[v.extend.type] = v;
19701
- });
19702
- const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
19703
- const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
19704
19720
  const recData = {
19705
19721
  position: 0,
19706
19722
  isCollected: false,
@@ -19879,7 +19895,14 @@ const recData = {
19879
19895
  ]
19880
19896
  }
19881
19897
  };
19882
- const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [], scenes, onActiveChange, activeIndex, loopPlay = false }) => {
19898
+ const RESOLVER$1 = {};
19899
+ Object.values(_materials_).forEach((v) => {
19900
+ RESOLVER$1[v.extend.type] = v;
19901
+ });
19902
+ const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
19903
+ const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
19904
+ const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [], scenes, onActiveChange, activeIndex, loopPlay = false, pointerEvents = 'none', isPlay }) => {
19905
+ const [loopPlaySwiper, setLooPlaySwiper] = React.useState(loopPlay);
19883
19906
  const swiperRef = React.useRef(null);
19884
19907
  React.useMemo(() => {
19885
19908
  let minusHeight = 0;
@@ -19905,10 +19928,10 @@ const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, des
19905
19928
  const renderContent = (rec, index) => {
19906
19929
  const isVideo = isVideoUrl(rec === null || rec === void 0 ? void 0 : rec.mediaUrl);
19907
19930
  if (isVideo) {
19908
- return (React.createElement(VideoWidget$1, { rec: rec, index: index, muted: true, width: containerWidth, data: scenes !== null && scenes !== void 0 ? scenes : [], height: containerHeight, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, swiperRef: swiperRef, loopPlay: loopPlay }));
19931
+ return (React.createElement(VideoWidget$1, { isPlay: isPlay, rec: rec, index: index, muted: true, width: containerWidth, data: scenes !== null && scenes !== void 0 ? scenes : [], height: containerHeight, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon, swiperRef: swiperRef, loopPlay: loopPlaySwiper }));
19909
19932
  }
19910
19933
  else {
19911
- return (React.createElement(PictureGroup$1, { key: rec.itemId, imgUrls: [rec === null || rec === void 0 ? void 0 : rec.mediaUrl], width: containerWidth, height: containerHeight, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost, data: scenes !== null && scenes !== void 0 ? scenes : [], swiperRef: swiperRef, loopPlay: loopPlay }));
19934
+ return (React.createElement(PictureGroup$1, { key: rec.itemId, imgUrls: [rec === null || rec === void 0 ? void 0 : rec.mediaUrl], width: containerWidth, height: containerHeight, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost, data: scenes !== null && scenes !== void 0 ? scenes : [], swiperRef: swiperRef, loopPlay: loopPlaySwiper }));
19912
19935
  }
19913
19936
  };
19914
19937
  React.useMemo(() => {
@@ -19941,7 +19964,7 @@ const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, des
19941
19964
  width: '100%',
19942
19965
  willChange: 'transform',
19943
19966
  zIndex: 2,
19944
- pointerEvents: 'none'
19967
+ pointerEvents
19945
19968
  } })),
19946
19969
  React.createElement("div", { style: {
19947
19970
  marginBottom: `${(_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _g !== void 0 ? _g : 40}px`,
@@ -20025,6 +20048,7 @@ const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, des
20025
20048
  var _a, _b, _c, _d;
20026
20049
  const rec = lodash.cloneDeep(recData);
20027
20050
  rec.video.bindProducts = item === null || item === void 0 ? void 0 : item.bindProducts;
20051
+ rec.video.title = (item === null || item === void 0 ? void 0 : item.title) || '';
20028
20052
  return (React.createElement("div", { style: { position: 'relative' } },
20029
20053
  React.createElement(SwiperSlide, { key: index, virtualIndex: index, style: { overflow: 'hidden', position: 'relative' } },
20030
20054
  renderBottom(rec, index),
@@ -20046,28 +20070,47 @@ const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, des
20046
20070
  (_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slideTo(activeIndex);
20047
20071
  }, [activeIndex]);
20048
20072
  React.useEffect(() => {
20049
- var _a, _b;
20050
20073
  if (!(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current))
20051
20074
  return;
20052
- (_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slideTo(0);
20075
+ // swiperRef?.current?.swiper?.slideTo(0);
20076
+ setLooPlaySwiper(loopPlay);
20053
20077
  }, [loopPlay]);
20078
+ const handleSessionExpire = React.useCallback(lodash.debounce(() => {
20079
+ setLooPlaySwiper(false);
20080
+ }, 1000), []);
20081
+ React.useEffect(() => {
20082
+ const events = ['touchstart', 'touchcancel'];
20083
+ events.forEach((event) => {
20084
+ window.addEventListener(event, handleSessionExpire);
20085
+ });
20086
+ return () => {
20087
+ events.forEach((event) => {
20088
+ window.removeEventListener(event, handleSessionExpire);
20089
+ });
20090
+ };
20091
+ }, [handleSessionExpire]);
20054
20092
  return (React.createElement("div", { id: 'sxp-render',
20055
20093
  // className={style['clc-sxp-container']}
20056
- style: { height: containerHeight, position: 'relative', pointerEvents: 'none' } },
20057
- React.createElement(Swiper, { ref: swiperRef, allowTouchMove: false, onActiveIndexChange: (swiper) => {
20094
+ style: { height: containerHeight, position: 'relative', pointerEvents } },
20095
+ React.createElement(Swiper, { ref: swiperRef, allowTouchMove: pointerEvents !== 'none', onSlideChange: () => {
20096
+ swiperRef.current.swiper.allowTouchMove = false;
20097
+ setTimeout(() => {
20098
+ swiperRef.current.swiper.allowTouchMove = true;
20099
+ }, 500);
20100
+ }, onActiveIndexChange: (swiper) => {
20058
20101
  // setActiveIndex(swiper.activeIndex);
20059
20102
  onActiveChange === null || onActiveChange === void 0 ? void 0 : onActiveChange(swiper.activeIndex);
20060
20103
  }, direction: 'vertical', style: { overflow: 'hidden', height: containerHeight }, height: containerHeight }, scenes === null || scenes === void 0 ? void 0 : scenes.map((rec, index) => {
20061
20104
  return renderView(rec, index);
20062
20105
  }))));
20063
20106
  };
20064
- var index$1 = React.memo(DiyStoryPreview);
20107
+ var DiyStoryPreview$1 = React.memo(DiyStoryPreview);
20065
20108
 
20066
20109
  /*
20067
20110
  * @Author: binruan@chatlabs.com
20068
20111
  * @Date: 2023-10-31 10:56:01
20069
20112
  * @LastEditors: binruan@chatlabs.com
20070
- * @LastEditTime: 2024-10-23 15:07:29
20113
+ * @LastEditTime: 2025-03-28 17:15:47
20071
20114
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
20072
20115
  *
20073
20116
  */
@@ -20159,17 +20202,9 @@ const Popup = () => {
20159
20202
 
20160
20203
  /*
20161
20204
  * @Author: binruan@chatlabs.com
20162
- * @Date: 2024-01-15 19:03:09
20163
- * @LastEditors: binruan@chatlabs.com
20164
- * @LastEditTime: 2025-02-24 15:47:44
20165
- * @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
20166
- *
20167
- */
20168
- /*
20169
- * @Author: binruan@chatlabs.com
20170
- * @Date: 2023-11-24 15:58:00
20205
+ * @Date: 2024-03-20 10:27:31
20171
20206
  * @LastEditors: binruan@chatlabs.com
20172
- * @LastEditTime: 2023-12-26 10:24:42
20207
+ * @LastEditTime: 2025-03-28 16:55:21
20173
20208
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
20174
20209
  *
20175
20210
  */
@@ -20177,20 +20212,20 @@ const RESOLVER = {};
20177
20212
  Object.values(_materials_).forEach((v) => {
20178
20213
  RESOLVER[v.extend.type] = v;
20179
20214
  });
20180
- const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, enabledMetaConversionApi, dataList }) => {
20181
- var _a, _b, _c, _d, _e, _f;
20215
+ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, enabledMetaConversionApi, dataList, pointerEvents }) => {
20216
+ var _a, _b, _c, _d, _e, _f, _g, _h;
20182
20217
  const utmVal = React.useMemo(() => {
20183
20218
  var _a;
20184
20219
  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('?', '') : '';
20185
20220
  return searchParams;
20186
20221
  }, []);
20187
- const [_schema, setSchema] = React.useState(data === null || data === void 0 ? void 0 : data.data);
20222
+ const [_schema, setSchema] = React.useState((_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.data);
20188
20223
  const [channel, setChannel] = React.useState();
20189
20224
  return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: _schema, utmVal: channel || utmVal },
20190
- 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), onUpdateChannel: (d) => setChannel(d), render: ({ rtcList, tagList, pageData }) => {
20191
- var _a;
20225
+ 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: (_c = (_b = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _b === void 0 ? void 0 : _b.personalized_recommend) !== null && _c !== void 0 ? _c : maxSize, defaultSize: (_e = (_d = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _d === void 0 ? void 0 : _d.default_recommend) !== null && _e !== void 0 ? _e : defaultSize, hashTagSize: (_g = (_f = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _f === void 0 ? void 0 : _f.hash_tag_size) !== null && _g !== void 0 ? _g : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter, data: Object.assign(Object.assign({}, data), { data: (_h = data === null || data === void 0 ? void 0 : data.data) === null || _h === void 0 ? void 0 : _h.data }), dataList: dataList, onUpdateSchema: (d) => setSchema(d), onUpdateChannel: (d) => setChannel(d), render: ({ rtcList, tagList, pageData }) => {
20226
+ var _a, _b;
20192
20227
  return (React.createElement(React.Fragment, null,
20193
- React.createElement(SxpPageRender$1, Object.assign({ defaultData: data }, (_a = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER })),
20228
+ React.createElement(DiyStoryPreview$1, Object.assign({ defaultData: Object.assign(Object.assign({}, data), { data: (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.data }) }, (_b = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _b === void 0 ? void 0 : _b.sxpPageConf, { tagList: tagList, scenes: rtcList, resolver: RESOLVER, containerHeight: window === null || window === void 0 ? void 0 : window.innerHeight, pointerEvents: pointerEvents, loopPlay: true })),
20194
20229
  React.createElement(Popup, null)));
20195
20230
  } })));
20196
20231
  };
@@ -20204,13 +20239,13 @@ var index = React.memo(SxpPageCore);
20204
20239
  * @FilePath: \pb-sxp-ui\src\index.ts
20205
20240
  */
20206
20241
 
20207
- exports.DiyPortalPreview = index$2;
20208
- exports.DiyStoryPreview = index$1;
20242
+ exports.DiyPortalPreview = index$1;
20243
+ exports.DiyStoryPreview = DiyStoryPreview$1;
20209
20244
  exports.EditorDataProvider = EditorDataProvider;
20210
20245
  exports.Modal = Modal$1;
20211
20246
  exports.SxpDataSourceProvider = SxpDataSourceProvider$1;
20212
20247
  exports.SxpPageCore = index;
20213
- exports.SxpPageRender = SxpPageRender$1;
20248
+ exports.SxpPageRender = index$2;
20214
20249
  exports.core = index$3;
20215
20250
  exports.default = Pagebuilder;
20216
20251
  exports.materials = _materials_;