pb-sxp-ui 1.7.6 → 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.
@@ -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: (new Date() - initTime).toFixed(2) + ''
34
+ loadTime: new Date() - initTime + ''
35
35
  });
36
36
  setIsLoad(true);
37
37
  }
@@ -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: ((loadedTimeRef === null || loadedTimeRef === void 0 ? void 0 : loadedTimeRef.current) - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current)).toFixed(2) + ''
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);
@@ -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 = JSON.parse(JSON.stringify((_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _b === void 0 ? void 0 : _b[eventName]));
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: (new Date() - initTime).toFixed(2) + ''
36
+ loadTime: new Date() - initTime + ''
37
37
  });
38
38
  setIsLoad(true);
39
39
  }
@@ -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: ((loadedTimeRef === null || loadedTimeRef === void 0 ? void 0 : loadedTimeRef.current) - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current)).toFixed(2) + ''
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);
@@ -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 = JSON.parse(JSON.stringify((_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _b === void 0 ? void 0 : _b[eventName]));
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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.7.6",
3
+ "version": "1.7.7",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",