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
@@ -16,8 +16,9 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
|
|
16
16
|
return searchParams;
|
17
17
|
}, []);
|
18
18
|
const [_schema, setSchema] = useState(data === null || data === void 0 ? void 0 : data.data);
|
19
|
-
|
20
|
-
|
19
|
+
const [channel, setChannel] = useState();
|
20
|
+
return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: _schema, utmVal: channel || utmVal },
|
21
|
+
React.createElement(SxpDataSourceProvider, { 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 }) => {
|
21
22
|
var _a;
|
22
23
|
return (React.createElement(React.Fragment, null,
|
23
24
|
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 })),
|
@@ -161,12 +161,12 @@ export default function WaterfallList(_a) {
|
|
161
161
|
setIsLoadingData(false);
|
162
162
|
}
|
163
163
|
}, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
|
164
|
-
const handleClickLink = () => {
|
164
|
+
const handleClickLink = (e) => {
|
165
165
|
var _a, _b, _c, _d, _e;
|
166
166
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
167
167
|
reportTagsView();
|
168
168
|
const rec = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec;
|
169
|
-
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);
|
169
|
+
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);
|
170
170
|
window.location.href = window.getJointUtmLink((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link);
|
171
171
|
}
|
172
172
|
};
|
@@ -269,12 +269,12 @@ export default function WaterfallList(_a) {
|
|
269
269
|
(_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('scroll', onScroll);
|
270
270
|
};
|
271
271
|
}, [onScroll, scrollParent]);
|
272
|
-
const handleClickLink = () => {
|
272
|
+
const handleClickLink = (e) => {
|
273
273
|
var _a, _b, _c, _d, _e;
|
274
274
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
275
275
|
reportTagsView();
|
276
276
|
const rec = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec;
|
277
|
-
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);
|
277
|
+
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);
|
278
278
|
window.location.href = window.getJointUtmLink((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link);
|
279
279
|
}
|
280
280
|
};
|
@@ -30,7 +30,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
30
30
|
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;
|
31
31
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
32
32
|
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
33
|
-
const { schema
|
33
|
+
const { schema } = useEditor();
|
34
34
|
const { openMultiPosts } = useEditorDataProvider();
|
35
35
|
const [activeIndex, setActiveIndex] = useState(0);
|
36
36
|
const viewImageStartTime = useRef(0);
|
@@ -41,7 +41,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
41
41
|
const [isReload, setIsReload] = useState(new Date().getTime());
|
42
42
|
const skipLinkRef = useRef(false);
|
43
43
|
const [pageNum, setPageNum] = useState(2);
|
44
|
-
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();
|
44
|
+
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();
|
45
45
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
46
46
|
const isShowFingerTip = useMemo(() => {
|
47
47
|
return data.length > 0 && !loading && (getFeUserState() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
|
@@ -200,10 +200,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
200
200
|
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';
|
201
201
|
const rec = visList[activeIndex];
|
202
202
|
return (React.createElement("div", Object.assign({ className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } }, (link && {
|
203
|
-
onClick: () => {
|
203
|
+
onClick: (e) => {
|
204
204
|
var _a, _b, _c, _d;
|
205
205
|
if (isExternalLink) {
|
206
|
-
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));
|
206
|
+
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));
|
207
207
|
}
|
208
208
|
new Function(link)();
|
209
209
|
}
|
@@ -62,8 +62,6 @@ export interface IEditorContext {
|
|
62
62
|
getCurPageConf?: any;
|
63
63
|
popup: IPopupType;
|
64
64
|
setPopup: React.Dispatch<React.SetStateAction<IPopupType>>;
|
65
|
-
channel?: string | undefined;
|
66
|
-
setChannel?: React.Dispatch<React.SetStateAction<string | undefined>>;
|
67
65
|
}
|
68
66
|
export interface IEditorCoreProps {
|
69
67
|
resolver: Record<string, MaterialComponet>;
|
@@ -55,7 +55,6 @@ export const EditorContext = React.createContext({
|
|
55
55
|
});
|
56
56
|
const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSource = true, utmVal }, ref) => {
|
57
57
|
const [currentNode, setCurrentNode] = useState(null);
|
58
|
-
const [channel, setChannel] = useState();
|
59
58
|
const [_schema, setSchema] = useState(schema || {
|
60
59
|
pointData: [item],
|
61
60
|
dataSource: [],
|
@@ -71,9 +70,6 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
|
|
71
70
|
const [undoStack, setUndoStack] = useState([[item]]);
|
72
71
|
const [redoStack, setRedoStack] = useState([]);
|
73
72
|
const [popup, setPopup] = useState(popupInit);
|
74
|
-
const channelParams = useMemo(() => {
|
75
|
-
return channel || utmVal;
|
76
|
-
}, [channel, utmVal]);
|
77
73
|
typeof window !== 'undefined' &&
|
78
74
|
(window.sxpPopup = (type, aniType) => {
|
79
75
|
setPopup(Object.assign(Object.assign(Object.assign({}, popupInit), { id: type }), aniType));
|
@@ -82,10 +78,10 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
|
|
82
78
|
(window.getJointUtmLink = (url) => {
|
83
79
|
setSlideSkipState();
|
84
80
|
if ((url === null || url === void 0 ? void 0 : url.indexOf('?')) !== -1) {
|
85
|
-
return url + (
|
81
|
+
return url + (utmVal ? '&' + utmVal : '');
|
86
82
|
}
|
87
83
|
else {
|
88
|
-
return url + (
|
84
|
+
return url + (utmVal ? '?' + utmVal : '');
|
89
85
|
}
|
90
86
|
});
|
91
87
|
useEffect(() => {
|
@@ -146,9 +142,7 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
|
|
146
142
|
setUndoStack,
|
147
143
|
getCurPageConf,
|
148
144
|
popup,
|
149
|
-
setPopup
|
150
|
-
channel,
|
151
|
-
setChannel
|
145
|
+
setPopup
|
152
146
|
} },
|
153
147
|
React.createElement(DataSourceProvider, { isSsr: isSsr, enable: enableDataSource }, children)));
|
154
148
|
});
|
@@ -8,6 +8,10 @@ export interface IWaterFallDataType {
|
|
8
8
|
itemType?: 'VIDEO' | 'PRODUCT' | null;
|
9
9
|
rec: RecItemType;
|
10
10
|
}
|
11
|
+
export interface IEventTimeType {
|
12
|
+
time: Date;
|
13
|
+
target: EventTarget;
|
14
|
+
}
|
11
15
|
export interface ISxpDataSourceContext {
|
12
16
|
rtcList: RecItemType[];
|
13
17
|
setRtcList?: React.Dispatch<React.SetStateAction<RecItemType[]>>;
|
@@ -80,6 +84,10 @@ export interface ISxpDataSourceContext {
|
|
80
84
|
checkCommodityIndexRef?: any;
|
81
85
|
isEditor?: boolean;
|
82
86
|
isNoMoreData?: boolean;
|
87
|
+
updateChannel?: (d: string) => void;
|
88
|
+
channel?: string;
|
89
|
+
eventTimeList?: Array<IEventTimeType>;
|
90
|
+
setEventTimeList?: React.Dispatch<React.SetStateAction<Array<IEventTimeType>>>;
|
83
91
|
}
|
84
92
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
85
93
|
export interface SxpDataSourceProviderProps {
|
@@ -122,6 +130,7 @@ export interface SxpDataSourceProviderProps {
|
|
122
130
|
data?: PageData;
|
123
131
|
dataList?: PageData[];
|
124
132
|
onUpdateSchema?: (d: PageData['data']) => void;
|
133
|
+
onUpdateChannel?: (d: string) => void;
|
125
134
|
}
|
126
135
|
export declare const DEFAULT_TAG = "FOR U";
|
127
136
|
declare const _default: React.NamedExoticComponent<SxpDataSourceProviderProps>;
|
@@ -8,7 +8,6 @@ import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../utils/event';
|
|
8
8
|
import Consent from '../components/Consent';
|
9
9
|
import { getBrowserInfo, getCookie, getDevice, getSystem } from '../utils/tool';
|
10
10
|
import { cloneDeep } from 'lodash';
|
11
|
-
import { useEditor } from '../hooks/useEditor';
|
12
11
|
export const SxpDataSourceContext = createContext({
|
13
12
|
rtcList: [],
|
14
13
|
tagList: []
|
@@ -18,9 +17,8 @@ var DataSourceType;
|
|
18
17
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
19
18
|
})(DataSourceType || (DataSourceType = {}));
|
20
19
|
export const DEFAULT_TAG = 'FOR U';
|
21
|
-
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 }) => {
|
20
|
+
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 }) => {
|
22
21
|
var _a, _b, _c, _d, _e;
|
23
|
-
const { channel } = useEditor();
|
24
22
|
const [rtcList, setRtcList] = useState([]);
|
25
23
|
const [tagList, setTagList] = useState([]);
|
26
24
|
const [loading, setLoading] = useState(false);
|
@@ -45,11 +43,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
45
43
|
const [pageData, setPageData] = useState(data);
|
46
44
|
const [showConsent, setShowConsent] = useState(false);
|
47
45
|
const [layoutVariantId, setLayoutVariantId] = useState();
|
46
|
+
const [channel, setChannel] = useState();
|
47
|
+
const [eventTimeList, setEventTimeList] = useState([]);
|
48
48
|
const isShowConsent = useMemo(() => {
|
49
49
|
var _a, _b, _c, _d;
|
50
50
|
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) &&
|
51
51
|
showConsent);
|
52
52
|
}, [isAgreePolicy, globalConfig, isOpenConsent, isEditor, showConsent]);
|
53
|
+
const updateChannel = useCallback((d) => {
|
54
|
+
onUpdateChannel === null || onUpdateChannel === void 0 ? void 0 : onUpdateChannel(d);
|
55
|
+
setChannel(d);
|
56
|
+
}, []);
|
53
57
|
const getFilterRecList = useCallback((data) => {
|
54
58
|
var _a;
|
55
59
|
const recList = data === null || data === void 0 ? void 0 : data.recList;
|
@@ -63,6 +67,20 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
63
67
|
})) !== null && _a !== void 0 ? _a : [];
|
64
68
|
return nList;
|
65
69
|
}, []);
|
70
|
+
useEffect(() => {
|
71
|
+
let intervalId;
|
72
|
+
if (eventTimeList.length > 0) {
|
73
|
+
const checkTimes = () => {
|
74
|
+
const now = new Date();
|
75
|
+
const threshold = 15 * 1000;
|
76
|
+
setEventTimeList((prevArray) => prevArray.filter((item) => now - item.time <= threshold));
|
77
|
+
};
|
78
|
+
intervalId = setInterval(checkTimes, 1000);
|
79
|
+
}
|
80
|
+
return () => {
|
81
|
+
clearInterval(intervalId);
|
82
|
+
};
|
83
|
+
}, [eventTimeList]);
|
66
84
|
useEffect(() => {
|
67
85
|
const handleChangeThemeTag = (tag) => {
|
68
86
|
themeTag.current = tag;
|
@@ -478,7 +496,11 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
478
496
|
popupCurTimeRef,
|
479
497
|
checkCommodityIndexRef,
|
480
498
|
isEditor,
|
481
|
-
isNoMoreData
|
499
|
+
isNoMoreData,
|
500
|
+
updateChannel,
|
501
|
+
channel,
|
502
|
+
eventTimeList,
|
503
|
+
setEventTimeList
|
482
504
|
} }, isShowConsent ? (React.createElement(Consent, 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({
|
483
505
|
rtcList,
|
484
506
|
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, traceInfo?: string) => void;
|
3
|
+
jumpToWeb: (e: React.MouseEvent<HTMLElement>, 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
|
};
|
@@ -2,9 +2,16 @@ import { useCallback } from 'react';
|
|
2
2
|
import { useSxpDataSource } from './useSxpDataSource';
|
3
3
|
import { DEFAULT_TAG } from '../context/SxpDataSourceProvider';
|
4
4
|
export function useEventReport() {
|
5
|
-
const { bffEventReport, popupDetailData,
|
6
|
-
const jumpToWeb = useCallback((data, product, cta, position, traceInfo) => {
|
5
|
+
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
6
|
+
const jumpToWeb = useCallback((e, data, product, cta, position, traceInfo) => {
|
7
7
|
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;
|
8
|
+
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
9
|
+
if (i !== -1) {
|
10
|
+
return;
|
11
|
+
}
|
12
|
+
else if (e) {
|
13
|
+
setEventTimeList === null || setEventTimeList === void 0 ? void 0 : setEventTimeList((prev) => [...prev, { target: e === null || e === void 0 ? void 0 : e.target, time: new Date() }]);
|
14
|
+
}
|
8
15
|
let fromKName = '';
|
9
16
|
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))) {
|
10
17
|
fromKName = 'pdpPage';
|
@@ -32,7 +39,7 @@ export function useEventReport() {
|
|
32
39
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
33
40
|
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 }))
|
34
41
|
});
|
35
|
-
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
42
|
+
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
36
43
|
const productView = useCallback((data, product, cta, viewTime, position) => {
|
37
44
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
38
45
|
let fromKName = '';
|
@@ -2,14 +2,13 @@ import { __rest } from "tslib";
|
|
2
2
|
import { getBgStyle } from '../../../core/utils/materials';
|
3
3
|
import React, { memo, useCallback, useEffect, useRef } from 'react';
|
4
4
|
import './index.less';
|
5
|
-
import {
|
5
|
+
import { useSxpDataSource } from '../../../core/hooks';
|
6
6
|
import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../core/utils/event';
|
7
7
|
import { useSwiperSlide } from 'swiper/react';
|
8
8
|
const MultiPosts = (_a) => {
|
9
9
|
var _b, _c;
|
10
10
|
var { bgImgUrl, style, recData } = _a, props = __rest(_a, ["bgImgUrl", "style", "recData"]);
|
11
|
-
const {
|
12
|
-
const { bffEventReport, curTime } = useSxpDataSource();
|
11
|
+
const { bffEventReport, curTime, updateChannel } = useSxpDataSource();
|
13
12
|
const { isActive } = useSwiperSlide() || {};
|
14
13
|
const initRef = useRef(false);
|
15
14
|
const viewTime = useRef();
|
@@ -39,7 +38,7 @@ const MultiPosts = (_a) => {
|
|
39
38
|
});
|
40
39
|
if ((v === null || v === void 0 ? void 0 : v.linkType) === 'recommendFlow') {
|
41
40
|
endMultiPost('multipostClick');
|
42
|
-
|
41
|
+
updateChannel === null || updateChannel === void 0 ? void 0 : updateChannel(value);
|
43
42
|
curTime.current = new Date();
|
44
43
|
}
|
45
44
|
else {
|
@@ -16,7 +16,7 @@ const AniLink = (_a) => {
|
|
16
16
|
const isOnScreen = useOnScreen(ref);
|
17
17
|
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);
|
18
18
|
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);
|
19
|
-
const handleTo = () => {
|
19
|
+
const handleTo = (e) => {
|
20
20
|
var _a, _b, _c, _d;
|
21
21
|
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);
|
22
22
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -27,7 +27,7 @@ const AniLink = (_a) => {
|
|
27
27
|
if (isExternalLink) {
|
28
28
|
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);
|
29
29
|
if (link) {
|
30
|
-
jumpToWeb(recData, product, cta, index);
|
30
|
+
jumpToWeb(e, recData, product, cta, index);
|
31
31
|
window.location.href = window.getJointUtmLink(link);
|
32
32
|
}
|
33
33
|
}
|
@@ -16,7 +16,7 @@ const AniLinkPopup = (_a) => {
|
|
16
16
|
const [visible, setVisible] = useState(true);
|
17
17
|
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);
|
18
18
|
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);
|
19
|
-
const handleTo = () => {
|
19
|
+
const handleTo = (e) => {
|
20
20
|
var _a, _b, _c, _d;
|
21
21
|
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);
|
22
22
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -27,7 +27,7 @@ const AniLinkPopup = (_a) => {
|
|
27
27
|
if (isExternalLink) {
|
28
28
|
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);
|
29
29
|
if (link) {
|
30
|
-
jumpToWeb(recData, product, cta, index);
|
30
|
+
jumpToWeb(e, recData, product, cta, index);
|
31
31
|
window.location.href = window.getJointUtmLink(link);
|
32
32
|
}
|
33
33
|
}
|
@@ -49,7 +49,7 @@ const AppointForm = (_a) => {
|
|
49
49
|
const { name, value } = e.target;
|
50
50
|
setFormData(Object.assign(Object.assign({}, formData), { [name]: value }));
|
51
51
|
}, [formData]);
|
52
|
-
const handleSubmit = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
52
|
+
const handleSubmit = debounce((e) => __awaiter(void 0, void 0, void 0, function* () {
|
53
53
|
var _d, _e, _f, _g, _h;
|
54
54
|
const vals = formData;
|
55
55
|
if (!vals)
|
@@ -72,7 +72,7 @@ const AppointForm = (_a) => {
|
|
72
72
|
const product = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
73
73
|
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;
|
74
74
|
const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
75
|
-
jumpToWeb(data, product, cta, position);
|
75
|
+
jumpToWeb(e, data, product, cta, position);
|
76
76
|
}
|
77
77
|
if (!isPopup) {
|
78
78
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
@@ -35,9 +35,9 @@ const CommodityDetail = (_a) => {
|
|
35
35
|
product = p;
|
36
36
|
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
37
37
|
}
|
38
|
-
const handleLink = () => {
|
38
|
+
const handleLink = (e) => {
|
39
39
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
40
|
-
jumpToWeb(data, product, cta, position);
|
40
|
+
jumpToWeb(e, data, product, cta, position);
|
41
41
|
if (!isPost) {
|
42
42
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
43
43
|
}
|
@@ -39,9 +39,9 @@ const CommodityDetailDiroNew = (_a) => {
|
|
39
39
|
product = p;
|
40
40
|
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
41
41
|
}
|
42
|
-
const handleLink = () => {
|
42
|
+
const handleLink = (e) => {
|
43
43
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
44
|
-
jumpToWeb(data, product, cta, position);
|
44
|
+
jumpToWeb(e, data, product, cta, position);
|
45
45
|
if (!isPost) {
|
46
46
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
47
47
|
}
|
@@ -26,7 +26,7 @@ const CommodityList = (_a) => {
|
|
26
26
|
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
27
27
|
});
|
28
28
|
}, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
|
29
|
-
const handleClick = throttle((item, multiCheckIndex) => {
|
29
|
+
const handleClick = throttle((item, multiCheckIndex, e) => {
|
30
30
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
31
31
|
eventSubject: 'clickCta',
|
32
32
|
eventDescription: 'User clicked the CTA'
|
@@ -34,7 +34,7 @@ const CommodityList = (_a) => {
|
|
34
34
|
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 }));
|
35
35
|
if (isExternalLink) {
|
36
36
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
37
|
-
jumpToWeb(recData, item, item.bindCta, index);
|
37
|
+
jumpToWeb(e, recData, item, item.bindCta, index);
|
38
38
|
window.location.href = window.getJointUtmLink(item.link);
|
39
39
|
}
|
40
40
|
}
|
@@ -49,7 +49,7 @@ const CommodityList = (_a) => {
|
|
49
49
|
}, []);
|
50
50
|
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) => {
|
51
51
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
52
|
-
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) },
|
52
|
+
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) },
|
53
53
|
React.createElement("button", Object.assign({ role: 'button', "aria-label": item === null || item === void 0 ? void 0 : item.title, tabIndex: 0, className: css({
|
54
54
|
display: 'flex',
|
55
55
|
alignItems: 'normal',
|
@@ -12,14 +12,14 @@ const Prompt = (_a) => {
|
|
12
12
|
const { popupDetailData } = useSxpDataSource();
|
13
13
|
const { jumpToWeb } = useEventReport();
|
14
14
|
const iconSrc = typeof icon === 'string' ? icon : getMediaValueByMode(icon);
|
15
|
-
const handleOk = () => {
|
15
|
+
const handleOk = (e) => {
|
16
16
|
var _a, _b, _c;
|
17
17
|
if (isExternalLink) {
|
18
18
|
const data = popupDetailData;
|
19
19
|
const product = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProduct;
|
20
20
|
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;
|
21
21
|
const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
22
|
-
jumpToWeb(data, product, cta, position);
|
22
|
+
jumpToWeb(e, data, product, cta, position);
|
23
23
|
}
|
24
24
|
if (!isPopup) {
|
25
25
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
@@ -3,15 +3,13 @@ import { css } from '@emotion/css';
|
|
3
3
|
import React, { memo } from 'react';
|
4
4
|
import EventProvider from '../components/EventProvider';
|
5
5
|
import { useSxpDataSource } from '../../../../core/hooks';
|
6
|
-
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
7
6
|
import Img from '../components/Img';
|
8
7
|
import { setFontForText } from '../../../../core/utils/tool';
|
9
8
|
import styles from './index.module.less';
|
10
9
|
const Link = (_a) => {
|
11
10
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
12
11
|
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"]);
|
13
|
-
const { sxpParameter
|
14
|
-
const { jumpToWeb } = useEventReport();
|
12
|
+
const { sxpParameter } = useSxpDataSource();
|
15
13
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
16
14
|
const product = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
|
17
15
|
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;
|
@@ -10,9 +10,9 @@ const EventProvider = (_a) => {
|
|
10
10
|
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
11
11
|
const { jumpToWeb } = useEventReport();
|
12
12
|
const [element, setElement] = useState(null);
|
13
|
-
const handleClick = throttle((
|
13
|
+
const handleClick = throttle((e) => {
|
14
14
|
var _a, _b, _c, _d, _e, _f;
|
15
|
-
|
15
|
+
e.preventDefault();
|
16
16
|
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;
|
17
17
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
18
18
|
eventSubject: 'clickCta',
|
@@ -26,7 +26,7 @@ const EventProvider = (_a) => {
|
|
26
26
|
if (jumpLink || link) {
|
27
27
|
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);
|
28
28
|
const product = ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct) || multItem;
|
29
|
-
jumpToWeb(rec, product, cta, index);
|
29
|
+
jumpToWeb(e, rec, product, cta, index);
|
30
30
|
window.location.href = window.getJointUtmLink(jumpLink || link || '');
|
31
31
|
}
|
32
32
|
}
|
@@ -19,8 +19,9 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
|
|
19
19
|
return searchParams;
|
20
20
|
}, []);
|
21
21
|
const [_schema, setSchema] = (0, react_1.useState)(data === null || data === void 0 ? void 0 : data.data);
|
22
|
-
|
23
|
-
|
22
|
+
const [channel, setChannel] = (0, react_1.useState)();
|
23
|
+
return (react_1.default.createElement(core_1.EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: _schema, utmVal: channel || utmVal },
|
24
|
+
react_1.default.createElement(SxpDataSourceProvider_1.default, { 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 }) => {
|
24
25
|
var _a;
|
25
26
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
26
27
|
react_1.default.createElement(SxpPageRender_1.default, 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 })),
|
@@ -163,12 +163,12 @@ function WaterfallList(_a) {
|
|
163
163
|
setIsLoadingData(false);
|
164
164
|
}
|
165
165
|
}, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
|
166
|
-
const handleClickLink = () => {
|
166
|
+
const handleClickLink = (e) => {
|
167
167
|
var _a, _b, _c, _d, _e;
|
168
168
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
169
169
|
reportTagsView();
|
170
170
|
const rec = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec;
|
171
|
-
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);
|
171
|
+
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);
|
172
172
|
window.location.href = window.getJointUtmLink((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link);
|
173
173
|
}
|
174
174
|
};
|
@@ -271,12 +271,12 @@ function WaterfallList(_a) {
|
|
271
271
|
(_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('scroll', onScroll);
|
272
272
|
};
|
273
273
|
}, [onScroll, scrollParent]);
|
274
|
-
const handleClickLink = () => {
|
274
|
+
const handleClickLink = (e) => {
|
275
275
|
var _a, _b, _c, _d, _e;
|
276
276
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
277
277
|
reportTagsView();
|
278
278
|
const rec = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec;
|
279
|
-
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);
|
279
|
+
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);
|
280
280
|
window.location.href = window.getJointUtmLink((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link);
|
281
281
|
}
|
282
282
|
};
|
@@ -33,7 +33,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
33
33
|
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;
|
34
34
|
const mutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
35
35
|
const unmutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
36
|
-
const { schema
|
36
|
+
const { schema } = (0, hooks_1.useEditor)();
|
37
37
|
const { openMultiPosts } = (0, EditorDataProvider_1.useEditorDataProvider)();
|
38
38
|
const [activeIndex, setActiveIndex] = (0, react_1.useState)(0);
|
39
39
|
const viewImageStartTime = (0, react_1.useRef)(0);
|
@@ -44,7 +44,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
44
44
|
const [isReload, setIsReload] = (0, react_1.useState)(new Date().getTime());
|
45
45
|
const skipLinkRef = (0, react_1.useRef)(false);
|
46
46
|
const [pageNum, setPageNum] = (0, react_1.useState)(2);
|
47
|
-
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 } = (0, hooks_1.useSxpDataSource)();
|
47
|
+
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 } = (0, hooks_1.useSxpDataSource)();
|
48
48
|
const { backMainFeed, productView, jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
49
49
|
const isShowFingerTip = (0, react_1.useMemo)(() => {
|
50
50
|
return data.length > 0 && !loading && ((0, localStore_1.getFeUserState)() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
|
@@ -203,10 +203,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
203
203
|
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';
|
204
204
|
const rec = visList[activeIndex];
|
205
205
|
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 && {
|
206
|
-
onClick: () => {
|
206
|
+
onClick: (e) => {
|
207
207
|
var _a, _b, _c, _d;
|
208
208
|
if (isExternalLink) {
|
209
|
-
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
|
+
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));
|
210
210
|
}
|
211
211
|
new Function(link)();
|
212
212
|
}
|
@@ -62,8 +62,6 @@ export interface IEditorContext {
|
|
62
62
|
getCurPageConf?: any;
|
63
63
|
popup: IPopupType;
|
64
64
|
setPopup: React.Dispatch<React.SetStateAction<IPopupType>>;
|
65
|
-
channel?: string | undefined;
|
66
|
-
setChannel?: React.Dispatch<React.SetStateAction<string | undefined>>;
|
67
65
|
}
|
68
66
|
export interface IEditorCoreProps {
|
69
67
|
resolver: Record<string, MaterialComponet>;
|