react-native-unistyles 3.0.0-nightly-20250210 → 3.0.0-nightly-20250214
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/README.md +3 -0
- package/android/src/main/java/com/unistyles/NativePlatform+insets.kt +16 -1
- package/cxx/core/HostUnistyle.cpp +15 -5
- package/cxx/core/HostUnistyle.h +1 -0
- package/cxx/core/UnistylesCommitHook.cpp +20 -17
- package/cxx/core/UnistylesRegistry.cpp +8 -6
- package/cxx/shadowTree/ShadowTrafficController.h +10 -4
- package/cxx/shadowTree/ShadowTreeManager.cpp +38 -35
- package/lib/commonjs/components/native/Pressable.native.js +7 -0
- package/lib/commonjs/components/native/Pressable.native.js.map +1 -1
- package/lib/commonjs/core/useProxifiedUnistyles/useProxifiedUnistyles.js +2 -2
- package/lib/commonjs/core/useProxifiedUnistyles/useProxifiedUnistyles.js.map +1 -1
- package/lib/commonjs/core/withUnistyles/withUnistyles.native.js +3 -1
- package/lib/commonjs/core/withUnistyles/withUnistyles.native.js.map +1 -1
- package/lib/module/components/native/Pressable.native.js +7 -0
- package/lib/module/components/native/Pressable.native.js.map +1 -1
- package/lib/module/core/useProxifiedUnistyles/useProxifiedUnistyles.js +2 -2
- package/lib/module/core/useProxifiedUnistyles/useProxifiedUnistyles.js.map +1 -1
- package/lib/module/core/withUnistyles/withUnistyles.native.js +4 -2
- package/lib/module/core/withUnistyles/withUnistyles.native.js.map +1 -1
- package/lib/typescript/src/components/native/Pressable.native.d.ts.map +1 -1
- package/lib/typescript/src/core/useProxifiedUnistyles/useProxifiedUnistyles.d.ts +2 -1
- package/lib/typescript/src/core/useProxifiedUnistyles/useProxifiedUnistyles.d.ts.map +1 -1
- package/lib/typescript/src/core/withUnistyles/withUnistyles.native.d.ts.map +1 -1
- package/lib/typescript/src/types/stylesheet.d.ts +1 -1
- package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
- package/package.json +19 -9
- package/plugin/index.d.ts +51 -18
- package/plugin/index.js +785 -178
- package/src/components/native/Pressable.native.tsx +8 -0
- package/src/core/useProxifiedUnistyles/useProxifiedUnistyles.ts +2 -2
- package/src/core/withUnistyles/withUnistyles.native.tsx +5 -3
- package/src/types/stylesheet.ts +1 -1
- package/plugin/consts.js +0 -63
- package/plugin/exotic.js +0 -54
- package/plugin/import.js +0 -51
- package/plugin/ref.js +0 -11
- package/plugin/stylesheet.js +0 -565
- package/plugin/variants.js +0 -66
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-native-unistyles",
|
3
|
-
"version": "3.0.0-nightly-
|
3
|
+
"version": "3.0.0-nightly-20250214",
|
4
4
|
"description": "Level up your React Native StyleSheet",
|
5
5
|
"scripts": {
|
6
6
|
"test": "jest",
|
@@ -9,9 +9,10 @@
|
|
9
9
|
"lint": "biome lint",
|
10
10
|
"check": "biome check --write",
|
11
11
|
"check:ci": "biome check",
|
12
|
-
"prepare": "husky && bob build",
|
12
|
+
"prepare": "husky && bob build && yarn plugin:build",
|
13
13
|
"precommit": "concurrently 'yarn tsc' 'yarn lint' 'yarn check' 'yarn test'",
|
14
|
-
"release": "release-it"
|
14
|
+
"release": "release-it",
|
15
|
+
"plugin:build": "node plugin/esbuild.js"
|
15
16
|
},
|
16
17
|
"main": "lib/commonjs/index.js",
|
17
18
|
"module": "lib/module/index.js",
|
@@ -21,24 +22,25 @@
|
|
21
22
|
".": {
|
22
23
|
"types": "./lib/typescript/src/index.d.ts",
|
23
24
|
"module": "./lib/module/index.js",
|
24
|
-
"
|
25
|
-
"
|
25
|
+
"react-native": "./src/index",
|
26
|
+
"default": "./lib/commonjs/index.js"
|
26
27
|
},
|
27
28
|
"./components/native/*": {
|
28
29
|
"module": "./lib/module/components/native/*",
|
29
|
-
"
|
30
|
-
"
|
30
|
+
"react-native": "./src/components/native/*",
|
31
|
+
"default": "./lib/commonjs/components/native/*"
|
31
32
|
},
|
32
33
|
"./plugin": {
|
33
34
|
"module": "./plugin/index.js",
|
35
|
+
"types": "./plugin/index.d.ts",
|
34
36
|
"default": "./plugin/index.js"
|
35
37
|
},
|
36
38
|
"./package.json": "./package.json",
|
37
39
|
"./server": {
|
38
40
|
"types": "./lib/typescript/src/server/index.d.ts",
|
39
41
|
"module": "./lib/module/server/index.js",
|
40
|
-
"
|
41
|
-
"
|
42
|
+
"react-native": "./src/server",
|
43
|
+
"default": "./lib/commonjs/server/index.js"
|
42
44
|
}
|
43
45
|
},
|
44
46
|
"files": [
|
@@ -54,6 +56,8 @@
|
|
54
56
|
"react-native.config.js",
|
55
57
|
"Unistyles.podspec",
|
56
58
|
"!plugin/__tests__",
|
59
|
+
"!plugin/src",
|
60
|
+
"!plugin/esbuild.js",
|
57
61
|
"!ios/build",
|
58
62
|
"!android/build",
|
59
63
|
"!android/gradle",
|
@@ -83,9 +87,11 @@
|
|
83
87
|
"registry": "https://registry.npmjs.org/"
|
84
88
|
},
|
85
89
|
"devDependencies": {
|
90
|
+
"@babel/core": "7.26.8",
|
86
91
|
"@babel/plugin-syntax-jsx": "7.25.9",
|
87
92
|
"@babel/preset-flow": "7.25.9",
|
88
93
|
"@babel/preset-typescript": "7.26.0",
|
94
|
+
"@babel/types": "7.26.8",
|
89
95
|
"@biomejs/biome": "1.9.4",
|
90
96
|
"@commitlint/config-conventional": "19.6.0",
|
91
97
|
"@react-native/normalize-colors": "0.77.0",
|
@@ -95,6 +101,7 @@
|
|
95
101
|
"babel-plugin-tester": "11.0.4",
|
96
102
|
"commitlint": "19.6.1",
|
97
103
|
"concurrently": "9.1.2",
|
104
|
+
"esbuild": "0.25.0",
|
98
105
|
"husky": "9.1.7",
|
99
106
|
"jest": "29.7.0",
|
100
107
|
"metro-react-native-babel-preset": "0.77.0",
|
@@ -178,5 +185,8 @@
|
|
178
185
|
"name": "TurboUnistyles",
|
179
186
|
"type": "modules",
|
180
187
|
"jsSrcsDir": "./src/specs/TurboUnistyles"
|
188
|
+
},
|
189
|
+
"resolutions": {
|
190
|
+
"@babel/types": "7.26.8"
|
181
191
|
}
|
182
192
|
}
|
package/plugin/index.d.ts
CHANGED
@@ -1,18 +1,43 @@
|
|
1
|
-
|
1
|
+
interface RemapImport {
|
2
|
+
/**
|
3
|
+
* The target import name if `isDefault` is false.
|
4
|
+
*/
|
2
5
|
name?: string,
|
6
|
+
|
7
|
+
/**
|
8
|
+
* Whether the import is default.
|
9
|
+
*/
|
3
10
|
isDefault: boolean,
|
11
|
+
|
12
|
+
/**
|
13
|
+
* The path to the target import.
|
14
|
+
*/
|
4
15
|
path: string,
|
16
|
+
|
17
|
+
/**
|
18
|
+
* The name of the Unistyles component, check `react-native-unistyles/src/components/native`
|
19
|
+
*/
|
5
20
|
mapTo: string
|
6
21
|
}
|
7
22
|
|
8
|
-
|
23
|
+
/**
|
24
|
+
* A more powerful API that allows converting unmatched imports to Unistyles.
|
25
|
+
*/
|
26
|
+
export interface RemapConfig {
|
27
|
+
/**
|
28
|
+
* The node_modules path.
|
29
|
+
*/
|
9
30
|
path: string,
|
31
|
+
|
32
|
+
/**
|
33
|
+
* An array of import objects with the following properties:
|
34
|
+
*/
|
10
35
|
imports: Array<RemapImport>
|
11
36
|
}
|
12
37
|
|
13
38
|
export interface UnistylesPluginOptions {
|
14
39
|
/**
|
15
|
-
* Example:
|
40
|
+
* Example: 'src' or 'apps/mobile'
|
16
41
|
* Add this option if some of your components don't have `react-native-unistyles` import.
|
17
42
|
* Babel plugin will automatically process all files under this root.
|
18
43
|
*/
|
@@ -25,29 +50,41 @@ export interface UnistylesPluginOptions {
|
|
25
50
|
autoProcessImports?: Array<string>,
|
26
51
|
|
27
52
|
/**
|
28
|
-
* Example:
|
29
|
-
*
|
53
|
+
* Example:
|
54
|
+
* ```js
|
55
|
+
* [{
|
56
|
+
* path: 'node_modules/custom-library/components',
|
30
57
|
* imports: [
|
31
58
|
* {
|
32
|
-
* name:
|
59
|
+
* name: 'NativeText',
|
33
60
|
* isDefault: false,
|
34
|
-
* path:
|
35
|
-
* mapTo:
|
61
|
+
* path: 'react-native/Libraries/Text/TextNativeComponent',
|
62
|
+
* mapTo: 'NativeText'
|
36
63
|
* },
|
37
64
|
* {
|
38
65
|
* isDefault: true,
|
39
|
-
* path:
|
40
|
-
* mapTo:
|
66
|
+
* path: 'react-native/Libraries/Components/View/ViewNativeComponent',
|
67
|
+
* mapTo: 'NativeView'
|
41
68
|
* }
|
42
69
|
* ]
|
43
70
|
* }]
|
71
|
+
* ```
|
44
72
|
*
|
45
73
|
* Will map:
|
46
|
-
* import { NativeText } from "react-native/Libraries/Text/TextNativeComponent"
|
47
|
-
* to Unistyles "NativeText"
|
48
74
|
*
|
49
|
-
*
|
50
|
-
*
|
75
|
+
* ```js
|
76
|
+
* import { NativeText } from 'react-native/Libraries/Text/TextNativeComponent'
|
77
|
+
* ```
|
78
|
+
*
|
79
|
+
* to Unistyles 'NativeText'
|
80
|
+
*
|
81
|
+
* and
|
82
|
+
*
|
83
|
+
* ```js
|
84
|
+
* import View from 'react-native/Libraries/Components/View/ViewNativeComponent'
|
85
|
+
* ```
|
86
|
+
*
|
87
|
+
* to Unistyles 'NativeView'
|
51
88
|
*
|
52
89
|
* This is the most powerful way of remapping imports. If 3rd party library uses imports different from `react-native` we can remap them to `react-native-unistyles` factories.
|
53
90
|
* Internally we do that for raw RCTView and RCTText components.
|
@@ -83,7 +120,3 @@ export interface UnistylesPluginOptions {
|
|
83
120
|
*/
|
84
121
|
isLocal?: boolean
|
85
122
|
}
|
86
|
-
|
87
|
-
export interface UnistylesPluginPass {
|
88
|
-
opts: UnistylesPluginOptions
|
89
|
-
}
|