react-native-unistyles 2.9.0 → 2.9.2
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +3 -3
- package/android/src/main/cxx/platform.cpp +18 -0
- package/android/src/main/cxx/platform.h +1 -0
- package/android/src/main/java/com/unistyles/Platform.kt +12 -1
- package/android/src/main/java/com/unistyles/UnistylesModule.kt +1 -1
- package/cxx/UnistylesImpl.cpp +12 -2
- package/cxx/UnistylesModel.h +4 -0
- package/cxx/UnistylesRuntime.h +3 -1
- package/ios/platform/Platform_iOS.mm +6 -1
- package/lib/commonjs/core/UnistyleRegistry.js +3 -0
- package/lib/commonjs/core/UnistyleRegistry.js.map +1 -1
- package/lib/commonjs/core/UnistylesModule.js +7 -1
- package/lib/commonjs/core/UnistylesModule.js.map +1 -1
- package/lib/commonjs/utils/styles.js +7 -1
- package/lib/commonjs/utils/styles.js.map +1 -1
- package/lib/module/core/UnistyleRegistry.js +4 -1
- package/lib/module/core/UnistyleRegistry.js.map +1 -1
- package/lib/module/core/UnistylesModule.js +7 -1
- package/lib/module/core/UnistylesModule.js.map +1 -1
- package/lib/module/utils/styles.js +7 -1
- package/lib/module/utils/styles.js.map +1 -1
- package/lib/typescript/src/core/UnistyleRegistry.d.ts.map +1 -1
- package/lib/typescript/src/core/UnistylesModule.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types/unistyles.d.ts +2 -0
- package/lib/typescript/src/types/unistyles.d.ts.map +1 -1
- package/lib/typescript/src/utils/styles.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/UnistyleRegistry.ts +5 -1
- package/src/core/UnistylesModule.ts +8 -1
- package/src/index.ts +2 -1
- package/src/types/unistyles.ts +5 -1
- package/src/utils/styles.ts +10 -1
package/README.md
CHANGED
@@ -65,9 +65,6 @@ npx expo prebuild
|
|
65
65
|
<a href="https://github.com/mobily">
|
66
66
|
<img src="https://avatars.githubusercontent.com/u/1467712?v=4" height="70px" width="70px" alt="mobily" />
|
67
67
|
</a>
|
68
|
-
<a href="https://github.com/abanobboles">
|
69
|
-
<img src="https://avatars.githubusercontent.com/u/9078953?v=4" height="70px" width="70px" alt="abanobboles" />
|
70
|
-
</a>
|
71
68
|
<a href="https://github.com/mwarger">
|
72
69
|
<img src="https://avatars.githubusercontent.com/u/686823?v=4" height="70px" width="70px" alt="mwarger" />
|
73
70
|
</a>
|
@@ -89,6 +86,9 @@ npx expo prebuild
|
|
89
86
|
<a href="https://github.com">
|
90
87
|
<img src="https://avatars.githubusercontent.com/u/113348625?v=4" height="70px" width="70px" alt="anonymous" />
|
91
88
|
</a>
|
89
|
+
<a href="https://github.com/abanobboles">
|
90
|
+
<img src="https://avatars.githubusercontent.com/u/9078953?v=4" height="70px" width="70px" alt="abanobboles" />
|
91
|
+
</a>
|
92
92
|
|
93
93
|
## Sponsor my work
|
94
94
|
|
@@ -49,6 +49,10 @@ void makeShared(JNIEnv *env, jobject unistylesModule, std::shared_ptr<UnistylesR
|
|
49
49
|
setRootViewBackgroundColor(env, unistylesModule, color, alpha);
|
50
50
|
});
|
51
51
|
|
52
|
+
unistylesRuntime->setDisableAnimatedInsetsAndroidCallback([=]() {
|
53
|
+
disableAnimatedInsets(env, unistylesModule);
|
54
|
+
});
|
55
|
+
|
52
56
|
Screen screen = getScreenDimensions(env, unistylesModule);
|
53
57
|
|
54
58
|
unistylesRuntime->screen = Dimensions{screen.width, screen.height};
|
@@ -62,6 +66,20 @@ void makeShared(JNIEnv *env, jobject unistylesModule, std::shared_ptr<UnistylesR
|
|
62
66
|
unistylesRuntime->rtl = getIsRTL(env, unistylesModule);
|
63
67
|
}
|
64
68
|
|
69
|
+
void disableAnimatedInsets(JNIEnv *env, jobject unistylesModule) {
|
70
|
+
jclass cls = env->GetObjectClass(unistylesModule);
|
71
|
+
jfieldID platformFieldId = env->GetFieldID(cls, "platform", "Lcom/unistyles/Platform;");
|
72
|
+
jobject platformInstance = env->GetObjectField(unistylesModule, platformFieldId);
|
73
|
+
jclass platformClass = env->GetObjectClass(platformInstance);
|
74
|
+
jmethodID methodId = env->GetMethodID(platformClass, "disableAnimatedInsets", "()V");
|
75
|
+
|
76
|
+
env->CallVoidMethod(platformInstance, methodId);
|
77
|
+
|
78
|
+
env->DeleteLocalRef(cls);
|
79
|
+
env->DeleteLocalRef(platformInstance);
|
80
|
+
env->DeleteLocalRef(platformClass);
|
81
|
+
}
|
82
|
+
|
65
83
|
Screen getScreenDimensions(JNIEnv *env, jobject unistylesModule) {
|
66
84
|
jobject result = JNI_callPlatform(env, unistylesModule, "getScreenDimensions", "()Lcom/unistyles/Screen;");
|
67
85
|
Screen screenDimensions = jobjectToScreen(env, result);
|
@@ -17,3 +17,4 @@ bool getIsRTL(JNIEnv *env, jobject unistylesModule);
|
|
17
17
|
std::string getContentSizeCategory(JNIEnv *env, jobject unistylesModule);
|
18
18
|
void setNavigationBarColor(JNIEnv *env, jobject unistylesModule, std::string color, float alpha);
|
19
19
|
void setStatusBarColor(JNIEnv *env, jobject unistylesModule, std::string color, float alpha);
|
20
|
+
void disableAnimatedInsets(JNIEnv *env, jobject unistylesModule);
|
@@ -20,12 +20,17 @@ import java.util.Locale
|
|
20
20
|
import kotlin.math.roundToInt
|
21
21
|
|
22
22
|
class Platform(private val reactApplicationContext: ReactApplicationContext) {
|
23
|
+
var hasAnimatedInsets = true
|
23
24
|
private var insets: Insets = Insets(0, 0, 0, 0)
|
24
25
|
private var defaultNavigationBarColor: Int = -1
|
25
26
|
private var defaultStatusBarColor: Int = -1
|
26
27
|
|
27
28
|
var orientation: Int = reactApplicationContext.resources.configuration.orientation
|
28
29
|
|
30
|
+
fun disableAnimatedInsets() {
|
31
|
+
this.hasAnimatedInsets = false
|
32
|
+
}
|
33
|
+
|
29
34
|
@Suppress("DEPRECATION")
|
30
35
|
fun getScreenDimensions(): Screen {
|
31
36
|
// function takes in count edge-to-edge layout
|
@@ -140,10 +145,16 @@ class Platform(private val reactApplicationContext: ReactApplicationContext) {
|
|
140
145
|
}
|
141
146
|
|
142
147
|
val insets = insetsCompat.getInsets(WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout())
|
143
|
-
|
148
|
+
|
149
|
+
if (!hasAnimatedInsets) {
|
150
|
+
this.insets = Insets(statusBarTopInset, insets.bottom, insets.left, insets.right)
|
151
|
+
|
152
|
+
return
|
153
|
+
}
|
144
154
|
|
145
155
|
// Android 10 and below - set bottom insets to 0 while keyboard is visible and use default bottom insets otherwise
|
146
156
|
// Android 11 and above - animate bottom insets while keyboard is appearing and disappearing
|
157
|
+
val imeInsets = insetsCompat.getInsets(WindowInsetsCompat.Type.ime())
|
147
158
|
val insetBottom = when(imeInsets.bottom > 0) {
|
148
159
|
true -> {
|
149
160
|
if (Build.VERSION.SDK_INT >= 30 && animatedBottomInsets != null) {
|
@@ -154,7 +154,7 @@ class UnistylesModule(reactContext: ReactApplicationContext) : ReactContextBaseJ
|
|
154
154
|
insets
|
155
155
|
}
|
156
156
|
|
157
|
-
if (Build.VERSION.SDK_INT >= 30) {
|
157
|
+
if (platform.hasAnimatedInsets && Build.VERSION.SDK_INT >= 30) {
|
158
158
|
ViewCompat.setWindowInsetsAnimationCallback(
|
159
159
|
mainView,
|
160
160
|
object : WindowInsetsAnimationCompat.Callback(DISPATCH_MODE_STOP) {
|
package/cxx/UnistylesImpl.cpp
CHANGED
@@ -234,11 +234,11 @@ jsi::Value UnistylesRuntime::getNavigationBar(jsi::Runtime& rt, std::string fnNa
|
|
234
234
|
}
|
235
235
|
|
236
236
|
jsi::Value UnistylesRuntime::getPixelRatio(jsi::Runtime& rt, std::string fnName) {
|
237
|
-
return jsi::Value(roundf(this->pixelRatio * 100)/ 100);
|
237
|
+
return jsi::Value(static_cast<double>(roundf(this->pixelRatio * 100)/ 100));
|
238
238
|
}
|
239
239
|
|
240
240
|
jsi::Value UnistylesRuntime::getFontScale(jsi::Runtime& rt, std::string fnName) {
|
241
|
-
return jsi::Value(roundf(this->fontScale * 100) / 100);
|
241
|
+
return jsi::Value(static_cast<double>(roundf(this->fontScale * 100) / 100));
|
242
242
|
}
|
243
243
|
|
244
244
|
std::optional<jsi::Value> UnistylesRuntime::setThemes(jsi::Runtime& rt, const jsi::Value& value) {
|
@@ -298,3 +298,13 @@ jsi::Value UnistylesRuntime::setRootBackgroundColor(jsi::Runtime& rt, std::strin
|
|
298
298
|
jsi::Value UnistylesRuntime::getIsRtl(jsi::Runtime& rt, std::string fnName) {
|
299
299
|
return jsi::Value(this->rtl);
|
300
300
|
}
|
301
|
+
|
302
|
+
jsi::Value UnistylesRuntime::disableAnimatedInsets(jsi::Runtime& rt, std::string fnName) {
|
303
|
+
return HOST_FN(fnName, 1, {
|
304
|
+
if (this->disableAnimatedInsetsAndroid.has_value()) {
|
305
|
+
this->disableAnimatedInsetsAndroid.value()();
|
306
|
+
}
|
307
|
+
|
308
|
+
return jsi::Value::undefined();
|
309
|
+
});
|
310
|
+
}
|
package/cxx/UnistylesModel.h
CHANGED
@@ -66,6 +66,7 @@ struct UnistylesModel {
|
|
66
66
|
std::optional<std::function<void(bool)>> setStatusBarHidden;
|
67
67
|
std::optional<std::function<void(bool)>> setImmersiveMode;
|
68
68
|
std::optional<std::function<void(std::string, float alpha)>> setRootViewBackgroundColor;
|
69
|
+
std::optional<std::function<void()>> disableAnimatedInsetsAndroid;
|
69
70
|
|
70
71
|
void setScreenDimensionsCallback(std::function<Screen()> callback) {
|
71
72
|
this->getScreenDimensions = callback;
|
@@ -103,6 +104,9 @@ struct UnistylesModel {
|
|
103
104
|
void setRootViewBackgroundColorCallback(std::function<void(std::string color, float alpha)> callback) {
|
104
105
|
this->setRootViewBackgroundColor = callback;
|
105
106
|
}
|
107
|
+
void setDisableAnimatedInsetsAndroidCallback(std::function<void()> callback) {
|
108
|
+
this->disableAnimatedInsetsAndroid = callback;
|
109
|
+
}
|
106
110
|
|
107
111
|
Dimensions screen = {0, 0};
|
108
112
|
Dimensions statusBar = {0, 0};
|
package/cxx/UnistylesRuntime.h
CHANGED
@@ -35,7 +35,8 @@ struct JSI_EXPORT UnistylesRuntime : public jsi::HostObject, UnistylesModel {
|
|
35
35
|
{"fontScale", BIND_FN(getFontScale)},
|
36
36
|
{"setRootViewBackgroundColor", BIND_FN(setRootBackgroundColor)},
|
37
37
|
{"setImmersiveMode", BIND_FN(setImmersiveModeEnabled)},
|
38
|
-
{"rtl", BIND_FN(getIsRtl)}
|
38
|
+
{"rtl", BIND_FN(getIsRtl)},
|
39
|
+
{"disableAnimatedInsets", BIND_FN(disableAnimatedInsets)}
|
39
40
|
};
|
40
41
|
|
41
42
|
this->setters = {
|
@@ -66,6 +67,7 @@ struct JSI_EXPORT UnistylesRuntime : public jsi::HostObject, UnistylesModel {
|
|
66
67
|
jsi::Value setRootBackgroundColor(jsi::Runtime&, std::string);
|
67
68
|
jsi::Value setImmersiveModeEnabled(jsi::Runtime&, std::string);
|
68
69
|
jsi::Value getIsRtl(jsi::Runtime&, std::string);
|
70
|
+
jsi::Value disableAnimatedInsets(jsi::Runtime&, std::string);
|
69
71
|
|
70
72
|
std::optional<jsi::Value> setThemes(jsi::Runtime&, const jsi::Value&);
|
71
73
|
|
@@ -81,6 +81,7 @@
|
|
81
81
|
return [self setRootViewBackgroundColor:color alpha:alpha];
|
82
82
|
});
|
83
83
|
|
84
|
+
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
|
84
85
|
dispatch_async(dispatch_get_main_queue(), ^{
|
85
86
|
Screen screen = [self getScreenDimensions];
|
86
87
|
|
@@ -92,7 +93,11 @@
|
|
92
93
|
unistylesRuntime->pixelRatio = screen.pixelRatio;
|
93
94
|
unistylesRuntime->fontScale = screen.fontScale;
|
94
95
|
unistylesRuntime->rtl = [self isRtl];
|
96
|
+
|
97
|
+
dispatch_semaphore_signal(semaphore);
|
95
98
|
});
|
99
|
+
|
100
|
+
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
|
96
101
|
}
|
97
102
|
|
98
103
|
- (void)onAppearanceChange:(NSNotification *)notification {
|
@@ -155,7 +160,7 @@
|
|
155
160
|
BOOL hasForcedRtl = [[NSUserDefaults standardUserDefaults] boolForKey:@"RCTI18nUtil_forceRTL"];
|
156
161
|
// user preferences
|
157
162
|
BOOL isRtl = [UIApplication sharedApplication].userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft;
|
158
|
-
|
163
|
+
|
159
164
|
return hasForcedRtl || isRtl;
|
160
165
|
}
|
161
166
|
|
@@ -53,6 +53,9 @@ class UnistyleRegistry {
|
|
53
53
|
if (_common.isWeb && config.windowResizeDebounceTimeMs !== undefined) {
|
54
54
|
this.unistylesBridge.setWindowResizeDebounceTimeMs(config.windowResizeDebounceTimeMs);
|
55
55
|
}
|
56
|
+
if (_common.isAndroid && config.disableAnimatedInsets) {
|
57
|
+
this.unistylesBridge.disableAnimatedInsets();
|
58
|
+
}
|
56
59
|
return {
|
57
60
|
addBreakpoints: this.addBreakpoints,
|
58
61
|
addThemes: this.addThemes
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_common","require","_plugins","UnistyleRegistry","config","plugins","isWeb","normalizeWebStylesPlugin","themeNames","themes","breakpoints","sortedBreakpointPairs","constructor","unistylesBridge","addThemes","keys","Object","addBreakpoints","addConfig","useBreakpoints","adaptiveThemes","useAdaptiveThemes","forEach","plugin","addPlugin","initialTheme","useTheme","experimentalCSSMediaQueries","cssMediaQueriesPlugin","concat","name","windowResizeDebounceTimeMs","undefined","setWindowResizeDebounceTimeMs","getTheme","forName","length","hasTheme","themeName","Error","UnistylesError","ThemeNotFound","ThemeNotSelected","notify","startsWith","InvalidPluginName","isAlreadyRegistered","some","isDev","DuplicatePluginName","removePlugin","CantRemoveInternalPlugin","filter","updateTheme","theme","exports"],"sourceRoot":"../../../src","sources":["core/UnistyleRegistry.ts"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEO,MAAME,gBAAgB,CAAC;EACnBC,MAAM,GAA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AK,CAAC,CAAC;IACnE;IAEA,IAAInB,MAAM,CAACqB,YAAY,EAAE;MACrB,IAAI,CAACZ,eAAe,CAACa,QAAQ,CAACtB,MAAM,CAACqB,YAAY,CAAC;IACtD;IAEA,IAAIrB,MAAM,CAACuB,2BAA2B,EAAE;MACpC,IAAI,CAACtB,OAAO,GAAG,CAACuB,8BAAqB,CAAC,CAACC,MAAM,CAAC,IAAI,CAACxB,OAAO,CAAC;MAC3D,IAAI,CAACQ,eAAe,CAACW,SAAS,CAACI,8BAAqB,CAACE,IAAI,EAAE,KAAK,CAAC;IACrE;IAEA,IAAIxB,aAAK,IAAIF,MAAM,CAAC2B,0BAA0B,KAAKC,SAAS,EAAE;MAC1D,IAAI,CAACnB,eAAe,CAACoB,6BAA6B,CAAC7B,MAAM,CAAC2B,0BAA0B,CAAC;IACzF;IAEA,OAAO;
|
1
|
+
{"version":3,"names":["_common","require","_plugins","UnistyleRegistry","config","plugins","isWeb","normalizeWebStylesPlugin","themeNames","themes","breakpoints","sortedBreakpointPairs","constructor","unistylesBridge","addThemes","keys","Object","addBreakpoints","addConfig","useBreakpoints","adaptiveThemes","useAdaptiveThemes","forEach","plugin","addPlugin","initialTheme","useTheme","experimentalCSSMediaQueries","cssMediaQueriesPlugin","concat","name","windowResizeDebounceTimeMs","undefined","setWindowResizeDebounceTimeMs","isAndroid","disableAnimatedInsets","getTheme","forName","length","hasTheme","themeName","Error","UnistylesError","ThemeNotFound","ThemeNotSelected","notify","startsWith","InvalidPluginName","isAlreadyRegistered","some","isDev","DuplicatePluginName","removePlugin","CantRemoveInternalPlugin","filter","updateTheme","theme","exports"],"sourceRoot":"../../../src","sources":["core/UnistyleRegistry.ts"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEO,MAAME,gBAAgB,CAAC;EACnBC,MAAM,GAAoB,CAAC,CAAC;EAC5BC,OAAO,GAA2BC,aAAK,GACxC,CAACC,iCAAwB,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IAAKA,IAAI,IAAI,IAAI,CAACrB,MAAM;AAC1E;AAACgD,OAAA,CAAAtD,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
@@ -50,7 +50,7 @@ class UnistylesBridgeWeb {
|
|
50
50
|
this.setupListeners();
|
51
51
|
this.#screenWidth = window.innerWidth;
|
52
52
|
this.#screenHeight = window.innerHeight;
|
53
|
-
this.#rtl =
|
53
|
+
this.#rtl = document.documentElement.dir === 'rtl';
|
54
54
|
}
|
55
55
|
}
|
56
56
|
install() {
|
@@ -209,6 +209,12 @@ class UnistylesBridgeWeb {
|
|
209
209
|
this.emitThemeChange();
|
210
210
|
}
|
211
211
|
});
|
212
|
+
new MutationObserver(() => {
|
213
|
+
this.#rtl = document.documentElement.dir === 'rtl';
|
214
|
+
}).observe(document.documentElement, {
|
215
|
+
attributes: true,
|
216
|
+
attributeFilter: ['dir']
|
217
|
+
});
|
212
218
|
}
|
213
219
|
getBreakpointFromScreenWidth(width) {
|
214
220
|
const breakpoint = this.#sortedBreakpointPairs.find(([, value], index, otherBreakpoints) => {
|
@@ -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","hairlineWidth","rtl","constructor","setupListeners","
|
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","document","documentElement","dir","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","MutationObserver","observe","attributes","attributeFilter","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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H,eAAe,GAAAD,OAAA,CAAAC,eAAA,GAAG,IAAIhH,kBAAkB,CAAC,CAAC","ignoreList":[]}
|
@@ -27,7 +27,13 @@ const parseStyle = (style, variant = {}, parseMediaQueries = true) => Object.ent
|
|
27
27
|
|
28
28
|
// transforms
|
29
29
|
if (key === 'transform' && Array.isArray(value)) {
|
30
|
-
acc[key] = value.map(value => parseStyle(value, variant))
|
30
|
+
acc[key] = value.map(value => parseStyle(value, variant)).filter(value => {
|
31
|
+
// remove undefined values
|
32
|
+
if (typeof value === 'object') {
|
33
|
+
return Object.values(value).at(0) !== undefined;
|
34
|
+
}
|
35
|
+
return true;
|
36
|
+
});
|
31
37
|
return acc;
|
32
38
|
}
|
33
39
|
if (key === 'fontVariant' && Array.isArray(value)) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_breakpoints","require","_common","_withPlugins","proxifyFunction","key","fn","variant","Proxy","apply","target","thisArg","argumentsList","withPlugins","parseStyle","exports","isPlatformColor","value","isIOS","semantic","isAndroid","resource_paths","style","parseMediaQueries","Object","entries","reduce","acc","Array","isArray","map","keys","toString","default","getValueForBreakpoint"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEO,MAAMG,eAAe,GAAGA,CAC3BC,GAAW,EACXC,EAAY,EACZC,OAA0C,KAC/B,IAAIC,KAAK,CAACF,EAAE,EAAE;EACzBG,KAAK,EAAEA,CAACC,MAAM,EAAEC,OAAO,EAAEC,aAAa,KAAK,IAAAC,wBAAW,EAACR,GAAG,EAAES,UAAU,CAACJ,MAAM,CAACD,KAAK,CAACE,OAAO,EAAEC,aAAa,CAAC,EAAEL,OAAO,CAAC;AACzH,CAAC,CAAC;AAAAQ,OAAA,CAAAX,eAAA,GAAAA,eAAA;AAEK,MAAMY,eAAe,GAAkBC,KAAQ,IAAc;EAChE,IAAIC,aAAK,EAAE;IACP,OAAO,UAAU,IAAID,KAAK,IAAI,OAAOA,KAAK,CAACE,QAAQ,KAAK,QAAQ;EACpE;EAEA,OAAOC,iBAAS,IAAI,gBAAgB,IAAIH,KAAK,IAAI,OAAOA,KAAK,CAACI,cAAc,KAAK,QAAQ;AAC7F,CAAC;AAAAN,OAAA,CAAAC,eAAA,GAAAA,eAAA;AAEM,MAAMF,UAAU,GAAGA,CACtBQ,KAAQ,EACRf,OAAyC,GAAG,CAAC,CAAC,EAC9CgB,iBAAiB,GAAG,IAAI,KACpBC,MAAM,CACTC,OAAO,CAACH,KAAK,IAAI,CAAC,CAAC,CAAC,CACpBI,MAAM,CAAC,CAACC,GAAG,EAAE,CAACtB,GAAG,EAAEY,KAAK,CAAC,KAAK;EAC3B;EACA,IAAIZ,GAAG,KAAK,cAAc,IAAIA,GAAG,KAAM,kBAAkB,EAAE;IACvDsB,GAAG,CAACtB,GAAG,CAAC,GAAGS,UAAU,CAACG,KAAK,EAAEV,OAAO,CAAC;IAErC,OAAOoB,GAAG;EACd;;EAEA;EACA,IAAItB,GAAG,KAAK,WAAW,IAAIuB,KAAK,CAACC,OAAO,CAACZ,KAAK,CAAC,EAAE;IAC7CU,GAAG,CAACtB,GAAG,CAAC,GAAGY,KAAK,
|
1
|
+
{"version":3,"names":["_breakpoints","require","_common","_withPlugins","proxifyFunction","key","fn","variant","Proxy","apply","target","thisArg","argumentsList","withPlugins","parseStyle","exports","isPlatformColor","value","isIOS","semantic","isAndroid","resource_paths","style","parseMediaQueries","Object","entries","reduce","acc","Array","isArray","map","filter","values","at","undefined","keys","toString","default","getValueForBreakpoint"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEO,MAAMG,eAAe,GAAGA,CAC3BC,GAAW,EACXC,EAAY,EACZC,OAA0C,KA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","ignoreList":[]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { isDev, isWeb, UnistylesError } from '../common';
|
1
|
+
import { isAndroid, isDev, isWeb, UnistylesError } from '../common';
|
2
2
|
import { cssMediaQueriesPlugin, normalizeWebStylesPlugin } from '../plugins';
|
3
3
|
export class UnistyleRegistry {
|
4
4
|
config = {};
|
@@ -47,6 +47,9 @@ export class UnistyleRegistry {
|
|
47
47
|
if (isWeb && config.windowResizeDebounceTimeMs !== undefined) {
|
48
48
|
this.unistylesBridge.setWindowResizeDebounceTimeMs(config.windowResizeDebounceTimeMs);
|
49
49
|
}
|
50
|
+
if (isAndroid && config.disableAnimatedInsets) {
|
51
|
+
this.unistylesBridge.disableAnimatedInsets();
|
52
|
+
}
|
50
53
|
return {
|
51
54
|
addBreakpoints: this.addBreakpoints,
|
52
55
|
addThemes: this.addThemes
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["isDev","isWeb","UnistylesError","cssMediaQueriesPlugin","normalizeWebStylesPlugin","UnistyleRegistry","config","plugins","themeNames","themes","breakpoints","sortedBreakpointPairs","constructor","unistylesBridge","addThemes","keys","Object","addBreakpoints","addConfig","useBreakpoints","adaptiveThemes","useAdaptiveThemes","forEach","plugin","addPlugin","initialTheme","useTheme","experimentalCSSMediaQueries","concat","name","windowResizeDebounceTimeMs","undefined","setWindowResizeDebounceTimeMs","getTheme","forName","length","hasTheme","themeName","Error","ThemeNotFound","ThemeNotSelected","notify","startsWith","InvalidPluginName","isAlreadyRegistered","some","DuplicatePluginName","removePlugin","CantRemoveInternalPlugin","filter","updateTheme","theme"],"sourceRoot":"../../../src","sources":["core/UnistyleRegistry.ts"],"mappings":"AAEA,SAASA,KAAK,EAAEC,KAAK,EAAEC,cAAc,QAAQ,WAAW;
|
1
|
+
{"version":3,"names":["isAndroid","isDev","isWeb","UnistylesError","cssMediaQueriesPlugin","normalizeWebStylesPlugin","UnistyleRegistry","config","plugins","themeNames","themes","breakpoints","sortedBreakpointPairs","constructor","unistylesBridge","addThemes","keys","Object","addBreakpoints","addConfig","useBreakpoints","adaptiveThemes","useAdaptiveThemes","forEach","plugin","addPlugin","initialTheme","useTheme","experimentalCSSMediaQueries","concat","name","windowResizeDebounceTimeMs","undefined","setWindowResizeDebounceTimeMs","disableAnimatedInsets","getTheme","forName","length","hasTheme","themeName","Error","ThemeNotFound","ThemeNotSelected","notify","startsWith","InvalidPluginName","isAlreadyRegistered","some","DuplicatePluginName","removePlugin","CantRemoveInternalPlugin","filter","updateTheme","theme"],"sourceRoot":"../../../src","sources":["core/UnistyleRegistry.ts"],"mappings":"AAEA,SAASA,SAAS,EAAEC,KAAK,EAAEC,KAAK,EAAEC,cAAc,QAAQ,WAAW;AACnE,SAASC,qBAAqB,EAAEC,wBAAwB,QAAQ,YAAY;AAE5E,OAAO,MAAMC,gBAAgB,CAAC;EACnBC,MAAM,GAAoB,CAAC,CAAC;EAC5BC,OAAO,GAA2BN,KAAK,GACxC,CAACG,wBAAwB,CAAC,GAC1B,EAAE;EACDI,UAAU,GAAiC,EAAE;EAC7CC,MAAM,GAAoB,CAAC,CAAC;EAC5BC,WAAW,GAAyB,CAAC,CAAC;EACtCC,qBAAqB,GAA0F,EAAE;EAExHC,WAAWA,CAASC,eAAgC,EAAE;IAAA,KAAlCA,eAAgC,GAAhCA,eAAgC;EAAG;EAEhDC,SAAS,GAAIL,MAAuB,IAAK;IAC5C,IAAI,CAACA,MAAM,GAAGA,MAAM;IAEpB,MAAMM,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACN,MAAM,CAAiC;IAEhE,IAAI,CAACI,eAAe,CAACJ,MAAM,GAAGM,IAAI;IAClC,IAAI,CAACP,UAAU,GAAGO,IAAI;IAEtB,OAAO;MACHE,cAAc,EAAE,IAAI,CAACA,cAAc;MACnCC,SAAS,EAAE,IAAI,CAACA;IACpB,CAAC;EACL,CAAC;EAEMD,cAAc,GAAIP,WAAiC,IAAK;IAC3D,IAAI,CAACA,WAAW,GAAGA,WAAW;IA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U,CAAC,aAAa,CAAC,EAAE;MACvC,MAAM,IAAIJ,KAAK,CAACrC,cAAc,CAAC+C,wBAAwB,CAAC;IAC5D;IAEA,IAAI,CAAC1C,OAAO,GAAG,IAAI,CAACA,OAAO,CAAC2C,MAAM,CAAC,CAAC;MAAErB;IAAK,CAAC,KAAKA,IAAI,KAAKN,MAAM,CAACM,IAAI,CAAC;IACtE,IAAI,CAAChB,eAAe,CAACmC,YAAY,CAACzB,MAAM,CAACM,IAAI,CAAC;EAClD,CAAC;EAEMsB,WAAW,GAAGA,CAACtB,IAA2B,EAAEuB,KAA6C,KAAK;IACjG,IAAI,CAAC3C,MAAM,CAACoB,IAAI,CAAC,GAAGuB,KAAK;IAEzB,IAAI,IAAI,CAACvC,eAAe,CAACyB,SAAS,KAAKT,IAAI,EAAE;MACzC,IAAI,CAAChB,eAAe,CAACsC,WAAW,CAACtB,IAAI,CAAC;IAC1C;EACJ,CAAC;EAEMQ,QAAQ,GAAIR,IAA2B,IAAKA,IAAI,IAAI,IAAI,CAACpB,MAAM;AAC1E","ignoreList":[]}
|
@@ -44,7 +44,7 @@ export class UnistylesBridgeWeb {
|
|
44
44
|
this.setupListeners();
|
45
45
|
this.#screenWidth = window.innerWidth;
|
46
46
|
this.#screenHeight = window.innerHeight;
|
47
|
-
this.#rtl =
|
47
|
+
this.#rtl = document.documentElement.dir === 'rtl';
|
48
48
|
}
|
49
49
|
}
|
50
50
|
install() {
|
@@ -203,6 +203,12 @@ export class UnistylesBridgeWeb {
|
|
203
203
|
this.emitThemeChange();
|
204
204
|
}
|
205
205
|
});
|
206
|
+
new MutationObserver(() => {
|
207
|
+
this.#rtl = document.documentElement.dir === 'rtl';
|
208
|
+
}).observe(document.documentElement, {
|
209
|
+
attributes: true,
|
210
|
+
attributeFilter: ['dir']
|
211
|
+
});
|
206
212
|
}
|
207
213
|
getBreakpointFromScreenWidth(width) {
|
208
214
|
const breakpoint = this.#sortedBreakpointPairs.find(([, value], index, otherBreakpoints) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["NativeEventEmitter","NativeModules","normalizeWebStylesPlugin","isServer","UnistylesBridgeWeb","timerRef","undefined","windowResizeDebounceTimeMs","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","setHidden","navigationBar","pixelRatio","fontScale","hairlineWidth","rtl","constructor","setupListeners","
|
1
|
+
{"version":3,"names":["NativeEventEmitter","NativeModules","normalizeWebStylesPlugin","isServer","UnistylesBridgeWeb","timerRef","undefined","windowResizeDebounceTimeMs","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","setHidden","navigationBar","pixelRatio","fontScale","hairlineWidth","rtl","constructor","setupListeners","document","documentElement","dir","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","MutationObserver","observe","attributes","attributeFilter","find","value","index","otherBreakpoints","minVal","maxVal","body","style","backgroundColor","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;AACr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EAAE,IAAI,CAAC,CAACA;MACrB;IACJ,CAAC,CAAC;EACN;EAEQmE,gBAAgBA,CAAA,EAAG;IACvB,IAAI,CAAC,CAAChE,eAAe,CAACoF,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAE;QACLnF,UAAU,EAAE,IAAI,CAAC,CAACA,UAAU;QAC5BoF,WAAW,EAAG,IAAI,CAAC,CAACnG,WAAW,GAAe,IAAI,CAAC,CAACG,YAAuB,GACrE,WAAW,GACX,UAAU;QAChBiG,MAAM,EAAE;UACJ5E,KAAK,EAAE,IAAI,CAAC,CAACxB,WAAW;UACxBuB,MAAM,EAAE,IAAI,CAAC,CAACpB;QAClB;MACJ;IACJ,CAAC,CAAC;EACN;AACJ;AAEA,OAAO,MAAMkG,eAAe,GAAG,IAAI3G,kBAAkB,CAAC,CAAC","ignoreList":[]}
|
@@ -19,7 +19,13 @@ export const parseStyle = (style, variant = {}, parseMediaQueries = true) => Obj
|
|
19
19
|
|
20
20
|
// transforms
|
21
21
|
if (key === 'transform' && Array.isArray(value)) {
|
22
|
-
acc[key] = value.map(value => parseStyle(value, variant))
|
22
|
+
acc[key] = value.map(value => parseStyle(value, variant)).filter(value => {
|
23
|
+
// remove undefined values
|
24
|
+
if (typeof value === 'object') {
|
25
|
+
return Object.values(value).at(0) !== undefined;
|
26
|
+
}
|
27
|
+
return true;
|
28
|
+
});
|
23
29
|
return acc;
|
24
30
|
}
|
25
31
|
if (key === 'fontVariant' && Array.isArray(value)) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["getValueForBreakpoint","isAndroid","isIOS","withPlugins","proxifyFunction","key","fn","variant","Proxy","apply","target","thisArg","argumentsList","parseStyle","isPlatformColor","value","semantic","resource_paths","style","parseMediaQueries","Object","entries","reduce","acc","Array","isArray","map","keys","toString","default"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,eAAe;AACrD,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IOS","withPlugins","proxifyFunction","key","fn","variant","Proxy","apply","target","thisArg","argumentsList","parseStyle","isPlatformColor","value","semantic","resource_paths","style","parseMediaQueries","Object","entries","reduce","acc","Array","isArray","map","filter","values","at","undefined","keys","toString","default"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,eAAe;AACrD,SAASC,SAAS,EAAEC,KAAK,QAAQ,WAAW;AAC5C,SAASC,WAAW,QAAQ,eAAe;AAE3C,OAAO,MAAMC,eAAe,GAAGA,CAC3BC,GAAW,EACXC,EAAY,EACZC,OAA0C,KAC/B,IAAIC,KAAK,CAACF,EAAE,EAAE;EACzBG,KAAK,EAAEA,CAACC,MAAM,EAAEC,OAAO,EAAEC,aAAa,KAAKT,WAAW,CAACE,GAAG,EAAEQ,UAAU,CAACH,MAAM,CAACD,KAAK,CAACE,OAAO,EAAEC,aAAa,CAAC,EAAEL,OAAO,CAAC;AACzH,CAAC,CAAC;AAEF,OAAO,MAAMO,eAAe,GAAkBC,KAAQ,IAAc;EAChE,IAAIb,KAAK,EAAE;IACP,OAAO,UAAU,IAAIa,KAAK,IAAI,OAAOA,KAAK,CAACC,QAAQ,KAAK,QAAQ;EACpE;EAEA,OAAOf,SAAS,IAAI,gBAAgB,IAAIc,KAAK,IAAI,OAAOA,KAAK,CAACE,cAAc,KAAK,QAAQ;AAC7F,CAAC;AAED,OAAO,MAAMJ,UAAU,GAAGA,CACtBK,KAAQ,EACRX,OAAyC,GAAG,CAAC,CAAC,EAC9CY,iBAAiB,GAAG,IAAI,KACpBC,MAAM,CACTC,OAAO,CAACH,KAAK,IAAI,CAAC,CAAC,CAAC,CACpBI,MAAM,CAAC,CAACC,GAAG,EAAE,CAAClB,GAAG,EAAEU,KAAK,CAAC,KAAK;EAC3B;EACA,IAAIV,GAAG,KAAK,cAAc,IAAIA,GAAG,KAAM,kBAAkB,EAAE;IACvDkB,GAAG,CAAClB,GAAG,CAAC,GAAGQ,UAAU,CAACE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AAC;IACd,CAAC;EACL;;EAEA;EACA,IAAI,CAACd,iBAAiB,EAAE;IACpB,OAAO;MACH,GAAGI,GAAG;MACN,CAAClB,GAAG,GAAGU;IACX,CAAC;EACL;EAEA,OAAO;IACH,GAAGQ,GAAG;IACN,CAAClB,GAAG,GAAGL,qBAAqB,CAACe,KAAgC;EACjE,CAAC;AACL,CAAC,EAAE,CAAC,CAAM,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UnistyleRegistry.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistyleRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AACjF,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAItE,qBAAa,gBAAgB;IAUb,OAAO,CAAC,eAAe;IAT5B,MAAM,EAAE,eAAe,CAAK;IAC5B,OAAO,EAAE,KAAK,CAAC,eAAe,CAAC,CAE9B;IACD,UAAU,EAAE,KAAK,CAAC,MAAM,eAAe,CAAC,CAAK;IAC7C,MAAM,EAAE,eAAe,CAAwB;IAC/C,WAAW,EAAE,oBAAoB,CAA6B;IAC9D,qBAAqB,EAAE,KAAK,CAAC,CAAC,MAAM,oBAAoB,EAAE,oBAAoB,CAAC,MAAM,oBAAoB,CAAC,CAAC,CAAC,CAAK;gBAEpG,eAAe,EAAE,eAAe;IAE7C,SAAS,WAAY,eAAe;sCAcL,oBAAoB;;gCAW9B,eAAe;;;;;4BAAf,eAAe;;;;MAb1C;IAEM,cAAc,gBAAiB,oBAAoB;4BAd9B,eAAe;;gCAyBf,eAAe;;;;;4BAAf,eAAe;;;;MAF1C;IAEM,SAAS,WAAY,eAAe;sCAXL,oBAAoB;gCAd9B,eAAe;;;;;;4BAAf,eAAe;;;;
|
1
|
+
{"version":3,"file":"UnistyleRegistry.d.ts","sourceRoot":"","sources":["../../../../src/core/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AKhB,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;
|
1
|
+
{"version":3,"file":"UnistylesModule.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.ts"],"names":[],"mappings":"AAMA,qBAAa,kBAAkB;;;IAgDpB,OAAO;IAyFd,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;IAyCtB,OAAO,CAAC,4BAA4B;IAgBpC,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,0BAA0B;IAIlC,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,gBAAgB;CAe3B;AAED,eAAO,MAAM,eAAe,oBAA2B,CAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { mq } from './utils';
|
2
2
|
import { useInitialTheme } from './hooks';
|
3
|
-
import type { UnistylesPlugin, UnistylesValues, UnistyleText, UnistyleView, UnistyleImage, ExtractVariantNames } from './types';
|
3
|
+
import type { UnistylesPlugin, UnistylesValues, UnistyleText, UnistyleView, UnistyleImage, ExtractVariantNames, UnistylesTheme } from './types';
|
4
4
|
import type { UnistylesThemes, UnistylesBreakpoints } from './global';
|
5
5
|
import { ScreenOrientation, AndroidContentSizeCategory, IOSContentSizeCategory } from './common';
|
6
6
|
import { useStyles } from './useStyles';
|
@@ -73,5 +73,5 @@ declare const UnistylesRegistry: {
|
|
73
73
|
};
|
74
74
|
declare const UnistylesRuntime: import("./core").UnistylesRuntime;
|
75
75
|
export { mq, useStyles, useInitialTheme, createStyleSheet, ScreenOrientation, AndroidContentSizeCategory, IOSContentSizeCategory, UnistylesRegistry, UnistylesRuntime };
|
76
|
-
export type { UnistylesThemes, UnistylesBreakpoints, UnistylesPlugin, UnistylesValues, UnistyleText, UnistyleView, UnistyleImage, ExtractVariantNames as UnistylesVariants };
|
76
|
+
export type { UnistylesTheme, UnistylesThemes, UnistylesBreakpoints, UnistylesPlugin, UnistylesValues, UnistyleText, UnistyleView, UnistyleImage, ExtractVariantNames as UnistylesVariants };
|
77
77
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAC/
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC/I,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD;;;GAGG;AACH,QAAA,MAAM,iBAAiB;IACnB;;;OAGG;;;;;;;;;;;;;;;;;IAEH;;;OAGG;;;;;;;;;;;;;;;;;IAEH;;;OAGG;;;;;;;;;;;;;;;;;CAEN,CAAA;AAED,QAAA,MAAM,gBAAgB,mCAAoB,CAAA;AAE1C,OAAO,EACH,EAAE,EACF,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EACnB,CAAA;AAED,YAAY,EACR,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,mBAAmB,IAAI,iBAAiB,EAC3C,CAAA"}
|
@@ -27,6 +27,7 @@ export type UnistylesConfig = {
|
|
27
27
|
plugins?: Array<UnistylesPlugin>;
|
28
28
|
experimentalCSSMediaQueries?: boolean;
|
29
29
|
windowResizeDebounceTimeMs?: number;
|
30
|
+
disableAnimatedInsets?: boolean;
|
30
31
|
};
|
31
32
|
export type UnistylesBridge = {
|
32
33
|
screenWidth: number;
|
@@ -54,6 +55,7 @@ export type UnistylesBridge = {
|
|
54
55
|
setRootViewBackgroundColor(color?: string, alpha?: number): void;
|
55
56
|
setImmersiveMode(isEnabled: boolean): void;
|
56
57
|
setWindowResizeDebounceTimeMs(timeMs: number): void;
|
58
|
+
disableAnimatedInsets(): void;
|
57
59
|
};
|
58
60
|
export type UnistylesThemeEvent = {
|
59
61
|
type: UnistylesEventType.Theme;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"unistyles.d.ts","sourceRoot":"","sources":["../../../../src/types/unistyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAA;AACrH,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACtE,OAAO,KAAK,EAAE,UAA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;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B,IAAI,EAAE,kBAAkB,CAAC,KAAK,CAAC;IAC/B,OAAO,EAAE;QACL,SAAS,EAAE,MAAM,eAAe,CAAA;KACnC,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACrC,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC;IAChC,OAAO,EAAE;QACL,MAAM,EAAE,UAAU,CAAC;QACnB,SAAS,EAAE,gBAAgB,CAAC;QAC5B,aAAa,EAAE,gBAAgB,CAAC;QAChC,MAAM,EAAE,YAAY,CAAC;QACrB,UAAU,EAAE,MAAM,oBAAoB,CAAC;QACvC,WAAW,EAAE,OAAO,iBAAiB,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAA;KACxE,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IAC/B,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAA;CAClC,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,0BAA0B,GAAG,oBAAoB,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/utils/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAW,MAAM,UAAU,CAAA;AAK1D,eAAO,MAAM,eAAe,QACnB,MAAM,MACP,QAAQ,YACF,OAAO,MAAM,EAAE,SAAS,MAAM,CAAC,CAAC,KAC3C,QAED,CAAA;AAEF,eAAO,MAAM,eAAe,8BAA6B,OAMxD,CAAA;AAED,eAAO,MAAM,UAAU,0CAEV,OAAO,MAAM,EAAE,SAAS,MAAM,CAAC,CAAC,
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/utils/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAW,MAAM,UAAU,CAAA;AAK1D,eAAO,MAAM,eAAe,QACnB,MAAM,MACP,QAAQ,YACF,OAAO,MAAM,EAAE,SAAS,MAAM,CAAC,CAAC,KAC3C,QAED,CAAA;AAEF,eAAO,MAAM,eAAe,8BAA6B,OAMxD,CAAA;AAED,eAAO,MAAM,UAAU,0CAEV,OAAO,MAAM,EAAE,SAAS,MAAM,CAAC,CAAC,mCAkE9B,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { UnistylesBridge, UnistylesConfig, UnistylesPlugin } from '../types'
|
2
2
|
import type { UnistylesBreakpoints, UnistylesThemes } from '../global'
|
3
|
-
import { isDev, isWeb, UnistylesError } from '../common'
|
3
|
+
import { isAndroid, isDev, isWeb, UnistylesError } from '../common'
|
4
4
|
import { cssMediaQueriesPlugin, normalizeWebStylesPlugin } from '../plugins'
|
5
5
|
|
6
6
|
export class UnistyleRegistry {
|
@@ -64,6 +64,10 @@ export class UnistyleRegistry {
|
|
64
64
|
this.unistylesBridge.setWindowResizeDebounceTimeMs(config.windowResizeDebounceTimeMs)
|
65
65
|
}
|
66
66
|
|
67
|
+
if (isAndroid && config.disableAnimatedInsets) {
|
68
|
+
this.unistylesBridge.disableAnimatedInsets()
|
69
|
+
}
|
70
|
+
|
67
71
|
return {
|
68
72
|
addBreakpoints: this.addBreakpoints,
|
69
73
|
addThemes: this.addThemes
|
@@ -48,7 +48,7 @@ export class UnistylesBridgeWeb {
|
|
48
48
|
this.setupListeners()
|
49
49
|
this.#screenWidth = window.innerWidth
|
50
50
|
this.#screenHeight = window.innerHeight
|
51
|
-
this.#rtl =
|
51
|
+
this.#rtl = document.documentElement.dir === 'rtl'
|
52
52
|
}
|
53
53
|
}
|
54
54
|
|
@@ -233,6 +233,13 @@ export class UnistylesBridgeWeb {
|
|
233
233
|
this.emitThemeChange()
|
234
234
|
}
|
235
235
|
})
|
236
|
+
|
237
|
+
new MutationObserver(() => {
|
238
|
+
this.#rtl = document.documentElement.dir === 'rtl'
|
239
|
+
}).observe(document.documentElement, {
|
240
|
+
attributes: true,
|
241
|
+
attributeFilter: ['dir']
|
242
|
+
})
|
236
243
|
}
|
237
244
|
|
238
245
|
private getBreakpointFromScreenWidth(width: number): keyof UnistylesBreakpoints {
|
package/src/index.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { unistyles } from './core'
|
2
2
|
import { mq } from './utils'
|
3
3
|
import { useInitialTheme } from './hooks'
|
4
|
-
import type { UnistylesPlugin, UnistylesValues, UnistyleText, UnistyleView, UnistyleImage, ExtractVariantNames } from './types'
|
4
|
+
import type { UnistylesPlugin, UnistylesValues, UnistyleText, UnistyleView, UnistyleImage, ExtractVariantNames, UnistylesTheme } from './types'
|
5
5
|
import type { UnistylesThemes, UnistylesBreakpoints } from './global'
|
6
6
|
import { ScreenOrientation, AndroidContentSizeCategory, IOSContentSizeCategory } from './common'
|
7
7
|
import { useStyles } from './useStyles'
|
@@ -44,6 +44,7 @@ export {
|
|
44
44
|
}
|
45
45
|
|
46
46
|
export type {
|
47
|
+
UnistylesTheme,
|
47
48
|
UnistylesThemes,
|
48
49
|
UnistylesBreakpoints,
|
49
50
|
UnistylesPlugin,
|
package/src/types/unistyles.ts
CHANGED
@@ -32,7 +32,8 @@ export type UnistylesConfig = {
|
|
32
32
|
initialTheme?: keyof UnistylesThemes,
|
33
33
|
plugins?: Array<UnistylesPlugin>,
|
34
34
|
experimentalCSSMediaQueries?: boolean,
|
35
|
-
windowResizeDebounceTimeMs?: number
|
35
|
+
windowResizeDebounceTimeMs?: number,
|
36
|
+
disableAnimatedInsets?: boolean
|
36
37
|
}
|
37
38
|
|
38
39
|
export type UnistylesBridge = {
|
@@ -66,6 +67,9 @@ export type UnistylesBridge = {
|
|
66
67
|
|
67
68
|
// web only
|
68
69
|
setWindowResizeDebounceTimeMs(timeMs: number): void
|
70
|
+
|
71
|
+
// android only
|
72
|
+
disableAnimatedInsets(): void
|
69
73
|
}
|
70
74
|
|
71
75
|
export type UnistylesThemeEvent = {
|
package/src/utils/styles.ts
CHANGED
@@ -35,7 +35,16 @@ export const parseStyle = <T extends RNStyle>(
|
|
35
35
|
|
36
36
|
// transforms
|
37
37
|
if (key === 'transform' && Array.isArray(value)) {
|
38
|
-
acc[key] = value
|
38
|
+
acc[key] = value
|
39
|
+
.map(value => parseStyle(value, variant))
|
40
|
+
.filter(value => {
|
41
|
+
// remove undefined values
|
42
|
+
if (typeof value === 'object') {
|
43
|
+
return Object.values(value).at(0) !== undefined
|
44
|
+
}
|
45
|
+
|
46
|
+
return true
|
47
|
+
})
|
39
48
|
|
40
49
|
return acc
|
41
50
|
}
|