@fonixtree/magic-design 1.0.70 → 1.0.71

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.
@@ -286,22 +286,6 @@ var getCoupon = function getCoupon(couponId) {
286
286
  });
287
287
  };
288
288
 
289
- function isUrl(string) {
290
- // var pattern = new RegExp('^(https?:\\/\\/)?' + // 协议
291
- // '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // 域名
292
- // '((\\d{1,3}\\.){3}\\d{1,3}))' + // 或者 IP (v4) 地址
293
- // '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // 端口和路径
294
- // '(\\?[;&a-z\\d%_.~+=-]*)?' + // 查询字符串
295
- // '(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
296
- // return !!pattern.test(string);
297
- try {
298
- new URL(string);
299
- return true;
300
- } catch (_) {
301
- return false;
302
- }
303
- }
304
-
305
289
  var clickUrl = function clickUrl(url) {
306
290
  if (url === void 0) {
307
291
  url = '';
@@ -326,17 +310,6 @@ var clickUrl = function clickUrl(url) {
326
310
  url: params.link
327
311
  }
328
312
  });
329
- /** 锚点跳转 */
330
-
331
- if (params.type === 'ANCHOR') {
332
- (0, _commonUtil.ensure)(function () {
333
- var nodeId = isPc() ? params.data.pcNodeId : params.data.mobileNodeId;
334
- document.querySelector("#node-" + nodeId).scrollIntoView({
335
- behavior: 'smooth'
336
- });
337
- });
338
- return;
339
- }
340
313
 
341
314
  if ((0, _androidUtil.browserVersion)().isAshitaApp) {
342
315
  (0, _androidUtil.sendToApp)(data);
@@ -369,25 +342,9 @@ var clickUrl = function clickUrl(url) {
369
342
  }
370
343
 
371
344
  return;
372
- } // 输入的是完整的跳转地址
373
-
374
-
375
- if (isUrl(link)) {
376
- if (!link.includes(window.location.host)) {
377
- // 跳转外链 需要把userToken带上
378
- if (link.includes('?')) {
379
- var a = link + "&userToken=" + (localStorage.getItem('h5Token') || '');
380
- window.open(a);
381
- } else {
382
- var a = link + "?userToken=" + (localStorage.getItem('h5Token') || '');
383
- window.open(a);
384
- }
385
- } else {
386
- window.open(link);
387
- }
388
- } else {
389
- (0, _commonUtil.navigateTo)(link);
390
345
  }
346
+
347
+ (0, _commonUtil.navigateTo)(link);
391
348
  }
392
349
  };
393
350
 
@@ -286,22 +286,6 @@ var getCoupon = function getCoupon(couponId) {
286
286
  });
287
287
  };
288
288
 
289
- function isUrl(string) {
290
- // var pattern = new RegExp('^(https?:\\/\\/)?' + // 协议
291
- // '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // 域名
292
- // '((\\d{1,3}\\.){3}\\d{1,3}))' + // 或者 IP (v4) 地址
293
- // '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // 端口和路径
294
- // '(\\?[;&a-z\\d%_.~+=-]*)?' + // 查询字符串
295
- // '(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
296
- // return !!pattern.test(string);
297
- try {
298
- new URL(string);
299
- return true;
300
- } catch (_) {
301
- return false;
302
- }
303
- }
304
-
305
289
  var clickUrl = function clickUrl(url) {
306
290
  if (url === void 0) {
307
291
  url = '';
@@ -326,17 +310,6 @@ var clickUrl = function clickUrl(url) {
326
310
  url: params.link
327
311
  }
328
312
  });
329
- /** 锚点跳转 */
330
-
331
- if (params.type === 'ANCHOR') {
332
- (0, _commonUtil.ensure)(function () {
333
- var nodeId = isPc() ? params.data.pcNodeId : params.data.mobileNodeId;
334
- document.querySelector("#node-" + nodeId).scrollIntoView({
335
- behavior: 'smooth'
336
- });
337
- });
338
- return;
339
- }
340
313
 
341
314
  if ((0, _androidUtil.browserVersion)().isAshitaApp) {
342
315
  (0, _androidUtil.sendToApp)(data);
@@ -369,25 +342,9 @@ var clickUrl = function clickUrl(url) {
369
342
  }
370
343
 
371
344
  return;
372
- } // 输入的是完整的跳转地址
373
-
374
-
375
- if (isUrl(link)) {
376
- if (!link.includes(window.location.host)) {
377
- // 跳转外链 需要把userToken带上
378
- if (link.includes('?')) {
379
- var a = link + "&userToken=" + (localStorage.getItem('h5Token') || '');
380
- window.open(a);
381
- } else {
382
- var a = link + "?userToken=" + (localStorage.getItem('h5Token') || '');
383
- window.open(a);
384
- }
385
- } else {
386
- window.open(link);
387
- }
388
- } else {
389
- (0, _commonUtil.navigateTo)(link);
390
345
  }
346
+
347
+ (0, _commonUtil.navigateTo)(link);
391
348
  }
392
349
  };
393
350
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "1.0.70",
4
+ "version": "1.0.71",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",