react-native-unistyles 2.4.0-rc.1 → 2.4.0-rc.2
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +5 -2
- package/android/src/main/cxx/cpp-adapter.cpp +28 -13
- package/android/src/main/cxx/helpers.cpp +21 -56
- package/android/src/main/cxx/helpers.h +3 -3
- package/android/src/main/java/com/unistyles/Config.kt +116 -0
- package/android/src/main/java/com/unistyles/Insets.kt +138 -0
- package/android/src/main/java/com/unistyles/Models.kt +85 -0
- package/android/src/main/java/com/unistyles/Platform.kt +10 -79
- package/android/src/main/java/com/unistyles/UnistylesModule.kt +85 -25
- package/cxx/UnistylesRuntime.cpp +57 -42
- package/cxx/UnistylesRuntime.h +30 -19
- package/ios/UnistylesModule.mm +20 -6
- package/ios/platform/Platform_iOS.h +5 -4
- package/ios/platform/Platform_iOS.mm +35 -22
- package/ios/platform/Platform_macOS.h +5 -4
- package/ios/platform/Platform_macOS.mm +18 -25
- package/lib/commonjs/common.js +7 -0
- package/lib/commonjs/common.js.map +1 -1
- package/lib/commonjs/core/UnistylesModule.js +6 -0
- package/lib/commonjs/core/UnistylesModule.js.map +1 -1
- package/lib/commonjs/core/UnistylesRuntime.js +8 -0
- package/lib/commonjs/core/UnistylesRuntime.js.map +1 -1
- package/lib/commonjs/hooks/useUnistyles.js +18 -1
- package/lib/commonjs/hooks/useUnistyles.js.map +1 -1
- package/lib/module/common.js +7 -0
- package/lib/module/common.js.map +1 -1
- package/lib/module/core/UnistylesModule.js +6 -0
- package/lib/module/core/UnistylesModule.js.map +1 -1
- package/lib/module/core/UnistylesRuntime.js +8 -0
- package/lib/module/core/UnistylesRuntime.js.map +1 -1
- package/lib/module/hooks/useUnistyles.js +18 -1
- package/lib/module/hooks/useUnistyles.js.map +1 -1
- package/lib/typescript/src/common.d.ts +8 -1
- package/lib/typescript/src/common.d.ts.map +1 -1
- package/lib/typescript/src/core/UnistylesModule.d.ts.map +1 -1
- package/lib/typescript/src/core/UnistylesRuntime.d.ts +6 -1
- package/lib/typescript/src/core/UnistylesRuntime.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useUnistyles.d.ts +14 -0
- package/lib/typescript/src/hooks/useUnistyles.d.ts.map +1 -1
- package/lib/typescript/src/types/unistyles.d.ts +6 -2
- package/lib/typescript/src/types/unistyles.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common.ts +8 -1
- package/src/core/UnistylesModule.ts +8 -2
- package/src/core/UnistylesRuntime.ts +8 -0
- package/src/hooks/useUnistyles.ts +18 -1
- package/src/types/unistyles.ts +6 -2
@@ -12,8 +12,7 @@
|
|
12
12
|
UIScreen *screen = [UIScreen mainScreen];
|
13
13
|
UIContentSizeCategory contentSizeCategory = [[UIApplication sharedApplication] preferredContentSizeCategory];
|
14
14
|
|
15
|
-
self.
|
16
|
-
self.initialHeight = screen.bounds.size.height;
|
15
|
+
self.initialScreen = {(int)screen.bounds.size.width, (int)screen.bounds.size.height};
|
17
16
|
self.initialColorScheme = [self getColorScheme];
|
18
17
|
self.initialContentSizeCategory = [self getContentSizeCategory:contentSizeCategory];
|
19
18
|
self.initialStatusBar = [self getStatusBarDimensions];
|
@@ -73,14 +72,14 @@
|
|
73
72
|
|
74
73
|
- (void)onOrientationChange:(NSNotification *)notification {
|
75
74
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
76
|
-
UIScreen *
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
75
|
+
UIScreen *mainScreen = [UIScreen mainScreen];
|
76
|
+
Dimensions screen = {(int)mainScreen.bounds.size.width, (int)mainScreen.bounds.size.height};
|
77
|
+
Insets insets = [self getInsets];
|
78
|
+
Dimensions statusBar = [self getStatusBarDimensions];
|
79
|
+
Dimensions navigationBar = [self getNavigationBarDimensions];
|
81
80
|
|
82
81
|
if (self.unistylesRuntime != nullptr) {
|
83
|
-
((UnistylesRuntime*)self.unistylesRuntime)->handleScreenSizeChange(
|
82
|
+
((UnistylesRuntime*)self.unistylesRuntime)->handleScreenSizeChange(screen, insets, statusBar, navigationBar);
|
84
83
|
}
|
85
84
|
});
|
86
85
|
}
|
@@ -99,27 +98,21 @@
|
|
99
98
|
}
|
100
99
|
}
|
101
100
|
|
102
|
-
- (
|
101
|
+
- (Insets)getInsets {
|
103
102
|
UIWindow *window = UIApplication.sharedApplication.windows.firstObject;
|
104
103
|
UIEdgeInsets safeArea = window.safeAreaInsets;
|
105
|
-
std::map<std::string, int> insets;
|
106
|
-
|
107
|
-
insets.insert({ "top", safeArea.top });
|
108
|
-
insets.insert({ "bottom", safeArea.bottom });
|
109
|
-
insets.insert({ "left", safeArea.left });
|
110
|
-
insets.insert({ "right", safeArea.right });
|
111
104
|
|
112
|
-
return
|
105
|
+
return {(int)safeArea.top, (int)safeArea.bottom, (int)safeArea.left, (int)safeArea.right};
|
113
106
|
}
|
114
107
|
|
115
|
-
- (
|
108
|
+
- (Dimensions)getStatusBarDimensions {
|
116
109
|
CGRect statusBarFrame = UIApplication.sharedApplication.statusBarFrame;
|
117
|
-
std::map<std::string, int> statusBar;
|
118
110
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
111
|
+
return {(int)statusBarFrame.size.width, (int)statusBarFrame.size.height};
|
112
|
+
}
|
113
|
+
|
114
|
+
- (Dimensions)getNavigationBarDimensions {
|
115
|
+
return {0, 0};
|
123
116
|
}
|
124
117
|
|
125
118
|
- (std::string)getContentSizeCategory:(UIContentSizeCategory)contentSizeCategory {
|
@@ -151,6 +144,26 @@
|
|
151
144
|
return std::string([@"xSmall" UTF8String]);
|
152
145
|
}
|
153
146
|
|
147
|
+
if ([contentSizeCategory isEqualToString:UIContentSizeCategoryAccessibilityMedium]) {
|
148
|
+
return std::string([@"accessibilityMedium" UTF8String]);
|
149
|
+
}
|
150
|
+
|
151
|
+
if ([contentSizeCategory isEqualToString:UIContentSizeCategoryAccessibilityLarge]) {
|
152
|
+
return std::string([@"accessibilityLarge" UTF8String]);
|
153
|
+
}
|
154
|
+
|
155
|
+
if ([contentSizeCategory isEqualToString:UIContentSizeCategoryAccessibilityExtraLarge]) {
|
156
|
+
return std::string([@"accessibilityExtraLarge" UTF8String]);
|
157
|
+
}
|
158
|
+
|
159
|
+
if ([contentSizeCategory isEqualToString:UIContentSizeCategoryAccessibilityExtraExtraLarge]) {
|
160
|
+
return std::string([@"accessibilityExtraExtraLarge" UTF8String]);
|
161
|
+
}
|
162
|
+
|
163
|
+
if ([contentSizeCategory isEqualToString:UIContentSizeCategoryAccessibilityExtraExtraExtraLarge]) {
|
164
|
+
return std::string([@"accessibilityExtraExtraExtraLarge" UTF8String]);
|
165
|
+
}
|
166
|
+
|
154
167
|
return std::string([@"unspecified" UTF8String]);
|
155
168
|
}
|
156
169
|
|
@@ -1,14 +1,15 @@
|
|
1
1
|
#include <string>
|
2
2
|
#include <map>
|
3
|
+
#include <UnistylesRuntime.h>
|
3
4
|
|
4
5
|
@interface Platform : NSObject
|
5
6
|
|
6
|
-
@property (nonatomic, assign)
|
7
|
-
@property (nonatomic, assign) CGFloat initialHeight;
|
7
|
+
@property (nonatomic, assign) Dimensions initialScreen;
|
8
8
|
@property (nonatomic, assign) std::string initialColorScheme;
|
9
9
|
@property (nonatomic, assign) std::string initialContentSizeCategory;
|
10
|
-
@property (nonatomic, assign)
|
11
|
-
@property (nonatomic, assign)
|
10
|
+
@property (nonatomic, assign) Insets initialInsets;
|
11
|
+
@property (nonatomic, assign) Dimensions initialStatusBar;
|
12
|
+
@property (nonatomic, assign) Dimensions initialNavigationBar;
|
12
13
|
@property (nonatomic, assign) void* unistylesRuntime;
|
13
14
|
|
14
15
|
- (instancetype)init;
|
@@ -11,11 +11,11 @@
|
|
11
11
|
if (self) {
|
12
12
|
NSWindow *window = RCTSharedApplication().mainWindow;
|
13
13
|
|
14
|
-
self.
|
15
|
-
self.initialHeight = window.frame.size.height;
|
14
|
+
self.initialScreen = {(int)window.frame.size.width, (int)window.frame.size.height};
|
16
15
|
self.initialContentSizeCategory = std::string([@"unspecified" UTF8String]);
|
17
16
|
self.initialColorScheme = [self getColorScheme];
|
18
17
|
self.initialStatusBar = [self getStatusBarDimensions];
|
18
|
+
self.initialNavigationBar = [self getNavigationBarDimensions];
|
19
19
|
self.initialInsets = [self getInsets];
|
20
20
|
|
21
21
|
[self setupListeners];
|
@@ -61,16 +61,17 @@
|
|
61
61
|
|
62
62
|
- (void)onWindowResize {
|
63
63
|
NSWindow *window = RCTSharedApplication().mainWindow;
|
64
|
-
|
65
|
-
|
66
|
-
|
64
|
+
Dimensions screen = {(int)window.frame.size.width, (int)window.frame.size.height};
|
65
|
+
Insets insets = [self getInsets];
|
66
|
+
Dimensions statusBar = [self getStatusBarDimensions];
|
67
|
+
Dimensions navigationBar = [self getNavigationBarDimensions];
|
67
68
|
|
68
69
|
if (self.unistylesRuntime != nullptr) {
|
69
70
|
((UnistylesRuntime*)self.unistylesRuntime)->handleScreenSizeChange(
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
71
|
+
screen,
|
72
|
+
insets,
|
73
|
+
statusBar,
|
74
|
+
navigationBar
|
74
75
|
);
|
75
76
|
}
|
76
77
|
}
|
@@ -85,24 +86,16 @@
|
|
85
86
|
return UnistylesLightScheme;
|
86
87
|
}
|
87
88
|
|
88
|
-
- (
|
89
|
-
|
90
|
-
|
91
|
-
insets.insert({ "top", 0 });
|
92
|
-
insets.insert({ "bottom", 0 });
|
93
|
-
insets.insert({ "left", 0 });
|
94
|
-
insets.insert({ "right", 0 });
|
95
|
-
|
96
|
-
return insets;
|
89
|
+
- (Insets)getInsets {
|
90
|
+
return {0, 0, 0, 0};
|
97
91
|
}
|
98
92
|
|
99
|
-
- (
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
return statusBar;
|
93
|
+
- (Dimensions)getStatusBarDimensions {
|
94
|
+
return {0, 0};
|
95
|
+
}
|
96
|
+
|
97
|
+
- (Dimensions)getNavigationBarDimensions {
|
98
|
+
return {0, 0};
|
106
99
|
}
|
107
100
|
|
108
101
|
@end
|
package/lib/commonjs/common.js
CHANGED
@@ -19,6 +19,11 @@ const ScreenOrientation = exports.ScreenOrientation = {
|
|
19
19
|
Portrait: 'portrait'
|
20
20
|
};
|
21
21
|
let IOSContentSizeCategory = exports.IOSContentSizeCategory = /*#__PURE__*/function (IOSContentSizeCategory) {
|
22
|
+
IOSContentSizeCategory["AccessibilityExtraExtraExtraLarge"] = "accessibilityExtraExtraExtraLarge";
|
23
|
+
IOSContentSizeCategory["AccessibilityExtraExtraLarge"] = "accessibilityExtraExtraLarge";
|
24
|
+
IOSContentSizeCategory["AccessibilityExtraLarge"] = "accessibilityExtraLarge";
|
25
|
+
IOSContentSizeCategory["AccessibilityLarge"] = "accessibilityLarge";
|
26
|
+
IOSContentSizeCategory["AccessibilityMedium"] = "accessibilityMedium";
|
22
27
|
IOSContentSizeCategory["ExtraExtraExtraLarge"] = "xxxLarge";
|
23
28
|
IOSContentSizeCategory["ExtraExtraLarge"] = "xxLarge";
|
24
29
|
IOSContentSizeCategory["ExtraLarge"] = "xLarge";
|
@@ -35,6 +40,8 @@ let AndroidContentSizeCategory = exports.AndroidContentSizeCategory = /*#__PURE_
|
|
35
40
|
AndroidContentSizeCategory["Large"] = "Large";
|
36
41
|
AndroidContentSizeCategory["ExtraLarge"] = "ExtraLarge";
|
37
42
|
AndroidContentSizeCategory["Huge"] = "Huge";
|
43
|
+
AndroidContentSizeCategory["ExtraHuge"] = "ExtraHuge";
|
44
|
+
AndroidContentSizeCategory["ExtraExtraHuge"] = "ExtraExtraHuge";
|
38
45
|
return AndroidContentSizeCategory;
|
39
46
|
}({});
|
40
47
|
let UnistylesEventType = exports.UnistylesEventType = /*#__PURE__*/function (UnistylesEventType) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_reactNative","require","warn","message","console","exports","isWeb","Platform","OS","isIOS","isAndroid","isMobile","isServer","window","ScreenOrientation","Landscape","Portrait","IOSContentSizeCategory","AndroidContentSizeCategory","UnistylesEventType","UnistylesError"],"sourceRoot":"../../src","sources":["common.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEO,MAAMC,IAAI,GAAIC,OAAe,IAAK;EACrCC,OAAO,CAACF,IAAI,CAAE,gCAA+BC,OAAQ,EAAC,CAAC;AAC3D,CAAC;AAAAE,OAAA,CAAAH,IAAA,GAAAA,IAAA;AAEM,MAAMI,KAAK,GAAAD,OAAA,CAAAC,KAAA,GAAGC,qBAAQ,CAACC,EAAE,KAAK,KAAK;AACnC,MAAMC,KAAK,GAAAJ,OAAA,CAAAI,KAAA,GAAGF,qBAAQ,CAACC,EAAE,KAAK,KAAK;AACnC,MAAME,SAAS,GAAAL,OAAA,CAAAK,SAAA,GAAGH,qBAAQ,CAACC,EAAE,KAAK,SAAS;AAC3C,MAAMG,QAAQ,GAAAN,OAAA,CAAAM,QAAA,GAAGF,KAAK,IAAIC,SAAS;AACnC,MAAME,QAAQ,GAAAP,OAAA,CAAAO,QAAA,GAAG,OAAOC,MAAM,KAAK,WAAW;AAE9C,MAAMC,iBAAiB,GAAAT,OAAA,CAAAS,iBAAA,GAAG;EAC7BC,SAAS,EAAE,WAAW;EACtBC,QAAQ,EAAE;AACd,CAAU;AAAA,IAEEC,sBAAsB,GAAAZ,OAAA,CAAAY,sBAAA,0BAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA;AAAA,
|
1
|
+
{"version":3,"names":["_reactNative","require","warn","message","console","exports","isWeb","Platform","OS","isIOS","isAndroid","isMobile","isServer","window","ScreenOrientation","Landscape","Portrait","IOSContentSizeCategory","AndroidContentSizeCategory","UnistylesEventType","UnistylesError"],"sourceRoot":"../../src","sources":["common.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAA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AAkB,GAAAd,OAAA,CAAAc,kBAAA,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;AAAA,IAOlBC,cAAc,GAAAf,OAAA,CAAAe,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA"}
|
@@ -32,6 +32,10 @@ class UnistylesBridgeWeb {
|
|
32
32
|
height: 0,
|
33
33
|
width: 0
|
34
34
|
};
|
35
|
+
#navigationBar = {
|
36
|
+
height: 0,
|
37
|
+
width: 0
|
38
|
+
};
|
35
39
|
constructor() {
|
36
40
|
if (!_common.isServer) {
|
37
41
|
this.setupListeners();
|
@@ -69,6 +73,8 @@ class UnistylesBridgeWeb {
|
|
69
73
|
return this.#insets;
|
70
74
|
case 'statusBar':
|
71
75
|
return this.#statusBar;
|
76
|
+
case 'navigationBar':
|
77
|
+
return this.#navigationBar;
|
72
78
|
case 'useTheme':
|
73
79
|
return themeName => this.useTheme(themeName);
|
74
80
|
case 'updateTheme':
|
@@ -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","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,
|
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","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,0BAA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B;IAEA,OAAO,OAAO;EAClB;EAEQV,gBAAgBA,CAAA,EAAG;IACvB,IAAI,CAAC,CAACjD,eAAe,CAACkE,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE;IACV,CAAC,CAAC;EACN;EAEQ1B,eAAeA,CAAA,EAAG;IACtB,IAAI,CAAC,CAACzC,eAAe,CAACkE,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,OAAO;MACbC,OAAO,EAAE;QACLxE,SAAS,EAAE,IAAI,CAAC,CAACA;MACrB;IACJ,CAAC,CAAC;EACN;EAEQ4D,gBAAgBA,CAAA,EAAG;IACvB,IAAI,CAAC,CAACxD,eAAe,CAACkE,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAE;QACL/D,UAAU,EAAE,IAAI,CAAC,CAACA,UAAU;QAC5BgE,WAAW,EAAG,IAAI,CAAC,CAACnF,WAAW,GAAe,IAAI,CAAC,CAACI,YAAuB,GACrE,WAAW,GACX,UAAU;QAChBgF,MAAM,EAAE;UACJxD,KAAK,EAAE,IAAI,CAAC,CAAC5B,WAAW;UACxB2B,MAAM,EAAE,IAAI,CAAC,CAACvB;QAClB;MACJ;IACJ,CAAC,CAAC;EACN;AACJ;AAACiF,OAAA,CAAA1F,kBAAA,GAAAA,kBAAA;AAEM,MAAM2F,eAAe,GAAAD,OAAA,CAAAC,eAAA,GAAG,IAAI3F,kBAAkB,CAAC,CAAC"}
|
@@ -97,6 +97,14 @@ class UnistylesRuntime {
|
|
97
97
|
return this.unistylesBridge.statusBar;
|
98
98
|
}
|
99
99
|
|
100
|
+
/**
|
101
|
+
* Get the navigation bar info (Android)
|
102
|
+
* @returns - The navigation bar size { width, height }
|
103
|
+
*/
|
104
|
+
get navigationBar() {
|
105
|
+
return this.unistylesBridge.navigationBar;
|
106
|
+
}
|
107
|
+
|
100
108
|
/**
|
101
109
|
* Get the screen orientation
|
102
110
|
* @returns - The screen orientation
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_common","require","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","colorScheme","hasAdaptiveThemes","themeName","contentSizeCategory","breakpoint","breakpoints","enabledPlugins","screen","width","screenWidth","height","screenHeight","insets","statusBar","orientation","ScreenOrientation","Landscape","Portrait","setTheme","name","hasTheme","useTheme","Error","UnistylesError","ThemeNotRegistered","updateTheme","updater","getTheme","setAdaptiveThemes","enable","useAdaptiveThemes","addPlugin","plugin","removePlugin","exports"],"sourceRoot":"../../../src","sources":["core/UnistylesRuntime.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAKA;AACA;AACA;AACO,MAAMC,gBAAgB,CAAC;EAC1BC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,iBAAmC,GAAnCA,iBAAmC;EAAG;;EAEpG;AACJ;AACA;AACA;EACI,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO,IAAI,CAACF,eAAe,CAACE,WAAW;EAC3C;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,iBAAiBA,CAAA,EAAG;IAC3B,OAAO,IAAI,CAACH,eAAe,CAACG,iBAAiB;EACjD;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,SAASA,CAAA,EAAG;IACnB,OAAO,IAAI,CAACJ,eAAe,CAACI,SAAS;EACzC;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,mBAAmBA,CAAA,EAAG;IAC7B,OAAO,IAAI,CAACL,eAAe,CAACK,mBAAmB;EACnD;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,UAAUA,CAAA,EAAG;IACpB,OAAO,IAAI,CAACN,eAAe,CAACM,UAAU;EAC1C;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO,IAAI,CAACN,iBAAiB,CAACM,WAAW;EAC7C;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,cAAcA,CAAA,EAAG;IACxB,OAAO,IAAI,CAACR,eAAe,CAACQ,cAAc;EAC9C;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,MAAMA,CAAA,EAAG;IAChB,OAAO;MACHC,KAAK,EAAE,IAAI,CAACV,eAAe,CAACW,WAAW;MACvCC,MAAM,EAAE,IAAI,CAACZ,eAAe,CAACa;IACjC,CAAC;EACL;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,MAAMA,CAAA,EAAG;IAChB,OAAO,IAAI,CAACd,eAAe,CAACc,MAAM;EACtC;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,SAASA,CAAA,EAAG;IACnB,OAAO,IAAI,CAACf,eAAe,CAACe,SAAS;EACzC;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,WAAWA,CAAA,EAAG;IACrB,MAAM;
|
1
|
+
{"version":3,"names":["_common","require","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","colorScheme","hasAdaptiveThemes","themeName","contentSizeCategory","breakpoint","breakpoints","enabledPlugins","screen","width","screenWidth","height","screenHeight","insets","statusBar","navigationBar","orientation","ScreenOrientation","Landscape","Portrait","setTheme","name","hasTheme","useTheme","Error","UnistylesError","ThemeNotRegistered","updateTheme","updater","getTheme","setAdaptiveThemes","enable","useAdaptiveThemes","addPlugin","plugin","removePlugin","exports"],"sourceRoot":"../../../src","sources":["core/UnistylesRuntime.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAKA;AACA;AACA;AACO,MAAMC,gBAAgB,CAAC;EAC1BC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,iBAAmC,GAAnCA,iBAAmC;EAAG;;EAEpG;AACJ;AACA;AACA;EACI,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO,IAAI,CAACF,eAAe,CAACE,WAAW;EAC3C;;EAEA;AACJ;A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IAAIC,KAAK,GAAGE,MAAM,EAAE;MAChB,OAAOM,yBAAiB,CAACC,SAAS;IACtC;IAEA,OAAOD,yBAAiB,CAACE,QAAQ;EACrC;;EAEA;AACJ;AACA;AACA;AACA;EACWC,QAAQ,GAAIC,IAA2B,IAAK;IAC/C,IAAIA,IAAI,KAAK,IAAI,CAAClB,SAAS,EAAE;MACzB;IACJ;IAEA,IAAI,IAAI,CAACH,iBAAiB,CAACsB,QAAQ,CAACD,IAAI,CAAC,EAAE;MACvC,IAAI,CAACtB,eAAe,CAACwB,QAAQ,CAACF,IAAI,CAAC;MAEnC,OAAO,IAAI;IACf;IAEA,MAAM,IAAIG,KAAK,CAACC,sBAAc,CAACC,kBAAkB,CAAC;EACtD,CAAC;;EAED;AACJ;AACA;AACA;AACA;AACA;EACWC,WAAW,GAAGA,CAACN,IAA2B,EAAEO,OAAkG,KAAK;IACtJ,IAAI,CAAC5B,iBAAiB,CAAC2B,WAAW,CAACN,IAAI,EAAEO,OAAO,CAAC,IAAI,CAAC5B,iBAAiB,CAAC6B,QAAQ,CAACR,IAAI,CAAC,CAAC,CAAC;EAC5F,CAAC;;EAED;AACJ;AACA;AACA;EACWS,iBAAiB,GAAIC,MAAe,IAAK;IAC5C,IAAI,CAAChC,eAAe,CAACiC,iBAAiB,CAACD,MAAM,CAAC;EAClD,CAAC;;EAED;AACJ;AACA;AACA;EACWE,SAAS,GAAIC,MAAuB,IAAK;IAC5C,IAAI,CAAClC,iBAAiB,CAACiC,SAAS,CAACC,MAAM,CAAC;EAC5C,CAAC;;EAED;AACJ;AACA;AACA;EACWC,YAAY,GAAID,MAAuB,IAAK;IAC/C,IAAI,CAAClC,iBAAiB,CAACmC,YAAY,CAACD,MAAM,CAAC;EAC/C,CAAC;AACL;AAACE,OAAA,CAAAvC,gBAAA,GAAAA,gBAAA"}
|
@@ -19,6 +19,20 @@ const useUnistyles = () => {
|
|
19
19
|
screenSize: {
|
20
20
|
width: _core.unistyles.runtime.screen.width,
|
21
21
|
height: _core.unistyles.runtime.screen.height
|
22
|
+
},
|
23
|
+
statusBar: {
|
24
|
+
width: _core.unistyles.runtime.statusBar.width,
|
25
|
+
height: _core.unistyles.runtime.statusBar.height
|
26
|
+
},
|
27
|
+
navigationBar: {
|
28
|
+
width: _core.unistyles.runtime.navigationBar.width,
|
29
|
+
height: _core.unistyles.runtime.navigationBar.height
|
30
|
+
},
|
31
|
+
insets: {
|
32
|
+
top: _core.unistyles.runtime.insets.top,
|
33
|
+
bottom: _core.unistyles.runtime.insets.bottom,
|
34
|
+
left: _core.unistyles.runtime.insets.left,
|
35
|
+
right: _core.unistyles.runtime.insets.right
|
22
36
|
}
|
23
37
|
});
|
24
38
|
(0, _react.useEffect)(() => {
|
@@ -35,7 +49,10 @@ const useUnistyles = () => {
|
|
35
49
|
return setLayout({
|
36
50
|
breakpoint: layoutEvent.payload.breakpoint,
|
37
51
|
orientation: layoutEvent.payload.orientation,
|
38
|
-
screenSize: layoutEvent.payload.screen
|
52
|
+
screenSize: layoutEvent.payload.screen,
|
53
|
+
statusBar: layoutEvent.payload.statusBar,
|
54
|
+
insets: layoutEvent.payload.insets,
|
55
|
+
navigationBar: layoutEvent.payload.navigationBar
|
39
56
|
});
|
40
57
|
}
|
41
58
|
case _common.UnistylesEventType.Plugin:
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_react","_core","_common","unistylesEvents","NativeEventEmitter","NativeModules","Unistyles","useUnistyles","plugins","setPlugins","useState","unistyles","runtime","enabledPlugins","theme","setTheme","registry","getTheme","themeName","contentSizeCategory","setContentSizeCategory","layout","setLayout","breakpoint","orientation","screenSize","width","screen","height","useEffect","subscription","addListener","event","type","UnistylesEventType","Theme","themeEvent","payload","Layout","layoutEvent","Plugin","DynamicTypeSize","dynamicTypeSizeEvent","remove","exports"],"sourceRoot":"../../../src","sources":["hooks/useUnistyles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAGA,MAAMI,eAAe,GAAG,IAAIC,+BAAkB,CAACC,0BAAa,CAACC,SAAS,CAAC;AAEhE,MAAMC,YAAY,GAAGA,CAAA,KAAM;EAC9B,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAG,IAAAC,eAAQ,EAACC,eAAS,CAACC,OAAO,CAACC,cAAc,CAAC;EACxE,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG,IAAAL,eAAQ,EAACC,eAAS,CAACK,QAAQ,CAACC,QAAQ,CAACN,eAAS,CAACC,OAAO,CAACM,SAAS,CAAC,CAAC;EAC5F,MAAM,CAACC,mBAAmB,EAAEC,sBAAsB,CAAC,GAAG,IAAAV,eAAQ,EAACC,eAAS,CAACC,OAAO,CAACO,mBAAmB,CAAC;EACrG,MAAM,CAACE,MAAM,EAAEC,SAAS,CAAC,GAAG,IAAAZ,eAAQ,EAAC;IACjCa,UAAU,EAAEZ,eAAS,CAACC,OAAO,CAACW,UAAU;IACxCC,WAAW,EAAEb,eAAS,CAACC,OAAO,CAACY,WAAW;IAC1CC,UAAU,EAAE;MACRC,KAAK,EAAEf,eAAS,CAACC,OAAO,CAACe,MAAM,CAACD,KAAK;MACrCE,MAAM,EAAEjB,eAAS,CAACC,OAAO,CAACe,MAAM,CAACC;IACrC;EACJ,CAAC,CAAC;EAEF,IAAAC,gBAAS,EAAC,MAAM;IACZ,MAAMC,YAAY,
|
1
|
+
{"version":3,"names":["_reactNative","require","_react","_core","_common","unistylesEvents","NativeEventEmitter","NativeModules","Unistyles","useUnistyles","plugins","setPlugins","useState","unistyles","runtime","enabledPlugins","theme","setTheme","registry","getTheme","themeName","contentSizeCategory","setContentSizeCategory","layout","setLayout","breakpoint","orientation","screenSize","width","screen","height","statusBar","navigationBar","insets","top","bottom","left","right","useEffect","subscription","addListener","event","type","UnistylesEventType","Theme","themeEvent","payload","Layout","layoutEvent","Plugin","DynamicTypeSize","dynamicTypeSizeEvent","remove","exports"],"sourceRoot":"../../../src","sources":["hooks/useUnistyles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAGA,MAAMI,eAAe,GAAG,IAAIC,+BAAkB,CAACC,0BAAa,CAACC,SAAS,CAAC;AAEhE,MAAMC,YAAY,GAAGA,CAAA,KAAM;EAC9B,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAG,IAAAC,eAAQ,EAACC,eAAS,CAACC,OAAO,CAACC,cAAc,CAAC;EACxE,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG,IAAAL,eAAQ,EAACC,eAAS,CAACK,QAAQ,CAACC,QAAQ,CAACN,eAAS,CAACC,OAAO,CAACM,SAAS,CAAC,CAAC;EAC5F,MAAM,CAACC,mBAAmB,EAAEC,sBAAsB,CAAC,GAAG,IAAAV,eAAQ,EAACC,eAAS,CAACC,OAAO,CAACO,mBAAmB,CAAC;EACrG,MAAM,CAACE,MAAM,EAAEC,SAAS,CAAC,GAAG,IAAAZ,eAAQ,EAAC;IACjCa,UAAU,EAAEZ,eAAS,CAACC,OAAO,CAACW,UAAU;IACxCC,WAAW,EAAEb,eAAS,CAACC,OAAO,CAACY,WAAW;IAC1CC,UAAU,EAAE;MACRC,KAAK,EAAEf,eAAS,CAACC,OAAO,CAACe,MAAM,CAACD,KAAK;MACrCE,MAAM,EAAEjB,eAAS,CAACC,OAAO,CAACe,MAAM,CAACC;IACrC,CAAC;IACDC,SAAS,EAAE;MACPH,KAAK,EAAEf,eAAS,CAACC,OAAO,CAACiB,SAAS,CAACH,KAAK;MACxCE,MAAM,EAAEjB,eAAS,CAACC,OAAO,CAACiB,SAAS,CAACD;IACxC,CAAC;IACDE,aAAa,EAAE;MACXJ,KAAK,EAAEf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B,OAAOtC,UAAU,CAACE,eAAS,CAACC,OAAO,CAACC,cAAc,CAAC;UACvD;QACA,KAAK4B,0BAAkB,CAACO,eAAe;UAAE;YACrC,MAAMC,oBAAoB,GAAGV,KAAsC;YAEnE,OAAOnB,sBAAsB,CAAC6B,oBAAoB,CAACL,OAAO,CAACzB,mBAAmB,CAAC;UACnF;QACA;UACI;MACR;IACJ,CACJ,CAAC;IAED,OAAOkB,YAAY,CAACa,MAAM;EAC9B,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACH1C,OAAO;IACPM,KAAK;IACLO,MAAM;IACNF;EACJ,CAAC;AACL,CAAC;AAAAgC,OAAA,CAAA5C,YAAA,GAAAA,YAAA"}
|
package/lib/module/common.js
CHANGED
@@ -12,6 +12,11 @@ export const ScreenOrientation = {
|
|
12
12
|
Portrait: 'portrait'
|
13
13
|
};
|
14
14
|
export let IOSContentSizeCategory = /*#__PURE__*/function (IOSContentSizeCategory) {
|
15
|
+
IOSContentSizeCategory["AccessibilityExtraExtraExtraLarge"] = "accessibilityExtraExtraExtraLarge";
|
16
|
+
IOSContentSizeCategory["AccessibilityExtraExtraLarge"] = "accessibilityExtraExtraLarge";
|
17
|
+
IOSContentSizeCategory["AccessibilityExtraLarge"] = "accessibilityExtraLarge";
|
18
|
+
IOSContentSizeCategory["AccessibilityLarge"] = "accessibilityLarge";
|
19
|
+
IOSContentSizeCategory["AccessibilityMedium"] = "accessibilityMedium";
|
15
20
|
IOSContentSizeCategory["ExtraExtraExtraLarge"] = "xxxLarge";
|
16
21
|
IOSContentSizeCategory["ExtraExtraLarge"] = "xxLarge";
|
17
22
|
IOSContentSizeCategory["ExtraLarge"] = "xLarge";
|
@@ -28,6 +33,8 @@ export let AndroidContentSizeCategory = /*#__PURE__*/function (AndroidContentSiz
|
|
28
33
|
AndroidContentSizeCategory["Large"] = "Large";
|
29
34
|
AndroidContentSizeCategory["ExtraLarge"] = "ExtraLarge";
|
30
35
|
AndroidContentSizeCategory["Huge"] = "Huge";
|
36
|
+
AndroidContentSizeCategory["ExtraHuge"] = "ExtraHuge";
|
37
|
+
AndroidContentSizeCategory["ExtraExtraHuge"] = "ExtraExtraHuge";
|
31
38
|
return AndroidContentSizeCategory;
|
32
39
|
}({});
|
33
40
|
export let UnistylesEventType = /*#__PURE__*/function (UnistylesEventType) {
|
package/lib/module/common.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Platform","warn","message","console","isWeb","OS","isIOS","isAndroid","isMobile","isServer","window","ScreenOrientation","Landscape","Portrait","IOSContentSizeCategory","AndroidContentSizeCategory","UnistylesEventType","UnistylesError"],"sourceRoot":"../../src","sources":["common.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,OAAO,MAAMC,IAAI,GAAIC,OAAe,IAAK;EACrCC,OAAO,CAACF,IAAI,CAAE,gCAA+BC,OAAQ,EAAC,CAAC;AAC3D,CAAC;AAED,OAAO,MAAME,KAAK,GAAGJ,QAAQ,CAACK,EAAE,KAAK,KAAK;AAC1C,OAAO,MAAMC,KAAK,GAAGN,QAAQ,CAACK,EAAE,KAAK,KAAK;AAC1C,OAAO,MAAME,SAAS,GAAGP,QAAQ,CAACK,EAAE,KAAK,SAAS;AAClD,OAAO,MAAMG,QAAQ,GAAGF,KAAK,IAAIC,SAAS;AAC1C,OAAO,MAAME,QAAQ,GAAG,OAAOC,MAAM,KAAK,WAAW;AAErD,OAAO,MAAMC,iBAAiB,GAAG;EAC7BC,SAAS,EAAE,WAAW;EACtBC,QAAQ,EAAE;AACd,CAAU;AAEV,WAAYC,sBAAsB,0BAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA;
|
1
|
+
{"version":3,"names":["Platform","warn","message","console","isWeb","OS","isIOS","isAndroid","isMobile","isServer","window","ScreenOrientation","Landscape","Portrait","IOSContentSizeCategory","AndroidContentSizeCategory","UnistylesEventType","UnistylesError"],"sourceRoot":"../../src","sources":["common.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,OAAO,MAAMC,IAAI,GAAIC,OAAe,IAAK;EACrCC,OAAO,CAACF,IAAI,CAAE,gCAA+BC,OAAQ,EAAC,CAAC;AAC3D,CAAC;AAED,OAAO,MAAME,KAAK,GAAGJ,QAAQ,CAACK,EAAE,KAAK,KAAK;AAC1C,OAAO,MAAMC,KAAK,GAAGN,QAAQ,CAACK,EAAE,KAAK,KAAK;AAC1C,OAAO,MAAME,SAAS,GAAGP,QAAQ,CAACK,EAAE,KAAK,SAAS;AAClD,OAAO,MAAMG,QAAQ,GAAGF,KAAK,IAAIC,SAAS;AAC1C,OAAO,MAAME,QAAQ,GAAG,OAAOC,MAAM,KAAK,WAAW;AAErD,OAAO,MAAMC,iBAAiB,GAAG;EAC7BC,SAAS,EAAE,WAAW;EACtBC,QAAQ,EAAE;AACd,CAAU;AAEV,WAAYC,sBAAsB,0BAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA;AAgBlC,WAAYC,0BAA0B,0BAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAAA,OAA1BA,0BAA0B;AAAA;AAUtC,WAAYC,kBAAkB,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;AAO9B,WAAYC,cAAc,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA"}
|
@@ -26,6 +26,10 @@ export class UnistylesBridgeWeb {
|
|
26
26
|
height: 0,
|
27
27
|
width: 0
|
28
28
|
};
|
29
|
+
#navigationBar = {
|
30
|
+
height: 0,
|
31
|
+
width: 0
|
32
|
+
};
|
29
33
|
constructor() {
|
30
34
|
if (!isServer) {
|
31
35
|
this.setupListeners();
|
@@ -63,6 +67,8 @@ export class UnistylesBridgeWeb {
|
|
63
67
|
return this.#insets;
|
64
68
|
case 'statusBar':
|
65
69
|
return this.#statusBar;
|
70
|
+
case 'navigationBar':
|
71
|
+
return this.#navigationBar;
|
66
72
|
case 'useTheme':
|
67
73
|
return themeName => this.useTheme(themeName);
|
68
74
|
case 'updateTheme':
|
@@ -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","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,
|
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","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,MAA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IACV,CAAC,CAAC;EACN;EAEQ1B,eAAeA,CAAA,EAAG;IACtB,IAAI,CAAC,CAACvC,eAAe,CAACgE,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,OAAO;MACbC,OAAO,EAAE;QACLrE,SAAS,EAAE,IAAI,CAAC,CAACA;MACrB;IACJ,CAAC,CAAC;EACN;EAEQyD,gBAAgBA,CAAA,EAAG;IACvB,IAAI,CAAC,CAACtD,eAAe,CAACgE,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAE;QACL/D,UAAU,EAAE,IAAI,CAAC,CAACA,UAAU;QAC5BgE,WAAW,EAAG,IAAI,CAAC,CAAC/E,WAAW,GAAe,IAAI,CAAC,CAACG,YAAuB,GACrE,WAAW,GACX,UAAU;QAChB6E,MAAM,EAAE;UACJxD,KAAK,EAAE,IAAI,CAAC,CAACxB,WAAW;UACxBuB,MAAM,EAAE,IAAI,CAAC,CAACpB;QAClB;MACJ;IACJ,CAAC,CAAC;EACN;AACJ;AAEA,OAAO,MAAM8E,eAAe,GAAG,IAAItF,kBAAkB,CAAC,CAAC"}
|
@@ -91,6 +91,14 @@ export class UnistylesRuntime {
|
|
91
91
|
return this.unistylesBridge.statusBar;
|
92
92
|
}
|
93
93
|
|
94
|
+
/**
|
95
|
+
* Get the navigation bar info (Android)
|
96
|
+
* @returns - The navigation bar size { width, height }
|
97
|
+
*/
|
98
|
+
get navigationBar() {
|
99
|
+
return this.unistylesBridge.navigationBar;
|
100
|
+
}
|
101
|
+
|
94
102
|
/**
|
95
103
|
* Get the screen orientation
|
96
104
|
* @returns - The screen orientation
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ScreenOrientation","UnistylesError","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","colorScheme","hasAdaptiveThemes","themeName","contentSizeCategory","breakpoint","breakpoints","enabledPlugins","screen","width","screenWidth","height","screenHeight","insets","statusBar","orientation","Landscape","Portrait","setTheme","name","hasTheme","useTheme","Error","ThemeNotRegistered","updateTheme","updater","getTheme","setAdaptiveThemes","enable","useAdaptiveThemes","addPlugin","plugin","removePlugin"],"sourceRoot":"../../../src","sources":["core/UnistylesRuntime.ts"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,cAAc,QAAQ,WAAW;AAK7D;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,CAAC;EAC1BC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,iBAAmC,GAAnCA,iBAAmC;EAAG;;EAEpG;AACJ;AACA;AACA;EACI,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO,IAAI,CAACF,eAAe,CAACE,WAAW;EAC3C;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,iBAAiBA,CAAA,EAAG;IAC3B,OAAO,IAAI,CAACH,eAAe,CAACG,iBAAiB;EACjD;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,SAASA,CAAA,EAAG;IACnB,OAAO,IAAI,CAACJ,eAAe,CAACI,SAAS;EACzC;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,mBAAmBA,CAAA,EAAG;IAC7B,OAAO,IAAI,CAACL,eAAe,CAACK,mBAAmB;EACnD;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,UAAUA,CAAA,EAAG;IACpB,OAAO,IAAI,CAACN,eAAe,CAACM,UAAU;EAC1C;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO,IAAI,CAACN,iBAAiB,CAACM,WAAW;EAC7C;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,cAAcA,CAAA,EAAG;IACxB,OAAO,IAAI,CAACR,eAAe,CAACQ,cAAc;EAC9C;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,MAAMA,CAAA,EAAG;IAChB,OAAO;MACHC,KAAK,EAAE,IAAI,CAACV,eAAe,CAACW,WAAW;MACvCC,MAAM,EAAE,IAAI,CAACZ,eAAe,CAACa;IACjC,CAAC;EACL;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,MAAMA,CAAA,EAAG;IAChB,OAAO,IAAI,CAACd,eAAe,CAACc,MAAM;EACtC;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,SAASA,CAAA,EAAG;IACnB,OAAO,IAAI,CAACf,eAAe,CAACe,SAAS;EACzC;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,WAAWA,CAAA,EAAG;IACrB,MAAM;
|
1
|
+
{"version":3,"names":["ScreenOrientation","UnistylesError","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","colorScheme","hasAdaptiveThemes","themeName","contentSizeCategory","breakpoint","breakpoints","enabledPlugins","screen","width","screenWidth","height","screenHeight","insets","statusBar","navigationBar","orientation","Landscape","Portrait","setTheme","name","hasTheme","useTheme","Error","ThemeNotRegistered","updateTheme","updater","getTheme","setAdaptiveThemes","enable","useAdaptiveThemes","addPlugin","plugin","removePlugin"],"sourceRoot":"../../../src","sources":["core/UnistylesRuntime.ts"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,cAAc,QAAQ,WAAW;AAK7D;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,CAAC;EAC1BC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,iBAAmC,GAAnCA,iBAAmC;EAAG;;EAEpG;AACJ;AACA;AACA;EACI,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO,IAAI,CAACF,eAAe,CAACE,WAAW;EAC3C;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,iBAAiBA,CAAA,EAAG;IAC3B,OAAO,IAAI,CAACH,eAAe,CAACG,iBAAiB;EACjD;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,SAASA,CAAA,EAAG;IACnB,OAAO,IAAI,CAACJ,eAAe,CAACI,SAAS;EACz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IAAI,KAAK,IAAI,CAACjB,SAAS,EAAE;MACzB;IACJ;IAEA,IAAI,IAAI,CAACH,iBAAiB,CAACqB,QAAQ,CAACD,IAAI,CAAC,EAAE;MACvC,IAAI,CAACrB,eAAe,CAACuB,QAAQ,CAACF,IAAI,CAAC;MAEnC,OAAO,IAAI;IACf;IAEA,MAAM,IAAIG,KAAK,CAAC3B,cAAc,CAAC4B,kBAAkB,CAAC;EACtD,CAAC;;EAED;AACJ;AACA;AACA;AACA;AACA;EACWC,WAAW,GAAGA,CAACL,IAA2B,EAAEM,OAAkG,KAAK;IACtJ,IAAI,CAAC1B,iBAAiB,CAACyB,WAAW,CAACL,IAAI,EAAEM,OAAO,CAAC,IAAI,CAAC1B,iBAAiB,CAAC2B,QAAQ,CAACP,IAAI,CAAC,CAAC,CAAC;EAC5F,CAAC;;EAED;AACJ;AACA;AACA;EACWQ,iBAAiB,GAAIC,MAAe,IAAK;IAC5C,IAAI,CAAC9B,eAAe,CAAC+B,iBAAiB,CAACD,MAAM,CAAC;EAClD,CAAC;;EAED;AACJ;AACA;AACA;EACWE,SAAS,GAAIC,MAAuB,IAAK;IAC5C,IAAI,CAAChC,iBAAiB,CAAC+B,SAAS,CAACC,MAAM,CAAC;EAC5C,CAAC;;EAED;AACJ;AACA;AACA;EACWC,YAAY,GAAID,MAAuB,IAAK;IAC/C,IAAI,CAAChC,iBAAiB,CAACiC,YAAY,CAACD,MAAM,CAAC;EAC/C,CAAC;AACL"}
|
@@ -13,6 +13,20 @@ export const useUnistyles = () => {
|
|
13
13
|
screenSize: {
|
14
14
|
width: unistyles.runtime.screen.width,
|
15
15
|
height: unistyles.runtime.screen.height
|
16
|
+
},
|
17
|
+
statusBar: {
|
18
|
+
width: unistyles.runtime.statusBar.width,
|
19
|
+
height: unistyles.runtime.statusBar.height
|
20
|
+
},
|
21
|
+
navigationBar: {
|
22
|
+
width: unistyles.runtime.navigationBar.width,
|
23
|
+
height: unistyles.runtime.navigationBar.height
|
24
|
+
},
|
25
|
+
insets: {
|
26
|
+
top: unistyles.runtime.insets.top,
|
27
|
+
bottom: unistyles.runtime.insets.bottom,
|
28
|
+
left: unistyles.runtime.insets.left,
|
29
|
+
right: unistyles.runtime.insets.right
|
16
30
|
}
|
17
31
|
});
|
18
32
|
useEffect(() => {
|
@@ -29,7 +43,10 @@ export const useUnistyles = () => {
|
|
29
43
|
return setLayout({
|
30
44
|
breakpoint: layoutEvent.payload.breakpoint,
|
31
45
|
orientation: layoutEvent.payload.orientation,
|
32
|
-
screenSize: layoutEvent.payload.screen
|
46
|
+
screenSize: layoutEvent.payload.screen,
|
47
|
+
statusBar: layoutEvent.payload.statusBar,
|
48
|
+
insets: layoutEvent.payload.insets,
|
49
|
+
navigationBar: layoutEvent.payload.navigationBar
|
33
50
|
});
|
34
51
|
}
|
35
52
|
case UnistylesEventType.Plugin:
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["NativeEventEmitter","NativeModules","useEffect","useState","unistyles","UnistylesEventType","unistylesEvents","Unistyles","useUnistyles","plugins","setPlugins","runtime","enabledPlugins","theme","setTheme","registry","getTheme","themeName","contentSizeCategory","setContentSizeCategory","layout","setLayout","breakpoint","orientation","screenSize","width","screen","height","subscription","addListener","event","type","Theme","themeEvent","payload","Layout","layoutEvent","Plugin","DynamicTypeSize","dynamicTypeSizeEvent","remove"],"sourceRoot":"../../../src","sources":["hooks/useUnistyles.ts"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAChE,SAASC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,SAAS,QAAQ,SAAS;AACnC,SAASC,kBAAkB,QAAQ,WAAW;AAG9C,MAAMC,eAAe,GAAG,IAAIN,kBAAkB,CAACC,aAAa,CAACM,SAAS,CAAC;AAEvE,OAAO,MAAMC,YAAY,GAAGA,CAAA,KAAM;EAC9B,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGP,QAAQ,CAACC,SAAS,CAACO,OAAO,CAACC,cAAc,CAAC;EACxE,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGX,QAAQ,CAACC,SAAS,CAACW,QAAQ,CAACC,QAAQ,CAACZ,SAAS,CAACO,OAAO,CAACM,SAAS,CAAC,CAAC;EAC5F,MAAM,CAACC,mBAAmB,EAAEC,sBAAsB,CAAC,GAAGhB,QAAQ,CAACC,SAAS,CAACO,OAAO,CAACO,mBAAmB,CAAC;EACrG,MAAM,CAACE,MAAM,EAAEC,SAAS,CAAC,GAAGlB,QAAQ,CAAC;IACjCmB,UAAU,EAAElB,SAAS,CAACO,OAAO,CAACW,UAAU;IACxCC,WAAW,EAAEnB,SAAS,CAACO,OAAO,CAACY,WAAW;IAC1CC,UAAU,EAAE;MACRC,KAAK,EAAErB,SAAS,CAACO,OAAO,CAACe,MAAM,CAACD,KAAK;MACrCE,MAAM,EAAEvB,SAAS,CAACO,OAAO,CAACe,MAAM,CAACC;IACrC;EACJ,CAAC,CAAC;
|
1
|
+
{"version":3,"names":["NativeEventEmitter","NativeModules","useEffect","useState","unistyles","UnistylesEventType","unistylesEvents","Unistyles","useUnistyles","plugins","setPlugins","runtime","enabledPlugins","theme","setTheme","registry","getTheme","themeName","contentSizeCategory","setContentSizeCategory","layout","setLayout","breakpoint","orientation","screenSize","width","screen","height","statusBar","navigationBar","insets","top","bottom","left","right","subscription","addListener","event","type","Theme","themeEvent","payload","Layout","layoutEvent","Plugin","DynamicTypeSize","dynamicTypeSizeEvent","remove"],"sourceRoot":"../../../src","sources":["hooks/useUnistyles.ts"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAChE,SAASC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,SAAS,QAAQ,SAAS;AACnC,SAASC,kBAAkB,QAAQ,WAAW;AAG9C,MAAMC,eAAe,GAAG,IAAIN,kBAAkB,CAACC,aAAa,CAACM,SAAS,CAAC;AAEvE,OAAO,MAAMC,YAAY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KAAK;IACLO,MAAM;IACNF;EACJ,CAAC;AACL,CAAC"}
|
@@ -9,6 +9,11 @@ export declare const ScreenOrientation: {
|
|
9
9
|
readonly Portrait: "portrait";
|
10
10
|
};
|
11
11
|
export declare enum IOSContentSizeCategory {
|
12
|
+
AccessibilityExtraExtraExtraLarge = "accessibilityExtraExtraExtraLarge",
|
13
|
+
AccessibilityExtraExtraLarge = "accessibilityExtraExtraLarge",
|
14
|
+
AccessibilityExtraLarge = "accessibilityExtraLarge",
|
15
|
+
AccessibilityLarge = "accessibilityLarge",
|
16
|
+
AccessibilityMedium = "accessibilityMedium",
|
12
17
|
ExtraExtraExtraLarge = "xxxLarge",
|
13
18
|
ExtraExtraLarge = "xxLarge",
|
14
19
|
ExtraLarge = "xLarge",
|
@@ -23,7 +28,9 @@ export declare enum AndroidContentSizeCategory {
|
|
23
28
|
Default = "Default",
|
24
29
|
Large = "Large",
|
25
30
|
ExtraLarge = "ExtraLarge",
|
26
|
-
Huge = "Huge"
|
31
|
+
Huge = "Huge",
|
32
|
+
ExtraHuge = "ExtraHuge",
|
33
|
+
ExtraExtraHuge = "ExtraExtraHuge"
|
27
34
|
}
|
28
35
|
export declare enum UnistylesEventType {
|
29
36
|
Theme = "theme",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/common.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,YAAa,MAAM,SAEnC,CAAA;AAED,eAAO,MAAM,KAAK,SAAwB,CAAA;AAC1C,eAAO,MAAM,KAAK,SAAwB,CAAA;AAC1C,eAAO,MAAM,SAAS,SAA4B,CAAA;AAClD,eAAO,MAAM,QAAQ,SAAqB,CAAA;AAC1C,eAAO,MAAM,QAAQ,SAAgC,CAAA;AAErD,eAAO,MAAM,iBAAiB;;;CAGpB,CAAA;AAEV,oBAAY,sBAAsB;IAC9B,oBAAoB,aAAa;IACjC,eAAe,YAAY;IAC3B,UAAU,WAAW;IACrB,KAAK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ACtE,wBAAwB,wDAAwD;IAChF,4BAA4B,mEAAoE;IAChG,iBAAiB,6DAA8D;IAC/E,mBAAmB,+EAA+E;IAClG,wBAAwB,0DAA0D;CACrF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UnistylesModule.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.ts"],"names":[],"mappings":"AAMA,qBAAa,kBAAkB;;;
|
1
|
+
{"version":3,"file":"UnistylesModule.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.ts"],"names":[],"mappings":"AAMA,qBAAa,kBAAkB;;;IAsCpB,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"}
|
@@ -60,7 +60,12 @@ export declare class UnistylesRuntime {
|
|
60
60
|
* Get the status bar info
|
61
61
|
* @returns - The status bar size { width, height }
|
62
62
|
*/
|
63
|
-
get statusBar(): import("../types").
|
63
|
+
get statusBar(): import("../types").ScreenDimensions;
|
64
|
+
/**
|
65
|
+
* Get the navigation bar info (Android)
|
66
|
+
* @returns - The navigation bar size { width, height }
|
67
|
+
*/
|
68
|
+
get navigationBar(): import("../types").ScreenDimensions;
|
64
69
|
/**
|
65
70
|
* Get the screen orientation
|
66
71
|
* @returns - The screen orientation
|