@tarojs/runtime-rn 3.4.0-beta.3 → 3.5.0-canary.1

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/compute.js CHANGED
@@ -9,14 +9,14 @@ const defaultRadio = {
9
9
  export function pxTransform(size) {
10
10
  var _a;
11
11
  const deviceWidthDp = Dimensions.get('window').width;
12
- const uiWidthPx = 375;
12
+ const uiWidthPx = 750;
13
13
  const config = ((_a = globalAny.__taroAppConfig) === null || _a === void 0 ? void 0 : _a.appConfig) || {};
14
14
  const { designWidth = defaultWidth, deviceRatio = defaultRadio } = config;
15
15
  if (!(designWidth in deviceRatio)) {
16
16
  throw new Error(`deviceRatio 配置中不存在 ${designWidth} 的设置!`);
17
17
  }
18
18
  const formatSize = ~~size;
19
- const rateSize = formatSize / (deviceRatio[designWidth] * 2);
19
+ const rateSize = formatSize * deviceRatio[designWidth];
20
20
  return rateSize * deviceWidthDp / uiWidthPx;
21
21
  }
22
22
  //# sourceMappingURL=compute.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compute.js","sourceRoot":"","sources":["../src/compute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAGzC,MAAM,SAAS,GAAQ,MAAM,CAAA;AAC7B,MAAM,YAAY,GAAG,GAAG,CAAA;AACxB,MAAM,YAAY,GAAG;IACnB,GAAG,EAAE,IAAI,GAAG,CAAC;IACb,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,IAAI,GAAG,CAAC;CACd,CAAA;AAED,MAAM,UAAU,WAAW,CAAE,IAAY;;IACvC,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAA;IACpD,MAAM,SAAS,GAAG,GAAG,CAAA;IACrB,MAAM,MAAM,GAAc,CAAA,MAAA,SAAS,CAAC,eAAe,0CAAE,SAAS,KAAI,EAAE,CAAA;IACpE,MAAM,EAAE,WA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GAAG,WAAW,CAAC,WAAW,CAAC,CAAA;IACtD,OAAO,QAAQ,GAAG,aAAa,GAAG,SAAS,CAAA;AAC7C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/runtime-rn",
3
- "version": "3.4.0-beta.3",
3
+ "version": "3.5.0-canary.1",
4
4
  "description": "taro-runtime-rn",
5
5
  "main": "dist/index.js",
6
6
  "types": "./src/index.ts",
@@ -28,8 +28,8 @@
28
28
  "url": "https://github.com/NervJS/taro/issues"
29
29
  },
30
30
  "dependencies": {
31
- "@tarojs/components-rn": "3.4.0-beta.3",
32
- "@tarojs/router-rn": "3.4.0-beta.3"
31
+ "@tarojs/components-rn": "3.5.0-canary.1",
32
+ "@tarojs/router-rn": "3.5.0-canary.1"
33
33
  },
34
34
  "resolutions": {
35
35
  "@types/react": "17.0.11"
@@ -37,5 +37,5 @@
37
37
  "devDependencies": {
38
38
  "@types/react-native": "0.66.5"
39
39
  },
40
- "gitHead": "2ef7e8c10c9e5784e98bb1ad3a803d5fd6a46c8b"
40
+ "gitHead": "c61624d2f763e6d31e67d6cf9c564efc8b0d0887"
41
41
  }
package/src/compute.ts CHANGED
@@ -11,13 +11,13 @@ const defaultRadio = {
11
11
 
12
12
  export function pxTransform (size: number): number {
13
13
  const deviceWidthDp = Dimensions.get('window').width
14
- const uiWidthPx = 375
14
+ const uiWidthPx = 750
15
15
  const config: AppConfig = globalAny.__taroAppConfig?.appConfig || {}
16
16
  const { designWidth = defaultWidth, deviceRatio = defaultRadio } = config
17
17
  if (!(designWidth in deviceRatio)) {
18
18
  throw new Error(`deviceRatio 配置中不存在 ${designWidth} 的设置!`)
19
19
  }
20
20
  const formatSize = ~~size
21
- const rateSize = formatSize / (deviceRatio[designWidth] * 2)
21
+ const rateSize = formatSize * deviceRatio[designWidth]
22
22
  return rateSize * deviceWidthDp / uiWidthPx
23
23
  }