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.cjs CHANGED
@@ -8605,7 +8605,7 @@ SwiperSlide.displayName = 'SwiperSlide';
8605
8605
  * @Author: binruan@chatlabs.com
8606
8606
  * @Date: 2023-11-02 18:34:34
8607
8607
  * @LastEditors: binruan@chatlabs.com
8608
- * @LastEditTime: 2024-07-19 18:39:54
8608
+ * @LastEditTime: 2024-07-25 17:05:20
8609
8609
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
8610
8610
  *
8611
8611
  */
@@ -8661,19 +8661,25 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
8661
8661
  onClose === null || onClose === void 0 ? void 0 : onClose();
8662
8662
  }, 300);
8663
8663
  const handleTouchStart = (event) => {
8664
- event.stopPropagation();
8665
- touchRef.current = event.touches[0].clientY;
8666
- fTouchRef.current = event.touches[0].clientY;
8664
+ // event.stopPropagation();
8665
+ touchRef.current = event.touches[0];
8666
+ fTouchRef.current = event.touches[0];
8667
8667
  touchMoveRef.current = true;
8668
8668
  };
8669
8669
  const handleTouchMove = (event) => {
8670
- event.stopPropagation();
8670
+ // event.stopPropagation();
8671
8671
  requestAnimationFrame(() => {
8672
8672
  var _a;
8673
8673
  if (touchMoveRef.current && ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.scrollTop) === 0) {
8674
8674
  const currentY = event.touches[0].clientY;
8675
- const diff = touchRef.current - currentY;
8676
- touchRef.current = currentY;
8675
+ const currentX = event.touches[0].clientX;
8676
+ const diff = touchRef.current.clientY - currentY;
8677
+ touchRef.current = event.touches[0];
8678
+ const diffY = currentY - fTouchRef.current.clientY;
8679
+ const diffX = currentX - fTouchRef.current.clientX;
8680
+ if (Math.abs(diffX) > Math.abs(diffY)) {
8681
+ return;
8682
+ }
8677
8683
  const ts = modalTrans - diff;
8678
8684
  if (ts > 0) {
8679
8685
  setModalTrans(ts);
@@ -8683,9 +8689,14 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
8683
8689
  };
8684
8690
  const handleTouchEnd = (event) => {
8685
8691
  var _a;
8686
- event.stopPropagation();
8692
+ // event.stopPropagation();
8687
8693
  if (touchMoveRef.current && ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.scrollTop) === 0) {
8688
- const diff = fTouchRef.current - touchRef.current;
8694
+ const diffY = event.changedTouches[0].clientY - fTouchRef.current.clientY;
8695
+ const diffX = event.changedTouches[0].clientX - fTouchRef.current.clientX;
8696
+ if (Math.abs(diffX) > Math.abs(diffY)) {
8697
+ return;
8698
+ }
8699
+ const diff = fTouchRef.current.clientY - touchRef.current.clientY;
8689
8700
  if (diff > 0) {
8690
8701
  setModalTrans(0);
8691
8702
  }
@@ -13997,6 +14008,9 @@ const AniLink$1 = (_a) => {
13997
14008
  if (isOnScreen) {
13998
14009
  setVisible(true);
13999
14010
  }
14011
+ else {
14012
+ setVisible(false);
14013
+ }
14000
14014
  }, [isOnScreen]);
14001
14015
  const aniNamStyle = React.useMemo(() => {
14002
14016
  if (!visible)
@@ -14114,7 +14128,7 @@ const AniLink = createMaterial(AniLinkComponent, {
14114
14128
  * @Author: binruan@chatlabs.com
14115
14129
  * @Date: 2024-03-26 16:50:25
14116
14130
  * @LastEditors: binruan@chatlabs.com
14117
- * @LastEditTime: 2024-07-08 11:01:24
14131
+ * @LastEditTime: 2024-07-25 15:02:45
14118
14132
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLinkPopup\settingRender.tsx
14119
14133
  *
14120
14134
  */
@@ -14316,7 +14330,7 @@ var settingRender = [
14316
14330
  },
14317
14331
  {
14318
14332
  type: 'TextSpace',
14319
- name: ['props', 'ctaTempStyles', 'title']
14333
+ name: ['props', 'ctaTempStyles', 'ctaTitle']
14320
14334
  },
14321
14335
  {
14322
14336
  type: 'Color',
@@ -14422,6 +14436,9 @@ const AniLinkPopup$1 = (_a) => {
14422
14436
  if (isOnScreen) {
14423
14437
  setVisible(true);
14424
14438
  }
14439
+ else {
14440
+ setVisible(false);
14441
+ }
14425
14442
  }, [isOnScreen]);
14426
14443
  const aniNamStyle = React.useMemo(() => {
14427
14444
  if (!visible)
@@ -14432,16 +14449,16 @@ const AniLinkPopup$1 = (_a) => {
14432
14449
  height: '40px',
14433
14450
  lineHeight: '40px',
14434
14451
  paddingLeft: '6px'
14435
- } }, "Cta Title")) : (React.createElement("div", Object.assign({ ref: ref }, props, { className: `${css.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.css(aniTimStyle)}`, onClick: handleTo }),
14452
+ } }, "Cta Title")) : (React.createElement(React.Fragment, null, aniNamStyle ? (React.createElement("div", Object.assign({ ref: ref }, props, { className: `${css.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.css(aniTimStyle)}`, onClick: handleTo }),
14436
14453
  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 } },
14437
14454
  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'] })),
14438
14455
  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 }),
14439
- 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: {
14456
+ (!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: {
14440
14457
  __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)
14441
- } }),
14458
+ } })),
14442
14459
  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: {
14443
14460
  __html: setFontForText(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
14444
- } })))));
14461
+ } }))) : (React.createElement("div", { ref: ref, style: { position: 'absolute', height: '50px', width: '50px', bottom: 0, right: 0, zIndex: 1000 } }))))));
14445
14462
  };
14446
14463
  var AniLinkPopupComponent = React.memo(AniLinkPopup$1);
14447
14464
 
@@ -15167,7 +15184,7 @@ var PictureGroup$3 = React.memo(PictureGroup$2);
15167
15184
  * @Author: binruan@chatlabs.com
15168
15185
  * @Date: 2024-01-15 19:03:09
15169
15186
  * @LastEditors: binruan@chatlabs.com
15170
- * @LastEditTime: 2024-07-09 18:47:05
15187
+ * @LastEditTime: 2024-07-25 18:14:29
15171
15188
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Hashtag\index.tsx
15172
15189
  *
15173
15190
  */
@@ -15204,7 +15221,6 @@ const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle }) => {
15204
15221
  }
15205
15222
  return (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer', color: '#fff' }, onClick: () => setIsShowMore(!isShowMore) }, isShowMore ? 'show less' : 'show more'));
15206
15223
  }, [isShowMore, tags]);
15207
- console.log(hashTagStyle, '111');
15208
15224
  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` } },
15209
15225
  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) },
15210
15226
  React.createElement("div", { dangerouslySetInnerHTML: { __html: setFontForText(`#${item}`, hashTagStyle) } })))))));
@@ -15275,27 +15291,35 @@ function withBindDataSource(Component) {
15275
15291
  * @Author: binruan@chatlabs.com
15276
15292
  * @Date: 2023-12-26 16:11:34
15277
15293
  * @LastEditors: binruan@chatlabs.com
15278
- * @LastEditTime: 2024-07-17 18:54:33
15294
+ * @LastEditTime: 2024-07-25 18:47:37
15279
15295
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
15280
15296
  *
15281
15297
  */
15282
15298
  const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
15299
+ var _a, _b, _c, _d, _e;
15283
15300
  const { schema } = useEditor();
15301
+ if (!(rec === null || rec === void 0 ? void 0 : rec.video))
15302
+ return null;
15303
+ let cta = null;
15304
+ 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) {
15305
+ cta = '多商品CTA';
15306
+ }
15307
+ else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
15308
+ cta = '商品CTA';
15309
+ }
15310
+ else {
15311
+ 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;
15312
+ }
15313
+ const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
15284
15314
  const renderComp = React.useMemo(() => {
15285
15315
  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;
15286
15316
  if (!(rec === null || rec === void 0 ? void 0 : rec.video))
15287
15317
  return null;
15288
- let cta = null;
15289
- 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) {
15290
- cta = '多商品CTA';
15291
- }
15292
- else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
15293
- cta = '商品CTA';
15294
- }
15318
+ 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) ;
15319
+ else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) ;
15295
15320
  else {
15296
- 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;
15321
+ (_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;
15297
15322
  }
15298
- const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
15299
15323
  //如果includesCtaType有值,则只渲染includesCtaType包含的cta类型组件,用于在页面某处只显示某一组件
15300
15324
  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)))
15301
15325
  return;
@@ -15321,7 +15345,7 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
15321
15345
  else {
15322
15346
  return null;
15323
15347
  }
15324
- }, [rec, resolver, tempMap, schema]);
15348
+ }, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id]);
15325
15349
  return React.createElement(React.Fragment, null, renderComp);
15326
15350
  };
15327
15351
  var RenderCard$1 = React.memo(RenderCard);
@@ -15409,7 +15433,7 @@ var Tagbar$1 = React.memo(Tagbar);
15409
15433
  * @Author: binruan@chatlabs.com
15410
15434
  * @Date: 2024-01-15 19:03:09
15411
15435
  * @LastEditors: binruan@chatlabs.com
15412
- * @LastEditTime: 2024-07-24 14:59:23
15436
+ * @LastEditTime: 2024-07-25 17:10:01
15413
15437
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
15414
15438
  *
15415
15439
  */
@@ -15686,7 +15710,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
15686
15710
  return;
15687
15711
  const t = new Date() - curTime.current;
15688
15712
  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) {
15689
- 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);
15713
+ 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);
15690
15714
  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]);
15691
15715
  if (link) {
15692
15716
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
@@ -16231,7 +16255,7 @@ var index$1 = React.memo(DiyPortalPreview);
16231
16255
  * @Author: binruan@chatlabs.com
16232
16256
  * @Date: 2023-10-31 10:56:01
16233
16257
  * @LastEditors: binruan@chatlabs.com
16234
- * @LastEditTime: 2024-07-19 18:06:14
16258
+ * @LastEditTime: 2024-07-25 17:15:36
16235
16259
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
16236
16260
  *
16237
16261
  */
@@ -16284,7 +16308,7 @@ const Popup = () => {
16284
16308
  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';
16285
16309
  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';
16286
16310
  const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
16287
- 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 })));
16311
+ 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 })));
16288
16312
  }
16289
16313
  else {
16290
16314
  return React.createElement(React.Fragment, null);