react-native-unistyles 2.6.0-rc.1 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -9,9 +9,12 @@
9
9
  [![platform - web](https://img.shields.io/badge/React_Native_Web-white?logo=react&logoColor=57BDDA&style=for-the-badge)](https://www.w3.org/)
10
10
  [![platform - ios](https://img.shields.io/badge/iOS-000?logo=apple&style=for-the-badge)](https://developer.apple.com/ios/)
11
11
  [![platform - macos](https://img.shields.io/badge/macOS-000?logo=apple&style=for-the-badge)](https://developer.apple.com/macos/)
12
+ [![platform - appletv](https://img.shields.io/badge/Apple_TV-000?logo=apple&style=for-the-badge)](https://developer.apple.com/tvos/)
13
+ [![platform - visionos](https://img.shields.io/badge/vision_os-000?logo=apple&style=for-the-badge)](https://developer.apple.com/visionos/)
14
+ [![platform - android](https://img.shields.io/badge/Android-44CD11?style=for-the-badge&logo=android&logoColor=white)](https://developer.android.com/)
15
+ [![platform - androidtv](https://img.shields.io/badge/Android_TV-44CD11?style=for-the-badge&logo=android&logoColor=white)](https://www.android.com/intl/pl_pl/tv/)
12
16
  [![platform - windows](https://img.shields.io/badge/windows-00a2ed?logo=windows&style=for-the-badge)](https://microsoft.github.io/react-native-windows/docs/getting-started)
13
17
  [![platform - ssr](https://img.shields.io/badge/SSR-black?style=for-the-badge&logo=next.js&logoColor=white)](https://nextjs.org/)
14
- [![platform - android](https://img.shields.io/badge/Android-44CD11?style=for-the-badge&logo=android&logoColor=white)](https://developer.android.com/)
15
18
 
16
19
  <a href="https://github.com/jpudysz?tab=followers">
17
20
  <img src="https://img.shields.io/github/followers/jpudysz?label=Follow%20%40jpudysz&style=social" />
@@ -30,7 +33,7 @@
30
33
 
31
34
  ## Features
32
35
  - 🚀 Shared core with C++ and JSI bindings
33
- - 🌉 Supports new architecture
36
+ - 🌉 Supports new architecture and bridgeless mode
34
37
  - 🔥 Crazy performance, adds under 0.1 ms to your StyleSheet
35
38
  - 🎳 Share up to 100% of your styles across platforms in monorepo
36
39
  - 🎯 Doesn't introduce new components, everything is packed in one hook
@@ -56,7 +59,18 @@
56
59
  <a href="https://github.com/kmartinezmedia">
57
60
  <img src="https://avatars.githubusercontent.com/u/6308123?s=200&v=4" height="70px" width="70px" alt="kmartinezmedia" />
58
61
  </a>
62
+ <a href="https://github.com/mobily">
63
+ <img src="https://avatars.githubusercontent.com/u/1467712?v=4" height="70px" width="70px" alt="mobily" />
64
+ </a>
65
+ <a href="https://github.com/levibuzolic">
66
+ <img src="https://avatars.githubusercontent.com/u/721323?v=4" height="70px" width="70px" alt="levibuzolic" />
67
+ </a>
68
+
69
+ ## UI Kits
59
70
 
71
+ <a href="https://stacks.grapp.dev/">
72
+ <img src="https://raw.githubusercontent.com/grapp-dev/stacks/main/assets/stacks-logo.png" height="70px" width="70px" alt="Stacks" />
73
+ </a>
60
74
 
61
75
  ## Installation
62
76
 
@@ -66,7 +80,7 @@ yarn add react-native-unistyles
66
80
 
67
81
  ## Benchmarks
68
82
 
69
- <img src="https://reactnativeunistyles.vercel.app/_astro/benchmark-2.jAtWyu0v.png" />
83
+ <img src="https://www.unistyl.es/_astro/benchmark-2.CMC1bK7S.png" />
70
84
 
71
85
 
72
86
  ## Discord
@@ -220,6 +220,10 @@ jsi::Value UnistylesRuntime::get(jsi::Runtime& runtime, const jsi::PropNameID& p
220
220
  1,
221
221
  [this](jsi::Runtime &runtime, const jsi::Value &thisVal, const jsi::Value *arguments, size_t count) -> jsi::Value {
222
222
  bool enableAdaptiveThemes = arguments[0].asBool();
223
+
224
+ if (enableAdaptiveThemes && this->colorScheme == UnistylesUnspecifiedScheme) {
225
+ throw jsi::JSError(runtime, UnistylesErrorAdaptiveThemesNotSupported);
226
+ }
223
227
 
224
228
  this->hasAdaptiveThemes = enableAdaptiveThemes;
225
229
 
@@ -17,6 +17,7 @@ const std::string UnistylesUnspecifiedScheme = "unspecified";
17
17
  const std::string UnistylesErrorBreakpointsCannotBeEmpty = "You are trying to register empty breakpoints object";
18
18
  const std::string UnistylesErrorBreakpointsMustStartFromZero = "You are trying to register breakpoints that don't start from 0";
19
19
  const std::string UnistylesErrorThemesCannotBeEmpty = "You are trying to register empty themes object";
20
+ const std::string UnistylesErrorAdaptiveThemesNotSupported = "Your platform doesn't support adaptive themes";
20
21
 
21
22
  struct Dimensions {
22
23
  int width;
@@ -8,6 +8,8 @@
8
8
  #import "Platform_iOS.h"
9
9
  #elif TARGET_OS_TV
10
10
  #import "Platform_tvOS.h"
11
+ #elif TARGET_OS_VISION
12
+ #import "Platform_visionOS.h"
11
13
  #endif
12
14
 
13
15
  @interface UnistylesModule : RCTEventEmitter<RCTBridgeModule>
@@ -0,0 +1,25 @@
1
+ #include <string>
2
+ #include <map>
3
+ #include <UnistylesRuntime.h>
4
+ #import <UIKit/UIKit.h>
5
+
6
+ @interface Platform : NSObject
7
+
8
+ @property (nonatomic, assign) Dimensions initialScreen;
9
+ @property (nonatomic, assign) std::string initialColorScheme;
10
+ @property (nonatomic, assign) std::string initialContentSizeCategory;
11
+ @property (nonatomic, assign) Insets initialInsets;
12
+ @property (nonatomic, assign) Dimensions initialStatusBar;
13
+ @property (nonatomic, assign) Dimensions initialNavigationBar;
14
+ @property (nonatomic, assign) void* unistylesRuntime;
15
+
16
+ - (instancetype)init;
17
+
18
+ - (void)setupListeners;
19
+ - (UIWindow *)getMainWindow;
20
+ - (std::string)getContentSizeCategory:(UIContentSizeCategory)contentSizeCategory;
21
+ - (void)onContentSizeCategoryChange:(NSNotification *)notification;
22
+ - (void)onWindowResize:(NSNotification *)notification;
23
+
24
+ @end
25
+
@@ -0,0 +1,164 @@
1
+ #if TARGET_OS_VISION
2
+
3
+ #import "Platform_visionOS.h"
4
+ #import "UnistylesRuntime.h"
5
+ #import <React/RCTAppearance.h>
6
+
7
+ @implementation Platform
8
+
9
+ - (instancetype)init {
10
+ self = [super init];
11
+ if (self) {
12
+ UIWindow* mainWindow = [self getMainWindow];
13
+ UIContentSizeCategory contentSizeCategory = [[UIApplication sharedApplication] preferredContentSizeCategory];
14
+
15
+ self.initialScreen = {(int)mainWindow.bounds.size.width, (int)mainWindow.bounds.size.height};
16
+ self.initialColorScheme = UnistylesUnspecifiedScheme;
17
+ self.initialContentSizeCategory = [self getContentSizeCategory:contentSizeCategory];
18
+ self.initialStatusBar = [self getStatusBarDimensions];
19
+ self.initialInsets = [self getInsets];
20
+
21
+ [self setupListeners];
22
+ }
23
+ return self;
24
+ }
25
+
26
+ - (UIWindow *)getMainWindow {
27
+ if (RCTRunningInAppExtension()) {
28
+ return nil;
29
+ }
30
+
31
+ for (UIScene* scene in RCTSharedApplication().connectedScenes) {
32
+ if (scene.activationState != UISceneActivationStateForegroundActive || ![scene isKindOfClass:[UIWindowScene class]]) {
33
+ continue;
34
+ }
35
+ UIWindowScene *windowScene = (UIWindowScene *)scene;
36
+
37
+ for (UIWindow *window in windowScene.windows) {
38
+ if (window.isKeyWindow) {
39
+ return window;
40
+ }
41
+ }
42
+ }
43
+
44
+ return nil;
45
+ }
46
+
47
+ - (void)dealloc {
48
+ if (self.unistylesRuntime != nullptr) {
49
+ self.unistylesRuntime = nullptr;
50
+ }
51
+
52
+ [[NSNotificationCenter defaultCenter] removeObserver:self
53
+ name: UIContentSizeCategoryDidChangeNotification
54
+ object: nil];
55
+ [[NSNotificationCenter defaultCenter] removeObserver:self
56
+ name: RCTWindowFrameDidChangeNotification
57
+ object: nil];
58
+ }
59
+
60
+ - (void)setupListeners {
61
+ [[NSNotificationCenter defaultCenter] addObserver:self
62
+ selector:@selector(onContentSizeCategoryChange:)
63
+ name:UIContentSizeCategoryDidChangeNotification
64
+ object:nil];
65
+ [[NSNotificationCenter defaultCenter] addObserver:self
66
+ selector:@selector(onWindowResize:)
67
+ name:RCTWindowFrameDidChangeNotification
68
+ object:nil];
69
+ }
70
+
71
+ - (void)onWindowResize:(NSNotification *)notification {
72
+ UIWindow* mainWindow = [self getMainWindow];
73
+
74
+ Dimensions screen = {(int)mainWindow.frame.size.width, (int)mainWindow.frame.size.height};
75
+ Insets insets = [self getInsets];
76
+ Dimensions statusBar = [self getStatusBarDimensions];
77
+ Dimensions navigationBar = [self getNavigationBarDimensions];
78
+
79
+ if (self.unistylesRuntime != nullptr) {
80
+ ((UnistylesRuntime*)self.unistylesRuntime)->handleScreenSizeChange(
81
+ screen,
82
+ insets,
83
+ statusBar,
84
+ navigationBar
85
+ );
86
+ }
87
+ }
88
+
89
+ - (void)onContentSizeCategoryChange:(NSNotification *)notification {
90
+ UIContentSizeCategory contentSizeCategory = [[UIApplication sharedApplication] preferredContentSizeCategory];
91
+
92
+ if (self.unistylesRuntime != nullptr) {
93
+ ((UnistylesRuntime*)self.unistylesRuntime)->handleContentSizeCategoryChange([self getContentSizeCategory:contentSizeCategory]);
94
+ }
95
+ }
96
+
97
+ - (Insets)getInsets {
98
+ return {0, 0, 0, 0};
99
+ }
100
+
101
+ - (Dimensions)getStatusBarDimensions {
102
+ return {0, 0};
103
+ }
104
+
105
+ - (Dimensions)getNavigationBarDimensions {
106
+ return {0, 0};
107
+ }
108
+
109
+ - (std::string)getContentSizeCategory:(UIContentSizeCategory)contentSizeCategory {
110
+ if ([contentSizeCategory isEqualToString:UIContentSizeCategoryExtraExtraExtraLarge]) {
111
+ return std::string([@"xxxLarge" UTF8String]);
112
+ }
113
+
114
+ if ([contentSizeCategory isEqualToString:UIContentSizeCategoryExtraExtraLarge]) {
115
+ return std::string([@"xxLarge" UTF8String]);
116
+ }
117
+
118
+ if ([contentSizeCategory isEqualToString:UIContentSizeCategoryExtraLarge]) {
119
+ return std::string([@"xLarge" UTF8String]);
120
+ }
121
+
122
+ if ([contentSizeCategory isEqualToString:UIContentSizeCategoryLarge]) {
123
+ return std::string([@"Large" UTF8String]);
124
+ }
125
+
126
+ if ([contentSizeCategory isEqualToString:UIContentSizeCategoryMedium]) {
127
+ return std::string([@"Medium" UTF8String]);
128
+ }
129
+
130
+ if ([contentSizeCategory isEqualToString:UIContentSizeCategorySmall]) {
131
+ return std::string([@"Small" UTF8String]);
132
+ }
133
+
134
+ if ([contentSizeCategory isEqualToString:UIContentSizeCategoryExtraSmall]) {
135
+ return std::string([@"xSmall" UTF8String]);
136
+ }
137
+
138
+ if ([contentSizeCategory isEqualToString:UIContentSizeCategoryAccessibilityMedium]) {
139
+ return std::string([@"accessibilityMedium" UTF8String]);
140
+ }
141
+
142
+ if ([contentSizeCategory isEqualToString:UIContentSizeCategoryAccessibilityLarge]) {
143
+ return std::string([@"accessibilityLarge" UTF8String]);
144
+ }
145
+
146
+ if ([contentSizeCategory isEqualToString:UIContentSizeCategoryAccessibilityExtraLarge]) {
147
+ return std::string([@"accessibilityExtraLarge" UTF8String]);
148
+ }
149
+
150
+ if ([contentSizeCategory isEqualToString:UIContentSizeCategoryAccessibilityExtraExtraLarge]) {
151
+ return std::string([@"accessibilityExtraExtraLarge" UTF8String]);
152
+ }
153
+
154
+ if ([contentSizeCategory isEqualToString:UIContentSizeCategoryAccessibilityExtraExtraExtraLarge]) {
155
+ return std::string([@"accessibilityExtraExtraExtraLarge" UTF8String]);
156
+ }
157
+
158
+ return std::string([@"unspecified" UTF8String]);
159
+ }
160
+
161
+ @end
162
+
163
+
164
+ #endif
@@ -119,6 +119,9 @@ class UnistylesBridgeWeb {
119
119
  this.emitThemeChange();
120
120
  }
121
121
  updateTheme(themeName) {
122
+ if (!this.#themeName) {
123
+ this.#themeName = this.getTheme();
124
+ }
122
125
  if (this.#themeName === themeName) {
123
126
  this.emitThemeChange();
124
127
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_plugins","_common","UnistylesBridgeWeb","timerRef","undefined","hasAdaptiveThemes","supportsAutomaticColorScheme","screenWidth","isServer","window","innerWidth","screenHeight","innerHeight","themes","breakpoints","colorScheme","getPreferredColorScheme","themeName","enabledPlugins","normalizeWebStylesPlugin","name","unistylesEvents","NativeEventEmitter","NativeModules","Unistyles","sortedBreakpointPairs","breakpoint","contentSizeCategory","insets","top","right","bottom","left","statusBar","height","width","setColor","navigationBar","constructor","setupListeners","install","globalThis","__UNISTYLES__","Proxy","get","_target","prop","getTheme","useTheme","updateTheme","useBreakpoints","enable","useAdaptiveThemes","pluginName","notify","addPlugin","removePlugin","Reflect","set","target","newValue","receiver","includes","emitThemeChange","Object","entries","sort","a","b","getBreakpointFromScreenWidth","concat","emitPluginChange","filter","length","at","addEventListener","clearTimeout","setTimeout","emitLayoutChange","matchMedia","event","matches","find","value","index","otherBreakpoints","minVal","maxVal","emit","type","payload","orientation","screen","exports","UnistylesModule"],"sourceRoot":"../../../src","sources":["core/UnistylesModule.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEO,MAAMG,kBAAkB,CAAC;EAC5B,CAACC,QAAQ,GAAmCC,SAAS;EACrD,CAACC,iBAAiB,GAAY,KAAK;EACnC,CAACC,4BAA4B,GAAG,KAAK;EACrC,CAACC,WAAW,GAAGC,gBAAQ,GAAGJ,SAAS,GAAGK,MAAM,CAACC,UAAU;EACvD,CAACC,YAAY,GAAGH,gBAAQ,GAAGJ,SAAS,GAAGK,MAAM,CAACG,WAAW;EACzD,CAACC,MAAM,GAAiC,EAAE;EAC1C,CAACC,WAAW,GAAyB,CAAC,CAAC;EACvC,CAACC,WAAW,GAAoB,IAAI,CAACC,uBAAuB,CAAC,CAAC;EAC9D,CAACC,SAAS,GAA0B,EAAE;EACtC,CAACC,cAAc,GAAkB,CAACC,iCAAwB,CAACC,IAAI,CAAC;EAChE,CAACC,eAAe,GAAG,IAAIC,+BAAkB,CAACC,0BAAa,CAACC,SAAS,CAAC;EAClE,CAACC,qBAAqB,GAAgD,EAAE;EACxE,CAACC,UAAU,GAA+B,EAAE;EAC5C,CAACC,mBAAmB,GAAW,aAAa;EAC5C,CAACC,MAAM,GAAiB;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAE;EACV,CAAC;EACD,CAACC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A,CAAA,EAAG;IACtB,IAAI,CAAC,CAAC1C,eAAe,CAACmE,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,OAAO;MACbC,OAAO,EAAE;QACLzE,SAAS,EAAE,IAAI,CAAC,CAACA;MACrB;IACJ,CAAC,CAAC;EACN;EAEQ6D,gBAAgBA,CAAA,EAAG;IACvB,IAAI,CAAC,CAACzD,eAAe,CAACmE,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAE;QACLhE,UAAU,EAAE,IAAI,CAAC,CAACA,UAAU;QAC5BiE,WAAW,EAAG,IAAI,CAAC,CAACpF,WAAW,GAAe,IAAI,CAAC,CAACI,YAAuB,GACrE,WAAW,GACX,UAAU;QAChBiF,MAAM,EAAE;UACJzD,KAAK,EAAE,IAAI,CAAC,CAAC5B,WAAW;UACxB2B,MAAM,EAAE,IAAI,CAAC,CAACvB;QAClB;MACJ;IACJ,CAAC,CAAC;EACN;AACJ;AAACkF,OAAA,CAAA3F,kBAAA,GAAAA,kBAAA;AAEM,MAAM4F,eAAe,GAAAD,OAAA,CAAAC,eAAA,GAAG,IAAI5F,kBAAkB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_plugins","_common","UnistylesBridgeWeb","timerRef","undefined","hasAdaptiveThemes","supportsAutomaticColorScheme","screenWidth","isServer","window","innerWidth","screenHeight","innerHeight","themes","breakpoints","colorScheme","getPreferredColorScheme","themeName","enabledPlugins","normalizeWebStylesPlugin","name","unistylesEvents","NativeEventEmitter","NativeModules","Unistyles","sortedBreakpointPairs","breakpoint","contentSizeCategory","insets","top","right","bottom","left","statusBar","height","width","setColor","navigationBar","constructor","setupListeners","install","globalThis","__UNISTYLES__","Proxy","get","_target","prop","getTheme","useTheme","updateTheme","useBreakpoints","enable","useAdaptiveThemes","pluginName","notify","addPlugin","removePlugin","Reflect","set","target","newValue","receiver","includes","emitThemeChange","Object","entries","sort","a","b","getBreakpointFromScreenWidth","concat","emitPluginChange","filter","length","at","addEventListener","clearTimeout","setTimeout","emitLayoutChange","matchMedia","event","matches","find","value","index","otherBreakpoints","minVal","maxVal","emit","type","payload","orientation","screen","exports","UnistylesModule"],"sourceRoot":"../../../src","sources":["core/UnistylesModule.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEO,MAAMG,kBAAkB,CAAC;EAC5B,CAACC,QAAQ,GAAmCC,SAAS;EACrD,CAACC,iBAAiB,GAAY,KAAK;EACnC,CAACC,4BAA4B,GAAG,KAAK;EACrC,CAACC,WAAW,GAAGC,gBAAQ,GAAGJ,SAAS,GAAGK,MAAM,CAACC,UAAU;EACvD,CAACC,YAAY,GAAGH,gBAAQ,GAAGJ,SAAS,GAAGK,MAAM,CAACG,WAAW;EACzD,CAACC,MAAM,GAAiC,EAAE;EAC1C,CAACC,WAAW,GAAyB,CAAC,CAAC;EACvC,CAACC,WAAW,GAAoB,IAAI,CAACC,uBAAuB,CAAC,CAAC;EAC9D,CAACC,SAAS,GAA0B,EAAE;EACtC,CAACC,cAAc,GAAkB,CAACC,iCAAwB,CAACC,IAAI,CAAC;EAChE,CAACC,eAAe,GAAG,IAAIC,+BAAkB,CAACC,0BAAa,CAACC,SAAS,CAAC;EAClE,CAACC,qBAAqB,GAAgD,EAAE;EACxE,CAACC,UAAU,GAA+B,EAAE;EAC5C,CAACC,mBAAmB,GAAW,aAAa;EAC5C,CAACC,MAAM,GAAiB;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAE;EACV,CAAC;EACD,CAACC,SAAS,GAAc;IACpBC,MAAM,EAAE,CAAC;IACTC,KAAK,EAAE,CAAC;IACRC,QAAQ,EAAEA,CAAA,KAAM,CAAC;EACrB,CAAC;EACD,CAACC,aAAa,GAAkB;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G;IACtB,IAAI,CAAC,CAAC1C,eAAe,CAACmE,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,OAAO;MACbC,OAAO,EAAE;QACLzE,SAAS,EAAE,IAAI,CAAC,CAACA;MACrB;IACJ,CAAC,CAAC;EACN;EAEQ6D,gBAAgBA,CAAA,EAAG;IACvB,IAAI,CAAC,CAACzD,eAAe,CAACmE,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAE;QACLhE,UAAU,EAAE,IAAI,CAAC,CAACA,UAAU;QAC5BiE,WAAW,EAAG,IAAI,CAAC,CAACpF,WAAW,GAAe,IAAI,CAAC,CAACI,YAAuB,GACrE,WAAW,GACX,UAAU;QAChBiF,MAAM,EAAE;UACJzD,KAAK,EAAE,IAAI,CAAC,CAAC5B,WAAW;UACxB2B,MAAM,EAAE,IAAI,CAAC,CAACvB;QAClB;MACJ;IACJ,CAAC,CAAC;EACN;AACJ;AAACkF,OAAA,CAAA3F,kBAAA,GAAAA,kBAAA;AAEM,MAAM4F,eAAe,GAAAD,OAAA,CAAAC,eAAA,GAAG,IAAI5F,kBAAkB,CAAC,CAAC","ignoreList":[]}
@@ -113,6 +113,9 @@ export class UnistylesBridgeWeb {
113
113
  this.emitThemeChange();
114
114
  }
115
115
  updateTheme(themeName) {
116
+ if (!this.#themeName) {
117
+ this.#themeName = this.getTheme();
118
+ }
116
119
  if (this.#themeName === themeName) {
117
120
  this.emitThemeChange();
118
121
  }
@@ -1 +1 @@
1
- {"version":3,"names":["NativeEventEmitter","NativeModules","normalizeWebStylesPlugin","isServer","UnistylesBridgeWeb","timerRef","undefined","hasAdaptiveThemes","supportsAutomaticColorScheme","screenWidth","window","innerWidth","screenHeight","innerHeight","themes","breakpoints","colorScheme","getPreferredColorScheme","themeName","enabledPlugins","name","unistylesEvents","Unistyles","sortedBreakpointPairs","breakpoint","contentSizeCategory","insets","top","right","bottom","left","statusBar","height","width","setColor","navigationBar","constructor","setupListeners","install","globalThis","__UNISTYLES__","Proxy","get","_target","prop","getTheme","useTheme","updateTheme","useBreakpoints","enable","useAdaptiveThemes","pluginName","notify","addPlugin","removePlugin","Reflect","set","target","newValue","receiver","includes","emitThemeChange","Object","entries","sort","a","b","getBreakpointFromScreenWidth","concat","emitPluginChange","filter","length","at","addEventListener","clearTimeout","setTimeout","emitLayoutChange","matchMedia","event","matches","find","value","index","otherBreakpoints","minVal","maxVal","emit","type","payload","orientation","screen","UnistylesModule"],"sourceRoot":"../../../src","sources":["core/UnistylesModule.ts"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAGhE,SAASC,wBAAwB,QAAQ,YAAY;AACrD,SAASC,QAAQ,QAAQ,WAAW;AAEpC,OAAO,MAAMC,kBAAkB,CAAC;EAC5B,CAACC,QAAQ,GAAmCC,SAAS;EACrD,CAACC,iBAAiB,GAAY,KAAK;EACnC,CAACC,4BAA4B,GAAG,KAAK;EACrC,CAACC,WAAW,GAAGN,QAAQ,GAAGG,SAAS,GAAGI,MAAM,CAACC,UAAU;EACvD,CAACC,YAAY,GAAGT,QAAQ,GAAGG,SAAS,GAAGI,MAAM,CAACG,WAAW;EACzD,CAACC,MAAM,GAAiC,EAAE;EAC1C,CAACC,WAAW,GAAyB,CAAC,CAAC;EACvC,CAACC,WAAW,GAAoB,IAAI,CAACC,uBAAuB,CAAC,CAAC;EAC9D,CAACC,SAAS,GAA0B,EAAE;EACtC,CAACC,cAAc,GAAkB,CAACjB,wBAAwB,CAACkB,IAAI,CAAC;EAChE,CAACC,eAAe,GAAG,IAAIrB,kBAAkB,CAACC,aAAa,CAACqB,SAAS,CAAC;EAClE,CAACC,qBAAqB,GAAgD,EAAE;EACxE,CAACC,UAAU,GAA+B,EAAE;EAC5C,CAACC,mBAAmB,GAAW,aAAa;EAC5C,CAACC,MAAM,GAAiB;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAA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,IAAI,EAAE;IACV,CAAC,CAAC;EACN;EAEQ1B,eAAeA,CAAA,EAAG;IACtB,IAAI,CAAC,CAACxC,eAAe,CAACiE,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,OAAO;MACbC,OAAO,EAAE;QACLtE,SAAS,EAAE,IAAI,CAAC,CAACA;MACrB;IACJ,CAAC,CAAC;EACN;EAEQ0D,gBAAgBA,CAAA,EAAG;IACvB,IAAI,CAAC,CAACvD,eAAe,CAACiE,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAE;QACLhE,UAAU,EAAE,IAAI,CAAC,CAACA,UAAU;QAC5BiE,WAAW,EAAG,IAAI,CAAC,CAAChF,WAAW,GAAe,IAAI,CAAC,CAACG,YAAuB,GACrE,WAAW,GACX,UAAU;QAChB8E,MAAM,EAAE;UACJzD,KAAK,EAAE,IAAI,CAAC,CAACxB,WAAW;UACxBuB,MAAM,EAAE,IAAI,CAAC,CAACpB;QAClB;MACJ;IACJ,CAAC,CAAC;EACN;AACJ;AAEA,OAAO,MAAM+E,eAAe,GAAG,IAAIvF,kBAAkB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["NativeEventEmitter","NativeModules","normalizeWebStylesPlugin","isServer","UnistylesBridgeWeb","timerRef","undefined","hasAdaptiveThemes","supportsAutomaticColorScheme","screenWidth","window","innerWidth","screenHeight","innerHeight","themes","breakpoints","colorScheme","getPreferredColorScheme","themeName","enabledPlugins","name","unistylesEvents","Unistyles","sortedBreakpointPairs","breakpoint","contentSizeCategory","insets","top","right","bottom","left","statusBar","height","width","setColor","navigationBar","constructor","setupListeners","install","globalThis","__UNISTYLES__","Proxy","get","_target","prop","getTheme","useTheme","updateTheme","useBreakpoints","enable","useAdaptiveThemes","pluginName","notify","addPlugin","removePlugin","Reflect","set","target","newValue","receiver","includes","emitThemeChange","Object","entries","sort","a","b","getBreakpointFromScreenWidth","concat","emitPluginChange","filter","length","at","addEventListener","clearTimeout","setTimeout","emitLayoutChange","matchMedia","event","matches","find","value","index","otherBreakpoints","minVal","maxVal","emit","type","payload","orientation","screen","UnistylesModule"],"sourceRoot":"../../../src","sources":["core/UnistylesModule.ts"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAGhE,SAASC,wBAAwB,QAAQ,YAAY;AACrD,SAASC,QAAQ,QAAQ,WAAW;AAEpC,OAAO,MAAMC,kBAAkB,CAAC;EAC5B,CAACC,QAAQ,GAAmCC,SAAS;EACrD,CAACC,iBAAiB,GAAY,KAAK;EACnC,CAACC,4BAA4B,GAAG,KAAK;EACrC,CAACC,WAAW,GAAGN,QAAQ,GAAGG,SAAS,GAAGI,MAAM,CAACC,UAAU;EACvD,CAACC,YAAY,GAAGT,QAAQ,GAAGG,SAAS,GAAGI,MAAM,CAACG,WAAW;EACzD,CAACC,MAAM,GAAiC,EAAE;EAC1C,CAACC,WAAW,GAAyB,CAAC,CAAC;EACvC,CAACC,WAAW,GAAoB,IAAI,CAACC,uBAAuB,CAAC,CAAC;EAC9D,CAACC,SAAS,GAA0B,EAAE;EACtC,CAACC,cAAc,GAAkB,CAACjB,wBAAwB,CAACkB,IAAI,CAAC;EAChE,CAACC,eAAe,GAAG,IAAIrB,kBAAkB,CAACC,aAAa,CAACqB,SAAS,CAAC;EAClE,CAACC,qBAAqB,GAAgD,EAAE;EACxE,CAACC,UAAU,GAA+B,EAAE;EAC5C,CAACC,mBAAmB,GAAW,aAAa;EAC5C,CAACC,MAAM,GAAiB;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAE;EACV,CAAC;EACD,CAACC,SAAS,GAAc;IACpBC,MAAM,EAAE,CAAC;IACTC,KAAK,EAAE,CAAC;IACRC,QAAQ,EAAEA,CAAA,KAAM,CAAC;EACrB,CAAC;EACD,CAACC,aAAa,GAAkB;IAC5BH,MAAM,EAAE,C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,CAACxC,eAAe,CAACiE,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,OAAO;MACbC,OAAO,EAAE;QACLtE,SAAS,EAAE,IAAI,CAAC,CAACA;MACrB;IACJ,CAAC,CAAC;EACN;EAEQ0D,gBAAgBA,CAAA,EAAG;IACvB,IAAI,CAAC,CAACvD,eAAe,CAACiE,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAE;QACLhE,UAAU,EAAE,IAAI,CAAC,CAACA,UAAU;QAC5BiE,WAAW,EAAG,IAAI,CAAC,CAAChF,WAAW,GAAe,IAAI,CAAC,CAACG,YAAuB,GACrE,WAAW,GACX,UAAU;QAChB8E,MAAM,EAAE;UACJzD,KAAK,EAAE,IAAI,CAAC,CAACxB,WAAW;UACxBuB,MAAM,EAAE,IAAI,CAAC,CAACpB;QAClB;MACJ;IACJ,CAAC,CAAC;EACN;AACJ;AAEA,OAAO,MAAM+E,eAAe,GAAG,IAAIvF,kBAAkB,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"UnistylesModule.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.ts"],"names":[],"mappings":"AAMA,qBAAa,kBAAkB;;;IAwCpB,OAAO;IAuEd,OAAO,CAAC,QAAQ;IAKhB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,cAAc;IA6BtB,OAAO,CAAC,4BAA4B;IAgBpC,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,gBAAgB;CAe3B;AAED,eAAO,MAAM,eAAe,oBAA2B,CAAA"}
1
+ {"version":3,"file":"UnistylesModule.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.ts"],"names":[],"mappings":"AAMA,qBAAa,kBAAkB;;;IAwCpB,OAAO;IAuEd,OAAO,CAAC,QAAQ;IAKhB,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,QAAQ;IAQhB,OAAO,CAAC,cAAc;IA6BtB,OAAO,CAAC,4BAA4B;IAgBpC,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,gBAAgB;CAe3B;AAED,eAAO,MAAM,eAAe,oBAA2B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-unistyles",
3
- "version": "2.6.0-rc.1",
3
+ "version": "2.7.0",
4
4
  "description": "Level up your React Native StyleSheet",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -44,6 +44,7 @@
44
44
  "react-native-windows",
45
45
  "react-native-web",
46
46
  "react-native-tvos",
47
+ "react-native-visionos",
47
48
  "expo"
48
49
  ],
49
50
  "repository": "https://github.com/jpudysz/react-native-unistyles",
@@ -119,6 +120,7 @@
119
120
  "examples/win",
120
121
  "examples/bare",
121
122
  "examples/tv",
123
+ "examples/vision",
122
124
  "docs"
123
125
  ],
124
126
  "packageManager": "yarn@3.6.4",
@@ -133,6 +135,7 @@
133
135
  "<rootDir>/examples/win/node_modules",
134
136
  "<rootDir>/examples/bare/node_modules",
135
137
  "<rootDir>/examples/tv/node_modules",
138
+ "<rootDir>/examples/vision/node_modules",
136
139
  "<rootDir>/docs/node_modules",
137
140
  "<rootDir>/lib/"
138
141
  ],
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
10
10
  s.license = package["license"]
11
11
  s.authors = package["author"]
12
12
 
13
- s.platforms = { :ios => min_ios_version_supported, :osx => "10.14", :tvos => "9.0" }
13
+ s.platforms = { :ios => min_ios_version_supported, :osx => "10.14", :tvos => "9.0", :visionos => "1.0" }
14
14
  s.source = { :git => package["repository"], :tag => "#{s.version}" }
15
15
 
16
16
  s.source_files = [
@@ -121,6 +121,10 @@ export class UnistylesBridgeWeb {
121
121
  }
122
122
 
123
123
  private updateTheme(themeName: keyof UnistylesThemes) {
124
+ if (!this.#themeName) {
125
+ this.#themeName = this.getTheme()
126
+ }
127
+
124
128
  if (this.#themeName === themeName) {
125
129
  this.emitThemeChange()
126
130
  }
@@ -164,7 +168,6 @@ export class UnistylesBridgeWeb {
164
168
  }
165
169
 
166
170
  private getTheme(): keyof UnistylesThemes {
167
-
168
171
  if (this.#themes.length === 1) {
169
172
  return this.#themes.at(0) as keyof UnistylesThemes
170
173
  }