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/index.cjs CHANGED
@@ -13477,20 +13477,23 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
13477
13477
  (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
13478
13478
  (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
13479
13479
  return () => {
13480
- var _a, _b, _c, _d, _e, _f, _g, _h;
13480
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
13481
+ const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
13482
+ if (!isPause)
13483
+ handlePause();
13481
13484
  if (hls)
13482
13485
  hls === null || hls === void 0 ? void 0 : hls.destroy();
13483
13486
  setIsLoadFinish(false);
13484
- (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedmetadata);
13485
- (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('loadeddata', handLoadeddata);
13486
- (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('play', handleStartPlay);
13487
- (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('playing', handlePlaying);
13488
- (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('pause', handlePause);
13489
- (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('ended', handlePlay);
13490
- (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('canplay', handlePlay);
13491
- (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('waiting', handleWaiting);
13487
+ (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('loadedmetadata', handleLoadedmetadata);
13488
+ (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('loadeddata', handLoadeddata);
13489
+ (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('play', handleStartPlay);
13490
+ (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('playing', handlePlaying);
13491
+ (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('pause', handlePause);
13492
+ (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('ended', handlePlay);
13493
+ (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('canplay', handlePlay);
13494
+ (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('waiting', handleWaiting);
13492
13495
  };
13493
- }, [isActive, videoId, rec]);
13496
+ }, [isActive, videoId, rec, handlePause]);
13494
13497
  React.useEffect(() => {
13495
13498
  var _a, _b;
13496
13499
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
@@ -13636,23 +13639,23 @@ var ToggleButton$1 = React.memo(ToggleButton);
13636
13639
  * @Author: binruan@chatlabs.com
13637
13640
  * @Date: 2024-01-15 19:03:09
13638
13641
  * @LastEditors: binruan@chatlabs.com
13639
- * @LastEditTime: 2024-03-13 10:53:56
13642
+ * @LastEditTime: 2024-07-11 18:19:29
13640
13643
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\FingerSwipeTip\index.tsx
13641
13644
  *
13642
13645
  */
13643
- const FingerSwipeTip = ({ imageUrl, style }) => {
13646
+ const FingerSwipeTip = ({ imageUrl, style, duration = 2000 }) => {
13644
13647
  const [show, setShow] = React.useState(true);
13645
13648
  useEditor();
13646
13649
  React.useEffect(() => {
13647
13650
  setTimeout(() => {
13648
13651
  setShow(false);
13649
- }, 2000);
13652
+ }, duration);
13650
13653
  }, []);
13651
13654
  const FINGER_SWIPE_ICON = useIconLink('/pb_static/finger-swipe-tip.29dc3a48a3c746c906ea..png');
13652
13655
  const animationCls = React.useMemo(() => {
13653
13656
  return show ? 'pb-fadeIn' : 'pb-fadeOut';
13654
13657
  }, [show]);
13655
- return (React.createElement("div", { hidden: !show, className: `pb-finger-wrap ${animationCls}`, style: style },
13658
+ return (React.createElement("div", { hidden: !show, className: `pb-finger-wrap ${animationCls}`, style: Object.assign(Object.assign({}, style), { animationDuration: `${duration / 1000}s` }) },
13656
13659
  React.createElement("img", { src: imageUrl || FINGER_SWIPE_ICON, alt: 'finger swiper' })));
13657
13660
  };
13658
13661
 
@@ -14379,7 +14382,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
14379
14382
  React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
14380
14383
  top: minusHeight
14381
14384
  } }),
14382
- 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,
14385
+ 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,
14383
14386
  React.createElement(Swiper, { style: {
14384
14387
  marginTop: tagHeight
14385
14388
  }, ref: swiperRef, onSlideChange: () => {