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
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,22 +9184,22 @@ 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
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;
|
9202
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);
|
9203
9205
|
}
|
@@ -9368,18 +9370,18 @@ var styles$5 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__nkBlU"};
|
|
9368
9370
|
|
9369
9371
|
const Link$1 = (_a) => {
|
9370
9372
|
var _b, _c, _d, _e, _f;
|
9371
|
-
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"]);
|
9372
9374
|
const { sxpParameter, bffEventReport } = useSxpDataSource();
|
9373
9375
|
const { jumpToWeb } = useEventReport();
|
9374
9376
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
9375
9377
|
const product = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
|
9376
9378
|
const handleTo = () => {
|
9377
9379
|
if (cta === null || cta === void 0 ? void 0 : cta.link) {
|
9378
|
-
jumpToWeb(recData, product, cta);
|
9380
|
+
jumpToWeb(recData, product, cta, index);
|
9379
9381
|
window.location.href = window.getJointUtmLink(cta.link);
|
9380
9382
|
}
|
9381
9383
|
};
|
9382
|
-
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 }),
|
9383
9385
|
React.createElement("div", { className: css(Object.assign({ backgroundColor: '#f2f2f2', overflow: 'hidden', flexShrink: 0 }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9384
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: '' })),
|
9385
9387
|
React.createElement("div", { className: css({
|
@@ -9647,11 +9649,11 @@ var Scroll$1 = memo(Scroll);
|
|
9647
9649
|
* @Author: binruan@chatlabs.com
|
9648
9650
|
* @Date: 2024-01-16 14:50:13
|
9649
9651
|
* @LastEditors: binruan@chatlabs.com
|
9650
|
-
* @LastEditTime: 2024-
|
9652
|
+
* @LastEditTime: 2024-04-11 18:24:15
|
9651
9653
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
9652
9654
|
*
|
9653
9655
|
*/
|
9654
|
-
const Img = ({ src, rec, item }) => {
|
9656
|
+
const Img = ({ src, rec, item, index }) => {
|
9655
9657
|
const ref = useRef(null);
|
9656
9658
|
const isOnScreen = useOnScreen(ref);
|
9657
9659
|
const { ctaEvent } = useSxpDataSource();
|
@@ -9660,9 +9662,9 @@ const Img = ({ src, rec, item }) => {
|
|
9660
9662
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9661
9663
|
eventSubject: 'ctaExposure',
|
9662
9664
|
eventDescription: 'The cta was shown to the user'
|
9663
|
-
}, rec, item);
|
9665
|
+
}, rec, item, index);
|
9664
9666
|
}
|
9665
|
-
}, [isOnScreen, src, ref, rec, ctaEvent, item]);
|
9667
|
+
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
9666
9668
|
return (React.createElement("img", { ref: ref, hidden: !src, className: css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, alt: '' }));
|
9667
9669
|
};
|
9668
9670
|
var Img$1 = memo(Img);
|
@@ -9671,7 +9673,7 @@ var styles$2 = {"two-line-ellipsis":"index-module_two-line-ellipsis__SFQwJ"};
|
|
9671
9673
|
|
9672
9674
|
const MultiCommodityDiro$1 = (_a) => {
|
9673
9675
|
var _b, _c;
|
9674
|
-
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"]);
|
9675
9677
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
9676
9678
|
const { popup } = useEditor();
|
9677
9679
|
const { jumpToWeb } = useEventReport();
|
@@ -9680,11 +9682,11 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
9680
9682
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9681
9683
|
eventSubject: 'clickCta',
|
9682
9684
|
eventDescription: 'User clicked the CTA'
|
9683
|
-
}, recData, item);
|
9684
|
-
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 }));
|
9685
9687
|
if (isExternalLink) {
|
9686
9688
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
9687
|
-
jumpToWeb(recData, item, item.bindCta);
|
9689
|
+
jumpToWeb(recData, item, item.bindCta, index);
|
9688
9690
|
window.location.href = window.getJointUtmLink(item.link);
|
9689
9691
|
}
|
9690
9692
|
}
|
@@ -9696,7 +9698,7 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
9696
9698
|
var _a, _b, _c, _d, _e, _f;
|
9697
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) }),
|
9698
9700
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9699
|
-
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 })),
|
9700
9702
|
React.createElement("div", { className: css({
|
9701
9703
|
color: '#000',
|
9702
9704
|
display: 'flex',
|
@@ -9783,7 +9785,7 @@ var styles$1 = {"two-line-ellipsis":"index-module_two-line-ellipsis__mdzn0"};
|
|
9783
9785
|
|
9784
9786
|
const MultiCommodity$1 = (_a) => {
|
9785
9787
|
var _b, _c;
|
9786
|
-
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"]);
|
9787
9789
|
const { sxpParameter } = useSxpDataSource();
|
9788
9790
|
const { ctaEvent, setPopupDetailData } = useSxpDataSource();
|
9789
9791
|
const { popup } = useEditor();
|
@@ -9793,11 +9795,11 @@ const MultiCommodity$1 = (_a) => {
|
|
9793
9795
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9794
9796
|
eventSubject: 'clickCta',
|
9795
9797
|
eventDescription: 'User clicked the CTA'
|
9796
|
-
}, recData, item);
|
9797
|
-
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 }));
|
9798
9800
|
if (isExternalLink) {
|
9799
9801
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
9800
|
-
jumpToWeb(recData, item, item.bindCta);
|
9802
|
+
jumpToWeb(recData, item, item.bindCta, index);
|
9801
9803
|
window.location.href = window.getJointUtmLink(item.link);
|
9802
9804
|
}
|
9803
9805
|
}
|
@@ -9809,7 +9811,7 @@ const MultiCommodity$1 = (_a) => {
|
|
9809
9811
|
var _a, _b, _c, _d, _e, _f;
|
9810
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) }),
|
9811
9813
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9812
|
-
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 })),
|
9813
9815
|
React.createElement("div", { className: css({
|
9814
9816
|
color: '#fff',
|
9815
9817
|
display: 'flex',
|
@@ -9896,7 +9898,7 @@ var styles = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__fselR"};
|
|
9896
9898
|
|
9897
9899
|
const MultiCommodityDiroNew$1 = (_a) => {
|
9898
9900
|
var _b, _c;
|
9899
|
-
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"]);
|
9900
9902
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
9901
9903
|
const { popup } = useEditor();
|
9902
9904
|
const { jumpToWeb } = useEventReport();
|
@@ -9905,11 +9907,11 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
9905
9907
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9906
9908
|
eventSubject: 'clickCta',
|
9907
9909
|
eventDescription: 'User clicked the CTA'
|
9908
|
-
}, recData, item);
|
9909
|
-
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 }));
|
9910
9912
|
if (isExternalLink) {
|
9911
9913
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
9912
|
-
jumpToWeb(recData, item, item.bindCta);
|
9914
|
+
jumpToWeb(recData, item, item.bindCta, index);
|
9913
9915
|
window.location.href = window.getJointUtmLink(item.link);
|
9914
9916
|
}
|
9915
9917
|
}
|
@@ -9921,7 +9923,7 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
9921
9923
|
var _a, _b, _c, _d, _e, _f;
|
9922
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) }),
|
9923
9925
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9924
|
-
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 })),
|
9925
9927
|
React.createElement("div", { className: css({
|
9926
9928
|
color: '#fff',
|
9927
9929
|
display: 'flex',
|
@@ -11567,7 +11569,7 @@ const WaterfallFlowItem = (props) => {
|
|
11567
11569
|
};
|
11568
11570
|
}, [src, showVideo]);
|
11569
11571
|
const handleClickToDetail = () => {
|
11570
|
-
reportTagsView();
|
11572
|
+
reportTagsView(index);
|
11571
11573
|
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(list);
|
11572
11574
|
setTimeout(() => {
|
11573
11575
|
var _a;
|
@@ -11675,7 +11677,7 @@ var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeA
|
|
11675
11677
|
* @Author: binruan@chatlabs.com
|
11676
11678
|
* @Date: 2024-01-10 10:58:24
|
11677
11679
|
* @LastEditors: binruan@chatlabs.com
|
11678
|
-
* @LastEditTime: 2024-04-
|
11680
|
+
* @LastEditTime: 2024-04-15 09:58:50
|
11679
11681
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
11680
11682
|
*
|
11681
11683
|
*/
|
@@ -11702,7 +11704,7 @@ const WaterFall = (props) => {
|
|
11702
11704
|
if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
|
11703
11705
|
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
|
11704
11706
|
}
|
11705
|
-
reportTagsView();
|
11707
|
+
reportTagsView(0);
|
11706
11708
|
setWaterFallData === null || setWaterFallData === void 0 ? void 0 : setWaterFallData(undefined);
|
11707
11709
|
setIsFromHashtag === null || setIsFromHashtag === void 0 ? void 0 : setIsFromHashtag(false);
|
11708
11710
|
setTimeout(() => {
|
@@ -11719,7 +11721,7 @@ const WaterFall = (props) => {
|
|
11719
11721
|
setRecData(waterFallData);
|
11720
11722
|
}
|
11721
11723
|
}, [waterFallData]);
|
11722
|
-
const reportTagsView = useCallback(() => {
|
11724
|
+
const reportTagsView = useCallback((index) => {
|
11723
11725
|
var _a, _b, _c, _d, _e, _f;
|
11724
11726
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
11725
11727
|
if (!rec)
|
@@ -11737,7 +11739,7 @@ const WaterFall = (props) => {
|
|
11737
11739
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
11738
11740
|
eventInfo: {
|
11739
11741
|
relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
11740
|
-
position:
|
11742
|
+
position: index + '',
|
11741
11743
|
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
11742
11744
|
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
11743
11745
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
@@ -11872,7 +11874,7 @@ var _materials_ = /*#__PURE__*/Object.freeze({
|
|
11872
11874
|
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
11873
11875
|
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
11874
11876
|
const LikeButton = (_a) => {
|
11875
|
-
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"]);
|
11876
11878
|
const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
|
11877
11879
|
const [state, setState] = useState(active);
|
11878
11880
|
const likeIcon = useIconLink(defaultLikeIconPath);
|
@@ -11890,7 +11892,7 @@ const LikeButton = (_a) => {
|
|
11890
11892
|
contentId: (_f = (_e = recData.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
|
11891
11893
|
contentName: (_h = (_g = recData.video) === null || _g === void 0 ? void 0 : _g.title) !== null && _h !== void 0 ? _h : '',
|
11892
11894
|
contentTags: JSON.stringify((_k = (_j = recData.video) === null || _j === void 0 ? void 0 : _j.tags) !== null && _k !== void 0 ? _k : []),
|
11893
|
-
position:
|
11895
|
+
position: position + '',
|
11894
11896
|
contentFormat: ((_l = recData.video) === null || _l === void 0 ? void 0 : _l.url) ? 'video' : 'image',
|
11895
11897
|
traceInfo: (_m = recData.video) === null || _m === void 0 ? void 0 : _m.traceInfo
|
11896
11898
|
}
|
@@ -11910,7 +11912,7 @@ const LikeButton = (_a) => {
|
|
11910
11912
|
contentId: (_q = (_p = recData.video) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : '',
|
11911
11913
|
contentName: (_s = (_r = recData.video) === null || _r === void 0 ? void 0 : _r.title) !== null && _s !== void 0 ? _s : '',
|
11912
11914
|
contentTags: JSON.stringify((_u = (_t = recData.video) === null || _t === void 0 ? void 0 : _t.tags) !== null && _u !== void 0 ? _u : []),
|
11913
|
-
position:
|
11915
|
+
position: position + '',
|
11914
11916
|
contentFormat: ((_v = recData.video) === null || _v === void 0 ? void 0 : _v.url) ? 'video' : 'image',
|
11915
11917
|
traceInfo: (_w = recData.video) === null || _w === void 0 ? void 0 : _w.traceInfo
|
11916
11918
|
}
|
@@ -11968,7 +11970,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
11968
11970
|
startTime: videoCurrentTime,
|
11969
11971
|
videoDuration,
|
11970
11972
|
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
11971
|
-
position:
|
11973
|
+
position: index + '',
|
11972
11974
|
contentFormat: 'video',
|
11973
11975
|
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
11974
11976
|
}
|
@@ -11996,7 +11998,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
11996
11998
|
startTime: videoCurrentTime,
|
11997
11999
|
videoDuration,
|
11998
12000
|
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
11999
|
-
position:
|
12001
|
+
position: index + '',
|
12000
12002
|
contentFormat: 'video',
|
12001
12003
|
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
12002
12004
|
}
|
@@ -12056,7 +12058,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
12056
12058
|
videoDuration,
|
12057
12059
|
playDuration,
|
12058
12060
|
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
12059
|
-
position:
|
12061
|
+
position: index + '',
|
12060
12062
|
contentFormat: 'video',
|
12061
12063
|
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
12062
12064
|
}
|
@@ -12404,7 +12406,7 @@ function withBindDataSource(Component) {
|
|
12404
12406
|
* @Author: binruan@chatlabs.com
|
12405
12407
|
* @Date: 2023-12-26 16:11:34
|
12406
12408
|
* @LastEditors: binruan@chatlabs.com
|
12407
|
-
* @LastEditTime: 2024-04-
|
12409
|
+
* @LastEditTime: 2024-04-11 18:14:05
|
12408
12410
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
12409
12411
|
*
|
12410
12412
|
*/
|
@@ -12438,7 +12440,7 @@ const RenderCard = ({ rec, index, tempMap, resolver }) => {
|
|
12438
12440
|
const Component = withBindDataSource(t);
|
12439
12441
|
const defaulSetting = (_x = t === null || t === void 0 ? void 0 : t.extend) === null || _x === void 0 ? void 0 : _x.defaulSetting;
|
12440
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';
|
12441
|
-
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 })));
|
12442
12444
|
}
|
12443
12445
|
else {
|
12444
12446
|
return null;
|
@@ -12448,8 +12450,16 @@ const RenderCard = ({ rec, index, tempMap, resolver }) => {
|
|
12448
12450
|
};
|
12449
12451
|
var RenderCard$1 = memo(RenderCard);
|
12450
12452
|
|
12453
|
+
/*
|
12454
|
+
* @Author: binruan@chatlabs.com
|
12455
|
+
* @Date: 2024-03-26 10:07:41
|
12456
|
+
* @LastEditors: binruan@chatlabs.com
|
12457
|
+
* @LastEditTime: 2024-04-15 14:27:18
|
12458
|
+
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Nudge\index.tsx
|
12459
|
+
*
|
12460
|
+
*/
|
12451
12461
|
const Nudge = ({ nudge }) => {
|
12452
|
-
return (React.createElement(
|
12462
|
+
return (React.createElement(React.Fragment, null, (nudge === null || nudge === void 0 ? void 0 : nudge.isOpen) && (React.createElement("div", { className: 'clc-sxp-bottom-nudge', style: {
|
12453
12463
|
marginBottom: nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom,
|
12454
12464
|
width: nudge === null || nudge === void 0 ? void 0 : nudge.size.width,
|
12455
12465
|
height: nudge === null || nudge === void 0 ? void 0 : nudge.size.height,
|
@@ -12457,14 +12467,14 @@ const Nudge = ({ nudge }) => {
|
|
12457
12467
|
borderRadius: nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius
|
12458
12468
|
} },
|
12459
12469
|
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover' } }) : null,
|
12460
|
-
React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, nudge === null || nudge === void 0 ? void 0 : nudge.content)));
|
12470
|
+
React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, nudge === null || nudge === void 0 ? void 0 : nudge.content)))));
|
12461
12471
|
};
|
12462
12472
|
|
12463
12473
|
/*
|
12464
12474
|
* @Author: binruan@chatlabs.com
|
12465
12475
|
* @Date: 2024-01-15 19:03:09
|
12466
12476
|
* @LastEditors: binruan@chatlabs.com
|
12467
|
-
* @LastEditTime: 2024-04-
|
12477
|
+
* @LastEditTime: 2024-04-11 18:45:44
|
12468
12478
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
12469
12479
|
*
|
12470
12480
|
*/
|
@@ -12592,7 +12602,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12592
12602
|
eventDescription: 'Session completed',
|
12593
12603
|
relatedContentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
|
12594
12604
|
relatedProductId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
|
12595
|
-
position:
|
12605
|
+
position: activeIndex,
|
12596
12606
|
fromKName,
|
12597
12607
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
12598
12608
|
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 : ''
|
@@ -12635,7 +12645,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12635
12645
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
12636
12646
|
const Component = withBindDataSource(t);
|
12637
12647
|
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
12638
|
-
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' }) })));
|
12648
|
+
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 })));
|
12639
12649
|
});
|
12640
12650
|
}
|
12641
12651
|
return null;
|
@@ -12649,12 +12659,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12649
12659
|
React.createElement(Nudge, { nudge: nudge }),
|
12650
12660
|
React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
12651
12661
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
|
12652
|
-
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 }),
|
12662
|
+
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: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }) }),
|
12653
12663
|
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 }))));
|
12654
12664
|
}
|
12655
12665
|
return null;
|
12656
|
-
}, [descStyle, activeIndex, tempMap, resolver, tipText, nudge, hashTagStyle]);
|
12657
|
-
const renderLikeButton = useCallback((rec) => {
|
12666
|
+
}, [descStyle, activeIndex, tempMap, resolver, tipText, nudge, hashTagStyle, globalConfig]);
|
12667
|
+
const renderLikeButton = useCallback((rec, index) => {
|
12658
12668
|
var _a, _b;
|
12659
12669
|
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
|
12660
12670
|
return;
|
@@ -12666,7 +12676,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12666
12676
|
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: {
|
12667
12677
|
top,
|
12668
12678
|
right: (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _b !== void 0 ? _b : 0
|
12669
|
-
} }));
|
12679
|
+
}, position: index }));
|
12670
12680
|
}
|
12671
12681
|
return null;
|
12672
12682
|
}, [globalConfig, waterFallData]);
|
@@ -12684,7 +12694,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12684
12694
|
imageEndTime: `${endTime}`,
|
12685
12695
|
playDuration: `${duration}`,
|
12686
12696
|
contentTags: JSON.stringify((_f = item.video.tags) !== null && _f !== void 0 ? _f : []),
|
12687
|
-
position:
|
12697
|
+
position: activeIndex,
|
12688
12698
|
contentFormat: 'image',
|
12689
12699
|
traceInfo: item.video.traceInfo
|
12690
12700
|
}
|
@@ -12729,7 +12739,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12729
12739
|
const handleReportProductView = (item) => {
|
12730
12740
|
var _a, _b, _c;
|
12731
12741
|
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)) {
|
12732
|
-
productView(item, item.product, (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.bindCta, viewTime.current);
|
12742
|
+
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);
|
12733
12743
|
}
|
12734
12744
|
};
|
12735
12745
|
useEffect(() => {
|
@@ -12752,7 +12762,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12752
12762
|
contentName: (_e = item.video.title) !== null && _e !== void 0 ? _e : '',
|
12753
12763
|
imageStartTime: `${startTime}`,
|
12754
12764
|
contentTags: JSON.stringify((_f = item.video.tags) !== null && _f !== void 0 ? _f : []),
|
12755
|
-
position:
|
12765
|
+
position: activeIndex,
|
12756
12766
|
contentFormat: 'image',
|
12757
12767
|
traceInfo: item.video.traceInfo
|
12758
12768
|
}
|
@@ -12786,7 +12796,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12786
12796
|
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement(React.Fragment, null,
|
12787
12797
|
renderContent(rec, index),
|
12788
12798
|
renderBottom(rec, index),
|
12789
|
-
renderLikeButton(rec)))))));
|
12799
|
+
renderLikeButton(rec, index)))))));
|
12790
12800
|
});
|
12791
12801
|
}, [containerWidth, data, height, loading, renderBottom, renderContent, visList, loadingImage]);
|
12792
12802
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
@@ -12843,7 +12853,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12843
12853
|
* @Author: binruan@chatlabs.com
|
12844
12854
|
* @Date: 2023-10-31 10:56:01
|
12845
12855
|
* @LastEditors: binruan@chatlabs.com
|
12846
|
-
* @LastEditTime: 2024-04-
|
12856
|
+
* @LastEditTime: 2024-04-15 09:39:17
|
12847
12857
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
12848
12858
|
*
|
12849
12859
|
*/
|
@@ -12879,7 +12889,7 @@ const Popup = () => {
|
|
12879
12889
|
const product = (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
12880
12890
|
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;
|
12881
12891
|
if (product && cta) {
|
12882
|
-
productView(data, product, cta, curTimeRef.current);
|
12892
|
+
productView(data, product, cta, curTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
|
12883
12893
|
}
|
12884
12894
|
setTimeout(() => {
|
12885
12895
|
window === null || window === void 0 ? void 0 : window.sxpPopup('');
|