react-native-unistyles 3.0.0-nightly-20250616 → 3.0.0-nightly-20250617

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 CHANGED
@@ -29,7 +29,7 @@ yarn add react-native-edge-to-edge react-native-nitro-modules@0.26.2
29
29
  | react-native-unistyles | react-native-nitro-modules |
30
30
  |------------------------|----------------------------|
31
31
  | 3.0.0-rc.5 | 0.26.2 |
32
- | 3.0.0-nightly-20250613 | 0.26.2 |
32
+ | 3.0.0-nightly-20250616 | 0.26.2 |
33
33
 
34
34
  Then follow [installation guides](https://unistyl.es/v3/start/getting-started) for your platform.
35
35
 
@@ -30,10 +30,12 @@ class NativePlatformInsets(
30
30
  init {
31
31
  // get initial insets
32
32
  reactContext.currentActivity?.let { activity ->
33
- val insets = ViewCompat.getRootWindowInsets(activity.window.decorView)
33
+ activity.findViewById<View>(android.R.id.content)?.let { mainView ->
34
+ val insets = ViewCompat.getRootWindowInsets(mainView)
34
35
 
35
- insets?.let { windowInsets ->
36
- setInsets(windowInsets, activity.window, null, true)
36
+ insets?.let { windowInsets ->
37
+ setInsets(windowInsets, activity.window, null, true)
38
+ }
37
39
  }
38
40
  }
39
41
  }
@@ -164,7 +166,7 @@ class NativePlatformInsets(
164
166
 
165
167
  fun stopInsetsListener() {
166
168
  reactContext.currentActivity?.let { activity ->
167
- activity.window?.decorView?.let { view ->
169
+ activity.findViewById<View>(android.R.id.content)?.let { view ->
168
170
  ViewCompat.setOnApplyWindowInsetsListener(view, null)
169
171
  }
170
172
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-unistyles",
3
- "version": "3.0.0-nightly-20250616",
3
+ "version": "3.0.0-nightly-20250617",
4
4
  "description": "Level up your React Native StyleSheet",
5
5
  "scripts": {
6
6
  "test": "NODE_ENV=babel-test jest ./plugin",
@@ -91,6 +91,7 @@
91
91
  "react-native.config.js",
92
92
  "Unistyles.podspec",
93
93
  "repack-plugin",
94
+ "rn_version.rb",
94
95
  "!repack-plugin/__tests__",
95
96
  "!repack-plugin/src",
96
97
  "!repack-plugin/esbuild.js",
package/rn_version.rb ADDED
@@ -0,0 +1,28 @@
1
+ require 'json'
2
+
3
+ def get_rn_version(rn_path)
4
+ rn_path = rn_path || '../node_modules/react-native'
5
+
6
+ maybe_rn_pkg_json = File.expand_path(File.join(rn_path, 'package.json'))
7
+ maybe_local_rn_pkg_json = File.expand_path('./node_modules/react-native/package.json')
8
+
9
+ rn_pkg_json =
10
+ if File.exist?(maybe_rn_pkg_json)
11
+ maybe_rn_pkg_json
12
+ elsif File.exist?(maybe_local_rn_pkg_json)
13
+ maybe_local_rn_pkg_json
14
+ else
15
+ nil
16
+ end
17
+
18
+ unless rn_pkg_json
19
+ warn "🦄 Unistyles: React Native not found. Frameworks :static will use all dependencies which might fail for older versions of React Native."
20
+ return nil
21
+ end
22
+
23
+ rn_pkg = JSON.parse(File.read(rn_pkg_json))
24
+ rn_version = rn_pkg['version']
25
+ parsed_version = Gem::Version.new(rn_version).segments[1]
26
+
27
+ parsed_version
28
+ end