@tarojs/taro-h5 3.6.5-alpha → 3.6.5-alpha.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/ai/index.d.ts +2 -2
- package/dist/api/base/index.d.ts +7 -7
- package/dist/api/canvas/index.d.ts +4 -4
- package/dist/api/device/battery.js +3 -2
- package/dist/api/device/battery.js.map +1 -1
- package/dist/api/device/index.d.ts +23 -23
- package/dist/api/framework/index.js.map +1 -1
- package/dist/api/index.d.ts +24 -24
- package/dist/api/location/index.d.ts +2 -2
- package/dist/api/location/style.scss.js +2 -2
- package/dist/api/media/audio/InnerAudioContext.d.ts +1 -1
- package/dist/api/media/background-audio/BackgroundAudioManager.d.ts +1 -1
- package/dist/api/media/background-audio/index.d.ts +1 -1
- package/dist/api/media/image/index.d.ts +3 -3
- package/dist/api/media/index.d.ts +12 -12
- package/dist/api/network/index.d.ts +7 -7
- package/dist/api/network/request/index.js +17 -0
- package/dist/api/network/request/index.js.map +1 -1
- package/dist/api/open-api/index.d.ts +18 -18
- package/dist/api/storage/index.d.ts +1 -1
- package/dist/api/ui/index.d.ts +12 -12
- package/dist/api/wxml/IntersectionObserver.js +7 -7
- package/dist/api/wxml/IntersectionObserver.js.map +1 -1
- package/dist/api/wxml/MediaQueryObserver.js +2 -0
- package/dist/api/wxml/MediaQueryObserver.js.map +1 -1
- package/dist/api/wxml/nodesRef.d.ts +1 -1
- package/dist/api/wxml/selectorQuery.d.ts +1 -1
- package/dist/index.cjs.d.ts +1 -0
- package/dist/index.cjs.js +30 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.esm.d.ts +1 -0
- package/dist/index.esm.js +30 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/utils/index.d.ts +3 -3
- package/package.json +10 -7
package/dist/index.cjs.js
CHANGED
|
@@ -12,6 +12,7 @@ var navigate = require('@tarojs/router/dist/utils/navigate');
|
|
|
12
12
|
var queryString = require('query-string');
|
|
13
13
|
var components = require('@tarojs/components/dist/components');
|
|
14
14
|
require('whatwg-fetch');
|
|
15
|
+
require('abortcontroller-polyfill/dist/abortcontroller-polyfill-only');
|
|
15
16
|
var jsonpRetry = require('jsonp-retry');
|
|
16
17
|
|
|
17
18
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -1265,7 +1266,8 @@ const offAccelerometerChange = callback => {
|
|
|
1265
1266
|
const checkIsOpenAccessibility = temporarilyNotSupport('checkIsOpenAccessibility');
|
|
1266
1267
|
|
|
1267
1268
|
// 电量
|
|
1268
|
-
|
|
1269
|
+
// Note: 浏览器标准下不支持,其他实现方案不准确,不建议开发者使用
|
|
1270
|
+
const getBatteryInfoSync = permanentlyNotSupport('getBatteryInfoSync');
|
|
1269
1271
|
const getBatteryInfo = ({ success, fail, complete } = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1270
1272
|
var _a;
|
|
1271
1273
|
const handle = new MethodHandler({ name: 'getBatteryInfo', success, fail, complete });
|
|
@@ -2013,8 +2015,8 @@ function styleInject(css, ref) {
|
|
|
2013
2015
|
}
|
|
2014
2016
|
}
|
|
2015
2017
|
|
|
2016
|
-
var css_248z = ".taro_choose_location {\n display: flex;\n position: fixed;\n top: 100%;\n z-index: 1;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background-color: #fff;\n transition: ease top 0.3s
|
|
2017
|
-
var stylesheet=".taro_choose_location {\n display: flex;\n position: fixed;\n top: 100%;\n z-index: 1;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background-color: #fff;\n transition: ease top 0.3s
|
|
2018
|
+
var css_248z = ".taro_choose_location {\n display: flex;\n position: fixed;\n top: 100%;\n z-index: 1;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background-color: #fff;\n transition: ease top 0.3s;\n}\n.taro_choose_location_bar {\n display: flex;\n flex: 0 95px;\n height: 95px;\n background-color: #ededed;\n color: #090909;\n}\n.taro_choose_location_back {\n position: relative;\n flex: 0 45px;\n margin-top: 30px;\n width: 33px;\n height: 30px;\n}\n.taro_choose_location_back::before {\n display: block;\n position: absolute;\n left: 0;\n top: 0;\n border: solid 15px;\n border-color: transparent #090909 transparent transparent;\n width: 0;\n height: 0;\n content: \"\";\n}\n.taro_choose_location_back::after {\n display: block;\n position: absolute;\n left: 3px;\n top: 0;\n border: solid 15px;\n border-color: transparent #ededed transparent transparent;\n width: 0;\n height: 0;\n content: \"\";\n}\n.taro_choose_location_title {\n flex: 1;\n padding-left: 30px;\n line-height: 95px;\n}\n.taro_choose_location_submit {\n margin: 18px 30px 0 0;\n padding: 0;\n border: none;\n width: 110px;\n height: 60px;\n background-color: #08bf62;\n line-height: 60px;\n font-size: 28px;\n color: #fff;\n}\n.taro_choose_location_frame {\n flex: 1;\n}";
|
|
2019
|
+
var stylesheet=".taro_choose_location {\n display: flex;\n position: fixed;\n top: 100%;\n z-index: 1;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background-color: #fff;\n transition: ease top 0.3s;\n}\n.taro_choose_location_bar {\n display: flex;\n flex: 0 95px;\n height: 95px;\n background-color: #ededed;\n color: #090909;\n}\n.taro_choose_location_back {\n position: relative;\n flex: 0 45px;\n margin-top: 30px;\n width: 33px;\n height: 30px;\n}\n.taro_choose_location_back::before {\n display: block;\n position: absolute;\n left: 0;\n top: 0;\n border: solid 15px;\n border-color: transparent #090909 transparent transparent;\n width: 0;\n height: 0;\n content: \"\";\n}\n.taro_choose_location_back::after {\n display: block;\n position: absolute;\n left: 3px;\n top: 0;\n border: solid 15px;\n border-color: transparent #ededed transparent transparent;\n width: 0;\n height: 0;\n content: \"\";\n}\n.taro_choose_location_title {\n flex: 1;\n padding-left: 30px;\n line-height: 95px;\n}\n.taro_choose_location_submit {\n margin: 18px 30px 0 0;\n padding: 0;\n border: none;\n width: 110px;\n height: 60px;\n background-color: #08bf62;\n line-height: 60px;\n font-size: 28px;\n color: #fff;\n}\n.taro_choose_location_frame {\n flex: 1;\n}";
|
|
2018
2020
|
styleInject(css_248z,{"insertAt":"top"});
|
|
2019
2021
|
|
|
2020
2022
|
function createLocationChooser(handler, key = LOCATION_APIKEY, mapOpt = {}) {
|
|
@@ -2934,12 +2936,24 @@ function _request(options) {
|
|
|
2934
2936
|
if (options.mode) {
|
|
2935
2937
|
params.mode = options.mode;
|
|
2936
2938
|
}
|
|
2939
|
+
let timeoutTimer = null;
|
|
2937
2940
|
if (options.signal) {
|
|
2938
2941
|
params.signal = options.signal;
|
|
2939
2942
|
}
|
|
2943
|
+
else if (typeof options.timeout === 'number') {
|
|
2944
|
+
const controller = new window.AbortController();
|
|
2945
|
+
params.signal = controller.signal;
|
|
2946
|
+
timeoutTimer = setTimeout(function () {
|
|
2947
|
+
controller.abort();
|
|
2948
|
+
}, options.timeout);
|
|
2949
|
+
}
|
|
2940
2950
|
params.credentials = options.credentials;
|
|
2941
2951
|
return fetch(url, params)
|
|
2942
2952
|
.then(response => {
|
|
2953
|
+
if (timeoutTimer) {
|
|
2954
|
+
clearTimeout(timeoutTimer);
|
|
2955
|
+
timeoutTimer = null;
|
|
2956
|
+
}
|
|
2943
2957
|
if (!response) {
|
|
2944
2958
|
const errorResponse = { ok: false };
|
|
2945
2959
|
throw errorResponse;
|
|
@@ -2971,6 +2985,10 @@ function _request(options) {
|
|
|
2971
2985
|
return res;
|
|
2972
2986
|
})
|
|
2973
2987
|
.catch(err => {
|
|
2988
|
+
if (timeoutTimer) {
|
|
2989
|
+
clearTimeout(timeoutTimer);
|
|
2990
|
+
timeoutTimer = null;
|
|
2991
|
+
}
|
|
2974
2992
|
shared.isFunction(fail) && fail(err);
|
|
2975
2993
|
shared.isFunction(complete) && complete(res);
|
|
2976
2994
|
err.statusCode = res.statusCode;
|
|
@@ -5031,6 +5049,13 @@ const createWorker = temporarilyNotSupport('createWorker');
|
|
|
5031
5049
|
// pollify
|
|
5032
5050
|
Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('intersection-observer')); });
|
|
5033
5051
|
class TaroH5IntersectionObserver {
|
|
5052
|
+
// selector 的容器节点
|
|
5053
|
+
get container() {
|
|
5054
|
+
const container = (this._component !== null
|
|
5055
|
+
? (findDOM(this._component) || document)
|
|
5056
|
+
: document);
|
|
5057
|
+
return container;
|
|
5058
|
+
}
|
|
5034
5059
|
constructor(component, options = {}) {
|
|
5035
5060
|
// 选项
|
|
5036
5061
|
this._options = {
|
|
@@ -5047,13 +5072,6 @@ class TaroH5IntersectionObserver {
|
|
|
5047
5072
|
this._component = component;
|
|
5048
5073
|
Object.assign(this._options, options);
|
|
5049
5074
|
}
|
|
5050
|
-
// selector 的容器节点
|
|
5051
|
-
get container() {
|
|
5052
|
-
const container = (this._component !== null
|
|
5053
|
-
? (findDOM(this._component) || document)
|
|
5054
|
-
: document);
|
|
5055
|
-
return container;
|
|
5056
|
-
}
|
|
5057
5075
|
createInst() {
|
|
5058
5076
|
// 去除原本的实例
|
|
5059
5077
|
this.disconnect();
|
|
@@ -5163,6 +5181,7 @@ class MediaQueryObserver {
|
|
|
5163
5181
|
this._mediaQueryObserver.addEventListener('change', this._listener);
|
|
5164
5182
|
}
|
|
5165
5183
|
else {
|
|
5184
|
+
// @ts-ignore
|
|
5166
5185
|
this._mediaQueryObserver.addListener(this._listener);
|
|
5167
5186
|
}
|
|
5168
5187
|
}
|
|
@@ -5175,6 +5194,7 @@ class MediaQueryObserver {
|
|
|
5175
5194
|
this._mediaQueryObserver.removeEventListener('change', this._listener);
|
|
5176
5195
|
}
|
|
5177
5196
|
else {
|
|
5197
|
+
// @ts-ignore
|
|
5178
5198
|
this._mediaQueryObserver.removeListener(this._listener);
|
|
5179
5199
|
}
|
|
5180
5200
|
}
|