@tarojs/taro-h5 3.3.13 → 3.3.14
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.cjs.js +24 -18
- package/package.json +5 -5
- package/src/api/image/chooseImage.js +2 -2
- package/src/api/navigationBar/index.js +2 -2
- package/src/api/others/index.js +2 -2
- package/src/api/storage/index.js +4 -4
- package/src/api/tabBar/index.js +9 -9
- package/src/api/utils/index.js +2 -2
- package/src/api/video/index.js +2 -2
- package/src/api/webSocket/index.js +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -249,7 +249,8 @@ var ENV_TYPE = {
|
|
|
249
249
|
ALIPAY: 'ALIPAY',
|
|
250
250
|
TT: 'TT',
|
|
251
251
|
QQ: 'QQ',
|
|
252
|
-
JD: 'JD'
|
|
252
|
+
JD: 'JD',
|
|
253
|
+
KWAI: 'KWAI'
|
|
253
254
|
};
|
|
254
255
|
var _env = null; // 一个taro项目肯定运行同样的环境
|
|
255
256
|
|
|
@@ -286,6 +287,11 @@ function getEnv() {
|
|
|
286
287
|
return ENV_TYPE.ALIPAY;
|
|
287
288
|
}
|
|
288
289
|
|
|
290
|
+
if (typeof ks !== 'undefined' && ks.getSystemInfo) {
|
|
291
|
+
_env = ENV_TYPE.KWAI;
|
|
292
|
+
return ENV_TYPE.KWAI;
|
|
293
|
+
}
|
|
294
|
+
|
|
289
295
|
if (typeof global !== 'undefined' && global.__fbGenNativeModule) {
|
|
290
296
|
_env = ENV_TYPE.RN;
|
|
291
297
|
return ENV_TYPE.RN;
|
|
@@ -3036,7 +3042,7 @@ function createRouter(app, config, framework) {
|
|
|
3036
3042
|
return exports.history.listen(render);
|
|
3037
3043
|
}
|
|
3038
3044
|
|
|
3039
|
-
function
|
|
3045
|
+
function shouldBeObject(target) {
|
|
3040
3046
|
if (target && _typeof$1(target) === 'object') return {
|
|
3041
3047
|
res: true
|
|
3042
3048
|
};
|
|
@@ -4394,7 +4400,7 @@ var createCanvasContext = function createCanvasContext(canvasId, inst) {
|
|
|
4394
4400
|
|
|
4395
4401
|
function setStorage(options) {
|
|
4396
4402
|
// options must be an Object
|
|
4397
|
-
var isObject =
|
|
4403
|
+
var isObject = shouldBeObject(options);
|
|
4398
4404
|
|
|
4399
4405
|
if (!isObject.res) {
|
|
4400
4406
|
var _res = {
|
|
@@ -4463,7 +4469,7 @@ function setStorageSync(key) {
|
|
|
4463
4469
|
|
|
4464
4470
|
function getStorage(options) {
|
|
4465
4471
|
// options must be an Object
|
|
4466
|
-
var isObject =
|
|
4472
|
+
var isObject = shouldBeObject(options);
|
|
4467
4473
|
|
|
4468
4474
|
if (!isObject.res) {
|
|
4469
4475
|
var _res2 = {
|
|
@@ -4571,7 +4577,7 @@ function getStorageInfoSync() {
|
|
|
4571
4577
|
|
|
4572
4578
|
function removeStorage(options) {
|
|
4573
4579
|
// options must be an Object
|
|
4574
|
-
var isObject =
|
|
4580
|
+
var isObject = shouldBeObject(options);
|
|
4575
4581
|
|
|
4576
4582
|
if (!isObject.res) {
|
|
4577
4583
|
var _res3 = {
|
|
@@ -6138,7 +6144,7 @@ var uploadFile = function uploadFile(_ref2) {
|
|
|
6138
6144
|
|
|
6139
6145
|
var chooseImage = function chooseImage(options) {
|
|
6140
6146
|
// options must be an Object
|
|
6141
|
-
var isObject =
|
|
6147
|
+
var isObject = shouldBeObject(options);
|
|
6142
6148
|
|
|
6143
6149
|
if (!isObject.res) {
|
|
6144
6150
|
var _res = {
|
|
@@ -7580,7 +7586,7 @@ var openLocation = processOpenapi('openLocation', {
|
|
|
7580
7586
|
|
|
7581
7587
|
function setNavigationBarTitle(options) {
|
|
7582
7588
|
// options must be an Object
|
|
7583
|
-
var isObject =
|
|
7589
|
+
var isObject = shouldBeObject(options);
|
|
7584
7590
|
|
|
7585
7591
|
if (!isObject.res) {
|
|
7586
7592
|
var _res = {
|
|
@@ -7764,7 +7770,7 @@ function base64ToArrayBuffer(base64) {
|
|
|
7764
7770
|
}
|
|
7765
7771
|
function makePhoneCall(options) {
|
|
7766
7772
|
// options must be an Object
|
|
7767
|
-
var isObject =
|
|
7773
|
+
var isObject = shouldBeObject(options);
|
|
7768
7774
|
|
|
7769
7775
|
if (!isObject.res) {
|
|
7770
7776
|
var _res = {
|
|
@@ -10357,7 +10363,7 @@ function initTabBarApis() {
|
|
|
10357
10363
|
function setTabBarBadge() {
|
|
10358
10364
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10359
10365
|
// options must be an Object
|
|
10360
|
-
var isObject =
|
|
10366
|
+
var isObject = shouldBeObject(options);
|
|
10361
10367
|
|
|
10362
10368
|
if (!isObject.res) {
|
|
10363
10369
|
var _res = {
|
|
@@ -10418,7 +10424,7 @@ function setTabBarBadge() {
|
|
|
10418
10424
|
function removeTabBarBadge() {
|
|
10419
10425
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10420
10426
|
// options must be an Object
|
|
10421
|
-
var isObject =
|
|
10427
|
+
var isObject = shouldBeObject(options);
|
|
10422
10428
|
|
|
10423
10429
|
if (!isObject.res) {
|
|
10424
10430
|
var _res2 = {
|
|
@@ -10466,7 +10472,7 @@ function removeTabBarBadge() {
|
|
|
10466
10472
|
function showTabBarRedDot() {
|
|
10467
10473
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10468
10474
|
// options must be an Object
|
|
10469
|
-
var isObject =
|
|
10475
|
+
var isObject = shouldBeObject(options);
|
|
10470
10476
|
|
|
10471
10477
|
if (!isObject.res) {
|
|
10472
10478
|
var _res3 = {
|
|
@@ -10514,7 +10520,7 @@ function showTabBarRedDot() {
|
|
|
10514
10520
|
function hideTabBarRedDot() {
|
|
10515
10521
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10516
10522
|
// options must be an Object
|
|
10517
|
-
var isObject =
|
|
10523
|
+
var isObject = shouldBeObject(options);
|
|
10518
10524
|
|
|
10519
10525
|
if (!isObject.res) {
|
|
10520
10526
|
var _res4 = {
|
|
@@ -10562,7 +10568,7 @@ function hideTabBarRedDot() {
|
|
|
10562
10568
|
function showTabBar() {
|
|
10563
10569
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10564
10570
|
// options must be an Object
|
|
10565
|
-
var isObject =
|
|
10571
|
+
var isObject = shouldBeObject(options);
|
|
10566
10572
|
|
|
10567
10573
|
if (!isObject.res) {
|
|
10568
10574
|
var _res5 = {
|
|
@@ -10610,7 +10616,7 @@ function showTabBar() {
|
|
|
10610
10616
|
function hideTabBar() {
|
|
10611
10617
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10612
10618
|
// options must be an Object
|
|
10613
|
-
var isObject =
|
|
10619
|
+
var isObject = shouldBeObject(options);
|
|
10614
10620
|
|
|
10615
10621
|
if (!isObject.res) {
|
|
10616
10622
|
var _res6 = {
|
|
@@ -10661,7 +10667,7 @@ function hideTabBar() {
|
|
|
10661
10667
|
function setTabBarStyle() {
|
|
10662
10668
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10663
10669
|
// options must be an Object
|
|
10664
|
-
var isObject =
|
|
10670
|
+
var isObject = shouldBeObject(options);
|
|
10665
10671
|
|
|
10666
10672
|
if (!isObject.res) {
|
|
10667
10673
|
var _res7 = {
|
|
@@ -10729,7 +10735,7 @@ function setTabBarStyle() {
|
|
|
10729
10735
|
function setTabBarItem() {
|
|
10730
10736
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10731
10737
|
// options must be an Object
|
|
10732
|
-
var isObject =
|
|
10738
|
+
var isObject = shouldBeObject(options);
|
|
10733
10739
|
|
|
10734
10740
|
if (!isObject.res) {
|
|
10735
10741
|
var _res8 = {
|
|
@@ -10855,7 +10861,7 @@ var vibrateLong = function vibrateLong() {
|
|
|
10855
10861
|
|
|
10856
10862
|
function chooseVideo(options) {
|
|
10857
10863
|
// options must be an Object
|
|
10858
|
-
var isObject =
|
|
10864
|
+
var isObject = shouldBeObject(options);
|
|
10859
10865
|
|
|
10860
10866
|
if (!isObject.res) {
|
|
10861
10867
|
var _res = {
|
|
@@ -11054,7 +11060,7 @@ function connectSocket(options) {
|
|
|
11054
11060
|
var name = 'connectSocket';
|
|
11055
11061
|
return new Promise(function (resolve, reject) {
|
|
11056
11062
|
// options must be an Object
|
|
11057
|
-
var isObject =
|
|
11063
|
+
var isObject = shouldBeObject(options);
|
|
11058
11064
|
|
|
11059
11065
|
if (!isObject.res) {
|
|
11060
11066
|
var _res = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/taro-h5",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.14",
|
|
4
4
|
"description": "Taro h5 framework",
|
|
5
5
|
"main:h5": "src/index.js",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"author": "O2Team",
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@tarojs/api": "3.3.
|
|
37
|
-
"@tarojs/router": "3.3.
|
|
38
|
-
"@tarojs/runtime": "3.3.
|
|
36
|
+
"@tarojs/api": "3.3.14",
|
|
37
|
+
"@tarojs/router": "3.3.14",
|
|
38
|
+
"@tarojs/runtime": "3.3.14",
|
|
39
39
|
"base64-js": "^1.3.0",
|
|
40
40
|
"jsonp-retry": "^1.0.3",
|
|
41
41
|
"mobile-detect": "^1.4.2",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"jest-fetch-mock": "^3.0.3"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "ffd2b33c2a760094372a9ec69735ab9c4d1877e5"
|
|
49
49
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { shouldBeObject, getParameterError } from '../utils'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* 从本地相册选择图片或使用相机拍照。
|
|
@@ -13,7 +13,7 @@ import { shouleBeObject, getParameterError } from '../utils'
|
|
|
13
13
|
*/
|
|
14
14
|
const chooseImage = function (options) {
|
|
15
15
|
// options must be an Object
|
|
16
|
-
const isObject =
|
|
16
|
+
const isObject = shouldBeObject(options)
|
|
17
17
|
if (!isObject.res) {
|
|
18
18
|
const res = { errMsg: `chooseImage${isObject.msg}` }
|
|
19
19
|
console.error(res.errMsg)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { shouldBeObject, getParameterError } from '../utils'
|
|
2
2
|
|
|
3
3
|
export function setNavigationBarTitle (options) {
|
|
4
4
|
// options must be an Object
|
|
5
|
-
const isObject =
|
|
5
|
+
const isObject = shouldBeObject(options)
|
|
6
6
|
if (!isObject.res) {
|
|
7
7
|
const res = { errMsg: `setNavigationBarTitle${isObject.msg}` }
|
|
8
8
|
console.error(res.errMsg)
|
package/src/api/others/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fromByteArray, toByteArray } from 'base64-js'
|
|
2
|
-
import {
|
|
2
|
+
import { shouldBeObject, getParameterError } from '../utils'
|
|
3
3
|
|
|
4
4
|
export function arrayBufferToBase64 (arrayBuffer) {
|
|
5
5
|
return fromByteArray(arrayBuffer)
|
|
@@ -11,7 +11,7 @@ export function base64ToArrayBuffer (base64) {
|
|
|
11
11
|
|
|
12
12
|
export function makePhoneCall (options) {
|
|
13
13
|
// options must be an Object
|
|
14
|
-
const isObject =
|
|
14
|
+
const isObject = shouldBeObject(options)
|
|
15
15
|
if (!isObject.res) {
|
|
16
16
|
const res = { errMsg: `makePhoneCall${isObject.msg}` }
|
|
17
17
|
console.error(res.errMsg)
|
package/src/api/storage/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { shouldBeObject, getParameterError } from '../utils'
|
|
2
2
|
|
|
3
3
|
function setStorage (options) {
|
|
4
4
|
// options must be an Object
|
|
5
|
-
const isObject =
|
|
5
|
+
const isObject = shouldBeObject(options)
|
|
6
6
|
if (!isObject.res) {
|
|
7
7
|
const res = { errMsg: `setStorage${isObject.msg}` }
|
|
8
8
|
console.error(res.errMsg)
|
|
@@ -56,7 +56,7 @@ function setStorageSync (key, data = '') {
|
|
|
56
56
|
|
|
57
57
|
function getStorage (options) {
|
|
58
58
|
// options must be an Object
|
|
59
|
-
const isObject =
|
|
59
|
+
const isObject = shouldBeObject(options)
|
|
60
60
|
if (!isObject.res) {
|
|
61
61
|
const res = { errMsg: `getStorage${isObject.msg}` }
|
|
62
62
|
console.error(res.errMsg)
|
|
@@ -149,7 +149,7 @@ function getStorageInfoSync () {
|
|
|
149
149
|
|
|
150
150
|
function removeStorage (options) {
|
|
151
151
|
// options must be an Object
|
|
152
|
-
const isObject =
|
|
152
|
+
const isObject = shouldBeObject(options)
|
|
153
153
|
if (!isObject.res) {
|
|
154
154
|
const res = { errMsg: `removeStorage${isObject.msg}` }
|
|
155
155
|
console.error(res.errMsg)
|
package/src/api/tabBar/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Taro from '@tarojs/api'
|
|
2
|
-
import {
|
|
2
|
+
import { shouldBeObject, getParameterError, isValidColor, successHandler, errorHandler } from '../utils'
|
|
3
3
|
|
|
4
4
|
let tabConf
|
|
5
5
|
let App
|
|
@@ -20,7 +20,7 @@ export function initTabBarApis (_App = {}) {
|
|
|
20
20
|
*/
|
|
21
21
|
export function setTabBarBadge (options = {}) {
|
|
22
22
|
// options must be an Object
|
|
23
|
-
const isObject =
|
|
23
|
+
const isObject = shouldBeObject(options)
|
|
24
24
|
if (!isObject.res) {
|
|
25
25
|
const res = { errMsg: `setTabBarBadge${isObject.msg}` }
|
|
26
26
|
console.error(res.errMsg)
|
|
@@ -78,7 +78,7 @@ export function setTabBarBadge (options = {}) {
|
|
|
78
78
|
*/
|
|
79
79
|
export function removeTabBarBadge (options = {}) {
|
|
80
80
|
// options must be an Object
|
|
81
|
-
const isObject =
|
|
81
|
+
const isObject = shouldBeObject(options)
|
|
82
82
|
if (!isObject.res) {
|
|
83
83
|
const res = { errMsg: `removeTabBarBadge${isObject.msg}` }
|
|
84
84
|
console.error(res.errMsg)
|
|
@@ -123,7 +123,7 @@ export function removeTabBarBadge (options = {}) {
|
|
|
123
123
|
*/
|
|
124
124
|
export function showTabBarRedDot (options = {}) {
|
|
125
125
|
// options must be an Object
|
|
126
|
-
const isObject =
|
|
126
|
+
const isObject = shouldBeObject(options)
|
|
127
127
|
if (!isObject.res) {
|
|
128
128
|
const res = { errMsg: `showTabBarRedDot${isObject.msg}` }
|
|
129
129
|
console.error(res.errMsg)
|
|
@@ -168,7 +168,7 @@ export function showTabBarRedDot (options = {}) {
|
|
|
168
168
|
*/
|
|
169
169
|
export function hideTabBarRedDot (options = {}) {
|
|
170
170
|
// options must be an Object
|
|
171
|
-
const isObject =
|
|
171
|
+
const isObject = shouldBeObject(options)
|
|
172
172
|
if (!isObject.res) {
|
|
173
173
|
const res = { errMsg: `hideTabBarRedDot${isObject.msg}` }
|
|
174
174
|
console.error(res.errMsg)
|
|
@@ -213,7 +213,7 @@ export function hideTabBarRedDot (options = {}) {
|
|
|
213
213
|
*/
|
|
214
214
|
export function showTabBar (options = {}) {
|
|
215
215
|
// options must be an Object
|
|
216
|
-
const isObject =
|
|
216
|
+
const isObject = shouldBeObject(options)
|
|
217
217
|
if (!isObject.res) {
|
|
218
218
|
const res = { errMsg: `showTabBar${isObject.msg}` }
|
|
219
219
|
console.error(res.errMsg)
|
|
@@ -259,7 +259,7 @@ export function showTabBar (options = {}) {
|
|
|
259
259
|
*/
|
|
260
260
|
export function hideTabBar (options = {}) {
|
|
261
261
|
// options must be an Object
|
|
262
|
-
const isObject =
|
|
262
|
+
const isObject = shouldBeObject(options)
|
|
263
263
|
if (!isObject.res) {
|
|
264
264
|
const res = { errMsg: `hideTabBar${isObject.msg}` }
|
|
265
265
|
console.error(res.errMsg)
|
|
@@ -308,7 +308,7 @@ export function hideTabBar (options = {}) {
|
|
|
308
308
|
*/
|
|
309
309
|
export function setTabBarStyle (options = {}) {
|
|
310
310
|
// options must be an Object
|
|
311
|
-
const isObject =
|
|
311
|
+
const isObject = shouldBeObject(options)
|
|
312
312
|
if (!isObject.res) {
|
|
313
313
|
const res = { errMsg: `setTabBarStyle${isObject.msg}` }
|
|
314
314
|
console.error(res.errMsg)
|
|
@@ -372,7 +372,7 @@ export function setTabBarStyle (options = {}) {
|
|
|
372
372
|
*/
|
|
373
373
|
export function setTabBarItem (options = {}) {
|
|
374
374
|
// options must be an Object
|
|
375
|
-
const isObject =
|
|
375
|
+
const isObject = shouldBeObject(options)
|
|
376
376
|
if (!isObject.res) {
|
|
377
377
|
const res = { errMsg: `setTabBarItem${isObject.msg}` }
|
|
378
378
|
console.error(res.errMsg)
|
package/src/api/utils/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable prefer-promise-reject-errors */
|
|
2
2
|
import { Current, container, SERVICE_IDENTIFIER } from '@tarojs/runtime'
|
|
3
3
|
|
|
4
|
-
function
|
|
4
|
+
function shouldBeObject (target) {
|
|
5
5
|
if (target && typeof target === 'object') return { res: true }
|
|
6
6
|
return {
|
|
7
7
|
res: false,
|
|
@@ -229,7 +229,7 @@ const getTimingFunc = (easeFunc, frameCnt) => {
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
export {
|
|
232
|
-
|
|
232
|
+
shouldBeObject,
|
|
233
233
|
getParameterError,
|
|
234
234
|
inlineStyle,
|
|
235
235
|
setTransform,
|
package/src/api/video/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { shouldBeObject, getParameterError, findDOM } from '../utils'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @typedef {Object} ChooseVideoParam
|
|
@@ -18,7 +18,7 @@ import { shouleBeObject, getParameterError, findDOM } from '../utils'
|
|
|
18
18
|
export function chooseVideo (options) {
|
|
19
19
|
// options must be an Object
|
|
20
20
|
|
|
21
|
-
const isObject =
|
|
21
|
+
const isObject = shouldBeObject(options)
|
|
22
22
|
if (!isObject.res) {
|
|
23
23
|
const res = { errMsg: `chooseVideo${isObject.msg}` }
|
|
24
24
|
console.error(res.errMsg)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import SocketTask from './socketTask'
|
|
2
|
-
import {
|
|
2
|
+
import { shouldBeObject, getParameterError } from '../utils'
|
|
3
3
|
|
|
4
4
|
let socketTasks = []
|
|
5
5
|
let socketsCounter = 1
|
|
@@ -9,7 +9,7 @@ function connectSocket (options) {
|
|
|
9
9
|
|
|
10
10
|
return new Promise((resolve, reject) => {
|
|
11
11
|
// options must be an Object
|
|
12
|
-
const isObject =
|
|
12
|
+
const isObject = shouldBeObject(options)
|
|
13
13
|
if (!isObject.res) {
|
|
14
14
|
const res = { errMsg: `${name}${isObject.msg}` }
|
|
15
15
|
console.error(res.errMsg)
|