react-native-unistyles 3.0.24 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/cxx/NativeUnistylesModule.cpp +7 -4
- package/android/src/main/cxx/NativeUnistylesModule.h +9 -3
- package/android/src/main/cxx/cpp-adapter.cpp +1 -1
- package/android/src/main/java/com/unistyles/NativePlatform+android.kt +22 -4
- package/android/src/main/java/com/unistyles/UnistylesModule.kt +1 -0
- package/cxx/core/StyleSheetRegistry.cpp +11 -11
- package/cxx/core/StyleSheetRegistry.h +4 -4
- package/cxx/core/UnistylesRegistry.cpp +27 -14
- package/cxx/core/UnistylesRegistry.h +4 -1
- package/cxx/hybridObjects/HybridShadowRegistry.cpp +5 -0
- package/cxx/hybridObjects/HybridStyleSheet.cpp +2 -14
- package/cxx/hybridObjects/HybridStyleSheet.h +0 -2
- package/ios/UnistylesModuleOnLoad.mm +10 -2
- package/lib/commonjs/components/AdaptiveTheme.js +1 -1
- package/lib/commonjs/components/AdaptiveTheme.js.map +1 -1
- package/lib/commonjs/components/ApplyScopedTheme.js.map +1 -1
- package/lib/commonjs/components/Display.js.map +1 -1
- package/lib/commonjs/components/Hide.js.map +1 -1
- package/lib/commonjs/components/NamedTheme.js +2 -2
- package/lib/commonjs/components/NamedTheme.js.map +1 -1
- package/lib/commonjs/components/ScopedTheme.js.map +1 -1
- package/lib/commonjs/components/native/ActivityIndicator.js.map +1 -1
- package/lib/commonjs/components/native/Animated.js.map +1 -1
- package/lib/commonjs/components/native/FlatList.js.map +1 -1
- package/lib/commonjs/components/native/Image.js.map +1 -1
- package/lib/commonjs/components/native/Image.native.js.map +1 -1
- package/lib/commonjs/components/native/ImageBackground.js.map +1 -1
- package/lib/commonjs/components/native/ImageBackground.native.js.map +1 -1
- package/lib/commonjs/components/native/KeyboardAvoidingView.js.map +1 -1
- package/lib/commonjs/components/native/NativeText.native.js.map +1 -1
- package/lib/commonjs/components/native/NativeView.native.js.map +1 -1
- package/lib/commonjs/components/native/Pressable.js.map +1 -1
- package/lib/commonjs/components/native/Pressable.native.js.map +1 -1
- package/lib/commonjs/components/native/RefreshControl.js.map +1 -1
- package/lib/commonjs/components/native/SafeAreaView.js.map +1 -1
- package/lib/commonjs/components/native/ScrollView.js.map +1 -1
- package/lib/commonjs/components/native/SectionList.js.map +1 -1
- package/lib/commonjs/components/native/Switch.js.map +1 -1
- package/lib/commonjs/components/native/Text.js.map +1 -1
- package/lib/commonjs/components/native/TextInput.js.map +1 -1
- package/lib/commonjs/components/native/TouchableHighlight.js.map +1 -1
- package/lib/commonjs/components/native/TouchableOpacity.js.map +1 -1
- package/lib/commonjs/components/native/View.js.map +1 -1
- package/lib/commonjs/components/native/VirtualizedList.js.map +1 -1
- package/lib/commonjs/core/createUnistylesElement.js.map +1 -1
- package/lib/commonjs/core/createUnistylesElement.native.js.map +1 -1
- package/lib/commonjs/core/createUnistylesImageBackground.js.map +1 -1
- package/lib/commonjs/core/getClassname.js.map +1 -1
- package/lib/commonjs/core/parseBoxShadow.js.map +1 -1
- package/lib/commonjs/core/useProxifiedUnistyles/listener.js.map +1 -1
- package/lib/commonjs/core/useProxifiedUnistyles/listener.native.js +0 -1
- package/lib/commonjs/core/useProxifiedUnistyles/listener.native.js.map +1 -1
- package/lib/commonjs/core/useProxifiedUnistyles/useProxifiedUnistyles.js.map +1 -1
- package/lib/commonjs/core/useUnistyles.js.map +1 -1
- package/lib/commonjs/core/warn.js.map +1 -1
- package/lib/commonjs/core/withUnistyles/withUnistyles.js +3 -1
- package/lib/commonjs/core/withUnistyles/withUnistyles.js.map +1 -1
- package/lib/commonjs/core/withUnistyles/withUnistyles.native.js +6 -0
- package/lib/commonjs/core/withUnistyles/withUnistyles.native.js.map +1 -1
- package/lib/commonjs/hooks/useMedia.js.map +1 -1
- package/lib/commonjs/hooks/useMedia.native.js +0 -1
- package/lib/commonjs/hooks/useMedia.native.js.map +1 -1
- package/lib/commonjs/index.js +6 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mocks.js +28 -8
- package/lib/commonjs/mocks.js.map +1 -1
- package/lib/commonjs/mq.js.map +1 -1
- package/lib/commonjs/reanimated/useAnimatedTheme.js.map +1 -1
- package/lib/commonjs/reanimated/useAnimatedTheme.native.js +0 -1
- package/lib/commonjs/reanimated/useAnimatedTheme.native.js.map +1 -1
- package/lib/commonjs/reanimated/variant/useAnimatedVariantColor.js.map +1 -1
- package/lib/commonjs/reanimated/variant/useUpdateVariantColor.js.map +1 -1
- package/lib/commonjs/reanimated/variant/useUpdateVariantColor.native.js +0 -1
- package/lib/commonjs/reanimated/variant/useUpdateVariantColor.native.js.map +1 -1
- package/lib/commonjs/server/getServerUnistyles.js.map +1 -1
- package/lib/commonjs/server/useServerUnistyles.js.map +1 -1
- package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js.map +1 -1
- package/lib/commonjs/specs/ShadowRegistry/index.js +9 -5
- package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/commonjs/specs/StatusBar/index.js.map +1 -1
- package/lib/commonjs/specs/StyleSheet/index.js.map +1 -1
- package/lib/commonjs/specs/TurboUnistyles/NativeTurboUnistyles.js.map +1 -1
- package/lib/commonjs/specs/UnistylesRuntime/index.js.map +1 -1
- package/lib/commonjs/specs/index.native.js +1 -1
- package/lib/commonjs/specs/index.native.js.map +1 -1
- package/lib/commonjs/specs/types.js.map +1 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/types/stylesheet.js.map +1 -1
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/convert/index.js.map +1 -1
- package/lib/commonjs/web/convert/object/boxShadow.js.map +1 -1
- package/lib/commonjs/web/convert/object/filter.js.map +1 -1
- package/lib/commonjs/web/convert/object/objectStyle.js.map +1 -1
- package/lib/commonjs/web/convert/object/transform.js.map +1 -1
- package/lib/commonjs/web/convert/pseudo.js.map +1 -1
- package/lib/commonjs/web/convert/shadow/boxShadow.js.map +1 -1
- package/lib/commonjs/web/convert/shadow/getShadowBreakpoints.js.map +1 -1
- package/lib/commonjs/web/convert/shadow/textShadow.js.map +1 -1
- package/lib/commonjs/web/convert/types.js.map +1 -1
- package/lib/commonjs/web/convert/utils.js.map +1 -1
- package/lib/commonjs/web/create.js +1 -5
- package/lib/commonjs/web/create.js.map +1 -1
- package/lib/commonjs/web/css/core.js.map +1 -1
- package/lib/commonjs/web/css/state.js.map +1 -1
- package/lib/commonjs/web/css/utils.js.map +1 -1
- package/lib/commonjs/web/index.js +1 -0
- package/lib/commonjs/web/index.js.map +1 -1
- package/lib/commonjs/web/listener.js +29 -8
- package/lib/commonjs/web/listener.js.map +1 -1
- package/lib/commonjs/web/registry.js.map +1 -1
- package/lib/commonjs/web/runtime.js +1 -2
- package/lib/commonjs/web/runtime.js.map +1 -1
- package/lib/commonjs/web/shadowRegistry.js.map +1 -1
- package/lib/commonjs/web/state.js +3 -3
- package/lib/commonjs/web/state.js.map +1 -1
- package/lib/commonjs/web/utils/common.js.map +1 -1
- package/lib/commonjs/web/utils/createUnistylesRef.js.map +1 -1
- package/lib/commonjs/web/utils/unistyle.js +2 -0
- package/lib/commonjs/web/utils/unistyle.js.map +1 -1
- package/lib/commonjs/web/variants.js.map +1 -1
- package/lib/commonjs/web-only/getWebProps.js.map +1 -1
- package/lib/commonjs/web-only/index.js.map +1 -1
- package/lib/module/components/AdaptiveTheme.js +1 -1
- package/lib/module/components/AdaptiveTheme.js.map +1 -1
- package/lib/module/components/ApplyScopedTheme.js.map +1 -1
- package/lib/module/components/Display.js.map +1 -1
- package/lib/module/components/Hide.js.map +1 -1
- package/lib/module/components/NamedTheme.js +2 -2
- package/lib/module/components/NamedTheme.js.map +1 -1
- package/lib/module/components/ScopedTheme.js.map +1 -1
- package/lib/module/components/native/ActivityIndicator.js.map +1 -1
- package/lib/module/components/native/Animated.js.map +1 -1
- package/lib/module/components/native/FlatList.js.map +1 -1
- package/lib/module/components/native/Image.js.map +1 -1
- package/lib/module/components/native/Image.native.js.map +1 -1
- package/lib/module/components/native/ImageBackground.js.map +1 -1
- package/lib/module/components/native/ImageBackground.native.js.map +1 -1
- package/lib/module/components/native/KeyboardAvoidingView.js.map +1 -1
- package/lib/module/components/native/NativeText.native.js.map +1 -1
- package/lib/module/components/native/NativeView.native.js.map +1 -1
- package/lib/module/components/native/Pressable.js.map +1 -1
- package/lib/module/components/native/Pressable.native.js.map +1 -1
- package/lib/module/components/native/RefreshControl.js.map +1 -1
- package/lib/module/components/native/SafeAreaView.js.map +1 -1
- package/lib/module/components/native/ScrollView.js.map +1 -1
- package/lib/module/components/native/SectionList.js.map +1 -1
- package/lib/module/components/native/Switch.js.map +1 -1
- package/lib/module/components/native/Text.js.map +1 -1
- package/lib/module/components/native/TextInput.js.map +1 -1
- package/lib/module/components/native/TouchableHighlight.js.map +1 -1
- package/lib/module/components/native/TouchableOpacity.js.map +1 -1
- package/lib/module/components/native/View.js.map +1 -1
- package/lib/module/components/native/VirtualizedList.js.map +1 -1
- package/lib/module/core/createUnistylesElement.js.map +1 -1
- package/lib/module/core/createUnistylesElement.native.js.map +1 -1
- package/lib/module/core/createUnistylesImageBackground.js.map +1 -1
- package/lib/module/core/getClassname.js.map +1 -1
- package/lib/module/core/parseBoxShadow.js.map +1 -1
- package/lib/module/core/useProxifiedUnistyles/listener.js.map +1 -1
- package/lib/module/core/useProxifiedUnistyles/listener.native.js +0 -1
- package/lib/module/core/useProxifiedUnistyles/listener.native.js.map +1 -1
- package/lib/module/core/useProxifiedUnistyles/useProxifiedUnistyles.js.map +1 -1
- package/lib/module/core/useUnistyles.js.map +1 -1
- package/lib/module/core/warn.js.map +1 -1
- package/lib/module/core/withUnistyles/withUnistyles.js +3 -1
- package/lib/module/core/withUnistyles/withUnistyles.js.map +1 -1
- package/lib/module/core/withUnistyles/withUnistyles.native.js +6 -0
- package/lib/module/core/withUnistyles/withUnistyles.native.js.map +1 -1
- package/lib/module/hooks/useMedia.js.map +1 -1
- package/lib/module/hooks/useMedia.native.js +0 -1
- package/lib/module/hooks/useMedia.native.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/mocks.js +28 -8
- package/lib/module/mocks.js.map +1 -1
- package/lib/module/mq.js.map +1 -1
- package/lib/module/reanimated/useAnimatedTheme.js.map +1 -1
- package/lib/module/reanimated/useAnimatedTheme.native.js +0 -1
- package/lib/module/reanimated/useAnimatedTheme.native.js.map +1 -1
- package/lib/module/reanimated/variant/useAnimatedVariantColor.js.map +1 -1
- package/lib/module/reanimated/variant/useUpdateVariantColor.js.map +1 -1
- package/lib/module/reanimated/variant/useUpdateVariantColor.native.js +0 -1
- package/lib/module/reanimated/variant/useUpdateVariantColor.native.js.map +1 -1
- package/lib/module/server/getServerUnistyles.js.map +1 -1
- package/lib/module/server/useServerUnistyles.js.map +1 -1
- package/lib/module/specs/NativePlatform/NativePlatform.nitro.js.map +1 -1
- package/lib/module/specs/ShadowRegistry/index.js +9 -5
- package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/module/specs/StatusBar/index.js.map +1 -1
- package/lib/module/specs/StyleSheet/index.js.map +1 -1
- package/lib/module/specs/TurboUnistyles/NativeTurboUnistyles.js.map +1 -1
- package/lib/module/specs/UnistylesRuntime/index.js.map +1 -1
- package/lib/module/specs/index.native.js +1 -1
- package/lib/module/specs/index.native.js.map +1 -1
- package/lib/module/specs/types.js.map +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/types/stylesheet.js.map +1 -1
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/convert/index.js.map +1 -1
- package/lib/module/web/convert/object/boxShadow.js.map +1 -1
- package/lib/module/web/convert/object/filter.js.map +1 -1
- package/lib/module/web/convert/object/objectStyle.js.map +1 -1
- package/lib/module/web/convert/object/transform.js.map +1 -1
- package/lib/module/web/convert/pseudo.js.map +1 -1
- package/lib/module/web/convert/shadow/boxShadow.js.map +1 -1
- package/lib/module/web/convert/shadow/getShadowBreakpoints.js.map +1 -1
- package/lib/module/web/convert/shadow/textShadow.js.map +1 -1
- package/lib/module/web/convert/types.js.map +1 -1
- package/lib/module/web/convert/utils.js.map +1 -1
- package/lib/module/web/create.js +2 -6
- package/lib/module/web/create.js.map +1 -1
- package/lib/module/web/css/core.js.map +1 -1
- package/lib/module/web/css/state.js.map +1 -1
- package/lib/module/web/css/utils.js.map +1 -1
- package/lib/module/web/index.js +1 -0
- package/lib/module/web/index.js.map +1 -1
- package/lib/module/web/listener.js +29 -8
- package/lib/module/web/listener.js.map +1 -1
- package/lib/module/web/registry.js.map +1 -1
- package/lib/module/web/runtime.js +1 -2
- package/lib/module/web/runtime.js.map +1 -1
- package/lib/module/web/shadowRegistry.js.map +1 -1
- package/lib/module/web/state.js +3 -3
- package/lib/module/web/state.js.map +1 -1
- package/lib/module/web/utils/common.js.map +1 -1
- package/lib/module/web/utils/createUnistylesRef.js.map +1 -1
- package/lib/module/web/utils/unistyle.js +2 -0
- package/lib/module/web/utils/unistyle.js.map +1 -1
- package/lib/module/web/variants.js.map +1 -1
- package/lib/module/web-only/getWebProps.js.map +1 -1
- package/lib/module/web-only/index.js.map +1 -1
- package/lib/typescript/src/__tests__/mocks.spec.d.ts +2 -0
- package/lib/typescript/src/__tests__/mocks.spec.d.ts.map +1 -0
- package/lib/typescript/src/__tests__/web-listener.spec.d.ts +2 -0
- package/lib/typescript/src/__tests__/web-listener.spec.d.ts.map +1 -0
- package/lib/typescript/src/components/AdaptiveTheme.d.ts +1 -1
- package/lib/typescript/src/components/AdaptiveTheme.d.ts.map +1 -1
- package/lib/typescript/src/components/ApplyScopedTheme.d.ts.map +1 -1
- package/lib/typescript/src/components/Display.d.ts.map +1 -1
- package/lib/typescript/src/components/Hide.d.ts.map +1 -1
- package/lib/typescript/src/components/NamedTheme.d.ts +1 -1
- package/lib/typescript/src/components/NamedTheme.d.ts.map +1 -1
- package/lib/typescript/src/components/ScopedTheme.d.ts.map +1 -1
- package/lib/typescript/src/components/native/ActivityIndicator.d.ts.map +1 -1
- package/lib/typescript/src/components/native/Animated.d.ts.map +1 -1
- package/lib/typescript/src/components/native/FlatList.d.ts.map +1 -1
- package/lib/typescript/src/components/native/Image.d.ts.map +1 -1
- package/lib/typescript/src/components/native/Image.native.d.ts.map +1 -1
- package/lib/typescript/src/components/native/ImageBackground.d.ts.map +1 -1
- package/lib/typescript/src/components/native/ImageBackground.native.d.ts.map +1 -1
- package/lib/typescript/src/components/native/KeyboardAvoidingView.d.ts.map +1 -1
- package/lib/typescript/src/components/native/NativeText.native.d.ts.map +1 -1
- package/lib/typescript/src/components/native/NativeView.native.d.ts.map +1 -1
- package/lib/typescript/src/components/native/Pressable.d.ts +1 -1
- package/lib/typescript/src/components/native/Pressable.d.ts.map +1 -1
- package/lib/typescript/src/components/native/Pressable.native.d.ts +1 -1
- package/lib/typescript/src/components/native/Pressable.native.d.ts.map +1 -1
- package/lib/typescript/src/components/native/RefreshControl.d.ts.map +1 -1
- package/lib/typescript/src/components/native/SafeAreaView.d.ts.map +1 -1
- package/lib/typescript/src/components/native/ScrollView.d.ts.map +1 -1
- package/lib/typescript/src/components/native/SectionList.d.ts.map +1 -1
- package/lib/typescript/src/components/native/Switch.d.ts.map +1 -1
- package/lib/typescript/src/components/native/Text.d.ts.map +1 -1
- package/lib/typescript/src/components/native/TextInput.d.ts.map +1 -1
- package/lib/typescript/src/components/native/TouchableHighlight.d.ts.map +1 -1
- package/lib/typescript/src/components/native/TouchableOpacity.d.ts.map +1 -1
- package/lib/typescript/src/components/native/View.d.ts.map +1 -1
- package/lib/typescript/src/components/native/VirtualizedList.d.ts.map +1 -1
- package/lib/typescript/src/core/createUnistylesElement.d.ts.map +1 -1
- package/lib/typescript/src/core/createUnistylesElement.native.d.ts.map +1 -1
- package/lib/typescript/src/core/createUnistylesImageBackground.d.ts.map +1 -1
- package/lib/typescript/src/core/getClassname.d.ts.map +1 -1
- package/lib/typescript/src/core/parseBoxShadow.d.ts.map +1 -1
- package/lib/typescript/src/core/useProxifiedUnistyles/listener.d.ts.map +1 -1
- package/lib/typescript/src/core/useProxifiedUnistyles/listener.native.d.ts +1 -1
- package/lib/typescript/src/core/useProxifiedUnistyles/listener.native.d.ts.map +1 -1
- package/lib/typescript/src/core/useProxifiedUnistyles/types.d.ts.map +1 -1
- package/lib/typescript/src/core/useProxifiedUnistyles/useProxifiedUnistyles.d.ts +1 -1
- package/lib/typescript/src/core/useProxifiedUnistyles/useProxifiedUnistyles.d.ts.map +1 -1
- package/lib/typescript/src/core/useUnistyles.d.ts.map +1 -1
- package/lib/typescript/src/core/withUnistyles/types.d.ts +1 -1
- package/lib/typescript/src/core/withUnistyles/types.d.ts.map +1 -1
- package/lib/typescript/src/core/withUnistyles/withUnistyles.d.ts.map +1 -1
- package/lib/typescript/src/core/withUnistyles/withUnistyles.native.d.ts.map +1 -1
- package/lib/typescript/src/global.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useMedia.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useMedia.native.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mq.d.ts.map +1 -1
- package/lib/typescript/src/reanimated/useAnimatedTheme.d.ts.map +1 -1
- package/lib/typescript/src/reanimated/useAnimatedTheme.native.d.ts.map +1 -1
- package/lib/typescript/src/reanimated/variant/types.d.ts.map +1 -1
- package/lib/typescript/src/reanimated/variant/useAnimatedVariantColor.d.ts.map +1 -1
- package/lib/typescript/src/reanimated/variant/useUpdateVariantColor.d.ts +1 -1
- package/lib/typescript/src/reanimated/variant/useUpdateVariantColor.d.ts.map +1 -1
- package/lib/typescript/src/reanimated/variant/useUpdateVariantColor.native.d.ts +1 -1
- package/lib/typescript/src/reanimated/variant/useUpdateVariantColor.native.d.ts.map +1 -1
- package/lib/typescript/src/server/getServerUnistyles.d.ts +1 -1
- package/lib/typescript/src/server/getServerUnistyles.d.ts.map +1 -1
- package/lib/typescript/src/server/types.d.ts.map +1 -1
- package/lib/typescript/src/server/useServerUnistyles.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/ShadowRegistry/types.d.ts +4 -5
- package/lib/typescript/src/specs/ShadowRegistry/types.d.ts.map +1 -1
- package/lib/typescript/src/specs/StatusBar/UnistylesStatusBar.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/StatusBar/index.d.ts +1 -1
- package/lib/typescript/src/specs/StatusBar/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts +0 -1
- package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/StyleSheet/index.d.ts +3 -3
- package/lib/typescript/src/specs/StyleSheet/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts +1 -1
- package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/index.native.d.ts +4 -4
- package/lib/typescript/src/specs/index.native.d.ts.map +1 -1
- package/lib/typescript/src/specs/types.d.ts.map +1 -1
- package/lib/typescript/src/types/breakpoints.d.ts +2 -2
- package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
- package/lib/typescript/src/types/core.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +1 -1
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/types/stylesheet.d.ts +1 -1
- package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
- package/lib/typescript/src/types/variants.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/index.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/object/boxShadow.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/object/filter.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/object/objectStyle.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/object/transform.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/pseudo.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/types.d.ts +2 -2
- package/lib/typescript/src/web/convert/types.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/utils.d.ts.map +1 -1
- package/lib/typescript/src/web/create.d.ts +1 -1
- package/lib/typescript/src/web/create.d.ts.map +1 -1
- package/lib/typescript/src/web/css/core.d.ts.map +1 -1
- package/lib/typescript/src/web/css/state.d.ts.map +1 -1
- package/lib/typescript/src/web/css/utils.d.ts.map +1 -1
- package/lib/typescript/src/web/index.d.ts.map +1 -1
- package/lib/typescript/src/web/listener.d.ts +5 -1
- package/lib/typescript/src/web/listener.d.ts.map +1 -1
- package/lib/typescript/src/web/registry.d.ts +1 -1
- package/lib/typescript/src/web/registry.d.ts.map +1 -1
- package/lib/typescript/src/web/runtime.d.ts +1 -1
- package/lib/typescript/src/web/runtime.d.ts.map +1 -1
- package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
- package/lib/typescript/src/web/state.d.ts.map +1 -1
- package/lib/typescript/src/web/types.d.ts +1 -1
- package/lib/typescript/src/web/types.d.ts.map +1 -1
- package/lib/typescript/src/web/utils/common.d.ts.map +1 -1
- package/lib/typescript/src/web/utils/createUnistylesRef.d.ts.map +1 -1
- package/lib/typescript/src/web/utils/unistyle.d.ts +1 -1
- package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
- package/lib/typescript/src/web/variants.d.ts.map +1 -1
- package/lib/typescript/src/web-only/getWebProps.d.ts.map +1 -1
- package/lib/typescript/src/web-only/index.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +36 -42
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.hpp +19 -22
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +15 -18
- package/nitrogen/generated/android/unistylesOnLoad.cpp +14 -9
- package/nitrogen/generated/android/unistylesOnLoad.hpp +13 -4
- package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +0 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +0 -1
- package/package.json +43 -44
- package/plugin/index.d.ts +34 -28
- package/plugin/index.js +113 -103
- package/repack-plugin/index.d.ts +2 -2
- package/src/components/AdaptiveTheme.tsx +8 -12
- package/src/components/ApplyScopedTheme.tsx +2 -0
- package/src/components/Display.tsx +2 -3
- package/src/components/Hide.tsx +2 -3
- package/src/components/NamedTheme.tsx +9 -14
- package/src/components/ScopedTheme.tsx +22 -27
- package/src/components/native/ActivityIndicator.tsx +1 -0
- package/src/components/native/Animated.tsx +2 -1
- package/src/components/native/FlatList.tsx +1 -0
- package/src/components/native/Image.native.tsx +1 -0
- package/src/components/native/Image.tsx +11 -7
- package/src/components/native/ImageBackground.native.tsx +1 -0
- package/src/components/native/ImageBackground.tsx +11 -7
- package/src/components/native/KeyboardAvoidingView.tsx +1 -0
- package/src/components/native/NativeText.native.tsx +3 -1
- package/src/components/native/NativeView.native.tsx +3 -1
- package/src/components/native/Pressable.native.tsx +8 -8
- package/src/components/native/Pressable.tsx +25 -20
- package/src/components/native/RefreshControl.tsx +1 -0
- package/src/components/native/SafeAreaView.tsx +1 -0
- package/src/components/native/ScrollView.tsx +1 -0
- package/src/components/native/SectionList.tsx +1 -0
- package/src/components/native/Switch.tsx +1 -0
- package/src/components/native/Text.tsx +1 -0
- package/src/components/native/TextInput.tsx +1 -0
- package/src/components/native/TouchableHighlight.tsx +1 -0
- package/src/components/native/TouchableOpacity.tsx +1 -0
- package/src/components/native/View.tsx +1 -0
- package/src/components/native/VirtualizedList.tsx +1 -0
- package/src/core/createUnistylesElement.native.tsx +4 -2
- package/src/core/createUnistylesElement.tsx +14 -17
- package/src/core/createUnistylesImageBackground.tsx +6 -4
- package/src/core/getClassname.ts +4 -11
- package/src/core/parseBoxShadow.ts +11 -24
- package/src/core/passForwardRef.ts +1 -1
- package/src/core/useProxifiedUnistyles/listener.native.ts +3 -3
- package/src/core/useProxifiedUnistyles/listener.ts +10 -3
- package/src/core/useProxifiedUnistyles/types.ts +2 -2
- package/src/core/useProxifiedUnistyles/useProxifiedUnistyles.ts +13 -9
- package/src/core/useUnistyles.ts +2 -1
- package/src/core/warn.ts +4 -4
- package/src/core/withUnistyles/types.ts +7 -4
- package/src/core/withUnistyles/withUnistyles.native.tsx +53 -44
- package/src/core/withUnistyles/withUnistyles.tsx +30 -24
- package/src/global.ts +2 -2
- package/src/hooks/useMedia.native.ts +2 -2
- package/src/hooks/useMedia.ts +6 -3
- package/src/index.ts +1 -0
- package/src/mocks.ts +74 -49
- package/src/mq.ts +23 -15
- package/src/reanimated/useAnimatedTheme.native.ts +4 -3
- package/src/reanimated/useAnimatedTheme.ts +6 -2
- package/src/reanimated/variant/types.ts +11 -10
- package/src/reanimated/variant/useAnimatedVariantColor.ts +7 -7
- package/src/reanimated/variant/useUpdateVariantColor.native.ts +10 -6
- package/src/reanimated/variant/useUpdateVariantColor.ts +21 -21
- package/src/server/getServerUnistyles.tsx +11 -4
- package/src/server/index.ts +0 -1
- package/src/server/types.ts +1 -1
- package/src/server/useServerUnistyles.tsx +4 -1
- package/src/specs/NativePlatform/NativePlatform.nitro.ts +30 -27
- package/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.ts +3 -3
- package/src/specs/ShadowRegistry/ShadowRegistry.nitro.ts +1 -1
- package/src/specs/ShadowRegistry/index.ts +35 -29
- package/src/specs/ShadowRegistry/types.ts +9 -10
- package/src/specs/StatusBar/UnistylesStatusBar.nitro.ts +4 -4
- package/src/specs/StatusBar/index.ts +5 -5
- package/src/specs/StyleSheet/UnistylesStyleSheet.nitro.ts +2 -2
- package/src/specs/StyleSheet/index.ts +32 -27
- package/src/specs/TurboUnistyles/NativeTurboUnistyles.ts +1 -0
- package/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.ts +26 -25
- package/src/specs/UnistylesRuntime/index.ts +20 -20
- package/src/specs/index.native.ts +6 -18
- package/src/specs/types.ts +9 -8
- package/src/types/accessibility.ts +2 -2
- package/src/types/breakpoints.ts +61 -59
- package/src/types/core.ts +17 -17
- package/src/types/index.ts +2 -9
- package/src/types/stylesheet.ts +27 -19
- package/src/types/variants.ts +3 -11
- package/src/utils.ts +16 -16
- package/src/web/convert/index.ts +6 -2
- package/src/web/convert/object/boxShadow.ts +23 -18
- package/src/web/convert/object/filter.ts +30 -13
- package/src/web/convert/object/objectStyle.ts +33 -23
- package/src/web/convert/object/transform.ts +10 -8
- package/src/web/convert/pseudo.ts +2 -2
- package/src/web/convert/shadow/boxShadow.ts +6 -6
- package/src/web/convert/shadow/getShadowBreakpoints.ts +4 -4
- package/src/web/convert/shadow/textShadow.ts +6 -6
- package/src/web/convert/style.ts +25 -25
- package/src/web/convert/types.ts +4 -3
- package/src/web/convert/utils.ts +20 -10
- package/src/web/create.ts +29 -20
- package/src/web/css/core.ts +2 -1
- package/src/web/css/state.ts +11 -8
- package/src/web/css/utils.ts +2 -1
- package/src/web/index.ts +7 -4
- package/src/web/listener.ts +61 -18
- package/src/web/mock.ts +2 -2
- package/src/web/registry.ts +17 -10
- package/src/web/runtime.ts +23 -17
- package/src/web/shadowRegistry.ts +26 -24
- package/src/web/state.ts +23 -16
- package/src/web/types.ts +5 -5
- package/src/web/utils/common.ts +7 -9
- package/src/web/utils/createUnistylesRef.ts +18 -14
- package/src/web/utils/unistyle.ts +53 -34
- package/src/web/variants.ts +19 -11
- package/src/web-only/getWebProps.ts +5 -6
- package/src/web-only/index.ts +0 -1
- package/LICENSE +0 -20
- package/README.md +0 -178
- package/lib/typescript/plugin/src/consts.d.ts +0 -17
- package/lib/typescript/plugin/src/consts.d.ts.map +0 -1
- package/lib/typescript/repack-plugin/src/index.d.ts +0 -18
- package/lib/typescript/repack-plugin/src/index.d.ts.map +0 -1
- package/lib/typescript/repack-plugin/src/loader.d.ts +0 -9
- package/lib/typescript/repack-plugin/src/loader.d.ts.map +0 -1
|
@@ -1,51 +1,56 @@
|
|
|
1
|
-
import { StyleSheet as NativeStyleSheet, processColor } from 'react-native'
|
|
2
1
|
import type { StyleSheet as NativeStyleSheetType } from 'react-native'
|
|
2
|
+
|
|
3
|
+
import { StyleSheet as NativeStyleSheet, processColor } from 'react-native'
|
|
3
4
|
import { NitroModules } from 'react-native-nitro-modules'
|
|
4
|
-
|
|
5
|
+
|
|
5
6
|
import type { UnistylesBreakpoints, UnistylesThemes } from '../../global'
|
|
6
7
|
import type { CreateUnistylesStyleSheet } from '../../types'
|
|
7
8
|
import type { UnistylesStyleSheet as UnistylesStyleSheetSpec } from './UnistylesStyleSheet.nitro'
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
import { parseBoxShadowString } from '../../core/parseBoxShadow'
|
|
11
|
+
|
|
12
|
+
type UnistylesThemeSettings =
|
|
13
|
+
| {
|
|
14
|
+
initialTheme: (() => keyof UnistylesThemes) | keyof UnistylesThemes
|
|
15
|
+
adaptiveThemes?: never | false
|
|
16
|
+
}
|
|
17
|
+
| {
|
|
18
|
+
adaptiveThemes: boolean
|
|
19
|
+
initialTheme?: never
|
|
20
|
+
}
|
|
21
|
+
| {
|
|
22
|
+
adaptiveThemes?: never
|
|
23
|
+
initialTheme?: never
|
|
24
|
+
}
|
|
19
25
|
|
|
20
26
|
type UnistylesSettings = UnistylesThemeSettings & {
|
|
21
|
-
CSSVars?: boolean
|
|
27
|
+
CSSVars?: boolean
|
|
22
28
|
nativeBreakpointsMode?: 'pixels' | 'points'
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
export type UnistylesConfig = {
|
|
26
|
-
settings?: UnistylesSettings
|
|
27
|
-
themes?: UnistylesThemes
|
|
32
|
+
settings?: UnistylesSettings
|
|
33
|
+
themes?: UnistylesThemes
|
|
28
34
|
breakpoints?: UnistylesBreakpoints
|
|
29
35
|
}
|
|
30
36
|
|
|
31
37
|
export interface UnistylesStyleSheet extends UnistylesStyleSheetSpec {
|
|
32
|
-
absoluteFillObject: typeof NativeStyleSheetType.absoluteFillObject
|
|
33
|
-
absoluteFill: typeof NativeStyleSheetType.absoluteFill
|
|
34
|
-
compose: typeof NativeStyleSheetType.compose
|
|
35
|
-
flatten: typeof NativeStyleSheetType.flatten
|
|
38
|
+
absoluteFillObject: typeof NativeStyleSheetType.absoluteFillObject
|
|
39
|
+
absoluteFill: typeof NativeStyleSheetType.absoluteFill
|
|
40
|
+
compose: typeof NativeStyleSheetType.compose
|
|
41
|
+
flatten: typeof NativeStyleSheetType.flatten
|
|
36
42
|
|
|
37
43
|
// overridden methods
|
|
38
|
-
init(): void
|
|
39
|
-
create: CreateUnistylesStyleSheet
|
|
40
|
-
configure(config: UnistylesConfig): void
|
|
44
|
+
init(): void
|
|
45
|
+
create: CreateUnistylesStyleSheet
|
|
46
|
+
configure(config: UnistylesConfig): void
|
|
41
47
|
jsMethods: {
|
|
42
|
-
processColor: typeof processColor
|
|
48
|
+
processColor: typeof processColor
|
|
43
49
|
parseBoxShadowString: typeof parseBoxShadowString
|
|
44
50
|
}
|
|
45
51
|
}
|
|
46
52
|
|
|
47
|
-
const HybridUnistylesStyleSheet = NitroModules
|
|
48
|
-
.createHybridObject<UnistylesStyleSheet>('UnistylesStyleSheet')
|
|
53
|
+
const HybridUnistylesStyleSheet = NitroModules.createHybridObject<UnistylesStyleSheet>('UnistylesStyleSheet')
|
|
49
54
|
|
|
50
55
|
HybridUnistylesStyleSheet.absoluteFillObject = NativeStyleSheet.absoluteFillObject
|
|
51
56
|
HybridUnistylesStyleSheet.absoluteFill = NativeStyleSheet.absoluteFill
|
|
@@ -53,11 +58,11 @@ HybridUnistylesStyleSheet.flatten = NativeStyleSheet.flatten
|
|
|
53
58
|
HybridUnistylesStyleSheet.compose = NativeStyleSheet.compose
|
|
54
59
|
HybridUnistylesStyleSheet.jsMethods = {
|
|
55
60
|
processColor,
|
|
56
|
-
parseBoxShadowString
|
|
61
|
+
parseBoxShadowString,
|
|
57
62
|
}
|
|
58
63
|
|
|
59
64
|
HybridUnistylesStyleSheet.init()
|
|
60
65
|
|
|
61
|
-
type PrivateMethods = 'jsMethods' | '
|
|
66
|
+
type PrivateMethods = 'jsMethods' | 'init'
|
|
62
67
|
|
|
63
68
|
export const StyleSheet = HybridUnistylesStyleSheet as Omit<UnistylesStyleSheet, PrivateMethods>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { HybridObject } from 'react-native-nitro-modules'
|
|
2
|
+
|
|
2
3
|
import type { AndroidContentSizeCategory, IOSContentSizeCategory, WebContentSizeCategory } from '../../types'
|
|
3
4
|
import type { UnistylesNativeMiniRuntime } from '../NativePlatform'
|
|
4
5
|
import type { AppBreakpoint, AppThemeName, Dimensions, Insets } from '../types'
|
|
@@ -8,40 +9,40 @@ type Orientation = 'portrait' | 'landscape'
|
|
|
8
9
|
|
|
9
10
|
// used for Nitro. It's (Native + Cxx) type
|
|
10
11
|
export interface UnistylesCxxMiniRuntime extends UnistylesNativeMiniRuntime {
|
|
11
|
-
readonly themeName?: string
|
|
12
|
-
readonly breakpoint?: string
|
|
13
|
-
readonly hasAdaptiveThemes: boolean
|
|
12
|
+
readonly themeName?: string
|
|
13
|
+
readonly breakpoint?: string
|
|
14
|
+
readonly hasAdaptiveThemes: boolean
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
// used for TS types
|
|
17
18
|
export interface UnistylesMiniRuntime extends UnistylesCxxMiniRuntime {
|
|
18
|
-
readonly colorScheme: ColorScheme
|
|
19
|
-
readonly contentSizeCategory: IOSContentSizeCategory | AndroidContentSizeCategory | WebContentSizeCategory
|
|
19
|
+
readonly colorScheme: ColorScheme
|
|
20
|
+
readonly contentSizeCategory: IOSContentSizeCategory | AndroidContentSizeCategory | WebContentSizeCategory
|
|
20
21
|
|
|
21
22
|
// additional metadata
|
|
22
|
-
readonly themeName?: AppThemeName
|
|
23
|
+
readonly themeName?: AppThemeName
|
|
23
24
|
readonly breakpoint?: AppBreakpoint
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
export interface UnistylesRuntime extends HybridObject<{ ios: 'c++'
|
|
27
|
-
readonly colorScheme: ColorScheme
|
|
28
|
-
readonly hasAdaptiveThemes: boolean
|
|
29
|
-
readonly screen: Dimensions
|
|
30
|
-
readonly themeName?: string
|
|
31
|
-
readonly contentSizeCategory: string
|
|
32
|
-
readonly breakpoint?: string
|
|
33
|
-
readonly breakpoints: Record<string, number
|
|
34
|
-
readonly insets: Insets
|
|
35
|
-
readonly orientation: Orientation
|
|
36
|
-
readonly pixelRatio: number
|
|
37
|
-
readonly fontScale: number
|
|
38
|
-
readonly rtl: boolean
|
|
39
|
-
readonly isLandscape: boolean
|
|
40
|
-
readonly isPortrait: boolean
|
|
41
|
-
|
|
42
|
-
setTheme(themeName: string): void
|
|
43
|
-
setAdaptiveThemes(isEnabled: boolean): void
|
|
44
|
-
setImmersiveModeNative(isEnabled: boolean): void
|
|
27
|
+
export interface UnistylesRuntime extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
28
|
+
readonly colorScheme: ColorScheme
|
|
29
|
+
readonly hasAdaptiveThemes: boolean
|
|
30
|
+
readonly screen: Dimensions
|
|
31
|
+
readonly themeName?: string
|
|
32
|
+
readonly contentSizeCategory: string
|
|
33
|
+
readonly breakpoint?: string
|
|
34
|
+
readonly breakpoints: Record<string, number>
|
|
35
|
+
readonly insets: Insets
|
|
36
|
+
readonly orientation: Orientation
|
|
37
|
+
readonly pixelRatio: number
|
|
38
|
+
readonly fontScale: number
|
|
39
|
+
readonly rtl: boolean
|
|
40
|
+
readonly isLandscape: boolean
|
|
41
|
+
readonly isPortrait: boolean
|
|
42
|
+
|
|
43
|
+
setTheme(themeName: string): void
|
|
44
|
+
setAdaptiveThemes(isEnabled: boolean): void
|
|
45
|
+
setImmersiveModeNative(isEnabled: boolean): void
|
|
45
46
|
nativeSetRootViewBackgroundColor(color: number): void
|
|
46
47
|
|
|
47
48
|
// private
|
|
@@ -1,38 +1,40 @@
|
|
|
1
1
|
import { processColor } from 'react-native'
|
|
2
2
|
import { NitroModules } from 'react-native-nitro-modules'
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
import type { UnistylesThemes } from '../../global'
|
|
5
5
|
import type { AndroidContentSizeCategory, IOSContentSizeCategory, UnistylesTheme } from '../../types'
|
|
6
6
|
import type { UnistylesNavigationBar } from '../NavigtionBar'
|
|
7
|
-
import { type UnistylesStatusBar, attachStatusBarJSMethods } from '../StatusBar'
|
|
8
7
|
import type { AppBreakpoint, AppTheme, AppThemeName, Color, ColorScheme, Orientation } from '../types'
|
|
9
8
|
import type { UnistylesMiniRuntime, UnistylesRuntime as UnistylesRuntimeSpec } from './UnistylesRuntime.nitro'
|
|
10
9
|
|
|
10
|
+
import { isAndroid, isIOS } from '../../common'
|
|
11
|
+
import { type UnistylesStatusBar, attachStatusBarJSMethods } from '../StatusBar'
|
|
12
|
+
|
|
11
13
|
export interface UnistylesRuntimePrivate extends Omit<UnistylesRuntimeSpec, 'setRootViewBackgroundColor'> {
|
|
12
|
-
readonly colorScheme: ColorScheme
|
|
13
|
-
readonly themeName?: AppThemeName
|
|
14
|
-
readonly contentSizeCategory: IOSContentSizeCategory | AndroidContentSizeCategory
|
|
15
|
-
readonly breakpoint?: AppBreakpoint
|
|
16
|
-
readonly orientation: Orientation
|
|
14
|
+
readonly colorScheme: ColorScheme
|
|
15
|
+
readonly themeName?: AppThemeName
|
|
16
|
+
readonly contentSizeCategory: IOSContentSizeCategory | AndroidContentSizeCategory
|
|
17
|
+
readonly breakpoint?: AppBreakpoint
|
|
18
|
+
readonly orientation: Orientation
|
|
17
19
|
|
|
18
20
|
// other HybridObjects
|
|
19
|
-
statusBar: UnistylesStatusBar
|
|
20
|
-
navigationBar: UnistylesNavigationBar
|
|
21
|
+
statusBar: UnistylesStatusBar
|
|
22
|
+
navigationBar: UnistylesNavigationBar
|
|
21
23
|
|
|
22
|
-
getTheme(themeName?: keyof UnistylesThemes): UnistylesTheme
|
|
24
|
+
getTheme(themeName?: keyof UnistylesThemes): UnistylesTheme
|
|
23
25
|
setTheme(themeName: AppThemeName): void
|
|
24
|
-
updateTheme(themeName: AppThemeName, updater: (currentTheme: AppTheme) => AppTheme): void
|
|
25
|
-
setRootViewBackgroundColor(color?: string): void
|
|
26
|
+
updateTheme(themeName: AppThemeName, updater: (currentTheme: AppTheme) => AppTheme): void
|
|
27
|
+
setRootViewBackgroundColor(color?: string): void
|
|
26
28
|
nativeSetRootViewBackgroundColor(color?: Color): void
|
|
27
29
|
setImmersiveMode(isEnabled: boolean): void
|
|
28
30
|
|
|
29
31
|
// constructors
|
|
30
|
-
createHybridStatusBar(): UnistylesStatusBar
|
|
32
|
+
createHybridStatusBar(): UnistylesStatusBar
|
|
31
33
|
createHybridNavigationBar(): UnistylesNavigationBar
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
type PrivateMethods =
|
|
35
|
-
|'createHybridStatusBar'
|
|
37
|
+
| 'createHybridStatusBar'
|
|
36
38
|
| 'createHybridNavigationBar'
|
|
37
39
|
| 'dispose'
|
|
38
40
|
| 'miniRuntime'
|
|
@@ -41,8 +43,7 @@ type PrivateMethods =
|
|
|
41
43
|
|
|
42
44
|
type UnistylesRuntime = Omit<UnistylesRuntimePrivate, PrivateMethods>
|
|
43
45
|
|
|
44
|
-
const HybridUnistylesRuntime = NitroModules
|
|
45
|
-
.createHybridObject<UnistylesRuntimePrivate>('UnistylesRuntime')
|
|
46
|
+
const HybridUnistylesRuntime = NitroModules.createHybridObject<UnistylesRuntimePrivate>('UnistylesRuntime')
|
|
46
47
|
|
|
47
48
|
HybridUnistylesRuntime.statusBar = HybridUnistylesRuntime.createHybridStatusBar()
|
|
48
49
|
HybridUnistylesRuntime.navigationBar = HybridUnistylesRuntime.createHybridNavigationBar()
|
|
@@ -54,7 +55,8 @@ HybridUnistylesRuntime.setRootViewBackgroundColor = (color?: string) => {
|
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
if (isIOS) {
|
|
57
|
-
HybridUnistylesRuntime.setImmersiveMode = (isEnabled: boolean) =>
|
|
58
|
+
HybridUnistylesRuntime.setImmersiveMode = (isEnabled: boolean) =>
|
|
59
|
+
HybridUnistylesRuntime.statusBar.setHidden(isEnabled, 'fade')
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
if (isAndroid) {
|
|
@@ -65,6 +67,4 @@ attachStatusBarJSMethods(HybridUnistylesRuntime.statusBar)
|
|
|
65
67
|
|
|
66
68
|
export const Runtime = HybridUnistylesRuntime as UnistylesRuntime
|
|
67
69
|
|
|
68
|
-
export type {
|
|
69
|
-
UnistylesMiniRuntime
|
|
70
|
-
}
|
|
70
|
+
export type { UnistylesMiniRuntime }
|
|
@@ -1,27 +1,15 @@
|
|
|
1
1
|
import './TurboUnistyles'
|
|
2
|
+
import type { UnistylesStyleSheet } from './StyleSheet'
|
|
3
|
+
import type { UnistylesMiniRuntime } from './UnistylesRuntime'
|
|
2
4
|
|
|
3
5
|
import { UnistyleDependency } from './NativePlatform'
|
|
4
6
|
import { UnistylesShadowRegistry } from './ShadowRegistry'
|
|
5
7
|
import { StyleSheet } from './StyleSheet'
|
|
6
|
-
import type { UnistylesStyleSheet } from './StyleSheet'
|
|
7
|
-
import { Runtime } from './UnistylesRuntime'
|
|
8
|
-
import type { UnistylesMiniRuntime } from './UnistylesRuntime'
|
|
9
8
|
import { ColorScheme, Orientation, StatusBarStyle } from './types'
|
|
9
|
+
import { Runtime } from './UnistylesRuntime'
|
|
10
10
|
|
|
11
|
-
export {
|
|
12
|
-
StatusBarStyle,
|
|
13
|
-
ColorScheme,
|
|
14
|
-
Orientation,
|
|
15
|
-
UnistyleDependency
|
|
16
|
-
}
|
|
11
|
+
export { StatusBarStyle, ColorScheme, Orientation, UnistyleDependency }
|
|
17
12
|
|
|
18
|
-
export {
|
|
19
|
-
UnistylesShadowRegistry,
|
|
20
|
-
Runtime as UnistylesRuntime,
|
|
21
|
-
StyleSheet,
|
|
22
|
-
}
|
|
13
|
+
export { UnistylesShadowRegistry, Runtime as UnistylesRuntime, StyleSheet }
|
|
23
14
|
|
|
24
|
-
export type {
|
|
25
|
-
UnistylesMiniRuntime,
|
|
26
|
-
UnistylesStyleSheet
|
|
27
|
-
}
|
|
15
|
+
export type { UnistylesMiniRuntime, UnistylesStyleSheet }
|
package/src/specs/types.ts
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
import type { ColorValue } from 'react-native'
|
|
2
|
+
|
|
2
3
|
import type { UnistylesBreakpoints, UnistylesThemes } from '../global'
|
|
3
4
|
|
|
4
5
|
export enum ColorScheme {
|
|
5
6
|
Light = 'light',
|
|
6
7
|
Dark = 'dark',
|
|
7
|
-
Unspecified = 'unspecified'
|
|
8
|
+
Unspecified = 'unspecified',
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export enum Orientation {
|
|
11
12
|
Portrait = 'portrait',
|
|
12
|
-
Landscape = 'landscape'
|
|
13
|
+
Landscape = 'landscape',
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export interface Dimensions {
|
|
16
|
-
readonly width: number
|
|
17
|
+
readonly width: number
|
|
17
18
|
readonly height: number
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export interface Insets {
|
|
21
|
-
readonly top: number
|
|
22
|
-
readonly bottom: number
|
|
23
|
-
readonly left: number
|
|
24
|
-
readonly right: number
|
|
22
|
+
readonly top: number
|
|
23
|
+
readonly bottom: number
|
|
24
|
+
readonly left: number
|
|
25
|
+
readonly right: number
|
|
25
26
|
readonly ime: number
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export enum StatusBarStyle {
|
|
29
30
|
Default = 'default',
|
|
30
31
|
Light = 'light',
|
|
31
|
-
Dark = 'dark'
|
|
32
|
+
Dark = 'dark',
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
export type AppThemeName = keyof UnistylesThemes
|
|
@@ -11,7 +11,7 @@ export enum IOSContentSizeCategory {
|
|
|
11
11
|
Medium = 'Medium',
|
|
12
12
|
Small = 'Small',
|
|
13
13
|
ExtraSmall = 'xSmall',
|
|
14
|
-
Unspecified = 'unspecified'
|
|
14
|
+
Unspecified = 'unspecified',
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export enum AndroidContentSizeCategory {
|
|
@@ -21,7 +21,7 @@ export enum AndroidContentSizeCategory {
|
|
|
21
21
|
ExtraLarge = 'ExtraLarge',
|
|
22
22
|
Huge = 'Huge',
|
|
23
23
|
ExtraHuge = 'ExtraHuge',
|
|
24
|
-
ExtraExtraHuge = 'ExtraExtraHuge'
|
|
24
|
+
ExtraExtraHuge = 'ExtraExtraHuge',
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export enum WebContentSizeCategory {
|
package/src/types/breakpoints.ts
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import type { ColorValue, OpaqueColorValue } from 'react-native'
|
|
2
|
+
|
|
2
3
|
import type { SafeReturnType, UnionToIntersection } from './common'
|
|
3
4
|
import type { TransformStyles } from './core'
|
|
4
5
|
import type { BreakpointsOrMediaQueries, ToDeepUnistyles } from './stylesheet'
|
|
5
6
|
|
|
6
|
-
type ExtractTransformArray<T> = T extends object
|
|
7
|
-
? { [K in keyof T]: ExtractBreakpoints<T[K]> }
|
|
8
|
-
: never
|
|
7
|
+
type ExtractTransformArray<T> = T extends object ? { [K in keyof T]: ExtractBreakpoints<T[K]> } : never
|
|
9
8
|
|
|
10
9
|
type ExtractBreakpoints<T> = T extends object
|
|
11
10
|
? keyof T extends BreakpointsOrMediaQueries
|
|
12
11
|
? T[keyof T]
|
|
13
12
|
: T extends Array<ToDeepUnistyles<TransformStyles>>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
? Array<ExtractTransformArray<T[number]>>
|
|
14
|
+
: T extends Array<infer _U>
|
|
15
|
+
? T
|
|
16
|
+
: {
|
|
17
|
+
[K in keyof T]: ExtractBreakpoints<T[K]>
|
|
18
|
+
}
|
|
20
19
|
: T
|
|
21
20
|
|
|
22
21
|
// Helper type to check if the base styles (without variants) are truly empty or just {}
|
|
@@ -25,48 +24,53 @@ type IsEmptyObject<T> = T extends Record<string, never> ? true : keyof T extends
|
|
|
25
24
|
type ParseNestedObject<T, ShouldFlatten> = T extends (...args: infer A) => infer R
|
|
26
25
|
? (...args: A) => ParseNestedObject<R, false>
|
|
27
26
|
: T extends object
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
27
|
+
? T extends { variants: infer R; compoundVariants: infer C }
|
|
28
|
+
? ParseVariants<FlattenVariants<R, false>> &
|
|
29
|
+
FlattenCompoundVariants<C, false> &
|
|
30
|
+
ParseNestedObject<Omit<T, 'variants' | 'compoundVariants'>, false> extends never
|
|
31
|
+
? ParseVariants<FlattenVariants<R, true>> &
|
|
32
|
+
FlattenCompoundVariants<C, true> &
|
|
33
|
+
ParseNestedObject<Omit<T, 'variants' | 'compoundVariants'>, false>
|
|
34
|
+
: ParseVariants<FlattenVariants<R, false>> &
|
|
35
|
+
FlattenCompoundVariants<C, false> &
|
|
36
|
+
ParseNestedObject<Omit<T, 'variants' | 'compoundVariants'>, false>
|
|
37
|
+
: T extends { variants: infer R }
|
|
38
|
+
? IsEmptyObject<ParseNestedObject<Omit<T, 'variants'>, false>> extends true
|
|
39
|
+
? ParseVariants<FlattenVariants<R, false>>
|
|
40
|
+
: ParseVariants<FlattenVariants<R, false>> & ParseNestedObject<Omit<T, 'variants'>, false> extends never
|
|
41
|
+
? ParseVariants<FlattenVariants<R, true>> & ParseNestedObject<Omit<T, 'variants'>, false>
|
|
42
|
+
: ParseVariants<FlattenVariants<R, false>> & ParseNestedObject<Omit<T, 'variants'>, false>
|
|
43
|
+
: T extends { compoundVariants: object }
|
|
44
|
+
? ParseNestedObject<Omit<T, 'compoundVariants'>, false>
|
|
45
|
+
: {
|
|
46
|
+
[K in keyof T as K extends '_web' ? never : K]: T[K] extends object
|
|
47
|
+
? T[K] extends OpaqueColorValue
|
|
48
|
+
? ColorValue
|
|
49
|
+
: ExtractBreakpoints<T[K]>
|
|
50
|
+
: T[K] extends string
|
|
51
|
+
? ShouldFlatten extends true
|
|
52
|
+
? string
|
|
53
|
+
: T[K]
|
|
54
|
+
: T[K]
|
|
55
|
+
}
|
|
56
|
+
: T
|
|
52
57
|
|
|
53
58
|
type FlattenVariants<T, ShouldFlatten> = T extends object
|
|
54
59
|
? {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
: never
|
|
62
|
-
}
|
|
60
|
+
[K in keyof T]: T[K] extends object
|
|
61
|
+
? {
|
|
62
|
+
[key in keyof T[K]]: T[K][key] extends object ? ParseNestedObject<T[K][key], ShouldFlatten> : never
|
|
63
|
+
}
|
|
64
|
+
: never
|
|
65
|
+
}
|
|
63
66
|
: never
|
|
64
67
|
|
|
65
|
-
type FlattenCompoundVariants<T, ShouldFlatten> =
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
type FlattenCompoundVariants<T, ShouldFlatten> =
|
|
69
|
+
T extends Array<infer _>
|
|
70
|
+
? FlattenCompoundVariants<T[number], ShouldFlatten>
|
|
71
|
+
: T extends { styles: infer S }
|
|
72
|
+
? ParseNestedObject<S, ShouldFlatten>
|
|
73
|
+
: never
|
|
70
74
|
|
|
71
75
|
type IsNonEmpty<T> = T extends object ? (keyof T extends never ? false : true) : false
|
|
72
76
|
|
|
@@ -74,18 +78,18 @@ type IntersectCategoryValues<T> = T extends object
|
|
|
74
78
|
? T extends Array<any>
|
|
75
79
|
? T
|
|
76
80
|
: UnionToIntersection<T[keyof T]> extends infer R
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
? R extends never
|
|
82
|
+
? T[keyof T]
|
|
83
|
+
: R
|
|
84
|
+
: never
|
|
81
85
|
: never
|
|
82
86
|
|
|
83
87
|
type MergeVariantCategories<T> = T extends object
|
|
84
88
|
? UnionToIntersection<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
{
|
|
90
|
+
[K in keyof T]: IsNonEmpty<T[K]> extends true ? T[K] : never
|
|
91
|
+
}[keyof T]
|
|
92
|
+
> extends infer R
|
|
89
93
|
? R extends never
|
|
90
94
|
? NonNullable<T[keyof T]>
|
|
91
95
|
: R
|
|
@@ -97,13 +101,11 @@ type ParseVariants<T> = T extends object
|
|
|
97
101
|
? T[keyof T] extends Array<any>
|
|
98
102
|
? T
|
|
99
103
|
: MergeVariantCategories<{
|
|
100
|
-
|
|
101
|
-
|
|
104
|
+
[K in keyof T]: T[K] extends object ? IntersectCategoryValues<T[K]> : never
|
|
105
|
+
}>
|
|
102
106
|
: T
|
|
103
107
|
: T
|
|
104
108
|
|
|
105
|
-
type ParseStyleKeys<T> = T extends object
|
|
106
|
-
? { [K in keyof T]: ParseNestedObject<T[K], false> }
|
|
107
|
-
: never
|
|
109
|
+
type ParseStyleKeys<T> = T extends object ? { [K in keyof T]: ParseNestedObject<T[K], false> } : never
|
|
108
110
|
|
|
109
111
|
export type ReactNativeStyleSheet<T> = ParseStyleKeys<SafeReturnType<T>>
|
package/src/types/core.ts
CHANGED
|
@@ -12,32 +12,32 @@ import type {
|
|
|
12
12
|
SkewXTransform,
|
|
13
13
|
SkewYTransform,
|
|
14
14
|
TranslateXTransform,
|
|
15
|
-
TranslateYTransform
|
|
15
|
+
TranslateYTransform,
|
|
16
16
|
} from 'react-native/Libraries/StyleSheet/StyleSheetTypes'
|
|
17
|
+
|
|
17
18
|
import type { UnistylesBreakpoints, UnistylesThemes } from '../global'
|
|
18
19
|
|
|
19
20
|
export type ShadowOffset = {
|
|
20
|
-
width: number
|
|
21
|
+
width: number
|
|
21
22
|
height: number
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
export type TransformStyles =
|
|
25
|
-
&
|
|
26
|
-
&
|
|
27
|
-
&
|
|
28
|
-
&
|
|
29
|
-
&
|
|
30
|
-
&
|
|
31
|
-
&
|
|
32
|
-
&
|
|
33
|
-
&
|
|
34
|
-
&
|
|
35
|
-
&
|
|
36
|
-
|
|
37
|
-
& MatrixTransform
|
|
25
|
+
export type TransformStyles = PerspectiveTransform &
|
|
26
|
+
RotateTransform &
|
|
27
|
+
RotateXTransform &
|
|
28
|
+
RotateYTransform &
|
|
29
|
+
RotateZTransform &
|
|
30
|
+
ScaleTransform &
|
|
31
|
+
ScaleXTransform &
|
|
32
|
+
ScaleYTransform &
|
|
33
|
+
TranslateXTransform &
|
|
34
|
+
TranslateYTransform &
|
|
35
|
+
SkewXTransform &
|
|
36
|
+
SkewYTransform &
|
|
37
|
+
MatrixTransform
|
|
38
38
|
|
|
39
39
|
export type ScreenSize = {
|
|
40
|
-
width: number
|
|
40
|
+
width: number
|
|
41
41
|
height: number
|
|
42
42
|
}
|
|
43
43
|
|
package/src/types/index.ts
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
export type { Optional, Nullable, UnionToIntersection } from './common'
|
|
2
|
-
export type {
|
|
3
|
-
NestedStylePairs,
|
|
4
|
-
UnistylesTheme,
|
|
5
|
-
ScreenSize,
|
|
6
|
-
NestedStyle,
|
|
7
|
-
RNValue,
|
|
8
|
-
RNStyle
|
|
9
|
-
} from './core'
|
|
2
|
+
export type { NestedStylePairs, UnistylesTheme, ScreenSize, NestedStyle, RNValue, RNStyle } from './core'
|
|
10
3
|
export type {
|
|
11
4
|
CreateUnistylesStyleSheet,
|
|
12
5
|
StyleSheet,
|
|
@@ -14,7 +7,7 @@ export type {
|
|
|
14
7
|
UnistylesValues,
|
|
15
8
|
UnistyleText,
|
|
16
9
|
UnistyleView,
|
|
17
|
-
UnistyleImage
|
|
10
|
+
UnistyleImage,
|
|
18
11
|
} from './stylesheet'
|
|
19
12
|
export type { ReactNativeStyleSheet } from './breakpoints'
|
|
20
13
|
export type { ExtractVariantNames, UnistylesVariants } from './variants'
|