@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/api/base/index.js
CHANGED
|
@@ -8,10 +8,10 @@ export function arrayBufferToBase64(arrayBuffer) {
|
|
|
8
8
|
export function base64ToArrayBuffer(base64) {
|
|
9
9
|
return toByteArray(base64);
|
|
10
10
|
}
|
|
11
|
+
export * from './crypto';
|
|
12
|
+
export * from './debug';
|
|
13
|
+
export * from './performance';
|
|
11
14
|
export * from './system';
|
|
12
15
|
export * from './update';
|
|
13
|
-
export * from './weapp/life-cycle';
|
|
14
16
|
export * from './weapp/app-event';
|
|
15
|
-
export * from './
|
|
16
|
-
export * from './performance';
|
|
17
|
-
export * from './crypto';
|
|
17
|
+
export * from './weapp/life-cycle';
|
|
@@ -13,8 +13,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
-
import { setStorage, setStorageSync, getStorageSync } from '../storage/index';
|
|
17
16
|
import { MethodHandler } from '../../utils/handler';
|
|
17
|
+
import { getStorageSync, setStorage, setStorageSync } from '../storage/index';
|
|
18
18
|
const CLIPBOARD_STORAGE_NAME = 'taro_clipboard';
|
|
19
19
|
document.addEventListener('copy', () => {
|
|
20
20
|
var _a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getDeviceInfo } from '../base/system';
|
|
2
1
|
import { throttle } from '../../utils';
|
|
3
2
|
import { CallbackManager, MethodHandler } from '../../utils/handler';
|
|
3
|
+
import { getDeviceInfo } from '../base/system';
|
|
4
4
|
const callbackManager = new CallbackManager();
|
|
5
5
|
let compassListener;
|
|
6
6
|
/**
|
|
@@ -7,8 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { CallbackManager, MethodHandler } from '../../utils/handler';
|
|
11
10
|
import { temporarilyNotSupport } from '../../utils';
|
|
11
|
+
import { CallbackManager, MethodHandler } from '../../utils/handler';
|
|
12
12
|
function getConnection() {
|
|
13
13
|
// @ts-ignore
|
|
14
14
|
return navigator.connection || navigator.mozConnection || navigator.webkitConnection || navigator.msConnection;
|
package/dist/api/device/phone.js
CHANGED
package/dist/api/index.js
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,8 +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
|
-
export * from './alipay';
|
|
24
|
-
export * from './swan';
|
|
@@ -9,9 +9,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
+
import './style.css';
|
|
12
13
|
import { stringify } from 'query-string';
|
|
13
14
|
import { MethodHandler } from '../../utils/handler';
|
|
14
|
-
import './style.css';
|
|
15
15
|
function createLocationChooser(handler, key = LOCATION_APIKEY, mapOpt = {}) {
|
|
16
16
|
var _a, _b, _c;
|
|
17
17
|
const { latitude, longitude } = mapOpt, opts = __rest(mapOpt, ["latitude", "longitude"]);
|
|
@@ -2,8 +2,8 @@ import { temporarilyNotSupport } from '../../../utils';
|
|
|
2
2
|
// 图片
|
|
3
3
|
export const saveImageToPhotosAlbum = temporarilyNotSupport('saveImageToPhotosAlbum');
|
|
4
4
|
export const previewMedia = temporarilyNotSupport('previewMedia');
|
|
5
|
-
export * from './previewImage';
|
|
6
5
|
export * from './getImageInfo';
|
|
6
|
+
export * from './previewImage';
|
|
7
7
|
export const compressImage = temporarilyNotSupport('compressImage');
|
|
8
8
|
export const chooseMessageFile = temporarilyNotSupport('chooseMessageFile');
|
|
9
9
|
export * from './chooseImage';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MethodHandler } from '../../../utils/handler';
|
|
2
1
|
import { findDOM, shouldBeObject, temporarilyNotSupport } from '../../../utils';
|
|
2
|
+
import { MethodHandler } from '../../../utils/handler';
|
|
3
3
|
// 视频
|
|
4
4
|
export const saveVideoToPhotosAlbum = temporarilyNotSupport('saveVideoToPhotosAlbum');
|
|
5
5
|
export const openVideoEditor = temporarilyNotSupport('openVideoEditor');
|
|
@@ -11,6 +11,7 @@ const createUploadTask = ({ url, filePath, formData = {}, name, header, timeout,
|
|
|
11
11
|
progressUpdate: new CallbackManager()
|
|
12
12
|
};
|
|
13
13
|
xhr.open('POST', url);
|
|
14
|
+
xhr.withCredentials = true;
|
|
14
15
|
setHeader(xhr, header);
|
|
15
16
|
for (formKey in formData) {
|
|
16
17
|
form.append(formKey, formData[formKey]);
|
|
@@ -20,7 +21,7 @@ const createUploadTask = ({ url, filePath, formData = {}, name, header, timeout,
|
|
|
20
21
|
callbackManager.progressUpdate.trigger({
|
|
21
22
|
progress: Math.round(loaded / total * 100),
|
|
22
23
|
totalBytesSent: loaded,
|
|
23
|
-
|
|
24
|
+
totalBytesExpectedToSend: total
|
|
24
25
|
});
|
|
25
26
|
};
|
|
26
27
|
xhr.onreadystatechange = () => {
|
|
@@ -51,6 +51,7 @@ export const convertObjectUrlToBlob = url => {
|
|
|
51
51
|
const xhr = new XMLHttpRequest();
|
|
52
52
|
xhr.open('GET', url, true);
|
|
53
53
|
xhr.responseType = 'blob';
|
|
54
|
+
xhr.withCredentials = true;
|
|
54
55
|
xhr.onload = function () {
|
|
55
56
|
if (this.status === 200) {
|
|
56
57
|
resolve(this.response);
|
|
@@ -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
|
let socketTasks = [];
|
|
5
5
|
let socketsCounter = 1;
|
|
6
6
|
export function sendSocketMessage() {
|
package/dist/api/route/index.js
CHANGED
package/dist/api/taro.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Taro from '@tarojs/api';
|
|
2
2
|
import { history } from '@tarojs/router';
|
|
3
|
-
import { getApp, getCurrentInstance, getCurrentPages,
|
|
3
|
+
import { getApp, getCurrentInstance, getCurrentPages, navigateBack, navigateTo, nextTick, redirectTo, reLaunch, switchTab } from '../api';
|
|
4
4
|
import { permanentlyNotSupport } from '../utils';
|
|
5
5
|
const { Behavior, getEnv, ENV_TYPE, Link, interceptors, getInitPxTransform, Current, options, eventCenter, Events, preload } = Taro;
|
|
6
6
|
const taro = {
|
|
@@ -43,4 +43,4 @@ taro.initPxTransform = initPxTransform;
|
|
|
43
43
|
// @ts-ignore
|
|
44
44
|
taro.canIUseWebp = canIUseWebp;
|
|
45
45
|
export default taro;
|
|
46
|
-
export { Behavior,
|
|
46
|
+
export { Behavior, canIUseWebp, Current, ENV_TYPE, eventCenter, Events, getEnv, history, initPxTransform, interceptors, Link, options, preload, pxTransform, requirePlugin };
|
package/dist/api/ui/index.js
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';
|
|
@@ -10,9 +10,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import Taro from '@tarojs/api';
|
|
11
11
|
import { getParameterError, temporarilyNotSupport } from '../../../utils';
|
|
12
12
|
import { MethodHandler } from '../../../utils/handler';
|
|
13
|
-
import Toast from './toast';
|
|
14
|
-
import Modal from './modal';
|
|
15
13
|
import ActionSheet from './actionSheet';
|
|
14
|
+
import Modal from './modal';
|
|
15
|
+
import Toast from './toast';
|
|
16
16
|
// 交互
|
|
17
17
|
let status = 'default';
|
|
18
18
|
// inject necessary style
|
|
@@ -274,4 +274,4 @@ Taro.eventCenter.on('__taroRouterChange', () => {
|
|
|
274
274
|
});
|
|
275
275
|
const enableAlertBeforeUnload = temporarilyNotSupport('enableAlertBeforeUnload');
|
|
276
276
|
const disableAlertBeforeUnload = temporarilyNotSupport('disableAlertBeforeUnload');
|
|
277
|
-
export {
|
|
277
|
+
export { disableAlertBeforeUnload, enableAlertBeforeUnload, hideLoading, hideToast, showActionSheet, showLoading, showModal, showToast };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MethodHandler } from '../../../utils/handler';
|
|
2
1
|
import { getParameterError, shouldBeObject, temporarilyNotSupport } from '../../../utils';
|
|
2
|
+
import { MethodHandler } from '../../../utils/handler';
|
|
3
3
|
// 导航栏
|
|
4
4
|
export const showNavigationBarLoading = temporarilyNotSupport('showNavigationBarLoading');
|
|
5
5
|
export function setNavigationBarTitle(options) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Current } from '@tarojs/runtime';
|
|
2
|
+
import { easeInOut, getTimingFunc } from '../../../utils';
|
|
2
3
|
import { MethodHandler } from '../../../utils/handler';
|
|
3
|
-
import { getTimingFunc, easeInOut } from '../../../utils';
|
|
4
4
|
let timer;
|
|
5
5
|
const FRAME_DURATION = 17;
|
|
6
6
|
/**
|
package/dist/api/ui/tab-bar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Taro from '@tarojs/api';
|
|
2
|
-
import {
|
|
2
|
+
import { getParameterError, isValidColor, shouldBeObject } from '../../utils';
|
|
3
3
|
import { MethodHandler } from '../../utils/handler';
|
|
4
4
|
let tabConf;
|
|
5
5
|
export function initTabBarApis(config = {}) {
|