@tarojs/taro-h5 3.5.0-alpha.13 → 3.5.0-alpha.16
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/ad/index.d.ts +6 -0
- package/dist/api/ai/facial.d.ts +9 -0
- package/dist/api/ai/index.d.ts +2 -0
- package/dist/api/ai/visual.d.ts +6 -0
- package/dist/api/alipay/index.d.ts +3 -0
- package/dist/api/base/crypto.d.ts +3 -0
- package/dist/api/base/debug.d.ts +9 -0
- package/dist/api/base/index.d.ts +12 -0
- package/dist/api/base/performance.d.ts +6 -0
- package/dist/api/base/system.d.ts +27 -0
- package/dist/api/base/system.js +2 -2
- package/dist/api/base/update.d.ts +6 -0
- package/dist/api/base/weapp/app-event.d.ts +41 -0
- package/dist/api/base/weapp/app-event.js +55 -4
- package/dist/api/base/weapp/life-cycle.d.ts +6 -0
- package/dist/api/canvas/CanvasContext.d.ts +104 -0
- package/dist/api/canvas/canvasGetImageData.d.ts +5 -0
- package/dist/api/canvas/canvasPutImageData.d.ts +6 -0
- package/dist/api/canvas/canvasToTempFilePath.d.ts +6 -0
- package/dist/api/canvas/canvasToTempFilePath.js +1 -1
- package/dist/api/canvas/createCanvasContext.d.ts +5 -0
- package/dist/api/canvas/index.d.ts +12 -0
- package/dist/api/cloud/index.d.ts +31 -0
- package/dist/api/data-analysis/index.d.ts +12 -0
- package/dist/api/device/accelerometer.d.ts +17 -0
- package/dist/api/device/accessibility.d.ts +3 -0
- package/dist/api/device/battery.d.ts +5 -0
- package/dist/api/device/bluetooth-ble.d.ts +48 -0
- package/dist/api/device/bluetooth-peripheral.d.ts +9 -0
- package/dist/api/device/bluetooth.d.ts +39 -0
- package/dist/api/device/calendar.d.ts +6 -0
- package/dist/api/device/clipboard.d.ts +15 -0
- package/dist/api/device/compass.d.ts +17 -0
- package/dist/api/device/contact.d.ts +6 -0
- package/dist/api/device/crypto.d.ts +3 -0
- package/dist/api/device/gyroscope.d.ts +12 -0
- package/dist/api/device/iBeacon.d.ts +21 -0
- package/dist/api/device/index.d.ts +23 -0
- package/dist/api/device/keyboard.d.ts +12 -0
- package/dist/api/device/memory.d.ts +6 -0
- package/dist/api/device/motion.d.ts +17 -0
- package/dist/api/device/network.d.ts +20 -0
- package/dist/api/device/nfc.d.ts +21 -0
- package/dist/api/device/phone.d.ts +2 -0
- package/dist/api/device/scan.d.ts +3 -0
- package/dist/api/device/screen.d.ts +18 -0
- package/dist/api/device/vibrate.d.ts +9 -0
- package/dist/api/device/vibrate.js +5 -7
- package/dist/api/device/wifi.d.ts +33 -0
- package/dist/api/ext/index.d.ts +6 -0
- package/dist/api/files/index.d.ts +24 -0
- package/dist/api/framework/index.d.ts +4 -0
- package/dist/api/index.d.ts +24 -0
- package/dist/api/location/chooseLocation.d.ts +6 -0
- package/dist/api/location/getLocation.d.ts +2 -0
- package/dist/api/location/index.d.ts +32 -0
- package/dist/api/location/index.js +1 -0
- package/dist/api/media/EditorContext.d.ts +42 -0
- package/dist/api/media/audio/InnerAudioContext.d.ts +58 -0
- package/dist/api/media/audio/InnerAudioContext.js +1 -1
- package/dist/api/media/audio/index.d.ts +29 -0
- package/dist/api/media/background-audio/BackgroundAudioManager.d.ts +71 -0
- package/dist/api/media/background-audio/index.d.ts +29 -0
- package/dist/api/media/camera.d.ts +3 -0
- package/dist/api/media/image/chooseImage.d.ts +5 -0
- package/dist/api/media/image/getImageInfo.d.ts +5 -0
- package/dist/api/media/image/index.d.ts +15 -0
- package/dist/api/media/image/previewImage.d.ts +8 -0
- package/dist/api/media/index.d.ts +12 -0
- package/dist/api/media/live.d.ts +6 -0
- package/dist/api/media/map.d.ts +3 -0
- package/dist/api/media/media-recorder.d.ts +3 -0
- package/dist/api/media/recorder.d.ts +9 -0
- package/dist/api/media/video/index.d.ts +24 -0
- package/dist/api/media/video-decoder.d.ts +3 -0
- package/dist/api/media/video-processing.d.ts +3 -0
- package/dist/api/media/voip.d.ts +42 -0
- package/dist/api/navigate/index.d.ts +12 -0
- package/dist/api/network/download.d.ts +6 -0
- package/dist/api/network/download.js +1 -0
- package/dist/api/network/index.d.ts +7 -0
- package/dist/api/network/mdns.d.ts +30 -0
- package/dist/api/network/request/index.d.ts +4 -0
- package/dist/api/network/tcp.d.ts +3 -0
- package/dist/api/network/udp.d.ts +3 -0
- package/dist/api/network/upload.d.ts +5 -0
- package/dist/api/network/upload.js +2 -1
- package/{src/api/network/utils.ts → dist/api/network/utils.d.ts} +44 -71
- package/dist/api/network/utils.js +1 -0
- package/dist/api/network/websocket/index.d.ts +7 -0
- package/dist/api/network/websocket/socketTask.d.ts +25 -0
- package/dist/api/open-api/account.d.ts +3 -0
- package/dist/api/open-api/address.d.ts +3 -0
- package/dist/api/open-api/authorize.d.ts +6 -0
- package/dist/api/open-api/card.d.ts +6 -0
- package/dist/api/open-api/channels-live.d.ts +18 -0
- package/dist/api/open-api/customer-service.d.ts +3 -0
- package/dist/api/open-api/facial.d.ts +12 -0
- package/dist/api/open-api/favorites.d.ts +6 -0
- package/dist/api/open-api/group.d.ts +3 -0
- package/dist/api/open-api/index.d.ts +18 -0
- package/dist/api/open-api/invoice.d.ts +6 -0
- package/dist/api/open-api/license-plate.d.ts +3 -0
- package/dist/api/open-api/login.d.ts +9 -0
- package/dist/api/open-api/red-package.d.ts +3 -0
- package/dist/api/open-api/settings.d.ts +6 -0
- package/dist/api/open-api/soter.d.ts +9 -0
- package/dist/api/open-api/subscribe-message.d.ts +3 -0
- package/dist/api/open-api/user-info.d.ts +6 -0
- package/dist/api/open-api/werun.d.ts +6 -0
- package/dist/api/payment/index.d.ts +6 -0
- package/dist/api/route/index.d.ts +1 -0
- package/dist/api/share/index.d.ts +30 -0
- package/dist/api/storage/background-fetch.d.ts +12 -0
- package/dist/api/storage/index.d.ts +18 -0
- package/dist/api/swan/index.d.ts +63 -0
- package/dist/api/taro.d.ts +12 -0
- package/dist/api/ui/animation/index.d.ts +2 -0
- package/dist/api/ui/background.d.ts +6 -0
- package/dist/api/ui/custom-component.d.ts +1 -0
- package/dist/api/ui/fonts.d.ts +2 -0
- package/dist/api/ui/index.d.ts +12 -0
- package/dist/api/ui/interaction/actionSheet.d.ts +61 -0
- package/dist/api/ui/interaction/index.d.ts +14 -0
- package/dist/api/ui/interaction/modal.d.ts +69 -0
- package/dist/api/ui/interaction/modal.js +1 -0
- package/dist/api/ui/interaction/toast.d.ts +85 -0
- package/dist/api/ui/menu.d.ts +3 -0
- package/dist/api/ui/navigation-bar/index.d.ts +15 -0
- package/dist/api/ui/navigation-bar/index.js +2 -3
- package/dist/api/ui/pull-down-refresh.d.ts +9 -0
- package/dist/api/ui/scroll/index.d.ts +5 -0
- package/dist/api/ui/sticky.d.ts +3 -0
- package/dist/api/ui/tab-bar.d.ts +34 -0
- package/dist/api/ui/window.d.ts +15 -0
- package/dist/api/worker/index.d.ts +3 -0
- package/dist/api/wxml/index.d.ts +5 -0
- package/dist/api/wxml/nodesRef.d.ts +13 -0
- package/dist/api/wxml/selectorQuery.d.ts +24 -0
- package/dist/api/wxml/selectorQuery.js +1 -1
- package/dist/index.cjs.d.ts +1373 -0
- package/dist/index.cjs.js +105 -81
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.d.ts +1373 -0
- package/dist/index.esm.js +93 -69
- package/dist/index.esm.js.map +1 -1
- package/dist/taroApis.d.ts +1364 -0
- package/dist/taroApis.js +1 -1
- package/dist/utils/animation.d.ts +6 -0
- package/dist/utils/handler.d.ts +48 -0
- package/dist/utils/index.d.ts +39 -0
- package/dist/utils/index.js +3 -7
- package/dist/utils/lodash.d.ts +2 -0
- package/dist/utils/valid.d.ts +2 -0
- package/package.json +17 -19
- package/types/api.d.ts +4 -0
- package/types/define.d.ts +2 -0
- package/types/index.d.ts +33 -0
- package/types/overlay.d.ts +9 -0
- package/LICENSE +0 -21
- package/src/api/ad/index.ts +0 -5
- package/src/api/ai/facial.ts +0 -6
- package/src/api/ai/index.ts +0 -2
- package/src/api/ai/visual.ts +0 -7
- package/src/api/alipay/index.ts +0 -4
- package/src/api/base/crypto.ts +0 -4
- package/src/api/base/debug.ts +0 -5
- package/src/api/base/index.ts +0 -23
- package/src/api/base/performance.ts +0 -5
- package/src/api/base/system.ts +0 -207
- package/src/api/base/update.ts +0 -5
- package/src/api/base/weapp/app-event.ts +0 -19
- package/src/api/base/weapp/life-cycle.ts +0 -5
- package/src/api/canvas/CanvasContext.ts +0 -233
- package/src/api/canvas/canvasGetImageData.ts +0 -28
- package/src/api/canvas/canvasPutImageData.ts +0 -25
- package/src/api/canvas/canvasToTempFilePath.ts +0 -25
- package/src/api/canvas/createCanvasContext.ts +0 -19
- package/src/api/canvas/index.ts +0 -18
- package/src/api/cloud/index.ts +0 -32
- package/src/api/data-analysis/index.ts +0 -6
- package/src/api/device/accelerometer.ts +0 -79
- package/src/api/device/accessibility.ts +0 -4
- package/src/api/device/battery.ts +0 -23
- package/src/api/device/bluetooth-ble.ts +0 -19
- package/src/api/device/bluetooth-peripheral.ts +0 -6
- package/src/api/device/bluetooth.ts +0 -16
- package/src/api/device/calendar.ts +0 -5
- package/src/api/device/clipboard.ts +0 -68
- package/src/api/device/compass.ts +0 -83
- package/src/api/device/contact.ts +0 -5
- package/src/api/device/crypto.ts +0 -4
- package/src/api/device/gyroscope.ts +0 -7
- package/src/api/device/iBeacon.ts +0 -10
- package/src/api/device/index.ts +0 -23
- package/src/api/device/keyboard.ts +0 -7
- package/src/api/device/memory.ts +0 -5
- package/src/api/device/motion.ts +0 -77
- package/src/api/device/network.ts +0 -90
- package/src/api/device/nfc.ts +0 -10
- package/src/api/device/phone.ts +0 -31
- package/src/api/device/scan.ts +0 -11
- package/src/api/device/screen.ts +0 -9
- package/src/api/device/vibrate.ts +0 -37
- package/src/api/device/wifi.ts +0 -14
- package/src/api/ext/index.ts +0 -5
- package/src/api/files/index.ts +0 -11
- package/src/api/framework/index.ts +0 -10
- package/src/api/index.ts +0 -24
- package/src/api/location/chooseLocation.ts +0 -117
- package/src/api/location/getLocation.ts +0 -81
- package/src/api/location/index.ts +0 -22
- package/src/api/location/style.css +0 -79
- package/src/api/media/EditorContext.ts +0 -32
- package/src/api/media/audio/InnerAudioContext.ts +0 -99
- package/src/api/media/audio/index.ts +0 -21
- package/src/api/media/background-audio/BackgroundAudioManager.ts +0 -104
- package/src/api/media/background-audio/index.ts +0 -17
- package/src/api/media/camera.ts +0 -4
- package/src/api/media/image/chooseImage.ts +0 -95
- package/src/api/media/image/getImageInfo.ts +0 -50
- package/src/api/media/image/index.ts +0 -13
- package/src/api/media/image/previewImage.ts +0 -80
- package/src/api/media/index.ts +0 -12
- package/src/api/media/live.ts +0 -5
- package/src/api/media/map.ts +0 -4
- package/src/api/media/media-recorder.ts +0 -4
- package/src/api/media/recorder.ts +0 -6
- package/src/api/media/video/index.ts +0 -82
- package/src/api/media/video-decoder.ts +0 -4
- package/src/api/media/video-processing.ts +0 -4
- package/src/api/media/voip.ts +0 -17
- package/src/api/navigate/index.ts +0 -7
- package/src/api/network/download.ts +0 -141
- package/src/api/network/index.ts +0 -7
- package/src/api/network/mdns.ts +0 -13
- package/src/api/network/request/index.ts +0 -135
- package/src/api/network/tcp.ts +0 -4
- package/src/api/network/udp.ts +0 -4
- package/src/api/network/upload.ts +0 -169
- package/src/api/network/websocket/index.ts +0 -88
- package/src/api/network/websocket/socketTask.ts +0 -89
- package/src/api/open-api/account.ts +0 -4
- package/src/api/open-api/address.ts +0 -4
- package/src/api/open-api/authorize.ts +0 -5
- package/src/api/open-api/card.ts +0 -5
- package/src/api/open-api/channels-live.ts +0 -9
- package/src/api/open-api/customer-service.ts +0 -4
- package/src/api/open-api/facial.ts +0 -7
- package/src/api/open-api/favorites.ts +0 -5
- package/src/api/open-api/group.ts +0 -4
- package/src/api/open-api/index.ts +0 -18
- package/src/api/open-api/invoice.ts +0 -5
- package/src/api/open-api/license-plate.ts +0 -4
- package/src/api/open-api/login.ts +0 -6
- package/src/api/open-api/red-package.ts +0 -4
- package/src/api/open-api/settings.ts +0 -5
- package/src/api/open-api/soter.ts +0 -6
- package/src/api/open-api/subscribe-message.ts +0 -4
- package/src/api/open-api/user-info.ts +0 -5
- package/src/api/open-api/werun.ts +0 -5
- package/src/api/payment/index.ts +0 -5
- package/src/api/route/index.ts +0 -10
- package/src/api/share/index.ts +0 -13
- package/src/api/storage/background-fetch.ts +0 -7
- package/src/api/storage/index.ts +0 -182
- package/src/api/swan/index.ts +0 -31
- package/src/api/taro.ts +0 -84
- package/src/api/ui/animation/index.ts +0 -356
- package/src/api/ui/background.ts +0 -5
- package/src/api/ui/custom-component.ts +0 -4
- package/src/api/ui/fonts.ts +0 -64
- package/src/api/ui/index.ts +0 -12
- package/src/api/ui/interaction/actionSheet.ts +0 -212
- package/src/api/ui/interaction/index.ts +0 -302
- package/src/api/ui/interaction/modal.ts +0 -237
- package/src/api/ui/interaction/toast.ts +0 -220
- package/src/api/ui/menu.ts +0 -4
- package/src/api/ui/navigation-bar/index.ts +0 -52
- package/src/api/ui/pull-down-refresh.ts +0 -28
- package/src/api/ui/scroll/index.ts +0 -85
- package/src/api/ui/sticky.ts +0 -4
- package/src/api/ui/tab-bar.ts +0 -327
- package/src/api/ui/window.ts +0 -38
- package/src/api/worker/index.ts +0 -4
- package/src/api/wxml/index.ts +0 -10
- package/src/api/wxml/nodesRef.ts +0 -56
- package/src/api/wxml/selectorQuery.ts +0 -220
- package/src/index.ts +0 -6
- package/src/utils/animation.ts +0 -15
- package/src/utils/handler.ts +0 -105
- package/src/utils/index.ts +0 -184
- package/src/utils/lodash.ts +0 -30
- package/src/utils/valid.ts +0 -8
package/dist/index.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ var Taro = require('@tarojs/api');
|
|
|
6
6
|
var router = require('@tarojs/router');
|
|
7
7
|
var runtime = require('@tarojs/runtime');
|
|
8
8
|
var base64Js = require('base64-js');
|
|
9
|
-
var
|
|
9
|
+
var navigate = require('@tarojs/router/dist/utils/navigate');
|
|
10
10
|
var queryString = require('query-string');
|
|
11
11
|
require('whatwg-fetch');
|
|
12
12
|
var jsonpRetry = require('jsonp-retry');
|
|
@@ -14,7 +14,6 @@ var jsonpRetry = require('jsonp-retry');
|
|
|
14
14
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
15
|
|
|
16
16
|
var Taro__default = /*#__PURE__*/_interopDefaultLegacy(Taro);
|
|
17
|
-
var MobileDetect__default = /*#__PURE__*/_interopDefaultLegacy(MobileDetect);
|
|
18
17
|
var jsonpRetry__default = /*#__PURE__*/_interopDefaultLegacy(jsonpRetry);
|
|
19
18
|
|
|
20
19
|
/**
|
|
@@ -83,12 +82,8 @@ function shouldBeObject(target) {
|
|
|
83
82
|
};
|
|
84
83
|
}
|
|
85
84
|
function findDOM(inst) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const find = runtimeHooks.getDOMNode;
|
|
89
|
-
if (typeof find === 'function') {
|
|
90
|
-
return find(inst);
|
|
91
|
-
}
|
|
85
|
+
if (inst && runtime.hooks.isExist('getDOMNode')) {
|
|
86
|
+
return runtime.hooks.call('getDOMNode', inst);
|
|
92
87
|
}
|
|
93
88
|
const page = runtime.Current.page;
|
|
94
89
|
const path = page === null || page === void 0 ? void 0 : page.path;
|
|
@@ -273,13 +268,11 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
273
268
|
var extendStatics = function(d, b) {
|
|
274
269
|
extendStatics = Object.setPrototypeOf ||
|
|
275
270
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
276
|
-
function (d, b) { for (var p in b) if (
|
|
271
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
277
272
|
return extendStatics(d, b);
|
|
278
273
|
};
|
|
279
274
|
|
|
280
275
|
function __extends(d, b) {
|
|
281
|
-
if (typeof b !== "function" && b !== null)
|
|
282
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
283
276
|
extendStatics(d, b);
|
|
284
277
|
function __() { this.constructor = d; }
|
|
285
278
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -361,16 +354,13 @@ function __generator(thisArg, body) {
|
|
|
361
354
|
}
|
|
362
355
|
}
|
|
363
356
|
|
|
364
|
-
|
|
365
|
-
if (k2 === undefined) k2 = k;
|
|
366
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
367
|
-
}) : (function(o, m, k, k2) {
|
|
357
|
+
function __createBinding(o, m, k, k2) {
|
|
368
358
|
if (k2 === undefined) k2 = k;
|
|
369
359
|
o[k2] = m[k];
|
|
370
|
-
}
|
|
360
|
+
}
|
|
371
361
|
|
|
372
|
-
function __exportStar(m,
|
|
373
|
-
for (var p in m) if (p !== "default" && !
|
|
362
|
+
function __exportStar(m, exports) {
|
|
363
|
+
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
374
364
|
}
|
|
375
365
|
|
|
376
366
|
function __values(o) {
|
|
@@ -402,31 +392,19 @@ function __read(o, n) {
|
|
|
402
392
|
return ar;
|
|
403
393
|
}
|
|
404
394
|
|
|
405
|
-
/** @deprecated */
|
|
406
395
|
function __spread() {
|
|
407
396
|
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
408
397
|
ar = ar.concat(__read(arguments[i]));
|
|
409
398
|
return ar;
|
|
410
399
|
}
|
|
411
400
|
|
|
412
|
-
/** @deprecated */
|
|
413
401
|
function __spreadArrays() {
|
|
414
402
|
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
415
403
|
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
416
404
|
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
417
405
|
r[k] = a[j];
|
|
418
406
|
return r;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
function __spreadArray(to, from, pack) {
|
|
422
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
423
|
-
if (ar || !(i in from)) {
|
|
424
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
425
|
-
ar[i] = from[i];
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
429
|
-
}
|
|
407
|
+
};
|
|
430
408
|
|
|
431
409
|
function __await(v) {
|
|
432
410
|
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
@@ -463,17 +441,11 @@ function __makeTemplateObject(cooked, raw) {
|
|
|
463
441
|
return cooked;
|
|
464
442
|
};
|
|
465
443
|
|
|
466
|
-
var __setModuleDefault = Object.create ? (function(o, v) {
|
|
467
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
468
|
-
}) : function(o, v) {
|
|
469
|
-
o["default"] = v;
|
|
470
|
-
};
|
|
471
|
-
|
|
472
444
|
function __importStar(mod) {
|
|
473
445
|
if (mod && mod.__esModule) return mod;
|
|
474
446
|
var result = {};
|
|
475
|
-
if (mod != null) for (var k in mod) if (
|
|
476
|
-
|
|
447
|
+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
448
|
+
result.default = mod;
|
|
477
449
|
return result;
|
|
478
450
|
}
|
|
479
451
|
|
|
@@ -481,17 +453,19 @@ function __importDefault(mod) {
|
|
|
481
453
|
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
482
454
|
}
|
|
483
455
|
|
|
484
|
-
function __classPrivateFieldGet(receiver,
|
|
485
|
-
if (
|
|
486
|
-
|
|
487
|
-
|
|
456
|
+
function __classPrivateFieldGet(receiver, privateMap) {
|
|
457
|
+
if (!privateMap.has(receiver)) {
|
|
458
|
+
throw new TypeError("attempted to get private field on non-instance");
|
|
459
|
+
}
|
|
460
|
+
return privateMap.get(receiver);
|
|
488
461
|
}
|
|
489
462
|
|
|
490
|
-
function __classPrivateFieldSet(receiver,
|
|
491
|
-
if (
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
463
|
+
function __classPrivateFieldSet(receiver, privateMap, value) {
|
|
464
|
+
if (!privateMap.has(receiver)) {
|
|
465
|
+
throw new TypeError("attempted to set private field on non-instance");
|
|
466
|
+
}
|
|
467
|
+
privateMap.set(receiver, value);
|
|
468
|
+
return value;
|
|
495
469
|
}
|
|
496
470
|
|
|
497
471
|
class MethodHandler {
|
|
@@ -623,7 +597,7 @@ const getSystemSetting = () => {
|
|
|
623
597
|
};
|
|
624
598
|
/** 获取设备设置 */
|
|
625
599
|
const getDeviceInfo = () => {
|
|
626
|
-
const md =
|
|
600
|
+
const md = navigate.getMobileDetect();
|
|
627
601
|
const info = {
|
|
628
602
|
/** 应用二进制接口类型(仅 Android 支持) */
|
|
629
603
|
abi: '',
|
|
@@ -759,6 +733,34 @@ const getSystemInfo = (options = {}) => __awaiter(void 0, void 0, void 0, functi
|
|
|
759
733
|
const updateWeChatApp = temporarilyNotSupport('updateWeChatApp');
|
|
760
734
|
const getUpdateManager = temporarilyNotSupport('getUpdateManager');
|
|
761
735
|
|
|
736
|
+
const appShowCallbackManager = new CallbackManager();
|
|
737
|
+
const appHideCallbackManager = new CallbackManager();
|
|
738
|
+
const getApp$1 = () => {
|
|
739
|
+
var _a;
|
|
740
|
+
const path = (_a = Taro__default["default"].Current.page) === null || _a === void 0 ? void 0 : _a.path;
|
|
741
|
+
return {
|
|
742
|
+
/** 小程序切前台的路径 */
|
|
743
|
+
path: path === null || path === void 0 ? void 0 : path.substring(0, path.indexOf('?')),
|
|
744
|
+
/** 小程序切前台的 query 参数 */
|
|
745
|
+
query: queryString.parse(location.search),
|
|
746
|
+
/** 来源信息。 */
|
|
747
|
+
referrerInfo: {},
|
|
748
|
+
/** 小程序切前台的[场景值](https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/scene.html) */
|
|
749
|
+
scene: 0,
|
|
750
|
+
/** shareTicket,详见[获取更多转发信息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */
|
|
751
|
+
shareTicket: ''
|
|
752
|
+
};
|
|
753
|
+
};
|
|
754
|
+
const appShowListener = () => {
|
|
755
|
+
if (document.visibilityState !== 'hidden') {
|
|
756
|
+
appShowCallbackManager.trigger(getApp$1());
|
|
757
|
+
}
|
|
758
|
+
};
|
|
759
|
+
const appHideListener = () => {
|
|
760
|
+
if (document.visibilityState === 'hidden') {
|
|
761
|
+
appHideCallbackManager.trigger(getApp$1());
|
|
762
|
+
}
|
|
763
|
+
};
|
|
762
764
|
// 应用级事件
|
|
763
765
|
const onUnhandledRejection = temporarilyNotSupport('onUnhandledRejection');
|
|
764
766
|
const onThemeChange = temporarilyNotSupport('onThemeChange');
|
|
@@ -766,16 +768,36 @@ const onPageNotFound = temporarilyNotSupport('onPageNotFound');
|
|
|
766
768
|
const onError = temporarilyNotSupport('onError');
|
|
767
769
|
const onAudioInterruptionEnd = temporarilyNotSupport('onAudioInterruptionEnd');
|
|
768
770
|
const onAudioInterruptionBegin = temporarilyNotSupport('onAudioInterruptionBegin');
|
|
769
|
-
const onAppShow =
|
|
770
|
-
|
|
771
|
+
const onAppShow = callback => {
|
|
772
|
+
appShowCallbackManager.add(callback);
|
|
773
|
+
if (appShowCallbackManager.count() === 1) {
|
|
774
|
+
window.addEventListener('visibilitychange', appShowListener);
|
|
775
|
+
}
|
|
776
|
+
};
|
|
777
|
+
const onAppHide = callback => {
|
|
778
|
+
appHideCallbackManager.add(callback);
|
|
779
|
+
if (appHideCallbackManager.count() === 1) {
|
|
780
|
+
window.addEventListener('visibilitychange', appHideListener);
|
|
781
|
+
}
|
|
782
|
+
};
|
|
771
783
|
const offUnhandledRejection = temporarilyNotSupport('offUnhandledRejection');
|
|
772
784
|
const offThemeChange = temporarilyNotSupport('offThemeChange');
|
|
773
785
|
const offPageNotFound = temporarilyNotSupport('offPageNotFound');
|
|
774
786
|
const offError = temporarilyNotSupport('offError');
|
|
775
787
|
const offAudioInterruptionEnd = temporarilyNotSupport('offAudioInterruptionEnd');
|
|
776
788
|
const offAudioInterruptionBegin = temporarilyNotSupport('offAudioInterruptionBegin');
|
|
777
|
-
const offAppShow =
|
|
778
|
-
|
|
789
|
+
const offAppShow = callback => {
|
|
790
|
+
appShowCallbackManager.remove(callback);
|
|
791
|
+
if (appShowCallbackManager.count() === 0) {
|
|
792
|
+
window.removeEventListener('visibilitychange', appShowListener);
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
const offAppHide = callback => {
|
|
796
|
+
appHideCallbackManager.remove(callback);
|
|
797
|
+
if (appHideCallbackManager.count() === 0) {
|
|
798
|
+
window.removeEventListener('visibilitychange', appHideListener);
|
|
799
|
+
}
|
|
800
|
+
};
|
|
779
801
|
|
|
780
802
|
// 生命周期
|
|
781
803
|
const getLaunchOptionsSync = temporarilyNotSupport('getLaunchOptionsSync');
|
|
@@ -1008,7 +1030,7 @@ const canvasToTempFilePath = ({ canvasId, fileType, quality, success, fail, comp
|
|
|
1008
1030
|
const el = findDOM(inst);
|
|
1009
1031
|
const canvas = el === null || el === void 0 ? void 0 : el.querySelector(`canvas[canvas-id="${canvasId}"]`);
|
|
1010
1032
|
try {
|
|
1011
|
-
const dataURL = canvas === null || canvas === void 0 ? void 0 : canvas.toDataURL(`image/${fileType || 'png'}`, quality);
|
|
1033
|
+
const dataURL = canvas === null || canvas === void 0 ? void 0 : canvas.toDataURL(`image/${(fileType === 'jpg' ? 'jpeg' : fileType) || 'png'}`, quality);
|
|
1012
1034
|
return handle.success({
|
|
1013
1035
|
tempFilePath: dataURL
|
|
1014
1036
|
});
|
|
@@ -1770,7 +1792,7 @@ const vibrator = function vibrator(mm) {
|
|
|
1770
1792
|
return window.navigator.vibrate(mm);
|
|
1771
1793
|
}
|
|
1772
1794
|
catch (e) {
|
|
1773
|
-
console.warn('当前浏览器不支持vibrate');
|
|
1795
|
+
console.warn('当前浏览器不支持 vibrate。');
|
|
1774
1796
|
}
|
|
1775
1797
|
};
|
|
1776
1798
|
/**
|
|
@@ -1778,12 +1800,11 @@ const vibrator = function vibrator(mm) {
|
|
|
1778
1800
|
*/
|
|
1779
1801
|
const vibrateShort = ({ success, fail, complete } = {}) => {
|
|
1780
1802
|
const handle = new MethodHandler({ name: 'vibrateShort', success, fail, complete });
|
|
1781
|
-
if (vibrator) {
|
|
1782
|
-
vibrator(15);
|
|
1803
|
+
if (vibrator(15)) {
|
|
1783
1804
|
return handle.success();
|
|
1784
1805
|
}
|
|
1785
1806
|
else {
|
|
1786
|
-
return handle.fail();
|
|
1807
|
+
return handle.fail({ errMsg: 'style is not support' });
|
|
1787
1808
|
}
|
|
1788
1809
|
};
|
|
1789
1810
|
/**
|
|
@@ -1791,12 +1812,11 @@ const vibrateShort = ({ success, fail, complete } = {}) => {
|
|
|
1791
1812
|
*/
|
|
1792
1813
|
const vibrateLong = ({ success, fail, complete } = {}) => {
|
|
1793
1814
|
const handle = new MethodHandler({ name: 'vibrateLong', success, fail, complete });
|
|
1794
|
-
if (vibrator) {
|
|
1795
|
-
vibrator(400);
|
|
1815
|
+
if (vibrator(400)) {
|
|
1796
1816
|
return handle.success();
|
|
1797
1817
|
}
|
|
1798
1818
|
else {
|
|
1799
|
-
return handle.fail();
|
|
1819
|
+
return handle.fail({ errMsg: 'style is not support' });
|
|
1800
1820
|
}
|
|
1801
1821
|
};
|
|
1802
1822
|
|
|
@@ -2034,6 +2054,7 @@ const onLocationChange = temporarilyNotSupport('onLocationChange');
|
|
|
2034
2054
|
const offLocationChangeError = temporarilyNotSupport('offLocationChangeError');
|
|
2035
2055
|
const offLocationChange = temporarilyNotSupport('offLocationChange');
|
|
2036
2056
|
const choosePoi = temporarilyNotSupport('choosePoi');
|
|
2057
|
+
const getFuzzyLocation = temporarilyNotSupport('getFuzzyLocation');
|
|
2037
2058
|
|
|
2038
2059
|
class InnerAudioContext {
|
|
2039
2060
|
constructor() {
|
|
@@ -2097,7 +2118,7 @@ class InnerAudioContext {
|
|
|
2097
2118
|
get duration() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.duration) || 0; }
|
|
2098
2119
|
set loop(e) { this.setProperty('loop', e); }
|
|
2099
2120
|
get loop() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.loop) || false; }
|
|
2100
|
-
get paused() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.paused)
|
|
2121
|
+
get paused() { var _a, _b; return (_b = (_a = this.Instance) === null || _a === void 0 ? void 0 : _a.paused) !== null && _b !== void 0 ? _b : true; }
|
|
2101
2122
|
set src(e) { this.setProperty('src', e); }
|
|
2102
2123
|
get src() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.src) || ''; }
|
|
2103
2124
|
set volume(e) { this.setProperty('volume', e); }
|
|
@@ -2603,6 +2624,7 @@ const convertObjectUrlToBlob = url => {
|
|
|
2603
2624
|
const xhr = new XMLHttpRequest();
|
|
2604
2625
|
xhr.open('GET', url, true);
|
|
2605
2626
|
xhr.responseType = 'blob';
|
|
2627
|
+
xhr.withCredentials = true;
|
|
2606
2628
|
xhr.onload = function () {
|
|
2607
2629
|
if (this.status === 200) {
|
|
2608
2630
|
resolve(this.response);
|
|
@@ -2625,6 +2647,7 @@ const createDownloadTask = ({ url, header, success, error }) => {
|
|
|
2625
2647
|
progressUpdate: new CallbackManager()
|
|
2626
2648
|
};
|
|
2627
2649
|
xhr.open('GET', url, true);
|
|
2650
|
+
xhr.withCredentials = true;
|
|
2628
2651
|
xhr.responseType = 'blob';
|
|
2629
2652
|
setHeader(xhr, header);
|
|
2630
2653
|
xhr.onprogress = e => {
|
|
@@ -2894,6 +2917,7 @@ const createUploadTask = ({ url, filePath, formData = {}, name, header, timeout,
|
|
|
2894
2917
|
progressUpdate: new CallbackManager()
|
|
2895
2918
|
};
|
|
2896
2919
|
xhr.open('POST', url);
|
|
2920
|
+
xhr.withCredentials = true;
|
|
2897
2921
|
setHeader(xhr, header);
|
|
2898
2922
|
for (formKey in formData) {
|
|
2899
2923
|
form.append(formKey, formData[formKey]);
|
|
@@ -2903,7 +2927,7 @@ const createUploadTask = ({ url, filePath, formData = {}, name, header, timeout,
|
|
|
2903
2927
|
callbackManager.progressUpdate.trigger({
|
|
2904
2928
|
progress: Math.round(loaded / total * 100),
|
|
2905
2929
|
totalBytesSent: loaded,
|
|
2906
|
-
|
|
2930
|
+
totalBytesExpectedToSend: total
|
|
2907
2931
|
});
|
|
2908
2932
|
};
|
|
2909
2933
|
xhr.onreadystatechange = () => {
|
|
@@ -3948,6 +3972,7 @@ class Modal {
|
|
|
3948
3972
|
this.text.setAttribute('style', inlineStyle(textStyle));
|
|
3949
3973
|
}
|
|
3950
3974
|
else {
|
|
3975
|
+
this.title.textContent = '';
|
|
3951
3976
|
// block => none
|
|
3952
3977
|
this.title.style.display = 'none';
|
|
3953
3978
|
const textCSS = Object.assign(Object.assign({}, textStyle), { padding: '40px 20px 26px', color: '#353535' });
|
|
@@ -4445,9 +4470,7 @@ function setNavigationBarTitle(options) {
|
|
|
4445
4470
|
})
|
|
4446
4471
|
});
|
|
4447
4472
|
}
|
|
4448
|
-
|
|
4449
|
-
document.title = title;
|
|
4450
|
-
}
|
|
4473
|
+
navigate.setTitle(title);
|
|
4451
4474
|
return handle.success();
|
|
4452
4475
|
}
|
|
4453
4476
|
/**
|
|
@@ -4954,7 +4977,7 @@ function filter(fields, dom, selector) {
|
|
|
4954
4977
|
}
|
|
4955
4978
|
}
|
|
4956
4979
|
else {
|
|
4957
|
-
// TODO https://developers.weixin.qq.com/miniprogram/dev/
|
|
4980
|
+
// TODO https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.html
|
|
4958
4981
|
// if (/^taro-scroll-view-core/i.test(tagName))
|
|
4959
4982
|
res.nodeCanvasType = '';
|
|
4960
4983
|
res.node = dom;
|
|
@@ -5176,32 +5199,32 @@ taro.initPxTransform = initPxTransform;
|
|
|
5176
5199
|
taro.canIUseWebp = canIUseWebp;
|
|
5177
5200
|
|
|
5178
5201
|
Object.defineProperty(exports, 'getCurrentPages', {
|
|
5179
|
-
|
|
5180
|
-
|
|
5202
|
+
enumerable: true,
|
|
5203
|
+
get: function () { return router.getCurrentPages; }
|
|
5181
5204
|
});
|
|
5182
5205
|
Object.defineProperty(exports, 'history', {
|
|
5183
|
-
|
|
5184
|
-
|
|
5206
|
+
enumerable: true,
|
|
5207
|
+
get: function () { return router.history; }
|
|
5185
5208
|
});
|
|
5186
5209
|
Object.defineProperty(exports, 'navigateBack', {
|
|
5187
|
-
|
|
5188
|
-
|
|
5210
|
+
enumerable: true,
|
|
5211
|
+
get: function () { return router.navigateBack; }
|
|
5189
5212
|
});
|
|
5190
5213
|
Object.defineProperty(exports, 'navigateTo', {
|
|
5191
|
-
|
|
5192
|
-
|
|
5214
|
+
enumerable: true,
|
|
5215
|
+
get: function () { return router.navigateTo; }
|
|
5193
5216
|
});
|
|
5194
5217
|
Object.defineProperty(exports, 'reLaunch', {
|
|
5195
|
-
|
|
5196
|
-
|
|
5218
|
+
enumerable: true,
|
|
5219
|
+
get: function () { return router.reLaunch; }
|
|
5197
5220
|
});
|
|
5198
5221
|
Object.defineProperty(exports, 'redirectTo', {
|
|
5199
|
-
|
|
5200
|
-
|
|
5222
|
+
enumerable: true,
|
|
5223
|
+
get: function () { return router.redirectTo; }
|
|
5201
5224
|
});
|
|
5202
5225
|
Object.defineProperty(exports, 'switchTab', {
|
|
5203
|
-
|
|
5204
|
-
|
|
5226
|
+
enumerable: true,
|
|
5227
|
+
get: function () { return router.switchTab; }
|
|
5205
5228
|
});
|
|
5206
5229
|
exports.Behavior = Behavior;
|
|
5207
5230
|
exports.Current = Current;
|
|
@@ -5322,6 +5345,7 @@ exports.getExtConfig = getExtConfig;
|
|
|
5322
5345
|
exports.getExtConfigSync = getExtConfigSync;
|
|
5323
5346
|
exports.getFileInfo = getFileInfo;
|
|
5324
5347
|
exports.getFileSystemManager = getFileSystemManager;
|
|
5348
|
+
exports.getFuzzyLocation = getFuzzyLocation;
|
|
5325
5349
|
exports.getGroupEnterInfo = getGroupEnterInfo;
|
|
5326
5350
|
exports.getHCEState = getHCEState;
|
|
5327
5351
|
exports.getImageInfo = getImageInfo;
|