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.
@@ -30,6 +30,8 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
30
30
  }, [text, maxStr, isShowMore]);
31
31
  useEffect(() => {
32
32
  var _a, _b;
33
+ if (multiRowCopy === null || multiRowCopy === void 0 ? void 0 : multiRowCopy.current)
34
+ multiRowCopy.current.style.display = 'block';
33
35
  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) {
34
36
  setIsShow(true);
35
37
  }
@@ -37,7 +39,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
37
39
  setIsShow(false);
38
40
  }
39
41
  multiRowCopy.current.style.display = 'none';
40
- }, [isPost]);
42
+ }, [isPost, text]);
41
43
  return (React.createElement("div", { className: className, style: Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' }), hidden: !text || text === '' },
42
44
  React.createElement("div", { ref: multiRow, style: {
43
45
  overflow: 'hidden',
@@ -19,6 +19,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
19
19
  const videoRef = useRef();
20
20
  const videoId = `pb-cache-video-${index}`;
21
21
  const videoEleRef = useRef(null);
22
+ const hlsRef = useRef(null);
22
23
  const blur = useMemo(() => {
23
24
  return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
24
25
  }, [videoPostConfig]);
@@ -197,12 +198,12 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
197
198
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
198
199
  return;
199
200
  const Hls = window === null || window === void 0 ? void 0 : window.Hls;
200
- let hls = null;
201
+ let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
201
202
  if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
202
203
  hls = new Hls();
203
- hls.loadSource(videoSrc);
204
- hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
205
- hls.on(Hls.Events.MANIFEST_PARSED, function () {
204
+ hls === null || hls === void 0 ? void 0 : hls.loadSource(videoSrc);
205
+ hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
206
+ hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
206
207
  var _a;
207
208
  (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
208
209
  });
@@ -221,23 +222,23 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
221
222
  (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
222
223
  (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
223
224
  return () => {
224
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
225
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
225
226
  const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
226
227
  if (!isPause)
227
228
  handlePause();
228
- if (hls)
229
- hls === null || hls === void 0 ? void 0 : hls.destroy();
229
+ if (hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current)
230
+ (_b = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current) === null || _b === void 0 ? void 0 : _b.destroy();
230
231
  setIsLoadFinish(false);
231
- (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('loadedmetadata', handleLoadedmetadata);
232
- (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('loadeddata', handLoadeddata);
233
- (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('play', handleStartPlay);
234
- (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('playing', handlePlaying);
235
- (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('pause', handlePause);
236
- (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('ended', handlePlay);
237
- (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('canplay', handlePlay);
238
- (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('waiting', handleWaiting);
232
+ (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('loadedmetadata', handleLoadedmetadata);
233
+ (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
234
+ (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
235
+ (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
236
+ (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
237
+ (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
238
+ (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
239
+ (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
239
240
  };
240
- }, [isActive, videoId, rec, handlePause]);
241
+ }, [isActive]);
241
242
  useEffect(() => {
242
243
  var _a, _b;
243
244
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
@@ -33,6 +33,8 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
33
33
  }, [text, maxStr, isShowMore]);
34
34
  (0, react_1.useEffect)(() => {
35
35
  var _a, _b;
36
+ if (multiRowCopy === null || multiRowCopy === void 0 ? void 0 : multiRowCopy.current)
37
+ multiRowCopy.current.style.display = 'block';
36
38
  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) {
37
39
  setIsShow(true);
38
40
  }
@@ -40,7 +42,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
40
42
  setIsShow(false);
41
43
  }
42
44
  multiRowCopy.current.style.display = 'none';
43
- }, [isPost]);
45
+ }, [isPost, text]);
44
46
  return (react_1.default.createElement("div", { className: className, style: Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' }), hidden: !text || text === '' },
45
47
  react_1.default.createElement("div", { ref: multiRow, style: {
46
48
  overflow: 'hidden',
@@ -22,6 +22,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
22
22
  const videoRef = (0, react_1.useRef)();
23
23
  const videoId = `pb-cache-video-${index}`;
24
24
  const videoEleRef = (0, react_1.useRef)(null);
25
+ const hlsRef = (0, react_1.useRef)(null);
25
26
  const blur = (0, react_1.useMemo)(() => {
26
27
  return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
27
28
  }, [videoPostConfig]);
@@ -200,12 +201,12 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
200
201
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
201
202
  return;
202
203
  const Hls = window === null || window === void 0 ? void 0 : window.Hls;
203
- let hls = null;
204
+ let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
204
205
  if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
205
206
  hls = new Hls();
206
- hls.loadSource(videoSrc);
207
- hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
208
- hls.on(Hls.Events.MANIFEST_PARSED, function () {
207
+ hls === null || hls === void 0 ? void 0 : hls.loadSource(videoSrc);
208
+ hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
209
+ hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
209
210
  var _a;
210
211
  (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
211
212
  });
@@ -224,23 +225,23 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
224
225
  (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
225
226
  (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
226
227
  return () => {
227
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
228
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
228
229
  const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
229
230
  if (!isPause)
230
231
  handlePause();
231
- if (hls)
232
- hls === null || hls === void 0 ? void 0 : hls.destroy();
232
+ if (hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current)
233
+ (_b = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current) === null || _b === void 0 ? void 0 : _b.destroy();
233
234
  setIsLoadFinish(false);
234
- (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('loadedmetadata', handleLoadedmetadata);
235
- (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('loadeddata', handLoadeddata);
236
- (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('play', handleStartPlay);
237
- (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('playing', handlePlaying);
238
- (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('pause', handlePause);
239
- (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('ended', handlePlay);
240
- (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('canplay', handlePlay);
241
- (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('waiting', handleWaiting);
235
+ (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('loadedmetadata', handleLoadedmetadata);
236
+ (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
237
+ (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
238
+ (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
239
+ (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
240
+ (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
241
+ (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
242
+ (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
242
243
  };
243
- }, [isActive, videoId, rec, handlePause]);
244
+ }, [isActive]);
244
245
  (0, react_1.useEffect)(() => {
245
246
  var _a, _b;
246
247
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.6.5",
3
+ "version": "1.6.6",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",