pb-sxp-ui 1.0.41 → 1.0.42
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/LICENSE +21 -21
- package/README.md +111 -111
- package/dist/index.cjs +111 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +48 -3
- package/dist/index.js +111 -27
- 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 +111 -27
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/index.js +21 -6
- package/es/core/components/SxpPageCore/index.js +2 -2
- package/es/core/components/SxpPageRender/Nudge/index.js +6 -5
- package/es/core/components/SxpPageRender/Tagbar.d.ts +7 -0
- package/es/core/components/SxpPageRender/Tagbar.js +37 -0
- package/es/core/components/SxpPageRender/index.d.ts +2 -0
- package/es/core/components/SxpPageRender/index.js +14 -5
- package/es/core/context/SxpDataSourceProvider.d.ts +3 -0
- package/es/core/context/SxpDataSourceProvider.js +28 -4
- package/es/materials/sxp/popup/CommodityDetail/index.js +4 -4
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
- package/lib/core/components/DiyPortalPreview/index.js +21 -6
- package/lib/core/components/SxpPageCore/index.js +2 -2
- package/lib/core/components/SxpPageRender/Nudge/index.js +6 -5
- package/lib/core/components/SxpPageRender/Tagbar.d.ts +7 -0
- package/lib/core/components/SxpPageRender/Tagbar.js +40 -0
- package/lib/core/components/SxpPageRender/index.d.ts +2 -0
- package/lib/core/components/SxpPageRender/index.js +14 -5
- package/lib/core/context/SxpDataSourceProvider.d.ts +3 -0
- package/lib/core/context/SxpDataSourceProvider.js +28 -4
- package/lib/materials/sxp/popup/CommodityDetail/index.js +4 -4
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
- package/package.json +115 -115
@@ -6,6 +6,7 @@ import Hashtag from '../SxpPageRender/Hashtag';
|
|
6
6
|
import LikeButton from '../SxpPageRender/LikeButton';
|
7
7
|
import ToggleButton from '../SxpPageRender/ToggleButton';
|
8
8
|
import { useIconLink } from '../SxpPageRender/useIconLink';
|
9
|
+
import Tagbar from '../SxpPageRender/Tagbar';
|
9
10
|
import PictureGroup from './PictureGroup';
|
10
11
|
import VideoWidget from './VideoWidget';
|
11
12
|
import * as _materials_ from '../../../materials';
|
@@ -16,10 +17,17 @@ Object.values(_materials_).forEach((v) => {
|
|
16
17
|
});
|
17
18
|
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
18
19
|
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
19
|
-
const DiyPortalPreview = ({ data, globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain }) => {
|
20
|
+
const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [] }) => {
|
20
21
|
const height = useMemo(() => {
|
21
|
-
|
22
|
-
|
22
|
+
let minusHeight = 0;
|
23
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
24
|
+
minusHeight += 45;
|
25
|
+
}
|
26
|
+
if (tagList.length > 0) {
|
27
|
+
minusHeight += 45;
|
28
|
+
}
|
29
|
+
return containerHeight - minusHeight;
|
30
|
+
}, [globalConfig, containerHeight, tagList]);
|
23
31
|
const renderContent = (rec, index) => {
|
24
32
|
var _a, _b, _c, _d;
|
25
33
|
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
@@ -47,6 +55,13 @@ const DiyPortalPreview = ({ data, globalConfig, tipText, nudge, tempMap, descSty
|
|
47
55
|
}
|
48
56
|
return null;
|
49
57
|
}, [globalConfig]);
|
58
|
+
const CTA = (rec, index) => {
|
59
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
|
60
|
+
return (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
61
|
+
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER })));
|
62
|
+
}
|
63
|
+
return null;
|
64
|
+
};
|
50
65
|
const renderBottom = (rec, index) => {
|
51
66
|
var _a, _b, _c, _d, _e, _f, _g;
|
52
67
|
if (rec.video) {
|
@@ -54,8 +69,7 @@ const DiyPortalPreview = ({ data, globalConfig, tipText, nudge, tempMap, descSty
|
|
54
69
|
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
55
70
|
React.createElement("div", { className: 'clc-sxp-bottom' },
|
56
71
|
React.createElement(Nudge, { nudge: nudge }),
|
57
|
-
|
58
|
-
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER })),
|
72
|
+
CTA(rec, index),
|
59
73
|
React.createElement("div", null,
|
60
74
|
React.createElement(ExpandableText, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }) })),
|
61
75
|
React.createElement(Hashtag, { index: index, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))));
|
@@ -84,8 +98,9 @@ const DiyPortalPreview = ({ data, globalConfig, tipText, nudge, tempMap, descSty
|
|
84
98
|
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png', appDomain);
|
85
99
|
const renderView = (rec, index) => {
|
86
100
|
var _a, _b, _c, _d;
|
87
|
-
return (React.createElement("div", { style: { position: 'relative' } },
|
101
|
+
return (React.createElement("div", { style: { position: 'relative', border: '1px solid #e1e1e1' } },
|
88
102
|
renderLogo,
|
103
|
+
React.createElement(Tagbar, { tagList: tagList }),
|
89
104
|
React.createElement(ToggleButton, { style: {
|
90
105
|
position: 'absolute',
|
91
106
|
right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
|
@@ -16,10 +16,10 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
|
|
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, render: ({ rtcList }) => {
|
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, render: ({ rtcList, tagList }) => {
|
20
20
|
var _a;
|
21
21
|
return (React.createElement(React.Fragment, null,
|
22
|
-
React.createElement(SxpPageRender, Object.assign({}, (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { data: rtcList, resolver: RESOLVER })),
|
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 })),
|
23
23
|
React.createElement(Popup, null)));
|
24
24
|
} })));
|
25
25
|
};
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
const Nudge = ({ nudge }) => {
|
3
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
3
4
|
return (React.createElement(React.Fragment, null, (nudge === null || nudge === void 0 ? void 0 : nudge.isOpen) && (React.createElement("div", { className: 'clc-sxp-bottom-nudge', style: {
|
4
|
-
marginBottom: nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom,
|
5
|
-
width: nudge === null || nudge === void 0 ? void 0 : nudge.size.width,
|
6
|
-
height: nudge === null || nudge === void 0 ? void 0 : nudge.size.height,
|
5
|
+
marginBottom: (_a = nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom) !== null && _a !== void 0 ? _a : 5,
|
6
|
+
width: (_c = (_b = nudge === null || nudge === void 0 ? void 0 : nudge.size) === null || _b === void 0 ? void 0 : _b.width) !== null && _c !== void 0 ? _c : 212,
|
7
|
+
height: (_e = (_d = nudge === null || nudge === void 0 ? void 0 : nudge.size) === null || _d === void 0 ? void 0 : _d.height) !== null && _e !== void 0 ? _e : 38,
|
7
8
|
backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
|
8
|
-
borderRadius: nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius
|
9
|
+
borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
|
9
10
|
} },
|
10
11
|
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover' } }) : null,
|
11
|
-
React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, nudge === null || nudge === void 0 ? void 0 : nudge.content)))));
|
12
|
+
React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, (_g = nudge === null || nudge === void 0 ? void 0 : nudge.content) !== null && _g !== void 0 ? _g : '')))));
|
12
13
|
};
|
13
14
|
export default Nudge;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import React, { memo, useMemo, useState } from 'react';
|
2
|
+
import { useSxpDataSource } from '../../../core/hooks';
|
3
|
+
const DEFAULT_TAG = 'FOR U';
|
4
|
+
const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
5
|
+
const [selectTag, setSelectTag] = useState(DEFAULT_TAG);
|
6
|
+
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = useSxpDataSource();
|
7
|
+
const realTagList = useMemo(() => {
|
8
|
+
return [DEFAULT_TAG, ...tagList];
|
9
|
+
}, [tagList]);
|
10
|
+
const handleSelectTag = (tag) => () => {
|
11
|
+
if (tag === selectTag)
|
12
|
+
return;
|
13
|
+
let hashTag;
|
14
|
+
if (tag !== DEFAULT_TAG) {
|
15
|
+
hashTag = tag;
|
16
|
+
}
|
17
|
+
setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
|
18
|
+
getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ hashTag }).then((res) => {
|
19
|
+
var _a, _b, _c, _d;
|
20
|
+
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
|
21
|
+
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
|
22
|
+
setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
|
23
|
+
setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(0);
|
24
|
+
(_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slideTo(0);
|
25
|
+
}).finally(() => {
|
26
|
+
setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
|
27
|
+
});
|
28
|
+
setSelectTag(tag);
|
29
|
+
};
|
30
|
+
if (tagList.length <= 0)
|
31
|
+
return null;
|
32
|
+
return (React.createElement("div", { className: 'clc-sxp-tagbar', style: { height: 45 } },
|
33
|
+
React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
|
34
|
+
return (React.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
|
35
|
+
}))));
|
36
|
+
};
|
37
|
+
export default memo(Tagbar);
|
@@ -9,6 +9,7 @@ export type postConfigType = {
|
|
9
9
|
export interface ISxpPageRenderProps {
|
10
10
|
globalConfig?: {
|
11
11
|
isShowLogo?: boolean;
|
12
|
+
isShowCTA?: boolean;
|
12
13
|
logoUrl?: string;
|
13
14
|
muteIcon?: string;
|
14
15
|
unMuteIcon?: string;
|
@@ -55,6 +56,7 @@ export interface ISxpPageRenderProps {
|
|
55
56
|
containerWidth?: number;
|
56
57
|
tempMap?: Record<string, any>;
|
57
58
|
data?: RecItemType[];
|
59
|
+
tagList?: string[];
|
58
60
|
resolver: any;
|
59
61
|
ctaType?: string;
|
60
62
|
_schema?: any;
|
@@ -21,7 +21,8 @@ import './index.less';
|
|
21
21
|
import { useEventReport } from '../../../core/hooks/useEventReport';
|
22
22
|
import withBindDataSource from '../../../core/hoc/withBindDataSource';
|
23
23
|
import { getFeUserId } from '../../../core/utils/localStore';
|
24
|
-
|
24
|
+
import Tagbar from './Tagbar';
|
25
|
+
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [] }) => {
|
25
26
|
var _a, _b, _c, _d, _e, _f, _g;
|
26
27
|
const { schema } = useEditor();
|
27
28
|
const [activeIndex, setActiveIndex] = useState(0);
|
@@ -141,8 +142,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
141
142
|
};
|
142
143
|
}, [activeIndex, bffEventReport, curTime, data, handleH5EnterLink, popupDetailData, isFromHashtag, tempMap]);
|
143
144
|
const height = useMemo(() => {
|
144
|
-
|
145
|
-
|
145
|
+
let minusHeight = 0;
|
146
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
147
|
+
minusHeight += 45;
|
148
|
+
}
|
149
|
+
if (tagList.length > 0) {
|
150
|
+
minusHeight += 45;
|
151
|
+
}
|
152
|
+
return containerHeight - minusHeight;
|
153
|
+
}, [globalConfig, containerHeight, tagList]);
|
146
154
|
const renderLogo = useMemo(() => {
|
147
155
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
148
156
|
return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
|
@@ -190,8 +198,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
190
198
|
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
191
199
|
React.createElement("div", { className: 'clc-sxp-bottom' },
|
192
200
|
React.createElement(Nudge, { nudge: nudge }),
|
193
|
-
React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
194
|
-
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
|
201
|
+
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
202
|
+
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver }))) : null,
|
195
203
|
React.createElement("div", null,
|
196
204
|
React.createElement(ExpandableText, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
|
197
205
|
React.createElement(Hashtag, { index: activeIndex, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle })))));
|
@@ -348,6 +356,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
348
356
|
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
349
357
|
} })),
|
350
358
|
renderLogo,
|
359
|
+
React.createElement(Tagbar, { tagList: tagList, setActiveIndex: setActiveIndex }),
|
351
360
|
isShowFingerTip ? React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
|
352
361
|
React.createElement(Swiper, { ref: swiperRef, onActiveIndexChange: (swiper) => {
|
353
362
|
setActiveIndex(swiper.activeIndex);
|
@@ -60,12 +60,15 @@ export interface ISxpDataSourceContext {
|
|
60
60
|
hashTagSize?: number;
|
61
61
|
loadingImage?: string;
|
62
62
|
isOpenHashTag?: boolean;
|
63
|
+
tagList: string[];
|
64
|
+
setLoading?: React.Dispatch<React.SetStateAction<boolean>>;
|
63
65
|
}
|
64
66
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
65
67
|
export interface SxpDataSourceProviderProps {
|
66
68
|
dataSources?: DataSource[];
|
67
69
|
render: (data: {
|
68
70
|
rtcList: RecItemType[];
|
71
|
+
tagList: string[];
|
69
72
|
submitForm: (body: {
|
70
73
|
attributes: Array<{
|
71
74
|
name: string;
|
@@ -5,7 +5,8 @@ import { storeAndLoadFeSessionId } from '../utils/sessionStore';
|
|
5
5
|
import { storeAndLoadFeUserId } from '../utils/localStore';
|
6
6
|
import { useIconLink } from '../components/SxpPageRender/useIconLink';
|
7
7
|
export const SxpDataSourceContext = createContext({
|
8
|
-
rtcList: []
|
8
|
+
rtcList: [],
|
9
|
+
tagList: []
|
9
10
|
});
|
10
11
|
var DataSourceType;
|
11
12
|
(function (DataSourceType) {
|
@@ -14,6 +15,7 @@ var DataSourceType;
|
|
14
15
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
15
16
|
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false }) => {
|
16
17
|
const [rtcList, setRtcList] = useState([]);
|
18
|
+
const [tagList, setTagList] = useState([]);
|
17
19
|
const [loading, setLoading] = useState(false);
|
18
20
|
const [curReqInfo, setCurReqInfo] = useState({ rtc: '', requestId: '' });
|
19
21
|
const swiperRef = useRef(null);
|
@@ -126,6 +128,18 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
126
128
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
|
127
129
|
return res === null || res === void 0 ? void 0 : res.success;
|
128
130
|
}), [bffFetch]);
|
131
|
+
const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
132
|
+
var _g, _h;
|
133
|
+
if (!utmVal)
|
134
|
+
return;
|
135
|
+
try {
|
136
|
+
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: utmVal } }));
|
137
|
+
setTagList((_h = (_g = result === null || result === void 0 ? void 0 : result.data) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []);
|
138
|
+
}
|
139
|
+
catch (e) {
|
140
|
+
console.log('e', e);
|
141
|
+
}
|
142
|
+
}), [bffFetch, utmVal]);
|
129
143
|
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
130
144
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
131
145
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
@@ -146,6 +160,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
146
160
|
}, [bffEventReport, isFromHashtag]);
|
147
161
|
useEffect(() => {
|
148
162
|
setLoading(true);
|
163
|
+
bffGetTagList();
|
149
164
|
getRecommendVideos()
|
150
165
|
.then((data) => {
|
151
166
|
var _a, _b;
|
@@ -161,6 +176,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
161
176
|
if (!isInit.current)
|
162
177
|
return;
|
163
178
|
setLoading(true);
|
179
|
+
bffGetTagList();
|
164
180
|
getRecommendVideos()
|
165
181
|
.then((data) => {
|
166
182
|
var _a, _b;
|
@@ -170,7 +186,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
170
186
|
.finally(() => {
|
171
187
|
setLoading(false);
|
172
188
|
});
|
173
|
-
}, [getRecommendVideos]);
|
189
|
+
}, [getRecommendVideos, bffGetTagList]);
|
174
190
|
const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
175
191
|
return (React.createElement(SxpDataSourceContext.Provider, { value: {
|
176
192
|
rtcList,
|
@@ -202,7 +218,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
202
218
|
appDomain,
|
203
219
|
hashTagSize,
|
204
220
|
loadingImage: loadingImage !== null && loadingImage !== void 0 ? loadingImage : defaultLoadingImage,
|
205
|
-
isOpenHashTag
|
206
|
-
|
221
|
+
isOpenHashTag,
|
222
|
+
tagList,
|
223
|
+
setLoading
|
224
|
+
} }, render({
|
225
|
+
rtcList,
|
226
|
+
mutateLike: bffMutateLike,
|
227
|
+
mutateUnlike: bffMutateUnlike,
|
228
|
+
submitForm: bffSubmitForm,
|
229
|
+
tagList
|
230
|
+
})));
|
207
231
|
};
|
208
232
|
export default memo(SxpDataSourceProvider);
|
@@ -59,10 +59,10 @@ const CommodityDetail = (_a) => {
|
|
59
59
|
React.createElement("div", { className: 'pb-commondity-content-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.title) }, (_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium'),
|
60
60
|
React.createElement("div", { className: 'pb-commondity-content-price', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price) }, priceText),
|
61
61
|
React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
62
|
-
React.createElement(ExpandableText, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
63
|
-
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
64
|
-
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
65
|
-
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
62
|
+
React.createElement(ExpandableText, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
63
|
+
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
64
|
+
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
65
|
+
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
66
66
|
18-karat gold, this necklace is embellished with hand-set diamonds.`, maxStr: 79, className: 'pb-commondity-content-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info }))));
|
67
67
|
};
|
68
68
|
const renderBtn = () => {
|
@@ -84,7 +84,7 @@ const CommodityDetailDiroNew = (_a) => {
|
|
84
84
|
const productInfoText = ({ isPost }) => {
|
85
85
|
return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
86
86
|
React.createElement(ExpandableText, { isPost: isPost, onClick: () => setShowModal(true), className: 'pb-commondityDiroNew-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (product === null || product === void 0 ? void 0 : product.info) ||
|
87
|
-
`Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
|
87
|
+
`Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
|
88
88
|
Made in Italy` })));
|
89
89
|
};
|
90
90
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
@@ -9,6 +9,7 @@ const Hashtag_1 = tslib_1.__importDefault(require("../SxpPageRender/Hashtag"));
|
|
9
9
|
const LikeButton_1 = tslib_1.__importDefault(require("../SxpPageRender/LikeButton"));
|
10
10
|
const ToggleButton_1 = tslib_1.__importDefault(require("../SxpPageRender/ToggleButton"));
|
11
11
|
const useIconLink_1 = require("../SxpPageRender/useIconLink");
|
12
|
+
const Tagbar_1 = tslib_1.__importDefault(require("../SxpPageRender/Tagbar"));
|
12
13
|
const PictureGroup_1 = tslib_1.__importDefault(require("./PictureGroup"));
|
13
14
|
const VideoWidget_1 = tslib_1.__importDefault(require("./VideoWidget"));
|
14
15
|
const _materials_ = tslib_1.__importStar(require("../../../materials"));
|
@@ -19,10 +20,17 @@ Object.values(_materials_).forEach((v) => {
|
|
19
20
|
});
|
20
21
|
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
21
22
|
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
22
|
-
const DiyPortalPreview = ({ data, globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain }) => {
|
23
|
+
const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [] }) => {
|
23
24
|
const height = (0, react_1.useMemo)(() => {
|
24
|
-
|
25
|
-
|
25
|
+
let minusHeight = 0;
|
26
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
27
|
+
minusHeight += 45;
|
28
|
+
}
|
29
|
+
if (tagList.length > 0) {
|
30
|
+
minusHeight += 45;
|
31
|
+
}
|
32
|
+
return containerHeight - minusHeight;
|
33
|
+
}, [globalConfig, containerHeight, tagList]);
|
26
34
|
const renderContent = (rec, index) => {
|
27
35
|
var _a, _b, _c, _d;
|
28
36
|
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
@@ -50,6 +58,13 @@ const DiyPortalPreview = ({ data, globalConfig, tipText, nudge, tempMap, descSty
|
|
50
58
|
}
|
51
59
|
return null;
|
52
60
|
}, [globalConfig]);
|
61
|
+
const CTA = (rec, index) => {
|
62
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
|
63
|
+
return (react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
|
64
|
+
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER })));
|
65
|
+
}
|
66
|
+
return null;
|
67
|
+
};
|
53
68
|
const renderBottom = (rec, index) => {
|
54
69
|
var _a, _b, _c, _d, _e, _f, _g;
|
55
70
|
if (rec.video) {
|
@@ -57,8 +72,7 @@ const DiyPortalPreview = ({ data, globalConfig, tipText, nudge, tempMap, descSty
|
|
57
72
|
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && react_1.default.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
58
73
|
react_1.default.createElement("div", { className: 'clc-sxp-bottom' },
|
59
74
|
react_1.default.createElement(Nudge_1.default, { nudge: nudge }),
|
60
|
-
|
61
|
-
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER })),
|
75
|
+
CTA(rec, index),
|
62
76
|
react_1.default.createElement("div", null,
|
63
77
|
react_1.default.createElement(ExpandableText_1.default, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }) })),
|
64
78
|
react_1.default.createElement(Hashtag_1.default, { index: index, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))));
|
@@ -87,8 +101,9 @@ const DiyPortalPreview = ({ data, globalConfig, tipText, nudge, tempMap, descSty
|
|
87
101
|
const unmutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png', appDomain);
|
88
102
|
const renderView = (rec, index) => {
|
89
103
|
var _a, _b, _c, _d;
|
90
|
-
return (react_1.default.createElement("div", { style: { position: 'relative' } },
|
104
|
+
return (react_1.default.createElement("div", { style: { position: 'relative', border: '1px solid #e1e1e1' } },
|
91
105
|
renderLogo,
|
106
|
+
react_1.default.createElement(Tagbar_1.default, { tagList: tagList }),
|
92
107
|
react_1.default.createElement(ToggleButton_1.default, { style: {
|
93
108
|
position: 'absolute',
|
94
109
|
right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
|
@@ -19,10 +19,10 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
|
|
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, render: ({ rtcList }) => {
|
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, render: ({ rtcList, tagList }) => {
|
23
23
|
var _a;
|
24
24
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
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, { data: rtcList, resolver: RESOLVER })),
|
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 })),
|
26
26
|
react_1.default.createElement(Popup_1.default, null)));
|
27
27
|
} })));
|
28
28
|
};
|
@@ -3,14 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
5
5
|
const Nudge = ({ nudge }) => {
|
6
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
6
7
|
return (react_1.default.createElement(react_1.default.Fragment, null, (nudge === null || nudge === void 0 ? void 0 : nudge.isOpen) && (react_1.default.createElement("div", { className: 'clc-sxp-bottom-nudge', style: {
|
7
|
-
marginBottom: nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom,
|
8
|
-
width: nudge === null || nudge === void 0 ? void 0 : nudge.size.width,
|
9
|
-
height: nudge === null || nudge === void 0 ? void 0 : nudge.size.height,
|
8
|
+
marginBottom: (_a = nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom) !== null && _a !== void 0 ? _a : 5,
|
9
|
+
width: (_c = (_b = nudge === null || nudge === void 0 ? void 0 : nudge.size) === null || _b === void 0 ? void 0 : _b.width) !== null && _c !== void 0 ? _c : 212,
|
10
|
+
height: (_e = (_d = nudge === null || nudge === void 0 ? void 0 : nudge.size) === null || _d === void 0 ? void 0 : _d.height) !== null && _e !== void 0 ? _e : 38,
|
10
11
|
backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
|
11
|
-
borderRadius: nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius
|
12
|
+
borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
|
12
13
|
} },
|
13
14
|
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? react_1.default.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover' } }) : null,
|
14
|
-
react_1.default.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, nudge === null || nudge === void 0 ? void 0 : nudge.content)))));
|
15
|
+
react_1.default.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, (_g = nudge === null || nudge === void 0 ? void 0 : nudge.content) !== null && _g !== void 0 ? _g : '')))));
|
15
16
|
};
|
16
17
|
exports.default = Nudge;
|
@@ -0,0 +1,40 @@
|
|
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 hooks_1 = require("../../../core/hooks");
|
6
|
+
const DEFAULT_TAG = 'FOR U';
|
7
|
+
const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
8
|
+
const [selectTag, setSelectTag] = (0, react_1.useState)(DEFAULT_TAG);
|
9
|
+
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = (0, hooks_1.useSxpDataSource)();
|
10
|
+
const realTagList = (0, react_1.useMemo)(() => {
|
11
|
+
return [DEFAULT_TAG, ...tagList];
|
12
|
+
}, [tagList]);
|
13
|
+
const handleSelectTag = (tag) => () => {
|
14
|
+
if (tag === selectTag)
|
15
|
+
return;
|
16
|
+
let hashTag;
|
17
|
+
if (tag !== DEFAULT_TAG) {
|
18
|
+
hashTag = tag;
|
19
|
+
}
|
20
|
+
setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
|
21
|
+
getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ hashTag }).then((res) => {
|
22
|
+
var _a, _b, _c, _d;
|
23
|
+
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
|
24
|
+
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
|
25
|
+
setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
|
26
|
+
setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(0);
|
27
|
+
(_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slideTo(0);
|
28
|
+
}).finally(() => {
|
29
|
+
setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
|
30
|
+
});
|
31
|
+
setSelectTag(tag);
|
32
|
+
};
|
33
|
+
if (tagList.length <= 0)
|
34
|
+
return null;
|
35
|
+
return (react_1.default.createElement("div", { className: 'clc-sxp-tagbar', style: { height: 45 } },
|
36
|
+
react_1.default.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
|
37
|
+
return (react_1.default.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
|
38
|
+
}))));
|
39
|
+
};
|
40
|
+
exports.default = (0, react_1.memo)(Tagbar);
|
@@ -9,6 +9,7 @@ export type postConfigType = {
|
|
9
9
|
export interface ISxpPageRenderProps {
|
10
10
|
globalConfig?: {
|
11
11
|
isShowLogo?: boolean;
|
12
|
+
isShowCTA?: boolean;
|
12
13
|
logoUrl?: string;
|
13
14
|
muteIcon?: string;
|
14
15
|
unMuteIcon?: string;
|
@@ -55,6 +56,7 @@ export interface ISxpPageRenderProps {
|
|
55
56
|
containerWidth?: number;
|
56
57
|
tempMap?: Record<string, any>;
|
57
58
|
data?: RecItemType[];
|
59
|
+
tagList?: string[];
|
58
60
|
resolver: any;
|
59
61
|
ctaType?: string;
|
60
62
|
_schema?: any;
|
@@ -24,7 +24,8 @@ require("./index.less");
|
|
24
24
|
const useEventReport_1 = require("../../../core/hooks/useEventReport");
|
25
25
|
const withBindDataSource_1 = tslib_1.__importDefault(require("../../../core/hoc/withBindDataSource"));
|
26
26
|
const localStore_1 = require("../../../core/utils/localStore");
|
27
|
-
const
|
27
|
+
const Tagbar_1 = tslib_1.__importDefault(require("./Tagbar"));
|
28
|
+
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [] }) => {
|
28
29
|
var _a, _b, _c, _d, _e, _f, _g;
|
29
30
|
const { schema } = (0, hooks_1.useEditor)();
|
30
31
|
const [activeIndex, setActiveIndex] = (0, react_1.useState)(0);
|
@@ -144,8 +145,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
144
145
|
};
|
145
146
|
}, [activeIndex, bffEventReport, curTime, data, handleH5EnterLink, popupDetailData, isFromHashtag, tempMap]);
|
146
147
|
const height = (0, react_1.useMemo)(() => {
|
147
|
-
|
148
|
-
|
148
|
+
let minusHeight = 0;
|
149
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
150
|
+
minusHeight += 45;
|
151
|
+
}
|
152
|
+
if (tagList.length > 0) {
|
153
|
+
minusHeight += 45;
|
154
|
+
}
|
155
|
+
return containerHeight - minusHeight;
|
156
|
+
}, [globalConfig, containerHeight, tagList]);
|
149
157
|
const renderLogo = (0, react_1.useMemo)(() => {
|
150
158
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
151
159
|
return (react_1.default.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
|
@@ -193,8 +201,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
193
201
|
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && react_1.default.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
194
202
|
react_1.default.createElement("div", { className: 'clc-sxp-bottom' },
|
195
203
|
react_1.default.createElement(Nudge_1.default, { nudge: nudge }),
|
196
|
-
react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
|
197
|
-
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
|
204
|
+
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
|
205
|
+
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver }))) : null,
|
198
206
|
react_1.default.createElement("div", null,
|
199
207
|
react_1.default.createElement(ExpandableText_1.default, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
|
200
208
|
react_1.default.createElement(Hashtag_1.default, { index: activeIndex, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle })))));
|
@@ -351,6 +359,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
351
359
|
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
352
360
|
} })),
|
353
361
|
renderLogo,
|
362
|
+
react_1.default.createElement(Tagbar_1.default, { tagList: tagList, setActiveIndex: setActiveIndex }),
|
354
363
|
isShowFingerTip ? react_1.default.createElement(FingerSwipeTip_1.default, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
|
355
364
|
react_1.default.createElement(react_2.Swiper, { ref: swiperRef, onActiveIndexChange: (swiper) => {
|
356
365
|
setActiveIndex(swiper.activeIndex);
|
@@ -60,12 +60,15 @@ export interface ISxpDataSourceContext {
|
|
60
60
|
hashTagSize?: number;
|
61
61
|
loadingImage?: string;
|
62
62
|
isOpenHashTag?: boolean;
|
63
|
+
tagList: string[];
|
64
|
+
setLoading?: React.Dispatch<React.SetStateAction<boolean>>;
|
63
65
|
}
|
64
66
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
65
67
|
export interface SxpDataSourceProviderProps {
|
66
68
|
dataSources?: DataSource[];
|
67
69
|
render: (data: {
|
68
70
|
rtcList: RecItemType[];
|
71
|
+
tagList: string[];
|
69
72
|
submitForm: (body: {
|
70
73
|
attributes: Array<{
|
71
74
|
name: string;
|