pb-sxp-ui 1.0.80 → 1.0.81
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 +321 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +93 -0
- package/dist/index.js +322 -86
- 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 +321 -85
- 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/Pagebuilder/type.d.ts +7 -0
- package/es/core/components/Consent/index.d.ts +13 -0
- package/es/core/components/Consent/index.js +60 -0
- package/es/core/components/SxpPageCore/index.js +2 -2
- package/es/core/components/SxpPageRender/Tagbar.js +15 -1
- package/es/core/components/SxpPageRender/WaterFall/List.d.ts +1 -1
- package/es/core/components/SxpPageRender/WaterFall/List.js +15 -9
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.d.ts +1 -1
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +18 -12
- package/es/core/components/SxpPageRender/WaterFall/index.js +7 -2
- package/es/core/components/SxpPageRender/index.d.ts +2 -1
- package/es/core/components/SxpPageRender/index.js +30 -10
- package/es/core/components/SxpPageRender/typing.d.ts +1 -0
- package/es/core/context/EditorDataProvider.d.ts +9 -0
- package/es/core/context/EditorDataProvider.js +13 -3
- package/es/core/context/SxpDataSourceProvider.d.ts +10 -0
- package/es/core/context/SxpDataSourceProvider.js +37 -21
- package/es/core/hooks/useEventReport.d.ts +1 -0
- package/es/core/hooks/useEventReport.js +13 -1
- package/es/core/utils/localStore.d.ts +1 -0
- package/es/core/utils/localStore.js +1 -0
- package/es/materials/sxp/Consent/index.d.ts +12 -0
- package/es/materials/sxp/Consent/index.js +5 -0
- package/es/materials/sxp/Consent/material.d.ts +2 -0
- package/es/materials/sxp/Consent/material.js +20 -0
- package/es/materials/sxp/Consent/settingRender.d.ts +31 -0
- package/es/materials/sxp/Consent/settingRender.js +39 -0
- package/es/materials/sxp/HashTag/index.d.ts +1 -1
- package/es/materials/sxp/HashTag/settingRender.js +1 -1
- package/es/materials/sxp/index.d.ts +1 -0
- package/es/materials/sxp/index.js +1 -0
- package/lib/core/Pagebuilder/type.d.ts +7 -0
- package/lib/core/components/Consent/index.d.ts +13 -0
- package/lib/core/components/Consent/index.js +63 -0
- package/lib/core/components/SxpPageCore/index.js +2 -2
- package/lib/core/components/SxpPageRender/Tagbar.js +15 -1
- package/lib/core/components/SxpPageRender/WaterFall/List.d.ts +1 -1
- package/lib/core/components/SxpPageRender/WaterFall/List.js +15 -9
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.d.ts +1 -1
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +18 -12
- package/lib/core/components/SxpPageRender/WaterFall/index.js +7 -2
- package/lib/core/components/SxpPageRender/index.d.ts +2 -1
- package/lib/core/components/SxpPageRender/index.js +30 -10
- package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
- package/lib/core/context/EditorDataProvider.d.ts +9 -0
- package/lib/core/context/EditorDataProvider.js +13 -3
- package/lib/core/context/SxpDataSourceProvider.d.ts +10 -0
- package/lib/core/context/SxpDataSourceProvider.js +36 -20
- package/lib/core/hooks/useEventReport.d.ts +1 -0
- package/lib/core/hooks/useEventReport.js +13 -1
- package/lib/core/utils/localStore.d.ts +1 -0
- package/lib/core/utils/localStore.js +2 -1
- package/lib/materials/sxp/Consent/index.d.ts +12 -0
- package/lib/materials/sxp/Consent/index.js +8 -0
- package/lib/materials/sxp/Consent/material.d.ts +2 -0
- package/lib/materials/sxp/Consent/material.js +24 -0
- package/lib/materials/sxp/Consent/settingRender.d.ts +31 -0
- package/lib/materials/sxp/Consent/settingRender.js +41 -0
- package/lib/materials/sxp/HashTag/index.d.ts +1 -1
- package/lib/materials/sxp/HashTag/settingRender.js +1 -1
- package/lib/materials/sxp/index.d.ts +1 -0
- package/lib/materials/sxp/index.js +1 -0
- package/package.json +1 -1
@@ -2,9 +2,10 @@ import { __awaiter } from "tslib";
|
|
2
2
|
import React, { createContext, memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
3
3
|
import qs from 'qs';
|
4
4
|
import { storeAndLoadFeSessionId } from '../utils/sessionStore';
|
5
|
-
import { storeAndLoadFeUserId } from '../utils/localStore';
|
5
|
+
import { storeAndLoadFeUserId, AGREE_POLICY } from '../utils/localStore';
|
6
6
|
import { useIconLink } from '../components/SxpPageRender/useIconLink';
|
7
7
|
import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../utils/event';
|
8
|
+
import Consent from '../components/Consent';
|
8
9
|
export const SxpDataSourceContext = createContext({
|
9
10
|
rtcList: [],
|
10
11
|
tagList: []
|
@@ -14,13 +15,15 @@ var DataSourceType;
|
|
14
15
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
15
16
|
})(DataSourceType || (DataSourceType = {}));
|
16
17
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
17
|
-
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, isShowTag = true }) => {
|
18
|
+
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig }) => {
|
19
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
18
20
|
const [rtcList, setRtcList] = useState([]);
|
19
21
|
const [tagList, setTagList] = useState([]);
|
20
22
|
const [loading, setLoading] = useState(false);
|
21
23
|
const [curReqInfo, setCurReqInfo] = useState({ rtc: '', requestId: '' });
|
22
24
|
const swiperRef = useRef(null);
|
23
25
|
const isInit = useRef(false);
|
26
|
+
const [isAgreePolicy, setIsAgreePolicy] = useState(() => !!window.localStorage.getItem(AGREE_POLICY));
|
24
27
|
const [popupDetailData, setPopupDetailData] = useState();
|
25
28
|
const [waterFallData, setWaterFallData] = useState();
|
26
29
|
const [openHashtag, setOpenHashtag] = useState(isOpenHashTag);
|
@@ -29,6 +32,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
29
32
|
const [isFromHashtag, setIsFromHashtag] = useState(false);
|
30
33
|
const [videoRef, setVideoRef] = useState(null);
|
31
34
|
const themeTag = useRef();
|
35
|
+
const curTime = useRef();
|
32
36
|
useEffect(() => {
|
33
37
|
const handleChangeThemeTag = (tag) => {
|
34
38
|
themeTag.current = tag;
|
@@ -68,10 +72,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
68
72
|
.catch((err) => Promise.reject(err));
|
69
73
|
}, [bffDataSource]);
|
70
74
|
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
71
|
-
var
|
75
|
+
var _h, _j, _k, _l, _m;
|
72
76
|
query = {
|
73
|
-
maxSize: (
|
74
|
-
defaultSize: (
|
77
|
+
maxSize: (_h = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _h !== void 0 ? _h : maxSize,
|
78
|
+
defaultSize: (_j = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _j !== void 0 ? _j : defaultSize,
|
75
79
|
'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
|
76
80
|
'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
|
77
81
|
hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
|
@@ -79,10 +83,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
79
83
|
themeTag: query === null || query === void 0 ? void 0 : query.themeTag
|
80
84
|
};
|
81
85
|
if (utmVal) {
|
82
|
-
const val = (
|
86
|
+
const val = (_m = (_l = (_k = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _k === void 0 ? void 0 : _k.filter((val) => {
|
83
87
|
const key = val.split('=')[0];
|
84
88
|
return UTM_KEYS.includes(key);
|
85
|
-
})) === null ||
|
89
|
+
})) === null || _l === void 0 ? void 0 : _l.join('&')) !== null && _m !== void 0 ? _m : '';
|
86
90
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
87
91
|
}
|
88
92
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
@@ -94,7 +98,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
94
98
|
return result === null || result === void 0 ? void 0 : result.data;
|
95
99
|
}), [bffFetch, utmVal, maxSize, defaultSize]);
|
96
100
|
const loadVideos = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
97
|
-
var
|
101
|
+
var _o, _p;
|
98
102
|
if (rtcList.length <= 0) {
|
99
103
|
return;
|
100
104
|
}
|
@@ -104,8 +108,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
104
108
|
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
105
109
|
themeTag: themeTag.current
|
106
110
|
});
|
107
|
-
setRtcList(rtcList.concat((
|
108
|
-
setCacheRtcList(cacheRtcList.concat((
|
111
|
+
setRtcList(rtcList.concat((_o = data === null || data === void 0 ? void 0 : data.recList) !== null && _o !== void 0 ? _o : []));
|
112
|
+
setCacheRtcList(cacheRtcList.concat((_p = data === null || data === void 0 ? void 0 : data.recList) !== null && _p !== void 0 ? _p : []));
|
109
113
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
110
114
|
const bffEventReport = useCallback(({ userInfo, eventInfo }) => {
|
111
115
|
if (!enableReportEvent) {
|
@@ -163,16 +167,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
163
167
|
return res === null || res === void 0 ? void 0 : res.success;
|
164
168
|
}), [bffFetch]);
|
165
169
|
const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
166
|
-
var
|
170
|
+
var _q, _r, _s, _t, _u;
|
167
171
|
if (!utmVal || !isShowTag)
|
168
172
|
return;
|
169
173
|
try {
|
170
|
-
const val = (
|
174
|
+
const val = (_s = (_r = (_q = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _q === void 0 ? void 0 : _q.filter((val) => {
|
171
175
|
const key = val.split('=')[0];
|
172
176
|
return UTM_KEYS.includes(key);
|
173
|
-
})) === null ||
|
177
|
+
})) === null || _r === void 0 ? void 0 : _r.join('&')) !== null && _s !== void 0 ? _s : '';
|
174
178
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
175
|
-
setTagList((
|
179
|
+
setTagList((_u = (_t = result === null || result === void 0 ? void 0 : result.data) === null || _t === void 0 ? void 0 : _t.tags) !== null && _u !== void 0 ? _u : []);
|
176
180
|
}
|
177
181
|
catch (e) {
|
178
182
|
console.log('e', e);
|
@@ -196,7 +200,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
196
200
|
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : '', fromKName })
|
197
201
|
});
|
198
202
|
}, [bffEventReport, isFromHashtag]);
|
199
|
-
|
203
|
+
const h5EnterLink = useCallback(() => {
|
200
204
|
var _a, _b;
|
201
205
|
const queryString = location.search.slice(1);
|
202
206
|
const params = qs.parse(queryString.replace(/\+/g, '%2B'));
|
@@ -204,6 +208,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
204
208
|
params[key] = params[key].replace(/%2B/g, '+');
|
205
209
|
}
|
206
210
|
const getVal = (key) => { var _a; return (_a = params[key]) !== null && _a !== void 0 ? _a : ''; };
|
211
|
+
const time = new Date();
|
212
|
+
curTime.current = time;
|
207
213
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
208
214
|
eventInfo: {
|
209
215
|
eventSubject: 'h5LinkEnterFeed',
|
@@ -213,14 +219,19 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
213
219
|
utmCampaign: getVal('utm_campaign'),
|
214
220
|
utmId: getVal('utm_id'),
|
215
221
|
utmContent: getVal('utm_content'),
|
216
|
-
enterTime:
|
222
|
+
enterTime: Math.floor(time / 1000) + '',
|
217
223
|
requestId: null,
|
218
224
|
enterUrl: (_b = (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.href) !== null && _b !== void 0 ? _b : '',
|
219
|
-
clSource: getVal('
|
225
|
+
clSource: getVal('cl_source')
|
220
226
|
}
|
221
227
|
});
|
228
|
+
}, [bffEventReport]);
|
229
|
+
useEffect(() => {
|
230
|
+
h5EnterLink();
|
222
231
|
}, []);
|
223
232
|
useEffect(() => {
|
233
|
+
if (!isAgreePolicy)
|
234
|
+
return;
|
224
235
|
setLoading(true);
|
225
236
|
bffGetTagList();
|
226
237
|
getRecommendVideos()
|
@@ -239,7 +250,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
239
250
|
setLoading(false);
|
240
251
|
isInit.current = true;
|
241
252
|
});
|
242
|
-
}, []);
|
253
|
+
}, [isAgreePolicy]);
|
243
254
|
useEffect(() => {
|
244
255
|
if (!isInit.current)
|
245
256
|
return;
|
@@ -291,13 +302,18 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
291
302
|
setLoading,
|
292
303
|
videoRef,
|
293
304
|
setVideoRef,
|
294
|
-
bffFbReport
|
295
|
-
|
305
|
+
bffFbReport,
|
306
|
+
isAgreePolicy,
|
307
|
+
setIsAgreePolicy,
|
308
|
+
curTime,
|
309
|
+
h5EnterLink,
|
310
|
+
themeTag
|
311
|
+
} }, (((_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) || isOpenConsent ? (React.createElement(Consent, Object.assign({}, (_g = (_f = (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.item) === null || _g === void 0 ? void 0 : _g.props))) : (render({
|
296
312
|
rtcList,
|
297
313
|
mutateLike: bffMutateLike,
|
298
314
|
mutateUnlike: bffMutateUnlike,
|
299
315
|
submitForm: bffSubmitForm,
|
300
316
|
tagList
|
301
|
-
})));
|
317
|
+
}))));
|
302
318
|
};
|
303
319
|
export default memo(SxpDataSourceProvider);
|
@@ -2,4 +2,5 @@ import { RecItemType } from '../components/SxpPageRender/typing';
|
|
2
2
|
export declare function useEventReport(): {
|
3
3
|
jumpToWeb: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], position?: number) => void;
|
4
4
|
productView: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], viewTime?: any, position?: number) => void;
|
5
|
+
backMainFeed: (lastFeed?: 'theme' | 'branch' | 'external', themeTag?: string, hashTag?: string) => void;
|
5
6
|
};
|
@@ -66,8 +66,20 @@ export function useEventReport() {
|
|
66
66
|
}
|
67
67
|
});
|
68
68
|
}, [bffEventReport, popupDetailData]);
|
69
|
+
const backMainFeed = useCallback((lastFeed, themeTag, hashTag) => {
|
70
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
71
|
+
eventInfo: {
|
72
|
+
lastFeed,
|
73
|
+
themeTags: themeTag ? `[${themeTag}]` : '',
|
74
|
+
hashTags: hashTag ? `[${hashTag}]` : '',
|
75
|
+
eventSubject: 'backMainFeed',
|
76
|
+
eventDescription: 'back Main Feed'
|
77
|
+
}
|
78
|
+
});
|
79
|
+
}, [bffEventReport]);
|
69
80
|
return {
|
70
81
|
jumpToWeb,
|
71
|
-
productView
|
82
|
+
productView,
|
83
|
+
backMainFeed
|
72
84
|
};
|
73
85
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
export declare const FAKE_USER_KEY = "SXP_FAKE_USER_ID";
|
2
2
|
export declare const FAKE_USER_STATE = "FAKE_USER_STATE";
|
3
|
+
export declare const AGREE_POLICY = "AGREE_POLICY";
|
3
4
|
export declare const storeAndLoadFeUserId: () => string;
|
4
5
|
export declare const removeFeUserId: () => void;
|
5
6
|
export declare const getFeUserId: () => boolean;
|
@@ -2,6 +2,7 @@ import { isEmpty } from 'lodash';
|
|
2
2
|
import { uuid } from './tool';
|
3
3
|
export const FAKE_USER_KEY = 'SXP_FAKE_USER_ID';
|
4
4
|
export const FAKE_USER_STATE = 'FAKE_USER_STATE';
|
5
|
+
export const AGREE_POLICY = 'AGREE_POLICY';
|
5
6
|
export const storeAndLoadFeUserId = () => {
|
6
7
|
let fakeUserId = window.localStorage.getItem(FAKE_USER_KEY);
|
7
8
|
if (isEmpty(fakeUserId)) {
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
export interface IConsentProps {
|
3
|
+
width?: number;
|
4
|
+
height?: number;
|
5
|
+
privacy_title?: string;
|
6
|
+
privacy_context?: string;
|
7
|
+
privacy_policy_url?: string;
|
8
|
+
privacy_policy_title?: string;
|
9
|
+
privacy_necessity?: boolean;
|
10
|
+
}
|
11
|
+
declare const _default: React.NamedExoticComponent<IConsentProps>;
|
12
|
+
export default _default;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import settingRender from './settingRender';
|
2
|
+
import ConsentComponent from '.';
|
3
|
+
import { createMaterial } from '../../../core/create';
|
4
|
+
const Consent = createMaterial(ConsentComponent, {
|
5
|
+
displayName: 'Consent',
|
6
|
+
icon: '',
|
7
|
+
category: 'base',
|
8
|
+
type: 'Consent',
|
9
|
+
related: {
|
10
|
+
settingRender
|
11
|
+
},
|
12
|
+
defaulSetting: {
|
13
|
+
props: {},
|
14
|
+
style: {}
|
15
|
+
},
|
16
|
+
w: 100,
|
17
|
+
h: 40,
|
18
|
+
sort: 1
|
19
|
+
});
|
20
|
+
export { Consent };
|
@@ -0,0 +1,31 @@
|
|
1
|
+
declare const _default: {
|
2
|
+
title: string;
|
3
|
+
child: ({
|
4
|
+
type: string;
|
5
|
+
label: string;
|
6
|
+
name: string[];
|
7
|
+
extra: string;
|
8
|
+
child?: undefined;
|
9
|
+
} | {
|
10
|
+
type: string;
|
11
|
+
label: string;
|
12
|
+
name: string[];
|
13
|
+
extra?: undefined;
|
14
|
+
child?: undefined;
|
15
|
+
} | {
|
16
|
+
type: string;
|
17
|
+
label: string;
|
18
|
+
child: ({
|
19
|
+
type: string;
|
20
|
+
name: string[];
|
21
|
+
addonBefore?: undefined;
|
22
|
+
} | {
|
23
|
+
type: string;
|
24
|
+
name: string[];
|
25
|
+
addonBefore: string;
|
26
|
+
})[];
|
27
|
+
extra: string;
|
28
|
+
name?: undefined;
|
29
|
+
})[];
|
30
|
+
}[];
|
31
|
+
export default _default;
|
@@ -0,0 +1,39 @@
|
|
1
|
+
export default [
|
2
|
+
{
|
3
|
+
title: '协议详情',
|
4
|
+
child: [
|
5
|
+
{
|
6
|
+
type: 'Switch',
|
7
|
+
label: '必须同意用户协议',
|
8
|
+
name: ['props', 'privacy_necessity'],
|
9
|
+
extra: '当新用户进入页面时,会出现用户协议弹窗,用户需要先同意协议后才能访问内容。'
|
10
|
+
},
|
11
|
+
{
|
12
|
+
type: 'Text',
|
13
|
+
label: '弹窗标题',
|
14
|
+
name: ['props', 'privacy_title']
|
15
|
+
},
|
16
|
+
{
|
17
|
+
type: 'TextArea',
|
18
|
+
label: '用户协议弹窗内容',
|
19
|
+
name: ['props', 'privacy_context']
|
20
|
+
},
|
21
|
+
{
|
22
|
+
type: 'Group',
|
23
|
+
label: '隐私政策',
|
24
|
+
child: [
|
25
|
+
{
|
26
|
+
type: 'Text',
|
27
|
+
name: ['props', 'privacy_policy_title']
|
28
|
+
},
|
29
|
+
{
|
30
|
+
type: 'Text',
|
31
|
+
name: ['props', 'privacy_policy_url'],
|
32
|
+
addonBefore: 'https://'
|
33
|
+
}
|
34
|
+
],
|
35
|
+
extra: '当用户点击更多信息按钮时,将会跳转至设置的链接查看政策内容'
|
36
|
+
}
|
37
|
+
]
|
38
|
+
}
|
39
|
+
];
|
@@ -19,6 +19,13 @@ export interface PageData {
|
|
19
19
|
placeholder_image: string;
|
20
20
|
hash_tag_size: number;
|
21
21
|
loading_image: string;
|
22
|
+
industry?: string;
|
23
|
+
privacy_context?: string;
|
24
|
+
privacy_necessity?: boolean;
|
25
|
+
privacy_policy_title?: string;
|
26
|
+
privacy_policy_url?: string;
|
27
|
+
privacy_title?: string;
|
28
|
+
template?: any | null;
|
22
29
|
};
|
23
30
|
}
|
24
31
|
export interface DataSource {
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import './index.less';
|
3
|
+
export interface IConsentProps {
|
4
|
+
width?: number;
|
5
|
+
height?: number;
|
6
|
+
privacy_title?: string;
|
7
|
+
privacy_context?: string;
|
8
|
+
privacy_policy_url?: string;
|
9
|
+
privacy_policy_title?: string;
|
10
|
+
privacy_necessity?: boolean;
|
11
|
+
}
|
12
|
+
declare const _default: React.NamedExoticComponent<IConsentProps>;
|
13
|
+
export default _default;
|
@@ -0,0 +1,63 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const tslib_1 = require("tslib");
|
4
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
5
|
+
const qs_1 = tslib_1.__importDefault(require("qs"));
|
6
|
+
const hooks_1 = require("../../../core/hooks");
|
7
|
+
require("./index.less");
|
8
|
+
const localStore_1 = require("../../../core/utils/localStore");
|
9
|
+
const Consent = ({ width = window.innerWidth, height = window.innerHeight, privacy_title, privacy_context, privacy_policy_url, privacy_policy_title }) => {
|
10
|
+
const { setIsAgreePolicy, bffEventReport } = (0, hooks_1.useSxpDataSource)();
|
11
|
+
const channelObj = (0, react_1.useMemo)(() => {
|
12
|
+
const queryString = location.search.slice(1);
|
13
|
+
const params = qs_1.default.parse(queryString.replace(/\+/g, '%2B'));
|
14
|
+
for (const key in params) {
|
15
|
+
params[key] = params[key].replace(/%2B/g, '+');
|
16
|
+
}
|
17
|
+
return params;
|
18
|
+
}, []);
|
19
|
+
const getUtmValue = (key) => { var _a; return (_a = channelObj[key]) !== null && _a !== void 0 ? _a : null; };
|
20
|
+
(0, react_1.useEffect)(() => {
|
21
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
22
|
+
eventInfo: {
|
23
|
+
eventSubject: 'privacyEnter',
|
24
|
+
eventDescription: 'User enter privacy page',
|
25
|
+
utmSource: getUtmValue('utm_source'),
|
26
|
+
utmMedium: getUtmValue('utm_medium'),
|
27
|
+
utmCampaign: getUtmValue('utm_campaign'),
|
28
|
+
utmId: getUtmValue('utm_id'),
|
29
|
+
utmContent: getUtmValue('utm_content'),
|
30
|
+
clSource: getUtmValue('cl_source'),
|
31
|
+
enterTime: `${Date.now()}`,
|
32
|
+
enterUrl: window.location.href,
|
33
|
+
rtc: null,
|
34
|
+
requestId: null,
|
35
|
+
sessionID: null
|
36
|
+
}
|
37
|
+
});
|
38
|
+
}, []);
|
39
|
+
const handleAgree = () => {
|
40
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
41
|
+
eventInfo: {
|
42
|
+
eventSubject: 'userConsent',
|
43
|
+
eventDescription: '用户授权【操作结果】',
|
44
|
+
consentResult: '0',
|
45
|
+
consentTags: '[]',
|
46
|
+
rtc: null,
|
47
|
+
requestId: null,
|
48
|
+
sessionID: null
|
49
|
+
}
|
50
|
+
});
|
51
|
+
setIsAgreePolicy === null || setIsAgreePolicy === void 0 ? void 0 : setIsAgreePolicy(true);
|
52
|
+
window.localStorage.setItem(localStore_1.AGREE_POLICY, 'yes');
|
53
|
+
};
|
54
|
+
return (react_1.default.createElement("div", { className: 'consent-bg' },
|
55
|
+
react_1.default.createElement("div", { className: 'consent' },
|
56
|
+
react_1.default.createElement("div", { className: 'consent-col' },
|
57
|
+
react_1.default.createElement("div", { className: 'consent-title' }, privacy_title !== null && privacy_title !== void 0 ? privacy_title : 'Privacy Policy'),
|
58
|
+
react_1.default.createElement("div", { className: 'consent-content' }, privacy_context !== null && privacy_context !== void 0 ? privacy_context : 'This site uses cookies to improve your online experience. By continuing to use the site please agree the policy first.')),
|
59
|
+
react_1.default.createElement("div", { className: 'consent-col' },
|
60
|
+
react_1.default.createElement("button", { className: 'consent-btn', onClick: handleAgree }, "Agree"),
|
61
|
+
react_1.default.createElement("a", { className: 'consent-policy', target: '_blank', href: privacy_policy_url }, privacy_policy_title !== null && privacy_policy_title !== void 0 ? privacy_policy_title : 'More information')))));
|
62
|
+
};
|
63
|
+
exports.default = (0, react_1.memo)(Consent);
|
@@ -12,14 +12,14 @@ Object.values(_materials_).forEach((v) => {
|
|
12
12
|
RESOLVER[v.extend.type] = v;
|
13
13
|
});
|
14
14
|
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl, enabledMetaConversionApi }) => {
|
15
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
15
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
16
16
|
const utmVal = (0, react_1.useMemo)(() => {
|
17
17
|
var _a;
|
18
18
|
const searchParams = (location === null || location === void 0 ? void 0 : location.search) ? (_a = location === null || location === void 0 ? void 0 : location.search) === null || _a === void 0 ? void 0 : _a.replace('?', '') : '';
|
19
19
|
return searchParams;
|
20
20
|
}, []);
|
21
21
|
return (react_1.default.createElement(core_1.EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
|
22
|
-
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, isShowTag: (_j = (_h = (_g = data === null || data === void 0 ? void 0 : data.data) === null || _g === void 0 ? void 0 : _g.sxpPageConf) === null || _h === void 0 ? void 0 : _h.globalConfig) === null || _j === void 0 ? void 0 : _j.isShowTag, render: ({ rtcList, tagList }) => {
|
22
|
+
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, isShowTag: (_j = (_h = (_g = data === null || data === void 0 ? void 0 : data.data) === null || _g === void 0 ? void 0 : _g.sxpPageConf) === null || _h === void 0 ? void 0 : _h.globalConfig) === null || _j === void 0 ? void 0 : _j.isShowTag, globalConfig: (_l = (_k = data === null || data === void 0 ? void 0 : data.data) === null || _k === void 0 ? void 0 : _k.sxpPageConf) === null || _l === void 0 ? void 0 : _l.globalConfig, render: ({ rtcList, tagList }) => {
|
23
23
|
var _a;
|
24
24
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
25
25
|
react_1.default.createElement(SxpPageRender_1.default, Object.assign({}, (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER, licenseUrl: licenseUrl })),
|
@@ -4,16 +4,30 @@ const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
5
5
|
const hooks_1 = require("../../../core/hooks");
|
6
6
|
const event_1 = tslib_1.__importStar(require("../../../core/utils/event"));
|
7
|
+
const useEventReport_1 = require("../../../core/hooks/useEventReport");
|
7
8
|
const DEFAULT_TAG = 'FOR U';
|
8
9
|
const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
9
10
|
const [selectTag, setSelectTag] = (0, react_1.useState)(DEFAULT_TAG);
|
10
|
-
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef, waterFallData } = (0, hooks_1.useSxpDataSource)();
|
11
|
+
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef, waterFallData, bffEventReport } = (0, hooks_1.useSxpDataSource)();
|
12
|
+
const { backMainFeed } = (0, useEventReport_1.useEventReport)();
|
11
13
|
const realTagList = (0, react_1.useMemo)(() => {
|
12
14
|
return [DEFAULT_TAG, ...tagList];
|
13
15
|
}, [tagList]);
|
14
16
|
const handleSelectTag = (tag) => () => {
|
15
17
|
if (tag === selectTag)
|
16
18
|
return;
|
19
|
+
if (tag !== 'FOR U') {
|
20
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
21
|
+
eventInfo: {
|
22
|
+
eventSubject: 'clickThemeTagsViewContents',
|
23
|
+
eventDescription: 'click Theme Tags View Contents',
|
24
|
+
themeTags: `[${tag}]`
|
25
|
+
}
|
26
|
+
});
|
27
|
+
}
|
28
|
+
else {
|
29
|
+
backMainFeed('theme', selectTag);
|
30
|
+
}
|
17
31
|
let themeTag;
|
18
32
|
if (tag !== DEFAULT_TAG) {
|
19
33
|
themeTag = tag;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import './List.less';
|
3
3
|
import { IHashTagProps } from '../../../../materials/sxp/HashTag';
|
4
|
-
export default function WaterfallList({ reportTagsView, ...props }: any & IHashTagProps): React.JSX.Element;
|
4
|
+
export default function WaterfallList({ reportTagsView, showBanner, ...props }: any & IHashTagProps): React.JSX.Element;
|
@@ -6,6 +6,7 @@ require("./List.less");
|
|
6
6
|
const FormatImage_1 = tslib_1.__importDefault(require("../FormatImage"));
|
7
7
|
const preview_json_1 = tslib_1.__importDefault(require("./preview.json"));
|
8
8
|
const hooks_1 = require("../../../../core/hooks");
|
9
|
+
const css_1 = require("@emotion/css");
|
9
10
|
const WaterfallFlowItem = (props) => {
|
10
11
|
const { rec, index, list, reportTagsView, textStyles, space } = props;
|
11
12
|
const { swiperRef, setRtcList, setOpenHashtag, bffEventReport, sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
@@ -115,8 +116,8 @@ const WaterfallFlowItem = (props) => {
|
|
115
116
|
react_1.default.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText }, priceText))));
|
116
117
|
};
|
117
118
|
function WaterfallList(_a) {
|
118
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
119
|
-
var { reportTagsView } = _a, props = tslib_1.__rest(_a, ["reportTagsView"]);
|
119
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
120
|
+
var { reportTagsView, showBanner } = _a, props = tslib_1.__rest(_a, ["reportTagsView", "showBanner"]);
|
120
121
|
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = (0, hooks_1.useSxpDataSource)();
|
121
122
|
const [list, setList] = (0, react_1.useState)();
|
122
123
|
const [data, setData] = (0, react_1.useState)();
|
@@ -171,17 +172,22 @@ function WaterfallList(_a) {
|
|
171
172
|
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' } },
|
172
173
|
react_1.default.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (react_1.default.createElement("div", { className: 'list' },
|
173
174
|
react_1.default.createElement("div", { className: 'list-scroll', ref: containerRef },
|
174
|
-
|
175
|
-
|
175
|
+
showBanner && ((_b = data === null || data === void 0 ? void 0 : data.tag) === null || _b === void 0 ? void 0 : _b.picture) && (react_1.default.createElement(FormatImage_1.default, { className: (0, css_1.css)({
|
176
|
+
width: '100%',
|
177
|
+
objectFit: 'cover',
|
178
|
+
marginBottom: '20px'
|
179
|
+
}), src: (_c = data === null || data === void 0 ? void 0 : data.tag) === null || _c === void 0 ? void 0 : _c.picture })),
|
180
|
+
react_1.default.createElement("div", { className: 'list-info', style: (_d = props === null || props === void 0 ? void 0 : props.textStyles) === null || _d === void 0 ? void 0 : _d.hashTagDesc }, (_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.info),
|
181
|
+
react_1.default.createElement("div", { hidden: !((_f = data === null || data === void 0 ? void 0 : data.tag) === null || _f === void 0 ? void 0 : _f.link), className: 'list-collection', onClick: handleClickLink, style: Object.assign(Object.assign({}, (_g = props === null || props === void 0 ? void 0 : props.textStyles) === null || _g === void 0 ? void 0 : _g.hashTagLink), { marginBottom: props === null || props === void 0 ? void 0 : props.space }) }, ((_h = data === null || data === void 0 ? void 0 : data.tag) === null || _h === void 0 ? void 0 : _h.linkTitle) || 'Shop the collection'),
|
176
182
|
react_1.default.createElement("div", { className: 'list-content' }, list === null || list === void 0 ? void 0 : list.map((item, ind) => {
|
177
183
|
return (react_1.default.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, rec: item, list: list, reportTagsView: reportTagsView }, props)));
|
178
184
|
})),
|
179
185
|
react_1.default.createElement("div", { hidden: !isLoadMore, style: { textAlign: 'center' } }, "loading..."),
|
180
|
-
react_1.default.createElement("div", { hidden: !((
|
181
|
-
height: ((
|
186
|
+
react_1.default.createElement("div", { hidden: !((_j = data === null || data === void 0 ? void 0 : data.tag) === null || _j === void 0 ? void 0 : _j.link), style: {
|
187
|
+
height: ((_k = data === null || data === void 0 ? void 0 : data.tag) === null || _k === void 0 ? void 0 : _k.link) ? ((_l = props === null || props === void 0 ? void 0 : props.buttonBgStyle) === null || _l === void 0 ? void 0 : _l.height) || ((_m = props === null || props === void 0 ? void 0 : props.buttonStyle) === null || _m === void 0 ? void 0 : _m.height) || '100px' : 0
|
182
188
|
} })),
|
183
|
-
react_1.default.createElement("div", { className: 'list-bottom', hidden: !((
|
184
|
-
react_1.default.createElement("div", { hidden: !((
|
185
|
-
react_1.default.createElement("button", { className: 'list-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((
|
189
|
+
react_1.default.createElement("div", { className: 'list-bottom', hidden: !((_o = data === null || data === void 0 ? void 0 : data.tag) === null || _o === void 0 ? void 0 : _o.link), style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
|
190
|
+
react_1.default.createElement("div", { hidden: !((_p = data === null || data === void 0 ? void 0 : data.tag) === null || _p === void 0 ? void 0 : _p.link), className: 'list-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
|
191
|
+
react_1.default.createElement("button", { className: 'list-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_q = data === null || data === void 0 ? void 0 : data.tag) === null || _q === void 0 ? void 0 : _q.linkTitle) || 'Shop the collection'))))));
|
186
192
|
}
|
187
193
|
exports.default = WaterfallList;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import './WaterfallList.less';
|
3
3
|
import { IHashTagProps } from '../../../../materials/sxp/HashTag';
|
4
|
-
export default function WaterfallList({ reportTagsView, ...props }: any & IHashTagProps): React.JSX.Element;
|
4
|
+
export default function WaterfallList({ reportTagsView, showBanner, ...props }: any & IHashTagProps): React.JSX.Element;
|