pb-sxp-ui 1.10.1 → 1.10.3
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 +78 -51
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +78 -51
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +4 -4
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +78 -51
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +4 -4
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageCore/index.js +3 -2
- package/es/core/components/SxpPageRender/WaterFall/List.js +2 -2
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +2 -2
- package/es/core/components/SxpPageRender/index.js +4 -4
- package/es/core/context/EditorContext.d.ts +0 -2
- package/es/core/context/EditorContext.js +3 -9
- package/es/core/context/SxpDataSourceProvider.d.ts +9 -0
- package/es/core/context/SxpDataSourceProvider.js +26 -4
- package/es/core/hooks/useEventReport.d.ts +1 -1
- package/es/core/hooks/useEventReport.js +10 -3
- package/es/materials/sxp/MultiPosts/index.js +3 -4
- package/es/materials/sxp/cta/AniLink/index.js +2 -2
- package/es/materials/sxp/cta/AniLinkPopup/index.js +2 -2
- package/es/materials/sxp/popup/AppointForm/index.js +2 -2
- package/es/materials/sxp/popup/CommodityDetail/index.js +2 -2
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +2 -2
- package/es/materials/sxp/popup/CommodityList/index.js +3 -3
- package/es/materials/sxp/popup/Prompt/index.js +2 -2
- package/es/materials/sxp/template/Link/index.js +1 -3
- package/es/materials/sxp/template/components/EventProvider.js +3 -3
- package/lib/core/components/SxpPageCore/index.js +3 -2
- package/lib/core/components/SxpPageRender/WaterFall/List.js +2 -2
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +2 -2
- package/lib/core/components/SxpPageRender/index.js +4 -4
- package/lib/core/context/EditorContext.d.ts +0 -2
- package/lib/core/context/EditorContext.js +3 -9
- package/lib/core/context/SxpDataSourceProvider.d.ts +9 -0
- package/lib/core/context/SxpDataSourceProvider.js +26 -4
- package/lib/core/hooks/useEventReport.d.ts +1 -1
- package/lib/core/hooks/useEventReport.js +10 -3
- package/lib/materials/sxp/MultiPosts/index.js +2 -3
- package/lib/materials/sxp/cta/AniLink/index.js +2 -2
- package/lib/materials/sxp/cta/AniLinkPopup/index.js +2 -2
- package/lib/materials/sxp/popup/AppointForm/index.js +2 -2
- package/lib/materials/sxp/popup/CommodityDetail/index.js +2 -2
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +2 -2
- package/lib/materials/sxp/popup/CommodityList/index.js +3 -3
- package/lib/materials/sxp/popup/Prompt/index.js +2 -2
- package/lib/materials/sxp/template/Link/index.js +1 -3
- package/lib/materials/sxp/template/components/EventProvider.js +3 -3
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
@@ -646,9 +646,8 @@
|
|
646
646
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
647
647
|
})(DataSourceType || (DataSourceType = {}));
|
648
648
|
const DEFAULT_TAG = 'FOR U';
|
649
|
-
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isOpenConsent = false, isEditor = false, utmParameter, channelQueryList, data, dataList, onUpdateSchema }) => {
|
649
|
+
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isOpenConsent = false, isEditor = false, utmParameter, channelQueryList, data, dataList, onUpdateSchema, onUpdateChannel }) => {
|
650
650
|
var _a, _b, _c, _d, _e;
|
651
|
-
const { channel } = useEditor();
|
652
651
|
const [rtcList, setRtcList] = React.useState([]);
|
653
652
|
const [tagList, setTagList] = React.useState([]);
|
654
653
|
const [loading, setLoading] = React.useState(false);
|
@@ -674,11 +673,17 @@
|
|
674
673
|
const [pageData, setPageData] = React.useState(data);
|
675
674
|
const [showConsent, setShowConsent] = React.useState(false);
|
676
675
|
const [layoutVariantId, setLayoutVariantId] = React.useState();
|
676
|
+
const [channel, setChannel] = React.useState();
|
677
|
+
const [eventTimeList, setEventTimeList] = React.useState([]);
|
677
678
|
const isShowConsent = React.useMemo(() => {
|
678
679
|
var _a, _b, _c, _d;
|
679
680
|
return (((((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent) &&
|
680
681
|
showConsent);
|
681
682
|
}, [isAgreePolicy, globalConfig, isOpenConsent, isEditor, showConsent]);
|
683
|
+
const updateChannel = React.useCallback((d) => {
|
684
|
+
onUpdateChannel === null || onUpdateChannel === void 0 ? void 0 : onUpdateChannel(d);
|
685
|
+
setChannel(d);
|
686
|
+
}, []);
|
682
687
|
const getFilterRecList = React.useCallback((data) => {
|
683
688
|
var _a;
|
684
689
|
const recList = data === null || data === void 0 ? void 0 : data.recList;
|
@@ -692,6 +697,24 @@
|
|
692
697
|
})) !== null && _a !== void 0 ? _a : [];
|
693
698
|
return nList;
|
694
699
|
}, []);
|
700
|
+
React.useEffect(() => {
|
701
|
+
let intervalId;
|
702
|
+
if (eventTimeList.length > 0) {
|
703
|
+
// 定期检查数组中的时间
|
704
|
+
const checkTimes = () => {
|
705
|
+
const now = new Date(); // 获取当前时间
|
706
|
+
const threshold = 15 * 1000; // 15秒的毫秒数
|
707
|
+
// 过滤掉超过15秒的时间
|
708
|
+
setEventTimeList((prevArray) => prevArray.filter((item) => now - item.time <= threshold));
|
709
|
+
};
|
710
|
+
// 每秒检查一次
|
711
|
+
intervalId = setInterval(checkTimes, 1000);
|
712
|
+
}
|
713
|
+
// 清理函数
|
714
|
+
return () => {
|
715
|
+
clearInterval(intervalId);
|
716
|
+
};
|
717
|
+
}, [eventTimeList]); // 依赖于 timeArray
|
695
718
|
React.useEffect(() => {
|
696
719
|
const handleChangeThemeTag = (tag) => {
|
697
720
|
themeTag.current = tag;
|
@@ -1119,7 +1142,11 @@
|
|
1119
1142
|
popupCurTimeRef,
|
1120
1143
|
checkCommodityIndexRef,
|
1121
1144
|
isEditor,
|
1122
|
-
isNoMoreData
|
1145
|
+
isNoMoreData,
|
1146
|
+
updateChannel,
|
1147
|
+
channel,
|
1148
|
+
eventTimeList,
|
1149
|
+
setEventTimeList
|
1123
1150
|
} }, isShowConsent ? (React.createElement(Consent$4, Object.assign({}, (_e = (_d = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.props))) : (render({
|
1124
1151
|
rtcList,
|
1125
1152
|
mutateLike: bffMutateLike,
|
@@ -1249,7 +1276,6 @@
|
|
1249
1276
|
});
|
1250
1277
|
const EditorCore = React.forwardRef(({ children, resolver, isSsr, schema, enableDataSource = true, utmVal }, ref) => {
|
1251
1278
|
const [currentNode, setCurrentNode] = React.useState(null);
|
1252
|
-
const [channel, setChannel] = React.useState();
|
1253
1279
|
const [_schema, setSchema] = React.useState(schema || {
|
1254
1280
|
pointData: [item],
|
1255
1281
|
dataSource: [],
|
@@ -1270,9 +1296,6 @@
|
|
1270
1296
|
const [undoStack, setUndoStack] = React.useState([[item]]);
|
1271
1297
|
const [redoStack, setRedoStack] = React.useState([]);
|
1272
1298
|
const [popup, setPopup] = React.useState(popupInit);
|
1273
|
-
const channelParams = React.useMemo(() => {
|
1274
|
-
return channel || utmVal;
|
1275
|
-
}, [channel, utmVal]);
|
1276
1299
|
typeof window !== 'undefined' &&
|
1277
1300
|
(window.sxpPopup = (type, aniType) => {
|
1278
1301
|
setPopup(Object.assign(Object.assign(Object.assign({}, popupInit), { id: type }), aniType));
|
@@ -1281,10 +1304,10 @@
|
|
1281
1304
|
(window.getJointUtmLink = (url) => {
|
1282
1305
|
setSlideSkipState();
|
1283
1306
|
if ((url === null || url === void 0 ? void 0 : url.indexOf('?')) !== -1) {
|
1284
|
-
return url + (
|
1307
|
+
return url + (utmVal ? '&' + utmVal : '');
|
1285
1308
|
}
|
1286
1309
|
else {
|
1287
|
-
return url + (
|
1310
|
+
return url + (utmVal ? '?' + utmVal : '');
|
1288
1311
|
}
|
1289
1312
|
});
|
1290
1313
|
// 切换页面类型,清空操作栈
|
@@ -1352,9 +1375,7 @@
|
|
1352
1375
|
setUndoStack,
|
1353
1376
|
getCurPageConf,
|
1354
1377
|
popup,
|
1355
|
-
setPopup
|
1356
|
-
channel,
|
1357
|
-
setChannel
|
1378
|
+
setPopup
|
1358
1379
|
} },
|
1359
1380
|
React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
|
1360
1381
|
});
|
@@ -1586,14 +1607,21 @@
|
|
1586
1607
|
* @Author: binruan@chatlabs.com
|
1587
1608
|
* @Date: 2024-03-12 10:59:06
|
1588
1609
|
* @LastEditors: binruan@chatlabs.com
|
1589
|
-
* @LastEditTime: 2024-
|
1610
|
+
* @LastEditTime: 2024-11-28 11:17:16
|
1590
1611
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1591
1612
|
*
|
1592
1613
|
*/
|
1593
1614
|
function useEventReport() {
|
1594
|
-
const { bffEventReport, popupDetailData,
|
1595
|
-
const jumpToWeb = React.useCallback((data, product, cta, position, traceInfo) => {
|
1615
|
+
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
1616
|
+
const jumpToWeb = React.useCallback((e, data, product, cta, position, traceInfo) => {
|
1596
1617
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13;
|
1618
|
+
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
1619
|
+
if (i !== -1) {
|
1620
|
+
return;
|
1621
|
+
}
|
1622
|
+
else if (e) {
|
1623
|
+
setEventTimeList === null || setEventTimeList === void 0 ? void 0 : setEventTimeList((prev) => [...prev, { target: e === null || e === void 0 ? void 0 : e.target, time: new Date() }]);
|
1624
|
+
}
|
1597
1625
|
let fromKName = '';
|
1598
1626
|
if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
1599
1627
|
fromKName = 'pdpPage';
|
@@ -1621,7 +1649,7 @@
|
|
1621
1649
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1622
1650
|
eventInfo: Object.assign({ eventSubject: 'jumpToWeb', eventDescription: 'User jumped to website', productId: (_v = product === null || product === void 0 ? void 0 : product.itemId) !== null && _v !== void 0 ? _v : '', productName: (_w = product === null || product === void 0 ? void 0 : product.title) !== null && _w !== void 0 ? _w : '', price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0', productCollection: (_x = product === null || product === void 0 ? void 0 : product.collection) !== null && _x !== void 0 ? _x : '', fromKName, fromKPage: location === null || location === void 0 ? void 0 : location.href, contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '', ctatId: (_0 = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _0 !== void 0 ? _0 : '', traceInfo: (_13 = (_10 = (_8 = (_4 = (_1 = traceInfo !== null && traceInfo !== void 0 ? traceInfo : product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _1 !== void 0 ? _1 : (_3 = (_2 = data === null || data === void 0 ? void 0 : data.video) === null || _2 === void 0 ? void 0 : _2.bindProduct) === null || _3 === void 0 ? void 0 : _3.traceInfo) !== null && _4 !== void 0 ? _4 : (_7 = (_6 = (_5 = data === null || data === void 0 ? void 0 : data.video) === null || _5 === void 0 ? void 0 : _5.bindProducts) === null || _6 === void 0 ? void 0 : _6[0]) === null || _7 === void 0 ? void 0 : _7.traceInfo) !== null && _8 !== void 0 ? _8 : (_9 = data === null || data === void 0 ? void 0 : data.product) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : (_12 = (_11 = data === null || data === void 0 ? void 0 : data.video) === null || _11 === void 0 ? void 0 : _11.bindCta) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : '' }, (contentFormat && { contentFormat }))
|
1623
1651
|
});
|
1624
|
-
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
1652
|
+
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
1625
1653
|
const productView = React.useCallback((data, product, cta, viewTime, position) => {
|
1626
1654
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
1627
1655
|
let fromKName = '';
|
@@ -1727,7 +1755,7 @@
|
|
1727
1755
|
const { name, value } = e.target;
|
1728
1756
|
setFormData(Object.assign(Object.assign({}, formData), { [name]: value }));
|
1729
1757
|
}, [formData]);
|
1730
|
-
const handleSubmit = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
1758
|
+
const handleSubmit = lodash.debounce((e) => __awaiter(void 0, void 0, void 0, function* () {
|
1731
1759
|
var _d, _e, _f, _g, _h;
|
1732
1760
|
const vals = formData;
|
1733
1761
|
if (!vals)
|
@@ -1750,7 +1778,7 @@
|
|
1750
1778
|
const product = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
1751
1779
|
const cta = (_h = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.bindCta;
|
1752
1780
|
const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
1753
|
-
jumpToWeb(data, product, cta, position);
|
1781
|
+
jumpToWeb(e, data, product, cta, position);
|
1754
1782
|
}
|
1755
1783
|
if (!isPopup) {
|
1756
1784
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
@@ -10197,9 +10225,9 @@
|
|
10197
10225
|
product = p;
|
10198
10226
|
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
10199
10227
|
}
|
10200
|
-
const handleLink = () => {
|
10228
|
+
const handleLink = (e) => {
|
10201
10229
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
10202
|
-
jumpToWeb(data, product, cta, position);
|
10230
|
+
jumpToWeb(e, data, product, cta, position);
|
10203
10231
|
if (!isPost) {
|
10204
10232
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
10205
10233
|
}
|
@@ -10659,14 +10687,14 @@
|
|
10659
10687
|
const { popupDetailData } = useSxpDataSource();
|
10660
10688
|
const { jumpToWeb } = useEventReport();
|
10661
10689
|
const iconSrc = typeof icon === 'string' ? icon : getMediaValueByMode(icon);
|
10662
|
-
const handleOk = () => {
|
10690
|
+
const handleOk = (e) => {
|
10663
10691
|
var _a, _b, _c;
|
10664
10692
|
if (isExternalLink) {
|
10665
10693
|
const data = popupDetailData;
|
10666
10694
|
const product = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProduct;
|
10667
10695
|
const cta = (_c = (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct) === null || _c === void 0 ? void 0 : _c.bindCta;
|
10668
10696
|
const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
10669
|
-
jumpToWeb(data, product, cta, position);
|
10697
|
+
jumpToWeb(e, data, product, cta, position);
|
10670
10698
|
}
|
10671
10699
|
if (!isPopup) {
|
10672
10700
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
@@ -11108,9 +11136,9 @@
|
|
11108
11136
|
product = p;
|
11109
11137
|
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
11110
11138
|
}
|
11111
|
-
const handleLink = () => {
|
11139
|
+
const handleLink = (e) => {
|
11112
11140
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
11113
|
-
jumpToWeb(data, product, cta, position);
|
11141
|
+
jumpToWeb(e, data, product, cta, position);
|
11114
11142
|
if (!isPost) {
|
11115
11143
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
11116
11144
|
}
|
@@ -11791,7 +11819,7 @@ Made in Italy` })));
|
|
11791
11819
|
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
11792
11820
|
});
|
11793
11821
|
}, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
|
11794
|
-
const handleClick = lodash.throttle((item, multiCheckIndex) => {
|
11822
|
+
const handleClick = lodash.throttle((item, multiCheckIndex, e) => {
|
11795
11823
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
11796
11824
|
eventSubject: 'clickCta',
|
11797
11825
|
eventDescription: 'User clicked the CTA'
|
@@ -11799,7 +11827,7 @@ Made in Italy` })));
|
|
11799
11827
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
|
11800
11828
|
if (isExternalLink) {
|
11801
11829
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
11802
|
-
jumpToWeb(recData, item, item.bindCta, index);
|
11830
|
+
jumpToWeb(e, recData, item, item.bindCta, index);
|
11803
11831
|
window.location.href = window.getJointUtmLink(item.link);
|
11804
11832
|
}
|
11805
11833
|
}
|
@@ -11814,7 +11842,7 @@ Made in Italy` })));
|
|
11814
11842
|
}, []);
|
11815
11843
|
return (React.createElement("ul", { role: 'list', className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
|
11816
11844
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
11817
|
-
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("li", { role: 'listitem', key: index, onClick: () => handleClick(item, index) },
|
11845
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("li", { role: 'listitem', key: index, onClick: (e) => handleClick(item, index, e) },
|
11818
11846
|
React.createElement("button", Object.assign({ role: 'button', "aria-label": item === null || item === void 0 ? void 0 : item.title, tabIndex: 0, className: css.css({
|
11819
11847
|
display: 'flex',
|
11820
11848
|
alignItems: 'normal',
|
@@ -12324,9 +12352,9 @@ Made in Italy` })));
|
|
12324
12352
|
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
12325
12353
|
const { jumpToWeb } = useEventReport();
|
12326
12354
|
const [element, setElement] = React.useState(null);
|
12327
|
-
const handleClick = lodash.throttle((
|
12355
|
+
const handleClick = lodash.throttle((e) => {
|
12328
12356
|
var _a, _b, _c, _d, _e, _f;
|
12329
|
-
|
12357
|
+
e.preventDefault();
|
12330
12358
|
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;
|
12331
12359
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
12332
12360
|
eventSubject: 'clickCta',
|
@@ -12340,7 +12368,7 @@ Made in Italy` })));
|
|
12340
12368
|
if (jumpLink || link) {
|
12341
12369
|
const cta = ((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta) || (multItem === null || multItem === void 0 ? void 0 : multItem.bindCta);
|
12342
12370
|
const product = ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct) || multItem;
|
12343
|
-
jumpToWeb(rec, product, cta, index);
|
12371
|
+
jumpToWeb(e, rec, product, cta, index);
|
12344
12372
|
window.location.href = window.getJointUtmLink(jumpLink || link || '');
|
12345
12373
|
}
|
12346
12374
|
}
|
@@ -12639,8 +12667,7 @@ Made in Italy` })));
|
|
12639
12667
|
const Link$1 = (_a) => {
|
12640
12668
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
12641
12669
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index, customTitle, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index", "customTitle", "isActive"]);
|
12642
|
-
const { sxpParameter
|
12643
|
-
useEventReport();
|
12670
|
+
const { sxpParameter } = useSxpDataSource();
|
12644
12671
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
12645
12672
|
(_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
|
12646
12673
|
const src = (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
|
@@ -15074,12 +15101,12 @@ Made in Italy` })));
|
|
15074
15101
|
(_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('scroll', onScroll);
|
15075
15102
|
};
|
15076
15103
|
}, [onScroll, scrollParent]);
|
15077
|
-
const handleClickLink = () => {
|
15104
|
+
const handleClickLink = (e) => {
|
15078
15105
|
var _a, _b, _c, _d, _e;
|
15079
15106
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
15080
15107
|
reportTagsView();
|
15081
15108
|
const rec = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec;
|
15082
|
-
jumpToWeb(rec, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProduct, (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindCta, cacheActiveIndex, (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo);
|
15109
|
+
jumpToWeb(e, rec, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProduct, (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindCta, cacheActiveIndex, (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo);
|
15083
15110
|
window.location.href = window.getJointUtmLink((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link);
|
15084
15111
|
}
|
15085
15112
|
};
|
@@ -15305,12 +15332,12 @@ Made in Italy` })));
|
|
15305
15332
|
// container?.removeEventListener('scroll', handleScroll); // 在组件卸载时移除事件监听器
|
15306
15333
|
// };
|
15307
15334
|
// }, [isLoadingData, containerRef, loadMoreData]);
|
15308
|
-
const handleClickLink = () => {
|
15335
|
+
const handleClickLink = (e) => {
|
15309
15336
|
var _a, _b, _c, _d, _e;
|
15310
15337
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
15311
15338
|
reportTagsView();
|
15312
15339
|
const rec = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec;
|
15313
|
-
jumpToWeb(rec, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProduct, (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindCta, cacheActiveIndex, (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo);
|
15340
|
+
jumpToWeb(e, rec, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProduct, (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindCta, cacheActiveIndex, (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo);
|
15314
15341
|
window.location.href = window.getJointUtmLink((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link);
|
15315
15342
|
}
|
15316
15343
|
};
|
@@ -15750,7 +15777,7 @@ Made in Italy` })));
|
|
15750
15777
|
const isOnScreen = useOnScreen(ref);
|
15751
15778
|
const cta = ((_d = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.bindCta) || ((_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.bindCta) || ((_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindCta);
|
15752
15779
|
const product = ((_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.bindProducts) === null || _j === void 0 ? void 0 : _j[0]) || ((_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.bindProduct);
|
15753
|
-
const handleTo = () => {
|
15780
|
+
const handleTo = (e) => {
|
15754
15781
|
var _a, _b, _c, _d;
|
15755
15782
|
const item = ((_b = (_a = recData === null || recData === void 0 ? void 0 : recData.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) || (recData === null || recData === void 0 ? void 0 : recData.video);
|
15756
15783
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -15761,7 +15788,7 @@ Made in Italy` })));
|
|
15761
15788
|
if (isExternalLink) {
|
15762
15789
|
const link = (product === null || product === void 0 ? void 0 : product.link) || ((_d = item === null || item === void 0 ? void 0 : item.bindCta) === null || _d === void 0 ? void 0 : _d.link);
|
15763
15790
|
if (link) {
|
15764
|
-
jumpToWeb(recData, product, cta, index);
|
15791
|
+
jumpToWeb(e, recData, product, cta, index);
|
15765
15792
|
window.location.href = window.getJointUtmLink(link);
|
15766
15793
|
}
|
15767
15794
|
}
|
@@ -16197,7 +16224,7 @@ Made in Italy` })));
|
|
16197
16224
|
const [visible, setVisible] = React.useState(true);
|
16198
16225
|
const cta = ((_d = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.bindCta) || ((_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.bindCta) || ((_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindCta);
|
16199
16226
|
const product = ((_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.bindProducts) === null || _j === void 0 ? void 0 : _j[0]) || ((_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.bindProduct);
|
16200
|
-
const handleTo = () => {
|
16227
|
+
const handleTo = (e) => {
|
16201
16228
|
var _a, _b, _c, _d;
|
16202
16229
|
const item = ((_b = (_a = recData === null || recData === void 0 ? void 0 : recData.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) || (recData === null || recData === void 0 ? void 0 : recData.video);
|
16203
16230
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -16208,7 +16235,7 @@ Made in Italy` })));
|
|
16208
16235
|
if (isExternalLink) {
|
16209
16236
|
const link = (product === null || product === void 0 ? void 0 : product.link) || ((_d = item === null || item === void 0 ? void 0 : item.bindCta) === null || _d === void 0 ? void 0 : _d.link);
|
16210
16237
|
if (link) {
|
16211
|
-
jumpToWeb(recData, product, cta, index);
|
16238
|
+
jumpToWeb(e, recData, product, cta, index);
|
16212
16239
|
window.location.href = window.getJointUtmLink(link);
|
16213
16240
|
}
|
16214
16241
|
}
|
@@ -16812,8 +16839,7 @@ Made in Italy` })));
|
|
16812
16839
|
const MultiPosts$1 = (_a) => {
|
16813
16840
|
var _b, _c;
|
16814
16841
|
var { bgImgUrl, style, recData } = _a, props = __rest(_a, ["bgImgUrl", "style", "recData"]);
|
16815
|
-
const {
|
16816
|
-
const { bffEventReport, curTime } = useSxpDataSource();
|
16842
|
+
const { bffEventReport, curTime, updateChannel } = useSxpDataSource();
|
16817
16843
|
const { isActive } = useSwiperSlide() || {};
|
16818
16844
|
const initRef = React.useRef(false);
|
16819
16845
|
const viewTime = React.useRef();
|
@@ -16843,7 +16869,7 @@ Made in Italy` })));
|
|
16843
16869
|
});
|
16844
16870
|
if ((v === null || v === void 0 ? void 0 : v.linkType) === 'recommendFlow') {
|
16845
16871
|
endMultiPost('multipostClick');
|
16846
|
-
|
16872
|
+
updateChannel === null || updateChannel === void 0 ? void 0 : updateChannel(value);
|
16847
16873
|
curTime.current = new Date();
|
16848
16874
|
}
|
16849
16875
|
else {
|
@@ -17929,7 +17955,7 @@ Made in Italy` })));
|
|
17929
17955
|
* @Author: binruan@chatlabs.com
|
17930
17956
|
* @Date: 2024-03-20 10:27:31
|
17931
17957
|
* @LastEditors: binruan@chatlabs.com
|
17932
|
-
* @LastEditTime: 2024-11-27
|
17958
|
+
* @LastEditTime: 2024-11-27 17:08:59
|
17933
17959
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
17934
17960
|
*
|
17935
17961
|
*/
|
@@ -17937,7 +17963,7 @@ Made in Italy` })));
|
|
17937
17963
|
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;
|
17938
17964
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
17939
17965
|
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
17940
|
-
const { schema
|
17966
|
+
const { schema } = useEditor();
|
17941
17967
|
const { openMultiPosts } = useEditorDataProvider();
|
17942
17968
|
const [activeIndex, setActiveIndex] = React.useState(0);
|
17943
17969
|
const viewImageStartTime = React.useRef(0);
|
@@ -17948,7 +17974,7 @@ Made in Italy` })));
|
|
17948
17974
|
const [isReload, setIsReload] = React.useState(new Date().getTime());
|
17949
17975
|
const skipLinkRef = React.useRef(false);
|
17950
17976
|
const [pageNum, setPageNum] = React.useState(2);
|
17951
|
-
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, isNoMoreData } = useSxpDataSource();
|
17977
|
+
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, isNoMoreData, channel } = useSxpDataSource();
|
17952
17978
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
17953
17979
|
const isShowFingerTip = React.useMemo(() => {
|
17954
17980
|
return data.length > 0 && !loading && (getFeUserState() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
|
@@ -18110,10 +18136,10 @@ Made in Italy` })));
|
|
18110
18136
|
const isExternalLink = ((_d = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoBar) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.linkType) === 'externalLink';
|
18111
18137
|
const rec = visList[activeIndex];
|
18112
18138
|
return (React.createElement("div", Object.assign({ className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } }, (link && {
|
18113
|
-
onClick: () => {
|
18139
|
+
onClick: (e) => {
|
18114
18140
|
var _a, _b, _c, _d;
|
18115
18141
|
if (isExternalLink) {
|
18116
|
-
jumpToWeb(rec, (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindCta, activeIndex, ((_c = rec === null || rec === void 0 ? void 0 : rec.product) === null || _c === void 0 ? void 0 : _c.traceInfo) || ((_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo));
|
18142
|
+
jumpToWeb(e, rec, (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindCta, activeIndex, ((_c = rec === null || rec === void 0 ? void 0 : rec.product) === null || _c === void 0 ? void 0 : _c.traceInfo) || ((_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo));
|
18117
18143
|
}
|
18118
18144
|
new Function(link)();
|
18119
18145
|
}
|
@@ -18953,7 +18979,7 @@ Made in Italy` })));
|
|
18953
18979
|
* @Author: binruan@chatlabs.com
|
18954
18980
|
* @Date: 2024-01-15 19:03:09
|
18955
18981
|
* @LastEditors: binruan@chatlabs.com
|
18956
|
-
* @LastEditTime: 2024-
|
18982
|
+
* @LastEditTime: 2024-11-27 16:58:32
|
18957
18983
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
|
18958
18984
|
*
|
18959
18985
|
*/
|
@@ -18977,8 +19003,9 @@ Made in Italy` })));
|
|
18977
19003
|
return searchParams;
|
18978
19004
|
}, []);
|
18979
19005
|
const [_schema, setSchema] = React.useState(data === null || data === void 0 ? void 0 : data.data);
|
18980
|
-
|
18981
|
-
|
19006
|
+
const [channel, setChannel] = React.useState();
|
19007
|
+
return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: _schema, utmVal: channel || utmVal },
|
19008
|
+
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 }) => {
|
18982
19009
|
var _a;
|
18983
19010
|
return (React.createElement(React.Fragment, null,
|
18984
19011
|
React.createElement(SxpPageRender, Object.assign({}, (_a = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER })),
|