@tuya-miniapp/smart-ui 2.10.1-beta-2 → 2.10.1-beta-3

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.
@@ -3,7 +3,8 @@ declare const tyApi: {
3
3
  selectionVibrate: () => void;
4
4
  notificationVibrate: (v: any) => void;
5
5
  nativeDisabled: (v: boolean) => void;
6
- getThemeInfo: () => any;
6
+ themeInfo: Record<string, string> | null;
7
+ getThemeInfo: () => Record<string, string> | null | undefined;
7
8
  isWX: () => boolean;
8
9
  };
9
10
  export default tyApi;
package/dist/common/ty.js CHANGED
@@ -1,4 +1,5 @@
1
- const systemInfo = wx.getSystemInfoSync();
1
+ import { getSystemInfoSync } from './version';
2
+ const systemInfo = getSystemInfoSync();
2
3
  const isIOS = systemInfo.platform === 'ios';
3
4
  const tyApi = {
4
5
  vibrateShort: (v) => {
@@ -42,12 +43,17 @@ const tyApi = {
42
43
  (_a = ty.nativeDisabled) === null || _a === void 0 ? void 0 : _a.call(ty, v);
43
44
  }
44
45
  },
46
+ themeInfo: null,
45
47
  getThemeInfo: () => {
46
48
  var _a;
49
+ if (tyApi.themeInfo) {
50
+ return tyApi.themeInfo;
51
+ }
47
52
  // @ts-ignore
48
53
  if (typeof ty !== 'undefined') {
49
54
  // @ts-ignore
50
- return (_a = ty.getThemeInfo) === null || _a === void 0 ? void 0 : _a.call(ty);
55
+ tyApi.themeInfo = (_a = ty.getThemeInfo) === null || _a === void 0 ? void 0 : _a.call(ty);
56
+ return tyApi.themeInfo;
51
57
  }
52
58
  },
53
59
  isWX: () => {
@@ -3,7 +3,8 @@ declare const tyApi: {
3
3
  selectionVibrate: () => void;
4
4
  notificationVibrate: (v: any) => void;
5
5
  nativeDisabled: (v: boolean) => void;
6
- getThemeInfo: () => any;
6
+ themeInfo: Record<string, string> | null;
7
+ getThemeInfo: () => Record<string, string> | null | undefined;
7
8
  isWX: () => boolean;
8
9
  };
9
10
  export default tyApi;
package/lib/common/ty.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var systemInfo = wx.getSystemInfoSync();
3
+ var version_1 = require("./version");
4
+ var systemInfo = (0, version_1.getSystemInfoSync)();
4
5
  var isIOS = systemInfo.platform === 'ios';
5
6
  var tyApi = {
6
7
  vibrateShort: function (v) {
@@ -44,12 +45,17 @@ var tyApi = {
44
45
  (_a = ty.nativeDisabled) === null || _a === void 0 ? void 0 : _a.call(ty, v);
45
46
  }
46
47
  },
48
+ themeInfo: null,
47
49
  getThemeInfo: function () {
48
50
  var _a;
51
+ if (tyApi.themeInfo) {
52
+ return tyApi.themeInfo;
53
+ }
49
54
  // @ts-ignore
50
55
  if (typeof ty !== 'undefined') {
51
56
  // @ts-ignore
52
- return (_a = ty.getThemeInfo) === null || _a === void 0 ? void 0 : _a.call(ty);
57
+ tyApi.themeInfo = (_a = ty.getThemeInfo) === null || _a === void 0 ? void 0 : _a.call(ty);
58
+ return tyApi.themeInfo;
53
59
  }
54
60
  },
55
61
  isWX: function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.10.1-beta-2",
3
+ "version": "2.10.1-beta-3",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",