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 +4 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -18
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +4 -18
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/PictureGroup/Picture.js +2 -17
- package/es/core/components/SxpPageRender/index.js +1 -1
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.js +1 -16
- package/lib/core/components/SxpPageRender/index.js +1 -1
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
@@ -12261,35 +12261,21 @@ Made in Italy` })));
|
|
12261
12261
|
* @Author: binruan@chatlabs.com
|
12262
12262
|
* @Date: 2024-03-20 10:27:31
|
12263
12263
|
* @LastEditors: binruan@chatlabs.com
|
12264
|
-
* @LastEditTime: 2024-04-
|
12264
|
+
* @LastEditTime: 2024-04-18 10:30:17
|
12265
12265
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\Picture.tsx
|
12266
12266
|
*
|
12267
12267
|
*/
|
12268
12268
|
const Picture = (props) => {
|
12269
12269
|
const { src, height, width } = props;
|
12270
12270
|
const [blur, setBlur] = React.useState(false);
|
12271
|
-
useSxpDataSource();
|
12272
12271
|
const onLoad = (img) => {
|
12273
|
-
const aspectRatio = img.
|
12272
|
+
const aspectRatio = img.naturalHeight / img.naturalWidth;
|
12274
12273
|
const targetAspectRatio = 16 / 9;
|
12275
12274
|
const tolerance = 0.05; // 允许的宽高比误差范围
|
12276
12275
|
if (Math.abs(aspectRatio - targetAspectRatio) > tolerance) {
|
12277
12276
|
setBlur(true);
|
12278
12277
|
}
|
12279
12278
|
};
|
12280
|
-
React.useCallback((src, style) => {
|
12281
|
-
if (src === '' || !src)
|
12282
|
-
return;
|
12283
|
-
return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? (React.createElement("picture", null,
|
12284
|
-
React.createElement("source", { type: 'image/avif', srcSet: src }),
|
12285
|
-
React.createElement("source", { type: 'image/webp', srcSet: `${src}?imageMogr2/format/webp` }),
|
12286
|
-
React.createElement("source", { type: 'image/jpeg', srcSet: `${src}?imageMogr2/format/jpg` }),
|
12287
|
-
React.createElement("img", { src: src, style: style, onLoad: (e) => {
|
12288
|
-
onLoad(e.target);
|
12289
|
-
} }))) : (React.createElement("img", { src: src, style: style, onLoad: (e) => {
|
12290
|
-
onLoad(e.target);
|
12291
|
-
} }));
|
12292
|
-
}, []);
|
12293
12279
|
return (React.createElement("div", { style: {
|
12294
12280
|
overflow: 'hidden',
|
12295
12281
|
height,
|
@@ -12528,7 +12514,7 @@ Made in Italy` })));
|
|
12528
12514
|
* @Author: binruan@chatlabs.com
|
12529
12515
|
* @Date: 2024-01-15 19:03:09
|
12530
12516
|
* @LastEditors: binruan@chatlabs.com
|
12531
|
-
* @LastEditTime: 2024-04-
|
12517
|
+
* @LastEditTime: 2024-04-18 09:43:19
|
12532
12518
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
12533
12519
|
*
|
12534
12520
|
*/
|
@@ -12732,7 +12718,7 @@ Made in Italy` })));
|
|
12732
12718
|
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
|
12733
12719
|
// textShadow: globalConfig?.isOpenTextShadow ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none'
|
12734
12720
|
), onChange: onExpandableChange }),
|
12735
|
-
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.
|
12721
|
+
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 })))));
|
12736
12722
|
}
|
12737
12723
|
return null;
|
12738
12724
|
}, [
|