react-native-unistyles 3.0.20 → 3.0.21

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.
Files changed (64) hide show
  1. package/README.md +11 -11
  2. package/android/src/main/java/com/unistyles/NativePlatform+insets.kt +1 -1
  3. package/ios/Equatable.swift +11 -18
  4. package/ios/NativePlatform+keyboard.swift +23 -1
  5. package/nitrogen/generated/android/c++/JColorScheme.hpp +4 -5
  6. package/nitrogen/generated/android/c++/JDimensions.hpp +1 -1
  7. package/nitrogen/generated/android/c++/JFunc_void_UnistylesNativeMiniRuntime.hpp +1 -1
  8. package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.hpp +1 -1
  9. package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +1 -1
  10. package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.hpp +1 -1
  11. package/nitrogen/generated/android/c++/JInsets.hpp +1 -1
  12. package/nitrogen/generated/android/c++/JOrientation.hpp +3 -4
  13. package/nitrogen/generated/android/c++/JUnistyleDependency.hpp +17 -18
  14. package/nitrogen/generated/android/c++/JUnistylesNativeMiniRuntime.hpp +1 -1
  15. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/ColorScheme.kt +3 -1
  16. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Dimensions.kt +2 -2
  17. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Func_void_UnistylesNativeMiniRuntime.kt +1 -1
  18. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.kt +1 -1
  19. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +1 -1
  20. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Insets.kt +2 -2
  21. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Orientation.kt +3 -1
  22. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistyleDependency.kt +3 -1
  23. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistylesNativeMiniRuntime.kt +2 -2
  24. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/unistylesOnLoad.kt +1 -1
  25. package/nitrogen/generated/android/unistyles+autolinking.cmake +1 -1
  26. package/nitrogen/generated/android/unistyles+autolinking.gradle +1 -1
  27. package/nitrogen/generated/android/unistylesOnLoad.cpp +1 -1
  28. package/nitrogen/generated/android/unistylesOnLoad.hpp +1 -1
  29. package/nitrogen/generated/ios/Unistyles+autolinking.rb +2 -2
  30. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.cpp +1 -1
  31. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +1 -1
  32. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +1 -1
  33. package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.cpp +1 -1
  34. package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.hpp +1 -1
  35. package/nitrogen/generated/ios/swift/ColorScheme.swift +1 -1
  36. package/nitrogen/generated/ios/swift/Dimensions.swift +5 -17
  37. package/nitrogen/generated/ios/swift/Func_void_UnistylesNativeMiniRuntime.swift +1 -1
  38. package/nitrogen/generated/ios/swift/Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.swift +1 -1
  39. package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +1 -1
  40. package/nitrogen/generated/ios/swift/HybridNativePlatformSpec_cxx.swift +1 -1
  41. package/nitrogen/generated/ios/swift/Insets.swift +11 -41
  42. package/nitrogen/generated/ios/swift/Orientation.swift +1 -1
  43. package/nitrogen/generated/ios/swift/UnistyleDependency.swift +1 -1
  44. package/nitrogen/generated/ios/swift/UnistylesNativeMiniRuntime.swift +23 -89
  45. package/nitrogen/generated/shared/c++/ColorScheme.hpp +1 -1
  46. package/nitrogen/generated/shared/c++/Dimensions.hpp +16 -8
  47. package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.cpp +1 -1
  48. package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.hpp +1 -1
  49. package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.cpp +1 -1
  50. package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.hpp +1 -1
  51. package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.cpp +1 -1
  52. package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.hpp +1 -1
  53. package/nitrogen/generated/shared/c++/HybridUnistylesShadowRegistrySpec.cpp +1 -1
  54. package/nitrogen/generated/shared/c++/HybridUnistylesShadowRegistrySpec.hpp +1 -1
  55. package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.cpp +1 -1
  56. package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.hpp +1 -1
  57. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +1 -1
  58. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +1 -1
  59. package/nitrogen/generated/shared/c++/Insets.hpp +25 -17
  60. package/nitrogen/generated/shared/c++/Orientation.hpp +1 -1
  61. package/nitrogen/generated/shared/c++/UnistyleDependency.hpp +1 -1
  62. package/nitrogen/generated/shared/c++/UnistylesCxxMiniRuntime.hpp +52 -44
  63. package/nitrogen/generated/shared/c++/UnistylesNativeMiniRuntime.hpp +43 -35
  64. package/package.json +3 -3
@@ -2,7 +2,7 @@
2
2
  /// UnistylesCxxMiniRuntime.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -22,6 +22,11 @@
22
22
  #else
23
23
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
24
  #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
25
30
 
26
31
  // Forward declaration of `ColorScheme` to properly resolve imports.
27
32
  namespace margelo::nitro::unistyles { enum class ColorScheme; }
@@ -41,7 +46,7 @@ namespace margelo::nitro::unistyles {
41
46
  /**
42
47
  * A struct which can be represented as a JavaScript object (UnistylesCxxMiniRuntime).
43
48
  */
44
- struct UnistylesCxxMiniRuntime {
49
+ struct UnistylesCxxMiniRuntime final {
45
50
  public:
46
51
  std::optional<std::string> themeName SWIFT_PRIVATE;
47
52
  std::optional<std::string> breakpoint SWIFT_PRIVATE;
@@ -61,6 +66,9 @@ namespace margelo::nitro::unistyles {
61
66
  public:
62
67
  UnistylesCxxMiniRuntime() = default;
63
68
  explicit UnistylesCxxMiniRuntime(std::optional<std::string> themeName, std::optional<std::string> breakpoint, bool hasAdaptiveThemes, ColorScheme colorScheme, Dimensions screen, std::string contentSizeCategory, Insets insets, double pixelRatio, double fontScale, bool rtl, Dimensions statusBar, Dimensions navigationBar, bool isPortrait, bool isLandscape): themeName(themeName), breakpoint(breakpoint), hasAdaptiveThemes(hasAdaptiveThemes), colorScheme(colorScheme), screen(screen), contentSizeCategory(contentSizeCategory), insets(insets), pixelRatio(pixelRatio), fontScale(fontScale), rtl(rtl), statusBar(statusBar), navigationBar(navigationBar), isPortrait(isPortrait), isLandscape(isLandscape) {}
69
+
70
+ public:
71
+ friend bool operator==(const UnistylesCxxMiniRuntime& lhs, const UnistylesCxxMiniRuntime& rhs) = default;
64
72
  };
65
73
 
66
74
  } // namespace margelo::nitro::unistyles
@@ -73,38 +81,38 @@ namespace margelo::nitro {
73
81
  static inline margelo::nitro::unistyles::UnistylesCxxMiniRuntime fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
74
82
  jsi::Object obj = arg.asObject(runtime);
75
83
  return margelo::nitro::unistyles::UnistylesCxxMiniRuntime(
76
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "themeName")),
77
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "breakpoint")),
78
- JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "hasAdaptiveThemes")),
79
- JSIConverter<margelo::nitro::unistyles::ColorScheme>::fromJSI(runtime, obj.getProperty(runtime, "colorScheme")),
80
- JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, "screen")),
81
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "contentSizeCategory")),
82
- JSIConverter<margelo::nitro::unistyles::Insets>::fromJSI(runtime, obj.getProperty(runtime, "insets")),
83
- JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "pixelRatio")),
84
- JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "fontScale")),
85
- JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "rtl")),
86
- JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, "statusBar")),
87
- JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, "navigationBar")),
88
- JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "isPortrait")),
89
- JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "isLandscape"))
84
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "themeName"))),
85
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "breakpoint"))),
86
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasAdaptiveThemes"))),
87
+ JSIConverter<margelo::nitro::unistyles::ColorScheme>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "colorScheme"))),
88
+ JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "screen"))),
89
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "contentSizeCategory"))),
90
+ JSIConverter<margelo::nitro::unistyles::Insets>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "insets"))),
91
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pixelRatio"))),
92
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fontScale"))),
93
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rtl"))),
94
+ JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "statusBar"))),
95
+ JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "navigationBar"))),
96
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isPortrait"))),
97
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isLandscape")))
90
98
  );
91
99
  }
92
100
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::unistyles::UnistylesCxxMiniRuntime& arg) {
93
101
  jsi::Object obj(runtime);
94
- obj.setProperty(runtime, "themeName", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.themeName));
95
- obj.setProperty(runtime, "breakpoint", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.breakpoint));
96
- obj.setProperty(runtime, "hasAdaptiveThemes", JSIConverter<bool>::toJSI(runtime, arg.hasAdaptiveThemes));
97
- obj.setProperty(runtime, "colorScheme", JSIConverter<margelo::nitro::unistyles::ColorScheme>::toJSI(runtime, arg.colorScheme));
98
- obj.setProperty(runtime, "screen", JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.screen));
99
- obj.setProperty(runtime, "contentSizeCategory", JSIConverter<std::string>::toJSI(runtime, arg.contentSizeCategory));
100
- obj.setProperty(runtime, "insets", JSIConverter<margelo::nitro::unistyles::Insets>::toJSI(runtime, arg.insets));
101
- obj.setProperty(runtime, "pixelRatio", JSIConverter<double>::toJSI(runtime, arg.pixelRatio));
102
- obj.setProperty(runtime, "fontScale", JSIConverter<double>::toJSI(runtime, arg.fontScale));
103
- obj.setProperty(runtime, "rtl", JSIConverter<bool>::toJSI(runtime, arg.rtl));
104
- obj.setProperty(runtime, "statusBar", JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.statusBar));
105
- obj.setProperty(runtime, "navigationBar", JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.navigationBar));
106
- obj.setProperty(runtime, "isPortrait", JSIConverter<bool>::toJSI(runtime, arg.isPortrait));
107
- obj.setProperty(runtime, "isLandscape", JSIConverter<bool>::toJSI(runtime, arg.isLandscape));
102
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "themeName"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.themeName));
103
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "breakpoint"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.breakpoint));
104
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "hasAdaptiveThemes"), JSIConverter<bool>::toJSI(runtime, arg.hasAdaptiveThemes));
105
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "colorScheme"), JSIConverter<margelo::nitro::unistyles::ColorScheme>::toJSI(runtime, arg.colorScheme));
106
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "screen"), JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.screen));
107
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "contentSizeCategory"), JSIConverter<std::string>::toJSI(runtime, arg.contentSizeCategory));
108
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "insets"), JSIConverter<margelo::nitro::unistyles::Insets>::toJSI(runtime, arg.insets));
109
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "pixelRatio"), JSIConverter<double>::toJSI(runtime, arg.pixelRatio));
110
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "fontScale"), JSIConverter<double>::toJSI(runtime, arg.fontScale));
111
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "rtl"), JSIConverter<bool>::toJSI(runtime, arg.rtl));
112
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "statusBar"), JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.statusBar));
113
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "navigationBar"), JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.navigationBar));
114
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "isPortrait"), JSIConverter<bool>::toJSI(runtime, arg.isPortrait));
115
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "isLandscape"), JSIConverter<bool>::toJSI(runtime, arg.isLandscape));
108
116
  return obj;
109
117
  }
110
118
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -115,20 +123,20 @@ namespace margelo::nitro {
115
123
  if (!nitro::isPlainObject(runtime, obj)) {
116
124
  return false;
117
125
  }
118
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "themeName"))) return false;
119
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "breakpoint"))) return false;
120
- if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "hasAdaptiveThemes"))) return false;
121
- if (!JSIConverter<margelo::nitro::unistyles::ColorScheme>::canConvert(runtime, obj.getProperty(runtime, "colorScheme"))) return false;
122
- if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, "screen"))) return false;
123
- if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "contentSizeCategory"))) return false;
124
- if (!JSIConverter<margelo::nitro::unistyles::Insets>::canConvert(runtime, obj.getProperty(runtime, "insets"))) return false;
125
- if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "pixelRatio"))) return false;
126
- if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "fontScale"))) return false;
127
- if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "rtl"))) return false;
128
- if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, "statusBar"))) return false;
129
- if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, "navigationBar"))) return false;
130
- if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isPortrait"))) return false;
131
- if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isLandscape"))) return false;
126
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "themeName")))) return false;
127
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "breakpoint")))) return false;
128
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasAdaptiveThemes")))) return false;
129
+ if (!JSIConverter<margelo::nitro::unistyles::ColorScheme>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "colorScheme")))) return false;
130
+ if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "screen")))) return false;
131
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "contentSizeCategory")))) return false;
132
+ if (!JSIConverter<margelo::nitro::unistyles::Insets>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "insets")))) return false;
133
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pixelRatio")))) return false;
134
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fontScale")))) return false;
135
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rtl")))) return false;
136
+ if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "statusBar")))) return false;
137
+ if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "navigationBar")))) return false;
138
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isPortrait")))) return false;
139
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isLandscape")))) return false;
132
140
  return true;
133
141
  }
134
142
  };
@@ -2,7 +2,7 @@
2
2
  /// UnistylesNativeMiniRuntime.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -22,6 +22,11 @@
22
22
  #else
23
23
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
24
  #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
25
30
 
26
31
  // Forward declaration of `ColorScheme` to properly resolve imports.
27
32
  namespace margelo::nitro::unistyles { enum class ColorScheme; }
@@ -40,7 +45,7 @@ namespace margelo::nitro::unistyles {
40
45
  /**
41
46
  * A struct which can be represented as a JavaScript object (UnistylesNativeMiniRuntime).
42
47
  */
43
- struct UnistylesNativeMiniRuntime {
48
+ struct UnistylesNativeMiniRuntime final {
44
49
  public:
45
50
  ColorScheme colorScheme SWIFT_PRIVATE;
46
51
  Dimensions screen SWIFT_PRIVATE;
@@ -57,6 +62,9 @@ namespace margelo::nitro::unistyles {
57
62
  public:
58
63
  UnistylesNativeMiniRuntime() = default;
59
64
  explicit UnistylesNativeMiniRuntime(ColorScheme colorScheme, Dimensions screen, std::string contentSizeCategory, Insets insets, double pixelRatio, double fontScale, bool rtl, Dimensions statusBar, Dimensions navigationBar, bool isPortrait, bool isLandscape): colorScheme(colorScheme), screen(screen), contentSizeCategory(contentSizeCategory), insets(insets), pixelRatio(pixelRatio), fontScale(fontScale), rtl(rtl), statusBar(statusBar), navigationBar(navigationBar), isPortrait(isPortrait), isLandscape(isLandscape) {}
65
+
66
+ public:
67
+ friend bool operator==(const UnistylesNativeMiniRuntime& lhs, const UnistylesNativeMiniRuntime& rhs) = default;
60
68
  };
61
69
 
62
70
  } // namespace margelo::nitro::unistyles
@@ -69,32 +77,32 @@ namespace margelo::nitro {
69
77
  static inline margelo::nitro::unistyles::UnistylesNativeMiniRuntime fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
70
78
  jsi::Object obj = arg.asObject(runtime);
71
79
  return margelo::nitro::unistyles::UnistylesNativeMiniRuntime(
72
- JSIConverter<margelo::nitro::unistyles::ColorScheme>::fromJSI(runtime, obj.getProperty(runtime, "colorScheme")),
73
- JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, "screen")),
74
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "contentSizeCategory")),
75
- JSIConverter<margelo::nitro::unistyles::Insets>::fromJSI(runtime, obj.getProperty(runtime, "insets")),
76
- JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "pixelRatio")),
77
- JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "fontScale")),
78
- JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "rtl")),
79
- JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, "statusBar")),
80
- JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, "navigationBar")),
81
- JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "isPortrait")),
82
- JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "isLandscape"))
80
+ JSIConverter<margelo::nitro::unistyles::ColorScheme>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "colorScheme"))),
81
+ JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "screen"))),
82
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "contentSizeCategory"))),
83
+ JSIConverter<margelo::nitro::unistyles::Insets>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "insets"))),
84
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pixelRatio"))),
85
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fontScale"))),
86
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rtl"))),
87
+ JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "statusBar"))),
88
+ JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "navigationBar"))),
89
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isPortrait"))),
90
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isLandscape")))
83
91
  );
84
92
  }
85
93
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::unistyles::UnistylesNativeMiniRuntime& arg) {
86
94
  jsi::Object obj(runtime);
87
- obj.setProperty(runtime, "colorScheme", JSIConverter<margelo::nitro::unistyles::ColorScheme>::toJSI(runtime, arg.colorScheme));
88
- obj.setProperty(runtime, "screen", JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.screen));
89
- obj.setProperty(runtime, "contentSizeCategory", JSIConverter<std::string>::toJSI(runtime, arg.contentSizeCategory));
90
- obj.setProperty(runtime, "insets", JSIConverter<margelo::nitro::unistyles::Insets>::toJSI(runtime, arg.insets));
91
- obj.setProperty(runtime, "pixelRatio", JSIConverter<double>::toJSI(runtime, arg.pixelRatio));
92
- obj.setProperty(runtime, "fontScale", JSIConverter<double>::toJSI(runtime, arg.fontScale));
93
- obj.setProperty(runtime, "rtl", JSIConverter<bool>::toJSI(runtime, arg.rtl));
94
- obj.setProperty(runtime, "statusBar", JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.statusBar));
95
- obj.setProperty(runtime, "navigationBar", JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.navigationBar));
96
- obj.setProperty(runtime, "isPortrait", JSIConverter<bool>::toJSI(runtime, arg.isPortrait));
97
- obj.setProperty(runtime, "isLandscape", JSIConverter<bool>::toJSI(runtime, arg.isLandscape));
95
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "colorScheme"), JSIConverter<margelo::nitro::unistyles::ColorScheme>::toJSI(runtime, arg.colorScheme));
96
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "screen"), JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.screen));
97
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "contentSizeCategory"), JSIConverter<std::string>::toJSI(runtime, arg.contentSizeCategory));
98
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "insets"), JSIConverter<margelo::nitro::unistyles::Insets>::toJSI(runtime, arg.insets));
99
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "pixelRatio"), JSIConverter<double>::toJSI(runtime, arg.pixelRatio));
100
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "fontScale"), JSIConverter<double>::toJSI(runtime, arg.fontScale));
101
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "rtl"), JSIConverter<bool>::toJSI(runtime, arg.rtl));
102
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "statusBar"), JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.statusBar));
103
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "navigationBar"), JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.navigationBar));
104
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "isPortrait"), JSIConverter<bool>::toJSI(runtime, arg.isPortrait));
105
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "isLandscape"), JSIConverter<bool>::toJSI(runtime, arg.isLandscape));
98
106
  return obj;
99
107
  }
100
108
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -105,17 +113,17 @@ namespace margelo::nitro {
105
113
  if (!nitro::isPlainObject(runtime, obj)) {
106
114
  return false;
107
115
  }
108
- if (!JSIConverter<margelo::nitro::unistyles::ColorScheme>::canConvert(runtime, obj.getProperty(runtime, "colorScheme"))) return false;
109
- if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, "screen"))) return false;
110
- if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "contentSizeCategory"))) return false;
111
- if (!JSIConverter<margelo::nitro::unistyles::Insets>::canConvert(runtime, obj.getProperty(runtime, "insets"))) return false;
112
- if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "pixelRatio"))) return false;
113
- if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "fontScale"))) return false;
114
- if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "rtl"))) return false;
115
- if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, "statusBar"))) return false;
116
- if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, "navigationBar"))) return false;
117
- if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isPortrait"))) return false;
118
- if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isLandscape"))) return false;
116
+ if (!JSIConverter<margelo::nitro::unistyles::ColorScheme>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "colorScheme")))) return false;
117
+ if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "screen")))) return false;
118
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "contentSizeCategory")))) return false;
119
+ if (!JSIConverter<margelo::nitro::unistyles::Insets>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "insets")))) return false;
120
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pixelRatio")))) return false;
121
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fontScale")))) return false;
122
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rtl")))) return false;
123
+ if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "statusBar")))) return false;
124
+ if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "navigationBar")))) return false;
125
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isPortrait")))) return false;
126
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isLandscape")))) return false;
119
127
  return true;
120
128
  }
121
129
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-unistyles",
3
- "version": "3.0.20",
3
+ "version": "3.0.21",
4
4
  "description": "Level up your React Native StyleSheet",
5
5
  "scripts": {
6
6
  "test": "NODE_ENV=babel-test jest ./plugin",
@@ -146,11 +146,11 @@
146
146
  "husky": "9.1.7",
147
147
  "jest": "29.7.0",
148
148
  "metro-react-native-babel-preset": "0.77.0",
149
- "nitrogen": "0.31.10",
149
+ "nitrogen": "0.32.0",
150
150
  "react": "19.1.0",
151
151
  "react-native": "0.79.2",
152
152
  "react-native-builder-bob": "0.40.10",
153
- "react-native-nitro-modules": "0.31.10",
153
+ "react-native-nitro-modules": "0.32.0",
154
154
  "react-native-reanimated": "3.17.5",
155
155
  "react-native-web": "0.20.0",
156
156
  "react-test-renderer": "19.1.0",