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
package/cxx/parser/Parser.cpp
CHANGED
@@ -36,6 +36,85 @@ void parser::Parser::buildUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet
|
|
36
36
|
});
|
37
37
|
}
|
38
38
|
|
39
|
+
jsi::Value parser::Parser::getParsedStyleSheetForScopedTheme(jsi::Runtime& rt, core::Unistyle::Shared unistyle, std::string& scopedTheme) {
|
40
|
+
// for static stylesheets and exotic styles we don't need to do anything
|
41
|
+
if (unistyle->parent == nullptr || unistyle->parent->type == StyleSheetType::Static) {
|
42
|
+
return jsi::Value::undefined();
|
43
|
+
}
|
44
|
+
|
45
|
+
auto& state = core::UnistylesRegistry::get().getState(rt);
|
46
|
+
auto jsTheme = state.getJSThemeByName(scopedTheme);
|
47
|
+
|
48
|
+
if (unistyle->parent->type == StyleSheetType::Themable) {
|
49
|
+
return unistyle->parent->rawValue
|
50
|
+
.asFunction(rt)
|
51
|
+
.call(rt, std::move(jsTheme))
|
52
|
+
.asObject(rt);
|
53
|
+
}
|
54
|
+
|
55
|
+
auto miniRuntime = this->_unistylesRuntime->getMiniRuntimeAsValue(rt, std::nullopt);
|
56
|
+
|
57
|
+
return unistyle->parent->rawValue
|
58
|
+
.asFunction(rt)
|
59
|
+
.call(rt, std::move(jsTheme), std::move(miniRuntime))
|
60
|
+
.asObject(rt);
|
61
|
+
}
|
62
|
+
|
63
|
+
void parser::Parser::rebuildUnistyleWithScopedTheme(jsi::Runtime& rt, jsi::Value& jsScopedTheme, std::shared_ptr<core::UnistyleData> unistyleData) {
|
64
|
+
auto parsedStyleSheet = jsScopedTheme.isUndefined()
|
65
|
+
? this->getParsedStyleSheetForScopedTheme(rt, unistyleData->unistyle, unistyleData->scopedTheme.value())
|
66
|
+
: jsScopedTheme.asObject(rt);
|
67
|
+
|
68
|
+
if (parsedStyleSheet.isUndefined()) {
|
69
|
+
return;
|
70
|
+
}
|
71
|
+
|
72
|
+
// get target style
|
73
|
+
auto targetStyle = parsedStyleSheet.asObject(rt).getProperty(rt, unistyleData->unistyle->styleKey.c_str()).asObject(rt);
|
74
|
+
|
75
|
+
// for object we just need to parse it
|
76
|
+
if (unistyleData->unistyle->type == UnistyleType::Object) {
|
77
|
+
// we need to temporarly swap rawValue to enforce correct parings
|
78
|
+
auto sharedRawValue = std::move(unistyleData->unistyle->rawValue);
|
79
|
+
|
80
|
+
unistyleData->unistyle->rawValue = std::move(targetStyle);
|
81
|
+
unistyleData->parsedStyle = this->parseFirstLevel(rt, unistyleData->unistyle, unistyleData->variants);
|
82
|
+
unistyleData->unistyle->rawValue = std::move(sharedRawValue);
|
83
|
+
|
84
|
+
return;
|
85
|
+
}
|
86
|
+
|
87
|
+
// for functions we need to call them with memoized arguments
|
88
|
+
auto unistyleFn = std::dynamic_pointer_cast<UnistyleDynamicFunction>(unistyleData->unistyle);
|
89
|
+
|
90
|
+
// convert arguments to jsi::Value
|
91
|
+
std::vector<jsi::Value> args{};
|
92
|
+
auto arguments = unistyleData->dynamicFunctionMetadata.value();
|
93
|
+
|
94
|
+
args.reserve(arguments.size());
|
95
|
+
|
96
|
+
for (int i = 0; i < arguments.size(); i++) {
|
97
|
+
folly::dynamic& arg = arguments.at(i);
|
98
|
+
|
99
|
+
args.emplace_back(jsi::valueFromDynamic(rt, arg));
|
100
|
+
}
|
101
|
+
|
102
|
+
const jsi::Value *argStart = args.data();
|
103
|
+
|
104
|
+
// we need to temporarly swap unprocessed value to enforce correct parings
|
105
|
+
auto sharedUnprocessedValue = std::move(unistyleFn->unprocessedValue);
|
106
|
+
|
107
|
+
// call cached function with memoized arguments
|
108
|
+
auto functionResult = targetStyle
|
109
|
+
.asFunction(rt)
|
110
|
+
.call(rt, argStart, arguments.size())
|
111
|
+
.asObject(rt);
|
112
|
+
|
113
|
+
unistyleFn->unprocessedValue = std::move(functionResult);
|
114
|
+
unistyleData->parsedStyle = this->parseFirstLevel(rt, unistyleFn, unistyleData->variants);
|
115
|
+
unistyleFn->unprocessedValue = std::move(sharedUnprocessedValue);
|
116
|
+
}
|
117
|
+
|
39
118
|
jsi::Object parser::Parser::unwrapStyleSheet(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, std::optional<UnistylesNativeMiniRuntime> maybeMiniRuntime) {
|
40
119
|
// firstly we need to get object representation of user's StyleSheet
|
41
120
|
// StyleSheet can be a function or an object
|
@@ -87,24 +166,57 @@ void parser::Parser::parseUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet
|
|
87
166
|
}
|
88
167
|
|
89
168
|
// rebuild all unistyles in StyleSheet that depends on variants
|
90
|
-
void parser::Parser::
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
169
|
+
void parser::Parser::rebuildUnistyleWithVariants(jsi::Runtime& rt, std::shared_ptr<core::UnistyleData> unistyleData) {
|
170
|
+
if (unistyleData->unistyle->styleKey == helpers::EXOTIC_STYLE_KEY) {
|
171
|
+
return;
|
172
|
+
}
|
173
|
+
|
174
|
+
if (unistyleData->unistyle->type == UnistyleType::Object) {
|
175
|
+
unistyleData->parsedStyle = this->parseFirstLevel(rt, unistyleData->unistyle, unistyleData->variants);
|
176
|
+
|
177
|
+
return;
|
178
|
+
}
|
179
|
+
|
180
|
+
// for functions we need to call them with memoized arguments
|
181
|
+
auto unistyleFn = std::dynamic_pointer_cast<UnistyleDynamicFunction>(unistyleData->unistyle);
|
182
|
+
|
183
|
+
// convert arguments to jsi::Value
|
184
|
+
std::vector<jsi::Value> args{};
|
185
|
+
auto arguments = unistyleData->dynamicFunctionMetadata.value();
|
186
|
+
|
187
|
+
args.reserve(arguments.size());
|
188
|
+
|
189
|
+
for (int i = 0; i < arguments.size(); i++) {
|
190
|
+
folly::dynamic& arg = arguments.at(i);
|
95
191
|
|
96
|
-
|
192
|
+
args.emplace_back(jsi::valueFromDynamic(rt, arg));
|
97
193
|
}
|
194
|
+
|
195
|
+
const jsi::Value *argStart = args.data();
|
196
|
+
|
197
|
+
// we need to temporarly swap unprocessed value to enforce correct parings
|
198
|
+
auto sharedUnprocessedValue = std::move(unistyleFn->unprocessedValue);
|
199
|
+
|
200
|
+
// call cached function with memoized arguments
|
201
|
+
auto functionResult = unistyleFn->rawValue
|
202
|
+
.asFunction(rt)
|
203
|
+
.call(rt, argStart, arguments.size())
|
204
|
+
.asObject(rt);
|
205
|
+
|
206
|
+
unistyleFn->unprocessedValue = std::move(functionResult);
|
207
|
+
unistyleData->parsedStyle = this->parseFirstLevel(rt, unistyleFn, unistyleData->variants);
|
208
|
+
unistyleFn->unprocessedValue = std::move(sharedUnprocessedValue);
|
98
209
|
}
|
99
210
|
|
100
211
|
// rebuild all unistyles that are affected by platform event
|
101
212
|
void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, DependencyMap& dependencyMap, std::vector<std::shared_ptr<core::StyleSheet>>& styleSheets, std::optional<UnistylesNativeMiniRuntime> maybeMiniRuntime) {
|
102
|
-
std::unordered_map<std::shared_ptr<StyleSheet>, jsi::Value>
|
213
|
+
std::unordered_map<std::shared_ptr<StyleSheet>, jsi::Value> parsedStyleSheetsWithDefaultTheme{};
|
214
|
+
std::unordered_map<std::string, std::unordered_map<std::shared_ptr<StyleSheet>, jsi::Value>> parsedStyleSheetsWithScopedTheme{};
|
103
215
|
std::unordered_map<std::shared_ptr<core::Unistyle>, bool> parsedUnistyles{};
|
104
216
|
|
105
217
|
// parse all stylesheets that depends on changes
|
106
218
|
for (auto styleSheet : styleSheets) {
|
107
|
-
|
219
|
+
parsedStyleSheetsWithDefaultTheme.emplace(styleSheet, this->unwrapStyleSheet(rt, styleSheet, maybeMiniRuntime));
|
108
220
|
}
|
109
221
|
|
110
222
|
// then parse all visible Unistyles managed by Unistyle
|
@@ -112,8 +224,8 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
|
|
112
224
|
auto styleSheet = unistyles.begin()->get()->unistyle->parent;
|
113
225
|
|
114
226
|
// stylesheet may be optional for exotic unistyles
|
115
|
-
if (styleSheet != nullptr && !
|
116
|
-
|
227
|
+
if (styleSheet != nullptr && !parsedStyleSheetsWithDefaultTheme.contains(styleSheet)) {
|
228
|
+
parsedStyleSheetsWithDefaultTheme.emplace(styleSheet, this->unwrapStyleSheet(rt, styleSheet, maybeMiniRuntime));
|
117
229
|
}
|
118
230
|
|
119
231
|
for (auto& unistyleData : unistyles) {
|
@@ -136,18 +248,60 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
|
|
136
248
|
auto unistyleStyleSheet = unistyle->parent;
|
137
249
|
|
138
250
|
// we may hit now other StyleSheets that are referenced from affected nodes
|
139
|
-
if (unistyleStyleSheet != nullptr && !
|
140
|
-
|
251
|
+
if (unistyleStyleSheet != nullptr && !parsedStyleSheetsWithDefaultTheme.contains(unistyleStyleSheet)) {
|
252
|
+
parsedStyleSheetsWithDefaultTheme.emplace(unistyleStyleSheet, this->unwrapStyleSheet(rt, unistyleStyleSheet, maybeMiniRuntime));
|
141
253
|
}
|
142
254
|
|
143
255
|
// StyleSheet might have styles that are not affected
|
144
|
-
if (!
|
256
|
+
if (!parsedStyleSheetsWithDefaultTheme[unistyleStyleSheet].asObject(rt).hasProperty(rt, unistyle->styleKey.c_str())) {
|
145
257
|
continue;
|
146
258
|
}
|
147
259
|
|
148
|
-
|
149
|
-
|
150
|
-
|
260
|
+
// for scoped themes we need to parse unistyle exclusively
|
261
|
+
if (unistyleData->scopedTheme.has_value()) {
|
262
|
+
std::vector<folly::dynamic> arguments = {};
|
263
|
+
|
264
|
+
if (unistyleData->dynamicFunctionMetadata.has_value()) {
|
265
|
+
arguments = unistyleData->dynamicFunctionMetadata.value();
|
266
|
+
}
|
267
|
+
|
268
|
+
auto parsedStyleSheet = jsi::Value::undefined();
|
269
|
+
auto scopedThemeName = unistyleData->scopedTheme.value();
|
270
|
+
|
271
|
+
// check if we have theme in cache
|
272
|
+
if (parsedStyleSheetsWithScopedTheme.contains(scopedThemeName)) {
|
273
|
+
if (parsedStyleSheetsWithScopedTheme[scopedThemeName].contains(unistyle->parent)) {
|
274
|
+
parsedStyleSheet = jsi::Value(rt, parsedStyleSheetsWithScopedTheme[scopedThemeName][unistyle->parent]);
|
275
|
+
}
|
276
|
+
}
|
277
|
+
|
278
|
+
// if not, let's build it
|
279
|
+
if (parsedStyleSheet.isUndefined()) {
|
280
|
+
parsedStyleSheet = this->getParsedStyleSheetForScopedTheme(rt, unistyle, unistyleData->scopedTheme.value());
|
281
|
+
|
282
|
+
if (!parsedStyleSheetsWithScopedTheme.contains(scopedThemeName)) {
|
283
|
+
parsedStyleSheetsWithScopedTheme.emplace(
|
284
|
+
scopedThemeName,
|
285
|
+
std::unordered_map<std::shared_ptr<StyleSheet>, jsi::Value>{}
|
286
|
+
);
|
287
|
+
}
|
288
|
+
|
289
|
+
parsedStyleSheetsWithScopedTheme[scopedThemeName].emplace(
|
290
|
+
unistyle->parent,
|
291
|
+
jsi::Value(rt, parsedStyleSheet)
|
292
|
+
);
|
293
|
+
}
|
294
|
+
|
295
|
+
this->rebuildUnistyleWithScopedTheme(
|
296
|
+
rt,
|
297
|
+
parsedStyleSheet,
|
298
|
+
unistyleData
|
299
|
+
);
|
300
|
+
} else {
|
301
|
+
unistyle->rawValue = parsedStyleSheetsWithDefaultTheme[unistyleStyleSheet].asObject(rt).getProperty(rt, unistyle->styleKey.c_str()).asObject(rt);
|
302
|
+
this->rebuildUnistyle(rt, unistyleStyleSheet, unistyle, unistyleData->variants, unistyleData->dynamicFunctionMetadata);
|
303
|
+
unistyleData->parsedStyle = jsi::Value(rt, unistyle->parsedStyle.value()).asObject(rt);
|
304
|
+
}
|
151
305
|
|
152
306
|
if (!parsedUnistyles.contains(unistyle)) {
|
153
307
|
parsedUnistyles.emplace(unistyle, true);
|
@@ -160,7 +314,7 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
|
|
160
314
|
for (auto styleSheet : styleSheets) {
|
161
315
|
for (auto& [_, unistyle] : styleSheet->unistyles) {
|
162
316
|
if (!parsedUnistyles.contains(unistyle)) {
|
163
|
-
unistyle->rawValue =
|
317
|
+
unistyle->rawValue = parsedStyleSheetsWithDefaultTheme[styleSheet].asObject(rt).getProperty(rt, unistyle->styleKey.c_str()).asObject(rt);
|
164
318
|
}
|
165
319
|
}
|
166
320
|
}
|
@@ -317,7 +471,7 @@ jsi::Object parser::Parser::parseFirstLevel(jsi::Runtime& rt, Unistyle::Shared u
|
|
317
471
|
parsedStyle.setProperty(rt, jsi::PropNameID::forUtf8(rt, propertyName), this->parseSecondLevel(rt, unistyle, valueFromBreakpoint));
|
318
472
|
});
|
319
473
|
|
320
|
-
if (shouldParseVariants && variants.has_value()
|
474
|
+
if (shouldParseVariants && variants.has_value()) {
|
321
475
|
auto propertyValueObject = style.getProperty(rt, "variants").asObject(rt);
|
322
476
|
auto parsedVariant = this->parseVariants(rt, unistyle, propertyValueObject, variants.value());
|
323
477
|
|
@@ -347,12 +501,12 @@ jsi::Function parser::Parser::createDynamicFunctionProxy(jsi::Runtime& rt, Unist
|
|
347
501
|
? thisVal.asObject(rt)
|
348
502
|
: jsi::Object(rt);
|
349
503
|
auto parser = parser::Parser(unistylesRuntime);
|
350
|
-
|
351
504
|
// call user function
|
352
505
|
auto result = unistyle->rawValue.asFunction(rt).call(rt, args, count);
|
353
506
|
|
354
507
|
// memoize metadata to call it later
|
355
508
|
auto unistyleFn = std::dynamic_pointer_cast<UnistyleDynamicFunction>(unistyle);
|
509
|
+
auto& registry = core::UnistylesRegistry::get();
|
356
510
|
|
357
511
|
unistyleFn->unprocessedValue = jsi::Value(rt, result).asObject(rt);
|
358
512
|
|
@@ -360,7 +514,7 @@ jsi::Function parser::Parser::createDynamicFunctionProxy(jsi::Runtime& rt, Unist
|
|
360
514
|
? thisObject.getProperty(rt, helpers::STYLE_VARIANTS.c_str())
|
361
515
|
: jsi::Value::undefined();
|
362
516
|
std::optional<Variants> variants = rawVariants.isUndefined()
|
363
|
-
?
|
517
|
+
? registry.getScopedVariants()
|
364
518
|
: std::optional<Variants>(helpers::variantsToPairs(rt, rawVariants.asObject(rt)));
|
365
519
|
|
366
520
|
unistyleFn->parsedStyle = this->parseFirstLevel(rt, unistyleFn, variants);
|
@@ -371,13 +525,15 @@ jsi::Function parser::Parser::createDynamicFunctionProxy(jsi::Runtime& rt, Unist
|
|
371
525
|
// include dependencies for createUnistylesComponent
|
372
526
|
style.setProperty(rt, "__proto__", generateUnistylesPrototype(rt, unistylesRuntime, unistyle, variants, helpers::functionArgumentsToArray(rt, args, count)));
|
373
527
|
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
528
|
+
jsi::Object secrets = jsi::Object(rt);
|
529
|
+
|
530
|
+
secrets.setProperty(rt, helpers::ARGUMENTS.c_str(), helpers::functionArgumentsToArray(rt, args, count));
|
531
|
+
|
532
|
+
helpers::defineHiddenProperty(rt, style, helpers::SECRETS.c_str(), secrets);
|
533
|
+
|
534
|
+
auto wrappedUnistyle = std::make_shared<UnistyleWrapper>(unistyle);
|
379
535
|
|
380
|
-
|
536
|
+
style.setNativeState(rt, std::move(wrappedUnistyle));
|
381
537
|
|
382
538
|
return style;
|
383
539
|
});
|
package/cxx/parser/Parser.h
CHANGED
@@ -23,11 +23,13 @@ struct Parser {
|
|
23
23
|
|
24
24
|
void buildUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet);
|
25
25
|
void parseUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet);
|
26
|
-
void
|
26
|
+
void rebuildUnistyleWithVariants(jsi::Runtime& rt, std::shared_ptr<core::UnistyleData> unistyleData);
|
27
27
|
void rebuildUnistylesInDependencyMap(jsi::Runtime& rt, core::DependencyMap& dependencyMap, std::vector<std::shared_ptr<core::StyleSheet>>& styleSheets, std::optional<UnistylesNativeMiniRuntime> maybeMiniRuntime);
|
28
28
|
void rebuildShadowLeafUpdates(jsi::Runtime& rt, core::DependencyMap& dependencyMap);
|
29
29
|
folly::dynamic parseStylesToShadowTreeStyles(jsi::Runtime& rt, const std::vector<std::shared_ptr<UnistyleData>>& unistyles);
|
30
30
|
void rebuildUnistyle(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, Unistyle::Shared unistyle, const Variants& variants, std::optional<std::vector<folly::dynamic>>);
|
31
|
+
void rebuildUnistyleWithScopedTheme(jsi::Runtime& rt, jsi::Value& jsScopedTheme, std::shared_ptr<core::UnistyleData> unistyleData);
|
32
|
+
jsi::Value getParsedStyleSheetForScopedTheme(jsi::Runtime& rt, core::Unistyle::Shared unistyle, std::string& scopedTheme);
|
31
33
|
|
32
34
|
private:
|
33
35
|
jsi::Object unwrapStyleSheet(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, std::optional<UnistylesNativeMiniRuntime>);
|
@@ -54,8 +54,8 @@ __weak RCTSurfacePresenter* _surfacePresenter;
|
|
54
54
|
HybridObjectRegistry::registerHybridObjectConstructor("UnistylesStyleSheet", [styleSheet]() -> std::shared_ptr<HybridObject>{
|
55
55
|
return styleSheet;
|
56
56
|
});
|
57
|
-
HybridObjectRegistry::registerHybridObjectConstructor("UnistylesShadowRegistry", []() -> std::shared_ptr<HybridObject>{
|
58
|
-
return std::make_shared<HybridShadowRegistry>();
|
57
|
+
HybridObjectRegistry::registerHybridObjectConstructor("UnistylesShadowRegistry", [unistylesRuntime]() -> std::shared_ptr<HybridObject>{
|
58
|
+
return std::make_shared<HybridShadowRegistry>(unistylesRuntime);
|
59
59
|
});
|
60
60
|
}
|
61
61
|
|
@@ -0,0 +1,36 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.ScopedTheme = void 0;
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
8
|
+
var _specs = require("../specs");
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
12
|
+
const Apply = ({
|
13
|
+
name
|
14
|
+
}) => {
|
15
|
+
_specs.UnistylesShadowRegistry.setScopedTheme(name);
|
16
|
+
(0, _react.useLayoutEffect)(() => {
|
17
|
+
_specs.UnistylesShadowRegistry.setScopedTheme(name);
|
18
|
+
});
|
19
|
+
return null;
|
20
|
+
};
|
21
|
+
const ScopedTheme = ({
|
22
|
+
name,
|
23
|
+
children
|
24
|
+
}) => {
|
25
|
+
const previousScopedTheme = _specs.UnistylesShadowRegistry.getScopedTheme();
|
26
|
+
const mappedChildren = [/*#__PURE__*/(0, _jsxRuntime.jsx)(Apply, {
|
27
|
+
name: name
|
28
|
+
}, name), children, /*#__PURE__*/(0, _jsxRuntime.jsx)(Apply, {
|
29
|
+
name: previousScopedTheme
|
30
|
+
}, 'dispose')];
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
|
32
|
+
children: mappedChildren
|
33
|
+
});
|
34
|
+
};
|
35
|
+
exports.ScopedTheme = ScopedTheme;
|
36
|
+
//# sourceMappingURL=ScopedTheme.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_specs","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Apply","name","UnistylesShadowRegistry","setScopedTheme","useLayoutEffect","ScopedTheme","children","previousScopedTheme","getScopedTheme","mappedChildren","jsx","Fragment","exports"],"sourceRoot":"../../../src","sources":["components/ScopedTheme.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAAkD,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAMlD,MAAMW,KAAK,GAAGA,CAAC;EAAEC;AAAuC,CAAC,KAAK;EAC1DC,8BAAuB,CAACC,cAAc,CAACF,IAAI,CAAC;EAE5C,IAAAG,sBAAe,EAAC,MAAM;IAClBF,8BAAuB,CAACC,cAAc,CAACF,IAAI,CAAC;EAChD,CAAC,CAAC;EAEF,OAAO,IAAI;AACf,CAAC;AAEM,MAAMI,WAAyE,GAAGA,CAAC;EAAEJ,IAAI;EAAEK;AAAS,CAAC,KAAK;EAC7G,MAAMC,mBAAmB,GAAGL,8BAAuB,CAACM,cAAc,CAAC,CAAC;EACpE,MAAMC,cAAc,GAAG,cACnB,IAAA9B,WAAA,CAAA+B,GAAA,EAACV,KAAK;IAAYC,IAAI,EAAEA;EAAK,GAAjBA,IAAmB,CAAC,EAChCK,QAAQ,eACR,IAAA3B,WAAA,CAAA+B,GAAA,EAACV,KAAK;IAAeC,IAAI,EAAEM;EAAoB,GAApC,SAAsC,CAAC,CACrD;EAED,oBACI,IAAA5B,WAAA,CAAA+B,GAAA,EAACnC,MAAA,CAAAW,OAAK,CAACyB,QAAQ;IAAAL,QAAA,EACVG;EAAc,CACH,CAAC;AAEzB,CAAC;AAAAG,OAAA,CAAAP,WAAA,GAAAA,WAAA","ignoreList":[]}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.Variants = void 0;
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
8
|
+
var _specs = require("../specs");
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
12
|
+
const Apply = ({
|
13
|
+
variants
|
14
|
+
}) => {
|
15
|
+
_specs.UnistylesShadowRegistry.selectVariants(variants);
|
16
|
+
(0, _react.useLayoutEffect)(() => {
|
17
|
+
_specs.UnistylesShadowRegistry.selectVariants(variants);
|
18
|
+
});
|
19
|
+
return null;
|
20
|
+
};
|
21
|
+
const Variants = ({
|
22
|
+
variants,
|
23
|
+
children
|
24
|
+
}) => {
|
25
|
+
const mappedChildren = [/*#__PURE__*/(0, _jsxRuntime.jsx)(Apply, {
|
26
|
+
variants: variants
|
27
|
+
}, 'add'), children, /*#__PURE__*/(0, _jsxRuntime.jsx)(Apply, {}, 'remove')];
|
28
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
|
29
|
+
children: mappedChildren
|
30
|
+
});
|
31
|
+
};
|
32
|
+
exports.Variants = Variants;
|
33
|
+
//# sourceMappingURL=Variants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_specs","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Apply","variants","UnistylesShadowRegistry","selectVariants","useLayoutEffect","Variants","children","mappedChildren","jsx","Fragment","exports"],"sourceRoot":"../../../src","sources":["components/Variants.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAAkD,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAMlD,MAAMW,KAA4C,GAAGA,CAAC;EAAEC;AAAS,CAAC,KAAK;EACnEC,8BAAuB,CAACC,cAAc,CAACF,QAAQ,CAAC;EAEhD,IAAAG,sBAAe,EAAC,MAAM;IAClBF,8BAAuB,CAACC,cAAc,CAACF,QAAQ,CAAC;EACpD,CAAC,CAAC;EAEF,OAAO,IAAI;AACf,CAAC;AACM,MAAMI,QAAwE,GAAGA,CAAC;EAAEJ,QAAQ;EAAEK;AAAS,CAAC,KAAK;EAChH,MAAMC,cAAc,GAAG,cACnB,IAAA5B,WAAA,CAAA6B,GAAA,EAACR,KAAK;IAAWC,QAAQ,EAAEA;EAAS,GAAzB,KAA2B,CAAC,EACvCK,QAAQ,eACR,IAAA3B,WAAA,CAAA6B,GAAA,EAACR,KAAK,MAAK,QAAU,CAAC,CACzB;EAED,oBACI,IAAArB,WAAA,CAAA6B,GAAA,EAACjC,MAAA,CAAAW,OAAK,CAACuB,QAAQ;IAAAH,QAAA,EACVC;EAAc,CACH,CAAC;AAEzB,CAAC;AAAAG,OAAA,CAAAL,QAAA,GAAAA,QAAA","ignoreList":[]}
|
@@ -15,13 +15,20 @@ Object.defineProperty(exports, "Hide", {
|
|
15
15
|
return _Hide.Hide;
|
16
16
|
}
|
17
17
|
});
|
18
|
-
Object.defineProperty(exports, "
|
18
|
+
Object.defineProperty(exports, "ScopedTheme", {
|
19
19
|
enumerable: true,
|
20
20
|
get: function () {
|
21
|
-
return
|
21
|
+
return _ScopedTheme.ScopedTheme;
|
22
|
+
}
|
23
|
+
});
|
24
|
+
Object.defineProperty(exports, "Variants", {
|
25
|
+
enumerable: true,
|
26
|
+
get: function () {
|
27
|
+
return _Variants.Variants;
|
22
28
|
}
|
23
29
|
});
|
24
30
|
var _Hide = require("./Hide");
|
25
31
|
var _Display = require("./Display");
|
26
|
-
var
|
32
|
+
var _Variants = require("./Variants");
|
33
|
+
var _ScopedTheme = require("./ScopedTheme");
|
27
34
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_Hide","require","_Display","
|
1
|
+
{"version":3,"names":["_Hide","require","_Display","_Variants","_ScopedTheme"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA","ignoreList":[]}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.ActivityIndicator = void 0;
|
7
|
+
var _reactNative = require("react-native");
|
8
|
+
var _core = require("../../core");
|
9
|
+
const ActivityIndicator = exports.ActivityIndicator = (0, _core.createUnistylesElement)(_reactNative.ActivityIndicator);
|
10
|
+
//# sourceMappingURL=ActivityIndicator.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_core","ActivityIndicator","exports","createUnistylesElement","NativeActivityIndicator"],"sourceRoot":"../../../../src","sources":["components/native/ActivityIndicator.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAAE,4BAAsB,EAACC,8BAAuB,CAAC","ignoreList":[]}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.FlatList = void 0;
|
7
|
+
var _reactNative = require("react-native");
|
8
|
+
var _core = require("../../core");
|
9
|
+
const FlatList = exports.FlatList = (0, _core.createUnistylesElement)(_reactNative.FlatList);
|
10
|
+
//# sourceMappingURL=FlatList.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_core","FlatList","exports","createUnistylesElement","NativeFlatList"],"sourceRoot":"../../../../src","sources":["components/native/FlatList.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAG,IAAAE,4BAAsB,EAACC,qBAAc,CAAC","ignoreList":[]}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.Image = void 0;
|
7
|
+
var _reactNative = require("react-native");
|
8
|
+
var _core = require("../../core");
|
9
|
+
const Image = exports.Image = (0, _core.createUnistylesElement)(_reactNative.Image);
|
10
|
+
//# sourceMappingURL=Image.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_core","Image","exports","createUnistylesElement","NativeImage"],"sourceRoot":"../../../../src","sources":["components/native/Image.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,KAAK,GAAAC,OAAA,CAAAD,KAAA,GAAG,IAAAE,4BAAsB,EAACC,kBAAW,CAAC","ignoreList":[]}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.ImageBackground = void 0;
|
7
|
+
var _reactNative = require("react-native");
|
8
|
+
var _core = require("../../core");
|
9
|
+
const ImageBackground = exports.ImageBackground = (0, _core.createUnistylesImageBackground)(_reactNative.ImageBackground);
|
10
|
+
//# sourceMappingURL=ImageBackground.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_core","ImageBackground","exports","createUnistylesImageBackground","NativeImageBackground"],"sourceRoot":"../../../../src","sources":["components/native/ImageBackground.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,IAAAE,oCAA8B,EAACC,4BAAqB,CAAC","ignoreList":[]}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.KeyboardAvoidingView = void 0;
|
7
|
+
var _reactNative = require("react-native");
|
8
|
+
var _core = require("../../core");
|
9
|
+
const KeyboardAvoidingView = exports.KeyboardAvoidingView = (0, _core.createUnistylesElement)(_reactNative.KeyboardAvoidingView);
|
10
|
+
//# sourceMappingURL=KeyboardAvoidingView.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_core","KeyboardAvoidingView","exports","createUnistylesElement","NativeKeyboardAvoidingView"],"sourceRoot":"../../../../src","sources":["components/native/KeyboardAvoidingView.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,IAAAE,4BAAsB,EAACC,iCAA0B,CAAC","ignoreList":[]}
|