@tarojs/taro-h5 4.0.0-beta.1 → 4.0.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 +1 -1
- package/dist/api/base/index.js.map +1 -1
- package/dist/api/base/system.js +7 -7
- package/dist/api/base/system.js.map +1 -1
- package/dist/api/canvas/CanvasContext.js +5 -2
- package/dist/api/canvas/CanvasContext.js.map +1 -1
- package/dist/api/device/battery.js +1 -1
- package/dist/api/device/clipboard.js +1 -1
- package/dist/api/device/network.js +1 -1
- package/dist/api/index.js +2 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/location/chooseLocation.js +1 -1
- package/dist/api/location/style.scss.js +3 -3
- package/dist/api/media/image/chooseImage.js +1 -1
- package/dist/api/media/image/previewImage.js +1 -1
- package/dist/api/media/video/chooseMedia.js +3 -4
- package/dist/api/media/video/chooseMedia.js.map +1 -1
- package/dist/api/media/video/getVideoInfo.js +1 -1
- package/dist/api/network/request/index.js +30 -7
- package/dist/api/network/request/index.js.map +1 -1
- package/dist/api/qq/index.d.ts +9 -1
- package/dist/api/qq/index.js +9 -1
- package/dist/api/qq/index.js.map +1 -1
- package/dist/api/ui/fonts.js +1 -1
- package/dist/api/ui/interaction/index.js +1 -1
- package/dist/api/ui/navigation-bar/index.js +1 -1
- package/dist/api/ui/navigation-bar/index.js.map +1 -1
- package/dist/api/wxml/IntersectionObserver.js +0 -1
- package/dist/api/wxml/IntersectionObserver.js.map +1 -1
- package/dist/api/wxml/index.d.ts +2 -1
- package/dist/api/wxml/index.js +1 -0
- package/dist/api/wxml/index.js.map +1 -1
- package/dist/index.cjs.d.ts +42 -1
- package/dist/index.cjs.js +84 -413
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.d.ts +42 -1
- package/dist/index.esm.js +56 -394
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/index.js +1 -2
- package/dist/utils/index.js.map +1 -1
- package/package.json +17 -11
- package/dist/node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.js +0 -373
- package/dist/node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.js.map +0 -1
- /package/dist/node_modules/.pnpm/{style-inject@0.3.0 → registry.npmjs.org_style-inject@0.3.0}/node_modules/style-inject/dist/style-inject.es.js +0 -0
- /package/dist/node_modules/.pnpm/{style-inject@0.3.0 → registry.npmjs.org_style-inject@0.3.0}/node_modules/style-inject/dist/style-inject.es.js.map +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -5,15 +5,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var Taro = require('@tarojs/api');
|
|
6
6
|
var router = require('@tarojs/router');
|
|
7
7
|
var shared = require('@tarojs/shared');
|
|
8
|
-
var utils = require('@tarojs/router/dist/utils');
|
|
9
8
|
var runtime = require('@tarojs/runtime');
|
|
10
9
|
var base64Js = require('base64-js');
|
|
11
|
-
var
|
|
10
|
+
var tslib = require('tslib');
|
|
11
|
+
var platform = require('platform');
|
|
12
12
|
var isNil = require('lodash-es/isNil');
|
|
13
13
|
var queryString = require('query-string');
|
|
14
14
|
var throttle = require('lodash-es/throttle');
|
|
15
15
|
var ics = require('ics');
|
|
16
16
|
var components = require('@tarojs/components/dist/components');
|
|
17
|
+
var isMobile = require('is-mobile');
|
|
17
18
|
require('whatwg-fetch');
|
|
18
19
|
require('abortcontroller-polyfill/dist/abortcontroller-polyfill-only');
|
|
19
20
|
var jsonpRetry = require('jsonp-retry');
|
|
@@ -302,8 +303,8 @@ function processOpenApi({ name, defaultOptions, standardMethod, formatOptions =
|
|
|
302
303
|
function getCurrentPath() {
|
|
303
304
|
var _a, _b, _c, _d, _e, _f;
|
|
304
305
|
const appConfig = window.__taroAppConfig || {};
|
|
305
|
-
const routePath =
|
|
306
|
-
const homePath =
|
|
306
|
+
const routePath = runtime.getCurrentPage((_a = appConfig.router) === null || _a === void 0 ? void 0 : _a.mode, (_b = appConfig.router) === null || _b === void 0 ? void 0 : _b.basename);
|
|
307
|
+
const homePath = runtime.getHomePage((_d = (_c = appConfig.routes) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.path, (_e = appConfig.router) === null || _e === void 0 ? void 0 : _e.basename, (_f = appConfig.router) === null || _f === void 0 ? void 0 : _f.customRoutes, appConfig.entryPagePath);
|
|
307
308
|
/**
|
|
308
309
|
* createPageConfig 时根据 stack 的长度来设置 stamp 以保证页面 path 的唯一,此函数是在 createPageConfig 之前调用,预先设置 stamp=1
|
|
309
310
|
* url 上没有指定应用的启动页面时使用 homePath
|
|
@@ -347,377 +348,6 @@ const preloadWebview = /* @__PURE__ */ temporarilyNotSupport('preloadWebview');
|
|
|
347
348
|
const preloadSkylineView = /* @__PURE__ */ temporarilyNotSupport('preloadSkylineView');
|
|
348
349
|
const preloadAssets = /* @__PURE__ */ temporarilyNotSupport('preloadAssets');
|
|
349
350
|
|
|
350
|
-
/******************************************************************************
|
|
351
|
-
Copyright (c) Microsoft Corporation.
|
|
352
|
-
|
|
353
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
354
|
-
purpose with or without fee is hereby granted.
|
|
355
|
-
|
|
356
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
357
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
358
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
359
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
360
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
361
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
362
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
363
|
-
***************************************************************************** */
|
|
364
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
365
|
-
|
|
366
|
-
var extendStatics = function(d, b) {
|
|
367
|
-
extendStatics = Object.setPrototypeOf ||
|
|
368
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
369
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
370
|
-
return extendStatics(d, b);
|
|
371
|
-
};
|
|
372
|
-
|
|
373
|
-
function __extends(d, b) {
|
|
374
|
-
if (typeof b !== "function" && b !== null)
|
|
375
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
376
|
-
extendStatics(d, b);
|
|
377
|
-
function __() { this.constructor = d; }
|
|
378
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
var __assign = function() {
|
|
382
|
-
__assign = Object.assign || function __assign(t) {
|
|
383
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
384
|
-
s = arguments[i];
|
|
385
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
386
|
-
}
|
|
387
|
-
return t;
|
|
388
|
-
};
|
|
389
|
-
return __assign.apply(this, arguments);
|
|
390
|
-
};
|
|
391
|
-
|
|
392
|
-
function __rest(s, e) {
|
|
393
|
-
var t = {};
|
|
394
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
395
|
-
t[p] = s[p];
|
|
396
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
397
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
398
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
399
|
-
t[p[i]] = s[p[i]];
|
|
400
|
-
}
|
|
401
|
-
return t;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
function __decorate(decorators, target, key, desc) {
|
|
405
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
406
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
407
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
408
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
function __param(paramIndex, decorator) {
|
|
412
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
416
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
417
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
418
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
419
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
420
|
-
var _, done = false;
|
|
421
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
422
|
-
var context = {};
|
|
423
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
424
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
425
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
426
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
427
|
-
if (kind === "accessor") {
|
|
428
|
-
if (result === void 0) continue;
|
|
429
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
430
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
431
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
432
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
433
|
-
}
|
|
434
|
-
else if (_ = accept(result)) {
|
|
435
|
-
if (kind === "field") initializers.unshift(_);
|
|
436
|
-
else descriptor[key] = _;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
440
|
-
done = true;
|
|
441
|
-
};
|
|
442
|
-
|
|
443
|
-
function __runInitializers(thisArg, initializers, value) {
|
|
444
|
-
var useValue = arguments.length > 2;
|
|
445
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
446
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
447
|
-
}
|
|
448
|
-
return useValue ? value : void 0;
|
|
449
|
-
};
|
|
450
|
-
|
|
451
|
-
function __propKey(x) {
|
|
452
|
-
return typeof x === "symbol" ? x : "".concat(x);
|
|
453
|
-
};
|
|
454
|
-
|
|
455
|
-
function __setFunctionName(f, name, prefix) {
|
|
456
|
-
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
457
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
458
|
-
};
|
|
459
|
-
|
|
460
|
-
function __metadata(metadataKey, metadataValue) {
|
|
461
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
465
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
466
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
467
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
468
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
469
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
470
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
471
|
-
});
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
function __generator(thisArg, body) {
|
|
475
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
476
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
477
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
478
|
-
function step(op) {
|
|
479
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
480
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
481
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
482
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
483
|
-
switch (op[0]) {
|
|
484
|
-
case 0: case 1: t = op; break;
|
|
485
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
486
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
487
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
488
|
-
default:
|
|
489
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
490
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
491
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
492
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
493
|
-
if (t[2]) _.ops.pop();
|
|
494
|
-
_.trys.pop(); continue;
|
|
495
|
-
}
|
|
496
|
-
op = body.call(thisArg, _);
|
|
497
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
498
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
var __createBinding = Object.create ? (function(o, m, k, k2) {
|
|
503
|
-
if (k2 === undefined) k2 = k;
|
|
504
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
505
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
506
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
507
|
-
}
|
|
508
|
-
Object.defineProperty(o, k2, desc);
|
|
509
|
-
}) : (function(o, m, k, k2) {
|
|
510
|
-
if (k2 === undefined) k2 = k;
|
|
511
|
-
o[k2] = m[k];
|
|
512
|
-
});
|
|
513
|
-
|
|
514
|
-
function __exportStar(m, o) {
|
|
515
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
function __values(o) {
|
|
519
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
520
|
-
if (m) return m.call(o);
|
|
521
|
-
if (o && typeof o.length === "number") return {
|
|
522
|
-
next: function () {
|
|
523
|
-
if (o && i >= o.length) o = void 0;
|
|
524
|
-
return { value: o && o[i++], done: !o };
|
|
525
|
-
}
|
|
526
|
-
};
|
|
527
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
function __read(o, n) {
|
|
531
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
532
|
-
if (!m) return o;
|
|
533
|
-
var i = m.call(o), r, ar = [], e;
|
|
534
|
-
try {
|
|
535
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
536
|
-
}
|
|
537
|
-
catch (error) { e = { error: error }; }
|
|
538
|
-
finally {
|
|
539
|
-
try {
|
|
540
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
541
|
-
}
|
|
542
|
-
finally { if (e) throw e.error; }
|
|
543
|
-
}
|
|
544
|
-
return ar;
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
/** @deprecated */
|
|
548
|
-
function __spread() {
|
|
549
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
550
|
-
ar = ar.concat(__read(arguments[i]));
|
|
551
|
-
return ar;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
/** @deprecated */
|
|
555
|
-
function __spreadArrays() {
|
|
556
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
557
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
558
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
559
|
-
r[k] = a[j];
|
|
560
|
-
return r;
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
function __spreadArray(to, from, pack) {
|
|
564
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
565
|
-
if (ar || !(i in from)) {
|
|
566
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
567
|
-
ar[i] = from[i];
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
function __await(v) {
|
|
574
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
578
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
579
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
580
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
581
|
-
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
582
|
-
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
583
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
584
|
-
function fulfill(value) { resume("next", value); }
|
|
585
|
-
function reject(value) { resume("throw", value); }
|
|
586
|
-
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
function __asyncDelegator(o) {
|
|
590
|
-
var i, p;
|
|
591
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
592
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
function __asyncValues(o) {
|
|
596
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
597
|
-
var m = o[Symbol.asyncIterator], i;
|
|
598
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
599
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
600
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
function __makeTemplateObject(cooked, raw) {
|
|
604
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
605
|
-
return cooked;
|
|
606
|
-
};
|
|
607
|
-
|
|
608
|
-
var __setModuleDefault = Object.create ? (function(o, v) {
|
|
609
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
610
|
-
}) : function(o, v) {
|
|
611
|
-
o["default"] = v;
|
|
612
|
-
};
|
|
613
|
-
|
|
614
|
-
function __importStar(mod) {
|
|
615
|
-
if (mod && mod.__esModule) return mod;
|
|
616
|
-
var result = {};
|
|
617
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
618
|
-
__setModuleDefault(result, mod);
|
|
619
|
-
return result;
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
function __importDefault(mod) {
|
|
623
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
627
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
628
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
629
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
633
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
634
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
635
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
636
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
function __classPrivateFieldIn(state, receiver) {
|
|
640
|
-
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
|
641
|
-
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
function __addDisposableResource(env, value, async) {
|
|
645
|
-
if (value !== null && value !== void 0) {
|
|
646
|
-
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
647
|
-
var dispose;
|
|
648
|
-
if (async) {
|
|
649
|
-
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
650
|
-
dispose = value[Symbol.asyncDispose];
|
|
651
|
-
}
|
|
652
|
-
if (dispose === void 0) {
|
|
653
|
-
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
654
|
-
dispose = value[Symbol.dispose];
|
|
655
|
-
}
|
|
656
|
-
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
657
|
-
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
658
|
-
}
|
|
659
|
-
else if (async) {
|
|
660
|
-
env.stack.push({ async: true });
|
|
661
|
-
}
|
|
662
|
-
return value;
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
666
|
-
var e = new Error(message);
|
|
667
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
668
|
-
};
|
|
669
|
-
|
|
670
|
-
function __disposeResources(env) {
|
|
671
|
-
function fail(e) {
|
|
672
|
-
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
673
|
-
env.hasError = true;
|
|
674
|
-
}
|
|
675
|
-
function next() {
|
|
676
|
-
while (env.stack.length) {
|
|
677
|
-
var rec = env.stack.pop();
|
|
678
|
-
try {
|
|
679
|
-
var result = rec.dispose && rec.dispose.call(rec.value);
|
|
680
|
-
if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
681
|
-
}
|
|
682
|
-
catch (e) {
|
|
683
|
-
fail(e);
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
if (env.hasError) throw env.error;
|
|
687
|
-
}
|
|
688
|
-
return next();
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
var tslib_es6 = {
|
|
692
|
-
__extends: __extends,
|
|
693
|
-
__assign: __assign,
|
|
694
|
-
__rest: __rest,
|
|
695
|
-
__decorate: __decorate,
|
|
696
|
-
__param: __param,
|
|
697
|
-
__metadata: __metadata,
|
|
698
|
-
__awaiter: __awaiter,
|
|
699
|
-
__generator: __generator,
|
|
700
|
-
__createBinding: __createBinding,
|
|
701
|
-
__exportStar: __exportStar,
|
|
702
|
-
__values: __values,
|
|
703
|
-
__read: __read,
|
|
704
|
-
__spread: __spread,
|
|
705
|
-
__spreadArrays: __spreadArrays,
|
|
706
|
-
__spreadArray: __spreadArray,
|
|
707
|
-
__await: __await,
|
|
708
|
-
__asyncGenerator: __asyncGenerator,
|
|
709
|
-
__asyncDelegator: __asyncDelegator,
|
|
710
|
-
__asyncValues: __asyncValues,
|
|
711
|
-
__makeTemplateObject: __makeTemplateObject,
|
|
712
|
-
__importStar: __importStar,
|
|
713
|
-
__importDefault: __importDefault,
|
|
714
|
-
__classPrivateFieldGet: __classPrivateFieldGet,
|
|
715
|
-
__classPrivateFieldSet: __classPrivateFieldSet,
|
|
716
|
-
__classPrivateFieldIn: __classPrivateFieldIn,
|
|
717
|
-
__addDisposableResource: __addDisposableResource,
|
|
718
|
-
__disposeResources: __disposeResources,
|
|
719
|
-
};
|
|
720
|
-
|
|
721
351
|
/** 跳转系统蓝牙设置页 */
|
|
722
352
|
const openSystemBluetoothSetting = /* @__PURE__ */ temporarilyNotSupport('openSystemBluetoothSetting');
|
|
723
353
|
/** 跳转系统微信授权管理页 */
|
|
@@ -766,7 +396,7 @@ const getSystemSetting = () => {
|
|
|
766
396
|
};
|
|
767
397
|
/** 获取设备设置 */
|
|
768
398
|
const getDeviceInfo = () => {
|
|
769
|
-
|
|
399
|
+
var _a, _b;
|
|
770
400
|
const info = {
|
|
771
401
|
/** 应用二进制接口类型(仅 Android 支持) */
|
|
772
402
|
abi: '',
|
|
@@ -775,13 +405,13 @@ const getDeviceInfo = () => {
|
|
|
775
405
|
/** 设备性能等级(仅Android小游戏)。取值为:-2 或 0(该设备无法运行小游戏),-1(性能未知),>=1(设备性能值,该值越高,设备性能越好,目前最高不到50) */
|
|
776
406
|
benchmarkLevel: -1,
|
|
777
407
|
/** 设备品牌 */
|
|
778
|
-
brand:
|
|
408
|
+
brand: platform.manufacturer || 'unknown',
|
|
779
409
|
/** 设备型号 */
|
|
780
|
-
model:
|
|
410
|
+
model: platform.product || 'unknown',
|
|
781
411
|
/** 操作系统及版本 */
|
|
782
|
-
system:
|
|
412
|
+
system: ((_a = platform.os) === null || _a === void 0 ? void 0 : _a.toString()) || 'unknown',
|
|
783
413
|
/** 客户端平台 */
|
|
784
|
-
platform:
|
|
414
|
+
platform: ((_b = platform.os) === null || _b === void 0 ? void 0 : _b.family) || 'unknown',
|
|
785
415
|
/** 设备二进制接口类型(仅 Android 支持) */
|
|
786
416
|
CPUType: '',
|
|
787
417
|
};
|
|
@@ -874,7 +504,7 @@ const getSystemInfoSync = () => {
|
|
|
874
504
|
return info;
|
|
875
505
|
};
|
|
876
506
|
/** 获取系统信息 */
|
|
877
|
-
const getSystemInfoAsync = (options = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
507
|
+
const getSystemInfoAsync = (options = {}) => tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
878
508
|
const { success, fail, complete } = options;
|
|
879
509
|
const handle = new MethodHandler({ name: 'getSystemInfoAsync', success, fail, complete });
|
|
880
510
|
try {
|
|
@@ -888,7 +518,7 @@ const getSystemInfoAsync = (options = {}) => __awaiter(void 0, void 0, void 0, f
|
|
|
888
518
|
}
|
|
889
519
|
});
|
|
890
520
|
/** 获取系统信息 */
|
|
891
|
-
const getSystemInfo = (options = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
521
|
+
const getSystemInfo = (options = {}) => tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
892
522
|
const { success, fail, complete } = options;
|
|
893
523
|
const handle = new MethodHandler({ name: 'getSystemInfo', success, fail, complete });
|
|
894
524
|
try {
|
|
@@ -1066,7 +696,7 @@ const env = {
|
|
|
1066
696
|
TARO_VERSION: process.env.TARO_VERSION,
|
|
1067
697
|
};
|
|
1068
698
|
// Note: 该方法由 taro-plugin-platform-h5 实现
|
|
1069
|
-
|
|
699
|
+
|
|
1070
700
|
function arrayBufferToBase64(arrayBuffer) {
|
|
1071
701
|
return base64Js.fromByteArray(arrayBuffer);
|
|
1072
702
|
}
|
|
@@ -1078,7 +708,10 @@ const TextBaseLineMap = {
|
|
|
1078
708
|
top: 'top',
|
|
1079
709
|
bottom: 'bottom',
|
|
1080
710
|
middle: 'middle',
|
|
1081
|
-
normal: 'alphabetic'
|
|
711
|
+
normal: 'alphabetic',
|
|
712
|
+
hanging: 'hanging',
|
|
713
|
+
alphabetic: 'alphabetic',
|
|
714
|
+
ideographic: 'ideographic'
|
|
1082
715
|
};
|
|
1083
716
|
class CanvasContext {
|
|
1084
717
|
constructor(canvas, ctx) {
|
|
@@ -1169,7 +802,7 @@ class CanvasContext {
|
|
|
1169
802
|
* @todo 每次 draw 都会读取 width 和 height
|
|
1170
803
|
*/
|
|
1171
804
|
draw(reserve, callback) {
|
|
1172
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
805
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
1173
806
|
try {
|
|
1174
807
|
if (!reserve) {
|
|
1175
808
|
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
|
@@ -1477,7 +1110,7 @@ const checkIsOpenAccessibility = /* @__PURE__ */ temporarilyNotSupport('checkIsO
|
|
|
1477
1110
|
// 电量
|
|
1478
1111
|
// Note: 浏览器标准下不支持,其他实现方案不准确,不建议开发者使用
|
|
1479
1112
|
const getBatteryInfoSync = /* @__PURE__ */ permanentlyNotSupport('getBatteryInfoSync');
|
|
1480
|
-
const getBatteryInfo = ({ success, fail, complete } = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1113
|
+
const getBatteryInfo = ({ success, fail, complete } = {}) => tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
1481
1114
|
var _a;
|
|
1482
1115
|
const handle = new MethodHandler({ name: 'getBatteryInfo', success, fail, complete });
|
|
1483
1116
|
try {
|
|
@@ -1860,7 +1493,7 @@ document.addEventListener('copy', () => {
|
|
|
1860
1493
|
/**
|
|
1861
1494
|
* 设置系统剪贴板的内容
|
|
1862
1495
|
*/
|
|
1863
|
-
const setClipboardData = ({ data, success, fail, complete }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1496
|
+
const setClipboardData = ({ data, success, fail, complete }) => tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
1864
1497
|
const handle = new MethodHandler({ name: 'setClipboardData', success, fail, complete });
|
|
1865
1498
|
try {
|
|
1866
1499
|
setStorageSync(CLIPBOARD_STORAGE_NAME, data);
|
|
@@ -1894,7 +1527,7 @@ const setClipboardData = ({ data, success, fail, complete }) => __awaiter(void 0
|
|
|
1894
1527
|
/**
|
|
1895
1528
|
* 获取系统剪贴板的内容
|
|
1896
1529
|
*/
|
|
1897
|
-
const getClipboardData = ({ success, fail, complete } = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1530
|
+
const getClipboardData = ({ success, fail, complete } = {}) => tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
1898
1531
|
const handle = new MethodHandler({ name: 'getClipboardData', success, fail, complete });
|
|
1899
1532
|
try {
|
|
1900
1533
|
const data = getStorageSync(CLIPBOARD_STORAGE_NAME);
|
|
@@ -2130,7 +1763,7 @@ const getNetworkType = (options = {}) => {
|
|
|
2130
1763
|
return handle.success({ networkType });
|
|
2131
1764
|
};
|
|
2132
1765
|
const networkStatusManager = new CallbackManager();
|
|
2133
|
-
const networkStatusListener = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
1766
|
+
const networkStatusListener = () => tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
2134
1767
|
const { networkType } = yield getNetworkType();
|
|
2135
1768
|
const isConnected = networkType !== 'none';
|
|
2136
1769
|
const obj = { isConnected, networkType };
|
|
@@ -2374,14 +2007,14 @@ function styleInject(css, ref) {
|
|
|
2374
2007
|
}
|
|
2375
2008
|
}
|
|
2376
2009
|
|
|
2377
|
-
var css_248z = ".taro_choose_location
|
|
2378
|
-
var stylesheet=".taro_choose_location
|
|
2010
|
+
var css_248z = ".taro_choose_location{background-color:#fff;display:flex;flex-direction:column;height:100%;position:fixed;top:100%;transition:top .3s ease;width:100%;z-index:1}.taro_choose_location_bar{background-color:#ededed;color:#090909;display:flex;flex:0 95px;height:95px}.taro_choose_location_back{flex:0 45px;height:30px;margin-top:30px;position:relative;width:33px}.taro_choose_location_back:before{border:15px solid transparent;border-right-color:#090909;content:\"\";display:block;height:0;left:0;position:absolute;top:0;width:0}.taro_choose_location_back:after{border:15px solid transparent;border-right-color:#ededed;content:\"\";display:block;height:0;left:3px;position:absolute;top:0;width:0}.taro_choose_location_title{flex:1;line-height:95px;padding-left:30px}.taro_choose_location_submit{background-color:#08bf62;border:none;color:#fff;font-size:28px;height:60px;line-height:60px;margin:18px 30px 0 0;padding:0;width:110px}.taro_choose_location_frame{flex:1}";
|
|
2011
|
+
var stylesheet=".taro_choose_location{background-color:#fff;display:flex;flex-direction:column;height:100%;position:fixed;top:100%;transition:top .3s ease;width:100%;z-index:1}.taro_choose_location_bar{background-color:#ededed;color:#090909;display:flex;flex:0 95px;height:95px}.taro_choose_location_back{flex:0 45px;height:30px;margin-top:30px;position:relative;width:33px}.taro_choose_location_back:before{border:15px solid transparent;border-right-color:#090909;content:\"\";display:block;height:0;left:0;position:absolute;top:0;width:0}.taro_choose_location_back:after{border:15px solid transparent;border-right-color:#ededed;content:\"\";display:block;height:0;left:3px;position:absolute;top:0;width:0}.taro_choose_location_title{flex:1;line-height:95px;padding-left:30px}.taro_choose_location_submit{background-color:#08bf62;border:none;color:#fff;font-size:28px;height:60px;line-height:60px;margin:18px 30px 0 0;padding:0;width:110px}.taro_choose_location_frame{flex:1}";
|
|
2379
2012
|
styleInject(css_248z,{"insertAt":"top"});
|
|
2380
2013
|
|
|
2381
2014
|
let container = null;
|
|
2382
2015
|
function createLocationChooser(handler, key = LOCATION_APIKEY, mapOpt = {}) {
|
|
2383
2016
|
var _a, _b, _c;
|
|
2384
|
-
const { latitude, longitude } = mapOpt, opts = __rest(mapOpt, ["latitude", "longitude"]);
|
|
2017
|
+
const { latitude, longitude } = mapOpt, opts = tslib.__rest(mapOpt, ["latitude", "longitude"]);
|
|
2385
2018
|
const query = Object.assign({ key, type: 1, coord: ((_a = mapOpt.coord) !== null && _a !== void 0 ? _a : [latitude, longitude].every(e => Number(e) >= 0)) ? `${latitude},${longitude}` : undefined, referer: 'myapp' }, opts);
|
|
2386
2019
|
if (!container) {
|
|
2387
2020
|
const html = `
|
|
@@ -2788,7 +2421,7 @@ const getImageInfo = (options) => {
|
|
|
2788
2421
|
/**
|
|
2789
2422
|
* 在新页面中全屏预览图片。预览的过程中用户可以进行保存图片、发送给朋友等操作。
|
|
2790
2423
|
*/
|
|
2791
|
-
const previewImage = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2424
|
+
const previewImage = (options) => tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
2792
2425
|
// TODO 改为通过 window.__taroAppConfig 获取配置的 Swiper 插件创建节点
|
|
2793
2426
|
components.defineCustomElementTaroSwiperCore();
|
|
2794
2427
|
components.defineCustomElementTaroSwiperItemCore();
|
|
@@ -3155,7 +2788,7 @@ const setBackgroundColor = /* @__PURE__ */ temporarilyNotSupport('setBackgroundC
|
|
|
3155
2788
|
const nextTick = Taro.nextTick;
|
|
3156
2789
|
|
|
3157
2790
|
// 字体
|
|
3158
|
-
const loadFontFace = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2791
|
+
const loadFontFace = (options) => tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
3159
2792
|
options = Object.assign({ global: false }, options);
|
|
3160
2793
|
const { success, fail, complete, family, source, desc = {} } = options;
|
|
3161
2794
|
const handle = new MethodHandler({ name: 'loadFontFace', success, fail, complete });
|
|
@@ -3874,7 +3507,7 @@ const hideLoading = ({ noConflict = false, success, fail, complete } = {}) => {
|
|
|
3874
3507
|
toast.hide(0, noConflict ? 'loading' : '');
|
|
3875
3508
|
return handle.success();
|
|
3876
3509
|
};
|
|
3877
|
-
const showModal = (options = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
3510
|
+
const showModal = (options = {}) => tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
3878
3511
|
init(document);
|
|
3879
3512
|
options = Object.assign({
|
|
3880
3513
|
title: '',
|
|
@@ -3968,7 +3601,7 @@ function hideModal() {
|
|
|
3968
3601
|
return;
|
|
3969
3602
|
modal.hide();
|
|
3970
3603
|
}
|
|
3971
|
-
const showActionSheet = (options = { itemList: [] }, methodName = 'showActionSheet') => __awaiter(void 0, void 0, void 0, function* () {
|
|
3604
|
+
const showActionSheet = (options = { itemList: [] }, methodName = 'showActionSheet') => tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
3972
3605
|
init(document);
|
|
3973
3606
|
options = Object.assign({
|
|
3974
3607
|
itemColor: '#000000',
|
|
@@ -4063,7 +3696,7 @@ function setNavigationBarTitle(options) {
|
|
|
4063
3696
|
})
|
|
4064
3697
|
});
|
|
4065
3698
|
}
|
|
4066
|
-
|
|
3699
|
+
router.setTitle(title);
|
|
4067
3700
|
return handle.success();
|
|
4068
3701
|
}
|
|
4069
3702
|
/**
|
|
@@ -4507,7 +4140,7 @@ const checkIsPictureInPictureActive = /* @__PURE__ */ temporarilyNotSupport('che
|
|
|
4507
4140
|
*/
|
|
4508
4141
|
const chooseMedia = function (options, methodName = 'chooseMedia') {
|
|
4509
4142
|
var _a;
|
|
4510
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
4143
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
4511
4144
|
// options must be an Object
|
|
4512
4145
|
const isObject = shouldBeObject(options);
|
|
4513
4146
|
if (!isObject.flag) {
|
|
@@ -4548,8 +4181,7 @@ const chooseMedia = function (options, methodName = 'chooseMedia') {
|
|
|
4548
4181
|
el.removeAttribute('multiple');
|
|
4549
4182
|
}
|
|
4550
4183
|
// Note: Input 仅在移动端支持 capture 属性,可以使用 getUserMedia 替代(暂不考虑)
|
|
4551
|
-
|
|
4552
|
-
if (md.mobile()) {
|
|
4184
|
+
if (isMobile.isMobile()) {
|
|
4553
4185
|
if (sourceType.length > 1 || sourceType.length < 1) {
|
|
4554
4186
|
try {
|
|
4555
4187
|
const { tapIndex } = yield showActionSheet({
|
|
@@ -4584,12 +4216,12 @@ const chooseMedia = function (options, methodName = 'chooseMedia') {
|
|
|
4584
4216
|
return;
|
|
4585
4217
|
document.body.appendChild(el);
|
|
4586
4218
|
el.onchange = function (e) {
|
|
4587
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
4219
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
4588
4220
|
const target = e.target;
|
|
4589
4221
|
if (target) {
|
|
4590
4222
|
const files = target.files || [];
|
|
4591
4223
|
const arr = [...files];
|
|
4592
|
-
yield Promise.all(arr.map((item) => __awaiter(this, void 0, void 0, function* () {
|
|
4224
|
+
yield Promise.all(arr.map((item) => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
4593
4225
|
var _a;
|
|
4594
4226
|
try {
|
|
4595
4227
|
(_a = res.tempFiles) === null || _a === void 0 ? void 0 : _a.push(yield loadMedia(item));
|
|
@@ -4714,7 +4346,7 @@ const chooseImage = function (options) {
|
|
|
4714
4346
|
return Promise.reject(res);
|
|
4715
4347
|
}
|
|
4716
4348
|
let camera = 'back';
|
|
4717
|
-
const { sourceType = ['album', 'camera'], success, complete, fail } = options, args = __rest(options, ["sourceType", "success", "complete", "fail"]);
|
|
4349
|
+
const { sourceType = ['album', 'camera'], success, complete, fail } = options, args = tslib.__rest(options, ["sourceType", "success", "complete", "fail"]);
|
|
4718
4350
|
if (sourceType.includes('camera') && sourceType.indexOf('user') > -1) {
|
|
4719
4351
|
camera = 'front';
|
|
4720
4352
|
}
|
|
@@ -4787,7 +4419,7 @@ const saveVideoToPhotosAlbum = (options) => {
|
|
|
4787
4419
|
};
|
|
4788
4420
|
|
|
4789
4421
|
const getVideoInfo = function (options) {
|
|
4790
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
4422
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
4791
4423
|
// options must be an Object
|
|
4792
4424
|
const isObject = shouldBeObject(options);
|
|
4793
4425
|
if (!isObject.flag) {
|
|
@@ -4825,7 +4457,7 @@ const getVideoInfo = function (options) {
|
|
|
4825
4457
|
res.height = video.videoHeight;
|
|
4826
4458
|
res.width = video.videoWidth;
|
|
4827
4459
|
fetch(src)
|
|
4828
|
-
.then((e) => __awaiter(this, void 0, void 0, function* () {
|
|
4460
|
+
.then((e) => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
4829
4461
|
const blob = yield e.blob();
|
|
4830
4462
|
res.type = blob.type;
|
|
4831
4463
|
res.size = blob.size;
|
|
@@ -5149,7 +4781,7 @@ function _request(options = {}) {
|
|
|
5149
4781
|
const { success, complete, fail } = options;
|
|
5150
4782
|
const params = {};
|
|
5151
4783
|
const res = {};
|
|
5152
|
-
let { cache = 'default', credentials, data, dataType, header = {}, jsonp, method = 'GET', mode, responseType, signal, timeout = 60000, url = '' } = options, opts = __rest(options, ["cache", "credentials", "data", "dataType", "header", "jsonp", "method", "mode", "responseType", "signal", "timeout", "url"]);
|
|
4784
|
+
let { cache = 'default', credentials, data, dataType, header = {}, jsonp, method = 'GET', mode, responseType, signal, timeout = 60000, url = '' } = options, opts = tslib.__rest(options, ["cache", "credentials", "data", "dataType", "header", "jsonp", "method", "mode", "responseType", "signal", "timeout", "url"]);
|
|
5153
4785
|
Object.assign(params, opts);
|
|
5154
4786
|
if (jsonp) {
|
|
5155
4787
|
// @ts-ignore
|
|
@@ -5208,23 +4840,30 @@ function _request(options = {}) {
|
|
|
5208
4840
|
params.mode = mode;
|
|
5209
4841
|
}
|
|
5210
4842
|
let timeoutTimer = null;
|
|
4843
|
+
let controller = null;
|
|
5211
4844
|
if (signal) {
|
|
5212
4845
|
params.signal = signal;
|
|
5213
4846
|
}
|
|
5214
|
-
else
|
|
5215
|
-
|
|
4847
|
+
else {
|
|
4848
|
+
controller = new window.AbortController();
|
|
5216
4849
|
params.signal = controller.signal;
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
4850
|
+
if (typeof timeout === 'number') {
|
|
4851
|
+
timeoutTimer = setTimeout(function () {
|
|
4852
|
+
if (controller)
|
|
4853
|
+
controller.abort();
|
|
4854
|
+
}, timeout);
|
|
4855
|
+
}
|
|
5220
4856
|
}
|
|
5221
4857
|
params.credentials = credentials;
|
|
5222
|
-
|
|
4858
|
+
const p = fetch(url, params)
|
|
5223
4859
|
.then(response => {
|
|
5224
4860
|
if (timeoutTimer) {
|
|
5225
4861
|
clearTimeout(timeoutTimer);
|
|
5226
4862
|
timeoutTimer = null;
|
|
5227
4863
|
}
|
|
4864
|
+
if (controller) {
|
|
4865
|
+
controller = null;
|
|
4866
|
+
}
|
|
5228
4867
|
if (!response) {
|
|
5229
4868
|
const errorResponse = { ok: false };
|
|
5230
4869
|
throw errorResponse;
|
|
@@ -5260,12 +4899,28 @@ function _request(options = {}) {
|
|
|
5260
4899
|
clearTimeout(timeoutTimer);
|
|
5261
4900
|
timeoutTimer = null;
|
|
5262
4901
|
}
|
|
4902
|
+
if (controller) {
|
|
4903
|
+
controller = null;
|
|
4904
|
+
}
|
|
5263
4905
|
shared.isFunction(fail) && fail(err);
|
|
5264
4906
|
shared.isFunction(complete) && complete(res);
|
|
5265
4907
|
err.statusCode = res.statusCode;
|
|
5266
4908
|
err.errMsg = err.message;
|
|
5267
4909
|
return Promise.reject(err);
|
|
5268
4910
|
});
|
|
4911
|
+
if (!p.abort && controller) {
|
|
4912
|
+
p.abort = cb => {
|
|
4913
|
+
if (controller) {
|
|
4914
|
+
cb && cb();
|
|
4915
|
+
controller.abort();
|
|
4916
|
+
if (timeoutTimer) {
|
|
4917
|
+
clearTimeout(timeoutTimer);
|
|
4918
|
+
timeoutTimer = null;
|
|
4919
|
+
}
|
|
4920
|
+
}
|
|
4921
|
+
};
|
|
4922
|
+
}
|
|
4923
|
+
return p;
|
|
5269
4924
|
}
|
|
5270
4925
|
function taroInterceptor(chain) {
|
|
5271
4926
|
return _request(chain.requestParams);
|
|
@@ -5673,6 +5328,14 @@ const requestOrderPayment = /* @__PURE__ */ temporarilyNotSupport('requestOrderP
|
|
|
5673
5328
|
|
|
5674
5329
|
// 打开手Q说说发表界面
|
|
5675
5330
|
const openQzonePublish = /* @__PURE__ */ temporarilyNotSupport('openQzonePublish');
|
|
5331
|
+
const getQQRunData = /* @__PURE__ */ temporarilyNotSupport('getQQRunData');
|
|
5332
|
+
const setOfficialDress = /* @__PURE__ */ temporarilyNotSupport('setOfficialDress');
|
|
5333
|
+
const setCustomDress = /* @__PURE__ */ temporarilyNotSupport('setCustomDress');
|
|
5334
|
+
const updateQQApp = /* @__PURE__ */ temporarilyNotSupport('updateQQApp');
|
|
5335
|
+
const addRecentColorSign = /* @__PURE__ */ temporarilyNotSupport('addRecentColorSign');
|
|
5336
|
+
const getGuildInfo = /* @__PURE__ */ temporarilyNotSupport('getGuildInfo');
|
|
5337
|
+
const applyAddToMyApps = /* @__PURE__ */ temporarilyNotSupport('applyAddToMyApps');
|
|
5338
|
+
const isAddedToMyApps = /* @__PURE__ */ temporarilyNotSupport('isAddedToMyApps');
|
|
5676
5339
|
|
|
5677
5340
|
// 路由
|
|
5678
5341
|
// FIXME 方法导出类型未对齐,后续修复
|
|
@@ -5728,7 +5391,6 @@ const preloadSubPackage = /* @__PURE__ */ temporarilyNotSupport('preloadSubPacka
|
|
|
5728
5391
|
// Worker
|
|
5729
5392
|
const createWorker = /* @__PURE__ */ temporarilyNotSupport('createWorker');
|
|
5730
5393
|
|
|
5731
|
-
import('intersection-observer');
|
|
5732
5394
|
class TaroH5IntersectionObserver {
|
|
5733
5395
|
// selector 的容器节点
|
|
5734
5396
|
get container() {
|
|
@@ -6275,15 +5937,18 @@ exports.Current = Current;
|
|
|
6275
5937
|
exports.ENV_TYPE = ENV_TYPE;
|
|
6276
5938
|
exports.Events = Events;
|
|
6277
5939
|
exports.Link = Link;
|
|
5940
|
+
exports.NodesRef = NodesRef;
|
|
6278
5941
|
exports.addCard = addCard;
|
|
6279
5942
|
exports.addFileToFavorites = addFileToFavorites;
|
|
6280
5943
|
exports.addInterceptor = addInterceptor;
|
|
6281
5944
|
exports.addPhoneCalendar = addPhoneCalendar;
|
|
6282
5945
|
exports.addPhoneContact = addPhoneContact;
|
|
6283
5946
|
exports.addPhoneRepeatCalendar = addPhoneRepeatCalendar;
|
|
5947
|
+
exports.addRecentColorSign = addRecentColorSign;
|
|
6284
5948
|
exports.addVideoToFavorites = addVideoToFavorites;
|
|
6285
5949
|
exports.advancedGeneralIdentify = advancedGeneralIdentify;
|
|
6286
5950
|
exports.animalClassify = animalClassify;
|
|
5951
|
+
exports.applyAddToMyApps = applyAddToMyApps;
|
|
6287
5952
|
exports.arrayBufferToBase64 = arrayBufferToBase64;
|
|
6288
5953
|
exports.authPrivateMessage = authPrivateMessage;
|
|
6289
5954
|
exports.authorize = authorize;
|
|
@@ -6406,6 +6071,7 @@ exports.getFileInfo = getFileInfo;
|
|
|
6406
6071
|
exports.getFileSystemManager = getFileSystemManager;
|
|
6407
6072
|
exports.getFuzzyLocation = getFuzzyLocation;
|
|
6408
6073
|
exports.getGroupEnterInfo = getGroupEnterInfo;
|
|
6074
|
+
exports.getGuildInfo = getGuildInfo;
|
|
6409
6075
|
exports.getHCEState = getHCEState;
|
|
6410
6076
|
exports.getImageInfo = getImageInfo;
|
|
6411
6077
|
exports.getInferenceEnvInfo = getInferenceEnvInfo;
|
|
@@ -6419,6 +6085,7 @@ exports.getNetworkType = getNetworkType;
|
|
|
6419
6085
|
exports.getOpenUserInfo = getOpenUserInfo;
|
|
6420
6086
|
exports.getPerformance = getPerformance;
|
|
6421
6087
|
exports.getPrivacySetting = getPrivacySetting;
|
|
6088
|
+
exports.getQQRunData = getQQRunData;
|
|
6422
6089
|
exports.getRandomValues = getRandomValues;
|
|
6423
6090
|
exports.getRealtimeLogManager = getRealtimeLogManager;
|
|
6424
6091
|
exports.getRecorderManager = getRecorderManager;
|
|
@@ -6463,6 +6130,7 @@ exports.initPxTransform = initPxTransform;
|
|
|
6463
6130
|
exports.initTabBarApis = initTabBarApis;
|
|
6464
6131
|
exports.interceptorify = interceptorify;
|
|
6465
6132
|
exports.interceptors = interceptors;
|
|
6133
|
+
exports.isAddedToMyApps = isAddedToMyApps;
|
|
6466
6134
|
exports.isBluetoothDevicePaired = isBluetoothDevicePaired;
|
|
6467
6135
|
exports.isVKSupport = isVKSupport;
|
|
6468
6136
|
exports.join1v1Chat = join1v1Chat;
|
|
@@ -6649,12 +6317,14 @@ exports.setBackgroundColor = setBackgroundColor;
|
|
|
6649
6317
|
exports.setBackgroundFetchToken = setBackgroundFetchToken;
|
|
6650
6318
|
exports.setBackgroundTextStyle = setBackgroundTextStyle;
|
|
6651
6319
|
exports.setClipboardData = setClipboardData;
|
|
6320
|
+
exports.setCustomDress = setCustomDress;
|
|
6652
6321
|
exports.setEnable1v1Chat = setEnable1v1Chat;
|
|
6653
6322
|
exports.setEnableDebug = setEnableDebug;
|
|
6654
6323
|
exports.setInnerAudioOption = setInnerAudioOption;
|
|
6655
6324
|
exports.setKeepScreenOn = setKeepScreenOn;
|
|
6656
6325
|
exports.setNavigationBarColor = setNavigationBarColor;
|
|
6657
6326
|
exports.setNavigationBarTitle = setNavigationBarTitle;
|
|
6327
|
+
exports.setOfficialDress = setOfficialDress;
|
|
6658
6328
|
exports.setPageInfo = setPageInfo;
|
|
6659
6329
|
exports.setScreenBrightness = setScreenBrightness;
|
|
6660
6330
|
exports.setStorage = setStorage;
|
|
@@ -6714,6 +6384,7 @@ exports.subscribeVoIPVideoMembers = subscribeVoIPVideoMembers;
|
|
|
6714
6384
|
exports.textReview = textReview;
|
|
6715
6385
|
exports.textToAudio = textToAudio;
|
|
6716
6386
|
exports.tradePay = tradePay;
|
|
6387
|
+
exports.updateQQApp = updateQQApp;
|
|
6717
6388
|
exports.updateShareMenu = updateShareMenu;
|
|
6718
6389
|
exports.updateVoIPChatMuteConfig = updateVoIPChatMuteConfig;
|
|
6719
6390
|
exports.updateWeChatApp = updateWeChatApp;
|