pb-sxp-ui 1.0.76 → 1.0.77

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.js CHANGED
@@ -10338,19 +10338,29 @@ var _a, _b;
10338
10338
  *
10339
10339
  */
10340
10340
  var settingRender = [
10341
+ {
10342
+ title: 'Banner',
10343
+ child: [
10344
+ {
10345
+ type: 'Switch',
10346
+ label: 'Banner图开关',
10347
+ name: ['props', 'showBanner']
10348
+ }
10349
+ ]
10350
+ },
10341
10351
  {
10342
10352
  title: '卡片样式',
10343
10353
  child: [
10344
- // {
10345
- // type: 'Number',
10346
- // label: '文本行数',
10347
- // name: ['props', 'lineClamp']
10348
- // },
10349
10354
  {
10350
10355
  type: 'Number',
10351
10356
  label: '上下边距',
10352
10357
  name: ['props', 'space'],
10353
10358
  addonAfter: 'px'
10359
+ },
10360
+ {
10361
+ type: 'Switch',
10362
+ label: '固定宽高',
10363
+ name: ['props', 'isWaterfallFlow']
10354
10364
  }
10355
10365
  ]
10356
10366
  },
@@ -11820,9 +11830,14 @@ var previewData = {
11820
11830
  };
11821
11831
 
11822
11832
  const WaterfallFlowItem = (props) => {
11823
- const { rec, index, list, reportTagsView, textStyles, space } = props;
11824
- const { swiperRef, setRtcList, setOpenHashtag, bffEventReport, sxpParameter } = useSxpDataSource();
11833
+ const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
11834
+ const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = useSxpDataSource();
11825
11835
  const [showVideo, setShowVideo] = useState(false);
11836
+ const [isLoading, setIsLoading] = useState(false);
11837
+ const [imgInfo, setImgInfo] = useState({
11838
+ height: 1,
11839
+ width: 1
11840
+ });
11826
11841
  const imgDom = useRef(null);
11827
11842
  const ref = useRef(null);
11828
11843
  const videoDom = useRef(null);
@@ -11847,6 +11862,26 @@ const WaterfallFlowItem = (props) => {
11847
11862
  var _a, _b;
11848
11863
  return ((_a = rec === null || rec === void 0 ? void 0 : rec.product) === null || _a === void 0 ? void 0 : _a.title) || ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.title) || null;
11849
11864
  }, [rec]);
11865
+ /** 离父亲上边框的距离 */
11866
+ const top = useMemo(() => {
11867
+ var _a;
11868
+ const y = style.transform
11869
+ ? Number((_a = style.transform) === null || _a === void 0 ? void 0 : _a.substring(style.transform.indexOf(',', 0) + 1, style.transform.length - 3))
11870
+ : undefined;
11871
+ return y;
11872
+ }, [style]);
11873
+ /** 是否加载图片 */
11874
+ const isImgShow = useMemo(() => {
11875
+ if (top === undefined) {
11876
+ return false;
11877
+ }
11878
+ if (top <= showBorder) {
11879
+ return true;
11880
+ }
11881
+ else {
11882
+ return false;
11883
+ }
11884
+ }, [top, showBorder]);
11850
11885
  const priceText = useMemo(() => {
11851
11886
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
11852
11887
  if (((_a = rec === null || rec === void 0 ? void 0 : rec.product) === null || _a === void 0 ? void 0 : _a.currency) && ((_b = rec === null || rec === void 0 ? void 0 : rec.product) === null || _b === void 0 ? void 0 : _b.price)) {
@@ -11859,42 +11894,55 @@ const WaterfallFlowItem = (props) => {
11859
11894
  }
11860
11895
  }, [rec]);
11861
11896
  // useEffect(() => {
11862
- // if (imgDom.current === null || src === '') {
11863
- // return;
11864
- // }
11865
- // const img = new Image();
11866
- // if (showVideo && firstFrameSrc) {
11867
- // img.src = firstFrameSrc;
11868
- // } else {
11869
- // img.src = src;
11870
- // }
11871
- // // img.onload = () => {
11872
- // // setIsLoading(true);
11873
- // // };
11874
- // imgDom.current.src = img.src;
11897
+ // const observer = new IntersectionObserver((entries) => {
11898
+ // entries.forEach((entry) => {
11899
+ // if (entry.isIntersecting) {
11900
+ // if (ref.current === null || src === '') {
11901
+ // return;
11902
+ // }
11903
+ // if (showVideo && firstFrameSrc) {
11904
+ // imgDom.current.setSrc(firstFrameSrc);
11905
+ // } else {
11906
+ // imgDom.current.setSrc(src);
11907
+ // }
11908
+ // observer.unobserve(ref.current);
11909
+ // }
11910
+ // });
11911
+ // });
11912
+ // observer.observe(ref.current);
11913
+ // return () => {
11914
+ // observer.disconnect();
11915
+ // };
11875
11916
  // }, [src, showVideo, firstFrameSrc]);
11876
11917
  useEffect(() => {
11877
- const observer = new IntersectionObserver((entries) => {
11878
- entries.forEach((entry) => {
11879
- if (entry.isIntersecting) {
11880
- if (ref.current === null || src === '') {
11881
- return;
11882
- }
11883
- if (showVideo && firstFrameSrc) {
11884
- imgDom.current.setSrc(firstFrameSrc);
11885
- }
11886
- else {
11887
- imgDom.current.setSrc(src);
11888
- }
11889
- observer.unobserve(ref.current);
11890
- }
11918
+ if (imgDom.current === null || src === '' || isImgShow === false) {
11919
+ return;
11920
+ }
11921
+ const img = new Image();
11922
+ if (showVideo && firstFrameSrc) {
11923
+ img.src = firstFrameSrc;
11924
+ }
11925
+ else {
11926
+ img.src = src;
11927
+ }
11928
+ img.onload = () => {
11929
+ setImgInfo({
11930
+ height: img.height,
11931
+ width: img.width
11891
11932
  });
11892
- });
11893
- observer.observe(ref.current);
11894
- return () => {
11895
- observer.disconnect();
11933
+ setIsLoading(true);
11896
11934
  };
11897
- }, [src, showVideo, firstFrameSrc]);
11935
+ // imgDom.current.setSrc(img.src);
11936
+ imgDom.current.src = img.src;
11937
+ }, [src, showVideo, firstFrameSrc, isImgShow]);
11938
+ useEffect(() => {
11939
+ // 通过宽度比例获取图片高度
11940
+ const height = imgInfo.height * (unitWidth / imgInfo.width);
11941
+ if (isLoading) {
11942
+ // 加40是因为下方文字部分高度为40,可以自己设置
11943
+ sizeChange(height + 76 + space, index);
11944
+ }
11945
+ }, [imgInfo, index, unitWidth, isLoading, space]); /* 增加sizeChange依赖项会导致在admin预览编辑时无限刷新 */
11898
11946
  const calculateHeightForWidth = (videoWidth, videoHeight, targetWidth) => {
11899
11947
  const aspectRatio = videoWidth / videoHeight;
11900
11948
  const targetHeight = targetWidth / aspectRatio;
@@ -11932,40 +11980,135 @@ const WaterfallFlowItem = (props) => {
11932
11980
  setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(false);
11933
11981
  }, 0);
11934
11982
  };
11935
- return (React.createElement("div", { ref: ref, className: 'list-content-listItem', key: index, onClick: handleClickToDetail, style: { marginBottom: space } },
11936
- React.createElement("div", { className: 'list-content-listItem-picture' },
11983
+ return (React.createElement("div", { ref: ref, style: Object.assign({}, style), className: 'waterFallList-content-listItem', key: index, onClick: handleClickToDetail },
11984
+ React.createElement("div", { className: 'waterFallList-content-listItem-picture' },
11937
11985
  showVideo && (React.createElement("div", { style: { display: 'none' } },
11938
- React.createElement("video", { ref: videoDom, crossOrigin: 'anonymous', className: 'list-content-listItem-picture-img' }),
11986
+ React.createElement("video", { ref: videoDom, src: src, crossOrigin: 'anonymous', className: 'waterFallList-content-listItem-picture-img' }),
11939
11987
  React.createElement("canvas", { ref: canvasRef }))),
11940
- React.createElement(FormatImage$1, { loading: 'lazy', className: 'list-content-listItem-picture-img', ref: imgDom })),
11941
- React.createElement("div", { className: 'list-content-listItem-info' },
11942
- 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),
11943
- React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText }, priceText))));
11988
+ React.createElement("img", { loading: 'lazy', className: 'waterFallList-content-listItem-picture-img', ref: imgDom })),
11989
+ React.createElement("div", { className: 'waterFallList-content-listItem-info' },
11990
+ 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),
11991
+ React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price }, priceText))));
11944
11992
  };
11945
11993
  function WaterfallList(_a) {
11946
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
11994
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
11947
11995
  var { reportTagsView } = _a, props = __rest(_a, ["reportTagsView"]);
11948
11996
  const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
11949
- const [list, setList] = useState();
11997
+ /** 滚动的父元素 */
11998
+ const scrollParent = useRef(null);
11999
+ /** 向上滚动的距离 */
12000
+ const [scrollTop, setScrollTop] = useState(0);
12001
+ /** 数据列表 */
11950
12002
  const [data, setData] = useState();
12003
+ const waterfallFlowDom = useRef(null);
12004
+ /** 样式列表 */
12005
+ const [styleList, setStyleList] = useState([]);
12006
+ const styleListRef = useRef();
12007
+ /** 自定义骨架屏高度 */
12008
+ const heightList = [170, 230, 300];
12009
+ /** 到达底部 */
11951
12010
  const [isLoadingData, setIsLoadingData] = useState(false);
11952
- const containerRef = useRef(null);
11953
- const [isLoadMore, setIsLoadMore] = useState(false);
11954
- useCallback(() => {
11955
- if (isLoadMore)
11956
- return;
11957
- setIsLoadMore(true);
11958
- waterFallData &&
11959
- (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
11960
- hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
11961
- 'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
11962
- 'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
11963
- }).then((res) => {
11964
- var _a;
11965
- setList(list === null || list === void 0 ? void 0 : list.concat((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []));
11966
- setIsLoadMore(false);
11967
- }));
11968
- }, [waterFallData, getRecommendVideos, list, isLoadMore]);
12011
+ const [list, setList] = useState([]);
12012
+ const buttonRef = useRef();
12013
+ /** 生成随机数 */
12014
+ const createRandomNum = useCallback((min, max) => {
12015
+ return Math.floor(Math.random() * (max - min + 1)) + min;
12016
+ }, []);
12017
+ const waterfallFlowListInfo = useRef([]);
12018
+ /** 当前容器信息 */
12019
+ const [frameInfo, setFrameInfoInfo] = useState({ width: 0 });
12020
+ /** 每行个数 */
12021
+ const rowsNum = useMemo(() => {
12022
+ const width = frameInfo.width || 0;
12023
+ if (width >= 1200) {
12024
+ return 6;
12025
+ }
12026
+ else if (width >= 768 && width <= 1199) {
12027
+ return 4;
12028
+ }
12029
+ else {
12030
+ return 2;
12031
+ }
12032
+ }, [frameInfo]);
12033
+ /** 每一个的宽度 */
12034
+ const unitWidth = useMemo(() => {
12035
+ return frameInfo.width / rowsNum - 2;
12036
+ }, [rowsNum, frameInfo]);
12037
+ /** 获取位置 */
12038
+ const getStyleList = useCallback(() => {
12039
+ var _a;
12040
+ const temporaryStyleList = (_a = styleListRef.current) !== null && _a !== void 0 ? _a : [];
12041
+ /** 目前最下一行的index */
12042
+ const bottomItemIndex = [];
12043
+ for (let i = 0; i < (list === null || list === void 0 ? void 0 : list.length); i++) {
12044
+ // 原本应对应的行数
12045
+ const currentRow = Math.floor(i / rowsNum);
12046
+ //
12047
+ const remainder = (i % rowsNum) + 1;
12048
+ // 最低item下标
12049
+ let minHeightInd = 0;
12050
+ // 最低高度
12051
+ let minHeight = 9999999999;
12052
+ // 寻找最低高度的下标
12053
+ if (currentRow === 0) {
12054
+ bottomItemIndex[i] = i;
12055
+ }
12056
+ else {
12057
+ for (let j = 0; j < bottomItemIndex.length; j++) {
12058
+ if (waterfallFlowListInfo.current[bottomItemIndex[j]].top +
12059
+ waterfallFlowListInfo.current[bottomItemIndex[j]].height <
12060
+ minHeight) {
12061
+ minHeightInd = j;
12062
+ minHeight =
12063
+ waterfallFlowListInfo.current[bottomItemIndex[j]].top +
12064
+ waterfallFlowListInfo.current[bottomItemIndex[j]].height;
12065
+ }
12066
+ }
12067
+ bottomItemIndex[minHeightInd] = i;
12068
+ }
12069
+ if (waterfallFlowListInfo.current[i] === undefined) {
12070
+ waterfallFlowListInfo.current[i] = {};
12071
+ }
12072
+ // 第一行特殊处理,一定是从左到右铺的
12073
+ if (currentRow === 0) {
12074
+ if (remainder === 1) {
12075
+ waterfallFlowListInfo.current[i].left = 0;
12076
+ }
12077
+ else {
12078
+ waterfallFlowListInfo.current[i].left = waterfallFlowListInfo.current[i - 1].left + unitWidth + 4;
12079
+ }
12080
+ waterfallFlowListInfo.current[i].top = 0;
12081
+ }
12082
+ // 剩下的行数,铺在当前最低高度下面
12083
+ else {
12084
+ waterfallFlowListInfo.current[i].left = waterfallFlowListInfo.current[minHeightInd].left;
12085
+ waterfallFlowListInfo.current[i].top = minHeight;
12086
+ }
12087
+ // 是否已经有高度,有高度使用已有高度,否则随机生成
12088
+ waterfallFlowListInfo.current[i].height =
12089
+ waterfallFlowListInfo.current[i].height || heightList[createRandomNum(0, 2)];
12090
+ temporaryStyleList[i] = {
12091
+ transform: `translate(${waterfallFlowListInfo.current[i].left}px,${waterfallFlowListInfo.current[i].top}px)`,
12092
+ width: `${unitWidth}px`,
12093
+ height: waterfallFlowListInfo.current[i].height
12094
+ };
12095
+ }
12096
+ setStyleList([...temporaryStyleList]);
12097
+ return [...temporaryStyleList];
12098
+ }, [unitWidth, rowsNum, heightList, createRandomNum, list]);
12099
+ /** 图片加载完更新高度 */
12100
+ const onSizeChange = useCallback((height, index) => {
12101
+ if (waterfallFlowListInfo.current[index] === undefined) {
12102
+ waterfallFlowListInfo.current[index] = {};
12103
+ }
12104
+ waterfallFlowListInfo.current[index].height = height;
12105
+ styleListRef.current = getStyleList();
12106
+ }, [getStyleList]);
12107
+ /** 大小、数量发生变化时触发 */
12108
+ useEffect(() => {
12109
+ styleListRef.current = getStyleList();
12110
+ }, [unitWidth, rowsNum, list]); /* 增加getStyleList依赖项会导致在admin预览编辑时无限刷新 */
12111
+ /** 初始化请求数据 */
11969
12112
  useEffect(() => {
11970
12113
  var _a, _b;
11971
12114
  setIsLoadingData(true);
@@ -11989,22 +12132,60 @@ function WaterfallList(_a) {
11989
12132
  setIsLoadingData(false);
11990
12133
  }
11991
12134
  }, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
11992
- // useEffect(() => {
11993
- // const container = containerRef?.current;
11994
- // if (!container) return;
11995
- // const handleScroll = () => {
11996
- // const top = (container as any)?.scrollTop;
11997
- // const clientHeight = (container as any)?.clientHeight;
11998
- // const scrollHeight = (container as any)?.scrollHeight;
11999
- // if (scrollHeight <= top + clientHeight && !isLoadingData) {
12000
- // loadMoreData();
12001
- // }
12002
- // };
12003
- // container?.addEventListener('scroll', handleScroll);
12004
- // return () => {
12005
- // container?.removeEventListener('scroll', handleScroll); // 在组件卸载时移除事件监听器
12006
- // };
12007
- // }, [isLoadingData, containerRef, loadMoreData]);
12135
+ const onResize = useCallback(() => {
12136
+ if (waterfallFlowDom.current === null) {
12137
+ return;
12138
+ }
12139
+ setFrameInfoInfo({
12140
+ width: waterfallFlowDom.current.getBoundingClientRect().width
12141
+ });
12142
+ }, []);
12143
+ /** 监听列表容器大小变化 */
12144
+ useEffect(() => {
12145
+ if (waterfallFlowDom.current === null) {
12146
+ return;
12147
+ }
12148
+ const resizeObserver = new ResizeObserver((entries) => {
12149
+ onResize();
12150
+ });
12151
+ resizeObserver.observe(waterfallFlowDom.current);
12152
+ return () => {
12153
+ resizeObserver.disconnect();
12154
+ };
12155
+ }, [onResize]);
12156
+ useCallback(() => {
12157
+ setIsLoadingData(true);
12158
+ waterFallData &&
12159
+ (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
12160
+ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
12161
+ 'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
12162
+ 'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
12163
+ }).then((res) => {
12164
+ var _a, _b;
12165
+ setList(list === null || list === void 0 ? void 0 : list.concat((_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 && _b !== void 0 ? _b : []));
12166
+ setIsLoadingData(false);
12167
+ }));
12168
+ }, [waterFallData, getRecommendVideos, list]);
12169
+ const onScroll = useCallback(() => {
12170
+ // 记录滚动值
12171
+ setScrollTop(scrollParent.current.scrollTop);
12172
+ // const top = (scrollParent.current as any).scrollTop;
12173
+ // const clientHeight = (scrollParent.current as any).clientHeight;
12174
+ // const scrollHeight = (scrollParent.current as any).scrollHeight;
12175
+ // // 做底部加载
12176
+ // if (scrollHeight <= top + clientHeight && !isLoadingData) {
12177
+ // loadMoreData();
12178
+ // }
12179
+ }, []);
12180
+ /** 监听滚动 */
12181
+ useEffect(() => {
12182
+ var _a;
12183
+ (_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.addEventListener('scroll', onScroll);
12184
+ return () => {
12185
+ var _a;
12186
+ (_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('scroll', onScroll);
12187
+ };
12188
+ }, [onScroll, scrollParent]);
12008
12189
  const handleClickLink = () => {
12009
12190
  var _a, _b;
12010
12191
  if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
@@ -12013,20 +12194,27 @@ function WaterfallList(_a) {
12013
12194
  }
12014
12195
  };
12015
12196
  return (React.createElement(React.Fragment, null, isLoadingData ? (React.createElement("div", { style: { height: '100%', width: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' } },
12016
- React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { className: 'list' },
12017
- React.createElement("div", { className: 'list-scroll', ref: containerRef },
12018
- React.createElement("div", { className: 'list-info', style: (_b = props === null || props === void 0 ? void 0 : props.textStyles) === null || _b === void 0 ? void 0 : _b.hashTagDesc }, (_c = data === null || data === void 0 ? void 0 : data.tag) === null || _c === void 0 ? void 0 : _c.info),
12019
- React.createElement("div", { hidden: !((_d = data === null || data === void 0 ? void 0 : data.tag) === null || _d === void 0 ? void 0 : _d.link), className: 'list-collection', onClick: handleClickLink, style: Object.assign(Object.assign({}, (_e = props === null || props === void 0 ? void 0 : props.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagLink), { 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'),
12020
- React.createElement("div", { className: 'list-content' }, list === null || list === void 0 ? void 0 : list.map((item, ind) => {
12021
- return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, rec: item, list: list, reportTagsView: reportTagsView }, props)));
12022
- })),
12023
- React.createElement("div", { hidden: !isLoadMore, style: { textAlign: 'center' } }, "loading..."),
12024
- React.createElement("div", { hidden: !((_g = data === null || data === void 0 ? void 0 : data.tag) === null || _g === void 0 ? void 0 : _g.link), style: {
12025
- height: ((_h = data === null || data === void 0 ? void 0 : data.tag) === null || _h === void 0 ? void 0 : _h.link) ? ((_j = props === null || props === void 0 ? void 0 : props.buttonBgStyle) === null || _j === void 0 ? void 0 : _j.height) || ((_k = props === null || props === void 0 ? void 0 : props.buttonStyle) === null || _k === void 0 ? void 0 : _k.height) || '100px' : 0
12026
- } })),
12027
- React.createElement("div", { className: 'list-bottom', hidden: !((_l = data === null || data === void 0 ? void 0 : data.tag) === null || _l === void 0 ? void 0 : _l.link), style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
12028
- React.createElement("div", { hidden: !((_m = data === null || data === void 0 ? void 0 : data.tag) === null || _m === void 0 ? void 0 : _m.link), className: 'list-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
12029
- React.createElement("button", { className: 'list-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_o = data === null || data === void 0 ? void 0 : data.tag) === null || _o === void 0 ? void 0 : _o.linkTitle) || 'Shop the collection'))))));
12197
+ React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { className: 'waterFallList', ref: waterfallFlowDom },
12198
+ React.createElement("div", { className: 'waterFallList-scroll', ref: scrollParent },
12199
+ React.createElement("div", { className: 'waterFallList-info', style: (_b = props === null || props === void 0 ? void 0 : props.textStyles) === null || _b === void 0 ? void 0 : _b.hashTagDesc }, (_c = data === null || data === void 0 ? void 0 : data.tag) === null || _c === void 0 ? void 0 : _c.info),
12200
+ React.createElement("div", { hidden: !((_d = data === null || data === void 0 ? void 0 : data.tag) === null || _d === void 0 ? void 0 : _d.link), className: 'waterFallList-collection', style: Object.assign({}, (_e = props === null || props === void 0 ? void 0 : props.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagLink), onClick: handleClickLink }, ((_f = data === null || data === void 0 ? void 0 : data.tag) === null || _f === void 0 ? void 0 : _f.linkTitle) || 'Shop the collection'),
12201
+ React.createElement("div", { className: 'waterFallList-content' }, list === null || list === void 0 ? void 0 :
12202
+ list.map((item, ind) => {
12203
+ var _a;
12204
+ return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, rec: item, list: list, showBorder: scrollTop + ((_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.clientHeight), style: styleList[ind], sizeChange: onSizeChange, unitWidth: unitWidth, reportTagsView: reportTagsView }, props)));
12205
+ }),
12206
+ React.createElement("div", { hidden: !((_g = data === null || data === void 0 ? void 0 : data.tag) === null || _g === void 0 ? void 0 : _g.link), style: {
12207
+ position: 'absolute',
12208
+ width: '100%',
12209
+ transform: `translate(0px,${(_m = ((_j = waterfallFlowListInfo === null || waterfallFlowListInfo === void 0 ? void 0 : waterfallFlowListInfo.current[((_h = waterfallFlowListInfo === null || waterfallFlowListInfo === void 0 ? void 0 : waterfallFlowListInfo.current) === null || _h === void 0 ? void 0 : _h.length) - 1]) === null || _j === void 0 ? void 0 : _j.top) +
12210
+ ((_l = waterfallFlowListInfo === null || waterfallFlowListInfo === void 0 ? void 0 : waterfallFlowListInfo.current[((_k = waterfallFlowListInfo === null || waterfallFlowListInfo === void 0 ? void 0 : waterfallFlowListInfo.current) === null || _k === void 0 ? void 0 : _k.length) - 1]) === null || _l === void 0 ? void 0 : _l.height)) !== null && _m !== void 0 ? _m : 0}px)`,
12211
+ height: ((_o = data === null || data === void 0 ? void 0 : data.tag) === null || _o === void 0 ? void 0 : _o.link)
12212
+ ? ((_p = buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) === null || _p === void 0 ? void 0 : _p.offsetHeight) || ((_q = props === null || props === void 0 ? void 0 : props.buttonBgStyle) === null || _q === void 0 ? void 0 : _q.height) || '100px'
12213
+ : 0
12214
+ } }))),
12215
+ React.createElement("div", { className: 'waterFallList-bottom', hidden: !((_r = data === null || data === void 0 ? void 0 : data.tag) === null || _r === void 0 ? void 0 : _r.link), style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
12216
+ React.createElement("div", { ref: buttonRef, hidden: !((_s = data === null || data === void 0 ? void 0 : data.tag) === null || _s === void 0 ? void 0 : _s.link), className: 'waterFallList-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
12217
+ React.createElement("button", { className: 'waterFallList-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_t = data === null || data === void 0 ? void 0 : data.tag) === null || _t === void 0 ? void 0 : _t.linkTitle) || 'Shop the collection'))))));
12030
12218
  }
12031
12219
 
12032
12220
  var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAaZJREFUeF7t2jFKBEEQRuG3mSJeQTARURDMTL2EqXfwAnoKD6FHMDEzNVIw2tzQC2gFggyDrExX1V92T7wz9PumFnqbXdH5teq8nwEwJqBzgfEVKDYAW8Ae8NZq3ZUm4Aa4AnaBR+C8BUIVAIu/ngSfAs9LESoAWLgB/LzWwP7SeLtfHWAu3tZ9Adz/dwD3eOUJCIlXBQiLVwQIjVcDCI9XAkiJVwFIi1cASI3PBpjb3jbd5GyyUcraCUrEZ02ATHwGgFR8NIBcfCSAZHwUgGx8BIB0vDeAfLwnQIl4L4Ay8R4ApeJbA2wD78DOZA/e7ABzk739Xz/T8rfAIfA6WYCd3BqA7NUSwCKfgLNKCK0BjoC7rzP74yoIrQGsuxSCB0ApBC+AMgieACUQvAHkESIApBGiAGQRIgEkEaIB5BAyAKQQsgBkEDIBJBCyAdIRFABSEVQA0hCUAFIQ1ADCERQBQhFUAcIQlAFCENQBfkOwg9eXpeftFQDmEOzv8ifARy8A3wiXwAHwANwujbf7q0xAi9bZZwwAN9oiDx4TUORFuS2z+wn4BAiAaEHnKChjAAAAAElFTkSuQmCC";
@@ -12035,7 +12223,7 @@ var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeA
12035
12223
  * @Author: binruan@chatlabs.com
12036
12224
  * @Date: 2024-01-10 10:58:24
12037
12225
  * @LastEditors: binruan@chatlabs.com
12038
- * @LastEditTime: 2024-04-15 17:57:59
12226
+ * @LastEditTime: 2024-06-06 17:19:25
12039
12227
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
12040
12228
  *
12041
12229
  */
@@ -12944,7 +13132,7 @@ var Tagbar$1 = memo(Tagbar);
12944
13132
  * @Author: binruan@chatlabs.com
12945
13133
  * @Date: 2024-01-15 19:03:09
12946
13134
  * @LastEditors: binruan@chatlabs.com
12947
- * @LastEditTime: 2024-05-30 11:35:35
13135
+ * @LastEditTime: 2024-06-06 18:42:24
12948
13136
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12949
13137
  *
12950
13138
  */
@@ -13004,7 +13192,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
13004
13192
  };
13005
13193
  const firstRef = useRef();
13006
13194
  useEffect(() => {
13007
- var _a, _b, _c;
13195
+ var _a, _b, _c, _d;
13008
13196
  if (!firstRef.current && !videoRef && (playerRef === null || playerRef === void 0 ? void 0 : playerRef.current) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
13009
13197
  firstRef.current = true;
13010
13198
  const player = TCPlayer('player-container-id', {
@@ -13016,11 +13204,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
13016
13204
  preload: 'auto',
13017
13205
  posterImage: false,
13018
13206
  bigPlayButton: true,
13019
- sources: [
13020
- {
13021
- src: (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.url) !== null && _c !== void 0 ? _c : ''
13022
- }
13023
- ]
13207
+ sources: ((_b = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.url)
13208
+ ? [
13209
+ {
13210
+ src: (_d = (_c = data === null || data === void 0 ? void 0 : data[0]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.url
13211
+ }
13212
+ ]
13213
+ : []
13024
13214
  });
13025
13215
  player === null || player === void 0 ? void 0 : player.ready(() => {
13026
13216
  setVideoRef(player);