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.cjs +293 -103
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +95 -27
- package/dist/index.js +293 -103
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +293 -103
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +49 -35
- package/es/core/components/SxpPageRender/WaterFall/index.js +1 -1
- package/es/core/components/SxpPageRender/index.js +8 -6
- package/es/materials/sxp/HashTag/index.d.ts +2 -0
- package/es/materials/sxp/HashTag/settingRender.d.ts +7 -2
- package/es/materials/sxp/HashTag/settingRender.js +15 -0
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +49 -35
- package/lib/core/components/SxpPageRender/WaterFall/index.js +2 -2
- package/lib/core/components/SxpPageRender/index.js +8 -6
- package/lib/materials/sxp/HashTag/index.d.ts +2 -0
- package/lib/materials/sxp/HashTag/settingRender.d.ts +7 -2
- package/lib/materials/sxp/HashTag/settingRender.js +15 -0
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
@@ -10353,19 +10353,29 @@ Made in Italy` })));
|
|
10353
10353
|
*
|
10354
10354
|
*/
|
10355
10355
|
var settingRender = [
|
10356
|
+
{
|
10357
|
+
title: 'Banner',
|
10358
|
+
child: [
|
10359
|
+
{
|
10360
|
+
type: 'Switch',
|
10361
|
+
label: 'Banner图开关',
|
10362
|
+
name: ['props', 'showBanner']
|
10363
|
+
}
|
10364
|
+
]
|
10365
|
+
},
|
10356
10366
|
{
|
10357
10367
|
title: '卡片样式',
|
10358
10368
|
child: [
|
10359
|
-
// {
|
10360
|
-
// type: 'Number',
|
10361
|
-
// label: '文本行数',
|
10362
|
-
// name: ['props', 'lineClamp']
|
10363
|
-
// },
|
10364
10369
|
{
|
10365
10370
|
type: 'Number',
|
10366
10371
|
label: '上下边距',
|
10367
10372
|
name: ['props', 'space'],
|
10368
10373
|
addonAfter: 'px'
|
10374
|
+
},
|
10375
|
+
{
|
10376
|
+
type: 'Switch',
|
10377
|
+
label: '固定宽高',
|
10378
|
+
name: ['props', 'isWaterfallFlow']
|
10369
10379
|
}
|
10370
10380
|
]
|
10371
10381
|
},
|
@@ -11835,9 +11845,14 @@ Made in Italy` })));
|
|
11835
11845
|
};
|
11836
11846
|
|
11837
11847
|
const WaterfallFlowItem = (props) => {
|
11838
|
-
const { rec, index, list, reportTagsView, textStyles, space } = props;
|
11839
|
-
const { swiperRef, setRtcList, setOpenHashtag,
|
11848
|
+
const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
|
11849
|
+
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = useSxpDataSource();
|
11840
11850
|
const [showVideo, setShowVideo] = React.useState(false);
|
11851
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
11852
|
+
const [imgInfo, setImgInfo] = React.useState({
|
11853
|
+
height: 1,
|
11854
|
+
width: 1
|
11855
|
+
});
|
11841
11856
|
const imgDom = React.useRef(null);
|
11842
11857
|
const ref = React.useRef(null);
|
11843
11858
|
const videoDom = React.useRef(null);
|
@@ -11862,6 +11877,26 @@ Made in Italy` })));
|
|
11862
11877
|
var _a, _b;
|
11863
11878
|
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;
|
11864
11879
|
}, [rec]);
|
11880
|
+
/** 离父亲上边框的距离 */
|
11881
|
+
const top = React.useMemo(() => {
|
11882
|
+
var _a;
|
11883
|
+
const y = style.transform
|
11884
|
+
? Number((_a = style.transform) === null || _a === void 0 ? void 0 : _a.substring(style.transform.indexOf(',', 0) + 1, style.transform.length - 3))
|
11885
|
+
: undefined;
|
11886
|
+
return y;
|
11887
|
+
}, [style]);
|
11888
|
+
/** 是否加载图片 */
|
11889
|
+
const isImgShow = React.useMemo(() => {
|
11890
|
+
if (top === undefined) {
|
11891
|
+
return false;
|
11892
|
+
}
|
11893
|
+
if (top <= showBorder) {
|
11894
|
+
return true;
|
11895
|
+
}
|
11896
|
+
else {
|
11897
|
+
return false;
|
11898
|
+
}
|
11899
|
+
}, [top, showBorder]);
|
11865
11900
|
const priceText = React.useMemo(() => {
|
11866
11901
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
11867
11902
|
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)) {
|
@@ -11874,42 +11909,55 @@ Made in Italy` })));
|
|
11874
11909
|
}
|
11875
11910
|
}, [rec]);
|
11876
11911
|
// useEffect(() => {
|
11877
|
-
//
|
11878
|
-
//
|
11879
|
-
//
|
11880
|
-
//
|
11881
|
-
//
|
11882
|
-
//
|
11883
|
-
//
|
11884
|
-
//
|
11885
|
-
//
|
11886
|
-
//
|
11887
|
-
//
|
11888
|
-
//
|
11889
|
-
//
|
11912
|
+
// const observer = new IntersectionObserver((entries) => {
|
11913
|
+
// entries.forEach((entry) => {
|
11914
|
+
// if (entry.isIntersecting) {
|
11915
|
+
// if (ref.current === null || src === '') {
|
11916
|
+
// return;
|
11917
|
+
// }
|
11918
|
+
// if (showVideo && firstFrameSrc) {
|
11919
|
+
// imgDom.current.setSrc(firstFrameSrc);
|
11920
|
+
// } else {
|
11921
|
+
// imgDom.current.setSrc(src);
|
11922
|
+
// }
|
11923
|
+
// observer.unobserve(ref.current);
|
11924
|
+
// }
|
11925
|
+
// });
|
11926
|
+
// });
|
11927
|
+
// observer.observe(ref.current);
|
11928
|
+
// return () => {
|
11929
|
+
// observer.disconnect();
|
11930
|
+
// };
|
11890
11931
|
// }, [src, showVideo, firstFrameSrc]);
|
11891
11932
|
React.useEffect(() => {
|
11892
|
-
|
11893
|
-
|
11894
|
-
|
11895
|
-
|
11896
|
-
|
11897
|
-
|
11898
|
-
|
11899
|
-
|
11900
|
-
|
11901
|
-
|
11902
|
-
|
11903
|
-
|
11904
|
-
|
11905
|
-
|
11933
|
+
if (imgDom.current === null || src === '' || isImgShow === false) {
|
11934
|
+
return;
|
11935
|
+
}
|
11936
|
+
const img = new Image();
|
11937
|
+
if (showVideo && firstFrameSrc) {
|
11938
|
+
img.src = firstFrameSrc;
|
11939
|
+
}
|
11940
|
+
else {
|
11941
|
+
img.src = src;
|
11942
|
+
}
|
11943
|
+
img.onload = () => {
|
11944
|
+
setImgInfo({
|
11945
|
+
height: img.height,
|
11946
|
+
width: img.width
|
11906
11947
|
});
|
11907
|
-
|
11908
|
-
observer.observe(ref.current);
|
11909
|
-
return () => {
|
11910
|
-
observer.disconnect();
|
11948
|
+
setIsLoading(true);
|
11911
11949
|
};
|
11912
|
-
|
11950
|
+
// imgDom.current.setSrc(img.src);
|
11951
|
+
imgDom.current.src = img.src;
|
11952
|
+
}, [src, showVideo, firstFrameSrc, isImgShow]);
|
11953
|
+
React.useEffect(() => {
|
11954
|
+
// 通过宽度比例获取图片高度
|
11955
|
+
const height = imgInfo.height * (unitWidth / imgInfo.width);
|
11956
|
+
if (isLoading) {
|
11957
|
+
// 加40是因为下方文字部分高度为40,可以自己设置
|
11958
|
+
sizeChange(height + 76 + space, index);
|
11959
|
+
}
|
11960
|
+
}, [imgInfo, index, unitWidth, isLoading, space]); /* 增加sizeChange依赖项会导致在admin预览编辑时无限刷新 */
|
11913
11961
|
const calculateHeightForWidth = (videoWidth, videoHeight, targetWidth) => {
|
11914
11962
|
const aspectRatio = videoWidth / videoHeight;
|
11915
11963
|
const targetHeight = targetWidth / aspectRatio;
|
@@ -11947,40 +11995,135 @@ Made in Italy` })));
|
|
11947
11995
|
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(false);
|
11948
11996
|
}, 0);
|
11949
11997
|
};
|
11950
|
-
return (React.createElement("div", { ref: ref, className: '
|
11951
|
-
React.createElement("div", { className: '
|
11998
|
+
return (React.createElement("div", { ref: ref, style: Object.assign({}, style), className: 'waterFallList-content-listItem', key: index, onClick: handleClickToDetail },
|
11999
|
+
React.createElement("div", { className: 'waterFallList-content-listItem-picture' },
|
11952
12000
|
showVideo && (React.createElement("div", { style: { display: 'none' } },
|
11953
|
-
React.createElement("video", { ref: videoDom, crossOrigin: 'anonymous', className: '
|
12001
|
+
React.createElement("video", { ref: videoDom, src: src, crossOrigin: 'anonymous', className: 'waterFallList-content-listItem-picture-img' }),
|
11954
12002
|
React.createElement("canvas", { ref: canvasRef }))),
|
11955
|
-
React.createElement(
|
11956
|
-
React.createElement("div", { className: '
|
11957
|
-
React.createElement("div", { className: `${'
|
11958
|
-
React.createElement("div", { className: '
|
12003
|
+
React.createElement("img", { loading: 'lazy', className: 'waterFallList-content-listItem-picture-img', ref: imgDom })),
|
12004
|
+
React.createElement("div", { className: 'waterFallList-content-listItem-info' },
|
12005
|
+
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),
|
12006
|
+
React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price }, priceText))));
|
11959
12007
|
};
|
11960
12008
|
function WaterfallList(_a) {
|
11961
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
12009
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
11962
12010
|
var { reportTagsView } = _a, props = __rest(_a, ["reportTagsView"]);
|
11963
12011
|
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
|
11964
|
-
|
12012
|
+
/** 滚动的父元素 */
|
12013
|
+
const scrollParent = React.useRef(null);
|
12014
|
+
/** 向上滚动的距离 */
|
12015
|
+
const [scrollTop, setScrollTop] = React.useState(0);
|
12016
|
+
/** 数据列表 */
|
11965
12017
|
const [data, setData] = React.useState();
|
12018
|
+
const waterfallFlowDom = React.useRef(null);
|
12019
|
+
/** 样式列表 */
|
12020
|
+
const [styleList, setStyleList] = React.useState([]);
|
12021
|
+
const styleListRef = React.useRef();
|
12022
|
+
/** 自定义骨架屏高度 */
|
12023
|
+
const heightList = [170, 230, 300];
|
12024
|
+
/** 到达底部 */
|
11966
12025
|
const [isLoadingData, setIsLoadingData] = React.useState(false);
|
11967
|
-
const
|
11968
|
-
const
|
11969
|
-
|
11970
|
-
|
11971
|
-
|
11972
|
-
|
11973
|
-
|
11974
|
-
|
11975
|
-
|
11976
|
-
|
11977
|
-
|
11978
|
-
|
11979
|
-
|
11980
|
-
|
11981
|
-
|
11982
|
-
|
11983
|
-
|
12026
|
+
const [list, setList] = React.useState([]);
|
12027
|
+
const buttonRef = React.useRef();
|
12028
|
+
/** 生成随机数 */
|
12029
|
+
const createRandomNum = React.useCallback((min, max) => {
|
12030
|
+
return Math.floor(Math.random() * (max - min + 1)) + min;
|
12031
|
+
}, []);
|
12032
|
+
const waterfallFlowListInfo = React.useRef([]);
|
12033
|
+
/** 当前容器信息 */
|
12034
|
+
const [frameInfo, setFrameInfoInfo] = React.useState({ width: 0 });
|
12035
|
+
/** 每行个数 */
|
12036
|
+
const rowsNum = React.useMemo(() => {
|
12037
|
+
const width = frameInfo.width || 0;
|
12038
|
+
if (width >= 1200) {
|
12039
|
+
return 6;
|
12040
|
+
}
|
12041
|
+
else if (width >= 768 && width <= 1199) {
|
12042
|
+
return 4;
|
12043
|
+
}
|
12044
|
+
else {
|
12045
|
+
return 2;
|
12046
|
+
}
|
12047
|
+
}, [frameInfo]);
|
12048
|
+
/** 每一个的宽度 */
|
12049
|
+
const unitWidth = React.useMemo(() => {
|
12050
|
+
return frameInfo.width / rowsNum - 2;
|
12051
|
+
}, [rowsNum, frameInfo]);
|
12052
|
+
/** 获取位置 */
|
12053
|
+
const getStyleList = React.useCallback(() => {
|
12054
|
+
var _a;
|
12055
|
+
const temporaryStyleList = (_a = styleListRef.current) !== null && _a !== void 0 ? _a : [];
|
12056
|
+
/** 目前最下一行的index */
|
12057
|
+
const bottomItemIndex = [];
|
12058
|
+
for (let i = 0; i < (list === null || list === void 0 ? void 0 : list.length); i++) {
|
12059
|
+
// 原本应对应的行数
|
12060
|
+
const currentRow = Math.floor(i / rowsNum);
|
12061
|
+
//
|
12062
|
+
const remainder = (i % rowsNum) + 1;
|
12063
|
+
// 最低item下标
|
12064
|
+
let minHeightInd = 0;
|
12065
|
+
// 最低高度
|
12066
|
+
let minHeight = 9999999999;
|
12067
|
+
// 寻找最低高度的下标
|
12068
|
+
if (currentRow === 0) {
|
12069
|
+
bottomItemIndex[i] = i;
|
12070
|
+
}
|
12071
|
+
else {
|
12072
|
+
for (let j = 0; j < bottomItemIndex.length; j++) {
|
12073
|
+
if (waterfallFlowListInfo.current[bottomItemIndex[j]].top +
|
12074
|
+
waterfallFlowListInfo.current[bottomItemIndex[j]].height <
|
12075
|
+
minHeight) {
|
12076
|
+
minHeightInd = j;
|
12077
|
+
minHeight =
|
12078
|
+
waterfallFlowListInfo.current[bottomItemIndex[j]].top +
|
12079
|
+
waterfallFlowListInfo.current[bottomItemIndex[j]].height;
|
12080
|
+
}
|
12081
|
+
}
|
12082
|
+
bottomItemIndex[minHeightInd] = i;
|
12083
|
+
}
|
12084
|
+
if (waterfallFlowListInfo.current[i] === undefined) {
|
12085
|
+
waterfallFlowListInfo.current[i] = {};
|
12086
|
+
}
|
12087
|
+
// 第一行特殊处理,一定是从左到右铺的
|
12088
|
+
if (currentRow === 0) {
|
12089
|
+
if (remainder === 1) {
|
12090
|
+
waterfallFlowListInfo.current[i].left = 0;
|
12091
|
+
}
|
12092
|
+
else {
|
12093
|
+
waterfallFlowListInfo.current[i].left = waterfallFlowListInfo.current[i - 1].left + unitWidth + 4;
|
12094
|
+
}
|
12095
|
+
waterfallFlowListInfo.current[i].top = 0;
|
12096
|
+
}
|
12097
|
+
// 剩下的行数,铺在当前最低高度下面
|
12098
|
+
else {
|
12099
|
+
waterfallFlowListInfo.current[i].left = waterfallFlowListInfo.current[minHeightInd].left;
|
12100
|
+
waterfallFlowListInfo.current[i].top = minHeight;
|
12101
|
+
}
|
12102
|
+
// 是否已经有高度,有高度使用已有高度,否则随机生成
|
12103
|
+
waterfallFlowListInfo.current[i].height =
|
12104
|
+
waterfallFlowListInfo.current[i].height || heightList[createRandomNum(0, 2)];
|
12105
|
+
temporaryStyleList[i] = {
|
12106
|
+
transform: `translate(${waterfallFlowListInfo.current[i].left}px,${waterfallFlowListInfo.current[i].top}px)`,
|
12107
|
+
width: `${unitWidth}px`,
|
12108
|
+
height: waterfallFlowListInfo.current[i].height
|
12109
|
+
};
|
12110
|
+
}
|
12111
|
+
setStyleList([...temporaryStyleList]);
|
12112
|
+
return [...temporaryStyleList];
|
12113
|
+
}, [unitWidth, rowsNum, heightList, createRandomNum, list]);
|
12114
|
+
/** 图片加载完更新高度 */
|
12115
|
+
const onSizeChange = React.useCallback((height, index) => {
|
12116
|
+
if (waterfallFlowListInfo.current[index] === undefined) {
|
12117
|
+
waterfallFlowListInfo.current[index] = {};
|
12118
|
+
}
|
12119
|
+
waterfallFlowListInfo.current[index].height = height;
|
12120
|
+
styleListRef.current = getStyleList();
|
12121
|
+
}, [getStyleList]);
|
12122
|
+
/** 大小、数量发生变化时触发 */
|
12123
|
+
React.useEffect(() => {
|
12124
|
+
styleListRef.current = getStyleList();
|
12125
|
+
}, [unitWidth, rowsNum, list]); /* 增加getStyleList依赖项会导致在admin预览编辑时无限刷新 */
|
12126
|
+
/** 初始化请求数据 */
|
11984
12127
|
React.useEffect(() => {
|
11985
12128
|
var _a, _b;
|
11986
12129
|
setIsLoadingData(true);
|
@@ -12004,22 +12147,60 @@ Made in Italy` })));
|
|
12004
12147
|
setIsLoadingData(false);
|
12005
12148
|
}
|
12006
12149
|
}, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
|
12007
|
-
|
12008
|
-
|
12009
|
-
|
12010
|
-
|
12011
|
-
|
12012
|
-
|
12013
|
-
|
12014
|
-
|
12015
|
-
|
12016
|
-
|
12017
|
-
|
12018
|
-
|
12019
|
-
|
12020
|
-
|
12021
|
-
|
12022
|
-
|
12150
|
+
const onResize = React.useCallback(() => {
|
12151
|
+
if (waterfallFlowDom.current === null) {
|
12152
|
+
return;
|
12153
|
+
}
|
12154
|
+
setFrameInfoInfo({
|
12155
|
+
width: waterfallFlowDom.current.getBoundingClientRect().width
|
12156
|
+
});
|
12157
|
+
}, []);
|
12158
|
+
/** 监听列表容器大小变化 */
|
12159
|
+
React.useEffect(() => {
|
12160
|
+
if (waterfallFlowDom.current === null) {
|
12161
|
+
return;
|
12162
|
+
}
|
12163
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
12164
|
+
onResize();
|
12165
|
+
});
|
12166
|
+
resizeObserver.observe(waterfallFlowDom.current);
|
12167
|
+
return () => {
|
12168
|
+
resizeObserver.disconnect();
|
12169
|
+
};
|
12170
|
+
}, [onResize]);
|
12171
|
+
React.useCallback(() => {
|
12172
|
+
setIsLoadingData(true);
|
12173
|
+
waterFallData &&
|
12174
|
+
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
|
12175
|
+
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
|
12176
|
+
'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
|
12177
|
+
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
|
12178
|
+
}).then((res) => {
|
12179
|
+
var _a, _b;
|
12180
|
+
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 : []));
|
12181
|
+
setIsLoadingData(false);
|
12182
|
+
}));
|
12183
|
+
}, [waterFallData, getRecommendVideos, list]);
|
12184
|
+
const onScroll = React.useCallback(() => {
|
12185
|
+
// 记录滚动值
|
12186
|
+
setScrollTop(scrollParent.current.scrollTop);
|
12187
|
+
// const top = (scrollParent.current as any).scrollTop;
|
12188
|
+
// const clientHeight = (scrollParent.current as any).clientHeight;
|
12189
|
+
// const scrollHeight = (scrollParent.current as any).scrollHeight;
|
12190
|
+
// // 做底部加载
|
12191
|
+
// if (scrollHeight <= top + clientHeight && !isLoadingData) {
|
12192
|
+
// loadMoreData();
|
12193
|
+
// }
|
12194
|
+
}, []);
|
12195
|
+
/** 监听滚动 */
|
12196
|
+
React.useEffect(() => {
|
12197
|
+
var _a;
|
12198
|
+
(_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.addEventListener('scroll', onScroll);
|
12199
|
+
return () => {
|
12200
|
+
var _a;
|
12201
|
+
(_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('scroll', onScroll);
|
12202
|
+
};
|
12203
|
+
}, [onScroll, scrollParent]);
|
12023
12204
|
const handleClickLink = () => {
|
12024
12205
|
var _a, _b;
|
12025
12206
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
@@ -12028,20 +12209,27 @@ Made in Italy` })));
|
|
12028
12209
|
}
|
12029
12210
|
};
|
12030
12211
|
return (React.createElement(React.Fragment, null, isLoadingData ? (React.createElement("div", { style: { height: '100%', width: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
12031
|
-
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { className: '
|
12032
|
-
React.createElement("div", { className: '
|
12033
|
-
React.createElement("div", { className: '
|
12034
|
-
React.createElement("div", { hidden: !((_d = data === null || data === void 0 ? void 0 : data.tag) === null || _d === void 0 ? void 0 : _d.link), className: '
|
12035
|
-
React.createElement("div", { className: '
|
12036
|
-
|
12037
|
-
|
12038
|
-
|
12039
|
-
|
12040
|
-
|
12041
|
-
|
12042
|
-
|
12043
|
-
|
12044
|
-
|
12212
|
+
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { className: 'waterFallList', ref: waterfallFlowDom },
|
12213
|
+
React.createElement("div", { className: 'waterFallList-scroll', ref: scrollParent },
|
12214
|
+
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),
|
12215
|
+
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'),
|
12216
|
+
React.createElement("div", { className: 'waterFallList-content' }, list === null || list === void 0 ? void 0 :
|
12217
|
+
list.map((item, ind) => {
|
12218
|
+
var _a;
|
12219
|
+
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)));
|
12220
|
+
}),
|
12221
|
+
React.createElement("div", { hidden: !((_g = data === null || data === void 0 ? void 0 : data.tag) === null || _g === void 0 ? void 0 : _g.link), style: {
|
12222
|
+
position: 'absolute',
|
12223
|
+
width: '100%',
|
12224
|
+
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) +
|
12225
|
+
((_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)`,
|
12226
|
+
height: ((_o = data === null || data === void 0 ? void 0 : data.tag) === null || _o === void 0 ? void 0 : _o.link)
|
12227
|
+
? ((_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'
|
12228
|
+
: 0
|
12229
|
+
} }))),
|
12230
|
+
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 }),
|
12231
|
+
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' }) },
|
12232
|
+
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'))))));
|
12045
12233
|
}
|
12046
12234
|
|
12047
12235
|
var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAaZJREFUeF7t2jFKBEEQRuG3mSJeQTARURDMTL2EqXfwAnoKD6FHMDEzNVIw2tzQC2gFggyDrExX1V92T7wz9PumFnqbXdH5teq8nwEwJqBzgfEVKDYAW8Ae8NZq3ZUm4Aa4AnaBR+C8BUIVAIu/ngSfAs9LESoAWLgB/LzWwP7SeLtfHWAu3tZ9Adz/dwD3eOUJCIlXBQiLVwQIjVcDCI9XAkiJVwFIi1cASI3PBpjb3jbd5GyyUcraCUrEZ02ATHwGgFR8NIBcfCSAZHwUgGx8BIB0vDeAfLwnQIl4L4Ay8R4ApeJbA2wD78DOZA/e7ABzk739Xz/T8rfAIfA6WYCd3BqA7NUSwCKfgLNKCK0BjoC7rzP74yoIrQGsuxSCB0ApBC+AMgieACUQvAHkESIApBGiAGQRIgEkEaIB5BAyAKQQsgBkEDIBJBCyAdIRFABSEVQA0hCUAFIQ1ADCERQBQhFUAcIQlAFCENQBfkOwg9eXpeftFQDmEOzv8ifARy8A3wiXwAHwANwujbf7q0xAi9bZZwwAN9oiDx4TUORFuS2z+wn4BAiAaEHnKChjAAAAAElFTkSuQmCC";
|
@@ -12050,7 +12238,7 @@ Made in Italy` })));
|
|
12050
12238
|
* @Author: binruan@chatlabs.com
|
12051
12239
|
* @Date: 2024-01-10 10:58:24
|
12052
12240
|
* @LastEditors: binruan@chatlabs.com
|
12053
|
-
* @LastEditTime: 2024-
|
12241
|
+
* @LastEditTime: 2024-06-06 17:19:25
|
12054
12242
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
12055
12243
|
*
|
12056
12244
|
*/
|
@@ -12959,7 +13147,7 @@ Made in Italy` })));
|
|
12959
13147
|
* @Author: binruan@chatlabs.com
|
12960
13148
|
* @Date: 2024-01-15 19:03:09
|
12961
13149
|
* @LastEditors: binruan@chatlabs.com
|
12962
|
-
* @LastEditTime: 2024-
|
13150
|
+
* @LastEditTime: 2024-06-06 18:42:24
|
12963
13151
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
12964
13152
|
*
|
12965
13153
|
*/
|
@@ -13019,7 +13207,7 @@ Made in Italy` })));
|
|
13019
13207
|
};
|
13020
13208
|
const firstRef = React.useRef();
|
13021
13209
|
React.useEffect(() => {
|
13022
|
-
var _a, _b, _c;
|
13210
|
+
var _a, _b, _c, _d;
|
13023
13211
|
if (!firstRef.current && !videoRef && (playerRef === null || playerRef === void 0 ? void 0 : playerRef.current) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
|
13024
13212
|
firstRef.current = true;
|
13025
13213
|
const player = TCPlayer('player-container-id', {
|
@@ -13031,11 +13219,13 @@ Made in Italy` })));
|
|
13031
13219
|
preload: 'auto',
|
13032
13220
|
posterImage: false,
|
13033
13221
|
bigPlayButton: true,
|
13034
|
-
sources: [
|
13035
|
-
|
13036
|
-
|
13037
|
-
|
13038
|
-
|
13222
|
+
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)
|
13223
|
+
? [
|
13224
|
+
{
|
13225
|
+
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
|
13226
|
+
}
|
13227
|
+
]
|
13228
|
+
: []
|
13039
13229
|
});
|
13040
13230
|
player === null || player === void 0 ? void 0 : player.ready(() => {
|
13041
13231
|
setVideoRef(player);
|