pb-sxp-ui 1.0.3-alpha.1 → 1.0.3-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/index.cjs +2403 -825
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +114 -112
  4. package/dist/index.js +2404 -826
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +3 -3
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +3 -3
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +2403 -825
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +3 -3
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/SxpPageRender/Hashtag/index.d.ts +2 -1
  15. package/es/core/components/SxpPageRender/Hashtag/index.js +2 -2
  16. package/es/core/components/SxpPageRender/Navbar.d.ts +1 -0
  17. package/es/core/components/SxpPageRender/Navbar.js +3 -2
  18. package/es/core/components/SxpPageRender/PictureGroup/Picture.js +31 -3
  19. package/es/core/components/SxpPageRender/VideoWidget/index.js +21 -30
  20. package/es/core/components/SxpPageRender/WaterFall/List.d.ts +2 -1
  21. package/es/core/components/SxpPageRender/WaterFall/List.js +24 -14
  22. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.d.ts +2 -1
  23. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +13 -11
  24. package/es/core/components/SxpPageRender/WaterFall/index.d.ts +2 -1
  25. package/es/core/components/SxpPageRender/WaterFall/index.js +4 -3
  26. package/es/core/components/SxpPageRender/WaterFall/preview.json +1242 -0
  27. package/es/core/components/SxpPageRender/index.d.ts +2 -0
  28. package/es/core/components/SxpPageRender/index.js +5 -5
  29. package/es/core/context/EditorDataProvider.d.ts +3 -1
  30. package/es/core/context/EditorDataProvider.js +5 -2
  31. package/es/core/context/SxpDataSourceProvider.d.ts +2 -0
  32. package/es/core/context/SxpDataSourceProvider.js +7 -3
  33. package/es/materials/sxp/HashTag/index.d.ts +14 -0
  34. package/es/materials/sxp/HashTag/index.js +6 -0
  35. package/es/materials/sxp/HashTag/material.d.ts +2 -0
  36. package/es/materials/sxp/HashTag/material.js +52 -0
  37. package/es/materials/sxp/HashTag/settingRender.d.ts +122 -0
  38. package/es/materials/sxp/HashTag/settingRender.js +153 -0
  39. package/es/materials/sxp/index.d.ts +1 -0
  40. package/es/materials/sxp/index.js +1 -0
  41. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +4 -3
  42. package/es/materials/sxp/template/components/settingRender.d.ts +15 -0
  43. package/es/materials/sxp/template/components/settingRender.js +17 -0
  44. package/lib/core/components/SxpPageRender/Hashtag/index.d.ts +2 -1
  45. package/lib/core/components/SxpPageRender/Hashtag/index.js +2 -2
  46. package/lib/core/components/SxpPageRender/Navbar.d.ts +1 -0
  47. package/lib/core/components/SxpPageRender/Navbar.js +3 -2
  48. package/lib/core/components/SxpPageRender/PictureGroup/Picture.js +30 -2
  49. package/lib/core/components/SxpPageRender/VideoWidget/index.js +21 -30
  50. package/lib/core/components/SxpPageRender/WaterFall/List.d.ts +2 -1
  51. package/lib/core/components/SxpPageRender/WaterFall/List.js +23 -14
  52. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.d.ts +2 -1
  53. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +12 -11
  54. package/lib/core/components/SxpPageRender/WaterFall/index.d.ts +2 -1
  55. package/lib/core/components/SxpPageRender/WaterFall/index.js +4 -3
  56. package/lib/core/components/SxpPageRender/WaterFall/preview.json +1242 -0
  57. package/lib/core/components/SxpPageRender/index.d.ts +2 -0
  58. package/lib/core/components/SxpPageRender/index.js +5 -5
  59. package/lib/core/context/EditorDataProvider.d.ts +3 -1
  60. package/lib/core/context/EditorDataProvider.js +4 -1
  61. package/lib/core/context/SxpDataSourceProvider.d.ts +2 -0
  62. package/lib/core/context/SxpDataSourceProvider.js +7 -3
  63. package/lib/materials/sxp/HashTag/index.d.ts +14 -0
  64. package/lib/materials/sxp/HashTag/index.js +9 -0
  65. package/lib/materials/sxp/HashTag/material.d.ts +2 -0
  66. package/lib/materials/sxp/HashTag/material.js +56 -0
  67. package/lib/materials/sxp/HashTag/settingRender.d.ts +122 -0
  68. package/lib/materials/sxp/HashTag/settingRender.js +155 -0
  69. package/lib/materials/sxp/index.d.ts +1 -0
  70. package/lib/materials/sxp/index.js +1 -0
  71. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +4 -3
  72. package/lib/materials/sxp/template/components/settingRender.d.ts +15 -0
  73. package/lib/materials/sxp/template/components/settingRender.js +17 -0
  74. package/package.json +1 -1
@@ -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,7 +2,7 @@ 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
7
  const { setWaterFallData, setOpenHashtag, setCacheActiveIndex, waterFallData, setIsFromHashtag } = useSxpDataSource();
8
8
  const handleClickTag = (data) => {
@@ -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);
@@ -2,6 +2,7 @@ import React, { CSSProperties } from 'react';
2
2
  interface INavbarProps {
3
3
  icon?: string;
4
4
  styles?: CSSProperties;
5
+ textStyle?: CSSProperties;
5
6
  onClose?: () => void;
6
7
  }
7
8
  declare const _default: React.NamedExoticComponent<INavbarProps>;
@@ -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);
@@ -1,9 +1,26 @@
1
- import React, { useRef } from 'react';
1
+ import React, { useEffect, useRef, useState } from 'react';
2
2
  import { useSxpDataSource } from '../../../../core/hooks';
3
3
  const Picture = (props) => {
4
4
  const { src, height, width } = props;
5
+ const [blur, setBlur] = useState(false);
5
6
  const imgDom = useRef(null);
6
7
  const { sxpParameter } = useSxpDataSource();
8
+ useEffect(() => {
9
+ if (imgDom.current === null || src === '') {
10
+ return;
11
+ }
12
+ const img = new Image();
13
+ img.src = src;
14
+ img.onload = () => {
15
+ const aspectRatio = img.height / img.width;
16
+ const targetAspectRatio = 16 / 9;
17
+ const tolerance = 0.05;
18
+ if (Math.abs(aspectRatio - targetAspectRatio) > tolerance) {
19
+ setBlur(true);
20
+ }
21
+ };
22
+ imgDom.current.src = src;
23
+ }, [src]);
7
24
  return (React.createElement("div", { style: {
8
25
  overflow: 'hidden',
9
26
  height,
@@ -13,7 +30,18 @@ const Picture = (props) => {
13
30
  React.createElement("img", { ref: imgDom, loading: 'lazy', src: src !== null && src !== void 0 ? src : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, style: {
14
31
  height: '100%',
15
32
  width: '100%',
16
- objectFit: 'cover'
17
- } })));
33
+ objectFit: 'cover',
34
+ filter: blur ? 'blur(10px)' : 'none',
35
+ transform: blur ? 'scale(1.2)' : 'none'
36
+ } }),
37
+ blur && (React.createElement("img", { ref: imgDom, src: src, loading: 'lazy', style: {
38
+ width: '100%',
39
+ objectFit: 'contain',
40
+ position: 'absolute',
41
+ top: '50%',
42
+ transform: 'translateY(-50%)',
43
+ left: 0,
44
+ right: 0
45
+ } }))));
18
46
  };
19
47
  export default Picture;
@@ -16,10 +16,8 @@ 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, _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();
19
+ var _a;
20
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
23
21
  }, []);
24
22
  const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
25
23
  const handlePlaying = useCallback(() => {
@@ -76,38 +74,37 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
76
74
  });
77
75
  }
78
76
  setTimeout(() => {
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();
77
+ var _a;
78
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
83
79
  }, 0);
84
80
  }, [index, bffEventReport, data, isLoad]);
85
81
  const handleClickVideo = useCallback((type) => () => {
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;
82
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
89
83
  if (!isLoad)
90
84
  return;
91
- const isPause = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.paused;
85
+ const item = data[index];
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;
92
89
  switch (type) {
93
90
  case 'start':
94
91
  if (!isPause)
95
92
  return;
96
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
93
+ (_f = videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
97
94
  setIsPauseVideo(false);
98
95
  break;
99
96
  case 'pause':
100
97
  if (isPause)
101
98
  return;
102
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.pause();
99
+ (_g = videoRef.current) === null || _g === void 0 ? void 0 : _g.pause();
103
100
  setIsPauseVideo(true);
104
101
  break;
105
102
  default:
106
103
  if (isPause) {
107
- (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
104
+ (_h = videoRef.current) === null || _h === void 0 ? void 0 : _h.play();
108
105
  }
109
106
  else {
110
- (_f = videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
107
+ (_j = videoRef.current) === null || _j === void 0 ? void 0 : _j.pause();
111
108
  }
112
109
  setIsPauseVideo(!isPause);
113
110
  break;
@@ -138,16 +135,14 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
138
135
  }
139
136
  }, [data, index, bffEventReport]);
140
137
  useEffect(() => {
141
- var _a, _b, _c, _d, _e, _f;
138
+ var _a, _b, _c;
142
139
  if (data.length <= 0)
143
140
  return;
144
141
  if (!videoRef.current)
145
142
  return;
146
- const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
147
143
  setIsPauseVideo(false);
148
144
  if (!isActive) {
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();
145
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
151
146
  return;
152
147
  }
153
148
  if (!videoRef.current.src) {
@@ -157,12 +152,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
157
152
  videoRef.current.setAttribute('webkit-playsinline', 'true');
158
153
  }
159
154
  else {
160
- if (((_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.readyState) < 2)
161
- return;
162
155
  videoRef.current.play();
163
156
  }
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);
157
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
158
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
166
159
  return () => {
167
160
  var _a, _b;
168
161
  (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('canplay', handleLoadedMetadata);
@@ -170,17 +163,15 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
170
163
  };
171
164
  }, [data, handleLoadedMetadata, handlePlaying, isActive, isLoad, rec.video]);
172
165
  useEffect(() => {
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;
166
+ var _a, _b, _c;
167
+ const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
177
168
  if (!isActive)
178
169
  return;
179
170
  if (!isPause && openHashtag) {
180
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
171
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.pause();
181
172
  }
182
173
  else if (!openHashtag) {
183
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
174
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
184
175
  }
185
176
  }, [openHashtag, isActive]);
186
177
  useEffect(() => {
@@ -1,3 +1,4 @@
1
1
  import React from 'react';
2
2
  import './List.less';
3
- export default function WaterfallList({ reportTagsView }: any): React.JSX.Element;
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' : ''}` }, title && title),
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 === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText }, priceText))));
114
116
  };
115
- export default function WaterfallList({ reportTagsView }) {
116
- var _a, _b, _c, _d, _e, _f;
117
- const { waterFallData, getRecommendVideos, hashTagSize, loadingImage } = useSxpDataSource();
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
- }, [waterFallData, getRecommendVideos, hashTagSize]);
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: ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) ? '100px' : 0
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' }, (_b = data === null || data === void 0 ? void 0 : data.tag) === null || _b === void 0 ? void 0 : _b.info),
166
- React.createElement("div", { hidden: !((_c = data === null || data === void 0 ? void 0 : data.tag) === null || _c === void 0 ? void 0 : _c.link), className: 'list-collection', onClick: handleClickLink }, ((_d = data === null || data === void 0 ? void 0 : data.tag) === null || _d === void 0 ? void 0 : _d.linkTitle) || 'Shop the collection'),
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: !((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link) },
172
- React.createElement("button", { className: 'list-bottom-btn', onClick: handleClickLink }, ((_f = data === null || data === void 0 ? void 0 : data.tag) === null || _f === void 0 ? void 0 : _f.linkTitle) || 'Shop the collection'))))));
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
- export default function WaterfallList({ reportTagsView }: any): React.JSX.Element;
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
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,12 @@ 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' : ''}` }, title && title),
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({ reportTagsView }) {
145
- var _a, _b, _c, _d, _e, _f;
145
+ export default function WaterfallList(_a) {
146
+ var _b, _c, _d, _e, _f, _g, _h;
147
+ var { reportTagsView } = _a, props = __rest(_a, ["reportTagsView"]);
146
148
  const { popupAni } = useEditor();
147
149
  const { waterFallData, getRecommendVideos, loadingImage } = useSxpDataSource();
148
150
  const scrollParent = useRef(null);
@@ -306,13 +308,13 @@ export default function WaterfallList({ reportTagsView }) {
306
308
  React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } })),
307
309
  React.createElement("div", { className: 'waterFallList', hidden: isLoadingData },
308
310
  React.createElement("div", { className: 'waterFallList-scroll', ref: scrollParent, style: {
309
- bottom: ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) ? '100px' : 0
311
+ bottom: ((_b = data === null || data === void 0 ? void 0 : data.tag) === null || _b === void 0 ? void 0 : _b.link) ? '100px' : 0
310
312
  } },
311
- React.createElement("div", { className: 'waterFallList-info' }, (_b = data === null || data === void 0 ? void 0 : data.tag) === null || _b === void 0 ? void 0 : _b.info),
312
- React.createElement("div", { hidden: !((_c = data === null || data === void 0 ? void 0 : data.tag) === null || _c === void 0 ? void 0 : _c.link), className: 'waterFallList-collection', onClick: handleClickLink }, ((_d = data === null || data === void 0 ? void 0 : data.tag) === null || _d === void 0 ? void 0 : _d.linkTitle) || 'Shop the collection'),
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'),
313
315
  React.createElement("div", { className: 'waterFallList-content', ref: waterfallFlowDom }, list === null || list === void 0 ? void 0 : list.map((item, ind) => {
314
- 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)));
315
317
  }))),
316
- React.createElement("div", { className: 'waterFallList-bottom', hidden: !((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link) },
317
- React.createElement("button", { className: 'waterFallList-bottom-btn', onClick: handleClickLink }, ((_f = data === null || data === void 0 ? void 0 : data.tag) === null || _f === void 0 ? void 0 : _f.linkTitle) || 'Shop the collection')))));
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')))));
318
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;
@@ -6,7 +6,8 @@ import Navbar from '../Navbar';
6
6
  import WaterfallList from './List';
7
7
  import left from './left.png';
8
8
  import { useSxpDataSource } from '../../../../core/hooks';
9
- const WaterFall = () => {
9
+ const WaterFall = (props) => {
10
+ var _a;
10
11
  const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport } = useSxpDataSource();
11
12
  const ref = useRef(null);
12
13
  const modalEleRef = useRef(null);
@@ -94,7 +95,7 @@ const WaterFall = () => {
94
95
  return ReactDOM.createPortal(React.createElement("div", { className: 'waterfall', style: {
95
96
  display: openHashtag ? 'block' : 'none'
96
97
  } },
97
- React.createElement(Navbar, { icon: left, styles: { top: '32px' }, onClose: handleClose }),
98
- React.createElement(WaterfallList, { reportTagsView: reportTagsView })), modalEleRef.current);
98
+ React.createElement(Navbar, { icon: left, styles: { top: '32px' }, textStyle: (_a = props === null || props === void 0 ? void 0 : props.textStyles) === null || _a === void 0 ? void 0 : _a.hashTagTitle, onClose: handleClose }),
99
+ React.createElement(WaterfallList, Object.assign({ reportTagsView: reportTagsView }, props))), modalEleRef.current);
99
100
  };
100
101
  export default memo(WaterFall);