react-native-unistyles 3.0.0-beta.1 → 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/README.md +4 -4
- package/Unistyles.podspec +7 -1
- package/android/build.gradle +6 -0
- package/android/src/main/cxx/NativeUnistylesModule.cpp +2 -2
- package/cxx/common/Constants.h +2 -0
- package/cxx/core/HostStyle.cpp +12 -7
- package/cxx/core/HostStyle.h +5 -0
- package/cxx/core/UnistyleData.h +3 -3
- package/cxx/core/UnistyleWrapper.h +8 -8
- package/cxx/core/UnistylesRegistry.cpp +23 -30
- package/cxx/core/UnistylesRegistry.h +8 -2
- package/cxx/hybridObjects/HybridShadowRegistry.cpp +108 -12
- package/cxx/hybridObjects/HybridShadowRegistry.h +21 -2
- package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +4 -0
- package/cxx/parser/Parser.cpp +182 -26
- package/cxx/parser/Parser.h +3 -1
- package/ios/UnistylesModuleOnLoad.mm +2 -2
- 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 +10 -3
- package/lib/commonjs/components/index.js.map +1 -1
- 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/{Pressable.web.js → native/Pressable.js} +26 -66
- 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 +5 -68
- package/lib/commonjs/core/createUnistylesComponent.js.map +1 -1
- 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 +20 -6
- package/lib/commonjs/core/index.js.map +1 -1
- 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/useMedia.js +17 -33
- package/lib/commonjs/hooks/useMedia.js.map +1 -1
- package/lib/commonjs/hooks/useMedia.native.js +60 -0
- package/lib/commonjs/hooks/useMedia.native.js.map +1 -0
- package/lib/commonjs/index.js +33 -16
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/ShadowRegistry/index.js +3 -3
- package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/commonjs/specs/index.js +14 -40
- 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/web/create.js +12 -33
- package/lib/commonjs/web/create.js.map +1 -1
- package/lib/commonjs/web/index.js.map +1 -1
- package/lib/commonjs/web/registry.js +10 -3
- package/lib/commonjs/web/registry.js.map +1 -1
- package/lib/commonjs/web/runtime.js +3 -1
- package/lib/commonjs/web/runtime.js.map +1 -1
- package/lib/commonjs/web/shadowRegistry.js +71 -64
- package/lib/commonjs/web/shadowRegistry.js.map +1 -1
- package/lib/commonjs/web/utils/unistyle.js +3 -3
- package/lib/commonjs/web/utils/unistyle.js.map +1 -1
- 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 +2 -1
- package/lib/module/components/index.js.map +1 -1
- 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 +5 -66
- package/lib/module/core/createUnistylesComponent.js.map +1 -1
- 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 +4 -2
- package/lib/module/core/index.js.map +1 -1
- 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/useMedia.js +19 -35
- package/lib/module/hooks/useMedia.js.map +1 -1
- 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 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/ShadowRegistry/index.js +3 -3
- package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/module/specs/index.js +2 -8
- 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/web/create.js +13 -34
- package/lib/module/web/create.js.map +1 -1
- package/lib/module/web/index.js +1 -1
- package/lib/module/web/index.js.map +1 -1
- package/lib/module/web/registry.js +11 -4
- package/lib/module/web/registry.js.map +1 -1
- package/lib/module/web/runtime.js +3 -1
- package/lib/module/web/runtime.js.map +1 -1
- package/lib/module/web/shadowRegistry.js +70 -63
- package/lib/module/web/shadowRegistry.js.map +1 -1
- package/lib/module/web/utils/unistyle.js +1 -1
- package/lib/module/web/utils/unistyle.js.map +1 -1
- 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 +2 -1
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- 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/{Pressable.web.d.ts → native/Pressable.d.ts} +3 -2
- package/lib/typescript/src/components/native/Pressable.d.ts.map +1 -0
- package/lib/typescript/src/components/{Pressable.d.ts → native/Pressable.native.d.ts} +1 -3
- 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 +9 -3
- package/lib/typescript/src/core/createUnistylesComponent.d.ts.map +1 -1
- 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 +4 -2
- package/lib/typescript/src/core/index.d.ts.map +1 -1
- 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/useMedia.d.ts +1 -1
- package/lib/typescript/src/hooks/useMedia.d.ts.map +1 -1
- 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 +2 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts +7 -2
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/ShadowRegistry/types.d.ts +17 -0
- package/lib/typescript/src/specs/ShadowRegistry/types.d.ts.map +1 -1
- package/lib/typescript/src/specs/index.d.ts +3 -11
- 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/web/create.d.ts +1 -1441
- package/lib/typescript/src/web/create.d.ts.map +1 -1
- package/lib/typescript/src/web/index.d.ts +2 -1441
- package/lib/typescript/src/web/index.d.ts.map +1 -1
- package/lib/typescript/src/web/registry.d.ts +2 -3
- package/lib/typescript/src/web/registry.d.ts.map +1 -1
- package/lib/typescript/src/web/runtime.d.ts.map +1 -1
- package/lib/typescript/src/web/shadowRegistry.d.ts +11 -3
- package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
- package/lib/typescript/src/web/utils/unistyle.d.ts +1 -2
- package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +3 -0
- package/package.json +4 -4
- package/plugin/common.js +4 -6
- package/plugin/import.js +63 -26
- package/plugin/index.js +48 -28
- package/plugin/ref.js +0 -234
- package/plugin/style.js +4 -317
- package/plugin/stylesheet.js +25 -10
- package/plugin/variants.js +54 -1
- package/src/components/ScopedTheme.tsx +32 -0
- package/src/components/Variants.tsx +29 -0
- package/src/components/index.ts +2 -1
- 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 +6 -76
- package/src/core/createUnistylesElement.tsx +9 -0
- package/src/core/createUnistylesImageBackground.tsx +24 -0
- package/src/core/index.ts +4 -2
- 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/useMedia.native.ts +65 -0
- package/src/hooks/useMedia.ts +19 -36
- package/src/index.ts +2 -2
- package/src/specs/ShadowRegistry/index.ts +14 -5
- package/src/specs/ShadowRegistry/types.ts +18 -1
- package/src/specs/index.native.ts +27 -0
- package/src/specs/index.ts +3 -27
- package/src/web/create.ts +14 -32
- package/src/web/index.ts +3 -2
- package/src/web/registry.ts +15 -6
- package/src/web/runtime.ts +3 -1
- package/src/web/shadowRegistry.ts +66 -52
- package/src/web/utils/unistyle.ts +1 -2
- package/lib/commonjs/components/Pressable.js +0 -74
- package/lib/commonjs/components/Pressable.js.map +0 -1
- package/lib/commonjs/components/Pressable.web.js.map +0 -1
- package/lib/commonjs/core/createUnistylesComponent.native.js +0 -82
- package/lib/commonjs/core/createUnistylesComponent.native.js.map +0 -1
- package/lib/commonjs/core/getBoundArgs.js +0 -18
- package/lib/commonjs/core/getBoundArgs.js.map +0 -1
- package/lib/commonjs/core/getId.js +0 -9
- package/lib/commonjs/core/getId.js.map +0 -1
- package/lib/commonjs/hooks/useMedia.web.js +0 -43
- package/lib/commonjs/hooks/useMedia.web.js.map +0 -1
- package/lib/commonjs/specs/index.web.js +0 -17
- package/lib/commonjs/specs/index.web.js.map +0 -1
- package/lib/module/components/Pressable.js +0 -68
- package/lib/module/components/Pressable.js.map +0 -1
- package/lib/module/components/Pressable.web.js +0 -109
- package/lib/module/components/Pressable.web.js.map +0 -1
- package/lib/module/core/createUnistylesComponent.native.js +0 -75
- package/lib/module/core/createUnistylesComponent.native.js.map +0 -1
- package/lib/module/core/getBoundArgs.js +0 -13
- package/lib/module/core/getBoundArgs.js.map +0 -1
- package/lib/module/core/getId.js +0 -4
- package/lib/module/core/getId.js.map +0 -1
- package/lib/module/hooks/useMedia.web.js +0 -38
- package/lib/module/hooks/useMedia.web.js.map +0 -1
- package/lib/module/specs/index.web.js +0 -4
- package/lib/module/specs/index.web.js.map +0 -1
- package/lib/typescript/src/components/Pressable.d.ts.map +0 -1
- package/lib/typescript/src/components/Pressable.web.d.ts.map +0 -1
- package/lib/typescript/src/core/createUnistylesComponent.native.d.ts +0 -8
- package/lib/typescript/src/core/createUnistylesComponent.native.d.ts.map +0 -1
- package/lib/typescript/src/core/getBoundArgs.d.ts +0 -2
- package/lib/typescript/src/core/getBoundArgs.d.ts.map +0 -1
- package/lib/typescript/src/core/getId.d.ts +0 -2
- package/lib/typescript/src/core/getId.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useMedia.web.d.ts +0 -6
- package/lib/typescript/src/hooks/useMedia.web.d.ts.map +0 -1
- package/lib/typescript/src/specs/index.web.d.ts +0 -2
- package/lib/typescript/src/specs/index.web.d.ts.map +0 -1
- package/src/components/Pressable.tsx +0 -89
- package/src/components/Pressable.web.tsx +0 -129
- package/src/core/createUnistylesComponent.native.tsx +0 -83
- package/src/core/getBoundArgs.ts +0 -15
- package/src/core/getId.ts +0 -1
- package/src/hooks/useMedia.web.ts +0 -47
- package/src/specs/index.web.ts +0 -1
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import React, { useLayoutEffect } from 'react';
|
4
|
+
import { UnistylesShadowRegistry } from '../specs';
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
+
const Apply = ({
|
7
|
+
variants
|
8
|
+
}) => {
|
9
|
+
UnistylesShadowRegistry.selectVariants(variants);
|
10
|
+
useLayoutEffect(() => {
|
11
|
+
UnistylesShadowRegistry.selectVariants(variants);
|
12
|
+
});
|
13
|
+
return null;
|
14
|
+
};
|
15
|
+
export const Variants = ({
|
16
|
+
variants,
|
17
|
+
children
|
18
|
+
}) => {
|
19
|
+
const mappedChildren = [/*#__PURE__*/_jsx(Apply, {
|
20
|
+
variants: variants
|
21
|
+
}, 'add'), children, /*#__PURE__*/_jsx(Apply, {}, 'remove')];
|
22
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
23
|
+
children: mappedChildren
|
24
|
+
});
|
25
|
+
};
|
26
|
+
//# sourceMappingURL=Variants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["React","useLayoutEffect","UnistylesShadowRegistry","jsx","_jsx","Apply","variants","selectVariants","Variants","children","mappedChildren","Fragment"],"sourceRoot":"../../../src","sources":["components/Variants.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,eAAe,QAAQ,OAAO;AAC9C,SAASC,uBAAuB,QAAQ,UAAU;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMlD,MAAMC,KAA4C,GAAGA,CAAC;EAAEC;AAAS,CAAC,KAAK;EACnEJ,uBAAuB,CAACK,cAAc,CAACD,QAAQ,CAAC;EAEhDL,eAAe,CAAC,MAAM;IAClBC,uBAAuB,CAACK,cAAc,CAACD,QAAQ,CAAC;EACpD,CAAC,CAAC;EAEF,OAAO,IAAI;AACf,CAAC;AACD,OAAO,MAAME,QAAwE,GAAGA,CAAC;EAAEF,QAAQ;EAAEG;AAAS,CAAC,KAAK;EAChH,MAAMC,cAAc,GAAG,cACnBN,IAAA,CAACC,KAAK;IAAWC,QAAQ,EAAEA;EAAS,GAAzB,KAA2B,CAAC,EACvCG,QAAQ,eACRL,IAAA,CAACC,KAAK,MAAK,QAAU,CAAC,CACzB;EAED,oBACID,IAAA,CAACJ,KAAK,CAACW,QAAQ;IAAAF,QAAA,EACVC;EAAc,CACH,CAAC;AAEzB,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Hide","Display","
|
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":[]}
|
@@ -1,72 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
import
|
4
|
-
import { UnistylesRuntime } from '../specs';
|
5
|
-
import { UnistyleDependency } from '../specs/NativePlatform';
|
6
|
-
import { UnistylesListener } from '../web/listener';
|
7
|
-
import { UnistylesShadowRegistry } from '../web';
|
8
|
-
import { equal } from '../web/utils';
|
9
|
-
import { deepMergeObjects } from '../utils';
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
3
|
+
import { withUnistyles } from './withUnistyles';
|
11
4
|
const SUPPORTED_STYLE_PROPS = ['style', 'contentContainerStyle'];
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
const oldClassNames = useRef([]);
|
16
|
-
const classNames = useMemo(() => {
|
17
|
-
if (!style) {
|
18
|
-
return [];
|
19
|
-
}
|
20
|
-
const newClassNames = UnistylesShadowRegistry.add(ref, [style], undefined, []) ?? [];
|
21
|
-
if (equal(oldClassNames.current, newClassNames)) {
|
22
|
-
return oldClassNames.current;
|
23
|
-
}
|
24
|
-
oldClassNames.current = newClassNames;
|
25
|
-
return newClassNames;
|
26
|
-
}, [style]);
|
27
|
-
useEffect(() => () => {
|
28
|
-
// Remove styles on unmount
|
29
|
-
if (style) {
|
30
|
-
UnistylesShadowRegistry.add(null, [style], undefined, []);
|
31
|
-
}
|
32
|
-
});
|
33
|
-
return classNames;
|
34
|
-
};
|
5
|
+
/**
|
6
|
+
* @deprecated Use withUnistyles instead
|
7
|
+
*/
|
35
8
|
export const createUnistylesComponent = (Component, mappings) => {
|
36
|
-
return
|
37
|
-
const narrowedProps = props;
|
38
|
-
const [mappingsProps, setMappingsProps] = useState(mappings?.(UnistylesRuntime.getTheme()));
|
39
|
-
const styleClassNames = useShadowRegistry(narrowedProps.style);
|
40
|
-
const contentContainerStyleClassNames = useShadowRegistry(narrowedProps.contentContainerStyle);
|
41
|
-
useEffect(() => {
|
42
|
-
const disposeMappings = UnistylesListener.addListeners(ALL_DEPENDENCIES, () => {
|
43
|
-
if (!mappings) {
|
44
|
-
disposeMappings();
|
45
|
-
return;
|
46
|
-
}
|
47
|
-
return setMappingsProps(mappings(UnistylesRuntime.getTheme()));
|
48
|
-
});
|
49
|
-
return () => disposeMappings();
|
50
|
-
}, [mappingsProps, narrowedProps.style]);
|
51
|
-
const combinedProps = {
|
52
|
-
...deepMergeObjects(props, mappingsProps ?? {}),
|
53
|
-
...(narrowedProps.style ? {
|
54
|
-
style: {
|
55
|
-
$$css: true,
|
56
|
-
'unistyles': styleClassNames.join(' ')
|
57
|
-
}
|
58
|
-
} : {}),
|
59
|
-
...(narrowedProps.contentContainerStyle ? {
|
60
|
-
style: {
|
61
|
-
$$css: true,
|
62
|
-
'unistyles': contentContainerStyleClassNames.join(' ')
|
63
|
-
}
|
64
|
-
} : {})
|
65
|
-
};
|
66
|
-
return /*#__PURE__*/_jsx(Component, {
|
67
|
-
...combinedProps,
|
68
|
-
ref: ref
|
69
|
-
});
|
70
|
-
});
|
9
|
+
return withUnistyles(Component, mappings);
|
71
10
|
};
|
72
11
|
//# sourceMappingURL=createUnistylesComponent.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
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":[]}
|
package/lib/module/core/index.js
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
export { createUnistylesComponent } from './createUnistylesComponent';
|
4
|
-
export {
|
5
|
-
export {
|
4
|
+
export { createUnistylesElement } from './createUnistylesElement';
|
5
|
+
export { createUnistylesImageBackground } from './createUnistylesImageBackground';
|
6
|
+
export { withUnistyles } from './withUnistyles';
|
7
|
+
export { passForwardedRef } from './passForwardRef';
|
6
8
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createUnistylesComponent","
|
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":[]}
|