pb-sxp-ui 1.6.2 → 1.6.4

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.js CHANGED
@@ -9168,11 +9168,11 @@ var FormatImage$1 = memo(FormatImage);
9168
9168
  * @Author: binruan@chatlabs.com
9169
9169
  * @Date: 2024-03-20 10:27:32
9170
9170
  * @LastEditors: binruan@chatlabs.com
9171
- * @LastEditTime: 2024-07-30 11:46:32
9171
+ * @LastEditTime: 2024-10-17 17:05:11
9172
9172
  * @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Scroll.tsx
9173
9173
  *
9174
9174
  */
9175
- const Scroll = ({ children, isPadding = true, style, enableSlideActive = false }) => {
9175
+ const Scroll = ({ children, isPadding = true, style, enableSlideActive = false, width }) => {
9176
9176
  const ref = useRef();
9177
9177
  const { popupDetailData } = useSxpDataSource();
9178
9178
  useEffect(() => {
@@ -9180,7 +9180,7 @@ const Scroll = ({ children, isPadding = true, style, enableSlideActive = false }
9180
9180
  if (enableSlideActive)
9181
9181
  (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
9182
9182
  }, [popupDetailData, enableSlideActive]);
9183
- return (React.createElement(Swiper, { ref: ref, direction: 'horizontal', slidesPerView: 'auto', freeMode: true, mousewheel: true, modules: [freeMode, Scrollbar, Mousewheel], style: Object.assign({ padding: isPadding ? '0 12px 0 20px' : 0 }, style) }, children));
9183
+ return (React.createElement(Swiper, { ref: ref, direction: 'horizontal', slidesPerView: 'auto', freeMode: true, mousewheel: true, modules: [freeMode, Scrollbar, Mousewheel], style: Object.assign(Object.assign({ padding: isPadding ? '0 12px 0 20px' : 0 }, style), (width && { width })) }, children));
9184
9184
  };
9185
9185
  var Scroll$1 = memo(Scroll);
9186
9186
 
@@ -16046,11 +16046,11 @@ var PictureGroup$3 = memo(PictureGroup$2);
16046
16046
  * @Author: binruan@chatlabs.com
16047
16047
  * @Date: 2024-01-15 19:03:09
16048
16048
  * @LastEditors: binruan@chatlabs.com
16049
- * @LastEditTime: 2024-10-11 18:37:55
16049
+ * @LastEditTime: 2024-10-17 17:00:33
16050
16050
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Hashtag\index.tsx
16051
16051
  *
16052
16052
  */
16053
- const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle }) => {
16053
+ const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle, hashTagRightMargin }) => {
16054
16054
  var _a;
16055
16055
  const [isShowMore, setIsShowMore] = useState(false);
16056
16056
  const { setWaterFallData, setOpenHashtag, setCacheActiveIndex, waterFallData, setIsFromHashtag } = useSxpDataSource();
@@ -16083,8 +16083,10 @@ const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle }) => {
16083
16083
  }
16084
16084
  return (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer', color: '#fff' }, onClick: () => setIsShowMore(!isShowMore) }, isShowMore ? 'show less' : 'show more'));
16085
16085
  }, [isShowMore, tags]);
16086
- return (React.createElement("div", { className: 'clc-sxp-bottom-hashtag', style: { marginTop: `${(_a = hashTagStyle === null || hashTagStyle === void 0 ? void 0 : hashTagStyle.marginTop) !== null && _a !== void 0 ? _a : 16}px` } },
16087
- React.createElement(Scroll$1, null, tags === null || tags === void 0 ? void 0 : tags.map((item, index) => (React.createElement(SwiperSlide, { key: index, hidden: !isShowMore ? index >= 6 : false, className: 'clc-sxp-bottom-hashtag-item', style: hashTagStyle, onClick: () => handleClickTag(item), tag: 'button', "aria-label": item },
16086
+ return (React.createElement("div", { className: 'clc-sxp-bottom-hashtag', style: {
16087
+ marginTop: `${(_a = hashTagStyle === null || hashTagStyle === void 0 ? void 0 : hashTagStyle.marginTop) !== null && _a !== void 0 ? _a : 16}px`
16088
+ } },
16089
+ React.createElement(Scroll$1, { width: hashTagRightMargin }, tags === null || tags === void 0 ? void 0 : tags.map((item, index) => (React.createElement(SwiperSlide, { key: index, hidden: !isShowMore ? index >= 6 : false, className: 'clc-sxp-bottom-hashtag-item', style: hashTagStyle, onClick: () => handleClickTag(item), tag: 'button', "aria-label": item },
16088
16090
  React.createElement("div", { dangerouslySetInnerHTML: { __html: setFontForText(`#${item}`, hashTagStyle) } })))))));
16089
16091
  };
16090
16092
  var Hashtag$1 = memo(Hashtag);
@@ -16295,12 +16297,12 @@ var Tagbar$1 = memo(Tagbar);
16295
16297
  * @Author: binruan@chatlabs.com
16296
16298
  * @Date: 2024-01-15 19:03:09
16297
16299
  * @LastEditors: binruan@chatlabs.com
16298
- * @LastEditTime: 2024-10-12 18:38:11
16300
+ * @LastEditTime: 2024-10-17 17:16:42
16299
16301
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
16300
16302
  *
16301
16303
  */
16302
- const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
16303
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
16304
+ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, hashTagRightMargin, tagList = [], licenseUrl }) => {
16305
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
16304
16306
  const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
16305
16307
  const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
16306
16308
  const { schema } = useEditor();
@@ -16456,10 +16458,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16456
16458
  minusHeight += 56;
16457
16459
  }
16458
16460
  return minusHeight;
16459
- }, []);
16461
+ }, [globalConfig]);
16460
16462
  const height = useMemo(() => {
16461
16463
  return containerHeight - minusHeight - tagHeight;
16462
- }, [globalConfig, containerHeight, tagHeight]);
16464
+ }, [minusHeight, containerHeight, tagHeight]);
16463
16465
  const visList = useMemo(() => {
16464
16466
  var _a;
16465
16467
  const list = activeIndex === 0 && !waterFallData && !isEditor
@@ -16553,7 +16555,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16553
16555
  React.createElement("div", null,
16554
16556
  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: (_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.title) !== null && _d !== void 0 ? _d : '', 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 }),
16555
16557
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
16556
- React.createElement(Hashtag$1, { index: activeIndex, tags: (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.hashTags) !== null && _f !== void 0 ? _f : [], itemId: (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.itemId, itemType: ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))),
16558
+ React.createElement(Hashtag$1, { index: activeIndex, tags: (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.hashTags) !== null && _f !== void 0 ? _f : [], itemId: (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.itemId, itemType: ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
16557
16559
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
16558
16560
  }
16559
16561
  return null;
@@ -16796,14 +16798,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16796
16798
  ((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && (React.createElement("button", { style: {
16797
16799
  position: 'absolute',
16798
16800
  [(_h = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _g === void 0 ? void 0 : _g.xPosit) !== null && _h !== void 0 ? _h : 'left']: (_k = (_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _j === void 0 ? void 0 : _j.x) !== null && _k !== void 0 ? _k : 0,
16799
- [(_m = (_l = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _l === void 0 ? void 0 : _l.yPosit) !== null && _m !== void 0 ? _m : 'top']: (_p = (_o = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _o === void 0 ? void 0 : _o.y) !== null && _p !== void 0 ? _p : 0,
16801
+ [(_m = (_l = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _l === void 0 ? void 0 : _l.yPosit) !== null && _m !== void 0 ? _m : 'top']: (((_o = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _o === void 0 ? void 0 : _o.yPosit) == 'top' ? minusHeight + tagHeight : 0) +
16802
+ ((_q = (_p = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _p === void 0 ? void 0 : _p.y) !== null && _q !== void 0 ? _q : 0),
16800
16803
  zIndex: 8,
16801
16804
  border: 'none',
16802
16805
  padding: 0,
16803
16806
  background: 'transparent'
16804
16807
  }, role: 'button', "aria-label": 'back button', onClick: () => history === null || history === void 0 ? void 0 : history.back() },
16805
- React.createElement("img", { src: (_r = (_q = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _q === void 0 ? void 0 : _q.icon) !== null && _r !== void 0 ? _r : img, alt: 'back button', width: 50, style: { objectFit: 'cover' } }))),
16806
- isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _s !== void 0 ? _s : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
16808
+ React.createElement("img", { src: (_s = (_r = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _r === void 0 ? void 0 : _r.icon) !== null && _s !== void 0 ? _s : img, alt: 'back button', width: 100, style: { objectFit: 'cover' } }))),
16809
+ isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _t !== void 0 ? _t : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
16807
16810
  React.createElement(Swiper, { style: {
16808
16811
  marginTop: tagHeight
16809
16812
  }, ref: swiperRef, onSlideChange: () => {
@@ -16835,7 +16838,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16835
16838
  renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
16836
16839
  renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
16837
16840
  renderView),
16838
- React.createElement(WaterFall$1, Object.assign({}, (_v = (_u = (_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _t === void 0 ? void 0 : _t[0]) === null || _u === void 0 ? void 0 : _u.item) === null || _v === void 0 ? void 0 : _v.props))));
16841
+ React.createElement(WaterFall$1, Object.assign({}, (_w = (_v = (_u = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _u === void 0 ? void 0 : _u[0]) === null || _v === void 0 ? void 0 : _v.item) === null || _w === void 0 ? void 0 : _w.props))));
16839
16842
  };
16840
16843
 
16841
16844
  const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {