pb-sxp-ui 1.14.1 → 1.15.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 (34) hide show
  1. package/dist/index.cjs +66 -24
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +13 -0
  4. package/dist/index.js +66 -24
  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 +66 -24
  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/Consent/index.js +8 -2
  15. package/es/core/components/SxpPageRender/WaterFall/List.js +3 -3
  16. package/es/core/components/SxpPageRender/WaterFall/index.js +2 -2
  17. package/es/core/context/SxpDataSourceProvider.js +13 -8
  18. package/es/core/utils/tool.d.ts +2 -1
  19. package/es/core/utils/tool.js +38 -14
  20. package/es/materials/sxp/HashTag/index.d.ts +4 -1
  21. package/es/materials/sxp/HashTag/material.js +2 -1
  22. package/es/materials/sxp/HashTag/settingRender.d.ts +0 -2
  23. package/es/materials/sxp/HashTag/settingRender.js +2 -3
  24. package/lib/core/components/Consent/index.js +8 -2
  25. package/lib/core/components/SxpPageRender/WaterFall/List.js +3 -3
  26. package/lib/core/components/SxpPageRender/WaterFall/index.js +2 -2
  27. package/lib/core/context/SxpDataSourceProvider.js +12 -7
  28. package/lib/core/utils/tool.d.ts +2 -1
  29. package/lib/core/utils/tool.js +39 -14
  30. package/lib/materials/sxp/HashTag/index.d.ts +4 -1
  31. package/lib/materials/sxp/HashTag/material.js +2 -1
  32. package/lib/materials/sxp/HashTag/settingRender.d.ts +0 -2
  33. package/lib/materials/sxp/HashTag/settingRender.js +2 -3
  34. package/package.json +1 -1
package/dist/pb-ui.js CHANGED
@@ -150,6 +150,13 @@
150
150
  return tokenData;
151
151
  });
152
152
 
153
+ /*
154
+ * @Author : haocanweng@chatlabs.cn
155
+ * @Date : 2023-08-21 16:58:40
156
+ * @LastEditors: binruan@chatlabs.com
157
+ * @LastEditTime: 2024-11-20 18:26:50
158
+ * @FilePath: \pb-sxp-ui\src\core\utils\tool.ts
159
+ */
153
160
  // 生成uuid
154
161
  function uuid(len, radix) {
155
162
  const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
@@ -204,8 +211,8 @@
204
211
  const cnStyle = `font-family:${cn !== null && cn !== void 0 ? cn : 'inherit'}`;
205
212
  const enStyle = `font-family:${en !== null && en !== void 0 ? en : 'inherit'}`;
206
213
  const fn = (str) => {
207
- let chineseStartIndex = str.search(chineseRegex);
208
- let englishStartIndex = str.search(englishRegex);
214
+ const chineseStartIndex = str.search(chineseRegex);
215
+ const englishStartIndex = str.search(englishRegex);
209
216
  if (chineseStartIndex !== -1 && englishStartIndex !== -1 && chineseStartIndex < englishStartIndex) {
210
217
  content += `<span style="${cnStyle}">${str.substring(chineseStartIndex, englishStartIndex)}</span>`;
211
218
  text = str.substring(englishStartIndex, str === null || str === void 0 ? void 0 : str.length);
@@ -250,7 +257,7 @@
250
257
  return value !== null && value !== void 0 ? value : '';
251
258
  }
252
259
  function getScreenReader() {
253
- let userAgent = self.navigator.userAgent;
260
+ const userAgent = self.navigator.userAgent;
254
261
  if (!userAgent)
255
262
  return false;
256
263
  return (/TalkBack/i.test(userAgent) ||
@@ -260,6 +267,30 @@
260
267
  /JAWS/i.test(userAgent) ||
261
268
  /ChromeVox/i.test(userAgent));
262
269
  }
270
+ function splitUrlParams(urlParams) {
271
+ if (!urlParams)
272
+ return;
273
+ const indList = [];
274
+ for (let i = 0; i < urlParams.length; i++) {
275
+ const item = urlParams[i];
276
+ const curStr = urlParams.substring(i + 1, urlParams.length);
277
+ if (item === '&' &&
278
+ (curStr === null || curStr === void 0 ? void 0 : curStr.indexOf('=')) !== -1 &&
279
+ ((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)) {
280
+ indList.push(i);
281
+ }
282
+ }
283
+ const splitList = indList.length > 0 ? [] : [urlParams];
284
+ let lastIndex = 0;
285
+ indList === null || indList === void 0 ? void 0 : indList.map((i) => {
286
+ splitList === null || splitList === void 0 ? void 0 : splitList.push(urlParams.substring(lastIndex, i));
287
+ lastIndex = i + 1;
288
+ if (i === indList[indList.length - 1] && i < urlParams.length) {
289
+ splitList === null || splitList === void 0 ? void 0 : splitList.push(urlParams.substring(lastIndex, urlParams.length));
290
+ }
291
+ });
292
+ return splitList !== null && splitList !== void 0 ? splitList : [];
293
+ }
263
294
 
264
295
  function unzip(b64Data) {
265
296
  const strData = atob(b64Data);
@@ -513,15 +544,21 @@
513
544
  * @Author: binruan@chatlabs.com
514
545
  * @Date: 2024-06-13 15:16:53
515
546
  * @LastEditors: binruan@chatlabs.com
516
- * @LastEditTime: 2024-06-19 14:13:50
547
+ * @LastEditTime: 2025-01-24 14:56:51
517
548
  * @FilePath: \pb-sxp-ui\src\core\components\Consent\index.tsx
518
549
  *
519
550
  */
520
551
  const Consent$3 = ({ width = window.innerWidth, height = window.innerHeight, privacy_title, privacy_context, privacy_policy_url, privacy_policy_title }) => {
521
552
  const { setIsAgreePolicy, bffEventReport } = useSxpDataSource();
522
553
  const channelObj = React.useMemo(() => {
554
+ var _a;
523
555
  const queryString = location.search.slice(1);
524
- const params = qs.parse(queryString.replace(/\+/g, '%2B'));
556
+ const params = {};
557
+ (_a = splitUrlParams(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
558
+ const key = val.split('=')[0];
559
+ const value = val.split('=')[1];
560
+ params[key] = value;
561
+ });
525
562
  for (const key in params) {
526
563
  params[key] = params[key].replace(/%2B/g, '+');
527
564
  }
@@ -713,7 +750,7 @@
713
750
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
714
751
  }
715
752
  else if (utmVal) {
716
- const val = (_k = (_j = (_h = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _h === void 0 ? void 0 : _h.filter((val) => {
753
+ const val = (_k = (_j = (_h = splitUrlParams(utmVal)) === null || _h === void 0 ? void 0 : _h.filter((val) => {
717
754
  var _a, _b;
718
755
  const key = val.split('=')[0];
719
756
  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);
@@ -840,7 +877,7 @@
840
877
  !((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName])) {
841
878
  return;
842
879
  }
843
- let jsonParams = lodash.cloneDeep((_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _b === void 0 ? void 0 : _b[eventName]);
880
+ const jsonParams = lodash.cloneDeep((_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _b === void 0 ? void 0 : _b[eventName]);
844
881
  const urlParams = new URLSearchParams(window.location.search);
845
882
  const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
846
883
  const fix_par = {
@@ -922,7 +959,7 @@
922
959
  if (!utmVal || !isShowTag)
923
960
  return;
924
961
  try {
925
- const val = (_10 = (_9 = (_8 = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _8 === void 0 ? void 0 : _8.filter((val) => {
962
+ const val = (_10 = (_9 = (_8 = splitUrlParams(utmVal)) === null || _8 === void 0 ? void 0 : _8.filter((val) => {
926
963
  var _a, _b;
927
964
  const key = val.split('=')[0];
928
965
  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);
@@ -957,9 +994,14 @@
957
994
  });
958
995
  }, [bffEventReport, isFromHashtag]);
959
996
  const h5EnterLink = React.useCallback(() => {
960
- var _a, _b;
997
+ var _a, _b, _c;
961
998
  const queryString = location.search.slice(1);
962
- const params = qs.parse(queryString.replace(/\+/g, '%2B'));
999
+ const params = {};
1000
+ (_a = splitUrlParams(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
1001
+ const key = val.split('=')[0];
1002
+ const value = val.split('=')[1];
1003
+ params[key] = value;
1004
+ });
963
1005
  for (const key in params) {
964
1006
  params[key] = params[key].replace(/%2B/g, '+');
965
1007
  }
@@ -977,7 +1019,7 @@
977
1019
  utmContent: getVal('utm_content'),
978
1020
  enterTime: Math.floor(time / 1000) + '',
979
1021
  requestId: null,
980
- enterUrl: (_b = (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.href) !== null && _b !== void 0 ? _b : '',
1022
+ enterUrl: (_c = (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href) !== null && _c !== void 0 ? _c : '',
981
1023
  clSource: getVal('cl_source')
982
1024
  },
983
1025
  reportLayId: false
@@ -13270,7 +13312,7 @@ Made in Italy` })));
13270
13312
  * @Author: binruan@chatlabs.com
13271
13313
  * @Date: 2024-04-07 14:07:12
13272
13314
  * @LastEditors: binruan@chatlabs.com
13273
- * @LastEditTime: 2024-08-22 10:14:36
13315
+ * @LastEditTime: 2025-02-17 17:16:56
13274
13316
  * @FilePath: \pb-sxp-ui\src\materials\sxp\HashTag\settingRender.tsx
13275
13317
  *
13276
13318
  */
@@ -13295,10 +13337,9 @@ Made in Italy` })));
13295
13337
  addonAfter: 'px'
13296
13338
  },
13297
13339
  {
13298
- type: 'Switch',
13340
+ type: 'HashTagFixedSize',
13299
13341
  label: '固定宽高',
13300
- name: ['props', 'openFixedSize'],
13301
- initialValue: true
13342
+ name: ['props', 'openFixedSize']
13302
13343
  }
13303
13344
  ]
13304
13345
  },
@@ -15106,7 +15147,7 @@ Made in Italy` })));
15106
15147
 
15107
15148
  const WaterfallFlowItem = (props) => {
15108
15149
  var _a;
15109
- const { rec, index, list, reportTagsView, textStyles, space } = props;
15150
+ const { rec, index, list, reportTagsView, textStyles, space, openFixedSize } = props;
15110
15151
  const { swiperRef, setRtcList, setOpenHashtag, sxpParameter, globalConfig } = useSxpDataSource();
15111
15152
  const [showVideo, setShowVideo] = React.useState(false);
15112
15153
  const imgDom = React.useRef(null);
@@ -15215,11 +15256,11 @@ Made in Italy` })));
15215
15256
  }, 0);
15216
15257
  };
15217
15258
  return (React.createElement("div", { ref: ref, className: 'list-content-listItem', key: index, onClick: handleClickToDetail, style: { marginBottom: space } },
15218
- React.createElement("div", { className: 'list-content-listItem-picture' },
15259
+ React.createElement("div", { className: (openFixedSize === null || openFixedSize === void 0 ? void 0 : openFixedSize.ratio) === '1' ? 'list-content-listItem-picture' : 'list-content-listItem-picture1609' },
15219
15260
  showVideo && (React.createElement("div", { style: { display: 'none' } },
15220
15261
  React.createElement("video", { ref: videoDom, crossOrigin: 'anonymous', className: 'list-content-listItem-picture-img' }),
15221
15262
  React.createElement("canvas", { ref: canvasRef }))),
15222
- React.createElement(FormatImage$1, { loading: 'lazy', className: 'list-content-listItem-picture-img', ref: imgDom })),
15263
+ React.createElement(FormatImage$1, { loading: 'lazy', className: (openFixedSize === null || openFixedSize === void 0 ? void 0 : openFixedSize.ratio) === '1' ? 'list-content-listItem-picture-img' : 'list-content-listItem-picture1609-img', ref: imgDom })),
15223
15264
  React.createElement("div", { className: 'list-content-listItem-info' },
15224
15265
  React.createElement("div", { className: `${'list-content-listItem-info-title'} ${priceText ? 'list-content-listItem-info-nowrap' : ''}`, style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.title, dangerouslySetInnerHTML: {
15225
15266
  __html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
@@ -15330,12 +15371,12 @@ Made in Italy` })));
15330
15371
  * @Author: binruan@chatlabs.com
15331
15372
  * @Date: 2024-01-10 10:58:24
15332
15373
  * @LastEditors: binruan@chatlabs.com
15333
- * @LastEditTime: 2024-12-09 11:18:32
15374
+ * @LastEditTime: 2025-02-17 16:25:30
15334
15375
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
15335
15376
  *
15336
15377
  */
15337
15378
  const WaterFall = (props) => {
15338
- var _a;
15379
+ var _a, _b;
15339
15380
  const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag, bffFbReport } = useSxpDataSource();
15340
15381
  const { backMainFeed } = useEventReport();
15341
15382
  const modalEleRef = React.useRef(null);
@@ -15424,7 +15465,7 @@ Made in Italy` })));
15424
15465
  display: openHashtag ? 'block' : 'none'
15425
15466
  } },
15426
15467
  React.createElement(Navbar$1, { icon: img$4, styles: { top: '32px' }, textStyle: (_a = props === null || props === void 0 ? void 0 : props.textStyles) === null || _a === void 0 ? void 0 : _a.hashTagTitle, onClose: handleClose }),
15427
- (props === null || props === void 0 ? void 0 : props.openFixedSize) === true || (props === null || props === void 0 ? void 0 : props.openFixedSize) === undefined ? (React.createElement(WaterfallList, Object.assign({ key: waterFallData, reportTagsView: reportTagsView }, props))) : (React.createElement(WaterfallList$1, Object.assign({ key: waterFallData, reportTagsView: reportTagsView }, props)))), modalEleRef.current);
15468
+ ((_b = props === null || props === void 0 ? void 0 : props.openFixedSize) === null || _b === void 0 ? void 0 : _b.open) === true || (props === null || props === void 0 ? void 0 : props.openFixedSize) === undefined ? (React.createElement(WaterfallList, Object.assign({ key: waterFallData, reportTagsView: reportTagsView }, props))) : (React.createElement(WaterfallList$1, Object.assign({ key: waterFallData, reportTagsView: reportTagsView }, props)))), modalEleRef.current);
15428
15469
  };
15429
15470
  var WaterFall$1 = React.memo(WaterFall);
15430
15471
 
@@ -15432,7 +15473,7 @@ Made in Italy` })));
15432
15473
  * @Author: binruan@chatlabs.com
15433
15474
  * @Date: 2024-01-15 19:03:09
15434
15475
  * @LastEditors: binruan@chatlabs.com
15435
- * @LastEditTime: 2024-08-22 10:15:23
15476
+ * @LastEditTime: 2025-02-17 16:24:14
15436
15477
  * @FilePath: \pb-sxp-ui\src\materials\sxp\HashTag\index.tsx
15437
15478
  *
15438
15479
  */
@@ -15445,7 +15486,7 @@ Made in Italy` })));
15445
15486
  * @Author: binruan@chatlabs.com
15446
15487
  * @Date: 2023-07-28 18:29:57
15447
15488
  * @LastEditors: binruan@chatlabs.com
15448
- * @LastEditTime: 2024-09-18 10:48:44
15489
+ * @LastEditTime: 2025-02-17 17:45:40
15449
15490
  * @FilePath: \pb-sxp-ui\src\materials\sxp\HashTag\material.tsx
15450
15491
  *
15451
15492
  */
@@ -15504,7 +15545,8 @@ Made in Italy` })));
15504
15545
  paddingLeft: 20,
15505
15546
  paddingRight: 20,
15506
15547
  paddingBottom: 20
15507
- }
15548
+ },
15549
+ openFixedSize: { open: true, ratio: '1' }
15508
15550
  }
15509
15551
  },
15510
15552
  w: 100,