pb-sxp-ui 1.6.5 → 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 CHANGED
@@ -9082,7 +9082,7 @@ var Modal$1 = React.memo(Modal);
9082
9082
  * @Author: binruan@chatlabs.com
9083
9083
  * @Date: 2023-12-26 16:11:34
9084
9084
  * @LastEditors: binruan@chatlabs.com
9085
- * @LastEditTime: 2024-06-28 15:17:10
9085
+ * @LastEditTime: 2024-10-18 14:52:42
9086
9086
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ExpandableText.tsx
9087
9087
  *
9088
9088
  */
@@ -9119,6 +9119,8 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
9119
9119
  }, [text, maxStr, isShowMore]);
9120
9120
  React.useEffect(() => {
9121
9121
  var _a, _b;
9122
+ if (multiRowCopy === null || multiRowCopy === void 0 ? void 0 : multiRowCopy.current)
9123
+ multiRowCopy.current.style.display = 'block';
9122
9124
  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) {
9123
9125
  setIsShow(true);
9124
9126
  }
@@ -9126,7 +9128,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
9126
9128
  setIsShow(false);
9127
9129
  }
9128
9130
  multiRowCopy.current.style.display = 'none';
9129
- }, [isPost]);
9131
+ }, [isPost, text]);
9130
9132
  return (React.createElement("div", { className: className, style: Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' }), hidden: !text || text === '' },
9131
9133
  React.createElement("div", { ref: multiRow, style: {
9132
9134
  overflow: 'hidden',
@@ -15579,6 +15581,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15579
15581
  const videoRef = React.useRef();
15580
15582
  const videoId = `pb-cache-video-${index}`;
15581
15583
  const videoEleRef = React.useRef(null);
15584
+ const hlsRef = React.useRef(null);
15582
15585
  const blur = React.useMemo(() => {
15583
15586
  return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
15584
15587
  }, [videoPostConfig]);
@@ -15757,12 +15760,12 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15757
15760
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
15758
15761
  return;
15759
15762
  const Hls = window === null || window === void 0 ? void 0 : window.Hls;
15760
- let hls = null;
15763
+ let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
15761
15764
  if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
15762
15765
  hls = new Hls();
15763
- hls.loadSource(videoSrc);
15764
- hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
15765
- hls.on(Hls.Events.MANIFEST_PARSED, function () {
15766
+ hls === null || hls === void 0 ? void 0 : hls.loadSource(videoSrc);
15767
+ hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
15768
+ hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
15766
15769
  var _a;
15767
15770
  (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
15768
15771
  });
@@ -15781,23 +15784,23 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15781
15784
  (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
15782
15785
  (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
15783
15786
  return () => {
15784
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
15787
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
15785
15788
  const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
15786
15789
  if (!isPause)
15787
15790
  handlePause();
15788
- if (hls)
15789
- hls === null || hls === void 0 ? void 0 : hls.destroy();
15791
+ if (hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current)
15792
+ (_b = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current) === null || _b === void 0 ? void 0 : _b.destroy();
15790
15793
  setIsLoadFinish(false);
15791
- (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('loadedmetadata', handleLoadedmetadata);
15792
- (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('loadeddata', handLoadeddata);
15793
- (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('play', handleStartPlay);
15794
- (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('playing', handlePlaying);
15795
- (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('pause', handlePause);
15796
- (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('ended', handlePlay);
15797
- (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('canplay', handlePlay);
15798
- (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('waiting', handleWaiting);
15794
+ (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('loadedmetadata', handleLoadedmetadata);
15795
+ (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
15796
+ (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
15797
+ (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
15798
+ (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
15799
+ (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
15800
+ (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
15801
+ (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
15799
15802
  };
15800
- }, [isActive, videoId, rec, handlePause]);
15803
+ }, [isActive]);
15801
15804
  React.useEffect(() => {
15802
15805
  var _a, _b;
15803
15806
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)