pb-sxp-ui 1.3.0 → 1.3.2
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 +371 -198
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +371 -198
- 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 +371 -198
- 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/SxpPageRender/Modal/index.js +3 -2
- package/es/core/components/SxpPageRender/RenderCard.d.ts +3 -3
- package/es/core/components/SxpPageRender/RenderCard.js +17 -27
- package/es/core/components/SxpPageRender/WaterFall/List.js +28 -15
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +27 -14
- package/es/core/components/SxpPageRender/index.js +41 -29
- package/es/core/context/EditorContext.js +2 -0
- package/es/core/context/EditorDataProvider.d.ts +3 -0
- package/es/core/context/EditorDataProvider.js +2 -1
- package/es/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.js +58 -23
- package/es/core/hooks/useEventReport.d.ts +1 -1
- package/es/core/hooks/useEventReport.js +2 -2
- package/es/core/utils/tool.d.ts +3 -3
- package/es/core/utils/tool.js +6 -6
- package/es/materials/sxp/HashTag/index.d.ts +3 -1
- package/es/materials/sxp/HashTag/settingRender.d.ts +13 -7
- package/es/materials/sxp/HashTag/settingRender.js +15 -0
- package/es/materials/sxp/cta/AniLink/settingRender.d.ts +5 -0
- package/es/materials/sxp/cta/AniLink/settingRender.js +4 -0
- package/es/materials/sxp/popup/AppointForm/settingRender.d.ts +8 -5
- package/es/materials/sxp/popup/AppointForm/settingRender.js +12 -0
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +3 -1
- package/es/materials/sxp/popup/CommodityDetail/index.js +34 -27
- package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +13 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +15 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +3 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +37 -30
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +13 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +15 -0
- package/es/materials/sxp/popup/CommodityList/index.d.ts +3 -1
- package/es/materials/sxp/popup/CommodityList/index.js +11 -7
- package/es/materials/sxp/popup/CommodityList/settingRender.d.ts +7 -0
- package/es/materials/sxp/popup/CommodityList/settingRender.js +10 -0
- package/es/materials/sxp/popup/Iframe/index.d.ts +1 -0
- package/es/materials/sxp/popup/Iframe/index.js +8 -7
- package/es/materials/sxp/popup/Prompt/settingRender.js +10 -0
- package/es/materials/sxp/template/Link/settingRender.js +5 -0
- package/lib/core/components/SxpPageRender/Modal/index.js +3 -2
- package/lib/core/components/SxpPageRender/RenderCard.d.ts +3 -3
- package/lib/core/components/SxpPageRender/RenderCard.js +16 -26
- package/lib/core/components/SxpPageRender/WaterFall/List.js +28 -15
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +27 -14
- package/lib/core/components/SxpPageRender/index.js +40 -28
- package/lib/core/context/EditorContext.js +2 -0
- package/lib/core/context/EditorDataProvider.d.ts +3 -0
- package/lib/core/context/EditorDataProvider.js +2 -1
- package/lib/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.js +58 -23
- package/lib/core/hooks/useEventReport.d.ts +1 -1
- package/lib/core/hooks/useEventReport.js +2 -2
- package/lib/core/utils/tool.d.ts +3 -3
- package/lib/core/utils/tool.js +6 -6
- package/lib/materials/sxp/HashTag/index.d.ts +3 -1
- package/lib/materials/sxp/HashTag/settingRender.d.ts +13 -7
- package/lib/materials/sxp/HashTag/settingRender.js +15 -0
- package/lib/materials/sxp/cta/AniLink/settingRender.d.ts +5 -0
- package/lib/materials/sxp/cta/AniLink/settingRender.js +4 -0
- package/lib/materials/sxp/popup/AppointForm/settingRender.d.ts +8 -5
- package/lib/materials/sxp/popup/AppointForm/settingRender.js +12 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +3 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +34 -27
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +13 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +15 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +3 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +37 -30
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +13 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +15 -0
- package/lib/materials/sxp/popup/CommodityList/index.d.ts +3 -1
- package/lib/materials/sxp/popup/CommodityList/index.js +11 -7
- package/lib/materials/sxp/popup/CommodityList/settingRender.d.ts +7 -0
- package/lib/materials/sxp/popup/CommodityList/settingRender.js +10 -0
- package/lib/materials/sxp/popup/Iframe/index.d.ts +1 -0
- package/lib/materials/sxp/popup/Iframe/index.js +8 -7
- package/lib/materials/sxp/popup/Prompt/settingRender.js +10 -0
- package/lib/materials/sxp/template/Link/settingRender.js +5 -0
- package/package.json +1 -1
@@ -8,7 +8,9 @@ const preview_json_1 = tslib_1.__importDefault(require("./preview.json"));
|
|
8
8
|
const FormatImage_1 = tslib_1.__importDefault(require("../FormatImage"));
|
9
9
|
const css_1 = require("@emotion/css");
|
10
10
|
const tool_1 = require("../../../../core/utils/tool");
|
11
|
+
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
11
12
|
const WaterfallFlowItem = (props) => {
|
13
|
+
var _a;
|
12
14
|
const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
|
13
15
|
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
14
16
|
const [showVideo, setShowVideo] = (0, react_1.useState)(false);
|
@@ -60,16 +62,19 @@ const WaterfallFlowItem = (props) => {
|
|
60
62
|
}
|
61
63
|
}, [top, showBorder]);
|
62
64
|
const priceText = (0, react_1.useMemo)(() => {
|
63
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
65
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
66
|
+
const isToLocStr = ((_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice) === undefined || ((_b = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _b === void 0 ? void 0 : _b.enableFormattedPrice);
|
67
|
+
if (((_c = rec === null || rec === void 0 ? void 0 : rec.product) === null || _c === void 0 ? void 0 : _c.currency) && ((_d = rec === null || rec === void 0 ? void 0 : rec.product) === null || _d === void 0 ? void 0 : _d.price)) {
|
68
|
+
return `${(_h = (_g = (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.product) === null || _e === void 0 ? void 0 : _e.currency) === null || _f === void 0 ? void 0 : _f.split('-')[1]) === null || _g === void 0 ? void 0 : _g.toUpperCase()) !== null && _h !== void 0 ? _h : ''}${isToLocStr
|
69
|
+
? (_l = (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.product) === null || _j === void 0 ? void 0 : _j.price) === null || _k === void 0 ? void 0 : _k.toLocaleString('zh', {
|
70
|
+
minimumFractionDigits: 0
|
71
|
+
})) !== null && _l !== void 0 ? _l : ''
|
72
|
+
: (_m = rec === null || rec === void 0 ? void 0 : rec.product) === null || _m === void 0 ? void 0 : _m.price}`;
|
68
73
|
}
|
69
74
|
else {
|
70
75
|
return null;
|
71
76
|
}
|
72
|
-
}, [rec]);
|
77
|
+
}, [rec, (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice]);
|
73
78
|
(0, react_1.useEffect)(() => {
|
74
79
|
if (imgDom.current === null || src === '') {
|
75
80
|
return;
|
@@ -115,7 +120,8 @@ const WaterfallFlowItem = (props) => {
|
|
115
120
|
function WaterfallList(_a) {
|
116
121
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
117
122
|
var { reportTagsView, showBanner } = _a, props = tslib_1.__rest(_a, ["reportTagsView", "showBanner"]);
|
118
|
-
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = (0, hooks_1.useSxpDataSource)();
|
123
|
+
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex } = (0, hooks_1.useSxpDataSource)();
|
124
|
+
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
119
125
|
const scrollParent = (0, react_1.useRef)(null);
|
120
126
|
const [scrollTop, setScrollTop] = (0, react_1.useState)(0);
|
121
127
|
const [data, setData] = (0, react_1.useState)();
|
@@ -209,10 +215,14 @@ function WaterfallList(_a) {
|
|
209
215
|
styleListRef.current = getStyleList();
|
210
216
|
}, [unitWidth, rowsNum, list]);
|
211
217
|
(0, react_1.useEffect)(() => {
|
212
|
-
var _a, _b
|
218
|
+
var _a, _b;
|
213
219
|
setIsLoadingData(true);
|
214
220
|
waterFallData &&
|
215
|
-
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos(
|
221
|
+
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
|
222
|
+
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
|
223
|
+
defaultSize: hashTagSize,
|
224
|
+
maxSize: hashTagSize
|
225
|
+
}).then((res) => {
|
216
226
|
var _a, _b;
|
217
227
|
setData(res);
|
218
228
|
setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
|
@@ -221,7 +231,7 @@ function WaterfallList(_a) {
|
|
221
231
|
if (isOpenHashTag) {
|
222
232
|
const res = preview_json_1.default;
|
223
233
|
setData(res);
|
224
|
-
setList((
|
234
|
+
setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
|
225
235
|
setIsLoadingData(false);
|
226
236
|
}
|
227
237
|
}, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
|
@@ -246,10 +256,11 @@ function WaterfallList(_a) {
|
|
246
256
|
};
|
247
257
|
}, [onResize]);
|
248
258
|
const loadMoreData = (0, react_1.useCallback)(() => {
|
249
|
-
var _a, _b, _c, _d;
|
250
259
|
setIsLoadingData(true);
|
251
260
|
waterFallData &&
|
252
|
-
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos(
|
261
|
+
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
|
262
|
+
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag
|
263
|
+
}).then((res) => {
|
253
264
|
var _a, _b;
|
254
265
|
setList(list === null || list === void 0 ? void 0 : list.concat((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => !(item === null || item === void 0 ? void 0 : item.video))) !== null && _b !== void 0 ? _b : []));
|
255
266
|
setIsLoadingData(false);
|
@@ -267,10 +278,12 @@ function WaterfallList(_a) {
|
|
267
278
|
};
|
268
279
|
}, [onScroll, scrollParent]);
|
269
280
|
const handleClickLink = () => {
|
270
|
-
var _a, _b;
|
281
|
+
var _a, _b, _c, _d, _e;
|
271
282
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
272
283
|
reportTagsView();
|
273
|
-
|
284
|
+
const rec = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec;
|
285
|
+
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);
|
286
|
+
window.location.href = window.getJointUtmLink((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link);
|
274
287
|
}
|
275
288
|
};
|
276
289
|
return (react_1.default.createElement(react_1.default.Fragment, null, isLoadingData ? (react_1.default.createElement("div", { style: { height: '100%', width: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
@@ -37,9 +37,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
37
37
|
const [isShowMore, setIsShowMore] = (0, react_1.useState)(false);
|
38
38
|
const [isReload, setIsReload] = (0, react_1.useState)(new Date().getTime());
|
39
39
|
const skipLinkRef = (0, react_1.useRef)(false);
|
40
|
-
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview } = (0, hooks_1.useSxpDataSource)();
|
41
|
-
const { backMainFeed } = (0, useEventReport_1.useEventReport)();
|
42
|
-
const { productView } = (0, useEventReport_1.useEventReport)();
|
40
|
+
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor } = (0, hooks_1.useSxpDataSource)();
|
41
|
+
const { backMainFeed, productView, jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
43
42
|
const isShowFingerTip = (0, react_1.useMemo)(() => {
|
44
43
|
return data.length > 0 && !loading && ((0, localStore_1.getFeUserId)() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
|
45
44
|
}, [data, loading, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip]);
|
@@ -68,6 +67,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
68
67
|
}, [data.length, bffFbReport, h5EnterLink]);
|
69
68
|
(0, react_1.useEffect)(() => {
|
70
69
|
var _a;
|
70
|
+
if (!ctaType || (ctaType === null || ctaType === void 0 ? void 0 : ctaType.length) < 1)
|
71
|
+
return;
|
71
72
|
const index = (data === null || data === void 0 ? void 0 : data.findIndex((item) => {
|
72
73
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
73
74
|
const ctaType0 = ctaType === null || ctaType === void 0 ? void 0 : ctaType[0];
|
@@ -81,8 +82,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
81
82
|
return ((_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.bindCta) === null || _f === void 0 ? void 0 : _f.itemId) === ctaType0 && (((_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.url) || ((_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.imgUrls) === null || _j === void 0 ? void 0 : _j.length));
|
82
83
|
}
|
83
84
|
})) || 0;
|
84
|
-
(
|
85
|
-
|
85
|
+
if (index !== -1)
|
86
|
+
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
87
|
+
}, [data, ctaType, swiperRef]);
|
86
88
|
(0, react_1.useEffect)(() => {
|
87
89
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
88
90
|
const visibleChange = () => {
|
@@ -179,15 +181,39 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
179
181
|
const height = (0, react_1.useMemo)(() => {
|
180
182
|
return containerHeight - minusHeight - tagHeight;
|
181
183
|
}, [globalConfig, containerHeight, tagHeight]);
|
184
|
+
const visList = (0, react_1.useMemo)(() => {
|
185
|
+
var _a;
|
186
|
+
const list = activeIndex === 0 && !waterFallData && !isEditor
|
187
|
+
? [(_a = data === null || data === void 0 ? void 0 : data[0]) !== null && _a !== void 0 ? _a : null]
|
188
|
+
: data === null || data === void 0 ? void 0 : data.map((item, index) => {
|
189
|
+
if (activeIndex === index || index - 1 === activeIndex || index + 1 === activeIndex) {
|
190
|
+
return item;
|
191
|
+
}
|
192
|
+
else {
|
193
|
+
return null;
|
194
|
+
}
|
195
|
+
});
|
196
|
+
return !waterFallData ? list.concat([{ loading: true }]) : list;
|
197
|
+
}, [data, activeIndex, waterFallData, isEditor]);
|
182
198
|
const renderLogo = (0, react_1.useMemo)(() => {
|
183
|
-
var _a, _b;
|
199
|
+
var _a, _b, _c, _d;
|
184
200
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
185
201
|
const link = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoBar) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.value;
|
186
|
-
|
202
|
+
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';
|
203
|
+
const rec = visList[activeIndex];
|
204
|
+
return (react_1.default.createElement("div", Object.assign({ className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } }, (link && {
|
205
|
+
onClick: () => {
|
206
|
+
var _a, _b, _c, _d;
|
207
|
+
if (isExternalLink) {
|
208
|
+
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));
|
209
|
+
}
|
210
|
+
new Function(link)();
|
211
|
+
}
|
212
|
+
})),
|
187
213
|
react_1.default.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
|
188
214
|
}
|
189
215
|
return null;
|
190
|
-
}, [globalConfig]);
|
216
|
+
}, [globalConfig, activeIndex, visList]);
|
191
217
|
const renderContent = (0, react_1.useCallback)((rec, index) => {
|
192
218
|
var _a, _b, _c, _d;
|
193
219
|
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
@@ -324,7 +350,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
324
350
|
traceInfo: (_u = (_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : (_t = item === null || item === void 0 ? void 0 : item.product) === null || _t === void 0 ? void 0 : _t.traceInfo) !== null && _u !== void 0 ? _u : ''
|
325
351
|
}
|
326
352
|
});
|
327
|
-
(0, localStore_1.setSlideSkipState)();
|
328
353
|
skipLinkRef.current = true;
|
329
354
|
window.location.href = window.getJointUtmLink(link);
|
330
355
|
}
|
@@ -406,20 +431,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
406
431
|
});
|
407
432
|
}
|
408
433
|
};
|
409
|
-
const visList = (0, react_1.useMemo)(() => {
|
410
|
-
var _a;
|
411
|
-
const list = activeIndex === 0 && !waterFallData
|
412
|
-
? [(_a = data === null || data === void 0 ? void 0 : data[0]) !== null && _a !== void 0 ? _a : null]
|
413
|
-
: data === null || data === void 0 ? void 0 : data.map((item, index) => {
|
414
|
-
if (activeIndex === index || index - 1 === activeIndex || index + 1 === activeIndex) {
|
415
|
-
return item;
|
416
|
-
}
|
417
|
-
else {
|
418
|
-
return null;
|
419
|
-
}
|
420
|
-
});
|
421
|
-
return !waterFallData ? list.concat([{ loading: true }]) : list;
|
422
|
-
}, [data, activeIndex, waterFallData]);
|
423
434
|
const renderToggleButton = (0, react_1.useCallback)((visible) => {
|
424
435
|
var _a, _b, _c, _d, _e, _f;
|
425
436
|
if (!visible)
|
@@ -428,6 +439,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
428
439
|
position: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed) ? 'fixed' : 'absolute',
|
429
440
|
visibility: ((_b = (_a = visList === null || visList === void 0 ? void 0 : visList[activeIndex]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.url) ? 'visible' : 'hidden',
|
430
441
|
zIndex: 999,
|
442
|
+
transform: 'translate3d(0px,0px,0px)',
|
431
443
|
[(_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _c !== void 0 ? _c : 'right']: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _d !== void 0 ? _d : 0,
|
432
444
|
[(_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _e !== void 0 ? _e : 'bottom']: (_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _f !== void 0 ? _f : 23
|
433
445
|
}, defaultValue: isMuted, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon, onChange: setIsMuted })));
|
@@ -446,10 +458,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
446
458
|
alignItems: 'center'
|
447
459
|
} },
|
448
460
|
react_1.default.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
449
|
-
renderContent(rec, index),
|
450
|
-
renderBottom(rec, index),
|
451
461
|
renderLikeButton(rec, index, !(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
|
452
|
-
renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))
|
462
|
+
renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
|
463
|
+
renderBottom(rec, index),
|
464
|
+
renderContent(rec, index)))))));
|
453
465
|
});
|
454
466
|
}, [
|
455
467
|
containerWidth,
|
@@ -484,9 +496,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
484
496
|
if (openHashtag)
|
485
497
|
return;
|
486
498
|
handleScrollEvent(swiper);
|
487
|
-
if (waterFallData)
|
499
|
+
if (waterFallData || isEditor)
|
488
500
|
return;
|
489
|
-
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) +
|
501
|
+
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
490
502
|
if (!isLoadMore) {
|
491
503
|
setIsLoadMore(true);
|
492
504
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(Math.ceil(activeIndex / 10) + 1).then(() => {
|
@@ -6,6 +6,7 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const lodash_1 = require("lodash");
|
7
7
|
const DataSourceProvider_1 = tslib_1.__importDefault(require("./DataSourceProvider"));
|
8
8
|
const tool_1 = require("../../core/utils/tool");
|
9
|
+
const localStore_1 = require("../utils/localStore");
|
9
10
|
const item = {
|
10
11
|
id: (0, tool_1.uuid)(6, 10),
|
11
12
|
item: {
|
@@ -79,6 +80,7 @@ const EditorCore = (0, react_1.forwardRef)(({ children, resolver, isSsr, schema,
|
|
79
80
|
});
|
80
81
|
typeof window !== 'undefined' &&
|
81
82
|
(window.getJointUtmLink = (url) => {
|
83
|
+
(0, localStore_1.setSlideSkipState)();
|
82
84
|
if ((url === null || url === void 0 ? void 0 : url.indexOf('?')) !== -1) {
|
83
85
|
return url + (utmVal ? '&' + utmVal : '');
|
84
86
|
}
|
@@ -29,7 +29,8 @@ const EditorDataProvider = ({ children, data }) => {
|
|
29
29
|
setOpenHashtag,
|
30
30
|
openConsent,
|
31
31
|
setOpenConsent,
|
32
|
-
sxpFontLinks: data === null || data === void 0 ? void 0 : data.sxpFontLinks
|
32
|
+
sxpFontLinks: data === null || data === void 0 ? void 0 : data.sxpFontLinks,
|
33
|
+
utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter
|
33
34
|
} }, children));
|
34
35
|
};
|
35
36
|
function useEditorDataProvider() {
|
@@ -81,6 +81,7 @@ export interface ISxpDataSourceContext {
|
|
81
81
|
globalConfig?: ISxpPageRenderProps['globalConfig'];
|
82
82
|
popupCurTimeRef?: any;
|
83
83
|
checkCommodityIndexRef?: any;
|
84
|
+
isEditor?: boolean;
|
84
85
|
}
|
85
86
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
86
87
|
export interface SxpDataSourceProviderProps {
|
@@ -96,8 +96,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
96
96
|
.catch((err) => Promise.reject(err));
|
97
97
|
}, [bffDataSource]);
|
98
98
|
const getRecommendVideos = (0, react_1.useCallback)((query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
99
|
-
var _d, _e, _f, _g, _h;
|
100
|
-
query = Object.assign(Object.assign({ maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize, defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag }, ((query === null || query === void 0 ? void 0 : query.contentFilter) && { contentFilter: `[${query === null || query === void 0 ? void 0 : query.contentFilter}]` })), ((query === null || query === void 0 ? void 0 : query.productFilter) && { productFilter: `[${query === null || query === void 0 ? void 0 : query.productFilter}]` }));
|
99
|
+
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
100
|
+
query = Object.assign(Object.assign(Object.assign({ maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize, defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag }, ((query === null || query === void 0 ? void 0 : query.contentFilter) && { contentFilter: `[${query === null || query === void 0 ? void 0 : query.contentFilter}]` })), ((query === null || query === void 0 ? void 0 : query.productFilter) && { productFilter: `[${query === null || query === void 0 ? void 0 : query.productFilter}]` })), { pageNum: query === null || query === void 0 ? void 0 : query.pageNum });
|
101
101
|
if (utmVal) {
|
102
102
|
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
103
103
|
var _a, _b;
|
@@ -106,8 +106,35 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
106
106
|
})) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
|
107
107
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
108
108
|
}
|
109
|
-
if (
|
110
|
-
query = Object.assign(Object.assign(
|
109
|
+
if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
|
110
|
+
query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_j = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _j !== void 0 ? _j : 1 });
|
111
|
+
}
|
112
|
+
if (isEditor) {
|
113
|
+
let pageNum = 1;
|
114
|
+
query = Object.assign(Object.assign({}, query), (!utmVal && channelQueryList && (channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList.length) > 0 && { channel: channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList[0] }));
|
115
|
+
if (!(query === null || query === void 0 ? void 0 : query.channel) || isInit.current)
|
116
|
+
return;
|
117
|
+
isInit.current = true;
|
118
|
+
let list = [];
|
119
|
+
let result = null;
|
120
|
+
const recurveRecList = (query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
121
|
+
var _r, _s, _t, _u, _v, _w;
|
122
|
+
query.pageNum = pageNum;
|
123
|
+
result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
124
|
+
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
125
|
+
return undefined;
|
126
|
+
}
|
127
|
+
const isNotNullList = (_s = (_r = result === null || result === void 0 ? void 0 : result.data) === null || _r === void 0 ? void 0 : _r.recList) === null || _s === void 0 ? void 0 : _s.every((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
128
|
+
list = list.concat((_w = (_v = (_u = (_t = result === null || result === void 0 ? void 0 : result.data) === null || _t === void 0 ? void 0 : _t.recList) === null || _u === void 0 ? void 0 : _u.filter) === null || _v === void 0 ? void 0 : _v.call(_u, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _w !== void 0 ? _w : []);
|
129
|
+
if (isNotNullList) {
|
130
|
+
pageNum = pageNum + 1;
|
131
|
+
yield recurveRecList(query);
|
132
|
+
}
|
133
|
+
});
|
134
|
+
yield recurveRecList(query);
|
135
|
+
if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
|
136
|
+
setCurReqInfo({ rtc: (_k = result === null || result === void 0 ? void 0 : result.data) === null || _k === void 0 ? void 0 : _k.rtc, requestId: (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.requestId });
|
137
|
+
return Object.assign(Object.assign({}, result.data), { recList: list });
|
111
138
|
}
|
112
139
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
113
140
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
@@ -115,15 +142,20 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
115
142
|
}
|
116
143
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag))
|
117
144
|
setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
|
145
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
|
146
|
+
let list = [];
|
147
|
+
list = list.concat((_q = (_p = (_o = (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.recList) === null || _o === void 0 ? void 0 : _o.filter) === null || _p === void 0 ? void 0 : _p.call(_o, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _q !== void 0 ? _q : []);
|
148
|
+
return Object.assign(Object.assign({}, result.data), { recList: list });
|
149
|
+
}
|
118
150
|
return result === null || result === void 0 ? void 0 : result.data;
|
119
|
-
}), [bffFetch, utmVal, maxSize, defaultSize,
|
120
|
-
const loadVideos = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
121
|
-
var
|
151
|
+
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList]);
|
152
|
+
const loadVideos = (0, react_1.useCallback)((pageNum) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
153
|
+
var _x, _y, _z, _0;
|
122
154
|
if (rtcList.length <= 0) {
|
123
155
|
return;
|
124
156
|
}
|
125
157
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
126
|
-
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((
|
158
|
+
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_x = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _x === void 0 ? void 0 : _x.itemId) && { productFilter: (_y = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _y === void 0 ? void 0 : _y.itemId })), (((_z = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _z === void 0 ? void 0 : _z.itemId) && { contentFilter: (_0 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _0 === void 0 ? void 0 : _0.itemId })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
|
127
159
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
128
160
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
129
161
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
@@ -135,7 +167,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
135
167
|
userInfo = {};
|
136
168
|
}
|
137
169
|
const sessionID = (0, sessionStore_1.storeAndLoadFeSessionId)();
|
138
|
-
const ef = Object.assign(Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, eventInfo), { sxpDevice: (0, tool_1.getDevice)(), sxpSystem: (0, tool_1.getSystem)(), sxpBrowser: (0, tool_1.getBrowserInfo)() });
|
170
|
+
const ef = Object.assign(Object.assign(Object.assign(Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, eventInfo), ((0, tool_1.getDevice)() && { sxpDevice: (0, tool_1.getDevice)() })), ((0, tool_1.getSystem)() && { sxpSystem: (0, tool_1.getSystem)() })), ((0, tool_1.getBrowserInfo)() && { sxpBrowser: (0, tool_1.getBrowserInfo)() }));
|
139
171
|
const realUserInfo = Object.entries(userInfo).map(([k, v]) => ({ name: k, value: v }));
|
140
172
|
const realEventInfo = Object.entries(ef)
|
141
173
|
.map(([k, v]) => v && { name: k, value: v })
|
@@ -151,24 +183,21 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
151
183
|
});
|
152
184
|
}, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
|
153
185
|
const bffFbReport = (0, react_1.useCallback)((_a) => {
|
154
|
-
var _b, _c;
|
186
|
+
var _b, _c, _d;
|
155
187
|
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;
|
156
188
|
if (!enableReportEvent || !enabledMetaConversionApi || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
|
157
189
|
return;
|
158
190
|
}
|
159
191
|
const fakeUserId = (0, localStore_1.storeAndLoadFeUserId)();
|
192
|
+
const urlParams = new URLSearchParams(window.location.search);
|
193
|
+
const fbclid = urlParams.get('fbclid');
|
160
194
|
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/fb/events', {
|
161
195
|
method: 'POST',
|
162
196
|
body: {
|
163
197
|
eventName,
|
164
198
|
actionSource,
|
165
199
|
eventSourceUrl,
|
166
|
-
userData: {
|
167
|
-
externalId: fakeUserId,
|
168
|
-
fbc: `fb.2.${new Date().getTime()}.${(0, tool_1.getCookie)('_fbc')}`,
|
169
|
-
fbp: `fb.2.${new Date().getTime()}.${(0, tool_1.getCookie)('_fbp')}`,
|
170
|
-
client_user_agent: (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent
|
171
|
-
}
|
200
|
+
userData: Object.assign(Object.assign(Object.assign({ externalId: fakeUserId }, (fbclid && { fbc: `fb.2.${new Date().getTime()}.${fbclid}` })), ((0, tool_1.getCookie)('_fbp') && { fbp: `fb.2.${new Date().getTime()}.${(0, tool_1.getCookie)('_fbp')}` })), { client_user_agent: (_d = (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent) !== null && _d !== void 0 ? _d : '' })
|
172
201
|
},
|
173
202
|
type: 'beacon'
|
174
203
|
});
|
@@ -186,17 +215,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
186
215
|
return res === null || res === void 0 ? void 0 : res.success;
|
187
216
|
}), [bffFetch]);
|
188
217
|
const bffGetTagList = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
189
|
-
var
|
218
|
+
var _1, _2, _3, _4, _5;
|
190
219
|
if (!utmVal || !isShowTag)
|
191
220
|
return;
|
192
221
|
try {
|
193
|
-
const val = (
|
222
|
+
const val = (_3 = (_2 = (_1 = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _1 === void 0 ? void 0 : _1.filter((val) => {
|
194
223
|
var _a, _b;
|
195
224
|
const key = val.split('=')[0];
|
196
225
|
return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
|
197
|
-
})) === null ||
|
226
|
+
})) === null || _2 === void 0 ? void 0 : _2.join('&')) !== null && _3 !== void 0 ? _3 : '';
|
198
227
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
199
|
-
setTagList((
|
228
|
+
setTagList((_5 = (_4 = result === null || result === void 0 ? void 0 : result.data) === null || _4 === void 0 ? void 0 : _4.tags) !== null && _5 !== void 0 ? _5 : []);
|
200
229
|
}
|
201
230
|
catch (e) {
|
202
231
|
console.log('e', e);
|
@@ -269,11 +298,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
269
298
|
}
|
270
299
|
});
|
271
300
|
setLoading(false);
|
272
|
-
isInit.current = true;
|
273
301
|
});
|
274
302
|
}, [isShowConsent]);
|
275
303
|
(0, react_1.useEffect)(() => {
|
276
|
-
if (!
|
304
|
+
if (!isPreview)
|
277
305
|
return;
|
278
306
|
setLoading(true);
|
279
307
|
bffGetTagList();
|
@@ -283,6 +311,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
283
311
|
setCacheRtcList(getFilterRecList(data));
|
284
312
|
})
|
285
313
|
.finally(() => {
|
314
|
+
bffEventReport({
|
315
|
+
eventInfo: {
|
316
|
+
eventSubject: 'apiRequest',
|
317
|
+
eventDescription: 'api request succeed'
|
318
|
+
}
|
319
|
+
});
|
286
320
|
setLoading(false);
|
287
321
|
});
|
288
322
|
}, [getRecommendVideos, bffGetTagList]);
|
@@ -333,7 +367,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
333
367
|
setSelectTag,
|
334
368
|
globalConfig,
|
335
369
|
popupCurTimeRef,
|
336
|
-
checkCommodityIndexRef
|
370
|
+
checkCommodityIndexRef,
|
371
|
+
isEditor
|
337
372
|
} }, isShowConsent ? (react_1.default.createElement(Consent_1.default, Object.assign({}, (_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))) : (render({
|
338
373
|
rtcList,
|
339
374
|
mutateLike: bffMutateLike,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { RecItemType } from '../components/SxpPageRender/typing';
|
2
2
|
export declare function useEventReport(): {
|
3
|
-
jumpToWeb: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], position?: number) => void;
|
3
|
+
jumpToWeb: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], position?: number, traceInfo?: string) => void;
|
4
4
|
productView: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], viewTime?: any, position?: number) => void;
|
5
5
|
backMainFeed: (lastFeed: 'theme' | 'branch' | 'external', selectTag?: string, themeTag?: string, hashTag?: string) => void;
|
6
6
|
};
|
@@ -6,7 +6,7 @@ const useSxpDataSource_1 = require("./useSxpDataSource");
|
|
6
6
|
const SxpDataSourceProvider_1 = require("../context/SxpDataSourceProvider");
|
7
7
|
function useEventReport() {
|
8
8
|
const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = (0, useSxpDataSource_1.useSxpDataSource)();
|
9
|
-
const jumpToWeb = (0, react_1.useCallback)((data, product, cta, position) => {
|
9
|
+
const jumpToWeb = (0, react_1.useCallback)((data, product, cta, position, traceInfo) => {
|
10
10
|
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;
|
11
11
|
let fromKName = '';
|
12
12
|
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))) {
|
@@ -39,7 +39,7 @@ function useEventReport() {
|
|
39
39
|
position: position + '',
|
40
40
|
contentId: (_v = (_u = data === null || data === void 0 ? void 0 : data.video) === null || _u === void 0 ? void 0 : _u.itemId) !== null && _v !== void 0 ? _v : '',
|
41
41
|
ctatId: (_w = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _w !== void 0 ? _w : '',
|
42
|
-
traceInfo: (_9 = (_6 = (_4 = (_0 = (_x = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _x !== void 0 ? _x : (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.bindProduct) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : (_3 = (_2 = (_1 = data === null || data === void 0 ? void 0 : data.video) === null || _1 === void 0 ? void 0 : _1.bindProducts) === null || _2 === void 0 ? void 0 : _2[0]) === null || _3 === void 0 ? void 0 : _3.traceInfo) !== null && _4 !== void 0 ? _4 : (_5 = data === null || data === void 0 ? void 0 : data.product) === null || _5 === void 0 ? void 0 : _5.traceInfo) !== null && _6 !== void 0 ? _6 : (_8 = (_7 = data === null || data === void 0 ? void 0 : data.video) === null || _7 === void 0 ? void 0 : _7.bindCta) === null || _8 === void 0 ? void 0 : _8.traceInfo) !== null && _9 !== void 0 ? _9 : ''
|
42
|
+
traceInfo: (_9 = (_6 = (_4 = (_0 = (_x = traceInfo !== null && traceInfo !== void 0 ? traceInfo : product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _x !== void 0 ? _x : (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.bindProduct) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : (_3 = (_2 = (_1 = data === null || data === void 0 ? void 0 : data.video) === null || _1 === void 0 ? void 0 : _1.bindProducts) === null || _2 === void 0 ? void 0 : _2[0]) === null || _3 === void 0 ? void 0 : _3.traceInfo) !== null && _4 !== void 0 ? _4 : (_5 = data === null || data === void 0 ? void 0 : data.product) === null || _5 === void 0 ? void 0 : _5.traceInfo) !== null && _6 !== void 0 ? _6 : (_8 = (_7 = data === null || data === void 0 ? void 0 : data.video) === null || _7 === void 0 ? void 0 : _7.bindCta) === null || _8 === void 0 ? void 0 : _8.traceInfo) !== null && _9 !== void 0 ? _9 : ''
|
43
43
|
}
|
44
44
|
});
|
45
45
|
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
package/lib/core/utils/tool.d.ts
CHANGED
@@ -7,8 +7,8 @@ interface IfontType {
|
|
7
7
|
'fontFamily-en': string;
|
8
8
|
}
|
9
9
|
export declare const setFontForText: (textContent?: string | null, style?: IfontType | any) => string;
|
10
|
-
declare function getBrowserInfo(): string;
|
11
|
-
declare function getSystem(): string;
|
12
|
-
declare function getDevice(): string;
|
10
|
+
declare function getBrowserInfo(): string | null;
|
11
|
+
declare function getSystem(): string | null;
|
12
|
+
declare function getDevice(): string | null;
|
13
13
|
declare function getCookie(val: string): string;
|
14
14
|
export { uuid, getIndexByblockType, getBrowserInfo, getDevice, getSystem, getCookie };
|
package/lib/core/utils/tool.js
CHANGED
@@ -100,7 +100,7 @@ function getBrowserInfo() {
|
|
100
100
|
var _a, _b, _c, _d, _e, _f, _g;
|
101
101
|
let userAgent = self.navigator.userAgent;
|
102
102
|
if (!userAgent)
|
103
|
-
return
|
103
|
+
return null;
|
104
104
|
if (/edge\/([\d\.]+)/i.exec(userAgent))
|
105
105
|
return `Edge ${(_a = /edge\/([\d\.]+)/i.exec(userAgent)) === null || _a === void 0 ? void 0 : _a[1]}`;
|
106
106
|
if (/edg\/([\d\.]+)/i.exec(userAgent))
|
@@ -115,14 +115,14 @@ function getBrowserInfo() {
|
|
115
115
|
return `Firefox ${(_f = /firefox\/([\d\.]+)/i.exec(userAgent)) === null || _f === void 0 ? void 0 : _f[1]}`;
|
116
116
|
if (/safari/i.test(userAgent))
|
117
117
|
return `Safari ${(_g = /version\/([\d\.]+)/i.exec(userAgent)) === null || _g === void 0 ? void 0 : _g[1]}`;
|
118
|
-
return
|
118
|
+
return null;
|
119
119
|
}
|
120
120
|
exports.getBrowserInfo = getBrowserInfo;
|
121
121
|
function getSystem() {
|
122
122
|
var _a, _b, _c;
|
123
123
|
let userAgent = self.navigator.userAgent;
|
124
124
|
if (!userAgent)
|
125
|
-
return
|
125
|
+
return null;
|
126
126
|
if (/iphone/i.test(userAgent))
|
127
127
|
return `IOS ${(_a = userAgent.match(/OS\s(.*?)\slike/)) === null || _a === void 0 ? void 0 : _a[1]}`;
|
128
128
|
if (/android/i.test(userAgent))
|
@@ -131,13 +131,13 @@ function getSystem() {
|
|
131
131
|
return `Windows ${(_c = userAgent.match(/Windows\s(.*?)\;/)) === null || _c === void 0 ? void 0 : _c[1]}`;
|
132
132
|
if (/mac/i.test(userAgent))
|
133
133
|
return `Mac OS`;
|
134
|
-
return
|
134
|
+
return null;
|
135
135
|
}
|
136
136
|
exports.getSystem = getSystem;
|
137
137
|
function getDevice() {
|
138
138
|
let userAgent = self.navigator.userAgent;
|
139
139
|
if (!userAgent)
|
140
|
-
return
|
140
|
+
return null;
|
141
141
|
if (/iphone/i.test(userAgent))
|
142
142
|
return `iPhone`;
|
143
143
|
if (/android/i.test(userAgent)) {
|
@@ -152,7 +152,7 @@ function getDevice() {
|
|
152
152
|
return `Windows`;
|
153
153
|
if (/mac/i.test(userAgent))
|
154
154
|
return `Mac`;
|
155
|
-
return
|
155
|
+
return null;
|
156
156
|
}
|
157
157
|
exports.getDevice = getDevice;
|
158
158
|
function getCookie(val) {
|
@@ -8,7 +8,9 @@ export interface IHashTagProps {
|
|
8
8
|
hashTagDesc: CSSProperties;
|
9
9
|
hashTagLink: CSSProperties;
|
10
10
|
title: CSSProperties;
|
11
|
-
price: CSSProperties
|
11
|
+
price: CSSProperties & {
|
12
|
+
enableFormattedPrice?: boolean;
|
13
|
+
};
|
12
14
|
};
|
13
15
|
buttonBgStyle: CSSProperties;
|
14
16
|
showBanner?: boolean;
|
@@ -1,11 +1,4 @@
|
|
1
1
|
declare const _default: ({
|
2
|
-
title: string;
|
3
|
-
child: {
|
4
|
-
type: string;
|
5
|
-
label: string;
|
6
|
-
name: string[];
|
7
|
-
}[];
|
8
|
-
} | {
|
9
2
|
title: string;
|
10
3
|
child: ({
|
11
4
|
type: string;
|
@@ -68,6 +61,13 @@ declare const _default: ({
|
|
68
61
|
name?: undefined;
|
69
62
|
initialValue?: undefined;
|
70
63
|
child?: undefined;
|
64
|
+
} | {
|
65
|
+
label: string;
|
66
|
+
type: string;
|
67
|
+
name: string[];
|
68
|
+
initialValue: boolean;
|
69
|
+
options?: undefined;
|
70
|
+
child?: undefined;
|
71
71
|
})[];
|
72
72
|
}[];
|
73
73
|
} | {
|
@@ -126,6 +126,12 @@ declare const _default: ({
|
|
126
126
|
})[];
|
127
127
|
name?: undefined;
|
128
128
|
initialValue?: undefined;
|
129
|
+
} | {
|
130
|
+
label: string;
|
131
|
+
type: string;
|
132
|
+
name: string[];
|
133
|
+
initialValue?: undefined;
|
134
|
+
child?: undefined;
|
129
135
|
})[];
|
130
136
|
})[];
|
131
137
|
export default _default;
|