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/pb-ui.js CHANGED
@@ -8598,7 +8598,7 @@
8598
8598
  * @Author: binruan@chatlabs.com
8599
8599
  * @Date: 2023-11-02 18:34:34
8600
8600
  * @LastEditors: binruan@chatlabs.com
8601
- * @LastEditTime: 2024-07-19 18:39:54
8601
+ * @LastEditTime: 2024-07-25 17:05:20
8602
8602
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
8603
8603
  *
8604
8604
  */
@@ -8654,19 +8654,25 @@
8654
8654
  onClose === null || onClose === void 0 ? void 0 : onClose();
8655
8655
  }, 300);
8656
8656
  const handleTouchStart = (event) => {
8657
- event.stopPropagation();
8658
- touchRef.current = event.touches[0].clientY;
8659
- fTouchRef.current = event.touches[0].clientY;
8657
+ // event.stopPropagation();
8658
+ touchRef.current = event.touches[0];
8659
+ fTouchRef.current = event.touches[0];
8660
8660
  touchMoveRef.current = true;
8661
8661
  };
8662
8662
  const handleTouchMove = (event) => {
8663
- event.stopPropagation();
8663
+ // event.stopPropagation();
8664
8664
  requestAnimationFrame(() => {
8665
8665
  var _a;
8666
8666
  if (touchMoveRef.current && ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.scrollTop) === 0) {
8667
8667
  const currentY = event.touches[0].clientY;
8668
- const diff = touchRef.current - currentY;
8669
- touchRef.current = currentY;
8668
+ const currentX = event.touches[0].clientX;
8669
+ const diff = touchRef.current.clientY - currentY;
8670
+ touchRef.current = event.touches[0];
8671
+ const diffY = currentY - fTouchRef.current.clientY;
8672
+ const diffX = currentX - fTouchRef.current.clientX;
8673
+ if (Math.abs(diffX) > Math.abs(diffY)) {
8674
+ return;
8675
+ }
8670
8676
  const ts = modalTrans - diff;
8671
8677
  if (ts > 0) {
8672
8678
  setModalTrans(ts);
@@ -8676,9 +8682,14 @@
8676
8682
  };
8677
8683
  const handleTouchEnd = (event) => {
8678
8684
  var _a;
8679
- event.stopPropagation();
8685
+ // event.stopPropagation();
8680
8686
  if (touchMoveRef.current && ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.scrollTop) === 0) {
8681
- const diff = fTouchRef.current - touchRef.current;
8687
+ const diffY = event.changedTouches[0].clientY - fTouchRef.current.clientY;
8688
+ const diffX = event.changedTouches[0].clientX - fTouchRef.current.clientX;
8689
+ if (Math.abs(diffX) > Math.abs(diffY)) {
8690
+ return;
8691
+ }
8692
+ const diff = fTouchRef.current.clientY - touchRef.current.clientY;
8682
8693
  if (diff > 0) {
8683
8694
  setModalTrans(0);
8684
8695
  }
@@ -13990,6 +14001,9 @@ Made in Italy` })));
13990
14001
  if (isOnScreen) {
13991
14002
  setVisible(true);
13992
14003
  }
14004
+ else {
14005
+ setVisible(false);
14006
+ }
13993
14007
  }, [isOnScreen]);
13994
14008
  const aniNamStyle = React.useMemo(() => {
13995
14009
  if (!visible)
@@ -14107,7 +14121,7 @@ Made in Italy` })));
14107
14121
  * @Author: binruan@chatlabs.com
14108
14122
  * @Date: 2024-03-26 16:50:25
14109
14123
  * @LastEditors: binruan@chatlabs.com
14110
- * @LastEditTime: 2024-07-08 11:01:24
14124
+ * @LastEditTime: 2024-07-25 15:02:45
14111
14125
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLinkPopup\settingRender.tsx
14112
14126
  *
14113
14127
  */
@@ -14309,7 +14323,7 @@ Made in Italy` })));
14309
14323
  },
14310
14324
  {
14311
14325
  type: 'TextSpace',
14312
- name: ['props', 'ctaTempStyles', 'title']
14326
+ name: ['props', 'ctaTempStyles', 'ctaTitle']
14313
14327
  },
14314
14328
  {
14315
14329
  type: 'Color',
@@ -14415,6 +14429,9 @@ Made in Italy` })));
14415
14429
  if (isOnScreen) {
14416
14430
  setVisible(true);
14417
14431
  }
14432
+ else {
14433
+ setVisible(false);
14434
+ }
14418
14435
  }, [isOnScreen]);
14419
14436
  const aniNamStyle = React.useMemo(() => {
14420
14437
  if (!visible)
@@ -14425,16 +14442,16 @@ Made in Italy` })));
14425
14442
  height: '40px',
14426
14443
  lineHeight: '40px',
14427
14444
  paddingLeft: '6px'
14428
- } }, "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 }),
14445
+ } }, "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 }),
14429
14446
  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 } },
14430
14447
  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'] })),
14431
14448
  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 }),
14432
- 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: {
14449
+ (!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: {
14433
14450
  __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)
14434
- } }),
14451
+ } })),
14435
14452
  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: {
14436
14453
  __html: setFontForText(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
14437
- } })))));
14454
+ } }))) : (React.createElement("div", { ref: ref, style: { position: 'absolute', height: '50px', width: '50px', bottom: 0, right: 0, zIndex: 1000 } }))))));
14438
14455
  };
14439
14456
  var AniLinkPopupComponent = React.memo(AniLinkPopup$1);
14440
14457
 
@@ -15160,7 +15177,7 @@ Made in Italy` })));
15160
15177
  * @Author: binruan@chatlabs.com
15161
15178
  * @Date: 2024-01-15 19:03:09
15162
15179
  * @LastEditors: binruan@chatlabs.com
15163
- * @LastEditTime: 2024-07-09 18:47:05
15180
+ * @LastEditTime: 2024-07-25 18:14:29
15164
15181
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Hashtag\index.tsx
15165
15182
  *
15166
15183
  */
@@ -15197,7 +15214,6 @@ Made in Italy` })));
15197
15214
  }
15198
15215
  return (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer', color: '#fff' }, onClick: () => setIsShowMore(!isShowMore) }, isShowMore ? 'show less' : 'show more'));
15199
15216
  }, [isShowMore, tags]);
15200
- console.log(hashTagStyle, '111');
15201
15217
  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` } },
15202
15218
  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) },
15203
15219
  React.createElement("div", { dangerouslySetInnerHTML: { __html: setFontForText(`#${item}`, hashTagStyle) } })))))));
@@ -15268,27 +15284,35 @@ Made in Italy` })));
15268
15284
  * @Author: binruan@chatlabs.com
15269
15285
  * @Date: 2023-12-26 16:11:34
15270
15286
  * @LastEditors: binruan@chatlabs.com
15271
- * @LastEditTime: 2024-07-17 18:54:33
15287
+ * @LastEditTime: 2024-07-25 18:47:37
15272
15288
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
15273
15289
  *
15274
15290
  */
15275
15291
  const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
15292
+ var _a, _b, _c, _d, _e;
15276
15293
  const { schema } = useEditor();
15294
+ if (!(rec === null || rec === void 0 ? void 0 : rec.video))
15295
+ return null;
15296
+ let cta = null;
15297
+ 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) {
15298
+ cta = '多商品CTA';
15299
+ }
15300
+ else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
15301
+ cta = '商品CTA';
15302
+ }
15303
+ else {
15304
+ 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;
15305
+ }
15306
+ const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
15277
15307
  const renderComp = React.useMemo(() => {
15278
15308
  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;
15279
15309
  if (!(rec === null || rec === void 0 ? void 0 : rec.video))
15280
15310
  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
- }
15311
+ 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) ;
15312
+ else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) ;
15288
15313
  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;
15314
+ (_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
15315
  }
15291
- const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
15292
15316
  //如果includesCtaType有值,则只渲染includesCtaType包含的cta类型组件,用于在页面某处只显示某一组件
15293
15317
  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)))
15294
15318
  return;
@@ -15314,7 +15338,7 @@ Made in Italy` })));
15314
15338
  else {
15315
15339
  return null;
15316
15340
  }
15317
- }, [rec, resolver, tempMap, schema]);
15341
+ }, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id]);
15318
15342
  return React.createElement(React.Fragment, null, renderComp);
15319
15343
  };
15320
15344
  var RenderCard$1 = React.memo(RenderCard);
@@ -15402,7 +15426,7 @@ Made in Italy` })));
15402
15426
  * @Author: binruan@chatlabs.com
15403
15427
  * @Date: 2024-01-15 19:03:09
15404
15428
  * @LastEditors: binruan@chatlabs.com
15405
- * @LastEditTime: 2024-07-24 14:59:23
15429
+ * @LastEditTime: 2024-07-25 17:10:01
15406
15430
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
15407
15431
  *
15408
15432
  */
@@ -15679,7 +15703,7 @@ Made in Italy` })));
15679
15703
  return;
15680
15704
  const t = new Date() - curTime.current;
15681
15705
  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) {
15682
- 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);
15706
+ 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);
15683
15707
  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]);
15684
15708
  if (link) {
15685
15709
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
@@ -16224,7 +16248,7 @@ Made in Italy` })));
16224
16248
  * @Author: binruan@chatlabs.com
16225
16249
  * @Date: 2023-10-31 10:56:01
16226
16250
  * @LastEditors: binruan@chatlabs.com
16227
- * @LastEditTime: 2024-07-19 18:06:14
16251
+ * @LastEditTime: 2024-07-25 17:15:36
16228
16252
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
16229
16253
  *
16230
16254
  */
@@ -16277,7 +16301,7 @@ Made in Italy` })));
16277
16301
  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';
16278
16302
  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';
16279
16303
  const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
16280
- 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 })));
16304
+ 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 })));
16281
16305
  }
16282
16306
  else {
16283
16307
  return React.createElement(React.Fragment, null);