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
@@ -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,60 @@
|
|
1
|
+
import React, { memo, useEffect, useMemo } from 'react';
|
2
|
+
import qs from 'qs';
|
3
|
+
import { useSxpDataSource } from '../../../core/hooks';
|
4
|
+
import './index.less';
|
5
|
+
import { AGREE_POLICY } from '../../../core/utils/localStore';
|
6
|
+
const Consent = ({ width = window.innerWidth, height = window.innerHeight, privacy_title, privacy_context, privacy_policy_url, privacy_policy_title }) => {
|
7
|
+
const { setIsAgreePolicy, bffEventReport } = useSxpDataSource();
|
8
|
+
const channelObj = useMemo(() => {
|
9
|
+
const queryString = location.search.slice(1);
|
10
|
+
const params = qs.parse(queryString.replace(/\+/g, '%2B'));
|
11
|
+
for (const key in params) {
|
12
|
+
params[key] = params[key].replace(/%2B/g, '+');
|
13
|
+
}
|
14
|
+
return params;
|
15
|
+
}, []);
|
16
|
+
const getUtmValue = (key) => { var _a; return (_a = channelObj[key]) !== null && _a !== void 0 ? _a : null; };
|
17
|
+
useEffect(() => {
|
18
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
19
|
+
eventInfo: {
|
20
|
+
eventSubject: 'privacyEnter',
|
21
|
+
eventDescription: 'User enter privacy page',
|
22
|
+
utmSource: getUtmValue('utm_source'),
|
23
|
+
utmMedium: getUtmValue('utm_medium'),
|
24
|
+
utmCampaign: getUtmValue('utm_campaign'),
|
25
|
+
utmId: getUtmValue('utm_id'),
|
26
|
+
utmContent: getUtmValue('utm_content'),
|
27
|
+
clSource: getUtmValue('cl_source'),
|
28
|
+
enterTime: `${Date.now()}`,
|
29
|
+
enterUrl: window.location.href,
|
30
|
+
rtc: null,
|
31
|
+
requestId: null,
|
32
|
+
sessionID: null
|
33
|
+
}
|
34
|
+
});
|
35
|
+
}, []);
|
36
|
+
const handleAgree = () => {
|
37
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
38
|
+
eventInfo: {
|
39
|
+
eventSubject: 'userConsent',
|
40
|
+
eventDescription: '用户授权【操作结果】',
|
41
|
+
consentResult: '0',
|
42
|
+
consentTags: '[]',
|
43
|
+
rtc: null,
|
44
|
+
requestId: null,
|
45
|
+
sessionID: null
|
46
|
+
}
|
47
|
+
});
|
48
|
+
setIsAgreePolicy === null || setIsAgreePolicy === void 0 ? void 0 : setIsAgreePolicy(true);
|
49
|
+
window.localStorage.setItem(AGREE_POLICY, 'yes');
|
50
|
+
};
|
51
|
+
return (React.createElement("div", { className: 'consent-bg' },
|
52
|
+
React.createElement("div", { className: 'consent' },
|
53
|
+
React.createElement("div", { className: 'consent-col' },
|
54
|
+
React.createElement("div", { className: 'consent-title' }, privacy_title !== null && privacy_title !== void 0 ? privacy_title : 'Privacy Policy'),
|
55
|
+
React.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.')),
|
56
|
+
React.createElement("div", { className: 'consent-col' },
|
57
|
+
React.createElement("button", { className: 'consent-btn', onClick: handleAgree }, "Agree"),
|
58
|
+
React.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')))));
|
59
|
+
};
|
60
|
+
export default memo(Consent);
|
@@ -9,14 +9,14 @@ Object.values(_materials_).forEach((v) => {
|
|
9
9
|
RESOLVER[v.extend.type] = v;
|
10
10
|
});
|
11
11
|
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl, enabledMetaConversionApi }) => {
|
12
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
12
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
13
13
|
const utmVal = useMemo(() => {
|
14
14
|
var _a;
|
15
15
|
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('?', '') : '';
|
16
16
|
return searchParams;
|
17
17
|
}, []);
|
18
18
|
return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
|
19
|
-
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, 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 }) => {
|
19
|
+
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, 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 }) => {
|
20
20
|
var _a;
|
21
21
|
return (React.createElement(React.Fragment, null,
|
22
22
|
React.createElement(SxpPageRender, 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 })),
|
@@ -1,16 +1,30 @@
|
|
1
1
|
import React, { memo, useMemo, useState } from 'react';
|
2
2
|
import { useSxpDataSource } from '../../../core/hooks';
|
3
3
|
import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../core/utils/event';
|
4
|
+
import { useEventReport } from '../../../core/hooks/useEventReport';
|
4
5
|
const DEFAULT_TAG = 'FOR U';
|
5
6
|
const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
6
7
|
const [selectTag, setSelectTag] = useState(DEFAULT_TAG);
|
7
|
-
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef, waterFallData } = useSxpDataSource();
|
8
|
+
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef, waterFallData, bffEventReport } = useSxpDataSource();
|
9
|
+
const { backMainFeed } = useEventReport();
|
8
10
|
const realTagList = useMemo(() => {
|
9
11
|
return [DEFAULT_TAG, ...tagList];
|
10
12
|
}, [tagList]);
|
11
13
|
const handleSelectTag = (tag) => () => {
|
12
14
|
if (tag === selectTag)
|
13
15
|
return;
|
16
|
+
if (tag !== 'FOR U') {
|
17
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18
|
+
eventInfo: {
|
19
|
+
eventSubject: 'clickThemeTagsViewContents',
|
20
|
+
eventDescription: 'click Theme Tags View Contents',
|
21
|
+
themeTags: `[${tag}]`
|
22
|
+
}
|
23
|
+
});
|
24
|
+
}
|
25
|
+
else {
|
26
|
+
backMainFeed('theme', selectTag);
|
27
|
+
}
|
14
28
|
let themeTag;
|
15
29
|
if (tag !== DEFAULT_TAG) {
|
16
30
|
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;
|
@@ -4,6 +4,7 @@ import './List.less';
|
|
4
4
|
import FormatImage from '../FormatImage';
|
5
5
|
import previewData from './preview.json';
|
6
6
|
import { useSxpDataSource } from '../../../../core/hooks';
|
7
|
+
import { css } from '@emotion/css';
|
7
8
|
const WaterfallFlowItem = (props) => {
|
8
9
|
const { rec, index, list, reportTagsView, textStyles, space } = props;
|
9
10
|
const { swiperRef, setRtcList, setOpenHashtag, bffEventReport, sxpParameter } = useSxpDataSource();
|
@@ -113,8 +114,8 @@ const WaterfallFlowItem = (props) => {
|
|
113
114
|
React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText }, priceText))));
|
114
115
|
};
|
115
116
|
export default function WaterfallList(_a) {
|
116
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
117
|
-
var { reportTagsView } = _a, props = __rest(_a, ["reportTagsView"]);
|
117
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
118
|
+
var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
|
118
119
|
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
|
119
120
|
const [list, setList] = useState();
|
120
121
|
const [data, setData] = useState();
|
@@ -169,16 +170,21 @@ export default function WaterfallList(_a) {
|
|
169
170
|
return (React.createElement(React.Fragment, null, isLoadingData ? (React.createElement("div", { style: { height: '100%', width: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
170
171
|
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { className: 'list' },
|
171
172
|
React.createElement("div", { className: 'list-scroll', ref: containerRef },
|
172
|
-
|
173
|
-
|
173
|
+
showBanner && ((_b = data === null || data === void 0 ? void 0 : data.tag) === null || _b === void 0 ? void 0 : _b.picture) && (React.createElement(FormatImage, { className: css({
|
174
|
+
width: '100%',
|
175
|
+
objectFit: 'cover',
|
176
|
+
marginBottom: '20px'
|
177
|
+
}), src: (_c = data === null || data === void 0 ? void 0 : data.tag) === null || _c === void 0 ? void 0 : _c.picture })),
|
178
|
+
React.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),
|
179
|
+
React.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'),
|
174
180
|
React.createElement("div", { className: 'list-content' }, list === null || list === void 0 ? void 0 : list.map((item, ind) => {
|
175
181
|
return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, rec: item, list: list, reportTagsView: reportTagsView }, props)));
|
176
182
|
})),
|
177
183
|
React.createElement("div", { hidden: !isLoadMore, style: { textAlign: 'center' } }, "loading..."),
|
178
|
-
React.createElement("div", { hidden: !((
|
179
|
-
height: ((
|
184
|
+
React.createElement("div", { hidden: !((_j = data === null || data === void 0 ? void 0 : data.tag) === null || _j === void 0 ? void 0 : _j.link), style: {
|
185
|
+
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
|
180
186
|
} })),
|
181
|
-
React.createElement("div", { className: 'list-bottom', hidden: !((
|
182
|
-
React.createElement("div", { hidden: !((
|
183
|
-
React.createElement("button", { className: 'list-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((
|
187
|
+
React.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 }),
|
188
|
+
React.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' }) },
|
189
|
+
React.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'))))));
|
184
190
|
}
|
@@ -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;
|
@@ -4,6 +4,7 @@ import { useSxpDataSource } from '../../../../core/hooks';
|
|
4
4
|
import './WaterfallList.less';
|
5
5
|
import previewData from './preview.json';
|
6
6
|
import FormatImage from '../FormatImage';
|
7
|
+
import { css } from '@emotion/css';
|
7
8
|
const WaterfallFlowItem = (props) => {
|
8
9
|
const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
|
9
10
|
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = useSxpDataSource();
|
@@ -140,8 +141,8 @@ const WaterfallFlowItem = (props) => {
|
|
140
141
|
React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price }, priceText))));
|
141
142
|
};
|
142
143
|
export default function WaterfallList(_a) {
|
143
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
144
|
-
var { reportTagsView } = _a, props = __rest(_a, ["reportTagsView"]);
|
144
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
145
|
+
var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
|
145
146
|
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
|
146
147
|
const scrollParent = useRef(null);
|
147
148
|
const [scrollTop, setScrollTop] = useState(0);
|
@@ -312,23 +313,28 @@ export default function WaterfallList(_a) {
|
|
312
313
|
return (React.createElement(React.Fragment, null, isLoadingData ? (React.createElement("div", { style: { height: '100%', width: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
313
314
|
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { className: 'waterFallList', ref: waterfallFlowDom },
|
314
315
|
React.createElement("div", { className: 'waterFallList-scroll', ref: scrollParent },
|
315
|
-
|
316
|
-
|
316
|
+
showBanner && ((_b = data === null || data === void 0 ? void 0 : data.tag) === null || _b === void 0 ? void 0 : _b.picture) && (React.createElement(FormatImage, { className: css({
|
317
|
+
width: '100%',
|
318
|
+
objectFit: 'cover',
|
319
|
+
marginBottom: '20px'
|
320
|
+
}), src: (_c = data === null || data === void 0 ? void 0 : data.tag) === null || _c === void 0 ? void 0 : _c.picture })),
|
321
|
+
React.createElement("div", { className: 'waterFallList-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),
|
322
|
+
React.createElement("div", { hidden: !((_f = data === null || data === void 0 ? void 0 : data.tag) === null || _f === void 0 ? void 0 : _f.link), className: 'waterFallList-collection', style: Object.assign({}, (_g = props === null || props === void 0 ? void 0 : props.textStyles) === null || _g === void 0 ? void 0 : _g.hashTagLink), onClick: handleClickLink }, ((_h = data === null || data === void 0 ? void 0 : data.tag) === null || _h === void 0 ? void 0 : _h.linkTitle) || 'Shop the collection'),
|
317
323
|
React.createElement("div", { className: 'waterFallList-content' }, list === null || list === void 0 ? void 0 :
|
318
324
|
list.map((item, ind) => {
|
319
325
|
var _a;
|
320
326
|
return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, rec: item, list: list, showBorder: scrollTop + ((_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.clientHeight), style: styleList[ind], sizeChange: onSizeChange, unitWidth: unitWidth, reportTagsView: reportTagsView }, props)));
|
321
327
|
}),
|
322
|
-
React.createElement("div", { hidden: !((
|
328
|
+
React.createElement("div", { hidden: !((_j = data === null || data === void 0 ? void 0 : data.tag) === null || _j === void 0 ? void 0 : _j.link), style: {
|
323
329
|
position: 'absolute',
|
324
330
|
width: '100%',
|
325
|
-
transform: `translate(0px,${(
|
326
|
-
((
|
327
|
-
height: ((
|
328
|
-
? ((
|
331
|
+
transform: `translate(0px,${(_p = ((_l = waterfallFlowListInfo === null || waterfallFlowListInfo === void 0 ? void 0 : waterfallFlowListInfo.current[((_k = waterfallFlowListInfo === null || waterfallFlowListInfo === void 0 ? void 0 : waterfallFlowListInfo.current) === null || _k === void 0 ? void 0 : _k.length) - 1]) === null || _l === void 0 ? void 0 : _l.top) +
|
332
|
+
((_o = waterfallFlowListInfo === null || waterfallFlowListInfo === void 0 ? void 0 : waterfallFlowListInfo.current[((_m = waterfallFlowListInfo === null || waterfallFlowListInfo === void 0 ? void 0 : waterfallFlowListInfo.current) === null || _m === void 0 ? void 0 : _m.length) - 1]) === null || _o === void 0 ? void 0 : _o.height)) !== null && _p !== void 0 ? _p : 0}px)`,
|
333
|
+
height: ((_q = data === null || data === void 0 ? void 0 : data.tag) === null || _q === void 0 ? void 0 : _q.link)
|
334
|
+
? ((_r = buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) === null || _r === void 0 ? void 0 : _r.offsetHeight) || ((_s = props === null || props === void 0 ? void 0 : props.buttonBgStyle) === null || _s === void 0 ? void 0 : _s.height) || '100px'
|
329
335
|
: 0
|
330
336
|
} }))),
|
331
|
-
React.createElement("div", { className: 'waterFallList-bottom', hidden: !((
|
332
|
-
React.createElement("div", { ref: buttonRef, hidden: !((
|
333
|
-
React.createElement("button", { className: 'waterFallList-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((
|
337
|
+
React.createElement("div", { className: 'waterFallList-bottom', hidden: !((_t = data === null || data === void 0 ? void 0 : data.tag) === null || _t === void 0 ? void 0 : _t.link), style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
|
338
|
+
React.createElement("div", { ref: buttonRef, hidden: !((_u = data === null || data === void 0 ? void 0 : data.tag) === null || _u === void 0 ? void 0 : _u.link), className: 'waterFallList-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
|
339
|
+
React.createElement("button", { className: 'waterFallList-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_v = data === null || data === void 0 ? void 0 : data.tag) === null || _v === void 0 ? void 0 : _v.linkTitle) || 'Shop the collection'))))));
|
334
340
|
}
|
@@ -7,9 +7,11 @@ import WaterfallList from './WaterfallList';
|
|
7
7
|
import left from './left.png';
|
8
8
|
import List from './List';
|
9
9
|
import { useSxpDataSource } from '../../../../core/hooks';
|
10
|
+
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
10
11
|
const WaterFall = (props) => {
|
11
12
|
var _a;
|
12
|
-
const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport } = useSxpDataSource();
|
13
|
+
const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag } = useSxpDataSource();
|
14
|
+
const { backMainFeed } = useEventReport();
|
13
15
|
const ref = useRef(null);
|
14
16
|
const modalEleRef = useRef(null);
|
15
17
|
const [viewTime, setViewTime] = useState();
|
@@ -30,6 +32,9 @@ const WaterFall = (props) => {
|
|
30
32
|
if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
|
31
33
|
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
|
32
34
|
}
|
35
|
+
if (!(themeTag === null || themeTag === void 0 ? void 0 : themeTag.current)) {
|
36
|
+
backMainFeed('branch', themeTag === null || themeTag === void 0 ? void 0 : themeTag.current, waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag);
|
37
|
+
}
|
33
38
|
reportTagsView();
|
34
39
|
setWaterFallData === null || setWaterFallData === void 0 ? void 0 : setWaterFallData(undefined);
|
35
40
|
setIsFromHashtag === null || setIsFromHashtag === void 0 ? void 0 : setIsFromHashtag(false);
|
@@ -97,6 +102,6 @@ const WaterFall = (props) => {
|
|
97
102
|
display: openHashtag ? 'block' : 'none'
|
98
103
|
} },
|
99
104
|
React.createElement(Navbar, { icon: left, styles: { top: '32px' }, textStyle: (_a = props === null || props === void 0 ? void 0 : props.textStyles) === null || _a === void 0 ? void 0 : _a.hashTagTitle, onClose: handleClose }),
|
100
|
-
(props === null || props === void 0 ? void 0 : props.
|
105
|
+
(props === null || props === void 0 ? void 0 : props.openFixedSize) === true || (props === null || props === void 0 ? void 0 : props.openFixedSize) === undefined ? (React.createElement(List, Object.assign({ reportTagsView: reportTagsView }, props))) : (React.createElement(WaterfallList, Object.assign({ reportTagsView: reportTagsView }, props)))), modalEleRef.current);
|
101
106
|
};
|
102
107
|
export default memo(WaterFall);
|
@@ -34,6 +34,7 @@ export interface ISxpPageRenderProps {
|
|
34
34
|
likeIconYPosit?: string;
|
35
35
|
likeIconXPosit?: string;
|
36
36
|
swipeTipOffset?: number;
|
37
|
+
consent?: any[];
|
37
38
|
};
|
38
39
|
descStyle?: CSSProperties;
|
39
40
|
tipText?: {
|
@@ -68,7 +69,7 @@ export interface ISxpPageRenderProps {
|
|
68
69
|
ctaType?: string;
|
69
70
|
_schema?: any;
|
70
71
|
hashTagStyle?: CSSProperties;
|
71
|
-
licenseUrl?:
|
72
|
+
licenseUrl?: string;
|
72
73
|
}
|
73
74
|
declare const SxpPageRender: FC<ISxpPageRenderProps>;
|
74
75
|
export default SxpPageRender;
|
@@ -28,11 +28,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
28
28
|
const viewImageStartTime = useRef(0);
|
29
29
|
const [isInit, setIsInit] = useState(false);
|
30
30
|
const [isMuted, setIsMuted] = useState(true);
|
31
|
-
const curTime = useRef();
|
32
31
|
const viewTime = useRef();
|
33
32
|
const [isLoadMore, setIsLoadMore] = useState(false);
|
34
33
|
const [isShowMore, setIsShowMore] = useState(false);
|
35
|
-
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport } = useSxpDataSource();
|
34
|
+
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink } = useSxpDataSource();
|
35
|
+
const { backMainFeed } = useEventReport();
|
36
36
|
const [videoRef, setVideoRef] = useState(null);
|
37
37
|
const playerRef = useRef();
|
38
38
|
const { productView } = useEventReport();
|
@@ -43,17 +43,17 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
43
43
|
if (data.length <= 0) {
|
44
44
|
return;
|
45
45
|
}
|
46
|
-
|
46
|
+
refreshFeSessionId();
|
47
|
+
const now = new Date();
|
48
|
+
viewTime.current = now;
|
49
|
+
if (isInit) {
|
50
|
+
h5EnterLink === null || h5EnterLink === void 0 ? void 0 : h5EnterLink();
|
51
|
+
}
|
47
52
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
48
53
|
eventName: 'PageView'
|
49
54
|
});
|
50
55
|
setIsInit(true);
|
51
|
-
}, [data.length, bffFbReport]);
|
52
|
-
const initTime = () => {
|
53
|
-
curTime.current = new Date();
|
54
|
-
viewTime.current = new Date();
|
55
|
-
refreshFeSessionId();
|
56
|
-
};
|
56
|
+
}, [data.length, bffFbReport, h5EnterLink, isInit]);
|
57
57
|
const firstRef = useRef();
|
58
58
|
useEffect(() => {
|
59
59
|
var _a, _b, _c, _d;
|
@@ -146,13 +146,33 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
146
146
|
handleH5EnterLink();
|
147
147
|
handleViewImageStartEvent(activeIndex);
|
148
148
|
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
|
149
|
+
backMainFeed('external');
|
149
150
|
}
|
150
151
|
};
|
151
152
|
document.addEventListener('visibilitychange', visibleChange);
|
152
153
|
return () => {
|
153
154
|
document.removeEventListener('visibilitychange', visibleChange);
|
154
155
|
};
|
155
|
-
}, [
|
156
|
+
}, [
|
157
|
+
activeIndex,
|
158
|
+
bffEventReport,
|
159
|
+
data,
|
160
|
+
handleH5EnterLink,
|
161
|
+
popupDetailData,
|
162
|
+
isFromHashtag,
|
163
|
+
tempMap,
|
164
|
+
curTime,
|
165
|
+
backMainFeed
|
166
|
+
]);
|
167
|
+
useEffect(() => {
|
168
|
+
const initTime = () => {
|
169
|
+
backMainFeed('external');
|
170
|
+
};
|
171
|
+
window.addEventListener('pageshow', initTime);
|
172
|
+
return () => {
|
173
|
+
window.removeEventListener('pageshow', initTime);
|
174
|
+
};
|
175
|
+
}, []);
|
156
176
|
const tagHeight = useMemo(() => {
|
157
177
|
let h = 0;
|
158
178
|
if (tagList.length > 0) {
|
@@ -7,10 +7,19 @@ interface IEditorDataContext {
|
|
7
7
|
placeholderImage: string;
|
8
8
|
hashTagSize: number;
|
9
9
|
loadingImage: string;
|
10
|
+
industry?: string;
|
11
|
+
privacyContent?: string;
|
12
|
+
privacyNecessity?: boolean;
|
13
|
+
privacyPolicyTitle?: string;
|
14
|
+
privacyPolicyUrl?: string;
|
15
|
+
privacyTitle?: string;
|
16
|
+
template?: any | null;
|
10
17
|
};
|
11
18
|
appDomain?: string;
|
12
19
|
openHashtag?: boolean;
|
13
20
|
setOpenHashtag?: React.Dispatch<React.SetStateAction<boolean>>;
|
21
|
+
openConsent?: boolean;
|
22
|
+
setOpenConsent?: React.Dispatch<React.SetStateAction<boolean>>;
|
14
23
|
}
|
15
24
|
interface IEditorProviderProps {
|
16
25
|
data?: any;
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import React, { createContext, useContext, useState } from 'react';
|
2
2
|
const EditorDataContext = createContext({});
|
3
3
|
const EditorDataProvider = ({ children, data }) => {
|
4
|
-
var _a, _b, _c, _d, _e, _f;
|
4
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
5
5
|
const [openHashtag, setOpenHashtag] = useState(false);
|
6
|
+
const [openConsent, setOpenConsent] = useState(false);
|
6
7
|
return (React.createElement(EditorDataContext.Provider, { value: {
|
7
8
|
sxpPrameter: {
|
8
9
|
bottomImage: (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.bottom_image,
|
@@ -10,11 +11,20 @@ const EditorDataProvider = ({ children, data }) => {
|
|
10
11
|
personalizedRecommend: (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.personalized_recommend,
|
11
12
|
placeholderImage: (_d = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _d === void 0 ? void 0 : _d.placeholder_image,
|
12
13
|
hashTagSize: (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size,
|
13
|
-
loadingImage: (_f = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _f === void 0 ? void 0 : _f.loading_image
|
14
|
+
loadingImage: (_f = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _f === void 0 ? void 0 : _f.loading_image,
|
15
|
+
privacyContent: (_g = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _g === void 0 ? void 0 : _g.privacy_context,
|
16
|
+
privacyNecessity: (_h = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _h === void 0 ? void 0 : _h.privacy_necessity,
|
17
|
+
privacyPolicyTitle: (_j = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _j === void 0 ? void 0 : _j.privacy_policy_title,
|
18
|
+
privacyPolicyUrl: (_k = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _k === void 0 ? void 0 : _k.privacy_policy_url,
|
19
|
+
privacyTitle: (_l = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _l === void 0 ? void 0 : _l.privacy_title,
|
20
|
+
template: (_m = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _m === void 0 ? void 0 : _m.template,
|
21
|
+
industry: (_o = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _o === void 0 ? void 0 : _o.industry
|
14
22
|
},
|
15
23
|
appDomain: data === null || data === void 0 ? void 0 : data.appDomain,
|
16
24
|
openHashtag,
|
17
|
-
setOpenHashtag
|
25
|
+
setOpenHashtag,
|
26
|
+
openConsent,
|
27
|
+
setOpenConsent
|
18
28
|
} }, children));
|
19
29
|
};
|
20
30
|
export function useEditorDataProvider() {
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React, { ReactNode } from 'react';
|
2
2
|
import { DataSource, PageData } from '../Pagebuilder/type';
|
3
3
|
import { ProductInfoType, RecItemType, RecommendVideoResultType, VideoInfoType } from '../components/SxpPageRender/typing';
|
4
|
+
import { ISxpPageRenderProps } from '../components/SxpPageRender';
|
4
5
|
export interface IWaterFallDataType {
|
5
6
|
hashTag: string;
|
6
7
|
itemId?: string;
|
@@ -62,6 +63,8 @@ export interface ISxpDataSourceContext {
|
|
62
63
|
loadingImage?: string;
|
63
64
|
isOpenHashTag?: boolean;
|
64
65
|
tagList: string[];
|
66
|
+
isAgreePolicy?: boolean;
|
67
|
+
setIsAgreePolicy?: React.Dispatch<React.SetStateAction<boolean>>;
|
65
68
|
setLoading?: React.Dispatch<React.SetStateAction<boolean>>;
|
66
69
|
videoRef?: any;
|
67
70
|
setVideoRef?: React.Dispatch<React.SetStateAction<any>>;
|
@@ -71,6 +74,9 @@ export interface ISxpDataSourceContext {
|
|
71
74
|
eventSourceUrl?: string;
|
72
75
|
externalId?: string;
|
73
76
|
}) => Promise<any> | undefined | boolean;
|
77
|
+
curTime?: any;
|
78
|
+
h5EnterLink?: () => void;
|
79
|
+
themeTag?: any;
|
74
80
|
}
|
75
81
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
76
82
|
export interface SxpDataSourceProviderProps {
|
@@ -103,6 +109,10 @@ export interface SxpDataSourceProviderProps {
|
|
103
109
|
isOpenHashTag?: boolean;
|
104
110
|
enabledMetaConversionApi?: boolean;
|
105
111
|
isShowTag?: boolean;
|
112
|
+
consentWidth?: number;
|
113
|
+
consentHeight?: number;
|
114
|
+
isOpenConsent?: boolean;
|
115
|
+
globalConfig?: ISxpPageRenderProps['globalConfig'];
|
106
116
|
}
|
107
117
|
declare const _default: React.NamedExoticComponent<SxpDataSourceProviderProps>;
|
108
118
|
export default _default;
|