react-native-unistyles 2.8.3 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. package/README.md +4 -1
  2. package/android/src/main/cxx/platform.cpp +16 -0
  3. package/android/src/main/cxx/platform.h +1 -0
  4. package/android/src/main/java/com/unistyles/Platform.kt +62 -9
  5. package/android/src/main/java/com/unistyles/UnistylesModule.kt +53 -1
  6. package/cxx/UnistylesImpl.cpp +4 -0
  7. package/cxx/UnistylesModel.cpp +0 -8
  8. package/cxx/UnistylesModel.h +1 -1
  9. package/cxx/UnistylesRuntime.h +3 -1
  10. package/ios/platform/Platform_iOS.mm +10 -0
  11. package/lib/commonjs/common.js +0 -1
  12. package/lib/commonjs/common.js.map +1 -1
  13. package/lib/commonjs/core/UnistylesModule.js +7 -0
  14. package/lib/commonjs/core/UnistylesModule.js.map +1 -1
  15. package/lib/commonjs/core/UnistylesRuntime.js +28 -5
  16. package/lib/commonjs/core/UnistylesRuntime.js.map +1 -1
  17. package/lib/commonjs/core/mocks/UnistylesMockedRuntime.js +9 -1
  18. package/lib/commonjs/core/mocks/UnistylesMockedRuntime.js.map +1 -1
  19. package/lib/commonjs/hooks/useUnistyles.js +1 -8
  20. package/lib/commonjs/hooks/useUnistyles.js.map +1 -1
  21. package/lib/module/common.js +0 -1
  22. package/lib/module/common.js.map +1 -1
  23. package/lib/module/core/UnistylesModule.js +7 -0
  24. package/lib/module/core/UnistylesModule.js.map +1 -1
  25. package/lib/module/core/UnistylesRuntime.js +25 -2
  26. package/lib/module/core/UnistylesRuntime.js.map +1 -1
  27. package/lib/module/core/mocks/UnistylesMockedRuntime.js +9 -1
  28. package/lib/module/core/mocks/UnistylesMockedRuntime.js.map +1 -1
  29. package/lib/module/hooks/useUnistyles.js +1 -8
  30. package/lib/module/hooks/useUnistyles.js.map +1 -1
  31. package/lib/typescript/src/common.d.ts +1 -2
  32. package/lib/typescript/src/common.d.ts.map +1 -1
  33. package/lib/typescript/src/core/UnistylesModule.d.ts.map +1 -1
  34. package/lib/typescript/src/core/UnistylesRuntime.d.ts +15 -0
  35. package/lib/typescript/src/core/UnistylesRuntime.d.ts.map +1 -1
  36. package/lib/typescript/src/core/mocks/UnistylesMockedRuntime.d.ts +4 -0
  37. package/lib/typescript/src/core/mocks/UnistylesMockedRuntime.d.ts.map +1 -1
  38. package/lib/typescript/src/hooks/useUnistyles.d.ts +0 -1
  39. package/lib/typescript/src/hooks/useUnistyles.d.ts.map +1 -1
  40. package/lib/typescript/src/index.d.ts +2 -2
  41. package/lib/typescript/src/index.d.ts.map +1 -1
  42. package/lib/typescript/src/types/index.d.ts +1 -1
  43. package/lib/typescript/src/types/index.d.ts.map +1 -1
  44. package/lib/typescript/src/types/stylesheet.d.ts +3 -3
  45. package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
  46. package/lib/typescript/src/types/unistyles.d.ts +2 -7
  47. package/lib/typescript/src/types/unistyles.d.ts.map +1 -1
  48. package/package.json +1 -1
  49. package/src/common.ts +1 -2
  50. package/src/core/UnistylesModule.ts +7 -0
  51. package/src/core/UnistylesRuntime.ts +26 -2
  52. package/src/core/mocks/UnistylesMockedRuntime.ts +11 -1
  53. package/src/hooks/useUnistyles.ts +2 -9
  54. package/src/index.ts +4 -1
  55. package/src/types/index.ts +4 -1
  56. package/src/types/stylesheet.ts +3 -3
  57. package/src/types/unistyles.ts +3 -9
package/README.md CHANGED
@@ -72,7 +72,6 @@ npx expo prebuild
72
72
  <img src="https://avatars.githubusercontent.com/u/686823?v=4" height="70px" width="70px" alt="mwarger" />
73
73
  </a>
74
74
 
75
-
76
75
  ## Past sponsors
77
76
 
78
77
  <a href="https://github.com/kmartinezmedia">
@@ -108,6 +107,10 @@ Your support is greatly appreciated and helps me dedicate more time and resource
108
107
  <img src="https://raw.githubusercontent.com/grapp-dev/stacks/main/assets/stacks-logo.png" height="70px" width="70px" alt="Stacks" />
109
108
  </a>
110
109
 
110
+ ## Plugins
111
+
112
+ [eslint-plugin-react-native-unistyles](https://github.com/RodSarhan/eslint-plugin-react-native-unistyles)
113
+
111
114
  ## Discord
112
115
  Looking for help or you want to chat with me?
113
116
 
@@ -59,6 +59,7 @@ void makeShared(JNIEnv *env, jobject unistylesModule, std::shared_ptr<UnistylesR
59
59
  unistylesRuntime->navigationBar = getNavigationBarDimensions(env, unistylesModule);
60
60
  unistylesRuntime->fontScale = screen.fontScale;
61
61
  unistylesRuntime->pixelRatio = screen.pixelRatio;
62
+ unistylesRuntime->rtl = getIsRTL(env, unistylesModule);
62
63
  }
63
64
 
64
65
  Screen getScreenDimensions(JNIEnv *env, jobject unistylesModule) {
@@ -79,6 +80,21 @@ std::string getColorScheme(JNIEnv *env, jobject unistylesModule) {
79
80
  return colorSchemeStr;
80
81
  }
81
82
 
83
+ bool getIsRTL(JNIEnv *env, jobject unistylesModule) {
84
+ jclass cls = env->GetObjectClass(unistylesModule);
85
+ jfieldID platformFieldId = env->GetFieldID(cls, "platform", "Lcom/unistyles/Platform;");
86
+ jobject platformInstance = env->GetObjectField(unistylesModule, platformFieldId);
87
+ jclass platformClass = env->GetObjectClass(platformInstance);
88
+ jmethodID methodId = env->GetMethodID(platformClass, "getIsRTL", "()Z");
89
+ jboolean result = env->CallBooleanMethod(platformInstance, methodId);
90
+
91
+ env->DeleteLocalRef(cls);
92
+ env->DeleteLocalRef(platformInstance);
93
+ env->DeleteLocalRef(platformClass);
94
+
95
+ return result;
96
+ }
97
+
82
98
  Dimensions getStatusBarDimensions(JNIEnv *env, jobject unistylesModule) {
83
99
  jobject dimensionsObj = JNI_callPlatform(env, unistylesModule, "getStatusBarDimensions", "()Lcom/unistyles/Dimensions;");
84
100
  Dimensions statusBarDimensions = jobjectToDimensions(env, dimensionsObj);
@@ -13,6 +13,7 @@ void setStatusBarHidden(JNIEnv *env, jobject unistylesModule, bool hidden);
13
13
  void setImmersiveMode(JNIEnv *env, jobject unistylesModule, bool hidden);
14
14
  void setRootViewBackgroundColor(JNIEnv *env, jobject unistylesModule, std::string color, float alpha);
15
15
  Insets getInsets(JNIEnv *env, jobject unistylesModule);
16
+ bool getIsRTL(JNIEnv *env, jobject unistylesModule);
16
17
  std::string getContentSizeCategory(JNIEnv *env, jobject unistylesModule);
17
18
  void setNavigationBarColor(JNIEnv *env, jobject unistylesModule, std::string color, float alpha);
18
19
  void setStatusBarColor(JNIEnv *env, jobject unistylesModule, std::string color, float alpha);
@@ -1,18 +1,22 @@
1
1
  package com.unistyles
2
2
 
3
+ import android.content.Context
3
4
  import android.content.res.Configuration
4
5
  import android.graphics.Color
5
6
  import android.graphics.Rect
6
7
  import android.os.Build
8
+ import android.util.DisplayMetrics
7
9
  import android.util.Log
8
10
  import android.view.View
9
11
  import android.view.Window
10
12
  import android.view.WindowManager
11
13
  import androidx.core.graphics.ColorUtils
14
+ import androidx.core.text.TextUtilsCompat
12
15
  import androidx.core.view.ViewCompat
13
16
  import androidx.core.view.WindowInsetsCompat
14
17
  import androidx.core.view.WindowInsetsControllerCompat
15
18
  import com.facebook.react.bridge.ReactApplicationContext
19
+ import java.util.Locale
16
20
  import kotlin.math.roundToInt
17
21
 
18
22
  class Platform(private val reactApplicationContext: ReactApplicationContext) {
@@ -22,13 +26,38 @@ class Platform(private val reactApplicationContext: ReactApplicationContext) {
22
26
 
23
27
  var orientation: Int = reactApplicationContext.resources.configuration.orientation
24
28
 
29
+ @Suppress("DEPRECATION")
25
30
  fun getScreenDimensions(): Screen {
31
+ // function takes in count edge-to-edge layout
26
32
  val displayMetrics = reactApplicationContext.resources.displayMetrics
27
33
  val fontScale = reactApplicationContext.resources.configuration.fontScale
28
- val screenWidth = (displayMetrics.widthPixels / displayMetrics.density).roundToInt()
29
- val screenHeight = (displayMetrics.heightPixels / displayMetrics.density).roundToInt()
30
34
 
31
- return Screen(screenWidth, screenHeight, displayMetrics.density, fontScale)
35
+ when {
36
+ Build.VERSION.SDK_INT < Build.VERSION_CODES.R -> {
37
+ val windowManager = reactApplicationContext.getSystemService(Context.WINDOW_SERVICE) as WindowManager
38
+ val metrics = DisplayMetrics()
39
+
40
+ windowManager.defaultDisplay.getRealMetrics(metrics)
41
+
42
+ val screenWidth = (metrics.widthPixels / metrics.density).roundToInt()
43
+ val screenHeight = (metrics.heightPixels / metrics.density).roundToInt()
44
+
45
+ return Screen(screenWidth, screenHeight, metrics.density, fontScale)
46
+ }
47
+ else -> {
48
+ reactApplicationContext.currentActivity?.windowManager?.currentWindowMetrics?.bounds?.let {
49
+ val boundsWidth = (it.width() / displayMetrics.density).roundToInt()
50
+ val boundsHeight = (it.height() / displayMetrics.density).roundToInt()
51
+
52
+ return Screen(boundsWidth, boundsHeight, displayMetrics.density, fontScale)
53
+ } ?: run {
54
+ val screenWidth = (displayMetrics.widthPixels / displayMetrics.density).roundToInt()
55
+ val screenHeight = (displayMetrics.heightPixels / displayMetrics.density).roundToInt()
56
+
57
+ return Screen(screenWidth, screenHeight, displayMetrics.density, fontScale)
58
+ }
59
+ }
60
+ }
32
61
  }
33
62
 
34
63
  fun getColorScheme(): String {
@@ -50,6 +79,19 @@ class Platform(private val reactApplicationContext: ReactApplicationContext) {
50
79
  return Dimensions(screenWidth, getStatusBarHeight())
51
80
  }
52
81
 
82
+ fun getIsRTL(): Boolean {
83
+ // forced by React Native
84
+ val sharedPrefs = reactApplicationContext.getSharedPreferences(
85
+ "com.facebook.react.modules.i18nmanager.I18nUtil",
86
+ Context.MODE_PRIVATE
87
+ )
88
+ val hasForcedRtl = sharedPrefs.getBoolean("RCTI18nUtil_forceRTL", false)
89
+ // user preferences
90
+ val isRtl = TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()) == ViewCompat.LAYOUT_DIRECTION_RTL
91
+
92
+ return hasForcedRtl || isRtl
93
+ }
94
+
53
95
  fun getNavigationBarDimensions(): Dimensions {
54
96
  val displayMetrics = reactApplicationContext.resources.displayMetrics
55
97
  val screenWidth = (displayMetrics.widthPixels / displayMetrics.density).roundToInt()
@@ -73,7 +115,7 @@ class Platform(private val reactApplicationContext: ReactApplicationContext) {
73
115
  return contentSizeCategory
74
116
  }
75
117
 
76
- fun setInsetsCompat(insetsCompat: WindowInsetsCompat, window: Window) {
118
+ fun setInsetsCompat(insetsCompat: WindowInsetsCompat, window: Window, animatedBottomInsets: Int?) {
77
119
  // below Android 11, we need to use window flags to detect status bar visibility
78
120
  val isStatusBarVisible = when(Build.VERSION.SDK_INT) {
79
121
  in 30..Int.MAX_VALUE -> {
@@ -98,13 +140,24 @@ class Platform(private val reactApplicationContext: ReactApplicationContext) {
98
140
  }
99
141
 
100
142
  val insets = insetsCompat.getInsets(WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout())
101
-
102
- // reports inset bottom as 0 when keyboard is visible
103
- // otherwise it will break other libraries that manipulates bottom insets
104
143
  val imeInsets = insetsCompat.getInsets(WindowInsetsCompat.Type.ime())
105
- val insetsBottom = if (imeInsets.bottom > 0) 0 else insets.bottom
106
144
 
107
- this.insets = Insets(statusBarTopInset, insetsBottom, insets.left, insets.right)
145
+ // Android 10 and below - set bottom insets to 0 while keyboard is visible and use default bottom insets otherwise
146
+ // Android 11 and above - animate bottom insets while keyboard is appearing and disappearing
147
+ val insetBottom = when(imeInsets.bottom > 0) {
148
+ true -> {
149
+ if (Build.VERSION.SDK_INT >= 30 && animatedBottomInsets != null) {
150
+ animatedBottomInsets
151
+ } else {
152
+ 0
153
+ }
154
+ }
155
+ else -> {
156
+ insets.bottom
157
+ }
158
+ }
159
+
160
+ this.insets = Insets(statusBarTopInset, insetBottom, insets.left, insets.right)
108
161
  }
109
162
 
110
163
  fun getInsets(): Insets {
@@ -4,17 +4,21 @@ import android.content.BroadcastReceiver
4
4
  import android.content.Context
5
5
  import android.content.Intent
6
6
  import android.content.IntentFilter
7
+ import android.os.Build
7
8
  import android.os.Handler
8
9
  import android.os.Looper
9
10
  import android.util.Log
10
11
  import android.view.View
11
12
  import androidx.core.view.ViewCompat
12
13
  import androidx.core.view.WindowCompat
14
+ import androidx.core.view.WindowInsetsAnimationCompat
15
+ import androidx.core.view.WindowInsetsCompat
13
16
  import com.facebook.react.bridge.LifecycleEventListener
14
17
  import com.facebook.react.bridge.ReactApplicationContext
15
18
  import com.facebook.react.bridge.ReactContextBaseJavaModule
16
19
  import com.facebook.react.bridge.ReactMethod
17
20
  import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder
21
+ import kotlin.math.roundToInt
18
22
 
19
23
  class UnistylesModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext), LifecycleEventListener {
20
24
  private var isCxxReady: Boolean = false
@@ -141,7 +145,7 @@ class UnistylesModule(reactContext: ReactApplicationContext) : ReactContextBaseJ
141
145
  this.reactApplicationContext.currentActivity?.let { activity ->
142
146
  activity.findViewById<View>(android.R.id.content)?.let { mainView ->
143
147
  ViewCompat.setOnApplyWindowInsetsListener(mainView) { _, insets ->
144
- this.platform.setInsetsCompat(insets, activity.window)
148
+ this.platform.setInsetsCompat(insets, activity.window, null)
145
149
 
146
150
  if (this.isCxxReady) {
147
151
  this.onLayoutConfigChange()
@@ -149,6 +153,53 @@ class UnistylesModule(reactContext: ReactApplicationContext) : ReactContextBaseJ
149
153
 
150
154
  insets
151
155
  }
156
+
157
+ if (Build.VERSION.SDK_INT >= 30) {
158
+ ViewCompat.setWindowInsetsAnimationCallback(
159
+ mainView,
160
+ object : WindowInsetsAnimationCompat.Callback(DISPATCH_MODE_STOP) {
161
+ var initialBottomInsets = 0
162
+ var isGoingUp = false
163
+
164
+ override fun onPrepare(animation: WindowInsetsAnimationCompat) {
165
+ val insets = ViewCompat.getRootWindowInsets(mainView)
166
+ val isKeyboardVisible = insets?.isVisible(WindowInsetsCompat.Type.ime()) ?: false
167
+
168
+ if (!isKeyboardVisible) {
169
+ val density = reactApplicationContext.resources.displayMetrics.density
170
+
171
+ initialBottomInsets = (this@UnistylesModule.platform.getInsets().bottom * density).roundToInt()
172
+ }
173
+
174
+ isGoingUp = !isKeyboardVisible
175
+ }
176
+
177
+ override fun onProgress(
178
+ insets: WindowInsetsCompat,
179
+ runningAnimations: List<WindowInsetsAnimationCompat>
180
+ ): WindowInsetsCompat {
181
+ runningAnimations.firstOrNull()?.let { animation ->
182
+ val progress = animation.fraction
183
+ val nextBottomInset = if (isGoingUp) {
184
+ (initialBottomInsets - (progress * initialBottomInsets).roundToInt())
185
+ } else {
186
+ // enable this in Unistyles 3.0 to get real time bottom insets
187
+ // initialBottomInsets - (initialBottomInsets - (progress * initialBottomInsets).roundToInt())
188
+ initialBottomInsets
189
+ }
190
+
191
+ this@UnistylesModule.platform.setInsetsCompat(insets, activity.window, nextBottomInset)
192
+
193
+ if (!isGoingUp) {
194
+ this@UnistylesModule.onLayoutConfigChange()
195
+ }
196
+ }
197
+
198
+ return insets
199
+ }
200
+ }
201
+ )
202
+ }
152
203
  }
153
204
  }
154
205
  }
@@ -157,6 +208,7 @@ class UnistylesModule(reactContext: ReactApplicationContext) : ReactContextBaseJ
157
208
  this.reactApplicationContext.currentActivity?.let { activity ->
158
209
  activity.window?.decorView?.let { view ->
159
210
  ViewCompat.setOnApplyWindowInsetsListener(view, null)
211
+ ViewCompat.setWindowInsetsAnimationCallback(view, null)
160
212
  }
161
213
  }
162
214
  }
@@ -294,3 +294,7 @@ jsi::Value UnistylesRuntime::setRootBackgroundColor(jsi::Runtime& rt, std::strin
294
294
  return jsi::Value::undefined();
295
295
  });
296
296
  }
297
+
298
+ jsi::Value UnistylesRuntime::getIsRtl(jsi::Runtime& rt, std::string fnName) {
299
+ return jsi::Value(this->rtl);
300
+ }
@@ -67,7 +67,6 @@ void UnistylesModel::handleContentSizeCategoryChange(std::string contentSizeCate
67
67
  }
68
68
 
69
69
  this->contentSizeCategory = contentSizeCategory;
70
- this->onContentSizeCategoryChange(contentSizeCategory);
71
70
  }
72
71
 
73
72
  jsi::Value UnistylesModel::getThemeOrFail(jsi::Runtime& runtime) {
@@ -144,13 +143,6 @@ void UnistylesModel::onThemeChange(std::string themeName) {
144
143
  this->emitDeviceEvent("theme", payload);
145
144
  }
146
145
 
147
- void UnistylesModel::onContentSizeCategoryChange(std::string contentSizeCategory) {
148
- EventPayload payload;
149
- payload["contentSizeCategory"] = contentSizeCategory;
150
-
151
- this->emitDeviceEvent("dynamicTypeSize", payload);
152
- }
153
-
154
146
  void UnistylesModel::onPluginChange() {
155
147
  this->emitDeviceEvent("plugin", {});
156
148
  }
@@ -50,7 +50,6 @@ struct UnistylesModel {
50
50
  void emitDeviceEvent(const std::string eventType, EventPayload payload);
51
51
  void onThemeChange(std::string themeName);
52
52
  void onPluginChange();
53
- void onContentSizeCategoryChange(std::string contentSizeCategory);
54
53
  void onLayoutChange();
55
54
  jsi::Object parseEventPayload(EventPayload payload);
56
55
  jsi::Object parseEventNestedPayload(EventNestedValue payload);
@@ -111,6 +110,7 @@ struct UnistylesModel {
111
110
  Insets insets = {0, 0, 0, 0};
112
111
  float pixelRatio = 1.0;
113
112
  float fontScale = 1.0;
113
+ bool rtl = false;
114
114
  std::string colorScheme = UnistylesUnspecifiedScheme;
115
115
  std::string contentSizeCategory = UnistylesUnspecifiedScheme;
116
116
 
@@ -34,7 +34,8 @@ struct JSI_EXPORT UnistylesRuntime : public jsi::HostObject, UnistylesModel {
34
34
  {"pixelRatio", BIND_FN(getPixelRatio)},
35
35
  {"fontScale", BIND_FN(getFontScale)},
36
36
  {"setRootViewBackgroundColor", BIND_FN(setRootBackgroundColor)},
37
- {"setImmersiveMode", BIND_FN(setImmersiveModeEnabled)}
37
+ {"setImmersiveMode", BIND_FN(setImmersiveModeEnabled)},
38
+ {"rtl", BIND_FN(getIsRtl)}
38
39
  };
39
40
 
40
41
  this->setters = {
@@ -64,6 +65,7 @@ struct JSI_EXPORT UnistylesRuntime : public jsi::HostObject, UnistylesModel {
64
65
  jsi::Value getFontScale(jsi::Runtime&, std::string);
65
66
  jsi::Value setRootBackgroundColor(jsi::Runtime&, std::string);
66
67
  jsi::Value setImmersiveModeEnabled(jsi::Runtime&, std::string);
68
+ jsi::Value getIsRtl(jsi::Runtime&, std::string);
67
69
 
68
70
  std::optional<jsi::Value> setThemes(jsi::Runtime&, const jsi::Value&);
69
71
 
@@ -91,6 +91,7 @@
91
91
  unistylesRuntime->insets = [self getInsets];
92
92
  unistylesRuntime->pixelRatio = screen.pixelRatio;
93
93
  unistylesRuntime->fontScale = screen.fontScale;
94
+ unistylesRuntime->rtl = [self isRtl];
94
95
  });
95
96
  }
96
97
 
@@ -149,6 +150,15 @@
149
150
  return Screen({width, height, pixelRatio, fontScale});
150
151
  }
151
152
 
153
+ - (bool)isRtl {
154
+ // forced by React Native
155
+ BOOL hasForcedRtl = [[NSUserDefaults standardUserDefaults] boolForKey:@"RCTI18nUtil_forceRTL"];
156
+ // user preferences
157
+ BOOL isRtl = [UIApplication sharedApplication].userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft;
158
+
159
+ return hasForcedRtl || isRtl;
160
+ }
161
+
152
162
  - (void)setStatusBarHidden:(bool)isHidden {
153
163
  // forward it to React Native ViewController
154
164
  dispatch_async(dispatch_get_main_queue(), ^{
@@ -50,7 +50,6 @@ let UnistylesEventType = exports.UnistylesEventType = /*#__PURE__*/function (Uni
50
50
  UnistylesEventType["Theme"] = "theme";
51
51
  UnistylesEventType["Layout"] = "layout";
52
52
  UnistylesEventType["Plugin"] = "plugin";
53
- UnistylesEventType["DynamicTypeSize"] = "dynamicTypeSize";
54
53
  return UnistylesEventType;
55
54
  }({});
56
55
  let UnistylesError = exports.UnistylesError = /*#__PURE__*/function (UnistylesError) {
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","warn","message","console","exports","isWeb","Platform","OS","isIOS","isAndroid","isMobile","isServer","window","isDev","process","env","NODE_ENV","isTest","JEST_WORKER_ID","undefined","jest","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,OA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C,0BAA0B,GAAArB,OAAA,CAAAqB,0BAAA,0BAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAAA,OAA1BA,0BAA0B;AAAA;AAAA,IAU1BC,kBAAkB,GAAAtB,OAAA,CAAAsB,kBAAA,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;AAAA,IAOlBC,cAAc,GAAAvB,OAAA,CAAAuB,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","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","warn","message","console","exports","isWeb","Platform","OS","isIOS","isAndroid","isMobile","isServer","window","isDev","process","env","NODE_ENV","isTest","JEST_WORKER_ID","undefined","jest","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,CAAC,gCAAgCC,OAAO,EAAE,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,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kB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;AAAA,IAMlBC,cAAc,GAAAvB,OAAA,CAAAuB,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","ignoreList":[]}
@@ -43,11 +43,14 @@ class UnistylesBridgeWeb {
43
43
  };
44
44
  #pixelRatio = 1.0;
45
45
  #fontScale = 1.0;
46
+ #hairlineWidth = 1;
47
+ #rtl = false;
46
48
  constructor() {
47
49
  if (!_common.isServer) {
48
50
  this.setupListeners();
49
51
  this.#screenWidth = window.innerWidth;
50
52
  this.#screenHeight = window.innerHeight;
53
+ this.#rtl = window.getComputedStyle(document.documentElement).direction === 'rtl';
51
54
  }
52
55
  }
53
56
  install() {
@@ -86,6 +89,10 @@ class UnistylesBridgeWeb {
86
89
  return this.#pixelRatio;
87
90
  case 'fontScale':
88
91
  return this.#fontScale;
92
+ case 'hairlineWidth':
93
+ return this.#hairlineWidth;
94
+ case 'rtl':
95
+ return this.#rtl;
89
96
  case 'useTheme':
90
97
  return themeName => this.useTheme(themeName);
91
98
  case 'updateTheme':
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_plugins","_common","UnistylesBridgeWeb","timerRef","undefined","windowResizeDebounceTimeMs","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","setHidden","navigationBar","pixelRatio","fontScale","constructor","setupListeners","install","globalThis","__UNISTYLES__","Proxy","get","_target","prop","getTheme","useTheme","updateTheme","useBreakpoints","enable","useAdaptiveThemes","pluginName","notify","addPlugin","removePlugin","color","setRootViewBackgroundColor","timeMs","Reflect","set","target","newValue","receiver","includes","emitThemeChange","Object","entries","sort","a","b","getBreakpointFromScreenWidth","concat","emitPluginChange","filter","length","at","onResize","emitLayoutChange","addEventListener","clearTimeout","setTimeout","matchMedia","event","matches","find","value","index","otherBreakpoints","minVal","maxVal","document","body","style","backgroundColor","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,0BAA0B,GAAW,GAAG;EACzC,CAACC,iBAAiB,GAAY,KAAK;EACnC,CAACC,4BAA4B,GAAG,KAAK;EACrC,CAACC,WAAW,GAAGC,gBAAQ,GAAGL,SAAS,GAAGM,MAAM,CAACC,UAAU;EACvD,CAACC,YAAY,GAAGH,gBAAQ,GAAGL,SAAS,GAAGM,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;I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CAAC7D,eAAe,CAAC8E,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAE;QACL3E,UAAU,EAAE,IAAI,CAAC,CAACA,UAAU;QAC5B4E,WAAW,EAAG,IAAI,CAAC,CAAC/F,WAAW,GAAe,IAAI,CAAC,CAACI,YAAuB,GACrE,WAAW,GACX,UAAU;QAChB4F,MAAM,EAAE;UACJpE,KAAK,EAAE,IAAI,CAAC,CAAC5B,WAAW;UACxB2B,MAAM,EAAE,IAAI,CAAC,CAACvB;QAClB;MACJ;IACJ,CAAC,CAAC;EACN;AACJ;AAAC6F,OAAA,CAAAvG,kBAAA,GAAAA,kBAAA;AAEM,MAAMwG,eAAe,GAAAD,OAAA,CAAAC,eAAA,GAAG,IAAIxG,kBAAkB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_plugins","_common","UnistylesBridgeWeb","timerRef","undefined","windowResizeDebounceTimeMs","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","setHidden","navigationBar","pixelRatio","fontScale","hairlineWidth","rtl","constructor","setupListeners","getComputedStyle","document","documentElement","direction","install","globalThis","__UNISTYLES__","Proxy","get","_target","prop","getTheme","useTheme","updateTheme","useBreakpoints","enable","useAdaptiveThemes","pluginName","notify","addPlugin","removePlugin","color","setRootViewBackgroundColor","timeMs","Reflect","set","target","newValue","receiver","includes","emitThemeChange","Object","entries","sort","a","b","getBreakpointFromScreenWidth","concat","emitPluginChange","filter","length","at","onResize","emitLayoutChange","addEventListener","clearTimeout","setTimeout","matchMedia","event","matches","find","value","index","otherBreakpoints","minVal","maxVal","body","style","backgroundColor","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,0BAA0B,GAAW,GAAG;EACzC,CAACC,iBAAiB,GAAY,KAAK;EACnC,CAACC,4BAA4B,GAAG,KAAK;EACrC,CAACC,WAAW,GAAGC,gBAAQ,GAAGL,SAAS,GAAGM,MAAM,CAACC,UAAU;EACvD,CAACC,YAAY,GAAGH,gBAAQ,GAAGL,SAAS,GAAGM,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,CAAC;IAClBC,SAAS,EAAEA,CAAA,KAAM,CAAC;EACtB,CAAC;EACD,CAACC,aAAa,GAAkB;IAC5BJ,MAAM,EAAE,CAAC;IACTC,KAAK,EAAE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AG;IACvB,IAAI,CAAC,CAACnE,eAAe,CAACmF,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAE;QACLhF,UAAU,EAAE,IAAI,CAAC,CAACA,UAAU;QAC5BiF,WAAW,EAAG,IAAI,CAAC,CAACpG,WAAW,GAAe,IAAI,CAAC,CAACI,YAAuB,GACrE,WAAW,GACX,UAAU;QAChBiG,MAAM,EAAE;UACJzE,KAAK,EAAE,IAAI,CAAC,CAAC5B,WAAW;UACxB2B,MAAM,EAAE,IAAI,CAAC,CAACvB;QAClB;MACJ;IACJ,CAAC,CAAC;EACN;AACJ;AAACkG,OAAA,CAAA5G,kBAAA,GAAAA,kBAAA;AAEM,MAAM6G,eAAe,GAAAD,OAAA,CAAAC,eAAA,GAAG,IAAI7G,kBAAkB,CAAC,CAAC","ignoreList":[]}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.UnistylesRuntime = void 0;
7
7
  var _common = require("../common");
8
- var _utils = require("../utils");
8
+ var _parseColor = require("../utils/parseColor");
9
9
  /**
10
10
  * Utility to interact with the Unistyles during runtime
11
11
  */
@@ -35,7 +35,9 @@ class UnistylesRuntime {
35
35
  },
36
36
  orientation: this.orientation,
37
37
  pixelRatio: this.pixelRatio,
38
- fontScale: this.fontScale
38
+ fontScale: this.fontScale,
39
+ hairlineWidth: this.hairlineWidth,
40
+ rtl: this.rtl
39
41
  };
40
42
  }
41
43
 
@@ -47,6 +49,14 @@ class UnistylesRuntime {
47
49
  return this.unistylesBridge.colorScheme;
48
50
  }
49
51
 
52
+ /**
53
+ * Get the layout direction
54
+ * @returns - Boolean indicating if the layout direction is RTL
55
+ */
56
+ get rtl() {
57
+ return this.unistylesBridge.rtl;
58
+ }
59
+
50
60
  /**
51
61
  * Get info about adaptive themes
52
62
  * @returns - boolean indicating if the adaptive themes are enabled
@@ -89,6 +99,7 @@ class UnistylesRuntime {
89
99
 
90
100
  /**
91
101
  * Get the names of currently enabled plugins
102
+ * @deprecated - Plugins will be removed in the next major release
92
103
  * @returns - The names of currently enabled plugins
93
104
  */
94
105
  get enabledPlugins() {
@@ -123,7 +134,7 @@ class UnistylesRuntime {
123
134
  width: this.unistylesBridge.statusBar.width,
124
135
  height: this.unistylesBridge.statusBar.height,
125
136
  setColor: (color, alpha) => {
126
- const [parsedColor, parsedAlpha] = (0, _utils.parseColor)(color, alpha);
137
+ const [parsedColor, parsedAlpha] = (0, _parseColor.parseColor)(color, alpha);
127
138
  this.unistylesBridge.statusBar.setColor(parsedColor, parsedAlpha);
128
139
  },
129
140
  setHidden: hidden => this.unistylesBridge.statusBar.setHidden(hidden)
@@ -139,7 +150,7 @@ class UnistylesRuntime {
139
150
  width: this.unistylesBridge.navigationBar.width,
140
151
  height: this.unistylesBridge.navigationBar.height,
141
152
  setColor: (color, alpha) => {
142
- const [parsedColor, parsedAlpha] = (0, _utils.parseColor)(color, alpha);
153
+ const [parsedColor, parsedAlpha] = (0, _parseColor.parseColor)(color, alpha);
143
154
  this.unistylesBridge.navigationBar.setColor(parsedColor, parsedAlpha);
144
155
  },
145
156
  setHidden: hidden => this.unistylesBridge.navigationBar.setHidden(hidden)
@@ -177,6 +188,16 @@ class UnistylesRuntime {
177
188
  return parseFloat(this.unistylesBridge.fontScale.toFixed(2));
178
189
  }
179
190
 
191
+ /**
192
+ * Get the hairline width
193
+ * @returns - The thinnest width of the platform
194
+ */
195
+ get hairlineWidth() {
196
+ const pixelRatio = this.pixelRatio;
197
+ const nearestPixel = Math.trunc(pixelRatio * 0.4) || 1;
198
+ return nearestPixel / pixelRatio;
199
+ }
200
+
180
201
  /**
181
202
  * Get the immersive mode (both status bar and navigation bar hidden (Android))
182
203
  * @param isEnabled
@@ -191,7 +212,7 @@ class UnistylesRuntime {
191
212
  * @param alpha - Color alpha - default is 1
192
213
  */
193
214
  setRootViewBackgroundColor = (color, alpha) => {
194
- const [parsedColor, parsedAlpha] = (0, _utils.parseColor)(color, alpha);
215
+ const [parsedColor, parsedAlpha] = (0, _parseColor.parseColor)(color, alpha);
195
216
  this.unistylesBridge.setRootViewBackgroundColor(parsedColor, parsedAlpha);
196
217
  };
197
218
 
@@ -231,6 +252,7 @@ class UnistylesRuntime {
231
252
 
232
253
  /**
233
254
  * Enable a plugin
255
+ * @deprecated - Plugins will be removed in the next major release
234
256
  * @param plugin - Plugin that conforms to UnistylesPlugin interface
235
257
  */
236
258
  addPlugin = plugin => {
@@ -239,6 +261,7 @@ class UnistylesRuntime {
239
261
 
240
262
  /**
241
263
  * Disable a plugin
264
+ * @deprecated - Plugins will be removed in the next major release
242
265
  * @param plugin - Plugin that conforms to UnistylesPlugin interface
243
266
  */
244
267
  removePlugin = plugin => {
@@ -1 +1 @@
1
- {"version":3,"names":["_common","require","_utils","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","miniRuntime","contentSizeCategory","breakpoint","screen","insets","statusBar","width","height","navigationBar","orientation","pixelRatio","fontScale","colorScheme","hasAdaptiveThemes","themeName","breakpoints","enabledPlugins","screenWidth","screenHeight","setColor","color","alpha","parsedColor","parsedAlpha","parseColor","setHidden","hidden","ScreenOrientation","Landscape","Portrait","parseFloat","toFixed","setImmersiveMode","isEnabled","setRootViewBackgroundColor","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;AAIA,IAAAC,MAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACO,MAAME,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,WAA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I,CAACf,iBAAiB,CAACsC,QAAQ,CAACD,IAAI,CAAC,EAAE;MACvC,IAAI,CAACtC,eAAe,CAACwC,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,CAAC5C,iBAAiB,CAAC2C,WAAW,CAACN,IAAI,EAAEO,OAAO,CAAC,IAAI,CAAC5C,iBAAiB,CAAC6C,QAAQ,CAACR,IAAI,CAAC,CAAC,CAAC;EAC5F,CAAC;;EAED;AACJ;AACA;AACA;EACWS,iBAAiB,GAAIC,MAAe,IAAK;IAC5C,IAAI,CAAChD,eAAe,CAACiD,iBAAiB,CAACD,MAAM,CAAC;EAClD,CAAC;;EAED;AACJ;AACA;AACA;EACWE,SAAS,GAAIC,MAAuB,IAAK;IAC5C,IAAI,CAAClD,iBAAiB,CAACiD,SAAS,CAACC,MAAM,CAAC;EAC5C,CAAC;;EAED;AACJ;AACA;AACA;EACWC,YAAY,GAAID,MAAuB,IAAK;IAC/C,IAAI,CAAClD,iBAAiB,CAACmD,YAAY,CAACD,MAAM,CAAC;EAC/C,CAAC;AACL;AAACE,OAAA,CAAAvD,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_common","require","_parseColor","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","miniRuntime","contentSizeCategory","breakpoint","screen","insets","statusBar","width","height","navigationBar","orientation","pixelRatio","fontScale","hairlineWidth","rtl","colorScheme","hasAdaptiveThemes","themeName","breakpoints","enabledPlugins","screenWidth","screenHeight","setColor","color","alpha","parsedColor","parsedAlpha","parseColor","setHidden","hidden","ScreenOrientation","Landscape","Portrait","parseFloat","toFixed","nearestPixel","Math","trunc","setImmersiveMode","isEnabled","setRootViewBackgroundColor","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;AAIA,IAAAC,WAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACO,MAAME,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;MACHC,mBAAmB,EAAE,IAAI,CAACA,mBAAmB;MAC7CC,UAAU,EAAE,IAAI,CAACA,UAAU;MAC3BC,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBC,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBC,SAAS,EAAE;QACPC,KAAK,EAAE,IAAI,CAACD,SAAS,CAACC,KAAK;QAC3BC,MAAM,EAAE,IAAI,CAACF,SAAS,CAACE;MAC3B,CAAC;MACDC,aAAa,EAAE;QACXF,KAAK,EAAE,IAAI,CAACE,aAAa,CAACF,KAAK;QAC/BC,MAAM,EAAE,IAAI,CAACC,aAAa,CAACD;MAC/B,CAAC;MACDE,WAAW,EAAE,IAAI,CAACA,WAAW;MAC7BC,UAAU,EAAE,IAAI,CAACA,UAAU;MAC3BC,SAAS,EAAE,IAAI,CAACA,SAAS;MACzBC,aAAa,EAAE,IAAI,CAACA,aAAa;MACjCC,GAAG,EAAE,IAAI,CAACA;IACd,CAAC;EACL;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO,IAAI,CAAChB,eAAe,CAACgB,WAAW;EAC3C;;EAEA;AACJ;AACA;AACA;EACI,IAAWD,GAAGA,CAA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AAO,CAAC,IAAI,CAACjD,iBAAiB,CAACkD,QAAQ,CAACR,IAAI,CAAC,CAAC,CAAC;EAC5F,CAAC;;EAED;AACJ;AACA;AACA;EACWS,iBAAiB,GAAIC,MAAe,IAAK;IAC5C,IAAI,CAACrD,eAAe,CAACsD,iBAAiB,CAACD,MAAM,CAAC;EAClD,CAAC;;EAED;AACJ;AACA;AACA;AACA;EACWE,SAAS,GAAIC,MAAuB,IAAK;IAC5C,IAAI,CAACvD,iBAAiB,CAACsD,SAAS,CAACC,MAAM,CAAC;EAC5C,CAAC;;EAED;AACJ;AACA;AACA;AACA;EACWC,YAAY,GAAID,MAAuB,IAAK;IAC/C,IAAI,CAACvD,iBAAiB,CAACwD,YAAY,CAACD,MAAM,CAAC;EAC/C,CAAC;AACL;AAACE,OAAA,CAAA5D,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -29,7 +29,9 @@ class UnistylesMockedRuntime {
29
29
  },
30
30
  orientation: this.orientation,
31
31
  pixelRatio: this.pixelRatio,
32
- fontScale: this.fontScale
32
+ fontScale: this.fontScale,
33
+ hairlineWidth: this.hairlineWidth,
34
+ rtl: this.rtl
33
35
  };
34
36
  }
35
37
  get colorScheme() {
@@ -51,6 +53,9 @@ class UnistylesMockedRuntime {
51
53
  const firstBreakpoint = this.unistylesRegistry.sortedBreakpointPairs.at(0);
52
54
  return firstBreakpoint ? firstBreakpoint.at(0) : undefined;
53
55
  }
56
+ get rtl() {
57
+ return false;
58
+ }
54
59
  get breakpoints() {
55
60
  return this.unistylesRegistry.breakpoints;
56
61
  }
@@ -74,6 +79,9 @@ class UnistylesMockedRuntime {
74
79
  get pixelRatio() {
75
80
  return 1.0;
76
81
  }
82
+ get hairlineWidth() {
83
+ return 0.333333;
84
+ }
77
85
  get fontScale() {
78
86
  return 1.0;
79
87
  }