pb-sxp-ui 1.6.4 → 1.6.6
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 +28 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +28 -24
- 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 +28 -24
- 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/ExpandableText.js +3 -1
- package/es/core/components/SxpPageRender/Hashtag/index.js +3 -2
- package/es/core/components/SxpPageRender/VideoWidget/index.js +17 -16
- package/es/materials/sxp/template/components/Scroll.d.ts +0 -1
- package/es/materials/sxp/template/components/Scroll.js +2 -2
- package/lib/core/components/SxpPageRender/ExpandableText.js +3 -1
- package/lib/core/components/SxpPageRender/Hashtag/index.js +3 -2
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +17 -16
- package/lib/materials/sxp/template/components/Scroll.d.ts +0 -1
- package/lib/materials/sxp/template/components/Scroll.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -9060,7 +9060,7 @@ var Modal$1 = memo(Modal);
|
|
9060
9060
|
* @Author: binruan@chatlabs.com
|
9061
9061
|
* @Date: 2023-12-26 16:11:34
|
9062
9062
|
* @LastEditors: binruan@chatlabs.com
|
9063
|
-
* @LastEditTime: 2024-
|
9063
|
+
* @LastEditTime: 2024-10-18 14:52:42
|
9064
9064
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ExpandableText.tsx
|
9065
9065
|
*
|
9066
9066
|
*/
|
@@ -9097,6 +9097,8 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
9097
9097
|
}, [text, maxStr, isShowMore]);
|
9098
9098
|
useEffect(() => {
|
9099
9099
|
var _a, _b;
|
9100
|
+
if (multiRowCopy === null || multiRowCopy === void 0 ? void 0 : multiRowCopy.current)
|
9101
|
+
multiRowCopy.current.style.display = 'block';
|
9100
9102
|
if (((_a = multiRowCopy === null || multiRowCopy === void 0 ? void 0 : multiRowCopy.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) > ((_b = multiRow === null || multiRow === void 0 ? void 0 : multiRow.current) === null || _b === void 0 ? void 0 : _b.offsetHeight) && isPost) {
|
9101
9103
|
setIsShow(true);
|
9102
9104
|
}
|
@@ -9104,7 +9106,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
9104
9106
|
setIsShow(false);
|
9105
9107
|
}
|
9106
9108
|
multiRowCopy.current.style.display = 'none';
|
9107
|
-
}, [isPost]);
|
9109
|
+
}, [isPost, text]);
|
9108
9110
|
return (React.createElement("div", { className: className, style: Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' }), hidden: !text || text === '' },
|
9109
9111
|
React.createElement("div", { ref: multiRow, style: {
|
9110
9112
|
overflow: 'hidden',
|
@@ -9168,11 +9170,11 @@ var FormatImage$1 = memo(FormatImage);
|
|
9168
9170
|
* @Author: binruan@chatlabs.com
|
9169
9171
|
* @Date: 2024-03-20 10:27:32
|
9170
9172
|
* @LastEditors: binruan@chatlabs.com
|
9171
|
-
* @LastEditTime: 2024-10-17
|
9173
|
+
* @LastEditTime: 2024-10-17 18:02:56
|
9172
9174
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Scroll.tsx
|
9173
9175
|
*
|
9174
9176
|
*/
|
9175
|
-
const Scroll = ({ children, isPadding = true, style, enableSlideActive = false
|
9177
|
+
const Scroll = ({ children, isPadding = true, style, enableSlideActive = false }) => {
|
9176
9178
|
const ref = useRef();
|
9177
9179
|
const { popupDetailData } = useSxpDataSource();
|
9178
9180
|
useEffect(() => {
|
@@ -9180,7 +9182,7 @@ const Scroll = ({ children, isPadding = true, style, enableSlideActive = false,
|
|
9180
9182
|
if (enableSlideActive)
|
9181
9183
|
(_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
9182
9184
|
}, [popupDetailData, enableSlideActive]);
|
9183
|
-
return (React.createElement(Swiper, { ref: ref, direction: 'horizontal', slidesPerView: 'auto', freeMode: true, mousewheel: true, modules: [freeMode, Scrollbar, Mousewheel], style: Object.assign(
|
9185
|
+
return (React.createElement(Swiper, { ref: ref, direction: 'horizontal', slidesPerView: 'auto', freeMode: true, mousewheel: true, modules: [freeMode, Scrollbar, Mousewheel], style: Object.assign({ padding: isPadding ? '0 12px 0 20px' : 0 }, style) }, children));
|
9184
9186
|
};
|
9185
9187
|
var Scroll$1 = memo(Scroll);
|
9186
9188
|
|
@@ -15557,6 +15559,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15557
15559
|
const videoRef = useRef();
|
15558
15560
|
const videoId = `pb-cache-video-${index}`;
|
15559
15561
|
const videoEleRef = useRef(null);
|
15562
|
+
const hlsRef = useRef(null);
|
15560
15563
|
const blur = useMemo(() => {
|
15561
15564
|
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
15562
15565
|
}, [videoPostConfig]);
|
@@ -15735,12 +15738,12 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15735
15738
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
15736
15739
|
return;
|
15737
15740
|
const Hls = window === null || window === void 0 ? void 0 : window.Hls;
|
15738
|
-
let hls = null;
|
15741
|
+
let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
|
15739
15742
|
if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
|
15740
15743
|
hls = new Hls();
|
15741
|
-
hls.loadSource(videoSrc);
|
15742
|
-
hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
15743
|
-
hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
15744
|
+
hls === null || hls === void 0 ? void 0 : hls.loadSource(videoSrc);
|
15745
|
+
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
15746
|
+
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
15744
15747
|
var _a;
|
15745
15748
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
15746
15749
|
});
|
@@ -15759,23 +15762,23 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15759
15762
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
15760
15763
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
15761
15764
|
return () => {
|
15762
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
15765
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
15763
15766
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
15764
15767
|
if (!isPause)
|
15765
15768
|
handlePause();
|
15766
|
-
if (
|
15767
|
-
|
15769
|
+
if (hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current)
|
15770
|
+
(_b = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current) === null || _b === void 0 ? void 0 : _b.destroy();
|
15768
15771
|
setIsLoadFinish(false);
|
15769
|
-
(
|
15770
|
-
(
|
15771
|
-
(
|
15772
|
-
(
|
15773
|
-
(
|
15774
|
-
(
|
15775
|
-
(
|
15776
|
-
(
|
15772
|
+
(_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('loadedmetadata', handleLoadedmetadata);
|
15773
|
+
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
|
15774
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
|
15775
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
|
15776
|
+
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
|
15777
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
|
15778
|
+
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
15779
|
+
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
|
15777
15780
|
};
|
15778
|
-
}, [isActive
|
15781
|
+
}, [isActive]);
|
15779
15782
|
useEffect(() => {
|
15780
15783
|
var _a, _b;
|
15781
15784
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
|
@@ -16046,7 +16049,7 @@ var PictureGroup$3 = memo(PictureGroup$2);
|
|
16046
16049
|
* @Author: binruan@chatlabs.com
|
16047
16050
|
* @Date: 2024-01-15 19:03:09
|
16048
16051
|
* @LastEditors: binruan@chatlabs.com
|
16049
|
-
* @LastEditTime: 2024-10-17
|
16052
|
+
* @LastEditTime: 2024-10-17 18:02:31
|
16050
16053
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Hashtag\index.tsx
|
16051
16054
|
*
|
16052
16055
|
*/
|
@@ -16084,9 +16087,10 @@ const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle, hashTagRigh
|
|
16084
16087
|
return (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer', color: '#fff' }, onClick: () => setIsShowMore(!isShowMore) }, isShowMore ? 'show less' : 'show more'));
|
16085
16088
|
}, [isShowMore, tags]);
|
16086
16089
|
return (React.createElement("div", { className: 'clc-sxp-bottom-hashtag', style: {
|
16087
|
-
marginTop: `${(_a = hashTagStyle === null || hashTagStyle === void 0 ? void 0 : hashTagStyle.marginTop) !== null && _a !== void 0 ? _a : 16}px
|
16090
|
+
marginTop: `${(_a = hashTagStyle === null || hashTagStyle === void 0 ? void 0 : hashTagStyle.marginTop) !== null && _a !== void 0 ? _a : 16}px`,
|
16091
|
+
width: hashTagRightMargin
|
16088
16092
|
} },
|
16089
|
-
React.createElement(Scroll$1,
|
16093
|
+
React.createElement(Scroll$1, 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), tag: 'button', "aria-label": item },
|
16090
16094
|
React.createElement("div", { dangerouslySetInnerHTML: { __html: setFontForText(`#${item}`, hashTagStyle) } })))))));
|
16091
16095
|
};
|
16092
16096
|
var Hashtag$1 = memo(Hashtag);
|