@tarojs/taro-h5 3.5.0-alpha.12 → 3.5.0-alpha.13

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.
Files changed (70) hide show
  1. package/dist/api/base/index.js +4 -4
  2. package/dist/api/canvas/canvasGetImageData.js +1 -1
  3. package/dist/api/canvas/canvasPutImageData.js +1 -1
  4. package/dist/api/device/clipboard.js +1 -1
  5. package/dist/api/device/compass.js +1 -1
  6. package/dist/api/device/network.js +1 -1
  7. package/dist/api/device/phone.js +1 -1
  8. package/dist/api/index.js +2 -2
  9. package/dist/api/location/chooseLocation.js +1 -1
  10. package/dist/api/media/image/chooseImage.js +1 -1
  11. package/dist/api/media/image/index.js +1 -1
  12. package/dist/api/media/video/index.js +1 -1
  13. package/dist/api/network/request/index.js +1 -1
  14. package/dist/api/network/websocket/index.js +2 -2
  15. package/dist/api/route/index.js +1 -1
  16. package/dist/api/storage/index.js +1 -1
  17. package/dist/api/taro.js +2 -2
  18. package/dist/api/ui/index.js +1 -1
  19. package/dist/api/ui/interaction/index.js +3 -3
  20. package/dist/api/ui/navigation-bar/index.js +1 -1
  21. package/dist/api/ui/scroll/index.js +1 -1
  22. package/dist/api/ui/tab-bar.js +1 -1
  23. package/dist/api/wxml/selectorQuery.js +1 -1
  24. package/dist/index.cjs.js +1089 -1089
  25. package/dist/index.cjs.js.map +1 -1
  26. package/dist/index.esm.js +1089 -1089
  27. package/dist/index.esm.js.map +1 -1
  28. package/dist/utils/index.js +1 -1
  29. package/package.json +5 -5
  30. package/src/api/base/index.ts +4 -4
  31. package/src/api/canvas/canvasGetImageData.ts +2 -1
  32. package/src/api/canvas/canvasPutImageData.ts +2 -1
  33. package/src/api/canvas/canvasToTempFilePath.ts +1 -0
  34. package/src/api/canvas/createCanvasContext.ts +1 -0
  35. package/src/api/cloud/index.ts +1 -0
  36. package/src/api/device/accelerometer.ts +1 -0
  37. package/src/api/device/battery.ts +1 -0
  38. package/src/api/device/clipboard.ts +2 -1
  39. package/src/api/device/compass.ts +1 -1
  40. package/src/api/device/network.ts +1 -1
  41. package/src/api/device/phone.ts +2 -1
  42. package/src/api/device/vibrate.ts +1 -0
  43. package/src/api/index.ts +2 -3
  44. package/src/api/location/chooseLocation.ts +2 -1
  45. package/src/api/location/getLocation.ts +1 -0
  46. package/src/api/media/EditorContext.ts +1 -0
  47. package/src/api/media/audio/InnerAudioContext.ts +1 -0
  48. package/src/api/media/audio/index.ts +1 -0
  49. package/src/api/media/background-audio/BackgroundAudioManager.ts +1 -0
  50. package/src/api/media/image/chooseImage.ts +1 -1
  51. package/src/api/media/image/index.ts +1 -1
  52. package/src/api/media/video/index.ts +1 -1
  53. package/src/api/network/download.ts +1 -0
  54. package/src/api/network/request/index.ts +2 -1
  55. package/src/api/network/upload.ts +2 -1
  56. package/src/api/network/websocket/index.ts +2 -2
  57. package/src/api/route/index.ts +4 -4
  58. package/src/api/storage/index.ts +2 -1
  59. package/src/api/taro.ts +10 -10
  60. package/src/api/ui/fonts.ts +1 -0
  61. package/src/api/ui/index.ts +1 -1
  62. package/src/api/ui/interaction/index.ts +4 -3
  63. package/src/api/ui/navigation-bar/index.ts +1 -1
  64. package/src/api/ui/pull-down-refresh.ts +1 -0
  65. package/src/api/ui/scroll/index.ts +1 -1
  66. package/src/api/ui/tab-bar.ts +2 -1
  67. package/src/api/ui/window.ts +1 -0
  68. package/src/api/wxml/index.ts +1 -0
  69. package/src/api/wxml/selectorQuery.ts +2 -1
  70. package/src/utils/index.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable prefer-promise-reject-errors */
2
- import { Current, container, SERVICE_IDENTIFIER } from '@tarojs/runtime';
2
+ import { container, Current, SERVICE_IDENTIFIER } from '@tarojs/runtime';
3
3
  export function shouldBeObject(target) {
4
4
  if (target && typeof target === 'object')
5
5
  return { flag: true };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/taro-h5",
3
- "version": "3.5.0-alpha.12",
3
+ "version": "3.5.0-alpha.13",
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-alpha.12",
37
- "@tarojs/router": "3.5.0-alpha.12",
38
- "@tarojs/runtime": "3.5.0-alpha.12",
36
+ "@tarojs/api": "3.5.0-alpha.13",
37
+ "@tarojs/router": "3.5.0-alpha.13",
38
+ "@tarojs/runtime": "3.5.0-alpha.13",
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": "3944506a80ab2ae4c763aaf477dba84ee5151be6"
45
+ "gitHead": "1e201315913fbeb3a71f14c93a5e7a2fa490e4c4"
46
46
  }
@@ -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 './debug'
22
- export * from './performance'
23
- export * from './crypto'
23
+ export * from './weapp/life-cycle'
@@ -1,6 +1,7 @@
1
1
  import Taro from '@tarojs/api'
2
- import { MethodHandler } from '../../utils/handler'
2
+
3
3
  import { findDOM } from '../../utils'
4
+ import { MethodHandler } from '../../utils/handler'
4
5
 
5
6
  /**
6
7
  * 获取 canvas 区域隐含的像素数据。
@@ -1,6 +1,7 @@
1
1
  import Taro from '@tarojs/api'
2
- import { MethodHandler } from '../../utils/handler'
2
+
3
3
  import { findDOM } from '../../utils'
4
+ import { MethodHandler } from '../../utils/handler'
4
5
 
5
6
  /**
6
7
  * 将像素数据绘制到画布。在自定义组件下,第二个参数传入自定义组件实例 this,以操作组件内 <canvas> 组件
@@ -1,4 +1,5 @@
1
1
  import Taro from '@tarojs/api'
2
+
2
3
  import { findDOM } from '../../utils'
3
4
  import { MethodHandler } from '../../utils/handler'
4
5
 
@@ -1,4 +1,5 @@
1
1
  import Taro from '@tarojs/api'
2
+
2
3
  import { findDOM } from '../../utils'
3
4
  import { CanvasContext } from './CanvasContext'
4
5
 
@@ -1,4 +1,5 @@
1
1
  import Taro from '@tarojs/api'
2
+
2
3
  import { temporarilyNotSupport } from '../../utils'
3
4
 
4
5
  export class cloud implements Taro.cloud {
@@ -1,4 +1,5 @@
1
1
  import Taro from '@tarojs/api'
2
+
2
3
  import { throttle } from '../../utils'
3
4
  import { CallbackManager, MethodHandler } from '../../utils/handler'
4
5
 
@@ -1,4 +1,5 @@
1
1
  import Taro from '@tarojs/api'
2
+
2
3
  import { temporarilyNotSupport } from '../../utils'
3
4
  import { MethodHandler } from '../../utils/handler'
4
5
 
@@ -6,8 +6,9 @@
6
6
  */
7
7
 
8
8
  import Taro from '@tarojs/api'
9
- import { setStorage, setStorageSync, getStorageSync } from '../storage/index'
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
@@ -1,5 +1,6 @@
1
1
  import Taro from '@tarojs/api'
2
- import { shouldBeObject, getParameterError } from '../../utils'
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) => {
@@ -1,4 +1,5 @@
1
1
  import Taro from '@tarojs/api'
2
+
2
3
  import { MethodHandler } from '../../utils/handler'
3
4
 
4
5
  const vibrator = function vibrator (mm) {
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
@@ -1,4 +1,5 @@
1
1
  import Taro from '@tarojs/api'
2
+
2
3
  import { processOpenApi, shouldBeObject } from '../../utils'
3
4
  import { MethodHandler } from '../../utils/handler'
4
5
 
@@ -1,4 +1,5 @@
1
1
  import Taro from '@tarojs/api'
2
+
2
3
  import { temporarilyNotSupport } from '../../utils'
3
4
 
4
5
  // 富文本
@@ -1,4 +1,5 @@
1
1
  import Taro from '@tarojs/api'
2
+
2
3
  import { permanentlyNotSupport } from '../../../utils'
3
4
  import { CallbackManager } from '../../../utils/handler'
4
5
 
@@ -1,4 +1,5 @@
1
1
  import Taro from '@tarojs/api'
2
+
2
3
  import { temporarilyNotSupport } from '../../../utils'
3
4
  import { InnerAudioContext } from './InnerAudioContext'
4
5
 
@@ -1,4 +1,5 @@
1
1
  import Taro from '@tarojs/api'
2
+
2
3
  import { permanentlyNotSupport } from '../../../utils'
3
4
  import { CallbackManager } from '../../../utils/handler'
4
5
 
@@ -1,7 +1,7 @@
1
1
  import Taro from '@tarojs/api'
2
2
 
3
+ import { getParameterError, shouldBeObject } from '../../../utils'
3
4
  import { MethodHandler } from '../../../utils/handler'
4
- import { shouldBeObject, getParameterError } from '../../../utils'
5
5
 
6
6
  /**
7
7
  * 从本地相册选择图片或使用相机拍照。
@@ -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
 
@@ -1,5 +1,6 @@
1
- import Taro from '@tarojs/api'
2
1
  import 'whatwg-fetch'
2
+
3
+ import Taro from '@tarojs/api'
3
4
  import jsonpRetry from 'jsonp-retry'
4
5
 
5
6
  import { serializeParams } from '../../../utils'
@@ -1,10 +1,11 @@
1
1
  import Taro from '@tarojs/api'
2
+
2
3
  import { CallbackManager } from '../../utils/handler'
3
4
  import {
4
5
  convertObjectUrlToBlob,
5
6
  NETWORK_TIMEOUT,
6
7
  setHeader,
7
- XHR_STATS
8
+ XHR_STATS
8
9
  } from './utils'
9
10
 
10
11
  const createUploadTask = ({ url, filePath, formData = {}, name, header, timeout, fileName, success, error }): Taro.UploadTask => {
@@ -1,6 +1,6 @@
1
- import { SocketTask } from './socketTask'
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
@@ -1,10 +1,10 @@
1
1
  // 路由
2
2
  export {
3
- switchTab,
4
- reLaunch,
5
- redirectTo,
3
+ navigateBack,
6
4
  navigateTo,
7
- navigateBack
5
+ redirectTo,
6
+ reLaunch,
7
+ switchTab
8
8
  } from '@tarojs/router'
9
9
 
10
10
  // FIXME 方法导出类型未对齐,后续修复
@@ -1,5 +1,6 @@
1
1
  import Taro from '@tarojs/api'
2
- import { shouldBeObject, getParameterError, temporarilyNotSupport } from '../../utils'
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, nextTick, navigateBack, navigateTo, reLaunch, redirectTo, switchTab } from '../api'
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
- getEnv,
71
- ENV_TYPE,
72
- Link,
73
- interceptors,
74
- initPxTransform,
70
+ canIUseWebp,
75
71
  Current,
76
- options,
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
- canIUseWebp,
83
- history
83
+ requirePlugin
84
84
  }
@@ -1,4 +1,5 @@
1
1
  import Taro from '@tarojs/api'
2
+
2
3
  import { MethodHandler } from '../../utils/handler'
3
4
 
4
5
  // 字体
@@ -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 { showToast, showModal, showLoading, showActionSheet, hideToast, hideLoading, enableAlertBeforeUnload, disableAlertBeforeUnload }
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,4 +1,5 @@
1
1
  import Taro from '@tarojs/api'
2
+
2
3
  import { MethodHandler } from '../../utils/handler'
3
4
  /**
4
5
  * 开始下拉刷新。调用后触发下拉刷新动画,效果与用户手动下拉刷新一致。
@@ -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
@@ -1,5 +1,6 @@
1
1
  import Taro, { AppConfig } from '@tarojs/api'
2
- import { shouldBeObject, getParameterError, isValidColor } from '../../utils'
2
+
3
+ import { getParameterError, isValidColor, shouldBeObject } from '../../utils'
3
4
  import { MethodHandler } from '../../utils/handler'
4
5
 
5
6
  let tabConf
@@ -1,4 +1,5 @@
1
1
  import Taro from '@tarojs/api'
2
+
2
3
  import { temporarilyNotSupport } from '../../utils'
3
4
  import { CallbackManager } from '../../utils/handler'
4
5
 
@@ -1,4 +1,5 @@
1
1
  import Taro from '@tarojs/api'
2
+
2
3
  import { temporarilyNotSupport } from '../../utils'
3
4
  import { SelectorQuery } from './selectorQuery'
4
5
 
@@ -1,6 +1,7 @@
1
1
  import Taro from '@tarojs/api'
2
- import { CanvasContext } from '../canvas/CanvasContext'
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
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable prefer-promise-reject-errors */
2
- import { Current, container, SERVICE_IDENTIFIER, IHooks, TaroElement } from '@tarojs/runtime'
2
+ import { container, Current, IHooks, SERVICE_IDENTIFIER, TaroElement } from '@tarojs/runtime'
3
3
 
4
4
  export function shouldBeObject (target: unknown) {
5
5
  if (target && typeof target === 'object') return { flag: true }