react-native-unistyles 3.0.23 → 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/Equatable.kt +1 -2
- package/android/src/main/java/com/unistyles/NativePlatform+android.kt +22 -4
- package/android/src/main/java/com/unistyles/NativePlatform+insets.kt +18 -5
- 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 +15 -2
- 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 +16 -3
- 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 +33 -14
- 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 -172
- 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,10 +1,12 @@
|
|
|
1
1
|
import { Animated } from 'react-native'
|
|
2
|
+
|
|
2
3
|
import type { UnistylesBreakpoints } from '../../global'
|
|
3
4
|
import type { UnistyleDependency } from '../../specs/NativePlatform/NativePlatform.nitro'
|
|
4
|
-
import { ColorScheme, Orientation } from '../../specs/types'
|
|
5
5
|
import type { StyleSheet, StyleSheetWithSuperPowers, UnistylesValues } from '../../types/stylesheet'
|
|
6
|
-
import { isDefined, isUnistylesMq, parseMq } from '../../utils'
|
|
7
6
|
import type { UnistylesRuntime } from '../runtime'
|
|
7
|
+
|
|
8
|
+
import { ColorScheme, Orientation } from '../../specs/types'
|
|
9
|
+
import { isDefined, isUnistylesMq, parseMq } from '../../utils'
|
|
8
10
|
import * as unistyles from '../services'
|
|
9
11
|
import { UNI_GENERATED_KEYS, type UniGeneratedKey, type UniGeneratedStyle } from '../types'
|
|
10
12
|
import { hyphenate, keyInObject, reduceObject } from './common'
|
|
@@ -20,9 +22,9 @@ export const schemeToTheme = (scheme: ColorScheme) => {
|
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
export type UnistyleSecrets = {
|
|
23
|
-
__uni__stylesheet: StyleSheetWithSuperPowers<StyleSheet
|
|
24
|
-
__uni__key: string
|
|
25
|
-
__uni__args?: Array<any
|
|
25
|
+
__uni__stylesheet: StyleSheetWithSuperPowers<StyleSheet>
|
|
26
|
+
__uni__key: string
|
|
27
|
+
__uni__args?: Array<any>
|
|
26
28
|
__stylesheetVariants: Record<string, string | boolean | undefined>
|
|
27
29
|
}
|
|
28
30
|
|
|
@@ -32,10 +34,11 @@ export const assignSecrets = <T>(object: T, secrets: UnistyleSecrets) => {
|
|
|
32
34
|
// @ts-expect-error assign hidden secrets
|
|
33
35
|
object[`unistyles_${secretsId}`] = {}
|
|
34
36
|
// @ts-expect-error assign hidden secrets
|
|
35
|
-
|
|
37
|
+
// prettier-ignore
|
|
38
|
+
Object.defineProperties(object[`unistyles_${secretsId}`], reduceObject(secrets, (secret) => ({
|
|
36
39
|
value: secret,
|
|
37
40
|
enumerable: false,
|
|
38
|
-
configurable: true
|
|
41
|
+
configurable: true,
|
|
39
42
|
})))
|
|
40
43
|
|
|
41
44
|
return object
|
|
@@ -52,17 +55,20 @@ export const extractSecrets = (object: any) => {
|
|
|
52
55
|
return undefined
|
|
53
56
|
}
|
|
54
57
|
|
|
55
|
-
return reduceObject(Object.getOwnPropertyDescriptors(secrets), secret => secret.value)
|
|
58
|
+
return reduceObject(Object.getOwnPropertyDescriptors(secrets), (secret) => secret.value)
|
|
56
59
|
}
|
|
57
60
|
|
|
58
61
|
export const removeInlineStyles = (values: UnistylesValues) => {
|
|
59
62
|
const returnValue = {}
|
|
60
63
|
|
|
61
|
-
Object.defineProperties(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
Object.defineProperties(
|
|
65
|
+
returnValue,
|
|
66
|
+
reduceObject(values, (value) => ({
|
|
67
|
+
value,
|
|
68
|
+
enumerable: false,
|
|
69
|
+
configurable: true,
|
|
70
|
+
})),
|
|
71
|
+
)
|
|
66
72
|
|
|
67
73
|
return returnValue
|
|
68
74
|
}
|
|
@@ -79,21 +85,25 @@ export const getMediaQuery = (query: string, allBreakpoints: Array<string>) => {
|
|
|
79
85
|
minWidth ? `(min-width: ${minWidth}px)` : undefined,
|
|
80
86
|
maxWidth ? `(max-width: ${maxWidth}px)` : undefined,
|
|
81
87
|
minHeight ? `(min-height: ${minHeight}px)` : undefined,
|
|
82
|
-
maxHeight ? `(max-height: ${maxHeight}px)` : undefined
|
|
83
|
-
]
|
|
88
|
+
maxHeight ? `(max-height: ${maxHeight}px)` : undefined,
|
|
89
|
+
]
|
|
90
|
+
.filter(Boolean)
|
|
91
|
+
.join(' and ')
|
|
84
92
|
return `@media ${queries}`
|
|
85
93
|
}
|
|
86
94
|
|
|
87
95
|
const breakpointValue = unistyles.services.runtime.breakpoints[query as keyof UnistylesBreakpoints] ?? 0
|
|
88
96
|
const nextBreakpoint = allBreakpoints
|
|
89
97
|
.filter((b): b is keyof UnistylesBreakpoints => b in unistyles.services.runtime.breakpoints)
|
|
90
|
-
.map(b => unistyles.services.runtime.breakpoints[b] as number)
|
|
98
|
+
.map((b) => unistyles.services.runtime.breakpoints[b] as number)
|
|
91
99
|
.sort((a, b) => a - b)
|
|
92
|
-
.find(b => b > breakpointValue)
|
|
100
|
+
.find((b) => b > breakpointValue)
|
|
93
101
|
const queries = [
|
|
94
102
|
`(min-width: ${breakpointValue}px)`,
|
|
95
103
|
nextBreakpoint ? `(max-width: ${nextBreakpoint - 1}px)` : undefined,
|
|
96
|
-
]
|
|
104
|
+
]
|
|
105
|
+
.filter(Boolean)
|
|
106
|
+
.join(' and ')
|
|
97
107
|
|
|
98
108
|
return `@media ${queries}`
|
|
99
109
|
}
|
|
@@ -103,22 +113,20 @@ export const extractUnistyleDependencies = (value: any) => {
|
|
|
103
113
|
return []
|
|
104
114
|
}
|
|
105
115
|
|
|
106
|
-
const dependencies: Array<UnistyleDependency> = keyInObject(value, 'uni__dependencies')
|
|
116
|
+
const dependencies: Array<UnistyleDependency> = keyInObject(value, 'uni__dependencies')
|
|
117
|
+
? value.uni__dependencies
|
|
118
|
+
: []
|
|
107
119
|
|
|
108
120
|
return Array.isArray(dependencies) ? dependencies : []
|
|
109
121
|
}
|
|
110
122
|
|
|
111
123
|
export const checkForProp = (value: any, prop: string): boolean => {
|
|
112
124
|
if (Array.isArray(value)) {
|
|
113
|
-
return value.some(nestedValue => checkForProp(nestedValue, prop))
|
|
125
|
+
return value.some((nestedValue) => checkForProp(nestedValue, prop))
|
|
114
126
|
}
|
|
115
127
|
|
|
116
128
|
if (typeof value === 'object' && value !== null) {
|
|
117
|
-
return keyInObject(value, prop)
|
|
118
|
-
? true
|
|
119
|
-
: keyInObject(value, '_web')
|
|
120
|
-
? checkForProp(value._web, prop)
|
|
121
|
-
: false
|
|
129
|
+
return keyInObject(value, prop) ? true : keyInObject(value, '_web') ? checkForProp(value._web, prop) : false
|
|
122
130
|
}
|
|
123
131
|
|
|
124
132
|
return false
|
|
@@ -134,9 +142,8 @@ export const checkForAnimated = (value: any): boolean => {
|
|
|
134
142
|
const secrets = extractSecrets(value)
|
|
135
143
|
|
|
136
144
|
// @ts-expect-error React Native Web exports Animated.AnimatedNode as Animated.Node
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
secrets && Object.keys(secrets).length === 0
|
|
145
|
+
// prettier-ignore
|
|
146
|
+
return value instanceof Animated.Node || objectValues.length > 0 && objectValues.some(checkForAnimated) || secrets && Object.keys(secrets).length === 0
|
|
140
147
|
}
|
|
141
148
|
|
|
142
149
|
return false
|
|
@@ -145,12 +152,19 @@ export const checkForAnimated = (value: any): boolean => {
|
|
|
145
152
|
export const isGeneratedUnistyle = (value: Record<string, any>): value is UniGeneratedStyle => {
|
|
146
153
|
const keys = Object.keys(value)
|
|
147
154
|
|
|
148
|
-
return keys.length > 0 && keys.every(key => UNI_GENERATED_KEYS.includes(key as UniGeneratedKey))
|
|
155
|
+
return keys.length > 0 && keys.every((key) => UNI_GENERATED_KEYS.includes(key as UniGeneratedKey))
|
|
149
156
|
}
|
|
150
157
|
|
|
151
158
|
export const convertTheme = (key: string, value: any, prev = '-'): [string, any] => {
|
|
152
159
|
if (typeof value === 'object' && value !== null) {
|
|
153
|
-
return [
|
|
160
|
+
return [
|
|
161
|
+
key,
|
|
162
|
+
Object.fromEntries(
|
|
163
|
+
Object.entries(value).map(([nestedKey, nestedValue]) =>
|
|
164
|
+
convertTheme(nestedKey, nestedValue, `${prev}-${key}`),
|
|
165
|
+
),
|
|
166
|
+
),
|
|
167
|
+
]
|
|
154
168
|
}
|
|
155
169
|
|
|
156
170
|
if (typeof value === 'string') {
|
|
@@ -160,7 +174,10 @@ export const convertTheme = (key: string, value: any, prev = '-'): [string, any]
|
|
|
160
174
|
return [key, value]
|
|
161
175
|
}
|
|
162
176
|
|
|
163
|
-
export const getClosestBreakpointValue = <T>(
|
|
177
|
+
export const getClosestBreakpointValue = <T>(
|
|
178
|
+
runtime: UnistylesRuntime,
|
|
179
|
+
values: Partial<Record<keyof UnistylesBreakpoints, T>>,
|
|
180
|
+
) => {
|
|
164
181
|
const breakpoints = runtime.breakpoints
|
|
165
182
|
const breakpointValues = Object.entries(values)
|
|
166
183
|
// Filter out non-breakpoint values
|
|
@@ -168,9 +185,11 @@ export const getClosestBreakpointValue = <T>(runtime: UnistylesRuntime, values:
|
|
|
168
185
|
// Sort in descending order
|
|
169
186
|
.sort(([a], [b]) => (breakpoints[b] ?? 0) - (breakpoints[a] ?? 0))
|
|
170
187
|
// Get breakpoint value with highest priority
|
|
171
|
-
const [_, currentBreakpointValue] =
|
|
172
|
-
|
|
173
|
-
|
|
188
|
+
const [_, currentBreakpointValue] =
|
|
189
|
+
breakpointValues.find(
|
|
190
|
+
([key]) =>
|
|
191
|
+
isDefined(runtime.breakpoint) && (breakpoints[key] ?? 0) <= (breakpoints[runtime.breakpoint] ?? 0),
|
|
192
|
+
) ?? []
|
|
174
193
|
|
|
175
194
|
return currentBreakpointValue
|
|
176
195
|
}
|
package/src/web/variants.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { UnistylesValues } from '../types'
|
|
2
|
+
|
|
2
3
|
import { deepMergeObjects } from '../utils'
|
|
3
4
|
import { keyInObject } from './utils'
|
|
4
5
|
|
|
5
6
|
type StylesWithVariants = {
|
|
6
|
-
variants: Record<string, string | boolean | undefined
|
|
7
|
-
compoundVariants?: Array<
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
variants: Record<string, string | boolean | undefined>
|
|
8
|
+
compoundVariants?: Array<
|
|
9
|
+
Record<string, string | boolean | undefined> & {
|
|
10
|
+
styles: Record<string, any>
|
|
11
|
+
}
|
|
12
|
+
>
|
|
10
13
|
}
|
|
11
14
|
const hasVariants = (value: any): value is StylesWithVariants => {
|
|
12
15
|
return keyInObject(value, 'variants')
|
|
@@ -28,15 +31,20 @@ export const getVariants = (styles: UnistylesValues, selectedVariants: Record<st
|
|
|
28
31
|
return selectedVariantStyles
|
|
29
32
|
})
|
|
30
33
|
|
|
31
|
-
const compoundVariantStyles =
|
|
32
|
-
|
|
34
|
+
const compoundVariantStyles =
|
|
35
|
+
styles.compoundVariants?.flatMap((compoundVariant) => {
|
|
36
|
+
const { styles, ...conditions } = compoundVariant
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
if (
|
|
39
|
+
Object.entries(conditions).some(
|
|
40
|
+
([variant, value]) => String(selectedVariants[variant]) !== String(value),
|
|
41
|
+
)
|
|
42
|
+
) {
|
|
43
|
+
return []
|
|
44
|
+
}
|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
return styles
|
|
47
|
+
}) ?? []
|
|
40
48
|
|
|
41
49
|
return deepMergeObjects(...variantStyles, ...compoundVariantStyles)
|
|
42
50
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { StyleProp } from 'react-native'
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import type { RNStyle, UnistylesValues } from '../types'
|
|
4
|
+
|
|
5
|
+
import { getClassName } from '../core'
|
|
4
6
|
import { createUnistylesRef } from '../web/utils/createUnistylesRef'
|
|
5
7
|
|
|
6
8
|
export const getWebProps = <T>(style: StyleProp<RNStyle>, forwardedRef?: React.ForwardedRef<T>) => {
|
|
@@ -9,10 +11,7 @@ export const getWebProps = <T>(style: StyleProp<RNStyle>, forwardedRef?: React.F
|
|
|
9
11
|
const [generatedStyles] = styles ?? []
|
|
10
12
|
|
|
11
13
|
return {
|
|
12
|
-
className: [
|
|
13
|
-
|
|
14
|
-
generatedStyles?.injectedClassName,
|
|
15
|
-
].filter(Boolean).join(' '),
|
|
16
|
-
ref
|
|
14
|
+
className: [generatedStyles?.hash, generatedStyles?.injectedClassName].filter(Boolean).join(' '),
|
|
15
|
+
ref,
|
|
17
16
|
}
|
|
18
17
|
}
|
package/src/web-only/index.ts
CHANGED
package/LICENSE
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023-2025 Jacek Pudysz
|
|
4
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
-
in the Software without restriction, including without limitation the rights
|
|
7
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
-
furnished to do so, subject to the following conditions:
|
|
10
|
-
|
|
11
|
-
The above copyright notice and this permission notice shall be included in all
|
|
12
|
-
copies or substantial portions of the Software.
|
|
13
|
-
|
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
-
SOFTWARE.
|
package/README.md
DELETED
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
[<img alt="react-native-unistyles" src="assets/banner3.png">](https://unistyl.es/)
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
[](https://www.npmjs.com/package/react-native-unistyles)
|
|
5
|
-
[](https://www.npmjs.com/package/react-native-unistyles)
|
|
6
|
-
[](https://opensource.org/licenses/MIT)
|
|
7
|
-
<br />
|
|
8
|
-
[](https://docs.expo.dev/)
|
|
9
|
-
[](https://www.w3.org/)
|
|
10
|
-
[](https://developer.apple.com/ios/)
|
|
11
|
-
[](https://developer.android.com/)
|
|
12
|
-
[](https://nextjs.org/)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## Installation
|
|
16
|
-
|
|
17
|
-
```shell
|
|
18
|
-
yarn add react-native-unistyles
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Install dependencies:
|
|
22
|
-
|
|
23
|
-
```shell
|
|
24
|
-
yarn add react-native-edge-to-edge react-native-nitro-modules@0.33.8
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
> To avoid unexpected behavior, always use a fixed version of `react-native-nitro-modules`
|
|
28
|
-
|
|
29
|
-
| react-native-unistyles | react-native-nitro-modules |
|
|
30
|
-
|------------------------|----------------------------|
|
|
31
|
-
| 3.0.0 | 0.33.8 |
|
|
32
|
-
|
|
33
|
-
Then follow [installation guides](https://unistyl.es/v3/start/getting-started) for your platform.
|
|
34
|
-
|
|
35
|
-
## [Documentation](https://unistyl.es/)
|
|
36
|
-
- [Start here](https://unistyl.es/v3/start/introduction)
|
|
37
|
-
- [Migration from Unistyles 2.0](https://unistyl.es/v3/start/migration-guide)
|
|
38
|
-
- [Learn how Unistyles 3.0 works](https://unistyl.es/v3/start/how-unistyles-works)
|
|
39
|
-
- [API](https://unistyl.es/v3/references/stylesheet)
|
|
40
|
-
- [Examples](https://unistyl.es/v3/examples/examples)
|
|
41
|
-
|
|
42
|
-
## Features
|
|
43
|
-
- 🚀 Shared core with C++ and JSI bindings
|
|
44
|
-
- 🏎️ Powered by Nitro Modules
|
|
45
|
-
- 🦸🏼♂️ No re-renders
|
|
46
|
-
- 🦄 Custom web parser, classes and pseudo classes
|
|
47
|
-
- ⚛️ Tightly integrated with Fabric and Shadow Tree
|
|
48
|
-
- 🔥 Crazy performance, adds under 0.1 ms to your StyleSheet
|
|
49
|
-
- 🎳 Share up to 100% of your styles across platforms in monorepo
|
|
50
|
-
- 🎯 Doesn't introduce new components, your view hierarchy is always clean
|
|
51
|
-
- 🎨 Register multiple themes and change them with single function call
|
|
52
|
-
- and [much much more](https://unistyl.es/v3/start/new-features)!
|
|
53
|
-
|
|
54
|
-
## Sponsors
|
|
55
|
-
|
|
56
|
-
<a href="https://codemask.com">
|
|
57
|
-
<img src="https://avatars.githubusercontent.com/u/51229884?s=200&v=4" height="70px" width="70px" alt="codemask" />
|
|
58
|
-
</a>
|
|
59
|
-
<a href="https://galaxies.dev">
|
|
60
|
-
<img src="https://avatars.githubusercontent.com/u/118431096?s=200&v=4" height="70px" width="70px" alt="galaxies-dev" />
|
|
61
|
-
</a>
|
|
62
|
-
<a href="https://github.com/ryanlanciaux">
|
|
63
|
-
<img src="https://avatars.githubusercontent.com/u/85041?v=4" height="70px" width="70px" alt="ryanlanciaux" />
|
|
64
|
-
</a>
|
|
65
|
-
<a href="https://github.com/jordmccord">
|
|
66
|
-
<img src="https://avatars.githubusercontent.com/u/7591840?v=4" height="70px" width="70px" alt="jordmccord" />
|
|
67
|
-
</a>
|
|
68
|
-
<a href="https://github.com/kerwanp">
|
|
69
|
-
<img src="https://avatars.githubusercontent.com/u/36955373?v=4" height="70px" width="70px" alt="kerwanp" />
|
|
70
|
-
</a>
|
|
71
|
-
<a href="https://github.com/andkindness">
|
|
72
|
-
<img src="https://avatars.githubusercontent.com/u/143941782?v=4" height="70px" width="70px" alt="andkindness" />
|
|
73
|
-
</a>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
## Past sponsors
|
|
77
|
-
|
|
78
|
-
<a href="https://github.com/kmartinezmedia">
|
|
79
|
-
<img src="https://avatars.githubusercontent.com/u/6308123?s=200&v=4" height="60px" width="60px" alt="kmartinezmedia" />
|
|
80
|
-
</a>
|
|
81
|
-
<a href="https://github.com/levibuzolic">
|
|
82
|
-
<img src="https://avatars.githubusercontent.com/u/721323?v=4" height="60px" width="60px" alt="levibuzolic" />
|
|
83
|
-
</a>
|
|
84
|
-
<a href="https://github.com/claudesortwell">
|
|
85
|
-
<img src="https://avatars.githubusercontent.com/u/41422239?v=4" height="60px" width="60px" alt="claudesortwell" />
|
|
86
|
-
</a>
|
|
87
|
-
<a href="https://github.com/luoxuhai">
|
|
88
|
-
<img src="https://avatars.githubusercontent.com/u/37284154?v=4" height="60px" width="60px" alt="luoxuhai" />
|
|
89
|
-
</a>
|
|
90
|
-
<a href="https://github.com">
|
|
91
|
-
<img src="https://avatars.githubusercontent.com/u/113348625?v=4" height="60px" width="60px" alt="anonymous" />
|
|
92
|
-
</a>
|
|
93
|
-
<a href="https://github.com/abanobboles">
|
|
94
|
-
<img src="https://avatars.githubusercontent.com/u/9078953?v=4" height="60px" width="60px" alt="abanobboles" />
|
|
95
|
-
</a>
|
|
96
|
-
<a href="https://github.com/hyoban">
|
|
97
|
-
<img src="https://avatars.githubusercontent.com/u/38493346?v=4" height="60px" width="60px" alt="hyoban" />
|
|
98
|
-
</a>
|
|
99
|
-
<a href="https://github.com/giovannilondero">
|
|
100
|
-
<img src="https://avatars.githubusercontent.com/u/10998991?v=4" height="60px" width="60px" alt="giovannilondero" />
|
|
101
|
-
</a>
|
|
102
|
-
<a href="https://github.com/4cc3ssX">
|
|
103
|
-
<img src="https://avatars.githubusercontent.com/u/57473799?v=4" height="60px" width="60px" alt="4cc3ssX" />
|
|
104
|
-
</a>
|
|
105
|
-
<a href="https://github.com/FilipiRafael">
|
|
106
|
-
<img src="https://avatars.githubusercontent.com/u/61629642?v=4" height="60px" width="60px" alt="FilipiRafael" />
|
|
107
|
-
</a>
|
|
108
|
-
<a href="https://github.com/dacoto97">
|
|
109
|
-
<img src="https://avatars.githubusercontent.com/u/16915053?v=4" height="60px" width="60px" alt="dacoto97" />
|
|
110
|
-
</a>
|
|
111
|
-
<a href="https://github.com/chinamcafee">
|
|
112
|
-
<img src="https://avatars.githubusercontent.com/u/3439961?v=4" height="60px" width="60px" alt="chinamcafee" />
|
|
113
|
-
</a>
|
|
114
|
-
<a href="https://github.com/guillaumehcht">
|
|
115
|
-
<img src="https://avatars.githubusercontent.com/u/80776475?v=4" height="60px" width="60px" alt="guillaumehcht" />
|
|
116
|
-
</a>
|
|
117
|
-
<a href="https://github.com/FTCHD">
|
|
118
|
-
<img src="https://avatars.githubusercontent.com/u/144691102?v=4" height="60px" width="60px" alt="FTCHD" />
|
|
119
|
-
</a>
|
|
120
|
-
<a href="https://github.com/avega99">
|
|
121
|
-
<img src="https://avatars.githubusercontent.com/u/177598670?v=4" height="60px" width="60px" alt="avega99" />
|
|
122
|
-
</a>
|
|
123
|
-
<a href="https://github.com/oscklm">
|
|
124
|
-
<img src="https://avatars.githubusercontent.com/u/22825865?v=4" height="60px" width="60px" alt="oscklm" />
|
|
125
|
-
</a>
|
|
126
|
-
<a href="https://github.com/loopsware">
|
|
127
|
-
<img src="https://avatars.githubusercontent.com/u/161434039?s=200&v=4" height="60px" width="60px" alt="loopsware" />
|
|
128
|
-
</a>
|
|
129
|
-
<a href="https://github.com/mobily">
|
|
130
|
-
<img src="https://avatars.githubusercontent.com/u/1467712?v=4" height="60px" width="60px" alt="mobily" />
|
|
131
|
-
</a>
|
|
132
|
-
<a href="https://github.com/mwarger">
|
|
133
|
-
<img src="https://avatars.githubusercontent.com/u/686823?v=4" height="60px" width="60px" alt="mwarger" />
|
|
134
|
-
</a>
|
|
135
|
-
<a href="https://github.com/happyfloat">
|
|
136
|
-
<img src="https://avatars.githubusercontent.com/u/186333704?s=200&v=4" height="60px" width="60px" alt="happyfloat" />
|
|
137
|
-
</a>
|
|
138
|
-
<a href="https://github.com/cargurus-oss-fund">
|
|
139
|
-
<img src="https://avatars.githubusercontent.com/u/108300759?v=4" height="60px" width="60px" alt="cargurus-oss-fund" />
|
|
140
|
-
</a>
|
|
141
|
-
<a href="https://github.com/rauchg">
|
|
142
|
-
<img src="https://avatars.githubusercontent.com/u/13041?v=4" height="60px" width="60px" alt="rauchg" />
|
|
143
|
-
</a>
|
|
144
|
-
<a href="https://github.com/oliverloops">
|
|
145
|
-
<img src="https://avatars.githubusercontent.com/u/33361399?v=4" height="60px" width="60px" alt="oliverloops" />
|
|
146
|
-
</a>
|
|
147
|
-
<a href="https://github.com/biw">
|
|
148
|
-
<img src="https://avatars.githubusercontent.com/u/6139501?v=4" height="60px" width="60px" alt="biw" />
|
|
149
|
-
</a>
|
|
150
|
-
|
|
151
|
-
## Sponsor my work
|
|
152
|
-
|
|
153
|
-
[How to become a sponsor?](https://unistyl.es/v3/other/for-sponsors)
|
|
154
|
-
|
|
155
|
-
If you found the `react-native-unistyles` time-saving and valuable, please consider sponsoring my work. Your support enables me to continue creating libraries with a fresh approach.
|
|
156
|
-
|
|
157
|
-
Github: https://github.com/sponsors/jpudysz
|
|
158
|
-
|
|
159
|
-
Ko-fi: https://ko-fi.com/jpudysz
|
|
160
|
-
|
|
161
|
-
Your support is greatly appreciated and helps me dedicate more time and resources to creating quality libraries. Thank you for all the support!
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
## Discord
|
|
165
|
-
Looking for help or you want to chat with me?
|
|
166
|
-
|
|
167
|
-
[Join Discord](https://discord.gg/akGHf27P4C)
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
## License
|
|
171
|
-
|
|
172
|
-
MIT
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { RemapConfig } from '../index';
|
|
2
|
-
export declare const REACT_NATIVE_COMPONENT_NAMES: string[];
|
|
3
|
-
/**
|
|
4
|
-
* auto replace RN imports to Unistyles imports under these paths
|
|
5
|
-
* our implementation simply borrows 'ref' to register it in ShadowRegistry
|
|
6
|
-
* so we won't affect anyone's implementation
|
|
7
|
-
*/
|
|
8
|
-
export declare const REPLACE_WITH_UNISTYLES_PATHS: string[];
|
|
9
|
-
/**
|
|
10
|
-
* this is more powerful API as it allows to convert unmatched imports to Unistyles
|
|
11
|
-
*/
|
|
12
|
-
export declare const REPLACE_WITH_UNISTYLES_EXOTIC_PATHS: Array<RemapConfig>;
|
|
13
|
-
/**
|
|
14
|
-
* this list will additionally detect React Native direct imports
|
|
15
|
-
*/
|
|
16
|
-
export declare const NATIVE_COMPONENTS_PATHS: Pick<RemapConfig, 'imports'>;
|
|
17
|
-
//# sourceMappingURL=consts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../../plugin/src/consts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,eAAO,MAAM,4BAA4B,UAqBxC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,UAGxC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mCAAmC,EAAE,KAAK,CAAC,WAAW,CAAM,CAAA;AAEzE;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,CAchE,CAAA"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { getModulePaths } from '@callstack/repack';
|
|
2
|
-
import type { Compiler, RspackPluginInstance } from '@rspack/core';
|
|
3
|
-
import type { UnistylesPluginOptions } from 'react-native-unistyles/plugin';
|
|
4
|
-
import { unistylesLoader } from './loader';
|
|
5
|
-
export declare const BASE_REPACK_EXCLUDE_PATHS: RegExp[];
|
|
6
|
-
type RuleExcludePaths = ReturnType<typeof getModulePaths>;
|
|
7
|
-
interface ConstructorParams {
|
|
8
|
-
ruleExcludePaths?: RuleExcludePaths;
|
|
9
|
-
unistylesPluginOptions?: UnistylesPluginOptions;
|
|
10
|
-
}
|
|
11
|
-
export declare class RepackUnistylePlugin implements RspackPluginInstance {
|
|
12
|
-
private ruleExcludePaths;
|
|
13
|
-
private unistylesPluginOptions;
|
|
14
|
-
constructor({ ruleExcludePaths, unistylesPluginOptions }?: ConstructorParams);
|
|
15
|
-
apply(compiler: Compiler): void;
|
|
16
|
-
}
|
|
17
|
-
export default unistylesLoader;
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../repack-plugin/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAClE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE1C,eAAO,MAAM,yBAAyB,UAcpC,CAAA;AAEF,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAEzD,UAAU,iBAAiB;IACvB,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,sBAAsB,CAAC,EAAE,sBAAsB,CAAA;CAClD;AAwBD,qBAAa,oBAAqB,YAAW,oBAAoB;IAC7D,OAAO,CAAC,gBAAgB,CAAA;IACxB,OAAO,CAAC,sBAAsB,CAAA;gBAElB,EAAE,gBAA4C,EAAE,sBAAsB,EAAE,GAAE,iBAAsB;IAK5G,KAAK,CAAC,QAAQ,EAAE,QAAQ;CAG3B;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { LoaderContext } from '@rspack/core';
|
|
2
|
-
import type { UnistylesPluginOptions } from '../../plugin';
|
|
3
|
-
interface UnistylesLoaderOptions {
|
|
4
|
-
babelPlugins?: string[];
|
|
5
|
-
unistylesPluginOptions?: UnistylesPluginOptions;
|
|
6
|
-
}
|
|
7
|
-
export declare function unistylesLoader(this: LoaderContext<UnistylesLoaderOptions>, source: string): void;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../repack-plugin/src/loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAK1D,UAAU,sBAAsB;IAC5B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,sBAAsB,CAAC,EAAE,sBAAsB,CAAA;CAClD;AAMD,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,CAAC,sBAAsB,CAAC,EAAE,MAAM,EAAE,MAAM,QAuC1F"}
|