pb-sxp-ui 14.0.3 → 14.0.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 +444 -802
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +0 -89
- package/dist/index.js +444 -802
- 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 +444 -802
- 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/SxpPageRender/ConsentPopup.js +8 -8
- package/es/core/components/SxpPageRender/Navbar.js +1 -1
- package/es/core/components/SxpPageRender/WaterFall/preview.json +272 -207
- package/es/core/components/SxpPageRender/index.js +2 -5
- package/es/core/context/SxpDataSourceProvider.js +48 -49
- package/es/core/utils/materials.js +3 -5
- package/es/materials/sxp/consentPopup/Display/index.d.ts +2 -2
- package/es/materials/sxp/consentPopup/Display/index.js +5 -7
- package/es/materials/sxp/consentPopup/index.d.ts +0 -2
- package/es/materials/sxp/consentPopup/index.js +0 -2
- package/es/materials/sxp/cta/AniLink/index.js +1 -1
- package/es/materials/sxp/cta/AniLinkPopup/index.js +1 -1
- package/es/materials/sxp/popup/ConsentDetail/index.d.ts +1 -2
- package/es/materials/sxp/popup/ConsentDetail/index.js +2 -2
- package/es/materials/sxp/popup/Iframe/index.d.ts +4 -0
- package/es/materials/sxp/popup/Iframe/index.js +5 -4
- package/es/materials/sxp/popup/Iframe/settingRender.js +15 -0
- package/lib/core/components/SxpPageRender/ConsentPopup.js +7 -7
- package/lib/core/components/SxpPageRender/Navbar.js +1 -1
- package/lib/core/components/SxpPageRender/WaterFall/preview.json +272 -207
- package/lib/core/components/SxpPageRender/index.js +2 -5
- package/lib/core/context/SxpDataSourceProvider.js +48 -49
- package/lib/core/utils/materials.js +3 -5
- package/lib/materials/sxp/consentPopup/Display/index.d.ts +2 -2
- package/lib/materials/sxp/consentPopup/Display/index.js +5 -7
- package/lib/materials/sxp/consentPopup/index.d.ts +0 -2
- package/lib/materials/sxp/consentPopup/index.js +0 -2
- package/lib/materials/sxp/cta/AniLink/index.js +1 -1
- package/lib/materials/sxp/cta/AniLinkPopup/index.js +1 -1
- package/lib/materials/sxp/popup/ConsentDetail/index.d.ts +1 -2
- package/lib/materials/sxp/popup/ConsentDetail/index.js +2 -2
- package/lib/materials/sxp/popup/Iframe/index.d.ts +4 -0
- package/lib/materials/sxp/popup/Iframe/index.js +5 -4
- package/lib/materials/sxp/popup/Iframe/settingRender.js +15 -0
- package/package.json +1 -1
- package/es/materials/sxp/consentPopup/Click/index.d.ts +0 -19
- package/es/materials/sxp/consentPopup/Click/index.js +0 -19
- package/es/materials/sxp/consentPopup/Click/material.d.ts +0 -2
- package/es/materials/sxp/consentPopup/Click/material.js +0 -48
- package/es/materials/sxp/consentPopup/Click/settingRender.d.ts +0 -63
- package/es/materials/sxp/consentPopup/Click/settingRender.js +0 -210
- package/es/materials/sxp/consentPopup/Swipe/index.d.ts +0 -12
- package/es/materials/sxp/consentPopup/Swipe/index.js +0 -44
- package/es/materials/sxp/consentPopup/Swipe/material.d.ts +0 -2
- package/es/materials/sxp/consentPopup/Swipe/material.js +0 -24
- package/es/materials/sxp/consentPopup/Swipe/settingRender.d.ts +0 -29
- package/es/materials/sxp/consentPopup/Swipe/settingRender.js +0 -43
- package/lib/materials/sxp/consentPopup/Click/index.d.ts +0 -19
- package/lib/materials/sxp/consentPopup/Click/index.js +0 -21
- package/lib/materials/sxp/consentPopup/Click/material.d.ts +0 -2
- package/lib/materials/sxp/consentPopup/Click/material.js +0 -52
- package/lib/materials/sxp/consentPopup/Click/settingRender.d.ts +0 -63
- package/lib/materials/sxp/consentPopup/Click/settingRender.js +0 -212
- package/lib/materials/sxp/consentPopup/Swipe/index.d.ts +0 -12
- package/lib/materials/sxp/consentPopup/Swipe/index.js +0 -46
- package/lib/materials/sxp/consentPopup/Swipe/material.d.ts +0 -2
- package/lib/materials/sxp/consentPopup/Swipe/material.js +0 -28
- package/lib/materials/sxp/consentPopup/Swipe/settingRender.d.ts +0 -29
- package/lib/materials/sxp/consentPopup/Swipe/settingRender.js +0 -45
@@ -117,7 +117,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
117
117
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
118
118
|
productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
|
119
119
|
position: activeIndex + '',
|
120
|
-
fromKName: fk
|
120
|
+
fromKName: fk ? fk : fromKName,
|
121
121
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
122
122
|
ctatId: (_r = (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.bindCta) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
123
123
|
traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : ''
|
@@ -144,12 +144,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
144
144
|
setIsReload(new Date().getTime());
|
145
145
|
skipLinkRef.current = false;
|
146
146
|
}
|
147
|
-
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false);
|
148
147
|
handleH5EnterLink();
|
149
148
|
if (repCond) {
|
150
|
-
|
151
|
-
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
|
152
|
-
});
|
149
|
+
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
|
153
150
|
backMainFeed('external', selectTag);
|
154
151
|
}
|
155
152
|
}
|
@@ -99,32 +99,53 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
99
99
|
const bffDataSource = useMemo(() => {
|
100
100
|
return dataSources === null || dataSources === void 0 ? void 0 : dataSources.find((d) => d.type === DataSourceType.BFF);
|
101
101
|
}, [dataSources]);
|
102
|
-
const fakeUserId = useMemo(() => {
|
103
|
-
var _a;
|
104
|
-
return ((_a = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _a === void 0 ? void 0 : _a['x-app-id']) + storeAndLoadFeUserId();
|
105
|
-
}, [bffDataSource]);
|
106
102
|
const bffFetch = useCallback((path, options) => {
|
107
103
|
if (!bffDataSource)
|
108
104
|
return;
|
109
105
|
const url = bffDataSource.url;
|
106
|
+
const fakeUserId = storeAndLoadFeUserId();
|
110
107
|
if (options === null || options === void 0 ? void 0 : options.query) {
|
111
108
|
const queryString = qs.stringify(options.query);
|
112
109
|
path = `${path}?${queryString}`;
|
113
110
|
}
|
114
111
|
if (options.type === 'beacon' && navigator.sendBeacon) {
|
115
|
-
return navigator.sendBeacon(`${url}/api
|
112
|
+
return navigator.sendBeacon(`${url}/api/v1${path}`, new Blob([
|
116
113
|
JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))
|
117
114
|
], { type: 'application/json;charset=UTF-8' }));
|
118
115
|
}
|
119
116
|
return window
|
120
|
-
.fetch(`${url}/api
|
117
|
+
.fetch(`${url}/api/v1${path}`, {
|
121
118
|
headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId }, bffDataSource.headers),
|
122
119
|
method: options.method,
|
123
120
|
body: JSON.stringify(options.body)
|
124
121
|
})
|
125
122
|
.then((res) => res.json())
|
126
123
|
.catch((err) => Promise.reject(err));
|
127
|
-
}, [bffDataSource
|
124
|
+
}, [bffDataSource]);
|
125
|
+
function splitUrlParams(urlParams) {
|
126
|
+
if (!urlParams)
|
127
|
+
return;
|
128
|
+
const indList = [];
|
129
|
+
for (let i = 0; i < urlParams.length; i++) {
|
130
|
+
const item = urlParams[i];
|
131
|
+
const curStr = urlParams.substring(i + 1, urlParams.length);
|
132
|
+
if (item === '&' &&
|
133
|
+
(curStr === null || curStr === void 0 ? void 0 : curStr.indexOf('=')) !== -1 &&
|
134
|
+
((curStr === null || curStr === void 0 ? void 0 : curStr.indexOf('=')) < (curStr === null || curStr === void 0 ? void 0 : curStr.indexOf('&')) || (curStr === null || curStr === void 0 ? void 0 : curStr.indexOf('&')) === -1)) {
|
135
|
+
indList.push(i);
|
136
|
+
}
|
137
|
+
}
|
138
|
+
const splitList = indList.length > 0 ? [] : [urlParams];
|
139
|
+
let lastIndex = 0;
|
140
|
+
indList === null || indList === void 0 ? void 0 : indList.map((i) => {
|
141
|
+
splitList === null || splitList === void 0 ? void 0 : splitList.push(urlParams.substring(lastIndex, i));
|
142
|
+
lastIndex = i + 1;
|
143
|
+
if (i === indList[indList.length - 1] && i < urlParams.length) {
|
144
|
+
splitList === null || splitList === void 0 ? void 0 : splitList.push(urlParams.substring(lastIndex, urlParams.length));
|
145
|
+
}
|
146
|
+
});
|
147
|
+
return splitList !== null && splitList !== void 0 ? splitList : [];
|
148
|
+
}
|
128
149
|
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
129
150
|
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
130
151
|
query = {
|
@@ -141,7 +162,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
141
162
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
|
142
163
|
}
|
143
164
|
else if (utmVal) {
|
144
|
-
const val = (_k = (_j = (_h = utmVal
|
165
|
+
const val = (_k = (_j = (_h = splitUrlParams(utmVal)) === null || _h === void 0 ? void 0 : _h.filter((val) => {
|
145
166
|
var _a, _b;
|
146
167
|
const key = val.split('=')[0];
|
147
168
|
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);
|
@@ -161,16 +182,14 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
161
182
|
const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
|
162
183
|
var _v, _w, _x, _y, _z, _0;
|
163
184
|
query.pageNum = pageNum;
|
164
|
-
result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('
|
185
|
+
result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'POST', body: query }));
|
165
186
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
166
187
|
return undefined;
|
167
188
|
}
|
168
189
|
setLoading(false);
|
169
190
|
list = list.concat((_y = (_x = (_w = (_v = result === null || result === void 0 ? void 0 : result.data) === null || _v === void 0 ? void 0 : _v.recList) === null || _w === void 0 ? void 0 : _w.filter) === null || _x === void 0 ? void 0 : _x.call(_w, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _y !== void 0 ? _y : []);
|
170
|
-
|
171
|
-
|
172
|
-
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
173
|
-
}
|
191
|
+
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result.data), { recList: list })));
|
192
|
+
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result.data), { recList: list })));
|
174
193
|
const isNotNullList = (_0 = (_z = result === null || result === void 0 ? void 0 : result.data) === null || _z === void 0 ? void 0 : _z.recList) === null || _0 === void 0 ? void 0 : _0.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
175
194
|
if (isNotNullList) {
|
176
195
|
pageNum = pageNum + 1;
|
@@ -180,12 +199,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
180
199
|
yield recurveRecList(query);
|
181
200
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
|
182
201
|
setCurReqInfo({ rtc: (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.rtc, requestId: (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.requestId });
|
183
|
-
return Object.assign(Object.assign({}, result
|
202
|
+
return Object.assign(Object.assign({}, result.data), { recList: list });
|
184
203
|
}
|
185
204
|
if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
|
186
205
|
query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_o = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _o !== void 0 ? _o : 1 });
|
187
206
|
}
|
188
|
-
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('
|
207
|
+
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'POST', body: query }));
|
189
208
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
190
209
|
return undefined;
|
191
210
|
}
|
@@ -235,7 +254,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
235
254
|
return expire;
|
236
255
|
}, [data]);
|
237
256
|
const bffEventReport = useCallback(({ userInfo, eventInfo, reportLayId = true }) => {
|
238
|
-
var _a, _b;
|
239
257
|
if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
|
240
258
|
return;
|
241
259
|
}
|
@@ -243,9 +261,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
243
261
|
userInfo = {};
|
244
262
|
}
|
245
263
|
const sessionID = storeAndLoadFeSessionId();
|
246
|
-
const
|
247
|
-
const cl_source = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('cl_source');
|
248
|
-
const ef = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, { playbookType }), (layoutVariantId && reportLayId && { layoutVariantId })), eventInfo), ((eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.position) && channel && { position: Number(eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.position) + 1 + '' })), (cl_source && { cl_source }));
|
264
|
+
const ef = Object.assign(Object.assign(Object.assign(Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, { playbookType }), (layoutVariantId && reportLayId && { layoutVariantId })), eventInfo), ((eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.position) && channel && { position: Number(eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.position) + 1 + '' }));
|
249
265
|
const realUserInfo = Object.entries(userInfo).map(([k, v]) => ({ name: k, value: v }));
|
250
266
|
const realEventInfo = Object.entries(ef)
|
251
267
|
.map(([k, v]) => v && { name: k, value: v })
|
@@ -254,23 +270,14 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
254
270
|
console.log('userInfo:', userInfo);
|
255
271
|
console.log('eventInfo:', ef);
|
256
272
|
console.log('========= 结束 =========');
|
257
|
-
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(
|
273
|
+
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/event/report', {
|
258
274
|
method: 'POST',
|
259
275
|
body: { userInfo: realUserInfo, eventInfo: realEventInfo },
|
260
276
|
type: 'beacon'
|
261
277
|
});
|
262
|
-
}, [
|
263
|
-
bffFetch,
|
264
|
-
curReqInfo,
|
265
|
-
enableReportEvent,
|
266
|
-
globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview,
|
267
|
-
layoutVariantId,
|
268
|
-
globalConfig,
|
269
|
-
playbookType,
|
270
|
-
bffDataSource
|
271
|
-
]);
|
278
|
+
}, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview, layoutVariantId, globalConfig, playbookType]);
|
272
279
|
const bffFbReport = useCallback(({ eventName, product }) => {
|
273
|
-
var _a, _b, _c, _d, _e
|
280
|
+
var _a, _b, _c, _d, _e;
|
274
281
|
if (!enableReportEvent ||
|
275
282
|
!enabledMetaConversionApi ||
|
276
283
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) ||
|
@@ -282,7 +289,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
282
289
|
const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
|
283
290
|
const fix_par = {
|
284
291
|
event_source_url: (_c = window === null || window === void 0 ? void 0 : window.location) === null || _c === void 0 ? void 0 : _c.href,
|
285
|
-
external_id:
|
292
|
+
external_id: storeAndLoadFeUserId(),
|
286
293
|
client_user_agent: (_e = (_d = window === null || window === void 0 ? void 0 : window.navigator) === null || _d === void 0 ? void 0 : _d.userAgent) !== null && _e !== void 0 ? _e : '',
|
287
294
|
fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
|
288
295
|
fbp: getCookie('_fbp') ? `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` : '',
|
@@ -334,30 +341,22 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
334
341
|
}
|
335
342
|
};
|
336
343
|
getEventParams(jsonParams);
|
337
|
-
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(
|
344
|
+
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/fb/events', {
|
338
345
|
method: 'POST',
|
339
346
|
body: jsonParams,
|
340
347
|
type: 'beacon'
|
341
348
|
});
|
342
|
-
}, [
|
343
|
-
bffFetch,
|
344
|
-
enableReportEvent,
|
345
|
-
enabledMetaConversionApi,
|
346
|
-
globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview,
|
347
|
-
globalConfig,
|
348
|
-
fakeUserId,
|
349
|
-
bffDataSource
|
350
|
-
]);
|
349
|
+
}, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview, globalConfig]);
|
351
350
|
const bffMutateLike = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
352
|
-
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('
|
351
|
+
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/like', { method: 'POST', body }));
|
353
352
|
return res === null || res === void 0 ? void 0 : res.success;
|
354
353
|
}), [bffFetch]);
|
355
354
|
const bffMutateUnlike = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
356
|
-
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('
|
355
|
+
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/unlike', { method: 'POST', body }));
|
357
356
|
return res === null || res === void 0 ? void 0 : res.success;
|
358
357
|
}), [bffFetch]);
|
359
358
|
const bffSubmitForm = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
360
|
-
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('
|
359
|
+
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
|
361
360
|
return res === null || res === void 0 ? void 0 : res.success;
|
362
361
|
}), [bffFetch]);
|
363
362
|
const bffGetTagList = useCallback((data) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -366,12 +365,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
366
365
|
if (!utmVal || !isShowTag)
|
367
366
|
return;
|
368
367
|
try {
|
369
|
-
const val = (_10 = (_9 = (_8 = utmVal
|
368
|
+
const val = (_10 = (_9 = (_8 = splitUrlParams(utmVal)) === null || _8 === void 0 ? void 0 : _8.filter((val) => {
|
370
369
|
var _a, _b;
|
371
370
|
const key = val.split('=')[0];
|
372
371
|
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);
|
373
372
|
})) === null || _9 === void 0 ? void 0 : _9.join('&')) !== null && _10 !== void 0 ? _10 : '';
|
374
|
-
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('
|
373
|
+
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
375
374
|
setTagList((_12 = (_11 = result === null || result === void 0 ? void 0 : result.data) === null || _11 === void 0 ? void 0 : _11.tags) !== null && _12 !== void 0 ? _12 : []);
|
376
375
|
}
|
377
376
|
catch (e) {
|
@@ -445,10 +444,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
445
444
|
let curData;
|
446
445
|
let gldata;
|
447
446
|
if (data === null || data === void 0 ? void 0 : data.layoutVariantId) {
|
448
|
-
layId = data === null || data === void 0 ? void 0 : data.layoutVariantId;
|
449
|
-
setLayoutVariantId(data === null || data === void 0 ? void 0 : data.layoutVariantId);
|
450
447
|
const id = (_b = (_a = data === null || data === void 0 ? void 0 : data.layoutVariantId) === null || _a === void 0 ? void 0 : _a.split('-')) === null || _b === void 0 ? void 0 : _b[1];
|
451
448
|
if (id) {
|
449
|
+
layId = id;
|
450
|
+
setLayoutVariantId(id);
|
452
451
|
curData = dataList === null || dataList === void 0 ? void 0 : dataList.find((item) => (item === null || item === void 0 ? void 0 : item.id) === id);
|
453
452
|
if (curData) {
|
454
453
|
setPageData(curData);
|
@@ -32,16 +32,14 @@ export const getBgStyleByImg = (data) => {
|
|
32
32
|
};
|
33
33
|
export const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef, style }) => {
|
34
34
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
35
|
-
let text = '';
|
36
35
|
if ((!(product === null || product === void 0 ? void 0 : product.currency) || !(product === null || product === void 0 ? void 0 : product.price)) && isHiddenDef)
|
37
36
|
return null;
|
38
|
-
let price =
|
39
|
-
|
40
|
-
return text;
|
37
|
+
let price = (product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price) ? product === null || product === void 0 ? void 0 : product.price : 7000;
|
38
|
+
let text = '';
|
41
39
|
let priceSymbol = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.priceSymbol;
|
42
40
|
let currency = (product === null || product === void 0 ? void 0 : product.currency) ? (_c = (_b = (_a = product === null || product === void 0 ? void 0 : product.currency) === null || _a === void 0 ? void 0 : _a.split('-')[1]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== null && _c !== void 0 ? _c : '' : '$';
|
43
41
|
const isToLocStr = enableFormattedPrice === undefined || enableFormattedPrice;
|
44
|
-
let decPic = price
|
42
|
+
let decPic = price.toString();
|
45
43
|
if (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.showTwoDecimalPoint) {
|
46
44
|
decPic = price === null || price === void 0 ? void 0 : price.toFixed(2);
|
47
45
|
}
|
@@ -13,9 +13,9 @@ export interface IDisplayProps {
|
|
13
13
|
};
|
14
14
|
style?: Record<string, any>;
|
15
15
|
isTel?: boolean;
|
16
|
-
isShowClose?: boolean;
|
17
|
-
consentPopupCate?: string;
|
18
16
|
onClick?: () => void;
|
17
|
+
contsentState?: boolean;
|
18
|
+
isShowClose?: boolean;
|
19
19
|
}
|
20
20
|
declare const _default: React.NamedExoticComponent<IDisplayProps>;
|
21
21
|
export default _default;
|
@@ -1,20 +1,18 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import React, { memo, useCallback, useMemo, useState } from 'react';
|
3
3
|
import './index.less';
|
4
|
+
import { useEditorDataProvider } from '../../../../core/context/EditorDataProvider';
|
4
5
|
import closeSvg from './close.svg';
|
5
6
|
import tel from './tel.png';
|
6
7
|
import { setFontForText } from '../../../../core/utils/tool';
|
7
|
-
import { getContsentState } from '../../../../core/utils/localStore';
|
8
8
|
const Display = (_a) => {
|
9
9
|
var _b, _c;
|
10
|
-
var { isTel, isShowOnce, open, content, interaction, style, onClick,
|
10
|
+
var { isTel, isShowOnce, open, content, interaction, style, onClick, contsentState, isShowClose } = _a, props = __rest(_a, ["isTel", "isShowOnce", "open", "content", "interaction", "style", "onClick", "contsentState", "isShowClose"]);
|
11
|
+
const { consentPopupCate } = useEditorDataProvider();
|
11
12
|
const [isClose, setIsClose] = useState(false);
|
12
|
-
const contsentState = useMemo(() => {
|
13
|
-
return getContsentState();
|
14
|
-
}, []);
|
15
13
|
const visivle = useMemo(() => {
|
16
|
-
return consentPopupCate || (open && (isShowOnce || contsentState) && style && !isClose);
|
17
|
-
}, [consentPopupCate, open, isClose
|
14
|
+
return consentPopupCate === 'Display' || (open && (isShowOnce || contsentState) && style && !isClose);
|
15
|
+
}, [consentPopupCate, open, isClose]);
|
18
16
|
const handleClickClose = useCallback(() => {
|
19
17
|
setIsClose(true);
|
20
18
|
}, []);
|
@@ -35,7 +35,7 @@ const AniLink = (_a) => {
|
|
35
35
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
36
36
|
}
|
37
37
|
};
|
38
|
-
const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || '
|
38
|
+
const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || '查看详情';
|
39
39
|
const aniTimStyle = useMemo(() => {
|
40
40
|
var _a, _b;
|
41
41
|
const ani = event === null || event === void 0 ? void 0 : event.animation;
|
@@ -35,7 +35,7 @@ const AniLinkPopup = (_a) => {
|
|
35
35
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
36
36
|
}
|
37
37
|
};
|
38
|
-
const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || '
|
38
|
+
const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || '查看详情';
|
39
39
|
const aniTimStyle = useMemo(() => {
|
40
40
|
const ani = event === null || event === void 0 ? void 0 : event.animation;
|
41
41
|
if (ani) {
|
@@ -1,9 +1,8 @@
|
|
1
|
-
import React
|
1
|
+
import React from 'react';
|
2
2
|
import './index.less';
|
3
3
|
export interface IConsentDetailProps {
|
4
4
|
content?: string;
|
5
5
|
isTel?: boolean;
|
6
|
-
style?: CSSProperties;
|
7
6
|
}
|
8
7
|
declare const _default: React.NamedExoticComponent<IConsentDetailProps>;
|
9
8
|
export default _default;
|
@@ -2,11 +2,11 @@ import { __rest } from "tslib";
|
|
2
2
|
import React, { memo } from 'react';
|
3
3
|
import './index.less';
|
4
4
|
const ConsentDetail = (_a) => {
|
5
|
-
var { content, isTel
|
5
|
+
var { content, isTel } = _a, props = __rest(_a, ["content", "isTel"]);
|
6
6
|
return (React.createElement("article", { className: 'consentDetail-article', dangerouslySetInnerHTML: {
|
7
7
|
__html: typeof content === 'string' ? content : ''
|
8
8
|
}, onClick: (e) => {
|
9
9
|
e.stopPropagation();
|
10
|
-
}
|
10
|
+
} }));
|
11
11
|
};
|
12
12
|
export default memo(ConsentDetail);
|
@@ -12,6 +12,10 @@ export interface IIframeProps {
|
|
12
12
|
submitButtonStyle?: CSSProperties;
|
13
13
|
contentStyle?: CSSProperties;
|
14
14
|
isTel?: boolean;
|
15
|
+
iframe?: {
|
16
|
+
src?: string;
|
17
|
+
allow?: string;
|
18
|
+
};
|
15
19
|
}
|
16
20
|
declare const _default: React.NamedExoticComponent<IIframeProps>;
|
17
21
|
export default _default;
|
@@ -5,11 +5,12 @@ import './index.less';
|
|
5
5
|
import { useSxpDataSource } from '../../../../core/hooks';
|
6
6
|
const Iframe = (_a) => {
|
7
7
|
var _b, _c;
|
8
|
-
var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick, submitButtonStyle, contentStyle, isTel } = _a, props = __rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick", "submitButtonStyle", "contentStyle", "isTel"]);
|
8
|
+
var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick, submitButtonStyle, contentStyle, isTel, iframe } = _a, props = __rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick", "submitButtonStyle", "contentStyle", "isTel", "iframe"]);
|
9
9
|
const { popupDetailData } = useSxpDataSource();
|
10
|
-
const
|
11
|
-
|
12
|
-
|
10
|
+
const { src, allow } = iframe || {};
|
11
|
+
const iframeUrl = src || ((_c = (_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.video) === null || _b === void 0 ? void 0 : _b.bindCta) === null || _c === void 0 ? void 0 : _c.remark);
|
12
|
+
return (React.createElement("div", Object.assign({ className: `${css(Object.assign(Object.assign({}, style), { overflow: 'hidden' }))}` }, props),
|
13
|
+
React.createElement("iframe", { src: iframeUrl, allow: allow, scrolling: 'no', style: {
|
13
14
|
width: '100%',
|
14
15
|
height: 'calc(100% - 50px)',
|
15
16
|
marginTop: '50px',
|
@@ -8,5 +8,20 @@ export default [
|
|
8
8
|
name: ['style', 'backgroundColor']
|
9
9
|
}
|
10
10
|
]
|
11
|
+
},
|
12
|
+
{
|
13
|
+
title: 'iframe',
|
14
|
+
child: [
|
15
|
+
{
|
16
|
+
type: 'TextArea',
|
17
|
+
label: 'url',
|
18
|
+
name: ['props', 'iframe', 'src']
|
19
|
+
},
|
20
|
+
{
|
21
|
+
type: 'TextArea',
|
22
|
+
label: 'allow',
|
23
|
+
name: ['props', 'iframe', 'allow']
|
24
|
+
}
|
25
|
+
]
|
11
26
|
}
|
12
27
|
];
|
@@ -4,15 +4,15 @@ const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
5
5
|
require("./index.less");
|
6
6
|
const withBindDataSource_1 = tslib_1.__importDefault(require("../../../core/hoc/withBindDataSource"));
|
7
|
-
const
|
7
|
+
const localStore_1 = require("../../../core/utils/localStore");
|
8
8
|
const Consent = ({ resolver, globalConfig }) => {
|
9
9
|
var _a, _b;
|
10
|
-
const
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
const t = resolver === null || resolver === void 0 ? void 0 : resolver[value === null || value === void 0 ? void 0 : value.type];
|
10
|
+
const contsentState = (0, react_1.useMemo)(() => {
|
11
|
+
return (0, localStore_1.getContsentState)();
|
12
|
+
}, []);
|
13
|
+
const t = resolver === null || resolver === void 0 ? void 0 : resolver['Display'];
|
15
14
|
const Component = (0, withBindDataSource_1.default)(t);
|
16
|
-
|
15
|
+
const value = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consentPopup) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item;
|
16
|
+
return react_1.default.createElement(Component, Object.assign({}, value === null || value === void 0 ? void 0 : value.props, { style: value === null || value === void 0 ? void 0 : value.style, event: (value === null || value === void 0 ? void 0 : value.event) || {}, contsentState: contsentState }));
|
17
17
|
};
|
18
18
|
exports.default = (0, react_1.memo)(Consent);
|
@@ -11,7 +11,7 @@ const Navbar = ({ icon, styles, textStyle, onClose }) => {
|
|
11
11
|
react_1.default.createElement("button", { className: 'clc-sxp-nav-left', role: 'button', "aria-label": 'back button', onClick: onClose },
|
12
12
|
react_1.default.createElement("img", { src: icon, alt: 'back button' })),
|
13
13
|
react_1.default.createElement("div", { className: 'clc-sxp-nav-title', style: Object.assign(Object.assign({}, textStyle), { paddingLeft: (textStyle === null || textStyle === void 0 ? void 0 : textStyle.textAlign) === 'left' ? '35px' : 0 }), dangerouslySetInnerHTML: {
|
14
|
-
__html: (0, tool_1.setFontForText)(`#${(_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag) !== null && _a !== void 0 ? _a : '
|
14
|
+
__html: (0, tool_1.setFontForText)(`#${(_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag) !== null && _a !== void 0 ? _a : '标题'}`, textStyle)
|
15
15
|
} })));
|
16
16
|
};
|
17
17
|
exports.default = (0, react_1.memo)(Navbar);
|