pb-sxp-ui 1.0.53 → 1.0.55
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 +112 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +112 -62
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +112 -62
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageCore/index.d.ts +1 -0
- package/es/core/components/SxpPageCore/index.js +2 -2
- package/es/core/components/SxpPageRender/Popup/index.js +1 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.js +10 -2
- package/es/core/components/SxpPageRender/index.js +16 -2
- package/es/core/context/SxpDataSourceProvider.d.ts +7 -0
- package/es/core/context/SxpDataSourceProvider.js +15 -2
- package/es/materials/sxp/popup/AppointForm/index.d.ts +1 -0
- package/es/materials/sxp/popup/AppointForm/index.js +14 -9
- package/es/materials/sxp/popup/CommodityDetail/index.js +8 -1
- package/es/materials/sxp/popup/CommodityDetailDiro/index.js +8 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +8 -1
- package/lib/core/components/SxpPageCore/index.d.ts +1 -0
- package/lib/core/components/SxpPageCore/index.js +2 -2
- package/lib/core/components/SxpPageRender/Popup/index.js +1 -1
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +10 -2
- package/lib/core/components/SxpPageRender/index.js +16 -2
- package/lib/core/context/SxpDataSourceProvider.d.ts +7 -0
- package/lib/core/context/SxpDataSourceProvider.js +15 -2
- package/lib/materials/sxp/popup/AppointForm/index.d.ts +1 -0
- package/lib/materials/sxp/popup/AppointForm/index.js +14 -9
- package/lib/materials/sxp/popup/CommodityDetail/index.js +8 -1
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +8 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +8 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -439,7 +439,7 @@ var DataSourceType;
|
|
439
439
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
440
440
|
})(DataSourceType || (DataSourceType = {}));
|
441
441
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
442
|
-
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false }) => {
|
442
|
+
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false }) => {
|
443
443
|
const [rtcList, setRtcList] = React.useState([]);
|
444
444
|
const [tagList, setTagList] = React.useState([]);
|
445
445
|
const [loading, setLoading] = React.useState(false);
|
@@ -554,6 +554,18 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
554
554
|
type: 'beacon'
|
555
555
|
});
|
556
556
|
}, [bffFetch, curReqInfo, enableReportEvent]);
|
557
|
+
const bffFbReport = React.useCallback((_a) => {
|
558
|
+
var _b;
|
559
|
+
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;
|
560
|
+
if (!enableReportEvent || !enabledMetaConversionApi) {
|
561
|
+
return;
|
562
|
+
}
|
563
|
+
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/fb/events', {
|
564
|
+
method: 'POST',
|
565
|
+
body: { eventName, actionSource, eventSourceUrl, 'userData.externalId': externalId },
|
566
|
+
type: 'beacon'
|
567
|
+
});
|
568
|
+
}, [bffFetch, enableReportEvent, enabledMetaConversionApi]);
|
557
569
|
const bffMutateLike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
558
570
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/like', { method: 'POST', body }));
|
559
571
|
return res === null || res === void 0 ? void 0 : res.success;
|
@@ -661,7 +673,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
661
673
|
tagList,
|
662
674
|
setLoading,
|
663
675
|
videoRef,
|
664
|
-
setVideoRef
|
676
|
+
setVideoRef,
|
677
|
+
bffFbReport
|
665
678
|
} }, render({
|
666
679
|
rtcList,
|
667
680
|
mutateLike: bffMutateLike,
|
@@ -1036,7 +1049,7 @@ var settingRender$5 = [
|
|
1036
1049
|
];
|
1037
1050
|
|
1038
1051
|
const AppointForm$1 = (_a) => {
|
1039
|
-
var { columns, style, title, textStyle, submitBgColor, submitColor, submitText, layoutType, onClick } = _a, props = __rest(_a, ["columns", "style", "title", "textStyle", "submitBgColor", "submitColor", "submitText", "layoutType", "onClick"]);
|
1052
|
+
var { columns, style, title, textStyle, submitBgColor, submitColor, submitText, layoutType, onClick, onClose } = _a, props = __rest(_a, ["columns", "style", "title", "textStyle", "submitBgColor", "submitColor", "submitText", "layoutType", "onClick", "onClose"]);
|
1040
1053
|
const { submitForm } = useSxpDataSource();
|
1041
1054
|
const formRef = React.useRef();
|
1042
1055
|
const [loading, setLoading] = React.useState(false);
|
@@ -1077,19 +1090,24 @@ const AppointForm$1 = (_a) => {
|
|
1077
1090
|
}, [layoutType, columns, defaultColumns]);
|
1078
1091
|
const handleSubmit = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
1079
1092
|
var _b, _c, _d;
|
1080
|
-
setLoading(true);
|
1081
1093
|
const vals = yield ((_b = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _b === void 0 ? void 0 : _b.getFieldsValue());
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1094
|
+
if (!vals)
|
1095
|
+
return;
|
1096
|
+
const arr = (_d = (_c = Object.keys(vals)) === null || _c === void 0 ? void 0 : _c.map((key) => {
|
1097
|
+
var _a;
|
1098
|
+
return ({
|
1099
|
+
name: key,
|
1100
|
+
value: (_a = vals[key]) !== null && _a !== void 0 ? _a : ''
|
1101
|
+
});
|
1102
|
+
})) === null || _d === void 0 ? void 0 : _d.filter((item) => item === null || item === void 0 ? void 0 : item.value);
|
1086
1103
|
if (!arr || !(arr === null || arr === void 0 ? void 0 : arr.length))
|
1087
1104
|
return;
|
1088
|
-
|
1105
|
+
setLoading(true);
|
1106
|
+
const res = (yield (submitForm === null || submitForm === void 0 ? void 0 : submitForm({ attributes: arr })));
|
1089
1107
|
setLoading(false);
|
1090
1108
|
if (res) {
|
1091
|
-
|
1092
|
-
|
1109
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
1110
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
1093
1111
|
}
|
1094
1112
|
}), 1000);
|
1095
1113
|
return (React.createElement("div", { className: 'pb-appoint-form' },
|
@@ -8371,7 +8389,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8371
8389
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
8372
8390
|
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index"]);
|
8373
8391
|
const { sxpParameter } = useSxpDataSource();
|
8374
|
-
const { popupDetailData, bffEventReport, isPreview,
|
8392
|
+
const { popupDetailData, bffEventReport, isPreview, bffFbReport } = useSxpDataSource();
|
8375
8393
|
const { jumpToWeb, productView } = useEventReport();
|
8376
8394
|
const curTimeRef = React.useRef(null);
|
8377
8395
|
const [showModal, setShowModal] = React.useState(false);
|
@@ -8388,6 +8406,13 @@ const CommodityDetail$1 = (_a) => {
|
|
8388
8406
|
window.location.href = window.getJointUtmLink(product.link);
|
8389
8407
|
}
|
8390
8408
|
};
|
8409
|
+
React.useEffect(() => {
|
8410
|
+
if (!isPost) {
|
8411
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
8412
|
+
eventName: 'ProductView'
|
8413
|
+
});
|
8414
|
+
}
|
8415
|
+
}, [isPost, bffFbReport]);
|
8391
8416
|
React.useEffect(() => {
|
8392
8417
|
const initTime = () => {
|
8393
8418
|
curTimeRef.current = new Date();
|
@@ -8823,7 +8848,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
8823
8848
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index"]);
|
8824
8849
|
React.useState(true);
|
8825
8850
|
const { sxpParameter } = useSxpDataSource();
|
8826
|
-
const { popupDetailData, bffEventReport, isPreview, swiperRef,
|
8851
|
+
const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
|
8827
8852
|
const { jumpToWeb, productView } = useEventReport();
|
8828
8853
|
const scrollRef = React.useRef(null);
|
8829
8854
|
React.useRef(null);
|
@@ -8846,6 +8871,13 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
8846
8871
|
window.location.href = window.getJointUtmLink(product.link);
|
8847
8872
|
}
|
8848
8873
|
};
|
8874
|
+
React.useEffect(() => {
|
8875
|
+
if (!isPost) {
|
8876
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
8877
|
+
eventName: 'ProductView'
|
8878
|
+
});
|
8879
|
+
}
|
8880
|
+
}, [isPost, bffFbReport]);
|
8849
8881
|
React.useEffect(() => {
|
8850
8882
|
const initTime = () => {
|
8851
8883
|
curTimeRef.current = new Date();
|
@@ -12064,7 +12096,7 @@ var SXP_EVENT_TYPE;
|
|
12064
12096
|
|
12065
12097
|
const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef }) => {
|
12066
12098
|
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
12067
|
-
const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
|
12099
|
+
const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport } = useSxpDataSource();
|
12068
12100
|
const videoStartTime = React.useRef(0);
|
12069
12101
|
const [isLoadFinish, setIsLoadFinish] = React.useState(false);
|
12070
12102
|
const [isFirstPlay, setIsFirstPlay] = React.useState(true);
|
@@ -12272,6 +12304,9 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12272
12304
|
if (!videoRef || !isLoadFinish)
|
12273
12305
|
return;
|
12274
12306
|
if (isActive) {
|
12307
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
12308
|
+
eventName: 'ViewContent'
|
12309
|
+
});
|
12275
12310
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
|
12276
12311
|
}
|
12277
12312
|
else {
|
@@ -12295,7 +12330,12 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12295
12330
|
React.useEffect(() => {
|
12296
12331
|
if (!isActive)
|
12297
12332
|
return;
|
12298
|
-
const onShow =
|
12333
|
+
const onShow = () => {
|
12334
|
+
handleClickVideo('start')();
|
12335
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
12336
|
+
eventName: 'ViewContent'
|
12337
|
+
});
|
12338
|
+
};
|
12299
12339
|
const onHide = handleClickVideo('pause');
|
12300
12340
|
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
12301
12341
|
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
|
@@ -12658,11 +12698,47 @@ const Nudge = ({ nudge }) => {
|
|
12658
12698
|
React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, (_g = nudge === null || nudge === void 0 ? void 0 : nudge.content) !== null && _g !== void 0 ? _g : '')))));
|
12659
12699
|
};
|
12660
12700
|
|
12701
|
+
const DEFAULT_TAG = 'FOR U';
|
12702
|
+
const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
12703
|
+
const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
|
12704
|
+
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = useSxpDataSource();
|
12705
|
+
const realTagList = React.useMemo(() => {
|
12706
|
+
return [DEFAULT_TAG, ...tagList];
|
12707
|
+
}, [tagList]);
|
12708
|
+
const handleSelectTag = (tag) => () => {
|
12709
|
+
if (tag === selectTag)
|
12710
|
+
return;
|
12711
|
+
let hashTag;
|
12712
|
+
if (tag !== DEFAULT_TAG) {
|
12713
|
+
hashTag = tag;
|
12714
|
+
}
|
12715
|
+
setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
|
12716
|
+
getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ hashTag }).then((res) => {
|
12717
|
+
var _a, _b, _c, _d;
|
12718
|
+
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
|
12719
|
+
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
|
12720
|
+
setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
|
12721
|
+
setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(0);
|
12722
|
+
(_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slideTo(0);
|
12723
|
+
}).finally(() => {
|
12724
|
+
setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
|
12725
|
+
});
|
12726
|
+
setSelectTag(tag);
|
12727
|
+
};
|
12728
|
+
if (tagList.length <= 0)
|
12729
|
+
return null;
|
12730
|
+
return (React.createElement("div", { className: 'clc-sxp-tagbar' },
|
12731
|
+
React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
|
12732
|
+
return (React.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
|
12733
|
+
}))));
|
12734
|
+
};
|
12735
|
+
var Tagbar$1 = React.memo(Tagbar);
|
12736
|
+
|
12661
12737
|
/*
|
12662
12738
|
* @Author: binruan@chatlabs.com
|
12663
12739
|
* @Date: 2024-01-15 19:03:09
|
12664
12740
|
* @LastEditors: binruan@chatlabs.com
|
12665
|
-
* @LastEditTime: 2024-
|
12741
|
+
* @LastEditTime: 2024-05-09 16:23:59
|
12666
12742
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
12667
12743
|
*
|
12668
12744
|
*/
|
@@ -12677,7 +12753,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12677
12753
|
const viewTime = React.useRef();
|
12678
12754
|
const [isLoadMore, setIsLoadMore] = React.useState(false);
|
12679
12755
|
const [isShowMore, setIsShowMore] = React.useState(false);
|
12680
|
-
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData } = useSxpDataSource();
|
12756
|
+
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport } = useSxpDataSource();
|
12681
12757
|
const [videoRef, setVideoRef] = React.useState(null);
|
12682
12758
|
const playerRef = React.useRef();
|
12683
12759
|
const { productView } = useEventReport();
|
@@ -12710,8 +12786,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12710
12786
|
requestId: null
|
12711
12787
|
}
|
12712
12788
|
});
|
12789
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
12790
|
+
eventName: 'PageView'
|
12791
|
+
});
|
12713
12792
|
setIsInit(true);
|
12714
|
-
}, [bffEventReport, data.length]);
|
12793
|
+
}, [bffEventReport, data.length, bffFbReport]);
|
12715
12794
|
const initTime = () => {
|
12716
12795
|
curTime.current = new Date();
|
12717
12796
|
viewTime.current = new Date();
|
@@ -12836,9 +12915,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12836
12915
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
12837
12916
|
minusHeight += 45;
|
12838
12917
|
}
|
12839
|
-
|
12840
|
-
|
12841
|
-
|
12918
|
+
if (tagList.length > 0) {
|
12919
|
+
minusHeight += 45;
|
12920
|
+
}
|
12842
12921
|
return containerHeight - minusHeight;
|
12843
12922
|
}, [globalConfig, containerHeight, tagList]);
|
12844
12923
|
const renderLogo = React.useMemo(() => {
|
@@ -12996,6 +13075,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12996
13075
|
var _a, _b, _c;
|
12997
13076
|
if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && !((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls) && (item === null || item === void 0 ? void 0 : item.product)) {
|
12998
13077
|
productView(item, item.product, (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.bindCta, viewTime.current, activeIndex);
|
13078
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
13079
|
+
eventName: 'ProductView'
|
13080
|
+
});
|
12999
13081
|
}
|
13000
13082
|
};
|
13001
13083
|
React.useEffect(() => {
|
@@ -13023,6 +13105,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13023
13105
|
traceInfo: item.video.traceInfo
|
13024
13106
|
}
|
13025
13107
|
});
|
13108
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
13109
|
+
eventName: 'ViewContent'
|
13110
|
+
});
|
13026
13111
|
}
|
13027
13112
|
};
|
13028
13113
|
const visList = React.useMemo(() => {
|
@@ -13062,6 +13147,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13062
13147
|
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
13063
13148
|
} })),
|
13064
13149
|
renderLogo,
|
13150
|
+
React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex }),
|
13065
13151
|
isShowFingerTip ? React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
|
13066
13152
|
React.createElement(Swiper, { ref: swiperRef, onSlideChange: () => {
|
13067
13153
|
swiperRef.current.swiper.allowTouchMove = false;
|
@@ -13122,42 +13208,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13122
13208
|
React.createElement("div", { id: 'player-container-id-copy' }))));
|
13123
13209
|
};
|
13124
13210
|
|
13125
|
-
const DEFAULT_TAG = 'FOR U';
|
13126
|
-
const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
13127
|
-
const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
|
13128
|
-
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = useSxpDataSource();
|
13129
|
-
const realTagList = React.useMemo(() => {
|
13130
|
-
return [DEFAULT_TAG, ...tagList];
|
13131
|
-
}, [tagList]);
|
13132
|
-
const handleSelectTag = (tag) => () => {
|
13133
|
-
if (tag === selectTag)
|
13134
|
-
return;
|
13135
|
-
let hashTag;
|
13136
|
-
if (tag !== DEFAULT_TAG) {
|
13137
|
-
hashTag = tag;
|
13138
|
-
}
|
13139
|
-
setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
|
13140
|
-
getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ hashTag }).then((res) => {
|
13141
|
-
var _a, _b, _c, _d;
|
13142
|
-
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
|
13143
|
-
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
|
13144
|
-
setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
|
13145
|
-
setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(0);
|
13146
|
-
(_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slideTo(0);
|
13147
|
-
}).finally(() => {
|
13148
|
-
setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
|
13149
|
-
});
|
13150
|
-
setSelectTag(tag);
|
13151
|
-
};
|
13152
|
-
if (tagList.length <= 0)
|
13153
|
-
return null;
|
13154
|
-
return (React.createElement("div", { className: 'clc-sxp-tagbar' },
|
13155
|
-
React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
|
13156
|
-
return (React.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
|
13157
|
-
}))));
|
13158
|
-
};
|
13159
|
-
var Tagbar$1 = React.memo(Tagbar);
|
13160
|
-
|
13161
13211
|
const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
|
13162
13212
|
return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, height: height, style: { width }, loop: true, autoplay: false }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url) => {
|
13163
13213
|
return (React.createElement(SwiperSlide, { key: url },
|
@@ -13522,7 +13572,7 @@ var index$1 = React.memo(DiyPortalPreview);
|
|
13522
13572
|
* @Author: binruan@chatlabs.com
|
13523
13573
|
* @Date: 2023-10-31 10:56:01
|
13524
13574
|
* @LastEditors: binruan@chatlabs.com
|
13525
|
-
* @LastEditTime: 2024-
|
13575
|
+
* @LastEditTime: 2024-05-08 17:41:44
|
13526
13576
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
13527
13577
|
*
|
13528
13578
|
*/
|
@@ -13573,7 +13623,7 @@ const Popup = () => {
|
|
13573
13623
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
13574
13624
|
const Component = withBindDataSource(t);
|
13575
13625
|
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
13576
|
-
return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.style), { width: '100%', height: '80vh', overflow: 'auto' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.textStyle), bindDatas: (_f = (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.bindDatas) !== null && _f !== void 0 ? _f : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.props, { event: ((_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id })));
|
13626
|
+
return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.style), { width: '100%', height: '80vh', overflow: 'auto' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.textStyle), bindDatas: (_f = (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.bindDatas) !== null && _f !== void 0 ? _f : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.props, { event: ((_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, onClose: handleClose })));
|
13577
13627
|
}
|
13578
13628
|
else {
|
13579
13629
|
return React.createElement(React.Fragment, null);
|
@@ -13587,7 +13637,7 @@ const Popup = () => {
|
|
13587
13637
|
* @Author: binruan@chatlabs.com
|
13588
13638
|
* @Date: 2024-01-15 19:03:09
|
13589
13639
|
* @LastEditors: binruan@chatlabs.com
|
13590
|
-
* @LastEditTime: 2024-
|
13640
|
+
* @LastEditTime: 2024-05-06 17:26:37
|
13591
13641
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
|
13592
13642
|
*
|
13593
13643
|
*/
|
@@ -13603,7 +13653,7 @@ const RESOLVER = {};
|
|
13603
13653
|
Object.values(_materials_).forEach((v) => {
|
13604
13654
|
RESOLVER[v.extend.type] = v;
|
13605
13655
|
});
|
13606
|
-
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl }) => {
|
13656
|
+
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl, enabledMetaConversionApi }) => {
|
13607
13657
|
var _a, _b, _c, _d, _e, _f;
|
13608
13658
|
const utmVal = React.useMemo(() => {
|
13609
13659
|
var _a;
|
@@ -13611,7 +13661,7 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
|
|
13611
13661
|
return searchParams;
|
13612
13662
|
}, []);
|
13613
13663
|
return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
|
13614
|
-
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, render: ({ rtcList, tagList }) => {
|
13664
|
+
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, render: ({ rtcList, tagList }) => {
|
13615
13665
|
var _a;
|
13616
13666
|
return (React.createElement(React.Fragment, null,
|
13617
13667
|
React.createElement(SxpPageRender, Object.assign({}, (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER, licenseUrl: licenseUrl })),
|