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.css CHANGED
@@ -1319,6 +1319,7 @@ button.swiper-pagination-bullet {
1319
1319
  bottom: 0;
1320
1320
  left: 0;
1321
1321
  right: 0;
1322
+ padding: 20px 0 20px 0;
1322
1323
  }
1323
1324
  .clc-sxp-bottom-nudge {
1324
1325
  display: -webkit-box;
package/dist/index.js CHANGED
@@ -369,6 +369,7 @@ const getFeSessionId = () => {
369
369
  };
370
370
 
371
371
  const FAKE_USER_KEY = 'SXP_FAKE_USER_ID';
372
+ const FAKE_USER_STATE = 'FAKE_USER_STATE';
372
373
  const storeAndLoadFeUserId = () => {
373
374
  let fakeUserId = window.localStorage.getItem(FAKE_USER_KEY);
374
375
  if (isEmpty(fakeUserId)) {
@@ -378,8 +379,11 @@ const storeAndLoadFeUserId = () => {
378
379
  return fakeUserId;
379
380
  };
380
381
  const getFeUserId = () => {
381
- const fakeUserId = window.localStorage.getItem(FAKE_USER_KEY);
382
- return isEmpty(fakeUserId);
382
+ const fakeUserState = window.localStorage.getItem(FAKE_USER_STATE);
383
+ if (isEmpty(fakeUserState)) {
384
+ window.localStorage.setItem(FAKE_USER_STATE, 'true');
385
+ }
386
+ return isEmpty(fakeUserState);
383
387
  };
384
388
 
385
389
  /*
@@ -8221,7 +8225,7 @@ var Modal$1 = memo(Modal);
8221
8225
  * @Author: binruan@chatlabs.com
8222
8226
  * @Date: 2023-12-26 16:11:34
8223
8227
  * @LastEditors: binruan@chatlabs.com
8224
- * @LastEditTime: 2024-04-16 19:27:48
8228
+ * @LastEditTime: 2024-04-17 10:18:57
8225
8229
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ExpandableText.tsx
8226
8230
  *
8227
8231
  */
@@ -8250,7 +8254,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
8250
8254
  const multiRow = useRef(null);
8251
8255
  const handleClick = useCallback(() => {
8252
8256
  setIsShowMore(!isShowMore);
8253
- onChange === null || onChange === void 0 ? void 0 : onChange(!isShowMore);
8257
+ // onChange?.(!isShowMore);
8254
8258
  }, [isShowMore, onChange]);
8255
8259
  useMemo(() => {
8256
8260
  return !isShowMore && text.length > maxStr ? limitTextLastWholeWord(text, maxStr) + '...' : text;
@@ -8277,7 +8281,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
8277
8281
  return (React.createElement("div", { className: className, style: Object.assign({}, style), hidden: !text || text === '' },
8278
8282
  React.createElement("div", { ref: multiRow, style: {
8279
8283
  overflow: 'hidden',
8280
- WebkitLineClamp: isShowMore ? '' : lineClamp,
8284
+ WebkitLineClamp: !isPost || isShowMore ? '' : lineClamp,
8281
8285
  textOverflow: 'ellipsis',
8282
8286
  display: '-webkit-box',
8283
8287
  WebkitBoxOrient: 'vertical',
@@ -12217,7 +12221,7 @@ const FingerSwipeTip = ({ imageUrl }) => {
12217
12221
  * @Author: binruan@chatlabs.com
12218
12222
  * @Date: 2024-03-20 10:27:31
12219
12223
  * @LastEditors: binruan@chatlabs.com
12220
- * @LastEditTime: 2024-04-15 18:10:26
12224
+ * @LastEditTime: 2024-04-17 10:23:35
12221
12225
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\Picture.tsx
12222
12226
  *
12223
12227
  */
@@ -12226,6 +12230,9 @@ const Picture = (props) => {
12226
12230
  const [blur, setBlur] = useState(false);
12227
12231
  const imgDom = useRef(null);
12228
12232
  const { sxpParameter } = useSxpDataSource();
12233
+ const getAvifToPng = useCallback((src) => {
12234
+ return src;
12235
+ }, []);
12229
12236
  useEffect(() => {
12230
12237
  if (imgDom.current === null || src === '') {
12231
12238
  return;
@@ -12240,22 +12247,22 @@ const Picture = (props) => {
12240
12247
  setBlur(true);
12241
12248
  }
12242
12249
  };
12243
- imgDom.current.src = src;
12244
- }, [src]);
12250
+ imgDom.current.src = getAvifToPng(src);
12251
+ }, [src, getAvifToPng]);
12245
12252
  return (React.createElement("div", { style: {
12246
12253
  overflow: 'hidden',
12247
12254
  height,
12248
12255
  width: '100%',
12249
12256
  position: 'relative'
12250
12257
  } },
12251
- 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: {
12258
+ React.createElement("img", { ref: imgDom, loading: 'lazy', src: src ? getAvifToPng(src) : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, style: {
12252
12259
  height: '100%',
12253
12260
  width: '100%',
12254
12261
  objectFit: 'cover',
12255
12262
  filter: blur ? 'blur(10px)' : 'none',
12256
12263
  transform: blur ? 'scale(1.2)' : 'none'
12257
12264
  } }),
12258
- blur && (React.createElement("img", { ref: imgDom, src: src, loading: 'lazy', style: {
12265
+ blur && (React.createElement("img", { ref: imgDom, src: getAvifToPng(src), loading: 'lazy', style: {
12259
12266
  width: '100%',
12260
12267
  objectFit: 'contain',
12261
12268
  position: 'absolute',
@@ -12270,7 +12277,7 @@ const Picture = (props) => {
12270
12277
  * @Author: lewinlu@chatlabs.com
12271
12278
  * @Date: 2024-01-03 14:39:09
12272
12279
  * @LastEditors: binruan@chatlabs.com
12273
- * @LastEditTime: 2024-04-15 18:08:25
12280
+ * @LastEditTime: 2024-04-16 22:06:11
12274
12281
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
12275
12282
  */
12276
12283
  const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent }) => {
@@ -12477,7 +12484,7 @@ const Nudge = ({ nudge }) => {
12477
12484
  * @Author: binruan@chatlabs.com
12478
12485
  * @Date: 2024-01-15 19:03:09
12479
12486
  * @LastEditors: binruan@chatlabs.com
12480
- * @LastEditTime: 2024-04-16 18:26:41
12487
+ * @LastEditTime: 2024-04-17 10:13:19
12481
12488
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12482
12489
  *
12483
12490
  */
@@ -12495,7 +12502,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12495
12502
  const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData } = useSxpDataSource();
12496
12503
  const { productView } = useEventReport();
12497
12504
  const isShowFingerTip = useMemo(() => {
12498
- return data.length > 0 && !loading && !getFeUserId;
12505
+ return data.length > 0 && !loading && getFeUserId();
12499
12506
  }, [data, loading]);
12500
12507
  const handleH5EnterLink = useCallback(() => {
12501
12508
  if (data.length <= 0) {
@@ -12677,8 +12684,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12677
12684
  React.createElement(Nudge, { nudge: nudge }),
12678
12685
  React.createElement("div", { className: 'clc-sxp-bottom-card' },
12679
12686
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
12680
- React.createElement("div", { style: lineGradStyle },
12681
- 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 }),
12687
+ React.createElement("div", null,
12688
+ 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
12689
+ // textShadow: globalConfig?.isOpenTextShadow ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none'
12690
+ ), onChange: onExpandableChange }),
12682
12691
  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 })))));
12683
12692
  }
12684
12693
  return null;