pb-sxp-ui 14.0.4 → 14.0.6

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.
@@ -1,12 +1,18 @@
1
1
  import React, { memo, useEffect, useMemo } from 'react';
2
- import qs from 'qs';
3
2
  import { useSxpDataSource } from '../../../core/hooks';
4
3
  import { AGREE_POLICY } from '../../../core/utils/localStore';
4
+ import { splitUrlParams } from '../../../core/utils/tool';
5
5
  const Consent = ({ width = window.innerWidth, height = window.innerHeight, privacy_title, privacy_context, privacy_policy_url, privacy_policy_title }) => {
6
6
  const { setIsAgreePolicy, bffEventReport } = useSxpDataSource();
7
7
  const channelObj = useMemo(() => {
8
+ var _a;
8
9
  const queryString = location.search.slice(1);
9
- const params = qs.parse(queryString.replace(/\+/g, '%2B'));
10
+ const params = {};
11
+ (_a = splitUrlParams(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
12
+ const key = val.split('=')[0];
13
+ const value = val.split('=')[1];
14
+ params[key] = value;
15
+ });
10
16
  for (const key in params) {
11
17
  params[key] = params[key].replace(/%2B/g, '+');
12
18
  }
@@ -7,7 +7,7 @@ import { storeAndLoadFeUserId, AGREE_POLICY } from '../utils/localStore';
7
7
  import { useIconLink } from '../components/SxpPageRender/useIconLink';
8
8
  import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../utils/event';
9
9
  import Consent from '../components/Consent';
10
- import { getCookie } from '../utils/tool';
10
+ import { getCookie, splitUrlParams } from '../utils/tool';
11
11
  export const SxpDataSourceContext = createContext({
12
12
  rtcList: [],
13
13
  tagList: []
@@ -122,30 +122,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
122
122
  .then((res) => res.json())
123
123
  .catch((err) => Promise.reject(err));
124
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
- }
149
125
  const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
150
126
  var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
151
127
  query = {
@@ -400,9 +376,14 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
400
376
  });
401
377
  }, [bffEventReport, isFromHashtag]);
402
378
  const h5EnterLink = useCallback(() => {
403
- var _a, _b;
379
+ var _a, _b, _c;
404
380
  const queryString = location.search.slice(1);
405
- const params = qs.parse(queryString.replace(/\+/g, '%2B'));
381
+ const params = {};
382
+ (_a = splitUrlParams(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
383
+ const key = val.split('=')[0];
384
+ const value = val.split('=')[1];
385
+ params[key] = value;
386
+ });
406
387
  for (const key in params) {
407
388
  params[key] = params[key].replace(/%2B/g, '+');
408
389
  }
@@ -420,7 +401,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
420
401
  utmContent: getVal('utm_content'),
421
402
  enterTime: Math.floor(time / 1000) + '',
422
403
  requestId: null,
423
- 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 : '',
404
+ 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 : '',
424
405
  clSource: getVal('cl_source')
425
406
  },
426
407
  reportLayId: false
@@ -12,4 +12,5 @@ declare function getSystem(): string | null;
12
12
  declare function getDevice(): string | null;
13
13
  declare function getCookie(val: string): string;
14
14
  declare function getScreenReader(): boolean;
15
- export { uuid, getIndexByblockType, getBrowserInfo, getDevice, getSystem, getCookie, getScreenReader };
15
+ declare function splitUrlParams(urlParams: string): string[] | undefined;
16
+ export { uuid, getIndexByblockType, getBrowserInfo, getDevice, getSystem, getCookie, getScreenReader, splitUrlParams };
@@ -60,8 +60,8 @@ export const setFontForText = (textContent, style) => {
60
60
  const cnStyle = `font-family:${cn !== null && cn !== void 0 ? cn : 'inherit'}`;
61
61
  const enStyle = `font-family:${en !== null && en !== void 0 ? en : 'inherit'}`;
62
62
  const fn = (str) => {
63
- let chineseStartIndex = str.search(chineseRegex);
64
- let englishStartIndex = str.search(englishRegex);
63
+ const chineseStartIndex = str.search(chineseRegex);
64
+ const englishStartIndex = str.search(englishRegex);
65
65
  if (chineseStartIndex !== -1 && englishStartIndex !== -1 && chineseStartIndex < englishStartIndex) {
66
66
  content += `<span style="${cnStyle}">${str.substring(chineseStartIndex, englishStartIndex)}</span>`;
67
67
  text = str.substring(englishStartIndex, str === null || str === void 0 ? void 0 : str.length);
@@ -90,7 +90,7 @@ export const setFontForText = (textContent, style) => {
90
90
  };
91
91
  function getBrowserInfo() {
92
92
  var _a, _b, _c, _d, _e, _f, _g;
93
- let userAgent = self.navigator.userAgent;
93
+ const userAgent = self.navigator.userAgent;
94
94
  if (!userAgent)
95
95
  return null;
96
96
  if (/edge\/([\d\.]+)/i.exec(userAgent))
@@ -111,7 +111,7 @@ function getBrowserInfo() {
111
111
  }
112
112
  function getSystem() {
113
113
  var _a, _b, _c;
114
- let userAgent = self.navigator.userAgent;
114
+ const userAgent = self.navigator.userAgent;
115
115
  if (!userAgent)
116
116
  return null;
117
117
  if (/iphone/i.test(userAgent))
@@ -121,27 +121,27 @@ function getSystem() {
121
121
  if (/windows/i.test(userAgent))
122
122
  return `Windows ${(_c = userAgent.match(/Windows\s(.*?)\;/)) === null || _c === void 0 ? void 0 : _c[1]}`;
123
123
  if (/mac/i.test(userAgent))
124
- return `Mac OS`;
124
+ return 'Mac OS';
125
125
  return null;
126
126
  }
127
127
  function getDevice() {
128
- let userAgent = self.navigator.userAgent;
128
+ const userAgent = self.navigator.userAgent;
129
129
  if (!userAgent)
130
130
  return null;
131
131
  if (/iphone/i.test(userAgent))
132
- return `iPhone`;
132
+ return 'iPhone';
133
133
  if (/android/i.test(userAgent)) {
134
- var index1 = userAgent.indexOf('(');
135
- var index2 = userAgent.indexOf(')');
134
+ const index1 = userAgent.indexOf('(');
135
+ const index2 = userAgent.indexOf(')');
136
136
  if (index1 !== -1 && index2 !== -1) {
137
- var value = userAgent.substring(index1 + 1, index2);
137
+ const value = userAgent.substring(index1 + 1, index2);
138
138
  return `${value}`;
139
139
  }
140
140
  }
141
141
  if (/windows/i.test(userAgent))
142
- return `Windows`;
142
+ return 'Windows';
143
143
  if (/mac/i.test(userAgent))
144
- return `Mac`;
144
+ return 'Mac';
145
145
  return null;
146
146
  }
147
147
  function getCookie(val) {
@@ -157,7 +157,7 @@ function getCookie(val) {
157
157
  return value !== null && value !== void 0 ? value : '';
158
158
  }
159
159
  function getScreenReader() {
160
- let userAgent = self.navigator.userAgent;
160
+ const userAgent = self.navigator.userAgent;
161
161
  if (!userAgent)
162
162
  return false;
163
163
  return (/TalkBack/i.test(userAgent) ||
@@ -167,4 +167,28 @@ function getScreenReader() {
167
167
  /JAWS/i.test(userAgent) ||
168
168
  /ChromeVox/i.test(userAgent));
169
169
  }
170
- export { uuid, getIndexByblockType, getBrowserInfo, getDevice, getSystem, getCookie, getScreenReader };
170
+ function splitUrlParams(urlParams) {
171
+ if (!urlParams)
172
+ return;
173
+ const indList = [];
174
+ for (let i = 0; i < urlParams.length; i++) {
175
+ const item = urlParams[i];
176
+ const curStr = urlParams.substring(i + 1, urlParams.length);
177
+ if (item === '&' &&
178
+ (curStr === null || curStr === void 0 ? void 0 : curStr.indexOf('=')) !== -1 &&
179
+ ((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)) {
180
+ indList.push(i);
181
+ }
182
+ }
183
+ const splitList = indList.length > 0 ? [] : [urlParams];
184
+ let lastIndex = 0;
185
+ indList === null || indList === void 0 ? void 0 : indList.map((i) => {
186
+ splitList === null || splitList === void 0 ? void 0 : splitList.push(urlParams.substring(lastIndex, i));
187
+ lastIndex = i + 1;
188
+ if (i === indList[indList.length - 1] && i < urlParams.length) {
189
+ splitList === null || splitList === void 0 ? void 0 : splitList.push(urlParams.substring(lastIndex, urlParams.length));
190
+ }
191
+ });
192
+ return splitList !== null && splitList !== void 0 ? splitList : [];
193
+ }
194
+ export { uuid, getIndexByblockType, getBrowserInfo, getDevice, getSystem, getCookie, getScreenReader, splitUrlParams };
@@ -12,10 +12,6 @@ export interface IIframeProps {
12
12
  submitButtonStyle?: CSSProperties;
13
13
  contentStyle?: CSSProperties;
14
14
  isTel?: boolean;
15
- iframe?: {
16
- src?: string;
17
- allow?: string;
18
- };
19
15
  }
20
16
  declare const _default: React.NamedExoticComponent<IIframeProps>;
21
17
  export default _default;
@@ -5,12 +5,11 @@ 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, iframe } = _a, props = __rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick", "submitButtonStyle", "contentStyle", "isTel", "iframe"]);
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"]);
9
9
  const { popupDetailData } = useSxpDataSource();
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: {
10
+ const iframeUrl = (_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;
11
+ return (React.createElement("div", Object.assign({ className: `${css(Object.assign({}, style))}` }, props),
12
+ React.createElement("iframe", { src: iframeUrl, style: {
14
13
  width: '100%',
15
14
  height: 'calc(100% - 50px)',
16
15
  marginTop: '50px',
@@ -8,20 +8,5 @@ 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
- ]
26
11
  }
27
12
  ];
@@ -2,14 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
- const qs_1 = tslib_1.__importDefault(require("qs"));
6
5
  const hooks_1 = require("../../../core/hooks");
7
6
  const localStore_1 = require("../../../core/utils/localStore");
7
+ const tool_1 = require("../../../core/utils/tool");
8
8
  const Consent = ({ width = window.innerWidth, height = window.innerHeight, privacy_title, privacy_context, privacy_policy_url, privacy_policy_title }) => {
9
9
  const { setIsAgreePolicy, bffEventReport } = (0, hooks_1.useSxpDataSource)();
10
10
  const channelObj = (0, react_1.useMemo)(() => {
11
+ var _a;
11
12
  const queryString = location.search.slice(1);
12
- const params = qs_1.default.parse(queryString.replace(/\+/g, '%2B'));
13
+ const params = {};
14
+ (_a = (0, tool_1.splitUrlParams)(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
15
+ const key = val.split('=')[0];
16
+ const value = val.split('=')[1];
17
+ params[key] = value;
18
+ });
13
19
  for (const key in params) {
14
20
  params[key] = params[key].replace(/%2B/g, '+');
15
21
  }
@@ -125,30 +125,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
125
125
  .then((res) => res.json())
126
126
  .catch((err) => Promise.reject(err));
127
127
  }, [bffDataSource]);
128
- function splitUrlParams(urlParams) {
129
- if (!urlParams)
130
- return;
131
- const indList = [];
132
- for (let i = 0; i < urlParams.length; i++) {
133
- const item = urlParams[i];
134
- const curStr = urlParams.substring(i + 1, urlParams.length);
135
- if (item === '&' &&
136
- (curStr === null || curStr === void 0 ? void 0 : curStr.indexOf('=')) !== -1 &&
137
- ((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)) {
138
- indList.push(i);
139
- }
140
- }
141
- const splitList = indList.length > 0 ? [] : [urlParams];
142
- let lastIndex = 0;
143
- indList === null || indList === void 0 ? void 0 : indList.map((i) => {
144
- splitList === null || splitList === void 0 ? void 0 : splitList.push(urlParams.substring(lastIndex, i));
145
- lastIndex = i + 1;
146
- if (i === indList[indList.length - 1] && i < urlParams.length) {
147
- splitList === null || splitList === void 0 ? void 0 : splitList.push(urlParams.substring(lastIndex, urlParams.length));
148
- }
149
- });
150
- return splitList !== null && splitList !== void 0 ? splitList : [];
151
- }
152
128
  const getRecommendVideos = (0, react_1.useCallback)((query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
153
129
  var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
154
130
  query = {
@@ -165,7 +141,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
165
141
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
166
142
  }
167
143
  else if (utmVal) {
168
- const val = (_k = (_j = (_h = splitUrlParams(utmVal)) === null || _h === void 0 ? void 0 : _h.filter((val) => {
144
+ const val = (_k = (_j = (_h = (0, tool_1.splitUrlParams)(utmVal)) === null || _h === void 0 ? void 0 : _h.filter((val) => {
169
145
  var _a, _b;
170
146
  const key = val.split('=')[0];
171
147
  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);
@@ -368,7 +344,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
368
344
  if (!utmVal || !isShowTag)
369
345
  return;
370
346
  try {
371
- const val = (_10 = (_9 = (_8 = splitUrlParams(utmVal)) === null || _8 === void 0 ? void 0 : _8.filter((val) => {
347
+ const val = (_10 = (_9 = (_8 = (0, tool_1.splitUrlParams)(utmVal)) === null || _8 === void 0 ? void 0 : _8.filter((val) => {
372
348
  var _a, _b;
373
349
  const key = val.split('=')[0];
374
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);
@@ -403,9 +379,14 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
403
379
  });
404
380
  }, [bffEventReport, isFromHashtag]);
405
381
  const h5EnterLink = (0, react_1.useCallback)(() => {
406
- var _a, _b;
382
+ var _a, _b, _c;
407
383
  const queryString = location.search.slice(1);
408
- const params = qs_1.default.parse(queryString.replace(/\+/g, '%2B'));
384
+ const params = {};
385
+ (_a = (0, tool_1.splitUrlParams)(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
386
+ const key = val.split('=')[0];
387
+ const value = val.split('=')[1];
388
+ params[key] = value;
389
+ });
409
390
  for (const key in params) {
410
391
  params[key] = params[key].replace(/%2B/g, '+');
411
392
  }
@@ -423,7 +404,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
423
404
  utmContent: getVal('utm_content'),
424
405
  enterTime: Math.floor(time / 1000) + '',
425
406
  requestId: null,
426
- 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 : '',
407
+ 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 : '',
427
408
  clSource: getVal('cl_source')
428
409
  },
429
410
  reportLayId: false
@@ -12,4 +12,5 @@ declare function getSystem(): string | null;
12
12
  declare function getDevice(): string | null;
13
13
  declare function getCookie(val: string): string;
14
14
  declare function getScreenReader(): boolean;
15
- export { uuid, getIndexByblockType, getBrowserInfo, getDevice, getSystem, getCookie, getScreenReader };
15
+ declare function splitUrlParams(urlParams: string): string[] | undefined;
16
+ export { uuid, getIndexByblockType, getBrowserInfo, getDevice, getSystem, getCookie, getScreenReader, splitUrlParams };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getScreenReader = exports.getCookie = exports.getSystem = exports.getDevice = exports.getBrowserInfo = exports.getIndexByblockType = exports.uuid = exports.setFontForText = exports.getUid = exports.generateRandomString = void 0;
3
+ exports.splitUrlParams = exports.getScreenReader = exports.getCookie = exports.getSystem = exports.getDevice = exports.getBrowserInfo = exports.getIndexByblockType = exports.uuid = exports.setFontForText = exports.getUid = exports.generateRandomString = void 0;
4
4
  const uuid_1 = require("uuid");
5
5
  function uuid(len, radix) {
6
6
  const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
@@ -67,8 +67,8 @@ const setFontForText = (textContent, style) => {
67
67
  const cnStyle = `font-family:${cn !== null && cn !== void 0 ? cn : 'inherit'}`;
68
68
  const enStyle = `font-family:${en !== null && en !== void 0 ? en : 'inherit'}`;
69
69
  const fn = (str) => {
70
- let chineseStartIndex = str.search(chineseRegex);
71
- let englishStartIndex = str.search(englishRegex);
70
+ const chineseStartIndex = str.search(chineseRegex);
71
+ const englishStartIndex = str.search(englishRegex);
72
72
  if (chineseStartIndex !== -1 && englishStartIndex !== -1 && chineseStartIndex < englishStartIndex) {
73
73
  content += `<span style="${cnStyle}">${str.substring(chineseStartIndex, englishStartIndex)}</span>`;
74
74
  text = str.substring(englishStartIndex, str === null || str === void 0 ? void 0 : str.length);
@@ -98,7 +98,7 @@ const setFontForText = (textContent, style) => {
98
98
  exports.setFontForText = setFontForText;
99
99
  function getBrowserInfo() {
100
100
  var _a, _b, _c, _d, _e, _f, _g;
101
- let userAgent = self.navigator.userAgent;
101
+ const userAgent = self.navigator.userAgent;
102
102
  if (!userAgent)
103
103
  return null;
104
104
  if (/edge\/([\d\.]+)/i.exec(userAgent))
@@ -120,7 +120,7 @@ function getBrowserInfo() {
120
120
  exports.getBrowserInfo = getBrowserInfo;
121
121
  function getSystem() {
122
122
  var _a, _b, _c;
123
- let userAgent = self.navigator.userAgent;
123
+ const userAgent = self.navigator.userAgent;
124
124
  if (!userAgent)
125
125
  return null;
126
126
  if (/iphone/i.test(userAgent))
@@ -130,28 +130,28 @@ function getSystem() {
130
130
  if (/windows/i.test(userAgent))
131
131
  return `Windows ${(_c = userAgent.match(/Windows\s(.*?)\;/)) === null || _c === void 0 ? void 0 : _c[1]}`;
132
132
  if (/mac/i.test(userAgent))
133
- return `Mac OS`;
133
+ return 'Mac OS';
134
134
  return null;
135
135
  }
136
136
  exports.getSystem = getSystem;
137
137
  function getDevice() {
138
- let userAgent = self.navigator.userAgent;
138
+ const userAgent = self.navigator.userAgent;
139
139
  if (!userAgent)
140
140
  return null;
141
141
  if (/iphone/i.test(userAgent))
142
- return `iPhone`;
142
+ return 'iPhone';
143
143
  if (/android/i.test(userAgent)) {
144
- var index1 = userAgent.indexOf('(');
145
- var index2 = userAgent.indexOf(')');
144
+ const index1 = userAgent.indexOf('(');
145
+ const index2 = userAgent.indexOf(')');
146
146
  if (index1 !== -1 && index2 !== -1) {
147
- var value = userAgent.substring(index1 + 1, index2);
147
+ const value = userAgent.substring(index1 + 1, index2);
148
148
  return `${value}`;
149
149
  }
150
150
  }
151
151
  if (/windows/i.test(userAgent))
152
- return `Windows`;
152
+ return 'Windows';
153
153
  if (/mac/i.test(userAgent))
154
- return `Mac`;
154
+ return 'Mac';
155
155
  return null;
156
156
  }
157
157
  exports.getDevice = getDevice;
@@ -169,7 +169,7 @@ function getCookie(val) {
169
169
  }
170
170
  exports.getCookie = getCookie;
171
171
  function getScreenReader() {
172
- let userAgent = self.navigator.userAgent;
172
+ const userAgent = self.navigator.userAgent;
173
173
  if (!userAgent)
174
174
  return false;
175
175
  return (/TalkBack/i.test(userAgent) ||
@@ -180,3 +180,28 @@ function getScreenReader() {
180
180
  /ChromeVox/i.test(userAgent));
181
181
  }
182
182
  exports.getScreenReader = getScreenReader;
183
+ function splitUrlParams(urlParams) {
184
+ if (!urlParams)
185
+ return;
186
+ const indList = [];
187
+ for (let i = 0; i < urlParams.length; i++) {
188
+ const item = urlParams[i];
189
+ const curStr = urlParams.substring(i + 1, urlParams.length);
190
+ if (item === '&' &&
191
+ (curStr === null || curStr === void 0 ? void 0 : curStr.indexOf('=')) !== -1 &&
192
+ ((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)) {
193
+ indList.push(i);
194
+ }
195
+ }
196
+ const splitList = indList.length > 0 ? [] : [urlParams];
197
+ let lastIndex = 0;
198
+ indList === null || indList === void 0 ? void 0 : indList.map((i) => {
199
+ splitList === null || splitList === void 0 ? void 0 : splitList.push(urlParams.substring(lastIndex, i));
200
+ lastIndex = i + 1;
201
+ if (i === indList[indList.length - 1] && i < urlParams.length) {
202
+ splitList === null || splitList === void 0 ? void 0 : splitList.push(urlParams.substring(lastIndex, urlParams.length));
203
+ }
204
+ });
205
+ return splitList !== null && splitList !== void 0 ? splitList : [];
206
+ }
207
+ exports.splitUrlParams = splitUrlParams;
@@ -12,10 +12,6 @@ export interface IIframeProps {
12
12
  submitButtonStyle?: CSSProperties;
13
13
  contentStyle?: CSSProperties;
14
14
  isTel?: boolean;
15
- iframe?: {
16
- src?: string;
17
- allow?: string;
18
- };
19
15
  }
20
16
  declare const _default: React.NamedExoticComponent<IIframeProps>;
21
17
  export default _default;
@@ -7,12 +7,11 @@ require("./index.less");
7
7
  const hooks_1 = require("../../../../core/hooks");
8
8
  const Iframe = (_a) => {
9
9
  var _b, _c;
10
- var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick, submitButtonStyle, contentStyle, isTel, iframe } = _a, props = tslib_1.__rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick", "submitButtonStyle", "contentStyle", "isTel", "iframe"]);
10
+ var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick, submitButtonStyle, contentStyle, isTel } = _a, props = tslib_1.__rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick", "submitButtonStyle", "contentStyle", "isTel"]);
11
11
  const { popupDetailData } = (0, hooks_1.useSxpDataSource)();
12
- const { src, allow } = iframe || {};
13
- 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);
14
- return (react_1.default.createElement("div", Object.assign({ className: `${(0, css_1.css)(Object.assign(Object.assign({}, style), { overflow: 'hidden' }))}` }, props),
15
- react_1.default.createElement("iframe", { src: iframeUrl, allow: allow, scrolling: 'no', style: {
12
+ const iframeUrl = (_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;
13
+ return (react_1.default.createElement("div", Object.assign({ className: `${(0, css_1.css)(Object.assign({}, style))}` }, props),
14
+ react_1.default.createElement("iframe", { src: iframeUrl, style: {
16
15
  width: '100%',
17
16
  height: 'calc(100% - 50px)',
18
17
  marginTop: '50px',
@@ -10,20 +10,5 @@ exports.default = [
10
10
  name: ['style', 'backgroundColor']
11
11
  }
12
12
  ]
13
- },
14
- {
15
- title: 'iframe',
16
- child: [
17
- {
18
- type: 'TextArea',
19
- label: 'url',
20
- name: ['props', 'iframe', 'src']
21
- },
22
- {
23
- type: 'TextArea',
24
- label: 'allow',
25
- name: ['props', 'iframe', 'allow']
26
- }
27
- ]
28
13
  }
29
14
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "14.0.4",
3
+ "version": "14.0.6",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",