pb-sxp-ui 1.0.3 → 1.0.5
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 +62 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -0
- package/dist/index.js +62 -24
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +62 -24
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/RenderCard.js +3 -2
- package/es/core/components/SxpPageRender/index.js +1 -2
- package/es/materials/sxp/template/Appoint/index.d.ts +1 -0
- package/es/materials/sxp/template/Appoint/index.js +3 -3
- package/es/materials/sxp/template/Commodity/index.d.ts +1 -0
- package/es/materials/sxp/template/Commodity/index.js +2 -2
- package/es/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
- package/es/materials/sxp/template/CommodityDiro/index.js +2 -2
- package/es/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
- package/es/materials/sxp/template/CommodityDiroNew/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodity/index.js +12 -2
- package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +12 -2
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +12 -2
- package/es/materials/sxp/template/components/EventProvider.d.ts +1 -0
- package/es/materials/sxp/template/components/EventProvider.js +15 -3
- package/lib/core/components/SxpPageRender/RenderCard.js +3 -2
- package/lib/core/components/SxpPageRender/index.js +1 -2
- package/lib/materials/sxp/template/Appoint/index.d.ts +1 -0
- package/lib/materials/sxp/template/Appoint/index.js +3 -3
- package/lib/materials/sxp/template/Commodity/index.d.ts +1 -0
- package/lib/materials/sxp/template/Commodity/index.js +2 -2
- package/lib/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
- package/lib/materials/sxp/template/CommodityDiro/index.js +2 -2
- package/lib/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
- package/lib/materials/sxp/template/CommodityDiroNew/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodity/index.js +12 -2
- package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +12 -2
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +12 -2
- package/lib/materials/sxp/template/components/EventProvider.d.ts +1 -0
- package/lib/materials/sxp/template/components/EventProvider.js +15 -3
- package/package.json +1 -1
package/dist/index.css
CHANGED
package/dist/index.js
CHANGED
@@ -8159,7 +8159,7 @@ function useEventReport() {
|
|
8159
8159
|
* @Author: binruan@chatlabs.com
|
8160
8160
|
* @Date: 2023-11-02 18:34:34
|
8161
8161
|
* @LastEditors: binruan@chatlabs.com
|
8162
|
-
* @LastEditTime: 2024-04-10
|
8162
|
+
* @LastEditTime: 2024-04-10 18:40:21
|
8163
8163
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8164
8164
|
*
|
8165
8165
|
*/
|
@@ -9158,11 +9158,12 @@ function useOnScreen(ref) {
|
|
9158
9158
|
}
|
9159
9159
|
|
9160
9160
|
const EventProvider = (_a) => {
|
9161
|
-
var { rec, children, className, onClick, style } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style"]);
|
9161
|
+
var { rec, children, className, onClick, style, isExternalLink = false } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink"]);
|
9162
9162
|
const ref = useRef(null);
|
9163
9163
|
const isOnScreen = useOnScreen(ref);
|
9164
9164
|
const { popupAni } = useEditor();
|
9165
9165
|
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
9166
|
+
const { jumpToWeb } = useEventReport();
|
9166
9167
|
useEffect(() => {
|
9167
9168
|
var _a, _b;
|
9168
9169
|
if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
@@ -9174,14 +9175,24 @@ const EventProvider = (_a) => {
|
|
9174
9175
|
}
|
9175
9176
|
}, [isOnScreen, ref, rec, ctaEvent]);
|
9176
9177
|
const handleClick = throttle(() => {
|
9177
|
-
var _a, _b;
|
9178
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
9178
9179
|
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;
|
9179
9180
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9180
9181
|
eventSubject: 'clickCta',
|
9181
9182
|
eventDescription: 'User clicked the CTA'
|
9182
9183
|
}, rec, item);
|
9183
9184
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(rec);
|
9184
|
-
|
9185
|
+
if (isExternalLink) {
|
9186
|
+
if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) {
|
9187
|
+
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
9188
|
+
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
9189
|
+
jumpToWeb(rec, product, cta);
|
9190
|
+
window.location.href = (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link;
|
9191
|
+
}
|
9192
|
+
}
|
9193
|
+
else {
|
9194
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9195
|
+
}
|
9185
9196
|
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
9186
9197
|
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
9187
9198
|
};
|
@@ -9191,11 +9202,11 @@ var styles$6 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
|
9191
9202
|
|
9192
9203
|
const Commodity$1 = (_a) => {
|
9193
9204
|
var _b, _c, _d, _e, _f, _g, _h;
|
9194
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
9205
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9195
9206
|
const { sxpParameter } = useSxpDataSource();
|
9196
9207
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9197
9208
|
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;
|
9198
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9209
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9199
9210
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9200
9211
|
React.createElement("img", { className: css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
|
9201
9212
|
React.createElement("div", { className: css({
|
@@ -9281,12 +9292,12 @@ var interactionRender$5 = [
|
|
9281
9292
|
|
9282
9293
|
const Appoint$1 = (_a) => {
|
9283
9294
|
var _b, _c, _d, _e;
|
9284
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
9295
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9285
9296
|
const { sxpParameter } = useSxpDataSource();
|
9286
9297
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
9287
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props),
|
9298
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props),
|
9288
9299
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9289
|
-
React.createElement("img", { className: 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: '' })),
|
9300
|
+
React.createElement("img", { className: 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: '' })),
|
9290
9301
|
React.createElement("div", { className: 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')));
|
9291
9302
|
};
|
9292
9303
|
var AppointComponent = memo(Appoint$1);
|
@@ -9434,11 +9445,11 @@ var styles$4 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__yyHVb"};
|
|
9434
9445
|
|
9435
9446
|
const CommodityDiro$1 = (_a) => {
|
9436
9447
|
var _b, _c, _d, _e, _f, _g, _h;
|
9437
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
9448
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9438
9449
|
const { sxpParameter } = useSxpDataSource();
|
9439
9450
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9440
9451
|
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;
|
9441
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9452
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9442
9453
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9443
9454
|
React.createElement("img", { className: css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
|
9444
9455
|
React.createElement("div", { className: css({
|
@@ -9526,11 +9537,11 @@ var styles$3 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__I-yCC"};
|
|
9526
9537
|
|
9527
9538
|
const CommodityDiroNew$1 = (_a) => {
|
9528
9539
|
var _b, _c, _d, _e, _f, _g, _h;
|
9529
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
9540
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9530
9541
|
const { sxpParameter } = useSxpDataSource();
|
9531
9542
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9532
9543
|
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;
|
9533
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9544
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9534
9545
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9535
9546
|
React.createElement("img", { className: css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
|
9536
9547
|
React.createElement("div", { className: css({
|
@@ -9648,9 +9659,10 @@ var styles$2 = {"two-line-ellipsis":"index-module_two-line-ellipsis__SFQwJ"};
|
|
9648
9659
|
|
9649
9660
|
const MultiCommodityDiro$1 = (_a) => {
|
9650
9661
|
var _b, _c;
|
9651
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
|
9662
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9652
9663
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
9653
9664
|
const { popupAni } = useEditor();
|
9665
|
+
const { jumpToWeb } = useEventReport();
|
9654
9666
|
const [products, setProducts] = 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]);
|
9655
9667
|
const handleClick = throttle((item) => {
|
9656
9668
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -9658,7 +9670,15 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
9658
9670
|
eventDescription: 'User clicked the CTA'
|
9659
9671
|
}, recData, item);
|
9660
9672
|
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 }) }));
|
9661
|
-
|
9673
|
+
if (isExternalLink) {
|
9674
|
+
if (item === null || item === void 0 ? void 0 : item.link) {
|
9675
|
+
jumpToWeb(recData, item, item.bindCta);
|
9676
|
+
window.location.href = item.link;
|
9677
|
+
}
|
9678
|
+
}
|
9679
|
+
else {
|
9680
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9681
|
+
}
|
9662
9682
|
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
9663
9683
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9664
9684
|
var _a, _b, _c, _d, _e, _f;
|
@@ -9751,18 +9771,27 @@ var styles$1 = {"two-line-ellipsis":"index-module_two-line-ellipsis__mdzn0"};
|
|
9751
9771
|
|
9752
9772
|
const MultiCommodity$1 = (_a) => {
|
9753
9773
|
var _b, _c;
|
9754
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
|
9774
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9755
9775
|
const { sxpParameter } = useSxpDataSource();
|
9756
9776
|
const { ctaEvent, setPopupDetailData } = useSxpDataSource();
|
9757
9777
|
const { popupAni } = useEditor();
|
9758
9778
|
const [products, setProducts] = 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]);
|
9779
|
+
const { jumpToWeb } = useEventReport();
|
9759
9780
|
const handleClick = throttle((item) => {
|
9760
9781
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9761
9782
|
eventSubject: 'clickCta',
|
9762
9783
|
eventDescription: 'User clicked the CTA'
|
9763
9784
|
}, recData, item);
|
9764
9785
|
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 }) }));
|
9765
|
-
|
9786
|
+
if (isExternalLink) {
|
9787
|
+
if (item === null || item === void 0 ? void 0 : item.link) {
|
9788
|
+
jumpToWeb(recData, item, item.bindCta);
|
9789
|
+
window.location.href = item.link;
|
9790
|
+
}
|
9791
|
+
}
|
9792
|
+
else {
|
9793
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9794
|
+
}
|
9766
9795
|
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
9767
9796
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9768
9797
|
var _a, _b, _c, _d, _e, _f;
|
@@ -9855,9 +9884,10 @@ var styles = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__fselR"};
|
|
9855
9884
|
|
9856
9885
|
const MultiCommodityDiroNew$1 = (_a) => {
|
9857
9886
|
var _b, _c;
|
9858
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
|
9887
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9859
9888
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
9860
9889
|
const { popupAni } = useEditor();
|
9890
|
+
const { jumpToWeb } = useEventReport();
|
9861
9891
|
const [products, setProducts] = 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]);
|
9862
9892
|
const handleClick = throttle((item) => {
|
9863
9893
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -9865,7 +9895,15 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
9865
9895
|
eventDescription: 'User clicked the CTA'
|
9866
9896
|
}, recData, item);
|
9867
9897
|
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 }) }));
|
9868
|
-
|
9898
|
+
if (isExternalLink) {
|
9899
|
+
if (item === null || item === void 0 ? void 0 : item.link) {
|
9900
|
+
jumpToWeb(recData, item, item.bindCta);
|
9901
|
+
window.location.href = item.link;
|
9902
|
+
}
|
9903
|
+
}
|
9904
|
+
else {
|
9905
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9906
|
+
}
|
9869
9907
|
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
9870
9908
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9871
9909
|
var _a, _b, _c, _d, _e, _f;
|
@@ -12351,14 +12389,14 @@ function withBindDataSource(Component) {
|
|
12351
12389
|
* @Author: binruan@chatlabs.com
|
12352
12390
|
* @Date: 2023-12-26 16:11:34
|
12353
12391
|
* @LastEditors: binruan@chatlabs.com
|
12354
|
-
* @LastEditTime: 2024-04-
|
12392
|
+
* @LastEditTime: 2024-04-10 16:49:34
|
12355
12393
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
12356
12394
|
*
|
12357
12395
|
*/
|
12358
12396
|
const RenderCard = ({ rec, index, tempMap, resolver }) => {
|
12359
12397
|
const { schema } = useEditor();
|
12360
12398
|
const renderComp = useMemo(() => {
|
12361
|
-
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;
|
12399
|
+
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;
|
12362
12400
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
12363
12401
|
return null;
|
12364
12402
|
let cta = null;
|
@@ -12384,7 +12422,8 @@ const RenderCard = ({ rec, index, tempMap, resolver }) => {
|
|
12384
12422
|
const t = resolver[(_w = value === null || value === void 0 ? void 0 : value.item) === null || _w === void 0 ? void 0 : _w.type];
|
12385
12423
|
const Component = withBindDataSource(t);
|
12386
12424
|
const defaulSetting = (_x = t === null || t === void 0 ? void 0 : t.extend) === null || _x === void 0 ? void 0 : _x.defaulSetting;
|
12387
|
-
|
12425
|
+
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';
|
12426
|
+
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 })));
|
12388
12427
|
}
|
12389
12428
|
else {
|
12390
12429
|
return null;
|
@@ -12595,8 +12634,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12595
12634
|
React.createElement(Nudge, { nudge: nudge }),
|
12596
12635
|
React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
12597
12636
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
|
12598
|
-
React.createElement(
|
12599
|
-
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 })),
|
12637
|
+
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 }),
|
12600
12638
|
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 }))));
|
12601
12639
|
}
|
12602
12640
|
return null;
|