pb-sxp-ui 1.0.22 → 1.0.23

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.js CHANGED
@@ -12246,35 +12246,21 @@ const FingerSwipeTip = ({ imageUrl }) => {
12246
12246
  * @Author: binruan@chatlabs.com
12247
12247
  * @Date: 2024-03-20 10:27:31
12248
12248
  * @LastEditors: binruan@chatlabs.com
12249
- * @LastEditTime: 2024-04-17 18:59:40
12249
+ * @LastEditTime: 2024-04-18 10:30:17
12250
12250
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\Picture.tsx
12251
12251
  *
12252
12252
  */
12253
12253
  const Picture = (props) => {
12254
12254
  const { src, height, width } = props;
12255
12255
  const [blur, setBlur] = useState(false);
12256
- useSxpDataSource();
12257
12256
  const onLoad = (img) => {
12258
- const aspectRatio = img.height / img.width;
12257
+ const aspectRatio = img.naturalHeight / img.naturalWidth;
12259
12258
  const targetAspectRatio = 16 / 9;
12260
12259
  const tolerance = 0.05; // 允许的宽高比误差范围
12261
12260
  if (Math.abs(aspectRatio - targetAspectRatio) > tolerance) {
12262
12261
  setBlur(true);
12263
12262
  }
12264
12263
  };
12265
- useCallback((src, style) => {
12266
- if (src === '' || !src)
12267
- return;
12268
- return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? (React.createElement("picture", null,
12269
- React.createElement("source", { type: 'image/avif', srcSet: src }),
12270
- React.createElement("source", { type: 'image/webp', srcSet: `${src}?imageMogr2/format/webp` }),
12271
- React.createElement("source", { type: 'image/jpeg', srcSet: `${src}?imageMogr2/format/jpg` }),
12272
- React.createElement("img", { src: src, style: style, onLoad: (e) => {
12273
- onLoad(e.target);
12274
- } }))) : (React.createElement("img", { src: src, style: style, onLoad: (e) => {
12275
- onLoad(e.target);
12276
- } }));
12277
- }, []);
12278
12264
  return (React.createElement("div", { style: {
12279
12265
  overflow: 'hidden',
12280
12266
  height,
@@ -12513,7 +12499,7 @@ const Nudge = ({ nudge }) => {
12513
12499
  * @Author: binruan@chatlabs.com
12514
12500
  * @Date: 2024-01-15 19:03:09
12515
12501
  * @LastEditors: binruan@chatlabs.com
12516
- * @LastEditTime: 2024-04-17 10:30:08
12502
+ * @LastEditTime: 2024-04-18 09:43:19
12517
12503
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12518
12504
  *
12519
12505
  */
@@ -12717,7 +12703,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12717
12703
  React.createElement(ExpandableText$1, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign({}, descStyle
12718
12704
  // textShadow: globalConfig?.isOpenTextShadow ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none'
12719
12705
  ), onChange: onExpandableChange }),
12720
- React.createElement(Hashtag$1, { index: activeIndex, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.url) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle })))));
12706
+ React.createElement(Hashtag$1, { index: activeIndex, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle })))));
12721
12707
  }
12722
12708
  return null;
12723
12709
  }, [