@tarojs/taro-h5 3.5.0-alpha.9 → 3.5.0-beta.2
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/api/base/index.js +4 -4
- package/dist/api/canvas/canvasGetImageData.js +1 -1
- package/dist/api/canvas/canvasPutImageData.js +1 -1
- package/dist/api/device/clipboard.js +1 -1
- package/dist/api/device/compass.js +1 -1
- package/dist/api/device/network.js +1 -1
- package/dist/api/device/phone.js +1 -1
- package/dist/api/index.js +2 -2
- package/dist/api/location/chooseLocation.js +1 -1
- package/dist/api/media/image/chooseImage.js +1 -1
- package/dist/api/media/image/index.js +1 -1
- package/dist/api/media/video/index.js +1 -1
- package/dist/api/network/download.js +1 -0
- package/dist/api/network/request/index.js +1 -1
- package/dist/api/network/upload.js +2 -1
- package/dist/api/network/utils.js +1 -0
- package/dist/api/network/websocket/index.js +2 -2
- package/dist/api/route/index.js +1 -1
- package/dist/api/storage/index.js +1 -1
- package/dist/api/taro.js +2 -2
- package/dist/api/ui/index.js +1 -1
- package/dist/api/ui/interaction/index.js +3 -3
- package/dist/api/ui/navigation-bar/index.js +1 -1
- package/dist/api/ui/scroll/index.js +1 -1
- package/dist/api/ui/tab-bar.js +1 -1
- package/dist/api/wxml/selectorQuery.js +1 -1
- package/dist/index.cjs.js +1095 -1096
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1096 -1097
- package/dist/index.esm.js.map +1 -1
- package/dist/utils/index.js +3 -7
- package/package.json +5 -5
- package/src/api/base/index.ts +4 -4
- package/src/api/canvas/canvasGetImageData.ts +2 -1
- package/src/api/canvas/canvasPutImageData.ts +2 -1
- package/src/api/canvas/canvasToTempFilePath.ts +1 -0
- package/src/api/canvas/createCanvasContext.ts +1 -0
- package/src/api/cloud/index.ts +1 -0
- package/src/api/device/accelerometer.ts +1 -0
- package/src/api/device/battery.ts +1 -0
- package/src/api/device/clipboard.ts +2 -1
- package/src/api/device/compass.ts +1 -1
- package/src/api/device/network.ts +1 -1
- package/src/api/device/phone.ts +2 -1
- package/src/api/device/vibrate.ts +1 -0
- package/src/api/index.ts +2 -3
- package/src/api/location/chooseLocation.ts +2 -1
- package/src/api/location/getLocation.ts +1 -0
- package/src/api/media/EditorContext.ts +1 -0
- package/src/api/media/audio/InnerAudioContext.ts +1 -0
- package/src/api/media/audio/index.ts +1 -0
- package/src/api/media/background-audio/BackgroundAudioManager.ts +1 -0
- package/src/api/media/image/chooseImage.ts +1 -1
- package/src/api/media/image/index.ts +1 -1
- package/src/api/media/video/index.ts +1 -1
- package/src/api/network/download.ts +2 -0
- package/src/api/network/request/index.ts +2 -1
- package/src/api/network/upload.ts +3 -1
- package/src/api/network/utils.ts +1 -0
- package/src/api/network/websocket/index.ts +2 -2
- package/src/api/route/index.ts +4 -4
- package/src/api/storage/index.ts +2 -1
- package/src/api/taro.ts +10 -10
- package/src/api/ui/fonts.ts +1 -0
- package/src/api/ui/index.ts +1 -1
- package/src/api/ui/interaction/index.ts +4 -3
- package/src/api/ui/navigation-bar/index.ts +1 -1
- package/src/api/ui/pull-down-refresh.ts +1 -0
- package/src/api/ui/scroll/index.ts +1 -1
- package/src/api/ui/tab-bar.ts +2 -1
- package/src/api/ui/window.ts +1 -0
- package/src/api/wxml/index.ts +1 -0
- package/src/api/wxml/selectorQuery.ts +2 -1
- package/src/utils/index.ts +3 -8
package/dist/utils/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable prefer-promise-reject-errors */
|
|
2
|
-
import { Current,
|
|
2
|
+
import { Current, hooks } from '@tarojs/runtime';
|
|
3
3
|
export function shouldBeObject(target) {
|
|
4
4
|
if (target && typeof target === 'object')
|
|
5
5
|
return { flag: true };
|
|
@@ -12,12 +12,8 @@ export function shouldBeObject(target) {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
export function findDOM(inst) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const find = runtimeHooks.getDOMNode;
|
|
18
|
-
if (typeof find === 'function') {
|
|
19
|
-
return find(inst);
|
|
20
|
-
}
|
|
15
|
+
if (inst && hooks.isExist('getDOMNode')) {
|
|
16
|
+
return hooks.call('getDOMNode', inst);
|
|
21
17
|
}
|
|
22
18
|
const page = Current.page;
|
|
23
19
|
const path = page === null || page === void 0 ? void 0 : page.path;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/taro-h5",
|
|
3
|
-
"version": "3.5.0-
|
|
3
|
+
"version": "3.5.0-beta.2",
|
|
4
4
|
"description": "Taro h5 framework",
|
|
5
5
|
"browser": "dist/index.esm.js",
|
|
6
6
|
"main:h5": "dist/index.js",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"author": "O2Team",
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@tarojs/api": "3.5.0-
|
|
37
|
-
"@tarojs/router": "3.5.0-
|
|
38
|
-
"@tarojs/runtime": "3.5.0-
|
|
36
|
+
"@tarojs/api": "3.5.0-beta.2",
|
|
37
|
+
"@tarojs/router": "3.5.0-beta.2",
|
|
38
|
+
"@tarojs/runtime": "3.5.0-beta.2",
|
|
39
39
|
"base64-js": "^1.3.0",
|
|
40
40
|
"jsonp-retry": "^1.0.3",
|
|
41
41
|
"mobile-detect": "^1.4.2",
|
|
42
42
|
"query-string": "^7.1.1",
|
|
43
43
|
"whatwg-fetch": "^3.4.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "c85adaa45959e6cafc15e6531f4735a7dfa2aab0"
|
|
46
46
|
}
|
package/src/api/base/index.ts
CHANGED
|
@@ -14,10 +14,10 @@ export function base64ToArrayBuffer (base64) {
|
|
|
14
14
|
return toByteArray(base64)
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
export * from './crypto'
|
|
18
|
+
export * from './debug'
|
|
19
|
+
export * from './performance'
|
|
17
20
|
export * from './system'
|
|
18
21
|
export * from './update'
|
|
19
|
-
export * from './weapp/life-cycle'
|
|
20
22
|
export * from './weapp/app-event'
|
|
21
|
-
export * from './
|
|
22
|
-
export * from './performance'
|
|
23
|
-
export * from './crypto'
|
|
23
|
+
export * from './weapp/life-cycle'
|
package/src/api/cloud/index.ts
CHANGED
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import Taro from '@tarojs/api'
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
import { MethodHandler } from '../../utils/handler'
|
|
11
|
+
import { getStorageSync, setStorage, setStorageSync } from '../storage/index'
|
|
11
12
|
|
|
12
13
|
const CLIPBOARD_STORAGE_NAME = 'taro_clipboard'
|
|
13
14
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Taro from '@tarojs/api'
|
|
2
2
|
|
|
3
|
-
import { getDeviceInfo } from '../base/system'
|
|
4
3
|
import { throttle } from '../../utils'
|
|
5
4
|
import { CallbackManager, MethodHandler } from '../../utils/handler'
|
|
5
|
+
import { getDeviceInfo } from '../base/system'
|
|
6
6
|
|
|
7
7
|
const callbackManager = new CallbackManager()
|
|
8
8
|
let compassListener
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Taro from '@tarojs/api'
|
|
2
2
|
|
|
3
|
-
import { CallbackManager, MethodHandler } from '../../utils/handler'
|
|
4
3
|
import { temporarilyNotSupport } from '../../utils'
|
|
4
|
+
import { CallbackManager, MethodHandler } from '../../utils/handler'
|
|
5
5
|
|
|
6
6
|
function getConnection () {
|
|
7
7
|
// @ts-ignore
|
package/src/api/device/phone.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Taro from '@tarojs/api'
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { getParameterError, shouldBeObject } from '../../utils'
|
|
3
4
|
import { MethodHandler } from '../../utils/handler'
|
|
4
5
|
|
|
5
6
|
export const makePhoneCall: typeof Taro.makePhoneCall = (options) => {
|
package/src/api/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './ad'
|
|
2
2
|
export * from './ai'
|
|
3
|
+
export * from './alipay'
|
|
3
4
|
export * from './base'
|
|
4
5
|
export * from './canvas'
|
|
5
6
|
export * from './cloud'
|
|
@@ -17,9 +18,7 @@ export * from './payment'
|
|
|
17
18
|
export * from './route'
|
|
18
19
|
export * from './share'
|
|
19
20
|
export * from './storage'
|
|
21
|
+
export * from './swan'
|
|
20
22
|
export * from './ui'
|
|
21
23
|
export * from './worker'
|
|
22
24
|
export * from './wxml'
|
|
23
|
-
|
|
24
|
-
export * from './alipay'
|
|
25
|
-
export * from './swan'
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import './style.css'
|
|
2
|
+
|
|
1
3
|
import Taro from '@tarojs/api'
|
|
2
4
|
import { stringify } from 'query-string'
|
|
3
5
|
|
|
4
6
|
import { MethodHandler } from '../../utils/handler'
|
|
5
|
-
import './style.css'
|
|
6
7
|
|
|
7
8
|
function createLocationChooser (handler, key = LOCATION_APIKEY, mapOpt: Taro.chooseLocation.Option['mapOpts'] = {}) {
|
|
8
9
|
const { latitude, longitude, ...opts } = mapOpt
|
|
@@ -4,8 +4,8 @@ import { temporarilyNotSupport } from '../../../utils'
|
|
|
4
4
|
export const saveImageToPhotosAlbum = temporarilyNotSupport('saveImageToPhotosAlbum')
|
|
5
5
|
export const previewMedia = temporarilyNotSupport('previewMedia')
|
|
6
6
|
|
|
7
|
-
export * from './previewImage'
|
|
8
7
|
export * from './getImageInfo'
|
|
8
|
+
export * from './previewImage'
|
|
9
9
|
|
|
10
10
|
export const compressImage = temporarilyNotSupport('compressImage')
|
|
11
11
|
export const chooseMessageFile = temporarilyNotSupport('chooseMessageFile')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Taro from '@tarojs/api'
|
|
2
2
|
|
|
3
|
-
import { MethodHandler } from '../../../utils/handler'
|
|
4
3
|
import { findDOM, shouldBeObject, temporarilyNotSupport } from '../../../utils'
|
|
4
|
+
import { MethodHandler } from '../../../utils/handler'
|
|
5
5
|
|
|
6
6
|
// 视频
|
|
7
7
|
export const saveVideoToPhotosAlbum = temporarilyNotSupport('saveVideoToPhotosAlbum')
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Taro from '@tarojs/api'
|
|
2
|
+
|
|
2
3
|
import { CallbackManager } from '../../utils/handler'
|
|
3
4
|
import { NETWORK_TIMEOUT, setHeader, XHR_STATS } from './utils'
|
|
4
5
|
|
|
@@ -12,6 +13,7 @@ const createDownloadTask = ({ url, header, success, error }): Taro.DownloadTask
|
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
xhr.open('GET', url, true)
|
|
16
|
+
xhr.withCredentials = true
|
|
15
17
|
xhr.responseType = 'blob'
|
|
16
18
|
setHeader(xhr, header)
|
|
17
19
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Taro from '@tarojs/api'
|
|
2
|
+
|
|
2
3
|
import { CallbackManager } from '../../utils/handler'
|
|
3
4
|
import {
|
|
4
5
|
convertObjectUrlToBlob,
|
|
@@ -19,6 +20,7 @@ const createUploadTask = ({ url, filePath, formData = {}, name, header, timeout,
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
xhr.open('POST', url)
|
|
23
|
+
xhr.withCredentials = true
|
|
22
24
|
setHeader(xhr, header)
|
|
23
25
|
|
|
24
26
|
for (formKey in formData) {
|
|
@@ -30,7 +32,7 @@ const createUploadTask = ({ url, filePath, formData = {}, name, header, timeout,
|
|
|
30
32
|
callbackManager.progressUpdate.trigger({
|
|
31
33
|
progress: Math.round(loaded / total * 100),
|
|
32
34
|
totalBytesSent: loaded,
|
|
33
|
-
|
|
35
|
+
totalBytesExpectedToSend: total
|
|
34
36
|
})
|
|
35
37
|
}
|
|
36
38
|
|
package/src/api/network/utils.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { shouldBeObject, getParameterError } from '../../../utils'
|
|
1
|
+
import { getParameterError, shouldBeObject } from '../../../utils'
|
|
3
2
|
import { MethodHandler } from '../../../utils/handler'
|
|
3
|
+
import { SocketTask } from './socketTask'
|
|
4
4
|
|
|
5
5
|
let socketTasks: SocketTask[] = []
|
|
6
6
|
let socketsCounter = 1
|
package/src/api/route/index.ts
CHANGED
package/src/api/storage/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Taro from '@tarojs/api'
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { getParameterError, shouldBeObject, temporarilyNotSupport } from '../../utils'
|
|
3
4
|
import { MethodHandler } from '../../utils/handler'
|
|
4
5
|
|
|
5
6
|
function getItem (key) {
|
package/src/api/taro.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Taro from '@tarojs/api'
|
|
2
2
|
import { history } from '@tarojs/router'
|
|
3
3
|
|
|
4
|
-
import { getApp, getCurrentInstance, getCurrentPages,
|
|
4
|
+
import { getApp, getCurrentInstance, getCurrentPages, navigateBack, navigateTo, nextTick, redirectTo, reLaunch, switchTab } from '../api'
|
|
5
5
|
import { permanentlyNotSupport } from '../utils'
|
|
6
6
|
|
|
7
7
|
const {
|
|
@@ -67,18 +67,18 @@ export default taro
|
|
|
67
67
|
|
|
68
68
|
export {
|
|
69
69
|
Behavior,
|
|
70
|
-
|
|
71
|
-
ENV_TYPE,
|
|
72
|
-
Link,
|
|
73
|
-
interceptors,
|
|
74
|
-
initPxTransform,
|
|
70
|
+
canIUseWebp,
|
|
75
71
|
Current,
|
|
76
|
-
|
|
72
|
+
ENV_TYPE,
|
|
77
73
|
eventCenter,
|
|
78
74
|
Events,
|
|
75
|
+
getEnv,
|
|
76
|
+
history,
|
|
77
|
+
initPxTransform,
|
|
78
|
+
interceptors,
|
|
79
|
+
Link,
|
|
80
|
+
options,
|
|
79
81
|
preload,
|
|
80
|
-
requirePlugin,
|
|
81
82
|
pxTransform,
|
|
82
|
-
|
|
83
|
-
history
|
|
83
|
+
requirePlugin
|
|
84
84
|
}
|
package/src/api/ui/fonts.ts
CHANGED
package/src/api/ui/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './animation'
|
|
|
2
2
|
export * from './background'
|
|
3
3
|
export * from './custom-component'
|
|
4
4
|
export * from './fonts'
|
|
5
|
+
export * from './interaction'
|
|
5
6
|
export * from './menu'
|
|
6
7
|
export * from './navigation-bar'
|
|
7
8
|
export * from './pull-down-refresh'
|
|
@@ -9,4 +10,3 @@ export * from './scroll'
|
|
|
9
10
|
export * from './sticky'
|
|
10
11
|
export * from './tab-bar'
|
|
11
12
|
export * from './window'
|
|
12
|
-
export * from './interaction'
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import Taro from '@tarojs/api'
|
|
2
|
+
|
|
2
3
|
import { getParameterError, temporarilyNotSupport } from '../../../utils'
|
|
3
4
|
import { MethodHandler } from '../../../utils/handler'
|
|
4
|
-
import Toast from './toast'
|
|
5
|
-
import Modal from './modal'
|
|
6
5
|
import ActionSheet from './actionSheet'
|
|
6
|
+
import Modal from './modal'
|
|
7
|
+
import Toast from './toast'
|
|
7
8
|
|
|
8
9
|
// 交互
|
|
9
10
|
|
|
@@ -298,4 +299,4 @@ Taro.eventCenter.on('__taroRouterChange', () => {
|
|
|
298
299
|
const enableAlertBeforeUnload = temporarilyNotSupport('enableAlertBeforeUnload')
|
|
299
300
|
const disableAlertBeforeUnload = temporarilyNotSupport('disableAlertBeforeUnload')
|
|
300
301
|
|
|
301
|
-
export {
|
|
302
|
+
export { disableAlertBeforeUnload, enableAlertBeforeUnload, hideLoading, hideToast, showActionSheet, showLoading, showModal, showToast }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Taro from '@tarojs/api'
|
|
2
2
|
|
|
3
|
-
import { MethodHandler } from '../../../utils/handler'
|
|
4
3
|
import { getParameterError, shouldBeObject, temporarilyNotSupport } from '../../../utils'
|
|
4
|
+
import { MethodHandler } from '../../../utils/handler'
|
|
5
5
|
|
|
6
6
|
// 导航栏
|
|
7
7
|
export const showNavigationBarLoading = temporarilyNotSupport('showNavigationBarLoading')
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Taro from '@tarojs/api'
|
|
2
2
|
import { Current } from '@tarojs/runtime'
|
|
3
3
|
|
|
4
|
+
import { easeInOut, getTimingFunc } from '../../../utils'
|
|
4
5
|
import { MethodHandler } from '../../../utils/handler'
|
|
5
|
-
import { getTimingFunc, easeInOut } from '../../../utils'
|
|
6
6
|
|
|
7
7
|
let timer: ReturnType<typeof setTimeout>
|
|
8
8
|
const FRAME_DURATION = 17
|
package/src/api/ui/tab-bar.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Taro, { AppConfig } from '@tarojs/api'
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { getParameterError, isValidColor, shouldBeObject } from '../../utils'
|
|
3
4
|
import { MethodHandler } from '../../utils/handler'
|
|
4
5
|
|
|
5
6
|
let tabConf
|
package/src/api/ui/window.ts
CHANGED
package/src/api/wxml/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Taro from '@tarojs/api'
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import { findDOM } from '../../utils'
|
|
4
|
+
import { CanvasContext } from '../canvas/CanvasContext'
|
|
4
5
|
import { NodesRef } from './nodesRef'
|
|
5
6
|
|
|
6
7
|
type TElement = Document | HTMLElement | Element
|
package/src/utils/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable prefer-promise-reject-errors */
|
|
2
|
-
import { Current,
|
|
2
|
+
import { Current, hooks, TaroElement } from '@tarojs/runtime'
|
|
3
3
|
|
|
4
4
|
export function shouldBeObject (target: unknown) {
|
|
5
5
|
if (target && typeof target === 'object') return { flag: true }
|
|
@@ -13,13 +13,8 @@ export function shouldBeObject (target: unknown) {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export function findDOM (inst?): TaroElement | HTMLElement | undefined {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (inst) {
|
|
19
|
-
const find = runtimeHooks.getDOMNode
|
|
20
|
-
if (typeof find === 'function') {
|
|
21
|
-
return find(inst)
|
|
22
|
-
}
|
|
16
|
+
if (inst && hooks.isExist('getDOMNode')) {
|
|
17
|
+
return hooks.call('getDOMNode', inst)
|
|
23
18
|
}
|
|
24
19
|
|
|
25
20
|
const page = Current.page
|