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/pb-ui.js CHANGED
@@ -384,6 +384,7 @@
384
384
  };
385
385
 
386
386
  const FAKE_USER_KEY = 'SXP_FAKE_USER_ID';
387
+ const FAKE_USER_STATE = 'FAKE_USER_STATE';
387
388
  const storeAndLoadFeUserId = () => {
388
389
  let fakeUserId = window.localStorage.getItem(FAKE_USER_KEY);
389
390
  if (lodash.isEmpty(fakeUserId)) {
@@ -393,8 +394,11 @@
393
394
  return fakeUserId;
394
395
  };
395
396
  const getFeUserId = () => {
396
- const fakeUserId = window.localStorage.getItem(FAKE_USER_KEY);
397
- return lodash.isEmpty(fakeUserId);
397
+ const fakeUserState = window.localStorage.getItem(FAKE_USER_STATE);
398
+ if (lodash.isEmpty(fakeUserState)) {
399
+ window.localStorage.setItem(FAKE_USER_STATE, 'true');
400
+ }
401
+ return lodash.isEmpty(fakeUserState);
398
402
  };
399
403
 
400
404
  /*
@@ -8236,7 +8240,7 @@
8236
8240
  * @Author: binruan@chatlabs.com
8237
8241
  * @Date: 2023-12-26 16:11:34
8238
8242
  * @LastEditors: binruan@chatlabs.com
8239
- * @LastEditTime: 2024-04-16 19:27:48
8243
+ * @LastEditTime: 2024-04-17 10:18:57
8240
8244
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ExpandableText.tsx
8241
8245
  *
8242
8246
  */
@@ -8265,7 +8269,7 @@
8265
8269
  const multiRow = React.useRef(null);
8266
8270
  const handleClick = React.useCallback(() => {
8267
8271
  setIsShowMore(!isShowMore);
8268
- onChange === null || onChange === void 0 ? void 0 : onChange(!isShowMore);
8272
+ // onChange?.(!isShowMore);
8269
8273
  }, [isShowMore, onChange]);
8270
8274
  React.useMemo(() => {
8271
8275
  return !isShowMore && text.length > maxStr ? limitTextLastWholeWord(text, maxStr) + '...' : text;
@@ -8292,7 +8296,7 @@
8292
8296
  return (React.createElement("div", { className: className, style: Object.assign({}, style), hidden: !text || text === '' },
8293
8297
  React.createElement("div", { ref: multiRow, style: {
8294
8298
  overflow: 'hidden',
8295
- WebkitLineClamp: isShowMore ? '' : lineClamp,
8299
+ WebkitLineClamp: !isPost || isShowMore ? '' : lineClamp,
8296
8300
  textOverflow: 'ellipsis',
8297
8301
  display: '-webkit-box',
8298
8302
  WebkitBoxOrient: 'vertical',
@@ -12232,7 +12236,7 @@ Made in Italy` })));
12232
12236
  * @Author: binruan@chatlabs.com
12233
12237
  * @Date: 2024-03-20 10:27:31
12234
12238
  * @LastEditors: binruan@chatlabs.com
12235
- * @LastEditTime: 2024-04-15 18:10:26
12239
+ * @LastEditTime: 2024-04-17 10:23:35
12236
12240
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\Picture.tsx
12237
12241
  *
12238
12242
  */
@@ -12241,6 +12245,9 @@ Made in Italy` })));
12241
12245
  const [blur, setBlur] = React.useState(false);
12242
12246
  const imgDom = React.useRef(null);
12243
12247
  const { sxpParameter } = useSxpDataSource();
12248
+ const getAvifToPng = React.useCallback((src) => {
12249
+ return src;
12250
+ }, []);
12244
12251
  React.useEffect(() => {
12245
12252
  if (imgDom.current === null || src === '') {
12246
12253
  return;
@@ -12255,22 +12262,22 @@ Made in Italy` })));
12255
12262
  setBlur(true);
12256
12263
  }
12257
12264
  };
12258
- imgDom.current.src = src;
12259
- }, [src]);
12265
+ imgDom.current.src = getAvifToPng(src);
12266
+ }, [src, getAvifToPng]);
12260
12267
  return (React.createElement("div", { style: {
12261
12268
  overflow: 'hidden',
12262
12269
  height,
12263
12270
  width: '100%',
12264
12271
  position: 'relative'
12265
12272
  } },
12266
- React.createElement("img", { ref: imgDom, loading: 'lazy', src: src !== null && src !== void 0 ? src : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, style: {
12273
+ React.createElement("img", { ref: imgDom, loading: 'lazy', src: src ? getAvifToPng(src) : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, style: {
12267
12274
  height: '100%',
12268
12275
  width: '100%',
12269
12276
  objectFit: 'cover',
12270
12277
  filter: blur ? 'blur(10px)' : 'none',
12271
12278
  transform: blur ? 'scale(1.2)' : 'none'
12272
12279
  } }),
12273
- blur && (React.createElement("img", { ref: imgDom, src: src, loading: 'lazy', style: {
12280
+ blur && (React.createElement("img", { ref: imgDom, src: getAvifToPng(src), loading: 'lazy', style: {
12274
12281
  width: '100%',
12275
12282
  objectFit: 'contain',
12276
12283
  position: 'absolute',
@@ -12285,7 +12292,7 @@ Made in Italy` })));
12285
12292
  * @Author: lewinlu@chatlabs.com
12286
12293
  * @Date: 2024-01-03 14:39:09
12287
12294
  * @LastEditors: binruan@chatlabs.com
12288
- * @LastEditTime: 2024-04-15 18:08:25
12295
+ * @LastEditTime: 2024-04-16 22:06:11
12289
12296
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
12290
12297
  */
12291
12298
  const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent }) => {
@@ -12492,7 +12499,7 @@ Made in Italy` })));
12492
12499
  * @Author: binruan@chatlabs.com
12493
12500
  * @Date: 2024-01-15 19:03:09
12494
12501
  * @LastEditors: binruan@chatlabs.com
12495
- * @LastEditTime: 2024-04-16 18:26:41
12502
+ * @LastEditTime: 2024-04-17 10:13:19
12496
12503
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12497
12504
  *
12498
12505
  */
@@ -12510,7 +12517,7 @@ Made in Italy` })));
12510
12517
  const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData } = useSxpDataSource();
12511
12518
  const { productView } = useEventReport();
12512
12519
  const isShowFingerTip = React.useMemo(() => {
12513
- return data.length > 0 && !loading && !getFeUserId;
12520
+ return data.length > 0 && !loading && getFeUserId();
12514
12521
  }, [data, loading]);
12515
12522
  const handleH5EnterLink = React.useCallback(() => {
12516
12523
  if (data.length <= 0) {
@@ -12692,8 +12699,10 @@ Made in Italy` })));
12692
12699
  React.createElement(Nudge, { nudge: nudge }),
12693
12700
  React.createElement("div", { className: 'clc-sxp-bottom-card' },
12694
12701
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
12695
- React.createElement("div", { style: lineGradStyle },
12696
- 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(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
12702
+ React.createElement("div", null,
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
12704
+ // textShadow: globalConfig?.isOpenTextShadow ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none'
12705
+ ), onChange: onExpandableChange }),
12697
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.url) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle })))));
12698
12707
  }
12699
12708
  return null;