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