pb-sxp-ui 1.0.14 → 1.0.16
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 +24 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -0
- package/dist/index.js +24 -15
- 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 +24 -15
- 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/ExpandableText.js +1 -2
- package/es/core/components/SxpPageRender/PictureGroup/Picture.js +9 -5
- package/es/core/components/SxpPageRender/index.js +3 -3
- package/es/core/utils/localStore.d.ts +1 -0
- package/es/core/utils/localStore.js +6 -2
- package/lib/core/components/SxpPageRender/ExpandableText.js +1 -2
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.js +8 -4
- package/lib/core/components/SxpPageRender/index.js +3 -3
- package/lib/core/utils/localStore.d.ts +1 -0
- package/lib/core/utils/localStore.js +7 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -392,6 +392,7 @@ const getFeSessionId = () => {
|
|
392
392
|
};
|
393
393
|
|
394
394
|
const FAKE_USER_KEY = 'SXP_FAKE_USER_ID';
|
395
|
+
const FAKE_USER_STATE = 'FAKE_USER_STATE';
|
395
396
|
const storeAndLoadFeUserId = () => {
|
396
397
|
let fakeUserId = window.localStorage.getItem(FAKE_USER_KEY);
|
397
398
|
if (lodash.isEmpty(fakeUserId)) {
|
@@ -401,8 +402,11 @@ const storeAndLoadFeUserId = () => {
|
|
401
402
|
return fakeUserId;
|
402
403
|
};
|
403
404
|
const getFeUserId = () => {
|
404
|
-
const
|
405
|
-
|
405
|
+
const fakeUserState = window.localStorage.getItem(FAKE_USER_STATE);
|
406
|
+
if (lodash.isEmpty(fakeUserState)) {
|
407
|
+
window.localStorage.setItem(FAKE_USER_STATE, 'true');
|
408
|
+
}
|
409
|
+
return lodash.isEmpty(fakeUserState);
|
406
410
|
};
|
407
411
|
|
408
412
|
/*
|
@@ -8244,7 +8248,7 @@ var Modal$1 = React.memo(Modal);
|
|
8244
8248
|
* @Author: binruan@chatlabs.com
|
8245
8249
|
* @Date: 2023-12-26 16:11:34
|
8246
8250
|
* @LastEditors: binruan@chatlabs.com
|
8247
|
-
* @LastEditTime: 2024-04-
|
8251
|
+
* @LastEditTime: 2024-04-17 10:18:57
|
8248
8252
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ExpandableText.tsx
|
8249
8253
|
*
|
8250
8254
|
*/
|
@@ -8273,7 +8277,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
8273
8277
|
const multiRow = React.useRef(null);
|
8274
8278
|
const handleClick = React.useCallback(() => {
|
8275
8279
|
setIsShowMore(!isShowMore);
|
8276
|
-
|
8280
|
+
// onChange?.(!isShowMore);
|
8277
8281
|
}, [isShowMore, onChange]);
|
8278
8282
|
React.useMemo(() => {
|
8279
8283
|
return !isShowMore && text.length > maxStr ? limitTextLastWholeWord(text, maxStr) + '...' : text;
|
@@ -8300,7 +8304,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
8300
8304
|
return (React.createElement("div", { className: className, style: Object.assign({}, style), hidden: !text || text === '' },
|
8301
8305
|
React.createElement("div", { ref: multiRow, style: {
|
8302
8306
|
overflow: 'hidden',
|
8303
|
-
WebkitLineClamp: isShowMore ? '' : lineClamp,
|
8307
|
+
WebkitLineClamp: !isPost || isShowMore ? '' : lineClamp,
|
8304
8308
|
textOverflow: 'ellipsis',
|
8305
8309
|
display: '-webkit-box',
|
8306
8310
|
WebkitBoxOrient: 'vertical',
|
@@ -12240,7 +12244,7 @@ const FingerSwipeTip = ({ imageUrl }) => {
|
|
12240
12244
|
* @Author: binruan@chatlabs.com
|
12241
12245
|
* @Date: 2024-03-20 10:27:31
|
12242
12246
|
* @LastEditors: binruan@chatlabs.com
|
12243
|
-
* @LastEditTime: 2024-04-
|
12247
|
+
* @LastEditTime: 2024-04-17 10:23:35
|
12244
12248
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\Picture.tsx
|
12245
12249
|
*
|
12246
12250
|
*/
|
@@ -12249,6 +12253,9 @@ const Picture = (props) => {
|
|
12249
12253
|
const [blur, setBlur] = React.useState(false);
|
12250
12254
|
const imgDom = React.useRef(null);
|
12251
12255
|
const { sxpParameter } = useSxpDataSource();
|
12256
|
+
const getAvifToPng = React.useCallback((src) => {
|
12257
|
+
return src;
|
12258
|
+
}, []);
|
12252
12259
|
React.useEffect(() => {
|
12253
12260
|
if (imgDom.current === null || src === '') {
|
12254
12261
|
return;
|
@@ -12263,22 +12270,22 @@ const Picture = (props) => {
|
|
12263
12270
|
setBlur(true);
|
12264
12271
|
}
|
12265
12272
|
};
|
12266
|
-
imgDom.current.src = src;
|
12267
|
-
}, [src]);
|
12273
|
+
imgDom.current.src = getAvifToPng(src);
|
12274
|
+
}, [src, getAvifToPng]);
|
12268
12275
|
return (React.createElement("div", { style: {
|
12269
12276
|
overflow: 'hidden',
|
12270
12277
|
height,
|
12271
12278
|
width: '100%',
|
12272
12279
|
position: 'relative'
|
12273
12280
|
} },
|
12274
|
-
React.createElement("img", { ref: imgDom, loading: 'lazy', src: src
|
12281
|
+
React.createElement("img", { ref: imgDom, loading: 'lazy', src: src ? getAvifToPng(src) : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, style: {
|
12275
12282
|
height: '100%',
|
12276
12283
|
width: '100%',
|
12277
12284
|
objectFit: 'cover',
|
12278
12285
|
filter: blur ? 'blur(10px)' : 'none',
|
12279
12286
|
transform: blur ? 'scale(1.2)' : 'none'
|
12280
12287
|
} }),
|
12281
|
-
blur && (React.createElement("img", { ref: imgDom, src: src, loading: 'lazy', style: {
|
12288
|
+
blur && (React.createElement("img", { ref: imgDom, src: getAvifToPng(src), loading: 'lazy', style: {
|
12282
12289
|
width: '100%',
|
12283
12290
|
objectFit: 'contain',
|
12284
12291
|
position: 'absolute',
|
@@ -12293,7 +12300,7 @@ const Picture = (props) => {
|
|
12293
12300
|
* @Author: lewinlu@chatlabs.com
|
12294
12301
|
* @Date: 2024-01-03 14:39:09
|
12295
12302
|
* @LastEditors: binruan@chatlabs.com
|
12296
|
-
* @LastEditTime: 2024-04-
|
12303
|
+
* @LastEditTime: 2024-04-16 22:06:11
|
12297
12304
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
|
12298
12305
|
*/
|
12299
12306
|
const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent }) => {
|
@@ -12500,7 +12507,7 @@ const Nudge = ({ nudge }) => {
|
|
12500
12507
|
* @Author: binruan@chatlabs.com
|
12501
12508
|
* @Date: 2024-01-15 19:03:09
|
12502
12509
|
* @LastEditors: binruan@chatlabs.com
|
12503
|
-
* @LastEditTime: 2024-04-
|
12510
|
+
* @LastEditTime: 2024-04-17 10:13:19
|
12504
12511
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
12505
12512
|
*
|
12506
12513
|
*/
|
@@ -12518,7 +12525,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12518
12525
|
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData } = useSxpDataSource();
|
12519
12526
|
const { productView } = useEventReport();
|
12520
12527
|
const isShowFingerTip = React.useMemo(() => {
|
12521
|
-
return data.length > 0 && !loading &&
|
12528
|
+
return data.length > 0 && !loading && getFeUserId();
|
12522
12529
|
}, [data, loading]);
|
12523
12530
|
const handleH5EnterLink = React.useCallback(() => {
|
12524
12531
|
if (data.length <= 0) {
|
@@ -12700,8 +12707,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12700
12707
|
React.createElement(Nudge, { nudge: nudge }),
|
12701
12708
|
React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
12702
12709
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
|
12703
|
-
React.createElement("div",
|
12704
|
-
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(
|
12710
|
+
React.createElement("div", null,
|
12711
|
+
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
|
12712
|
+
// textShadow: globalConfig?.isOpenTextShadow ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none'
|
12713
|
+
), onChange: onExpandableChange }),
|
12705
12714
|
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
12715
|
}
|
12707
12716
|
return null;
|