pb-sxp-ui 1.15.13-alpha.2 → 1.15.13-alpha.4
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 +146 -111
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +144 -109
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +6 -6
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +6 -6
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +146 -111
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +6 -6
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyStoryPreview/VideoWidget.d.ts +2 -0
- package/es/core/components/DiyStoryPreview/VideoWidget.js +6 -4
- package/es/core/components/DiyStoryPreview/index.d.ts +3 -0
- package/es/core/components/DiyStoryPreview/index.js +36 -24
- package/es/core/components/SxpPageCore/index.d.ts +1 -0
- package/es/core/components/SxpPageCore/index.js +7 -7
- package/es/core/context/EditorContext.js +1 -1
- package/es/core/context/SxpDataSourceProvider.d.ts +1 -1
- package/es/core/context/SxpDataSourceProvider.js +23 -24
- package/lib/core/components/DiyStoryPreview/VideoWidget.d.ts +2 -0
- package/lib/core/components/DiyStoryPreview/VideoWidget.js +6 -4
- package/lib/core/components/DiyStoryPreview/index.d.ts +3 -0
- package/lib/core/components/DiyStoryPreview/index.js +34 -22
- package/lib/core/components/SxpPageCore/index.d.ts +1 -0
- package/lib/core/components/SxpPageCore/index.js +7 -7
- package/lib/core/context/EditorContext.js +1 -1
- package/lib/core/context/SxpDataSourceProvider.d.ts +1 -1
- package/lib/core/context/SxpDataSourceProvider.js +23 -24
- package/package.json +1 -1
@@ -12,6 +12,8 @@ interface IVideoWidgetProps {
|
|
12
12
|
videoPostConfig?: postConfigType;
|
13
13
|
swiperRef?: any;
|
14
14
|
loopPlay?: boolean;
|
15
|
+
videoPlayIcon?: string;
|
16
|
+
isPlay?: boolean;
|
15
17
|
}
|
16
18
|
declare const _default: React.NamedExoticComponent<IVideoWidgetProps>;
|
17
19
|
export default _default;
|
@@ -2,8 +2,9 @@ import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from '
|
|
2
2
|
import { useSwiperSlide } from 'swiper/react';
|
3
3
|
import { useIconLink } from '../SxpPageRender/useIconLink';
|
4
4
|
import { mountVideoPlayerAtNode } from '../SxpPageRender/VideoWidget/VideoPlayer';
|
5
|
+
import FormatImage from '../SxpPageRender/FormatImage';
|
5
6
|
import { useSxpDataSource } from '../../../core/hooks';
|
6
|
-
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width, swiperRef, loopPlay }) => {
|
7
|
+
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width, swiperRef, loopPlay, videoPlayIcon, isPlay }) => {
|
7
8
|
const { isActive } = useSwiperSlide();
|
8
9
|
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
9
10
|
const videoRef = useRef(null);
|
@@ -188,9 +189,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
188
189
|
position: 'relative',
|
189
190
|
width: '100%',
|
190
191
|
height,
|
191
|
-
overflow: 'hidden'
|
192
|
-
pointerEvents: 'none'
|
192
|
+
overflow: 'hidden'
|
193
193
|
} },
|
194
|
-
React.createElement("div", { className: 'n-full-screen', id: videoId, style: { width: '100%', height: '100%' } })
|
194
|
+
React.createElement("div", { className: 'n-full-screen', id: videoId, style: { width: '100%', height: '100%' } }),
|
195
|
+
renderPoster,
|
196
|
+
isPauseVideo && React.createElement(FormatImage, { className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' })));
|
195
197
|
};
|
196
198
|
export default memo(VideoWidget);
|
@@ -15,6 +15,7 @@ export interface IScene {
|
|
15
15
|
startTime: number;
|
16
16
|
traceInfo: string;
|
17
17
|
bindProducts?: any[];
|
18
|
+
title?: string;
|
18
19
|
}
|
19
20
|
export type ScenesType = IScene[];
|
20
21
|
export type DiyStoryPreviewType = ISxpPageRenderProps & {
|
@@ -23,6 +24,8 @@ export type DiyStoryPreviewType = ISxpPageRenderProps & {
|
|
23
24
|
activeIndex?: number;
|
24
25
|
onActiveChange?: (v: number) => void;
|
25
26
|
loopPlay?: boolean;
|
27
|
+
pointerEvents?: any;
|
28
|
+
isPlay?: boolean;
|
26
29
|
};
|
27
30
|
declare const _default: React.NamedExoticComponent<DiyStoryPreviewType>;
|
28
31
|
export default _default;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import React, { memo, useEffect, useMemo, useRef } from 'react';
|
1
|
+
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
2
2
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
3
|
-
import { cloneDeep } from 'lodash';
|
3
|
+
import { cloneDeep, debounce } from 'lodash';
|
4
4
|
import RenderCard from '../SxpPageRender/RenderCard';
|
5
5
|
import ExpandableText from '../SxpPageRender/ExpandableText';
|
6
6
|
import LikeButton from '../SxpPageRender/LikeButton';
|
@@ -10,12 +10,6 @@ import PictureGroup from './PictureGroup';
|
|
10
10
|
import VideoWidget from './VideoWidget';
|
11
11
|
import * as _materials_ from '../../../materials';
|
12
12
|
import '../SxpPageRender/index.less';
|
13
|
-
const RESOLVER = {};
|
14
|
-
Object.values(_materials_).forEach((v) => {
|
15
|
-
RESOLVER[v.extend.type] = v;
|
16
|
-
});
|
17
|
-
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
18
|
-
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
19
13
|
const recData = {
|
20
14
|
position: 0,
|
21
15
|
isCollected: false,
|
@@ -194,7 +188,14 @@ const recData = {
|
|
194
188
|
]
|
195
189
|
}
|
196
190
|
};
|
197
|
-
const
|
191
|
+
const RESOLVER = {};
|
192
|
+
Object.values(_materials_).forEach((v) => {
|
193
|
+
RESOLVER[v.extend.type] = v;
|
194
|
+
});
|
195
|
+
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
196
|
+
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
197
|
+
const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [], scenes, onActiveChange, activeIndex, loopPlay = false, pointerEvents = 'none', isPlay }) => {
|
198
|
+
const [loopPlaySwiper, setLooPlaySwiper] = useState(loopPlay);
|
198
199
|
const swiperRef = useRef(null);
|
199
200
|
const height = useMemo(() => {
|
200
201
|
let minusHeight = 0;
|
@@ -219,10 +220,10 @@ const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, des
|
|
219
220
|
const renderContent = (rec, index) => {
|
220
221
|
const isVideo = isVideoUrl(rec === null || rec === void 0 ? void 0 : rec.mediaUrl);
|
221
222
|
if (isVideo) {
|
222
|
-
return (React.createElement(VideoWidget, { rec: rec, index: index, muted: true, width: containerWidth, data: scenes !== null && scenes !== void 0 ? scenes : [], height: containerHeight, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, swiperRef: swiperRef, loopPlay:
|
223
|
+
return (React.createElement(VideoWidget, { isPlay: isPlay, rec: rec, index: index, muted: true, width: containerWidth, data: scenes !== null && scenes !== void 0 ? scenes : [], height: containerHeight, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon, swiperRef: swiperRef, loopPlay: loopPlaySwiper }));
|
223
224
|
}
|
224
225
|
else {
|
225
|
-
return (React.createElement(PictureGroup, { key: rec.itemId, imgUrls: [rec === null || rec === void 0 ? void 0 : rec.mediaUrl], width: containerWidth, height: containerHeight, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost, data: scenes !== null && scenes !== void 0 ? scenes : [], swiperRef: swiperRef, loopPlay:
|
226
|
+
return (React.createElement(PictureGroup, { key: rec.itemId, imgUrls: [rec === null || rec === void 0 ? void 0 : rec.mediaUrl], width: containerWidth, height: containerHeight, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost, data: scenes !== null && scenes !== void 0 ? scenes : [], swiperRef: swiperRef, loopPlay: loopPlaySwiper }));
|
226
227
|
}
|
227
228
|
};
|
228
229
|
const renderLogo = useMemo(() => {
|
@@ -232,14 +233,6 @@ const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, des
|
|
232
233
|
}
|
233
234
|
return null;
|
234
235
|
}, [globalConfig]);
|
235
|
-
const CTA = (rec, index) => {
|
236
|
-
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
|
237
|
-
console.log(globalConfig, rec, '111');
|
238
|
-
return (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
239
|
-
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER })));
|
240
|
-
}
|
241
|
-
return null;
|
242
|
-
};
|
243
236
|
const renderBottom = (rec, index) => {
|
244
237
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
245
238
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
@@ -263,7 +256,7 @@ const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, des
|
|
263
256
|
width: '100%',
|
264
257
|
willChange: 'transform',
|
265
258
|
zIndex: 2,
|
266
|
-
pointerEvents
|
259
|
+
pointerEvents
|
267
260
|
} })),
|
268
261
|
React.createElement("div", { style: {
|
269
262
|
marginBottom: `${(_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _g !== void 0 ? _g : 40}px`,
|
@@ -341,6 +334,7 @@ const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, des
|
|
341
334
|
var _a, _b, _c, _d;
|
342
335
|
const rec = cloneDeep(recData);
|
343
336
|
rec.video.bindProducts = item === null || item === void 0 ? void 0 : item.bindProducts;
|
337
|
+
rec.video.title = (item === null || item === void 0 ? void 0 : item.title) || '';
|
344
338
|
return (React.createElement("div", { style: { position: 'relative' } },
|
345
339
|
React.createElement(SwiperSlide, { key: index, virtualIndex: index, style: { overflow: 'hidden', position: 'relative' } },
|
346
340
|
renderBottom(rec, index),
|
@@ -362,13 +356,31 @@ const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, des
|
|
362
356
|
(_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slideTo(activeIndex);
|
363
357
|
}, [activeIndex]);
|
364
358
|
useEffect(() => {
|
365
|
-
var _a, _b;
|
366
359
|
if (!(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current))
|
367
360
|
return;
|
368
|
-
(
|
361
|
+
setLooPlaySwiper(loopPlay);
|
369
362
|
}, [loopPlay]);
|
370
|
-
|
371
|
-
|
363
|
+
const handleSessionExpire = useCallback(debounce(() => {
|
364
|
+
setLooPlaySwiper(false);
|
365
|
+
}, 1000), []);
|
366
|
+
useEffect(() => {
|
367
|
+
const events = ['touchstart', 'touchcancel'];
|
368
|
+
events.forEach((event) => {
|
369
|
+
window.addEventListener(event, handleSessionExpire);
|
370
|
+
});
|
371
|
+
return () => {
|
372
|
+
events.forEach((event) => {
|
373
|
+
window.removeEventListener(event, handleSessionExpire);
|
374
|
+
});
|
375
|
+
};
|
376
|
+
}, [handleSessionExpire]);
|
377
|
+
return (React.createElement("div", { id: 'sxp-render', style: { height: containerHeight, position: 'relative', pointerEvents } },
|
378
|
+
React.createElement(Swiper, { ref: swiperRef, allowTouchMove: pointerEvents !== 'none', onSlideChange: () => {
|
379
|
+
swiperRef.current.swiper.allowTouchMove = false;
|
380
|
+
setTimeout(() => {
|
381
|
+
swiperRef.current.swiper.allowTouchMove = true;
|
382
|
+
}, 500);
|
383
|
+
}, onActiveIndexChange: (swiper) => {
|
372
384
|
onActiveChange === null || onActiveChange === void 0 ? void 0 : onActiveChange(swiper.activeIndex);
|
373
385
|
}, direction: 'vertical', style: { overflow: 'hidden', height: containerHeight }, height: containerHeight }, scenes === null || scenes === void 0 ? void 0 : scenes.map((rec, index) => {
|
374
386
|
return renderView(rec, index);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { memo, useMemo, useState } from 'react';
|
2
|
-
import SxpPageRender from '../SxpPageRender';
|
3
2
|
import Popup from '../SxpPageRender/Popup';
|
3
|
+
import DiyStoryPreview from '../DiyStoryPreview';
|
4
4
|
import * as _materials_ from '../../../materials';
|
5
5
|
import { EditorCore } from '../../../core';
|
6
6
|
import SxpDataSourceProvider from '../../../core/context/SxpDataSourceProvider';
|
@@ -8,20 +8,20 @@ const RESOLVER = {};
|
|
8
8
|
Object.values(_materials_).forEach((v) => {
|
9
9
|
RESOLVER[v.extend.type] = v;
|
10
10
|
});
|
11
|
-
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, enabledMetaConversionApi, dataList }) => {
|
12
|
-
var _a, _b, _c, _d, _e, _f;
|
11
|
+
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, enabledMetaConversionApi, dataList, pointerEvents }) => {
|
12
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
13
13
|
const utmVal = useMemo(() => {
|
14
14
|
var _a;
|
15
15
|
const searchParams = (location === null || location === void 0 ? void 0 : location.search) ? (_a = location === null || location === void 0 ? void 0 : location.search) === null || _a === void 0 ? void 0 : _a.replace('?', '') : '';
|
16
16
|
return searchParams;
|
17
17
|
}, []);
|
18
|
-
const [_schema, setSchema] = useState(data === null || data === void 0 ? void 0 : data.data);
|
18
|
+
const [_schema, setSchema] = useState((_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.data);
|
19
19
|
const [channel, setChannel] = useState();
|
20
20
|
return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: _schema, utmVal: channel || utmVal },
|
21
|
-
React.createElement(SxpDataSourceProvider, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (
|
22
|
-
var _a;
|
21
|
+
React.createElement(SxpDataSourceProvider, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_c = (_b = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _b === void 0 ? void 0 : _b.personalized_recommend) !== null && _c !== void 0 ? _c : maxSize, defaultSize: (_e = (_d = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _d === void 0 ? void 0 : _d.default_recommend) !== null && _e !== void 0 ? _e : defaultSize, hashTagSize: (_g = (_f = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _f === void 0 ? void 0 : _f.hash_tag_size) !== null && _g !== void 0 ? _g : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter, data: Object.assign(Object.assign({}, data), { data: (_h = data === null || data === void 0 ? void 0 : data.data) === null || _h === void 0 ? void 0 : _h.data }), dataList: dataList, onUpdateSchema: (d) => setSchema(d), onUpdateChannel: (d) => setChannel(d), render: ({ rtcList, tagList, pageData }) => {
|
22
|
+
var _a, _b;
|
23
23
|
return (React.createElement(React.Fragment, null,
|
24
|
-
React.createElement(
|
24
|
+
React.createElement(DiyStoryPreview, Object.assign({ defaultData: Object.assign(Object.assign({}, data), { data: (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.data }) }, (_b = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _b === void 0 ? void 0 : _b.sxpPageConf, { tagList: tagList, scenes: rtcList, resolver: RESOLVER, containerHeight: window === null || window === void 0 ? void 0 : window.innerHeight, pointerEvents: pointerEvents, loopPlay: true })),
|
25
25
|
React.createElement(Popup, null)));
|
26
26
|
} })));
|
27
27
|
};
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useState, useMemo } from 'react';
|
2
2
|
import { cloneDeep } from 'lodash';
|
3
|
+
import { setSlideSkipState } from '../utils/localStore';
|
3
4
|
import DataSourceProvider from './DataSourceProvider';
|
4
5
|
import { uuid } from '../../core/utils/tool';
|
5
|
-
import { setSlideSkipState } from '../utils/localStore';
|
6
6
|
const item = {
|
7
7
|
id: uuid(6, 10),
|
8
8
|
item: {
|
@@ -131,7 +131,7 @@ export interface SxpDataSourceProviderProps {
|
|
131
131
|
isEditor?: boolean;
|
132
132
|
utmParameter?: PageData['utm_parameter'];
|
133
133
|
channelQueryList?: any[];
|
134
|
-
data?:
|
134
|
+
data?: any;
|
135
135
|
dataList?: PageData[];
|
136
136
|
onUpdateSchema?: (d: PageData['data']) => void;
|
137
137
|
onUpdateChannel?: (d: string) => void;
|
@@ -144,17 +144,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
144
144
|
.catch((err) => Promise.reject(err));
|
145
145
|
}, [bffDataSource]);
|
146
146
|
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
147
|
-
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s
|
148
|
-
query = Object.assign({ maxSize:
|
147
|
+
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
148
|
+
query = Object.assign({ maxSize: 50, defaultSize: 50, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag, pageNum: query === null || query === void 0 ? void 0 : query.pageNum, contentFilter: query === null || query === void 0 ? void 0 : query.contentFilter, productFilter: query === null || query === void 0 ? void 0 : query.productFilter }, (chatlabsId && { chatlabsId }));
|
149
149
|
if (channel) {
|
150
150
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
|
151
151
|
}
|
152
152
|
else if (utmVal) {
|
153
|
-
const val = (
|
154
|
-
var _a, _b;
|
153
|
+
const val = (_h = (_g = (_f = splitUrlParams(utmVal)) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
155
154
|
const key = val.split('=')[0];
|
156
|
-
return
|
157
|
-
})) === null ||
|
155
|
+
return key;
|
156
|
+
})) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
|
158
157
|
if (val)
|
159
158
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
160
159
|
}
|
@@ -168,19 +167,19 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
168
167
|
let list = [];
|
169
168
|
let result = null;
|
170
169
|
const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
|
171
|
-
var _v, _w, _x, _y
|
170
|
+
var _t, _u, _v, _w, _x, _y;
|
172
171
|
query.pageNum = pageNum;
|
173
172
|
result = yield (bffFetchAdmin === null || bffFetchAdmin === void 0 ? void 0 : bffFetchAdmin('recommend/direct_page', { method: 'POST', body: query }));
|
174
173
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
175
174
|
return undefined;
|
176
175
|
}
|
177
176
|
setLoading(false);
|
178
|
-
list = list.concat((
|
177
|
+
list = list.concat((_w = (_v = (_u = (_t = result === null || result === void 0 ? void 0 : result.data) === null || _t === void 0 ? void 0 : _t.recList) === null || _u === void 0 ? void 0 : _u.filter) === null || _v === void 0 ? void 0 : _v.call(_u, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _w !== void 0 ? _w : []);
|
179
178
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
180
179
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
181
180
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
182
181
|
}
|
183
|
-
const isNotNullList = (
|
182
|
+
const isNotNullList = (_y = (_x = result === null || result === void 0 ? void 0 : result.data) === null || _x === void 0 ? void 0 : _x.recList) === null || _y === void 0 ? void 0 : _y.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
184
183
|
if (isNotNullList) {
|
185
184
|
pageNum = pageNum + 1;
|
186
185
|
yield recurveRecList(query);
|
@@ -188,13 +187,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
188
187
|
});
|
189
188
|
yield recurveRecList(query);
|
190
189
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
|
191
|
-
setCurReqInfo({ rtc: (
|
190
|
+
setCurReqInfo({ rtc: (_j = result === null || result === void 0 ? void 0 : result.data) === null || _j === void 0 ? void 0 : _j.rtc, requestId: (_k = result === null || result === void 0 ? void 0 : result.data) === null || _k === void 0 ? void 0 : _k.requestId });
|
192
191
|
return Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list });
|
193
192
|
}
|
194
193
|
if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
|
195
|
-
query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (
|
194
|
+
query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_l = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _l !== void 0 ? _l : 1 });
|
196
195
|
}
|
197
|
-
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('
|
196
|
+
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v3/recommend/direct', { method: 'POST', body: query }));
|
198
197
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
199
198
|
return undefined;
|
200
199
|
}
|
@@ -202,8 +201,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
202
201
|
setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
|
203
202
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
|
204
203
|
let list = [];
|
205
|
-
list = list.concat((
|
206
|
-
const isNotNullList = (
|
204
|
+
list = list.concat((_q = (_p = (_o = (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.recList) === null || _o === void 0 ? void 0 : _o.filter) === null || _p === void 0 ? void 0 : _p.call(_o, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _q !== void 0 ? _q : []);
|
205
|
+
const isNotNullList = (_s = (_r = result === null || result === void 0 ? void 0 : result.data) === null || _r === void 0 ? void 0 : _r.recList) === null || _s === void 0 ? void 0 : _s.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
207
206
|
if (!isNotNullList) {
|
208
207
|
setIsNoMoreData(true);
|
209
208
|
}
|
@@ -212,12 +211,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
212
211
|
return result === null || result === void 0 ? void 0 : result.data;
|
213
212
|
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin]);
|
214
213
|
const loadVideos = useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
|
215
|
-
var
|
214
|
+
var _z, _0, _1, _2;
|
216
215
|
if (rtcList.length <= 0) {
|
217
216
|
return;
|
218
217
|
}
|
219
218
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
220
|
-
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((
|
219
|
+
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_z = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _z === void 0 ? void 0 : _z.itemId) && { productFilter: [(_0 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _0 === void 0 ? void 0 : _0.itemId] })), (((_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _1 === void 0 ? void 0 : _1.itemId) && { contentFilter: [(_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _2 === void 0 ? void 0 : _2.itemId] })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
|
221
220
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
222
221
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
223
222
|
return data;
|
@@ -376,18 +375,18 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
376
375
|
return res === null || res === void 0 ? void 0 : res.success;
|
377
376
|
}), [bffFetch]);
|
378
377
|
const bffGetTagList = useCallback((data) => __awaiter(void 0, void 0, void 0, function* () {
|
379
|
-
var _5, _6, _7, _8, _9, _10
|
380
|
-
const isShowTag = !!((
|
378
|
+
var _3, _4, _5, _6, _7, _8, _9, _10;
|
379
|
+
const isShowTag = !!((_5 = (_4 = (_3 = data === null || data === void 0 ? void 0 : data.data) === null || _3 === void 0 ? void 0 : _3.sxpPageConf) === null || _4 === void 0 ? void 0 : _4.globalConfig) === null || _5 === void 0 ? void 0 : _5.isShowTag);
|
381
380
|
if (!utmVal || !isShowTag)
|
382
381
|
return;
|
383
382
|
try {
|
384
|
-
const val = (
|
383
|
+
const val = (_8 = (_7 = (_6 = splitUrlParams(utmVal)) === null || _6 === void 0 ? void 0 : _6.filter((val) => {
|
385
384
|
var _a, _b;
|
386
385
|
const key = val.split('=')[0];
|
387
386
|
return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
|
388
|
-
})) === null ||
|
387
|
+
})) === null || _7 === void 0 ? void 0 : _7.join('&')) !== null && _8 !== void 0 ? _8 : '';
|
389
388
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
390
|
-
setTagList((
|
389
|
+
setTagList((_10 = (_9 = result === null || result === void 0 ? void 0 : result.data) === null || _9 === void 0 ? void 0 : _9.tags) !== null && _10 !== void 0 ? _10 : []);
|
391
390
|
}
|
392
391
|
catch (e) {
|
393
392
|
console.log('e', e);
|
@@ -447,10 +446,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
447
446
|
});
|
448
447
|
}, [bffEventReport]);
|
449
448
|
const getAccount = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
450
|
-
var
|
449
|
+
var _11, _12;
|
451
450
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account', { method: 'GET' }));
|
452
|
-
setChatlabsId((
|
453
|
-
return ((
|
451
|
+
setChatlabsId((_11 = res === null || res === void 0 ? void 0 : res.data) === null || _11 === void 0 ? void 0 : _11.chatLabsId);
|
452
|
+
return ((_12 = res === null || res === void 0 ? void 0 : res.data) === null || _12 === void 0 ? void 0 : _12.consentResult) === 'true';
|
454
453
|
}), [bffFetch]);
|
455
454
|
const accountSonsent = useCallback((consentResult) => __awaiter(void 0, void 0, void 0, function* () {
|
456
455
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account/consent', {
|
@@ -12,6 +12,8 @@ interface IVideoWidgetProps {
|
|
12
12
|
videoPostConfig?: postConfigType;
|
13
13
|
swiperRef?: any;
|
14
14
|
loopPlay?: boolean;
|
15
|
+
videoPlayIcon?: string;
|
16
|
+
isPlay?: boolean;
|
15
17
|
}
|
16
18
|
declare const _default: React.NamedExoticComponent<IVideoWidgetProps>;
|
17
19
|
export default _default;
|
@@ -5,8 +5,9 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const react_2 = require("swiper/react");
|
6
6
|
const useIconLink_1 = require("../SxpPageRender/useIconLink");
|
7
7
|
const VideoPlayer_1 = require("../SxpPageRender/VideoWidget/VideoPlayer");
|
8
|
+
const FormatImage_1 = tslib_1.__importDefault(require("../SxpPageRender/FormatImage"));
|
8
9
|
const hooks_1 = require("../../../core/hooks");
|
9
|
-
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width, swiperRef, loopPlay }) => {
|
10
|
+
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width, swiperRef, loopPlay, videoPlayIcon, isPlay }) => {
|
10
11
|
const { isActive } = (0, react_2.useSwiperSlide)();
|
11
12
|
const [isPauseVideo, setIsPauseVideo] = (0, react_1.useState)(false);
|
12
13
|
const videoRef = (0, react_1.useRef)(null);
|
@@ -191,9 +192,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
191
192
|
position: 'relative',
|
192
193
|
width: '100%',
|
193
194
|
height,
|
194
|
-
overflow: 'hidden'
|
195
|
-
pointerEvents: 'none'
|
195
|
+
overflow: 'hidden'
|
196
196
|
} },
|
197
|
-
react_1.default.createElement("div", { className: 'n-full-screen', id: videoId, style: { width: '100%', height: '100%' } })
|
197
|
+
react_1.default.createElement("div", { className: 'n-full-screen', id: videoId, style: { width: '100%', height: '100%' } }),
|
198
|
+
renderPoster,
|
199
|
+
isPauseVideo && react_1.default.createElement(FormatImage_1.default, { className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' })));
|
198
200
|
};
|
199
201
|
exports.default = (0, react_1.memo)(VideoWidget);
|
@@ -15,6 +15,7 @@ export interface IScene {
|
|
15
15
|
startTime: number;
|
16
16
|
traceInfo: string;
|
17
17
|
bindProducts?: any[];
|
18
|
+
title?: string;
|
18
19
|
}
|
19
20
|
export type ScenesType = IScene[];
|
20
21
|
export type DiyStoryPreviewType = ISxpPageRenderProps & {
|
@@ -23,6 +24,8 @@ export type DiyStoryPreviewType = ISxpPageRenderProps & {
|
|
23
24
|
activeIndex?: number;
|
24
25
|
onActiveChange?: (v: number) => void;
|
25
26
|
loopPlay?: boolean;
|
27
|
+
pointerEvents?: any;
|
28
|
+
isPlay?: boolean;
|
26
29
|
};
|
27
30
|
declare const _default: React.NamedExoticComponent<DiyStoryPreviewType>;
|
28
31
|
export default _default;
|
@@ -13,12 +13,6 @@ const PictureGroup_1 = tslib_1.__importDefault(require("./PictureGroup"));
|
|
13
13
|
const VideoWidget_1 = tslib_1.__importDefault(require("./VideoWidget"));
|
14
14
|
const _materials_ = tslib_1.__importStar(require("../../../materials"));
|
15
15
|
require("../SxpPageRender/index.less");
|
16
|
-
const RESOLVER = {};
|
17
|
-
Object.values(_materials_).forEach((v) => {
|
18
|
-
RESOLVER[v.extend.type] = v;
|
19
|
-
});
|
20
|
-
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
21
|
-
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
22
16
|
const recData = {
|
23
17
|
position: 0,
|
24
18
|
isCollected: false,
|
@@ -197,7 +191,14 @@ const recData = {
|
|
197
191
|
]
|
198
192
|
}
|
199
193
|
};
|
200
|
-
const
|
194
|
+
const RESOLVER = {};
|
195
|
+
Object.values(_materials_).forEach((v) => {
|
196
|
+
RESOLVER[v.extend.type] = v;
|
197
|
+
});
|
198
|
+
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
199
|
+
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
200
|
+
const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [], scenes, onActiveChange, activeIndex, loopPlay = false, pointerEvents = 'none', isPlay }) => {
|
201
|
+
const [loopPlaySwiper, setLooPlaySwiper] = (0, react_1.useState)(loopPlay);
|
201
202
|
const swiperRef = (0, react_1.useRef)(null);
|
202
203
|
const height = (0, react_1.useMemo)(() => {
|
203
204
|
let minusHeight = 0;
|
@@ -222,10 +223,10 @@ const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, des
|
|
222
223
|
const renderContent = (rec, index) => {
|
223
224
|
const isVideo = isVideoUrl(rec === null || rec === void 0 ? void 0 : rec.mediaUrl);
|
224
225
|
if (isVideo) {
|
225
|
-
return (react_1.default.createElement(VideoWidget_1.default, { rec: rec, index: index, muted: true, width: containerWidth, data: scenes !== null && scenes !== void 0 ? scenes : [], height: containerHeight, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, swiperRef: swiperRef, loopPlay:
|
226
|
+
return (react_1.default.createElement(VideoWidget_1.default, { isPlay: isPlay, rec: rec, index: index, muted: true, width: containerWidth, data: scenes !== null && scenes !== void 0 ? scenes : [], height: containerHeight, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon, swiperRef: swiperRef, loopPlay: loopPlaySwiper }));
|
226
227
|
}
|
227
228
|
else {
|
228
|
-
return (react_1.default.createElement(PictureGroup_1.default, { key: rec.itemId, imgUrls: [rec === null || rec === void 0 ? void 0 : rec.mediaUrl], width: containerWidth, height: containerHeight, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost, data: scenes !== null && scenes !== void 0 ? scenes : [], swiperRef: swiperRef, loopPlay:
|
229
|
+
return (react_1.default.createElement(PictureGroup_1.default, { key: rec.itemId, imgUrls: [rec === null || rec === void 0 ? void 0 : rec.mediaUrl], width: containerWidth, height: containerHeight, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost, data: scenes !== null && scenes !== void 0 ? scenes : [], swiperRef: swiperRef, loopPlay: loopPlaySwiper }));
|
229
230
|
}
|
230
231
|
};
|
231
232
|
const renderLogo = (0, react_1.useMemo)(() => {
|
@@ -235,14 +236,6 @@ const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, des
|
|
235
236
|
}
|
236
237
|
return null;
|
237
238
|
}, [globalConfig]);
|
238
|
-
const CTA = (rec, index) => {
|
239
|
-
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
|
240
|
-
console.log(globalConfig, rec, '111');
|
241
|
-
return (react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
|
242
|
-
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER })));
|
243
|
-
}
|
244
|
-
return null;
|
245
|
-
};
|
246
239
|
const renderBottom = (rec, index) => {
|
247
240
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
248
241
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
@@ -266,7 +259,7 @@ const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, des
|
|
266
259
|
width: '100%',
|
267
260
|
willChange: 'transform',
|
268
261
|
zIndex: 2,
|
269
|
-
pointerEvents
|
262
|
+
pointerEvents
|
270
263
|
} })),
|
271
264
|
react_1.default.createElement("div", { style: {
|
272
265
|
marginBottom: `${(_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _g !== void 0 ? _g : 40}px`,
|
@@ -344,6 +337,7 @@ const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, des
|
|
344
337
|
var _a, _b, _c, _d;
|
345
338
|
const rec = (0, lodash_1.cloneDeep)(recData);
|
346
339
|
rec.video.bindProducts = item === null || item === void 0 ? void 0 : item.bindProducts;
|
340
|
+
rec.video.title = (item === null || item === void 0 ? void 0 : item.title) || '';
|
347
341
|
return (react_1.default.createElement("div", { style: { position: 'relative' } },
|
348
342
|
react_1.default.createElement(react_2.SwiperSlide, { key: index, virtualIndex: index, style: { overflow: 'hidden', position: 'relative' } },
|
349
343
|
renderBottom(rec, index),
|
@@ -365,13 +359,31 @@ const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, des
|
|
365
359
|
(_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slideTo(activeIndex);
|
366
360
|
}, [activeIndex]);
|
367
361
|
(0, react_1.useEffect)(() => {
|
368
|
-
var _a, _b;
|
369
362
|
if (!(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current))
|
370
363
|
return;
|
371
|
-
(
|
364
|
+
setLooPlaySwiper(loopPlay);
|
372
365
|
}, [loopPlay]);
|
373
|
-
|
374
|
-
|
366
|
+
const handleSessionExpire = (0, react_1.useCallback)((0, lodash_1.debounce)(() => {
|
367
|
+
setLooPlaySwiper(false);
|
368
|
+
}, 1000), []);
|
369
|
+
(0, react_1.useEffect)(() => {
|
370
|
+
const events = ['touchstart', 'touchcancel'];
|
371
|
+
events.forEach((event) => {
|
372
|
+
window.addEventListener(event, handleSessionExpire);
|
373
|
+
});
|
374
|
+
return () => {
|
375
|
+
events.forEach((event) => {
|
376
|
+
window.removeEventListener(event, handleSessionExpire);
|
377
|
+
});
|
378
|
+
};
|
379
|
+
}, [handleSessionExpire]);
|
380
|
+
return (react_1.default.createElement("div", { id: 'sxp-render', style: { height: containerHeight, position: 'relative', pointerEvents } },
|
381
|
+
react_1.default.createElement(react_2.Swiper, { ref: swiperRef, allowTouchMove: pointerEvents !== 'none', onSlideChange: () => {
|
382
|
+
swiperRef.current.swiper.allowTouchMove = false;
|
383
|
+
setTimeout(() => {
|
384
|
+
swiperRef.current.swiper.allowTouchMove = true;
|
385
|
+
}, 500);
|
386
|
+
}, onActiveIndexChange: (swiper) => {
|
375
387
|
onActiveChange === null || onActiveChange === void 0 ? void 0 : onActiveChange(swiper.activeIndex);
|
376
388
|
}, direction: 'vertical', style: { overflow: 'hidden', height: containerHeight }, height: containerHeight }, scenes === null || scenes === void 0 ? void 0 : scenes.map((rec, index) => {
|
377
389
|
return renderView(rec, index);
|
@@ -2,8 +2,8 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const tslib_1 = require("tslib");
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
5
|
-
const SxpPageRender_1 = tslib_1.__importDefault(require("../SxpPageRender"));
|
6
5
|
const Popup_1 = tslib_1.__importDefault(require("../SxpPageRender/Popup"));
|
6
|
+
const DiyStoryPreview_1 = tslib_1.__importDefault(require("../DiyStoryPreview"));
|
7
7
|
const _materials_ = tslib_1.__importStar(require("../../../materials"));
|
8
8
|
const core_1 = require("../../../core");
|
9
9
|
const SxpDataSourceProvider_1 = tslib_1.__importDefault(require("../../../core/context/SxpDataSourceProvider"));
|
@@ -11,20 +11,20 @@ const RESOLVER = {};
|
|
11
11
|
Object.values(_materials_).forEach((v) => {
|
12
12
|
RESOLVER[v.extend.type] = v;
|
13
13
|
});
|
14
|
-
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, enabledMetaConversionApi, dataList }) => {
|
15
|
-
var _a, _b, _c, _d, _e, _f;
|
14
|
+
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, enabledMetaConversionApi, dataList, pointerEvents }) => {
|
15
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
16
16
|
const utmVal = (0, react_1.useMemo)(() => {
|
17
17
|
var _a;
|
18
18
|
const searchParams = (location === null || location === void 0 ? void 0 : location.search) ? (_a = location === null || location === void 0 ? void 0 : location.search) === null || _a === void 0 ? void 0 : _a.replace('?', '') : '';
|
19
19
|
return searchParams;
|
20
20
|
}, []);
|
21
|
-
const [_schema, setSchema] = (0, react_1.useState)(data === null || data === void 0 ? void 0 : data.data);
|
21
|
+
const [_schema, setSchema] = (0, react_1.useState)((_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.data);
|
22
22
|
const [channel, setChannel] = (0, react_1.useState)();
|
23
23
|
return (react_1.default.createElement(core_1.EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: _schema, utmVal: channel || utmVal },
|
24
|
-
react_1.default.createElement(SxpDataSourceProvider_1.default, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (
|
25
|
-
var _a;
|
24
|
+
react_1.default.createElement(SxpDataSourceProvider_1.default, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_c = (_b = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _b === void 0 ? void 0 : _b.personalized_recommend) !== null && _c !== void 0 ? _c : maxSize, defaultSize: (_e = (_d = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _d === void 0 ? void 0 : _d.default_recommend) !== null && _e !== void 0 ? _e : defaultSize, hashTagSize: (_g = (_f = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _f === void 0 ? void 0 : _f.hash_tag_size) !== null && _g !== void 0 ? _g : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter, data: Object.assign(Object.assign({}, data), { data: (_h = data === null || data === void 0 ? void 0 : data.data) === null || _h === void 0 ? void 0 : _h.data }), dataList: dataList, onUpdateSchema: (d) => setSchema(d), onUpdateChannel: (d) => setChannel(d), render: ({ rtcList, tagList, pageData }) => {
|
25
|
+
var _a, _b;
|
26
26
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
27
|
-
react_1.default.createElement(
|
27
|
+
react_1.default.createElement(DiyStoryPreview_1.default, Object.assign({ defaultData: Object.assign(Object.assign({}, data), { data: (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.data }) }, (_b = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _b === void 0 ? void 0 : _b.sxpPageConf, { tagList: tagList, scenes: rtcList, resolver: RESOLVER, containerHeight: window === null || window === void 0 ? void 0 : window.innerHeight, pointerEvents: pointerEvents, loopPlay: true })),
|
28
28
|
react_1.default.createElement(Popup_1.default, null)));
|
29
29
|
} })));
|
30
30
|
};
|
@@ -4,9 +4,9 @@ exports.EditorCore = exports.EditorContext = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
6
6
|
const lodash_1 = require("lodash");
|
7
|
+
const localStore_1 = require("../utils/localStore");
|
7
8
|
const DataSourceProvider_1 = tslib_1.__importDefault(require("./DataSourceProvider"));
|
8
9
|
const tool_1 = require("../../core/utils/tool");
|
9
|
-
const localStore_1 = require("../utils/localStore");
|
10
10
|
const item = {
|
11
11
|
id: (0, tool_1.uuid)(6, 10),
|
12
12
|
item: {
|