pb-sxp-ui 1.0.86 → 1.0.87
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 +208 -265
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +209 -266
- 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 +208 -265
- 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/Consent/index.js +2 -2
- package/es/core/components/DiyPortalPreview/VideoWidget.js +3 -3
- package/es/core/components/SxpPageRender/FingerSwipeTip/index.js +1 -1
- package/es/core/components/SxpPageRender/FormatImage.js +2 -2
- package/es/core/components/SxpPageRender/LikeButton/index.js +1 -1
- package/es/core/components/SxpPageRender/Navbar.js +1 -1
- package/es/core/components/SxpPageRender/Nudge/index.js +1 -1
- package/es/core/components/SxpPageRender/Tagbar.js +6 -7
- package/es/core/components/SxpPageRender/ToggleButton/index.js +2 -2
- package/es/core/components/SxpPageRender/VideoWidget/index.js +3 -3
- package/es/core/components/SxpPageRender/WaterFall/List.js +2 -2
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +17 -52
- package/es/core/components/SxpPageRender/WaterFall/index.js +2 -4
- package/es/core/components/SxpPageRender/index.js +48 -52
- package/es/core/context/SxpDataSourceProvider.d.ts +4 -0
- package/es/core/context/SxpDataSourceProvider.js +20 -17
- package/es/core/hooks/useEventReport.d.ts +1 -1
- package/es/core/hooks/useEventReport.js +13 -10
- package/es/materials/sxp/popup/AppointForm/index.js +1 -1
- package/es/materials/sxp/popup/CommodityDetail/index.js +3 -3
- package/es/materials/sxp/popup/CommodityDetailDiro/index.js +4 -4
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -3
- package/es/materials/sxp/popup/Prompt/index.js +2 -2
- package/es/materials/sxp/template/Appoint/index.js +1 -1
- package/lib/core/components/Consent/index.js +2 -2
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +3 -3
- package/lib/core/components/SxpPageRender/FingerSwipeTip/index.js +1 -1
- package/lib/core/components/SxpPageRender/FormatImage.js +2 -2
- package/lib/core/components/SxpPageRender/LikeButton/index.js +1 -1
- package/lib/core/components/SxpPageRender/Navbar.js +1 -1
- package/lib/core/components/SxpPageRender/Nudge/index.js +1 -1
- package/lib/core/components/SxpPageRender/Tagbar.js +7 -8
- package/lib/core/components/SxpPageRender/ToggleButton/index.js +2 -2
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +3 -3
- package/lib/core/components/SxpPageRender/WaterFall/List.js +2 -2
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +17 -52
- package/lib/core/components/SxpPageRender/WaterFall/index.js +2 -4
- package/lib/core/components/SxpPageRender/index.js +48 -52
- package/lib/core/context/SxpDataSourceProvider.d.ts +4 -0
- package/lib/core/context/SxpDataSourceProvider.js +21 -18
- package/lib/core/hooks/useEventReport.d.ts +1 -1
- package/lib/core/hooks/useEventReport.js +13 -10
- package/lib/materials/sxp/popup/AppointForm/index.js +1 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +3 -3
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +4 -4
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -3
- package/lib/materials/sxp/popup/Prompt/index.js +2 -2
- package/lib/materials/sxp/template/Appoint/index.js +1 -1
- package/package.json +1 -1
@@ -24,8 +24,9 @@ const useEventReport_1 = require("../../../core/hooks/useEventReport");
|
|
24
24
|
const withBindDataSource_1 = tslib_1.__importDefault(require("../../../core/hoc/withBindDataSource"));
|
25
25
|
const Tagbar_1 = tslib_1.__importDefault(require("./Tagbar"));
|
26
26
|
const localStore_1 = require("../../../core/utils/localStore");
|
27
|
+
const Consent_1 = tslib_1.__importDefault(require("../Consent"));
|
27
28
|
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
|
28
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
29
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
29
30
|
const { schema } = (0, hooks_1.useEditor)();
|
30
31
|
const [activeIndex, setActiveIndex] = (0, react_1.useState)(0);
|
31
32
|
const viewImageStartTime = (0, react_1.useRef)(0);
|
@@ -34,7 +35,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
34
35
|
const viewTime = (0, react_1.useRef)();
|
35
36
|
const [isLoadMore, setIsLoadMore] = (0, react_1.useState)(false);
|
36
37
|
const [isShowMore, setIsShowMore] = (0, react_1.useState)(false);
|
37
|
-
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink } = (0, hooks_1.useSxpDataSource)();
|
38
|
+
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag } = (0, hooks_1.useSxpDataSource)();
|
38
39
|
const { backMainFeed } = (0, useEventReport_1.useEventReport)();
|
39
40
|
const [videoRef, setVideoRef] = (0, react_1.useState)(null);
|
40
41
|
const playerRef = (0, react_1.useRef)();
|
@@ -108,8 +109,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
108
109
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
109
110
|
const visibleChange = () => {
|
110
111
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
112
|
+
const repCond = !openHashtag && !isShowConsent;
|
111
113
|
if (document.visibilityState === 'hidden') {
|
112
|
-
if (
|
114
|
+
if (repCond) {
|
113
115
|
event_1.default.emit(event_1.SXP_EVENT_TYPE.PAGE_DID_HIDE, item);
|
114
116
|
handleReportViewImageEnd(item);
|
115
117
|
handleReportProductView(item);
|
@@ -149,11 +151,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
149
151
|
}
|
150
152
|
else if (document.visibilityState === 'visible') {
|
151
153
|
handleH5EnterLink();
|
152
|
-
if (
|
154
|
+
if (repCond) {
|
153
155
|
handleViewImageStartEvent(activeIndex);
|
154
156
|
event_1.default.emit(event_1.SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
|
157
|
+
backMainFeed('external', selectTag);
|
155
158
|
}
|
156
|
-
backMainFeed('external');
|
157
159
|
}
|
158
160
|
};
|
159
161
|
document.addEventListener('visibilitychange', visibleChange);
|
@@ -170,17 +172,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
170
172
|
tempMap,
|
171
173
|
curTime,
|
172
174
|
backMainFeed,
|
173
|
-
openHashtag
|
175
|
+
openHashtag,
|
176
|
+
isShowConsent,
|
177
|
+
selectTag
|
174
178
|
]);
|
175
|
-
(0, react_1.useEffect)(() => {
|
176
|
-
const initTime = () => {
|
177
|
-
backMainFeed('external');
|
178
|
-
};
|
179
|
-
window.addEventListener('pageshow', initTime);
|
180
|
-
return () => {
|
181
|
-
window.removeEventListener('pageshow', initTime);
|
182
|
-
};
|
183
|
-
}, []);
|
184
179
|
const tagHeight = (0, react_1.useMemo)(() => {
|
185
180
|
let h = 0;
|
186
181
|
if (tagList.length > 0) {
|
@@ -420,44 +415,45 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
420
415
|
const mutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
421
416
|
const unmutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
422
417
|
return (react_1.default.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' },
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
swiperRef
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
if (
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
418
|
+
isShowConsent ? (react_1.default.createElement(Consent_1.default, Object.assign({}, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
419
|
+
waterFallData && (react_1.default.createElement(Navbar_1.default, { icon: left_png_1.default, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, onClose: () => {
|
420
|
+
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
421
|
+
} })),
|
422
|
+
renderLogo,
|
423
|
+
react_1.default.createElement(Tagbar_1.default, { tagList: tagList, setActiveIndex: setActiveIndex }),
|
424
|
+
isShowFingerTip ? (react_1.default.createElement(FingerSwipeTip_1.default, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 + ((_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _d !== void 0 ? _d : 0)}%` } })) : null,
|
425
|
+
react_1.default.createElement(react_2.Swiper, { style: {
|
426
|
+
marginTop: tagHeight
|
427
|
+
}, ref: swiperRef, onSlideChange: () => {
|
428
|
+
swiperRef.current.swiper.allowTouchMove = false;
|
429
|
+
setTimeout(() => {
|
430
|
+
swiperRef.current.swiper.allowTouchMove = true;
|
431
|
+
}, 500);
|
432
|
+
}, onActiveIndexChange: (swiper) => {
|
433
|
+
setActiveIndex(swiper.activeIndex);
|
434
|
+
if (openHashtag)
|
435
|
+
return;
|
436
|
+
handleScrollEvent(swiper);
|
437
|
+
if (waterFallData)
|
438
|
+
return;
|
439
|
+
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 2 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
440
|
+
if (!isLoadMore) {
|
441
|
+
setIsLoadMore(true);
|
442
|
+
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(Math.ceil(activeIndex / 10) + 1).then(() => {
|
443
|
+
setIsLoadMore(false);
|
444
|
+
});
|
445
|
+
}
|
449
446
|
}
|
450
|
-
}
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
react_1.default.createElement(WaterFall_1.default, Object.assign({}, (_k = (_j = (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.item) === null || _k === void 0 ? void 0 : _k.props)),
|
447
|
+
}, direction: 'vertical', height: height },
|
448
|
+
react_1.default.createElement(ToggleButton_1.default, { style: {
|
449
|
+
position: 'fixed',
|
450
|
+
visibility: ((_f = (_e = data === null || data === void 0 ? void 0 : data[activeIndex]) === null || _e === void 0 ? void 0 : _e.video) === null || _f === void 0 ? void 0 : _f.url) ? 'visible' : 'hidden',
|
451
|
+
zIndex: 999,
|
452
|
+
[(_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _g !== void 0 ? _g : 'right']: (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _h !== void 0 ? _h : 0,
|
453
|
+
[(_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _j !== void 0 ? _j : 'bottom']: (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _k !== void 0 ? _k : 23
|
454
|
+
}, 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 }),
|
455
|
+
renderView))),
|
456
|
+
react_1.default.createElement(WaterFall_1.default, Object.assign({}, (_o = (_m = (_l = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _l === void 0 ? void 0 : _l[0]) === null || _m === void 0 ? void 0 : _m.item) === null || _o === void 0 ? void 0 : _o.props)),
|
461
457
|
react_1.default.createElement("div", { style: { position: 'absolute', zIndex: -100 } },
|
462
458
|
react_1.default.createElement("video", { ref: playerRef, id: 'player-container-id', playsInline: true, crossOrigin: 'anonymous', style: {
|
463
459
|
backgroundColor: 'transparent',
|
@@ -77,6 +77,9 @@ export interface ISxpDataSourceContext {
|
|
77
77
|
curTime?: any;
|
78
78
|
h5EnterLink?: () => void;
|
79
79
|
themeTag?: any;
|
80
|
+
isShowConsent?: boolean;
|
81
|
+
selectTag?: string;
|
82
|
+
setSelectTag?: React.Dispatch<React.SetStateAction<string>>;
|
80
83
|
}
|
81
84
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
82
85
|
export interface SxpDataSourceProviderProps {
|
@@ -115,5 +118,6 @@ export interface SxpDataSourceProviderProps {
|
|
115
118
|
globalConfig?: ISxpPageRenderProps['globalConfig'];
|
116
119
|
isEditor?: boolean;
|
117
120
|
}
|
121
|
+
export declare const DEFAULT_TAG = "FOR U";
|
118
122
|
declare const _default: React.NamedExoticComponent<SxpDataSourceProviderProps>;
|
119
123
|
export default _default;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.SxpDataSourceContext = void 0;
|
3
|
+
exports.DEFAULT_TAG = exports.SxpDataSourceContext = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
6
6
|
const qs_1 = tslib_1.__importDefault(require("qs"));
|
@@ -8,7 +8,6 @@ const sessionStore_1 = require("../utils/sessionStore");
|
|
8
8
|
const localStore_1 = require("../utils/localStore");
|
9
9
|
const useIconLink_1 = require("../components/SxpPageRender/useIconLink");
|
10
10
|
const event_1 = tslib_1.__importStar(require("../utils/event"));
|
11
|
-
const Consent_1 = tslib_1.__importDefault(require("../components/Consent"));
|
12
11
|
exports.SxpDataSourceContext = (0, react_1.createContext)({
|
13
12
|
rtcList: [],
|
14
13
|
tagList: []
|
@@ -18,8 +17,8 @@ var DataSourceType;
|
|
18
17
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
19
18
|
})(DataSourceType || (DataSourceType = {}));
|
20
19
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
20
|
+
exports.DEFAULT_TAG = 'FOR U';
|
21
21
|
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false }) => {
|
22
|
-
var _a, _b, _c;
|
23
22
|
const [rtcList, setRtcList] = (0, react_1.useState)([]);
|
24
23
|
const [tagList, setTagList] = (0, react_1.useState)([]);
|
25
24
|
const [loading, setLoading] = (0, react_1.useState)(false);
|
@@ -36,6 +35,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
36
35
|
const [videoRef, setVideoRef] = (0, react_1.useState)(null);
|
37
36
|
const themeTag = (0, react_1.useRef)();
|
38
37
|
const curTime = (0, react_1.useRef)();
|
38
|
+
const [selectTag, setSelectTag] = (0, react_1.useState)(exports.DEFAULT_TAG);
|
39
39
|
const isShowConsent = (0, react_1.useMemo)(() => {
|
40
40
|
var _a, _b, _c, _d;
|
41
41
|
return (((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === 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.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent;
|
@@ -79,10 +79,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
79
79
|
.catch((err) => Promise.reject(err));
|
80
80
|
}, [bffDataSource]);
|
81
81
|
const getRecommendVideos = (0, react_1.useCallback)((query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
82
|
-
var
|
82
|
+
var _a, _b, _c, _d, _e;
|
83
83
|
query = {
|
84
|
-
maxSize: (
|
85
|
-
defaultSize: (
|
84
|
+
maxSize: (_a = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _a !== void 0 ? _a : maxSize,
|
85
|
+
defaultSize: (_b = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _b !== void 0 ? _b : defaultSize,
|
86
86
|
'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
|
87
87
|
'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
|
88
88
|
hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
|
@@ -90,10 +90,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
90
90
|
themeTag: query === null || query === void 0 ? void 0 : query.themeTag
|
91
91
|
};
|
92
92
|
if (utmVal) {
|
93
|
-
const val = (
|
93
|
+
const val = (_e = (_d = (_c = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _c === void 0 ? void 0 : _c.filter((val) => {
|
94
94
|
const key = val.split('=')[0];
|
95
95
|
return UTM_KEYS.includes(key);
|
96
|
-
})) === null ||
|
96
|
+
})) === null || _d === void 0 ? void 0 : _d.join('&')) !== null && _e !== void 0 ? _e : '';
|
97
97
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
98
98
|
}
|
99
99
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
@@ -105,7 +105,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
105
105
|
return result === null || result === void 0 ? void 0 : result.data;
|
106
106
|
}), [bffFetch, utmVal, maxSize, defaultSize]);
|
107
107
|
const loadVideos = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
108
|
-
var
|
108
|
+
var _f, _g;
|
109
109
|
if (rtcList.length <= 0) {
|
110
110
|
return;
|
111
111
|
}
|
@@ -115,8 +115,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
115
115
|
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
116
116
|
themeTag: themeTag.current
|
117
117
|
});
|
118
|
-
setRtcList(rtcList.concat((
|
119
|
-
setCacheRtcList(cacheRtcList.concat((
|
118
|
+
setRtcList(rtcList.concat((_f = data === null || data === void 0 ? void 0 : data.recList) !== null && _f !== void 0 ? _f : []));
|
119
|
+
setCacheRtcList(cacheRtcList.concat((_g = data === null || data === void 0 ? void 0 : data.recList) !== null && _g !== void 0 ? _g : []));
|
120
120
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
121
121
|
const bffEventReport = (0, react_1.useCallback)(({ userInfo, eventInfo }) => {
|
122
122
|
if (!enableReportEvent) {
|
@@ -174,16 +174,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
174
174
|
return res === null || res === void 0 ? void 0 : res.success;
|
175
175
|
}), [bffFetch]);
|
176
176
|
const bffGetTagList = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
177
|
-
var
|
177
|
+
var _h, _j, _k, _l, _m;
|
178
178
|
if (!utmVal || !isShowTag)
|
179
179
|
return;
|
180
180
|
try {
|
181
|
-
const val = (
|
181
|
+
const val = (_k = (_j = (_h = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _h === void 0 ? void 0 : _h.filter((val) => {
|
182
182
|
const key = val.split('=')[0];
|
183
183
|
return UTM_KEYS.includes(key);
|
184
|
-
})) === null ||
|
184
|
+
})) === null || _j === void 0 ? void 0 : _j.join('&')) !== null && _k !== void 0 ? _k : '';
|
185
185
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
186
|
-
setTagList((
|
186
|
+
setTagList((_m = (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []);
|
187
187
|
}
|
188
188
|
catch (e) {
|
189
189
|
console.log('e', e);
|
@@ -314,13 +314,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
314
314
|
setIsAgreePolicy,
|
315
315
|
curTime,
|
316
316
|
h5EnterLink,
|
317
|
-
themeTag
|
318
|
-
|
317
|
+
themeTag,
|
318
|
+
isShowConsent,
|
319
|
+
selectTag,
|
320
|
+
setSelectTag
|
321
|
+
} }, render({
|
319
322
|
rtcList,
|
320
323
|
mutateLike: bffMutateLike,
|
321
324
|
mutateUnlike: bffMutateUnlike,
|
322
325
|
submitForm: bffSubmitForm,
|
323
326
|
tagList
|
324
|
-
})))
|
327
|
+
})));
|
325
328
|
};
|
326
329
|
exports.default = (0, react_1.memo)(SxpDataSourceProvider);
|
@@ -2,5 +2,5 @@ import { RecItemType } from '../components/SxpPageRender/typing';
|
|
2
2
|
export declare function useEventReport(): {
|
3
3
|
jumpToWeb: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], position?: number) => void;
|
4
4
|
productView: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], viewTime?: any, position?: number) => void;
|
5
|
-
backMainFeed: (lastFeed
|
5
|
+
backMainFeed: (lastFeed: 'theme' | 'branch' | 'external', selectTag?: string, themeTag?: string, hashTag?: string) => void;
|
6
6
|
};
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useEventReport = void 0;
|
4
4
|
const react_1 = require("react");
|
5
5
|
const useSxpDataSource_1 = require("./useSxpDataSource");
|
6
|
+
const SxpDataSourceProvider_1 = require("../context/SxpDataSourceProvider");
|
6
7
|
function useEventReport() {
|
7
8
|
const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = (0, useSxpDataSource_1.useSxpDataSource)();
|
8
9
|
const jumpToWeb = (0, react_1.useCallback)((data, product, cta, position) => {
|
@@ -69,16 +70,18 @@ function useEventReport() {
|
|
69
70
|
}
|
70
71
|
});
|
71
72
|
}, [bffEventReport, popupDetailData]);
|
72
|
-
const backMainFeed = (0, react_1.useCallback)((lastFeed, themeTag, hashTag) => {
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
73
|
+
const backMainFeed = (0, react_1.useCallback)((lastFeed, selectTag, themeTag, hashTag) => {
|
74
|
+
if (selectTag && selectTag === SxpDataSourceProvider_1.DEFAULT_TAG) {
|
75
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
76
|
+
eventInfo: {
|
77
|
+
lastFeed,
|
78
|
+
themeTags: themeTag ? `['${themeTag}']` : '',
|
79
|
+
hashTags: hashTag ? `['${hashTag}']` : '',
|
80
|
+
eventSubject: 'backMainFeed',
|
81
|
+
eventDescription: 'back Main Feed'
|
82
|
+
}
|
83
|
+
});
|
84
|
+
}
|
82
85
|
}, [bffEventReport]);
|
83
86
|
return {
|
84
87
|
jumpToWeb,
|
@@ -86,6 +86,6 @@ const AppointForm = (_a) => {
|
|
86
86
|
react_1.default.createElement("div", { className: 'pb-appoint-form-container' },
|
87
87
|
react_1.default.createElement(pro_components_1.BetaSchemaForm, { columns: columnsData, submitter: false, layout: layoutType, autoFocusFirstInput: false, size: 'large', formRef: formRef, className: 'panel-reset' }))),
|
88
88
|
react_1.default.createElement("div", { className: 'pb-appoint-form-btn-wrapper' },
|
89
|
-
react_1.default.createElement("button", { onClick: handleSubmit, className: 'pb-appoint-form-btn', style: Object.assign({ color: submitColor, background: submitBgColor }, submitButtonStyle) }, loading ? react_1.default.createElement(react_1.default.Fragment, null, "loading...") : submitText))));
|
89
|
+
react_1.default.createElement("button", { "aria-label": submitText, onClick: handleSubmit, className: 'pb-appoint-form-btn', style: Object.assign({ color: submitColor, background: submitBgColor }, submitButtonStyle) }, loading ? react_1.default.createElement(react_1.default.Fragment, null, "loading...") : submitText))));
|
90
90
|
};
|
91
91
|
exports.default = (0, react_1.memo)(AppointForm);
|
@@ -75,8 +75,8 @@ const CommodityDetail = (_a) => {
|
|
75
75
|
18-karat gold, this necklace is embellished with hand-set diamonds.`, maxStr: 79, className: 'pb-commondity-content-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info }))));
|
76
76
|
};
|
77
77
|
const renderBtn = () => {
|
78
|
-
var _a;
|
79
|
-
return (react_1.default.createElement(react_1.default.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.createElement("button", { onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle }, (
|
78
|
+
var _a, _b;
|
79
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.createElement("button", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle }, (_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website'))));
|
80
80
|
};
|
81
81
|
const getStyle = (0, react_1.useCallback)((style) => {
|
82
82
|
if (style === null || style === void 0 ? void 0 : style.lineClamp) {
|
@@ -122,7 +122,7 @@ const CommodityDetail = (_a) => {
|
|
122
122
|
top: 0,
|
123
123
|
objectFit: 'cover',
|
124
124
|
width: '100%'
|
125
|
-
}), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
|
125
|
+
}), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: 'pdp image' }))),
|
126
126
|
react_1.default.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
|
127
127
|
renderBtn(),
|
128
128
|
react_1.default.createElement(Modal_1.default, { visible: showModal, onClose: () => setShowModal(false) },
|
@@ -11,7 +11,7 @@ const arrow_png_1 = tslib_1.__importDefault(require("./arrow.png"));
|
|
11
11
|
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
12
12
|
const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/FormatImage"));
|
13
13
|
const CommodityDetailDiro = (_a) => {
|
14
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
14
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
15
15
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, index } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "index"]);
|
16
16
|
const [spread, setSpread] = (0, react_1.useState)(true);
|
17
17
|
const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
@@ -151,7 +151,7 @@ const CommodityDetailDiro = (_a) => {
|
|
151
151
|
top: 0,
|
152
152
|
objectFit: 'cover',
|
153
153
|
width: '100%'
|
154
|
-
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
154
|
+
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: 'pdp image' }))),
|
155
155
|
react_1.default.createElement("div", { className: 'pb-commondityDiro-content' },
|
156
156
|
react_1.default.createElement("div", { className: 'pb-commondityDiro-content-title' }, (_k = product === null || product === void 0 ? void 0 : product.title) !== null && _k !== void 0 ? _k : 'MEDIUM LADY D-LITE BAG'),
|
157
157
|
react_1.default.createElement("div", { className: 'pb-commondityDiro-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === '') }, (product === null || product === void 0 ? void 0 : product.collection) || 'Gold-Tone and White Butterfly Zodiac Embroidery'),
|
@@ -161,12 +161,12 @@ const CommodityDetailDiro = (_a) => {
|
|
161
161
|
react_1.default.createElement("div", { className: 'pb-commondityDiro-desc', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
162
162
|
react_1.default.createElement("div", { className: 'pb-commondityDiro-desc-collapse', onClick: handleClickCollapse },
|
163
163
|
react_1.default.createElement("div", { className: 'pb-commondityDiro-desc-collapse-title' }, "DESCRIPTION"),
|
164
|
-
react_1.default.createElement("img", { className: `pb-commondityDiro-desc-collapse-icon ${spread ? 'pb-commondityDiro-desc-collapse-iconActive' : ''}`, src: arrow_png_1.default, alt: '' })),
|
164
|
+
react_1.default.createElement("img", { className: `pb-commondityDiro-desc-collapse-icon ${spread ? 'pb-commondityDiro-desc-collapse-iconActive' : ''}`, src: arrow_png_1.default, alt: 'arrow image' })),
|
165
165
|
react_1.default.createElement("div", { className: 'pb-commondityDiro-desc-info', hidden: !spread }, (product === null || product === void 0 ? void 0 : product.info) ||
|
166
166
|
'The Lady D-Lite bag combines classic elegance with House modernity. The style is fully embroidered with a gold-tone and white Butterfly Zodiac motif by Pietro Ruffo, showcasing a constellation enhanced by astrological signs and adorned with butterflies. A Christian Dior Paris signature adorns the front, while D.I.O.R. charms in pale gold-finish metal further enhance and highlight the silhouette. Featuring a wide, removable embroidered shoulder strap, the medium Lady D-Lite bag can be carried by hand or worn crossbody.')),
|
167
167
|
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.createElement(react_1.default.Fragment, null,
|
168
168
|
react_1.default.createElement("div", { className: 'pb-commondityDiro-h90' }),
|
169
169
|
react_1.default.createElement("div", { className: 'pb-commondityDiro-bottom' },
|
170
|
-
react_1.default.createElement("button", { onClick: handleLink, className: 'pb-commondityDiro-bottom-btn' }, (
|
170
|
+
react_1.default.createElement("button", { "aria-label": (_l = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _l !== void 0 ? _l : 'SHOP NOW', onClick: handleLink, className: 'pb-commondityDiro-bottom-btn' }, (_m = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _m !== void 0 ? _m : 'SHOP NOW')))))));
|
171
171
|
};
|
172
172
|
exports.default = (0, react_1.memo)(CommodityDetailDiro);
|
@@ -12,7 +12,7 @@ const ExpandableText_1 = tslib_1.__importDefault(require("../../../../core/compo
|
|
12
12
|
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
13
13
|
const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/FormatImage"));
|
14
14
|
const CommodityDetailDiroNew = (_a) => {
|
15
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
15
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
16
16
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index"]);
|
17
17
|
const [spread, setSpread] = (0, react_1.useState)(true);
|
18
18
|
const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
@@ -140,7 +140,7 @@ Made in Italy` })));
|
|
140
140
|
top: 0,
|
141
141
|
objectFit: 'cover',
|
142
142
|
width: '100%'
|
143
|
-
}), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
|
143
|
+
}), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: 'pdp image' }))),
|
144
144
|
react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
145
145
|
react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
146
146
|
react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
@@ -149,7 +149,7 @@ Made in Italy` })));
|
|
149
149
|
react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
|
150
150
|
react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) }, priceText),
|
151
151
|
react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo) }, (_m = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _m !== void 0 ? _m : '税费'))),
|
152
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (
|
152
|
+
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.createElement("button", { "aria-label": (_o = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _o !== void 0 ? _o : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (_p = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _p !== void 0 ? _p : 'Shop now')),
|
153
153
|
productInfoText({ isPost }))),
|
154
154
|
react_1.default.createElement(Modal_1.default, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
155
155
|
};
|
@@ -29,8 +29,8 @@ const Prompt = (_a) => {
|
|
29
29
|
};
|
30
30
|
return (react_1.default.createElement("div", Object.assign({ className: `pb-prompt ${(0, css_1.css)(Object.assign({}, style))}` }, props),
|
31
31
|
react_1.default.createElement("div", { className: 'pb-prompt-icon' },
|
32
|
-
react_1.default.createElement("img", { width: '100%', src: iconSrc !== null && iconSrc !== void 0 ? iconSrc : success_png_1.default })),
|
32
|
+
react_1.default.createElement("img", { width: '100%', src: iconSrc !== null && iconSrc !== void 0 ? iconSrc : success_png_1.default, alt: 'success image' })),
|
33
33
|
react_1.default.createElement("div", { className: 'pb-prompt-content' }, content),
|
34
|
-
react_1.default.createElement("button", { className: 'pb-prompt-btn', style: submitButtonStyle, onClick: handleOk }, btnText)));
|
34
|
+
react_1.default.createElement("button", { "aria-label": btnText, className: 'pb-prompt-btn', style: submitButtonStyle, onClick: handleOk }, btnText)));
|
35
35
|
};
|
36
36
|
exports.default = (0, react_1.memo)(Prompt);
|
@@ -12,7 +12,7 @@ const Appoint = (_a) => {
|
|
12
12
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
13
13
|
return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props),
|
14
14
|
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
15
|
-
react_1.default.createElement("img", { className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), src: (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, alt: '' })),
|
15
|
+
react_1.default.createElement("img", { className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), src: (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, alt: 'cta image' })),
|
16
16
|
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_e = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _e !== void 0 ? _e : 'Product Name')));
|
17
17
|
};
|
18
18
|
exports.default = (0, react_1.memo)(Appoint);
|