pb-sxp-ui 1.7.5 → 1.7.7
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 +45 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +46 -48
- 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 +45 -47
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/PictureGroup/index.js +1 -1
- package/es/core/components/SxpPageRender/RenderCard.d.ts +1 -0
- package/es/core/components/SxpPageRender/RenderCard.js +15 -39
- package/es/core/components/SxpPageRender/VideoWidget/index.js +1 -1
- package/es/core/components/SxpPageRender/index.js +19 -8
- package/es/core/context/SxpDataSourceProvider.js +8 -1
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +1 -1
- package/lib/core/components/SxpPageRender/RenderCard.d.ts +1 -0
- package/lib/core/components/SxpPageRender/RenderCard.js +15 -39
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +1 -1
- package/lib/core/components/SxpPageRender/index.js +19 -8
- package/lib/core/context/SxpDataSourceProvider.js +8 -1
- package/package.json +1 -1
@@ -31,7 +31,7 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onViewImageEndEvent,
|
|
31
31
|
const showFirstImageFn = useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
32
32
|
if (!isLoad) {
|
33
33
|
setImgInfo({
|
34
|
-
loadTime:
|
34
|
+
loadTime: new Date() - initTime + ''
|
35
35
|
});
|
36
36
|
setIsLoad(true);
|
37
37
|
}
|
@@ -3,59 +3,35 @@ import './index.less';
|
|
3
3
|
import withBindDataSource from '../../../core/hoc/withBindDataSource';
|
4
4
|
import { useEditor } from '../../../core/hooks';
|
5
5
|
import { cloneDeep } from 'lodash';
|
6
|
-
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }) => {
|
7
|
-
var _a, _b, _c, _d, _e;
|
6
|
+
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive, value }) => {
|
8
7
|
const { schema } = useEditor();
|
9
8
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
10
9
|
return null;
|
11
|
-
let cta = null;
|
12
|
-
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) {
|
13
|
-
cta = '多商品CTA';
|
14
|
-
}
|
15
|
-
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
16
|
-
cta = '商品CTA';
|
17
|
-
}
|
18
|
-
else {
|
19
|
-
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;
|
20
|
-
}
|
21
|
-
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
22
10
|
const renderComp = useMemo(() => {
|
23
|
-
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
|
24
|
-
if (!(
|
25
|
-
return null;
|
26
|
-
let cta = null;
|
27
|
-
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) {
|
28
|
-
cta = '多商品CTA';
|
29
|
-
}
|
30
|
-
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
31
|
-
cta = '商品CTA';
|
32
|
-
}
|
33
|
-
else {
|
34
|
-
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;
|
35
|
-
}
|
36
|
-
if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.type)))
|
11
|
+
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;
|
12
|
+
if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type)))
|
37
13
|
return;
|
38
|
-
if (!includesCtaType && ((
|
14
|
+
if (!includesCtaType && ((_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.category) === 'cta')
|
39
15
|
return;
|
40
|
-
if ((((
|
41
|
-
(((
|
42
|
-
(((
|
43
|
-
(((
|
44
|
-
(((
|
45
|
-
(((
|
16
|
+
if ((((_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.type) === 'CommodityDiro' && !((_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindProduct)) ||
|
17
|
+
(((_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.type) === 'Commodity' && !((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct)) ||
|
18
|
+
(((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.type) === 'CommodityDiroNew' && !((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.bindProduct)) ||
|
19
|
+
(((_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.type) === 'MultiCommodity' && !((_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.bindProducts) === null || _l === void 0 ? void 0 : _l.length)) ||
|
20
|
+
(((_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.type) === 'MultiCommodityDiro' && !((_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.bindProducts) === null || _p === void 0 ? void 0 : _p.length)) ||
|
21
|
+
(((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.type) === 'MultiCommodityDiroNew' && !((_s = (_r = rec === null || rec === void 0 ? void 0 : rec.video) === null || _r === void 0 ? void 0 : _r.bindProducts) === null || _s === void 0 ? void 0 : _s.length))) {
|
46
22
|
return null;
|
47
23
|
}
|
48
24
|
if (value && resolver) {
|
49
|
-
const t = resolver[(
|
25
|
+
const t = resolver[(_t = value === null || value === void 0 ? void 0 : value.item) === null || _t === void 0 ? void 0 : _t.type];
|
50
26
|
const Component = withBindDataSource(t);
|
51
|
-
const defaulSetting = (
|
52
|
-
const isExternalLink = ((
|
53
|
-
let style = cloneDeep((
|
27
|
+
const defaulSetting = (_u = t === null || t === void 0 ? void 0 : t.extend) === null || _u === void 0 ? void 0 : _u.defaulSetting;
|
28
|
+
const isExternalLink = ((_x = (_w = (_v = value === null || value === void 0 ? void 0 : value.item) === null || _v === void 0 ? void 0 : _v.event) === null || _w === void 0 ? void 0 : _w.onClick) === null || _x === void 0 ? void 0 : _x.linkType) === 'externalLink';
|
29
|
+
let style = cloneDeep((_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.style);
|
54
30
|
if (style.hasOwnProperty('backdropFilter')) {
|
55
31
|
let sbf = style['backdropFilter'];
|
56
32
|
style['backdropFilter'] = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
|
57
33
|
}
|
58
|
-
return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (
|
34
|
+
return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_z = value === null || value === void 0 ? void 0 : value.item) === null || _z === void 0 ? void 0 : _z.textStyle), bindDatas: (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.bindDatas) !== null && _1 !== void 0 ? _1 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.props, { event: ((_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index, isActive: isActive })));
|
59
35
|
}
|
60
36
|
else {
|
61
37
|
return null;
|
@@ -92,7 +92,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
92
92
|
position: index + '',
|
93
93
|
contentFormat: 'video',
|
94
94
|
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo,
|
95
|
-
loadTime: (
|
95
|
+
loadTime: (loadedTimeRef === null || loadedTimeRef === void 0 ? void 0 : loadedTimeRef.current) - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current) + ''
|
96
96
|
}
|
97
97
|
});
|
98
98
|
setIsFirstPlay(false);
|
@@ -254,19 +254,30 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
254
254
|
};
|
255
255
|
}, [isShowMore]);
|
256
256
|
const renderBottom = useCallback((rec, index) => {
|
257
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
257
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
258
258
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
259
|
+
let cta = null;
|
260
|
+
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) {
|
261
|
+
cta = '多商品CTA';
|
262
|
+
}
|
263
|
+
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
264
|
+
cta = '商品CTA';
|
265
|
+
}
|
266
|
+
else {
|
267
|
+
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;
|
268
|
+
}
|
269
|
+
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
259
270
|
return (React.createElement(React.Fragment, null,
|
260
|
-
((
|
261
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
271
|
+
((_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' }),
|
272
|
+
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` } },
|
262
273
|
React.createElement(Nudge, { nudge: nudge }),
|
263
274
|
(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' },
|
264
|
-
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex }))) : null,
|
275
|
+
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
265
276
|
React.createElement("div", null,
|
266
|
-
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: (
|
267
|
-
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
|
268
|
-
React.createElement(Hashtag, { index: activeIndex, tags: (
|
269
|
-
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
277
|
+
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 }),
|
278
|
+
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
279
|
+
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) }))),
|
280
|
+
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
270
281
|
}
|
271
282
|
return null;
|
272
283
|
}, [
|
@@ -7,6 +7,7 @@ import { useIconLink } from '../components/SxpPageRender/useIconLink';
|
|
7
7
|
import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../utils/event';
|
8
8
|
import Consent from '../components/Consent';
|
9
9
|
import { getBrowserInfo, getCookie, getDevice, getSystem } from '../utils/tool';
|
10
|
+
import { cloneDeep } from 'lodash';
|
10
11
|
export const SxpDataSourceContext = createContext({
|
11
12
|
rtcList: [],
|
12
13
|
tagList: []
|
@@ -197,7 +198,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
197
198
|
!((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName])) {
|
198
199
|
return;
|
199
200
|
}
|
200
|
-
let jsonParams =
|
201
|
+
let jsonParams = cloneDeep((_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _b === void 0 ? void 0 : _b[eventName]);
|
201
202
|
const urlParams = new URLSearchParams(window.location.search);
|
202
203
|
const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
|
203
204
|
const fix_par = {
|
@@ -226,10 +227,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
226
227
|
const matches = value === null || value === void 0 ? void 0 : value.match(regex);
|
227
228
|
if (matches) {
|
228
229
|
matches.forEach((match) => {
|
230
|
+
var _a;
|
229
231
|
const prop = match.substring(2, match.length - 2);
|
230
232
|
try {
|
231
233
|
let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
|
232
234
|
if (replaceValue) {
|
235
|
+
if (prop.indexOf('currency') &&
|
236
|
+
(replaceValue === null || replaceValue === void 0 ? void 0 : replaceValue.indexOf('-')) !== -1 &&
|
237
|
+
typeof replaceValue === 'string') {
|
238
|
+
replaceValue = (_a = replaceValue === null || replaceValue === void 0 ? void 0 : replaceValue.split('-')) === null || _a === void 0 ? void 0 : _a[0];
|
239
|
+
}
|
233
240
|
obj[key] = replaceValue;
|
234
241
|
}
|
235
242
|
else {
|
@@ -33,7 +33,7 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onViewImageEndEvent,
|
|
33
33
|
const showFirstImageFn = (0, react_1.useCallback)((e) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
34
34
|
if (!isLoad) {
|
35
35
|
setImgInfo({
|
36
|
-
loadTime:
|
36
|
+
loadTime: new Date() - initTime + ''
|
37
37
|
});
|
38
38
|
setIsLoad(true);
|
39
39
|
}
|
@@ -6,59 +6,35 @@ require("./index.less");
|
|
6
6
|
const withBindDataSource_1 = tslib_1.__importDefault(require("../../../core/hoc/withBindDataSource"));
|
7
7
|
const hooks_1 = require("../../../core/hooks");
|
8
8
|
const lodash_1 = require("lodash");
|
9
|
-
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }) => {
|
10
|
-
var _a, _b, _c, _d, _e;
|
9
|
+
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive, value }) => {
|
11
10
|
const { schema } = (0, hooks_1.useEditor)();
|
12
11
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
13
12
|
return null;
|
14
|
-
let cta = null;
|
15
|
-
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) {
|
16
|
-
cta = '多商品CTA';
|
17
|
-
}
|
18
|
-
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
19
|
-
cta = '商品CTA';
|
20
|
-
}
|
21
|
-
else {
|
22
|
-
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;
|
23
|
-
}
|
24
|
-
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
25
13
|
const renderComp = (0, react_1.useMemo)(() => {
|
26
|
-
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
|
27
|
-
if (!(
|
28
|
-
return null;
|
29
|
-
let cta = null;
|
30
|
-
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) {
|
31
|
-
cta = '多商品CTA';
|
32
|
-
}
|
33
|
-
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
34
|
-
cta = '商品CTA';
|
35
|
-
}
|
36
|
-
else {
|
37
|
-
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;
|
38
|
-
}
|
39
|
-
if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.type)))
|
14
|
+
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;
|
15
|
+
if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type)))
|
40
16
|
return;
|
41
|
-
if (!includesCtaType && ((
|
17
|
+
if (!includesCtaType && ((_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.category) === 'cta')
|
42
18
|
return;
|
43
|
-
if ((((
|
44
|
-
(((
|
45
|
-
(((
|
46
|
-
(((
|
47
|
-
(((
|
48
|
-
(((
|
19
|
+
if ((((_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.type) === 'CommodityDiro' && !((_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindProduct)) ||
|
20
|
+
(((_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.type) === 'Commodity' && !((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct)) ||
|
21
|
+
(((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.type) === 'CommodityDiroNew' && !((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.bindProduct)) ||
|
22
|
+
(((_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.type) === 'MultiCommodity' && !((_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.bindProducts) === null || _l === void 0 ? void 0 : _l.length)) ||
|
23
|
+
(((_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.type) === 'MultiCommodityDiro' && !((_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.bindProducts) === null || _p === void 0 ? void 0 : _p.length)) ||
|
24
|
+
(((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.type) === 'MultiCommodityDiroNew' && !((_s = (_r = rec === null || rec === void 0 ? void 0 : rec.video) === null || _r === void 0 ? void 0 : _r.bindProducts) === null || _s === void 0 ? void 0 : _s.length))) {
|
49
25
|
return null;
|
50
26
|
}
|
51
27
|
if (value && resolver) {
|
52
|
-
const t = resolver[(
|
28
|
+
const t = resolver[(_t = value === null || value === void 0 ? void 0 : value.item) === null || _t === void 0 ? void 0 : _t.type];
|
53
29
|
const Component = (0, withBindDataSource_1.default)(t);
|
54
|
-
const defaulSetting = (
|
55
|
-
const isExternalLink = ((
|
56
|
-
let style = (0, lodash_1.cloneDeep)((
|
30
|
+
const defaulSetting = (_u = t === null || t === void 0 ? void 0 : t.extend) === null || _u === void 0 ? void 0 : _u.defaulSetting;
|
31
|
+
const isExternalLink = ((_x = (_w = (_v = value === null || value === void 0 ? void 0 : value.item) === null || _v === void 0 ? void 0 : _v.event) === null || _w === void 0 ? void 0 : _w.onClick) === null || _x === void 0 ? void 0 : _x.linkType) === 'externalLink';
|
32
|
+
let style = (0, lodash_1.cloneDeep)((_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.style);
|
57
33
|
if (style.hasOwnProperty('backdropFilter')) {
|
58
34
|
let sbf = style['backdropFilter'];
|
59
35
|
style['backdropFilter'] = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
|
60
36
|
}
|
61
|
-
return (react_1.default.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (
|
37
|
+
return (react_1.default.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_z = value === null || value === void 0 ? void 0 : value.item) === null || _z === void 0 ? void 0 : _z.textStyle), bindDatas: (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.bindDatas) !== null && _1 !== void 0 ? _1 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.props, { event: ((_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index, isActive: isActive })));
|
62
38
|
}
|
63
39
|
else {
|
64
40
|
return null;
|
@@ -94,7 +94,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
94
94
|
position: index + '',
|
95
95
|
contentFormat: 'video',
|
96
96
|
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo,
|
97
|
-
loadTime: (
|
97
|
+
loadTime: (loadedTimeRef === null || loadedTimeRef === void 0 ? void 0 : loadedTimeRef.current) - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current) + ''
|
98
98
|
}
|
99
99
|
});
|
100
100
|
setIsFirstPlay(false);
|
@@ -257,19 +257,30 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
257
257
|
};
|
258
258
|
}, [isShowMore]);
|
259
259
|
const renderBottom = (0, react_1.useCallback)((rec, index) => {
|
260
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
260
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
261
261
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
262
|
+
let cta = null;
|
263
|
+
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) {
|
264
|
+
cta = '多商品CTA';
|
265
|
+
}
|
266
|
+
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
267
|
+
cta = '商品CTA';
|
268
|
+
}
|
269
|
+
else {
|
270
|
+
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;
|
271
|
+
}
|
272
|
+
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
262
273
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
263
|
-
((
|
264
|
-
react_1.default.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
274
|
+
((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.title) && !isShowMore && react_1.default.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
275
|
+
react_1.default.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` } },
|
265
276
|
react_1.default.createElement(Nudge_1.default, { nudge: nudge }),
|
266
277
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
|
267
|
-
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex }))) : null,
|
278
|
+
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
268
279
|
react_1.default.createElement("div", null,
|
269
|
-
react_1.default.createElement(ExpandableText_1.default, { 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: (
|
270
|
-
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
|
271
|
-
react_1.default.createElement(Hashtag_1.default, { index: activeIndex, tags: (
|
272
|
-
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
280
|
+
react_1.default.createElement(ExpandableText_1.default, { 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 }),
|
281
|
+
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
282
|
+
react_1.default.createElement(Hashtag_1.default, { 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) }))),
|
283
|
+
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
273
284
|
}
|
274
285
|
return null;
|
275
286
|
}, [
|
@@ -10,6 +10,7 @@ const useIconLink_1 = require("../components/SxpPageRender/useIconLink");
|
|
10
10
|
const event_1 = tslib_1.__importStar(require("../utils/event"));
|
11
11
|
const Consent_1 = tslib_1.__importDefault(require("../components/Consent"));
|
12
12
|
const tool_1 = require("../utils/tool");
|
13
|
+
const lodash_1 = require("lodash");
|
13
14
|
exports.SxpDataSourceContext = (0, react_1.createContext)({
|
14
15
|
rtcList: [],
|
15
16
|
tagList: []
|
@@ -200,7 +201,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
200
201
|
!((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName])) {
|
201
202
|
return;
|
202
203
|
}
|
203
|
-
let jsonParams =
|
204
|
+
let jsonParams = (0, lodash_1.cloneDeep)((_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _b === void 0 ? void 0 : _b[eventName]);
|
204
205
|
const urlParams = new URLSearchParams(window.location.search);
|
205
206
|
const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
|
206
207
|
const fix_par = {
|
@@ -229,10 +230,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
229
230
|
const matches = value === null || value === void 0 ? void 0 : value.match(regex);
|
230
231
|
if (matches) {
|
231
232
|
matches.forEach((match) => {
|
233
|
+
var _a;
|
232
234
|
const prop = match.substring(2, match.length - 2);
|
233
235
|
try {
|
234
236
|
let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
|
235
237
|
if (replaceValue) {
|
238
|
+
if (prop.indexOf('currency') &&
|
239
|
+
(replaceValue === null || replaceValue === void 0 ? void 0 : replaceValue.indexOf('-')) !== -1 &&
|
240
|
+
typeof replaceValue === 'string') {
|
241
|
+
replaceValue = (_a = replaceValue === null || replaceValue === void 0 ? void 0 : replaceValue.split('-')) === null || _a === void 0 ? void 0 : _a[0];
|
242
|
+
}
|
236
243
|
obj[key] = replaceValue;
|
237
244
|
}
|
238
245
|
else {
|