react-native-unistyles 3.0.0-alpha.9 → 3.0.0-beta.2
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/LICENSE +1 -1
- package/README.md +30 -41
- package/Unistyles.podspec +8 -2
- package/android/CMakeLists.txt +22 -45
- package/android/build.gradle +22 -5
- package/android/src/main/cxx/NativeUnistylesModule.cpp +71 -0
- package/android/src/main/cxx/NativeUnistylesModule.h +42 -0
- package/android/src/main/cxx/cpp-adapter.cpp +8 -86
- package/android/src/main/java/com/unistyles/Equatable.kt +61 -0
- package/android/src/main/java/com/unistyles/NativePlatform+android.kt +294 -0
- package/android/src/main/java/com/unistyles/NativePlatform+insets.kt +152 -0
- package/android/src/main/java/com/unistyles/NativePlatform+listener.kt +59 -0
- package/android/src/main/java/com/unistyles/UnistylesModule.kt +51 -0
- package/android/src/main/java/com/unistyles/UnistylesPackage.kt +16 -14
- package/cxx/NativePlatform.h +11 -0
- package/cxx/common/Constants.h +5 -0
- package/cxx/common/Helpers.h +59 -6
- package/cxx/core/HostStyle.cpp +14 -4
- package/cxx/core/HostStyle.h +6 -1
- package/cxx/core/StyleSheet.h +0 -1
- package/cxx/core/Unistyle.h +8 -5
- package/cxx/core/UnistyleData.h +4 -3
- package/cxx/core/UnistyleWrapper.h +102 -7
- package/cxx/core/UnistylesCommitHook.cpp +14 -18
- package/cxx/core/UnistylesCommitHook.h +6 -11
- package/cxx/core/UnistylesCommitShadowNode.h +13 -0
- package/cxx/core/UnistylesMountHook.cpp +28 -0
- package/cxx/core/UnistylesMountHook.h +27 -0
- package/cxx/core/UnistylesRegistry.cpp +104 -51
- package/cxx/core/UnistylesRegistry.h +17 -11
- package/cxx/core/UnistylesState.cpp +29 -8
- package/cxx/core/UnistylesState.h +5 -2
- package/cxx/hybridObjects/HybridNavigationBar.cpp +0 -4
- package/cxx/hybridObjects/HybridNavigationBar.h +3 -4
- package/cxx/hybridObjects/HybridShadowRegistry.cpp +114 -13
- package/cxx/hybridObjects/HybridShadowRegistry.h +21 -2
- package/cxx/hybridObjects/HybridStatusBar.cpp +0 -4
- package/cxx/hybridObjects/HybridStatusBar.h +3 -4
- package/cxx/hybridObjects/HybridStyleSheet.cpp +145 -19
- package/cxx/hybridObjects/HybridStyleSheet.h +27 -5
- package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +82 -11
- package/cxx/hybridObjects/HybridUnistylesRuntime.h +17 -3
- package/cxx/parser/Parser.cpp +363 -70
- package/cxx/parser/Parser.h +10 -6
- package/cxx/shadowTree/ShadowLeafUpdate.h +3 -1
- package/cxx/shadowTree/ShadowTrafficController.h +71 -0
- package/cxx/shadowTree/ShadowTreeManager.cpp +28 -19
- package/cxx/shadowTree/ShadowTreeManager.h +3 -2
- package/ios/Equatable.swift +2 -1
- package/ios/Extensions.swift +3 -1
- package/ios/NativePlatform+ios.swift +34 -9
- package/ios/NativePlatform+keyboard.swift +83 -0
- package/ios/NativePlatformListener+ios.swift +36 -24
- package/ios/Unistyles.h +1 -0
- package/ios/UnistylesModuleOnLoad.h +8 -2
- package/ios/UnistylesModuleOnLoad.mm +11 -3
- package/lib/commonjs/components/Display.js +18 -0
- package/lib/commonjs/components/Display.js.map +1 -0
- package/lib/commonjs/components/Hide.js +18 -0
- package/lib/commonjs/components/Hide.js.map +1 -0
- package/lib/commonjs/components/ScopedTheme.js +36 -0
- package/lib/commonjs/components/ScopedTheme.js.map +1 -0
- package/lib/commonjs/components/Variants.js +33 -0
- package/lib/commonjs/components/Variants.js.map +1 -0
- package/lib/commonjs/components/index.js +34 -0
- package/lib/commonjs/components/index.js.map +1 -0
- package/lib/commonjs/components/native/ActivityIndicator.js +10 -0
- package/lib/commonjs/components/native/ActivityIndicator.js.map +1 -0
- package/lib/commonjs/components/native/FlatList.js +10 -0
- package/lib/commonjs/components/native/FlatList.js.map +1 -0
- package/lib/commonjs/components/native/Image.js +10 -0
- package/lib/commonjs/components/native/Image.js.map +1 -0
- package/lib/commonjs/components/native/ImageBackground.js +10 -0
- package/lib/commonjs/components/native/ImageBackground.js.map +1 -0
- package/lib/commonjs/components/native/KeyboardAvoidingView.js +10 -0
- package/lib/commonjs/components/native/KeyboardAvoidingView.js.map +1 -0
- package/lib/commonjs/components/native/Pressable.js +75 -0
- package/lib/commonjs/components/native/Pressable.js.map +1 -0
- package/lib/commonjs/components/native/Pressable.native.js +48 -0
- package/lib/commonjs/components/native/Pressable.native.js.map +1 -0
- package/lib/commonjs/components/native/RefreshControl.js +10 -0
- package/lib/commonjs/components/native/RefreshControl.js.map +1 -0
- package/lib/commonjs/components/native/ScrollView.js +10 -0
- package/lib/commonjs/components/native/ScrollView.js.map +1 -0
- package/lib/commonjs/components/native/SectionList.js +10 -0
- package/lib/commonjs/components/native/SectionList.js.map +1 -0
- package/lib/commonjs/components/native/Switch.js +10 -0
- package/lib/commonjs/components/native/Switch.js.map +1 -0
- package/lib/commonjs/components/native/Text.js +10 -0
- package/lib/commonjs/components/native/Text.js.map +1 -0
- package/lib/commonjs/components/native/TextInput.js +10 -0
- package/lib/commonjs/components/native/TextInput.js.map +1 -0
- package/lib/commonjs/components/native/TouchableHighlight.js +10 -0
- package/lib/commonjs/components/native/TouchableHighlight.js.map +1 -0
- package/lib/commonjs/components/native/TouchableOpacity.js +10 -0
- package/lib/commonjs/components/native/TouchableOpacity.js.map +1 -0
- package/lib/commonjs/components/native/View.js +10 -0
- package/lib/commonjs/components/native/View.js.map +1 -0
- package/lib/commonjs/components/native/VirtualizedList.js +10 -0
- package/lib/commonjs/components/native/VirtualizedList.js.map +1 -0
- package/lib/commonjs/core/createUnistylesComponent.js +16 -0
- package/lib/commonjs/core/createUnistylesComponent.js.map +1 -0
- package/lib/commonjs/core/createUnistylesElement.js +16 -0
- package/lib/commonjs/core/createUnistylesElement.js.map +1 -0
- package/lib/commonjs/core/createUnistylesImageBackground.js +27 -0
- package/lib/commonjs/core/createUnistylesImageBackground.js.map +1 -0
- package/lib/commonjs/core/index.js +41 -0
- package/lib/commonjs/core/index.js.map +1 -0
- package/lib/commonjs/core/passForwardRef.js +27 -0
- package/lib/commonjs/core/passForwardRef.js.map +1 -0
- package/lib/commonjs/core/withUnistyles/index.js +13 -0
- package/lib/commonjs/core/withUnistyles/index.js.map +1 -0
- package/lib/commonjs/core/withUnistyles/types.js +8 -0
- package/lib/commonjs/core/withUnistyles/types.js.map +1 -0
- package/lib/commonjs/core/withUnistyles/useDependencies.js +81 -0
- package/lib/commonjs/core/withUnistyles/useDependencies.js.map +1 -0
- package/lib/commonjs/core/withUnistyles/withUnistyles.js +88 -0
- package/lib/commonjs/core/withUnistyles/withUnistyles.js.map +1 -0
- package/lib/commonjs/core/withUnistyles/withUnistyles.native.js +96 -0
- package/lib/commonjs/core/withUnistyles/withUnistyles.native.js.map +1 -0
- package/lib/commonjs/hooks/index.js +13 -0
- package/lib/commonjs/hooks/index.js.map +1 -0
- package/lib/commonjs/hooks/useMedia.js +43 -0
- package/lib/commonjs/hooks/useMedia.js.map +1 -0
- package/lib/commonjs/hooks/useMedia.native.js +60 -0
- package/lib/commonjs/hooks/useMedia.native.js.map +1 -0
- package/lib/commonjs/index.js +45 -11
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mq.js +31 -18
- package/lib/commonjs/mq.js.map +1 -1
- package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js +1 -0
- package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js.map +1 -1
- package/lib/commonjs/specs/NavigtionBar/index.js +0 -15
- package/lib/commonjs/specs/NavigtionBar/index.js.map +1 -1
- package/lib/commonjs/specs/ShadowRegistry/index.js +12 -9
- package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/commonjs/specs/StatusBar/index.js +0 -5
- package/lib/commonjs/specs/StatusBar/index.js.map +1 -1
- package/lib/commonjs/specs/StyleSheet/index.js +1 -0
- package/lib/commonjs/specs/StyleSheet/index.js.map +1 -1
- package/lib/commonjs/specs/TurboUnistyles/NativeTurboUnistyles.js +1 -2
- package/lib/commonjs/specs/TurboUnistyles/NativeTurboUnistyles.js.map +1 -1
- package/lib/commonjs/specs/UnistylesRuntime/index.js +0 -2
- package/lib/commonjs/specs/UnistylesRuntime/index.js.map +1 -1
- package/lib/commonjs/specs/index.js +17 -36
- package/lib/commonjs/specs/index.js.map +1 -1
- package/lib/commonjs/specs/index.native.js +54 -0
- package/lib/commonjs/specs/index.native.js.map +1 -0
- package/lib/commonjs/types/stylesheet.js.map +1 -1
- package/lib/commonjs/utils.js +26 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/commonjs/web/convert/index.js +27 -24
- package/lib/commonjs/web/convert/index.js.map +1 -1
- package/lib/commonjs/web/convert/object/boxShadow.js +59 -0
- package/lib/commonjs/web/convert/object/boxShadow.js.map +1 -0
- package/lib/commonjs/web/convert/object/filter.js +42 -0
- package/lib/commonjs/web/convert/object/filter.js.map +1 -0
- package/lib/commonjs/web/convert/object/index.js +39 -0
- package/lib/commonjs/web/convert/object/index.js.map +1 -0
- package/lib/commonjs/web/convert/object/objectStyle.js +56 -0
- package/lib/commonjs/web/convert/object/objectStyle.js.map +1 -0
- package/lib/commonjs/web/convert/object/transform.js +27 -0
- package/lib/commonjs/web/convert/object/transform.js.map +1 -0
- package/lib/commonjs/web/convert/pseudo.js +10 -0
- package/lib/commonjs/web/convert/pseudo.js.map +1 -0
- package/lib/commonjs/web/convert/{boxShadow.js → shadow/boxShadow.js} +22 -37
- package/lib/commonjs/web/convert/shadow/boxShadow.js.map +1 -0
- package/lib/commonjs/web/convert/shadow/getShadowBreakpoints.js +38 -0
- package/lib/commonjs/web/convert/shadow/getShadowBreakpoints.js.map +1 -0
- package/lib/commonjs/web/convert/shadow/index.js +28 -0
- package/lib/commonjs/web/convert/shadow/index.js.map +1 -0
- package/lib/commonjs/web/convert/{textShadow.js → shadow/textShadow.js} +21 -35
- package/lib/commonjs/web/convert/shadow/textShadow.js.map +1 -0
- package/lib/commonjs/web/convert/style.js +11 -7
- package/lib/commonjs/web/convert/style.js.map +1 -1
- package/lib/commonjs/web/convert/types.js.map +1 -1
- package/lib/commonjs/web/convert/utils.js +8 -4
- package/lib/commonjs/web/convert/utils.js.map +1 -1
- package/lib/commonjs/web/create.js +21 -74
- package/lib/commonjs/web/create.js.map +1 -1
- package/lib/commonjs/web/index.js +18 -7
- package/lib/commonjs/web/index.js.map +1 -1
- package/lib/commonjs/web/listener.js +61 -0
- package/lib/commonjs/web/listener.js.map +1 -0
- package/lib/commonjs/web/mock.js +2 -12
- package/lib/commonjs/web/mock.js.map +1 -1
- package/lib/commonjs/web/registry.js +161 -19
- package/lib/commonjs/web/registry.js.map +1 -1
- package/lib/commonjs/web/runtime.js +25 -14
- package/lib/commonjs/web/runtime.js.map +1 -1
- package/lib/commonjs/web/shadowRegistry.js +150 -0
- package/lib/commonjs/web/shadowRegistry.js.map +1 -0
- package/lib/commonjs/web/state.js +31 -72
- package/lib/commonjs/web/state.js.map +1 -1
- package/lib/commonjs/web/utils/common.js +39 -0
- package/lib/commonjs/web/utils/common.js.map +1 -0
- package/lib/commonjs/web/utils/index.js +28 -0
- package/lib/commonjs/web/utils/index.js.map +1 -0
- package/lib/commonjs/web/utils/unistyle.js +77 -0
- package/lib/commonjs/web/utils/unistyle.js.map +1 -0
- package/lib/commonjs/web/{variants/getVariants.js → variants.js} +2 -2
- package/lib/commonjs/web/variants.js.map +1 -0
- package/lib/module/components/Display.js +13 -0
- package/lib/module/components/Display.js.map +1 -0
- package/lib/module/components/Hide.js +13 -0
- package/lib/module/components/Hide.js.map +1 -0
- package/lib/module/components/ScopedTheme.js +29 -0
- package/lib/module/components/ScopedTheme.js.map +1 -0
- package/lib/module/components/Variants.js +26 -0
- package/lib/module/components/Variants.js.map +1 -0
- package/lib/module/components/index.js +7 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/components/native/ActivityIndicator.js +6 -0
- package/lib/module/components/native/ActivityIndicator.js.map +1 -0
- package/lib/module/components/native/FlatList.js +6 -0
- package/lib/module/components/native/FlatList.js.map +1 -0
- package/lib/module/components/native/Image.js +6 -0
- package/lib/module/components/native/Image.js.map +1 -0
- package/lib/module/components/native/ImageBackground.js +6 -0
- package/lib/module/components/native/ImageBackground.js.map +1 -0
- package/lib/module/components/native/KeyboardAvoidingView.js +6 -0
- package/lib/module/components/native/KeyboardAvoidingView.js.map +1 -0
- package/lib/module/components/native/Pressable.js +69 -0
- package/lib/module/components/native/Pressable.js.map +1 -0
- package/lib/module/components/native/Pressable.native.js +42 -0
- package/lib/module/components/native/Pressable.native.js.map +1 -0
- package/lib/module/components/native/RefreshControl.js +6 -0
- package/lib/module/components/native/RefreshControl.js.map +1 -0
- package/lib/module/components/native/ScrollView.js +6 -0
- package/lib/module/components/native/ScrollView.js.map +1 -0
- package/lib/module/components/native/SectionList.js +6 -0
- package/lib/module/components/native/SectionList.js.map +1 -0
- package/lib/module/components/native/Switch.js +6 -0
- package/lib/module/components/native/Switch.js.map +1 -0
- package/lib/module/components/native/Text.js +6 -0
- package/lib/module/components/native/Text.js.map +1 -0
- package/lib/module/components/native/TextInput.js +6 -0
- package/lib/module/components/native/TextInput.js.map +1 -0
- package/lib/module/components/native/TouchableHighlight.js +6 -0
- package/lib/module/components/native/TouchableHighlight.js.map +1 -0
- package/lib/module/components/native/TouchableOpacity.js +6 -0
- package/lib/module/components/native/TouchableOpacity.js.map +1 -0
- package/lib/module/components/native/View.js +6 -0
- package/lib/module/components/native/View.js.map +1 -0
- package/lib/module/components/native/VirtualizedList.js +6 -0
- package/lib/module/components/native/VirtualizedList.js.map +1 -0
- package/lib/module/core/createUnistylesComponent.js +11 -0
- package/lib/module/core/createUnistylesComponent.js.map +1 -0
- package/lib/module/core/createUnistylesElement.js +10 -0
- package/lib/module/core/createUnistylesElement.js.map +1 -0
- package/lib/module/core/createUnistylesImageBackground.js +21 -0
- package/lib/module/core/createUnistylesImageBackground.js.map +1 -0
- package/lib/module/core/index.js +8 -0
- package/lib/module/core/index.js.map +1 -0
- package/lib/module/core/passForwardRef.js +22 -0
- package/lib/module/core/passForwardRef.js.map +1 -0
- package/lib/module/core/withUnistyles/index.js +4 -0
- package/lib/module/core/withUnistyles/index.js.map +1 -0
- package/lib/module/core/withUnistyles/types.js +4 -0
- package/lib/module/core/withUnistyles/types.js.map +1 -0
- package/lib/module/core/withUnistyles/useDependencies.js +75 -0
- package/lib/module/core/withUnistyles/useDependencies.js.map +1 -0
- package/lib/module/core/withUnistyles/withUnistyles.js +81 -0
- package/lib/module/core/withUnistyles/withUnistyles.js.map +1 -0
- package/lib/module/core/withUnistyles/withUnistyles.native.js +89 -0
- package/lib/module/core/withUnistyles/withUnistyles.native.js.map +1 -0
- package/lib/module/hooks/index.js +4 -0
- package/lib/module/hooks/index.js.map +1 -0
- package/lib/module/hooks/useMedia.js +38 -0
- package/lib/module/hooks/useMedia.js.map +1 -0
- package/lib/module/hooks/useMedia.native.js +55 -0
- package/lib/module/hooks/useMedia.native.js.map +1 -0
- package/lib/module/index.js +2 -9
- package/lib/module/index.js.map +1 -1
- package/lib/module/mq.js +27 -17
- package/lib/module/mq.js.map +1 -1
- package/lib/module/specs/NativePlatform/NativePlatform.nitro.js +1 -0
- package/lib/module/specs/NativePlatform/NativePlatform.nitro.js.map +1 -1
- package/lib/module/specs/NavigtionBar/index.js +0 -10
- package/lib/module/specs/NavigtionBar/index.js.map +1 -1
- package/lib/module/specs/ShadowRegistry/index.js +12 -9
- package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/module/specs/StatusBar/index.js +1 -6
- package/lib/module/specs/StatusBar/index.js.map +1 -1
- package/lib/module/specs/StyleSheet/index.js +1 -0
- package/lib/module/specs/StyleSheet/index.js.map +1 -1
- package/lib/module/specs/TurboUnistyles/NativeTurboUnistyles.js +1 -2
- package/lib/module/specs/TurboUnistyles/NativeTurboUnistyles.js.map +1 -1
- package/lib/module/specs/UnistylesRuntime/index.js +0 -2
- package/lib/module/specs/UnistylesRuntime/index.js.map +1 -1
- package/lib/module/specs/index.js +2 -7
- package/lib/module/specs/index.js.map +1 -1
- package/lib/module/specs/index.native.js +11 -0
- package/lib/module/specs/index.native.js.map +1 -0
- package/lib/module/types/stylesheet.js.map +1 -1
- package/lib/module/utils.js +21 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/module/web/convert/index.js +23 -20
- package/lib/module/web/convert/index.js.map +1 -1
- package/lib/module/web/convert/object/boxShadow.js +54 -0
- package/lib/module/web/convert/object/boxShadow.js.map +1 -0
- package/lib/module/web/convert/object/filter.js +37 -0
- package/lib/module/web/convert/object/filter.js.map +1 -0
- package/lib/module/web/convert/object/index.js +6 -0
- package/lib/module/web/convert/object/index.js.map +1 -0
- package/lib/module/web/convert/object/objectStyle.js +51 -0
- package/lib/module/web/convert/object/objectStyle.js.map +1 -0
- package/lib/module/web/convert/object/transform.js +22 -0
- package/lib/module/web/convert/object/transform.js.map +1 -0
- package/lib/module/web/convert/pseudo.js +5 -0
- package/lib/module/web/convert/pseudo.js.map +1 -0
- package/lib/module/web/convert/shadow/boxShadow.js +57 -0
- package/lib/module/web/convert/shadow/boxShadow.js.map +1 -0
- package/lib/module/web/convert/shadow/getShadowBreakpoints.js +33 -0
- package/lib/module/web/convert/shadow/getShadowBreakpoints.js.map +1 -0
- package/lib/module/web/convert/shadow/index.js +5 -0
- package/lib/module/web/convert/shadow/index.js.map +1 -0
- package/lib/module/web/convert/shadow/textShadow.js +54 -0
- package/lib/module/web/convert/shadow/textShadow.js.map +1 -0
- package/lib/module/web/convert/style.js +11 -7
- package/lib/module/web/convert/style.js.map +1 -1
- package/lib/module/web/convert/types.js.map +1 -1
- package/lib/module/web/convert/utils.js +5 -3
- package/lib/module/web/convert/utils.js.map +1 -1
- package/lib/module/web/create.js +22 -75
- package/lib/module/web/create.js.map +1 -1
- package/lib/module/web/index.js +10 -4
- package/lib/module/web/index.js.map +1 -1
- package/lib/module/web/listener.js +57 -0
- package/lib/module/web/listener.js.map +1 -0
- package/lib/module/web/mock.js +1 -11
- package/lib/module/web/mock.js.map +1 -1
- package/lib/module/web/registry.js +162 -20
- package/lib/module/web/registry.js.map +1 -1
- package/lib/module/web/runtime.js +25 -14
- package/lib/module/web/runtime.js.map +1 -1
- package/lib/module/web/shadowRegistry.js +146 -0
- package/lib/module/web/shadowRegistry.js.map +1 -0
- package/lib/module/web/state.js +32 -73
- package/lib/module/web/state.js.map +1 -1
- package/lib/module/web/utils/common.js +28 -0
- package/lib/module/web/utils/common.js.map +1 -0
- package/lib/module/web/utils/index.js +5 -0
- package/lib/module/web/utils/index.js.map +1 -0
- package/lib/module/web/utils/unistyle.js +65 -0
- package/lib/module/web/utils/unistyle.js.map +1 -0
- package/lib/module/web/{variants/getVariants.js → variants.js} +2 -2
- package/lib/module/web/variants.js.map +1 -0
- package/lib/typescript/src/components/Display.d.ts +7 -0
- package/lib/typescript/src/components/Display.d.ts.map +1 -0
- package/lib/typescript/src/components/Hide.d.ts +7 -0
- package/lib/typescript/src/components/Hide.d.ts.map +1 -0
- package/lib/typescript/src/components/ScopedTheme.d.ts +8 -0
- package/lib/typescript/src/components/ScopedTheme.d.ts.map +1 -0
- package/lib/typescript/src/components/Variants.d.ts +7 -0
- package/lib/typescript/src/components/Variants.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts +5 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -0
- package/lib/typescript/src/components/native/ActivityIndicator.d.ts +2 -0
- package/lib/typescript/src/components/native/ActivityIndicator.d.ts.map +1 -0
- package/lib/typescript/src/components/native/FlatList.d.ts +2 -0
- package/lib/typescript/src/components/native/FlatList.d.ts.map +1 -0
- package/lib/typescript/src/components/native/Image.d.ts +2 -0
- package/lib/typescript/src/components/native/Image.d.ts.map +1 -0
- package/lib/typescript/src/components/native/ImageBackground.d.ts +3 -0
- package/lib/typescript/src/components/native/ImageBackground.d.ts.map +1 -0
- package/lib/typescript/src/components/native/KeyboardAvoidingView.d.ts +2 -0
- package/lib/typescript/src/components/native/KeyboardAvoidingView.d.ts.map +1 -0
- package/lib/typescript/src/components/native/Pressable.d.ts +15 -0
- package/lib/typescript/src/components/native/Pressable.d.ts.map +1 -0
- package/lib/typescript/src/components/native/Pressable.native.d.ts +6 -0
- package/lib/typescript/src/components/native/Pressable.native.d.ts.map +1 -0
- package/lib/typescript/src/components/native/RefreshControl.d.ts +2 -0
- package/lib/typescript/src/components/native/RefreshControl.d.ts.map +1 -0
- package/lib/typescript/src/components/native/ScrollView.d.ts +2 -0
- package/lib/typescript/src/components/native/ScrollView.d.ts.map +1 -0
- package/lib/typescript/src/components/native/SectionList.d.ts +2 -0
- package/lib/typescript/src/components/native/SectionList.d.ts.map +1 -0
- package/lib/typescript/src/components/native/Switch.d.ts +2 -0
- package/lib/typescript/src/components/native/Switch.d.ts.map +1 -0
- package/lib/typescript/src/components/native/Text.d.ts +2 -0
- package/lib/typescript/src/components/native/Text.d.ts.map +1 -0
- package/lib/typescript/src/components/native/TextInput.d.ts +2 -0
- package/lib/typescript/src/components/native/TextInput.d.ts.map +1 -0
- package/lib/typescript/src/components/native/TouchableHighlight.d.ts +2 -0
- package/lib/typescript/src/components/native/TouchableHighlight.d.ts.map +1 -0
- package/lib/typescript/src/components/native/TouchableOpacity.d.ts +2 -0
- package/lib/typescript/src/components/native/TouchableOpacity.d.ts.map +1 -0
- package/lib/typescript/src/components/native/View.d.ts +2 -0
- package/lib/typescript/src/components/native/View.d.ts.map +1 -0
- package/lib/typescript/src/components/native/VirtualizedList.d.ts +2 -0
- package/lib/typescript/src/components/native/VirtualizedList.d.ts.map +1 -0
- package/lib/typescript/src/core/createUnistylesComponent.d.ts +14 -0
- package/lib/typescript/src/core/createUnistylesComponent.d.ts.map +1 -0
- package/lib/typescript/src/core/createUnistylesElement.d.ts +3 -0
- package/lib/typescript/src/core/createUnistylesElement.d.ts.map +1 -0
- package/lib/typescript/src/core/createUnistylesImageBackground.d.ts +4 -0
- package/lib/typescript/src/core/createUnistylesImageBackground.d.ts.map +1 -0
- package/lib/typescript/src/core/index.d.ts +6 -0
- package/lib/typescript/src/core/index.d.ts.map +1 -0
- package/lib/typescript/src/core/passForwardRef.d.ts +3 -0
- package/lib/typescript/src/core/passForwardRef.d.ts.map +1 -0
- package/lib/typescript/src/core/withUnistyles/index.d.ts +2 -0
- package/lib/typescript/src/core/withUnistyles/index.d.ts.map +1 -0
- package/lib/typescript/src/core/withUnistyles/types.d.ts +6 -0
- package/lib/typescript/src/core/withUnistyles/types.d.ts.map +1 -0
- package/lib/typescript/src/core/withUnistyles/useDependencies.d.ts +13 -0
- package/lib/typescript/src/core/withUnistyles/useDependencies.d.ts.map +1 -0
- package/lib/typescript/src/core/withUnistyles/withUnistyles.d.ts +11 -0
- package/lib/typescript/src/core/withUnistyles/withUnistyles.d.ts.map +1 -0
- package/lib/typescript/src/core/withUnistyles/withUnistyles.native.d.ts +8 -0
- package/lib/typescript/src/core/withUnistyles/withUnistyles.native.d.ts.map +1 -0
- package/lib/typescript/src/hooks/index.d.ts +2 -0
- package/lib/typescript/src/hooks/index.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useMedia.d.ts +6 -0
- package/lib/typescript/src/hooks/useMedia.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useMedia.native.d.ts +6 -0
- package/lib/typescript/src/hooks/useMedia.native.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mq.d.ts +8 -0
- package/lib/typescript/src/mq.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts +8 -6
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.d.ts +0 -1
- package/lib/typescript/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/NavigtionBar/index.d.ts +1 -10
- package/lib/typescript/src/specs/NavigtionBar/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts +9 -4
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/ShadowRegistry/types.d.ts +21 -0
- package/lib/typescript/src/specs/ShadowRegistry/types.d.ts.map +1 -1
- package/lib/typescript/src/specs/StatusBar/UnistylesStatusBar.nitro.d.ts +0 -1
- package/lib/typescript/src/specs/StatusBar/UnistylesStatusBar.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/StatusBar/index.d.ts +2 -4
- package/lib/typescript/src/specs/StatusBar/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts +3 -1
- package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/StyleSheet/index.d.ts +5 -3
- package/lib/typescript/src/specs/StyleSheet/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.d.ts +1 -1
- package/lib/typescript/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts +4 -2
- package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/index.d.ts +3 -9
- package/lib/typescript/src/specs/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/index.native.d.ts +12 -0
- package/lib/typescript/src/specs/index.native.d.ts.map +1 -0
- package/lib/typescript/src/types/breakpoints.d.ts +11 -11
- package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
- package/lib/typescript/src/types/common.d.ts +2 -0
- package/lib/typescript/src/types/common.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +2 -2
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/types/stylesheet.d.ts +6 -4
- package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
- package/lib/typescript/src/types/variants.d.ts +4 -1
- package/lib/typescript/src/types/variants.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts +2 -0
- package/lib/typescript/src/utils.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/index.d.ts +1 -2
- package/lib/typescript/src/web/convert/index.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/object/boxShadow.d.ts +9 -0
- package/lib/typescript/src/web/convert/object/boxShadow.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/object/filter.d.ts +3 -0
- package/lib/typescript/src/web/convert/object/filter.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/object/index.d.ts +4 -0
- package/lib/typescript/src/web/convert/object/index.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/object/objectStyle.d.ts +5 -0
- package/lib/typescript/src/web/convert/object/objectStyle.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/object/transform.d.ts +3 -0
- package/lib/typescript/src/web/convert/object/transform.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/pseudo.d.ts +6 -0
- package/lib/typescript/src/web/convert/pseudo.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/shadow/boxShadow.d.ts +8 -0
- package/lib/typescript/src/web/convert/shadow/boxShadow.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/shadow/getShadowBreakpoints.d.ts +2 -0
- package/lib/typescript/src/web/convert/shadow/getShadowBreakpoints.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/shadow/index.d.ts +3 -0
- package/lib/typescript/src/web/convert/shadow/index.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/shadow/textShadow.d.ts +8 -0
- package/lib/typescript/src/web/convert/shadow/textShadow.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/style.d.ts +1 -2
- package/lib/typescript/src/web/convert/style.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/types.d.ts +7 -1
- package/lib/typescript/src/web/convert/types.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/utils.d.ts +8 -4
- package/lib/typescript/src/web/convert/utils.d.ts.map +1 -1
- package/lib/typescript/src/web/create.d.ts +1 -2447
- package/lib/typescript/src/web/create.d.ts.map +1 -1
- package/lib/typescript/src/web/index.d.ts +10 -2448
- package/lib/typescript/src/web/index.d.ts.map +1 -1
- package/lib/typescript/src/web/{listener/listener.d.ts → listener.d.ts} +5 -2
- package/lib/typescript/src/web/listener.d.ts.map +1 -0
- package/lib/typescript/src/web/mock.d.ts +0 -9
- package/lib/typescript/src/web/mock.d.ts.map +1 -1
- package/lib/typescript/src/web/registry.d.ts +17 -6
- package/lib/typescript/src/web/registry.d.ts.map +1 -1
- package/lib/typescript/src/web/runtime.d.ts +6 -5
- package/lib/typescript/src/web/runtime.d.ts.map +1 -1
- package/lib/typescript/src/web/shadowRegistry.d.ts +25 -0
- package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -0
- package/lib/typescript/src/web/state.d.ts +3 -9
- package/lib/typescript/src/web/state.d.ts.map +1 -1
- package/lib/typescript/src/web/utils/common.d.ts +8 -0
- package/lib/typescript/src/web/utils/common.d.ts.map +1 -0
- package/lib/typescript/src/web/utils/index.d.ts +3 -0
- package/lib/typescript/src/web/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/web/utils/unistyle.d.ts +18 -0
- package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -0
- package/lib/typescript/src/web/{variants/getVariants.d.ts → variants.d.ts} +2 -2
- package/lib/typescript/src/web/variants.d.ts.map +1 -0
- package/nitrogen/generated/android/c++/JColorScheme.hpp +2 -2
- package/nitrogen/generated/android/c++/JFunc_void_UnistylesNativeMiniRuntime.hpp +57 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.hpp +69 -0
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +35 -34
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.hpp +15 -6
- package/nitrogen/generated/android/c++/JOrientation.hpp +2 -2
- package/nitrogen/generated/android/c++/JUnistyleDependency.hpp +5 -2
- package/nitrogen/generated/android/c++/JUnistylesNativeMiniRuntime.hpp +9 -7
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/ColorScheme.kt +5 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Dimensions.kt +1 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/{Func_void_std__vector_UnistyleDependency_.kt → Func_void_UnistylesNativeMiniRuntime.kt} +6 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +25 -13
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Insets.kt +1 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Orientation.kt +5 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistyleDependency.kt +6 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistylesNativeMiniRuntime.kt +3 -1
- package/nitrogen/generated/android/unistyles+autolinking.cmake +13 -1
- package/nitrogen/generated/android/unistyles+autolinking.gradle +2 -0
- package/nitrogen/generated/android/{UnistylesOnLoad.cpp → unistylesOnLoad.cpp} +6 -4
- package/nitrogen/generated/android/{UnistylesOnLoad.hpp → unistylesOnLoad.hpp} +1 -1
- package/nitrogen/generated/ios/Unistyles+autolinking.rb +6 -4
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.cpp +25 -0
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +73 -38
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +4 -30
- package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.hpp +8 -8
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +4 -16
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpecCxx.swift +156 -115
- package/nitrogen/generated/ios/swift/UnistyleDependency.swift +4 -0
- package/nitrogen/generated/ios/swift/UnistylesNativeMiniRuntime.swift +16 -5
- package/nitrogen/generated/shared/c++/ColorScheme.hpp +2 -2
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.cpp +2 -2
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.hpp +6 -3
- package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.cpp +0 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.hpp +3 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.hpp +5 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesShadowRegistrySpec.hpp +3 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.cpp +0 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.hpp +3 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +2 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +10 -4
- package/nitrogen/generated/shared/c++/Orientation.hpp +2 -2
- package/nitrogen/generated/shared/c++/UnistyleDependency.hpp +2 -1
- package/nitrogen/generated/shared/c++/UnistylesCxxMiniRuntime.hpp +10 -9
- package/nitrogen/generated/shared/c++/UnistylesNativeMiniRuntime.hpp +9 -8
- package/package.json +25 -38
- package/plugin/common.js +30 -7
- package/plugin/import.js +69 -6
- package/plugin/index.js +142 -33
- package/plugin/ref.js +0 -200
- package/plugin/style.js +130 -9
- package/plugin/stylesheet.js +35 -13
- package/plugin/variants.js +54 -1
- package/src/components/Display.tsx +12 -0
- package/src/components/Hide.tsx +12 -0
- package/src/components/ScopedTheme.tsx +32 -0
- package/src/components/Variants.tsx +29 -0
- package/src/components/index.ts +4 -0
- package/src/components/native/ActivityIndicator.tsx +4 -0
- package/src/components/native/FlatList.tsx +4 -0
- package/src/components/native/Image.tsx +4 -0
- package/src/components/native/ImageBackground.tsx +4 -0
- package/src/components/native/KeyboardAvoidingView.tsx +4 -0
- package/src/components/native/Pressable.native.tsx +55 -0
- package/src/components/native/Pressable.tsx +98 -0
- package/src/components/native/RefreshControl.tsx +4 -0
- package/src/components/native/ScrollView.tsx +4 -0
- package/src/components/native/SectionList.tsx +4 -0
- package/src/components/native/Switch.tsx +4 -0
- package/src/components/native/Text.tsx +4 -0
- package/src/components/native/TextInput.tsx +4 -0
- package/src/components/native/TouchableHighlight.tsx +4 -0
- package/src/components/native/TouchableOpacity.tsx +4 -0
- package/src/components/native/View.tsx +4 -0
- package/src/components/native/VirtualizedList.tsx +4 -0
- package/src/core/createUnistylesComponent.tsx +14 -0
- package/src/core/createUnistylesElement.tsx +9 -0
- package/src/core/createUnistylesImageBackground.tsx +24 -0
- package/src/core/index.ts +5 -0
- package/src/core/passForwardRef.ts +29 -0
- package/src/core/withUnistyles/index.ts +1 -0
- package/src/core/withUnistyles/types.ts +7 -0
- package/src/core/withUnistyles/useDependencies.ts +93 -0
- package/src/core/withUnistyles/withUnistyles.native.tsx +96 -0
- package/src/core/withUnistyles/withUnistyles.tsx +90 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useMedia.native.ts +65 -0
- package/src/hooks/useMedia.ts +47 -0
- package/src/index.ts +3 -12
- package/src/mq.ts +33 -15
- package/src/specs/NativePlatform/NativePlatform.nitro.ts +8 -6
- package/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.ts +0 -1
- package/src/specs/NavigtionBar/index.ts +1 -25
- package/src/specs/ShadowRegistry/index.ts +26 -12
- package/src/specs/ShadowRegistry/types.ts +24 -3
- package/src/specs/StatusBar/UnistylesStatusBar.nitro.ts +0 -1
- package/src/specs/StatusBar/index.ts +2 -12
- package/src/specs/StyleSheet/UnistylesStyleSheet.nitro.ts +4 -1
- package/src/specs/StyleSheet/index.ts +7 -3
- package/src/specs/TurboUnistyles/NativeTurboUnistyles.ts +1 -2
- package/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.ts +2 -2
- package/src/specs/UnistylesRuntime/index.ts +4 -3
- package/src/specs/index.native.ts +27 -0
- package/src/specs/index.ts +3 -23
- package/src/types/breakpoints.ts +25 -13
- package/src/types/common.ts +2 -0
- package/src/types/index.ts +2 -2
- package/src/types/stylesheet.ts +7 -5
- package/src/types/variants.ts +7 -1
- package/src/utils.ts +22 -0
- package/src/web/convert/index.ts +24 -24
- package/src/web/convert/object/boxShadow.ts +55 -0
- package/src/web/convert/object/filter.ts +39 -0
- package/src/web/convert/object/index.ts +3 -0
- package/src/web/convert/object/objectStyle.ts +69 -0
- package/src/web/convert/object/transform.ts +24 -0
- package/src/web/convert/pseudo.ts +137 -0
- package/src/web/convert/shadow/boxShadow.ts +50 -0
- package/src/web/convert/shadow/getShadowBreakpoints.ts +34 -0
- package/src/web/convert/shadow/index.ts +2 -0
- package/src/web/convert/shadow/textShadow.ts +48 -0
- package/src/web/convert/style.ts +61 -10
- package/src/web/convert/types.ts +8 -1
- package/src/web/convert/utils.ts +13 -7
- package/src/web/create.ts +22 -88
- package/src/web/index.ts +12 -6
- package/src/web/listener.ts +65 -0
- package/src/web/mock.ts +1 -12
- package/src/web/registry.ts +211 -28
- package/src/web/runtime.ts +31 -18
- package/src/web/shadowRegistry.ts +163 -0
- package/src/web/state.ts +52 -87
- package/src/web/utils/common.ts +45 -0
- package/src/web/utils/index.ts +2 -0
- package/src/web/utils/unistyle.ts +93 -0
- package/src/web/{variants/getVariants.ts → variants.ts} +2 -2
- package/android/src/main/cxx/helpers.cpp +0 -105
- package/android/src/main/cxx/helpers.h +0 -16
- package/android/src/main/cxx/platform.cpp +0 -170
- package/android/src/main/cxx/platform.h +0 -20
- package/lib/commonjs/specs/index.web.js +0 -24
- package/lib/commonjs/specs/index.web.js.map +0 -1
- package/lib/commonjs/web/convert/boxShadow.js.map +0 -1
- package/lib/commonjs/web/convert/breakpoint.js +0 -25
- package/lib/commonjs/web/convert/breakpoint.js.map +0 -1
- package/lib/commonjs/web/convert/shadow.js +0 -68
- package/lib/commonjs/web/convert/shadow.js.map +0 -1
- package/lib/commonjs/web/convert/textShadow.js.map +0 -1
- package/lib/commonjs/web/convert/transform.js +0 -72
- package/lib/commonjs/web/convert/transform.js.map +0 -1
- package/lib/commonjs/web/listener/index.js +0 -13
- package/lib/commonjs/web/listener/index.js.map +0 -1
- package/lib/commonjs/web/listener/listener.js +0 -36
- package/lib/commonjs/web/listener/listener.js.map +0 -1
- package/lib/commonjs/web/mq.js +0 -23
- package/lib/commonjs/web/mq.js.map +0 -1
- package/lib/commonjs/web/pseudo.js +0 -11
- package/lib/commonjs/web/pseudo.js.map +0 -1
- package/lib/commonjs/web/utils.js +0 -78
- package/lib/commonjs/web/utils.js.map +0 -1
- package/lib/commonjs/web/variants/getVariants.js.map +0 -1
- package/lib/commonjs/web/variants/index.js +0 -28
- package/lib/commonjs/web/variants/index.js.map +0 -1
- package/lib/commonjs/web/variants/useVariants.js +0 -75
- package/lib/commonjs/web/variants/useVariants.js.map +0 -1
- package/lib/module/specs/index.web.js +0 -5
- package/lib/module/specs/index.web.js.map +0 -1
- package/lib/module/web/convert/boxShadow.js +0 -72
- package/lib/module/web/convert/boxShadow.js.map +0 -1
- package/lib/module/web/convert/breakpoint.js +0 -20
- package/lib/module/web/convert/breakpoint.js.map +0 -1
- package/lib/module/web/convert/shadow.js +0 -63
- package/lib/module/web/convert/shadow.js.map +0 -1
- package/lib/module/web/convert/textShadow.js +0 -68
- package/lib/module/web/convert/textShadow.js.map +0 -1
- package/lib/module/web/convert/transform.js +0 -67
- package/lib/module/web/convert/transform.js.map +0 -1
- package/lib/module/web/listener/index.js +0 -4
- package/lib/module/web/listener/index.js.map +0 -1
- package/lib/module/web/listener/listener.js +0 -31
- package/lib/module/web/listener/listener.js.map +0 -1
- package/lib/module/web/mq.js +0 -17
- package/lib/module/web/mq.js.map +0 -1
- package/lib/module/web/pseudo.js +0 -6
- package/lib/module/web/pseudo.js.map +0 -1
- package/lib/module/web/utils.js +0 -65
- package/lib/module/web/utils.js.map +0 -1
- package/lib/module/web/variants/getVariants.js.map +0 -1
- package/lib/module/web/variants/index.js +0 -5
- package/lib/module/web/variants/index.js.map +0 -1
- package/lib/module/web/variants/useVariants.js +0 -70
- package/lib/module/web/variants/useVariants.js.map +0 -1
- package/lib/typescript/example/App.d.ts +0 -4
- package/lib/typescript/example/App.d.ts.map +0 -1
- package/lib/typescript/example/Typography.d.ts +0 -11
- package/lib/typescript/example/Typography.d.ts.map +0 -1
- package/lib/typescript/example/unistyles.d.ts +0 -63
- package/lib/typescript/example/unistyles.d.ts.map +0 -1
- package/lib/typescript/expo-example/App.d.ts +0 -4
- package/lib/typescript/expo-example/App.d.ts.map +0 -1
- package/lib/typescript/expo-example/unistyles.d.ts +0 -63
- package/lib/typescript/expo-example/unistyles.d.ts.map +0 -1
- package/lib/typescript/src/specs/index.web.d.ts +0 -4
- package/lib/typescript/src/specs/index.web.d.ts.map +0 -1
- package/lib/typescript/src/web/convert/boxShadow.d.ts +0 -3
- package/lib/typescript/src/web/convert/boxShadow.d.ts.map +0 -1
- package/lib/typescript/src/web/convert/breakpoint.d.ts +0 -3
- package/lib/typescript/src/web/convert/breakpoint.d.ts.map +0 -1
- package/lib/typescript/src/web/convert/shadow.d.ts +0 -2
- package/lib/typescript/src/web/convert/shadow.d.ts.map +0 -1
- package/lib/typescript/src/web/convert/textShadow.d.ts +0 -3
- package/lib/typescript/src/web/convert/textShadow.d.ts.map +0 -1
- package/lib/typescript/src/web/convert/transform.d.ts +0 -5
- package/lib/typescript/src/web/convert/transform.d.ts.map +0 -1
- package/lib/typescript/src/web/listener/index.d.ts +0 -2
- package/lib/typescript/src/web/listener/index.d.ts.map +0 -1
- package/lib/typescript/src/web/listener/listener.d.ts.map +0 -1
- package/lib/typescript/src/web/mq.d.ts +0 -4
- package/lib/typescript/src/web/mq.d.ts.map +0 -1
- package/lib/typescript/src/web/pseudo.d.ts +0 -4
- package/lib/typescript/src/web/pseudo.d.ts.map +0 -1
- package/lib/typescript/src/web/utils.d.ts +0 -20
- package/lib/typescript/src/web/utils.d.ts.map +0 -1
- package/lib/typescript/src/web/variants/getVariants.d.ts.map +0 -1
- package/lib/typescript/src/web/variants/index.d.ts +0 -3
- package/lib/typescript/src/web/variants/index.d.ts.map +0 -1
- package/lib/typescript/src/web/variants/useVariants.d.ts +0 -3
- package/lib/typescript/src/web/variants/useVariants.d.ts.map +0 -1
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency_.hpp +0 -60
- package/plugin/__tests__/dependencies.spec.js +0 -438
- package/plugin/__tests__/ref.spec.js +0 -1170
- package/plugin/__tests__/stylesheet.spec.js +0 -489
- package/src/specs/index.web.ts +0 -5
- package/src/web/convert/boxShadow.ts +0 -72
- package/src/web/convert/breakpoint.ts +0 -21
- package/src/web/convert/shadow.ts +0 -68
- package/src/web/convert/textShadow.ts +0 -69
- package/src/web/convert/transform.ts +0 -89
- package/src/web/listener/index.ts +0 -1
- package/src/web/listener/listener.ts +0 -33
- package/src/web/mq.ts +0 -19
- package/src/web/pseudo.ts +0 -11
- package/src/web/utils.ts +0 -95
- package/src/web/variants/index.ts +0 -2
- package/src/web/variants/useVariants.ts +0 -79
- /package/nitrogen/generated/android/{UnistylesOnLoad.kt → unistylesOnLoad.kt} +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["Hide","Display","Variants","ScopedTheme"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,QAAQ;AAC7B,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,WAAW,QAAQ,eAAe","ignoreList":[]}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { ActivityIndicator as NativeActivityIndicator } from 'react-native';
|
4
|
+
import { createUnistylesElement } from '../../core';
|
5
|
+
export const ActivityIndicator = createUnistylesElement(NativeActivityIndicator);
|
6
|
+
//# sourceMappingURL=ActivityIndicator.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["ActivityIndicator","NativeActivityIndicator","createUnistylesElement"],"sourceRoot":"../../../../src","sources":["components/native/ActivityIndicator.tsx"],"mappings":";;AAAA,SAASA,iBAAiB,IAAIC,uBAAuB,QAAQ,cAAc;AAC3E,SAASC,sBAAsB,QAAQ,YAAY;AAEnD,OAAO,MAAMF,iBAAiB,GAAGE,sBAAsB,CAACD,uBAAuB,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["FlatList","NativeFlatList","createUnistylesElement"],"sourceRoot":"../../../../src","sources":["components/native/FlatList.tsx"],"mappings":";;AAAA,SAASA,QAAQ,IAAIC,cAAc,QAAQ,cAAc;AACzD,SAASC,sBAAsB,QAAQ,YAAY;AAEnD,OAAO,MAAMF,QAAQ,GAAGE,sBAAsB,CAACD,cAAc,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["Image","NativeImage","createUnistylesElement"],"sourceRoot":"../../../../src","sources":["components/native/Image.tsx"],"mappings":";;AAAA,SAASA,KAAK,IAAIC,WAAW,QAAQ,cAAc;AACnD,SAASC,sBAAsB,QAAQ,YAAY;AAEnD,OAAO,MAAMF,KAAK,GAAGE,sBAAsB,CAACD,WAAW,CAAC","ignoreList":[]}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { ImageBackground as NativeImageBackground } from 'react-native';
|
4
|
+
import { createUnistylesImageBackground } from '../../core';
|
5
|
+
export const ImageBackground = createUnistylesImageBackground(NativeImageBackground);
|
6
|
+
//# sourceMappingURL=ImageBackground.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["ImageBackground","NativeImageBackground","createUnistylesImageBackground"],"sourceRoot":"../../../../src","sources":["components/native/ImageBackground.tsx"],"mappings":";;AAAA,SAASA,eAAe,IAAIC,qBAAqB,QAAQ,cAAc;AACvE,SAASC,8BAA8B,QAAQ,YAAY;AAE3D,OAAO,MAAMF,eAAe,GAAGE,8BAA8B,CAACD,qBAAqB,CAAC","ignoreList":[]}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { KeyboardAvoidingView as NativeKeyboardAvoidingView } from 'react-native';
|
4
|
+
import { createUnistylesElement } from '../../core';
|
5
|
+
export const KeyboardAvoidingView = createUnistylesElement(NativeKeyboardAvoidingView);
|
6
|
+
//# sourceMappingURL=KeyboardAvoidingView.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["KeyboardAvoidingView","NativeKeyboardAvoidingView","createUnistylesElement"],"sourceRoot":"../../../../src","sources":["components/native/KeyboardAvoidingView.tsx"],"mappings":";;AAAA,SAASA,oBAAoB,IAAIC,0BAA0B,QAAQ,cAAc;AACjF,SAASC,sBAAsB,QAAQ,YAAY;AAEnD,OAAO,MAAMF,oBAAoB,GAAGE,sBAAsB,CAACD,0BAA0B,CAAC","ignoreList":[]}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import React, { forwardRef, useRef } from 'react';
|
4
|
+
import { Pressable as NativePressableReactNative } from 'react-native';
|
5
|
+
import { UnistylesShadowRegistry } from '../../specs';
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
+
const initialState = {
|
8
|
+
pressed: false,
|
9
|
+
hovered: false,
|
10
|
+
focused: false
|
11
|
+
};
|
12
|
+
const extractStyleResult = style => {
|
13
|
+
return typeof style === 'function' ? [style()] : Array.isArray(style) ? style.map(style => typeof style === 'function' ? style() : style) : [style];
|
14
|
+
};
|
15
|
+
const updateStyles = ({
|
16
|
+
ref,
|
17
|
+
style,
|
18
|
+
state,
|
19
|
+
scopedTheme,
|
20
|
+
variants
|
21
|
+
}) => {
|
22
|
+
const styleResult = typeof style === 'function' ? style(state) : style;
|
23
|
+
const extractedResult = extractStyleResult(styleResult);
|
24
|
+
const previousScopedTheme = UnistylesShadowRegistry.getScopedTheme();
|
25
|
+
const previousVariants = UnistylesShadowRegistry.getVariants();
|
26
|
+
UnistylesShadowRegistry.selectVariants(variants);
|
27
|
+
UnistylesShadowRegistry.setScopedTheme(scopedTheme);
|
28
|
+
UnistylesShadowRegistry.add(ref, extractedResult);
|
29
|
+
UnistylesShadowRegistry.setScopedTheme(previousScopedTheme);
|
30
|
+
UnistylesShadowRegistry.selectVariants(previousVariants);
|
31
|
+
};
|
32
|
+
export const Pressable = /*#__PURE__*/forwardRef(({
|
33
|
+
style,
|
34
|
+
...props
|
35
|
+
}, passedRef) => {
|
36
|
+
const storedRef = useRef(null);
|
37
|
+
const scopedTheme = UnistylesShadowRegistry.getScopedTheme();
|
38
|
+
const variants = UnistylesShadowRegistry.getVariants();
|
39
|
+
return /*#__PURE__*/_jsx(NativePressableReactNative, {
|
40
|
+
...props,
|
41
|
+
style: state => {
|
42
|
+
if (!storedRef.current) {
|
43
|
+
return {};
|
44
|
+
}
|
45
|
+
updateStyles({
|
46
|
+
ref: storedRef.current,
|
47
|
+
style: style,
|
48
|
+
variants,
|
49
|
+
scopedTheme,
|
50
|
+
state: state
|
51
|
+
});
|
52
|
+
return {};
|
53
|
+
},
|
54
|
+
ref: ref => {
|
55
|
+
storedRef.current = ref;
|
56
|
+
updateStyles({
|
57
|
+
ref,
|
58
|
+
style: style,
|
59
|
+
variants,
|
60
|
+
scopedTheme,
|
61
|
+
state: initialState
|
62
|
+
});
|
63
|
+
if (typeof passedRef === 'object' && passedRef !== null) {
|
64
|
+
passedRef.current = ref;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
});
|
68
|
+
});
|
69
|
+
//# sourceMappingURL=Pressable.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useRef","Pressable","NativePressableReactNative","UnistylesShadowRegistry","jsx","_jsx","initialState","pressed","hovered","focused","extractStyleResult","style","Array","isArray","map","updateStyles","ref","state","scopedTheme","variants","styleResult","extractedResult","previousScopedTheme","getScopedTheme","previousVariants","getVariants","selectVariants","setScopedTheme","add","props","passedRef","storedRef","current"],"sourceRoot":"../../../../src","sources":["components/native/Pressable.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,MAAM,QAAQ,OAAO;AACjD,SAASC,SAAS,IAAIC,0BAA0B,QAAQ,cAAc;AAEtE,SAASC,uBAAuB,QAAQ,aAAa;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAgBrD,MAAMC,YAA+B,GAAG;EACpCC,OAAO,EAAE,KAAK;EACdC,OAAO,EAAE,KAAK;EACdC,OAAO,EAAE;AACb,CAAC;AAUD,MAAMC,kBAAkB,GAAIC,KAAU,IAAK;EACvC,OAAO,OAAOA,KAAK,KAAK,UAAU,GAC5B,CAACA,KAAK,CAAC,CAAC,CAAC,GACTC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,GAChBA,KAAK,CAACG,GAAG,CAACH,KAAK,IAAI,OAAOA,KAAK,KAAK,UAAU,GAAGA,KAAK,CAAC,CAAC,GAAGA,KAAK,CAAC,GACjE,CAACA,KAAK,CAAC;AACrB,CAAC;AAED,MAAMI,YAAY,GAAGA,CAAC;EAAEC,GAAG;EAAEL,KAAK;EAAEM,KAAK;EAAEC,WAAW;EAAEC;AAA4B,CAAC,KAAK;EACtF,MAAMC,WAAW,GAAG,OAAOT,KAAK,KAAK,UAAU,GACzCA,KAAK,CAACM,KAAK,CAAC,GACZN,KAAK;EACX,MAAMU,eAAe,GAAGX,kBAAkB,CAACU,WAAW,CAAC;EACvD,MAAME,mBAAmB,GAAGnB,uBAAuB,CAACoB,cAAc,CAAC,CAAC;EACpE,MAAMC,gBAAgB,GAAGrB,uBAAuB,CAACsB,WAAW,CAAC,CAAC;EAE9DtB,uBAAuB,CAACuB,cAAc,CAACP,QAA+B,CAAC;EACvEhB,uBAAuB,CAACwB,cAAc,CAACT,WAAkB,CAAC;EAE1Df,uBAAuB,CAACyB,GAAG,CAACZ,GAAG,EAAEK,eAAe,CAAC;EAEjDlB,uBAAuB,CAACwB,cAAc,CAACL,mBAAmB,CAAC;EAC3DnB,uBAAuB,CAACuB,cAAc,CAACF,gBAAuC,CAAC;AACnF,CAAC;AAED,OAAO,MAAMvB,SAAS,gBAAGF,UAAU,CAAuB,CAAC;EAAEY,KAAK;EAAE,GAAGkB;AAAM,CAAC,EAAEC,SAAS,KAAK;EAC1F,MAAMC,SAAS,GAAG/B,MAAM,CAAc,IAAI,CAAC;EAC3C,MAAMkB,WAAW,GAAGf,uBAAuB,CAACoB,cAAc,CAAC,CAAC;EAC5D,MAAMJ,QAAQ,GAAGhB,uBAAuB,CAACsB,WAAW,CAAC,CAAC;EAEtD,oBACIpB,IAAA,CAACH,0BAA0B;IAAA,GACnB2B,KAAK;IACTlB,KAAK,EAAEM,KAAK,IAAI;MACZ,IAAI,CAACc,SAAS,CAACC,OAAO,EAAE;QACpB,OAAO,CAAC,CAAC;MACb;MAEAjB,YAAY,CAAC;QACTC,GAAG,EAAEe,SAAS,CAACC,OAAO;QACtBrB,KAAK,EAAEA,KAA0B;QACjCQ,QAAQ;QACRD,WAAW;QACXD,KAAK,EAAEA;MACX,CAAC,CAAC;MAEF,OAAO,CAAC,CAAC;IACb,CAAE;IACFD,GAAG,EAAEA,GAAG,IAAI;MACRe,SAAS,CAACC,OAAO,GAAGhB,GAAG;MACvBD,YAAY,CAAC;QACTC,GAAG;QACHL,KAAK,EAAEA,KAA0B;QACjCQ,QAAQ;QACRD,WAAW;QACXD,KAAK,EAAEX;MACX,CAAC,CAAC;MAEF,IAAI,OAAOwB,SAAS,KAAK,QAAQ,IAAIA,SAAS,KAAK,IAAI,EAAE;QACrDA,SAAS,CAACE,OAAO,GAAGhB,GAAG;MAC3B;IACJ;EAAE,CACL,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import React, { forwardRef, useRef } from 'react';
|
4
|
+
import { Pressable as NativePressableReactNative } from 'react-native';
|
5
|
+
import { UnistylesShadowRegistry } from '../../specs';
|
6
|
+
import { passForwardedRef } from '../../core';
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
8
|
+
export const Pressable = /*#__PURE__*/forwardRef(({
|
9
|
+
variants,
|
10
|
+
style,
|
11
|
+
...props
|
12
|
+
}, forwardedRef) => {
|
13
|
+
const storedRef = useRef();
|
14
|
+
return /*#__PURE__*/_jsx(NativePressableReactNative, {
|
15
|
+
...props,
|
16
|
+
ref: ref => {
|
17
|
+
const unistyles = typeof style === 'function' ? style({
|
18
|
+
pressed: false
|
19
|
+
}) : style;
|
20
|
+
const styles = Array.isArray(unistyles) ? unistyles : [unistyles];
|
21
|
+
|
22
|
+
// @ts-expect-error - this is hidden from TS
|
23
|
+
UnistylesShadowRegistry.add(ref, styles);
|
24
|
+
storedRef.current = ref;
|
25
|
+
return passForwardedRef(props, ref, forwardedRef);
|
26
|
+
},
|
27
|
+
style: state => {
|
28
|
+
UnistylesShadowRegistry.selectVariants(variants);
|
29
|
+
const unistyles = typeof style === 'function' ? style(state) : style;
|
30
|
+
const styles = Array.isArray(unistyles) ? unistyles : [unistyles];
|
31
|
+
if (storedRef.current) {
|
32
|
+
// @ts-expect-error - this is hidden from TS
|
33
|
+
UnistylesShadowRegistry.remove(storedRef.current);
|
34
|
+
// @ts-expect-error - this is hidden from TS
|
35
|
+
UnistylesShadowRegistry.add(storedRef.current, styles);
|
36
|
+
}
|
37
|
+
UnistylesShadowRegistry.selectVariants(undefined);
|
38
|
+
return unistyles;
|
39
|
+
}
|
40
|
+
});
|
41
|
+
});
|
42
|
+
//# sourceMappingURL=Pressable.native.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useRef","Pressable","NativePressableReactNative","UnistylesShadowRegistry","passForwardedRef","jsx","_jsx","variants","style","props","forwardedRef","storedRef","ref","unistyles","pressed","styles","Array","isArray","add","current","state","selectVariants","remove","undefined"],"sourceRoot":"../../../../src","sources":["components/native/Pressable.native.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,MAAM,QAAQ,OAAO;AACjD,SAASC,SAAS,IAAIC,0BAA0B,QAAQ,cAAc;AAEtE,SAASC,uBAAuB,QAAQ,aAAa;AACrD,SAASC,gBAAgB,QAAQ,YAAY;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAM7C,OAAO,MAAML,SAAS,gBAAGF,UAAU,CAAuB,CAAC;EAAEQ,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,YAAY,KAAK;EACvG,MAAMC,SAAS,GAAGX,MAAM,CAAc,CAAC;EAEvC,oBACIM,IAAA,CAACJ,0BAA0B;IAAA,GACnBO,KAAK;IACTG,GAAG,EAAEA,GAAG,IAAI;MACR,MAAMC,SAAS,GAAG,OAAOL,KAAK,KAAK,UAAU,GACvCA,KAAK,CAAC;QAAEM,OAAO,EAAE;MAAM,CAAC,CAAC,GACzBN,KAAK;MACX,MAAMO,MAAM,GAAGC,KAAK,CAACC,OAAO,CAACJ,SAAS,CAAC,GACjCA,SAAS,GACT,CAACA,SAAS,CAAC;;MAEjB;MACAV,uBAAuB,CAACe,GAAG,CAACN,GAAG,EAAEG,MAAM,CAAC;MAExCJ,SAAS,CAACQ,OAAO,GAAGP,GAAG;MAEvB,OAAOR,gBAAgB,CAACK,KAAK,EAAEG,GAAG,EAAEF,YAAY,CAAC;IACrD,CAAE;IACFF,KAAK,EAAEY,KAAK,IAAI;MACZjB,uBAAuB,CAACkB,cAAc,CAACd,QAAQ,CAAC;MAEhD,MAAMM,SAAS,GAAG,OAAOL,KAAK,KAAK,UAAU,GACvCA,KAAK,CAACY,KAAK,CAAC,GACZZ,KAAK;MACX,MAAMO,MAAM,GAAGC,KAAK,CAACC,OAAO,CAACJ,SAAS,CAAC,GACjCA,SAAS,GACT,CAACA,SAAS,CAAC;MAEjB,IAAIF,SAAS,CAACQ,OAAO,EAAE;QACnB;QACAhB,uBAAuB,CAACmB,MAAM,CAACX,SAAS,CAACQ,OAAO,CAAC;QACjD;QACAhB,uBAAuB,CAACe,GAAG,CAACP,SAAS,CAACQ,OAAO,EAAEJ,MAAM,CAAC;MAC1D;MAEAZ,uBAAuB,CAACkB,cAAc,CAACE,SAAS,CAAC;MAEjD,OAAOV,SAAS;IACpB;EAAE,CACL,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["RefreshControl","NativeRefreshControl","createUnistylesElement"],"sourceRoot":"../../../../src","sources":["components/native/RefreshControl.tsx"],"mappings":";;AAAA,SAASA,cAAc,IAAIC,oBAAoB,QAAQ,cAAc;AACrE,SAASC,sBAAsB,QAAQ,YAAY;AAEnD,OAAO,MAAMF,cAAc,GAAGE,sBAAsB,CAACD,oBAAoB,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["ScrollView","NativeScrollView","createUnistylesElement"],"sourceRoot":"../../../../src","sources":["components/native/ScrollView.tsx"],"mappings":";;AAAA,SAASA,UAAU,IAAIC,gBAAgB,QAAQ,cAAc;AAC7D,SAASC,sBAAsB,QAAQ,YAAY;AAEnD,OAAO,MAAMF,UAAU,GAAGE,sBAAsB,CAACD,gBAAgB,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["SectionList","NativeSectionList","createUnistylesElement"],"sourceRoot":"../../../../src","sources":["components/native/SectionList.tsx"],"mappings":";;AAAA,SAASA,WAAW,IAAIC,iBAAiB,QAAQ,cAAc;AAC/D,SAASC,sBAAsB,QAAQ,YAAY;AAEnD,OAAO,MAAMF,WAAW,GAAGE,sBAAsB,CAACD,iBAAiB,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["Switch","NativeSwitch","createUnistylesElement"],"sourceRoot":"../../../../src","sources":["components/native/Switch.tsx"],"mappings":";;AAAA,SAASA,MAAM,IAAIC,YAAY,QAAQ,cAAc;AACrD,SAASC,sBAAsB,QAAQ,YAAY;AAEnD,OAAO,MAAMF,MAAM,GAAGE,sBAAsB,CAACD,YAAY,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["Text","NativeText","createUnistylesElement"],"sourceRoot":"../../../../src","sources":["components/native/Text.tsx"],"mappings":";;AAAA,SAASA,IAAI,IAAIC,UAAU,QAAQ,cAAc;AACjD,SAASC,sBAAsB,QAAQ,YAAY;AAEnD,OAAO,MAAMF,IAAI,GAAGE,sBAAsB,CAACD,UAAU,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["TextInput","NativeTextInput","createUnistylesElement"],"sourceRoot":"../../../../src","sources":["components/native/TextInput.tsx"],"mappings":";;AAAA,SAASA,SAAS,IAAIC,eAAe,QAAQ,cAAc;AAC3D,SAASC,sBAAsB,QAAQ,YAAY;AAEnD,OAAO,MAAMF,SAAS,GAAGE,sBAAsB,CAACD,eAAe,CAAC","ignoreList":[]}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { TouchableHighlight as NativeTouchableHighlight } from 'react-native';
|
4
|
+
import { createUnistylesElement } from '../../core';
|
5
|
+
export const TouchableHighlight = createUnistylesElement(NativeTouchableHighlight);
|
6
|
+
//# sourceMappingURL=TouchableHighlight.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["TouchableHighlight","NativeTouchableHighlight","createUnistylesElement"],"sourceRoot":"../../../../src","sources":["components/native/TouchableHighlight.tsx"],"mappings":";;AAAA,SAASA,kBAAkB,IAAIC,wBAAwB,QAAQ,cAAc;AAC7E,SAASC,sBAAsB,QAAQ,YAAY;AAEnD,OAAO,MAAMF,kBAAkB,GAAGE,sBAAsB,CAACD,wBAAwB,CAAC","ignoreList":[]}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { TouchableOpacity as NativeTouchableOpacity } from 'react-native';
|
4
|
+
import { createUnistylesElement } from '../../core';
|
5
|
+
export const TouchableOpacity = createUnistylesElement(NativeTouchableOpacity);
|
6
|
+
//# sourceMappingURL=TouchableOpacity.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["TouchableOpacity","NativeTouchableOpacity","createUnistylesElement"],"sourceRoot":"../../../../src","sources":["components/native/TouchableOpacity.tsx"],"mappings":";;AAAA,SAASA,gBAAgB,IAAIC,sBAAsB,QAAQ,cAAc;AACzE,SAASC,sBAAsB,QAAQ,YAAY;AAEnD,OAAO,MAAMF,gBAAgB,GAAGE,sBAAsB,CAACD,sBAAsB,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["View","NativeView","createUnistylesElement"],"sourceRoot":"../../../../src","sources":["components/native/View.tsx"],"mappings":";;AAAA,SAASA,IAAI,IAAIC,UAAU,QAAQ,cAAc;AACjD,SAASC,sBAAsB,QAAQ,YAAY;AAEnD,OAAO,MAAMF,IAAI,GAAGE,sBAAsB,CAACD,UAAU,CAAC","ignoreList":[]}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { VirtualizedList as NativeVirtualizedList } from 'react-native';
|
4
|
+
import { createUnistylesElement } from '../../core';
|
5
|
+
export const VirtualizedList = createUnistylesElement(NativeVirtualizedList);
|
6
|
+
//# sourceMappingURL=VirtualizedList.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["VirtualizedList","NativeVirtualizedList","createUnistylesElement"],"sourceRoot":"../../../../src","sources":["components/native/VirtualizedList.tsx"],"mappings":";;AAAA,SAASA,eAAe,IAAIC,qBAAqB,QAAQ,cAAc;AACvE,SAASC,sBAAsB,QAAQ,YAAY;AAEnD,OAAO,MAAMF,eAAe,GAAGE,sBAAsB,CAACD,qBAAqB,CAAC","ignoreList":[]}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { withUnistyles } from './withUnistyles';
|
4
|
+
const SUPPORTED_STYLE_PROPS = ['style', 'contentContainerStyle'];
|
5
|
+
/**
|
6
|
+
* @deprecated Use withUnistyles instead
|
7
|
+
*/
|
8
|
+
export const createUnistylesComponent = (Component, mappings) => {
|
9
|
+
return withUnistyles(Component, mappings);
|
10
|
+
};
|
11
|
+
//# sourceMappingURL=createUnistylesComponent.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["withUnistyles","SUPPORTED_STYLE_PROPS","createUnistylesComponent","Component","mappings"],"sourceRoot":"../../../src","sources":["core/createUnistylesComponent.tsx"],"mappings":";;AAEA,SAASA,aAAa,QAAQ,iBAAiB;AAE/C,MAAMC,qBAAqB,GAAG,CAAC,OAAO,EAAE,uBAAuB,CAAU;AAIzE;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,GAAGA,CAAmGC,SAAgC,EAAEC,QAA+C,KAAK;EAC7N,OAAOJ,aAAa,CAACG,SAAS,EAASC,QAAe,CAAC;AAC3D,CAAC","ignoreList":[]}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import React from 'react';
|
4
|
+
import { passForwardedRef } from './passForwardRef';
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
+
export const createUnistylesElement = Component => /*#__PURE__*/React.forwardRef((props, forwardedRef) => /*#__PURE__*/_jsx(Component, {
|
7
|
+
...props,
|
8
|
+
ref: ref => passForwardedRef(props, ref, forwardedRef)
|
9
|
+
}));
|
10
|
+
//# sourceMappingURL=createUnistylesElement.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["React","passForwardedRef","jsx","_jsx","createUnistylesElement","Component","forwardRef","props","forwardedRef","ref"],"sourceRoot":"../../../src","sources":["core/createUnistylesElement.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,gBAAgB,QAAQ,kBAAkB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEnD,OAAO,MAAMC,sBAAsB,GAAIC,SAAc,iBAAKL,KAAK,CAACM,UAAU,CAAC,CAACC,KAAK,EAAEC,YAAY,kBAC3FL,IAAA,CAACE,SAAS;EAAA,GACFE,KAAK;EACTE,GAAG,EAAGA,GAAY,IAAKR,gBAAgB,CAACM,KAAK,EAAEE,GAAG,EAAED,YAAY;AAAE,CACrE,CACJ,CAAC","ignoreList":[]}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import React from 'react';
|
4
|
+
import { UnistylesShadowRegistry } from '../specs';
|
5
|
+
import { passForwardedRef } from './passForwardRef';
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
+
export const createUnistylesImageBackground = Component => /*#__PURE__*/React.forwardRef((props, forwardedRef) => /*#__PURE__*/_jsx(Component, {
|
8
|
+
...props,
|
9
|
+
ref: ref => passForwardedRef(props, ref, forwardedRef),
|
10
|
+
imageRef: ref => {
|
11
|
+
const style = Array.isArray(props.imageStyle) ? props.imageStyle : [props.imageStyle];
|
12
|
+
|
13
|
+
// @ts-expect-error - This is hidden from TS
|
14
|
+
UnistylesShadowRegistry.add(ref, style);
|
15
|
+
return () => {
|
16
|
+
// @ts-expect-error - This is hidden from TS
|
17
|
+
UnistylesShadowRegistry.remove(ref);
|
18
|
+
};
|
19
|
+
}
|
20
|
+
}));
|
21
|
+
//# sourceMappingURL=createUnistylesImageBackground.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["React","UnistylesShadowRegistry","passForwardedRef","jsx","_jsx","createUnistylesImageBackground","Component","forwardRef","props","forwardedRef","ref","imageRef","style","Array","isArray","imageStyle","add","remove"],"sourceRoot":"../../../src","sources":["core/createUnistylesImageBackground.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,uBAAuB,QAAQ,UAAU;AAClD,SAASC,gBAAgB,QAAQ,kBAAkB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEnD,OAAO,MAAMC,8BAA8B,GAAIC,SAAiC,iBAAKN,KAAK,CAACO,UAAU,CAAwC,CAACC,KAAK,EAAEC,YAAY,kBAC7JL,IAAA,CAACE,SAAS;EAAA,GACFE,KAAK;EACTE,GAAG,EAAEA,GAAG,IAAIR,gBAAgB,CAACM,KAAK,EAAEE,GAAG,EAAED,YAAY,CAAE;EACvDE,QAAQ,EAAED,GAAG,IAAI;IACb,MAAME,KAAK,GAAGC,KAAK,CAACC,OAAO,CAACN,KAAK,CAACO,UAAU,CAAC,GACvCP,KAAK,CAACO,UAAU,GAChB,CAACP,KAAK,CAACO,UAAU,CAAC;;IAExB;IACAd,uBAAuB,CAACe,GAAG,CAACN,GAAG,EAAEE,KAAK,CAAC;IAEvC,OAAO,MAAM;MACT;MACAX,uBAAuB,CAACgB,MAAM,CAACP,GAAG,CAAC;IACvC,CAAC;EACL;AAAE,CACL,CACJ,CAAC","ignoreList":[]}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
export { createUnistylesComponent } from './createUnistylesComponent';
|
4
|
+
export { createUnistylesElement } from './createUnistylesElement';
|
5
|
+
export { createUnistylesImageBackground } from './createUnistylesImageBackground';
|
6
|
+
export { withUnistyles } from './withUnistyles';
|
7
|
+
export { passForwardedRef } from './passForwardRef';
|
8
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["createUnistylesComponent","createUnistylesElement","createUnistylesImageBackground","withUnistyles","passForwardedRef"],"sourceRoot":"../../../src","sources":["core/index.ts"],"mappings":";;AAAA,SAASA,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,sBAAsB,QAAQ,0BAA0B;AACjE,SAASC,8BAA8B,QAAQ,kCAAkC;AACjF,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,gBAAgB,QAAQ,kBAAkB","ignoreList":[]}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { UnistylesShadowRegistry } from '../specs';
|
4
|
+
export const passForwardedRef = (props, ref, forwardedRef) => {
|
5
|
+
const passForwardedRef = () => {
|
6
|
+
if (typeof forwardedRef === 'function') {
|
7
|
+
return forwardedRef(ref);
|
8
|
+
}
|
9
|
+
if (forwardedRef) {
|
10
|
+
forwardedRef.current = ref;
|
11
|
+
}
|
12
|
+
return () => {};
|
13
|
+
};
|
14
|
+
const forwardedRefReturnFn = passForwardedRef();
|
15
|
+
UnistylesShadowRegistry.add(ref, props.style);
|
16
|
+
return () => {
|
17
|
+
// @ts-expect-error - This is hidden from TS
|
18
|
+
UnistylesShadowRegistry.remove(ref);
|
19
|
+
forwardedRefReturnFn?.();
|
20
|
+
};
|
21
|
+
};
|
22
|
+
//# sourceMappingURL=passForwardRef.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["UnistylesShadowRegistry","passForwardedRef","props","ref","forwardedRef","current","forwardedRefReturnFn","add","style","remove"],"sourceRoot":"../../../src","sources":["core/passForwardRef.ts"],"mappings":";;AACA,SAASA,uBAAuB,QAAQ,UAAU;AAElD,OAAO,MAAMC,gBAAgB,GAAGA,CAC5BC,KAAU,EACVC,GAAM,EACNC,YAAmC,KAClC;EACD,MAAMH,gBAAgB,GAAGA,CAAA,KAAM;IAC3B,IAAI,OAAOG,YAAY,KAAK,UAAU,EAAE;MACpC,OAAOA,YAAY,CAACD,GAAG,CAAC;IAC5B;IAEA,IAAIC,YAAY,EAAE;MACdA,YAAY,CAACC,OAAO,GAAGF,GAAG;IAC9B;IAEA,OAAO,MAAM,CAAC,CAAC;EACnB,CAAC;EACD,MAAMG,oBAAoB,GAAGL,gBAAgB,CAAC,CAAC;EAE/CD,uBAAuB,CAACO,GAAG,CAACJ,GAAG,EAAED,KAAK,CAACM,KAAK,CAAC;EAE7C,OAAO,MAAM;IACT;IACAR,uBAAuB,CAACS,MAAM,CAACN,GAAG,CAAC;IACnCG,oBAAoB,GAAG,CAAC;EAC5B,CAAC;AACL,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["withUnistyles"],"sourceRoot":"../../../../src","sources":["core/withUnistyles/index.ts"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,iBAAiB","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["SUPPORTED_STYLE_PROPS"],"sourceRoot":"../../../../src","sources":["core/withUnistyles/types.ts"],"mappings":";;AAGA,OAAO,MAAMA,qBAAqB,GAAG,CAAC,OAAO,EAAE,uBAAuB,CAAU","ignoreList":[]}
|
@@ -0,0 +1,75 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { useEffect, useReducer, useRef, useState } from 'react';
|
4
|
+
import { UnistylesRuntime, UnistylesShadowRegistry } from '../../specs';
|
5
|
+
// It's imported that way because of circular dependency
|
6
|
+
import { UnistyleDependency } from '../../specs/NativePlatform';
|
7
|
+
const RTDependencyMap = {
|
8
|
+
breakpoint: UnistyleDependency.Breakpoints,
|
9
|
+
colorScheme: UnistyleDependency.ColorScheme,
|
10
|
+
contentSizeCategory: UnistyleDependency.ContentSizeCategory,
|
11
|
+
hasAdaptiveThemes: UnistyleDependency.AdaptiveThemes,
|
12
|
+
insets: UnistyleDependency.Insets,
|
13
|
+
fontScale: UnistyleDependency.FontScale,
|
14
|
+
isLandscape: UnistyleDependency.Orientation,
|
15
|
+
isPortrait: UnistyleDependency.Orientation,
|
16
|
+
navigationBar: UnistyleDependency.NavigationBar,
|
17
|
+
screen: UnistyleDependency.Dimensions,
|
18
|
+
statusBar: UnistyleDependency.StatusBar,
|
19
|
+
pixelRatio: UnistyleDependency.PixelRatio,
|
20
|
+
themeName: UnistyleDependency.ThemeName
|
21
|
+
};
|
22
|
+
export const useDependencies = listener => {
|
23
|
+
const scopedTheme = UnistylesShadowRegistry.getScopedTheme();
|
24
|
+
const [dependencies] = useState(() => new Set());
|
25
|
+
const [theme, setTheme] = useState(UnistylesRuntime.getTheme(scopedTheme));
|
26
|
+
const [_, runtimeChanged] = useReducer(() => ({}), {});
|
27
|
+
const disposeRef = useRef();
|
28
|
+
const reinitListener = () => {
|
29
|
+
disposeRef.current?.();
|
30
|
+
disposeRef.current = listener({
|
31
|
+
dependencies: Array.from(dependencies),
|
32
|
+
updateTheme: () => {
|
33
|
+
if (scopedTheme) {
|
34
|
+
return;
|
35
|
+
}
|
36
|
+
setTheme(UnistylesRuntime.getTheme(scopedTheme));
|
37
|
+
},
|
38
|
+
updateRuntime: () => runtimeChanged()
|
39
|
+
});
|
40
|
+
};
|
41
|
+
useEffect(() => {
|
42
|
+
reinitListener();
|
43
|
+
return () => disposeRef.current?.();
|
44
|
+
}, [dependencies.size]);
|
45
|
+
return {
|
46
|
+
mappingsCallback: callback => {
|
47
|
+
const proxifiedTheme = new Proxy(theme, {
|
48
|
+
get: (target, prop) => {
|
49
|
+
dependencies.add(UnistyleDependency.Theme);
|
50
|
+
return target[prop];
|
51
|
+
}
|
52
|
+
});
|
53
|
+
const proxifiedRuntime = new Proxy(UnistylesRuntime.miniRuntime, {
|
54
|
+
get: (target, prop) => {
|
55
|
+
if (prop in RTDependencyMap) {
|
56
|
+
dependencies.add(RTDependencyMap[prop]);
|
57
|
+
}
|
58
|
+
return target[prop];
|
59
|
+
}
|
60
|
+
});
|
61
|
+
return callback(proxifiedTheme, proxifiedRuntime);
|
62
|
+
},
|
63
|
+
addDependencies: newDependencies => {
|
64
|
+
const dependenciesSize = dependencies.size;
|
65
|
+
newDependencies.forEach(dependency => {
|
66
|
+
dependencies.add(dependency);
|
67
|
+
});
|
68
|
+
if (dependenciesSize === dependencies.size) {
|
69
|
+
return;
|
70
|
+
}
|
71
|
+
reinitListener();
|
72
|
+
}
|
73
|
+
};
|
74
|
+
};
|
75
|
+
//# sourceMappingURL=useDependencies.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["useEffect","useReducer","useRef","useState","UnistylesRuntime","UnistylesShadowRegistry","UnistyleDependency","RTDependencyMap","breakpoint","Breakpoints","colorScheme","ColorScheme","contentSizeCategory","ContentSizeCategory","hasAdaptiveThemes","AdaptiveThemes","insets","Insets","fontScale","FontScale","isLandscape","Orientation","isPortrait","navigationBar","NavigationBar","screen","Dimensions","statusBar","StatusBar","pixelRatio","PixelRatio","themeName","ThemeName","useDependencies","listener","scopedTheme","getScopedTheme","dependencies","Set","theme","setTheme","getTheme","_","runtimeChanged","disposeRef","reinitListener","current","Array","from","updateTheme","updateRuntime","size","mappingsCallback","callback","proxifiedTheme","Proxy","get","target","prop","add","Theme","proxifiedRuntime","miniRuntime","addDependencies","newDependencies","dependenciesSize","forEach","dependency"],"sourceRoot":"../../../../src","sources":["core/withUnistyles/useDependencies.ts"],"mappings":"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","ignoreList":[]}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import React, { useEffect, useState, forwardRef, useRef, useMemo } from 'react';
|
4
|
+
import { UnistylesListener } from '../../web/listener';
|
5
|
+
import { UnistylesShadowRegistry } from '../../web';
|
6
|
+
import { equal } from '../../web/utils';
|
7
|
+
import { deepMergeObjects } from '../../utils';
|
8
|
+
import { useDependencies } from './useDependencies';
|
9
|
+
import { UnistyleDependency } from '../../specs/NativePlatform';
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
11
|
+
const useShadowRegistry = style => {
|
12
|
+
const [ref] = useState(document.createElement('div'));
|
13
|
+
const oldClassNames = useRef([]);
|
14
|
+
const classNames = useMemo(() => {
|
15
|
+
if (!style) {
|
16
|
+
return [];
|
17
|
+
}
|
18
|
+
const newClassNames = UnistylesShadowRegistry.add(ref, [style]) ?? [];
|
19
|
+
if (equal(oldClassNames.current, newClassNames)) {
|
20
|
+
return oldClassNames.current;
|
21
|
+
}
|
22
|
+
oldClassNames.current = newClassNames;
|
23
|
+
return newClassNames;
|
24
|
+
}, [style]);
|
25
|
+
useEffect(() => () => {
|
26
|
+
// Remove styles on unmount
|
27
|
+
if (style) {
|
28
|
+
UnistylesShadowRegistry.add(null, [style]);
|
29
|
+
}
|
30
|
+
});
|
31
|
+
return classNames;
|
32
|
+
};
|
33
|
+
|
34
|
+
// @ts-expect-error
|
35
|
+
|
36
|
+
// @ts-expect-error
|
37
|
+
|
38
|
+
export const withUnistyles = (Component, mappings) => {
|
39
|
+
return /*#__PURE__*/forwardRef((props, ref) => {
|
40
|
+
const narrowedProps = props;
|
41
|
+
const styleClassNames = useShadowRegistry(narrowedProps.style);
|
42
|
+
const contentContainerStyleClassNames = useShadowRegistry(narrowedProps.contentContainerStyle);
|
43
|
+
const {
|
44
|
+
mappingsCallback
|
45
|
+
} = useDependencies(({
|
46
|
+
dependencies,
|
47
|
+
updateTheme,
|
48
|
+
updateRuntime
|
49
|
+
}) => {
|
50
|
+
const disposeTheme = UnistylesListener.addListeners(dependencies.filter(dependency => dependency === UnistyleDependency.Theme), updateTheme);
|
51
|
+
const disposeRuntime = UnistylesListener.addListeners(dependencies.filter(dependency => dependency !== UnistyleDependency.Theme), updateRuntime);
|
52
|
+
return () => {
|
53
|
+
disposeTheme();
|
54
|
+
disposeRuntime();
|
55
|
+
};
|
56
|
+
});
|
57
|
+
const mappingsProps = mappings ? mappingsCallback(mappings) : {};
|
58
|
+
const unistyleProps = narrowedProps.uniProps ? mappingsCallback(narrowedProps.uniProps) : {};
|
59
|
+
const combinedProps = {
|
60
|
+
...deepMergeObjects(mappingsProps, unistyleProps, props),
|
61
|
+
...(narrowedProps.style ? {
|
62
|
+
style: {
|
63
|
+
$$css: true,
|
64
|
+
'unistyles': styleClassNames.join(' ')
|
65
|
+
}
|
66
|
+
} : {}),
|
67
|
+
...(narrowedProps.contentContainerStyle ? {
|
68
|
+
style: {
|
69
|
+
$$css: true,
|
70
|
+
'unistyles': contentContainerStyleClassNames.join(' ')
|
71
|
+
}
|
72
|
+
} : {})
|
73
|
+
};
|
74
|
+
const NativeComponent = Component;
|
75
|
+
return /*#__PURE__*/_jsx(NativeComponent, {
|
76
|
+
...combinedProps,
|
77
|
+
ref: ref
|
78
|
+
});
|
79
|
+
});
|
80
|
+
};
|
81
|
+
//# sourceMappingURL=withUnistyles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["React","useEffect","useState","forwardRef","useRef","useMemo","UnistylesListener","UnistylesShadowRegistry","equal","deepMergeObjects","useDependencies","UnistyleDependency","jsx","_jsx","useShadowRegistry","style","ref","document","createElement","oldClassNames","classNames","newClassNames","add","current","withUnistyles","Component","mappings","props","narrowedProps","styleClassNames","contentContainerStyleClassNames","contentContainerStyle","mappingsCallback","dependencies","updateTheme","updateRuntime","disposeTheme","addListeners","filter","dependency","Theme","disposeRuntime","mappingsProps","unistyleProps","uniProps","combinedProps","$$css","join","NativeComponent"],"sourceRoot":"../../../../src","sources":["core/withUnistyles/withUnistyles.tsx"],"mappings":"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","ignoreList":[]}
|