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.cjs CHANGED
@@ -12269,35 +12269,21 @@ const FingerSwipeTip = ({ imageUrl }) => {
12269
12269
  * @Author: binruan@chatlabs.com
12270
12270
  * @Date: 2024-03-20 10:27:31
12271
12271
  * @LastEditors: binruan@chatlabs.com
12272
- * @LastEditTime: 2024-04-17 18:59:40
12272
+ * @LastEditTime: 2024-04-18 10:30:17
12273
12273
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\Picture.tsx
12274
12274
  *
12275
12275
  */
12276
12276
  const Picture = (props) => {
12277
12277
  const { src, height, width } = props;
12278
12278
  const [blur, setBlur] = React.useState(false);
12279
- useSxpDataSource();
12280
12279
  const onLoad = (img) => {
12281
- const aspectRatio = img.height / img.width;
12280
+ const aspectRatio = img.naturalHeight / img.naturalWidth;
12282
12281
  const targetAspectRatio = 16 / 9;
12283
12282
  const tolerance = 0.05; // 允许的宽高比误差范围
12284
12283
  if (Math.abs(aspectRatio - targetAspectRatio) > tolerance) {
12285
12284
  setBlur(true);
12286
12285
  }
12287
12286
  };
12288
- React.useCallback((src, style) => {
12289
- if (src === '' || !src)
12290
- return;
12291
- return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? (React.createElement("picture", null,
12292
- React.createElement("source", { type: 'image/avif', srcSet: src }),
12293
- React.createElement("source", { type: 'image/webp', srcSet: `${src}?imageMogr2/format/webp` }),
12294
- React.createElement("source", { type: 'image/jpeg', srcSet: `${src}?imageMogr2/format/jpg` }),
12295
- React.createElement("img", { src: src, style: style, onLoad: (e) => {
12296
- onLoad(e.target);
12297
- } }))) : (React.createElement("img", { src: src, style: style, onLoad: (e) => {
12298
- onLoad(e.target);
12299
- } }));
12300
- }, []);
12301
12287
  return (React.createElement("div", { style: {
12302
12288
  overflow: 'hidden',
12303
12289
  height,
@@ -12536,7 +12522,7 @@ const Nudge = ({ nudge }) => {
12536
12522
  * @Author: binruan@chatlabs.com
12537
12523
  * @Date: 2024-01-15 19:03:09
12538
12524
  * @LastEditors: binruan@chatlabs.com
12539
- * @LastEditTime: 2024-04-17 10:30:08
12525
+ * @LastEditTime: 2024-04-18 09:43:19
12540
12526
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12541
12527
  *
12542
12528
  */
@@ -12740,7 +12726,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12740
12726
  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
12741
12727
  // textShadow: globalConfig?.isOpenTextShadow ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none'
12742
12728
  ), onChange: onExpandableChange }),
12743
- 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 })))));
12729
+ 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 })))));
12744
12730
  }
12745
12731
  return null;
12746
12732
  }, [