pb-sxp-ui 1.0.7 → 1.0.9
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 +72 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +72 -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 +72 -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/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.js +8 -8
- 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 +6 -6
- package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +6 -6
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +6 -6
- package/es/materials/sxp/template/components/EventProvider.d.ts +1 -0
- package/es/materials/sxp/template/components/EventProvider.js +8 -7
- 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/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.js +8 -8
- 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 +6 -6
- package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +6 -6
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +6 -6
- package/lib/materials/sxp/template/components/EventProvider.d.ts +1 -0
- package/lib/materials/sxp/template/components/EventProvider.js +8 -7
- 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
package/dist/index.js
CHANGED
@@ -531,7 +531,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
531
531
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
|
532
532
|
return res === null || res === void 0 ? void 0 : res.success;
|
533
533
|
}), [bffFetch]);
|
534
|
-
const ctaEvent = useCallback((eventInfo, rec, product) => {
|
534
|
+
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
535
535
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
536
536
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
537
537
|
const isProd = ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) || (((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProducts) && ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProducts) === null || _d === void 0 ? void 0 : _d.length) > 0);
|
@@ -546,7 +546,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
546
546
|
fromKName = 'imagePage';
|
547
547
|
}
|
548
548
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
549
|
-
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position:
|
549
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', relatedContentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', relatedProductId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : '', fromKName })
|
550
550
|
});
|
551
551
|
}, [bffEventReport, isFromHashtag]);
|
552
552
|
useEffect(() => {
|
@@ -8083,13 +8083,13 @@ SwiperSlide.displayName = 'SwiperSlide';
|
|
8083
8083
|
* @Author: binruan@chatlabs.com
|
8084
8084
|
* @Date: 2024-03-12 10:59:06
|
8085
8085
|
* @LastEditors: binruan@chatlabs.com
|
8086
|
-
* @LastEditTime: 2024-04-
|
8086
|
+
* @LastEditTime: 2024-04-15 09:47:08
|
8087
8087
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
8088
8088
|
*
|
8089
8089
|
*/
|
8090
8090
|
function useEventReport() {
|
8091
8091
|
const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = useSxpDataSource();
|
8092
|
-
const jumpToWeb = useCallback((data, product, cta) => {
|
8092
|
+
const jumpToWeb = useCallback((data, product, cta, position) => {
|
8093
8093
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
8094
8094
|
let fromKName = '';
|
8095
8095
|
if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
@@ -8118,14 +8118,14 @@ function useEventReport() {
|
|
8118
8118
|
fromKName,
|
8119
8119
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
8120
8120
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
8121
|
-
position:
|
8121
|
+
position: position + '',
|
8122
8122
|
relatedContentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
|
8123
8123
|
relatedCtatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
|
8124
8124
|
traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
|
8125
8125
|
}
|
8126
8126
|
});
|
8127
8127
|
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
8128
|
-
const productView = useCallback((data, product, cta, viewTime) => {
|
8128
|
+
const productView = useCallback((data, product, cta, viewTime, position) => {
|
8129
8129
|
var _a, _b, _c, _d;
|
8130
8130
|
let fromKName = '';
|
8131
8131
|
if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
@@ -8143,7 +8143,7 @@ function useEventReport() {
|
|
8143
8143
|
fromKName,
|
8144
8144
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
8145
8145
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
8146
|
-
position:
|
8146
|
+
position: position + '',
|
8147
8147
|
relatedContentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
8148
8148
|
relatedCtatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
8149
8149
|
traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
|
@@ -8286,7 +8286,7 @@ var ExpandableText$1 = memo(ExpandableText);
|
|
8286
8286
|
|
8287
8287
|
const CommodityDetail$1 = (_a) => {
|
8288
8288
|
var _b, _c, _d, _e, _f, _g, _h, _j;
|
8289
|
-
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle"]);
|
8289
|
+
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index"]);
|
8290
8290
|
const { sxpParameter } = useSxpDataSource();
|
8291
8291
|
const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
|
8292
8292
|
const { jumpToWeb, productView } = useEventReport();
|
@@ -8295,11 +8295,12 @@ const CommodityDetail$1 = (_a) => {
|
|
8295
8295
|
const data = isPost ? rec : popupDetailData;
|
8296
8296
|
const product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
8297
8297
|
const cta = isPost ? (_c = data === null || data === void 0 ? void 0 : data.product) === null || _c === void 0 ? void 0 : _c.bindCta : (_e = (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.bindProduct) === null || _e === void 0 ? void 0 : _e.bindCta;
|
8298
|
+
const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
8298
8299
|
const handleLink = () => {
|
8299
8300
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
8300
|
-
jumpToWeb(popupDetailData, product, cta);
|
8301
|
+
jumpToWeb(popupDetailData, product, cta, position);
|
8301
8302
|
if (!isPost) {
|
8302
|
-
productView(data, product, cta, viewTime || curTimeRef.current);
|
8303
|
+
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
8303
8304
|
}
|
8304
8305
|
window.location.href = window.getJointUtmLink(product.link);
|
8305
8306
|
}
|
@@ -8736,7 +8737,7 @@ var settingRender$2 = [
|
|
8736
8737
|
|
8737
8738
|
const CommodityDetailDiroNew$1 = (_a) => {
|
8738
8739
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
8739
|
-
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle"]);
|
8740
|
+
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index"]);
|
8740
8741
|
useState(true);
|
8741
8742
|
const { sxpParameter } = useSxpDataSource();
|
8742
8743
|
const { popupDetailData, bffEventReport, isPreview, swiperRef, waterFallData } = useSxpDataSource();
|
@@ -8752,11 +8753,12 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
8752
8753
|
const data = isPost ? rec : popupDetailData;
|
8753
8754
|
const product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
8754
8755
|
const cta = isPost ? (_c = data === null || data === void 0 ? void 0 : data.product) === null || _c === void 0 ? void 0 : _c.bindCta : (_e = (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.bindProduct) === null || _e === void 0 ? void 0 : _e.bindCta;
|
8756
|
+
const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
8755
8757
|
const handleLink = () => {
|
8756
8758
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
8757
|
-
jumpToWeb(data, product, cta);
|
8759
|
+
jumpToWeb(data, product, cta, position);
|
8758
8760
|
if (!isPost) {
|
8759
|
-
productView(data, product, cta, viewTime || curTimeRef.current);
|
8761
|
+
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
8760
8762
|
}
|
8761
8763
|
window.location.href = window.getJointUtmLink(product.link);
|
8762
8764
|
}
|
@@ -9169,7 +9171,7 @@ function useOnScreen(ref) {
|
|
9169
9171
|
}
|
9170
9172
|
|
9171
9173
|
const EventProvider = (_a) => {
|
9172
|
-
var { rec, children, className, onClick, style, isExternalLink = false } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink"]);
|
9174
|
+
var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
|
9173
9175
|
const ref = useRef(null);
|
9174
9176
|
const isOnScreen = useOnScreen(ref);
|
9175
9177
|
const { popup } = useEditor();
|
@@ -9182,23 +9184,24 @@ const EventProvider = (_a) => {
|
|
9182
9184
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9183
9185
|
eventSubject: 'ctaExposure',
|
9184
9186
|
eventDescription: 'The cta was shown to the user'
|
9185
|
-
}, rec, item);
|
9187
|
+
}, rec, item, index);
|
9186
9188
|
}
|
9187
|
-
}, [isOnScreen, ref, rec, ctaEvent]);
|
9189
|
+
}, [isOnScreen, ref, rec, ctaEvent, index]);
|
9188
9190
|
const handleClick = throttle(() => {
|
9189
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
9191
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
9190
9192
|
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;
|
9191
9193
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9192
9194
|
eventSubject: 'clickCta',
|
9193
9195
|
eventDescription: 'User clicked the CTA'
|
9194
|
-
}, rec, item);
|
9195
|
-
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(rec);
|
9196
|
+
}, rec, item, index);
|
9197
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
9196
9198
|
if (isExternalLink) {
|
9197
9199
|
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) {
|
9198
9200
|
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
9199
9201
|
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
9200
|
-
jumpToWeb(rec, product, cta);
|
9202
|
+
jumpToWeb(rec, product, cta, index);
|
9201
9203
|
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;
|
9204
|
+
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);
|
9202
9205
|
}
|
9203
9206
|
}
|
9204
9207
|
else {
|
@@ -9367,18 +9370,18 @@ var styles$5 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__nkBlU"};
|
|
9367
9370
|
|
9368
9371
|
const Link$1 = (_a) => {
|
9369
9372
|
var _b, _c, _d, _e, _f;
|
9370
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
9373
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index"]);
|
9371
9374
|
const { sxpParameter, bffEventReport } = useSxpDataSource();
|
9372
9375
|
const { jumpToWeb } = useEventReport();
|
9373
9376
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
9374
9377
|
const product = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
|
9375
9378
|
const handleTo = () => {
|
9376
9379
|
if (cta === null || cta === void 0 ? void 0 : cta.link) {
|
9377
|
-
jumpToWeb(recData, product, cta);
|
9380
|
+
jumpToWeb(recData, product, cta, index);
|
9378
9381
|
window.location.href = window.getJointUtmLink(cta.link);
|
9379
9382
|
}
|
9380
9383
|
};
|
9381
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
|
9384
|
+
return (React.createElement(EventProvider$1, Object.assign({ index: index, rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
|
9382
9385
|
React.createElement("div", { className: css(Object.assign({ backgroundColor: '#f2f2f2', overflow: 'hidden', flexShrink: 0 }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9383
9386
|
React.createElement("img", { className: 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: '' })),
|
9384
9387
|
React.createElement("div", { className: css({
|
@@ -9646,11 +9649,11 @@ var Scroll$1 = memo(Scroll);
|
|
9646
9649
|
* @Author: binruan@chatlabs.com
|
9647
9650
|
* @Date: 2024-01-16 14:50:13
|
9648
9651
|
* @LastEditors: binruan@chatlabs.com
|
9649
|
-
* @LastEditTime: 2024-
|
9652
|
+
* @LastEditTime: 2024-04-11 18:24:15
|
9650
9653
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
9651
9654
|
*
|
9652
9655
|
*/
|
9653
|
-
const Img = ({ src, rec, item }) => {
|
9656
|
+
const Img = ({ src, rec, item, index }) => {
|
9654
9657
|
const ref = useRef(null);
|
9655
9658
|
const isOnScreen = useOnScreen(ref);
|
9656
9659
|
const { ctaEvent } = useSxpDataSource();
|
@@ -9659,9 +9662,9 @@ const Img = ({ src, rec, item }) => {
|
|
9659
9662
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9660
9663
|
eventSubject: 'ctaExposure',
|
9661
9664
|
eventDescription: 'The cta was shown to the user'
|
9662
|
-
}, rec, item);
|
9665
|
+
}, rec, item, index);
|
9663
9666
|
}
|
9664
|
-
}, [isOnScreen, src, ref, rec, ctaEvent, item]);
|
9667
|
+
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
9665
9668
|
return (React.createElement("img", { ref: ref, hidden: !src, className: css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, alt: '' }));
|
9666
9669
|
};
|
9667
9670
|
var Img$1 = memo(Img);
|
@@ -9670,7 +9673,7 @@ var styles$2 = {"two-line-ellipsis":"index-module_two-line-ellipsis__SFQwJ"};
|
|
9670
9673
|
|
9671
9674
|
const MultiCommodityDiro$1 = (_a) => {
|
9672
9675
|
var _b, _c;
|
9673
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9676
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
|
9674
9677
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
9675
9678
|
const { popup } = useEditor();
|
9676
9679
|
const { jumpToWeb } = useEventReport();
|
@@ -9679,12 +9682,12 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
9679
9682
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9680
9683
|
eventSubject: 'clickCta',
|
9681
9684
|
eventDescription: 'User clicked the CTA'
|
9682
|
-
}, recData, item);
|
9683
|
-
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 }) }));
|
9685
|
+
}, recData, item, index);
|
9686
|
+
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 }));
|
9684
9687
|
if (isExternalLink) {
|
9685
9688
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
9686
|
-
jumpToWeb(recData, item, item.bindCta);
|
9687
|
-
window.location.href = item.link;
|
9689
|
+
jumpToWeb(recData, item, item.bindCta, index);
|
9690
|
+
window.location.href = window.getJointUtmLink(item.link);
|
9688
9691
|
}
|
9689
9692
|
}
|
9690
9693
|
else {
|
@@ -9695,7 +9698,7 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
9695
9698
|
var _a, _b, _c, _d, _e, _f;
|
9696
9699
|
return (React.createElement(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: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
9697
9700
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9698
|
-
React.createElement(Img$1, { 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 })),
|
9701
|
+
React.createElement(Img$1, { 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 })),
|
9699
9702
|
React.createElement("div", { className: css({
|
9700
9703
|
color: '#000',
|
9701
9704
|
display: 'flex',
|
@@ -9782,7 +9785,7 @@ var styles$1 = {"two-line-ellipsis":"index-module_two-line-ellipsis__mdzn0"};
|
|
9782
9785
|
|
9783
9786
|
const MultiCommodity$1 = (_a) => {
|
9784
9787
|
var _b, _c;
|
9785
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9788
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
|
9786
9789
|
const { sxpParameter } = useSxpDataSource();
|
9787
9790
|
const { ctaEvent, setPopupDetailData } = useSxpDataSource();
|
9788
9791
|
const { popup } = useEditor();
|
@@ -9792,12 +9795,12 @@ const MultiCommodity$1 = (_a) => {
|
|
9792
9795
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9793
9796
|
eventSubject: 'clickCta',
|
9794
9797
|
eventDescription: 'User clicked the CTA'
|
9795
|
-
}, recData, item);
|
9796
|
-
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 }) }));
|
9798
|
+
}, recData, item, index);
|
9799
|
+
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 }));
|
9797
9800
|
if (isExternalLink) {
|
9798
9801
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
9799
|
-
jumpToWeb(recData, item, item.bindCta);
|
9800
|
-
window.location.href = item.link;
|
9802
|
+
jumpToWeb(recData, item, item.bindCta, index);
|
9803
|
+
window.location.href = window.getJointUtmLink(item.link);
|
9801
9804
|
}
|
9802
9805
|
}
|
9803
9806
|
else {
|
@@ -9808,7 +9811,7 @@ const MultiCommodity$1 = (_a) => {
|
|
9808
9811
|
var _a, _b, _c, _d, _e, _f;
|
9809
9812
|
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
9810
9813
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9811
|
-
React.createElement(Img$1, { 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 })),
|
9814
|
+
React.createElement(Img$1, { 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 })),
|
9812
9815
|
React.createElement("div", { className: css({
|
9813
9816
|
color: '#fff',
|
9814
9817
|
display: 'flex',
|
@@ -9895,7 +9898,7 @@ var styles = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__fselR"};
|
|
9895
9898
|
|
9896
9899
|
const MultiCommodityDiroNew$1 = (_a) => {
|
9897
9900
|
var _b, _c;
|
9898
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9901
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
|
9899
9902
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
9900
9903
|
const { popup } = useEditor();
|
9901
9904
|
const { jumpToWeb } = useEventReport();
|
@@ -9904,12 +9907,12 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
9904
9907
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9905
9908
|
eventSubject: 'clickCta',
|
9906
9909
|
eventDescription: 'User clicked the CTA'
|
9907
|
-
}, recData, item);
|
9908
|
-
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 }) }));
|
9910
|
+
}, recData, item, index);
|
9911
|
+
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 }));
|
9909
9912
|
if (isExternalLink) {
|
9910
9913
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
9911
|
-
jumpToWeb(recData, item, item.bindCta);
|
9912
|
-
window.location.href = item.link;
|
9914
|
+
jumpToWeb(recData, item, item.bindCta, index);
|
9915
|
+
window.location.href = window.getJointUtmLink(item.link);
|
9913
9916
|
}
|
9914
9917
|
}
|
9915
9918
|
else {
|
@@ -9920,7 +9923,7 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
9920
9923
|
var _a, _b, _c, _d, _e, _f;
|
9921
9924
|
return (React.createElement(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: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
9922
9925
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9923
|
-
React.createElement(Img$1, { 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 })),
|
9926
|
+
React.createElement(Img$1, { 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 })),
|
9924
9927
|
React.createElement("div", { className: css({
|
9925
9928
|
color: '#fff',
|
9926
9929
|
display: 'flex',
|
@@ -11566,7 +11569,7 @@ const WaterfallFlowItem = (props) => {
|
|
11566
11569
|
};
|
11567
11570
|
}, [src, showVideo]);
|
11568
11571
|
const handleClickToDetail = () => {
|
11569
|
-
reportTagsView();
|
11572
|
+
reportTagsView(index);
|
11570
11573
|
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(list);
|
11571
11574
|
setTimeout(() => {
|
11572
11575
|
var _a;
|
@@ -11674,7 +11677,7 @@ var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeA
|
|
11674
11677
|
* @Author: binruan@chatlabs.com
|
11675
11678
|
* @Date: 2024-01-10 10:58:24
|
11676
11679
|
* @LastEditors: binruan@chatlabs.com
|
11677
|
-
* @LastEditTime: 2024-04-
|
11680
|
+
* @LastEditTime: 2024-04-15 09:58:50
|
11678
11681
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
11679
11682
|
*
|
11680
11683
|
*/
|
@@ -11701,7 +11704,7 @@ const WaterFall = (props) => {
|
|
11701
11704
|
if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
|
11702
11705
|
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
|
11703
11706
|
}
|
11704
|
-
reportTagsView();
|
11707
|
+
reportTagsView(0);
|
11705
11708
|
setWaterFallData === null || setWaterFallData === void 0 ? void 0 : setWaterFallData(undefined);
|
11706
11709
|
setIsFromHashtag === null || setIsFromHashtag === void 0 ? void 0 : setIsFromHashtag(false);
|
11707
11710
|
setTimeout(() => {
|
@@ -11718,7 +11721,7 @@ const WaterFall = (props) => {
|
|
11718
11721
|
setRecData(waterFallData);
|
11719
11722
|
}
|
11720
11723
|
}, [waterFallData]);
|
11721
|
-
const reportTagsView = useCallback(() => {
|
11724
|
+
const reportTagsView = useCallback((index) => {
|
11722
11725
|
var _a, _b, _c, _d, _e, _f;
|
11723
11726
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
11724
11727
|
if (!rec)
|
@@ -11736,7 +11739,7 @@ const WaterFall = (props) => {
|
|
11736
11739
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
11737
11740
|
eventInfo: {
|
11738
11741
|
relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
11739
|
-
position:
|
11742
|
+
position: index + '',
|
11740
11743
|
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
11741
11744
|
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
11742
11745
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
@@ -11871,7 +11874,7 @@ var _materials_ = /*#__PURE__*/Object.freeze({
|
|
11871
11874
|
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
11872
11875
|
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
11873
11876
|
const LikeButton = (_a) => {
|
11874
|
-
var { active, activeIcon, unActicveIcon, recData } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData"]);
|
11877
|
+
var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
|
11875
11878
|
const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
|
11876
11879
|
const [state, setState] = useState(active);
|
11877
11880
|
const likeIcon = useIconLink(defaultLikeIconPath);
|
@@ -11889,7 +11892,7 @@ const LikeButton = (_a) => {
|
|
11889
11892
|
contentId: (_f = (_e = recData.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
|
11890
11893
|
contentName: (_h = (_g = recData.video) === null || _g === void 0 ? void 0 : _g.title) !== null && _h !== void 0 ? _h : '',
|
11891
11894
|
contentTags: JSON.stringify((_k = (_j = recData.video) === null || _j === void 0 ? void 0 : _j.tags) !== null && _k !== void 0 ? _k : []),
|
11892
|
-
position:
|
11895
|
+
position: position + '',
|
11893
11896
|
contentFormat: ((_l = recData.video) === null || _l === void 0 ? void 0 : _l.url) ? 'video' : 'image',
|
11894
11897
|
traceInfo: (_m = recData.video) === null || _m === void 0 ? void 0 : _m.traceInfo
|
11895
11898
|
}
|
@@ -11909,7 +11912,7 @@ const LikeButton = (_a) => {
|
|
11909
11912
|
contentId: (_q = (_p = recData.video) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : '',
|
11910
11913
|
contentName: (_s = (_r = recData.video) === null || _r === void 0 ? void 0 : _r.title) !== null && _s !== void 0 ? _s : '',
|
11911
11914
|
contentTags: JSON.stringify((_u = (_t = recData.video) === null || _t === void 0 ? void 0 : _t.tags) !== null && _u !== void 0 ? _u : []),
|
11912
|
-
position:
|
11915
|
+
position: position + '',
|
11913
11916
|
contentFormat: ((_v = recData.video) === null || _v === void 0 ? void 0 : _v.url) ? 'video' : 'image',
|
11914
11917
|
traceInfo: (_w = recData.video) === null || _w === void 0 ? void 0 : _w.traceInfo
|
11915
11918
|
}
|
@@ -11967,7 +11970,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
11967
11970
|
startTime: videoCurrentTime,
|
11968
11971
|
videoDuration,
|
11969
11972
|
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
11970
|
-
position:
|
11973
|
+
position: index + '',
|
11971
11974
|
contentFormat: 'video',
|
11972
11975
|
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
11973
11976
|
}
|
@@ -11995,7 +11998,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
11995
11998
|
startTime: videoCurrentTime,
|
11996
11999
|
videoDuration,
|
11997
12000
|
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
11998
|
-
position:
|
12001
|
+
position: index + '',
|
11999
12002
|
contentFormat: 'video',
|
12000
12003
|
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
12001
12004
|
}
|
@@ -12055,7 +12058,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
12055
12058
|
videoDuration,
|
12056
12059
|
playDuration,
|
12057
12060
|
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
12058
|
-
position:
|
12061
|
+
position: index + '',
|
12059
12062
|
contentFormat: 'video',
|
12060
12063
|
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
12061
12064
|
}
|
@@ -12403,7 +12406,7 @@ function withBindDataSource(Component) {
|
|
12403
12406
|
* @Author: binruan@chatlabs.com
|
12404
12407
|
* @Date: 2023-12-26 16:11:34
|
12405
12408
|
* @LastEditors: binruan@chatlabs.com
|
12406
|
-
* @LastEditTime: 2024-04-
|
12409
|
+
* @LastEditTime: 2024-04-11 18:14:05
|
12407
12410
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
12408
12411
|
*
|
12409
12412
|
*/
|
@@ -12437,7 +12440,7 @@ const RenderCard = ({ rec, index, tempMap, resolver }) => {
|
|
12437
12440
|
const Component = withBindDataSource(t);
|
12438
12441
|
const defaulSetting = (_x = t === null || t === void 0 ? void 0 : t.extend) === null || _x === void 0 ? void 0 : _x.defaulSetting;
|
12439
12442
|
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';
|
12440
|
-
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 })));
|
12443
|
+
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, index: index })));
|
12441
12444
|
}
|
12442
12445
|
else {
|
12443
12446
|
return null;
|
@@ -12463,7 +12466,7 @@ const Nudge = ({ nudge }) => {
|
|
12463
12466
|
* @Author: binruan@chatlabs.com
|
12464
12467
|
* @Date: 2024-01-15 19:03:09
|
12465
12468
|
* @LastEditors: binruan@chatlabs.com
|
12466
|
-
* @LastEditTime: 2024-04-
|
12469
|
+
* @LastEditTime: 2024-04-11 18:45:44
|
12467
12470
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
12468
12471
|
*
|
12469
12472
|
*/
|
@@ -12591,7 +12594,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12591
12594
|
eventDescription: 'Session completed',
|
12592
12595
|
relatedContentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
|
12593
12596
|
relatedProductId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
|
12594
|
-
position:
|
12597
|
+
position: activeIndex,
|
12595
12598
|
fromKName,
|
12596
12599
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
12597
12600
|
relatedCtatId: (_q = (_p = (_o = item.video) === null || _o === void 0 ? void 0 : _o.bindCta) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : ''
|
@@ -12634,7 +12637,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12634
12637
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
12635
12638
|
const Component = withBindDataSource(t);
|
12636
12639
|
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
12637
|
-
return (React.createElement(Component, Object.assign({ key: index, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }) })));
|
12640
|
+
return (React.createElement(Component, Object.assign({ key: index, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }), index: index })));
|
12638
12641
|
});
|
12639
12642
|
}
|
12640
12643
|
return null;
|
@@ -12653,7 +12656,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12653
12656
|
}
|
12654
12657
|
return null;
|
12655
12658
|
}, [descStyle, activeIndex, tempMap, resolver, tipText, nudge, hashTagStyle]);
|
12656
|
-
const renderLikeButton = useCallback((rec) => {
|
12659
|
+
const renderLikeButton = useCallback((rec, index) => {
|
12657
12660
|
var _a, _b;
|
12658
12661
|
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
|
12659
12662
|
return;
|
@@ -12665,7 +12668,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12665
12668
|
return (React.createElement(LikeButton$1, { key: rec.position, activeIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIcon, unActicveIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unlikeIcon, active: rec.isCollected, recData: rec, className: 'clc-sxp-like-button', style: {
|
12666
12669
|
top,
|
12667
12670
|
right: (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _b !== void 0 ? _b : 0
|
12668
|
-
} }));
|
12671
|
+
}, position: index }));
|
12669
12672
|
}
|
12670
12673
|
return null;
|
12671
12674
|
}, [globalConfig, waterFallData]);
|
@@ -12683,7 +12686,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12683
12686
|
imageEndTime: `${endTime}`,
|
12684
12687
|
playDuration: `${duration}`,
|
12685
12688
|
contentTags: JSON.stringify((_f = item.video.tags) !== null && _f !== void 0 ? _f : []),
|
12686
|
-
position:
|
12689
|
+
position: activeIndex,
|
12687
12690
|
contentFormat: 'image',
|
12688
12691
|
traceInfo: item.video.traceInfo
|
12689
12692
|
}
|
@@ -12728,7 +12731,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12728
12731
|
const handleReportProductView = (item) => {
|
12729
12732
|
var _a, _b, _c;
|
12730
12733
|
if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && !((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls) && (item === null || item === void 0 ? void 0 : item.product)) {
|
12731
|
-
productView(item, item.product, (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.bindCta, viewTime.current);
|
12734
|
+
productView(item, item.product, (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.bindCta, viewTime.current, activeIndex);
|
12732
12735
|
}
|
12733
12736
|
};
|
12734
12737
|
useEffect(() => {
|
@@ -12751,7 +12754,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12751
12754
|
contentName: (_e = item.video.title) !== null && _e !== void 0 ? _e : '',
|
12752
12755
|
imageStartTime: `${startTime}`,
|
12753
12756
|
contentTags: JSON.stringify((_f = item.video.tags) !== null && _f !== void 0 ? _f : []),
|
12754
|
-
position:
|
12757
|
+
position: activeIndex,
|
12755
12758
|
contentFormat: 'image',
|
12756
12759
|
traceInfo: item.video.traceInfo
|
12757
12760
|
}
|
@@ -12785,7 +12788,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12785
12788
|
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement(React.Fragment, null,
|
12786
12789
|
renderContent(rec, index),
|
12787
12790
|
renderBottom(rec, index),
|
12788
|
-
renderLikeButton(rec)))))));
|
12791
|
+
renderLikeButton(rec, index)))))));
|
12789
12792
|
});
|
12790
12793
|
}, [containerWidth, data, height, loading, renderBottom, renderContent, visList, loadingImage]);
|
12791
12794
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
@@ -12842,7 +12845,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12842
12845
|
* @Author: binruan@chatlabs.com
|
12843
12846
|
* @Date: 2023-10-31 10:56:01
|
12844
12847
|
* @LastEditors: binruan@chatlabs.com
|
12845
|
-
* @LastEditTime: 2024-04-
|
12848
|
+
* @LastEditTime: 2024-04-15 09:39:17
|
12846
12849
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
12847
12850
|
*
|
12848
12851
|
*/
|
@@ -12878,7 +12881,7 @@ const Popup = () => {
|
|
12878
12881
|
const product = (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
12879
12882
|
const cta = (_d = (_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.bindCta;
|
12880
12883
|
if (product && cta) {
|
12881
|
-
productView(data, product, cta, curTimeRef.current);
|
12884
|
+
productView(data, product, cta, curTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
|
12882
12885
|
}
|
12883
12886
|
setTimeout(() => {
|
12884
12887
|
window === null || window === void 0 ? void 0 : window.sxpPopup('');
|