pb-sxp-ui 1.0.2 → 1.0.3-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3624 -1460
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +143 -245
- package/dist/index.js +3625 -1461
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -5
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -5
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +3624 -1460
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -5
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageCore/index.d.ts +1 -0
- package/es/core/components/SxpPageCore/index.js +2 -2
- package/es/core/components/SxpPageRender/ExpandableText.d.ts +1 -0
- package/es/core/components/SxpPageRender/ExpandableText.js +17 -10
- package/es/core/components/SxpPageRender/Hashtag/index.d.ts +2 -1
- package/es/core/components/SxpPageRender/Hashtag/index.js +3 -3
- package/es/core/components/SxpPageRender/Modal/index.d.ts +2 -0
- package/es/core/components/SxpPageRender/Modal/index.js +7 -4
- package/es/core/components/SxpPageRender/Navbar.d.ts +1 -0
- package/es/core/components/SxpPageRender/Navbar.js +3 -2
- package/es/core/components/SxpPageRender/Nudge/index.d.ts +24 -0
- package/es/core/components/SxpPageRender/Nudge/index.js +13 -0
- package/es/core/components/SxpPageRender/PictureGroup/index.js +11 -7
- package/es/core/components/SxpPageRender/Popup/index.js +3 -3
- package/es/core/components/SxpPageRender/VideoWidget/index.js +30 -21
- package/es/core/components/SxpPageRender/WaterFall/List.d.ts +2 -1
- package/es/core/components/SxpPageRender/WaterFall/List.js +24 -14
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.d.ts +2 -1
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +17 -14
- package/es/core/components/SxpPageRender/WaterFall/index.d.ts +2 -1
- package/es/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/es/core/components/SxpPageRender/WaterFall/preview.json +1242 -0
- package/es/core/components/SxpPageRender/index.d.ts +22 -1
- package/es/core/components/SxpPageRender/index.js +22 -19
- package/es/core/components/SxpPageRender/typing.d.ts +1 -0
- package/es/core/components/SxpPageRender/useIconLink.d.ts +1 -1
- package/es/core/components/SxpPageRender/useIconLink.js +8 -3
- package/es/core/context/EditorContext.d.ts +5 -0
- package/es/core/context/EditorContext.js +21 -3
- package/es/core/context/EditorDataProvider.d.ts +3 -1
- package/es/core/context/EditorDataProvider.js +5 -2
- package/es/core/context/SxpDataSourceProvider.d.ts +2 -0
- package/es/core/context/SxpDataSourceProvider.js +8 -4
- package/es/core/create.d.ts +1 -1
- package/es/materials/sxp/HashTag/index.d.ts +14 -0
- package/es/materials/sxp/HashTag/index.js +6 -0
- package/es/materials/sxp/HashTag/material.d.ts +2 -0
- package/es/materials/sxp/HashTag/material.js +52 -0
- package/es/materials/sxp/HashTag/settingRender.d.ts +122 -0
- package/es/materials/sxp/HashTag/settingRender.js +153 -0
- package/es/materials/sxp/index.d.ts +1 -0
- package/es/materials/sxp/index.js +1 -0
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +20 -1
- package/es/materials/sxp/popup/CommodityDetail/index.js +44 -21
- package/es/materials/sxp/popup/CommodityDetail/material.js +36 -1
- package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +134 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +167 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +13 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +20 -17
- package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +46 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +134 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +171 -0
- package/es/materials/sxp/popup/index.d.ts +0 -1
- package/es/materials/sxp/popup/index.js +0 -1
- package/es/materials/sxp/template/Appoint/index.d.ts +2 -0
- package/es/materials/sxp/template/Appoint/index.js +4 -18
- package/es/materials/sxp/template/Appoint/material.js +22 -6
- package/es/materials/sxp/template/Commodity/index.d.ts +2 -0
- package/es/materials/sxp/template/Commodity/index.js +5 -22
- package/es/materials/sxp/template/Commodity/material.js +31 -6
- package/es/materials/sxp/template/CommodityDiro/index.d.ts +2 -0
- package/es/materials/sxp/template/CommodityDiro/index.js +5 -24
- package/es/materials/sxp/template/CommodityDiro/material.js +30 -5
- package/es/materials/sxp/template/CommodityDiroNew/index.d.ts +2 -0
- package/es/materials/sxp/template/CommodityDiroNew/index.js +5 -24
- package/es/materials/sxp/template/CommodityDiroNew/material.js +32 -6
- package/es/materials/sxp/template/Link/index.d.ts +2 -0
- package/es/materials/sxp/template/Link/index.js +4 -13
- package/es/materials/sxp/template/Link/material.js +22 -5
- package/es/materials/sxp/template/MultiCommodity/index.d.ts +2 -0
- package/es/materials/sxp/template/MultiCommodity/index.js +8 -24
- package/es/materials/sxp/template/MultiCommodity/material.js +30 -5
- package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +2 -0
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +8 -27
- package/es/materials/sxp/template/MultiCommodityDiro/material.js +31 -6
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +2 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +8 -25
- package/es/materials/sxp/template/MultiCommodityDiroNew/material.js +32 -6
- package/es/materials/sxp/template/components/EventProvider.d.ts +2 -1
- package/es/materials/sxp/template/components/EventProvider.js +5 -4
- package/es/materials/sxp/template/components/settingRender.d.ts +123 -0
- package/es/materials/sxp/template/components/settingRender.js +215 -0
- package/es/materials/sxp/template/components/typing.d.ts +6 -0
- package/es/materials/sxp/template/components/typing.js +1 -0
- package/lib/core/components/SxpPageCore/index.d.ts +1 -0
- package/lib/core/components/SxpPageCore/index.js +2 -2
- package/lib/core/components/SxpPageRender/ExpandableText.d.ts +1 -0
- package/lib/core/components/SxpPageRender/ExpandableText.js +17 -10
- package/lib/core/components/SxpPageRender/Hashtag/index.d.ts +2 -1
- package/lib/core/components/SxpPageRender/Hashtag/index.js +3 -3
- package/lib/core/components/SxpPageRender/Modal/index.d.ts +2 -0
- package/lib/core/components/SxpPageRender/Modal/index.js +7 -4
- package/lib/core/components/SxpPageRender/Navbar.d.ts +1 -0
- package/lib/core/components/SxpPageRender/Navbar.js +3 -2
- package/lib/core/components/SxpPageRender/Nudge/index.d.ts +24 -0
- package/lib/core/components/SxpPageRender/Nudge/index.js +16 -0
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +10 -6
- package/lib/core/components/SxpPageRender/Popup/index.js +3 -3
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +30 -21
- package/lib/core/components/SxpPageRender/WaterFall/List.d.ts +2 -1
- package/lib/core/components/SxpPageRender/WaterFall/List.js +23 -14
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.d.ts +2 -1
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +15 -13
- package/lib/core/components/SxpPageRender/WaterFall/index.d.ts +2 -1
- package/lib/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/lib/core/components/SxpPageRender/WaterFall/preview.json +1242 -0
- package/lib/core/components/SxpPageRender/index.d.ts +22 -1
- package/lib/core/components/SxpPageRender/index.js +22 -19
- package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
- package/lib/core/components/SxpPageRender/useIconLink.d.ts +1 -1
- package/lib/core/components/SxpPageRender/useIconLink.js +8 -3
- package/lib/core/context/EditorContext.d.ts +5 -0
- package/lib/core/context/EditorContext.js +21 -3
- package/lib/core/context/EditorDataProvider.d.ts +3 -1
- package/lib/core/context/EditorDataProvider.js +4 -1
- package/lib/core/context/SxpDataSourceProvider.d.ts +2 -0
- package/lib/core/context/SxpDataSourceProvider.js +8 -4
- package/lib/core/create.d.ts +1 -1
- package/lib/materials/sxp/HashTag/index.d.ts +14 -0
- package/lib/materials/sxp/HashTag/index.js +9 -0
- package/lib/materials/sxp/HashTag/material.d.ts +2 -0
- package/lib/materials/sxp/HashTag/material.js +56 -0
- package/lib/materials/sxp/HashTag/settingRender.d.ts +122 -0
- package/lib/materials/sxp/HashTag/settingRender.js +155 -0
- package/lib/materials/sxp/index.d.ts +1 -0
- package/lib/materials/sxp/index.js +1 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +20 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +43 -20
- package/lib/materials/sxp/popup/CommodityDetail/material.js +36 -1
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +134 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +169 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +13 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +20 -17
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +46 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +134 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +173 -0
- package/lib/materials/sxp/popup/index.d.ts +0 -1
- package/lib/materials/sxp/popup/index.js +0 -1
- package/lib/materials/sxp/template/Appoint/index.d.ts +2 -0
- package/lib/materials/sxp/template/Appoint/index.js +4 -18
- package/lib/materials/sxp/template/Appoint/material.js +22 -6
- package/lib/materials/sxp/template/Commodity/index.d.ts +2 -0
- package/lib/materials/sxp/template/Commodity/index.js +5 -22
- package/lib/materials/sxp/template/Commodity/material.js +31 -6
- package/lib/materials/sxp/template/CommodityDiro/index.d.ts +2 -0
- package/lib/materials/sxp/template/CommodityDiro/index.js +5 -24
- package/lib/materials/sxp/template/CommodityDiro/material.js +30 -5
- package/lib/materials/sxp/template/CommodityDiroNew/index.d.ts +2 -0
- package/lib/materials/sxp/template/CommodityDiroNew/index.js +5 -24
- package/lib/materials/sxp/template/CommodityDiroNew/material.js +32 -6
- package/lib/materials/sxp/template/Link/index.d.ts +2 -0
- package/lib/materials/sxp/template/Link/index.js +4 -13
- package/lib/materials/sxp/template/Link/material.js +22 -5
- package/lib/materials/sxp/template/MultiCommodity/index.d.ts +2 -0
- package/lib/materials/sxp/template/MultiCommodity/index.js +7 -23
- package/lib/materials/sxp/template/MultiCommodity/material.js +30 -5
- package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +2 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +7 -26
- package/lib/materials/sxp/template/MultiCommodityDiro/material.js +31 -6
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +2 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +7 -24
- package/lib/materials/sxp/template/MultiCommodityDiroNew/material.js +32 -6
- package/lib/materials/sxp/template/components/EventProvider.d.ts +2 -1
- package/lib/materials/sxp/template/components/EventProvider.js +4 -3
- package/lib/materials/sxp/template/components/settingRender.d.ts +123 -0
- package/lib/materials/sxp/template/components/settingRender.js +217 -0
- package/lib/materials/sxp/template/components/typing.d.ts +6 -0
- package/lib/materials/sxp/template/components/typing.js +2 -0
- package/package.json +1 -1
@@ -8,7 +8,7 @@ const RESOLVER = {};
|
|
8
8
|
Object.values(_materials_).forEach((v) => {
|
9
9
|
RESOLVER[v.extend.type] = v;
|
10
10
|
});
|
11
|
-
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage }) => {
|
11
|
+
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain }) => {
|
12
12
|
var _a, _b, _c, _d, _e, _f;
|
13
13
|
const utmVal = useMemo(() => {
|
14
14
|
var _a;
|
@@ -16,7 +16,7 @@ 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, 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 }) => {
|
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, { data: rtcList, resolver: RESOLVER })),
|
@@ -15,7 +15,7 @@ const limitTextLastWholeWord = (originalText = '', limit) => {
|
|
15
15
|
const _words = newWords.length > 1 && newWords.length < words.length ? newWords.slice(0, newWords.length - 1) : newWords;
|
16
16
|
return _words.join(' ') + ' ';
|
17
17
|
};
|
18
|
-
const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldText, unfoldText }) => {
|
18
|
+
const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldText, unfoldText, isPost }) => {
|
19
19
|
const [isShowMore, setIsShowMore] = useState(true);
|
20
20
|
const [isShow, setIsShow] = useState(false);
|
21
21
|
const lineClamp = Number((style === null || style === void 0 ? void 0 : style.lineClamp) || 2);
|
@@ -27,20 +27,27 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
27
27
|
return !isShowMore && text.length > maxStr ? limitTextLastWholeWord(text, maxStr) + '...' : text;
|
28
28
|
}, [text, maxStr, isShowMore]);
|
29
29
|
useEffect(() => {
|
30
|
-
if (multiRow.current) {
|
30
|
+
if (multiRow.current && isPost) {
|
31
31
|
setIsShowMore(true);
|
32
32
|
setTimeout(() => {
|
33
|
+
var _a;
|
33
34
|
setIsShow(false);
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
35
|
+
try {
|
36
|
+
const cs = (_a = window === null || window === void 0 ? void 0 : window.getComputedStyle) === null || _a === void 0 ? void 0 : _a.call(window, multiRow.current);
|
37
|
+
const height = parseFloat(cs === null || cs === void 0 ? void 0 : cs.height);
|
38
|
+
const lh = parseFloat(cs === null || cs === void 0 ? void 0 : cs.lineHeight);
|
39
|
+
const fs = parseFloat(cs === null || cs === void 0 ? void 0 : cs.fontSize) + 4;
|
40
|
+
const lineHeight = isNaN(lh) ? fs : lh;
|
41
|
+
if (text && height > lineHeight * lineClamp) {
|
42
|
+
setIsShowMore(false);
|
43
|
+
setIsShow(true);
|
44
|
+
}
|
39
45
|
}
|
46
|
+
catch (_b) { }
|
40
47
|
}, 100);
|
41
48
|
}
|
42
|
-
}, [multiRow, text, lineClamp, style]);
|
43
|
-
return (React.createElement("div", { className: className, style: Object.assign({}, style) },
|
49
|
+
}, [multiRow, text, lineClamp, style, isPost]);
|
50
|
+
return (React.createElement("div", { className: className, style: Object.assign({}, style), hidden: !text || text === '' },
|
44
51
|
React.createElement("div", { ref: multiRow, style: {
|
45
52
|
overflow: 'hidden',
|
46
53
|
WebkitLineClamp: !isShowMore ? lineClamp : '',
|
@@ -48,7 +55,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
48
55
|
display: '-webkit-box',
|
49
56
|
WebkitBoxOrient: 'vertical',
|
50
57
|
wordBreak: 'break-word'
|
51
|
-
}
|
58
|
+
}, dangerouslySetInnerHTML: { __html: text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>') } }),
|
52
59
|
isShow && text && (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick }, isShowMore ? unfoldText || 'show less' : foldText || 'show more'))));
|
53
60
|
};
|
54
61
|
export default memo(ExpandableText);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { CSSProperties } from 'react';
|
2
2
|
import { RecItemType } from '../typing';
|
3
3
|
interface IHashtagProps {
|
4
4
|
tags: string[];
|
@@ -6,6 +6,7 @@ interface IHashtagProps {
|
|
6
6
|
itemType: 'VIDEO' | 'PRODUCT' | null;
|
7
7
|
index: number;
|
8
8
|
rec: RecItemType;
|
9
|
+
hashTagStyle?: CSSProperties;
|
9
10
|
}
|
10
11
|
declare const _default: React.NamedExoticComponent<IHashtagProps>;
|
11
12
|
export default _default;
|
@@ -2,9 +2,9 @@ import React, { memo, useMemo, useState } from 'react';
|
|
2
2
|
import { SwiperSlide } from 'swiper/react';
|
3
3
|
import { useSxpDataSource } from '../../../../core/hooks';
|
4
4
|
import Scroll from '../../../../materials/sxp/template/components/Scroll';
|
5
|
-
const Hashtag = ({ tags, itemId, itemType, index, rec }) => {
|
5
|
+
const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle }) => {
|
6
6
|
const [isShowMore, setIsShowMore] = useState(false);
|
7
|
-
const { setWaterFallData, setOpenHashtag,
|
7
|
+
const { setWaterFallData, setOpenHashtag, setCacheActiveIndex, waterFallData, setIsFromHashtag } = useSxpDataSource();
|
8
8
|
const handleClickTag = (data) => {
|
9
9
|
if (!waterFallData) {
|
10
10
|
setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(index);
|
@@ -35,6 +35,6 @@ const Hashtag = ({ tags, itemId, itemType, index, rec }) => {
|
|
35
35
|
return (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer', color: '#fff' }, onClick: () => setIsShowMore(!isShowMore) }, isShowMore ? 'show less' : 'show more'));
|
36
36
|
}, [isShowMore, tags]);
|
37
37
|
return (React.createElement("div", { className: 'clc-sxp-bottom-hashtag' },
|
38
|
-
React.createElement(Scroll, null, tags === null || tags === void 0 ? void 0 : tags.map((item, index) => (React.createElement(SwiperSlide, { key: index, hidden: !isShowMore ? index >= 6 : false, className: 'clc-sxp-bottom-hashtag-item', onClick: () => handleClickTag(item) }, `#${item}`))))));
|
38
|
+
React.createElement(Scroll, null, tags === null || tags === void 0 ? void 0 : tags.map((item, index) => (React.createElement(SwiperSlide, { key: index, hidden: !isShowMore ? index >= 6 : false, className: 'clc-sxp-bottom-hashtag-item', style: hashTagStyle, onClick: () => handleClickTag(item) }, `#${item}`))))));
|
39
39
|
};
|
40
40
|
export default memo(Hashtag);
|
@@ -1,8 +1,10 @@
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
2
|
+
import { IPopupAniType } from '../../../../core/context/EditorContext';
|
2
3
|
interface IModalProps {
|
3
4
|
visible?: boolean;
|
4
5
|
padding?: number | string;
|
5
6
|
modalStyle?: CSSProperties;
|
7
|
+
popupAniData?: IPopupAniType;
|
6
8
|
onClose?: () => void;
|
7
9
|
}
|
8
10
|
declare const _default: React.NamedExoticComponent<React.PropsWithChildren<IModalProps>>;
|
@@ -1,8 +1,11 @@
|
|
1
1
|
import { debounce } from 'lodash';
|
2
2
|
import React, { memo, useEffect, useRef, useState } from 'react';
|
3
3
|
import * as ReactDOM from 'react-dom';
|
4
|
+
import { useEditor } from '../../../../core/hooks';
|
4
5
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
5
|
-
const Modal = ({ visible, onClose, children, modalStyle, padding }) => {
|
6
|
+
const Modal = ({ visible, onClose, children, modalStyle, padding, popupAniData }) => {
|
7
|
+
const { popupAni } = useEditor();
|
8
|
+
const cssAni = popupAniData !== null && popupAniData !== void 0 ? popupAniData : popupAni;
|
6
9
|
const [isShow, setIsShow] = useState(false);
|
7
10
|
const modalEleRef = useRef(null);
|
8
11
|
useEffect(() => {
|
@@ -24,16 +27,16 @@ const Modal = ({ visible, onClose, children, modalStyle, padding }) => {
|
|
24
27
|
else {
|
25
28
|
setTimeout(() => {
|
26
29
|
setIsShow(false);
|
27
|
-
},
|
30
|
+
}, cssAni === null || cssAni === void 0 ? void 0 : cssAni.duration);
|
28
31
|
}
|
29
|
-
}, [visible]);
|
32
|
+
}, [visible, cssAni]);
|
30
33
|
if (!modalEleRef.current)
|
31
34
|
return null;
|
32
35
|
const handleClose = debounce(() => {
|
33
36
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
34
37
|
}, 300);
|
35
38
|
return ReactDOM.createPortal(React.createElement("div", { className: 'modal-bg', style: Object.assign({ display: isShow ? 'flex' : 'none', backgroundColor: visible ? 'rgba(0, 0, 0, 0.7)' : 'rgba(0, 0, 0, 0)' }, modalStyle), onClick: handleClose },
|
36
|
-
React.createElement("div", { className: `modal-container ${visible ? 'modal-popIn' : 'modal-popOut'}`, style: { padding }, onClick: (e) => {
|
39
|
+
React.createElement("div", { className: `modal-container ${visible ? 'modal-popIn' : 'modal-popOut'}`, style: { padding, animationDuration: (cssAni === null || cssAni === void 0 ? void 0 : cssAni.duration) / 1000 + 's' }, onClick: (e) => {
|
37
40
|
e.stopPropagation();
|
38
41
|
e.preventDefault();
|
39
42
|
} },
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import React, { memo } from 'react';
|
2
2
|
import { useSxpDataSource } from '../../../core/hooks';
|
3
|
-
const Navbar = ({ icon, styles, onClose }) => {
|
3
|
+
const Navbar = ({ icon, styles, textStyle, onClose }) => {
|
4
|
+
var _a;
|
4
5
|
const { waterFallData, setOpenHashtag } = useSxpDataSource();
|
5
6
|
return (React.createElement("div", { className: 'clc-sxp-nav', style: styles },
|
6
7
|
React.createElement("img", { className: 'clc-sxp-nav-left', src: icon, alt: '', onClick: onClose }),
|
7
|
-
React.createElement("div", { className: 'clc-sxp-nav-title' }, `#${waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag}`)));
|
8
|
+
React.createElement("div", { className: 'clc-sxp-nav-title', style: textStyle }, `#${(_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag) !== null && _a !== void 0 ? _a : '标题'}`)));
|
8
9
|
};
|
9
10
|
export default memo(Navbar);
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { FC } from 'react';
|
2
|
+
interface IProps {
|
3
|
+
nudge?: {
|
4
|
+
isOpen: boolean;
|
5
|
+
icon?: string;
|
6
|
+
backgroundColor: string;
|
7
|
+
content?: string;
|
8
|
+
marginBottom: number;
|
9
|
+
borderRadius: number;
|
10
|
+
size: {
|
11
|
+
height: number;
|
12
|
+
width: number;
|
13
|
+
};
|
14
|
+
textStyle: {
|
15
|
+
color: string;
|
16
|
+
fontFamily: string;
|
17
|
+
fontSize: number;
|
18
|
+
fontStyle: string;
|
19
|
+
textAlign: string;
|
20
|
+
};
|
21
|
+
};
|
22
|
+
}
|
23
|
+
declare const Nudge: FC<IProps>;
|
24
|
+
export default Nudge;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
const Nudge = ({ nudge }) => {
|
3
|
+
return (React.createElement("div", { hidden: !(nudge === null || nudge === void 0 ? void 0 : nudge.isOpen), 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,
|
7
|
+
backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
|
8
|
+
borderRadius: nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius
|
9
|
+
} },
|
10
|
+
(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
|
+
};
|
13
|
+
export default Nudge;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { memo, useEffect } from 'react';
|
1
|
+
import React, { memo, useEffect, useState } from 'react';
|
2
2
|
import { Autoplay, Pagination } from 'swiper/modules';
|
3
3
|
import { Swiper, SwiperSlide, useSwiperSlide } from 'swiper/react';
|
4
4
|
import Picture from './Picture';
|
@@ -6,16 +6,20 @@ import { useSxpDataSource } from '../../../../core/hooks';
|
|
6
6
|
const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent }) => {
|
7
7
|
const { isActive } = useSwiperSlide();
|
8
8
|
const { sxpParameter, openHashtag } = useSxpDataSource();
|
9
|
+
const [isLoad, setIsLoad] = useState(false);
|
9
10
|
useEffect(() => {
|
10
|
-
if (
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
if (isLoad && isActive) {
|
12
|
+
if (openHashtag) {
|
13
|
+
onReportViewImageEnd(rec);
|
14
|
+
}
|
15
|
+
else {
|
16
|
+
onViewImageStartEvent(index);
|
17
|
+
}
|
14
18
|
}
|
15
19
|
else {
|
16
|
-
|
20
|
+
setIsLoad(true);
|
17
21
|
}
|
18
|
-
}, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent]);
|
22
|
+
}, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad]);
|
19
23
|
if (!isActive) {
|
20
24
|
return React.createElement("img", { src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, style: { width, height, objectFit: 'cover' } });
|
21
25
|
}
|
@@ -4,7 +4,7 @@ import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
|
4
4
|
import withBindDataSource from '../../../../core/hoc/withBindDataSource';
|
5
5
|
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
6
6
|
const Popup = () => {
|
7
|
-
const { schema, resolver, popup } = useEditor();
|
7
|
+
const { schema, resolver, popup, popupAni } = useEditor();
|
8
8
|
const { setPopupDetailData, popupDetailData, bffEventReport } = useSxpDataSource();
|
9
9
|
const { productView } = useEventReport();
|
10
10
|
const [visible, setVisible] = useState(false);
|
@@ -27,7 +27,7 @@ const Popup = () => {
|
|
27
27
|
}, [popup]);
|
28
28
|
const handleClose = () => {
|
29
29
|
var _a, _b, _c;
|
30
|
-
if (!popup || popup === '' || !visible || new Date() - curTimeRef.current <
|
30
|
+
if (!popup || popup === '' || !visible || new Date() - curTimeRef.current < (popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration)) {
|
31
31
|
return;
|
32
32
|
}
|
33
33
|
setVisible(false);
|
@@ -40,7 +40,7 @@ const Popup = () => {
|
|
40
40
|
setTimeout(() => {
|
41
41
|
window === null || window === void 0 ? void 0 : window.sxpPopup('');
|
42
42
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(null);
|
43
|
-
},
|
43
|
+
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
44
44
|
};
|
45
45
|
const renderPopupDetail = useMemo(() => {
|
46
46
|
var _a, _b, _c;
|
@@ -16,8 +16,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
16
16
|
videoRef.current.muted = muted;
|
17
17
|
}, [muted]);
|
18
18
|
const handleVideoStart = useCallback(() => {
|
19
|
-
var _a;
|
20
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.
|
19
|
+
var _a, _b;
|
20
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.readyState) < 2)
|
21
|
+
return;
|
22
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
|
21
23
|
}, []);
|
22
24
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
23
25
|
const handlePlaying = useCallback(() => {
|
@@ -74,37 +76,38 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
74
76
|
});
|
75
77
|
}
|
76
78
|
setTimeout(() => {
|
77
|
-
var _a;
|
78
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.
|
79
|
+
var _a, _b;
|
80
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.readyState) < 2)
|
81
|
+
return;
|
82
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
|
79
83
|
}, 0);
|
80
84
|
}, [index, bffEventReport, data, isLoad]);
|
81
85
|
const handleClickVideo = useCallback((type) => () => {
|
82
|
-
var _a, _b, _c, _d, _e, _f
|
86
|
+
var _a, _b, _c, _d, _e, _f;
|
87
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.readyState) < 2)
|
88
|
+
return;
|
83
89
|
if (!isLoad)
|
84
90
|
return;
|
85
|
-
const
|
86
|
-
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
87
|
-
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
88
|
-
const isPause = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.paused;
|
91
|
+
const isPause = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.paused;
|
89
92
|
switch (type) {
|
90
93
|
case 'start':
|
91
94
|
if (!isPause)
|
92
95
|
return;
|
93
|
-
(
|
96
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
|
94
97
|
setIsPauseVideo(false);
|
95
98
|
break;
|
96
99
|
case 'pause':
|
97
100
|
if (isPause)
|
98
101
|
return;
|
99
|
-
(
|
102
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.pause();
|
100
103
|
setIsPauseVideo(true);
|
101
104
|
break;
|
102
105
|
default:
|
103
106
|
if (isPause) {
|
104
|
-
(
|
107
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
105
108
|
}
|
106
109
|
else {
|
107
|
-
(
|
110
|
+
(_f = videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
108
111
|
}
|
109
112
|
setIsPauseVideo(!isPause);
|
110
113
|
break;
|
@@ -135,14 +138,16 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
135
138
|
}
|
136
139
|
}, [data, index, bffEventReport]);
|
137
140
|
useEffect(() => {
|
138
|
-
var _a, _b, _c;
|
141
|
+
var _a, _b, _c, _d, _e, _f;
|
139
142
|
if (data.length <= 0)
|
140
143
|
return;
|
141
144
|
if (!videoRef.current)
|
142
145
|
return;
|
146
|
+
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
143
147
|
setIsPauseVideo(false);
|
144
148
|
if (!isActive) {
|
145
|
-
(
|
149
|
+
if (!isPause && ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.readyState) >= 2)
|
150
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
146
151
|
return;
|
147
152
|
}
|
148
153
|
if (!videoRef.current.src) {
|
@@ -152,10 +157,12 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
152
157
|
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
153
158
|
}
|
154
159
|
else {
|
160
|
+
if (((_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.readyState) < 2)
|
161
|
+
return;
|
155
162
|
videoRef.current.play();
|
156
163
|
}
|
157
|
-
(
|
158
|
-
(
|
164
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('canplay', handleLoadedMetadata);
|
165
|
+
(_f = videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
159
166
|
return () => {
|
160
167
|
var _a, _b;
|
161
168
|
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('canplay', handleLoadedMetadata);
|
@@ -163,15 +170,17 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
163
170
|
};
|
164
171
|
}, [data, handleLoadedMetadata, handlePlaying, isActive, isLoad, rec.video]);
|
165
172
|
useEffect(() => {
|
166
|
-
var _a, _b, _c;
|
167
|
-
|
173
|
+
var _a, _b, _c, _d;
|
174
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.readyState) < 2)
|
175
|
+
return;
|
176
|
+
const isPause = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.paused;
|
168
177
|
if (!isActive)
|
169
178
|
return;
|
170
179
|
if (!isPause && openHashtag) {
|
171
|
-
(
|
180
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
172
181
|
}
|
173
182
|
else if (!openHashtag) {
|
174
|
-
(
|
183
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
175
184
|
}
|
176
185
|
}, [openHashtag, isActive]);
|
177
186
|
useEffect(() => {
|
@@ -1,3 +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;
|
@@ -1,8 +1,10 @@
|
|
1
|
+
import { __rest } from "tslib";
|
1
2
|
import React, { useState, useEffect, useMemo, useRef, useCallback } from 'react';
|
2
3
|
import './List.less';
|
4
|
+
import previewData from './preview.json';
|
3
5
|
import { useSxpDataSource } from '../../../../core/hooks';
|
4
6
|
const WaterfallFlowItem = (props) => {
|
5
|
-
const { rec, index, list, reportTagsView } = props;
|
7
|
+
const { rec, index, list, reportTagsView, textStyles, space } = props;
|
6
8
|
const { swiperRef, setRtcList, setOpenHashtag, bffEventReport, sxpParameter } = useSxpDataSource();
|
7
9
|
const [showVideo, setShowVideo] = useState(false);
|
8
10
|
const imgDom = useRef(null);
|
@@ -102,19 +104,20 @@ const WaterfallFlowItem = (props) => {
|
|
102
104
|
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(false);
|
103
105
|
}, 0);
|
104
106
|
};
|
105
|
-
return (React.createElement("div", { className: 'list-content-listItem', key: index, onClick: handleClickToDetail },
|
107
|
+
return (React.createElement("div", { className: 'list-content-listItem', key: index, onClick: handleClickToDetail, style: { marginBottom: space } },
|
106
108
|
React.createElement("div", { className: 'list-content-listItem-picture' },
|
107
109
|
showVideo && (React.createElement("div", { style: { display: 'none' } },
|
108
110
|
React.createElement("video", { ref: videoDom, crossOrigin: 'anonymous', className: 'list-content-listItem-picture-img' }),
|
109
111
|
React.createElement("canvas", { ref: canvasRef }))),
|
110
112
|
React.createElement("img", { className: 'list-content-listItem-picture-img', loading: 'lazy', ref: imgDom })),
|
111
113
|
React.createElement("div", { className: 'list-content-listItem-info' },
|
112
|
-
React.createElement("div", { className: `${'list-content-listItem-info-title'} ${priceText ? 'list-content-listItem-info-nowrap' : ''}
|
113
|
-
React.createElement("div", { className: 'list-content-listItem-info-price', hidden: !priceText }, priceText))));
|
114
|
+
React.createElement("div", { className: `${'list-content-listItem-info-title'} ${priceText ? 'list-content-listItem-info-nowrap' : ''}`, style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.title }, title && title),
|
115
|
+
React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles.price, hidden: !priceText }, priceText))));
|
114
116
|
};
|
115
|
-
export default function WaterfallList(
|
116
|
-
var
|
117
|
-
|
117
|
+
export default function WaterfallList(_a) {
|
118
|
+
var _b, _c, _d, _e, _f, _g, _h;
|
119
|
+
var { reportTagsView } = _a, props = __rest(_a, ["reportTagsView"]);
|
120
|
+
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
|
118
121
|
const [list, setList] = useState();
|
119
122
|
const [data, setData] = useState();
|
120
123
|
const [isLoadingData, setIsLoadingData] = useState(false);
|
@@ -136,6 +139,7 @@ export default function WaterfallList({ reportTagsView }) {
|
|
136
139
|
}));
|
137
140
|
}, [waterFallData, getRecommendVideos, list, isLoadMore]);
|
138
141
|
useEffect(() => {
|
142
|
+
var _a, _b;
|
139
143
|
setIsLoadingData(true);
|
140
144
|
waterFallData &&
|
141
145
|
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
|
@@ -149,7 +153,13 @@ export default function WaterfallList({ reportTagsView }) {
|
|
149
153
|
setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
|
150
154
|
setIsLoadingData(false);
|
151
155
|
}));
|
152
|
-
|
156
|
+
if (isOpenHashTag) {
|
157
|
+
const res = previewData;
|
158
|
+
setData(res);
|
159
|
+
setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
|
160
|
+
setIsLoadingData(false);
|
161
|
+
}
|
162
|
+
}, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
|
153
163
|
const handleClickLink = () => {
|
154
164
|
var _a, _b;
|
155
165
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
@@ -160,14 +170,14 @@ export default function WaterfallList({ reportTagsView }) {
|
|
160
170
|
return (React.createElement(React.Fragment, null, isLoadingData ? (React.createElement("div", { style: { height: '100%', width: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
161
171
|
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { className: 'list' },
|
162
172
|
React.createElement("div", { className: 'list-scroll', ref: containerRef, style: {
|
163
|
-
bottom: ((
|
173
|
+
bottom: ((_b = data === null || data === void 0 ? void 0 : data.tag) === null || _b === void 0 ? void 0 : _b.link) ? '100px' : 0
|
164
174
|
} },
|
165
|
-
React.createElement("div", { className: 'list-info' }, (
|
166
|
-
React.createElement("div", { hidden: !((
|
175
|
+
React.createElement("div", { className: 'list-info', style: (_c = props === null || props === void 0 ? void 0 : props.textStyles) === null || _c === void 0 ? void 0 : _c.hashTagDesc }, (_d = data === null || data === void 0 ? void 0 : data.tag) === null || _d === void 0 ? void 0 : _d.info),
|
176
|
+
React.createElement("div", { hidden: !((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link), className: 'list-collection', onClick: handleClickLink, style: { marginBottom: props === null || props === void 0 ? void 0 : props.space } }, ((_f = data === null || data === void 0 ? void 0 : data.tag) === null || _f === void 0 ? void 0 : _f.linkTitle) || 'Shop the collection'),
|
167
177
|
React.createElement("div", { className: 'list-content' }, list === null || list === void 0 ? void 0 : list.map((item, ind) => {
|
168
|
-
return (React.createElement(WaterfallFlowItem, { key: ind, index: ind, rec: item, list: list, reportTagsView: reportTagsView }));
|
178
|
+
return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, rec: item, list: list, reportTagsView: reportTagsView }, props)));
|
169
179
|
})),
|
170
180
|
React.createElement("div", { hidden: !isLoadMore, style: { textAlign: 'center' } }, "loading...")),
|
171
|
-
React.createElement("div", { className: 'list-bottom', hidden: !((
|
172
|
-
React.createElement("button", { className: 'list-bottom-btn', onClick: handleClickLink }, ((
|
181
|
+
React.createElement("div", { className: 'list-bottom', hidden: !((_g = data === null || data === void 0 ? void 0 : data.tag) === null || _g === void 0 ? void 0 : _g.link) },
|
182
|
+
React.createElement("button", { className: 'list-bottom-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_h = data === null || data === void 0 ? void 0 : data.tag) === null || _h === void 0 ? void 0 : _h.linkTitle) || 'Shop the collection'))))));
|
173
183
|
}
|
@@ -1,3 +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;
|
@@ -1,8 +1,9 @@
|
|
1
|
+
import { __rest } from "tslib";
|
1
2
|
import React, { useState, useEffect, useRef, useMemo, useCallback } from 'react';
|
2
|
-
import { useSxpDataSource } from '../../../../core/hooks';
|
3
|
+
import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
3
4
|
import './WaterfallList.less';
|
4
5
|
const WaterfallFlowItem = (props) => {
|
5
|
-
const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView } = props;
|
6
|
+
const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, lineClamp } = props;
|
6
7
|
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = useSxpDataSource();
|
7
8
|
const [showVideo, setShowVideo] = useState(false);
|
8
9
|
const [isLoading, setIsLoading] = useState(false);
|
@@ -138,11 +139,13 @@ const WaterfallFlowItem = (props) => {
|
|
138
139
|
visibility: isLoading ? 'visible' : 'hidden'
|
139
140
|
} })),
|
140
141
|
React.createElement("div", { className: 'waterFallList-content-listItem-info' },
|
141
|
-
React.createElement("div", { className: `${'waterFallList-content-listItem-info-title'} ${priceText ? 'waterFallList-content-listItem-info-nowrap' : ''}
|
142
|
-
React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText }, priceText))));
|
142
|
+
React.createElement("div", { className: `${'waterFallList-content-listItem-info-title'} ${priceText ? 'waterFallList-content-listItem-info-nowrap' : ''}`, style: Object.assign({}, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title) }, title && title),
|
143
|
+
React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price }, priceText))));
|
143
144
|
};
|
144
|
-
export default function WaterfallList(
|
145
|
-
var
|
145
|
+
export default function WaterfallList(_a) {
|
146
|
+
var _b, _c, _d, _e, _f, _g, _h;
|
147
|
+
var { reportTagsView } = _a, props = __rest(_a, ["reportTagsView"]);
|
148
|
+
const { popupAni } = useEditor();
|
146
149
|
const { waterFallData, getRecommendVideos, loadingImage } = useSxpDataSource();
|
147
150
|
const scrollParent = useRef(null);
|
148
151
|
const [scrollTop, setScrollTop] = useState(0);
|
@@ -160,7 +163,7 @@ export default function WaterfallList({ reportTagsView }) {
|
|
160
163
|
const [frameInfo, setFrameInfoInfo] = useState({ width: 0 });
|
161
164
|
const rowsNum = useMemo(() => {
|
162
165
|
const width = frameInfo.width || 0;
|
163
|
-
if (width >=
|
166
|
+
if (width >= (popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration)) {
|
164
167
|
return 6;
|
165
168
|
}
|
166
169
|
else if (width >= 768 && width <= 1199) {
|
@@ -169,7 +172,7 @@ export default function WaterfallList({ reportTagsView }) {
|
|
169
172
|
else {
|
170
173
|
return 2;
|
171
174
|
}
|
172
|
-
}, [frameInfo]);
|
175
|
+
}, [frameInfo, popupAni]);
|
173
176
|
const unitWidth = useMemo(() => {
|
174
177
|
return frameInfo.width / rowsNum - 2;
|
175
178
|
}, [rowsNum, frameInfo]);
|
@@ -305,13 +308,13 @@ export default function WaterfallList({ reportTagsView }) {
|
|
305
308
|
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } })),
|
306
309
|
React.createElement("div", { className: 'waterFallList', hidden: isLoadingData },
|
307
310
|
React.createElement("div", { className: 'waterFallList-scroll', ref: scrollParent, style: {
|
308
|
-
bottom: ((
|
311
|
+
bottom: ((_b = data === null || data === void 0 ? void 0 : data.tag) === null || _b === void 0 ? void 0 : _b.link) ? '100px' : 0
|
309
312
|
} },
|
310
|
-
React.createElement("div", { className: 'waterFallList-info' }, (
|
311
|
-
React.createElement("div", { hidden: !((
|
313
|
+
React.createElement("div", { className: 'waterFallList-info', style: (_c = props === null || props === void 0 ? void 0 : props.textStyles) === null || _c === void 0 ? void 0 : _c.hashTagDesc }, (_d = data === null || data === void 0 ? void 0 : data.tag) === null || _d === void 0 ? void 0 : _d.info),
|
314
|
+
React.createElement("div", { hidden: !((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link), className: 'waterFallList-collection', onClick: handleClickLink }, ((_f = data === null || data === void 0 ? void 0 : data.tag) === null || _f === void 0 ? void 0 : _f.linkTitle) || 'Shop the collection'),
|
312
315
|
React.createElement("div", { className: 'waterFallList-content', ref: waterfallFlowDom }, list === null || list === void 0 ? void 0 : list.map((item, ind) => {
|
313
|
-
return (React.createElement(WaterfallFlowItem, { key: ind, index: ind, rec: item, list: list, showBorder: scrollTop + scrollParent.current.clientHeight, style: styleList[ind], sizeChange: onSizeChange, unitWidth: unitWidth, reportTagsView: reportTagsView }));
|
316
|
+
return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, rec: item, list: list, showBorder: scrollTop + scrollParent.current.clientHeight, style: styleList[ind], sizeChange: onSizeChange, unitWidth: unitWidth, reportTagsView: reportTagsView }, props)));
|
314
317
|
}))),
|
315
|
-
React.createElement("div", { className: 'waterFallList-bottom', hidden: !((
|
316
|
-
React.createElement("button", { className: 'waterFallList-bottom-btn', onClick: handleClickLink }, ((
|
318
|
+
React.createElement("div", { className: 'waterFallList-bottom', hidden: !((_g = data === null || data === void 0 ? void 0 : data.tag) === null || _g === void 0 ? void 0 : _g.link) },
|
319
|
+
React.createElement("button", { className: 'waterFallList-bottom-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_h = data === null || data === void 0 ? void 0 : data.tag) === null || _h === void 0 ? void 0 : _h.linkTitle) || 'Shop the collection')))));
|
317
320
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import './index.less';
|
3
|
+
import { IHashTagProps } from '../../../../materials/sxp/HashTag';
|
3
4
|
interface IWaterFallProps {
|
4
5
|
}
|
5
|
-
declare const _default: React.NamedExoticComponent<IWaterFallProps>;
|
6
|
+
declare const _default: React.NamedExoticComponent<IWaterFallProps & IHashTagProps>;
|
6
7
|
export default _default;
|