pb-sxp-ui 1.7.3 → 1.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +60 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +60 -67
- 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 +60 -67
- 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/Modal/index.d.ts +1 -0
- package/es/core/components/SxpPageRender/Modal/index.js +2 -2
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +2 -3
- package/es/core/components/SxpPageRender/PictureGroup/index.js +5 -8
- package/es/core/components/SxpPageRender/RenderCard.js +2 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.js +15 -17
- package/es/core/components/SxpPageRender/index.js +25 -20
- package/es/core/context/SxpDataSourceProvider.js +9 -6
- package/es/core/utils/tool.d.ts +1 -2
- package/es/core/utils/tool.js +1 -11
- package/lib/core/components/SxpPageRender/Modal/index.d.ts +1 -0
- package/lib/core/components/SxpPageRender/Modal/index.js +2 -2
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +2 -3
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +5 -8
- package/lib/core/components/SxpPageRender/RenderCard.js +2 -1
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +15 -17
- package/lib/core/components/SxpPageRender/index.js +25 -20
- package/lib/core/context/SxpDataSourceProvider.js +9 -6
- package/lib/core/utils/tool.d.ts +1 -2
- package/lib/core/utils/tool.js +1 -12
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -320,16 +320,6 @@ function getCookie(val) {
|
|
320
320
|
});
|
321
321
|
return value !== null && value !== void 0 ? value : '';
|
322
322
|
}
|
323
|
-
const getResFileSizeFromSrc = (imageSrc) => {
|
324
|
-
if (!imageSrc)
|
325
|
-
return '';
|
326
|
-
return fetch(imageSrc)
|
327
|
-
.then((response) => response.blob())
|
328
|
-
.then((blob) => {
|
329
|
-
const fileSizeInMB = blob.size / (1024 * 1024); // 将文件大小转换为 MB
|
330
|
-
return fileSizeInMB.toFixed(2) + '';
|
331
|
-
});
|
332
|
-
};
|
333
323
|
|
334
324
|
function unzip(b64Data) {
|
335
325
|
const strData = atob(b64Data);
|
@@ -830,17 +820,20 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
830
820
|
});
|
831
821
|
}, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
|
832
822
|
const bffFbReport = React.useCallback(({ eventName, product }) => {
|
833
|
-
var _a, _b, _c, _d;
|
834
|
-
if (!enableReportEvent ||
|
823
|
+
var _a, _b, _c, _d, _e;
|
824
|
+
if (!enableReportEvent ||
|
825
|
+
!enabledMetaConversionApi ||
|
826
|
+
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) ||
|
827
|
+
!((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName])) {
|
835
828
|
return;
|
836
829
|
}
|
837
|
-
let jsonParams = (
|
830
|
+
let jsonParams = JSON.parse(JSON.stringify((_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _b === void 0 ? void 0 : _b[eventName]));
|
838
831
|
const urlParams = new URLSearchParams(window.location.search);
|
839
832
|
const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
|
840
833
|
const fix_par = {
|
841
|
-
event_source_url: (
|
834
|
+
event_source_url: (_c = window === null || window === void 0 ? void 0 : window.location) === null || _c === void 0 ? void 0 : _c.href,
|
842
835
|
external_id: storeAndLoadFeUserId(),
|
843
|
-
client_user_agent: (
|
836
|
+
client_user_agent: (_e = (_d = window === null || window === void 0 ? void 0 : window.navigator) === null || _d === void 0 ? void 0 : _d.userAgent) !== null && _e !== void 0 ? _e : '',
|
844
837
|
fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
|
845
838
|
fbp: getCookie('_fbp') ? `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` : '',
|
846
839
|
time: new Date().getTime()
|
@@ -865,7 +858,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
865
858
|
matches.forEach((match) => {
|
866
859
|
const prop = match.substring(2, match.length - 2);
|
867
860
|
try {
|
868
|
-
|
861
|
+
let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
|
869
862
|
if (replaceValue) {
|
870
863
|
obj[key] = replaceValue;
|
871
864
|
}
|
@@ -8986,12 +8979,12 @@ SwiperSlide.displayName = 'SwiperSlide';
|
|
8986
8979
|
* @Author: binruan@chatlabs.com
|
8987
8980
|
* @Date: 2023-11-02 18:34:34
|
8988
8981
|
* @LastEditors: binruan@chatlabs.com
|
8989
|
-
* @LastEditTime: 2024-10-
|
8982
|
+
* @LastEditTime: 2024-10-30 19:22:59
|
8990
8983
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8991
8984
|
*
|
8992
8985
|
*/
|
8993
8986
|
const closeIcon$1 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
8994
|
-
const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema, fullHeight = window.innerHeight, isFullScreen = false }) => {
|
8987
|
+
const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema, fullHeight = window.innerHeight, isFullScreen = false, openState }) => {
|
8995
8988
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
8996
8989
|
const touchRef = React.useRef(null);
|
8997
8990
|
const fTouchRef = React.useRef(null);
|
@@ -9043,7 +9036,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
9043
9036
|
}, [isOpen, popup]);
|
9044
9037
|
const child = React.useCallback(() => {
|
9045
9038
|
return children;
|
9046
|
-
}, [_popup]);
|
9039
|
+
}, [_popup, openState]);
|
9047
9040
|
if (!modalEleRef.current)
|
9048
9041
|
return null;
|
9049
9042
|
const handleClose = lodash.debounce(() => {
|
@@ -15683,6 +15676,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15683
15676
|
const videoEleRef = React.useRef(null);
|
15684
15677
|
const hlsRef = React.useRef(null);
|
15685
15678
|
const initTimeRef = React.useRef();
|
15679
|
+
const loadedTimeRef = React.useRef();
|
15686
15680
|
const blur = React.useMemo(() => {
|
15687
15681
|
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
15688
15682
|
}, [videoPostConfig]);
|
@@ -15729,7 +15723,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15729
15723
|
setIsLoadFinish(true);
|
15730
15724
|
}, []);
|
15731
15725
|
const handleStartPlay = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
15732
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
15726
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
15733
15727
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
15734
15728
|
return;
|
15735
15729
|
setIsPauseVideo(false);
|
@@ -15739,22 +15733,20 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15739
15733
|
const videoDuration = ((_d = (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
15740
15734
|
const videoCurrentTime = ((_f = (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
15741
15735
|
const playType = isFirstPlay ? '0' : '1';
|
15742
|
-
const contentSize = yield getResFileSizeFromSrc((_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.url);
|
15743
15736
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15744
15737
|
eventInfo: {
|
15745
15738
|
eventSubject: 'playVideo',
|
15746
15739
|
eventDescription: 'User played the video',
|
15747
|
-
contentId: (
|
15748
|
-
contentName: (
|
15740
|
+
contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
15741
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
15749
15742
|
playType,
|
15750
15743
|
startTime: videoCurrentTime,
|
15751
15744
|
videoDuration,
|
15752
|
-
contentTags: JSON.stringify((
|
15745
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
15753
15746
|
position: index + '',
|
15754
15747
|
contentFormat: 'video',
|
15755
|
-
traceInfo: (
|
15756
|
-
|
15757
|
-
loadTime: (new Date() - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current)).toFixed(2) + ''
|
15748
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo,
|
15749
|
+
loadTime: ((loadedTimeRef === null || loadedTimeRef === void 0 ? void 0 : loadedTimeRef.current) - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current)).toFixed(2) + ''
|
15758
15750
|
}
|
15759
15751
|
});
|
15760
15752
|
setIsFirstPlay(false);
|
@@ -15785,6 +15777,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15785
15777
|
const handleLoadedmetadata = React.useCallback(() => {
|
15786
15778
|
if (!videoRef.current)
|
15787
15779
|
return;
|
15780
|
+
loadedTimeRef.current = new Date();
|
15788
15781
|
handleStartPlay();
|
15789
15782
|
handLoadeddata();
|
15790
15783
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
@@ -15907,7 +15900,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15907
15900
|
};
|
15908
15901
|
}, [isActive]);
|
15909
15902
|
React.useEffect(() => {
|
15910
|
-
var _a, _b, _c, _d;
|
15903
|
+
var _a, _b, _c, _d, _e, _f;
|
15911
15904
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
|
15912
15905
|
return;
|
15913
15906
|
if (isActive) {
|
@@ -15915,10 +15908,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15915
15908
|
eventName: 'ViewContent',
|
15916
15909
|
product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProduct
|
15917
15910
|
});
|
15918
|
-
|
15911
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
15912
|
+
eventName: 'PageView',
|
15913
|
+
product: (_d = (_c = data === null || data === void 0 ? void 0 : data[index]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.bindProduct
|
15914
|
+
});
|
15915
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
15919
15916
|
}
|
15920
15917
|
else {
|
15921
|
-
(
|
15918
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
15922
15919
|
}
|
15923
15920
|
}, [isActive, isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
15924
15921
|
/*
|
@@ -15940,12 +15937,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15940
15937
|
if (!isActive)
|
15941
15938
|
return;
|
15942
15939
|
const onShow = () => {
|
15943
|
-
var _a, _b;
|
15944
15940
|
handleClickVideo('start')();
|
15945
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
15946
|
-
eventName: 'ViewContent',
|
15947
|
-
product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProduct
|
15948
|
-
});
|
15949
15941
|
};
|
15950
15942
|
const onHide = handleClickVideo('pause');
|
15951
15943
|
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
@@ -16116,7 +16108,7 @@ const Picture = (props) => {
|
|
16116
16108
|
}, onLoad: onShowFirstImage }))));
|
16117
16109
|
};
|
16118
16110
|
|
16119
|
-
const PictureGroup$2 = ({ imgUrls, width, height, rec, index,
|
16111
|
+
const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
16120
16112
|
var _a, _b;
|
16121
16113
|
const ref = React.useRef();
|
16122
16114
|
const { isActive } = useSwiperSlide();
|
@@ -16128,21 +16120,19 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageE
|
|
16128
16120
|
if (isLoad && isActive) {
|
16129
16121
|
(ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.start();
|
16130
16122
|
if (openHashtag) {
|
16131
|
-
|
16123
|
+
onViewImageEndEvent(rec);
|
16132
16124
|
}
|
16133
16125
|
else {
|
16134
|
-
onViewImageStartEvent(index, imgInfo);
|
16126
|
+
onViewImageStartEvent(index, imgInfo, true);
|
16135
16127
|
}
|
16136
16128
|
}
|
16137
16129
|
else {
|
16138
16130
|
(ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.stop();
|
16139
16131
|
}
|
16140
|
-
}, [rec, isActive,
|
16132
|
+
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
16141
16133
|
const showFirstImageFn = React.useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
16142
16134
|
if (!isLoad) {
|
16143
|
-
const contentSize = yield getResFileSizeFromSrc(e.src);
|
16144
16135
|
setImgInfo({
|
16145
|
-
contentSize,
|
16146
16136
|
loadTime: (new Date() - initTime).toFixed(2) + ''
|
16147
16137
|
});
|
16148
16138
|
setIsLoad(true);
|
@@ -16153,7 +16143,7 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageE
|
|
16153
16143
|
// }
|
16154
16144
|
React.useEffect(() => {
|
16155
16145
|
const onShow = () => onViewImageStartEvent(index, imgInfo);
|
16156
|
-
const onHide = () =>
|
16146
|
+
const onHide = () => onViewImageEndEvent(rec);
|
16157
16147
|
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
16158
16148
|
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
|
16159
16149
|
return () => {
|
@@ -16299,7 +16289,7 @@ function withBindDataSource(Component) {
|
|
16299
16289
|
* @Author: binruan@chatlabs.com
|
16300
16290
|
* @Date: 2023-12-26 16:11:34
|
16301
16291
|
* @LastEditors: binruan@chatlabs.com
|
16302
|
-
* @LastEditTime: 2024-10-
|
16292
|
+
* @LastEditTime: 2024-10-30 14:51:19
|
16303
16293
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
16304
16294
|
*
|
16305
16295
|
*/
|
@@ -16348,7 +16338,7 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }
|
|
16348
16338
|
const Component = withBindDataSource(t);
|
16349
16339
|
const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
|
16350
16340
|
const isExternalLink = ((_2 = (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.event) === null || _1 === void 0 ? void 0 : _1.onClick) === null || _2 === void 0 ? void 0 : _2.linkType) === 'externalLink';
|
16351
|
-
let style = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style;
|
16341
|
+
let style = lodash.cloneDeep((_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style);
|
16352
16342
|
if (style.hasOwnProperty('backdropFilter')) {
|
16353
16343
|
let sbf = style['backdropFilter'];
|
16354
16344
|
style['backdropFilter'] = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
|
@@ -16446,7 +16436,7 @@ var Tagbar$1 = React.memo(Tagbar);
|
|
16446
16436
|
* @Author: binruan@chatlabs.com
|
16447
16437
|
* @Date: 2024-01-15 19:03:09
|
16448
16438
|
* @LastEditors: binruan@chatlabs.com
|
16449
|
-
* @LastEditTime: 2024-10-
|
16439
|
+
* @LastEditTime: 2024-10-28 16:36:22
|
16450
16440
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
16451
16441
|
*
|
16452
16442
|
*/
|
@@ -16516,7 +16506,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16516
16506
|
// 移动端h5直接杀掉浏览器或宿主app时不会触发,pc端直接杀掉标签页时能触发
|
16517
16507
|
if (repCond) {
|
16518
16508
|
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_HIDE, item);
|
16519
|
-
// handleReportViewImageEnd(item);
|
16520
16509
|
handleReportProductView(item);
|
16521
16510
|
}
|
16522
16511
|
let fromKName = '';
|
@@ -16561,7 +16550,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16561
16550
|
// 页面可见时触发,注意页面初始化时不会触发
|
16562
16551
|
handleH5EnterLink();
|
16563
16552
|
if (repCond) {
|
16564
|
-
// handleViewImageStartEvent(activeIndex);
|
16565
16553
|
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
|
16566
16554
|
backMainFeed('external', selectTag);
|
16567
16555
|
}
|
@@ -16646,7 +16634,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16646
16634
|
return (React.createElement(VideoWidget$3, { key: isReload, rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon }));
|
16647
16635
|
}
|
16648
16636
|
if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
16649
|
-
return (React.createElement(PictureGroup$3, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index,
|
16637
|
+
return (React.createElement(PictureGroup$3, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onViewImageEndEvent: handleViewImageStartEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
16650
16638
|
}
|
16651
16639
|
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
16652
16640
|
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|
@@ -16720,7 +16708,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16720
16708
|
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike) || !visible)
|
16721
16709
|
return;
|
16722
16710
|
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
|
16723
|
-
if (waterFallData && top < 40) {
|
16711
|
+
if (waterFallData && top < 40 && globalConfig.likeIconYPosit === 'top') {
|
16724
16712
|
top += 40;
|
16725
16713
|
}
|
16726
16714
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
@@ -16732,7 +16720,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16732
16720
|
}
|
16733
16721
|
return null;
|
16734
16722
|
}, [globalConfig, waterFallData]);
|
16735
|
-
const
|
16723
|
+
const handleViewImageStartEnd = (item) => {
|
16736
16724
|
var _a, _b, _c, _d, _e, _f;
|
16737
16725
|
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)) {
|
16738
16726
|
const endTime = Date.now();
|
@@ -16815,7 +16803,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16815
16803
|
}
|
16816
16804
|
});
|
16817
16805
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
16818
|
-
|
16806
|
+
handleViewImageStartEnd(item);
|
16819
16807
|
handleSlideSkip(item, swiper.previousIndex);
|
16820
16808
|
}
|
16821
16809
|
else {
|
@@ -16832,7 +16820,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16832
16820
|
}
|
16833
16821
|
});
|
16834
16822
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
16835
|
-
|
16823
|
+
handleViewImageStartEnd(item);
|
16836
16824
|
}
|
16837
16825
|
// 商品浏览事件
|
16838
16826
|
handleReportProductView(item);
|
@@ -16853,7 +16841,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16853
16841
|
viewTime.current = new Date();
|
16854
16842
|
}
|
16855
16843
|
}, [openHashtag, data, activeIndex]);
|
16856
|
-
const handleViewImageStartEvent = (activeIndex, imgInfo) => {
|
16844
|
+
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
16857
16845
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
16858
16846
|
const item = data[activeIndex];
|
16859
16847
|
// 如果是图片集则上报事件
|
@@ -16871,33 +16859,38 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16871
16859
|
position: activeIndex + '',
|
16872
16860
|
contentFormat: 'image',
|
16873
16861
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
16874
|
-
contentSize: imgInfo === null || imgInfo === void 0 ? void 0 : imgInfo.contentSize,
|
16875
16862
|
loadTime: imgInfo === null || imgInfo === void 0 ? void 0 : imgInfo.loadTime
|
16876
16863
|
}
|
16877
16864
|
});
|
16878
|
-
|
16879
|
-
|
16880
|
-
|
16881
|
-
|
16882
|
-
|
16883
|
-
|
16884
|
-
|
16885
|
-
|
16865
|
+
if (enableCapi) {
|
16866
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16867
|
+
eventName: 'ViewContent',
|
16868
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
16869
|
+
});
|
16870
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16871
|
+
eventName: 'PageView',
|
16872
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
16873
|
+
});
|
16874
|
+
}
|
16886
16875
|
}
|
16887
16876
|
};
|
16888
16877
|
const renderToggleButton = React.useCallback((visible) => {
|
16889
16878
|
var _a, _b, _c, _d, _e, _f;
|
16890
16879
|
if (!visible)
|
16891
16880
|
return;
|
16881
|
+
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _a !== void 0 ? _a : 23;
|
16882
|
+
if (waterFallData && top < 40 && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) === 'top') {
|
16883
|
+
top += 40;
|
16884
|
+
}
|
16892
16885
|
return (((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === true) && (React.createElement(ToggleButton$1, { style: {
|
16893
16886
|
position: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed) ? 'fixed' : 'absolute',
|
16894
|
-
visibility: ((
|
16887
|
+
visibility: ((_c = (_b = visList === null || visList === void 0 ? void 0 : visList[activeIndex]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.url) ? 'visible' : 'hidden',
|
16895
16888
|
zIndex: 999,
|
16896
16889
|
transform: 'translate3d(0px,0px,0px)',
|
16897
|
-
[(
|
16898
|
-
[(
|
16890
|
+
[(_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _d !== void 0 ? _d : 'right']: (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _e !== void 0 ? _e : 0,
|
16891
|
+
[(_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _f !== void 0 ? _f : 'bottom']: top
|
16899
16892
|
}, defaultValue: isMuted, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon, onChange: setIsMuted })));
|
16900
|
-
}, [globalConfig, visList, activeIndex, isMuted]);
|
16893
|
+
}, [globalConfig, visList, activeIndex, isMuted, waterFallData]);
|
16901
16894
|
const renderView = React.useMemo(() => {
|
16902
16895
|
if (loading) {
|
16903
16896
|
return (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
@@ -16930,7 +16923,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16930
16923
|
renderToggleButton
|
16931
16924
|
]);
|
16932
16925
|
return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container', style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
|
16933
|
-
waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
|
16926
|
+
waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff', top: `${minusHeight}px` }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
|
16934
16927
|
const isEq = lodash.isEqual(rtcList, cacheRtcList);
|
16935
16928
|
if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
|
16936
16929
|
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
|