@tarojs/runtime-rn 3.6.1 → 3.6.2-canary.0
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/LICENSE +21 -0
- package/dist/scale2dp.js +7 -2
- package/dist/scale2dp.js.map +1 -1
- package/package.json +4 -7
- package/src/scale2dp.tsx +8 -2
package/LICENSE
CHANGED
|
@@ -137,3 +137,24 @@ MIT (miniprogram-render):
|
|
|
137
137
|
The following files embed [miniprogram-render](https://github.com/Tencent/kbone) MIT:
|
|
138
138
|
`/packages/taro-plugin-http/src/runtime/Cookie.ts`
|
|
139
139
|
See `/LICENSE` for details of the license.
|
|
140
|
+
|
|
141
|
+
==================
|
|
142
|
+
|
|
143
|
+
MIT (stencil-ds-output-targets):
|
|
144
|
+
The following files embed [stencil-ds-output-targets](https://github.com/ionic-team/stencil-ds-output-targets/) MIT:
|
|
145
|
+
`/packages/taro-components-library-react/src/react-component-lib/utils/attachProps.ts`
|
|
146
|
+
`/packages/taro-components-library-react/src/react-component-lib/utils/case.ts`
|
|
147
|
+
`/packages/taro-components-library-react/src/react-component-lib/utils/dev.ts`
|
|
148
|
+
`/packages/taro-components-library-react/src/react-component-lib/utils/index.tsx`
|
|
149
|
+
`/packages/taro-components-library-react/src/react-component-lib/createComponent.tsx`
|
|
150
|
+
`/packages/taro-components-library-react/src/react-component-lib/createOverlayComponent.tsx`
|
|
151
|
+
`/packages/taro-components-library-react/src/react-component-lib/interfaces.ts`
|
|
152
|
+
`/packages/taro-components-library-vue3/src/vue-component-lib/utils.ts`
|
|
153
|
+
See `/LICENSE` for details of the license.
|
|
154
|
+
|
|
155
|
+
==================
|
|
156
|
+
|
|
157
|
+
MIT (stencil-vue2-output-target):
|
|
158
|
+
The following files embed [stencil-vue2-output-target](https://github.com/diondree/stencil-vue2-output-target) MIT:
|
|
159
|
+
`/packages/taro-components-library-vue2/src/vue-component-lib/utils.ts`
|
|
160
|
+
See `/LICENSE` for details of the license.
|
package/dist/scale2dp.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { Dimensions } from 'react-native';
|
|
1
|
+
import { Dimensions, Platform } from 'react-native';
|
|
2
2
|
// 一般app 只有竖屏模式,所以可以只获取一次 width
|
|
3
3
|
const deviceWidthDp = Dimensions.get('window').width;
|
|
4
4
|
const deviceHeightDp = Dimensions.get('window').height;
|
|
5
|
-
|
|
5
|
+
let uiWidthPx = 375;
|
|
6
|
+
if (Platform.OS === 'ios') {
|
|
7
|
+
if (Platform.isPad) {
|
|
8
|
+
uiWidthPx = 750;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
6
11
|
export function scalePx2dp(uiElementPx) {
|
|
7
12
|
return uiElementPx * deviceWidthDp / uiWidthPx;
|
|
8
13
|
}
|
package/dist/scale2dp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scale2dp.js","sourceRoot":"","sources":["../src/scale2dp.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"scale2dp.js","sourceRoot":"","sources":["../src/scale2dp.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEnD,+BAA+B;AAC/B,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAA;AACpD,MAAM,cAAc,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAA;AACtD,IAAI,SAAS,GAAG,GAAG,CAAA;AAEnB,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE;IACzB,IAAI,QAAQ,CAAC,KAAK,EAAE;QAClB,SAAS,GAAG,GAAG,CAAA;KAChB;CACF;AAED,MAAM,UAAU,UAAU,CAAE,WAAW;IACrC,OAAO,WAAW,GAAG,aAAa,GAAG,SAAS,CAAA;AAChD,CAAC;AACD,MAAM,UAAU,UAAU,CAAE,WAAW,EAAE,IAAI;IAC3C,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,WAAW,GAAG,cAAc,GAAG,GAAG,CAAA;IAC5D,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,cAAc,CAAC,GAAG,GAAG,CAAA;IACvF,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,cAAc,CAAC,GAAG,GAAG,CAAA;IACvF,OAAO,WAAW,GAAG,aAAa,GAAG,GAAG,CAAA;AAC1C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/runtime-rn",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.2-canary.0",
|
|
4
4
|
"description": "taro-runtime-rn",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"react-native-root-siblings": "^4.1.1",
|
|
24
|
-
"@tarojs/components-rn": "3.6.
|
|
25
|
-
"@tarojs/router-rn": "3.6.
|
|
24
|
+
"@tarojs/components-rn": "3.6.2-canary.0",
|
|
25
|
+
"@tarojs/router-rn": "3.6.2-canary.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/react-native": "^0.69.8"
|
|
@@ -30,9 +30,6 @@
|
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "tsc",
|
|
32
32
|
"dev": "tsc -w",
|
|
33
|
-
"lint": "eslint ."
|
|
34
|
-
"test": "jest",
|
|
35
|
-
"test:dev": "jest --watch",
|
|
36
|
-
"test:coverage": "jest --coverage"
|
|
33
|
+
"lint": "eslint ."
|
|
37
34
|
}
|
|
38
35
|
}
|
package/src/scale2dp.tsx
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { Dimensions } from 'react-native'
|
|
1
|
+
import { Dimensions, Platform } from 'react-native'
|
|
2
2
|
|
|
3
3
|
// 一般app 只有竖屏模式,所以可以只获取一次 width
|
|
4
4
|
const deviceWidthDp = Dimensions.get('window').width
|
|
5
5
|
const deviceHeightDp = Dimensions.get('window').height
|
|
6
|
-
|
|
6
|
+
let uiWidthPx = 375
|
|
7
|
+
|
|
8
|
+
if (Platform.OS === 'ios') {
|
|
9
|
+
if (Platform.isPad) {
|
|
10
|
+
uiWidthPx = 750
|
|
11
|
+
}
|
|
12
|
+
}
|
|
7
13
|
|
|
8
14
|
export function scalePx2dp (uiElementPx) {
|
|
9
15
|
return uiElementPx * deviceWidthDp / uiWidthPx
|