pb-sxp-ui 1.0.8 → 1.0.10
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 +79 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +79 -69
- 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 +79 -69
- 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/LikeButton/index.d.ts +1 -0
- package/es/core/components/SxpPageRender/LikeButton/index.js +3 -3
- package/es/core/components/SxpPageRender/Nudge/index.js +2 -2
- package/es/core/components/SxpPageRender/Popup/index.js +1 -1
- package/es/core/components/SxpPageRender/RenderCard.js +1 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.js +3 -3
- package/es/core/components/SxpPageRender/WaterFall/List.js +1 -1
- package/es/core/components/SxpPageRender/WaterFall/index.js +3 -3
- package/es/core/components/SxpPageRender/index.d.ts +1 -0
- package/es/core/components/SxpPageRender/index.js +10 -10
- package/es/core/context/SxpDataSourceProvider.d.ts +4 -2
- package/es/core/context/SxpDataSourceProvider.js +2 -2
- package/es/core/hooks/useEventReport.d.ts +2 -2
- package/es/core/hooks/useEventReport.js +4 -4
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +4 -3
- package/es/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetailDiro/index.js +4 -3
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +4 -3
- package/es/materials/sxp/template/Appoint/index.d.ts +1 -0
- package/es/materials/sxp/template/Commodity/index.d.ts +1 -0
- package/es/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
- package/es/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
- package/es/materials/sxp/template/Link/index.d.ts +1 -0
- package/es/materials/sxp/template/Link/index.js +3 -3
- package/es/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodity/index.js +5 -5
- package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +5 -5
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +5 -5
- package/es/materials/sxp/template/components/EventProvider.d.ts +1 -0
- package/es/materials/sxp/template/components/EventProvider.js +6 -6
- package/es/materials/sxp/template/components/Img.d.ts +1 -0
- package/es/materials/sxp/template/components/Img.js +3 -3
- package/lib/core/components/SxpPageRender/LikeButton/index.d.ts +1 -0
- package/lib/core/components/SxpPageRender/LikeButton/index.js +3 -3
- package/lib/core/components/SxpPageRender/Nudge/index.js +2 -2
- package/lib/core/components/SxpPageRender/Popup/index.js +1 -1
- package/lib/core/components/SxpPageRender/RenderCard.js +1 -1
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +3 -3
- package/lib/core/components/SxpPageRender/WaterFall/List.js +1 -1
- package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -3
- package/lib/core/components/SxpPageRender/index.d.ts +1 -0
- package/lib/core/components/SxpPageRender/index.js +10 -10
- package/lib/core/context/SxpDataSourceProvider.d.ts +4 -2
- package/lib/core/context/SxpDataSourceProvider.js +2 -2
- package/lib/core/hooks/useEventReport.d.ts +2 -2
- package/lib/core/hooks/useEventReport.js +4 -4
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.js +4 -3
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +4 -3
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +4 -3
- package/lib/materials/sxp/template/Appoint/index.d.ts +1 -0
- package/lib/materials/sxp/template/Commodity/index.d.ts +1 -0
- package/lib/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
- package/lib/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
- package/lib/materials/sxp/template/Link/index.d.ts +1 -0
- package/lib/materials/sxp/template/Link/index.js +3 -3
- package/lib/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodity/index.js +5 -5
- package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +5 -5
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +5 -5
- package/lib/materials/sxp/template/components/EventProvider.d.ts +1 -0
- package/lib/materials/sxp/template/components/EventProvider.js +6 -6
- package/lib/materials/sxp/template/components/Img.d.ts +1 -0
- package/lib/materials/sxp/template/components/Img.js +3 -3
- package/package.json +1 -1
@@ -9,18 +9,18 @@ const hooks_1 = require("../../../../core/hooks");
|
|
9
9
|
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
10
10
|
const Link = (_a) => {
|
11
11
|
var _b, _c, _d, _e, _f;
|
12
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
12
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index"]);
|
13
13
|
const { sxpParameter, bffEventReport } = (0, hooks_1.useSxpDataSource)();
|
14
14
|
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
15
15
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
16
16
|
const product = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
|
17
17
|
const handleTo = () => {
|
18
18
|
if (cta === null || cta === void 0 ? void 0 : cta.link) {
|
19
|
-
jumpToWeb(recData, product, cta);
|
19
|
+
jumpToWeb(recData, product, cta, index);
|
20
20
|
window.location.href = window.getJointUtmLink(cta.link);
|
21
21
|
}
|
22
22
|
};
|
23
|
-
return (react_1.default.createElement(EventProvider_1.default, Object.assign({ rec: recData, className: (0, css_1.css)(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
|
23
|
+
return (react_1.default.createElement(EventProvider_1.default, Object.assign({ index: index, rec: recData, className: (0, css_1.css)(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
|
24
24
|
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ backgroundColor: '#f2f2f2', overflow: 'hidden', flexShrink: 0 }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
25
25
|
react_1.default.createElement("img", { className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%' }), src: (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image, alt: '' })),
|
26
26
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
@@ -10,6 +10,7 @@ export interface IMultiCommodityProps {
|
|
10
10
|
bottom_image?: string;
|
11
11
|
ctaTempStyles?: ICtaTempStylesType;
|
12
12
|
isExternalLink?: boolean;
|
13
|
+
index?: number;
|
13
14
|
}
|
14
15
|
declare const _default: React.NamedExoticComponent<IMultiCommodityProps>;
|
15
16
|
export default _default;
|
@@ -12,7 +12,7 @@ const hooks_1 = require("../../../../core/hooks");
|
|
12
12
|
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
13
13
|
const MultiCommodity = (_a) => {
|
14
14
|
var _b, _c;
|
15
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
15
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
|
16
16
|
const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
17
17
|
const { ctaEvent, setPopupDetailData } = (0, hooks_1.useSxpDataSource)();
|
18
18
|
const { popup } = (0, hooks_1.useEditor)();
|
@@ -22,11 +22,11 @@ const MultiCommodity = (_a) => {
|
|
22
22
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
23
23
|
eventSubject: 'clickCta',
|
24
24
|
eventDescription: 'User clicked the CTA'
|
25
|
-
}, recData, item);
|
26
|
-
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 }) }));
|
25
|
+
}, recData, item, index);
|
26
|
+
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 }), index }));
|
27
27
|
if (isExternalLink) {
|
28
28
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
29
|
-
jumpToWeb(recData, item, item.bindCta);
|
29
|
+
jumpToWeb(recData, item, item.bindCta, index);
|
30
30
|
window.location.href = window.getJointUtmLink(item.link);
|
31
31
|
}
|
32
32
|
}
|
@@ -38,7 +38,7 @@ const MultiCommodity = (_a) => {
|
|
38
38
|
var _a, _b, _c, _d, _e, _f;
|
39
39
|
return (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
40
40
|
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
41
|
-
react_1.default.createElement(Img_1.default, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item })),
|
41
|
+
react_1.default.createElement(Img_1.default, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item, index: index })),
|
42
42
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
43
43
|
color: '#fff',
|
44
44
|
display: 'flex',
|
@@ -10,6 +10,7 @@ export interface IMultiCommodityDiroProps {
|
|
10
10
|
bottom_image?: string;
|
11
11
|
ctaTempStyles?: ICtaTempStylesType;
|
12
12
|
isExternalLink?: boolean;
|
13
|
+
index?: number;
|
13
14
|
}
|
14
15
|
declare const _default: React.NamedExoticComponent<IMultiCommodityDiroProps>;
|
15
16
|
export default _default;
|
@@ -12,7 +12,7 @@ const hooks_1 = require("../../../../core/hooks");
|
|
12
12
|
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
13
13
|
const MultiCommodityDiro = (_a) => {
|
14
14
|
var _b, _c;
|
15
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
15
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
|
16
16
|
const { ctaEvent, setPopupDetailData, sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
17
17
|
const { popup } = (0, hooks_1.useEditor)();
|
18
18
|
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
@@ -21,11 +21,11 @@ const MultiCommodityDiro = (_a) => {
|
|
21
21
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
22
22
|
eventSubject: 'clickCta',
|
23
23
|
eventDescription: 'User clicked the CTA'
|
24
|
-
}, recData, item);
|
25
|
-
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 }) }));
|
24
|
+
}, recData, item, index);
|
25
|
+
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 }), index }));
|
26
26
|
if (isExternalLink) {
|
27
27
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
28
|
-
jumpToWeb(recData, item, item.bindCta);
|
28
|
+
jumpToWeb(recData, item, item.bindCta, index);
|
29
29
|
window.location.href = window.getJointUtmLink(item.link);
|
30
30
|
}
|
31
31
|
}
|
@@ -37,7 +37,7 @@ const MultiCommodityDiro = (_a) => {
|
|
37
37
|
var _a, _b, _c, _d, _e, _f;
|
38
38
|
return (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
39
39
|
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
40
|
-
react_1.default.createElement(Img_1.default, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item })),
|
40
|
+
react_1.default.createElement(Img_1.default, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item, index: index })),
|
41
41
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
42
42
|
color: '#000',
|
43
43
|
display: 'flex',
|
@@ -10,6 +10,7 @@ export interface IMultiCommodityDiroNewProps {
|
|
10
10
|
bottom_image?: string;
|
11
11
|
ctaTempStyles?: ICtaTempStylesType;
|
12
12
|
isExternalLink?: boolean;
|
13
|
+
index?: number;
|
13
14
|
}
|
14
15
|
declare const _default: React.NamedExoticComponent<IMultiCommodityDiroNewProps>;
|
15
16
|
export default _default;
|
@@ -12,7 +12,7 @@ const hooks_1 = require("../../../../core/hooks");
|
|
12
12
|
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
13
13
|
const MultiCommodityDiroNew = (_a) => {
|
14
14
|
var _b, _c;
|
15
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
15
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
|
16
16
|
const { ctaEvent, setPopupDetailData, sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
17
17
|
const { popup } = (0, hooks_1.useEditor)();
|
18
18
|
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
@@ -21,11 +21,11 @@ const MultiCommodityDiroNew = (_a) => {
|
|
21
21
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
22
22
|
eventSubject: 'clickCta',
|
23
23
|
eventDescription: 'User clicked the CTA'
|
24
|
-
}, recData, item);
|
25
|
-
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 }) }));
|
24
|
+
}, recData, item, index);
|
25
|
+
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 }), index }));
|
26
26
|
if (isExternalLink) {
|
27
27
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
28
|
-
jumpToWeb(recData, item, item.bindCta);
|
28
|
+
jumpToWeb(recData, item, item.bindCta, index);
|
29
29
|
window.location.href = window.getJointUtmLink(item.link);
|
30
30
|
}
|
31
31
|
}
|
@@ -37,7 +37,7 @@ const MultiCommodityDiroNew = (_a) => {
|
|
37
37
|
var _a, _b, _c, _d, _e, _f;
|
38
38
|
return (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
39
39
|
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
40
|
-
react_1.default.createElement(Img_1.default, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item })),
|
40
|
+
react_1.default.createElement(Img_1.default, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item, index: index })),
|
41
41
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
42
42
|
color: '#fff',
|
43
43
|
display: 'flex',
|
@@ -7,7 +7,7 @@ const useOnScreen_1 = tslib_1.__importDefault(require("../../../../core/hooks/us
|
|
7
7
|
const hooks_1 = require("../../../../core/hooks");
|
8
8
|
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
9
9
|
const EventProvider = (_a) => {
|
10
|
-
var { rec, children, className, onClick, style, isExternalLink = false } = _a, props = tslib_1.__rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink"]);
|
10
|
+
var { rec, children, className, onClick, style, isExternalLink = false, index } = _a, props = tslib_1.__rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
|
11
11
|
const ref = (0, react_1.useRef)(null);
|
12
12
|
const isOnScreen = (0, useOnScreen_1.default)(ref);
|
13
13
|
const { popup } = (0, hooks_1.useEditor)();
|
@@ -20,22 +20,22 @@ const EventProvider = (_a) => {
|
|
20
20
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
21
21
|
eventSubject: 'ctaExposure',
|
22
22
|
eventDescription: 'The cta was shown to the user'
|
23
|
-
}, rec, item);
|
23
|
+
}, rec, item, index);
|
24
24
|
}
|
25
|
-
}, [isOnScreen, ref, rec, ctaEvent]);
|
25
|
+
}, [isOnScreen, ref, rec, ctaEvent, index]);
|
26
26
|
const handleClick = (0, lodash_1.throttle)(() => {
|
27
27
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
28
28
|
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;
|
29
29
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
30
30
|
eventSubject: 'clickCta',
|
31
31
|
eventDescription: 'User clicked the CTA'
|
32
|
-
}, rec, item);
|
33
|
-
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(rec);
|
32
|
+
}, rec, item, index);
|
33
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
34
34
|
if (isExternalLink) {
|
35
35
|
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) {
|
36
36
|
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
37
37
|
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
38
|
-
jumpToWeb(rec, product, cta);
|
38
|
+
jumpToWeb(rec, product, cta, index);
|
39
39
|
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;
|
40
40
|
window.location.href = window.getJointUtmLink((_k = (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProduct) === null || _k === void 0 ? void 0 : _k.link);
|
41
41
|
}
|
@@ -5,7 +5,7 @@ const css_1 = require("@emotion/css");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
6
6
|
const useOnScreen_1 = tslib_1.__importDefault(require("../../../../core/hooks/useOnScreen"));
|
7
7
|
const hooks_1 = require("../../../../core/hooks");
|
8
|
-
const Img = ({ src, rec, item }) => {
|
8
|
+
const Img = ({ src, rec, item, index }) => {
|
9
9
|
const ref = (0, react_1.useRef)(null);
|
10
10
|
const isOnScreen = (0, useOnScreen_1.default)(ref);
|
11
11
|
const { ctaEvent } = (0, hooks_1.useSxpDataSource)();
|
@@ -14,9 +14,9 @@ const Img = ({ src, rec, item }) => {
|
|
14
14
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
15
15
|
eventSubject: 'ctaExposure',
|
16
16
|
eventDescription: 'The cta was shown to the user'
|
17
|
-
}, rec, item);
|
17
|
+
}, rec, item, index);
|
18
18
|
}
|
19
|
-
}, [isOnScreen, src, ref, rec, ctaEvent, item]);
|
19
|
+
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
20
20
|
return (react_1.default.createElement("img", { ref: ref, hidden: !src, className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, alt: '' }));
|
21
21
|
};
|
22
22
|
exports.default = (0, react_1.memo)(Img);
|