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.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { isEmpty, isEqual, cloneDeep, debounce, throttle, get } from 'lodash';
1
+ import { isEmpty, cloneDeep, isEqual, debounce, throttle, get } from 'lodash';
2
2
  import { v4 } from 'uuid';
3
3
  import pako from 'pako';
4
4
  import React, { useContext, useMemo, memo, useEffect, createContext, useState, useRef, useCallback, forwardRef, useImperativeHandle, useLayoutEffect } from 'react';
@@ -805,7 +805,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
805
805
  !((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName])) {
806
806
  return;
807
807
  }
808
- let jsonParams = JSON.parse(JSON.stringify((_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _b === void 0 ? void 0 : _b[eventName]));
808
+ let jsonParams = cloneDeep((_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _b === void 0 ? void 0 : _b[eventName]);
809
809
  const urlParams = new URLSearchParams(window.location.search);
810
810
  const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
811
811
  const fix_par = {
@@ -834,10 +834,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
834
834
  const matches = value === null || value === void 0 ? void 0 : value.match(regex);
835
835
  if (matches) {
836
836
  matches.forEach((match) => {
837
+ var _a;
837
838
  const prop = match.substring(2, match.length - 2);
838
839
  try {
839
840
  let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
840
841
  if (replaceValue) {
842
+ if (prop.indexOf('currency') &&
843
+ (replaceValue === null || replaceValue === void 0 ? void 0 : replaceValue.indexOf('-')) !== -1 &&
844
+ typeof replaceValue === 'string') {
845
+ replaceValue = (_a = replaceValue === null || replaceValue === void 0 ? void 0 : replaceValue.split('-')) === null || _a === void 0 ? void 0 : _a[0];
846
+ }
841
847
  obj[key] = replaceValue;
842
848
  }
843
849
  else {
@@ -15724,7 +15730,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15724
15730
  position: index + '',
15725
15731
  contentFormat: 'video',
15726
15732
  traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo,
15727
- loadTime: ((loadedTimeRef === null || loadedTimeRef === void 0 ? void 0 : loadedTimeRef.current) - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current)).toFixed(2) + ''
15733
+ loadTime: (loadedTimeRef === null || loadedTimeRef === void 0 ? void 0 : loadedTimeRef.current) - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current) + ''
15728
15734
  }
15729
15735
  });
15730
15736
  setIsFirstPlay(false);
@@ -16111,7 +16117,7 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
16111
16117
  const showFirstImageFn = useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
16112
16118
  if (!isLoad) {
16113
16119
  setImgInfo({
16114
- loadTime: (new Date() - initTime).toFixed(2) + ''
16120
+ loadTime: new Date() - initTime + ''
16115
16121
  });
16116
16122
  setIsLoad(true);
16117
16123
  }