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.cjs CHANGED
@@ -9190,11 +9190,11 @@ var FormatImage$1 = React.memo(FormatImage);
9190
9190
  * @Author: binruan@chatlabs.com
9191
9191
  * @Date: 2024-03-20 10:27:32
9192
9192
  * @LastEditors: binruan@chatlabs.com
9193
- * @LastEditTime: 2024-07-30 11:46:32
9193
+ * @LastEditTime: 2024-10-17 17:05:11
9194
9194
  * @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Scroll.tsx
9195
9195
  *
9196
9196
  */
9197
- const Scroll = ({ children, isPadding = true, style, enableSlideActive = false }) => {
9197
+ const Scroll = ({ children, isPadding = true, style, enableSlideActive = false, width }) => {
9198
9198
  const ref = React.useRef();
9199
9199
  const { popupDetailData } = useSxpDataSource();
9200
9200
  React.useEffect(() => {
@@ -9202,7 +9202,7 @@ const Scroll = ({ children, isPadding = true, style, enableSlideActive = false }
9202
9202
  if (enableSlideActive)
9203
9203
  (_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);
9204
9204
  }, [popupDetailData, enableSlideActive]);
9205
- 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));
9205
+ 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));
9206
9206
  };
9207
9207
  var Scroll$1 = React.memo(Scroll);
9208
9208
 
@@ -16068,11 +16068,11 @@ var PictureGroup$3 = React.memo(PictureGroup$2);
16068
16068
  * @Author: binruan@chatlabs.com
16069
16069
  * @Date: 2024-01-15 19:03:09
16070
16070
  * @LastEditors: binruan@chatlabs.com
16071
- * @LastEditTime: 2024-10-11 18:37:55
16071
+ * @LastEditTime: 2024-10-17 17:00:33
16072
16072
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Hashtag\index.tsx
16073
16073
  *
16074
16074
  */
16075
- const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle }) => {
16075
+ const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle, hashTagRightMargin }) => {
16076
16076
  var _a;
16077
16077
  const [isShowMore, setIsShowMore] = React.useState(false);
16078
16078
  const { setWaterFallData, setOpenHashtag, setCacheActiveIndex, waterFallData, setIsFromHashtag } = useSxpDataSource();
@@ -16105,8 +16105,10 @@ const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle }) => {
16105
16105
  }
16106
16106
  return (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer', color: '#fff' }, onClick: () => setIsShowMore(!isShowMore) }, isShowMore ? 'show less' : 'show more'));
16107
16107
  }, [isShowMore, tags]);
16108
- 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` } },
16109
- 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 },
16108
+ return (React.createElement("div", { className: 'clc-sxp-bottom-hashtag', style: {
16109
+ marginTop: `${(_a = hashTagStyle === null || hashTagStyle === void 0 ? void 0 : hashTagStyle.marginTop) !== null && _a !== void 0 ? _a : 16}px`
16110
+ } },
16111
+ 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 },
16110
16112
  React.createElement("div", { dangerouslySetInnerHTML: { __html: setFontForText(`#${item}`, hashTagStyle) } })))))));
16111
16113
  };
16112
16114
  var Hashtag$1 = React.memo(Hashtag);
@@ -16317,12 +16319,12 @@ var Tagbar$1 = React.memo(Tagbar);
16317
16319
  * @Author: binruan@chatlabs.com
16318
16320
  * @Date: 2024-01-15 19:03:09
16319
16321
  * @LastEditors: binruan@chatlabs.com
16320
- * @LastEditTime: 2024-10-12 18:38:11
16322
+ * @LastEditTime: 2024-10-17 17:16:42
16321
16323
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
16322
16324
  *
16323
16325
  */
16324
- const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
16325
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
16326
+ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, hashTagRightMargin, tagList = [], licenseUrl }) => {
16327
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
16326
16328
  const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
16327
16329
  const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
16328
16330
  const { schema } = useEditor();
@@ -16478,10 +16480,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16478
16480
  minusHeight += 56;
16479
16481
  }
16480
16482
  return minusHeight;
16481
- }, []);
16483
+ }, [globalConfig]);
16482
16484
  const height = React.useMemo(() => {
16483
16485
  return containerHeight - minusHeight - tagHeight;
16484
- }, [globalConfig, containerHeight, tagHeight]);
16486
+ }, [minusHeight, containerHeight, tagHeight]);
16485
16487
  const visList = React.useMemo(() => {
16486
16488
  var _a;
16487
16489
  const list = activeIndex === 0 && !waterFallData && !isEditor
@@ -16575,7 +16577,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16575
16577
  React.createElement("div", null,
16576
16578
  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 }),
16577
16579
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
16578
- 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 }))),
16580
+ 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) }))),
16579
16581
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
16580
16582
  }
16581
16583
  return null;
@@ -16818,14 +16820,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16818
16820
  ((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && (React.createElement("button", { style: {
16819
16821
  position: 'absolute',
16820
16822
  [(_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,
16821
- [(_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,
16823
+ [(_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) +
16824
+ ((_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),
16822
16825
  zIndex: 8,
16823
16826
  border: 'none',
16824
16827
  padding: 0,
16825
16828
  background: 'transparent'
16826
16829
  }, role: 'button', "aria-label": 'back button', onClick: () => history === null || history === void 0 ? void 0 : history.back() },
16827
- 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' } }))),
16828
- 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,
16830
+ 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' } }))),
16831
+ 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,
16829
16832
  React.createElement(Swiper, { style: {
16830
16833
  marginTop: tagHeight
16831
16834
  }, ref: swiperRef, onSlideChange: () => {
@@ -16857,7 +16860,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16857
16860
  renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
16858
16861
  renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
16859
16862
  renderView),
16860
- 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))));
16863
+ 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))));
16861
16864
  };
16862
16865
 
16863
16866
  const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {