pb-sxp-ui 1.0.3 → 1.0.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.
Files changed (50) hide show
  1. package/dist/index.cjs +64 -23
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +1 -0
  4. package/dist/index.js +64 -23
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +3 -3
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +3 -3
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +64 -23
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +3 -3
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/SxpPageRender/RenderCard.js +3 -2
  15. package/es/core/components/SxpPageRender/index.js +1 -2
  16. package/es/materials/sxp/template/Appoint/index.d.ts +1 -0
  17. package/es/materials/sxp/template/Appoint/index.js +3 -3
  18. package/es/materials/sxp/template/Commodity/index.d.ts +1 -0
  19. package/es/materials/sxp/template/Commodity/index.js +2 -2
  20. package/es/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
  21. package/es/materials/sxp/template/CommodityDiro/index.js +2 -2
  22. package/es/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
  23. package/es/materials/sxp/template/CommodityDiroNew/index.js +2 -2
  24. package/es/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
  25. package/es/materials/sxp/template/MultiCommodity/index.js +13 -2
  26. package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
  27. package/es/materials/sxp/template/MultiCommodityDiro/index.js +13 -2
  28. package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
  29. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +13 -2
  30. package/es/materials/sxp/template/components/EventProvider.d.ts +1 -0
  31. package/es/materials/sxp/template/components/EventProvider.js +15 -3
  32. package/lib/core/components/SxpPageRender/RenderCard.js +3 -2
  33. package/lib/core/components/SxpPageRender/index.js +1 -2
  34. package/lib/materials/sxp/template/Appoint/index.d.ts +1 -0
  35. package/lib/materials/sxp/template/Appoint/index.js +3 -3
  36. package/lib/materials/sxp/template/Commodity/index.d.ts +1 -0
  37. package/lib/materials/sxp/template/Commodity/index.js +2 -2
  38. package/lib/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
  39. package/lib/materials/sxp/template/CommodityDiro/index.js +2 -2
  40. package/lib/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
  41. package/lib/materials/sxp/template/CommodityDiroNew/index.js +2 -2
  42. package/lib/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
  43. package/lib/materials/sxp/template/MultiCommodity/index.js +13 -2
  44. package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
  45. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +13 -2
  46. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
  47. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +13 -2
  48. package/lib/materials/sxp/template/components/EventProvider.d.ts +1 -0
  49. package/lib/materials/sxp/template/components/EventProvider.js +15 -3
  50. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -9181,11 +9181,12 @@ function useOnScreen(ref) {
9181
9181
  }
9182
9182
 
9183
9183
  const EventProvider = (_a) => {
9184
- var { rec, children, className, onClick, style } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style"]);
9184
+ var { rec, children, className, onClick, style, isExternalLink = false } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink"]);
9185
9185
  const ref = React.useRef(null);
9186
9186
  const isOnScreen = useOnScreen(ref);
9187
9187
  const { popupAni } = useEditor();
9188
9188
  const { setPopupDetailData, ctaEvent } = useSxpDataSource();
9189
+ const { jumpToWeb } = useEventReport();
9189
9190
  React.useEffect(() => {
9190
9191
  var _a, _b;
9191
9192
  if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
@@ -9197,14 +9198,24 @@ const EventProvider = (_a) => {
9197
9198
  }
9198
9199
  }, [isOnScreen, ref, rec, ctaEvent]);
9199
9200
  const handleClick = lodash.throttle(() => {
9200
- var _a, _b;
9201
+ var _a, _b, _c, _d, _e, _f, _g, _h;
9201
9202
  const item = (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
9202
9203
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
9203
9204
  eventSubject: 'clickCta',
9204
9205
  eventDescription: 'User clicked the CTA'
9205
9206
  }, rec, item);
9206
9207
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(rec);
9207
- onClick === null || onClick === void 0 ? void 0 : onClick();
9208
+ if (isExternalLink) {
9209
+ if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindCta) === null || _d === void 0 ? void 0 : _d.link) {
9210
+ const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
9211
+ const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
9212
+ jumpToWeb(rec, product, cta);
9213
+ window.location.href = (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindCta) === null || _h === void 0 ? void 0 : _h.link;
9214
+ }
9215
+ }
9216
+ else {
9217
+ onClick === null || onClick === void 0 ? void 0 : onClick();
9218
+ }
9208
9219
  }, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
9209
9220
  return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
9210
9221
  };
@@ -9214,11 +9225,11 @@ var styles$6 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
9214
9225
 
9215
9226
  const Commodity$1 = (_a) => {
9216
9227
  var _b, _c, _d, _e, _f, _g, _h;
9217
- var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
9228
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
9218
9229
  const { sxpParameter } = useSxpDataSource();
9219
9230
  const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
9220
9231
  const src = (_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.homePage) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
9221
- return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
9232
+ return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
9222
9233
  React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
9223
9234
  React.createElement("img", { className: css.css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
9224
9235
  React.createElement("div", { className: css.css({
@@ -9304,12 +9315,12 @@ var interactionRender$5 = [
9304
9315
 
9305
9316
  const Appoint$1 = (_a) => {
9306
9317
  var _b, _c, _d, _e;
9307
- var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
9318
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
9308
9319
  const { sxpParameter } = useSxpDataSource();
9309
9320
  const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
9310
- return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props),
9321
+ return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props),
9311
9322
  React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
9312
- React.createElement("img", { className: css.css({ width: '100%', objectFit: 'cover', height: '100%' }), src: (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, alt: '' })),
9323
+ React.createElement("img", { className: css.css({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), src: (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, alt: '' })),
9313
9324
  React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_e = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _e !== void 0 ? _e : 'Product Name')));
9314
9325
  };
9315
9326
  var AppointComponent = React.memo(Appoint$1);
@@ -9457,11 +9468,11 @@ var styles$4 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__yyHVb"};
9457
9468
 
9458
9469
  const CommodityDiro$1 = (_a) => {
9459
9470
  var _b, _c, _d, _e, _f, _g, _h;
9460
- var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
9471
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
9461
9472
  const { sxpParameter } = useSxpDataSource();
9462
9473
  const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
9463
9474
  const src = (_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.homePage) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
9464
- return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
9475
+ return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
9465
9476
  React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
9466
9477
  React.createElement("img", { className: css.css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
9467
9478
  React.createElement("div", { className: css.css({
@@ -9549,11 +9560,11 @@ var styles$3 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__I-yCC"};
9549
9560
 
9550
9561
  const CommodityDiroNew$1 = (_a) => {
9551
9562
  var _b, _c, _d, _e, _f, _g, _h;
9552
- var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
9563
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
9553
9564
  const { sxpParameter } = useSxpDataSource();
9554
9565
  const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
9555
9566
  const src = (_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.homePage) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
9556
- return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
9567
+ return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
9557
9568
  React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
9558
9569
  React.createElement("img", { className: css.css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
9559
9570
  React.createElement("div", { className: css.css({
@@ -9671,17 +9682,27 @@ var styles$2 = {"two-line-ellipsis":"index-module_two-line-ellipsis__SFQwJ"};
9671
9682
 
9672
9683
  const MultiCommodityDiro$1 = (_a) => {
9673
9684
  var _b, _c;
9674
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
9685
+ var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
9675
9686
  const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
9676
9687
  const { popupAni } = useEditor();
9688
+ const { jumpToWeb } = useEventReport();
9677
9689
  const [products, setProducts] = React.useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
9678
9690
  const handleClick = lodash.throttle((item) => {
9691
+ var _a;
9679
9692
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
9680
9693
  eventSubject: 'clickCta',
9681
9694
  eventDescription: 'User clicked the CTA'
9682
9695
  }, recData, item);
9683
9696
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
9684
- onClick === null || onClick === void 0 ? void 0 : onClick();
9697
+ if (isExternalLink) {
9698
+ if ((_a = item === null || item === void 0 ? void 0 : item.bindCta) === null || _a === void 0 ? void 0 : _a.link) {
9699
+ jumpToWeb(recData, item, item.bindCta);
9700
+ window.location.href = item.bindCta.link;
9701
+ }
9702
+ }
9703
+ else {
9704
+ onClick === null || onClick === void 0 ? void 0 : onClick();
9705
+ }
9685
9706
  }, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
9686
9707
  return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
9687
9708
  var _a, _b, _c, _d, _e, _f;
@@ -9774,18 +9795,28 @@ var styles$1 = {"two-line-ellipsis":"index-module_two-line-ellipsis__mdzn0"};
9774
9795
 
9775
9796
  const MultiCommodity$1 = (_a) => {
9776
9797
  var _b, _c;
9777
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
9798
+ var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
9778
9799
  const { sxpParameter } = useSxpDataSource();
9779
9800
  const { ctaEvent, setPopupDetailData } = useSxpDataSource();
9780
9801
  const { popupAni } = useEditor();
9781
9802
  const [products, setProducts] = React.useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
9803
+ const { jumpToWeb } = useEventReport();
9782
9804
  const handleClick = lodash.throttle((item) => {
9805
+ var _a;
9783
9806
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
9784
9807
  eventSubject: 'clickCta',
9785
9808
  eventDescription: 'User clicked the CTA'
9786
9809
  }, recData, item);
9787
9810
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
9788
- onClick === null || onClick === void 0 ? void 0 : onClick();
9811
+ if (isExternalLink) {
9812
+ if ((_a = item === null || item === void 0 ? void 0 : item.bindCta) === null || _a === void 0 ? void 0 : _a.link) {
9813
+ jumpToWeb(recData, item, item.bindCta);
9814
+ window.location.href = item.bindCta.link;
9815
+ }
9816
+ }
9817
+ else {
9818
+ onClick === null || onClick === void 0 ? void 0 : onClick();
9819
+ }
9789
9820
  }, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
9790
9821
  return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
9791
9822
  var _a, _b, _c, _d, _e, _f;
@@ -9878,17 +9909,27 @@ var styles = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__fselR"};
9878
9909
 
9879
9910
  const MultiCommodityDiroNew$1 = (_a) => {
9880
9911
  var _b, _c;
9881
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
9912
+ var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
9882
9913
  const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
9883
9914
  const { popupAni } = useEditor();
9915
+ const { jumpToWeb } = useEventReport();
9884
9916
  const [products, setProducts] = React.useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
9885
9917
  const handleClick = lodash.throttle((item) => {
9918
+ var _a;
9886
9919
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
9887
9920
  eventSubject: 'clickCta',
9888
9921
  eventDescription: 'User clicked the CTA'
9889
9922
  }, recData, item);
9890
9923
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
9891
- onClick === null || onClick === void 0 ? void 0 : onClick();
9924
+ if (isExternalLink) {
9925
+ if ((_a = item === null || item === void 0 ? void 0 : item.bindCta) === null || _a === void 0 ? void 0 : _a.link) {
9926
+ jumpToWeb(recData, item, item.bindCta);
9927
+ window.location.href = item.bindCta.link;
9928
+ }
9929
+ }
9930
+ else {
9931
+ onClick === null || onClick === void 0 ? void 0 : onClick();
9932
+ }
9892
9933
  }, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
9893
9934
  return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
9894
9935
  var _a, _b, _c, _d, _e, _f;
@@ -12374,14 +12415,14 @@ function withBindDataSource(Component) {
12374
12415
  * @Author: binruan@chatlabs.com
12375
12416
  * @Date: 2023-12-26 16:11:34
12376
12417
  * @LastEditors: binruan@chatlabs.com
12377
- * @LastEditTime: 2024-04-09 18:17:54
12418
+ * @LastEditTime: 2024-04-10 16:49:34
12378
12419
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
12379
12420
  *
12380
12421
  */
12381
12422
  const RenderCard = ({ rec, index, tempMap, resolver }) => {
12382
12423
  const { schema } = useEditor();
12383
12424
  const renderComp = React.useMemo(() => {
12384
- 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;
12425
+ 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;
12385
12426
  if (!(rec === null || rec === void 0 ? void 0 : rec.video))
12386
12427
  return null;
12387
12428
  let cta = null;
@@ -12407,7 +12448,8 @@ const RenderCard = ({ rec, index, tempMap, resolver }) => {
12407
12448
  const t = resolver[(_w = value === null || value === void 0 ? void 0 : value.item) === null || _w === void 0 ? void 0 : _w.type];
12408
12449
  const Component = withBindDataSource(t);
12409
12450
  const defaulSetting = (_x = t === null || t === void 0 ? void 0 : t.extend) === null || _x === void 0 ? void 0 : _x.defaulSetting;
12410
- return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_z = value === null || value === void 0 ? void 0 : value.item) === null || _z === void 0 ? void 0 : _z.textStyle), bindDatas: (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.bindDatas) !== null && _1 !== void 0 ? _1 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.props, { event: ((_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec })));
12451
+ const isExternalLink = ((_0 = (_z = (_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.event) === null || _z === void 0 ? void 0 : _z.onClick) === null || _0 === void 0 ? void 0 : _0.linkType) === 'externalLink';
12452
+ return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_1 = value === null || value === void 0 ? void 0 : value.item) === null || _1 === void 0 ? void 0 : _1.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.textStyle), bindDatas: (_4 = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.bindDatas) !== null && _4 !== void 0 ? _4 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.props, { event: ((_6 = value === null || value === void 0 ? void 0 : value.item) === null || _6 === void 0 ? void 0 : _6.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink })));
12411
12453
  }
12412
12454
  else {
12413
12455
  return null;
@@ -12618,8 +12660,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12618
12660
  React.createElement(Nudge, { nudge: nudge }),
12619
12661
  React.createElement("div", { className: 'clc-sxp-bottom-card' },
12620
12662
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
12621
- React.createElement("div", { className: 'clc-sxp-bottom-text' },
12622
- React.createElement(ExpandableText$1, { isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: descStyle })),
12663
+ 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: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: descStyle }),
12623
12664
  React.createElement(Hashtag$1, { index: activeIndex, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.url) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))));
12624
12665
  }
12625
12666
  return null;