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/index.js
CHANGED
@@ -631,9 +631,8 @@ var DataSourceType;
|
|
631
631
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
632
632
|
})(DataSourceType || (DataSourceType = {}));
|
633
633
|
const DEFAULT_TAG = 'FOR U';
|
634
|
-
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 }) => {
|
634
|
+
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 }) => {
|
635
635
|
var _a, _b, _c, _d, _e;
|
636
|
-
const { channel } = useEditor();
|
637
636
|
const [rtcList, setRtcList] = useState([]);
|
638
637
|
const [tagList, setTagList] = useState([]);
|
639
638
|
const [loading, setLoading] = useState(false);
|
@@ -659,11 +658,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
659
658
|
const [pageData, setPageData] = useState(data);
|
660
659
|
const [showConsent, setShowConsent] = useState(false);
|
661
660
|
const [layoutVariantId, setLayoutVariantId] = useState();
|
661
|
+
const [channel, setChannel] = useState();
|
662
|
+
const [eventTimeList, setEventTimeList] = useState([]);
|
662
663
|
const isShowConsent = useMemo(() => {
|
663
664
|
var _a, _b, _c, _d;
|
664
665
|
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) &&
|
665
666
|
showConsent);
|
666
667
|
}, [isAgreePolicy, globalConfig, isOpenConsent, isEditor, showConsent]);
|
668
|
+
const updateChannel = useCallback((d) => {
|
669
|
+
onUpdateChannel === null || onUpdateChannel === void 0 ? void 0 : onUpdateChannel(d);
|
670
|
+
setChannel(d);
|
671
|
+
}, []);
|
667
672
|
const getFilterRecList = useCallback((data) => {
|
668
673
|
var _a;
|
669
674
|
const recList = data === null || data === void 0 ? void 0 : data.recList;
|
@@ -677,6 +682,24 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
677
682
|
})) !== null && _a !== void 0 ? _a : [];
|
678
683
|
return nList;
|
679
684
|
}, []);
|
685
|
+
useEffect(() => {
|
686
|
+
let intervalId;
|
687
|
+
if (eventTimeList.length > 0) {
|
688
|
+
// 定期检查数组中的时间
|
689
|
+
const checkTimes = () => {
|
690
|
+
const now = new Date(); // 获取当前时间
|
691
|
+
const threshold = 15 * 1000; // 15秒的毫秒数
|
692
|
+
// 过滤掉超过15秒的时间
|
693
|
+
setEventTimeList((prevArray) => prevArray.filter((item) => now - item.time <= threshold));
|
694
|
+
};
|
695
|
+
// 每秒检查一次
|
696
|
+
intervalId = setInterval(checkTimes, 1000);
|
697
|
+
}
|
698
|
+
// 清理函数
|
699
|
+
return () => {
|
700
|
+
clearInterval(intervalId);
|
701
|
+
};
|
702
|
+
}, [eventTimeList]); // 依赖于 timeArray
|
680
703
|
useEffect(() => {
|
681
704
|
const handleChangeThemeTag = (tag) => {
|
682
705
|
themeTag.current = tag;
|
@@ -1104,7 +1127,11 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1104
1127
|
popupCurTimeRef,
|
1105
1128
|
checkCommodityIndexRef,
|
1106
1129
|
isEditor,
|
1107
|
-
isNoMoreData
|
1130
|
+
isNoMoreData,
|
1131
|
+
updateChannel,
|
1132
|
+
channel,
|
1133
|
+
eventTimeList,
|
1134
|
+
setEventTimeList
|
1108
1135
|
} }, 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({
|
1109
1136
|
rtcList,
|
1110
1137
|
mutateLike: bffMutateLike,
|
@@ -1234,7 +1261,6 @@ const EditorContext = React.createContext({
|
|
1234
1261
|
});
|
1235
1262
|
const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSource = true, utmVal }, ref) => {
|
1236
1263
|
const [currentNode, setCurrentNode] = useState(null);
|
1237
|
-
const [channel, setChannel] = useState();
|
1238
1264
|
const [_schema, setSchema] = useState(schema || {
|
1239
1265
|
pointData: [item],
|
1240
1266
|
dataSource: [],
|
@@ -1255,9 +1281,6 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
|
|
1255
1281
|
const [undoStack, setUndoStack] = useState([[item]]);
|
1256
1282
|
const [redoStack, setRedoStack] = useState([]);
|
1257
1283
|
const [popup, setPopup] = useState(popupInit);
|
1258
|
-
const channelParams = useMemo(() => {
|
1259
|
-
return channel || utmVal;
|
1260
|
-
}, [channel, utmVal]);
|
1261
1284
|
typeof window !== 'undefined' &&
|
1262
1285
|
(window.sxpPopup = (type, aniType) => {
|
1263
1286
|
setPopup(Object.assign(Object.assign(Object.assign({}, popupInit), { id: type }), aniType));
|
@@ -1266,10 +1289,10 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
|
|
1266
1289
|
(window.getJointUtmLink = (url) => {
|
1267
1290
|
setSlideSkipState();
|
1268
1291
|
if ((url === null || url === void 0 ? void 0 : url.indexOf('?')) !== -1) {
|
1269
|
-
return url + (
|
1292
|
+
return url + (utmVal ? '&' + utmVal : '');
|
1270
1293
|
}
|
1271
1294
|
else {
|
1272
|
-
return url + (
|
1295
|
+
return url + (utmVal ? '?' + utmVal : '');
|
1273
1296
|
}
|
1274
1297
|
});
|
1275
1298
|
// 切换页面类型,清空操作栈
|
@@ -1337,9 +1360,7 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
|
|
1337
1360
|
setUndoStack,
|
1338
1361
|
getCurPageConf,
|
1339
1362
|
popup,
|
1340
|
-
setPopup
|
1341
|
-
channel,
|
1342
|
-
setChannel
|
1363
|
+
setPopup
|
1343
1364
|
} },
|
1344
1365
|
React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
|
1345
1366
|
});
|
@@ -1571,14 +1592,21 @@ var settingRender$d = [
|
|
1571
1592
|
* @Author: binruan@chatlabs.com
|
1572
1593
|
* @Date: 2024-03-12 10:59:06
|
1573
1594
|
* @LastEditors: binruan@chatlabs.com
|
1574
|
-
* @LastEditTime: 2024-
|
1595
|
+
* @LastEditTime: 2024-11-28 11:17:16
|
1575
1596
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1576
1597
|
*
|
1577
1598
|
*/
|
1578
1599
|
function useEventReport() {
|
1579
|
-
const { bffEventReport, popupDetailData,
|
1580
|
-
const jumpToWeb = useCallback((data, product, cta, position, traceInfo) => {
|
1600
|
+
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
1601
|
+
const jumpToWeb = useCallback((e, data, product, cta, position, traceInfo) => {
|
1581
1602
|
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;
|
1603
|
+
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
1604
|
+
if (i !== -1) {
|
1605
|
+
return;
|
1606
|
+
}
|
1607
|
+
else if (e) {
|
1608
|
+
setEventTimeList === null || setEventTimeList === void 0 ? void 0 : setEventTimeList((prev) => [...prev, { target: e === null || e === void 0 ? void 0 : e.target, time: new Date() }]);
|
1609
|
+
}
|
1582
1610
|
let fromKName = '';
|
1583
1611
|
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))) {
|
1584
1612
|
fromKName = 'pdpPage';
|
@@ -1606,7 +1634,7 @@ function useEventReport() {
|
|
1606
1634
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1607
1635
|
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 }))
|
1608
1636
|
});
|
1609
|
-
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
1637
|
+
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
1610
1638
|
const productView = useCallback((data, product, cta, viewTime, position) => {
|
1611
1639
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
1612
1640
|
let fromKName = '';
|
@@ -1712,7 +1740,7 @@ const AppointForm$1 = (_a) => {
|
|
1712
1740
|
const { name, value } = e.target;
|
1713
1741
|
setFormData(Object.assign(Object.assign({}, formData), { [name]: value }));
|
1714
1742
|
}, [formData]);
|
1715
|
-
const handleSubmit = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
1743
|
+
const handleSubmit = debounce((e) => __awaiter(void 0, void 0, void 0, function* () {
|
1716
1744
|
var _d, _e, _f, _g, _h;
|
1717
1745
|
const vals = formData;
|
1718
1746
|
if (!vals)
|
@@ -1735,7 +1763,7 @@ const AppointForm$1 = (_a) => {
|
|
1735
1763
|
const product = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
1736
1764
|
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;
|
1737
1765
|
const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
1738
|
-
jumpToWeb(data, product, cta, position);
|
1766
|
+
jumpToWeb(e, data, product, cta, position);
|
1739
1767
|
}
|
1740
1768
|
if (!isPopup) {
|
1741
1769
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
@@ -10182,9 +10210,9 @@ const CommodityDetail$1 = (_a) => {
|
|
10182
10210
|
product = p;
|
10183
10211
|
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
10184
10212
|
}
|
10185
|
-
const handleLink = () => {
|
10213
|
+
const handleLink = (e) => {
|
10186
10214
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
10187
|
-
jumpToWeb(data, product, cta, position);
|
10215
|
+
jumpToWeb(e, data, product, cta, position);
|
10188
10216
|
if (!isPost) {
|
10189
10217
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
10190
10218
|
}
|
@@ -10644,14 +10672,14 @@ const Prompt$1 = (_a) => {
|
|
10644
10672
|
const { popupDetailData } = useSxpDataSource();
|
10645
10673
|
const { jumpToWeb } = useEventReport();
|
10646
10674
|
const iconSrc = typeof icon === 'string' ? icon : getMediaValueByMode(icon);
|
10647
|
-
const handleOk = () => {
|
10675
|
+
const handleOk = (e) => {
|
10648
10676
|
var _a, _b, _c;
|
10649
10677
|
if (isExternalLink) {
|
10650
10678
|
const data = popupDetailData;
|
10651
10679
|
const product = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProduct;
|
10652
10680
|
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;
|
10653
10681
|
const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
10654
|
-
jumpToWeb(data, product, cta, position);
|
10682
|
+
jumpToWeb(e, data, product, cta, position);
|
10655
10683
|
}
|
10656
10684
|
if (!isPopup) {
|
10657
10685
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
@@ -11093,9 +11121,9 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
11093
11121
|
product = p;
|
11094
11122
|
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
11095
11123
|
}
|
11096
|
-
const handleLink = () => {
|
11124
|
+
const handleLink = (e) => {
|
11097
11125
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
11098
|
-
jumpToWeb(data, product, cta, position);
|
11126
|
+
jumpToWeb(e, data, product, cta, position);
|
11099
11127
|
if (!isPost) {
|
11100
11128
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
11101
11129
|
}
|
@@ -11776,7 +11804,7 @@ const CommodityList$1 = (_a) => {
|
|
11776
11804
|
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
11777
11805
|
});
|
11778
11806
|
}, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
|
11779
|
-
const handleClick = throttle((item, multiCheckIndex) => {
|
11807
|
+
const handleClick = throttle((item, multiCheckIndex, e) => {
|
11780
11808
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
11781
11809
|
eventSubject: 'clickCta',
|
11782
11810
|
eventDescription: 'User clicked the CTA'
|
@@ -11784,7 +11812,7 @@ const CommodityList$1 = (_a) => {
|
|
11784
11812
|
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 }));
|
11785
11813
|
if (isExternalLink) {
|
11786
11814
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
11787
|
-
jumpToWeb(recData, item, item.bindCta, index);
|
11815
|
+
jumpToWeb(e, recData, item, item.bindCta, index);
|
11788
11816
|
window.location.href = window.getJointUtmLink(item.link);
|
11789
11817
|
}
|
11790
11818
|
}
|
@@ -11799,7 +11827,7 @@ const CommodityList$1 = (_a) => {
|
|
11799
11827
|
}, []);
|
11800
11828
|
return (React.createElement("ul", { role: 'list', className: 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) => {
|
11801
11829
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
11802
|
-
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) },
|
11830
|
+
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) },
|
11803
11831
|
React.createElement("button", Object.assign({ role: 'button', "aria-label": item === null || item === void 0 ? void 0 : item.title, tabIndex: 0, className: css({
|
11804
11832
|
display: 'flex',
|
11805
11833
|
alignItems: 'normal',
|
@@ -12309,9 +12337,9 @@ const EventProvider = (_a) => {
|
|
12309
12337
|
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
12310
12338
|
const { jumpToWeb } = useEventReport();
|
12311
12339
|
const [element, setElement] = useState(null);
|
12312
|
-
const handleClick = throttle((
|
12340
|
+
const handleClick = throttle((e) => {
|
12313
12341
|
var _a, _b, _c, _d, _e, _f;
|
12314
|
-
|
12342
|
+
e.preventDefault();
|
12315
12343
|
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;
|
12316
12344
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
12317
12345
|
eventSubject: 'clickCta',
|
@@ -12325,7 +12353,7 @@ const EventProvider = (_a) => {
|
|
12325
12353
|
if (jumpLink || link) {
|
12326
12354
|
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);
|
12327
12355
|
const product = ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct) || multItem;
|
12328
|
-
jumpToWeb(rec, product, cta, index);
|
12356
|
+
jumpToWeb(e, rec, product, cta, index);
|
12329
12357
|
window.location.href = window.getJointUtmLink(jumpLink || link || '');
|
12330
12358
|
}
|
12331
12359
|
}
|
@@ -12624,8 +12652,7 @@ var styles$7 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__nkBlU","one
|
|
12624
12652
|
const Link$1 = (_a) => {
|
12625
12653
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
12626
12654
|
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"]);
|
12627
|
-
const { sxpParameter
|
12628
|
-
useEventReport();
|
12655
|
+
const { sxpParameter } = useSxpDataSource();
|
12629
12656
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
12630
12657
|
(_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
|
12631
12658
|
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;
|
@@ -15059,12 +15086,12 @@ function WaterfallList$1(_a) {
|
|
15059
15086
|
(_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('scroll', onScroll);
|
15060
15087
|
};
|
15061
15088
|
}, [onScroll, scrollParent]);
|
15062
|
-
const handleClickLink = () => {
|
15089
|
+
const handleClickLink = (e) => {
|
15063
15090
|
var _a, _b, _c, _d, _e;
|
15064
15091
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
15065
15092
|
reportTagsView();
|
15066
15093
|
const rec = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec;
|
15067
|
-
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);
|
15094
|
+
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);
|
15068
15095
|
window.location.href = window.getJointUtmLink((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link);
|
15069
15096
|
}
|
15070
15097
|
};
|
@@ -15290,12 +15317,12 @@ function WaterfallList(_a) {
|
|
15290
15317
|
// container?.removeEventListener('scroll', handleScroll); // 在组件卸载时移除事件监听器
|
15291
15318
|
// };
|
15292
15319
|
// }, [isLoadingData, containerRef, loadMoreData]);
|
15293
|
-
const handleClickLink = () => {
|
15320
|
+
const handleClickLink = (e) => {
|
15294
15321
|
var _a, _b, _c, _d, _e;
|
15295
15322
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
15296
15323
|
reportTagsView();
|
15297
15324
|
const rec = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec;
|
15298
|
-
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);
|
15325
|
+
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);
|
15299
15326
|
window.location.href = window.getJointUtmLink((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link);
|
15300
15327
|
}
|
15301
15328
|
};
|
@@ -15735,7 +15762,7 @@ const AniLink$1 = (_a) => {
|
|
15735
15762
|
const isOnScreen = useOnScreen(ref);
|
15736
15763
|
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);
|
15737
15764
|
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);
|
15738
|
-
const handleTo = () => {
|
15765
|
+
const handleTo = (e) => {
|
15739
15766
|
var _a, _b, _c, _d;
|
15740
15767
|
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);
|
15741
15768
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -15746,7 +15773,7 @@ const AniLink$1 = (_a) => {
|
|
15746
15773
|
if (isExternalLink) {
|
15747
15774
|
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);
|
15748
15775
|
if (link) {
|
15749
|
-
jumpToWeb(recData, product, cta, index);
|
15776
|
+
jumpToWeb(e, recData, product, cta, index);
|
15750
15777
|
window.location.href = window.getJointUtmLink(link);
|
15751
15778
|
}
|
15752
15779
|
}
|
@@ -16182,7 +16209,7 @@ const AniLinkPopup$1 = (_a) => {
|
|
16182
16209
|
const [visible, setVisible] = useState(true);
|
16183
16210
|
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);
|
16184
16211
|
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);
|
16185
|
-
const handleTo = () => {
|
16212
|
+
const handleTo = (e) => {
|
16186
16213
|
var _a, _b, _c, _d;
|
16187
16214
|
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);
|
16188
16215
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -16193,7 +16220,7 @@ const AniLinkPopup$1 = (_a) => {
|
|
16193
16220
|
if (isExternalLink) {
|
16194
16221
|
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);
|
16195
16222
|
if (link) {
|
16196
|
-
jumpToWeb(recData, product, cta, index);
|
16223
|
+
jumpToWeb(e, recData, product, cta, index);
|
16197
16224
|
window.location.href = window.getJointUtmLink(link);
|
16198
16225
|
}
|
16199
16226
|
}
|
@@ -16797,8 +16824,7 @@ var settingRender = [
|
|
16797
16824
|
const MultiPosts$1 = (_a) => {
|
16798
16825
|
var _b, _c;
|
16799
16826
|
var { bgImgUrl, style, recData } = _a, props = __rest(_a, ["bgImgUrl", "style", "recData"]);
|
16800
|
-
const {
|
16801
|
-
const { bffEventReport, curTime } = useSxpDataSource();
|
16827
|
+
const { bffEventReport, curTime, updateChannel } = useSxpDataSource();
|
16802
16828
|
const { isActive } = useSwiperSlide() || {};
|
16803
16829
|
const initRef = useRef(false);
|
16804
16830
|
const viewTime = useRef();
|
@@ -16828,7 +16854,7 @@ const MultiPosts$1 = (_a) => {
|
|
16828
16854
|
});
|
16829
16855
|
if ((v === null || v === void 0 ? void 0 : v.linkType) === 'recommendFlow') {
|
16830
16856
|
endMultiPost('multipostClick');
|
16831
|
-
|
16857
|
+
updateChannel === null || updateChannel === void 0 ? void 0 : updateChannel(value);
|
16832
16858
|
curTime.current = new Date();
|
16833
16859
|
}
|
16834
16860
|
else {
|
@@ -17914,7 +17940,7 @@ var NavBack$1 = memo(NavBack);
|
|
17914
17940
|
* @Author: binruan@chatlabs.com
|
17915
17941
|
* @Date: 2024-03-20 10:27:31
|
17916
17942
|
* @LastEditors: binruan@chatlabs.com
|
17917
|
-
* @LastEditTime: 2024-11-27
|
17943
|
+
* @LastEditTime: 2024-11-27 17:08:59
|
17918
17944
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
17919
17945
|
*
|
17920
17946
|
*/
|
@@ -17922,7 +17948,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
17922
17948
|
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;
|
17923
17949
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
17924
17950
|
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
17925
|
-
const { schema
|
17951
|
+
const { schema } = useEditor();
|
17926
17952
|
const { openMultiPosts } = useEditorDataProvider();
|
17927
17953
|
const [activeIndex, setActiveIndex] = useState(0);
|
17928
17954
|
const viewImageStartTime = useRef(0);
|
@@ -17933,7 +17959,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
17933
17959
|
const [isReload, setIsReload] = useState(new Date().getTime());
|
17934
17960
|
const skipLinkRef = useRef(false);
|
17935
17961
|
const [pageNum, setPageNum] = useState(2);
|
17936
|
-
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();
|
17962
|
+
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();
|
17937
17963
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
17938
17964
|
const isShowFingerTip = useMemo(() => {
|
17939
17965
|
return data.length > 0 && !loading && (getFeUserState() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
|
@@ -18095,10 +18121,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18095
18121
|
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';
|
18096
18122
|
const rec = visList[activeIndex];
|
18097
18123
|
return (React.createElement("div", Object.assign({ className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } }, (link && {
|
18098
|
-
onClick: () => {
|
18124
|
+
onClick: (e) => {
|
18099
18125
|
var _a, _b, _c, _d;
|
18100
18126
|
if (isExternalLink) {
|
18101
|
-
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));
|
18127
|
+
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));
|
18102
18128
|
}
|
18103
18129
|
new Function(link)();
|
18104
18130
|
}
|
@@ -18938,7 +18964,7 @@ const Popup = () => {
|
|
18938
18964
|
* @Author: binruan@chatlabs.com
|
18939
18965
|
* @Date: 2024-01-15 19:03:09
|
18940
18966
|
* @LastEditors: binruan@chatlabs.com
|
18941
|
-
* @LastEditTime: 2024-
|
18967
|
+
* @LastEditTime: 2024-11-27 16:58:32
|
18942
18968
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
|
18943
18969
|
*
|
18944
18970
|
*/
|
@@ -18962,8 +18988,9 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
|
|
18962
18988
|
return searchParams;
|
18963
18989
|
}, []);
|
18964
18990
|
const [_schema, setSchema] = useState(data === null || data === void 0 ? void 0 : data.data);
|
18965
|
-
|
18966
|
-
|
18991
|
+
const [channel, setChannel] = useState();
|
18992
|
+
return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: _schema, utmVal: channel || utmVal },
|
18993
|
+
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 }) => {
|
18967
18994
|
var _a;
|
18968
18995
|
return (React.createElement(React.Fragment, null,
|
18969
18996
|
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 })),
|