pb-sxp-ui 1.2.3 → 1.2.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
@@ -8583,7 +8583,7 @@ SwiperSlide.displayName = 'SwiperSlide';
8583
8583
  * @Author: binruan@chatlabs.com
8584
8584
  * @Date: 2023-11-02 18:34:34
8585
8585
  * @LastEditors: binruan@chatlabs.com
8586
- * @LastEditTime: 2024-07-19 18:39:54
8586
+ * @LastEditTime: 2024-07-25 17:05:20
8587
8587
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
8588
8588
  *
8589
8589
  */
@@ -8639,19 +8639,25 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
8639
8639
  onClose === null || onClose === void 0 ? void 0 : onClose();
8640
8640
  }, 300);
8641
8641
  const handleTouchStart = (event) => {
8642
- event.stopPropagation();
8643
- touchRef.current = event.touches[0].clientY;
8644
- fTouchRef.current = event.touches[0].clientY;
8642
+ // event.stopPropagation();
8643
+ touchRef.current = event.touches[0];
8644
+ fTouchRef.current = event.touches[0];
8645
8645
  touchMoveRef.current = true;
8646
8646
  };
8647
8647
  const handleTouchMove = (event) => {
8648
- event.stopPropagation();
8648
+ // event.stopPropagation();
8649
8649
  requestAnimationFrame(() => {
8650
8650
  var _a;
8651
8651
  if (touchMoveRef.current && ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.scrollTop) === 0) {
8652
8652
  const currentY = event.touches[0].clientY;
8653
- const diff = touchRef.current - currentY;
8654
- touchRef.current = currentY;
8653
+ const currentX = event.touches[0].clientX;
8654
+ const diff = touchRef.current.clientY - currentY;
8655
+ touchRef.current = event.touches[0];
8656
+ const diffY = currentY - fTouchRef.current.clientY;
8657
+ const diffX = currentX - fTouchRef.current.clientX;
8658
+ if (Math.abs(diffX) > Math.abs(diffY)) {
8659
+ return;
8660
+ }
8655
8661
  const ts = modalTrans - diff;
8656
8662
  if (ts > 0) {
8657
8663
  setModalTrans(ts);
@@ -8661,9 +8667,14 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
8661
8667
  };
8662
8668
  const handleTouchEnd = (event) => {
8663
8669
  var _a;
8664
- event.stopPropagation();
8670
+ // event.stopPropagation();
8665
8671
  if (touchMoveRef.current && ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.scrollTop) === 0) {
8666
- const diff = fTouchRef.current - touchRef.current;
8672
+ const diffY = event.changedTouches[0].clientY - fTouchRef.current.clientY;
8673
+ const diffX = event.changedTouches[0].clientX - fTouchRef.current.clientX;
8674
+ if (Math.abs(diffX) > Math.abs(diffY)) {
8675
+ return;
8676
+ }
8677
+ const diff = fTouchRef.current.clientY - touchRef.current.clientY;
8667
8678
  if (diff > 0) {
8668
8679
  setModalTrans(0);
8669
8680
  }
@@ -13975,6 +13986,9 @@ const AniLink$1 = (_a) => {
13975
13986
  if (isOnScreen) {
13976
13987
  setVisible(true);
13977
13988
  }
13989
+ else {
13990
+ setVisible(false);
13991
+ }
13978
13992
  }, [isOnScreen]);
13979
13993
  const aniNamStyle = useMemo(() => {
13980
13994
  if (!visible)
@@ -14092,7 +14106,7 @@ const AniLink = createMaterial(AniLinkComponent, {
14092
14106
  * @Author: binruan@chatlabs.com
14093
14107
  * @Date: 2024-03-26 16:50:25
14094
14108
  * @LastEditors: binruan@chatlabs.com
14095
- * @LastEditTime: 2024-07-08 11:01:24
14109
+ * @LastEditTime: 2024-07-25 15:02:45
14096
14110
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLinkPopup\settingRender.tsx
14097
14111
  *
14098
14112
  */
@@ -14294,7 +14308,7 @@ var settingRender = [
14294
14308
  },
14295
14309
  {
14296
14310
  type: 'TextSpace',
14297
- name: ['props', 'ctaTempStyles', 'title']
14311
+ name: ['props', 'ctaTempStyles', 'ctaTitle']
14298
14312
  },
14299
14313
  {
14300
14314
  type: 'Color',
@@ -14400,6 +14414,9 @@ const AniLinkPopup$1 = (_a) => {
14400
14414
  if (isOnScreen) {
14401
14415
  setVisible(true);
14402
14416
  }
14417
+ else {
14418
+ setVisible(false);
14419
+ }
14403
14420
  }, [isOnScreen]);
14404
14421
  const aniNamStyle = useMemo(() => {
14405
14422
  if (!visible)
@@ -14410,16 +14427,16 @@ const AniLinkPopup$1 = (_a) => {
14410
14427
  height: '40px',
14411
14428
  lineHeight: '40px',
14412
14429
  paddingLeft: '6px'
14413
- } }, "Cta Title")) : (React.createElement("div", Object.assign({ ref: ref }, props, { className: `${css(Object.assign(Object.assign({}, style), { '--transY': `translateY(calc(100% + ${(_r = style === null || style === void 0 ? void 0 : style.margin) !== null && _r !== void 0 ? _r : 0}px))` }))} ${styles['aniLinkPopup']} ${aniNamStyle} ${css(aniTimStyle)}`, onClick: handleTo }),
14430
+ } }, "Cta Title")) : (React.createElement(React.Fragment, null, aniNamStyle ? (React.createElement("div", Object.assign({ ref: ref }, props, { className: `${css(Object.assign(Object.assign({}, style), { '--transY': `translateY(calc(100% + ${(_r = style === null || style === void 0 ? void 0 : style.margin) !== null && _r !== void 0 ? _r : 0}px))` }))} ${styles['aniLinkPopup']} ${aniNamStyle} ${css(aniTimStyle)}`, onClick: handleTo }),
14414
14431
  React.createElement("div", { onClick: onClose, className: styles['modal-icon-wrapper'], style: { padding: (_s = style === null || style === void 0 ? void 0 : style['padding']) !== null && _s !== void 0 ? _s : 0 } },
14415
14432
  React.createElement("img", { src: (_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _t !== void 0 ? _t : closeIcon, alt: 'close', className: styles['modal-icon-wrapper-img'] })),
14416
14433
  React.createElement(Img$1, { src: src, rec: recData, item: (_y = (_w = (_v = (_u = recData === null || recData === void 0 ? void 0 : recData.video) === null || _u === void 0 ? void 0 : _u.bindProducts) === null || _v === void 0 ? void 0 : _v[0]) !== null && _w !== void 0 ? _w : (_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.bindProduct) !== null && _y !== void 0 ? _y : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
14417
- React.createElement("div", { hidden: !!recData && !(product === null || product === void 0 ? void 0 : product.title), className: styles['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
14434
+ (!recData || (product === null || product === void 0 ? void 0 : product.title)) && (React.createElement("div", { className: styles['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
14418
14435
  __html: setFontForText((_z = product === null || product === void 0 ? void 0 : product.title) !== null && _z !== void 0 ? _z : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
14419
- } }),
14436
+ } })),
14420
14437
  React.createElement("div", { className: styles['one-line-ellipsis'], style: Object.assign(Object.assign({}, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle), { lineHeight: ((_0 = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _0 === void 0 ? void 0 : _0.height) + 'px' }), dangerouslySetInnerHTML: {
14421
14438
  __html: setFontForText(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
14422
- } })))));
14439
+ } }))) : (React.createElement("div", { ref: ref, style: { position: 'absolute', height: '50px', width: '50px', bottom: 0, right: 0, zIndex: 1000 } }))))));
14423
14440
  };
14424
14441
  var AniLinkPopupComponent = memo(AniLinkPopup$1);
14425
14442
 
@@ -15145,7 +15162,7 @@ var PictureGroup$3 = memo(PictureGroup$2);
15145
15162
  * @Author: binruan@chatlabs.com
15146
15163
  * @Date: 2024-01-15 19:03:09
15147
15164
  * @LastEditors: binruan@chatlabs.com
15148
- * @LastEditTime: 2024-07-09 18:47:05
15165
+ * @LastEditTime: 2024-07-25 18:14:29
15149
15166
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Hashtag\index.tsx
15150
15167
  *
15151
15168
  */
@@ -15182,7 +15199,6 @@ const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle }) => {
15182
15199
  }
15183
15200
  return (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer', color: '#fff' }, onClick: () => setIsShowMore(!isShowMore) }, isShowMore ? 'show less' : 'show more'));
15184
15201
  }, [isShowMore, tags]);
15185
- console.log(hashTagStyle, '111');
15186
15202
  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` } },
15187
15203
  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) },
15188
15204
  React.createElement("div", { dangerouslySetInnerHTML: { __html: setFontForText(`#${item}`, hashTagStyle) } })))))));
@@ -15253,27 +15269,35 @@ function withBindDataSource(Component) {
15253
15269
  * @Author: binruan@chatlabs.com
15254
15270
  * @Date: 2023-12-26 16:11:34
15255
15271
  * @LastEditors: binruan@chatlabs.com
15256
- * @LastEditTime: 2024-07-17 18:54:33
15272
+ * @LastEditTime: 2024-07-25 18:47:37
15257
15273
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
15258
15274
  *
15259
15275
  */
15260
15276
  const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
15277
+ var _a, _b, _c, _d, _e;
15261
15278
  const { schema } = useEditor();
15279
+ if (!(rec === null || rec === void 0 ? void 0 : rec.video))
15280
+ return null;
15281
+ let cta = null;
15282
+ if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
15283
+ cta = '多商品CTA';
15284
+ }
15285
+ else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
15286
+ cta = '商品CTA';
15287
+ }
15288
+ else {
15289
+ cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
15290
+ }
15291
+ const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
15262
15292
  const renderComp = useMemo(() => {
15263
15293
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
15264
15294
  if (!(rec === null || rec === void 0 ? void 0 : rec.video))
15265
15295
  return null;
15266
- let cta = null;
15267
- if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
15268
- cta = '多商品CTA';
15269
- }
15270
- else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
15271
- cta = '商品CTA';
15272
- }
15296
+ if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) ;
15297
+ else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) ;
15273
15298
  else {
15274
- cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
15299
+ (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
15275
15300
  }
15276
- const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
15277
15301
  //如果includesCtaType有值,则只渲染includesCtaType包含的cta类型组件,用于在页面某处只显示某一组件
15278
15302
  if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.type)))
15279
15303
  return;
@@ -15299,7 +15323,7 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
15299
15323
  else {
15300
15324
  return null;
15301
15325
  }
15302
- }, [rec, resolver, tempMap, schema]);
15326
+ }, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id]);
15303
15327
  return React.createElement(React.Fragment, null, renderComp);
15304
15328
  };
15305
15329
  var RenderCard$1 = memo(RenderCard);
@@ -15387,7 +15411,7 @@ var Tagbar$1 = memo(Tagbar);
15387
15411
  * @Author: binruan@chatlabs.com
15388
15412
  * @Date: 2024-01-15 19:03:09
15389
15413
  * @LastEditors: binruan@chatlabs.com
15390
- * @LastEditTime: 2024-07-24 14:59:23
15414
+ * @LastEditTime: 2024-07-25 17:10:01
15391
15415
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
15392
15416
  *
15393
15417
  */
@@ -15664,7 +15688,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
15664
15688
  return;
15665
15689
  const t = new Date() - curTime.current;
15666
15690
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.openSlideSkip) && t >= ((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.slideSkipStartTime) !== null && _a !== void 0 ? _a : 0) && getSlideSkipState() && item) {
15667
- const link = ((_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.bindProduct) === null || _c === void 0 ? void 0 : _c.link) || ((_f = (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.bindProducts) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.link) || ((_g = item === null || item === void 0 ? void 0 : item.product) === null || _g === void 0 ? void 0 : _g.link);
15691
+ const link = ((_d = (_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.link) || ((_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.link) || ((_g = item === null || item === void 0 ? void 0 : item.product) === null || _g === void 0 ? void 0 : _g.link);
15668
15692
  const product = (item === null || item === void 0 ? void 0 : item.product) || ((_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct) || ((_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]);
15669
15693
  if (link) {
15670
15694
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
@@ -16209,7 +16233,7 @@ var index$1 = memo(DiyPortalPreview);
16209
16233
  * @Author: binruan@chatlabs.com
16210
16234
  * @Date: 2023-10-31 10:56:01
16211
16235
  * @LastEditors: binruan@chatlabs.com
16212
- * @LastEditTime: 2024-07-19 18:06:14
16236
+ * @LastEditTime: 2024-07-25 17:15:36
16213
16237
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
16214
16238
  *
16215
16239
  */
@@ -16262,7 +16286,7 @@ const Popup = () => {
16262
16286
  const isExternalLink = ((_d = (_c = (_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.event) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.linkType) === 'externalLink';
16263
16287
  const isPopup = ((_g = (_f = (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.event) === null || _f === void 0 ? void 0 : _f.onClick) === null || _g === void 0 ? void 0 : _g.linkType) === 'popup';
16264
16288
  const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
16265
- return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: (_k = window.innerWidth) !== null && _k !== void 0 ? _k : '100vw' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.textStyle), bindDatas: (_o = (_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.bindDatas) !== null && _o !== void 0 ? _o : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.props, { event: ((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose })));
16289
+ return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: (_k = window.innerWidth) !== null && _k !== void 0 ? _k : '100vw', height: '100%' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.textStyle), bindDatas: (_o = (_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.bindDatas) !== null && _o !== void 0 ? _o : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.props, { event: ((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose })));
16266
16290
  }
16267
16291
  else {
16268
16292
  return React.createElement(React.Fragment, null);