@conecli/cone-render 0.8.31 → 0.8.32

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 +1 @@
1
- var splitOnFirst = function splitOnFirst(string, separator) {
2
1
  return Object.prototype.toString.call(obj);
3
2
  return typeof obj === 'function';
4
3
  return '[object Object]' === getType(obj);
5
4
  return '[object Array]' == getType(obj);
6
5
  return '[object Undefined]' === getType(obj);
7
6
  return '[object Null]' == getType(obj);
8
7
  return typeof obj === 'string';
9
8
  return typeof obj === 'boolean';
10
9
  return '[object Number]' === getType(num);
11
10
  ua = ua || navigator.userAgent;
12
11
  if (name === 'wx') return (/micromessenger/i.test(ua)
13
12
  );
14
13
  if (name === 'qq') return (/qq\//i.test(ua)
15
14
  );
16
15
  if (name === 'weibo') return (/weibo/i.test(ua)
17
16
  );
18
17
  if (name === 'jd') return (/^jdapp/i.test(ua)
19
18
  );
20
19
  if (name === 'jdlittle') return (/^jdltapp/i.test(ua)
21
20
  );
22
21
  if (name === 'mp') return navigator.userAgent.match(/micromessenger/i) && navigator.userAgent.match(/miniprogram/i) || window.__wxjs_environment === 'miniprogram';
23
22
  if (name === 'jdb') return (/JDBmall/i.test(ua) && window.location.href.includes('shop.m.conecli.com/shop/bhome'));
24
23
  return false;
25
24
  ua = ua || navigator.userAgent;
26
25
  return (/android/i.test(ua) && !isIOS()
27
26
  );
28
27
  ua = ua || navigator.userAgent;
29
28
  return (/ip(hone|od)|ipad/i.test(ua)
30
29
  );
31
30
  ua = ua || navigator.userAgent;
32
31
  return (/ipad/i.test(ua) || /android/i.test(ua) && !/mobi|mini|fennec/i.test(ua)
33
32
  );
34
33
  ua = ua || navigator.userAgent;
35
34
  return !!ua.match(/ip(hone|od)|android.+mobile|windows (ce|phone)|blackberry|bb10|symbian|webos|firefox.+fennec|opera m(ob|in)i|polaris|iemobile|lgtelecom|nokia|sonyericsson|dolfin|uzard|natebrowser|ktf;|skt;/i);
36
35
  ua = ua || navigator.userAgent;
37
36
  return !!ua.match(/iphone/i);
38
37
  ua = ua || navigator.userAgent;
39
38
  return !!ua.match(/ipad/i);
40
39
  ua = ua || navigator.userAgent;
41
40
  if (name === 'xview') return typeof window.XView !== 'undefined';
42
41
  if (name === 'wk') return !!ua.match(/supportjdshwk/i) || window._is_jdsh_wkwebview == 1;
43
42
  return false;
44
43
  ua = ua || navigator.userAgent;
45
44
  var re = /nettype\/([\S]*)/i;
46
45
  if (isApp('jd', ua)) re = /network\/([^;]*)/i;
47
46
  return re.test(ua) ? RegExp.$1.toLowerCase() : 'unknown';
48
47
  ua = ua || navigator.userAgent;
49
48
  if (!isApp('jd', ua)) return null;
50
49
  return ua.split(';')[4];
51
50
  ua = ua || navigator.userAgent;
52
51
  if (appName === 'jd') return ua.split(';')[2] || null;
53
52
  if (appName === 'wx') return (/micromessenger\/([\S]*)/i.test(ua) ? RegExp.$1 : null
54
53
  );
55
54
  if (appName === 'qq') return (/qq\/([\S]*)/i.test(ua) ? RegExp.$1 : null
56
55
  );
57
56
  return null;
58
57
  ua = ua || navigator.userAgent;
59
58
  var match = ua.match(/android\s([0-9\.]*)/i);
60
59
  return match ? match[1] : 'unknown';
61
60
  ua = ua || navigator.userAgent;
62
61
  var match = ua.match(/OS ((\d+_?){2,3})\s/i);
63
62
  return match ? match[1].replace(/_/g, '.') : 'unknown';
63
+ var splitOnFirst = function splitOnFirst(string, separator) {
64
64
  return Object.prototype.toString.call(obj);
65
65
  return typeof obj === 'function';
66
66
  return '[object Object]' === getType(obj);
67
67
  return '[object Array]' == getType(obj);
68
68
  return '[object Undefined]' === getType(obj);
69
69
  return '[object Null]' == getType(obj);
70
70
  return typeof obj === 'string';
71
71
  return typeof obj === 'boolean';
72
72
  return '[object Number]' === getType(num);
73
73
  ua = ua || navigator.userAgent;
74
74
  if (name === 'wx') return (/micromessenger/i.test(ua)
75
75
  );
76
76
  if (name === 'qq') return (/qq\//i.test(ua)
77
77
  );
78
78
  if (name === 'weibo') return (/weibo/i.test(ua)
79
79
  );
80
80
  if (name === 'jd') return (/^jdapp/i.test(ua)
81
81
  );
82
82
  if (name === 'jdlittle') return (/^jdltapp/i.test(ua)
83
83
  );
84
84
  if (name === 'mp') return navigator.userAgent.match(/micromessenger/i) && navigator.userAgent.match(/miniprogram/i) || window.__wxjs_environment === 'miniprogram';
85
85
  if (name === 'jdb') return (/JDBmall/i.test(ua) && /shop\.m\.jd\.com\/shop\/bhome/i.test(window.location.href));
86
86
  return false;
87
87
  ua = ua || navigator.userAgent;
88
88
  return (/android/i.test(ua) && !isIOS()
89
89
  );
90
90
  ua = ua || navigator.userAgent;
91
91
  return (/ip(hone|od)|ipad/i.test(ua)
92
92
  );
93
93
  ua = ua || navigator.userAgent;
94
94
  return (/ipad/i.test(ua) || /android/i.test(ua) && !/mobi|mini|fennec/i.test(ua)
95
95
  );
96
96
  ua = ua || navigator.userAgent;
97
97
  return !!ua.match(/ip(hone|od)|android.+mobile|windows (ce|phone)|blackberry|bb10|symbian|webos|firefox.+fennec|opera m(ob|in)i|polaris|iemobile|lgtelecom|nokia|sonyericsson|dolfin|uzard|natebrowser|ktf;|skt;/i);
98
98
  ua = ua || navigator.userAgent;
99
99
  return !!ua.match(/iphone/i);
100
100
  ua = ua || navigator.userAgent;
101
101
  return !!ua.match(/ipad/i);
102
102
  ua = ua || navigator.userAgent;
103
103
  if (name === 'xview') return typeof window.XView !== 'undefined';
104
104
  if (name === 'wk') return !!ua.match(/supportjdshwk/i) || window._is_jdsh_wkwebview == 1;
105
105
  return false;
106
106
  ua = ua || navigator.userAgent;
107
107
  var re = /nettype\/([\S]*)/i;
108
108
  if (isApp('jd', ua)) re = /network\/([^;]*)/i;
109
109
  return re.test(ua) ? RegExp.$1.toLowerCase() : 'unknown';
110
110
  ua = ua || navigator.userAgent;
111
111
  if (!isApp('jd', ua)) return null;
112
112
  return ua.split(';')[4];
113
113
  ua = ua || navigator.userAgent;
114
114
  if (appName === 'jd') return ua.split(';')[2] || null;
115
115
  if (appName === 'wx') return (/micromessenger\/([\S]*)/i.test(ua) ? RegExp.$1 : null
116
116
  );
117
117
  if (appName === 'qq') return (/qq\/([\S]*)/i.test(ua) ? RegExp.$1 : null
118
118
  );
119
119
  return null;
120
120
  ua = ua || navigator.userAgent;
121
121
  var match = ua.match(/android\s([0-9\.]*)/i);
122
122
  return match ? match[1] : 'unknown';
123
123
  ua = ua || navigator.userAgent;
124
124
  var match = ua.match(/OS ((\d+_?){2,3})\s/i);
125
125
  return match ? match[1].replace(/_/g, '.') : 'unknown';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conecli/cone-render",
3
- "version": "0.8.31",
3
+ "version": "0.8.32",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist/"
@@ -1 +0,0 @@
1
- import { JumpEventReport, JumpEventReportPromise } from '../../jumpEventReport'
2
  jdJumpToShopHome: (info: object) => void
3
1
  jdJumpToProduct: (skuId: string | null, logEventInfo: object) => void
4
2
  jdJumpConfigUrl: (detail: object, logEventInfo: object) => void
5
3
  jdJumpToShopMemberInfo: (logEventInfo: object) => void
6
4
  jdJumpToShopMemberPointDetail: (logEventInfo: object) => void
7
5
  jdJumpToShopMemberBenefit: (logEventInfo: object) => void
8
6
  jdJumpToShopMemberRule: (logEventInfo: object) => void
9
7
  jdJumpToShopMemberCloseAccount: (
10
8
  venderType: number,
11
9
  logEventInfo: object,
12
10
  ) => void
13
11
  jdJumpToShopMemberPointExchange: (
14
12
  venderType: number,
15
13
  channel: number,
16
14
  levelZeroMenuUrl: string,
17
15
  logEventInfo: object,
18
16
  ) => void
19
17
  jdJumpToShopMemberBonusPurchase: (
20
18
  customerLevel: number,
21
19
  logEventInfo: object,
22
20
  ) => void
23
21
  jdJumpToShopMemberGood: (customerLevel: number, logEventInfo: object) => void
24
22
  jdJumpToBeanDetail: (logEventInfo: object) => void
25
23
  jdJumpToMyRedEnvelope: (logEventInfo: object) => void
26
24
  jdJumpToMyCoupon: (logEventInfo: object) => void
27
25
  jdJumpToTabAllProduct: (shopId: string | number,venderId: string | number,logEventInfo: object) => void
28
26
  jdJumpToTabAllProductInner: (shopId: string | number,venderId: string | number,logEventInfo: object) => void
29
27
  jdJumpToShopHome: () => {},
30
28
  jdJumpToProduct: () => {},
31
29
  jdJumpConfigUrl: () => {},
32
30
  jdJumpToShopMemberInfo: () => {},
33
31
  jdJumpToShopMemberPointDetail: () => {},
34
32
  jdJumpToShopMemberBenefit: () => {},
35
33
  jdJumpToShopMemberRule: () => {},
36
34
  jdJumpToShopMemberCloseAccount: () => {},
37
35
  jdJumpToShopMemberPointExchange: () => {},
38
36
  jdJumpToShopMemberBonusPurchase: () => {},
39
37
  jdJumpToShopMemberGood: () => {},
40
38
  jdJumpToBeanDetail: () => {},
41
39
  jdJumpToMyRedEnvelope: () => {},
42
40
  jdJumpToMyCoupon: () => {},
43
41
  jdJumpToTabAllProductInner: () => {},
44
42
  jdJumpToWeb: (url: string, logEventInfo: object) => void
45
43
  jdJumpToAppMiniProgram: (path: string, logEventInfo: object) => void
46
44
  jdJumpToShopLight: (detail: object) => void
47
45
  jdJumpToAppMiniProgram: () => {},
48
46
  jdJumpToShopLight: () => {},
49
47
  jdJumpToWeb: () => {},
50
48
  [key: string]: any
51
49
  [key: string]: any
52
50
  const {
53
51
  jdJumpToShopHome,
54
52
  jdJumpToProduct,
55
53
  jdJumpConfigUrl,
56
54
  jdJumpToShopMemberInfo,
57
55
  jdJumpToShopMemberPointDetail,
58
56
  jdJumpToShopMemberBenefit,
59
57
  jdJumpToShopMemberRule,
60
58
  jdJumpToShopMemberCloseAccount,
61
59
  jdJumpToShopMemberPointExchange,
62
60
  jdJumpToShopMemberBonusPurchase,
63
61
  jdJumpToShopMemberGood,
64
62
  jdJumpToBeanDetail,
65
63
  jdJumpToMyRedEnvelope,
66
64
  jdJumpToMyCoupon,
67
65
  jdJumpToTabAllProduct,
68
66
  jdJumpToTabAllProductInner,
69
67
  } = JumpEventReport
70
68
  const {
71
69
  jdJumpToAppMiniProgram,
72
70
  jdJumpToShopLight,
73
71
  jdJumpToWeb,
74
72
  jumpWebUrl,
75
73
  jumpMiniPath,
76
74
  } = JumpEventReport
77
75
  Object.assign(business, {
78
76
  jdJumpToShopHome: jdJumpToShopHome.bind(JumpEventReport),
79
77
  jdJumpToProduct: jdJumpToProduct.bind(JumpEventReport),
80
78
  jdJumpConfigUrl: jdJumpConfigUrl.bind(JumpEventReport),
81
79
  jdJumpToShopMemberInfo: jdJumpToShopMemberInfo.bind(JumpEventReport),
82
80
  jdJumpToShopMemberPointDetail:
83
81
  jdJumpToShopMemberPointDetail.bind(JumpEventReport),
84
82
  jdJumpToShopMemberBenefit: jdJumpToShopMemberBenefit.bind(JumpEventReport),
85
83
  jdJumpToShopMemberRule: jdJumpToShopMemberRule.bind(JumpEventReport),
86
84
  jdJumpToShopMemberCloseAccount:
87
85
  jdJumpToShopMemberCloseAccount.bind(JumpEventReport),
88
86
  jdJumpToShopMemberPointExchange:
89
87
  jdJumpToShopMemberPointExchange.bind(JumpEventReport),
90
88
  jdJumpToShopMemberBonusPurchase:
91
89
  jdJumpToShopMemberBonusPurchase.bind(JumpEventReport),
92
90
  jdJumpToShopMemberGood: jdJumpToShopMemberGood.bind(JumpEventReport),
93
91
  jdJumpToBeanDetail: jdJumpToBeanDetail.bind(JumpEventReport),
94
92
  jdJumpToMyRedEnvelope: jdJumpToMyRedEnvelope.bind(JumpEventReport),
95
93
  jdJumpToMyCoupon: jdJumpToMyCoupon.bind(JumpEventReport),
96
94
  jdJumpToTabAllProduct: jdJumpToTabAllProduct.bind(JumpEventReport),
97
95
  jdJumpToTabAllProductInner: jdJumpToTabAllProductInner.bind(JumpEventReport),
98
96
  })
99
97
  Object.assign(side, {
100
98
  jdJumpToAppMiniProgram: jdJumpToAppMiniProgram.bind(JumpEventReport),
101
99
  jdJumpToShopLight: jdJumpToShopLight.bind(JumpEventReport),
102
100
  jdJumpToWeb: jdJumpToWeb.bind(JumpEventReport),
103
101
  jumpWebUrl,
104
102
  jumpMiniPath,
105
103
  })
106
104
  Object.assign(webUrl, jumpWebUrl)
107
105
  Object.assign(minPath, jumpMiniPath)