pb-sxp-ui 1.2.9 → 1.3.0

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 (96) hide show
  1. package/dist/index.cjs +611 -260
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +62 -2
  4. package/dist/index.js +611 -260
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +3 -3
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +3 -3
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +611 -260
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +3 -3
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/SxpPageRender/FormatImage.js +19 -17
  15. package/es/core/components/SxpPageRender/Modal/index.js +33 -20
  16. package/es/core/components/SxpPageRender/Popup/index.js +2 -2
  17. package/es/core/components/SxpPageRender/ToggleButton/index.js +4 -1
  18. package/es/core/components/SxpPageRender/WaterFall/List.js +5 -14
  19. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +5 -14
  20. package/es/core/components/SxpPageRender/index.d.ts +6 -1
  21. package/es/core/components/SxpPageRender/index.js +46 -23
  22. package/es/core/components/SxpPageRender/typing.d.ts +2 -0
  23. package/es/core/context/SxpDataSourceProvider.d.ts +3 -2
  24. package/es/core/context/SxpDataSourceProvider.js +27 -30
  25. package/es/core/hooks/useEventReport.js +9 -8
  26. package/es/core/utils/tool.d.ts +5 -1
  27. package/es/core/utils/tool.js +69 -1
  28. package/es/materials/sxp/popup/AppointForm/settingRender.js +15 -0
  29. package/es/materials/sxp/popup/CommodityDetail/index.d.ts +10 -1
  30. package/es/materials/sxp/popup/CommodityDetail/index.js +46 -28
  31. package/es/materials/sxp/popup/CommodityDetail/material.js +4 -0
  32. package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +21 -2
  33. package/es/materials/sxp/popup/CommodityDetail/settingRender.js +46 -0
  34. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +10 -1
  35. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +72 -46
  36. package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +4 -0
  37. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +21 -2
  38. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +46 -0
  39. package/es/materials/sxp/popup/CommodityList/settingRender.js +15 -0
  40. package/es/materials/sxp/popup/Iframe/index.d.ts +16 -0
  41. package/es/materials/sxp/popup/Iframe/index.js +18 -0
  42. package/es/materials/sxp/popup/Iframe/material.d.ts +2 -0
  43. package/es/materials/sxp/popup/Iframe/material.js +21 -0
  44. package/es/materials/sxp/popup/Iframe/settingRender.d.ts +9 -0
  45. package/es/materials/sxp/popup/Iframe/settingRender.js +12 -0
  46. package/es/materials/sxp/popup/Prompt/settingRender.js +16 -1
  47. package/es/materials/sxp/popup/index.d.ts +1 -0
  48. package/es/materials/sxp/popup/index.js +1 -0
  49. package/es/materials/sxp/template/Link/index.js +5 -11
  50. package/es/materials/sxp/template/Link/interactionRender.d.ts +8 -0
  51. package/es/materials/sxp/template/Link/interactionRender.js +11 -0
  52. package/es/materials/sxp/template/Link/material.js +3 -1
  53. package/es/materials/sxp/template/components/EventProvider.d.ts +3 -2
  54. package/es/materials/sxp/template/components/EventProvider.js +3 -3
  55. package/lib/core/components/SxpPageRender/FormatImage.js +19 -17
  56. package/lib/core/components/SxpPageRender/Modal/index.js +33 -20
  57. package/lib/core/components/SxpPageRender/Popup/index.js +2 -2
  58. package/lib/core/components/SxpPageRender/ToggleButton/index.js +3 -0
  59. package/lib/core/components/SxpPageRender/WaterFall/List.js +5 -14
  60. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +5 -14
  61. package/lib/core/components/SxpPageRender/index.d.ts +6 -1
  62. package/lib/core/components/SxpPageRender/index.js +46 -23
  63. package/lib/core/components/SxpPageRender/typing.d.ts +2 -0
  64. package/lib/core/context/SxpDataSourceProvider.d.ts +3 -2
  65. package/lib/core/context/SxpDataSourceProvider.js +27 -30
  66. package/lib/core/hooks/useEventReport.js +9 -8
  67. package/lib/core/utils/tool.d.ts +5 -1
  68. package/lib/core/utils/tool.js +73 -1
  69. package/lib/materials/sxp/popup/AppointForm/settingRender.js +15 -0
  70. package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +10 -1
  71. package/lib/materials/sxp/popup/CommodityDetail/index.js +46 -28
  72. package/lib/materials/sxp/popup/CommodityDetail/material.js +4 -0
  73. package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +21 -2
  74. package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +46 -0
  75. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +10 -1
  76. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +72 -46
  77. package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +4 -0
  78. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +21 -2
  79. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +46 -0
  80. package/lib/materials/sxp/popup/CommodityList/settingRender.js +15 -0
  81. package/lib/materials/sxp/popup/Iframe/index.d.ts +16 -0
  82. package/lib/materials/sxp/popup/Iframe/index.js +20 -0
  83. package/lib/materials/sxp/popup/Iframe/material.d.ts +2 -0
  84. package/lib/materials/sxp/popup/Iframe/material.js +25 -0
  85. package/lib/materials/sxp/popup/Iframe/settingRender.d.ts +9 -0
  86. package/lib/materials/sxp/popup/Iframe/settingRender.js +14 -0
  87. package/lib/materials/sxp/popup/Prompt/settingRender.js +16 -1
  88. package/lib/materials/sxp/popup/index.d.ts +1 -0
  89. package/lib/materials/sxp/popup/index.js +1 -0
  90. package/lib/materials/sxp/template/Link/index.js +5 -11
  91. package/lib/materials/sxp/template/Link/interactionRender.d.ts +8 -0
  92. package/lib/materials/sxp/template/Link/interactionRender.js +13 -0
  93. package/lib/materials/sxp/template/Link/material.js +3 -1
  94. package/lib/materials/sxp/template/components/EventProvider.d.ts +3 -2
  95. package/lib/materials/sxp/template/components/EventProvider.js +3 -3
  96. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -239,6 +239,87 @@ const setFontForText = (textContent, style) => {
239
239
  }
240
240
  return content;
241
241
  };
242
+ function getBrowserInfo() {
243
+ var _a, _b, _c, _d, _e, _f, _g;
244
+ let userAgent = self.navigator.userAgent;
245
+ if (!userAgent)
246
+ return 'Unknown';
247
+ if (/edge\/([\d\.]+)/i.exec(userAgent))
248
+ return `Edge ${(_a = /edge\/([\d\.]+)/i.exec(userAgent)) === null || _a === void 0 ? void 0 : _a[1]}`;
249
+ if (/edg\/([\d\.]+)/i.exec(userAgent))
250
+ return `Edge(Chromium) ${(_b = /edge\/([\d\.]+)/i.exec(userAgent)) === null || _b === void 0 ? void 0 : _b[1]}`;
251
+ if (/msie/i.test(userAgent))
252
+ return `Internet Explorer ${(_c = /msie ([\d\.]+)/i.exec(userAgent)) === null || _c === void 0 ? void 0 : _c[1]}`;
253
+ if (/Trident/i.test(userAgent))
254
+ return `Internet Explorer ${(_d = /rv:([\d\.]+)/i.exec(userAgent)) === null || _d === void 0 ? void 0 : _d[1]}`;
255
+ if (/chrome/i.test(userAgent))
256
+ return `Chrome ${(_e = /chrome\/([\d\.]+)/i.exec(userAgent)) === null || _e === void 0 ? void 0 : _e[1]}`;
257
+ if (/firefox/i.test(userAgent))
258
+ return `Firefox ${(_f = /firefox\/([\d\.]+)/i.exec(userAgent)) === null || _f === void 0 ? void 0 : _f[1]}`;
259
+ if (/safari/i.test(userAgent))
260
+ return `Safari ${(_g = /version\/([\d\.]+)/i.exec(userAgent)) === null || _g === void 0 ? void 0 : _g[1]}`;
261
+ return 'Unknown';
262
+ }
263
+ function getSystem() {
264
+ var _a, _b, _c;
265
+ let userAgent = self.navigator.userAgent;
266
+ if (!userAgent)
267
+ return 'Unknown';
268
+ if (/iphone/i.test(userAgent))
269
+ return `IOS ${(_a = userAgent.match(/OS\s(.*?)\slike/)) === null || _a === void 0 ? void 0 : _a[1]}`;
270
+ if (/android/i.test(userAgent))
271
+ return `Android ${(_b = userAgent.match(/Android\s(.*?)\;/)) === null || _b === void 0 ? void 0 : _b[1]}`;
272
+ if (/windows/i.test(userAgent))
273
+ return `Windows ${(_c = userAgent.match(/Windows\s(.*?)\;/)) === null || _c === void 0 ? void 0 : _c[1]}`;
274
+ if (/mac/i.test(userAgent))
275
+ return `Mac OS`;
276
+ return 'Unknown';
277
+ }
278
+ function getDevice$1() {
279
+ let userAgent = self.navigator.userAgent;
280
+ if (!userAgent)
281
+ return 'Unknown';
282
+ if (/iphone/i.test(userAgent))
283
+ return `iPhone`;
284
+ if (/android/i.test(userAgent)) {
285
+ // var index1 = userAgent.indexOf(';');
286
+ // var index2 = userAgent.indexOf(';', index1 + 1);
287
+ // var index3 = userAgent.indexOf(';', index2 + 1);
288
+ // var index4 = userAgent.indexOf(';', index3 + 1);
289
+ // if (index2 !== -1 && index3 !== -1) {
290
+ // var value1 = userAgent.substring(index3 + 1, index4);
291
+ // return `${value1}`;
292
+ // }
293
+ var index1 = userAgent.indexOf('(');
294
+ var index2 = userAgent.indexOf(')');
295
+ if (index1 !== -1 && index2 !== -1) {
296
+ var value = userAgent.substring(index1 + 1, index2);
297
+ return `${value}`;
298
+ }
299
+ }
300
+ if (/windows/i.test(userAgent))
301
+ return `Windows`;
302
+ if (/mac/i.test(userAgent))
303
+ return `Mac`;
304
+ return 'Unknown';
305
+ }
306
+ function getCookie(val) {
307
+ // const expirationDate = new Date();
308
+ // expirationDate.setDate(expirationDate.getDate() + 100);
309
+ // document.cookie = `_fbc=IwAR2F4-dbP0l7Mn1IawQQGCINEz7PYXQvwjNwB_qa2ofrHyiLjcbCRxTDGrc; expires=${expirationDate.toUTCString()}; path=/`;
310
+ const cookies = document.cookie;
311
+ // 将cookie字符串拆分成数组
312
+ const cookieArray = cookies.split(';');
313
+ let value = null;
314
+ // 遍历cookie数组,查找名为_fbc的cookie
315
+ cookieArray.forEach((cookie) => {
316
+ const [cookieName, cookieValue] = cookie.trim().split('=');
317
+ if (cookieName === val) {
318
+ value = cookieValue;
319
+ }
320
+ });
321
+ return value !== null && value !== void 0 ? value : '';
322
+ }
242
323
 
243
324
  function unzip(b64Data) {
244
325
  const strData = atob(b64Data);
@@ -554,7 +635,7 @@ var DataSourceType;
554
635
  DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
555
636
  })(DataSourceType || (DataSourceType = {}));
556
637
  const DEFAULT_TAG = 'FOR U';
557
- const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false, utmParameter }) => {
638
+ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false, utmParameter, channelQueryList }) => {
558
639
  var _a, _b, _c;
559
640
  const [rtcList, setRtcList] = React.useState([]);
560
641
  const [tagList, setTagList] = React.useState([]);
@@ -638,15 +719,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
638
719
  // 获取推荐视频数据
639
720
  const getRecommendVideos = React.useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
640
721
  var _d, _e, _f, _g, _h;
641
- query = {
642
- maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize,
643
- defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize,
644
- 'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
645
- 'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
646
- hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
647
- traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo,
648
- themeTag: query === null || query === void 0 ? void 0 : query.themeTag
649
- };
722
+ query = Object.assign(Object.assign({ maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize, defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : 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 }, ((query === null || query === void 0 ? void 0 : query.contentFilter) && { contentFilter: `[${query === null || query === void 0 ? void 0 : query.contentFilter}]` })), ((query === null || query === void 0 ? void 0 : query.productFilter) && { productFilter: `[${query === null || query === void 0 ? void 0 : query.productFilter}]` }));
650
723
  if (utmVal) {
651
724
  const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
652
725
  var _a, _b;
@@ -655,6 +728,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
655
728
  })) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
656
729
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
657
730
  }
731
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || isEditor) {
732
+ query = Object.assign(Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: 1 }), (!utmVal && channelQueryList && (channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList.length) > 0 && { channel: channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList.join('&') }));
733
+ }
658
734
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
659
735
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
660
736
  return undefined;
@@ -662,23 +738,20 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
662
738
  if (!(query === null || query === void 0 ? void 0 : query.hashTag))
663
739
  setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
664
740
  return result === null || result === void 0 ? void 0 : result.data;
665
- }), [bffFetch, utmVal, maxSize, defaultSize]);
741
+ }), [bffFetch, utmVal, maxSize, defaultSize, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview, channelQueryList, isEditor]);
666
742
  const loadVideos = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
743
+ var _j, _k, _l, _m;
667
744
  if (rtcList.length <= 0) {
668
745
  return;
669
746
  }
670
- const data = yield getRecommendVideos({
671
- hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
672
- 'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
673
- 'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
674
- themeTag: themeTag.current
675
- });
747
+ const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
748
+ const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_j = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _j === void 0 ? void 0 : _j.itemId) && { productFilter: (_k = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _k === void 0 ? void 0 : _k.itemId })), (((_l = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _l === void 0 ? void 0 : _l.itemId) && { contentFilter: (_m = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _m === void 0 ? void 0 : _m.itemId })), { themeTag: themeTag.current }));
676
749
  setRtcList(rtcList.concat(getFilterRecList(data)));
677
750
  setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
678
751
  }), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
679
752
  const bffEventReport = React.useCallback(({ userInfo, eventInfo }) => {
680
753
  // 关闭 BFF 事件上报
681
- if (!enableReportEvent) {
754
+ if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
682
755
  return;
683
756
  }
684
757
  // 用户信息都是公共的
@@ -689,7 +762,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
689
762
  };
690
763
  }
691
764
  const sessionID = storeAndLoadFeSessionId();
692
- const ef = Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, eventInfo);
765
+ const ef = Object.assign(Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, eventInfo), { sxpDevice: getDevice$1(), sxpSystem: getSystem(), sxpBrowser: getBrowserInfo() });
693
766
  const realUserInfo = Object.entries(userInfo).map(([k, v]) => ({ name: k, value: v }));
694
767
  const realEventInfo = Object.entries(ef)
695
768
  .map(([k, v]) => v && { name: k, value: v })
@@ -703,11 +776,11 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
703
776
  body: { userInfo: realUserInfo, eventInfo: realEventInfo },
704
777
  type: 'beacon'
705
778
  });
706
- }, [bffFetch, curReqInfo, enableReportEvent]);
779
+ }, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
707
780
  const bffFbReport = React.useCallback((_a) => {
708
- var _b;
781
+ var _b, _c;
709
782
  var { eventName, actionSource = 'website', eventSourceUrl = (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href, externalId } = _a;
710
- if (!enableReportEvent || !enabledMetaConversionApi) {
783
+ if (!enableReportEvent || !enabledMetaConversionApi || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
711
784
  return;
712
785
  }
713
786
  const fakeUserId = storeAndLoadFeUserId();
@@ -718,12 +791,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
718
791
  actionSource,
719
792
  eventSourceUrl,
720
793
  userData: {
721
- externalId: fakeUserId
794
+ externalId: fakeUserId,
795
+ fbc: `fb.2.${new Date().getTime()}.${getCookie('_fbc')}`,
796
+ fbp: `fb.2.${new Date().getTime()}.${getCookie('_fbp')}`,
797
+ client_user_agent: (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent
722
798
  }
723
799
  },
724
800
  type: 'beacon'
725
801
  });
726
- }, [bffFetch, enableReportEvent, enabledMetaConversionApi]);
802
+ }, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
727
803
  const bffMutateLike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
728
804
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/like', { method: 'POST', body }));
729
805
  return res === null || res === void 0 ? void 0 : res.success;
@@ -738,24 +814,24 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
738
814
  }), [bffFetch]);
739
815
  // 获取 Tag
740
816
  const bffGetTagList = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
741
- var _j, _k, _l, _m, _o;
817
+ var _o, _p, _q, _r, _s;
742
818
  if (!utmVal || !isShowTag)
743
819
  return;
744
820
  try {
745
- const val = (_l = (_k = (_j = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _j === void 0 ? void 0 : _j.filter((val) => {
821
+ const val = (_q = (_p = (_o = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _o === void 0 ? void 0 : _o.filter((val) => {
746
822
  var _a, _b;
747
823
  const key = val.split('=')[0];
748
824
  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);
749
- })) === null || _k === void 0 ? void 0 : _k.join('&')) !== null && _l !== void 0 ? _l : '';
825
+ })) === null || _p === void 0 ? void 0 : _p.join('&')) !== null && _q !== void 0 ? _q : '';
750
826
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
751
- setTagList((_o = (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.tags) !== null && _o !== void 0 ? _o : []);
827
+ setTagList((_s = (_r = result === null || result === void 0 ? void 0 : result.data) === null || _r === void 0 ? void 0 : _r.tags) !== null && _s !== void 0 ? _s : []);
752
828
  }
753
829
  catch (e) {
754
830
  console.log('e', e);
755
831
  }
756
832
  }), [bffFetch, utmVal, isShowTag]);
757
833
  const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
758
- 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;
834
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
759
835
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
760
836
  const isProd = ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) || (((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProducts) && ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProducts) === null || _d === void 0 ? void 0 : _d.length) > 0);
761
837
  let fromKName = '';
@@ -768,8 +844,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
768
844
  else if ((_g = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.imgUrls) === null || _g === void 0 ? void 0 : _g.length) {
769
845
  fromKName = 'imagePage';
770
846
  }
847
+ const contentTags = (_p = (_m = (_h = product === null || product === void 0 ? void 0 : product.tags) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : (_q = rec === null || rec === void 0 ? void 0 : rec.product) === null || _q === void 0 ? void 0 : _q.tags;
771
848
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
772
- eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_2 = (_z = (_u = (_q = (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : (_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.bindCta) === null || _p === void 0 ? void 0 : _p.traceInfo) !== null && _q !== void 0 ? _q : (_t = (_s = (_r = rec === null || rec === void 0 ? void 0 : rec.video) === null || _r === void 0 ? void 0 : _r.bindProduct) === null || _s === void 0 ? void 0 : _s.bindCta) === null || _t === void 0 ? void 0 : _t.traceInfo) !== null && _u !== void 0 ? _u : (_y = (_x = (_w = (_v = rec === null || rec === void 0 ? void 0 : rec.video) === null || _v === void 0 ? void 0 : _v.bindProducts) === null || _w === void 0 ? void 0 : _w[0]) === null || _x === void 0 ? void 0 : _x.bindCta) === null || _y === void 0 ? void 0 : _y.traceInfo) !== null && _z !== void 0 ? _z : (_1 = (_0 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : '', fromKName, fromKPage: (_3 = location === null || location === void 0 ? void 0 : location.href) !== null && _3 !== void 0 ? _3 : '' })
849
+ eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_10 = (_7 = (_2 = (_y = (_v = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _v !== void 0 ? _v : (_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_1 = (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindProduct) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : (_6 = (_5 = (_4 = (_3 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _3 === void 0 ? void 0 : _3.bindProducts) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.bindCta) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_9 = (_8 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : '', fromKName, fromKPage: (_11 = location === null || location === void 0 ? void 0 : location.href) !== null && _11 !== void 0 ? _11 : '' })
773
850
  });
774
851
  }, [bffEventReport, isFromHashtag]);
775
852
  const h5EnterLink = React.useCallback(() => {
@@ -1121,7 +1198,7 @@ var index$2 = /*#__PURE__*/Object.freeze({
1121
1198
  EditorCore: EditorCore
1122
1199
  });
1123
1200
 
1124
- var interactionRender$d = [
1201
+ var interactionRender$e = [
1125
1202
  {
1126
1203
  title: '点击事件',
1127
1204
  child: [
@@ -1137,11 +1214,26 @@ var interactionRender$d = [
1137
1214
  * @Author: binruan@chatlabs.com
1138
1215
  * @Date: 2023-07-28 18:29:57
1139
1216
  * @LastEditors: binruan@chatlabs.com
1140
- * @LastEditTime: 2024-07-02 10:01:21
1217
+ * @LastEditTime: 2024-08-06 15:35:25
1141
1218
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\AppointForm\settingRender.tsx
1142
1219
  *
1143
1220
  */
1144
- var settingRender$9 = [
1221
+ var settingRender$a = [
1222
+ {
1223
+ title: '弹窗背景',
1224
+ child: [
1225
+ {
1226
+ type: 'Number',
1227
+ label: '左右边距',
1228
+ name: ['props', 'popupBg', 'horizontalMargin']
1229
+ },
1230
+ {
1231
+ type: 'Number',
1232
+ label: '下边距',
1233
+ name: ['props', 'popupBg', 'bottomMargin']
1234
+ }
1235
+ ]
1236
+ },
1145
1237
  {
1146
1238
  type: 'Text',
1147
1239
  label: '组件名称',
@@ -1299,14 +1391,14 @@ var settingRender$9 = [
1299
1391
  * @Author: binruan@chatlabs.com
1300
1392
  * @Date: 2024-03-12 10:59:06
1301
1393
  * @LastEditors: binruan@chatlabs.com
1302
- * @LastEditTime: 2024-08-01 17:36:34
1394
+ * @LastEditTime: 2024-08-14 17:02:53
1303
1395
  * @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
1304
1396
  *
1305
1397
  */
1306
1398
  function useEventReport() {
1307
1399
  const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = useSxpDataSource();
1308
1400
  const jumpToWeb = React.useCallback((data, product, cta, position) => {
1309
- 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;
1401
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
1310
1402
  let fromKName = '';
1311
1403
  if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
1312
1404
  fromKName = 'pdpPage';
@@ -1323,21 +1415,22 @@ function useEventReport() {
1323
1415
  else if (data === null || data === void 0 ? void 0 : data.product) {
1324
1416
  fromKName = 'productPage';
1325
1417
  }
1418
+ const contentTags = (_p = (_m = (_h = product === null || product === void 0 ? void 0 : product.tags) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : (_o = data === null || data === void 0 ? void 0 : data.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : (_q = data === null || data === void 0 ? void 0 : data.product) === null || _q === void 0 ? void 0 : _q.tags;
1326
1419
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
1327
1420
  eventInfo: {
1328
1421
  eventSubject: 'jumpToWeb',
1329
1422
  eventDescription: 'User jumped to website',
1330
- productId: (_h = product === null || product === void 0 ? void 0 : product.itemId) !== null && _h !== void 0 ? _h : '',
1331
- productName: (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : '',
1423
+ productId: (_r = product === null || product === void 0 ? void 0 : product.itemId) !== null && _r !== void 0 ? _r : '',
1424
+ productName: (_s = product === null || product === void 0 ? void 0 : product.title) !== null && _s !== void 0 ? _s : '',
1332
1425
  price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0',
1333
- productCollection: (_k = product === null || product === void 0 ? void 0 : product.collection) !== null && _k !== void 0 ? _k : '',
1426
+ productCollection: (_t = product === null || product === void 0 ? void 0 : product.collection) !== null && _t !== void 0 ? _t : '',
1334
1427
  fromKName,
1335
1428
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
1336
- contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
1429
+ contentTags: contentTags ? JSON.stringify(contentTags) : '',
1337
1430
  position: position + '',
1338
- contentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
1339
- ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
1340
- traceInfo: (_1 = (_y = (_w = (_s = (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : (_r = (_q = data === null || data === void 0 ? void 0 : data.video) === null || _q === void 0 ? void 0 : _q.bindProduct) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : (_v = (_u = (_t = data === null || data === void 0 ? void 0 : data.video) === null || _t === void 0 ? void 0 : _t.bindProducts) === null || _u === void 0 ? void 0 : _u[0]) === null || _v === void 0 ? void 0 : _v.traceInfo) !== null && _w !== void 0 ? _w : (_x = data === null || data === void 0 ? void 0 : data.product) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_0 = (_z = data === null || data === void 0 ? void 0 : data.video) === null || _z === void 0 ? void 0 : _z.bindCta) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : ''
1431
+ contentId: (_v = (_u = data === null || data === void 0 ? void 0 : data.video) === null || _u === void 0 ? void 0 : _u.itemId) !== null && _v !== void 0 ? _v : '',
1432
+ ctatId: (_w = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _w !== void 0 ? _w : '',
1433
+ traceInfo: (_9 = (_6 = (_4 = (_0 = (_x = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _x !== void 0 ? _x : (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.bindProduct) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : (_3 = (_2 = (_1 = data === null || data === void 0 ? void 0 : data.video) === null || _1 === void 0 ? void 0 : _1.bindProducts) === null || _2 === void 0 ? void 0 : _2[0]) === null || _3 === void 0 ? void 0 : _3.traceInfo) !== null && _4 !== void 0 ? _4 : (_5 = data === null || data === void 0 ? void 0 : data.product) === null || _5 === void 0 ? void 0 : _5.traceInfo) !== null && _6 !== void 0 ? _6 : (_8 = (_7 = data === null || data === void 0 ? void 0 : data.video) === null || _7 === void 0 ? void 0 : _7.bindCta) === null || _8 === void 0 ? void 0 : _8.traceInfo) !== null && _9 !== void 0 ? _9 : ''
1341
1434
  }
1342
1435
  });
1343
1436
  }, [bffEventReport, popupDetailData, isFromHashtag]);
@@ -1507,9 +1600,9 @@ const AppointForm = createMaterial(AppointFormComponent, {
1507
1600
  category: 'popup',
1508
1601
  type: 'AppointForm',
1509
1602
  related: {
1510
- settingRender: settingRender$9,
1603
+ settingRender: settingRender$a,
1511
1604
  bindableProps: [],
1512
- interactionRender: interactionRender$d
1605
+ interactionRender: interactionRender$e
1513
1606
  },
1514
1607
  defaulSetting: {
1515
1608
  name: '表单',
@@ -1532,10 +1625,41 @@ const AppointForm = createMaterial(AppointFormComponent, {
1532
1625
  sort: 2
1533
1626
  });
1534
1627
 
1535
- var settingRender$8 = [
1628
+ var settingRender$9 = [
1629
+ {
1630
+ title: '弹窗背景',
1631
+ child: [
1632
+ {
1633
+ type: 'Number',
1634
+ label: '左右边距',
1635
+ name: ['props', 'popupBg', 'horizontalMargin']
1636
+ },
1637
+ {
1638
+ type: 'Number',
1639
+ label: '下边距',
1640
+ name: ['props', 'popupBg', 'bottomMargin']
1641
+ }
1642
+ ]
1643
+ },
1536
1644
  {
1537
1645
  title: '商品图片',
1538
1646
  child: [
1647
+ {
1648
+ type: 'Group',
1649
+ label: '宽高比',
1650
+ child: [
1651
+ {
1652
+ type: 'Number',
1653
+ name: ['props', 'commodityImgRatio', 'w'],
1654
+ addonAfter: 'w'
1655
+ },
1656
+ {
1657
+ type: 'Number',
1658
+ name: ['props', 'commodityImgRatio', 'h'],
1659
+ addonAfter: 'h'
1660
+ }
1661
+ ]
1662
+ },
1539
1663
  {
1540
1664
  type: 'Radius',
1541
1665
  label: '轮播指示器',
@@ -1547,6 +1671,10 @@ var settingRender$8 = [
1547
1671
  {
1548
1672
  label: '居中',
1549
1673
  value: 'center'
1674
+ },
1675
+ {
1676
+ label: '居右',
1677
+ value: 'right'
1550
1678
  }
1551
1679
  ],
1552
1680
  name: ['props', 'swiper', 'dotsAlign']
@@ -1794,6 +1922,17 @@ var settingRender$8 = [
1794
1922
  name: ['props', 'buttonStyle']
1795
1923
  }
1796
1924
  ]
1925
+ },
1926
+ {
1927
+ title: 'Iframe商品弹窗',
1928
+ child: [
1929
+ {
1930
+ label: '弹窗按钮',
1931
+ type: 'Upload',
1932
+ name: ['props', 'iframeIcon'],
1933
+ text: '建议尺寸:106 * 41'
1934
+ }
1935
+ ]
1797
1936
  }
1798
1937
  ];
1799
1938
 
@@ -8623,13 +8762,13 @@ SwiperSlide.displayName = 'SwiperSlide';
8623
8762
  * @Author: binruan@chatlabs.com
8624
8763
  * @Date: 2023-11-02 18:34:34
8625
8764
  * @LastEditors: binruan@chatlabs.com
8626
- * @LastEditTime: 2024-07-29 16:20:40
8765
+ * @LastEditTime: 2024-08-06 16:35:43
8627
8766
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
8628
8767
  *
8629
8768
  */
8630
8769
  const closeIcon$1 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
8631
8770
  const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema, fullHeight = window.innerHeight, isFullScreen = false }) => {
8632
- var _a, _b;
8771
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
8633
8772
  const touchRef = React.useRef(null);
8634
8773
  const fTouchRef = React.useRef(null);
8635
8774
  const touchMoveRef = React.useRef(null);
@@ -8656,12 +8795,16 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
8656
8795
  const isOpen = React.useMemo(() => {
8657
8796
  return ((popup === null || popup === void 0 ? void 0 : popup.id) && (popup === null || popup === void 0 ? void 0 : popup.id) !== '') || visible;
8658
8797
  }, [visible, popup]);
8659
- const isScrollFullScreen = React.useMemo(() => {
8660
- var _a, _b, _c, _d, _e;
8798
+ const getPopupById = React.useMemo(() => {
8799
+ var _a, _b, _c;
8661
8800
  const schemaData = schema !== null && schema !== void 0 ? schema : _schema;
8662
8801
  const value = (_c = (_b = (_a = schemaData === null || schemaData === void 0 ? void 0 : schemaData.sxpPageConf) === null || _a === void 0 ? void 0 : _a.globalConfig) === null || _b === void 0 ? void 0 : _b.popupList) === null || _c === void 0 ? void 0 : _c.find((value) => (value === null || value === void 0 ? void 0 : value.id) === (popup === null || popup === void 0 ? void 0 : popup.id));
8663
- return ((_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.event) === null || _e === void 0 ? void 0 : _e.isScrollFullScreen) || false;
8802
+ return value;
8664
8803
  }, [popup, schema, _schema]);
8804
+ const isScrollFullScreen = React.useMemo(() => {
8805
+ var _a, _b;
8806
+ return ((_b = (_a = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _a === void 0 ? void 0 : _a.event) === null || _b === void 0 ? void 0 : _b.isScrollFullScreen) || false;
8807
+ }, [getPopupById]);
8665
8808
  React.useEffect(() => {
8666
8809
  if (isOpen) {
8667
8810
  setIsShow(true);
@@ -8728,22 +8871,31 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
8728
8871
  touchMoveRef.current = false;
8729
8872
  };
8730
8873
  return ReactDOM__namespace.createPortal(React.createElement(React.Fragment, null, isShow && (React.createElement("div", { className: 'modal-bg', style: Object.assign({ display: 'flex', backgroundColor: isOpen ? 'rgba(0, 0, 0, 0.7)' : 'rgba(0, 0, 0, 0)' }, modalStyle), onClick: handleClose },
8731
- React.createElement("div", Object.assign({ className: `modal-container ${isOpen ? 'modal-popIn' : 'modal-popOut'}`, style: Object.assign({ padding, animationDuration: ((_a = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _a !== void 0 ? _a : 0) / 1000 + 's' }, (isScrollFullScreen && {
8732
- transform: `translateY(${modalTrans}px)`
8733
- })), onClick: (e) => {
8734
- e.stopPropagation();
8735
- e.preventDefault();
8736
- } }, (isScrollFullScreen && {
8737
- onTouchMove: handleTouchMove,
8738
- onTouchStart: handleTouchStart,
8739
- onTouchEnd: handleTouchEnd
8740
- })),
8741
- React.createElement("div", { onClick: onClose, className: 'modal-icon-wrapper' },
8742
- React.createElement("img", { src: (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _b !== void 0 ? _b : closeIcon$1, alt: 'close', className: 'modal-icon' })),
8743
- React.createElement("div", { ref: ref, style: {
8744
- height: isScrollFullScreen ? fullHeight : MODAL_DEF_CON_H,
8745
- overflow: (isScrollFullScreen && modalTrans <= 0) || !isScrollFullScreen ? 'auto' : 'hidden'
8746
- } }, children))))), modalEleRef.current);
8874
+ React.createElement("div", { style: {
8875
+ position: 'relative',
8876
+ left: `${(_d = (_c = (_b = (_a = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.popupBg) === null || _c === void 0 ? void 0 : _c.horizontalMargin) !== null && _d !== void 0 ? _d : 0}px`,
8877
+ right: `${(_h = (_g = (_f = (_e = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _e === void 0 ? void 0 : _e.props) === null || _f === void 0 ? void 0 : _f.popupBg) === null || _g === void 0 ? void 0 : _g.horizontalMargin) !== null && _h !== void 0 ? _h : 0}px`,
8878
+ bottom: `${(_m = (_l = (_k = (_j = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _j === void 0 ? void 0 : _j.props) === null || _k === void 0 ? void 0 : _k.popupBg) === null || _l === void 0 ? void 0 : _l.bottomMargin) !== null && _m !== void 0 ? _m : 0}px`,
8879
+ overflow: 'hidden',
8880
+ width: `calc(100% - ${((_r = (_q = (_p = (_o = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _o === void 0 ? void 0 : _o.props) === null || _p === void 0 ? void 0 : _p.popupBg) === null || _q === void 0 ? void 0 : _q.horizontalMargin) !== null && _r !== void 0 ? _r : 0) * 2}px)`,
8881
+ height: '100%'
8882
+ } },
8883
+ React.createElement("div", Object.assign({ className: `modal-container ${isOpen ? 'modal-popIn' : 'modal-popOut'}`, style: Object.assign({ padding, animationDuration: ((_s = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _s !== void 0 ? _s : 0) / 1000 + 's' }, (isScrollFullScreen && {
8884
+ transform: `translateY(${modalTrans}px)`
8885
+ })), onClick: (e) => {
8886
+ e.stopPropagation();
8887
+ e.preventDefault();
8888
+ } }, (isScrollFullScreen && {
8889
+ onTouchMove: handleTouchMove,
8890
+ onTouchStart: handleTouchStart,
8891
+ onTouchEnd: handleTouchEnd
8892
+ })),
8893
+ React.createElement("div", { onClick: onClose, className: 'modal-icon-wrapper' },
8894
+ React.createElement("img", { src: (_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _t !== void 0 ? _t : closeIcon$1, alt: 'close', className: 'modal-icon' })),
8895
+ React.createElement("div", { ref: ref, style: {
8896
+ height: isScrollFullScreen ? fullHeight : MODAL_DEF_CON_H,
8897
+ overflow: (isScrollFullScreen && modalTrans <= 0) || !isScrollFullScreen ? 'auto' : 'hidden'
8898
+ } }, children)))))), modalEleRef.current);
8747
8899
  };
8748
8900
  var Modal$1 = React.memo(Modal);
8749
8901
 
@@ -8816,18 +8968,20 @@ const FormatImage = React.forwardRef((props, ref) => {
8816
8968
  const { src, onLoad, style, className, loading, alt = 'image' } = props;
8817
8969
  const [imgSrc, setImgSrc] = React.useState();
8818
8970
  const imgRef = React.useRef(null);
8971
+ const [visible, setVisible] = React.useState(false);
8819
8972
  React.useImperativeHandle(ref, () => ({
8820
8973
  setSrc: (v) => {
8821
- setImgSrc(v);
8974
+ if (v)
8975
+ setImgSrc(v);
8822
8976
  }
8823
8977
  }));
8824
8978
  React.useEffect(() => {
8825
- setImgSrc(src);
8979
+ if (src)
8980
+ setImgSrc(src);
8826
8981
  }, [src]);
8827
8982
  React.useEffect(() => {
8828
8983
  const onShow = () => {
8829
- var _a, _b;
8830
- if (src && ((_b = (_a = imgRef === null || imgRef === void 0 ? void 0 : imgRef.current) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.display) === 'none') {
8984
+ if (src && !visible && imgRef.current) {
8831
8985
  imgRef.current.src = '';
8832
8986
  imgRef.current.src = src;
8833
8987
  }
@@ -8836,20 +8990,20 @@ const FormatImage = React.forwardRef((props, ref) => {
8836
8990
  return () => {
8837
8991
  SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
8838
8992
  };
8839
- }, [src]);
8840
- return (React.createElement(React.Fragment, null, (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
8841
- React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
8842
- React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
8843
- React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
8844
- React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign(Object.assign({}, style), { display: 'none' }), loading: loading, onLoad: (e) => {
8845
- if (imgRef.current)
8846
- imgRef.current.style.display = 'block';
8993
+ }, [src, visible]);
8994
+ return (React.createElement(React.Fragment, null,
8995
+ !visible && React.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
8996
+ (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
8997
+ React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
8998
+ React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
8999
+ React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
9000
+ React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
9001
+ setVisible(true);
9002
+ onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
9003
+ }, alt: alt }))) : (React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
9004
+ setVisible(true);
8847
9005
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
8848
- }, alt: alt }))) : (React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign(Object.assign({}, style), { display: 'none' }), loading: loading, onLoad: (e) => {
8849
- if (imgRef.current)
8850
- imgRef.current.style.display = 'block';
8851
- onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
8852
- }, alt: alt }))));
9006
+ }, alt: alt }))));
8853
9007
  });
8854
9008
  var FormatImage$1 = React.memo(FormatImage);
8855
9009
 
@@ -8907,8 +9061,8 @@ const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailDat
8907
9061
  var CommodityGroup$1 = React.memo(CommodityGroup);
8908
9062
 
8909
9063
  const CommodityDetail$1 = (_a) => {
8910
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
8911
- var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup"]);
9064
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
9065
+ var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio"]);
8912
9066
  const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef } = useSxpDataSource();
8913
9067
  const { jumpToWeb, productView } = useEventReport();
8914
9068
  const curTimeRef = React.useRef(null);
@@ -8964,7 +9118,8 @@ const CommodityDetail$1 = (_a) => {
8964
9118
  return '$7,000';
8965
9119
  }
8966
9120
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
8967
- const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
9121
+ const width = (isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth) - ((_u = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _u !== void 0 ? _u : 0) * 2;
9122
+ const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
8968
9123
  const renderContent = ({ isPost }) => {
8969
9124
  var _a, _b, _c, _d;
8970
9125
  return (React.createElement("div", null,
@@ -9011,25 +9166,32 @@ const CommodityDetail$1 = (_a) => {
9011
9166
  return;
9012
9167
  return (React.createElement(CommodityGroup$1, { products: (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts, data: commodityGroup, defImg: (_c = (_b = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _b !== void 0 ? _b : bottom_image) !== null && _c !== void 0 ? _c : '', style: { padding: '0 19px' }, onCLick: handleClick, popupDetailData: popupDetailData, check: checkCommodityIndex }));
9013
9168
  }, [checkCommodityIndex]);
9169
+ const getDotsAlign = React.useMemo(() => {
9170
+ const dotsAlignClass = {
9171
+ left: 'commondityDetail-swiper-clickable-left',
9172
+ center: 'commondityDetail-swiper-clickable-center',
9173
+ right: 'commondityDetail-swiper-clickable-right'
9174
+ };
9175
+ return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
9176
+ }, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
9177
+ const iframeUrl = ((_w = (_v = data === null || data === void 0 ? void 0 : data.video) === null || _v === void 0 ? void 0 : _v.bindProduct) === null || _w === void 0 ? void 0 : _w.remark) || ((_z = (_y = (_x = data === null || data === void 0 ? void 0 : data.video) === null || _x === void 0 ? void 0 : _x.bindProducts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.remark) || ((_0 = data === null || data === void 0 ? void 0 : data.product) === null || _0 === void 0 ? void 0 : _0.remark);
9014
9178
  return (React.createElement(React.Fragment, null,
9015
9179
  React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
9016
- product && ((_u = product === null || product === void 0 ? void 0 : product.homePage) === null || _u === void 0 ? void 0 : _u.length) > 0 && (React.createElement("div", { style: { position: 'relative' } },
9017
- React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
9180
+ React.createElement("div", { style: { position: 'relative' } },
9181
+ product && ((_1 = product === null || product === void 0 ? void 0 : product.homePage) === null || _1 === void 0 ? void 0 : _1.length) > 0 && (React.createElement(Swiper, { height: height, modules: [Pagination, Autoplay], pagination: {
9018
9182
  clickable: true,
9019
9183
  bulletActiveClass: 'swipe-item-active-bullet',
9020
- clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
9021
- ? 'commondityDetail-swiper-clickable-left'
9022
- : 'commondityDetail-swiper-clickable-center'
9184
+ clickableClass: getDotsAlign
9023
9185
  }, loop: true, autoplay: {
9024
9186
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
9025
9187
  } },
9026
- React.createElement(React.Fragment, null, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
9188
+ React.createElement(React.Fragment, null, (_2 = product === null || product === void 0 ? void 0 : product.homePage) === null || _2 === void 0 ? void 0 : _2.map((src) => {
9027
9189
  var _a;
9028
9190
  return (React.createElement(SwiperSlide, { key: src },
9029
9191
  React.createElement("div", { style: {
9030
9192
  overflow: 'hidden',
9031
9193
  width,
9032
- height: width
9194
+ height
9033
9195
  } },
9034
9196
  React.createElement(FormatImage$1, { style: {
9035
9197
  height: '100%',
@@ -9038,21 +9200,30 @@ const CommodityDetail$1 = (_a) => {
9038
9200
  display: 'block',
9039
9201
  objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
9040
9202
  }, src: (_a = src !== null && src !== void 0 ? src : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _a !== void 0 ? _a : bottom_image }))));
9041
- }))))),
9042
- !((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css.css({
9043
- position: 'relative',
9044
- height: 0,
9045
- width: '100%',
9046
- paddingBottom: '100%',
9047
- overflow: 'hidden'
9048
- }) },
9049
- React.createElement("img", { className: css.css({
9050
- position: 'absolute',
9051
- left: 0,
9052
- top: 0,
9053
- objectFit: 'cover',
9054
- width: '100%'
9055
- }), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
9203
+ })))),
9204
+ !((_3 = product === null || product === void 0 ? void 0 : product.homePage) === null || _3 === void 0 ? void 0 : _3.length) && (React.createElement("div", { className: css.css({
9205
+ height,
9206
+ width
9207
+ }) },
9208
+ React.createElement("img", { className: css.css({
9209
+ objectFit: 'cover',
9210
+ width: '100%',
9211
+ height: '100%'
9212
+ }), src: (_4 = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _4 !== void 0 ? _4 : bottom_image, alt: 'pdp image' }))),
9213
+ (iframeUrl && iframeIcon) ||
9214
+ (!product && iframeIcon && (React.createElement("div", { style: {
9215
+ padding: '5px 10px',
9216
+ display: 'flex',
9217
+ alignItems: 'center',
9218
+ position: 'absolute',
9219
+ right: '10px',
9220
+ bottom: '10px',
9221
+ zIndex: 1,
9222
+ background: '#fff',
9223
+ borderRadius: '3px'
9224
+ }, onClick: () => setShow3DModal(true) },
9225
+ React.createElement("img", { src: iframeIcon, alt: '3d', width: '20px', height: '20px', style: { marginRight: '5px' } }),
9226
+ React.createElement("span", { style: { fontSize: '12px' } }, "Try in 3D"))))),
9056
9227
  renderCommodityGroup(),
9057
9228
  React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
9058
9229
  renderBtn(),
@@ -9060,10 +9231,11 @@ const CommodityDetail$1 = (_a) => {
9060
9231
  React.createElement("div", { style: { paddingBottom: '80px' } }, renderContent({ isPost: false })),
9061
9232
  renderBtn()),
9062
9233
  React.createElement(Modal$1, { visible: show3DModal, padding: 0, isFullScreen: true, onClose: () => setShow3DModal(false) },
9063
- React.createElement("iframe", { src: 'https://rimowa.threedium.co.uk/product-experience/latest/?sku=92573974&lang=en', style: {
9234
+ React.createElement("iframe", { src: iframeUrl, style: {
9064
9235
  width: '100%',
9065
- height: 'calc(100% - 40px)',
9066
- marginTop: '40px'
9236
+ height: 'calc(100% - 50px)',
9237
+ marginTop: '40px',
9238
+ border: 'none'
9067
9239
  } }))));
9068
9240
  };
9069
9241
  var CommodityDetailComponent = React.memo(CommodityDetail$1);
@@ -9084,7 +9256,7 @@ var CommodityDetailComponent = React.memo(CommodityDetail$1);
9084
9256
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\interactionRender.tsx
9085
9257
  *
9086
9258
  */
9087
- var interactionRender$c = [
9259
+ var interactionRender$d = [
9088
9260
  {
9089
9261
  title: '滑动事件',
9090
9262
  child: [
@@ -9101,7 +9273,7 @@ var interactionRender$c = [
9101
9273
  * @Author: binruan@chatlabs.com
9102
9274
  * @Date: 2023-07-28 18:29:57
9103
9275
  * @LastEditors: binruan@chatlabs.com
9104
- * @LastEditTime: 2024-07-31 13:58:45
9276
+ * @LastEditTime: 2024-08-08 18:30:20
9105
9277
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetail\material.tsx
9106
9278
  *
9107
9279
  */
@@ -9111,8 +9283,8 @@ const CommodityDetail = createMaterial(CommodityDetailComponent, {
9111
9283
  category: 'popup',
9112
9284
  type: 'CommodityDetail',
9113
9285
  related: {
9114
- settingRender: settingRender$8,
9115
- interactionRender: interactionRender$c
9286
+ settingRender: settingRender$9,
9287
+ interactionRender: interactionRender$d
9116
9288
  },
9117
9289
  defaulSetting: {
9118
9290
  props: {
@@ -9154,6 +9326,10 @@ const CommodityDetail = createMaterial(CommodityDetailComponent, {
9154
9326
  fontWeight: 'bold',
9155
9327
  textAlign: 'center',
9156
9328
  color: 'rgba(255, 255, 255, 0.9)'
9329
+ },
9330
+ commodityImgRatio: {
9331
+ w: 1,
9332
+ h: 1
9157
9333
  }
9158
9334
  },
9159
9335
  style: {}
@@ -9163,7 +9339,7 @@ const CommodityDetail = createMaterial(CommodityDetailComponent, {
9163
9339
  sort: 1
9164
9340
  });
9165
9341
 
9166
- var interactionRender$b = [
9342
+ var interactionRender$c = [
9167
9343
  {
9168
9344
  title: '点击事件',
9169
9345
  child: [
@@ -9179,13 +9355,28 @@ var interactionRender$b = [
9179
9355
  * @Author: binruan@chatlabs.com
9180
9356
  * @Date: 2023-10-27 14:06:35
9181
9357
  * @LastEditors: binruan@chatlabs.com
9182
- * @LastEditTime: 2024-07-02 09:58:06
9358
+ * @LastEditTime: 2024-08-06 16:15:08
9183
9359
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\Prompt\settingRender.tsx
9184
9360
  *
9185
9361
  */
9186
- var settingRender$7 = [
9362
+ var settingRender$8 = [
9187
9363
  {
9188
- title: '',
9364
+ title: '弹窗背景',
9365
+ child: [
9366
+ {
9367
+ type: 'Number',
9368
+ label: '左右边距',
9369
+ name: ['props', 'popupBg', 'horizontalMargin']
9370
+ },
9371
+ {
9372
+ type: 'Number',
9373
+ label: '下边距',
9374
+ name: ['props', 'popupBg', 'bottomMargin']
9375
+ }
9376
+ ]
9377
+ },
9378
+ {
9379
+ title: '内容',
9189
9380
  child: [
9190
9381
  {
9191
9382
  type: 'Media',
@@ -9353,9 +9544,9 @@ const Prompt = createMaterial(PromptComponent, {
9353
9544
  category: 'popup',
9354
9545
  type: 'Prompt',
9355
9546
  related: {
9356
- settingRender: settingRender$7,
9547
+ settingRender: settingRender$8,
9357
9548
  bindableProps: [],
9358
- interactionRender: interactionRender$b
9549
+ interactionRender: interactionRender$c
9359
9550
  },
9360
9551
  defaulSetting: {
9361
9552
  props: {
@@ -9374,14 +9565,45 @@ const Prompt = createMaterial(PromptComponent, {
9374
9565
  * @Author: binruan@chatlabs.com
9375
9566
  * @Date: 2024-03-26 16:50:25
9376
9567
  * @LastEditors: binruan@chatlabs.com
9377
- * @LastEditTime: 2024-07-12 14:44:50
9568
+ * @LastEditTime: 2024-08-08 18:34:06
9378
9569
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiroNew\settingRender.tsx
9379
9570
  *
9380
9571
  */
9381
- var settingRender$6 = [
9572
+ var settingRender$7 = [
9573
+ {
9574
+ title: '弹窗背景',
9575
+ child: [
9576
+ {
9577
+ type: 'Number',
9578
+ label: '左右边距',
9579
+ name: ['props', 'popupBg', 'horizontalMargin']
9580
+ },
9581
+ {
9582
+ type: 'Number',
9583
+ label: '下边距',
9584
+ name: ['props', 'popupBg', 'bottomMargin']
9585
+ }
9586
+ ]
9587
+ },
9382
9588
  {
9383
9589
  title: '商品图片',
9384
9590
  child: [
9591
+ {
9592
+ type: 'Group',
9593
+ label: '宽高比',
9594
+ child: [
9595
+ {
9596
+ type: 'Number',
9597
+ name: ['props', 'commodityImgRatio', 'w'],
9598
+ addonAfter: 'w'
9599
+ },
9600
+ {
9601
+ type: 'Number',
9602
+ name: ['props', 'commodityImgRatio', 'h'],
9603
+ addonAfter: 'h'
9604
+ }
9605
+ ]
9606
+ },
9385
9607
  {
9386
9608
  type: 'Radius',
9387
9609
  label: '轮播指示器',
@@ -9393,6 +9615,10 @@ var settingRender$6 = [
9393
9615
  {
9394
9616
  label: '居中',
9395
9617
  value: 'center'
9618
+ },
9619
+ {
9620
+ label: '居右',
9621
+ value: 'right'
9396
9622
  }
9397
9623
  ],
9398
9624
  name: ['props', 'swiper', 'dotsAlign']
@@ -9623,12 +9849,23 @@ var settingRender$6 = [
9623
9849
  name: ['props', 'buttonStyle']
9624
9850
  }
9625
9851
  ]
9852
+ },
9853
+ {
9854
+ title: 'Iframe商品弹窗',
9855
+ child: [
9856
+ {
9857
+ label: '弹窗按钮',
9858
+ type: 'Upload',
9859
+ name: ['props', 'iframeIcon'],
9860
+ text: '建议尺寸:106 * 41'
9861
+ }
9862
+ ]
9626
9863
  }
9627
9864
  ];
9628
9865
 
9629
9866
  const CommodityDetailDiroNew$1 = (_a) => {
9630
- var _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;
9631
- var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup"]);
9867
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
9868
+ var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio"]);
9632
9869
  React.useState(true);
9633
9870
  const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef } = useSxpDataSource();
9634
9871
  const { jumpToWeb, productView } = useEventReport();
@@ -9637,6 +9874,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
9637
9874
  React.useState(true);
9638
9875
  const [showModal, setShowModal] = React.useState(false);
9639
9876
  const curTimeRef = React.useRef(null);
9877
+ const [show3DModal, setShow3DModal] = React.useState(false);
9640
9878
  const [checkCommodityIndex, setCheckCommodityIndex] = React.useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
9641
9879
  const data = isPost ? rec : popupDetailData;
9642
9880
  let product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_d = (_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct) !== null && _d !== void 0 ? _d : (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProducts) === null || _f === void 0 ? void 0 : _f[0];
@@ -9687,7 +9925,8 @@ const CommodityDetailDiroNew$1 = (_a) => {
9687
9925
  return '£102,300.00';
9688
9926
  }
9689
9927
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
9690
- const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
9928
+ const width = (isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth) - ((_u = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _u !== void 0 ? _u : 0) * 2;
9929
+ const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
9691
9930
  // useEffect(() => {
9692
9931
  // console.log(scrollRef?.current?.scrollHeight, window.innerHeight);
9693
9932
  // if (scrollRef?.current && scrollRef?.current?.scrollHeight > window.innerHeight) {
@@ -9761,52 +10000,69 @@ Made in Italy` })));
9761
10000
  return;
9762
10001
  return (React.createElement(CommodityGroup$1, { products: (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts, data: commodityGroup, defImg: (_c = (_b = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _b !== void 0 ? _b : bottom_image) !== null && _c !== void 0 ? _c : '', style: { padding: '0 19px' }, onCLick: handleClick, popupDetailData: popupDetailData, check: checkCommodityIndex }));
9763
10002
  }, [checkCommodityIndex]);
10003
+ const getDotsAlign = React.useMemo(() => {
10004
+ const dotsAlignClass = {
10005
+ left: 'commondityDetail-swiper-clickable-left',
10006
+ center: 'commondityDetail-swiper-clickable-center',
10007
+ right: 'commondityDetail-swiper-clickable-right'
10008
+ };
10009
+ return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
10010
+ }, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
10011
+ const iframeUrl = ((_w = (_v = data === null || data === void 0 ? void 0 : data.video) === null || _v === void 0 ? void 0 : _v.bindProduct) === null || _w === void 0 ? void 0 : _w.remark) || ((_z = (_y = (_x = data === null || data === void 0 ? void 0 : data.video) === null || _x === void 0 ? void 0 : _x.bindProducts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.remark) || ((_0 = data === null || data === void 0 ? void 0 : data.product) === null || _0 === void 0 ? void 0 : _0.remark);
9764
10012
  return (React.createElement("div", { className: 'pb-commondityDiroNew' },
9765
10013
  React.createElement("div", Object.assign({ className: css.css(Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' })) }, props),
9766
- product && ((_u = product === null || product === void 0 ? void 0 : product.homePage) === null || _u === void 0 ? void 0 : _u.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
9767
- clickable: true,
9768
- bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
9769
- clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
9770
- ? 'commondityDiroNew-swiper-clickable-left'
9771
- : 'commondityDiroNew-swiper-clickable-center'
9772
- }, loop: true, autoplay: {
9773
- delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
9774
- } }, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
9775
- var _a;
9776
- return (React.createElement(SwiperSlide, { key: src },
9777
- React.createElement("div", { style: {
9778
- overflow: 'hidden',
9779
- width,
9780
- height: width
9781
- } },
9782
- React.createElement(FormatImage$1, { style: {
9783
- height: '100%',
9784
- width: '100%',
9785
- objectFit: 'cover',
9786
- display: 'block',
9787
- objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
9788
- }, src: (_a = src !== null && src !== void 0 ? src : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _a !== void 0 ? _a : bottom_image }))));
9789
- }))),
9790
- !((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css.css({
9791
- position: 'relative',
9792
- height: 0,
9793
- width: '100%',
9794
- paddingBottom: '100%',
9795
- overflow: 'hidden'
9796
- }) },
9797
- React.createElement("img", { className: css.css({
9798
- position: 'absolute',
9799
- left: 0,
9800
- top: 0,
9801
- objectFit: 'cover',
9802
- width: '100%'
9803
- }), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
10014
+ React.createElement("div", { style: { position: 'relative' } },
10015
+ product && ((_1 = product === null || product === void 0 ? void 0 : product.homePage) === null || _1 === void 0 ? void 0 : _1.length) > 0 && (React.createElement(Swiper, { height: height, modules: [Pagination, Autoplay], pagination: {
10016
+ clickable: true,
10017
+ bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
10018
+ clickableClass: getDotsAlign
10019
+ }, loop: true, autoplay: {
10020
+ delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
10021
+ } }, (_2 = product === null || product === void 0 ? void 0 : product.homePage) === null || _2 === void 0 ? void 0 : _2.map((src) => {
10022
+ var _a;
10023
+ return (React.createElement(SwiperSlide, { key: src },
10024
+ React.createElement("div", { style: {
10025
+ overflow: 'hidden',
10026
+ width,
10027
+ height
10028
+ } },
10029
+ React.createElement(FormatImage$1, { style: {
10030
+ height: '100%',
10031
+ width: '100%',
10032
+ objectFit: 'cover',
10033
+ display: 'block',
10034
+ objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
10035
+ }, src: (_a = src !== null && src !== void 0 ? src : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _a !== void 0 ? _a : bottom_image }))));
10036
+ }))),
10037
+ !((_3 = product === null || product === void 0 ? void 0 : product.homePage) === null || _3 === void 0 ? void 0 : _3.length) && (React.createElement("div", { className: css.css({
10038
+ height,
10039
+ width
10040
+ }) },
10041
+ React.createElement("img", { className: css.css({
10042
+ objectFit: 'cover',
10043
+ width: '100%',
10044
+ height: '100%'
10045
+ }), src: (_4 = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _4 !== void 0 ? _4 : bottom_image, alt: 'pdp image' }))),
10046
+ (iframeUrl && iframeIcon) ||
10047
+ (!product && iframeIcon && (React.createElement("div", { style: {
10048
+ padding: '5px 10px',
10049
+ display: 'flex',
10050
+ alignItems: 'center',
10051
+ position: 'absolute',
10052
+ right: '10px',
10053
+ bottom: '10px',
10054
+ zIndex: 1,
10055
+ background: '#fff',
10056
+ borderRadius: '3px'
10057
+ }, onClick: () => setShow3DModal(true) },
10058
+ React.createElement("img", { src: iframeIcon, alt: '3d', width: '20px', height: '20px', style: { marginRight: '5px' } }),
10059
+ React.createElement("span", { style: { fontSize: '12px' } }, "Try in 3D"))))),
9804
10060
  renderCommodityGroup(),
9805
10061
  React.createElement("div", { className: 'pb-commondityDiroNew-content' },
9806
10062
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
9807
10063
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
9808
10064
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), dangerouslySetInnerHTML: {
9809
- __html: setFontForText((_y = product === null || product === void 0 ? void 0 : product.title) !== null && _y !== void 0 ? _y : 'Large Dior Toujours BagLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
10065
+ __html: setFontForText((_5 = product === null || product === void 0 ? void 0 : product.title) !== null && _5 !== void 0 ? _5 : 'Large Dior Toujours BagLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
9810
10066
  } }),
9811
10067
  React.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection), dangerouslySetInnerHTML: {
9812
10068
  __html: setFontForText((product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage CalfskinLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
@@ -9816,14 +10072,21 @@ Made in Italy` })));
9816
10072
  __html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
9817
10073
  } }),
9818
10074
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
9819
- __html: setFontForText((_z = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _z !== void 0 ? _z : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
10075
+ __html: setFontForText((_6 = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _6 !== void 0 ? _6 : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
9820
10076
  } }))),
9821
- (!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_0 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _0 !== void 0 ? _0 : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
10077
+ (!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_7 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _7 !== void 0 ? _7 : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
9822
10078
  React.createElement("span", { dangerouslySetInnerHTML: {
9823
- __html: setFontForText((_1 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _1 !== void 0 ? _1 : 'Shop now', buttonStyle)
10079
+ __html: setFontForText((_8 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _8 !== void 0 ? _8 : 'Shop now', buttonStyle)
9824
10080
  } }))),
9825
10081
  productInfoText({ isPost }))),
9826
- React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
10082
+ React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false })),
10083
+ React.createElement(Modal$1, { visible: show3DModal, padding: 0, isFullScreen: true, onClose: () => setShow3DModal(false) },
10084
+ React.createElement("iframe", { src: iframeUrl, style: {
10085
+ width: '100%',
10086
+ height: 'calc(100% - 50px)',
10087
+ marginTop: '40px',
10088
+ border: 'none'
10089
+ } }))));
9827
10090
  };
9828
10091
  var CommodityDetailDiroNewComponent = React.memo(CommodityDetailDiroNew$1);
9829
10092
 
@@ -9843,7 +10106,7 @@ var CommodityDetailDiroNewComponent = React.memo(CommodityDetailDiroNew$1);
9843
10106
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\interactionRender.tsx
9844
10107
  *
9845
10108
  */
9846
- var interactionRender$a = [
10109
+ var interactionRender$b = [
9847
10110
  {
9848
10111
  title: '滑动事件',
9849
10112
  child: [
@@ -9870,8 +10133,8 @@ const CommodityDetailDiroNew = createMaterial(CommodityDetailDiroNewComponent, {
9870
10133
  category: 'popup',
9871
10134
  type: 'CommodityDetailDiroNew',
9872
10135
  related: {
9873
- settingRender: settingRender$6,
9874
- interactionRender: interactionRender$a
10136
+ settingRender: settingRender$7,
10137
+ interactionRender: interactionRender$b
9875
10138
  },
9876
10139
  defaulSetting: {
9877
10140
  props: {
@@ -9914,6 +10177,10 @@ const CommodityDetailDiroNew = createMaterial(CommodityDetailDiroNewComponent, {
9914
10177
  borderRadius: 25,
9915
10178
  marginTop: 16,
9916
10179
  marginBottom: 16
10180
+ },
10181
+ commodityImgRatio: {
10182
+ w: 1,
10183
+ h: 1
9917
10184
  }
9918
10185
  },
9919
10186
  style: {}
@@ -9931,7 +10198,22 @@ const CommodityDetailDiroNew = createMaterial(CommodityDetailDiroNewComponent, {
9931
10198
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityList\settingRender.tsx
9932
10199
  *
9933
10200
  */
9934
- var settingRender$5 = [
10201
+ var settingRender$6 = [
10202
+ {
10203
+ title: '弹窗背景',
10204
+ child: [
10205
+ {
10206
+ type: 'Number',
10207
+ label: '左右边距',
10208
+ name: ['props', 'popupBg', 'horizontalMargin']
10209
+ },
10210
+ {
10211
+ type: 'Number',
10212
+ label: '下边距',
10213
+ name: ['props', 'popupBg', 'bottomMargin']
10214
+ }
10215
+ ]
10216
+ },
9935
10217
  {
9936
10218
  title: '商品图片',
9937
10219
  child: [
@@ -10289,7 +10571,7 @@ var CommodityListComponent = React.memo(CommodityList$1);
10289
10571
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\interactionRender.tsx
10290
10572
  *
10291
10573
  */
10292
- var interactionRender$9 = [
10574
+ var interactionRender$a = [
10293
10575
  {
10294
10576
  title: '点击事件',
10295
10577
  child: [
@@ -10315,8 +10597,8 @@ const CommodityList = createMaterial(CommodityListComponent, {
10315
10597
  category: 'popup',
10316
10598
  type: 'CommodityList',
10317
10599
  related: {
10318
- settingRender: settingRender$5,
10319
- interactionRender: interactionRender$9
10600
+ settingRender: settingRender$6,
10601
+ interactionRender: interactionRender$a
10320
10602
  },
10321
10603
  defaulSetting: {
10322
10604
  props: {
@@ -10357,6 +10639,59 @@ const CommodityList = createMaterial(CommodityListComponent, {
10357
10639
  sort: 1
10358
10640
  });
10359
10641
 
10642
+ /*
10643
+ * @Author: binruan@chatlabs.com
10644
+ * @Date: 2023-10-27 14:06:35
10645
+ * @LastEditors: binruan@chatlabs.com
10646
+ * @LastEditTime: 2024-08-08 17:32:11
10647
+ * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\Iframe\settingRender.tsx
10648
+ *
10649
+ */
10650
+ var settingRender$5 = [
10651
+ {
10652
+ title: '背景样式',
10653
+ child: [
10654
+ {
10655
+ type: 'Color',
10656
+ label: '背景色',
10657
+ name: ['style', 'backgroundColor']
10658
+ }
10659
+ ]
10660
+ }
10661
+ ];
10662
+
10663
+ const Iframe$1 = (_a) => {
10664
+ var _b, _c;
10665
+ var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick, submitButtonStyle, contentStyle } = _a, props = __rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick", "submitButtonStyle", "contentStyle"]);
10666
+ const { popupDetailData } = useSxpDataSource();
10667
+ const iframeUrl = (_c = (_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.video) === null || _b === void 0 ? void 0 : _b.bindCta) === null || _c === void 0 ? void 0 : _c.remark;
10668
+ return (React.createElement("div", Object.assign({ className: `${css.css(Object.assign({}, style))}` }, props), iframeUrl && (React.createElement("iframe", { src: iframeUrl, style: {
10669
+ width: '100%',
10670
+ height: 'calc(100% - 50px)',
10671
+ marginTop: '40px',
10672
+ border: 'none'
10673
+ } }))));
10674
+ };
10675
+ var IframeComponent = React.memo(Iframe$1);
10676
+
10677
+ const Iframe = createMaterial(IframeComponent, {
10678
+ displayName: 'Iframe弹窗',
10679
+ icon: '',
10680
+ category: 'popup',
10681
+ type: 'Iframe',
10682
+ related: {
10683
+ settingRender: settingRender$5,
10684
+ bindableProps: []
10685
+ },
10686
+ defaulSetting: {
10687
+ props: {},
10688
+ style: {}
10689
+ },
10690
+ w: 100,
10691
+ h: 40,
10692
+ sort: 3
10693
+ });
10694
+
10360
10695
  /*
10361
10696
  * @Author: binruan@chatlabs.com
10362
10697
  * @Date: 2024-03-26 16:50:25
@@ -10616,7 +10951,7 @@ var settingRender$4 = [
10616
10951
  }
10617
10952
  ];
10618
10953
 
10619
- var interactionRender$8 = [
10954
+ var interactionRender$9 = [
10620
10955
  {
10621
10956
  title: '点击事件',
10622
10957
  child: [
@@ -10629,7 +10964,7 @@ var interactionRender$8 = [
10629
10964
  ];
10630
10965
 
10631
10966
  const EventProvider = (_a) => {
10632
- var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
10967
+ var { rec, children, className, onClick, style, isExternalLink = false, index, jumpLink } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index", "jumpLink"]);
10633
10968
  const ref = React.useRef(null);
10634
10969
  const { popup } = useEditor();
10635
10970
  const { setPopupDetailData, ctaEvent } = useSxpDataSource();
@@ -10643,11 +10978,11 @@ const EventProvider = (_a) => {
10643
10978
  }, rec, item, index);
10644
10979
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
10645
10980
  if (isExternalLink) {
10646
- if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) {
10981
+ if (jumpLink || ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link)) {
10647
10982
  const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
10648
10983
  const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
10649
10984
  jumpToWeb(rec, product, cta, index);
10650
- window.location.href = window.getJointUtmLink((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link);
10985
+ window.location.href = window.getJointUtmLink(jumpLink || ((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link) || '');
10651
10986
  }
10652
10987
  }
10653
10988
  else {
@@ -10699,7 +11034,7 @@ const Commodity = createMaterial(CommodityComponent, {
10699
11034
  category: 'template',
10700
11035
  type: 'Commodity',
10701
11036
  related: {
10702
- interactionRender: interactionRender$8,
11037
+ interactionRender: interactionRender$9,
10703
11038
  bindableProps: [],
10704
11039
  settingRender: settingRender$4
10705
11040
  },
@@ -10741,7 +11076,7 @@ const Commodity = createMaterial(CommodityComponent, {
10741
11076
  sort: 1
10742
11077
  });
10743
11078
 
10744
- var interactionRender$7 = [
11079
+ var interactionRender$8 = [
10745
11080
  {
10746
11081
  title: '点击事件',
10747
11082
  child: [
@@ -10781,7 +11116,7 @@ const Appoint = createMaterial(AppointComponent, {
10781
11116
  category: 'template',
10782
11117
  type: 'Appoint',
10783
11118
  related: {
10784
- interactionRender: interactionRender$7,
11119
+ interactionRender: interactionRender$8,
10785
11120
  settingRender: settingRender$4 === null || settingRender$4 === void 0 ? void 0 : settingRender$4.filter((i) => i.type !== 'commodityTitle'),
10786
11121
  bindableProps: []
10787
11122
  },
@@ -10931,21 +11266,15 @@ var linkSettingRender = [
10931
11266
  var styles$7 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__nkBlU","one-line-ellipsis":"index-module_one-line-ellipsis__buFw1"};
10932
11267
 
10933
11268
  const Link$1 = (_a) => {
10934
- var _b, _c, _d, _e, _f, _g, _h, _j;
11269
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k;
10935
11270
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index, customTitle } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index", "customTitle"]);
10936
11271
  const { sxpParameter, bffEventReport } = useSxpDataSource();
10937
- const { jumpToWeb } = useEventReport();
11272
+ useEventReport();
10938
11273
  const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
10939
- const product = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
10940
- const handleTo = () => {
10941
- if (cta === null || cta === void 0 ? void 0 : cta.link) {
10942
- jumpToWeb(recData, product, cta, index);
10943
- window.location.href = window.getJointUtmLink(cta.link);
10944
- }
10945
- };
11274
+ (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
10946
11275
  const src = (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
10947
- return (React.createElement(EventProvider$1, Object.assign({ index: index, rec: recData, className: css.css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
10948
- React.createElement(Img$1, { src: src, rec: recData, item: (_g = (_f = recData === null || recData === void 0 ? void 0 : recData.video) === null || _f === void 0 ? void 0 : _f.bindProduct) !== null && _g !== void 0 ? _g : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
11276
+ return (React.createElement(EventProvider$1, Object.assign({ index: index, rec: recData, className: css.css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { jumpLink: (_f = cta === null || cta === void 0 ? void 0 : cta.link) !== null && _f !== void 0 ? _f : '' }),
11277
+ React.createElement(Img$1, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
10949
11278
  React.createElement("div", { className: css.css({
10950
11279
  display: 'flex',
10951
11280
  alignItems: 'center',
@@ -10954,14 +11283,34 @@ const Link$1 = (_a) => {
10954
11283
  }) },
10955
11284
  React.createElement("div", null,
10956
11285
  React.createElement("div", { className: styles$7['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle, dangerouslySetInnerHTML: {
10957
- __html: setFontForText((_h = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _h !== void 0 ? _h : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
11286
+ __html: setFontForText((_j = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _j !== void 0 ? _j : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
10958
11287
  } }),
10959
- (customTitle === null || customTitle === void 0 ? void 0 : customTitle.display) && (React.createElement("div", { style: Object.assign(Object.assign({}, customTitle === null || customTitle === void 0 ? void 0 : customTitle.style), { lineHeight: ((_j = customTitle === null || customTitle === void 0 ? void 0 : customTitle.style) === null || _j === void 0 ? void 0 : _j.height) + 'px' }), className: styles$7['one-line-ellipsis'], dangerouslySetInnerHTML: {
11288
+ (customTitle === null || customTitle === void 0 ? void 0 : customTitle.display) && (React.createElement("div", { style: Object.assign(Object.assign({}, customTitle === null || customTitle === void 0 ? void 0 : customTitle.style), { lineHeight: ((_k = customTitle === null || customTitle === void 0 ? void 0 : customTitle.style) === null || _k === void 0 ? void 0 : _k.height) + 'px' }), className: styles$7['one-line-ellipsis'], dangerouslySetInnerHTML: {
10960
11289
  __html: setFontForText(customTitle === null || customTitle === void 0 ? void 0 : customTitle.text, customTitle === null || customTitle === void 0 ? void 0 : customTitle.style)
10961
11290
  } }))))));
10962
11291
  };
10963
11292
  var LinkComponent = React.memo(Link$1);
10964
11293
 
11294
+ /*
11295
+ * @Author: binruan@chatlabs.com
11296
+ * @Date: 2024-08-09 16:59:38
11297
+ * @LastEditors: binruan@chatlabs.com
11298
+ * @LastEditTime: 2024-08-09 16:59:44
11299
+ * @FilePath: \pb-sxp-ui\src\materials\sxp\template\Link\interactionRender.tsx
11300
+ *
11301
+ */
11302
+ var interactionRender$7 = [
11303
+ {
11304
+ title: '点击事件',
11305
+ child: [
11306
+ {
11307
+ type: 'link',
11308
+ name: 'onClick'
11309
+ }
11310
+ ]
11311
+ }
11312
+ ];
11313
+
10965
11314
  var _a;
10966
11315
  const Link = createMaterial(LinkComponent, {
10967
11316
  displayName: '跳转指引',
@@ -10970,7 +11319,8 @@ const Link = createMaterial(LinkComponent, {
10970
11319
  type: 'Link',
10971
11320
  related: {
10972
11321
  settingRender: (_a = settingRender$4 === null || settingRender$4 === void 0 ? void 0 : settingRender$4.filter((i) => i.type !== 'commodityTitle')) === null || _a === void 0 ? void 0 : _a.concat(linkSettingRender),
10973
- bindableProps: []
11322
+ bindableProps: [],
11323
+ interactionRender: interactionRender$7
10974
11324
  },
10975
11325
  defaulSetting: {
10976
11326
  props: {
@@ -13305,16 +13655,10 @@ function WaterfallList$1(_a) {
13305
13655
  }, [unitWidth, rowsNum, list]); /* 增加getStyleList依赖项会导致在admin预览编辑时无限刷新 */
13306
13656
  /** 初始化请求数据 */
13307
13657
  React.useEffect(() => {
13308
- var _a, _b;
13658
+ var _a, _b, _c, _d, _e, _f;
13309
13659
  setIsLoadingData(true);
13310
13660
  waterFallData &&
13311
- (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
13312
- hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
13313
- 'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
13314
- 'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
13315
- defaultSize: hashTagSize,
13316
- maxSize: hashTagSize
13317
- }).then((res) => {
13661
+ (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag, defaultSize: hashTagSize, maxSize: hashTagSize }, (((_b = (_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.itemId) && { productFilter: (_d = (_c = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.itemId })), ((waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId) && { contentFilter: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId }))).then((res) => {
13318
13662
  var _a, _b;
13319
13663
  setData(res);
13320
13664
  setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
@@ -13323,7 +13667,7 @@ function WaterfallList$1(_a) {
13323
13667
  if (isOpenHashTag) {
13324
13668
  const res = previewData;
13325
13669
  setData(res);
13326
- setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
13670
+ setList((_f = (_e = res === null || res === void 0 ? void 0 : res.recList) === null || _e === void 0 ? void 0 : _e.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _f !== void 0 ? _f : []);
13327
13671
  setIsLoadingData(false);
13328
13672
  }
13329
13673
  }, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
@@ -13349,13 +13693,10 @@ function WaterfallList$1(_a) {
13349
13693
  };
13350
13694
  }, [onResize]);
13351
13695
  React.useCallback(() => {
13696
+ var _a, _b, _c, _d;
13352
13697
  setIsLoadingData(true);
13353
13698
  waterFallData &&
13354
- (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
13355
- hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
13356
- 'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
13357
- 'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
13358
- }).then((res) => {
13699
+ (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_b = (_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.itemId) && { productFilter: (_d = (_c = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.itemId })), ((waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId) && { contentFilter: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId }))).then((res) => {
13359
13700
  var _a, _b;
13360
13701
  setList(list === null || list === void 0 ? void 0 : list.concat((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => !(item === null || item === void 0 ? void 0 : item.video))) !== null && _b !== void 0 ? _b : []));
13361
13702
  setIsLoadingData(false);
@@ -13563,31 +13904,22 @@ function WaterfallList(_a) {
13563
13904
  const containerRef = React.useRef(null);
13564
13905
  const [isLoadMore, setIsLoadMore] = React.useState(false);
13565
13906
  React.useCallback(() => {
13907
+ var _a, _b, _c, _d;
13566
13908
  if (isLoadMore)
13567
13909
  return;
13568
13910
  setIsLoadMore(true);
13569
13911
  waterFallData &&
13570
- (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
13571
- hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
13572
- 'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
13573
- 'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
13574
- }).then((res) => {
13912
+ (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_b = (_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.itemId) && { productFilter: (_d = (_c = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.itemId })), ((waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId) && { contentFilter: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId }))).then((res) => {
13575
13913
  var _a;
13576
13914
  setList(list === null || list === void 0 ? void 0 : list.concat((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []));
13577
13915
  setIsLoadMore(false);
13578
13916
  }));
13579
13917
  }, [waterFallData, getRecommendVideos, list, isLoadMore]);
13580
13918
  React.useEffect(() => {
13581
- var _a, _b;
13919
+ var _a, _b, _c, _d, _e, _f;
13582
13920
  setIsLoadingData(true);
13583
13921
  waterFallData &&
13584
- (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
13585
- hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
13586
- 'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
13587
- 'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
13588
- defaultSize: hashTagSize,
13589
- maxSize: hashTagSize
13590
- }).then((res) => {
13922
+ (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_b = (_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.itemId) && { productFilter: (_d = (_c = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.itemId })), ((waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId) && { contentFilter: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId })), { defaultSize: hashTagSize, maxSize: hashTagSize })).then((res) => {
13591
13923
  var _a, _b;
13592
13924
  setData(res);
13593
13925
  setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
@@ -13596,7 +13928,7 @@ function WaterfallList(_a) {
13596
13928
  if (isOpenHashTag) {
13597
13929
  const res = previewData;
13598
13930
  setData(res);
13599
- setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
13931
+ setList((_f = (_e = res === null || res === void 0 ? void 0 : res.recList) === null || _e === void 0 ? void 0 : _e.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _f !== void 0 ? _f : []);
13600
13932
  setIsLoadingData(false);
13601
13933
  }
13602
13934
  }, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
@@ -14683,6 +15015,7 @@ var _materials_ = /*#__PURE__*/Object.freeze({
14683
15015
  CommodityList: CommodityList,
14684
15016
  Consent: Consent,
14685
15017
  HashTag: HashTag,
15018
+ Iframe: Iframe,
14686
15019
  Link: Link,
14687
15020
  MultiCommodity: MultiCommodity,
14688
15021
  MultiCommodityDiro: MultiCommodityDiro,
@@ -15141,14 +15474,6 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15141
15474
  };
15142
15475
  var VideoWidget$3 = React.memo(VideoWidget$2);
15143
15476
 
15144
- /*
15145
- * @Author: binruan@chatlabs.com
15146
- * @Date: 2023-12-27 19:02:59
15147
- * @LastEditors: binruan@chatlabs.com
15148
- * @LastEditTime: 2024-01-24 10:30:13
15149
- * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ToggleButton\index.tsx
15150
- *
15151
- */
15152
15477
  const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style }) => {
15153
15478
  const [isTrue, setIsTure] = React.useState(defaultValue);
15154
15479
  const handleClick = (e) => {
@@ -15157,6 +15482,9 @@ const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style
15157
15482
  setIsTure(result);
15158
15483
  onChange === null || onChange === void 0 ? void 0 : onChange(result);
15159
15484
  };
15485
+ React.useEffect(() => {
15486
+ setIsTure(defaultValue);
15487
+ }, [defaultValue]);
15160
15488
  return (React.createElement("button", { style: style, "aria-label": 'toggle button', className: 'pb-toggle-button', onClick: handleClick },
15161
15489
  React.createElement("img", { className: 'pb-toggle-button-icon', alt: 'toggle image', src: isTrue ? activeIcon : unactiveIcon })));
15162
15490
  };
@@ -15535,12 +15863,14 @@ var Tagbar$1 = React.memo(Tagbar);
15535
15863
  * @Author: binruan@chatlabs.com
15536
15864
  * @Date: 2024-01-15 19:03:09
15537
15865
  * @LastEditors: binruan@chatlabs.com
15538
- * @LastEditTime: 2024-08-02 18:34:27
15866
+ * @LastEditTime: 2024-08-14 19:09:32
15539
15867
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
15540
15868
  *
15541
15869
  */
15542
15870
  const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
15543
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
15871
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
15872
+ const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
15873
+ const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
15544
15874
  const { schema } = useEditor();
15545
15875
  const [activeIndex, setActiveIndex] = React.useState(0);
15546
15876
  const viewImageStartTime = React.useRef(0);
@@ -15554,8 +15884,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
15554
15884
  const { backMainFeed } = useEventReport();
15555
15885
  const { productView } = useEventReport();
15556
15886
  const isShowFingerTip = React.useMemo(() => {
15557
- return data.length > 0 && !loading && getFeUserId();
15558
- }, [data, loading]);
15887
+ return data.length > 0 && !loading && (getFeUserId() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
15888
+ }, [data, loading, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip]);
15559
15889
  React.useEffect(() => {
15560
15890
  refreshFeSessionId();
15561
15891
  }, []);
@@ -15583,14 +15913,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
15583
15913
  var _a;
15584
15914
  const index = (data === null || data === void 0 ? void 0 : data.findIndex((item) => {
15585
15915
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
15586
- if (ctaType === '多商品CTA') {
15916
+ const ctaType0 = ctaType === null || ctaType === void 0 ? void 0 : ctaType[0];
15917
+ if (ctaType0 === '多商品CTA') {
15587
15918
  return ((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) && ((_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c.length) > 0;
15588
15919
  }
15589
- else if (ctaType === '商品CTA') {
15920
+ else if (ctaType0 === '商品CTA') {
15590
15921
  return (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.bindProduct;
15591
15922
  }
15592
15923
  else {
15593
- return ((_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.bindCta) === null || _f === void 0 ? void 0 : _f.itemId) === ctaType && (((_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.url) || ((_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.imgUrls) === null || _j === void 0 ? void 0 : _j.length));
15924
+ return ((_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.bindCta) === null || _f === void 0 ? void 0 : _f.itemId) === ctaType0 && (((_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.url) || ((_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.imgUrls) === null || _j === void 0 ? void 0 : _j.length));
15594
15925
  }
15595
15926
  })) || 0;
15596
15927
  (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
@@ -15695,8 +16026,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
15695
16026
  return containerHeight - minusHeight - tagHeight;
15696
16027
  }, [globalConfig, containerHeight, tagHeight]);
15697
16028
  const renderLogo = React.useMemo(() => {
16029
+ var _a, _b;
15698
16030
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
15699
- return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
16031
+ const link = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoBar) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.value;
16032
+ return (React.createElement("div", Object.assign({ className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } }, (link && { onClick: () => new Function(link)() })),
15700
16033
  React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
15701
16034
  }
15702
16035
  return null;
@@ -15776,9 +16109,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
15776
16109
  isShowMore,
15777
16110
  lineGradStyle
15778
16111
  ]);
15779
- const renderLikeButton = React.useCallback((rec, index) => {
16112
+ const renderLikeButton = React.useCallback((rec, index, visible) => {
15780
16113
  var _a, _b, _c, _d;
15781
- if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
16114
+ if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike) || !visible)
15782
16115
  return;
15783
16116
  let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
15784
16117
  if (waterFallData && top < 40) {
@@ -15786,6 +16119,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
15786
16119
  }
15787
16120
  if (rec === null || rec === void 0 ? void 0 : rec.video) {
15788
16121
  return (React.createElement(LikeButton$1, { key: rec.position, activeIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIcon, unActicveIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unlikeIcon, active: rec.isCollected, recData: rec, className: 'clc-sxp-like-button', style: {
16122
+ position: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed) ? 'fixed' : 'absolute',
15789
16123
  [(_b = globalConfig.likeIconXPosit) !== null && _b !== void 0 ? _b : 'right']: (_c = globalConfig.likeIconX) !== null && _c !== void 0 ? _c : 0,
15790
16124
  [(_d = globalConfig.likeIconYPosit) !== null && _d !== void 0 ? _d : 'bottom']: top
15791
16125
  }, position: index }));
@@ -15936,6 +16270,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
15936
16270
  });
15937
16271
  return !waterFallData ? list.concat([{ loading: true }]) : list;
15938
16272
  }, [data, activeIndex, waterFallData]);
16273
+ const renderToggleButton = React.useCallback((visible) => {
16274
+ var _a, _b, _c, _d, _e, _f;
16275
+ if (!visible)
16276
+ return;
16277
+ 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: {
16278
+ position: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed) ? 'fixed' : 'absolute',
16279
+ visibility: ((_b = (_a = visList === null || visList === void 0 ? void 0 : visList[activeIndex]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.url) ? 'visible' : 'hidden',
16280
+ zIndex: 999,
16281
+ [(_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _c !== void 0 ? _c : 'right']: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _d !== void 0 ? _d : 0,
16282
+ [(_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _e !== void 0 ? _e : 'bottom']: (_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _f !== void 0 ? _f : 23
16283
+ }, defaultValue: isMuted, 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, onChange: setIsMuted })));
16284
+ }, [globalConfig, visList, activeIndex, isMuted]);
15939
16285
  const renderView = React.useMemo(() => {
15940
16286
  if (loading) {
15941
16287
  return (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
@@ -15952,20 +16298,30 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
15952
16298
  React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement(React.Fragment, null,
15953
16299
  renderContent(rec, index),
15954
16300
  renderBottom(rec, index),
15955
- renderLikeButton(rec, index)))))));
16301
+ renderLikeButton(rec, index, !(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
16302
+ renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))))))));
15956
16303
  });
15957
- }, [containerWidth, data, height, loading, renderBottom, renderContent, visList, loadingImage, isReload]);
15958
- const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
15959
- const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
16304
+ }, [
16305
+ containerWidth,
16306
+ data,
16307
+ height,
16308
+ loading,
16309
+ renderBottom,
16310
+ renderContent,
16311
+ visList,
16312
+ loadingImage,
16313
+ isReload,
16314
+ renderToggleButton
16315
+ ]);
15960
16316
  return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' },
15961
- waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, onClose: () => {
16317
+ waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
15962
16318
  setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
15963
16319
  } })),
15964
16320
  renderLogo,
15965
16321
  React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
15966
16322
  top: minusHeight
15967
16323
  } }),
15968
- isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _a !== void 0 ? _a : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
16324
+ isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _f !== void 0 ? _f : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
15969
16325
  React.createElement(Swiper, { style: {
15970
16326
  marginTop: tagHeight
15971
16327
  }, ref: swiperRef, onSlideChange: () => {
@@ -15990,15 +16346,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
15990
16346
  }
15991
16347
  }
15992
16348
  }, direction: 'vertical', height: height },
15993
- ((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: {
15994
- position: 'fixed',
15995
- visibility: ((_c = (_b = data === null || data === void 0 ? void 0 : data[activeIndex]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.url) ? 'visible' : 'hidden',
15996
- zIndex: 999,
15997
- [(_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _d !== void 0 ? _d : 'right']: (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _e !== void 0 ? _e : 0,
15998
- [(_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _f !== void 0 ? _f : 'bottom']: (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _g !== void 0 ? _g : 23
15999
- }, defaultValue: isMuted, 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, onChange: setIsMuted })),
16349
+ renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
16350
+ renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
16000
16351
  renderView),
16001
- React.createElement(WaterFall$1, Object.assign({}, (_k = (_j = (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.item) === null || _k === void 0 ? void 0 : _k.props))));
16352
+ React.createElement(WaterFall$1, Object.assign({}, (_j = (_h = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.item) === null || _j === void 0 ? void 0 : _j.props))));
16002
16353
  };
16003
16354
 
16004
16355
  const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
@@ -16365,7 +16716,7 @@ var index$1 = React.memo(DiyPortalPreview);
16365
16716
  * @Author: binruan@chatlabs.com
16366
16717
  * @Date: 2023-10-31 10:56:01
16367
16718
  * @LastEditors: binruan@chatlabs.com
16368
- * @LastEditTime: 2024-08-01 15:23:51
16719
+ * @LastEditTime: 2024-08-06 17:15:56
16369
16720
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
16370
16721
  *
16371
16722
  */
@@ -16424,14 +16775,14 @@ const Popup = () => {
16424
16775
  const renderPopupDetail = React.useMemo(() => {
16425
16776
  var _a, _b, _c;
16426
16777
  return (_c = (_b = (_a = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _a === void 0 ? void 0 : _a.globalConfig) === null || _b === void 0 ? void 0 : _b.popupList) === null || _c === void 0 ? void 0 : _c.map((value, index) => {
16427
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
16778
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
16428
16779
  if ((value === null || value === void 0 ? void 0 : value.id) === (popup === null || popup === void 0 ? void 0 : popup.id)) {
16429
16780
  const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
16430
16781
  const Component = withBindDataSource(t);
16431
16782
  const isExternalLink = ((_d = (_c = (_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.event) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.linkType) === 'externalLink';
16432
16783
  const isPopup = ((_g = (_f = (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.event) === null || _f === void 0 ? void 0 : _f.onClick) === null || _g === void 0 ? void 0 : _g.linkType) === 'popup';
16433
16784
  const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
16434
- return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: (_k = window.innerWidth) !== null && _k !== void 0 ? _k : '100vw', height: '100%' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.textStyle), bindDatas: (_o = (_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.bindDatas) !== null && _o !== void 0 ? _o : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.props, { event: ((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose })));
16785
+ return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { height: '100%' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_k = value === null || value === void 0 ? void 0 : value.item) === null || _k === void 0 ? void 0 : _k.textStyle), bindDatas: (_m = (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.bindDatas) !== null && _m !== void 0 ? _m : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_o = value === null || value === void 0 ? void 0 : value.item) === null || _o === void 0 ? void 0 : _o.props, { event: ((_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose })));
16435
16786
  }
16436
16787
  else {
16437
16788
  return React.createElement(React.Fragment, null);