pb-sxp-ui 1.1.0 → 1.1.2

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
@@ -13470,20 +13470,23 @@ Made in Italy` })));
13470
13470
  (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
13471
13471
  (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
13472
13472
  return () => {
13473
- var _a, _b, _c, _d, _e, _f, _g, _h;
13473
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
13474
+ const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
13475
+ if (!isPause)
13476
+ handlePause();
13474
13477
  if (hls)
13475
13478
  hls === null || hls === void 0 ? void 0 : hls.destroy();
13476
13479
  setIsLoadFinish(false);
13477
- (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedmetadata);
13478
- (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('loadeddata', handLoadeddata);
13479
- (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('play', handleStartPlay);
13480
- (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('playing', handlePlaying);
13481
- (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('pause', handlePause);
13482
- (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('ended', handlePlay);
13483
- (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('canplay', handlePlay);
13484
- (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('waiting', handleWaiting);
13480
+ (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('loadedmetadata', handleLoadedmetadata);
13481
+ (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('loadeddata', handLoadeddata);
13482
+ (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('play', handleStartPlay);
13483
+ (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('playing', handlePlaying);
13484
+ (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('pause', handlePause);
13485
+ (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('ended', handlePlay);
13486
+ (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('canplay', handlePlay);
13487
+ (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('waiting', handleWaiting);
13485
13488
  };
13486
- }, [isActive, videoId, rec]);
13489
+ }, [isActive, videoId, rec, handlePause]);
13487
13490
  React.useEffect(() => {
13488
13491
  var _a, _b;
13489
13492
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
@@ -13629,23 +13632,23 @@ Made in Italy` })));
13629
13632
  * @Author: binruan@chatlabs.com
13630
13633
  * @Date: 2024-01-15 19:03:09
13631
13634
  * @LastEditors: binruan@chatlabs.com
13632
- * @LastEditTime: 2024-03-13 10:53:56
13635
+ * @LastEditTime: 2024-07-11 18:19:29
13633
13636
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\FingerSwipeTip\index.tsx
13634
13637
  *
13635
13638
  */
13636
- const FingerSwipeTip = ({ imageUrl, style }) => {
13639
+ const FingerSwipeTip = ({ imageUrl, style, duration = 2000 }) => {
13637
13640
  const [show, setShow] = React.useState(true);
13638
13641
  useEditor();
13639
13642
  React.useEffect(() => {
13640
13643
  setTimeout(() => {
13641
13644
  setShow(false);
13642
- }, 2000);
13645
+ }, duration);
13643
13646
  }, []);
13644
13647
  const FINGER_SWIPE_ICON = useIconLink('/pb_static/finger-swipe-tip.29dc3a48a3c746c906ea..png');
13645
13648
  const animationCls = React.useMemo(() => {
13646
13649
  return show ? 'pb-fadeIn' : 'pb-fadeOut';
13647
13650
  }, [show]);
13648
- return (React.createElement("div", { hidden: !show, className: `pb-finger-wrap ${animationCls}`, style: style },
13651
+ return (React.createElement("div", { hidden: !show, className: `pb-finger-wrap ${animationCls}`, style: Object.assign(Object.assign({}, style), { animationDuration: `${duration / 1000}s` }) },
13649
13652
  React.createElement("img", { src: imageUrl || FINGER_SWIPE_ICON, alt: 'finger swiper' })));
13650
13653
  };
13651
13654
 
@@ -14372,7 +14375,7 @@ Made in Italy` })));
14372
14375
  React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
14373
14376
  top: minusHeight
14374
14377
  } }),
14375
- isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _a !== void 0 ? _a : 0)}%` } })) : null,
14378
+ isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _a !== void 0 ? _a : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
14376
14379
  React.createElement(Swiper, { style: {
14377
14380
  marginTop: tagHeight
14378
14381
  }, ref: swiperRef, onSlideChange: () => {