pb-sxp-ui 1.15.23-alpha.1 → 1.15.24
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 +143 -157
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +143 -157
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +5 -5
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +5 -5
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +143 -157
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +5 -5
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/es/core/components/SxpPageRender/ExpandableText.js +52 -44
- package/es/core/components/SxpPageRender/LikeButton/index.js +15 -17
- package/es/core/components/SxpPageRender/VideoWidget/index.js +18 -20
- package/es/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/es/core/components/SxpPageRender/index.js +33 -42
- package/es/core/context/SxpDataSourceProvider.js +2 -2
- package/es/core/hooks/useEventReport.js +5 -6
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/lib/core/components/SxpPageRender/ExpandableText.js +51 -44
- package/lib/core/components/SxpPageRender/LikeButton/index.js +15 -17
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +18 -20
- package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/lib/core/components/SxpPageRender/index.js +33 -42
- package/lib/core/context/SxpDataSourceProvider.js +2 -2
- package/lib/core/hooks/useEventReport.js +5 -6
- package/package.json +1 -1
@@ -89,7 +89,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
89
89
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
90
90
|
}, [data, ctaType, swiperRef]);
|
91
91
|
const handleSessionCompleted = useCallback((fk) => {
|
92
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v
|
92
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
93
93
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
94
94
|
let fromKName = '';
|
95
95
|
if (popupDetailData && (((_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
@@ -116,13 +116,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
116
116
|
eventSubject: 'sessionCompleted',
|
117
117
|
eventDescription: 'Session completed',
|
118
118
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
119
|
-
|
120
|
-
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
119
|
+
productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
|
121
120
|
position: activeIndex + '',
|
122
121
|
fromKName: fk || fromKName,
|
123
122
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
124
|
-
ctatId: (
|
125
|
-
traceInfo: (
|
123
|
+
ctatId: (_r = (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.bindCta) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
124
|
+
traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : ''
|
126
125
|
}
|
127
126
|
});
|
128
127
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
|
@@ -249,18 +248,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
249
248
|
return null;
|
250
249
|
}, [globalConfig, activeIndex, visList]);
|
251
250
|
const renderContent = useCallback((rec, index) => {
|
252
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
251
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
253
252
|
if (rec === 'organic menu') {
|
254
253
|
return (React.createElement(MultiPosts, Object.assign({ recData: data === null || data === void 0 ? void 0 : data[1] }, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props, (_f = (_e = (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.item) === null || _f === void 0 ? void 0 : _f.event)));
|
255
254
|
}
|
256
|
-
if ((
|
255
|
+
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
|
257
256
|
return (React.createElement(VideoWidget, Object.assign({ key: isReload }, (activeIndex === index && { ref: videoWidgetRef }), { 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, loopPlay: true, swiperRef: swiperRef })));
|
258
257
|
}
|
259
|
-
if ((
|
258
|
+
if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
|
260
259
|
return (React.createElement(PictureGroup, { 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 }));
|
261
260
|
}
|
262
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
263
|
-
return (
|
261
|
+
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _j === void 0 ? void 0 : _j.length) > 0) {
|
262
|
+
return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
|
264
263
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
265
264
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
266
265
|
const Component = withBindDataSource(t);
|
@@ -298,7 +297,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
298
297
|
};
|
299
298
|
}, [isShowMore]);
|
300
299
|
const renderBottom = useCallback((rec, index) => {
|
301
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
300
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
302
301
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
303
302
|
let cta = null;
|
304
303
|
if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
|
@@ -307,23 +306,20 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
307
306
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
308
307
|
cta = '商品CTA';
|
309
308
|
}
|
310
|
-
else if (tempMap && ((_d = Object.keys(tempMap)) === null || _d === void 0 ? void 0 : _d.includes('服务CTA')) && ((_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta) === null || _f === void 0 ? void 0 : _f.itemId)) {
|
311
|
-
cta = '服务CTA';
|
312
|
-
}
|
313
309
|
else {
|
314
|
-
cta = (
|
310
|
+
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
315
311
|
}
|
316
312
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
317
313
|
return (React.createElement(React.Fragment, null,
|
318
|
-
((
|
319
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
314
|
+
((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
315
|
+
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _g !== void 0 ? _g : 40}px` } },
|
320
316
|
React.createElement(Nudge, { nudge: nudge }),
|
321
317
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
322
318
|
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
323
319
|
React.createElement("div", null,
|
324
|
-
React.createElement(ExpandableText, { 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: (
|
320
|
+
React.createElement(ExpandableText, { 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: (_j = (_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '', 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' }), onChange: onExpandableChange }),
|
325
321
|
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
326
|
-
React.createElement(Hashtag, { index: activeIndex, tags: (
|
322
|
+
React.createElement(Hashtag, { index: activeIndex, tags: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.hashTags) !== null && _l !== void 0 ? _l : [], itemId: (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.itemId, itemType: ((_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
|
327
323
|
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
328
324
|
}
|
329
325
|
return null;
|
@@ -361,7 +357,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
361
357
|
return null;
|
362
358
|
}, [globalConfig, waterFallData]);
|
363
359
|
const handleViewImageStartEnd = (item) => {
|
364
|
-
var _a, _b, _c, _d, _e, _f
|
360
|
+
var _a, _b, _c, _d, _e, _f;
|
365
361
|
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)) {
|
366
362
|
const endTime = Date.now();
|
367
363
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
@@ -370,11 +366,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
370
366
|
eventSubject: 'viewImageCarouselEnd',
|
371
367
|
eventDescription: 'User end view the image carousel',
|
372
368
|
contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
373
|
-
|
374
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
369
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
375
370
|
imageEndTime: `${endTime}`,
|
376
371
|
playDuration: `${duration}`,
|
377
|
-
contentTags: JSON.stringify((
|
372
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
378
373
|
position: activeIndex + '',
|
379
374
|
contentFormat: 'image',
|
380
375
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
@@ -383,7 +378,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
383
378
|
}
|
384
379
|
};
|
385
380
|
const handleSlideSkip = (item, position) => {
|
386
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
381
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
387
382
|
if (isPreview || waterFallData)
|
388
383
|
return;
|
389
384
|
const t = new Date() - curTime.current;
|
@@ -409,8 +404,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
409
404
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
410
405
|
position: position + '',
|
411
406
|
contentId: (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.itemId) !== null && _t !== void 0 ? _t : '',
|
412
|
-
|
413
|
-
traceInfo: (_0 = (_y = (_x = item === null || item === void 0 ? void 0 : item.video) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_z = item === null || item === void 0 ? void 0 : item.product) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : '',
|
407
|
+
traceInfo: (_x = (_v = (_u = item === null || item === void 0 ? void 0 : item.video) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : (_w = item === null || item === void 0 ? void 0 : item.product) === null || _w === void 0 ? void 0 : _w.traceInfo) !== null && _x !== void 0 ? _x : '',
|
414
408
|
contentFormat
|
415
409
|
}
|
416
410
|
});
|
@@ -420,7 +414,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
420
414
|
}
|
421
415
|
};
|
422
416
|
const handleScrollEvent = (swiper) => {
|
423
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w
|
417
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
424
418
|
const item = data[swiper.previousIndex];
|
425
419
|
if (!item)
|
426
420
|
return;
|
@@ -437,12 +431,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
437
431
|
eventSubject: 'scrollDown',
|
438
432
|
eventDescription: 'User scroll down',
|
439
433
|
contentId: (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.itemId) !== null && _e !== void 0 ? _e : '',
|
440
|
-
|
441
|
-
productId: (_k = (_j = item === null || item === void 0 ? void 0 : item.product) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '',
|
434
|
+
productId: (_g = (_f = item === null || item === void 0 ? void 0 : item.product) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
|
442
435
|
requestId: null,
|
443
|
-
traceInfo: (
|
436
|
+
traceInfo: (_l = (_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.traceInfo) !== null && _j !== void 0 ? _j : (_k = item === null || item === void 0 ? void 0 : item.product) === null || _k === void 0 ? void 0 : _k.traceInfo) !== null && _l !== void 0 ? _l : '',
|
444
437
|
contentFormat,
|
445
|
-
position: ((
|
438
|
+
position: ((_m = swiper.previousIndex) !== null && _m !== void 0 ? _m : 0) + ''
|
446
439
|
}
|
447
440
|
});
|
448
441
|
handleViewImageStartEnd(item);
|
@@ -453,13 +446,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
453
446
|
eventInfo: {
|
454
447
|
eventSubject: 'scrollUp',
|
455
448
|
eventDescription: 'User scroll up',
|
456
|
-
contentId: (
|
457
|
-
|
458
|
-
productId: (_x = (_w = item.product) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
449
|
+
contentId: (_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.itemId) !== null && _p !== void 0 ? _p : '',
|
450
|
+
productId: (_r = (_q = item.product) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
459
451
|
requestId: null,
|
460
|
-
traceInfo: (
|
452
|
+
traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : '',
|
461
453
|
contentFormat,
|
462
|
-
position: ((
|
454
|
+
position: ((_w = swiper.previousIndex) !== null && _w !== void 0 ? _w : 0) + ''
|
463
455
|
}
|
464
456
|
});
|
465
457
|
handleViewImageStartEnd(item);
|
@@ -483,7 +475,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
483
475
|
}
|
484
476
|
}, [openHashtag, data, activeIndex]);
|
485
477
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
486
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
478
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
487
479
|
const item = data[activeIndex];
|
488
480
|
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)) {
|
489
481
|
const startTime = Date.now();
|
@@ -493,10 +485,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
493
485
|
eventSubject: 'viewImageCarouselStart',
|
494
486
|
eventDescription: 'User start view the image carousel',
|
495
487
|
contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
496
|
-
|
497
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
488
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
498
489
|
imageStartTime: `${startTime}`,
|
499
|
-
contentTags: JSON.stringify((
|
490
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
500
491
|
position: activeIndex + '',
|
501
492
|
contentFormat: 'image',
|
502
493
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
@@ -506,11 +497,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
506
497
|
if (enableCapi) {
|
507
498
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
508
499
|
eventName: 'ViewContent',
|
509
|
-
product: (
|
500
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
510
501
|
});
|
511
502
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
512
503
|
eventName: 'PageView',
|
513
|
-
product: (
|
504
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
514
505
|
});
|
515
506
|
}
|
516
507
|
}
|
@@ -461,7 +461,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
461
461
|
}
|
462
462
|
}), [bffFetch, utmVal]);
|
463
463
|
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
464
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11
|
464
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
|
465
465
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
466
466
|
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);
|
467
467
|
let fromKName = '';
|
@@ -479,7 +479,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
479
479
|
}
|
480
480
|
const contentTags = (_p = (_m = (_h = product === null || product === void 0 ? void 0 : product.tags) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : (_q = rec === null || rec === void 0 ? void 0 : rec.product) === null || _q === void 0 ? void 0 : _q.tags;
|
481
481
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
482
|
-
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '',
|
482
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_10 = (_7 = (_2 = (_y = (_v = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _v !== void 0 ? _v : (_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_1 = (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindProduct) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : (_6 = (_5 = (_4 = (_3 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _3 === void 0 ? void 0 : _3.bindProducts) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.bindCta) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_9 = (_8 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : '', fromKName, fromKPage: (_11 = location === null || location === void 0 ? void 0 : location.href) !== null && _11 !== void 0 ? _11 : '', contentFormat })
|
483
483
|
});
|
484
484
|
}, [bffEventReport, isFromHashtag]);
|
485
485
|
const h5EnterLink = useCallback(() => {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { useCallback } from 'react';
|
2
|
-
import { DEFAULT_TAG } from '../context/SxpDataSourceProvider';
|
3
2
|
import { useSxpDataSource } from './useSxpDataSource';
|
3
|
+
import { DEFAULT_TAG } from '../context/SxpDataSourceProvider';
|
4
4
|
export function useEventReport() {
|
5
5
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
6
6
|
const jumpToWeb = useCallback((e, data, product, cta, position, traceInfo) => {
|
7
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13
|
7
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13;
|
8
8
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
9
9
|
if (i !== -1) {
|
10
10
|
return;
|
@@ -37,11 +37,11 @@ export function useEventReport() {
|
|
37
37
|
contentFormat = 'image';
|
38
38
|
}
|
39
39
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
40
|
-
eventInfo: Object.assign({ eventSubject: 'jumpToWeb', eventDescription: 'User jumped to website', productId: (_v = product === null || product === void 0 ? void 0 : product.itemId) !== null && _v !== void 0 ? _v : '', productName: (_w = product === null || product === void 0 ? void 0 : product.title) !== null && _w !== void 0 ? _w : '', price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0', productCollection: (_x = product === null || product === void 0 ? void 0 : product.collection) !== null && _x !== void 0 ? _x : '', fromKName, fromKPage: location === null || location === void 0 ? void 0 : location.href, contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '',
|
40
|
+
eventInfo: Object.assign({ eventSubject: 'jumpToWeb', eventDescription: 'User jumped to website', productId: (_v = product === null || product === void 0 ? void 0 : product.itemId) !== null && _v !== void 0 ? _v : '', productName: (_w = product === null || product === void 0 ? void 0 : product.title) !== null && _w !== void 0 ? _w : '', price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0', productCollection: (_x = product === null || product === void 0 ? void 0 : product.collection) !== null && _x !== void 0 ? _x : '', fromKName, fromKPage: location === null || location === void 0 ? void 0 : location.href, contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '', ctatId: (_0 = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _0 !== void 0 ? _0 : '', traceInfo: (_13 = (_10 = (_8 = (_4 = (_1 = traceInfo !== null && traceInfo !== void 0 ? traceInfo : product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _1 !== void 0 ? _1 : (_3 = (_2 = data === null || data === void 0 ? void 0 : data.video) === null || _2 === void 0 ? void 0 : _2.bindProduct) === null || _3 === void 0 ? void 0 : _3.traceInfo) !== null && _4 !== void 0 ? _4 : (_7 = (_6 = (_5 = data === null || data === void 0 ? void 0 : data.video) === null || _5 === void 0 ? void 0 : _5.bindProducts) === null || _6 === void 0 ? void 0 : _6[0]) === null || _7 === void 0 ? void 0 : _7.traceInfo) !== null && _8 !== void 0 ? _8 : (_9 = data === null || data === void 0 ? void 0 : data.product) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : (_12 = (_11 = data === null || data === void 0 ? void 0 : data.video) === null || _11 === void 0 ? void 0 : _11.bindCta) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : '' }, (contentFormat && { contentFormat }))
|
41
41
|
});
|
42
42
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
43
43
|
const productView = useCallback((data, product, cta, viewTime, position) => {
|
44
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p
|
44
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
45
45
|
let fromKName = '';
|
46
46
|
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))) {
|
47
47
|
fromKName = 'pdpPage';
|
@@ -60,9 +60,8 @@ export function useEventReport() {
|
|
60
60
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
61
61
|
position: position + '',
|
62
62
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
63
|
-
sceneId: (_g = (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
|
64
63
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
65
|
-
traceInfo: (
|
64
|
+
traceInfo: (_p = (_m = (_h = (_e = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _e !== void 0 ? _e : (_g = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct) === null || _g === void 0 ? void 0 : _g.traceInfo) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.traceInfo) !== null && _m !== void 0 ? _m : (_o = data === null || data === void 0 ? void 0 : data.product) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : '',
|
66
65
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
67
66
|
eventSubject: 'productView',
|
68
67
|
eventDescription: 'User browsed the product'
|
@@ -25,7 +25,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
25
25
|
}, []);
|
26
26
|
const PAUSE_ICON = (0, useIconLink_1.useIconLink)('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
27
27
|
const handlePlaying = (0, react_1.useCallback)(() => {
|
28
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
29
29
|
setIsPauseVideo(false);
|
30
30
|
const item = data[index];
|
31
31
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
@@ -38,15 +38,14 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
38
38
|
eventSubject: 'playVideo',
|
39
39
|
eventDescription: 'User played the video',
|
40
40
|
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 : '',
|
41
|
-
|
42
|
-
contentName: (_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.title) !== null && _o !== void 0 ? _o : '',
|
41
|
+
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 : '',
|
43
42
|
playType,
|
44
43
|
startTime: videoCurrentTime,
|
45
44
|
videoDuration,
|
46
|
-
contentTags: JSON.stringify((
|
45
|
+
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 : []),
|
47
46
|
position: index + '',
|
48
47
|
contentFormat: 'video',
|
49
|
-
traceInfo: (
|
48
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
50
49
|
}
|
51
50
|
});
|
52
51
|
setIsFirstPlay(false);
|
@@ -85,7 +84,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
85
84
|
}
|
86
85
|
}, [isLoadFinish]);
|
87
86
|
const onPause = (0, react_1.useCallback)(() => {
|
88
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
87
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
89
88
|
const item = data[index];
|
90
89
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
91
90
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -96,15 +95,14 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
96
95
|
eventSubject: 'playOverVideo',
|
97
96
|
eventDescription: 'User finished playing the video',
|
98
97
|
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 : '',
|
99
|
-
|
100
|
-
contentName: (_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.title) !== null && _o !== void 0 ? _o : '',
|
98
|
+
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 : '',
|
101
99
|
endTime: videoCurrentTime,
|
102
100
|
videoDuration,
|
103
101
|
playDuration,
|
104
|
-
contentTags: JSON.stringify((
|
102
|
+
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 : []),
|
105
103
|
position: index + '',
|
106
104
|
contentFormat: 'video',
|
107
|
-
traceInfo: (
|
105
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
108
106
|
}
|
109
107
|
});
|
110
108
|
}
|
@@ -1,60 +1,67 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const tslib_1 = require("tslib");
|
4
|
-
const tool_1 = require("../../../core/utils/tool");
|
5
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
6
|
-
const
|
7
|
-
const chineseRegex = /[\u4e00-\u9fa5]+/;
|
8
|
-
if (chineseRegex.test(originalText)) {
|
9
|
-
return originalText.slice(0, 54);
|
10
|
-
}
|
11
|
-
const words = originalText.split(' ');
|
12
|
-
const newWords = [];
|
13
|
-
for (let i = 0; i < words.length; i++) {
|
14
|
-
newWords.push(words[i]);
|
15
|
-
const tempText = newWords.join(' ');
|
16
|
-
if (tempText.length >= limit)
|
17
|
-
break;
|
18
|
-
}
|
19
|
-
const _words = newWords.length > 1 && newWords.length < words.length ? newWords.slice(0, newWords.length - 1) : newWords;
|
20
|
-
return _words.join(' ') + ' ';
|
21
|
-
};
|
5
|
+
const tool_1 = require("../../../core/utils/tool");
|
22
6
|
const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldText, unfoldText, isPost, onChange }) => {
|
23
7
|
const [isShowMore, setIsShowMore] = (0, react_1.useState)(false);
|
24
8
|
const [isShow, setIsShow] = (0, react_1.useState)(false);
|
25
|
-
const
|
9
|
+
const _a = style || {}, { lineClamp } = _a, textStyle = tslib_1.__rest(_a, ["lineClamp"]);
|
10
|
+
const textLineClamp = Number(lineClamp || 2);
|
26
11
|
const multiRow = (0, react_1.useRef)(null);
|
27
|
-
const
|
28
|
-
const handleClick = (
|
12
|
+
const observerRef = (0, react_1.useRef)();
|
13
|
+
const handleClick = () => {
|
29
14
|
setIsShowMore(!isShowMore);
|
30
|
-
}
|
31
|
-
const
|
32
|
-
|
33
|
-
|
15
|
+
};
|
16
|
+
const checkOverflow = (0, react_1.useCallback)(() => {
|
17
|
+
if (!multiRow.current || !isPost || !text)
|
18
|
+
return;
|
19
|
+
const triggerReflow = (el) => el.offsetHeight;
|
20
|
+
requestAnimationFrame(() => {
|
21
|
+
const el = multiRow.current;
|
22
|
+
triggerReflow(el);
|
23
|
+
const originalStyle = el.style.cssText;
|
24
|
+
el.style.webkitLineClamp = 'unset';
|
25
|
+
el.style.display = 'block';
|
26
|
+
triggerReflow(el);
|
27
|
+
const realHeight = el.getBoundingClientRect().height;
|
28
|
+
el.style.cssText = originalStyle;
|
29
|
+
triggerReflow(el);
|
30
|
+
const clampHeight = el.getBoundingClientRect().height;
|
31
|
+
const isActuallyClamped = realHeight > clampHeight + 1;
|
32
|
+
console.log('[精确测量]', { realHeight, clampHeight, isActuallyClamped });
|
33
|
+
setIsShow(isActuallyClamped);
|
34
|
+
});
|
35
|
+
}, [isPost, text, textLineClamp]);
|
34
36
|
(0, react_1.useEffect)(() => {
|
35
|
-
|
36
|
-
if (
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
}
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
37
|
+
const el = multiRow.current;
|
38
|
+
if (!el)
|
39
|
+
return;
|
40
|
+
const fontCheck = () => {
|
41
|
+
document.fonts.ready.then(checkOverflow);
|
42
|
+
};
|
43
|
+
const observer = new ResizeObserver((entries) => {
|
44
|
+
entries.forEach((entry) => {
|
45
|
+
if (entry.contentBoxSize) {
|
46
|
+
}
|
47
|
+
});
|
48
|
+
});
|
49
|
+
fontCheck();
|
50
|
+
observer.observe(el);
|
51
|
+
return () => observer.disconnect();
|
52
|
+
}, [checkOverflow]);
|
53
|
+
return (react_1.default.createElement("div", { className: className, style: Object.assign(Object.assign({}, textStyle), { transform: 'translate3d(0px, 0px, 0px)' }), hidden: !text || text === '' },
|
54
|
+
react_1.default.createElement("div", { ref: multiRow, style: Object.assign(Object.assign({}, (!isShowMore &&
|
55
|
+
isPost && {
|
56
|
+
WebkitLineClamp: textLineClamp,
|
57
|
+
lineClamp: textLineClamp,
|
50
58
|
textOverflow: 'ellipsis',
|
59
|
+
overflow: 'hidden',
|
51
60
|
display: '-webkit-box',
|
52
|
-
WebkitBoxOrient: 'vertical'
|
53
|
-
|
54
|
-
}, dangerouslySetInnerHTML: { __html: (0, tool_1.setFontForText)(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
|
55
|
-
react_1.default.createElement("div", { ref: multiRowCopy, dangerouslySetInnerHTML: { __html: (0, tool_1.setFontForText)(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
|
61
|
+
WebkitBoxOrient: 'vertical'
|
62
|
+
})), { wordBreak: 'break-word', textRendering: 'geometricPrecision', fontKerning: 'none', textSizeAdjust: '100%', boxSizing: 'border-box', contain: 'content' }), dangerouslySetInnerHTML: { __html: (0, tool_1.setFontForText)(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), textStyle) } }),
|
56
63
|
text && isPost && isShow && (react_1.default.createElement("button", { "aria-label": isShowMore ? unfoldText || 'show less' : foldText || 'show more', style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
|
57
|
-
__html: (0, tool_1.setFontForText)(isShowMore ? unfoldText || 'show less' : foldText || 'show more',
|
64
|
+
__html: (0, tool_1.setFontForText)(isShowMore ? unfoldText || 'show less' : foldText || 'show more', textStyle)
|
58
65
|
} }))));
|
59
66
|
};
|
60
67
|
exports.default = (0, react_1.memo)(ExpandableText);
|
@@ -15,7 +15,7 @@ const LikeButton = (_a) => {
|
|
15
15
|
const likeIcon = (0, useIconLink_1.useIconLink)(defaultLikeIconPath);
|
16
16
|
const unlikeIcon = (0, useIconLink_1.useIconLink)(defaultUnLikeIconPath);
|
17
17
|
const handleClick = (0, lodash_1.debounce)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
18
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z
|
18
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
19
19
|
if (state) {
|
20
20
|
setState(false);
|
21
21
|
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ videoItemId: (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '' })))) !== null && _e !== void 0 ? _e : false;
|
@@ -24,53 +24,51 @@ const LikeButton = (_a) => {
|
|
24
24
|
eventSubject: 'favoriteContentCanceled',
|
25
25
|
eventDescription: 'This content was unfavorite by the user',
|
26
26
|
contentId: (_g = (_f = recData === null || recData === void 0 ? void 0 : recData.video) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
|
27
|
-
|
28
|
-
|
29
|
-
contentTags: JSON.stringify((_p = (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : []),
|
27
|
+
contentName: (_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '',
|
28
|
+
contentTags: JSON.stringify((_l = (_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.tags) !== null && _l !== void 0 ? _l : []),
|
30
29
|
position: position + '',
|
31
|
-
contentFormat: ((
|
32
|
-
traceInfo: (
|
30
|
+
contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
|
31
|
+
traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
33
32
|
}
|
34
33
|
});
|
35
34
|
if (!result) {
|
36
35
|
setState(true);
|
37
36
|
}
|
38
37
|
else {
|
39
|
-
const nRtcList = (
|
38
|
+
const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
40
39
|
if (index === position) {
|
41
40
|
item.isCollected = false;
|
42
41
|
}
|
43
42
|
return item;
|
44
|
-
})) !== null &&
|
43
|
+
})) !== null && _p !== void 0 ? _p : [];
|
45
44
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
46
45
|
}
|
47
46
|
}
|
48
47
|
else {
|
49
48
|
setState(true);
|
50
|
-
const result = (
|
49
|
+
const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
|
51
50
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
52
51
|
eventInfo: {
|
53
52
|
eventSubject: 'favoriteContent',
|
54
53
|
eventDescription: 'This content was favorite by the user',
|
55
|
-
contentId: (
|
56
|
-
|
57
|
-
|
58
|
-
contentTags: JSON.stringify((_2 = (_1 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _1 === void 0 ? void 0 : _1.tags) !== null && _2 !== void 0 ? _2 : []),
|
54
|
+
contentId: (_s = (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.itemId) !== null && _s !== void 0 ? _s : '',
|
55
|
+
contentName: (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.title) !== null && _u !== void 0 ? _u : '',
|
56
|
+
contentTags: JSON.stringify((_w = (_v = recData === null || recData === void 0 ? void 0 : recData.video) === null || _v === void 0 ? void 0 : _v.tags) !== null && _w !== void 0 ? _w : []),
|
59
57
|
position: position + '',
|
60
|
-
contentFormat: ((
|
61
|
-
traceInfo: (
|
58
|
+
contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
|
59
|
+
traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
|
62
60
|
}
|
63
61
|
});
|
64
62
|
if (!result) {
|
65
63
|
setState(false);
|
66
64
|
}
|
67
65
|
else {
|
68
|
-
const nRtcList = (
|
66
|
+
const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
69
67
|
if (index === position) {
|
70
68
|
item.isCollected = true;
|
71
69
|
}
|
72
70
|
return item;
|
73
|
-
})) !== null &&
|
71
|
+
})) !== null && _z !== void 0 ? _z : [];
|
74
72
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
75
73
|
}
|
76
74
|
}
|