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/pb-ui.js CHANGED
@@ -9075,7 +9075,7 @@
9075
9075
  * @Author: binruan@chatlabs.com
9076
9076
  * @Date: 2023-12-26 16:11:34
9077
9077
  * @LastEditors: binruan@chatlabs.com
9078
- * @LastEditTime: 2024-06-28 15:17:10
9078
+ * @LastEditTime: 2024-10-18 14:52:42
9079
9079
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ExpandableText.tsx
9080
9080
  *
9081
9081
  */
@@ -9112,6 +9112,8 @@
9112
9112
  }, [text, maxStr, isShowMore]);
9113
9113
  React.useEffect(() => {
9114
9114
  var _a, _b;
9115
+ if (multiRowCopy === null || multiRowCopy === void 0 ? void 0 : multiRowCopy.current)
9116
+ multiRowCopy.current.style.display = 'block';
9115
9117
  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) {
9116
9118
  setIsShow(true);
9117
9119
  }
@@ -9119,7 +9121,7 @@
9119
9121
  setIsShow(false);
9120
9122
  }
9121
9123
  multiRowCopy.current.style.display = 'none';
9122
- }, [isPost]);
9124
+ }, [isPost, text]);
9123
9125
  return (React.createElement("div", { className: className, style: Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' }), hidden: !text || text === '' },
9124
9126
  React.createElement("div", { ref: multiRow, style: {
9125
9127
  overflow: 'hidden',
@@ -15572,6 +15574,7 @@ Made in Italy` })));
15572
15574
  const videoRef = React.useRef();
15573
15575
  const videoId = `pb-cache-video-${index}`;
15574
15576
  const videoEleRef = React.useRef(null);
15577
+ const hlsRef = React.useRef(null);
15575
15578
  const blur = React.useMemo(() => {
15576
15579
  return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
15577
15580
  }, [videoPostConfig]);
@@ -15750,12 +15753,12 @@ Made in Italy` })));
15750
15753
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
15751
15754
  return;
15752
15755
  const Hls = window === null || window === void 0 ? void 0 : window.Hls;
15753
- let hls = null;
15756
+ let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
15754
15757
  if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
15755
15758
  hls = new Hls();
15756
- hls.loadSource(videoSrc);
15757
- hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
15758
- hls.on(Hls.Events.MANIFEST_PARSED, function () {
15759
+ hls === null || hls === void 0 ? void 0 : hls.loadSource(videoSrc);
15760
+ hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
15761
+ hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
15759
15762
  var _a;
15760
15763
  (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
15761
15764
  });
@@ -15774,23 +15777,23 @@ Made in Italy` })));
15774
15777
  (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
15775
15778
  (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
15776
15779
  return () => {
15777
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
15780
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
15778
15781
  const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
15779
15782
  if (!isPause)
15780
15783
  handlePause();
15781
- if (hls)
15782
- hls === null || hls === void 0 ? void 0 : hls.destroy();
15784
+ if (hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current)
15785
+ (_b = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current) === null || _b === void 0 ? void 0 : _b.destroy();
15783
15786
  setIsLoadFinish(false);
15784
- (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('loadedmetadata', handleLoadedmetadata);
15785
- (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('loadeddata', handLoadeddata);
15786
- (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('play', handleStartPlay);
15787
- (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('playing', handlePlaying);
15788
- (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('pause', handlePause);
15789
- (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('ended', handlePlay);
15790
- (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('canplay', handlePlay);
15791
- (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('waiting', handleWaiting);
15787
+ (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('loadedmetadata', handleLoadedmetadata);
15788
+ (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
15789
+ (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
15790
+ (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
15791
+ (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
15792
+ (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
15793
+ (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
15794
+ (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
15792
15795
  };
15793
- }, [isActive, videoId, rec, handlePause]);
15796
+ }, [isActive]);
15794
15797
  React.useEffect(() => {
15795
15798
  var _a, _b;
15796
15799
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)