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

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 (51) hide show
  1. package/dist/index.cjs +129 -774
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +128 -772
  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 +129 -774
  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/SxpPageCore/index.d.ts +0 -1
  14. package/es/core/components/SxpPageCore/index.js +7 -7
  15. package/es/core/components/SxpPageRender/ExpandableText.js +2 -10
  16. package/es/core/components/SxpPageRender/RenderCard.js +4 -4
  17. package/es/core/context/EditorContext.js +1 -1
  18. package/es/core/context/SxpDataSourceProvider.d.ts +1 -1
  19. package/es/core/context/SxpDataSourceProvider.js +41 -28
  20. package/es/index.d.ts +0 -1
  21. package/es/index.js +0 -1
  22. package/es/materials/sxp/template/MultiCommodity/index.js +1 -1
  23. package/es/materials/sxp/template/MultiCommodityDiro/index.js +1 -2
  24. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +1 -2
  25. package/es/materials/sxp/template/components/EventProvider.js +2 -2
  26. package/lib/core/components/SxpPageCore/index.d.ts +0 -1
  27. package/lib/core/components/SxpPageCore/index.js +7 -7
  28. package/lib/core/components/SxpPageRender/ExpandableText.js +2 -10
  29. package/lib/core/components/SxpPageRender/RenderCard.js +4 -4
  30. package/lib/core/context/EditorContext.js +1 -1
  31. package/lib/core/context/SxpDataSourceProvider.d.ts +1 -1
  32. package/lib/core/context/SxpDataSourceProvider.js +41 -28
  33. package/lib/index.d.ts +0 -1
  34. package/lib/index.js +1 -3
  35. package/lib/materials/sxp/template/MultiCommodity/index.js +1 -1
  36. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +1 -2
  37. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +1 -2
  38. package/lib/materials/sxp/template/components/EventProvider.js +2 -2
  39. package/package.json +1 -1
  40. package/es/core/components/DiyStoryPreview/PictureGroup.d.ts +0 -16
  41. package/es/core/components/DiyStoryPreview/PictureGroup.js +0 -34
  42. package/es/core/components/DiyStoryPreview/VideoWidget.d.ts +0 -19
  43. package/es/core/components/DiyStoryPreview/VideoWidget.js +0 -198
  44. package/es/core/components/DiyStoryPreview/index.d.ts +0 -31
  45. package/es/core/components/DiyStoryPreview/index.js +0 -389
  46. package/lib/core/components/DiyStoryPreview/PictureGroup.d.ts +0 -16
  47. package/lib/core/components/DiyStoryPreview/PictureGroup.js +0 -37
  48. package/lib/core/components/DiyStoryPreview/VideoWidget.d.ts +0 -19
  49. package/lib/core/components/DiyStoryPreview/VideoWidget.js +0 -201
  50. package/lib/core/components/DiyStoryPreview/index.d.ts +0 -31
  51. package/lib/core/components/DiyStoryPreview/index.js +0 -392
package/dist/pb-ui.js CHANGED
@@ -444,6 +444,39 @@
444
444
  })
445
445
  };
446
446
 
447
+ function useEditor() {
448
+ return React.useContext(EditorContext);
449
+ }
450
+
451
+ function useDataSource() {
452
+ return React.useContext(DataSourceContext);
453
+ }
454
+
455
+ const feRealSessionIdKey = 'feRealSessionIdKey';
456
+ const generateFeSessionId = () => {
457
+ const uid = getUid(); // 32位长度
458
+ const timestamp = Date.now(); // 13位长度
459
+ const result = `${timestamp}${uid}`; // 总共45位长度的唯一ID
460
+ return result;
461
+ };
462
+ // 生成或者获取sessionID
463
+ const storeAndLoadFeSessionId = () => {
464
+ let result = getFeSessionId();
465
+ if (!result) {
466
+ result = generateFeSessionId();
467
+ window.localStorage.setItem(feRealSessionIdKey, result);
468
+ }
469
+ return result;
470
+ };
471
+ const refreshFeSessionId = () => {
472
+ const result = generateFeSessionId();
473
+ window.localStorage.setItem(feRealSessionIdKey, result);
474
+ };
475
+ // 获取 sessionID
476
+ const getFeSessionId = () => {
477
+ return window.localStorage.getItem(feRealSessionIdKey);
478
+ };
479
+
447
480
  /*
448
481
  * @Author: binruan@chatlabs.com
449
482
  * @Date: 2024-03-20 10:27:31
@@ -495,39 +528,6 @@
495
528
  window.localStorage.setItem(USER_CONSENT_RESULT_KEY, 'true');
496
529
  };
497
530
 
498
- function useEditor() {
499
- return React.useContext(EditorContext);
500
- }
501
-
502
- function useDataSource() {
503
- return React.useContext(DataSourceContext);
504
- }
505
-
506
- const feRealSessionIdKey = 'feRealSessionIdKey';
507
- const generateFeSessionId = () => {
508
- const uid = getUid(); // 32位长度
509
- const timestamp = Date.now(); // 13位长度
510
- const result = `${timestamp}${uid}`; // 总共45位长度的唯一ID
511
- return result;
512
- };
513
- // 生成或者获取sessionID
514
- const storeAndLoadFeSessionId = () => {
515
- let result = getFeSessionId();
516
- if (!result) {
517
- result = generateFeSessionId();
518
- window.localStorage.setItem(feRealSessionIdKey, result);
519
- }
520
- return result;
521
- };
522
- const refreshFeSessionId = () => {
523
- const result = generateFeSessionId();
524
- window.localStorage.setItem(feRealSessionIdKey, result);
525
- };
526
- // 获取 sessionID
527
- const getFeSessionId = () => {
528
- return window.localStorage.getItem(feRealSessionIdKey);
529
- };
530
-
531
531
  /*
532
532
  * @Author: binruan@chatlabs.com
533
533
  * @Date: 2024-03-20 10:27:31
@@ -740,8 +740,12 @@
740
740
  // Beacon API 用于发送异步和非阻塞请求到服务器。这类请求不需要响应。
741
741
  if (options.type === 'beacon' && navigator.sendBeacon) {
742
742
  return navigator.sendBeacon(`${url}/api/${path}`, new Blob([
743
- JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))
744
- ], { type: 'application/json;charset=UTF-8' }));
743
+ JSON.stringify({
744
+ body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
745
+ })
746
+ ], {
747
+ type: 'application/json;charset=UTF-8'
748
+ }));
745
749
  }
746
750
  return window
747
751
  .fetch(`${url}/api/${path}`, {
@@ -772,16 +776,17 @@
772
776
  }, [bffDataSource]);
773
777
  // 获取推荐视频数据
774
778
  const getRecommendVideos = React.useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
775
- var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
776
- 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 }));
779
+ var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
780
+ 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 }));
777
781
  if (channel) {
778
782
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
779
783
  }
780
784
  else if (utmVal) {
781
- const val = (_h = (_g = (_f = splitUrlParams(utmVal)) === null || _f === void 0 ? void 0 : _f.filter((val) => {
785
+ const val = (_k = (_j = (_h = splitUrlParams(utmVal)) === null || _h === void 0 ? void 0 : _h.filter((val) => {
786
+ var _a, _b;
782
787
  const key = val.split('=')[0];
783
- return key;
784
- })) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
788
+ 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);
789
+ })) === null || _j === void 0 ? void 0 : _j.join('&')) !== null && _k !== void 0 ? _k : '';
785
790
  if (val)
786
791
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
787
792
  }
@@ -795,19 +800,19 @@
795
800
  let list = [];
796
801
  let result = null;
797
802
  const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
798
- var _t, _u, _v, _w, _x, _y;
803
+ var _v, _w, _x, _y, _z, _0;
799
804
  query.pageNum = pageNum;
800
805
  result = yield (bffFetchAdmin === null || bffFetchAdmin === void 0 ? void 0 : bffFetchAdmin('recommend/direct_page', { method: 'POST', body: query }));
801
806
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
802
807
  return undefined;
803
808
  }
804
809
  setLoading(false);
805
- 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 : []);
810
+ 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 : []);
806
811
  if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
807
812
  setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
808
813
  setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
809
814
  }
810
- 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));
815
+ 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));
811
816
  if (isNotNullList) {
812
817
  pageNum = pageNum + 1;
813
818
  yield recurveRecList(query);
@@ -815,13 +820,13 @@
815
820
  });
816
821
  yield recurveRecList(query);
817
822
  if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
818
- 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 });
823
+ 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 });
819
824
  return Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list });
820
825
  }
821
826
  if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
822
- 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 });
827
+ 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 });
823
828
  }
824
- const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v3/recommend/direct', { method: 'POST', body: query }));
829
+ const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', { method: 'POST', body: query }));
825
830
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
826
831
  return undefined;
827
832
  }
@@ -829,8 +834,8 @@
829
834
  setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
830
835
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
831
836
  let list = [];
832
- 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 : []);
833
- 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));
837
+ 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 : []);
838
+ 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));
834
839
  if (!isNotNullList) {
835
840
  setIsNoMoreData(true);
836
841
  }
@@ -839,12 +844,12 @@
839
844
  return result === null || result === void 0 ? void 0 : result.data;
840
845
  }), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin]);
841
846
  const loadVideos = React.useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
842
- var _z, _0, _1, _2;
847
+ var _1, _2, _3, _4;
843
848
  if (rtcList.length <= 0) {
844
849
  return;
845
850
  }
846
851
  const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
847
- 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 })));
852
+ 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 })));
848
853
  setRtcList(rtcList.concat(getFilterRecList(data)));
849
854
  setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
850
855
  return data;
@@ -901,7 +906,7 @@
901
906
  console.log('userInfo:', userInfo);
902
907
  console.log('eventInfo:', ef);
903
908
  console.log('========= 结束 =========');
904
- return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/event/report/CLD/${(_b = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _b === void 0 ? void 0 : _b['x-app-id']}/${eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.eventSubject}`, {
909
+ return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/cld/${(_b = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _b === void 0 ? void 0 : _b['x-app-id']}/${eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.eventSubject}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
905
910
  method: 'POST',
906
911
  body: { userInfo: realUserInfo, eventInfo: realEventInfo },
907
912
  type: 'beacon'
@@ -917,7 +922,7 @@
917
922
  bffDataSource
918
923
  ]);
919
924
  const bffFbReport = React.useCallback(({ eventName, product }) => {
920
- var _a, _b, _c, _d, _e, _f;
925
+ var _a, _b, _c, _d, _e, _f, _g;
921
926
  if (!enableReportEvent ||
922
927
  !enabledMetaConversionApi ||
923
928
  (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) ||
@@ -981,7 +986,15 @@
981
986
  }
982
987
  };
983
988
  getEventParams(jsonParams);
984
- return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/event/report/FB/${(_f = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _f === void 0 ? void 0 : _f['x-app-id']}/${eventName}`, {
989
+ const params = {};
990
+ const queryString = location.search.slice(1);
991
+ (_f = splitUrlParams(queryString)) === null || _f === void 0 ? void 0 : _f.map((val) => {
992
+ const key = val.split('=')[0];
993
+ const value = val.split('=')[1];
994
+ params[key] = value;
995
+ });
996
+ const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
997
+ return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_g = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _g === void 0 ? void 0 : _g['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
985
998
  method: 'POST',
986
999
  body: jsonParams,
987
1000
  type: 'beacon'
@@ -1009,18 +1022,18 @@
1009
1022
  }), [bffFetch]);
1010
1023
  // 获取 Tag
1011
1024
  const bffGetTagList = React.useCallback((data) => __awaiter(void 0, void 0, void 0, function* () {
1012
- var _3, _4, _5, _6, _7, _8, _9, _10;
1013
- 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);
1025
+ var _5, _6, _7, _8, _9, _10, _11, _12;
1026
+ 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);
1014
1027
  if (!utmVal || !isShowTag)
1015
1028
  return;
1016
1029
  try {
1017
- const val = (_8 = (_7 = (_6 = splitUrlParams(utmVal)) === null || _6 === void 0 ? void 0 : _6.filter((val) => {
1030
+ const val = (_10 = (_9 = (_8 = splitUrlParams(utmVal)) === null || _8 === void 0 ? void 0 : _8.filter((val) => {
1018
1031
  var _a, _b;
1019
1032
  const key = val.split('=')[0];
1020
1033
  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);
1021
- })) === null || _7 === void 0 ? void 0 : _7.join('&')) !== null && _8 !== void 0 ? _8 : '';
1034
+ })) === null || _9 === void 0 ? void 0 : _9.join('&')) !== null && _10 !== void 0 ? _10 : '';
1022
1035
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
1023
- 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 : []);
1036
+ 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 : []);
1024
1037
  }
1025
1038
  catch (e) {
1026
1039
  console.log('e', e);
@@ -1080,10 +1093,10 @@
1080
1093
  });
1081
1094
  }, [bffEventReport]);
1082
1095
  const getAccount = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
1083
- var _11, _12;
1096
+ var _13, _14;
1084
1097
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account', { method: 'GET' }));
1085
- setChatlabsId((_11 = res === null || res === void 0 ? void 0 : res.data) === null || _11 === void 0 ? void 0 : _11.chatLabsId);
1086
- return ((_12 = res === null || res === void 0 ? void 0 : res.data) === null || _12 === void 0 ? void 0 : _12.consentResult) === 'true';
1098
+ setChatlabsId((_13 = res === null || res === void 0 ? void 0 : res.data) === null || _13 === void 0 ? void 0 : _13.chatLabsId);
1099
+ return ((_14 = res === null || res === void 0 ? void 0 : res.data) === null || _14 === void 0 ? void 0 : _14.consentResult) === 'true';
1087
1100
  }), [bffFetch]);
1088
1101
  const accountSonsent = React.useCallback((consentResult) => __awaiter(void 0, void 0, void 0, function* () {
1089
1102
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account/consent', {
@@ -1478,7 +1491,7 @@
1478
1491
  React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
1479
1492
  });
1480
1493
 
1481
- var index$3 = /*#__PURE__*/Object.freeze({
1494
+ var index$2 = /*#__PURE__*/Object.freeze({
1482
1495
  __proto__: null,
1483
1496
  EditorCore: EditorCore
1484
1497
  });
@@ -10098,15 +10111,7 @@
10098
10111
  wordBreak: 'break-word'
10099
10112
  }, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
10100
10113
  React.createElement("div", { ref: multiRowCopy, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
10101
- text && isPost && isShow && (React.createElement("button", { "aria-label": isShowMore ? unfoldText || 'show less' : foldText || 'show more', style: {
10102
- textDecoration: 'underline',
10103
- cursor: 'pointer',
10104
- outline: 'none',
10105
- border: 'none',
10106
- boxSizing: 'content-box',
10107
- padding: 0,
10108
- background: 'transparent'
10109
- }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
10114
+ text && isPost && isShow && (React.createElement("button", { "aria-label": isShowMore ? unfoldText || 'show less' : foldText || 'show more', style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
10110
10115
  __html: setFontForText(isShowMore ? unfoldText || 'show less' : foldText || 'show more', style)
10111
10116
  } }))));
10112
10117
  };
@@ -12464,7 +12469,7 @@ Made in Italy` })));
12464
12469
  const handleClick = lodash.throttle((e) => {
12465
12470
  var _a, _b, _c, _d, _e, _f;
12466
12471
  e.preventDefault();
12467
- const item = multItem || ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video);
12472
+ const item = multItem ? multItem : (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
12468
12473
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12469
12474
  eventSubject: 'clickCta',
12470
12475
  eventDescription: 'User clicked the CTA'
@@ -12491,7 +12496,7 @@ Made in Italy` })));
12491
12496
  setElement(null);
12492
12497
  }
12493
12498
  }, [element, popup]);
12494
- return (React.createElement("button", { ref: ref, className: className, style: Object.assign({ outline: 'none', border: 'none', boxSizing: 'content-box', padding: 0, background: 'transparent', display: 'flex', alignItems: 'normal' }, style), onClick: handleClick, role: 'button', "aria-label": 'CTA', tabIndex: 0 }, children));
12499
+ return (React.createElement("button", { ref: ref, className: className, style: Object.assign({ display: 'flex', alignItems: 'normal' }, style), onClick: handleClick, role: 'button', "aria-label": 'CTA', tabIndex: 0 }, children));
12495
12500
  };
12496
12501
  var EventProvider$1 = React.memo(EventProvider);
12497
12502
 
@@ -13087,7 +13092,6 @@ Made in Italy` })));
13087
13092
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive", "index"]);
13088
13093
  const { sxpParameter } = useSxpDataSource();
13089
13094
  const [products] = React.useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
13090
- console.log(recData, '222');
13091
13095
  return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
13092
13096
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
13093
13097
  return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css.css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
@@ -13294,7 +13298,6 @@ Made in Italy` })));
13294
13298
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive", "index"]);
13295
13299
  const { sxpParameter } = useSxpDataSource();
13296
13300
  const [products] = React.useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
13297
- console.log(recData, '333');
13298
13301
  return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
13299
13302
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
13300
13303
  return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css.css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
@@ -17570,15 +17573,15 @@ Made in Italy` })));
17570
17573
  Swipe: Swipe
17571
17574
  });
17572
17575
 
17573
- const defaultUnLikeIconPath$2 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
17574
- const defaultLikeIconPath$2 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
17576
+ const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
17577
+ const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
17575
17578
  const LikeButton = (_a) => {
17576
17579
  var _b;
17577
17580
  var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
17578
17581
  const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList } = useSxpDataSource();
17579
17582
  const [state, setState] = React.useState((_b = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList[position]) === null || _b === void 0 ? void 0 : _b.isCollected);
17580
- const likeIcon = useIconLink(defaultLikeIconPath$2);
17581
- const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
17583
+ const likeIcon = useIconLink(defaultLikeIconPath$1);
17584
+ const unlikeIcon = useIconLink(defaultUnLikeIconPath$1);
17582
17585
  const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
17583
17586
  var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
17584
17587
  if (state) {
@@ -17669,7 +17672,7 @@ Made in Italy` })));
17669
17672
  };
17670
17673
  })();
17671
17674
 
17672
- const VideoWidget$4 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon }) => {
17675
+ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon }) => {
17673
17676
  const [isPauseVideo, setIsPauseVideo] = React.useState(false);
17674
17677
  const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport } = useSxpDataSource();
17675
17678
  const videoStartTime = React.useRef(0);
@@ -18014,7 +18017,7 @@ Made in Italy` })));
18014
18017
  renderLoading,
18015
18018
  isPauseVideo && React.createElement(FormatImage$1, { className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' })))));
18016
18019
  };
18017
- var VideoWidget$5 = React.memo(VideoWidget$4);
18020
+ var VideoWidget$3 = React.memo(VideoWidget$2);
18018
18021
 
18019
18022
  const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style }) => {
18020
18023
  const [isTrue, setIsTure] = React.useState(defaultValue);
@@ -18103,7 +18106,7 @@ Made in Italy` })));
18103
18106
  }, onLoad: onShowFirstImage }))));
18104
18107
  };
18105
18108
 
18106
- const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
18109
+ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
18107
18110
  var _a, _b;
18108
18111
  const { isActive } = useSwiperSlide();
18109
18112
  const { sxpParameter, openHashtag } = useSxpDataSource();
@@ -18197,7 +18200,7 @@ Made in Italy` })));
18197
18200
  React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
18198
18201
  }))));
18199
18202
  };
18200
- var PictureGroup$5 = React.memo(PictureGroup$4);
18203
+ var PictureGroup$3 = React.memo(PictureGroup$2);
18201
18204
 
18202
18205
  /*
18203
18206
  * @Author: binruan@chatlabs.com
@@ -18313,7 +18316,7 @@ Made in Italy` })));
18313
18316
  * @Author: binruan@chatlabs.com
18314
18317
  * @Date: 2023-12-26 16:11:34
18315
18318
  * @LastEditors: binruan@chatlabs.com
18316
- * @LastEditTime: 2025-03-28 14:46:08
18319
+ * @LastEditTime: 2024-10-31 10:30:55
18317
18320
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
18318
18321
  *
18319
18322
  */
@@ -18323,10 +18326,10 @@ Made in Italy` })));
18323
18326
  return null;
18324
18327
  const renderComp = React.useMemo(() => {
18325
18328
  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;
18326
- // 如果includesCtaType有值,则只渲染includesCtaType包含的cta类型组件,用于在页面某处只显示某一组件
18329
+ //如果includesCtaType有值,则只渲染includesCtaType包含的cta类型组件,用于在页面某处只显示某一组件
18327
18330
  if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type)))
18328
18331
  return;
18329
- // 默认不渲染category为cta类型的组件,该类型的组件只用于某一处
18332
+ //默认不渲染category为cta类型的组件,该类型的组件只用于某一处
18330
18333
  if (!includesCtaType && ((_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.category) === 'cta')
18331
18334
  return;
18332
18335
  if ((((_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.type) === 'CommodityDiro' && !((_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindProduct)) ||
@@ -18343,10 +18346,10 @@ Made in Italy` })));
18343
18346
  const Component = withBindDataSource(t);
18344
18347
  const defaulSetting = (_u = t === null || t === void 0 ? void 0 : t.extend) === null || _u === void 0 ? void 0 : _u.defaulSetting;
18345
18348
  const isExternalLink = ((_x = (_w = (_v = value === null || value === void 0 ? void 0 : value.item) === null || _v === void 0 ? void 0 : _v.event) === null || _w === void 0 ? void 0 : _w.onClick) === null || _x === void 0 ? void 0 : _x.linkType) === 'externalLink';
18346
- const style = lodash.cloneDeep((_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.style);
18349
+ let style = lodash.cloneDeep((_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.style);
18347
18350
  if (style.hasOwnProperty('backdropFilter')) {
18348
- const sbf = style.backdropFilter;
18349
- style.backdropFilter = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
18351
+ let sbf = style['backdropFilter'];
18352
+ style['backdropFilter'] = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
18350
18353
  }
18351
18354
  return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_z = value === null || value === void 0 ? void 0 : value.item) === null || _z === void 0 ? void 0 : _z.textStyle), bindDatas: (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.bindDatas) !== null && _1 !== void 0 ? _1 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.props, { event: ((_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index, isActive: isActive })));
18352
18355
  }
@@ -18707,10 +18710,10 @@ Made in Italy` })));
18707
18710
  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)));
18708
18711
  }
18709
18712
  if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
18710
- return (React.createElement(VideoWidget$5, { 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 }));
18713
+ 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 }));
18711
18714
  }
18712
18715
  if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
18713
- return (React.createElement(PictureGroup$5, { 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 }));
18716
+ 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 }));
18714
18717
  }
18715
18718
  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) {
18716
18719
  return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
@@ -19078,9 +19081,9 @@ Made in Italy` })));
19078
19081
  React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
19079
19082
  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 } })))))));
19080
19083
  };
19081
- var index$2 = React.memo(SxpPageRender);
19084
+ var SxpPageRender$1 = React.memo(SxpPageRender);
19082
19085
 
19083
- const PictureGroup$2 = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
19086
+ const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
19084
19087
  return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
19085
19088
  clickable: true,
19086
19089
  bulletActiveClass: 'swipe-item-active-bullet',
@@ -19090,9 +19093,9 @@ Made in Italy` })));
19090
19093
  React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
19091
19094
  })));
19092
19095
  };
19093
- var PictureGroup$3 = React.memo(PictureGroup$2);
19096
+ var PictureGroup$1 = React.memo(PictureGroup);
19094
19097
 
19095
- const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width }) => {
19098
+ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width }) => {
19096
19099
  const [isPauseVideo, setIsPauseVideo] = React.useState(false);
19097
19100
  const videoRef = React.useRef(null);
19098
19101
  const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
@@ -19322,14 +19325,14 @@ Made in Italy` })));
19322
19325
  renderPoster,
19323
19326
  React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON, alt: 'video pause image' })))));
19324
19327
  };
19325
- var VideoWidget$3 = React.memo(VideoWidget$2);
19328
+ var VideoWidget$1 = React.memo(VideoWidget);
19326
19329
 
19327
- const RESOLVER$2 = {};
19330
+ const RESOLVER$1 = {};
19328
19331
  Object.values(_materials_).forEach((v) => {
19329
- RESOLVER$2[v.extend.type] = v;
19332
+ RESOLVER$1[v.extend.type] = v;
19330
19333
  });
19331
- const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
19332
- const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
19334
+ const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
19335
+ const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
19333
19336
  const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [] }) => {
19334
19337
  const height = React.useMemo(() => {
19335
19338
  let minusHeight = 0;
@@ -19344,16 +19347,16 @@ Made in Italy` })));
19344
19347
  const renderContent = (rec, index) => {
19345
19348
  var _a, _b, _c, _d;
19346
19349
  if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
19347
- return (React.createElement(VideoWidget$3, { rec: rec, index: index, muted: true, width: containerWidth, data: data !== null && data !== void 0 ? data : [], height: height, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost }));
19350
+ return (React.createElement(VideoWidget$1, { rec: rec, index: index, muted: true, width: containerWidth, data: data !== null && data !== void 0 ? data : [], height: height, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost }));
19348
19351
  }
19349
19352
  if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
19350
- 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, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
19353
+ return (React.createElement(PictureGroup$1, { 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, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
19351
19354
  }
19352
19355
  if (rec.product) {
19353
19356
  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) {
19354
19357
  return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
19355
19358
  var _a, _b, _c, _d, _e, _f, _g, _h;
19356
- const t = RESOLVER$2[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
19359
+ const t = RESOLVER$1[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
19357
19360
  const Component = withBindDataSource(t);
19358
19361
  const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
19359
19362
  return (React.createElement(Component, Object.assign({ key: `${index}${idx}`, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {},
@@ -19375,7 +19378,7 @@ Made in Italy` })));
19375
19378
  const CTA = (rec, index) => {
19376
19379
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
19377
19380
  return (React.createElement("div", { className: 'clc-sxp-bottom-card' },
19378
- React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$2 })));
19381
+ React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1 })));
19379
19382
  }
19380
19383
  return null;
19381
19384
  };
@@ -19393,8 +19396,8 @@ Made in Italy` })));
19393
19396
  }
19394
19397
  return null;
19395
19398
  };
19396
- const likeIcon = useIconLink(defaultLikeIconPath$1, appDomain);
19397
- const unlikeIcon = useIconLink(defaultUnLikeIconPath$1, appDomain);
19399
+ const likeIcon = useIconLink(defaultLikeIconPath, appDomain);
19400
+ const unlikeIcon = useIconLink(defaultUnLikeIconPath, appDomain);
19398
19401
  const renderLikeButton = (rec, index) => {
19399
19402
  var _a, _b, _c, _d;
19400
19403
  if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
@@ -19444,666 +19447,11 @@ Made in Italy` })));
19444
19447
  };
19445
19448
  var index$1 = React.memo(DiyPortalPreview);
19446
19449
 
19447
- const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index, swiperRef, data = [], loopPlay }) => {
19448
- const { isActive } = useSwiperSlide();
19449
- const [isload, setIsLoad] = React.useState(false);
19450
- React.useEffect(() => {
19451
- if (isActive && isload && loopPlay) {
19452
- setTimeout(() => {
19453
- var _a, _b, _c, _d;
19454
- if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
19455
- (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(0);
19456
- }
19457
- else {
19458
- const i = (_c = (_b = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _b === void 0 ? void 0 : _b.swiper) === null || _c === void 0 ? void 0 : _c.activeIndex;
19459
- (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper.slideTo(i + 1);
19460
- }
19461
- }, 3000);
19462
- }
19463
- }, [isActive, isload, data, index, swiperRef, loopPlay]);
19464
- const loadFinishImage = () => {
19465
- setIsLoad(true);
19466
- };
19467
- return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
19468
- clickable: true,
19469
- bulletActiveClass: 'swipe-item-active-bullet',
19470
- bulletElement: 'button'
19471
- }, height: height, style: { width }, loop: true, autoplay: false }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url) => {
19472
- return (React.createElement(SwiperSlide, { key: url },
19473
- React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: loadFinishImage })));
19474
- })));
19475
- };
19476
- var PictureGroup$1 = React.memo(PictureGroup);
19477
-
19478
- const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width, swiperRef, loopPlay, videoPlayIcon, isPlay }) => {
19479
- const { isActive } = useSwiperSlide();
19480
- const [isPauseVideo, setIsPauseVideo] = React.useState(false);
19481
- const videoRef = React.useRef(null);
19482
- const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
19483
- const videoStartTime = React.useRef(0);
19484
- const [isLoadFinish, setIsLoadFinish] = React.useState(false);
19485
- const [isFirstPlay, setIsFirstPlay] = React.useState(true);
19486
- const canvasRef = React.useRef(null);
19487
- const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
19488
- const videoId = `pb-cache-video-${index}`;
19489
- const hlsRef = React.useRef(null);
19490
- React.useEffect(() => {
19491
- if (!videoRef.current)
19492
- return;
19493
- videoRef.current.muted = muted;
19494
- }, [muted]);
19495
- React.useCallback(() => {
19496
- var _a;
19497
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
19498
- }, []);
19499
- const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
19500
- const handlePlaying = React.useCallback(() => {
19501
- var _a, _b, _c, _d, _e, _f;
19502
- setIsPauseVideo(false);
19503
- const item = data[index];
19504
- if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
19505
- videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
19506
- ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
19507
- ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
19508
- setIsFirstPlay(false);
19509
- }
19510
- }, [bffEventReport, data, index, isFirstPlay]);
19511
- const handleLoadedMetadata = React.useCallback(() => {
19512
- var _a;
19513
- videoRef.current.currentTime = rec === null || rec === void 0 ? void 0 : rec.startTime;
19514
- (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
19515
- setIsLoadFinish(true);
19516
- }, []);
19517
- React.useCallback((type) => () => {
19518
- var _a, _b, _c, _d, _e;
19519
- if (!isLoadFinish)
19520
- return;
19521
- const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
19522
- switch (type) {
19523
- case 'start':
19524
- if (!isPause)
19525
- return;
19526
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
19527
- setIsPauseVideo(false);
19528
- break;
19529
- case 'pause':
19530
- if (isPause)
19531
- return;
19532
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
19533
- setIsPauseVideo(true);
19534
- break;
19535
- default:
19536
- if (isPause) {
19537
- // if (videoRef?.current?.currentTime >= rec?.endTime) {
19538
- // videoRef.current.currentTime = rec?.startTime;
19539
- // }
19540
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
19541
- }
19542
- else {
19543
- (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
19544
- }
19545
- setIsPauseVideo(!isPause);
19546
- break;
19547
- }
19548
- }, [isLoadFinish]);
19549
- React.useCallback(() => {
19550
- var _a, _b, _c, _d, _e, _f;
19551
- data[index];
19552
- ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
19553
- ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
19554
- if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
19555
- (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
19556
- }
19557
- }, [data, index, bffEventReport]);
19558
- const blur = React.useMemo(() => {
19559
- return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
19560
- }, [videoPostConfig]);
19561
- React.useMemo(() => {
19562
- var _a;
19563
- return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
19564
- ? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
19565
- : 'translateY(-50%)';
19566
- }, [videoPostConfig]);
19567
- const handLoadeddata = React.useCallback(() => {
19568
- if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
19569
- return;
19570
- const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
19571
- const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
19572
- const ctx = canvas.getContext('2d');
19573
- const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
19574
- const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
19575
- canvas.height = targetHeight;
19576
- canvas.width = targetWidth;
19577
- ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
19578
- setFirstFrameSrc(canvas.toDataURL());
19579
- }, []);
19580
- const handleTimeUpload = React.useCallback(() => {
19581
- var _a, _b, _c;
19582
- if (!videoRef.current)
19583
- return;
19584
- if (((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) >= ((_b = rec === null || rec === void 0 ? void 0 : rec.endTime) !== null && _b !== void 0 ? _b : 0)) {
19585
- (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
19586
- }
19587
- }, []);
19588
- // useEffect(() => {
19589
- // if (!videoRef.current || !isActive) return;
19590
- // if (isPlay) {
19591
- // videoRef.current?.play();
19592
- // } else {
19593
- // videoRef.current?.pause();
19594
- // }
19595
- // }, [isPlay, isActive]);
19596
- const handlePause = () => {
19597
- var _a, _b, _c, _d, _e, _f;
19598
- if (!videoRef.current || !isActive)
19599
- return;
19600
- if (!loopPlay)
19601
- return;
19602
- if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
19603
- (_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);
19604
- }
19605
- else {
19606
- const i = (_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.activeIndex;
19607
- (_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);
19608
- }
19609
- };
19610
- React.useEffect(() => {
19611
- var _a, _b, _c;
19612
- if (!isActive)
19613
- return;
19614
- const videoSrc = rec === null || rec === void 0 ? void 0 : rec.mediaUrl;
19615
- if (!videoSrc)
19616
- return;
19617
- setIsPauseVideo(false);
19618
- const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
19619
- if (!videoPlayerWrapperNode)
19620
- return;
19621
- videoRef.current = mountVideoPlayerAtNode === null || mountVideoPlayerAtNode === void 0 ? void 0 : mountVideoPlayerAtNode(videoPlayerWrapperNode);
19622
- if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
19623
- return;
19624
- const Hls = window === null || window === void 0 ? void 0 : window.Hls;
19625
- let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
19626
- if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
19627
- hls = new Hls();
19628
- hls === null || hls === void 0 ? void 0 : hls.loadSource(videoSrc);
19629
- hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
19630
- hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
19631
- var _a;
19632
- videoRef.current.currentTime = rec === null || rec === void 0 ? void 0 : rec.startTime;
19633
- (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
19634
- });
19635
- }
19636
- else {
19637
- videoRef.current.src = videoSrc;
19638
- }
19639
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
19640
- // videoRef.current?.addEventListener('playing', handlePlaying);
19641
- // videoRef.current?.addEventListener('loadeddata', handLoadeddata);
19642
- (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('pause', handlePause);
19643
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('timeupdate', handleTimeUpload);
19644
- return () => {
19645
- var _a, _b, _c, _d;
19646
- if (hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current)
19647
- (_a = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
19648
- setIsLoadFinish(false);
19649
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('loadedmetadata', handleLoadedMetadata);
19650
- // videoRef.current?.removeEventListener('playing', handlePlaying);
19651
- // videoRef.current?.removeEventListener('loadeddata', handLoadeddata);
19652
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('pause', handlePause);
19653
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('timeupdate', handleTimeUpload);
19654
- };
19655
- }, [handleLoadedMetadata, handlePlaying, rec, handLoadeddata, isActive, loopPlay]);
19656
- const renderPoster = React.useMemo(() => {
19657
- if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
19658
- return null;
19659
- }
19660
- return (React.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'video poster' }));
19661
- }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
19662
- React.useMemo(() => {
19663
- return blur
19664
- ? {
19665
- filter: 'blur(10px)',
19666
- transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
19667
- }
19668
- : {};
19669
- }, [blur]);
19670
- if (!(rec === null || rec === void 0 ? void 0 : rec.mediaUrl)) {
19671
- return null;
19672
- }
19673
- // const renderLoading = useMemo(() => {
19674
- // if (!waiting || !isLoadFinish) return;
19675
- // return (
19676
- // <img
19677
- // style={{
19678
- // position: 'absolute',
19679
- // top: '50%',
19680
- // left: 0,
19681
- // right: 0,
19682
- // transform: 'translateY(-100%)',
19683
- // margin: 'auto',
19684
- // width: '50px',
19685
- // height: '50px',
19686
- // objectFit: 'contain'
19687
- // }}
19688
- // src={loading_gif}
19689
- // alt='placeholder image'
19690
- // />
19691
- // );
19692
- // }, [waiting, isLoadFinish]);
19693
- return (React.createElement("div", { className: 'video-container', key: rec.itemId, style: {
19694
- position: 'relative',
19695
- width: '100%',
19696
- height,
19697
- overflow: 'hidden'
19698
- } },
19699
- React.createElement("div", { className: 'n-full-screen', id: videoId, style: { width: '100%', height: '100%' } }),
19700
- renderPoster,
19701
- isPauseVideo && React.createElement(FormatImage$1, { className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' })));
19702
- };
19703
- var VideoWidget$1 = React.memo(VideoWidget);
19704
-
19705
- /*
19706
- * @Author: binruan@chatlabs.com
19707
- * @Date: 2025-03-25 13:54:27
19708
- * @LastEditors: binruan@chatlabs.com
19709
- * @LastEditTime: 2025-03-28 18:08:02
19710
- * @FilePath: \pb-sxp-ui\src\core\components\DiyStoryPreview\index.tsx
19711
- *
19712
- */
19713
- const recData = {
19714
- position: 0,
19715
- isCollected: false,
19716
- product: null,
19717
- video: {
19718
- appId: null,
19719
- itemId: 'VIDEOSsRgI1695278974368',
19720
- title: '8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片',
19721
- enTitle: null,
19722
- icon: null,
19723
- cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20231017/fsJFWmW1dGyW7XmDspbJPTn5esL3U1697538777398.png',
19724
- link: null,
19725
- linkTitle: null,
19726
- linkType: null,
19727
- menuCategoryId: null,
19728
- remark: null,
19729
- tags: [
19730
- 'Gift-Giving',
19731
- 'Daily Wear',
19732
- 'Business Formal',
19733
- 'Sports/Casual',
19734
- 'Anniversary Gifts',
19735
- 'Wedding/Engagement',
19736
- 'Formal Dinner/Party'
19737
- ],
19738
- traceInfo: ':VIDEO:VIDEOSsRgI1695278974368:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
19739
- value: 385,
19740
- weight: null,
19741
- bindCta: null,
19742
- bindProduct: null,
19743
- bindProducts: [
19744
- {
19745
- appId: 'wx448578f8851f3dce',
19746
- itemId: 'test02178888',
19747
- title: 'christian dior小包包 新CDN',
19748
- enTitle: null,
19749
- icon: null,
19750
- cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fs2jqiurjftpoaba67iiwr9jt5sc31726213277754.avif',
19751
- link: '/pages/details/index?spu_id=1702262707659534338',
19752
- linkTitle: '',
19753
- linkType: 'MP',
19754
- menuCategoryId: null,
19755
- remark: null,
19756
- tags: [],
19757
- traceInfo: ':PRODUCT:test02178888:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
19758
- value: null,
19759
- weight: null,
19760
- bindCta: {
19761
- appId: 'wx448578f8851f3dce',
19762
- itemId: 'CTA3KofE1716186622249',
19763
- title: 'SHOP NOW 立即购买',
19764
- enTitle: 'BUY NOW立即购买,选择你所喜爱的;',
19765
- icon: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240520/fssfxbmiwghixmgblz9uriwennd2r1716186615574.avif',
19766
- cover: null,
19767
- link: '/pages/details/index?spu_id=1702262707659534338',
19768
- linkTitle: '',
19769
- linkType: 'MP',
19770
- menuCategoryId: '64b60b202caf0e1c1ce1e17d',
19771
- remark: null,
19772
- tags: [
19773
- "Woman's Perfumes",
19774
- 'Plates & Bowls',
19775
- 'Glasses',
19776
- 'Multicolor',
19777
- 'Carafes',
19778
- 'Tea & Coffee',
19779
- 'Green',
19780
- 'Grey',
19781
- 'Cutlery'
19782
- ],
19783
- traceInfo: ':CTA:CTA3KofE1716186622249:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
19784
- value: null,
19785
- weight: null
19786
- },
19787
- collection: 'Ricco',
19788
- currency: 'INR-₹',
19789
- homePage: [
19790
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fs2jqiurjftpoaba67iiwr9jt5sc31726213277754.avif',
19791
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fsr9ttuzuljs85smqi6lsidovnyoy1726213285994.avif',
19792
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fsknmfhx2lxukxews05guwwxr8rju1726213281108.avif',
19793
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fs0acnua4f1clamdpwdsrh0v5dgc61726213289247.avif'
19794
- ],
19795
- info: 'test',
19796
- price: 53200,
19797
- shippingInfo: null,
19798
- taxInfo: null
19799
- },
19800
- {
19801
- appId: null,
19802
- itemId: '113J631A0684_C520',
19803
- title: 'Sweatshirt à capuche Dior Oblique, coupe relax',
19804
- enTitle: null,
19805
- icon: null,
19806
- cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fsaf0xq8vx8gkkl30y1h1swpinmbt1731661943891.avif',
19807
- link: 'https://www.dior.com/fr_fr/fashion/products/113J631A0684_C520',
19808
- linkTitle: null,
19809
- linkType: 'WEB',
19810
- menuCategoryId: null,
19811
- remark: null,
19812
- tags: [],
19813
- traceInfo: ':PRODUCT:113J631A0684_C520:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
19814
- value: null,
19815
- weight: null,
19816
- bindCta: {
19817
- appId: null,
19818
- itemId: 'CTAAfaKf1730796437032',
19819
- title: 'test',
19820
- enTitle: 'test',
19821
- icon: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241105/fsjblxoud2tmehpiqqomh0oktwqrd1730796431496.avif',
19822
- cover: null,
19823
- link: null,
19824
- linkTitle: null,
19825
- linkType: null,
19826
- menuCategoryId: '64b60b202caf0e1c1ce1e17d',
19827
- remark: '',
19828
- tags: [],
19829
- traceInfo: ':CTA:CTAAfaKf1730796437032:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
19830
- value: null,
19831
- weight: null
19832
- },
19833
- collection: 'Jacquard de coton éponge bleu',
19834
- currency: 'EUR-€',
19835
- homePage: [
19836
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fsaf0xq8vx8gkkl30y1h1swpinmbt1731661943891.avif',
19837
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fszxkdcjfjql2oiy90ffbal5tsfd81731661964913.avif',
19838
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fs1jhd9jwxvfqmrbjwy5abfzb0fde1731661994996.avif'
19839
- ],
19840
- info: "Le sweatshirt à capuche bleu met à l'honneur l'emblématique motif dior oblique. Confectionné en jacquard de coton éponge bleu, il présente une coupe relax très confortable. Doté de poches latérales fendues, ce sweatshirt à capuche s'associera à tous vos jeans ou pantalons de survêtement pour un look décontracté.. Sweatshirt à capuche dior oblique, coupe relax Jacquard de coton éponge bleu",
19841
- price: 1800,
19842
- shippingInfo: null,
19843
- taxInfo: null
19844
- },
19845
- {
19846
- appId: null,
19847
- itemId: 'S5573CRIW_M928',
19848
- title: 'Mini Dior Book Tote',
19849
- enTitle: null,
19850
- icon: null,
19851
- cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsvewk9etrawxrzznmvvewgt1bctu1739415576729.avif',
19852
- link: 'https://www.dior.com/en_gb/fashion/products/S5573CRIW_M928',
19853
- linkTitle: null,
19854
- linkType: 'WEB',
19855
- menuCategoryId: null,
19856
- remark: null,
19857
- tags: ['ダイヤモンド'],
19858
- traceInfo: ':PRODUCT:S5573CRIW_M928:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
19859
- value: null,
19860
- weight: null,
19861
- bindCta: null,
19862
- collection: null,
19863
- currency: 'GBP-£',
19864
- homePage: [
19865
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsvewk9etrawxrzznmvvewgt1bctu1739415576729.avif',
19866
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsngtlvhid7xwt5if0viw7vqanm831739415582147.avif',
19867
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fs4hotdvyzjtnqb9vszlynuzplddc1739415586910.avif',
19868
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fswffx9kwexf3z3vcnxisut1qxtez1739415591629.avif',
19869
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsbfsi7tttx1hnzldoiw7eoea7fvh1739415597388.avif'
19870
- ],
19871
- info: "The Dior Book Tote is a House classic and original design by Maria Grazia Chiuri, Creative Director of Christian Dior. The style is fully embroidered with the House's hallmark blue Dior Oblique motif and showcases the Christian Dior Paris signature. Exemplifying House savoir-faire, the miniature style features an adjustable and removable strap that allows it to be carried by hand, worn over the shoulder or crossbody.",
19872
- price: 1950,
19873
- shippingInfo: null,
19874
- taxInfo: null
19875
- }
19876
- ],
19877
- url: null,
19878
- blockCta: 1,
19879
- blockProduct: 1,
19880
- hashTags: [
19881
- 'Sports/Casual',
19882
- 'Formal Dinner/Party',
19883
- 'Business Formal',
19884
- 'Wedding/Engagement',
19885
- 'Gift-Giving',
19886
- 'Daily Wear',
19887
- 'Anniversary Gifts'
19888
- ]
19889
- }
19890
- };
19891
- const RESOLVER$1 = {};
19892
- Object.values(_materials_).forEach((v) => {
19893
- RESOLVER$1[v.extend.type] = v;
19894
- });
19895
- const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
19896
- const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
19897
- const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [], scenes, onActiveChange, activeIndex, loopPlay = false, pointerEvents = 'none', isPlay }) => {
19898
- const [loopPlaySwiper, setLooPlaySwiper] = React.useState(loopPlay);
19899
- const swiperRef = React.useRef(null);
19900
- React.useMemo(() => {
19901
- let minusHeight = 0;
19902
- if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
19903
- minusHeight += 45;
19904
- }
19905
- if (tagList.length > 0) {
19906
- minusHeight += 45;
19907
- }
19908
- return containerHeight - minusHeight;
19909
- }, [globalConfig, containerHeight, tagList]);
19910
- // 判断是否是视频
19911
- const isVideoUrl = (url) => {
19912
- if (url && url !== '' && typeof url === 'string') {
19913
- const imageExtensions = ['.mp4', '.m3u8'];
19914
- const lowerCaseUrl = url === null || url === void 0 ? void 0 : url.toLowerCase();
19915
- return imageExtensions.some((ext) => lowerCaseUrl === null || lowerCaseUrl === void 0 ? void 0 : lowerCaseUrl.endsWith(ext));
19916
- }
19917
- else {
19918
- return false;
19919
- }
19920
- };
19921
- const renderContent = (rec, index) => {
19922
- const isVideo = isVideoUrl(rec === null || rec === void 0 ? void 0 : rec.mediaUrl);
19923
- if (isVideo) {
19924
- 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 }));
19925
- }
19926
- else {
19927
- 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 }));
19928
- }
19929
- };
19930
- React.useMemo(() => {
19931
- if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
19932
- return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
19933
- React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
19934
- }
19935
- return null;
19936
- }, [globalConfig]);
19937
- const renderBottom = (rec, index) => {
19938
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
19939
- if (rec === null || rec === void 0 ? void 0 : rec.video) {
19940
- let cta = null;
19941
- if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
19942
- cta = '多商品CTA';
19943
- }
19944
- else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
19945
- cta = '商品CTA';
19946
- }
19947
- else {
19948
- cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
19949
- }
19950
- const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
19951
- return (React.createElement(React.Fragment, null,
19952
- ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.title) && (React.createElement("div", { style: {
19953
- background: 'repeating-linear-gradient(0deg, rgba(26, 26, 25, 0.7), hsla(0, 0%, 100%, 0))',
19954
- height: '130px',
19955
- position: 'absolute',
19956
- bottom: 0,
19957
- width: '100%',
19958
- willChange: 'transform',
19959
- zIndex: 2,
19960
- pointerEvents
19961
- } })),
19962
- React.createElement("div", { style: {
19963
- marginBottom: `${(_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _g !== void 0 ? _g : 40}px`,
19964
- zIndex: 999,
19965
- position: 'absolute',
19966
- bottom: 0,
19967
- left: 0,
19968
- right: 0,
19969
- paddingTop: '20px'
19970
- } },
19971
- (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (React.createElement("div", { style: {} },
19972
- React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1, isActive: index === activeIndex, value: value }))) : null,
19973
- React.createElement("div", null,
19974
- React.createElement(ExpandableText$1
19975
- // className='clc-sxp-bottom-text'
19976
- , {
19977
- // className='clc-sxp-bottom-text'
19978
- isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_j = (_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none', padding: '0 20px', fontSize: '12px' }) }),
19979
- React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }))),
19980
- React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
19981
- }
19982
- return null;
19983
- };
19984
- const likeIcon = useIconLink(defaultLikeIconPath, appDomain);
19985
- const unlikeIcon = useIconLink(defaultUnLikeIconPath, appDomain);
19986
- const renderLikeButton = (rec, index) => {
19987
- var _a, _b, _c, _d;
19988
- if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
19989
- return;
19990
- let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
19991
- if (top < 40) {
19992
- top += 40;
19993
- }
19994
- if (rec === null || rec === void 0 ? void 0 : rec.video) {
19995
- return (React.createElement(LikeButton$1, { key: rec.position, activeIcon: (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIcon) !== null && _b !== void 0 ? _b : likeIcon, unActicveIcon: (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unlikeIcon) !== null && _c !== void 0 ? _c : unlikeIcon, position: index, active: rec.isCollected, recData: rec,
19996
- // className={style['clc-sxp-like-button']}
19997
- style: {
19998
- top,
19999
- right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0,
20000
- position: 'absolute',
20001
- zIndex: 999,
20002
- backgroundColor: 'transparent',
20003
- width: '50px',
20004
- height: '50px',
20005
- outline: 'none',
20006
- border: 'none',
20007
- boxSizing: 'content-box',
20008
- padding: 0,
20009
- transform: 'translate3d(0px, 0px, 0px)'
20010
- } }));
20011
- }
20012
- return null;
20013
- };
20014
- const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png', appDomain);
20015
- const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png', appDomain);
20016
- const renderToggleButton = (visible) => {
20017
- var _a, _b, _c, _d;
20018
- if (!visible)
20019
- return;
20020
- let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _a !== void 0 ? _a : 23;
20021
- if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) === 'top') {
20022
- top += 45;
20023
- }
20024
- return (((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === true) && (React.createElement(ToggleButton$1, { style: {
20025
- position: 'absolute',
20026
- visibility: 'visible',
20027
- zIndex: 999,
20028
- transform: 'translate3d(0px,0px,0px)',
20029
- [(_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _b !== void 0 ? _b : 'right']: (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _c !== void 0 ? _c : 0,
20030
- [(_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _d !== void 0 ? _d : 'bottom']: top,
20031
- backgroundColor: 'transparent',
20032
- width: '50px',
20033
- height: '50px',
20034
- outline: 'none',
20035
- border: 'none',
20036
- boxSizing: 'content-box',
20037
- padding: 0
20038
- }, defaultValue: true, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon })));
20039
- };
20040
- const renderView = (item, index) => {
20041
- var _a, _b, _c, _d;
20042
- const rec = lodash.cloneDeep(recData);
20043
- rec.video.bindProducts = item === null || item === void 0 ? void 0 : item.bindProducts;
20044
- rec.video.title = (item === null || item === void 0 ? void 0 : item.title) || '';
20045
- return (React.createElement("div", { style: { position: 'relative' } },
20046
- React.createElement(SwiperSlide, { key: index, virtualIndex: index, style: { overflow: 'hidden', position: 'relative' } },
20047
- renderBottom(rec, index),
20048
- renderLikeButton(rec, index),
20049
- renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
20050
- React.createElement(ToggleButton$1, { style: {
20051
- position: 'absolute',
20052
- right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
20053
- visibility: ((_c = (_b = data === null || data === void 0 ? void 0 : data[index]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.url) ? 'visible' : 'hidden',
20054
- bottom: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _d !== void 0 ? _d : 23,
20055
- zIndex: 999
20056
- }, defaultValue: true, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon }),
20057
- renderContent(item, index))));
20058
- };
20059
- React.useEffect(() => {
20060
- var _a, _b;
20061
- if (!(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current))
20062
- return;
20063
- (_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);
20064
- }, [activeIndex]);
20065
- React.useEffect(() => {
20066
- if (!(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current))
20067
- return;
20068
- // swiperRef?.current?.swiper?.slideTo(0);
20069
- setLooPlaySwiper(loopPlay);
20070
- }, [loopPlay]);
20071
- const handleSessionExpire = React.useCallback(lodash.debounce(() => {
20072
- setLooPlaySwiper(false);
20073
- }, 1000), []);
20074
- React.useEffect(() => {
20075
- const events = ['touchstart', 'touchcancel'];
20076
- events.forEach((event) => {
20077
- window.addEventListener(event, handleSessionExpire);
20078
- });
20079
- return () => {
20080
- events.forEach((event) => {
20081
- window.removeEventListener(event, handleSessionExpire);
20082
- });
20083
- };
20084
- }, [handleSessionExpire]);
20085
- return (React.createElement("div", { id: 'sxp-render',
20086
- // className={style['clc-sxp-container']}
20087
- style: { height: containerHeight, position: 'relative', pointerEvents } },
20088
- React.createElement(Swiper, { ref: swiperRef, allowTouchMove: pointerEvents !== 'none', onSlideChange: () => {
20089
- swiperRef.current.swiper.allowTouchMove = false;
20090
- setTimeout(() => {
20091
- swiperRef.current.swiper.allowTouchMove = true;
20092
- }, 500);
20093
- }, onActiveIndexChange: (swiper) => {
20094
- // setActiveIndex(swiper.activeIndex);
20095
- onActiveChange === null || onActiveChange === void 0 ? void 0 : onActiveChange(swiper.activeIndex);
20096
- }, direction: 'vertical', style: { overflow: 'hidden', height: containerHeight }, height: containerHeight }, scenes === null || scenes === void 0 ? void 0 : scenes.map((rec, index) => {
20097
- return renderView(rec, index);
20098
- }))));
20099
- };
20100
- var DiyStoryPreview$1 = React.memo(DiyStoryPreview);
20101
-
20102
19450
  /*
20103
19451
  * @Author: binruan@chatlabs.com
20104
19452
  * @Date: 2023-10-31 10:56:01
20105
19453
  * @LastEditors: binruan@chatlabs.com
20106
- * @LastEditTime: 2025-03-28 17:15:47
19454
+ * @LastEditTime: 2024-10-23 15:07:29
20107
19455
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
20108
19456
  *
20109
19457
  */
@@ -20195,9 +19543,17 @@ Made in Italy` })));
20195
19543
 
20196
19544
  /*
20197
19545
  * @Author: binruan@chatlabs.com
20198
- * @Date: 2024-03-20 10:27:31
19546
+ * @Date: 2024-01-15 19:03:09
20199
19547
  * @LastEditors: binruan@chatlabs.com
20200
- * @LastEditTime: 2025-03-28 16:55:21
19548
+ * @LastEditTime: 2025-02-24 15:47:44
19549
+ * @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
19550
+ *
19551
+ */
19552
+ /*
19553
+ * @Author: binruan@chatlabs.com
19554
+ * @Date: 2023-11-24 15:58:00
19555
+ * @LastEditors: binruan@chatlabs.com
19556
+ * @LastEditTime: 2023-12-26 10:24:42
20201
19557
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
20202
19558
  *
20203
19559
  */
@@ -20205,20 +19561,20 @@ Made in Italy` })));
20205
19561
  Object.values(_materials_).forEach((v) => {
20206
19562
  RESOLVER[v.extend.type] = v;
20207
19563
  });
20208
- const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, enabledMetaConversionApi, dataList, pointerEvents }) => {
20209
- var _a, _b, _c, _d, _e, _f, _g, _h;
19564
+ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, enabledMetaConversionApi, dataList }) => {
19565
+ var _a, _b, _c, _d, _e, _f;
20210
19566
  const utmVal = React.useMemo(() => {
20211
19567
  var _a;
20212
19568
  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('?', '') : '';
20213
19569
  return searchParams;
20214
19570
  }, []);
20215
- const [_schema, setSchema] = React.useState((_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.data);
19571
+ const [_schema, setSchema] = React.useState(data === null || data === void 0 ? void 0 : data.data);
20216
19572
  const [channel, setChannel] = React.useState();
20217
19573
  return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: _schema, utmVal: channel || utmVal },
20218
- 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 }) => {
20219
- var _a, _b;
19574
+ 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 }) => {
19575
+ var _a;
20220
19576
  return (React.createElement(React.Fragment, null,
20221
- 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 })),
19577
+ 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 })),
20222
19578
  React.createElement(Popup, null)));
20223
19579
  } })));
20224
19580
  };
@@ -20228,18 +19584,17 @@ Made in Italy` })));
20228
19584
  * @Author : haocanweng@chatlabs.cn
20229
19585
  * @Date : 2023-08-21 16:31:58
20230
19586
  * @LastEditors: binruan@chatlabs.com
20231
- * @LastEditTime: 2025-03-25 14:31:53
19587
+ * @LastEditTime: 2024-06-25 11:37:48
20232
19588
  * @FilePath: \pb-sxp-ui\src\index.ts
20233
19589
  */
20234
19590
 
20235
19591
  exports.DiyPortalPreview = index$1;
20236
- exports.DiyStoryPreview = DiyStoryPreview$1;
20237
19592
  exports.EditorDataProvider = EditorDataProvider;
20238
19593
  exports.Modal = Modal$1;
20239
19594
  exports.SxpDataSourceProvider = SxpDataSourceProvider$1;
20240
19595
  exports.SxpPageCore = index;
20241
- exports.SxpPageRender = index$2;
20242
- exports.core = index$3;
19596
+ exports.SxpPageRender = SxpPageRender$1;
19597
+ exports.core = index$2;
20243
19598
  exports.default = Pagebuilder;
20244
19599
  exports.materials = _materials_;
20245
19600
  exports.useEditorDataProvider = useEditorDataProvider;