@tarojs/taro-h5 3.6.22 → 3.6.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/api/base/system.js +1 -1
  2. package/dist/api/canvas/CanvasContext.js +5 -2
  3. package/dist/api/canvas/CanvasContext.js.map +1 -1
  4. package/dist/api/device/battery.js +1 -1
  5. package/dist/api/device/clipboard.js +1 -1
  6. package/dist/api/device/network.js +1 -1
  7. package/dist/api/index.js +2 -1
  8. package/dist/api/index.js.map +1 -1
  9. package/dist/api/location/chooseLocation.js +1 -1
  10. package/dist/api/location/style.scss.js +2 -6
  11. package/dist/api/location/style.scss.js.map +1 -1
  12. package/dist/api/media/image/chooseImage.js +1 -1
  13. package/dist/api/media/image/previewImage.js +1 -1
  14. package/dist/api/media/video/chooseMedia.js +1 -1
  15. package/dist/api/media/video/getVideoInfo.js +1 -1
  16. package/dist/api/network/request/index.js +31 -6
  17. package/dist/api/network/request/index.js.map +1 -1
  18. package/dist/api/qq/index.d.ts +9 -1
  19. package/dist/api/qq/index.js +9 -1
  20. package/dist/api/qq/index.js.map +1 -1
  21. package/dist/api/ui/fonts.js +1 -1
  22. package/dist/api/ui/interaction/index.js +1 -1
  23. package/dist/api/ui/navigation-bar/index.js +1 -1
  24. package/dist/api/ui/navigation-bar/index.js.map +1 -1
  25. package/dist/api/wxml/IntersectionObserver.js +0 -1
  26. package/dist/api/wxml/IntersectionObserver.js.map +1 -1
  27. package/dist/api/wxml/index.d.ts +2 -1
  28. package/dist/api/wxml/index.js +1 -0
  29. package/dist/api/wxml/index.js.map +1 -1
  30. package/dist/index.cjs.css +1 -0
  31. package/dist/index.cjs.d.ts +42 -1
  32. package/dist/index.cjs.js +73 -354
  33. package/dist/index.cjs.js.map +1 -1
  34. package/dist/index.css +1 -0
  35. package/dist/index.esm.css +1 -0
  36. package/dist/index.esm.d.ts +42 -1
  37. package/dist/index.esm.js +46 -336
  38. package/dist/index.esm.js.map +1 -1
  39. package/dist/index.js +2 -1
  40. package/dist/index.js.map +1 -1
  41. package/dist/utils/index.js +1 -2
  42. package/dist/utils/index.js.map +1 -1
  43. package/package.json +17 -14
  44. package/dist/node_modules/.pnpm/registry.npmjs.org_style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js +0 -29
  45. package/dist/node_modules/.pnpm/registry.npmjs.org_style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js.map +0 -1
  46. package/dist/node_modules/.pnpm/registry.npmjs.org_tslib@2.5.0/node_modules/tslib/tslib.es6.js +0 -296
  47. package/dist/node_modules/.pnpm/registry.npmjs.org_tslib@2.5.0/node_modules/tslib/tslib.es6.js.map +0 -1
package/dist/index.cjs.js CHANGED
@@ -5,9 +5,9 @@ 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');
10
+ var tslib = require('tslib');
11
11
  var platform = require('platform');
12
12
  var isNil = require('lodash-es/isNil');
13
13
  var queryString = require('query-string');
@@ -15,7 +15,6 @@ var throttle = require('lodash-es/throttle');
15
15
  var ics = require('ics');
16
16
  var components = require('@tarojs/components/dist/components');
17
17
  var isMobile = require('is-mobile');
18
- var navigate = require('@tarojs/router/dist/utils/navigate');
19
18
  require('whatwg-fetch');
20
19
  require('abortcontroller-polyfill/dist/abortcontroller-polyfill-only');
21
20
  var jsonpRetry = require('jsonp-retry');
@@ -304,8 +303,8 @@ function processOpenApi({ name, defaultOptions, standardMethod, formatOptions =
304
303
  function getCurrentPath() {
305
304
  var _a, _b, _c, _d, _e, _f;
306
305
  const appConfig = window.__taroAppConfig || {};
307
- const routePath = utils.getCurrentPage((_a = appConfig.router) === null || _a === void 0 ? void 0 : _a.mode, (_b = appConfig.router) === null || _b === void 0 ? void 0 : _b.basename);
308
- const homePath = utils.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);
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);
309
308
  /**
310
309
  * createPageConfig 时根据 stack 的长度来设置 stamp 以保证页面 path 的唯一,此函数是在 createPageConfig 之前调用,预先设置 stamp=1
311
310
  * url 上没有指定应用的启动页面时使用 homePath
@@ -349,300 +348,6 @@ const preloadWebview = /* @__PURE__ */ temporarilyNotSupport('preloadWebview');
349
348
  const preloadSkylineView = /* @__PURE__ */ temporarilyNotSupport('preloadSkylineView');
350
349
  const preloadAssets = /* @__PURE__ */ temporarilyNotSupport('preloadAssets');
351
350
 
352
- /******************************************************************************
353
- Copyright (c) Microsoft Corporation.
354
-
355
- Permission to use, copy, modify, and/or distribute this software for any
356
- purpose with or without fee is hereby granted.
357
-
358
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
359
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
360
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
361
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
362
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
363
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
364
- PERFORMANCE OF THIS SOFTWARE.
365
- ***************************************************************************** */
366
- /* global Reflect, Promise */
367
-
368
- var extendStatics = function(d, b) {
369
- extendStatics = Object.setPrototypeOf ||
370
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
371
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
372
- return extendStatics(d, b);
373
- };
374
-
375
- function __extends(d, b) {
376
- if (typeof b !== "function" && b !== null)
377
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
378
- extendStatics(d, b);
379
- function __() { this.constructor = d; }
380
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
381
- }
382
-
383
- var __assign = function() {
384
- __assign = Object.assign || function __assign(t) {
385
- for (var s, i = 1, n = arguments.length; i < n; i++) {
386
- s = arguments[i];
387
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
388
- }
389
- return t;
390
- };
391
- return __assign.apply(this, arguments);
392
- };
393
-
394
- function __rest(s, e) {
395
- var t = {};
396
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
397
- t[p] = s[p];
398
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
399
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
400
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
401
- t[p[i]] = s[p[i]];
402
- }
403
- return t;
404
- }
405
-
406
- function __decorate(decorators, target, key, desc) {
407
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
408
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
409
- 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;
410
- return c > 3 && r && Object.defineProperty(target, key, r), r;
411
- }
412
-
413
- function __param(paramIndex, decorator) {
414
- return function (target, key) { decorator(target, key, paramIndex); }
415
- }
416
-
417
- function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
418
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
419
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
420
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
421
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
422
- var _, done = false;
423
- for (var i = decorators.length - 1; i >= 0; i--) {
424
- var context = {};
425
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
426
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
427
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
428
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
429
- if (kind === "accessor") {
430
- if (result === void 0) continue;
431
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
432
- if (_ = accept(result.get)) descriptor.get = _;
433
- if (_ = accept(result.set)) descriptor.set = _;
434
- if (_ = accept(result.init)) initializers.push(_);
435
- }
436
- else if (_ = accept(result)) {
437
- if (kind === "field") initializers.push(_);
438
- else descriptor[key] = _;
439
- }
440
- }
441
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
442
- done = true;
443
- };
444
-
445
- function __runInitializers(thisArg, initializers, value) {
446
- var useValue = arguments.length > 2;
447
- for (var i = 0; i < initializers.length; i++) {
448
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
449
- }
450
- return useValue ? value : void 0;
451
- };
452
-
453
- function __propKey(x) {
454
- return typeof x === "symbol" ? x : "".concat(x);
455
- };
456
-
457
- function __setFunctionName(f, name, prefix) {
458
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
459
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
460
- };
461
-
462
- function __metadata(metadataKey, metadataValue) {
463
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
464
- }
465
-
466
- function __awaiter(thisArg, _arguments, P, generator) {
467
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
468
- return new (P || (P = Promise))(function (resolve, reject) {
469
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
470
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
471
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
472
- step((generator = generator.apply(thisArg, _arguments || [])).next());
473
- });
474
- }
475
-
476
- function __generator(thisArg, body) {
477
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
478
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
479
- function verb(n) { return function (v) { return step([n, v]); }; }
480
- function step(op) {
481
- if (f) throw new TypeError("Generator is already executing.");
482
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
483
- 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;
484
- if (y = 0, t) op = [op[0] & 2, t.value];
485
- switch (op[0]) {
486
- case 0: case 1: t = op; break;
487
- case 4: _.label++; return { value: op[1], done: false };
488
- case 5: _.label++; y = op[1]; op = [0]; continue;
489
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
490
- default:
491
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
492
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
493
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
494
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
495
- if (t[2]) _.ops.pop();
496
- _.trys.pop(); continue;
497
- }
498
- op = body.call(thisArg, _);
499
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
500
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
501
- }
502
- }
503
-
504
- var __createBinding = Object.create ? (function(o, m, k, k2) {
505
- if (k2 === undefined) k2 = k;
506
- var desc = Object.getOwnPropertyDescriptor(m, k);
507
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
508
- desc = { enumerable: true, get: function() { return m[k]; } };
509
- }
510
- Object.defineProperty(o, k2, desc);
511
- }) : (function(o, m, k, k2) {
512
- if (k2 === undefined) k2 = k;
513
- o[k2] = m[k];
514
- });
515
-
516
- function __exportStar(m, o) {
517
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
518
- }
519
-
520
- function __values(o) {
521
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
522
- if (m) return m.call(o);
523
- if (o && typeof o.length === "number") return {
524
- next: function () {
525
- if (o && i >= o.length) o = void 0;
526
- return { value: o && o[i++], done: !o };
527
- }
528
- };
529
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
530
- }
531
-
532
- function __read(o, n) {
533
- var m = typeof Symbol === "function" && o[Symbol.iterator];
534
- if (!m) return o;
535
- var i = m.call(o), r, ar = [], e;
536
- try {
537
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
538
- }
539
- catch (error) { e = { error: error }; }
540
- finally {
541
- try {
542
- if (r && !r.done && (m = i["return"])) m.call(i);
543
- }
544
- finally { if (e) throw e.error; }
545
- }
546
- return ar;
547
- }
548
-
549
- /** @deprecated */
550
- function __spread() {
551
- for (var ar = [], i = 0; i < arguments.length; i++)
552
- ar = ar.concat(__read(arguments[i]));
553
- return ar;
554
- }
555
-
556
- /** @deprecated */
557
- function __spreadArrays() {
558
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
559
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
560
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
561
- r[k] = a[j];
562
- return r;
563
- }
564
-
565
- function __spreadArray(to, from, pack) {
566
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
567
- if (ar || !(i in from)) {
568
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
569
- ar[i] = from[i];
570
- }
571
- }
572
- return to.concat(ar || Array.prototype.slice.call(from));
573
- }
574
-
575
- function __await(v) {
576
- return this instanceof __await ? (this.v = v, this) : new __await(v);
577
- }
578
-
579
- function __asyncGenerator(thisArg, _arguments, generator) {
580
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
581
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
582
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
583
- 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); }); }; }
584
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
585
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
586
- function fulfill(value) { resume("next", value); }
587
- function reject(value) { resume("throw", value); }
588
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
589
- }
590
-
591
- function __asyncDelegator(o) {
592
- var i, p;
593
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
594
- 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; }
595
- }
596
-
597
- function __asyncValues(o) {
598
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
599
- var m = o[Symbol.asyncIterator], i;
600
- 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);
601
- 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); }); }; }
602
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
603
- }
604
-
605
- function __makeTemplateObject(cooked, raw) {
606
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
607
- return cooked;
608
- };
609
-
610
- var __setModuleDefault = Object.create ? (function(o, v) {
611
- Object.defineProperty(o, "default", { enumerable: true, value: v });
612
- }) : function(o, v) {
613
- o["default"] = v;
614
- };
615
-
616
- function __importStar(mod) {
617
- if (mod && mod.__esModule) return mod;
618
- var result = {};
619
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
620
- __setModuleDefault(result, mod);
621
- return result;
622
- }
623
-
624
- function __importDefault(mod) {
625
- return (mod && mod.__esModule) ? mod : { default: mod };
626
- }
627
-
628
- function __classPrivateFieldGet(receiver, state, kind, f) {
629
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
630
- 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");
631
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
632
- }
633
-
634
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
635
- if (kind === "m") throw new TypeError("Private method is not writable");
636
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
637
- 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");
638
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
639
- }
640
-
641
- function __classPrivateFieldIn(state, receiver) {
642
- if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
643
- return typeof state === "function" ? receiver === state : state.has(receiver);
644
- }
645
-
646
351
  /** 跳转系统蓝牙设置页 */
647
352
  const openSystemBluetoothSetting = /* @__PURE__ */ temporarilyNotSupport('openSystemBluetoothSetting');
648
353
  /** 跳转系统微信授权管理页 */
@@ -799,7 +504,7 @@ const getSystemInfoSync = () => {
799
504
  return info;
800
505
  };
801
506
  /** 获取系统信息 */
802
- const getSystemInfoAsync = (options = {}) => __awaiter(void 0, void 0, void 0, function* () {
507
+ const getSystemInfoAsync = (options = {}) => tslib.__awaiter(void 0, void 0, void 0, function* () {
803
508
  const { success, fail, complete } = options;
804
509
  const handle = new MethodHandler({ name: 'getSystemInfoAsync', success, fail, complete });
805
510
  try {
@@ -813,7 +518,7 @@ const getSystemInfoAsync = (options = {}) => __awaiter(void 0, void 0, void 0, f
813
518
  }
814
519
  });
815
520
  /** 获取系统信息 */
816
- const getSystemInfo = (options = {}) => __awaiter(void 0, void 0, void 0, function* () {
521
+ const getSystemInfo = (options = {}) => tslib.__awaiter(void 0, void 0, void 0, function* () {
817
522
  const { success, fail, complete } = options;
818
523
  const handle = new MethodHandler({ name: 'getSystemInfo', success, fail, complete });
819
524
  try {
@@ -1003,7 +708,10 @@ const TextBaseLineMap = {
1003
708
  top: 'top',
1004
709
  bottom: 'bottom',
1005
710
  middle: 'middle',
1006
- normal: 'alphabetic'
711
+ normal: 'alphabetic',
712
+ hanging: 'hanging',
713
+ alphabetic: 'alphabetic',
714
+ ideographic: 'ideographic'
1007
715
  };
1008
716
  class CanvasContext {
1009
717
  constructor(canvas, ctx) {
@@ -1094,7 +802,7 @@ class CanvasContext {
1094
802
  * @todo 每次 draw 都会读取 width 和 height
1095
803
  */
1096
804
  draw(reserve, callback) {
1097
- return __awaiter(this, void 0, void 0, function* () {
805
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1098
806
  try {
1099
807
  if (!reserve) {
1100
808
  this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
@@ -1402,7 +1110,7 @@ const checkIsOpenAccessibility = /* @__PURE__ */ temporarilyNotSupport('checkIsO
1402
1110
  // 电量
1403
1111
  // Note: 浏览器标准下不支持,其他实现方案不准确,不建议开发者使用
1404
1112
  const getBatteryInfoSync = /* @__PURE__ */ permanentlyNotSupport('getBatteryInfoSync');
1405
- 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* () {
1406
1114
  var _a;
1407
1115
  const handle = new MethodHandler({ name: 'getBatteryInfo', success, fail, complete });
1408
1116
  try {
@@ -1785,7 +1493,7 @@ document.addEventListener('copy', () => {
1785
1493
  /**
1786
1494
  * 设置系统剪贴板的内容
1787
1495
  */
1788
- 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* () {
1789
1497
  const handle = new MethodHandler({ name: 'setClipboardData', success, fail, complete });
1790
1498
  try {
1791
1499
  setStorageSync(CLIPBOARD_STORAGE_NAME, data);
@@ -1819,7 +1527,7 @@ const setClipboardData = ({ data, success, fail, complete }) => __awaiter(void 0
1819
1527
  /**
1820
1528
  * 获取系统剪贴板的内容
1821
1529
  */
1822
- 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* () {
1823
1531
  const handle = new MethodHandler({ name: 'getClipboardData', success, fail, complete });
1824
1532
  try {
1825
1533
  const data = getStorageSync(CLIPBOARD_STORAGE_NAME);
@@ -2055,7 +1763,7 @@ const getNetworkType = (options = {}) => {
2055
1763
  return handle.success({ networkType });
2056
1764
  };
2057
1765
  const networkStatusManager = new CallbackManager();
2058
- const networkStatusListener = () => __awaiter(void 0, void 0, void 0, function* () {
1766
+ const networkStatusListener = () => tslib.__awaiter(void 0, void 0, void 0, function* () {
2059
1767
  const { networkType } = yield getNetworkType();
2060
1768
  const isConnected = networkType !== 'none';
2061
1769
  const obj = { isConnected, networkType };
@@ -2272,41 +1980,12 @@ const getLocation = /* @__PURE__ */ processOpenApi({
2272
1980
  standardMethod: getLocationByW3CApi
2273
1981
  });
2274
1982
 
2275
- function styleInject(css, ref) {
2276
- if ( ref === void 0 ) ref = {};
2277
- var insertAt = ref.insertAt;
2278
-
2279
- if (!css || typeof document === 'undefined') { return; }
2280
-
2281
- var head = document.head || document.getElementsByTagName('head')[0];
2282
- var style = document.createElement('style');
2283
- style.type = 'text/css';
2284
-
2285
- if (insertAt === 'top') {
2286
- if (head.firstChild) {
2287
- head.insertBefore(style, head.firstChild);
2288
- } else {
2289
- head.appendChild(style);
2290
- }
2291
- } else {
2292
- head.appendChild(style);
2293
- }
2294
-
2295
- if (style.styleSheet) {
2296
- style.styleSheet.cssText = css;
2297
- } else {
2298
- style.appendChild(document.createTextNode(css));
2299
- }
2300
- }
2301
-
2302
- 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}";
2303
- 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}";
2304
- styleInject(css_248z,{"insertAt":"top"});
1983
+ var undefined$1 = undefined;
2305
1984
 
2306
1985
  let container = null;
2307
1986
  function createLocationChooser(handler, key = LOCATION_APIKEY, mapOpt = {}) {
2308
1987
  var _a, _b, _c;
2309
- const { latitude, longitude } = mapOpt, opts = __rest(mapOpt, ["latitude", "longitude"]);
1988
+ const { latitude, longitude } = mapOpt, opts = tslib.__rest(mapOpt, ["latitude", "longitude"]);
2310
1989
  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);
2311
1990
  if (!container) {
2312
1991
  const html = `
@@ -2713,7 +2392,7 @@ const getImageInfo = (options) => {
2713
2392
  /**
2714
2393
  * 在新页面中全屏预览图片。预览的过程中用户可以进行保存图片、发送给朋友等操作。
2715
2394
  */
2716
- const previewImage = (options) => __awaiter(void 0, void 0, void 0, function* () {
2395
+ const previewImage = (options) => tslib.__awaiter(void 0, void 0, void 0, function* () {
2717
2396
  // TODO 改为通过 window.__taroAppConfig 获取配置的 Swiper 插件创建节点
2718
2397
  components.defineCustomElementTaroSwiperCore();
2719
2398
  components.defineCustomElementTaroSwiperItemCore();
@@ -3080,7 +2759,7 @@ const setBackgroundColor = /* @__PURE__ */ temporarilyNotSupport('setBackgroundC
3080
2759
  const nextTick = Taro.nextTick;
3081
2760
 
3082
2761
  // 字体
3083
- const loadFontFace = (options) => __awaiter(void 0, void 0, void 0, function* () {
2762
+ const loadFontFace = (options) => tslib.__awaiter(void 0, void 0, void 0, function* () {
3084
2763
  options = Object.assign({ global: false }, options);
3085
2764
  const { success, fail, complete, family, source, desc = {} } = options;
3086
2765
  const handle = new MethodHandler({ name: 'loadFontFace', success, fail, complete });
@@ -3799,7 +3478,7 @@ const hideLoading = ({ noConflict = false, success, fail, complete } = {}) => {
3799
3478
  toast.hide(0, noConflict ? 'loading' : '');
3800
3479
  return handle.success();
3801
3480
  };
3802
- const showModal = (options = {}) => __awaiter(void 0, void 0, void 0, function* () {
3481
+ const showModal = (options = {}) => tslib.__awaiter(void 0, void 0, void 0, function* () {
3803
3482
  init(document);
3804
3483
  options = Object.assign({
3805
3484
  title: '',
@@ -3893,7 +3572,7 @@ function hideModal() {
3893
3572
  return;
3894
3573
  modal.hide();
3895
3574
  }
3896
- const showActionSheet = (options = { itemList: [] }, methodName = 'showActionSheet') => __awaiter(void 0, void 0, void 0, function* () {
3575
+ const showActionSheet = (options = { itemList: [] }, methodName = 'showActionSheet') => tslib.__awaiter(void 0, void 0, void 0, function* () {
3897
3576
  init(document);
3898
3577
  options = Object.assign({
3899
3578
  itemColor: '#000000',
@@ -3988,7 +3667,7 @@ function setNavigationBarTitle(options) {
3988
3667
  })
3989
3668
  });
3990
3669
  }
3991
- navigate.setTitle(title);
3670
+ router.setTitle(title);
3992
3671
  return handle.success();
3993
3672
  }
3994
3673
  /**
@@ -4432,7 +4111,7 @@ const checkIsPictureInPictureActive = /* @__PURE__ */ temporarilyNotSupport('che
4432
4111
  */
4433
4112
  const chooseMedia = function (options, methodName = 'chooseMedia') {
4434
4113
  var _a;
4435
- return __awaiter(this, void 0, void 0, function* () {
4114
+ return tslib.__awaiter(this, void 0, void 0, function* () {
4436
4115
  // options must be an Object
4437
4116
  const isObject = shouldBeObject(options);
4438
4117
  if (!isObject.flag) {
@@ -4508,12 +4187,12 @@ const chooseMedia = function (options, methodName = 'chooseMedia') {
4508
4187
  return;
4509
4188
  document.body.appendChild(el);
4510
4189
  el.onchange = function (e) {
4511
- return __awaiter(this, void 0, void 0, function* () {
4190
+ return tslib.__awaiter(this, void 0, void 0, function* () {
4512
4191
  const target = e.target;
4513
4192
  if (target) {
4514
4193
  const files = target.files || [];
4515
4194
  const arr = [...files];
4516
- yield Promise.all(arr.map((item) => __awaiter(this, void 0, void 0, function* () {
4195
+ yield Promise.all(arr.map((item) => tslib.__awaiter(this, void 0, void 0, function* () {
4517
4196
  var _a;
4518
4197
  try {
4519
4198
  (_a = res.tempFiles) === null || _a === void 0 ? void 0 : _a.push(yield loadMedia(item));
@@ -4638,7 +4317,7 @@ const chooseImage = function (options) {
4638
4317
  return Promise.reject(res);
4639
4318
  }
4640
4319
  let camera = 'back';
4641
- const { sourceType = ['album', 'camera'], success, complete, fail } = options, args = __rest(options, ["sourceType", "success", "complete", "fail"]);
4320
+ const { sourceType = ['album', 'camera'], success, complete, fail } = options, args = tslib.__rest(options, ["sourceType", "success", "complete", "fail"]);
4642
4321
  if (sourceType.includes('camera') && sourceType.indexOf('user') > -1) {
4643
4322
  camera = 'front';
4644
4323
  }
@@ -4711,7 +4390,7 @@ const saveVideoToPhotosAlbum = (options) => {
4711
4390
  };
4712
4391
 
4713
4392
  const getVideoInfo = function (options) {
4714
- return __awaiter(this, void 0, void 0, function* () {
4393
+ return tslib.__awaiter(this, void 0, void 0, function* () {
4715
4394
  // options must be an Object
4716
4395
  const isObject = shouldBeObject(options);
4717
4396
  if (!isObject.flag) {
@@ -4749,7 +4428,7 @@ const getVideoInfo = function (options) {
4749
4428
  res.height = video.videoHeight;
4750
4429
  res.width = video.videoWidth;
4751
4430
  fetch(src)
4752
- .then((e) => __awaiter(this, void 0, void 0, function* () {
4431
+ .then((e) => tslib.__awaiter(this, void 0, void 0, function* () {
4753
4432
  const blob = yield e.blob();
4754
4433
  res.type = blob.type;
4755
4434
  res.size = blob.size;
@@ -5073,7 +4752,10 @@ function _request(options = {}) {
5073
4752
  const { success, complete, fail } = options;
5074
4753
  const params = {};
5075
4754
  const res = {};
5076
- 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"]);
4755
+ let { cache = 'default', credentials, data, dataType, header = {}, jsonp, method = 'GET', mode, responseType, signal, timeout, url = '' } = options, opts = tslib.__rest(options, ["cache", "credentials", "data", "dataType", "header", "jsonp", "method", "mode", "responseType", "signal", "timeout", "url"]);
4756
+ if (typeof timeout !== 'number') {
4757
+ timeout = NETWORK_TIMEOUT;
4758
+ }
5077
4759
  Object.assign(params, opts);
5078
4760
  if (jsonp) {
5079
4761
  // @ts-ignore
@@ -5132,23 +4814,28 @@ function _request(options = {}) {
5132
4814
  params.mode = mode;
5133
4815
  }
5134
4816
  let timeoutTimer = null;
4817
+ let controller = null;
5135
4818
  if (signal) {
5136
4819
  params.signal = signal;
5137
4820
  }
5138
- else if (typeof timeout === 'number') {
5139
- const controller = new window.AbortController();
4821
+ else {
4822
+ controller = new window.AbortController();
5140
4823
  params.signal = controller.signal;
5141
4824
  timeoutTimer = setTimeout(function () {
5142
- controller.abort();
4825
+ if (controller)
4826
+ controller.abort();
5143
4827
  }, timeout);
5144
4828
  }
5145
4829
  params.credentials = credentials;
5146
- return fetch(url, params)
4830
+ const p = fetch(url, params)
5147
4831
  .then(response => {
5148
4832
  if (timeoutTimer) {
5149
4833
  clearTimeout(timeoutTimer);
5150
4834
  timeoutTimer = null;
5151
4835
  }
4836
+ if (controller) {
4837
+ controller = null;
4838
+ }
5152
4839
  if (!response) {
5153
4840
  const errorResponse = { ok: false };
5154
4841
  throw errorResponse;
@@ -5184,12 +4871,28 @@ function _request(options = {}) {
5184
4871
  clearTimeout(timeoutTimer);
5185
4872
  timeoutTimer = null;
5186
4873
  }
4874
+ if (controller) {
4875
+ controller = null;
4876
+ }
5187
4877
  shared.isFunction(fail) && fail(err);
5188
4878
  shared.isFunction(complete) && complete(res);
5189
4879
  err.statusCode = res.statusCode;
5190
4880
  err.errMsg = err.message;
5191
4881
  return Promise.reject(err);
5192
4882
  });
4883
+ if (!p.abort && controller) {
4884
+ p.abort = cb => {
4885
+ if (controller) {
4886
+ cb && cb();
4887
+ controller.abort();
4888
+ if (timeoutTimer) {
4889
+ clearTimeout(timeoutTimer);
4890
+ timeoutTimer = null;
4891
+ }
4892
+ }
4893
+ };
4894
+ }
4895
+ return p;
5193
4896
  }
5194
4897
  function taroInterceptor(chain) {
5195
4898
  return _request(chain.requestParams);
@@ -5597,6 +5300,14 @@ const requestOrderPayment = /* @__PURE__ */ temporarilyNotSupport('requestOrderP
5597
5300
 
5598
5301
  // 打开手Q说说发表界面
5599
5302
  const openQzonePublish = /* @__PURE__ */ temporarilyNotSupport('openQzonePublish');
5303
+ const getQQRunData = /* @__PURE__ */ temporarilyNotSupport('getQQRunData');
5304
+ const setOfficialDress = /* @__PURE__ */ temporarilyNotSupport('setOfficialDress');
5305
+ const setCustomDress = /* @__PURE__ */ temporarilyNotSupport('setCustomDress');
5306
+ const updateQQApp = /* @__PURE__ */ temporarilyNotSupport('updateQQApp');
5307
+ const addRecentColorSign = /* @__PURE__ */ temporarilyNotSupport('addRecentColorSign');
5308
+ const getGuildInfo = /* @__PURE__ */ temporarilyNotSupport('getGuildInfo');
5309
+ const applyAddToMyApps = /* @__PURE__ */ temporarilyNotSupport('applyAddToMyApps');
5310
+ const isAddedToMyApps = /* @__PURE__ */ temporarilyNotSupport('isAddedToMyApps');
5600
5311
 
5601
5312
  // 路由
5602
5313
  // FIXME 方法导出类型未对齐,后续修复
@@ -5652,7 +5363,6 @@ const preloadSubPackage = /* @__PURE__ */ temporarilyNotSupport('preloadSubPacka
5652
5363
  // Worker
5653
5364
  const createWorker = /* @__PURE__ */ temporarilyNotSupport('createWorker');
5654
5365
 
5655
- import('intersection-observer');
5656
5366
  class TaroH5IntersectionObserver {
5657
5367
  // selector 的容器节点
5658
5368
  get container() {
@@ -6198,15 +5908,18 @@ exports.Current = Current;
6198
5908
  exports.ENV_TYPE = ENV_TYPE;
6199
5909
  exports.Events = Events;
6200
5910
  exports.Link = Link;
5911
+ exports.NodesRef = NodesRef;
6201
5912
  exports.addCard = addCard;
6202
5913
  exports.addFileToFavorites = addFileToFavorites;
6203
5914
  exports.addInterceptor = addInterceptor;
6204
5915
  exports.addPhoneCalendar = addPhoneCalendar;
6205
5916
  exports.addPhoneContact = addPhoneContact;
6206
5917
  exports.addPhoneRepeatCalendar = addPhoneRepeatCalendar;
5918
+ exports.addRecentColorSign = addRecentColorSign;
6207
5919
  exports.addVideoToFavorites = addVideoToFavorites;
6208
5920
  exports.advancedGeneralIdentify = advancedGeneralIdentify;
6209
5921
  exports.animalClassify = animalClassify;
5922
+ exports.applyAddToMyApps = applyAddToMyApps;
6210
5923
  exports.arrayBufferToBase64 = arrayBufferToBase64;
6211
5924
  exports.authPrivateMessage = authPrivateMessage;
6212
5925
  exports.authorize = authorize;
@@ -6329,6 +6042,7 @@ exports.getFileInfo = getFileInfo;
6329
6042
  exports.getFileSystemManager = getFileSystemManager;
6330
6043
  exports.getFuzzyLocation = getFuzzyLocation;
6331
6044
  exports.getGroupEnterInfo = getGroupEnterInfo;
6045
+ exports.getGuildInfo = getGuildInfo;
6332
6046
  exports.getHCEState = getHCEState;
6333
6047
  exports.getImageInfo = getImageInfo;
6334
6048
  exports.getInferenceEnvInfo = getInferenceEnvInfo;
@@ -6342,6 +6056,7 @@ exports.getNetworkType = getNetworkType;
6342
6056
  exports.getOpenUserInfo = getOpenUserInfo;
6343
6057
  exports.getPerformance = getPerformance;
6344
6058
  exports.getPrivacySetting = getPrivacySetting;
6059
+ exports.getQQRunData = getQQRunData;
6345
6060
  exports.getRandomValues = getRandomValues;
6346
6061
  exports.getRealtimeLogManager = getRealtimeLogManager;
6347
6062
  exports.getRecorderManager = getRecorderManager;
@@ -6386,6 +6101,7 @@ exports.initPxTransform = initPxTransform;
6386
6101
  exports.initTabBarApis = initTabBarApis;
6387
6102
  exports.interceptorify = interceptorify;
6388
6103
  exports.interceptors = interceptors;
6104
+ exports.isAddedToMyApps = isAddedToMyApps;
6389
6105
  exports.isBluetoothDevicePaired = isBluetoothDevicePaired;
6390
6106
  exports.isVKSupport = isVKSupport;
6391
6107
  exports.join1v1Chat = join1v1Chat;
@@ -6572,12 +6288,14 @@ exports.setBackgroundColor = setBackgroundColor;
6572
6288
  exports.setBackgroundFetchToken = setBackgroundFetchToken;
6573
6289
  exports.setBackgroundTextStyle = setBackgroundTextStyle;
6574
6290
  exports.setClipboardData = setClipboardData;
6291
+ exports.setCustomDress = setCustomDress;
6575
6292
  exports.setEnable1v1Chat = setEnable1v1Chat;
6576
6293
  exports.setEnableDebug = setEnableDebug;
6577
6294
  exports.setInnerAudioOption = setInnerAudioOption;
6578
6295
  exports.setKeepScreenOn = setKeepScreenOn;
6579
6296
  exports.setNavigationBarColor = setNavigationBarColor;
6580
6297
  exports.setNavigationBarTitle = setNavigationBarTitle;
6298
+ exports.setOfficialDress = setOfficialDress;
6581
6299
  exports.setPageInfo = setPageInfo;
6582
6300
  exports.setScreenBrightness = setScreenBrightness;
6583
6301
  exports.setStorage = setStorage;
@@ -6637,6 +6355,7 @@ exports.subscribeVoIPVideoMembers = subscribeVoIPVideoMembers;
6637
6355
  exports.textReview = textReview;
6638
6356
  exports.textToAudio = textToAudio;
6639
6357
  exports.tradePay = tradePay;
6358
+ exports.updateQQApp = updateQQApp;
6640
6359
  exports.updateShareMenu = updateShareMenu;
6641
6360
  exports.updateVoIPChatMuteConfig = updateVoIPChatMuteConfig;
6642
6361
  exports.updateWeChatApp = updateWeChatApp;