@tarojs/taro-h5 3.6.6-alpha.0 → 3.6.6-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/framework/index.d.ts +1 -1
- package/dist/api/taro.d.ts +7 -2
- package/dist/api/taro.js +12 -3
- package/dist/api/taro.js.map +1 -1
- package/dist/api/wxml/MediaQueryObserver.js +1 -2
- package/dist/api/wxml/MediaQueryObserver.js.map +1 -1
- package/dist/index.cjs.d.ts +8 -3
- package/dist/index.cjs.js +14 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.d.ts +8 -3
- package/dist/index.esm.js +12 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/utils/index.d.ts +1 -2
- package/dist/utils/index.js +1 -4
- package/dist/utils/index.js.map +1 -1
- package/package.json +7 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Taro from '@tarojs/api';
|
|
2
2
|
declare const getApp: typeof Taro.getApp;
|
|
3
|
-
declare const getCurrentInstance: () => Taro.Current;
|
|
3
|
+
declare const getCurrentInstance: () => Taro.getCurrentInstance.Current;
|
|
4
4
|
export { getApp, getCurrentInstance };
|
|
5
5
|
export { getCurrentPages } from '@tarojs/router';
|
package/dist/api/taro.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Taro from '@tarojs/api';
|
|
2
2
|
import { history } from '@tarojs/router';
|
|
3
|
-
declare const Behavior: any, getEnv: any, ENV_TYPE: any, Link: any, interceptors: any, Current: any, options: any, eventCenter: any, Events: any, preload: any;
|
|
3
|
+
declare const Behavior: any, getEnv: any, ENV_TYPE: any, Link: any, interceptors: any, interceptorify: any, Current: any, options: any, eventCenter: any, Events: any, preload: any;
|
|
4
4
|
declare const taro: typeof Taro;
|
|
5
5
|
declare const requirePlugin: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
6
6
|
declare const initPxTransform: ({ designWidth, deviceRatio, baseFontSize, unitPrecision, targetUnit }: {
|
|
@@ -12,4 +12,9 @@ declare const initPxTransform: ({ designWidth, deviceRatio, baseFontSize, unitPr
|
|
|
12
12
|
}) => void;
|
|
13
13
|
declare const pxTransform: (size?: number) => any;
|
|
14
14
|
declare const canIUseWebp: () => boolean;
|
|
15
|
-
|
|
15
|
+
declare const getAppInfo: () => {
|
|
16
|
+
platform: string;
|
|
17
|
+
taroVersion: string;
|
|
18
|
+
designWidth: any;
|
|
19
|
+
};
|
|
20
|
+
export { taro as default, Behavior, canIUseWebp, Current, ENV_TYPE, eventCenter, Events, getAppInfo, getEnv, history, initPxTransform, interceptorify, interceptors, Link, options, preload, pxTransform, requirePlugin };
|
package/dist/api/taro.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import Taro from '@tarojs/api';
|
|
2
2
|
import { history, navigateBack, navigateTo, reLaunch, redirectTo, getCurrentPages, switchTab } from '@tarojs/router';
|
|
3
3
|
export { history } from '@tarojs/router';
|
|
4
|
-
import { isFunction } from '@tarojs/shared';
|
|
4
|
+
import { isFunction, PLATFORM_TYPE } from '@tarojs/shared';
|
|
5
5
|
import './index.js';
|
|
6
6
|
import { permanentlyNotSupport } from '../utils/index.js';
|
|
7
7
|
import { getCurrentInstance, getApp } from './framework/index.js';
|
|
8
8
|
import { nextTick } from './ui/custom-component.js';
|
|
9
9
|
|
|
10
|
-
const { Behavior, getEnv, ENV_TYPE, Link, interceptors, Current, options, eventCenter, Events, preload } = Taro;
|
|
10
|
+
const { Behavior, getEnv, ENV_TYPE, Link, interceptors, interceptorify, Current, options, eventCenter, Events, preload } = Taro;
|
|
11
11
|
const taro = {
|
|
12
12
|
// @ts-ignore
|
|
13
13
|
Behavior,
|
|
@@ -15,6 +15,7 @@ const taro = {
|
|
|
15
15
|
ENV_TYPE,
|
|
16
16
|
Link,
|
|
17
17
|
interceptors,
|
|
18
|
+
interceptorify,
|
|
18
19
|
Current,
|
|
19
20
|
getCurrentInstance,
|
|
20
21
|
options,
|
|
@@ -82,11 +83,19 @@ const canIUseWebp = function () {
|
|
|
82
83
|
const canvas = document.createElement('canvas');
|
|
83
84
|
return canvas.toDataURL('image/webp').indexOf('data:image/webp') === 0;
|
|
84
85
|
};
|
|
86
|
+
const getAppInfo = function () {
|
|
87
|
+
const config = getConfig.call(this);
|
|
88
|
+
return {
|
|
89
|
+
platform: process.env.TARO_PLATFORM || PLATFORM_TYPE.WEB,
|
|
90
|
+
taroVersion: process.env.TARO_VERSION || 'unknown',
|
|
91
|
+
designWidth: config.designWidth,
|
|
92
|
+
};
|
|
93
|
+
};
|
|
85
94
|
taro.requirePlugin = requirePlugin;
|
|
86
95
|
taro.getApp = getApp;
|
|
87
96
|
taro.pxTransform = pxTransform;
|
|
88
97
|
taro.initPxTransform = initPxTransform;
|
|
89
98
|
taro.canIUseWebp = canIUseWebp;
|
|
90
99
|
|
|
91
|
-
export { Behavior, Current, ENV_TYPE, Events, Link, canIUseWebp, taro as default, eventCenter, getEnv, initPxTransform, interceptors, options, preload, pxTransform, requirePlugin };
|
|
100
|
+
export { Behavior, Current, ENV_TYPE, Events, Link, canIUseWebp, taro as default, eventCenter, getAppInfo, getEnv, initPxTransform, interceptorify, interceptors, options, preload, pxTransform, requirePlugin };
|
|
92
101
|
//# sourceMappingURL=taro.js.map
|
package/dist/api/taro.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taro.js","sources":["../../src/api/taro.ts"],"sourcesContent":["import Taro from '@tarojs/api'\nimport { history } from '@tarojs/router'\nimport { isFunction } from '@tarojs/shared'\n\nimport { getApp, getCurrentInstance, getCurrentPages, navigateBack, navigateTo, nextTick, redirectTo, reLaunch, switchTab } from '../api'\nimport { permanentlyNotSupport } from '../utils'\n\nconst {\n Behavior,\n getEnv,\n ENV_TYPE,\n Link,\n interceptors,\n Current,\n options,\n eventCenter,\n Events,\n preload\n} = Taro as any\n\nconst taro: typeof Taro = {\n // @ts-ignore\n Behavior,\n getEnv,\n ENV_TYPE,\n Link,\n interceptors,\n Current,\n getCurrentInstance,\n options,\n nextTick,\n eventCenter,\n Events,\n preload,\n history,\n navigateBack,\n navigateTo,\n reLaunch,\n redirectTo,\n getCurrentPages,\n switchTab\n}\n\nconst requirePlugin = permanentlyNotSupport('requirePlugin')\n\nfunction getConfig (): Record<string, any> {\n if (this?.pxTransformConfig) return this.pxTransformConfig\n return ((taro as any).config ||= {})\n}\n\nconst initPxTransform = function ({\n designWidth = 750,\n deviceRatio = {\n 640: 2.34 / 2,\n 750: 1,\n 828: 1.81 / 2\n } as TaroGeneral.TDeviceRatio,\n baseFontSize = 20,\n unitPrecision = 5,\n targetUnit = 'rem'\n}) {\n const config = getConfig.call(this)\n config.designWidth = designWidth\n config.deviceRatio = deviceRatio\n config.baseFontSize = baseFontSize\n config.targetUnit = targetUnit\n config.unitPrecision = unitPrecision\n}\n\nconst pxTransform = function (size = 0) {\n const config = getConfig.call(this)\n const baseFontSize = config.baseFontSize || 20\n const designWidth = (((input = 0) => isFunction(config.designWidth)\n ? config.designWidth(input)\n : config.designWidth))(size)\n if (!(designWidth in config.deviceRatio)) {\n throw new Error(`deviceRatio 配置中不存在 ${designWidth} 的设置!`)\n }\n const formatSize = ~~size\n let rootValue = 1 / config.deviceRatio[designWidth]\n switch (config?.targetUnit) {\n case 'vw':\n rootValue = designWidth / 100\n break\n case 'px':\n rootValue *= 2\n break\n default:\n // rem\n rootValue *= baseFontSize * 2\n }\n let val: number | string = formatSize / rootValue\n if (config.unitPrecision >= 0 && config.unitPrecision <= 100) {\n // Number(val): 0.50000 => 0.5\n val = Number(val.toFixed(config.unitPrecision))\n }\n return val + config?.targetUnit\n}\n\nconst canIUseWebp = function () {\n const canvas = document.createElement('canvas')\n return canvas.toDataURL('image/webp').indexOf('data:image/webp') === 0\n}\n\ntaro.requirePlugin = requirePlugin\ntaro.getApp = getApp\ntaro.pxTransform = pxTransform\ntaro.initPxTransform = initPxTransform\ntaro.canIUseWebp = canIUseWebp\n\nexport default taro\n\nexport {\n Behavior,\n canIUseWebp,\n Current,\n ENV_TYPE,\n eventCenter,\n Events,\n getEnv,\n history,\n initPxTransform,\n interceptors,\n Link,\n options,\n preload,\n pxTransform,\n requirePlugin\n}\n"],"names":[],"mappings":";;;;;;;;;AAOM,MAAA,EACJ,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,OAAO,EACP,WAAW,EACX,MAAM,EACN,OAAO,EACR,GAAG,KAAW;AAEf,MAAM,IAAI,GAAgB;;IAExB,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,IAAI;IACJ,YAAY;IACZ,OAAO;IACP,kBAAkB;IAClB,OAAO;IACP,QAAQ;IACR,WAAW;IACX,MAAM;IACN,OAAO;IACP,OAAO;IACP,YAAY;IACZ,UAAU;IACV,QAAQ;IACR,UAAU;IACV,eAAe;IACf,SAAS;EACV;AAED,MAAM,aAAa,GAAG,qBAAqB,CAAC,eAAe,EAAC;AAE5D,SAAS,SAAS,GAAA;;AAChB,IAAA,IAAI,IAAI,KAAJ,IAAA,IAAA,IAAI,KAAJ,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,IAAI,CAAE,iBAAiB;QAAE,OAAO,IAAI,CAAC,iBAAiB,CAAA;IAC1D,QAAO,CAAA,EAAA,GAAE,IAAY,EAAC,MAAM,QAAN,MAAM,GAAK,EAAE,CAAA,EAAC;AACtC,CAAC;AAEK,MAAA,eAAe,GAAG,UAAU,EAChC,WAAW,GAAG,GAAG,EACjB,WAAW,GAAG;IACZ,GAAG,EAAE,IAAI,GAAG,CAAC;AACb,IAAA,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,IAAI,GAAG,CAAC;CACc,EAC7B,YAAY,GAAG,EAAE,EACjB,aAAa,GAAG,CAAC,EACjB,UAAU,GAAG,KAAK,EACnB,EAAA;IACC,MAAM,MAAM,GAAG,SAAS,CAAC,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AAA;AAChC,KAAA;AACD,IAAA,IAAI,GAAG,GAAoB,UAAU,GAAG,SAAS,CAAA;IACjD,IAAI,MAAM,CAAC,aAAa,IAAI,CAAC,IAAI,MAAM,CAAC,aAAa,IAAI,GAAG,EAAE;;AAE5D,QAAA,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAA;AAChD,KAAA;IACD,OAAO,GAAG,IAAG,MAAM,KAAN,IAAA,IAAA,MAAM,uBAAN,MAAM,CAAE,UAAU,CAAA,CAAA;AACjC,EAAC;AAED,MAAM,WAAW,GAAG,YAAA;IAClB,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;AAC/C,IAAA,OAAO,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAA;AACxE,EAAC;AAED,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;AAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;AACpB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;AAC9B,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;AACtC,IAAI,CAAC,WAAW,GAAG,WAAW;;;;"}
|
|
1
|
+
{"version":3,"file":"taro.js","sources":["../../src/api/taro.ts"],"sourcesContent":["import Taro from '@tarojs/api'\nimport { history } from '@tarojs/router'\nimport { isFunction, PLATFORM_TYPE } from '@tarojs/shared'\n\nimport { getApp, getCurrentInstance, getCurrentPages, navigateBack, navigateTo, nextTick, redirectTo, reLaunch, switchTab } from '../api'\nimport { permanentlyNotSupport } from '../utils'\n\nconst {\n Behavior,\n getEnv,\n ENV_TYPE,\n Link,\n interceptors,\n interceptorify,\n Current,\n options,\n eventCenter,\n Events,\n preload\n} = Taro as any\n\nconst taro: typeof Taro = {\n // @ts-ignore\n Behavior,\n getEnv,\n ENV_TYPE,\n Link,\n interceptors,\n interceptorify,\n Current,\n getCurrentInstance,\n options,\n nextTick,\n eventCenter,\n Events,\n preload,\n history,\n navigateBack,\n navigateTo,\n reLaunch,\n redirectTo,\n getCurrentPages,\n switchTab\n}\n\nconst requirePlugin = permanentlyNotSupport('requirePlugin')\n\nfunction getConfig (): Record<string, any> {\n if (this?.pxTransformConfig) return this.pxTransformConfig\n return ((taro as any).config ||= {})\n}\n\nconst initPxTransform = function ({\n designWidth = 750,\n deviceRatio = {\n 640: 2.34 / 2,\n 750: 1,\n 828: 1.81 / 2\n } as TaroGeneral.TDeviceRatio,\n baseFontSize = 20,\n unitPrecision = 5,\n targetUnit = 'rem'\n}) {\n const config = getConfig.call(this)\n config.designWidth = designWidth\n config.deviceRatio = deviceRatio\n config.baseFontSize = baseFontSize\n config.targetUnit = targetUnit\n config.unitPrecision = unitPrecision\n}\n\nconst pxTransform = function (size = 0) {\n const config = getConfig.call(this)\n const baseFontSize = config.baseFontSize || 20\n const designWidth = (((input = 0) => isFunction(config.designWidth)\n ? config.designWidth(input)\n : config.designWidth))(size)\n if (!(designWidth in config.deviceRatio)) {\n throw new Error(`deviceRatio 配置中不存在 ${designWidth} 的设置!`)\n }\n const formatSize = ~~size\n let rootValue = 1 / config.deviceRatio[designWidth]\n switch (config?.targetUnit) {\n case 'vw':\n rootValue = designWidth / 100\n break\n case 'px':\n rootValue *= 2\n break\n default:\n // rem\n rootValue *= baseFontSize * 2\n }\n let val: number | string = formatSize / rootValue\n if (config.unitPrecision >= 0 && config.unitPrecision <= 100) {\n // Number(val): 0.50000 => 0.5\n val = Number(val.toFixed(config.unitPrecision))\n }\n return val + config?.targetUnit\n}\n\nconst canIUseWebp = function () {\n const canvas = document.createElement('canvas')\n return canvas.toDataURL('image/webp').indexOf('data:image/webp') === 0\n}\n\nconst getAppInfo = function () {\n const config = getConfig.call(this)\n return {\n platform: process.env.TARO_PLATFORM || PLATFORM_TYPE.WEB,\n taroVersion: process.env.TARO_VERSION || 'unknown',\n designWidth: config.designWidth,\n }\n}\n\ntaro.requirePlugin = requirePlugin\ntaro.getApp = getApp\ntaro.pxTransform = pxTransform\ntaro.initPxTransform = initPxTransform\ntaro.canIUseWebp = canIUseWebp\n\nexport default taro\n\nexport {\n Behavior,\n canIUseWebp,\n Current,\n ENV_TYPE,\n eventCenter,\n Events,\n getAppInfo,\n getEnv,\n history,\n initPxTransform,\n interceptorify,\n interceptors,\n Link,\n options,\n preload,\n pxTransform,\n requirePlugin\n}\n"],"names":[],"mappings":";;;;;;;;;AAOM,MAAA,EACJ,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,cAAc,EACd,OAAO,EACP,OAAO,EACP,WAAW,EACX,MAAM,EACN,OAAO,EACR,GAAG,KAAW;AAEf,MAAM,IAAI,GAAgB;;IAExB,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,IAAI;IACJ,YAAY;IACZ,cAAc;IACd,OAAO;IACP,kBAAkB;IAClB,OAAO;IACP,QAAQ;IACR,WAAW;IACX,MAAM;IACN,OAAO;IACP,OAAO;IACP,YAAY;IACZ,UAAU;IACV,QAAQ;IACR,UAAU;IACV,eAAe;IACf,SAAS;EACV;AAED,MAAM,aAAa,GAAG,qBAAqB,CAAC,eAAe,EAAC;AAE5D,SAAS,SAAS,GAAA;;AAChB,IAAA,IAAI,IAAI,KAAJ,IAAA,IAAA,IAAI,KAAJ,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,IAAI,CAAE,iBAAiB;QAAE,OAAO,IAAI,CAAC,iBAAiB,CAAA;IAC1D,QAAO,CAAA,EAAA,GAAE,IAAY,EAAC,MAAM,QAAN,MAAM,GAAK,EAAE,CAAA,EAAC;AACtC,CAAC;AAEK,MAAA,eAAe,GAAG,UAAU,EAChC,WAAW,GAAG,GAAG,EACjB,WAAW,GAAG;IACZ,GAAG,EAAE,IAAI,GAAG,CAAC;AACb,IAAA,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,IAAI,GAAG,CAAC;CACc,EAC7B,YAA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
|
1
|
-
{"version":3,"file":"MediaQueryObserver.js","sources":["../../../src/api/wxml/MediaQueryObserver.ts"],"sourcesContent":["\nimport { isFunction } from '@tarojs/shared'\nimport Taro from '@tarojs/taro'\n\
|
|
1
|
+
{"version":3,"file":"MediaQueryObserver.js","sources":["../../../src/api/wxml/MediaQueryObserver.ts"],"sourcesContent":["\nimport { isFunction, toKebabCase } from '@tarojs/shared'\nimport Taro from '@tarojs/taro'\n\nfunction generateMediaQueryStr (descriptor: Taro.MediaQueryObserver.descriptor) {\n const mediaQueryArr: string[] = []\n const descriptorMenu = ['width', 'minWidth', 'maxWidth', 'height', 'minHeight', 'maxHeight', 'orientation']\n for (const item of descriptorMenu) {\n if (\n item !== 'orientation' &&\n descriptor[item] &&\n Number(descriptor[item]) >= 0\n ) {\n mediaQueryArr.push(`(${(toKebabCase(item))}: ${Number(descriptor[item])}px)`)\n }\n if (item === 'orientation' && descriptor[item]) {\n mediaQueryArr.push(`(${toKebabCase(item)}: ${descriptor[item]})`)\n }\n }\n return mediaQueryArr.join(' and ')\n}\n\n\nexport class MediaQueryObserver implements Taro.MediaQueryObserver {\n private _mediaQueryObserver: MediaQueryList\n private _listener: (ev: MediaQueryListEvent) => void\n\n // 监听页面媒体查询变化情况\n public observe (descriptor: Taro.MediaQueryObserver.descriptor, callback: Taro.MediaQueryObserver.observeCallback): void {\n if (isFunction(callback)) {\n // 创建媒体查询对象\n this._mediaQueryObserver = window.matchMedia(generateMediaQueryStr(descriptor))\n // 监听器\n this._listener = (ev: MediaQueryListEvent) => {\n callback({ matches: ev.matches })\n }\n callback({ matches: this._mediaQueryObserver.matches })\n // 兼容旧浏览器中 MediaQueryList 尚未继承于 EventTarget 导致不存在 'addEventListener'\n if ('addEventListener' in this._mediaQueryObserver) {\n this._mediaQueryObserver.addEventListener('change', this._listener)\n } else {\n // @ts-ignore\n this._mediaQueryObserver.addListener(this._listener)\n }\n }\n }\n\n // 停止监听,销毁媒体查询对象\n public disconnect (): void {\n if (this._mediaQueryObserver && this._listener) {\n // 兼容旧浏览器中 MediaQueryList 尚未继承于 EventTarget 导致不存在 'removeEventListener'\n if ('removeEventListener' in this._mediaQueryObserver) {\n this._mediaQueryObserver.removeEventListener('change', this._listener)\n } else {\n // @ts-ignore\n this._mediaQueryObserver.removeListener(this._listener)\n }\n }\n }\n\n}\n"],"names":[],"mappings":";;AAIA,SAAS,qBAAqB,CAAE,UAA8C,EAAA;IAC5E,MAAM,aAAa,GAAa,EAAE,CAAA;AAClC,IAAA,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,CAAC,CAAA;AAC3G,IAAA,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE;QACjC,IACE,IAAI,KAAK,aAAa;YACtB,UAAU,CAAC,IAAI,CAAC;YAChB,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAC7B;YACA,aAAa,CAAC,IAAI,CAAC,CAAA,CAAA,GAAK,WAAW,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAA,GAAA,CAAK,CAAC,CAAA;AAC9E,SAAA;QACD,IAAI,IAAI,KAAK,aAAa,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE;AAC9C,YAAA,aAAa,CAAC,IAAI,CAAC,CAAA,CAAA,EAAI,WAAW,CAAC,IAAI,CAAC,CAAA,EAAA,EAAK,UAAU,CAAC,IAAI,CAAC,CAAA,CAAA,CAAG,CAAC,CAAA;AAClE,SAAA;AACF,KAAA;AACD,IAAA,OAAO,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;AACpC,CAAC;MAGY,kBAAkB,CAAA;;IAKtB,OAAO,CAAE,UAA8C,EAAE,QAAiD,EAAA;AAC/G,QAAA,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE;;AAExB,YAAA,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC,UAAU,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,CAAA;;AAE/E,YAAA,IAAI,CAAC,SAAS,GAAG,CAAC,EAAuB,KAAI;gBAC3C,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,CAAA;AACnC,aAAC,CAAA;YACD,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC,CAAA;;AAEvD,YAAA,IAAI,kBAAkB,IAAI,IAAI,CAAC,mBAAmB,EAAE;gBAClD,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;AACpE,aAAA;AAAM,iBAAA;;gBAEL,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;AACrD,aAAA;AACF,SAAA;KACF;;IAGM,UAAU,GAAA;AACf,QAAA,IAAI,IAAI,CAAC,mBAAmB,IAAI,IAAI,CAAC,SAAS,EAAE;;AAE9C,YAAA,IAAI,qBAAqB,IAAI,IAAI,CAAC,mBAAmB,EAAE;gBACrD,IAAI,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;AACvE,aAAA;AAAM,iBAAA;;gBAEL,IAAI,CAAC,mBAAmB,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;AACxD,aAAA;AACF,SAAA;KACF;AAEF;;;;"}
|
package/dist/index.cjs.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Taro from "@tarojs/api";
|
|
2
2
|
import { AppConfig } from "@tarojs/api";
|
|
3
3
|
import { history } from "@tarojs/router";
|
|
4
|
-
declare const Behavior: any, getEnv: any, ENV_TYPE: any, Link: any, interceptors: any, Current: any, options: any, eventCenter: any, Events: any, preload: any;
|
|
4
|
+
declare const Behavior: any, getEnv: any, ENV_TYPE: any, Link: any, interceptors: any, interceptorify: any, Current: any, options: any, eventCenter: any, Events: any, preload: any;
|
|
5
5
|
declare const taro: typeof Taro;
|
|
6
6
|
declare const requirePlugin: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
7
7
|
declare const initPxTransform: ({ designWidth, deviceRatio, baseFontSize, unitPrecision, targetUnit }: {
|
|
@@ -13,6 +13,11 @@ declare const initPxTransform: ({ designWidth, deviceRatio, baseFontSize, unitPr
|
|
|
13
13
|
}) => void;
|
|
14
14
|
declare const pxTransform: (size?: number) => any;
|
|
15
15
|
declare const canIUseWebp: () => boolean;
|
|
16
|
+
declare const getAppInfo: () => {
|
|
17
|
+
platform: string;
|
|
18
|
+
taroVersion: string;
|
|
19
|
+
designWidth: any;
|
|
20
|
+
};
|
|
16
21
|
// 广告
|
|
17
22
|
declare const createRewardedVideoAd: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
18
23
|
declare const createInterstitialAd: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
@@ -323,7 +328,7 @@ declare const getFileSystemManager: (option?: {}, ...args: any[]) => Promise<Par
|
|
|
323
328
|
declare const getFileInfo: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
324
329
|
declare const getApp: typeof Taro.getApp;
|
|
325
330
|
// 自定义组件
|
|
326
|
-
declare const getCurrentInstance: () => Taro.Current;
|
|
331
|
+
declare const getCurrentInstance: () => Taro.getCurrentInstance.Current;
|
|
327
332
|
// 位置
|
|
328
333
|
declare const stopLocationUpdate: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
329
334
|
declare const startLocationUpdateBackground: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
@@ -771,5 +776,5 @@ declare const createWorker: (option?: {}, ...args: any[]) => Promise<Partial<Tar
|
|
|
771
776
|
declare const createSelectorQuery: typeof Taro.createSelectorQuery;
|
|
772
777
|
declare const createIntersectionObserver: typeof Taro.createIntersectionObserver;
|
|
773
778
|
declare const createMediaQueryObserver: typeof Taro.createMediaQueryObserver;
|
|
774
|
-
export { taro as default, taro, createRewardedVideoAd, createInterstitialAd, stopFaceDetect, initFaceDetect, faceDetect, isVKSupport, createVKSession, getOpenUserInfo, env, canIUse, arrayBufferToBase64, base64ToArrayBuffer, getUserCryptoManager, setEnableDebug, getRealtimeLogManager, getLogManager, reportPerformance, getPerformance, openSystemBluetoothSetting, openAppAuthorizeSetting, getWindowInfo, getSystemSetting, getDeviceInfo, getAppBaseInfo, getAppAuthorizeSetting, getSystemInfoSync, getSystemInfoAsync, getSystemInfo, updateWeChatApp, getUpdateManager, onUnhandledRejection, onThemeChange, onPageNotFound, onError, onAudioInterruptionEnd, onAudioInterruptionBegin, onAppShow, onAppHide, offUnhandledRejection, offThemeChange, offPageNotFound, offError, offAudioInterruptionEnd, offAudioInterruptionBegin, offAppShow, offAppHide, getLaunchOptionsSync, getEnterOptionsSync, createOffscreenCanvas, createCanvasContext, canvasToTempFilePath, canvasPutImageData, canvasGetImageData, cloud, reportMonitor, reportAnalytics, reportEvent, getExptInfoSync, stopAccelerometer, startAccelerometer, onAccelerometerChange, offAccelerometerChange, checkIsOpenAccessibility, getBatteryInfoSync, getBatteryInfo, stopBluetoothDevicesDiscovery, startBluetoothDevicesDiscovery, openBluetoothAdapter, onBluetoothDeviceFound, onBluetoothAdapterStateChange, offBluetoothDeviceFound, offBluetoothAdapterStateChange, makeBluetoothPair, isBluetoothDevicePaired, getConnectedBluetoothDevices, getBluetoothDevices, getBluetoothAdapterState, closeBluetoothAdapter, writeBLECharacteristicValue, setBLEMTU, readBLECharacteristicValue, onBLEMTUChange, onBLEConnectionStateChange, onBLECharacteristicValueChange, offBLEMTUChange, offBLEConnectionStateChange, offBLECharacteristicValueChange, notifyBLECharacteristicValueChange, getBLEMTU, getBLEDeviceServices, getBLEDeviceRSSI, getBLEDeviceCharacteristics, createBLEConnection, closeBLEConnection, onBLEPeripheralConnectionStateChanged, offBLEPeripheralConnectionStateChanged, createBLEPeripheralServer, addPhoneRepeatCalendar, addPhoneCalendar, setClipboardData, getClipboardData, stopCompass, startCompass, onCompassChange, offCompassChange, chooseContact, addPhoneContact, getRandomValues, stopGyroscope, startGyroscope, onGyroscopeChange, offGyroscopeChange, stopBeaconDiscovery, startBeaconDiscovery, onBeaconUpdate, onBeaconServiceChange, offBeaconUpdate, offBeaconServiceChange, getBeacons, onKeyboardHeightChange, offKeyboardHeightChange, hideKeyboard, getSelectedTextRange, onMemoryWarning, offMemoryWarning, stopDeviceMotionListening, startDeviceMotionListening, onDeviceMotionChange, offDeviceMotionChange, getNetworkType, onNetworkWeakChange, onNetworkStatusChange, offNetworkWeakChange, offNetworkStatusChange, getLocalIPAddress, stopHCE, startHCE, sendHCEMessage, onHCEMessage, offHCEMessage, getNFCAdapter, getHCEState, makePhoneCall, scanCode, setVisualEffectOnCapture, setScreenBrightness, setKeepScreenOn, onUserCaptureScreen, offUserCaptureScreen, getScreenBrightness, vibrateShort, vibrateLong, stopWifi, startWifi, setWifiList, onWifiConnectedWithPartialInfo, onWifiConnected, onGetWifiList, offWifiConnected, offGetWifiList, getWifiList, getConnectedWifi, connectWifi, getExtConfigSync, getExtConfig, saveFileToDisk, saveFile, removeSavedFile, openDocument, getSavedFileList, getSavedFileInfo, getFileSystemManager, getFileInfo, getApp, getCurrentInstance, stopLocationUpdate, startLocationUpdateBackground, startLocationUpdate, openLocation, onLocationChangeError, onLocationChange, offLocationChangeError, offLocationChange, getLocation, choosePoi, getFuzzyLocation, chooseLocation, stopVoice, setInnerAudioOption, playVoice, pauseVoice, getAvailableAudioSources, createWebAudioContext, createMediaAudioPlayer, createInnerAudioContext, createAudioContext, stopBackgroundAudio, seekBackgroundAudio, playBackgroundAudio, pauseBackgroundAudio, onBackgroundAudioStop, onBackgroundAudioPlay, onBackgroundAudioPause, getBackgroundAudioPlayerState, getBackgroundAudioManager, createCameraContext, saveImageToPhotosAlbum, previewMedia, getImageInfo, previewImage, compressImage, chooseMessageFile, chooseImage, createLivePusherContext, createLivePlayerContext, createMapContext, createMediaRecorder, stopRecord, startRecord, getRecorderManager, saveVideoToPhotosAlbum, openVideoEditor, getVideoInfo, createVideoContext, compressVideo, chooseVideo, chooseMedia, createVideoDecoder, createMediaContainer, updateVoIPChatMuteConfig, subscribeVoIPVideoMembers, setEnable1v1Chat, onVoIPVideoMembersChanged, onVoIPChatStateChanged, onVoIPChatSpeakersChanged, onVoIPChatMembersChanged, onVoIPChatInterrupted, offVoIPVideoMembersChanged, offVoIPChatStateChanged, offVoIPChatMembersChanged, offVoIPChatInterrupted, joinVoIPChat, exitVoIPChat, openEmbeddedMiniProgram, navigateToMiniProgram, navigateBackMiniProgram, exitMiniProgram, openBusinessView, downloadFile, stopLocalServiceDiscovery, startLocalServiceDiscovery, onLocalServiceResolveFail, onLocalServiceLost, onLocalServiceFound, onLocalServiceDiscoveryStop, offLocalServiceResolveFail, offLocalServiceLost, offLocalServiceFound, offLocalServiceDiscoveryStop, request, addInterceptor, cleanInterceptors, createTCPSocket, createUDPSocket, uploadFile, sendSocketMessage, onSocketOpen, onSocketMessage, onSocketError, onSocketClose, connectSocket, closeSocket, getAccountInfoSync, chooseAddress, authorizeForMiniProgram, authorize, openCard, addCard, reserveChannelsLive, openChannelsLive, openChannelsEvent, openChannelsActivity, getChannelsLiveNoticeInfo, getChannelsLiveInfo, openCustomerServiceChat, checkIsSupportFacialRecognition, startFacialRecognitionVerify, startFacialRecognitionVerifyAndUploadVideo, faceVerifyForPay, addVideoToFavorites, addFileToFavorites, checkIsAddedToMyMiniProgram, getGroupEnterInfo, chooseInvoiceTitle, chooseInvoice, chooseLicensePlate, pluginLogin, login, checkSession, showRedPackage, openSetting, getSetting, startSoterAuthentication, checkIsSupportSoterAuthentication, checkIsSoterEnrolledInDevice, requestSubscribeMessage, getUserProfile, getUserInfo, shareToWeRun, getWeRunData, requestPayment, requestOrderPayment, updateShareMenu, showShareMenu, showShareImageMenu, shareVideoMessage, shareFileMessage, onCopyUrl, offCopyUrl, hideShareMenu, getShareInfo, authPrivateMessage, setStorageSync, setStorage, revokeBufferURL, removeStorageSync, removeStorage, getStorageSync, getStorageInfoSync, getStorageInfo, getStorage, createBufferURL, clearStorageSync, clearStorage, setBackgroundFetchToken, onBackgroundFetchData, getBackgroundFetchToken, getBackgroundFetchData, setPageInfo, ocrIdCard, ocrBankCard, ocrDrivingLicense, ocrVehicleLicense, textReview, textToAudio, imageAudit, advancedGeneralIdentify, objectDetectIdentify, carClassify, dishClassify, logoClassify, animalClassify, plantClassify, getSwanId, requestPolymerPayment, navigateToSmartGameProgram, navigateToSmartProgram, navigateBackSmartProgram, preloadSubPackage, createAnimation, setBackgroundTextStyle, setBackgroundColor, nextTick, loadFontFace, disableAlertBeforeUnload, enableAlertBeforeUnload, hideLoading, hideToast, showActionSheet, showLoading, showModal, showToast, getMenuButtonBoundingClientRect, showNavigationBarLoading, setNavigationBarTitle, setNavigationBarColor, hideNavigationBarLoading, hideHomeButton, startPullDownRefresh, stopPullDownRefresh, pageScrollTo, setTopBarText, initTabBarApis, showTabBarRedDot, showTabBar, setTabBarStyle, setTabBarItem, setTabBarBadge, removeTabBarBadge, hideTabBarRedDot, hideTabBar, setWindowSize, onWindowResize, offWindowResize, createWorker, createSelectorQuery, createIntersectionObserver, createMediaQueryObserver, Behavior, canIUseWebp, Current, ENV_TYPE, eventCenter, Events, getEnv, history, initPxTransform, interceptors, Link, options, preload, pxTransform, requirePlugin };
|
|
779
|
+
export { taro as default, taro, createRewardedVideoAd, createInterstitialAd, stopFaceDetect, initFaceDetect, faceDetect, isVKSupport, createVKSession, getOpenUserInfo, env, canIUse, arrayBufferToBase64, base64ToArrayBuffer, getUserCryptoManager, setEnableDebug, getRealtimeLogManager, getLogManager, reportPerformance, getPerformance, openSystemBluetoothSetting, openAppAuthorizeSetting, getWindowInfo, getSystemSetting, getDeviceInfo, getAppBaseInfo, getAppAuthorizeSetting, getSystemInfoSync, getSystemInfoAsync, getSystemInfo, updateWeChatApp, getUpdateManager, onUnhandledRejection, onThemeChange, onPageNotFound, onError, onAudioInterruptionEnd, onAudioInterruptionBegin, onAppShow, onAppHide, offUnhandledRejection, offThemeChange, offPageNotFound, offError, offAudioInterruptionEnd, offAudioInterruptionBegin, offAppShow, offAppHide, getLaunchOptionsSync, getEnterOptionsSync, createOffscreenCanvas, createCanvasContext, canvasToTempFilePath, canvasPutImageData, canvasGetImageData, cloud, reportMonitor, reportAnalytics, reportEvent, getExptInfoSync, stopAccelerometer, startAccelerometer, onAccelerometerChange, offAccelerometerChange, checkIsOpenAccessibility, getBatteryInfoSync, getBatteryInfo, stopBluetoothDevicesDiscovery, startBluetoothDevicesDiscovery, openBluetoothAdapter, onBluetoothDeviceFound, onBluetoothAdapterStateChange, offBluetoothDeviceFound, offBluetoothAdapterStateChange, makeBluetoothPair, isBluetoothDevicePaired, getConnectedBluetoothDevices, getBluetoothDevices, getBluetoothAdapterState, closeBluetoothAdapter, writeBLECharacteristicValue, setBLEMTU, readBLECharacteristicValue, onBLEMTUChange, onBLEConnectionStateChange, onBLECharacteristicValueChange, offBLEMTUChange, offBLEConnectionStateChange, offBLECharacteristicValueChange, notifyBLECharacteristicValueChange, getBLEMTU, getBLEDeviceServices, getBLEDeviceRSSI, getBLEDeviceCharacteristics, createBLEConnection, closeBLEConnection, onBLEPeripheralConnectionStateChanged, offBLEPeripheralConnectionStateChanged, createBLEPeripheralServer, addPhoneRepeatCalendar, addPhoneCalendar, setClipboardData, getClipboardData, stopCompass, startCompass, onCompassChange, offCompassChange, chooseContact, addPhoneContact, getRandomValues, stopGyroscope, startGyroscope, onGyroscopeChange, offGyroscopeChange, stopBeaconDiscovery, startBeaconDiscovery, onBeaconUpdate, onBeaconServiceChange, offBeaconUpdate, offBeaconServiceChange, getBeacons, onKeyboardHeightChange, offKeyboardHeightChange, hideKeyboard, getSelectedTextRange, onMemoryWarning, offMemoryWarning, stopDeviceMotionListening, startDeviceMotionListening, onDeviceMotionChange, offDeviceMotionChange, getNetworkType, onNetworkWeakChange, onNetworkStatusChange, offNetworkWeakChange, offNetworkStatusChange, getLocalIPAddress, stopHCE, startHCE, sendHCEMessage, onHCEMessage, offHCEMessage, getNFCAdapter, getHCEState, makePhoneCall, scanCode, setVisualEffectOnCapture, setScreenBrightness, setKeepScreenOn, onUserCaptureScreen, offUserCaptureScreen, getScreenBrightness, vibrateShort, vibrateLong, stopWifi, startWifi, setWifiList, onWifiConnectedWithPartialInfo, onWifiConnected, onGetWifiList, offWifiConnected, offGetWifiList, getWifiList, getConnectedWifi, connectWifi, getExtConfigSync, getExtConfig, saveFileToDisk, saveFile, removeSavedFile, openDocument, getSavedFileList, getSavedFileInfo, getFileSystemManager, getFileInfo, getApp, getCurrentInstance, stopLocationUpdate, startLocationUpdateBackground, startLocationUpdate, openLocation, onLocationChangeError, onLocationChange, offLocationChangeError, offLocationChange, getLocation, choosePoi, getFuzzyLocation, chooseLocation, stopVoice, setInnerAudioOption, playVoice, pauseVoice, getAvailableAudioSources, createWebAudioContext, createMediaAudioPlayer, createInnerAudioContext, createAudioContext, stopBackgroundAudio, seekBackgroundAudio, playBackgroundAudio, pauseBackgroundAudio, onBackgroundAudioStop, onBackgroundAudioPlay, onBackgroundAudioPause, getBackgroundAudioPlayerState, getBackgroundAudioManager, createCameraContext, saveImageToPhotosAlbum, previewMedia, getImageInfo, previewImage, compressImage, chooseMessageFile, chooseImage, createLivePusherContext, createLivePlayerContext, createMapContext, createMediaRecorder, stopRecord, startRecord, getRecorderManager, saveVideoToPhotosAlbum, openVideoEditor, getVideoInfo, createVideoContext, compressVideo, chooseVideo, chooseMedia, createVideoDecoder, createMediaContainer, updateVoIPChatMuteConfig, subscribeVoIPVideoMembers, setEnable1v1Chat, onVoIPVideoMembersChanged, onVoIPChatStateChanged, onVoIPChatSpeakersChanged, onVoIPChatMembersChanged, onVoIPChatInterrupted, offVoIPVideoMembersChanged, offVoIPChatStateChanged, offVoIPChatMembersChanged, offVoIPChatInterrupted, joinVoIPChat, exitVoIPChat, openEmbeddedMiniProgram, navigateToMiniProgram, navigateBackMiniProgram, exitMiniProgram, openBusinessView, downloadFile, stopLocalServiceDiscovery, startLocalServiceDiscovery, onLocalServiceResolveFail, onLocalServiceLost, onLocalServiceFound, onLocalServiceDiscoveryStop, offLocalServiceResolveFail, offLocalServiceLost, offLocalServiceFound, offLocalServiceDiscoveryStop, request, addInterceptor, cleanInterceptors, createTCPSocket, createUDPSocket, uploadFile, sendSocketMessage, onSocketOpen, onSocketMessage, onSocketError, onSocketClose, connectSocket, closeSocket, getAccountInfoSync, chooseAddress, authorizeForMiniProgram, authorize, openCard, addCard, reserveChannelsLive, openChannelsLive, openChannelsEvent, openChannelsActivity, getChannelsLiveNoticeInfo, getChannelsLiveInfo, openCustomerServiceChat, checkIsSupportFacialRecognition, startFacialRecognitionVerify, startFacialRecognitionVerifyAndUploadVideo, faceVerifyForPay, addVideoToFavorites, addFileToFavorites, checkIsAddedToMyMiniProgram, getGroupEnterInfo, chooseInvoiceTitle, chooseInvoice, chooseLicensePlate, pluginLogin, login, checkSession, showRedPackage, openSetting, getSetting, startSoterAuthentication, checkIsSupportSoterAuthentication, checkIsSoterEnrolledInDevice, requestSubscribeMessage, getUserProfile, getUserInfo, shareToWeRun, getWeRunData, requestPayment, requestOrderPayment, updateShareMenu, showShareMenu, showShareImageMenu, shareVideoMessage, shareFileMessage, onCopyUrl, offCopyUrl, hideShareMenu, getShareInfo, authPrivateMessage, setStorageSync, setStorage, revokeBufferURL, removeStorageSync, removeStorage, getStorageSync, getStorageInfoSync, getStorageInfo, getStorage, createBufferURL, clearStorageSync, clearStorage, setBackgroundFetchToken, onBackgroundFetchData, getBackgroundFetchToken, getBackgroundFetchData, setPageInfo, ocrIdCard, ocrBankCard, ocrDrivingLicense, ocrVehicleLicense, textReview, textToAudio, imageAudit, advancedGeneralIdentify, objectDetectIdentify, carClassify, dishClassify, logoClassify, animalClassify, plantClassify, getSwanId, requestPolymerPayment, navigateToSmartGameProgram, navigateToSmartProgram, navigateBackSmartProgram, preloadSubPackage, createAnimation, setBackgroundTextStyle, setBackgroundColor, nextTick, loadFontFace, disableAlertBeforeUnload, enableAlertBeforeUnload, hideLoading, hideToast, showActionSheet, showLoading, showModal, showToast, getMenuButtonBoundingClientRect, showNavigationBarLoading, setNavigationBarTitle, setNavigationBarColor, hideNavigationBarLoading, hideHomeButton, startPullDownRefresh, stopPullDownRefresh, pageScrollTo, setTopBarText, initTabBarApis, showTabBarRedDot, showTabBar, setTabBarStyle, setTabBarItem, setTabBarBadge, removeTabBarBadge, hideTabBarRedDot, hideTabBar, setWindowSize, onWindowResize, offWindowResize, createWorker, createSelectorQuery, createIntersectionObserver, createMediaQueryObserver, Behavior, canIUseWebp, Current, ENV_TYPE, eventCenter, Events, getAppInfo, getEnv, history, initPxTransform, interceptorify, interceptors, Link, options, preload, pxTransform, requirePlugin };
|
|
775
780
|
export { getCurrentPages, navigateBack, navigateTo, redirectTo, reLaunch, switchTab } from "@tarojs/router";
|
package/dist/index.cjs.js
CHANGED
|
@@ -218,9 +218,6 @@ function upperCaseFirstLetter(string) {
|
|
|
218
218
|
string = string.replace(/^./, match => match.toUpperCase());
|
|
219
219
|
return string;
|
|
220
220
|
}
|
|
221
|
-
const toKebabCase = function (string) {
|
|
222
|
-
return string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
223
|
-
};
|
|
224
221
|
function inlineStyle(style) {
|
|
225
222
|
let res = '';
|
|
226
223
|
for (const attr in style)
|
|
@@ -5233,10 +5230,10 @@ function generateMediaQueryStr(descriptor) {
|
|
|
5233
5230
|
if (item !== 'orientation' &&
|
|
5234
5231
|
descriptor[item] &&
|
|
5235
5232
|
Number(descriptor[item]) >= 0) {
|
|
5236
|
-
mediaQueryArr.push(`(${(toKebabCase(item))}: ${Number(descriptor[item])}px)`);
|
|
5233
|
+
mediaQueryArr.push(`(${(shared.toKebabCase(item))}: ${Number(descriptor[item])}px)`);
|
|
5237
5234
|
}
|
|
5238
5235
|
if (item === 'orientation' && descriptor[item]) {
|
|
5239
|
-
mediaQueryArr.push(`(${toKebabCase(item)}: ${descriptor[item]})`);
|
|
5236
|
+
mediaQueryArr.push(`(${shared.toKebabCase(item)}: ${descriptor[item]})`);
|
|
5240
5237
|
}
|
|
5241
5238
|
}
|
|
5242
5239
|
return mediaQueryArr.join(' and ');
|
|
@@ -5534,7 +5531,7 @@ const createMediaQueryObserver = () => {
|
|
|
5534
5531
|
return new MediaQueryObserver();
|
|
5535
5532
|
};
|
|
5536
5533
|
|
|
5537
|
-
const { Behavior, getEnv, ENV_TYPE, Link, interceptors, Current, options, eventCenter, Events, preload } = Taro__default["default"];
|
|
5534
|
+
const { Behavior, getEnv, ENV_TYPE, Link, interceptors, interceptorify, Current, options, eventCenter, Events, preload } = Taro__default["default"];
|
|
5538
5535
|
const taro = {
|
|
5539
5536
|
// @ts-ignore
|
|
5540
5537
|
Behavior,
|
|
@@ -5542,6 +5539,7 @@ const taro = {
|
|
|
5542
5539
|
ENV_TYPE,
|
|
5543
5540
|
Link,
|
|
5544
5541
|
interceptors,
|
|
5542
|
+
interceptorify,
|
|
5545
5543
|
Current,
|
|
5546
5544
|
getCurrentInstance,
|
|
5547
5545
|
options,
|
|
@@ -5609,6 +5607,14 @@ const canIUseWebp = function () {
|
|
|
5609
5607
|
const canvas = document.createElement('canvas');
|
|
5610
5608
|
return canvas.toDataURL('image/webp').indexOf('data:image/webp') === 0;
|
|
5611
5609
|
};
|
|
5610
|
+
const getAppInfo = function () {
|
|
5611
|
+
const config = getConfig.call(this);
|
|
5612
|
+
return {
|
|
5613
|
+
platform: process.env.TARO_PLATFORM || shared.PLATFORM_TYPE.WEB,
|
|
5614
|
+
taroVersion: process.env.TARO_VERSION || 'unknown',
|
|
5615
|
+
designWidth: config.designWidth,
|
|
5616
|
+
};
|
|
5617
|
+
};
|
|
5612
5618
|
taro.requirePlugin = requirePlugin;
|
|
5613
5619
|
taro.getApp = getApp;
|
|
5614
5620
|
taro.pxTransform = pxTransform;
|
|
@@ -5738,6 +5744,7 @@ exports.getAccountInfoSync = getAccountInfoSync;
|
|
|
5738
5744
|
exports.getApp = getApp;
|
|
5739
5745
|
exports.getAppAuthorizeSetting = getAppAuthorizeSetting;
|
|
5740
5746
|
exports.getAppBaseInfo = getAppBaseInfo;
|
|
5747
|
+
exports.getAppInfo = getAppInfo;
|
|
5741
5748
|
exports.getAvailableAudioSources = getAvailableAudioSources;
|
|
5742
5749
|
exports.getBLEDeviceCharacteristics = getBLEDeviceCharacteristics;
|
|
5743
5750
|
exports.getBLEDeviceRSSI = getBLEDeviceRSSI;
|
|
@@ -5817,6 +5824,7 @@ exports.imageAudit = imageAudit;
|
|
|
5817
5824
|
exports.initFaceDetect = initFaceDetect;
|
|
5818
5825
|
exports.initPxTransform = initPxTransform;
|
|
5819
5826
|
exports.initTabBarApis = initTabBarApis;
|
|
5827
|
+
exports.interceptorify = interceptorify;
|
|
5820
5828
|
exports.interceptors = interceptors;
|
|
5821
5829
|
exports.isBluetoothDevicePaired = isBluetoothDevicePaired;
|
|
5822
5830
|
exports.isVKSupport = isVKSupport;
|