pb-sxp-ui 14.0.7 → 15.0.1

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.
Files changed (76) hide show
  1. package/dist/index.cjs +157 -607
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +15 -89
  4. package/dist/index.js +157 -607
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +5 -5
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +5 -5
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +157 -607
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +5 -5
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/SxpPageRender/ConsentPopup.js +8 -8
  15. package/es/core/components/SxpPageRender/Navbar.js +1 -1
  16. package/es/core/components/SxpPageRender/WaterFall/List.js +3 -3
  17. package/es/core/components/SxpPageRender/WaterFall/index.js +2 -2
  18. package/es/core/components/SxpPageRender/index.js +2 -5
  19. package/es/core/context/SxpDataSourceProvider.js +22 -54
  20. package/es/core/utils/materials.js +3 -5
  21. package/es/materials/sxp/HashTag/index.d.ts +4 -1
  22. package/es/materials/sxp/HashTag/material.js +2 -1
  23. package/es/materials/sxp/HashTag/settingRender.d.ts +0 -2
  24. package/es/materials/sxp/HashTag/settingRender.js +2 -3
  25. package/es/materials/sxp/consentPopup/Display/index.d.ts +2 -2
  26. package/es/materials/sxp/consentPopup/Display/index.js +5 -7
  27. package/es/materials/sxp/consentPopup/index.d.ts +0 -2
  28. package/es/materials/sxp/consentPopup/index.js +0 -2
  29. package/es/materials/sxp/cta/AniLink/index.js +1 -1
  30. package/es/materials/sxp/cta/AniLinkPopup/index.js +1 -1
  31. package/es/materials/sxp/popup/ConsentDetail/index.d.ts +1 -2
  32. package/es/materials/sxp/popup/ConsentDetail/index.js +2 -2
  33. package/lib/core/components/SxpPageRender/ConsentPopup.js +7 -7
  34. package/lib/core/components/SxpPageRender/Navbar.js +1 -1
  35. package/lib/core/components/SxpPageRender/WaterFall/List.js +3 -3
  36. package/lib/core/components/SxpPageRender/WaterFall/index.js +2 -2
  37. package/lib/core/components/SxpPageRender/index.js +2 -5
  38. package/lib/core/context/SxpDataSourceProvider.js +22 -54
  39. package/lib/core/utils/materials.js +3 -5
  40. package/lib/materials/sxp/HashTag/index.d.ts +4 -1
  41. package/lib/materials/sxp/HashTag/material.js +2 -1
  42. package/lib/materials/sxp/HashTag/settingRender.d.ts +0 -2
  43. package/lib/materials/sxp/HashTag/settingRender.js +2 -3
  44. package/lib/materials/sxp/consentPopup/Display/index.d.ts +2 -2
  45. package/lib/materials/sxp/consentPopup/Display/index.js +5 -7
  46. package/lib/materials/sxp/consentPopup/index.d.ts +0 -2
  47. package/lib/materials/sxp/consentPopup/index.js +0 -2
  48. package/lib/materials/sxp/cta/AniLink/index.js +1 -1
  49. package/lib/materials/sxp/cta/AniLinkPopup/index.js +1 -1
  50. package/lib/materials/sxp/popup/ConsentDetail/index.d.ts +1 -2
  51. package/lib/materials/sxp/popup/ConsentDetail/index.js +2 -2
  52. package/package.json +1 -1
  53. package/es/materials/sxp/consentPopup/Click/index.d.ts +0 -19
  54. package/es/materials/sxp/consentPopup/Click/index.js +0 -19
  55. package/es/materials/sxp/consentPopup/Click/material.d.ts +0 -2
  56. package/es/materials/sxp/consentPopup/Click/material.js +0 -48
  57. package/es/materials/sxp/consentPopup/Click/settingRender.d.ts +0 -63
  58. package/es/materials/sxp/consentPopup/Click/settingRender.js +0 -210
  59. package/es/materials/sxp/consentPopup/Swipe/index.d.ts +0 -12
  60. package/es/materials/sxp/consentPopup/Swipe/index.js +0 -44
  61. package/es/materials/sxp/consentPopup/Swipe/material.d.ts +0 -2
  62. package/es/materials/sxp/consentPopup/Swipe/material.js +0 -24
  63. package/es/materials/sxp/consentPopup/Swipe/settingRender.d.ts +0 -29
  64. package/es/materials/sxp/consentPopup/Swipe/settingRender.js +0 -43
  65. package/lib/materials/sxp/consentPopup/Click/index.d.ts +0 -19
  66. package/lib/materials/sxp/consentPopup/Click/index.js +0 -21
  67. package/lib/materials/sxp/consentPopup/Click/material.d.ts +0 -2
  68. package/lib/materials/sxp/consentPopup/Click/material.js +0 -52
  69. package/lib/materials/sxp/consentPopup/Click/settingRender.d.ts +0 -63
  70. package/lib/materials/sxp/consentPopup/Click/settingRender.js +0 -212
  71. package/lib/materials/sxp/consentPopup/Swipe/index.d.ts +0 -12
  72. package/lib/materials/sxp/consentPopup/Swipe/index.js +0 -46
  73. package/lib/materials/sxp/consentPopup/Swipe/material.d.ts +0 -2
  74. package/lib/materials/sxp/consentPopup/Swipe/material.js +0 -28
  75. package/lib/materials/sxp/consentPopup/Swipe/settingRender.d.ts +0 -29
  76. package/lib/materials/sxp/consentPopup/Swipe/settingRender.js +0 -45
@@ -102,32 +102,29 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
102
102
  const bffDataSource = (0, react_1.useMemo)(() => {
103
103
  return dataSources === null || dataSources === void 0 ? void 0 : dataSources.find((d) => d.type === DataSourceType.BFF);
104
104
  }, [dataSources]);
105
- const fakeUserId = (0, react_1.useMemo)(() => {
106
- var _a;
107
- return ((_a = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _a === void 0 ? void 0 : _a['x-app-id']) + (0, localStore_1.storeAndLoadFeUserId)();
108
- }, [bffDataSource]);
109
105
  const bffFetch = (0, react_1.useCallback)((path, options) => {
110
106
  if (!bffDataSource)
111
107
  return;
112
108
  const url = bffDataSource.url;
109
+ const fakeUserId = (0, localStore_1.storeAndLoadFeUserId)();
113
110
  if (options === null || options === void 0 ? void 0 : options.query) {
114
111
  const queryString = qs_1.default.stringify(options.query);
115
112
  path = `${path}?${queryString}`;
116
113
  }
117
114
  if (options.type === 'beacon' && navigator.sendBeacon) {
118
- return navigator.sendBeacon(`${url}/api/${path}`, new Blob([
115
+ return navigator.sendBeacon(`${url}/api/v1${path}`, new Blob([
119
116
  JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))
120
117
  ], { type: 'application/json;charset=UTF-8' }));
121
118
  }
122
119
  return window
123
- .fetch(`${url}/api/${path}`, {
120
+ .fetch(`${url}/api/v1${path}`, {
124
121
  headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId }, bffDataSource.headers),
125
122
  method: options.method,
126
123
  body: JSON.stringify(options.body)
127
124
  })
128
125
  .then((res) => res.json())
129
126
  .catch((err) => Promise.reject(err));
130
- }, [bffDataSource, fakeUserId]);
127
+ }, [bffDataSource]);
131
128
  const getRecommendVideos = (0, react_1.useCallback)((query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
132
129
  var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
133
130
  query = {
@@ -164,16 +161,14 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
164
161
  const recurveRecList = (query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
165
162
  var _v, _w, _x, _y, _z, _0;
166
163
  query.pageNum = pageNum;
167
- result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', { method: 'POST', body: query }));
164
+ result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'POST', body: query }));
168
165
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
169
166
  return undefined;
170
167
  }
171
168
  setLoading(false);
172
169
  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 : []);
173
- if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
174
- setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
175
- setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
176
- }
170
+ setRtcList(getFilterRecList(Object.assign(Object.assign({}, result.data), { recList: list })));
171
+ setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result.data), { recList: list })));
177
172
  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));
178
173
  if (isNotNullList) {
179
174
  pageNum = pageNum + 1;
@@ -183,12 +178,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
183
178
  yield recurveRecList(query);
184
179
  if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
185
180
  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 });
186
- return Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list });
181
+ return Object.assign(Object.assign({}, result.data), { recList: list });
187
182
  }
188
183
  if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
189
184
  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 });
190
185
  }
191
- const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', { method: 'POST', body: query }));
186
+ const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'POST', body: query }));
192
187
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
193
188
  return undefined;
194
189
  }
@@ -238,7 +233,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
238
233
  return expire;
239
234
  }, [data]);
240
235
  const bffEventReport = (0, react_1.useCallback)(({ userInfo, eventInfo, reportLayId = true }) => {
241
- var _a, _b;
242
236
  if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
243
237
  return;
244
238
  }
@@ -246,16 +240,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
246
240
  userInfo = {};
247
241
  }
248
242
  const sessionID = (0, sessionStore_1.storeAndLoadFeSessionId)();
249
- const params = {};
250
- const queryString = location.search.slice(1);
251
- (_a = (0, tool_1.splitUrlParams)(queryString)) === null || _a === void 0 ? void 0 : _a.map((val) => {
252
- const key = val.split('=')[0];
253
- const value = val.split('=')[1];
254
- params[key] = value;
255
- });
256
- console.log(params, '111');
257
- const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
258
- 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 }));
243
+ 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 + '' }));
259
244
  const realUserInfo = Object.entries(userInfo).map(([k, v]) => ({ name: k, value: v }));
260
245
  const realEventInfo = Object.entries(ef)
261
246
  .map(([k, v]) => v && { name: k, value: v })
@@ -264,23 +249,14 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
264
249
  console.log('userInfo:', userInfo);
265
250
  console.log('eventInfo:', ef);
266
251
  console.log('========= 结束 =========');
267
- return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/event/report/CLD/${(_b = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _b === void 0 ? void 0 : _b['x-app-id']}/${eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.eventSubject}`, {
252
+ return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/event/report', {
268
253
  method: 'POST',
269
254
  body: { userInfo: realUserInfo, eventInfo: realEventInfo },
270
255
  type: 'beacon'
271
256
  });
272
- }, [
273
- bffFetch,
274
- curReqInfo,
275
- enableReportEvent,
276
- globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview,
277
- layoutVariantId,
278
- globalConfig,
279
- playbookType,
280
- bffDataSource
281
- ]);
257
+ }, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview, layoutVariantId, globalConfig, playbookType]);
282
258
  const bffFbReport = (0, react_1.useCallback)(({ eventName, product }) => {
283
- var _a, _b, _c, _d, _e, _f;
259
+ var _a, _b, _c, _d, _e;
284
260
  if (!enableReportEvent ||
285
261
  !enabledMetaConversionApi ||
286
262
  (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) ||
@@ -292,7 +268,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
292
268
  const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
293
269
  const fix_par = {
294
270
  event_source_url: (_c = window === null || window === void 0 ? void 0 : window.location) === null || _c === void 0 ? void 0 : _c.href,
295
- external_id: fakeUserId,
271
+ external_id: (0, localStore_1.storeAndLoadFeUserId)(),
296
272
  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 : '',
297
273
  fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
298
274
  fbp: (0, tool_1.getCookie)('_fbp') ? `fb.2.${new Date().getTime()}.${(0, tool_1.getCookie)('_fbp')}` : '',
@@ -344,30 +320,22 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
344
320
  }
345
321
  };
346
322
  getEventParams(jsonParams);
347
- return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/event/report/FB/${(_f = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _f === void 0 ? void 0 : _f['x-app-id']}/${eventName}`, {
323
+ return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/fb/events', {
348
324
  method: 'POST',
349
325
  body: jsonParams,
350
326
  type: 'beacon'
351
327
  });
352
- }, [
353
- bffFetch,
354
- enableReportEvent,
355
- enabledMetaConversionApi,
356
- globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview,
357
- globalConfig,
358
- fakeUserId,
359
- bffDataSource
360
- ]);
328
+ }, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview, globalConfig]);
361
329
  const bffMutateLike = (0, react_1.useCallback)((body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
362
- const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
330
+ const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/like', { method: 'POST', body }));
363
331
  return res === null || res === void 0 ? void 0 : res.success;
364
332
  }), [bffFetch]);
365
333
  const bffMutateUnlike = (0, react_1.useCallback)((body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
366
- const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/unlike', { method: 'POST', body }));
334
+ const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/unlike', { method: 'POST', body }));
367
335
  return res === null || res === void 0 ? void 0 : res.success;
368
336
  }), [bffFetch]);
369
337
  const bffSubmitForm = (0, react_1.useCallback)((body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
370
- const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/customform', { method: 'POST', body }));
338
+ const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
371
339
  return res === null || res === void 0 ? void 0 : res.success;
372
340
  }), [bffFetch]);
373
341
  const bffGetTagList = (0, react_1.useCallback)((data) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
@@ -381,7 +349,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
381
349
  const key = val.split('=')[0];
382
350
  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);
383
351
  })) === null || _9 === void 0 ? void 0 : _9.join('&')) !== null && _10 !== void 0 ? _10 : '';
384
- const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
352
+ const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
385
353
  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 : []);
386
354
  }
387
355
  catch (e) {
@@ -460,10 +428,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
460
428
  let curData;
461
429
  let gldata;
462
430
  if (data === null || data === void 0 ? void 0 : data.layoutVariantId) {
463
- layId = data === null || data === void 0 ? void 0 : data.layoutVariantId;
464
- setLayoutVariantId(data === null || data === void 0 ? void 0 : data.layoutVariantId);
465
431
  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];
466
432
  if (id) {
433
+ layId = id;
434
+ setLayoutVariantId(id);
467
435
  curData = dataList === null || dataList === void 0 ? void 0 : dataList.find((item) => (item === null || item === void 0 ? void 0 : item.id) === id);
468
436
  if (curData) {
469
437
  setPageData(curData);
@@ -38,16 +38,14 @@ const getBgStyleByImg = (data) => {
38
38
  exports.getBgStyleByImg = getBgStyleByImg;
39
39
  const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef, style }) => {
40
40
  var _a, _b, _c, _d, _e, _f, _g, _h;
41
- let text = '';
42
41
  if ((!(product === null || product === void 0 ? void 0 : product.currency) || !(product === null || product === void 0 ? void 0 : product.price)) && isHiddenDef)
43
42
  return null;
44
- let price = Number((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);
45
- if (typeof price !== 'number')
46
- return text;
43
+ 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;
44
+ let text = '';
47
45
  let priceSymbol = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.priceSymbol;
48
46
  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 : '' : '$';
49
47
  const isToLocStr = enableFormattedPrice === undefined || enableFormattedPrice;
50
- let decPic = price === null || price === void 0 ? void 0 : price.toString();
48
+ let decPic = price.toString();
51
49
  if (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.showTwoDecimalPoint) {
52
50
  decPic = price === null || price === void 0 ? void 0 : price.toFixed(2);
53
51
  }
@@ -14,7 +14,10 @@ export interface IHashTagProps {
14
14
  };
15
15
  buttonBgStyle: CSSProperties;
16
16
  showBanner?: boolean;
17
- openFixedSize?: boolean;
17
+ openFixedSize?: {
18
+ open: true;
19
+ ratio: string;
20
+ };
18
21
  }
19
22
  declare const _default: React.NamedExoticComponent<IHashTagProps>;
20
23
  export default _default;
@@ -60,7 +60,8 @@ const HashTag = (0, create_1.createMaterial)(_1.default, {
60
60
  paddingLeft: 20,
61
61
  paddingRight: 20,
62
62
  paddingBottom: 20
63
- }
63
+ },
64
+ openFixedSize: { open: true, ratio: '1' }
64
65
  }
65
66
  },
66
67
  w: 100,
@@ -5,12 +5,10 @@ declare const _default: ({
5
5
  label: string;
6
6
  name: string[];
7
7
  addonAfter: string;
8
- initialValue?: undefined;
9
8
  } | {
10
9
  type: string;
11
10
  label: string;
12
11
  name: string[];
13
- initialValue: boolean;
14
12
  addonAfter?: undefined;
15
13
  })[];
16
14
  } | {
@@ -21,10 +21,9 @@ exports.default = [
21
21
  addonAfter: 'px'
22
22
  },
23
23
  {
24
- type: 'Switch',
24
+ type: 'HashTagFixedSize',
25
25
  label: '固定宽高',
26
- name: ['props', 'openFixedSize'],
27
- initialValue: true
26
+ name: ['props', 'openFixedSize']
28
27
  }
29
28
  ]
30
29
  },
@@ -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;
@@ -3,20 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
5
  require("./index.less");
6
+ const EditorDataProvider_1 = require("../../../../core/context/EditorDataProvider");
6
7
  const close_svg_1 = tslib_1.__importDefault(require("./close.svg"));
7
8
  const tel_png_1 = tslib_1.__importDefault(require("./tel.png"));
8
9
  const tool_1 = require("../../../../core/utils/tool");
9
- const localStore_1 = require("../../../../core/utils/localStore");
10
10
  const Display = (_a) => {
11
11
  var _b, _c;
12
- var { isTel, isShowOnce, open, content, interaction, style, onClick, isShowClose, consentPopupCate } = _a, props = tslib_1.__rest(_a, ["isTel", "isShowOnce", "open", "content", "interaction", "style", "onClick", "isShowClose", "consentPopupCate"]);
12
+ var { isTel, isShowOnce, open, content, interaction, style, onClick, contsentState, isShowClose } = _a, props = tslib_1.__rest(_a, ["isTel", "isShowOnce", "open", "content", "interaction", "style", "onClick", "contsentState", "isShowClose"]);
13
+ const { consentPopupCate } = (0, EditorDataProvider_1.useEditorDataProvider)();
13
14
  const [isClose, setIsClose] = (0, react_1.useState)(false);
14
- const contsentState = (0, react_1.useMemo)(() => {
15
- return (0, localStore_1.getContsentState)();
16
- }, []);
17
15
  const visivle = (0, react_1.useMemo)(() => {
18
- return consentPopupCate || (open && (isShowOnce || contsentState) && style && !isClose);
19
- }, [consentPopupCate, open, isClose, contsentState]);
16
+ return consentPopupCate === 'Display' || (open && (isShowOnce || contsentState) && style && !isClose);
17
+ }, [consentPopupCate, open, isClose]);
20
18
  const handleClickClose = (0, react_1.useCallback)(() => {
21
19
  setIsClose(true);
22
20
  }, []);
@@ -1,3 +1 @@
1
1
  export * from './Display/material';
2
- export * from './Click/material';
3
- export * from './Swipe/material';
@@ -2,5 +2,3 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./Display/material"), exports);
5
- tslib_1.__exportStar(require("./Click/material"), exports);
6
- tslib_1.__exportStar(require("./Swipe/material"), exports);
@@ -37,7 +37,7 @@ const AniLink = (_a) => {
37
37
  onClick === null || onClick === void 0 ? void 0 : onClick();
38
38
  }
39
39
  };
40
- const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || 'Show More';
40
+ const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || '查看详情';
41
41
  const aniTimStyle = (0, react_1.useMemo)(() => {
42
42
  var _a, _b;
43
43
  const ani = event === null || event === void 0 ? void 0 : event.animation;
@@ -37,7 +37,7 @@ const AniLinkPopup = (_a) => {
37
37
  onClick === null || onClick === void 0 ? void 0 : onClick();
38
38
  }
39
39
  };
40
- const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || 'Show More';
40
+ const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || '查看详情';
41
41
  const aniTimStyle = (0, react_1.useMemo)(() => {
42
42
  const ani = event === null || event === void 0 ? void 0 : event.animation;
43
43
  if (ani) {
@@ -1,9 +1,8 @@
1
- import React, { CSSProperties } from '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;
@@ -4,11 +4,11 @@ const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
5
  require("./index.less");
6
6
  const ConsentDetail = (_a) => {
7
- var { content, isTel, style } = _a, props = tslib_1.__rest(_a, ["content", "isTel", "style"]);
7
+ var { content, isTel } = _a, props = tslib_1.__rest(_a, ["content", "isTel"]);
8
8
  return (react_1.default.createElement("article", { className: 'consentDetail-article', dangerouslySetInnerHTML: {
9
9
  __html: typeof content === 'string' ? content : ''
10
10
  }, onClick: (e) => {
11
11
  e.stopPropagation();
12
- }, style: style }));
12
+ } }));
13
13
  };
14
14
  exports.default = (0, react_1.memo)(ConsentDetail);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "14.0.7",
3
+ "version": "15.0.1",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -1,19 +0,0 @@
1
- import React, { CSSProperties } from 'react';
2
- import './index.less';
3
- export interface IClickProps {
4
- open?: boolean;
5
- content?: string;
6
- style?: Record<string, any>;
7
- isTel?: boolean;
8
- acceptButton?: {
9
- text?: string;
10
- style?: CSSProperties;
11
- };
12
- rejectButton?: {
13
- text?: string;
14
- style?: CSSProperties;
15
- };
16
- consentPopupCate?: string;
17
- }
18
- declare const _default: React.NamedExoticComponent<IClickProps>;
19
- export default _default;
@@ -1,19 +0,0 @@
1
- import { __rest } from "tslib";
2
- import React, { memo, useMemo } from 'react';
3
- import './index.less';
4
- import tel from './tel.png';
5
- import ConsentDetail from '../../popup/ConsentDetail';
6
- const Click = (_a) => {
7
- var { isTel, open, content, style, consentPopupCate, acceptButton, rejectButton } = _a, props = __rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "acceptButton", "rejectButton"]);
8
- const visivle = useMemo(() => {
9
- return consentPopupCate || (open && style);
10
- }, [consentPopupCate, open]);
11
- const handleClickAccept = () => { };
12
- const handleClickReject = () => { };
13
- return (React.createElement(React.Fragment, null, isTel ? (React.createElement("img", { src: tel, style: { objectFit: 'cover', width: '100%', height: '100%' } })) : (React.createElement(React.Fragment, null, visivle && (React.createElement("div", { className: 'consentPopupClick' },
14
- React.createElement("div", { className: 'consentPopupClick-container', style: style },
15
- React.createElement(ConsentDetail, { content: content, style: { padding: 0 } }),
16
- React.createElement("button", { style: acceptButton === null || acceptButton === void 0 ? void 0 : acceptButton.style, onClick: handleClickAccept }, acceptButton === null || acceptButton === void 0 ? void 0 : acceptButton.text),
17
- React.createElement("button", { style: rejectButton === null || rejectButton === void 0 ? void 0 : rejectButton.style, onClick: handleClickReject }, rejectButton === null || rejectButton === void 0 ? void 0 : rejectButton.text))))))));
18
- };
19
- export default memo(Click);
@@ -1,2 +0,0 @@
1
- declare const Click: import("../../../../core/create").MaterialComponet<import(".").IClickProps>;
2
- export { Click };
@@ -1,48 +0,0 @@
1
- import settingRender from './settingRender';
2
- import ClickComponent from '.';
3
- import { createMaterial } from '../../../../core/create';
4
- const Click = createMaterial(ClickComponent, {
5
- displayName: 'Click Consent',
6
- icon: '',
7
- category: 'consentPopup',
8
- type: 'Click',
9
- related: {
10
- settingRender,
11
- bindableProps: []
12
- },
13
- defaulSetting: {
14
- props: {
15
- content: '<p><strong><span style="font-size:14px"><span style="line-height:3">Your Cookie Preferences</span></span></strong></p><p>We use cookie, including third-party cookies, to ensure the proper functioning and security of this site, to analyse its use, and to show you personalised content. You can authorise the use of all cookies by clicking on &quot;Accept all cookies&quot;. If you click on &quot;Reject all cookies&quot;, we will only use cookies necessary for the proper functioning and security of this site. To personalise on adjust your preferences at any time, click on &quot;Cookies Settings&quot; below or at the bottom of any Fendi.com webpage. For more information, read our Cookie Policy.</p><p></p>',
16
- acceptButton: {
17
- text: 'Accept all cookies',
18
- style: {
19
- backgroundColor: '#000',
20
- height: 45,
21
- color: '#fff',
22
- fontSize: 12,
23
- textAlign: 'center',
24
- marginTop: 5,
25
- marginBottom: 5
26
- }
27
- },
28
- rejectButton: {
29
- text: 'Reject all cookies',
30
- style: {
31
- backgroundColor: '#000',
32
- height: 45,
33
- color: '#fff',
34
- fontSize: 12,
35
- textAlign: 'center',
36
- marginTop: 5,
37
- marginBottom: 5
38
- }
39
- }
40
- },
41
- style: {
42
- backgroundColor: '#fff',
43
- padding: 18
44
- }
45
- },
46
- sort: 2
47
- });
48
- export { Click };
@@ -1,63 +0,0 @@
1
- declare const _default: ({
2
- title: string;
3
- child: {
4
- type: string;
5
- name: string[];
6
- }[];
7
- } | {
8
- title: string;
9
- child: ({
10
- type: string;
11
- label: string;
12
- name: string[];
13
- addonAfter?: undefined;
14
- child?: undefined;
15
- } | {
16
- type: string;
17
- label: string;
18
- name: string[];
19
- addonAfter: string;
20
- child?: undefined;
21
- } | {
22
- type: string;
23
- label: string;
24
- child: ({
25
- type: string;
26
- name: string[];
27
- max: number;
28
- addonAfter?: undefined;
29
- } | {
30
- type: string;
31
- name: string[];
32
- addonAfter: string;
33
- max: number;
34
- })[];
35
- name?: undefined;
36
- addonAfter?: undefined;
37
- } | {
38
- type: string;
39
- label: string;
40
- child: {
41
- type: string;
42
- name: string[];
43
- bottomText: string;
44
- }[];
45
- name?: undefined;
46
- addonAfter?: undefined;
47
- } | {
48
- type: string;
49
- label: string;
50
- child: ({
51
- type: string;
52
- name: string[];
53
- addonAfter?: undefined;
54
- } | {
55
- type: string;
56
- name: string[];
57
- addonAfter: string;
58
- })[];
59
- name?: undefined;
60
- addonAfter?: undefined;
61
- })[];
62
- })[];
63
- export default _default;