pb-sxp-ui 1.0.95 → 1.0.97

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
@@ -9683,7 +9683,7 @@ function useOnScreen(ref) {
9683
9683
  * @Author: binruan@chatlabs.com
9684
9684
  * @Date: 2024-01-16 14:50:13
9685
9685
  * @LastEditors: binruan@chatlabs.com
9686
- * @LastEditTime: 2024-06-21 16:34:48
9686
+ * @LastEditTime: 2024-06-24 15:41:25
9687
9687
  * @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
9688
9688
  *
9689
9689
  */
@@ -9700,7 +9700,7 @@ const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
9700
9700
  }
9701
9701
  }, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
9702
9702
  const imgSrc = React.useMemo(() => {
9703
- return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? src : `${src}?imrquality/rquality/40`;
9703
+ return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? src : `${src}?imrquality/rquality/20`;
9704
9704
  }, [src]);
9705
9705
  return (React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, imgStyle)) },
9706
9706
  React.createElement("div", { ref: ref, hidden: !src, className: css.css({ width: '100%', height: '100%' }) },
@@ -10274,7 +10274,7 @@ const MultiCommodity$1 = (_a) => {
10274
10274
  }
10275
10275
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
10276
10276
  return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
10277
- var _a, _b, _c, _d, _e, _f, _g;
10277
+ var _a, _b, _c, _d, _e, _f, _g, _h;
10278
10278
  return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: item.itemId, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
10279
10279
  React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
10280
10280
  React.createElement("div", { className: css.css({
@@ -10286,7 +10286,7 @@ const MultiCommodity$1 = (_a) => {
10286
10286
  overflow: 'hidden'
10287
10287
  }) },
10288
10288
  React.createElement("div", { className: styles$1['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name'),
10289
- React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))))));
10289
+ React.createElement("div", { className: css.css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', lineHeight: ((_f = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _f === void 0 ? void 0 : _f.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_h = (_g = item === null || item === void 0 ? void 0 : item.bindCta) === null || _g === void 0 ? void 0 : _g.enTitle) !== null && _h !== void 0 ? _h : 'Shop Now'))))));
10290
10290
  })));
10291
10291
  };
10292
10292
  var MultiCommodityComponent = React.memo(MultiCommodity$1);
@@ -13047,8 +13047,9 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
13047
13047
  if (!videoSrc)
13048
13048
  return;
13049
13049
  const Hls = window === null || window === void 0 ? void 0 : window.Hls;
13050
+ let hls = null;
13050
13051
  if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
13051
- const hls = new Hls();
13052
+ hls = new Hls();
13052
13053
  hls.loadSource(videoSrc);
13053
13054
  hls.attachMedia(videoRef);
13054
13055
  hls.on(Hls.Events.MANIFEST_PARSED, function () {
@@ -13075,6 +13076,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
13075
13076
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('canplay', handlePlay);
13076
13077
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('waiting', handleWaiting);
13077
13078
  return () => {
13079
+ hls.destroy();
13078
13080
  setIsLoadFinish(false);
13079
13081
  dom2 === null || dom2 === void 0 ? void 0 : dom2.appendChild(dom);
13080
13082
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadedmetadata', handleLoadedmetadata);